From: Alexander Ebert Date: Fri, 15 Nov 2013 14:00:32 +0000 (+0100) Subject: Loading CKEditor through head.js X-Git-Tag: 2.0.0_RC_2~22 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=eb1537e311e82f4c2f9e341a7990fab7ba138b63;p=GitHub%2FWoltLab%2FWCF.git Loading CKEditor through head.js --- diff --git a/com.woltlab.wcf/templates/wysiwyg.tpl b/com.woltlab.wcf/templates/wysiwyg.tpl index 370a8c1f22..6a84f02bbe 100644 --- a/com.woltlab.wcf/templates/wysiwyg.tpl +++ b/com.woltlab.wcf/templates/wysiwyg.tpl @@ -4,9 +4,9 @@ var __CKEDITOR_BUTTONS = [ {implode from=$__wcf->getBBCodeHandler()->getButtonBBCodes() item=__bbcode}{ icon: '../../../icon/{$__bbcode->wysiwygIcon}', label: '{$__bbcode->buttonLabel|language}', name: '{$__bbcode->bbcodeTag}' }{/implode} ]; //]]> - +{* -{event name='javascriptIncludes'} +{event name='javascriptIncludes'*} diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index bde2da1460..3322cac68e 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -89,6 +89,10 @@ */ (function(t,i,n){var e=i.matchMedia;"undefined"!=typeof module&&module.exports?module.exports=n(e):"function"==typeof define&&define.amd?define(function(){return i[t]=n(e)}):i[t]=n(e)})("enquire",this,function(t){"use strict";function i(t,i){var n,e=0,s=t.length;for(e;s>e&&(n=i(t[e],e),n!==!1);e++);}function n(t){return"[object Array]"===Object.prototype.toString.apply(t)}function e(t){return"function"==typeof t}function s(t){this.options=t,!t.deferSetup&&this.setup()}function o(i,n){this.query=i,this.isUnconditional=n,this.handlers=[],this.mql=t(i);var e=this;this.listener=function(t){e.mql=t,e.assess()},this.mql.addListener(this.listener)}function r(){if(!t)throw Error("matchMedia not present, legacy browsers require a polyfill");this.queries={},this.browserIsIncapable=!t("only all").matches}return s.prototype={setup:function(){this.options.setup&&this.options.setup(),this.initialised=!0},on:function(){!this.initialised&&this.setup(),this.options.match&&this.options.match()},off:function(){this.options.unmatch&&this.options.unmatch()},destroy:function(){this.options.destroy?this.options.destroy():this.off()},equals:function(t){return this.options===t||this.options.match===t}},o.prototype={addHandler:function(t){var i=new s(t);this.handlers.push(i),this.matches()&&i.on()},removeHandler:function(t){var n=this.handlers;i(n,function(i,e){return i.equals(t)?(i.destroy(),!n.splice(e,1)):void 0})},matches:function(){return this.mql.matches||this.isUnconditional},clear:function(){i(this.handlers,function(t){t.destroy()}),this.mql.removeListener(this.listener),this.handlers.length=0},assess:function(){var t=this.matches()?"on":"off";i(this.handlers,function(i){i[t]()})}},r.prototype={register:function(t,s,r){var h=this.queries,u=r&&this.browserIsIncapable;return h[t]||(h[t]=new o(t,u)),e(s)&&(s={match:s}),n(s)||(s=[s]),i(s,function(i){h[t].addHandler(i)}),this},unregister:function(t,i){var n=this.queries[t];return n&&(i?n.removeHandler(i):(n.clear(),delete this.queries[t])),this}},new r}); +/*! head.load - v1.0.1 */ +(function(n,t){"use strict";function p(){}function u(n,t){if(n){typeof n=="object"&&(n=[].slice.call(n));for(var i=0,r=n.length;i + */ + _loaded: [ ], + + /** + * list of setup callbacks grouped by identifier + * @var object + */ + _setupCallbacks: { }, + + /** + * Registers a callback for given identifier, will be executed after all setup + * callbacks have been invoked. + * + * @param string identifier + * @param object callback + */ + register: function(identifier, callback) { + if (!$.isFunction(callback)) { + console.debug("[WCF.System.Dependency.Manager] Callback for identifier '" + identifier + "' is invalid, aborting."); + return; + } + + // already loaded, invoke now + if (WCF.inArray(identifier, this._loaded)) { + callback(); + } + else { + if (!this._callbacks[identifier]) { + this._callbacks[identifier] = [ ]; + } + + this._callbacks[identifier].push(callback); + } + }, + + /** + * Registers a setup callback for given identifier, will be invoked + * prior to all other callbacks. + * + * @param string identifier + * @param object callback + */ + setup: function(identifier, callback) { + if (!$.isFunction(callback)) { + console.debug("[WCF.System.Dependency.Manager] Setup callback for identifier '" + identifier + "' is invalid, aborting."); + return; + } + + if (!this._setupCallbacks[identifier]) { + this._setupCallbacks[identifier] = [ ]; + } + + this._setupCallbacks[identifier].push(callback); + }, + + /** + * Invokes all callbacks for given identifier and marks it as loaded. + * + * @param string identifier + */ + invoke: function(identifier) { + if (this._setupCallbacks[identifier]) { + for (var $i = 0, $length = this._setupCallbacks[identifier].length; $i < $length; $i++) { + this._setupCallbacks[identifier][$i](); + } + } + + this._loaded.push(identifier); + + if (this._callbacks[identifier]) { + for (var $i = 0, $length = this._callbacks[identifier].length; $i < $length; $i++) { + this._callbacks[identifier][$i](); + } + } + } +}; + /** * Provides flexible dropdowns for tab-based menus. */