diff options
-rw-r--r-- | bitbake/lib/toaster/toastergui/static/js/libtoaster.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/js/libtoaster.js b/bitbake/lib/toaster/toastergui/static/js/libtoaster.js index b2099a6048..8e2221d2ae 100644 --- a/bitbake/lib/toaster/toastergui/static/js/libtoaster.js +++ b/bitbake/lib/toaster/toastergui/static/js/libtoaster.js | |||
@@ -449,6 +449,16 @@ var libtoaster = (function () { | |||
449 | ajaxLoadingTimerEnabled = false; | 449 | ajaxLoadingTimerEnabled = false; |
450 | } | 450 | } |
451 | 451 | ||
452 | /* Utility function to set a notification for the next page load */ | ||
453 | function _setNotification(name, message){ | ||
454 | var data = { | ||
455 | name: name, | ||
456 | message: message | ||
457 | }; | ||
458 | |||
459 | $.cookie('toaster-notification', JSON.stringify(data), { path: '/'}); | ||
460 | } | ||
461 | |||
452 | return { | 462 | return { |
453 | enableAjaxLoadingTimer: _enableAjaxLoadingTimer, | 463 | enableAjaxLoadingTimer: _enableAjaxLoadingTimer, |
454 | disableAjaxLoadingTimer: _disableAjaxLoadingTimer, | 464 | disableAjaxLoadingTimer: _disableAjaxLoadingTimer, |
@@ -468,6 +478,7 @@ var libtoaster = (function () { | |||
468 | showChangeNotification : _showChangeNotification, | 478 | showChangeNotification : _showChangeNotification, |
469 | createCustomRecipe: _createCustomRecipe, | 479 | createCustomRecipe: _createCustomRecipe, |
470 | makeProjectNameValidation: _makeProjectNameValidation, | 480 | makeProjectNameValidation: _makeProjectNameValidation, |
481 | setNotification: _setNotification, | ||
471 | }; | 482 | }; |
472 | })(); | 483 | })(); |
473 | 484 | ||
@@ -502,6 +513,21 @@ function reload_params(params) { | |||
502 | /* Things that happen for all pages */ | 513 | /* Things that happen for all pages */ |
503 | $(document).ready(function() { | 514 | $(document).ready(function() { |
504 | 515 | ||
516 | (function showNotificationRequest(){ | ||
517 | var cookie = $.cookie('toaster-notification'); | ||
518 | |||
519 | if (!cookie) | ||
520 | return; | ||
521 | |||
522 | var notificationData = JSON.parse(cookie); | ||
523 | |||
524 | libtoaster.showChangeNotification(notificationData.message); | ||
525 | |||
526 | $.removeCookie('toaster-notification', { path: "/"}); | ||
527 | })(); | ||
528 | |||
529 | |||
530 | |||
505 | var ajaxLoadingTimer; | 531 | var ajaxLoadingTimer; |
506 | 532 | ||
507 | /* If we don't have a console object which might be the case in some | 533 | /* If we don't have a console object which might be the case in some |