calendar.html 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>AdminLTE | Calendar</title>
  6. <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
  7. <!-- bootstrap 3.0.2 -->
  8. <link href="../css/bootstrap.min.css" rel="stylesheet" type="text/css" />
  9. <!-- font Awesome -->
  10. <link href="../css/font-awesome.min.css" rel="stylesheet" type="text/css" />
  11. <!-- Ionicons -->
  12. <link href="../css/ionicons.min.css" rel="stylesheet" type="text/css" />
  13. <!-- fullCalendar -->
  14. <link href="../css/fullcalendar/fullcalendar.css" rel="stylesheet" type="text/css" />
  15. <link href="../css/fullcalendar/fullcalendar.print.css" rel="stylesheet" type="text/css" media='print' />
  16. <!-- Theme style -->
  17. <link href="../css/AdminLTE.css" rel="stylesheet" type="text/css" />
  18. <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  19. <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  20. <!--[if lt IE 9]>
  21. <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
  22. <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
  23. <![endif]-->
  24. </head>
  25. <body class="skin-black">
  26. <!-- header logo: style can be found in header.less -->
  27. <header class="header">
  28. <a href="../index.html" class="logo">
  29. <!-- Add the class icon to your logo image or logo icon to add the margining -->
  30. AdminLTE
  31. </a>
  32. <!-- Header Navbar: style can be found in header.less -->
  33. <nav class="navbar navbar-static-top" role="navigation">
  34. <!-- Sidebar toggle button-->
  35. <a href="#" class="navbar-btn sidebar-toggle" data-toggle="offcanvas" role="button">
  36. <span class="sr-only">Toggle navigation</span>
  37. <span class="icon-bar"></span>
  38. <span class="icon-bar"></span>
  39. <span class="icon-bar"></span>
  40. </a>
  41. <div class="navbar-right">
  42. <ul class="nav navbar-nav">
  43. <!-- Messages: style can be found in dropdown.less-->
  44. <li class="dropdown messages-menu">
  45. <a href="#" class="dropdown-toggle" data-toggle="dropdown">
  46. <i class="fa fa-envelope"></i>
  47. <span class="label label-success">4</span>
  48. </a>
  49. <ul class="dropdown-menu">
  50. <li class="header">You have 4 messages</li>
  51. <li>
  52. <!-- inner menu: contains the actual data -->
  53. <ul class="menu">
  54. <li><!-- start message -->
  55. <a href="#">
  56. <div class="pull-left">
  57. <img src="../img/avatar3.png" class="img-circle" alt="User Image"/>
  58. </div>
  59. <h4>
  60. Support Team
  61. <small><i class="fa fa-clock-o"></i> 5 mins</small>
  62. </h4>
  63. <p>Why not buy a new awesome theme?</p>
  64. </a>
  65. </li><!-- end message -->
  66. <li>
  67. <a href="#">
  68. <div class="pull-left">
  69. <img src="../img/avatar2.png" class="img-circle" alt="user image"/>
  70. </div>
  71. <h4>
  72. AdminLTE Design Team
  73. <small><i class="fa fa-clock-o"></i> 2 hours</small>
  74. </h4>
  75. <p>Why not buy a new awesome theme?</p>
  76. </a>
  77. </li>
  78. <li>
  79. <a href="#">
  80. <div class="pull-left">
  81. <img src="../img/avatar.png" class="img-circle" alt="user image"/>
  82. </div>
  83. <h4>
  84. Developers
  85. <small><i class="fa fa-clock-o"></i> Today</small>
  86. </h4>
  87. <p>Why not buy a new awesome theme?</p>
  88. </a>
  89. </li>
  90. <li>
  91. <a href="#">
  92. <div class="pull-left">
  93. <img src="../img/avatar2.png" class="img-circle" alt="user image"/>
  94. </div>
  95. <h4>
  96. Sales Department
  97. <small><i class="fa fa-clock-o"></i> Yesterday</small>
  98. </h4>
  99. <p>Why not buy a new awesome theme?</p>
  100. </a>
  101. </li>
  102. <li>
  103. <a href="#">
  104. <div class="pull-left">
  105. <img src="../img/avatar.png" class="img-circle" alt="user image"/>
  106. </div>
  107. <h4>
  108. Reviewers
  109. <small><i class="fa fa-clock-o"></i> 2 days</small>
  110. </h4>
  111. <p>Why not buy a new awesome theme?</p>
  112. </a>
  113. </li>
  114. </ul>
  115. </li>
  116. <li class="footer"><a href="#">See All Messages</a></li>
  117. </ul>
  118. </li>
  119. <!-- Notifications: style can be found in dropdown.less -->
  120. <li class="dropdown notifications-menu">
  121. <a href="#" class="dropdown-toggle" data-toggle="dropdown">
  122. <i class="fa fa-warning"></i>
  123. <span class="label label-warning">10</span>
  124. </a>
  125. <ul class="dropdown-menu">
  126. <li class="header">You have 10 notifications</li>
  127. <li>
  128. <!-- inner menu: contains the actual data -->
  129. <ul class="menu">
  130. <li>
  131. <a href="#">
  132. <i class="ion ion-ios7-people info"></i> 5 new members joined today
  133. </a>
  134. </li>
  135. <li>
  136. <a href="#">
  137. <i class="fa fa-warning danger"></i> Very long description here that may not fit into the page and may cause design problems
  138. </a>
  139. </li>
  140. <li>
  141. <a href="#">
  142. <i class="fa fa-users warning"></i> 5 new members joined
  143. </a>
  144. </li>
  145. <li>
  146. <a href="#">
  147. <i class="ion ion-ios7-cart success"></i> 25 sales made
  148. </a>
  149. </li>
  150. <li>
  151. <a href="#">
  152. <i class="ion ion-ios7-person danger"></i> You changed your username
  153. </a>
  154. </li>
  155. </ul>
  156. </li>
  157. <li class="footer"><a href="#">View all</a></li>
  158. </ul>
  159. </li>
  160. <!-- Tasks: style can be found in dropdown.less -->
  161. <li class="dropdown tasks-menu">
  162. <a href="#" class="dropdown-toggle" data-toggle="dropdown">
  163. <i class="fa fa-tasks"></i>
  164. <span class="label label-danger">9</span>
  165. </a>
  166. <ul class="dropdown-menu">
  167. <li class="header">You have 9 tasks</li>
  168. <li>
  169. <!-- inner menu: contains the actual data -->
  170. <ul class="menu">
  171. <li><!-- Task item -->
  172. <a href="#">
  173. <h3>
  174. Design some buttons
  175. <small class="pull-right">20%</small>
  176. </h3>
  177. <div class="progress xs">
  178. <div class="progress-bar progress-bar-aqua" style="width: 20%" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100">
  179. <span class="sr-only">20% Complete</span>
  180. </div>
  181. </div>
  182. </a>
  183. </li><!-- end task item -->
  184. <li><!-- Task item -->
  185. <a href="#">
  186. <h3>
  187. Create a nice theme
  188. <small class="pull-right">40%</small>
  189. </h3>
  190. <div class="progress xs">
  191. <div class="progress-bar progress-bar-green" style="width: 40%" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100">
  192. <span class="sr-only">40% Complete</span>
  193. </div>
  194. </div>
  195. </a>
  196. </li><!-- end task item -->
  197. <li><!-- Task item -->
  198. <a href="#">
  199. <h3>
  200. Some task I need to do
  201. <small class="pull-right">60%</small>
  202. </h3>
  203. <div class="progress xs">
  204. <div class="progress-bar progress-bar-red" style="width: 60%" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100">
  205. <span class="sr-only">60% Complete</span>
  206. </div>
  207. </div>
  208. </a>
  209. </li><!-- end task item -->
  210. <li><!-- Task item -->
  211. <a href="#">
  212. <h3>
  213. Make beautiful transitions
  214. <small class="pull-right">80%</small>
  215. </h3>
  216. <div class="progress xs">
  217. <div class="progress-bar progress-bar-yellow" style="width: 80%" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100">
  218. <span class="sr-only">80% Complete</span>
  219. </div>
  220. </div>
  221. </a>
  222. </li><!-- end task item -->
  223. </ul>
  224. </li>
  225. <li class="footer">
  226. <a href="#">View all tasks</a>
  227. </li>
  228. </ul>
  229. </li>
  230. <!-- User Account: style can be found in dropdown.less -->
  231. <li class="dropdown user user-menu">
  232. <a href="#" class="dropdown-toggle" data-toggle="dropdown">
  233. <i class="glyphicon glyphicon-user"></i>
  234. <span>Jane Doe <i class="caret"></i></span>
  235. </a>
  236. <ul class="dropdown-menu">
  237. <!-- User image -->
  238. <li class="user-header bg-light-blue">
  239. <img src="../img/avatar3.png" class="img-circle" alt="User Image" />
  240. <p>
  241. Jane Doe - Web Developer
  242. <small>Member since Nov. 2012</small>
  243. </p>
  244. </li>
  245. <!-- Menu Body -->
  246. <li class="user-body">
  247. <div class="col-xs-4 text-center">
  248. <a href="#">Followers</a>
  249. </div>
  250. <div class="col-xs-4 text-center">
  251. <a href="#">Sales</a>
  252. </div>
  253. <div class="col-xs-4 text-center">
  254. <a href="#">Friends</a>
  255. </div>
  256. </li>
  257. <!-- Menu Footer-->
  258. <li class="user-footer">
  259. <div class="pull-left">
  260. <a href="#" class="btn btn-default btn-flat">Profile</a>
  261. </div>
  262. <div class="pull-right">
  263. <a href="#" class="btn btn-default btn-flat">Sign out</a>
  264. </div>
  265. </li>
  266. </ul>
  267. </li>
  268. </ul>
  269. </div>
  270. </nav>
  271. </header>
  272. <div class="wrapper row-offcanvas row-offcanvas-left">
  273. <!-- Left side column. contains the logo and sidebar -->
  274. <aside class="left-side sidebar-offcanvas">
  275. <!-- sidebar: style can be found in sidebar.less -->
  276. <section class="sidebar">
  277. <!-- Sidebar user panel -->
  278. <div class="user-panel">
  279. <div class="pull-left image">
  280. <img src="../img/avatar3.png" class="img-circle" alt="User Image" />
  281. </div>
  282. <div class="pull-left info">
  283. <p>Hello, Jane</p>
  284. <a href="#"><i class="fa fa-circle text-success"></i> Online</a>
  285. </div>
  286. </div>
  287. <!-- search form -->
  288. <form action="#" method="get" class="sidebar-form">
  289. <div class="input-group">
  290. <input type="text" name="q" class="form-control" placeholder="Search..."/>
  291. <span class="input-group-btn">
  292. <button type='submit' name='seach' id='search-btn' class="btn btn-flat"><i class="fa fa-search"></i></button>
  293. </span>
  294. </div>
  295. </form>
  296. <!-- /.search form -->
  297. <!-- sidebar menu: : style can be found in sidebar.less -->
  298. <ul class="sidebar-menu">
  299. <li>
  300. <a href="../index.html">
  301. <i class="fa fa-dashboard"></i> <span>Dashboard</span>
  302. </a>
  303. </li>
  304. <li>
  305. <a href="widgets.html">
  306. <i class="fa fa-th"></i> <span>Widgets</span> <small class="badge pull-right bg-green">new</small>
  307. </a>
  308. </li>
  309. <li class="treeview">
  310. <a href="#">
  311. <i class="fa fa-bar-chart-o"></i>
  312. <span>Charts</span>
  313. <i class="fa fa-angle-left pull-right"></i>
  314. </a>
  315. <ul class="treeview-menu">
  316. <li><a href="charts/morris.html"><i class="fa fa-angle-double-right"></i> Morris</a></li>
  317. <li><a href="charts/flot.html"><i class="fa fa-angle-double-right"></i> Flot</a></li>
  318. <li><a href="charts/inline.html"><i class="fa fa-angle-double-right"></i> Inline charts</a></li>
  319. </ul>
  320. </li>
  321. <li class="treeview">
  322. <a href="#">
  323. <i class="fa fa-laptop"></i>
  324. <span>UI Elements</span>
  325. <i class="fa fa-angle-left pull-right"></i>
  326. </a>
  327. <ul class="treeview-menu">
  328. <li><a href="UI/general.html"><i class="fa fa-angle-double-right"></i> General</a></li>
  329. <li><a href="UI/icons.html"><i class="fa fa-angle-double-right"></i> Icons</a></li>
  330. <li><a href="UI/buttons.html"><i class="fa fa-angle-double-right"></i> Buttons</a></li>
  331. <li><a href="UI/sliders.html"><i class="fa fa-angle-double-right"></i> Sliders</a></li>
  332. <li><a href="UI/timeline.html"><i class="fa fa-angle-double-right"></i> Timeline</a></li>
  333. </ul>
  334. </li>
  335. <li class="treeview">
  336. <a href="#">
  337. <i class="fa fa-edit"></i> <span>Forms</span>
  338. <i class="fa fa-angle-left pull-right"></i>
  339. </a>
  340. <ul class="treeview-menu">
  341. <li><a href="forms/general.html"><i class="fa fa-angle-double-right"></i> General Elements</a></li>
  342. <li><a href="forms/advanced.html"><i class="fa fa-angle-double-right"></i> Advanced Elements</a></li>
  343. <li><a href="forms/editors.html"><i class="fa fa-angle-double-right"></i> Editors</a></li>
  344. </ul>
  345. </li>
  346. <li class="treeview">
  347. <a href="#">
  348. <i class="fa fa-table"></i> <span>Tables</span>
  349. <i class="fa fa-angle-left pull-right"></i>
  350. </a>
  351. <ul class="treeview-menu">
  352. <li><a href="tables/simple.html"><i class="fa fa-angle-double-right"></i> Simple tables</a></li>
  353. <li><a href="tables/data.html"><i class="fa fa-angle-double-right"></i> Data tables</a></li>
  354. </ul>
  355. </li>
  356. <li class="active">
  357. <a href="calendar.html">
  358. <i class="fa fa-calendar"></i> <span>Calendar</span>
  359. <small class="badge pull-right bg-red">3</small>
  360. </a>
  361. </li>
  362. <li>
  363. <a href="mailbox.html">
  364. <i class="fa fa-envelope"></i> <span>Mailbox</span>
  365. <small class="badge pull-right bg-yellow">12</small>
  366. </a>
  367. </li>
  368. <li class="treeview">
  369. <a href="#">
  370. <i class="fa fa-folder"></i> <span>Examples</span>
  371. <i class="fa fa-angle-left pull-right"></i>
  372. </a>
  373. <ul class="treeview-menu">
  374. <li><a href="examples/invoice.html"><i class="fa fa-angle-double-right"></i> Invoice</a></li>
  375. <li><a href="examples/login.html"><i class="fa fa-angle-double-right"></i> Login</a></li>
  376. <li><a href="examples/register.html"><i class="fa fa-angle-double-right"></i> Register</a></li>
  377. <li><a href="examples/lockscreen.html"><i class="fa fa-angle-double-right"></i> Lockscreen</a></li>
  378. <li><a href="examples/404.html"><i class="fa fa-angle-double-right"></i> 404 Error</a></li>
  379. <li><a href="examples/500.html"><i class="fa fa-angle-double-right"></i> 500 Error</a></li>
  380. <li><a href="examples/blank.html"><i class="fa fa-angle-double-right"></i> Blank Page</a></li>
  381. </ul>
  382. </li>
  383. </ul>
  384. </section>
  385. <!-- /.sidebar -->
  386. </aside>
  387. <!-- Right side column. Contains the navbar and content of the page -->
  388. <aside class="right-side">
  389. <!-- Content Header (Page header) -->
  390. <section class="content-header">
  391. <h1>
  392. Calendar
  393. <small>Control panel</small>
  394. </h1>
  395. <ol class="breadcrumb">
  396. <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
  397. <li class="active">Calendar</li>
  398. </ol>
  399. </section>
  400. <!-- Main content -->
  401. <section class="content">
  402. <div class="row">
  403. <div class="col-md-3">
  404. <div class="box box-primary">
  405. <div class="box-header">
  406. <h4 class="box-title">Draggable Events</h4>
  407. </div>
  408. <div class="box-body">
  409. <!-- the events -->
  410. <div id='external-events'>
  411. <div class='external-event bg-green'>Lunch</div>
  412. <div class='external-event bg-red'>Go home</div>
  413. <div class='external-event bg-aqua'>Do homework</div>
  414. <div class='external-event bg-yellow'>Work on UI design</div>
  415. <div class='external-event bg-navy'>Sleep tight</div>
  416. <p>
  417. <input type='checkbox' id='drop-remove' /> <label for='drop-remove'>remove after drop</label>
  418. </p>
  419. </div>
  420. </div><!-- /.box-body -->
  421. </div><!-- /. box -->
  422. <div class="box box-primary">
  423. <div class="box-header">
  424. <h3 class="box-title">Create Event</h3>
  425. </div>
  426. <div class="box-body">
  427. <div class="btn-group" style="width: 100%; margin-bottom: 10px;">
  428. <button type="button" id="color-chooser-btn" class="btn btn-danger btn-block btn-sm dropdown-toggle" data-toggle="dropdown">Color <span class="caret"></span></button>
  429. <ul class="dropdown-menu" id="color-chooser">
  430. <li><a class="text-green" href="#"><i class="fa fa-square"></i> Green</a></li>
  431. <li><a class="text-blue" href="#"><i class="fa fa-square"></i> Blue</a></li>
  432. <li><a class="text-navy" href="#"><i class="fa fa-square"></i> Navy</a></li>
  433. <li><a class="text-yellow" href="#"><i class="fa fa-square"></i> Yellow</a></li>
  434. <li><a class="text-orange" href="#"><i class="fa fa-square"></i> Orange</a></li>
  435. <li><a class="text-aqua" href="#"><i class="fa fa-square"></i> Aqua</a></li>
  436. <li><a class="text-red" href="#"><i class="fa fa-square"></i> Red</a></li>
  437. <li><a class="text-fuchsia" href="#"><i class="fa fa-square"></i> Fuchsia</a></li>
  438. <li><a class="text-purple" href="#"><i class="fa fa-square"></i> Purple</a></li>
  439. </ul>
  440. </div><!-- /btn-group -->
  441. <div class="input-group">
  442. <input id="new-event" type="text" class="form-control" placeholder="Event Title">
  443. <div class="input-group-btn">
  444. <button id="add-new-event" type="button" class="btn btn-default btn-flat">Add</button>
  445. </div><!-- /btn-group -->
  446. </div><!-- /input-group -->
  447. </div>
  448. </div>
  449. </div><!-- /.col -->
  450. <div class="col-md-9">
  451. <div class="box box-primary">
  452. <div class="box-body no-padding">
  453. <!-- THE CALENDAR -->
  454. <div id="calendar"></div>
  455. </div><!-- /.box-body -->
  456. </div><!-- /. box -->
  457. </div><!-- /.col -->
  458. </div><!-- /.row -->
  459. </section><!-- /.content -->
  460. </aside><!-- /.right-side -->
  461. </div><!-- ./wrapper -->
  462. <!-- jQuery 2.0.2 -->
  463. <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
  464. <!-- jQuery UI 1.10.3 -->
  465. <script src="../js/jquery-ui-1.10.3.min.js" type="text/javascript"></script>
  466. <!-- Bootstrap -->
  467. <script src="../js/bootstrap.min.js" type="text/javascript"></script>
  468. <!-- AdminLTE App -->
  469. <script src="../js/AdminLTE/app.js" type="text/javascript"></script>
  470. <!-- fullCalendar -->
  471. <script src="../js/plugins/fullcalendar/fullcalendar.min.js" type="text/javascript"></script>
  472. <!-- Page specific script -->
  473. <script type="text/javascript">
  474. $(function() {
  475. /* initialize the external events
  476. -----------------------------------------------------------------*/
  477. function ini_events(ele) {
  478. ele.each(function() {
  479. // create an Event Object (http://arshaw.com/fullcalendar/docs/event_data/Event_Object/)
  480. // it doesn't need to have a start or end
  481. var eventObject = {
  482. title: $.trim($(this).text()) // use the element's text as the event title
  483. };
  484. // store the Event Object in the DOM element so we can get to it later
  485. $(this).data('eventObject', eventObject);
  486. // make the event draggable using jQuery UI
  487. $(this).draggable({
  488. zIndex: 1070,
  489. revert: true, // will cause the event to go back to its
  490. revertDuration: 0 // original position after the drag
  491. });
  492. });
  493. }
  494. ini_events($('#external-events div.external-event'));
  495. /* initialize the calendar
  496. -----------------------------------------------------------------*/
  497. //Date for the calendar events (dummy data)
  498. var date = new Date();
  499. var d = date.getDate(),
  500. m = date.getMonth(),
  501. y = date.getFullYear();
  502. $('#calendar').fullCalendar({
  503. header: {
  504. left: 'prev,next today',
  505. center: 'title',
  506. right: 'month,agendaWeek,agendaDay'
  507. },
  508. buttonText: {//This is to add icons to the visible buttons
  509. prev: "<span class='fa fa-caret-left'></span>",
  510. next: "<span class='fa fa-caret-right'></span>",
  511. today: 'today',
  512. month: 'month',
  513. week: 'week',
  514. day: 'day'
  515. },
  516. //Random default events
  517. events: [
  518. {
  519. title: 'All Day Event',
  520. start: new Date(y, m, 1),
  521. backgroundColor: "#f56954", //red
  522. borderColor: "#f56954" //red
  523. },
  524. {
  525. title: 'Long Event',
  526. start: new Date(y, m, d - 5),
  527. end: new Date(y, m, d - 2),
  528. backgroundColor: "#f39c12", //yellow
  529. borderColor: "#f39c12" //yellow
  530. },
  531. {
  532. title: 'Meeting',
  533. start: new Date(y, m, d, 10, 30),
  534. allDay: false,
  535. backgroundColor: "#0073b7", //Blue
  536. borderColor: "#0073b7" //Blue
  537. },
  538. {
  539. title: 'Lunch',
  540. start: new Date(y, m, d, 12, 0),
  541. end: new Date(y, m, d, 14, 0),
  542. allDay: false,
  543. backgroundColor: "#00c0ef", //Info (aqua)
  544. borderColor: "#00c0ef" //Info (aqua)
  545. },
  546. {
  547. title: 'Birthday Party',
  548. start: new Date(y, m, d + 1, 19, 0),
  549. end: new Date(y, m, d + 1, 22, 30),
  550. allDay: false,
  551. backgroundColor: "#00a65a", //Success (green)
  552. borderColor: "#00a65a" //Success (green)
  553. },
  554. {
  555. title: 'Click for Google',
  556. start: new Date(y, m, 28),
  557. end: new Date(y, m, 29),
  558. url: 'http://google.com/',
  559. backgroundColor: "#3c8dbc", //Primary (light-blue)
  560. borderColor: "#3c8dbc" //Primary (light-blue)
  561. }
  562. ],
  563. editable: true,
  564. droppable: true, // this allows things to be dropped onto the calendar !!!
  565. drop: function(date, allDay) { // this function is called when something is dropped
  566. // retrieve the dropped element's stored Event Object
  567. var originalEventObject = $(this).data('eventObject');
  568. // we need to copy it, so that multiple events don't have a reference to the same object
  569. var copiedEventObject = $.extend({}, originalEventObject);
  570. // assign it the date that was reported
  571. copiedEventObject.start = date;
  572. copiedEventObject.allDay = allDay;
  573. copiedEventObject.backgroundColor = $(this).css("background-color");
  574. copiedEventObject.borderColor = $(this).css("border-color");
  575. // render the event on the calendar
  576. // the last `true` argument determines if the event "sticks" (http://arshaw.com/fullcalendar/docs/event_rendering/renderEvent/)
  577. $('#calendar').fullCalendar('renderEvent', copiedEventObject, true);
  578. // is the "remove after drop" checkbox checked?
  579. if ($('#drop-remove').is(':checked')) {
  580. // if so, remove the element from the "Draggable Events" list
  581. $(this).remove();
  582. }
  583. }
  584. });
  585. /* ADDING EVENTS */
  586. var currColor = "#f56954"; //Red by default
  587. //Color chooser button
  588. var colorChooser = $("#color-chooser-btn");
  589. $("#color-chooser > li > a").click(function(e) {
  590. e.preventDefault();
  591. //Save color
  592. currColor = $(this).css("color");
  593. //Add color effect to button
  594. colorChooser
  595. .css({"background-color": currColor, "border-color": currColor})
  596. .html($(this).text()+' <span class="caret"></span>');
  597. });
  598. $("#add-new-event").click(function(e) {
  599. e.preventDefault();
  600. //Get value and make sure it is not null
  601. var val = $("#new-event").val();
  602. if (val.length == 0) {
  603. return;
  604. }
  605. //Create event
  606. var event = $("<div />");
  607. event.css({"background-color": currColor, "border-color": currColor, "color": "#fff"}).addClass("external-event");
  608. event.html(val);
  609. $('#external-events').prepend(event);
  610. //Add draggable funtionality
  611. ini_events(event);
  612. //Remove event from text input
  613. $("#new-event").val("");
  614. });
  615. });
  616. </script>
  617. </body>
  618. </html>