1
0
Fork 0
forked from 0x2620/oxjs

change symbols from png to svg

This commit is contained in:
rlx 2011-03-07 22:31:46 +00:00
commit f8485f0874
570 changed files with 1674 additions and 343 deletions

View file

@ -14,19 +14,49 @@ requires
(function() {
Ox.UI = (function() {
$(function() {
Ox.extend(Ox.UI, {
$body: $('body'),
$document: $(document),
$window: $(window)
});
Ox.theme(Ox.UI.DEFAULT_THEME);
});
return {
$elements: {},
DEFAULT_THEME: 'classic',
DIMENSIONS: {
horizontal: ['width', 'height'],
vertical: ['height', 'width']
},
EDGES: {
horizontal: ['left', 'right', 'top', 'bottom'],
vertical: ['top', 'bottom', 'left', 'right']
},
getImagePath: function(filename) {
return Ox.UI.PATH + filename.split('.').pop() +
'/ox.ui.' + Ox.UI.theme() + '/' + filename;
},
PATH: $('script[src*="ox.ui.js"]')
.attr('src').replace('js/ox.ui.js', ''),
SCROLLBAR_SIZE: $.browser.mozilla ? 16 : 12,
theme: function() {
var theme;
Ox.forEach(Ox.UI.$body.attr('class').split(' '), function(v) {
if (Ox.startsWith(v, 'OxTheme')) {
theme = v.replace('OxTheme', '').toLowerCase();
return false;
}
});
return theme || Ox.UI.DEFAULT_THEME; // fixme: shouldn't be neccessary
},
};
})();
// fixme: move into Ox.UI
var oxui = {
defaultTheme: 'classic',
elements: {},
getDimensions: function(orientation) {
return orientation == 'horizontal' ?
['width', 'height'] : ['height', 'width'];
},
getEdges: function(orientation) {
return orientation == 'horizontal' ?
['left', 'right', 'top', 'bottom'] :
['top', 'bottom', 'left', 'right'];
},
getBarSize: function(size) {
var sizes = {
small: 20,
@ -35,8 +65,6 @@ requires
};
return sizes[size];
},
path: $('script[src*="ox.ui.js"]').attr('src').replace('js/ox.ui.js', ''),
scrollbarSize: $.browser.mozilla ? 16 : 12,
symbols: {
alt: '\u2325',
apple: '\uF8FF',
@ -91,18 +119,7 @@ requires
warning: '\u26A0',
white_star: '\u2606'
}
},
$elements = {},
$window, $document, $body;
_$elements = $elements;
$(function() {
$window = $(window);
$document = $(document);
$body = $('body');
Ox.theme(oxui.defaultTheme);
});
};
/*
============================================================================
@ -186,12 +203,16 @@ requires
function loadImages(callback) {
window.OxImageCache = [];
$.getJSON(oxui.path + 'json/ox.ui.images.json', function(data) {
$.getJSON(Ox.UI.PATH + 'json/ox.ui.images.json', function(data) {
// fixme: find a better way to not wait for flags
data = data.filter(function(image) {
return !Ox.startsWith(image, 'svg/ox.map/')
});
var counter = 0,
length = data.length;
data.forEach(function(src, i) {
var image = new Image();
image.src = oxui.path + src;
image.src = Ox.UI.PATH + src;
image.onload = function() {
(++counter == length) && callback();
}
@ -263,8 +284,8 @@ requires
loadImages(launchCallback);
function launchCallback() {
++counter == 2 && $(function() {
var $div = $body.find('div');
$body.find('img').remove();
var $div = Ox.UI.$body.find('div');
Ox.UI.$body.find('img').remove();
$div.animate({
opacity: 0
}, 1000, function() {
@ -334,7 +355,7 @@ requires
stack.splice(stack.length - 2, 0, stack.pop());
//$elements[id].removeClass('OxFocus');
$('.OxFocus').removeClass('OxFocus'); // fixme: the above is better, and should work
stack.length && $elements[stack[stack.length - 1]].addClass('OxFocus');
stack.length && Ox.UI.$elements[stack[stack.length - 1]].addClass('OxFocus');
Ox.print('blur', id, stack);
}
},
@ -344,7 +365,7 @@ requires
index > -1 && stack.splice(index, 1);
stack.push(id);
$('.OxFocus').removeClass('OxFocus'); // fixme: see above
$elements[id].addClass('OxFocus');
Ox.UI.$elements[id].addClass('OxFocus');
Ox.print('focus', id, stack);
}
},
@ -494,8 +515,8 @@ requires
// if the cursor is at the start/end of an input element
// on linux, it doesn't seem to fire if the input element has focus
if ($.browser.mozilla) {
$document.keypress(keypress);
$document.keydown(function(event) {
Ox.UI.$document.keypress(keypress);
Ox.UI.$document.keydown(function(event) {
var $element = $('input:focus');
if ($element.length) {
if (
@ -513,7 +534,7 @@ requires
}
});
} else {
$document.keydown(keypress);
Ox.UI.$document.keydown(keypress);
}
});
@ -540,8 +561,8 @@ requires
buffer += key == 'SPACE' ? ' ' : key;
bufferTime = time;
}
focused !== null && $elements[focused].triggerEvent('key_' + key);
if (['down', 'space', 'up'].indexOf(key) > -1 && !$elements[focused].hasClass('OxInput')) {
focused !== null && Ox.UI.$elements[focused].triggerEvent('key_' + key);
if (['down', 'space', 'up'].indexOf(key) > -1 && !Ox.UI.$elements[focused].hasClass('OxInput')) {
// prevent chrome from scrolling
return false;
}
@ -779,45 +800,6 @@ requires
};
Ox.UI = (function() {
/*
$(function() {
Ox.extend(Ox.UI, {
$body: $('body'),
$document: $(document),
$window: $(window)
});
});
*/
return {
getDimensions: function(orientation) {
return orientation == 'horizontal' ?
['width', 'height'] : ['height', 'width'];
},
getEdges: function(orientation) {
return orientation == 'horizontal' ?
['left', 'right', 'top', 'bottom'] :
['top', 'bottom', 'left', 'right'];
},
DIMENSIONS: {
horizontal: ['width', 'height'],
vertical: ['height', 'width']
},
EDGES: {
horizontal: [['left', 'right'], ['top', 'bottom']],
vertical: [['top', 'bottom'], ['left', 'right']]
},
PATH: $('script[src*="ox.ui.js"]')
.attr('src').replace('js/ox.ui.js', ''),
theme: function() {
},
themePath: function() {
}
};
}());
/***
Ox.URL
***/
@ -873,11 +855,11 @@ requires
// so that we can do oxObj.jqFn().oxFn()
/*
if (fn == 'appendTo') {
Ox.print('ret', ret, $element, ret.jquery && $elements[id = ret.data('ox')] == true)
Ox.print('ret', ret, $element, ret.jquery && Ox.UI.$elements[id = ret.data('ox')] == true)
}
*/
return ret.jquery && $elements[id = ret.data('ox')] ?
$elements[id] : ret;
return ret.jquery && Ox.UI.$elements[id = ret.data('ox')] ?
Ox.UI.$elements[id] : ret;
};
});
return that;
@ -919,7 +901,7 @@ requires
},
mousedown: mousedown
});
$elements[that.id] = that;
Ox.UI.$elements[that.id] = that;
$.extend(that, Ox.jQueryElement(that));
@ -958,11 +940,11 @@ requires
mouseInterval = setInterval(function() {
that.triggerEvent('mouserepeat');
}, 50);
$window.unbind('mouseup', mouseup)
Ox.UI.$window.unbind('mouseup', mouseup)
.mousemove(mousemove)
.one('mouseup', function(e) {
clearInterval(mouseInterval);
$window.unbind('mousemove', mousemove);
Ox.UI.$window.unbind('mousemove', mousemove);
that.triggerEvent('dragend', e);
});
that.one('mouseleave', function() {
@ -976,7 +958,7 @@ requires
self.mouseTimeout = 0;
that.triggerEvent('doubleclick');
}
$window.one('mouseup', mouseup);
Ox.UI.$window.one('mouseup', mouseup);
function mousemove(e) {
that.triggerEvent('drag', e);
}
@ -1099,7 +1081,7 @@ requires
that.loseFocus();
delete self.$eventHandler;
that.$element.remove();
delete $elements[that.ox];
delete Ox.UI.$elements[that.ox];
return that;
};
@ -1219,20 +1201,20 @@ requires
*/
Ox.theme = function() {
var length = arguments.length,
classes = $body.attr('class').split(' '),
classes = Ox.UI.$body.attr('class').split(' '),
arg, theme;
$.each(classes, function(i, v) {
if (Ox.startsWith(v, 'OxTheme')) {
theme = v.replace('OxTheme', '').toLowerCase();
if (length == 1) {
$body.removeClass(v);
Ox.UI.$body.removeClass(v);
}
return false;
}
});
if (length == 1) {
arg = arguments[0]
$body.addClass('OxTheme' + Ox.toTitleCase(arg));
Ox.UI.$body.addClass('OxTheme' + Ox.toTitleCase(arg));
if (theme) {
$('img').each(function() {
var $this = $(this);
@ -1281,7 +1263,7 @@ requires
})
.options(options || {})
.addClass('OxBar Ox' + Ox.toTitleCase(self.options.orientation)),
dimensions = oxui.getDimensions(self.options.orientation);
dimensions = Ox.UI.DIMENSIONS[self.options.orientation];
self.options.size = Ox.isString(self.options.size) ?
oxui.getBarSize(self.options.size) : self.options.size;
that.css(dimensions[0], '100%')
@ -1331,8 +1313,8 @@ requires
$.extend(self, {
clientXY: self.options.orientation == 'horizontal' ? 'clientY' : 'clientX',
dimensions: oxui.getDimensions(self.options.orientation), // fixme: should orientation be the opposite orientation here?
edges: oxui.getEdges(self.options.orientation),
dimensions: Ox.UI.DIMENSIONS[self.options.orientation], // fixme: should orientation be the opposite orientation here?
edges: Ox.UI.EDGES[self.options.orientation],
leftOrTop: self.options.edge == 'left' || self.options.edge == 'top'
});
@ -1569,7 +1551,7 @@ requires
.mouseup(mouseupLayer);
function center() {
var documentHeight = $document.height();
var documentHeight = Ox.UI.$document.height();
that.css({
left: 0,
top: Math.max(parseInt(-documentHeight / 10), self.options.height - documentHeight + 40) + 'px',
@ -1581,8 +1563,8 @@ requires
function dragstart(event, e) {
self.drag = {
bodyWidth: $body.width(),
bodyHeight: $document.height(),
bodyWidth: Ox.UI.$body.width(),
bodyHeight: Ox.UI.$document.height(),
elementWidth: that.width(),
offset: that.offset(),
x: e.clientX,
@ -1612,8 +1594,8 @@ requires
function dragstartResize(event, e) {
self.drag = {
documentWidth: $document.width(),
documentHeight: $document.height(),
documentWidth: Ox.UI.$document.width(),
documentHeight: Ox.UI.$document.height(),
elementWidth: that.width(),
elementHeight: that.height(),
offset: that.offset(),
@ -1812,7 +1794,7 @@ requires
that.remove();
callback();
});
$window.unbind('mouseup', mouseupLayer)
Ox.UI.$window.unbind('mouseup', mouseupLayer)
return that;
};
@ -1848,17 +1830,17 @@ requires
that.open = function() {
//Ox.print('before open')
that.$layer.appendTo($body);
that.$layer.appendTo(Ox.UI.$body);
that.css({
opacity: 0
}).appendTo($body).animate({
}).appendTo(Ox.UI.$body).animate({
opacity: 1
}, 200);
center();
reset();
// fixme: the following line prevents preview-style dialog
that.gainFocus();
$window.bind('mouseup', mouseupLayer)
Ox.UI.$window.bind('mouseup', mouseupLayer)
//Ox.print('after open')
return that;
};
@ -2559,8 +2541,9 @@ requires
self.title = title;
if (self.options.type == 'image') {
that.attr({
src: oxui.path + 'png/ox.ui.' + Ox.theme() +
'/symbol' + Ox.toTitleCase(title) + '.png'
src: Ox.UI.getImagePath(
'symbol' + title[0].toUpperCase() + title.substr(1) + '.svg'
)
});
} else {
that.val(title);
@ -3009,7 +2992,7 @@ requires
self.arrows[0] = [
new Ox.Button({
overlap: 'right',
title: 'previous',
title: 'left',
type: 'image'
})
.css({
@ -3021,7 +3004,7 @@ requires
.appendTo(that),
new Ox.Button({
overlap: 'left',
title: 'next',
title: 'right',
type: 'image'
})
.css({
@ -3043,7 +3026,7 @@ requires
if (self.options.clear) {
self.$button = new Ox.Button({
overlap: 'left',
title: 'clear',
title: 'close',
type: 'image'
})
.css({
@ -3378,8 +3361,8 @@ requires
self.options.placeholder && setPlaceholder();
self.options.validate && validate();
if (self.bindKeyboard) {
$document.unbind('keydown', keypress);
$document.unbind('keypress', keypress);
Ox.UI.$document.unbind('keydown', keypress);
Ox.UI.$document.unbind('keypress', keypress);
}
that.triggerEvent('blur', {});
}
@ -3462,8 +3445,8 @@ requires
if (self.bindKeyboard) {
//Ox.print('binding...')
// fixme: different in webkit and firefox (?), see keyboard handler, need generic function
$document.keydown(keypress);
$document.keypress(keypress);
Ox.UI.$document.keydown(keypress);
Ox.UI.$document.keypress(keypress);
self.options.autocompleteSelect && setTimeout(autocomplete, 0); // fixme: why is the timeout needed?
}
}
@ -4457,7 +4440,7 @@ requires
.defaults({
arrows: false,
arrowStep: 1,
arrowSymbols: ['previous', 'next'],
arrowSymbols: ['left', 'right'],
max: 100,
min: 0,
orientation: 'horizontal',
@ -4993,13 +4976,13 @@ requires
MozBorderRadius: '8px 8px 0 0',
WebkitBorderRadius: '8px 8px 0 0'
});
self.$layer.appendTo($body);
self.$layer.appendTo(Ox.UI.$body);
self.$menu
.css({
left: left + 'px',
top: top + 'px'
})
.appendTo($body);
.appendTo(Ox.UI.$body);
that.triggerEvent('show');
};
@ -5481,8 +5464,8 @@ requires
if (self.options.clear) {
that.$clear = new Ox.Button({
overlap: 'left',
type: 'image',
value: 'clear'
title: 'close',
type: 'image'
})
.css({
float: 'right'
@ -5932,8 +5915,8 @@ requires
}
}
if (self.bindKeyboard) {
$document.unbind('keydown', keypress);
$document.unbind('keypress', keypress);
Ox.UI.$document.unbind('keydown', keypress);
Ox.UI.$document.unbind('keypress', keypress);
}
}
@ -5982,8 +5965,8 @@ requires
}
if (self.bindKeyboard) {
// fixme: different in webkit and firefox (?), see keyboard handler, need generic function
$document.keydown(keypress);
$document.keypress(keypress);
Ox.UI.$document.keydown(keypress);
Ox.UI.$document.keypress(keypress);
//Ox.print('calling autosuggest...')
self.options.autosuggest && setTimeout(autosuggestCall, 0); // fixme: why is the timeout needed?
}
@ -6039,7 +6022,7 @@ requires
animate: false,
arrows: false,
arrowStep: 1,
arrowSymbols: ['previous', 'next'],
arrowSymbols: ['left', 'right'],
max: 100,
min: 0,
orientation: 'horizontal',
@ -6152,11 +6135,11 @@ requires
return getVal(e.clientX - left - offset);
}
setValue(val(e), 200);
$window.mousemove(function(e) {
Ox.UI.$window.mousemove(function(e) {
setValue(val(e));
});
$window.one('mouseup', function() {
$window.unbind('mousemove');
Ox.UI.$window.one('mouseup', function() {
Ox.UI.$window.unbind('mousemove');
});
}
function getPx(val) {
@ -6400,7 +6383,7 @@ requires
height: self.options.size * 1.5,
lineLength: self.options.size == 64 ? 15 : 23,
lines: self.options.size == 64 ? 4 : 5,
url: oxui.path + '/png/ox.ui/transparent.png',
url: Ox.UI.PATH + '/png/ox.ui/transparent.png',
width: self.options.size
});
self.title = formatText(self.options.title, self.lines - 1, self.lineLength);
@ -6675,7 +6658,7 @@ requires
updateQuery(self.options.selected);
}
that.bindEvent(self.keyboardEvents);
$window.resize(that.size); // fixme: this is not the widget's job
Ox.UI.$window.resize(that.size); // fixme: this is not the widget's job
function addAboveToSelection() {
var pos = getAbove();
@ -6885,7 +6868,7 @@ requires
//Ox.print('dragItem', e);
//Ox.print(e.offsetY, offsets)
$item.addClass('OxDrag');
$window.mousemove(function(e) {
Ox.UI.$window.mousemove(function(e) {
var clientY = e.clientY - that.offset()['top'],
offset = clientY % 16,
position = Ox.limit(parseInt(clientY / 16), 0, self.$items.length - 1);
@ -6899,9 +6882,9 @@ requires
pos = stopPos;
}
});
$window.one('mouseup', function() {
Ox.UI.$window.one('mouseup', function() {
dropItem(id, pos);
$window.unbind('mousemove');
Ox.UI.$window.unbind('mousemove');
});
}
@ -6998,7 +6981,7 @@ requires
}
function getHeight() {
return that.height() - (that.$content.width() > that.width() ? oxui.scrollbarSize : 0);
return that.height() - (that.$content.width() > that.width() ? Ox.UI.SCROLLBAR_SIZE : 0);
}
function getListSize() {
@ -7139,7 +7122,7 @@ requires
}
function getWidth() {
return that.width() - (that.$content.height() > that.height() ? oxui.scrollbarSize : 0);
return that.width() - (that.$content.height() > that.height() ? Ox.UI.SCROLLBAR_SIZE : 0);
}
function invertSelection() {
@ -7354,7 +7337,7 @@ requires
self.dragTimeout = 0;
}
}, 250);
$window.one('mouseup', function(e) {
Ox.UI.$window.one('mouseup', function(e) {
if (self.dragTimeout) {
clearTimeout(self.dragTimeout);
self.dragTimeout = 0;
@ -8148,7 +8131,7 @@ requires
that.$head = new Ox.Container()
.addClass('OxHead')
.css({
right: self.options.scrollbarVisible ? oxui.scrollbarSize + 'px' : 0
right: self.options.scrollbarVisible ? Ox.UI.SCROLLBAR_SIZE + 'px' : 0
})
.appendTo(that.$bar);
that.$head.$content.addClass('OxTitles');
@ -8507,7 +8490,7 @@ requires
return Math.max(
Ox.sum(self.columnWidths),
that.$element.width() -
(self.options.scrollbarVisible ? oxui.scrollbarSize : 0)
(self.options.scrollbarVisible ? Ox.UI.SCROLLBAR_SIZE : 0)
);
//return Ox.sum(self.columnWidths)
}
@ -8849,8 +8832,9 @@ requires
$('<img>')
.addClass('OxToggle')
.attr({
src: oxui.path + '/png/ox.ui.' + Ox.theme() + '/symbol' +
(data.expanded ? 'Collapse' : 'Expand') + '.png'
src: Ox.UI.getImagePath(
'symbol' + (data.expanded ? 'Collapse' : 'Expand') + '.svg'
)
})
)
.appendTo($item);
@ -8937,8 +8921,9 @@ requires
}
})
$img.attr({
src: oxui.path + '/png/ox.ui.' + Ox.theme() + '/symbol' +
(item.expanded ? 'Collapse' : 'Expand') + '.png'
src: Ox.UI.getImagePath(
'symbol' + (item.expanded ? 'Down' : 'Right') + '.svg'
)
});
item.expanded ?
that.$element.addItems(pos + 1, parseItems(item.items, item.level + 1)) :
@ -9019,7 +9004,7 @@ requires
return $('<img>')
.attr({
// fixme: not the right place to do these
src: '/static/oxjs/build/svg/' + (value || 'NTHH') + '.' + (value == 'RE' ? 'png' : 'svg')
src: Ox.UI.PATH + 'svg/ox.map/' + (value || 'NTHH') + '.' + (value == 'RE' ? 'png' : 'svg')
})
.load(function() {
$(this).css({
@ -9513,7 +9498,7 @@ requires
top: '24px'
}),
'east': new Ox.Button({
title: 'next',
title: 'right',
type: 'image'
})
.addClass('OxMapButton')
@ -9522,7 +9507,7 @@ requires
top: '24px',
}),
'north': new Ox.Button({
title: 'above',
title: 'up',
type: 'image'
})
.addClass('OxMapButton')
@ -9531,7 +9516,7 @@ requires
top: '4px',
}),
'south': new Ox.Button({
title: 'below',
title: 'down',
type: 'image'
})
.addClass('OxMapButton')
@ -9540,7 +9525,7 @@ requires
top: '44px',
}),
'west': new Ox.Button({
title: 'previous',
title: 'left',
type: 'image'
})
.addClass('OxMapButton')
@ -10470,7 +10455,7 @@ requires
cursor: that.place.editing ? 'move' : 'pointer',
draggable: that.place.editing,
icon: new google.maps.MarkerImage(
oxui.path + 'png/ox.ui/mapMarker' +
Ox.UI.PATH + 'png/ox.map/marker' +
(that.place.id[0] == '_' ? 'Result' : '') +
(that.place.editing ? 'Editing' : (
that.place.selected ? 'Selected' : ''
@ -10630,7 +10615,7 @@ requires
cursor: that.position + '-resize',
draggable: true,
icon: new google.maps.MarkerImage(
oxui.path + 'png/ox.ui/mapMarkerResize.png',
Ox.UI.PATH + 'png/ox.ui/markerResize.png',
new google.maps.Size(16, 16),
new google.maps.Point(0, 0),
new google.maps.Point(8, 8)
@ -10753,7 +10738,7 @@ requires
});
$.each(self.markers, function(k, markers) {
if (markers.length) {
self.src += '&markers=icon:' + 'http://dev.pan.do:8000' + oxui.path + 'png/ox.ui/marker' +
self.src += '&markers=icon:' + 'http://dev.pan.do:8000' + Ox.UI.PATH + 'png/ox.map/marker' +
Ox.toTitleCase(self.options['markerColor' + Ox.toTitleCase(k)]) + '.png|' +
markers.join('|')
}
@ -11602,9 +11587,9 @@ requires
return;
}
if (!self.options.parent && !that.$layer.parent().length) {
that.$layer.appendTo($body);
that.$layer.appendTo(Ox.UI.$body);
}
that.parent().length == 0 && that.appendTo($body);
that.parent().length == 0 && that.appendTo(Ox.UI.$body);
that.css({
left: '-1000px',
top: '-1000px',
@ -11614,15 +11599,15 @@ requires
height = self.options.element.outerHeight(),
left = Ox.limit(
offset.left + self.options.offset.left + (self.options.side == 'bottom' ? 0 : width),
0, $window.width() - that.width()
0, Ox.UI.$window.width() - that.width()
),
top = offset.top + self.options.offset.top + (self.options.side == 'bottom' ? height : 0),
menuHeight = that.$content.outerHeight(); // fixme: why is outerHeight 0 when hidden?
menuMaxHeight = Math.floor($window.height() - top - 16);
menuMaxHeight = Math.floor(Ox.UI.$window.height() - top - 16);
if (self.options.parent) {
if (menuHeight > menuMaxHeight) {
top = Ox.limit(top - menuHeight + menuMaxHeight, self.options.parent.offset().top, top);
menuMaxHeight = Math.floor($window.height() - top - 16);
menuMaxHeight = Math.floor(Ox.UI.$window.height() - top - 16);
}
}
that.css({
@ -11790,8 +11775,8 @@ requires
.addClass('OxCollapsePanel'),
// fixme: the following should all be self.foo
title = self.options.collapsed ?
[{id: 'expand', title: 'expand'}, {id: 'collapse', title: 'collapse'}] :
[{id: 'collapse', title: 'collapse'}, {id: 'expand', title: 'expand'}],
[{id: 'expand', title: 'right'}, {id: 'collapse', title: 'down'}] :
[{id: 'collapse', title: 'down'}, {id: 'expand', title: 'right'}],
$titlebar = new Ox.Bar({
orientation: 'horizontal',
size: self.options.size,
@ -12085,8 +12070,8 @@ requires
.addClass('OxSplitPanel');
$.extend(self, {
dimensions: oxui.getDimensions(self.options.orientation),
edges: oxui.getEdges(self.options.orientation),
dimensions: Ox.UI.DIMENSIONS[self.options.orientation],
edges: Ox.UI.EDGES[self.options.orientation],
length: self.options.elements.length,
resizebarElements: [],
$resizebars: []
@ -12313,8 +12298,6 @@ requires
============================================================================
*/
/**
*/
Ox.LoadingIcon = function(options, self) {
var self = self || {},
that = new Ox.Element('img', self)
@ -12323,45 +12306,21 @@ requires
})
.options(options || {})
.attr({
src: oxui.path + '/png/ox.ui.' + Ox.theme() + '/loading.png' // fixme: oxui.themePath needed?
src: Ox.UI.getImagePath('symbolLoading.svg')
})
.addClass(
'OxLoadingIcon Ox' + Ox.toTitleCase(self.options.size)
);
self.deg = 0;
self.interval = 0;
self.isRunning = false;
function clear() {
clearInterval(self.interval);
self.deg = 0;
self.interval = 0;
update();
}
function update() {
that.css({
MozTransform: 'rotate(' + self.deg + 'deg)',
WebkitTransform: 'rotate(' + self.deg + 'deg)'
});
}
that.start = function() {
self.isRunning = true;
clear();
that.animate({
opacity: 1
}, 250);
self.interval = setInterval(function() {
self.deg = (self.deg + 30) % 360;
update();
}, 83);
return that;
};
that.stop = function() {
that.animate({
opacity: 0
}, 250, function() {
self.isRunning && clear();
self.isRunning = false;
});
}, 250);
return that;
}
return that;
@ -12550,7 +12509,7 @@ requires
self.$markerPosition = $('<img>')
.addClass('OxMarkerPosition')
.attr({
src: '/static/oxjs/build/png/ox.ui/videoMarkerPlay.png'
src: Ox.UI.PATH + 'png/ox.ui/videoMarkerPlay.png'
})
.css({
position: 'absolute',
@ -12567,7 +12526,7 @@ requires
self.$markerPoint[i] = $('<img>')
.addClass('OxMarkerPoint' + titleCase)
.attr({
src: '/static/oxjs/build/png/ox.ui/videoMarker' + titleCase + '.png'
src: Ox.UI.PATH + 'png/ox.ui/videoMarker' + titleCase + '.png'
})
.appendTo(that.$element);
setMarkerPoint(i);
@ -13016,7 +12975,7 @@ requires
self.$cuts[i] = $('<img>')
.addClass('OxCut')
.attr({
src: '/static/oxjs/build/png/ox.ui/videoMarkerCut.png'
src: Ox.UI.PATH + 'png/ox.ui/videoMarkerCut.png'
})
.css({
left: (v * self.fps) + 'px'
@ -13027,7 +12986,7 @@ requires
self.$markerPosition = $('<img>')
.addClass('OxMarkerPosition')
.attr({
src: '/static/oxjs/build/png/ox.ui/videoMarkerPlay.png'
src: Ox.UI.PATH + 'png/ox.ui/videoMarkerPlay.png'
})
.appendTo(that.$element);
setMarker();
@ -13036,7 +12995,7 @@ requires
self.$markerPoint[i] = $('<img>')
.addClass('OxMarkerPoint' + v)
.attr({
src: '/static/oxjs/build/png/ox.ui/videoMarker' + v + '.png'
src: Ox.UI.PATH + 'png/ox.ui/videoMarker' + v + '.png'
})
.appendTo(self.$timeline);
setMarkerPoint(i);
@ -13217,7 +13176,7 @@ requires
self.$markerPosition = $('<img>')
.addClass('OxMarkerPosition')
.attr({
src: '/static/oxjs/build/png/ox.ui/videoMarkerPlay.png'
src: Ox.UI.PATH + 'png/ox.ui/videoMarkerPlay.png'
})
.css({
position: 'absolute',
@ -13234,7 +13193,7 @@ requires
self.$markerPoint[i] = $('<img>')
.addClass('OxMarkerPoint' + titleCase)
.attr({
src: '/static/oxjs/build/png/ox.ui/videoMarker' + titleCase + '.png'
src: Ox.UI.PATH + 'png/ox.ui/videoMarker' + titleCase + '.png'
})
.appendTo(that.$element);
setMarkerPoint(i);
@ -13698,7 +13657,7 @@ requires
function getSizes(scrollbarIsVisible) {
//Ox.print('getSizes', scrollbarIsVisible)
var scrollbarWidth = oxui.scrollbarSize,
var scrollbarWidth = Ox.UI.SCROLLBAR_SIZE,
contentWidth = self.options.width -
(self.options.showAnnotations * self.options.annotationsSize) - 1 -
(scrollbarIsVisible ? scrollbarWidth : 0),
@ -14034,7 +13993,7 @@ requires
self.$markerPoint[point][edge] = $('<img>')
.addClass('OxMarkerPoint OxMarker' + titleCase)
.attr({
src: '/static/oxjs/build/png/ox.ui/videoMarker' + titleCase + '.png' // fixme: remove static path
src: Ox.UI.PATH + 'png/ox.ui/videoMarker' + titleCase + '.png'
})
.hide()
.appendTo(that.$element);
@ -14968,11 +14927,11 @@ requires
that.show = function(x, y) {
var left, top, width, height;
$('.OxTooltip').remove(); // fixme: don't use dom
that.appendTo($body);
that.appendTo(Ox.UI.$body);
width = that.width();
height = that.height();
left = Ox.limit(x - width / 2, 0, $document.width() - width);
top = y > $document.height() - height - 16 ? y - 32 : y + 16;
left = Ox.limit(x - width / 2, 0, Ox.UI.$document.width() - width);
top = y > Ox.UI.$document.height() - height - 16 ? y - 32 : y + 16;
that.css({
left: left + 'px',
top: top + 'px'