Redundancy Reduction Mk. II
This commit is contained in:
parent
aadfe30b20
commit
bcdb6193eb
@ -11537,33 +11537,31 @@
|
|||||||
return $.asap((function() {
|
return $.asap((function() {
|
||||||
return $('.mPagelist');
|
return $('.mPagelist');
|
||||||
}), function() {
|
}), function() {
|
||||||
var next, nextA, nextAction, prev, prevA, prevAction;
|
var i, item, items;
|
||||||
|
|
||||||
prev = $(".pagelist > .prev");
|
items = [['prev', '<'], ['next', '>']];
|
||||||
prevA = $.el('a', {
|
i = 0;
|
||||||
textContent: '<'
|
while (item = items[i++]) {
|
||||||
});
|
Style.pages(item[0], item[1]);
|
||||||
next = $(".pagelist > .next");
|
|
||||||
nextA = $.el('a', {
|
|
||||||
textContent: '>'
|
|
||||||
});
|
|
||||||
if ((prevAction = prev.firstElementChild).nodeName === 'FORM') {
|
|
||||||
prevA.href = 'javascript:;';
|
|
||||||
$.on(prevA, 'click', function() {
|
|
||||||
return prevAction.firstElementChild.click();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
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() {
|
readyInit: function() {
|
||||||
var exLink;
|
var exLink;
|
||||||
|
|
||||||
|
|||||||
@ -11525,33 +11525,31 @@
|
|||||||
return $.asap((function() {
|
return $.asap((function() {
|
||||||
return $('.mPagelist');
|
return $('.mPagelist');
|
||||||
}), function() {
|
}), function() {
|
||||||
var next, nextA, nextAction, prev, prevA, prevAction;
|
var i, item, items;
|
||||||
|
|
||||||
prev = $(".pagelist > .prev");
|
items = [['prev', '<'], ['next', '>']];
|
||||||
prevA = $.el('a', {
|
i = 0;
|
||||||
textContent: '<'
|
while (item = items[i++]) {
|
||||||
});
|
Style.pages(item[0], item[1]);
|
||||||
next = $(".pagelist > .next");
|
|
||||||
nextA = $.el('a', {
|
|
||||||
textContent: '>'
|
|
||||||
});
|
|
||||||
if ((prevAction = prev.firstElementChild).nodeName === 'FORM') {
|
|
||||||
prevA.href = 'javascript:;';
|
|
||||||
$.on(prevA, 'click', function() {
|
|
||||||
return prevAction.firstElementChild.click();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
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() {
|
readyInit: function() {
|
||||||
var exLink;
|
var exLink;
|
||||||
|
|
||||||
|
|||||||
@ -25,27 +25,26 @@ Style =
|
|||||||
|
|
||||||
if g.VIEW is 'index'
|
if g.VIEW is 'index'
|
||||||
$.asap (-> $ '.mPagelist'), ->
|
$.asap (-> $ '.mPagelist'), ->
|
||||||
|
items = [
|
||||||
|
['prev', '<']
|
||||||
|
['next', '>']
|
||||||
|
]
|
||||||
|
i = 0
|
||||||
|
while item = items[i++]
|
||||||
|
Style.pages item[0], item[1]
|
||||||
|
return
|
||||||
|
|
||||||
prev = $ ".pagelist > .prev"
|
pages: (name, text) ->
|
||||||
prevA = $.el 'a',
|
el = $ ".pagelist > .#{name}"
|
||||||
textContent: '<'
|
elA = $.el 'a',
|
||||||
|
textContent: text
|
||||||
|
|
||||||
next = $ ".pagelist > .next"
|
if (action = prev.firstElementChild).nodeName is 'FORM'
|
||||||
nextA = $.el 'a',
|
elA.href = 'javascript:;'
|
||||||
textContent: '>'
|
$.on elA, 'click', ->
|
||||||
|
action.firstElementChild.click()
|
||||||
|
|
||||||
if (prevAction = prev.firstElementChild).nodeName is 'FORM'
|
$.add el, elA
|
||||||
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
|
|
||||||
|
|
||||||
readyInit: ->
|
readyInit: ->
|
||||||
Style.padding()
|
Style.padding()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user