Redundancy Reduction Mk. II
This commit is contained in:
parent
aadfe30b20
commit
bcdb6193eb
@ -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;
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user