X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Fmkws-team.js;h=17f0f1f770e2b0a94180d63f48499e22ff43239b;hb=24b694ad5605a6f9d2a662677fbfcf9e6b0b693c;hp=890f58274a823c9830fb8256656083e6069684a5;hpb=82b10f58a4178af523fa3f9c37148d52f4944e7c;p=mkws-moved-to-github.git diff --git a/src/mkws-team.js b/src/mkws-team.js index 890f582..17f0f1f 100644 --- a/src/mkws-team.js +++ b/src/mkws-team.js @@ -101,6 +101,49 @@ mkws.makeTeam = function($, teamName) { return s; } + // ### what quoting do we need to undo? Complement of previous function + that.parseFragment = function(s) { + var x = {}; + + var list = s.split('@'); + for (var i in list) { + var a = list[i].split('='); + x[a[0]] = a[1]; + } + + return x; + } + + that.handleChanges = function(oldState, newState) { + for (var key in newState) { + var val = newState[key]; + if (newState.hasOwnProperty(key) && + (!oldState || val != oldState[key])) { + that.warn("changed property " + key + ": " + + (oldState ? ("'" + oldState[key] + "'") : "undefined") + + " -> '" + val + "'"); + if (key === 'page') { + that.showPage(parseInt(val)); + } else if (key === 'sort') { + that.set_sortOrder(val); + if (that.submitted()) { + that.reShow(); + } + } else if (key === 'size') { + that.set_perpage(val); + if (that.submitted()) { + that.reShow(); + } + } else if (key.indexOf('xt-') == 0) { + that.limitTarget(key.substring(3), val); + } else if (key.indexOf('xf-') == 0) { + var a = key.split('-'); + that.limitQuery(a[1], a[2]); + } + } + } + }; + // The following PubSub code is modified from the jQuery manual: // http://api.jquery.com/jQuery.Callbacks/