Merge pull request #37 from Chri-s/master
Added option "stripBrs" ("Ignore <br> tags")
This commit is contained in:
commit
c651443017
2 changed files with 15 additions and 1 deletions
|
@ -29,3 +29,5 @@
|
||||||
@define('PLUGIN_EVENT_DPSYNTAXHIGHLIGHTER_SMARTTABS_DESC', 'Allows you to turn smart tabs feature on and off.');
|
@define('PLUGIN_EVENT_DPSYNTAXHIGHLIGHTER_SMARTTABS_DESC', 'Allows you to turn smart tabs feature on and off.');
|
||||||
@define('PLUGIN_EVENT_DPSYNTAXHIGHLIGHTER_TABSIZE', 'Tab size for smart tabs');
|
@define('PLUGIN_EVENT_DPSYNTAXHIGHLIGHTER_TABSIZE', 'Tab size for smart tabs');
|
||||||
@define('PLUGIN_EVENT_DPSYNTAXHIGHLIGHTER_TABSIZE_DESC', 'Allows you to adjust tab size.');
|
@define('PLUGIN_EVENT_DPSYNTAXHIGHLIGHTER_TABSIZE_DESC', 'Allows you to adjust tab size.');
|
||||||
|
@define('PLUGIN_EVENT_DPSYNTAXHIGHLIGHTER_STRIPBRS', 'Ignore <br> tags');
|
||||||
|
@define('PLUGIN_EVENT_DPSYNTAXHIGHLIGHTER_STRIPBRS_DESC', 'If your software adds <br /> tags at the end of each line, this option allows you to ignore those..');
|
|
@ -66,6 +66,7 @@ class serendipity_event_dpsyntaxhighlighter extends serendipity_event {
|
||||||
$conf_array[] = 'gutter';
|
$conf_array[] = 'gutter';
|
||||||
$conf_array[] = 'smart-tabs';
|
$conf_array[] = 'smart-tabs';
|
||||||
$conf_array[] = 'tab-size';
|
$conf_array[] = 'tab-size';
|
||||||
|
$conf_array[] = 'stripBrs';
|
||||||
$propbag->add('configuration', $conf_array);
|
$propbag->add('configuration', $conf_array);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,6 +138,12 @@ class serendipity_event_dpsyntaxhighlighter extends serendipity_event {
|
||||||
$propbag->add('default', '4');
|
$propbag->add('default', '4');
|
||||||
$propbag->add('validate', 'number');
|
$propbag->add('validate', 'number');
|
||||||
break;
|
break;
|
||||||
|
case 'stripBrs':
|
||||||
|
$propbag->add('type', 'boolean');
|
||||||
|
$propbag->add('name', PLUGIN_EVENT_DPSYNTAXHIGHLIGHTER_STRIPBRS);
|
||||||
|
$propbag->add('description', PLUGIN_EVENT_DPSYNTAXHIGHLIGHTER_STRIPBRS_DESC);
|
||||||
|
$propbag->add('default', 'false');
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -173,6 +180,11 @@ class serendipity_event_dpsyntaxhighlighter extends serendipity_event {
|
||||||
$footer_add .= '<script type="text/javascript">
|
$footer_add .= '<script type="text/javascript">
|
||||||
SyntaxHighlighter.config.clipboardSwf = \''.$pluginDir.'/sh/'.$this->version.'/scripts/clipboard.swf\';';
|
SyntaxHighlighter.config.clipboardSwf = \''.$pluginDir.'/sh/'.$this->version.'/scripts/clipboard.swf\';';
|
||||||
|
|
||||||
|
$stripBrs = $this->get_config('stripBrs');
|
||||||
|
if ($stripBrs) {
|
||||||
|
$footer_add .= 'SyntaxHighlighter.config.stripBrs = true;';
|
||||||
|
}
|
||||||
|
|
||||||
$toolbar = $this->get_config('toolbar');
|
$toolbar = $this->get_config('toolbar');
|
||||||
if (!$toolbar) {
|
if (!$toolbar) {
|
||||||
$footer_add .= 'SyntaxHighlighter.defaults[\'toolbar\'] = false;';
|
$footer_add .= 'SyntaxHighlighter.defaults[\'toolbar\'] = false;';
|
||||||
|
|
Loading…
Reference in a new issue