Removed some simplified english, tag changes and cleared out small nuggets of dead code
This commit is contained in:
@@ -104,7 +104,7 @@ var Editor = (function () {
|
||||
// Creates a MochiKit-style iterator that goes over a series of DOM
|
||||
// nodes. The values it yields are strings, the textual content of
|
||||
// the nodes. It makes sure that all nodes up to and including the
|
||||
// one whose text is being yielded have been 'normalized' to be just
|
||||
// one whose text is being yielded have been 'normalised' to be just
|
||||
// <span> and <br> elements.
|
||||
// See the story.html file for some short remarks about the use of
|
||||
// continuation-passing style in this iterator.
|
||||
@@ -145,7 +145,7 @@ var Editor = (function () {
|
||||
// confused when the cursor is between two BRs.
|
||||
var afterBR = true;
|
||||
|
||||
// Insert a normalized node at the current point. If it is a text
|
||||
// Insert a normalised node at the current point. If it is a text
|
||||
// node, wrap it in a <span>, and give that span a currentText
|
||||
// property -- this is used to cache the nodeValue, because
|
||||
// directly accessing nodeValue is horribly slow on some browsers.
|
||||
@@ -171,7 +171,7 @@ var Editor = (function () {
|
||||
|
||||
// Extract the text and newlines from a DOM node, insert them into
|
||||
// the document, and yield the textual content. Used to replace
|
||||
// non-normalized nodes.
|
||||
// non-normalised nodes.
|
||||
function writeNode(node, c, end) {
|
||||
var toYield = [];
|
||||
forEach(simplifyDOM(node, end), function (part) {
|
||||
@@ -180,7 +180,7 @@ var Editor = (function () {
|
||||
return yield(toYield.join(""), c);
|
||||
}
|
||||
|
||||
// Check whether a node is a normalized <span> element.
|
||||
// Check whether a node is a normalised <span> element.
|
||||
function partNode(node) {
|
||||
if (node.isPart && node.childNodes.length == 1 && node.firstChild.nodeType == 3) {
|
||||
node.currentText = node.firstChild.nodeValue;
|
||||
@@ -190,8 +190,8 @@ var Editor = (function () {
|
||||
}
|
||||
|
||||
// Handle a node. Add its successor to the continuation if there
|
||||
// is one, find out whether the node is normalized. If it is,
|
||||
// yield its content, otherwise, normalize it (writeNode will take
|
||||
// is one, find out whether the node is normalised. If it is,
|
||||
// yield its content, otherwise, normalise it (writeNode will take
|
||||
// care of yielding).
|
||||
function scanNode(node, c) {
|
||||
if (node.nextSibling)
|
||||
@@ -1188,7 +1188,7 @@ var Editor = (function () {
|
||||
},
|
||||
|
||||
// The function that does the actual highlighting/colouring (with
|
||||
// help from the parser and the DOM normalizer). Its interface is
|
||||
// help from the parser and the DOM normaliser). Its interface is
|
||||
// rather overcomplicated, because it is used in different
|
||||
// situations: ensuring that a certain line is highlighted, or
|
||||
// highlighting up to X milliseconds starting from a certain
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Parse function for JavaScript. Makes use of the tokenizer from
|
||||
* tokenizejavascript.js. Note that your parsers do not have to be
|
||||
* this complicated -- if you don't want to recognize local variables,
|
||||
* this complicated -- if you don't want to recognise local variables,
|
||||
* in many languages it is enough to just look for braces, semicolons,
|
||||
* parentheses, etc, and know when you are inside a string or comment.
|
||||
*
|
||||
@@ -297,7 +297,7 @@ var JSParser = Editor.Parser = (function () {
|
||||
if (atomicTypes.hasOwnProperty(type)) cont(expect(":"), expression);
|
||||
}
|
||||
|
||||
// Parses a comma-separated list of the things that are recognized
|
||||
// Parses a comma-separated list of the things that are recognised
|
||||
// by the 'what' argument.
|
||||
function commasep(what, end) {
|
||||
function proceed(type) {
|
||||
|
||||
@@ -302,7 +302,7 @@ var select = {};
|
||||
}
|
||||
}
|
||||
|
||||
// Used to normalize the effect of the enter key, since browsers
|
||||
// Used to normalise the effect of the enter key, since browsers
|
||||
// do widely different things when pressing enter in designMode.
|
||||
select.insertNewlineAtCursor = function (window) {
|
||||
insertAtCursor(window, "<br>");
|
||||
@@ -396,7 +396,7 @@ var select = {};
|
||||
// We want the nodes right at the cursor, not one of their
|
||||
// ancestors with a suitable offset. This goes down the DOM tree
|
||||
// until a 'leaf' is reached (or is it *up* the DOM tree?).
|
||||
function normalize(point) {
|
||||
function normalise(point) {
|
||||
while (point.node.nodeType != 3 && !isBR(point.node)) {
|
||||
var newNode = point.node.childNodes[point.offset] || point.node.nextSibling;
|
||||
point.offset = 0;
|
||||
@@ -410,8 +410,8 @@ var select = {};
|
||||
}
|
||||
}
|
||||
|
||||
normalize(currentSelection.start);
|
||||
normalize(currentSelection.end);
|
||||
normalise(currentSelection.start);
|
||||
normalise(currentSelection.end);
|
||||
};
|
||||
|
||||
select.selectMarked = function () {
|
||||
|
||||
@@ -91,7 +91,7 @@ var matching = {
|
||||
};
|
||||
|
||||
// Standardize a few unportable event properties.
|
||||
function normalizeEvent(event) {
|
||||
function normaliseEvent(event) {
|
||||
if (!event.stopPropagation) {
|
||||
event.stopPropagation = function () {
|
||||
this.cancelBubble = true;
|
||||
@@ -117,7 +117,7 @@ function normalizeEvent(event) {
|
||||
// Portably register event handlers.
|
||||
function addEventHandler(node, type, handler, removeFunc) {
|
||||
function wrapHandler(event) {
|
||||
handler(normalizeEvent(event || window.event));
|
||||
handler(normaliseEvent(event || window.event));
|
||||
}
|
||||
|
||||
if (typeof node.addEventListener == "function") {
|
||||
|
||||
Vendored
+4
-4
@@ -80,7 +80,7 @@ if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.v
|
||||
return J[G]}
|
||||
if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}
|
||||
if(L){J.setAttribute(G,""+K)}
|
||||
var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}
|
||||
var E=!o.support.hrefnormalised&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}
|
||||
if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}
|
||||
return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}
|
||||
G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}
|
||||
@@ -120,7 +120,7 @@ return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0
|
||||
if(ag==null){ag=U}
|
||||
I.relative[ah](ai,ag,Q(U))}}
|
||||
if(!ai){ai=af}
|
||||
if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}
|
||||
if(!ai){throw"Syntax error, unrecognised expression: "+(ah||Y)}
|
||||
if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}
|
||||
if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}
|
||||
return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}
|
||||
@@ -132,7 +132,7 @@ return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0
|
||||
if(ah!==g){if(!ag){aa=ai}
|
||||
ad=ad.replace(I.match[ab],"");if(!T){return[]}
|
||||
break}}}
|
||||
if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}
|
||||
if(ad==V){if(T==null){throw"Syntax error, unrecognised expression: "+ad}else{break}}
|
||||
V=ad}
|
||||
return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}
|
||||
for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}
|
||||
@@ -244,7 +244,7 @@ return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0
|
||||
o.ready()})()}}}
|
||||
o.event.add(l,"load",o.ready)}
|
||||
o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML=' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}
|
||||
o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}
|
||||
o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefnormalised:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}
|
||||
F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}
|
||||
F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}
|
||||
o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+6
-3
@@ -1,4 +1,5 @@
|
||||
var undoC, neoCMSGlobalPath, neoCMSPath, neoCMSFiles, neoCMSHTMLEdit, neoCMSFilePath, neoCMSImagePath, fileTarget, origImg,
|
||||
var undoC, neoCMSGlobalPath, neoCMSPath, neoCMSFiles, neoCMSHTMLEdit, neoCMSFilePath, neoCMSImagePath, fileTarget,
|
||||
origImg,
|
||||
bm;
|
||||
$(function () {
|
||||
$(window).bind('load', neocmsStart);
|
||||
@@ -1167,7 +1168,8 @@ imageConstrain = function (ele) {
|
||||
}
|
||||
};
|
||||
changeSize = function (f, ele) {
|
||||
var ele = (ele) ? ele : $('.neoCMSEle', ifrDoc)[0], fval = $('#' + f).val(), fWidth = $('#neoCMSImgStatsWidth').val(),
|
||||
var ele = (ele) ? ele : $('.neoCMSEle', ifrDoc)[0], fval = $('#' + f).val(),
|
||||
fWidth = $('#neoCMSImgStatsWidth').val(),
|
||||
fHeight = $('#neoCMSImgStatsHeight').val();
|
||||
if ($('#neoCMSUploadImgClone', ifrDoc).length) ele = $('#neoCMSUploadImgClone', ifrDoc);
|
||||
var eleWidth = $(ele, ifrDoc).width();
|
||||
@@ -1520,7 +1522,8 @@ vidBind = function () {
|
||||
})
|
||||
};
|
||||
vidDone = function (ele) {
|
||||
var eleEditNum = $(ele, ifrDoc).attr('neocmsid').replace('neoCMSEditArea', ''), content = $('#neoCMSVidEmbed').val();
|
||||
var eleEditNum = $(ele, ifrDoc).attr('neocmsid').replace('neoCMSEditArea', ''),
|
||||
content = $('#neoCMSVidEmbed').val();
|
||||
createUndo(ele);
|
||||
content = $(content, ifrDoc).addClass('neocms');
|
||||
var constring = eleHTML(content);
|
||||
|
||||
Reference in New Issue
Block a user