tinymce.dom.ScriptLoader

Namespace tinymce.dom
Class ScriptLoader
This class handles asynchronous/synchronous loading of JavaScript files it will execute callbacks when various items gets loaded. This class is useful to

Public Methods

Method Defined By
ScriptLoader(s:Object)
Constructs a new script loaded instance.
ScriptLoader
add(u:String, cb:function, s:Object, pr:Boolean):object
Adds a specific script to the load queue of the script loader.
ScriptLoader
eval(Script:string):void
Evaluates the specified string inside the global namespace/window scope.
ScriptLoader
isDone(u:String):void
Returns true/false if a script has been loaded or not.
ScriptLoader
load(u:String, cb:function, s:Object):void
Loads a specific script directly without adding it to the load queue.
ScriptLoader
loadQueue(cb:function, s:Object):void
Starts the loading of the queue.
ScriptLoader
loadScript(u:string, cb:function):void
[static] Loads the specified script without adding it to any load queue.
ScriptLoader
loadScripts(sc:Array, cb:function, s:Object):void
Loads the specified queue of files and executes the callback ones they are loaded.
ScriptLoader
markDone(u:string):void
Marks a specific script to be loaded.
ScriptLoader

Method details

ScriptLoaderconstructor

public function ScriptLoader(s:Object)
Constructs a new script loaded instance. Check the Wiki for more detailed information for this method.

Parameters

s:Object Optional settings object for the ScriptLoaded.

addmethod

public function add(u:String, cb:function, s:Object, pr:Boolean):object
Adds a specific script to the load queue of the script loader.

Parameters

u:String Absolute URL to script to add.
cb:function Optional callback function to execute ones this script gets loaded.
s:Object Optional scope to execute callback in.
pr:Boolean Optional state to add to top or bottom of load queue. Defaults to bottom.

Returns

object - Load queue object contains, state, url and callback.

evalmethod

public function eval(Script:string):void
Evaluates the specified string inside the global namespace/window scope.

Parameters

Script:string contents to evaluate.

isDonemethod

public function isDone(u:String):void
Returns true/false if a script has been loaded or not.

Parameters

u:String URL to check for.

loadmethod

public function load(u:String, cb:function, s:Object):void
Loads a specific script directly without adding it to the load queue.

Parameters

u:String Absolute URL to script to add.
cb:function Optional callback function to execute ones this script gets loaded.
s:Object Optional scope to execute callback in.

loadQueuemethod

public function loadQueue(cb:function, s:Object):void
Starts the loading of the queue.

Parameters

cb:function Optional callback to execute when all queued items are loaded.
s:Object Optional scope to execute the callback in.

loadScriptmethod

public static function loadScript(u:string, cb:function):void
Loads the specified script without adding it to any load queue.

Parameters

u:string URL to dynamically load.
cb:function Callback function to executed on load.

loadScriptsmethod

public function loadScripts(sc:Array, cb:function, s:Object):void
Loads the specified queue of files and executes the callback ones they are loaded. This method is generally not used outside this class but it might be useful in some scenarios.

Parameters

sc:Array Array of queue items to load.
cb:function Optional callback to execute ones all items are loaded.
s:Object Optional scope to execute callback in.

markDonemethod

public function markDone(u:string):void
Marks a specific script to be loaded. This can be useful if a script got loaded outside the script loader or to skip it from loading some script.

Parameters

u:string Absolute URL to the script to mark as loaded.