couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From benk...@apache.org
Subject [1/2] fauxton commit: updated refs/heads/master to f0d4518
Date Mon, 21 Sep 2015 20:29:04 GMT
Repository: couchdb-fauxton
Updated Branches:
  refs/heads/master 1263c853d -> f0d451861


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f0d45186/settings.json.default
----------------------------------------------------------------------
diff --git a/settings.json.default b/settings.json.default
index b44c98b..9d384ad 100644
--- a/settings.json.default
+++ b/settings.json.default
@@ -27,7 +27,7 @@
           "root": "/",
           "host": "../..",
           "version": "1.0.dev",
-          "zeroClipboardPath": "js/zeroclipboard/ZeroClipboard.swf"
+          "bundled": false
         }
       },
       "release": {
@@ -42,7 +42,7 @@
           "root": "/_utils/",
           "host": "../..",
           "version": "1.0",
-          "zeroClipboardPath": "js/zeroclipboard/ZeroClipboard.swf"
+          "bundled": true
         }
       },
       "couchapp": {
@@ -57,7 +57,7 @@
           "root": "/",
           "host": "../../..",
           "version": "1.0",
-          "zeroClipboardPath": "js/zeroclipboard/ZeroClipboard.swf"
+          "bundled": true
         }
       }
     },

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f0d45186/tasks/couchserver.js
----------------------------------------------------------------------
diff --git a/tasks/couchserver.js b/tasks/couchserver.js
index faa8118..66f8725 100644
--- a/tasks/couchserver.js
+++ b/tasks/couchserver.js
@@ -81,8 +81,10 @@ module.exports = function (grunt) {
         // server js from app directory
         url = url.replace(/\?_.*/, '');
         filePath = path.join(app_dir, url.replace('/_utils/fauxton/', ''));
-      } else if (!!url.match(/ZeroClipboard/)) {
-        filePath = "./assets/js/plugins/zeroclipboard/ZeroClipboard.swf";
+      // handles local references to any addon dependencies (e.g. ZeroClipboard.swf)
+      } else if (!!url.match(/addons\/[^\/]+\/dependencies\/.+/)) {
+        var urlNoQueryStr = url.replace(/\?.*$/, '');
+        filePath = './app' + urlNoQueryStr;
       } else if (!!url.match(/testrunner/)) {
         var testSetup = grunt.util.spawn({cmd: 'grunt', grunt: true, args: ['test_inline']},
function (error, result, code) {/* log.writeln(String(result));*/ });
         testSetup.stdout.pipe(process.stdout);

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f0d45186/tasks/helper.js
----------------------------------------------------------------------
diff --git a/tasks/helper.js b/tasks/helper.js
index 66f3a91..8ad4d32 100644
--- a/tasks/helper.js
+++ b/tasks/helper.js
@@ -57,6 +57,31 @@ exports.init = function (grunt) {
       }, defaults);
     },
 
+    // examines all loaded addons and returns any files in their /dependencies subfolder.
These are copied over to
+    // /js/[addonName]/ for bundled (prod) releases so their paths are known for referencing
at runtime
+    getAddonDependencies: function () {
+      var files = [];
+
+      _.each(this.readSettingsFile().deps, function (addon) {
+        var addonFolder = (addon.path) ? addon.path : './app/addons/' + addon.name;
+        var addonDepsFolder = addonFolder + '/dependencies';
+
+        // ignore addons that don't contain a /dependencies subfolder
+        if (!fs.existsSync(addonDepsFolder)) {
+          return false;
+        }
+
+        _.each(fs.readdirSync(addonDepsFolder), function (file) {
+          files.push({
+            src: addonDepsFolder + '/' + file,
+            dest: 'dist/release/js/' + addon.name + '/' + file
+          });
+        });
+      });
+
+      return files;
+    },
+
     check_selenium: {
       command: 'test -s ./test/nightwatch_tests/selenium/selenium-server-standalone-2.45.0.jar
|| ' +
         'curl -o ./test/nightwatch_tests/selenium/selenium-server-standalone-2.45.0.jar '
+


Mime
View raw message