Redundancy Reduction Mk. II

This commit is contained in:
Zixaphir 2013-08-06 17:41:58 -07:00
parent aadfe30b20
commit bcdb6193eb
3 changed files with 57 additions and 62 deletions

View File

@ -11537,33 +11537,31 @@
return $.asap((function() {
return $('.mPagelist');
}), function() {
var next, nextA, nextAction, prev, prevA, prevAction;
var i, item, items;
prev = $(".pagelist > .prev");
prevA = $.el('a', {
textContent: '<'
});
next = $(".pagelist > .next");
nextA = $.el('a', {
textContent: '>'
});
if ((prevAction = prev.firstElementChild).nodeName === 'FORM') {
prevA.href = 'javascript:;';
$.on(prevA, 'click', function() {
return prevAction.firstElementChild.click();
});
items = [['prev', '<'], ['next', '>']];
i = 0;
while (item = items[i++]) {
Style.pages(item[0], item[1]);
}
if ((nextAction = next.firstElementChild).nodeName === 'FORM') {
nextA.href = 'javascript:;';
$.on(nextA, 'click', function() {
return nextAction.firstElementChild.click();
});
}
$.add(prev, prevA);
return $.add(next, nextA);
});
}
},
pages: function(name, text) {
var action, el, elA;
el = $(".pagelist > ." + name);
elA = $.el('a', {
textContent: text
});
if ((action = prev.firstElementChild).nodeName === 'FORM') {
elA.href = 'javascript:;';
$.on(elA, 'click', function() {
return action.firstElementChild.click();
});
}
return $.add(el, elA);
},
readyInit: function() {
var exLink;

View File

@ -11525,33 +11525,31 @@
return $.asap((function() {
return $('.mPagelist');
}), function() {
var next, nextA, nextAction, prev, prevA, prevAction;
var i, item, items;
prev = $(".pagelist > .prev");
prevA = $.el('a', {
textContent: '<'
});
next = $(".pagelist > .next");
nextA = $.el('a', {
textContent: '>'
});
if ((prevAction = prev.firstElementChild).nodeName === 'FORM') {
prevA.href = 'javascript:;';
$.on(prevA, 'click', function() {
return prevAction.firstElementChild.click();
});
items = [['prev', '<'], ['next', '>']];
i = 0;
while (item = items[i++]) {
Style.pages(item[0], item[1]);
}
if ((nextAction = next.firstElementChild).nodeName === 'FORM') {
nextA.href = 'javascript:;';
$.on(nextA, 'click', function() {
return nextAction.firstElementChild.click();
});
}
$.add(prev, prevA);
return $.add(next, nextA);
});
}
},
pages: function(name, text) {
var action, el, elA;
el = $(".pagelist > ." + name);
elA = $.el('a', {
textContent: text
});
if ((action = prev.firstElementChild).nodeName === 'FORM') {
elA.href = 'javascript:;';
$.on(elA, 'click', function() {
return action.firstElementChild.click();
});
}
return $.add(el, elA);
},
readyInit: function() {
var exLink;

View File

@ -25,27 +25,26 @@ Style =
if g.VIEW is 'index'
$.asap (-> $ '.mPagelist'), ->
items = [
['prev', '<']
['next', '>']
]
i = 0
while item = items[i++]
Style.pages item[0], item[1]
return
prev = $ ".pagelist > .prev"
prevA = $.el 'a',
textContent: '<'
pages: (name, text) ->
el = $ ".pagelist > .#{name}"
elA = $.el 'a',
textContent: text
next = $ ".pagelist > .next"
nextA = $.el 'a',
textContent: '>'
if (action = prev.firstElementChild).nodeName is 'FORM'
elA.href = 'javascript:;'
$.on elA, 'click', ->
action.firstElementChild.click()
if (prevAction = prev.firstElementChild).nodeName is 'FORM'
prevA.href = 'javascript:;'
$.on prevA, 'click', ->
prevAction.firstElementChild.click()
if (nextAction = next.firstElementChild).nodeName is 'FORM'
nextA.href = 'javascript:;'
$.on nextA, 'click', ->
nextAction.firstElementChild.click()
$.add prev, prevA
$.add next, nextA
$.add el, elA
readyInit: ->
Style.padding()