mirror of
https://github.com/WordPress/WordPress.git
synced 2024-08-25 15:22:53 +02:00
Updates package dependencies to more modern versions, also adds .nvmrc and package-lock.json as followups to [43683] and [43571]. See #44600. Fixes #45064. Built from https://develop.svn.wordpress.org/branches/5.0@43684 git-svn-id: http://core.svn.wordpress.org/branches/5.0@43513 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 line
11 KiB
JavaScript
1 line
11 KiB
JavaScript
var QTags,edCanvas,edButtons=[],edAddTag=function(){},edCheckOpenTags=function(){},edCloseAllTags=function(){},edInsertImage=function(){},edInsertLink=function(){},edInsertTag=function(){},edLink=function(){},edQuickLink=function(){},edRemoveTag=function(){},edShowButton=function(){},edShowLinks=function(){},edSpell=function(){},edToolbar=function(){};function quicktags(t){return new QTags(t)}function edInsertContent(t,e){return QTags.insertContent(e)}function edButton(t,e,n,o,a){return QTags.addButton(t,e,n,o,a,"",-1)}!function(){var r,t,e,d=function(t){var e,n,o,a;"undefined"!=typeof jQuery?jQuery(document).ready(t):((e=d).funcs=[],e.ready=function(){if(!e.isReady)for(e.isReady=!0,n=0;n<e.funcs.length;n++)e.funcs[n]()},e.isReady?t():e.funcs.push(t),e.eventAttached||(document.addEventListener?(o=function(){document.removeEventListener("DOMContentLoaded",o,!1),e.ready()},document.addEventListener("DOMContentLoaded",o,!1),window.addEventListener("load",e.ready,!1)):document.attachEvent&&(o=function(){"complete"===document.readyState&&(document.detachEvent("onreadystatechange",o),e.ready())},document.attachEvent("onreadystatechange",o),window.attachEvent("onload",e.ready),(a=function(){try{document.documentElement.doScroll("left")}catch(t){return void setTimeout(a,50)}e.ready()})()),e.eventAttached=!0))},n=(e=new Date,t=function(t){var e=t.toString();return e.length<2&&(e="0"+e),e},e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"+00:00");function u(t){return(t=(t=t||"").replace(/&([^#])(?![a-z1-4]{1,8};)/gi,"&$1")).replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}(r=QTags=function(t){if("string"==typeof t)t={id:t};else if("object"!=typeof t)return!1;var e,n,o,a,i,s=this,l=t.id,u=document.getElementById(l),c="qt_"+l;if(!l||!u)return!1;s.name=c,s.id=l,s.canvas=u,s.settings=t,o="content"!==l||"string"!=typeof adminpage||"post-new-php"!==adminpage&&"post-php"!==adminpage?c+"_toolbar":(edCanvas=u,"ed_toolbar"),(e=document.getElementById(o))||((e=document.createElement("div")).id=o,e.className="quicktags-toolbar"),u.parentNode.insertBefore(e,u),s.toolbar=e,n=function(t){var e,n=(t=t||window.event).target||t.srcElement;(n.clientWidth||n.offsetWidth)&&/ ed_button /.test(" "+n.className+" ")&&(s.canvas=u=document.getElementById(l),e=n.id.replace(c+"_",""),s.theButtons[e]&&s.theButtons[e].callback.call(s.theButtons[e],n,u,s))},i=function(){window.wpActiveEditor=l},a=document.getElementById("wp-"+l+"-wrap"),e.addEventListener?(e.addEventListener("click",n,!1),a&&a.addEventListener("click",i,!1)):e.attachEvent&&(e.attachEvent("onclick",n),a&&a.attachEvent("onclick",i)),s.getButton=function(t){return s.theButtons[t]},s.getButtonElement=function(t){return document.getElementById(c+"_"+t)},s.init=function(){d(function(){r._buttonsInit(l)})},s.remove=function(){delete r.instances[l],e&&e.parentNode&&e.parentNode.removeChild(e)},(r.instances[l]=s).init()}).instances={},r.getInstance=function(t){return r.instances[t]},r._buttonsInit=function(t){var c=this;function e(t){var e,n,o,a,i,s,l,u;for(l in(i=c.instances[t]).canvas,e=i.name,o={},u=a="",(n=i.settings).buttons&&(u=","+n.buttons+","),edButtons)edButtons[l]&&(s=edButtons[l].id,u&&-1!==",strong,em,link,block,del,ins,img,ul,ol,li,code,more,close,".indexOf(","+s+",")&&-1===u.indexOf(","+s+",")||edButtons[l].instance&&edButtons[l].instance!==t||(o[s]=edButtons[l],edButtons[l].html&&(a+=edButtons[l].html(e+"_"))));u&&-1!==u.indexOf(",dfw,")&&(o.dfw=new r.DFWButton,a+=o.dfw.html(e+"_")),"rtl"===document.getElementsByTagName("html")[0].dir&&(o.textdirection=new r.TextDirectionButton,a+=o.textdirection.html(e+"_")),i.toolbar.innerHTML=a,i.theButtons=o,"undefined"!=typeof jQuery&&jQuery(document).triggerHandler("quicktags-init",[i])}if(t)e(t);else for(t in c.instances)e(t);c.buttonsInitDone=!0},r.addButton=function(t,e,n,o,a,i,s,l,u){var c;if(t&&e){if(s=s||0,o=o||"",u=u||{},"function"==typeof n)(c=new r.Button(t,e,a,i,l,u)).callback=n;else{if("string"!=typeof n)return;c=new r.TagButton(t,e,n,o,a,i,l,u)}if(-1===s)return c;if(0<s){for(;void 0!==edButtons[s];)s++;edButtons[s]=c}else edButtons[edButtons.length]=c;this.buttonsInitDone&&this._buttonsInit()}},r.insertContent=function(t){var e,n,o,a,i,s=document.getElementById(wpActiveEditor);return!!s&&(document.selection?(s.focus(),document.selection.createRange().text=t):s.selectionStart||0===s.selectionStart?(a=s.value,e=s.selectionStart,n=s.selectionEnd,o=s.scrollTop,s.value=a.substring(0,e)+t+a.substring(n,a.length),s.selectionStart=e+t.length,s.selectionEnd=e+t.length,s.scrollTop=o):s.value+=t,s.focus(),document.createEvent?((i=document.createEvent("HTMLEvents")).initEvent("change",!1,!0),s.dispatchEvent(i)):s.fireEvent&&s.fireEvent("onchange"),!0)},r.Button=function(t,e,n,o,a,i){this.id=t,this.display=e,this.access="",this.title=o||"",this.instance=a||"",this.attr=i||{}},r.Button.prototype.html=function(t){var e,n,o=this.title?' title="'+u(this.title)+'"':"",a=this.attr&&this.attr.ariaLabel?' aria-label="'+u(this.attr.ariaLabel)+'"':"",i=this.display?' value="'+u(this.display)+'"':"",s=this.id?' id="'+u(t+this.id)+'"':"",l=(n=window.wp)&&n.editor&&n.editor.dfw;return"fullscreen"===this.id?'<button type="button"'+s+' class="ed_button qt-dfw qt-fullscreen"'+o+a+"></button>":"dfw"===this.id?(e=l&&l.isActive()?"":' disabled="disabled"','<button type="button"'+s+' class="ed_button qt-dfw'+(l&&l.isOn()?" active":"")+'"'+o+a+e+"></button>"):'<input type="button"'+s+' class="ed_button button button-small"'+o+a+i+" />"},r.Button.prototype.callback=function(){},r.TagButton=function(t,e,n,o,a,i,s,l){r.Button.call(this,t,e,a,i,s,l),this.tagStart=n,this.tagEnd=o},r.TagButton.prototype=new r.Button,r.TagButton.prototype.openTag=function(t,e){e.openTags||(e.openTags=[]),this.tagEnd&&(e.openTags.push(this.id),t.value="/"+t.value,this.attr.ariaLabelClose&&t.setAttribute("aria-label",this.attr.ariaLabelClose))},r.TagButton.prototype.closeTag=function(t,e){var n=this.isOpen(e);!1!==n&&e.openTags.splice(n,1),t.value=this.display,this.attr.ariaLabel&&t.setAttribute("aria-label",this.attr.ariaLabel)},r.TagButton.prototype.isOpen=function(t){var e=0,n=!1;if(t.openTags)for(;!1===n&&e<t.openTags.length;)n=t.openTags[e]===this.id&&e,e++;else n=!1;return n},r.TagButton.prototype.callback=function(t,e,n){var o,a,i,s,l,u,c,r,d,g=this,p=e.value,f=p?g.tagEnd:"";document.selection?(e.focus(),0<(r=document.selection.createRange()).text.length?g.tagEnd?r.text=g.tagStart+r.text+f:r.text=r.text+g.tagStart:g.tagEnd?!1===g.isOpen(n)?(r.text=g.tagStart,g.openTag(t,n)):(r.text=f,g.closeTag(t,n)):r.text=g.tagStart):e.selectionStart||0===e.selectionStart?((o=e.selectionStart)<(a=e.selectionEnd)&&"\n"===p.charAt(a-1)&&(a-=1),i=a,s=e.scrollTop,l=p.substring(0,o),u=p.substring(a,p.length),c=p.substring(o,a),o!==a?g.tagEnd?(e.value=l+g.tagStart+c+f+u,i+=g.tagStart.length+f.length):(e.value=l+c+g.tagStart+u,i+=g.tagStart.length):g.tagEnd?!1===g.isOpen(n)?(e.value=l+g.tagStart+u,g.openTag(t,n),i=o+g.tagStart.length):(e.value=l+f+u,i=o+f.length,g.closeTag(t,n)):(e.value=l+g.tagStart+u,i=o+g.tagStart.length),e.selectionStart=i,e.selectionEnd=i,e.scrollTop=s):f?!1!==g.isOpen(n)?(e.value+=g.tagStart,g.openTag(t,n)):(e.value+=f,g.closeTag(t,n)):e.value+=g.tagStart,e.focus(),document.createEvent?((d=document.createEvent("HTMLEvents")).initEvent("change",!1,!0),e.dispatchEvent(d)):e.fireEvent&&e.fireEvent("onchange")},r.SpellButton=function(){},r.CloseButton=function(){r.Button.call(this,"close",quicktagsL10n.closeTags,"",quicktagsL10n.closeAllOpenTags)},r.CloseButton.prototype=new r.Button,r._close=function(t,e,n){var o,a,i=n.openTags;if(i)for(;0<i.length;)o=n.getButton(i[i.length-1]),a=document.getElementById(n.name+"_"+o.id),t?o.callback.call(o,a,e,n):o.closeTag(a,n)},r.CloseButton.prototype.callback=r._close,r.closeAllTags=function(t){var e=this.getInstance(t);e&&r._close("",e.canvas,e)},r.LinkButton=function(){var t={ariaLabel:quicktagsL10n.link};r.TagButton.call(this,"link","link","","</a>","","","",t)},r.LinkButton.prototype=new r.TagButton,r.LinkButton.prototype.callback=function(t,e,n,o){var a;"undefined"==typeof wpLink?(o||(o="http://"),!1===this.isOpen(n)?(a=prompt(quicktagsL10n.enterURL,o))&&(this.tagStart='<a href="'+a+'">',r.TagButton.prototype.callback.call(this,t,e,n)):r.TagButton.prototype.callback.call(this,t,e,n)):wpLink.open(n.id)},r.ImgButton=function(){var t={ariaLabel:quicktagsL10n.image};r.TagButton.call(this,"img","img","","","","","",t)},r.ImgButton.prototype=new r.TagButton,r.ImgButton.prototype.callback=function(t,e,n,o){o||(o="http://");var a,i=prompt(quicktagsL10n.enterImageURL,o);i&&(a=prompt(quicktagsL10n.enterImageDescription,""),this.tagStart='<img src="'+i+'" alt="'+a+'" />',r.TagButton.prototype.callback.call(this,t,e,n))},r.DFWButton=function(){r.Button.call(this,"dfw","","f",quicktagsL10n.dfw)},r.DFWButton.prototype=new r.Button,r.DFWButton.prototype.callback=function(){var t;(t=window.wp)&&t.editor&&t.editor.dfw&&window.wp.editor.dfw.toggle()},r.TextDirectionButton=function(){r.Button.call(this,"textdirection",quicktagsL10n.textdirection,"",quicktagsL10n.toggleTextdirection)},r.TextDirectionButton.prototype=new r.Button,r.TextDirectionButton.prototype.callback=function(t,e){var n="rtl"===document.getElementsByTagName("html")[0].dir,o=e.style.direction;o||(o=n?"rtl":"ltr"),e.style.direction="rtl"===o?"ltr":"rtl",e.focus()},edButtons[10]=new r.TagButton("strong","b","<strong>","</strong>","","","",{ariaLabel:quicktagsL10n.strong,ariaLabelClose:quicktagsL10n.strongClose}),edButtons[20]=new r.TagButton("em","i","<em>","</em>","","","",{ariaLabel:quicktagsL10n.em,ariaLabelClose:quicktagsL10n.emClose}),edButtons[30]=new r.LinkButton,edButtons[40]=new r.TagButton("block","b-quote","\n\n<blockquote>","</blockquote>\n\n","","","",{ariaLabel:quicktagsL10n.blockquote,ariaLabelClose:quicktagsL10n.blockquoteClose}),edButtons[50]=new r.TagButton("del","del",'<del datetime="'+n+'">',"</del>","","","",{ariaLabel:quicktagsL10n.del,ariaLabelClose:quicktagsL10n.delClose}),edButtons[60]=new r.TagButton("ins","ins",'<ins datetime="'+n+'">',"</ins>","","","",{ariaLabel:quicktagsL10n.ins,ariaLabelClose:quicktagsL10n.insClose}),edButtons[70]=new r.ImgButton,edButtons[80]=new r.TagButton("ul","ul","<ul>\n","</ul>\n\n","","","",{ariaLabel:quicktagsL10n.ul,ariaLabelClose:quicktagsL10n.ulClose}),edButtons[90]=new r.TagButton("ol","ol","<ol>\n","</ol>\n\n","","","",{ariaLabel:quicktagsL10n.ol,ariaLabelClose:quicktagsL10n.olClose}),edButtons[100]=new r.TagButton("li","li","\t<li>","</li>\n","","","",{ariaLabel:quicktagsL10n.li,ariaLabelClose:quicktagsL10n.liClose}),edButtons[110]=new r.TagButton("code","code","<code>","</code>","","","",{ariaLabel:quicktagsL10n.code,ariaLabelClose:quicktagsL10n.codeClose}),edButtons[120]=new r.TagButton("more","more","\x3c!--more--\x3e\n\n","","","","",{ariaLabel:quicktagsL10n.more}),edButtons[140]=new r.CloseButton}(); |