From 1e5e2cd98ab228680ae49bcf95ba443a5c29a5b5 Mon Sep 17 00:00:00 2001 From: Alexander Yakovlev Date: Fri, 17 Feb 2017 14:41:26 +0700 Subject: [PATCH] Spoilers --- .../classes/modules/ifhub/Ifhub.class.php | 41 ++++++++++ application/config/jevix.php | 10 ++- .../plugins/bspoiler/PluginBspoiler.class.php | 73 ------------------ application/plugins/bspoiler/Readme.txt | 8 -- .../plugins/bspoiler/classes/.htaccess | 2 - .../modules/bspoiler/Bspoiler.class.php | 64 --------------- application/plugins/bspoiler/config/.htaccess | 2 - .../plugins/bspoiler/config/config.php | 32 -------- application/plugins/bspoiler/plugin.xml | 22 ------ .../plugins/bspoiler/templates/.htaccess | 5 -- .../templates/skin/default/css/style.css | 10 --- .../skin/default/images/spoiler.icon.png | Bin 1022 -> 0 bytes .../templates/skin/default/js/bspoiler.js | 12 --- 13 files changed, 50 insertions(+), 231 deletions(-) create mode 100644 application/classes/modules/ifhub/Ifhub.class.php delete mode 100644 application/plugins/bspoiler/PluginBspoiler.class.php delete mode 100644 application/plugins/bspoiler/Readme.txt delete mode 100644 application/plugins/bspoiler/classes/.htaccess delete mode 100644 application/plugins/bspoiler/classes/modules/bspoiler/Bspoiler.class.php delete mode 100644 application/plugins/bspoiler/config/.htaccess delete mode 100644 application/plugins/bspoiler/config/config.php delete mode 100644 application/plugins/bspoiler/plugin.xml delete mode 100644 application/plugins/bspoiler/templates/.htaccess delete mode 100644 application/plugins/bspoiler/templates/skin/default/css/style.css delete mode 100644 application/plugins/bspoiler/templates/skin/default/images/spoiler.icon.png delete mode 100644 application/plugins/bspoiler/templates/skin/default/js/bspoiler.js diff --git a/application/classes/modules/ifhub/Ifhub.class.php b/application/classes/modules/ifhub/Ifhub.class.php new file mode 100644 index 00000000..6643f50e --- /dev/null +++ b/application/classes/modules/ifhub/Ifhub.class.php @@ -0,0 +1,41 @@ + + * Текст спойлера + * + * + * @param string $sTag Тег на ктором сработал колбэк + * @param array $aParams Список параметров тега + * @return string + */ + public function CallbackParserTagSpoiler($sTag, $aParams, $sText) + { + $sTitle = "Спойлер"; + if (isset($aParams['title'])) { + $sTitle = $aParams['title']; + } + + return '
'. + ''.$sTitle.''. + '
'.$sText.'
'. + '
'; + } +} diff --git a/application/config/jevix.php b/application/config/jevix.php index 3c976184..20709088 100644 --- a/application/config/jevix.php +++ b/application/config/jevix.php @@ -6,7 +6,7 @@ return array( 'cfgAllowTags' => array( // вызов метода с параметрами array( - array('ls', 'gallery'), + array('ls', 'gallery', 'spoiler'), ), ), // Коротие теги типа @@ -56,6 +56,10 @@ return array( 'a', array('data-rel' => '#text', 'class' => array('js-lbx')) ), + array( + 'spoiler', + array('title' => '#text') + ), ), 'cfgSetTagCallbackFull' => array( array( @@ -66,6 +70,10 @@ return array( 'gallery', array('_this_', 'Media_CallbackParserTagGallery'), ), + array( + 'spoiler', + array('_this_', 'Ifhub_CallbackParserTagSpoiler'), + ), ) ), ); diff --git a/application/plugins/bspoiler/PluginBspoiler.class.php b/application/plugins/bspoiler/PluginBspoiler.class.php deleted file mode 100644 index 54125fc1..00000000 --- a/application/plugins/bspoiler/PluginBspoiler.class.php +++ /dev/null @@ -1,73 +0,0 @@ - array('ModuleText' => '_ModuleBspoiler') - ); - - // Активация плагина - public function Activate() { - return TRUE; - } - - // Деактивация плагина - public function Deactivate() { - return TRUE; - } - - /** - * Инициализация плагина - * - * (non-PHPdoc) - * @see engine/classes/Plugin#Init() - */ - public function Init() - { - $sTemplatesUrl = Plugin::GetTemplatePath('PluginBspoiler'); - - // Добавление своего CSS и JS - $this->Viewer_AppendStyle($sTemplatesUrl."/css/style.css"); - $this->Viewer_AppendScript($sTemplatesUrl."/js/bspoiler.js"); - } - -} - -?> diff --git a/application/plugins/bspoiler/Readme.txt b/application/plugins/bspoiler/Readme.txt deleted file mode 100644 index 75de02cc..00000000 --- a/application/plugins/bspoiler/Readme.txt +++ /dev/null @@ -1,8 +0,0 @@ ----Плагин спойлер--- - -Описание настройки: http://livestreet.ru/blog/17229.html - -Первоначальный автор - kks. -Адаптировал для 1.0.3 - http://livestreet.ru/profile/dex-/ -Выложил в каталог - testerok, gs.dafter.ru - diff --git a/application/plugins/bspoiler/classes/.htaccess b/application/plugins/bspoiler/classes/.htaccess deleted file mode 100644 index f31bf500..00000000 --- a/application/plugins/bspoiler/classes/.htaccess +++ /dev/null @@ -1,2 +0,0 @@ -Order Deny,Allow -Deny from all \ No newline at end of file diff --git a/application/plugins/bspoiler/classes/modules/bspoiler/Bspoiler.class.php b/application/plugins/bspoiler/classes/modules/bspoiler/Bspoiler.class.php deleted file mode 100644 index 8770d346..00000000 --- a/application/plugins/bspoiler/classes/modules/bspoiler/Bspoiler.class.php +++ /dev/null @@ -1,64 +0,0 @@ -oJevix->tagsRules); - $aTags[] = 'spoiler'; - $this->oJevix->cfgAllowTags($aTags); - $this->oJevix->cfgAllowTagParams('spoiler', array('title')); - } - - private function SpoilerParser($sText) - { - $aMatches = array(); - while (preg_match('//', $sText, $aMatches) !== false && count($aMatches) > 1) { - $sTitle = $aMatches[1]; - $sText = str_replace("", - '
'.$sTitle.'
', - $sText); - $sText = str_replace("", '
', $sText); - } - return $sText; - } - - public function Parser($sText) - { - $sResult = parent::Parser($sText); - $sResult = $this->SpoilerParser($sResult); - echo $sResult;die; - return $sResult; - } -} - -?> diff --git a/application/plugins/bspoiler/config/.htaccess b/application/plugins/bspoiler/config/.htaccess deleted file mode 100644 index f31bf500..00000000 --- a/application/plugins/bspoiler/config/.htaccess +++ /dev/null @@ -1,2 +0,0 @@ -Order Deny,Allow -Deny from all \ No newline at end of file diff --git a/application/plugins/bspoiler/config/config.php b/application/plugins/bspoiler/config/config.php deleted file mode 100644 index e0dcaf01..00000000 --- a/application/plugins/bspoiler/config/config.php +++ /dev/null @@ -1,32 +0,0 @@ - \ No newline at end of file diff --git a/application/plugins/bspoiler/plugin.xml b/application/plugins/bspoiler/plugin.xml deleted file mode 100644 index 332ca867..00000000 --- a/application/plugins/bspoiler/plugin.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - Bspoiler Plugin (rewrote 1.0.3) - Плагин Bspoiler (переделан под 1.0.3) - - - kks (rewrote dex-) - kks (переделал dex-, выложил testerok) - - http://ls.ksotik.ru/ - 1.1.0 - - 2.0.* - - - - - Spoiler tag support. - Плагин, добавляющий поддержку тега spoiler в топики и страницы. - - diff --git a/application/plugins/bspoiler/templates/.htaccess b/application/plugins/bspoiler/templates/.htaccess deleted file mode 100644 index d183f597..00000000 --- a/application/plugins/bspoiler/templates/.htaccess +++ /dev/null @@ -1,5 +0,0 @@ -Options -Indexes - - Order allow,deny - Deny from all - \ No newline at end of file diff --git a/application/plugins/bspoiler/templates/skin/default/css/style.css b/application/plugins/bspoiler/templates/skin/default/css/style.css deleted file mode 100644 index 693699e0..00000000 --- a/application/plugins/bspoiler/templates/skin/default/css/style.css +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Spoiler :: CSS - * Modified by fedorov mich 2014 - * [ LS :: 1.0.3 | Habra Style ] - */ -.spoiler-title { color: #6da3bd; border-bottom: 1px dashed; font-weight: normal; cursor: pointer; } -.spoiler-title:hover { color: #4d7285; } -.spoiler-body { display: none; padding: 10px; border: 1px solid #eee; background: #f9f9f9; margin-top: 10px; overflow: hidden; } -.spoiler-title:before { float: left; content: " "; width: 16px; height: 16px; margin-top: 2px; display: block; border: 0px solid red; background: url(../images/spoiler.icon.png) no-repeat left top; } -.spoiler-title.open:before { background: url(../images/spoiler.icon.png) no-repeat left bottom; } \ No newline at end of file diff --git a/application/plugins/bspoiler/templates/skin/default/images/spoiler.icon.png b/application/plugins/bspoiler/templates/skin/default/images/spoiler.icon.png deleted file mode 100644 index 0a77069e496a409ef9c36bd108600dc0d3e85ebd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1022 zcmaJ=O=uHA6yDk*HCX9I#6LQ2@n&{+k|uGtiEWZiOrTpz8cB|BcPGix?#_01+H86f z|DZ<^DGG{s5|sAhMGJcIQt{x=LF~nzl!D?(5TWR7nxr0#3$rut@qOQWZ{C~bsmb#L zfnx!NVFvO!xj^?px^EKU$l1!OQ;|i&(4q}ozo(Q) zmnMta(yS)x?ASRF_arJ{BBBD%oU>fXOR!B{iJpBo&w?g|%qG~~q{_+^NMi?q2qy$J zAu50<Bnbj&eJqXU=oP6TXIrtTm0)Xx*b>jz>vgUk z=CD)cp(u*JMko}dh@jiBi0TC`cet$}BUf__n;6&vzM?vV7f6DoneLWg+8tTTZCw++ zFy2#b9&&cjYH27hCs?Y$8HO%plc@+Ck(04(1VWgBDL4|& zW@7?%i()33X>(<)Ettq6ZLYq@O?Bn^qhQ)JvWy&K5$Rb6o1j^;WOUEvY*)P&SMQ#S z*pJ-8qSNCaJ7Y_Y&fp`9PP;?L`Xu{Bq))=h%gLg*`SoV<5Ci)%H=eFM z`miza?C!zmi|;e1qlfw2(E8}Nt8XeN`i1bPd-r<}l*UhO4-DoSF9U^r#ak;q7u>-3 zoiwu