-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathdemo.html
70 lines (62 loc) · 3.76 KB
/
demo.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/start/jquery-ui.css" />
<style>
#splash {
text-align: center;
}
</style>
<script src="http://knockoutjs.com/downloads/knockout-2.2.1.debug.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"></script>
<script src="https://raw.github.com/asual/jquery-address/master/samples/api/jquery.address-1.5.min.js" type="text/javascript"></script>
<script src="src/knockout.bindings.js" type="text/javascript"></script>
<script src="demo.js" type="text/javascript"></script>
</head>
<body>
<!-- ko message: message --><!-- /ko -->
<button data-bind="click: showSplash">Show Splash message</button>
<button data-bind="click: showAlert">Show alert message</button>
<button data-bind="click: showConfirm">Show confirm message</button>
<div>
<button data-bind="button: {}">This is a jQuery button</button>
<button data-bind="button: { icon: 'ui-icon-arrowreturnthick-1-w' }">This is a jQuery button with icon</button>
<p>jQuery buttons have a bug so if the button is disabled from the click handler the layout is broken (It looks clicked)</p>
<button data-bind="click: disableButton, enable: buttonEnabled, button: {}">This button can handle being disabled from click handler</button>
<button data-bind="click: increaseButton, button: { label: buttonLabel }"></button>
</div>
<div>
<input data-bind="datepicker: date, datepickerOptions: { minDate: new Date() }" />
</div>
<button data-bind="click: showDialog">Show dialog</button>
<div id="dialog" data-bind="dialog: { autoOpen: false, modal: true, title: dialogTitle }, template: { name: 'dialog-template', data: dialogItem, 'if': dialogItem }, openDialog: dialogItem"></div>
<script id="dialog-template" type="text/html">
<span data-bind="text: message"></span>
</script>
<div>
<input data-bind="label: { caption: 'Label with reference to input' }" type="checkbox" />
</div>
<div>
<p>The built in value binding for options cant handle when the selected item and the corresponding item does not have the same object reference (A common scenario with JSON objects)</P>
<select data-bind="options: optionItems,
optionsText: 'text',
selected: selectedOption,
optionsCaption: ' '">
</select>
<!-- ko with: selectedOption -->
<span data-bind="text: text"></span>
<!-- /ko -->
</div>
<div data-bind="tabs: tabs, tabsOptions: { selectedTab: selectedTabModel, enable: tabsEnabled, onTabChanging: onTabChanging }"></div>
<button data-bind="click: setTabTwo">Set tab 2 from view model</button>
<button data-bind="click: toggleTabTwo">Toggle tab 2</button>
<button data-bind="click: toggleTabs">Toggle tabs</button>
<button data-bind="click: addTab">Add new Tab</button>
<button data-bind="click: collapse">Collapse</button>
<input type="checkbox" data-bind="checked: cancelTabSelect, label: { caption: 'Cancel select'}" />
<script id="tab-template" type="text/html">
<span data-bind="text: content"></span>
</script>
</body>
</html></p>