From e52b06d722ffc3b93ca2d475200731a9bb266b81 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sun, 14 Aug 2011 16:57:46 +0100 Subject: [PATCH] More cleanup work on the notes javascript --- public/javascripts/notes.js | 1126 +++++++++++++++++------------------ 1 file changed, 550 insertions(+), 576 deletions(-) diff --git a/public/javascripts/notes.js b/public/javascripts/notes.js index b538cc801..2dc756bdc 100644 --- a/public/javascripts/notes.js +++ b/public/javascripts/notes.js @@ -1,16 +1,16 @@ /* - Dervied from the OpenStreetBugs client, which is available - under the following license. - - This OpenStreetBugs client is free software: you can redistribute it - and/or modify it under the terms of the GNU Affero General Public License - as published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - This file is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public - License for more details. + Dervied from the OpenStreetBugs client, which is available + under the following license. + + This OpenStreetBugs client is free software: you can redistribute it + and/or modify it under the terms of the GNU Affero General Public License + as published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This file is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public + License for more details. */ OpenLayers.Layer.Notes = new OpenLayers.Class(OpenLayers.Layer.Markers, { @@ -42,7 +42,7 @@ OpenLayers.Layer.Notes = new OpenLayers.Class(OpenLayers.Layer.Markers, { * @var OpenLayers.Icon */ iconOpen : new OpenLayers.Icon("/images/open_note_marker.png", new OpenLayers.Size(22, 22), new OpenLayers.Pixel(-11, -11)), - + /** * The icon to be used for a closed note. * @@ -63,34 +63,13 @@ OpenLayers.Layer.Notes = new OpenLayers.Class(OpenLayers.Layer.Markers, { * @var Boolean */ readonly : false, - + /** * When the layer is hidden, all open popups are stored in this * array in order to be re-opened again when the layer is made * visible again. */ reopenPopups : [ ], - - /** - * The user name will be saved in a cookie if this isn’t set to false. - * - * @var Boolean - */ - setCookie : true, - - /** - * The lifetime of the user name cookie in days. - * - * @var Number - */ - cookieLifetime : 1000, - - /** - * The path where the cookie will be available on this server. - * - * @var String - */ - cookiePath : null, /** * A URL to append lon=123&lat=123&zoom=123 for the Permalinks. @@ -109,41 +88,33 @@ OpenLayers.Layer.Notes = new OpenLayers.Class(OpenLayers.Layer.Markers, { /** * @param String name */ - initialize : function(name, options) - { - OpenLayers.Layer.Markers.prototype.initialize.apply(this, [ name, OpenLayers.Util.extend({ opacity: 0.7, projection: new OpenLayers.Projection("EPSG:4326") }, options) ]); - putAJAXMarker.layers.push(this); - this.events.addEventType("markerAdded"); - - this.events.register("visibilitychanged", this, this.updatePopupVisibility); - this.events.register("visibilitychanged", this, this.loadNotes); - - var cookies = document.cookie.split(/;\s*/); - for(var i=0; i/); for(var i=0; i").replace(/&/g, "&"); + comments[i] = comments[i].replace(/"/g, "\"").replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&"); putAJAXMarker.notes[id] = [ - new OpenLayers.LonLat(lon, lat), - comments, - closed + new OpenLayers.LonLat(lon, lat), + comments, + closed ]; for(var i=0; i