summaryrefslogtreecommitdiffstats
path: root/js/yui3/editor-para
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2014-09-03 05:46:38 +0200
committerDylan William Hardison <dylan@hardison.net>2014-09-03 05:48:52 +0200
commitbd23fbfeccd49a406f6a8d99a21371ad7ade07ba (patch)
tree4f7fe26cad167380d7d17ce4616173a90e684acf /js/yui3/editor-para
parent14be79f77292305fbd5a9508ca6142e97498abb5 (diff)
downloadbugzilla-bd23fbfeccd49a406f6a8d99a21371ad7ade07ba.tar.gz
bugzilla-bd23fbfeccd49a406f6a8d99a21371ad7ade07ba.tar.xz
Bug 913647: Deploy YUI 3.17.2 for BMO
r=glob
Diffstat (limited to 'js/yui3/editor-para')
-rw-r--r--js/yui3/editor-para/editor-para-min.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/js/yui3/editor-para/editor-para-min.js b/js/yui3/editor-para/editor-para-min.js
index 813da3109..ffb4d975e 100644
--- a/js/yui3/editor-para/editor-para-min.js
+++ b/js/yui3/editor-para/editor-para-min.js
@@ -1,7 +1,8 @@
/*
-YUI 3.7.3 (build 5687)
-Copyright 2012 Yahoo! Inc. All rights reserved.
+YUI 3.17.2 (build 9c3c78e)
+Copyright 2014 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
-YUI.add("editor-para",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)},r="host",i="body",s="nodeChange",o="parentNode",u=i+" > p",a="p",f="<br>",l="firstChild",c="li";e.extend(n,e.Plugin.EditorParaBase,{_onNodeChange:function(t){var n=this.get(r),s=n.getInstance(),h,p,d,v,m,g=s.EditorSelection.DEFAULT_BLOCK_TAG,y,b,w,E,S,x,T,N,C,k,L,A,O,M,_,D,H=":last-child",B,j,F,I,q,R=!1,U;switch(t.changedType){case"enter-up":B=this._lastPara?this._lastPara:t.changedNode,j=B.one("br.yui-cursor"),this._lastPara&&delete this._lastPara,j&&(j.previous()||j.next())&&j.ancestor(a)&&j.remove(),B.test(g)||(C=B.ancestor(g),C&&(B=C,C=null));if(B.test(g)){k=B.previous();if(k){I=k.one(H);while(!R)I?(q=I.one(H),q?I=q:R=!0):R=!0;I&&n.copyStyles(I,B)}}break;case"enter":e.UA.webkit&&t.changedEvent.shiftKey&&(n.execCommand("insertbr"),t.changedEvent.preventDefault()),t.changedNode.test("li")&&!e.UA.ie&&(h=s.EditorSelection.getText(t.changedNode),h===""&&(d=t.changedNode.ancestor("ol,ul"),F=d.getAttribute("dir"),F!==""&&(F=' dir = "'+F+'"'),d=t.changedNode.ancestor(s.EditorSelection.BLOCKS),v=s.Node.create("<p"+F+">"+s.EditorSelection.CURSOR+"</p>"),d.insert(v,"after"),t.changedNode.remove(),t.changedEvent.halt(),m=new s.EditorSelection,m.selectNode(v,!0,!1)));if(e.UA.gecko&&n.get("defaultblock")!=="p"){d=t.changedNode;if(!d.test(c)&&!d.ancestor(c)){d.test(g)||(d=d.ancestor(g)),v=s.Node.create("<"+g+"></"+g+">"),d.insert(v,"after"),m=new s.EditorSelection;if(m.anchorOffset){y=m.anchorNode.get("textContent"),p=s.one(s.config.doc.createTextNode(y.substr(0,m.anchorOffset))),b=s.one(s.config.doc.createTextNode(y.substr(m.anchorOffset))),E=m.anchorNode,E.setContent(""),S=E.cloneNode(),S.append(b),x=!1,N=E;while(!x)N=N.get(o),N&&!N.test(g)?(T=N.cloneNode(),T.set("innerHTML",""),T.append(S),w=N.get("childNodes"),U=!1,w.each(function(e){U&&T.append(e),e===E&&(U=!0)}),E=N,S=T):x=!0;b=S,m.anchorNode.append(p),b&&v.append(b)}v.get(l)&&(v=v.get(l)),v.prepend(s.EditorSelection.CURSOR),m.focusCursor(!0,!0),h=s.EditorSelection.getText(v),h!==""&&s.EditorSelection.cleanCursor(),t.changedEvent.preventDefault()}}break;case"keyup":e.UA.gecko&&s.config.doc&&s.config.doc.body&&s.config.doc.body.innerHTML.length<20&&(s.one(u)||this._fixFirstPara());break;case"backspace-up":case"backspace-down":case"delete-up":e.UA.ie||(L=s.all(u),O=s.one(i),L.item(0)&&(O=L.item(0)),A=O.one("br"),A&&(A.removeAttribute("id"),A.removeAttribute("class")),p=s.EditorSelection.getText(O),p=p.replace(/ /g,"").replace(/\n/g,""),_=O.all("img"),p.length===0&&!_.size()&&(O.test(a)||this._fixFirstPara(),M=null,t.changedNode&&t.changedNode.test(a)&&(M=t.changedNode),!M&&n._lastPara&&n._lastPara.inDoc()&&(M=n._lastPara),M&&!M.test(a)&&(M=M.ancestor(a)),M&&!M.previous()&&M.get(o)&&M.get(o).test(i)&&(t.changedEvent.frameEvent.halt(),t.preventDefault())),e.UA.webkit&&t.changedNode&&(t.preventDefault(),O=t.changedNode,O.test("li")&&!O.previous()&&!O.next()&&(h=O.get("innerHTML").replace(f,""),h===""&&O.get(o)&&(O.get(o).replace(s.Node.create(f)),t.changedEvent.frameEvent.halt(),s.EditorSelection.filterBlocks())))),e.UA.gecko&&(v=t.changedNode,D=s.config.doc.createTextNode(" "),v.appendChild(D),v.removeChild(D))}e.UA.gecko&&t.changedNode&&!t.changedNode.test(g)&&(M=t.changedNode.ancestor(g),M&&(this._lastPara=M))},initializer:function(){var t=this.get(r);if(t.editorBR){e.error("Can not plug EditorPara and EditorBR at the same time.");return}t.on(s,e.bind(this._onNodeChange,this))}},{NAME:"editorPara",NS:"editorPara",ATTRS:{host:{value:!1}}}),e.namespace("Plugin"),e.Plugin.EditorPara=n},"3.7.3",{requires:["editor-para-base"]});
+
+YUI.add("editor-para",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)},r="host",i="nodeChange",s="parentNode",o="> p",u="p",a="<br>",f="firstChild",l="li";e.extend(n,e.Plugin.EditorParaBase,{_getRoot:function(){return this.get(r).getInstance().EditorSelection.ROOT},_onNodeChange:function(t){var n=this.get(r),i=n.getInstance(),c,h,p,d,v,m=i.EditorSelection.DEFAULT_BLOCK_TAG,g,y,b,w,E,S,x,T,N,C,k,L,A,O,M,_,D=":last-child",H,B,j,F,I,q=!1,R=this._getRoot(),U;switch(t.changedType){case"enter-up":H=this._lastPara?this._lastPara:t.changedNode,B=H.one("br.yui-cursor"),this._lastPara&&delete this._lastPara,B&&(B.previous()||B.next())&&B.ancestor(u)&&B.remove(),H.test(m)||(N=H.ancestor(m),N&&(H=N,N=null));if(H.test(m)){C=H.previous();if(C){F=C.one(D);while(!q)F?(I=F.one(D),I?F=I:q=!0):q=!0;F&&n.copyStyles(F,H)}}break;case"enter":e.UA.webkit&&t.changedEvent.shiftKey&&(n.execCommand("insertbr"),t.changedEvent.preventDefault()),t.changedNode.test("li")&&!e.UA.ie&&(c=i.EditorSelection.getText(t.changedNode),c===""&&(p=t.changedNode.ancestor("ol,ul"),j=p.getAttribute("dir"),j!==""&&(j=' dir = "'+j+'"'),p=t.changedNode.ancestor(i.EditorSelection.BLOCKS),d=i.Node.create("<p"+j+">"+i.EditorSelection.CURSOR+"</p>"),p.insert(d,"after"),t.changedNode.remove(),t.changedEvent.halt(),v=new i.EditorSelection,v.selectNode(d,!0,!1)));if(e.UA.gecko&&n.get("defaultblock")!=="p"){p=t.changedNode;if(!p.test(l)&&!p.ancestor(l)){p.test(m)||(p=p.ancestor(m)),d=i.Node.create("<"+m+"></"+m+">"),p.insert(d,"after"),v=new i.EditorSelection;if(v.anchorOffset){g=v.anchorNode.get("textContent"),h=i.one(i.config.doc.createTextNode(g.substr(0,v.anchorOffset))),y=i.one(i.config.doc.createTextNode(g.substr(v.anchorOffset))),w=v.anchorNode,w.setContent(""),E=w.cloneNode(),E.append(y),S=!1,T=w;while(!S)T=T.get(s),T&&!T.test(m)?(x=T.cloneNode(),x.set("innerHTML",""),x.append(E),b=T.get("childNodes"),U=!1,b.each(function(e){U&&x.append(e),e===w&&(U=!0)}),w=T,E=x):S=!0;y=E,v.anchorNode.append(h),y&&d.append(y)}d.get(f)&&(d=d.get(f)),d.prepend(i.EditorSelection.CURSOR),v.focusCursor(!0,!0),c=i.EditorSelection.getText(d),c!==""&&i.EditorSelection.cleanCursor(),t.changedEvent.preventDefault()}}break;case"keyup":e.UA.gecko&&R&&R.getHTML().length<20&&(R.one(o)||this._fixFirstPara());break;case"backspace-up":case"backspace-down":case"delete-up":e.UA.ie||(k=R.all(o),A=R,k.item(0)&&(A=k.item(0)),L=A.one("br"),L&&(L.removeAttribute("id"),L.removeAttribute("class")),h=i.EditorSelection.getText(A),h=h.replace(/ /g,"").replace(/\n/g,""),M=A.all("img"),h.length===0&&!M.size()&&(A.test(u)||this._fixFirstPara(),O=null,t.changedNode&&t.changedNode.test(u)&&(O=t.changedNode),!O&&n._lastPara&&n._lastPara.inDoc()&&(O=n._lastPara),O&&!O.test(u)&&(O=O.ancestor(u)),O&&!O.previous()&&O.get(s)&&O.get(s).compareTo(R)&&(t.changedEvent.frameEvent.halt(),t.preventDefault())),e.UA.webkit&&t.changedNode&&(t.preventDefault(),A=t.changedNode,A.test("li")&&!A.previous()&&!A.next()&&(c=A.get("innerHTML").replace(a,""),c===""&&A.get(s)&&(A.get(s).replace(i.Node.create(a)),t.changedEvent.frameEvent.halt(),i.EditorSelection.filterBlocks())))),e.UA.gecko&&this._fixGeckoOnBackspace(i)}e.UA.gecko&&t.changedNode&&!t.changedNode.test(m)&&(O=t.changedNode.ancestor(m),O&&(this._lastPara=O))},_fixGeckoOnBackspace:function(e){var t=new e.EditorSelection,n,r;if(!t.isCollapsed||t.anchorNode.get("nodeName")!=="P"||t.anchorOffset===0)return;r=t.anchorNode.get("childNodes"),n=t.anchorNode.get("lastChild");if(t.anchorOffset!==r.size()||n.get("nodeName")!=="BR")return;if(t.anchorOffset===1){t.selectNode(t.anchorNode,!0);return}n=n.get("previousSibling");if(n.get("nodeType")!==Node.TEXT_NODE)return;offset=n.get("length"),t.getEditorOffset()===offset&&t.selectNode(n,!0,offset)},initializer:function(){var t=this.get(r);if(t.editorBR){e.error("Can not plug EditorPara and EditorBR at the same time.");return}t.on(i,e.bind(this._onNodeChange,this))}},{NAME:"editorPara",NS:"editorPara",ATTRS:{host:{value:!1}}}),e.namespace("Plugin"),e.Plugin.EditorPara=n},"3.17.2",{requires:["editor-para-base"]});