diff --git a/source/Ox.UI/js/Core/URL.js b/source/Ox.UI/js/Core/URL.js index 4e958125..bf2d5e3d 100644 --- a/source/Ox.UI/js/Core/URL.js +++ b/source/Ox.UI/js/Core/URL.js @@ -40,10 +40,10 @@ Ox.URL URL controller typeA Span types for this type list Span types for list views for this type viewA Span type for this view - Can be "date", "duration" or "location" + Can be "date", "duration", "location" or "number" item Span types for item views for this type viewA Span type for this view - Can be "date", "duration" or "location" + Can be "date", "duration", "location" or "number" types <[s]> List of types views List and item views for all types typeA Views for type "typeA" @@ -504,8 +504,8 @@ Ox.URL = function(options) { return Ox.isNumber(point) ? ( spanType == 'date' ? constructDate(point) : spanType == 'duration' ? constructDuration(point) - : spanType == 'number' ? point - : constructLocation(point) + : spanType == 'location' ? constructLocation(point) + : point ) : point; }).join(','); } @@ -586,8 +586,8 @@ Ox.URL = function(options) { : canBeDuration ? 'duration' : canBeDate && !/\./.test(str) ? 'date' : canBeLocation && length == 2 ? 'location' - : canBeNumber && /\d-/.test(str) ? 'number' - : ':' + : canBeNumber && /^\d+$/.test(str) ? 'number' + : ''; } function parseCondition(str) { @@ -647,10 +647,6 @@ Ox.URL = function(options) { return Ox.parseDuration(str); } - function parseNumber(str) { - return parseFloat(str); - } - function parseFind(str) { str = (str || '').replace(/%7C/g, '|'); var conditions, counter = 0, @@ -716,6 +712,10 @@ Ox.URL = function(options) { }); } + function parseNumber(str) { + return parseInt(str); + } + function parseSort(str, state) { return str.split(',').map(function(str) { var hasOperator = /^[\+-]/.test(str); @@ -738,8 +738,8 @@ Ox.URL = function(options) { return split.map( type == 'date' ? parseDate : type == 'duration' ? parseDuration - : type == 'number' ? parseNumber - : parseLocation + : type == 'location' ? parseLocation + : parseNumber ); } @@ -813,7 +813,7 @@ Ox.URL = function(options) { spanType = state.view ? spanTypes[state.view] : getSpanType(parts[0], Ox.unique(Ox.values(spanTypes))); - Ox.Log('Core', 'SPAN TYPE', spanType) + Ox.Log('URL', 'SPAN TYPE', spanType) if (spanType) { span = parseSpan(parts[0], spanType); if (span) {