chukwa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ey...@apache.org
Subject [8/8] chukwa git commit: CHUKWA-806. Replace gridster with gridstack. (Eric Yang)
Date Sun, 01 May 2016 04:00:54 GMT
CHUKWA-806. Replace gridster with gridstack.  (Eric Yang)


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

Branch: refs/heads/master
Commit: 6f6e4399eb10f11814b2d478527d88b6ad351a99
Parents: e0bf3c0
Author: Eric Yang <eyang@apache.org>
Authored: Sat Apr 30 21:00:33 2016 -0700
Committer: Eric Yang <eyang@apache.org>
Committed: Sat Apr 30 21:00:33 2016 -0700

----------------------------------------------------------------------
 CHANGES.txt                                     |     2 +
 LICENSE.txt                                     |    76 +
 NOTICE.txt                                      |     9 +-
 .../hadoop/chukwa/hicc/rest/Examples.java       |     8 +-
 src/main/web/hicc/WEB-INF/vm/circles.vm         |     2 +-
 src/main/web/hicc/home/css/component.css        |   349 +
 src/main/web/hicc/home/css/gridstack.min.css    |     1 +
 .../web/hicc/home/css/jquery.gridster.min.css   |     2 -
 src/main/web/hicc/home/index.html               |   132 +-
 src/main/web/hicc/home/js/gridstack.min.js      |    20 +
 src/main/web/hicc/home/js/gridstack.min.map     |     1 +
 src/main/web/hicc/home/js/jquery-ui.js          | 16150 +++++++++++++++++
 src/main/web/hicc/home/js/jquery.gridster.js    |  4051 -----
 .../web/hicc/home/js/jquery.gridster.min.js     |     2 -
 .../hicc/home/js/jquery.gridster.with-extras.js |  4163 -----
 .../home/js/jquery.gridster.with-extras.min.js  |     2 -
 src/main/web/hicc/home/js/lodash.min.js         |    89 +
 17 files changed, 16782 insertions(+), 8277 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/chukwa/blob/6f6e4399/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index ec869f8..fa9f7db 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -6,6 +6,8 @@ Trunk (unreleased changes)
 
   IMPROVEMENTS
 
+    CHUKWA-806. Replace gridster with gridstack.  (Eric Yang)
+
     CHUKWA-805. Added examples to HICC rest api.  (Eric Yang)
 
     CHUKWA-804.  Update user documents to match current code base. (Eric Yang)

http://git-wip-us.apache.org/repos/asf/chukwa/blob/6f6e4399/LICENSE.txt
----------------------------------------------------------------------
diff --git a/LICENSE.txt b/LICENSE.txt
index 734b897..01d13c0 100644
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -1267,3 +1267,79 @@ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
    TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
 
   0. You just DO WHAT THE FUCK YOU WANT TO.
+
+------
+grid-stack.js
+
+The MIT License (MIT)
+
+Copyright (c) 2014-2016 Pavel Reznikov
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+------
+lodash
+
+Copyright jQuery Foundation and other contributors <https://jquery.org/>
+
+Based on Underscore.js, copyright Jeremy Ashkenas,
+DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
+
+This software consists of voluntary contributions made by many
+individuals. For exact contribution history, see the revision history
+available at https://github.com/lodash/lodash
+
+The following license applies to all parts of this software except as
+documented below:
+
+====
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+====
+
+Copyright and related rights for sample code are waived via CC0. Sample
+code is defined as all source code displayed within the prose of the
+documentation.
+
+CC0: http://creativecommons.org/publicdomain/zero/1.0/
+
+====
+
+Files located in the node_modules and vendor directories are externally
+maintained libraries used by this software which have their own
+licenses; we recommend you read them, as their terms may differ from the
+terms above.

http://git-wip-us.apache.org/repos/asf/chukwa/blob/6f6e4399/NOTICE.txt
----------------------------------------------------------------------
diff --git a/NOTICE.txt b/NOTICE.txt
index 9990966..782b76d 100644
--- a/NOTICE.txt
+++ b/NOTICE.txt
@@ -79,9 +79,6 @@ Copyright (c) 2011-2015 Twitter, Inc.
 This product includes typeahead.js
 Copyright (c) 2011-2015 Twitter, Inc.
 
-This product includes gridster.js
-Copyright (c) 2014 ducksboard, http://gridster.net/
-
 This product includes Modernizr
 Copyright (c) 2009-2015 modernizr.com
 
@@ -102,3 +99,9 @@ Copyright (c) 2014-2015, https://github.com/pguso/jquery-plugin-circliful
 
 This product includes chartist.js
 Copyright (c) 2014-2015, https://gionkunz.github.io/chartist-js/
+
+This product includes gridstack.js
+Copyright (c) 2014-2016 Pavel Reznikov
+
+This product includes lodash
+Public Domain

http://git-wip-us.apache.org/repos/asf/chukwa/blob/6f6e4399/src/main/java/org/apache/hadoop/chukwa/hicc/rest/Examples.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/hadoop/chukwa/hicc/rest/Examples.java b/src/main/java/org/apache/hadoop/chukwa/hicc/rest/Examples.java
index 4c2de0a..bc1c596 100644
--- a/src/main/java/org/apache/hadoop/chukwa/hicc/rest/Examples.java
+++ b/src/main/java/org/apache/hadoop/chukwa/hicc/rest/Examples.java
@@ -186,8 +186,8 @@ public class Examples {
       widget.setSrc(new URI("/hicc/welcome.html"));
       widget.setCol(1);
       widget.setRow(1);
-      widget.setSize_x(10);
-      widget.setSize_y(5);
+      widget.setSize_x(12);
+      widget.setSize_y(7);
       WELCOME_PAGE_WIDGET = widget;
       dashboard.add(WELCOME_PAGE_WIDGET);
       DEFAULT_DASHBOARD = dashboard;
@@ -281,8 +281,8 @@ public class Examples {
       widget.setSrc(new URI("/hicc/v1/dashboard/quicklinks"));
       widget.setCol(1);
       widget.setRow(1);
-      widget.setSize_x(10);
-      widget.setSize_y(5);
+      widget.setSize_x(12);
+      widget.setSize_y(7);
       QUICK_LINKS_WIDGET = widget;
       dashboard.add(QUICK_LINKS_WIDGET);
 

http://git-wip-us.apache.org/repos/asf/chukwa/blob/6f6e4399/src/main/web/hicc/WEB-INF/vm/circles.vm
----------------------------------------------------------------------
diff --git a/src/main/web/hicc/WEB-INF/vm/circles.vm b/src/main/web/hicc/WEB-INF/vm/circles.vm
index 65e38ff..c53450a 100644
--- a/src/main/web/hicc/WEB-INF/vm/circles.vm
+++ b/src/main/web/hicc/WEB-INF/vm/circles.vm
@@ -103,7 +103,7 @@ function render(result) {
         color = "#f7d254";
       }
     #end
-    if(radius < 200) {
+    if(radius < 180) {
       width=10;
       fontsize = 12;
     }

http://git-wip-us.apache.org/repos/asf/chukwa/blob/6f6e4399/src/main/web/hicc/home/css/component.css
----------------------------------------------------------------------
diff --git a/src/main/web/hicc/home/css/component.css b/src/main/web/hicc/home/css/component.css
index 1d4d53e..497e20b 100755
--- a/src/main/web/hicc/home/css/component.css
+++ b/src/main/web/hicc/home/css/component.css
@@ -27,6 +27,309 @@
 	font-style: normal;
 }
 
+/* =============================================================================
+   NORMALIZATION
+========================================================================== */
+
+/* *  {
+  margin: 0;
+  padding: 0;
+} */
+
+article, aside, details, figcaption, figure, footer, header, hgroup, nav, section { display: block; }
+[hidden] { display: none; }
+
+ul, ol {
+    list-style: none;
+}
+
+/* =============================================================================
+   COMMONS
+========================================================================== */
+
+* { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }
+
+@font-face {
+    font-family:'Glyphicons Halflings';
+    src:url(../../fonts/glyphicons-halflings-regular.eot);
+    src:url(../../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),
+        url(../../fonts/glyphicons-halflings-regular.woff2) format('woff2'),
+        url(../../fonts/glyphicons-halflings-regular.woff) format('woff'),
+        url(../../fonts/glyphicons-halflings-regular.ttf) format('truetype'),
+        url(../../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg')
+}
+
+body {
+    background-color: #ffffff;
+    font-family: 'Helvetica Neue', Arial, sans-serif;
+    -webkit-font-smoothing: antialiased;
+    font-size: x-small;
+    color: #666666;
+}
+
+.gs-w {
+    background: #FFF;
+    cursor: pointer;
+    //-webkit-box-shadow: 0 0 5px rgba(0,0,0,0.3);
+    //box-shadow: 0 0 5px rgba(0,0,0,0.3);
+    z-index: 2;
+    position: absolute;
+    min-width: 140px;
+    min-height: 140px;
+}
+
+.ready .gs-w:not(.preview-holder) {
+    -webkit-transition: opacity .3s, left .3s, top .3s;
+    -moz-transition: opacity .3s, left .3s, top .3s;
+    -o-transition: opacity .3s, left .3s, top .3s;
+    transition: opacity .3s, left .3s, top .3s;
+}
+
+.ready .gs-w:not(.preview-holder),
+.ready .resize-preview-holder {
+    -webkit-transition: opacity .3s, left .3s, top .3s, width .3s, height .3s;
+    -moz-transition: opacity .3s, left .3s, top .3s, width .3s, height .3s;
+    -o-transition: opacity .3s, left .3s, top .3s, width .3s, height .3s;
+    transition: opacity .3s, left .3s, top .3s, width .3s, height .3s;
+}
+
+.gs-resize-handle {
+    position: absolute;
+    z-index: 1;
+}
+
+.gs-resize-handle-both {
+    width: 20px;
+    height: 20px;
+    bottom: -8px;
+    right: -8px;
+    background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pg08IS0tIEdlbmVyYXRvcjogQWRvYmUgRmlyZXdvcmtzIENTNiwgRXhwb3J0IFNWRyBFeHRlbnNpb24gYnkgQWFyb24gQmVhbGwgKGh0dHA6Ly9maXJld29ya3MuYWJlYWxsLmNvbSkgLiBWZXJzaW9uOiAwLjYuMSAgLS0+DTwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DTxzdmcgaWQ9IlVudGl0bGVkLVBhZ2UlMjAxIiB2aWV3Qm94PSIwIDAgNiA2IiBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHZlcnNpb249IjEuMSINCXhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbDpzcGFjZT0icHJlc2VydmUiDQl4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjZweCIgaGVpZ2h0PSI2cHgiDT4NCTxnIG9wYWNpdHk9IjAuMzAyIj4NCQk8cGF0aCBkPSJNIDYgNiBMIDAgNiBMIDAgNC4yIEwgNCA0LjIgTCA0LjIgNC4yIEwgNC4yIDAgTCA2IDAgTCA2IDYgTCA2IDYgWiIgZmlsbD0iIzAwMDAwMCIvPg0JPC9nPg08L3N2Zz4=');
+    background-position: top left;
+    background-repeat: no-repeat;
+    cursor: se-resize;
+    z-index: 20;
+}
+
+.gs-resize-handle-x {
+    top: 0;
+    bottom: 13px;
+    right: -5px;
+    width: 10px;
+    cursor: e-resize;
+}
+
+.gs-resize-handle-y {
+    left: 0;
+    right: 13px;
+    bottom: -5px;
+    height: 10px;
+    cursor: s-resize;
+}
+
+.gs-w:hover {
+    -webkit-box-shadow: 3px 3px 5px rgba(0,0,0,0.3);
+    box-shadow: 3px 3px 5px rgba(0,0,0,0.3);    
+    z-index: 10;
+}
+
+.gs-w:hover .gs-resize-handle,
+.resizing .gs-resize-handle {
+    opacity: 1;
+}
+
+.gs-resize-handle,
+.gs-w.dragging .gs-resize-handle {
+    opacity: 0;
+}
+
+.gs-resize-disabled .gs-resize-handle {
+    display: none!important;
+}
+
+[data-max-sizex="1"] .gs-resize-handle-x,
+[data-max-sizey="1"] .gs-resize-handle-y,
+[data-max-sizey="1"][data-max-sizex="1"] .gs-resize-handle {
+    display: none !important;
+}
+
+.gs-w:hover .gs-header {
+    opacity: .3;
+    //filter: blur(5px);
+}
+
+.gs-header {
+    color: #555555;
+    position: absolute;
+    top: 0;
+    left: 0;
+    width: 100%;
+    height: 30px;
+    background-color: #eeeeee;
+    opacity: 0;
+    z-index: 20;
+}
+
+.gs-icon {
+    display:inline-block;
+    font-family:'Glyphicons Halflings';
+    font-style:normal;
+    font-weight:400;
+    font-size: 18px;
+    line-height:30px;
+    -webkit-font-smoothing:antialiased;
+    -moz-osx-font-smoothing:grayscale;
+    padding-left: 2px;
+    padding-right: 2px;
+}
+
+.gs-close-handle:before {
+    content:"\e014"
+}
+
+.gs-close-handle {
+    position: absolute;
+    left: 0;
+    width: 24px;
+    height: 30px;
+}
+
+.gs-zoom-handle:before {
+    content:"\e164"
+}
+
+.gs-zoom-handle {
+    position: absolute;
+    right: 0;
+    width: 24px;
+    height: 30px;
+}
+
+
+.overlay_fix {
+    position: absolute;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+    z-index: 100000;
+    opacity: 0;
+    display: none;
+}
+
+.wrapper {
+  position: absolute;
+  top: 0;
+  bottom: 0;
+  left: 0;
+  right: 0;
+  width: 100%;
+  height: 100%;
+}
+
+li iframe {
+  position: absolute;
+  top: 0;
+  bottom: 0;
+  left: 0;
+  right: 0;
+  width: 100%;
+  height: 100%;
+  border: 0px;
+  overflow: hidden;
+}
+
+.tt-dropdown-menu {
+  width: 355px;
+  margin-top: 0px;
+  background-color: #fff;
+  height: 100%;
+}
+
+.typeahead {
+  height: 60px;
+}
+
+.tt-dataset-widgets {
+  width: 355px;
+  margin-top: 0px;
+  background-color: #fff;
+  height: 100%;
+}
+
+.tt-input {
+  position: absolute;
+  top: 0px;
+  width: 240px;
+  height: 38px; 
+  padding: 11px 12px;
+  border: 2px solid #ccc;
+  outline: none;
+}
+
+.tt-hint {
+  position: absolute;
+  top: 0px;
+  width: 240px;
+  height: 60px; 
+  padding: 0px 12px;
+  border: 2px solid #ccc;
+  outline: none;
+}
+
+.tt-suggestions {
+  width: 100%;
+  height: 100%;
+  background-color: #496274;
+  display: block;
+}
+
+.tt-suggestion {
+  clear: both;
+  display: block;
+  box-shadow: inset 0 1px #c6d0da;
+  font-size: 18px;
+  font-weight: bold;
+  height: 60px;
+  color: #fff;
+  background-color: #496274;
+  overflow: hidden;
+  cursor: pointer;
+}
+
+.tt-suggestion > p {
+  margin: 0px;
+  padding: 0px 60px;
+}
+
+.tt-suggestion > p:hover,
+.tt-suggestion > p:focus {
+}
+
+.tt-suggestion.tt-cursor {
+  color: #496274;
+  background-color: white;
+}
+
+.input-group span.twitter-typeahead {
+  display: block !important;
+}
+
+.input-group span.twitter-typeahead .tt-dropdown-menu {
+  top: 32px !important;
+}
+
+.input-group.input-group-lg span.twitter-typeahead .tt-dropdown-menu {
+  top: 44px !important;
+}
+
+.input-group.input-group-sm span.twitter-typeahead .tt-dropdown-menu {
+  top: 28px !important;
+}
+
+#the-basics {
+  text-align: center;
+}
+
 .container > header,
 .codrops-top {
 	color: #fff;
@@ -631,3 +934,49 @@ input.gn-search:focus {
     height: 100%;
 }
 
+.grid-stack {
+    top: 60px;
+}
+
+.grid-stack-item:hover {
+    -webkit-box-shadow: 3px 3px 5px rgba(0,0,0,0.3);
+    box-shadow: 3px 3px 5px rgba(0,0,0,0.3);
+    z-index: 10;
+}
+
+.grid-stack-item > div {
+    display: none
+}
+
+.grid-stack-item:hover > div {
+    display: block;
+    z-index: 20;
+    opacity: 0.3;
+}
+
+.grid-stack-item iframe {
+    border: none;
+    position: absolute;
+    top: 0;
+    bottom: 0;
+    left: 0;
+    right: 0;
+    height: 100%;
+    width: 100%;
+}
+
+.widget-header {
+    color: #555555;
+    background-color: #eeeeee;
+    position: absolute;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+    width: 100%;
+    height: 30px;
+}
+
+.grid-stack>.grid-stack-item>.ui-resizable-se {
+    right: 0;
+}

http://git-wip-us.apache.org/repos/asf/chukwa/blob/6f6e4399/src/main/web/hicc/home/css/gridstack.min.css
----------------------------------------------------------------------
diff --git a/src/main/web/hicc/home/css/gridstack.min.css b/src/main/web/hicc/home/css/gridstack.min.css
new file mode 100644
index 0000000..5fb6602
--- /dev/null
+++ b/src/main/web/hicc/home/css/gridstack.min.css
@@ -0,0 +1 @@
+:root .grid-stack-item>.ui-resizable-handle{filter:none}.grid-stack{position:relative}.grid-stack.grid-stack-rtl{direction:ltr}.grid-stack.grid-stack-rtl>.grid-stack-item{direction:rtl}.grid-stack .grid-stack-placeholder>.placeholder-content{border:1px dashed #d3d3d3;margin:0;position:absolute;top:0;left:10px;right:10px;bottom:0;width:auto;z-index:0!important;text-align:center}.grid-stack>.grid-stack-item{min-width:8.3333333333%;position:absolute;padding:0}.grid-stack>.grid-stack-item>.grid-stack-item-content{margin:0;position:absolute;top:0;left:10px;right:10px;bottom:0;width:auto;z-index:0!important;overflow-x:hidden;overflow-y:auto}.grid-stack>.grid-stack-item>.ui-resizable-handle{position:absolute;font-size:.1px;display:block;-ms-touch-action:none;touch-action:none}.grid-stack>.grid-stack-item.ui-resizable-autohide>.ui-resizable-handle,.grid-stack>.grid-stack-item.ui-resizable-disabled>.ui-resizable-handle{display:none}.grid-stack>.grid-stack-item.ui-draggable-dragging,.grid-sta
 ck>.grid-stack-item.ui-resizable-resizing{z-index:100}.grid-stack>.grid-stack-item.ui-draggable-dragging>.grid-stack-item-content,.grid-stack>.grid-stack-item.ui-resizable-resizing>.grid-stack-item-content{box-shadow:1px 4px 6px rgba(0,0,0,.2);opacity:.8}.grid-stack>.grid-stack-item>.ui-resizable-se,.grid-stack>.grid-stack-item>.ui-resizable-sw{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjE2cHgiIGhlaWdodD0iMTZweCIgdmlld0JveD0iMCAwIDUxMS42MjYgNTExLjYyNyIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDA
 gNTExLjYyNiA1MTEuNjI3OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxnPgoJPHBhdGggZD0iTTMyOC45MDYsNDAxLjk5NGgtMzYuNTUzVjEwOS42MzZoMzYuNTUzYzQuOTQ4LDAsOS4yMzYtMS44MDksMTIuODQ3LTUuNDI2YzMuNjEzLTMuNjE1LDUuNDIxLTcuODk4LDUuNDIxLTEyLjg0NSAgIGMwLTQuOTQ5LTEuODAxLTkuMjMxLTUuNDI4LTEyLjg1MWwtNzMuMDg3LTczLjA5QzI2NS4wNDQsMS44MDksMjYwLjc2LDAsMjU1LjgxMywwYy00Ljk0OCwwLTkuMjI5LDEuODA5LTEyLjg0Nyw1LjQyNCAgIGwtNzMuMDg4LDczLjA5Yy0zLjYxOCwzLjYxOS01LjQyNCw3LjkwMi01LjQyNCwxMi44NTFjMCw0Ljk0NiwxLjgwNyw5LjIyOSw1LjQyNCwxMi44NDVjMy42MTksMy42MTcsNy45MDEsNS40MjYsMTIuODUsNS40MjYgICBoMzYuNTQ1djI5Mi4zNThoLTM2LjU0MmMtNC45NTIsMC05LjIzNSwxLjgwOC0xMi44NSw1LjQyMWMtMy42MTcsMy42MjEtNS40MjQsNy45MDUtNS40MjQsMTIuODU0ICAgYzAsNC45NDUsMS44MDcsOS4yMjcsNS40MjQsMTIuODQ3bDczLjA4OSw3My4wODhjMy42MTcsMy42MTcsNy44OTgsNS40MjQsMTIuODQ3LDUuNDI0YzQuOTUsMCw5LjIzNC0xLjgwNywxMi44NDktNS40MjQgICBsNzMuMDg3LTczLjA4OGMzLjYxMy0zLjYyLDUuNDIxLTcuOTAxLDUuNDIxLTEyLjg0N2MwLTQuOTQ4LTEuODA4LTkuMjMyLTUuNDIxLTEyLjg1NCAgIEMzMzguMTQyLDQwMy44MDIsMzMzLjg1Nyw0MDEuOTk0LDMyOC45
 MDYsNDAxLjk5NHoiIGZpbGw9IiM2NjY2NjYiLz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8L3N2Zz4K);background-repeat:no-repeat;background-position:center;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.grid-stack>.grid-stack-item>.ui-resizable-nw{cursor:nw-resize;width:20px;height:20px;left:10px;top:0}.grid-stack>.grid-stack-item>.ui-resizable-n{cursor:n-resize;height:10px;top:0;left:25px;right:25px}.grid-stack>.grid-stack-item>.ui-resizable-ne{cursor:ne-resize;width:20px;height:20px;right:10px;top:0}.grid-stack>.grid-stack-item>.ui-resizable-e{cursor:e-resize;width:10px;right:10px;top:15px;bottom:15px}.grid-stack>.grid-stack-item>.ui-resizable-se{-webkit-transform:rotate(-45deg);-moz-transform:rotate(-45deg);-ms-transform:rotate(-45deg);-o-transform:rota
 te(-45deg);transform:rotate(-45deg);cursor:se-resize;width:20px;height:20px;right:10px;bottom:0}.grid-stack>.grid-stack-item>.ui-resizable-s{cursor:s-resize;height:10px;left:25px;bottom:0;right:25px}.grid-stack>.grid-stack-item>.ui-resizable-sw{cursor:sw-resize;width:20px;height:20px;left:10px;bottom:0}.grid-stack>.grid-stack-item>.ui-resizable-w{cursor:w-resize;width:10px;left:10px;top:15px;bottom:15px}.grid-stack>.grid-stack-item.ui-draggable-dragging>.ui-resizable-handle{display:none!important}.grid-stack>.grid-stack-item[data-gs-width='1']{width:8.3333333333%}.grid-stack>.grid-stack-item[data-gs-x='1']{left:8.3333333333%}.grid-stack>.grid-stack-item[data-gs-min-width='1']{min-width:8.3333333333%}.grid-stack>.grid-stack-item[data-gs-max-width='1']{max-width:8.3333333333%}.grid-stack>.grid-stack-item[data-gs-width='2']{width:16.6666666667%}.grid-stack>.grid-stack-item[data-gs-x='2']{left:16.6666666667%}.grid-stack>.grid-stack-item[data-gs-min-width='2']{min-width:16.6666666667%}.g
 rid-stack>.grid-stack-item[data-gs-max-width='2']{max-width:16.6666666667%}.grid-stack>.grid-stack-item[data-gs-width='3']{width:25%}.grid-stack>.grid-stack-item[data-gs-x='3']{left:25%}.grid-stack>.grid-stack-item[data-gs-min-width='3']{min-width:25%}.grid-stack>.grid-stack-item[data-gs-max-width='3']{max-width:25%}.grid-stack>.grid-stack-item[data-gs-width='4']{width:33.3333333333%}.grid-stack>.grid-stack-item[data-gs-x='4']{left:33.3333333333%}.grid-stack>.grid-stack-item[data-gs-min-width='4']{min-width:33.3333333333%}.grid-stack>.grid-stack-item[data-gs-max-width='4']{max-width:33.3333333333%}.grid-stack>.grid-stack-item[data-gs-width='5']{width:41.6666666667%}.grid-stack>.grid-stack-item[data-gs-x='5']{left:41.6666666667%}.grid-stack>.grid-stack-item[data-gs-min-width='5']{min-width:41.6666666667%}.grid-stack>.grid-stack-item[data-gs-max-width='5']{max-width:41.6666666667%}.grid-stack>.grid-stack-item[data-gs-width='6']{width:50%}.grid-stack>.grid-stack-item[data-gs-x='6']{lef
 t:50%}.grid-stack>.grid-stack-item[data-gs-min-width='6']{min-width:50%}.grid-stack>.grid-stack-item[data-gs-max-width='6']{max-width:50%}.grid-stack>.grid-stack-item[data-gs-width='7']{width:58.3333333333%}.grid-stack>.grid-stack-item[data-gs-x='7']{left:58.3333333333%}.grid-stack>.grid-stack-item[data-gs-min-width='7']{min-width:58.3333333333%}.grid-stack>.grid-stack-item[data-gs-max-width='7']{max-width:58.3333333333%}.grid-stack>.grid-stack-item[data-gs-width='8']{width:66.6666666667%}.grid-stack>.grid-stack-item[data-gs-x='8']{left:66.6666666667%}.grid-stack>.grid-stack-item[data-gs-min-width='8']{min-width:66.6666666667%}.grid-stack>.grid-stack-item[data-gs-max-width='8']{max-width:66.6666666667%}.grid-stack>.grid-stack-item[data-gs-width='9']{width:75%}.grid-stack>.grid-stack-item[data-gs-x='9']{left:75%}.grid-stack>.grid-stack-item[data-gs-min-width='9']{min-width:75%}.grid-stack>.grid-stack-item[data-gs-max-width='9']{max-width:75%}.grid-stack>.grid-stack-item[data-gs-width
 ='10']{width:83.3333333333%}.grid-stack>.grid-stack-item[data-gs-x='10']{left:83.3333333333%}.grid-stack>.grid-stack-item[data-gs-min-width='10']{min-width:83.3333333333%}.grid-stack>.grid-stack-item[data-gs-max-width='10']{max-width:83.3333333333%}.grid-stack>.grid-stack-item[data-gs-width='11']{width:91.6666666667%}.grid-stack>.grid-stack-item[data-gs-x='11']{left:91.6666666667%}.grid-stack>.grid-stack-item[data-gs-min-width='11']{min-width:91.6666666667%}.grid-stack>.grid-stack-item[data-gs-max-width='11']{max-width:91.6666666667%}.grid-stack>.grid-stack-item[data-gs-width='12']{width:100%}.grid-stack>.grid-stack-item[data-gs-x='12']{left:100%}.grid-stack>.grid-stack-item[data-gs-min-width='12']{min-width:100%}.grid-stack>.grid-stack-item[data-gs-max-width='12']{max-width:100%}.grid-stack.grid-stack-animate,.grid-stack.grid-stack-animate .grid-stack-item{-webkit-transition:left .3s,top .3s,height .3s,width .3s;-moz-transition:left .3s,top .3s,height .3s,width .3s;-ms-transition:l
 eft .3s,top .3s,height .3s,width .3s;-o-transition:left .3s,top .3s,height .3s,width .3s;transition:left .3s,top .3s,height .3s,width .3s}.grid-stack.grid-stack-animate .grid-stack-item.grid-stack-placeholder,.grid-stack.grid-stack-animate .grid-stack-item.ui-draggable-dragging,.grid-stack.grid-stack-animate .grid-stack-item.ui-resizable-resizing{-webkit-transition:left 0s,top 0s,height 0s,width 0s;-moz-transition:left 0s,top 0s,height 0s,width 0s;-ms-transition:left 0s,top 0s,height 0s,width 0s;-o-transition:left 0s,top 0s,height 0s,width 0s;transition:left 0s,top 0s,height 0s,width 0s}@media (max-width:768px){.grid-stack-item{position:relative!important;width:auto!important;left:0!important;top:auto!important;margin-bottom:20px}.grid-stack-item .ui-resizable-handle{display:none}.grid-stack{height:auto!important}}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/chukwa/blob/6f6e4399/src/main/web/hicc/home/css/jquery.gridster.min.css
----------------------------------------------------------------------
diff --git a/src/main/web/hicc/home/css/jquery.gridster.min.css b/src/main/web/hicc/home/css/jquery.gridster.min.css
deleted file mode 100755
index 9d9fe84..0000000
--- a/src/main/web/hicc/home/css/jquery.gridster.min.css
+++ /dev/null
@@ -1,2 +0,0 @@
-/*! gridster.js - v0.5.6 - 2014-09-25 - * http://gridster.net/ - Copyright (c) 2014 ducksboard; Licensed MIT */ 
-.gridster{position:relative}.gridster>*{margin:0 auto;-webkit-transition:height .4s,width .4s;-moz-transition:height .4s,width .4s;-o-transition:height .4s,width .4s;-ms-transition:height .4s,width .4s;transition:height .4s,width .4s}.gridster .gs-w{z-index:2;position:absolute}.ready .gs-w:not(.preview-holder){-webkit-transition:opacity .3s,left .3s,top .3s;-moz-transition:opacity .3s,left .3s,top .3s;-o-transition:opacity .3s,left .3s,top .3s;transition:opacity .3s,left .3s,top .3s}.ready .gs-w:not(.preview-holder),.ready .resize-preview-holder{-webkit-transition:opacity .3s,left .3s,top .3s,width .3s,height .3s;-moz-transition:opacity .3s,left .3s,top .3s,width .3s,height .3s;-o-transition:opacity .3s,left .3s,top .3s,width .3s,height .3s;transition:opacity .3s,left .3s,top .3s,width .3s,height .3s}.gridster .preview-holder{z-index:1;position:absolute;background-color:#fff;border-color:#fff;opacity:.3}.gridster .player-revert{z-index:10!important;-webkit-transition:left .3s,top .3
 s!important;-moz-transition:left .3s,top .3s!important;-o-transition:left .3s,top .3s!important;transition:left .3s,top .3s!important}.gridster .dragging,.gridster .resizing{z-index:10!important;-webkit-transition:all 0s!important;-moz-transition:all 0s!important;-o-transition:all 0s!important;transition:all 0s!important}.gs-resize-handle{position:absolute;z-index:1}.gs-resize-handle-both{width:20px;height:20px;bottom:-8px;right:-8px;background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pg08IS0tIEdlbmVyYXRvcjogQWRvYmUgRmlyZXdvcmtzIENTNiwgRXhwb3J0IFNWRyBFeHRlbnNpb24gYnkgQWFyb24gQmVhbGwgKGh0dHA6Ly9maXJld29ya3MuYWJlYWxsLmNvbSkgLiBWZXJzaW9uOiAwLjYuMSAgLS0+DTwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DTxzdmcgaWQ9IlVudGl0bGVkLVBhZ2UlMjAxIiB2aWV3Qm94PSIwIDAgNiA2IiBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHZlcnNpb249IjEuMSINCXhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8y
 MDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbDpzcGFjZT0icHJlc2VydmUiDQl4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjZweCIgaGVpZ2h0PSI2cHgiDT4NCTxnIG9wYWNpdHk9IjAuMzAyIj4NCQk8cGF0aCBkPSJNIDYgNiBMIDAgNiBMIDAgNC4yIEwgNCA0LjIgTCA0LjIgNC4yIEwgNC4yIDAgTCA2IDAgTCA2IDYgTCA2IDYgWiIgZmlsbD0iIzAwMDAwMCIvPg0JPC9nPg08L3N2Zz4=);background-position:top left;background-repeat:no-repeat;cursor:se-resize;z-index:20}.gs-resize-handle-x{top:0;bottom:13px;right:-5px;width:10px;cursor:e-resize}.gs-resize-handle-y{left:0;right:13px;bottom:-5px;height:10px;cursor:s-resize}.gs-w:hover .gs-resize-handle,.resizing .gs-resize-handle{opacity:1}.gs-resize-handle,.gs-w.dragging .gs-resize-handle{opacity:0}.gs-resize-disabled .gs-resize-handle{display:none!important}[data-max-sizex="1"] .gs-resize-handle-x,[data-max-sizey="1"] .gs-resize-handle-y,[data-max-sizey="1"][data-max-sizex="1"] .gs-resize-handle{display:none!important}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/chukwa/blob/6f6e4399/src/main/web/hicc/home/index.html
----------------------------------------------------------------------
diff --git a/src/main/web/hicc/home/index.html b/src/main/web/hicc/home/index.html
index 828c291..aefe260 100755
--- a/src/main/web/hicc/home/index.html
+++ b/src/main/web/hicc/home/index.html
@@ -27,11 +27,14 @@
     <title>Chukwa</title>
     <link rel="shortcut icon" href="../favicon.ico">
     <link rel="stylesheet" type="text/css" href="css/normalize.css" />
-    <link rel="stylesheet" type="text/css" href="css/jquery.gridster.css" />
+    <!-- link rel="stylesheet" type="text/css" href="css/jquery.gridster.css" / -->
+    <link rel="stylesheet" type="text/css" href="css/gridstack.min.css" />
     <link rel="stylesheet" type="text/css" href="css/component.css" />
     <script src="js/modernizr.custom.js"></script>
     <script src="js/jquery.js" type="text/javascript"></script>
-    <script src="js/jquery.gridster.js" type="text/javascript" charset="utf-8"></script>
+    <script src="js/jquery-ui.js"></script>
+    <script src="js/lodash.min.js" type="text/javascript"></script>
+    <script src="js/gridstack.min.js" type="text/javascript"></script>
     <script src="js/typeahead.bundle.js" type="text/javascript"></script>
   </head>
   <body>
@@ -75,9 +78,8 @@
         <li><a class="gn-icon-fullscreen" onclick="toggleFullScreen()"><span> </span></a></li>
       </ul>
     </div><!-- /container -->
-    <div class="gridster">
-      <ul/>
-    </div>
+
+    <div class="grid-stack"></div>
 
     <script src="js/classie.js"></script>
     <script src="js/gnmenu.js"></script>
@@ -142,48 +144,73 @@ function toggleGlass() {
   $('#glass').toggle();
 }
 
+function buildWidget(src) {
+  var html = '<div class="grid-stack-item-content">' +
+             '<div class="widget-header">' +
+             '<span class="gs-icon gs-close-handle" onClick="remove_widget(this);"></span>' +
+             '<span class="gs-icon gs-zoom-handle" onClick="zoom_widget(this);"></span>' +
+             '</div>' +
+             '<iframe src="'+src+'"></iframe>' +
+             '<div class="overlay_fix" style="display: none"></div></div>';
+  return html
+}
+
+function remove_widget(target) {
+  el = $(target).closest('.grid-stack-item')
+  var gridstack = $(".grid-stack").data('gridstack');
+  gridstack.removeWidget(el);
+  save();
+}
+
+function zoom_widget(button) {
+  var url = $(button).parent().parent().find('iframe').contents().get(0).location.href;
+  window.location.href = url;
+}
+
 // Load dashboard
 function load() {
   $.getJSON('/hicc/v1/dashboard/load/'+dashboard,
     function(data) {
       grid_data = data.grid;
-      grid_data = Gridster.sort_by_row_and_col_asc(grid_data);
-      var overlay_fix_start = function() {
-        $('.overlay_fix').show();
-      }
 
-      var overlay_fix_stop = function() {
-        $('.overlay_fix').hide();
-        save();
+      var options = {
+        cellHeight: 110,
+        verticalMargin: 10,
+        handle: '.widget-header'
       };
-      var gridster = $(".gridster ul").gridster({
-        widget_margins: [0, 0],
-        widget_base_dimensions: [140, 140],
-        autogrow_cols: true,
-	max_cols: 10,
-        limit: true,
-        draggable: {
-          handle: 'header',
-          start: overlay_fix_start,
-          stop: overlay_fix_stop
-        },
-        resize: {
-          enabled: true,
-          start: overlay_fix_start,
-          stop: overlay_fix_stop
-        },
-        header: {
-          enabled: true
-        }
-      });
+      $('.grid-stack').gridstack(options);
+      var gridstack = $(".grid-stack").data('gridstack');
+      gridstack.removeAll();
 
+      $('.grid-stack').on('dragstart', function(event, ui) {
+        var grid = this;
+        var element = event.target;
+        $('.overlay_fix').show();
+      });
+      $('.grid-stack').on('dragstop', function(event, ui) {
+        var grid = this;
+        var element = event.target;
+        $('.overlay_fix').hide();
+      });
+      $('.grid-stack').on('resizestart', function(event, ui) {
+        var grid = this;
+        var element = event.target;
+        $('.overlay_fix').show();
+      });
+      $('.grid-stack').on('resizestop', function(event, ui) {
+        var grid = this;
+        var element = event.target;
+        $('.overlay_fix').hide();
+      });
       $.each(grid_data, function() {
-        var gridster = $(".gridster ul").gridster().data('gridster');
-        gridster.add_widget(this.src,
-          this.size_x,
-          this.size_y,
-          this.col,
-          this.row);
+        var gridstack = $(".grid-stack").data('gridstack');
+        gridstack.addWidget(buildWidget(this.src), this.col, this.row, this.size_x, this.size_y);
+
+      });
+      // Bind save operation only after load operation has been
+      // completed to avoid race conditions.
+      $('.grid-stack').on('change', function(event, ui) {
+        save();
       });
     }
   );
@@ -214,9 +241,20 @@ function load() {
 
 // Save Dashboard
 function save() {
-  var gridster = $(".gridster ul").gridster().data('gridster');
-  var s = gridster.serialize();
-  var data = { "grid" : s };
+  var items = [];
+  $('.grid-stack-item.ui-draggable').each(function () {
+        var $this = $(this);
+        var iframe = $this.find('iframe')[0];
+        items.push({
+            col: parseInt($this.attr('data-gs-x')),
+            row: parseInt($this.attr('data-gs-y')),
+            size_x: parseInt($this.attr('data-gs-width')),
+            size_y: parseInt($this.attr('data-gs-height')),
+            src: iframe.src,
+        });
+    });
+
+  var data = { "grid" : items };
   $.ajax({
     url: '/hicc/v1/dashboard/save/'+dashboard,
     type: 'PUT',
@@ -234,21 +272,19 @@ function setDashboard(value) {
     contentType: 'application/json',
     data: JSON.stringify(data)
   });
-  var gridster = $(".gridster ul").gridster().data('gridster');
-  gridster.remove_all_widgets();
   load();
   showGrid();
 }
 
 function showGrid() {
   $(".frame").hide();
-  $(".gridster ul").show();
+  $(".grid-stack").show();
 }
 
 function showFrame(target) {
   $("#frame").attr("src", target);
   $(".frame").show();
-  $(".gridster ul").hide();
+  $(".grid-stack").hide();
   gnMenu._closeMenu();
 }
 
@@ -284,9 +320,8 @@ $(function(){ //DOM Ready
       var title = $('#url').val();
       if(title in widgetsToUrl) {
         var url = widgetsToUrl[title];
-        var gridster = $(".gridster ul").gridster().data('gridster');
-        gridster.add_widget(url, 1, 1, 1, 1);
-        setTimeout(function(){ save(); }, 3000);
+        var gridstack = $(".grid-stack").data('gridstack');
+        gridstack.addWidget(buildWidget(url), 0, 0, 1, 1);
       }
     }
   });
@@ -313,7 +348,6 @@ $(function(){ //DOM Ready
 function setTime() {
   var data = {};
   data['period'] = $('input[name=period]:checked').val();
-  console.log(data);
   $.ajax({
     url: '/hicc/v1/session/save',
     type: 'PUT',

http://git-wip-us.apache.org/repos/asf/chukwa/blob/6f6e4399/src/main/web/hicc/home/js/gridstack.min.js
----------------------------------------------------------------------
diff --git a/src/main/web/hicc/home/js/gridstack.min.js b/src/main/web/hicc/home/js/gridstack.min.js
new file mode 100644
index 0000000..a369610
--- /dev/null
+++ b/src/main/web/hicc/home/js/gridstack.min.js
@@ -0,0 +1,20 @@
+/**
+ * gridstack.js 0.2.5
+ * http://troolee.github.io/gridstack.js/
+ * (c) 2014-2016 Pavel Reznikov
+ * gridstack.js may be freely distributed under the MIT license.
+ * @preserve
+*/
+!function(a){if("function"==typeof define&&define.amd)define(["jquery","lodash","jquery-ui/core","jquery-ui/widget","jquery-ui/mouse","jquery-ui/draggable","jquery-ui/resizable"],a);else if("undefined"!=typeof exports){try{jQuery=require("jquery")}catch(b){}try{_=require("lodash")}catch(b){}a(jQuery,_)}else a(jQuery,_)}(function(a,b){var c=window,d=function(a,b,c){var d=function(){return console.warn("gridstack.js: Function `"+b+"` is deprecated as of v0.2.5 and has been replaced with `"+c+"`. It will be **completely** removed in v1.0."),a.apply(this,arguments)};return d.prototype=a.prototype,d},e=function(a,b){console.warn("gridstack.js: Option `"+a+"` is deprecated as of v0.2.5 and has been replaced with `"+b+"`. It will be **completely** removed in v1.0.")},f={isIntercepted:function(a,b){return!(a.x+a.width<=b.x||b.x+b.width<=a.x||a.y+a.height<=b.y||b.y+b.height<=a.y)},sort:function(a,c,d){return d=d||b.chain(a).map(function(a){return a.x+a.width}).max().value(),c=-1!=c?1:-1,b.so
 rtBy(a,function(a){return c*(a.x+a.y*d)})},createStylesheet:function(a){var b=document.createElement("style");return b.setAttribute("type","text/css"),b.setAttribute("data-gs-style-id",a),b.styleSheet?b.styleSheet.cssText="":b.appendChild(document.createTextNode("")),document.getElementsByTagName("head")[0].appendChild(b),b.sheet},removeStylesheet:function(b){a("STYLE[data-gs-style-id="+b+"]").remove()},insertCSSRule:function(a,b,c,d){"function"==typeof a.insertRule?a.insertRule(b+"{"+c+"}",d):"function"==typeof a.addRule&&a.addRule(b,c,d)},toBool:function(a){return"boolean"==typeof a?a:"string"==typeof a?(a=a.toLowerCase(),!(""===a||"no"==a||"false"==a||"0"==a)):Boolean(a)},_collisionNodeCheck:function(a){return a!=this.node&&f.isIntercepted(a,this.nn)},_didCollide:function(a){return f.isIntercepted({x:this.n.x,y:this.newY,width:this.n.width,height:this.n.height},a)},_isAddNodeIntercepted:function(a){return f.isIntercepted({x:this.x,y:this.y,width:this.node.width,height:this.node.h
 eight},a)},parseHeight:function(a){var c=a,d="px";if(c&&b.isString(c)){var e=c.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw)?$/);if(!e)throw new Error("Invalid height");d=e[2]||"px",c=parseFloat(e[1])}return{height:c,unit:d}}};
+// jscs:disable requireCamelCaseOrUpperCaseIdentifiers
+f.is_intercepted=d(f.isIntercepted,"is_intercepted","isIntercepted"),f.create_stylesheet=d(f.createStylesheet,"create_stylesheet","createStylesheet"),f.remove_stylesheet=d(f.removeStylesheet,"remove_stylesheet","removeStylesheet"),f.insert_css_rule=d(f.insertCSSRule,"insert_css_rule","insertCSSRule");
+// jscs:enable requireCamelCaseOrUpperCaseIdentifiers
+var g=0,h=function(a,b,c,d,e){this.width=a,this["float"]=c||!1,this.height=d||0,this.nodes=e||[],this.onchange=b||function(){},this._updateCounter=0,this._float=this["float"],this._addedNodes=[],this._removedNodes=[]};h.prototype.batchUpdate=function(){this._updateCounter=1,this["float"]=!0},h.prototype.commit=function(){0!==this._updateCounter&&(this._updateCounter=0,this["float"]=this._float,this._packNodes(),this._notify())},
+// For Meteor support: https://github.com/troolee/gridstack.js/pull/272
+h.prototype.getNodeDataByDOMEl=function(a){return b.find(this.nodes,function(b){return a.get(0)===b.el.get(0)})},h.prototype._fixCollisions=function(a){this._sortNodes(-1);var c=a,d=Boolean(b.find(this.nodes,function(a){return a.locked}));for(this["float"]||d||(c={x:0,y:a.y,width:this.width,height:a.height});;){var e=b.find(this.nodes,b.bind(f._collisionNodeCheck,{node:a,nn:c}));if("undefined"==typeof e)return;this.moveNode(e,e.x,a.y+a.height,e.width,e.height,!0)}},h.prototype.isAreaEmpty=function(a,c,d,e){var g={x:a||0,y:c||0,width:d||1,height:e||1},h=b.find(this.nodes,b.bind(function(a){return f.isIntercepted(a,g)},this));return null===h||"undefined"==typeof h},h.prototype._sortNodes=function(a){this.nodes=f.sort(this.nodes,a,this.width)},h.prototype._packNodes=function(){this._sortNodes(),this["float"]?b.each(this.nodes,b.bind(function(a,c){if(!a._updating&&"undefined"!=typeof a._origY&&a.y!=a._origY)for(var d=a.y;d>=a._origY;){var e=b.chain(this.nodes).find(b.bind(f._didCollide,
 {n:a,newY:d})).value();e||(a._dirty=!0,a.y=d),--d}},this)):b.each(this.nodes,b.bind(function(a,c){if(!a.locked)for(;a.y>0;){var d=a.y-1,e=0===c;if(c>0){var g=b.chain(this.nodes).take(c).find(b.bind(f._didCollide,{n:a,newY:d})).value();e="undefined"==typeof g}if(!e)break;a._dirty=a.y!=d,a.y=d}},this))},h.prototype._prepareNode=function(a,c){return a=b.defaults(a||{},{width:1,height:1,x:0,y:0}),a.x=parseInt(""+a.x),a.y=parseInt(""+a.y),a.width=parseInt(""+a.width),a.height=parseInt(""+a.height),a.autoPosition=a.autoPosition||!1,a.noResize=a.noResize||!1,a.noMove=a.noMove||!1,a.width>this.width?a.width=this.width:a.width<1&&(a.width=1),a.height<1&&(a.height=1),a.x<0&&(a.x=0),a.x+a.width>this.width&&(c?a.width=this.width-a.x:a.x=this.width-a.width),a.y<0&&(a.y=0),a},h.prototype._notify=function(){if(!this._updateCounter){var a=Array.prototype.slice.call(arguments,0);a=a.concat(this.getDirtyNodes()),this.onchange(a)}},h.prototype.cleanNodes=function(){this._updateCounter||b.each(this.nod
 es,function(a){a._dirty=!1})},h.prototype.getDirtyNodes=function(){return b.filter(this.nodes,function(a){return a._dirty})},h.prototype.addNode=function(a,c){if(a=this._prepareNode(a),"undefined"!=typeof a.maxWidth&&(a.width=Math.min(a.width,a.maxWidth)),"undefined"!=typeof a.maxHeight&&(a.height=Math.min(a.height,a.maxHeight)),"undefined"!=typeof a.minWidth&&(a.width=Math.max(a.width,a.minWidth)),"undefined"!=typeof a.minHeight&&(a.height=Math.max(a.height,a.minHeight)),a._id=++g,a._dirty=!0,a.autoPosition){this._sortNodes();for(var d=0;;++d){var e=d%this.width,h=Math.floor(d/this.width);if(!(e+a.width>this.width||b.find(this.nodes,b.bind(f._isAddNodeIntercepted,{x:e,y:h,node:a})))){a.x=e,a.y=h;break}}}return this.nodes.push(a),"undefined"!=typeof c&&c&&this._addedNodes.push(b.clone(a)),this._fixCollisions(a),this._packNodes(),this._notify(),a},h.prototype.removeNode=function(a,c){c="undefined"==typeof c?!0:c,this._removedNodes.push(b.clone(a)),a._id=null,this.nodes=b.without(this
 .nodes,a),this._packNodes(),c&&this._notify(a)},h.prototype.canMoveNode=function(c,d,e,f,g){var i=Boolean(b.find(this.nodes,function(a){return a.locked}));if(!this.height&&!i)return!0;var j,k=new h(this.width,null,this["float"],0,b.map(this.nodes,function(b){return b==c?j=a.extend({},b):a.extend({},b)}));if("undefined"==typeof j)return!0;k.moveNode(j,d,e,f,g);var l=!0;return i&&(l&=!Boolean(b.find(k.nodes,function(a){return a!=j&&Boolean(a.locked)&&Boolean(a._dirty)}))),this.height&&(l&=k.getGridHeight()<=this.height),l},h.prototype.canBePlacedWithRespectToHeight=function(c){if(!this.height)return!0;var d=new h(this.width,null,this["float"],0,b.map(this.nodes,function(b){return a.extend({},b)}));return d.addNode(c),d.getGridHeight()<=this.height},h.prototype.moveNode=function(a,b,c,d,e,f){if("number"!=typeof b&&(b=a.x),"number"!=typeof c&&(c=a.y),"number"!=typeof d&&(d=a.width),"number"!=typeof e&&(e=a.height),"undefined"!=typeof a.maxWidth&&(d=Math.min(d,a.maxWidth)),"undefined"!=t
 ypeof a.maxHeight&&(e=Math.min(e,a.maxHeight)),"undefined"!=typeof a.minWidth&&(d=Math.max(d,a.minWidth)),"undefined"!=typeof a.minHeight&&(e=Math.max(e,a.minHeight)),a.x==b&&a.y==c&&a.width==d&&a.height==e)return a;var g=a.width!=d;return a._dirty=!0,a.x=b,a.y=c,a.width=d,a.height=e,a=this._prepareNode(a,g),this._fixCollisions(a),f||(this._packNodes(),this._notify()),a},h.prototype.getGridHeight=function(){return b.reduce(this.nodes,function(a,b){return Math.max(a,b.y+b.height)},0)},h.prototype.beginUpdate=function(a){b.each(this.nodes,function(a){a._origY=a.y}),a._updating=!0},h.prototype.endUpdate=function(){b.each(this.nodes,function(a){a._origY=a.y});var a=b.find(this.nodes,function(a){return a._updating});a&&(a._updating=!1)};var i=function(c,d){var f,g,i=this;d=d||{},this.container=a(c),"undefined"!=typeof d.handle_class&&(d.handleClass=d.handle_class,e("handle_class","handleClass")),"undefined"!=typeof d.item_class&&(d.itemClass=d.item_class,e("item_class","itemClass")),"und
 efined"!=typeof d.placeholder_class&&(d.placeholderClass=d.placeholder_class,e("placeholder_class","placeholderClass")),"undefined"!=typeof d.placeholder_text&&(d.placeholderText=d.placeholder_text,e("placeholder_text","placeholderText")),"undefined"!=typeof d.cell_height&&(d.cellHeight=d.cell_height,e("cell_height","cellHeight")),"undefined"!=typeof d.vertical_margin&&(d.verticalMargin=d.vertical_margin,e("vertical_margin","verticalMargin")),"undefined"!=typeof d.min_width&&(d.minWidth=d.min_width,e("min_width","minWidth")),"undefined"!=typeof d.static_grid&&(d.staticGrid=d.static_grid,e("static_grid","staticGrid")),"undefined"!=typeof d.is_nested&&(d.isNested=d.is_nested,e("is_nested","isNested")),"undefined"!=typeof d.always_show_resize_handle&&(d.alwaysShowResizeHandle=d.always_show_resize_handle,e("always_show_resize_handle","alwaysShowResizeHandle")),d.itemClass=d.itemClass||"grid-stack-item";var j=this.container.closest("."+d.itemClass).size()>0;if(this.opts=b.defaults(d||{},
 {width:parseInt(this.container.attr("data-gs-width"))||12,height:parseInt(this.container.attr("data-gs-height"))||0,itemClass:"grid-stack-item",placeholderClass:"grid-stack-placeholder",placeholderText:"",handle:".grid-stack-item-content",handleClass:null,cellHeight:60,verticalMargin:20,auto:!0,minWidth:768,"float":!1,staticGrid:!1,_class:"grid-stack-instance-"+(1e4*Math.random()).toFixed(0),animate:Boolean(this.container.attr("data-gs-animate"))||!1,alwaysShowResizeHandle:d.alwaysShowResizeHandle||!1,resizable:b.defaults(d.resizable||{},{autoHide:!d.alwaysShowResizeHandle,handles:"se"}),draggable:b.defaults(d.draggable||{},{handle:(d.handleClass?"."+d.handleClass:d.handle?d.handle:"")||".grid-stack-item-content",scroll:!1,appendTo:"body"}),disableDrag:d.disableDrag||!1,disableResize:d.disableResize||!1,rtl:"auto",removable:!1,removeTimeout:2e3,verticalMarginUnit:"px",cellHeightUnit:"px"}),"auto"===this.opts.rtl&&(this.opts.rtl="rtl"===this.container.css("direction")),this.opts.rtl&
 &this.container.addClass("grid-stack-rtl"),this.opts.isNested=j,g="auto"===this.opts.cellHeight,g?i.cellHeight(i.cellWidth(),!0):this.cellHeight(this.opts.cellHeight,!0),this.verticalMargin(this.opts.verticalMargin,!0),this.container.addClass(this.opts._class),this._setStaticClass(),j&&this.container.addClass("grid-stack-nested"),this._initStyles(),this.grid=new h(this.opts.width,function(a){var c=0;b.each(a,function(a){null===a._id?a.el&&a.el.remove():(a.el.attr("data-gs-x",a.x).attr("data-gs-y",a.y).attr("data-gs-width",a.width).attr("data-gs-height",a.height),c=Math.max(c,a.y+a.height))}),i._updateStyles(c+10)},this.opts["float"],this.opts.height),this.opts.auto){var k=[],l=this;this.container.children("."+this.opts.itemClass+":not(."+this.opts.placeholderClass+")").each(function(b,c){c=a(c),k.push({el:c,i:parseInt(c.attr("data-gs-x"))+parseInt(c.attr("data-gs-y"))*l.opts.width})}),b.chain(k).sortBy(function(a){return a.i}).each(function(a){i._prepareElement(a.el)}).value()}if(th
 is.setAnimation(this.opts.animate),this.placeholder=a('<div class="'+this.opts.placeholderClass+" "+this.opts.itemClass+'"><div class="placeholder-content">'+this.opts.placeholderText+"</div></div>").hide(),this._updateContainerHeight(),this._updateHeightsOnResize=b.throttle(function(){i.cellHeight(i.cellWidth(),!1)},100),this.onResizeHandler=function(){if(g&&i._updateHeightsOnResize(),i._isOneColumnMode()){if(f)return;f=!0,i.grid._sortNodes(),b.each(i.grid.nodes,function(a){i.container.append(a.el),i.opts.staticGrid||((a.noMove||i.opts.disableDrag)&&a.el.draggable("disable"),(a.noResize||i.opts.disableResize)&&a.el.resizable("disable"),a.el.trigger("resize"))})}else{if(!f)return;if(f=!1,i.opts.staticGrid)return;b.each(i.grid.nodes,function(a){a.noMove||i.opts.disableDrag||a.el.draggable("enable"),a.noResize||i.opts.disableResize||a.el.resizable("enable"),a.el.trigger("resize")})}},a(window).resize(this.onResizeHandler),this.onResizeHandler(),!i.opts.staticGrid&&"string"==typeof i.o
 pts.removable){var m=a(i.opts.removable);m.data("droppable")||m.droppable({accept:"."+i.opts.itemClass}),m.on("dropover",function(b,c){var d=a(c.draggable),e=d.data("_gridstack_node");e._grid===i&&i._setupRemovingTimeout(d)}).on("dropout",function(b,c){var d=a(c.draggable),e=d.data("_gridstack_node");e._grid===i&&i._clearRemovingTimeout(d)})}if(!i.opts.staticGrid&&i.opts.acceptWidgets){var n=null,o=function(a,b){var c=n,d=c.data("_gridstack_node"),e=i.getCellFromPixel(b.offset,!0),f=Math.max(0,e.x),g=Math.max(0,e.y);if(d._added){if(!i.grid.canMoveNode(d,f,g))return;i.grid.moveNode(d,f,g),i._updateContainerHeight()}else d._added=!0,d.el=c,d.x=f,d.y=g,i.grid.cleanNodes(),i.grid.beginUpdate(d),i.grid.addNode(d),i.container.append(i.placeholder),i.placeholder.attr("data-gs-x",d.x).attr("data-gs-y",d.y).attr("data-gs-width",d.width).attr("data-gs-height",d.height).show(),d.el=i.placeholder,d._beforeDragX=d.x,d._beforeDragY=d.y,i._updateContainerHeight()};a(i.container).droppable({accept:
 function(b){b=a(b);var c=b.data("_gridstack_node");return c&&c._grid===i?!1:b.is(i.opts.acceptWidgets===!0?".grid-stack-item":i.opts.acceptWidgets)},over:function(b,c){var d=(i.container.offset(),a(c.draggable)),e=i.cellWidth(),f=i.cellHeight(),g=d.data("_gridstack_node"),h=g?g.width:Math.ceil(d.outerWidth()/e),j=g?g.height:Math.ceil(d.outerHeight()/f);n=d;var k=i.grid._prepareNode({width:h,height:j,_added:!1,_temporary:!0});d.data("_gridstack_node",k),d.data("_gridstack_node_orig",g),d.on("drag",o)},out:function(b,c){var d=a(c.draggable);d.unbind("drag",o);var e=d.data("_gridstack_node");e.el=null,i.grid.removeNode(e),i.placeholder.detach(),i._updateContainerHeight(),d.data("_gridstack_node",d.data("_gridstack_node_orig"))},drop:function(b,c){i.placeholder.detach();var d=a(c.draggable).data("_gridstack_node");d._grid=i;var e=a(c.draggable).clone(!1);e.data("_gridstack_node",d),a(c.draggable).remove(),d.el=e,i.placeholder.hide(),e.attr("data-gs-x",d.x).attr("data-gs-y",d.y).attr("da
 ta-gs-width",d.width).attr("data-gs-height",d.height).addClass(i.opts.itemClass).removeAttr("style").enableSelection().removeData("draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled").unbind("drag",o),i.container.append(e),i._prepareElementsByNode(e,d),i._updateContainerHeight(),i._triggerChangeEvent(),i.grid.endUpdate()}})}};
+// jscs:disable requireCamelCaseOrUpperCaseIdentifiers
+// jscs:enable requireCamelCaseOrUpperCaseIdentifiers
+return i.prototype._triggerChangeEvent=function(a){var b=this.grid.getDirtyNodes(),c=!1,d=[];b&&b.length&&(d.push(b),c=!0),(c||a===!0)&&this.container.trigger("change",d)},i.prototype._triggerAddEvent=function(){this.grid._addedNodes&&this.grid._addedNodes.length>0&&(this.container.trigger("added",[b.map(this.grid._addedNodes,b.clone)]),this.grid._addedNodes=[])},i.prototype._triggerRemoveEvent=function(){this.grid._removedNodes&&this.grid._removedNodes.length>0&&(this.container.trigger("removed",[b.map(this.grid._removedNodes,b.clone)]),this.grid._removedNodes=[])},i.prototype._initStyles=function(){this._stylesId&&f.removeStylesheet(this._stylesId),this._stylesId="gridstack-style-"+(1e5*Math.random()).toFixed(),this._styles=f.createStylesheet(this._stylesId),null!==this._styles&&(this._styles._max=0)},i.prototype._updateStyles=function(a){if(null!==this._styles&&"undefined"!=typeof this._styles){var b,c="."+this.opts._class+" ."+this.opts.itemClass,d=this;if("undefined"==typeof a&
 &(a=this._styles._max,this._initStyles(),this._updateContainerHeight()),this.opts.cellHeight&&!(0!==this._styles._max&&a<=this._styles._max)&&(b=this.opts.verticalMargin&&this.opts.cellHeightUnit!==this.opts.verticalMarginUnit?function(a,b){return a&&b?"calc("+(d.opts.cellHeight*a+d.opts.cellHeightUnit)+" + "+(d.opts.verticalMargin*b+d.opts.verticalMarginUnit)+")":d.opts.cellHeight*a+d.opts.verticalMargin*b+d.opts.cellHeightUnit}:function(a,b){return d.opts.cellHeight*a+d.opts.verticalMargin*b+d.opts.cellHeightUnit},0===this._styles._max&&f.insertCSSRule(this._styles,c,"min-height: "+b(1,0)+";",0),a>this._styles._max)){for(var e=this._styles._max;a>e;++e)f.insertCSSRule(this._styles,c+'[data-gs-height="'+(e+1)+'"]',"height: "+b(e+1,e)+";",e),f.insertCSSRule(this._styles,c+'[data-gs-min-height="'+(e+1)+'"]',"min-height: "+b(e+1,e)+";",e),f.insertCSSRule(this._styles,c+'[data-gs-max-height="'+(e+1)+'"]',"max-height: "+b(e+1,e)+";",e),f.insertCSSRule(this._styles,c+'[data-gs-y="'+e+'"]
 ',"top: "+b(e,e)+";",e);this._styles._max=a}}},i.prototype._updateContainerHeight=function(){if(!this.grid._updateCounter){var a=this.grid.getGridHeight();this.container.attr("data-gs-current-height",a),this.opts.cellHeight&&(this.opts.verticalMargin?this.opts.cellHeightUnit===this.opts.verticalMarginUnit?this.container.css("height",a*(this.opts.cellHeight+this.opts.verticalMargin)-this.opts.verticalMargin+this.opts.cellHeightUnit):this.container.css("height","calc("+(a*this.opts.cellHeight+this.opts.cellHeightUnit)+" + "+(a*(this.opts.verticalMargin-1)+this.opts.verticalMarginUnit)+")"):this.container.css("height",a*this.opts.cellHeight+this.opts.cellHeightUnit))}},i.prototype._isOneColumnMode=function(){return(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<=this.opts.minWidth},i.prototype._setupRemovingTimeout=function(b){var c=this,d=a(b).data("_gridstack_node");!d._removeTimeout&&c.opts.removable&&(d._removeTimeout=setTimeout(function(){b.add
 Class("grid-stack-item-removing"),d._isAboutToRemove=!0},c.opts.removeTimeout))},i.prototype._clearRemovingTimeout=function(b){var c=a(b).data("_gridstack_node");c._removeTimeout&&(clearTimeout(c._removeTimeout),c._removeTimeout=null,b.removeClass("grid-stack-item-removing"),c._isAboutToRemove=!1)},i.prototype._prepareElementsByNode=function(c,d){var e,f,g=this,h=function(a,b){var h,i,j=Math.round(b.position.left/e),k=Math.floor((b.position.top+f/2)/f);if("drag"!=a.type&&(h=Math.round(b.size.width/e),i=Math.round(b.size.height/f)),"drag"==a.type)0>j||j>=g.grid.width||0>k?(g.opts.removable===!0&&g._setupRemovingTimeout(c),j=d._beforeDragX,k=d._beforeDragY,g.placeholder.detach(),g.placeholder.hide(),g.grid.removeNode(d),g._updateContainerHeight(),d._temporaryRemoved=!0):(g._clearRemovingTimeout(c),d._temporaryRemoved&&(g.grid.addNode(d),g.placeholder.attr("data-gs-x",j).attr("data-gs-y",k).attr("data-gs-width",h).attr("data-gs-height",i).show(),g.container.append(g.placeholder),d.el=g
 .placeholder,d._temporaryRemoved=!1));else if("resize"==a.type&&0>j)return;g.grid.canMoveNode(d,j,k,h,i)&&(g.grid.moveNode(d,j,k,h,i),g._updateContainerHeight())},i=function(b,h){g.container.append(g.placeholder);var i=a(this);g.grid.cleanNodes(),g.grid.beginUpdate(d),e=Math.ceil(i.outerWidth()/i.attr("data-gs-width"));var j=Math.ceil(i.outerHeight()/i.attr("data-gs-height"));f=g.container.height()/parseInt(g.container.attr("data-gs-current-height")),g.placeholder.attr("data-gs-x",i.attr("data-gs-x")).attr("data-gs-y",i.attr("data-gs-y")).attr("data-gs-width",i.attr("data-gs-width")).attr("data-gs-height",i.attr("data-gs-height")).show(),d.el=g.placeholder,d._beforeDragX=d.x,d._beforeDragY=d.y,c.resizable("option","minWidth",e*(d.minWidth||1)),c.resizable("option","minHeight",j*(d.minHeight||1)),"resizestart"==b.type&&i.find(".grid-stack-item").trigger("resizestart")},j=function(b,e){var f=a(this);if(f.data("_gridstack_node")){var h=!1;g.placeholder.detach(),d.el=f,g.placeholder.hid
 e(),d._isAboutToRemove?(h=!0,c.removeData("_gridstack_node"),c.remove()):(g._clearRemovingTimeout(c),d._temporaryRemoved?(f.attr("data-gs-x",d._beforeDragX).attr("data-gs-y",d._beforeDragY).attr("data-gs-width",d.width).attr("data-gs-height",d.height).removeAttr("style"),d.x=d._beforeDragX,d.y=d._beforeDragY,g.grid.addNode(d)):f.attr("data-gs-x",d.x).attr("data-gs-y",d.y).attr("data-gs-width",d.width).attr("data-gs-height",d.height).removeAttr("style")),g._updateContainerHeight(),g._triggerChangeEvent(h),g.grid.endUpdate();var i=f.find(".grid-stack");i.length&&"resizestop"==b.type&&(i.each(function(b,c){a(c).data("gridstack").onResizeHandler()}),f.find(".grid-stack-item").trigger("resizestop"))}};c.draggable(b.extend(this.opts.draggable,{containment:this.opts.isNested?this.container.parent():null,start:i,stop:j,drag:h})).resizable(b.extend(this.opts.resizable,{start:i,stop:j,resize:h})),(d.noMove||this._isOneColumnMode()||this.opts.disableDrag)&&c.draggable("disable"),(d.noResize||t
 his._isOneColumnMode()||this.opts.disableResize)&&c.resizable("disable"),c.attr("data-gs-locked",d.locked?"yes":null)},i.prototype._prepareElement=function(b,c){c="undefined"!=typeof c?c:!1;var d=this;b=a(b),b.addClass(this.opts.itemClass);var e=d.grid.addNode({x:b.attr("data-gs-x"),y:b.attr("data-gs-y"),width:b.attr("data-gs-width"),height:b.attr("data-gs-height"),maxWidth:b.attr("data-gs-max-width"),minWidth:b.attr("data-gs-min-width"),maxHeight:b.attr("data-gs-max-height"),minHeight:b.attr("data-gs-min-height"),autoPosition:f.toBool(b.attr("data-gs-auto-position")),noResize:f.toBool(b.attr("data-gs-no-resize")),noMove:f.toBool(b.attr("data-gs-no-move")),locked:f.toBool(b.attr("data-gs-locked")),el:b,id:b.attr("data-gs-id"),_grid:d},c);b.data("_gridstack_node",e),this.opts.staticGrid||this._prepareElementsByNode(b,e)},i.prototype.setAnimation=function(a){a?this.container.addClass("grid-stack-animate"):this.container.removeClass("grid-stack-animate")},i.prototype.addWidget=function
 (b,c,d,e,f,g,h,i,j,k,l){return b=a(b),"undefined"!=typeof c&&b.attr("data-gs-x",c),"undefined"!=typeof d&&b.attr("data-gs-y",d),"undefined"!=typeof e&&b.attr("data-gs-width",e),"undefined"!=typeof f&&b.attr("data-gs-height",f),"undefined"!=typeof g&&b.attr("data-gs-auto-position",g?"yes":null),"undefined"!=typeof h&&b.attr("data-gs-min-width",h),"undefined"!=typeof i&&b.attr("data-gs-max-width",i),"undefined"!=typeof j&&b.attr("data-gs-min-height",j),"undefined"!=typeof k&&b.attr("data-gs-max-height",k),"undefined"!=typeof l&&b.attr("data-gs-id",l),this.container.append(b),this._prepareElement(b,!0),this._triggerAddEvent(),this._updateContainerHeight(),this._triggerChangeEvent(!0),b},i.prototype.makeWidget=function(b){return b=a(b),this._prepareElement(b,!0),this._triggerAddEvent(),this._updateContainerHeight(),this._triggerChangeEvent(!0),b},i.prototype.willItFit=function(a,b,c,d,e){var f={x:a,y:b,width:c,height:d,autoPosition:e};return this.grid.canBePlacedWithRespectToHeight(f)},
 i.prototype.removeWidget=function(b,c){c="undefined"==typeof c?!0:c,b=a(b);var d=b.data("_gridstack_node");
+// For Meteor support: https://github.com/troolee/gridstack.js/pull/272
+d||(d=this.grid.getNodeDataByDOMEl(b)),this.grid.removeNode(d,c),b.removeData("_gridstack_node"),this._updateContainerHeight(),c&&b.remove(),this._triggerChangeEvent(!0),this._triggerRemoveEvent()},i.prototype.removeAll=function(a){b.each(this.grid.nodes,b.bind(function(b){this.removeWidget(b.el,a)},this)),this.grid.nodes=[],this._updateContainerHeight()},i.prototype.destroy=function(b){a(window).off("resize",this.onResizeHandler),this.disable(),"undefined"==typeof b||b?this.container.remove():this.removeAll(!1),f.removeStylesheet(this._stylesId),this.grid&&(this.grid=null)},i.prototype.resizable=function(b,c){var d=this;return b=a(b),b.each(function(b,e){e=a(e);var f=e.data("_gridstack_node");d.opts.staticGrid||"undefined"==typeof f||null===f||(f.noResize=!c,f.noResize||d._isOneColumnMode()?e.resizable("disable"):e.resizable("enable"))}),this},i.prototype.movable=function(b,c){var d=this;return b=a(b),b.each(function(b,e){e=a(e);var f=e.data("_gridstack_node");d.opts.staticGrid||"u
 ndefined"==typeof f||null===f||(f.noMove=!c,f.noMove||d._isOneColumnMode()?(e.draggable("disable"),e.removeClass("ui-draggable-handle")):(e.draggable("enable"),e.addClass("ui-draggable-handle")))}),this},i.prototype.enableMove=function(a,b){this.movable(this.container.children("."+this.opts.itemClass),a),b&&(this.opts.disableDrag=!a)},i.prototype.enableResize=function(a,b){this.resizable(this.container.children("."+this.opts.itemClass),a),b&&(this.opts.disableResize=!a)},i.prototype.disable=function(){this.movable(this.container.children("."+this.opts.itemClass),!1),this.resizable(this.container.children("."+this.opts.itemClass),!1),this.container.trigger("disable")},i.prototype.enable=function(){this.movable(this.container.children("."+this.opts.itemClass),!0),this.resizable(this.container.children("."+this.opts.itemClass),!0),this.container.trigger("enable")},i.prototype.locked=function(b,c){return b=a(b),b.each(function(b,d){d=a(d);var e=d.data("_gridstack_node");"undefined"!=typ
 eof e&&null!==e&&(e.locked=c||!1,d.attr("data-gs-locked",e.locked?"yes":null))}),this},i.prototype.maxHeight=function(b,c){return b=a(b),b.each(function(b,d){d=a(d);var e=d.data("_gridstack_node");"undefined"!=typeof e&&null!==e&&(isNaN(c)||(e.maxHeight=c||!1,d.attr("data-gs-max-height",c)))}),this},i.prototype.minHeight=function(b,c){return b=a(b),b.each(function(b,d){d=a(d);var e=d.data("_gridstack_node");"undefined"!=typeof e&&null!==e&&(isNaN(c)||(e.minHeight=c||!1,d.attr("data-gs-min-height",c)))}),this},i.prototype.maxWidth=function(b,c){return b=a(b),b.each(function(b,d){d=a(d);var e=d.data("_gridstack_node");"undefined"!=typeof e&&null!==e&&(isNaN(c)||(e.maxWidth=c||!1,d.attr("data-gs-max-width",c)))}),this},i.prototype.minWidth=function(b,c){return b=a(b),b.each(function(b,d){d=a(d);var e=d.data("_gridstack_node");"undefined"!=typeof e&&null!==e&&(isNaN(c)||(e.minWidth=c||!1,d.attr("data-gs-min-width",c)))}),this},i.prototype._updateElement=function(b,c){b=a(b).first();var 
 d=b.data("_gridstack_node");if("undefined"!=typeof d&&null!==d){var e=this;e.grid.cleanNodes(),e.grid.beginUpdate(d),c.call(this,b,d),e._updateContainerHeight(),e._triggerChangeEvent(),e.grid.endUpdate()}},i.prototype.resize=function(a,b,c){this._updateElement(a,function(a,d){b=null!==b&&"undefined"!=typeof b?b:d.width,c=null!==c&&"undefined"!=typeof c?c:d.height,this.grid.moveNode(d,d.x,d.y,b,c)})},i.prototype.move=function(a,b,c){this._updateElement(a,function(a,d){b=null!==b&&"undefined"!=typeof b?b:d.x,c=null!==c&&"undefined"!=typeof c?c:d.y,this.grid.moveNode(d,b,c,d.width,d.height)})},i.prototype.update=function(a,b,c,d,e){this._updateElement(a,function(a,f){b=null!==b&&"undefined"!=typeof b?b:f.x,c=null!==c&&"undefined"!=typeof c?c:f.y,d=null!==d&&"undefined"!=typeof d?d:f.width,e=null!==e&&"undefined"!=typeof e?e:f.height,this.grid.moveNode(f,b,c,d,e)})},i.prototype.verticalMargin=function(a,b){if("undefined"==typeof a)return this.opts.verticalMargin;var c=f.parseHeight(a);t
 his.opts.verticalMarginUnit===c.unit&&this.opts.height===c.height||(this.opts.verticalMarginUnit=c.unit,this.opts.verticalMargin=c.height,b||this._updateStyles())},i.prototype.cellHeight=function(a,b){if("undefined"==typeof a){if(this.opts.cellHeight)return this.opts.cellHeight;var c=this.container.children("."+this.opts.itemClass).first();return Math.ceil(c.outerHeight()/c.attr("data-gs-height"))}var d=f.parseHeight(a);this.opts.cellHeightUnit===d.heightUnit&&this.opts.height===d.height||(this.opts.cellHeightUnit=d.unit,this.opts.cellHeight=d.height,b||this._updateStyles())},i.prototype.cellWidth=function(){var a=this.container.children("."+this.opts.itemClass).first();return Math.ceil(a.outerWidth()/parseInt(a.attr("data-gs-width"),10))},i.prototype.getCellFromPixel=function(a,b){var c="undefined"!=typeof b&&b?this.container.offset():this.container.position(),d=a.left-c.left,e=a.top-c.top,f=Math.floor(this.container.width()/this.opts.width),g=Math.floor(this.container.height()/par
 seInt(this.container.attr("data-gs-current-height")));return{x:Math.floor(d/f),y:Math.floor(e/g)}},i.prototype.batchUpdate=function(){this.grid.batchUpdate()},i.prototype.commit=function(){this.grid.commit(),this._updateContainerHeight()},i.prototype.isAreaEmpty=function(a,b,c,d){return this.grid.isAreaEmpty(a,b,c,d)},i.prototype.setStatic=function(a){this.opts.staticGrid=a===!0,this.enableMove(!a),this.enableResize(!a),this._setStaticClass()},i.prototype._setStaticClass=function(){var a="grid-stack-static";this.opts.staticGrid===!0?this.container.addClass(a):this.container.removeClass(a)},i.prototype._updateNodeWidths=function(a,b){this.grid._sortNodes(),this.grid.batchUpdate();for(var c={},d=0;d<this.grid.nodes.length;d++)c=this.grid.nodes[d],this.update(c.el,Math.round(c.x*b/a),void 0,Math.round(c.width*b/a),void 0);this.grid.commit()},i.prototype.setGridWidth=function(a,b){this.container.removeClass("grid-stack-"+this.opts.width),b!==!0&&this._updateNodeWidths(this.opts.width,a)
 ,this.opts.width=a,this.grid.width=a,this.container.addClass("grid-stack-"+a)},h.prototype.batch_update=d(h.prototype.batchUpdate),h.prototype._fix_collisions=d(h.prototype._fixCollisions,"_fix_collisions","_fixCollisions"),h.prototype.is_area_empty=d(h.prototype.isAreaEmpty,"is_area_empty","isAreaEmpty"),h.prototype._sort_nodes=d(h.prototype._sortNodes,"_sort_nodes","_sortNodes"),h.prototype._pack_nodes=d(h.prototype._packNodes,"_pack_nodes","_packNodes"),h.prototype._prepare_node=d(h.prototype._prepareNode,"_prepare_node","_prepareNode"),h.prototype.clean_nodes=d(h.prototype.cleanNodes,"clean_nodes","cleanNodes"),h.prototype.get_dirty_nodes=d(h.prototype.getDirtyNodes,"get_dirty_nodes","getDirtyNodes"),h.prototype.add_node=d(h.prototype.addNode,"add_node","addNode, "),h.prototype.remove_node=d(h.prototype.removeNode,"remove_node","removeNode"),h.prototype.can_move_node=d(h.prototype.canMoveNode,"can_move_node","canMoveNode"),h.prototype.move_node=d(h.prototype.moveNode,"move_node"
 ,"moveNode"),h.prototype.get_grid_height=d(h.prototype.getGridHeight,"get_grid_height","getGridHeight"),h.prototype.begin_update=d(h.prototype.beginUpdate,"begin_update","beginUpdate"),h.prototype.end_update=d(h.prototype.endUpdate,"end_update","endUpdate"),h.prototype.can_be_placed_with_respect_to_height=d(h.prototype.canBePlacedWithRespectToHeight,"can_be_placed_with_respect_to_height","canBePlacedWithRespectToHeight"),i.prototype._trigger_change_event=d(i.prototype._triggerChangeEvent,"_trigger_change_event","_triggerChangeEvent"),i.prototype._init_styles=d(i.prototype._initStyles,"_init_styles","_initStyles"),i.prototype._update_styles=d(i.prototype._updateStyles,"_update_styles","_updateStyles"),i.prototype._update_container_height=d(i.prototype._updateContainerHeight,"_update_container_height","_updateContainerHeight"),i.prototype._is_one_column_mode=d(i.prototype._isOneColumnMode,"_is_one_column_mode","_isOneColumnMode"),i.prototype._prepare_element=d(i.prototype._prepareElem
 ent,"_prepare_element","_prepareElement"),i.prototype.set_animation=d(i.prototype.setAnimation,"set_animation","setAnimation"),i.prototype.add_widget=d(i.prototype.addWidget,"add_widget","addWidget"),i.prototype.make_widget=d(i.prototype.makeWidget,"make_widget","makeWidget"),i.prototype.will_it_fit=d(i.prototype.willItFit,"will_it_fit","willItFit"),i.prototype.remove_widget=d(i.prototype.removeWidget,"remove_widget","removeWidget"),i.prototype.remove_all=d(i.prototype.removeAll,"remove_all","removeAll"),i.prototype.min_height=d(i.prototype.minHeight,"min_height","minHeight"),i.prototype.min_width=d(i.prototype.minWidth,"min_width","minWidth"),i.prototype._update_element=d(i.prototype._updateElement,"_update_element","_updateElement"),i.prototype.cell_height=d(i.prototype.cellHeight,"cell_height","cellHeight"),i.prototype.cell_width=d(i.prototype.cellWidth,"cell_width","cellWidth"),i.prototype.get_cell_from_pixel=d(i.prototype.getCellFromPixel,"get_cell_from_pixel","getCellFromPixel
 "),i.prototype.batch_update=d(i.prototype.batchUpdate,"batch_update","batchUpdate"),i.prototype.is_area_empty=d(i.prototype.isAreaEmpty,"is_area_empty","isAreaEmpty"),i.prototype.set_static=d(i.prototype.setStatic,"set_static","setStatic"),i.prototype._set_static_class=d(i.prototype._setStaticClass,"_set_static_class","_setStaticClass"),c.GridStackUI=i,c.GridStackUI.Utils=f,c.GridStackUI.Engine=h,a.fn.gridstack=function(b){return this.each(function(){var c=a(this);c.data("gridstack")||c.data("gridstack",new i(this,b))})},c.GridStackUI});
+//# sourceMappingURL=gridstack.min.map
\ No newline at end of file


Mime
View raw message