Merge pull request #278 from nmav/ocserv
[project/luci.git] / modules / freifunk / luasrc / view / cbi / osmll_value.htm
1 <%#
2 cc-by-sa Andreas Pittrich <andreas.pittrich@web.de>
3 in behalf of the german pirate party (Piratenpartei)
4 www.piratenpartei.de
5
6 $Id$
7
8 -%>
9 <%+cbi/valueheader%>
10
11                 <% if self:cfgvalue(section) ~= false then %>
12                         <% if self.latfield and self.lonfield then %>
13                                 <input type="hidden" <%= attr("value", string.format('cbid.%s.%s.%s', self.config, section, self.latfield))..attr("id", cbid..".latfield")..attr("name", cbid..".latfield")%>/>
14                                 <input type="hidden" <%= attr("value", string.format('cbid.%s.%s.%s', self.config, section, self.lonfield))..attr("id", cbid..".lonfield")..attr("name", cbid..".lonfield")%>/>
15                         <% end %>
16                         <input type="hidden" <%= attr("value", self.centerlat)..attr("id", cbid..".centerlat")..attr("name", cbid..".centerlat")%>/>
17                         <input type="hidden" <%= attr("value", self.centerlon)..attr("id", cbid..".centerlon")..attr("name", cbid..".centerlon")%>/>
18                         <input type="hidden" <%= attr("value", self.zoom)..attr("id", cbid..".zoom")..attr("name", cbid..".zoom")%>/>
19                 <% end %>
20
21                 <% if self.popup then %>
22                         <input class="cbi-button cbi-input-button" type="button"<%= attr("name", cbid..".button")..attr("id", cbid..".button")..attr("value", self.displaytext)%> 
23                                         onclick="
24                                                 popup=window.open('/luci-static/resources/OSMLatLon.htm', '<%=cbid%>.window', 'innerWidth=<%=self.width%>, innerHeight=<%=self.height%>, location=no, menubar=no, scrollbars=no, status=no, toolbar=no');
25                                                 popup.focus();
26                                         "
27                         />
28         </div>
29         <div>           
30                 <% else %>
31                         <input class="cbi-button cbi-input-button" type="button"<%= attr("name", cbid..".displayosm")..attr("id", cbid..".displayosm")..attr("value", self.displaytext)%> 
32                                         onclick="
33                                                 document.getElementById('<%=cbid..".hideosm"%>').style.display='inline';
34                                                 document.getElementById('<%=cbid..".displayosm"%>').style.display='none';
35                                                 for(var i = 0; Math.min(i, window.frames.length)!=window.frames.lengths; i++){
36                                                         if(frames[i].name=='<%=cbid..".iframe"%>'){                                                             
37                                                                 document.getElementById('<%=cbid..".iframediv"%>').style.display='block';
38                                                                 frames[i].location.href='/luci-static/resources/OSMLatLon.htm';
39                                                         }
40                                                 }
41                                         "
42                         />
43                         <input class="cbi-button cbi-input-button" style="display:none" type="button"<%= attr("name", cbid..".hideosm")..attr("id", cbid..".hideosm")..attr("value", self.hidetext)%> 
44                                         onclick="
45                                                 document.getElementById('<%=cbid..".displayosm"%>').style.display='inline';
46                                                 document.getElementById('<%=cbid..".hideosm"%>').style.display='none';
47                                                 document.getElementById('<%=cbid..".iframediv"%>').style.display='none';
48                                         "
49                         />
50         </div>
51         <div class="cbi-value-osmiframesection" id="<%=cbid..".iframediv"%>" style="display:none">
52                         <iframe src="" <%= attr("id", cbid..".iframe")..attr("name", cbid..".iframe")..attr("width", self.width)..attr("height", self.height)%> frameborder="0" scrolling="no"></iframe>
53                 <%end%>
54
55 <%+cbi/valuefooter%>