diff options
author | Andreas Gohr <andi@splitbrain.org> | 2015-05-16 18:40:21 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2015-05-16 18:40:21 +0200 |
commit | 6ea007c9f8c6830ea4f21ad880e91279e2f4bf10 (patch) | |
tree | 8d769608fe260066773457feccb987730459a73e /lib/plugins/styler/script.js | |
parent | 4d6524b8916955bf5fa9086042917244751dc03d (diff) | |
download | rpg-6ea007c9f8c6830ea4f21ad880e91279e2f4bf10.tar.gz rpg-6ea007c9f8c6830ea4f21ad880e91279e2f4bf10.tar.bz2 |
a first very basic implementation of the preview mechanism
Diffstat (limited to 'lib/plugins/styler/script.js')
-rw-r--r-- | lib/plugins/styler/script.js | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/lib/plugins/styler/script.js b/lib/plugins/styler/script.js new file mode 100644 index 000000000..d09a8b8da --- /dev/null +++ b/lib/plugins/styler/script.js @@ -0,0 +1,40 @@ +jQuery(function () { + + + if (DokuCookie.getValue('styler_plugin') == 1) { + + + + // load dialog + var $dialog = jQuery(document.createElement('div')); + jQuery('body').append($dialog); + $dialog.load( + DOKU_BASE + '/lib/exe/ajax.php', + { + 'call': 'plugin_styler' + }, + function () { + // load the preview template + var now = new Date().getTime(); + var $style = jQuery('link[rel=stylesheet][href*="lib/exe/css.php"]'); + $style.attr('href', DOKU_BASE + 'lib/exe/css.php?preview=1&tseed=' + now); + + // open the dialog + $dialog.dialog({ + 'title': 'Template Variables', + 'width': 500, + 'top': 50, + 'position': { 'my': 'left top', 'at': 'left top', 'of': window }, + // bring everything back to normal + 'close': function (event, ui) { + // disable the styler plugin again + DokuCookie.setValue('styler_plugin', 0); + // reload + document.location.reload() + } + }); + } + ); + + } +});
\ No newline at end of file |