diff --git a/source/Ox.Geo/json/Ox.Geo.json b/source/Ox.Geo/json/Ox.Geo.json index 64775d8e..f899eb2b 100644 --- a/source/Ox.Geo/json/Ox.Geo.json +++ b/source/Ox.Geo/json/Ox.Geo.json @@ -4438,7 +4438,7 @@ "dissolved": [], "east": 7.2271405, "flagURL": "http://upload.wikimedia.org/wikipedia/commons/2/20/Flag_of_the_Netherlands.svg", - "googleName": "Netherlands", + "googleName": "The Netherlands", "imdbCode": "nl", "imdbName": "Netherlands", "languages": [ diff --git a/source/Ox.UI/css/Ox.UI.css b/source/Ox.UI/css/Ox.UI.css index e9dce39b..5f73afb3 100644 --- a/source/Ox.UI/css/Ox.UI.css +++ b/source/Ox.UI/css/Ox.UI.css @@ -1255,15 +1255,37 @@ Maps border-radius: 0; } -input[type=image].OxMapButton { +.OxMap .OxButton.OxMapControl { position: absolute; width: 10px; height: 10px; padding: 1px; border-width: 2px; } -.OxMapLabel { +.OxMap .OxButton.OxMapControl.OxMapButtonCenter { + left: 24px; + top: 24px; +} +.OxMap .OxButton.OxMapControl.OxMapButtonEast { + left: 44px; + top: 24px; +} +.OxMap .OxButton.OxMapControl.OxMapButtonNorth { + left: 24px; + top: 4px; +} +.OxMap .OxButton.OxMapControl.OxMapButtonSouth { + left: 24px; + top: 44px; +} +.OxMap .OxButton.OxMapControl.OxMapButtonWest { + left: 4px; + top: 24px; +} +.OxMap .OxLabel.OxMapControl { position: absolute; + right: 4px; + top: 4px; height: 12px; font-size: 10px; border-width: 2px; diff --git a/source/Ox.UI/js/Form/Ox.Select.js b/source/Ox.UI/js/Form/Ox.Select.js index 41ea4c63..cc2dd4b9 100644 --- a/source/Ox.UI/js/Form/Ox.Select.js +++ b/source/Ox.UI/js/Form/Ox.Select.js @@ -105,8 +105,8 @@ Ox.Select = function(options, self) { )) + 'px' }) .html( - self.options.title ? self.options.title : - self.options.items[self.checked[0]].title + self.options.title ? self.options.title + : self.options.items[self.checked[0]].title ) .click(showMenu) .appendTo(that.$element); diff --git a/source/Ox.UI/js/Map/Ox.Map.js b/source/Ox.UI/js/Map/Ox.Map.js index 552ded21..0e1f9397 100644 --- a/source/Ox.UI/js/Map/Ox.Map.js +++ b/source/Ox.UI/js/Map/Ox.Map.js @@ -118,7 +118,7 @@ Ox.Map = function(options, self) { }) .bindEvent({ key_0: function() { - that.panToPlace() + panToPlace() }, key_down: function() { pan(0, 1); @@ -158,7 +158,7 @@ Ox.Map = function(options, self) { pan(0, 2); }, key_shift_0: function() { - that.zoomToPlace(); + zoomToPlace(); }, key_shift_equal: function() { zoom(2); @@ -211,18 +211,41 @@ Ox.Map = function(options, self) { }) .appendTo(that); self.$select = Ox.Select({ - items: [ - {id: 'new Place', title: 'New Place...', keyboard: 'n'}, - {}, - {id: 'toggleLabels', title: 'Show Labels', keyboard: 'l', checked: self.options.showLabels}, - {id: 'toggleControls', title: 'Show Controls', keyboard: 'c', checked: self.options.showControls}, - ], - min: 0, - max: 2, + items: Ox.merge( + self.options.editable + ? [{id: 'new Place', title: 'New Place...', keyboard: 'n'}, {}] + : [], + [ + { + id: 'toggleLabels', + title: self.options.showLabels + ? ['Hide Labels', 'Show Labels'] + : ['Show Labels', 'Hide Labels'], + keyboard: 'l' + }, + { + id: 'toggleControls', + title: self.options.showLabels + ? ['Hide Controls', 'Show Controls'] + : ['Show Controls', 'Hide Controls'], + keyboard: 'c' + } + ] + ), + selectable: false, title: 'Options...', width: 96 }) .css({float: 'left', margin: '4px'}) + .bindEvent({ + click: function(data) { + if (data.id == 'toggleLabels') { + toggleLabels(); + } else if (data.id == 'toggleControls') { + toggleControls(); + } + } + }) .appendTo(self.$toolbar); /* self.$labelsButton = Ox.Checkbox({ @@ -306,66 +329,82 @@ Ox.Map = function(options, self) { .appendTo(self.$statusbar); } - self.$navigationButtons = { + self.$controls = { 'center': Ox.Button({ - title: 'close', + title: 'center', type: 'image' }) - .addClass('OxMapButton') - .css({ - left: '24px', - top: '24px' + .addClass('OxMapControl OxMapButtonCenter') + .bindEvent({ + singleclick: function() { + panToPlace(); + }, + doubleclick: function() { + zoomToPlace(); + } }), 'east': Ox.Button({ title: 'right', type: 'image' }) - .addClass('OxMapButton') - .css({ - left: '44px', - top: '24px', + .addClass('OxMapControl OxMapButtonEast') + .bindEvent({ + singleclick: function() { + pan(1, 0); + }, + doubleclick: function() { + pan(2, 0); + } }), 'north': Ox.Button({ title: 'up', type: 'image' }) - .addClass('OxMapButton') - .css({ - left: '24px', - top: '4px', + .addClass('OxMapControl OxMapButtonNorth') + .bindEvent({ + singleclick: function() { + pan(0, -1); + }, + doubleclick: function() { + pan(0, -2); + } }), 'south': Ox.Button({ title: 'down', type: 'image' }) - .addClass('OxMapButton') - .css({ - left: '24px', - top: '44px', + .addClass('OxMapControl OxMapButtonSouth') + .bindEvent({ + singleclick: function() { + pan(0, 1); + }, + doubleclick: function() { + pan(0, 2); + } }), 'west': Ox.Button({ title: 'left', type: 'image' }) - .addClass('OxMapButton') - .css({ - left: '4px', - top: '24px', + .addClass('OxMapControl OxMapButtonWest') + .bindEvent({ + singleclick: function() { + pan(-1, 0); + }, + doubleclick: function() { + pan(-2, 0); + } + }), + 'scale': Ox.Label({ + textAlign: 'center', + title: '...' // fixme ??? }) + .addClass('OxMapControl') }; - Ox.forEach(self.$navigationButtons, function($button) { - $button.attr({ - src: $button.attr('src').replace('/classic/', '/modern/') - }); + !self.options.showControls && Ox.forEach(self.$controls, function($control) { + $control.css({opacity: 0}).hide(); }); - self.$scaleLabel = Ox.Label({ - textAlign: 'center', - title: '...' // fixme ??? - }) - .addClass('OxMapLabel') - .css({right: '4px', top: '4px'}); - if (!self.isAsync) { self.options.places.forEach(function(place) { if (Ox.isUndefined(place.id)) { @@ -755,10 +794,9 @@ Ox.Map = function(options, self) { function tilesLoaded() { // fixme: can add earlier, use don't replace map contents option - Ox.forEach(self.$navigationButtons, function(button) { - button.appendTo(self.$map); + Ox.forEach(self.$controls, function($control) { + $control.appendTo(self.$map); }); - self.$scaleLabel.appendTo(self.$map); } } @@ -862,6 +900,11 @@ Ox.Map = function(options, self) { self.map.panBy(x * self.$map.width() / 2, y * self.$map.height() / 2); }; + function panToPlace() { + var place = getSelectedPlace(); + place && self.map.panTo(place.center); + } + function parseGeodata(data) { var bounds = data.geometry.bounds || data.geometry.viewport, northEast = bounds.getNorthEast(), @@ -1043,7 +1086,7 @@ Ox.Map = function(options, self) { }, result.data.items[0])).add(); self.places.push(place); select(); - that.zoomToPlace(); + zoomToPlace(); } }); } @@ -1066,7 +1109,7 @@ Ox.Map = function(options, self) { Ox.forEach(self.scaleMeters, function(meters) { var scaleWidth = Math.round(meters / metersPerPixel); if (scaleWidth <= self.options.width / 2 - 4) { - self.$scaleLabel + self.$controls.scale .options({ title: '\u2190 ' + ( meters > 1000 ? Ox.formatNumber(meters / 1000) + ' k' : meters + ' ' @@ -1123,16 +1166,28 @@ Ox.Map = function(options, self) { }); } - function toggleLabels() { - self.options.showLabels = !self.options.showLabels - //Ox.print('toggle', getMapType()) - self.map.setMapTypeId(google.maps.MapTypeId[getMapType()]); - /* - self.$labelsButton.options({ - title: self.$labelsButton.options('title') == 'Show Labels' ? - 'Hide Labels' : 'Show Labels' + function toggleControls() { + // fixme: that.find() doesn't work here + var $controls = that.$element.find('.OxMapControl'); + self.options.showControls = !self.options.showControls; + if (self.options.showControls) { + $controls.show().animate({opacity: 1}, 250); + } else { + $controls.animate({opacity: 0}, 250, function() { + $controls.hide(); + }); + } + that.triggerEvent('togglecontrols', { + visible: self.options.showControls + }); + } + + function toggleLabels() { + self.options.showLabels = !self.options.showLabels; + self.map.setMapTypeId(google.maps.MapTypeId[getMapType()]); + that.triggerEvent('togglelabels', { + visible: self.options.showLabels }); - */ } function triggerGeocodeEvent(data) { @@ -1209,10 +1264,8 @@ Ox.Map = function(options, self) { } function zoomToPlace() { - Ox.print('zoomToPlace') - if (self.options.selected !== null) { - self.map.fitBounds(getPlaceById(self.options.selected).bounds); - } + var place = getSelectedPlace(); + place && self.map.fitBounds(place.bounds); } self.setOption = function(key, value) { @@ -1276,9 +1329,7 @@ Ox.Map = function(options, self) { }; that.panToPlace = function() { - Ox.print('panToPlace:', self.options.selected) - var place = getSelectedPlace(); - place && self.map.panTo(place.center); + panToPlace(); return that; }; @@ -1348,9 +1399,7 @@ Ox.Map = function(options, self) { } that.zoomToPlace = function() { - Ox.print('zoomToPlace') - var place = getSelectedPlace(); - place && self.map.fitBounds(place.bounds); + zoomToPlace(); return that; }; diff --git a/source/Ox.UI/js/Menu/Ox.MenuItem.js b/source/Ox.UI/js/Menu/Ox.MenuItem.js index def1fed6..e86fe9c0 100644 --- a/source/Ox.UI/js/Menu/Ox.MenuItem.js +++ b/source/Ox.UI/js/Menu/Ox.MenuItem.js @@ -135,7 +135,7 @@ Ox.MenuItem = function(options, self) { toggleTitle toggleTitle @*/ that.toggleTitle = function() { - that.options({title: self.options.title.reverse()}); + that.options({title: Ox.clone(self.options.title).reverse()}); return that; }; diff --git a/source/Ox.UI/js/Video/Ox.VideoEditor.js b/source/Ox.UI/js/Video/Ox.VideoEditor.js index 6bfb5dcd..f41dda52 100644 --- a/source/Ox.UI/js/Video/Ox.VideoEditor.js +++ b/source/Ox.UI/js/Video/Ox.VideoEditor.js @@ -360,21 +360,24 @@ Ox.VideoEditor = function(options, self) { }); self.$videoMenuButton = Ox.Select({ - items: Ox.merge([ - {id: 'toggleSize', title: 'Large Player', selected: self.options.playerSize == 'large', keyboard: 'shift +'}, - {} - ], self.resolutions, [ - {}, - {id: 'largeTimeline', title: 'Hide Large Timeline'}, - {id: 'subtitlesTimeline', title: 'Hide Subtitles on Large Timeline'}, - {}, - {id: 'linkSelection', title: 'Link to Selection...'}, - {id: 'embed', title: 'Embed Selection...'}, - {id: 'downloadSelection', title: 'Download Selection...'}, - {}, - {id: 'keyboard', title: 'Keyboard Shortcuts...', keyboard: 'h'} - - ]), + items: Ox.merge( + [ + {id: 'toggleSize', title: 'Large Player', selected: self.options.playerSize == 'large', keyboard: 'shift +'}, + {} + ], + self.resolutions, + [ + {}, + {id: 'largeTimeline', title: 'Hide Large Timeline'}, + {id: 'subtitlesTimeline', title: 'Hide Subtitles on Large Timeline'}, + {}, + {id: 'linkSelection', title: 'Link to Selection...'}, + {id: 'embed', title: 'Embed Selection...'}, + {id: 'downloadSelection', title: 'Download Selection...'}, + {}, + {id: 'keyboard', title: 'Keyboard Shortcuts...', keyboard: 'h'} + ] + ), selectable: false, title: $('').attr({ src: Ox.UI.getImageURL('symbolSet') diff --git a/source/Ox.UI/themes/classic/css/classic.css b/source/Ox.UI/themes/classic/css/classic.css index f401b9bd..42761923 100644 --- a/source/Ox.UI/themes/classic/css/classic.css +++ b/source/Ox.UI/themes/classic/css/classic.css @@ -443,14 +443,10 @@ Maps ================================================================================ */ -.OxThemeClassic .OxMapButton { - border-color: rgb(255, 255, 255); - background: rgba(0, 0, 0, 0.5); -} -.OxThemeClassic .OxMapLabel { - border-color: rgb(255, 255, 255); - background: rgba(0, 0, 0, 0.5); - color: rgb(255, 255, 255); +.OxThemeClassic .OxMapControl { + border-color: rgb(64, 64, 64); + background: rgba(255, 255, 255, 0.75); + color: rgb(64, 64, 64); } /* diff --git a/source/Ox.UI/themes/classic/svg/symbolCenter.svg b/source/Ox.UI/themes/classic/svg/symbolCenter.svg index df83ecb3..5eb22938 100644 --- a/source/Ox.UI/themes/classic/svg/symbolCenter.svg +++ b/source/Ox.UI/themes/classic/svg/symbolCenter.svg @@ -1,10 +1,3 @@ - - - - - - - - - + + \ No newline at end of file diff --git a/source/Ox.UI/themes/classic/svg/symbolRecord.svg b/source/Ox.UI/themes/classic/svg/symbolRecord.svg new file mode 100644 index 00000000..5eb22938 --- /dev/null +++ b/source/Ox.UI/themes/classic/svg/symbolRecord.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/source/Ox.UI/themes/classic/svg/symbolZoom.svg b/source/Ox.UI/themes/classic/svg/symbolZoom.svg deleted file mode 100644 index be9bb043..00000000 --- a/source/Ox.UI/themes/classic/svg/symbolZoom.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/source/Ox.UI/themes/modern/css/modern.css b/source/Ox.UI/themes/modern/css/modern.css index ce7effa0..3e4f3750 100644 --- a/source/Ox.UI/themes/modern/css/modern.css +++ b/source/Ox.UI/themes/modern/css/modern.css @@ -430,14 +430,10 @@ Maps ================================================================================ */ -.OxThemeModern .OxMapButton { - border-color: rgb(255, 255, 255); +.OxThemeModern .OxMapControl { + border-color: rgb(192, 192, 192); background: rgba(0, 0, 0, 0.5); -} -.OxThemeModern .OxMapLabel { - border-color: rgb(255, 255, 255); - background: rgba(0, 0, 0, 0.5); - color: rgb(255, 255, 255); + color: rgb(192, 192, 192); } /* diff --git a/source/Ox.UI/themes/modern/svg/symbolCenter.svg b/source/Ox.UI/themes/modern/svg/symbolCenter.svg index 6b4b4948..451bccfa 100644 --- a/source/Ox.UI/themes/modern/svg/symbolCenter.svg +++ b/source/Ox.UI/themes/modern/svg/symbolCenter.svg @@ -1,10 +1,3 @@ - - - - - - - - - + + \ No newline at end of file diff --git a/tools/geo/py/fix_json.py b/tools/geo/py/fix_json.py index c160a745..9b606a27 100644 --- a/tools/geo/py/fix_json.py +++ b/tools/geo/py/fix_json.py @@ -1,5 +1,4 @@ import json -import ox f = open('../json/countries.json') data = json.loads(f.read()) diff --git a/tools/geo/py/geo.py b/tools/geo/py/geo.py index aa153bc0..6a94740c 100644 --- a/tools/geo/py/geo.py +++ b/tools/geo/py/geo.py @@ -245,6 +245,7 @@ geo = { 'Kosovo': 'Kosova (Kosovo)', 'Macedonia': 'Former Yugoslav Republic of Macedonia', 'Myanmar': 'Burma', + 'Netherlands': 'The Netherlands', 'Palestine': 'Palestinian Territories', 'Republic of the Congo': 'Congo', 'Sahrawi': 'Western Sahara',