Skip to content
Snippets Groups Projects
Commit bcea9d64 authored by Andreas Gohr's avatar Andreas Gohr
Browse files

removed no longer needed ajax action components

parent 3e2beab5
No related branches found
No related tags found
No related merge requests found
......@@ -26,8 +26,6 @@ class action_plugin_styling extends DokuWiki_Action_Plugin {
* @return void
*/
public function register(Doku_Event_Handler $controller) {
$controller->register_hook('AJAX_CALL_UNKNOWN', 'BEFORE', $this, 'handle_ajax');
$controller->register_hook('ACTION_ACT_PREPROCESS', 'BEFORE', $this, 'handle_action');
$controller->register_hook('TPL_METAHEADER_OUTPUT', 'BEFORE', $this, 'handle_header');
}
......@@ -57,52 +55,6 @@ class action_plugin_styling extends DokuWiki_Action_Plugin {
}
}
/**
* Updates the style.ini settings by passing it on to handle() of the admin component
*
* @param Doku_Event $event event object by reference
* @param mixed $param [the parameters passed as fifth argument to register_hook() when this
* handler was registered]
* @return void
*/
public function handle_action(Doku_Event &$event, $param) {
if($event->data != 'styling_plugin') return;
if(!auth_isadmin()) return;
$event->data = 'show';
/** @var admin_plugin_styling $hlp */
$hlp = plugin_load('admin', 'styling');
$hlp->handle();
}
/**
* Create the style form in the floating Dialog
*
* @param Doku_Event $event event object by reference
* @param mixed $param [the parameters passed as fifth argument to register_hook() when this
* handler was registered]
* @return void
*/
public function handle_ajax(Doku_Event &$event, $param) {
if($event->data != 'plugin_styling') return;
if(!auth_isadmin()) return;
$event->preventDefault();
$event->stopPropagation();
global $ID;
global $INPUT;
$ID = getID();
/** @var admin_plugin_styling $hlp */
$hlp = plugin_load('admin', 'styling');
if($INPUT->str('run') == 'preview') {
$hlp->run_preview();
} else {
$hlp->form(true);
}
}
}
// vim:ts=4:sw=4:et:
......@@ -5,6 +5,8 @@ jQuery(function () {
var $styling_plugin = jQuery('#plugin__styling');
if (!$styling_plugin.length) return;
// add the color picker
$styling_plugin.find('.color').iris({});
if (!$styling_plugin.hasClass('ispopup')) {
var $hl = $styling_plugin.find('h1').first();
......@@ -18,9 +20,6 @@ jQuery(function () {
return;
}
// add the color picker
$styling_plugin.find('.color').iris({});
// append the loader screen
$loader = window.opener.jQuery('#plugin__styling_loader');
if (!$loader.length) {
......@@ -45,8 +44,5 @@ jQuery(function () {
// 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);
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment