guias.js
20.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
/**
* Title: Guias
*
* Cria e controla os blocos de opções ativados por meio de guias
* ou botões
*
* As guias alternam conteúdos para exibição conforme as escolhas feitas pelo usuário
*
* Namespace:
*
* i3GEO.guias
*
* Veja:
*
* <http://localhost/i3geo/classesjs/classe_guias.js>
*/
/**
* Licença
*
* GPL2
*
* i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet
*
* Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com
*
* Este programa é software livre; você pode redistribuí-lo e/ou modificá-lo sob os termos da Licença
* Pública Geral GNU conforme publicada pela Free Software Foundation;
*
* Este programa é distribuído na expectativa de que seja útil, porém, SEM NENHUMA GARANTIA; nem mesmo a
* garantia implícita de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. Consulte a Licença
* Pública Geral do GNU para mais detalhes. Você deve ter recebido uma cópia da Licença Pública Geral do
* GNU junto com este programa; se não, escreva para a Free Software Foundation, Inc., no endereço 59 Temple Street, Suite
* 330, Boston, MA 02111-1307 USA.
*/
if (typeof (i3GEO) === 'undefined') {
var i3GEO = {};
}
i3GEO.guias =
{
LARGURAGUIAMOVEL : 350,
/**
* Propriedade: CONFIGURA
*
* Define os parâmetros de cada guia que será mostrada no mapa, como título, conteúdo, etc.
*
* Você pode modificar o nome de uma guia como no exemplo
*
* i3GEO.guias.CONFIGURA.legenda.titulo = "nome diferente";
*
* Por padrão são definidas as guias legenda, temas, adiciona e mapas (links)
*
* Exemplo:
*
* (start code)
*
* i3GEO.guias.CONFIGURA.legenda = { icone : "imagens/gisicons/show-legend.png", titulo : "Legenda", id : "guia4", idconteudo :
* "guia4obj", click : function() { i3GEO.guias.mostra("legenda"); i3GEO.mapa.legendaHTML.cria("guia4obj"); } };
*
* (end)
*
* Tipo:
*
* {objeto}
*/
CONFIGURA : {
"zoomanterior" : {
icone : "imagens/gisicons/zoom-last.png",
titulo : "",
id : "guiaZoomanterior",
idconteudo : "",
click : function() {
i3GEO.navega.extensaoAnterior();
}
},
"zoomli" : {
icone : "imagens/gisicons/zoom-region.png",
titulo : $trad("d3"),
id : "guiaZoomli",
idconteudo : "",
click : function() {
if (DetectaMobile("DetectMobileLong")) {
i3GEO.janela.tempoMsg($trad("x70"));
} else {
i3GEO.janela.tempoMsg($trad("x69"));
}
if (i3GEO.Interface.ATUAL === "googlemaps") {
// alert("Pressione a tecla CTRL junto com o botão esquerdo do mouse");
i3GeoMap.setOptions({
draggable : true
});
}
}
},
"zoomproximo" : {
icone : "imagens/gisicons/zoom-next.png",
titulo : "",
id : "guiaZoomproximo",
idconteudo : "",
click : function() {
i3GEO.navega.extensaoProximo();
}
},
"zoomtot" : {
icone : "imagens/gisicons/zoom-extent.png",
titulo : $trad("d2"),
id : "guiaZoomtot",
idconteudo : "",
click : function() {
if (i3GEO.Interface.ATUAL === "openlayers") {
i3GEO.Interface.openlayers.zoom2ext(i3GEO.parametros.extentTotal);
return;
}
if (i3GEO.Interface.ATUAL === "googlemaps") {
i3GEO.Interface.googlemaps.zoom2extent(i3GEO.parametros.extentTotal);
return;
}
}
},
"identificaBalao" : {
icone : "imagens/gisicons/tips.png",
titulo : $trad("d7a"),
id : "guiaIdentificaBalao",
idconteudo : "",
click : function() {
if (typeof (console) !== 'undefined')
console.info("click no botao identifica balao");
i3GEO.mapa.ativaIdentificaBalao();
}
},
"identifica" : {
icone : "imagens/gisicons/pointer-info.png",
titulo : $trad("d7"),
id : "guiaIdentifica",
idconteudo : "",
click : function() {
if (typeof (console) !== 'undefined')
console.info("click no botao identifica");
//$('.iconeGuiaMovel').tooltip('destroy');
i3GEO.mapa.ativaIdentifica();
}
},
"mapas" : {
icone : "imagens/gisicons/show-links.png",
titulo : "Links",
id : "guia5",
idconteudo : "guia5obj",
mostraLink : function(id, url) {
$i("i3geoMapasLink_" + id).innerHTML = "<a href='" + url + "' target=_blank >" + $trad("abreMapa") + "</a>";
},
click : function(onde) {
if (!onde) {
onde = i3GEO.guias.CONFIGURA.mapas.idconteudo;
}
//$('.iconeGuiaMovel').tooltip('destroy');
var pegaMapas =
function(retorno) {
var ins, mapa, ig1lt, ig1, nome, lkd, link, temp, combo, urlinterface;
ins = "<br><div id='banners' style='overflow:auto;text-align:center'>";
ins += "<br>";
mapa = retorno.data.mapas;
ig1lt = mapa.length;
ig1 = 0;
urlinterface = window.location.origin + window.location.pathname;
if (ig1lt > 0) {
do {
temp = mapa[ig1];
nome = temp.NOME;
if (temp.PUBLICADO) {
if (temp.PUBLICADO.toLowerCase() === "nao") {
nome = "<s>" + nome + "</s>";
}
}
lkd = temp.LINK;
link = i3GEO.configura.locaplic + "/ms_criamapa.php?temasa=" + temp.TEMAS + "&layers=" + temp.LIGADOS;
if (temp.EXTENSAO !== "") {
link += "&mapext=" + temp.EXTENSAO;
}
if (temp.OUTROS !== "") {
link += "&" + temp.OUTROS;
}
if (lkd !== "") {
link = lkd;
}
ins +=
"<div style='cursor:pointer; height: 120px;float: left;width:45%;background-color:white;padding:5px;margin:5px;border: 1px solid #F0F0F0;border-radius: 5px;box-shadow: 1px 1px 1px 1px #D3D3D3;' >";
if (temp.IMAGEM && temp.IMAGEM != "") {
ins +=
"<div style='float:left;margin:2px' ><a href='" + link
+ "' style=text-align:center;text-decoration:none; >"
+ "<img src='"
+ temp.IMAGEM
+ "'></a></div>";
}
// verifica se o mapfile esta salvo no banco
// diretamente
nome += " (" + temp.ID_MAPA + ")";
if (temp.CONTEMMAPFILE == "nao") {
ins +=
"<div class=paragrafo style='text-align:left;'>" + "<a href='"
+ link
+ "' style=text-align:left;text-decoration:none; >"
+ nome
+ "</a></div>";
} else {
// combo de opcoes para abrir os mapas
// salvos
// como mapfiles
combo =
"<select style='width:170px;' onchange='i3GEO.guias.CONFIGURA.mapas.mostraLink(" + ig1
+ ",this.value)'>"
+ "<option value=''>"
+ $trad("x103")
+ ":</option>"
+ "<option value='"
+ link
+ "'>Como foi salvo</option>"
+ "<option value='"
+ link
+ "&interface="
+ urlinterface
+ "'>Com a interface atual</option>"
+ "<option value='"
+ i3GEO.configura.locaplic
+ "/mashups/openlayers.php?numzoomlevels=18&restauramapa="
+ temp.ID_MAPA
+ "&fundo=e_wsm'>Openlayers com todos os botoes</option>"
+ "<option value='"
+ i3GEO.configura.locaplic
+ "/mashups/openlayers.php?numzoomlevels=18&restauramapa="
+ temp.ID_MAPA
+ "&fundo=est_wms'>Sem o fundo</option>"
+ "<option value='"
+ i3GEO.configura.locaplic
+ "/mashups/openlayers.php?numzoomlevels=18&restauramapa="
+ temp.ID_MAPA
+ "&fundo=e_wsm&botoes=legenda pan zoombox zoomtot zoomin zoomout distancia area identifica'>Com botoes principais</option>"
+ "<option value='"
+ i3GEO.configura.locaplic
+ "/mashups/osm.php?numzoomlevels=18&restauramapa="
+ temp.ID_MAPA
+ "&fundo=e_wsm&botoes=legenda pan zoombox zoomtot zoomin zoomout distancia area identifica'>Com botoes principais e OSM</option>"
+ "<option value='"
+ i3GEO.configura.locaplic
+ "/mashups/openlayers.php?numzoomlevels=18&restauramapa="
+ temp.ID_MAPA
+ "&botoes=legenda pan zoombox zoomtot zoomin zoomout'>Botoes de navegacao</option>"
+ "</select>";
ins +=
"<div style='float:left;margin:2px'>" + "<img src='"
+ i3GEO.configura.locaplic
+ "/ferramentas/salvamapa/geraminiatura.php?w=100&h=67&restauramapa="
+ temp.ID_MAPA
+ "'></div><div class=paragrafo style='text-align:left;'><a href='"
+ link
+ "' style=text-align:center;text-decoration:none; >"
+ nome
+ "</a></div>"
+ combo
+ "<br><div style='cursor:pointer;' id='i3geoMapasLink_"
+ ig1
+ "' ></div>";
}
ins += "</div>";
ig1++;
} while (ig1 < ig1lt);
}
$i(onde).innerHTML = ins + "</div>";
};
if ($i(i3GEO.guias.CONFIGURA.mapas.idconteudo)) {
$i(i3GEO.guias.CONFIGURA.mapas.idconteudo).innerHTML = "Aguarde...";
}
//i3GEO.guias.mostra("mapas");
i3GEO.php.pegaMapas(pegaMapas);
i3GEO.navega.removeCookieExtensao();
}
},
"dobraPagina" : {
icone : "imagens/googlemaps.png",
titulo : $trad("trocaInterface"),
id : "guia6",
idconteudo : "",
inicializa : function(){
if (i3GEO.Interface.ATUAL === "googlemaps") {
i3GEO.guias.CONFIGURA.dobraPagina.icone = "imagens/openlayers.png";
}
else{
i3GEO.guias.CONFIGURA.dobraPagina.icone = "imagens/googlemaps.png";
}
},
click : function() {
if (typeof (console) !== 'undefined')
console.info("i3GEO.guias dobraPagina.click");
//$('.iconeGuiaMovel').tooltip('destroy');
i3GEO.Interface.atual2gm.insereIcone = false;
i3GEO.Interface.atual2ol.insereIcone = false;
if (i3GEO.Interface.ATUAL === "googlemaps") {
if (typeof i3GeoMap.getStreetView != "undefined"){
if(i3GeoMap.getStreetView().getVisible() === true) {
i3GeoMap.getStreetView().setVisible(false);
}
}
i3GEO.Interface.atual2ol.inicia();
i3GEO.guias.CONFIGURA.dobraPagina.icone = "imagens/googlemaps.png";
}
if (i3GEO.Interface.ATUAL === "openlayers") {
i3GEO.Interface.atual2gm.inicia();
i3GEO.guias.CONFIGURA.dobraPagina.icone = "imagens/openlayers.png";
}
$i("iconeTrocaInterface").src = i3GEO.configura.locaplic + "/" + i3GEO.guias.CONFIGURA.dobraPagina.icone;
}
},
"buscaRapida" : {
icone : "imagens/gisicons/search.png",
titulo : "",
id : "guia7",
idconteudo : "guia7obj",
idBuscaRapida : "buscaRapidaGuia",
click : function(obj) {
if (typeof (console) !== 'undefined')
console.info("click no botao que abre a guia de camadas");
//$('.iconeGuiaMovel').tooltip('destroy');
var f = i3GEO.guias.CONFIGURA.buscaRapida;
obj = $(obj);
if(obj.attr("data-idconteudo") != undefined){
f.idconteudo = obj.attr("data-idconteudo");
}
}
},
"legenda" : {
icone : "imagens/legenda.png",
titulo : $trad("g3"),
id : "guia4",
idconteudo : "guia4obj",
idLegenda: "legendaHtml",
click : function(obj) {
if (typeof (console) !== 'undefined')
console.info("click no botao que abre a guia de camadas");
//$('.iconeGuiaMovel').tooltip('destroy');
var f = i3GEO.guias.CONFIGURA.legenda;
obj = $(obj);
if(obj.attr("data-idLegenda") != undefined){
f.idLegenda = obj.attr("data-idLegenda");
}
//necessario para a legenda nao ser atualizada nos eventos desnecessariamente
if($i(f.idLegenda)){
$i(f.idLegenda).style.display = "block";
i3GEO.legenda.CAMADAS = "";
i3GEO.legenda.inicia({
"idLegenda": f.idLegenda,
"templateLegenda": $("#" + f.idLegenda).attr("data-template"),
"janela": false
});
}
}
},
"temas" : {
icone : "imagens/layer.png",
titulo : $trad("g4a"),
id : "guia1",
idconteudo : "guia1obj",
idListaDeCamadas : "listaTemas",
idListaFundo : "listaFundo",
idListaLayersGr : "listaLayersGr",
verificaAbrangencia : "",
click : function(obj){
if (typeof (console) !== 'undefined')
console.info("click no botao que abre a guia de camadas");
//$('.iconeGuiaMovel').tooltip('destroy');
var f = i3GEO.guias.CONFIGURA.temas;
obj = $(obj);
if(obj.attr("data-verificaAbrangencia") != undefined){
f.verificaAbrangencia = obj.attr("data-verificaAbrangencia");
}
if(obj.attr("data-idconteudo") != undefined){
f.idconteudo = obj.attr("data-idconteudo");
}
if(obj.attr("data-idListaDeCamadas") != undefined){
f.idListaDeCamadas = obj.attr("data-idListaDeCamadas");
}
if(obj.attr("data-idListaFundo") != undefined){
f.idListaFundo = obj.attr("data-idListaFundo");
}
if(obj.attr("data-idListaLayersGr") != undefined){
f.idListaLayersGr = obj.attr("data-idListaLayersGr");
}
if($("#" + obj.attr("data-idListaFundo")).attr("data-idTemplateCamada") != undefined){
f.idTemplateCamadaFundo = $("#" + obj.attr("data-idListaFundo")).attr("data-idTemplateCamada");
}
if($i(f.idListaDeCamadas)){
i3GEO.arvoreDeCamadas.inicia({
"idOnde" : f.idListaDeCamadas,
"templateCamada": $("#" + f.idListaDeCamadas).attr("data-template"),
"idListaFundo": f.idListaFundo,
"templateCamadaFundo": $("#" + f.idListaFundo).attr("data-template"),
"idListaLayersGr": f.idListaLayersGr,
"templateCamadaGr": $("#" + f.idListaLayersGr).attr("data-template"),
"verificaAbrangencia": f.verificaAbrangencia
});
}
}
},
"adiciona" : {
icone : "imagens/catalogo.png",
titulo : $trad("g1a"),
id : "guia2",
idconteudo : "guia2obj",
idMenus: "catalogoMenus", //lista de menus
idCatalogo: "catalogoPrincipal", //onde vai a lista inicial
idNavegacao: "catalogoNavegacao",
idMigalha: "catalogoMigalha",
click : function(obj) {
if (typeof (console) !== 'undefined')
console.info("click no botao que abre a guia de adicao de temas");
//$('.iconeGuiaMovel').tooltip('destroy');
var f = i3GEO.guias.CONFIGURA.adiciona;
if($(obj).attr("data-idconteudo") != undefined){
f.idconteudo = $(obj).attr("data-idconteudo");
}
if($(obj).attr("data-idMenus") != undefined){
f.idMenus = $(obj).attr("data-idMenus");
}
if($(obj).attr("data-idCatalogo") != undefined){
f.idCatalogo = $(obj).attr("data-idCatalogo");
}
if($(obj).attr("data-idNavegacao") != undefined){
f.idNavegacao = $(obj).attr("data-idNavegacao");
}
if($(obj).attr("data-idMigalha") != undefined){
f.idMigalha = $(obj).attr("data-idMigalha");
}
if($(obj).attr("data-folderFirst") != undefined){
f.folderFirst = $(obj).attr("data-folderFirst");
} else {
f.folderFirst = "false";
}
var ondeMenus = $( "#" + f.idMenus );
i3GEO.catalogoMenus.listaMenus({
"templateDir": ondeMenus.attr("data-templateDir"),
"templateTema": ondeMenus.attr("data-templateTema"),
"idOndeMenus": f.idMenus,
"idCatalogoPrincipal": f.idCatalogo,
"idCatalogoNavegacao": f.idNavegacao,
"idOndeMigalha": f.idMigalha,
"folderFirst": f.folderFirst
});
}
},
"ferramentas" : {
icone : "imagens/gisicons/tools.png",
titulo : $trad("u15a"),
id : "guia8",
idconteudo : "guia8obj",
idLista: "listaFerramentas",
idMigalha: "migalhaFerramentas",
idLinks: "listaFerramentasLinks",
status: false,
click : function(obj) {
if (typeof (console) !== 'undefined')
console.info("click no botao que abre a guia das ferramentas");
//$('.iconeGuiaMovel').tooltip('destroy');
if($(obj).attr("data-idconteudo") != undefined){
i3GEO.guias.CONFIGURA.ferramentas.idconteudo = $(obj).attr("data-idconteudo");
}
if($(obj).attr("data-idLista") != undefined){
i3GEO.guias.CONFIGURA.ferramentas.idLista = $(obj).attr("data-idLista");
}
if($(obj).attr("data-idMigalha") != undefined){
i3GEO.guias.CONFIGURA.ferramentas.idMigalha = $(obj).attr("data-idMigalha");
}
if($(obj).attr("data-idLinks") != undefined){
i3GEO.guias.CONFIGURA.ferramentas.idLinks = $(obj).attr("data-idLinks");
}
if(i3GEO.util.checaHtmlVazio(i3GEO.guias.CONFIGURA.ferramentas.idLista) == false || i3GEO.util.checaHtmlVazio(i3GEO.guias.CONFIGURA.ferramentas.idLinks) == false){
return;
}
var f = i3GEO.guias.CONFIGURA.ferramentas;
i3GEO.caixaDeFerramentas.inicia({
"idOndeFolder": $( "#" + f.idLista ),
"idOndeLinks": $( "#" + f.idLinks ),
"idOndeMigalha" : f.idMigalha,
"templateFolder" : $( "#" + f.idLista ).attr("data-template"),
"templateMigalha" : $("#" + f.idMigalha).attr("data-template"),
"templateLinks" : $( "#" + f.idLinks ).attr("data-template")
});
}
}
},
/**
* Ajusta a altura das guias conforme a altura da imagem do mapa
*/
ajustaAltura : function() {
if (typeof (console) !== 'undefined')
console.info("guias.ajustaAltura");
var guia, guias, nguias, temp, temps, n, i, g, altura = 0;
guias = i3GEO.util.listaChaves(i3GEO.guias.CONFIGURA);
nguias = guias.length;
for (g = 0; g < nguias; g++) {
guia = $i(this.CONFIGURA[guias[g]].idconteudo);
if (guia) {
guia.style.overflow = "auto";
if (!guia.style.height) {
guia.style.height = i3GEO.parametros.h + "px";
}
}
}
},
/**
* Esconde todas as guias
*/
escondeGuias : function() {
if (typeof (console) !== 'undefined')
console.info("guias.escondeGuias");
var guias, nguias, g, temp, attributes, anim;
guias = i3GEO.util.listaChaves(i3GEO.guias.CONFIGURA);
nguias = guias.length;
for (g = 0; g < nguias; g++) {
temp = $i(this.CONFIGURA[guias[g]].idconteudo);
if (temp) {
temp.style.display = "none";
}
}
$("#i3GEOguiaMovelConteudo").css("display","none");
},
/**
* Mostra no mapa uma determinada guia
*
* Parametro:
*
* {String} - nome da guia
*/
mostra : function(guia) {
if (typeof (console) !== 'undefined')
console.info("guias.mostra");
// fecha o streetview
if (i3GEO.Interface.ATUAL === "googlemaps") {
if(typeof i3GeoMap.getStreetView != "undefined"){
i3GeoMap.getStreetView().setVisible(false);
}
}
var guias, nguias, g, temp, attributes, anim;
guias = i3GEO.util.listaChaves(i3GEO.guias.CONFIGURA);
nguias = guias.length;
if (!$i(i3GEO.guias.CONFIGURA[guia].idconteudo)) {
return;
}
if (i3GEO.guias.CONFIGURA[guia]) {
temp = $i(i3GEO.guias.CONFIGURA[guia].idconteudo);
if (temp) {
temp.style.display = "block";
$("#i3GEOguiaMovelMolde,#i3GEOguiaMovelConteudo").css("display","block");
}
}
},
/**
* Function: inicia
*
* Inicializa a guia móvel
*/
inicia : function() {
if (typeof (console) !== 'undefined')
console.info("guias.inicia");
if($i("i3GEOguiaMovel")){
i3GEO.guias.LARGURAGUIAMOVEL = parseInt($("#i3GEOguiaMovel").css("width"),10);
}
if(!$i("i3GEOguiaMovelMolde").style.height || $i("i3GEOguiaMovelMolde").style.height == ""){
$("#i3GEOguiaMovelMolde,#i3GEOguiaMovelConteudo").css("height",i3GEO.parametros.h + "px");
}
if(i3GEO.guias.LARGURAGUIAMOVEL > i3GEO.parametros.w){
i3GEO.guias.LARGURAGUIAMOVEL = i3GEO.parametros.w;
}
},
/**
* Ativa o conteúdo de determinada guia
*
* Parametro:
*
* chave {string} - código da guia, definido em i3GEO.guias.CONFIGURA
*/
ativa : function(chave,obj) {
if (typeof (console) !== 'undefined')
console.info("guias.ativa");
if(i3GEO.guias.LARGURAGUIAMOVEL > i3GEO.parametros.w){
i3GEO.guias.LARGURAGUIAMOVEL = i3GEO.parametros.w;
}
// nao tem conteudo para mostrar
var f="" ;
if (!$i(i3GEO.guias.CONFIGURA[chave].idconteudo)) {
f = i3GEO.guias.CONFIGURA[chave].click.apply(f,[obj]);
return;
}
i3GEO.guias.escondeGuias();
i3GEO.guias.abreFecha("abre",chave);
if (i3GEO.guias.CONFIGURA[chave].click) {
f = i3GEO.guias.CONFIGURA[chave].click.apply(f,[obj]);
}
},
/**
* Function: abreFecha
*
* Abre ou fecha a guia móvel
*/
abreFecha : function(forca,chave) {
if (typeof (console) !== 'undefined')
console.info("guias.abreFecha");
var molde = $("#i3GEOguiaMovelMolde");
if (!forca) {
if (parseInt(molde.css("width"),10) <= 10) {
forca = "abre";
} else {
forca = "fecha";
}
}
if (forca === "fecha") {// esconde
i3GEO.guias.escondeGuias();
molde.animate(
{ "width": "-10px" },
400
);
} else {
//$("#i3GEOguiaMovelIcones").css("display","block");
var temp = function(){
i3GEO.guias.mostra(chave);
};
molde.animate(
{ "width": i3GEO.guias.LARGURAGUIAMOVEL + "px" },
{duration: 400,always: temp}
);
}
},
//usado nas ferramentas
mostraGuiaFerramenta : function(guia, namespace) {
var g, Dom = YAHOO.util.Dom;
if (!namespace) {
namespace = "guia";
}
for (g = 0; g < 12; g++) {
Dom.setStyle(namespace + g + "obj", "display", "none");
}
Dom.setStyle(guia + "obj", "display", "block");
},
ajustaGuiaFerramenta : function(){}
};