More name/email/subject save/load work.

This commit is contained in:
Nicolas Stepien 2012-01-11 16:41:04 +01:00
parent 50ffdb417c
commit d5df9b0714
2 changed files with 16 additions and 4 deletions

View File

@ -1320,6 +1320,10 @@
}
_Class.prototype.load = function() {
var data;
for (data in this) {
if (data !== 'file') $("[name=" + data + "]", qr.el).value = this[data];
}
return log(this);
};
@ -1329,7 +1333,7 @@
})(),
dialog: function() {
var mimeTypes, thread, threads, _i, _len, _ref;
var input, mimeTypes, thread, threads, _i, _j, _len, _len2, _ref, _ref2;
if (!g.REPLY) {
threads = '<option value=new>New thread</option>';
_ref = $$('.op');
@ -1364,6 +1368,11 @@
$.on($('form', qr.el), 'submit', qr.submit);
$.on($('[type=file]', qr.el), 'change', qr.fileInput);
new qr.reply().load();
_ref2 = ['name', 'email', 'sub', 'com'];
for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) {
input = _ref2[_j];
$.on($("[name=" + input + "]", qr.el), 'change', function() {});
}
return $.add(d.body, qr.el);
},
submit: function(e) {

View File

@ -980,14 +980,15 @@ qr =
]
else
[
$.get("qr_name", null),
$.get("qr_name", null),
$.get("qr_email", null),
if conf['Remember Subject'] then $.get("qr_sub", null) else null
]
@com = null
qr.replies.push @
load: ->
# load reply's data in the QR dialog
for data of @
$("[name=#{data}]", qr.el).value = @[data] unless data is 'file'
# visual feedback in the list
log @
rm: ->
@ -1121,7 +1122,9 @@ textarea.field {
$.on $('[type=file]', qr.el), 'change', qr.fileInput
new qr.reply().load()
#onchange this reply =
for input in ['name', 'email', 'sub', 'com']
# save this reply's data
$.on $("[name=#{input}]", qr.el), 'change', -> # (getReply?)[@name] = @value
# sync between tabs
# $.on window, 'storage', (e) ->
# if match = e.key.match /qr_(.+)$/