Commit 05c023e0 by fsn

删除demo文件夹

parent 2fae8e2d
/**
* 初始化表格的列
*/
function initColumn(){
var columns = [
{field: 'selectItem',radio:true},
{title: 'id',field: 'userId', visible: false, align: 'center',valign: 'middle'},
{title: '姓名',field: 'userName',align: 'center',valign: 'middle'},
{title: '账号',field: 'userNo',align: 'center',valign: 'middle'},
{title: '角色',field: 'userRole',align: 'center',valign: 'middle',
formatter:function(value,row,index){
if(value == "1"){
return "超级管理员";
}else if(value == "2"){
return "管理员";
}else{
return "其他";
}
}
},
{title: '用户状态',field: 'userStatus',align: 'center',valign: 'middle',
formatter:function(value,row,index){
if(value == 1){
return "登录中";
}else if(value == 2){
return "已退出";
}else{
return "冻结";
}
}
},
{title: '创建时间',field: 'createTime',align: 'center',valign: 'middle'},
{title: '上次登录时间',field: 'loginTime',align: 'center',valign: 'middle'},
{title: '操作',field: '#',align: 'center',
formatter:function(value,row,index){
var e = '<a href="#" mce_href="#" onclick="editManagerInfo(\''+ row.userId + '\')">编辑</a> &nbsp;&nbsp;';
var f = '<a href="#" mce_href="#" onclick="freezeAccount(\''+ row.userId + '\')">停用</a> &nbsp;&nbsp;';
var unf = '<a href="#" mce_href="#" onclick="unFreezeAccount(\''+ row.userId + '\')">恢复</a> ';
return e+f+unf;
}
}];
return columns;
}
/**
* 点击编辑按钮时
* @param userId
*/
function editManagerInfo(userId){
console.log("userId=" + userId);
}
/**
* 点击添加管理员
*/
function addManager(){
parent.layer.open({
type: 2,
title: false,
closeBtn: false,
shade: [0],
area: ['340px', '215px'],
offset: 'rb', //右下角弹出
time: 2000, //2秒后自动关闭
shift: 2,
content: ['http://www.zi-han.net', 'no'], //iframe的url,no代表不显示滚动条
end: function(){ //此处用于演示
parent.layer.open({
type: 2,
title: '很多时候,我们想最大化看,比如像这个页面。',
shadeClose: true,
shade: false,
maxmin: true, //开启最大化最小化按钮
area: ['1150px', '650px'],
content: 'http://www.zi-han.net'
});
}
});
}
/**
* 冻结用户账户
* @param userId
*/
function freezeAccount(userId){
parent.layer.confirm('您确定要停用该账户吗?', {
btn: ['确定','取消'],
shade: false //不显示遮罩
}, function(){
var ajax = new $ax(Feng.ctxPath + "/sys/freeze/" + userId+"", function(data){
parent.layer.msg('停用成功', {icon: 1});
$('#managerTable').bootstrapTable('refresh');
},function(data){
parent.layer.msg('停用失败!', {icon: 2});
});
ajax.start();
});
}
/**
* 解除冻结用户账户
* @param userId
*/
function unFreezeAccount(userId){
parent.layer.confirm('您确定要恢复该账户吗?', {
btn: ['确定','取消'],
shade: false //不显示遮罩
}, function(){
var ajax = new $ax(Feng.ctxPath + "/sys/unfreeze/" + userId, function(data){
parent.layer.msg('恢复成功', {icon: 1});
$('#managerTable').bootstrapTable('refresh');
},function(data){
parent.layer.msg('恢复失败', {icon: 2});
});
ajax.start();
});
}
(function(document, window, $) {
var defaultColunms = initColumn();
// 管理员列表的表格
(function() {
$('#managerTable').bootstrapTable({
url : Feng.ctxPath + "/sys/members",
method : "post",
search : true,
selectItemName : "selectItem",
clickToSelect : true,
pagination : true,
sidePagination : "client",
showRefresh : true,
showColumns : true,
iconSize : 'outline',
toolbar : '#managerTableToolbar',
icons : {
refresh : 'glyphicon-repeat',
toggle : 'glyphicon-list-alt',
columns : 'glyphicon-list'
},
height : 620,
columns: defaultColunms
});
})();
})(document, window, jQuery);
[
{
"id": 0,
"name": "测试0",
"price": "&yen;0",
"column1": "c10",
"column2": "c20",
"column3": "c30",
"column4": "c40"
},
{
"id": 1,
"name": "测试1",
"price": "&yen;1",
"column1": "c10",
"column2": "c20",
"column3": "c30",
"column4": "c40"
},
{
"id": 2,
"name": "测试2",
"price": "&yen;2",
"column1": "c10",
"column2": "c20",
"column3": "c30",
"column4": "c40"
},
{
"id": 3,
"name": "测试3",
"price": "&yen;3",
"column1": "c10",
"column2": "c20",
"column3": "c30",
"column4": "c40"
},
{
"id": 4,
"name": "测试4",
"price": "&yen;4",
"column1": "c10",
"column2": "c20",
"column3": "c30",
"column4": "c40"
},
{
"id": 5,
"name": "测试5",
"price": "&yen;5",
"column1": "c10",
"column2": "c20",
"column3": "c30",
"column4": "c40"
},
{
"id": 6,
"name": "测试6",
"price": "&yen;6",
"column1": "c10",
"column2": "c20",
"column3": "c30",
"column4": "c40"
},
{
"id": 7,
"name": "测试7",
"price": "&yen;7",
"column1": "c10",
"column2": "c20",
"column3": "c30",
"column4": "c40"
},
{
"id": 8,
"name": "测试8",
"price": "&yen;8",
"column1": "c10",
"column2": "c20",
"column3": "c30",
"column4": "c40"
},
{
"id": 9,
"name": "测试9",
"price": "&yen;9",
"column1": "c10",
"column2": "c20",
"column3": "c30",
"column4": "c40"
},
{
"id": 10,
"name": "测试10",
"price": "&yen;10",
"column1": "c10",
"column2": "c20",
"column3": "c30",
"column4": "c40"
},
{
"id": 11,
"name": "测试11",
"price": "&yen;11",
"column1": "c10",
"column2": "c20",
"column3": "c30",
"column4": "c40"
},
{
"id": 12,
"name": "测试12",
"price": "&yen;12",
"column1": "c10",
"column2": "c20",
"column3": "c30",
"column4": "c40"
},
{
"id": 13,
"name": "测试13",
"price": "&yen;13",
"column1": "c10",
"column2": "c20",
"column3": "c30",
"column4": "c40"
},
{
"id": 14,
"name": "测试14",
"price": "&yen;14",
"column1": "c10",
"column2": "c20",
"column3": "c30",
"column4": "c40"
},
{
"id": 15,
"name": "测试15",
"price": "&yen;15",
"column1": "c10",
"column2": "c20",
"column3": "c30",
"column4": "c40"
},
{
"id": 16,
"name": "测试16",
"price": "&yen;16",
"column1": "c10",
"column2": "c20",
"column3": "c30",
"column4": "c40"
},
{
"id": 17,
"name": "测试17",
"price": "&yen;17",
"column1": "c10",
"column2": "c20",
"column3": "c30",
"column4": "c40"
},
{
"id": 18,
"name": "测试18",
"price": "&yen;18",
"column1": "c10",
"column2": "c20",
"column3": "c30",
"column4": "c40"
},
{
"id": 19,
"name": "测试19",
"price": "&yen;19",
"column1": "c10",
"column2": "c20",
"column3": "c30",
"column4": "c40"
},
{
"id": 20,
"name": "测试20",
"price": "&yen;20",
"column1": "c10",
"column2": "c20",
"column3": "c30",
"column4": "c40"
}
]
[
{
"name": "asSelect",
"star": 777,
"license": "MIT",
"description": "A jQuery plugin to select multiple elements with checkboxes and radio:)",
"url": "<a href='https://github.com/amazingSurger/jquery-asSelect'>https://github.com/amazingSurger/jquery-asSelect</a>"
},
{
"name": "Bootstrap Table",
"star": 778,
"license": "MIT & XXX",
"description": "Bootstrap table displays data in a tabular format and offers rich support to radio, checkbox, sort, pagination and so on. ",
"url": "<a href='https://github.com/wenzhixin/bootstrap-table'>https://github.com/wenzhixin/bootstrap-table</a>"
},
{
"name": "asDatepicker",
"star": 779,
"license": "MIT",
"description": "A jQuery datepicker plugin for best .",
"url": "<a href='https://github.com/amazingSurger/jquery-asDatepicker'>https://github.com/amazingSurger/jquery-asDatepicker</a>"
},
{
"name": "asColorpicker",
"star": 780,
"license": "MIT",
"description": "A jQuery colorpicker for best .",
"url": "<a href='https://github.com/amazingSurger/jquery-asColorpicker'>https://github.com/amazingSurger/jquery-asColorpicker</a>"
}
]
$(document).ready(function () {
var $image = $(".image-crop > img")
$($image).cropper({
aspectRatio: 1.618,
preview: ".img-preview",
done: function (data) {
// 输出结果
}
});
var $inputImage = $("#inputImage");
if (window.FileReader) {
$inputImage.change(function () {
var fileReader = new FileReader(),
files = this.files,
file;
if (!files.length) {
return;
}
file = files[0];
if (/^image\/\w+$/.test(file.type)) {
fileReader.readAsDataURL(file);
fileReader.onload = function () {
$inputImage.val("");
$image.cropper("reset", true).cropper("replace", this.result);
};
} else {
showMessage("请选择图片文件");
}
});
} else {
$inputImage.addClass("hide");
}
$("#download").click(function () {
window.open($image.cropper("getDataURL"));
});
$("#zoomIn").click(function () {
$image.cropper("zoom", 0.1);
});
$("#zoomOut").click(function () {
$image.cropper("zoom", -0.1);
});
$("#rotateLeft").click(function () {
$image.cropper("rotate", 45);
});
$("#rotateRight").click(function () {
$image.cropper("rotate", -45);
});
$("#setDrag").click(function () {
$image.cropper("setDragMode", "crop");
});
$('#data_1 .input-group.date').datepicker({
todayBtn: "linked",
keyboardNavigation: false,
forceParse: false,
calendarWeeks: true,
autoclose: true
});
$('#data_2 .input-group.date').datepicker({
startView: 1,
todayBtn: "linked",
keyboardNavigation: false,
forceParse: false,
autoclose: true,
format: "yyyy-mm-dd"
});
$('#data_3 .input-group.date').datepicker({
startView: 2,
todayBtn: "linked",
keyboardNavigation: false,
forceParse: false,
autoclose: true
});
$('#data_4 .input-group.date').datepicker({
minViewMode: 1,
keyboardNavigation: false,
forceParse: false,
autoclose: true,
todayHighlight: true
});
$('#data_5 .input-daterange').datepicker({
keyboardNavigation: false,
forceParse: false,
autoclose: true
});
var elem = document.querySelector('.js-switch');
var switchery = new Switchery(elem, {
color: '#1AB394'
});
var elem_2 = document.querySelector('.js-switch_2');
var switchery_2 = new Switchery(elem_2, {
color: '#ED5565'
});
var elem_3 = document.querySelector('.js-switch_3');
var switchery_3 = new Switchery(elem_3, {
color: '#1AB394'
});
$('.i-checks').iCheck({
checkboxClass: 'icheckbox_square-green',
radioClass: 'iradio_square-green'
});
$('.colorpicker-demo1').colorpicker();
$('.colorpicker-demo2').colorpicker();
$('.colorpicker-demo3').colorpicker();
// Code for demos
function createColorpickers() {
// Api demo
var bodyStyle = $('body')[0].style;
$('#demo_apidemo').colorpicker({
color: bodyStyle.backgroundColor
}).on('changeColor', function (ev) {
bodyStyle.backgroundColor = ev.color.toHex();
});
// Horizontal mode
$('#demo_forceformat').colorpicker({
format: 'rgba', // force this format
horizontal: true
});
$('.demo-auto').colorpicker();
// Disabled / enabled triggers
$(".disable-button").click(function (e) {
e.preventDefault();
$("#demo_endis").colorpicker('disable');
});
$(".enable-button").click(function (e) {
e.preventDefault();
$("#demo_endis").colorpicker('enable');
});
}
createColorpickers();
// Create / destroy instances
$('.demo-destroy').click(function (e) {
e.preventDefault();
$('.demo').colorpicker('destroy');
$(".disable-button, .enable-button").off('click');
});
$('.demo-create').click(function (e) {
e.preventDefault();
createColorpickers();
});
var divStyle = $('.back-change')[0].style;
$('#demo_apidemo').colorpicker({
color: divStyle.backgroundColor
}).on('changeColor', function (ev) {
divStyle.backgroundColor = ev.color.toHex();
});
$('.clockpicker').clockpicker();
$( '#file-pretty input[type="file"]' ).prettyFile();
});
var config = {
'.chosen-select': {},
'.chosen-select-deselect': {
allow_single_deselect: true
},
'.chosen-select-no-single': {
disable_search_threshold: 10
},
'.chosen-select-no-results': {
no_results_text: 'Oops, nothing found!'
},
'.chosen-select-width': {
width: "95%"
}
}
for (var selector in config) {
$(selector).chosen(config[selector]);
}
$("#ionrange_1").ionRangeSlider({
min: 0,
max: 5000,
type: 'double',
prefix: "&yen;",
maxPostfix: "+",
prettify: false,
hasGrid: true
});
$("#ionrange_2").ionRangeSlider({
min: 0,
max: 10,
type: 'single',
step: 0.1,
postfix: " 克",
prettify: false,
hasGrid: true
});
$("#ionrange_3").ionRangeSlider({
min: -50,
max: 50,
from: 0,
postfix: "°",
prettify: false,
hasGrid: true
});
$("#ionrange_4").ionRangeSlider({
values: [
"一月", "二月", "三月",
"四月", "五月", "六月",
"七月", "八月", "九月",
"十月", "十一月", "十二月"
],
type: 'single',
hasGrid: true
});
$("#ionrange_5").ionRangeSlider({
min: 10000,
max: 100000,
step: 100,
postfix: " km",
from: 55000,
hideMinMax: true,
hideFromTo: false
});
$(".dial").knob();
$("#basic_slider").noUiSlider({
start: 40,
behaviour: 'tap',
connect: 'upper',
range: {
'min': 20,
'max': 80
}
});
$("#range_slider").noUiSlider({
start: [40, 60],
behaviour: 'drag',
connect: true,
range: {
'min': 20,
'max': 80
}
});
$("#drag-fixed").noUiSlider({
start: [40, 60],
behaviour: 'drag-fixed',
connect: true,
range: {
'min': 20,
'max': 80
}
});
//以下为修改jQuery Validation插件兼容Bootstrap的方法,没有直接写在插件中是为了便于插件升级
$.validator.setDefaults({
highlight: function (element) {
$(element).closest('.form-group').removeClass('has-success').addClass('has-error');
},
success: function (element) {
element.closest('.form-group').removeClass('has-error').addClass('has-success');
},
errorElement: "span",
errorPlacement: function (error, element) {
if (element.is(":radio") || element.is(":checkbox")) {
error.appendTo(element.parent().parent().parent());
} else {
error.appendTo(element.parent());
}
},
errorClass: "help-block m-b-none",
validClass: "help-block m-b-none"
});
//以下为官方示例
$().ready(function () {
// validate the comment form when it is submitted
$("#commentForm").validate();
// validate signup form on keyup and submit
var icon = "<i class='fa fa-times-circle'></i> ";
$("#signupForm").validate({
rules: {
firstname: "required",
lastname: "required",
username: {
required: true,
minlength: 2
},
password: {
required: true,
minlength: 5
},
confirm_password: {
required: true,
minlength: 5,
equalTo: "#password"
},
email: {
required: true,
email: true
},
topic: {
required: "#newsletter:checked",
minlength: 2
},
agree: "required"
},
messages: {
firstname: icon + "请输入你的姓",
lastname: icon + "请输入您的名字",
username: {
required: icon + "请输入您的用户名",
minlength: icon + "用户名必须两个字符以上"
},
password: {
required: icon + "请输入您的密码",
minlength: icon + "密码必须5个字符以上"
},
confirm_password: {
required: icon + "请再次输入密码",
minlength: icon + "密码必须5个字符以上",
equalTo: icon + "两次输入的密码不一致"
},
email: icon + "请输入您的E-mail",
agree: {
required: icon + "必须同意协议后才能注册",
element: '#agree-error'
}
}
});
// propose username by combining first- and lastname
$("#username").focus(function () {
var firstname = $("#firstname").val();
var lastname = $("#lastname").val();
if (firstname && lastname && !this.value) {
this.value = firstname + "." + lastname;
}
});
});
/*! layer demo */ ;
! function () {
var gather = {
htdy: $('html, body')
};
//一睹为快
gather.demo1 = $('#demo1');
$('#chutiyan>a').on('click', function () {
var othis = $(this),
index = othis.index();
var p = gather.demo1.children('p').eq(index);
var top = p.position().top;
gather.demo1.animate({
scrollTop: gather.demo1.scrollTop() + top
}, 0);
switch (index) {
case 0:
var icon = -1;
(function changeIcon() {
var index = parent.layer.alert('点击确认更换图标', {
icon: icon,
shadeClose: true,
title: icon === -1 ? '初体验' : 'icon:' + icon
}, changeIcon);
if (8 === ++icon) layer.close(index);
}());
break;
case 1:
var icon = 0;
(function changeIcon1() {
var index = parent.layer.alert('点击确认更换图标', {
icon: icon,
shadeClose: true,
skin: 'layer-ext-moon',
shift: 5,
title: icon === -1 ? '第三方扩展皮肤' : 'icon:' + icon
}, changeIcon1);
if (9 === ++icon) {
parent.layer.confirm('怎么样,是否很喜欢该皮肤,去下载?', {
skin: 'layer-ext-moon'
}, function (index, layero) {
layero.find('.layui-layer-btn0').attr({
href: 'http://layer.layui.com/skin.html',
target: '_blank'
});
parent.layer.close(index);
});
};
}());
break;
case 6:
parent.layer.open({
type: 1,
area: ['420px', '240px'],
skin: 'layui-layer-rim', //加上边框
content: '<div style="padding:20px;">即直接给content传入html字符<br>当内容宽高超过定义宽高,会自动出现滚动条。<br><br><br><br><br><br><br><br><br><br><br>很高兴在下面遇见你</div>'
});
break;
case 7:
parent.layer.open({
type: 1,
skin: 'layui-layer-demo',
closeBtn: false,
area: '350px',
shift: 2,
shadeClose: true,
content: '<div style="padding:20px;">即传入skin:"样式名",然后你就可以为所欲为了。<br>你怎么样给她整容都行<br><br><br>我是华丽的酱油==。</div>'
});
break;
case 8:
layer.tips('Hi,我是tips', this);
break;
case 11:
var ii = parent.layer.load(0, {
shade: false
});
setTimeout(function () {
parent.layer.close(ii)
}, 5000);
break;
case 12:
var iii = parent.layer.load(1, {
shade: [0.1, '#fff']
});
setTimeout(function () {
parent.layer.close(iii)
}, 3000);
break;
case 13:
layer.tips('我是另外一个tips,只不过我长得跟之前那位稍有些不一样。', this, {
tips: [1, '#3595CC'],
time: 4000
});
break;
case 14:
parent.layer.prompt({
title: '输入任何口令,并确认',
formType: 1
}, function (pass) {
parent.layer.prompt({
title: '随便写点啥,并确认',
formType: 2
}, function (text) {
parent.layer.msg('演示完毕!您的口令:' + pass + '<br>您最后写下了:' + text);
});
});
break;
case 15:
parent.layer.tab({
area: ['600px', '300px'],
tab: [{
title: '无题',
content: '<div style="padding:20px; line-height:30px; text-align:center">欢迎体验layer.tab<br>此时此刻不禁让人吟诗一首:<br>一入前端深似海<br>从此妹纸是浮云<br>以下省略七个字<br>。。。。。。。<br>——贤心</div>'
}, {
title: 'TAB2',
content: '<div style="padding:20px;">TAB2该说些啥</div>'
}, {
title: 'TAB3',
content: '<div style="padding:20px;">有一种坚持叫:layer</div>'
}]
});
break;
case 16:
if (gather.photoJSON) {
layer.photos({
photos: gather.photoJSON
});
} else {
$.getJSON('js/demo/photos.json?v=', function (json) {
gather.photoJSON = json;
layer.photos({
photos: json
});
});
}
break;
default:
new Function(p.text())();
break;
}
});
}();
$(function() {
Morris.Line({
element: 'morris-one-line-chart',
data: [
{ year: '2008', value: 5 },
{ year: '2009', value: 10 },
{ year: '2010', value: 8 },
{ year: '2011', value: 22 },
{ year: '2012', value: 8 },
{ year: '2014', value: 10 },
{ year: '2015', value: 5 }
],
xkey: 'year',
ykeys: ['value'],
resize: true,
lineWidth:4,
labels: ['Value'],
lineColors: ['#1ab394'],
pointSize:5,
});
Morris.Area({
element: 'morris-area-chart',
data: [{
period: '2010 Q1',
iphone: 2666,
ipad: null,
itouch: 2647
}, {
period: '2010 Q2',
iphone: 2778,
ipad: 2294,
itouch: 2441
}, {
period: '2010 Q3',
iphone: 4912,
ipad: 1969,
itouch: 2501
}, {
period: '2010 Q4',
iphone: 3767,
ipad: 3597,
itouch: 5689
}, {
period: '2011 Q1',
iphone: 6810,
ipad: 1914,
itouch: 2293
}, {
period: '2011 Q2',
iphone: 5670,
ipad: 4293,
itouch: 1881
}, {
period: '2011 Q3',
iphone: 4820,
ipad: 3795,
itouch: 1588
}, {
period: '2011 Q4',
iphone: 15073,
ipad: 5967,
itouch: 5175
}, {
period: '2012 Q1',
iphone: 10687,
ipad: 4460,
itouch: 2028
}, {
period: '2012 Q2',
iphone: 8432,
ipad: 5713,
itouch: 1791
}],
xkey: 'period',
ykeys: ['iphone', 'ipad', 'itouch'],
labels: ['iPhone', 'iPad', 'iPod Touch'],
pointSize: 2,
hideHover: 'auto',
resize: true,
lineColors: ['#87d6c6', '#54cdb4','#1ab394'],
lineWidth:2,
pointSize:1,
});
Morris.Donut({
element: 'morris-donut-chart',
data: [{
label: "A系列",
value: 12
}, {
label: "B系列",
value: 30
}, {
label: "C系列",
value: 20
}],
resize: true,
colors: ['#87d6c6', '#54cdb4','#1ab394'],
});
Morris.Bar({
element: 'morris-bar-chart',
data: [{
y: '2006',
a: 60,
b: 50
}, {
y: '2007',
a: 75,
b: 65
}, {
y: '2008',
a: 50,
b: 40
}, {
y: '2009',
a: 75,
b: 65
}, {
y: '2010',
a: 50,
b: 40
}, {
y: '2011',
a: 75,
b: 65
}, {
y: '2012',
a: 100,
b: 90
}],
xkey: 'y',
ykeys: ['a', 'b'],
labels: ['A系列', 'B系列'],
hideHover: 'auto',
resize: true,
barColors: ['#1ab394', '#cacaca'],
});
Morris.Line({
element: 'morris-line-chart',
data: [{
y: '2006',
a: 100,
b: 90
}, {
y: '2007',
a: 75,
b: 65
}, {
y: '2008',
a: 50,
b: 40
}, {
y: '2009',
a: 75,
b: 65
}, {
y: '2010',
a: 50,
b: 40
}, {
y: '2011',
a: 75,
b: 65
}, {
y: '2012',
a: 100,
b: 90
}],
xkey: 'y',
ykeys: ['a', 'b'],
labels: ['A系列', 'B系列'],
hideHover: 'auto',
resize: true,
lineColors: ['#54cdb4','#1ab394'],
});
});
$(function() {
$("span.pie").peity("pie", {
fill: ['#1ab394', '#d7d7d7', '#ffffff']
})
$(".line").peity("line",{
fill: '#1ab394',
stroke:'#169c81',
})
$(".bar").peity("bar", {
fill: ["#1ab394", "#d7d7d7"]
})
$(".bar_dashboard").peity("bar", {
fill: ["#1ab394", "#d7d7d7"],
width:100
})
var updatingChart = $(".updating-chart").peity("line", { fill: '#1ab394',stroke:'#169c81', width: 64 })
setInterval(function() {
var random = Math.round(Math.random() * 10)
var values = updatingChart.text().split(",")
values.shift()
values.push(random)
updatingChart
.text(values.join(","))
.change()
}, 1000);
});
{
"status": 1,
"msg": "",
"title": "JSON请求的相册",
"id": 8,
"start": 0,
"data": [
{
"name": "越来越喜欢观察微小的事物",
"pid": 109,
"src": "http://f8.topitme.com/8/99/b0/1100251118d0cb0998l.jpg",
"thumb": "http://f8.topitme.com/8/99/b0/1100251118d0cb0998l.jpg",
"area": [
510,
287
]
},
{
"name": "决定,意味着对与错的并存",
"pid": 110,
"src": "http://t.williamgates.net/image-9A50_54058FA3.jpg",
"thumb": "http://t.williamgates.net/image-9A50_54058FA3.jpg",
"area": [
690,
431
]
},
{
"name": "给人姐姐般温暖的的邻家女孩",
"pid": 111,
"src": "http://t.williamgates.net/image-E9BF_54058FA3.jpg",
"thumb": "http://t.williamgates.net/image-E9BF_54058FA3.jpg",
"area": [
690,
431
]
}
]
}
$(function() {
var graph = new Rickshaw.Graph( {
element: document.querySelector("#chart"),
series: [{
color: '#1ab394',
data: [
{ x: 0, y: 40 },
{ x: 1, y: 49 },
{ x: 2, y: 38 },
{ x: 3, y: 30 },
{ x: 4, y: 32 } ]
}]
});
graph.render();
var graph2 = new Rickshaw.Graph( {
element: document.querySelector("#rickshaw_multi"),
renderer: 'area',
stroke: true,
series: [ {
data: [ { x: 0, y: 40 }, { x: 1, y: 49 }, { x: 2, y: 38 }, { x: 3, y: 20 }, { x: 4, y: 16 } ],
color: '#1ab394',
stroke: '#17997f'
}, {
data: [ { x: 0, y: 22 }, { x: 1, y: 25 }, { x: 2, y: 38 }, { x: 3, y: 44 }, { x: 4, y: 46 } ],
color: '#eeeeee',
stroke: '#d7d7d7'
} ]
} );
graph2.renderer.unstack = true;
graph2.render();
var graph3 = new Rickshaw.Graph({
element: document.querySelector("#rickshaw_line"),
renderer: 'line',
series: [ {
data: [ { x: 0, y: 40 }, { x: 1, y: 49 }, { x: 2, y: 38 }, { x: 3, y: 30 }, { x: 4, y: 32 } ],
color: '#1ab394'
} ]
} );
graph3.render();
var graph4 = new Rickshaw.Graph({
element: document.querySelector("#rickshaw_multi_line"),
renderer: 'line',
series: [{
data: [ { x: 0, y: 40 }, { x: 1, y: 49 }, { x: 2, y: 38 }, { x: 3, y: 30 }, { x: 4, y: 32 } ],
color: '#1ab394'
}, {
data: [ { x: 0, y: 20 }, { x: 1, y: 24 }, { x: 2, y: 19 }, { x: 3, y: 15 }, { x: 4, y: 16 } ],
color: '#d7d7d7'
}]
});
graph4.render();
var graph5 = new Rickshaw.Graph( {
element: document.querySelector("#rickshaw_bars"),
renderer: 'bar',
series: [ {
data: [ { x: 0, y: 40 }, { x: 1, y: 49 }, { x: 2, y: 38 }, { x: 3, y: 30 }, { x: 4, y: 32 } ],
color: '#1ab394'
} ]
} );
graph5.render();
var graph6 = new Rickshaw.Graph( {
element: document.querySelector("#rickshaw_bars_stacked"),
renderer: 'bar',
series: [
{
data: [ { x: 0, y: 40 }, { x: 1, y: 49 }, { x: 2, y: 38 }, { x: 3, y: 30 }, { x: 4, y: 32 } ],
color: '#1ab394'
}, {
data: [ { x: 0, y: 20 }, { x: 1, y: 24 }, { x: 2, y: 19 }, { x: 3, y: 15 }, { x: 4, y: 16 } ],
color: '#d7d7d7'
} ]
} );
graph6.render();
var graph7 = new Rickshaw.Graph( {
element: document.querySelector("#rickshaw_scatterplot"),
renderer: 'scatterplot',
stroke: true,
padding: { top: 0.05, left: 0.05, right: 0.05 },
series: [ {
data: [ { x: 0, y: 15 },
{ x: 1, y: 18 },
{ x: 2, y: 10 },
{ x: 3, y: 12 },
{ x: 4, y: 15 },
{ x: 5, y: 24 },
{ x: 6, y: 28 },
{ x: 7, y: 31 },
{ x: 8, y: 22 },
{ x: 9, y: 18 },
{ x: 10, y: 16 }
],
color: '#1ab394'
} ]
} );
graph7.render();
});
$(function () {
$("#sparkline1").sparkline([34, 43, 43, 35, 44, 32, 44, 52, 25], {
type: 'line',
lineColor: '#17997f',
fillColor: '#1ab394',
});
$("#sparkline2").sparkline([5, 6, 7, 2, 0, -4, -2, 4], {
type: 'bar',
barColor: '#1ab394',
negBarColor: '#c6c6c6'});
$("#sparkline3").sparkline([1, 1, 2], {
type: 'pie',
sliceColors: ['#1ab394', '#b3b3b3', '#e4f0fb']});
$("#sparkline4").sparkline([34, 43, 43, 35, 44, 32, 15, 22, 46, 33, 86, 54, 73, 53, 12, 53, 23, 65, 23, 63, 53, 42, 34, 56, 76, 15, 54, 23, 44], {
type: 'line',
lineColor: '#17997f',
fillColor: '#ffffff',
});
$("#sparkline5").sparkline([1, 1, 0, 1, -1, -1, 1, -1, 0, 0, 1, 1], {
type: 'tristate',
posBarColor: '#1ab394',
negBarColor: '#bfbfbf'});
$("#sparkline6").sparkline([4, 6, 7, 7, 4, 3, 2, 1, 4, 4, 5, 6, 3, 4, 5, 8, 7, 6, 9, 3, 2, 4, 1, 5, 6, 4, 3, 7, ], {
type: 'discrete',
lineColor: '#1ab394'});
$("#sparkline7").sparkline([52, 12, 44], {
type: 'pie',
height: '150px',
sliceColors: ['#1ab394', '#b3b3b3', '#e4f0fb']});
$("#sparkline8").sparkline([5, 6, 7, 2, 0, 4, 2, 4, 5, 7, 2, 4, 12, 14, 4, 2, 14, 12, 7], {
type: 'bar',
barWidth: 8,
height: '150px',
barColor: '#1ab394',
negBarColor: '#c6c6c6'});
$("#sparkline9").sparkline([34, 43, 43, 35, 44, 32, 15, 22, 46, 33, 86, 54, 73, 53, 12, 53, 23, 65, 23, 63, 53, 42, 34, 56, 76, 15, 54, 23, 44], {
type: 'line',
lineWidth: 1,
height: '150px',
lineColor: '#17997f',
fillColor: '#ffffff',
});
});
[{
"Tid": "1",
"First": "奔波儿灞",
"sex": "男",
"Score": "50"
}, {
"Tid": "2",
"First": "灞波儿奔",
"sex": "男",
"Score": "94"
}, {
"Tid": "3",
"First": "作家崔成浩",
"sex": "男",
"Score": "80"
}, {
"Tid": "4",
"First": "韩寒",
"sex": "男",
"Score": "67"
}, {
"Tid": "5",
"First": "郭敬明",
"sex": "男",
"Score": "100"
}, {
"Tid": "6",
"First": "马云",
"sex": "男",
"Score": "77"
}, {
"Tid": "7",
"First": "范爷",
"sex": "女",
"Score": "87"
}]
$(function () {
var defaultData = [
{
text: '父节点 1',
href: '#parent1',
tags: ['4'],
nodes: [
{
text: '子节点 1',
href: '#child1',
tags: ['2'],
nodes: [
{
text: '孙子节点 1',
href: '#grandchild1',
tags: ['0']
},
{
text: '孙子节点 2',
href: '#grandchild2',
tags: ['0']
}
]
},
{
text: '子节点 2',
href: '#child2',
tags: ['0']
}
]
},
{
text: '父节点 2',
href: '#parent2',
tags: ['0']
},
{
text: '父节点 3',
href: '#parent3',
tags: ['0']
},
{
text: '父节点 4',
href: '#parent4',
tags: ['0']
},
{
text: '父节点 5',
href: '#parent5',
tags: ['0']
}
];
var alternateData = [
{
text: '父节点 1',
tags: ['2'],
nodes: [
{
text: '子节点 1',
tags: ['3'],
nodes: [
{
text: '孙子节点 1',
tags: ['6']
},
{
text: '孙子节点 2',
tags: ['3']
}
]
},
{
text: '子节点 2',
tags: ['3']
}
]
},
{
text: '父节点 2',
tags: ['7']
},
{
text: '父节点 3',
icon: 'glyphicon glyphicon-earphone',
href: '#demo',
tags: ['11']
},
{
text: '父节点 4',
icon: 'glyphicon glyphicon-cloud-download',
href: '/demo.html',
tags: ['19'],
selected: true
},
{
text: '父节点 5',
icon: 'glyphicon glyphicon-certificate',
color: 'pink',
backColor: 'red',
href: 'http://www.tesco.com',
tags: ['available', '0']
}
];
var json = '[' +
'{' +
'"text": "父节点 1",' +
'"nodes": [' +
'{' +
'"text": "子节点 1",' +
'"nodes": [' +
'{' +
'"text": "孙子节点 1"' +
'},' +
'{' +
'"text": "孙子节点 2"' +
'}' +
']' +
'},' +
'{' +
'"text": "子节点 2"' +
'}' +
']' +
'},' +
'{' +
'"text": "父节点 2"' +
'},' +
'{' +
'"text": "父节点 3"' +
'},' +
'{' +
'"text": "父节点 4"' +
'},' +
'{' +
'"text": "父节点 5"' +
'}' +
']';
$('#treeview1').treeview({
data: defaultData
});
$('#treeview2').treeview({
levels: 1,
data: defaultData
});
$('#treeview3').treeview({
levels: 99,
data: defaultData
});
$('#treeview4').treeview({
color: "#428bca",
data: defaultData
});
$('#treeview5').treeview({
color: "#428bca",
expandIcon: 'glyphicon glyphicon-chevron-right',
collapseIcon: 'glyphicon glyphicon-chevron-down',
nodeIcon: 'glyphicon glyphicon-bookmark',
data: defaultData
});
$('#treeview6').treeview({
color: "#428bca",
expandIcon: "glyphicon glyphicon-stop",
collapseIcon: "glyphicon glyphicon-unchecked",
nodeIcon: "glyphicon glyphicon-user",
showTags: true,
data: defaultData
});
$('#treeview7').treeview({
color: "#428bca",
showBorder: false,
data: defaultData
});
$('#treeview8').treeview({
expandIcon: "glyphicon glyphicon-stop",
collapseIcon: "glyphicon glyphicon-unchecked",
nodeIcon: "glyphicon glyphicon-user",
color: "yellow",
backColor: "purple",
onhoverColor: "orange",
borderColor: "red",
showBorder: false,
showTags: true,
highlightSelected: true,
selectedColor: "yellow",
selectedBackColor: "darkorange",
data: defaultData
});
$('#treeview9').treeview({
expandIcon: "glyphicon glyphicon-stop",
collapseIcon: "glyphicon glyphicon-unchecked",
nodeIcon: "glyphicon glyphicon-user",
color: "yellow",
backColor: "purple",
onhoverColor: "orange",
borderColor: "red",
showBorder: false,
showTags: true,
highlightSelected: true,
selectedColor: "yellow",
selectedBackColor: "darkorange",
data: alternateData
});
$('#treeview10').treeview({
color: "#428bca",
enableLinks: true,
data: defaultData
});
$('#treeview11').treeview({
color: "#428bca",
data: defaultData,
onNodeSelected: function (event, node) {
$('#event_output').prepend('<p>您单击了 ' + node.text + '</p>');
}
});
// $('#treeview11').on('nodeSelected', function (event, node) {
// $('#event_output').prepend('<p>您单击了 ' + node.text + '</p>');
// });
$('#treeview12').treeview({
data: json
});
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment