X-Git-Url: https://dev.renevier.net/?a=blobdiff_plain;f=public%2Fjs%2Fsyj.js;h=4b62b84e1faccc90b9a538fd9393f018636598f2;hb=4f977dedcaec8928890a94d7fc80d5c8925befed;hp=85db31ac775e901508f4b65116bf498449d94fcb;hpb=d52fa81549b32a16a59b17732adb19a0c6559cc1;p=syj.git diff --git a/public/js/syj.js b/public/js/syj.js index 85db31a..4b62b84 100644 --- a/public/js/syj.js +++ b/public/js/syj.js @@ -6,6 +6,8 @@ OpenLayers.Console.userError = function(error) { SYJView.messenger.setMessage(error, "error"); }; +OpenLayers.Layer.Vector.prototype.renderers = ["SVG2", "VML", "Canvas"]; + var SyjSaveUI = { status: "unknown", @@ -292,7 +294,7 @@ var SYJView = { 'http://a.tile.openstreetmap.org/${z}/${x}/${y}.png', 'http://b.tile.openstreetmap.org/${z}/${x}/${y}.png', 'http://c.tile.openstreetmap.org/${z}/${x}/${y}.png'], - { wrapDateLine: true , attribution: SyjStrings.osmAttribution }); + { attribution: SyjStrings.osmAttribution }); layerOptions = {format: OpenLayers.Format.WKT, projection: WGS84, @@ -305,7 +307,7 @@ var SYJView = { if ($("edit-btn")) { $("edit-btn").observe('click', function() { $("geom_submit").value = SyjStrings.editAction; - this.messenger.hide(); + this.messenger.clearMessages(); this.editMode(); this.mode = 'edit'; }.bind(this)); @@ -314,7 +316,7 @@ var SYJView = { if ($("create-btn")) { $("create-btn").observe('click', function() { $("geom_submit").value = SyjStrings.createAction; - this.messenger.hide(); + this.messenger.clearMessages(); this.editMode(); this.mode = 'create'; }.bind(this)); @@ -324,7 +326,7 @@ var SYJView = { $("clone-btn").observe('click', function() { $("geom_submit").value = SyjStrings.cloneAction; $("geom_title").value = ""; - this.messenger.hide(); + this.messenger.clearMessages(); this.editMode(); this.mode = 'create'; }.bind(this)); @@ -450,18 +452,11 @@ var SYJView = { } else { this.map.setCenter(center, zoom); } - this.resizeMap(); - }, - - resizeMap: function() { - var map = $('map'); - map.style.width = map.offsetWidth.toString() + 'px'; - map.style.height = map.offsetHeight.toString() + 'px'; }, observer: function(evt) { if (evt.eventName === "simplebox:shown" && evt.memo.element !== $("termsofusearea")) { - this.messenger.hide(); + this.messenger.clearMessages(); } }, @@ -497,7 +492,7 @@ var SYJView = { } this.needsFormResubmit = false; SyjSaveUI.disable.bind(SyjSaveUI).defer(); - this.messenger.hide(); + this.messenger.clearMessages(); return true; }, @@ -576,7 +571,7 @@ var SYJView = { } }, create: function(f, line) { - this.messenger.hide(); + this.messenger.clearMessages(); $("geom_upload_container").hide(); }.bind(this) }, @@ -745,7 +740,7 @@ var SYJModalClass = Class.create({ }, reset: function() { - this.messenger.hide(); + this.messenger.clearMessages(); this.area.select('.message').invoke('setMessageStatus', null); } }); @@ -803,7 +798,7 @@ var SYJUserClass = Class.create(SYJModalClass, { }, presubmit: function() { - this.messenger.hide(); + this.messenger.clearMessages(); PseudoChecker.reset(); if (!(this.checkNotEmpty("user_pseudo", SyjStrings.userEmptyWarn))) { return false; @@ -921,7 +916,7 @@ var SYJLoginClass = Class.create(SYJModalClass, { }, presubmit: function() { - this.messenger.hide(); + this.messenger.clearMessages(); if (!(this.checkNotEmpty("login_user", SyjStrings.userEmptyWarn))) { return false; } @@ -1293,7 +1288,3 @@ window.onbeforeunload = function() { return undefined; } }; - -window.onresize = function() { - SYJView.resizeMap(); -};