mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-05-04 18:08:19 +03:00
bSpoiler plugin (inactive?)
This commit is contained in:
parent
b9e8e3e6af
commit
4099a07a18
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -3,4 +3,4 @@ application/config/config.local.php
|
|||
application/logs
|
||||
uploads
|
||||
application/tmp
|
||||
application/plugins
|
||||
application/plugins/admin
|
||||
|
|
73
application/plugins/bspoiler/PluginBspoiler.class.php
Normal file
73
application/plugins/bspoiler/PluginBspoiler.class.php
Normal file
|
@ -0,0 +1,73 @@
|
|||
<?php
|
||||
|
||||
/*-------------------------------------------------------
|
||||
*
|
||||
* LiveStreet Engine Social Networking
|
||||
* Copyright © 2008 Mzhelskiy Maxim
|
||||
*
|
||||
*--------------------------------------------------------
|
||||
*
|
||||
* Official site: www.livestreet.ru
|
||||
* Contact e-mail: rus.engine@gmail.com
|
||||
*
|
||||
* GNU General Public License, version 2:
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
*
|
||||
*---------------------------------------------------------
|
||||
*
|
||||
* Plugin Spoiler
|
||||
* Shpinev Konstantin
|
||||
* Contact e-mail: thedoublekey@gmail.com
|
||||
*
|
||||
*---------------------------------------------------------
|
||||
*
|
||||
* Spoiler :: Plugin
|
||||
* Modified by fedorov mich © 2014
|
||||
* [ LS :: 1.0.3 | Habra Style ]
|
||||
*
|
||||
*/
|
||||
|
||||
if (!class_exists('Plugin')) {
|
||||
die('Hacking attemp!');
|
||||
}
|
||||
|
||||
class PluginBspoiler extends Plugin {
|
||||
protected $sTemplatesUrl = "";
|
||||
|
||||
/**
|
||||
* Делегаты
|
||||
*
|
||||
* @var unknown_type
|
||||
*/
|
||||
protected $aInherits = array(
|
||||
'module' => 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");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
8
application/plugins/bspoiler/Readme.txt
Normal file
8
application/plugins/bspoiler/Readme.txt
Normal file
|
@ -0,0 +1,8 @@
|
|||
---Плагин спойлер---
|
||||
|
||||
Описание настройки: http://livestreet.ru/blog/17229.html
|
||||
|
||||
Первоначальный автор - kks.
|
||||
Адаптировал для 1.0.3 - http://livestreet.ru/profile/dex-/
|
||||
Выложил в каталог - testerok, gs.dafter.ru
|
||||
|
2
application/plugins/bspoiler/classes/.htaccess
Normal file
2
application/plugins/bspoiler/classes/.htaccess
Normal file
|
@ -0,0 +1,2 @@
|
|||
Order Deny,Allow
|
||||
Deny from all
|
|
@ -0,0 +1,64 @@
|
|||
<?php
|
||||
|
||||
/*-------------------------------------------------------
|
||||
*
|
||||
* LiveStreet Engine Social Networking
|
||||
* Copyright © 2008 Mzhelskiy Maxim
|
||||
*
|
||||
*--------------------------------------------------------
|
||||
*
|
||||
* Official site: www.livestreet.ru
|
||||
* Contact e-mail: rus.engine@gmail.com
|
||||
*
|
||||
* GNU General Public License, version 2:
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
*
|
||||
*---------------------------------------------------------
|
||||
*
|
||||
* Plugin Spoiler
|
||||
* Shpinev Konstantin
|
||||
* Contact e-mail: thedoublekey@gmail.com
|
||||
*
|
||||
*---------------------------------------------------------
|
||||
*
|
||||
* Spoiler :: Plugin
|
||||
* Modified by fedorov mich © 2014
|
||||
* [ LS :: 1.0.3 | Habra Style ]
|
||||
*
|
||||
*/
|
||||
|
||||
class PluginBspoiler_ModuleBspoiler extends ModuleText_ModuleBspoiler
|
||||
{
|
||||
protected function JevixConfig()
|
||||
{
|
||||
parent::JevixConfig();
|
||||
|
||||
$aTags = array_keys($this->oJevix->tagsRules);
|
||||
$aTags[] = 'spoiler';
|
||||
$this->oJevix->cfgAllowTags($aTags);
|
||||
$this->oJevix->cfgAllowTagParams('spoiler', array('title'));
|
||||
}
|
||||
|
||||
private function SpoilerParser($sText)
|
||||
{
|
||||
$aMatches = array();
|
||||
while (preg_match('/<spoiler title="(.+?)">/', $sText, $aMatches) !== false && count($aMatches) > 1) {
|
||||
$sTitle = $aMatches[1];
|
||||
$sText = str_replace("<spoiler title=\"$sTitle\">",
|
||||
'<div><b class="spoiler-title">'.$sTitle.'</b><div class="spoiler-body">',
|
||||
$sText);
|
||||
$sText = str_replace("</spoiler>", '</div></div>', $sText);
|
||||
}
|
||||
return $sText;
|
||||
}
|
||||
|
||||
public function Parser($sText)
|
||||
{
|
||||
$sResult = parent::Parser($sText);
|
||||
$sResult = $this->SpoilerParser($sResult);
|
||||
echo $sResult;die;
|
||||
return $sResult;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
2
application/plugins/bspoiler/config/.htaccess
Normal file
2
application/plugins/bspoiler/config/.htaccess
Normal file
|
@ -0,0 +1,2 @@
|
|||
Order Deny,Allow
|
||||
Deny from all
|
32
application/plugins/bspoiler/config/config.php
Normal file
32
application/plugins/bspoiler/config/config.php
Normal file
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
/*-------------------------------------------------------
|
||||
*
|
||||
* LiveStreet Engine Social Networking
|
||||
* Copyright © 2008 Mzhelskiy Maxim
|
||||
*
|
||||
*--------------------------------------------------------
|
||||
*
|
||||
* Official site: www.livestreet.ru
|
||||
* Contact e-mail: rus.engine@gmail.com
|
||||
*
|
||||
* GNU General Public License, version 2:
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
*
|
||||
*---------------------------------------------------------
|
||||
*
|
||||
* Plugin Spoiler
|
||||
* Shpinev Konstantin
|
||||
* Contact e-mail: thedoublekey@gmail.com
|
||||
*
|
||||
*---------------------------------------------------------
|
||||
*
|
||||
* Spoiler :: Plugin
|
||||
* Modified by fedorov mich © 2014
|
||||
* [ LS :: 1.0.3 | Habra Style ]
|
||||
*
|
||||
*/
|
||||
|
||||
$config = array();
|
||||
|
||||
?>
|
22
application/plugins/bspoiler/plugin.xml
Normal file
22
application/plugins/bspoiler/plugin.xml
Normal file
|
@ -0,0 +1,22 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<plugin>
|
||||
<name>
|
||||
<lang name="default">Bspoiler Plugin (rewrote 1.0.3)</lang>
|
||||
<lang name="russian">Плагин Bspoiler (переделан под 1.0.3)</lang>
|
||||
</name>
|
||||
<author>
|
||||
<lang name="default">kks (rewrote dex-)</lang>
|
||||
<lang name="russian">kks (переделал dex-, выложил testerok)</lang>
|
||||
</author>
|
||||
<homepage>http://ls.ksotik.ru/</homepage>
|
||||
<version>1.1.0</version>
|
||||
<requires>
|
||||
<livestreet>2.0.*</livestreet>
|
||||
<plugins>
|
||||
</plugins>
|
||||
</requires>
|
||||
<description>
|
||||
<lang name="default">Spoiler tag support.</lang>
|
||||
<lang name="russian">Плагин, добавляющий поддержку тега spoiler в топики и страницы.</lang>
|
||||
</description>
|
||||
</plugin>
|
5
application/plugins/bspoiler/templates/.htaccess
Normal file
5
application/plugins/bspoiler/templates/.htaccess
Normal file
|
@ -0,0 +1,5 @@
|
|||
Options -Indexes
|
||||
<Files ~ "\.tpl$">
|
||||
Order allow,deny
|
||||
Deny from all
|
||||
</Files>
|
|
@ -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; }
|
Binary file not shown.
After Width: | Height: | Size: 1,022 B |
|
@ -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;
|
||||
});
|
||||
});
|
Loading…
Reference in a new issue