From 123bc813fd93ab5d8dab3cc4a66a09e613a10aa2 Mon Sep 17 00:00:00 2001 From: Andreas Gohr <andi@splitbrain.org> Date: Sat, 23 May 2015 15:29:33 +0200 Subject: [PATCH] renamed plugin from styler to styling styler was already taken --- lib/plugins/{styler => styling}/.travis.yml | 2 +- lib/plugins/{styler => styling}/README | 6 +-- .../_test/general.test.php | 8 ++-- lib/plugins/{styler => styling}/action.php | 20 +++++----- lib/plugins/{styler => styling}/admin.php | 16 ++++---- lib/plugins/{styler => styling}/iris.js | 0 .../{styler => styling}/lang/en/intro.txt | 0 .../{styler => styling}/lang/en/lang.php | 2 +- .../{styler => styling}/plugin.info.txt | 6 +-- lib/plugins/{styler => styling}/script.js | 38 +++++++++---------- 10 files changed, 49 insertions(+), 49 deletions(-) rename lib/plugins/{styler => styling}/.travis.yml (79%) rename lib/plugins/{styler => styling}/README (86%) rename lib/plugins/{styler => styling}/_test/general.test.php (83%) rename lib/plugins/{styler => styling}/action.php (85%) rename lib/plugins/{styler => styling}/admin.php (93%) rename lib/plugins/{styler => styling}/iris.js (100%) rename lib/plugins/{styler => styling}/lang/en/intro.txt (100%) rename lib/plugins/{styler => styling}/lang/en/lang.php (95%) rename lib/plugins/{styler => styling}/plugin.info.txt (56%) rename lib/plugins/{styler => styling}/script.js (72%) diff --git a/lib/plugins/styler/.travis.yml b/lib/plugins/styling/.travis.yml similarity index 79% rename from lib/plugins/styler/.travis.yml rename to lib/plugins/styling/.travis.yml index d80c0691f..75ee0b152 100644 --- a/lib/plugins/styler/.travis.yml +++ b/lib/plugins/styling/.travis.yml @@ -10,4 +10,4 @@ env: - DOKUWIKI=stable before_install: wget https://raw.github.com/splitbrain/dokuwiki-travis/master/travis.sh install: sh travis.sh -script: cd _test && phpunit --stderr --group plugin_styler \ No newline at end of file +script: cd _test && phpunit --stderr --group plugin_styling diff --git a/lib/plugins/styler/README b/lib/plugins/styling/README similarity index 86% rename from lib/plugins/styler/README rename to lib/plugins/styling/README index 37a966352..a1a5e890c 100644 --- a/lib/plugins/styler/README +++ b/lib/plugins/styling/README @@ -1,12 +1,12 @@ -styler Plugin for DokuWiki +styling Plugin for DokuWiki Allows to edit style.ini replacements All documentation for this plugin can be found at -https://www.dokuwiki.org/plugin:styler +https://www.dokuwiki.org/plugin:styling If you install this plugin manually, make sure it is installed in -lib/plugins/styler/ - if the folder is called different it +lib/plugins/styling/ - if the folder is called different it will not work! Please refer to http://www.dokuwiki.org/plugins for additional info diff --git a/lib/plugins/styler/_test/general.test.php b/lib/plugins/styling/_test/general.test.php similarity index 83% rename from lib/plugins/styler/_test/general.test.php rename to lib/plugins/styling/_test/general.test.php index 8b0712a20..1337f6f75 100644 --- a/lib/plugins/styler/_test/general.test.php +++ b/lib/plugins/styling/_test/general.test.php @@ -1,11 +1,11 @@ <?php /** - * General tests for the styler plugin + * General tests for the styling plugin * - * @group plugin_styler + * @group plugin_styling * @group plugins */ -class general_plugin_styler_test extends DokuWikiTest { +class general_plugin_styling_test extends DokuWikiTest { /** * Simple test to make sure the plugin.info.txt is in correct format @@ -24,7 +24,7 @@ class general_plugin_styler_test extends DokuWikiTest { $this->assertArrayHasKey('desc', $info); $this->assertArrayHasKey('url', $info); - $this->assertEquals('styler', $info['base']); + $this->assertEquals('styling', $info['base']); $this->assertRegExp('/^https?:\/\//', $info['url']); $this->assertTrue(mail_isvalid($info['email'])); $this->assertRegExp('/^\d\d\d\d-\d\d-\d\d$/', $info['date']); diff --git a/lib/plugins/styler/action.php b/lib/plugins/styling/action.php similarity index 85% rename from lib/plugins/styler/action.php rename to lib/plugins/styling/action.php index 1cc712a15..622c634d6 100644 --- a/lib/plugins/styler/action.php +++ b/lib/plugins/styling/action.php @@ -1,6 +1,6 @@ <?php /** - * DokuWiki Plugin styler (Action Component) + * DokuWiki Plugin styling (Action Component) * * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html * @author Andreas Gohr <andi@splitbrain.org> @@ -10,14 +10,14 @@ if(!defined('DOKU_INC')) die(); /** - * Class action_plugin_styler + * Class action_plugin_styling * * This handles all the save actions and loading the interface * * All this usually would be done within an admin plugin, but we want to have this available outside * the admin interface using our floating dialog. */ -class action_plugin_styler extends DokuWiki_Action_Plugin { +class action_plugin_styling extends DokuWiki_Action_Plugin { /** * Registers a callback functions @@ -42,7 +42,7 @@ class action_plugin_styler extends DokuWiki_Action_Plugin { public function handle_header(Doku_Event &$event, $param) { global $ACT; global $INPUT; - if($ACT != 'admin' || $INPUT->str('page') != 'styler') return; + if($ACT != 'admin' || $INPUT->str('page') != 'styling') return; if(!auth_isadmin()) return; // set preview @@ -66,12 +66,12 @@ class action_plugin_styler extends DokuWiki_Action_Plugin { * @return void */ public function handle_action(Doku_Event &$event, $param) { - if($event->data != 'styler_plugin') return; + if($event->data != 'styling_plugin') return; if(!auth_isadmin()) return; $event->data = 'show'; - /** @var admin_plugin_styler $hlp */ - $hlp = plugin_load('admin', 'styler'); + /** @var admin_plugin_styling $hlp */ + $hlp = plugin_load('admin', 'styling'); $hlp->handle(); } @@ -85,7 +85,7 @@ class action_plugin_styler extends DokuWiki_Action_Plugin { */ public function handle_ajax(Doku_Event &$event, $param) { - if($event->data != 'plugin_styler') return; + if($event->data != 'plugin_styling') return; if(!auth_isadmin()) return; $event->preventDefault(); $event->stopPropagation(); @@ -94,8 +94,8 @@ class action_plugin_styler extends DokuWiki_Action_Plugin { global $INPUT; $ID = getID(); - /** @var admin_plugin_styler $hlp */ - $hlp = plugin_load('admin', 'styler'); + /** @var admin_plugin_styling $hlp */ + $hlp = plugin_load('admin', 'styling'); if($INPUT->str('run') == 'preview') { $hlp->run_preview(); } else { diff --git a/lib/plugins/styler/admin.php b/lib/plugins/styling/admin.php similarity index 93% rename from lib/plugins/styler/admin.php rename to lib/plugins/styling/admin.php index a66dfbb11..85d87dd71 100644 --- a/lib/plugins/styler/admin.php +++ b/lib/plugins/styling/admin.php @@ -1,6 +1,6 @@ <?php /** - * DokuWiki Plugin styler (Admin Component) + * DokuWiki Plugin styling (Admin Component) * * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html * @author Andreas Gohr <andi@splitbrain.org> @@ -9,7 +9,7 @@ // must be run within Dokuwiki if(!defined('DOKU_INC')) die(); -class admin_plugin_styler extends DokuWiki_Admin_Plugin { +class admin_plugin_styling extends DokuWiki_Admin_Plugin { /** * @return int sort number in admin menu @@ -49,7 +49,7 @@ class admin_plugin_styler extends DokuWiki_Admin_Plugin { * Render HTML output, e.g. helpful text and a form */ public function html() { - echo '<div id="plugin__styler">'; + echo '<div id="plugin__styling">'; ptln('<h1>'.$this->getMenuText('').'</h1>'); $this->form(false); echo '</div>'; @@ -67,9 +67,9 @@ class admin_plugin_styler extends DokuWiki_Admin_Plugin { $replacements = $styleini['replacements']; if($isajax) { - $target = wl($ID, array('do' => 'styler_plugin')); + $target = wl($ID, array('do' => 'styling_plugin')); } else { - $target = wl($ID, array('do' => 'admin', 'page' => 'styler')); + $target = wl($ID, array('do' => 'admin', 'page' => 'styling')); } if(empty($replacements)) { @@ -77,7 +77,7 @@ class admin_plugin_styler extends DokuWiki_Admin_Plugin { } else { echo $this->locale_xhtml('intro'); - echo '<form class="styler" method="post" action="'.$target.'">'; + echo '<form class="styling" method="post" action="'.$target.'">'; echo '<table>'; foreach($replacements as $key => $value) { @@ -181,7 +181,7 @@ class admin_plugin_styler extends DokuWiki_Admin_Plugin { global $INPUT; $ini = "[replacements]\n"; - $ini .= ";These overwrites have been generated from the Template Styler Admin interface\n"; + $ini .= ";These overwrites have been generated from the Template styling Admin interface\n"; $ini .= ";Any values in this section will be overwritten by that tool again\n"; foreach($INPUT->arr('tpl') as $key => $val) { $ini .= $key.' = "'.addslashes($val).'"'."\n"; @@ -212,4 +212,4 @@ class admin_plugin_styler extends DokuWiki_Admin_Plugin { } -// vim:ts=4:sw=4:et: \ No newline at end of file +// vim:ts=4:sw=4:et: diff --git a/lib/plugins/styler/iris.js b/lib/plugins/styling/iris.js similarity index 100% rename from lib/plugins/styler/iris.js rename to lib/plugins/styling/iris.js diff --git a/lib/plugins/styler/lang/en/intro.txt b/lib/plugins/styling/lang/en/intro.txt similarity index 100% rename from lib/plugins/styler/lang/en/intro.txt rename to lib/plugins/styling/lang/en/intro.txt diff --git a/lib/plugins/styler/lang/en/lang.php b/lib/plugins/styling/lang/en/lang.php similarity index 95% rename from lib/plugins/styler/lang/en/lang.php rename to lib/plugins/styling/lang/en/lang.php index 1bf8efa2c..a68464f15 100644 --- a/lib/plugins/styler/lang/en/lang.php +++ b/lib/plugins/styling/lang/en/lang.php @@ -1,6 +1,6 @@ <?php /** - * English language file for styler plugin + * English language file for styling plugin * * @author Andreas Gohr <andi@splitbrain.org> */ diff --git a/lib/plugins/styler/plugin.info.txt b/lib/plugins/styling/plugin.info.txt similarity index 56% rename from lib/plugins/styler/plugin.info.txt rename to lib/plugins/styling/plugin.info.txt index 51f2f72f6..cdf01ee6f 100644 --- a/lib/plugins/styler/plugin.info.txt +++ b/lib/plugins/styling/plugin.info.txt @@ -1,7 +1,7 @@ -base styler +base styling author Andreas Gohr email andi@splitbrain.org date 2015-05-16 -name styler plugin +name styling plugin desc Allows to edit style.ini replacements -url https://www.dokuwiki.org/plugin:styler +url https://www.dokuwiki.org/plugin:styling diff --git a/lib/plugins/styler/script.js b/lib/plugins/styling/script.js similarity index 72% rename from lib/plugins/styler/script.js rename to lib/plugins/styling/script.js index a4fb601c8..76cd1a847 100644 --- a/lib/plugins/styler/script.js +++ b/lib/plugins/styling/script.js @@ -2,15 +2,15 @@ jQuery(function () { // user openend the admin page, set cookie and redirect - if (jQuery('#plugin__styler').length) { - DokuCookie.setValue('styler_plugin', 1); + if (jQuery('#plugin__styling').length) { + DokuCookie.setValue('styling_plugin', 1); document.location.href = document.location.href.replace(/do=admin/, ''); } - // continue only if the Styler Dialog is currently enabled - if (DokuCookie.getValue('styler_plugin') != 1) return; + // continue only if the styling Dialog is currently enabled + if (DokuCookie.getValue('styling_plugin') != 1) return; - var styler_timeout = null; + var styling_timeout = null; // create dialog element var $dialog = jQuery(document.createElement('div')); @@ -20,7 +20,7 @@ jQuery(function () { /** * updates the current CSS with a new preview one */ - function styler_updateCSS() { + function styling_updateCSS() { 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); @@ -29,19 +29,19 @@ jQuery(function () { /** * save current values and reload preview (debounced) */ - function styler_saveAndUpdate() { - if (styler_timeout) window.clearTimeout(styler_timeout); - styler_timeout = window.setTimeout(function () { - styler_timeout = null; + function styling_saveAndUpdate() { + if (styling_timeout) window.clearTimeout(styling_timeout); + styling_timeout = window.setTimeout(function () { + styling_timeout = null; var params = $dialog.find('input[type=text]').serializeArray(); - params[params.length] = { name: 'call', value: 'plugin_styler'}; + params[params.length] = { name: 'call', value: 'plugin_styling'}; params[params.length] = {name: 'run', value: 'preview'}; jQuery.post( DOKU_BASE + '/lib/exe/ajax.php', params, - styler_updateCSS + styling_updateCSS ); }, 500); } @@ -50,25 +50,25 @@ jQuery(function () { $dialog.load( DOKU_BASE + '/lib/exe/ajax.php', { - 'call': 'plugin_styler', + 'call': 'plugin_styling', 'run': 'html', 'id': JSINFO.id }, function () { // load the preview template - styler_updateCSS(); + styling_updateCSS(); // open the dialog $dialog.dialog({ - 'title': LANG.plugins.styler.menu, + 'title': LANG.plugins.styling.menu, 'width': 500, 'height': 500, 'top': 50, 'position': { 'my': 'left bottom', 'at': 'left bottom', 'of': window }, // bring everything back to normal 'close': function (event, ui) { - // disable the styler plugin again - DokuCookie.setValue('styler_plugin', 0); + // disable the styling plugin again + DokuCookie.setValue('styling_plugin', 0); // reload document.location.reload() } @@ -83,10 +83,10 @@ jQuery(function () { // listen to keyup events $dialog.find('input[type=text]').keyup(function () { console.log('change'); - styler_saveAndUpdate(); + styling_saveAndUpdate(); }); } ); -}); \ No newline at end of file +}); -- GitLab