couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robertkowal...@apache.org
Subject fauxton commit: updated refs/heads/master to 0173197
Date Mon, 02 Feb 2015 12:50:24 GMT
Repository: couchdb-fauxton
Updated Branches:
  refs/heads/master e0201f235 -> 017319776


ZeroClipboard: Don't rely on code loading order

Bake path to swf-file into release at build time and make it
configurable for different environments.

Relying on the synchronous `registerExtensions` for configuration
is not reliable in an asynchronous bootstrapping application like
Fauxton


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/01731977
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/01731977
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/01731977

Branch: refs/heads/master
Commit: 017319776b7fddf40febb3ef1ea22cc6f5fddeb9
Parents: e0201f2
Author: Robert Kowalski <robertkowalski@apache.org>
Authored: Fri Jan 30 18:08:22 2015 +0100
Committer: Robert Kowalski <robertkowalski@apache.org>
Committed: Mon Feb 2 13:50:09 2015 +0100

----------------------------------------------------------------------
 .travis.yml                                     |  2 +
 .../databases/tests/nightwatch/zeroclipboard.js | 45 ++++++++++++++++++++
 app/addons/fauxton/components.js                |  7 +--
 app/initialize.js.underscore                    |  3 +-
 settings.json.default                           |  9 ++--
 5 files changed, 56 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/01731977/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index a650404..cd33b4d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -8,6 +8,8 @@ services:
 addons:
   firefox: "34.0"
 before_install:
+  - sudo apt-get update -qq
+  - sudo apt-get install -qq flashplugin-installer
   - export DISPLAY=:99.0
   - "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile
--background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1400x900x16"
   - HOST="http://127.0.0.1:5984"

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/01731977/app/addons/databases/tests/nightwatch/zeroclipboard.js
----------------------------------------------------------------------
diff --git a/app/addons/databases/tests/nightwatch/zeroclipboard.js b/app/addons/databases/tests/nightwatch/zeroclipboard.js
new file mode 100644
index 0000000..e188407
--- /dev/null
+++ b/app/addons/databases/tests/nightwatch/zeroclipboard.js
@@ -0,0 +1,45 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+var os = require('os');
+
+module.exports = {
+  'ZeroClipboard copies' : function (client) {
+    var waitTime = 10000,
+        newDatabaseName = client.globals.testDatabaseName,
+        baseUrl = client.globals.test_settings.launch_url;
+
+    var controlOrCommandKey = client.Keys.CONTROL;
+    if (os.type() === 'Darwin') {
+      controlOrCommandKey = client.Keys.COMMAND;
+    }
+
+    client
+      .loginToGUI()
+      .deleteDatabase(newDatabaseName) //need to delete the automatic database 'fauxton-selenium-tests'
that has been set up before each test
+      .url(baseUrl)
+
+      .waitForElementPresent('.api-url-btn', waitTime, false)
+      .click('.api-url-btn')
+      .waitForElementVisible('.copy-url', waitTime, false)
+      .moveTo('.copy-url')
+      .click('.copy-url')
+      .mouseButtonDown('left')
+      .mouseButtonUp('left')
+      .closeNotification()
+      .setValue('.search-autocomplete', '')
+      .keys([controlOrCommandKey, 'v'])
+      .assert.value('.search-autocomplete', 'http://localhost:8000/_all_dbs')
+
+    .end();
+  }
+};

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/01731977/app/addons/fauxton/components.js
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/components.js b/app/addons/fauxton/components.js
index c6f307d..43d406e 100644
--- a/app/addons/fauxton/components.js
+++ b/app/addons/fauxton/components.js
@@ -1023,13 +1023,8 @@ function(app, FauxtonAPI, ace, spin, ZeroClipboard) {
   Components.Clipboard = FauxtonAPI.View.extend({
     initialize: function (options) {
       this.$el = options.$el;
-      this.moviePath = FauxtonAPI.getExtensions('zeroclipboard:movielist')[0];
 
-      if (_.isUndefined(this.moviePath)) {
-       this.moviePath = 'js/zeroclipboard/ZeroClipboard.swf';
-      }
-
-      ZeroClipboard.config({ moviePath: this.moviePath });
+      ZeroClipboard.config({ moviePath: app.zeroClipboardPath });
       this.client = new ZeroClipboard(this.$el);
     },
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/01731977/app/initialize.js.underscore
----------------------------------------------------------------------
diff --git a/app/initialize.js.underscore b/app/initialize.js.underscore
index 02689a1..245bf55 100644
--- a/app/initialize.js.underscore
+++ b/app/initialize.js.underscore
@@ -25,7 +25,8 @@ function() {
     root: "<%= root %>",
     version: "<%= version %>",
     // Host is used as prefix for urls
-    host: "<%= host %>" ,
+    host: "<%= host %>",
+    zeroClipboardPath: "<%= zeroClipboardPath %>"
   };
 
   return app; 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/01731977/settings.json.default
----------------------------------------------------------------------
diff --git a/settings.json.default b/settings.json.default
index 1e6aa50..9c3ba87 100644
--- a/settings.json.default
+++ b/settings.json.default
@@ -25,7 +25,8 @@
         "app": {
           "root": "/",
           "host": "../..",
-          "version": "1.0.dev"
+          "version": "1.0.dev",
+          "zeroClipboardPath": "js/zeroclipboard/ZeroClipboard.swf"
         }
       },
       "release": {
@@ -39,7 +40,8 @@
         "app": {
           "root": "/_utils/",
           "host": "../..",
-          "version": "1.0"
+          "version": "1.0",
+          "zeroClipboardPath": "js/zeroclipboard/ZeroClipboard.swf"
         }
       },
       "couchapp": {
@@ -53,7 +55,8 @@
         "app": {
           "root": "/",
           "host": "../../..",
-          "version": "1.0"
+          "version": "1.0",
+          "zeroClipboardPath": "js/zeroclipboard/ZeroClipboard.swf"
         }
       }
     },


Mime
View raw message