Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

modify info

  • Loading branch information...
commit 34b18d5cfe8fa8f70dfb63486511afc23530584e 1 parent d01bc6d
ShiChunhua authored
Showing with 5,922 additions and 157 deletions.
  1. +12 −0 __index.html
  2. +442 −0 demo/core/H5Calendar/calendar.css
  3. +50 −0 demo/core/H5Calendar/calendar.htm
  4. +945 −0 demo/core/H5Calendar/calendar.js
  5. BIN  demo/core/H5Calendar/dot.png
  6. +1 −7 demo/core/SiderBar/css/SiderBar.css
  7. +1 −4 demo/core/SimpleTree/css/simpleTree.css
  8. +2 −2 demo/core/SliderPicShow/example.htm
  9. +2 −2 demo/core/ajax.js
  10. +3,897 −0 demo/core/menu/ace.all.js
  11. BIN  demo/core/menu/icons/00003.gif
  12. BIN  demo/core/menu/icons/00023.gif
  13. BIN  demo/core/menu/icons/00137.gif
  14. BIN  demo/core/menu/icons/00156.gif
  15. BIN  demo/core/menu/icons/00178.gif
  16. BIN  demo/core/menu/icons/00206.gif
  17. BIN  demo/core/menu/icons/00263.gif
  18. BIN  demo/core/menu/icons/00280.gif
  19. BIN  demo/core/menu/icons/00298.gif
  20. BIN  demo/core/menu/icons/00429.gif
  21. BIN  demo/core/menu/icons/00442.gif
  22. BIN  demo/core/menu/icons/00645.gif
  23. BIN  demo/core/menu/icons/01031.gif
  24. BIN  demo/core/menu/icons/01122.gif
  25. BIN  demo/core/menu/icons/01691.gif
  26. BIN  demo/core/menu/icons/01957.gif
  27. BIN  demo/core/menu/icons/02619.gif
  28. BIN  demo/core/menu/icons/03265.gif
  29. BIN  demo/core/menu/icons/06125.gif
  30. BIN  demo/core/menu/icons/06376.gif
  31. BIN  demo/core/menu/icons/06850.gif
  32. BIN  demo/core/menu/icons/06851.gif
  33. BIN  demo/core/menu/icons/06852.gif
  34. BIN  demo/core/menu/icons/06853.gif
  35. BIN  demo/core/menu/icons/06854.gif
  36. BIN  demo/core/menu/icons/06858.gif
  37. BIN  demo/core/menu/icons/06862.gif
  38. BIN  demo/core/menu/icons/07007.gif
  39. BIN  demo/core/menu/icons/07133.gif
  40. BIN  demo/core/menu/icons/07166.gif
  41. BIN  demo/core/menu/icons/07176.gif
  42. BIN  demo/core/menu/icons/07493.gif
  43. BIN  demo/core/menu/icons/07728.gif
  44. BIN  demo/core/menu/icons/07879.gif
  45. BIN  demo/core/menu/icons/07994.gif
  46. BIN  demo/core/menu/icons/09002.gif
  47. BIN  demo/core/menu/icons/09151.gif
  48. BIN  demo/core/menu/icons/09432.gif
  49. BIN  demo/core/menu/icons/09435.gif
  50. BIN  demo/core/menu/icons/09553.gif
  51. BIN  demo/core/menu/icons/09582.gif
  52. BIN  demo/core/menu/icons/09986.gif
  53. BIN  demo/core/menu/icons/10030.gif
  54. BIN  demo/core/menu/icons/browserLogo.jpg
  55. BIN  demo/core/menu/icons/me.jpg
  56. BIN  demo/core/menu/icons/software_256.png
  57. BIN  demo/core/menu/icons/tools.jpg
  58. BIN  demo/core/menu/icons/webtools.jpg
  59. BIN  demo/core/menu/images/arrow.gif
  60. BIN  demo/core/menu/images/hover.gif
  61. BIN  demo/core/menu/images/hoverDisabled.gif
  62. BIN  demo/core/menu/images/leftLine.gif
  63. BIN  demo/core/menu/images/splitLine.gif
  64. +57 −0 demo/core/menu/index.htm
  65. +160 −0 demo/core/menu/menu.css
  66. +222 −0 demo/core/menu/provider.js
  67. +2 −0  demo/data/tree.xml
  68. +0 −1  demo/index.htm
  69. +0 −129 index.htm
  70. +129 −12 index.html
View
12 __index.html
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>test</title>
+ </head>
+ <body>
+ <header class="header">
+ <h1>Hello Git!</h1>
+ </header>
+ </body>
+</html>
View
442 demo/core/H5Calendar/calendar.css
@@ -0,0 +1,442 @@
+.ace_calendar {
+ position:relative;
+ cursor:default;
+ -webkit-user-select: none;
+ -webkit-touch-callout: none;
+ font:400 12px/18px "SimSun", "Arial Narrow", "STHeiti", "Microsoft YaHei", "宋体", "Arial";
+ overflow:hidden;
+}
+
+.ace_calendar .ace_calendar_calendarBox {
+}
+.ace_calendar .ace_calendar_calendarBox .ace_calendar_head {
+ position:relative;
+ height:45px;
+ border-bottom: 1px solid #D9D9D9;
+ border-right:1px solid #CECECE;
+ background: -webkit-gradient(linear, left top, left bottom, from(#FFFFFF), color-stop(0.5,#F7F7F7),color-stop(0.5,#F0F0F0), to(#FEFEFE));
+}
+.ace_calendar .ace_calendar_calendarBox .ace_calendar_head .ace_calendar_mainPreButton {
+ position:absolute;
+ left:50%;
+ top:4px;
+ width:15px;
+ height:15px;
+ margin-left:-65px;
+
+ color:#656565;
+ font-family:Webdings;
+ text-align:center;
+ line-height:15px;
+
+ border-radius: 3px;
+ border:1px solid transparent;
+ cursor: pointer;
+
+ font-size:16px;
+ line-height: 12px;
+}
+.ace_calendar .ace_calendar_calendarBox .ace_calendar_head .ace_calendar_mainPreButton:hover {
+ background-image: -webkit-gradient(linear,0% 0%,0% 100%,from(#11B8FF),to(#0187FF));
+ border:1px solid #006CFF;
+ color:#FFF;
+ box-shadow:inset 0 0 2px #FFFFFF;
+}
+.ace_calendar .ace_calendar_calendarBox .ace_calendar_head .ace_calendar_mainPreButton:active {
+ color: #000;
+}
+.ace_calendar .ace_calendar_calendarBox .ace_calendar_head .ace_calendar_mainTitle {
+ position:absolute;
+ left:50%;
+ top:3px;
+ width:80px;
+ height:18px;
+ text-align:center;
+
+ margin-left:-40px;
+ color:#656565;
+ text-shadow: 1px 1px 0 #FFF;
+
+ border-radius: 3px;
+ border:1px solid transparent;
+ cursor: pointer;
+
+ -webkit-transition:opacity .2s ease-out;
+ opacity:1;
+}
+.ace_calendar .ace_calendar_calendarBox .ace_calendar_head .ace_calendar_mainTitle.flip {
+}
+.ace_calendar .ace_calendar_calendarBox .ace_calendar_head .ace_calendar_mainTitle:hover {
+ background-image: -webkit-gradient(linear,0% 0%,0% 100%,from(#11B8FF),to(#0187FF));
+ border:1px solid #006CFF;
+ color:#FFF;
+ box-shadow:inset 0 0 2px #FFFFFF;
+ text-shadow: none;
+}
+.ace_calendar .ace_calendar_calendarBox .ace_calendar_head .ace_calendar_mainTitle:active {
+ color: #000;
+}
+
+.ace_calendar .ace_calendar_calendarBox .ace_calendar_head .ace_calendar_mainNextButton {
+ position:absolute;
+ right:50%;
+ top:4px;
+ width:15px;
+ height:15px;
+ margin-right:-65px;
+
+ color:#656565;
+ font-family:Webdings;
+ text-align:center;
+ line-height:15px;
+
+ border-radius: 3px;
+ border:1px solid transparent;
+ cursor: pointer;
+
+ font-size:16px;
+ line-height: 12px;
+}
+.ace_calendar .ace_calendar_calendarBox .ace_calendar_head .ace_calendar_mainNextButton:hover {
+ background-image: -webkit-gradient(linear,0% 0%,0% 100%,from(#11B8FF),to(#0187FF));
+ border:1px solid #006CFF;
+ color:#FFF;
+ box-shadow:inset 0 0 2px #FFFFFF;
+}
+.ace_calendar .ace_calendar_calendarBox .ace_calendar_head .ace_calendar_mainNextButton:active {
+ color: #000;
+}
+
+.ace_calendar .ace_calendar_calendarBox .ace_calendar_head .ace_calendar_weekBox {
+ position:absolute;
+ top:25px;
+ left:0;
+ right:0;
+ height:20px;
+}
+.ace_calendar .ace_calendar_calendarBox .ace_calendar_head .ace_calendar_weekBox .ace_calendar_weekItem {
+ float:left;
+ height:20px;
+ text-align:center;
+ color:#656565;
+ text-shadow: 1px 1px 0 #FFF;
+}
+
+.ace_calendar .ace_calendar_calendarBox .ace_calendar_body {
+ overflow:hidden;
+ position: relative;
+}
+.ace_calendar .ace_calendar_calendarBox .ace_calendar_body .ace_calendar_bodyBox {
+ position: absolute;
+ top:0;
+ left:0;
+}
+.ace_calendar .ace_calendar_calendarBox .ace_calendar_body .ace_calendar_bodyBox.moving {
+ -webkit-transition: top .3s ease-in;
+}
+.ace_calendar .ace_calendar_calendarBox .ace_calendar_body .ace_calendar_listBox {
+ overflow:hidden;
+}
+.ace_calendar .ace_calendar_calendarBox .ace_calendar_body .ace_calendar_listBox .ace_calendar_dateItem {
+ float:left;
+ text-align:center;
+ height:32px;
+ line-height: 32px;
+ background-color:#F1F1F1;
+ border-width: 1px;
+ border-color: #FEFEFE #D9D9D9 #D9D9D9 #FEFEFE;
+ border-style:solid;
+
+ font-family: Serif;
+ color:#656565;
+ /*text-shadow: 1px 1px 0 #EBEBED;*/
+
+ cursor: pointer;
+}
+.ace_calendar .ace_calendar_calendarBox .ace_calendar_body .ace_calendar_listBox .ace_calendar_dateItem.otherRow {
+ background-color:#FFF;
+}
+.ace_calendar .ace_calendar_calendarBox .ace_calendar_body .ace_calendar_listBox .ace_calendar_dateItem:hover {
+ /*background: -webkit-gradient(linear,0% 0%,0% 100%,from(#72B1EF),color-stop(0.5,#2B8AE7),color-stop(0.5,#0072E2),to(#0072E2));*/
+ background: #FFF;
+ border:1px solid #00A9FF;
+ box-shadow:inset 0 0 1px #00A9FF;
+}
+.ace_calendar .ace_calendar_calendarBox .ace_calendar_body .ace_calendar_listBox .ace_calendar_dateItem.otherMonth {
+ color:#C7C7C7;
+}
+.ace_calendar .ace_calendar_calendarBox .ace_calendar_body .ace_calendar_listBox .ace_calendar_dateItem.current {
+ background-image: -webkit-gradient(linear,0% 0%,0% 100%,from(#11B8FF),to(#0187FF));
+ border:1px solid #006CFF;
+ color:#FFF;
+ box-shadow:inset 0 0 2px #FFFFFF;
+}
+.ace_calendar .ace_calendar_calendarBox .ace_calendar_body .ace_calendar_listBox .ace_calendar_dateItem.now {
+ background-color:#DFE0E0;
+ border:1px solid #AAA9A9;
+ box-shadow:inset 0 2px 6px #AAA9A9;
+}
+.ace_calendar .ace_calendar_calendarBox .ace_calendar_body .ace_calendar_listBox .ace_calendar_dateItem.now:hover {
+ background: #FFF;
+ border:1px solid #00A9FF;
+ box-shadow:inset 0 0 1px #00A9FF;
+}
+.ace_calendar .ace_calendar_calendarBox .ace_calendar_body .ace_calendar_listBox .ace_calendar_dateItem.hasData {
+ background-image:url(dot.png);
+ background-position: right bottom;
+ background-repeat:no-repeat;
+}
+.ace_calendar .ace_calendar_calendarBox .ace_calendar_body .ace_calendar_listBox .ace_calendar_dateItem.hasData:hover {
+ /*background-image:url(dot.png), -webkit-gradient(linear,0% 0%,0% 100%,from(#72B1EF),color-stop(0.5,#2B8AE7),color-stop(0.5,#0072E2),to(#0072E2));*/
+ background-image:url(dot.png);
+}
+.ace_calendar .ace_calendar_calendarBox .ace_calendar_body .ace_calendar_listBox .ace_calendar_dateItem.now.hasData {
+ background-color:#DFE0E0;
+ border:1px solid #AAA9A9;
+ box-shadow:inset 0 2px 6px #AAA9A9;
+ background-image:url(dot.png);
+ background-position: right bottom;
+ background-repeat:no-repeat;
+}
+.ace_calendar .ace_calendar_calendarBox .ace_calendar_body .ace_calendar_listBox .ace_calendar_dateItem.now.hasData:hover {
+ background-color:#FFF;
+ border:1px solid #00A9FF;
+ box-shadow:inset 0 0 1px #00A9FF;
+}
+.ace_calendar .ace_calendar_calendarBox .ace_calendar_body .ace_calendar_listBox .ace_calendar_dateItem.current.hasData {
+ /*background-image:url(dot.png), -webkit-gradient(linear,0% 0%,0% 100%,from(#72B1EF),color-stop(0.5,#2B8AE7),color-stop(0.5,#0072E2),to(#0072E2));*/
+ background-image:url(dot.png), -webkit-gradient(linear,0% 0%,0% 100%,from(#11B8FF),to(#0187FF));
+ background-position: right bottom;
+ background-repeat:no-repeat;
+ border:1px solid #006CFF;
+ color:#FFF;
+ box-shadow:inset 0 0 2px #FFFFFF;
+}
+.ace_calendar .ace_calendar_calendarBox .ace_calendar_body .ace_calendar_listBox .ace_calendar_dateItem.current.hasData:hover {
+ box-shadow:inset 0 0 2px #FFFFFF;
+ border:1px solid #006CFF;
+}
+.ace_calendar .ace_calendar_calendarBox .ace_calendar_body .ace_calendar_listBox .ace_calendar_dateItem.now.current {
+ background-image: -webkit-gradient(linear,0% 0%,0% 100%,from(#11B8FF),to(#0187FF));
+ border:1px solid #006CFF;
+ color:#FFF;
+ box-shadow:inset 0 0 2px #FFFFFF;
+}
+
+.ace_calendar .ace_calendar_calendarBox .ace_calendar_timebody {
+
+}
+.ace_calendar .ace_calendar_calendarBox .ace_calendar_root {
+ height:24px;
+ background:#FFF;
+ overflow:hidden;
+ border-right:1px solid #CECECE;
+}
+.ace_calendar .ace_calendar_calendarBox .ace_calendar_root .ace_calendar_todayButton {
+ width:50px;
+ height:18px;
+ margin: 2px auto 0 auto;
+ cursor: pointer;
+ text-align:center;
+ color:#656565;
+
+ border-radius: 3px;
+ border:1px solid transparent;
+ cursor: pointer;
+}
+.ace_calendar .ace_calendar_calendarBox .ace_calendar_root .ace_calendar_todayButton:hover {
+ background-image: -webkit-gradient(linear,0% 0%,0% 100%,from(#11B8FF),to(#0187FF));
+ border:1px solid #006CFF;
+ color:#FFF;
+ box-shadow:inset 0 0 2px #FFFFFF;
+}
+.ace_calendar .ace_calendar_calendarBox .ace_calendar_root .ace_calendar_todayButton:active {
+ color: #000;
+}
+
+/* 年月选择图层 */
+.ace_calendar .ace_calendar_selectBox {
+ position:absolute;
+ left:0;
+ right:0;
+ top:0;
+ bottom:0;
+ z-index:2;
+
+ background: -webkit-gradient(linear, left top, left bottom, from(#FFFFFF), color-stop(0.3,#F7F7F7),color-stop(0.7,#F0F0F0), to(#FEFEFE));
+
+ -webkit-transition:-webkit-transform .25s ease-out, opacity .25s ease-out;
+ -webkit-transform:Scale(0);
+ opacity: 0;
+
+ border-right: 1px solid #CECECE;
+
+ color: #656565;
+}
+.ace_calendar .ace_calendar_selectBox.show {
+ -webkit-transform:Scale(1);
+ opacity: 1;
+}
+
+
+/* 选择图层上方容器 */
+.ace_calendar .ace_calendar_selectBox .ace_calendar_yearMonthHeadBox {
+ height:30px;
+ text-align:center;
+}
+.ace_calendar .ace_calendar_selectBox .ace_calendar_yearMonthHeadBox .ace_calendar_yearMonthHead {
+ display:inline-block;
+ padding:0 10px;
+ margin:3px auto 0 auto;
+ cursor:pointer;
+ height:18px;
+ line-height:18px;
+ border-radius: 3px;
+ border:1px solid transparent;
+ text-align:center;
+
+ -webkit-transition:-webkit-transform .2s ease-out;
+ -webkit-transform:rotateX(0deg);
+ -webkit-transform:rotateY(0deg);
+}
+.ace_calendar .ace_calendar_selectBox .ace_calendar_yearMonthHeadBox .ace_calendar_yearMonthHead.flip {
+ -webkit-transform:rotateX(90deg);
+}
+.ace_calendar .ace_calendar_selectBox .ace_calendar_yearMonthHeadBox .ace_calendar_yearMonthHead.vflip {
+ -webkit-transform:rotateY(90deg);
+}
+.ace_calendar .ace_calendar_selectBox .ace_calendar_yearMonthHeadBox .ace_calendar_yearMonthHead:hover {
+ background-image: -webkit-gradient(linear,0% 0%,0% 100%,from(#11B8FF),to(#0187FF));
+ border:1px solid #006CFF;
+ color:#FFF;
+ box-shadow:inset 0 0 2px #FFFFFF;
+}
+.ace_calendar .ace_calendar_selectBox .ace_calendar_yearMonthHeadBox .ace_calendar_yearMonthHead:active {
+ color: #000;
+}
+
+/* 选择图层中年份前后按钮 */
+.ace_calendar .ace_calendar_selectBox .ace_calendar_yearMonthHeadBox .ace_calendar_yearMonthPreButton {
+ position:absolute;
+ left:50%;
+ top:3px;
+ width:16px;
+ height:16px;
+
+ margin-left:-65px;
+
+ color:#545454;
+ font-family:Webdings;
+ text-align:center;
+ line-height:12px;
+
+ border-radius: 3px;
+ border:1px solid transparent;
+ cursor: pointer;
+
+ font-size:16px;
+}
+.ace_calendar .ace_calendar_selectBox .ace_calendar_yearMonthHeadBox .ace_calendar_yearMonthPreButton:hover {
+ background-image: -webkit-gradient(linear,0% 0%,0% 100%,from(#11B8FF),to(#0187FF));
+ border:1px solid #006CFF;
+ color:#FFF;
+ box-shadow:inset 0 0 2px #FFFFFF;
+}
+.ace_calendar .ace_calendar_selectBox .ace_calendar_yearMonthHeadBox .ace_calendar_yearMonthPreButton:active {
+ color: #000;
+}
+
+.ace_calendar .ace_calendar_selectBox .ace_calendar_yearMonthHeadBox .ace_calendar_yearMonthNextButton {
+ position:absolute;
+ right:50%;
+ top:3px;
+ width:16px;
+ height:16px;
+
+ margin-right:-65px;
+
+ color:#545454;
+ font-family:Webdings;
+ text-align:center;
+ line-height:12px;
+
+ border-radius: 3px;
+ border:1px solid transparent;
+ cursor: pointer;
+
+ font-size:16px;
+}
+.ace_calendar .ace_calendar_selectBox .ace_calendar_yearMonthHeadBox .ace_calendar_yearMonthNextButton:hover {
+ background-image: -webkit-gradient(linear,0% 0%,0% 100%,from(#11B8FF),to(#0187FF));
+ border:1px solid #006CFF;
+ color:#FFF;
+ box-shadow:inset 0 0 2px #FFFFFF;
+}
+.ace_calendar .ace_calendar_selectBox .ace_calendar_yearMonthHeadBox .ace_calendar_yearMonthNextButton:active {
+ color: #000;
+}
+
+
+/* 选择图层内容 */
+.ace_calendar .ace_calendar_selectBox .ace_calendar_yearMonthListBox {
+ position:absolute;
+ left:0;
+ top:30px;
+ right:0;
+ bottom:0;
+ -webkit-transition:-webkit-transform .2s ease-out, opacity .2s ease-out;
+ -webkit-transform:Scale(1);
+ -webkit-transform:rotateY(0deg);
+ opacity: 1;
+}
+.ace_calendar .ace_calendar_selectBox .ace_calendar_yearMonthListBox.zoomout {
+ -webkit-transition:-webkit-transform .2s ease-out, opacity .2s ease-out;
+ -webkit-transform:Scale(2);
+ opacity: 0;
+}
+.ace_calendar .ace_calendar_selectBox .ace_calendar_yearMonthListBox.zoomin {
+ -webkit-transition:-webkit-transform .2s ease-out, opacity .2s ease-out;
+ -webkit-transform:Scale(.1);
+ opacity: 0;
+}
+.ace_calendar .ace_calendar_selectBox .ace_calendar_yearMonthListBox.flip {
+ -webkit-transform:rotateY(90deg);
+}
+.ace_calendar .ace_calendar_selectBox .ace_calendar_yearMonthListBox .ace_calendar_selectListItem {
+ text-align:center;
+ border-radius: 3px;
+ border:1px solid transparent;
+ cursor: pointer;
+ margin:20px 5px 10px 5px;
+ height:35px;
+ line-height:34px;
+ float:left;
+}
+.ace_calendar .ace_calendar_selectBox .ace_calendar_yearMonthListBox .ace_calendar_selectListItem.part {
+ word-break: break-all;
+ white-space:pre-wrap;
+ line-height:18px;
+}
+.ace_calendar .ace_calendar_selectBox .ace_calendar_yearMonthListBox .ace_calendar_selectListItem:hover {
+ border:1px solid #00A9FF;
+ box-shadow:inset 0 0 1px #00A9FF;
+ background: #FFF;
+}
+.ace_calendar .ace_calendar_selectBox .ace_calendar_yearMonthListBox .ace_calendar_selectListItem.current {
+ background-image: -webkit-gradient(linear,0% 0%,0% 100%,from(#11B8FF),to(#0187FF));
+ border:1px solid #006CFF;
+ color: #FFF;
+ box-shadow:inset 0 0 2px #FFFFFF;
+}
+.ace_calendar .ace_calendar_selectBox .ace_calendar_yearMonthListBox .ace_calendar_selectListItem.now {
+ background:#DFE0E0;
+ border:1px solid #AAA9A9;
+ box-shadow:inset 0 2px 6px #AAA9A9;
+ color: #656565;
+}
+.ace_calendar .ace_calendar_selectBox .ace_calendar_yearMonthListBox .ace_calendar_selectListItem.now:hover {
+ border:1px solid #00A9FF;
+ box-shadow:inset 0 0 1px #00A9FF;
+ background: #FFF;
+}
+
View
50 demo/core/H5Calendar/calendar.htm
@@ -0,0 +1,50 @@
+<!Doctype HTML>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <title>日历</title>
+ <script type="text/javascript" src="http://img.baidu.com/js/tangram-base-core-1.3.9.js"></script>
+ <script type="text/javascript" src="calendar.js"></script>
+ <link rel="stylesheet" href="calendar.css"/>
+ <style>
+ body {
+ font:400 12px/20px 宋体;
+ background-color:#FFF;
+ }
+ </style>
+ <script>
+ try {
+ document.execCommand("BackgroundImageCache", false, true);
+ } catch (ex) {
+ }
+ </script>
+
+ </head>
+ <body>
+ <div id="cc" style="width:238px; display:inline-block; border:1px solid #CECECE;border-right:0;box-shadow:0 0 10px #CECECE;"></div>
+ <script>
+ var render = document.getElementById('cc');
+ var calendar = new AceCalendar({render: render});
+
+ var hasDataList = [
+ '2011/07/03'
+ ,'2011/07/05'
+ ,'2011/07/09'
+ ,'2011/07/12'
+ ,'2011/06/27'
+ ,'2011/08/03'
+ ];
+
+ calendar.onMonthChange = function(year, month){
+ if(year == 2011 && month == 7){
+ calendar.updateDate(hasDataList);
+ }
+ }
+ calendar.onSelectData = function(info){
+ var year = info.year, month = info.month, date = info.date;
+ var dateString = info.string;
+ }
+
+ </script>
+ </body>
+</html>
View
945 demo/core/H5Calendar/calendar.js
@@ -0,0 +1,945 @@
+/**
+ * @author 史纯华(shichunhua)
+ * @fileoverview webkit日历控件
+ * 需要调用tangram
+ * AceCalendar 提供接口(方法) 具体参数见对应方法注释:
+ * @version 1.0.0.0
+ */
+
+/**
+ * AceCalendar构造函数
+ * @param {Object} params 参数:
+ * {HTMLElement} render 容器
+ * {Int} width 控件的宽度
+ * {String} [pattern] 日期格式 默认 yyyy/MM/dd hh:mm:ss
+ * {String} [initiation] 默认日期(时间) 默认取系统日期(时间)
+ * {Boolean} [showTime] 是否显示时间 默认为false
+ * {Boolean} [showFuture] 是否可选取未来日期 默认true
+ * {Boolean} [showPast] 是否可选取过去日期 默认true
+ * {Boolean} [atwill] 是否随意选取日期 即是否有选择限制 默认为false
+ * {Array} [allowList] 如果有选取限制, 给出哪些日期是可选的 格式同pattern中指定的
+ */
+if(!ace){
+ var ace = baidu || T;
+}
+function AceCalendar(params){
+ this._params = params;
+ this._render = params.render;
+ this._width = params.width || 238;
+ this._showTime = params.showTime != null ? params.showTime : false;
+ this._pattern = params.pattern || (this._showTime ? 'yyyy/MM/dd hh:mm:ss' : 'yyyy/MM/dd');
+ this._initiation = this._getCurrentTime(params.initiation);
+ this._now = this._getCurrentTime();
+ this._showFuture = params.showFuture != null ? params.showFuture : true;
+ this._showPast = params.showPast != null ? params.showPast : true;
+ this._atwill = params.atwill != null ? params.atwill : true;
+ this._allowList = params.allowList;
+
+ this._weekArr = ['', '', '', '', '', '', ''];
+ this._monthArr = ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'];
+
+ this._moveTop = null;
+
+ this._selectInfo = {
+ step: ['month', 'year', 'yearpart', 'yearbigpart']
+ };
+
+ this._tempDate = {
+ target: [],
+ year: null,
+ month: null,
+ date: null
+ };
+
+ this._init();
+}
+
+AceCalendar.prototype = {
+ /**
+ * 初始化
+ */
+ _init: function(){
+ this._buildDom();
+ this._addEvent();
+ },
+ /**
+ * 创建DOM对象
+ * @param {Object} tagName
+ * @param {Object} params
+ */
+ $C: function(tagName, params){
+ var elm = document.createElement(tagName);
+ for(var item in params){
+ if(item == 'className'){
+ elm.className = params[item];
+ }else if(item == 'innerHTML'){
+ elm.innerHTML = params[item];
+ }else{
+ elm.setAttribute(item, params[item]);
+ }
+ }
+ return elm;
+ },
+ /**
+ * 添加DOM对象
+ * @param {Object} cNode
+ * @param {Object} pNode
+ */
+ $A: function(cNode, pNode){
+ return pNode != null ? pNode.appendChild(cNode) : document.body.appendChild(cNode);
+ },
+ /**
+ * 移除DOM对象
+ * @param {Object} cNode
+ */
+ $R: function(cNode){
+ return cNode.parentNode.removeChild(cNode);
+ },
+
+ /**
+ * 获取当前日期和时间
+ */
+ _getCurrentTime: function(dateStr){
+ var d = dateStr ? this._getTimeByString(dateStr) : new Date();
+ return {
+ year: d.getUTCFullYear(),
+ month: d.getMonth() + 1,
+ date: d.getDate(),
+ week: d.getDay(),
+ hour: d.getHours(),
+ minute: d.getMinutes(),
+ second: d.getSeconds()
+ }
+ },
+
+ /**
+ * 通过字符串取日期对象
+ */
+ _getTimeByString: function(dateStr){
+ var year = dateStr.substring(this.parten.indexOf("yyyy"),this.parten.lastIndexOf("yyyy")+4);
+ var month = dateStr.substring(this.parten.indexOf("MM"),this.parten.lastIndexOf("MM")+2);
+ var date = dateStr.substring(this.parten.indexOf("dd"),this.parten.lastIndexOf("dd")+2);
+
+ var hour = dateStr.substring(this.parten.indexOf("hh"),this.parten.lastIndexOf("hh")+2);
+ var minute = dateStr.substring(this.parten.indexOf("mm"),this.parten.lastIndexOf("mm")+2);
+ var second = dateStr.substring(this.parten.indexOf("ss"),this.parten.lastIndexOf("ss")+2);
+
+ var nDate = this._showTime ?
+ new Date(Number(year), Number(month) - 1, Number(date), Number(hour), Number(minute), Number(second))
+ : new Date(Number(year), Number(month) - 1, Number(date));
+
+ if(isNaN(nDate)) {
+ nDate = new Date();
+ }
+ return nDate;
+ },
+
+ /**
+ * 获取双位字符
+ */
+ _toDoubleString: function(s){
+ s = Number(s);
+ if(s < 10){
+ return '0' + s;
+ }else{
+ return s.toString();
+ }
+ },
+
+ /**
+ * 构建日历所需要的DOM结构
+ */
+ _buildDom: function(){
+ // 主容器
+ this._mainBox = this.$C('div', {'className': 'ace_calendar'});
+ this.$A(this._mainBox, this._render);
+
+ // 日历内容容器
+ this._contentBox = this.$C('div', {'className': 'ace_calendar_calendarBox'});
+ this.$A(this._contentBox, this._mainBox);
+
+ // 年份月份选择容器
+ this._selectBox = this.$C('div', {'className': 'ace_calendar_selectBox'});
+ this.$A(this._selectBox, this._mainBox);
+ ace.hide(this._selectBox);
+
+ // 实体头部
+ this._head = this.$C('div', {'className': 'ace_calendar_head'});
+ this.$A(this._head, this._contentBox);
+
+ // 实体的body
+ this._body = this.$C('div', {'className': 'ace_calendar_body'});
+ this.$A(this._body, this._contentBox);
+
+ // 动画容器
+ this._bodyBox = this.$C('div', {'className': 'ace_calendar_bodyBox'});
+ this.$A(this._bodyBox, this._body);
+
+ // 实体的时间选择
+ this._timebody = this.$C('div', {'className': 'ace_calendar_timebody'});
+ this.$A(this._timebody, this._contentBox);
+
+ // 实体的底部
+ this._root = this.$C('div', {'className': 'ace_calendar_root'});
+ this.$A(this._root, this._contentBox);
+
+ this._buildHead();
+ this._buildBody();
+ this._buildTime();
+ this._buildRoot();
+ this._buildSelectBox();
+ },
+
+ /**
+ * 构建头部信息
+ */
+ _buildHead: function(){
+ this._mainPreButton = this.$C('div', {'className': 'ace_calendar_mainPreButton'});
+ this._mainPreButton.innerHTML = '3';
+ this.$A(this._mainPreButton, this._head);
+
+ this._mainTitle = this.$C('div', {'className': 'ace_calendar_mainTitle'});
+ this.$A(this._mainTitle, this._head);
+ this._setHead(this._initiation.year, this._initiation.month);
+
+ this._mainNextButton = this.$C('div', {'className': 'ace_calendar_mainNextButton'});
+ this._mainNextButton.innerHTML = '4';
+ this.$A(this._mainNextButton, this._head);
+
+
+ this._weekBox = this.$C('div', {'className': 'ace_calendar_weekBox'});
+ this.$A(this._weekBox, this._head);
+
+ this._buildWeek();
+ },
+
+ /**
+ * 构建实体内容信息
+ */
+ _buildBody: function(){
+ // 动画月的容器
+ this._monthBox = this.$C('div', {'className': 'ace_calendar_listBox'});
+ this.$A(this._monthBox, this._bodyBox);
+
+ this._effectMonthBox = this.$C('div', {'className': 'ace_calendar_listBox'});
+ this.$A(this._effectMonthBox, this._bodyBox);
+
+ this._showDateList(this._monthBox, this._initiation.year, this._initiation.month);
+
+ ace.setStyles(this._body, {
+ 'width': this._width + 'px'
+ ,'height': this._monthBox.clientHeight + 'px'
+ });
+ ace.setStyles(this._effectMonthBox, {
+ 'height': this._monthBox.clientHeight
+ });
+
+ ace.setStyles(this._bodyBox, {
+ 'width': this._width + 'px'
+ ,'height': this._monthBox.clientHeight * 2 + 'px'
+ });
+
+ this._moveTop = 0;
+
+ var me = this;
+ setTimeout(function(){
+ me.onMonthChange(me._initiation.year, me._initiation.month);
+ }, 20);
+ },
+
+ /**
+ * 显示月份的日期列表
+ */
+ _showDateList: function(container, year, month) {
+ container.innerHTML = '';
+ var list = this._getMonthDayList(year, month),
+ theDaysInMonth = new Date(year, month, 0).getDate(),
+ w = (this._width / this._weekArr.length).toFixed(2);
+
+ for (var i = 1; i < 7; i++) {
+ for (var j = 0; j < 7; j++) {
+ var dateInfo = this._getDateInfo(year, month, list[i][j]),
+ dataStr = dateInfo.year + '-' + dateInfo.month + '-' + dateInfo.date;
+ var item = this.$C('div', {
+ className: i % 2 == 0 ? 'ace_calendar_dateItem' : 'ace_calendar_dateItem otherRow',
+ innerHTML: dateInfo.date,
+ 'data-date': dataStr
+ });
+ ace.setStyles(item, {
+ 'width': w - 2 + 'px'
+ });
+ if(list[i][j] < 1 || list[i][j] > theDaysInMonth){
+ ace.addClass(item, 'otherMonth');
+ }
+ if(dateInfo.year == this._now.year && dateInfo.month == this._now.month && dateInfo.date == this._now.date){
+ ace.addClass(item, 'now');
+ }
+ if(dateInfo.year == this._tempDate.year && dateInfo.month == this._tempDate.month && dateInfo.date == this._tempDate.date){
+ ace.addClass(item, 'current');
+ this._tempDate.target.push(item);
+ }
+ this.$A(item, container);
+ }
+ }
+ },
+
+ /**
+ * 获取某年某月的日期列表
+ */
+ _getMonthDayList: function(year, month) {
+ var aMonth = [];
+ for (i = 1; i < 7; i++) aMonth[i] = new Array(i);
+
+ var dCalDate = new Date(year, month - 1, 1);
+ var iDayOfFirst = dCalDate.getDay();
+ var iDaysInMonth = new Date(year, month, 0).getDate();
+ var iOffsetLast = new Date(year, month - 1, 0).getDate() - iDayOfFirst + 1;
+ var iDate = 1;
+ var iNext = 1;
+
+ for (d = 0; d < 7; d++) aMonth[1][d] = (d < iDayOfFirst) ? ( - iDayOfFirst + d + 1) : iDate++;
+ for (w = 2; w < 7; w++) for (d = 0; d < 7; d++) aMonth[w][d] = iDate++;
+ return aMonth;
+ },
+
+ /**
+ * 获取日期信息
+ */
+ _getDateInfo: function(year, month, date) {
+ var curDate = new Date(year, month - 1, date);
+ if (curDate.getMonth() + 1 == 1 && curDate.getDate() == 1) {
+ return {
+ year: curDate.getUTCFullYear() + 1,
+ month: curDate.getMonth() + 1,
+ date: curDate.getDate()
+ }
+ } else {
+ return {
+ year: curDate.getUTCFullYear(),
+ month: curDate.getMonth() + 1,
+ date: curDate.getDate()
+ }
+ }
+ },
+
+ /**
+ * 构建时间信息
+ */
+ _buildTime: function(){
+
+ },
+
+ /**
+ * 构建页脚信息
+ */
+ _buildRoot: function(){
+ this._todayButton = this.$C('div', {'className': 'ace_calendar_todayButton'});
+ this._todayButton.innerHTML = '今天';
+ this.$A(this._todayButton, this._root);
+ },
+
+ /**
+ * 构建年月选择图层
+ */
+ _buildSelectBox: function(){
+ if(!this._showYear){
+ this._showYear = this._initiation.year;
+ }
+ if(!this._showMonth){
+ this._showMonth = this._initiation.month;
+ }
+
+ var headBox = this.$C('div', {'className': 'ace_calendar_yearMonthHeadBox'});
+ this.$A(headBox, this._selectBox);
+
+ this._selectHead = this.$C('div', {'className': 'ace_calendar_yearMonthHead'});
+ this._selectHead.innerHTML = this._showYear;
+ this.$A(this._selectHead, headBox);
+
+ this._selectYearPreButton = this.$C('div', {'className': 'ace_calendar_yearMonthPreButton'});
+ this._selectYearPreButton.innerHTML = '3';
+ this.$A(this._selectYearPreButton, headBox);
+
+ this._selectYearNextButton = this.$C('div', {'className': 'ace_calendar_yearMonthNextButton'});
+ this._selectYearNextButton.innerHTML = '4';
+ this.$A(this._selectYearNextButton, headBox);
+
+
+ this._yearMonthListBox = this.$C('div', {'className': 'ace_calendar_yearMonthListBox'});
+ this.$A(this._yearMonthListBox, this._selectBox);
+
+
+ this._selectInfo.year = this._showYear;
+ this._selectInfo.month = this._showMonth;
+ this._selectInfo.type = this._selectInfo.step[0];
+
+ this._fillSelectMonth();
+ },
+
+ /**
+ * 填充选择图层中的月份
+ */
+ _fillSelectMonth: function(){
+ this._selectInfo.type = 'month';
+ this._yearMonthListBox.innerHTML = '';
+
+ this._selectHead.innerHTML = this._selectInfo.year;
+
+ for(var i = 0, iLen = this._monthArr.length ; i < iLen ; i ++){
+ var item = this.$C('div', {'className': 'ace_calendar_selectListItem', 'data-month': i + 1});
+ item.innerHTML = this._monthArr[i];
+ ace.setStyles(item, {
+ 'width': Math.floor(this._width/4 - 12) + 'px'
+ });
+ if(i + 1 == this._now.month && this._selectInfo.year == this._now.year){
+ ace.addClass(item, 'now');
+ }
+ if(i + 1 == this._selectInfo.month){
+ ace.addClass(item, 'current');
+ }
+ this.$A(item, this._yearMonthListBox);
+ }
+ },
+
+ /**
+ * 添加周信息的DOM
+ */
+ _buildWeek: function(){
+ var iLen = this._weekArr.length, w = (this._width/iLen).toFixed(2);
+ for(var i = 0 ; i < iLen ; i ++){
+ var item = this.$C('div', {'className': 'ace_calendar_weekItem', 'innerHTML': this._weekArr[i]});
+ this.$A(item, this._weekBox);
+ ace.setStyles(item, {'width': w + 'px'});
+ }
+
+ ace.setStyles(this._weekBox, {
+ 'width': this._width + 'px'
+ });
+ },
+
+ /**
+ * 添加日历中元素事件
+ */
+ _addEvent: function(){
+ var me = this;
+ // 主界面前后按钮
+ ace.on(this._mainPreButton, 'click', function(){
+ me._showPreMonth();
+
+ ace.addClass(me._mainTitle, 'flip');
+ setTimeout(function(){
+ ace.removeClass(me._mainTitle, 'flip');
+ }, 300);
+ });
+ ace.on(this._mainNextButton, 'click', function(){
+ me._showNextMonth();
+
+ ace.addClass(me._mainTitle, 'flip');
+ setTimeout(function(){
+ ace.removeClass(me._mainTitle, 'flip');
+ }, 300);
+ });
+
+ // 主界面年月点击
+ ace.on(this._mainTitle, 'click', function(){
+ me._showYearMonthSelect(true);
+ });
+
+ // 选择界面前后按钮
+ ace.on(this._selectYearPreButton, 'click', function(){
+ me._showSelectPreYear();
+
+ ace.addClass(me._selectHead, 'vflip');
+ ace.addClass(me._yearMonthListBox, 'flip');
+ setTimeout(function(){
+ ace.removeClass(me._yearMonthListBox, 'flip');
+ ace.removeClass(me._selectHead, 'vflip');
+ }, 300);
+ });
+ ace.on(this._selectYearNextButton, 'click', function(){
+ me._showSelectNextYear();
+
+ ace.addClass(me._selectHead, 'vflip');
+ ace.addClass(me._yearMonthListBox, 'flip');
+ setTimeout(function(){
+ ace.removeClass(me._yearMonthListBox, 'flip');
+ ace.removeClass(me._selectHead, 'vflip');
+ }, 300);
+ });
+
+ // 选择界面标题点击
+ ace.on(this._selectHead, 'click', function(){
+ ace.addClass(me._selectHead, 'flip');
+ ace.addClass(me._yearMonthListBox, 'zoomin');
+ setTimeout(function(){
+ me._fillYearList(true);
+ ace.removeClass(me._yearMonthListBox, 'zoomin');
+ ace.removeClass(me._selectHead, 'flip');
+ }, 300);
+ });
+
+ // 选择界面图层点击
+ ace.on(this._yearMonthListBox, 'click', function(e){
+ if(me._selectInfo.type == 'month'){
+ me._checkSelectYearMonth(e);
+ }else{
+ ace.addClass(me._selectHead, 'flip');
+ ace.addClass(me._yearMonthListBox, 'zoomin');
+ setTimeout(function(){
+ me._checkSelectYearMonth(e);
+ ace.removeClass(me._yearMonthListBox, 'zoomin');
+ ace.removeClass(me._selectHead, 'flip');
+ }, 300);
+ }
+ });
+
+ // 日期点击
+ ace.on(this._body, 'click', function(e){
+ if(!e.target.getAttribute('data-date')){
+ return;
+ }
+ var date = e.target.getAttribute('data-date').split('-');
+ me._tempDate.year = Number(date[0]);
+ me._tempDate.month = Number(date[1]);
+ me._tempDate.date = Number(date[2]);
+
+ me._selectInfo.date = me._tempDate.date;
+ me._selectDate(me._tempDate.year, me._tempDate.month, me._tempDate.date);
+ if(me._tempDate.target.length != 0){
+ while(me._tempDate.target.length){
+ ace.removeClass(me._tempDate.target.pop(), 'current');
+ }
+ }
+ ace.addClass(e.target, 'current');
+ me._tempDate.target.push(e.target);
+ });
+
+ // "今天"点击
+ ace.on(this._todayButton, 'click', function(e){
+ me._turnToday();
+ me._selectDate(me._now.year, me._now.month, me._now.date);
+ });
+ },
+
+ /**
+ * 显示上个月信息
+ */
+ _showPreMonth: function(){
+ var me = this;
+ ace.removeClass(this._bodyBox, 'moving');
+ ace.setStyles(me._bodyBox, {
+ 'top':0 - this._monthBox.clientHeight + 'px'
+ });
+
+ this._showDateList(this._effectMonthBox, this._showYear, this._showMonth);
+
+ this._showMonth = this._showMonth - 1;
+ if(this._showMonth < 1){
+ this._showMonth = 12;
+ this._showYear = this._showYear - 1;
+
+ if(this._showYear < 1900){
+ this._showYear = 1900;
+ }
+ }
+ this._showDateList(this._monthBox, this._showYear, this._showMonth);
+
+ setTimeout(function(){
+ ace.addClass(me._bodyBox, 'moving');
+ ace.setStyles(me._bodyBox, {
+ 'top':0 + 'px'
+ });
+ }, 10);
+
+ this._setHead(this._showYear, this._showMonth);
+
+ this._selectInfo.year = this._showYear;
+ this._selectInfo.month = this._showMonth;
+
+ this.onMonthChange(this._showYear, this._showMonth);
+ },
+
+ /**
+ * 显示下个月信息
+ */
+ _showNextMonth: function(){
+ var me = this;
+ ace.removeClass(this._bodyBox, 'moving');
+ ace.setStyles(me._bodyBox, {
+ 'top':0 + 'px'
+ });
+
+ this._showDateList(this._monthBox, this._showYear, this._showMonth);
+
+ this._showMonth = this._showMonth + 1;
+ if(this._showMonth > 12){
+ this._showMonth = 1;
+ this._showYear = this._showYear + 1;
+ }
+ this._showDateList(this._effectMonthBox, this._showYear, this._showMonth);
+
+ setTimeout(function(){
+ ace.addClass(me._bodyBox, 'moving');
+ ace.setStyles(me._bodyBox, {
+ 'top':0 - me._monthBox.clientHeight + 'px'
+ });
+ }, 10);
+
+ this._setHead(this._showYear, this._showMonth);
+
+ this._selectInfo.year = this._showYear;
+ this._selectInfo.month = this._showMonth;
+
+ this.onMonthChange(this._showYear, this._showMonth);
+ },
+
+ /**
+ * 设置头信息
+ */
+ _setHead: function(year, month){
+ this._mainTitle.innerHTML = year + '' + month + '';
+ },
+
+ /**
+ * 年月选择图层
+ */
+ _showYearMonthSelect: function(isShow, cb){
+ var me = this;
+ if(isShow){
+ ace.show(this._selectBox);
+ this._fillSelectMonth();
+ cb && cb();
+ window.setTimeout(function(){
+ ace.addClass(me._selectBox, 'show');
+ }, 10);
+ }else{
+ ace.removeClass(this._selectBox, 'show');
+ window.setTimeout(function(){
+ ace.hide(me._selectBox);
+ cb && cb();
+ }, 200);
+ }
+ /*
+ var me = this, cHeight = this._contentBox.clientHeight;
+ ace.setStyles(this._selectBox, {
+ 'top': - cHeight + 'px'
+ ,'height': cHeight + 'px'
+ });
+
+ if(isShow){
+ ace.show(this._selectBox);
+ this._fillSelectMonth();
+ }
+ var Tween = ace.ui.Tween, Easing = ace.ui.Easing, me = this;
+ isShow ? new Tween(this._selectBox, 'top', - cHeight, 0, Easing.Quad.easeOut, .2, function(){
+ cb && cb();
+ })
+ : new Tween(this._selectBox, 'top', 0, - cHeight, Easing.Quad.easeOut, .2, function(){
+ ace.hide(me._selectBox);
+ cb && cb();
+ });
+ */
+ },
+
+ /**
+ * 显示选择图层前一个年段
+ */
+ _showSelectPreYear: function(){
+ if(this._selectInfo.type == 'yearpart'){
+ this._selectInfo.type = 'year';
+ this._selectInfo.year = Number(this._selectInfo.year.toString().split('').splice(0, 2).join('') + '00') - 100;
+ if(this._selectInfo.year < 1900){
+ this._selectInfo.year = 1900;
+ }
+ this._fillYearList();
+ }else if(this._selectInfo.type == 'year'){
+ this._selectInfo.type = 'month';
+ this._selectInfo.year = this._selectInfo.year - this._selectInfo.year.toString().split('').pop() - 1 - 12;
+ if(this._selectInfo.year < 1900){
+ this._selectInfo.year = 1900;
+ }
+ this._fillYearList();
+ }else if(this._selectInfo.type == 'month'){
+ this._selectInfo.year --;
+ if(this._selectInfo.year < 1900){
+ this._selectInfo.year = 1900;
+ }
+ this._showYear = this._selectInfo.year;
+
+ this._fillSelectMonth();
+ }
+ },
+
+ /**
+ * 显示选择图层下一个年段
+ */
+ _showSelectNextYear: function(){
+ if(this._selectInfo.type == 'yearpart'){
+ this._selectInfo.type = 'year';
+ this._selectInfo.year = Number(this._selectInfo.year.toString().split('').splice(0, 2).join('') + '00') + 100;
+ if(this._selectInfo.year > 2200){
+ this._selectInfo.year = 2200;
+ }
+ this._fillYearList();
+ }else if(this._selectInfo.type == 'year'){
+ this._selectInfo.type = 'month';
+ this._selectInfo.year = this._selectInfo.year - this._selectInfo.year.toString().split('').pop() - 1 + 12;
+ if(this._selectInfo.year > 2200){
+ this._selectInfo.year = 2200;
+ }
+ this._fillYearList();
+ }else if(this._selectInfo.type == 'month'){
+ this._selectInfo.year ++;
+ if(this._selectInfo.year > 2200){
+ this._selectInfo.year = 2200;
+ }
+ this._showYear = this._selectInfo.year;
+
+ this._fillSelectMonth();
+ }
+ },
+
+ /**
+ * 填充选择图层中年份列表
+ */
+ _fillYearList: function(){
+ if(this._selectInfo.type == 'month'){
+ this._selectInfo.type = 'year';
+ }else if(this._selectInfo.type == 'year'){
+ this._selectInfo.type = 'yearpart';
+ }else if(this._selectInfo.type == 'yearpart'){
+ return;
+ }
+ this._yearMonthListBox.innerHTML = '';
+ this._selectHead.innerHTML = '';
+
+ var showYearLength, startYear, item, yearMerge;
+ if(this._selectInfo.type == 'year'){
+ showYearLength = 12;
+ startYear = this._selectInfo.year - this._selectInfo.year.toString().split('').pop() - 1;
+ this._selectHead.innerHTML = startYear + ' - ' + (startYear + showYearLength - 1);
+
+ for(var i = 0, iLen = showYearLength ; i < iLen ; i ++){
+ item = this.$C('div', {'className': 'ace_calendar_selectListItem', 'data-year': startYear + i});
+ item.innerHTML = startYear + i;
+ ace.setStyles(item, {
+ 'width': Math.floor(this._width/4 - 12) + 'px'
+ });
+ if(startYear + i == this._now.year){
+ ace.addClass(item, 'now');
+ }
+ if(startYear + i == this._selectInfo.year){
+ ace.addClass(item, 'current');
+ }
+ this.$A(item, this._yearMonthListBox);
+ }
+ }
+
+ if(this._selectInfo.type == 'yearpart'){
+ showYearLength = 11;
+ startYear = Number(this._selectInfo.year.toString().split('').splice(0, 2).join('') + '00');
+ this._selectHead.innerHTML = startYear + ' - ' + (startYear + 99);
+ yearMerge = Math.ceil(99 / showYearLength);
+
+ var sY, eY;
+ for(var i = 0, iLen = showYearLength - 1 ; i < iLen ; i ++){
+ sY = eY ? (eY + 1) : (startYear + i * yearMerge);
+ eY = eY ? eY + yearMerge + 1 : (startYear + (i + 1) * yearMerge);
+
+ item = this.$C('div', {'className': 'ace_calendar_selectListItem part', 'data-year': sY + '-' + eY});
+ item.innerHTML = sY + ' - ' + eY;
+ ace.setStyles(item, {
+ 'width': Math.floor(this._width/4 - 12) + 'px'
+ });
+ if(sY <= this._now.year && eY >= this._now.year){
+ ace.addClass(item, 'now');
+ }
+ if(sY <= this._selectInfo.year && eY >= this._selectInfo.year){
+ ace.addClass(item, 'current');
+ }
+ this.$A(item, this._yearMonthListBox);
+ }
+ }
+ },
+
+ /**
+ * 选择了年或月或年段
+ */
+ _checkSelectYearMonth: function(e){
+ if(!e.target.getAttribute('data-year') && !e.target.getAttribute('data-month')){
+ return;
+ }
+ if(this._selectInfo.type == 'yearpart'){
+ this._selectInfo.type = 'month';
+ this._selectInfo.year = Number(e.target.getAttribute('data-year').split('-')[0]);
+ this._fillYearList();
+ }else if(this._selectInfo.type == 'year'){
+ this._selectInfo.year = Number(e.target.getAttribute('data-year'));
+ this._fillSelectMonth();
+ }else if(this._selectInfo.type == 'month'){
+ this._selectInfo.month = Number(e.target.getAttribute('data-month'));
+
+ var me = this;
+ this._showYearMonthSelect(false, function(){
+ var d = new Date(me._showYear, me._showMonth, 0).valueOf(),
+ nd = new Date(me._selectInfo.year, me._selectInfo.month, 0).valueOf();
+
+ if(nd > d){
+ if(me._selectInfo.month == 1){
+ me._showYear = me._selectInfo.year - 1;
+ me._showMonth = 12;
+ }else{
+ me._showYear = me._selectInfo.year;
+ me._showMonth = me._selectInfo.month - 1;
+ }
+ me._showNextMonth();
+ }else{
+ if(me._selectInfo.month == 12){
+ me._showYear = me._selectInfo.year + 1;
+ me._showMonth = 1;
+ }else{
+ me._showYear = me._selectInfo.year;
+ me._showMonth = me._selectInfo.month + 1;
+ }
+ me._showPreMonth();
+ }
+ });
+ }
+ },
+
+ /**
+ * 转到今日
+ */
+ _turnToday: function(){
+ this._tempDate.year = this._now.year;
+ this._tempDate.month = this._now.month;
+ this._tempDate.date = this._now.date;
+
+ if(this._now.year == this._showYear && this._now.month == this._showMonth){
+ this._showDateList(this._effectMonthBox, this._showYear, this._showMonth);
+ this._showDateList(this._monthBox, this._showYear, this._showMonth);
+
+ this.onMonthChange(this._showYear, this._showMonth);
+ return;
+ }
+
+ var me = this,
+ d = new Date(me._showYear, me._showMonth, 0).valueOf(),
+ nd = new Date(me._now.year, me._now.month, 0).valueOf();
+
+ if(me._tempDate.target.length != 0){
+ while(me._tempDate.target.length){
+ ace.removeClass(me._tempDate.target.pop(), 'current');
+ }
+ }
+
+ if(nd > d){
+ if(me._now.month == 1){
+ me._showYear = me._now.year - 1;
+ me._showMonth = 12;
+ }else{
+ me._showYear = me._now.year;
+ me._showMonth = me._now.month - 1;
+ }
+ me._showNextMonth();
+ }else{
+ if(me._now.month == 12){
+ me._showYear = me._now.year + 1;
+ me._showMonth = 1;
+ }else{
+ me._showYear = me._now.year;
+ me._showMonth = me._now.month + 1;
+ }
+ me._showPreMonth();
+ }
+
+ this.onMonthChange(this._showYear, this._showMonth);
+ },
+
+ /**
+ * 更新月份数据
+ */
+ _updateDate: function(list){
+ var pDomList = this._effectMonthBox.getElementsByTagName('div'),
+ cDomList = this._monthBox.getElementsByTagName('div');
+
+ var year, month, date;
+
+ for(var i = 0 ; i < pDomList.length ; i ++){
+ var d = pDomList[i].getAttribute('data-date').split('-');
+ year = Number(d[0]);
+ month = Number(d[1]);
+ date = Number(d[2]);
+ if(this._checkInDate(list, year, month, date)){
+ ace.addClass(pDomList[i], 'hasData');
+ }
+ }
+ for(var i = 0 ; i < cDomList.length ; i ++){
+ var d = cDomList[i].getAttribute('data-date').split('-');
+ year = Number(d[0]);
+ month = Number(d[1]);
+ date = Number(d[2]);
+ if(this._checkInDate(list, year, month, date)){
+ ace.addClass(cDomList[i], 'hasData');
+ }
+ }
+ },
+
+ /**
+ * 验证是否在可选列表日期中
+ */
+ _checkInDate: function(list, year, month, date){
+ var str = this._pattern.replace('yyyy', year)
+ .replace('MM', this._toDoubleString(month))
+ .replace('M', month)
+ .replace('dd', this._toDoubleString(date))
+ .replace('d', date);
+
+ for(var i = 0 ; i < list.length ; i ++){
+ if(list[i] == str){
+ return true;
+ }
+ }
+
+ return false;
+ },
+
+ /**
+ * 选择日期
+ */
+ _selectDate: function(year, month, date){
+ var info = {
+ year: year,
+ month: month,
+ date: date,
+
+ string: this._pattern.replace('yyyy', year)
+ .replace('MM', this._toDoubleString(month))
+ .replace('M', month)
+ .replace('dd', this._toDoubleString(date))
+ .replace('d', date)
+ };
+ this.onSelectData(info);
+ },
+
+ /**
+ * 对外接口, 给出选择日期, 由调用方覆写
+ */
+ onSelectData: function(info){
+ console.log(info.string);
+ },
+
+ /**
+ * 通知外部切换月份, 以获取当月及前后各一个月数据, 做可用标识
+ */
+ onMonthChange: function(year, month){
+
+ },
+
+ /**
+ * 更新数据, 由外部调用
+ */
+ updateDate: function(list){
+ this._updateDate(list);
+ }
+}
View
BIN  demo/core/H5Calendar/dot.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
8 demo/core/SiderBar/css/SiderBar.css
@@ -11,7 +11,7 @@
padding:0px;
border:0px;
text-align:left;
- font:normal 12px Arial,宋体;
+ font:400 12px "宋体", "STHeiti", "Microsoft YaHei", "Arial";
position:static;
overflow:auto;
}
@@ -21,7 +21,6 @@
.siderBar .bar {
background:#A9A9A9 url(../images/barBg.gif) repeat-x;
- font:normal 12px Arial,宋体;
height:20px;
*height:22px;
border-bottom:1px solid #545557;
@@ -53,13 +52,11 @@
}
.siderBar .team .title {
background:#DAE7F7 url(../images/barBg.gif) 0px -42px repeat-x;
- font:normal 12px Arial,宋体;
height:22px;
border-bottom:1px solid #545557;
overflow:hidden;
}
.siderBar .team .title .teamTitle {
- font:normal 12px Arial,宋体;
height:22px;
display:-moz-inline-block;
width:150px;
@@ -70,7 +67,6 @@
padding:5px 0px 0px 3px;
}
.siderBar .team .title .teamBT {
- font:normal 12px Arial,宋体;
background:url(../images/tool-sprites.gif) 0px -240px repeat-x;
width:15px;
height:15px;
@@ -80,7 +76,6 @@
margin:4px 4px 0px 0px;
}
.siderBar .team .title .teamBT_Expand {
- font:normal 12px Arial,宋体;
background:url(../images/tool-sprites.gif) 0px -255px repeat-x;
width:15px;
height:15px;
@@ -92,7 +87,6 @@
.siderBar .team .content {
background:#FFF;
- font:normal 12px Arial,宋体;
overflow:auto;
}
.siderBar .hideLayer {
View
5 demo/core/SimpleTree/css/simpleTree.css
@@ -2,7 +2,6 @@
padding:3px;
}
.simpleTree A {
- font:normal 12px Arial,ËÎÌå;
color:#000000;
text-decoration:none;
word-break:keep-all;
@@ -13,7 +12,7 @@
padding:0px;
border:0px;
text-align:left;
- font:normal 12px Arial,ËÎÌå;
+ font:400 12px/16px "Geneva", "Arial", "Helvetica", "sans-serif", "STHeiti", "ËÎÌå";
position:static;
overflow:hidden;
}
@@ -48,7 +47,6 @@
.simpleTree .treeNodeDiv {
display:-moz-inline-block;
height:18px;
- font:normal 12px Arial,ËÎÌå;
word-break:keep-all;
white-space:nowrap;
padding-left:2px;
@@ -64,7 +62,6 @@
.simpleTree .treeNodeDiv_Select {
display:-moz-inline-block;
height:18px;
- font:normal 12px Arial,ËÎÌå;
word-break:keep-all;
white-space:nowrap;
padding-left:2px;
View
4 demo/core/SliderPicShow/example.htm
@@ -108,8 +108,8 @@
<body scroll=no>
<div class="banner">
- <input type=radio value=1 name=typeSelect checked/>XML数据
- <input type=radio value=2 name=typeSelect />JSON数据
+ <label><input type=radio value=1 name=typeSelect checked/>XML数据</label>
+ <label><input type=radio value=2 name=typeSelect />JSON数据</label>
</div>
<p>
<!-- 控件容器 开始 -->
View
4 demo/core/ajax.js
@@ -51,10 +51,10 @@
this.http.open("POST", this.url, true);
this.http.setRequestHeader("REQUEST-TYPE","xmlhttp");
- this.http.setRequestHeader("REFERER", this.url);
+ //this.http.setRequestHeader("REFERER", this.url);
this.http.setRequestHeader("CONTENT-TYPE","text/xml");
this.http.setRequestHeader("CONTENT-TYPE","application/octet-stream");
- this.http.setRequestHeader("CONTENT-LENGTH",params.length);
+ //this.http.setRequestHeader("CONTENT-LENGTH",params.length);
this.http.send(params);
}
View
3,897 demo/core/menu/ace.all.js
3,897 additions, 0 deletions not shown
View
BIN  demo/core/menu/icons/00003.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  demo/core/menu/icons/00023.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  demo/core/menu/icons/00137.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  demo/core/menu/icons/00156.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  demo/core/menu/icons/00178.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  demo/core/menu/icons/00206.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  demo/core/menu/icons/00263.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  demo/core/menu/icons/00280.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  demo/core/menu/icons/00298.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  demo/core/menu/icons/00429.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  demo/core/menu/icons/00442.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  demo/core/menu/icons/00645.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  demo/core/menu/icons/01031.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  demo/core/menu/icons/01122.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  demo/core/menu/icons/01691.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  demo/core/menu/icons/01957.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  demo/core/menu/icons/02619.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  demo/core/menu/icons/03265.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  demo/core/menu/icons/06125.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  demo/core/menu/icons/06376.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  demo/core/menu/icons/06850.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  demo/core/menu/icons/06851.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  demo/core/menu/icons/06852.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  demo/core/menu/icons/06853.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  demo/core/menu/icons/06854.gif
Diff not rendered
View
BIN  demo/core/menu/icons/06858.gif
Diff not rendered
View
BIN  demo/core/menu/icons/06862.gif
Diff not rendered
View
BIN  demo/core/menu/icons/07007.gif
Diff not rendered
View
BIN  demo/core/menu/icons/07133.gif
Diff not rendered
View
BIN  demo/core/menu/icons/07166.gif
Diff not rendered
View
BIN  demo/core/menu/icons/07176.gif
Diff not rendered
View
BIN  demo/core/menu/icons/07493.gif
Diff not rendered
View
BIN  demo/core/menu/icons/07728.gif
Diff not rendered
View
BIN  demo/core/menu/icons/07879.gif
Diff not rendered
View
BIN  demo/core/menu/icons/07994.gif
Diff not rendered
View
BIN  demo/core/menu/icons/09002.gif
Diff not rendered
View
BIN  demo/core/menu/icons/09151.gif
Diff not rendered
View
BIN  demo/core/menu/icons/09432.gif
Diff not rendered
View
BIN  demo/core/menu/icons/09435.gif
Diff not rendered
View
BIN  demo/core/menu/icons/09553.gif
Diff not rendered
View
BIN  demo/core/menu/icons/09582.gif
Diff not rendered
View
BIN  demo/core/menu/icons/09986.gif
Diff not rendered
View
BIN  demo/core/menu/icons/10030.gif
Diff not rendered
View
BIN  demo/core/menu/icons/browserLogo.jpg
Diff not rendered
View
BIN  demo/core/menu/icons/me.jpg
Diff not rendered
View
BIN  demo/core/menu/icons/software_256.png
Diff not rendered
View
BIN  demo/core/menu/icons/tools.jpg
Diff not rendered
View
BIN  demo/core/menu/icons/webtools.jpg
Diff not rendered
View
BIN  demo/core/menu/images/arrow.gif
Diff not rendered
View
BIN  demo/core/menu/images/hover.gif
Diff not rendered
View
BIN  demo/core/menu/images/hoverDisabled.gif
Diff not rendered
View
BIN  demo/core/menu/images/leftLine.gif
Diff not rendered
View
BIN  demo/core/menu/images/splitLine.gif
Diff not rendered
View
57 demo/core/menu/index.htm
@@ -0,0 +1,57 @@
+<!-- Quriks Mode -->
+<!Doctype html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <title>测试菜单</title>
+ <script type="text/javascript" src="ace.all.js"></script>
+ <script type="text/javascript" src="provider.js"></script>
+ <link rel="stylesheet" href="menu.css"/>
+ <style>
+ body {
+ font:400 12px/20px 宋体;
+ }
+ </style>
+ <script>
+ try {
+ document.execCommand("BackgroundImageCache", false, true);
+ } catch (ex) {
+ }
+ </script>
+
+ </head>
+ <body>
+ <div onclick="arrowMenu(event)" style="cursor:pointer;color:yellow;">显示菜单</div>
+
+ <p style="color:red;">
+ 点击箭头和鼠标右键试试...<br/>
+
+ 使用方法见源此HTML源文件<br/>
+ 数据使用见provider.js的注释
+ </p>
+
+ <div style="height:1500px;width:2000px;cursor:default;"></div>
+ </body>
+ <script>
+ var menu = new ace.ui.Menu(menuData);
+ function arrowMenu(e){
+ e = e || window.event;
+ menu.show(e);
+ ace.event.stop(e);
+ }
+
+ document.body.onclick = function(){
+ menu.hide();
+ }
+
+ document.oncontextmenu = function(e){
+ e = e || window.event;
+ menu.show(e);
+ return false;
+ }
+
+ menu.onclick = function(data){
+ alert(ace.json.stringify(data));
+ }
+ </script>
+</html>
View
160 demo/core/menu/menu.css
@@ -0,0 +1,160 @@
+/* 菜单样式 */
+.ace_menu .rightArrow, .ace_menu .leftArrow {
+ background-image:url(images/arrow.gif);
+ background-repeat:no-repeat;
+}
+.ace_menu a:hover.item, .ace_menu a.item.mover {
+ background-image:url(images/hover.gif);
+ background-repeat:repeat-x;
+}
+.ace_menu a:hover.item.disabled, .ace_menu a.item.disabled.dover {
+ background-image:url(images/hoverDisabled.gif);
+ background-repeat:repeat-x;
+}
+.ace_menu .menuSplit em {
+ background-image:url(images/splitLine.gif);
+ background-repeat:repeat-x;
+}
+
+.ace_menu {
+ position:absolute;
+ z-index:600;
+ background-image:url(images/leftLine.gif);
+ background-repeat:repeat-y;
+ background-position:22px top;
+ background-color:#EFEFF7;
+ border:1px solid #ADB5BD;
+ /*filter : progid:DXImageTransform.Microsoft.DropShadow(color=#66CCCCCC,offX=3,offY=3,positives=true);*/
+ box-shadow:3px 3px 0 rgba(169, 169, 169, 0.3);
+ -o-box-shadow:3px 3px 0 rgba(169, 169, 169, 0.3);
+ -moz-box-shadow:3px 3px 0 rgba(169, 169, 169, 0.3);
+ -webkit-box-shadow:3px 3px 0 rgba(169, 169, 169, 0.3);
+ padding:1px;
+ zoom:1;
+}
+.ace_menu ul {
+ color:inherit;
+ list-style-type:none;
+ margin:0;
+ padding:0;
+ z-index:inherit;
+}
+.ace_menu li {
+ display:inline;
+ float:left;
+ position:relative;
+ width:100%;
+ z-index:1;
+}
+.ace_menu div {
+ position:absolute;
+ top:0;
+ left:100%;
+ z-index:10;
+}
+.ace_menu a.item {
+ height:22px;
+ font:400 12px/22px 宋体;
+ display:block;
+ text-align:left;
+ text-decoration:none;
+ cursor:default;
+ padding:0 2px 0 2px;
+ white-space:nowrap;
+ color:#000;
+ outline:none;
+ overflow:hidden;
+ zoom:1;
+}
+.ace_menu a.item b {
+ position:absolute;
+ right:2px;
+ top:0;
+ display:inline-block;
+ width:10px;
+ height:22px;
+}
+.ace_menu a:hover.item {
+ background-color:#4284DE;
+ color:#FFFFFF;
+}
+.ace_menu a.item.mover {
+ background-color:#4284DE;
+ color:#FFFFFF;
+}
+.ace_menu a span {
+ display:inline-block;
+}
+.ace_menu a .icon {
+ font-size:1px;
+ line-height:1px;
+ width:16px;
+ height:16px;
+ cursor:default;
+ margin-top:3px;
+}
+.ace_menu a .icon.disabled {
+ filter:gray();
+ opacity:.1;
+}
+.ace_menu a .showText {
+ position:absolute;
+ left:25px;
+ top:0;
+ height:22px;
+ font:400 12px/22px 宋体;
+ text-align:left;
+ cursor:default;
+ white-space:nowrap;
+ z-index:2;
+}
+.ace_menu a .showText.fixed {
+ top:1px;
+}
+.ace_menu a .showText.disabled {
+ color:#B9B9B9;
+ /*filter: Dropshadow(color:#FFFFFF,offx=0,offy=1,Positive=1);*/
+ /*text-shadow:1px 1px 0 #FFFFFF;*/
+}
+.ace_menu a .showText.shadow {
+ left:26px;
+ top:1px;
+ color:#FFFFFF;
+ z-index:1;
+}
+.ace_menu a .showText.shadowFixed {
+ left:26px;
+ top:2px;
+ color:#FFFFFF;
+ z-index:1;
+}
+.ace_menu .menuSplit {
+ font-size:1px;
+ margin:3px 0 3px 0;
+ padding:0;
+ overflow:hidden;
+}
+.ace_menu .menuSplit em {
+ margin:0;
+ padding:0;
+ display:block;
+ height:2px;
+ margin:0 2px 0 25px;
+ font-size:2px;
+ line-height:2px;
+}
+.ace_menu a.item b.rightArrow {
+ background-position:right 7px;
+}
+.ace_menu a:hover.item b.rightArrow {
+ background-position:left -35px;
+}
+.ace_menu a.item.mover b.rightArrow {
+ background-position:left -35px;
+}
+.ace_menu a:hover.item.disabled b.rightArrow {
+ background-position:right 7px;
+}
+.ace_menu a.item.dover.disabled b.rightArrow {
+ background-position:right 7px;
+}
View
222 demo/core/menu/provider.js
@@ -0,0 +1,222 @@
+/**
+ * @author ShiChunhua
+ * @fileoverview 菜单源数据
+ * 说明 :
+ * {
+ * 'width': // 对应到同级items属性下的菜单的宽度
+ * 'items': // 菜单项
+ * [
+ * // 文字类菜单项
+ * {
+ * 'text': //'显示文字'
+ * [,'icon':] // 对应的icon 规格为16x16 的gif或浏览器可正常显示的其它格式图片
+ * [,'disabled':] // 如果值为'1' 表示该项菜单不可用 (默认可用)
+ * [,'handler':] // 点击时要执行的方法, 如果此项菜单可用, 则会执行handler
+ * [,'href':] // 此项菜单对应的链接(协议)地址 默认为'###'
+ * [,'items':] // 如果该项菜单下有子菜单, 请扩展此属性, 结构与父级items类似
+ * [,'width':] // 如果此项菜单有items属性, 则需要加上width属性, 以确定对应子菜单宽度
+ *
+ * [,'这里可以扩展任意多个任何你喜欢的属性':] // 在菜单项被点击的时候, 会执行menu.onclick (优先于handler执行), 并回传给你这个菜单项对应的JSON数据(当然包括此项...)
+ * // 注:要扩展实例后的ace.ui.Menu,
+ * // 如:var menu = new ace.ui.Menu(dataProv); menu.onclick = function(data){alert(JSON.stringify(data));}
+ * },
+ * // 间隔线
+ * {
+ * 'splitLine': true
+ * }
+ * ]
+ * }
+ */
+var menuData = {
+ 'width': 150,
+ 'items':[
+ {
+ 'text': '菜单长点又如何...?',
+ 'disabled': '1',
+ 'icon': 'icons/01957.gif'
+ },
+ {
+ 'text': 'alert("菜单")',
+ 'handler': function(){
+ alert("菜单");
+ },
+ 'href': '###',
+ 'attrs': [
+ {
+ '_moreAtt': '可加属性地菜单'
+ }
+ ],
+ 'icon': 'icons/00023.gif'
+ },
+ {
+ 'splitLine': true
+ },
+ {
+ 'text': '发送邮件',
+ 'href': 'mailto:shichunhua@baidu.com',
+ 'icon': 'icons/09553.gif'
+ },
+ {
+ 'text': '发送邮件2',
+ 'handler': function(){
+ var win = window.open('mailto:shichunhua@baidu.com');
+ try {
+ win.close();
+ }catch(ex){}
+ },
+ 'icon': 'icons/09553.gif'
+ },
+ {
+ 'text': '颜色',
+ 'width': 70,
+ 'items':[
+ {
+ 'text':'黄色',
+ 'icon': 'icons/06854.gif'
+ },
+ {
+ 'text':'绿色',
+ 'icon': 'icons/06852.gif'
+ },
+ {
+ 'text':'蓝色',
+ 'icon': 'icons/06851.gif'
+ },
+ {
+ 'text':'粉色',
+ 'icon': 'icons/06850.gif'
+ },
+ {
+ 'text':'青色',
+ 'icon': 'icons/06858.gif'
+ },
+ {
+ 'text':'灰色',
+ 'icon': 'icons/06853.gif'
+ },
+ {
+ 'splitLine': true
+ },
+ {
+ 'text': '其它',
+ 'icon': 'icons/07879.gif',
+ 'width': 130,
+ 'items': [
+ {
+ 'text': '你喜欢啥颜色',
+ 'icon': 'icons/01691.gif'
+ },
+ {
+ 'text': '自己填写么...',
+ 'icon': 'icons/09151.gif'
+ },
+ {
+ 'text': '不写? 算了',
+ 'icon': 'icons/00442.gif'
+ }
+ ]
+ }
+ ],
+ 'icon': 'icons/06862.gif'
+ },
+ {
+ 'text': '还能更多',
+ 'width': 140,
+ 'icon': 'icons/09582.gif',
+ 'items': [
+ {
+ 'text': '多了还有意思么?',
+ 'icon': 'icons/00429.gif'
+ },
+ {
+ 'text': '你说呢',
+ 'width': 90,
+ 'icon': 'icons/01122.gif',
+ 'items': [
+ {
+ 'text': '第3级?',
+ 'width': 175,
+ 'icon': 'icons/07007.gif',
+ 'items': [
+ {
+ 'text': '咋地,有疑问噢?',
+ 'icon': 'icons/07133.gif'
+ },
+ {
+ 'text': '这都第4级了耶',
+ 'icon': 'icons/07176.gif'
+ },
+ {
+ 'text': '你还可以无限级别的玩...',
+ 'icon': 'icons/00206.gif',
+ 'width': 100,