Index: trunk/extensions/CategoryBrowser/CategoryBrowserPage.php |
— | — | @@ -27,7 +27,7 @@ |
28 | 28 | * * Add this line at the end of your LocalSettings.php file : |
29 | 29 | * require_once "$IP/extensions/CategoryBrowser/CategoryBrowser.php"; |
30 | 30 | * |
31 | | - * @version 0.2.0 |
| 31 | + * @version 0.2.1 |
32 | 32 | * @link http://www.mediawiki.org/wiki/Extension:CategoryBrowser |
33 | 33 | * @author Dmitriy Sintsov <questpc@rambler.ru> |
34 | 34 | * @addtogroup Extensions |
— | — | @@ -111,8 +111,8 @@ |
112 | 112 | ); |
113 | 113 | if ( CB_Setup::$cat_title_CI != '' ) { |
114 | 114 | // case insensitive search is possible |
115 | | - $checkbox = array( '__tag' => 'input', 'type' => 'checkbox', 'onchange' => $js_setNameFilter, 'id' => 'cb_cat_name_filter_ci', 'checked' => null ); |
116 | | - $nameFilterFields[] = wfMsg( 'cb_cat_name_filter_ci', CB_XML::toText( $checkbox ) ); |
| 115 | + $nameFilterFields[] = wfMsg( 'cb_cat_name_filter_ci' ); |
| 116 | + $nameFilterFields[] = array( '__tag' => 'input', 'type' => 'checkbox', 'onchange' => $js_setNameFilter, 'id' => 'cb_cat_name_filter_ci', 'checked' => null ); |
117 | 117 | } |
118 | 118 | $top_tpl = |
119 | 119 | array( '__tag' => 'table', 'class' => 'cb_top_container', '__end' => "\n", |
— | — | @@ -122,19 +122,19 @@ |
123 | 123 | array( '__tag' => 'tr', '__end' => "\n", |
124 | 124 | array( '__tag' => 'td', 'class' => 'cb_toolbox_bottom', '__end' => "\n", |
125 | 125 | array( wfMsg( 'cb_cat_name_filter' ) ), |
126 | | - $nameFilterFields, |
| 126 | + &$nameFilterFields, |
127 | 127 | ) |
128 | 128 | ), |
129 | 129 | array( '__tag' => 'tr', '__end' => "\n", |
130 | 130 | array( '__tag' => 'td', 'class' => 'cb_toolbox', 'style' => 'display:none; ', '__end' => "\n", |
131 | | - array( '__tag' => 'div', 'id' => 'cb_editor_container', 0 => '' ), |
| 131 | + array( '__tag' => 'div', 'id' => 'cb_editor_container', 0 => '' /* holder of condition line */ ), |
132 | 132 | array( '__tag' => 'div', 'class' => 'cb_separate_container', 0 => '' /* holder of apply button */ ) |
133 | 133 | ) |
134 | 134 | ), |
135 | 135 | array( '__tag' => 'tr', '__end' => "\n", |
136 | 136 | array( '__tag' => 'td', 'class' => 'cb_toolbox', 'style' => 'display:none; ', '__end' => "\n", |
137 | 137 | array( '__tag' => 'div', 'class' => 'cb_copy_line_hint', 0 => wfMsg( 'cb_copy_line_hint' ) ), |
138 | | - array( '__tag' => 'div', 'id' => 'cb_editor_controls', 0 => '' ) |
| 138 | + array( '__tag' => 'div', 'id' => 'cb_samples_container', 0 => '' /* holder of samples line */ ) |
139 | 139 | ) |
140 | 140 | ), |
141 | 141 | array( '__tag' => 'tr', '__end' => "\n", |
— | — | @@ -145,7 +145,8 @@ |
146 | 146 | ); |
147 | 147 | # }}} |
148 | 148 | $condSelector = CategoryBrowser::generateSelector( $this->ranges, $rootPager ); |
149 | | - $catlist = $cb->generateCatList( $rootPager ); |
| 149 | + $pagerView = new CB_CategoriesView( $rootPager ); |
| 150 | + $catlist = $pagerView->generateList(); |
150 | 151 | $wgOut->addHTML( CB_XML::toText( $top_tpl ) ); |
151 | 152 | } |
152 | 153 | |
Index: trunk/extensions/CategoryBrowser/CategoryBrowser_i18n.php |
— | — | @@ -27,7 +27,7 @@ |
28 | 28 | * * Add this line at the end of your LocalSettings.php file : |
29 | 29 | * require_once "$IP/extensions/CategoryBrowser/CategoryBrowser.php"; |
30 | 30 | * |
31 | | - * @version 0.2.0 |
| 31 | + * @version 0.2.1 |
32 | 32 | * @link http://www.mediawiki.org/wiki/Extension:CategoryBrowser |
33 | 33 | * @author Dmitriy Sintsov <questpc@rambler.ru> |
34 | 34 | * @addtogroup Extensions |
— | — | @@ -50,7 +50,7 @@ |
51 | 51 | However, browsing of pre-defined conditions should work normally. |
52 | 52 | Please change or upgrade your browser, if possible.', |
53 | 53 | 'cb_cat_name_filter' => 'Search for category by name:', |
54 | | - 'cb_cat_name_filter_ci' => '(case insensitive) $1', |
| 54 | + 'cb_cat_name_filter_ci' => '(case insensitive)', |
55 | 55 | 'cb_copy_line_hint' => 'Use the [+] and [>+] buttons to copy and paste operators into the selected expression', |
56 | 56 | 'cb_has_subcategories' => '$1 {{PLURAL:$1|subcategory|subcategories}}', |
57 | 57 | 'cb_has_pages' => '$1 {{PLURAL:$1|page|pages}}', |
— | — | @@ -89,17 +89,17 @@ |
90 | 90 | * @author QuestPC |
91 | 91 | */ |
92 | 92 | $messages['qqq'] = array( |
93 | | - 'cb_cat_name_filter_ci' => 'Dialog for case insensitive category name search. Argument 1 is a script-generated html input checkbox.', |
| 93 | + 'cb_cat_name_filter_ci' => 'Dialog string for case insensitive category name search.', |
94 | 94 | 'cb_op1_template' => 'One operand operation visualisation template. Argument 1 is an operator name. Argument 2 is operation\'s parameter.', |
95 | 95 | 'cb_op2_template' => 'Two operands operation visualisation template. Argument 1 is first parameter. Argument 2 is operator name. Argument 3 is second parameter.', |
96 | 96 | 'cb_all_op' => 'Operator to select all categories available.', |
97 | 97 | 'cb_lbracket_op' => 'Opening bracket, allows to change execution order.', |
98 | 98 | 'cb_rbracket_op' => 'Closing bracket, allows to change execution order.', |
99 | | - 'cb_or_op' => 'Logical "or" operator name in your language. Short (mathematical) form is preferred.', |
100 | | - 'cb_and_op' => 'Logical "and" operator name in your language. Short (mathematical) form is preferred.', |
101 | | - 'cb_ge_op' => 'Comparsion operator "greater or equal" name in your language. Short (mathematical) form is preferred.', |
102 | | - 'cb_le_op' => 'Comparsion operator "less or equal" name in your language. Short (mathematical) form is preferred.', |
103 | | - 'cb_eq_op' => 'Comparsion operator "equal" name in your language. Short (mathematical) form is preferred.', |
| 99 | + 'cb_or_op' => 'Name of logical "or" operator in your language. Short (mathematical) form is preferred.', |
| 100 | + 'cb_and_op' => 'Name of logical "and" operator in your language. Short (mathematical) form is preferred.', |
| 101 | + 'cb_ge_op' => 'Name of comparsion operator "greater or equal" in your language. Short (mathematical) form is preferred.', |
| 102 | + 'cb_le_op' => 'Name of comparsion operator "less or equal" in your language. Short (mathematical) form is preferred.', |
| 103 | + 'cb_eq_op' => 'Name of comparsion operator "equal" in your language. Short (mathematical) form is preferred.', |
104 | 104 | ); |
105 | 105 | |
106 | 106 | /** Russian (Русский) |
— | — | @@ -113,7 +113,7 @@ |
114 | 114 | Возможен лишь просмотр предопределенных выражений. |
115 | 115 | Пожалуйста поменяйте или обновите ваш браузер.', |
116 | 116 | 'cb_cat_name_filter' => 'Поиск категории по имени:', |
117 | | - 'cb_cat_name_filter_ci' => '(без учёта регистра) $1', |
| 117 | + 'cb_cat_name_filter_ci' => '(без учёта регистра)', |
118 | 118 | 'cb_copy_line_hint' => 'Используйте кнопки [+] и [>+] для копирования оператора в выбранное выражение', |
119 | 119 | 'cb_has_subcategories' => '$1 {{PLURAL:$1|подкатегория|подкатегории|подкатегорий}}', |
120 | 120 | 'cb_has_pages' => '$1 {{PLURAL:$1|страница|страницы|страниц}}', |
Index: trunk/extensions/CategoryBrowser/INSTALL |
— | — | @@ -1,4 +1,4 @@ |
2 | | -MediaWiki extension CategoryBrowser, version 0.2.0 |
| 2 | +MediaWiki extension CategoryBrowser, version 0.2.1 |
3 | 3 | |
4 | 4 | * download the latest available version and extract it to your wiki extension directory. |
5 | 5 | * add the following line to LocalSettings.php |
Index: trunk/extensions/CategoryBrowser/CategoryBrowser.php |
— | — | @@ -27,7 +27,7 @@ |
28 | 28 | * * Add this line at the end of your LocalSettings.php file : |
29 | 29 | * require_once "$IP/extensions/CategoryBrowser/CategoryBrowser.php"; |
30 | 30 | * |
31 | | - * @version 0.2.0 |
| 31 | + * @version 0.2.1 |
32 | 32 | * @link http://www.mediawiki.org/wiki/Extension:CategoryBrowser |
33 | 33 | * @author Dmitriy Sintsov <questpc@rambler.ru> |
34 | 34 | * @addtogroup Extensions |
— | — | @@ -39,6 +39,8 @@ |
40 | 40 | |
41 | 41 | /* default minimal count of DB rows to start paging */ |
42 | 42 | define( 'CB_PAGING_ROWS', 20 ); |
| 43 | +/* minimal count of rows in image gallery (not DB rows!) pager */ |
| 44 | +define( 'CB_FILES_ROWS', 3 ); |
43 | 45 | /* maximal number of logical operations in SQL filter (condition) */ |
44 | 46 | define( 'CB_MAX_LOGICAL_OP', 5 ); |
45 | 47 | |
— | — | @@ -46,7 +48,7 @@ |
47 | 49 | |
48 | 50 | class CB_Setup { |
49 | 51 | |
50 | | - static $version = '0.2.0'; |
| 52 | + static $version = '0.2.1'; |
51 | 53 | static $ExtDir; // filesys path with windows path fix |
52 | 54 | static $ScriptPath; // apache virtual path |
53 | 55 | static $cat_pages_ranges; // ??? |
— | — | @@ -62,6 +64,11 @@ |
63 | 65 | // number of files to show in gallery row |
64 | 66 | static $imageGalleryPerRow = 4; |
65 | 67 | |
| 68 | + // default limits of different pagers |
| 69 | + static $categoriesLimit = CB_PAGING_ROWS; |
| 70 | + static $pagesLimit = CB_PAGING_ROWS; |
| 71 | + static $filesLimit = CB_FILES_ROWS; |
| 72 | + |
66 | 73 | /** |
67 | 74 | * Add this extension to the mediawiki's extensions list. |
68 | 75 | */ |
— | — | @@ -78,12 +85,19 @@ |
79 | 86 | $top_dir = array_pop( explode( '/', self::$ExtDir ) ); |
80 | 87 | self::$ScriptPath = $wgScriptPath . '/extensions' . ( ( $top_dir == 'extensions' ) ? '' : '/' . $top_dir ); |
81 | 88 | $wgExtensionMessagesFiles['CategoryBrowser'] = self::$ExtDir . '/CategoryBrowser_i18n.php'; |
| 89 | + |
82 | 90 | // do not forget to autoload all the required classes (for AJAX to work correctly) |
83 | 91 | $wgAutoloadClasses['CB_XML'] = |
84 | 92 | $wgAutoloadClasses['CB_SqlCond'] = self::$ExtDir . '/CategoryBrowserBasic.php'; |
| 93 | + |
85 | 94 | $wgAutoloadClasses['CB_RootPager'] = |
86 | | - $wgAutoloadClasses['CB_SubPager'] = |
87 | | - $wgAutoloadClasses['CategoryBrowser'] = self::$ExtDir . '/CategoryBrowserMain.php'; |
| 95 | + $wgAutoloadClasses['CB_SubPager'] = self::$ExtDir . '/CategoryBrowserModel.php'; |
| 96 | + |
| 97 | + $wgAutoloadClasses['CB_CategoriesView'] = |
| 98 | + $wgAutoloadClasses['CB_PagesView'] = |
| 99 | + $wgAutoloadClasses['CB_FilesView'] = self::$ExtDir . '/CategoryBrowserView.php'; |
| 100 | + |
| 101 | + $wgAutoloadClasses['CategoryBrowser'] = self::$ExtDir . '/CategoryBrowserCtrl.php'; |
88 | 102 | $wgAutoloadClasses['CategoryBrowserPage'] = self::$ExtDir . '/CategoryBrowserPage.php'; |
89 | 103 | |
90 | 104 | $wgExtensionCredits['specialpage'][] = array( |
— | — | @@ -94,6 +108,7 @@ |
95 | 109 | ); |
96 | 110 | $wgSpecialPages['CategoryBrowser'] = array( 'CategoryBrowserPage' ); |
97 | 111 | $wgSpecialPageGroups['CategoryBrowser'] = 'pages'; |
| 112 | + |
98 | 113 | $wgAjaxExportList[] = 'CategoryBrowser::getRootOffsetHtml'; |
99 | 114 | $wgAjaxExportList[] = 'CategoryBrowser::getSubOffsetHtml'; |
100 | 115 | $wgAjaxExportList[] = 'CategoryBrowser::applyEncodedQueue'; |
Index: trunk/extensions/CategoryBrowser/CategoryBrowserBasic.php |
— | — | @@ -27,7 +27,7 @@ |
28 | 28 | * * Add this line at the end of your LocalSettings.php file : |
29 | 29 | * require_once "$IP/extensions/CategoryBrowser/CategoryBrowser.php"; |
30 | 30 | * |
31 | | - * @version 0.2.0 |
| 31 | + * @version 0.2.1 |
32 | 32 | * @link http://www.mediawiki.org/wiki/Extension:CategoryBrowser |
33 | 33 | * @author Dmitriy Sintsov <questpc@rambler.ru> |
34 | 34 | * @addtogroup Extensions |
Index: trunk/extensions/CategoryBrowser/category_browser.js |
— | — | @@ -26,7 +26,7 @@ |
27 | 27 | * * Add this line at the end of your LocalSettings.php file : |
28 | 28 | * require_once "$IP/extensions/CategoryBrowser/CategoryBrowser.php"; |
29 | 29 | * |
30 | | - * @version 0.2.0 |
| 30 | + * @version 0.2.1 |
31 | 31 | * @link http://www.mediawiki.org/wiki/Extension:CategoryBrowser |
32 | 32 | * @author Dmitriy Sintsov <questpc@rambler.ru> |
33 | 33 | * @addtogroup Extensions |
— | — | @@ -1584,7 +1584,7 @@ |
1585 | 1585 | |
1586 | 1586 | createEditSamples : function() { |
1587 | 1587 | var i = 0; |
1588 | | - var cbEditorControls = document.getElementById( 'cb_editor_controls' ); |
| 1588 | + var cbEditorControls = document.getElementById( 'cb_samples_container' ); |
1589 | 1589 | // show previousely hidden toolbox cell |
1590 | 1590 | cbEditorControls.parentNode.style.display = (CB_Setup.isIE > 7) ? 'table-cell' : 'block'; |
1591 | 1591 | this.samplesLine = new CB_EditLine( 'samples', cbEditorControls, 'samplesLine' ); |
Index: trunk/extensions/CategoryBrowser/README |
— | — | @@ -1,4 +1,4 @@ |
2 | | -MediaWiki extension CategoryBrowser, version 0.2.0 |
| 2 | +MediaWiki extension CategoryBrowser, version 0.2.1 |
3 | 3 | |
4 | 4 | CategoryBrowser is an AJAX-enabled category filter and browser for MediaWiki. |
5 | 5 | Categories can be filtered with pre-defined and also with used-defined conditions. |