diff --git a/.gitignore b/.gitignore index b0bb8dbc..489d73a8 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,4 @@ application/config/config.local.php application/logs uploads application/tmp -application/plugins +application/plugins/admin diff --git a/application/plugins/bspoiler/PluginBspoiler.class.php b/application/plugins/bspoiler/PluginBspoiler.class.php new file mode 100644 index 00000000..54125fc1 --- /dev/null +++ b/application/plugins/bspoiler/PluginBspoiler.class.php @@ -0,0 +1,73 @@ + 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 new file mode 100644 index 00000000..75de02cc --- /dev/null +++ b/application/plugins/bspoiler/Readme.txt @@ -0,0 +1,8 @@ +---Плагин спойлер--- + +Описание настройки: 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 new file mode 100644 index 00000000..f31bf500 --- /dev/null +++ b/application/plugins/bspoiler/classes/.htaccess @@ -0,0 +1,2 @@ +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 new file mode 100644 index 00000000..db9a7879 --- /dev/null +++ b/application/plugins/bspoiler/classes/modules/bspoiler/Bspoiler.class.php @@ -0,0 +1,64 @@ +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 new file mode 100644 index 00000000..f31bf500 --- /dev/null +++ b/application/plugins/bspoiler/config/.htaccess @@ -0,0 +1,2 @@ +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 new file mode 100644 index 00000000..e0dcaf01 --- /dev/null +++ b/application/plugins/bspoiler/config/config.php @@ -0,0 +1,32 @@ + \ No newline at end of file diff --git a/application/plugins/bspoiler/plugin.xml b/application/plugins/bspoiler/plugin.xml new file mode 100644 index 00000000..332ca867 --- /dev/null +++ b/application/plugins/bspoiler/plugin.xml @@ -0,0 +1,22 @@ + + + + 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 new file mode 100644 index 00000000..d183f597 --- /dev/null +++ b/application/plugins/bspoiler/templates/.htaccess @@ -0,0 +1,5 @@ +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 new file mode 100644 index 00000000..693699e0 --- /dev/null +++ b/application/plugins/bspoiler/templates/skin/default/css/style.css @@ -0,0 +1,10 @@ +/** + * 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 new file mode 100644 index 00000000..0a77069e Binary files /dev/null and b/application/plugins/bspoiler/templates/skin/default/images/spoiler.icon.png differ diff --git a/application/plugins/bspoiler/templates/skin/default/js/bspoiler.js b/application/plugins/bspoiler/templates/skin/default/js/bspoiler.js new file mode 100644 index 00000000..742b4a44 --- /dev/null +++ b/application/plugins/bspoiler/templates/skin/default/js/bspoiler.js @@ -0,0 +1,12 @@ +/** + * Spoiler :: jQuery + * Modified by fedorov mich 2014 + * [ LS :: 1.0.3 | Habra Style ] + */ +$(document).ready(function(){ + $('.spoiler-title').on('click touchstart', function(){ + $(this).toggleClass('open'); + $(this).parent().children('div.spoiler-body').toggle('normal'); + return false; + }); +}); \ No newline at end of file