You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by da...@apache.org on 2015/05/04 05:13:21 UTC

[1/2] stratos git commit: add application editor contextMenu icons

Repository: stratos
Updated Branches:
  refs/heads/master 46441b028 -> 5168b2b59


add application editor contextMenu icons


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

Branch: refs/heads/master
Commit: aa4eb4ced5212b509191f1dce6d222bba93c23bb
Parents: 46441b0
Author: Dakshika Jayathilaka <si...@gmail.com>
Authored: Mon May 4 08:27:11 2015 +0530
Committer: Dakshika Jayathilaka <si...@gmail.com>
Committed: Mon May 4 08:27:11 2015 +0530

----------------------------------------------------------------------
 .../theme0/images/ContextMenu/page_white_delete.png  | Bin 0 -> 536 bytes
 .../theme0/images/ContextMenu/page_white_edit.png    | Bin 0 -> 618 bytes
 2 files changed, 0 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/aa4eb4ce/components/org.apache.stratos.manager.console/console/themes/theme0/images/ContextMenu/page_white_delete.png
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme0/images/ContextMenu/page_white_delete.png b/components/org.apache.stratos.manager.console/console/themes/theme0/images/ContextMenu/page_white_delete.png
new file mode 100755
index 0000000..af1ecaf
Binary files /dev/null and b/components/org.apache.stratos.manager.console/console/themes/theme0/images/ContextMenu/page_white_delete.png differ

http://git-wip-us.apache.org/repos/asf/stratos/blob/aa4eb4ce/components/org.apache.stratos.manager.console/console/themes/theme0/images/ContextMenu/page_white_edit.png
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme0/images/ContextMenu/page_white_edit.png b/components/org.apache.stratos.manager.console/console/themes/theme0/images/ContextMenu/page_white_edit.png
new file mode 100755
index 0000000..b93e776
Binary files /dev/null and b/components/org.apache.stratos.manager.console/console/themes/theme0/images/ContextMenu/page_white_edit.png differ


[2/2] stratos git commit: add context menu to cartridge group editor [STRATOS-1252]

Posted by da...@apache.org.
add context menu to cartridge group editor [STRATOS-1252]


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

Branch: refs/heads/master
Commit: 5168b2b59fe85de9163293077c08006bbec41915
Parents: aa4eb4c
Author: Dakshika Jayathilaka <si...@gmail.com>
Authored: Mon May 4 08:41:23 2015 +0530
Committer: Dakshika Jayathilaka <si...@gmail.com>
Committed: Mon May 4 08:41:23 2015 +0530

----------------------------------------------------------------------
 .../js/custom/applications_group_editor.js      | 80 ++++++++++++++++++++
 1 file changed, 80 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/5168b2b5/components/org.apache.stratos.manager.console/console/themes/theme0/js/custom/applications_group_editor.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme0/js/custom/applications_group_editor.js b/components/org.apache.stratos.manager.console/console/themes/theme0/js/custom/applications_group_editor.js
index d2e7017..3969abe 100644
--- a/components/org.apache.stratos.manager.console/console/themes/theme0/js/custom/applications_group_editor.js
+++ b/components/org.apache.stratos.manager.console/console/themes/theme0/js/custom/applications_group_editor.js
@@ -489,9 +489,89 @@ $(document).ready(function(){
         dagrePosition();
     });
 
+    //genrate context menu for nodes
+    $.contextMenu({
+        selector: '.stepnode',
+        callback: function(key, options) {
+            var m = "clicked: " + key + $(this);
+            if(key == 'delete'){
+                deleteNode($(this));
+            }else if(key == 'edit'){
+                document.getElementById('group-data-scroll').scrollIntoView();
+                tabData($(this));
+            }
+        },
+        items: {
+            "edit": {name: "Edit", icon: "edit"},
+            "delete": {name: "Delete", icon: "delete"}
+        }
+    });
+
 });
 
 //bootstrap tooltip added
 $(function () {
     $('[data-toggle="tooltip"]').tooltip();
 })
+
+
+// ************* Add context menu for nodes ******************
+//remove nodes from workarea
+function deleteNode(endPoint){
+    if(endPoint.attr('id') != 'group-base'){
+        var allnodes = $(".stepnode");
+        var superParent = endPoint.attr('id').split("-")[0]+endPoint.attr('id').split("-")[1];
+        var nodeName = endPoint.attr('data-ctype');
+        var nodeType = endPoint.attr('data-type');
+        var notyText = '';
+
+        if(nodeType == 'group'){
+            notyText = 'This will remove related nodes from the Editor. Are you sure you want to delete '
+                +nodeType + ': '+nodeName+'?';
+        }else{
+            notyText = 'Are you sure you want to delete '+nodeType + ': '+nodeName+'?';
+        }
+        noty({
+            layout: 'bottomRight',
+            type: 'warning',
+            text:  notyText,
+            buttons: [
+                {addClass: 'btn btn-primary', text: 'Yes', onClick: function($noty) {
+                    $noty.close();
+
+                    allnodes.each(function(){
+                        var currentId = $(this).attr('id').split("-")[0]+$(this).attr('id').split("-")[1];
+                        if(currentId == superParent){
+                            var that=$(this);      //get all of your DIV tags having endpoints
+                            for (var i=0;i<that.length;i++) {
+                                var endpoints = jsPlumb.getEndpoints($(that[i])); //get all endpoints of that DIV
+                                if(endpoints){
+                                    for (var m=0;m<endpoints.length;m++) {
+                                        // if(endpoints[m].anchor.type=="TopCenter") //Endpoint on right side
+                                        jsPlumb.deleteEndpoint(endpoints[m]);  //remove endpoint
+                                    }
+                                }
+
+                            }
+                            jsPlumb.detachAllConnections($(this));
+                            $(this).remove();
+                        }
+
+                    });
+
+                }
+                },
+                {addClass: 'btn btn-danger', text: 'No', onClick: function($noty) {
+                    $noty.close();
+                }
+                }
+            ]
+        });
+
+
+
+    }else{
+        var n = noty({text: 'Sorry you can\'t remove root group node' , layout: 'bottomRight', type: 'warning'});
+    }
+
+}
\ No newline at end of file