X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/2b3846bf0747c3cd6a6a324d06d1e7241165b9f4..2bceba38bad5dfcf70023da99d17a5953183cd84:/public/javascripts/notes.js?ds=sidebyside
diff --git a/public/javascripts/notes.js b/public/javascripts/notes.js
index b538cc801..626a16901 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.
*
@@ -50,6 +50,13 @@ OpenLayers.Layer.Notes = new OpenLayers.Class(OpenLayers.Layer.Markers, {
*/
iconClosed : new OpenLayers.Icon("/images/closed_note_marker.png", new OpenLayers.Size(22, 22), new OpenLayers.Pixel(-11, -11)),
+ /**
+ * The icon to be used when adding a new note.
+ *
+ * @var OpenLayers.Icon
+ */
+ iconNew : new OpenLayers.Icon("/images/new_note_marker.png", new OpenLayers.Size(22, 22), new OpenLayers.Pixel(-11, -11)),
+
/**
* The projection of the coordinates sent by the OpenStreetMap API.
*
@@ -63,34 +70,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 +95,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