Index: trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.js |
— | — | @@ -134,6 +134,21 @@ |
135 | 135 | }; |
136 | 136 | // Loops over each tool |
137 | 137 | for ( tool in section.groups[group] ) { |
| 138 | + // Filters are jQuery selectors which must select 1 or more |
| 139 | + // elements for this tool to apear. This is especailly |
| 140 | + // useful for restricting some tools to certain namespaces |
| 141 | + if ( 'filters' in section.groups[group][tool] ) { |
| 142 | + var filters = section.groups[group][tool].filters; |
| 143 | + var skip = false; |
| 144 | + for ( filter in filters ) { |
| 145 | + if ( $( filters[filter] ).size() == 0 ) { |
| 146 | + skip = true; |
| 147 | + } |
| 148 | + } |
| 149 | + if ( skip ) { |
| 150 | + continue; |
| 151 | + } |
| 152 | + } |
138 | 153 | // Creates context for use in action |
139 | 154 | var context = { 'tool': section.groups[group][tool], 'textbox': textbox }; |
140 | 155 | // Creates the label of the tool |
— | — | @@ -303,6 +318,7 @@ |
304 | 319 | }, |
305 | 320 | 'reference': { |
306 | 321 | labelMsg: 'edittoolbar-insert-reference', |
| 322 | + filters: [ 'body.ns-subject' ], |
307 | 323 | type: 'button', |
308 | 324 | icon: 'insert-reference.png', |
309 | 325 | action: { |
— | — | @@ -313,6 +329,18 @@ |
314 | 330 | post: "</ref>" |
315 | 331 | } |
316 | 332 | } |
| 333 | + }, |
| 334 | + 'signature': { |
| 335 | + labelMsg: 'edittoolbar-insert-signature', |
| 336 | + filters: [ 'body.ns-talk' ], |
| 337 | + type: 'button', |
| 338 | + icon: 'insert-signature.png', |
| 339 | + action: { |
| 340 | + type: 'encapsulate', |
| 341 | + options: { |
| 342 | + post: "--~~~~", |
| 343 | + } |
| 344 | + } |
317 | 345 | } |
318 | 346 | } |
319 | 347 | } |
Index: trunk/extensions/UsabilityInitiative/EditToolbar/images/insert-signature.png |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: trunk/extensions/UsabilityInitiative/EditToolbar/images/insert-signature.png |
___________________________________________________________________ |
Added: svn:mime-type |
320 | 348 | + application/octet-stream |