aboutsummaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/static/js/projectpage.js
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/toaster/toastergui/static/js/projectpage.js')
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/projectpage.js66
1 files changed, 2 insertions, 64 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/js/projectpage.js b/bitbake/lib/toaster/toastergui/static/js/projectpage.js
index 7f19c0d7aa..4536703649 100644
--- a/bitbake/lib/toaster/toastergui/static/js/projectpage.js
+++ b/bitbake/lib/toaster/toastergui/static/js/projectpage.js
@@ -50,70 +50,8 @@ function projectPageInit(ctx) {
$("#delete-project-modal .project-name").text(prjInfo.name);
});
- (function notificationRequest(){
-
- if (urlParams.hasOwnProperty('notify')){
- switch (urlParams.notify){
- case 'new-project':
- $("#project-created-notification").show();
- break;
- case 'layer-imported':
- layerImportedNotification();
- break;
- case 'layer-deleted':
- layerDeletedNotification();
- default:
- break;
- }
- }
- })();
-
- /* Layer deleted notification */
- function layerDeletedNotification(){
- var layer = $.cookie("layer-deleted");
-
- if (!layer)
- return;
-
- var message = "You have deleted <strong>1</strong> layer from your ";
- message += "project: <strong>" + layer + "</strong>";
-
- libtoaster.showChangeNotification(message);
-
- $.removeCookie("layer-deleted", { path: "/"});
- }
-
-
- /* Layer imported notification */
- function layerImportedNotification(){
- var imported = $.cookie("layer-imported-alert");
- var message = "Layer imported";
-
- if (!imported)
- return;
- else
- imported = JSON.parse(imported);
-
- if (imported.deps_added.length === 0) {
- message = "You have imported <strong><a class=\"alert-link\" href=\""+imported.imported_layer.layerdetailurl+"\">"+imported.imported_layer.name+"</a></strong> and added it to your project.";
- } else {
-
- var links = "<a href=\""+imported.imported_layer.layerdetailurl+"\">"+imported.imported_layer.name+"</a>, ";
-
- imported.deps_added.map (function(item, index){
- links +='<a href="'+item.layerdetailurl+'">'+item.name+'</a>';
- /*If we're at the last element we don't want the trailing comma */
- if (imported.deps_added[index+1] !== undefined)
- links += ', ';
- });
-
- /* Length + 1 here to do deps + the imported layer */
- message = 'You have imported <strong><a href="'+imported.imported_layer.layerdetailurl+'">'+imported.imported_layer.name+'</a></strong> and added <strong>'+(imported.deps_added.length+1)+'</strong> layers to your project: <strong>'+links+'</strong>';
- }
-
- libtoaster.showChangeNotification(message);
-
- $.removeCookie("layer-imported-alert", { path: "/"});
+ if (urlParams.hasOwnProperty('notify') && urlParams.notify === 'new-project'){
+ $("#project-created-notification").show();
}
/* Add/Rm layer functionality */