Index: trunk/extensions/AddThis/AddThis.body.php |
— | — | @@ -19,16 +19,11 @@ |
20 | 20 | # Output AddThis widget |
21 | 21 | $output .='<!-- AddThis Button BEGIN --> |
22 | 22 | <div class="addthis_toolbox addthis_default_style" id="addthistoolbar" style="background:'.$wgAddThisBackground.'; border-color:'.$wgAddThisBorder.';"> |
23 | | - <a href="http://www.addthis.com/bookmark.php?v=250&pubid=ra-4eb75def4ec6488b" class="addthis_button_compact"> ' . $share . '</a><span class="addthis_separator"> </span> |
24 | | - <a class="addthis_button_'.$wgAddThisHServ[1].'" '.$wgAddThisHServ['1set'].'></a> |
25 | | - <a class="addthis_button_'.$wgAddThisHServ[2].'" '.$wgAddThisHServ['2set'].'></a> |
26 | | - <a class="addthis_button_'.$wgAddThisHServ[3].'" '.$wgAddThisHServ['3set'].'></a> |
27 | | - <a class="addthis_button_'.$wgAddThisHServ[4].'" '.$wgAddThisHServ['4set'].'></a> |
28 | | - <a class="addthis_button_'.$wgAddThisHServ[5].'" '.$wgAddThisHServ['5set'].'></a> |
29 | | - <a class="addthis_button_'.$wgAddThisHServ[6].'" '.$wgAddThisHServ['6set'].'></a> |
30 | | - <a class="addthis_button_'.$wgAddThisHServ[7].'" '.$wgAddThisHServ['7set'].'></a> |
31 | | - <a class="addthis_button_'.$wgAddThisHServ[8].'" '.$wgAddThisHServ['8set'].'></a> |
32 | | - </div> |
| 23 | + <a href="http://www.addthis.com/bookmark.php?v=250&pubid=ra-4eb75def4ec6488b" class="addthis_button_compact"> ' . $share . '</a><span class="addthis_separator"> </span>'; |
| 24 | + foreach ( $wgAddThisHServ as $n => $a ) { |
| 25 | + $output .= '<a class="addthis_button_'.$wgAddThisHServ[$n]["service"].'" '.$wgAddThisHServ[$n]["attribs"].'></a>'; |
| 26 | + } |
| 27 | + $output .='</div> |
33 | 28 | <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid='.$wgAddThispubid.'"></script> |
34 | 29 | <!-- AddThis Button END -->'; |
35 | 30 | return $output; |
— | — | @@ -47,13 +42,11 @@ |
48 | 43 | if(strtolower($wgAddThisSidebar) == 'true') { |
49 | 44 | # Output AddThis widget |
50 | 45 | $bar['addthis'] = '<!-- AddThis Button BEGIN --> |
51 | | - <div class="addthis_toolbox addthis_default_style" id="addthissidebar"> |
52 | | - <a class="addthis_button_'.$wgAddThisSBServ[1].'" '.$wgAddThisSBServ['1set'].'></a> |
53 | | - <a class="addthis_button_'.$wgAddThisSBServ[2].'" '.$wgAddThisSBServ['2set'].'></a> |
54 | | - <a class="addthis_button_'.$wgAddThisSBServ[3].'" '.$wgAddThisSBServ['3set'].'></a> |
55 | | - <a class="addthis_button_'.$wgAddThisSBServ[4].'" '.$wgAddThisSBServ['4set'].'></a> |
56 | | - <a class="addthis_button_'.$wgAddThisSBServ[5].'" '.$wgAddThisSBServ['5set'].'></a> |
57 | | - </div> |
| 46 | + <div class="addthis_toolbox addthis_default_style" id="addthissidebar">'; |
| 47 | + foreach ( $wgAddThisSBServ as $n => $a ) { |
| 48 | + $bar['addthis'] .= '<a class="addthis_button_'.$wgAddThisSBServ[$n]["service"].'" '.$wgAddThisSBServ[$n]["attribs"].'></a>'; |
| 49 | + } |
| 50 | + $bar['addthis'] .= '</div> |
58 | 51 | <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid='.$wgAddThispubid.'"></script> |
59 | 52 | <!-- AddThis Button END -->'; |
60 | 53 | return $bar; |
— | — | @@ -85,17 +78,12 @@ |
86 | 79 | if ( MWNamespace::isContent( $title->getNamespace() ) ) { |
87 | 80 | # Output AddThis widget |
88 | 81 | $wgOut->addHTML('<!-- AddThis Button BEGIN --> |
89 | | - <div class="addthis_toolbox addthis_default_style" id="addthisheader" style="background:'.$wgAddThisBackground.'; border-color:'.$wgAddThisBorder.';"> |
90 | | - <a href="http://www.addthis.com/bookmark.php?v=250&pubid=ra-4eb75def4ec6488b" class="addthis_button_compact"> ' . $share . '</a><span class="addthis_separator"> </span> |
91 | | - <a class="addthis_button_'.$wgAddThisHServ[1].'" '.$wgAddThisHServ['1set'].'></a> |
92 | | - <a class="addthis_button_'.$wgAddThisHServ[2].'" '.$wgAddThisHServ['2set'].'></a> |
93 | | - <a class="addthis_button_'.$wgAddThisHServ[3].'" '.$wgAddThisHServ['3set'].'></a> |
94 | | - <a class="addthis_button_'.$wgAddThisHServ[4].'" '.$wgAddThisHServ['4set'].'></a> |
95 | | - <a class="addthis_button_'.$wgAddThisHServ[5].'" '.$wgAddThisHServ['5set'].'></a> |
96 | | - <a class="addthis_button_'.$wgAddThisHServ[6].'" '.$wgAddThisHServ['6set'].'></a> |
97 | | - <a class="addthis_button_'.$wgAddThisHServ[7].'" '.$wgAddThisHServ['7set'].'></a> |
98 | | - <a class="addthis_button_'.$wgAddThisHServ[8].'" '.$wgAddThisHServ['8set'].'></a> |
99 | | - </div> |
| 82 | + <div class="addthis_toolbox addthis_default_style" id="addthistoolbar" style="background:'.$wgAddThisBackground.'; border-color:'.$wgAddThisBorder.';"> |
| 83 | + <a href="http://www.addthis.com/bookmark.php?v=250&pubid=ra-4eb75def4ec6488b" class="addthis_button_compact"> ' . $share . '</a><span class="addthis_separator"> </span>'); |
| 84 | + foreach ( $wgAddThisHServ as $n => $a ) { |
| 85 | + $wgOut->addHTML('<a class="addthis_button_'.$wgAddThisHServ[$n]["service"].'" '.$wgAddThisHServ[$n]["attribs"].'></a>'); |
| 86 | + } |
| 87 | + $wgOut->addHTML('</div> |
100 | 88 | <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid='.$wgAddThispubid.'"></script> |
101 | 89 | <!-- AddThis Button END -->'); |
102 | 90 | } |
Index: trunk/extensions/AddThis/AddThis.php |
— | — | @@ -43,72 +43,72 @@ |
44 | 44 | * $wgAddThisMain |
45 | 45 | * - Display AddThis widget on main page |
46 | 46 | * Default is true |
47 | | - * $wgAddThisSBServ[1] |
| 47 | + * $wgAddThisSBServ[0]['service'] |
48 | 48 | * - Service code for 1st button in sidebar - service codes: http://www.addthis.com/services/list |
49 | 49 | * Default is compact - AddThis icon used to access full AddThis popup menu |
50 | | - * $wgAddThisSBServ['1set'] |
| 50 | + * $wgAddThisSBServ[0]['attribs'] |
51 | 51 | * - Settings for 1st button in sidebar - more info: http://www.addthis.com/help/client-api#attribute-config |
52 | | - * $wgAddThisSBServ[2] |
| 52 | + * $wgAddThisSBServ[1]['service'] |
53 | 53 | * - Service code for 2nd button in sidebar |
54 | 54 | * Default is facebook |
55 | | - * $wgAddThisSBServ['2set'] |
| 55 | + * $wgAddThisSBServ[1]['attribs'] |
56 | 56 | * - Settings for 2nd button in sidebar |
57 | | - * $wgAddThisSBServ[3] |
| 57 | + * $wgAddThisSBServ[2]['service'] |
58 | 58 | * - Service code for 3rd button in sidebar |
59 | 59 | * Default is twitter |
60 | | - * $wgAddThisSBServ['3set'] |
| 60 | + * $wgAddThisSBServ[2]['attribs'] |
61 | 61 | * - Settings for 3rd button in sidebar |
62 | | - * $wgAddThisSBServ[4] |
| 62 | + * $wgAddThisSBServ[3]['service'] |
63 | 63 | * - Service code for 4th button in sidebar |
64 | 64 | * Default is google_plusone |
65 | | - * $wgAddThisSBServ['4set'] |
| 65 | + * $wgAddThisSBServ[3]['attribs'] |
66 | 66 | * - Settings for 4th button in sidebar |
67 | 67 | * Default is g:plusone:count="false" style="margin-top:1px;" |
68 | | - * $wgAddThisSBServ[5] |
| 68 | + * $wgAddThisSBServ[4]['service'] |
69 | 69 | * - Service code for 5th button in sidebar |
70 | 70 | * Default is email |
71 | | - * $wgAddThisSBServ['5set'] |
| 71 | + * $wgAddThisSBServ[4]['attribs'] |
72 | 72 | * - Settings for 5th button in sidebar |
73 | | - * $wgAddThisHServ[1] |
| 73 | + * $wgAddThisHServ[0]['service'] |
74 | 74 | * - Service code for 1st button in article header after AddThis icon (which cannot be moved in the header) |
75 | 75 | * Default is facebook |
76 | | - * $wgAddThisHServ['1set'] |
| 76 | + * $wgAddThisHServ[0]['attribs'] |
77 | 77 | * - Settings for 1st button in article header |
78 | | - * $wgAddThisHServ[2] |
| 78 | + * $wgAddThisHServ[1]['service'] |
79 | 79 | * - Service code for 2nd button in article header |
80 | 80 | * Default is twitter |
81 | | - * $wgAddThisHServ['2set'] |
| 81 | + * $wgAddThisHServ[1]['attribs'] |
82 | 82 | * - Settings for 2nd button in article header |
83 | | - * $wgAddThisHServ[3] |
| 83 | + * $wgAddThisHServ[2]['service'] |
84 | 84 | * - Service code for 3rd button in article header |
85 | 85 | * Default is google_plusone |
86 | | - * $wgAddThisHServ['3set'] |
| 86 | + * $wgAddThisHServ[2]['attribs'] |
87 | 87 | * - Settings for 3rd button in article header |
88 | 88 | * Default is g:plusone:count="false" style="margin-top:1px;" |
89 | | - * $wgAddThisHServ[4] |
| 89 | + * $wgAddThisHServ[3]['service'] |
90 | 90 | * - Service code for 4th button in article header |
91 | 91 | * Default is linkedin |
92 | | - * $wgAddThisHServ['4set'] |
| 92 | + * $wgAddThisHServ[3]['attribs'] |
93 | 93 | * - Settings for 4th button in article header |
94 | | - * $wgAddThisHServ[5] |
| 94 | + * $wgAddThisHServ[4]['service'] |
95 | 95 | * - Service code for 5th button in article header |
96 | 96 | * Default is tumblr |
97 | | - * $wgAddThisHServ['5set'] |
| 97 | + * $wgAddThisHServ[4]['attribs'] |
98 | 98 | * - Settings for 5th button in article header |
99 | | - * $wgAddThisHServ[6] |
| 99 | + * $wgAddThisHServ[5]['service'] |
100 | 100 | * - Service code for 6th button in article header |
101 | 101 | * Default is stumbleupon |
102 | | - * $wgAddThisHServ['6set'] |
| 102 | + * $wgAddThisHServ[5]['attribs'] |
103 | 103 | * - Settings for 6th button in article header |
104 | | - * $wgAddThisHServ[7] |
| 104 | + * $wgAddThisHServ[6]['service'] |
105 | 105 | * - Service code for 7th button in article header |
106 | 106 | * Default is reddit |
107 | | - * $wgAddThisHServ['7set'] |
| 107 | + * $wgAddThisHServ[6]['attribs'] |
108 | 108 | * - Settings for 7th button in article header |
109 | | - * $wgAddThisHServ[8] |
| 109 | + * $wgAddThisHServ[7]['service'] |
110 | 110 | * - Service code for 8th button in article header |
111 | 111 | * Default is email |
112 | | - * $wgAddThisHServ['8set'] |
| 112 | + * $wgAddThisHServ[7]['attribs'] |
113 | 113 | * - Settings for 8th button in article header |
114 | 114 | */ |
115 | 115 | |
— | — | @@ -123,36 +123,51 @@ |
124 | 124 | |
125 | 125 | # Sidebar settings |
126 | 126 | $wgAddThisSBServ = array( |
127 | | - 1 => 'compact', |
128 | | - '1set' => '', |
129 | | - 2 => 'facebook', |
130 | | - '2set' => '', |
131 | | - 3 => 'twitter', |
132 | | - '3set' => '', |
133 | | - 4 => 'google_plusone', |
134 | | - '4set' => 'g:plusone:count="false" style="margin-top:1px;"', |
135 | | - 5 => 'email', |
136 | | - '5set' => '', |
| 127 | + array( |
| 128 | + 'service' => 'compact', |
| 129 | + ), |
| 130 | + array( |
| 131 | + 'service' => 'facebook', |
| 132 | + ), |
| 133 | + array( |
| 134 | + 'service' => 'twitter', |
| 135 | + ), |
| 136 | + array( |
| 137 | + 'service' => 'google_plusone', |
| 138 | + 'attribs' => 'g:plusone:count="false" style="margin-top:1px;"', |
| 139 | + ), |
| 140 | + array( |
| 141 | + 'service' => 'email', |
| 142 | + ), |
137 | 143 | ); |
138 | 144 | |
139 | 145 | # Toolbar settings |
140 | 146 | $wgAddThisHServ = array( |
141 | | - 1 => 'facebook', |
142 | | - '1set' => '', |
143 | | - 2 => 'twitter', |
144 | | - '2set' => '', |
145 | | - 3 => 'google_plusone', |
146 | | - '3set' => 'g:plusone:count="false" style="margin-top:1px;"', |
147 | | - 4 => 'linkedin', |
148 | | - '4set' => '', |
149 | | - 5 => 'tumblr', |
150 | | - '5set' => '', |
151 | | - 6 => 'stumbleupon', |
152 | | - '6set' => '', |
153 | | - 7 => 'reddit', |
154 | | - '7set' => '', |
155 | | - 8 => 'email', |
156 | | - '8set' => '', |
| 147 | + array( |
| 148 | + 'service' => 'facebook', |
| 149 | + ), |
| 150 | + array( |
| 151 | + 'service' => 'twitter', |
| 152 | + ), |
| 153 | + array( |
| 154 | + 'service' => 'google_plusone', |
| 155 | + 'attribs' => 'g:plusone:count="false" style="margin-top:1px;"', |
| 156 | + ), |
| 157 | + array( |
| 158 | + 'service' => 'linkedin', |
| 159 | + ), |
| 160 | + array( |
| 161 | + 'service' => 'tumblr', |
| 162 | + ), |
| 163 | + array( |
| 164 | + 'service' => 'stumbleupon', |
| 165 | + ), |
| 166 | + array( |
| 167 | + 'service' => 'reddit', |
| 168 | + ), |
| 169 | + array( |
| 170 | + 'service' => 'email', |
| 171 | + ), |
157 | 172 | ); |
158 | 173 | |
159 | 174 | |
— | — | @@ -162,7 +177,7 @@ |
163 | 178 | */ |
164 | 179 | $wgExtensionCredits['other'][] = array( |
165 | 180 | 'name' => 'AddThis', |
166 | | - 'version' => '1.0e', |
| 181 | + 'version' => '1.0f', |
167 | 182 | 'author' => '[http://en.wikipedia.org/wiki/User:Varnent Gregory Varnum]', |
168 | 183 | 'description' => 'Adds [http://www.addthis.com AddThis button] to the sidebar and page header', |
169 | 184 | 'descriptionmsg' => 'addthis-desc', |
Index: trunk/extensions/AddThis/addThis.css |
— | — | @@ -25,7 +25,7 @@ |
26 | 26 | #addthistoolbar { |
27 | 27 | float:right; |
28 | 28 | padding:5px; |
29 | | - padding-top:5px; |
| 29 | + padding-top:10px; |
30 | 30 | margin-left:10px; |
31 | 31 | margin-bottom:10px; |
32 | 32 | border-style:solid; |