wbase 0.0.14 → 0.0.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/fonts/FontAwesome.otf +0 -0
- data/app/assets/fonts/Material-Design-Iconic-Font.eot +0 -0
- data/app/assets/fonts/Material-Design-Iconic-Font.svg +773 -0
- data/app/assets/fonts/Material-Design-Iconic-Font.ttf +0 -0
- data/app/assets/fonts/Material-Design-Iconic-Font.woff +0 -0
- data/app/assets/fonts/Simple-Line-Icons.eot +0 -0
- data/app/assets/fonts/Simple-Line-Icons.svg +211 -0
- data/app/assets/fonts/Simple-Line-Icons.ttf +0 -0
- data/app/assets/fonts/Simple-Line-Icons.woff +0 -0
- data/app/assets/fonts/Simple-Line-Icons.woff2 +0 -0
- data/app/assets/fonts/et-line.eot +0 -0
- data/app/assets/fonts/et-line.svg +1 -1
- data/app/assets/fonts/et-line.ttf +0 -0
- data/app/assets/fonts/et-line.woff +0 -0
- data/app/assets/fonts/fontawesome-webfont.eot +0 -0
- data/app/assets/fonts/fontawesome-webfont.svg +685 -0
- data/app/assets/fonts/fontawesome-webfont.ttf +0 -0
- data/app/assets/fonts/fontawesome-webfont.woff +0 -0
- data/app/assets/fonts/fontawesome-webfont.woff2 +0 -0
- data/app/assets/fonts/glyphicons-halflings-regular.eot +0 -0
- data/app/assets/fonts/glyphicons-halflings-regular.svg +1 -1
- data/app/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/app/assets/fonts/glyphicons-halflings-regular.woff +0 -0
- data/app/assets/fonts/glyphicons-halflings-regular.woff2 +0 -0
- data/app/assets/fonts/ionicons.eot +0 -0
- data/app/assets/fonts/ionicons.svg +1899 -0
- data/app/assets/fonts/ionicons.ttf +0 -0
- data/app/assets/fonts/ionicons.woff +0 -0
- data/app/assets/fonts/themify.eot +0 -0
- data/app/assets/fonts/themify.svg +362 -0
- data/app/assets/fonts/themify.ttf +0 -0
- data/app/assets/fonts/themify.woff +0 -0
- data/app/assets/fonts/typicons.eot +0 -0
- data/app/assets/fonts/typicons.less +1040 -0
- data/app/assets/fonts/typicons.svg +1180 -0
- data/app/assets/fonts/typicons.ttf +0 -0
- data/app/assets/fonts/typicons.woff +0 -0
- data/app/assets/fonts/weathericons-regular-webfont.eot +0 -0
- data/app/assets/fonts/weathericons-regular-webfont.svg +257 -0
- data/app/assets/fonts/weathericons-regular-webfont.ttf +0 -0
- data/app/assets/fonts/weathericons-regular-webfont.woff +0 -0
- data/app/assets/fonts/weathericons-regular-webfont.woff2 +0 -0
- data/app/assets/javascripts/wbase/admin/animate/animate.min.css +11 -0
- data/app/assets/javascripts/wbase/admin/autoNumeric/autoNumeric.js +1465 -0
- data/app/assets/javascripts/wbase/admin/autocomplete/autocomplete.zip +0 -0
- data/app/assets/javascripts/wbase/admin/autocomplete/countries.js +267 -0
- data/app/assets/javascripts/wbase/admin/autocomplete/demo.js +77 -0
- data/app/assets/javascripts/wbase/admin/autocomplete/jquery.autocomplete.min.js +8 -0
- data/app/assets/javascripts/wbase/admin/autocomplete/jquery.mockjax.js +601 -0
- data/app/assets/javascripts/wbase/admin/autocomplete.js +77 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-colorpicker/css/bootstrap-colorpicker.css +222 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-colorpicker/css/bootstrap-colorpicker.css.map +1 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-colorpicker/css/bootstrap-colorpicker.min.css +10 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-colorpicker/css/bootstrap-colorpicker.min.css.map +1 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-colorpicker/img/bootstrap-colorpicker/alpha-horizontal.png +0 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-colorpicker/img/bootstrap-colorpicker/alpha.png +0 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-colorpicker/img/bootstrap-colorpicker/hue-horizontal.png +0 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-colorpicker/img/bootstrap-colorpicker/hue.png +0 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-colorpicker/img/bootstrap-colorpicker/saturation.png +0 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-colorpicker/js/bootstrap-colorpicker.js +1106 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-colorpicker/js/bootstrap-colorpicker.min.js +5 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-datepicker/css/bootstrap-datepicker.min.css +9 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-datepicker/js/bootstrap-datepicker.min.js +10 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-daterangepicker/daterangepicker.css +269 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-daterangepicker/daterangepicker.js +1618 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-daterangepicker/drp.png +0 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-filestyle/js/bootstrap-filestyle.js +351 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-filestyle/js/bootstrap-filestyle.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-inputmask/bootstrap-inputmask.min.js +7 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-markdown/css/bootstrap-markdown.min.css +1 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-markdown/js/bootstrap-markdown.js +1362 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-maxlength/bootstrap-maxlength.js +501 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-maxlength/bootstrap-maxlength.min.js +10 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-maxlength/src/bootstrap-maxlength.js +501 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/css/bootstrap-select.min.css +6 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/bootstrap-select.js +1735 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/bootstrap-select.js.map +1 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/bootstrap-select.min.js +8 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-ar_AR.js +49 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-ar_AR.min.js +12 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-bg_BG.js +44 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-bg_BG.min.js +7 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-cro_CRO.js +44 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-cro_CRO.min.js +7 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-cs_CZ.js +35 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-cs_CZ.min.js +7 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-da_DK.js +44 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-da_DK.min.js +7 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-de_DE.js +35 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-de_DE.min.js +7 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-en_US.js +44 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-en_US.min.js +7 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-es_CL.js +35 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-es_CL.min.js +7 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-eu.js +35 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-eu.min.js +7 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-fa_IR.js +37 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-fa_IR.min.js +7 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-fi_FI.js +44 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-fi_FI.min.js +7 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-fr_FR.js +44 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-fr_FR.min.js +7 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-hu_HU.js +44 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-hu_HU.min.js +7 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-id_ID.js +37 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-id_ID.min.js +7 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-it_IT.js +35 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-it_IT.min.js +7 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-ko_KR.js +44 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-ko_KR.min.js +7 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-lt_LT.js +44 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-lt_LT.min.js +7 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-nb_NO.js +70 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-nb_NO.min.js +13 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-nl_NL.js +35 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-nl_NL.min.js +7 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-pl_PL.js +37 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-pl_PL.min.js +7 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-pt_BR.js +35 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-pt_BR.min.js +7 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-pt_PT.js +35 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-pt_PT.min.js +7 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-ro_RO.js +35 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-ro_RO.min.js +7 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-ru_RU.js +36 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-ru_RU.min.js +7 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-sk_SK.js +37 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-sk_SK.min.js +7 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-sl_SI.js +44 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-sl_SI.min.js +7 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-sv_SE.js +44 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-sv_SE.min.js +7 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-tr_TR.js +44 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-tr_TR.min.js +7 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-ua_UA.js +35 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-ua_UA.min.js +7 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-zh_CN.js +35 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-zh_CN.min.js +7 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-zh_TW.js +37 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-zh_TW.min.js +7 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-slider/css/bootstrap-slider.min.css +28 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-slider/js/bootstrap-slider.min.js +29 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-sweetalert/sweet-alert.css +564 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-sweetalert/sweet-alert.js +745 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-sweetalert/sweet-alert.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-sweetalert/thumbs-up.jpg +0 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-table/css/bootstrap-table.min.css +1 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-table/js/bootstrap-table.min.js +8 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-tagsinput/css/bootstrap-tagsinput.css +60 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-tagsinput/js/bootstrap-tagsinput.min.js +7 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-touchspin/css/jquery.bootstrap-touchspin.min.css +10 -0
- data/app/assets/javascripts/wbase/admin/bootstrap-touchspin/js/jquery.bootstrap-touchspin.min.js +9 -0
- data/app/assets/javascripts/wbase/admin/bootstrap.min.js +7 -0
- data/app/assets/javascripts/wbase/admin/c3/c3.css +158 -0
- data/app/assets/javascripts/wbase/admin/c3/c3.js +7049 -0
- data/app/assets/javascripts/wbase/admin/c3/c3.min.css +1 -0
- data/app/assets/javascripts/wbase/admin/c3/c3.min.js +5 -0
- data/app/assets/javascripts/wbase/admin/chart.js/chart.min.js +14 -0
- data/app/assets/javascripts/wbase/admin/chartist/css/chartist.min.css +1 -0
- data/app/assets/javascripts/wbase/admin/chartist/js/chartist-plugin-tooltip.min.js +8 -0
- data/app/assets/javascripts/wbase/admin/chartist/js/chartist.min.js +10 -0
- data/app/assets/javascripts/wbase/admin/clockpicker/css/bootstrap-clockpicker.min.css +5 -0
- data/app/assets/javascripts/wbase/admin/clockpicker/js/bootstrap-clockpicker.min.js +6 -0
- data/app/assets/javascripts/wbase/admin/codemirror/css/ambiance.css +74 -0
- data/app/assets/javascripts/wbase/admin/codemirror/css/codemirror.css +347 -0
- data/app/assets/javascripts/wbase/admin/codemirror/js/codemirror.js +8935 -0
- data/app/assets/javascripts/wbase/admin/codemirror/js/formatting.js +108 -0
- data/app/assets/javascripts/wbase/admin/codemirror/js/javascript.js +638 -0
- data/app/assets/javascripts/wbase/admin/codemirror/js/xml.js +333 -0
- data/app/assets/javascripts/wbase/admin/countdown/dest/countdown.js +195 -0
- data/app/assets/javascripts/wbase/admin/countdown/dest/countdown.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/countdown/dest/jquery.countdown.js +215 -0
- data/app/assets/javascripts/wbase/admin/countdown/dest/jquery.countdown.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/countdown/src/countdown.js +191 -0
- data/app/assets/javascripts/wbase/admin/countdown/src/jquery-wrapper.js +18 -0
- data/app/assets/javascripts/wbase/admin/counterup/jquery.counterup.min.js +8 -0
- data/app/assets/javascripts/wbase/admin/cropper/cropper.css +315 -0
- data/app/assets/javascripts/wbase/admin/cropper/cropper.js +2457 -0
- data/app/assets/javascripts/wbase/admin/cropper/cropper.min.css +9 -0
- data/app/assets/javascripts/wbase/admin/cropper/cropper.min.js +9 -0
- data/app/assets/javascripts/wbase/admin/custombox/css/custombox.css +872 -0
- data/app/assets/javascripts/wbase/admin/custombox/js/custombox.min.js +10 -0
- data/app/assets/javascripts/wbase/admin/custombox/js/legacy.min.js +18 -0
- data/app/assets/javascripts/wbase/admin/d3/d3.js +9426 -0
- data/app/assets/javascripts/wbase/admin/d3/d3.min.js +5 -0
- data/app/assets/javascripts/wbase/admin/datatables/buttons.bootstrap.min.js +6 -0
- data/app/assets/javascripts/wbase/admin/datatables/buttons.html5.min.js +20 -0
- data/app/assets/javascripts/wbase/admin/datatables/buttons.print.min.js +4 -0
- data/app/assets/javascripts/wbase/admin/datatables/dataTables.bootstrap.js +186 -0
- data/app/assets/javascripts/wbase/admin/datatables/dataTables.buttons.min.js +35 -0
- data/app/assets/javascripts/wbase/admin/datatables/dataTables.colVis.js +1107 -0
- data/app/assets/javascripts/wbase/admin/datatables/dataTables.fixedColumns.min.js +35 -0
- data/app/assets/javascripts/wbase/admin/datatables/dataTables.fixedHeader.min.js +16 -0
- data/app/assets/javascripts/wbase/admin/datatables/dataTables.keyTable.min.js +18 -0
- data/app/assets/javascripts/wbase/admin/datatables/dataTables.responsive.min.js +23 -0
- data/app/assets/javascripts/wbase/admin/datatables/dataTables.scroller.min.js +25 -0
- data/app/assets/javascripts/wbase/admin/datatables/jquery.dataTables.min.js +163 -0
- data/app/assets/javascripts/wbase/admin/datatables/json/scroller-demo.json +2502 -0
- data/app/assets/javascripts/wbase/admin/datatables/jszip.min.js +14 -0
- data/app/assets/javascripts/wbase/admin/datatables/pdfmake.min.js +22 -0
- data/app/assets/javascripts/wbase/admin/datatables/responsive.bootstrap.min.js +7 -0
- data/app/assets/javascripts/wbase/admin/datatables/vfs_fonts.js +1 -0
- data/app/assets/javascripts/wbase/admin/datatables.editable.init.js +244 -0
- data/app/assets/javascripts/wbase/admin/datatables.init.js +37 -0
- data/app/assets/javascripts/wbase/admin/detect.js +7 -0
- data/app/assets/javascripts/wbase/admin/doc-ready/README.md +23 -0
- data/app/assets/javascripts/wbase/admin/doc-ready/bower.json +35 -0
- data/app/assets/javascripts/wbase/admin/doc-ready/doc-ready.js +80 -0
- data/app/assets/javascripts/wbase/admin/dropzone/basic.css +39 -0
- data/app/assets/javascripts/wbase/admin/dropzone/dropzone-amd-module.js +1743 -0
- data/app/assets/javascripts/wbase/admin/dropzone/dropzone.css +388 -0
- data/app/assets/javascripts/wbase/admin/dropzone/dropzone.js +1728 -0
- data/app/assets/javascripts/wbase/admin/dropzone/readme.md +10 -0
- data/app/assets/javascripts/wbase/admin/easy-pie-chart.init.js +63 -0
- data/app/assets/javascripts/wbase/admin/eventEmitter/EventEmitter.js +472 -0
- data/app/assets/javascripts/wbase/admin/eventEmitter/EventEmitter.min.js +7 -0
- data/app/assets/javascripts/wbase/admin/eventie/eventie.js +82 -0
- data/app/assets/javascripts/wbase/admin/fastclick.js +841 -0
- data/app/assets/javascripts/wbase/admin/fizzy-ui-utils/utils.js +270 -0
- data/app/assets/javascripts/wbase/admin/flot-chart/jquery.flot.crosshair.js +176 -0
- data/app/assets/javascripts/wbase/admin/flot-chart/jquery.flot.min.js +8 -0
- data/app/assets/javascripts/wbase/admin/flot-chart/jquery.flot.orderBars.min.js +186 -0
- data/app/assets/javascripts/wbase/admin/flot-chart/jquery.flot.pie.js +820 -0
- data/app/assets/javascripts/wbase/admin/flot-chart/jquery.flot.resize.js +59 -0
- data/app/assets/javascripts/wbase/admin/flot-chart/jquery.flot.selection.js +360 -0
- data/app/assets/javascripts/wbase/admin/flot-chart/jquery.flot.stack.js +188 -0
- data/app/assets/javascripts/wbase/admin/flot-chart/jquery.flot.time.js +432 -0
- data/app/assets/javascripts/wbase/admin/flot-chart/jquery.flot.tooltip.min.js +12 -0
- data/app/assets/javascripts/wbase/admin/footable/css/fonts/footable.eot +0 -0
- data/app/assets/javascripts/wbase/admin/footable/css/fonts/footable.svg +78 -0
- data/app/assets/javascripts/wbase/admin/footable/css/fonts/footable.ttf +0 -0
- data/app/assets/javascripts/wbase/admin/footable/css/fonts/footable.woff +0 -0
- data/app/assets/javascripts/wbase/admin/footable/css/footable.core.css +181 -0
- data/app/assets/javascripts/wbase/admin/footable/js/footable.all.min.js +14 -0
- data/app/assets/javascripts/wbase/admin/form-validation-init.js +106 -0
- data/app/assets/javascripts/wbase/admin/fullcalendar/css/fullcalendar.min.css +5 -0
- data/app/assets/javascripts/wbase/admin/fullcalendar/js/fullcalendar.min.js +9 -0
- data/app/assets/javascripts/wbase/admin/get-size/get-size.js +250 -0
- data/app/assets/javascripts/wbase/admin/get-style-property/get-style-property.js +55 -0
- data/app/assets/javascripts/wbase/admin/gmaps/gmaps.js +2204 -0
- data/app/assets/javascripts/wbase/admin/gmaps/gmaps.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/gmaps/gmaps.min.js.map +1 -0
- data/app/assets/javascripts/wbase/admin/gmaps/lib/gmaps.controls.js +83 -0
- data/app/assets/javascripts/wbase/admin/gmaps/lib/gmaps.core.js +488 -0
- data/app/assets/javascripts/wbase/admin/gmaps/lib/gmaps.events.js +54 -0
- data/app/assets/javascripts/wbase/admin/gmaps/lib/gmaps.geofences.js +14 -0
- data/app/assets/javascripts/wbase/admin/gmaps/lib/gmaps.geometry.js +205 -0
- data/app/assets/javascripts/wbase/admin/gmaps/lib/gmaps.layers.js +158 -0
- data/app/assets/javascripts/wbase/admin/gmaps/lib/gmaps.map_types.js +29 -0
- data/app/assets/javascripts/wbase/admin/gmaps/lib/gmaps.markers.js +210 -0
- data/app/assets/javascripts/wbase/admin/gmaps/lib/gmaps.native_extensions.js +121 -0
- data/app/assets/javascripts/wbase/admin/gmaps/lib/gmaps.overlays.js +134 -0
- data/app/assets/javascripts/wbase/admin/gmaps/lib/gmaps.routes.js +330 -0
- data/app/assets/javascripts/wbase/admin/gmaps/lib/gmaps.static.js +245 -0
- data/app/assets/javascripts/wbase/admin/gmaps/lib/gmaps.streetview.js +44 -0
- data/app/assets/javascripts/wbase/admin/gmaps/lib/gmaps.styles.js +9 -0
- data/app/assets/javascripts/wbase/admin/gmaps/lib/gmaps.utils.js +42 -0
- data/app/assets/javascripts/wbase/admin/hopscotch/css/hopscotch.css +519 -0
- data/app/assets/javascripts/wbase/admin/hopscotch/css/hopscotch.min.css +17 -0
- data/app/assets/javascripts/wbase/admin/hopscotch/img/sprite-green.png +0 -0
- data/app/assets/javascripts/wbase/admin/hopscotch/img/sprite-orange.png +0 -0
- data/app/assets/javascripts/wbase/admin/hopscotch/js/hopscotch.js +2536 -0
- data/app/assets/javascripts/wbase/admin/hopscotch/js/hopscotch.min.js +17 -0
- data/app/assets/javascripts/wbase/admin/ion-rangeslider/ion.rangeSlider.css +150 -0
- data/app/assets/javascripts/wbase/admin/ion-rangeslider/ion.rangeSlider.min.js +76 -0
- data/app/assets/javascripts/wbase/admin/ion-rangeslider/ion.rangeSlider.skinFlat.css +106 -0
- data/app/assets/javascripts/wbase/admin/ion-rangeslider/sprite-skin-flat.png +0 -0
- data/app/assets/javascripts/wbase/admin/isotope/js/isotope.pkgd.min.js +12 -0
- data/app/assets/javascripts/wbase/admin/jquery-circliful/css/jquery.circliful.css +20 -0
- data/app/assets/javascripts/wbase/admin/jquery-circliful/js/jquery.circliful.js +262 -0
- data/app/assets/javascripts/wbase/admin/jquery-circliful/js/jquery.circliful.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/jquery-datatables-editable/dataTables.bootstrap.js +186 -0
- data/app/assets/javascripts/wbase/admin/jquery-datatables-editable/datatables.css +333 -0
- data/app/assets/javascripts/wbase/admin/jquery-datatables-editable/jquery.dataTables.js +14951 -0
- data/app/assets/javascripts/wbase/admin/jquery-knob/excanvas.js +924 -0
- data/app/assets/javascripts/wbase/admin/jquery-knob/jquery.knob.js +805 -0
- data/app/assets/javascripts/wbase/admin/jquery-quicksearch/jquery.quicksearch.js +181 -0
- data/app/assets/javascripts/wbase/admin/jquery-sparkline/jquery.sparkline.min.js +5 -0
- data/app/assets/javascripts/wbase/admin/jquery-ui/external/jquery/jquery.js +9789 -0
- data/app/assets/javascripts/wbase/admin/jquery-ui/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- data/app/assets/javascripts/wbase/admin/jquery-ui/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- data/app/assets/javascripts/wbase/admin/jquery-ui/images/ui-bg_flat_10_000000_40x100.png +0 -0
- data/app/assets/javascripts/wbase/admin/jquery-ui/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/app/assets/javascripts/wbase/admin/jquery-ui/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/app/assets/javascripts/wbase/admin/jquery-ui/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/app/assets/javascripts/wbase/admin/jquery-ui/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- data/app/assets/javascripts/wbase/admin/jquery-ui/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/app/assets/javascripts/wbase/admin/jquery-ui/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/app/assets/javascripts/wbase/admin/jquery-ui/images/ui-icons_222222_256x240.png +0 -0
- data/app/assets/javascripts/wbase/admin/jquery-ui/images/ui-icons_228ef1_256x240.png +0 -0
- data/app/assets/javascripts/wbase/admin/jquery-ui/images/ui-icons_ef8c08_256x240.png +0 -0
- data/app/assets/javascripts/wbase/admin/jquery-ui/images/ui-icons_ffd27a_256x240.png +0 -0
- data/app/assets/javascripts/wbase/admin/jquery-ui/images/ui-icons_ffffff_256x240.png +0 -0
- data/app/assets/javascripts/wbase/admin/jquery-ui/index.html +513 -0
- data/app/assets/javascripts/wbase/admin/jquery-ui/jquery-ui.css +1225 -0
- data/app/assets/javascripts/wbase/admin/jquery-ui/jquery-ui.js +16617 -0
- data/app/assets/javascripts/wbase/admin/jquery-ui/jquery-ui.min.css +7 -0
- data/app/assets/javascripts/wbase/admin/jquery-ui/jquery-ui.min.js +13 -0
- data/app/assets/javascripts/wbase/admin/jquery-ui/jquery-ui.structure.css +833 -0
- data/app/assets/javascripts/wbase/admin/jquery-ui/jquery-ui.structure.min.css +5 -0
- data/app/assets/javascripts/wbase/admin/jquery-ui/jquery-ui.theme.css +410 -0
- data/app/assets/javascripts/wbase/admin/jquery-ui/jquery-ui.theme.min.css +5 -0
- data/app/assets/javascripts/wbase/admin/jquery-validation/js/jquery.validate.min.js +4 -0
- data/app/assets/javascripts/wbase/admin/jquery.app.js +318 -0
- data/app/assets/javascripts/wbase/admin/jquery.blockUI.js +620 -0
- data/app/assets/javascripts/wbase/admin/jquery.bs-table.js +93 -0
- data/app/assets/javascripts/wbase/admin/jquery.c3-chart.init.js +225 -0
- data/app/assets/javascripts/wbase/admin/jquery.chartist.init.js +860 -0
- data/app/assets/javascripts/wbase/admin/jquery.chartjs.init.js +231 -0
- data/app/assets/javascripts/wbase/admin/jquery.charts-sparkline.js +149 -0
- data/app/assets/javascripts/wbase/admin/jquery.chat.js +60 -0
- data/app/assets/javascripts/wbase/admin/jquery.codemirror.init.js +66 -0
- data/app/assets/javascripts/wbase/admin/jquery.core.js +323 -0
- data/app/assets/javascripts/wbase/admin/jquery.dashboard.js +91 -0
- data/app/assets/javascripts/wbase/admin/jquery.dashboard_2.js +57 -0
- data/app/assets/javascripts/wbase/admin/jquery.dashboard_3.js +64 -0
- data/app/assets/javascripts/wbase/admin/jquery.dashboard_4.js +81 -0
- data/app/assets/javascripts/wbase/admin/jquery.dashboard_crm.js +104 -0
- data/app/assets/javascripts/wbase/admin/jquery.dashboard_ecommerce.js +57 -0
- data/app/assets/javascripts/wbase/admin/jquery.easy-pie-chart/dist/angular.easypiechart.js +397 -0
- data/app/assets/javascripts/wbase/admin/jquery.easy-pie-chart/dist/angular.easypiechart.min.js +9 -0
- data/app/assets/javascripts/wbase/admin/jquery.easy-pie-chart/dist/easypiechart.js +351 -0
- data/app/assets/javascripts/wbase/admin/jquery.easy-pie-chart/dist/easypiechart.min.js +9 -0
- data/app/assets/javascripts/wbase/admin/jquery.easy-pie-chart/dist/jquery.easypiechart.js +360 -0
- data/app/assets/javascripts/wbase/admin/jquery.easy-pie-chart/dist/jquery.easypiechart.min.js +9 -0
- data/app/assets/javascripts/wbase/admin/jquery.easy-pie-chart/src/angular.directive.js +48 -0
- data/app/assets/javascripts/wbase/admin/jquery.easy-pie-chart/src/easypiechart.js +134 -0
- data/app/assets/javascripts/wbase/admin/jquery.easy-pie-chart/src/jquery.plugin.js +10 -0
- data/app/assets/javascripts/wbase/admin/jquery.easy-pie-chart/src/renderer/canvas.js +190 -0
- data/app/assets/javascripts/wbase/admin/jquery.flot.init.js +500 -0
- data/app/assets/javascripts/wbase/admin/jquery.footable.js +86 -0
- data/app/assets/javascripts/wbase/admin/jquery.form-advanced.init.js +126 -0
- data/app/assets/javascripts/wbase/admin/jquery.form-pickers.init.js +130 -0
- data/app/assets/javascripts/wbase/admin/jquery.fullcalendar.js +202 -0
- data/app/assets/javascripts/wbase/admin/jquery.gmaps.js +226 -0
- data/app/assets/javascripts/wbase/admin/jquery.jsgrid.init.js +123 -0
- data/app/assets/javascripts/wbase/admin/jquery.leads.init.js +53 -0
- data/app/assets/javascripts/wbase/admin/jquery.min.js +5 -0
- data/app/assets/javascripts/wbase/admin/jquery.nicescroll.js +113 -0
- data/app/assets/javascripts/wbase/admin/jquery.nvd3.init.js +297 -0
- data/app/assets/javascripts/wbase/admin/jquery.opportunities.init.js +49 -0
- data/app/assets/javascripts/wbase/admin/jquery.peity.init.js +49 -0
- data/app/assets/javascripts/wbase/admin/jquery.rickshaw.chart.init.js +288 -0
- data/app/assets/javascripts/wbase/admin/jquery.scrollTo.min.js +7 -0
- data/app/assets/javascripts/wbase/admin/jquery.slimscroll.js +474 -0
- data/app/assets/javascripts/wbase/admin/jquery.steps/css/jquery.steps.css +382 -0
- data/app/assets/javascripts/wbase/admin/jquery.steps/js/jquery.steps.min.js +6 -0
- data/app/assets/javascripts/wbase/admin/jquery.sweet-alert.init.js +162 -0
- data/app/assets/javascripts/wbase/admin/jquery.todo.js +153 -0
- data/app/assets/javascripts/wbase/admin/jquery.tree.js +89 -0
- data/app/assets/javascripts/wbase/admin/jquery.ui-sliders.js +66 -0
- data/app/assets/javascripts/wbase/admin/jquery.widgets.js +149 -0
- data/app/assets/javascripts/wbase/admin/jquery.wizard-init.js +87 -0
- data/app/assets/javascripts/wbase/admin/jquery.xeditable.js +117 -0
- data/app/assets/javascripts/wbase/admin/jsgrid/css/jsgrid-theme.css +258 -0
- data/app/assets/javascripts/wbase/admin/jsgrid/css/jsgrid-theme.min.css +7 -0
- data/app/assets/javascripts/wbase/admin/jsgrid/css/jsgrid.css +126 -0
- data/app/assets/javascripts/wbase/admin/jsgrid/css/jsgrid.min.css +7 -0
- data/app/assets/javascripts/wbase/admin/jsgrid/js/jsgrid.js +2508 -0
- data/app/assets/javascripts/wbase/admin/jsgrid/js/jsgrid.min.js +8 -0
- data/app/assets/javascripts/wbase/admin/jstree/32px.png +0 -0
- data/app/assets/javascripts/wbase/admin/jstree/40px.png +0 -0
- data/app/assets/javascripts/wbase/admin/jstree/ajax_children.json +1 -0
- data/app/assets/javascripts/wbase/admin/jstree/ajax_roots.json +8 -0
- data/app/assets/javascripts/wbase/admin/jstree/jstree.js +7988 -0
- data/app/assets/javascripts/wbase/admin/jstree/jstree.min.js +6 -0
- data/app/assets/javascripts/wbase/admin/jstree/style.css +1066 -0
- data/app/assets/javascripts/wbase/admin/jstree/style.min.css +1 -0
- data/app/assets/javascripts/wbase/admin/jstree/themes/dark/32px.png +0 -0
- data/app/assets/javascripts/wbase/admin/jstree/themes/dark/40px.png +0 -0
- data/app/assets/javascripts/wbase/admin/jstree/themes/dark/style.css +1110 -0
- data/app/assets/javascripts/wbase/admin/jstree/themes/dark/style.min.css +1 -0
- data/app/assets/javascripts/wbase/admin/jstree/themes/dark/throbber.gif +0 -0
- data/app/assets/javascripts/wbase/admin/jstree/throbber.gif +0 -0
- data/app/assets/javascripts/wbase/admin/justgage-toorshia/justgage.js +1051 -0
- data/app/assets/javascripts/wbase/admin/jvectormap/gdp-data.js +185 -0
- data/app/assets/javascripts/wbase/admin/jvectormap/jquery-jvectormap-2.0.2.css +130 -0
- data/app/assets/javascripts/wbase/admin/jvectormap/jquery-jvectormap-2.0.2.min.js +3328 -0
- data/app/assets/javascripts/wbase/admin/jvectormap/jquery-jvectormap-asia-mill.js +1 -0
- data/app/assets/javascripts/wbase/admin/jvectormap/jquery-jvectormap-au-mill.js +1 -0
- data/app/assets/javascripts/wbase/admin/jvectormap/jquery-jvectormap-ca-lcc.js +1 -0
- data/app/assets/javascripts/wbase/admin/jvectormap/jquery-jvectormap-de-mill.js +1 -0
- data/app/assets/javascripts/wbase/admin/jvectormap/jquery-jvectormap-europe-mill-en.js +1 -0
- data/app/assets/javascripts/wbase/admin/jvectormap/jquery-jvectormap-in-mill.js +1 -0
- data/app/assets/javascripts/wbase/admin/jvectormap/jquery-jvectormap-uk-mill-en.js +1 -0
- data/app/assets/javascripts/wbase/admin/jvectormap/jquery-jvectormap-us-aea-en.js +1 -0
- data/app/assets/javascripts/wbase/admin/jvectormap/jquery-jvectormap-us-il-chicago-mill-en.js +1 -0
- data/app/assets/javascripts/wbase/admin/jvectormap/jquery-jvectormap-world-mill-en.js +1 -0
- data/app/assets/javascripts/wbase/admin/jvectormap.init.js +215 -0
- data/app/assets/javascripts/wbase/admin/ladda-buttons/css/ladda-themeless.min.css +7 -0
- data/app/assets/javascripts/wbase/admin/ladda-buttons/js/ladda.jquery.min.js +8 -0
- data/app/assets/javascripts/wbase/admin/ladda-buttons/js/ladda.min.js +8 -0
- data/app/assets/javascripts/wbase/admin/ladda-buttons/js/spin.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/magnific-popup/css/magnific-popup.css +369 -0
- data/app/assets/javascripts/wbase/admin/magnific-popup/js/jquery.magnific-popup.min.js +4 -0
- data/app/assets/javascripts/wbase/admin/masonry/dist/masonry.pkgd.js +3189 -0
- data/app/assets/javascripts/wbase/admin/masonry/dist/masonry.pkgd.min.js +9 -0
- data/app/assets/javascripts/wbase/admin/masonry/masonry.js +203 -0
- data/app/assets/javascripts/wbase/admin/masonry/sandbox/basic.html +62 -0
- data/app/assets/javascripts/wbase/admin/masonry/sandbox/bottom-up.html +119 -0
- data/app/assets/javascripts/wbase/admin/masonry/sandbox/browserify/index.html +42 -0
- data/app/assets/javascripts/wbase/admin/masonry/sandbox/browserify/main.js +19 -0
- data/app/assets/javascripts/wbase/admin/masonry/sandbox/element-sizing.html +69 -0
- data/app/assets/javascripts/wbase/admin/masonry/sandbox/fit-width.html +68 -0
- data/app/assets/javascripts/wbase/admin/masonry/sandbox/fluid.html +89 -0
- data/app/assets/javascripts/wbase/admin/masonry/sandbox/jquery.html +64 -0
- data/app/assets/javascripts/wbase/admin/masonry/sandbox/require-js/index.html +41 -0
- data/app/assets/javascripts/wbase/admin/masonry/sandbox/require-js/main.js +69 -0
- data/app/assets/javascripts/wbase/admin/masonry/sandbox/right-to-left.html +120 -0
- data/app/assets/javascripts/wbase/admin/masonry/sandbox/sandbox.css +33 -0
- data/app/assets/javascripts/wbase/admin/masonry/sandbox/stamps.html +124 -0
- data/app/assets/javascripts/wbase/admin/matches-selector/matches-selector.js +107 -0
- data/app/assets/javascripts/wbase/admin/mjolnic-bootstrap-colorpicker/dist/css/bootstrap-colorpicker.css +251 -0
- data/app/assets/javascripts/wbase/admin/mjolnic-bootstrap-colorpicker/dist/css/bootstrap-colorpicker.min.css +9 -0
- data/app/assets/javascripts/wbase/admin/mjolnic-bootstrap-colorpicker/dist/img/bootstrap-colorpicker/alpha-horizontal.png +0 -0
- data/app/assets/javascripts/wbase/admin/mjolnic-bootstrap-colorpicker/dist/img/bootstrap-colorpicker/alpha.png +0 -0
- data/app/assets/javascripts/wbase/admin/mjolnic-bootstrap-colorpicker/dist/img/bootstrap-colorpicker/hue-horizontal.png +0 -0
- data/app/assets/javascripts/wbase/admin/mjolnic-bootstrap-colorpicker/dist/img/bootstrap-colorpicker/hue.png +0 -0
- data/app/assets/javascripts/wbase/admin/mjolnic-bootstrap-colorpicker/dist/img/bootstrap-colorpicker/saturation.png +0 -0
- data/app/assets/javascripts/wbase/admin/mjolnic-bootstrap-colorpicker/dist/js/bootstrap-colorpicker.js +1079 -0
- data/app/assets/javascripts/wbase/admin/mjolnic-bootstrap-colorpicker/dist/js/bootstrap-colorpicker.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/mocha/media/logo.svg +8 -0
- data/app/assets/javascripts/wbase/admin/mocha/mocha.css +270 -0
- data/app/assets/javascripts/wbase/admin/mocha/mocha.js +5812 -0
- data/app/assets/javascripts/wbase/admin/modal-effect/css/component.css +743 -0
- data/app/assets/javascripts/wbase/admin/modal-effect/js/classie.js +80 -0
- data/app/assets/javascripts/wbase/admin/modal-effect/js/modalEffects.js +57 -0
- data/app/assets/javascripts/wbase/admin/modernizr.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/moment/moment.js +4195 -0
- data/app/assets/javascripts/wbase/admin/morris/morris.css +2 -0
- data/app/assets/javascripts/wbase/admin/morris/morris.min.js +7 -0
- data/app/assets/javascripts/wbase/admin/morris.init.js +184 -0
- data/app/assets/javascripts/wbase/admin/morris.min.js +7 -0
- data/app/assets/javascripts/wbase/admin/multiselect/css/multi-select.css +93 -0
- data/app/assets/javascripts/wbase/admin/multiselect/img/switch.png +0 -0
- data/app/assets/javascripts/wbase/admin/multiselect/js/jquery.multi-select.js +528 -0
- data/app/assets/javascripts/wbase/admin/nestable/jquery.nestable.css +74 -0
- data/app/assets/javascripts/wbase/admin/nestable/jquery.nestable.js +485 -0
- data/app/assets/javascripts/wbase/admin/nestable.js +59 -0
- data/app/assets/javascripts/wbase/admin/notifications/notification.css +56 -0
- data/app/assets/javascripts/wbase/admin/notifications/notify-metro.js +51 -0
- data/app/assets/javascripts/wbase/admin/notifications/notify.min.js +5 -0
- data/app/assets/javascripts/wbase/admin/notifyjs/js/notify.js +625 -0
- data/app/assets/javascripts/wbase/admin/nvd3/nv.d3.min.css +1 -0
- data/app/assets/javascripts/wbase/admin/nvd3/nv.d3.min.js +8 -0
- data/app/assets/javascripts/wbase/admin/outlayer/item.js +586 -0
- data/app/assets/javascripts/wbase/admin/outlayer/outlayer.js +926 -0
- data/app/assets/javascripts/wbase/admin/owl.carousel/dist/LICENSE +22 -0
- data/app/assets/javascripts/wbase/admin/owl.carousel/dist/README.md +158 -0
- data/app/assets/javascripts/wbase/admin/owl.carousel/dist/assets/ajax-loader.gif +0 -0
- data/app/assets/javascripts/wbase/admin/owl.carousel/dist/assets/owl.carousel.css +179 -0
- data/app/assets/javascripts/wbase/admin/owl.carousel/dist/assets/owl.carousel.min.css +1 -0
- data/app/assets/javascripts/wbase/admin/owl.carousel/dist/assets/owl.theme.default.css +51 -0
- data/app/assets/javascripts/wbase/admin/owl.carousel/dist/assets/owl.theme.default.min.css +1 -0
- data/app/assets/javascripts/wbase/admin/owl.carousel/dist/assets/owl.theme.green.css +51 -0
- data/app/assets/javascripts/wbase/admin/owl.carousel/dist/assets/owl.theme.green.min.css +1 -0
- data/app/assets/javascripts/wbase/admin/owl.carousel/dist/assets/owl.video.play.png +0 -0
- data/app/assets/javascripts/wbase/admin/owl.carousel/dist/owl.carousel.js +3148 -0
- data/app/assets/javascripts/wbase/admin/owl.carousel/dist/owl.carousel.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/owl.carousel/src/css/owl.animate.css +29 -0
- data/app/assets/javascripts/wbase/admin/owl.carousel/src/css/owl.autoheight.css +9 -0
- data/app/assets/javascripts/wbase/admin/owl.carousel/src/css/owl.carousel.css +74 -0
- data/app/assets/javascripts/wbase/admin/owl.carousel/src/css/owl.lazyload.css +12 -0
- data/app/assets/javascripts/wbase/admin/owl.carousel/src/css/owl.theme.default.css +51 -0
- data/app/assets/javascripts/wbase/admin/owl.carousel/src/css/owl.theme.green.css +51 -0
- data/app/assets/javascripts/wbase/admin/owl.carousel/src/css/owl.video.css +51 -0
- data/app/assets/javascripts/wbase/admin/owl.carousel/src/img/ajax-loader.gif +0 -0
- data/app/assets/javascripts/wbase/admin/owl.carousel/src/img/owl.video.play.png +0 -0
- data/app/assets/javascripts/wbase/admin/owl.carousel/src/js/owl.animate.js +120 -0
- data/app/assets/javascripts/wbase/admin/owl.carousel/src/js/owl.autoheight.js +96 -0
- data/app/assets/javascripts/wbase/admin/owl.carousel/src/js/owl.autoplay.js +161 -0
- data/app/assets/javascripts/wbase/admin/owl.carousel/src/js/owl.autorefresh.js +110 -0
- data/app/assets/javascripts/wbase/admin/owl.carousel/src/js/owl.carousel.js +1654 -0
- data/app/assets/javascripts/wbase/admin/owl.carousel/src/js/owl.hash.js +121 -0
- data/app/assets/javascripts/wbase/admin/owl.carousel/src/js/owl.lazyload.js +134 -0
- data/app/assets/javascripts/wbase/admin/owl.carousel/src/js/owl.navigation.js +381 -0
- data/app/assets/javascripts/wbase/admin/owl.carousel/src/js/owl.support.js +82 -0
- data/app/assets/javascripts/wbase/admin/owl.carousel/src/js/owl.support.modernizr.js +57 -0
- data/app/assets/javascripts/wbase/admin/owl.carousel/src/js/owl.video.js +280 -0
- data/app/assets/javascripts/wbase/admin/owl.carousel/src/scss/_mixins.scss +21 -0
- data/app/assets/javascripts/wbase/admin/owl.carousel/src/scss/_theme.scss +63 -0
- data/app/assets/javascripts/wbase/admin/owl.carousel/src/scss/owl.animate.scss +40 -0
- data/app/assets/javascripts/wbase/admin/owl.carousel/src/scss/owl.autoheight.scss +9 -0
- data/app/assets/javascripts/wbase/admin/owl.carousel/src/scss/owl.carousel.scss +108 -0
- data/app/assets/javascripts/wbase/admin/owl.carousel/src/scss/owl.lazyload.scss +18 -0
- data/app/assets/javascripts/wbase/admin/owl.carousel/src/scss/owl.theme.default.scss +31 -0
- data/app/assets/javascripts/wbase/admin/owl.carousel/src/scss/owl.theme.green.scss +31 -0
- data/app/assets/javascripts/wbase/admin/owl.carousel/src/scss/owl.video.scss +51 -0
- data/app/assets/javascripts/wbase/admin/pace.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/parsleyjs/parsley.min.js +18 -0
- data/app/assets/javascripts/wbase/admin/peity/jquery.peity.js +383 -0
- data/app/assets/javascripts/wbase/admin/peity/jquery.peity.min.js +13 -0
- data/app/assets/javascripts/wbase/admin/radial/radial.css +736 -0
- data/app/assets/javascripts/wbase/admin/raphael/raphael-min.js +11 -0
- data/app/assets/javascripts/wbase/admin/requirejs/require.js +2103 -0
- data/app/assets/javascripts/wbase/admin/responsive-table/css/rwd-table.min.css +7 -0
- data/app/assets/javascripts/wbase/admin/responsive-table/js/rwd-table.min.js +7 -0
- data/app/assets/javascripts/wbase/admin/rickshaw-chart/data/data.json +14 -0
- data/app/assets/javascripts/wbase/admin/rickshaw-chart/data/data.jsonp +14 -0
- data/app/assets/javascripts/wbase/admin/rickshaw-chart/data/data2.json +14 -0
- data/app/assets/javascripts/wbase/admin/rickshaw-chart/data/status.json +1 -0
- data/app/assets/javascripts/wbase/admin/rickshaw-chart/rickshaw.min.css +1 -0
- data/app/assets/javascripts/wbase/admin/rickshaw-chart/rickshaw.min.js +3 -0
- data/app/assets/javascripts/wbase/admin/rickshaw-chart/vendor/d3.layout.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/rickshaw-chart/vendor/d3.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/select2/css/select2.css +484 -0
- data/app/assets/javascripts/wbase/admin/select2/css/select2.min.css +1 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/ar.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/az.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/bg.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/ca.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/cs.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/da.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/de.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/el.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/en.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/es.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/et.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/eu.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/fa.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/fi.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/fr.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/gl.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/he.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/hi.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/hr.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/hu.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/id.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/is.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/it.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/ja.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/km.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/ko.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/lt.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/lv.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/mk.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/ms.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/nb.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/nl.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/pl.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/pt-BR.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/pt.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/ro.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/ru.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/sk.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/sr-Cyrl.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/sr.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/sv.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/th.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/tr.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/uk.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/vi.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/zh-CN.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/i18n/zh-TW.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/select2.full.js +6436 -0
- data/app/assets/javascripts/wbase/admin/select2/js/select2.full.min.js +3 -0
- data/app/assets/javascripts/wbase/admin/select2/js/select2.js +5725 -0
- data/app/assets/javascripts/wbase/admin/select2/js/select2.min.js +3 -0
- data/app/assets/javascripts/wbase/admin/simple-text-rotator/jquery.simple-text-rotator.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/skyicons/skycons.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/smoothproducts/css/smoothproducts.css +174 -0
- data/app/assets/javascripts/wbase/admin/smoothproducts/js/jquery-2.1.3.min.js +4 -0
- data/app/assets/javascripts/wbase/admin/smoothproducts/js/smoothproducts.js +265 -0
- data/app/assets/javascripts/wbase/admin/smoothproducts/js/smoothproducts.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/summernote/font/summernote.eot +0 -0
- data/app/assets/javascripts/wbase/admin/summernote/font/summernote.ttf +0 -0
- data/app/assets/javascripts/wbase/admin/summernote/font/summernote.woff +0 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-ar-AR.js +104 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-ar-AR.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-bg-BG.js +99 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-bg-BG.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-ca-ES.js +147 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-ca-ES.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-cs-CZ.js +103 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-cs-CZ.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-da-DK.js +114 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-da-DK.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-de-DE.js +110 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-de-DE.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-es-ES.js +147 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-es-ES.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-es-EU.js +103 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-es-EU.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-fa-IR.js +105 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-fa-IR.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-fi-FI.js +104 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-fi-FI.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-fr-FR.js +115 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-fr-FR.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-gl-ES.js +147 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-gl-ES.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-he-IL.js +107 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-he-IL.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-hr-HR.js +104 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-hr-HR.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-hu-HU.js +135 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-hu-HU.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-id-ID.js +103 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-id-ID.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-it-IT.js +104 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-it-IT.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-ja-JP.js +133 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-ja-JP.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-ko-KR.js +115 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-ko-KR.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-lt-LT.js +107 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-lt-LT.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-lt-LV.js +135 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-lt-LV.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-nb-NO.js +104 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-nb-NO.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-nl-NL.js +104 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-nl-NL.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-pl-PL.js +112 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-pl-PL.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-pt-BR.js +132 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-pt-BR.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-pt-PT.js +103 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-pt-PT.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-ro-RO.js +102 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-ro-RO.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-ru-RU.js +112 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-ru-RU.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-sk-SK.js +102 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-sk-SK.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-sl-SI.js +106 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-sl-SI.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-sr-RS-Latin.js +104 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-sr-RS-Latin.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-sr-RS.js +104 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-sr-RS.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-sv-SE.js +104 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-sv-SE.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-th-TH.js +106 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-th-TH.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-tr-TR.js +147 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-tr-TR.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-uk-UA.js +111 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-uk-UA.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-vi-VN.js +104 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-vi-VN.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-zh-CN.js +113 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-zh-CN.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-zh-TW.js +113 -0
- data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-zh-TW.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/summernote/plugin/databasic/summernote-ext-databasic.css +16 -0
- data/app/assets/javascripts/wbase/admin/summernote/plugin/databasic/summernote-ext-databasic.js +303 -0
- data/app/assets/javascripts/wbase/admin/summernote/plugin/databasic/summernote-ext-databasic.min.css +1 -0
- data/app/assets/javascripts/wbase/admin/summernote/plugin/databasic/summernote-ext-databasic.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/summernote/plugin/hello/summernote-ext-hello.js +82 -0
- data/app/assets/javascripts/wbase/admin/summernote/plugin/hello/summernote-ext-hello.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/summernote/plugin/specialchars/summernote-ext-specialchars.js +315 -0
- data/app/assets/javascripts/wbase/admin/summernote/plugin/specialchars/summernote-ext-specialchars.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/summernote/summernote.css +1 -0
- data/app/assets/javascripts/wbase/admin/summernote/summernote.js +7016 -0
- data/app/assets/javascripts/wbase/admin/summernote/summernote.min.js +4 -0
- data/app/assets/javascripts/wbase/admin/switchery/css/switchery.min.css +1 -0
- data/app/assets/javascripts/wbase/admin/switchery/js/switchery.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tablesaw/css/tablesaw.css +833 -0
- data/app/assets/javascripts/wbase/admin/tablesaw/js/tablesaw-init.js +12 -0
- data/app/assets/javascripts/wbase/admin/tablesaw/js/tablesaw.js +1266 -0
- data/app/assets/javascripts/wbase/admin/timepicker/bootstrap-timepicker.js +1177 -0
- data/app/assets/javascripts/wbase/admin/timepicker/bootstrap-timepicker.min.css +148 -0
- data/app/assets/javascripts/wbase/admin/tiny-editable/mindmup-editabletable.js +131 -0
- data/app/assets/javascripts/wbase/admin/tiny-editable/numeric-input-example.js +48 -0
- data/app/assets/javascripts/wbase/admin/tinymce/jquery.tinymce.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/langs/readme.md +3 -0
- data/app/assets/javascripts/wbase/admin/tinymce/license.txt +504 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/advlist/plugin.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/anchor/plugin.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/autolink/plugin.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/autoresize/plugin.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/autosave/plugin.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/bbcode/plugin.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/charmap/plugin.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/code/plugin.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/codesample/css/prism.css +138 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/codesample/plugin.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/colorpicker/plugin.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/contextmenu/plugin.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/directionality/plugin.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/emoticons/img/smiley-cool.gif +0 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/emoticons/img/smiley-cry.gif +0 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/emoticons/img/smiley-embarassed.gif +0 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/emoticons/img/smiley-foot-in-mouth.gif +0 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/emoticons/img/smiley-frown.gif +0 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/emoticons/img/smiley-innocent.gif +0 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/emoticons/img/smiley-kiss.gif +0 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/emoticons/img/smiley-laughing.gif +0 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/emoticons/img/smiley-money-mouth.gif +0 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/emoticons/img/smiley-sealed.gif +0 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/emoticons/img/smiley-smile.gif +0 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/emoticons/img/smiley-surprised.gif +0 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/emoticons/img/smiley-tongue-out.gif +0 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/emoticons/img/smiley-undecided.gif +0 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/emoticons/img/smiley-wink.gif +0 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/emoticons/img/smiley-yell.gif +0 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/emoticons/plugin.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/example/dialog.html +8 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/example/plugin.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/example_dependency/plugin.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/fullpage/plugin.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/fullscreen/plugin.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/hr/plugin.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/image/plugin.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/imagetools/plugin.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/importcss/plugin.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/insertdatetime/plugin.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/layer/plugin.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/legacyoutput/plugin.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/link/plugin.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/lists/plugin.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/media/moxieplayer.swf +0 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/media/plugin.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/nonbreaking/plugin.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/noneditable/plugin.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/pagebreak/plugin.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/paste/plugin.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/preview/plugin.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/print/plugin.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/save/plugin.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/searchreplace/plugin.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/spellchecker/plugin.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/tabfocus/plugin.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/table/plugin.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/template/plugin.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/textcolor/plugin.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/textpattern/plugin.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/visualblocks/css/visualblocks.css +135 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/visualblocks/plugin.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/visualchars/plugin.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/plugins/wordcount/plugin.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/skins/lightgray/content.inline.min.css +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/skins/lightgray/content.min.css +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/skins/lightgray/fonts/tinymce-small.eot +0 -0
- data/app/assets/javascripts/wbase/admin/tinymce/skins/lightgray/fonts/tinymce-small.svg +63 -0
- data/app/assets/javascripts/wbase/admin/tinymce/skins/lightgray/fonts/tinymce-small.ttf +0 -0
- data/app/assets/javascripts/wbase/admin/tinymce/skins/lightgray/fonts/tinymce-small.woff +0 -0
- data/app/assets/javascripts/wbase/admin/tinymce/skins/lightgray/fonts/tinymce.eot +0 -0
- data/app/assets/javascripts/wbase/admin/tinymce/skins/lightgray/fonts/tinymce.svg +129 -0
- data/app/assets/javascripts/wbase/admin/tinymce/skins/lightgray/fonts/tinymce.ttf +0 -0
- data/app/assets/javascripts/wbase/admin/tinymce/skins/lightgray/fonts/tinymce.woff +0 -0
- data/app/assets/javascripts/wbase/admin/tinymce/skins/lightgray/img/anchor.gif +0 -0
- data/app/assets/javascripts/wbase/admin/tinymce/skins/lightgray/img/loader.gif +0 -0
- data/app/assets/javascripts/wbase/admin/tinymce/skins/lightgray/img/object.gif +0 -0
- data/app/assets/javascripts/wbase/admin/tinymce/skins/lightgray/img/trans.gif +0 -0
- data/app/assets/javascripts/wbase/admin/tinymce/skins/lightgray/skin.ie7.min.css +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/skins/lightgray/skin.min.css +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/config/bolt/atomic.js +5 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/config/bolt/bootstrap-atomic.js +1491 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/config/bolt/bootstrap-browser.js +1491 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/config/bolt/bootstrap-demo.js +1491 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/config/bolt/bootstrap-prod.js +1491 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/config/bolt/browser.js +10 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/config/bolt/demo.js +8 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/config/bolt/prod.js +5 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/config/dent/depend.js +21 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/scratch/compile/bootstrap.js +1526 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/scratch/compile/theme.js +1594 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/scratch/inline/theme.js +1679 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/scratch/inline/theme.raw.js +1679 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/demo/css/demo.css +25 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/demo/html/demo.html +69 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/demo/js/tinymce/inlite/Demo.js +28 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/main/js/tinymce/inlite/Theme.js +150 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/main/js/tinymce/inlite/alien/Arr.js +22 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/main/js/tinymce/inlite/alien/Bookmark.js +130 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/main/js/tinymce/inlite/alien/Unlink.js +84 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/main/js/tinymce/inlite/alien/Uuid.js +34 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/Actions.js +106 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/Convert.js +37 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/ElementMatcher.js +47 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/Layout.js +95 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/Matcher.js +39 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/Measure.js +61 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/PredicateId.js +32 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/SelectionMatcher.js +55 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/SkinLoader.js +45 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/UrlType.js +27 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/main/js/tinymce/inlite/file/Conversions.js +31 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/main/js/tinymce/inlite/file/Picker.js +40 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/main/js/tinymce/inlite/ui/Buttons.js +80 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/main/js/tinymce/inlite/ui/Forms.js +102 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/main/js/tinymce/inlite/ui/Panel.js +218 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/main/js/tinymce/inlite/ui/Toolbar.js +126 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/test/js/atomic/alien/ArrTest.js +9 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/test/js/atomic/alien/UuidTest.js +10 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/test/js/atomic/core/ConvertTest.js +12 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/test/js/atomic/core/MatcherTest.js +51 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/test/js/atomic/core/UrlTypeTest.js +33 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/test/js/browser/ThemeTest.js +202 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/test/js/browser/alien/BookmarkTest.js +65 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/test/js/browser/alien/UnlinkTest.js +38 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/test/js/browser/core/ActionsTest.js +177 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/test/js/browser/core/ElementMatcher.js +69 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/test/js/browser/core/LayoutTest.js +118 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/test/js/browser/core/MeasureTest.js +62 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/test/js/browser/core/PredicateIdTest.js +26 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/test/js/browser/core/SelectionMatcherTest.js +76 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/test/js/browser/file/ConversionsTest.js +41 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/test/js/browser/file/SelectionMatcher.js +55 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/theme.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/themes/modern/theme.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/tinymce/tinymce.min.js +13 -0
- data/app/assets/javascripts/wbase/admin/transitionize/dist/transitionize.js +275 -0
- data/app/assets/javascripts/wbase/admin/transitionize/dist/transitionize.min.js +1 -0
- data/app/assets/javascripts/wbase/admin/transitionize/examples/browserify.js +46 -0
- data/app/assets/javascripts/wbase/admin/transitionize/examples/example.html +31 -0
- data/app/assets/javascripts/wbase/admin/transitionize/transitionize.js +64 -0
- data/app/assets/javascripts/wbase/admin/waves.js +498 -0
- data/app/assets/javascripts/wbase/admin/waypoints/lib/jquery.waypoints.js +647 -0
- data/app/assets/javascripts/wbase/admin/waypoints/lib/jquery.waypoints.min.js +7 -0
- data/app/assets/javascripts/wbase/admin/waypoints/lib/noframework.waypoints.js +743 -0
- data/app/assets/javascripts/wbase/admin/waypoints/lib/noframework.waypoints.min.js +7 -0
- data/app/assets/javascripts/wbase/admin/waypoints/lib/shortcuts/infinite.js +84 -0
- data/app/assets/javascripts/wbase/admin/waypoints/lib/shortcuts/infinite.min.js +7 -0
- data/app/assets/javascripts/wbase/admin/waypoints/lib/shortcuts/inview.js +103 -0
- data/app/assets/javascripts/wbase/admin/waypoints/lib/shortcuts/inview.min.js +7 -0
- data/app/assets/javascripts/wbase/admin/waypoints/lib/shortcuts/sticky.js +65 -0
- data/app/assets/javascripts/wbase/admin/waypoints/lib/shortcuts/sticky.min.js +7 -0
- data/app/assets/javascripts/wbase/admin/waypoints/lib/waypoints.debug.js +46 -0
- data/app/assets/javascripts/wbase/admin/waypoints/lib/zepto.waypoints.js +690 -0
- data/app/assets/javascripts/wbase/admin/waypoints/lib/zepto.waypoints.min.js +7 -0
- data/app/assets/javascripts/wbase/admin/wow.min.js +2 -0
- data/app/assets/javascripts/wbase/admin/x-editable/css/bootstrap-editable.css +663 -0
- data/app/assets/javascripts/wbase/admin/x-editable/img/clear.png +0 -0
- data/app/assets/javascripts/wbase/admin/x-editable/img/loading.gif +0 -0
- data/app/assets/javascripts/wbase/admin/x-editable/js/bootstrap-editable.js +6807 -0
- data/app/assets/javascripts/wbase/admin/x-editable/js/bootstrap-editable.min.js +7 -0
- data/app/assets/javascripts/wbase/admin.js +50 -0
- data/app/assets/javascripts/wbase/auth/bootstrap.min.js +1 -1
- data/app/assets/javascripts/wbase/auth/detect.js +1 -1
- data/app/assets/javascripts/wbase/auth/jquery.min.js +1 -1
- data/app/assets/javascripts/wbase/auth/jquery.scrollTo.min.js +1 -1
- data/app/assets/javascripts/wbase/auth/modernizr.min.js +1 -1
- data/app/assets/javascripts/wbase/auth/pace.min.js +1 -1
- data/app/assets/javascripts/wbase/auth/wow.min.js +1 -1
- data/app/assets/javascripts/wbase/landing/bootstrap.min.js +1 -1
- data/app/assets/javascripts/wbase/landing/validator.min.js +1 -1
- data/app/assets/stylesheets/wbase/admin/components.scss +2362 -0
- data/app/assets/stylesheets/wbase/admin/core.scss +2190 -0
- data/app/assets/stylesheets/wbase/admin/datatables/buttons.bootstrap.min.css +1 -0
- data/app/assets/stylesheets/wbase/admin/datatables/dataTables.bootstrap.min.css +1 -0
- data/app/assets/stylesheets/wbase/admin/datatables/dataTables.colVis.css +185 -0
- data/app/assets/stylesheets/wbase/admin/datatables/fixedColumns.dataTables.min.css +1 -0
- data/app/assets/stylesheets/wbase/admin/datatables/fixedHeader.bootstrap.min.css +1 -0
- data/app/assets/stylesheets/wbase/admin/datatables/jquery.dataTables.min.css +333 -0
- data/app/assets/stylesheets/wbase/admin/datatables/responsive.bootstrap.min.css +1 -0
- data/app/assets/stylesheets/wbase/admin/datatables/scroller.bootstrap.min.css +1 -0
- data/app/assets/stylesheets/wbase/admin/icons.scss +9884 -0
- data/app/assets/stylesheets/wbase/admin/morris.scss +25 -0
- data/app/assets/stylesheets/wbase/admin/pages.scss +2039 -0
- data/app/assets/stylesheets/wbase/admin/responsive.scss +162 -0
- data/app/assets/stylesheets/wbase/admin/typicons.scss +1370 -0
- data/app/assets/stylesheets/wbase/admin.scss +20 -0
- data/app/assets/stylesheets/wbase/auth/components.css +77 -77
- data/app/assets/stylesheets/wbase/auth/core.css +41 -41
- data/app/assets/stylesheets/wbase/auth/pages.css +43 -43
- data/app/views/layouts/wbase/_common_foot.html.erb +42 -0
- data/app/views/layouts/wbase/_common_head.html.erb +2 -1
- data/app/views/layouts/wbase/_olark.html.erb +34 -0
- data/app/views/layouts/wbase/_sidebar.html.erb +22 -0
- data/app/views/layouts/wbase/_topbar.html.erb +48 -0
- data/app/views/layouts/wbase/admin.html.erb +42 -0
- data/app/views/layouts/wbase/auth.html.erb +2 -1
- data/app/views/layouts/wbase/landing.html.erb +1 -0
- data/app/views/shared/{_errors.html.erb → wbase/_errors.html.erb} +0 -0
- data/app/views/shared/wbase/_page_title.html.erb +26 -0
- data/config/initializers/assets.rb +1 -1
- data/lib/wbase/engine.rb +6 -1
- data/lib/wbase/version.rb +1 -1
- data/test/dummy/db/development.sqlite3 +0 -0
- metadata +846 -4
- data/app/views/layouts/wbase/application.html.erb +0 -14
@@ -0,0 +1,2457 @@
|
|
1
|
+
/*!
|
2
|
+
* Cropper v0.11.1
|
3
|
+
* https://github.com/fengyuanchen/cropper
|
4
|
+
*
|
5
|
+
* Copyright (c) 2014-2015 Fengyuan Chen and contributors
|
6
|
+
* Released under the MIT license
|
7
|
+
*
|
8
|
+
* Date: 2015-08-22T04:55:04.780Z
|
9
|
+
*/
|
10
|
+
|
11
|
+
(function (factory) {
|
12
|
+
if (typeof define === 'function' && define.amd) {
|
13
|
+
// AMD. Register as anonymous module.
|
14
|
+
define(['jquery'], factory);
|
15
|
+
} else if (typeof exports === 'object') {
|
16
|
+
// Node / CommonJS
|
17
|
+
factory(require('jquery'));
|
18
|
+
} else {
|
19
|
+
// Browser globals.
|
20
|
+
factory(jQuery);
|
21
|
+
}
|
22
|
+
})(function ($) {
|
23
|
+
|
24
|
+
'use strict';
|
25
|
+
|
26
|
+
// Globals
|
27
|
+
var $window = $(window);
|
28
|
+
var $document = $(document);
|
29
|
+
var location = window.location;
|
30
|
+
|
31
|
+
// Constants
|
32
|
+
var NAMESPACE = 'cropper';
|
33
|
+
var PREVIEW = 'preview.' + NAMESPACE;
|
34
|
+
|
35
|
+
// Classes
|
36
|
+
var CLASS_MODAL = 'cropper-modal';
|
37
|
+
var CLASS_HIDE = 'cropper-hide';
|
38
|
+
var CLASS_HIDDEN = 'cropper-hidden';
|
39
|
+
var CLASS_INVISIBLE = 'cropper-invisible';
|
40
|
+
var CLASS_MOVE = 'cropper-move';
|
41
|
+
var CLASS_CROP = 'cropper-crop';
|
42
|
+
var CLASS_DISABLED = 'cropper-disabled';
|
43
|
+
var CLASS_BG = 'cropper-bg';
|
44
|
+
|
45
|
+
// Events
|
46
|
+
var EVENT_MOUSE_DOWN = 'mousedown touchstart pointerdown MSPointerDown';
|
47
|
+
var EVENT_MOUSE_MOVE = 'mousemove touchmove pointermove MSPointerMove';
|
48
|
+
var EVENT_MOUSE_UP = 'mouseup touchend touchcancel pointerup pointercancel MSPointerUp MSPointerCancel';
|
49
|
+
var EVENT_WHEEL = 'wheel mousewheel DOMMouseScroll';
|
50
|
+
var EVENT_DBLCLICK = 'dblclick';
|
51
|
+
var EVENT_LOAD = 'load.' + NAMESPACE;
|
52
|
+
var EVENT_ERROR = 'error.' + NAMESPACE;
|
53
|
+
var EVENT_RESIZE = 'resize.' + NAMESPACE; // Bind to window with namespace
|
54
|
+
var EVENT_BUILD = 'build.' + NAMESPACE;
|
55
|
+
var EVENT_BUILT = 'built.' + NAMESPACE;
|
56
|
+
var EVENT_CROP_START = 'cropstart.' + NAMESPACE;
|
57
|
+
var EVENT_CROP_MOVE = 'cropmove.' + NAMESPACE;
|
58
|
+
var EVENT_CROP_END = 'cropend.' + NAMESPACE;
|
59
|
+
var EVENT_CROP = 'crop.' + NAMESPACE;
|
60
|
+
var EVENT_ZOOM = 'zoom.' + NAMESPACE;
|
61
|
+
|
62
|
+
// RegExps
|
63
|
+
var REGEXP_ACTIONS = /^(e|w|s|n|se|sw|ne|nw|all|crop|move|zoom)$/;
|
64
|
+
|
65
|
+
// Actions
|
66
|
+
var ACTION_EAST = 'e';
|
67
|
+
var ACTION_WEST = 'w';
|
68
|
+
var ACTION_SOUTH = 's';
|
69
|
+
var ACTION_NORTH = 'n';
|
70
|
+
var ACTION_SOUTH_EAST = 'se';
|
71
|
+
var ACTION_SOUTH_WEST = 'sw';
|
72
|
+
var ACTION_NORTH_EAST = 'ne';
|
73
|
+
var ACTION_NORTH_WEST = 'nw';
|
74
|
+
var ACTION_ALL = 'all';
|
75
|
+
var ACTION_CROP = 'crop';
|
76
|
+
var ACTION_MOVE = 'move';
|
77
|
+
var ACTION_ZOOM = 'zoom';
|
78
|
+
var ACTION_NONE = 'none';
|
79
|
+
|
80
|
+
// Supports
|
81
|
+
var SUPPORT_CANVAS = $.isFunction($('<canvas>')[0].getContext);
|
82
|
+
|
83
|
+
// Maths
|
84
|
+
var sqrt = Math.sqrt;
|
85
|
+
var min = Math.min;
|
86
|
+
var max = Math.max;
|
87
|
+
var abs = Math.abs;
|
88
|
+
var sin = Math.sin;
|
89
|
+
var cos = Math.cos;
|
90
|
+
var num = parseFloat;
|
91
|
+
|
92
|
+
// Prototype
|
93
|
+
var prototype = {};
|
94
|
+
|
95
|
+
function isNumber(n) {
|
96
|
+
return typeof n === 'number' && !isNaN(n);
|
97
|
+
}
|
98
|
+
|
99
|
+
function isUndefined(n) {
|
100
|
+
return typeof n === 'undefined';
|
101
|
+
}
|
102
|
+
|
103
|
+
function toArray(obj, offset) {
|
104
|
+
var args = [];
|
105
|
+
|
106
|
+
// This is necessary for IE8
|
107
|
+
if (isNumber(offset)) {
|
108
|
+
args.push(offset);
|
109
|
+
}
|
110
|
+
|
111
|
+
return args.slice.apply(obj, args);
|
112
|
+
}
|
113
|
+
|
114
|
+
// Custom proxy to avoid jQuery's guid
|
115
|
+
function proxy(fn, context) {
|
116
|
+
var args = toArray(arguments, 2);
|
117
|
+
|
118
|
+
return function () {
|
119
|
+
return fn.apply(context, args.concat(toArray(arguments)));
|
120
|
+
};
|
121
|
+
}
|
122
|
+
|
123
|
+
function isCrossOriginURL(url) {
|
124
|
+
var parts = url.match(/^(https?:)\/\/([^\:\/\?#]+):?(\d*)/i);
|
125
|
+
|
126
|
+
return parts && (
|
127
|
+
parts[1] !== location.protocol ||
|
128
|
+
parts[2] !== location.hostname ||
|
129
|
+
parts[3] !== location.port
|
130
|
+
);
|
131
|
+
}
|
132
|
+
|
133
|
+
function addTimestamp(url) {
|
134
|
+
var timestamp = 'timestamp=' + (new Date()).getTime();
|
135
|
+
|
136
|
+
return (url + (url.indexOf('?') === -1 ? '?' : '&') + timestamp);
|
137
|
+
}
|
138
|
+
|
139
|
+
function getImageData(image) {
|
140
|
+
var naturalWidth = image.naturalWidth;
|
141
|
+
var naturalHeight = image.naturalHeight;
|
142
|
+
var newImage;
|
143
|
+
|
144
|
+
// IE8
|
145
|
+
if (!naturalWidth) {
|
146
|
+
newImage = new Image();
|
147
|
+
newImage.src = image.src;
|
148
|
+
naturalWidth = newImage.width;
|
149
|
+
naturalHeight = newImage.height;
|
150
|
+
}
|
151
|
+
|
152
|
+
return {
|
153
|
+
naturalWidth: naturalWidth,
|
154
|
+
naturalHeight: naturalHeight,
|
155
|
+
aspectRatio: naturalWidth / naturalHeight
|
156
|
+
};
|
157
|
+
}
|
158
|
+
|
159
|
+
function getTransform(options) {
|
160
|
+
var transforms = [];
|
161
|
+
var rotate = options.rotate;
|
162
|
+
var scaleX = options.scaleX;
|
163
|
+
var scaleY = options.scaleY;
|
164
|
+
|
165
|
+
if (isNumber(rotate)) {
|
166
|
+
transforms.push('rotate(' + rotate + 'deg)');
|
167
|
+
}
|
168
|
+
|
169
|
+
if (isNumber(scaleX) && isNumber(scaleY)) {
|
170
|
+
transforms.push('scale(' + scaleX + ',' + scaleY + ')');
|
171
|
+
}
|
172
|
+
|
173
|
+
return transforms.length ? transforms.join(' ') : 'none';
|
174
|
+
}
|
175
|
+
|
176
|
+
function getRotatedSizes(data, reverse) {
|
177
|
+
var deg = abs(data.degree) % 180;
|
178
|
+
var arc = (deg > 90 ? (180 - deg) : deg) * Math.PI / 180;
|
179
|
+
var sinArc = sin(arc);
|
180
|
+
var cosArc = cos(arc);
|
181
|
+
var width = data.width;
|
182
|
+
var height = data.height;
|
183
|
+
var aspectRatio = data.aspectRatio;
|
184
|
+
var newWidth;
|
185
|
+
var newHeight;
|
186
|
+
|
187
|
+
if (!reverse) {
|
188
|
+
newWidth = width * cosArc + height * sinArc;
|
189
|
+
newHeight = width * sinArc + height * cosArc;
|
190
|
+
} else {
|
191
|
+
newWidth = width / (cosArc + sinArc / aspectRatio);
|
192
|
+
newHeight = newWidth / aspectRatio;
|
193
|
+
}
|
194
|
+
|
195
|
+
return {
|
196
|
+
width: newWidth,
|
197
|
+
height: newHeight
|
198
|
+
};
|
199
|
+
}
|
200
|
+
|
201
|
+
function getSourceCanvas(image, data) {
|
202
|
+
var canvas = $('<canvas>')[0];
|
203
|
+
var context = canvas.getContext('2d');
|
204
|
+
var x = 0;
|
205
|
+
var y = 0;
|
206
|
+
var width = data.naturalWidth;
|
207
|
+
var height = data.naturalHeight;
|
208
|
+
var rotate = data.rotate;
|
209
|
+
var scaleX = data.scaleX;
|
210
|
+
var scaleY = data.scaleY;
|
211
|
+
var scalable = isNumber(scaleX) && isNumber(scaleY) && (scaleX !== 1 || scaleY !== 1);
|
212
|
+
var rotatable = isNumber(rotate) && rotate !== 0;
|
213
|
+
var advanced = rotatable || scalable;
|
214
|
+
var canvasWidth = width;
|
215
|
+
var canvasHeight = height;
|
216
|
+
var translateX;
|
217
|
+
var translateY;
|
218
|
+
var rotated;
|
219
|
+
|
220
|
+
if (scalable) {
|
221
|
+
translateX = width / 2;
|
222
|
+
translateY = height / 2;
|
223
|
+
}
|
224
|
+
|
225
|
+
if (rotatable) {
|
226
|
+
rotated = getRotatedSizes({
|
227
|
+
width: width,
|
228
|
+
height: height,
|
229
|
+
degree: rotate
|
230
|
+
});
|
231
|
+
|
232
|
+
canvasWidth = rotated.width;
|
233
|
+
canvasHeight = rotated.height;
|
234
|
+
translateX = rotated.width / 2;
|
235
|
+
translateY = rotated.height / 2;
|
236
|
+
}
|
237
|
+
|
238
|
+
canvas.width = canvasWidth;
|
239
|
+
canvas.height = canvasHeight;
|
240
|
+
|
241
|
+
if (advanced) {
|
242
|
+
x = -width / 2;
|
243
|
+
y = -height / 2;
|
244
|
+
|
245
|
+
context.save();
|
246
|
+
context.translate(translateX, translateY);
|
247
|
+
}
|
248
|
+
|
249
|
+
if (rotatable) {
|
250
|
+
context.rotate(rotate * Math.PI / 180);
|
251
|
+
}
|
252
|
+
|
253
|
+
// Should call `scale` after rotated
|
254
|
+
if (scalable) {
|
255
|
+
context.scale(scaleX, scaleY);
|
256
|
+
}
|
257
|
+
|
258
|
+
context.drawImage(image, x, y, width, height);
|
259
|
+
|
260
|
+
if (advanced) {
|
261
|
+
context.restore();
|
262
|
+
}
|
263
|
+
|
264
|
+
return canvas;
|
265
|
+
}
|
266
|
+
|
267
|
+
function Cropper(element, options) {
|
268
|
+
this.$element = $(element);
|
269
|
+
this.options = $.extend({}, Cropper.DEFAULTS, $.isPlainObject(options) && options);
|
270
|
+
this.ready = false;
|
271
|
+
this.built = false;
|
272
|
+
this.complete = false;
|
273
|
+
this.rotated = false;
|
274
|
+
this.cropped = false;
|
275
|
+
this.disabled = false;
|
276
|
+
this.replaced = false;
|
277
|
+
this.isImg = false;
|
278
|
+
this.originalUrl = '';
|
279
|
+
this.canvas = null;
|
280
|
+
this.cropBox = null;
|
281
|
+
this.init();
|
282
|
+
}
|
283
|
+
|
284
|
+
$.extend(prototype, {
|
285
|
+
init: function () {
|
286
|
+
var $this = this.$element;
|
287
|
+
var url;
|
288
|
+
|
289
|
+
if ($this.is('img')) {
|
290
|
+
this.isImg = true;
|
291
|
+
|
292
|
+
// Should use `$.fn.attr` here. e.g.: "img/picture.jpg"
|
293
|
+
this.originalUrl = url = $this.attr('src');
|
294
|
+
|
295
|
+
// Stop when it's a blank image
|
296
|
+
if (!url) {
|
297
|
+
return;
|
298
|
+
}
|
299
|
+
|
300
|
+
// Should use `$.fn.prop` here. e.g.: "http://example.com/img/picture.jpg"
|
301
|
+
url = $this.prop('src');
|
302
|
+
} else if ($this.is('canvas') && SUPPORT_CANVAS) {
|
303
|
+
url = $this[0].toDataURL();
|
304
|
+
}
|
305
|
+
|
306
|
+
this.load(url);
|
307
|
+
},
|
308
|
+
|
309
|
+
// A shortcut for triggering custom events
|
310
|
+
trigger: function (type, data) {
|
311
|
+
var e = $.Event(type, data);
|
312
|
+
|
313
|
+
this.$element.trigger(e);
|
314
|
+
|
315
|
+
return e.isDefaultPrevented();
|
316
|
+
},
|
317
|
+
|
318
|
+
load: function (url) {
|
319
|
+
var options = this.options;
|
320
|
+
var $this = this.$element;
|
321
|
+
var crossOrigin = '';
|
322
|
+
var bustCacheUrl;
|
323
|
+
var $clone;
|
324
|
+
|
325
|
+
if (!url) {
|
326
|
+
return;
|
327
|
+
}
|
328
|
+
|
329
|
+
this.url = url;
|
330
|
+
|
331
|
+
// Trigger build event first
|
332
|
+
$this.one(EVENT_BUILD, options.build);
|
333
|
+
|
334
|
+
if (this.trigger(EVENT_BUILD)) {
|
335
|
+
return;
|
336
|
+
}
|
337
|
+
|
338
|
+
if (options.checkImageOrigin && isCrossOriginURL(url)) {
|
339
|
+
crossOrigin = ' crossOrigin="anonymous"';
|
340
|
+
|
341
|
+
// Bust cache (#148), only when there was not a "crossOrigin" property
|
342
|
+
if (!$this.prop('crossOrigin')) {
|
343
|
+
bustCacheUrl = addTimestamp(url);
|
344
|
+
}
|
345
|
+
}
|
346
|
+
|
347
|
+
this.$clone = $clone = $('<img' + crossOrigin + ' src="' + (bustCacheUrl || url) + '">');
|
348
|
+
|
349
|
+
if (this.isImg) {
|
350
|
+
if ($this[0].complete) {
|
351
|
+
this.start();
|
352
|
+
} else {
|
353
|
+
$this.one(EVENT_LOAD, $.proxy(this.start, this));
|
354
|
+
}
|
355
|
+
} else {
|
356
|
+
$clone.
|
357
|
+
one(EVENT_LOAD, $.proxy(this.start, this)).
|
358
|
+
one(EVENT_ERROR, $.proxy(this.stop, this)).
|
359
|
+
addClass(CLASS_HIDE).
|
360
|
+
insertAfter($this);
|
361
|
+
}
|
362
|
+
},
|
363
|
+
|
364
|
+
start: function () {
|
365
|
+
this.image = getImageData(this.isImg ? this.$element[0] : this.$clone[0]);
|
366
|
+
this.ready = true;
|
367
|
+
this.build();
|
368
|
+
},
|
369
|
+
|
370
|
+
stop: function () {
|
371
|
+
this.$clone.remove();
|
372
|
+
this.$clone = null;
|
373
|
+
}
|
374
|
+
});
|
375
|
+
|
376
|
+
$.extend(prototype, {
|
377
|
+
build: function () {
|
378
|
+
var options = this.options;
|
379
|
+
var $this = this.$element;
|
380
|
+
var $clone = this.$clone;
|
381
|
+
var $cropper;
|
382
|
+
var $cropBox;
|
383
|
+
var $face;
|
384
|
+
|
385
|
+
if (!this.ready) {
|
386
|
+
return;
|
387
|
+
}
|
388
|
+
|
389
|
+
// Unbuild first when replace
|
390
|
+
if (this.built) {
|
391
|
+
this.unbuild();
|
392
|
+
}
|
393
|
+
|
394
|
+
// Create cropper elements
|
395
|
+
this.$container = $this.parent();
|
396
|
+
this.$cropper = $cropper = $(Cropper.TEMPLATE);
|
397
|
+
this.$canvas = $cropper.find('.cropper-canvas').append($clone);
|
398
|
+
this.$dragBox = $cropper.find('.cropper-drag-box');
|
399
|
+
this.$cropBox = $cropBox = $cropper.find('.cropper-crop-box');
|
400
|
+
this.$viewBox = $cropper.find('.cropper-view-box');
|
401
|
+
this.$face = $face = $cropBox.find('.cropper-face');
|
402
|
+
|
403
|
+
// Hide the original image
|
404
|
+
$this.addClass(CLASS_HIDDEN).after($cropper);
|
405
|
+
|
406
|
+
// Show the clone image if is hidden
|
407
|
+
if (!this.isImg) {
|
408
|
+
$clone.removeClass(CLASS_HIDE);
|
409
|
+
}
|
410
|
+
|
411
|
+
this.initPreview();
|
412
|
+
this.bind();
|
413
|
+
|
414
|
+
// Format aspect ratio (0 -> NaN)
|
415
|
+
options.aspectRatio = num(options.aspectRatio) || NaN;
|
416
|
+
|
417
|
+
if (options.autoCrop) {
|
418
|
+
this.cropped = true;
|
419
|
+
|
420
|
+
if (options.modal) {
|
421
|
+
this.$dragBox.addClass(CLASS_MODAL);
|
422
|
+
}
|
423
|
+
} else {
|
424
|
+
$cropBox.addClass(CLASS_HIDDEN);
|
425
|
+
}
|
426
|
+
|
427
|
+
if (!options.guides) {
|
428
|
+
$cropBox.find('.cropper-dashed').addClass(CLASS_HIDDEN);
|
429
|
+
}
|
430
|
+
|
431
|
+
if (!options.center) {
|
432
|
+
$cropBox.find('.cropper-center').addClass(CLASS_HIDDEN);
|
433
|
+
}
|
434
|
+
|
435
|
+
if (options.cropBoxMovable) {
|
436
|
+
$face.addClass(CLASS_MOVE).data('action', ACTION_ALL);
|
437
|
+
}
|
438
|
+
|
439
|
+
if (!options.highlight) {
|
440
|
+
$face.addClass(CLASS_INVISIBLE);
|
441
|
+
}
|
442
|
+
|
443
|
+
if (options.background) {
|
444
|
+
$cropper.addClass(CLASS_BG);
|
445
|
+
}
|
446
|
+
|
447
|
+
if (!options.cropBoxResizable) {
|
448
|
+
$cropBox.find('.cropper-line, .cropper-point').addClass(CLASS_HIDDEN);
|
449
|
+
}
|
450
|
+
|
451
|
+
this.setDragMode(options.dragCrop ? ACTION_CROP : (options.movable ? ACTION_MOVE : ACTION_NONE));
|
452
|
+
|
453
|
+
this.render();
|
454
|
+
this.built = true;
|
455
|
+
this.setData(options.data);
|
456
|
+
$this.one(EVENT_BUILT, options.built);
|
457
|
+
|
458
|
+
// Trigger the built event asynchronously to keep `data('cropper')` is defined
|
459
|
+
setTimeout($.proxy(function () {
|
460
|
+
this.trigger(EVENT_BUILT);
|
461
|
+
this.complete = true;
|
462
|
+
}, this), 0);
|
463
|
+
},
|
464
|
+
|
465
|
+
unbuild: function () {
|
466
|
+
if (!this.built) {
|
467
|
+
return;
|
468
|
+
}
|
469
|
+
|
470
|
+
this.built = false;
|
471
|
+
this.initialImage = null;
|
472
|
+
|
473
|
+
// Clear `initialCanvas` is necessary when replace
|
474
|
+
this.initialCanvas = null;
|
475
|
+
this.initialCropBox = null;
|
476
|
+
this.container = null;
|
477
|
+
this.canvas = null;
|
478
|
+
|
479
|
+
// Clear `cropBox` is necessary when replace
|
480
|
+
this.cropBox = null;
|
481
|
+
this.unbind();
|
482
|
+
|
483
|
+
this.resetPreview();
|
484
|
+
this.$preview = null;
|
485
|
+
|
486
|
+
this.$viewBox = null;
|
487
|
+
this.$cropBox = null;
|
488
|
+
this.$dragBox = null;
|
489
|
+
this.$canvas = null;
|
490
|
+
this.$container = null;
|
491
|
+
|
492
|
+
this.$cropper.remove();
|
493
|
+
this.$cropper = null;
|
494
|
+
}
|
495
|
+
});
|
496
|
+
|
497
|
+
$.extend(prototype, {
|
498
|
+
render: function () {
|
499
|
+
this.initContainer();
|
500
|
+
this.initCanvas();
|
501
|
+
this.initCropBox();
|
502
|
+
|
503
|
+
this.renderCanvas();
|
504
|
+
|
505
|
+
if (this.cropped) {
|
506
|
+
this.renderCropBox();
|
507
|
+
}
|
508
|
+
},
|
509
|
+
|
510
|
+
initContainer: function () {
|
511
|
+
var options = this.options;
|
512
|
+
var $this = this.$element;
|
513
|
+
var $container = this.$container;
|
514
|
+
var $cropper = this.$cropper;
|
515
|
+
|
516
|
+
$cropper.addClass(CLASS_HIDDEN);
|
517
|
+
$this.removeClass(CLASS_HIDDEN);
|
518
|
+
|
519
|
+
$cropper.css((this.container = {
|
520
|
+
width: max($container.width(), num(options.minContainerWidth) || 200),
|
521
|
+
height: max($container.height(), num(options.minContainerHeight) || 100)
|
522
|
+
}));
|
523
|
+
|
524
|
+
$this.addClass(CLASS_HIDDEN);
|
525
|
+
$cropper.removeClass(CLASS_HIDDEN);
|
526
|
+
},
|
527
|
+
|
528
|
+
// Canvas (image wrapper)
|
529
|
+
initCanvas: function () {
|
530
|
+
var container = this.container;
|
531
|
+
var containerWidth = container.width;
|
532
|
+
var containerHeight = container.height;
|
533
|
+
var image = this.image;
|
534
|
+
var aspectRatio = image.aspectRatio;
|
535
|
+
var canvas = {
|
536
|
+
aspectRatio: aspectRatio,
|
537
|
+
width: containerWidth,
|
538
|
+
height: containerHeight
|
539
|
+
};
|
540
|
+
|
541
|
+
if (containerHeight * aspectRatio > containerWidth) {
|
542
|
+
canvas.height = containerWidth / aspectRatio;
|
543
|
+
} else {
|
544
|
+
canvas.width = containerHeight * aspectRatio;
|
545
|
+
}
|
546
|
+
|
547
|
+
canvas.oldLeft = canvas.left = (containerWidth - canvas.width) / 2;
|
548
|
+
canvas.oldTop = canvas.top = (containerHeight - canvas.height) / 2;
|
549
|
+
|
550
|
+
this.canvas = canvas;
|
551
|
+
this.limitCanvas(true, true);
|
552
|
+
this.initialImage = $.extend({}, image);
|
553
|
+
this.initialCanvas = $.extend({}, canvas);
|
554
|
+
},
|
555
|
+
|
556
|
+
limitCanvas: function (size, position) {
|
557
|
+
var options = this.options;
|
558
|
+
var strict = options.strict;
|
559
|
+
var container = this.container;
|
560
|
+
var containerWidth = container.width;
|
561
|
+
var containerHeight = container.height;
|
562
|
+
var canvas = this.canvas;
|
563
|
+
var aspectRatio = canvas.aspectRatio;
|
564
|
+
var cropBox = this.cropBox;
|
565
|
+
var cropped = this.cropped && cropBox;
|
566
|
+
var initialCanvas = this.initialCanvas || canvas;
|
567
|
+
var initialCanvasWidth = initialCanvas.width;
|
568
|
+
var initialCanvasHeight = initialCanvas.height;
|
569
|
+
var minCanvasWidth;
|
570
|
+
var minCanvasHeight;
|
571
|
+
|
572
|
+
if (size) {
|
573
|
+
minCanvasWidth = num(options.minCanvasWidth) || 0;
|
574
|
+
minCanvasHeight = num(options.minCanvasHeight) || 0;
|
575
|
+
|
576
|
+
if (minCanvasWidth) {
|
577
|
+
if (strict) {
|
578
|
+
minCanvasWidth = max(cropped ? cropBox.width : initialCanvasWidth, minCanvasWidth);
|
579
|
+
}
|
580
|
+
|
581
|
+
minCanvasHeight = minCanvasWidth / aspectRatio;
|
582
|
+
} else if (minCanvasHeight) {
|
583
|
+
if (strict) {
|
584
|
+
minCanvasHeight = max(cropped ? cropBox.height : initialCanvasHeight, minCanvasHeight);
|
585
|
+
}
|
586
|
+
|
587
|
+
minCanvasWidth = minCanvasHeight * aspectRatio;
|
588
|
+
} else if (strict) {
|
589
|
+
if (cropped) {
|
590
|
+
minCanvasWidth = cropBox.width;
|
591
|
+
minCanvasHeight = cropBox.height;
|
592
|
+
|
593
|
+
if (minCanvasHeight * aspectRatio > minCanvasWidth) {
|
594
|
+
minCanvasWidth = minCanvasHeight * aspectRatio;
|
595
|
+
} else {
|
596
|
+
minCanvasHeight = minCanvasWidth / aspectRatio;
|
597
|
+
}
|
598
|
+
} else {
|
599
|
+
minCanvasWidth = initialCanvasWidth;
|
600
|
+
minCanvasHeight = initialCanvasHeight;
|
601
|
+
}
|
602
|
+
}
|
603
|
+
|
604
|
+
$.extend(canvas, {
|
605
|
+
minWidth: minCanvasWidth,
|
606
|
+
minHeight: minCanvasHeight,
|
607
|
+
maxWidth: Infinity,
|
608
|
+
maxHeight: Infinity
|
609
|
+
});
|
610
|
+
}
|
611
|
+
|
612
|
+
if (position) {
|
613
|
+
if (strict) {
|
614
|
+
if (cropped) {
|
615
|
+
canvas.minLeft = min(cropBox.left, (cropBox.left + cropBox.width) - canvas.width);
|
616
|
+
canvas.minTop = min(cropBox.top, (cropBox.top + cropBox.height) - canvas.height);
|
617
|
+
canvas.maxLeft = cropBox.left;
|
618
|
+
canvas.maxTop = cropBox.top;
|
619
|
+
} else {
|
620
|
+
canvas.minLeft = min(0, containerWidth - canvas.width);
|
621
|
+
canvas.minTop = min(0, containerHeight - canvas.height);
|
622
|
+
canvas.maxLeft = max(0, containerWidth - canvas.width);
|
623
|
+
canvas.maxTop = max(0, containerHeight - canvas.height);
|
624
|
+
}
|
625
|
+
} else {
|
626
|
+
canvas.minLeft = -canvas.width;
|
627
|
+
canvas.minTop = -canvas.height;
|
628
|
+
canvas.maxLeft = containerWidth;
|
629
|
+
canvas.maxTop = containerHeight;
|
630
|
+
}
|
631
|
+
}
|
632
|
+
},
|
633
|
+
|
634
|
+
renderCanvas: function (changed) {
|
635
|
+
var options = this.options;
|
636
|
+
var canvas = this.canvas;
|
637
|
+
var image = this.image;
|
638
|
+
var aspectRatio;
|
639
|
+
var rotated;
|
640
|
+
|
641
|
+
if (this.rotated) {
|
642
|
+
this.rotated = false;
|
643
|
+
|
644
|
+
// Computes rotated sizes with image sizes
|
645
|
+
rotated = getRotatedSizes({
|
646
|
+
width: image.width,
|
647
|
+
height: image.height,
|
648
|
+
degree: image.rotate
|
649
|
+
});
|
650
|
+
|
651
|
+
aspectRatio = rotated.width / rotated.height;
|
652
|
+
|
653
|
+
if (aspectRatio !== canvas.aspectRatio) {
|
654
|
+
canvas.left -= (rotated.width - canvas.width) / 2;
|
655
|
+
canvas.top -= (rotated.height - canvas.height) / 2;
|
656
|
+
canvas.width = rotated.width;
|
657
|
+
canvas.height = rotated.height;
|
658
|
+
canvas.aspectRatio = aspectRatio;
|
659
|
+
this.limitCanvas(true, false);
|
660
|
+
}
|
661
|
+
}
|
662
|
+
|
663
|
+
if (canvas.width > canvas.maxWidth || canvas.width < canvas.minWidth) {
|
664
|
+
canvas.left = canvas.oldLeft;
|
665
|
+
}
|
666
|
+
|
667
|
+
if (canvas.height > canvas.maxHeight || canvas.height < canvas.minHeight) {
|
668
|
+
canvas.top = canvas.oldTop;
|
669
|
+
}
|
670
|
+
|
671
|
+
canvas.width = min(max(canvas.width, canvas.minWidth), canvas.maxWidth);
|
672
|
+
canvas.height = min(max(canvas.height, canvas.minHeight), canvas.maxHeight);
|
673
|
+
|
674
|
+
this.limitCanvas(false, true);
|
675
|
+
|
676
|
+
canvas.oldLeft = canvas.left = min(max(canvas.left, canvas.minLeft), canvas.maxLeft);
|
677
|
+
canvas.oldTop = canvas.top = min(max(canvas.top, canvas.minTop), canvas.maxTop);
|
678
|
+
|
679
|
+
this.$canvas.css({
|
680
|
+
width: canvas.width,
|
681
|
+
height: canvas.height,
|
682
|
+
left: canvas.left,
|
683
|
+
top: canvas.top
|
684
|
+
});
|
685
|
+
|
686
|
+
this.renderImage();
|
687
|
+
|
688
|
+
if (this.cropped && options.strict) {
|
689
|
+
this.limitCropBox(true, true);
|
690
|
+
}
|
691
|
+
|
692
|
+
if (changed) {
|
693
|
+
this.output();
|
694
|
+
}
|
695
|
+
},
|
696
|
+
|
697
|
+
renderImage: function (changed) {
|
698
|
+
var canvas = this.canvas;
|
699
|
+
var image = this.image;
|
700
|
+
var reversed;
|
701
|
+
|
702
|
+
if (image.rotate) {
|
703
|
+
reversed = getRotatedSizes({
|
704
|
+
width: canvas.width,
|
705
|
+
height: canvas.height,
|
706
|
+
degree: image.rotate,
|
707
|
+
aspectRatio: image.aspectRatio
|
708
|
+
}, true);
|
709
|
+
}
|
710
|
+
|
711
|
+
$.extend(image, reversed ? {
|
712
|
+
width: reversed.width,
|
713
|
+
height: reversed.height,
|
714
|
+
left: (canvas.width - reversed.width) / 2,
|
715
|
+
top: (canvas.height - reversed.height) / 2
|
716
|
+
} : {
|
717
|
+
width: canvas.width,
|
718
|
+
height: canvas.height,
|
719
|
+
left: 0,
|
720
|
+
top: 0
|
721
|
+
});
|
722
|
+
|
723
|
+
this.$clone.css({
|
724
|
+
width: image.width,
|
725
|
+
height: image.height,
|
726
|
+
marginLeft: image.left,
|
727
|
+
marginTop: image.top,
|
728
|
+
transform: getTransform(image)
|
729
|
+
});
|
730
|
+
|
731
|
+
if (changed) {
|
732
|
+
this.output();
|
733
|
+
}
|
734
|
+
},
|
735
|
+
|
736
|
+
initCropBox: function () {
|
737
|
+
var options = this.options;
|
738
|
+
var canvas = this.canvas;
|
739
|
+
var aspectRatio = options.aspectRatio;
|
740
|
+
var autoCropArea = num(options.autoCropArea) || 0.8;
|
741
|
+
var cropBox = {
|
742
|
+
width: canvas.width,
|
743
|
+
height: canvas.height
|
744
|
+
};
|
745
|
+
|
746
|
+
if (aspectRatio) {
|
747
|
+
if (canvas.height * aspectRatio > canvas.width) {
|
748
|
+
cropBox.height = cropBox.width / aspectRatio;
|
749
|
+
} else {
|
750
|
+
cropBox.width = cropBox.height * aspectRatio;
|
751
|
+
}
|
752
|
+
}
|
753
|
+
|
754
|
+
this.cropBox = cropBox;
|
755
|
+
this.limitCropBox(true, true);
|
756
|
+
|
757
|
+
// Initialize auto crop area
|
758
|
+
cropBox.width = min(max(cropBox.width, cropBox.minWidth), cropBox.maxWidth);
|
759
|
+
cropBox.height = min(max(cropBox.height, cropBox.minHeight), cropBox.maxHeight);
|
760
|
+
|
761
|
+
// The width of auto crop area must large than "minWidth", and the height too. (#164)
|
762
|
+
cropBox.width = max(cropBox.minWidth, cropBox.width * autoCropArea);
|
763
|
+
cropBox.height = max(cropBox.minHeight, cropBox.height * autoCropArea);
|
764
|
+
cropBox.oldLeft = cropBox.left = canvas.left + (canvas.width - cropBox.width) / 2;
|
765
|
+
cropBox.oldTop = cropBox.top = canvas.top + (canvas.height - cropBox.height) / 2;
|
766
|
+
|
767
|
+
this.initialCropBox = $.extend({}, cropBox);
|
768
|
+
},
|
769
|
+
|
770
|
+
limitCropBox: function (size, position) {
|
771
|
+
var options = this.options;
|
772
|
+
var strict = options.strict;
|
773
|
+
var container = this.container;
|
774
|
+
var containerWidth = container.width;
|
775
|
+
var containerHeight = container.height;
|
776
|
+
var canvas = this.canvas;
|
777
|
+
var cropBox = this.cropBox;
|
778
|
+
var aspectRatio = options.aspectRatio;
|
779
|
+
var minCropBoxWidth;
|
780
|
+
var minCropBoxHeight;
|
781
|
+
|
782
|
+
if (size) {
|
783
|
+
minCropBoxWidth = num(options.minCropBoxWidth) || 0;
|
784
|
+
minCropBoxHeight = num(options.minCropBoxHeight) || 0;
|
785
|
+
|
786
|
+
// The min/maxCropBoxWidth/Height must less than container width/height
|
787
|
+
cropBox.minWidth = min(containerWidth, minCropBoxWidth);
|
788
|
+
cropBox.minHeight = min(containerHeight, minCropBoxHeight);
|
789
|
+
cropBox.maxWidth = min(containerWidth, strict ? canvas.width : containerWidth);
|
790
|
+
cropBox.maxHeight = min(containerHeight, strict ? canvas.height : containerHeight);
|
791
|
+
|
792
|
+
if (aspectRatio) {
|
793
|
+
|
794
|
+
// Compare crop box size with container first
|
795
|
+
if (cropBox.maxHeight * aspectRatio > cropBox.maxWidth) {
|
796
|
+
cropBox.minHeight = cropBox.minWidth / aspectRatio;
|
797
|
+
cropBox.maxHeight = cropBox.maxWidth / aspectRatio;
|
798
|
+
} else {
|
799
|
+
cropBox.minWidth = cropBox.minHeight * aspectRatio;
|
800
|
+
cropBox.maxWidth = cropBox.maxHeight * aspectRatio;
|
801
|
+
}
|
802
|
+
}
|
803
|
+
|
804
|
+
// The "minWidth" must be less than "maxWidth", and the "minHeight" too.
|
805
|
+
cropBox.minWidth = min(cropBox.maxWidth, cropBox.minWidth);
|
806
|
+
cropBox.minHeight = min(cropBox.maxHeight, cropBox.minHeight);
|
807
|
+
}
|
808
|
+
|
809
|
+
if (position) {
|
810
|
+
if (strict) {
|
811
|
+
cropBox.minLeft = max(0, canvas.left);
|
812
|
+
cropBox.minTop = max(0, canvas.top);
|
813
|
+
cropBox.maxLeft = min(containerWidth, canvas.left + canvas.width) - cropBox.width;
|
814
|
+
cropBox.maxTop = min(containerHeight, canvas.top + canvas.height) - cropBox.height;
|
815
|
+
} else {
|
816
|
+
cropBox.minLeft = 0;
|
817
|
+
cropBox.minTop = 0;
|
818
|
+
cropBox.maxLeft = containerWidth - cropBox.width;
|
819
|
+
cropBox.maxTop = containerHeight - cropBox.height;
|
820
|
+
}
|
821
|
+
}
|
822
|
+
},
|
823
|
+
|
824
|
+
renderCropBox: function () {
|
825
|
+
var options = this.options;
|
826
|
+
var container = this.container;
|
827
|
+
var containerWidth = container.width;
|
828
|
+
var containerHeight = container.height;
|
829
|
+
var cropBox = this.cropBox;
|
830
|
+
|
831
|
+
if (cropBox.width > cropBox.maxWidth || cropBox.width < cropBox.minWidth) {
|
832
|
+
cropBox.left = cropBox.oldLeft;
|
833
|
+
}
|
834
|
+
|
835
|
+
if (cropBox.height > cropBox.maxHeight || cropBox.height < cropBox.minHeight) {
|
836
|
+
cropBox.top = cropBox.oldTop;
|
837
|
+
}
|
838
|
+
|
839
|
+
cropBox.width = min(max(cropBox.width, cropBox.minWidth), cropBox.maxWidth);
|
840
|
+
cropBox.height = min(max(cropBox.height, cropBox.minHeight), cropBox.maxHeight);
|
841
|
+
|
842
|
+
this.limitCropBox(false, true);
|
843
|
+
|
844
|
+
cropBox.oldLeft = cropBox.left = min(max(cropBox.left, cropBox.minLeft), cropBox.maxLeft);
|
845
|
+
cropBox.oldTop = cropBox.top = min(max(cropBox.top, cropBox.minTop), cropBox.maxTop);
|
846
|
+
|
847
|
+
if (options.movable && options.cropBoxMovable) {
|
848
|
+
|
849
|
+
// Turn to move the canvas when the crop box is equal to the container
|
850
|
+
this.$face.data('action', (cropBox.width === containerWidth && cropBox.height === containerHeight) ? ACTION_MOVE : ACTION_ALL);
|
851
|
+
}
|
852
|
+
|
853
|
+
this.$cropBox.css({
|
854
|
+
width: cropBox.width,
|
855
|
+
height: cropBox.height,
|
856
|
+
left: cropBox.left,
|
857
|
+
top: cropBox.top
|
858
|
+
});
|
859
|
+
|
860
|
+
if (this.cropped && options.strict) {
|
861
|
+
this.limitCanvas(true, true);
|
862
|
+
}
|
863
|
+
|
864
|
+
if (!this.disabled) {
|
865
|
+
this.output();
|
866
|
+
}
|
867
|
+
},
|
868
|
+
|
869
|
+
output: function () {
|
870
|
+
this.preview();
|
871
|
+
|
872
|
+
if (this.complete) {
|
873
|
+
this.trigger(EVENT_CROP, this.getData());
|
874
|
+
} else if (!this.built) {
|
875
|
+
|
876
|
+
// Only trigger one crop event before complete
|
877
|
+
this.$element.one(EVENT_BUILT, $.proxy(function () {
|
878
|
+
this.trigger(EVENT_CROP, this.getData());
|
879
|
+
}, this));
|
880
|
+
}
|
881
|
+
}
|
882
|
+
});
|
883
|
+
|
884
|
+
$.extend(prototype, {
|
885
|
+
initPreview: function () {
|
886
|
+
var url = this.url;
|
887
|
+
|
888
|
+
this.$preview = $(this.options.preview);
|
889
|
+
this.$viewBox.html('<img src="' + url + '">');
|
890
|
+
this.$preview.each(function () {
|
891
|
+
var $this = $(this);
|
892
|
+
|
893
|
+
// Save the original size for recover
|
894
|
+
$this.data(PREVIEW, {
|
895
|
+
width: $this.width(),
|
896
|
+
height: $this.height(),
|
897
|
+
original: $this.html()
|
898
|
+
});
|
899
|
+
|
900
|
+
/**
|
901
|
+
* Override img element styles
|
902
|
+
* Add `display:block` to avoid margin top issue
|
903
|
+
* (Occur only when margin-top <= -height)
|
904
|
+
*/
|
905
|
+
$this.html(
|
906
|
+
'<img src="' + url + '" style="display:block;width:100%;' +
|
907
|
+
'min-width:0!important;min-height:0!important;' +
|
908
|
+
'max-width:none!important;max-height:none!important;' +
|
909
|
+
'image-orientation:0deg!important">'
|
910
|
+
);
|
911
|
+
});
|
912
|
+
},
|
913
|
+
|
914
|
+
resetPreview: function () {
|
915
|
+
this.$preview.each(function () {
|
916
|
+
var $this = $(this);
|
917
|
+
|
918
|
+
$this.html($this.data(PREVIEW).original).removeData(PREVIEW);
|
919
|
+
});
|
920
|
+
},
|
921
|
+
|
922
|
+
preview: function () {
|
923
|
+
var image = this.image;
|
924
|
+
var canvas = this.canvas;
|
925
|
+
var cropBox = this.cropBox;
|
926
|
+
var width = image.width;
|
927
|
+
var height = image.height;
|
928
|
+
var left = cropBox.left - canvas.left - image.left;
|
929
|
+
var top = cropBox.top - canvas.top - image.top;
|
930
|
+
|
931
|
+
if (!this.cropped || this.disabled) {
|
932
|
+
return;
|
933
|
+
}
|
934
|
+
|
935
|
+
this.$viewBox.find('img').css({
|
936
|
+
width: width,
|
937
|
+
height: height,
|
938
|
+
marginLeft: -left,
|
939
|
+
marginTop: -top,
|
940
|
+
transform: getTransform(image)
|
941
|
+
});
|
942
|
+
|
943
|
+
this.$preview.each(function () {
|
944
|
+
var $this = $(this);
|
945
|
+
var data = $this.data(PREVIEW);
|
946
|
+
var ratio = data.width / cropBox.width;
|
947
|
+
var newWidth = data.width;
|
948
|
+
var newHeight = cropBox.height * ratio;
|
949
|
+
|
950
|
+
if (newHeight > data.height) {
|
951
|
+
ratio = data.height / cropBox.height;
|
952
|
+
newWidth = cropBox.width * ratio;
|
953
|
+
newHeight = data.height;
|
954
|
+
}
|
955
|
+
|
956
|
+
$this.width(newWidth).height(newHeight).find('img').css({
|
957
|
+
width: width * ratio,
|
958
|
+
height: height * ratio,
|
959
|
+
marginLeft: -left * ratio,
|
960
|
+
marginTop: -top * ratio,
|
961
|
+
transform: getTransform(image)
|
962
|
+
});
|
963
|
+
});
|
964
|
+
}
|
965
|
+
});
|
966
|
+
|
967
|
+
$.extend(prototype, {
|
968
|
+
bind: function () {
|
969
|
+
var options = this.options;
|
970
|
+
var $this = this.$element;
|
971
|
+
var $cropper = this.$cropper;
|
972
|
+
|
973
|
+
if ($.isFunction(options.cropstart)) {
|
974
|
+
$this.on(EVENT_CROP_START, options.cropstart);
|
975
|
+
}
|
976
|
+
|
977
|
+
if ($.isFunction(options.cropmove)) {
|
978
|
+
$this.on(EVENT_CROP_MOVE, options.cropmove);
|
979
|
+
}
|
980
|
+
|
981
|
+
if ($.isFunction(options.cropend)) {
|
982
|
+
$this.on(EVENT_CROP_END, options.cropend);
|
983
|
+
}
|
984
|
+
|
985
|
+
if ($.isFunction(options.crop)) {
|
986
|
+
$this.on(EVENT_CROP, options.crop);
|
987
|
+
}
|
988
|
+
|
989
|
+
if ($.isFunction(options.zoom)) {
|
990
|
+
$this.on(EVENT_ZOOM, options.zoom);
|
991
|
+
}
|
992
|
+
|
993
|
+
$cropper.on(EVENT_MOUSE_DOWN, $.proxy(this.cropStart, this));
|
994
|
+
|
995
|
+
if (options.zoomable && options.mouseWheelZoom) {
|
996
|
+
$cropper.on(EVENT_WHEEL, $.proxy(this.wheel, this));
|
997
|
+
}
|
998
|
+
|
999
|
+
if (options.doubleClickToggle) {
|
1000
|
+
$cropper.on(EVENT_DBLCLICK, $.proxy(this.dblclick, this));
|
1001
|
+
}
|
1002
|
+
|
1003
|
+
$document.
|
1004
|
+
on(EVENT_MOUSE_MOVE, (this._cropMove = proxy(this.cropMove, this))).
|
1005
|
+
on(EVENT_MOUSE_UP, (this._cropEnd = proxy(this.cropEnd, this)));
|
1006
|
+
|
1007
|
+
if (options.responsive) {
|
1008
|
+
$window.on(EVENT_RESIZE, (this._resize = proxy(this.resize, this)));
|
1009
|
+
}
|
1010
|
+
},
|
1011
|
+
|
1012
|
+
unbind: function () {
|
1013
|
+
var options = this.options;
|
1014
|
+
var $this = this.$element;
|
1015
|
+
var $cropper = this.$cropper;
|
1016
|
+
|
1017
|
+
if ($.isFunction(options.cropstart)) {
|
1018
|
+
$this.off(EVENT_CROP_START, options.cropstart);
|
1019
|
+
}
|
1020
|
+
|
1021
|
+
if ($.isFunction(options.cropmove)) {
|
1022
|
+
$this.off(EVENT_CROP_MOVE, options.cropmove);
|
1023
|
+
}
|
1024
|
+
|
1025
|
+
if ($.isFunction(options.cropend)) {
|
1026
|
+
$this.off(EVENT_CROP_END, options.cropend);
|
1027
|
+
}
|
1028
|
+
|
1029
|
+
if ($.isFunction(options.crop)) {
|
1030
|
+
$this.off(EVENT_CROP, options.crop);
|
1031
|
+
}
|
1032
|
+
|
1033
|
+
if ($.isFunction(options.zoom)) {
|
1034
|
+
$this.off(EVENT_ZOOM, options.zoom);
|
1035
|
+
}
|
1036
|
+
|
1037
|
+
$cropper.off(EVENT_MOUSE_DOWN, this.cropStart);
|
1038
|
+
|
1039
|
+
if (options.zoomable && options.mouseWheelZoom) {
|
1040
|
+
$cropper.off(EVENT_WHEEL, this.wheel);
|
1041
|
+
}
|
1042
|
+
|
1043
|
+
if (options.doubleClickToggle) {
|
1044
|
+
$cropper.off(EVENT_DBLCLICK, this.dblclick);
|
1045
|
+
}
|
1046
|
+
|
1047
|
+
$document.
|
1048
|
+
off(EVENT_MOUSE_MOVE, this._cropMove).
|
1049
|
+
off(EVENT_MOUSE_UP, this._cropEnd);
|
1050
|
+
|
1051
|
+
if (options.responsive) {
|
1052
|
+
$window.off(EVENT_RESIZE, this._resize);
|
1053
|
+
}
|
1054
|
+
}
|
1055
|
+
});
|
1056
|
+
|
1057
|
+
$.extend(prototype, {
|
1058
|
+
resize: function () {
|
1059
|
+
var $container = this.$container;
|
1060
|
+
var container = this.container;
|
1061
|
+
var canvasData;
|
1062
|
+
var cropBoxData;
|
1063
|
+
var ratio;
|
1064
|
+
|
1065
|
+
// Check `container` is necessary for IE8
|
1066
|
+
if (this.disabled || !container) {
|
1067
|
+
return;
|
1068
|
+
}
|
1069
|
+
|
1070
|
+
ratio = $container.width() / container.width;
|
1071
|
+
|
1072
|
+
// Resize when width changed or height changed
|
1073
|
+
if (ratio !== 1 || $container.height() !== container.height) {
|
1074
|
+
canvasData = this.getCanvasData();
|
1075
|
+
cropBoxData = this.getCropBoxData();
|
1076
|
+
|
1077
|
+
this.render();
|
1078
|
+
this.setCanvasData($.each(canvasData, function (i, n) {
|
1079
|
+
canvasData[i] = n * ratio;
|
1080
|
+
}));
|
1081
|
+
this.setCropBoxData($.each(cropBoxData, function (i, n) {
|
1082
|
+
cropBoxData[i] = n * ratio;
|
1083
|
+
}));
|
1084
|
+
}
|
1085
|
+
},
|
1086
|
+
|
1087
|
+
dblclick: function () {
|
1088
|
+
if (this.disabled) {
|
1089
|
+
return;
|
1090
|
+
}
|
1091
|
+
|
1092
|
+
if (this.$dragBox.hasClass(CLASS_CROP)) {
|
1093
|
+
this.setDragMode(ACTION_MOVE);
|
1094
|
+
} else {
|
1095
|
+
this.setDragMode(ACTION_CROP);
|
1096
|
+
}
|
1097
|
+
},
|
1098
|
+
|
1099
|
+
wheel: function (event) {
|
1100
|
+
var originalEvent = event.originalEvent;
|
1101
|
+
var e = originalEvent;
|
1102
|
+
var ratio = num(this.options.wheelZoomRatio) || 0.1;
|
1103
|
+
var delta = 1;
|
1104
|
+
|
1105
|
+
if (this.disabled) {
|
1106
|
+
return;
|
1107
|
+
}
|
1108
|
+
|
1109
|
+
event.preventDefault();
|
1110
|
+
|
1111
|
+
if (e.deltaY) {
|
1112
|
+
delta = e.deltaY > 0 ? 1 : -1;
|
1113
|
+
} else if (e.wheelDelta) {
|
1114
|
+
delta = -e.wheelDelta / 120;
|
1115
|
+
} else if (e.detail) {
|
1116
|
+
delta = e.detail > 0 ? 1 : -1;
|
1117
|
+
}
|
1118
|
+
|
1119
|
+
this.zoom(-delta * ratio, originalEvent);
|
1120
|
+
},
|
1121
|
+
|
1122
|
+
cropStart: function (event) {
|
1123
|
+
var options = this.options;
|
1124
|
+
var originalEvent = event.originalEvent;
|
1125
|
+
var touches = originalEvent && originalEvent.touches;
|
1126
|
+
var e = event;
|
1127
|
+
var touchesLength;
|
1128
|
+
var action;
|
1129
|
+
|
1130
|
+
if (this.disabled) {
|
1131
|
+
return;
|
1132
|
+
}
|
1133
|
+
|
1134
|
+
if (touches) {
|
1135
|
+
touchesLength = touches.length;
|
1136
|
+
|
1137
|
+
if (touchesLength > 1) {
|
1138
|
+
if (options.zoomable && options.touchDragZoom && touchesLength === 2) {
|
1139
|
+
e = touches[1];
|
1140
|
+
this.startX2 = e.pageX;
|
1141
|
+
this.startY2 = e.pageY;
|
1142
|
+
action = ACTION_ZOOM;
|
1143
|
+
} else {
|
1144
|
+
return;
|
1145
|
+
}
|
1146
|
+
}
|
1147
|
+
|
1148
|
+
e = touches[0];
|
1149
|
+
}
|
1150
|
+
|
1151
|
+
action = action || $(e.target).data('action');
|
1152
|
+
|
1153
|
+
if (REGEXP_ACTIONS.test(action)) {
|
1154
|
+
if (this.trigger(EVENT_CROP_START, {
|
1155
|
+
originalEvent: originalEvent,
|
1156
|
+
action: action
|
1157
|
+
})) {
|
1158
|
+
return;
|
1159
|
+
}
|
1160
|
+
|
1161
|
+
event.preventDefault();
|
1162
|
+
|
1163
|
+
this.action = action;
|
1164
|
+
this.cropping = false;
|
1165
|
+
|
1166
|
+
// IE8 has `event.pageX/Y`, but not `event.originalEvent.pageX/Y`
|
1167
|
+
// IE10 has `event.originalEvent.pageX/Y`, but not `event.pageX/Y`
|
1168
|
+
this.startX = e.pageX || originalEvent && originalEvent.pageX;
|
1169
|
+
this.startY = e.pageY || originalEvent && originalEvent.pageY;
|
1170
|
+
|
1171
|
+
if (action === ACTION_CROP) {
|
1172
|
+
this.cropping = true;
|
1173
|
+
this.$dragBox.addClass(CLASS_MODAL);
|
1174
|
+
}
|
1175
|
+
}
|
1176
|
+
},
|
1177
|
+
|
1178
|
+
cropMove: function (event) {
|
1179
|
+
var options = this.options;
|
1180
|
+
var originalEvent = event.originalEvent;
|
1181
|
+
var touches = originalEvent && originalEvent.touches;
|
1182
|
+
var e = event;
|
1183
|
+
var action = this.action;
|
1184
|
+
var touchesLength;
|
1185
|
+
|
1186
|
+
if (this.disabled) {
|
1187
|
+
return;
|
1188
|
+
}
|
1189
|
+
|
1190
|
+
if (touches) {
|
1191
|
+
touchesLength = touches.length;
|
1192
|
+
|
1193
|
+
if (touchesLength > 1) {
|
1194
|
+
if (options.zoomable && options.touchDragZoom && touchesLength === 2) {
|
1195
|
+
e = touches[1];
|
1196
|
+
this.endX2 = e.pageX;
|
1197
|
+
this.endY2 = e.pageY;
|
1198
|
+
} else {
|
1199
|
+
return;
|
1200
|
+
}
|
1201
|
+
}
|
1202
|
+
|
1203
|
+
e = touches[0];
|
1204
|
+
}
|
1205
|
+
|
1206
|
+
if (action) {
|
1207
|
+
if (this.trigger(EVENT_CROP_MOVE, {
|
1208
|
+
originalEvent: originalEvent,
|
1209
|
+
action: action
|
1210
|
+
})) {
|
1211
|
+
return;
|
1212
|
+
}
|
1213
|
+
|
1214
|
+
event.preventDefault();
|
1215
|
+
|
1216
|
+
this.endX = e.pageX || originalEvent && originalEvent.pageX;
|
1217
|
+
this.endY = e.pageY || originalEvent && originalEvent.pageY;
|
1218
|
+
|
1219
|
+
this.change(e.shiftKey, action === ACTION_ZOOM ? originalEvent : null);
|
1220
|
+
}
|
1221
|
+
},
|
1222
|
+
|
1223
|
+
cropEnd: function (event) {
|
1224
|
+
var originalEvent = event.originalEvent;
|
1225
|
+
var action = this.action;
|
1226
|
+
|
1227
|
+
if (this.disabled) {
|
1228
|
+
return;
|
1229
|
+
}
|
1230
|
+
|
1231
|
+
if (action) {
|
1232
|
+
event.preventDefault();
|
1233
|
+
|
1234
|
+
if (this.cropping) {
|
1235
|
+
this.cropping = false;
|
1236
|
+
this.$dragBox.toggleClass(CLASS_MODAL, this.cropped && this.options.modal);
|
1237
|
+
}
|
1238
|
+
|
1239
|
+
this.action = '';
|
1240
|
+
|
1241
|
+
this.trigger(EVENT_CROP_END, {
|
1242
|
+
originalEvent: originalEvent,
|
1243
|
+
action: action
|
1244
|
+
});
|
1245
|
+
}
|
1246
|
+
}
|
1247
|
+
});
|
1248
|
+
|
1249
|
+
$.extend(prototype, {
|
1250
|
+
change: function (shiftKey, originalEvent) {
|
1251
|
+
var options = this.options;
|
1252
|
+
var aspectRatio = options.aspectRatio;
|
1253
|
+
var action = this.action;
|
1254
|
+
var container = this.container;
|
1255
|
+
var canvas = this.canvas;
|
1256
|
+
var cropBox = this.cropBox;
|
1257
|
+
var width = cropBox.width;
|
1258
|
+
var height = cropBox.height;
|
1259
|
+
var left = cropBox.left;
|
1260
|
+
var top = cropBox.top;
|
1261
|
+
var right = left + width;
|
1262
|
+
var bottom = top + height;
|
1263
|
+
var minLeft = 0;
|
1264
|
+
var minTop = 0;
|
1265
|
+
var maxWidth = container.width;
|
1266
|
+
var maxHeight = container.height;
|
1267
|
+
var renderable = true;
|
1268
|
+
var offset;
|
1269
|
+
var range;
|
1270
|
+
|
1271
|
+
// Locking aspect ratio in "free mode" by holding shift key (#259)
|
1272
|
+
if (!aspectRatio && shiftKey) {
|
1273
|
+
aspectRatio = width && height ? width / height : 1;
|
1274
|
+
}
|
1275
|
+
|
1276
|
+
if (options.strict) {
|
1277
|
+
minLeft = cropBox.minLeft;
|
1278
|
+
minTop = cropBox.minTop;
|
1279
|
+
maxWidth = minLeft + min(container.width, canvas.width);
|
1280
|
+
maxHeight = minTop + min(container.height, canvas.height);
|
1281
|
+
}
|
1282
|
+
|
1283
|
+
range = {
|
1284
|
+
x: this.endX - this.startX,
|
1285
|
+
y: this.endY - this.startY
|
1286
|
+
};
|
1287
|
+
|
1288
|
+
if (aspectRatio) {
|
1289
|
+
range.X = range.y * aspectRatio;
|
1290
|
+
range.Y = range.x / aspectRatio;
|
1291
|
+
}
|
1292
|
+
|
1293
|
+
switch (action) {
|
1294
|
+
// Move crop box
|
1295
|
+
case ACTION_ALL:
|
1296
|
+
left += range.x;
|
1297
|
+
top += range.y;
|
1298
|
+
break;
|
1299
|
+
|
1300
|
+
// Resize crop box
|
1301
|
+
case ACTION_EAST:
|
1302
|
+
if (range.x >= 0 && (right >= maxWidth || aspectRatio &&
|
1303
|
+
(top <= minTop || bottom >= maxHeight))) {
|
1304
|
+
|
1305
|
+
renderable = false;
|
1306
|
+
break;
|
1307
|
+
}
|
1308
|
+
|
1309
|
+
width += range.x;
|
1310
|
+
|
1311
|
+
if (aspectRatio) {
|
1312
|
+
height = width / aspectRatio;
|
1313
|
+
top -= range.Y / 2;
|
1314
|
+
}
|
1315
|
+
|
1316
|
+
if (width < 0) {
|
1317
|
+
action = ACTION_WEST;
|
1318
|
+
width = 0;
|
1319
|
+
}
|
1320
|
+
|
1321
|
+
break;
|
1322
|
+
|
1323
|
+
case ACTION_NORTH:
|
1324
|
+
if (range.y <= 0 && (top <= minTop || aspectRatio &&
|
1325
|
+
(left <= minLeft || right >= maxWidth))) {
|
1326
|
+
|
1327
|
+
renderable = false;
|
1328
|
+
break;
|
1329
|
+
}
|
1330
|
+
|
1331
|
+
height -= range.y;
|
1332
|
+
top += range.y;
|
1333
|
+
|
1334
|
+
if (aspectRatio) {
|
1335
|
+
width = height * aspectRatio;
|
1336
|
+
left += range.X / 2;
|
1337
|
+
}
|
1338
|
+
|
1339
|
+
if (height < 0) {
|
1340
|
+
action = ACTION_SOUTH;
|
1341
|
+
height = 0;
|
1342
|
+
}
|
1343
|
+
|
1344
|
+
break;
|
1345
|
+
|
1346
|
+
case ACTION_WEST:
|
1347
|
+
if (range.x <= 0 && (left <= minLeft || aspectRatio &&
|
1348
|
+
(top <= minTop || bottom >= maxHeight))) {
|
1349
|
+
|
1350
|
+
renderable = false;
|
1351
|
+
break;
|
1352
|
+
}
|
1353
|
+
|
1354
|
+
width -= range.x;
|
1355
|
+
left += range.x;
|
1356
|
+
|
1357
|
+
if (aspectRatio) {
|
1358
|
+
height = width / aspectRatio;
|
1359
|
+
top += range.Y / 2;
|
1360
|
+
}
|
1361
|
+
|
1362
|
+
if (width < 0) {
|
1363
|
+
action = ACTION_EAST;
|
1364
|
+
width = 0;
|
1365
|
+
}
|
1366
|
+
|
1367
|
+
break;
|
1368
|
+
|
1369
|
+
case ACTION_SOUTH:
|
1370
|
+
if (range.y >= 0 && (bottom >= maxHeight || aspectRatio &&
|
1371
|
+
(left <= minLeft || right >= maxWidth))) {
|
1372
|
+
|
1373
|
+
renderable = false;
|
1374
|
+
break;
|
1375
|
+
}
|
1376
|
+
|
1377
|
+
height += range.y;
|
1378
|
+
|
1379
|
+
if (aspectRatio) {
|
1380
|
+
width = height * aspectRatio;
|
1381
|
+
left -= range.X / 2;
|
1382
|
+
}
|
1383
|
+
|
1384
|
+
if (height < 0) {
|
1385
|
+
action = ACTION_NORTH;
|
1386
|
+
height = 0;
|
1387
|
+
}
|
1388
|
+
|
1389
|
+
break;
|
1390
|
+
|
1391
|
+
case ACTION_NORTH_EAST:
|
1392
|
+
if (aspectRatio) {
|
1393
|
+
if (range.y <= 0 && (top <= minTop || right >= maxWidth)) {
|
1394
|
+
renderable = false;
|
1395
|
+
break;
|
1396
|
+
}
|
1397
|
+
|
1398
|
+
height -= range.y;
|
1399
|
+
top += range.y;
|
1400
|
+
width = height * aspectRatio;
|
1401
|
+
} else {
|
1402
|
+
if (range.x >= 0) {
|
1403
|
+
if (right < maxWidth) {
|
1404
|
+
width += range.x;
|
1405
|
+
} else if (range.y <= 0 && top <= minTop) {
|
1406
|
+
renderable = false;
|
1407
|
+
}
|
1408
|
+
} else {
|
1409
|
+
width += range.x;
|
1410
|
+
}
|
1411
|
+
|
1412
|
+
if (range.y <= 0) {
|
1413
|
+
if (top > minTop) {
|
1414
|
+
height -= range.y;
|
1415
|
+
top += range.y;
|
1416
|
+
}
|
1417
|
+
} else {
|
1418
|
+
height -= range.y;
|
1419
|
+
top += range.y;
|
1420
|
+
}
|
1421
|
+
}
|
1422
|
+
|
1423
|
+
if (width < 0 && height < 0) {
|
1424
|
+
action = ACTION_SOUTH_WEST;
|
1425
|
+
height = 0;
|
1426
|
+
width = 0;
|
1427
|
+
} else if (width < 0) {
|
1428
|
+
action = ACTION_NORTH_WEST;
|
1429
|
+
width = 0;
|
1430
|
+
} else if (height < 0) {
|
1431
|
+
action = ACTION_SOUTH_EAST;
|
1432
|
+
height = 0;
|
1433
|
+
}
|
1434
|
+
|
1435
|
+
break;
|
1436
|
+
|
1437
|
+
case ACTION_NORTH_WEST:
|
1438
|
+
if (aspectRatio) {
|
1439
|
+
if (range.y <= 0 && (top <= minTop || left <= minLeft)) {
|
1440
|
+
renderable = false;
|
1441
|
+
break;
|
1442
|
+
}
|
1443
|
+
|
1444
|
+
height -= range.y;
|
1445
|
+
top += range.y;
|
1446
|
+
width = height * aspectRatio;
|
1447
|
+
left += range.X;
|
1448
|
+
} else {
|
1449
|
+
if (range.x <= 0) {
|
1450
|
+
if (left > minLeft) {
|
1451
|
+
width -= range.x;
|
1452
|
+
left += range.x;
|
1453
|
+
} else if (range.y <= 0 && top <= minTop) {
|
1454
|
+
renderable = false;
|
1455
|
+
}
|
1456
|
+
} else {
|
1457
|
+
width -= range.x;
|
1458
|
+
left += range.x;
|
1459
|
+
}
|
1460
|
+
|
1461
|
+
if (range.y <= 0) {
|
1462
|
+
if (top > minTop) {
|
1463
|
+
height -= range.y;
|
1464
|
+
top += range.y;
|
1465
|
+
}
|
1466
|
+
} else {
|
1467
|
+
height -= range.y;
|
1468
|
+
top += range.y;
|
1469
|
+
}
|
1470
|
+
}
|
1471
|
+
|
1472
|
+
if (width < 0 && height < 0) {
|
1473
|
+
action = ACTION_SOUTH_EAST;
|
1474
|
+
height = 0;
|
1475
|
+
width = 0;
|
1476
|
+
} else if (width < 0) {
|
1477
|
+
action = ACTION_NORTH_EAST;
|
1478
|
+
width = 0;
|
1479
|
+
} else if (height < 0) {
|
1480
|
+
action = ACTION_SOUTH_WEST;
|
1481
|
+
height = 0;
|
1482
|
+
}
|
1483
|
+
|
1484
|
+
break;
|
1485
|
+
|
1486
|
+
case ACTION_SOUTH_WEST:
|
1487
|
+
if (aspectRatio) {
|
1488
|
+
if (range.x <= 0 && (left <= minLeft || bottom >= maxHeight)) {
|
1489
|
+
renderable = false;
|
1490
|
+
break;
|
1491
|
+
}
|
1492
|
+
|
1493
|
+
width -= range.x;
|
1494
|
+
left += range.x;
|
1495
|
+
height = width / aspectRatio;
|
1496
|
+
} else {
|
1497
|
+
if (range.x <= 0) {
|
1498
|
+
if (left > minLeft) {
|
1499
|
+
width -= range.x;
|
1500
|
+
left += range.x;
|
1501
|
+
} else if (range.y >= 0 && bottom >= maxHeight) {
|
1502
|
+
renderable = false;
|
1503
|
+
}
|
1504
|
+
} else {
|
1505
|
+
width -= range.x;
|
1506
|
+
left += range.x;
|
1507
|
+
}
|
1508
|
+
|
1509
|
+
if (range.y >= 0) {
|
1510
|
+
if (bottom < maxHeight) {
|
1511
|
+
height += range.y;
|
1512
|
+
}
|
1513
|
+
} else {
|
1514
|
+
height += range.y;
|
1515
|
+
}
|
1516
|
+
}
|
1517
|
+
|
1518
|
+
if (width < 0 && height < 0) {
|
1519
|
+
action = ACTION_NORTH_EAST;
|
1520
|
+
height = 0;
|
1521
|
+
width = 0;
|
1522
|
+
} else if (width < 0) {
|
1523
|
+
action = ACTION_SOUTH_EAST;
|
1524
|
+
width = 0;
|
1525
|
+
} else if (height < 0) {
|
1526
|
+
action = ACTION_NORTH_WEST;
|
1527
|
+
height = 0;
|
1528
|
+
}
|
1529
|
+
|
1530
|
+
break;
|
1531
|
+
|
1532
|
+
case ACTION_SOUTH_EAST:
|
1533
|
+
if (aspectRatio) {
|
1534
|
+
if (range.x >= 0 && (right >= maxWidth || bottom >= maxHeight)) {
|
1535
|
+
renderable = false;
|
1536
|
+
break;
|
1537
|
+
}
|
1538
|
+
|
1539
|
+
width += range.x;
|
1540
|
+
height = width / aspectRatio;
|
1541
|
+
} else {
|
1542
|
+
if (range.x >= 0) {
|
1543
|
+
if (right < maxWidth) {
|
1544
|
+
width += range.x;
|
1545
|
+
} else if (range.y >= 0 && bottom >= maxHeight) {
|
1546
|
+
renderable = false;
|
1547
|
+
}
|
1548
|
+
} else {
|
1549
|
+
width += range.x;
|
1550
|
+
}
|
1551
|
+
|
1552
|
+
if (range.y >= 0) {
|
1553
|
+
if (bottom < maxHeight) {
|
1554
|
+
height += range.y;
|
1555
|
+
}
|
1556
|
+
} else {
|
1557
|
+
height += range.y;
|
1558
|
+
}
|
1559
|
+
}
|
1560
|
+
|
1561
|
+
if (width < 0 && height < 0) {
|
1562
|
+
action = ACTION_NORTH_WEST;
|
1563
|
+
height = 0;
|
1564
|
+
width = 0;
|
1565
|
+
} else if (width < 0) {
|
1566
|
+
action = ACTION_SOUTH_WEST;
|
1567
|
+
width = 0;
|
1568
|
+
} else if (height < 0) {
|
1569
|
+
action = ACTION_NORTH_EAST;
|
1570
|
+
height = 0;
|
1571
|
+
}
|
1572
|
+
|
1573
|
+
break;
|
1574
|
+
|
1575
|
+
// Move canvas
|
1576
|
+
case ACTION_MOVE:
|
1577
|
+
canvas.left += range.x;
|
1578
|
+
canvas.top += range.y;
|
1579
|
+
this.renderCanvas(true);
|
1580
|
+
renderable = false;
|
1581
|
+
break;
|
1582
|
+
|
1583
|
+
// Zoom canvas
|
1584
|
+
case ACTION_ZOOM:
|
1585
|
+
this.zoom((function (x1, y1, x2, y2) {
|
1586
|
+
var z1 = sqrt(x1 * x1 + y1 * y1);
|
1587
|
+
var z2 = sqrt(x2 * x2 + y2 * y2);
|
1588
|
+
|
1589
|
+
return (z2 - z1) / z1;
|
1590
|
+
})(
|
1591
|
+
abs(this.startX - this.startX2),
|
1592
|
+
abs(this.startY - this.startY2),
|
1593
|
+
abs(this.endX - this.endX2),
|
1594
|
+
abs(this.endY - this.endY2)
|
1595
|
+
), originalEvent);
|
1596
|
+
this.startX2 = this.endX2;
|
1597
|
+
this.startY2 = this.endY2;
|
1598
|
+
renderable = false;
|
1599
|
+
break;
|
1600
|
+
|
1601
|
+
// Create crop box
|
1602
|
+
case ACTION_CROP:
|
1603
|
+
if (range.x && range.y) {
|
1604
|
+
offset = this.$cropper.offset();
|
1605
|
+
left = this.startX - offset.left;
|
1606
|
+
top = this.startY - offset.top;
|
1607
|
+
width = cropBox.minWidth;
|
1608
|
+
height = cropBox.minHeight;
|
1609
|
+
|
1610
|
+
if (range.x > 0) {
|
1611
|
+
if (range.y > 0) {
|
1612
|
+
action = ACTION_SOUTH_EAST;
|
1613
|
+
} else {
|
1614
|
+
action = ACTION_NORTH_EAST;
|
1615
|
+
top -= height;
|
1616
|
+
}
|
1617
|
+
} else {
|
1618
|
+
if (range.y > 0) {
|
1619
|
+
action = ACTION_SOUTH_WEST;
|
1620
|
+
left -= width;
|
1621
|
+
} else {
|
1622
|
+
action = ACTION_NORTH_WEST;
|
1623
|
+
left -= width;
|
1624
|
+
top -= height;
|
1625
|
+
}
|
1626
|
+
}
|
1627
|
+
|
1628
|
+
// Show the crop box if is hidden
|
1629
|
+
if (!this.cropped) {
|
1630
|
+
this.cropped = true;
|
1631
|
+
this.$cropBox.removeClass(CLASS_HIDDEN);
|
1632
|
+
}
|
1633
|
+
}
|
1634
|
+
|
1635
|
+
break;
|
1636
|
+
|
1637
|
+
// No default
|
1638
|
+
}
|
1639
|
+
|
1640
|
+
if (renderable) {
|
1641
|
+
cropBox.width = width;
|
1642
|
+
cropBox.height = height;
|
1643
|
+
cropBox.left = left;
|
1644
|
+
cropBox.top = top;
|
1645
|
+
this.action = action;
|
1646
|
+
|
1647
|
+
this.renderCropBox();
|
1648
|
+
}
|
1649
|
+
|
1650
|
+
// Override
|
1651
|
+
this.startX = this.endX;
|
1652
|
+
this.startY = this.endY;
|
1653
|
+
}
|
1654
|
+
});
|
1655
|
+
|
1656
|
+
$.extend(prototype, {
|
1657
|
+
|
1658
|
+
// Show the crop box manually
|
1659
|
+
crop: function () {
|
1660
|
+
if (!this.built || this.disabled) {
|
1661
|
+
return;
|
1662
|
+
}
|
1663
|
+
|
1664
|
+
if (!this.cropped) {
|
1665
|
+
this.cropped = true;
|
1666
|
+
this.limitCropBox(true, true);
|
1667
|
+
|
1668
|
+
if (this.options.modal) {
|
1669
|
+
this.$dragBox.addClass(CLASS_MODAL);
|
1670
|
+
}
|
1671
|
+
|
1672
|
+
this.$cropBox.removeClass(CLASS_HIDDEN);
|
1673
|
+
}
|
1674
|
+
|
1675
|
+
this.setCropBoxData(this.initialCropBox);
|
1676
|
+
},
|
1677
|
+
|
1678
|
+
// Reset the image and crop box to their initial states
|
1679
|
+
reset: function () {
|
1680
|
+
if (!this.built || this.disabled) {
|
1681
|
+
return;
|
1682
|
+
}
|
1683
|
+
|
1684
|
+
this.image = $.extend({}, this.initialImage);
|
1685
|
+
this.canvas = $.extend({}, this.initialCanvas);
|
1686
|
+
|
1687
|
+
// Required for strict mode
|
1688
|
+
this.cropBox = $.extend({}, this.initialCropBox);
|
1689
|
+
|
1690
|
+
this.renderCanvas();
|
1691
|
+
|
1692
|
+
if (this.cropped) {
|
1693
|
+
this.renderCropBox();
|
1694
|
+
}
|
1695
|
+
},
|
1696
|
+
|
1697
|
+
// Clear the crop box
|
1698
|
+
clear: function () {
|
1699
|
+
if (!this.cropped || this.disabled) {
|
1700
|
+
return;
|
1701
|
+
}
|
1702
|
+
|
1703
|
+
$.extend(this.cropBox, {
|
1704
|
+
left: 0,
|
1705
|
+
top: 0,
|
1706
|
+
width: 0,
|
1707
|
+
height: 0
|
1708
|
+
});
|
1709
|
+
|
1710
|
+
this.cropped = false;
|
1711
|
+
this.renderCropBox();
|
1712
|
+
|
1713
|
+
this.limitCanvas();
|
1714
|
+
|
1715
|
+
// Render canvas after crop box rendered
|
1716
|
+
this.renderCanvas();
|
1717
|
+
|
1718
|
+
this.$dragBox.removeClass(CLASS_MODAL);
|
1719
|
+
this.$cropBox.addClass(CLASS_HIDDEN);
|
1720
|
+
},
|
1721
|
+
|
1722
|
+
/**
|
1723
|
+
* Replace the image's src and rebuild the cropper
|
1724
|
+
*
|
1725
|
+
* @param {String} url
|
1726
|
+
*/
|
1727
|
+
replace: function (url) {
|
1728
|
+
if (!this.disabled && url) {
|
1729
|
+
if (this.isImg) {
|
1730
|
+
this.$element.attr('src', url);
|
1731
|
+
}
|
1732
|
+
|
1733
|
+
// Clear previous data
|
1734
|
+
this.options.data = null;
|
1735
|
+
this.load(url);
|
1736
|
+
}
|
1737
|
+
},
|
1738
|
+
|
1739
|
+
// Enable (unfreeze) the cropper
|
1740
|
+
enable: function () {
|
1741
|
+
if (this.built) {
|
1742
|
+
this.disabled = false;
|
1743
|
+
this.$cropper.removeClass(CLASS_DISABLED);
|
1744
|
+
}
|
1745
|
+
},
|
1746
|
+
|
1747
|
+
// Disable (freeze) the cropper
|
1748
|
+
disable: function () {
|
1749
|
+
if (this.built) {
|
1750
|
+
this.disabled = true;
|
1751
|
+
this.$cropper.addClass(CLASS_DISABLED);
|
1752
|
+
}
|
1753
|
+
},
|
1754
|
+
|
1755
|
+
// Destroy the cropper and remove the instance from the image
|
1756
|
+
destroy: function () {
|
1757
|
+
var $this = this.$element;
|
1758
|
+
|
1759
|
+
if (this.ready) {
|
1760
|
+
if (this.isImg) {
|
1761
|
+
$this.attr('src', this.originalUrl);
|
1762
|
+
}
|
1763
|
+
|
1764
|
+
this.unbuild();
|
1765
|
+
$this.removeClass(CLASS_HIDDEN);
|
1766
|
+
} else {
|
1767
|
+
if (this.isImg) {
|
1768
|
+
$this.off(EVENT_LOAD, this.start);
|
1769
|
+
} else if (this.$clone) {
|
1770
|
+
this.$clone.remove();
|
1771
|
+
}
|
1772
|
+
}
|
1773
|
+
|
1774
|
+
$this.removeData(NAMESPACE);
|
1775
|
+
},
|
1776
|
+
|
1777
|
+
/**
|
1778
|
+
* Move the canvas
|
1779
|
+
*
|
1780
|
+
* @param {Number} offsetX
|
1781
|
+
* @param {Number} offsetY (optional)
|
1782
|
+
*/
|
1783
|
+
move: function (offsetX, offsetY) {
|
1784
|
+
var canvas = this.canvas;
|
1785
|
+
|
1786
|
+
// If "offsetY" is not present, its default value is "offsetX"
|
1787
|
+
if (isUndefined(offsetY)) {
|
1788
|
+
offsetY = offsetX;
|
1789
|
+
}
|
1790
|
+
|
1791
|
+
offsetX = num(offsetX);
|
1792
|
+
offsetY = num(offsetY);
|
1793
|
+
|
1794
|
+
if (this.built && !this.disabled && this.options.movable) {
|
1795
|
+
canvas.left += isNumber(offsetX) ? offsetX : 0;
|
1796
|
+
canvas.top += isNumber(offsetY) ? offsetY : 0;
|
1797
|
+
this.renderCanvas(true);
|
1798
|
+
}
|
1799
|
+
},
|
1800
|
+
|
1801
|
+
/**
|
1802
|
+
* Zoom the canvas
|
1803
|
+
*
|
1804
|
+
* @param {Number} ratio
|
1805
|
+
* @param {Event} _originalEvent (private)
|
1806
|
+
*/
|
1807
|
+
zoom: function (ratio, _originalEvent) {
|
1808
|
+
var canvas = this.canvas;
|
1809
|
+
var width;
|
1810
|
+
var height;
|
1811
|
+
|
1812
|
+
ratio = num(ratio);
|
1813
|
+
|
1814
|
+
if (ratio && this.built && !this.disabled && this.options.zoomable) {
|
1815
|
+
if (this.trigger(EVENT_ZOOM, {
|
1816
|
+
originalEvent: _originalEvent,
|
1817
|
+
ratio: ratio
|
1818
|
+
})) {
|
1819
|
+
return;
|
1820
|
+
}
|
1821
|
+
|
1822
|
+
if (ratio < 0) {
|
1823
|
+
ratio = 1 / (1 - ratio);
|
1824
|
+
} else {
|
1825
|
+
ratio = 1 + ratio;
|
1826
|
+
}
|
1827
|
+
|
1828
|
+
width = canvas.width * ratio;
|
1829
|
+
height = canvas.height * ratio;
|
1830
|
+
canvas.left -= (width - canvas.width) / 2;
|
1831
|
+
canvas.top -= (height - canvas.height) / 2;
|
1832
|
+
canvas.width = width;
|
1833
|
+
canvas.height = height;
|
1834
|
+
this.renderCanvas(true);
|
1835
|
+
this.setDragMode(ACTION_MOVE);
|
1836
|
+
}
|
1837
|
+
},
|
1838
|
+
|
1839
|
+
/**
|
1840
|
+
* Rotate the canvas
|
1841
|
+
* https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function#rotate()
|
1842
|
+
*
|
1843
|
+
* @param {Number} degree
|
1844
|
+
*/
|
1845
|
+
rotate: function (degree) {
|
1846
|
+
var image = this.image;
|
1847
|
+
var rotate = image.rotate || 0;
|
1848
|
+
|
1849
|
+
degree = num(degree) || 0;
|
1850
|
+
|
1851
|
+
if (this.built && !this.disabled && this.options.rotatable) {
|
1852
|
+
image.rotate = (rotate + degree) % 360;
|
1853
|
+
this.rotated = true;
|
1854
|
+
this.renderCanvas(true);
|
1855
|
+
}
|
1856
|
+
},
|
1857
|
+
|
1858
|
+
/**
|
1859
|
+
* Scale the image
|
1860
|
+
* https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function#scale()
|
1861
|
+
*
|
1862
|
+
* @param {Number} scaleX
|
1863
|
+
* @param {Number} scaleY (optional)
|
1864
|
+
*/
|
1865
|
+
scale: function (scaleX, scaleY) {
|
1866
|
+
var image = this.image;
|
1867
|
+
|
1868
|
+
// If "scaleY" is not present, its default value is "scaleX"
|
1869
|
+
if (isUndefined(scaleY)) {
|
1870
|
+
scaleY = scaleX;
|
1871
|
+
}
|
1872
|
+
|
1873
|
+
scaleX = num(scaleX);
|
1874
|
+
scaleY = num(scaleY);
|
1875
|
+
|
1876
|
+
if (this.built && !this.disabled && this.options.scalable) {
|
1877
|
+
image.scaleX = isNumber(scaleX) ? scaleX : 1;
|
1878
|
+
image.scaleY = isNumber(scaleY) ? scaleY : 1;
|
1879
|
+
this.renderImage(true);
|
1880
|
+
}
|
1881
|
+
},
|
1882
|
+
|
1883
|
+
/**
|
1884
|
+
* Get the cropped area position and size data (base on the original image)
|
1885
|
+
*
|
1886
|
+
* @param {Boolean} rounded (optional)
|
1887
|
+
* @return {Object} data
|
1888
|
+
*/
|
1889
|
+
getData: function (rounded) {
|
1890
|
+
var options = this.options;
|
1891
|
+
var image = this.image;
|
1892
|
+
var canvas = this.canvas;
|
1893
|
+
var cropBox = this.cropBox;
|
1894
|
+
var ratio;
|
1895
|
+
var data;
|
1896
|
+
|
1897
|
+
if (this.built && this.cropped) {
|
1898
|
+
data = {
|
1899
|
+
x: cropBox.left - canvas.left,
|
1900
|
+
y: cropBox.top - canvas.top,
|
1901
|
+
width: cropBox.width,
|
1902
|
+
height: cropBox.height
|
1903
|
+
};
|
1904
|
+
|
1905
|
+
ratio = image.width / image.naturalWidth;
|
1906
|
+
|
1907
|
+
$.each(data, function (i, n) {
|
1908
|
+
n = n / ratio;
|
1909
|
+
data[i] = rounded ? Math.round(n) : n;
|
1910
|
+
});
|
1911
|
+
|
1912
|
+
} else {
|
1913
|
+
data = {
|
1914
|
+
x: 0,
|
1915
|
+
y: 0,
|
1916
|
+
width: 0,
|
1917
|
+
height: 0
|
1918
|
+
};
|
1919
|
+
}
|
1920
|
+
|
1921
|
+
if (options.rotatable) {
|
1922
|
+
data.rotate = image.rotate || 0;
|
1923
|
+
}
|
1924
|
+
|
1925
|
+
if (options.scalable) {
|
1926
|
+
data.scaleX = image.scaleX || 1;
|
1927
|
+
data.scaleY = image.scaleY || 1;
|
1928
|
+
}
|
1929
|
+
|
1930
|
+
return data;
|
1931
|
+
},
|
1932
|
+
|
1933
|
+
/**
|
1934
|
+
* Set the cropped area position and size with new data
|
1935
|
+
*
|
1936
|
+
* @param {Object} data
|
1937
|
+
*/
|
1938
|
+
setData: function (data) {
|
1939
|
+
var image = this.image;
|
1940
|
+
var canvas = this.canvas;
|
1941
|
+
var cropBoxData = {};
|
1942
|
+
var ratio;
|
1943
|
+
|
1944
|
+
if ($.isFunction(data)) {
|
1945
|
+
data = data.call(this.$element);
|
1946
|
+
}
|
1947
|
+
|
1948
|
+
if (this.built && !this.disabled && $.isPlainObject(data)) {
|
1949
|
+
if (isNumber(data.rotate) && data.rotate !== image.rotate &&
|
1950
|
+
this.options.rotatable) {
|
1951
|
+
|
1952
|
+
image.rotate = data.rotate;
|
1953
|
+
this.rotated = true;
|
1954
|
+
this.renderCanvas(true);
|
1955
|
+
}
|
1956
|
+
|
1957
|
+
ratio = image.width / image.naturalWidth;
|
1958
|
+
|
1959
|
+
if (isNumber(data.x)) {
|
1960
|
+
cropBoxData.left = data.x * ratio + canvas.left;
|
1961
|
+
}
|
1962
|
+
|
1963
|
+
if (isNumber(data.y)) {
|
1964
|
+
cropBoxData.top = data.y * ratio + canvas.top;
|
1965
|
+
}
|
1966
|
+
|
1967
|
+
if (isNumber(data.width)) {
|
1968
|
+
cropBoxData.width = data.width * ratio;
|
1969
|
+
}
|
1970
|
+
|
1971
|
+
if (isNumber(data.height)) {
|
1972
|
+
cropBoxData.height = data.height * ratio;
|
1973
|
+
}
|
1974
|
+
|
1975
|
+
this.setCropBoxData(cropBoxData);
|
1976
|
+
}
|
1977
|
+
},
|
1978
|
+
|
1979
|
+
/**
|
1980
|
+
* Get the container size data
|
1981
|
+
*
|
1982
|
+
* @return {Object} data
|
1983
|
+
*/
|
1984
|
+
getContainerData: function () {
|
1985
|
+
return this.built ? this.container : {};
|
1986
|
+
},
|
1987
|
+
|
1988
|
+
/**
|
1989
|
+
* Get the image position and size data
|
1990
|
+
*
|
1991
|
+
* @return {Object} data
|
1992
|
+
*/
|
1993
|
+
getImageData: function () {
|
1994
|
+
return this.ready ? this.image : {};
|
1995
|
+
},
|
1996
|
+
|
1997
|
+
/**
|
1998
|
+
* Get the canvas position and size data
|
1999
|
+
*
|
2000
|
+
* @return {Object} data
|
2001
|
+
*/
|
2002
|
+
getCanvasData: function () {
|
2003
|
+
var canvas = this.canvas;
|
2004
|
+
var data;
|
2005
|
+
|
2006
|
+
if (this.built) {
|
2007
|
+
data = {
|
2008
|
+
left: canvas.left,
|
2009
|
+
top: canvas.top,
|
2010
|
+
width: canvas.width,
|
2011
|
+
height: canvas.height
|
2012
|
+
};
|
2013
|
+
}
|
2014
|
+
|
2015
|
+
return data || {};
|
2016
|
+
},
|
2017
|
+
|
2018
|
+
/**
|
2019
|
+
* Set the canvas position and size with new data
|
2020
|
+
*
|
2021
|
+
* @param {Object} data
|
2022
|
+
*/
|
2023
|
+
setCanvasData: function (data) {
|
2024
|
+
var canvas = this.canvas;
|
2025
|
+
var aspectRatio = canvas.aspectRatio;
|
2026
|
+
|
2027
|
+
if ($.isFunction(data)) {
|
2028
|
+
data = data.call(this.$element);
|
2029
|
+
}
|
2030
|
+
|
2031
|
+
if (this.built && !this.disabled && $.isPlainObject(data)) {
|
2032
|
+
if (isNumber(data.left)) {
|
2033
|
+
canvas.left = data.left;
|
2034
|
+
}
|
2035
|
+
|
2036
|
+
if (isNumber(data.top)) {
|
2037
|
+
canvas.top = data.top;
|
2038
|
+
}
|
2039
|
+
|
2040
|
+
if (isNumber(data.width)) {
|
2041
|
+
canvas.width = data.width;
|
2042
|
+
canvas.height = data.width / aspectRatio;
|
2043
|
+
} else if (isNumber(data.height)) {
|
2044
|
+
canvas.height = data.height;
|
2045
|
+
canvas.width = data.height * aspectRatio;
|
2046
|
+
}
|
2047
|
+
|
2048
|
+
this.renderCanvas(true);
|
2049
|
+
}
|
2050
|
+
},
|
2051
|
+
|
2052
|
+
/**
|
2053
|
+
* Get the crop box position and size data
|
2054
|
+
*
|
2055
|
+
* @return {Object} data
|
2056
|
+
*/
|
2057
|
+
getCropBoxData: function () {
|
2058
|
+
var cropBox = this.cropBox;
|
2059
|
+
var data;
|
2060
|
+
|
2061
|
+
if (this.built && this.cropped) {
|
2062
|
+
data = {
|
2063
|
+
left: cropBox.left,
|
2064
|
+
top: cropBox.top,
|
2065
|
+
width: cropBox.width,
|
2066
|
+
height: cropBox.height
|
2067
|
+
};
|
2068
|
+
}
|
2069
|
+
|
2070
|
+
return data || {};
|
2071
|
+
},
|
2072
|
+
|
2073
|
+
/**
|
2074
|
+
* Set the crop box position and size with new data
|
2075
|
+
*
|
2076
|
+
* @param {Object} data
|
2077
|
+
*/
|
2078
|
+
setCropBoxData: function (data) {
|
2079
|
+
var cropBox = this.cropBox;
|
2080
|
+
var aspectRatio = this.options.aspectRatio;
|
2081
|
+
var widthChanged;
|
2082
|
+
var heightChanged;
|
2083
|
+
|
2084
|
+
if ($.isFunction(data)) {
|
2085
|
+
data = data.call(this.$element);
|
2086
|
+
}
|
2087
|
+
|
2088
|
+
if (this.built && this.cropped && !this.disabled && $.isPlainObject(data)) {
|
2089
|
+
|
2090
|
+
if (isNumber(data.left)) {
|
2091
|
+
cropBox.left = data.left;
|
2092
|
+
}
|
2093
|
+
|
2094
|
+
if (isNumber(data.top)) {
|
2095
|
+
cropBox.top = data.top;
|
2096
|
+
}
|
2097
|
+
|
2098
|
+
if (isNumber(data.width) && data.width !== cropBox.width) {
|
2099
|
+
widthChanged = true;
|
2100
|
+
cropBox.width = data.width;
|
2101
|
+
}
|
2102
|
+
|
2103
|
+
if (isNumber(data.height) && data.height !== cropBox.height) {
|
2104
|
+
heightChanged = true;
|
2105
|
+
cropBox.height = data.height;
|
2106
|
+
}
|
2107
|
+
|
2108
|
+
if (aspectRatio) {
|
2109
|
+
if (widthChanged) {
|
2110
|
+
cropBox.height = cropBox.width / aspectRatio;
|
2111
|
+
} else if (heightChanged) {
|
2112
|
+
cropBox.width = cropBox.height * aspectRatio;
|
2113
|
+
}
|
2114
|
+
}
|
2115
|
+
|
2116
|
+
this.renderCropBox();
|
2117
|
+
}
|
2118
|
+
},
|
2119
|
+
|
2120
|
+
/**
|
2121
|
+
* Get a canvas drawn the cropped image
|
2122
|
+
*
|
2123
|
+
* @param {Object} options (optional)
|
2124
|
+
* @return {HTMLCanvasElement} canvas
|
2125
|
+
*/
|
2126
|
+
getCroppedCanvas: function (options) {
|
2127
|
+
var originalWidth;
|
2128
|
+
var originalHeight;
|
2129
|
+
var canvasWidth;
|
2130
|
+
var canvasHeight;
|
2131
|
+
var scaledWidth;
|
2132
|
+
var scaledHeight;
|
2133
|
+
var scaledRatio;
|
2134
|
+
var aspectRatio;
|
2135
|
+
var canvas;
|
2136
|
+
var context;
|
2137
|
+
var data;
|
2138
|
+
|
2139
|
+
if (!this.built || !this.cropped || !SUPPORT_CANVAS) {
|
2140
|
+
return;
|
2141
|
+
}
|
2142
|
+
|
2143
|
+
if (!$.isPlainObject(options)) {
|
2144
|
+
options = {};
|
2145
|
+
}
|
2146
|
+
|
2147
|
+
data = this.getData();
|
2148
|
+
originalWidth = data.width;
|
2149
|
+
originalHeight = data.height;
|
2150
|
+
aspectRatio = originalWidth / originalHeight;
|
2151
|
+
|
2152
|
+
if ($.isPlainObject(options)) {
|
2153
|
+
scaledWidth = options.width;
|
2154
|
+
scaledHeight = options.height;
|
2155
|
+
|
2156
|
+
if (scaledWidth) {
|
2157
|
+
scaledHeight = scaledWidth / aspectRatio;
|
2158
|
+
scaledRatio = scaledWidth / originalWidth;
|
2159
|
+
} else if (scaledHeight) {
|
2160
|
+
scaledWidth = scaledHeight * aspectRatio;
|
2161
|
+
scaledRatio = scaledHeight / originalHeight;
|
2162
|
+
}
|
2163
|
+
}
|
2164
|
+
|
2165
|
+
canvasWidth = scaledWidth || originalWidth;
|
2166
|
+
canvasHeight = scaledHeight || originalHeight;
|
2167
|
+
|
2168
|
+
canvas = $('<canvas>')[0];
|
2169
|
+
canvas.width = canvasWidth;
|
2170
|
+
canvas.height = canvasHeight;
|
2171
|
+
context = canvas.getContext('2d');
|
2172
|
+
|
2173
|
+
if (options.fillColor) {
|
2174
|
+
context.fillStyle = options.fillColor;
|
2175
|
+
context.fillRect(0, 0, canvasWidth, canvasHeight);
|
2176
|
+
}
|
2177
|
+
|
2178
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D.drawImage
|
2179
|
+
context.drawImage.apply(context, (function () {
|
2180
|
+
var source = getSourceCanvas(this.$clone[0], this.image);
|
2181
|
+
var sourceWidth = source.width;
|
2182
|
+
var sourceHeight = source.height;
|
2183
|
+
var args = [source];
|
2184
|
+
|
2185
|
+
// Source canvas
|
2186
|
+
var srcX = data.x;
|
2187
|
+
var srcY = data.y;
|
2188
|
+
var srcWidth;
|
2189
|
+
var srcHeight;
|
2190
|
+
|
2191
|
+
// Destination canvas
|
2192
|
+
var dstX;
|
2193
|
+
var dstY;
|
2194
|
+
var dstWidth;
|
2195
|
+
var dstHeight;
|
2196
|
+
|
2197
|
+
if (srcX <= -originalWidth || srcX > sourceWidth) {
|
2198
|
+
srcX = srcWidth = dstX = dstWidth = 0;
|
2199
|
+
} else if (srcX <= 0) {
|
2200
|
+
dstX = -srcX;
|
2201
|
+
srcX = 0;
|
2202
|
+
srcWidth = dstWidth = min(sourceWidth, originalWidth + srcX);
|
2203
|
+
} else if (srcX <= sourceWidth) {
|
2204
|
+
dstX = 0;
|
2205
|
+
srcWidth = dstWidth = min(originalWidth, sourceWidth - srcX);
|
2206
|
+
}
|
2207
|
+
|
2208
|
+
if (srcWidth <= 0 || srcY <= -originalHeight || srcY > sourceHeight) {
|
2209
|
+
srcY = srcHeight = dstY = dstHeight = 0;
|
2210
|
+
} else if (srcY <= 0) {
|
2211
|
+
dstY = -srcY;
|
2212
|
+
srcY = 0;
|
2213
|
+
srcHeight = dstHeight = min(sourceHeight, originalHeight + srcY);
|
2214
|
+
} else if (srcY <= sourceHeight) {
|
2215
|
+
dstY = 0;
|
2216
|
+
srcHeight = dstHeight = min(originalHeight, sourceHeight - srcY);
|
2217
|
+
}
|
2218
|
+
|
2219
|
+
args.push(srcX, srcY, srcWidth, srcHeight);
|
2220
|
+
|
2221
|
+
// Scale destination sizes
|
2222
|
+
if (scaledRatio) {
|
2223
|
+
dstX *= scaledRatio;
|
2224
|
+
dstY *= scaledRatio;
|
2225
|
+
dstWidth *= scaledRatio;
|
2226
|
+
dstHeight *= scaledRatio;
|
2227
|
+
}
|
2228
|
+
|
2229
|
+
// Avoid "IndexSizeError" in IE and Firefox
|
2230
|
+
if (dstWidth > 0 && dstHeight > 0) {
|
2231
|
+
args.push(dstX, dstY, dstWidth, dstHeight);
|
2232
|
+
}
|
2233
|
+
|
2234
|
+
return args;
|
2235
|
+
}).call(this));
|
2236
|
+
|
2237
|
+
return canvas;
|
2238
|
+
},
|
2239
|
+
|
2240
|
+
/**
|
2241
|
+
* Change the aspect ratio of the crop box
|
2242
|
+
*
|
2243
|
+
* @param {Number} aspectRatio
|
2244
|
+
*/
|
2245
|
+
setAspectRatio: function (aspectRatio) {
|
2246
|
+
var options = this.options;
|
2247
|
+
|
2248
|
+
if (!this.disabled && !isUndefined(aspectRatio)) {
|
2249
|
+
|
2250
|
+
// 0 -> NaN
|
2251
|
+
options.aspectRatio = num(aspectRatio) || NaN;
|
2252
|
+
|
2253
|
+
if (this.built) {
|
2254
|
+
this.initCropBox();
|
2255
|
+
|
2256
|
+
if (this.cropped) {
|
2257
|
+
this.renderCropBox();
|
2258
|
+
}
|
2259
|
+
}
|
2260
|
+
}
|
2261
|
+
},
|
2262
|
+
|
2263
|
+
/**
|
2264
|
+
* Change the drag mode
|
2265
|
+
*
|
2266
|
+
* @param {String} mode (optional)
|
2267
|
+
*/
|
2268
|
+
setDragMode: function (mode) {
|
2269
|
+
var options = this.options;
|
2270
|
+
var croppable;
|
2271
|
+
var movable;
|
2272
|
+
|
2273
|
+
if (this.ready && !this.disabled) {
|
2274
|
+
croppable = options.dragCrop && mode === ACTION_CROP;
|
2275
|
+
movable = options.movable && mode === ACTION_MOVE;
|
2276
|
+
mode = (croppable || movable) ? mode : ACTION_NONE;
|
2277
|
+
|
2278
|
+
this.$dragBox.
|
2279
|
+
data('action', mode).
|
2280
|
+
toggleClass(CLASS_CROP, croppable).
|
2281
|
+
toggleClass(CLASS_MOVE, movable);
|
2282
|
+
|
2283
|
+
if (!options.cropBoxMovable) {
|
2284
|
+
|
2285
|
+
// Sync drag mode to crop box when it is not movable(#300)
|
2286
|
+
this.$face.
|
2287
|
+
data('action', mode).
|
2288
|
+
toggleClass(CLASS_CROP, croppable).
|
2289
|
+
toggleClass(CLASS_MOVE, movable);
|
2290
|
+
}
|
2291
|
+
}
|
2292
|
+
}
|
2293
|
+
});
|
2294
|
+
|
2295
|
+
$.extend(Cropper.prototype, prototype);
|
2296
|
+
|
2297
|
+
Cropper.DEFAULTS = {
|
2298
|
+
|
2299
|
+
// Define the aspect ratio of the crop box
|
2300
|
+
aspectRatio: NaN,
|
2301
|
+
|
2302
|
+
// An object with the previous cropping result data
|
2303
|
+
data: null,
|
2304
|
+
|
2305
|
+
// A jQuery selector for adding extra containers to preview
|
2306
|
+
preview: '',
|
2307
|
+
|
2308
|
+
// Strict mode, the image cannot zoom out less than the container
|
2309
|
+
strict: true,
|
2310
|
+
|
2311
|
+
// Rebuild when resize the window
|
2312
|
+
responsive: true,
|
2313
|
+
|
2314
|
+
// Check if the target image is cross origin
|
2315
|
+
checkImageOrigin: true,
|
2316
|
+
|
2317
|
+
// Show the black modal
|
2318
|
+
modal: true,
|
2319
|
+
|
2320
|
+
// Show the dashed lines for guiding
|
2321
|
+
guides: true,
|
2322
|
+
|
2323
|
+
// Show the center indicator for guiding
|
2324
|
+
center: true,
|
2325
|
+
|
2326
|
+
// Show the white modal to highlight the crop box
|
2327
|
+
highlight: true,
|
2328
|
+
|
2329
|
+
// Show the grid background
|
2330
|
+
background: true,
|
2331
|
+
|
2332
|
+
// Enable to crop the image automatically when initialize
|
2333
|
+
autoCrop: true,
|
2334
|
+
|
2335
|
+
// Define the percentage of automatic cropping area when initializes
|
2336
|
+
autoCropArea: 0.8,
|
2337
|
+
|
2338
|
+
// Enable to create new crop box by dragging over the image
|
2339
|
+
dragCrop: true,
|
2340
|
+
|
2341
|
+
// Enable to move the image
|
2342
|
+
movable: true,
|
2343
|
+
|
2344
|
+
// Enable to rotate the image
|
2345
|
+
rotatable: true,
|
2346
|
+
|
2347
|
+
// Enable to scale the image
|
2348
|
+
scalable: true,
|
2349
|
+
|
2350
|
+
// Enable to zoom the image
|
2351
|
+
zoomable: true,
|
2352
|
+
|
2353
|
+
// Enable to zoom the image by wheeling mouse
|
2354
|
+
mouseWheelZoom: true,
|
2355
|
+
|
2356
|
+
// Define zoom ratio when zoom the image by wheeling mouse
|
2357
|
+
wheelZoomRatio: 0.1,
|
2358
|
+
|
2359
|
+
// Enable to zoom the image by dragging touch
|
2360
|
+
touchDragZoom: true,
|
2361
|
+
|
2362
|
+
// Enable to move the crop box
|
2363
|
+
cropBoxMovable: true,
|
2364
|
+
|
2365
|
+
// Enable to resize the crop box
|
2366
|
+
cropBoxResizable: true,
|
2367
|
+
|
2368
|
+
// Toggle drag mode between "crop" and "move" when double click on the cropper
|
2369
|
+
doubleClickToggle: true,
|
2370
|
+
|
2371
|
+
// Size limitation
|
2372
|
+
minCanvasWidth: 0,
|
2373
|
+
minCanvasHeight: 0,
|
2374
|
+
minCropBoxWidth: 0,
|
2375
|
+
minCropBoxHeight: 0,
|
2376
|
+
minContainerWidth: 200,
|
2377
|
+
minContainerHeight: 100,
|
2378
|
+
|
2379
|
+
// Shortcuts of events
|
2380
|
+
build: null,
|
2381
|
+
built: null,
|
2382
|
+
cropstart: null,
|
2383
|
+
cropmove: null,
|
2384
|
+
cropend: null,
|
2385
|
+
crop: null,
|
2386
|
+
zoom: null
|
2387
|
+
};
|
2388
|
+
|
2389
|
+
Cropper.setDefaults = function (options) {
|
2390
|
+
$.extend(Cropper.DEFAULTS, options);
|
2391
|
+
};
|
2392
|
+
|
2393
|
+
Cropper.TEMPLATE = (
|
2394
|
+
'<div class="cropper-container">' +
|
2395
|
+
'<div class="cropper-canvas"></div>' +
|
2396
|
+
'<div class="cropper-drag-box"></div>' +
|
2397
|
+
'<div class="cropper-crop-box">' +
|
2398
|
+
'<span class="cropper-view-box"></span>' +
|
2399
|
+
'<span class="cropper-dashed dashed-h"></span>' +
|
2400
|
+
'<span class="cropper-dashed dashed-v"></span>' +
|
2401
|
+
'<span class="cropper-center"></span>' +
|
2402
|
+
'<span class="cropper-face"></span>' +
|
2403
|
+
'<span class="cropper-line line-e" data-action="e"></span>' +
|
2404
|
+
'<span class="cropper-line line-n" data-action="n"></span>' +
|
2405
|
+
'<span class="cropper-line line-w" data-action="w"></span>' +
|
2406
|
+
'<span class="cropper-line line-s" data-action="s"></span>' +
|
2407
|
+
'<span class="cropper-point point-e" data-action="e"></span>' +
|
2408
|
+
'<span class="cropper-point point-n" data-action="n"></span>' +
|
2409
|
+
'<span class="cropper-point point-w" data-action="w"></span>' +
|
2410
|
+
'<span class="cropper-point point-s" data-action="s"></span>' +
|
2411
|
+
'<span class="cropper-point point-ne" data-action="ne"></span>' +
|
2412
|
+
'<span class="cropper-point point-nw" data-action="nw"></span>' +
|
2413
|
+
'<span class="cropper-point point-sw" data-action="sw"></span>' +
|
2414
|
+
'<span class="cropper-point point-se" data-action="se"></span>' +
|
2415
|
+
'</div>' +
|
2416
|
+
'</div>'
|
2417
|
+
);
|
2418
|
+
|
2419
|
+
// Save the other cropper
|
2420
|
+
Cropper.other = $.fn.cropper;
|
2421
|
+
|
2422
|
+
// Register as jQuery plugin
|
2423
|
+
$.fn.cropper = function (options) {
|
2424
|
+
var args = toArray(arguments, 1);
|
2425
|
+
var result;
|
2426
|
+
|
2427
|
+
this.each(function () {
|
2428
|
+
var $this = $(this);
|
2429
|
+
var data = $this.data(NAMESPACE);
|
2430
|
+
var fn;
|
2431
|
+
|
2432
|
+
if (!data) {
|
2433
|
+
if (/destroy/.test(options)) {
|
2434
|
+
return;
|
2435
|
+
}
|
2436
|
+
|
2437
|
+
$this.data(NAMESPACE, (data = new Cropper(this, options)));
|
2438
|
+
}
|
2439
|
+
|
2440
|
+
if (typeof options === 'string' && $.isFunction(fn = data[options])) {
|
2441
|
+
result = fn.apply(data, args);
|
2442
|
+
}
|
2443
|
+
});
|
2444
|
+
|
2445
|
+
return isUndefined(result) ? this : result;
|
2446
|
+
};
|
2447
|
+
|
2448
|
+
$.fn.cropper.Constructor = Cropper;
|
2449
|
+
$.fn.cropper.setDefaults = Cropper.setDefaults;
|
2450
|
+
|
2451
|
+
// No conflict
|
2452
|
+
$.fn.cropper.noConflict = function () {
|
2453
|
+
$.fn.cropper = Cropper.other;
|
2454
|
+
return this;
|
2455
|
+
};
|
2456
|
+
|
2457
|
+
});
|