From d809578c6c2d269ccee87c119c043b8ffab1d880 Mon Sep 17 00:00:00 2001 From: Bruno Heridet Date: Tue, 19 Feb 2013 15:00:56 +0000 Subject: [PATCH] fixed indentation and removed two unneeded local vars git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2432 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svg-editor.js | 57 +++++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 30 deletions(-) diff --git a/editor/svg-editor.js b/editor/svg-editor.js index a82a8d78..0729fd1b 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -538,44 +538,43 @@ $('#dialog_container').draggable({cancel: '#dialog_content, #dialog_buttons *', containment: 'window'}); var box = $('#dialog_box'), btn_holder = $('#dialog_buttons'), - dbox = function(type, msg, callback, defText) { - $('#dialog_content').html('

'+msg.replace(/\n/g, '

')+'

') - .toggleClass('prompt', (type == 'prompt')); - btn_holder.empty(); + $('#dialog_content').html('

'+msg.replace(/\n/g, '

')+'

') + .toggleClass('prompt', (type == 'prompt')); + btn_holder.empty(); - var ok = $('').appendTo(btn_holder); + var ok = $('').appendTo(btn_holder); - if (type != 'alert') { - $('') - .appendTo(btn_holder) - .click(function() { box.hide(); callback(false);}); - } + if (type != 'alert') { + $('') + .appendTo(btn_holder) + .click(function() { box.hide(); callback(false);}); + } - if (type == 'prompt') { - var input = $('').prependTo(btn_holder); - input.val(defText || ''); - input.bind('keydown', 'return', function() {ok.click();}); - } + if (type == 'prompt') { + var input = $('').prependTo(btn_holder); + input.val(defText || ''); + input.bind('keydown', 'return', function() {ok.click();}); + } - if (type == 'process') { - ok.hide(); - } + if (type == 'process') { + ok.hide(); + } - box.show(); + box.show(); - ok.click(function() { - box.hide(); - var resp = (type == 'prompt') ? input.val() : true; - if (callback) callback(resp); - }).focus(); + ok.click(function() { + box.hide(); + var resp = (type == 'prompt') ? input.val() : true; + if (callback) callback(resp); + }).focus(); - if (type == 'prompt') input.focus(); - }; + if (type == 'prompt') input.focus(); + }; $.alert = function(msg, cb) { dbox('alert', msg, cb);}; $.confirm = function(msg, cb) { dbox('confirm', msg, cb);}; - $.process_cancel = function(msg, cb) { dbox('process', msg, cb);}; + $.process_cancel = function(msg, cb) { dbox('process', msg, cb);}; $.prompt = function(msg, txt, cb) { dbox('prompt', msg, cb, txt);}; }()); @@ -2200,7 +2199,6 @@ }; Editor.addDropDown('#font_family_dropdown', function() { - var fam = $(this).text(); $('#font_family').val($(this).text()).change(); }); @@ -3281,10 +3279,9 @@ paint = new $.jGraduate.Paint(p); paintBox[picker].setPaint(paint); svgCanvas.setPaint(picker, paint); - $('#color_picker').hide(); }, - function(p) { + function() { $('#color_picker').hide(); }); };