diff --git a/source/Ox.UI/js/Calendar/Ox.Calendar.js b/source/Ox.UI/js/Calendar/Ox.Calendar.js index ad819409..5252449c 100644 --- a/source/Ox.UI/js/Calendar/Ox.Calendar.js +++ b/source/Ox.UI/js/Calendar/Ox.Calendar.js @@ -1216,12 +1216,13 @@ Ox.Calendar = function(options, self) { if (key == 'date') { } else if (key == 'height') { - //that.css({height: self.options.height + 'px'}); + that.css({height: self.options.height + 'px'}); } else if (key == 'selected') { selectEvent(value); } else if (key == 'width') { - //that.css({width: self.options.width + 'px'}); - //self.$zoomInput.options({size: self.options.width}); + that.css({width: self.options.width + 'px'}); + self.options.showZoombar && self.$zoomInput.options({size: self.options.width}); + renderOverlay(); //getLines(); } else if (key == 'zoom') { diff --git a/source/Ox.UI/js/Map/Ox.Map.js b/source/Ox.UI/js/Map/Ox.Map.js index 36327a3d..e104842d 100644 --- a/source/Ox.UI/js/Map/Ox.Map.js +++ b/source/Ox.UI/js/Map/Ox.Map.js @@ -441,7 +441,13 @@ Ox.Map = function(options, self) { }); } - if (!window.googleCallback) { + if (window.google) { + initMap(); + } else if (window.googleCallback) { + (function interval() { + window.google ? initMap() : setTimeout(interval, 100); + }()); + } else { window.googleCallback = function() { delete window.googleCallback; initMap(); @@ -450,10 +456,6 @@ Ox.Map = function(options, self) { document.location.protocol + '//maps.google.com/maps/api/js?callback=googleCallback&sensor=false' ); - } else { - (function interval() { - window.google ? initMap() : setTimeout(interval, 100); - }()); } function addPlaceToMap(place) { @@ -1360,6 +1362,7 @@ Ox.Map = function(options, self) { self.setOption = function(key, value) { if (key == 'height' || key == 'width') { + that.$element.css(key, value + 'px'); that.resizeMap(); } else if (key == 'places') { Ox.print('MAP SET OPTIONS PLACES', value); diff --git a/source/Ox.UI/js/Video/Ox.AnnotationFolder.js b/source/Ox.UI/js/Video/Ox.AnnotationFolder.js index df360803..bfd51047 100644 --- a/source/Ox.UI/js/Video/Ox.AnnotationFolder.js +++ b/source/Ox.UI/js/Video/Ox.AnnotationFolder.js @@ -42,116 +42,115 @@ Ox.AnnotationFolder = function(options, self) { }) .options(options || {}); - Ox.print('SO', self.options) - self.sort = getSort(); self.widget = self.options.type == 'event' ? 'Calendar' : self.options.type == 'place' ? 'Map' : ''; + if (self.widget) { + self.$defineButton = Ox.Button({ + disabled: !self.options.selected, + id: 'define', + style: 'symbol', + title: 'click', + tooltip: 'Define ' + Ox.toTitleCase(self.options.type), + type: 'image' + }) + .bindEvent({ + click: function() { + + } + }); + } + + self.$addButton = Ox.Button({ + disabled: !self.options.editable, + id: 'add', + style: 'symbol', + title: 'add', + tooltip: 'Add ' + self.options.item, + type: 'image' + }).bindEvent({ + click: function() { + that.triggerEvent('add', {value: ''}); + } + }); + that.setElement( Ox.CollapsePanel({ collapsed: self.options.collapsed, extras: Ox.merge( - self.widget ? [ - Ox.MenuButton({ - items: [ - {id: 'show', title: 'Show ' + self.widget, checked: true} - ], - style: 'square', - title: 'set', - type: 'image' - }) - .bindEvent({ - click: function(data) { - - } - }) - ] : [], - self.options.editable ? [ - Ox.Button({ - id: 'add', - style: 'symbol', - title: 'add', - tooltip: 'Add ' + self.options.item, - type: 'image' - }).bindEvent({ - click: function(data) { - that.triggerEvent('add', {value: ''}); - } - }) - ] : [] + self.widget ? [self.$defineButton] : [], + [self.$addButton] ), size: 16, title: self.options.title }) .addClass('OxAnnotationFolder') .bindEvent({ - toggle: togglePanel + toggle: toggleLayer }) ); that.$content = that.$element.$content; if (self.widget) { self.widgetSize = self.options.showWidget * self.options.widgetSize; - } - - if (self.options.type == 'event') { + Ox.print('FOO', self.widgetSize, self.options.showWidget, self.options.widgetSize) self.$outer = Ox.Element() .css({ display: 'table-cell', - width: self.options.width + 'px', - //height: '256px' - }); - self.$calendar = Ox.Calendar({ - events: getEvents(), - height: self.widgetSize, - width: self.options.width - }) - .css({ - width: self.options.width + 'px', - height: self.widgetSize + 'px' - }) - .bindEvent({ - select: function(data) { - selectAnnotation({id: data.annotationId}); - } - }) - .appendTo(self.$outer); - } else if (self.options.type == 'place') { - Ox.print('SWS', self.widgetSize) - self.$outer = Ox.Element() - .css({ - display: 'table-cell', - width: self.widgetSize + 'px', + width: self.options.width + 'px' }) .appendTo(that.$content); self.$inner = Ox.Element() - .css({height: self.widgetSize + 'px', overflow: 'hidden'}) + .css({ + height: self.widgetSize + 'px', + overflow: 'hidden' + }) .appendTo(self.$outer); - self.$map = Ox.Map({ - places: getPlaces() - // showLabels: true - }) - .css({height: self.widgetSize + 'px'}) - .bindEvent({ - // FIXME: should be select, not selectplace - selectplace: function(data) { - self.$annotations.options({selected: data.annotationId}); - // selectAnnotation({id: data.annotationId}); - } - }) - .appendTo(self.$inner); - } - - if (self.widget) { - + if (options.type == 'event') { + self.$widget = self.$calendar = Ox.Calendar({ + events: getEvents(), + height: self.widgetSize, + showZoombar: true, + width: self.options.width + }) + .css({ + width: self.options.width + 'px', + height: self.widgetSize + 'px' + }) + .bindEvent({ + select: function(data) { + selectAnnotation({id: data.annotationId}); + } + }) + .appendTo(self.$inner); + } else { // place + self.$widget = self.$map = Ox.Map({ + places: getPlaces(), + // FIXME: should be showZoombar + zoombar: true + // showLabels: true + }) + .css({ + width: self.options.width + 'px', + height: self.widgetSize + 'px' + }) + .bindEvent({ + // FIXME: should be select, not selectplace + selectplace: function(data) { + self.$annotations.options({selected: data.annotationId}); + // selectAnnotation({id: data.annotationId}); + } + }) + .appendTo(self.$inner); + } self.$resizebar = Ox.Element({ tooltip: 'Drag to resize or click to toggle map' // fixme: update as w/ splitpanels }) .addClass('OxResizebar OxHorizontal') .css({ position: 'absolute', - top: self.options.widgetSize + 'px', + top: self.widgetSize + 'px', cursor: 'ns-resize' }) .append($('