mirror of
https://github.com/hanzoai/jube-fork.git
synced 2026-11-02 09:25:40 +00:00
243 lines
8.5 KiB
HTML
Executable File
243 lines
8.5 KiB
HTML
Executable File
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>API</title>
|
|
<meta charset="utf-8">
|
|
<link href="../content/shared/styles/examples-offline.css" rel="stylesheet">
|
|
<link href="../../styles/kendo.common.min.css" rel="stylesheet">
|
|
<link href="../../styles/kendo.rtl.min.css" rel="stylesheet">
|
|
<link href="../../styles/kendo.default.min.css" rel="stylesheet">
|
|
<link href="../../styles/kendo.default.mobile.min.css" rel="stylesheet">
|
|
<script src="../../js/jquery.min.js"></script>
|
|
<script src="../../js/jszip.min.js"></script>
|
|
<script src="../../js/kendo.all.min.js"></script>
|
|
<script src="../content/shared/js/console.js"></script>
|
|
<script>
|
|
|
|
</script>
|
|
|
|
|
|
</head>
|
|
<body>
|
|
|
|
<a class="offline-button" href="../index.html">Back</a>
|
|
|
|
<div id="example">
|
|
<div class="demo-section k-content wide">
|
|
<div class="configurator">
|
|
<div class="header">Configurator</div>
|
|
<div class="box-col">
|
|
<h4>API Functions</h4>
|
|
<ul class="options">
|
|
<li>
|
|
<input type="text" id="toggleIndex" /> <button class="toggleItem">Enable / Disable</button>
|
|
</li>
|
|
<li>
|
|
<button class="toggleVisibility">Show / Hide Text</button>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="box-col">
|
|
<h4>Add / Remove item</h4>
|
|
<ul class="options">
|
|
<li>
|
|
<input type="text" id="addIndex" placeholder="Type index..." /><button id="addItem">Add Item</button>
|
|
</li>
|
|
<li>
|
|
<input type="text" id="removeIndex" placeholder="Type index..." /><button id="removeItem">Remove Item</button>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="box-col">
|
|
<h4>Get / Select items</h4>
|
|
<ul class="options">
|
|
<li>
|
|
<input type="text" id="getIndex" placeholder="Type Index..." /><button id="getByIndex">Get By Index</button>
|
|
</li>
|
|
<li>
|
|
<input type="text" id="selectIndex" placeholder="Type Index..." /><button id="selectByIndex">Select By Index</button>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="demo-app" style="position:relative">
|
|
<div id="home"class="demo-view">
|
|
<div class="view-content">
|
|
<div class="title">
|
|
<h3>Home</h3>
|
|
</div>
|
|
<div>
|
|
<span class="sunny"> </span>
|
|
<div class="weather">
|
|
<h2>29<span>ºC</span></h2>
|
|
<p>Sunny weather in New York.</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="calendar" class="demo-view" style="display:none">
|
|
<div class="view-content">
|
|
<div class="title">
|
|
<h3>Calendar</h3>
|
|
</div>
|
|
<div id="calendar-widget"></div>
|
|
</div>
|
|
</div>
|
|
<div id="profile" class="demo-view" style="display:none">
|
|
<div class="title">
|
|
<h3>My Profile</h3>
|
|
</div>
|
|
<div class="view-content">
|
|
<div id="avatar">
|
|
<img src="../content/web/avatar.png" width="128" height="128" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<nav id="bottomNavigation" style="bottom: 0; "></nav>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
$(document).ready(function () {
|
|
var isVisible = false;
|
|
$("#calendar-widget").kendoCalendar();
|
|
$("#bottomNavigation").kendoBottomNavigation({
|
|
items: [
|
|
{ data: { view: "home" }, icon: "home", text: "Home", selected: true },
|
|
{ data: { view: "calendar" }, icon: "calendar", text: "Calendar" },
|
|
{ data: { view: "profile" }, icon: "user", text: "Profile" }
|
|
],
|
|
positionMode: "absolute",
|
|
select: function (e) {
|
|
var id = e.data.view;
|
|
$(".demo-view").hide();
|
|
$("#" + id).show();
|
|
}
|
|
});
|
|
|
|
var nav = $("#bottomNavigation").data("kendoBottomNavigation"),
|
|
getItem = function (target) {
|
|
var itemIndexes = target.val().split(/[.,]/),
|
|
item = nav.element;
|
|
|
|
if (itemIndexes[0] !== "") {
|
|
for (var i = 0, len = itemIndexes.length; i < len; i++) {
|
|
item = item.children("span").eq(itemIndexes[i]);
|
|
if (i < len - 1) {
|
|
item = item.find("span:first");
|
|
}
|
|
}
|
|
}
|
|
|
|
return item;
|
|
},
|
|
toggle = function (e) {
|
|
var item = getItem($("#toggleIndex"));
|
|
nav.enable(item, item.hasClass("k-state-disabled"));
|
|
|
|
},
|
|
toggleVisibility = function (e) {
|
|
nav.showText(isVisible);
|
|
isVisible = !isVisible;
|
|
},
|
|
addItem = function (e) {
|
|
var item = getItem($("#addIndex"));
|
|
nav.add({ icon: "home", text: "Home" }, item);
|
|
},
|
|
removeItem = function (e) {
|
|
var item = getItem($("#removeIndex"))
|
|
nav.remove(item);
|
|
},
|
|
getByIndex = function (e) {
|
|
if (nav.items().length > 0) {
|
|
var index = $("#getIndex").val();
|
|
var item = nav.item(index);
|
|
kendo.alert("Item: " + $(item)[0].innerText);
|
|
}
|
|
},
|
|
select = function (e) {
|
|
if (nav.items().length > 0) {
|
|
var index = $("#selectIndex").val();
|
|
var item = nav.item(index);
|
|
var id = $(item)[0].innerText;
|
|
nav.select(item);
|
|
$(".demo-view").hide();
|
|
$("#" + id.toLowerCase()).show();
|
|
}
|
|
};
|
|
$(".toggleItem").click(toggle);
|
|
$(".toggleVisibility").click(toggleVisibility);
|
|
$("#addItem").click(addItem);
|
|
$("#removeItem").click(removeItem);
|
|
$("#getByIndex").click(getByIndex);
|
|
$("#selectByIndex").click(select);
|
|
})
|
|
</script>
|
|
<style>
|
|
.weather {
|
|
margin: 0 auto 30px;
|
|
text-align: center;
|
|
}
|
|
|
|
.sunny {
|
|
display: block;
|
|
margin: 30px auto 10px;
|
|
width: 128px;
|
|
height: 128px;
|
|
background: url('../content/web/tabstrip/weather.png') transparent no-repeat 0 0;
|
|
}
|
|
|
|
#avatar {
|
|
text-align: center;
|
|
}
|
|
|
|
.view-content {
|
|
letter-spacing: 0.20px;
|
|
}
|
|
|
|
#calendar .view-content {
|
|
text-align: center;
|
|
}
|
|
|
|
.demo-app {
|
|
margin: auto;
|
|
width: 382px;
|
|
height: 600px;
|
|
background: #FFFFFF;
|
|
box-shadow: 0px 10px 20px #00000016;
|
|
border-radius: 30px;
|
|
font-size: 14px;
|
|
}
|
|
|
|
.demo-app h3 {
|
|
padding-top: 24px;
|
|
text-align: center;
|
|
font-size: 28px;
|
|
letter-spacing: 0.28px;
|
|
color: #3D57D8;
|
|
font-weight: 400;
|
|
}
|
|
|
|
#home, #calendar, #profile {
|
|
background: #F9F9F9;
|
|
height: inherit;
|
|
width: inherit;
|
|
border-radius: 30px;
|
|
border: 10px solid white;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
.demo-app .k-bottom-nav-flat {
|
|
margin-left: 10px;
|
|
margin-bottom: 10px;
|
|
height: 70px;
|
|
max-width: 362px;
|
|
border-bottom-left-radius: 20px;
|
|
border-bottom-right-radius: 20px;
|
|
}
|
|
</style>
|
|
</div>
|
|
|
|
|
|
</body>
|
|
</html>
|