repsheet_visualizer 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/repsheet_visualizer/application/app.rb +2 -2
- data/lib/repsheet_visualizer/application/public/javascripts/application.js +0 -4
- data/lib/repsheet_visualizer/application/views/activity.erb +5 -0
- data/lib/repsheet_visualizer/application/views/actors.erb +5 -0
- data/lib/repsheet_visualizer/application/views/breakdown.erb +5 -0
- data/lib/repsheet_visualizer/application/views/whitelist.erb +5 -0
- data/lib/repsheet_visualizer/application/views/worldview.erb +5 -0
- data/lib/repsheet_visualizer/version.rb +1 -1
- metadata +2 -289
- data/redesign/actor.html +0 -228
- data/redesign/chart-flot.html +0 -698
- data/redesign/chart-morris.html +0 -528
- data/redesign/chart-sparkline.html +0 -702
- data/redesign/css/App.css +0 -3436
- data/redesign/css/Login.css +0 -88
- data/redesign/css/bootstrap.min.css +0 -9
- data/redesign/css/custom.css +0 -0
- data/redesign/css/font-awesome.min.css +0 -395
- data/redesign/fonts/FontAwesome.otf +0 -0
- data/redesign/fonts/fontawesome-webfont.eot +0 -0
- data/redesign/fonts/fontawesome-webfont.svg +0 -414
- data/redesign/fonts/fontawesome-webfont.ttf +0 -0
- data/redesign/fonts/fontawesome-webfont.woff +0 -0
- data/redesign/fonts/glyphicons-halflings-regular.eot +0 -0
- data/redesign/fonts/glyphicons-halflings-regular.svg +0 -228
- data/redesign/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/redesign/fonts/glyphicons-halflings-regular.woff +0 -0
- data/redesign/form-extended.html +0 -1052
- data/redesign/form-regular.html +0 -863
- data/redesign/form-validation.html +0 -678
- data/redesign/img/avatars/avatar-1.jpg +0 -0
- data/redesign/img/avatars/avatar-2.jpg +0 -0
- data/redesign/img/avatars/avatar-large-1.jpg +0 -0
- data/redesign/img/avatars/avatar-large-2.jpg +0 -0
- data/redesign/img/gallery/zoom.png +0 -0
- data/redesign/img/jquery/handle-vertical.png +0 -0
- data/redesign/img/jquery/handle.png +0 -0
- data/redesign/img/layout/sidebar-bg.png +0 -0
- data/redesign/img/loaders/ajax-loader.gif +0 -0
- data/redesign/img/logos/logo-login.png +0 -0
- data/redesign/img/logos/logo.png +0 -0
- data/redesign/img/mockup.png +0 -0
- data/redesign/img/photos/blur-lg.jpg +0 -0
- data/redesign/img/photos/blur-sm.jpg +0 -0
- data/redesign/img/photos/clock-lg.jpg +0 -0
- data/redesign/img/photos/clock-sm.jpg +0 -0
- data/redesign/img/photos/lens-lg.jpg +0 -0
- data/redesign/img/photos/lens-sm.jpg +0 -0
- data/redesign/img/photos/map.png +0 -0
- data/redesign/img/photos/rust-lg.jpg +0 -0
- data/redesign/img/photos/rust-sm.jpg +0 -0
- data/redesign/img/pricing/label-editable.png +0 -0
- data/redesign/img/pricing/label-red.png +0 -0
- data/redesign/img/pricing/label-yellow.png +0 -0
- data/redesign/index.html +0 -328
- data/redesign/js/App.js +0 -372
- data/redesign/js/Login.js +0 -17
- data/redesign/js/demos/buttons.js +0 -7
- data/redesign/js/demos/calendar.js +0 -142
- data/redesign/js/demos/charts/flot/area.js +0 -73
- data/redesign/js/demos/charts/flot/chart1.js +0 -77
- data/redesign/js/demos/charts/flot/chart2.js +0 -70
- data/redesign/js/demos/charts/flot/chart3.js +0 -71
- data/redesign/js/demos/charts/flot/chart4.js +0 -69
- data/redesign/js/demos/charts/flot/donut.js +0 -49
- data/redesign/js/demos/charts/flot/horizontal.js +0 -56
- data/redesign/js/demos/charts/flot/line.js +0 -76
- data/redesign/js/demos/charts/flot/pie.js +0 -50
- data/redesign/js/demos/charts/flot/scatter.js +0 -62
- data/redesign/js/demos/charts/flot/stacked-area.js +0 -86
- data/redesign/js/demos/charts/flot/stacked-horizontal.js +0 -60
- data/redesign/js/demos/charts/flot/stacked-vertical.js +0 -75
- data/redesign/js/demos/charts/flot/vertical.js +0 -70
- data/redesign/js/demos/charts/morris/area.js +0 -28
- data/redesign/js/demos/charts/morris/bar.js +0 -29
- data/redesign/js/demos/charts/morris/donut.js +0 -26
- data/redesign/js/demos/charts/morris/line.js +0 -30
- data/redesign/js/demos/dashboard.js +0 -26
- data/redesign/js/demos/form-extended.js +0 -61
- data/redesign/js/demos/popups.js +0 -16
- data/redesign/js/demos/pricing.js +0 -10
- data/redesign/js/demos/sliders.js +0 -77
- data/redesign/js/libs/bootstrap.js +0 -1999
- data/redesign/js/libs/bootstrap.min.js +0 -6
- data/redesign/js/libs/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- data/redesign/js/libs/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- data/redesign/js/libs/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
- data/redesign/js/libs/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/redesign/js/libs/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/redesign/js/libs/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/redesign/js/libs/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- data/redesign/js/libs/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/redesign/js/libs/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/redesign/js/libs/css/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
- data/redesign/js/libs/css/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
- data/redesign/js/libs/css/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
- data/redesign/js/libs/css/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
- data/redesign/js/libs/css/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
- data/redesign/js/libs/css/ui-lightness/jquery-ui-1.9.2.custom.css +0 -294
- data/redesign/js/libs/css/ui-lightness/jquery-ui-1.9.2.custom.min.css +0 -7
- data/redesign/js/libs/jquery-1.9.1.min.js +0 -5
- data/redesign/js/libs/jquery-ui-1.9.2.custom.min.js +0 -6
- data/redesign/js/libs/jquery.min.map +0 -1
- data/redesign/js/libs/raphael-2.1.2.min.js +0 -11
- data/redesign/js/plugins/autosize/jquery.autosize.min.js +0 -7
- data/redesign/js/plugins/datatables/DT_bootstrap.js +0 -148
- data/redesign/js/plugins/datatables/img/Sorting icons.psd +0 -0
- data/redesign/js/plugins/datatables/img/back_disabled.png +0 -0
- data/redesign/js/plugins/datatables/img/back_enabled.png +0 -0
- data/redesign/js/plugins/datatables/img/back_enabled_hover.png +0 -0
- data/redesign/js/plugins/datatables/img/datatable-row-openclose.png +0 -0
- data/redesign/js/plugins/datatables/img/favicon.ico +0 -0
- data/redesign/js/plugins/datatables/img/forward_disabled.png +0 -0
- data/redesign/js/plugins/datatables/img/forward_enabled.png +0 -0
- data/redesign/js/plugins/datatables/img/forward_enabled_hover.png +0 -0
- data/redesign/js/plugins/datatables/img/sort_asc.png +0 -0
- data/redesign/js/plugins/datatables/img/sort_asc_disabled.png +0 -0
- data/redesign/js/plugins/datatables/img/sort_both.png +0 -0
- data/redesign/js/plugins/datatables/img/sort_desc.png +0 -0
- data/redesign/js/plugins/datatables/img/sort_desc_disabled.png +0 -0
- data/redesign/js/plugins/datatables/jquery.dataTables.min.js +0 -155
- data/redesign/js/plugins/datepicker/bootstrap-datepicker.js +0 -1258
- data/redesign/js/plugins/datepicker/datepicker.css +0 -481
- data/redesign/js/plugins/datepicker/less/datepicker.less +0 -122
- data/redesign/js/plugins/fileupload/bootstrap-fileupload.css +0 -132
- data/redesign/js/plugins/fileupload/bootstrap-fileupload.js +0 -169
- data/redesign/js/plugins/fileupload/bootstrap-fileupload.min.css +0 -31
- data/redesign/js/plugins/fileupload/bootstrap-fileupload.min.js +0 -7
- data/redesign/js/plugins/flot/jquery.flot.js +0 -2599
- data/redesign/js/plugins/flot/jquery.flot.orderBars.js +0 -186
- data/redesign/js/plugins/flot/jquery.flot.pie.js +0 -750
- data/redesign/js/plugins/flot/jquery.flot.resize.js +0 -57
- data/redesign/js/plugins/flot/jquery.flot.stack.js +0 -184
- data/redesign/js/plugins/flot/jquery.flot.tooltip.min.js +0 -14
- data/redesign/js/plugins/fullcalendar/fullcalendar.css +0 -589
- data/redesign/js/plugins/fullcalendar/fullcalendar.js +0 -6110
- data/redesign/js/plugins/fullcalendar/fullcalendar.min.js +0 -7
- data/redesign/js/plugins/fullcalendar/fullcalendar.print.css +0 -32
- data/redesign/js/plugins/fullcalendar/gcal.js +0 -107
- data/redesign/js/plugins/howl/howl.js +0 -70
- data/redesign/js/plugins/howl/howl.min.js +0 -2
- data/redesign/js/plugins/icheck/jquery.icheck.js +0 -462
- data/redesign/js/plugins/icheck/jquery.icheck.min.js +0 -11
- data/redesign/js/plugins/icheck/skins/all.css +0 -61
- data/redesign/js/plugins/icheck/skins/flat/_all.css +0 -540
- data/redesign/js/plugins/icheck/skins/flat/aero.css +0 -54
- data/redesign/js/plugins/icheck/skins/flat/aero.png +0 -0
- data/redesign/js/plugins/icheck/skins/flat/aero@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/flat/blue.css +0 -54
- data/redesign/js/plugins/icheck/skins/flat/blue.png +0 -0
- data/redesign/js/plugins/icheck/skins/flat/blue@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/flat/flat.css +0 -54
- data/redesign/js/plugins/icheck/skins/flat/flat.png +0 -0
- data/redesign/js/plugins/icheck/skins/flat/flat@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/flat/green.css +0 -54
- data/redesign/js/plugins/icheck/skins/flat/green.png +0 -0
- data/redesign/js/plugins/icheck/skins/flat/green@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/flat/grey.css +0 -54
- data/redesign/js/plugins/icheck/skins/flat/grey.png +0 -0
- data/redesign/js/plugins/icheck/skins/flat/grey@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/flat/orange.css +0 -54
- data/redesign/js/plugins/icheck/skins/flat/orange.png +0 -0
- data/redesign/js/plugins/icheck/skins/flat/orange@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/flat/pink.css +0 -54
- data/redesign/js/plugins/icheck/skins/flat/pink.png +0 -0
- data/redesign/js/plugins/icheck/skins/flat/pink@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/flat/purple.css +0 -54
- data/redesign/js/plugins/icheck/skins/flat/purple.png +0 -0
- data/redesign/js/plugins/icheck/skins/flat/purple@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/flat/red.css +0 -54
- data/redesign/js/plugins/icheck/skins/flat/red.png +0 -0
- data/redesign/js/plugins/icheck/skins/flat/red@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/flat/yellow.css +0 -54
- data/redesign/js/plugins/icheck/skins/flat/yellow.png +0 -0
- data/redesign/js/plugins/icheck/skins/flat/yellow@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/futurico/futurico.css +0 -54
- data/redesign/js/plugins/icheck/skins/futurico/futurico.png +0 -0
- data/redesign/js/plugins/icheck/skins/futurico/futurico@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/line/_all.css +0 -740
- data/redesign/js/plugins/icheck/skins/line/aero.css +0 -74
- data/redesign/js/plugins/icheck/skins/line/blue.css +0 -74
- data/redesign/js/plugins/icheck/skins/line/green.css +0 -74
- data/redesign/js/plugins/icheck/skins/line/grey.css +0 -74
- data/redesign/js/plugins/icheck/skins/line/line.css +0 -74
- data/redesign/js/plugins/icheck/skins/line/line.png +0 -0
- data/redesign/js/plugins/icheck/skins/line/line@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/line/orange.css +0 -74
- data/redesign/js/plugins/icheck/skins/line/pink.css +0 -74
- data/redesign/js/plugins/icheck/skins/line/purple.css +0 -74
- data/redesign/js/plugins/icheck/skins/line/red.css +0 -74
- data/redesign/js/plugins/icheck/skins/line/yellow.css +0 -74
- data/redesign/js/plugins/icheck/skins/minimal/_all.css +0 -600
- data/redesign/js/plugins/icheck/skins/minimal/aero.css +0 -60
- data/redesign/js/plugins/icheck/skins/minimal/aero.png +0 -0
- data/redesign/js/plugins/icheck/skins/minimal/aero@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/minimal/blue.css +0 -60
- data/redesign/js/plugins/icheck/skins/minimal/blue.png +0 -0
- data/redesign/js/plugins/icheck/skins/minimal/blue@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/minimal/green.css +0 -60
- data/redesign/js/plugins/icheck/skins/minimal/green.png +0 -0
- data/redesign/js/plugins/icheck/skins/minimal/green@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/minimal/grey.css +0 -60
- data/redesign/js/plugins/icheck/skins/minimal/grey.png +0 -0
- data/redesign/js/plugins/icheck/skins/minimal/grey@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/minimal/minimal.css +0 -60
- data/redesign/js/plugins/icheck/skins/minimal/minimal.png +0 -0
- data/redesign/js/plugins/icheck/skins/minimal/minimal@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/minimal/orange.css +0 -60
- data/redesign/js/plugins/icheck/skins/minimal/orange.png +0 -0
- data/redesign/js/plugins/icheck/skins/minimal/orange@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/minimal/pink.css +0 -60
- data/redesign/js/plugins/icheck/skins/minimal/pink.png +0 -0
- data/redesign/js/plugins/icheck/skins/minimal/pink@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/minimal/purple.css +0 -60
- data/redesign/js/plugins/icheck/skins/minimal/purple.png +0 -0
- data/redesign/js/plugins/icheck/skins/minimal/purple@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/minimal/red.css +0 -60
- data/redesign/js/plugins/icheck/skins/minimal/red.png +0 -0
- data/redesign/js/plugins/icheck/skins/minimal/red@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/minimal/yellow.css +0 -60
- data/redesign/js/plugins/icheck/skins/minimal/yellow.png +0 -0
- data/redesign/js/plugins/icheck/skins/minimal/yellow@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/polaris/polaris.css +0 -60
- data/redesign/js/plugins/icheck/skins/polaris/polaris.png +0 -0
- data/redesign/js/plugins/icheck/skins/polaris/polaris@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/square/_all.css +0 -600
- data/redesign/js/plugins/icheck/skins/square/aero.css +0 -60
- data/redesign/js/plugins/icheck/skins/square/aero.png +0 -0
- data/redesign/js/plugins/icheck/skins/square/aero@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/square/blue.css +0 -60
- data/redesign/js/plugins/icheck/skins/square/blue.png +0 -0
- data/redesign/js/plugins/icheck/skins/square/blue@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/square/green.css +0 -60
- data/redesign/js/plugins/icheck/skins/square/green.png +0 -0
- data/redesign/js/plugins/icheck/skins/square/green@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/square/grey.css +0 -60
- data/redesign/js/plugins/icheck/skins/square/grey.png +0 -0
- data/redesign/js/plugins/icheck/skins/square/grey@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/square/orange.css +0 -60
- data/redesign/js/plugins/icheck/skins/square/orange.png +0 -0
- data/redesign/js/plugins/icheck/skins/square/orange@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/square/pink.css +0 -60
- data/redesign/js/plugins/icheck/skins/square/pink.png +0 -0
- data/redesign/js/plugins/icheck/skins/square/pink@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/square/purple.css +0 -60
- data/redesign/js/plugins/icheck/skins/square/purple.png +0 -0
- data/redesign/js/plugins/icheck/skins/square/purple@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/square/red.css +0 -60
- data/redesign/js/plugins/icheck/skins/square/red.png +0 -0
- data/redesign/js/plugins/icheck/skins/square/red@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/square/square.css +0 -60
- data/redesign/js/plugins/icheck/skins/square/square.png +0 -0
- data/redesign/js/plugins/icheck/skins/square/square@2x.png +0 -0
- data/redesign/js/plugins/icheck/skins/square/yellow.css +0 -60
- data/redesign/js/plugins/icheck/skins/square/yellow.png +0 -0
- data/redesign/js/plugins/icheck/skins/square/yellow@2x.png +0 -0
- data/redesign/js/plugins/magnific/jquery.magnific-popup.js +0 -2026
- data/redesign/js/plugins/magnific/jquery.magnific-popup.min.js +0 -4
- data/redesign/js/plugins/magnific/magnific-popup.css +0 -396
- data/redesign/js/plugins/morris/morris.css +0 -1
- data/redesign/js/plugins/morris/morris.min.js +0 -1
- data/redesign/js/plugins/parsley/parsley.js +0 -1363
- data/redesign/js/plugins/select2/select2-spinner.gif +0 -0
- data/redesign/js/plugins/select2/select2.css +0 -615
- data/redesign/js/plugins/select2/select2.js +0 -3217
- data/redesign/js/plugins/select2/select2.min.js +0 -22
- data/redesign/js/plugins/select2/select2.png +0 -0
- data/redesign/js/plugins/select2/select2x2.png +0 -0
- data/redesign/js/plugins/simplecolorpicker/jquery.simplecolorpicker.css +0 -98
- data/redesign/js/plugins/simplecolorpicker/jquery.simplecolorpicker.js +0 -211
- data/redesign/js/plugins/sparkline/jquery.sparkline.min.js +0 -5
- data/redesign/js/plugins/tableCheckable/jquery.tableCheckable.js +0 -122
- data/redesign/js/plugins/textarea-counter/jquery.textarea-counter.js +0 -163
- data/redesign/js/plugins/timepicker/bootstrap-timepicker.css +0 -121
- data/redesign/js/plugins/timepicker/bootstrap-timepicker.js +0 -893
- data/redesign/page-404.html +0 -446
- data/redesign/page-500.html +0 -453
- data/redesign/page-blank.html +0 -417
- data/redesign/page-calendar.html +0 -491
- data/redesign/page-gallery.html +0 -736
- data/redesign/page-invoice.html +0 -705
- data/redesign/page-login-social.html +0 -111
- data/redesign/page-login.html +0 -82
- data/redesign/page-pricing.html +0 -707
- data/redesign/page-settings.html +0 -665
- data/redesign/page-support.html +0 -825
- data/redesign/table-advanced.html +0 -1297
- data/redesign/table-basic.html +0 -777
- data/redesign/table-responsive.html +0 -720
- data/redesign/ui-buttons.html +0 -901
- data/redesign/ui-icons.html +0 -1392
- data/redesign/ui-popups.html +0 -781
- data/redesign/ui-portlets.html +0 -887
- data/redesign/ui-sliders.html +0 -520
- data/redesign/ui-tabs.html +0 -663
- data/redesign/ui-typography.html +0 -687
@@ -1,163 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* jQuery Textarea Characters Counter Plugin v 2.0
|
3
|
-
* Examples and documentation at: http://roy-jin.appspot.com/jsp/textareaCounter.jsp
|
4
|
-
* Copyright (c) 2010 Roy Jin
|
5
|
-
* Version: 2.0 (11-JUN-2010)
|
6
|
-
* Dual licensed under the MIT and GPL licenses:
|
7
|
-
* http://www.opensource.org/licenses/mit-license.php
|
8
|
-
* http://www.gnu.org/licenses/gpl.html
|
9
|
-
* Requires: jQuery v1.4.2 or later
|
10
|
-
*/
|
11
|
-
(function($){
|
12
|
-
$.fn.textareaCount = function(options, fn) {
|
13
|
-
var defaults = {
|
14
|
-
maxCharacterSize: -1,
|
15
|
-
originalStyle: 'originalTextareaInfo',
|
16
|
-
warningStyle: 'warningTextareaInfo',
|
17
|
-
warningNumber: 20,
|
18
|
-
displayFormat: '#input characters | #words words'
|
19
|
-
};
|
20
|
-
var options = $.extend(defaults, options);
|
21
|
-
|
22
|
-
var container = $(this);
|
23
|
-
|
24
|
-
$("<div class='charleft'> </div>").insertAfter(container);
|
25
|
-
|
26
|
-
//create charleft css
|
27
|
-
var charLeftCss = {
|
28
|
-
'width' : container.width()
|
29
|
-
};
|
30
|
-
|
31
|
-
var charLeftInfo = getNextCharLeftInformation(container);
|
32
|
-
charLeftInfo.addClass(options.originalStyle);
|
33
|
-
charLeftInfo.css(charLeftCss);
|
34
|
-
|
35
|
-
var numInput = 0;
|
36
|
-
var maxCharacters = options.maxCharacterSize;
|
37
|
-
var numLeft = 0;
|
38
|
-
var numWords = 0;
|
39
|
-
|
40
|
-
container.bind('keyup', function(event){limitTextAreaByCharacterCount();})
|
41
|
-
.bind('mouseover', function(event){setTimeout(function(){limitTextAreaByCharacterCount();}, 10);})
|
42
|
-
.bind('paste', function(event){setTimeout(function(){limitTextAreaByCharacterCount();}, 10);});
|
43
|
-
|
44
|
-
|
45
|
-
function limitTextAreaByCharacterCount(){
|
46
|
-
charLeftInfo.html(countByCharacters());
|
47
|
-
//function call back
|
48
|
-
if(typeof fn != 'undefined'){
|
49
|
-
fn.call(this, getInfo());
|
50
|
-
}
|
51
|
-
return true;
|
52
|
-
}
|
53
|
-
|
54
|
-
function countByCharacters(){
|
55
|
-
var content = container.val();
|
56
|
-
var contentLength = content.length;
|
57
|
-
|
58
|
-
//Start Cut
|
59
|
-
if(options.maxCharacterSize > 0){
|
60
|
-
//If copied content is already more than maxCharacterSize, chop it to maxCharacterSize.
|
61
|
-
if(contentLength >= options.maxCharacterSize) {
|
62
|
-
content = content.substring(0, options.maxCharacterSize);
|
63
|
-
}
|
64
|
-
|
65
|
-
var newlineCount = getNewlineCount(content);
|
66
|
-
|
67
|
-
// newlineCount new line character. For windows, it occupies 2 characters
|
68
|
-
var systemmaxCharacterSize = options.maxCharacterSize - newlineCount;
|
69
|
-
if (!isWin()){
|
70
|
-
systemmaxCharacterSize = options.maxCharacterSize
|
71
|
-
}
|
72
|
-
if(contentLength > systemmaxCharacterSize){
|
73
|
-
//avoid scroll bar moving
|
74
|
-
var originalScrollTopPosition = this.scrollTop;
|
75
|
-
container.val(content.substring(0, systemmaxCharacterSize));
|
76
|
-
this.scrollTop = originalScrollTopPosition;
|
77
|
-
}
|
78
|
-
charLeftInfo.removeClass(options.warningStyle);
|
79
|
-
if(systemmaxCharacterSize - contentLength <= options.warningNumber){
|
80
|
-
charLeftInfo.addClass(options.warningStyle);
|
81
|
-
}
|
82
|
-
|
83
|
-
numInput = container.val().length + newlineCount;
|
84
|
-
if(!isWin()){
|
85
|
-
numInput = container.val().length;
|
86
|
-
}
|
87
|
-
|
88
|
-
numWords = countWord(getCleanedWordString(container.val()));
|
89
|
-
|
90
|
-
numLeft = maxCharacters - numInput;
|
91
|
-
} else {
|
92
|
-
//normal count, no cut
|
93
|
-
var newlineCount = getNewlineCount(content);
|
94
|
-
numInput = container.val().length + newlineCount;
|
95
|
-
if(!isWin()){
|
96
|
-
numInput = container.val().length;
|
97
|
-
}
|
98
|
-
numWords = countWord(getCleanedWordString(container.val()));
|
99
|
-
}
|
100
|
-
|
101
|
-
return formatDisplayInfo();
|
102
|
-
}
|
103
|
-
|
104
|
-
function formatDisplayInfo(){
|
105
|
-
var format = options.displayFormat;
|
106
|
-
format = format.replace('#input', numInput);
|
107
|
-
format = format.replace('#words', numWords);
|
108
|
-
//When maxCharacters <= 0, #max, #left cannot be substituted.
|
109
|
-
if(maxCharacters > 0){
|
110
|
-
format = format.replace('#max', maxCharacters);
|
111
|
-
format = format.replace('#left', numLeft);
|
112
|
-
}
|
113
|
-
return format;
|
114
|
-
}
|
115
|
-
|
116
|
-
function getInfo(){
|
117
|
-
var info = {
|
118
|
-
input: numInput,
|
119
|
-
max: maxCharacters,
|
120
|
-
left: numLeft,
|
121
|
-
words: numWords
|
122
|
-
};
|
123
|
-
return info;
|
124
|
-
}
|
125
|
-
|
126
|
-
function getNextCharLeftInformation(container){
|
127
|
-
return container.next('.charleft');
|
128
|
-
}
|
129
|
-
|
130
|
-
function isWin(){
|
131
|
-
var strOS = navigator.appVersion;
|
132
|
-
if (strOS.toLowerCase().indexOf('win') != -1){
|
133
|
-
return true;
|
134
|
-
}
|
135
|
-
return false;
|
136
|
-
}
|
137
|
-
|
138
|
-
function getNewlineCount(content){
|
139
|
-
var newlineCount = 0;
|
140
|
-
for(var i=0; i<content.length;i++){
|
141
|
-
if(content.charAt(i) == '\n'){
|
142
|
-
newlineCount++;
|
143
|
-
}
|
144
|
-
}
|
145
|
-
return newlineCount;
|
146
|
-
}
|
147
|
-
|
148
|
-
function getCleanedWordString(content){
|
149
|
-
var fullStr = content + " ";
|
150
|
-
var initial_whitespace_rExp = /^[^A-Za-z0-9]+/gi;
|
151
|
-
var left_trimmedStr = fullStr.replace(initial_whitespace_rExp, "");
|
152
|
-
var non_alphanumerics_rExp = rExp = /[^A-Za-z0-9]+/gi;
|
153
|
-
var cleanedStr = left_trimmedStr.replace(non_alphanumerics_rExp, " ");
|
154
|
-
var splitString = cleanedStr.split(" ");
|
155
|
-
return splitString;
|
156
|
-
}
|
157
|
-
|
158
|
-
function countWord(cleanedWordString){
|
159
|
-
var word_count = cleanedWordString.length-1;
|
160
|
-
return word_count;
|
161
|
-
}
|
162
|
-
};
|
163
|
-
})(jQuery);
|
@@ -1,121 +0,0 @@
|
|
1
|
-
/*!
|
2
|
-
* Timepicker Component for Twitter Bootstrap
|
3
|
-
*
|
4
|
-
* Copyright 2013 Joris de Wit
|
5
|
-
*
|
6
|
-
* Contributors https://github.com/jdewit/bootstrap-timepicker/graphs/contributors
|
7
|
-
*
|
8
|
-
* For the full copyright and license information, please view the LICENSE
|
9
|
-
* file that was distributed with this source code.
|
10
|
-
*/
|
11
|
-
.bootstrap-timepicker {
|
12
|
-
position: relative;
|
13
|
-
}
|
14
|
-
.bootstrap-timepicker.pull-right .bootstrap-timepicker-widget.dropdown-menu {
|
15
|
-
left: auto;
|
16
|
-
right: 0;
|
17
|
-
}
|
18
|
-
.bootstrap-timepicker.pull-right .bootstrap-timepicker-widget.dropdown-menu:before {
|
19
|
-
left: auto;
|
20
|
-
right: 12px;
|
21
|
-
}
|
22
|
-
.bootstrap-timepicker.pull-right .bootstrap-timepicker-widget.dropdown-menu:after {
|
23
|
-
left: auto;
|
24
|
-
right: 13px;
|
25
|
-
}
|
26
|
-
.bootstrap-timepicker .add-on {
|
27
|
-
cursor: pointer;
|
28
|
-
}
|
29
|
-
.bootstrap-timepicker .add-on i {
|
30
|
-
display: inline-block;
|
31
|
-
width: 16px;
|
32
|
-
height: 16px;
|
33
|
-
}
|
34
|
-
.bootstrap-timepicker-widget.dropdown-menu {
|
35
|
-
padding: 2px 3px 2px 2px;
|
36
|
-
}
|
37
|
-
.bootstrap-timepicker-widget.dropdown-menu.open {
|
38
|
-
display: inline-block;
|
39
|
-
}
|
40
|
-
.bootstrap-timepicker-widget.dropdown-menu:before {
|
41
|
-
border-bottom: 7px solid rgba(0, 0, 0, 0.2);
|
42
|
-
border-left: 7px solid transparent;
|
43
|
-
border-right: 7px solid transparent;
|
44
|
-
content: "";
|
45
|
-
display: inline-block;
|
46
|
-
left: 9px;
|
47
|
-
position: absolute;
|
48
|
-
top: -7px;
|
49
|
-
}
|
50
|
-
.bootstrap-timepicker-widget.dropdown-menu:after {
|
51
|
-
border-bottom: 6px solid #FFFFFF;
|
52
|
-
border-left: 6px solid transparent;
|
53
|
-
border-right: 6px solid transparent;
|
54
|
-
content: "";
|
55
|
-
display: inline-block;
|
56
|
-
left: 10px;
|
57
|
-
position: absolute;
|
58
|
-
top: -6px;
|
59
|
-
}
|
60
|
-
.bootstrap-timepicker-widget a.btn,
|
61
|
-
.bootstrap-timepicker-widget input {
|
62
|
-
border-radius: 4px;
|
63
|
-
}
|
64
|
-
.bootstrap-timepicker-widget table {
|
65
|
-
width: 100%;
|
66
|
-
margin: 0;
|
67
|
-
}
|
68
|
-
.bootstrap-timepicker-widget table td {
|
69
|
-
text-align: center;
|
70
|
-
height: 30px;
|
71
|
-
margin: 0;
|
72
|
-
padding: 2px;
|
73
|
-
}
|
74
|
-
.bootstrap-timepicker-widget table td:not(.separator) {
|
75
|
-
min-width: 30px;
|
76
|
-
}
|
77
|
-
.bootstrap-timepicker-widget table td span {
|
78
|
-
width: 100%;
|
79
|
-
}
|
80
|
-
.bootstrap-timepicker-widget table td a {
|
81
|
-
border: 1px transparent solid;
|
82
|
-
width: 100%;
|
83
|
-
display: inline-block;
|
84
|
-
margin: 0;
|
85
|
-
padding: 8px 0;
|
86
|
-
outline: 0;
|
87
|
-
color: #333;
|
88
|
-
}
|
89
|
-
.bootstrap-timepicker-widget table td a:hover {
|
90
|
-
text-decoration: none;
|
91
|
-
background-color: #eee;
|
92
|
-
-webkit-border-radius: 4px;
|
93
|
-
-moz-border-radius: 4px;
|
94
|
-
border-radius: 4px;
|
95
|
-
border-color: #ddd;
|
96
|
-
}
|
97
|
-
.bootstrap-timepicker-widget table td a i {
|
98
|
-
margin-top: 2px;
|
99
|
-
}
|
100
|
-
.bootstrap-timepicker-widget table td input {
|
101
|
-
width: 25px;
|
102
|
-
margin: 0;
|
103
|
-
text-align: center;
|
104
|
-
}
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
@media (min-width: 767px) {
|
112
|
-
|
113
|
-
}
|
114
|
-
@media (max-width: 767px) {
|
115
|
-
.bootstrap-timepicker {
|
116
|
-
width: 100%;
|
117
|
-
}
|
118
|
-
.bootstrap-timepicker .dropdown-menu {
|
119
|
-
width: 100%;
|
120
|
-
}
|
121
|
-
}
|
@@ -1,893 +0,0 @@
|
|
1
|
-
/*!
|
2
|
-
* Timepicker Component for Twitter Bootstrap
|
3
|
-
*
|
4
|
-
* Copyright 2013 Joris de Wit
|
5
|
-
*
|
6
|
-
* Contributors https://github.com/jdewit/bootstrap-timepicker/graphs/contributors
|
7
|
-
*
|
8
|
-
* For the full copyright and license information, please view the LICENSE
|
9
|
-
* file that was distributed with this source code.
|
10
|
-
*/
|
11
|
-
(function($, window, document, undefined) {
|
12
|
-
'use strict';
|
13
|
-
|
14
|
-
// TIMEPICKER PUBLIC CLASS DEFINITION
|
15
|
-
var Timepicker = function(element, options) {
|
16
|
-
this.widget = '';
|
17
|
-
this.$element = $(element);
|
18
|
-
this.defaultTime = options.defaultTime;
|
19
|
-
this.disableFocus = options.disableFocus;
|
20
|
-
this.isOpen = options.isOpen;
|
21
|
-
this.minuteStep = options.minuteStep;
|
22
|
-
this.modalBackdrop = options.modalBackdrop;
|
23
|
-
this.secondStep = options.secondStep;
|
24
|
-
this.showInputs = options.showInputs;
|
25
|
-
this.showMeridian = options.showMeridian;
|
26
|
-
this.showSeconds = options.showSeconds;
|
27
|
-
this.template = options.template;
|
28
|
-
this.appendWidgetTo = options.appendWidgetTo;
|
29
|
-
|
30
|
-
this._init();
|
31
|
-
};
|
32
|
-
|
33
|
-
Timepicker.prototype = {
|
34
|
-
|
35
|
-
constructor: Timepicker,
|
36
|
-
|
37
|
-
_init: function() {
|
38
|
-
var self = this;
|
39
|
-
|
40
|
-
if (this.$element.parent().hasClass('input-group')) {
|
41
|
-
this.$element.parent('.input-group').find('.input-group-addon').on({
|
42
|
-
'click.timepicker': $.proxy(this.showWidget, this)
|
43
|
-
});
|
44
|
-
this.$element.on({
|
45
|
-
'focus.timepicker': $.proxy(this.highlightUnit, this),
|
46
|
-
'click.timepicker': $.proxy(this.highlightUnit, this),
|
47
|
-
'keydown.timepicker': $.proxy(this.elementKeydown, this),
|
48
|
-
'blur.timepicker': $.proxy(this.blurElement, this)
|
49
|
-
});
|
50
|
-
} else {
|
51
|
-
if (this.template) {
|
52
|
-
this.$element.on({
|
53
|
-
'focus.timepicker': $.proxy(this.showWidget, this),
|
54
|
-
'click.timepicker': $.proxy(this.showWidget, this),
|
55
|
-
'blur.timepicker': $.proxy(this.blurElement, this)
|
56
|
-
});
|
57
|
-
} else {
|
58
|
-
this.$element.on({
|
59
|
-
'focus.timepicker': $.proxy(this.highlightUnit, this),
|
60
|
-
'click.timepicker': $.proxy(this.highlightUnit, this),
|
61
|
-
'keydown.timepicker': $.proxy(this.elementKeydown, this),
|
62
|
-
'blur.timepicker': $.proxy(this.blurElement, this)
|
63
|
-
});
|
64
|
-
}
|
65
|
-
}
|
66
|
-
|
67
|
-
if (this.template !== false) {
|
68
|
-
this.$widget = $(this.getTemplate()).prependTo(this.$element.parents(this.appendWidgetTo)).on('click', $.proxy(this.widgetClick, this));
|
69
|
-
} else {
|
70
|
-
this.$widget = false;
|
71
|
-
}
|
72
|
-
|
73
|
-
if (this.showInputs && this.$widget !== false) {
|
74
|
-
this.$widget.find('input').each(function() {
|
75
|
-
$(this).on({
|
76
|
-
'click.timepicker': function() { $(this).select(); },
|
77
|
-
'keydown.timepicker': $.proxy(self.widgetKeydown, self)
|
78
|
-
});
|
79
|
-
});
|
80
|
-
}
|
81
|
-
|
82
|
-
this.setDefaultTime(this.defaultTime);
|
83
|
-
},
|
84
|
-
|
85
|
-
blurElement: function() {
|
86
|
-
this.highlightedUnit = undefined;
|
87
|
-
this.updateFromElementVal();
|
88
|
-
},
|
89
|
-
|
90
|
-
decrementHour: function() {
|
91
|
-
if (this.showMeridian) {
|
92
|
-
if (this.hour === 1) {
|
93
|
-
this.hour = 12;
|
94
|
-
} else if (this.hour === 12) {
|
95
|
-
this.hour--;
|
96
|
-
|
97
|
-
return this.toggleMeridian();
|
98
|
-
} else if (this.hour === 0) {
|
99
|
-
this.hour = 11;
|
100
|
-
|
101
|
-
return this.toggleMeridian();
|
102
|
-
} else {
|
103
|
-
this.hour--;
|
104
|
-
}
|
105
|
-
} else {
|
106
|
-
if (this.hour === 0) {
|
107
|
-
this.hour = 23;
|
108
|
-
} else {
|
109
|
-
this.hour--;
|
110
|
-
}
|
111
|
-
}
|
112
|
-
this.update();
|
113
|
-
},
|
114
|
-
|
115
|
-
decrementMinute: function(step) {
|
116
|
-
var newVal;
|
117
|
-
|
118
|
-
if (step) {
|
119
|
-
newVal = this.minute - step;
|
120
|
-
} else {
|
121
|
-
newVal = this.minute - this.minuteStep;
|
122
|
-
}
|
123
|
-
|
124
|
-
if (newVal < 0) {
|
125
|
-
this.decrementHour();
|
126
|
-
this.minute = newVal + 60;
|
127
|
-
} else {
|
128
|
-
this.minute = newVal;
|
129
|
-
}
|
130
|
-
this.update();
|
131
|
-
},
|
132
|
-
|
133
|
-
decrementSecond: function() {
|
134
|
-
var newVal = this.second - this.secondStep;
|
135
|
-
|
136
|
-
if (newVal < 0) {
|
137
|
-
this.decrementMinute(true);
|
138
|
-
this.second = newVal + 60;
|
139
|
-
} else {
|
140
|
-
this.second = newVal;
|
141
|
-
}
|
142
|
-
this.update();
|
143
|
-
},
|
144
|
-
|
145
|
-
elementKeydown: function(e) {
|
146
|
-
switch (e.keyCode) {
|
147
|
-
case 9: //tab
|
148
|
-
this.updateFromElementVal();
|
149
|
-
|
150
|
-
switch (this.highlightedUnit) {
|
151
|
-
case 'hour':
|
152
|
-
e.preventDefault();
|
153
|
-
this.highlightNextUnit();
|
154
|
-
break;
|
155
|
-
case 'minute':
|
156
|
-
if (this.showMeridian || this.showSeconds) {
|
157
|
-
e.preventDefault();
|
158
|
-
this.highlightNextUnit();
|
159
|
-
}
|
160
|
-
break;
|
161
|
-
case 'second':
|
162
|
-
if (this.showMeridian) {
|
163
|
-
e.preventDefault();
|
164
|
-
this.highlightNextUnit();
|
165
|
-
}
|
166
|
-
break;
|
167
|
-
}
|
168
|
-
break;
|
169
|
-
case 27: // escape
|
170
|
-
this.updateFromElementVal();
|
171
|
-
break;
|
172
|
-
case 37: // left arrow
|
173
|
-
e.preventDefault();
|
174
|
-
this.highlightPrevUnit();
|
175
|
-
this.updateFromElementVal();
|
176
|
-
break;
|
177
|
-
case 38: // up arrow
|
178
|
-
e.preventDefault();
|
179
|
-
switch (this.highlightedUnit) {
|
180
|
-
case 'hour':
|
181
|
-
this.incrementHour();
|
182
|
-
this.highlightHour();
|
183
|
-
break;
|
184
|
-
case 'minute':
|
185
|
-
this.incrementMinute();
|
186
|
-
this.highlightMinute();
|
187
|
-
break;
|
188
|
-
case 'second':
|
189
|
-
this.incrementSecond();
|
190
|
-
this.highlightSecond();
|
191
|
-
break;
|
192
|
-
case 'meridian':
|
193
|
-
this.toggleMeridian();
|
194
|
-
this.highlightMeridian();
|
195
|
-
break;
|
196
|
-
}
|
197
|
-
break;
|
198
|
-
case 39: // right arrow
|
199
|
-
e.preventDefault();
|
200
|
-
this.updateFromElementVal();
|
201
|
-
this.highlightNextUnit();
|
202
|
-
break;
|
203
|
-
case 40: // down arrow
|
204
|
-
e.preventDefault();
|
205
|
-
switch (this.highlightedUnit) {
|
206
|
-
case 'hour':
|
207
|
-
this.decrementHour();
|
208
|
-
this.highlightHour();
|
209
|
-
break;
|
210
|
-
case 'minute':
|
211
|
-
this.decrementMinute();
|
212
|
-
this.highlightMinute();
|
213
|
-
break;
|
214
|
-
case 'second':
|
215
|
-
this.decrementSecond();
|
216
|
-
this.highlightSecond();
|
217
|
-
break;
|
218
|
-
case 'meridian':
|
219
|
-
this.toggleMeridian();
|
220
|
-
this.highlightMeridian();
|
221
|
-
break;
|
222
|
-
}
|
223
|
-
break;
|
224
|
-
}
|
225
|
-
},
|
226
|
-
|
227
|
-
formatTime: function(hour, minute, second, meridian) {
|
228
|
-
hour = hour < 10 ? '0' + hour : hour;
|
229
|
-
minute = minute < 10 ? '0' + minute : minute;
|
230
|
-
second = second < 10 ? '0' + second : second;
|
231
|
-
|
232
|
-
return hour + ':' + minute + (this.showSeconds ? ':' + second : '') + (this.showMeridian ? ' ' + meridian : '');
|
233
|
-
},
|
234
|
-
|
235
|
-
getCursorPosition: function() {
|
236
|
-
var input = this.$element.get(0);
|
237
|
-
|
238
|
-
if ('selectionStart' in input) {// Standard-compliant browsers
|
239
|
-
|
240
|
-
return input.selectionStart;
|
241
|
-
} else if (document.selection) {// IE fix
|
242
|
-
input.focus();
|
243
|
-
var sel = document.selection.createRange(),
|
244
|
-
selLen = document.selection.createRange().text.length;
|
245
|
-
|
246
|
-
sel.moveStart('character', - input.value.length);
|
247
|
-
|
248
|
-
return sel.text.length - selLen;
|
249
|
-
}
|
250
|
-
},
|
251
|
-
|
252
|
-
getTemplate: function() {
|
253
|
-
var template,
|
254
|
-
hourTemplate,
|
255
|
-
minuteTemplate,
|
256
|
-
secondTemplate,
|
257
|
-
meridianTemplate,
|
258
|
-
templateContent;
|
259
|
-
|
260
|
-
if (this.showInputs) {
|
261
|
-
hourTemplate = '<input type="text" name="hour" class="bootstrap-timepicker-hour" maxlength="2"/>';
|
262
|
-
minuteTemplate = '<input type="text" name="minute" class="bootstrap-timepicker-minute" maxlength="2"/>';
|
263
|
-
secondTemplate = '<input type="text" name="second" class="bootstrap-timepicker-second" maxlength="2"/>';
|
264
|
-
meridianTemplate = '<input type="text" name="meridian" class="bootstrap-timepicker-meridian" maxlength="2"/>';
|
265
|
-
} else {
|
266
|
-
hourTemplate = '<span class="bootstrap-timepicker-hour"></span>';
|
267
|
-
minuteTemplate = '<span class="bootstrap-timepicker-minute"></span>';
|
268
|
-
secondTemplate = '<span class="bootstrap-timepicker-second"></span>';
|
269
|
-
meridianTemplate = '<span class="bootstrap-timepicker-meridian"></span>';
|
270
|
-
}
|
271
|
-
|
272
|
-
templateContent = '<table>'+
|
273
|
-
'<tr>'+
|
274
|
-
'<td><a href="#" data-action="incrementHour"><i class="fa fa-chevron-up"></i></a></td>'+
|
275
|
-
'<td class="separator"> </td>'+
|
276
|
-
'<td><a href="#" data-action="incrementMinute"><i class="fa fa-chevron-up"></i></a></td>'+
|
277
|
-
(this.showSeconds ?
|
278
|
-
'<td class="separator"> </td>'+
|
279
|
-
'<td><a href="#" data-action="incrementSecond"><i class="fa fa-chevron-up"></i></a></td>'
|
280
|
-
: '') +
|
281
|
-
(this.showMeridian ?
|
282
|
-
'<td class="separator"> </td>'+
|
283
|
-
'<td class="meridian-column"><a href="#" data-action="toggleMeridian"><i class="fa fa-chevron-up"></i></a></td>'
|
284
|
-
: '') +
|
285
|
-
'</tr>'+
|
286
|
-
'<tr>'+
|
287
|
-
'<td>'+ hourTemplate +'</td> '+
|
288
|
-
'<td class="separator">:</td>'+
|
289
|
-
'<td>'+ minuteTemplate +'</td> '+
|
290
|
-
(this.showSeconds ?
|
291
|
-
'<td class="separator">:</td>'+
|
292
|
-
'<td>'+ secondTemplate +'</td>'
|
293
|
-
: '') +
|
294
|
-
(this.showMeridian ?
|
295
|
-
'<td class="separator"> </td>'+
|
296
|
-
'<td>'+ meridianTemplate +'</td>'
|
297
|
-
: '') +
|
298
|
-
'</tr>'+
|
299
|
-
'<tr>'+
|
300
|
-
'<td><a href="#" data-action="decrementHour"><i class="fa fa-chevron-down"></i></a></td>'+
|
301
|
-
'<td class="separator"></td>'+
|
302
|
-
'<td><a href="#" data-action="decrementMinute"><i class="fa fa-chevron-down"></i></a></td>'+
|
303
|
-
(this.showSeconds ?
|
304
|
-
'<td class="separator"> </td>'+
|
305
|
-
'<td><a href="#" data-action="decrementSecond"><i class="fa fa-chevron-down"></i></a></td>'
|
306
|
-
: '') +
|
307
|
-
(this.showMeridian ?
|
308
|
-
'<td class="separator"> </td>'+
|
309
|
-
'<td><a href="#" data-action="toggleMeridian"><i class="fa fa-chevron-down"></i></a></td>'
|
310
|
-
: '') +
|
311
|
-
'</tr>'+
|
312
|
-
'</table>';
|
313
|
-
|
314
|
-
switch(this.template) {
|
315
|
-
case 'modal':
|
316
|
-
template = '<div class="bootstrap-timepicker-widget modal fade" data-backdrop="'+ (this.modalBackdrop ? 'true' : 'false') +'">'+
|
317
|
-
'<div class="modal-dialog">' +
|
318
|
-
'<div class="modal-content">' +
|
319
|
-
'<div class="modal-header">'+
|
320
|
-
'<a href="#" class="close" data-dismiss="modal">×</a>'+
|
321
|
-
'<h3>Pick a Time</h3>'+
|
322
|
-
'</div>'+
|
323
|
-
'<div class="modal-body">'+
|
324
|
-
templateContent +
|
325
|
-
'</div>'+
|
326
|
-
'<div class="modal-footer">'+
|
327
|
-
'<a href="#" class="btn btn-sm btn-primary" data-dismiss="modal">OK</a>'+
|
328
|
-
'</div>'+
|
329
|
-
|
330
|
-
'</div>' +
|
331
|
-
'</div>' +
|
332
|
-
'</div>';
|
333
|
-
break;
|
334
|
-
case 'dropdown':
|
335
|
-
template = '<div class="bootstrap-timepicker-widget dropdown-menu">'+ templateContent +'</div>';
|
336
|
-
break;
|
337
|
-
}
|
338
|
-
|
339
|
-
return template;
|
340
|
-
},
|
341
|
-
|
342
|
-
getTime: function() {
|
343
|
-
return this.formatTime(this.hour, this.minute, this.second, this.meridian);
|
344
|
-
},
|
345
|
-
|
346
|
-
hideWidget: function() {
|
347
|
-
if (this.isOpen === false) {
|
348
|
-
return;
|
349
|
-
}
|
350
|
-
|
351
|
-
if (this.showInputs) {
|
352
|
-
this.updateFromWidgetInputs();
|
353
|
-
}
|
354
|
-
|
355
|
-
this.$element.trigger({
|
356
|
-
'type': 'hide.timepicker',
|
357
|
-
'time': {
|
358
|
-
'value': this.getTime(),
|
359
|
-
'hours': this.hour,
|
360
|
-
'minutes': this.minute,
|
361
|
-
'seconds': this.second,
|
362
|
-
'meridian': this.meridian
|
363
|
-
}
|
364
|
-
});
|
365
|
-
|
366
|
-
if (this.template === 'modal' && this.$widget.modal) {
|
367
|
-
this.$widget.modal('hide');
|
368
|
-
} else {
|
369
|
-
this.$widget.removeClass('open');
|
370
|
-
}
|
371
|
-
|
372
|
-
$(document).off('mousedown.timepicker');
|
373
|
-
|
374
|
-
this.isOpen = false;
|
375
|
-
},
|
376
|
-
|
377
|
-
highlightUnit: function() {
|
378
|
-
this.position = this.getCursorPosition();
|
379
|
-
if (this.position >= 0 && this.position <= 2) {
|
380
|
-
this.highlightHour();
|
381
|
-
} else if (this.position >= 3 && this.position <= 5) {
|
382
|
-
this.highlightMinute();
|
383
|
-
} else if (this.position >= 6 && this.position <= 8) {
|
384
|
-
if (this.showSeconds) {
|
385
|
-
this.highlightSecond();
|
386
|
-
} else {
|
387
|
-
this.highlightMeridian();
|
388
|
-
}
|
389
|
-
} else if (this.position >= 9 && this.position <= 11) {
|
390
|
-
this.highlightMeridian();
|
391
|
-
}
|
392
|
-
},
|
393
|
-
|
394
|
-
highlightNextUnit: function() {
|
395
|
-
switch (this.highlightedUnit) {
|
396
|
-
case 'hour':
|
397
|
-
this.highlightMinute();
|
398
|
-
break;
|
399
|
-
case 'minute':
|
400
|
-
if (this.showSeconds) {
|
401
|
-
this.highlightSecond();
|
402
|
-
} else if (this.showMeridian){
|
403
|
-
this.highlightMeridian();
|
404
|
-
} else {
|
405
|
-
this.highlightHour();
|
406
|
-
}
|
407
|
-
break;
|
408
|
-
case 'second':
|
409
|
-
if (this.showMeridian) {
|
410
|
-
this.highlightMeridian();
|
411
|
-
} else {
|
412
|
-
this.highlightHour();
|
413
|
-
}
|
414
|
-
break;
|
415
|
-
case 'meridian':
|
416
|
-
this.highlightHour();
|
417
|
-
break;
|
418
|
-
}
|
419
|
-
},
|
420
|
-
|
421
|
-
highlightPrevUnit: function() {
|
422
|
-
switch (this.highlightedUnit) {
|
423
|
-
case 'hour':
|
424
|
-
this.highlightMeridian();
|
425
|
-
break;
|
426
|
-
case 'minute':
|
427
|
-
this.highlightHour();
|
428
|
-
break;
|
429
|
-
case 'second':
|
430
|
-
this.highlightMinute();
|
431
|
-
break;
|
432
|
-
case 'meridian':
|
433
|
-
if (this.showSeconds) {
|
434
|
-
this.highlightSecond();
|
435
|
-
} else {
|
436
|
-
this.highlightMinute();
|
437
|
-
}
|
438
|
-
break;
|
439
|
-
}
|
440
|
-
},
|
441
|
-
|
442
|
-
highlightHour: function() {
|
443
|
-
var $element = this.$element.get(0);
|
444
|
-
|
445
|
-
this.highlightedUnit = 'hour';
|
446
|
-
|
447
|
-
if ($element.setSelectionRange) {
|
448
|
-
setTimeout(function() {
|
449
|
-
$element.setSelectionRange(0,2);
|
450
|
-
}, 0);
|
451
|
-
}
|
452
|
-
},
|
453
|
-
|
454
|
-
highlightMinute: function() {
|
455
|
-
var $element = this.$element.get(0);
|
456
|
-
|
457
|
-
this.highlightedUnit = 'minute';
|
458
|
-
|
459
|
-
if ($element.setSelectionRange) {
|
460
|
-
setTimeout(function() {
|
461
|
-
$element.setSelectionRange(3,5);
|
462
|
-
}, 0);
|
463
|
-
}
|
464
|
-
},
|
465
|
-
|
466
|
-
highlightSecond: function() {
|
467
|
-
var $element = this.$element.get(0);
|
468
|
-
|
469
|
-
this.highlightedUnit = 'second';
|
470
|
-
|
471
|
-
if ($element.setSelectionRange) {
|
472
|
-
setTimeout(function() {
|
473
|
-
$element.setSelectionRange(6,8);
|
474
|
-
}, 0);
|
475
|
-
}
|
476
|
-
},
|
477
|
-
|
478
|
-
highlightMeridian: function() {
|
479
|
-
var $element = this.$element.get(0);
|
480
|
-
|
481
|
-
this.highlightedUnit = 'meridian';
|
482
|
-
|
483
|
-
if ($element.setSelectionRange) {
|
484
|
-
if (this.showSeconds) {
|
485
|
-
setTimeout(function() {
|
486
|
-
$element.setSelectionRange(9,11);
|
487
|
-
}, 0);
|
488
|
-
} else {
|
489
|
-
setTimeout(function() {
|
490
|
-
$element.setSelectionRange(6,8);
|
491
|
-
}, 0);
|
492
|
-
}
|
493
|
-
}
|
494
|
-
},
|
495
|
-
|
496
|
-
incrementHour: function() {
|
497
|
-
if (this.showMeridian) {
|
498
|
-
if (this.hour === 11) {
|
499
|
-
this.hour++;
|
500
|
-
return this.toggleMeridian();
|
501
|
-
} else if (this.hour === 12) {
|
502
|
-
this.hour = 0;
|
503
|
-
}
|
504
|
-
}
|
505
|
-
if (this.hour === 23) {
|
506
|
-
this.hour = 0;
|
507
|
-
|
508
|
-
return;
|
509
|
-
}
|
510
|
-
this.hour++;
|
511
|
-
this.update();
|
512
|
-
},
|
513
|
-
|
514
|
-
incrementMinute: function(step) {
|
515
|
-
var newVal;
|
516
|
-
|
517
|
-
if (step) {
|
518
|
-
newVal = this.minute + step;
|
519
|
-
} else {
|
520
|
-
newVal = this.minute + this.minuteStep - (this.minute % this.minuteStep);
|
521
|
-
}
|
522
|
-
|
523
|
-
if (newVal > 59) {
|
524
|
-
this.incrementHour();
|
525
|
-
this.minute = newVal - 60;
|
526
|
-
} else {
|
527
|
-
this.minute = newVal;
|
528
|
-
}
|
529
|
-
this.update();
|
530
|
-
},
|
531
|
-
|
532
|
-
incrementSecond: function() {
|
533
|
-
var newVal = this.second + this.secondStep - (this.second % this.secondStep);
|
534
|
-
|
535
|
-
if (newVal > 59) {
|
536
|
-
this.incrementMinute(true);
|
537
|
-
this.second = newVal - 60;
|
538
|
-
} else {
|
539
|
-
this.second = newVal;
|
540
|
-
}
|
541
|
-
this.update();
|
542
|
-
},
|
543
|
-
|
544
|
-
remove: function() {
|
545
|
-
$('document').off('.timepicker');
|
546
|
-
if (this.$widget) {
|
547
|
-
this.$widget.remove();
|
548
|
-
}
|
549
|
-
delete this.$element.data().timepicker;
|
550
|
-
},
|
551
|
-
|
552
|
-
setDefaultTime: function(defaultTime){
|
553
|
-
if (!this.$element.val()) {
|
554
|
-
if (defaultTime === 'current') {
|
555
|
-
var dTime = new Date(),
|
556
|
-
hours = dTime.getHours(),
|
557
|
-
minutes = Math.floor(dTime.getMinutes() / this.minuteStep) * this.minuteStep,
|
558
|
-
seconds = Math.floor(dTime.getSeconds() / this.secondStep) * this.secondStep,
|
559
|
-
meridian = 'AM';
|
560
|
-
|
561
|
-
if (this.showMeridian) {
|
562
|
-
if (hours === 0) {
|
563
|
-
hours = 12;
|
564
|
-
} else if (hours >= 12) {
|
565
|
-
if (hours > 12) {
|
566
|
-
hours = hours - 12;
|
567
|
-
}
|
568
|
-
meridian = 'PM';
|
569
|
-
} else {
|
570
|
-
meridian = 'AM';
|
571
|
-
}
|
572
|
-
}
|
573
|
-
|
574
|
-
this.hour = hours;
|
575
|
-
this.minute = minutes;
|
576
|
-
this.second = seconds;
|
577
|
-
this.meridian = meridian;
|
578
|
-
|
579
|
-
this.update();
|
580
|
-
|
581
|
-
} else if (defaultTime === false) {
|
582
|
-
this.hour = 0;
|
583
|
-
this.minute = 0;
|
584
|
-
this.second = 0;
|
585
|
-
this.meridian = 'AM';
|
586
|
-
} else {
|
587
|
-
this.setTime(defaultTime);
|
588
|
-
}
|
589
|
-
} else {
|
590
|
-
this.updateFromElementVal();
|
591
|
-
}
|
592
|
-
},
|
593
|
-
|
594
|
-
setTime: function(time) {
|
595
|
-
var arr,
|
596
|
-
timeArray;
|
597
|
-
|
598
|
-
if (this.showMeridian) {
|
599
|
-
arr = time.split(' ');
|
600
|
-
timeArray = arr[0].split(':');
|
601
|
-
this.meridian = arr[1];
|
602
|
-
} else {
|
603
|
-
timeArray = time.split(':');
|
604
|
-
}
|
605
|
-
|
606
|
-
this.hour = parseInt(timeArray[0], 10);
|
607
|
-
this.minute = parseInt(timeArray[1], 10);
|
608
|
-
this.second = parseInt(timeArray[2], 10);
|
609
|
-
|
610
|
-
if (isNaN(this.hour)) {
|
611
|
-
this.hour = 0;
|
612
|
-
}
|
613
|
-
if (isNaN(this.minute)) {
|
614
|
-
this.minute = 0;
|
615
|
-
}
|
616
|
-
|
617
|
-
if (this.showMeridian) {
|
618
|
-
if (this.hour > 12) {
|
619
|
-
this.hour = 12;
|
620
|
-
} else if (this.hour < 1) {
|
621
|
-
this.hour = 12;
|
622
|
-
}
|
623
|
-
|
624
|
-
if (this.meridian === 'am' || this.meridian === 'a') {
|
625
|
-
this.meridian = 'AM';
|
626
|
-
} else if (this.meridian === 'pm' || this.meridian === 'p') {
|
627
|
-
this.meridian = 'PM';
|
628
|
-
}
|
629
|
-
|
630
|
-
if (this.meridian !== 'AM' && this.meridian !== 'PM') {
|
631
|
-
this.meridian = 'AM';
|
632
|
-
}
|
633
|
-
} else {
|
634
|
-
if (this.hour >= 24) {
|
635
|
-
this.hour = 23;
|
636
|
-
} else if (this.hour < 0) {
|
637
|
-
this.hour = 0;
|
638
|
-
}
|
639
|
-
}
|
640
|
-
|
641
|
-
if (this.minute < 0) {
|
642
|
-
this.minute = 0;
|
643
|
-
} else if (this.minute >= 60) {
|
644
|
-
this.minute = 59;
|
645
|
-
}
|
646
|
-
|
647
|
-
if (this.showSeconds) {
|
648
|
-
if (isNaN(this.second)) {
|
649
|
-
this.second = 0;
|
650
|
-
} else if (this.second < 0) {
|
651
|
-
this.second = 0;
|
652
|
-
} else if (this.second >= 60) {
|
653
|
-
this.second = 59;
|
654
|
-
}
|
655
|
-
}
|
656
|
-
|
657
|
-
this.update();
|
658
|
-
},
|
659
|
-
|
660
|
-
showWidget: function() {
|
661
|
-
if (this.isOpen) {
|
662
|
-
return;
|
663
|
-
}
|
664
|
-
|
665
|
-
if (this.$element.is(':disabled')) {
|
666
|
-
return;
|
667
|
-
}
|
668
|
-
|
669
|
-
var self = this;
|
670
|
-
$(document).on('mousedown.timepicker', function (e) {
|
671
|
-
// Clicked outside the timepicker, hide it
|
672
|
-
if ($(e.target).closest('.bootstrap-timepicker-widget').length === 0) {
|
673
|
-
self.hideWidget();
|
674
|
-
}
|
675
|
-
});
|
676
|
-
|
677
|
-
this.$element.trigger({
|
678
|
-
'type': 'show.timepicker',
|
679
|
-
'time': {
|
680
|
-
'value': this.getTime(),
|
681
|
-
'hours': this.hour,
|
682
|
-
'minutes': this.minute,
|
683
|
-
'seconds': this.second,
|
684
|
-
'meridian': this.meridian
|
685
|
-
}
|
686
|
-
});
|
687
|
-
|
688
|
-
if (this.disableFocus) {
|
689
|
-
this.$element.blur();
|
690
|
-
}
|
691
|
-
|
692
|
-
this.updateFromElementVal();
|
693
|
-
|
694
|
-
if (this.template === 'modal' && this.$widget.modal) {
|
695
|
-
this.$widget.modal('show').on('hidden', $.proxy(this.hideWidget, this));
|
696
|
-
} else {
|
697
|
-
if (this.isOpen === false) {
|
698
|
-
this.$widget.addClass('open');
|
699
|
-
}
|
700
|
-
}
|
701
|
-
|
702
|
-
this.isOpen = true;
|
703
|
-
},
|
704
|
-
|
705
|
-
toggleMeridian: function() {
|
706
|
-
this.meridian = this.meridian === 'AM' ? 'PM' : 'AM';
|
707
|
-
this.update();
|
708
|
-
},
|
709
|
-
|
710
|
-
update: function() {
|
711
|
-
this.$element.trigger({
|
712
|
-
'type': 'changeTime.timepicker',
|
713
|
-
'time': {
|
714
|
-
'value': this.getTime(),
|
715
|
-
'hours': this.hour,
|
716
|
-
'minutes': this.minute,
|
717
|
-
'seconds': this.second,
|
718
|
-
'meridian': this.meridian
|
719
|
-
}
|
720
|
-
});
|
721
|
-
|
722
|
-
this.updateElement();
|
723
|
-
this.updateWidget();
|
724
|
-
},
|
725
|
-
|
726
|
-
updateElement: function() {
|
727
|
-
this.$element.val(this.getTime()).change();
|
728
|
-
},
|
729
|
-
|
730
|
-
updateFromElementVal: function() {
|
731
|
-
var val = this.$element.val();
|
732
|
-
|
733
|
-
if (val) {
|
734
|
-
this.setTime(val);
|
735
|
-
}
|
736
|
-
},
|
737
|
-
|
738
|
-
updateWidget: function() {
|
739
|
-
if (this.$widget === false) {
|
740
|
-
return;
|
741
|
-
}
|
742
|
-
|
743
|
-
var hour = this.hour < 10 ? '0' + this.hour : this.hour,
|
744
|
-
minute = this.minute < 10 ? '0' + this.minute : this.minute,
|
745
|
-
second = this.second < 10 ? '0' + this.second : this.second;
|
746
|
-
|
747
|
-
if (this.showInputs) {
|
748
|
-
this.$widget.find('input.bootstrap-timepicker-hour').val(hour);
|
749
|
-
this.$widget.find('input.bootstrap-timepicker-minute').val(minute);
|
750
|
-
|
751
|
-
if (this.showSeconds) {
|
752
|
-
this.$widget.find('input.bootstrap-timepicker-second').val(second);
|
753
|
-
}
|
754
|
-
if (this.showMeridian) {
|
755
|
-
this.$widget.find('input.bootstrap-timepicker-meridian').val(this.meridian);
|
756
|
-
}
|
757
|
-
} else {
|
758
|
-
this.$widget.find('span.bootstrap-timepicker-hour').text(hour);
|
759
|
-
this.$widget.find('span.bootstrap-timepicker-minute').text(minute);
|
760
|
-
|
761
|
-
if (this.showSeconds) {
|
762
|
-
this.$widget.find('span.bootstrap-timepicker-second').text(second);
|
763
|
-
}
|
764
|
-
if (this.showMeridian) {
|
765
|
-
this.$widget.find('span.bootstrap-timepicker-meridian').text(this.meridian);
|
766
|
-
}
|
767
|
-
}
|
768
|
-
},
|
769
|
-
|
770
|
-
updateFromWidgetInputs: function() {
|
771
|
-
if (this.$widget === false) {
|
772
|
-
return;
|
773
|
-
}
|
774
|
-
var time = $('input.bootstrap-timepicker-hour', this.$widget).val() + ':' +
|
775
|
-
$('input.bootstrap-timepicker-minute', this.$widget).val() +
|
776
|
-
(this.showSeconds ? ':' + $('input.bootstrap-timepicker-second', this.$widget).val() : '') +
|
777
|
-
(this.showMeridian ? ' ' + $('input.bootstrap-timepicker-meridian', this.$widget).val() : '');
|
778
|
-
|
779
|
-
this.setTime(time);
|
780
|
-
},
|
781
|
-
|
782
|
-
widgetClick: function(e) {
|
783
|
-
e.stopPropagation();
|
784
|
-
e.preventDefault();
|
785
|
-
|
786
|
-
var action = $(e.target).closest('a').data('action');
|
787
|
-
if (action) {
|
788
|
-
this[action]();
|
789
|
-
}
|
790
|
-
},
|
791
|
-
|
792
|
-
widgetKeydown: function(e) {
|
793
|
-
var $input = $(e.target).closest('input'),
|
794
|
-
name = $input.attr('name');
|
795
|
-
|
796
|
-
switch (e.keyCode) {
|
797
|
-
case 9: //tab
|
798
|
-
if (this.showMeridian) {
|
799
|
-
if (name === 'meridian') {
|
800
|
-
return this.hideWidget();
|
801
|
-
}
|
802
|
-
} else {
|
803
|
-
if (this.showSeconds) {
|
804
|
-
if (name === 'second') {
|
805
|
-
return this.hideWidget();
|
806
|
-
}
|
807
|
-
} else {
|
808
|
-
if (name === 'minute') {
|
809
|
-
return this.hideWidget();
|
810
|
-
}
|
811
|
-
}
|
812
|
-
}
|
813
|
-
|
814
|
-
this.updateFromWidgetInputs();
|
815
|
-
break;
|
816
|
-
case 27: // escape
|
817
|
-
this.hideWidget();
|
818
|
-
break;
|
819
|
-
case 38: // up arrow
|
820
|
-
e.preventDefault();
|
821
|
-
switch (name) {
|
822
|
-
case 'hour':
|
823
|
-
this.incrementHour();
|
824
|
-
break;
|
825
|
-
case 'minute':
|
826
|
-
this.incrementMinute();
|
827
|
-
break;
|
828
|
-
case 'second':
|
829
|
-
this.incrementSecond();
|
830
|
-
break;
|
831
|
-
case 'meridian':
|
832
|
-
this.toggleMeridian();
|
833
|
-
break;
|
834
|
-
}
|
835
|
-
break;
|
836
|
-
case 40: // down arrow
|
837
|
-
e.preventDefault();
|
838
|
-
switch (name) {
|
839
|
-
case 'hour':
|
840
|
-
this.decrementHour();
|
841
|
-
break;
|
842
|
-
case 'minute':
|
843
|
-
this.decrementMinute();
|
844
|
-
break;
|
845
|
-
case 'second':
|
846
|
-
this.decrementSecond();
|
847
|
-
break;
|
848
|
-
case 'meridian':
|
849
|
-
this.toggleMeridian();
|
850
|
-
break;
|
851
|
-
}
|
852
|
-
break;
|
853
|
-
}
|
854
|
-
}
|
855
|
-
};
|
856
|
-
|
857
|
-
|
858
|
-
//TIMEPICKER PLUGIN DEFINITION
|
859
|
-
$.fn.timepicker = function(option) {
|
860
|
-
var args = Array.apply(null, arguments);
|
861
|
-
args.shift();
|
862
|
-
return this.each(function() {
|
863
|
-
var $this = $(this),
|
864
|
-
data = $this.data('timepicker'),
|
865
|
-
options = typeof option === 'object' && option;
|
866
|
-
|
867
|
-
if (!data) {
|
868
|
-
$this.data('timepicker', (data = new Timepicker(this, $.extend({}, $.fn.timepicker.defaults, options, $(this).data()))));
|
869
|
-
}
|
870
|
-
|
871
|
-
if (typeof option === 'string') {
|
872
|
-
data[option].apply(data, args);
|
873
|
-
}
|
874
|
-
});
|
875
|
-
};
|
876
|
-
|
877
|
-
$.fn.timepicker.defaults = {
|
878
|
-
defaultTime: 'current',
|
879
|
-
disableFocus: false,
|
880
|
-
isOpen: false,
|
881
|
-
minuteStep: 15,
|
882
|
-
modalBackdrop: false,
|
883
|
-
secondStep: 15,
|
884
|
-
showSeconds: false,
|
885
|
-
showInputs: true,
|
886
|
-
showMeridian: true,
|
887
|
-
template: 'dropdown',
|
888
|
-
appendWidgetTo: '.bootstrap-timepicker'
|
889
|
-
};
|
890
|
-
|
891
|
-
$.fn.timepicker.Constructor = Timepicker;
|
892
|
-
|
893
|
-
})(jQuery, window, document);
|