allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [47/50] [abbrv] allura git commit: [#7919] add helpful messages if transpiled.js isn't there
Date Fri, 08 Jan 2016 19:30:52 GMT
[#7919] add helpful messages if transpiled.js isn't there


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

Branch: refs/heads/master
Commit: a40304e1f4dfa013fd4c2b4a6e75c23e80e7e0dd
Parents: 25c7d96
Author: Dave Brondsema <dave@brondsema.net>
Authored: Fri Jan 8 10:16:47 2016 -0500
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Fri Jan 8 14:06:19 2016 -0500

----------------------------------------------------------------------
 Allura/allura/templates/jinja_master/top_nav.html | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/a40304e1/Allura/allura/templates/jinja_master/top_nav.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/jinja_master/top_nav.html b/Allura/allura/templates/jinja_master/top_nav.html
index 7be0917..bcbb215 100644
--- a/Allura/allura/templates/jinja_master/top_nav.html
+++ b/Allura/allura/templates/jinja_master/top_nav.html
@@ -55,15 +55,24 @@
         var _data = {{ h.escape_json(c.project.nav_data(admin_options=True))|safe }};
         $(document).ready(function () {
             $('#toggle-admin-btn').click(function () {
+                if (typeof Main === 'undefined') {
+                    alert('Compiled JS is missing.  Need to run `npm install; npm run build;`
on the server.');
+                    return;
+                }
                 ReactDOM.render(React.createElement(Main, {
                     initialData: _data
                 }), document.getElementById("top_nav_admin"));
             });
 
-            ReactDOM.render(React.createElement(ToggleAddNewTool, {
+            if (typeof ToggleAddNewTool === 'undefined') {
+                $('#add-tool-container').click(function(){
+                    alert('Compiled JS is missing.  Need to run `npm install; npm run build;`
on the server.');
+                });
+            } else {
+                ReactDOM.render(React.createElement(ToggleAddNewTool, {
                         installableTools: _data['installable_tools']
                     }), document.getElementById('add-tool-container'));
-
+            }
             $("#toggle-admin-btn").tooltipster({
                 delay: 200,
                 theme: 'tooltipster-light',


Mime
View raw message