OSDN Git Service

BugTrack/2188 Define List layout by CSS instead of ini file
authorumorigu <umorigu@gmail.com>
Wed, 16 Aug 2017 16:04:56 +0000 (01:04 +0900)
committerumorigu <umorigu@gmail.com>
Wed, 16 Aug 2017 16:04:56 +0000 (01:04 +0900)
* Define List styles by CSS instead of default.ini file
  * Add list-indent1, 2 and 3: that is express indent-distance to parent list
* In default.ini.php, $_ul_margin, $_ol_margin and $_dl_margin must be 1
  * These are used as indent leaping level calclation source
  * $_list_pad_str = ' class="list%d list-indent%d"';
    * 2nd param of sprintf($_list_pad_str, $1, $2) is exactly indent-level.
* This replacement from PHP logic to CSS is completely compatible
  with existing list logic that contains ls2 plugin
  and PukiWiki core list logic.

default.ini.php
keitai.ini.php
skin/pukiwiki.css
skin/tdiary.css

index 2f5259a..3c97f6e 100644 (file)
@@ -1,8 +1,8 @@
 <?php
 // PukiWiki - Yet another WikiWikiWeb clone.
-// $Id: default.ini.php,v 1.25 2005/12/20 14:04:40 henoheno Exp $
-// Copyright (C)
-//   2003-2005 PukiWiki Developers Team
+// default.ini.php
+// Copyright
+//   2003-2017 PukiWiki Development Team
 //   2001-2002 Originally written by yu-ji
 // License: GPL v2 or (at your option) any later version
 //
@@ -30,14 +30,15 @@ $search_word_color = 1;
 $list_index = 1;
 
 /////////////////////////////////////////////////
-// リスト構造の左マージン
-$_ul_left_margin = 0;   // リストと画面左端との間隔(px)
-$_ul_margin = 16;       // リストの階層間の間隔(px)
-$_ol_left_margin = 0;   // リストと画面左端との間隔(px)
-$_ol_margin = 16;       // リストの階層間の間隔(px)
-$_dl_left_margin = 0;   // リストと画面左端との間隔(px)
-$_dl_margin = 16;        // リストの階層間の間隔(px)
-$_list_pad_str = ' class="list%d" style="padding-left:%dpx;margin-left:%dpx"';
+// Obsolete: リスト構造の左マージン (Leaves for compatibility of plugins)
+// Use list-indent1 CSS class instead
+$_ul_left_margin = 0;   // Must be 0 (Plugin backward compatibility)
+$_ul_margin = 1;        // Must be 1 (Plugin backward compatibility)
+$_ol_left_margin = 0;   // Must be 0
+$_ol_margin = 1;        // Must be 1
+$_dl_left_margin = 0;   // Must be 0
+$_dl_margin = 1;        // Must be 1
+$_list_pad_str = ' class="list%d list-indent%d"';
 
 /////////////////////////////////////////////////
 // テキストエリアのカラム数
@@ -178,5 +179,3 @@ $facemark_rules = array(
        '&amp;(phoneto);'=>'[phoneto]',
        '&amp;(faxto);' => '[faxto]',
 );
-
-?>
index 7455e4f..33bb45f 100644 (file)
@@ -1,8 +1,8 @@
 <?php
 // PukiWiki - Yet another WikiWikiWeb clone.
-// $Id: keitai.ini.php,v 1.25 2005/12/10 07:57:30 henoheno Exp $
-// Copyright (C)
-//   2002-2005 PukiWiki Developers Team
+// keitai.ini.php
+// Copyright
+//   2002-2017 PukiWiki Development Team
 //   2001-2002 Originally written by yu-ji
 // License: GPL v2 or (at your option) any later version
 //
@@ -30,13 +30,14 @@ $search_word_color = 0;
 $list_index = 0;
 
 /////////////////////////////////////////////////
-// リスト構造の左マージン
-$_ul_left_margin =  0; // リストと画面左端との間隔(px)
-$_ul_margin      = 16; // リストの階層間の間隔(px)
-$_ol_left_margin =  0; // リストと画面左端との間隔(px)
-$_ol_margin      = 16; // リストの階層間の間隔(px)
-$_dl_left_margin =  0; // リストと画面左端との間隔(px)
-$_dl_margin      = 16; // リストの階層間の間隔(px)
+// Obsolete: リスト構造の左マージン (Leaves for compatibility of plugins)
+// Use list-indent1 CSS class instead
+$_ul_left_margin =  0; // Must be 0 (Plugin backward compatibility)
+$_ul_margin      = 1;  // Must be 1 (Plugin backward compatibility)
+$_ol_left_margin =  0; // Must be 0
+$_ol_margin      = 1;  // Must be 1
+$_dl_left_margin =  0; // Must be 0
+$_dl_margin      = 1;  // Must be 1
 $_list_pad_str   = '';
 
 /////////////////////////////////////////////////
@@ -383,5 +384,3 @@ switch ($ua_name) {
 }
 
 unset($matches, $ua_name, $ua_vers, $ua_agent, $special_rules);
-
-?>
index 9952a8d..411e383 100644 (file)
@@ -2,8 +2,8 @@
 
 /*!
  * PukiWiki - Yet another WikiWikiWeb clone.
- * Copyright (C)
- *   2002-2016 PukiWiki Development Team
+ * Copyright
+ *   2002-2017 PukiWiki Development Team
  *   2001-2002 Originally written by yu-ji
  * License: GPL v2 or (at your option) any later version
  *
@@ -168,6 +168,24 @@ ol.list1 { list-style-type:decimal; }
 ol.list2 { list-style-type:lower-roman; }
 ol.list3 { list-style-type:lower-alpha; }
 
+.list-indent1 {
+       padding-left: 16px;
+       margin-left: 16px
+}
+/* list-indent2,3,4 are used for leaping list level indentation */
+.list-indent2 {
+       padding-left: 32px;
+       margin-left: 32px
+}
+.list-indent3 {
+       padding-left: 48px;
+       margin-left: 48px
+}
+.list-indent4 {
+       padding-left: 64px;
+       margin-left: 64px
+}
+
 div.ie5 { text-align:center; }
 
 span.noexists {
index 78ec214..c4a39f1 100644 (file)
@@ -2,8 +2,8 @@
 
 /*!
  * PukiWiki - Yet another WikiWikiWeb clone.
- * Copyright (C)
- *   2002-2016 PukiWiki Development Team
+ * Copyright
+ *   2002-2017 PukiWiki Development Team
  *   2001-2002 Originally written by yu-ji
  * License: GPL v2 or (at your option) any later version
  *
@@ -70,6 +70,24 @@ ol.list1 { list-style-type:decimal; }
 ol.list2 { list-style-type:lower-roman; }
 ol.list3 { list-style-type:lower-alpha; }
 
+.list-indent1 {
+       padding-left: 16px;
+       margin-left: 16px
+}
+/* list-indent2,3,4 are used for leaping list level indentation */
+.list-indent2 {
+       padding-left: 32px;
+       margin-left: 32px
+}
+.list-indent3 {
+       padding-left: 48px;
+       margin-left: 48px
+}
+.list-indent4 {
+       padding-left: 64px;
+       margin-left: 64px
+}
+
 div.ie5 { text-align:center; }
 
 /* NoSuchPage? */