Changeset 251
- Timestamp:
- 04/05/10 10:14:32 (22 months ago)
- Location:
- notours/noTours editor
- Files:
-
- 9 added
- 11 modified
-
inc/actualizar_marcador.php (modified) (5 diffs)
-
inc/css/estilo_form.css (modified) (5 diffs)
-
inc/db.php (modified) (2 diffs)
-
inc/eliminar_proyecto.php (modified) (1 diff)
-
inc/feed.php (modified) (2 diffs)
-
inc/js/Gmaps.js (modified) (4 diffs)
-
inc/js/MPolyDragControl.js (modified) (1 diff)
-
inc/js/NotoursObjects.js (modified) (10 diffs)
-
inc/js/notours-ajax-html.js (modified) (8 diffs)
-
inc/js/notours-ajax.js (modified) (17 diffs)
-
inc/pix/blackline_back.png (added)
-
inc/pix/btn_add_project.png (added)
-
inc/pix/btn_add_project_hover.png (added)
-
inc/pix/btn_left.png (added)
-
inc/pix/btn_minimizar.png (added)
-
inc/pix/btn_right.png (added)
-
inc/pix/logo_notours.jpg (added)
-
inc/pix/top_left.png (added)
-
inc/pix/top_right.png (added)
-
index.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
notours/noTours editor/inc/actualizar_marcador.php
r250 r251 13 13 $object_data = array(); 14 14 15 //notours_object id project_id title description class at ributes geodata modified sounds15 //notours_object id project_id title description class attributes geodata modified sounds 16 16 //notours_file id url length type volume angles 17 17 /* … … 22 22 'description' => '', 23 23 'class' => '', 24 'at ributes' => '',24 'attributes' => '', 25 25 'geodata' => '', 26 26 'modified' => '', 27 27 'sounds' => '', 28 28 ); 29 db_update_query($db_tables['objects'], array('project_id' => , 'title' => , 'description' => , 'class' => , 'at ributes' => , 'geodata' => , 'modified' => , 'sounds' => ), $id);30 $id = db_insert_query($db_tables['objects'], array('project_id' => , 'title' => , 'description' => , 'class' => , 'at ributes' => , 'geodata' => , 'modified' => , 'sounds' => ));29 db_update_query($db_tables['objects'], array('project_id' => , 'title' => , 'description' => , 'class' => , 'attributes' => , 'geodata' => , 'modified' => , 'sounds' => ), $id); 30 $id = db_insert_query($db_tables['objects'], array('project_id' => , 'title' => , 'description' => , 'class' => , 'attributes' => , 'geodata' => , 'modified' => , 'sounds' => )); 31 31 32 32 $file_data = array ( … … 57 57 $actualProjectFolder = $_POST['hidden_proyecto'].'/'; 58 58 } 59 if (isset($_POST['hidden_atributos'])) { 60 $object_data['attributes'] = trim($_POST['hidden_atributos']); 61 } 59 62 if ( (isset($_POST['hidden_lat'])) && ($_POST['hidden_lat']!="") && (isset($_POST['hidden_lonx'])) && ($_POST['hidden_lonx']!="") && (isset($_POST['hidden_radio'])) && ($_POST['hidden_radio']!="") ) { 60 63 $object_data['class'] = "soundpoint"; … … 62 65 } 63 66 64 $object_data['modified'] = date("Y-m-d");65 66 67 if (count($object_data)>0) { 68 $object_data['modified'] = date("Y-m-d"); 67 69 // si la id es cero creamos un nuevo marcador 68 70 if ($object_id==0) { … … 111 113 } else { 112 114 $error = array ( 113 "msg" => "<p>datos: ".count($object_data)."<br />Algo va mal!</p> \n"115 "msg" => "<p>datos: ".count($object_data)."<br />Algo va mal!</p>" 114 116 ); 115 117 echo json_encode($error); -
notours/noTours editor/inc/css/estilo_form.css
r250 r251 1 /* ___________________________________________________________________ Xenericos ________________ */ 1 2 body { 2 width: !00%;3 width: 100%; 3 4 height: 100%; 4 margin: 0;5 margin: 8px; 5 6 font-size:0.88em; 6 7 font-family: helvetica, verdana; 7 8 letter-spacing: 0.03em; 8 9 } 9 h4 { 10 display: inline; 11 line-height: 200%; 12 } 13 label { 14 /*display: none;*/ 15 display: inline; 16 line-height: 200%; 17 } 18 ul { 19 list-style-type: none; 20 margin: 0; 21 padding: 0 8px; 22 } 23 li { 24 background-color: #fff; 25 margin-top: 8px; 26 padding: 8px; 27 } 28 29 li.proyecto { 30 padding: 0; 31 height: 52px; 32 } 10 11 h4 {display:inline; line-height:200%;} 12 img {border:none} 13 label {display:inline; line-height:200%;} 14 fieldset{border:none;} 15 ul {list-style-type:none; margin:0; padding:0 8px; } 16 li {background-color:#fff; margin-top:8px; padding:8px;} 17 18 li.proyecto {padding: 0;height: 52px;} 33 19 li.proyecto input, li.proyecto label { 34 20 line-height: 52px; … … 37 23 float: left; 38 24 } 39 li.proyecto input { 40 height: 50px; 41 margin: 0 5px; 42 } 43 li.proyecto .icono { 44 width: 52px; 45 height: 52px; 46 float: left; 47 } 48 49 fieldset{ 50 border: none; 51 } 25 li.proyecto input {height:50px; margin:0 5px;} 26 li.proyecto .icono {width:52px; height:52px; float:left;} 27 52 28 /*fieldset de formularios con texto azul agochado*/ 53 29 .corregir_proyecto .enviar_formulario { … … 72 48 } 73 49 74 #panel_control { 75 } 76 #proyectos, #marcadores { 77 width: 391px; 78 margin: 8px; 79 background-color: #ccc; 80 } 81 #marcadores { 82 overflow: auto; 83 position: absolute; 84 top: 30px; 85 bottom: 0; 86 left: 0; 87 } 50 #cabeceira{padding:20px 0 10px 10px; } 51 52 #proyectos, #marcadores {width: 390px;} 53 #marcadores {overflow: auto; position: absolute; top:116px; bottom: 0; background-color:#ddd;} 54 88 55 #pestanhaMapa { 89 position: absolute; 90 top: 8px; 91 right: 8px; 92 left: 408px; 93 } 56 position: absolute; 57 top:8px; 58 right:8px; 59 left:408px; 60 background-image:none; 61 } 62 94 63 #cajaMapa { 95 64 position: absolute; 96 top: 34px;65 top: 49px; 97 66 bottom: 128px; 98 67 right: 8px; … … 114 83 } 115 84 116 #mapa_marcadores { 117 width: 100%; 118 height: 100%; 119 } 85 #mapa_marcadores {width: 100%; height: 100%;} 120 86 121 87 .pestanha { 122 height: 26px;88 height: 41px; 123 89 overflow: hidden; 124 background-color: #000; 90 background-color:none; 91 background-image:url(../pix/blackline_back.png); 125 92 font-weight: bold; 126 93 color: #ccc; 127 94 } 128 .pestanha span { 129 line-height: 26px; 130 vertical-align: middle; 131 margin-left: 8px; 132 } 133 #proyectos .contenedor_nombre div { 134 /*display: inline;*/ 135 float: left; 136 padding: 3px 0; 137 width: 240px; 138 } 139 #proyectos .contenedor_nombre div .valor { 140 vertical-align: middle; 141 line-height: 20px; 142 } 143 #proyectos .contenedor_nombre div input { 144 /*display: inline;*/ 145 font-size: 0.8em; 146 margin-left: 3px; 147 height: 20px; 148 width: 240px; 149 } 150 #proyectos .contenedor_nombre div.agochado { 151 /*display: none;*/ 152 float: left; 153 } 95 .pestanha .top_left{background-image:url(../pix/top_left.png); float:left; height:41px; width:20px} 96 .pestanha .top_right{background-image:url(../pix/top_right.png); float:right; height:41px; width:280px} 97 .pestanha .top_middle{background-color:#000; margin-left:10px; height:41px; width:95%} 98 99 .pestanha span {line-height: 26px; vertical-align: middle; margin-left: 8px;} 100 101 #proyectos .contenedor_nombre{padding:10px} 102 #proyectos .contenedor_nombre div {float: left; padding: 3px 0; width: 240px;} 103 #proyectos .contenedor_nombre div .valor {vertical-align: middle; line-height: 20px;} 104 #proyectos .contenedor_nombre div input {font-size: 0.8em; margin-left: 3px; height: 20px; width: 240px;} 105 #proyectos .contenedor_nombre div.agochado {float: left;} 106 #proyectos .contenedor_nombre li{display:block; background-color:none; width:25px; height:18px; margin-right:10px} 107 #proyectos .contenedor_nombre li.next{background:url(../pix/btn_right.png) no-repeat;} 108 #proyectos .contenedor_nombre li.back{background:url(../pix/btn_left.png) no-repeat;} 109 #proyectos .contenedor_nombre li.toogle{background:url(../pix/btn_minimizar.png) no-repeat;} 110 #proyectos .contenedor_nombre li.novo{ 111 background:url(../pix/btn_add_project.png) no-repeat; 112 position:absolute; 113 top:6px; 114 left:370px; 115 width:91px; 116 height:99px; 117 } 118 #proyectos .contenedor_nombre li.novo:hover{background-position:-92px top;} 119 154 120 /*#proyectos .contenedor_nombre span*/ 155 121 .toogle, .next, .back, .novo { … … 166 132 overflow: hidden; 167 133 height: 285px; 134 background-color:#ddd; 168 135 } 169 136 .recuadro { -
notours/noTours editor/inc/db.php
r250 r251 408 408 } else { 409 409 mysql_select_db ($db['data'], $link); 410 $dosql = "SELECT * FROM `".$db_tables['objects']."` WHERE `project_id`=".$id." ORDER BY `id` ASC";410 $dosql = "SELECT * FROM `".$db_tables['objects']."` WHERE `project_id`=".$id." ORDER BY `id` DESC"; 411 411 $result = mysql_query ($dosql); 412 412 while ($row = mysql_fetch_array($result)) { … … 436 436 "description" => $row['description'], 437 437 "class" => $row['class'], 438 "at ributes" => $row['atributes'],438 "attributes" => $row['attributes'], 439 439 "geodata" => $row['geodata'], 440 440 "modified" => $row['modified'], -
notours/noTours editor/inc/eliminar_proyecto.php
r250 r251 8 8 header("Content-type: text/html; charset=utf-8"); 9 9 10 if ( (isset($_ GET['hidden_id'])) && ($_GET['hidden_id']!="") ) {10 if ( (isset($_POST['hidden_id'])) && ($_POST['hidden_id']!="") ) { 11 11 // leemos las variables recibidas desde el formulario mediante el metodo POST 12 $id = $_ GET['hidden_id'];12 $id = $_POST['hidden_id']; 13 13 // eliminamos la entrada: 14 14 $data = db_delete_project($id); -
notours/noTours editor/inc/feed.php
r250 r251 49 49 if ($objects_data[$i]["class"]=="soundpoint") { 50 50 $enclosure = "\t\t\t<enclosure url=\"".$root.$projectFolder.$project_data["id"]."/".$soundFolder.$objects_data[$i]["sounds"][0]["url"]."\" length=\"".$objects_data[$i]["sounds"][0]["length"]."\" type=\"".$objects_data[$i]["sounds"][0]["type"]."\" />\n"; 51 $extra .= soundpoint_tag($objects_data[$i]["sounds"], $objects_data[$i]["at ributes"]);51 $extra .= soundpoint_tag($objects_data[$i]["sounds"], $objects_data[$i]["attributes"]); 52 52 } else if ($objects_data[$i]["class"]=="soundscape") { 53 53 $enclosure = "\t\t\t<enclosure url=\"".$root.$projectFolder.$project_data["id"]."/soundscape_".$objects_data[$i]["id"].".m3u\" length=\"12216320\" type=\"audio/x-mpegurl\" />\n"; … … 85 85 86 86 // Para devolver el contenido de la etiqueta notours:soundpoint de un item a partir de los datos 87 function soundpoint_tag($data, $at ributes) {87 function soundpoint_tag($data, $attributes) { 88 88 global $soundFolder; 89 89 $soundpoint_tag = ""; 90 90 $soundpoint_tag .= "\t\t\t<notours:soundpoint>\n"; 91 91 $soundpoint_tag .= "\t\t\t\t<notours:sound>\n"; 92 $soundpoint_tag .= "\t\t\t\t\t<notours:at ributes>".$atributes."</notours:atributes>\n";92 $soundpoint_tag .= "\t\t\t\t\t<notours:attributes>".$attributes."</notours:attributes>\n"; 93 93 $soundpoint_tag .= "\t\t\t\t\t<notours:file>/".$soundFolder.$data[0]["url"]."</notours:file>\n"; 94 94 $soundpoint_tag .= "\t\t\t\t\t<notours:volume>".$data[0]["volume"]."</notours:volume>\n"; -
notours/noTours editor/inc/js/Gmaps.js
r250 r251 8 8 //NotoursSoundscape(id, proyecto, title, description, sons, imgs, modified, geodata, angles) 9 9 marcador_0 = new NotoursSoundscape(); 10 marcador_0.initialize(0, proyectoActual, "nuevo", "descripcion de la nueva entrada", "", "", "", geo, new Array(0,90,90,180,180,270,270,360));10 marcador_0.initialize(0, proyectoActual, "nuevo", "descripcion de la nueva entrada", "", "", "", geo, "", new Array(0,90,90,180,180,270,270,360)); 11 11 polyDragControl2.target = 0; 12 12 polyDragControl2.mapClick(new GLatLng(geo[0], geo[1])); … … 19 19 20 20 $("ul").prepend(li_html(0,"marcador")); 21 $("#marcador_0").append(editar_marcador_html(0, proyectoActual)); 21 $("#marcador_0").append(marcador_0.html_editar(proyectoActual)); 22 22 23 inicia_jquery(); 23 24 $("#marcador_0 .valor").attr("class","valor new"); … … 27 28 $("#marcador_0 .corregir_texto").append(hidden_imput_html ("texto", 0, "descripcion de la nueva entrada")); 28 29 $("#marcador_0 .corregir_coordenadas").append(hidden_coordenadas_html(0, geo[0], geo[1], geo[2])); 30 $("#marcador_0 .contenedor_atributos .caja_campo").show(); 29 31 } 30 32 function mapSoundscapeControl() { … … 68 70 69 71 function engadeMarker(map) { 72 70 73 var center = map.getCenter(); 71 74 var geo = Array(center.lat(), center.lng(), 50); 72 75 marcador_0 = new NotoursSoundpoint(); 73 marcador_0.initialize(0, proyectoActual, "nuevo", "descripcion de la nueva entrada", "", "", "", geo); 76 marcador_0.initialize(0, proyectoActual, "nuevo", "descripcion de la nueva entrada", "", "", "", geo, ""); 77 if (!first) { 78 polyDragControl.clear(); 79 } 80 first = false; 81 74 82 polyDragControl.target = 0; 75 polyDragControl.mapClick(new GLatLng( geo[0], geo[1]));76 first = false;83 polyDragControl.mapClick(new GLatLng(center.lat(), center.lng())); 84 77 85 marcador_0.Gmarker.hide(); 78 86 marcador_0.Gpolygon.hide(); 87 79 88 $("ul").prepend(li_html(0,"marcador")); 80 $("#marcador_0").append( editar_marcador_html(0,proyectoActual));89 $("#marcador_0").append(marcador_0.html_editar(proyectoActual)); 81 90 inicia_jquery(); 82 91 $("#marcador_0 .valor").attr("class","valor new"); -
notours/noTours editor/inc/js/MPolyDragControl.js
r250 r251 71 71 GEvent.addListener(self.dragMarker1,'dragend',function(){self.dragEnd(this)}); 72 72 73 this.polygons .push(new GPolygon([latlon,latlon,latlon,latlon,latlon],'#0000ff',1,1,'#0000ff',0.3));73 this.polygons[0] = new GPolygon([latlon,latlon,latlon,latlon,latlon],'#0000ff',1,1,'#0000ff',0.3); 74 74 this.map.addOverlay(this.polygons[0]); 75 75 -
notours/noTours editor/inc/js/NotoursObjects.js
r250 r251 2 2 // Notours Project Object 3 3 //****************************** 4 5 function Notoursattributes() { 6 this.key = new Array("speaker", "microphone", "inverse", "nonloop", "nonstop"); 7 this.value = new Array(false, false, false, false, false); 8 } 9 Notoursattributes.prototype.initialize = function(attr) { 10 var attributes = attr.split(" "); 11 for (i=0; i<attributes.length; i++) { 12 switch(attributes[i]) { 13 case 'speaker': 14 this.value[0] = true; 15 break; 16 case 'microphone': 17 this.value[1] = true; 18 break; 19 case 'inverse': 20 this.value[2] = true; 21 break; 22 case 'nonloop': 23 this.value[3] = true; 24 break; 25 case 'nonstop': 26 this.value[4] = true; 27 break; 28 } 29 } 30 } 4 31 5 32 function NotoursProject() { … … 53 80 } 54 81 55 82 NotoursProject.prototype.html = function() { 83 var html = '<img class="icono" src="'+ this.icon +'" /><input class="radio" type="radio" name="project" id="project_"'+ this.id +'" value="'+ this.id +'" /> <label for="project_'+ this.id +'">'+ this.name +'</label>'; 84 return html; 85 } 56 86 57 87 //****************************** … … 72 102 this.lonx = false; 73 103 this.radius = false; 104 //notours 105 this.attributes = false; 74 106 //Gmaps elements 75 107 this.Gmarker = false; … … 77 109 } 78 110 79 NotoursSoundpoint.prototype.initialize = function(id, proyecto, title, description, son, img, modified, geodata ) {111 NotoursSoundpoint.prototype.initialize = function(id, proyecto, title, description, son, img, modified, geodata, attr) { 80 112 //info 81 113 this.id = id; … … 87 119 if (img) this.img = img; 88 120 //geodata 89 if (typeof geodata == "string") { 90 var geo = geodata.split(" "); 91 this.lat = parseFloat(geo[0]);; 92 this.lonx = parseFloat(geo[1]);; 93 this.radius = geo[2]; 121 this.lat = 0; //aqui voy a poner por defecto las coordenadas del centro del proyecto 122 this.lonx = 0; //aqui voy a poner por defecto las coordenadas del centro del proyecto 123 this.radius = 0; //aqui voy a poner por defecto las coordenadas del centro del proyecto 124 var geo; 125 if ((typeof geodata == "string")&&(geodata!="")) { 126 geo = geodata.split(" "); 94 127 } else if (typeof geodata == "object") { 95 if (geodata.length==0) { 96 this.lat = 0; //aqui voy a poner por defecto las coordenadas del centro del proyecto 97 this.lonx = 0; //aqui voy a poner por defecto las coordenadas del centro del proyecto 98 this.radius = 0; //aqui voy a poner por defecto las coordenadas del centro del proyecto 99 } else { 100 this.lat = geodata[0]; 101 this.lonx = geodata[1]; 102 if ((geodata.length < 3)||(geodata[2].length==0)) { 103 this.radius = 50; 104 } else { 105 this.radius = parseFloat(geodata[2]); 106 } 107 } 108 } 128 geo = geodata; 129 } 130 if (geodata.length>=2) { 131 this.lat = parseFloat(geodata[0]); 132 this.lonx = parseFloat(geodata[1]); 133 if (geodata.length < 3) { 134 this.radius = 50; 135 } else { 136 this.radius = parseFloat(geodata[2]); 137 } 138 } 139 // Notours 140 this.attributes = new Notoursattributes(); 141 this.attributes.initialize(attr); 142 109 143 //Gmaps elements 110 144 // creamos el marcador con los datos almacenados en las variables … … 132 166 } 133 167 134 168 NotoursSoundpoint.prototype.html_editar = function(proyecto) { 169 var html = ""; 170 var campo = ""; 171 var valor = ""; 172 173 html += '\n\t<a class="mark"><img src="'+ root +'inc/pix/cuadrado.png" /></a>\n'; 174 175 valor = valor_html2("marcador", "titulo", this.id, this.title, "Título:", "editar_texto", ""); 176 campo = imput_html("input", "marcador", "titulo", this.id, this.title, "¿Cómo queres que se chame o teu artigo?:", "", ""); 177 html += contenedor_html2("titulo", valor, campo); 178 179 valor = valor_html2("marcador", "texto", this.id, this.description, "Descripción da grabación:", "editar_texto", ""); 180 campo = imput_html("textarea", "marcador", "texto", this.id, this.description, "Escribe unha pequena descripción da gravación:", "", ""); 181 html += contenedor_html2("texto", valor, campo); 182 183 valor = valor_html2("marcador", "lat", this.id, this.lat, "Latitude:", "editar_coordenadas", ""); 184 html += contenedor_html2("lat", valor, ""); 185 valor = valor_html2("marcador", "lonx", this.id, this.lonx, "Lonxitude:", "editar_coordenadas", ""); 186 html += contenedor_html2("lonx", valor, ""); 187 valor = valor_html2("marcador", "radio", this.id, this.radius, "Radio:", "editar_coordenadas", ""); 188 html += contenedor_html2("radio", valor, ""); 189 190 var text = ""; 191 campo = ""; 192 for (i=0; i<this.attributes.key.length; i++) { 193 if (this.attributes.value[i]) { 194 text += this.attributes.key[i] + " "; 195 campo += imput_html("checkbox", "marcador", "atributos", this.id, this.attributes.key[i], this.attributes.key[i], "", 'checked="checked"'); 196 } else { 197 campo += imput_html("checkbox", "marcador", "atributos", this.id, this.attributes.key[i], this.attributes.key[i], "", ""); 198 } 199 } 200 if (text == "") { 201 text = "(none)"; 202 } 203 valor = valor_html2("marcador", "atributos", this.id, text, "Atributos:", "editar_atributos", ""); 204 html += contenedor_html2("atributos", valor, campo); 205 206 if (this.img == "") { 207 var img = '<img src="'+ root +'inc/pix/photo.png" />'; 208 } else { 209 var img = '<img src="'+ this.img +'" />'; 210 } 211 valor = valor_html2("marcador", "imaxe", this.id, "(editar)", "Imaxe:", "editar_archivo", img); 212 campo = imput_html("iframe", "marcador", "imaxe", this.id, this.img, "Sube unha nova imaxe:", "", ""); 213 html += contenedor_html2("imaxe", valor, campo); 214 215 if (this.son == "") { 216 var son = '<img src="'+ root +'inc/pix/sound.png" />'; 217 } else { 218 var son = sound_html(root+projectFolder+proyectoActual+value,""); 219 } 220 valor = valor_html2("marcador", "son", this.id, "(editar)", "Son:", "editar_archivo", son); 221 campo = imput_html("iframe", "marcador", "son", this.id, this.son, "Sube unha nova gravación:", "", ""); 222 html += contenedor_html2("son", valor, campo); 223 224 html += form_corregir_html(this.id, proyecto); 225 html += form_eliminar_html(this.id); 226 return html; 227 } 135 228 136 229 //****************************** … … 153 246 //notours 154 247 this.angles = false; 248 this.attributes = false; 155 249 //Gmaps elements 156 250 this.Gmarker = false; … … 158 252 } 159 253 160 NotoursSoundscape.prototype.initialize = function(id, proyecto, title, description, sons, imgs, modified, geodata, a ngles) {254 NotoursSoundscape.prototype.initialize = function(id, proyecto, title, description, sons, imgs, modified, geodata, attributes, angles) { 161 255 //info 162 256 this.id = id; … … 183 277 } 184 278 // Notours 279 this.attributes = new Notoursattributes(); 280 this.attributes.initialize(attributes); 281 185 282 if (typeof angles == "string") { 186 283 this.angles = angles.split(" "); … … 217 314 } 218 315 } 316 317 NotoursSoundscape.prototype.html_editar = function(proyecto) { 318 var html = ""; 319 html += contenedor_html("marcador", "input", "titulo", this.id, "Título:", "¿Cómo queres que se chame o teu artigo?:", this.title, "", true, '<a class="mark"><img src="'+ root +'inc/pix/cuadrado.png" /></a>'); 320 html += contenedor_html("marcador", "textarea", "texto", this.id, "Descripción da grabación:", "Escribe unha pequena descripción da gravación:", this.description, ""); 321 html += contenedor_html("marcador", "", "lat", this.id, "latitude:", "", this.lat, "editar_coordenadas"); 322 html += contenedor_html("marcador", "", "lonx", this.id, "lonxitude:", "", this.lonx, "editar_coordenadas"); 323 html += contenedor_html("marcador", "", "radio", this.id, "radio:", "", this.radius, "editar_coordenadas"); 324 var checkbox = ""; 325 var text = ""; 326 for (i=0; i<this.attributes.key.length; i++) { 327 if (this.attributes.value[i]) { 328 text += this.attributes.key[i] + " "; 329 checkbox += imput_html("marcador", "checkbox", "atributos", this.id, this.attributes.key[i], 'checked="checked"', this.attributes.key[i]); 330 } else { 331 checkbox += imput_html("marcador", "checkbox", "atributos", this.id, this.attributes.key[i], "", this.attributes.key[i]); 332 } 333 } 334 html += contenedor_html2("atributos", valor_html2("marcador", "atributos", this.id, text, "Atributos:", "", ""), checkbox); 335 html += contenedor_html("marcador", "iframe", "imaxe", this.id, "Imaxe:", "Sube unha nova imaxe:", this.img, ""); 336 html += contenedor_html("marcador", "iframe", "son", this.id, "Son:", "Sube unha nova gravación:", this.son, ""); 337 html += form_corregir_html(this.id, proyecto); 338 html += form_eliminar_html(this.id); 339 return html; 340 } -
notours/noTours editor/inc/js/notours-ajax-html.js
r250 r251 19 19 20 20 function form_new_html() { 21 var html = ""; 21 var html = ""; 22 22 html += '\t<form id="crearAutor" class="recuadro" method="post" action="new.php">\n'; 23 23 html += '\t\t<label for="newuser">nombre de usuario:</label><input type="text" name="newuser" id="newuser" value="">\n'; … … 28 28 return html; 29 29 } 30 31 function contenedor_html2(nombre, valor, campo) { 32 var html = ""; 33 html += '\t<div class="contenedor_'+ nombre +'">\n'; 34 if ((valor)&&(valor!="")) { 35 html += '\t\t<div class="caja_valor">\n'; 36 html += valor; 37 html += '\t\t</div>\n'; 38 } 39 if ((campo)&&(campo!="")) { 40 html += '\t\t<div class="caja_campo agochado">\n'; 41 html += campo; 42 html += '\t\t</div>\n'; 43 } 44 html += '\t</div>\n'; 45 return html; 46 } 47 48 function valor_html2(contexto, campo, id, value, texto_valor, clase, extra) { 49 var html = ""; 50 var extraClass = ""; 51 52 if ((clase)&&(clase!='')) { 53 extraClass += " " + clase; 54 } 55 if ((texto_valor)&&(texto_valor!='')) { 56 html += '\t\t\t<h4>'+ texto_valor +'</h4>\n'; 57 } 58 59 html += '\t\t\t<span class="valor'+ extraClass +'" name="'+ contexto +'_'+ campo +'_'+ id +'">'+ value +'</span>\n'; 60 61 if ((extra)&&(extra!='')) { 62 html += '\t\t\t'+ extra +'\n'; 63 } 64 return html; 65 } 66 30 67 31 68 function contenedor_html(contexto, type, campo, id, texto_valor, texto_campo, value, clase, before, extra) { … … 75 112 } 76 113 114 function imput_html(type, contexto, campo, id, value, label, clase, extra) { 115 var html = ""; 116 if ((label)&&(label!="")) { 117 //html += '\t\t\t<nobr>\n'; 118 html += '\t\t\t<label for="'+ contexto +'_'+ campo +'_'+ id +'">'+ label +'</label>\n'; 119 } 120 if ((clase)&&(clase!="")) { 121 extraClass = 'class=" '+ clase +'" '; 122 } else { 123 extraClass = ""; 124 } 125 switch (type) { 126 case 'input': 127 html += '\t\t\t<input '+ extraClass +'name="'+ contexto +'_'+ campo +'_'+ id +'" type="text" value="'+ value +'" size="35" '+ extra +'/>\n'; 128 break; 129 case 'textarea': 130 html += '\t\t\t<textarea '+ extraClass +'name="'+ contexto +'_'+ campo +'_'+ id +'" '+ extra +'>'+ value +'</textarea>\n'; 131 break; 132 case 'iframe': 133 html += '\t\t\t<iframe '+ extraClass +'name="'+ id +'" id="iframe_'+ campo +'_'+ id +'" src="'+ root +'inc/iframe_subir_'+ campo +'.html" '+ extra +'></iframe>\n'; 134 break; 135 case 'checkbox': 136 html += '\t\t\t<input '+ extraClass +'name="'+ contexto +'_'+ campo +'_'+ id +'" type="checkbox" '+ extra +'value="'+ value +'" />\n'; 137 break; 138 case 'hidden': 139 html += '\t\t\t<input '+ extraClass +'name="'+ contexto +'_'+ campo +'_'+ id +'" type="hidden" '+ extra +'value="'+ value +'" />\n'; 140 break; 141 case '': 142 return ''; 143 break; 144 } 145 if ((label)&&(label!="")) { 146 //html += '\t\t\t</nobr>\n'; 147 } 148 return html; 149 } 150 151 function hidden_imput_html(campo, id, value) { 152 var html = ""; 153 //html += '\t\t\t<span class="new">'+ campo +': '+ value +'<'+'/span>\n'; 154 html += '<input name="hidden_'+ campo +'" id="hidden_'+ campo +'_'+ id +'" type="hidden" value="'+ value +'" />'; 155 return html; 156 } 157 77 158 function campo_html(contexto, type, campo, id, texto_campo, value, clase) { 78 159 if ((clase)&&(clase!="")) { … … 81 162 extraClass = ""; 82 163 } 83 var html = ""; 164 var html = ""; 165 // div caja_campo 84 166 html += '\t\t<div class="caja_campo agochado">\n'; 85 167 if (texto_campo!='') { 86 168 html += '\t\t\t<label for="'+ campo +'_'+id+'">'+ texto_campo +'</label>\n'; 87 169 } 88 switch (type) { 89 case 'input': 90 html += '\t\t\t<input '+ extraClass +'name="'+ contexto +'_'+ campo +'_'+ id +'" type="text" value="'+value+'" size="35" />\n'; 91 break; 92 case 'textarea': 93 html += '\t\t\t<textarea '+ extraClass +'name="'+ contexto +'_'+ campo +'_'+ id +'">'+value+'</textarea>\n'; 94 break; 95 case 'iframe': 96 html += '\t\t\t<iframe '+ extraClass +'src="'+root+'inc/iframe_subir_'+ campo +'.html" id="iframe_'+ campo +'_'+ id +'" name="'+ id +'"></iframe>\n'; 97 break; 98 case '': 99 return ''; 100 break; 101 } 170 // imputs 171 html += imput_html(contexto, type, campo, id, value, clase, ""); 172 // div caja_campo 102 173 html += '\t\t</div>\n'; 103 174 return html; 104 175 } 105 176 106 function hidden_imput_html(campo, id, value) {107 var html = "";108 html += '\t\t\t<span class="new">'+ campo +': '+ value +'<'+'/span>\n';109 html += '\t\t\t<input name="hidden_'+ campo +'" id="hidden_'+ campo +'_'+ id +'" type="hidden" value="'+ value +'" />\n';110 return html;111 }112 113 177 function hidden_coordenadas_html(id, lat, lonx, radius) { 114 178 var html = ""; 115 html += '\t\t\t<span class="new">latitud: '+ lat +'<'+'/span>\n'; 116 html += '\t\t\t<span class="new">longitud: '+ lonx +'<'+'/span>\n'; 117 html += '\t\t\t<span class="new">Radio: '+ radius +'<'+'/span>\n'; 118 html += '\t\t\t<input name="hidden_lat" id="hidden_lat_'+ id +'" type="hidden" value="'+ lat +'" />\n'; 119 html += '\t\t\t<input name="hidden_lonx" id="hidden_lonx_'+ id +'" type="hidden" value="'+ lonx +'" />\n'; 120 html += '\t\t\t<input name="hidden_radio" id="hidden_radio_'+ id +'" type="hidden" value="'+ radius +'" />\n'; 179 //html += '\t\t\t<span class="new">latitud: '+ lat +'<'+'/span>\n'; 180 //html += '\t\t\t<span class="new">longitud: '+ lonx +'<'+'/span>\n'; 181 //html += '\t\t\t<span class="new">Radio: '+ radius +'<'+'/span>\n'; 182 183 html += hidden_imput_html("lat", id, lat); 184 //html += imput_html("hidden", "hidden", "lat", id, lat, "", "", ""); 185 html += hidden_imput_html("lonx", id, lonx); 186 //html += imput_html("hidden", "hidden", "lonx", id, lonx, "", "", ""); 187 html += hidden_imput_html("radio", id, radius); 188 //html += imput_html("hidden", "hidden", "radio", id, radius, "", "", ""); 189 190 //html += '\t\t\t<input name="hidden_lat" id="hidden_lat_'+ id +'" type="hidden" value="'+ lat +'" />\n'; 191 //html += '\t\t\t<input name="hidden_lonx" id="hidden_lonx_'+ id +'" type="hidden" value="'+ lonx +'" />\n'; 192 //html += '\t\t\t<input name="hidden_radio" id="hidden_radio_'+ id +'" type="hidden" value="'+ radius +'" />\n'; 121 193 return html; 122 194 } … … 145 217 html += '\t\t\t<div class="corregir_imagen"></div>\n'; 146 218 html += '\t\t\t<div class="corregir_sonido"></div>\n'; 219 html += '\t\t\t<div class="corregir_atributos"></div>\n'; 147 220 html += '\t\t\t<input class="submit" type="submit" name="valider" value="ok" />\n'; 148 221 html += '\t\t</fieldset>\n'; … … 187 260 html += '</form>\n'; 188 261 return html; 189 }190 191 function proyecto_html (id) {192 if (eval('proyecto_'+id+'!=null')) {//esto no se hace asi deberia ser un typeof193 var name = eval('proyecto_'+id+'.name');194 var description = eval('proyecto_'+id+'.description');195 var icon = eval('proyecto_'+id+'.icon');196 var lat = eval('proyecto_'+id+'.lat');197 var lonx = eval('proyecto_'+id+'.lonx');198 var zoom = eval('proyecto_'+id+'.zoom');199 200 $("ul").append(li_html(id,"proyecto"));201 var html = '<img class="icono" src="'+ icon +'" /><input class="radio" type="radio" name="project" id="project_"'+ id +'" value="'+ id +'" /> <label for="project_'+ id +'">'+ name +'</label>';202 $("#proyecto_"+id).append(html);203 }204 262 } 205 263 … … 228 286 $("#proyecto_"+ id).append('\n<div id="pestanha_proyecto" class="pestanha">\n</div><!-- fin proyecto_'+ id +' -->\n'); 229 287 230 $("#pestanha_proyecto").append(contenedor_html("proyecto", 'input', 'nombre', id, '', 'nome do proxecto:', name, "", false, '\t\t< span class="toogle"><img src="'+ root +'inc/pix/desplegar.png" alt="desplegar" /></span> <span class="next"><img src="'+root+'inc/pix/adelante.png" alt="siguiente" /></span> <span class="back"><img src="'+ root +'inc/pix/atras.png" alt="anterior" /></span> <span class="novo"><img src="'+ root +'inc/pix/nuevo.png" alt="nuevo" /></span>\n'));288 $("#pestanha_proyecto").append(contenedor_html("proyecto", 'input', 'nombre', id, '', 'nome do proxecto:', name, "", false, '\t\t<li class="toogle"></li> <li class="next"></li> <li class="back"></li> <li class="novo"></li>\n')); 231 289 232 290 $("#proyecto_"+ id).append('\t<div class="contenedor">\n\t</div><!-- fin .contenedor -->\n'); … … 249 307 } 250 308 } 251 252 function editar_marcador_html(id, proyecto) {253 var lat = eval('marcador_'+ id +'.lat');254 var lonx = eval('marcador_'+ id +'.lonx');255 var radio = eval('marcador_'+ id +'.radius');256 var son = eval('marcador_'+ id +'.son');257 var img = eval('marcador_'+ id +'.img');258 var titulo = eval('marcador_'+ id +'.title');259 var descripcion = eval('marcador_'+ id +'.descripcion');260 var html = "";261 //html += editar_html(id);262 html += contenedor_html("marcador", "input", "titulo", id, "Título:", "¿Cómo queres que se chame o teu artigo?:", titulo, "",true, '<a class="mark"><img src="'+ root +'inc/pix/cuadrado.png" /></a>');263 html += contenedor_html("marcador", "textarea", "texto", id, "Descripción da grabación:", "Escribe unha pequena descripción da gravación:", descripcion, "");264 html += contenedor_html("marcador", "", "lat", id, "latitude:", "", lat, "editar_coordenadas");265 html += contenedor_html("marcador", "", "lonx", id, "lonxitude:", "", lonx, "editar_coordenadas");266 html += contenedor_html("marcador", "", "radio", id, "radio:", "", radio, "editar_coordenadas");267 html += contenedor_html("marcador", "iframe", "imaxe", id, "Imaxe:", "Sube unha nova imaxe:", img, "");268 html += contenedor_html("marcador", "iframe", "son", id, "Son:", "Sube unha nova gravación:", son, "");269 html += form_corregir_html(id, proyecto);270 html += form_eliminar_html(id);271 return html;272 } -
notours/noTours editor/inc/js/notours-ajax.js
r250 r251 82 82 } 83 83 84 function itemChild(item, def) { 85 var child; 86 if(item.firstChild != null){ 87 child = item.firstChild.data; 88 } else { 89 child = def; 90 } 91 return child; 92 } 93 84 94 function agregarMarcador(item, proyecto) { 85 95 //almacenamos en distintas variables la informacion contenida nen los chilNodes de cada item-marcador do xml 86 96 var itemtags = item.getElementsByTagName("*"); 97 var xmlattributes = ""; 87 98 for ( var j = 0; j < itemtags.length; j++ ) { 88 99 var tag = itemtags[j].nodeName.toLowerCase(); 89 100 switch (tag) { 90 101 case 'guid': 91 if(itemtags[j].firstChild != null){ 92 var xmlId = itemtags[j].firstChild.data; 93 } else { 94 var xmlId = ""; 102 var xmlId = itemChild(itemtags[j], ""); 103 break; 104 case 'title': 105 var xmlTitle = itemChild(itemtags[j], ""); 106 break; 107 case 'description': 108 var xmlDesc = itemChild(itemtags[j], ""); 109 break; 110 case 'pubdate': 111 var xmlDate = itemChild(itemtags[j], ""); 112 break; 113 case 'notours:soundpoint': 114 var soundpoint = itemtags[j].getElementsByTagName("*"); 115 for ( var k=0; k<soundpoint.length; k++ ) { 116 if (soundpoint[k].nodeName.toLowerCase()=='notours:attributes') { 117 xmlattributes = itemChild(soundpoint[k], ""); 118 } 95 119 } 96 120 break; 97 case 'title':98 if(itemtags[j].firstChild != null){99 var xmlTitle = itemtags[j].firstChild.data;100 } else {101 var xmlTitle = "";102 }103 break;104 case 'description':105 if(itemtags[j].firstChild != null){106 var xmlDesc = itemtags[j].firstChild.data;107 } else {108 var xmlDesc = "";109 }110 break;111 case 'pubdate':112 if(itemtags[j].firstChild != null){113 var xmlDate = itemtags[j].firstChild.data;114 } else {115 var xmlDate = "";116 }117 break;118 121 case 'georss:circle': 119 if(itemtags[j].firstChild != null){ 120 var xmlGeo = itemtags[j].firstChild.data.split(" "); 121 } else { 122 var xmlGeo = new Array(); 123 } 122 var xmlGeo = itemChild(itemtags[j], ""); 124 123 break; 125 124 case 'enclosure': … … 136 135 eval('marcador_' + xmlId + ' = new NotoursSoundpoint();'); 137 136 var marcador = eval('marcador_' + xmlId); 138 marcador.initialize(xmlId, proyecto, xmlTitle, xmlDesc, xmlSon, xmlIMG, xmlDate, xmlGeo); 137 marcador.initialize(xmlId, proyecto, xmlTitle, xmlDesc, xmlSon, xmlIMG, xmlDate, xmlGeo.split(" "), xmlattributes); 138 139 $("ul").append(li_html(xmlId,"marcador")); 140 $("#marcador_"+ xmlId).append(marcador.html_editar(proyecto)); 141 $("#marcador_"+ xmlId + " .eliminar_marcador").toggle(); 142 $("#marcador_"+ xmlId + " .corregir_marcador").toggle(); 143 $("#marcador_"+ xmlId + " .contenedor_imaxe").toggle(); 144 $("#marcador_"+ xmlId + " .contenedor_son").toggle(); 145 $("#marcador_"+ xmlId + " .contenedor_texto").toggle(); 146 $("#marcador_"+ xmlId + " .contenedor_radio").toggle(); 147 $("#marcador_"+ xmlId + " .contenedor_lonx").toggle(); 148 $("#marcador_"+ xmlId + " .contenedor_lat").toggle(); 149 //$("#marcador_"+ xmlId + " .contenedor_atributos .caja_campo").show(); 150 $("#marcador_"+ xmlId + " .contenedor_atributos").toggle(); 151 139 152 return xmlId; 140 153 } … … 147 160 switch (tag) { 148 161 case 'guid': 149 var xmlId = ""; 150 if (itemtags[j].firstChild) { 151 xmlId = itemtags[j].firstChild.data; 152 } 162 var xmlId = itemChild(itemtags[j], ""); 153 163 break; 154 164 case 'title': 155 var xmlTitle = ""; 156 if (itemtags[j].firstChild) { 157 xmlTitle = itemtags[j].firstChild.data; 158 } 165 var xmlTitle = itemChild(itemtags[j], ""); 159 166 break; 160 167 case 'description': 161 var xmlDesc = ""; 162 if (itemtags[j].firstChild) { 163 xmlDesc = itemtags[j].firstChild.data; 164 } 168 var xmlDesc = itemChild(itemtags[j], ""); 165 169 break; 166 170 case 'pubdate': 167 var xmlDate = ""; 168 if (itemtags[j].firstChild) { 169 xmlDate = itemtags[j].firstChild.data; 170 } 171 var xmlDate = itemChild(itemtags[j], ""); 171 172 break; 172 173 case 'georss:point': 173 var xmlGeo = ""; 174 if (itemtags[j].firstChild) { 175 xmlGeo = itemtags[j].firstChild.data.split(" "); 176 } 174 var xmlGeo = itemChild(itemtags[j], ""); 177 175 break; 178 176 case 'enclosure': … … 184 182 } 185 183 } 184 186 185 // creamos el proyecto con los datos almacenados en las variables 187 //return notours_project_data(xmlId, xmlTitle, xmlDesc, xmlIMG, xmlType, xmlDate, xmlGeo);188 189 // creamos el marcador con los datos almacenados en las variables190 186 eval('proyecto_' + xmlId + ' = new NotoursProject();'); 191 187 var proyecto = eval('proyecto_' + xmlId); 192 188 proyecto.initialize(xmlId, xmlTitle, xmlDesc, xmlIMG, xmlType, xmlDate, xmlGeo); 189 190 $("ul").append(li_html(xmlId,"proyecto")); 191 $("#proyecto_"+ xmlId).append(proyecto.html()); 192 193 193 return xmlId; 194 194 … … 204 204 jQuery("item", xml_marcadores).each(function(i, item_marcadores){ 205 205 $("#terminal").append('marcador: ' + i + '<br />'); 206 var id_marcador = agregarMarcador (item_marcadores, proyecto); 207 $("ul").append(li_html(id_marcador,"marcador")); 208 $("#marcador_"+ id_marcador).append(editar_marcador_html(id_marcador, proyecto)); 209 $("#marcador_"+ id_marcador + " .eliminar_marcador").toggle(); 210 $("#marcador_"+ id_marcador + " .corregir_marcador").toggle(); 211 $("#marcador_"+ id_marcador + " .contenedor_imaxe").toggle(); 212 $("#marcador_"+ id_marcador + " .contenedor_son").toggle(); 213 $("#marcador_"+ id_marcador + " .contenedor_texto").toggle(); 214 $("#marcador_"+ id_marcador + " .contenedor_radio").toggle(); 215 $("#marcador_"+ id_marcador + " .contenedor_lonx").toggle(); 216 $("#marcador_"+ id_marcador + " .contenedor_lat").toggle(); 206 agregarMarcador(item_marcadores, proyecto); 217 207 }); 218 208 $("#terminal").append('<br />'); 219 209 inicia_jquery(); 220 210 }); 211 } 212 213 function leerRssProyectos(autor) { 214 if (typeof autor == "undefined") { 215 var url = root + "proyectos.php"; 216 } else { 217 var url = root + "proyectos.php?id_autor="+autor; 218 } 219 $("#terminal").append(url+ '<br><br>'); 220 //leemos el rss que contiene los proyectos 221 jQuery.get(url, function(xml_proyectos){ 222 // jQuery almacena en un objeto xml los datos recogidos del documento leido para 223 // cada elemento item vamos a agregar un marcador en el mapa 224 jQuery("item", xml_proyectos).each(function(i, item_proyectos){ 225 var id_proyecto = agregarProyecto (item_proyectos); 226 var num_proyecto = proyectos.push(id_proyecto)-1; 227 eval('proyecto_'+id_proyecto+'.numero='+num_proyecto); 228 }); 229 $("ul").after(form_nuevo_proyecto()); 230 inicia_jquery_selector_proyectos(); 231 }); 232 } 233 234 function cargarProyectos() { 235 for (i=0;i<proyectos.length;i++) { 236 if ((eval('typeof proyecto_' + proyectos[i]) != "undefined") && (eval('proyecto_' + proyectos[i]) != null)) { 237 var proyecto = eval('proyecto_' + proyectos[i]); 238 $("ul").append(li_html(proyectos[i], "proyecto")); 239 $("#proyecto_"+ proyectos[i]).append(proyecto.html()); 240 } 241 } 242 $("ul").after(form_nuevo_proyecto()); 243 inicia_jquery_selector_proyectos(); 221 244 } 222 245 … … 294 317 } 295 318 296 function leerRssProyectos(autor) {297 if (typeof autor == "undefined") {298 var url = root + "proyectos.php";299 } else {300 var url = root + "proyectos.php?id_autor="+autor;301 }302 $("#terminal").append(url+ '<br><br>');303 //leemos el rss que contiene los proyectos304 jQuery.get(url, function(xml_proyectos){305 // jQuery almacena en un objeto xml los datos recogidos del documento leido para306 // cada elemento item vamos a agregar un marcador en el mapa307 jQuery("item", xml_proyectos).each(function(i, item_proyectos){308 var id_proyecto = agregarProyecto (item_proyectos);309 var num_proyecto = proyectos.push(id_proyecto)-1;310 eval('proyecto_'+id_proyecto+'.numero='+num_proyecto);311 proyecto_html (id_proyecto);312 });313 $("ul").after(form_nuevo_proyecto());314 inicia_jquery_selector_proyectos();315 });316 }317 function cargarProyectos() {318 for (i=0;i<proyectos.length;i++) {319 proyecto_html (proyectos[i]);320 }321 $("ul").after(form_nuevo_proyecto());322 inicia_jquery_selector_proyectos();323 }324 319 function enviarMarcador(formulario, callBack){ 325 320 var values = $(formulario).serialize(); … … 336 331 // si la variable marcador_id no existe se trata de un nuevo marcador 337 332 } else if (eval('typeof marcador_' + data.id)=="undefined") { 338 var campos = new Array(" title", "description", "son", "imaxe", "modified", "project_id");339 var values = new Array("", "", "", "", "", "" );333 var campos = new Array("project_id", "title", "description", "son", "imaxe", "modified", "attributes", "geodata"); 334 var values = new Array("", "", "", "", "", "", "", ""); 340 335 for(i=0; i<campos.length; i++) { 341 336 if(eval("typeof data."+campos[i]) != "undefined") { … … 344 339 } 345 340 } 346 var geo = data.geodata.split(" ");347 $("#terminal").append("geodata = '"+ data.geodata +"';" + '<br />');348 349 341 eval('marcador_' + data.id + ' = new NotoursSoundpoint();'); 350 342 var marcador = eval('marcador_' + data.id); 351 marcador.initialize(data.id, values[5], values[0], values[1], values[2], values[3], values[4], geo); 352 343 marcador.initialize(data.id, values[0], values[1], values[2], values[3], values[4], values[5], values[7].split(" "), values[6]); 353 344 $("#marcador_0").remove(); 354 345 map.removeOverlay(marcador_0.Gmarker); 355 346 map.removeOverlay(marcador_0.Gpolygon); 356 347 $("ul").prepend(li_html(data.id,"marcador")); 357 $("#marcador_"+ data.id).append( editar_marcador_html(data.id, values[0]));348 $("#marcador_"+ data.id).append(marcador.html_editar(values[5])); 358 349 inicia_jquery(); 359 350 … … 386 377 $("#terminal").append("Descripción = '"+ data.description +"';" + '<br />'); 387 378 } 379 if (typeof data.attributes != "undefined") { 380 $("#marcador_"+ data.id +" .contenedor_atributos .valor").attr("class","valor"); 381 $("#marcador_"+ data.id +" .contenedor_atributos .caja_campo").hide(); 382 marcador.attributes = data.attributes; 383 $("#marcador_"+ data.id +" .corregir_atributos").empty(); 384 $("#terminal").append("Atributos = '"+ data.attributes +"';" + '<br />'); 385 } 388 386 if (typeof data.geodata != "undefined") { 389 387 var jsonGeo = data.geodata.split(" "); … … 396 394 map.addOverlay(marcador.Gpolygon); 397 395 $("#marcador_"+ data.id +" .corregir_coordenadas").empty(); 398 $("#marcador_"+ data.id +" .contenedor_lat .valor").attr("class","valor editar_ marcador");399 $("#marcador_"+ data.id +" .contenedor_lonx .valor").attr("class","valor editar_ marcador");400 $("#marcador_"+ data.id +" .contenedor_radio .valor").attr("class","valor editar_ marcador");396 $("#marcador_"+ data.id +" .contenedor_lat .valor").attr("class","valor editar_coordenadas"); 397 $("#marcador_"+ data.id +" .contenedor_lonx .valor").attr("class","valor editar_coordenadas"); 398 $("#marcador_"+ data.id +" .contenedor_radio .valor").attr("class","valor editar_coordenadas"); 401 399 $("#terminal").append("GeoData = '"+ data.geodata +"';" + '<br />'); 402 400 } 403 401 } 404 //alert("aqui");405 402 first = true; 406 403 polyDragControl.clear(); 407 408 404 if (callBack) { 409 405 callBack(); … … 491 487 $("#" + id + " .contenedor_lonx").toggle(); 492 488 $("#" + id + " .contenedor_lat").toggle(); 489 $("#" + id + " .contenedor_atributos").toggle(); 493 490 }); 494 491 $(".marcador").mouseover( function(){ … … 508 505 //aclara(0.8, 0.2, data[1]); 509 506 }); 510 $(". valor").dblclick( function(){507 $(".editar_texto").dblclick( function(){ 511 508 var data = $(this).attr("name").split("_"); 512 509 var contexto = data[0]; … … 518 515 } 519 516 }); 517 $(".editar_archivo").dblclick( function(){ 518 var data = $(this).attr("name").split("_"); 519 var contexto = data[0]; 520 var campo = data[1]; 521 var id = data[2]; 522 if ($("#"+ contexto +"_"+ id +" .contenedor_"+ campo +" .caja_campo").attr("class")){ 523 $("#"+ contexto +"_"+ id +" .contenedor_"+ campo +" .caja_valor").hide(); 524 $("#"+ contexto +"_"+ id +" .contenedor_"+ campo +" .caja_campo").show("slow"); 525 } 526 }); 527 $(".editar_atributos").click( function(){ 528 var data = $(this).attr("name").split("_"); 529 var contexto = data[0]; 530 var campo = data[1]; 531 var id = data[2]; 532 if ($("#"+ contexto +"_"+ id +" .contenedor_"+ campo +" .caja_campo").attr("class")){ 533 //$("#"+ contexto +"_"+ id +" .contenedor_"+ campo +" .caja_valor").hide(); 534 $("#"+ contexto +"_"+ id +" .contenedor_"+ campo +" .caja_campo").show("slow"); 535 } 536 }); 537 /* 520 538 $(".editar_marcador").click( function(){ 521 539 var data = $(this).attr("name").split("_"); … … 523 541 abrir_ventana(id); 524 542 }); 543 */ 525 544 $(".editar_coordenadas").dblclick( function(){ 526 545 var data = $(this).attr("name").split("_"); … … 537 556 $("input[type=\'text\']").blur( function(){ 538 557 actua(this); 558 }); 559 $("input[type=\'checkbox\']").change( function(){ 560 var data = $(this).attr("name").split("_"); 561 var contexto = data[0]; 562 var campo = data[1]; 563 var id = data[2]; 564 var value = ""; 565 var num = 0; 566 $("#"+ contexto +"_"+ id +" .contenedor_"+ campo +" input:checked").each(function() { 567 num++; 568 value += $(this).attr("value") + " "; 569 }); 570 if (num==0) { 571 $("#"+ contexto +"_"+ id +" .contenedor_"+ campo +" .valor").text("(none)"); 572 } else { 573 $("#"+ contexto +"_"+ id +" .contenedor_"+ campo +" .valor").text(value); 574 } 575 $("#"+ contexto +"_"+ id +" .corregir_"+ campo).empty(); 576 $("#"+ contexto +"_"+ id +" .corregir_"+ campo).append(hidden_imput_html (campo, id, value)); 577 $("#"+ contexto +"_"+ id +" .contenedor_"+ campo +" .valor").attr("class","valor new"); 539 578 }); 540 579 $("textarea").blur( function(){ … … 648 687 $("#proyecto_"+ proyectoActual +" .contenedor").slideToggle("slow"); 649 688 if (desplagable) { 650 $('#marcadores').animate({top: " 30px"}, "slow");689 $('#marcadores').animate({top: "105px"}, "slow"); 651 690 } else { 652 691 $('#marcadores').animate({top: "320px"}, "slow"); … … 714 753 } else { 715 754 proyectoActual = null; 755 proyectos.splice(eval('proyecto_'+value[2]+'.numero'),1); 716 756 eval('proyecto_'+value[2]+'=null'); 717 757 $("#proyecto_"+ proyectoActual +" .contenedor").hide(); -
notours/noTours editor/index.html
r250 r251 22 22 </script> 23 23 <body> 24 <div id="cabeceira">< /div><!-- fin cabeceira -->24 <div id="cabeceira"><a href="#"><img src="inc/pix/logo_notours.jpg"></a></div><!-- fin cabeceira --> 25 25 26 <div id="pestanhaMapa" class="pestanha">< /div>26 <div id="pestanhaMapa" class="pestanha"><div class="top_right"></div><div class="top_left"></div><div class="top_middle"></div><br clear="both" /></div> 27 27 <div id="cajaMapa"> 28 28 <div id="mapa_marcadores"></div><!-- fin mapa_marcadores -->
