Merge Mayhem X
This commit is contained in:
commit
b0a9ce5667
@ -4653,30 +4653,31 @@
|
|||||||
return status.disabled = disabled || false;
|
return status.disabled = disabled || false;
|
||||||
},
|
},
|
||||||
persona: {
|
persona: {
|
||||||
name: [],
|
|
||||||
email: [],
|
|
||||||
sub: [],
|
|
||||||
pwd: '',
|
pwd: '',
|
||||||
always: {},
|
always: {},
|
||||||
init: function() {
|
init: function() {
|
||||||
QR.persona.getPassword();
|
QR.persona.getPassword();
|
||||||
return $.get('QR.personas', Conf['QR.personas'], function(_arg) {
|
return $.get('QR.personas', Conf['QR.personas'], function(_arg) {
|
||||||
var item, personas, type, _i, _j, _len, _len1, _ref, _ref1;
|
var arr, item, personas, type, types, _i, _len, _ref;
|
||||||
|
|
||||||
personas = _arg['QR.personas'];
|
personas = _arg['QR.personas'];
|
||||||
|
types = {
|
||||||
|
name: [],
|
||||||
|
email: [],
|
||||||
|
sub: []
|
||||||
|
};
|
||||||
_ref = personas.split('\n');
|
_ref = personas.split('\n');
|
||||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||||
item = _ref[_i];
|
item = _ref[_i];
|
||||||
QR.persona.parseItem(item.trim());
|
QR.persona.parseItem(item.trim(), types);
|
||||||
}
|
}
|
||||||
_ref1 = ['name', 'email', 'sub'];
|
for (type in types) {
|
||||||
for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
|
arr = types[type];
|
||||||
type = _ref1[_j];
|
QR.persona.loadPersonas(type, arr);
|
||||||
QR.persona.loadPersonas(type);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
parseItem: function(item) {
|
parseItem: function(item, types) {
|
||||||
var boards, match, type, val, _ref, _ref1, _ref2;
|
var boards, match, type, val, _ref, _ref1, _ref2;
|
||||||
|
|
||||||
if (item[0] === '#') {
|
if (item[0] === '#') {
|
||||||
@ -4701,17 +4702,16 @@
|
|||||||
if (/always/i.test(item)) {
|
if (/always/i.test(item)) {
|
||||||
QR.persona.always[type] = val;
|
QR.persona.always[type] = val;
|
||||||
}
|
}
|
||||||
if (__indexOf.call(QR.persona[type], val) < 0) {
|
if (__indexOf.call(types[type], val) < 0) {
|
||||||
return QR.persona[type].push(val);
|
return types[type].push(val);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
loadPersonas: function(type) {
|
loadPersonas: function(type, arr) {
|
||||||
var list, val, _i, _len, _ref;
|
var list, val, _i, _len;
|
||||||
|
|
||||||
list = $("#list-" + type, QR.nodes.el);
|
list = $("#list-" + type, QR.nodes.el);
|
||||||
_ref = QR.persona[type];
|
for (_i = 0, _len = arr.length; _i < _len; _i++) {
|
||||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
val = arr[_i];
|
||||||
val = _ref[_i];
|
|
||||||
$.add(list, $.el('option', {
|
$.add(list, $.el('option', {
|
||||||
textContent: val
|
textContent: val
|
||||||
}));
|
}));
|
||||||
|
|||||||
@ -4649,30 +4649,31 @@
|
|||||||
return status.disabled = disabled || false;
|
return status.disabled = disabled || false;
|
||||||
},
|
},
|
||||||
persona: {
|
persona: {
|
||||||
name: [],
|
|
||||||
email: [],
|
|
||||||
sub: [],
|
|
||||||
pwd: '',
|
pwd: '',
|
||||||
always: {},
|
always: {},
|
||||||
init: function() {
|
init: function() {
|
||||||
QR.persona.getPassword();
|
QR.persona.getPassword();
|
||||||
return $.get('QR.personas', Conf['QR.personas'], function(_arg) {
|
return $.get('QR.personas', Conf['QR.personas'], function(_arg) {
|
||||||
var item, personas, type, _i, _j, _len, _len1, _ref, _ref1;
|
var arr, item, personas, type, types, _i, _len, _ref;
|
||||||
|
|
||||||
personas = _arg['QR.personas'];
|
personas = _arg['QR.personas'];
|
||||||
|
types = {
|
||||||
|
name: [],
|
||||||
|
email: [],
|
||||||
|
sub: []
|
||||||
|
};
|
||||||
_ref = personas.split('\n');
|
_ref = personas.split('\n');
|
||||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||||
item = _ref[_i];
|
item = _ref[_i];
|
||||||
QR.persona.parseItem(item.trim());
|
QR.persona.parseItem(item.trim(), types);
|
||||||
}
|
}
|
||||||
_ref1 = ['name', 'email', 'sub'];
|
for (type in types) {
|
||||||
for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
|
arr = types[type];
|
||||||
type = _ref1[_j];
|
QR.persona.loadPersonas(type, arr);
|
||||||
QR.persona.loadPersonas(type);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
parseItem: function(item) {
|
parseItem: function(item, types) {
|
||||||
var boards, match, type, val, _ref, _ref1, _ref2;
|
var boards, match, type, val, _ref, _ref1, _ref2;
|
||||||
|
|
||||||
if (item[0] === '#') {
|
if (item[0] === '#') {
|
||||||
@ -4697,17 +4698,16 @@
|
|||||||
if (/always/i.test(item)) {
|
if (/always/i.test(item)) {
|
||||||
QR.persona.always[type] = val;
|
QR.persona.always[type] = val;
|
||||||
}
|
}
|
||||||
if (__indexOf.call(QR.persona[type], val) < 0) {
|
if (__indexOf.call(types[type], val) < 0) {
|
||||||
return QR.persona[type].push(val);
|
return types[type].push(val);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
loadPersonas: function(type) {
|
loadPersonas: function(type, arr) {
|
||||||
var list, val, _i, _len, _ref;
|
var list, val, _i, _len;
|
||||||
|
|
||||||
list = $("#list-" + type, QR.nodes.el);
|
list = $("#list-" + type, QR.nodes.el);
|
||||||
_ref = QR.persona[type];
|
for (_i = 0, _len = arr.length; _i < _len; _i++) {
|
||||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
val = arr[_i];
|
||||||
val = _ref[_i];
|
|
||||||
$.add(list, $.el('option', {
|
$.add(list, $.el('option', {
|
||||||
textContent: val
|
textContent: val
|
||||||
}));
|
}));
|
||||||
|
|||||||
@ -4652,30 +4652,31 @@
|
|||||||
return status.disabled = disabled || false;
|
return status.disabled = disabled || false;
|
||||||
},
|
},
|
||||||
persona: {
|
persona: {
|
||||||
name: [],
|
|
||||||
email: [],
|
|
||||||
sub: [],
|
|
||||||
pwd: '',
|
pwd: '',
|
||||||
always: {},
|
always: {},
|
||||||
init: function() {
|
init: function() {
|
||||||
QR.persona.getPassword();
|
QR.persona.getPassword();
|
||||||
return $.get('QR.personas', Conf['QR.personas'], function(_arg) {
|
return $.get('QR.personas', Conf['QR.personas'], function(_arg) {
|
||||||
var item, personas, type, _i, _j, _len, _len1, _ref, _ref1;
|
var arr, item, personas, type, types, _i, _len, _ref;
|
||||||
|
|
||||||
personas = _arg['QR.personas'];
|
personas = _arg['QR.personas'];
|
||||||
|
types = {
|
||||||
|
name: [],
|
||||||
|
email: [],
|
||||||
|
sub: []
|
||||||
|
};
|
||||||
_ref = personas.split('\n');
|
_ref = personas.split('\n');
|
||||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||||
item = _ref[_i];
|
item = _ref[_i];
|
||||||
QR.persona.parseItem(item.trim());
|
QR.persona.parseItem(item.trim(), types);
|
||||||
}
|
}
|
||||||
_ref1 = ['name', 'email', 'sub'];
|
for (type in types) {
|
||||||
for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
|
arr = types[type];
|
||||||
type = _ref1[_j];
|
QR.persona.loadPersonas(type, arr);
|
||||||
QR.persona.loadPersonas(type);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
parseItem: function(item) {
|
parseItem: function(item, types) {
|
||||||
var boards, match, type, val, _ref, _ref1, _ref2;
|
var boards, match, type, val, _ref, _ref1, _ref2;
|
||||||
|
|
||||||
if (item[0] === '#') {
|
if (item[0] === '#') {
|
||||||
@ -4700,17 +4701,16 @@
|
|||||||
if (/always/i.test(item)) {
|
if (/always/i.test(item)) {
|
||||||
QR.persona.always[type] = val;
|
QR.persona.always[type] = val;
|
||||||
}
|
}
|
||||||
if (__indexOf.call(QR.persona[type], val) < 0) {
|
if (__indexOf.call(types[type], val) < 0) {
|
||||||
return QR.persona[type].push(val);
|
return types[type].push(val);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
loadPersonas: function(type) {
|
loadPersonas: function(type, arr) {
|
||||||
var list, val, _i, _len, _ref;
|
var list, val, _i, _len;
|
||||||
|
|
||||||
list = $("#list-" + type, QR.nodes.el);
|
list = $("#list-" + type, QR.nodes.el);
|
||||||
_ref = QR.persona[type];
|
for (_i = 0, _len = arr.length; _i < _len; _i++) {
|
||||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
val = arr[_i];
|
||||||
val = _ref[_i];
|
|
||||||
$.add(list, $.el('option', {
|
$.add(list, $.el('option', {
|
||||||
textContent: val
|
textContent: val
|
||||||
}));
|
}));
|
||||||
|
|||||||
@ -158,20 +158,21 @@ QR =
|
|||||||
status.disabled = disabled or false
|
status.disabled = disabled or false
|
||||||
|
|
||||||
persona:
|
persona:
|
||||||
name: []
|
|
||||||
email: []
|
|
||||||
sub: []
|
|
||||||
pwd: ''
|
pwd: ''
|
||||||
always: {}
|
always: {}
|
||||||
init: ->
|
init: ->
|
||||||
QR.persona.getPassword()
|
QR.persona.getPassword()
|
||||||
$.get 'QR.personas', Conf['QR.personas'], ({'QR.personas': personas}) ->
|
$.get 'QR.personas', Conf['QR.personas'], ({'QR.personas': personas}) ->
|
||||||
|
types =
|
||||||
|
name: []
|
||||||
|
email: []
|
||||||
|
sub: []
|
||||||
for item in personas.split '\n'
|
for item in personas.split '\n'
|
||||||
QR.persona.parseItem item.trim()
|
QR.persona.parseItem item.trim(), types
|
||||||
for type in ['name', 'email', 'sub']
|
for type, arr of types
|
||||||
QR.persona.loadPersonas type
|
QR.persona.loadPersonas type, arr
|
||||||
return
|
return
|
||||||
parseItem: (item) ->
|
parseItem: (item, types) ->
|
||||||
return if item[0] is '#'
|
return if item[0] is '#'
|
||||||
return unless match = item.match /(name|email|subject|password):"(.*)"/i
|
return unless match = item.match /(name|email|subject|password):"(.*)"/i
|
||||||
[match, type, val] = match
|
[match, type, val] = match
|
||||||
@ -192,11 +193,11 @@ QR =
|
|||||||
if /always/i.test item
|
if /always/i.test item
|
||||||
QR.persona.always[type] = val
|
QR.persona.always[type] = val
|
||||||
|
|
||||||
unless val in QR.persona[type]
|
unless val in types[type]
|
||||||
QR.persona[type].push val
|
types[type].push val
|
||||||
loadPersonas: (type) ->
|
loadPersonas: (type, arr) ->
|
||||||
list = $ "#list-#{type}", QR.nodes.el
|
list = $ "#list-#{type}", QR.nodes.el
|
||||||
for val in QR.persona[type]
|
for val in arr
|
||||||
$.add list, $.el 'option',
|
$.add list, $.el 'option',
|
||||||
textContent: val
|
textContent: val
|
||||||
return
|
return
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user