Index: trunk/extensions/UsabilityInitiative/css/vector.collapsibleNav.css |
— | — | @@ -37,26 +37,31 @@ |
38 | 38 | text-decoration: underline; |
39 | 39 | } |
40 | 40 | #panel.collapsible-nav div.portal div.body { |
| 41 | + background: none !important; |
41 | 42 | padding-top: 0px; |
42 | 43 | display: none; |
43 | 44 | } |
| 45 | +#panel.collapsible-nav div.persistent div.body { |
| 46 | + display: block; |
| 47 | +} |
| 48 | +#panel.collapsible-nav div.first h5 { |
| 49 | + display: none; |
| 50 | +} |
| 51 | +#panel.collapsible-nav div.persistent h5 { |
| 52 | + background: none !important; |
| 53 | + padding-left: 0.7em; |
| 54 | +} |
44 | 55 | #panel.collapsible-nav div.portal div.body ul li { |
45 | 56 | padding: 0.25em 0; |
46 | 57 | } |
47 | | -#panel.collapsible-nav div.portal div.body { |
48 | | - background: none !important; |
49 | | -} |
50 | | -#panel.collapsible-nav #p-navigation { |
| 58 | +#panel.collapsible-nav div.first { |
51 | 59 | background-image: none; |
52 | 60 | margin-top: 0px; |
53 | 61 | } |
54 | | -#panel.collapsible-nav #p-navigation div.body { |
| 62 | +#panel.collapsible-nav div.persistent div.body { |
55 | 63 | margin-left: 0.5em; |
56 | 64 | } |
57 | | -body.rtl #panel.collapsible-nav #p-navigation div.body { |
| 65 | +body.rtl #panel.collapsible-nav div.persistent div.body { |
58 | 66 | margin-left: 0; |
59 | 67 | margin-right: 0.5em; |
60 | | -} |
61 | | -#panel.collapsible-nav #p-navigation h5 { |
62 | | - display: none; |
63 | | -} |
| 68 | +} |
\ No newline at end of file |
Index: trunk/extensions/UsabilityInitiative/css/combined.css |
— | — | @@ -104,30 +104,34 @@ |
105 | 105 | text-decoration: underline; |
106 | 106 | } |
107 | 107 | #panel.collapsible-nav div.portal div.body { |
| 108 | + background: none !important; |
108 | 109 | padding-top: 0px; |
109 | 110 | display: none; |
110 | 111 | } |
| 112 | +#panel.collapsible-nav div.persistent div.body { |
| 113 | + display: block; |
| 114 | +} |
| 115 | +#panel.collapsible-nav div.first h5 { |
| 116 | + display: none; |
| 117 | +} |
| 118 | +#panel.collapsible-nav div.persistent h5 { |
| 119 | + background: none !important; |
| 120 | + padding-left: 0.7em; |
| 121 | +} |
111 | 122 | #panel.collapsible-nav div.portal div.body ul li { |
112 | 123 | padding: 0.25em 0; |
113 | 124 | } |
114 | | -#panel.collapsible-nav div.portal div.body { |
115 | | - background: none !important; |
116 | | -} |
117 | | -#panel.collapsible-nav #p-navigation { |
| 125 | +#panel.collapsible-nav div.first { |
118 | 126 | background-image: none; |
119 | 127 | margin-top: 0px; |
120 | 128 | } |
121 | | -#panel.collapsible-nav #p-navigation div.body { |
| 129 | +#panel.collapsible-nav div.persistent div.body { |
122 | 130 | margin-left: 0.5em; |
123 | 131 | } |
124 | | -body.rtl #panel.collapsible-nav #p-navigation div.body { |
| 132 | +body.rtl #panel.collapsible-nav div.persistent div.body { |
125 | 133 | margin-left: 0; |
126 | 134 | margin-right: 0.5em; |
127 | | -} |
128 | | -#panel.collapsible-nav #p-navigation h5 { |
129 | | - display: none; |
130 | | -} |
131 | | -.expandableField { |
| 135 | +}.expandableField { |
132 | 136 | display: block; |
133 | 137 | float: left; |
134 | 138 | } |
Index: trunk/extensions/UsabilityInitiative/css/combined.min.css |
— | — | @@ -102,30 +102,34 @@ |
103 | 103 | text-decoration:underline; |
104 | 104 | } |
105 | 105 | #panel.collapsible-nav div.portal div.body{ |
| 106 | +background:none !important; |
106 | 107 | padding-top:0px; |
107 | 108 | display:none; |
108 | 109 | } |
| 110 | +#panel.collapsible-nav div.persistent div.body{ |
| 111 | +display:block; |
| 112 | +} |
| 113 | +#panel.collapsible-nav div.first h5{ |
| 114 | +display:none; |
| 115 | +} |
| 116 | +#panel.collapsible-nav div.persistent h5{ |
| 117 | +background:none !important; |
| 118 | +padding-left:0.7em; |
| 119 | +} |
109 | 120 | #panel.collapsible-nav div.portal div.body ul li{ |
110 | 121 | padding:0.25em 0; |
111 | 122 | } |
112 | | -#panel.collapsible-nav div.portal div.body{ |
113 | | -background:none !important; |
114 | | -} |
115 | | -#panel.collapsible-nav #p-navigation{ |
| 123 | +#panel.collapsible-nav div.first{ |
116 | 124 | background-image:none; |
117 | 125 | margin-top:0px; |
118 | 126 | } |
119 | | -#panel.collapsible-nav #p-navigation div.body{ |
| 127 | +#panel.collapsible-nav div.persistent div.body{ |
120 | 128 | margin-left:0.5em; |
121 | 129 | } |
122 | | -body.rtl #panel.collapsible-nav #p-navigation div.body{ |
| 130 | +body.rtl #panel.collapsible-nav div.persistent div.body{ |
123 | 131 | margin-left:0; |
124 | 132 | margin-right:0.5em; |
125 | | -} |
126 | | -#panel.collapsible-nav #p-navigation h5{ |
127 | | -display:none; |
128 | | -} |
129 | | -.expandableField{ |
| 133 | +}.expandableField{ |
130 | 134 | display:block; |
131 | 135 | float:left; |
132 | 136 | } |
Index: trunk/extensions/UsabilityInitiative/Vector/Modules/CollapsibleNav/CollapsibleNav.i18n.php |
— | — | @@ -13,6 +13,7 @@ |
14 | 14 | */ |
15 | 15 | $messages['en'] = array( |
16 | 16 | 'vector-collapsiblenav-preference' => 'Enable collapsible left navigation menu', |
| 17 | + 'vector-collapsiblenav-more' => 'More languages', |
17 | 18 | ); |
18 | 19 | |
19 | 20 | /** Gheg Albanian (Gegë) |
Index: trunk/extensions/UsabilityInitiative/Vector/Modules/CollapsibleNav/CollapsibleNav.js |
— | — | @@ -29,15 +29,17 @@ |
30 | 30 | if ( !$j.wikiEditor.isSupported( mod ) ) { |
31 | 31 | return true; |
32 | 32 | } |
33 | | - |
| 33 | + // Create a new portal for overflow languages |
| 34 | + $j( '#p-lang' ) |
| 35 | + .after( '<div id="p-lang-more" class="portal"><h5></h5><div class="body"><ul></ul></div></div>' ) |
| 36 | + .addClass( 'persistent' ); |
| 37 | + $j( '#panel > div.portal:first' ) |
| 38 | + .addClass( 'first persistent' ); |
| 39 | + $j( '#p-lang-more h5' ).text( mw.usability.getMsg( 'vector-collapsiblenav-more' ) ); |
| 40 | + // Apply a class to the entire panel to activate styles |
34 | 41 | $j( '#panel' ).addClass( 'collapsible-nav' ); |
35 | | - // Always show the first portal |
36 | | - $j( '#panel > div.portal:first' ) |
37 | | - .addClass( 'expanded' ) |
38 | | - .find( 'div.body' ) |
39 | | - .show(); |
40 | | - // Remember which portals to hide and show |
41 | | - $j( '#panel > div.portal:not(:first)' ) |
| 42 | + // Use cookie data to restore preferences of what to show and hide |
| 43 | + $j( '#panel > div.portal:not(.persistent)' ) |
42 | 44 | .each( function( i ) { |
43 | 45 | var state = $j.cookie( 'vector-nav-' + $j(this).attr( 'id' ) ); |
44 | 46 | if ( state == 'true' || ( state == null && i < 1 ) ) { |
— | — | @@ -53,6 +55,7 @@ |
54 | 56 | $j.cookie( 'vector-nav-' + $j(this).attr( 'id' ), state, { expires: 30, path: '/' } ); |
55 | 57 | } |
56 | 58 | } ); |
| 59 | + |
57 | 60 | // Use the same function for all navigation headings - don't repeat yourself |
58 | 61 | function toggle( $element ) { |
59 | 62 | $j.cookie( 'vector-nav-' + $element.parent().attr( 'id' ), $element.parent().is( '.collapsed' ), { expires: 30, path: '/' } ); |
— | — | @@ -63,7 +66,7 @@ |
64 | 67 | .find( 'div.body' ) |
65 | 68 | .slideToggle( 'fast' ); |
66 | 69 | } |
67 | | - var $headings = $j( '#panel > div.portal > h5' ); |
| 70 | + var $headings = $j( '#panel > div.portal:not(.persistent) > h5' ); |
68 | 71 | /** Copy-pasted from jquery.wikiEditor.dialogs - :( */ |
69 | 72 | // Find the highest tabindex in use |
70 | 73 | var maxTI = 0; |
— | — | @@ -93,4 +96,47 @@ |
94 | 97 | $j(this).blur(); |
95 | 98 | return false; |
96 | 99 | } ); |
| 100 | + // Split the language lists, showing the first 5 in the original portal and all others in the overflow portal |
| 101 | + var limit = 5; |
| 102 | + var count = 0; |
| 103 | + $more = $j( '#p-lang-more ul' ); |
| 104 | + $j( '#p-lang li' ).each( function() { |
| 105 | + if ( count++ >= limit ) { |
| 106 | + $j(this).remove().appendTo( $more ); |
| 107 | + } |
| 108 | + } ); |
| 109 | + /* |
| 110 | + * It may be clever to use something like this to steer which languages get shown by default... |
| 111 | + var wikipediaProjectSizes = { |
| 112 | + 'en': 1, 'fr': 2, 'de': 3, 'es': 4, 'pt': 5, 'it': 6, 'ru': 7, 'ja': 8, 'nl': 9, 'pl': 10, 'zh': 11, 'sv': 12, |
| 113 | + 'ar': 13, 'tr': 14, 'uk': 15, 'fi': 16, 'no': 17, 'ca': 18, 'ro': 19, 'hu': 20, 'ksh': 21, 'id': 22, 'he': 23, |
| 114 | + 'cs': 24, 'vi': 25, 'ko': 26, 'sr': 27, 'fa': 28, 'da': 29, 'eo': 30, 'sk': 31, 'th': 32, 'lt': 33, 'vo': 34, |
| 115 | + 'bg': 35, 'sl': 36, 'hr': 37, 'hi': 38, 'et': 39, 'mk': 40, 'simple': 41, 'new': 42, 'ms': 43, 'nn': 44, |
| 116 | + 'gl': 45, 'el': 46, 'eu': 47, 'ka': 48, 'tl': 49, 'bn': 50, 'lv': 51, 'ml': 52, 'bs': 53, 'te': 54, 'la': 55, |
| 117 | + 'az': 56, 'sh': 57, 'war': 58, 'br': 59, 'is': 60, 'mr': 61, 'be-x-old': 62, 'sq': 63, 'cy': 64, 'lb': 65, |
| 118 | + 'ta': 66, 'zh-classical': 67, 'an': 68, 'jv': 69, 'ht': 70, 'oc': 71, 'bpy': 72, 'ceb': 73, 'ur': 74, |
| 119 | + 'zh-yue': 75, 'pms': 76, 'scn': 77, 'be': 78, 'roa-rup': 79, 'qu': 80, 'af': 81, 'sw': 82, 'nds': 83, 'fy': 84, |
| 120 | + 'lmo': 85, 'wa': 86, 'ku': 87, 'hy': 88, 'su': 89, 'yi': 90, 'io': 91, 'os': 92, 'ga': 93, 'ast': 94, 'nap': 95, |
| 121 | + 'vec': 96, 'gu': 97, 'cv': 98, 'bat-smg': 99, 'kn': 100, 'uz': 101, 'zh-min-nan': 102, 'si': 103, 'als': 104, |
| 122 | + 'yo': 105, 'li': 106, 'gan': 107, 'arz': 108, 'sah': 109, 'tt': 110, 'bar': 111, 'gd': 112, 'tg': 113, |
| 123 | + 'kk': 114, 'pam': 115, 'hsb': 116, 'roa-tara': 117, 'nah': 118, 'mn': 119, 'vls': 120, 'gv': 121, 'mi': 122, |
| 124 | + 'am': 123, 'ia': 124, 'co': 125, 'ne': 126, 'fo': 127, 'nds-nl': 128, 'glk': 129, 'mt': 130, 'ang': 131, |
| 125 | + 'wuu': 132, 'dv': 133, 'km': 134, 'sco': 135, 'bcl': 136, 'mg': 137, 'my': 138, 'diq': 139, 'tk': 140, |
| 126 | + 'szl': 141, 'ug': 142, 'fiu-vro': 143, 'sc': 144, 'rm': 145, 'nrm': 146, 'ps': 147, 'nv': 148, 'hif': 149, |
| 127 | + 'bo': 150, 'se': 151, 'sa': 152, 'pnb': 153, 'map-bms': 154, 'lad': 155, 'lij': 156, 'crh': 157, 'fur': 158, |
| 128 | + 'kw': 159, 'to': 160, 'pa': 161, 'jbo': 162, 'ba': 163, 'ilo': 164, 'csb': 165, 'wo': 166, 'xal': 167, |
| 129 | + 'krc': 168, 'ckb': 169, 'pag': 170, 'ln': 171, 'frp': 172, 'mzn': 173, 'ce': 174, 'nov': 175, 'kv': 176, |
| 130 | + 'eml': 177, 'gn': 178, 'ky': 179, 'pdc': 180, 'lo': 181, 'haw': 182, 'mhr': 183, 'dsb': 184, 'stq': 185, |
| 131 | + 'tpi': 186, 'arc': 187, 'hak': 188, 'ie': 189, 'so': 190, 'bh': 191, 'ext': 192, 'mwl': 193, 'sd': 194, |
| 132 | + 'ig': 195, 'myv': 196, 'ay': 197, 'iu': 198, 'na': 199, 'cu': 200, 'pi': 201, 'kl': 202, 'ty': 203, 'lbe': 204, |
| 133 | + 'ab': 205, 'got': 206, 'sm': 207, 'as': 208, 'mo': 209, 'ee': 210, 'zea': 211, 'av': 212, 'ace': 213, 'kg': 214, |
| 134 | + 'bm': 215, 'cdo': 216, 'cbk-zam': 217, 'kab': 218, 'om': 219, 'chr': 220, 'pap': 221, 'udm': 222, 'ks': 223, |
| 135 | + 'zu': 224, 'rmy': 225, 'cr': 226, 'ch': 227, 'st': 228, 'ik': 229, 'mdf': 230, 'kaa': 231, 'aa': 232, 'fj': 233, |
| 136 | + 'srn': 234, 'tet': 235, 'or': 236, 'pnt': 237, 'bug': 238, 'ss': 239, 'ts': 240, 'pcd': 241, 'pih': 242, |
| 137 | + 'za': 243, 'sg': 244, 'lg': 245, 'bxr': 246, 'xh': 247, 'ak': 248, 'ha': 249, 'bi': 250, 've': 251, 'tn': 252, |
| 138 | + 'ff': 253, 'dz': 254, 'ti': 255, 'ki': 256, 'ny': 257, 'rw': 258, 'chy': 259, 'tw': 260, 'sn': 261, 'tum': 262, |
| 139 | + 'ng': 263, 'rn': 264, 'mh': 265, 'ii': 266, 'cho': 267, 'hz': 268, 'kr': 269, 'ho': 270, 'mus': 271, 'kj': 272 |
| 140 | + }; |
| 141 | + */ |
| 142 | + */ |
97 | 143 | } ); |
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.hooks.php |
— | — | @@ -12,7 +12,7 @@ |
13 | 13 | |
14 | 14 | static $scripts = array( |
15 | 15 | 'raw' => array( |
16 | | - array( 'src' => 'Modules/CollapsibleNav/CollapsibleNav.js', 'version' => 15 ), |
| 16 | + array( 'src' => 'Modules/CollapsibleNav/CollapsibleNav.js', 'version' => 16 ), |
17 | 17 | array( 'src' => 'Modules/CollapsibleTabs/CollapsibleTabs.js', 'version' => 8 ), |
18 | 18 | array( 'src' => 'Modules/ExpandableSearch/ExpandableSearch.js', 'version' => 2 ), |
19 | 19 | array( 'src' => 'Modules/EditWarning/EditWarning.js', 'version' => 8 ), |
— | — | @@ -20,10 +20,10 @@ |
21 | 21 | array( 'src' => 'Modules/SimpleSearch/SimpleSearch.js', 'version' => 15 ), |
22 | 22 | ), |
23 | 23 | 'combined' => array( |
24 | | - array( 'src' => 'Vector.combined.js', 'version' => 37 ), |
| 24 | + array( 'src' => 'Vector.combined.js', 'version' => 38 ), |
25 | 25 | ), |
26 | 26 | 'minified' => array( |
27 | | - array( 'src' => 'Vector.combined.min.js', 'version' => 37 ), |
| 27 | + array( 'src' => 'Vector.combined.min.js', 'version' => 38 ), |
28 | 28 | ), |
29 | 29 | ); |
30 | 30 | static $modules = array( |
— | — | @@ -39,6 +39,9 @@ |
40 | 40 | ), |
41 | 41 | ), |
42 | 42 | ), |
| 43 | + 'messages' => array( |
| 44 | + 'vector-collapsiblenav-more', |
| 45 | + ), |
43 | 46 | ), |
44 | 47 | 'collapsibletabs' => array( |
45 | 48 | ), |
Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php |
— | — | @@ -19,7 +19,7 @@ |
20 | 20 | 'base_sets' => array( |
21 | 21 | 'raw' => array( |
22 | 22 | array( 'src' => 'css/suggestions.css', 'version' => 14 ), |
23 | | - array( 'src' => 'css/vector.collapsibleNav.css', 'version' => 9 ), |
| 23 | + array( 'src' => 'css/vector.collapsibleNav.css', 'version' => 10 ), |
24 | 24 | array( 'src' => 'css/vector.expandableSearch.css', 'version' => 2 ), |
25 | 25 | array( 'src' => 'css/vector.footerCleanup.css', 'version' => 2 ), |
26 | 26 | array( 'src' => 'css/wikiEditor.css', 'version' => 14 ), |
— | — | @@ -30,11 +30,11 @@ |
31 | 31 | array( 'src' => 'css/vector/jquery-ui-1.7.2.css', 'version' => '1.7.2y' ), |
32 | 32 | ), |
33 | 33 | 'combined' => array( |
34 | | - array( 'src' => 'css/combined.css', 'version' => 96 ), |
| 34 | + array( 'src' => 'css/combined.css', 'version' => 98 ), |
35 | 35 | array( 'src' => 'css/vector/jquery-ui-1.7.2.css', 'version' => '1.7.2y' ), |
36 | 36 | ), |
37 | 37 | 'minified' => array( |
38 | | - array( 'src' => 'css/combined.min.css', 'version' => 96 ), |
| 38 | + array( 'src' => 'css/combined.min.css', 'version' => 98 ), |
39 | 39 | array( 'src' => 'css/vector/jquery-ui-1.7.2.css', 'version' => '1.7.2y' ), |
40 | 40 | ), |
41 | 41 | ) |