From a7ec353091498e86d606c27f5ca7a808c2d096c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerry=20Wei=C3=9Fbach?= Date: Tue, 14 Apr 2015 10:12:02 +0200 Subject: Add display options to extension manger Allows tho show/hide extensions that are: enabled, disabled, updatable --- lib/plugins/extension/helper/gui.php | 9 +++++++++ lib/plugins/extension/helper/list.php | 1 + lib/plugins/extension/lang/en/lang.php | 7 ++++++- lib/plugins/extension/script.js | 8 +++++++- lib/plugins/extension/style.less | 13 +++++++++++++ 5 files changed, 36 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/plugins/extension/helper/gui.php b/lib/plugins/extension/helper/gui.php index 3a0f0c589..2dbb3d5e5 100644 --- a/lib/plugins/extension/helper/gui.php +++ b/lib/plugins/extension/helper/gui.php @@ -38,6 +38,15 @@ class helper_plugin_extension_gui extends DokuWiki_Plugin { echo '
'; echo $this->locale_xhtml('intro_plugins'); + + $options = new Doku_Form( "viewoptions" ); + $options->addElement( form_makeOpenTag( "p" ) ); + $options->addElement( $this->getLang('display_viewoptions') ); + $options->addElement( form_makeCheckboxField( "enabled", 1, $this->getLang('display_enabled') ) ); + $options->addElement( form_makeCheckboxField( "disabled", 1, $this->getLang('display_disabled') ) ); + $options->addElement( form_makeCheckboxField( "updatable", 1, $this->getLang('display_updatable') ) ); + $options->addElement( form_makeCloseTag( "p" ) ); + $options->printForm(); echo '
'; $pluginlist = $plugin_controller->getList('', true); diff --git a/lib/plugins/extension/helper/list.php b/lib/plugins/extension/helper/list.php index 8bcd00ec6..11aea1d0e 100644 --- a/lib/plugins/extension/helper/list.php +++ b/lib/plugins/extension/helper/list.php @@ -151,6 +151,7 @@ class helper_plugin_extension_list extends DokuWiki_Plugin { if($extension->isInstalled()) { $class.=' installed'; $class.= ($extension->isEnabled()) ? ' enabled':' disabled'; + if($extension->updateAvailable()) $class .= ' updatable'; } if(!$extension->canModify()) $class.= ' notselect'; if($extension->isProtected()) $class.= ' protected'; diff --git a/lib/plugins/extension/lang/en/lang.php b/lib/plugins/extension/lang/en/lang.php index f545b6da3..907f91c23 100644 --- a/lib/plugins/extension/lang/en/lang.php +++ b/lib/plugins/extension/lang/en/lang.php @@ -101,4 +101,9 @@ $lang['install_url'] = 'Install from URL:'; $lang['install_upload'] = 'Upload Extension:'; $lang['repo_error'] = 'The plugin repository could not be contacted. Make sure your server is allowed to contact www.dokuwiki.org and check your proxy settings.'; -$lang['nossl'] = 'Your PHP seems to miss SSL support. Downloading will not work for many DokuWiki extensions.'; \ No newline at end of file +$lang['nossl'] = 'Your PHP seems to miss SSL support. Downloading will not work for many DokuWiki extensions.'; + +$lang['display_viewoptions'] = 'View Options:'; +$lang['display_enabled'] = 'enabled'; +$lang['display_disabled'] = 'disabled'; +$lang['display_updatable'] = 'updatable'; diff --git a/lib/plugins/extension/script.js b/lib/plugins/extension/script.js index fab88162d..43af21ee1 100644 --- a/lib/plugins/extension/script.js +++ b/lib/plugins/extension/script.js @@ -110,4 +110,10 @@ jQuery(function(){ ); }); -}); \ No newline at end of file + /** + * Enable all plugin types + */ + $extmgr.find( '#viewoptions :checkbox' ).change(function(){ + jQuery('#extension__list').toggleClass( this.name ); + }).click(); +}); diff --git a/lib/plugins/extension/style.less b/lib/plugins/extension/style.less index d20689099..fe15da16a 100644 --- a/lib/plugins/extension/style.less +++ b/lib/plugins/extension/style.less @@ -281,6 +281,15 @@ * Enabled/Disabled overrides */ #extension__list { + + .enabled, .disabled, .updatable { + display: none; + } + + &.enabled .enabled, &.disabled .disabled, &.updatable .updatable { + display: block; + } + .enabled div.screenshot span { background: transparent url(images/enabled.png) no-repeat 2px 2px; } @@ -361,3 +370,7 @@ display: block; width: 60%; } + +#viewoptions label { + margin-left: 1em; +} -- cgit v1.2.3 From 79a3bed0a23b6bef35eb12c6ccbb1f3301f6c621 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerry=20Wei=C3=9Fbach?= Date: Mon, 27 Apr 2015 08:00:12 +0200 Subject: Generate display options via JS Since it is a JS function only, the form will be generated by it too. --- lib/plugins/extension/helper/gui.php | 9 --------- lib/plugins/extension/lang/en/lang.php | 8 ++++---- lib/plugins/extension/script.js | 18 ++++++++++++++---- 3 files changed, 18 insertions(+), 17 deletions(-) (limited to 'lib') diff --git a/lib/plugins/extension/helper/gui.php b/lib/plugins/extension/helper/gui.php index 2dbb3d5e5..3a0f0c589 100644 --- a/lib/plugins/extension/helper/gui.php +++ b/lib/plugins/extension/helper/gui.php @@ -38,15 +38,6 @@ class helper_plugin_extension_gui extends DokuWiki_Plugin { echo '
'; echo $this->locale_xhtml('intro_plugins'); - - $options = new Doku_Form( "viewoptions" ); - $options->addElement( form_makeOpenTag( "p" ) ); - $options->addElement( $this->getLang('display_viewoptions') ); - $options->addElement( form_makeCheckboxField( "enabled", 1, $this->getLang('display_enabled') ) ); - $options->addElement( form_makeCheckboxField( "disabled", 1, $this->getLang('display_disabled') ) ); - $options->addElement( form_makeCheckboxField( "updatable", 1, $this->getLang('display_updatable') ) ); - $options->addElement( form_makeCloseTag( "p" ) ); - $options->printForm(); echo '
'; $pluginlist = $plugin_controller->getList('', true); diff --git a/lib/plugins/extension/lang/en/lang.php b/lib/plugins/extension/lang/en/lang.php index 907f91c23..79f643629 100644 --- a/lib/plugins/extension/lang/en/lang.php +++ b/lib/plugins/extension/lang/en/lang.php @@ -103,7 +103,7 @@ $lang['install_upload'] = 'Upload Extension:'; $lang['repo_error'] = 'The plugin repository could not be contacted. Make sure your server is allowed to contact www.dokuwiki.org and check your proxy settings.'; $lang['nossl'] = 'Your PHP seems to miss SSL support. Downloading will not work for many DokuWiki extensions.'; -$lang['display_viewoptions'] = 'View Options:'; -$lang['display_enabled'] = 'enabled'; -$lang['display_disabled'] = 'disabled'; -$lang['display_updatable'] = 'updatable'; +$lang['js']['display_viewoptions'] = 'View Options:'; +$lang['js']['display_enabled'] = 'enabled'; +$lang['js']['display_disabled'] = 'disabled'; +$lang['js']['display_updatable'] = 'updatable'; diff --git a/lib/plugins/extension/script.js b/lib/plugins/extension/script.js index 43af21ee1..825bcc928 100644 --- a/lib/plugins/extension/script.js +++ b/lib/plugins/extension/script.js @@ -111,9 +111,19 @@ jQuery(function(){ }); /** - * Enable all plugin types - */ - $extmgr.find( '#viewoptions :checkbox' ).change(function(){ + Create section for enabling/disabling viewing options + */ + var $displayOpts = jQuery('

', { id: 'viewoptions'} ).appendTo($extmgr.find( '.panelHeader' )); + $displayOpts.append(LANG.plugins.extension.display_viewoptions); + + var displayOptionsHandler = function(){ jQuery('#extension__list').toggleClass( this.name ); - }).click(); + }; + + jQuery(['enabled', 'disabled', 'updatable']).each(function(index, chkName){ + + var $label = jQuery( '' ).appendTo($displayOpts); + jQuery( '', { type: 'checkbox', name: chkName }).change(displayOptionsHandler).appendTo($label).click(); + jQuery( '' ).append(LANG.plugins.extension['display_'+chkName]).appendTo($label); + }); }); -- cgit v1.2.3 From abf17633a7157acf33d1cf76985b9221089d3fe8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerry=20Wei=C3=9Fbach?= Date: Mon, 4 May 2015 07:57:33 +0200 Subject: Add selection for the Installed Plugins tab The viewing options should only be visible on the first tab - which is the installed Plugins tab. (There seems to be no more direct way to address this tab.) --- lib/plugins/extension/script.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib') diff --git a/lib/plugins/extension/script.js b/lib/plugins/extension/script.js index 825bcc928..db6a95e51 100644 --- a/lib/plugins/extension/script.js +++ b/lib/plugins/extension/script.js @@ -113,7 +113,9 @@ jQuery(function(){ /** Create section for enabling/disabling viewing options */ + if ( $extmgr.find('.tabs li:first-child').hasClass('active') ) { var $displayOpts = jQuery('

', { id: 'viewoptions'} ).appendTo($extmgr.find( '.panelHeader' )); + $displayOpts.append(LANG.plugins.extension.display_viewoptions); var displayOptionsHandler = function(){ @@ -126,4 +128,5 @@ jQuery(function(){ jQuery( '', { type: 'checkbox', name: chkName }).change(displayOptionsHandler).appendTo($label).click(); jQuery( '' ).append(LANG.plugins.extension['display_'+chkName]).appendTo($label); }); + } }); -- cgit v1.2.3 From c85bc60fd47287238689cca5a2c32b9253cf0b0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerry=20Wei=C3=9Fbach?= Date: Mon, 4 May 2015 07:58:47 +0200 Subject: Prettify Code. --- lib/plugins/extension/script.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'lib') diff --git a/lib/plugins/extension/script.js b/lib/plugins/extension/script.js index db6a95e51..06ad6ff20 100644 --- a/lib/plugins/extension/script.js +++ b/lib/plugins/extension/script.js @@ -114,19 +114,19 @@ jQuery(function(){ Create section for enabling/disabling viewing options */ if ( $extmgr.find('.tabs li:first-child').hasClass('active') ) { - var $displayOpts = jQuery('

', { id: 'viewoptions'} ).appendTo($extmgr.find( '.panelHeader' )); + var $displayOpts = jQuery('

', { id: 'viewoptions'} ).appendTo($extmgr.find( '.panelHeader' )); - $displayOpts.append(LANG.plugins.extension.display_viewoptions); + $displayOpts.append(LANG.plugins.extension.display_viewoptions); - var displayOptionsHandler = function(){ - jQuery('#extension__list').toggleClass( this.name ); - }; + var displayOptionsHandler = function(){ + jQuery('#extension__list').toggleClass( this.name ); + }; - jQuery(['enabled', 'disabled', 'updatable']).each(function(index, chkName){ + jQuery(['enabled', 'disabled', 'updatable']).each(function(index, chkName){ - var $label = jQuery( '' ).appendTo($displayOpts); - jQuery( '', { type: 'checkbox', name: chkName }).change(displayOptionsHandler).appendTo($label).click(); - jQuery( '' ).append(LANG.plugins.extension['display_'+chkName]).appendTo($label); - }); + var $label = jQuery( '' ).appendTo($displayOpts); + jQuery( '', { type: 'checkbox', name: chkName }).change(displayOptionsHandler).appendTo($label).click(); + jQuery( '' ).append(LANG.plugins.extension['display_'+chkName]).appendTo($label); + }); } }); -- cgit v1.2.3 From 957202777a4d14ec2b5601d36010542f38b4740c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerry=20Wei=C3=9Fbach?= Date: Mon, 4 May 2015 08:03:46 +0200 Subject: Allow Viewing Options for templates as well. --- lib/plugins/extension/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/plugins/extension/script.js b/lib/plugins/extension/script.js index 06ad6ff20..1a0af4e0d 100644 --- a/lib/plugins/extension/script.js +++ b/lib/plugins/extension/script.js @@ -113,7 +113,7 @@ jQuery(function(){ /** Create section for enabling/disabling viewing options */ - if ( $extmgr.find('.tabs li:first-child').hasClass('active') ) { + if ( $extmgr.find('.tabs li:first-child, .tabs li:nth-child(2)').hasClass('active') ) { var $displayOpts = jQuery('

', { id: 'viewoptions'} ).appendTo($extmgr.find( '.panelHeader' )); $displayOpts.append(LANG.plugins.extension.display_viewoptions); -- cgit v1.2.3 From 95e3f389247c53b580d3dc59b26d4bf89ef6ae3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerry=20Wei=C3=9Fbach?= Date: Thu, 7 May 2015 11:29:07 +0200 Subject: Change ID name --- lib/plugins/extension/script.js | 1 + lib/plugins/extension/style.less | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/plugins/extension/script.js b/lib/plugins/extension/script.js index 1a0af4e0d..ddd668a76 100644 --- a/lib/plugins/extension/script.js +++ b/lib/plugins/extension/script.js @@ -115,6 +115,7 @@ jQuery(function(){ */ if ( $extmgr.find('.tabs li:first-child, .tabs li:nth-child(2)').hasClass('active') ) { var $displayOpts = jQuery('

', { id: 'viewoptions'} ).appendTo($extmgr.find( '.panelHeader' )); + var $displayOpts = jQuery('

', { id: 'extension__viewoptions'} ).appendTo($extmgr.find( '.panelHeader' )); $displayOpts.append(LANG.plugins.extension.display_viewoptions); diff --git a/lib/plugins/extension/style.less b/lib/plugins/extension/style.less index fe15da16a..baeb40db1 100644 --- a/lib/plugins/extension/style.less +++ b/lib/plugins/extension/style.less @@ -371,6 +371,6 @@ width: 60%; } -#viewoptions label { +#extension__viewoptions label { margin-left: 1em; } -- cgit v1.2.3 From c594265e447bf705dae05f5e59560ea4c3afea0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerry=20Wei=C3=9Fbach?= Date: Thu, 7 May 2015 11:30:00 +0200 Subject: Add class name using tab name --- lib/plugins/extension/helper/gui.php | 4 ++-- lib/plugins/extension/script.js | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/plugins/extension/helper/gui.php b/lib/plugins/extension/helper/gui.php index 3a0f0c589..4ec6fec85 100644 --- a/lib/plugins/extension/helper/gui.php +++ b/lib/plugins/extension/helper/gui.php @@ -144,11 +144,11 @@ class helper_plugin_extension_gui extends DokuWiki_Plugin { foreach($this->tabs as $tab) { $url = $this->tabURL($tab); if($this->currentTab() == $tab) { - $class = 'class="active"'; + $class = ' active'; } else { $class = ''; } - echo '

  • '.$this->getLang('tab_'.$tab).'
  • '; + echo '
  • '.$this->getLang('tab_'.$tab).'
  • '; } echo ''; } diff --git a/lib/plugins/extension/script.js b/lib/plugins/extension/script.js index ddd668a76..bc1bf8b12 100644 --- a/lib/plugins/extension/script.js +++ b/lib/plugins/extension/script.js @@ -113,8 +113,7 @@ jQuery(function(){ /** Create section for enabling/disabling viewing options */ - if ( $extmgr.find('.tabs li:first-child, .tabs li:nth-child(2)').hasClass('active') ) { - var $displayOpts = jQuery('

    ', { id: 'viewoptions'} ).appendTo($extmgr.find( '.panelHeader' )); + if ( $extmgr.find('.plugins, .templates').hasClass('active') ) { var $displayOpts = jQuery('

    ', { id: 'extension__viewoptions'} ).appendTo($extmgr.find( '.panelHeader' )); $displayOpts.append(LANG.plugins.extension.display_viewoptions); -- cgit v1.2.3 From 526e5abda6d7ab051bb2819eaffbe81af04e6c68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerry=20Wei=C3=9Fbach?= Date: Fri, 8 May 2015 13:15:31 +0200 Subject: Adhere to CSS style guide --- lib/plugins/extension/style.less | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/plugins/extension/style.less b/lib/plugins/extension/style.less index baeb40db1..38b2d65d0 100644 --- a/lib/plugins/extension/style.less +++ b/lib/plugins/extension/style.less @@ -282,11 +282,14 @@ */ #extension__list { - .enabled, .disabled, .updatable { + .enabled, .disabled, + .updatable { display: none; } - &.enabled .enabled, &.disabled .disabled, &.updatable .updatable { + &.enabled .enabled, + &.disabled .disabled, + &.updatable .updatable { display: block; } -- cgit v1.2.3