Apache-SdnFw
view release on metacpan or search on metacpan
lib/Apache/SdnFw/js/tinymce/jscripts/tiny_mce/tiny_mce_src.js view on Meta::CPAN
};
this.isDone = function(url) {
return states[url] == LOADED;
};
this.markDone = function(url) {
states[url] = LOADED;
};
this.add = this.load = function(url, callback, scope) {
var item, state = states[url];
// Add url to load queue
if (state == undefined) {
queue.push(url);
states[url] = QUEUED;
}
if (callback) {
// Store away callback for later execution
if (!scriptLoadedCallbacks[url])
scriptLoadedCallbacks[url] = [];
scriptLoadedCallbacks[url].push({
func : callback,
scope : scope || this
});
}
};
this.loadQueue = function(callback, scope) {
this.loadScripts(queue, callback, scope);
};
this.loadScripts = function(scripts, callback, scope) {
var loadScripts;
function execScriptLoadedCallbacks(url) {
// Execute URL callback functions
tinymce.each(scriptLoadedCallbacks[url], function(callback) {
callback.func.call(callback.scope);
});
scriptLoadedCallbacks[url] = undefined;
};
queueLoadedCallbacks.push({
func : callback,
scope : scope || this
});
loadScripts = function() {
var loadingScripts = tinymce.grep(scripts);
// Current scripts has been handled
scripts.length = 0;
// Load scripts that needs to be loaded
tinymce.each(loadingScripts, function(url) {
// Script is already loaded then execute script callbacks directly
if (states[url] == LOADED) {
execScriptLoadedCallbacks(url);
return;
}
// Is script not loading then start loading it
if (states[url] != LOADING) {
states[url] = LOADING;
loading++;
loadScript(url, function() {
states[url] = LOADED;
loading--;
execScriptLoadedCallbacks(url);
// Load more scripts if they where added by the recently loaded script
loadScripts();
});
}
});
// No scripts are currently loading then execute all pending queue loaded callbacks
if (!loading) {
tinymce.each(queueLoadedCallbacks, function(callback) {
callback.func.call(callback.scope);
});
queueLoadedCallbacks.length = 0;
}
};
loadScripts();
};
};
// Global script loader
tinymce.ScriptLoader = new tinymce.dom.ScriptLoader();
})(tinymce);
tinymce.dom.TreeWalker = function(start_node, root_node) {
var node = start_node;
function findSibling(node, start_name, sibling_name, shallow) {
var sibling, parent;
if (node) {
// Walk into nodes if it has a start
if (!shallow && node[start_name])
return node[start_name];
// Return the sibling if it has one
if (node != root_node) {
sibling = node[sibling_name];
if (sibling)
return sibling;
// Walk up the parents to look for siblings
for (parent = node.parentNode; parent && parent != root_node; parent = parent.parentNode) {
sibling = parent[sibling_name];
if (sibling)
return sibling;
}
}
}
};
this.current = function() {
return node;
};
this.next = function(shallow) {
return (node = findSibling(node, 'firstChild', 'nextSibling', shallow));
};
this.prev = function(shallow) {
return (node = findSibling(node, 'lastChild', 'lastSibling', shallow));
};
};
(function() {
var transitional = {};
( run in 1.053 second using v1.01-cache-2.11-cpan-39bf76dae61 )