merging changes

This commit is contained in:
rlx 2011-08-06 17:41:01 +00:00
parent b05be138cc
commit 8e468ced0b
7 changed files with 31 additions and 14 deletions

View file

@ -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;

View file

@ -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}: {}));
};
});

View file

@ -53,6 +53,10 @@ Ox.Request = function(options) {
cache = {};
},
_leakCache: function() {
return cache;
},
/*@
options <f> get/set options
() -> <o> get options

View file

@ -6,6 +6,7 @@ Ox.IconItem <f:Ox.Element> IconItem Object
(options) -> <f> IconItem Object
(options, self) -> <f> IconItem Object
options <o> Options object
borderRadius <n|0> border radius for icon images
fixedRatio <b|n|false> if set to a number, icons have a fixed ratio
height <n|128> icon height
id <s> 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 = $('<div>')
.css({

View file

@ -5,6 +5,7 @@ Ox.IconList <f:Ox.Element> IconList Object
(options) -> <f> IconList Object
(options, self) -> <f> IconList Object
options <o> Options object
borderRadius <n|0> border radius for icon images
centerSelection <b|false> scroll list so selection is always centered
defaultRatio <n|1> aspect ratio of icon placeholders
draggable <b|true> 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,

View file

@ -162,9 +162,9 @@ Ox.LargeTimeline = function(options, self) {
if (!self.$tiles[v]) {
self.$tiles[v] = $('<img>')
.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'

View file

@ -56,7 +56,7 @@ Ox.SmallTimeline = function(options, self) {
self.$line = $('<img>')
.addClass('OxTimelineSmallImage')
.attr({
src: '/' + self.options.videoId + '/timelines/timeline.16.0.png'
src: '/' + self.options.videoId + '/timeline16.png'
})
.css({
position: 'absolute',