You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2014/02/12 07:20:26 UTC

[32/52] [abbrv] fauxton commit: updated refs/heads/import-master to d11b90b

Fix for beautify to work with require.js


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

Branch: refs/heads/import-master
Commit: 1be64cdd4eac99dedc34558c219f5249586d5e15
Parents: c9ad37b
Author: suelockwood <de...@apache.org>
Authored: Tue Jan 28 10:39:05 2014 -0500
Committer: suelockwood <de...@apache.org>
Committed: Tue Jan 28 11:31:37 2014 -0500

----------------------------------------------------------------------
 app/addons/documents/templates/view_editor.html |  4 ++--
 app/addons/documents/views.js                   |  4 ++--
 assets/js/plugins/beautify.js                   | 17 ++++-------------
 3 files changed, 8 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/1be64cdd/app/addons/documents/templates/view_editor.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/view_editor.html b/app/addons/documents/templates/view_editor.html
index bf31ba2..d02971e 100644
--- a/app/addons/documents/templates/view_editor.html
+++ b/app/addons/documents/templates/view_editor.html
@@ -41,7 +41,7 @@ the License.
             <div class="js-editor" id="map-function"><%= langTemplates.map %></div>
             <% } else { %>
             <div class="js-editor" id="map-function"><%- ddoc.get('views')[viewName].map %></div>
-            <button class="beautify beautify_map button hidden beautify-tooltip" type="button" data-toggle="tooltip" title="Reformat your minified code to make edits to it.">beautify this code</button>
+            <button class="beautify beautify_map button hide beautify-tooltip" type="button" data-toggle="tooltip" title="Reformat your minified code to make edits to it.">beautify this code</button>
             <% } %>
           </div>
 
@@ -64,7 +64,7 @@ the License.
             <div class="js-editor" id="reduce-function"><%= langTemplates.reduce %></div>
             <% } else { %>
             <div class="js-editor" id="reduce-function"><%- ddoc.get('views')[viewName].reduce %></div>
-            <button class="beautify beautify_reduce button hidden beautify-tooltip" type="button" data-toggle="tooltip" title="Reformat your minified code to make edits to it.">beautify this code</button>
+            <button class="beautify beautify_reduce button hide beautify-tooltip" type="button" data-toggle="tooltip" title="Reformat your minified code to make edits to it.">beautify this code</button>
             <% } %>
           </div>
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/1be64cdd/app/addons/documents/views.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/views.js b/app/addons/documents/views.js
index e2f5578..9516355 100644
--- a/app/addons/documents/views.js
+++ b/app/addons/documents/views.js
@@ -1630,7 +1630,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
       this.reduceEditor.render();
 
       if (this.reduceEditor.getLines() === 1){
-        this.$('.beautify_reduce').removeClass("hidden");
+        this.$('.beautify_reduce').removeClass("hide");
         $('.beautify-tooltip').tooltip();
       }
     },
@@ -1709,7 +1709,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
       this.reduceEditor && this.reduceEditor.editSaved();
 
       if (this.mapEditor.getLines() === 1){
-        this.$('.beautify_map').removeClass("hidden");
+        this.$('.beautify_map').removeClass("hide");
         $('.beautify-tooltip').tooltip();
       }
     },

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/1be64cdd/assets/js/plugins/beautify.js
----------------------------------------------------------------------
diff --git a/assets/js/plugins/beautify.js b/assets/js/plugins/beautify.js
index e934fe3..07b6617 100644
--- a/assets/js/plugins/beautify.js
+++ b/assets/js/plugins/beautify.js
@@ -1611,19 +1611,10 @@
     }
 
 
-    if (typeof define === "function") {
-        // Add support for require.js
-        if (typeof define.amd === "undefined") {
-            define(function(require, exports, module) {
-                exports.js_beautify = js_beautify;
-            });
-        } else {
-            // if is AMD ( https://github.com/amdjs/amdjs-api/wiki/AMD#defineamd-property- )
-            define([], function() {
-                return js_beautify;
-            });
-        }
-
+    if (typeof define === "function" && define.amd) {
+        define([], function() {
+            return js_beautify;
+        });
     } else if (typeof exports !== "undefined") {
         // Add support for CommonJS. Just put this file somewhere on your require.paths
         // and you will be able to `var js_beautify = require("beautify").js_beautify`.