Minor clean-up

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2813 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Brett Zamir 2014-04-09 03:44:19 +00:00
parent 04d522b43b
commit d84a4465d2
9 changed files with 17 additions and 18 deletions

View File

@ -144,7 +144,7 @@ svgEditor.addExtension('view_grid', function() { 'use strict';
callback: function () { callback: function () {
if (showGrid) { if (showGrid) {
gridUpdate(); gridUpdate();
} }
}, },
buttons: [{ buttons: [{
id: 'view_grid', id: 'view_grid',

View File

@ -20,7 +20,7 @@ svgEditor.addExtension("Hello World", function() {'use strict';
return { return {
name: "Hello World", name: "Hello World",
// For more notes on how to make an icon file, see the source of // For more notes on how to make an icon file, see the source of
// the hellorworld-icon.xml // the helloworld-icon.xml
svgicons: svgEditor.curConfig.extPath + "helloworld-icon.xml", svgicons: svgEditor.curConfig.extPath + "helloworld-icon.xml",
// Multiple buttons can be added in this array // Multiple buttons can be added in this array

View File

@ -115,14 +115,14 @@ svgEditor.addExtension("mathjax", function() {'use strict';
} }
return { return {
name: "MatJax", name: "MathJax",
svgicons: svgEditor.curConfig.extPath + "mathjax-icons.xml", svgicons: svgEditor.curConfig.extPath + "mathjax-icons.xml",
buttons: [{ buttons: [{
id: "tool_mathjax", id: "tool_mathjax",
type: "mode", type: "mode",
title: "Add Mathematics", title: "Add Mathematics",
events: { events: {
'click': function() { click: function() {
// Only load Mathjax when needed, we don't want to strain Svg-Edit any more. // Only load Mathjax when needed, we don't want to strain Svg-Edit any more.
// From this point on it is very probable that it will be needed, so load it. // From this point on it is very probable that it will be needed, so load it.
if (mathjaxLoaded === false) { if (mathjaxLoaded === false) {

View File

@ -134,9 +134,9 @@ svgEditor.addExtension("overview_window", function() { 'use strict';
updateViewPortFromViewBox(); updateViewPortFromViewBox();
}); });
return{ return {
name: "overview window", name: "overview window",
canvasUpdated:updateViewDimensions, canvasUpdated: updateViewDimensions,
workareaResized:updateViewBox workareaResized: updateViewBox
}; };
}); });

View File

@ -138,7 +138,6 @@ svgEditor.addExtension("polygon", function(S) {'use strict';
events: { events: {
change: function(){ change: function(){
setAttr('sides', this.value); setAttr('sides', this.value);
} }
} }
}], }],

View File

@ -248,7 +248,7 @@ svgEditor.addExtension('shapes', function() {'use strict';
start_y = opts.start_y; start_y = opts.start_y;
var y = start_y; var y = start_y;
var cur_style = canv.getStyle(); var cur_style = canv.getStyle();
startClientPos.x = opts.event.clientX; startClientPos.x = opts.event.clientX;
startClientPos.y = opts.event.clientY; startClientPos.y = opts.event.clientY;
@ -343,8 +343,8 @@ svgEditor.addExtension('shapes', function() {'use strict';
mouseUp: function(opts) { mouseUp: function(opts) {
var mode = canv.getMode(); var mode = canv.getMode();
if (mode !== mode_id) {return;} if (mode !== mode_id) {return;}
var keepObject = (opts.event.clientX != startClientPos.x && opts.event.clientY != startClientPos.y); var keepObject = (opts.event.clientX != startClientPos.x && opts.event.clientY != startClientPos.y);
return { return {
keep: keepObject, keep: keepObject,

View File

@ -55,7 +55,7 @@ var svgEditor = (function($, editor) {'use strict';
} }
editor.readLang = function(langData) { editor.readLang = function(langData) {
var more = editor.canvas.runExtensions("addlangData", lang_param, true); var more = editor.canvas.runExtensions('addlangData', lang_param, true);
$.each(more, function(i, m) { $.each(more, function(i, m) {
if (m.data) { if (m.data) {
langData = $.merge(langData, m.data); langData = $.merge(langData, m.data);

View File

@ -2591,7 +2591,7 @@ TODOS
+ '<span id="' + tool.id + '_label">' + '<span id="' + tool.id + '_label">'
+ tool.label + ':</span>' + tool.label + ':</span>'
+ '<input id="' + tool.id + '" title="' + tool.title + '<input id="' + tool.id + '" title="' + tool.title
+ '" size="' + (tool.size || "4") + '" value="' + (tool.defval || "") + '" type="text"/></label>'; + '" size="' + (tool.size || '4') + '" value="' + (tool.defval || '') + '" type="text"/></label>';
// Creates the tool, hides & adds it, returns the select element // Creates the tool, hides & adds it, returns the select element
@ -2775,12 +2775,12 @@ TODOS
// TODO: Find way to set the current icon using the iconloader if this is not default // TODO: Find way to set the current icon using the iconloader if this is not default
// Include data for extension button as well as ref button // Include data for extension button as well as ref button
cur_h = holders['#'+flyout_holder[0].id] = [{ cur_h = holders['#' + flyout_holder[0].id] = [{
sel: '#'+id, sel: '#' + id,
fn: btn.events.click, fn: btn.events.click,
icon: btn.id, icon: btn.id,
key: btn.key, key: btn.key,
isDefault: btn.includeWith?btn.includeWith.isDefault:0 isDefault: btn.includeWith ? btn.includeWith.isDefault : 0
}, ref_data]; }, ref_data];
// {sel:'#tool_rect', fn: clickRect, evt: 'mouseup', key: 4, parent: '#tools_rect', icon: 'rect'} // {sel:'#tool_rect', fn: clickRect, evt: 'mouseup', key: 4, parent: '#tools_rect', icon: 'rect'}
@ -4346,7 +4346,7 @@ TODOS
$('#layerpanel').width('+=' + delta); $('#layerpanel').width('+=' + delta);
rulerX.css('right', parseInt(rulerX.css('right'), 10) + delta); rulerX.css('right', parseInt(rulerX.css('right'), 10) + delta);
workarea.css('right', parseInt(workarea.css('right'), 10) + delta); workarea.css('right', parseInt(workarea.css('right'), 10) + delta);
svgCanvas.runExtensions("workareaResized"); svgCanvas.runExtensions('workareaResized');
}; };
var resizeSidePanel = function(evt) { var resizeSidePanel = function(evt) {

View File

@ -7636,7 +7636,7 @@ this.updateCanvas = function(w, h) {
} }
selectorManager.selectorParentGroup.setAttribute('transform', 'translate(' + x + ',' + y + ')'); selectorManager.selectorParentGroup.setAttribute('transform', 'translate(' + x + ',' + y + ')');
runExtensions('canvasUpdated',{new_x:x, new_y:y, old_x:old_x, old_y:old_y, d_x:x - old_x, d_y:y - old_y}); runExtensions('canvasUpdated', {new_x:x, new_y:y, old_x:old_x, old_y:old_y, d_x:x - old_x, d_y:y - old_y});
return {x:x, y:y, old_x:old_x, old_y:old_y, d_x:x - old_x, d_y:y - old_y}; return {x:x, y:y, old_x:old_x, old_y:old_y, d_x:x - old_x, d_y:y - old_y};
}; };