Dotclear

Changeset 1443


Ignore:
Timestamp:
09/09/09 16:10:36 (14 years ago)
Author:
Moe
Message:

Sup Sub Tags 1.0.1 :

  • fixed bug with empty tags (thanks to nico@nc)
Location:
plugins/supSubTags
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • plugins/supSubTags/_admin.php

    r664 r1443  
    33# 
    44# This file is part of Sup Sub Tags. 
    5 # Copyright 2007 Moe (http://gniark.net/) 
     5# Copyright 2007,2009 Moe (http://gniark.net/) 
    66# 
    77# Sup Sub Tags is free software; you can redistribute it and/or modify 
     
    3232{ 
    3333     public static function wiki(&$wiki2xhtml) 
    34      { 
    35           global $core; 
     34     {     
     35          $s = $GLOBALS['core']->blog->settings; 
    3636 
    37           $tags = array( 
    38                'sup'=>array($core->blog->settings->supsub_tags_sup_open, 
    39                     $core->blog->settings->supsub_tags_sup_close), 
    40                'sub'=>array($core->blog->settings->supsub_tags_sub_open, 
    41                     $core->blog->settings->supsub_tags_sub_close) 
    42           ); 
     37          $tags = array(); 
     38           
     39          # empty tags cause errors, we ignore them 
     40          if (!empty($s->supsub_tags_sup_open) 
     41               && (!empty($s->supsub_tags_sup_close))) 
     42          { 
     43               $tags['sup'] =array($s->supsub_tags_sup_open, 
     44                    $s->supsub_tags_sup_close); 
     45          } 
     46           
     47          if (!empty($s->supsub_tags_sub_open) 
     48               && (!empty($s->supsub_tags_sub_close))) 
     49          { 
     50               $tags['sup'] =array($s->supsub_tags_sub_open, 
     51                    $s->supsub_tags_sub_close); 
     52          } 
     53           
     54          if (empty($tags)) {return;} 
     55           
    4356          $wiki2xhtml->custom_tags = array_merge($wiki2xhtml->custom_tags,$tags); 
    4457     } 
     
    4659     public static function postHeaders() 
    4760     { 
    48           global $core; 
     61          $s = $GLOBALS['core']->blog->settings; 
    4962 
    5063          return 
     
    5770          "jsToolBar.prototype.elements.sup.fn.wiki = ". 
    5871          "function() { this.encloseSelection('". 
    59           html::escapeJS($core->blog->settings->supsub_tags_sup_open)."','". 
    60           html::escapeJS($core->blog->settings->supsub_tags_sup_close)."') };". 
     72          html::escapeJS($s->supsub_tags_sup_open)."','". 
     73          html::escapeJS($s->supsub_tags_sup_close)."') };". 
    6174          "jsToolBar.prototype.elements.sub.fn.wiki = ". 
    6275          "function() { this.encloseSelection('". 
    63           html::escapeJS($core->blog->settings->supsub_tags_sub_open)."','". 
    64           html::escapeJS($core->blog->settings->supsub_tags_sub_close)."') };". 
     76          html::escapeJS($s->supsub_tags_sub_open)."','". 
     77          html::escapeJS($s->supsub_tags_sub_close)."') };". 
    6578          "</script>\n"; 
    6679     } 
  • plugins/supSubTags/_define.php

    r664 r1443  
    33# 
    44# This file is part of Sup Sub Tags. 
    5 # Copyright 2007 Moe (http://gniark.net/) 
     5# Copyright 2007,2009 Moe (http://gniark.net/) 
    66# 
    77# Sup Sub Tags is free software; you can redistribute it and/or modify 
     
    2626        /* Description*/                "Add superscript and subscript tags to syntax", 
    2727        /* Author */                    "Moe (http://gniark.net/)", 
    28         /* Version */                   '1.0', 
     28        /* Version */                   '1.0.1', 
    2929        /* Permissions */               'usage,contentadmin' 
    3030); 
  • plugins/supSubTags/_install.php

    r664 r1443  
    33# 
    44# This file is part of Sup Sub Tags. 
    5 # Copyright 2007 Moe (http://gniark.net/) 
     5# Copyright 2007,2009 Moe (http://gniark.net/) 
    66# 
    77# Sup Sub Tags is free software; you can redistribute it and/or modify 
     
    3636$settings = new dcSettings($core,$core->blog->id); 
    3737$settings->setNamespace('supsubtags'); 
    38 $settings->put('supsub_tags_sup_open','**','string','Superscript open tag',false,true); 
    39 $settings->put('supsub_tags_sup_close','**','string','Superscript close tag',false,true); 
    40 $settings->put('supsub_tags_sub_open',',,','string','Subscript open tag',false,true); 
    41 $settings->put('supsub_tags_sub_close',',,','string','Subscript close tag',false,true); 
     38$settings->put('supsub_tags_sup_open','**','string', 
     39     'Superscript open tag',false,true); 
     40$settings->put('supsub_tags_sup_close','**','string', 
     41     'Superscript close tag',false,true); 
     42$settings->put('supsub_tags_sub_open',',,','string', 
     43     'Subscript open tag',false,true); 
     44$settings->put('supsub_tags_sub_close',',,','string', 
     45     'Subscript close tag',false,true); 
     46$settings->setNamespace('system'); 
    4247  
    4348# La procédure d'installation commence vraiment là 
  • plugins/supSubTags/index.php

    r664 r1443  
    33# 
    44# This file is part of Sup Sub Tags. 
    5 # Copyright 2007 Moe (http://gniark.net/) 
     5# Copyright 2007,2009 Moe (http://gniark.net/) 
    66# 
    77# Sup Sub Tags is free software; you can redistribute it and/or modify 
  • plugins/supSubTags/post.js

    r664 r1443  
    22// 
    33// This file is part of Sup Sub Tags. 
    4 // Copyright 2007 Moe (http://gniark.net/) 
     4// Copyright 2007,2009 Moe (http://gniark.net/) 
    55// 
    66// Sup Sub Tags is free software; you can redistribute it and/or modify 
Note: See TracChangeset for help on using the changeset viewer.

Sites map