diff options
author | Andreas Gohr <andi@splitbrain.org> | 2015-06-26 13:31:46 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2015-06-26 13:31:46 +0200 |
commit | 3e2beab52631135f77d0ad5b6ed297458bfff2f2 (patch) | |
tree | 865a6283991c9c1ed711dfbf6c97ef41fe54c622 /lib/plugins/styling/script.js | |
parent | 6667cd8743e57a4492cfbcbe1066ea48d444f7a2 (diff) | |
download | rpg-3e2beab52631135f77d0ad5b6ed297458bfff2f2.tar.gz rpg-3e2beab52631135f77d0ad5b6ed297458bfff2f2.tar.bz2 |
added a simple loading screen for the JavaScript preview
Diffstat (limited to 'lib/plugins/styling/script.js')
-rw-r--r-- | lib/plugins/styling/script.js | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/lib/plugins/styling/script.js b/lib/plugins/styling/script.js index 8b4563986..f732c0524 100644 --- a/lib/plugins/styling/script.js +++ b/lib/plugins/styling/script.js @@ -3,7 +3,7 @@ jQuery(function () { var $styling_plugin = jQuery('#plugin__styling'); - if(!$styling_plugin.length) return; + if (!$styling_plugin.length) return; if (!$styling_plugin.hasClass('ispopup')) { @@ -21,9 +21,32 @@ jQuery(function () { // add the color picker $styling_plugin.find('.color').iris({}); + // append the loader screen + $loader = window.opener.jQuery('#plugin__styling_loader'); + if (!$loader.length) { + $loader = jQuery('<div id="plugin__styling_loader">' + LANG.plugins.styling.loader + '</div>'); + $loader.css({ + 'position': 'absolute', + 'width': '100%', + 'height': '100%', + 'top': 0, + 'left': 0, + 'z-index': 5000, + 'background-color': '#fff', + 'opacity': '0.7', + 'color': '#000', + 'font-size': '40px', + 'text-align': 'center', + 'line-height': '90px' + }); + window.opener.jQuery('body').append($loader); + } + // load preview in main window var now = new Date().getTime(); var $style = window.opener.jQuery('link[rel=stylesheet][href*="lib/exe/css.php"]'); + $style.attr('href', ''); $style.attr('href', DOKU_BASE + 'lib/exe/css.php?preview=1&tseed=' + now); + }); |