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 () {
if (showGrid) {
gridUpdate();
}
}
},
buttons: [{
id: 'view_grid',

View File

@ -20,7 +20,7 @@ svgEditor.addExtension("Hello World", function() {'use strict';
return {
name: "Hello World",
// 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",
// Multiple buttons can be added in this array

View File

@ -115,14 +115,14 @@ svgEditor.addExtension("mathjax", function() {'use strict';
}
return {
name: "MatJax",
name: "MathJax",
svgicons: svgEditor.curConfig.extPath + "mathjax-icons.xml",
buttons: [{
id: "tool_mathjax",
type: "mode",
title: "Add Mathematics",
events: {
'click': function() {
click: function() {
// 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.
if (mathjaxLoaded === false) {

View File

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

View File

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

View File

@ -248,7 +248,7 @@ svgEditor.addExtension('shapes', function() {'use strict';
start_y = opts.start_y;
var y = start_y;
var cur_style = canv.getStyle();
startClientPos.x = opts.event.clientX;
startClientPos.y = opts.event.clientY;
@ -343,8 +343,8 @@ svgEditor.addExtension('shapes', function() {'use strict';
mouseUp: function(opts) {
var mode = canv.getMode();
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 {
keep: keepObject,

View File

@ -55,7 +55,7 @@ var svgEditor = (function($, editor) {'use strict';
}
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) {
if (m.data) {
langData = $.merge(langData, m.data);

View File

@ -2591,7 +2591,7 @@ TODOS
+ '<span id="' + tool.id + '_label">'
+ tool.label + ':</span>'
+ '<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
@ -2775,12 +2775,12 @@ TODOS
// 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
cur_h = holders['#'+flyout_holder[0].id] = [{
sel: '#'+id,
cur_h = holders['#' + flyout_holder[0].id] = [{
sel: '#' + id,
fn: btn.events.click,
icon: btn.id,
key: btn.key,
isDefault: btn.includeWith?btn.includeWith.isDefault:0
isDefault: btn.includeWith ? btn.includeWith.isDefault : 0
}, ref_data];
// {sel:'#tool_rect', fn: clickRect, evt: 'mouseup', key: 4, parent: '#tools_rect', icon: 'rect'}
@ -4346,7 +4346,7 @@ TODOS
$('#layerpanel').width('+=' + delta);
rulerX.css('right', parseInt(rulerX.css('right'), 10) + delta);
workarea.css('right', parseInt(workarea.css('right'), 10) + delta);
svgCanvas.runExtensions("workareaResized");
svgCanvas.runExtensions('workareaResized');
};
var resizeSidePanel = function(evt) {

View File

@ -7636,7 +7636,7 @@ this.updateCanvas = function(w, h) {
}
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};
};