main.htm 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <%
  2. --[[
  3. LuCI - Lua Configuration Interface
  4. Copyright 2012 Manuel Munz <freifunk at somakoma dot de>
  5. Licensed under the Apache License, Version 2.0 (the "License");
  6. you may not use this file except in compliance with the License.
  7. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. ]]--
  10. local url = data['url']
  11. local name = data['.name']
  12. local title = data['title'] or "No title set"
  13. local height = data['height'] or "400px"
  14. if type(height) == "number" then
  15. height = height .. "px"
  16. end
  17. local width = data['width'] or "100%"
  18. if type(width) == "number" then
  19. width = width .. "px"
  20. end
  21. %>
  22. <div id="<%=name%>" style="width:<%=width%>;float:left;">
  23. <h2><%=title%></h2>
  24. <% if not url then %>
  25. <%:No url set.%>
  26. <% else %>
  27. <div style="height:<%=height%>;min-height:<%=height%>">
  28. <object type="text/html" data="<%=url%>" width="100%" height="<%=height%>" name="widget_<%=name%>" id="widget_<%=name%>">
  29. <param name="src" value="<%=url%>" />
  30. <%:Sorry, your browser doesn't support the object tag and cannot display this page:%><br />
  31. <a href="<%=url%>"><%=url%></a>
  32. </object>
  33. </div>
  34. </div>
  35. <%end%>