You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@freemarker.apache.org by ed...@apache.org on 2015/11/29 06:55:58 UTC

[1/3] incubator-freemarker-docgen git commit: upgrading npm packages, removing global package installs to avoid conflicts

Repository: incubator-freemarker-docgen
Updated Branches:
  refs/heads/master 82c4a3e31 -> bab5de6d8


upgrading npm packages, removing global package installs to avoid conflicts


Project: http://git-wip-us.apache.org/repos/asf/incubator-freemarker-docgen/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-freemarker-docgen/commit/4b24dfc1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-freemarker-docgen/tree/4b24dfc1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-freemarker-docgen/diff/4b24dfc1

Branch: refs/heads/master
Commit: 4b24dfc1b82c8d05de3ad9464e777654e091d3c0
Parents: 82c4a3e
Author: ratherblue <ra...@gmail.com>
Authored: Sat Nov 28 21:35:44 2015 -0800
Committer: ratherblue <ra...@gmail.com>
Committed: Sat Nov 28 21:35:44 2015 -0800

----------------------------------------------------------------------
 .eslintrc    |  2 +-
 package.json | 24 +++++++++++++++---------
 2 files changed, 16 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker-docgen/blob/4b24dfc1/.eslintrc
----------------------------------------------------------------------
diff --git a/.eslintrc b/.eslintrc
index 9735638..1165708 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -2,7 +2,7 @@
     "rules": {
         "indent": [2, 2],
         "quotes": [2, "single"],
-        "linebreak-style": [2, "unix"],
+        "linebreak-style": [2, "windows"],
         "semi": [2, "always"],
         "space-in-parens": [2, "never"],
         "strict": [2, "never"],

http://git-wip-us.apache.org/repos/asf/incubator-freemarker-docgen/blob/4b24dfc1/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 3c7c80f..b9b0f74 100644
--- a/package.json
+++ b/package.json
@@ -3,16 +3,22 @@
   "version": "0.0.0",
   "private": true,
   "scripts": {
-    "preinstall": "npm install gulp eslint -g",
-    "lint": "eslint  --ext .js ./src/main/org/freemarker/docgen/js/"
+    "build": "./node_modules/.bin/gulp",
+    "lint": "./node_modules/.bin/eslint  --ext .js ./src/main/org/freemarker/docgen/js/"
   },
   "dependencies": {
-    "gulp": "^3.8.11",
-    "gulp-autoprefixer": "^2.2.0",
-    "gulp-concat": "^2.5.2",
-    "gulp-less": "^3.0.3",
-    "gulp-minify-css": "^1.1.1",
-    "gulp-rename": "^1.2.2",
-    "gulp-uglify": "^1.2.0"
+    "clean-css": "3.4.8",
+    "eslint": "1.10.2",
+    "gulp": "3.9.0",
+    "gulp-autoprefixer": "3.1.0",
+    "gulp-concat": "2.6.0",
+    "gulp-less": "3.0.5",
+    "gulp-minify-css": "1.2.1",
+    "gulp-rename": "1.2.2",
+    "gulp-uglify": "1.5.1",
+    "less": "2.5.3"
+  },
+  "engines": {
+    "node": ">=0.12.4"
   }
 }


[2/3] incubator-freemarker-docgen git commit: fixing spacing

Posted by ed...@apache.org.
fixing spacing


Project: http://git-wip-us.apache.org/repos/asf/incubator-freemarker-docgen/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-freemarker-docgen/commit/ce1336ba
Tree: http://git-wip-us.apache.org/repos/asf/incubator-freemarker-docgen/tree/ce1336ba
Diff: http://git-wip-us.apache.org/repos/asf/incubator-freemarker-docgen/diff/ce1336ba

Branch: refs/heads/master
Commit: ce1336ba8239fe120b482d0af47a736eb5076c3d
Parents: 4b24dfc
Author: ratherblue <ra...@gmail.com>
Authored: Sat Nov 28 21:37:47 2015 -0800
Committer: ratherblue <ra...@gmail.com>
Committed: Sat Nov 28 21:38:07 2015 -0800

----------------------------------------------------------------------
 src/main/org/freemarker/docgen/js/make-toc.js | 28 ++++++++++------------
 1 file changed, 13 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker-docgen/blob/ce1336ba/src/main/org/freemarker/docgen/js/make-toc.js
----------------------------------------------------------------------
diff --git a/src/main/org/freemarker/docgen/js/make-toc.js b/src/main/org/freemarker/docgen/js/make-toc.js
index d96ded7..3fb68da 100644
--- a/src/main/org/freemarker/docgen/js/make-toc.js
+++ b/src/main/org/freemarker/docgen/js/make-toc.js
@@ -1,18 +1,18 @@
 (function(toc, breadcrumb) {
 
-  var LEVEL = 0;
-
-
+  var menuLevel = 0;
 
   function menuItemInnerHTML(nodeData) {
-    var isLink = nodeData.url != null; 
+    var isLink = nodeData.url != null;
     var a = document.createElement(isLink ? 'a' : 'span');
 
     a.innerHTML = nodeData.title;
+
     if (isLink) {
       a.href = nodeData.url;
     }
-    a.className = 'depth-' + LEVEL + '-link';
+
+    a.className = 'depth-' + menuLevel + '-link';
 
     return a;
   }
@@ -38,7 +38,6 @@
     if (!nodeData.children.length) {
       return true;
     } else {
-
       // don't print out children if they are only anchors
       for (var x = 0; x < nodeData.children.length; x++) {
         if (nodeData.children[x].isFile) {
@@ -64,7 +63,7 @@
   function menuChildren(children, depth, onPath) {
 
     var ul = document.createElement('ul');
-    ul.classList.add('depth-' + LEVEL);
+    ul.classList.add('depth-' + menuLevel);
 
     for (var x = 0; x < children.length; x++) {
       var node = children[x];
@@ -72,7 +71,7 @@
       var li = document.createElement('li');
       var isLast = checkIfLast(node);
 
-      if (LEVEL === 0) {
+      if (menuLevel === 0) {
         li.classList.add('section');
       }
 
@@ -94,35 +93,34 @@
         }
 
         // 'section' is always open
-        if (LEVEL !== 0) {
+        if (menuLevel !== 0) {
           li.classList.add('open');
         }
 
         depth++;
 
-      } else if (LEVEL > 0) {
+      } else if (menuLevel > 0) {
         li.classList.add('closed');
       }
 
       if (isLast) {
-
         li.classList.add('last');
 
         // @todo: add flags to docgen
         if (typeof node.flags !== 'undefined') {
           li.classList.add(node.flags.join(' '));
         }
-      } else if (LEVEL > 0) {
-        // don't add for top level elements
+      } else if (menuLevel > 0) {
+        // don't add for top menuLevel elements
         li.classList.add('has-children');
       }
 
       if (!isLast) {
-        LEVEL++;
+        menuLevel++;
 
         li.appendChild(menuChildren(node.children, depth, (node.title === breadcrumb[depth])));
 
-        LEVEL--;
+        menuLevel--;
       }
 
       ul.appendChild(li);


[3/3] incubator-freemarker-docgen git commit: populate the search field with the search term, if applicable

Posted by ed...@apache.org.
populate the search field with the search term, if applicable


Project: http://git-wip-us.apache.org/repos/asf/incubator-freemarker-docgen/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-freemarker-docgen/commit/bab5de6d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-freemarker-docgen/tree/bab5de6d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-freemarker-docgen/diff/bab5de6d

Branch: refs/heads/master
Commit: bab5de6d8293621ca4e2fa69287b81a15e23fdc7
Parents: ce1336b
Author: ratherblue <ra...@gmail.com>
Authored: Sat Nov 28 21:55:33 2015 -0800
Committer: ratherblue <ra...@gmail.com>
Committed: Sat Nov 28 21:55:33 2015 -0800

----------------------------------------------------------------------
 src/main/org/freemarker/docgen/js/search.js | 44 ++++++++++++++++++++++++
 1 file changed, 44 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker-docgen/blob/bab5de6d/src/main/org/freemarker/docgen/js/search.js
----------------------------------------------------------------------
diff --git a/src/main/org/freemarker/docgen/js/search.js b/src/main/org/freemarker/docgen/js/search.js
new file mode 100644
index 0000000..e03a24a
--- /dev/null
+++ b/src/main/org/freemarker/docgen/js/search.js
@@ -0,0 +1,44 @@
+// fix search population
+(function() {
+
+  var SEARCH_VARIABLE = 'q'; // this must be the same as google analytics
+  var searchField;
+
+  function populationSearchField(query) {
+    // replace '+' signs with spaces
+    query = query.replace(/\+/g, ' ');
+    query = decodeURIComponent(query); // decode so value stays as expected
+
+    searchField.value = query;
+  }
+
+  function checkForSearchQuery() {
+    var query = window.location.search;
+
+    if (query !== '') {
+      var params = query.split('&'); // note: if the user's search term
+                                     // includes & then this won't work as
+                                     // expected for them
+
+      // extract the search query
+      for (var x = 0; x < params.length; x++) {
+        var param = params[x];
+        var parts = param.split('=');
+
+        if (parts[0] === '?' + SEARCH_VARIABLE) {
+          populationSearchField(parts[1]); // second part is the query
+        }
+      }
+    }
+  }
+
+  function init() {
+    searchField = document.getElementById('search-field');
+
+    if (searchField !== null) {
+      checkForSearchQuery();
+    }
+  }
+
+  init();
+})();