fixed indentation and removed two unneeded local vars
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2432 eee81c28-f429-11dd-99c0-75d572ba1dddmaster
parent
570c59ebf2
commit
d809578c6c
|
@ -538,44 +538,43 @@
|
||||||
$('#dialog_container').draggable({cancel: '#dialog_content, #dialog_buttons *', containment: 'window'});
|
$('#dialog_container').draggable({cancel: '#dialog_content, #dialog_buttons *', containment: 'window'});
|
||||||
var box = $('#dialog_box'),
|
var box = $('#dialog_box'),
|
||||||
btn_holder = $('#dialog_buttons'),
|
btn_holder = $('#dialog_buttons'),
|
||||||
|
|
||||||
dbox = function(type, msg, callback, defText) {
|
dbox = function(type, msg, callback, defText) {
|
||||||
$('#dialog_content').html('<p>'+msg.replace(/\n/g, '</p><p>')+'</p>')
|
$('#dialog_content').html('<p>'+msg.replace(/\n/g, '</p><p>')+'</p>')
|
||||||
.toggleClass('prompt', (type == 'prompt'));
|
.toggleClass('prompt', (type == 'prompt'));
|
||||||
btn_holder.empty();
|
btn_holder.empty();
|
||||||
|
|
||||||
var ok = $('<input type="button" value="' + uiStrings.common.ok + '">').appendTo(btn_holder);
|
var ok = $('<input type="button" value="' + uiStrings.common.ok + '">').appendTo(btn_holder);
|
||||||
|
|
||||||
if (type != 'alert') {
|
if (type != 'alert') {
|
||||||
$('<input type="button" value="' + uiStrings.common.cancel + '">')
|
$('<input type="button" value="' + uiStrings.common.cancel + '">')
|
||||||
.appendTo(btn_holder)
|
.appendTo(btn_holder)
|
||||||
.click(function() { box.hide(); callback(false);});
|
.click(function() { box.hide(); callback(false);});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type == 'prompt') {
|
if (type == 'prompt') {
|
||||||
var input = $('<input type="text">').prependTo(btn_holder);
|
var input = $('<input type="text">').prependTo(btn_holder);
|
||||||
input.val(defText || '');
|
input.val(defText || '');
|
||||||
input.bind('keydown', 'return', function() {ok.click();});
|
input.bind('keydown', 'return', function() {ok.click();});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type == 'process') {
|
if (type == 'process') {
|
||||||
ok.hide();
|
ok.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
box.show();
|
box.show();
|
||||||
|
|
||||||
ok.click(function() {
|
ok.click(function() {
|
||||||
box.hide();
|
box.hide();
|
||||||
var resp = (type == 'prompt') ? input.val() : true;
|
var resp = (type == 'prompt') ? input.val() : true;
|
||||||
if (callback) callback(resp);
|
if (callback) callback(resp);
|
||||||
}).focus();
|
}).focus();
|
||||||
|
|
||||||
if (type == 'prompt') input.focus();
|
if (type == 'prompt') input.focus();
|
||||||
};
|
};
|
||||||
|
|
||||||
$.alert = function(msg, cb) { dbox('alert', msg, cb);};
|
$.alert = function(msg, cb) { dbox('alert', msg, cb);};
|
||||||
$.confirm = function(msg, cb) { dbox('confirm', 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);};
|
$.prompt = function(msg, txt, cb) { dbox('prompt', msg, cb, txt);};
|
||||||
}());
|
}());
|
||||||
|
|
||||||
|
@ -2200,7 +2199,6 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
Editor.addDropDown('#font_family_dropdown', function() {
|
Editor.addDropDown('#font_family_dropdown', function() {
|
||||||
var fam = $(this).text();
|
|
||||||
$('#font_family').val($(this).text()).change();
|
$('#font_family').val($(this).text()).change();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -3281,10 +3279,9 @@
|
||||||
paint = new $.jGraduate.Paint(p);
|
paint = new $.jGraduate.Paint(p);
|
||||||
paintBox[picker].setPaint(paint);
|
paintBox[picker].setPaint(paint);
|
||||||
svgCanvas.setPaint(picker, paint);
|
svgCanvas.setPaint(picker, paint);
|
||||||
|
|
||||||
$('#color_picker').hide();
|
$('#color_picker').hide();
|
||||||
},
|
},
|
||||||
function(p) {
|
function() {
|
||||||
$('#color_picker').hide();
|
$('#color_picker').hide();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue