osmll_value.htm 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. $Id$
  6. -%>
  7. <%+cbi/valueheader%>
  8. <% if self:cfgvalue(section) ~= false then %>
  9. <% if self.latfield and self.lonfield then %>
  10. <input type="hidden" <%= attr("value", string.format('cbid.%s.%s.%s', self.config, section, self.latfield))..attr("id", cbid..".latfield")..attr("name", cbid..".latfield")%>/>
  11. <input type="hidden" <%= attr("value", string.format('cbid.%s.%s.%s', self.config, section, self.lonfield))..attr("id", cbid..".lonfield")..attr("name", cbid..".lonfield")%>/>
  12. <% end %>
  13. <input type="hidden" <%= attr("value", self.centerlat)..attr("id", cbid..".centerlat")..attr("name", cbid..".centerlat")%>/>
  14. <input type="hidden" <%= attr("value", self.centerlon)..attr("id", cbid..".centerlon")..attr("name", cbid..".centerlon")%>/>
  15. <input type="hidden" <%= attr("value", self.zoom)..attr("id", cbid..".zoom")..attr("name", cbid..".zoom")%>/>
  16. <% end %>
  17. <% if self.popup then %>
  18. <input class="cbi-button cbi-input-button" type="button"<%= attr("name", cbid..".button")..attr("id", cbid..".button")..attr("value", self.displaytext)%>
  19. onclick="
  20. 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');
  21. popup.focus();
  22. "
  23. />
  24. </div>
  25. <div>
  26. <% else %>
  27. <input class="cbi-button cbi-input-button" type="button"<%= attr("name", cbid..".displayosm")..attr("id", cbid..".displayosm")..attr("value", self.displaytext)%>
  28. onclick="
  29. document.getElementById('<%=cbid..".hideosm"%>').style.display='inline';
  30. document.getElementById('<%=cbid..".displayosm"%>').style.display='none';
  31. for(var i = 0; Math.min(i, window.frames.length)!=window.frames.lengths; i++){
  32. if(frames[i].name=='<%=cbid..".iframe"%>'){
  33. document.getElementById('<%=cbid..".iframediv"%>').style.display='block';
  34. frames[i].location.href='/luci-static/resources/OSMLatLon.htm';
  35. }
  36. }
  37. "
  38. />
  39. <input class="cbi-button cbi-input-button" style="display:none" type="button"<%= attr("name", cbid..".hideosm")..attr("id", cbid..".hideosm")..attr("value", self.hidetext)%>
  40. onclick="
  41. document.getElementById('<%=cbid..".displayosm"%>').style.display='inline';
  42. document.getElementById('<%=cbid..".hideosm"%>').style.display='none';
  43. document.getElementById('<%=cbid..".iframediv"%>').style.display='none';
  44. "
  45. />
  46. </div>
  47. <div class="cbi-value-osmiframesection" id="<%=cbid..".iframediv"%>" style="display:none">
  48. <iframe src="" <%= attr("id", cbid..".iframe")..attr("name", cbid..".iframe")..attr("width", self.width)..attr("height", self.height)%> frameborder="0" scrolling="no"></iframe>
  49. <%end%>
  50. <%+cbi/valuefooter%>