From 8e468ced0b35807516fbda0986253148ee4d48c1 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Sat, 6 Aug 2011 17:41:01 +0000 Subject: [PATCH] merging changes --- source/Ox.UI/css/Ox.UI.css | 3 +-- source/Ox.UI/js/Core/Ox.App.js | 21 ++++++++++++++------- source/Ox.UI/js/Core/Ox.Request.js | 4 ++++ source/Ox.UI/js/List/Ox.IconItem.js | 8 ++++++-- source/Ox.UI/js/List/Ox.IconList.js | 3 +++ source/Ox.UI/js/Video/Ox.LargeTimeline.js | 4 ++-- source/Ox.UI/js/Video/Ox.SmallTimeline.js | 2 +- 7 files changed, 31 insertions(+), 14 deletions(-) diff --git a/source/Ox.UI/css/Ox.UI.css b/source/Ox.UI/css/Ox.UI.css index 3f8b7e84..1b9f9675 100644 --- a/source/Ox.UI/css/Ox.UI.css +++ b/source/Ox.UI/css/Ox.UI.css @@ -926,8 +926,7 @@ Lists margin: auto; border: 2px solid rgba(0, 0, 0, 0); cursor: pointer; - -moz-border-radius: 4px; - -webkit-border-radius: 4px; + border-radius: 4px; } .OxIconList .OxItem > .OxReflection { overflow: hidden; diff --git a/source/Ox.UI/js/Core/Ox.App.js b/source/Ox.UI/js/Core/Ox.App.js index 189b4ef5..0f56d4e6 100644 --- a/source/Ox.UI/js/Core/Ox.App.js +++ b/source/Ox.UI/js/Core/Ox.App.js @@ -55,18 +55,25 @@ Ox.App = function(options) { @*/ that.api.api(function(result) { Ox.forEach(result.data.actions, function(val, key) { - that.api[key] = function(data, callback) { - if (arguments.length == 1 && Ox.isFunction(data)) { - callback = data; - data = {}; - } + that.api[key] = function(/*data, age, callback*/) { + var data = {}, age = -1, callback = null; + Ox.forEach(arguments, function(argument) { + if (Ox.isObject(argument)) { + data = argument; + } else if (Ox.isNumber(argument)) { + age = argument; + } else if (Ox.isFunction(argument)) { + callback = argument; + } + }); return Ox.Request.send($.extend({ - url: self.options.url, + age: age, + callback: callback, data: { action: key, data: JSON.stringify(data) }, - callback: callback + url: self.options.url }, !val.cache ? {age: 0}: {})); }; }); diff --git a/source/Ox.UI/js/Core/Ox.Request.js b/source/Ox.UI/js/Core/Ox.Request.js index 646470b6..cff8bf60 100644 --- a/source/Ox.UI/js/Core/Ox.Request.js +++ b/source/Ox.UI/js/Core/Ox.Request.js @@ -53,6 +53,10 @@ Ox.Request = function(options) { cache = {}; }, + _leakCache: function() { + return cache; + }, + /*@ options get/set options () -> get options diff --git a/source/Ox.UI/js/List/Ox.IconItem.js b/source/Ox.UI/js/List/Ox.IconItem.js index 3e673814..b1afe2da 100644 --- a/source/Ox.UI/js/List/Ox.IconItem.js +++ b/source/Ox.UI/js/List/Ox.IconItem.js @@ -6,6 +6,7 @@ Ox.IconItem IconItem Object (options) -> IconItem Object (options, self) -> IconItem Object options Options object + borderRadius border radius for icon images fixedRatio if set to a number, icons have a fixed ratio height icon height id element id @@ -24,6 +25,7 @@ Ox.IconItem = function(options, self) { self = self || {}; var that = Ox.Element({}, self) .defaults({ + borderRadius: 0, fixedRatio: false, height: 128, id: '', @@ -64,7 +66,8 @@ Ox.IconItem = function(options, self) { }) .css({ width: self.options.width + 'px', - height: self.options.height + 'px' + height: self.options.height + 'px', + borderRadius: self.options.borderRadius + 4 + 'px' }) .mousedown(mousedown) .mouseenter(mouseenter) @@ -103,7 +106,8 @@ Ox.IconItem = function(options, self) { width: self.options.width + 'px', height: self.options.height + 'px', // firefox is 1px off when centering images with odd width and scaleY(-1) - paddingLeft: ($.browser.mozilla && self.options.width % 2 ? 1 : 0) + 'px' + paddingLeft: ($.browser.mozilla && self.options.width % 2 ? 1 : 0) + 'px', + borderRadius: self.options.borderRadius + 4 + 'px' }); that.$gradient = $('
') .css({ diff --git a/source/Ox.UI/js/List/Ox.IconList.js b/source/Ox.UI/js/List/Ox.IconList.js index ee13fc03..a4791d85 100644 --- a/source/Ox.UI/js/List/Ox.IconList.js +++ b/source/Ox.UI/js/List/Ox.IconList.js @@ -5,6 +5,7 @@ Ox.IconList IconList Object (options) -> IconList Object (options, self) -> IconList Object options Options object + borderRadius border radius for icon images centerSelection scroll list so selection is always centered defaultRatio aspect ratio of icon placeholders draggable can be dragged @@ -29,6 +30,7 @@ Ox.IconList = function(options, self) { self = self || {}; var that = Ox.Element({}, self) .defaults({ + borderRadius: 0, centerSelection: false, defaultRatio: 1, draggable: true, @@ -91,6 +93,7 @@ Ox.IconList = function(options, self) { self.options.item(data, self.options.sort, self.options.size) : {} ratio = !isEmpty ? data.width / data.height : self.options.defaultRatio; return self.options.itemConstructor($.extend(data, { + borderRadius: self.options.borderRadius, fixedRatio: self.options.fixedRatio, height: Math.round(self.options.size / (ratio <= 1 ? 1 : ratio)), size: self.options.size, diff --git a/source/Ox.UI/js/Video/Ox.LargeTimeline.js b/source/Ox.UI/js/Video/Ox.LargeTimeline.js index 2b975972..c32b8d00 100644 --- a/source/Ox.UI/js/Video/Ox.LargeTimeline.js +++ b/source/Ox.UI/js/Video/Ox.LargeTimeline.js @@ -162,9 +162,9 @@ Ox.LargeTimeline = function(options, self) { if (!self.$tiles[v]) { self.$tiles[v] = $('') .attr({ - src: '/' + self.options.videoId + '/timelines/' + ( + src: '/' + self.options.videoId + '/' + ( self.options.style == 'default' ? 'timeline' : self.options.style - ) + '.64.' + v + '.png' + ) + '64p' + v + '.png' }) .css({ left: (v * self.tileWidth) + 'px' diff --git a/source/Ox.UI/js/Video/Ox.SmallTimeline.js b/source/Ox.UI/js/Video/Ox.SmallTimeline.js index cdac7624..03700588 100644 --- a/source/Ox.UI/js/Video/Ox.SmallTimeline.js +++ b/source/Ox.UI/js/Video/Ox.SmallTimeline.js @@ -56,7 +56,7 @@ Ox.SmallTimeline = function(options, self) { self.$line = $('') .addClass('OxTimelineSmallImage') .attr({ - src: '/' + self.options.videoId + '/timelines/timeline.16.0.png' + src: '/' + self.options.videoId + '/timeline16.png' }) .css({ position: 'absolute',