Index: branches/5.2.x/core/admin_templates/js/script.js =================================================================== diff -u -N -r15539 -r15593 --- branches/5.2.x/core/admin_templates/js/script.js (.../script.js) (revision 15539) +++ branches/5.2.x/core/admin_templates/js/script.js (.../script.js) (revision 15593) @@ -1,13 +1,14 @@ if ( !( isset($init_made) && $init_made ) ) { var Application = new kApplication(); - var Grids = new Array(); - var GridScrollers = new Array(); - var Toolbars = new Array(); - var $Menus = new Array(); - var $ViewMenus = new Array(); - var $nls_menus = new Array(); - var $MenuNames = new Array(); + var Grids = [], + GridScrollers = [], + Toolbars = [], + $Menus = [], + $ViewMenus = [], + $nls_menus = [], + $MenuNames = []; + var $CKEditors = {}; // input name VS ck options mapping var $form_name = 'kernel_form'; @@ -16,15 +17,16 @@ var $fw_menus = new Array(); } - var $env = ''; - var submitted = false; - var unload_legal = false; - var $edit_mode = false; - var $init_made = true; // in case of double inclusion of script.js :) + var $env = '', + submitted = false, + unload_legal = false, + $edit_mode = false, + $init_made = true; // in case of double inclusion of script.js :) // hook processing var hBEFORE = 1; // this is const, but including this twice causes errors var hAFTER = 2; // this is const, but including this twice causes errors + replaceFireBug(); } @@ -1906,4 +1908,29 @@ } return crc ^ (-1); +} + +function ckeditors_apply_typekit() { + if ( $typekit_id === undefined || $typekit_id.length == 0 ) { + return; + } + + CKEDITOR.on( + 'instanceReady', + function (ev) { + setTimeout(function () { + var $script = document.createElement('script'), + $editor_instance = CKEDITOR.instances[ev.editor.name]; + + $script.src = '//use.typekit.com/' + $typekit_id + '.js'; + $script.onload = function () { + try { + $editor_instance.window.$.Typekit.load(); + } catch (e) {} + }; + + $editor_instance.document.getHead().$.appendChild($script); + }, 1000); + } + ); } \ No newline at end of file