diff --git a/conf/default.php b/conf/default.php index b3f0126..49c767f 100644 --- a/conf/default.php +++ b/conf/default.php @@ -6,3 +6,4 @@ */ $conf['loadBootstrap'] = 0; +$conf['allowStylingAttributes'] = 0; \ No newline at end of file diff --git a/conf/metadata.php b/conf/metadata.php index 8ee671b..2541e6f 100644 --- a/conf/metadata.php +++ b/conf/metadata.php @@ -6,3 +6,4 @@ */ $meta['loadBootstrap'] = array('onoff', '_caution' => 'danger'); +$meta['allowStylingAttributes'] = array('onoff'); diff --git a/lang/en/settings.php b/lang/en/settings.php index f162924..e4dc3f0 100644 --- a/lang/en/settings.php +++ b/lang/en/settings.php @@ -8,3 +8,4 @@ // for the configuration manager $lang['loadBootstrap'] = "Load the Bootstrap vanilla CSS. Disable it if you have installed a Bootstrap based template."; +$lang['allowStylingAttributes'] = "Allow the use of ''class=\"\"'', ''id=\"\"'' and ''style=\"\"'' attributes on all components."; diff --git a/lang/ja/settings.php b/lang/ja/settings.php index c4549f7..7c67c7f 100644 --- a/lang/ja/settings.php +++ b/lang/ja/settings.php @@ -7,3 +7,4 @@ // 設定管理画面用 $lang['loadBootstrap'] = "Bootstrap vanilla CSS を読み込む。Bootstrap を基にしたテンプレートをインストールした場合、無効にします。"; +$lang['allowStylingAttributes'] = "Allow the use of ''class=\"\"'', ''id=\"\"'' and ''style=\"\"'' attributes on all components."; diff --git a/script.js b/script.js index 8482a08..b3c444d 100644 --- a/script.js +++ b/script.js @@ -122,6 +122,14 @@ jQuery(document).ready(function() { case 'btnSize': btn_class.push(['btn-', value].join('')); break; + case 'btnClass': + btn_class.push(value); + case 'btnId': + $btn_link.attr('id', value); + break; + case 'btnStyle': + $btn_link.attr('style', value); + break; case 'btnBlock': btn_class.push('btn-block'); break; diff --git a/syntax/accordion.php b/syntax/accordion.php index b82b95d..75a7221 100644 --- a/syntax/accordion.php +++ b/syntax/accordion.php @@ -14,7 +14,7 @@ class syntax_plugin_bootswrapper_accordion extends syntax_plugin_bootswrapper_bootstrap { - protected $pattern_start = ''; + protected $pattern_start = '(?=.*?)'; protected $pattern_end = ''; protected $tag_attributes = array( @@ -42,7 +42,10 @@ function render($mode, Doku_Renderer $renderer, $data) { case DOKU_LEXER_ENTER: $id = $attributes['id']; - $markup = sprintf('
', $id); + $style = $this->getStylingAttributes($attributes); + + $markup = sprintf('
', + $style['class'], $id, $style['style']); $renderer->doc .= $markup; return true; diff --git a/syntax/affix.php b/syntax/affix.php index 576f4b5..e5feed2 100644 --- a/syntax/affix.php +++ b/syntax/affix.php @@ -55,6 +55,7 @@ function render($mode, Doku_Renderer $renderer, $data) { $top = $attributes['offset-top']; $bottom = $attributes['offset-bottom']; $target = $attributes['target']; + $style = $this->getStylingAttributes($attributes); $data = array(); if ($top) { @@ -67,7 +68,8 @@ function render($mode, Doku_Renderer $renderer, $data) { $data[] = sprintf('data-target="%s"', $target); } - $markup = sprintf('
', implode(' ', $data)); + $markup = sprintf('
', + $style['class'], $style['id'], $style['style'], implode(' ', data)); $renderer->doc .= $markup; return true; diff --git a/syntax/alert.php b/syntax/alert.php index eac705c..94d8b65 100644 --- a/syntax/alert.php +++ b/syntax/alert.php @@ -50,9 +50,10 @@ function render($mode, Doku_Renderer $renderer, $data) { case DOKU_LEXER_ENTER: extract($attributes); + $style = $this->getStylingAttributes($attributes); - $markup = sprintf('