]> git.openstreetmap.org Git - rails.git/commitdiff
Experimental CSS media queries to support iPhone and other small-screen devices.
authorMatt Amos <zerebubuth@gmail.com>
Tue, 18 Aug 2009 16:06:26 +0000 (16:06 +0000)
committerMatt Amos <zerebubuth@gmail.com>
Tue, 18 Aug 2009 16:06:26 +0000 (16:06 +0000)
app/views/layouts/site.html.erb
app/views/user/login.html.erb
public/stylesheets/site-sml.css [new file with mode: 0644]

index 59b7c304bd94e573c030e057f750b802dd782dcd..ed8c1456b5dd6e8fe45f3f0d810ff65a799a4d85 100644 (file)
@@ -1,11 +1,14 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<%= I18n.locale %>" lang="<%= I18n.locale %>" dir="<%= t'html.dir' %>">
   <head>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<%= I18n.locale %>" lang="<%= I18n.locale %>" dir="<%= t'html.dir' %>">
   <head>
+    <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0">
     <%= javascript_include_tag 'prototype' %>
     <%= javascript_include_tag 'site' %>
     <!--[if lt IE 7]><%= javascript_include_tag 'pngfix' %><![endif]--> <!-- thanks, microsoft! -->
     <%= javascript_include_tag 'prototype' %>
     <%= javascript_include_tag 'site' %>
     <!--[if lt IE 7]><%= javascript_include_tag 'pngfix' %><![endif]--> <!-- thanks, microsoft! -->
-    <%= stylesheet_link_tag 'site' %>
-    <%= stylesheet_link_tag 'print', :media => "print" %>
+    <!--[if IE]><%= stylesheet_link_tag 'site', :media => "screen" %><![endif]--> <!-- IE is totally broken with CSS media queries -->
+    <%= stylesheet_link_tag 'site-sml', :media => "only screen and (max-width: 481px)" %> 
+    <%= stylesheet_link_tag 'site', :media => "screen and (min-width: 482px)" %> 
+    <%= stylesheet_link_tag 'print', :media => "print" %> 
     <%= tag("link", { :rel => "search", :type => "application/opensearchdescription+xml", :title => "OpenStreetMap Search", :href => "/opensearch/osm.xml" }) %>
     <%= tag("meta", { :name => "description", :content => "OpenStreetMap is the free wiki world map." }) %>
     <%= yield :head %>
     <%= tag("link", { :rel => "search", :type => "application/opensearchdescription+xml", :title => "OpenStreetMap Search", :href => "/opensearch/osm.xml" }) %>
     <%= tag("meta", { :name => "description", :content => "OpenStreetMap is the free wiki world map." }) %>
     <%= yield :head %>
index dc10011172a41a32598bff8a36852667ed3d3065..9b6d62f92fc1f96b201de57def528b9213efa07d 100644 (file)
@@ -5,7 +5,7 @@
 <% form_tag :action => 'login' do %>
 <%= hidden_field_tag('referer', h(params[:referer])) %>
 <table>
 <% form_tag :action => 'login' do %>
 <%= hidden_field_tag('referer', h(params[:referer])) %>
 <table>
-  <tr><td class="fieldName"><%= t 'user.login.email or username' %></td><td><%= text_field('user', 'email',{:size => 50, :maxlength => 255, :tabindex => 1}) %></td></tr>
+  <tr><td class="fieldName"><%= t 'user.login.email or username' %></td><td><%= text_field('user', 'email',{:size => 28, :maxlength => 255, :tabindex => 1}) %></td></tr>
   <tr><td class="fieldName"><%= t 'user.login.password' %></td><td><%= password_field('user', 'password',{:size => 28, :maxlength => 255, :tabindex => 2}) %> <span class="minorNote">(<%= link_to t('user.login.lost password link'), :controller => 'user', :action => 'lost_password' %>)</span></td></tr>
   <tr><td colspan=2>&nbsp;<!--vertical spacer--></td></tr>
   <tr><td></td><td align="right"><%= submit_tag t('user.login.login_button'), :tabindex => 3 %></td></tr>
   <tr><td class="fieldName"><%= t 'user.login.password' %></td><td><%= password_field('user', 'password',{:size => 28, :maxlength => 255, :tabindex => 2}) %> <span class="minorNote">(<%= link_to t('user.login.lost password link'), :controller => 'user', :action => 'lost_password' %>)</span></td></tr>
   <tr><td colspan=2>&nbsp;<!--vertical spacer--></td></tr>
   <tr><td></td><td align="right"><%= submit_tag t('user.login.login_button'), :tabindex => 3 %></td></tr>
diff --git a/public/stylesheets/site-sml.css b/public/stylesheets/site-sml.css
new file mode 100644 (file)
index 0000000..e3f3715
--- /dev/null
@@ -0,0 +1,65 @@
+body {
+  font-family: Arial,sans-serif;
+  color: #000;
+  background-color: #fff;
+  font-size: 12px;
+}
+
+#left {
+  display: none;
+}
+
+#greeting {
+  position: absolute;
+  top: 0px;
+  right: 0px;
+  height: 16px;
+  margin: 0px;
+  padding-right: 10px;
+  font-size: 13px;
+  line-height: 14px;
+}
+
+#content {
+  padding-top: 16px;
+  height: 640px;
+}
+
+#tabnav {
+/*  display: none;*/
+}
+
+#sidebar {
+  display: none;
+}
+
+#permalink {
+  display: none;
+}
+
+input[type="text"], input[type="password"], textarea {
+  border: 1px solid black;
+  font-size: 12px;
+}
+
+.olControlPanZoomBar {
+  display: none;
+}
+
+.olControlLayerSwitcher {
+  display: none;
+}
+
+.olControlAttribution {
+  display: none !important;
+}
+
+#attribution {
+  font-size: 10px;
+  text-align: center;
+}
+
+#map {
+  border: 1px solid black;
+  height: 480px;
+}