]> git.ipfire.org Git - thirdparty/foundation/foundation-emails.git/commitdiff
Add docs-specific JavaScript, and add toggle between HTML/Inky samples
authorGeoff Kimball <geoff@zurb.com>
Tue, 23 Feb 2016 01:25:27 +0000 (17:25 -0800)
committerGeoff Kimball <geoff@zurb.com>
Tue, 23 Feb 2016 01:25:27 +0000 (17:25 -0800)
docs/assets/js/codeSample.js [new file with mode: 0644]
docs/layouts/default.html
docs/pages/button.md
docs/partials/component-list.html
gulpfile.js
package.json

diff --git a/docs/assets/js/codeSample.js b/docs/assets/js/codeSample.js
new file mode 100644 (file)
index 0000000..571a067
--- /dev/null
@@ -0,0 +1,19 @@
+!function() {
+
+var $currentText = $('[data-docs-code-current]');
+var $toggleButtons = $('[data-docs-code-toggle]');
+
+$toggleButtons.click(function() {
+  $('body').toggleClass('is-inky-enabled');
+
+  if ($('body').hasClass('is-inky-enabled')) {
+    $currentText.text('Inky');
+    $toggleButtons.text('Switch to HTML');
+  }
+  else {
+    $currentText.text('HTML');
+    $toggleButtons.text('Switch to Inky');
+  }
+});
+
+}();
index 77f896af33e2685fe39f40427a5d0a7368dfe595..ed8329aa34034c83d3fa994ac54cc001d712e6dc 100644 (file)
     <link href="//cdnjs.cloudflare.com/ajax/libs/foundicons/3.0.0/foundation-icons.css" rel="stylesheet">
     <!-- <link rel="stylesheet" href="./node_modules/motion-ui/dist/motion-ui.css" /> -->
   </head>
-  <body>
+  <body class="docs-emails">
 
     <div class="off-canvas-wrapper"><div class="off-canvas-wrapper-inner" data-off-canvas-wrapper>
 
     <div class="off-canvas-content" data-off-canvas-content>
       <!-- Info Banner For Announcements or Links -->
-      <a href="http://zurb.com/article/1416/foundation-6-is-here" id="notice">
+      <!-- <a href="http://zurb.com/article/1416/foundation-6-is-here" id="notice">
         <div class="info">
           <h5>Foundation 6 is here!</h5>
         </div>
-      </a>
+      </a> -->
 
       {{> navigation}}
       {{> mobile-navigation}}
@@ -59,6 +59,7 @@
     </script>
 
     <script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
+    <script src="https://cdn.jsdelivr.net/what-input/1.2.3/what-input.min.js"></script>
     <script src="https://cdn.jsdelivr.net/foundation/6.0.5/foundation.min.js"></script>
     <script src="https://cdn.jsdelivr.net/typeahead.js/0.11.1/typeahead.bundle.min.js"></script>
     <script src="https://cdn.jsdelivr.net/zeroclipboard/2.2.0/ZeroClipboard.min.js"></script>
index ba53b148df8984a1b3e9b5cb705b0e04c57e75ec..ba069633026b9b04bd343f826e7207fd68d1a97d 100644 (file)
@@ -9,95 +9,58 @@ To get buttons that look awesome in most clients we make a table with the class
 
 Check out this basic button:
 ```inky
-    <center>
-      <row>
-        <column>
-        <table class="button">
-          <tr>
-            <td>
-              <a href="#">Button!</a>
-            </td>
-          </tr>
-        </table>
-      </column>
-    </row>
-  </center>
+<center>
+  <row>
+    <columns>
+      <button href="zurb.com">Button</button>
+    </columns>
+  </row>
+</center>
 ```
 
 You can quickly modify the size of our buttons by adding these classes:
 ```inky
-    <center>
-      <row>
-        <column>
-        <table class="button tiny">
-          <tr>
-            <td>
-              <a href="#">Button!</a>
-            </td>
-          </tr>
-        </table>
-      </column>
-    </row>
-      <row>
-        <column>
-        <table class="button small">
-          <tr>
-            <td>
-              <a href="#">Button!</a>
-            </td>
-          </tr>
-        </table>
-      </column>
-    </row>
-      <row>
-        <column>
-        <table class="button large">
-          <tr>
-            <td>
-              <a href="#">Button!</a>
-            </td>
-          </tr>
-        </table>
-      </column>
-    </row>
-  </center>
+<center>
+  <row>
+    <columns>
+      <button href="zurb.com" class="tiny">Tiny Button</button>
+    </columns>
+  </row>
+  <row>
+    <columns>
+      <button href="zurb.com" class="small">Small Button</button>
+    </columns>
+  </row>
+  <row>
+    <columns>
+      <button href="zurb.com" class="large">Large Button</button>
+    </columns>
+  </row>
+</center>
 ```
 
 You can also change the color using our color classes here:
 ```inky
-    <center>
-      <row>
-        <column>
-        <table class="button secondary">
-          <tr>
-            <td>
-              <a href="#">Button!</a>
-            </td>
-          </tr>
-        </table>
-      </column>
-    </row>
-      <row>
-        <column>
-        <table class="button success">
-          <tr>
-            <td>
-              <a href="#">Button!</a>
-            </td>
-          </tr>
-        </table>
-      </column>
-    </row>
-      <row>
-        <column>
-        <table class="button warning">
-          <tr>
-            <td>
-              <a href="#">Button!</a>
-            </td>
-          </tr>
-        </table>
-      </column>
-    </row>
-  </center>
+<center>
+  <row>
+    <columns>
+      <button href="zurb.com" class="secondary">Secondary Button</button>
+    </columns>
+  </row>
+  <row>
+    <columns>
+      <button href="zurb.com" class="success">Success Button</button>
+    </columns>
+  </row>
+  <row>
+    <columns>
+      <button href="zurb.com" class="warning">Warning Button</button>
+    </columns>
+  </row>
+  <row>
+    <columns>
+      <button href="zurb.com" class="alert">Alert Button</button>
+    </columns>
+  </row>
+</center>
 ```
index fb56f9ec644b162aeb876e4e2a833f5fb56926ff..787938926fec79d6c21683f91fb5428dadcf9028 100644 (file)
@@ -1,17 +1,17 @@
-<ul class="vertical menu docs-menu" id="docs-menu">
-  <p class="docs-version-number">
-    <span data-docs-version></span>
-    <a href="https://github.com/zurb/foundation-sites/releases/" target="_blank">(Changelog)</a>
+<ul class="vertical menu docs-nav" id="docs-menu">
+  <p class="docs-nav-version">
+    <span data-docs-version>v2.0.0-rc.2</span>
+    <a href="https://github.com/zurb/foundation-emails/releases/" target="_blank">(Changelog)</a>
   </p>
 
-  <li class="docs-menu-title">Components</li>
+  <li class="docs-nav-title">Components</li>
   <li><a href="">Alignment</a></li>
   <li><a href="">Block Grid</a></li>
   <li><a href="button.html">Button</a></li>
   <li><a href="">Callout</a></li>
   <li><a href="">Global</a></li>
 
-  <li class="docs-menu-title">Grid</li>
+  <li class="docs-nav-title">Grid</li>
   <li><a href="">Grid</a></li>
   <li><a href="">Sass</a></li>
   <li><a href="">Inline Lists</a></li>
index dcbf745aad4bef47685393debbbe4c9283774081..e75118744db12d1cdecfdf211737de6548ecc903 100644 (file)
@@ -25,7 +25,7 @@ gulp.task('clean', function(cb) {
 
 // Copies static documentation assets
 gulp.task('copy', function() {
-  return gulp.src(['docs/assets/**/*', '!docs/assets/scss/**/*'])
+  return gulp.src(['docs/assets/**/*', '!docs/assets/scss/**/*', '!docs/assets/js/**/*'])
     .pipe(gulp.dest('_build/assets'));
 });
 
@@ -61,6 +61,13 @@ gulp.task('sass:foundation', function() {
     .pipe(gulp.dest('_build/assets/css'));
 });
 
+// Compiles documentation JavaScript
+gulp.task('javascript:docs', function() {
+  return gulp.src('docs/assets/js/**/*.js')
+    .pipe($.concat('docs.js'))
+    .pipe(gulp.dest('_build/assets/js'));
+});
+
 // Generates a Sass settings file from the current codebase
 gulp.task('settings', function() {
   octophant('scss/**/*.scss', {
@@ -87,12 +94,12 @@ gulp.task('server', ['build'], function() {
 
 // Runs the entire build process
 gulp.task('build', function(cb) {
-  sequence('clean', ['copy', 'html', 'sass'], cb);
+  sequence('clean', ['copy', 'html', 'sass', 'javascript:docs'], cb);
 });
 
 // Runs the build process, spins up a server, and watches for file changes
 gulp.task('default', ['server'], function() {
   gulp.watch('docs/**/*', ['html', browser.reload]);
-  gulp.watch('docs/assets/scss/**/*', ['sass:docs', browser.reload]);
+  gulp.watch(['docs/assets/scss/**/*', 'node_modules/foundation-docs/scss/**/*'], ['sass:docs', browser.reload]);
   gulp.watch('scss/**/*.scss', ['sass:foundation', browser.reload]);
 });
index 6b8bc3875c17ff8ed3cbf873682f5973b2aaff2c..8b7cd8928a5e5dc1ce26ea8f7a5615a956f1fe88 100644 (file)
@@ -22,6 +22,7 @@
     "gulp": "^3.8.11",
     "gulp-autoprefixer": "^2.3.1",
     "gulp-cached": "^1.1.0",
+    "gulp-concat": "^2.6.0",
     "gulp-htmlmin": "^1.1.1",
     "gulp-if": "^2.0.0",
     "gulp-inject": "^1.2.0",