Changeset 251

Show
Ignore:
Timestamp:
04/05/10 10:14:32 (22 months ago)
Author:
horaciogd
Message:

Cambios de la sesión de trabajo en equipo del sábado.
Nueva css + Notours:attributes

Location:
notours/noTours editor
Files:
9 added
11 modified

Legend:

Unmodified
Added
Removed
  • notours/noTours editor/inc/actualizar_marcador.php

    r250 r251  
    1313$object_data = array(); 
    1414 
    15 //notours_object        id      project_id      title   description     class   atributes       geodata         modified        sounds 
     15//notours_object        id      project_id      title   description     class   attributes      geodata         modified        sounds 
    1616//notours_file  id      url     length  type    volume  angles 
    1717/* 
     
    2222        'description' => '', 
    2323        'class' => '', 
    24         'atributes' => '', 
     24        'attributes' => '', 
    2525        'geodata' => '', 
    2626        'modified' => '', 
    2727        'sounds' => '', 
    2828); 
    29 db_update_query($db_tables['objects'], array('project_id' => , 'title' => , 'description' => , 'class' => , 'atributes' => , 'geodata' => , 'modified' => , 'sounds' => ), $id); 
    30 $id = db_insert_query($db_tables['objects'], array('project_id' => , 'title' => , 'description' => , 'class' => , 'atributes' => , 'geodata' => , 'modified' => , 'sounds' => )); 
     29db_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' => )); 
    3131 
    3232$file_data = array ( 
     
    5757        $actualProjectFolder = $_POST['hidden_proyecto'].'/'; 
    5858} 
     59if (isset($_POST['hidden_atributos'])) { 
     60        $object_data['attributes'] = trim($_POST['hidden_atributos']); 
     61} 
    5962if ( (isset($_POST['hidden_lat'])) && ($_POST['hidden_lat']!="") && (isset($_POST['hidden_lonx'])) && ($_POST['hidden_lonx']!="") && (isset($_POST['hidden_radio'])) && ($_POST['hidden_radio']!="") ) { 
    6063        $object_data['class'] = "soundpoint"; 
     
    6265} 
    6366 
    64 $object_data['modified'] = date("Y-m-d");    
    65  
    6667if (count($object_data)>0) { 
     68        $object_data['modified'] = date("Y-m-d");    
    6769        // si la id es cero creamos un nuevo marcador 
    6870        if ($object_id==0) { 
     
    111113} else { 
    112114        $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>" 
    114116        ); 
    115117        echo json_encode($error); 
  • notours/noTours editor/inc/css/estilo_form.css

    r250 r251  
     1/* ___________________________________________________________________ Xenericos ________________ */ 
    12body { 
    2         width: !00%; 
     3        width: 100%; 
    34        height: 100%; 
    4         margin: 0; 
     5        margin: 8px; 
    56        font-size:0.88em; 
    67        font-family: helvetica, verdana; 
    78        letter-spacing: 0.03em; 
    89} 
    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 
     11h4 {display:inline; line-height:200%;} 
     12img {border:none} 
     13label {display:inline; line-height:200%;} 
     14fieldset{border:none;} 
     15ul {list-style-type:none; margin:0; padding:0 8px; } 
     16li {background-color:#fff; margin-top:8px; padding:8px;} 
     17 
     18li.proyecto {padding: 0;height: 52px;} 
    3319li.proyecto input, li.proyecto label { 
    3420        line-height: 52px; 
     
    3723        float: left; 
    3824} 
    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 } 
     25li.proyecto input {height:50px; margin:0 5px;} 
     26li.proyecto .icono {width:52px; height:52px; float:left;} 
     27 
    5228/*fieldset de formularios con texto azul agochado*/ 
    5329.corregir_proyecto .enviar_formulario { 
     
    7248} 
    7349 
    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 
    8855#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 
    9463#cajaMapa { 
    9564        position: absolute; 
    96         top: 34px; 
     65        top: 49px; 
    9766        bottom: 128px; 
    9867        right: 8px; 
     
    11483} 
    11584 
    116 #mapa_marcadores { 
    117         width: 100%; 
    118         height: 100%; 
    119 } 
     85#mapa_marcadores {width: 100%; height: 100%;} 
    12086 
    12187.pestanha { 
    122         height: 26px; 
     88        height: 41px; 
    12389        overflow: hidden; 
    124         background-color: #000; 
     90        background-color:none; 
     91        background-image:url(../pix/blackline_back.png); 
    12592        font-weight: bold; 
    12693        color: #ccc; 
    12794} 
    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 
    154120/*#proyectos .contenedor_nombre span*/ 
    155121.toogle, .next, .back, .novo { 
     
    166132        overflow: hidden; 
    167133        height: 285px; 
     134        background-color:#ddd; 
    168135} 
    169136.recuadro { 
  • notours/noTours editor/inc/db.php

    r250 r251  
    408408        } else { 
    409409                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"; 
    411411                $result = mysql_query ($dosql); 
    412412                while ($row = mysql_fetch_array($result)) { 
     
    436436                                "description" => $row['description'], 
    437437                                "class" => $row['class'], 
    438                                 "atributes" => $row['atributes'], 
     438                                "attributes" => $row['attributes'], 
    439439                                "geodata" => $row['geodata'], 
    440440                                "modified" => $row['modified'], 
  • notours/noTours editor/inc/eliminar_proyecto.php

    r250 r251  
    88        header("Content-type: text/html; charset=utf-8"); 
    99         
    10         if ( (isset($_GET['hidden_id'])) && ($_GET['hidden_id']!="") ) { 
     10        if ( (isset($_POST['hidden_id'])) && ($_POST['hidden_id']!="") ) { 
    1111                // leemos las variables recibidas desde el formulario mediante el metodo POST 
    12                 $id = $_GET['hidden_id']; 
     12                $id = $_POST['hidden_id']; 
    1313                // eliminamos la entrada: 
    1414                $data = db_delete_project($id); 
  • notours/noTours editor/inc/feed.php

    r250 r251  
    4949                if ($objects_data[$i]["class"]=="soundpoint") { 
    5050                        $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]["atributes"]); 
     51                                        $extra .= soundpoint_tag($objects_data[$i]["sounds"], $objects_data[$i]["attributes"]); 
    5252                                } else if ($objects_data[$i]["class"]=="soundscape") { 
    5353                                        $enclosure = "\t\t\t<enclosure url=\"".$root.$projectFolder.$project_data["id"]."/soundscape_".$objects_data[$i]["id"].".m3u\" length=\"12216320\" type=\"audio/x-mpegurl\" />\n"; 
     
    8585 
    8686// Para devolver el contenido de la etiqueta notours:soundpoint de un item a partir de los datos 
    87 function soundpoint_tag($data, $atributes) { 
     87function soundpoint_tag($data, $attributes) { 
    8888        global $soundFolder; 
    8989        $soundpoint_tag = ""; 
    9090        $soundpoint_tag .= "\t\t\t<notours:soundpoint>\n"; 
    9191        $soundpoint_tag .= "\t\t\t\t<notours:sound>\n"; 
    92         $soundpoint_tag .= "\t\t\t\t\t<notours:atributes>".$atributes."</notours:atributes>\n"; 
     92        $soundpoint_tag .= "\t\t\t\t\t<notours:attributes>".$attributes."</notours:attributes>\n"; 
    9393        $soundpoint_tag .= "\t\t\t\t\t<notours:file>/".$soundFolder.$data[0]["url"]."</notours:file>\n"; 
    9494        $soundpoint_tag .= "\t\t\t\t\t<notours:volume>".$data[0]["volume"]."</notours:volume>\n"; 
  • notours/noTours editor/inc/js/Gmaps.js

    r250 r251  
    88        //NotoursSoundscape(id, proyecto, title, description, sons, imgs, modified, geodata, angles)  
    99        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)); 
    1111        polyDragControl2.target = 0; 
    1212        polyDragControl2.mapClick(new GLatLng(geo[0], geo[1])); 
     
    1919                 
    2020        $("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         
    2223        inicia_jquery(); 
    2324        $("#marcador_0 .valor").attr("class","valor new"); 
     
    2728        $("#marcador_0 .corregir_texto").append(hidden_imput_html ("texto", 0, "descripcion de la nueva entrada")); 
    2829        $("#marcador_0 .corregir_coordenadas").append(hidden_coordenadas_html(0, geo[0], geo[1], geo[2])); 
     30        $("#marcador_0 .contenedor_atributos .caja_campo").show(); 
    2931} 
    3032function mapSoundscapeControl() { 
     
    6870 
    6971function engadeMarker(map) { 
     72         
    7073        var center = map.getCenter(); 
    7174        var geo = Array(center.lat(), center.lng(), 50); 
    7275        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         
    7482        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         
    7785        marcador_0.Gmarker.hide(); 
    7886        marcador_0.Gpolygon.hide(); 
     87         
    7988        $("ul").prepend(li_html(0,"marcador")); 
    80         $("#marcador_0").append(editar_marcador_html(0, proyectoActual)); 
     89        $("#marcador_0").append(marcador_0.html_editar(proyectoActual)); 
    8190        inicia_jquery(); 
    8291        $("#marcador_0 .valor").attr("class","valor new"); 
  • notours/noTours editor/inc/js/MPolyDragControl.js

    r250 r251  
    7171        GEvent.addListener(self.dragMarker1,'dragend',function(){self.dragEnd(this)}); 
    7272 
    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); 
    7474        this.map.addOverlay(this.polygons[0]); 
    7575         
  • notours/noTours editor/inc/js/NotoursObjects.js

    r250 r251  
    22// Notours Project Object 
    33//****************************** 
     4 
     5function Notoursattributes() { 
     6        this.key = new Array("speaker", "microphone", "inverse", "nonloop", "nonstop"); 
     7        this.value = new Array(false, false, false, false, false); 
     8} 
     9Notoursattributes.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} 
    431 
    532function NotoursProject() { 
     
    5380} 
    5481 
    55  
     82NotoursProject.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} 
    5686 
    5787//****************************** 
     
    72102        this.lonx = false; 
    73103        this.radius = false; 
     104        //notours 
     105        this.attributes = false; 
    74106        //Gmaps elements 
    75107        this.Gmarker = false; 
     
    77109} 
    78110 
    79 NotoursSoundpoint.prototype.initialize = function(id, proyecto, title, description, son, img, modified, geodata) { 
     111NotoursSoundpoint.prototype.initialize = function(id, proyecto, title, description, son, img, modified, geodata, attr) { 
    80112        //info 
    81113        this.id = id; 
     
    87119        if (img) this.img = img; 
    88120        //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(" "); 
    94127        } 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         
    109143        //Gmaps elements 
    110144        // creamos el marcador con los datos almacenados en las variables 
     
    132166} 
    133167 
    134  
     168NotoursSoundpoint.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&iacute;tulo:", "editar_texto", ""); 
     176        campo = imput_html("input", "marcador", "titulo", this.id, this.title, "&iquest;C&oacute;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&oacute;n da grabaci&oacute;n:", "editar_texto", ""); 
     180        campo = imput_html("textarea", "marcador", "texto", this.id, this.description, "Escribe unha pequena descripci&oacute;n da gravaci&oacute;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&oacute;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} 
    135228 
    136229//****************************** 
     
    153246        //notours 
    154247        this.angles = false; 
     248        this.attributes = false; 
    155249        //Gmaps elements 
    156250        this.Gmarker = false; 
     
    158252} 
    159253 
    160 NotoursSoundscape.prototype.initialize = function(id, proyecto, title, description, sons, imgs, modified, geodata, angles) { 
     254NotoursSoundscape.prototype.initialize = function(id, proyecto, title, description, sons, imgs, modified, geodata, attributes, angles) { 
    161255        //info 
    162256        this.id = id; 
     
    183277        } 
    184278        // Notours 
     279        this.attributes = new Notoursattributes(); 
     280        this.attributes.initialize(attributes); 
     281         
    185282        if (typeof angles == "string") { 
    186283                this.angles = angles.split(" "); 
     
    217314        }        
    218315} 
     316 
     317NotoursSoundscape.prototype.html_editar = function(proyecto) { 
     318        var html = ""; 
     319        html += contenedor_html("marcador", "input", "titulo", this.id, "T&iacute;tulo:", "&iquest;C&oacute;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&oacute;n da grabaci&oacute;n:", "Escribe unha pequena descripci&oacute;n da gravaci&oacute;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&oacute;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  
    1919 
    2020function form_new_html() { 
    21         var html = "";  
     21        var html = ""; 
    2222        html += '\t<form id="crearAutor" class="recuadro" method="post" action="new.php">\n'; 
    2323        html += '\t\t<label for="newuser">nombre de usuario:</label><input type="text" name="newuser" id="newuser" value="">\n'; 
     
    2828        return html; 
    2929} 
     30 
     31function 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         
     48function 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 
    3067 
    3168function contenedor_html(contexto, type, campo, id, texto_valor, texto_campo, value, clase, before, extra) { 
     
    75112} 
    76113 
     114function 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 
     151function 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 
    77158function campo_html(contexto, type, campo, id, texto_campo, value, clase) { 
    78159        if ((clase)&&(clase!="")) { 
     
    81162                extraClass = ""; 
    82163        } 
    83         var html = "";  
     164        var html = ""; 
     165        // div caja_campo 
    84166        html += '\t\t<div class="caja_campo agochado">\n'; 
    85167        if (texto_campo!='') { 
    86168                html += '\t\t\t<label for="'+ campo +'_'+id+'">'+ texto_campo +'</label>\n'; 
    87169        } 
    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 
    102173        html += '\t\t</div>\n'; 
    103174        return html; 
    104175} 
    105176 
    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  
    113177function hidden_coordenadas_html(id, lat, lonx, radius) { 
    114178        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'; 
    121193        return html;             
    122194} 
     
    145217        html += '\t\t\t<div class="corregir_imagen"></div>\n'; 
    146218        html += '\t\t\t<div class="corregir_sonido"></div>\n'; 
     219        html += '\t\t\t<div class="corregir_atributos"></div>\n'; 
    147220        html += '\t\t\t<input class="submit" type="submit" name="valider" value="ok" />\n'; 
    148221        html += '\t\t</fieldset>\n'; 
     
    187260        html += '</form>\n'; 
    188261        return html; 
    189 } 
    190  
    191 function proyecto_html (id) { 
    192         if (eval('proyecto_'+id+'!=null')) {//esto no se hace asi deberia ser un typeof 
    193                 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         } 
    204262} 
    205263 
     
    228286        $("#proyecto_"+ id).append('\n<div id="pestanha_proyecto" class="pestanha">\n</div><!-- fin proyecto_'+ id +' -->\n'); 
    229287         
    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')); 
    231289         
    232290        $("#proyecto_"+ id).append('\t<div class="contenedor">\n\t</div><!-- fin .contenedor -->\n'); 
     
    249307        } 
    250308} 
    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&iacute;tulo:", "&iquest;C&oacute;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&oacute;n da grabaci&oacute;n:", "Escribe unha pequena descripci&oacute;n da gravaci&oacute;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&oacute;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  
    8282} 
    8383 
     84function 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 
    8494function agregarMarcador(item, proyecto) { 
    8595        //almacenamos en distintas variables la informacion contenida nen los chilNodes de cada item-marcador do xml 
    8696        var itemtags = item.getElementsByTagName("*"); 
     97        var xmlattributes = ""; 
    8798        for ( var j = 0; j < itemtags.length; j++ ) { 
    8899                var tag = itemtags[j].nodeName.toLowerCase(); 
    89100                switch  (tag) { 
    90101                        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                                        } 
    95119                                } 
    96120                                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; 
    118121                        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], ""); 
    124123                                break; 
    125124                        case 'enclosure': 
     
    136135        eval('marcador_' + xmlId + ' = new NotoursSoundpoint();'); 
    137136        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         
    139152        return xmlId; 
    140153} 
     
    147160                switch  (tag) { 
    148161                        case 'guid': 
    149                                 var xmlId = ""; 
    150                                 if (itemtags[j].firstChild) { 
    151                                         xmlId = itemtags[j].firstChild.data; 
    152                                 } 
     162                                var xmlId = itemChild(itemtags[j], ""); 
    153163                                break; 
    154164                        case 'title': 
    155                                 var xmlTitle = ""; 
    156                                 if (itemtags[j].firstChild) { 
    157                                         xmlTitle = itemtags[j].firstChild.data; 
    158                                 } 
     165                                var xmlTitle = itemChild(itemtags[j], ""); 
    159166                                break; 
    160167                        case 'description': 
    161                                 var xmlDesc = ""; 
    162                                 if (itemtags[j].firstChild) { 
    163                                         xmlDesc = itemtags[j].firstChild.data; 
    164                                 } 
     168                                var xmlDesc = itemChild(itemtags[j], ""); 
    165169                                break; 
    166170                        case 'pubdate': 
    167                                 var xmlDate = ""; 
    168                                 if (itemtags[j].firstChild) { 
    169                                         xmlDate = itemtags[j].firstChild.data; 
    170                                 } 
     171                                var xmlDate = itemChild(itemtags[j], ""); 
    171172                                break; 
    172173                        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], ""); 
    177175                                break; 
    178176                        case 'enclosure': 
     
    184182                } 
    185183        } 
     184         
    186185        // 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 variables 
    190186        eval('proyecto_' + xmlId + ' = new NotoursProject();'); 
    191187        var proyecto = eval('proyecto_' + xmlId); 
    192188        proyecto.initialize(xmlId, xmlTitle, xmlDesc, xmlIMG, xmlType, xmlDate, xmlGeo); 
     189         
     190        $("ul").append(li_html(xmlId,"proyecto")); 
     191        $("#proyecto_"+ xmlId).append(proyecto.html()); 
     192                         
    193193        return xmlId; 
    194194         
     
    204204                jQuery("item", xml_marcadores).each(function(i, item_marcadores){ 
    205205                        $("#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); 
    217207                }); 
    218208                $("#terminal").append('<br />'); 
    219209                inicia_jquery(); 
    220210        }); 
     211} 
     212 
     213function 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 
     234function 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(); 
    221244} 
    222245 
     
    294317} 
    295318 
    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 proyectos 
    304         jQuery.get(url, function(xml_proyectos){ 
    305                 // jQuery almacena en un objeto xml los datos recogidos del documento leido para  
    306                 // cada elemento item vamos a agregar un marcador en el mapa 
    307                 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 } 
    324319function enviarMarcador(formulario, callBack){ 
    325320        var values = $(formulario).serialize(); 
     
    336331                // si la variable marcador_id no existe se trata de un nuevo marcador 
    337332                } 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("", "", "", "", "", "", "", ""); 
    340335                        for(i=0; i<campos.length; i++) { 
    341336                                if(eval("typeof data."+campos[i]) != "undefined") { 
     
    344339                                } 
    345340                        } 
    346                         var geo = data.geodata.split(" "); 
    347                         $("#terminal").append("geodata = '"+ data.geodata +"';" + '<br />'); 
    348                          
    349341                        eval('marcador_' + data.id + ' = new NotoursSoundpoint();'); 
    350342                        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]); 
    353344                        $("#marcador_0").remove(); 
    354345                        map.removeOverlay(marcador_0.Gmarker); 
    355346                        map.removeOverlay(marcador_0.Gpolygon); 
    356347                        $("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])); 
    358349                        inicia_jquery(); 
    359350                                         
     
    386377                                $("#terminal").append("Descripci&oacute;n = '"+ data.description +"';" + '<br />'); 
    387378                        } 
     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                        } 
    388386                        if (typeof data.geodata != "undefined") { 
    389387                                var jsonGeo = data.geodata.split(" "); 
     
    396394                                map.addOverlay(marcador.Gpolygon); 
    397395                                $("#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"); 
    401399                                $("#terminal").append("GeoData = '"+ data.geodata +"';" + '<br />'); 
    402400                        } 
    403401                } 
    404                 //alert("aqui"); 
    405402                first = true; 
    406403                polyDragControl.clear(); 
    407                  
    408404                if (callBack) { 
    409405                        callBack(); 
     
    491487                $("#" + id + " .contenedor_lonx").toggle(); 
    492488                $("#" + id + " .contenedor_lat").toggle(); 
     489                $("#" + id + " .contenedor_atributos").toggle(); 
    493490        }); 
    494491        $(".marcador").mouseover( function(){ 
     
    508505                //aclara(0.8, 0.2, data[1]); 
    509506        }); 
    510         $(".valor").dblclick( function(){ 
     507        $(".editar_texto").dblclick( function(){ 
    511508                var data = $(this).attr("name").split("_"); 
    512509        var contexto = data[0]; 
     
    518515                } 
    519516        }); 
     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        /* 
    520538        $(".editar_marcador").click( function(){ 
    521539                var data = $(this).attr("name").split("_"); 
     
    523541                abrir_ventana(id); 
    524542        }); 
     543        */ 
    525544        $(".editar_coordenadas").dblclick( function(){ 
    526545                var data = $(this).attr("name").split("_"); 
     
    537556        $("input[type=\'text\']").blur( function(){ 
    538557                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"); 
    539578    }); 
    540579    $("textarea").blur( function(){ 
     
    648687                $("#proyecto_"+ proyectoActual +" .contenedor").slideToggle("slow"); 
    649688                if (desplagable) { 
    650                         $('#marcadores').animate({top: "30px"}, "slow"); 
     689                        $('#marcadores').animate({top: "105px"}, "slow"); 
    651690                } else { 
    652691                        $('#marcadores').animate({top: "320px"}, "slow"); 
     
    714753                                } else { 
    715754                                        proyectoActual = null; 
     755                                        proyectos.splice(eval('proyecto_'+value[2]+'.numero'),1); 
    716756                                        eval('proyecto_'+value[2]+'=null'); 
    717757                                        $("#proyecto_"+ proyectoActual +" .contenedor").hide(); 
  • notours/noTours editor/index.html

    r250 r251  
    2222        </script> 
    2323        <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 --> 
    2525         
    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> 
    2727        <div id="cajaMapa"> 
    2828                <div id="mapa_marcadores"></div><!-- fin mapa_marcadores -->