cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblot...@apache.org
Subject docs commit: Fixing responsiveness and styling of ToC.
Date Sat, 29 Aug 2015 02:54:21 GMT
Repository: cordova-docs
Updated Branches:
  refs/heads/cordova-website cebafcc95 -> da7c1ea92


Fixing responsiveness and styling of ToC.


Project: http://git-wip-us.apache.org/repos/asf/cordova-docs/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-docs/commit/da7c1ea9
Tree: http://git-wip-us.apache.org/repos/asf/cordova-docs/tree/da7c1ea9
Diff: http://git-wip-us.apache.org/repos/asf/cordova-docs/diff/da7c1ea9

Branch: refs/heads/cordova-website
Commit: da7c1ea925bff1aa504f22c90580e51b8933b6e4
Parents: cebafcc
Author: Dmitry Blotsky <dmitry.blotsky@gmail.com>
Authored: Fri Aug 28 19:54:14 2015 -0700
Committer: Dmitry Blotsky <dmitry.blotsky@gmail.com>
Committed: Fri Aug 28 19:54:14 2015 -0700

----------------------------------------------------------------------
 www/_layouts/docs.html        | 77 +++++++++++++++++++++++++-------------
 www/static/css-src/_docs.scss | 30 ++++++++++-----
 2 files changed, 71 insertions(+), 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/da7c1ea9/www/_layouts/docs.html
----------------------------------------------------------------------
diff --git a/www/_layouts/docs.html b/www/_layouts/docs.html
index d7f5bef..7a85f1d 100644
--- a/www/_layouts/docs.html
+++ b/www/_layouts/docs.html
@@ -4,21 +4,20 @@ docs_tab: true
 analytics_id: UA-64283057-1
 ---
 
+<!-- Use the manual ToC, and if it doesn't exist, use the generated one -->
+{% assign toc_dir = site.data.toc %}
+{% if toc_dir.[page.manual_toc] %}
+    {% assign tocfile = toc_dir.[page.manual_toc] %}
+{% else %}
+    {% assign tocfile = toc_dir.[page.generated_toc] %}
+{% endif %}
+
 <div class="container">
 
     <!-- Table of Contents -->
-    <div class="col-xs-3 site-toc-container">
+    <div class="hidden-xs hidden-sm col-md-3 site-toc-container">
         <h2 class="site-toc-title">{{ page.toc_text }}</h2>
         <ul class="site-toc">
-
-            <!-- Use the manual ToC, and if it doesn't exist, use the generated one -->
-            {% assign toc_dir = site.data.toc %}
-            {% if toc_dir.[page.manual_toc] %}
-                {% assign tocfile = toc_dir.[page.manual_toc] %}
-            {% else %}
-                {% assign tocfile = toc_dir.[page.generated_toc] %}
-            {% endif %}
-
             {% for entry in tocfile %}
             <li>
                 <a class="{% if page.url == entry.url %}this-page{% endif %}" href="{{
site.baseurl }}{{ entry.url }}">
@@ -35,8 +34,33 @@ analytics_id: UA-64283057-1
     </div>
 
     <!-- Page content -->
-    <div id="page-toc-source" class="col-xs-8 col-xs-offset-1">
-        <div class="row content-header">
+    <div id="page-toc-source" class="col-md-8 col-md-offset-1">
+
+        <!-- ToC Dropdown (for XS and SM sizes only) -->
+        <div class="toc-dropdown content-header visible-xs-block visible-sm-block">
+            <div class="dropdown">
+                <button class="btn btn-default dropdown-toggle" type="button" id="tocDropdown"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
+                    {{ page.toc_text }}
+                    <span class="caret"></span>
+                </button>
+                <ul class="dropdown-menu">
+                    {% for entry in tocfile %}
+                    <li>
+                        <a class="{% if page.url == entry.url %}this-page{% endif %}"
href="{{ site.baseurl }}{{ entry.url }}">
+                            {% if page.url == entry.url %}
+                                <em>{{ entry.name }}</em>
+                            {% else %}
+                                {{ entry.name }}
+                                <!-- DEBUG: {{ page.url }} != {{ entry.url }} -->
+                            {% endif %}
+                        </a>
+                    </li>
+                    {% endfor %}
+                </ul>
+            </div>
+        </div>
+
+        <div class="content-header">
 
             <a class="edit" href="{{ site.repo.uri }}/tree/{{ site.repo.branch }}/www/{{
page.path }}">
                 <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>
Edit
@@ -91,7 +115,7 @@ analytics_id: UA-64283057-1
             <!-- Version dropdown -->
             <div class="dropdown">
                 <button class="btn btn-default dropdown-toggle" type="button" id="versionDropdown"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
-                    Version {{ page.version }}
+                    {{ page.version }}
                     <span class="caret"></span>
                 </button>
                 <ul class="dropdown-menu" aria-labelledby="versionDropdown">
@@ -119,19 +143,18 @@ analytics_id: UA-64283057-1
                 </ul>
             </div>
         </div>
-        <div class="row">
-            <!-- Show warning if this version isn't the latest -->
-            {% if page.version != 'edge' %}
-            <a href="{{ site.baseurl }}{{ page.url | replace:page.version,'edge' }}">
-                <div class="alert alert-warning alert-dismissible" role="alert">
-                    <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span
aria-hidden="true">&times;</span></button>
-                    <strong>Warning!</strong> {{ page.not_latest_warning_text
}}
-                </div>
-            </a>
-            {% endif %}
-        </div>
-        <div class="row">
-            {{ content }}
-        </div>
+
+        <!-- Show warning if this version isn't the latest -->
+        {% if page.version != 'edge' %}
+        <a href="{{ site.baseurl }}{{ page.url | replace:page.version,'edge' }}">
+            <div class="alert alert-warning alert-dismissible" role="alert">
+                <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span
aria-hidden="true">&times;</span></button>
+                <strong>Warning!</strong> {{ page.not_latest_warning_text }}
+            </div>
+        </a>
+        {% endif %}
+
+        {{ content }}
+
     </div>
 </div>

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/da7c1ea9/www/static/css-src/_docs.scss
----------------------------------------------------------------------
diff --git a/www/static/css-src/_docs.scss b/www/static/css-src/_docs.scss
index 174b256..f443ea4 100644
--- a/www/static/css-src/_docs.scss
+++ b/www/static/css-src/_docs.scss
@@ -39,22 +39,34 @@
 .content-header {
     text-align: right;
     margin-top: 22px;
-    .alert { 
+    .alert {
         text-align:left;
     }
 }
+.toc-dropdown {
+    text-align: center;
+    width: 100%;
+    .dropdown {
+        width: inherit;
+        button {
+            width: inherit;
+        }
+    }
+}
 .alert.alert-warning.alert-dismissible {
-    margin-top:15px;
+    margin-top: 15px;
 }
-.content-header .dropdown {
+.dropdown {
     display: inline-block;
-    margin-left: 0.3em;
+    &:not(:last-child) {
+        margin-right: 0.3em;
+    }
 }
-.content-header .dropdown .selected {
+.dropdown .selected {
     font-weight: bold;
     font-style: italic;
 }
-.content-header .dropdown button.dropdown-toggle {
+.dropdown button.dropdown-toggle {
     border-radius: 4px;
     background-color: rgb(214, 214, 214);
     &:hover {
@@ -62,8 +74,8 @@
     }
 }
 .content-header .edit {
-    margin-right: 1em;
-    margin-left: 1em;
+    margin-right: 0.5em;
+    margin-left: 0.5em;
 }
 
 /* missing version highlight */
@@ -71,7 +83,7 @@
     color: gray !important;
 }
 
-/* Formatting for compatibility table in docs */
+/* Formatting for compatibility table on plugin docs page */
 .compat {
     td {
         text-align: center;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message