Ver código fonte

Added new flags (border, borderColor) and changes

 * New flags "border" and "borderColor"
 * Changed "align" from style to Dokuwiki .media{left,center,right} CSS class
Giuseppe Di Terlizzi 10 anos atrás
pai
commit
e86928d5df
2 arquivos alterados com 20 adições e 21 exclusões
  1. 1 1
      plugin.info.txt
  2. 19 20
      syntax/icon.php

+ 1 - 1
plugin.info.txt

@@ -1,7 +1,7 @@
 base icons
 author Giuseppe Di Terlizzi
 email giuseppe.diterlizzi@gmail.com
-date 2015-03-19
+date 2015-03-20
 name Icons Plugin
 desc Embed icons in Dokuwiki
 url http://www.dokuwiki.org/plugin:icons

+ 19 - 20
syntax/icon.php

@@ -172,55 +172,54 @@ class syntax_plugin_icons_icon extends DokuWiki_Syntax_Plugin {
         switch ($flag) {
 
           case 'pack':
-            $this->flags['pack'] = $value;
+            $this->flags[$flag] = $value;
             break;
 
           case 'size':
-            $this->flags['size']       = (int) $value;
+            $this->flags[$flag]       = (int) $value;
             $this->styles['font-size'] = "{$value}px";
             break;
 
           case 'circle':
-            $this->flags['circle']                 = true;
+            $this->flags[$flag]                 = true;
             $this->styles['border-radius']         = '50%';
             $this->styles['-moz-border-radius']    = '50%';
             $this->styles['-webkit-border-radius'] = '50%';
             break;
 
+          case 'border':
+            $this->flags[$flag]     = true;
+            $this->styles['border'] = '0.08em solid #EEE';
+            break;
+
+          case 'borderColor':
+            $this->flags[$flag] = $value;
+            $this->styles['border-color'] = $value;
+            break;
+
           case 'padding':
-            $this->flags['padding']  = $value;
+            $this->flags[$flag]  = $value;
             $this->styles['padding'] = $value;
             break;
 
           case 'background':
-            $this->flags['background']        = $value;
+            $this->flags[$flag]        = $value;
             $this->styles['background-color'] = $value;
             break;
 
           case 'color':
-            $this->flags['color']  = $value;
+            $this->flags[$flag]  = $value;
             $this->styles['color'] = $value;
             break;
 
           case 'class':
-            $this->flags['class'] = $value;
+            $this->flags[$flag] = $value;
             $this->classes[] = $value;
             break;
 
           case 'align':
-
-            $this->flags['align'] = $value;
-
-            if ($value !== 'center') {
-              $margin = ($value == 'left') ? 'right' : 'left';
-              $this->styles['float'] = $value;
-              $this->styles["margin-$margin"] = '.2em';
-            } else {
-              $this->styles['display']    = 'block';
-              $this->styles['text-align'] = 'center';
-              $this->styles['margin']     = '0 auto';
-            }
-
+            $this->flags[$flag] = $value;
+            $this->classes[] = "media$value";
             break;
 
           default: