This commit is contained in:
rolux 2013-12-06 22:15:04 +01:00
parent a97170ea5b
commit 37ab78f05b
7 changed files with 22 additions and 23 deletions

View file

@ -413,11 +413,11 @@ Ox.load.UI = function(options, callback) {
Ox.UI.PATH = Ox.PATH + 'Ox.UI/'; Ox.UI.PATH = Ox.PATH + 'Ox.UI/';
//@ Ox.UI.SCOLLBAR_SIZE <str> size of scrollbar //@ Ox.UI.SCOLLBAR_SIZE <str> size of scrollbar
Ox.UI.SCROLLBAR_SIZE = $.browser.webkit ? 8 : (function() { Ox.UI.SCROLLBAR_SIZE = $.browser.webkit ? 8 : (function() {
var inner = $('<p>').css({ var inner = Ox.$('<p>').css({
height: '200px', height: '200px',
width: '100%' width: '100%'
}), }),
outer = $('<div>').css({ outer = Ox.$('<div>').css({
height: '150px', height: '150px',
left: 0, left: 0,
overflow: 'hidden', overflow: 'hidden',
@ -426,8 +426,7 @@ Ox.load.UI = function(options, callback) {
visibility: 'hidden', visibility: 'hidden',
width: '200px' width: '200px'
}).append(inner).appendTo($('body')), }).append(inner).appendTo($('body')),
width; width = inner[0].offsetWidth;
width = inner[0].offsetWidth;
outer.css({overflow: 'scroll'}); outer.css({overflow: 'scroll'});
width = 1 + width - (inner[0].offsetWidth == width width = 1 + width - (inner[0].offsetWidth == width
? outer[0].clientWidth : inner[0].offsetWidth); ? outer[0].clientWidth : inner[0].offsetWidth);

View file

@ -361,7 +361,7 @@ Ox.Map = function(options, self) {
bottom: 0 bottom: 0
}) })
.appendTo(that); .appendTo(that);
self.$placeFlag = $('<img>') self.$placeFlag = Ox.$('<img>')
.addClass('OxFlag') .addClass('OxFlag')
.attr({ .attr({
src: Ox.PATH + 'Ox.Geo/png/icons/16/NTHH.png' src: Ox.PATH + 'Ox.Geo/png/icons/16/NTHH.png'
@ -1252,7 +1252,7 @@ Ox.Map = function(options, self) {
.data({country: country}) .data({country: country})
.empty() .empty()
.append( .append(
$('<img>').attr({ Ox.$('<img>').attr({
src: Ox.getFlagByGeoname(place.geoname, 16) src: Ox.getFlagByGeoname(place.geoname, 16)
}) })
) )
@ -1602,7 +1602,7 @@ Ox.Map = function(options, self) {
self.$placeControls.name.options({title: value}); self.$placeControls.name.options({title: value});
} else if (key == 'geoname') { } else if (key == 'geoname') {
self.$placeControls.flag.empty().append( self.$placeControls.flag.empty().append(
$('<img>').attr({ Ox.$('<img>').attr({
src: Ox.getFlagByGeoname(value, 16) src: Ox.getFlagByGeoname(value, 16)
}) })
); );

View file

@ -79,7 +79,7 @@ Ox.MapEditor = function(options, self) {
{ {
format: function(value, data) { format: function(value, data) {
return data.type return data.type
? $('<img>') ? Ox.$('<img>')
.attr({ .attr({
src: Ox.getFlagByGeoname(data.geoname, 16) src: Ox.getFlagByGeoname(data.geoname, 16)
}) })
@ -121,7 +121,7 @@ Ox.MapEditor = function(options, self) {
} }
}); });
return data.type return data.type
? $('<div>') ? Ox.$('<div>')
.addClass('OxTypeIcon') .addClass('OxTypeIcon')
.css({ .css({
width: iconSize + 'px', width: iconSize + 'px',
@ -148,7 +148,7 @@ Ox.MapEditor = function(options, self) {
format: function(value, data) { format: function(value, data) {
return data.type return data.type
? value ? value
: $('<span>').addClass('OxWarning').html(value); : Ox.$('<span>').addClass('OxWarning').html(value);
}, },
id: 'name', id: 'name',
operator: '+', operator: '+',
@ -427,7 +427,7 @@ Ox.MapEditor = function(options, self) {
self.$placeTitlebar = Ox.Bar({ self.$placeTitlebar = Ox.Bar({
size: 24 size: 24
}); });
self.$placeTitle = $('<div>') self.$placeTitle = Ox.$('<div>')
.hide() .hide()
.appendTo(self.$placeTitlebar); .appendTo(self.$placeTitlebar);
if (self.options.mode == 'define') { if (self.options.mode == 'define') {
@ -443,7 +443,7 @@ Ox.MapEditor = function(options, self) {
.hide() .hide()
.appendTo(self.$placeTitle); .appendTo(self.$placeTitle);
} }
self.$placeFlag = $('<img>') self.$placeFlag = Ox.$('<img>')
.addClass('OxFlag') .addClass('OxFlag')
.attr({ .attr({
src: Ox.getFlagByGeoname('', 16) src: Ox.getFlagByGeoname('', 16)

View file

@ -37,7 +37,7 @@ Ox.MainMenu = function(options, self) {
}); });
if (self.options.extras.length) { if (self.options.extras.length) {
that.extras = $('<div>') that.extras = Ox.$('<div>')
.addClass('OxExtras') .addClass('OxExtras')
.appendTo(that); .appendTo(that);
self.options.extras.forEach(function(extra) { self.options.extras.forEach(function(extra) {
@ -49,7 +49,7 @@ Ox.MainMenu = function(options, self) {
that.titles[position] = $('<div>') that.titles[position] = $('<div>')
.addClass('OxTitle') .addClass('OxTitle')
.html(menu.title) .html(menu.title)
.data('position', position); .data({position: position});
if (position == 0) { if (position == 0) {
if (that.titles.length == 1) { if (that.titles.length == 1) {
that.titles[position].appendTo(that); that.titles[position].appendTo(that);

View file

@ -66,7 +66,7 @@ Ox.MenuButton = function(options, self) {
}); });
if (self.options.type == 'text') { if (self.options.type == 'text') {
self.$title = $('<div>') self.$title = Ox.$('<div>')
.addClass('OxTitle') .addClass('OxTitle')
.css({width: self.options.width - 24 + 'px'}) .css({width: self.options.width - 24 + 'px'})
.html(self.options.title) .html(self.options.title)

View file

@ -71,7 +71,7 @@ Ox.MenuItem = function(options, self) {
} }
that.append( that.append(
that.$status = $('<td>') that.$status = Ox.$('<td>')
.addClass('OxCell OxStatus') .addClass('OxCell OxStatus')
.html(self.options.checked ? Ox.UI.symbols.check : '') .html(self.options.checked ? Ox.UI.symbols.check : '')
) )
@ -80,12 +80,12 @@ Ox.MenuItem = function(options, self) {
.addClass('OxCell OxIcon') .addClass('OxCell OxIcon')
.append( .append(
self.options.icon self.options.icon
? $('<img>').attr({src: self.options.icon}) ? Ox.$('<img>').attr({src: self.options.icon})
: null : null
) )
) )
.append( .append(
that.$title = $('<td>') that.$title = Ox.$('<td>')
.addClass('OxCell OxTitle') .addClass('OxCell OxTitle')
.css( .css(
self.options.maxWidth self.options.maxWidth
@ -110,12 +110,12 @@ Ox.MenuItem = function(options, self) {
: ( : (
Ox.isString(self.options.title[0]) Ox.isString(self.options.title[0])
? self.options.title[0] ? self.options.title[0]
: $('<div>').html(self.options.title[0]).html() : Ox.$('<div>').html(self.options.title[0]).html()
) )
) )
) )
.append( .append(
that.$modifiers = $('<td>') that.$modifiers = Ox.$('<td>')
.addClass('OxCell OxModifiers') .addClass('OxCell OxModifiers')
.html( .html(
self.options.keyboard.modifiers.map(function(modifier) { self.options.keyboard.modifiers.map(function(modifier) {
@ -124,7 +124,7 @@ Ox.MenuItem = function(options, self) {
) )
) )
.append( .append(
that.$key = $('<td>') that.$key = Ox.$('<td>')
.addClass( .addClass(
'OxCell Ox' + (self.options.items.length ? 'Submenu' : 'Key') 'OxCell Ox' + (self.options.items.length ? 'Submenu' : 'Key')
) )

View file

@ -49,11 +49,11 @@ Ox.VideoPreview = function(options, self) {
self.loaded = []; self.loaded = [];
self.queue = []; self.queue = [];
self.$frameElement = $('<div>') self.$frameElement = Ox.$('<div>')
.addClass('OxFrame') .addClass('OxFrame')
.appendTo(that); .appendTo(that);
self.$frame = $('<img>') self.$frame = Ox.$('<img>')
.attr({src: self.options.getFrame(self.options.position)}) .attr({src: self.options.getFrame(self.options.position)})
.css(getFrameCSS()) .css(getFrameCSS())
.appendTo(self.$frameElement); .appendTo(self.$frameElement);