Selaa lähdekoodia

HUE-1538 [core] Change jHueNotify to event based

Changed all calls to a .trigger("info") and .trigger("error")
Enrico Berti 12 vuotta sitten
vanhempi
commit
b49532b
27 muutettua tiedostoa jossa 82 lisäystä ja 79 poistoa
  1. 6 6
      apps/about/src/about/templates/admin_wizard.mako
  2. 1 1
      apps/beeswax/src/beeswax/templates/execute.mako
  3. 2 2
      apps/beeswax/src/beeswax/templates/watch_wait.mako
  4. 4 4
      apps/beeswax/static/js/autocomplete.utils.js
  5. 3 3
      apps/filebrowser/src/filebrowser/templates/listdir_components.mako
  6. 1 1
      apps/hbase/static/js/api.js
  7. 1 1
      apps/hbase/static/js/nav.js
  8. 1 1
      apps/hbase/static/js/utils.js
  9. 2 2
      apps/jobbrowser/src/jobbrowser/templates/job.mako
  10. 4 4
      apps/jobbrowser/src/jobbrowser/templates/jobs.mako
  11. 2 2
      apps/oozie/src/oozie/templates/dashboard/list_oozie_bundle.mako
  12. 3 3
      apps/oozie/src/oozie/templates/dashboard/list_oozie_bundles.mako
  13. 2 2
      apps/oozie/src/oozie/templates/dashboard/list_oozie_coordinator.mako
  14. 3 3
      apps/oozie/src/oozie/templates/dashboard/list_oozie_coordinators.mako
  15. 3 3
      apps/oozie/src/oozie/templates/dashboard/list_oozie_workflow.mako
  16. 3 3
      apps/oozie/src/oozie/templates/dashboard/list_oozie_workflows.mako
  17. 10 10
      apps/oozie/src/oozie/templates/editor/edit_workflow.mako
  18. 3 3
      apps/search/src/search/templates/admin_collection_facets.mako
  19. 2 2
      apps/search/src/search/templates/admin_collection_highlighting.mako
  20. 2 2
      apps/search/src/search/templates/admin_collection_sorting.mako
  21. 2 2
      apps/search/src/search/templates/admin_collection_template.mako
  22. 3 3
      apps/search/src/search/templates/admin_collections.mako
  23. 1 1
      apps/search/src/search/templates/search.mako
  24. 7 7
      apps/sqoop/src/sqoop/templates/app.mako
  25. 9 2
      desktop/core/src/desktop/templates/common_footer.mako
  26. 1 3
      desktop/core/static/js/jquery.filechooser.js
  27. 1 3
      desktop/core/static/js/jquery.tour.js

+ 6 - 6
apps/about/src/about/templates/admin_wizard.mako

@@ -237,7 +237,7 @@ $(document).ready(function(){
   $.get("${ url('desktop.views.check_config') }", function(response) {
     $("#check-config-section").html(response);
   })
-  .fail(function() { $.jHueNotify.error('${ _("Check config failed: ")}'); });
+  .fail(function() { $(document).trigger('error', '${ _("Check config failed: ")}'); });
 
   $("[rel='popover']").popover();
 
@@ -246,9 +246,9 @@ $(document).ready(function(){
     $(button).button('loading');
     $.post($(this).data("sample-url"), function(data) {
       if (data.status == 0) {
-        $.jHueNotify.info('${ _("Examples refreshed") }');
+        $(document).trigger('info','${ _("Examples refreshed") }');
       } else {
-        $.jHueNotify.error(data.message);
+        $(document).trigger('error', data.message);
       }
     })
     .always(function(data) {
@@ -264,7 +264,7 @@ $(document).ready(function(){
     });
     $.when.apply(this, calls)
       .then(function() {
-        $.jHueNotify.info('${ _("Examples refreshed") }');
+        $(document).trigger('info', '${ _("Examples refreshed") }');
       })
       .always(function(data) {
         $(button).button('reset');
@@ -328,9 +328,9 @@ $(document).ready(function(){
   $(".updatePreferences").click(function () {
     $.post("${ url('about:update_preferences') }", $("input").serialize(), function(data) {
       if (data.status == 0) {
-        $.jHueNotify.info('${ _("Configuration updated") }');
+        $(document).trigger('info', '${ _("Configuration updated") }');
       } else {
-        $.jHueNotify.error(data.data);
+        $(document).trigger('error', data.data);
       }
     });
   });

+ 1 - 1
apps/beeswax/src/beeswax/templates/execute.mako

@@ -463,7 +463,7 @@ ${layout.menubar(section='query')}
 
       var successfunction = function (response, newValue) {
         if (response.status != 0) {
-          $.jHueNotify.error("${ _('Problem: ') }" + response.data);
+          $(document).trigger("error", "${ _('Problem: ') }" + response.data);
         }
       }
 

+ 2 - 2
apps/beeswax/src/beeswax/templates/watch_wait.mako

@@ -154,9 +154,9 @@ ${layout.menubar(section='query')}
         $.post("${ url(app_name + ':cancel_operation', query.id) }",
           function(response) {
             if (response['status'] != 0) {
-              $.jHueNotify.error("${ _('Problem: ') }" + response['message']);
+              $(document).trigger("error", "${ _('Problem: ') }" + response['message']);
             } else {
-              $.jHueNotify.info("${ _('Query canceled!') }")
+              $(document).trigger("info", "${ _('Query canceled!') }")
             }
           }
         );

+ 4 - 4
apps/beeswax/static/js/autocomplete.utils.js

@@ -75,7 +75,7 @@ function hac_getTableColumns(databaseName, tableName, textScanned, callback) {
       table: tableName,
       onDataReceived: function (data) {
         if (data.error) {
-          $.jHueNotify.error(data.error);
+          $(document).trigger('error', data.error);
         }
         else {
           $.totalStorage('columns_' + databaseName + '_' + tableName, (data.columns ? data.columns.join(" ") : ""));
@@ -89,7 +89,7 @@ function hac_getTableColumns(databaseName, tableName, textScanned, callback) {
       table: tableName,
       onDataReceived: function (data) {
         if (data.error) {
-          $.jHueNotify.error(data.error);
+          $(document).trigger('error', data.error);
         }
         else {
           $.totalStorage('columns_' + databaseName + '_' + tableName, (data.columns ? data.columns.join(" ") : ""));
@@ -117,7 +117,7 @@ function hac_getTables(databaseName, callback) {
       database: databaseName,
       onDataReceived: function (data) {
         if (data.error) {
-          $.jHueNotify.error(data.error);
+          $(document).trigger('error', data.error);
         }
         else {
           $.totalStorage('tables_' + databaseName, data.tables.join(" "));
@@ -130,7 +130,7 @@ function hac_getTables(databaseName, callback) {
       database: databaseName,
       onDataReceived: function (data) {
         if (data.error) {
-          $.jHueNotify.error(data.error);
+          $(document).trigger('error', data.error);
         }
         else {
           $.totalStorage('tables_' + databaseName, data.tables.join(" "));

+ 3 - 3
apps/filebrowser/src/filebrowser/templates/listdir_components.mako

@@ -775,7 +775,7 @@ from django.utils.translation import ugettext as _
       $.ajaxSetup({
         error:function (x, e) {
           if (x.status == 500) {
-            $.jHueNotify.error("${_('There was a problem with your request.')}");
+            $(document).trigger("error", "${_('There was a problem with your request.')}");
             $("#hueBreadcrumbText").blur();
           }
         }
@@ -967,7 +967,7 @@ from django.utils.translation import ugettext as _
         self.isLoading(true);
         $.getJSON(self.targetPath() + "?pagesize=" + self.recordsPerPage() + "&pagenum=" + self.targetPageNum() + "&filter=" + self.searchQuery() + "&sortby=" + self.sortBy() + "&descending=" + self.sortDescending() + "&format=json", function (data) {
           if (data.error){
-            $.jHueNotify.error(data.error);
+            $(document).trigger("error", data.error);
             self.isLoading(false);
             return false;
           }
@@ -1252,7 +1252,7 @@ from django.utils.translation import ugettext as _
           onComplete:function (id, fileName, response) {
             num_of_pending_uploads--;
             if (response.status != 0) {
-              $.jHueNotify.error("${ _('Error: ') }" + response['data']);
+              $(document).trigger("error", "${ _('Error: ') }" + response['data']);
             } else if (num_of_pending_uploads == 0) {
               window.location = "/filebrowser/view" + self.currentPath();
             }

+ 1 - 1
apps/hbase/static/js/api.js

@@ -35,7 +35,7 @@ var API = {
     }
     var queryObject = {url:url, method:'POST', startTime: new Date().getTime(), status:'running...'}
     var handler = $.post(url, $_POST).error(function(response) {
-      $.jHueNotify.error(JSON.parse(response.responseText).message);
+      $(document).trigger("error", JSON.parse(response.responseText).message);
     });
     var doneHandle = handler.done;
     handler.done = function() {

+ 1 - 1
apps/hbase/static/js/nav.js

@@ -33,7 +33,7 @@ var Router = {
       multiple: false,
       onComplete: function (id, fileName, response) {
         if(response.response != null)
-          $.jHueNotify.error($(response.response).find('.alert strong').text());
+          $(document).trigger("error", $(response.response).find('.alert strong').text());
         else
           app.views.tabledata.reload();
       }

+ 1 - 1
apps/hbase/static/js/utils.js

@@ -140,7 +140,7 @@ function launchModal(modal, data) {
             data.reload();
             element.modal('hide');
           } else {
-            $.jHueNotify.error($(response.response).find('div.alert strong').text());
+            $(document).trigger("error", $(response.response).find('div.alert strong').text());
           }
         },
         onSubmit: function() {

+ 2 - 2
apps/jobbrowser/src/jobbrowser/templates/job.mako

@@ -409,7 +409,7 @@ $(document).ready(function () {
   $(document).ajaxError(function (event, jqxhr, settings, exception) {
     if (jqxhr.status == 500) {
       window.clearInterval(_runningInterval);
-      $.jHueNotify.error("${_('There was a problem communicating with the server. Refresh the page.')}");
+      $(document).trigger("error", "${_('There was a problem communicating with the server. Refresh the page.')}");
     }
   });
 
@@ -541,7 +541,7 @@ $(document).ready(function () {
               _this.button("reset");
               $("#killModal").modal("hide");
               if (response.status != 0) {
-                $.jHueNotify.error("${ _('There was a problem killing this job.') }");
+                $(document).trigger("error", "${ _('There was a problem killing this job.') }");
               }
               else {
                 callJobDetails({ url: _this.data("url")});

+ 4 - 4
apps/jobbrowser/src/jobbrowser/templates/jobs.mako

@@ -132,7 +132,7 @@ ${ commonheader(None, "jobbrowser", user) | n,unicode }
     $(document).ajaxError(function (event, jqxhr, settings, exception) {
       if (jqxhr.status == 500) {
         window.clearInterval(_runningInterval);
-        $.jHueNotify.error("${_('There was a problem communicating with the server. Refresh the page.')}");
+        $(document).trigger("error", "${_('There was a problem communicating with the server. Refresh the page.')}");
       }
     });
 
@@ -153,7 +153,7 @@ ${ commonheader(None, "jobbrowser", user) | n,unicode }
               $("a[data-row-selector='true']").jHueRowSelector();
             }
             catch (error) {
-              $.jHueNotify.error(error);
+              $(document).trigger("error", error);
             }
           });
         }
@@ -197,7 +197,7 @@ ${ commonheader(None, "jobbrowser", user) | n,unicode }
                 $("a[data-row-selector='true']").jHueRowSelector();
               }
               catch (error) {
-                $.jHueNotify.error(error);
+                $(document).trigger("error", error);
               }
             }
           }
@@ -346,7 +346,7 @@ ${ commonheader(None, "jobbrowser", user) | n,unicode }
                 _this.button("reset");
                 $("#killModal").modal("hide");
                 if (response.status != 0) {
-                  $.jHueNotify.error("${ _('There was a problem killing this job.') }");
+                  $(document).trigger("error", "${ _('There was a problem killing this job.') }");
                 }
                 else {
                   callJobDetails({ url: _this.data("url")});

+ 2 - 2
apps/oozie/src/oozie/templates/dashboard/list_oozie_bundle.mako

@@ -383,7 +383,7 @@ ${ layout.menubar(section='dashboard') }
         { 'notification': $(this).attr("data-message") },
         function(response) {
           if (response['status'] != 0) {
-            $.jHueNotify.error("${ _('Problem: ') }" + response['data']);
+            $(document).trigger("error", "${ _('Problem: ') }" + response['data']);
           } else {
             window.location.reload();
           }
@@ -398,7 +398,7 @@ ${ layout.menubar(section='dashboard') }
         { 'notification': $(this).data("message") },
         function(response) {
           if (response['status'] != 0) {
-            $.jHueNotify.error("${ _('Error: ') }" + response['data']);
+            $(document).trigger("error", "${ _('Error: ') }" + response['data']);
           } else {
             window.location.reload();
           }

+ 3 - 3
apps/oozie/src/oozie/templates/dashboard/list_oozie_bundles.mako

@@ -284,7 +284,7 @@ ${layout.menubar(section='dashboard')}
                 { "notification":$(this).attr("data-message") },
                 function (response) {
                   if (response["status"] != 0) {
-                    $.jHueNotify.error("${ _('Problem: ') }" + response["data"]);
+                    $(document).trigger("error", "${ _('Problem: ') }" + response["data"]);
                   } else {
                     window.location.reload();
                   }
@@ -375,7 +375,7 @@ ${layout.menubar(section='dashboard')}
                   ]);
                 }
                 catch (error) {
-                  $.jHueNotify.error(error);
+                  $(document).trigger("error", error);
                 }
               }
 
@@ -416,7 +416,7 @@ ${layout.menubar(section='dashboard')}
             ], false);
           }
           catch (error) {
-            $.jHueNotify.error(error);
+            $(document).trigger("error", error);
           }
         });
         completedTable.fnDraw();

+ 2 - 2
apps/oozie/src/oozie/templates/dashboard/list_oozie_coordinator.mako

@@ -385,7 +385,7 @@ ${ layout.menubar(section='dashboard') }
         { 'notification': $(this).attr("data-message") },
         function(response) {
           if (response['status'] != 0) {
-            $.jHueNotify.error("${ _('Problem: ') }" + response['data']);
+            $(document).trigger("error", "${ _('Problem: ') }" + response['data']);
           } else {
             window.location.reload();
           }
@@ -400,7 +400,7 @@ ${ layout.menubar(section='dashboard') }
         { 'notification': $(this).data("message") },
         function(response) {
           if (response['status'] != 0) {
-            $.jHueNotify.error("${ _('Error: ') }" + response['data']);
+            $(document).trigger("error", "${ _('Error: ') }" + response['data']);
           } else {
             window.location.reload();
           }

+ 3 - 3
apps/oozie/src/oozie/templates/dashboard/list_oozie_coordinators.mako

@@ -296,7 +296,7 @@ ${layout.menubar(section='dashboard')}
                 { "notification":$(this).attr("data-message") },
                 function (response) {
                   if (response["status"] != 0) {
-                    $.jHueNotify.error("${ _('Problem: ') }" + response["data"]);
+                    $(document).trigger("error", "${ _('Problem: ') }" + response["data"]);
                   } else {
                     window.location.reload();
                   }
@@ -389,7 +389,7 @@ ${layout.menubar(section='dashboard')}
                   ]);
                 }
                 catch (error) {
-                  $.jHueNotify.error(error);
+                  $(document).trigger("error", error);
                 }
               }
             }
@@ -432,7 +432,7 @@ ${layout.menubar(section='dashboard')}
             ], false);
           }
           catch (error) {
-            $.jHueNotify.error(error);
+            $(document).trigger("error", error);
           }
         });
         completedTable.fnDraw();

+ 3 - 3
apps/oozie/src/oozie/templates/dashboard/list_oozie_workflow.mako

@@ -400,7 +400,7 @@ ${ layout.menubar(section='dashboard') }
         { 'notification': $(this).data("message") },
         function(response) {
           if (response['status'] != 0) {
-            $.jHueNotify.error("${ _('Error: ') }" + response['data']);
+            $(document).trigger("error", "${ _('Error: ') }" + response['data']);
           } else {
             window.location.reload();
           }
@@ -415,7 +415,7 @@ ${ layout.menubar(section='dashboard') }
         { 'notification': $(this).data("message") },
         function(response) {
           if (response['status'] != 0) {
-            $.jHueNotify.error("${ _('Error: ') }" + response['data']);
+            $(document).trigger("error", "${ _('Error: ') }" + response['data']);
           } else {
             window.location.reload();
           }
@@ -430,7 +430,7 @@ ${ layout.menubar(section='dashboard') }
         { 'notification': $(this).data("message") },
         function(response) {
           if (response['status'] != 0) {
-            $.jHueNotify.error("${ _('Error: ') }" + response['data']);
+            $(document).trigger("error", "${ _('Error: ') }" + response['data']);
           } else {
             window.location.reload();
           }

+ 3 - 3
apps/oozie/src/oozie/templates/dashboard/list_oozie_workflows.mako

@@ -293,7 +293,7 @@ ${ layout.menubar(section='dashboard') }
                 { "notification":$(this).attr("data-message") },
                 function (response) {
                   if (response["status"] != 0) {
-                    $.jHueNotify.error("${ _('Problem: ') }" + response["data"]);
+                    $(document).trigger("error", "${ _('Problem: ') }" + response["data"]);
                   } else {
                     window.location.reload();
                   }
@@ -386,7 +386,7 @@ ${ layout.menubar(section='dashboard') }
                   ]);
                 }
                 catch (error) {
-                  $.jHueNotify.error(error);
+                  $(document).trigger("error", error);
                 }
               }
             }
@@ -428,7 +428,7 @@ ${ layout.menubar(section='dashboard') }
             ], false);
           }
           catch (error) {
-            $.jHueNotify.error(error);
+            $(document).trigger("error", error);
           }
         });
         completedTable.fnDraw();

+ 10 - 10
apps/oozie/src/oozie/templates/editor/edit_workflow.mako

@@ -568,7 +568,7 @@ function import_jobsub_load_success(data) {
   if (data.status == 0) {
     import_jobsub_action.initialize(data.data);
   } else {
-    $.jHueNotify.error("${ _('Received invalid response from server: ') } " + JSON.stringify(data));
+    $(document).trigger("error", "${ _('Received invalid response from server: ') } " + JSON.stringify(data));
   }
 }
 
@@ -576,12 +576,12 @@ function import_workflow_load_success(data) {
   if (data.status == 0) {
     import_workflow_action.initialize(data.data);
   } else {
-    $.jHueNotify.error("${ _('Received invalid response from server: ') } " + JSON.stringify(data));
+    $(document).trigger("error", "${ _('Received invalid response from server: ') } " + JSON.stringify(data));
   }
 }
 
 function workflow_save_success(data) {
-  $.jHueNotify.info("${ _('Workflow saved') }");
+  $(document).trigger("info", "${ _('Workflow saved') }");
   workflow.reload(data.data);
   workflow.is_dirty( false );
   workflow.loading(false);
@@ -589,13 +589,13 @@ function workflow_save_success(data) {
 }
 
 function workflow_save_error(data) {
-  $.jHueNotify.error("${ _('Could not save workflow') }");
+  $(document).trigger("error", "${ _('Could not save workflow') }");
   workflow.loading(false);
   $("#btn-save-wf").button('reset');
 }
 
 function workflow_read_only_handler() {
-  $.jHueNotify.error("${ _('Workflow is in read only mode.') }");
+  $(document).trigger("error", "${ _('Workflow is in read only mode.') }");
   workflow.loading(false);
 }
 
@@ -609,7 +609,7 @@ function workflow_load_success(data) {
     ko.applyBindings(kill_view_model, $('#editKill')[0]);
 
   } else {
-    $.jHueNotify.error("${ _('Received invalid response from server: ') }" + JSON.stringify(data));
+    $(document).trigger("error", "${ _('Received invalid response from server: ') }" + JSON.stringify(data));
   }
   workflow.loading(false);
 }
@@ -827,9 +827,9 @@ $('#importJobsub').on('click', '.action-row', function(e) {
 
           workflow.el.trigger('workflow:rebuild');
           routie('editWorkflow');
-          $.jHueNotify.info("${ _('Action imported at the top of the workflow.') } ");
+          $(document).trigger("info", "${ _('Action imported at the top of the workflow.') } ");
         } else {
-          $.jHueNotify.error("${ _('Received invalid response from server: ') } " + JSON.stringify(data));
+          $(document).trigger("error", "${ _('Received invalid response from server: ') } " + JSON.stringify(data));
         }
       }
     });
@@ -851,7 +851,7 @@ $('#importOozie').on('click', '.action-row', function(e) {
           import_view_model.oozie().initialize({nodes: data.data.actions});
           routie('importAction/oozie');
         } else {
-          $.jHueNotify.error("${ _('Received invalid response from server: ') } " + JSON.stringify(data));
+          $(document).trigger("error", "${ _('Received invalid response from server: ') } " + JSON.stringify(data));
         }
       }
     });
@@ -868,7 +868,7 @@ $('#importOozieAction').on('click', '.action-row', function(e) {
 
     workflow.el.trigger('workflow:rebuild');
     routie('editWorkflow');
-    $.jHueNotify.info("${ _('Action imported at the top of the workflow.') } ");
+    $(document).trigger("error", "${ _('Action imported at the top of the workflow.') } ");
   }
 });
 

+ 3 - 3
apps/search/src/search/templates/admin_collection_facets.mako

@@ -557,7 +557,7 @@ ${ commonheader(_('Search'), "search", user, "40px") | n,unicode }
       field(new DateMath({frequency: parseFloat($.trim(value).split(" ")[0]), unit: $.trim(value).split(" ")[1]}));
     }
     catch (exception){
-      $.jHueNotify.error("${ _('There was an error parsing your input') }");
+      $(document).trigger("error", "${ _('There was an error parsing your input') }");
       field(new DateMath({frequency: defaultFrequency, unit: 'DAYS'}));
     }
   }
@@ -819,11 +819,11 @@ ${ commonheader(_('Search'), "search", user, "40px") | n,unicode }
         contentType: 'application/json',
         type: 'POST',
         success: function () {
-          $.jHueNotify.info("${_('Facets updated')}");
+          $(document).trigger("info", "${_('Facets updated')}");
           self.isSaveBtnVisible(false);
         },
         error: function (data) {
-          $.jHueNotify.error("${_('Error: ')}" + data);
+          $(document).trigger("error", "${_('Error: ')}" + data);
         },
         complete: function() {
           $("#save-facets").button('reset');

+ 2 - 2
apps/search/src/search/templates/admin_collection_highlighting.mako

@@ -112,10 +112,10 @@ ${ commonheader(_('Search'), "search", user, "40px") | n,unicode }
         contentType: 'application/json',
         type: 'POST',
         success: function () {
-          $.jHueNotify.info("${_('Updated')}");
+          $(document).trigger("info", "${_('Updated')}");
         },
         error: function (data) {
-          $.jHueNotify.error("${_('Error: ')}" + data);
+          $(document).trigger("error", "${_('Error: ')}" + data);
         },
         complete: function() {
           $("#save-btn").button('reset');

+ 2 - 2
apps/search/src/search/templates/admin_collection_sorting.mako

@@ -190,10 +190,10 @@ ${ commonheader(_('Search'), "search", user, "40px") | n,unicode }
         contentType: 'application/json',
         type: 'POST',
         success: function () {
-          $.jHueNotify.info("${_('Sorting updated')}");
+          $(document).trigger("info", "${_('Sorting updated')}");
         },
         error: function (data) {
-          $.jHueNotify.error("${_('Error: ')}" + data);
+          $(document).trigger("error", "${_('Error: ')}" + data);
         },
         complete: function() {
           $("#save-sorting").button('reset');

+ 2 - 2
apps/search/src/search/templates/admin_collection_template.mako

@@ -686,10 +686,10 @@ ${ commonheader(_('Search'), "search", user, "40px") | n,unicode }
         contentType: 'application/json',
         type: 'POST',
         success: function () {
-          $.jHueNotify.info("${_('Template updated')}");
+          $(document).trigger("info", "${_('Template updated')}");
         },
         error: function (data) {
-          $.jHueNotify.error("${_('Error: ')}" + data);
+          $(document).trigger("error", "${_('Error: ')}" + data);
         },
         complete: function () {
           $("#save-template").button('reset');

+ 3 - 3
apps/search/src/search/templates/admin_collections.mako

@@ -209,7 +209,7 @@ ${ commonheader(_('Search'), "search", user, "40px") | n,unicode }
     $(document).on("imported", function () {
       $("#importModal").modal("hide");
       $("#importModalBtn").button("reset");
-      $.jHueNotify.info("${ _("Collections imported successfully.") }"); // Could fail actually
+      $(document).trigger("info", "${ _("Collections imported successfully.") }"); // Could fail actually
     });
 
     $(document).on("deleting", function () {
@@ -221,11 +221,11 @@ ${ commonheader(_('Search'), "search", user, "40px") | n,unicode }
     $(document).on("collectionDeleted", function () {
       $("#deleteModal").modal("hide");
       $("#deleteModalBtn").button("reset");
-      $.jHueNotify.info("${ _("Collection deleted successfully.") }");
+      $(document).trigger("info", "${ _("Collection deleted successfully.") }");
     });
 
     $(document).on("collectionCopied", function () {
-      $.jHueNotify.info("${ _("Collection copied successfully.") }");
+      $(document).trigger("info", "${ _("Collection copied successfully.") }");
     });
 
     $(document).on("confirmDelete", function () {

+ 1 - 1
apps/search/src/search/templates/search.mako

@@ -218,7 +218,7 @@ ${ commonheader(_('Search'), "search", user, "40px") | n,unicode }
   $(document).ready(function () {
     if ($(".errorlist").length > 0) {
       $(".errorlist li").each(function () {
-        $.jHueNotify.error($(this).text());
+        $(document).trigger("error", $(this).text());
       });
     }
 

+ 7 - 7
apps/sqoop/src/sqoop/templates/app.mako

@@ -672,7 +672,7 @@ function handle_form_errors(e, node, options, data) {
   switch(data.status) {
     case 1:
     $.each(errors, function(component, err) {
-      $.jHueNotify.error(err);
+      $(document).trigger("error", err);
     });
     break;
     case 100:
@@ -720,27 +720,27 @@ $(document).on('connection_error.jobs', function(e, name, options, jqXHR) {
 });
 
 $(document).on('start.job', function(e, options, job) {
-  $.jHueNotify.info("${ _('The job is starting...') }");
+  $(document).trigger("info", "${ _('The job is starting...') }");
 });
 
 $(document).on('started.job', function(e, job, options, submission_dict) {
-  $.jHueNotify.info("${ _('Started job.') }");
+  $(document).trigger("info", "${ _('Started job.') }");
 });
 
 $(document).on('start_fail.job', function(e, job, options, error) {
-  $.jHueNotify.error("${ _('Error: ') }" + (typeof error.exception != "undefined" ? error.exception : error));
+  $(document).trigger("error", "${ _('Error: ') }" + (typeof error.exception != "undefined" ? error.exception : error));
 });
 
 $(document).on('stopped.job', function(e, job, options, submission_dict) {
-  $.jHueNotify.info("${ _('Stopped job.') }");
+  $(document).trigger("info", "${ _('Stopped job.') }");
 });
 
 $(document).on('stop_fail.job', function(e, job, options, submission_dict) {
-  $.jHueNotify.error("${ _('Could not stop job.') }");
+  $(document).trigger("error", "${ _('Could not stop job.') }");
 });
 
 $(document).one('load_fail.job', function() {
-  $.jHueNotify.error("${ _('Could not load node.') }");
+  $(document).trigger("error", "${ _('Could not load node.') }");
 });
 
 $(document).on('save_fail.job', handle_form_errors);

+ 9 - 2
desktop/core/src/desktop/templates/common_footer.mako

@@ -23,9 +23,9 @@ from django.template.defaultfilters import escape, escapejs
   <script>
     %for message in messages:
       %if message.tags == 'error':
-        $.jHueNotify.error('${ escapejs(escape(message)) }');
+        $(document).trigger('error', '${ escapejs(escape(message)) }');
       %else:
-        $.jHueNotify.info('${ escapejs(escape(message)) }');
+        $(document).trigger('info', '${ escapejs(escape(message)) }');
       %endif
     %endfor
   </script>
@@ -33,6 +33,13 @@ from django.template.defaultfilters import escape, escapejs
 
 <script type="text/javascript">
   $(document).ready(function () {
+    $(document).on("info", function (e, msg) {
+      $.jHueNotify.info(msg);
+    });
+    $(document).on("error", function (e, msg) {
+      $.jHueNotify.error(msg);
+    });
+
     $(".dataTables_wrapper").jHueTableScroller();
     var resetTimeout = -1;
     var pendingRequestsInterval = -1;

+ 1 - 3
desktop/core/static/js/jquery.filechooser.js

@@ -261,9 +261,7 @@
                 }, 100);
             }
         }).error(function(){
-            if ($.jHueNotify) {
-                $.jHueNotify.info(_parent.options.labels.FILE_NOT_FOUND);
-            }
+            $(document).trigger("info", _parent.options.labels.FILE_NOT_FOUND);
             _parent.navigateTo(_parent.options.errorRedirectPath != "" ? _parent.options.errorRedirectPath : "/?default_to_home");
             _parent.options.onError();
         });

+ 1 - 3
desktop/core/static/js/jquery.tour.js

@@ -271,9 +271,7 @@
           $("#jHueTourQuestion").click();
         },
         error: function (e) {
-          if ($.jHueNotify !== undefined) {
-            $.jHueNotify.error(e.message)
-          }
+          $(document).trigger("error", e.message);
           $("#jHueTourRemoteTutorial").removeAttr("disabled");
           $("#jHueTourRemoteTutorialBtn").removeAttr("disabled");
         }