web_admin 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (264) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +11 -0
  3. data/.rspec +2 -0
  4. data/.ruby-version +1 -0
  5. data/Gemfile +32 -0
  6. data/Gemfile.lock +335 -0
  7. data/MIT-LICENSE +20 -0
  8. data/README.rdoc +3 -0
  9. data/Rakefile +22 -0
  10. data/app/assets/images/web_admin/.keep +0 -0
  11. data/app/assets/images/web_admin/avatar.jpg +0 -0
  12. data/app/assets/images/web_admin/first_icon.png +0 -0
  13. data/app/assets/images/web_admin/render-1-thumb.jpg +0 -0
  14. data/app/assets/images/web_admin/render-1.jpg +0 -0
  15. data/app/assets/images/web_admin/render-2-thumb.jpg +0 -0
  16. data/app/assets/images/web_admin/render-2.jpg +0 -0
  17. data/app/assets/images/web_admin/render-3-thumb.jpg +0 -0
  18. data/app/assets/images/web_admin/render-3.jpg +0 -0
  19. data/app/assets/images/web_admin/render-4-thumb.jpg +0 -0
  20. data/app/assets/images/web_admin/render-4.jpg +0 -0
  21. data/app/assets/images/web_admin/responsive.png +0 -0
  22. data/app/assets/javascripts/web_admin/app.data.js +336 -0
  23. data/app/assets/javascripts/web_admin/app.js +172 -0
  24. data/app/assets/javascripts/web_admin/app.plugin.js +220 -0
  25. data/app/assets/javascripts/web_admin/application.js +20 -0
  26. data/app/assets/javascripts/web_admin/bootstrap-filestyle.min.js +1 -0
  27. data/app/assets/javascripts/web_admin/bootstrap.js +1951 -0
  28. data/app/assets/javascripts/web_admin/charts/easypiechart/jquery.easy-pie-chart.js +184 -0
  29. data/app/assets/javascripts/web_admin/charts/sparkline/jquery.sparkline.min.js +5 -0
  30. data/app/assets/javascripts/web_admin/combodate/combodate.js +453 -0
  31. data/app/assets/javascripts/web_admin/combodate/moment.min.js +6 -0
  32. data/app/assets/javascripts/web_admin/data/datagrid.json +1900 -0
  33. data/app/assets/javascripts/web_admin/data/datatable.json +401 -0
  34. data/app/assets/javascripts/web_admin/datatables/jquery.dataTables.min.js +155 -0
  35. data/app/assets/javascripts/web_admin/datepicker/bootstrap-datepicker.js +474 -0
  36. data/app/assets/javascripts/web_admin/datepicker.js +3 -0
  37. data/app/assets/javascripts/web_admin/fuelux/fuelux.js +1645 -0
  38. data/app/assets/javascripts/web_admin/fullcalendar/fullcalendar.min.js +7 -0
  39. data/app/assets/javascripts/web_admin/grid/gallery.js +14 -0
  40. data/app/assets/javascripts/web_admin/grid/jquery.grid-a-licious.min.js +15 -0
  41. data/app/assets/javascripts/web_admin/grid/masonry.pkgd.min.js +9 -0
  42. data/app/assets/javascripts/web_admin/ie/excanvas.js +924 -0
  43. data/app/assets/javascripts/web_admin/ie/html5.js +9 -0
  44. data/app/assets/javascripts/web_admin/ie/respond.min.js +6 -0
  45. data/app/assets/javascripts/web_admin/jquery-ui-1.10.3.custom.min.js +6 -0
  46. data/app/assets/javascripts/web_admin/jquery.datetimepicker.js +1851 -0
  47. data/app/assets/javascripts/web_admin/jquery.ui.touch-punch.min.js +11 -0
  48. data/app/assets/javascripts/web_admin/parsley/parsley.min.js +35 -0
  49. data/app/assets/javascripts/web_admin/prettyphoto/default/default_thumb.png +0 -0
  50. data/app/assets/javascripts/web_admin/prettyphoto/default/loader.gif +0 -0
  51. data/app/assets/javascripts/web_admin/prettyphoto/default/sprite.png +0 -0
  52. data/app/assets/javascripts/web_admin/prettyphoto/default/sprite_next.png +0 -0
  53. data/app/assets/javascripts/web_admin/prettyphoto/default/sprite_prev.png +0 -0
  54. data/app/assets/javascripts/web_admin/prettyphoto/default/sprite_x.png +0 -0
  55. data/app/assets/javascripts/web_admin/prettyphoto/default/sprite_y.png +0 -0
  56. data/app/assets/javascripts/web_admin/prettyphoto/jquery.prettyPhoto.js +7 -0
  57. data/app/assets/javascripts/web_admin/prettyphoto/prettyPhoto.css +170 -0
  58. data/app/assets/javascripts/web_admin/select2/select2.css +652 -0
  59. data/app/assets/javascripts/web_admin/select2/select2.min.js +22 -0
  60. data/app/assets/javascripts/web_admin/slider/bootstrap-slider.js +388 -0
  61. data/app/assets/javascripts/web_admin/underscore-min.js +7 -0
  62. data/app/assets/javascripts/web_admin/underscore-min.map +1 -0
  63. data/app/assets/javascripts/web_admin/upload_image.js +39 -0
  64. data/app/assets/stylesheets/web_admin/application.css +15 -0
  65. data/app/assets/stylesheets/web_admin/bootstrap.css +5784 -0
  66. data/app/assets/stylesheets/web_admin/font-awesome.min.css +4 -0
  67. data/app/assets/stylesheets/web_admin/font.css +18 -0
  68. data/app/assets/stylesheets/web_admin/fonts/FontAwesome.otf +0 -0
  69. data/app/assets/stylesheets/web_admin/fonts/fontawesome-webfont.eot +0 -0
  70. data/app/assets/stylesheets/web_admin/fonts/fontawesome-webfont.svg +414 -0
  71. data/app/assets/stylesheets/web_admin/fonts/fontawesome-webfont.ttf +0 -0
  72. data/app/assets/stylesheets/web_admin/fonts/fontawesome-webfont.woff +0 -0
  73. data/app/assets/stylesheets/web_admin/fonts/glyphicons-halflings-regular.eot +0 -0
  74. data/app/assets/stylesheets/web_admin/fonts/glyphicons-halflings-regular.svg +229 -0
  75. data/app/assets/stylesheets/web_admin/fonts/glyphicons-halflings-regular.ttf +0 -0
  76. data/app/assets/stylesheets/web_admin/fonts/glyphicons-halflings-regular.woff +0 -0
  77. data/app/assets/stylesheets/web_admin/fonts/opensans/opensans-bold-webfont.woff +0 -0
  78. data/app/assets/stylesheets/web_admin/fonts/opensans/opensans-light-webfont.woff +0 -0
  79. data/app/assets/stylesheets/web_admin/fonts/opensans/opensans-webfont.woff +0 -0
  80. data/app/assets/stylesheets/web_admin/landing.css +272 -0
  81. data/app/assets/stylesheets/web_admin/plugin.css +1132 -0
  82. data/app/assets/stylesheets/web_admin/style.css +613 -0
  83. data/app/assets/stylesheets/web_admin/style2.css +21 -0
  84. data/app/controllers/web_admin/albums_controller.rb +8 -0
  85. data/app/controllers/web_admin/application_controller.rb +10 -0
  86. data/app/controllers/web_admin/crud_controller.rb +61 -0
  87. data/app/controllers/web_admin/events_controller.rb +9 -0
  88. data/app/controllers/web_admin/images_controller.rb +8 -0
  89. data/app/controllers/web_admin/institutionals_controller.rb +8 -0
  90. data/app/controllers/web_admin/main_controller.rb +7 -0
  91. data/app/controllers/web_admin/posts_controller.rb +19 -0
  92. data/app/controllers/web_admin/users_controller.rb +15 -0
  93. data/app/controllers/web_admin/videos_controller.rb +8 -0
  94. data/app/enumerations/web_admin/permission_type.rb +5 -0
  95. data/app/enumerations/web_admin/user_type.rb +6 -0
  96. data/app/helpers/web_admin/application_helper.rb +20 -0
  97. data/app/models/ability.rb +14 -0
  98. data/app/models/ckeditor/asset.rb +7 -0
  99. data/app/models/ckeditor/attachment_file.rb +7 -0
  100. data/app/models/ckeditor/picture.rb +7 -0
  101. data/app/models/web_admin/album.rb +13 -0
  102. data/app/models/web_admin/event.rb +20 -0
  103. data/app/models/web_admin/image.rb +10 -0
  104. data/app/models/web_admin/institutional.rb +11 -0
  105. data/app/models/web_admin/permission.rb +9 -0
  106. data/app/models/web_admin/post.rb +14 -0
  107. data/app/models/web_admin/user.rb +25 -0
  108. data/app/models/web_admin/video.rb +17 -0
  109. data/app/uploaders/ckeditor_attachment_file_uploader.rb +36 -0
  110. data/app/uploaders/ckeditor_picture_uploader.rb +47 -0
  111. data/app/uploaders/web_admin/image_post_uploader.rb +55 -0
  112. data/app/uploaders/web_admin/image_uploader.rb +52 -0
  113. data/app/views/devise/confirmations/new.html.erb +12 -0
  114. data/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
  115. data/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
  116. data/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
  117. data/app/views/devise/passwords/edit.html.erb +16 -0
  118. data/app/views/devise/passwords/new.html.erb +12 -0
  119. data/app/views/devise/registrations/edit.html.erb +29 -0
  120. data/app/views/devise/registrations/new.html.erb +18 -0
  121. data/app/views/devise/sessions/new.html.erb +16 -0
  122. data/app/views/devise/shared/_links.html.erb +25 -0
  123. data/app/views/devise/unlocks/new.html.erb +12 -0
  124. data/app/views/layouts/web_admin/devise.html.erb +42 -0
  125. data/app/views/shared/403.html +57 -0
  126. data/app/views/shared/_header.html.erb +16 -0
  127. data/app/views/shared/_navbar.html.erb +23 -0
  128. data/app/views/shared/_notice.html.erb +12 -0
  129. data/app/views/web_admin/albums/_form.html.erb +23 -0
  130. data/app/views/web_admin/albums/edit.html.erb +4 -0
  131. data/app/views/web_admin/albums/index.html.erb +39 -0
  132. data/app/views/web_admin/albums/new.html.erb +4 -0
  133. data/app/views/web_admin/albums/show.html.erb +4 -0
  134. data/app/views/web_admin/events/_form.html.erb +37 -0
  135. data/app/views/web_admin/events/edit.html.erb +4 -0
  136. data/app/views/web_admin/events/index.html.erb +39 -0
  137. data/app/views/web_admin/events/new.html.erb +4 -0
  138. data/app/views/web_admin/images/_form.html.erb +23 -0
  139. data/app/views/web_admin/images/_images.html.erb +10 -0
  140. data/app/views/web_admin/images/create.js.erb +2 -0
  141. data/app/views/web_admin/images/update.js.erb +2 -0
  142. data/app/views/web_admin/institutionals/_form.html.erb +22 -0
  143. data/app/views/web_admin/institutionals/edit.html.erb +4 -0
  144. data/app/views/web_admin/institutionals/index.html.erb +35 -0
  145. data/app/views/web_admin/institutionals/new.html.erb +4 -0
  146. data/app/views/web_admin/layouts/application.html.erb +77 -0
  147. data/app/views/web_admin/main/index.html.erb +1 -0
  148. data/app/views/web_admin/posts/_form.html.erb +27 -0
  149. data/app/views/web_admin/posts/edit.html.erb +4 -0
  150. data/app/views/web_admin/posts/index.html.erb +37 -0
  151. data/app/views/web_admin/posts/new.html.erb +4 -0
  152. data/app/views/web_admin/users/_form.html.erb +49 -0
  153. data/app/views/web_admin/users/edit.html.erb +4 -0
  154. data/app/views/web_admin/users/index.html.erb +35 -0
  155. data/app/views/web_admin/users/new.html.erb +4 -0
  156. data/app/views/web_admin/videos/_form.html.erb +22 -0
  157. data/app/views/web_admin/videos/edit.html.erb +4 -0
  158. data/app/views/web_admin/videos/index.html.erb +37 -0
  159. data/app/views/web_admin/videos/new.html.erb +4 -0
  160. data/bin/rails +12 -0
  161. data/config/initializers/ckeditor.rb +39 -0
  162. data/config/initializers/devise.rb +261 -0
  163. data/config/initializers/enumerate_it.rb +1 -0
  164. data/config/initializers/simple_form.rb +145 -0
  165. data/config/initializers/simple_form_bootstrap.rb +46 -0
  166. data/config/locales/buttons.yml +3 -0
  167. data/config/locales/controllers.yml +9 -0
  168. data/config/locales/devise.en.yml +62 -0
  169. data/config/locales/devise.pt.yml +62 -0
  170. data/config/locales/models.yml +54 -0
  171. data/config/locales/rails.yml +219 -0
  172. data/config/locales/responders.yml +10 -0
  173. data/config/locales/simple_form.en.yml +26 -0
  174. data/config/routes.rb +13 -0
  175. data/db/migrate/20141023223026_devise_create_admin_web_users.rb +42 -0
  176. data/db/migrate/20141023223656_create_admin_web_posts.rb +15 -0
  177. data/db/migrate/20141026181117_create_ckeditor_assets.rb +26 -0
  178. data/db/migrate/20141028020102_create_admin_web_institutionals.rb +10 -0
  179. data/db/migrate/20141028135201_create_admin_web_videos.rb +10 -0
  180. data/db/migrate/20141114020551_create_admin_web_albums.rb +12 -0
  181. data/db/migrate/20141117183405_create_admin_web_images.rb +11 -0
  182. data/db/migrate/20141130203155_add_user_type_to_users.rb +5 -0
  183. data/db/migrate/20141224221959_create_admin_web_events.rb +18 -0
  184. data/db/migrate/20150130140502_create_admin_web_permissions.rb +13 -0
  185. data/db/migrate/20150510191213_rename_tables.rb +12 -0
  186. data/lib/application_responder.rb +12 -0
  187. data/lib/tasks/web_admin_tasks.rake +4 -0
  188. data/lib/templates/erb/scaffold/_form.html.erb +13 -0
  189. data/lib/web_admin/engine.rb +15 -0
  190. data/lib/web_admin/version.rb +3 -0
  191. data/lib/web_admin.rb +18 -0
  192. data/spec/factories/admin_web_users.rb +24 -0
  193. data/spec/features/admin_web/albums_spec.rb +74 -0
  194. data/spec/features/admin_web/event_spec.rb +85 -0
  195. data/spec/features/admin_web/institutionals_spec.rb +47 -0
  196. data/spec/features/admin_web/login_spec.rb +18 -0
  197. data/spec/features/admin_web/permissions_spec.rb +40 -0
  198. data/spec/features/admin_web/posts_spec.rb +55 -0
  199. data/spec/features/admin_web/users_spec.rb +73 -0
  200. data/spec/features/admin_web/videos_spec.rb +51 -0
  201. data/spec/fixtures/p3-single.jpg +0 -0
  202. data/spec/models/admin_web/album_spec.rb +20 -0
  203. data/spec/models/admin_web/event_spec.rb +42 -0
  204. data/spec/models/admin_web/image_spec.rb +14 -0
  205. data/spec/models/admin_web/institutional_spec.rb +19 -0
  206. data/spec/models/admin_web/permission_spec.rb +14 -0
  207. data/spec/models/admin_web/post_spec.rb +25 -0
  208. data/spec/models/admin_web/user_spec.rb +18 -0
  209. data/spec/models/admin_web/video_spec.rb +26 -0
  210. data/spec/rails_helper.rb +52 -0
  211. data/spec/spec_helper.rb +85 -0
  212. data/spec/support/capybara.rb +53 -0
  213. data/spec/support/database_cleaner.rb +25 -0
  214. data/spec/support/devise.rb +5 -0
  215. data/spec/support/factory_girl.rb +4 -0
  216. data/spec/support/helpers.rb +82 -0
  217. data/spec/support/shared_connection.rb +10 -0
  218. data/spec/test_app/README.rdoc +28 -0
  219. data/spec/test_app/Rakefile +6 -0
  220. data/spec/test_app/app/assets/images/.keep +0 -0
  221. data/spec/test_app/app/assets/javascripts/application.js +13 -0
  222. data/spec/test_app/app/assets/stylesheets/application.css +15 -0
  223. data/spec/test_app/app/controllers/application_controller.rb +5 -0
  224. data/spec/test_app/app/controllers/concerns/.keep +0 -0
  225. data/spec/test_app/app/helpers/application_helper.rb +2 -0
  226. data/spec/test_app/app/mailers/.keep +0 -0
  227. data/spec/test_app/app/models/.keep +0 -0
  228. data/spec/test_app/app/models/concerns/.keep +0 -0
  229. data/spec/test_app/app/views/layouts/application.html.erb +14 -0
  230. data/spec/test_app/bin/bundle +3 -0
  231. data/spec/test_app/bin/rails +4 -0
  232. data/spec/test_app/bin/rake +4 -0
  233. data/spec/test_app/config/application.rb +29 -0
  234. data/spec/test_app/config/boot.rb +5 -0
  235. data/spec/test_app/config/database.yml +85 -0
  236. data/spec/test_app/config/environment.rb +5 -0
  237. data/spec/test_app/config/environments/development.rb +37 -0
  238. data/spec/test_app/config/environments/production.rb +78 -0
  239. data/spec/test_app/config/environments/test.rb +39 -0
  240. data/spec/test_app/config/initializers/assets.rb +8 -0
  241. data/spec/test_app/config/initializers/backtrace_silencers.rb +7 -0
  242. data/spec/test_app/config/initializers/cookies_serializer.rb +3 -0
  243. data/spec/test_app/config/initializers/filter_parameter_logging.rb +4 -0
  244. data/spec/test_app/config/initializers/inflections.rb +16 -0
  245. data/spec/test_app/config/initializers/mime_types.rb +4 -0
  246. data/spec/test_app/config/initializers/session_store.rb +3 -0
  247. data/spec/test_app/config/initializers/wrap_parameters.rb +14 -0
  248. data/spec/test_app/config/locales/en.yml +23 -0
  249. data/spec/test_app/config/routes.rb +4 -0
  250. data/spec/test_app/config/secrets.yml +22 -0
  251. data/spec/test_app/config.ru +4 -0
  252. data/spec/test_app/db/schema.rb +121 -0
  253. data/spec/test_app/lib/assets/.keep +0 -0
  254. data/spec/test_app/log/.keep +0 -0
  255. data/spec/test_app/public/404.html +67 -0
  256. data/spec/test_app/public/422.html +67 -0
  257. data/spec/test_app/public/500.html +66 -0
  258. data/spec/test_app/public/favicon.ico +0 -0
  259. data/spec/test_app/spec/factories/admin_web_albums.rb +7 -0
  260. data/spec/test_app/spec/factories/admin_web_users.rb +24 -0
  261. data/spec/test_app/spec/factories/permissions.rb +36 -0
  262. data/web_admin.gemspec +38 -0
  263. data/wercker.yml +16 -0
  264. metadata +530 -0
@@ -0,0 +1,336 @@
1
+ $(document).ready(function() {
2
+
3
+ $('#docs pre code').each(function(){
4
+ var $this = $(this);
5
+ var t = $this.html();
6
+ $this.html(t.replace(/</g, '&lt;').replace(/>/g, '&gt;'));
7
+ });
8
+
9
+ function getRandomInt(min, max) {
10
+ return Math.floor(Math.random() * (max - min + 1)) + min;
11
+ };
12
+
13
+ $(document).on('click', '.the-icons a', function(e){
14
+ e && e.preventDefault();
15
+ });
16
+
17
+ $(document).on('change', 'table thead [type="checkbox"]', function(e){
18
+ e && e.preventDefault();
19
+ var $table = $(e.target).closest('table'), $checked = $(e.target).is(':checked');
20
+ $('tbody [type="checkbox"]', $table).prop('checked', $checked);
21
+ });
22
+
23
+ $(document).on('click', '[data-toggle^="progress"]', function(e){
24
+ e && e.preventDefault();
25
+
26
+ $el = $(e.target);
27
+ $target = $($el.data('target'));
28
+ $('.progress', $target).each(
29
+ function(){
30
+ var $max = 50, $data, $ps = $('.progress-bar',this).last();
31
+ ($(this).hasClass('progress-mini') || $(this).hasClass('progress-small')) && ($max = 100);
32
+ $data = Math.floor(Math.random()*$max)+'%';
33
+ $ps.css('width', $data).attr('data-original-title', $data);
34
+ }
35
+ );
36
+ });
37
+
38
+ function addNotification($notes){
39
+ var $el = $('#panel-notifications'), $n = $('.count-n:first', $el), $item = $('.list-group-item:first', $el).clone(), $v = parseInt($n.text());
40
+ $('.count-n', $el).fadeOut().fadeIn().text($v+1);
41
+ $item.attr('href', $notes.link);
42
+ $item.find('.pull-left').html($notes.icon);
43
+ $item.find('.media-body').html($notes.title);
44
+ $item.hide().prependTo($el.find('.list-group')).slideDown().css('display','block');
45
+ }
46
+ var $noteMail = {
47
+ icon: '<i class="fa fa-envelope-o fa-2x text-default"></i>',
48
+ title: 'Added the mail app, Check it out.<br><small class="text-muted">2 July 13</small>',
49
+ link: 'mail.html'
50
+ }
51
+ var $noteCalendar = {
52
+ icon: '<i class="fa fa-calendar fa-2x text-default"></i>',
53
+ title: 'Added the calendar, Get it.<br><small class="text-muted">10 July 13</small>',
54
+ link: 'calendar.html'
55
+ }
56
+ var $noteTimeline = {
57
+ icon: '<i class="fa fa-clock-o fa-2x text-default"></i>',
58
+ title: 'Added the timeline, view it here.<br><small class="text-muted">1 minute ago</small>',
59
+ link: 'timeline.html'
60
+ }
61
+ window.setTimeout(function(){addNotification($noteMail)}, 2000);
62
+ window.setTimeout(function(){addNotification($noteCalendar)}, 3500);
63
+ window.setTimeout(function(){addNotification($noteTimeline)}, 5000);
64
+
65
+ // fullcalendar
66
+ var date = new Date();
67
+ var d = date.getDate();
68
+ var m = date.getMonth();
69
+ var y = date.getFullYear();
70
+ var addDragEvent = function($this){
71
+ // create an Event Object (http://arshaw.com/fullcalendar/docs/event_data/Event_Object/)
72
+ // it doesn't need to have a start or end
73
+ var eventObject = {
74
+ title: $.trim($this.text()), // use the element's text as the event title
75
+ className: $this.attr('class').replace('label','')
76
+ };
77
+
78
+ // store the Event Object in the DOM element so we can get to it later
79
+ $this.data('eventObject', eventObject);
80
+
81
+ // make the event draggable using jQuery UI
82
+ $this.draggable({
83
+ zIndex: 999,
84
+ revert: true, // will cause the event to go back to its
85
+ revertDuration: 0 // original position after the drag
86
+ });
87
+ };
88
+ $('.calendar').each(function() {
89
+ $(this).fullCalendar({
90
+ header: {
91
+ left: 'prev,next today',
92
+ center: 'title',
93
+ right: 'month,agendaWeek,agendaDay'
94
+ },
95
+ editable: true,
96
+ droppable: true, // this allows things to be dropped onto the calendar !!!
97
+ drop: function(date, allDay) { // this function is called when something is dropped
98
+
99
+ // retrieve the dropped element's stored Event Object
100
+ var originalEventObject = $(this).data('eventObject');
101
+
102
+ // we need to copy it, so that multiple events don't have a reference to the same object
103
+ var copiedEventObject = $.extend({}, originalEventObject);
104
+
105
+ // assign it the date that was reported
106
+ copiedEventObject.start = date;
107
+ copiedEventObject.allDay = allDay;
108
+
109
+ // render the event on the calendar
110
+ // the last `true` argument determines if the event "sticks" (http://arshaw.com/fullcalendar/docs/event_rendering/renderEvent/)
111
+ $('#calendar').fullCalendar('renderEvent', copiedEventObject, true);
112
+
113
+ // is the "remove after drop" checkbox checked?
114
+ if ($('#drop-remove').is(':checked')) {
115
+ // if so, remove the element from the "Draggable Events" list
116
+ $(this).remove();
117
+ }
118
+
119
+ }
120
+ ,
121
+ events: [
122
+ {
123
+ title: 'All Day Event',
124
+ start: new Date(y, m, 1)
125
+ },
126
+ {
127
+ title: 'Long Event',
128
+ start: new Date(y, m, d-5),
129
+ end: new Date(y, m, d-2),
130
+ className:'bg-primary'
131
+ },
132
+ {
133
+ id: 999,
134
+ title: 'Repeating Event',
135
+ start: new Date(y, m, d-3, 16, 0),
136
+ allDay: false
137
+ },
138
+ {
139
+ id: 999,
140
+ title: 'Repeating Event',
141
+ start: new Date(y, m, d+4, 16, 0),
142
+ allDay: false
143
+ },
144
+ {
145
+ title: 'Meeting',
146
+ start: new Date(y, m, d, 10, 30),
147
+ allDay: false
148
+ },
149
+ {
150
+ title: 'Lunch',
151
+ start: new Date(y, m, d, 12, 0),
152
+ end: new Date(y, m, d, 14, 0),
153
+ allDay: false
154
+ },
155
+ {
156
+ title: 'Birthday Party',
157
+ start: new Date(y, m, d+1, 19, 0),
158
+ end: new Date(y, m, d+1, 22, 30),
159
+ allDay: false
160
+ },
161
+ {
162
+ title: 'Click for Google',
163
+ start: new Date(y, m, 28),
164
+ end: new Date(y, m, 29),
165
+ url: 'http://google.com/'
166
+ }
167
+ ]
168
+ });
169
+ });
170
+ $('#myEvents').on('change', function(e, item){
171
+ addDragEvent($(item));
172
+ });
173
+
174
+ $('#myEvents li').each(function() {
175
+ addDragEvent($(this));
176
+ });
177
+
178
+ // fuelux datagrid
179
+ var DataGridDataSource = function (options) {
180
+ this._formatter = options.formatter;
181
+ this._columns = options.columns;
182
+ this._delay = options.delay;
183
+ };
184
+
185
+ DataGridDataSource.prototype = {
186
+
187
+ columns: function () {
188
+ return this._columns;
189
+ },
190
+
191
+ data: function (options, callback) {
192
+ var url = 'js/data/datagrid.json';
193
+ var self = this;
194
+
195
+ setTimeout(function () {
196
+
197
+ var data = $.extend(true, [], self._data);
198
+
199
+ $.ajax(url, {
200
+ dataType: 'json',
201
+ async: false,
202
+ type: 'GET'
203
+ }).done(function (response) {
204
+
205
+ data = response.geonames;
206
+ // SEARCHING
207
+ if (options.search) {
208
+ data = _.filter(data, function (item) {
209
+ var match = false;
210
+
211
+ _.each(item, function (prop) {
212
+ if (_.isString(prop) || _.isFinite(prop)) {
213
+ if (prop.toString().toLowerCase().indexOf(options.search.toLowerCase()) !== -1) match = true;
214
+ }
215
+ });
216
+
217
+ return match;
218
+ });
219
+ }
220
+
221
+ // FILTERING
222
+ if (options.filter) {
223
+ data = _.filter(data, function (item) {
224
+ switch(options.filter.value) {
225
+ case 'lt5m':
226
+ if(item.population < 5000000) return true;
227
+ break;
228
+ case 'gte5m':
229
+ if(item.population >= 5000000) return true;
230
+ break;
231
+ default:
232
+ return true;
233
+ break;
234
+ }
235
+ });
236
+ }
237
+
238
+ var count = data.length;
239
+
240
+ // SORTING
241
+ if (options.sortProperty) {
242
+ data = _.sortBy(data, options.sortProperty);
243
+ if (options.sortDirection === 'desc') data.reverse();
244
+ }
245
+
246
+ // PAGING
247
+ var startIndex = options.pageIndex * options.pageSize;
248
+ var endIndex = startIndex + options.pageSize;
249
+ var end = (endIndex > count) ? count : endIndex;
250
+ var pages = Math.ceil(count / options.pageSize);
251
+ var page = options.pageIndex + 1;
252
+ var start = startIndex + 1;
253
+
254
+ data = data.slice(startIndex, endIndex);
255
+
256
+ if (self._formatter) self._formatter(data);
257
+
258
+ callback({ data: data, start: start, end: end, count: count, pages: pages, page: page });
259
+ }).fail(function(e){
260
+
261
+ });
262
+ }, self._delay);
263
+ }
264
+ };
265
+
266
+ $('#MyStretchGrid').each(function() {
267
+ $(this).datagrid({
268
+ dataSource: new DataGridDataSource({
269
+ // Column definitions for Datagrid
270
+ columns: [
271
+ {
272
+ property: 'toponymName',
273
+ label: 'Name',
274
+ sortable: true
275
+ },
276
+ {
277
+ property: 'countrycode',
278
+ label: 'Country',
279
+ sortable: true
280
+ },
281
+ {
282
+ property: 'population',
283
+ label: 'Population',
284
+ sortable: true
285
+ },
286
+ {
287
+ property: 'fcodeName',
288
+ label: 'Type',
289
+ sortable: true
290
+ },
291
+ {
292
+ property: 'geonameId',
293
+ label: 'Edit',
294
+ sortable: true
295
+ }
296
+ ],
297
+
298
+ // Create IMG tag for each returned image
299
+ formatter: function (items) {
300
+ $.each(items, function (index, item) {
301
+ item.geonameId = '<a href="#edit?geonameid='+item.geonameId+'"><i class="fa fa-pencil"></i></a>';
302
+ });
303
+ }
304
+ })
305
+ });
306
+ });
307
+
308
+ // datatable
309
+ $('[data-ride="datatables"]').each(function() {
310
+ var oTable = $(this).dataTable( {
311
+ "bProcessing": true,
312
+ "sAjaxSource": "js/data/datatable.json",
313
+ "sDom": "<'row'<'col-sm-6'l><'col-sm-6'f>r>t<'row'<'col-sm-6'i><'col col-sm-6'p>>",
314
+ "sPaginationType": "full_numbers",
315
+ "aoColumns": [
316
+ { "mData": "engine" },
317
+ { "mData": "browser" },
318
+ { "mData": "platform" },
319
+ { "mData": "version" },
320
+ { "mData": "grade" }
321
+ ]
322
+ } );
323
+ });
324
+
325
+ // select2
326
+
327
+ if ($.fn.select2) {
328
+ $("#select2-option").select2();
329
+ $("#select2-tags").select2({
330
+ tags:["red", "green", "blue"],
331
+ tokenSeparators: [",", " "]}
332
+ );
333
+ }
334
+
335
+
336
+ });
@@ -0,0 +1,172 @@
1
+ /*! jQuery Mobile v1.3.0 | Copyright 2010, 2013 jQuery Foundation, Inc. | jquery.org/license */
2
+ (function(a,b,c){typeof define=="function"&&define.amd?define(["jquery"],function(d){return c(d,a,b),d.mobile}):c(a.jQuery,a,b)})(this,document,function(a,b,c,d){(function(a){a.mobile={}})(a),function(a,b){var d={touch:"ontouchend"in c};a.mobile.support=a.mobile.support||{},a.extend(a.support,d),a.extend(a.mobile.support,d)}(a),function(a,b,c,d){function x(a){while(a&&typeof a.originalEvent!="undefined")a=a.originalEvent;return a}function y(b,c){var e=b.type,f,g,i,k,l,m,n,o,p;b=a.Event(b),b.type=c,f=b.originalEvent,g=a.event.props,e.search(/^(mouse|click)/)>-1&&(g=j);if(f)for(n=g.length,k;n;)k=g[--n],b[k]=f[k];e.search(/mouse(down|up)|click/)>-1&&!b.which&&(b.which=1);if(e.search(/^touch/)!==-1){i=x(f),e=i.touches,l=i.changedTouches,m=e&&e.length?e[0]:l&&l.length?l[0]:d;if(m)for(o=0,p=h.length;o<p;o++)k=h[o],b[k]=m[k]}return b}function z(b){var c={},d,f;while(b){d=a.data(b,e);for(f in d)d[f]&&(c[f]=c.hasVirtualBinding=!0);b=b.parentNode}return c}function A(b,c){var d;while(b){d=a.data(b,e);if(d&&(!c||d[c]))return b;b=b.parentNode}return null}function B(){r=!1}function C(){r=!0}function D(){v=0,p.length=0,q=!1,C()}function E(){B()}function F(){G(),l=setTimeout(function(){l=0,D()},a.vmouse.resetTimerDuration)}function G(){l&&(clearTimeout(l),l=0)}function H(b,c,d){var e;if(d&&d[b]||!d&&A(c.target,b))e=y(c,b),a(c.target).trigger(e);return e}function I(b){var c=a.data(b.target,f);if(!q&&(!v||v!==c)){var d=H("v"+b.type,b);d&&(d.isDefaultPrevented()&&b.preventDefault(),d.isPropagationStopped()&&b.stopPropagation(),d.isImmediatePropagationStopped()&&b.stopImmediatePropagation())}}function J(b){var c=x(b).touches,d,e;if(c&&c.length===1){d=b.target,e=z(d);if(e.hasVirtualBinding){v=u++,a.data(d,f,v),G(),E(),o=!1;var g=x(b).touches[0];m=g.pageX,n=g.pageY,H("vmouseover",b,e),H("vmousedown",b,e)}}}function K(a){if(r)return;o||H("vmousecancel",a,z(a.target)),o=!0,F()}function L(b){if(r)return;var c=x(b).touches[0],d=o,e=a.vmouse.moveDistanceThreshold,f=z(b.target);o=o||Math.abs(c.pageX-m)>e||Math.abs(c.pageY-n)>e,o&&!d&&H("vmousecancel",b,f),H("vmousemove",b,f),F()}function M(a){if(r)return;C();var b=z(a.target),c;H("vmouseup",a,b);if(!o){var d=H("vclick",a,b);d&&d.isDefaultPrevented()&&(c=x(a).changedTouches[0],p.push({touchID:v,x:c.clientX,y:c.clientY}),q=!0)}H("vmouseout",a,b),o=!1,F()}function N(b){var c=a.data(b,e),d;if(c)for(d in c)if(c[d])return!0;return!1}function O(){}function P(b){var c=b.substr(1);return{setup:function(d,f){N(this)||a.data(this,e,{});var g=a.data(this,e);g[b]=!0,k[b]=(k[b]||0)+1,k[b]===1&&t.bind(c,I),a(this).bind(c,O),s&&(k.touchstart=(k.touchstart||0)+1,k.touchstart===1&&t.bind("touchstart",J).bind("touchend",M).bind("touchmove",L).bind("scroll",K))},teardown:function(d,f){--k[b],k[b]||t.unbind(c,I),s&&(--k.touchstart,k.touchstart||t.unbind("touchstart",J).unbind("touchmove",L).unbind("touchend",M).unbind("scroll",K));var g=a(this),h=a.data(this,e);h&&(h[b]=!1),g.unbind(c,O),N(this)||g.removeData(e)}}}var e="virtualMouseBindings",f="virtualTouchID",g="vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel".split(" "),h="clientX clientY pageX pageY screenX screenY".split(" "),i=a.event.mouseHooks?a.event.mouseHooks.props:[],j=a.event.props.concat(i),k={},l=0,m=0,n=0,o=!1,p=[],q=!1,r=!1,s="addEventListener"in c,t=a(c),u=1,v=0,w;a.vmouse={moveDistanceThreshold:10,clickDistanceThreshold:10,resetTimerDuration:1500};for(var Q=0;Q<g.length;Q++)a.event.special[g[Q]]=P(g[Q]);s&&c.addEventListener("click",function(b){var c=p.length,d=b.target,e,g,h,i,j,k;if(c){e=b.clientX,g=b.clientY,w=a.vmouse.clickDistanceThreshold,h=d;while(h){for(i=0;i<c;i++){j=p[i],k=0;if(h===d&&Math.abs(j.x-e)<w&&Math.abs(j.y-g)<w||a.data(h,f)===j.touchID){b.preventDefault(),b.stopPropagation();return}}h=h.parentNode}}},!0)}(a,b,c),function(a,b,d){function k(b,c,d){var e=d.type;d.type=c,a.event.dispatch.call(b,d),d.type=e}var e=a(c);a.each("touchstart touchmove touchend tap taphold swipe swipeleft swiperight scrollstart scrollstop".split(" "),function(b,c){a.fn[c]=function(a){return a?this.bind(c,a):this.trigger(c)},a.attrFn&&(a.attrFn[c]=!0)});var f=a.mobile.support.touch,g="touchmove scroll",h=f?"touchstart":"mousedown",i=f?"touchend":"mouseup",j=f?"touchmove":"mousemove";a.event.special.scrollstart={enabled:!0,setup:function(){function f(a,c){d=c,k(b,d?"scrollstart":"scrollstop",a)}var b=this,c=a(b),d,e;c.bind(g,function(b){if(!a.event.special.scrollstart.enabled)return;d||f(b,!0),clearTimeout(e),e=setTimeout(function(){f(b,!1)},50)})}},a.event.special.tap={tapholdThreshold:750,setup:function(){var b=this,c=a(b);c.bind("vmousedown",function(d){function i(){clearTimeout(h)}function j(){i(),c.unbind("vclick",l).unbind("vmouseup",i),e.unbind("vmousecancel",j)}function l(a){j(),f===a.target&&k(b,"tap",a)}if(d.which&&d.which!==1)return!1;var f=d.target,g=d.originalEvent,h;c.bind("vmouseup",i).bind("vclick",l),e.bind("vmousecancel",j),h=setTimeout(function(){k(b,"taphold",a.Event("taphold",{target:f}))},a.event.special.tap.tapholdThreshold)})}},a.event.special.swipe={scrollSupressionThreshold:30,durationThreshold:1e3,horizontalDistanceThreshold:30,verticalDistanceThreshold:75,start:function(b){var c=b.originalEvent.touches?b.originalEvent.touches[0]:b;return{time:(new Date).getTime(),coords:[c.pageX,c.pageY],origin:a(b.target)}},stop:function(a){var b=a.originalEvent.touches?a.originalEvent.touches[0]:a;return{time:(new Date).getTime(),coords:[b.pageX,b.pageY]}},handleSwipe:function(b,c){c.time-b.time<a.event.special.swipe.durationThreshold&&Math.abs(b.coords[0]-c.coords[0])>a.event.special.swipe.horizontalDistanceThreshold&&Math.abs(b.coords[1]-c.coords[1])<a.event.special.swipe.verticalDistanceThreshold&&b.origin.trigger("swipe").trigger(b.coords[0]>c.coords[0]?"swipeleft":"swiperight")},setup:function(){var b=this,c=a(b);c.bind(h,function(b){function g(b){if(!e)return;f=a.event.special.swipe.stop(b),Math.abs(e.coords[0]-f.coords[0])>a.event.special.swipe.scrollSupressionThreshold&&b.preventDefault()}var e=a.event.special.swipe.start(b),f;c.bind(j,g).one(i,function(){c.unbind(j,g),e&&f&&a.event.special.swipe.handleSwipe(e,f),e=f=d})})}},a.each({scrollstop:"scrollstart",taphold:"tap",swipeleft:"swipe",swiperight:"swipe"},function(b,c){a.event.special[b]={setup:function(){a(this).bind(c,a.noop)}}})}(a,this)})
3
+ /*! http://mths.be/placeholder v2.0.7 by @mathias */
4
+ ;(function(h,j,e){var a="placeholder" in j.createElement("input");var f="placeholder" in j.createElement("textarea");var k=e.fn;var d=e.valHooks;var b=e.propHooks;var m;var l;if(a&&f){l=k.placeholder=function(){return this};l.input=l.textarea=true}else{l=k.placeholder=function(){var n=this;n.filter((a?"textarea":":input")+"[placeholder]").not(".placeholder").bind({"focus.placeholder":c,"blur.placeholder":g}).data("placeholder-enabled",true).trigger("blur.placeholder");return n};l.input=a;l.textarea=f;m={get:function(o){var n=e(o);var p=n.data("placeholder-password");if(p){return p[0].value}return n.data("placeholder-enabled")&&n.hasClass("placeholder")?"":o.value},set:function(o,q){var n=e(o);var p=n.data("placeholder-password");if(p){return p[0].value=q}if(!n.data("placeholder-enabled")){return o.value=q}if(q==""){o.value=q;if(o!=j.activeElement){g.call(o)}}else{if(n.hasClass("placeholder")){c.call(o,true,q)||(o.value=q)}else{o.value=q}}return n}};if(!a){d.input=m;b.value=m}if(!f){d.textarea=m;b.value=m}e(function(){e(j).delegate("form","submit.placeholder",function(){var n=e(".placeholder",this).each(c);setTimeout(function(){n.each(g)},10)})});e(h).bind("beforeunload.placeholder",function(){e(".placeholder").each(function(){this.value=""})})}function i(o){var n={};var p=/^jQuery\d+$/;e.each(o.attributes,function(r,q){if(q.specified&&!p.test(q.name)){n[q.name]=q.value}});return n}function c(o,p){var n=this;var q=e(n);if(n.value==q.attr("placeholder")&&q.hasClass("placeholder")){if(q.data("placeholder-password")){q=q.hide().next().show().attr("id",q.removeAttr("id").data("placeholder-id"));if(o===true){return q[0].value=p}q.focus()}else{n.value="";q.removeClass("placeholder");n==j.activeElement&&n.select()}}}function g(){var r;var n=this;var q=e(n);var p=this.id;if(n.value==""){if(n.type=="password"){if(!q.data("placeholder-textinput")){try{r=q.clone().attr({type:"text"})}catch(o){r=e("<input>").attr(e.extend(i(this),{type:"text"}))}r.removeAttr("name").data({"placeholder-password":q,"placeholder-id":p}).bind("focus.placeholder",c);q.data({"placeholder-textinput":r,"placeholder-id":p}).before(r)}q=q.removeAttr("id").hide().prev().attr("id",p).show()}q.addClass("placeholder");q[0].value=q.attr("placeholder")}else{q.removeClass("placeholder")}}}(this,document,jQuery));
5
+
6
+ // data-shift api
7
+ !function ($) {
8
+
9
+ "use strict"; // jshint ;_;
10
+
11
+ /* SHIFT CLASS DEFINITION
12
+ * ====================== */
13
+
14
+ var Shift = function (element) {
15
+ this.$element = $(element)
16
+ this.$prev = this.$element.prev()
17
+ !this.$prev.length && (this.$parent = this.$element.parent())
18
+ }
19
+
20
+ Shift.prototype = {
21
+ constructor: Shift
22
+
23
+ , init:function(){
24
+ var $el = this.$element
25
+ , method = $el.data()['toggle'].split(':')[1]
26
+ , $target = $el.data('target')
27
+ $el.hasClass('in') || $el[method]($target).addClass('in')
28
+ }
29
+ , reset :function(){
30
+ this.$parent && this.$parent['prepend'](this.$element)
31
+ !this.$parent && this.$element['insertAfter'](this.$prev)
32
+ this.$element.removeClass('in')
33
+ }
34
+ }
35
+
36
+ /* SHIFT PLUGIN DEFINITION
37
+ * ======================= */
38
+
39
+ $.fn.shift = function (option) {
40
+ return this.each(function () {
41
+ var $this = $(this)
42
+ , data = $this.data('shift')
43
+ if (!data) $this.data('shift', (data = new Shift(this)))
44
+ if (typeof option == 'string') data[option]()
45
+ })
46
+ }
47
+
48
+ $.fn.shift.Constructor = Shift
49
+ }(window.jQuery);
50
+
51
+ Date.now = Date.now || function() { return +new Date; };
52
+
53
+ !function ($) {
54
+
55
+ $(function(){
56
+
57
+ // placeholder
58
+ $('input[placeholder], textarea[placeholder]').placeholder();
59
+
60
+ // popover
61
+ $("[data-toggle=popover]").popover();
62
+ $(document).on('click', '.popover-title .close', function(e){
63
+ var $target = $(e.target), $popover = $target.closest('.popover').prev();
64
+ $popover && $popover.popover('hide');
65
+ });
66
+
67
+ $.fn.dropdown.Constructor.prototype.change = function(e){
68
+ e.preventDefault();
69
+ var $item = $(e.target), $select, $checked = false, $menu, $label;
70
+ !$item.is('a') && ($item = $item.closest('a'));
71
+ $menu = $item.closest('.dropdown-menu');
72
+ $label = $menu.parent().find('.dropdown-label');
73
+ $labelHolder = $label.text();
74
+ $select = $item.find('input');
75
+ $checked = $select.is(':checked');
76
+ if($select.is(':disabled')) return;
77
+ if($select.attr('type') == 'radio' && $checked) return;
78
+ if($select.attr('type') == 'radio') $menu.find('li').removeClass('active');
79
+ $item.parent().removeClass('active');
80
+ !$checked && $item.parent().addClass('active');
81
+ $select.prop("checked", !$select.prop("checked"));
82
+
83
+ $items = $menu.find('li > a > input:checked');
84
+ if ($items.length) {
85
+ $text = [];
86
+ $items.each(function () {
87
+ var $str = $(this).parent().text();
88
+ $str && $text.push($.trim($str));
89
+ });
90
+
91
+ $text = $text.length < 4 ? $text.join(', ') : $text.length + ' selected';
92
+ $label.html($text);
93
+ }else{
94
+ $label.html($label.data('placeholder'));
95
+ }
96
+ }
97
+ $(document).on('click.dropdown-menu', '.dropdown-select > li > a', $.fn.dropdown.Constructor.prototype.change);
98
+
99
+ // tooltip
100
+ $("[data-toggle=tooltip]").tooltip();
101
+
102
+ // class
103
+ $(document).on('click', '[data-toggle^="class"]', function(e){
104
+ e && e.preventDefault();
105
+ var $this = $(e.target), $class , $target;
106
+ !$this.data('toggle') && ($this = $this.closest('[data-toggle^="class"]'));
107
+ $class = $this.data()['toggle'].split(':')[1];
108
+ $target = $( $this.data('target') || $this.attr('href') );
109
+ $target.toggleClass($class);
110
+ $this.toggleClass('active');
111
+ });
112
+
113
+ // panel toggle
114
+ $(document).on('click', '.panel-toggle', function(e){
115
+ e && e.preventDefault();
116
+ var $this = $(e.target), $class = 'collapse' , $target;
117
+ if (!$this.is('a')) $this = $this.closest('a');
118
+ $target = $this.closest('.panel');
119
+ $target.find('.panel-body').toggleClass($class);
120
+ $this.toggleClass('active');
121
+ });
122
+
123
+ // carousel
124
+ $('.carousel.auto').carousel();
125
+
126
+ // button loading
127
+ $(document).on('click.button.data-api', '[data-loading-text]', function (e) {
128
+ var $this = $(e.target);
129
+ $this.is('i') && ($this = $this.parent());
130
+ $this.button('loading');
131
+ });
132
+
133
+ // carousel swipe
134
+ $(".carousel").swiperight(function() {
135
+ $(this).find('.left').trigger('click');
136
+ });
137
+
138
+ $(".carousel").swipeleft(function() {
139
+ $(this).find('.right').trigger('click');
140
+ });
141
+
142
+ var is_touch_device = function() {
143
+ return !!('ontouchstart' in window) || !!('onmsgesturechange' in window);
144
+ };
145
+
146
+ !is_touch_device() && $('html').addClass('no-touch');
147
+
148
+ var scrollToTop = function(){
149
+ !location.hash && setTimeout(function () {
150
+ if (!pageYOffset) window.scrollTo(0, 0);
151
+ }, 1000);
152
+ };
153
+
154
+ var $window = $(window);
155
+ // mobile
156
+ var mobile = function(option){
157
+ if(option == 'reset'){
158
+ $('[data-toggle^="shift"]').shift('reset');
159
+ return;
160
+ }
161
+ scrollToTop();
162
+ $('[data-toggle^="shift"]').shift('init');
163
+ };
164
+ // unmobile
165
+ $window.width() < 768 && mobile();
166
+ $window.resize(function() {
167
+ $window.width() < 767 && mobile();
168
+ $window.width() >= 768 && mobile('reset');
169
+ });
170
+
171
+ });
172
+ }(window.jQuery);