r81224 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81223‎ | r81224 | r81225 >
Date:22:38, 30 January 2011
Author:brion
Status:deferred
Tags:
Comment:
SVGEdit extension updates:
* add "Edit drawing" tab (this is hidden in the overflow on Vector, so keeping the separate button for now)
* Allow auto-open of the svg editor with #!action=svgedit (so can use the tab to open editor in new window)
* README cleanup
Modified paths:
  • /trunk/extensions/SVGEdit/README (modified) (history)
  • /trunk/extensions/SVGEdit/SVGEdit.i18n.php (modified) (history)
  • /trunk/extensions/SVGEdit/SVGEdit.php (modified) (history)
  • /trunk/extensions/SVGEdit/modules/ext.svgedit.editButton.js (modified) (history)

Diff [purge]

Index: trunk/extensions/SVGEdit/modules/ext.svgedit.editButton.js
@@ -84,6 +84,20 @@
8585 .attr('src', url);
8686 };
8787
 88+ var tab = mediaWiki.util.addPortletLink('p-cactions',
 89+ document.location + '#!action=svgedit',
 90+ mediaWiki.msg('svgedit-edit-tab'),
 91+ 'ca-ext-svgedit',
 92+ mediaWiki.msg('svgedit-edit-tab-tooltip'),
 93+ '',
 94+ document.getElementById('ca-edit'));
 95+
 96+ $(tab).find('a').click(function(event) {
 97+ triggerSVGEdit(wgTitle);
 98+ event.preventDefault();
 99+ return false;
 100+ });
 101+
88102 var button = $('<button></button>')
89103 .text(mediaWiki.msg('svgedit-editbutton-edit'))
90104 .click(function() {
@@ -91,5 +105,9 @@
92106 });
93107
94108 $('.fullMedia').append(button);
 109+
 110+ if (document.location.hash.indexOf('!action=svgedit') != -1) {
 111+ triggerSVGEdit(wgTitle);
 112+ }
95113 }
96114 });
Index: trunk/extensions/SVGEdit/SVGEdit.i18n.php
@@ -18,6 +18,8 @@
1919 'svgedit-editor-save-close' => 'Save and close',
2020 'svgedit-editor-close' => 'Cancel',
2121 'svgedit-desc' => 'In-browser editing of SVG drawings with [http://code.google.com/p/svg-edit/ SVG-Edit]',
 22+ 'svgedit-edit-tab' => 'Edit drawing',
 23+ 'svgedit-edit-tab-tooltip' => 'You can edit this SVG drawing in your browser'
2224 );
2325
2426 /** Message documentation (Message documentation)
Index: trunk/extensions/SVGEdit/SVGEdit.php
@@ -47,6 +47,8 @@
4848 'svgedit-summary-default',
4949 'svgedit-editor-save-close',
5050 'svgedit-editor-close',
 51+ 'svgedit-edit-tab',
 52+ 'svgedit-edit-tab-tooltip'
5153 ),
5254 ),
5355 );
Index: trunk/extensions/SVGEdit/README
@@ -6,8 +6,8 @@
77 SVG-edit 2.5.1 is included at present.
88
99 Current versions of most major browsers should work except for Internet Explorer
10 -(IE currently requires Chrome Frame plugin, though native IE9 support should come
11 -with upstream updates.)
 10+(IE currently requires Chrome Frame plugin, or using the development version of
 11+SVG-edit 2.6 with IE9.)
1212
1313 While the master code for this extension lives in Wikimedia's SVN repository, I also
1414 have a git repo where I may have some experimental branches:
@@ -20,7 +20,6 @@
2121
2222 Known bugs:
2323 * Actual editor issues belong upstream: http://code.google.com/p/svg-edit/
24 -* open seems to have some race conditions (sometimes doesn't load the initial file)
2524
2625 Todo:
2726 * add an editor trigger on SVG images visible in regular page views

Status & tagging log