rem
stringlengths 0
126k
| add
stringlengths 0
441k
| context
stringlengths 15
136k
|
---|---|---|
var result = {}; | result = {}; | function handleLoad() { GM_log("> ScriptDownloader.handleLoad"); closeDownloadManager(); // validate that we downloaded ok if (!targetFile.exists() || targetFile.fileSize == 0) { alert("The file does not exist or was removed."); GM_log("* downloaded file not found, exiting"); return; } // initialize a new script object var script = new Script(); script.filename = targetFile.leafName; script.enabled = true; script.includes = []; script.excludes = []; // crack open the file so we can look for metadata in the comments var fileStream = getLineStream(targetFile); // read one line at a time looking for start meta delimiter or EOF var lineStream = fileStream.QueryInterface(Components.interfaces.nsILineInputStream); var result = {}; var foundMeta = false; while (lineStream.readLine(result)) { if (result.value.indexOf("// ==UserScript==") == 0) { GM_log("* found metadata"); foundMeta = true; break; } } // gather up meta lines if (foundMeta) { while (lineStream.readLine(result)) { if (result.value.indexOf("// ==/UserScript==") == 0) { break; } var match = result.value.match(/\/\/ \@(\S+)\s+([^\n]+)/); if (match != null) { switch (match[1]) { case "name": case "namespace": case "description": script[match[1]] = match[2]; break; case "include": case "exclude": script[match[1]+"s"].push(match[2]); break; } } } } fileStream.close(); // if no meta info, default to reasonable values if (script.name == null) { script.name = parseScriptName(sourceUri); } if (script.namespace == null) { script.namespace = sourceUri.host; } if (script.includes.length == 0) { script.includes.push("*"); } // open install dialog var result = {}; GM_log("* opening install dialog"); window.openDialog("chrome://greasemonkey/content/install.xul", "manager", "resizable,centerscreen,modal", script, targetFile, result); if (result.value) { alert("Success! Refresh page to see changes."); } GM_log("< ScriptDownloader.handleLoad"); } |
case "includes": case "excludes": script[match[1]].push(match[2]); | case "include": case "exclude": script[match[1]+"s"].push(match[2]); | function handleLoad() { closeDownloadManager(); // validate that we downloaded ok if (!targetFile.exists() || targetFile.fileSize == 0) { alert("The file does not exist or was removed."); return; } // initialize a new script object var script = new Script(); script.id = targetFile.leafName; script.enabled = true; script.includes = []; script.excludes = []; // crack open the file so we can look for metadata in the comments var fileStream = Components.classes["@mozilla.org/network/file-input-stream;1"] .createInstance(Components.interfaces.nsIFileInputStream); fileStream.init(targetFile, 1, 0, false); // read one line at a time looking for start meta delimiter or EOF var lineStream = fileStream.QueryInterface(Components.interfaces.nsILineInputStream); var result = {}; var foundMeta = false; while (lineStream.readLine(result)) { if (result.value.indexOf("// ==UserScript==") == 0) { foundMeta = true; break; } } // gather up meta lines if (foundMeta) { while (lineStream.readLine(result)) { if (result.value.indexOf("// ==/UserScript==") == 0) { break; } var match = result.value.match(/\/\/ \@(\S+)\s+([^\n]+)/); if (match != null) { switch (match[1]) { case "name": case "namespace": case "description": script[match[1]] = match[2]; break; case "includes": case "excludes": script[match[1]].push(match[2]); break; } } } } fileStream.close(); // if no meta info, default to reasonable values if (script.name == null) { script.name = parseScriptName(sourceUri); } if (script.namespace == null) { script.namespace = sourceUri.host; } if (script.includes.length == 0) { script.includes.push("*"); } // open install dialog var result = {}; window.openDialog("chrome://greasemonkey/content/install.xul", "manager", "resizable,centerscreen,modal", script, targetFile, result); closeDownloadManager(); if (result.value) { alert("Success! Refresh page to see changes."); } } |
closeDownloadManager(); | function handleLoad() { closeDownloadManager(); // validate that we downloaded ok if (!targetFile.exists() || targetFile.fileSize == 0) { alert("The file does not exist or was removed."); return; } // initialize a new script object var script = new Script(); script.filename = targetFile.leafName; script.enabled = true; script.includes = []; script.excludes = []; // crack open the file so we can look for metadata in the comments var fileStream = getLineStream(targetFile); // read one line at a time looking for start meta delimiter or EOF var lineStream = fileStream.QueryInterface(Components.interfaces.nsILineInputStream); var result = {}; var foundMeta = false; while (lineStream.readLine(result)) { if (result.value.indexOf("// ==UserScript==") == 0) { foundMeta = true; break; } } // gather up meta lines if (foundMeta) { while (lineStream.readLine(result)) { if (result.value.indexOf("// ==/UserScript==") == 0) { break; } var match = result.value.match(/\/\/ \@(\S+)\s+([^\n]+)/); if (match != null) { switch (match[1]) { case "name": case "namespace": case "description": script[match[1]] = match[2]; break; case "include": case "exclude": script[match[1]+"s"].push(match[2]); break; } } } } fileStream.close(); // if no meta info, default to reasonable values if (script.name == null) { script.name = parseScriptName(sourceUri); } if (script.namespace == null) { script.namespace = sourceUri.host; } if (script.includes.length == 0) { script.includes.push("*"); } // open install dialog var result = {}; window.openDialog("chrome://greasemonkey/content/install.xul", "manager", "resizable,centerscreen,modal", script, targetFile, result); closeDownloadManager(); if (result.value) { alert("Success! Refresh page to see changes."); } } |
|
if (getAttrib(path[i], 'href') != "") { | if (path[i].nodeName == 'A' && getAttrib(path[i], 'href') != "") { | handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection, setup_content) { function selectByValue(select_elm, value, first_index) { first_index = typeof(first_index) == "undefined" ? false : true; if (select_elm) { for (var i=0; i<select_elm.options.length; i++) { var ov = "" + select_elm.options[i].value; if (first_index && ov.toLowerCase().indexOf(value.toLowerCase()) == 0) { select_elm.selectedIndex = i; return true; } if (ov == value) { select_elm.selectedIndex = i; return true; } } } return false; }; function getAttrib(elm, name) { return elm.getAttribute(name) ? elm.getAttribute(name) : ""; }; // No node provided if (node == null) return; // Update path var pathElm = document.getElementById(editor_id + "_path"); var inst = tinyMCE.getInstanceById(editor_id); var doc = inst.getDoc(); if (pathElm) { // Get node path var parentNode = node; var path = new Array(); while (parentNode != null) { if (parentNode.nodeName.toUpperCase() == "BODY") { break; } // Only append element nodes to path if (parentNode.nodeType == 1 && tinyMCE.getAttrib(parentNode, "class").indexOf('mceItemHidden') == -1) { path[path.length] = parentNode; } parentNode = parentNode.parentNode; } // Setup HTML var html = ""; for (var i=path.length-1; i>=0; i--) { var nodeName = path[i].nodeName.toLowerCase(); var nodeData = ""; if (nodeName == "b") { nodeName = "strong"; } if (nodeName == "i") { nodeName = "em"; } if (nodeName == "span") { var cn = tinyMCE.getAttrib(path[i], "class"); if (cn != "" && cn.indexOf('mceItem') == -1) nodeData += "class: " + cn + " "; var st = tinyMCE.getAttrib(path[i], "style"); if (st != "") { st = tinyMCE.serializeStyle(tinyMCE.parseStyle(st)); nodeData += "style: " + st + " "; } } if (nodeName == "font") { if (tinyMCE.getParam("convert_fonts_to_spans")) nodeName = "span"; var face = tinyMCE.getAttrib(path[i], "face"); if (face != "") nodeData += "font: " + face + " "; var size = tinyMCE.getAttrib(path[i], "size"); if (size != "") nodeData += "size: " + size + " "; var color = tinyMCE.getAttrib(path[i], "color"); if (color != "") nodeData += "color: " + color + " "; } if (getAttrib(path[i], 'id') != "") { nodeData += "id: " + path[i].getAttribute('id') + " "; } var className = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i], "class"), false); if (className != "" && className.indexOf('mceItem') == -1) nodeData += "class: " + className + " "; if (getAttrib(path[i], 'src') != "") { var src = tinyMCE.getAttrib(path[i], "mce_src"); if (src == "") src = tinyMCE.getAttrib(path[i], "src"); nodeData += "src: " + src + " "; } if (getAttrib(path[i], 'href') != "") { var href = tinyMCE.getAttrib(path[i], "mce_href"); if (href == "") href = tinyMCE.getAttrib(path[i], "href"); nodeData += "href: " + href + " "; } if (nodeName == "img" && tinyMCE.getAttrib(path[i], "class").indexOf('mceItemFlash') != -1) { nodeName = "flash"; nodeData = "src: " + path[i].getAttribute('title'); } if (nodeName == "a" && (anchor = tinyMCE.getAttrib(path[i], "name")) != "") { nodeName = "a"; nodeName += "#" + anchor; nodeData = ""; } if (getAttrib(path[i], 'name').indexOf("mce_") != 0) { var className = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i], "class"), false); if (className != "" && className.indexOf('mceItem') == -1) { nodeName += "." + className; } } var cmd = 'tinyMCE.execInstanceCommand(\'' + editor_id + '\',\'mceSelectNodeDepth\',false,\'' + i + '\');'; html += '<a title="' + nodeData + '" href="javascript:' + cmd + '" onclick="' + cmd + 'return false;" onmousedown="return false;" target="_self" class="mcePathItem">' + nodeName + '</a>'; if (i > 0) { html += " » "; } } pathElm.innerHTML = '<a href="#" accesskey="x"></a>' + tinyMCE.getLang('lang_theme_path') + ": " + html + ' '; } // Reset old states tinyMCE.switchClass(editor_id + '_justifyleft', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_justifyright', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_justifycenter', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_justifyfull', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_bold', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_italic', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_underline', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_strikethrough', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_bullist', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_numlist', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_sub', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_sup', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_anchor', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_link', 'mceButtonDisabled'); tinyMCE.switchClass(editor_id + '_unlink', 'mceButtonDisabled'); tinyMCE.switchClass(editor_id + '_outdent', 'mceButtonDisabled'); tinyMCE.switchClass(editor_id + '_image', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_hr', 'mceButtonNormal'); if (node.nodeName == "A" && tinyMCE.getAttrib(node, "class").indexOf('mceItemAnchor') != -1) tinyMCE.switchClass(editor_id + '_anchor', 'mceButtonSelected'); // Get link var anchorLink = tinyMCE.getParentElement(node, "a", "href"); if (anchorLink || any_selection) { tinyMCE.switchClass(editor_id + '_link', anchorLink ? 'mceButtonSelected' : 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_unlink', anchorLink ? 'mceButtonSelected' : 'mceButtonNormal'); } // Handle visual aid tinyMCE.switchClass(editor_id + '_visualaid', visual_aid ? 'mceButtonSelected' : 'mceButtonNormal'); if (undo_levels != -1) { tinyMCE.switchClass(editor_id + '_undo', 'mceButtonDisabled'); tinyMCE.switchClass(editor_id + '_redo', 'mceButtonDisabled'); } // Within li, blockquote if (tinyMCE.getParentElement(node, "li,blockquote")) tinyMCE.switchClass(editor_id + '_outdent', 'mceButtonNormal'); // Has redo levels if (undo_index != -1 && (undo_index < undo_levels-1 && undo_levels > 0)) tinyMCE.switchClass(editor_id + '_redo', 'mceButtonNormal'); // Has undo levels if (undo_index != -1 && (undo_index > 0 && undo_levels > 0)) tinyMCE.switchClass(editor_id + '_undo', 'mceButtonNormal'); // Select class in select box var selectElm = document.getElementById(editor_id + "_styleSelect"); if (selectElm) { TinyMCE_AdvancedTheme._setupCSSClasses(editor_id); classNode = node; breakOut = false; var index = 0; do { if (classNode && classNode.className) { for (var i=0; i<selectElm.options.length; i++) { if (selectElm.options[i].value == classNode.className) { index = i; breakOut = true; break; } } } } while (!breakOut && classNode != null && (classNode = classNode.parentNode) != null); selectElm.selectedIndex = index; } // Select formatblock var selectElm = document.getElementById(editor_id + "_formatSelect"); if (selectElm) { var elm = tinyMCE.getParentElement(node, "p,div,h1,h2,h3,h4,h5,h6,pre,address"); if (elm) selectByValue(selectElm, "<" + elm.nodeName.toLowerCase() + ">"); else selectByValue(selectElm, ""); } // Select fontselect var selectElm = document.getElementById(editor_id + "_fontNameSelect"); if (selectElm) { if (!tinyMCE.isSafari && !(tinyMCE.isMSIE && !tinyMCE.isOpera)) { var face = inst.queryCommandValue('FontName'); face = face == null || face == "" ? "" : face; selectByValue(selectElm, face, face != ""); } else { var elm = tinyMCE.getParentElement(node, "font", "face"); if (elm) { var family = tinyMCE.getAttrib(elm, "face"); if (family == '') family = '' + elm.style.fontFamily; if (!selectByValue(selectElm, family, family != "")) selectByValue(selectElm, ""); } else selectByValue(selectElm, ""); } } // Select fontsize var selectElm = document.getElementById(editor_id + "_fontSizeSelect"); if (selectElm) { if (!tinyMCE.isSafari && !tinyMCE.isOpera) { var size = inst.queryCommandValue('FontSize'); selectByValue(selectElm, size == null || size == "" ? "0" : size); } else { var elm = tinyMCE.getParentElement(node, "font", "size"); if (elm) { var size = tinyMCE.getAttrib(elm, "size"); if (size == '') { var sizes = new Array('', '8px', '10px', '12px', '14px', '18px', '24px', '36px'); size = '' + elm.style.fontSize; for (var i=0; i<sizes.length; i++) { if (('' + sizes[i]) == size) { size = i; break; } } } if (!selectByValue(selectElm, size)) selectByValue(selectElm, ""); } else selectByValue(selectElm, "0"); } } // Handle align attributes alignNode = node; breakOut = false; do { if (!alignNode.getAttribute || !alignNode.getAttribute('align')) continue; switch (alignNode.getAttribute('align').toLowerCase()) { case "left": tinyMCE.switchClass(editor_id + '_justifyleft', 'mceButtonSelected'); breakOut = true; break; case "right": tinyMCE.switchClass(editor_id + '_justifyright', 'mceButtonSelected'); breakOut = true; break; case "middle": case "center": tinyMCE.switchClass(editor_id + '_justifycenter', 'mceButtonSelected'); breakOut = true; break; case "justify": tinyMCE.switchClass(editor_id + '_justifyfull', 'mceButtonSelected'); breakOut = true; break; } } while (!breakOut && (alignNode = alignNode.parentNode) != null); // Div justification var div = tinyMCE.getParentElement(node, "div"); if (div && div.style.textAlign == "center") tinyMCE.switchClass(editor_id + '_justifycenter', 'mceButtonSelected'); // Do special text if (!setup_content) { // , "JustifyLeft", "_justifyleft", "JustifyCenter", "justifycenter", "JustifyRight", "justifyright", "JustifyFull", "justifyfull", "InsertUnorderedList", "bullist", "InsertOrderedList", "numlist", "InsertUnorderedList", "bullist", "Outdent", "outdent", "Indent", "indent", "subscript", "sub" var ar = new Array("Bold", "_bold", "Italic", "_italic", "Strikethrough", "_strikethrough", "superscript", "_sup", "subscript", "_sub"); for (var i=0; i<ar.length; i+=2) { if (inst.queryCommandState(ar[i])) tinyMCE.switchClass(editor_id + ar[i+1], 'mceButtonSelected'); } if (inst.queryCommandState("Underline") && (node.parentNode == null || node.parentNode.nodeName != "A")) tinyMCE.switchClass(editor_id + '_underline', 'mceButtonSelected'); } // Handle elements do { switch (node.nodeName) { case "UL": tinyMCE.switchClass(editor_id + '_bullist', 'mceButtonSelected'); break; case "OL": tinyMCE.switchClass(editor_id + '_numlist', 'mceButtonSelected'); break; case "HR": tinyMCE.switchClass(editor_id + '_hr', 'mceButtonSelected'); break; case "IMG": if (getAttrib(node, 'name').indexOf('mce_') != 0) { tinyMCE.switchClass(editor_id + '_image', 'mceButtonSelected'); } break; } } while ((node = node.parentNode) != null); }, |
if (nodeName == "img" && tinyMCE.getAttrib(path[i], "class").indexOf('mceItemFlash') != -1) { nodeName = "flash"; nodeData = "src: " + path[i].getAttribute('title'); | className = tinyMCE.getAttrib(path[i], "class"); if ((nodeName == "img" || nodeName == "span") && className.indexOf('mceItem') != -1) { nodeName = className.replace(/mceItem([a-z]+)/gi, '$1').toLowerCase(); nodeData = path[i].getAttribute('title'); | handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection, setup_content) { function selectByValue(select_elm, value, first_index) { first_index = typeof(first_index) == "undefined" ? false : true; if (select_elm) { for (var i=0; i<select_elm.options.length; i++) { var ov = "" + select_elm.options[i].value; if (first_index && ov.toLowerCase().indexOf(value.toLowerCase()) == 0) { select_elm.selectedIndex = i; return true; } if (ov == value) { select_elm.selectedIndex = i; return true; } } } return false; }; function getAttrib(elm, name) { return elm.getAttribute(name) ? elm.getAttribute(name) : ""; }; // No node provided if (node == null) return; // Update path var pathElm = document.getElementById(editor_id + "_path"); var inst = tinyMCE.getInstanceById(editor_id); var doc = inst.getDoc(); if (pathElm) { // Get node path var parentNode = node; var path = new Array(); while (parentNode != null) { if (parentNode.nodeName.toUpperCase() == "BODY") { break; } // Only append element nodes to path if (parentNode.nodeType == 1 && tinyMCE.getAttrib(parentNode, "class").indexOf('mceItemHidden') == -1) { path[path.length] = parentNode; } parentNode = parentNode.parentNode; } // Setup HTML var html = ""; for (var i=path.length-1; i>=0; i--) { var nodeName = path[i].nodeName.toLowerCase(); var nodeData = ""; if (nodeName == "b") { nodeName = "strong"; } if (nodeName == "i") { nodeName = "em"; } if (nodeName == "span") { var cn = tinyMCE.getAttrib(path[i], "class"); if (cn != "" && cn.indexOf('mceItem') == -1) nodeData += "class: " + cn + " "; var st = tinyMCE.getAttrib(path[i], "style"); if (st != "") { st = tinyMCE.serializeStyle(tinyMCE.parseStyle(st)); nodeData += "style: " + st + " "; } } if (nodeName == "font") { if (tinyMCE.getParam("convert_fonts_to_spans")) nodeName = "span"; var face = tinyMCE.getAttrib(path[i], "face"); if (face != "") nodeData += "font: " + face + " "; var size = tinyMCE.getAttrib(path[i], "size"); if (size != "") nodeData += "size: " + size + " "; var color = tinyMCE.getAttrib(path[i], "color"); if (color != "") nodeData += "color: " + color + " "; } if (getAttrib(path[i], 'id') != "") { nodeData += "id: " + path[i].getAttribute('id') + " "; } var className = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i], "class"), false); if (className != "" && className.indexOf('mceItem') == -1) nodeData += "class: " + className + " "; if (getAttrib(path[i], 'src') != "") { var src = tinyMCE.getAttrib(path[i], "mce_src"); if (src == "") src = tinyMCE.getAttrib(path[i], "src"); nodeData += "src: " + src + " "; } if (getAttrib(path[i], 'href') != "") { var href = tinyMCE.getAttrib(path[i], "mce_href"); if (href == "") href = tinyMCE.getAttrib(path[i], "href"); nodeData += "href: " + href + " "; } if (nodeName == "img" && tinyMCE.getAttrib(path[i], "class").indexOf('mceItemFlash') != -1) { nodeName = "flash"; nodeData = "src: " + path[i].getAttribute('title'); } if (nodeName == "a" && (anchor = tinyMCE.getAttrib(path[i], "name")) != "") { nodeName = "a"; nodeName += "#" + anchor; nodeData = ""; } if (getAttrib(path[i], 'name').indexOf("mce_") != 0) { var className = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i], "class"), false); if (className != "" && className.indexOf('mceItem') == -1) { nodeName += "." + className; } } var cmd = 'tinyMCE.execInstanceCommand(\'' + editor_id + '\',\'mceSelectNodeDepth\',false,\'' + i + '\');'; html += '<a title="' + nodeData + '" href="javascript:' + cmd + '" onclick="' + cmd + 'return false;" onmousedown="return false;" target="_self" class="mcePathItem">' + nodeName + '</a>'; if (i > 0) { html += " » "; } } pathElm.innerHTML = '<a href="#" accesskey="x"></a>' + tinyMCE.getLang('lang_theme_path') + ": " + html + ' '; } // Reset old states tinyMCE.switchClass(editor_id + '_justifyleft', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_justifyright', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_justifycenter', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_justifyfull', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_bold', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_italic', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_underline', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_strikethrough', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_bullist', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_numlist', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_sub', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_sup', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_anchor', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_link', 'mceButtonDisabled'); tinyMCE.switchClass(editor_id + '_unlink', 'mceButtonDisabled'); tinyMCE.switchClass(editor_id + '_outdent', 'mceButtonDisabled'); tinyMCE.switchClass(editor_id + '_image', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_hr', 'mceButtonNormal'); if (node.nodeName == "A" && tinyMCE.getAttrib(node, "class").indexOf('mceItemAnchor') != -1) tinyMCE.switchClass(editor_id + '_anchor', 'mceButtonSelected'); // Get link var anchorLink = tinyMCE.getParentElement(node, "a", "href"); if (anchorLink || any_selection) { tinyMCE.switchClass(editor_id + '_link', anchorLink ? 'mceButtonSelected' : 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_unlink', anchorLink ? 'mceButtonSelected' : 'mceButtonNormal'); } // Handle visual aid tinyMCE.switchClass(editor_id + '_visualaid', visual_aid ? 'mceButtonSelected' : 'mceButtonNormal'); if (undo_levels != -1) { tinyMCE.switchClass(editor_id + '_undo', 'mceButtonDisabled'); tinyMCE.switchClass(editor_id + '_redo', 'mceButtonDisabled'); } // Within li, blockquote if (tinyMCE.getParentElement(node, "li,blockquote")) tinyMCE.switchClass(editor_id + '_outdent', 'mceButtonNormal'); // Has redo levels if (undo_index != -1 && (undo_index < undo_levels-1 && undo_levels > 0)) tinyMCE.switchClass(editor_id + '_redo', 'mceButtonNormal'); // Has undo levels if (undo_index != -1 && (undo_index > 0 && undo_levels > 0)) tinyMCE.switchClass(editor_id + '_undo', 'mceButtonNormal'); // Select class in select box var selectElm = document.getElementById(editor_id + "_styleSelect"); if (selectElm) { TinyMCE_AdvancedTheme._setupCSSClasses(editor_id); classNode = node; breakOut = false; var index = 0; do { if (classNode && classNode.className) { for (var i=0; i<selectElm.options.length; i++) { if (selectElm.options[i].value == classNode.className) { index = i; breakOut = true; break; } } } } while (!breakOut && classNode != null && (classNode = classNode.parentNode) != null); selectElm.selectedIndex = index; } // Select formatblock var selectElm = document.getElementById(editor_id + "_formatSelect"); if (selectElm) { var elm = tinyMCE.getParentElement(node, "p,div,h1,h2,h3,h4,h5,h6,pre,address"); if (elm) selectByValue(selectElm, "<" + elm.nodeName.toLowerCase() + ">"); else selectByValue(selectElm, ""); } // Select fontselect var selectElm = document.getElementById(editor_id + "_fontNameSelect"); if (selectElm) { if (!tinyMCE.isSafari && !(tinyMCE.isMSIE && !tinyMCE.isOpera)) { var face = inst.queryCommandValue('FontName'); face = face == null || face == "" ? "" : face; selectByValue(selectElm, face, face != ""); } else { var elm = tinyMCE.getParentElement(node, "font", "face"); if (elm) { var family = tinyMCE.getAttrib(elm, "face"); if (family == '') family = '' + elm.style.fontFamily; if (!selectByValue(selectElm, family, family != "")) selectByValue(selectElm, ""); } else selectByValue(selectElm, ""); } } // Select fontsize var selectElm = document.getElementById(editor_id + "_fontSizeSelect"); if (selectElm) { if (!tinyMCE.isSafari && !tinyMCE.isOpera) { var size = inst.queryCommandValue('FontSize'); selectByValue(selectElm, size == null || size == "" ? "0" : size); } else { var elm = tinyMCE.getParentElement(node, "font", "size"); if (elm) { var size = tinyMCE.getAttrib(elm, "size"); if (size == '') { var sizes = new Array('', '8px', '10px', '12px', '14px', '18px', '24px', '36px'); size = '' + elm.style.fontSize; for (var i=0; i<sizes.length; i++) { if (('' + sizes[i]) == size) { size = i; break; } } } if (!selectByValue(selectElm, size)) selectByValue(selectElm, ""); } else selectByValue(selectElm, "0"); } } // Handle align attributes alignNode = node; breakOut = false; do { if (!alignNode.getAttribute || !alignNode.getAttribute('align')) continue; switch (alignNode.getAttribute('align').toLowerCase()) { case "left": tinyMCE.switchClass(editor_id + '_justifyleft', 'mceButtonSelected'); breakOut = true; break; case "right": tinyMCE.switchClass(editor_id + '_justifyright', 'mceButtonSelected'); breakOut = true; break; case "middle": case "center": tinyMCE.switchClass(editor_id + '_justifycenter', 'mceButtonSelected'); breakOut = true; break; case "justify": tinyMCE.switchClass(editor_id + '_justifyfull', 'mceButtonSelected'); breakOut = true; break; } } while (!breakOut && (alignNode = alignNode.parentNode) != null); // Div justification var div = tinyMCE.getParentElement(node, "div"); if (div && div.style.textAlign == "center") tinyMCE.switchClass(editor_id + '_justifycenter', 'mceButtonSelected'); // Do special text if (!setup_content) { // , "JustifyLeft", "_justifyleft", "JustifyCenter", "justifycenter", "JustifyRight", "justifyright", "JustifyFull", "justifyfull", "InsertUnorderedList", "bullist", "InsertOrderedList", "numlist", "InsertUnorderedList", "bullist", "Outdent", "outdent", "Indent", "indent", "subscript", "sub" var ar = new Array("Bold", "_bold", "Italic", "_italic", "Strikethrough", "_strikethrough", "superscript", "_sup", "subscript", "_sub"); for (var i=0; i<ar.length; i+=2) { if (inst.queryCommandState(ar[i])) tinyMCE.switchClass(editor_id + ar[i+1], 'mceButtonSelected'); } if (inst.queryCommandState("Underline") && (node.parentNode == null || node.parentNode.nodeName != "A")) tinyMCE.switchClass(editor_id + '_underline', 'mceButtonSelected'); } // Handle elements do { switch (node.nodeName) { case "UL": tinyMCE.switchClass(editor_id + '_bullist', 'mceButtonSelected'); break; case "OL": tinyMCE.switchClass(editor_id + '_numlist', 'mceButtonSelected'); break; case "HR": tinyMCE.switchClass(editor_id + '_hr', 'mceButtonSelected'); break; case "IMG": if (getAttrib(node, 'name').indexOf('mce_') != 0) { tinyMCE.switchClass(editor_id + '_image', 'mceButtonSelected'); } break; } } while ((node = node.parentNode) != null); }, |
if (getAttrib(node, 'name').indexOf('mce_') != 0) { | if (getAttrib(node, 'name').indexOf('mce_') != 0 && tinyMCE.getAttrib(node, 'class').indexOf('mceItem') == -1) { | handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection, setup_content) { function selectByValue(select_elm, value, first_index) { first_index = typeof(first_index) == "undefined" ? false : true; if (select_elm) { for (var i=0; i<select_elm.options.length; i++) { var ov = "" + select_elm.options[i].value; if (first_index && ov.toLowerCase().indexOf(value.toLowerCase()) == 0) { select_elm.selectedIndex = i; return true; } if (ov == value) { select_elm.selectedIndex = i; return true; } } } return false; }; function getAttrib(elm, name) { return elm.getAttribute(name) ? elm.getAttribute(name) : ""; }; // No node provided if (node == null) return; // Update path var pathElm = document.getElementById(editor_id + "_path"); var inst = tinyMCE.getInstanceById(editor_id); var doc = inst.getDoc(); if (pathElm) { // Get node path var parentNode = node; var path = new Array(); while (parentNode != null) { if (parentNode.nodeName.toUpperCase() == "BODY") { break; } // Only append element nodes to path if (parentNode.nodeType == 1 && tinyMCE.getAttrib(parentNode, "class").indexOf('mceItemHidden') == -1) { path[path.length] = parentNode; } parentNode = parentNode.parentNode; } // Setup HTML var html = ""; for (var i=path.length-1; i>=0; i--) { var nodeName = path[i].nodeName.toLowerCase(); var nodeData = ""; if (nodeName == "b") { nodeName = "strong"; } if (nodeName == "i") { nodeName = "em"; } if (nodeName == "span") { var cn = tinyMCE.getAttrib(path[i], "class"); if (cn != "" && cn.indexOf('mceItem') == -1) nodeData += "class: " + cn + " "; var st = tinyMCE.getAttrib(path[i], "style"); if (st != "") { st = tinyMCE.serializeStyle(tinyMCE.parseStyle(st)); nodeData += "style: " + st + " "; } } if (nodeName == "font") { if (tinyMCE.getParam("convert_fonts_to_spans")) nodeName = "span"; var face = tinyMCE.getAttrib(path[i], "face"); if (face != "") nodeData += "font: " + face + " "; var size = tinyMCE.getAttrib(path[i], "size"); if (size != "") nodeData += "size: " + size + " "; var color = tinyMCE.getAttrib(path[i], "color"); if (color != "") nodeData += "color: " + color + " "; } if (getAttrib(path[i], 'id') != "") { nodeData += "id: " + path[i].getAttribute('id') + " "; } var className = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i], "class"), false); if (className != "" && className.indexOf('mceItem') == -1) nodeData += "class: " + className + " "; if (getAttrib(path[i], 'src') != "") { var src = tinyMCE.getAttrib(path[i], "mce_src"); if (src == "") src = tinyMCE.getAttrib(path[i], "src"); nodeData += "src: " + src + " "; } if (getAttrib(path[i], 'href') != "") { var href = tinyMCE.getAttrib(path[i], "mce_href"); if (href == "") href = tinyMCE.getAttrib(path[i], "href"); nodeData += "href: " + href + " "; } if (nodeName == "img" && tinyMCE.getAttrib(path[i], "class").indexOf('mceItemFlash') != -1) { nodeName = "flash"; nodeData = "src: " + path[i].getAttribute('title'); } if (nodeName == "a" && (anchor = tinyMCE.getAttrib(path[i], "name")) != "") { nodeName = "a"; nodeName += "#" + anchor; nodeData = ""; } if (getAttrib(path[i], 'name').indexOf("mce_") != 0) { var className = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i], "class"), false); if (className != "" && className.indexOf('mceItem') == -1) { nodeName += "." + className; } } var cmd = 'tinyMCE.execInstanceCommand(\'' + editor_id + '\',\'mceSelectNodeDepth\',false,\'' + i + '\');'; html += '<a title="' + nodeData + '" href="javascript:' + cmd + '" onclick="' + cmd + 'return false;" onmousedown="return false;" target="_self" class="mcePathItem">' + nodeName + '</a>'; if (i > 0) { html += " » "; } } pathElm.innerHTML = '<a href="#" accesskey="x"></a>' + tinyMCE.getLang('lang_theme_path') + ": " + html + ' '; } // Reset old states tinyMCE.switchClass(editor_id + '_justifyleft', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_justifyright', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_justifycenter', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_justifyfull', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_bold', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_italic', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_underline', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_strikethrough', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_bullist', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_numlist', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_sub', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_sup', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_anchor', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_link', 'mceButtonDisabled'); tinyMCE.switchClass(editor_id + '_unlink', 'mceButtonDisabled'); tinyMCE.switchClass(editor_id + '_outdent', 'mceButtonDisabled'); tinyMCE.switchClass(editor_id + '_image', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_hr', 'mceButtonNormal'); if (node.nodeName == "A" && tinyMCE.getAttrib(node, "class").indexOf('mceItemAnchor') != -1) tinyMCE.switchClass(editor_id + '_anchor', 'mceButtonSelected'); // Get link var anchorLink = tinyMCE.getParentElement(node, "a", "href"); if (anchorLink || any_selection) { tinyMCE.switchClass(editor_id + '_link', anchorLink ? 'mceButtonSelected' : 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_unlink', anchorLink ? 'mceButtonSelected' : 'mceButtonNormal'); } // Handle visual aid tinyMCE.switchClass(editor_id + '_visualaid', visual_aid ? 'mceButtonSelected' : 'mceButtonNormal'); if (undo_levels != -1) { tinyMCE.switchClass(editor_id + '_undo', 'mceButtonDisabled'); tinyMCE.switchClass(editor_id + '_redo', 'mceButtonDisabled'); } // Within li, blockquote if (tinyMCE.getParentElement(node, "li,blockquote")) tinyMCE.switchClass(editor_id + '_outdent', 'mceButtonNormal'); // Has redo levels if (undo_index != -1 && (undo_index < undo_levels-1 && undo_levels > 0)) tinyMCE.switchClass(editor_id + '_redo', 'mceButtonNormal'); // Has undo levels if (undo_index != -1 && (undo_index > 0 && undo_levels > 0)) tinyMCE.switchClass(editor_id + '_undo', 'mceButtonNormal'); // Select class in select box var selectElm = document.getElementById(editor_id + "_styleSelect"); if (selectElm) { TinyMCE_AdvancedTheme._setupCSSClasses(editor_id); classNode = node; breakOut = false; var index = 0; do { if (classNode && classNode.className) { for (var i=0; i<selectElm.options.length; i++) { if (selectElm.options[i].value == classNode.className) { index = i; breakOut = true; break; } } } } while (!breakOut && classNode != null && (classNode = classNode.parentNode) != null); selectElm.selectedIndex = index; } // Select formatblock var selectElm = document.getElementById(editor_id + "_formatSelect"); if (selectElm) { var elm = tinyMCE.getParentElement(node, "p,div,h1,h2,h3,h4,h5,h6,pre,address"); if (elm) selectByValue(selectElm, "<" + elm.nodeName.toLowerCase() + ">"); else selectByValue(selectElm, ""); } // Select fontselect var selectElm = document.getElementById(editor_id + "_fontNameSelect"); if (selectElm) { if (!tinyMCE.isSafari && !(tinyMCE.isMSIE && !tinyMCE.isOpera)) { var face = inst.queryCommandValue('FontName'); face = face == null || face == "" ? "" : face; selectByValue(selectElm, face, face != ""); } else { var elm = tinyMCE.getParentElement(node, "font", "face"); if (elm) { var family = tinyMCE.getAttrib(elm, "face"); if (family == '') family = '' + elm.style.fontFamily; if (!selectByValue(selectElm, family, family != "")) selectByValue(selectElm, ""); } else selectByValue(selectElm, ""); } } // Select fontsize var selectElm = document.getElementById(editor_id + "_fontSizeSelect"); if (selectElm) { if (!tinyMCE.isSafari && !tinyMCE.isOpera) { var size = inst.queryCommandValue('FontSize'); selectByValue(selectElm, size == null || size == "" ? "0" : size); } else { var elm = tinyMCE.getParentElement(node, "font", "size"); if (elm) { var size = tinyMCE.getAttrib(elm, "size"); if (size == '') { var sizes = new Array('', '8px', '10px', '12px', '14px', '18px', '24px', '36px'); size = '' + elm.style.fontSize; for (var i=0; i<sizes.length; i++) { if (('' + sizes[i]) == size) { size = i; break; } } } if (!selectByValue(selectElm, size)) selectByValue(selectElm, ""); } else selectByValue(selectElm, "0"); } } // Handle align attributes alignNode = node; breakOut = false; do { if (!alignNode.getAttribute || !alignNode.getAttribute('align')) continue; switch (alignNode.getAttribute('align').toLowerCase()) { case "left": tinyMCE.switchClass(editor_id + '_justifyleft', 'mceButtonSelected'); breakOut = true; break; case "right": tinyMCE.switchClass(editor_id + '_justifyright', 'mceButtonSelected'); breakOut = true; break; case "middle": case "center": tinyMCE.switchClass(editor_id + '_justifycenter', 'mceButtonSelected'); breakOut = true; break; case "justify": tinyMCE.switchClass(editor_id + '_justifyfull', 'mceButtonSelected'); breakOut = true; break; } } while (!breakOut && (alignNode = alignNode.parentNode) != null); // Div justification var div = tinyMCE.getParentElement(node, "div"); if (div && div.style.textAlign == "center") tinyMCE.switchClass(editor_id + '_justifycenter', 'mceButtonSelected'); // Do special text if (!setup_content) { // , "JustifyLeft", "_justifyleft", "JustifyCenter", "justifycenter", "JustifyRight", "justifyright", "JustifyFull", "justifyfull", "InsertUnorderedList", "bullist", "InsertOrderedList", "numlist", "InsertUnorderedList", "bullist", "Outdent", "outdent", "Indent", "indent", "subscript", "sub" var ar = new Array("Bold", "_bold", "Italic", "_italic", "Strikethrough", "_strikethrough", "superscript", "_sup", "subscript", "_sub"); for (var i=0; i<ar.length; i+=2) { if (inst.queryCommandState(ar[i])) tinyMCE.switchClass(editor_id + ar[i+1], 'mceButtonSelected'); } if (inst.queryCommandState("Underline") && (node.parentNode == null || node.parentNode.nodeName != "A")) tinyMCE.switchClass(editor_id + '_underline', 'mceButtonSelected'); } // Handle elements do { switch (node.nodeName) { case "UL": tinyMCE.switchClass(editor_id + '_bullist', 'mceButtonSelected'); break; case "OL": tinyMCE.switchClass(editor_id + '_numlist', 'mceButtonSelected'); break; case "HR": tinyMCE.switchClass(editor_id + '_hr', 'mceButtonSelected'); break; case "IMG": if (getAttrib(node, 'name').indexOf('mce_') != 0) { tinyMCE.switchClass(editor_id + '_image', 'mceButtonSelected'); } break; } } while ((node = node.parentNode) != null); }, |
var colspan = "1", rowspan = "1"; | var colspan = "1", rowspan = "1", tdElm; | handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) { var colspan = "1", rowspan = "1"; var inst = tinyMCE.getInstanceById(editor_id); // Reset table controls tinyMCE.switchClass(editor_id + '_table', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_row_props', 'mceButtonDisabled'); tinyMCE.switchClass(editor_id + '_cell_props', 'mceButtonDisabled'); tinyMCE.switchClass(editor_id + '_row_before', 'mceButtonDisabled'); tinyMCE.switchClass(editor_id + '_row_after', 'mceButtonDisabled'); tinyMCE.switchClass(editor_id + '_delete_row', 'mceButtonDisabled'); tinyMCE.switchClass(editor_id + '_col_before', 'mceButtonDisabled'); tinyMCE.switchClass(editor_id + '_col_after', 'mceButtonDisabled'); tinyMCE.switchClass(editor_id + '_delete_col', 'mceButtonDisabled'); tinyMCE.switchClass(editor_id + '_split_cells', 'mceButtonDisabled'); tinyMCE.switchClass(editor_id + '_merge_cells', 'mceButtonDisabled'); // Within a td element if (tdElm = tinyMCE.getParentElement(node, "td,th")) { tinyMCE.switchClass(editor_id + '_cell_props', 'mceButtonSelected'); tinyMCE.switchClass(editor_id + '_row_before', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_row_after', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_delete_row', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_col_before', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_col_after', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_delete_col', 'mceButtonNormal'); colspan = tinyMCE.getAttrib(tdElm, "colspan"); rowspan = tinyMCE.getAttrib(tdElm, "rowspan"); colspan = colspan == "" ? "1" : colspan; rowspan = rowspan == "" ? "1" : rowspan; if (colspan != "1" || rowspan != "1") tinyMCE.switchClass(editor_id + '_split_cells', 'mceButtonNormal'); } // Within a tr element if (tinyMCE.getParentElement(node, "tr")) tinyMCE.switchClass(editor_id + '_row_props', 'mceButtonSelected'); // Within table if (tinyMCE.getParentElement(node, "table")) { tinyMCE.switchClass(editor_id + '_table', 'mceButtonSelected'); tinyMCE.switchClass(editor_id + '_merge_cells', 'mceButtonNormal'); } }, |
tinyMCE.switchClass(editor_id + '_delete_table', 'mceButtonNormal'); | handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) { var colspan = "1", rowspan = "1"; var inst = tinyMCE.getInstanceById(editor_id); // Reset table controls tinyMCE.switchClass(editor_id + '_table', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_row_props', 'mceButtonDisabled'); tinyMCE.switchClass(editor_id + '_cell_props', 'mceButtonDisabled'); tinyMCE.switchClass(editor_id + '_row_before', 'mceButtonDisabled'); tinyMCE.switchClass(editor_id + '_row_after', 'mceButtonDisabled'); tinyMCE.switchClass(editor_id + '_delete_row', 'mceButtonDisabled'); tinyMCE.switchClass(editor_id + '_col_before', 'mceButtonDisabled'); tinyMCE.switchClass(editor_id + '_col_after', 'mceButtonDisabled'); tinyMCE.switchClass(editor_id + '_delete_col', 'mceButtonDisabled'); tinyMCE.switchClass(editor_id + '_split_cells', 'mceButtonDisabled'); tinyMCE.switchClass(editor_id + '_merge_cells', 'mceButtonDisabled'); // Within a td element if (tdElm = tinyMCE.getParentElement(node, "td,th")) { tinyMCE.switchClass(editor_id + '_cell_props', 'mceButtonSelected'); tinyMCE.switchClass(editor_id + '_row_before', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_row_after', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_delete_row', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_col_before', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_col_after', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_delete_col', 'mceButtonNormal'); colspan = tinyMCE.getAttrib(tdElm, "colspan"); rowspan = tinyMCE.getAttrib(tdElm, "rowspan"); colspan = colspan == "" ? "1" : colspan; rowspan = rowspan == "" ? "1" : rowspan; if (colspan != "1" || rowspan != "1") tinyMCE.switchClass(editor_id + '_split_cells', 'mceButtonNormal'); } // Within a tr element if (tinyMCE.getParentElement(node, "tr")) tinyMCE.switchClass(editor_id + '_row_props', 'mceButtonSelected'); // Within table if (tinyMCE.getParentElement(node, "table")) { tinyMCE.switchClass(editor_id + '_table', 'mceButtonSelected'); tinyMCE.switchClass(editor_id + '_merge_cells', 'mceButtonNormal'); } }, |
|
var inst = tinyMCE.getInstanceById(editor_id), self = TinyMCE_LayerPlugin; var le = self._getParentLayer(inst.getFocusElement()); | var inst = tinyMCE.getInstanceById(editor_id); var le = this._getParentLayer(inst.getFocusElement()); | handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) { var inst = tinyMCE.getInstanceById(editor_id), self = TinyMCE_LayerPlugin; var le = self._getParentLayer(inst.getFocusElement()); var p = tinyMCE.getParentElement(inst.getFocusElement(), 'div,p,img'); tinyMCE.switchClass(editor_id + '_absolute', 'mceButtonDisabled'); tinyMCE.switchClass(editor_id + '_moveforward', 'mceButtonDisabled'); tinyMCE.switchClass(editor_id + '_movebackward', 'mceButtonDisabled'); if (p) tinyMCE.switchClass(editor_id + '_absolute', 'mceButtonNormal'); if (le && le.style.position.toLowerCase() == "absolute") { tinyMCE.switchClass(editor_id + '_absolute', 'mceButtonSelected'); tinyMCE.switchClass(editor_id + '_moveforward', 'mceButtonNormal'); tinyMCE.switchClass(editor_id + '_movebackward', 'mceButtonNormal'); } }, |
html+='</td></tr></table>';return{delta_width:0,delta_height:20,html:html};},handleNodeChange:function(editor_id,node){tinyMCE.switchClass(editor_id+'_bold','mceButtonNormal');tinyMCE.switchClass(editor_id+'_italic','mceButtonNormal');tinyMCE.switchClass(editor_id+'_underline','mceButtonNormal');tinyMCE.switchClass(editor_id+'_strikethrough','mceButtonNormal');tinyMCE.switchClass(editor_id+'_bullist','mceButtonNormal');tinyMCE.switchClass(editor_id+'_numlist','mceButtonNormal');do{switch(node.nodeName.toLowerCase()){case"b":case"strong":tinyMCE.switchClass(editor_id+'_bold','mceButtonSelected');break;case"i":case"em":tinyMCE.switchClass(editor_id+'_italic','mceButtonSelected');break;case"u":tinyMCE.switchClass(editor_id+'_underline','mceButtonSelected');break;case"strike":tinyMCE.switchClass(editor_id+'_strikethrough','mceButtonSelected');break;case"ul":tinyMCE.switchClass(editor_id+'_bullist','mceButtonSelected');break;case"ol":tinyMCE.switchClass(editor_id+'_numlist','mceButtonSelected');break;}}while((node=node.parentNode)!=null);}};tinyMCE.addTheme("simple",TinyMCE_SimpleTheme);tinyMCE.addButtonMap(TinyMCE_SimpleTheme._buttonMap); | var TinyMCE_SimpleTheme={_buttonMap:'bold,bullist,cleanup,italic,numlist,redo,strikethrough,underline,undo',getEditorTemplate:function(){var html='';html+='<table class="mceEditor" border="0" cellpadding="0" cellspacing="0" width="{$width}" height="{$height}">';html+='<tr><td align="center">';html+='<span id="{$editor_id}">IFRAME</span>';html+='</td></tr>';html+='<tr><td class="mceToolbar" align="center" height="1">';html+=tinyMCE.getButtonHTML('bold','lang_bold_desc','{$themeurl}/images/{$lang_bold_img}','Bold');html+=tinyMCE.getButtonHTML('italic','lang_italic_desc','{$themeurl}/images/{$lang_italic_img}','Italic');html+=tinyMCE.getButtonHTML('underline','lang_underline_desc','{$themeurl}/images/{$lang_underline_img}','Underline');html+=tinyMCE.getButtonHTML('strikethrough','lang_striketrough_desc','{$themeurl}/images/strikethrough.gif','Strikethrough');html+='<img src="{$themeurl}/images/separator.gif" width="2" height="20" class="mceSeparatorLine" />';html+=tinyMCE.getButtonHTML('undo','lang_undo_desc','{$themeurl}/images/undo.gif','Undo');html+=tinyMCE.getButtonHTML('redo','lang_redo_desc','{$themeurl}/images/redo.gif','Redo');html+='<img src="{$themeurl}/images/separator.gif" width="2" height="20" class="mceSeparatorLine" />';html+=tinyMCE.getButtonHTML('cleanup','lang_cleanup_desc','{$themeurl}/images/cleanup.gif','mceCleanup');html+='<img src="{$themeurl}/images/separator.gif" width="2" height="20" class="mceSeparatorLine" />';html+=tinyMCE.getButtonHTML('bullist','lang_bullist_desc','{$themeurl}/images/bullist.gif','InsertUnorderedList');html+=tinyMCE.getButtonHTML('numlist','lang_numlist_desc','{$themeurl}/images/numlist.gif','InsertOrderedList');html+='</td></tr></table>';return{delta_width:0,delta_height:20,html:html}},handleNodeChange:function(editor_id,node){tinyMCE.switchClass(editor_id+'_bold','mceButtonNormal');tinyMCE.switchClass(editor_id+'_italic','mceButtonNormal');tinyMCE.switchClass(editor_id+'_underline','mceButtonNormal');tinyMCE.switchClass(editor_id+'_strikethrough','mceButtonNormal');tinyMCE.switchClass(editor_id+'_bullist','mceButtonNormal');tinyMCE.switchClass(editor_id+'_numlist','mceButtonNormal');do{switch(node.nodeName.toLowerCase()){case"b":case"strong":tinyMCE.switchClass(editor_id+'_bold','mceButtonSelected');break;case"i":case"em":tinyMCE.switchClass(editor_id+'_italic','mceButtonSelected');break;case"u":tinyMCE.switchClass(editor_id+'_underline','mceButtonSelected');break;case"strike":tinyMCE.switchClass(editor_id+'_strikethrough','mceButtonSelected');break;case"ul":tinyMCE.switchClass(editor_id+'_bullist','mceButtonSelected');break;case"ol":tinyMCE.switchClass(editor_id+'_numlist','mceButtonSelected');break}}while((node=node.parentNode)!=null)}};tinyMCE.addTheme("simple",TinyMCE_SimpleTheme);tinyMCE.addButtonMap(TinyMCE_SimpleTheme._buttonMap); | html+='</td></tr></table>';return{delta_width:0,delta_height:20,html:html};},handleNodeChange:function(editor_id,node){tinyMCE.switchClass(editor_id+'_bold','mceButtonNormal');tinyMCE.switchClass(editor_id+'_italic','mceButtonNormal');tinyMCE.switchClass(editor_id+'_underline','mceButtonNormal');tinyMCE.switchClass(editor_id+'_strikethrough','mceButtonNormal');tinyMCE.switchClass(editor_id+'_bullist','mceButtonNormal');tinyMCE.switchClass(editor_id+'_numlist','mceButtonNormal');do{switch(node.nodeName.toLowerCase()){case"b":case"strong":tinyMCE.switchClass(editor_id+'_bold','mceButtonSelected');break;case"i":case"em":tinyMCE.switchClass(editor_id+'_italic','mceButtonSelected');break;case"u":tinyMCE.switchClass(editor_id+'_underline','mceButtonSelected');break;case"strike":tinyMCE.switchClass(editor_id+'_strikethrough','mceButtonSelected');break;case"ul":tinyMCE.switchClass(editor_id+'_bullist','mceButtonSelected');break;case"ol":tinyMCE.switchClass(editor_id+'_numlist','mceButtonSelected');break;}}while((node=node.parentNode)!=null);}};tinyMCE.addTheme("simple",TinyMCE_SimpleTheme);tinyMCE.addButtonMap(TinyMCE_SimpleTheme._buttonMap); |
d.setMonth(parseInt(bits[2], 10) - 1); | handler: function(bits) { var d = new Date(); d.setYear(parseInt(bits[1])); d.setDate(parseInt(bits[3], 10)); d.setMonth(parseInt(bits[2], 10) - 1); return d; } |
|
document.getElementById(cid).innerHTML = xmlHttp.responseText; | var serverResponse = document.createElement("div"); serverResponse.innerHTML = xmlHttp.responseText; tempPageElements = serverResponse.getElementsByTagName("div"); document.getElementById(cid).innerHTML = tempPageElements[0].innerHTML; | function handleStateChange() { if(xmlHttp.readyState == 4) { if(xmlHttp.status == 200) { //alert("The server replied with: " + xmlHttp.responseText); //alert(document.getElementById('77')); document.getElementById(cid).innerHTML = xmlHttp.responseText; // clone the "hiddenContent" element and assign it to the "newContent" variable //newContent = document.getElementById("hiddenContent").cloneNode(true); // clear the contents of your destination element. //so_clearInnerHTML(document.getElementById("mContainer")); // append the cloned element to the destination element //document.getElementById("mContainer").appendChild(newContent); } }} |
alert(cid); | handleSuccess:function(o) { var cid = o.argument[0]; alert(cid); if(o.responseText != undefined){ alert(o.responseText); // create a temporary div element to store the responseText... var serverResponse = document.createElement("div"); // ... and store the responseText inside it serverResponse.innerHTML = o.responseText; //alert(o.responseText); // create a collection of all the div elements returned tempPageElements = serverResponse.getElementsByTagName("div"); // replace existing component with new one document.getElementById(cid).innerHTML = tempPageElements[0].innerHTML; } }, |
|
alert(o.responseText); | handleSuccess:function(o) { var cid = o.argument[0]; alert(cid); if(o.responseText != undefined){ alert(o.responseText); // create a temporary div element to store the responseText... var serverResponse = document.createElement("div"); // ... and store the responseText inside it serverResponse.innerHTML = o.responseText; //alert(o.responseText); // create a collection of all the div elements returned tempPageElements = serverResponse.getElementsByTagName("div"); // replace existing component with new one document.getElementById(cid).innerHTML = tempPageElements[0].innerHTML; } }, |
|
el.className = 'mceItemAnchor'; | tinyMCE.addCSSClass(el, 'mceItemAnchor'); | handleVisualAid : function(el, deep, state, inst, skip_dispatch) { if (!el) return; if (!skip_dispatch) tinyMCE.dispatchCallback(inst, 'handle_visual_aid_callback', 'handleVisualAid', el, deep, state, inst); var tableElement = null; switch (el.nodeName) { case "TABLE": var oldW = el.style.width; var oldH = el.style.height; var bo = tinyMCE.getAttrib(el, "border"); bo = bo == "" || bo == "0" ? true : false; tinyMCE.setAttrib(el, "class", tinyMCE.getVisualAidClass(tinyMCE.getAttrib(el, "class"), state && bo)); el.style.width = oldW; el.style.height = oldH; for (var y=0; y<el.rows.length; y++) { for (var x=0; x<el.rows[y].cells.length; x++) { var cn = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(el.rows[y].cells[x], "class"), state && bo); tinyMCE.setAttrib(el.rows[y].cells[x], "class", cn); } } break; case "A": var anchorName = tinyMCE.getAttrib(el, "name"); if (anchorName != '' && state) { el.title = anchorName; el.className = 'mceItemAnchor'; } else if (anchorName != '' && !state) el.className = ''; break; } if (deep && el.hasChildNodes()) { for (var i=0; i<el.childNodes.length; i++) tinyMCE.handleVisualAid(el.childNodes[i], deep, state, inst, true); } }, |
regEx = new RegExp("\\b" + arguments[i] + "\\b"); if(!regEx.test(element.className)) return false; | if((typeof arguments[i] == 'object') && (arguments[i].constructor == Array)) { for(var j = 0; j < arguments[i].length; j++) { regEx = new RegExp("(^|\\s)" + arguments[i][j] + "(\\s|$)"); if(!regEx.test(element.className)) return false; } } else { regEx = new RegExp("(^|\\s)" + arguments[i] + "(\\s|$)"); if(!regEx.test(element.className)) return false; } | has: function(element) { element = $(element); if(!element || !element.className) return false; var regEx; for(var i = 1; i < arguments.length; i++) { regEx = new RegExp("\\b" + arguments[i] + "\\b"); if(!regEx.test(element.className)) return false; } return true; }, |
regEx = new RegExp("\\b" + arguments[i][j] + "\\b"); | regEx = new RegExp("(^|\\s)" + arguments[i][j] + "(\\s|$)"); | has_any: function(element) { element = $(element); if(!element || !element.className) return false; var regEx; for(var i = 1; i < arguments.length; i++) { if((typeof arguments[i] == 'object') && (arguments[i].constructor == Array)) { for(var j = 0; j < arguments[i].length; j++) { regEx = new RegExp("\\b" + arguments[i][j] + "\\b"); if(regEx.test(element.className)) return true; } } else { regEx = new RegExp("\\b" + arguments[i] + "\\b"); if(regEx.test(element.className)) return true; } } return false; }, |
regEx = new RegExp("\\b" + arguments[i] + "\\b"); | regEx = new RegExp("(^|\\s)" + arguments[i] + "(\\s|$)"); | has_any: function(element) { element = $(element); if(!element || !element.className) return false; var regEx; for(var i = 1; i < arguments.length; i++) { if((typeof arguments[i] == 'object') && (arguments[i].constructor == Array)) { for(var j = 0; j < arguments[i].length; j++) { regEx = new RegExp("\\b" + arguments[i][j] + "\\b"); if(regEx.test(element.className)) return true; } } else { regEx = new RegExp("\\b" + arguments[i] + "\\b"); if(regEx.test(element.className)) return true; } } return false; }, |
element = $(element); if (!element) return; var a = element.className.split(' '); for (var i = 0; i < a.length; i++) { if (a[i] == className) return true; } return false; | if (!(element = $(element))) return; return Element.classNames(element).include(className); | hasClassName: function(element, className) { element = $(element); if (!element) return; var a = element.className.split(' '); for (var i = 0; i < a.length; i++) { if (a[i] == className) return true; } return false; }, |
}; | } | Element.prototype.hasStyleClass = function(className) { return this.className.indexOf(className) != -1;}; |
function hasStyleClass(element, className) { return ( element.className.indexOf(className) != -1 ); } | Element.prototype.hasStyleClass = function(className) { return this.className.indexOf(className) != -1; }; | function hasStyleClass(element, className){ return ( element.className.indexOf(className) != -1 );} |
rootNode = childList.item(1); childList = rootNode.childNodes; | function hc_noderemovechild() { var success; if(checkInitialization(builder, "hc_noderemovechild") != null) return; var doc; var rootNode; var childList; var childToRemove; var removedChild; var parentNode; var docRef = null; if (typeof(this.doc) != 'undefined') { docRef = this.doc; } doc = load(docRef, "doc", "hc_staff"); rootNode = doc.documentElement; childList = rootNode.childNodes; childToRemove = childList.item(1); removedChild = rootNode.removeChild(childToRemove); parentNode = removedChild.parentNode; assertNull("parentNodeNull",parentNode); } |
|
var hex = this.match('^#?(\\w{1,2})(\\w{1,2})(\\w{1,2})$'); if (!hex) return false; | if (this.length != 4) return false; | hexToRgb: function(array){ var hex = this.match('^#?(\\w{1,2})(\\w{1,2})(\\w{1,2})$'); if (!hex) return false; var rgb = []; for (var i = 1; i < 4; i++){ if (hex[i].length == 1) hex[i] += hex[i]; rgb.push(parseInt(hex[i], 16)); } return array ? rgb : 'rgb('+rgb.join(',')+')'; } |
if (hex[i].length == 1) hex[i] += hex[i]; rgb.push(parseInt(hex[i], 16)); | if (this[i].length == 1) this[i] += this[i]; rgb.push(parseInt(this[i], 16)); | hexToRgb: function(array){ var hex = this.match('^#?(\\w{1,2})(\\w{1,2})(\\w{1,2})$'); if (!hex) return false; var rgb = []; for (var i = 1; i < 4; i++){ if (hex[i].length == 1) hex[i] += hex[i]; rgb.push(parseInt(hex[i], 16)); } return array ? rgb : 'rgb('+rgb.join(',')+')'; } |
if (text.substr(0, 1) != "&") { cell.appendChild(document.createTextNode(text)); } else { cell.innerHTML = text; } | cell.innerHTML = "<div unselectable='on'>" + text + "</div>"; | var hh = function (text, cs, navtype) { cell = Calendar.createElement("td", row); cell.colSpan = cs; cell.className = "button"; if (navtype != 0 && Math.abs(navtype) <= 2) cell.className += " nav"; Calendar._add_evs(cell); cell.calendar = cal; cell.navtype = navtype; if (text.substr(0, 1) != "&") { cell.appendChild(document.createTextNode(text)); } else { // FIXME: dirty hack for entities cell.innerHTML = text; } return cell; }; |
Element.hide(this.update); | hide: function() { if(this.iefix) Element.hide(this.iefix); Element.hide(this.update); }, |
|
collapse_link.innerHTML = 'Show'; | collapse_link.innerHTML = gettext('Show'); | hide: function(fieldset_index) { var fs = document.getElementsByTagName('fieldset')[fieldset_index]; // Add the class name that causes the "display: none". fs.className += ' ' + CollapsedFieldsets.collapsed_class; // Toggle the "Hide" link to a "Show" link var collapse_link = document.getElementById('fieldsetcollapser' + fieldset_index); collapse_link.onclick = new Function('CollapsedFieldsets.show('+fieldset_index+'); return false;'); collapse_link.innerHTML = 'Show'; }, |
this.stopIndicator(); | hide: function() { if(Element.getStyle(this.update, 'display')!='none') this.options.onHide(this.element, this.update); if(this.iefix) Element.hide(this.iefix); }, |
|
function hide(s) { if (!s) return; s.style.display = "none"; | HTMLElement.prototype.hide = function() { this.style.display = 'none'; | function hide(s) { if (!s) return; s.style.display = "none";} |
if(this.update.style.display=='') this.options.onHide(this.element, this.update); | this.stopIndicator(); if(Element.getStyle(this.update, 'display')!='none') this.options.onHide(this.element, this.update); | hide: function() { if(this.update.style.display=='') this.options.onHide(this.element, this.update); if(this.iefix) Element.hide(this.iefix); }, |
HTMLElement.prototype.hide = function() { this.style.display = 'none'; | function hide(n) { n.style.display = 'none'; | HTMLElement.prototype.hide = function() { this.style.display = 'none';} |
document.getElementById( 'input_fake' ).style.display = 'none'; | function hide_input( ){ document.getElementById( 'input_file' ).style.display = 'none'; document.getElementById( 'input_disc' ).style.display = 'none'; document.getElementById( 'input_network' ).style.display = 'none';} |
|
}, | } | hideMenus : function() { var e = tinyMCE.lastSelectedMenuBtn; if (tinyMCE.lastMenu) { tinyMCE.lastMenu.hide(); tinyMCE.lastMenu = null; } if (e) { tinyMCE.switchClass(e, tinyMCE.lastMenuBtnClass); tinyMCE.lastSelectedMenuBtn = null; } }, |
highlight : function(element) { var highLightColor = "yellow"; var originalColor = Element.getStyle(element, "background-color"); | highlight : function(element) { var highLightColor = "yellow"; if (element.originalColor == undefined) { element.originalColor = Element.getStyle(element, "background-color"); } | highlight : function(element) { var highLightColor = "yellow"; var originalColor = Element.getStyle(element, "background-color"); Element.setStyle(element, {"background-color" : highLightColor}); window.setTimeout(function() { if(element.document != undefined && element.document==null) return; Element.setStyle(element, {"background-color" : originalColor}); }, 200); } |
if(element.document != undefined && element.document==null) return; Element.setStyle(element, {"background-color" : originalColor}); | if (element.document != undefined && element.document == null) { return; } Element.setStyle(element, {"background-color" : element.originalColor}); | highlight : function(element) { var highLightColor = "yellow"; var originalColor = Element.getStyle(element, "background-color"); Element.setStyle(element, {"background-color" : highLightColor}); window.setTimeout(function() { if(element.document != undefined && element.document==null) return; Element.setStyle(element, {"background-color" : originalColor}); }, 200); } |
if (element.document != undefined && element.document == null) { | if (!element.parentNode) { | highlight : function(element) { var highLightColor = "yellow"; if (element.originalColor == undefined) { // avoid picking up highlight element.originalColor = Element.getStyle(element, "background-color"); } Element.setStyle(element, {"background-color" : highLightColor}); window.setTimeout(function() { if (element.document != undefined && element.document == null) { return; } Element.setStyle(element, {"background-color" : element.originalColor}); }, 200); } |
}, 300); | }, 200); | highlight : function(element) { var highLightColor = "yellow"; var originalColor = Element.getStyle(element, "background-color"); Element.setStyle(element, {"background-color" : highLightColor}); window.setTimeout(function() { Element.setStyle(element, {"background-color" : originalColor}); }, 300); } |
if(!element.document) return; | if(element.document != undefined && element.document==null) return; | highlight : function(element) { var highLightColor = "yellow"; var originalColor = Element.getStyle(element, "background-color"); Element.setStyle(element, {"background-color" : highLightColor}); window.setTimeout(function() { if(!element.document) return; Element.setStyle(element, {"background-color" : originalColor}); }, 200); } |
elementSetStyle(element, {"background-color" : highLightColor}); | elementSetStyle(element, {"backgroundColor" : highLightColor}); | highlight : function(element) { var highLightColor = "yellow"; if (element.originalColor == undefined) { // avoid picking up highlight element.originalColor = elementGetStyle(element, "background-color"); } elementSetStyle(element, {"background-color" : highLightColor}); window.setTimeout(function() { //if element is orphan, probably page of it has already gone, so ignore if (!element.parentNode) { return; } elementSetStyle(element, {"background-color" : element.originalColor}); }, 200); } |
if (!element.parentNode) { return; } elementSetStyle(element, {"background-color" : element.originalColor}); | try { if (!element.parentNode) { return; } elementSetStyle(element, {"backgroundColor" : element.originalColor}); } catch (e) {} | highlight : function(element) { var highLightColor = "yellow"; if (element.originalColor == undefined) { // avoid picking up highlight element.originalColor = elementGetStyle(element, "background-color"); } elementSetStyle(element, {"background-color" : highLightColor}); window.setTimeout(function() { //if element is orphan, probably page of it has already gone, so ignore if (!element.parentNode) { return; } elementSetStyle(element, {"background-color" : element.originalColor}); }, 200); } |
element.originalColor = Element.getStyle(element, "background-color"); | element.originalColor = elementGetStyle(element, "background-color"); | highlight : function(element) { var highLightColor = "yellow"; if (element.originalColor == undefined) { // avoid picking up highlight element.originalColor = Element.getStyle(element, "background-color"); } Element.setStyle(element, {"background-color" : highLightColor}); window.setTimeout(function() { //if element is orphan, probably page of it has already gone, so ignore if (!element.parentNode) { return; } Element.setStyle(element, {"background-color" : element.originalColor}); }, 200); } |
Element.setStyle(element, {"background-color" : highLightColor}); | elementSetStyle(element, {"background-color" : highLightColor}); | highlight : function(element) { var highLightColor = "yellow"; if (element.originalColor == undefined) { // avoid picking up highlight element.originalColor = Element.getStyle(element, "background-color"); } Element.setStyle(element, {"background-color" : highLightColor}); window.setTimeout(function() { //if element is orphan, probably page of it has already gone, so ignore if (!element.parentNode) { return; } Element.setStyle(element, {"background-color" : element.originalColor}); }, 200); } |
Element.setStyle(element, {"background-color" : element.originalColor}); | elementSetStyle(element, {"background-color" : element.originalColor}); | highlight : function(element) { var highLightColor = "yellow"; if (element.originalColor == undefined) { // avoid picking up highlight element.originalColor = Element.getStyle(element, "background-color"); } Element.setStyle(element, {"background-color" : highLightColor}); window.setTimeout(function() { //if element is orphan, probably page of it has already gone, so ignore if (!element.parentNode) { return; } Element.setStyle(element, {"background-color" : element.originalColor}); }, 200); } |
highlight : function(element) { var highLightColor = "yellow"; if (element.originalColor == undefined) { element.originalColor = elementGetStyle(element, "background-color"); } elementSetStyle(element, {"backgroundColor" : highLightColor}); window.setTimeout(function() { try { if (!element.parentNode) { return; } elementSetStyle(element, {"backgroundColor" : element.originalColor}); } catch (e) {} }, 200); | function highlight(element) { var highLightColor = "yellow"; if (element.originalColor == undefined) { element.originalColor = elementGetStyle(element, "background-color"); | highlight : function(element) { var highLightColor = "yellow"; if (element.originalColor == undefined) { // avoid picking up highlight element.originalColor = elementGetStyle(element, "background-color"); } elementSetStyle(element, {"backgroundColor" : highLightColor}); window.setTimeout(function() { try { //if element is orphan, probably page of it has already gone, so ignore if (!element.parentNode) { return; } elementSetStyle(element, {"backgroundColor" : element.originalColor}); } catch (e) {} // DGF unhighlighting is very dangerous and low priority }, 200); } |
elementSetStyle(element, {"backgroundColor" : highLightColor}); window.setTimeout(function() { try { if (!element.parentNode) { return; } elementSetStyle(element, {"backgroundColor" : element.originalColor}); } catch (e) {} }, 200); } | highlight : function(element) { var highLightColor = "yellow"; if (element.originalColor == undefined) { // avoid picking up highlight element.originalColor = elementGetStyle(element, "background-color"); } elementSetStyle(element, {"backgroundColor" : highLightColor}); window.setTimeout(function() { try { //if element is orphan, probably page of it has already gone, so ignore if (!element.parentNode) { return; } elementSetStyle(element, {"backgroundColor" : element.originalColor}); } catch (e) {} // DGF unhighlighting is very dangerous and low priority }, 200); } |
|
addFocusHandlers(document.getElementsByTagName("select")); | function highlightFormElements() { // add input box highlighting addFocusHandlers(document.getElementsByTagName("input")); addFocusHandlers(document.getElementsByTagName("select")); addFocusHandlers(document.getElementsByTagName("textarea"));} |
|
prevClickedDOMObj.style.color=lastClickedColor; prevClickedDOMObj.style.backgroundColor=lastClickedBgColor; | if (prevClickedDOMObj) { prevClickedDOMObj.style.color=lastClickedColor; prevClickedDOMObj.style.backgroundColor=lastClickedBgColor; } | function highlightObjLink(nodeObj) { if (!HIGHLIGHT || nodeObj==null || nodeObj.maySelect==false) {//node deleted in DB return; } if (browserVersion == 1 || browserVersion == 3) { var clickedDOMObj = getElById('itemTextLink'+nodeObj.id); if (clickedDOMObj != null) { if (lastClicked != null) { var prevClickedDOMObj = getElById('itemTextLink'+lastClicked.id); prevClickedDOMObj.style.color=lastClickedColor; prevClickedDOMObj.style.backgroundColor=lastClickedBgColor; } lastClickedColor = clickedDOMObj.style.color; lastClickedBgColor = clickedDOMObj.style.backgroundColor; clickedDOMObj.style.color=HIGHLIGHT_COLOR; clickedDOMObj.style.backgroundColor=HIGHLIGHT_BG; } } lastClicked = nodeObj; if (PRESERVESTATE) SetCookie('highlightedTreeviewLink', nodeObj.getID());} |
var rows = table.getElementsByTagName("tr"); | rows = table.getElementsByTagName("tr"); | function highlightTableRows(tableId) { var previousClass = null; var table = document.getElementById(tableId); var tbody = table.getElementsByTagName("tbody")[0]; if (tbody == null) { var rows = table.getElementsByTagName("tr"); } else { var rows = tbody.getElementsByTagName("tr"); } // add event handlers so rows light up and are clickable for (i=0; i < rows.length; i++) { rows[i].onmouseover = function() { previousClass=this.className;this.className+=' over' }; rows[i].onmouseout = function() { this.className=previousClass }; rows[i].onclick = function() { var cell = this.getElementsByTagName("td")[0]; var link = cell.getElementsByTagName("a")[0]; location.href = link.getAttribute("href"); this.style.cursor="wait"; } }} |
var rows = tbody.getElementsByTagName("tr"); | rows = tbody.getElementsByTagName("tr"); | function highlightTableRows(tableId) { var previousClass = null; var table = document.getElementById(tableId); var tbody = table.getElementsByTagName("tbody")[0]; if (tbody == null) { var rows = table.getElementsByTagName("tr"); } else { var rows = tbody.getElementsByTagName("tr"); } // add event handlers so rows light up and are clickable for (i=0; i < rows.length; i++) { rows[i].onmouseover = function() { previousClass=this.className;this.className+=' over' }; rows[i].onmouseout = function() { this.className=previousClass }; rows[i].onclick = function() { var cell = this.getElementsByTagName("td")[0]; var link = cell.getElementsByTagName("a")[0]; location.href = link.getAttribute("href"); this.style.cursor="wait"; } }} |
http.setRequestHeader( 'Hop-Share', hop_serialize_share_env() ); | http.setRequestHeader( 'Hop-Env', hop_serialize_request_env() ); | function hop( service, success, failure, sync ) { if( success == true ) { location.href = service; return true; } else { resume_success = success; resume_failure = failure; } var http = hop_make_xml_http_request(); var vis = hop_anim( service ); document.body.appendChild( vis ); http.open( "GET", service, (sync != true) ); http.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded; charset=ISO-8859-1' ); http.setRequestHeader( 'Connection', 'close' ); http.setRequestHeader( 'Hop-Share', hop_serialize_share_env() ); return hop_inner( http, success, failure, vis );} |
http.setRequestHeader( 'Hop-Share', hop_serialize_share_env() ); | function hop( service, success, failure, sync ) { if( success == true ) { location.href = service; return true; } else { resume_success = success; resume_failure = failure; } var http = hop_make_xml_http_request(); var vis = hop_anim( service ); document.body.appendChild( vis ); http.open( "GET", service, (sync != true) ); http.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded; charset=ISO-8859-1' ); http.setRequestHeader( 'Connection', 'close' ); return hop_inner( http, success, failure, vis );} |
|
return obj.attachEvent( "on" + event, proc ); | return obj.attachEvent( "on" + event, function(_) {return proc(window.event)}); | hop_add_event_listener = function( obj, event, proc, capture ) { return obj.attachEvent( "on" + event, proc ); } |
return obj.attachEvent( "on" + event, function(_) {return proc(window.event)}); | var p = function(_) {return proc(window.event)}; var i = "on" + event + "hdl"; if( obj[ i ] == undefined ) obj[ i ] = []; obj[ i ][ proc ] = p; return obj.attachEvent( "on" + event, p ); | hop_add_event_listener = function( obj, event, proc, capture ) { return obj.attachEvent( "on" + event, function(_) {return proc(window.event)}); } |
if( item instanceof HTMLCollection ) return hop_serialize_array( item ); | function hop_bigloo_serialize( item ) { var tname = typeof item; if( (item instanceof String) || (tname == "string") ) return hop_serialize_string( '"', item ); if( (typeof item) == "number" ) return hop_serialize_number( item ); if( (item instanceof Boolean) || (tname == "boolean") ) return hop_serialize_boolean( item ); if( item instanceof Array ) return hop_serialize_array( item ); if( item == undefined ) return ";"; if( item == null ) return "."; if( item instanceof HTMLCollection ) return hop_serialize_array( item ); if( item instanceof Date ) return hop_serialize_date( item ); if( item instanceof HTMLInputElement ) return hop_serialize( item.value ); if( item instanceof HTMLTextAreaElement ) return hop_serialize( item.value ); if( item instanceof HTMLSelectElement ) return hop_serialize( item.value ); if( (item instanceof Object) && (typeof item.hop_bigloo_serialize == "function") ) return item.hop_bigloo_serialize(); alert( "*** Hop Error, Can't serialize element: `" + item + "' (" + tname + "). Ignoring value." ); return hop_serialize( false );} |
|
if( item instanceof HTMLInputElement ) return hop_serialize( item.value ); if( item instanceof HTMLTextAreaElement ) return hop_serialize( item.value ); if( item instanceof HTMLSelectElement ) return hop_serialize( item.value ); | function hop_bigloo_serialize( item ) { var tname = typeof item; if( (item instanceof String) || (tname == "string") ) return hop_serialize_string( '"', item ); if( (typeof item) == "number" ) return hop_serialize_number( item ); if( (item instanceof Boolean) || (tname == "boolean") ) return hop_serialize_boolean( item ); if( item instanceof Array ) return hop_serialize_array( item ); if( item == undefined ) return ";"; if( item == null ) return "."; if( item instanceof HTMLCollection ) return hop_serialize_array( item ); if( item instanceof Date ) return hop_serialize_date( item ); if( item instanceof HTMLInputElement ) return hop_serialize( item.value ); if( item instanceof HTMLTextAreaElement ) return hop_serialize( item.value ); if( item instanceof HTMLSelectElement ) return hop_serialize( item.value ); if( (item instanceof Object) && (typeof item.hop_bigloo_serialize == "function") ) return item.hop_bigloo_serialize(); alert( "*** Hop Error, Can't serialize element: `" + item + "' (" + tname + "). Ignoring value." ); return hop_serialize( false );} |
|
if( (HTMLCollection != undefined) && (item instanceof HTMLCollection) ) return hop_serialize_array( item ); if( (HTMLInputElement != undefined) && (item instanceof HTMLInputElement) ) return hop_serialize( item.value ); if( (HTMLTextAreaElement != undefined) && (item instanceof HTMLTextAreaElement) ) return hop_serialize( item.value ); if( (HTMLSelectElement != undefined) && (item instanceof HTMLSelectElement) ) return hop_serialize( item.value ); | function hop_bigloo_serialize( item ) { var tname = typeof item; if( (item instanceof String) || (tname == "string") ) return hop_serialize_string( '"', item ); if( (typeof item) == "number" ) return hop_serialize_number( item ); if( (item instanceof Boolean) || (tname == "boolean") ) return hop_serialize_boolean( item ); if( item instanceof Array ) return hop_serialize_array( item ); if( item == undefined ) return ";"; if( item == null ) return "."; if( item instanceof HTMLCollection ) return hop_serialize_array( item ); if( item instanceof Date ) return hop_serialize_date( item ); if( item instanceof HTMLInputElement ) return hop_serialize( item.value ); if( item instanceof HTMLTextAreaElement ) return hop_serialize( item.value ); if( item instanceof HTMLSelectElement ) return hop_serialize( item.value ); if( (item instanceof Object) && (typeof item.hop_bigloo_serialize == "function") ) return item.hop_bigloo_serialize(); alert( "*** Hop Error, Can't serialize element: `" + item + "' (" + tname + "). Ignoring value." ); return hop_serialize( false );} |
|
if( (item instanceof String) || (tname == "string") ) return hop_serialize_string( '"', item ); | if( (item instanceof String) || (tname == "string") ) { if( sc_isSymbol_immutable( item ) ) { return "'" + hop_serialize_string( '"', sc_symbol2string_immutable( item ) ); } else { return hop_serialize_string( '"', item ); } } | function hop_bigloo_serialize( item ) { var tname = typeof item; if( (item instanceof String) || (tname == "string") ) return hop_serialize_string( '"', item ); if( (typeof item) == "number" ) return hop_serialize_number( item ); if( (item instanceof Boolean) || (tname == "boolean") ) return hop_serialize_boolean( item ); if( item instanceof Array ) return hop_serialize_array( item ); if( item == undefined ) return ";"; if( item == null ) return "."; if( item instanceof Date ) return hop_serialize_date( item ); if( (item instanceof Object) && (typeof item.hop_bigloo_serialize == "function") ) return item.hop_bigloo_serialize(); if( (HTMLCollection != undefined) && (item instanceof HTMLCollection) ) return hop_serialize_array( item ); if( (HTMLInputElement != undefined) && (item instanceof HTMLInputElement) ) return hop_serialize( item.value ); if( (HTMLTextAreaElement != undefined) && (item instanceof HTMLTextAreaElement) ) return hop_serialize( item.value ); if( (HTMLSelectElement != undefined) && (item instanceof HTMLSelectElement) ) return hop_serialize( item.value ); alert( "*** Hop Error, Can't serialize element: `" + item + "' (" + tname + "). Ignoring value." ); return hop_serialize( false );} |
return hop_serialize( item.value ); | return hop_bigloo_serialize( item.value ); | function hop_bigloo_serialize( item ) { var tname = typeof item; if( (item instanceof String) || (tname == "string") ) return hop_serialize_string( '"', item ); if( (typeof item) == "number" ) return hop_serialize_number( item ); if( (item instanceof Boolean) || (tname == "boolean") ) return hop_serialize_boolean( item ); if( item instanceof Array ) return hop_serialize_array( item ); if( item == undefined ) return ";"; if( item == null ) return "."; if( item instanceof Date ) return hop_serialize_date( item ); if( (item instanceof Object) && (typeof item.hop_bigloo_serialize == "function") ) return item.hop_bigloo_serialize(); if( (HTMLCollection != undefined) && (item instanceof HTMLCollection) ) return hop_serialize_array( item ); if( (HTMLInputElement != undefined) && (item instanceof HTMLInputElement) ) return hop_serialize( item.value ); if( (HTMLTextAreaElement != undefined) && (item instanceof HTMLTextAreaElement) ) return hop_serialize( item.value ); if( (HTMLSelectElement != undefined) && (item instanceof HTMLSelectElement) ) return hop_serialize( item.value ); alert( "*** Hop Error, Can't serialize element: `" + item + "' (" + tname + "). Ignoring value." ); return hop_serialize( false );} |
return hop_serialize( false ); | return hop_bigloo_serialize( false ); | function hop_bigloo_serialize( item ) { var tname = typeof item; if( (item instanceof String) || (tname == "string") ) return hop_serialize_string( '"', item ); if( (typeof item) == "number" ) return hop_serialize_number( item ); if( (item instanceof Boolean) || (tname == "boolean") ) return hop_serialize_boolean( item ); if( item instanceof Array ) return hop_serialize_array( item ); if( item == undefined ) return ";"; if( item == null ) return "."; if( item instanceof Date ) return hop_serialize_date( item ); if( (item instanceof Object) && (typeof item.hop_bigloo_serialize == "function") ) return item.hop_bigloo_serialize(); if( (HTMLCollection != undefined) && (item instanceof HTMLCollection) ) return hop_serialize_array( item ); if( (HTMLInputElement != undefined) && (item instanceof HTMLInputElement) ) return hop_serialize( item.value ); if( (HTMLTextAreaElement != undefined) && (item instanceof HTMLTextAreaElement) ) return hop_serialize( item.value ); if( (HTMLSelectElement != undefined) && (item instanceof HTMLSelectElement) ) return hop_serialize( item.value ); alert( "*** Hop Error, Can't serialize element: `" + item + "' (" + tname + "). Ignoring value." ); return hop_serialize( false );} |
res += hop_serialize( l.car ); | res += hop_bigloo_serialize( l.car ); | function hop_bigloo_serialize_pair( l ) { var res = ""; var len = 0; while (sc_isPair( l ) ) { res += hop_serialize( l.car ); l = l.cdr; len++; } if( l == null ) { return hop_serialize_word( len + 1 ) + res + "."; } else { return hop_serialize_word( len + 1 ) + res + hop_serialize( l ); }} |
return hop_serialize_word( len + 1 ) + res + hop_serialize( l ); | return hop_serialize_word( len + 1 ) + res + hop_bigloo_serialize( l ); | function hop_bigloo_serialize_pair( l ) { var res = ""; var len = 0; while (sc_isPair( l ) ) { res += hop_serialize( l.car ); l = l.cdr; len++; } if( l == null ) { return hop_serialize_word( len + 1 ) + res + "."; } else { return hop_serialize_word( len + 1 ) + res + hop_serialize( l ); }} |
return hop_serialize_word( len ) + res; | return hop_serialize_word( len + 1 ) + res + hop_serialize( l ); | function hop_bigloo_serialize_pair( l ) { var res = ""; var len = 0; while (sc_isPair( l ) ) { res += hop_serialize( l.car ); l = l.cdr; len++; } if( l == null ) { return hop_serialize_word( len + 1 ) + res + "."; } else { return hop_serialize_word( len ) + res; }} |
pre.className = "hop_debug"; | pre.className = "hop_debug_pre"; | function hop_debug_get_container() { var pre = document.getElementById( "hop_debug_content" ); var win = document.getElementById( "hop_debug" ); if( pre == null ) { var div = document.createElement( "div" ); pre = document.createElement( "pre" ); div.id = "hop_debug_div"; div.className = "hop_debug"; pre.id = "hop_debug_content"; pre.className = "hop_debug"; div.innerHTML = "<DIV class='hop_debug_reset'><BUTTON onclick='hop_debug_reset()'>Reset</BUTTON></DIV>"; div.appendChild( pre ); win = hop_iwindow_open( "hop_debug", div, "hop_debug", false, 320, 200 ); } else { win.style.display = "block"; } return pre;} |
win = hop_iwindow_open( "hop_debug", div, "hop_debug", false, 320, 200 ); | win = hop_iwindow_open( "hop_debug", div, "hop_debug", false, 320, 200, 10, 10 ); | function hop_debug_get_container() { var pre = document.getElementById( "hop_debug_content" ); var win = document.getElementById( "hop_debug" ); if( pre == null ) { var div = document.createElement( "div" ); pre = document.createElement( "pre" ); div.id = "hop_debug_div"; div.className = "hop_debug"; pre.id = "hop_debug_content"; pre.className = "hop_debug"; div.innerHTML = "<DIV class='hop_debug_reset'><BUTTON onclick='hop_debug_reset()'>Reset</BUTTON></DIV>"; div.appendChild( pre ); win = hop_iwindow_open( "hop_debug", div, "hop_debug", false, 320, 200 ); } else { win.style.display = "block"; } return pre;} |
t = t.replace( /<body[^>]*>/g, "<div style='background: #f7f7f7; font-family: sans serif; -moz-opacity: 0.97'>" ); | t = t.replace( /<body[^>]*>/g, "<div style='background: transparent; font-family: sans serif; -moz-opacity: 0.97'>" ); | function hop_default_failure( http ) { var t = http.responseText; var div = document.getElementById( "hop_default_failure" ); t = t.replace( /<!DOCTYPE[^>]*>/g, "" ); t = t.replace( /<(head|meta|link)[^>]*>/g, "<div style='display: none'>" ); t = t.replace( /<\/(head|meta|link)>/g, "</div>" ); t = t.replace( /<html[^>]*>/g, "<div style='width: 45em; overflow: auto; cursor: pointer;' onclick='document.body.removeChild( document.getElementById( \"hop_default_failure\" ) )' title='Click to hide this message'>" ); t = t.replace( /<\/html>/g, "</div>" ); t = t.replace( /<body[^>]*>/g, "<div style='background: #f7f7f7; font-family: sans serif; -moz-opacity: 0.97'>" ); t = t.replace( /<\/body>/g, "</div>" ); t = t.replace( /</g, "<" ); t = t.replace( />/g, ">" ); t = t.replace( /"/g, "\"" ); if( !div ) { div = document.createElement( "div" ); div.id = "hop_default_failure"; div.style.setProperty( "position", "absolute", "" ); div.style.setProperty( "top", "100", "" ); div.style.setProperty( "z-index", "100", "" ); div.style.setProperty( "width", "100%", "" ); div.style.setProperty( "padding", "0", "" ); div.align = "center"; div.style.setProperty( "background", "transparent", "" ); div.innerHTML = t; document.body.appendChild( div ); } else { div.innerHTML = t; }} |
t = t.replace( /</g, "<" ); t = t.replace( />/g, ">" ); | function hop_default_failure( http ) { var t = http.responseText; var div = document.getElementById( "hop_default_failure" ); t = t.replace( /<!DOCTYPE[^>]*>/g, "" ); t = t.replace( /<head[^>]*>/g, "<div style='display: none'>" ); t = t.replace( /<\/head>/g, "</div>" ); t = t.replace( /<(meta|link)[^>]*>/g, "<span style='display: none'></span>" ); t = t.replace( /<html[^>]*>/g, "<div style='width: 45em; overflow: auto; cursor: pointer;' onclick='document.body.removeChild( document.getElementById( \"hop_default_failure\" ) )' title='Click to hide this message'>" ); t = t.replace( /<\/html>/g, "</div>" ); t = t.replace( /<body[^>]*>/g, "<div style='background: transparent; font-family: sans serif; -moz-opacity: 0.87'>" ); t = t.replace( /<\/body>/g, "</div>" ); t = t.replace( /</g, "<" ); t = t.replace( />/g, ">" ); t = t.replace( /"/g, "\"" ); if( !div ) { div = document.createElement( "div" ); div.id = "hop_default_failure"; div.style.setProperty( "position", "absolute", "" ); div.style.setProperty( "top", "100", "" ); div.style.setProperty( "z-index", "10000", "" ); div.style.setProperty( "width", "100%", "" ); div.style.setProperty( "padding", "0", "" ); div.align = "center"; div.style.setProperty( "background", "transparent", "" ); div.innerHTML = t; document.body.appendChild( div ); } else { div.innerHTML = t; }} |
|
t = t.replace( /<(head|meta|link)[^>]*>/g, "<div style='display: none'>" ); t = t.replace( /<\/(head|meta|link)>/g, "</div>" ); | t = t.replace( /<head[^>]*>/g, "<div style='display: none'>" ); t = t.replace( /<\/head>/g, "</div>" ); t = t.replace( /<(meta|link)[^>]*>/g, "<span style='display: none'></span>" ); | function hop_default_failure( http ) { var t = http.responseText; var div = document.getElementById( "hop_default_failure" ); t = t.replace( /<!DOCTYPE[^>]*>/g, "" ); t = t.replace( /<(head|meta|link)[^>]*>/g, "<div style='display: none'>" ); t = t.replace( /<\/(head|meta|link)>/g, "</div>" ); t = t.replace( /<html[^>]*>/g, "<div style='width: 45em; overflow: auto; cursor: pointer;' onclick='document.body.removeChild( document.getElementById( \"hop_default_failure\" ) )' title='Click to hide this message'>" ); t = t.replace( /<\/html>/g, "</div>" ); t = t.replace( /<body[^>]*>/g, "<div style='background: transparent; font-family: sans serif; -moz-opacity: 0.87'>" ); t = t.replace( /<\/body>/g, "</div>" ); t = t.replace( /</g, "<" ); t = t.replace( />/g, ">" ); t = t.replace( /"/g, "\"" ); if( !div ) { div = document.createElement( "div" ); div.id = "hop_default_failure"; div.style.setProperty( "position", "absolute", "" ); div.style.setProperty( "top", "100", "" ); div.style.setProperty( "z-index", "100", "" ); div.style.setProperty( "width", "100%", "" ); div.style.setProperty( "padding", "0", "" ); div.align = "center"; div.style.setProperty( "background", "transparent", "" ); div.innerHTML = t; document.body.appendChild( div ); } else { div.innerHTML = t; }} |
div.style.setProperty( "z-index", "100", "" ); | div.style.setProperty( "z-index", "10000", "" ); | function hop_default_failure( http ) { var t = http.responseText; var div = document.getElementById( "hop_default_failure" ); t = t.replace( /<!DOCTYPE[^>]*>/g, "" ); t = t.replace( /<(head|meta|link)[^>]*>/g, "<div style='display: none'>" ); t = t.replace( /<\/(head|meta|link)>/g, "</div>" ); t = t.replace( /<html[^>]*>/g, "<div style='width: 45em; overflow: auto; cursor: pointer;' onclick='document.body.removeChild( document.getElementById( \"hop_default_failure\" ) )' title='Click to hide this message'>" ); t = t.replace( /<\/html>/g, "</div>" ); t = t.replace( /<body[^>]*>/g, "<div style='background: transparent; font-family: sans serif; -moz-opacity: 0.87'>" ); t = t.replace( /<\/body>/g, "</div>" ); t = t.replace( /</g, "<" ); t = t.replace( />/g, ">" ); t = t.replace( /"/g, "\"" ); if( !div ) { div = document.createElement( "div" ); div.id = "hop_default_failure"; div.style.setProperty( "position", "absolute", "" ); div.style.setProperty( "top", "100", "" ); div.style.setProperty( "z-index", "100", "" ); div.style.setProperty( "width", "100%", "" ); div.style.setProperty( "padding", "0", "" ); div.align = "center"; div.style.setProperty( "background", "transparent", "" ); div.innerHTML = t; document.body.appendChild( div ); } else { div.innerHTML = t; }} |
char=e.charCode; switch (char) { | c=e.charCode; switch (c) { | function hop_edit_keypress_hdlr(e, id){ if (e==undefined) e=window.event; if (e.ctrlKey) { var propagate=false, char=e.charCode; switch (char) { case 98: hop_edit_action(id, "bold"); break; case 105: hop_edit_action(id, "italic"); break; case 117: hop_edit_action(id, "underline"); break; default: propagate = true; } if (!propagate) { hop_stop_propagation(e); } }} |
e.preventDefault(); e.stopPropagation(); | hop_stop_propagation(e); | function hop_edit_keypress_hdlr(e, id){ if (e.ctrlKey) { var propagate=false, char=e.charCode; switch (char) { case 98: hop_edit_action(id, "bold"); break; case 105: hop_edit_action(id, "italic"); break; case 117: hop_edit_action(id, "underline"); break; case 113: hop_edit_update_interface2(id); break; default: propagate = true; } if (!propagate) { e.preventDefault(); e.stopPropagation(); } }} |
function hop_filebrowse( service, obj, width, height, event, onselect ) { | function hop_filebrowse( service, title, ident, value, path, multiselect, clientX, clientY, width, height ) { | function hop_filebrowse( service, obj, width, height, event, onselect ) { var x = window.innerWidth/2 - width/2; var y = event.clientY + 20; if( (y + height) > window.innerHeight ) y = window.innerHeight - height; obj.onselect = onselect; hop_iwindow_open( "file browser", service( obj.id, obj.value ), obj.value, "hop-file-browse", width, height, x, y );} |
var y = event.clientY + 20; | var y = clientY + 20; var wident = ident + "-window"; | function hop_filebrowse( service, obj, width, height, event, onselect ) { var x = window.innerWidth/2 - width/2; var y = event.clientY + 20; if( (y + height) > window.innerHeight ) y = window.innerHeight - height; obj.onselect = onselect; hop_iwindow_open( "file browser", service( obj.id, obj.value ), obj.value, "hop-file-browse", width, height, x, y );} |
obj.onselect = onselect; hop_iwindow_open( "file browser", service( obj.id, obj.value ), obj.value, | hop_iwindow_open( wident, service( ident, wident, value, path, multiselect ), title, | function hop_filebrowse( service, obj, width, height, event, onselect ) { var x = window.innerWidth/2 - width/2; var y = event.clientY + 20; if( (y + height) > window.innerHeight ) y = window.innerHeight - height; obj.onselect = onselect; hop_iwindow_open( "file browser", service( obj.id, obj.value ), obj.value, "hop-file-browse", width, height, x, y );} |
if( event.which == 9 ) { | if( hop_event_key_code( event ) == 9 ) { | function hop_fileselect_keypress( service, obj, event, onreturn ) { if( event.which == 9 ) { hop_stop_propagation( event, false ); if( !hop_fileselect_init ) hop_fileselect_init = obj.value; if( hop_fileselect_count == -1 ) { with_hop( service( obj.value ), function( v ) { hop_fileselect_completions = v; hop_fileselect_complete( obj, v ); } ); } else { hop_fileselect_complete( obj, hop_fileselect_completions ); } } else { hop_fileselect_count = -1; hop_fileselect_completions = false; if( event.which == 13 ) { hop_stop_propagation( event, false ); obj.onreturn = onreturn; obj.onreturn(); } }} |
if( event.which == 13 ) { | if( hop_event_key_code( event ) == 13 ) { | function hop_fileselect_keypress( service, obj, event, onreturn ) { if( event.which == 9 ) { hop_stop_propagation( event, false ); if( !hop_fileselect_init ) hop_fileselect_init = obj.value; if( hop_fileselect_count == -1 ) { with_hop( service( obj.value ), function( v ) { hop_fileselect_completions = v; hop_fileselect_complete( obj, v ); } ); } else { hop_fileselect_complete( obj, hop_fileselect_completions ); } } else { hop_fileselect_count = -1; hop_fileselect_completions = false; if( event.which == 13 ) { hop_stop_propagation( event, false ); obj.onreturn = onreturn; obj.onreturn(); } }} |
function hop_fileselect_keypress( service, obj, event ) { | function hop_fileselect_keypress( service, obj, event, onreturn ) { | function hop_fileselect_keypress( service, obj, event ) { if( event.which == 9 ) { hop_stop_propagation( event, false ); if( !hop_fileselect_init ) hop_fileselect_init = obj.value; if( hop_fileselect_count == -1 ) { with_hop( service( obj.value ), function( v ) { hop_fileselect_completions = v; hop_fileselect_complete( obj, v ); } ); } else { hop_fileselect_complete( obj, hop_fileselect_completions ); } } else { hop_fileselect_count = -1; hop_fileselect_completions = false; if( event.which == 13 ) { if( obj.onchange ) { obj.onchange(); } } }} |
if( obj.onchange ) { obj.onchange(); } | hop_stop_propagation( event, false ); obj.onreturn = onreturn; obj.onreturn(); | function hop_fileselect_keypress( service, obj, event ) { if( event.which == 9 ) { hop_stop_propagation( event, false ); if( !hop_fileselect_init ) hop_fileselect_init = obj.value; if( hop_fileselect_count == -1 ) { with_hop( service( obj.value ), function( v ) { hop_fileselect_completions = v; hop_fileselect_complete( obj, v ); } ); } else { hop_fileselect_complete( obj, hop_fileselect_completions ); } } else { hop_fileselect_count = -1; hop_fileselect_completions = false; if( event.which == 13 ) { if( obj.onchange ) { obj.onchange(); } } }} |
HopDrag.init(el); | var h = document.getElementById(id + "-handle"); HopDrag.init(el, h); | function hop_float_window_init(id, inframe){ var el = document.getElementById(id); HopDrag.init(el); el.inFrame = inframe;} |
obj.style.background = colors[ i ]; | function hop_fx_fade_background( obj, delay, step, colors ) { var it; var i = 0; var func = function() { i++; obj.style.background = colors[ i ]; return (i < colors.length); } obj.style.background = colors[ i ]; it = setInterval( function() { clearInterval( it ); hop_fx_repeat( func, step ) }, delay );} |
|
paned.pan1.style.height = fraction; | hop_style_set( paned.pan1, "height", fraction ); | function hop_hpaned_fraction_set( paned, fraction ) { if( (fraction instanceof String) || (typeof fraction == "string") ) { paned.pan1.style.height = fraction; } else { if( (fraction < 0) || (fraction > 100) ) { return; } paned.pan1.style.height = fraction + "%"; } if( paned.fraction != fraction ) { paned.fraction = fraction; if( paned.onresize != undefined ) { paned.onresize(); } }} |
paned.pan1.style.height = fraction + "%"; | hop_style_set( paned.pan1, "height", fraction + "%" ); | function hop_hpaned_fraction_set( paned, fraction ) { if( (fraction instanceof String) || (typeof fraction == "string") ) { paned.pan1.style.height = fraction; } else { if( (fraction < 0) || (fraction > 100) ) { return; } paned.pan1.style.height = fraction + "%"; } if( paned.fraction != fraction ) { paned.fraction = fraction; if( paned.onresize != undefined ) { paned.onresize(); } }} |
if( (fraction < 0) || (fraction > 100) ) { return; | if( (fraction instanceof String) || (typeof fraction == "string") ) { paned.pan1.style.height = fraction; } else { if( (fraction < 0) || (fraction > 100) ) { return; } paned.pan1.style.height = fraction + "%"; | function hop_hpaned_fraction_set( paned, fraction ) { if( (fraction < 0) || (fraction > 100) ) { return; } paned.pan1.style.height = fraction + "%"; if( paned.fraction != fraction ) { paned.fraction = fraction; if( paned.onresize != undefined ) { paned.onresize(); } }} |
paned.pan1.style.height = fraction + "%"; | function hop_hpaned_fraction_set( paned, fraction ) { if( (fraction < 0) || (fraction > 100) ) { return; } paned.pan1.style.height = fraction + "%"; if( paned.fraction != fraction ) { paned.fraction = fraction; if( paned.onresize != undefined ) { paned.onresize(); } }} |
|
var val = e.clientY - hop_element_y( paned ); | var val = hop_event_mouse_y( e ) - hop_element_y( paned ); | function hop_hpaned_mousemove( e, paned ) { var val = e.clientY - hop_element_y( paned ); paned.pan1.style.height = val;} |
paned.pan1.style.height = val; | hop_style_set( paned.pan1, "height", val ); | function hop_hpaned_mousemove( e, paned ) { var val = e.clientY - hop_element_y( paned ); paned.pan1.style.height = val;} |
img.classname = "hop-busy-anim"; | function hop_inner( method, service, success, failure, sync, mute ) { var http = new XMLHttpRequest(); var vis = false; if( !mute ) { vis = document.createElement( "div" ); vis.style.setProperty( "position", "absolute", "" ); vis.style.setProperty( "top", "5", "" ); vis.style.setProperty( "right", "5", "" ); vis.style.setProperty( "z-index", "100", "" ); vis.style.setProperty( "background", "#eeeeee", "" ); vis.style.setProperty( "-moz-opacity", "0.7", "" ); vis.style.setProperty( "border-color", "black", "" ); vis.style.setProperty( "border-style", "outset", "" ); vis.style.setProperty( "border-width", "1px", "" ); vis.style.setProperty( "padding", "2px", "" ); vis.title = service; var img = document.createElement( "img" ); img.src = hop_busy_anim; vis.appendChild( img ); document.body.appendChild( vis ); } http.open( method, service, (sync != true) ); http.onreadystatechange = function() { if( http.readyState == 4 ) { var status; if( !mute ) { document.body.removeChild( vis ); } try { status = http.status; } catch( e ) { if( failure ) { failure( http ); } else { throw( e ); } } switch( status ) { case 200: if( success ) { success( http ); } else { hop_js_eval( http ); } break; case 204: break; case 257: hop_js_eval( http ); break; case 258: if( http.responseText != null ) eval( http.responseText ); break; case 259: hop_set_cookie( http ); break; case 407: alert( "*** Hop Authentication Error " + http.status + ": `" + http.responseText + "'" ); break; default: if( (status > 200) && (status < 300) ) { if( success ) { success( http ); } } else { if( failure ) { failure( http ); } else { hop_default_failure( http ); } } } } } http.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded; charset=ISO-8859-1' );/* http.setTimeouts = 1000; */ http.send( null ); return http;} |
|
return (obj instanceof HTMLElement); } | return (obj instanceof HTMLElement) || (obj.__proto__ == ifproto); } | hop_is_html_element = function hop_is_html_element( obj ) { return (obj instanceof HTMLElement); } |
if( win.close ) { win.close( win ); } else { win.style.display = "none"; } | win.style.display = "none"; if( win.onclose ) win.onclose(); | function hop_iwindow_close( id ) { var win = (id instanceof HTMLElement) ? id : document.getElementById( id ); if( win.close ) { win.close( win ); } else { win.style.display = "none"; }} |
win.style.display = "none"; | hop_style_set( win, "display", "none" ); | function hop_iwindow_close( id ) { var win = hop_is_html_element( id ) ? id : document.getElementById( id ); win.style.display = "none"; /* user event */ if( win.onclose ) win.onclose();} |
var win = ((id instanceof HTMLElement) || (id instanceof Object && id.propertyIsEnumerable( "innerHTML" ))) ? id : document.getElementById( id ); | var win = hop_isHTMLElement( id ) ? id : document.getElementById( id ); | function hop_iwindow_close( id ) { var win = ((id instanceof HTMLElement) || (id instanceof Object && id.propertyIsEnumerable( "innerHTML" ))) ? id : document.getElementById( id ); win.style.display = "none"; /* user event */ if( win.onclose ) win.onclose();} |
var win = (id instanceof HTMLElement) ? id : document.getElementById( id ); | var win = ((id instanceof HTMLElement) || (id instanceof Object && id.propertyIsEnumerable( "innerHTML" ))) ? id : document.getElementById( id ); | function hop_iwindow_close( id ) { var win = (id instanceof HTMLElement) ? id : document.getElementById( id ); win.style.display = "none"; /* user event */ if( win.onclose ) win.onclose();} |
var dx = hop_mouse_x( event ) - win.offsetLeft; var dy = hop_mouse_y( event ) - win.offsetTop; | var dx = hop_event_mouse_x( event ) - win.offsetLeft; var dy = hop_event_mouse_y( event ) - win.offsetTop; | function hop_iwindow_drag( event, win ) { var dx = hop_mouse_x( event ) - win.offsetLeft; var dy = hop_mouse_y( event ) - win.offsetTop; var ocursor = win.el_handle.style.cursor; hop_iwindow_raise( win ); hop_style_set( win.el_main, "height", win.el_main.offsetHeight ); hop_style_set( win.el_main, "width", win.el_main.offsetWidth ); hop_style_set( win.el_body, "visibility", "hidden" ); hop_style_set( win.el_handle, "cursor", "move" ); var mousemove = function( event ) { var nx = (hop_mouse_x( event ) - dx); var ny = (hop_mouse_y( event ) - dy); if( win.user_parent ) { var p = win.parentNode; var px = hop_element_x( p ); var py = hop_element_y( p ); if( (nx > px) && ((nx + win.offsetWidth) < (px + p.offsetWidth)) ) { hop_style_set( win, "left", nx ); } if( (ny > py) && ((ny + win.offsetHeight) < (py + p.offsetHeight)) ) { hop_style_set( win, "top", ny ); } } else { if( nx > 0 ) hop_style_set( win, "left", nx ); if( ny > 0 ) hop_style_set( win, "top", ny ); } } var mouseup = function( event ) { hop_remove_event_listener( document, "mousemove", mousemove ); hop_remove_event_listener( document, "mouseup", mouseup ); hop_style_set( win.el_handle, "cursor", ocursor ); hop_style_set( win.el_body, "visibility", "visible" ); /* user event */ if( win.ondrag ) win.ondrag(); } hop_add_event_listener( document, "mousemove", mousemove ); hop_add_event_listener( document, "mouseup", mouseup ); hop_stop_propagation( event );} |
var nx = (hop_mouse_x( event ) - dx); var ny = (hop_mouse_y( event ) - dy); | var nx = (hop_event_mouse_x( event ) - dx); var ny = (hop_event_mouse_y( event ) - dy); | function hop_iwindow_drag( event, win ) { var dx = hop_mouse_x( event ) - win.offsetLeft; var dy = hop_mouse_y( event ) - win.offsetTop; var ocursor = win.el_handle.style.cursor; hop_iwindow_raise( win ); hop_style_set( win.el_main, "height", win.el_main.offsetHeight ); hop_style_set( win.el_main, "width", win.el_main.offsetWidth ); hop_style_set( win.el_body, "visibility", "hidden" ); hop_style_set( win.el_handle, "cursor", "move" ); var mousemove = function( event ) { var nx = (hop_mouse_x( event ) - dx); var ny = (hop_mouse_y( event ) - dy); if( win.user_parent ) { var p = win.parentNode; var px = hop_element_x( p ); var py = hop_element_y( p ); if( (nx > px) && ((nx + win.offsetWidth) < (px + p.offsetWidth)) ) { hop_style_set( win, "left", nx ); } if( (ny > py) && ((ny + win.offsetHeight) < (py + p.offsetHeight)) ) { hop_style_set( win, "top", ny ); } } else { if( nx > 0 ) hop_style_set( win, "left", nx ); if( ny > 0 ) hop_style_set( win, "top", ny ); } } var mouseup = function( event ) { hop_remove_event_listener( document, "mousemove", mousemove ); hop_remove_event_listener( document, "mouseup", mouseup ); hop_style_set( win.el_handle, "cursor", ocursor ); hop_style_set( win.el_body, "visibility", "visible" ); /* user event */ if( win.ondrag ) win.ondrag(); } hop_add_event_listener( document, "mousemove", mousemove ); hop_add_event_listener( document, "mouseup", mouseup ); hop_stop_propagation( event );} |
debug( "ny=" + ny + "\n" ); | function hop_iwindow_drag( event, win ) { var dx = event.clientX - hop_element_x( win ); var dy = event.clientY - hop_element_y( win ); var ocursor = win.el_handle.style.cursor; hop_iwindow_raise( win ); win.el_main.style.height = win.el_main.offsetHeight; win.el_main.style.width = win.el_main.offsetWidth; win.el_body.style.visibility = "hidden"; win.el_handle.style.cursor = "move"; document.onmousemove = function( event ) { if( event == undefined ) event = window.event; var nx = (event.clientX - dx); var ny = (event.clientY - dy); if( win.user_parent ) { var p = win.parentNode; var px = hop_element_x( p ); var py = hop_element_y( p ); if( (nx > px) && ((nx + win.offsetWidth) < px + p.offsetWidth) ) { win.style.left = nx; } if( (ny > py) && ((ny + win.offsetHeight) < py + p.offsetHeight) ) { win.style.top = ny; } } else { if( nx > 0 ) win.style.left = nx; if( ny > 0 ) win.style.top = ny; } } document.onmouseup = function( event ) { if( event == undefined ) event = window.event; document.onmousemove = false; win.el_handle.style.cursor = ocursor; win.el_body.style.visibility = "visible"; /* user event */ if( win.ondrag ) win.ondrag(); } event.preventDefault(); event.stopPropagation();} |
|
win.el_main.style.height = win.el_content.offsetHeight; win.el_main.style.width = win.el_content.offsetWidth; | win.el_main.style.height = win.el_main.offsetHeight; win.el_main.style.width = win.el_main.offsetWidth; | function hop_iwindow_drag( event, win ) { var dx = event.clientX - hop_element_x( win ); var dy = event.clientY - hop_element_y( win ); var ocursor = win.el_handle.style.cursor; win.el_main.style.height = win.el_content.offsetHeight; win.el_main.style.width = win.el_content.offsetWidth; win.el_body.style.display = "none"; win.el_handle.style.cursor = "move"; document.onmousemove = function( event ) { win.style.left = event.clientX - dx; win.style.top = event.clientY - dy; } document.onmouseup = function( event ) { document.onmousemove = false; win.el_handle.style.cursor = ocursor; win.el_body.style.display = "block"; } event.preventDefault(); event.stopPropagation();} |
if( win.ondrag ) win.ondrag(); | function hop_iwindow_drag( event, win ) { var dx = event.clientX - hop_element_x( win ); var dy = event.clientY - hop_element_y( win ); var ocursor = win.el_handle.style.cursor; win.el_main.style.height = win.el_content.offsetHeight; win.el_main.style.width = win.el_content.offsetWidth; win.el_body.style.display = "none"; win.el_handle.style.cursor = "move"; document.onmousemove = function( event ) { win.style.left = event.clientX - dx; win.style.top = event.clientY - dy; } document.onmouseup = function( event ) { document.onmousemove = false; win.el_handle.style.cursor = ocursor; win.el_body.style.display = "block"; } event.preventDefault(); event.stopPropagation();} |
|
var dx = event.clientX - hop_element_x( win ); var dy = event.clientY - hop_element_y( win ); | var dx = event.clientX - win.offsetLeft; var dy = event.clientY - win.offsetTop; | function hop_iwindow_drag( event, win ) { var dx = event.clientX - hop_element_x( win ); var dy = event.clientY - hop_element_y( win ); var ocursor = win.el_handle.style.cursor; hop_iwindow_raise( win ); win.el_main.style.height = win.el_main.offsetHeight; win.el_main.style.width = win.el_main.offsetWidth; win.el_body.style.visibility = "hidden"; win.el_handle.style.cursor = "move"; debug( "win-drag, clientY=" + event.clientY + " y=" + hop_element_y( win ) + " dy=" + dy + "\n" ); document.onmousemove = function( event ) { if( event == undefined ) event = window.event; var nx = (event.clientX - dx); var ny = (event.clientY - dy); if( win.user_parent ) { var p = win.parentNode; var px = hop_element_x( p ); var py = hop_element_y( p ); if( (nx > px) && ((nx + win.offsetWidth) < px + p.offsetWidth) ) { win.style.left = nx; } if( (ny > py) && ((ny + win.offsetHeight) < py + p.offsetHeight) ) { win.style.top = ny; } } else { if( nx > 0 ) win.style.left = nx; if( ny > 0 ) win.style.top = ny; debug( "ny=" + ny + "\n" ); } } document.onmouseup = function( event ) { if( event == undefined ) event = window.event; document.onmousemove = false; win.el_handle.style.cursor = ocursor; win.el_body.style.visibility = "visible"; /* user event */ if( win.ondrag ) win.ondrag(); } event.preventDefault(); event.stopPropagation();} |
debug( "win-drag, clientY=" + event.clientY + " y=" + hop_element_y( win ) + " dy=" + dy + "\n" ); document.onmousemove = function( event ) { if( event == undefined ) event = window.event; | var mousemove = function( event ) { | function hop_iwindow_drag( event, win ) { var dx = event.clientX - hop_element_x( win ); var dy = event.clientY - hop_element_y( win ); var ocursor = win.el_handle.style.cursor; hop_iwindow_raise( win ); win.el_main.style.height = win.el_main.offsetHeight; win.el_main.style.width = win.el_main.offsetWidth; win.el_body.style.visibility = "hidden"; win.el_handle.style.cursor = "move"; debug( "win-drag, clientY=" + event.clientY + " y=" + hop_element_y( win ) + " dy=" + dy + "\n" ); document.onmousemove = function( event ) { if( event == undefined ) event = window.event; var nx = (event.clientX - dx); var ny = (event.clientY - dy); if( win.user_parent ) { var p = win.parentNode; var px = hop_element_x( p ); var py = hop_element_y( p ); if( (nx > px) && ((nx + win.offsetWidth) < px + p.offsetWidth) ) { win.style.left = nx; } if( (ny > py) && ((ny + win.offsetHeight) < py + p.offsetHeight) ) { win.style.top = ny; } } else { if( nx > 0 ) win.style.left = nx; if( ny > 0 ) win.style.top = ny; debug( "ny=" + ny + "\n" ); } } document.onmouseup = function( event ) { if( event == undefined ) event = window.event; document.onmousemove = false; win.el_handle.style.cursor = ocursor; win.el_body.style.visibility = "visible"; /* user event */ if( win.ondrag ) win.ondrag(); } event.preventDefault(); event.stopPropagation();} |
if( (nx > px) && ((nx + win.offsetWidth) < px + p.offsetWidth) ) { | if( (nx > px) && ((nx + win.offsetWidth) < (px + p.offsetWidth)) ) { | function hop_iwindow_drag( event, win ) { var dx = event.clientX - hop_element_x( win ); var dy = event.clientY - hop_element_y( win ); var ocursor = win.el_handle.style.cursor; hop_iwindow_raise( win ); win.el_main.style.height = win.el_main.offsetHeight; win.el_main.style.width = win.el_main.offsetWidth; win.el_body.style.visibility = "hidden"; win.el_handle.style.cursor = "move"; debug( "win-drag, clientY=" + event.clientY + " y=" + hop_element_y( win ) + " dy=" + dy + "\n" ); document.onmousemove = function( event ) { if( event == undefined ) event = window.event; var nx = (event.clientX - dx); var ny = (event.clientY - dy); if( win.user_parent ) { var p = win.parentNode; var px = hop_element_x( p ); var py = hop_element_y( p ); if( (nx > px) && ((nx + win.offsetWidth) < px + p.offsetWidth) ) { win.style.left = nx; } if( (ny > py) && ((ny + win.offsetHeight) < py + p.offsetHeight) ) { win.style.top = ny; } } else { if( nx > 0 ) win.style.left = nx; if( ny > 0 ) win.style.top = ny; debug( "ny=" + ny + "\n" ); } } document.onmouseup = function( event ) { if( event == undefined ) event = window.event; document.onmousemove = false; win.el_handle.style.cursor = ocursor; win.el_body.style.visibility = "visible"; /* user event */ if( win.ondrag ) win.ondrag(); } event.preventDefault(); event.stopPropagation();} |
if( (ny > py) && ((ny + win.offsetHeight) < py + p.offsetHeight) ) { | if( (ny > py) && ((ny + win.offsetHeight) < (py + p.offsetHeight)) ) { | function hop_iwindow_drag( event, win ) { var dx = event.clientX - hop_element_x( win ); var dy = event.clientY - hop_element_y( win ); var ocursor = win.el_handle.style.cursor; hop_iwindow_raise( win ); win.el_main.style.height = win.el_main.offsetHeight; win.el_main.style.width = win.el_main.offsetWidth; win.el_body.style.visibility = "hidden"; win.el_handle.style.cursor = "move"; debug( "win-drag, clientY=" + event.clientY + " y=" + hop_element_y( win ) + " dy=" + dy + "\n" ); document.onmousemove = function( event ) { if( event == undefined ) event = window.event; var nx = (event.clientX - dx); var ny = (event.clientY - dy); if( win.user_parent ) { var p = win.parentNode; var px = hop_element_x( p ); var py = hop_element_y( p ); if( (nx > px) && ((nx + win.offsetWidth) < px + p.offsetWidth) ) { win.style.left = nx; } if( (ny > py) && ((ny + win.offsetHeight) < py + p.offsetHeight) ) { win.style.top = ny; } } else { if( nx > 0 ) win.style.left = nx; if( ny > 0 ) win.style.top = ny; debug( "ny=" + ny + "\n" ); } } document.onmouseup = function( event ) { if( event == undefined ) event = window.event; document.onmousemove = false; win.el_handle.style.cursor = ocursor; win.el_body.style.visibility = "visible"; /* user event */ if( win.ondrag ) win.ondrag(); } event.preventDefault(); event.stopPropagation();} |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.