Ox.URL: invoke getSpan for durations

This commit is contained in:
rolux 2013-07-12 11:00:51 +02:00
parent a2fb27d469
commit fadf032592

View file

@ -25,11 +25,11 @@ Ox.URL <f> URL controller
state <o> State object state <o> State object
string <s> The string to be tested string <s> The string to be tested
callback <f> callback function callback <f> callback function
getSpan <f> Tests if a string matches a span getSpan <f> Tests if a value matches a span
May modify the state's view and span properties May modify the state's view and span properties
(state, string, callback) -> <u> undefined (state, string, callback) -> <u> undefined
state <o> State object state <o> State object
string <s> The string to be tested value <[n]|s> The value to be tested
callback <f> Callback function callback <f> Callback function
pages <[s]> List of pages pages <[s]> List of pages
sortKeys <o> Sort keys for list and item views for all types sortKeys <o> Sort keys for list and item views for all types
@ -773,7 +773,7 @@ Ox.URL = function(options) {
parts.shift(); parts.shift();
if (parts.length) { if (parts.length) {
// may modify state.part // may modify state.part
self.options.getPart(state, parts[0], getHash); self.options.getPart(state, decodeValue(parts[0]), getHash);
} else { } else {
getHash(); getHash();
} }
@ -796,7 +796,7 @@ Ox.URL = function(options) {
parseBeyondItem(); parseBeyondItem();
} else { } else {
// test for item id or name // test for item id or name
self.options.getItem(state, parts[0].replace(/%20/g, ' '), function() { self.options.getItem(state, decodeValue(parts[0]), function() {
// may have modified state.item // may have modified state.item
if (state.item) { if (state.item) {
parts.shift(); parts.shift();
@ -857,7 +857,10 @@ Ox.URL = function(options) {
} }
} }
} }
if (!state.span && /^[A-Z@]/.test(parts[0])) { if (state.span && spanType == 'duration') {
// test duration, may modify state.span
self.options.getSpan(state, state.span, parseBeyondSpan);
} else if (!state.span && /^[A-Z@]/.test(parts[0])) {
// test for span id or name // test for span id or name
self.options.getSpan(state, decodeValue(parts[0]), function() { self.options.getSpan(state, decodeValue(parts[0]), function() {
// may have modified state.view and state.span // may have modified state.view and state.span