Thanks to visit codestin.com
Credit goes to github.com

Skip to content

demo app cleanup #1049

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions demo/anijs.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
<title>AniJS demo</title>

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" />
<link rel="stylesheet" href="../dist/gridstack.css"/>
<link rel="stylesheet" href="https://anijs.github.io/lib/anicollection/anicollection.css" />
<link rel="stylesheet" href="../dist/gridstack.css"/>


<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/core-js/2.6.9/shim.min.js"></script>
<script src="../dist/gridstack.js"></script>
<script src="../dist/gridstack.jQueryUI.js"></script>
<script src="../src/gridstack.js"></script>
<script src="../src/gridstack.jQueryUI.js"></script>

<style type="text/css">
.grid-stack {
Expand All @@ -37,7 +37,9 @@
<body>
<div class="container-fluid">
<h1>AniJS demo</h1>
<button id="add-widget" href="#">Add Widget</button>
<div>
<a class="btn btn-primary" id="add-widget" href="#">Add Widget</a>
</div>
<h4>Widget added</h4>
<br>
<div class="grid-stack"></div>
Expand Down
8 changes: 5 additions & 3 deletions demo/float.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/core-js/2.6.9/shim.min.js"></script>
<script src="../dist/gridstack.js"></script>
<script src="../dist/gridstack.jQueryUI.js"></script>
<script src="../src/gridstack.js"></script>
<script src="../src/gridstack.jQueryUI.js"></script>

<style type="text/css">
.grid-stack {
Expand All @@ -35,7 +35,9 @@
<body>
<div class="container-fluid">
<h1>Float grid demo</h1>
<button id="add-widget" href="#">Add Widget</button>
<div>
<a class="btn btn-primary" id="add-widget" href="#">Add Widget</a>
</div>
<br><br>
<div class="grid-stack"></div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<li><a href="knockout.html">Knockout.js demo</a></li>
<li><a href="knockout2.html">Knockout.js demo (2)</a></li>
<li><a href="nested.html">Nested grids demo</a></li>
<li><a href="rtl.html">RTL demo</a></li>
<li><a href="right-to-left(rtl).html">Right-To-Left (RTL) demo</a></li>
<li><a href="serialization.html">Serialization demo</a></li>
<li><a href="two.html">Two grids demo</a></li>
<li><a href="responsive.html">Resize grid (responsive) demo</a></li>
Expand Down
4 changes: 2 additions & 2 deletions demo/knockout.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/core-js/2.6.9/shim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.5.0/knockout-min.js"></script>
<script src="../dist/gridstack.js"></script>
<script src="../dist/gridstack.jQueryUI.js"></script>
<script src="../src/gridstack.js"></script>
<script src="../src/gridstack.jQueryUI.js"></script>

<style type="text/css">
.grid-stack {
Expand Down
4 changes: 2 additions & 2 deletions demo/knockout2.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/core-js/2.6.9/shim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.5.0/knockout-min.js"></script>
<script src="../dist/gridstack.js"></script>
<script src="../dist/gridstack.jQueryUI.js"></script>
<script src="../src/gridstack.js"></script>
<script src="../src/gridstack.jQueryUI.js"></script>

<style type="text/css">
.grid-stack {
Expand Down
4 changes: 2 additions & 2 deletions demo/nested.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/core-js/2.6.9/shim.min.js"></script>
<script src="../dist/gridstack.js"></script>
<script src="../dist/gridstack.jQueryUI.js"></script>
<script src="../src/gridstack.js"></script>
<script src="../src/gridstack.jQueryUI.js"></script>

<style type="text/css">
.grid-stack {
Expand Down
4 changes: 2 additions & 2 deletions demo/responsive.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/core-js/2.6.9/shim.min.js"></script>
<script src="../dist/gridstack.js"></script>
<script src="../dist/gridstack.jQueryUI.js"></script>
<script src="../src/gridstack.js"></script>
<script src="../src/gridstack.jQueryUI.js"></script>

<style type="text/css">
.grid-stack {
Expand Down
122 changes: 122 additions & 0 deletions demo/right-to-left(rtl).html
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
<!DOCTYPE html>
<html lang="en" dir="rtl"> <!-- set text reading direction -->
<head>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Right-To-Left (RTL) demo</title>

<!-- TODO Note: bootstrap 4.3.1 seem to prevent our h1 tag and button from right aligning, so use older for now... -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="../dist/gridstack.css"/>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/core-js/2.6.9/shim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.5.0/knockout-min.js"></script>
<script src="../src/gridstack.js"></script>
<script src="../src/gridstack.jQueryUI.js"></script>

<style type="text/css">
.grid-stack {
background: lightgoldenrodyellow;
}

.grid-stack-item-content {
color: #2c3e50;
background-color: #18bc9c;
}
</style>
</head>
<body>
<div class="container-fluid">
<h1>RTL Demo</h1>

<div>
<button data-bind="click: addNewWidget">Add new widget</button>
</div>

<br>

<div data-bind="component: {name: 'dashboard-grid', params: $data}"></div>
</div>

<script type="text/javascript">
ko.components.register('dashboard-grid', {
viewModel: {
createViewModel: function (controller, componentInfo) {
var ViewModel = function (controller, componentInfo) {
var grid = null;

this.widgets = controller.widgets;

this.afterAddWidget = function (items) {
if (grid == null) {
grid = $(componentInfo.element).find('.grid-stack').gridstack({
auto: false
}).data('gridstack');
}

var item = items.find(function (i) { return i.nodeType == 1 });
grid.addWidget(item);
ko.utils.domNodeDisposal.addDisposeCallback(item, function () {
grid.removeWidget(item);
});
};
};

return new ViewModel(controller, componentInfo);
}
},
template:
[
'<div class="grid-stack" data-bind="foreach: {data: widgets, afterRender: afterAddWidget}">',
' <div class="grid-stack-item" data-bind="attr: {\'data-gs-x\': $data.x, \'data-gs-y\': $data.y, \'data-gs-width\': $data.width, \'data-gs-height\': $data.height, \'data-gs-auto-position\': $data.auto_position}">',
' <div class="grid-stack-item-content"><center><button data-bind="click: $root.deleteWidget">Delete me</button><br><h5 data-bind="text: index" /></center><br><p>lorem ipsum</p></div>',
' </div>',
'</div> '
].join('')
});

$(function () {
var Controller = function (widgets) {
var self = this;

this.widgets = ko.observableArray(widgets);

this.addNewWidget = function () {
this.widgets.push({
x: 0,
y: 0,
width: Math.floor(1 + 3 * Math.random()),
height: Math.floor(1 + 3 * Math.random()),
auto_position: true,
index: 'auto'
});
return false;
};

this.deleteWidget = function (item) {
self.widgets.remove(item);
return false;
};
};

var widgets = [
{x: 0, y: 0, width: 2, height: 2, index: 1},
{x: 2, y: 0, width: 4, height: 2, index: 2},
{x: 6, y: 0, width: 2, height: 4, index: 3},
{x: 1, y: 2, width: 4, height: 2, index: 4}
];

var controller = new Controller(widgets);
ko.applyBindings(controller);
});
</script>
</body>
</html>
122 changes: 0 additions & 122 deletions demo/rtl.html

This file was deleted.

Loading