mosaico 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +8 -0
- data/Gemfile +7 -0
- data/LICENSE +680 -0
- data/README.md +179 -0
- data/Rakefile +5 -0
- data/app/assets/images/mosaico/logo_transparent.png +0 -0
- data/app/assets/javascripts/mosaico/application.js.erb +51 -0
- data/app/assets/javascripts/mosaico/plugins/debug.js.erb +10 -0
- data/app/assets/javascripts/mosaico/plugins/logo.js.erb +10 -0
- data/app/assets/javascripts/mosaico/plugins/preview.js +85 -0
- data/app/assets/javascripts/mosaico/plugins/save.js.erb +72 -0
- data/app/assets/javascripts/mosaico/plugins/template_path.js.erb +22 -0
- data/app/assets/javascripts/mosaico/plugins/translations.js +10 -0
- data/app/assets/javascripts/mosaico/utilities.js +25 -0
- data/app/assets/stylesheets/mosaico/application.css +6 -0
- data/app/controllers/mosaico/application_controller.rb +17 -0
- data/app/controllers/mosaico/images_controller.rb +142 -0
- data/app/controllers/mosaico/projects_controller.rb +31 -0
- data/app/controllers/mosaico/templates_controller.rb +8 -0
- data/app/helpers/mosaico/application_helper.rb +7 -0
- data/app/models/mosaico/image.rb +9 -0
- data/app/models/mosaico/placeholder_image.rb +9 -0
- data/app/models/mosaico/project.rb +13 -0
- data/app/models/mosaico/uploaded_image.rb +26 -0
- data/app/views/layouts/mosaico/application.html.erb +13 -0
- data/app/views/mosaico/projects/new.html.erb +1 -0
- data/app/views/mosaico/projects/show.html.erb +1 -0
- data/app/views/mosaico/shared/_metadata.html.erb +12 -0
- data/config/routes.rb +12 -0
- data/db/migrate/20170817202255_add_images.rb +14 -0
- data/db/migrate/20170824233755_add_projects.rb +11 -0
- data/lib/mosaico.rb +100 -0
- data/lib/mosaico/engine.rb +72 -0
- data/lib/mosaico/local_backend.rb +23 -0
- data/lib/mosaico/local_image_backend.rb +7 -0
- data/lib/mosaico/local_placeholder_backend.rb +7 -0
- data/lib/mosaico/placeholder.png +0 -0
- data/lib/mosaico/template.rb +89 -0
- data/lib/mosaico/versafix_template.rb +43 -0
- data/lib/mosaico/version.rb +4 -0
- data/lib/tasks/makeThumbs.js.erb +57 -0
- data/lib/tasks/thumbs.rake +35 -0
- data/mosaico.gemspec +22 -0
- data/screenshot.png +0 -0
- data/vendor/assets/fonts/LiberationSans-Regular.ttf +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/.jsbeautifyrc +6 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/.jshintrc +8 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/.travis.yml +6 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/CONTRIBUTING.md +37 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/Dockerfile +21 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/Gruntfile.js +241 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/LICENSE +680 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/NOTICE.txt +87 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/README.md +73 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/backend/README.txt +23 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/backend/main.js +162 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/bower.json +76 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/build/mosaico-material.css +7425 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/build/mosaico.css +7133 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/build/mosaico.debug.js +1517 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/build/mosaico.js +12828 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/build/templates.js +15 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/fa/fonts/fontawesome-webfont.eot +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/fa/fonts/fontawesome-webfont.svg +685 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/fa/fonts/fontawesome-webfont.ttf +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/fa/fonts/fontawesome-webfont.woff +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/fa/fonts/fontawesome-webfont.woff2 +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/img/byvoxmail.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/img/mosaico-badge.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/img/mosaico-v.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/img/mosaico32.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/img/mosaicologo.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/img/screenshot-orig.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/img/screenshot.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/lang/README.md +26 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/lang/mosaico-de.json +88 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/lang/mosaico-en.json +88 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/lang/mosaico-es.json +88 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/lang/mosaico-fr.json +88 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/lang/mosaico-it.json +88 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/lang/mosaico-nl.json +88 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/lang/mosaico-sv.json +88 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/mosaico-material.min.css +5 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/mosaico-material.min.css.map +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/mosaico.min.css +5 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/mosaico.min.css.map +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/mosaico.min.js +1517 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/mosaico.min.js.map +147 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/canvas-to-blob.min.js +2 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/jquery-ui.min.css +7 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/jquery-ui.min.js +13 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/jquery.fileupload-image.js +324 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/jquery.fileupload-process.js +175 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/jquery.fileupload-validate.js +122 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/jquery.fileupload.js +1482 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/jquery.iframe-transport.js +217 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/jquery.min.js +5 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/jquery.min.map +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/jquery.ui.touch-punch.min.js +11 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/knockout-jqueryui.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/knockout.js +123 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/load-image.all.min.js +2 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/notoregular/NotoSans-Regular-webfont.eot +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/notoregular/NotoSans-Regular-webfont.ttf +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/notoregular/NotoSans-Regular-webfont.woff +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/notoregular/stylesheet.css +9 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/advlist/plugin.js +101 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/advlist/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/anchor/plugin.js +55 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/anchor/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/autolink/plugin.js +204 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/autolink/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/autoresize/plugin.js +162 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/autoresize/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/autosave/plugin.js +165 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/autosave/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/bbcode/plugin.js +123 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/bbcode/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/charmap/plugin.js +462 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/charmap/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/code/plugin.js +60 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/code/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/codesample/css/prism.css +138 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/codesample/plugin.js +1319 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/codesample/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/colorpicker/plugin.js +112 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/colorpicker/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/contextmenu/plugin.js +100 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/contextmenu/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/directionality/plugin.js +64 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/directionality/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-cool.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-cry.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-embarassed.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-foot-in-mouth.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-frown.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-innocent.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-kiss.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-laughing.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-money-mouth.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-sealed.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-smile.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-surprised.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-tongue-out.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-undecided.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-wink.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/img/smiley-yell.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/plugin.js +65 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/emoticons/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/fullpage/plugin.js +490 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/fullpage/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/fullscreen/plugin.js +154 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/fullscreen/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/hr/plugin.js +30 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/hr/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/image/plugin.js +630 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/image/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/imagetools/plugin.js +2944 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/imagetools/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/importcss/plugin.js +273 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/importcss/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/insertdatetime/plugin.js +121 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/insertdatetime/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/layer/plugin.js +225 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/layer/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/legacyoutput/plugin.js +208 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/legacyoutput/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/link/plugin.js +403 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/link/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/lists/plugin.js +965 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/lists/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/media/moxieplayer.swf +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/media/plugin.js +879 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/media/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/nonbreaking/plugin.js +53 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/nonbreaking/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/noneditable/plugin.js +101 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/noneditable/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/pagebreak/plugin.js +88 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/pagebreak/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/paste/plugin.js +1844 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/paste/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/preview/plugin.js +101 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/preview/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/print/plugin.js +32 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/print/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/save/plugin.js +98 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/save/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/searchreplace/plugin.js +609 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/searchreplace/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/spellchecker/plugin.js +1031 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/spellchecker/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/tabfocus/plugin.js +120 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/tabfocus/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/table/plugin.js +4400 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/table/plugin.min.js +2 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/template/plugin.js +276 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/template/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/textcolor/plugin.js +297 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/textcolor/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/textpattern/plugin.js +268 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/textpattern/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/visualblocks/css/visualblocks.css +135 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/visualblocks/plugin.js +86 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/visualblocks/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/visualchars/plugin.js +123 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/visualchars/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/wordcount/plugin.js +69 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/plugins/wordcount/plugin.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/Variables.less +196 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/content.inline.min.css +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/content.min.css +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/fonts/readme.md +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/fonts/tinymce-small.eot +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/fonts/tinymce-small.json +1277 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/fonts/tinymce-small.svg +63 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/fonts/tinymce-small.ttf +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/fonts/tinymce-small.woff +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/fonts/tinymce.eot +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/fonts/tinymce.json +1972 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/fonts/tinymce.svg +98 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/fonts/tinymce.ttf +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/fonts/tinymce.woff +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/img/anchor.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/img/loader.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/img/object.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/img/trans.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/skin.ie7.min.css +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/skin.json +79 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/gray-flat/skin.min.css +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/content.inline.min.css +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/content.min.css +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/fonts/tinymce-small.eot +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/fonts/tinymce-small.svg +63 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/fonts/tinymce-small.ttf +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/fonts/tinymce-small.woff +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/fonts/tinymce.eot +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/fonts/tinymce.svg +129 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/fonts/tinymce.ttf +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/fonts/tinymce.woff +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/img/anchor.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/img/loader.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/img/object.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/img/trans.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/skin.ie7.min.css +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/skins/lightgray/skin.min.css +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/themes/inlite/theme.js +1828 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/themes/inlite/theme.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/themes/modern/theme.js +934 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/themes/modern/theme.min.js +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/dist/vendor/tinymce.min.js +14 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/editor.html +63 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/favicon.ico +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/index.html +368 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/package.json +92 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/img/byvoxmail.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/img/mosaico-badge.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/img/mosaico-v.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/img/mosaico32.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/img/mosaicologo.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/img/screenshot-orig.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/img/screenshot.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/lang/README.md +26 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/lang/mosaico-de.json +88 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/lang/mosaico-en.json +88 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/lang/mosaico-es.json +88 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/lang/mosaico-fr.json +88 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/lang/mosaico-it.json +88 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/lang/mosaico-nl.json +88 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/lang/mosaico-sv.json +88 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/Variables.less +196 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/content.inline.min.css +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/content.min.css +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/fonts/readme.md +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/fonts/tinymce-small.eot +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/fonts/tinymce-small.json +1277 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/fonts/tinymce-small.svg +63 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/fonts/tinymce-small.ttf +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/fonts/tinymce-small.woff +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/fonts/tinymce.eot +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/fonts/tinymce.json +1972 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/fonts/tinymce.svg +98 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/fonts/tinymce.ttf +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/fonts/tinymce.woff +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/img/anchor.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/img/loader.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/img/object.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/img/trans.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/skin.ie7.min.css +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/skin.json +79 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/res/vendor/skins/gray-flat/skin.min.css +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/server-config.js +12 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/spec/converter-spec.js +115 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/spec/data/template-versafix-1.model.json +137 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/spec/declarations-spec.js +282 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/spec/mensch-spec.js +114 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/spec/model-spec.js +88 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/spec/stylesheet-spec.js +177 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/css/app_standalone.less +7 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/css/app_standalone_material.less +350 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/css/safarihack.css +17 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/css/style_elements.less +497 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/css/style_elements_jquery.less +344 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/css/style_elements_mixins.less +406 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/css/style_elements_moxie.less +130 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/css/style_mosaico.less +529 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/css/style_mosaico_content.less +391 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/css/style_mosaico_tools.less +1043 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/css/style_reset.less +45 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/css/style_variables.less +156 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/app.js +167 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/bind-iframe.js +64 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/blocks.js +118 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/choose-template.js +7 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/colorpicker.js +58 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/csstext.js +16 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/droppable.js +87 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/eventable.js +33 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/extender-pagination.js +60 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/extsortables.js +103 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/fileupload.js +373 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/if-subs.js +110 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/jqueryui-spinner.js +31 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/jqueryui-tabs.js +17 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/script-template.js +30 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/scrollfix.js +48 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/scrollintoview.js +83 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/string-template.js +76 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/tooltips.js +36 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/validated-value.js +40 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/virtuals.js +102 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/bindings/wysiwygs.js +304 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/converter/checkmodel.js +114 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/converter/declarations.js +279 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/converter/domutils.js +93 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/converter/editor.js +411 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/converter/main.js +42 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/converter/model.js +536 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/converter/parser.js +485 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/converter/stylesheet.js +205 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/converter/utils.js +156 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/converter/wrapper.js +308 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/ext/color.js +53 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/ext/inliner.js +35 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/ext/localstorage.js +100 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/ko-bindings.js +22 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/template-loader.js +446 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/timed-call.js +31 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/undomanager/undomain.js +49 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/undomanager/undoserializer.js +120 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/js/viewmodel.js +595 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/array.tmpl.html +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/block-show.tmpl.html +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/block-wysiwyg.tmpl.html +18 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/blocks-show.tmpl.html +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/blocks-wysiwyg.tmpl.html +2 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/customstyle.tmpl.html +3 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/empty.tmpl.html +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/error.tmpl.html +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/gallery-images.tmpl.html +16 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/img-wysiwyg.tmpl.html +43 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/main.tmpl.html +102 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/src/tmpl/toolbox.tmpl.html +111 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/tasks/combineKOTemplates.js +24 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/tasks/lib/phantom-thumbnailer-editor.js +168 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/tasks/makeThumbs.js +79 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/tedc15/README.md +1 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/tedc15/edres/_full.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/tedc15/edres/footerBlock.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/tedc15/edres/headerBlock.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/tedc15/edres/heroBlock.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/tedc15/edres/socialBlock.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/tedc15/edres/threetwoBlock.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/tedc15/edres/twoColumnBlock.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/tedc15/template-tedc15.html +567 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/edres/HeaderAndText.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/edres/_full.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/edres/fixedlist.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/mosaico-tutorial.md +335 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/mosaico-tutorial.pdf +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/screenshot_384.jpg +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/screenshot_385.jpg +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/screenshot_386.jpg +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/screenshot_387.jpg +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/screenshot_407.jpg +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/screenshot_408.jpg +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/tutorial/template-tutorial.html +68 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/_full.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/buttonBlock.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/doubleArticleBlock.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/doubleImageBlock.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/hrBlock.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/imageBlock.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/logoBlock.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/sideArticleBlock.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/singleArticleBlock.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/socialBlock.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/spacerBlock.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/textBlock.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/titleBlock.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/tripleArticleBlock.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/edres/tripleImageBlock.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/facebook_bw_ok.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/facebook_ok.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/flickr_bw_ok.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/flickr_ok.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/google+_bw_ok.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/google+_ok.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/instagram_bw_ok.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/instagram_ok.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/linkedin_bw_ok.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/linkedin_ok.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/twitter_bw_ok.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/twitter_ok.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/vimeo_bw_ok.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/vimeo_ok.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/web_bw_ok.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/web_ok.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/youtube_bw_ok.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/social_def/youtube_ok.png +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/img/sponsor.gif +0 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/templates/versafix-1/template-versafix-1.html +1531 -0
- data/vendor/assets/mosaico-0.16.0/mosaico/uploads/README.md +1 -0
- metadata +536 -0
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": [
|
|
4
|
+
"node_modules/browser-pack/_prelude.js",
|
|
5
|
+
"bower_components/console-browserify/index.js",
|
|
6
|
+
"bower_components/evol-colorpicker/js/evol.colorpicker.min.js",
|
|
7
|
+
"bower_components/jsep/src/jsep.js",
|
|
8
|
+
"bower_components/juice/lib/inline.js",
|
|
9
|
+
"bower_components/juice/lib/property.js",
|
|
10
|
+
"bower_components/juice/lib/selector.js",
|
|
11
|
+
"bower_components/juice/lib/utils.js",
|
|
12
|
+
"bower_components/knockout-sortable/build/knockout-sortable.min.js",
|
|
13
|
+
"bower_components/knockout-undomanager/knockout-undomanager.js",
|
|
14
|
+
"bower_components/knockout.wrap/knockout.wrap.js",
|
|
15
|
+
"bower_components/knockoutjs-reactor/src/knockout.reactor.js",
|
|
16
|
+
"bower_components/mensch/index.js",
|
|
17
|
+
"bower_components/mensch/lib/debug.js",
|
|
18
|
+
"bower_components/mensch/lib/lexer.js",
|
|
19
|
+
"bower_components/mensch/lib/parser.js",
|
|
20
|
+
"bower_components/mensch/lib/stringify.js",
|
|
21
|
+
"bower_components/slick/parser.js",
|
|
22
|
+
"bower_components/tinycolor/tinycolor.js",
|
|
23
|
+
"bower_components/toastr/toastr.js",
|
|
24
|
+
"build/templates.js",
|
|
25
|
+
"node_modules/assert/assert.js",
|
|
26
|
+
"node_modules/os-browserify/browser.js",
|
|
27
|
+
"node_modules/process/browser.js",
|
|
28
|
+
"node_modules/util/node_modules/inherits/inherits_browser.js",
|
|
29
|
+
"node_modules/util/support/isBufferBrowser.js",
|
|
30
|
+
"node_modules/util/util.js",
|
|
31
|
+
"src/js/app.js",
|
|
32
|
+
"src/js/bindings/bind-iframe.js",
|
|
33
|
+
"src/js/bindings/blocks.js",
|
|
34
|
+
"src/js/bindings/choose-template.js",
|
|
35
|
+
"src/js/bindings/colorpicker.js",
|
|
36
|
+
"src/js/bindings/csstext.js",
|
|
37
|
+
"src/js/bindings/droppable.js",
|
|
38
|
+
"src/js/bindings/eventable.js",
|
|
39
|
+
"src/js/bindings/extender-pagination.js",
|
|
40
|
+
"src/js/bindings/extsortables.js",
|
|
41
|
+
"src/js/bindings/fileupload.js",
|
|
42
|
+
"src/js/bindings/if-subs.js",
|
|
43
|
+
"src/js/bindings/jqueryui-spinner.js",
|
|
44
|
+
"src/js/bindings/jqueryui-tabs.js",
|
|
45
|
+
"src/js/bindings/script-template.js",
|
|
46
|
+
"src/js/bindings/scrollfix.js",
|
|
47
|
+
"src/js/bindings/scrollintoview.js",
|
|
48
|
+
"src/js/bindings/string-template.js",
|
|
49
|
+
"src/js/bindings/tooltips.js",
|
|
50
|
+
"src/js/bindings/validated-value.js",
|
|
51
|
+
"src/js/bindings/virtuals.js",
|
|
52
|
+
"src/js/bindings/wysiwygs.js",
|
|
53
|
+
"src/js/converter/checkmodel.js",
|
|
54
|
+
"src/js/converter/declarations.js",
|
|
55
|
+
"src/js/converter/domutils.js",
|
|
56
|
+
"src/js/converter/editor.js",
|
|
57
|
+
"src/js/converter/main.js",
|
|
58
|
+
"src/js/converter/model.js",
|
|
59
|
+
"src/js/converter/parser.js",
|
|
60
|
+
"src/js/converter/stylesheet.js",
|
|
61
|
+
"src/js/converter/utils.js",
|
|
62
|
+
"src/js/converter/wrapper.js",
|
|
63
|
+
"src/js/ext/color.js",
|
|
64
|
+
"src/js/ext/inliner.js",
|
|
65
|
+
"src/js/ext/localstorage.js",
|
|
66
|
+
"src/js/ko-bindings.js",
|
|
67
|
+
"src/js/template-loader.js",
|
|
68
|
+
"src/js/timed-call.js",
|
|
69
|
+
"src/js/undomanager/undomain.js",
|
|
70
|
+
"src/js/undomanager/undoserializer.js",
|
|
71
|
+
"src/js/viewmodel.js"
|
|
72
|
+
],
|
|
73
|
+
"names": [],
|
|
74
|
+
"mappings": "AAAA;;ACwCA,QAAS,QAET,QAAS,QACL,QAAQ,IAAI,MAAM,QAAS,WAG/B,QAAS,QACL,QAAQ,IAAI,MAAM,QAAS,WAG/B,QAAS,SAC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AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AC1kBA,YAoBA,SAAS,eAAc,GACrB,GAAI,GAAM,OAAO,SAAS,cAAc,MAIxC,OAHA,GAAI,UAAY,UAChB,EAAI,WAAW,KAAO,EACtB,EAAI,UAAY,EAAI,UACb,EAAI,WAAW,KArBxB,GAAI,gBAAiB,QAAQ,wBACzB,QAAU,QAAQ,WAClB,GAAK,QAAQ,YACb,EAAI,QAAQ,SAChB,SAAQ,mBACR,IAAI,wBAAyB,QAAQ,mBAAmB,UAEpD,2BAA6B,QAAQ,6BACrC,YAAc,QAAQ,kBACtB,cAAgB,QAAQ,oBAExB,mBAAqB,QAAQ,wBAEjC,IAAiB,mBAAN,IAAmB,KAAM,kCACpC,IAAgB,mBAAL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C5B,GAAI,GAAI,GAAG,MAAM,iBAAiB,EAAI,GAC5B,QAAN,GAA0B,gBAAL,GACvB,EAAQ,EAAO,IAAK,EAAM,GAE1B,EAAK,EAAS,GAAQ,GAK9B,GAAQ,GAAI,EAAM,EAElB,IAAI,GAAS,EACb,KAAK,GAAI,KAAQ,GACX,EAAK,eAAe,IAAiB,QAAR,IAC/B,GAAU,EAAO,KAAO,EAAK,GAAQ,IAAM,KAG/C,OAAO,IAQT,EAAU,UAAY,SAAS,GAE7B,EAAU,cAAc,QAAQ,GAEhC,EAAU,iBAAiB,IAG7B,EAAU,OAAS,SAAS,EAAU,GACpC,EAAE,GAAU,OAAO,IAIrB,EAAU,IAAM,aAKhB,EAAU,iBAAiB,UAAU,SAAS,GAC5B,GAAZ,GAAiB,EAAU,mBAAoB,GACjD,EAAU,eAEX,EAAW,UAEP,EA3kBT,GAAI,GAAI,QAAQ,UACZ,GAAK,QAAQ,YACb,QAAU,QAAQ,WAClB,uBAAyB,QAAQ,mBAAmB,UAEpD,OAAS,QAAQ,SACrB,QAAO,SACL,aAAe,EACf,OAAS,EACT,cAAiB,0BACjB,OAAU,WACV,QAAW,KACX,aAAgB,MAChB,aAAgB,OAChB,QAAW,OACX,gBAAmB,OACnB,WAAc,QACd,WAAc,SACd,WAAc,SACd,WAAc,WA4jBhB,OAAO,QAAU",
|
|
75
|
+
"file": "generated.js",
|
|
76
|
+
"sourceRoot": "",
|
|
77
|
+
"sourcesContent": [
|
|
78
|
+
"(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})",
|
|
79
|
+
"/*global window, global*/\nvar util = require(\"util\")\nvar assert = require(\"assert\")\n\nvar slice = Array.prototype.slice\nvar console\nvar times = {}\n\nif (typeof global !== \"undefined\" && global.console) {\n console = global.console\n} else if (typeof window !== \"undefined\" && window.console) {\n console = window.console\n} else {\n console = {}\n}\n\nvar functions = [\n [log, \"log\"]\n , [info, \"info\"]\n , [warn, \"warn\"]\n , [error, \"error\"]\n , [time, \"time\"]\n , [timeEnd, \"timeEnd\"]\n , [trace, \"trace\"]\n , [dir, \"dir\"]\n , [assert, \"assert\"]\n]\n\nfor (var i = 0; i < functions.length; i++) {\n var tuple = functions[i]\n var f = tuple[0]\n var name = tuple[1]\n\n if (!console[name]) {\n console[name] = f\n }\n}\n\nmodule.exports = console\n\nfunction log() {}\n\nfunction info() {\n console.log.apply(console, arguments)\n}\n\nfunction warn() {\n console.log.apply(console, arguments)\n}\n\nfunction error() {\n console.warn.apply(console, arguments)\n}\n\nfunction time(label) {\n times[label] = Date.now()\n}\n\nfunction timeEnd(label) {\n var time = times[label]\n if (!time) {\n throw new Error(\"No such label: \" + label)\n }\n\n var duration = Date.now() - time\n console.log(label + \": \" + duration + \"ms\")\n}\n\nfunction trace() {\n var err = new Error()\n err.name = \"Trace\"\n err.message = util.format.apply(null, arguments)\n console.error(err.stack)\n}\n\nfunction dir(object) {\n console.log(util.inspect(object) + \"\\n\")\n}\n\nfunction assert(expression) {\n if (!expression) {\n var arr = slice.call(arguments, 1)\n assert.ok(false, util.format.apply(null, arr))\n }\n}\n",
|
|
80
|
+
"/*\n evol.colorpicker 3.2.2\n (c) 2015 Olivier Giulieri\n http://evoluteur.github.io/colorpicker/\n*/\n!function(a,b){var c=0,d=window.navigator.userAgent,e=d.indexOf(\"MSIE \")>0,f=e?\"-ie\":\"\",g=e?!1:/mozilla/.test(d.toLowerCase())&&!/webkit/.test(d.toLowerCase()),h=[],i=[\"ffffff\",\"000000\",\"eeece1\",\"1f497d\",\"4f81bd\",\"c0504d\",\"9bbb59\",\"8064a2\",\"4bacc6\",\"f79646\"],j=[\"f2f2f2\",\"7f7f7f\",\"ddd9c3\",\"c6d9f0\",\"dbe5f1\",\"f2dcdb\",\"ebf1dd\",\"e5e0ec\",\"dbeef3\",\"fdeada\",\"d8d8d8\",\"595959\",\"c4bd97\",\"8db3e2\",\"b8cce4\",\"e5b9b7\",\"d7e3bc\",\"ccc1d9\",\"b7dde8\",\"fbd5b5\",\"bfbfbf\",\"3f3f3f\",\"938953\",\"548dd4\",\"95b3d7\",\"d99694\",\"c3d69b\",\"b2a2c7\",\"92cddc\",\"fac08f\",\"a5a5a5\",\"262626\",\"494429\",\"17365d\",\"366092\",\"953734\",\"76923c\",\"5f497a\",\"31859b\",\"e36c09\",\"7f7f7f\",\"0c0c0c\",\"1d1b10\",\"0f243e\",\"244061\",\"632423\",\"4f6128\",\"3f3151\",\"205867\",\"974806\"],k=[\"c00000\",\"ff0000\",\"ffc000\",\"ffff00\",\"92d050\",\"00b050\",\"00b0f0\",\"0070c0\",\"002060\",\"7030a0\"],l=[[\"003366\",\"336699\",\"3366cc\",\"003399\",\"000099\",\"0000cc\",\"000066\"],[\"006666\",\"006699\",\"0099cc\",\"0066cc\",\"0033cc\",\"0000ff\",\"3333ff\",\"333399\"],[\"669999\",\"009999\",\"33cccc\",\"00ccff\",\"0099ff\",\"0066ff\",\"3366ff\",\"3333cc\",\"666699\"],[\"339966\",\"00cc99\",\"00ffcc\",\"00ffff\",\"33ccff\",\"3399ff\",\"6699ff\",\"6666ff\",\"6600ff\",\"6600cc\"],[\"339933\",\"00cc66\",\"00ff99\",\"66ffcc\",\"66ffff\",\"66ccff\",\"99ccff\",\"9999ff\",\"9966ff\",\"9933ff\",\"9900ff\"],[\"006600\",\"00cc00\",\"00ff00\",\"66ff99\",\"99ffcc\",\"ccffff\",\"ccccff\",\"cc99ff\",\"cc66ff\",\"cc33ff\",\"cc00ff\",\"9900cc\"],[\"003300\",\"009933\",\"33cc33\",\"66ff66\",\"99ff99\",\"ccffcc\",\"ffffff\",\"ffccff\",\"ff99ff\",\"ff66ff\",\"ff00ff\",\"cc00cc\",\"660066\"],[\"333300\",\"009900\",\"66ff33\",\"99ff66\",\"ccff99\",\"ffffcc\",\"ffcccc\",\"ff99cc\",\"ff66cc\",\"ff33cc\",\"cc0099\",\"993399\"],[\"336600\",\"669900\",\"99ff33\",\"ccff66\",\"ffff99\",\"ffcc99\",\"ff9999\",\"ff6699\",\"ff3399\",\"cc3399\",\"990099\"],[\"666633\",\"99cc00\",\"ccff33\",\"ffff66\",\"ffcc66\",\"ff9966\",\"ff6666\",\"ff0066\",\"d60094\",\"993366\"],[\"a58800\",\"cccc00\",\"ffff00\",\"ffcc00\",\"ff9933\",\"ff6600\",\"ff0033\",\"cc0066\",\"660033\"],[\"996633\",\"cc9900\",\"ff9900\",\"cc6600\",\"ff3300\",\"ff0000\",\"cc0000\",\"990033\"],[\"663300\",\"996600\",\"cc3300\",\"993300\",\"990000\",\"800000\",\"993333\"]],m=\"#0000ffff\",n=function(a){var b=a.toString(16);return 1==b.length&&(b=\"0\"+b),b},o=function(a){return n(Number(a))},p=function(a){var b=n(a);return b+b+b},q=function(a){if(a.length>10){var b=1+a.indexOf(\"(\"),c=a.indexOf(\")\"),d=a.substring(b,c).split(\",\");return[\"#\",o(d[0]),o(d[1]),o(d[2])].join(\"\")}return a};a.widget(\"evol.colorpicker\",{version:\"3.2.1\",options:{color:null,showOn:\"both\",hideButton:!1,displayIndicator:!0,transparentColor:!1,history:!0,defaultPalette:\"theme\",strings:\"Theme Colors,Standard Colors,Web Colors,Theme Colors,Back to Palette,History,No history yet.\"},_active:!1,_create:function(){var b=this;switch(this._paletteIdx=\"theme\"==this.options.defaultPalette?1:2,this._id=\"evo-cp\"+c++,this._enabled=!0,this.options.showOn=this.options.hideButton?\"focus\":this.options.showOn,this.element.get(0).tagName){case\"INPUT\":var d=this.options.color,h=this.element,i=(\"focus\"===this.options.showOn?\"\":\"evo-pointer \")+\"evo-colorind\"+(g?\"-ff\":f)+(this.options.hideButton?\" evo-hidden-button\":\"\"),j=\"\";if(this._isPopup=!0,this._palette=null,null!==d)h.val(d);else{var k=h.val();\"\"!==k&&(d=this.options.color=k)}d===m?i+=\" evo-transparent\":j=null!==d?\"background-color:\"+d:\"\",h.addClass(\"colorPicker \"+this._id).wrap('<div style=\"width:'+(this.options.hideButton?this.element.width():this.element.width()+32)+\"px;\"+(e?\"margin-bottom:-21px;\":\"\")+(g?\"padding:1px 0;\":\"\")+'\"></div>').after('<div class=\"'+i+'\" style=\"'+j+'\"></div>').on(\"keyup onpaste\",function(c){var d=a(this).val();d!=b.options.color&&b._setValue(d,!0)});var l=this.options.showOn;(\"both\"===l||\"focus\"===l)&&h.on(\"focus\",function(){b.showPalette()}),(\"both\"===l||\"button\"===l)&&h.next().on(\"click\",function(a){return a.stopPropagation(),b.showPalette(),!1});break;default:this._isPopup=!1,this._palette=this.element.html(this._paletteHTML()).attr(\"aria-haspopup\",\"true\"),this._bindColors()}if(this.options.history&&(d&&this._add2History(d),this.options.initialHistory)){var n=this.options.initialHistory;for(var o in n)this._add2History(n[o])}},_paletteHTML:function(){var a=this._paletteIdx=Math.abs(this._paletteIdx),b=this.options,c=b.strings.split(\",\"),d='<div class=\"evo-pop'+f+' ui-widget ui-widget-content ui-corner-all\"'+(this._isPopup?' style=\"position:absolute\"':\"\")+\"><span>\"+this[\"_paletteHTML\"+a]()+'</span><div class=\"evo-more\"><a href=\"javascript:void(0)\">'+c[1+a]+\"</a>\";return b.history&&(d+='<a href=\"javascript:void(0)\" class=\"evo-hist\">'+c[5]+\"</a>\"),d+=\"</div>\",b.displayIndicator&&(d+=this._colorIndHTML(this.options.color)+this._colorIndHTML(\"\")),d+=\"</div>\"},_colorIndHTML:function(a){var b=e?\"evo-colorbox-ie \":\"\",c=\"\";return a?a===m?b+=\"evo-transparent\":c=\"background-color:\"+a:c=\"display:none\",'<div class=\"evo-color\" style=\"float:left\"><div style=\"'+c+'\" class=\"'+b+'\"></div><span>'+(a?a:\"\")+\"</span></div>\"},_paletteHTML1:function(){for(var a=this.options,b=a.strings.split(\",\"),c='<td style=\"background-color:#',d=e?'\"><div style=\"width:2px;\"></div></td>':'\"><span/></td>',g='<tr><th colspan=\"10\" class=\"ui-widget-content\">',h='<table class=\"evo-palette'+f+'\">'+g+b[0]+\"</th></tr><tr>\",l=0;10>l;l++)h+=c+i[l]+d;for(h+=\"</tr>\",e||(h+='<tr><th colspan=\"10\"></th></tr>'),h+='<tr class=\"top\">',l=0;10>l;l++)h+=c+j[l]+d;for(var m=1;4>m;m++)for(h+='</tr><tr class=\"in\">',l=0;10>l;l++)h+=c+j[10*m+l]+d;for(h+='</tr><tr class=\"bottom\">',l=40;50>l;l++)h+=c+j[l]+d;for(h+=\"</tr>\"+g,a.transparentColor&&(h+='<div class=\"evo-transparent evo-tr-box\"></div>'),h+=b[1]+\"</th></tr><tr>\",l=0;10>l;l++)h+=c+k[l]+d;return h+=\"</tr></table>\"},_paletteHTML2:function(){for(var a,b,c='<td style=\"background-color:#',d=e?'\"><div style=\"width:5px;\"></div></td>':'\"><span/></td>',g='<table class=\"evo-palette2'+f+'\"><tr>',h=\"</tr></table>\",i='<div class=\"evo-palcenter\">',j=0,k=l.length;k>j;j++){i+=g;var m=l[j];for(a=0,b=m.length;b>a;a++)i+=c+m[a]+d;i+=h}i+='<div class=\"evo-sep\"/>';var n=\"\";for(i+=g,a=255;a>10;a-=10)i+=c+p(a)+d,a-=10,n+=c+p(a)+d;return i+=h+g+n+h+\"</div>\"},_switchPalette:function(b){if(this._enabled){var c,d,e,f=this.options.strings.split(\",\");if(a(b).hasClass(\"evo-hist\")){var g=['<table class=\"evo-palette\"><tr><th class=\"ui-widget-content\">',f[5],\"</th></tr></tr></table>\",'<div class=\"evo-cHist\">'];if(0===h.length)g.push(\"<p> \",f[6],\"</p>\");else for(var i=h.length-1;i>-1;i--)9===h[i].length?g.push('<div class=\"evo-transparent\"></div>'):g.push('<div style=\"background-color:',h[i],'\"></div>');g.push(\"</div>\"),c=-this._paletteIdx,d=g.join(\"\"),e=f[4]}else this._paletteIdx<0?(c=-this._paletteIdx,this._palette.find(\".evo-hist\").show()):c=2==this._paletteIdx?1:2,d=this[\"_paletteHTML\"+c](),e=f[c+1],this._paletteIdx=c;this._paletteIdx=c;var j=this._palette.find(\".evo-more\").prev().html(d).end().children().eq(0).html(e);0>c&&j.next().hide()}},_downOrUpPositioning:function(){for(var a=this.element,b=0;null!==a&&100>b;){if(\"visible\"!=a.css(\"overflow\")){var c=this._palette.offset().top+this._palette.height(),d=a.offset().top+a.height(),e=this._palette.offset().top-this._palette.height()-this.element.outerHeight(),f=a.offset().top,g=c>d&&e>f;g?this._palette.css({bottom:this.element.outerHeight()+\"px\"}):this._palette.css({bottom:\"auto\"});break}if(\"HTML\"==a[0].tagName)break;a=a.offsetParent(),b++}},showPalette:function(){if(this._enabled&&(this._active=!0,a(\".colorPicker\").not(\".\"+this._id).colorpicker(\"hidePalette\"),null===this._palette)){this._palette=this.element.next().after(this._paletteHTML()).next().on(\"click\",function(a){return a.stopPropagation(),!1}),this._bindColors();var b=this;this._isPopup&&(this._downOrUpPositioning(),a(document.body).on(\"click.\"+b._id,function(a){a.target!=b.element.get(0)&&b.hidePalette()}).on(\"keyup.\"+b._id,function(a){27===a.keyCode&&b.hidePalette()}))}return this},hidePalette:function(){if(this._isPopup&&this._palette){a(document.body).off(\"click.\"+this._id);var b=this;this._palette.off(\"mouseover click\",\"td,.evo-transparent\").fadeOut(function(){b._palette.remove(),b._palette=b._cTxt=null}).find(\".evo-more a\").off(\"click\")}return this},_bindColors:function(){var b=this,c=this.options,d=this._palette.find(\"div.evo-color\"),e=c.history?\"td,.evo-cHist>div\":\"td\";c.transparentColor&&(e+=\",.evo-transparent\"),this._cTxt1=d.eq(0).children().eq(0),this._cTxt2=d.eq(1).children().eq(0),this._palette.on(\"click\",e,function(c){if(b._enabled){var d=a(this);b._setValue(d.hasClass(\"evo-transparent\")?m:q(d.attr(\"style\").substring(17))),b._active=!1}}).on(\"mouseover\",e,function(c){if(b._enabled){var d=a(this),e=d.hasClass(\"evo-transparent\")?m:q(d.attr(\"style\").substring(17));b.options.displayIndicator&&b._setColorInd(e,2),b._active&&b.element.trigger(\"mouseover.color\",e)}}).find(\".evo-more a\").on(\"click\",function(){b._switchPalette(this)})},val:function(a){return\"undefined\"==typeof a?this.options.color:(this._setValue(a),this)},_setValue:function(a,b){a=a.replace(/ /g,\"\"),this.options.color=a,this._isPopup?(b||this.hidePalette(),this._setBoxColor(this.element.val(a).next(),a)):this._setColorInd(a,1),this.options.history&&this._paletteIdx>0&&this._add2History(a),this.element.trigger(\"change.color\",a)},_setColorInd:function(a,b){var c=this[\"_cTxt\"+b];this._setBoxColor(c,a),c.next().html(a)},_setBoxColor:function(a,b){b===m?a.addClass(\"evo-transparent\").removeAttr(\"style\"):a.removeClass(\"evo-transparent\").attr(\"style\",\"background-color:\"+b)},_setOption:function(a,b){\"color\"==a?this._setValue(b,!0):this.options[a]=b},_add2History:function(a){for(var b=h.length,c=0;b>c;c++)if(a==h[c])return;b>27&&h.shift(),h.push(a)},clear:function(){this.hidePalette().val(\"\")},enable:function(){var a=this.element;return this._isPopup?a.removeAttr(\"disabled\"):a.css({opacity:\"1\",\"pointer-events\":\"auto\"}),\"focus\"!==this.options.showOn&&this.element.next().addClass(\"evo-pointer\"),a.removeAttr(\"aria-disabled\"),this._enabled=!0,this},disable:function(){var a=this.element;return this._isPopup?a.attr(\"disabled\",\"disabled\"):(this.hidePalette(),a.css({opacity:\"0.3\",\"pointer-events\":\"none\"})),\"focus\"!==this.options.showOn&&this.element.next().removeClass(\"evo-pointer\"),a.attr(\"aria-disabled\",\"true\"),this._enabled=!1,this},isDisabled:function(){return!this._enabled},destroy:function(){a(document.body).off(\"click.\"+this._id),this._palette&&(this._palette.off(\"mouseover click\",\"td,.evo-cHist>div,.evo-transparent\").find(\".evo-more a\").off(\"click\"),this._isPopup&&this._palette.remove(),this._palette=this._cTxt=null),this._isPopup&&this.element.next().off(\"click\").remove().end().off(\"focus\").unwrap(),this.element.removeClass(\"colorPicker \"+this.id).empty(),a.Widget.prototype.destroy.call(this)}})}(jQuery);",
|
|
81
|
+
"// JavaScript Expression Parser (JSEP) <%= version %>\n// JSEP may be freely distributed under the MIT License\n// http://jsep.from.so/\n\n/*global module: true, exports: true, console: true */\n(function (root) {\n\t'use strict';\n\t// Node Types\n\t// ----------\n\n\t// This is the full set of types that any JSEP node can be.\n\t// Store them here to save space when minified\n\tvar COMPOUND = 'Compound',\n\t\tIDENTIFIER = 'Identifier',\n\t\tMEMBER_EXP = 'MemberExpression',\n\t\tLITERAL = 'Literal',\n\t\tTHIS_EXP = 'ThisExpression',\n\t\tCALL_EXP = 'CallExpression',\n\t\tUNARY_EXP = 'UnaryExpression',\n\t\tBINARY_EXP = 'BinaryExpression',\n\t\tLOGICAL_EXP = 'LogicalExpression',\n\t\tCONDITIONAL_EXP = 'ConditionalExpression',\n\t\tARRAY_EXP = 'ArrayExpression',\n\n\t\tPERIOD_CODE = 46, // '.'\n\t\tCOMMA_CODE = 44, // ','\n\t\tSQUOTE_CODE = 39, // single quote\n\t\tDQUOTE_CODE = 34, // double quotes\n\t\tOPAREN_CODE = 40, // (\n\t\tCPAREN_CODE = 41, // )\n\t\tOBRACK_CODE = 91, // [\n\t\tCBRACK_CODE = 93, // ]\n\t\tQUMARK_CODE = 63, // ?\n\t\tSEMCOL_CODE = 59, // ;\n\t\tCOLON_CODE = 58, // :\n\n\t\tthrowError = function(message, index) {\n\t\t\tvar error = new Error(message + ' at character ' + index);\n\t\t\terror.index = index;\n\t\t\terror.description = message;\n\t\t\tthrow error;\n\t\t},\n\n\t// Operations\n\t// ----------\n\n\t// Set `t` to `true` to save space (when minified, not gzipped)\n\t\tt = true,\n\t// Use a quickly-accessible map to store all of the unary operators\n\t// Values are set to `true` (it really doesn't matter)\n\t\tunary_ops = {'-': t, '!': t, '~': t, '+': t},\n\t// Also use a map for the binary operations but set their values to their\n\t// binary precedence for quick reference:\n\t// see [Order of operations](http://en.wikipedia.org/wiki/Order_of_operations#Programming_language)\n\t\tbinary_ops = {\n\t\t\t'||': 1, '&&': 2, '|': 3, '^': 4, '&': 5,\n\t\t\t'==': 6, '!=': 6, '===': 6, '!==': 6,\n\t\t\t'<': 7, '>': 7, '<=': 7, '>=': 7,\n\t\t\t'<<':8, '>>': 8, '>>>': 8,\n\t\t\t'+': 9, '-': 9,\n\t\t\t'*': 10, '/': 10, '%': 10\n\t\t},\n\t// Get return the longest key length of any object\n\t\tgetMaxKeyLen = function(obj) {\n\t\t\tvar max_len = 0, len;\n\t\t\tfor(var key in obj) {\n\t\t\t\tif((len = key.length) > max_len && obj.hasOwnProperty(key)) {\n\t\t\t\t\tmax_len = len;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn max_len;\n\t\t},\n\t\tmax_unop_len = getMaxKeyLen(unary_ops),\n\t\tmax_binop_len = getMaxKeyLen(binary_ops),\n\t// Literals\n\t// ----------\n\t// Store the values to return for the various literals we may encounter\n\t\tliterals = {\n\t\t\t'true': true,\n\t\t\t'false': false,\n\t\t\t'null': null\n\t\t},\n\t// Except for `this`, which is special. This could be changed to something like `'self'` as well\n\t\tthis_str = 'this',\n\t// Returns the precedence of a binary operator or `0` if it isn't a binary operator\n\t\tbinaryPrecedence = function(op_val) {\n\t\t\treturn binary_ops[op_val] || 0;\n\t\t},\n\t// Utility function (gets called from multiple places)\n\t// Also note that `a && b` and `a || b` are *logical* expressions, not binary expressions\n\t\tcreateBinaryExpression = function (operator, left, right) {\n\t\t\tvar type = (operator === '||' || operator === '&&') ? LOGICAL_EXP : BINARY_EXP;\n\t\t\treturn {\n\t\t\t\ttype: type,\n\t\t\t\toperator: operator,\n\t\t\t\tleft: left,\n\t\t\t\tright: right\n\t\t\t};\n\t\t},\n\t\t// `ch` is a character code in the next three functions\n\t\tisDecimalDigit = function(ch) {\n\t\t\treturn (ch >= 48 && ch <= 57); // 0...9\n\t\t},\n\t\tisIdentifierStart = function(ch) {\n\t\t\treturn (ch === 36) || (ch === 95) || // `$` and `_`\n\t\t\t\t\t(ch >= 65 && ch <= 90) || // A...Z\n\t\t\t\t\t(ch >= 97 && ch <= 122) || // a...z\n (ch >= 128 && !binary_ops[String.fromCharCode(ch)]); // any non-ASCII that is not an operator\n\t\t},\n\t\tisIdentifierPart = function(ch) {\n\t\t\treturn (ch === 36) || (ch === 95) || // `$` and `_`\n\t\t\t\t\t(ch >= 65 && ch <= 90) || // A...Z\n\t\t\t\t\t(ch >= 97 && ch <= 122) || // a...z\n\t\t\t\t\t(ch >= 48 && ch <= 57) || // 0...9\n (ch >= 128 && !binary_ops[String.fromCharCode(ch)]); // any non-ASCII that is not an operator\n\t\t},\n\n\t\t// Parsing\n\t\t// -------\n\t\t// `expr` is a string with the passed in expression\n\t\tjsep = function(expr) {\n\t\t\t// `index` stores the character number we are currently at while `length` is a constant\n\t\t\t// All of the gobbles below will modify `index` as we move along\n\t\t\tvar index = 0,\n\t\t\t\tcharAtFunc = expr.charAt,\n\t\t\t\tcharCodeAtFunc = expr.charCodeAt,\n\t\t\t\texprI = function(i) { return charAtFunc.call(expr, i); },\n\t\t\t\texprICode = function(i) { return charCodeAtFunc.call(expr, i); },\n\t\t\t\tlength = expr.length,\n\n\t\t\t\t// Push `index` up to the next non-space character\n\t\t\t\tgobbleSpaces = function() {\n\t\t\t\t\tvar ch = exprICode(index);\n\t\t\t\t\t// space or tab\n\t\t\t\t\twhile(ch === 32 || ch === 9 || ch === 10 || ch === 13) {\n\t\t\t\t\t\tch = exprICode(++index);\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\t\t// The main parsing function. Much of this code is dedicated to ternary expressions\n\t\t\t\tgobbleExpression = function() {\n\t\t\t\t\tvar test = gobbleBinaryExpression(),\n\t\t\t\t\t\tconsequent, alternate;\n\t\t\t\t\tgobbleSpaces();\n\t\t\t\t\tif(exprICode(index) === QUMARK_CODE) {\n\t\t\t\t\t\t// Ternary expression: test ? consequent : alternate\n\t\t\t\t\t\tindex++;\n\t\t\t\t\t\tconsequent = gobbleExpression();\n\t\t\t\t\t\tif(!consequent) {\n\t\t\t\t\t\t\tthrowError('Expected expression', index);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tgobbleSpaces();\n\t\t\t\t\t\tif(exprICode(index) === COLON_CODE) {\n\t\t\t\t\t\t\tindex++;\n\t\t\t\t\t\t\talternate = gobbleExpression();\n\t\t\t\t\t\t\tif(!alternate) {\n\t\t\t\t\t\t\t\tthrowError('Expected expression', index);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\ttype: CONDITIONAL_EXP,\n\t\t\t\t\t\t\t\ttest: test,\n\t\t\t\t\t\t\t\tconsequent: consequent,\n\t\t\t\t\t\t\t\talternate: alternate\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthrowError('Expected :', index);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn test;\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\t\t// Search for the operation portion of the string (e.g. `+`, `===`)\n\t\t\t\t// Start by taking the longest possible binary operations (3 characters: `===`, `!==`, `>>>`)\n\t\t\t\t// and move down from 3 to 2 to 1 character until a matching binary operation is found\n\t\t\t\t// then, return that binary operation\n\t\t\t\tgobbleBinaryOp = function() {\n\t\t\t\t\tgobbleSpaces();\n\t\t\t\t\tvar biop, to_check = expr.substr(index, max_binop_len), tc_len = to_check.length;\n\t\t\t\t\twhile(tc_len > 0) {\n\t\t\t\t\t\tif(binary_ops.hasOwnProperty(to_check)) {\n\t\t\t\t\t\t\tindex += tc_len;\n\t\t\t\t\t\t\treturn to_check;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tto_check = to_check.substr(0, --tc_len);\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t},\n\n\t\t\t\t// This function is responsible for gobbling an individual expression,\n\t\t\t\t// e.g. `1`, `1+2`, `a+(b*2)-Math.sqrt(2)`\n\t\t\t\tgobbleBinaryExpression = function() {\n\t\t\t\t\tvar ch_i, node, biop, prec, stack, biop_info, left, right, i;\n\n\t\t\t\t\t// First, try to get the leftmost thing\n\t\t\t\t\t// Then, check to see if there's a binary operator operating on that leftmost thing\n\t\t\t\t\tleft = gobbleToken();\n\t\t\t\t\tbiop = gobbleBinaryOp();\n\n\t\t\t\t\t// If there wasn't a binary operator, just return the leftmost node\n\t\t\t\t\tif(!biop) {\n\t\t\t\t\t\treturn left;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Otherwise, we need to start a stack to properly place the binary operations in their\n\t\t\t\t\t// precedence structure\n\t\t\t\t\tbiop_info = { value: biop, prec: binaryPrecedence(biop)};\n\n\t\t\t\t\tright = gobbleToken();\n\t\t\t\t\tif(!right) {\n\t\t\t\t\t\tthrowError(\"Expected expression after \" + biop, index);\n\t\t\t\t\t}\n\t\t\t\t\tstack = [left, biop_info, right];\n\n\t\t\t\t\t// Properly deal with precedence using [recursive descent](http://www.engr.mun.ca/~theo/Misc/exp_parsing.htm)\n\t\t\t\t\twhile((biop = gobbleBinaryOp())) {\n\t\t\t\t\t\tprec = binaryPrecedence(biop);\n\n\t\t\t\t\t\tif(prec === 0) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbiop_info = { value: biop, prec: prec };\n\n\t\t\t\t\t\t// Reduce: make a binary expression from the three topmost entries.\n\t\t\t\t\t\twhile ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {\n\t\t\t\t\t\t\tright = stack.pop();\n\t\t\t\t\t\t\tbiop = stack.pop().value;\n\t\t\t\t\t\t\tleft = stack.pop();\n\t\t\t\t\t\t\tnode = createBinaryExpression(biop, left, right);\n\t\t\t\t\t\t\tstack.push(node);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tnode = gobbleToken();\n\t\t\t\t\t\tif(!node) {\n\t\t\t\t\t\t\tthrowError(\"Expected expression after \" + biop, index);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstack.push(biop_info, node);\n\t\t\t\t\t}\n\n\t\t\t\t\ti = stack.length - 1;\n\t\t\t\t\tnode = stack[i];\n\t\t\t\t\twhile(i > 1) {\n\t\t\t\t\t\tnode = createBinaryExpression(stack[i - 1].value, stack[i - 2], node);\n\t\t\t\t\t\ti -= 2;\n\t\t\t\t\t}\n\t\t\t\t\treturn node;\n\t\t\t\t},\n\n\t\t\t\t// An individual part of a binary expression:\n\t\t\t\t// e.g. `foo.bar(baz)`, `1`, `\"abc\"`, `(a % 2)` (because it's in parenthesis)\n\t\t\t\tgobbleToken = function() {\n\t\t\t\t\tvar ch, to_check, tc_len;\n\n\t\t\t\t\tgobbleSpaces();\n\t\t\t\t\tch = exprICode(index);\n\n\t\t\t\t\tif(isDecimalDigit(ch) || ch === PERIOD_CODE) {\n\t\t\t\t\t\t// Char code 46 is a dot `.` which can start off a numeric literal\n\t\t\t\t\t\treturn gobbleNumericLiteral();\n\t\t\t\t\t} else if(ch === SQUOTE_CODE || ch === DQUOTE_CODE) {\n\t\t\t\t\t\t// Single or double quotes\n\t\t\t\t\t\treturn gobbleStringLiteral();\n\t\t\t\t\t} else if(isIdentifierStart(ch) || ch === OPAREN_CODE) { // open parenthesis\n\t\t\t\t\t\t// `foo`, `bar.baz`\n\t\t\t\t\t\treturn gobbleVariable();\n\t\t\t\t\t} else if (ch === OBRACK_CODE) {\n\t\t\t\t\t\treturn gobbleArray();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tto_check = expr.substr(index, max_unop_len);\n\t\t\t\t\t\ttc_len = to_check.length;\n\t\t\t\t\t\twhile(tc_len > 0) {\n\t\t\t\t\t\t\tif(unary_ops.hasOwnProperty(to_check)) {\n\t\t\t\t\t\t\t\tindex += tc_len;\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\ttype: UNARY_EXP,\n\t\t\t\t\t\t\t\t\toperator: to_check,\n\t\t\t\t\t\t\t\t\targument: gobbleToken(),\n\t\t\t\t\t\t\t\t\tprefix: true\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tto_check = to_check.substr(0, --tc_len);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t// Parse simple numeric literals: `12`, `3.4`, `.5`. Do this by using a string to\n\t\t\t\t// keep track of everything in the numeric literal and then calling `parseFloat` on that string\n\t\t\t\tgobbleNumericLiteral = function() {\n\t\t\t\t\tvar number = '', ch, chCode;\n\t\t\t\t\twhile(isDecimalDigit(exprICode(index))) {\n\t\t\t\t\t\tnumber += exprI(index++);\n\t\t\t\t\t}\n\n\t\t\t\t\tif(exprICode(index) === PERIOD_CODE) { // can start with a decimal marker\n\t\t\t\t\t\tnumber += exprI(index++);\n\n\t\t\t\t\t\twhile(isDecimalDigit(exprICode(index))) {\n\t\t\t\t\t\t\tnumber += exprI(index++);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tch = exprI(index);\n\t\t\t\t\tif(ch === 'e' || ch === 'E') { // exponent marker\n\t\t\t\t\t\tnumber += exprI(index++);\n\t\t\t\t\t\tch = exprI(index);\n\t\t\t\t\t\tif(ch === '+' || ch === '-') { // exponent sign\n\t\t\t\t\t\t\tnumber += exprI(index++);\n\t\t\t\t\t\t}\n\t\t\t\t\t\twhile(isDecimalDigit(exprICode(index))) { //exponent itself\n\t\t\t\t\t\t\tnumber += exprI(index++);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!isDecimalDigit(exprICode(index-1)) ) {\n\t\t\t\t\t\t\tthrowError('Expected exponent (' + number + exprI(index) + ')', index);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\n\t\t\t\t\tchCode = exprICode(index);\n\t\t\t\t\t// Check to make sure this isn't a variable name that start with a number (123abc)\n\t\t\t\t\tif(isIdentifierStart(chCode)) {\n\t\t\t\t\t\tthrowError('Variable names cannot start with a number (' +\n\t\t\t\t\t\t\t\t\tnumber + exprI(index) + ')', index);\n\t\t\t\t\t} else if(chCode === PERIOD_CODE) {\n\t\t\t\t\t\tthrowError('Unexpected period', index);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttype: LITERAL,\n\t\t\t\t\t\tvalue: parseFloat(number),\n\t\t\t\t\t\traw: number\n\t\t\t\t\t};\n\t\t\t\t},\n\n\t\t\t\t// Parses a string literal, staring with single or double quotes with basic support for escape codes\n\t\t\t\t// e.g. `\"hello world\"`, `'this is\\nJSEP'`\n\t\t\t\tgobbleStringLiteral = function() {\n\t\t\t\t\tvar str = '', quote = exprI(index++), closed = false, ch;\n\n\t\t\t\t\twhile(index < length) {\n\t\t\t\t\t\tch = exprI(index++);\n\t\t\t\t\t\tif(ch === quote) {\n\t\t\t\t\t\t\tclosed = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} else if(ch === '\\\\') {\n\t\t\t\t\t\t\t// Check for all of the common escape codes\n\t\t\t\t\t\t\tch = exprI(index++);\n\t\t\t\t\t\t\tswitch(ch) {\n\t\t\t\t\t\t\t\tcase 'n': str += '\\n'; break;\n\t\t\t\t\t\t\t\tcase 'r': str += '\\r'; break;\n\t\t\t\t\t\t\t\tcase 't': str += '\\t'; break;\n\t\t\t\t\t\t\t\tcase 'b': str += '\\b'; break;\n\t\t\t\t\t\t\t\tcase 'f': str += '\\f'; break;\n\t\t\t\t\t\t\t\tcase 'v': str += '\\x0B'; break;\n\t\t\t\t\t\t\t\tdefault : str += '\\\\' + ch;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tstr += ch;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif(!closed) {\n\t\t\t\t\t\tthrowError('Unclosed quote after \"'+str+'\"', index);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttype: LITERAL,\n\t\t\t\t\t\tvalue: str,\n\t\t\t\t\t\traw: quote + str + quote\n\t\t\t\t\t};\n\t\t\t\t},\n\n\t\t\t\t// Gobbles only identifiers\n\t\t\t\t// e.g.: `foo`, `_value`, `$x1`\n\t\t\t\t// Also, this function checks if that identifier is a literal:\n\t\t\t\t// (e.g. `true`, `false`, `null`) or `this`\n\t\t\t\tgobbleIdentifier = function() {\n\t\t\t\t\tvar ch = exprICode(index), start = index, identifier;\n\n\t\t\t\t\tif(isIdentifierStart(ch)) {\n\t\t\t\t\t\tindex++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrowError('Unexpected ' + exprI(index), index);\n\t\t\t\t\t}\n\n\t\t\t\t\twhile(index < length) {\n\t\t\t\t\t\tch = exprICode(index);\n\t\t\t\t\t\tif(isIdentifierPart(ch)) {\n\t\t\t\t\t\t\tindex++;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tidentifier = expr.slice(start, index);\n\n\t\t\t\t\tif(literals.hasOwnProperty(identifier)) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\ttype: LITERAL,\n\t\t\t\t\t\t\tvalue: literals[identifier],\n\t\t\t\t\t\t\traw: identifier\n\t\t\t\t\t\t};\n\t\t\t\t\t} else if(identifier === this_str) {\n\t\t\t\t\t\treturn { type: THIS_EXP };\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\ttype: IDENTIFIER,\n\t\t\t\t\t\t\tname: identifier\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\t\t// Gobbles a list of arguments within the context of a function call\n\t\t\t\t// or array literal. This function also assumes that the opening character\n\t\t\t\t// `(` or `[` has already been gobbled, and gobbles expressions and commas\n\t\t\t\t// until the terminator character `)` or `]` is encountered.\n\t\t\t\t// e.g. `foo(bar, baz)`, `my_func()`, or `[bar, baz]`\n\t\t\t\tgobbleArguments = function(termination) {\n\t\t\t\t\tvar ch_i, args = [], node, closed = false;\n\t\t\t\t\twhile(index < length) {\n\t\t\t\t\t\tgobbleSpaces();\n\t\t\t\t\t\tch_i = exprICode(index);\n\t\t\t\t\t\tif(ch_i === termination) { // done parsing\n\t\t\t\t\t\t\tclosed = true;\n\t\t\t\t\t\t\tindex++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} else if (ch_i === COMMA_CODE) { // between expressions\n\t\t\t\t\t\t\tindex++;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tnode = gobbleExpression();\n\t\t\t\t\t\t\tif(!node || node.type === COMPOUND) {\n\t\t\t\t\t\t\t\tthrowError('Expected comma', index);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\targs.push(node);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!closed) {\n\t\t\t\t\t\tthrowError('Expected ' + String.fromCharCode(termination), index);\n\t\t\t\t\t}\n\t\t\t\t\treturn args;\n\t\t\t\t},\n\n\t\t\t\t// Gobble a non-literal variable name. This variable name may include properties\n\t\t\t\t// e.g. `foo`, `bar.baz`, `foo['bar'].baz`\n\t\t\t\t// It also gobbles function calls:\n\t\t\t\t// e.g. `Math.acos(obj.angle)`\n\t\t\t\tgobbleVariable = function() {\n\t\t\t\t\tvar ch_i, node;\n\t\t\t\t\tch_i = exprICode(index);\n\n\t\t\t\t\tif(ch_i === OPAREN_CODE) {\n\t\t\t\t\t\tnode = gobbleGroup();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnode = gobbleIdentifier();\n\t\t\t\t\t}\n\t\t\t\t\tgobbleSpaces();\n\t\t\t\t\tch_i = exprICode(index);\n\t\t\t\t\twhile(ch_i === PERIOD_CODE || ch_i === OBRACK_CODE || ch_i === OPAREN_CODE) {\n\t\t\t\t\t\tindex++;\n\t\t\t\t\t\tif(ch_i === PERIOD_CODE) {\n\t\t\t\t\t\t\tgobbleSpaces();\n\t\t\t\t\t\t\tnode = {\n\t\t\t\t\t\t\t\ttype: MEMBER_EXP,\n\t\t\t\t\t\t\t\tcomputed: false,\n\t\t\t\t\t\t\t\tobject: node,\n\t\t\t\t\t\t\t\tproperty: gobbleIdentifier()\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t} else if(ch_i === OBRACK_CODE) {\n\t\t\t\t\t\t\tnode = {\n\t\t\t\t\t\t\t\ttype: MEMBER_EXP,\n\t\t\t\t\t\t\t\tcomputed: true,\n\t\t\t\t\t\t\t\tobject: node,\n\t\t\t\t\t\t\t\tproperty: gobbleExpression()\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tgobbleSpaces();\n\t\t\t\t\t\t\tch_i = exprICode(index);\n\t\t\t\t\t\t\tif(ch_i !== CBRACK_CODE) {\n\t\t\t\t\t\t\t\tthrowError('Unclosed [', index);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tindex++;\n\t\t\t\t\t\t} else if(ch_i === OPAREN_CODE) {\n\t\t\t\t\t\t\t// A function call is being made; gobble all the arguments\n\t\t\t\t\t\t\tnode = {\n\t\t\t\t\t\t\t\ttype: CALL_EXP,\n\t\t\t\t\t\t\t\t'arguments': gobbleArguments(CPAREN_CODE),\n\t\t\t\t\t\t\t\tcallee: node\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\tgobbleSpaces();\n\t\t\t\t\t\tch_i = exprICode(index);\n\t\t\t\t\t}\n\t\t\t\t\treturn node;\n\t\t\t\t},\n\n\t\t\t\t// Responsible for parsing a group of things within parentheses `()`\n\t\t\t\t// This function assumes that it needs to gobble the opening parenthesis\n\t\t\t\t// and then tries to gobble everything within that parenthesis, assuming\n\t\t\t\t// that the next thing it should see is the close parenthesis. If not,\n\t\t\t\t// then the expression probably doesn't have a `)`\n\t\t\t\tgobbleGroup = function() {\n\t\t\t\t\tindex++;\n\t\t\t\t\tvar node = gobbleExpression();\n\t\t\t\t\tgobbleSpaces();\n\t\t\t\t\tif(exprICode(index) === CPAREN_CODE) {\n\t\t\t\t\t\tindex++;\n\t\t\t\t\t\treturn node;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrowError('Unclosed (', index);\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\t\t// Responsible for parsing Array literals `[1, 2, 3]`\n\t\t\t\t// This function assumes that it needs to gobble the opening bracket\n\t\t\t\t// and then tries to gobble the expressions as arguments.\n\t\t\t\tgobbleArray = function() {\n\t\t\t\t\tindex++;\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttype: ARRAY_EXP,\n\t\t\t\t\t\telements: gobbleArguments(CBRACK_CODE)\n\t\t\t\t\t};\n\t\t\t\t},\n\n\t\t\t\tnodes = [], ch_i, node;\n\n\t\t\twhile(index < length) {\n\t\t\t\tch_i = exprICode(index);\n\n\t\t\t\t// Expressions can be separated by semicolons, commas, or just inferred without any\n\t\t\t\t// separators\n\t\t\t\tif(ch_i === SEMCOL_CODE || ch_i === COMMA_CODE) {\n\t\t\t\t\tindex++; // ignore separators\n\t\t\t\t} else {\n\t\t\t\t\t// Try to gobble each expression individually\n\t\t\t\t\tif((node = gobbleExpression())) {\n\t\t\t\t\t\tnodes.push(node);\n\t\t\t\t\t// If we weren't able to find a binary expression and are out of room, then\n\t\t\t\t\t// the expression passed in probably has too much\n\t\t\t\t\t} else if(index < length) {\n\t\t\t\t\t\tthrowError('Unexpected \"' + exprI(index) + '\"', index);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If there's only one expression just try returning the expression\n\t\t\tif(nodes.length === 1) {\n\t\t\t\treturn nodes[0];\n\t\t\t} else {\n\t\t\t\treturn {\n\t\t\t\t\ttype: COMPOUND,\n\t\t\t\t\tbody: nodes\n\t\t\t\t};\n\t\t\t}\n\t\t};\n\n\t// To be filled in by the template\n\tjsep.version = '<%= version %>';\n\tjsep.toString = function() { return 'JavaScript Expression Parser (JSEP) v' + jsep.version; };\n\n\t/**\n\t * @method jsep.addUnaryOp\n\t * @param {string} op_name The name of the unary op to add\n\t * @return jsep\n\t */\n\tjsep.addUnaryOp = function(op_name) {\n\t\tmax_unop_len = Math.max(op_name.length, max_unop_len);\n\t\tunary_ops[op_name] = t; return this;\n\t};\n\n\t/**\n\t * @method jsep.addBinaryOp\n\t * @param {string} op_name The name of the binary op to add\n\t * @param {number} precedence The precedence of the binary op (can be a float)\n\t * @return jsep\n\t */\n\tjsep.addBinaryOp = function(op_name, precedence) {\n\t\tmax_binop_len = Math.max(op_name.length, max_binop_len);\n\t\tbinary_ops[op_name] = precedence;\n\t\treturn this;\n\t};\n\n\t/**\n\t * @method jsep.addLiteral\n\t * @param {string} literal_name The name of the literal to add\n\t * @param {*} literal_value The value of the literal\n\t * @return jsep\n\t */\n\tjsep.addLiteral = function(literal_name, literal_value) {\n\t\tliterals[literal_name] = literal_value;\n\t\treturn this;\n\t};\n\n\t/**\n\t * @method jsep.removeUnaryOp\n\t * @param {string} op_name The name of the unary op to remove\n\t * @return jsep\n\t */\n\tjsep.removeUnaryOp = function(op_name) {\n\t\tdelete unary_ops[op_name];\n\t\tif(op_name.length === max_unop_len) {\n\t\t\tmax_unop_len = getMaxKeyLen(unary_ops);\n\t\t}\n\t\treturn this;\n\t};\n\n\t/**\n\t * @method jsep.removeAllUnaryOps\n\t * @return jsep\n\t */\n\tjsep.removeAllUnaryOps = function() {\n\t\tunary_ops = {};\n\t\tmax_unop_len = 0;\n\t\t\n\t\treturn this;\n\t};\n\n\t/**\n\t * @method jsep.removeBinaryOp\n\t * @param {string} op_name The name of the binary op to remove\n\t * @return jsep\n\t */\n\tjsep.removeBinaryOp = function(op_name) {\n\t\tdelete binary_ops[op_name];\n\t\tif(op_name.length === max_binop_len) {\n\t\t\tmax_binop_len = getMaxKeyLen(binary_ops);\n\t\t}\n\t\treturn this;\n\t};\n\n\t/**\n\t * @method jsep.removeAllBinaryOps\n\t * @return jsep\n\t */\n\tjsep.removeAllBinaryOps = function() {\n\t\tbinary_ops = {};\n\t\tmax_binop_len = 0;\n\t\t\n\t\treturn this;\n\t};\n\n\t/**\n\t * @method jsep.removeLiteral\n\t * @param {string} literal_name The name of the literal to remove\n\t * @return jsep\n\t */\n\tjsep.removeLiteral = function(literal_name) {\n\t\tdelete literals[literal_name];\n\t\treturn this;\n\t};\n\n\t/**\n\t * @method jsep.removeAllLiterals\n\t * @return jsep\n\t */\n\tjsep.removeAllLiterals = function() {\n\t\tliterals = {};\n\t\t\n\t\treturn this;\n\t};\n\n\t// In desktop environments, have a way to restore the old value for `jsep`\n\tif (typeof exports === 'undefined') {\n\t\tvar old_jsep = root.jsep;\n\t\t// The star of the show! It's a function!\n\t\troot.jsep = jsep;\n\t\t// And a courteous function willing to move out of the way for other similarly-named objects!\n\t\tjsep.noConflict = function() {\n\t\t\tif(root.jsep === jsep) {\n\t\t\t\troot.jsep = old_jsep;\n\t\t\t}\n\t\t\treturn jsep;\n\t\t};\n\t} else {\n\t\t// In Node.JS environments\n\t\tif (typeof module !== 'undefined' && module.exports) {\n\t\t\texports = module.exports = jsep;\n\t\t} else {\n\t\t\texports.parse = jsep;\n\t\t}\n\t}\n}(this));\n",
|
|
82
|
+
"'use strict';\n\nvar utils = require('./utils');\n\nmodule.exports = function makeJuiceClient(juiceClient) {\n\njuiceClient.ignoredPseudos = ['hover', 'active', 'focus', 'visited', 'link'];\njuiceClient.widthElements = ['TABLE', 'TD', 'IMG'];\njuiceClient.heightElements = ['TABLE', 'TD', 'IMG'];\njuiceClient.tableElements = ['TABLE', 'TD', 'TH', 'TR', 'TD', 'CAPTION', 'COLGROUP', 'COL', 'THEAD', 'TBODY', 'TFOOT'];\njuiceClient.nonVisualElements = [ 'HEAD', 'TITLE', 'BASE', 'LINK', 'STYLE', 'META', 'SCRIPT', 'NOSCRIPT' ];\njuiceClient.styleToAttribute = {\n 'background-color': 'bgcolor',\n 'background-image': 'background',\n 'text-align': 'align',\n 'vertical-align': 'valign'\n};\njuiceClient.excludedProperties = [];\n\njuiceClient.juiceDocument = juiceDocument;\njuiceClient.inlineDocument = inlineDocument;\n\nfunction inlineDocument($, css, options) {\n\n options = options || {};\n var rules = utils.parseCSS(css);\n var editedElements = [];\n var styleAttributeName = 'style';\n \n if (options.styleAttributeName) {\n styleAttributeName = options.styleAttributeName;\n }\n\n rules.forEach(handleRule);\n editedElements.forEach(setStyleAttrs);\n\n if (options.inlinePseudoElements) {\n editedElements.forEach(inlinePseudoElements);\n }\n\n if (options.applyWidthAttributes) {\n editedElements.forEach(function(el) {\n setDimensionAttrs(el, 'width');\n });\n }\n\n if (options.applyHeightAttributes) {\n editedElements.forEach(function(el) {\n setDimensionAttrs(el, 'height');\n });\n }\n\n if (options.applyAttributesTableElements) {\n editedElements.forEach(setAttributesOnTableElements);\n }\n\n if (options.insertPreservedExtraCss && options.extraCss) {\n var preservedText = utils.getPreservedText(options.extraCss, {\n mediaQueries: options.preserveMediaQueries,\n fontFaces: options.preserveFontFaces\n });\n if (preservedText) {\n var $appendTo = null;\n if (options.insertPreservedExtraCss !== true) {\n $appendTo = $(options.insertPreservedExtraCss);\n } else {\n $appendTo = $('head');\n if (!$appendTo.length) { $appendTo = $('body'); }\n if (!$appendTo.length) { $appendTo = $.root(); }\n }\n\n $appendTo.first().append('<style>' + preservedText + '</style>');\n }\n }\n\n function handleRule(rule) {\n var sel = rule[0];\n var style = rule[1];\n var selector = new utils.Selector(sel);\n var parsedSelector = selector.parsed();\n var pseudoElementType = getPseudoElementType(parsedSelector);\n\n // skip rule if the selector has any pseudos which are ignored\n for (var i = 0; i < parsedSelector.length; ++i) {\n var subSel = parsedSelector[i];\n if (subSel.pseudos) {\n for (var j = 0; j < subSel.pseudos.length; ++j) {\n var subSelPseudo = subSel.pseudos[j];\n if (juiceClient.ignoredPseudos.indexOf(subSelPseudo.name) >= 0) {\n return;\n }\n }\n }\n }\n\n if (pseudoElementType) {\n var last = parsedSelector[parsedSelector.length - 1];\n var pseudos = last.pseudos;\n last.pseudos = filterElementPseudos(last.pseudos);\n sel = parsedSelector.toString();\n last.pseudos = pseudos;\n }\n\n var els;\n try {\n els = $(sel);\n } catch (err) {\n // skip invalid selector\n return;\n }\n\n els.each(function() {\n var el = this;\n\n if (el.name && juiceClient.nonVisualElements.indexOf(el.name.toUpperCase()) >= 0) {\n return;\n }\n\n if (pseudoElementType) {\n var pseudoElPropName = 'pseudo' + pseudoElementType;\n var pseudoEl = el[pseudoElPropName];\n if (!pseudoEl) {\n pseudoEl = el[pseudoElPropName] = $('<span />').get(0);\n pseudoEl.pseudoElementType = pseudoElementType;\n pseudoEl.pseudoElementParent = el;\n el[pseudoElPropName] = pseudoEl;\n }\n el = pseudoEl;\n }\n\n if (!el.styleProps) {\n el.styleProps = {};\n\n // if the element has inline styles, fake selector with topmost specificity\n if ($(el).attr(styleAttributeName)) {\n var cssText = '* { ' + $(el).attr(styleAttributeName) + ' } ';\n addProps(utils.parseCSS(cssText)[0][1], new utils.Selector('<style>', true));\n }\n\n // store reference to an element we need to compile style=\"\" attr for\n editedElements.push(el);\n }\n\n // go through the properties\n function addProps(style, selector) {\n for (var i = 0, l = style.length; i < l; i++) {\n if (style[i].type == 'property') {\n var name = style[i].name;\n var value = style[i].value;\n var important = style[i].value.match(/!important$/) !== null;\n if (important && !options.preserveImportant) value = value.replace(/\\s*!important$/, '');\n // adds line number and column number for the properties as \"additionalPriority\" to the \n // properties because in CSS the position directly affect the priority.\n var additionalPriority = [style[i].position.start.line, style[i].position.start.col];\n var prop = new utils.Property(name, value, selector, important ? 2 : 0, additionalPriority);\n var existing = el.styleProps[name];\n\n // if property name is not in the excluded properties array\n if (juiceClient.excludedProperties.indexOf(name) < 0) {\n if (existing && existing.compare(prop) === prop || !existing) {\n // deleting a property let us change the order (move it to the end in the setStyleAttrs loop)\n if (existing && existing.selector !== selector) {\n delete el.styleProps[name];\n } else if (existing) {\n // make \"prop\" a special composed property.\n prop.nextProp = existing;\n }\n\n el.styleProps[name] = prop;\n }\n }\n }\n }\n }\n\n addProps(style, selector);\n });\n }\n\n function setStyleAttrs(el) {\n var l = Object.keys(el.styleProps).length;\n var props = [];\n // Here we loop each property and make sure to \"expand\"\n // linked \"nextProp\" properties happening when the same property\n // is declared multiple times in the same selector.\n Object.keys(el.styleProps).forEach(function(key) {\n var np = el.styleProps[key];\n while (typeof np !== 'undefined') {\n props.push(np);\n np = np.nextProp;\n }\n });\n // sort properties by their originating selector's specificity so that\n // props like \"padding\" and \"padding-bottom\" are resolved as expected.\n props.sort(function(a, b) {\n return a.compareFunc(b);\n });\n var string = props\n .filter(function(prop) {\n // Content becomes the innerHTML of pseudo elements, not used as a\n // style property\n return prop.prop !== 'content';\n })\n .map(function(prop) {\n return prop.prop + ': ' + prop.value.replace(/[\"]/g, '\\'') + ';';\n })\n .join(' ');\n if (string) {\n $(el).attr(styleAttributeName, string);\n }\n }\n\n function inlinePseudoElements(el) {\n if (el.pseudoElementType && el.styleProps.content) {\n var parsed = parseContent(el.styleProps.content.value);\n if (parsed.img) {\n el.name = 'img';\n $(el).attr('src', parsed.img);\n } else {\n $(el).text(parsed);\n }\n var parent = el.pseudoElementParent;\n if (el.pseudoElementType === 'before') {\n $(parent).prepend(el);\n } else {\n $(parent).append(el);\n }\n }\n }\n\n function setDimensionAttrs(el, dimension) {\n if (!el.name) { return; }\n var elName = el.name.toUpperCase();\n if (juiceClient[dimension + 'Elements'].indexOf(elName) > -1) {\n for (var i in el.styleProps) {\n if (el.styleProps[i].prop === dimension) {\n if (el.styleProps[i].value.match(/px/)) {\n var pxSize = el.styleProps[i].value.replace('px', '');\n $(el).attr(dimension, pxSize);\n return;\n }\n if (juiceClient.tableElements.indexOf(elName) > -1 && el.styleProps[i].value.match(/\\%/)) {\n $(el).attr(dimension, el.styleProps[i].value);\n return;\n }\n }\n }\n }\n }\n\n function setAttributesOnTableElements(el) {\n if (!el.name) { return; }\n var elName = el.name.toUpperCase();\n var styleProps = Object.keys(juiceClient.styleToAttribute);\n\n if (juiceClient.tableElements.indexOf(elName) > -1) {\n for (var i in el.styleProps) {\n if (styleProps.indexOf(el.styleProps[i].prop) > -1) {\n $(el).attr(juiceClient.styleToAttribute[el.styleProps[i].prop], el.styleProps[i].value);\n }\n }\n }\n }\n}\n\nfunction parseContent(content) {\n if (content === 'none' || content === 'normal') {\n return '';\n }\n\n var imageUrlMatch = content.match(/^\\s*url\\s*\\(\\s*(.*?)\\s*\\)\\s*$/i);\n if (imageUrlMatch) {\n var url = imageUrlMatch[1].replace(/^['\"]|['\"]$/g, '');\n return { img: url };\n }\n\n // Naive parsing, assume well-formed value\n content = content.slice(1, content.length - 1);\n // Naive unescape, assume no unicode char codes\n content = content.replace(/\\\\/g, '');\n return content;\n}\n\n// Return \"before\" or \"after\" if the given selector is a pseudo element (e.g.,\n// a::after).\nfunction getPseudoElementType(selector) {\n if (selector.length === 0) {\n return;\n }\n\n var pseudos = selector[selector.length - 1].pseudos;\n if (!pseudos) {\n return;\n }\n\n for (var i = 0; i < pseudos.length; i++) {\n if (isPseudoElementName(pseudos[i])) {\n return pseudos[i].name;\n }\n }\n}\n\nfunction isPseudoElementName(pseudo) {\n return pseudo.name === 'before' || pseudo.name === 'after';\n}\n\nfunction filterElementPseudos(pseudos) {\n return pseudos.filter(function(pseudo) {\n return !isPseudoElementName(pseudo);\n });\n}\n\nfunction juiceDocument($, options) {\n options = utils.getDefaultOptions(options);\n var css = extractCssFromDocument($, options);\n css += '\\n' + options.extraCss;\n inlineDocument($, css, options);\n return $;\n}\n\nfunction getStylesData($, options) {\n var results = [];\n var stylesList = $('style');\n var styleDataList, styleData, styleElement;\n stylesList.each(function() {\n styleElement = this;\n styleDataList = styleElement.childNodes;\n if (styleDataList.length !== 1) {\n return;\n }\n styleData = styleDataList[0].data;\n if (options.applyStyleTags && $(styleElement).attr('data-embed') === undefined) {\n results.push(styleData);\n }\n if (options.removeStyleTags && $(styleElement).attr('data-embed') === undefined) {\n var preservedText = utils.getPreservedText(styleElement.childNodes[0].nodeValue, {\n mediaQueries: options.preserveMediaQueries,\n fontFaces: options.preserveFontFaces\n });\n if (preservedText) {\n styleElement.childNodes[0].nodeValue = preservedText;\n } else {\n $(styleElement).remove();\n }\n }\n $(styleElement).removeAttr('data-embed');\n });\n return results;\n}\n\nfunction extractCssFromDocument($, options) {\n var results = getStylesData($, options);\n var css = results.join('\\n');\n return css;\n}\n\nreturn juiceClient;\n\n};",
|
|
83
|
+
"'use strict';\n\nmodule.exports = exports = Property;\n\n/**\n * Module dependencies.\n */\n\nvar utils = require('./utils');\n\n/**\n * CSS property constructor.\n *\n * @param {String} property\n * @param {String} value\n * @param {Selector} selector the property originates from\n * @param {Integer} priority 0 for normal properties, 2 for !important properties.\n * @param {Array} additional array of integers representing more detailed priorities (sorting)\n * @api public\n */\n\nfunction Property(prop, value, selector, priority, additionalPriority) {\n this.prop = prop;\n this.value = value;\n this.selector = selector;\n this.priority = priority || 0;\n this.additionalPriority = additionalPriority || [];\n}\n\n/**\n * Compares with another Property based on Selector#specificity.\n *\n * @api public\n */\n\nProperty.prototype.compareFunc = function(property) {\n var a = [];\n a.push.apply(a, this.selector.specificity());\n a.push.apply(a, this.additionalPriority);\n a[0] += this.priority;\n var b = [];\n b.push.apply(b, property.selector.specificity());\n b.push.apply(b, property.additionalPriority);\n b[0] += property.priority;\n return utils.compareFunc(a, b);\n};\n\nProperty.prototype.compare = function(property) {\n var winner = this.compareFunc(property);\n if (winner === 1) return this;\n return property;\n};\n\n\n/**\n * Returns CSS property\n *\n * @api public\n */\n\nProperty.prototype.toString = function() {\n return this.prop + ': ' + this.value.replace(/['\"]+/g, '') + ';';\n};\n",
|
|
84
|
+
"'use strict';\n\nvar parser = require('slick/parser');\n\nmodule.exports = exports = Selector;\n\n/**\n * CSS selector constructor.\n *\n * @param {String} selector text\n * @param {Array} optionally, precalculated specificity\n * @api public\n */\n\nfunction Selector(text, styleAttribute) {\n this.text = text;\n this.spec = undefined;\n this.styleAttribute = styleAttribute || false;\n}\n\n/**\n * Get parsed selector.\n *\n * @api public\n */\n\nSelector.prototype.parsed = function() {\n if (!this.tokens) { this.tokens = parse(this.text); }\n return this.tokens;\n};\n\n/**\n * Lazy specificity getter\n *\n * @api public\n */\n\nSelector.prototype.specificity = function() {\n var styleAttribute = this.styleAttribute;\n if (!this.spec) { this.spec = specificity(this.text, this.parsed()); }\n return this.spec;\n\n function specificity(text, parsed) {\n var expressions = parsed || parse(text);\n var spec = [styleAttribute ? 1 : 0, 0, 0, 0];\n var nots = [];\n\n for (var i = 0; i < expressions.length; i++) {\n var expression = expressions[i];\n var pseudos = expression.pseudos;\n\n // id awards a point in the second column\n if (expression.id) { spec[1]++; }\n\n // classes and attributes award a point each in the third column\n if (expression.attributes) { spec[2] += expression.attributes.length; }\n if (expression.classList) { spec[2] += expression.classList.length; }\n\n // tag awards a point in the fourth column\n if (expression.tag && expression.tag !== '*') { spec[3]++; }\n\n // pseudos award a point each in the fourth column\n if (pseudos) {\n spec[3] += pseudos.length;\n\n for (var p = 0; p < pseudos.length; p++) {\n if (pseudos[p].name === 'not') {\n nots.push(pseudos[p].value);\n spec[3]--;\n }\n }\n }\n }\n\n for (var ii = nots.length; ii--;) {\n var not = specificity(nots[ii]);\n for (var jj = 4; jj--;) { spec[jj] += not[jj]; }\n }\n\n return spec;\n }\n};\n\n/**\n * Parses a selector and returns the tokens.\n *\n * @param {String} selector\n * @api private.\n */\n\nfunction parse(text) {\n try {\n return parser(text)[0];\n } catch (e) {\n return [];\n }\n}\n",
|
|
85
|
+
"'use strict';\n\n/**\n * Module dependencies.\n */\n\nvar mensch = require('mensch');\nvar own = {}.hasOwnProperty;\nvar os = require('os');\nvar Selector = require('./selector');\nvar Property = require('./property');\n\nexports.Selector = Selector;\nexports.Property = Property;\n\n/**\n * Returns an array of the selectors.\n *\n * @license Sizzle CSS Selector Engine - MIT\n * @param {String} selectorText from mensch\n * @api public\n */\n\nexports.extract = function extract(selectorText) {\n var attr = 0;\n var sels = [];\n var sel = '';\n\n for (var i = 0, l = selectorText.length; i < l; i++) {\n var c = selectorText.charAt(i);\n\n if (attr) {\n if (']' === c || ')' === c) { attr--; }\n sel += c;\n } else {\n if (',' === c) {\n sels.push(sel);\n sel = '';\n } else {\n if ('[' === c || '(' === c) { attr++; }\n if (sel.length || (c !== ',' && c !== '\\n' && c !== ' ')) { sel += c; }\n }\n }\n }\n\n if (sel.length) {\n sels.push(sel);\n }\n\n return sels;\n};\n\n/**\n * Returns a parse tree for a CSS source.\n * If it encounters multiple selectors separated by a comma, it splits the\n * tree.\n *\n * @param {String} css source\n * @api public\n */\n\nexports.parseCSS = function(css) {\n var parsed = mensch.parse(css, {position: true, comments: true});\n var rules = typeof parsed.stylesheet != 'undefined' && parsed.stylesheet.rules ? parsed.stylesheet.rules : [];\n var ret = [];\n\n for (var i = 0, l = rules.length; i < l; i++) {\n if (rules[i].type == 'rule') {\n var rule = rules[i];\n var selectors = rule.selectors;\n\n for (var ii = 0, ll = selectors.length; ii < ll; ii++) {\n ret.push([selectors[ii], rule.declarations]);\n }\n }\n }\n\n return ret;\n};\n\n/**\n * Returns preserved text for a CSS source.\n *\n * @param {String} css source\n * @param {Object} options\n * @api public\n */\n\nexports.getPreservedText = function(css, options) {\n var parsed = mensch.parse(css, {position: true, comments: true});\n var rules = typeof parsed.stylesheet != 'undefined' && parsed.stylesheet.rules ? parsed.stylesheet.rules : [];\n var preserved = [];\n var lastStart = null;\n\n for (var i = rules.length - 1; i >= 0; i--) {\n if ((options.fontFaces && rules[i].type === 'font-face') ||\n (options.mediaQueries && rules[i].type === 'media')) {\n preserved.push(\n mensch.stringify(\n { stylesheet: { rules: [ rules[i] ] }},\n { comments: false, indentation: ' ' }\n )\n );\n }\n lastStart = rules[i].position.start;\n }\n\n if (preserved.length === 0) return false;\n return os.EOL+preserved.join(os.EOL)+os.EOL;\n};\n\nexports.normalizeLineEndings = function(text) {\n return text.replace(/\\r\\n/g, '\\n').replace(/\\n/g, '\\r\\n');\n};\n\n\n/**\n * Compares two specificity vectors, returning the winning one.\n *\n * @param {Array} vector a\n * @param {Array} vector b\n * @return {Array}\n * @api public\n */\n\nexports.compareFunc = function(a, b) {\n var min = Math.min(a.length, b.length);\n for (var i = 0; i < min; i++) {\n if (a[i] === b[i]) { continue; }\n if (a[i] > b[i]) { return 1; }\n return -1;\n }\n\n return a.length-b.length;\n};\n\nexports.compare = function(a, b) {\n return exports.compareFunc(a, b) == 1 ? a : b;\n};\n\nexports.extend = function(obj, src) {\n for (var key in src) {\n if (own.call(src, key)) {\n obj[key] = src[key];\n }\n }\n return obj;\n};\n\nexports.getDefaultOptions = function(options) {\n var result = exports.extend({\n extraCss: '',\n insertPreservedExtraCss: true,\n applyStyleTags: true,\n removeStyleTags: true,\n preserveMediaQueries: true,\n preserveFontFaces: true,\n applyWidthAttributes: true,\n applyHeightAttributes: true,\n applyAttributesTableElements: true,\n url: ''\n }, options);\n\n result.webResources = result.webResources || {};\n\n return result;\n};\n",
|
|
86
|
+
"// knockout-sortable 0.15.0 | (c) 2016 Ryan Niemeyer | http://www.opensource.org/licenses/mit-license\n!function(a){if(\"function\"==typeof define&&define.amd)define([\"knockout\",\"jquery\",\"jquery-ui/sortable\",\"jquery-ui/draggable\"],a);else if(\"function\"==typeof require&&\"object\"==typeof exports&&\"object\"==typeof module){var b=require(\"knockout\"),c=require(\"jquery\");require(\"jquery-ui/sortable\"),require(\"jquery-ui/draggable\"),a(b,c)}else a(window.ko,window.jQuery)}(function(a,b){var c=\"ko_sortItem\",d=\"ko_sourceIndex\",e=\"ko_sortList\",f=\"ko_parentList\",g=\"ko_dragItem\",h=a.utils.unwrapObservable,i=a.utils.domData.get,j=a.utils.domData.set,k=b.ui&&b.ui.version,l=k&&k.indexOf(\"1.6.\")&&k.indexOf(\"1.7.\")&&(k.indexOf(\"1.8.\")||\"1.8.24\"===k),m=function(b,d){a.utils.arrayForEach(b,function(a){1===a.nodeType&&(j(a,c,d),j(a,f,i(a.parentNode,e)))})},n=function(b,c){var d,e={},f=h(b())||{};return f.data?(e[c]=f.data,e.name=f.template):e[c]=b(),a.utils.arrayForEach([\"afterAdd\",\"afterRender\",\"as\",\"beforeRemove\",\"includeDestroyed\",\"templateEngine\",\"templateOptions\",\"nodes\"],function(b){f.hasOwnProperty(b)?e[b]=f[b]:a.bindingHandlers.sortable.hasOwnProperty(b)&&(e[b]=a.bindingHandlers.sortable[b])}),\"foreach\"===c&&(e.afterRender?(d=e.afterRender,e.afterRender=function(a,b){m.call(b,a,b),d.call(b,a,b)}):e.afterRender=m),e},o=function(a,b){var c=h(b);if(c)for(var d=0;a>d;d++)c[d]&&h(c[d]._destroy)&&a++;return a},p=function(c,d){var e,f;d?(f=document.getElementById(d),f&&(e=new a.templateSources.domElement(f),e.text(b.trim(e.text())))):b(c).contents().each(function(){this&&1!==this.nodeType&&c.removeChild(this)})};a.bindingHandlers.sortable={init:function(k,m,q,r,s){var t,u,v=b(k),w=h(m())||{},x=n(m,\"foreach\"),y={};p(k,x.name),b.extend(!0,y,a.bindingHandlers.sortable),w.options&&y.options&&(a.utils.extend(y.options,w.options),delete w.options),a.utils.extend(y,w),y.connectClass&&(a.isObservable(y.allowDrop)||\"function\"==typeof y.allowDrop)?a.computed({read:function(){var b=h(y.allowDrop),c=\"function\"==typeof b?b.call(this,x.foreach):b;a.utils.toggleDomNodeCssClass(k,y.connectClass,c)},disposeWhenNodeIsRemoved:k},this):a.utils.toggleDomNodeCssClass(k,y.connectClass,y.allowDrop),a.bindingHandlers.template.init(k,function(){return x},q,r,s),t=y.options.start,u=y.options.update,y.options.helper||(y.options.helper=function(a,c){return c.is(\"tr\")&&c.children().each(function(){b(this).width(b(this).width())}),c});var z=setTimeout(function(){var m,n=y.options.receive;v.sortable(a.utils.extend(y.options,{start:function(b,c){var e=c.item[0];j(e,d,a.utils.arrayIndexOf(c.item.parent().children(),e)),c.item.find(\"input:focus\").change(),t&&t.apply(this,arguments)},receive:function(a,b){\"function\"==typeof n&&n.call(this,a,b),m=i(b.item[0],g),m&&(m.clone&&(m=m.clone()),y.dragged&&(m=y.dragged.call(this,m,a,b)||m))},update:function(g,k){var n,p,q,r,s,t=k.item[0],v=k.item.parent()[0],w=i(t,c)||m;if(w||b(t).remove(),m=null,w&&this===v||!l&&b.contains(this,v)){if(n=i(t,f),q=i(t,d),p=i(t.parentNode,e),r=a.utils.arrayIndexOf(k.item.parent().children(),t),x.includeDestroyed||(q=o(q,n),r=o(r,p)),(y.beforeMove||y.afterMove)&&(s={item:w,sourceParent:n,sourceParentNode:n&&k.sender||t.parentNode,sourceIndex:q,targetParent:p,targetIndex:r,cancelDrop:!1},y.beforeMove&&y.beforeMove.call(this,s,g,k)),n?b(n===p?this:k.sender||this).sortable(\"cancel\"):b(t).remove(),s&&s.cancelDrop)return;if(y.hasOwnProperty(\"strategyMove\")&&y.strategyMove!==!1){if(r>=0)if(n)if(n!==p)n.splice(q,1),p.splice(r,0,w),j(t,c,null),k.item.remove();else{var z=h(n);n.valueWillMutate&&n.valueWillMutate(),z.splice(q,1),z.splice(r,0,w),n.valueHasMutated&&n.valueHasMutated()}else p.splice(r,0,w),j(t,c,null),k.item.remove()}else r>=0&&(n&&(n.splice(q,1),a.processAllDeferredBindingUpdates&&a.processAllDeferredBindingUpdates(),a.options&&a.options.deferUpdates&&a.tasks.runEarly()),p.splice(r,0,w)),j(t,c,null);a.processAllDeferredBindingUpdates&&a.processAllDeferredBindingUpdates(),y.afterMove&&y.afterMove.call(this,s,g,k)}u&&u.apply(this,arguments)},connectWith:y.connectClass?\".\"+y.connectClass:!1})),void 0!==y.isEnabled&&a.computed({read:function(){v.sortable(h(y.isEnabled)?\"enable\":\"disable\")},disposeWhenNodeIsRemoved:k})},0);return a.utils.domNodeDisposal.addDisposeCallback(k,function(){(v.data(\"ui-sortable\")||v.data(\"sortable\"))&&v.sortable(\"destroy\"),a.utils.toggleDomNodeCssClass(k,y.connectClass,!1),clearTimeout(z)}),{controlsDescendantBindings:!0}},update:function(b,c,d,f,g){var h=n(c,\"foreach\");j(b,e,h.foreach),a.bindingHandlers.template.update(b,function(){return h},d,f,g)},connectClass:\"ko_container\",allowDrop:!0,afterMove:null,beforeMove:null,options:{}},a.bindingHandlers.draggable={init:function(c,d,e,f,i){var k=h(d())||{},l=k.options||{},m=a.utils.extend({},a.bindingHandlers.draggable.options),o=n(d,\"data\"),p=k.connectClass||a.bindingHandlers.draggable.connectClass,q=void 0!==k.isEnabled?k.isEnabled:a.bindingHandlers.draggable.isEnabled;return k=\"data\"in k?k.data:k,j(c,g,k),a.utils.extend(m,l),m.connectToSortable=p?\".\"+p:!1,b(c).draggable(m),void 0!==q&&a.computed({read:function(){b(c).draggable(h(q)?\"enable\":\"disable\")},disposeWhenNodeIsRemoved:c}),a.utils.domNodeDisposal.addDisposeCallback(c,function(){b(c).draggable(\"destroy\")}),a.bindingHandlers.template.init(c,function(){return o},e,f,i)},update:function(b,c,d,e,f){var g=n(c,\"data\");return a.bindingHandlers.template.update(b,function(){return g},d,e,f)},connectClass:a.bindingHandlers.sortable.connectClass,options:{helper:\"clone\"}}});",
|
|
87
|
+
"// Knockout UndoManager v0.2 | (c) 2015 Stefano Bagnara\n// License: MIT (http://www.opensource.org/licenses/mit-license) \n// requires \"ko.watch\" method from knockout.reactor\n(function (factory) {\n // Module systems magic dance.\n if (typeof require === \"function\" && typeof exports === \"object\" && typeof module === \"object\") {\n // CommonJS or Node: hard-coded dependency on \"knockout\"\n module.exports = factory(require(\"knockout\"), require(\"knockoutjs-reactor\"));\n } else if (typeof define === \"function\" && define[\"amd\"]) {\n // AMD anonymous module with hard-coded dependency on \"knockout\"\n define([\"knockout\", \"knockoutjs-reactor\", \"exports\"], factory);\n } else {\n // <script> tag: use the global `ko` object\n factory(ko, ko.watch);\n }\n}(function (ko, reactor) { \n\n /// <summary>\n /// Track last \"levels\" changes within the chained observable down to any given level and\n /// supports undoing/redoing the changes.\n /// </summary>\n /// <param name=\"options\" type=\"object\">\n /// { levels: 2 } -> Remember only last \"levels\" changes<br/>\n /// { undoLabel: \"Undo it (#COUNT)!\" } -> Define a label for the undo command. \"#COUNT#\" sequence will be replaced with the stack length.<br/>\n /// { redoLabel: \"Redo it (#COUNT)!\" } -> Define a label for the redo command. \"#COUNT#\" sequence will be replaced with the stack length.<br/>\n /// </param>\n var undoManager = function (model, options) {\n var undoStack = ko.observableArray();\n var redoStack = ko.observableArray();\n var lastPushedStack;\n var STATE_DOING = 0;\n var STATE_UNDOING = 1;\n var STATE_REDOING = 2;\n var state = STATE_DOING;\n\n var MODE_NORMAL = 0; // add to stack every change\n var MODE_IGNORE = 1; // do not add anything to the stack\n var MODE_ONCE = 2; // only one sequential change for each property is added to the stack\n var MODE_MERGE = 3; // merge next change with the last one\n var mode = MODE_NORMAL;\n\n var defaultOptions = {\n levels: 100,\n undoLabel: \"undo (#COUNT#)\",\n redoLabel: \"redo (#COUNT#)\"\n };\n \n if (typeof options == 'object') {\n options = ko.utils.extend(defaultOptions, options);\n } else {\n options = defaultOptions;\n }\n \n var _push = function (action) {\n // durante UNDO/REDO lavoriamo sempre in normale\n if (state == STATE_UNDOING) {\n _pushInt(action, redoStack);\n } else if (state == STATE_REDOING) {\n _pushInt(action, undoStack);\n } else if (state == STATE_DOING) {\n _pushInt(action, undoStack);\n redoStack.removeAll();\n }\n };\n \n var _tryMerge = function (prev, newAction) {\n if (typeof prev.mergedAction !== 'undefined') {\n return prev.mergedAction(newAction);\n } else return null;\n };\n\n var _pushInt = function (action, myStack) {\n /* gestione del merge di azioni: se l'ultima azione nello stack ha un metodo \"mergedAction\"\n proviamo ad invocarlo e se ci restituisce una funzione la usiamo al posto di entrambe */\n // console.log(\"UR\", \"_pushInt\", myStack().length > 0 ? typeof myStack()[myStack().length - 1].mergedAction : \"EMPTY\");\n if (myStack().length > 0) {\n var merged = _tryMerge(myStack()[myStack().length - 1], action);\n // console.log(\"UR\", \"_pushInt.merged\", merged, \"MV\", typeof action.mergeableMove, \"MA\", typeof action.mergeableAction, \"MM\", typeof action.mergeMe);\n if (merged !== null) {\n myStack()[myStack().length - 1] = merged;\n return;\n }\n }\n if (myStack().length >= options.levels) myStack.shift();\n lastPushedStack = myStack;\n myStack.push(action);\n };\n \n var _xdoCommand = function(label, workState, stack) {\n return {\n name: ko.computed(function() {\n return ko.utils.unwrapObservable(label).replace(/#COUNT#/, stack().length);\n }),\n enabled: ko.computed(function() {\n return stack().length !== 0;\n }),\n execute: function() {\n var action = stack.pop();\n if (action) {\n var prevState = state;\n state = workState;\n var oldMode = mode;\n mode = MODE_MERGE;\n // console.log(\"XDO\", \"before\", label);\n action();\n // console.log(\"XDO\", \"after\", label);\n _removeMergedAction(lastPushedStack);\n mode = oldMode;\n state = prevState;\n }\n return true;\n }\n };\n };\n\n var _removeMergedAction = function(myStack) {\n if (typeof myStack == 'undefined') throw \"Unexpected operation: stack cleaner called with undefined stack\";\n \n if (myStack().length > 0 && typeof myStack()[myStack().length - 1].mergedAction !== 'undefined') {\n // console.log(\"Removing mergedAction from stack\");\n delete myStack()[myStack().length - 1].mergedAction;\n }\n };\n\n var _combinedFunction = function(first, second) {\n var res = (function(f1, f2) {\n f1();\n f2();\n }).bind(undefined, first, second);\n if (typeof first.mergedAction !== 'undefined') {\n res.mergedAction = first.mergedAction;\n }\n return res;\n };\n\n var executeUndoAction = function(child, value, item) {\n // console.log(\"executeUndoAction\", child, value, item);\n if (typeof value !== 'undefined') {\n child(value);\n } else if (item) {\n if (item.status == 'deleted') {\n child.splice(item.index, 0, item.value);\n } else if (item.status == 'added') {\n child.splice(item.index, 1);\n } else {\n throw \"Unsupproted item.status: \"+item.status;\n }\n } else {\n throw \"Unexpected condition: no item and no child.oldValues!\";\n }\n };\n\n var makeUndoActionDefault = function(undoFunc, parents, child, oldVal, item) {\n return undoFunc.bind(undefined, child, oldVal, item);\n };\n\n var makeUndoAction = makeUndoActionDefault;\n\n var changePusher = function(parents, child, item) {\n var oldVal = typeof child.oldValues != 'undefined' ? child.oldValues[0] : undefined;\n var act = makeUndoAction(executeUndoAction, parents, child, oldVal, item);\n\n if (mode == MODE_IGNORE) return;\n\n if (mode == MODE_MERGE) {\n // console.log(\"UR\", \"mergemode\");\n if (typeof act !== 'undefined') {\n act.mergedAction = function(newAction) {\n if (typeof newAction.mergeMe !== 'undefined' && newAction.mergeMe) {\n return _combinedFunction(newAction, this);\n } else return null;\n };\n act.mergeMe = true;\n }\n } else {\n if (typeof act !== 'undefined') {\n if (child.oldValues && mode == MODE_ONCE) {\n act.mergedAction = function(oldChild, oldItem, newAction) {\n if (typeof newAction.mergeableAction == 'object' && oldChild == newAction.mergeableAction.child) {\n // console.log(\"UR\", \"ignore update for property in MODE_ONCE\");\n return this;\n } else return null;\n }.bind(act, child, item);\n act.mergeableAction = { child: child, item: item };\n }\n // console.log(\"UR\", \"item.status\", item.status);\n // \"item\" is valued when an item is added/removed/reteined in an array\n // sometimes KO detect \"moves\" and add a \"moved\" property with the index but\n // this doesn't happen for example using knockout-sortable or when moving objects\n // between arrays.\n // So this ends up handling this with \"mergeableMove\" and \"mergedAction\": \n if (item && item.status == 'deleted') {\n // TODO se sono in MODE = MERGE devo metteer una funzione di merge che accetta tutto.\n // altrimenti lascio questa.\n act.mergedAction = function(oldChild, oldItem, newAction) {\n // console.log(\"UR\", \"act.mergedAction\", typeof newAction.mergeableMove);\n // a deleted action is able to merge with a added action if they apply to the same\n // object.\n if (typeof newAction.mergeableMove == 'object' && oldItem.value == newAction.mergeableMove.item.value) {\n // in this case I simply return a single action running both actions in sequence,\n // this way the \"undo\" will need to undo only once for a \"move\" operation.\n return _combinedFunction(newAction, this);\n } else {\n console.log(\"UR\", \"not mergeable\", typeof newAction.mergeableMove);\n }\n\n return null;\n }.bind(act, child, item);\n }\n if (item && item.status == 'added') {\n // add a mergeableMove property that will be used by the next action \"mergedAction\" to see if this action\n // can be merged.\n act.mergeableMove = { child: child, item: item };\n }\n }\n }\n if (typeof act !== 'undefined') _push(act);\n };\n\n var reactorOptions = { depth: -1, oldValues: 1, mutable: true, /* tagParentsWithName: true */ tagFields: true };\n\n var context = {};\n var react = typeof reactor == 'function' ? reactor : ko.watch;\n var res = react(model, reactorOptions, changePusher, context);\n\n return {\n push: _push, \n undoCommand: _xdoCommand(options.undoLabel, STATE_UNDOING, undoStack),\n redoCommand: _xdoCommand(options.redoLabel, STATE_REDOING, redoStack),\n reset: function() { undoStack.removeAll(); redoStack.removeAll(); },\n // setMode: function(newMode) { mode = newMode; _removeMergedAction(undoStack); },\n setModeOnce: function() { mode = MODE_ONCE; _removeMergedAction(undoStack); },\n setModeMerge: function() { mode = MODE_MERGE; _removeMergedAction(undoStack); },\n setModeNormal: function() { mode = MODE_NORMAL; _removeMergedAction(undoStack); },\n setModeIgnore: function() { mode = MODE_IGNORE; _removeMergedAction(undoStack); },\n setUndoActionMaker: function(maker) { makeUndoAction = maker; },\n dispose: function() { /* ko.unwatch(model, reactorOptions, changePusher); */ res.dispose(); }\n };\n };\n\n return undoManager;\n \n}));",
|
|
88
|
+
"// Knockout Fast Mapping v0.1\n// License: MIT (http://www.opensource.org/licenses/mit-license.php)\n\n(function (factory) {\n\t// Module systems magic dance.\n\n\tif (typeof require === \"function\" && typeof exports === \"object\" && typeof module === \"object\") {\n\t\t// CommonJS or Node: hard-coded dependency on \"knockout\"\n\t\tfactory(require(\"knockout\"), exports);\n\t} else if (typeof define === \"function\" && define[\"amd\"]) {\n\t\t// AMD anonymous module with hard-coded dependency on \"knockout\"\n\t\tdefine([\"knockout\", \"exports\"], factory);\n\t} else {\n\t\t// <script> tag: use the global `ko` object, attaching a `wrap` property\n\t\tfactory(ko, ko.wrap = {});\n\t}\n}(function (ko, exports) {\n \n // this function mimics ko.mapping\n exports.fromJS = function(jsObject, computedFunctions, observableObjects)\n {\n reset();\n\treturn wrap(jsObject, computedFunctions, observableObjects);\n }\n\n // this function unwraps the outer for assigning the result to an observable\n // see https://github.com/SteveSanderson/knockout/issues/517\n exports.updateFromJS = function(observable, jsObject, computedFunctions, observableObjects)\n {\n reset();\n\treturn observable(ko.utils.unwrapObservable(wrap(jsObject, computedFunctions, observableObjects)));\n }\n\n exports.fromJSON = function (jsonString, computedFunctions, observableObjects) {\n\tvar parsed = ko.utils.parseJson(jsonString);\n\targuments[0] = parsed;\n\treturn exports.fromJS.apply(this, computedFunctions, observableObjects);\n };\n \n exports.toJS = function (observable) {\n\treturn unwrap(observable);\n }\n\n exports.toJSON = function (observable) {\n\tvar plainJavaScriptObject = exports.toJS(observable);\n\treturn ko.utils.stringifyJson(plainJavaScriptObject);\n };\n\n function typeOf(value) {\n\tvar s = typeof value;\n\tif (s === 'object') {\n if (value) {\n if (value.constructor == Date)\n s = 'date';\n\t\telse if (Object.prototype.toString.call(value) == '[object Array]')\n s = 'array';\n } else {\n\t\ts = 'null';\n }\n\t}\n\treturn s;\n }\n\n // unwrapping\n function unwrapObject(o)\n {\n\tvar t = {};\n\n\tfor (var k in o)\n\t{\n\t var v = o[k];\n\n\t if (ko.isComputed(v))\n\t\tcontinue;\n\n\t t[k] = unwrap(v);\n\t}\n\n\treturn t;\n }\n\n function unwrapArray(a)\n {\n\tvar r = [];\n\n\tif (!a || a.length == 0)\n\t return r;\n\t\n\tfor (var i = 0, l = a.length; i < l; ++i)\n\t r.push(unwrap(a[i]));\n\n\treturn r;\n }\n\n function unwrap(v)\n {\n\tvar isObservable = ko.isObservable(v);\n\n\tif (isObservable)\n\t{\n\t var val = v();\n\n\t return unwrap(val);\n\t}\n\telse\n\t{\n\t if (typeOf(v) == \"array\")\n\t {\n\t\treturn unwrapArray(v);\n\t }\n\t else if (typeOf(v) == \"object\")\n\t {\n\t\treturn unwrapObject(v);\n\t }\n\t else\n\t {\n\t\treturn v;\n\t }\n\t}\n }\n\n function reset()\n {\n parents = [{obj: null, wrapped: null, lvl: \"\"}];\n } \n \n // wrapping\n\n function wrapObject(o, computedFunctions, observableObjects)\n {\n // check for infinite recursion\n for (var i = 0; i < parents.length; ++i) {\n if (parents[i].obj === o) {\n return parents[i].wrapped;\n }\n }\n\n\tvar t = {};\n\n\tfor (var k in o)\n\t{\n\t var v = o[k];\n\n parents.push({obj: o, wrapped: t, lvl: currentLvl() + \"/\" + k});\n\n\t t[k] = wrap(v, computedFunctions, observableObjects);\n\n parents.pop();\n\t}\n\n\tif (computedFunctions && computedFunctions[currentLvl()])\n\t t = computedFunctions[currentLvl()](t);\n\n if (hasES5Plugin())\n ko.track(t);\n\n\tif (observableObjects) return ko.observable(t);\n\treturn t;\n }\n\n function wrapArray(a, computedFunctions, observableObjects)\n {\n\tvar r = ko.observableArray();\n\n\tif (!a || a.length == 0)\n\t return r;\n\n\tfor (var i = 0, l = a.length; i < l; ++i)\n\t r.push(wrap(a[i], computedFunctions, observableObjects));\n\n\treturn r;\n }\n\n // a stack, used for two purposes:\n // - circular reference checking\n // - computed functions\n var parents;\n\n function currentLvl()\n {\n\treturn parents[parents.length-1].lvl;\n }\n\n function wrap(v, computedFunctions, observableObjects)\n {\n\tif (typeOf(v) == \"array\")\n\t{\n\t return wrapArray(v, computedFunctions, observableObjects);\n\t}\n\telse if (typeOf(v) == \"object\")\n\t{\n\t return wrapObject(v, computedFunctions, observableObjects);\n\t}\n\telse\n\t{\n if (!hasES5Plugin() && typeof v !== 'function')\n {\n\t var t = ko.observable();\n\t t(v);\n\t return t;\n } else\n return v;\n\t}\n }\n\n function hasES5Plugin()\n {\n return ko.track != null;\n }\n}));\n",
|
|
89
|
+
"// Deep observer plugin for Knockout http://knockoutjs.com/\r\n// (c) Ziad Jeeroburkhan\r\n// License: MIT (http://www.opensource.org/licenses/mit-license.php)\r\n// Version 1.3.8\r\n; (function (factory) {\r\n // CommonJS\r\n if (typeof require === 'function' && typeof exports === 'object' && typeof module === 'object') {\r\n factory(require('knockout'));\r\n // AMD\r\n } else if (typeof define === 'function' && define.amd) {\r\n define(['knockout'], factory);\r\n // Normal script tag\r\n } else {\r\n factory(window.ko);\r\n }\r\n}(function (ko) {\r\nko.subscribable.fn['watch'] = function (targetOrCallback, options, evaluatorCallback, context) {\r\n /// <summary>\r\n /// Track and manage changes within the chained observable down to any given level. \r\n /// </summary>\r\n /// <param name=\"targetOrCallback\">\r\n /// The subscription callback function or an object containing the subscribables to be watched.\r\n /// </param>\r\n /// <param name=\"options\" type=\"object\">\r\n /// false -> Disables tracking on the chained observable.\r\n /// { depth: 2 } -> Track all nested subscribables down to the 2nd level(default is 1).<br/>\r\n /// { depth: -1 } -> Track all nested subscribables.<br/>\r\n /// { hide: [...] } -> Property or array of properties to be ignored.<br/>\r\n /// { hideArrays: true } -> Ignore all nested arrays.<br/>\r\n /// { hideWrappedValues: true } -> Ignore observables wrapped under yet another parent observable.<br/>\r\n /// { mutable: true } -> Dynamically adapt to changes made to the target structure through any subscribable.<br/>\r\n /// { watchedOnly: true } -> Watch only subscribables tagged with .watch().<br/>\r\n /// { beforeWatch: function(parents, child) {...} } -> Function called prior to creating a subscription. Returning false aborts the operation and ignores its children.<br/>\r\n /// { wrap: true } -> Wrap all fields into observables. This happens on the fly for new array items(or child objects when mutable is set to true).<br/>\r\n /// { beforeWrap: function(parents, field, value) {...} } -> Function called prior to wrapping a value into an observable. Returning false leaves it as it is.<br/>\r\n /// { tagFields: true } -> Add the property '_fieldName' under each property for textual identification.<br/>\r\n /// { tagFields: 'parentsOnly' } -> Same as above except that it is limited to parent properties only.<br/>\r\n /// { oldValues: 3 } -> Keep the last three values for each subscribable under the property 'oldValues'.<br/>\r\n /// { seal: true } -> Prevent any subsequent watcher from watching the target again.<br/>\r\n /// { unloop: true } -> Avoid circular paths through the use of a breadcrumb property '_watcher' set at each node level.<br/>\r\n /// </param>\r\n /// <param name=\"evaluatorCallback\" type=\"function\">\r\n /// The callback function called during changes. Any return value is assigned to the chained observable.\r\n /// </param>\r\n\r\n var targetType = typeof targetOrCallback;\r\n\r\n if (targetType === 'boolean' || targetType === 'undefined') {\r\n // Turn on or off the watcher for the specified target along with any of its children.\r\n ko.watch(this, { enabled: targetOrCallback !== false });\r\n } else if (targetType === 'function' && !ko.isSubscribable(targetOrCallback)) {\r\n // Target the chained subscribable itself if no target subscribable or object was passed.\r\n ko.watch(this, options || {}, targetOrCallback, context || this);\r\n } else {\r\n ko.watch(targetOrCallback, options, evaluatorCallback, context || this);\r\n }\r\n\r\n return this;\r\n};\r\n\r\nko['watch'] = function (target, options, evaluatorCallback, context) {\r\n /// <summary>\r\n /// Track and manage changes within a specific target object down to any given level.\r\n /// </summary>\r\n /// <param name=\"target\">\r\n /// An object or function containing the targeted subscribable(s).\r\n /// </param>\r\n /// <param name=\"options\" type=\"object\">\r\n /// { depth: 2 } -> Track all nested subscribables down to the 2nd level(default is 1).<br/>\r\n /// { depth: -1 } -> Track all nested subscribables.<br/>\r\n /// { hide: [...] } -> Property or array of properties to be ignored.<br/>\r\n /// { hideArrays: true } -> Ignore all nested arrays.<br/>\r\n /// { hideWrappedValues: true } -> Ignore observables wrapped under yet another parent observable.<br/>\r\n /// { mutable: true } -> Dynamically adapt to changes made to the target structure through any subscribable.<br/>\r\n /// { watchedOnly: true } -> Watch only subscribables tagged with .watch().<br/>\r\n /// { beforeWatch: function(parents, child) {...} } -> Function called prior to creating a subscription. Returning false aborts the operation and ignores its children.<br/>\r\n /// { wrap: true } -> Wrap all fields into observables. This happens on the fly for new array items(or child objects when mutable is set to true).<br/>\r\n /// { beforeWrap: function(parents, field, value) {...} } -> Function called prior to wrapping a value into an observable. Returning false leaves it as it is.<br/>\r\n /// { tagFields: true } -> Add the property '_fieldName' under each property for textual identification.<br/>\r\n /// { tagFields: 'parentsOnly' } -> Same as above except that it is limited to parent properties only.<br/>\r\n /// { oldValues: 3 } -> Keep the last three values for each subscribable under the property 'oldValues'.<br/>\r\n /// { seal: true } -> Prevent any subsequent watcher from watching the target again.<br/>\r\n /// { unloop: true } -> Avoid circular paths through the use of a breadcrumb property '_watcher' set at each node level.<br/>\r\n /// { getter: function(parents, child, property) {...} } -> Function used to retrieve the property value from the given child. False can be returned to ignore the property.<br/>\r\n /// </param>\r\n /// <param name=\"evaluatorCallback\" type=\"function\">\r\n /// The callback function called during changes.\r\n /// </param>\r\n\r\n if (typeof options === 'function') {\r\n context = context || evaluatorCallback;\r\n evaluatorCallback = options;\r\n options = {};\r\n }\r\n\r\n context = context || this;\r\n\r\n function watchChildren(child, parent, grandParents, unwatch, keepOffParentList, fieldName) {\r\n if (child && options.depth !== 0 && (options.depth === -1 || grandParents.length < (options.depth || 1))) {\r\n\r\n // Proceed on watched children only when in watched-only mode.\r\n if (options.watchedOnly && !child.watchable && child != target)\r\n return;\r\n\r\n // Setting the target as false prevents it from being watched later on.\r\n if (options.enabled === false || options.enabled === true)\r\n child.watchable = options.enabled;\r\n\r\n // Ignore watch-disabled objects.\r\n if (child.watchable === false)\r\n return;\r\n\r\n // Prevent subsequent watchers from watching the target when sealed.\r\n if (options.seal === true)\r\n child.watchable = false;\r\n\r\n var type = typeof child;\r\n\r\n if (type === 'object' || type === 'function') {\r\n // Bypass circular references.\r\n if (child._watcher === context)\r\n return;\r\n\r\n // Ignore hidden objects. Also applies to any of their children.\r\n if (options.hide)\r\n if (ko.utils.arrayIndexOf(options.hide, child) > -1)\r\n return;\r\n\r\n // Merge parents. Using a fresh array so it is not referenced in the next recursion if any.\r\n var parents = [].concat(grandParents, parent && parent !== target ? parent : []);\r\n\r\n if (type === 'function') {\r\n if (typeof child['notifySubscribers'] == 'function') {\r\n // Target is a subscribable. Watch it.\r\n if (evaluatorCallback) {\r\n if (options.enabled === true && child.watchable === false)\r\n // Only waking up an existing watcher. Let's not add another.\r\n return;\r\n\r\n if (unwatch || !options.beforeWatch || options.beforeWatch.call(context, parents, child, fieldName) !== false) {\r\n var isArray = typeof child.pop === 'function';\r\n\r\n if (unwatch) {\r\n disposeWatcher(child);\r\n } else {\r\n assignWatcher(child, isArray, parents, keepOffParentList);\r\n }\r\n\r\n if (isArray) {\r\n watchChildren(child(), keepOffParentList ? null : child, parents, unwatch, true);\r\n return true;\r\n } else {\r\n if (options.hideWrappedValues !== true)\r\n return watchChildren(child(), keepOffParentList ? null : child, parents, unwatch, true);\r\n }\r\n }\r\n }\r\n }\r\n } else {\r\n if (Object.prototype.toString.call(child) === '[object Object]') {\r\n ko.utils.objectForEach(child, function (property, sub) {\r\n sub = options.getter ? options.getter.call(context, parents, child, property) : sub;\r\n if (sub) {\r\n if (options.wrap) {\r\n // Wrap simple objects and arrays into observables.\r\n var type = Object.prototype.toString.call(sub);\r\n if (type !== '[object Function]' && type !== '[object Object]') {\r\n if (!options.beforeWrap || options.beforeWrap.call(context, parents, child, sub) !== false) {\r\n sub = child[property] = type === '[object Array]'\r\n ? ko.observableArray(sub)\r\n : ko.observable(sub);\r\n }\r\n }\r\n }\r\n\r\n if (options.unloop)\r\n sub._watcher = unwatch ? undefined : context;\r\n\r\n var hasChildren = watchChildren(sub, keepOffParentList ? null : child, parents, unwatch, null, property);\r\n\r\n if (options.tagFields && sub._fieldName === undefined)\r\n if (hasChildren\r\n || (options.tagFields !== 'parentsOnly' && typeof sub === 'function' || typeof sub === 'object'))\r\n sub._fieldName = property;\r\n }\r\n });\r\n } else { // '[object Array]'\r\n if (options.hideArrays !== true)\r\n for (var i = 0; i < child.length; i++)\r\n watchChildren(child[i], keepOffParentList ? null : child, parents, unwatch);\r\n }\r\n\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Subscriptions are stored under either the _subscriptions field for the debug version\r\n // or the F, H or M fields when minified depending on the version used.\r\n // NOTE: we used to use ko.DEBUG to detect the debug versionbut it was removed in 3.4.0+,\r\n // so we now check the existence of a \"subscription\" function.\r\n var subscriptionsField;\r\n switch (typeof ko.subscription == 'function' || ko.version) {\r\n case true: subscriptionsField = '_subscriptions'; break;\r\n case \"3.0.0\": subscriptionsField = 'F'; break;\r\n case \"3.1.0\": subscriptionsField = 'H'; break;\r\n case \"3.2.0\": subscriptionsField = 'M'; break;\r\n case \"3.3.0\": subscriptionsField = 'G'; break;\r\n case \"3.4.0\": subscriptionsField = 'K'; break;\r\n case \"3.4.1\": subscriptionsField = 'K'; break;\r\n default: throw \"Unsupported Knockout version. Only v3.0.0 to v3.4.1 are supported when minified. Current version is \" + ko.version;\r\n }\r\n\r\n function disposeWatcher(child) {\r\n var subsc = child[subscriptionsField];\r\n\r\n if (subsc) {\r\n if (subsc.change)\r\n for (var i = subsc.change.length - 1; i >= 0; i--)\r\n if (subsc.change[i]._watcher === context)\r\n subsc.change[i].dispose();\r\n\r\n if (subsc.beforeChange && (options.mutable || options.oldValues > 0))\r\n // Also clean up any before-change subscriptions used for tracking old values.\r\n for (var i = subsc.beforeChange.length - 1; i >= 0; i--)\r\n if (subsc.beforeChange[i]._watcher === context)\r\n subsc.beforeChange[i].dispose();\r\n\r\n if (subsc.arrayChange)\r\n for (var i = subsc.arrayChange.length - 1; i >= 0; i--)\r\n if (subsc.arrayChange[i]._watcher === context)\r\n subsc.arrayChange[i].dispose();\r\n } else {\r\n throw \"Subscriptions field (.\" + subscriptionsField + \") not defined for observable child \" + (child._fieldName || \"\");\r\n }\r\n }\r\n\r\n function assignWatcher(child, isArray, parents, keepOffParentList) {\r\n if (isArray) {\r\n // Child is an observable array. Watch all changes within it.\r\n child.subscribe(function (changes) {\r\n ko.utils.arrayForEach(changes, function (item) {\r\n var returnValue = evaluatorCallback.call(context, parents, child, item);\r\n if (returnValue !== undefined)\r\n context(returnValue);\r\n\r\n if (!item.moved) {\r\n // Deleted or brand new item. Unwatch or watch it accordingly.\r\n setTimeout(function () {\r\n watchChildren(item.value, (keepOffParentList ? null : child), parents, item.status === 'deleted');\r\n }, 0);\r\n }\r\n });\r\n }, undefined, 'arrayChange')._watcher = context;\r\n\r\n } else {\r\n child.subscribe(function () {\r\n if (child.watchable !== false) {\r\n var returnValue = evaluatorCallback.call(context, parents, child);\r\n\r\n if (returnValue !== undefined)\r\n context(returnValue);\r\n\r\n if (options.mutable && typeof child() === 'object')\r\n // Watch the new comer.\r\n watchChildren(child(), (keepOffParentList ? null : child), parents);\r\n }\r\n\r\n }, null, 'change')._watcher = context;\r\n\r\n if (options.oldValues > 0 || options.mutable) {\r\n child.subscribe(function (oldValue) {\r\n if (options.oldValues > 0) {\r\n // Add old value to history list before every update.\r\n var values = (child['oldValues']\r\n ? child['oldValues']\r\n : child['oldValues'] = []);\r\n\r\n values.unshift(oldValue);\r\n\r\n while (values.length > options.oldValues)\r\n values.pop();\r\n }\r\n\r\n if (options.mutable && typeof oldValue === 'object')\r\n // Clean up all subscriptions for the old child object.\r\n watchChildren(oldValue, (keepOffParentList ? null : child), parents, false, true);\r\n\r\n }, null, 'beforeChange')._watcher = context;\r\n }\r\n }\r\n }\r\n\r\n // Use a computed when targeting a non-watchable function.\r\n if (typeof target === 'function' && !ko.isSubscribable(target))\r\n return ko.computed(target, evaluatorCallback, options);\r\n\r\n watchChildren(target, null, []);\r\n\r\n return {\r\n dispose: function () {\r\n watchChildren(target, null, [], true);\r\n }\r\n };\r\n};\r\n\r\n}));",
|
|
90
|
+
"module.exports = {\n lex : require('./lib/lexer'),\n parse: require('./lib/parser'),\n stringify: require('./lib/stringify')\n};\n",
|
|
91
|
+
"exports = module.exports = debug;\n\nfunction debug(label) {\n return _debug.bind(null, label);\n}\n\nfunction _debug(label) {\n var args = [].slice.call(arguments, 1);\n args.unshift('[' + label + ']');\n process.stderr.write(args.join(' ') + '\\n');\n}",
|
|
92
|
+
"var DEBUG = false; // `true` to print debugging info.\nvar TIMER = false; // `true` to time calls to `lex()` and print the results.\n\nvar debug = require('./debug')('lex');\n\nexports = module.exports = lex;\n\n/**\n * Convert a CSS string into an array of lexical tokens.\n *\n * @param {String} css CSS\n * @returns {Array} lexical tokens\n */\nfunction lex(css) {\n var start; // Debug timer start.\n\n var buffer = ''; // Character accumulator\n var ch; // Current character\n var column = 0; // Current source column number\n var cursor = -1; // Current source cursor position\n var depth = 0; // Current nesting depth\n var line = 1; // Current source line number\n var state = 'before-selector'; // Current state\n var stack = [state]; // State stack\n var token = {}; // Current token\n var tokens = []; // Token accumulator\n\n // Supported @-rules, in roughly descending order of usage probability.\n var atRules = [\n 'media',\n 'keyframes',\n { name: '-webkit-keyframes', type: 'keyframes', prefix: '-webkit-' },\n { name: '-moz-keyframes', type: 'keyframes', prefix: '-moz-' },\n { name: '-ms-keyframes', type: 'keyframes', prefix: '-ms-' },\n { name: '-o-keyframes', type: 'keyframes', prefix: '-o-' },\n 'font-face',\n { name: 'import', state: 'before-at-value' },\n { name: 'charset', state: 'before-at-value' },\n 'supports',\n 'viewport',\n { name: 'namespace', state: 'before-at-value' },\n 'document',\n { name: '-moz-document', type: 'document', prefix: '-moz-' },\n 'page'\n ];\n\n // -- Functions ------------------------------------------------------------\n\n /**\n * Advance the character cursor and return the next character.\n *\n * @returns {String} The next character.\n */\n function getCh() {\n skip();\n return css[cursor];\n }\n\n /**\n * Return the state at the given index in the stack.\n * The stack is LIFO so indexing is from the right.\n *\n * @param {Number} [index=0] Index to return.\n * @returns {String} state\n */\n function getState(index) {\n return index ? stack[stack.length - 1 - index] : state;\n }\n\n /**\n * Look ahead for a string beginning from the next position. The string\n * being looked for must start at the next position.\n *\n * @param {String} str The string to look for.\n * @returns {Boolean} Whether the string was found.\n */\n function isNextString(str) {\n var start = cursor + 1;\n return (str === css.slice(start, start + str.length));\n }\n\n /**\n * Find the start position of a substring beginning from the next\n * position. The string being looked for may begin anywhere.\n *\n * @param {String} str The substring to look for.\n * @returns {Number|false} The position, or `false` if not found.\n */\n function find(str) {\n var pos = css.slice(cursor).indexOf(str);\n\n return pos > 0 ? pos : false;\n }\n\n /**\n * Determine whether a character is next.\n *\n * @param {String} ch Character.\n * @returns {Boolean} Whether the character is next.\n */\n function isNextChar(ch) {\n return ch === peek(1);\n }\n\n /**\n * Return the character at the given cursor offset. The offset is relative\n * to the cursor, so negative values move backwards.\n *\n * @param {Number} [offset=1] Cursor offset.\n * @returns {String} Character.\n */\n function peek(offset) {\n return css[cursor + (offset || 1)];\n }\n\n /**\n * Remove the current state from the stack and set the new current state.\n *\n * @returns {String} The removed state.\n */\n function popState() {\n var removed = stack.pop();\n state = stack[stack.length - 1];\n\n return removed;\n }\n\n /**\n * Set the current state and add it to the stack.\n *\n * @param {String} newState The new state.\n * @returns {Number} The new stack length.\n */\n function pushState(newState) {\n state = newState;\n stack.push(state);\n\n return stack.length;\n }\n\n /**\n * Replace the current state with a new state.\n *\n * @param {String} newState The new state.\n * @returns {String} The replaced state.\n */\n function replaceState(newState) {\n var previousState = state;\n stack[stack.length - 1] = state = newState;\n\n return previousState;\n }\n\n /**\n * Move the character cursor. Positive numbers move the cursor forward.\n * Negative numbers are not supported!\n *\n * @param {Number} [n=1] Number of characters to skip.\n */\n function skip(n) {\n if ((n || 1) == 1) {\n if (css[cursor] == '\\n') {\n line++;\n column = 1;\n } else {\n column++;\n }\n cursor++;\n } else {\n var skipStr = css.slice(cursor, cursor + n).split('\\n');\n if (skipStr.length > 1) {\n line += skipStr.length - 1;\n column = 1;\n }\n column += skipStr[skipStr.length - 1].length;\n cursor = cursor + n;\n }\n }\n\n /**\n * Add the current token to the pile and reset the buffer.\n */\n function addToken() {\n token.end = {\n line: line,\n col: column\n };\n\n DEBUG && debug('addToken:', JSON.stringify(token, null, 2));\n\n tokens.push(token);\n\n buffer = '';\n token = {};\n }\n\n /**\n * Set the current token.\n *\n * @param {String} type Token type.\n */\n function initializeToken(type) {\n token = {\n type: type,\n start: {\n line: line,\n col : column\n }\n };\n }\n\n // -- Main Loop ------------------------------------------------------------\n\n /*\n The main loop is a state machine that reads in one character at a time,\n and determines what to do based on the current state and character.\n This is implemented as a series of nested `switch` statements and the\n case orders have been mildly optimized based on rough probabilities\n calculated by processing a small sample of real-world CSS.\n\n Further optimization (such as a dispatch table) shouldn't be necessary\n since the total number of cases is very low.\n */\n\n TIMER && (start = Date.now());\n\n while (ch = getCh()) {\n DEBUG && debug(ch, getState());\n\n // column += 1;\n\n switch (ch) {\n // Space\n case ' ':\n switch (getState()) {\n case 'selector':\n case 'value':\n case 'value-paren':\n case 'at-group':\n case 'at-value':\n case 'comment':\n case 'double-string':\n case 'single-string':\n buffer += ch;\n break;\n }\n break;\n\n // Newline or tab\n case '\\n':\n case '\\t':\n case '\\r':\n case '\\f':\n switch (getState()) {\n case 'value':\n case 'value-paren':\n case 'at-group':\n case 'comment':\n case 'single-string':\n case 'double-string':\n case 'selector':\n buffer += ch;\n break;\n\n case 'at-value':\n // Tokenize an @-rule if a semi-colon was omitted.\n if ('\\n' === ch) {\n token.value = buffer.trim();\n addToken();\n popState();\n }\n break;\n }\n\n // if ('\\n' === ch) {\n // column = 0;\n // line += 1;\n // }\n break;\n\n case ':':\n switch (getState()) {\n case 'name':\n token.name = buffer.trim();\n buffer = '';\n\n replaceState('before-value');\n break;\n\n case 'before-selector':\n buffer += ch;\n\n initializeToken('selector');\n pushState('selector');\n break;\n\n case 'before-value':\n replaceState('value');\n buffer += ch;\n break;\n\n default:\n buffer += ch;\n break;\n }\n break;\n\n case ';':\n switch (getState()) {\n case 'name':\n case 'before-value':\n case 'value':\n // Tokenize a declaration\n // if value is empty skip the declaration\n if (buffer.trim().length > 0) {\n token.value = buffer.trim(),\n addToken();\n }\n replaceState('before-name');\n break;\n\n case 'value-paren':\n // Insignificant semi-colon\n buffer += ch;\n break;\n\n case 'at-value':\n // Tokenize an @-rule\n token.value = buffer.trim();\n addToken();\n popState();\n break;\n\n case 'before-name':\n // Extraneous semi-colon\n break;\n\n default:\n buffer += ch;\n break;\n }\n break;\n\n case '{':\n switch (getState()) {\n case 'selector':\n // If the sequence is `\\{` then assume that the brace should be escaped.\n if (peek(-1) === '\\\\') {\n buffer += ch;\n break;\n }\n\n // Tokenize a selector\n token.text = buffer.trim();\n addToken();\n replaceState('before-name');\n depth = depth + 1;\n break;\n\n case 'at-group':\n // Tokenize an @-group\n token.name = buffer.trim();\n\n // XXX: @-rules are starting to get hairy\n switch (token.type) {\n case 'font-face':\n case 'viewport' :\n case 'page' :\n pushState('before-name');\n break;\n\n default:\n pushState('before-selector');\n }\n\n addToken();\n depth = depth + 1;\n break;\n\n case 'name':\n case 'at-rule':\n // Tokenize a declaration or an @-rule\n token.name = buffer.trim();\n addToken();\n pushState('before-name');\n depth = depth + 1;\n break;\n\n case 'comment':\n case 'double-string':\n case 'single-string':\n // Ignore braces in comments and strings\n buffer += ch;\n break;\n case 'before-value':\n replaceState('value');\n buffer += ch;\n break;\n }\n\n break;\n\n case '}':\n switch (getState()) {\n case 'before-name':\n case 'name':\n case 'before-value':\n case 'value':\n // If the buffer contains anything, it is a value\n if (buffer) {\n token.value = buffer.trim();\n }\n\n // If the current token has a name and a value it should be tokenized.\n if (token.name && token.value) {\n addToken();\n }\n\n // Leave the block\n initializeToken('end');\n addToken();\n popState();\n\n // We might need to leave again.\n // XXX: What about 3 levels deep?\n if ('at-group' === getState()) {\n initializeToken('at-group-end');\n addToken();\n popState();\n }\n \n if (depth > 0) {\n depth = depth - 1;\n }\n\n break;\n\n case 'at-group':\n case 'before-selector':\n case 'selector':\n // If the sequence is `\\}` then assume that the brace should be escaped.\n if (peek(-1) === '\\\\') {\n buffer += ch;\n break;\n }\n\n if (depth > 0) {\n // Leave block if in an at-group\n if ('at-group' === getState(1)) {\n initializeToken('at-group-end');\n addToken();\n }\n }\n\n if (depth > 1) {\n popState();\n }\n\n if (depth > 0) {\n depth = depth - 1;\n }\n break;\n\n case 'double-string':\n case 'single-string':\n case 'comment':\n // Ignore braces in comments and strings.\n buffer += ch;\n break;\n }\n\n break;\n\n // Strings\n case '\"':\n case \"'\":\n switch (getState()) {\n case 'double-string':\n if ('\"' === ch && '\\\\' !== peek(-1)) {\n popState();\n }\n break;\n\n case 'single-string':\n if (\"'\" === ch && '\\\\' !== peek(-1)) {\n popState();\n }\n break;\n\n case 'before-at-value':\n replaceState('at-value');\n pushState('\"' === ch ? 'double-string' : 'single-string');\n break;\n\n case 'before-value':\n replaceState('value');\n pushState('\"' === ch ? 'double-string' : 'single-string');\n break;\n\n case 'comment':\n // Ignore strings within comments.\n break;\n\n default:\n if ('\\\\' !== peek(-1)) {\n pushState('\"' === ch ? 'double-string' : 'single-string');\n }\n }\n\n buffer += ch;\n break;\n\n // Comments\n case '/':\n switch (getState()) {\n case 'comment':\n case 'double-string':\n case 'single-string':\n // Ignore\n buffer += ch;\n break;\n\n case 'before-value':\n case 'selector':\n case 'name':\n case 'value':\n if (isNextChar('*')) {\n // Ignore comments in selectors, properties and values. They are\n // difficult to represent in the AST.\n var pos = find('*/');\n\n if (pos) {\n skip(pos + 1);\n }\n } else {\n if (getState() == 'before-value') replaceState('value');\n buffer += ch;\n }\n break;\n\n default:\n if (isNextChar('*')) {\n // Create a comment token\n initializeToken('comment');\n pushState('comment');\n skip();\n }\n else {\n buffer += ch;\n }\n break;\n }\n break;\n\n // Comment end or universal selector\n case '*':\n switch (getState()) {\n case 'comment':\n if (isNextChar('/')) {\n // Tokenize a comment\n token.text = buffer; // Don't trim()!\n skip();\n addToken();\n popState();\n }\n else {\n buffer += ch;\n }\n break;\n\n case 'before-selector':\n buffer += ch;\n initializeToken('selector');\n pushState('selector');\n break;\n\n case 'before-value':\n replaceState('value');\n buffer += ch;\n break;\n\n default:\n buffer += ch;\n }\n break;\n\n // @-rules\n case '@':\n switch (getState()) {\n case 'comment':\n case 'double-string':\n case 'single-string':\n buffer += ch;\n break;\n case 'before-value':\n replaceState('value');\n buffer += ch;\n break;\n\n default:\n // Iterate over the supported @-rules and attempt to tokenize one.\n var tokenized = false;\n var name;\n var rule;\n\n for (var j = 0, len = atRules.length; !tokenized && j < len; ++j) {\n rule = atRules[j];\n name = rule.name || rule;\n\n if (!isNextString(name)) { continue; }\n\n tokenized = true;\n\n initializeToken(name);\n pushState(rule.state || 'at-group');\n skip(name.length);\n\n if (rule.prefix) {\n token.prefix = rule.prefix;\n }\n\n if (rule.type) {\n token.type = rule.type;\n }\n }\n\n if (!tokenized) {\n // Keep on truckin' America!\n buffer += ch;\n }\n break;\n }\n break;\n\n // Parentheses are tracked to disambiguate semi-colons, such as within a\n // data URI.\n case '(':\n switch (getState()) {\n case 'value':\n pushState('value-paren');\n break;\n case 'before-value':\n replaceState('value');\n break;\n }\n\n buffer += ch;\n break;\n\n case ')':\n switch (getState()) {\n case 'value-paren':\n popState();\n break;\n case 'before-value':\n replaceState('value');\n break;\n }\n\n buffer += ch;\n break;\n\n default:\n switch (getState()) {\n case 'before-selector':\n initializeToken('selector');\n pushState('selector');\n break;\n\n case 'before-name':\n initializeToken('property');\n replaceState('name');\n break;\n\n case 'before-value':\n replaceState('value');\n break;\n\n case 'before-at-value':\n replaceState('at-value');\n break;\n }\n\n buffer += ch;\n break;\n }\n }\n\n TIMER && debug('ran in', (Date.now() - start) + 'ms');\n\n return tokens;\n}\n",
|
|
93
|
+
"var DEBUG = false; // `true` to print debugging info.\nvar TIMER = false; // `true` to time calls to `parse()` and print the results.\n\nvar debug = require('./debug')('parse');\nvar lex = require('./lexer');\n\nexports = module.exports = parse;\n\nvar _comments; // Whether comments are allowed.\nvar _depth; // Current block nesting depth.\nvar _position; // Whether to include line/column position.\nvar _tokens; // Array of lexical tokens.\n\n/**\n * Convert a CSS string or array of lexical tokens into a `stringify`-able AST.\n *\n * @param {String} css CSS string or array of lexical token\n * @param {Object} [options]\n * @param {Boolean} [options.comments=false] allow comment nodes in the AST\n * @returns {Object} `stringify`-able AST\n */\nfunction parse(css, options) {\n var start; // Debug timer start.\n\n options || (options = {});\n _comments = !!options.comments;\n _position = !!options.position;\n\n _depth = 0;\n\n // Operate on a copy of the given tokens, or the lex()'d CSS string.\n _tokens = Array.isArray(css) ? css.slice() : lex(css);\n\n var rule;\n var rules = [];\n var token;\n\n TIMER && (start = Date.now());\n\n while ((token = next())) {\n rule = parseToken(token);\n rule && rules.push(rule);\n }\n\n TIMER && debug('ran in', (Date.now() - start) + 'ms');\n\n return {\n type: \"stylesheet\",\n stylesheet: {\n rules: rules\n }\n };\n}\n\n// -- Functions --------------------------------------------------------------\n\n/**\n * Build an AST node from a lexical token.\n *\n * @param {Object} token lexical token\n * @param {Object} [override] object hash of properties that override those\n * already in the token, or that will be added to the token.\n * @returns {Object} AST node\n */\nfunction astNode(token, override) {\n override || (override = {});\n\n var key;\n var keys = ['type', 'name', 'value'];\n var node = {};\n\n // Avoiding [].forEach for performance reasons.\n for (var i = 0; i < keys.length; ++i) {\n key = keys[i];\n\n if (token[key]) {\n node[key] = override[key] || token[key];\n }\n }\n\n keys = Object.keys(override);\n\n for (i = 0; i < keys.length; ++i) {\n key = keys[i];\n\n if (!node[key]) {\n node[key] = override[key];\n }\n }\n\n if (_position) {\n node.position = {\n start: token.start,\n end: token.end\n };\n }\n\n DEBUG && debug('astNode:', JSON.stringify(node, null, 2));\n\n return node;\n}\n\n/**\n * Remove a lexical token from the stack and return the removed token.\n *\n * @returns {Object} lexical token\n */\nfunction next() {\n var token = _tokens.shift();\n DEBUG && debug('next:', JSON.stringify(token, null, 2));\n return token;\n}\n\n// -- Parse* Functions ---------------------------------------------------------\n\n/**\n * Convert an @-group lexical token to an AST node.\n *\n * @param {Object} token @-group lexical token\n * @returns {Object} @-group AST node\n */\nfunction parseAtGroup(token) {\n _depth = _depth + 1;\n\n // As the @-group token is assembled, relevant token values are captured here\n // temporarily. They will later be used as `tokenize()` overrides.\n var overrides = {};\n\n switch (token.type) {\n case 'font-face':\n case 'viewport' :\n overrides.declarations = parseDeclarations();\n break;\n\n case 'page':\n overrides.prefix = token.prefix;\n overrides.declarations = parseDeclarations();\n break;\n\n default:\n overrides.prefix = token.prefix;\n overrides.rules = parseRules();\n }\n\n return astNode(token, overrides);\n}\n\n/**\n * Convert an @import lexical token to an AST node.\n *\n * @param {Object} token @import lexical token\n * @returns {Object} @import AST node\n */\nfunction parseAtImport(token) {\n return astNode(token);\n}\n\n/**\n * Convert an @charset token to an AST node.\n *\n * @param {Object} token @charset lexical token\n * @returns {Object} @charset node\n */\nfunction parseCharset(token) {\n return astNode(token);\n}\n\n/**\n * Convert a comment token to an AST Node.\n *\n * @param {Object} token comment lexical token\n * @returns {Object} comment node\n */\nfunction parseComment(token) {\n return astNode(token, {text: token.text});\n}\n\nfunction parseNamespace(token) {\n return astNode(token);\n}\n\n/**\n * Convert a property lexical token to a property AST node.\n *\n * @returns {Object} property node\n */\nfunction parseProperty(token) {\n return astNode(token);\n}\n\n/**\n * Convert a selector lexical token to a selector AST node.\n *\n * @param {Object} token selector lexical token\n * @returns {Object} selector node\n */\nfunction parseSelector(token) {\n function trim(str) {\n return str.trim();\n }\n\n return astNode(token, {\n type: 'rule',\n selectors: token.text.split(',').map(trim),\n declarations: parseDeclarations(token)\n });\n}\n\n/**\n * Convert a lexical token to an AST node.\n *\n * @returns {Object|undefined} AST node\n */\nfunction parseToken(token) {\n switch (token.type) {\n // Cases are listed in roughly descending order of probability.\n case 'property': return parseProperty(token);\n\n case 'selector': return parseSelector(token);\n\n case 'at-group-end': _depth = _depth - 1; return;\n\n case 'media' :\n case 'keyframes' :return parseAtGroup(token);\n\n case 'comment': if (_comments) { return parseComment(token); } break;\n\n case 'charset': return parseCharset(token);\n case 'import': return parseAtImport(token);\n\n case 'namespace': return parseNamespace(token);\n\n case 'font-face':\n case 'supports' :\n case 'viewport' :\n case 'document' :\n case 'page' : return parseAtGroup(token);\n }\n\n DEBUG && debug('parseToken: unexpected token:', JSON.stringify(token));\n}\n\n// -- Parse Helper Functions ---------------------------------------------------\n\n/**\n * Iteratively parses lexical tokens from the stack into AST nodes until a\n * conditional function returns `false`, at which point iteration terminates\n * and any AST nodes collected are returned.\n *\n * @param {Function} conditionFn\n * @param {Object} token the lexical token being parsed\n * @returns {Boolean} `true` if the token should be parsed, `false` otherwise\n * @return {Array} AST nodes\n */\nfunction parseTokensWhile(conditionFn) {\n var node;\n var nodes = [];\n var token;\n\n while ((token = next()) && (conditionFn && conditionFn(token))) {\n node = parseToken(token);\n node && nodes.push(node);\n }\n\n // Place an unused non-`end` lexical token back onto the stack.\n if (token && token.type !== 'end') {\n _tokens.unshift(token);\n }\n\n return nodes;\n}\n\n/**\n * Convert a series of tokens into a sequence of declaration AST nodes.\n *\n * @returns {Array} declaration nodes\n */\nfunction parseDeclarations() {\n return parseTokensWhile(function (token) {\n return (token.type === 'property' || token.type === 'comment');\n });\n}\n\n/**\n * Convert a series of tokens into a sequence of rule nodes.\n *\n * @returns {Array} rule nodes\n */\nfunction parseRules() {\n return parseTokensWhile(function () { return _depth; });\n}\n",
|
|
94
|
+
"var DEBUG = false; // `true` to print debugging info.\nvar TIMER = false; // `true` to time calls to `stringify()` and print the results.\n\nvar debug = require('./debug')('stringify');\n\nvar _comments; // Whether comments are allowed in the stringified CSS.\nvar _compress; // Whether the stringified CSS should be compressed.\nvar _indentation; // Indentation option value.\nvar _n; // Compression-aware newline character.\nvar _s; // Compression-aware space character.\n\nexports = module.exports = stringify;\n\n/**\n * Convert a `stringify`-able AST into a CSS string.\n *\n * @param {Object} `stringify`-able AST\n * @param {Object} [options]\n * @param {Boolean} [options.comments=false] allow comments in the CSS\n * @param {Boolean} [options.compress=false] compress whitespace\n * @param {String} [options.indentation=''] indentation sequence\n * @returns {String} CSS\n */\nfunction stringify(ast, options) {\n var start; // Debug timer start.\n\n options || (options = {});\n _indentation = options.indentation || '';\n _compress = !!options.compress;\n _comments = !!options.comments;\n\n if (_compress) {\n _n = _s = '';\n } else {\n _n = '\\n';\n _s = ' ';\n }\n\n TIMER && (start = Date.now());\n\n var css = reduce(ast.stylesheet.rules, stringifyNode).join('\\n').trim();\n\n TIMER && debug('ran in', (Date.now() - start) + 'ms');\n\n return css;\n}\n\n// -- Functions --------------------------------------------------------------\n\n/**\n * Modify the indentation level, or return a compression-aware sequence of\n * spaces equal to the current indentation level.\n *\n * @param {Number} [level=undefined] indentation level modifier\n * @returns {String} sequence of spaces\n */\nfunction indent(level) {\n this.level || (this.level = 1);\n\n if (level) {\n this.level += level;\n return;\n }\n\n if (_compress) { return ''; }\n\n return Array(this.level).join(_indentation || '');\n}\n\n// -- Stringify Functions ------------------------------------------------------\n\n/**\n * Stringify an @-rule AST node.\n *\n * Use `stringifyAtGroup()` when dealing with @-groups that may contain blocks\n * such as @media.\n *\n * @param {String} type @-rule type. E.g., import, charset\n * @returns {String} Stringified @-rule\n */\nfunction stringifyAtRule(node) {\n return '@' + node.type + ' ' + node.value + ';' + _n;\n}\n\n/**\n * Stringify an @-group AST node.\n *\n * Use `stringifyAtRule()` when dealing with @-rules that may not contain blocks\n * such as @import.\n *\n * @param {Object} node @-group AST node\n * @returns {String}\n */\nfunction stringifyAtGroup(node) {\n var label = '';\n var prefix = node.prefix || '';\n\n if (node.name) {\n label = ' ' + node.name;\n }\n\n // FIXME: @-rule conditional logic is leaking everywhere.\n var chomp = node.type !== 'page';\n\n return '@' + prefix + node.type + label + _s + stringifyBlock(node, chomp) + _n;\n}\n\n/**\n * Stringify a comment AST node.\n *\n * @param {Object} node comment AST node\n * @returns {String}\n */\nfunction stringifyComment(node) {\n if (!_comments) { return ''; }\n\n return '/*' + (node.text || '') + '*/' + _n;\n}\n\n/**\n * Stringify a rule AST node.\n *\n * @param {Object} node rule AST node\n * @returns {String}\n */\nfunction stringifyRule(node) {\n var label;\n\n if (node.selectors) {\n label = node.selectors.join(',' + _n);\n } else {\n label = '@' + node.type;\n label += node.name ? ' ' + node.name : '';\n }\n\n return indent() + label + _s + stringifyBlock(node) + _n;\n}\n\n\n// -- Stringify Helper Functions -----------------------------------------------\n\n/**\n * Reduce an array by applying a function to each item and retaining the truthy\n * results.\n *\n * When `item.type` is `'comment'` `stringifyComment` will be applied instead.\n *\n * @param {Array} items array to reduce\n * @param {Function} fn function to call for each item in the array\n * @returns {Mixed} Truthy values will be retained, falsy values omitted\n * @returns {Array} retained results\n */\nfunction reduce(items, fn) {\n return items.reduce(function (results, item) {\n var result = (item.type === 'comment') ? stringifyComment(item) : fn(item);\n result && results.push(result);\n return results;\n }, []);\n}\n\n/**\n * Stringify an AST node with the assumption that it represents a block of\n * declarations or other @-group contents.\n *\n * @param {Object} node AST node\n * @returns {String}\n */\n// FIXME: chomp should not be a magic boolean parameter\nfunction stringifyBlock(node, chomp) {\n var children = node.declarations;\n var fn = stringifyDeclaration;\n\n if (node.rules) {\n children = node.rules;\n fn = stringifyRule;\n }\n\n children = stringifyChildren(children, fn);\n children && (children = _n + children + (chomp ? '' : _n));\n\n return '{' + children + indent() + '}';\n}\n\n/**\n * Stringify an array of child AST nodes by calling the given stringify function\n * once for each child, and concatenating the results.\n *\n * @param {Array} children `node.rules` or `node.declarations`\n * @param {Function} fn stringify function\n * @returns {String}\n */\nfunction stringifyChildren(children, fn) {\n if (!children) { return ''; }\n\n indent(1);\n var results = reduce(children, fn);\n indent(-1);\n\n if (!results.length) { return ''; }\n\n return results.join(_n);\n}\n\n/**\n * Stringify a declaration AST node.\n *\n * @param {Object} node declaration AST node\n * @returns {String}\n */\nfunction stringifyDeclaration(node) {\n if (node.type === 'property') {\n return stringifyProperty(node);\n }\n\n DEBUG && debug('stringifyDeclaration: unexpected node:', JSON.stringify(node));\n}\n\n/**\n * Stringify an AST node.\n *\n * @param {Object} node AST node\n * @returns {String}\n */\nfunction stringifyNode(node) {\n switch (node.type) {\n // Cases are listed in roughly descending order of probability.\n case 'rule': return stringifyRule(node);\n\n case 'media' :\n case 'keyframes': return stringifyAtGroup(node);\n\n case 'comment': return stringifyComment(node);\n\n case 'import' :\n case 'charset' :\n case 'namespace': return stringifyAtRule(node);\n\n case 'font-face':\n case 'supports' :\n case 'viewport' :\n case 'document' :\n case 'page' : return stringifyAtGroup(node);\n }\n\n DEBUG && debug('stringifyNode: unexpected node: ' + JSON.stringify(node));\n}\n\n/**\n * Stringify an AST property node.\n *\n * @param {Object} node AST property node\n * @returns {String}\n */\nfunction stringifyProperty(node) {\n var name = node.name ? node.name + ':' + _s : '';\n\n return indent() + name + node.value + ';';\n}\n",
|
|
95
|
+
"/*\nSlick Parser\n - originally created by the almighty Thomas Aylott <@subtlegradient> (http://subtlegradient.com)\n*/\"use strict\"\n\n// Notable changes from Slick.Parser 1.0.x\n\n// The parser now uses 2 classes: Expressions and Expression\n// `new Expressions` produces an array-like object containing a list of Expression objects\n// - Expressions::toString() produces a cleaned up expressions string\n// `new Expression` produces an array-like object\n// - Expression::toString() produces a cleaned up expression string\n// The only exposed method is parse, which produces a (cached) `new Expressions` instance\n// parsed.raw is no longer present, use .toString()\n// parsed.expression is now useless, just use the indices\n// parsed.reverse() has been removed for now, due to its apparent uselessness\n// Other changes in the Expressions object:\n// - classNames are now unique, and save both escaped and unescaped values\n// - attributes now save both escaped and unescaped values\n// - pseudos now save both escaped and unescaped values\n\nvar escapeRe = /([-.*+?^${}()|[\\]\\/\\\\])/g,\n unescapeRe = /\\\\/g\n\nvar escape = function(string){\n // XRegExp v2.0.0-beta-3\n // « https://github.com/slevithan/XRegExp/blob/master/src/xregexp.js\n return (string + \"\").replace(escapeRe, '\\\\$1')\n}\n\nvar unescape = function(string){\n return (string + \"\").replace(unescapeRe, '')\n}\n\nvar slickRe = RegExp(\n/*\n#!/usr/bin/env ruby\nputs \"\\t\\t\" + DATA.read.gsub(/\\(\\?x\\)|\\s+#.*$|\\s+|\\\\$|\\\\n/,'')\n__END__\n \"(?x)^(?:\\\n \\\\s* ( , ) \\\\s* # Separator \\n\\\n | \\\\s* ( <combinator>+ ) \\\\s* # Combinator \\n\\\n | ( \\\\s+ ) # CombinatorChildren \\n\\\n | ( <unicode>+ | \\\\* ) # Tag \\n\\\n | \\\\# ( <unicode>+ ) # ID \\n\\\n | \\\\. ( <unicode>+ ) # ClassName \\n\\\n | # Attribute \\n\\\n \\\\[ \\\n \\\\s* (<unicode1>+) (?: \\\n \\\\s* ([*^$!~|]?=) (?: \\\n \\\\s* (?:\\\n ([\\\"']?)(.*?)\\\\9 \\\n )\\\n ) \\\n )? \\\\s* \\\n \\\\](?!\\\\]) \\n\\\n | :+ ( <unicode>+ )(?:\\\n \\\\( (?:\\\n (?:([\\\"'])([^\\\\12]*)\\\\12)|((?:\\\\([^)]+\\\\)|[^()]*)+)\\\n ) \\\\)\\\n )?\\\n )\"\n*/\n\"^(?:\\\\s*(,)\\\\s*|\\\\s*(<combinator>+)\\\\s*|(\\\\s+)|(<unicode>+|\\\\*)|\\\\#(<unicode>+)|\\\\.(<unicode>+)|\\\\[\\\\s*(<unicode1>+)(?:\\\\s*([*^$!~|]?=)(?:\\\\s*(?:([\\\"']?)(.*?)\\\\9)))?\\\\s*\\\\](?!\\\\])|(:+)(<unicode>+)(?:\\\\((?:(?:([\\\"'])([^\\\\13]*)\\\\13)|((?:\\\\([^)]+\\\\)|[^()]*)+))\\\\))?)\"\n .replace(/<combinator>/, '[' + escape(\">+~`!@$%^&={}\\\\;</\") + ']')\n .replace(/<unicode>/g, '(?:[\\\\w\\\\u00a1-\\\\uFFFF-]|\\\\\\\\[^\\\\s0-9a-f])')\n .replace(/<unicode1>/g, '(?:[:\\\\w\\\\u00a1-\\\\uFFFF-]|\\\\\\\\[^\\\\s0-9a-f])')\n)\n\n// Part\n\nvar Part = function Part(combinator){\n this.combinator = combinator || \" \"\n this.tag = \"*\"\n}\n\nPart.prototype.toString = function(){\n\n if (!this.raw){\n\n var xpr = \"\", k, part\n\n xpr += this.tag || \"*\"\n if (this.id) xpr += \"#\" + this.id\n if (this.classes) xpr += \".\" + this.classList.join(\".\")\n if (this.attributes) for (k = 0; part = this.attributes[k++];){\n xpr += \"[\" + part.name + (part.operator ? part.operator + '\"' + part.value + '\"' : '') + \"]\"\n }\n if (this.pseudos) for (k = 0; part = this.pseudos[k++];){\n xpr += \":\" + part.name\n if (part.value) xpr += \"(\" + part.value + \")\"\n }\n\n this.raw = xpr\n\n }\n\n return this.raw\n}\n\n// Expression\n\nvar Expression = function Expression(){\n this.length = 0\n}\n\nExpression.prototype.toString = function(){\n\n if (!this.raw){\n\n var xpr = \"\"\n\n for (var j = 0, bit; bit = this[j++];){\n if (j !== 1) xpr += \" \"\n if (bit.combinator !== \" \") xpr += bit.combinator + \" \"\n xpr += bit\n }\n\n this.raw = xpr\n\n }\n\n return this.raw\n}\n\nvar replacer = function(\n rawMatch,\n\n separator,\n combinator,\n combinatorChildren,\n\n tagName,\n id,\n className,\n\n attributeKey,\n attributeOperator,\n attributeQuote,\n attributeValue,\n\n pseudoMarker,\n pseudoClass,\n pseudoQuote,\n pseudoClassQuotedValue,\n pseudoClassValue\n){\n\n var expression, current\n\n if (separator || !this.length){\n expression = this[this.length++] = new Expression\n if (separator) return ''\n }\n\n if (!expression) expression = this[this.length - 1]\n\n if (combinator || combinatorChildren || !expression.length){\n current = expression[expression.length++] = new Part(combinator)\n }\n\n if (!current) current = expression[expression.length - 1]\n\n if (tagName){\n\n current.tag = unescape(tagName)\n\n } else if (id){\n\n current.id = unescape(id)\n\n } else if (className){\n\n var unescaped = unescape(className)\n\n var classes = current.classes || (current.classes = {})\n if (!classes[unescaped]){\n classes[unescaped] = escape(className)\n var classList = current.classList || (current.classList = [])\n classList.push(unescaped)\n classList.sort()\n }\n\n } else if (pseudoClass){\n\n pseudoClassValue = pseudoClassValue || pseudoClassQuotedValue\n\n ;(current.pseudos || (current.pseudos = [])).push({\n type : pseudoMarker.length == 1 ? 'class' : 'element',\n name : unescape(pseudoClass),\n escapedName : escape(pseudoClass),\n value : pseudoClassValue ? unescape(pseudoClassValue) : null,\n escapedValue : pseudoClassValue ? escape(pseudoClassValue) : null\n })\n\n } else if (attributeKey){\n\n attributeValue = attributeValue ? escape(attributeValue) : null\n\n ;(current.attributes || (current.attributes = [])).push({\n operator : attributeOperator,\n name : unescape(attributeKey),\n escapedName : escape(attributeKey),\n value : attributeValue ? unescape(attributeValue) : null,\n escapedValue : attributeValue ? escape(attributeValue) : null\n })\n\n }\n\n return ''\n\n}\n\n// Expressions\n\nvar Expressions = function Expressions(expression){\n this.length = 0\n\n var self = this\n\n var original = expression, replaced\n\n while (expression){\n replaced = expression.replace(slickRe, function(){\n return replacer.apply(self, arguments)\n })\n if (replaced === expression) throw new Error(original + ' is an invalid expression')\n expression = replaced\n }\n}\n\nExpressions.prototype.toString = function(){\n if (!this.raw){\n var expressions = []\n for (var i = 0, expression; expression = this[i++];) expressions.push(expression)\n this.raw = expressions.join(\", \")\n }\n\n return this.raw\n}\n\nvar cache = {}\n\nvar parse = function(expression){\n if (expression == null) return null\n expression = ('' + expression).replace(/^\\s+|\\s+$/g, '')\n return cache[expression] || (cache[expression] = new Expressions(expression))\n}\n\nmodule.exports = parse\n",
|
|
96
|
+
"// TinyColor v1.4.1\n// https://github.com/bgrins/TinyColor\n// Brian Grinstead, MIT License\n\n(function(Math) {\n\nvar trimLeft = /^\\s+/,\n trimRight = /\\s+$/,\n tinyCounter = 0,\n mathRound = Math.round,\n mathMin = Math.min,\n mathMax = Math.max,\n mathRandom = Math.random;\n\nfunction tinycolor (color, opts) {\n\n color = (color) ? color : '';\n opts = opts || { };\n\n // If input is already a tinycolor, return itself\n if (color instanceof tinycolor) {\n return color;\n }\n // If we are called as a function, call using new instead\n if (!(this instanceof tinycolor)) {\n return new tinycolor(color, opts);\n }\n\n var rgb = inputToRGB(color);\n this._originalInput = color,\n this._r = rgb.r,\n this._g = rgb.g,\n this._b = rgb.b,\n this._a = rgb.a,\n this._roundA = mathRound(100*this._a) / 100,\n this._format = opts.format || rgb.format;\n this._gradientType = opts.gradientType;\n\n // Don't let the range of [0,255] come back in [0,1].\n // Potentially lose a little bit of precision here, but will fix issues where\n // .5 gets interpreted as half of the total, instead of half of 1\n // If it was supposed to be 128, this was already taken care of by `inputToRgb`\n if (this._r < 1) { this._r = mathRound(this._r); }\n if (this._g < 1) { this._g = mathRound(this._g); }\n if (this._b < 1) { this._b = mathRound(this._b); }\n\n this._ok = rgb.ok;\n this._tc_id = tinyCounter++;\n}\n\ntinycolor.prototype = {\n isDark: function() {\n return this.getBrightness() < 128;\n },\n isLight: function() {\n return !this.isDark();\n },\n isValid: function() {\n return this._ok;\n },\n getOriginalInput: function() {\n return this._originalInput;\n },\n getFormat: function() {\n return this._format;\n },\n getAlpha: function() {\n return this._a;\n },\n getBrightness: function() {\n //http://www.w3.org/TR/AERT#color-contrast\n var rgb = this.toRgb();\n return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;\n },\n getLuminance: function() {\n //http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef\n var rgb = this.toRgb();\n var RsRGB, GsRGB, BsRGB, R, G, B;\n RsRGB = rgb.r/255;\n GsRGB = rgb.g/255;\n BsRGB = rgb.b/255;\n\n if (RsRGB <= 0.03928) {R = RsRGB / 12.92;} else {R = Math.pow(((RsRGB + 0.055) / 1.055), 2.4);}\n if (GsRGB <= 0.03928) {G = GsRGB / 12.92;} else {G = Math.pow(((GsRGB + 0.055) / 1.055), 2.4);}\n if (BsRGB <= 0.03928) {B = BsRGB / 12.92;} else {B = Math.pow(((BsRGB + 0.055) / 1.055), 2.4);}\n return (0.2126 * R) + (0.7152 * G) + (0.0722 * B);\n },\n setAlpha: function(value) {\n this._a = boundAlpha(value);\n this._roundA = mathRound(100*this._a) / 100;\n return this;\n },\n toHsv: function() {\n var hsv = rgbToHsv(this._r, this._g, this._b);\n return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this._a };\n },\n toHsvString: function() {\n var hsv = rgbToHsv(this._r, this._g, this._b);\n var h = mathRound(hsv.h * 360), s = mathRound(hsv.s * 100), v = mathRound(hsv.v * 100);\n return (this._a == 1) ?\n \"hsv(\" + h + \", \" + s + \"%, \" + v + \"%)\" :\n \"hsva(\" + h + \", \" + s + \"%, \" + v + \"%, \"+ this._roundA + \")\";\n },\n toHsl: function() {\n var hsl = rgbToHsl(this._r, this._g, this._b);\n return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this._a };\n },\n toHslString: function() {\n var hsl = rgbToHsl(this._r, this._g, this._b);\n var h = mathRound(hsl.h * 360), s = mathRound(hsl.s * 100), l = mathRound(hsl.l * 100);\n return (this._a == 1) ?\n \"hsl(\" + h + \", \" + s + \"%, \" + l + \"%)\" :\n \"hsla(\" + h + \", \" + s + \"%, \" + l + \"%, \"+ this._roundA + \")\";\n },\n toHex: function(allow3Char) {\n return rgbToHex(this._r, this._g, this._b, allow3Char);\n },\n toHexString: function(allow3Char) {\n return '#' + this.toHex(allow3Char);\n },\n toHex8: function(allow4Char) {\n return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char);\n },\n toHex8String: function(allow4Char) {\n return '#' + this.toHex8(allow4Char);\n },\n toRgb: function() {\n return { r: mathRound(this._r), g: mathRound(this._g), b: mathRound(this._b), a: this._a };\n },\n toRgbString: function() {\n return (this._a == 1) ?\n \"rgb(\" + mathRound(this._r) + \", \" + mathRound(this._g) + \", \" + mathRound(this._b) + \")\" :\n \"rgba(\" + mathRound(this._r) + \", \" + mathRound(this._g) + \", \" + mathRound(this._b) + \", \" + this._roundA + \")\";\n },\n toPercentageRgb: function() {\n return { r: mathRound(bound01(this._r, 255) * 100) + \"%\", g: mathRound(bound01(this._g, 255) * 100) + \"%\", b: mathRound(bound01(this._b, 255) * 100) + \"%\", a: this._a };\n },\n toPercentageRgbString: function() {\n return (this._a == 1) ?\n \"rgb(\" + mathRound(bound01(this._r, 255) * 100) + \"%, \" + mathRound(bound01(this._g, 255) * 100) + \"%, \" + mathRound(bound01(this._b, 255) * 100) + \"%)\" :\n \"rgba(\" + mathRound(bound01(this._r, 255) * 100) + \"%, \" + mathRound(bound01(this._g, 255) * 100) + \"%, \" + mathRound(bound01(this._b, 255) * 100) + \"%, \" + this._roundA + \")\";\n },\n toName: function() {\n if (this._a === 0) {\n return \"transparent\";\n }\n\n if (this._a < 1) {\n return false;\n }\n\n return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false;\n },\n toFilter: function(secondColor) {\n var hex8String = '#' + rgbaToArgbHex(this._r, this._g, this._b, this._a);\n var secondHex8String = hex8String;\n var gradientType = this._gradientType ? \"GradientType = 1, \" : \"\";\n\n if (secondColor) {\n var s = tinycolor(secondColor);\n secondHex8String = '#' + rgbaToArgbHex(s._r, s._g, s._b, s._a);\n }\n\n return \"progid:DXImageTransform.Microsoft.gradient(\"+gradientType+\"startColorstr=\"+hex8String+\",endColorstr=\"+secondHex8String+\")\";\n },\n toString: function(format) {\n var formatSet = !!format;\n format = format || this._format;\n\n var formattedString = false;\n var hasAlpha = this._a < 1 && this._a >= 0;\n var needsAlphaFormat = !formatSet && hasAlpha && (format === \"hex\" || format === \"hex6\" || format === \"hex3\" || format === \"hex4\" || format === \"hex8\" || format === \"name\");\n\n if (needsAlphaFormat) {\n // Special case for \"transparent\", all other non-alpha formats\n // will return rgba when there is transparency.\n if (format === \"name\" && this._a === 0) {\n return this.toName();\n }\n return this.toRgbString();\n }\n if (format === \"rgb\") {\n formattedString = this.toRgbString();\n }\n if (format === \"prgb\") {\n formattedString = this.toPercentageRgbString();\n }\n if (format === \"hex\" || format === \"hex6\") {\n formattedString = this.toHexString();\n }\n if (format === \"hex3\") {\n formattedString = this.toHexString(true);\n }\n if (format === \"hex4\") {\n formattedString = this.toHex8String(true);\n }\n if (format === \"hex8\") {\n formattedString = this.toHex8String();\n }\n if (format === \"name\") {\n formattedString = this.toName();\n }\n if (format === \"hsl\") {\n formattedString = this.toHslString();\n }\n if (format === \"hsv\") {\n formattedString = this.toHsvString();\n }\n\n return formattedString || this.toHexString();\n },\n clone: function() {\n return tinycolor(this.toString());\n },\n\n _applyModification: function(fn, args) {\n var color = fn.apply(null, [this].concat([].slice.call(args)));\n this._r = color._r;\n this._g = color._g;\n this._b = color._b;\n this.setAlpha(color._a);\n return this;\n },\n lighten: function() {\n return this._applyModification(lighten, arguments);\n },\n brighten: function() {\n return this._applyModification(brighten, arguments);\n },\n darken: function() {\n return this._applyModification(darken, arguments);\n },\n desaturate: function() {\n return this._applyModification(desaturate, arguments);\n },\n saturate: function() {\n return this._applyModification(saturate, arguments);\n },\n greyscale: function() {\n return this._applyModification(greyscale, arguments);\n },\n spin: function() {\n return this._applyModification(spin, arguments);\n },\n\n _applyCombination: function(fn, args) {\n return fn.apply(null, [this].concat([].slice.call(args)));\n },\n analogous: function() {\n return this._applyCombination(analogous, arguments);\n },\n complement: function() {\n return this._applyCombination(complement, arguments);\n },\n monochromatic: function() {\n return this._applyCombination(monochromatic, arguments);\n },\n splitcomplement: function() {\n return this._applyCombination(splitcomplement, arguments);\n },\n triad: function() {\n return this._applyCombination(triad, arguments);\n },\n tetrad: function() {\n return this._applyCombination(tetrad, arguments);\n }\n};\n\n// If input is an object, force 1 into \"1.0\" to handle ratios properly\n// String input requires \"1.0\" as input, so 1 will be treated as 1\ntinycolor.fromRatio = function(color, opts) {\n if (typeof color == \"object\") {\n var newColor = {};\n for (var i in color) {\n if (color.hasOwnProperty(i)) {\n if (i === \"a\") {\n newColor[i] = color[i];\n }\n else {\n newColor[i] = convertToPercentage(color[i]);\n }\n }\n }\n color = newColor;\n }\n\n return tinycolor(color, opts);\n};\n\n// Given a string or object, convert that input to RGB\n// Possible string inputs:\n//\n// \"red\"\n// \"#f00\" or \"f00\"\n// \"#ff0000\" or \"ff0000\"\n// \"#ff000000\" or \"ff000000\"\n// \"rgb 255 0 0\" or \"rgb (255, 0, 0)\"\n// \"rgb 1.0 0 0\" or \"rgb (1, 0, 0)\"\n// \"rgba (255, 0, 0, 1)\" or \"rgba 255, 0, 0, 1\"\n// \"rgba (1.0, 0, 0, 1)\" or \"rgba 1.0, 0, 0, 1\"\n// \"hsl(0, 100%, 50%)\" or \"hsl 0 100% 50%\"\n// \"hsla(0, 100%, 50%, 1)\" or \"hsla 0 100% 50%, 1\"\n// \"hsv(0, 100%, 100%)\" or \"hsv 0 100% 100%\"\n//\nfunction inputToRGB(color) {\n\n var rgb = { r: 0, g: 0, b: 0 };\n var a = 1;\n var s = null;\n var v = null;\n var l = null;\n var ok = false;\n var format = false;\n\n if (typeof color == \"string\") {\n color = stringInputToObject(color);\n }\n\n if (typeof color == \"object\") {\n if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {\n rgb = rgbToRgb(color.r, color.g, color.b);\n ok = true;\n format = String(color.r).substr(-1) === \"%\" ? \"prgb\" : \"rgb\";\n }\n else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {\n s = convertToPercentage(color.s);\n v = convertToPercentage(color.v);\n rgb = hsvToRgb(color.h, s, v);\n ok = true;\n format = \"hsv\";\n }\n else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {\n s = convertToPercentage(color.s);\n l = convertToPercentage(color.l);\n rgb = hslToRgb(color.h, s, l);\n ok = true;\n format = \"hsl\";\n }\n\n if (color.hasOwnProperty(\"a\")) {\n a = color.a;\n }\n }\n\n a = boundAlpha(a);\n\n return {\n ok: ok,\n format: color.format || format,\n r: mathMin(255, mathMax(rgb.r, 0)),\n g: mathMin(255, mathMax(rgb.g, 0)),\n b: mathMin(255, mathMax(rgb.b, 0)),\n a: a\n };\n}\n\n\n// Conversion Functions\n// --------------------\n\n// `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:\n// <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript>\n\n// `rgbToRgb`\n// Handle bounds / percentage checking to conform to CSS color spec\n// <http://www.w3.org/TR/css3-color/>\n// *Assumes:* r, g, b in [0, 255] or [0, 1]\n// *Returns:* { r, g, b } in [0, 255]\nfunction rgbToRgb(r, g, b){\n return {\n r: bound01(r, 255) * 255,\n g: bound01(g, 255) * 255,\n b: bound01(b, 255) * 255\n };\n}\n\n// `rgbToHsl`\n// Converts an RGB color value to HSL.\n// *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]\n// *Returns:* { h, s, l } in [0,1]\nfunction rgbToHsl(r, g, b) {\n\n r = bound01(r, 255);\n g = bound01(g, 255);\n b = bound01(b, 255);\n\n var max = mathMax(r, g, b), min = mathMin(r, g, b);\n var h, s, l = (max + min) / 2;\n\n if(max == min) {\n h = s = 0; // achromatic\n }\n else {\n var d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch(max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4; break;\n }\n\n h /= 6;\n }\n\n return { h: h, s: s, l: l };\n}\n\n// `hslToRgb`\n// Converts an HSL color value to RGB.\n// *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]\n// *Returns:* { r, g, b } in the set [0, 255]\nfunction hslToRgb(h, s, l) {\n var r, g, b;\n\n h = bound01(h, 360);\n s = bound01(s, 100);\n l = bound01(l, 100);\n\n function hue2rgb(p, q, t) {\n if(t < 0) t += 1;\n if(t > 1) t -= 1;\n if(t < 1/6) return p + (q - p) * 6 * t;\n if(t < 1/2) return q;\n if(t < 2/3) return p + (q - p) * (2/3 - t) * 6;\n return p;\n }\n\n if(s === 0) {\n r = g = b = l; // achromatic\n }\n else {\n var q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n var p = 2 * l - q;\n r = hue2rgb(p, q, h + 1/3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1/3);\n }\n\n return { r: r * 255, g: g * 255, b: b * 255 };\n}\n\n// `rgbToHsv`\n// Converts an RGB color value to HSV\n// *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]\n// *Returns:* { h, s, v } in [0,1]\nfunction rgbToHsv(r, g, b) {\n\n r = bound01(r, 255);\n g = bound01(g, 255);\n b = bound01(b, 255);\n\n var max = mathMax(r, g, b), min = mathMin(r, g, b);\n var h, s, v = max;\n\n var d = max - min;\n s = max === 0 ? 0 : d / max;\n\n if(max == min) {\n h = 0; // achromatic\n }\n else {\n switch(max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4; break;\n }\n h /= 6;\n }\n return { h: h, s: s, v: v };\n}\n\n// `hsvToRgb`\n// Converts an HSV color value to RGB.\n// *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]\n// *Returns:* { r, g, b } in the set [0, 255]\n function hsvToRgb(h, s, v) {\n\n h = bound01(h, 360) * 6;\n s = bound01(s, 100);\n v = bound01(v, 100);\n\n var i = Math.floor(h),\n f = h - i,\n p = v * (1 - s),\n q = v * (1 - f * s),\n t = v * (1 - (1 - f) * s),\n mod = i % 6,\n r = [v, q, p, p, t, v][mod],\n g = [t, v, v, q, p, p][mod],\n b = [p, p, t, v, v, q][mod];\n\n return { r: r * 255, g: g * 255, b: b * 255 };\n}\n\n// `rgbToHex`\n// Converts an RGB color to hex\n// Assumes r, g, and b are contained in the set [0, 255]\n// Returns a 3 or 6 character hex\nfunction rgbToHex(r, g, b, allow3Char) {\n\n var hex = [\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16))\n ];\n\n // Return a 3 character hex if possible\n if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);\n }\n\n return hex.join(\"\");\n}\n\n// `rgbaToHex`\n// Converts an RGBA color plus alpha transparency to hex\n// Assumes r, g, b are contained in the set [0, 255] and\n// a in [0, 1]. Returns a 4 or 8 character rgba hex\nfunction rgbaToHex(r, g, b, a, allow4Char) {\n\n var hex = [\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16)),\n pad2(convertDecimalToHex(a))\n ];\n\n // Return a 4 character hex if possible\n if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);\n }\n\n return hex.join(\"\");\n}\n\n// `rgbaToArgbHex`\n// Converts an RGBA color to an ARGB Hex8 string\n// Rarely used, but required for \"toFilter()\"\nfunction rgbaToArgbHex(r, g, b, a) {\n\n var hex = [\n pad2(convertDecimalToHex(a)),\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16))\n ];\n\n return hex.join(\"\");\n}\n\n// `equals`\n// Can be called with any tinycolor input\ntinycolor.equals = function (color1, color2) {\n if (!color1 || !color2) { return false; }\n return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString();\n};\n\ntinycolor.random = function() {\n return tinycolor.fromRatio({\n r: mathRandom(),\n g: mathRandom(),\n b: mathRandom()\n });\n};\n\n\n// Modification Functions\n// ----------------------\n// Thanks to less.js for some of the basics here\n// <https://github.com/cloudhead/less.js/blob/master/lib/less/functions.js>\n\nfunction desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}\n\nfunction saturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s += amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}\n\nfunction greyscale(color) {\n return tinycolor(color).desaturate(100);\n}\n\nfunction lighten (color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.l += amount / 100;\n hsl.l = clamp01(hsl.l);\n return tinycolor(hsl);\n}\n\nfunction brighten(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var rgb = tinycolor(color).toRgb();\n rgb.r = mathMax(0, mathMin(255, rgb.r - mathRound(255 * - (amount / 100))));\n rgb.g = mathMax(0, mathMin(255, rgb.g - mathRound(255 * - (amount / 100))));\n rgb.b = mathMax(0, mathMin(255, rgb.b - mathRound(255 * - (amount / 100))));\n return tinycolor(rgb);\n}\n\nfunction darken (color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.l -= amount / 100;\n hsl.l = clamp01(hsl.l);\n return tinycolor(hsl);\n}\n\n// Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.\n// Values outside of this range will be wrapped into this range.\nfunction spin(color, amount) {\n var hsl = tinycolor(color).toHsl();\n var hue = (hsl.h + amount) % 360;\n hsl.h = hue < 0 ? 360 + hue : hue;\n return tinycolor(hsl);\n}\n\n// Combination Functions\n// ---------------------\n// Thanks to jQuery xColor for some of the ideas behind these\n// <https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js>\n\nfunction complement(color) {\n var hsl = tinycolor(color).toHsl();\n hsl.h = (hsl.h + 180) % 360;\n return tinycolor(hsl);\n}\n\nfunction triad(color) {\n var hsl = tinycolor(color).toHsl();\n var h = hsl.h;\n return [\n tinycolor(color),\n tinycolor({ h: (h + 120) % 360, s: hsl.s, l: hsl.l }),\n tinycolor({ h: (h + 240) % 360, s: hsl.s, l: hsl.l })\n ];\n}\n\nfunction tetrad(color) {\n var hsl = tinycolor(color).toHsl();\n var h = hsl.h;\n return [\n tinycolor(color),\n tinycolor({ h: (h + 90) % 360, s: hsl.s, l: hsl.l }),\n tinycolor({ h: (h + 180) % 360, s: hsl.s, l: hsl.l }),\n tinycolor({ h: (h + 270) % 360, s: hsl.s, l: hsl.l })\n ];\n}\n\nfunction splitcomplement(color) {\n var hsl = tinycolor(color).toHsl();\n var h = hsl.h;\n return [\n tinycolor(color),\n tinycolor({ h: (h + 72) % 360, s: hsl.s, l: hsl.l}),\n tinycolor({ h: (h + 216) % 360, s: hsl.s, l: hsl.l})\n ];\n}\n\nfunction analogous(color, results, slices) {\n results = results || 6;\n slices = slices || 30;\n\n var hsl = tinycolor(color).toHsl();\n var part = 360 / slices;\n var ret = [tinycolor(color)];\n\n for (hsl.h = ((hsl.h - (part * results >> 1)) + 720) % 360; --results; ) {\n hsl.h = (hsl.h + part) % 360;\n ret.push(tinycolor(hsl));\n }\n return ret;\n}\n\nfunction monochromatic(color, results) {\n results = results || 6;\n var hsv = tinycolor(color).toHsv();\n var h = hsv.h, s = hsv.s, v = hsv.v;\n var ret = [];\n var modification = 1 / results;\n\n while (results--) {\n ret.push(tinycolor({ h: h, s: s, v: v}));\n v = (v + modification) % 1;\n }\n\n return ret;\n}\n\n// Utility Functions\n// ---------------------\n\ntinycolor.mix = function(color1, color2, amount) {\n amount = (amount === 0) ? 0 : (amount || 50);\n\n var rgb1 = tinycolor(color1).toRgb();\n var rgb2 = tinycolor(color2).toRgb();\n\n var p = amount / 100;\n\n var rgba = {\n r: ((rgb2.r - rgb1.r) * p) + rgb1.r,\n g: ((rgb2.g - rgb1.g) * p) + rgb1.g,\n b: ((rgb2.b - rgb1.b) * p) + rgb1.b,\n a: ((rgb2.a - rgb1.a) * p) + rgb1.a\n };\n\n return tinycolor(rgba);\n};\n\n\n// Readability Functions\n// ---------------------\n// <http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef (WCAG Version 2)\n\n// `contrast`\n// Analyze the 2 colors and returns the color contrast defined by (WCAG Version 2)\ntinycolor.readability = function(color1, color2) {\n var c1 = tinycolor(color1);\n var c2 = tinycolor(color2);\n return (Math.max(c1.getLuminance(),c2.getLuminance())+0.05) / (Math.min(c1.getLuminance(),c2.getLuminance())+0.05);\n};\n\n// `isReadable`\n// Ensure that foreground and background color combinations meet WCAG2 guidelines.\n// The third argument is an optional Object.\n// the 'level' property states 'AA' or 'AAA' - if missing or invalid, it defaults to 'AA';\n// the 'size' property states 'large' or 'small' - if missing or invalid, it defaults to 'small'.\n// If the entire object is absent, isReadable defaults to {level:\"AA\",size:\"small\"}.\n\n// *Example*\n// tinycolor.isReadable(\"#000\", \"#111\") => false\n// tinycolor.isReadable(\"#000\", \"#111\",{level:\"AA\",size:\"large\"}) => false\ntinycolor.isReadable = function(color1, color2, wcag2) {\n var readability = tinycolor.readability(color1, color2);\n var wcag2Parms, out;\n\n out = false;\n\n wcag2Parms = validateWCAG2Parms(wcag2);\n switch (wcag2Parms.level + wcag2Parms.size) {\n case \"AAsmall\":\n case \"AAAlarge\":\n out = readability >= 4.5;\n break;\n case \"AAlarge\":\n out = readability >= 3;\n break;\n case \"AAAsmall\":\n out = readability >= 7;\n break;\n }\n return out;\n\n};\n\n// `mostReadable`\n// Given a base color and a list of possible foreground or background\n// colors for that base, returns the most readable color.\n// Optionally returns Black or White if the most readable color is unreadable.\n// *Example*\n// tinycolor.mostReadable(tinycolor.mostReadable(\"#123\", [\"#124\", \"#125\"],{includeFallbackColors:false}).toHexString(); // \"#112255\"\n// tinycolor.mostReadable(tinycolor.mostReadable(\"#123\", [\"#124\", \"#125\"],{includeFallbackColors:true}).toHexString(); // \"#ffffff\"\n// tinycolor.mostReadable(\"#a8015a\", [\"#faf3f3\"],{includeFallbackColors:true,level:\"AAA\",size:\"large\"}).toHexString(); // \"#faf3f3\"\n// tinycolor.mostReadable(\"#a8015a\", [\"#faf3f3\"],{includeFallbackColors:true,level:\"AAA\",size:\"small\"}).toHexString(); // \"#ffffff\"\ntinycolor.mostReadable = function(baseColor, colorList, args) {\n var bestColor = null;\n var bestScore = 0;\n var readability;\n var includeFallbackColors, level, size ;\n args = args || {};\n includeFallbackColors = args.includeFallbackColors ;\n level = args.level;\n size = args.size;\n\n for (var i= 0; i < colorList.length ; i++) {\n readability = tinycolor.readability(baseColor, colorList[i]);\n if (readability > bestScore) {\n bestScore = readability;\n bestColor = tinycolor(colorList[i]);\n }\n }\n\n if (tinycolor.isReadable(baseColor, bestColor, {\"level\":level,\"size\":size}) || !includeFallbackColors) {\n return bestColor;\n }\n else {\n args.includeFallbackColors=false;\n return tinycolor.mostReadable(baseColor,[\"#fff\", \"#000\"],args);\n }\n};\n\n\n// Big List of Colors\n// ------------------\n// <http://www.w3.org/TR/css3-color/#svg-color>\nvar names = tinycolor.names = {\n aliceblue: \"f0f8ff\",\n antiquewhite: \"faebd7\",\n aqua: \"0ff\",\n aquamarine: \"7fffd4\",\n azure: \"f0ffff\",\n beige: \"f5f5dc\",\n bisque: \"ffe4c4\",\n black: \"000\",\n blanchedalmond: \"ffebcd\",\n blue: \"00f\",\n blueviolet: \"8a2be2\",\n brown: \"a52a2a\",\n burlywood: \"deb887\",\n burntsienna: \"ea7e5d\",\n cadetblue: \"5f9ea0\",\n chartreuse: \"7fff00\",\n chocolate: \"d2691e\",\n coral: \"ff7f50\",\n cornflowerblue: \"6495ed\",\n cornsilk: \"fff8dc\",\n crimson: \"dc143c\",\n cyan: \"0ff\",\n darkblue: \"00008b\",\n darkcyan: \"008b8b\",\n darkgoldenrod: \"b8860b\",\n darkgray: \"a9a9a9\",\n darkgreen: \"006400\",\n darkgrey: \"a9a9a9\",\n darkkhaki: \"bdb76b\",\n darkmagenta: \"8b008b\",\n darkolivegreen: \"556b2f\",\n darkorange: \"ff8c00\",\n darkorchid: \"9932cc\",\n darkred: \"8b0000\",\n darksalmon: \"e9967a\",\n darkseagreen: \"8fbc8f\",\n darkslateblue: \"483d8b\",\n darkslategray: \"2f4f4f\",\n darkslategrey: \"2f4f4f\",\n darkturquoise: \"00ced1\",\n darkviolet: \"9400d3\",\n deeppink: \"ff1493\",\n deepskyblue: \"00bfff\",\n dimgray: \"696969\",\n dimgrey: \"696969\",\n dodgerblue: \"1e90ff\",\n firebrick: \"b22222\",\n floralwhite: \"fffaf0\",\n forestgreen: \"228b22\",\n fuchsia: \"f0f\",\n gainsboro: \"dcdcdc\",\n ghostwhite: \"f8f8ff\",\n gold: \"ffd700\",\n goldenrod: \"daa520\",\n gray: \"808080\",\n green: \"008000\",\n greenyellow: \"adff2f\",\n grey: \"808080\",\n honeydew: \"f0fff0\",\n hotpink: \"ff69b4\",\n indianred: \"cd5c5c\",\n indigo: \"4b0082\",\n ivory: \"fffff0\",\n khaki: \"f0e68c\",\n lavender: \"e6e6fa\",\n lavenderblush: \"fff0f5\",\n lawngreen: \"7cfc00\",\n lemonchiffon: \"fffacd\",\n lightblue: \"add8e6\",\n lightcoral: \"f08080\",\n lightcyan: \"e0ffff\",\n lightgoldenrodyellow: \"fafad2\",\n lightgray: \"d3d3d3\",\n lightgreen: \"90ee90\",\n lightgrey: \"d3d3d3\",\n lightpink: \"ffb6c1\",\n lightsalmon: \"ffa07a\",\n lightseagreen: \"20b2aa\",\n lightskyblue: \"87cefa\",\n lightslategray: \"789\",\n lightslategrey: \"789\",\n lightsteelblue: \"b0c4de\",\n lightyellow: \"ffffe0\",\n lime: \"0f0\",\n limegreen: \"32cd32\",\n linen: \"faf0e6\",\n magenta: \"f0f\",\n maroon: \"800000\",\n mediumaquamarine: \"66cdaa\",\n mediumblue: \"0000cd\",\n mediumorchid: \"ba55d3\",\n mediumpurple: \"9370db\",\n mediumseagreen: \"3cb371\",\n mediumslateblue: \"7b68ee\",\n mediumspringgreen: \"00fa9a\",\n mediumturquoise: \"48d1cc\",\n mediumvioletred: \"c71585\",\n midnightblue: \"191970\",\n mintcream: \"f5fffa\",\n mistyrose: \"ffe4e1\",\n moccasin: \"ffe4b5\",\n navajowhite: \"ffdead\",\n navy: \"000080\",\n oldlace: \"fdf5e6\",\n olive: \"808000\",\n olivedrab: \"6b8e23\",\n orange: \"ffa500\",\n orangered: \"ff4500\",\n orchid: \"da70d6\",\n palegoldenrod: \"eee8aa\",\n palegreen: \"98fb98\",\n paleturquoise: \"afeeee\",\n palevioletred: \"db7093\",\n papayawhip: \"ffefd5\",\n peachpuff: \"ffdab9\",\n peru: \"cd853f\",\n pink: \"ffc0cb\",\n plum: \"dda0dd\",\n powderblue: \"b0e0e6\",\n purple: \"800080\",\n rebeccapurple: \"663399\",\n red: \"f00\",\n rosybrown: \"bc8f8f\",\n royalblue: \"4169e1\",\n saddlebrown: \"8b4513\",\n salmon: \"fa8072\",\n sandybrown: \"f4a460\",\n seagreen: \"2e8b57\",\n seashell: \"fff5ee\",\n sienna: \"a0522d\",\n silver: \"c0c0c0\",\n skyblue: \"87ceeb\",\n slateblue: \"6a5acd\",\n slategray: \"708090\",\n slategrey: \"708090\",\n snow: \"fffafa\",\n springgreen: \"00ff7f\",\n steelblue: \"4682b4\",\n tan: \"d2b48c\",\n teal: \"008080\",\n thistle: \"d8bfd8\",\n tomato: \"ff6347\",\n turquoise: \"40e0d0\",\n violet: \"ee82ee\",\n wheat: \"f5deb3\",\n white: \"fff\",\n whitesmoke: \"f5f5f5\",\n yellow: \"ff0\",\n yellowgreen: \"9acd32\"\n};\n\n// Make it easy to access colors via `hexNames[hex]`\nvar hexNames = tinycolor.hexNames = flip(names);\n\n\n// Utilities\n// ---------\n\n// `{ 'name1': 'val1' }` becomes `{ 'val1': 'name1' }`\nfunction flip(o) {\n var flipped = { };\n for (var i in o) {\n if (o.hasOwnProperty(i)) {\n flipped[o[i]] = i;\n }\n }\n return flipped;\n}\n\n// Return a valid alpha value [0,1] with all invalid values being set to 1\nfunction boundAlpha(a) {\n a = parseFloat(a);\n\n if (isNaN(a) || a < 0 || a > 1) {\n a = 1;\n }\n\n return a;\n}\n\n// Take input from [0, n] and return it as [0, 1]\nfunction bound01(n, max) {\n if (isOnePointZero(n)) { n = \"100%\"; }\n\n var processPercent = isPercentage(n);\n n = mathMin(max, mathMax(0, parseFloat(n)));\n\n // Automatically convert percentage into number\n if (processPercent) {\n n = parseInt(n * max, 10) / 100;\n }\n\n // Handle floating point rounding errors\n if ((Math.abs(n - max) < 0.000001)) {\n return 1;\n }\n\n // Convert into [0, 1] range if it isn't already\n return (n % max) / parseFloat(max);\n}\n\n// Force a number between 0 and 1\nfunction clamp01(val) {\n return mathMin(1, mathMax(0, val));\n}\n\n// Parse a base-16 hex value into a base-10 integer\nfunction parseIntFromHex(val) {\n return parseInt(val, 16);\n}\n\n// Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1\n// <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>\nfunction isOnePointZero(n) {\n return typeof n == \"string\" && n.indexOf('.') != -1 && parseFloat(n) === 1;\n}\n\n// Check to see if string passed in is a percentage\nfunction isPercentage(n) {\n return typeof n === \"string\" && n.indexOf('%') != -1;\n}\n\n// Force a hex value to have 2 characters\nfunction pad2(c) {\n return c.length == 1 ? '0' + c : '' + c;\n}\n\n// Replace a decimal with it's percentage value\nfunction convertToPercentage(n) {\n if (n <= 1) {\n n = (n * 100) + \"%\";\n }\n\n return n;\n}\n\n// Converts a decimal to a hex value\nfunction convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}\n// Converts a hex value to a decimal\nfunction convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n}\n\nvar matchers = (function() {\n\n // <http://www.w3.org/TR/css3-values/#integers>\n var CSS_INTEGER = \"[-\\\\+]?\\\\d+%?\";\n\n // <http://www.w3.org/TR/css3-values/#number-value>\n var CSS_NUMBER = \"[-\\\\+]?\\\\d*\\\\.\\\\d+%?\";\n\n // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.\n var CSS_UNIT = \"(?:\" + CSS_NUMBER + \")|(?:\" + CSS_INTEGER + \")\";\n\n // Actual matching.\n // Parentheses and commas are optional, but not required.\n // Whitespace can take the place of commas or opening paren\n var PERMISSIVE_MATCH3 = \"[\\\\s|\\\\(]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")\\\\s*\\\\)?\";\n var PERMISSIVE_MATCH4 = \"[\\\\s|\\\\(]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")\\\\s*\\\\)?\";\n\n return {\n CSS_UNIT: new RegExp(CSS_UNIT),\n rgb: new RegExp(\"rgb\" + PERMISSIVE_MATCH3),\n rgba: new RegExp(\"rgba\" + PERMISSIVE_MATCH4),\n hsl: new RegExp(\"hsl\" + PERMISSIVE_MATCH3),\n hsla: new RegExp(\"hsla\" + PERMISSIVE_MATCH4),\n hsv: new RegExp(\"hsv\" + PERMISSIVE_MATCH3),\n hsva: new RegExp(\"hsva\" + PERMISSIVE_MATCH4),\n hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,\n hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/\n };\n})();\n\n// `isValidCSSUnit`\n// Take in a single string / number and check to see if it looks like a CSS unit\n// (see `matchers` above for definition).\nfunction isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}\n\n// `stringInputToObject`\n// Permissive string parsing. Take in a number of formats, and output an object\n// based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`\nfunction stringInputToObject(color) {\n\n color = color.replace(trimLeft,'').replace(trimRight, '').toLowerCase();\n var named = false;\n if (names[color]) {\n color = names[color];\n named = true;\n }\n else if (color == 'transparent') {\n return { r: 0, g: 0, b: 0, a: 0, format: \"name\" };\n }\n\n // Try to match string input using regular expressions.\n // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]\n // Just return an object and let the conversion functions handle that.\n // This way the result will be the same whether the tinycolor is initialized with string or object.\n var match;\n if ((match = matchers.rgb.exec(color))) {\n return { r: match[1], g: match[2], b: match[3] };\n }\n if ((match = matchers.rgba.exec(color))) {\n return { r: match[1], g: match[2], b: match[3], a: match[4] };\n }\n if ((match = matchers.hsl.exec(color))) {\n return { h: match[1], s: match[2], l: match[3] };\n }\n if ((match = matchers.hsla.exec(color))) {\n return { h: match[1], s: match[2], l: match[3], a: match[4] };\n }\n if ((match = matchers.hsv.exec(color))) {\n return { h: match[1], s: match[2], v: match[3] };\n }\n if ((match = matchers.hsva.exec(color))) {\n return { h: match[1], s: match[2], v: match[3], a: match[4] };\n }\n if ((match = matchers.hex8.exec(color))) {\n return {\n r: parseIntFromHex(match[1]),\n g: parseIntFromHex(match[2]),\n b: parseIntFromHex(match[3]),\n a: convertHexToDecimal(match[4]),\n format: named ? \"name\" : \"hex8\"\n };\n }\n if ((match = matchers.hex6.exec(color))) {\n return {\n r: parseIntFromHex(match[1]),\n g: parseIntFromHex(match[2]),\n b: parseIntFromHex(match[3]),\n format: named ? \"name\" : \"hex\"\n };\n }\n if ((match = matchers.hex4.exec(color))) {\n return {\n r: parseIntFromHex(match[1] + '' + match[1]),\n g: parseIntFromHex(match[2] + '' + match[2]),\n b: parseIntFromHex(match[3] + '' + match[3]),\n a: convertHexToDecimal(match[4] + '' + match[4]),\n format: named ? \"name\" : \"hex8\"\n };\n }\n if ((match = matchers.hex3.exec(color))) {\n return {\n r: parseIntFromHex(match[1] + '' + match[1]),\n g: parseIntFromHex(match[2] + '' + match[2]),\n b: parseIntFromHex(match[3] + '' + match[3]),\n format: named ? \"name\" : \"hex\"\n };\n }\n\n return false;\n}\n\nfunction validateWCAG2Parms(parms) {\n // return valid WCAG2 parms for isReadable.\n // If input parms are invalid, return {\"level\":\"AA\", \"size\":\"small\"}\n var level, size;\n parms = parms || {\"level\":\"AA\", \"size\":\"small\"};\n level = (parms.level || \"AA\").toUpperCase();\n size = (parms.size || \"small\").toLowerCase();\n if (level !== \"AA\" && level !== \"AAA\") {\n level = \"AA\";\n }\n if (size !== \"small\" && size !== \"large\") {\n size = \"small\";\n }\n return {\"level\":level, \"size\":size};\n}\n\n// Node: Export function\nif (typeof module !== \"undefined\" && module.exports) {\n module.exports = tinycolor;\n}\n// AMD/requirejs: Define the module\nelse if (typeof define === 'function' && define.amd) {\n define(function () {return tinycolor;});\n}\n// Browser: Expose to window\nelse {\n window.tinycolor = tinycolor;\n}\n\n})(Math);\n",
|
|
97
|
+
"/*\n * Toastr\n * Copyright 2012-2015\n * Authors: John Papa, Hans Fjällemark, and Tim Ferrell.\n * All Rights Reserved.\n * Use, reproduction, distribution, and modification of this code is subject to the terms and\n * conditions of the MIT license, available at http://www.opensource.org/licenses/mit-license.php\n *\n * ARIA Support: Greta Krafsig\n *\n * Project: https://github.com/CodeSeven/toastr\n */\n/* global define */\n(function (define) {\n define(['jquery'], function ($) {\n return (function () {\n var $container;\n var listener;\n var toastId = 0;\n var toastType = {\n error: 'error',\n info: 'info',\n success: 'success',\n warning: 'warning'\n };\n\n var toastr = {\n clear: clear,\n remove: remove,\n error: error,\n getContainer: getContainer,\n info: info,\n options: {},\n subscribe: subscribe,\n success: success,\n version: '2.1.3',\n warning: warning\n };\n\n var previousToast;\n\n return toastr;\n\n ////////////////\n\n function error(message, title, optionsOverride) {\n return notify({\n type: toastType.error,\n iconClass: getOptions().iconClasses.error,\n message: message,\n optionsOverride: optionsOverride,\n title: title\n });\n }\n\n function getContainer(options, create) {\n if (!options) { options = getOptions(); }\n $container = $('#' + options.containerId);\n if ($container.length) {\n return $container;\n }\n if (create) {\n $container = createContainer(options);\n }\n return $container;\n }\n\n function info(message, title, optionsOverride) {\n return notify({\n type: toastType.info,\n iconClass: getOptions().iconClasses.info,\n message: message,\n optionsOverride: optionsOverride,\n title: title\n });\n }\n\n function subscribe(callback) {\n listener = callback;\n }\n\n function success(message, title, optionsOverride) {\n return notify({\n type: toastType.success,\n iconClass: getOptions().iconClasses.success,\n message: message,\n optionsOverride: optionsOverride,\n title: title\n });\n }\n\n function warning(message, title, optionsOverride) {\n return notify({\n type: toastType.warning,\n iconClass: getOptions().iconClasses.warning,\n message: message,\n optionsOverride: optionsOverride,\n title: title\n });\n }\n\n function clear($toastElement, clearOptions) {\n var options = getOptions();\n if (!$container) { getContainer(options); }\n if (!clearToast($toastElement, options, clearOptions)) {\n clearContainer(options);\n }\n }\n\n function remove($toastElement) {\n var options = getOptions();\n if (!$container) { getContainer(options); }\n if ($toastElement && $(':focus', $toastElement).length === 0) {\n removeToast($toastElement);\n return;\n }\n if ($container.children().length) {\n $container.remove();\n }\n }\n\n // internal functions\n\n function clearContainer (options) {\n var toastsToClear = $container.children();\n for (var i = toastsToClear.length - 1; i >= 0; i--) {\n clearToast($(toastsToClear[i]), options);\n }\n }\n\n function clearToast ($toastElement, options, clearOptions) {\n var force = clearOptions && clearOptions.force ? clearOptions.force : false;\n if ($toastElement && (force || $(':focus', $toastElement).length === 0)) {\n $toastElement[options.hideMethod]({\n duration: options.hideDuration,\n easing: options.hideEasing,\n complete: function () { removeToast($toastElement); }\n });\n return true;\n }\n return false;\n }\n\n function createContainer(options) {\n $container = $('<div/>')\n .attr('id', options.containerId)\n .addClass(options.positionClass);\n\n $container.appendTo($(options.target));\n return $container;\n }\n\n function getDefaults() {\n return {\n tapToDismiss: true,\n toastClass: 'toast',\n containerId: 'toast-container',\n debug: false,\n\n showMethod: 'fadeIn', //fadeIn, slideDown, and show are built into jQuery\n showDuration: 300,\n showEasing: 'swing', //swing and linear are built into jQuery\n onShown: undefined,\n hideMethod: 'fadeOut',\n hideDuration: 1000,\n hideEasing: 'swing',\n onHidden: undefined,\n closeMethod: false,\n closeDuration: false,\n closeEasing: false,\n closeOnHover: true,\n\n extendedTimeOut: 1000,\n iconClasses: {\n error: 'toast-error',\n info: 'toast-info',\n success: 'toast-success',\n warning: 'toast-warning'\n },\n iconClass: 'toast-info',\n positionClass: 'toast-top-right',\n timeOut: 5000, // Set timeOut and extendedTimeOut to 0 to make it sticky\n titleClass: 'toast-title',\n messageClass: 'toast-message',\n escapeHtml: false,\n target: 'body',\n closeHtml: '<button type=\"button\">×</button>',\n closeClass: 'toast-close-button',\n newestOnTop: true,\n preventDuplicates: false,\n progressBar: false,\n progressClass: 'toast-progress',\n rtl: false\n };\n }\n\n function publish(args) {\n if (!listener) { return; }\n listener(args);\n }\n\n function notify(map) {\n var options = getOptions();\n var iconClass = map.iconClass || options.iconClass;\n\n if (typeof (map.optionsOverride) !== 'undefined') {\n options = $.extend(options, map.optionsOverride);\n iconClass = map.optionsOverride.iconClass || iconClass;\n }\n\n if (shouldExit(options, map)) { return; }\n\n toastId++;\n\n $container = getContainer(options, true);\n\n var intervalId = null;\n var $toastElement = $('<div/>');\n var $titleElement = $('<div/>');\n var $messageElement = $('<div/>');\n var $progressElement = $('<div/>');\n var $closeElement = $(options.closeHtml);\n var progressBar = {\n intervalId: null,\n hideEta: null,\n maxHideTime: null\n };\n var response = {\n toastId: toastId,\n state: 'visible',\n startTime: new Date(),\n options: options,\n map: map\n };\n\n personalizeToast();\n\n displayToast();\n\n handleEvents();\n\n publish(response);\n\n if (options.debug && console) {\n console.log(response);\n }\n\n return $toastElement;\n\n function escapeHtml(source) {\n if (source == null) {\n source = '';\n }\n\n return source\n .replace(/&/g, '&')\n .replace(/\"/g, '"')\n .replace(/'/g, ''')\n .replace(/</g, '<')\n .replace(/>/g, '>');\n }\n\n function personalizeToast() {\n setIcon();\n setTitle();\n setMessage();\n setCloseButton();\n setProgressBar();\n setRTL();\n setSequence();\n setAria();\n }\n\n function setAria() {\n var ariaValue = '';\n switch (map.iconClass) {\n case 'toast-success':\n case 'toast-info':\n ariaValue = 'polite';\n break;\n default:\n ariaValue = 'assertive';\n }\n $toastElement.attr('aria-live', ariaValue);\n }\n\n function handleEvents() {\n if (options.closeOnHover) {\n $toastElement.hover(stickAround, delayedHideToast);\n }\n\n if (!options.onclick && options.tapToDismiss) {\n $toastElement.click(hideToast);\n }\n\n if (options.closeButton && $closeElement) {\n $closeElement.click(function (event) {\n if (event.stopPropagation) {\n event.stopPropagation();\n } else if (event.cancelBubble !== undefined && event.cancelBubble !== true) {\n event.cancelBubble = true;\n }\n\n if (options.onCloseClick) {\n options.onCloseClick(event);\n }\n\n hideToast(true);\n });\n }\n\n if (options.onclick) {\n $toastElement.click(function (event) {\n options.onclick(event);\n hideToast();\n });\n }\n }\n\n function displayToast() {\n $toastElement.hide();\n\n $toastElement[options.showMethod](\n {duration: options.showDuration, easing: options.showEasing, complete: options.onShown}\n );\n\n if (options.timeOut > 0) {\n intervalId = setTimeout(hideToast, options.timeOut);\n progressBar.maxHideTime = parseFloat(options.timeOut);\n progressBar.hideEta = new Date().getTime() + progressBar.maxHideTime;\n if (options.progressBar) {\n progressBar.intervalId = setInterval(updateProgress, 10);\n }\n }\n }\n\n function setIcon() {\n if (map.iconClass) {\n $toastElement.addClass(options.toastClass).addClass(iconClass);\n }\n }\n\n function setSequence() {\n if (options.newestOnTop) {\n $container.prepend($toastElement);\n } else {\n $container.append($toastElement);\n }\n }\n\n function setTitle() {\n if (map.title) {\n var suffix = map.title;\n if (options.escapeHtml) {\n suffix = escapeHtml(map.title);\n }\n $titleElement.append(suffix).addClass(options.titleClass);\n $toastElement.append($titleElement);\n }\n }\n\n function setMessage() {\n if (map.message) {\n var suffix = map.message;\n if (options.escapeHtml) {\n suffix = escapeHtml(map.message);\n }\n $messageElement.append(suffix).addClass(options.messageClass);\n $toastElement.append($messageElement);\n }\n }\n\n function setCloseButton() {\n if (options.closeButton) {\n $closeElement.addClass(options.closeClass).attr('role', 'button');\n $toastElement.prepend($closeElement);\n }\n }\n\n function setProgressBar() {\n if (options.progressBar) {\n $progressElement.addClass(options.progressClass);\n $toastElement.prepend($progressElement);\n }\n }\n\n function setRTL() {\n if (options.rtl) {\n $toastElement.addClass('rtl');\n }\n }\n\n function shouldExit(options, map) {\n if (options.preventDuplicates) {\n if (map.message === previousToast) {\n return true;\n } else {\n previousToast = map.message;\n }\n }\n return false;\n }\n\n function hideToast(override) {\n var method = override && options.closeMethod !== false ? options.closeMethod : options.hideMethod;\n var duration = override && options.closeDuration !== false ?\n options.closeDuration : options.hideDuration;\n var easing = override && options.closeEasing !== false ? options.closeEasing : options.hideEasing;\n if ($(':focus', $toastElement).length && !override) {\n return;\n }\n clearTimeout(progressBar.intervalId);\n return $toastElement[method]({\n duration: duration,\n easing: easing,\n complete: function () {\n removeToast($toastElement);\n clearTimeout(intervalId);\n if (options.onHidden && response.state !== 'hidden') {\n options.onHidden();\n }\n response.state = 'hidden';\n response.endTime = new Date();\n publish(response);\n }\n });\n }\n\n function delayedHideToast() {\n if (options.timeOut > 0 || options.extendedTimeOut > 0) {\n intervalId = setTimeout(hideToast, options.extendedTimeOut);\n progressBar.maxHideTime = parseFloat(options.extendedTimeOut);\n progressBar.hideEta = new Date().getTime() + progressBar.maxHideTime;\n }\n }\n\n function stickAround() {\n clearTimeout(intervalId);\n progressBar.hideEta = 0;\n $toastElement.stop(true, true)[options.showMethod](\n {duration: options.showDuration, easing: options.showEasing}\n );\n }\n\n function updateProgress() {\n var percentage = ((progressBar.hideEta - (new Date().getTime())) / progressBar.maxHideTime) * 100;\n $progressElement.width(percentage + '%');\n }\n }\n\n function getOptions() {\n return $.extend({}, getDefaults(), toastr.options);\n }\n\n function removeToast($toastElement) {\n if (!$container) { $container = getContainer(); }\n if ($toastElement.is(':visible')) {\n return;\n }\n $toastElement.remove();\n $toastElement = null;\n if ($container.children().length === 0) {\n $container.remove();\n previousToast = undefined;\n }\n }\n\n })();\n });\n}(typeof define === 'function' && define.amd ? define : function (deps, factory) {\n if (typeof module !== 'undefined' && module.exports) { //Node\n module.exports = factory(require('jquery'));\n } else {\n window.toastr = factory(window.jQuery);\n }\n}));\n",
|
|
98
|
+
"var templateSystem = require('../src/js/bindings/choose-template.js');\ndocument.addEventListener('DOMContentLoaded', function(event) {\ntemplateSystem.addTemplate(\"array\", \"<!-- ko foreach: $data --><!-- ko block: $data --><!-- /ko --><!-- /ko -->\");\ntemplateSystem.addTemplate(\"block-show\", \"<!-- ko block: $data, scrollIntoView: $root.selectedBlock() === $data --><!-- /ko -->\");\ntemplateSystem.addTemplate(\"block-wysiwyg\", \"<div class=\\x22editable block\\x22 data-drop-content=\\x22Drop here\\x22 data-bind=\\x22attr: { 'data-drop-content': $root.t('Drop here') }, click: function(obj, evt) { $root.selectBlock(obj); return true }, clickBubble: false, css: { selected: $root.selectedBlock() === $data }, scrollIntoView: $root.selectedBlock() === $data\\x22> <div class=\\x22mo-blockselectionhelper\\x22></div> <div class=\\x22tools\\x22 data-bind=\\x22tooltips: {}\\x22> <!-- ko if: typeof $index != 'undefined' --> <div title=\\x22Drag this handle to move the block\\x22 data-bind=\\x22attr: { title: $root.t('Drag this handle to move the block') }\\x22 class=\\x22tool handle\\x22><i class=\\x22fa fa-fw fa-sort\\x22></i></div> <!-- ko if: $index() > 0 --> <div title=\\x22Move this block upside\\x22 data-bind=\\x22attr: { title: $root.t('Move this block upside') }\\x22 class=\\x22tool moveup\\x22><i class=\\x22fa fa-fw fa-sort-asc\\x22 data-bind='click: $root.moveBlock.bind($element, $index, $parent, true)'></i></div> <!-- /ko --> <!-- ko if: $index() < $parent.blocks().length -1 --> <div title=\\x22Move this block downside\\x22 data-bind=\\x22attr: { title: $root.t('Move this block downside') }\\x22 class=\\x22tool movedown\\x22><i class=\\x22fa fa-fw fa-sort-desc\\x22 data-bind='click: $root.moveBlock.bind($element, $index, $parent, false)'></i></div> <!-- /ko --> <div title=\\x22Delete block\\x22 class=\\x22tool delete\\x22 data-bind=\\x22attr: { title: $root.t('Delete block') }, click: $root.removeBlock.bind($element, $rawData, $parent)\\x22><i class=\\x22fa fa-fw fa-trash-o\\x22></i></div> <div title=\\x22Duplicate block\\x22 class=\\x22tool clone\\x22 data-bind=\\x22attr: { title: $root.t('Duplicate block') }, click: $root.duplicateBlock.bind($element, $index, $parent)\\x22><i class=\\x22fa fa-fw fa-files-o\\x22></i></div> <!-- /ko --> <!-- ko if: typeof $data._nextVariant != 'undefined' --><div title=\\x22Switch block variant\\x22 class=\\x22tool variant\\x22 data-bind=\\x22attr: { title: $root.t('Switch block variant') }, click: $data._nextVariant\\x22><i class=\\x22fa fa-fw fa-magic\\x22></i></div><!-- /ko --> </div> <!-- ko block: $data --><!-- /ko --></div>\");\ntemplateSystem.addTemplate(\"blocks-show\", \"<!-- ko template: { name: 'block-show', foreach: blocks } --><!-- /ko -->\");\ntemplateSystem.addTemplate(\"blocks-wysiwyg\", \"<div class=\\x22sortable-blocks-edit\\x22 data-drop-content=\\x22Drop here\\x22 data-empty-content=\\x22Drop here blocks from the Blocks tab\\x22 data-bind=\\x22attr: { 'data-drop-content': $root.t('Drop here'), 'data-empty-content': $root.t('Drop here blocks from the "Blocks" tab') }, css: { 'empty': ko.utils.unwrapObservable(blocks).length == 0 }, extsortable: { connectClass: 'sortable-blocks-edit', template: 'block-wysiwyg', data: blocks, dragging: $root.dragging, beforeMove: $root.startMultiple, afterMove: $root.stopMultiple, options: { handle: '.handle', placeholder: $root.placeholderHelper } }\\x22></div>\");\ntemplateSystem.addTemplate(\"customstyle\", \"<div class=\\x22customStyleHelp\\x22 data-bind=\\x22html: $root.t('Customized block.<ul><li>In this status changes to properties will be specific to the current block (instead of being global to all blocks in the same section)</li><li>A <span class="customStyled"><span>"small cube" </span></span> icon beside the property will mark the customization. By clicking this icon the property value will be reverted to the value defined for the section.</li></ul>')\\x22>Customized block.<ul><li>In this status changes to properties will be specific to the current block (instead of being global to all blocks in the same section)</li><li>A <span class=\\x22customStyled\\x22><span>\\x22small cube\\x22 </span></span> icon beside the property will mark the customization. By clicking this icon the property value will be reverted to the value defined for the section.</li></ul></div>\");\ntemplateSystem.addTemplate(\"empty\", \"\");\ntemplateSystem.addTemplate(\"error\", \"[<div style=\\x22background-color: #fff0f0\\x22 data-bind=\\x22text: ko.toJS($data)\\x22></div>]\");\ntemplateSystem.addTemplate(\"gallery-images\", \"<div data-bind=\\x22foreach: items.currentPageData\\x22> <div class=\\x22draggable-item\\x22 data-bind=\\x22if: typeof thumbnailUrl != 'undefined'\\x22> <div class=\\x22draggable image\\x22 data-bind=\\x22click: $root.addImage, extdraggable: { data: $data, dropContainer: '#main-wysiwyg-area', dragging: $root.draggingImage, 'options': { 'appendTo': '#page' } }, style: { backgroundImage: 'url(\\\\'' + thumbnailUrl + '\\\\')' }\\x22> <img title=\\x22Drag this image and drop it on any template image placeholder\\x22 style=\\x22display: block;\\x22 data-bind=\\x22tooltips: {}, attr: { src: thumbnailUrl, 'title': $root.t('Drag this image and drop it on any template image placeholder') }\\x22/> </div> </div></div><!-- ko if: items.pageCount() > 1 --><div class=\\x22galleryPager\\x22 data-bind=\\x22buttonset: {}\\x22> <a href=\\x22javascript:void(0)\\x22 data-bind=\\x22click: items.moveFirst, button: { disabled: items.currentPage() == 1, icons: { primary: 'fa fa-fast-backward' }, text: false }\\x22>First</a> <a href=\\x22javascript:void(0)\\x22 data-bind=\\x22click: items.movePrevious, button: { disabled: items.currentPage() == 1, icons: { primary: 'fa fa-backward' }, text: false }\\x22>Previous</a> <span data-bind=\\x22button: { disabled: true, text: true, label: ' '+items.currentPage()+' di '+items.pageCount()+' ' }\\x22> X di Y </span> <a href=\\x22javascript:void(0)\\x22 data-bind=\\x22click: items.moveNext, button: { disabled: items.currentPage() == items.pageCount(), icons: { primary: 'fa fa-forward' }, text: false }\\x22>Next</a> <a href=\\x22javascript:void(0)\\x22 data-bind=\\x22click: items.moveLast, button: { disabled: items.currentPage() == items.pageCount(), icons: { primary: 'fa fa-fast-forward' }, text: false }\\x22>Last</a></div><!-- /ko -->\");\ntemplateSystem.addTemplate(\"img-wysiwyg\", \"<table tabfocus=\\x220\\x22 cellspacing=\\x220\\x22 cellpadding=\\x220\\x22 data-drop-content=\\x22Drop here\\x22 data-bind=\\x22style: _stylebind, click: function(obj, evt) { $root.selectItem(_item, _data); return true; }, clickBubble: false, fudroppable: { activeClass: 'ui-state-highlight', hoverClass: 'ui-state-draghover' }, droppable: { options: { accept: '.image', activeClass: 'ui-state-highlight', hoverClass: 'ui-state-draghover' }, data: _src, dragged: $root.fileToImage }, css: { selecteditem: $root.isSelectedItem(_item) }, scrollIntoView: $root.isSelectedItem(_item), attr: { 'data-drop-content': $root.t('Drop here'), width: _width, height: _height, align: _align }\\x22 class=\\x22img-wysiwyg selectable-img\\x22 style=\\x22display: table;\\x22><tr><td class=\\x22uploadzone\\x22> <div class=\\x22mo-imgselectionhelper\\x22></div> <div class=\\x22mo-uploadzone\\x22></div> <div class=\\x22img-size\\x22 data-bind=\\x22text: _size\\x22>size</div> <div class=\\x22midtools\\x22 data-bind=\\x22tooltips: {}\\x22> <!-- ko if: _src() != '' --> <div title=\\x22Remove image\\x22 class=\\x22tool delete\\x22 data-bind=\\x22attr: { title: $root.t('Remove image') }, click: _src.bind(_src, ''), clickBubble: false\\x22><i class=\\x22fa fa-fw fa-trash-o\\x22></i></div> <!-- ko if: typeof $root.editImage !== 'undefined' --> <div title=\\x22Open the image editing tool\\x22 class=\\x22tool edit\\x22 data-bind=\\x22attr: { title: $root.t('Open the image editing tool') }, click: $root.editImage.bind($element, _src), clickBubble: false\\x22><i class=\\x22fa fa-fw fa-pencil\\x22></i></div> <!-- /ko --> <!-- /ko --> <!-- ko if: _src() == '' --> <div title=\\x22Upload a new image\\x22 data-bind=\\x22attr: { title: $root.t('Upload a new image') }\\x22 class=\\x22tool upload\\x22 style=\\x22position: relative; overflow: hidden;\\x22><i class=\\x22fa fa-fw fa-upload\\x22></i> <input class=\\x22fileupload nofile\\x22 type=\\x22file\\x22 name=\\x22files[]\\x22 data-bind=\\x22fileupload: { data: _src, onerror: $root.notifier.error, onfile: $root.loadImage, canvasPreview: true }\\x22 style=\\x22z-index: 20; position: absolute; top: 0; left: 0; right: 0; bottom: 0; min-width: 100%; min-height: 100%; font-size: 999px; text-align: right; filter: alpha(opacity=0); opacity: 0; outline: none; cursor: inherit; display: block\\x22> </div> <!-- /ko --> </div> <!-- ko template: _template --><!-- /ko --> <!-- ko if: _src() == '' --> <!-- <img style=\\x22display: block;\\x22 class=\\x22imgplaceholder\\x22 width=\\x22200\\x22 src=\\x22\\x22 alt=\\x22Insert an image here\\x22 data-bind=\\x22wysiwygSrc: { src: _src.preloaded, placeholder: _placeholdersrc, width: _width, height: _height, method: _method }\\x22 /> --> <span class=\\x22fileuploadtext\\x22 style=\\x22text-align: center; display: -ms-flexbox; display: flex; align-items: center; flex-align: center; justify-content: center; padding: 1em; position: absolute; top: 0; left: 0; right: 0; bottom: 0;\\x22><span class=\\x22textMiddle\\x22 style=\\x22 text-shadow: 1px 1px 0 #FFFFFF, 0 0 10px #FFFFFF; font-weight: bold;\\x22 data-bind=\\x22text: $root.t('Drop an image here')\\x22>Drop an image here</span></span> <!-- /ko --> <!-- ko if: _src() != '' --> <!-- <img style=\\x22display: block;\\x22 width=\\x22200\\x22 src=\\x22\\x22 data-bind=\\x22preloader: _src, wysiwygSrc: { src: _src.preloaded, placeholder: _placeholdersrc, width: _width, height: _height, method: _method }\\x22 /> --> <!-- /ko --> <!-- pulsante per la cancellazione --> <div title=\\x22Drop an image here or click the upload button\\x22 data-bind=\\x22attr: { title: $root.t('Drop an image here or click the upload button') }, tooltips: {}\\x22 class=\\x22workzone\\x22 style=\\x22position: absolute; top: 0; left: 0; right: 0; bottom: 0; overflow: hidden;\\x22> <!-- ko if: _src.preloaded && _src() != _src.preloaded() -->PRELOADING....<!-- /ko --> <!-- ko if: _src() != '' --> <input class=\\x22fileupload withfile\\x22 type=\\x22file\\x22 name=\\x22files[]\\x22 data-bind=\\x22fileupload: { data: _src, onerror: $root.notifier.error, onfile: $root.galleryRecent.unshift.bind($root.galleryRecent), canvasPreview: true }\\x22 style=\\x22z-index: -20; position: absolute; top: 0; left: 0; right: 0; bottom: 0; min-width: 100%; min-height: 100%; font-zie: 999px; text-align: right; filter: alpha(opacity=0); opacity: 0; outline: none; cursor: inherit; display: block\\x22> <!-- /ko --> <div class=\\x22progress\\x22 style=\\x22opacity: .5; width: 80%; margin-left: 10%; position: absolute; bottom: 30%; height: 20px; border: 2px solid black;\\x22> <div class=\\x22progress-bar progress-bar-success\\x22 style=\\x22height: 20px; background-color: black; \\x22></div> </div> </div></table>\");\ntemplateSystem.addTemplate(\"main\", \"<div id=\\x22page\\x22 style=\\x22display: none;\\x22 data-bind=\\x22visible: true, css: { withToolbox: $root.showToolbox, withPreviewFrame: showPreviewFrame }\\x22> <div id=\\x22main-edit-area\\x22 data-bind=\\x22click: function(obj, evt) { $root.selectBlock(null); return true; }, clickBubble: false\\x22> <!-- ko withProperties: { templateMode: 'wysiwyg', templateModeFallback: 'show' } --> <div id=\\x22main-wysiwyg-area\\x22 data-bind=\\x22wysiwygScrollfix: true, scrollable: true, fudroppable: { active: draggingImage }, css: { isdragging: dragging, isdraggingimg: draggingImage }, block: content\\x22></div> <!-- /ko --> </div> <div id=\\x22toolbar\\x22 class=\\x22mo\\x22 data-bind=\\x22tooltips: {}\\x22> <!-- ko if: typeof $root.undo != 'undefined' --> <span data-bind=\\x22buttonset: { }\\x22 class=\\x22leftButtons\\x22> <a title=\\x22Undo last operation\\x22 href=\\x22javascript:void(0)\\x22 data-bind=\\x22attr: { title: $root.t('Undo last operation') }, click: $root.undo.execute, clickBubble: false, button: { disabled: !$root.undo.enabled(), icons: { primary: 'fa fa-reply' }, label: $root.undo.name, text: true }\\x22>UNDO</a> <a title=\\x22Redo last operation\\x22 href=\\x22javascript:void(0)\\x22 data-bind=\\x22attr: { title: $root.t('Redo last operation') }, click: $root.redo.execute, clickBubble: false, button: { disabled: !$root.redo.enabled(), icons: { primary: 'fa fa-share' }, label: $root.redo.name, text: true }\\x22>REDO</a> </span> <!-- ko if: $root.debug --> <a href=\\x22javascript:void(0)\\x22 data-bind=\\x22click: $root.undoReset, clickBubble: false, button: { disabled: !$root.undo.enabled() && !$root.redo.enabled(), label: 'reset', text: true }\\x22>RESET</a> <!-- /ko --> <!-- /ko --> <span> <input id=\\x22showGallery\\x22 type=\\x22checkbox\\x22 data-bind=\\x22checked: $root.showGallery, button: { refreshOn: $root.showGallery, icons: { primary: 'fa fa-fw fa-picture-o', secondary: null }, text: true, label: $root.t('Gallery') }\\x22><label title=\\x22Show image gallery\\x22 for=\\x22showGallery\\x22 data-bind=\\x22attr: { title: $root.t('Show image gallery') }\\x22>show gallery</label></input> </span> <input id=\\x22previewFrameToggle\\x22 type=\\x22checkbox\\x22 data-bind=\\x22checked: $root.showPreviewFrame, button: { refreshOn: $root.showPreviewFrame, icons: { primary: 'fa fa-fw fa-tablet', secondary: null }, text: false, label: $root.t('Preview') }\\x22><label title=\\x22Show live preview\\x22 for=\\x22previewFrameToggle\\x22 data-bind=\\x22attr: { title: $root.t('Show live preview') }\\x22>PREVIEW</label></input> <!-- ko if: $root.debug --> <a href=\\x22javascript:void(0)\\x22 data-bind=\\x22click: $root.export, clickBubble: false, button: { label: 'export', text: true }\\x22>EXPORT</a> <input type=\\x22checkbox\\x22 data-bind=\\x22checked: $root.debug\\x22 /> debug <a href=\\x22javascript:void(0)\\x22 data-bind=\\x22click: $root.loadDefaultBlocks, clickBubble: false, button: { icons: { primary: 'fa fa-fw fa-upload' }, label: 'Default', text: true }\\x22>LOAD BLOCKS</a> [<a id=\\x22subscriptionsCount\\x22 href=\\x22javascript:viewModel.loopSubscriptionsCount()\\x22>subs</a>] <!-- /ko --> <span data-bind=\\x22visible: false\\x22> <input type=\\x22checkbox\\x22 data-bind=\\x22checked: $root.showToolbox\\x22 /> toolbox </span> <div class=\\x22rightButtons\\x22> <!-- ko if: typeof $root.save !== 'undefined' --> <a title=\\x22Save template\\x22 href=\\x22javascript:void(0)\\x22 data-bind=\\x22attr: { title: $root.t('Save template') }, click: $root.save.execute, clickBubble: false, button: { disabled: !$root.save.enabled(), icons: { primary: 'fa fa-fw fa-cloud-upload' }, label: $root.t($root.save.name), text: true }\\x22>SALVA</a> <!-- /ko --> <!-- ko if: typeof $root.test !== 'undefined' --> <a title=\\x22Show preview and send test\\x22 href=\\x22javascript:void(0)\\x22 data-bind=\\x22attr: { title: $root.t('Show preview and send test') }, click: $root.test.execute, clickBubble: false, button: { disabled: !$root.test.enabled(), icons: { primary: 'fa fa-fw fa-paper-plane' }, label: $root.t($root.test.name), text: true }\\x22>TEST</a> <!-- /ko --> <!-- ko if: typeof $root.download !== 'undefined' --> <form id=\\x22downloadForm\\x22 action=\\x22#\\x22 method=\\x22POST\\x22> <input type=\\x22hidden\\x22 name=\\x22action\\x22 value=\\x22download\\x22 /> <input type=\\x22hidden\\x22 name=\\x22filename\\x22 value=\\x22email.html\\x22 /> <input type=\\x22hidden\\x22 name=\\x22html\\x22 id=\\x22downloadHtmlTextarea\\x22 /> <a title=\\x22Download template\\x22 href=\\x22javascript:void(0)\\x22 data-bind=\\x22attr: { title: $root.t('Download template') }, click: $root.download.execute, clickBubble: false, button: { disabled: !$root.download.enabled(), icons: { primary: 'fa fa-fw fa-download' }, label: $root.t($root.download.name), text: true }\\x22>DOWNLOAD</a> </form> <!-- /ko --> </div> </div> <!-- ko if: $root.showToolbox --> <div id=\\x22main-toolbox\\x22 class=\\x22mo\\x22 data-bind=\\x22scrollable: true, withProperties: { templateMode: 'edit' }\\x22> <div data-bind=\\x22template: { name: 'toolbox' }\\x22></div> </div> <!-- /ko --> <div id=\\x22main-preview\\x22 class=\\x22mo\\x22 data-bind=\\x22scrollable: true, if: $root.showPreviewFrame\\x22> <div id=\\x22preview-toolbar\\x22> <div data-bind=\\x22visible: $root.showPreviewFrame, buttonset: { }\\x22 style=\\x22display: inline-block\\x22> <input id=\\x22previewLarge\\x22 type=\\x22radio\\x22 name=\\x22previewMode\\x22 value=\\x22large\\x22 data-bind=\\x22checked: $root.previewMode, button: { text: false, label: 'large', icons: { primary: 'fa fa-fw fa-desktop' } }\\x22 /> <label for=\\x22previewLarge\\x22 title=\\x22Large screen\\x22 data-bind=\\x22attr: { title: $root.t('Large screen') }\\x22>Large screen</label> <input id=\\x22previewDesktop\\x22 type=\\x22radio\\x22 name=\\x22previewMode\\x22 value=\\x22desktop\\x22 data-bind=\\x22checked: $root.previewMode, button: { text: false, label: 'desktop', icons: { primary: 'fa fa-fw fa-tablet' } }\\x22 /> <label for=\\x22previewDesktop\\x22 title=\\x22Tablet\\x22 data-bind=\\x22attr: { title: $root.t('Tablet') }\\x22>Tablet</label> <input id=\\x22previewMobile\\x22 type=\\x22radio\\x22 name=\\x22previewMode\\x22 value=\\x22mobile\\x22 data-bind=\\x22checked: $root.previewMode, button: { text: false, label: 'mobile', icons: { primary: 'fa fa-fw fa-mobile' } }\\x22 /> <label for=\\x22previewMobile\\x22 title=\\x22Smartphone\\x22 data-bind=\\x22attr: { title: $root.t('Smartphone') }\\x22>Smartphone</label> </div> </div> <div id=\\x22frame-container\\x22 data-bind=\\x22css: { desktop: $root.previewMode() == 'desktop', mobile: $root.previewMode() == 'mobile', large: $root.previewMode() == 'large' }\\x22> <iframe data-bind=\\x22bindIframe: $data\\x22></iframe> </div> </div> <div class=\\x22mo\\x22 id=\\x22mo-body\\x22></div> <!-- TODO REMOVE ME <div id=\\x22incompatible-browser\\x22 title=\\x22Unsupported browser\\x22 style=\\x22display: none\\x22 data-bind=\\x22attr: { title: $root.t('Usupported browser') }, html: '<p>Your browser is not supported.</p><p>Use a different browser or try updaring your browser.</p><p>Supported browsers: <ul><li>Internet Explorer >= 10</li><li>Google Chrome >= 30</li><li>Apple Safari >= 5</li><li>Mozilla Firefix >= 20</li></ul></p>'\\x22> Unsupported browser </div> --> <div id=\\x22incompatible-template\\x22 title=\\x22Saved model is obsolete\\x22 style=\\x22display: none\\x22 data-bind=\\x22attr: { title: $root.t('Saved model is obsolete') }, html: $root.t('<p>The saved model has been created with a previous, non completely compatible version, of the template</p><p>Some content or style in the model <b>COULD BE LOST</b> if you will <b>save</b></p><p>Contact us for more informations!</p>')\\x22> Incompatible template </div> <div id=\\x22fake-image-editor\\x22 title=\\x22Fake image editor\\x22 style=\\x22display: none\\x22 data-bind=\\x22attr: { title: $root.t('Fake image editor') }, html: $root.t('<p>Fake image editor</p>')\\x22> <p>Fake image editor</p> </div></div><!-- ko if: $root.logoPath --><div id=\\x22loading\\x22 class=\\x22loading\\x22 style=\\x22display: block; width: 300px; text-align: center; height: 32px; position: absolute; top:0; bottom: 0; left: 0; right: 0; margin: auto;\\x22 data-bind=\\x22attr: { style: 'position: absolute; top: 5px; left: 6px; z-index: 150;'}, css: { loading: false }\\x22> <a href=\\x22/\\x22 data-bind=\\x22attr: { href: $root.logoUrl, alt: $root.logoAlt }\\x22><img data-bind=\\x22attr: { src: $root.logoPath }\\x22 width=\\x2232\\x22 height=\\x2232\\x22 alt=\\x22mosaico\\x22 border=\\x220\\x22 /></a> <div style=\\x22opacity: 0\\x22 data-bind=\\x22visible: false\\x22>Oppps... !!</div></div><!-- /ko -->\");\ntemplateSystem.addTemplate(\"toolbox\", \"<div id=\\x22tooltabs\\x22 class=\\x22tabs_horizontal button_color\\x22 data-bind=\\x22tabs: { active: $root.selectedTool }\\x22> <ul> <li data-bind=\\x22tooltips: {}\\x22><a title=\\x22Blocks ready to be added to the template\\x22 data-local=\\x22true\\x22 href=\\x22#toolblocks\\x22 data-bind=\\x22attr: { title: $root.t('Blocks ready to be added to the template') }\\x22><i class=\\x22fa fa-fw fa-cubes\\x22></i> <span data-bind=\\x22html: $root.t('Blocks')\\x22>Blocks</span></a></li> <li data-bind=\\x22tooltips: {}\\x22><a title=\\x22Edit content options\\x22 href=\\x22#toolcontents\\x22 data-local=\\x22true\\x22 data-bind=\\x22attr: { title: $root.t('Edit content options') }\\x22><i class=\\x22fa fa-fw fa-pencil\\x22></i> <span data-bind=\\x22html: $root.t('Content')\\x22>Content</span></a></li> <li data-bind=\\x22tooltips: {}\\x22><a title=\\x22Edit style options\\x22 href=\\x22#toolstyles\\x22 data-local=\\x22true\\x22 data-bind=\\x22attr: { title: $root.t('Edit style options') }\\x22><i class=\\x22fa fa-fw fa-paint-brush\\x22></i> <span data-bind=\\x22html: $root.t('Style')\\x22>Style</span></a></li> </ul> <div id=\\x22toolblocks\\x22 data-bind=\\x22scrollable: true\\x22> <div class=\\x22block-list\\x22 data-bind=\\x22foreach: blockDefs\\x22 style=\\x22text-align: center\\x22> <div class=\\x22draggable-item\\x22 data-bind=\\x22withProperties: { templateMode: 'show' }\\x22> <div class=\\x22block\\x22 data-bind=\\x22extdraggable: { connectClass: 'sortable-blocks-edit', data: $data, dropContainer: '#main-wysiwyg-area', dragging: $root.dragging, 'options': { handle: '.handle', distance: 10, 'appendTo': '#page' } }, click: $root.addBlock\\x22 style=\\x22position: relative;\\x22> <div title=\\x22Click or drag to add this block to the template\\x22 class=\\x22handle\\x22 data-bind=\\x22attr: { title: $root.t('Click or drag to add this block to the template') }, tooltips: {}\\x22></div> <img data-bind=\\x22attr: { alt: $root.t('Block __name__', { name: ko.utils.unwrapObservable(type) }), src: $root.templatePath('edres/'+ko.utils.unwrapObservable(type)+'.png') }\\x22 alt=\\x22Block __name__\\x22 /> </div> <a href=\\x22javascript:void(0)\\x22 class=\\x22addblockbutton\\x22 data-bind=\\x22click: $root.addBlock, button: { label: $root.t('Add') }\\x22>Add</a> </div> </div> </div> <div id=\\x22toolcontents\\x22 data-bind=\\x22scrollable: true\\x22> <!-- ko if: $root.selectedBlock() !== null --> <div data-bind=\\x22block: $root.selectedBlock\\x22></div> <!-- /ko --> <!-- ko if: $root.selectedBlock() == null --> <div class=\\x22noSelectedBlock\\x22 data-bind=\\x22text: $root.t('By clicking on message parts you will select a block and content options, if any, will show here')\\x22>By clicking on message parts you will select a block and content options, if any, will show here</div> <!-- /ko --> <!-- ko block: content --><!-- /ko --> </div> <div id=\\x22toolstyles\\x22 data-bind=\\x22scrollable: true, withProperties: { templateMode: 'styler' }\\x22> <!-- ko if: typeof $root.content().theme === 'undefined' || typeof $root.content().theme().scheme === 'undefined' || $root.content().theme().scheme() === 'custom' --> <!-- ko if: $root.selectedBlock() !== null --> <div data-bind=\\x22block: $root.selectedBlock, css: { workLocal: $root.selectedBlock().customStyle, workGlobal: typeof $root.selectedBlock().customStyle === 'undefined' || !$root.selectedBlock().customStyle() }\\x22></div> <!-- /ko --> <!-- ko if: $root.selectedBlock() == null --> <div class=\\x22noSelectedBlock\\x22 data-bind=\\x22text: $root.t('By clicking on message parts you will select a block and style options, if available, will show here')\\x22>By clicking on message parts you will select a block and style options, if available, will show here</div> <!-- /ko --> <div class=\\x22workGlobalContent\\x22> <!-- ko block: content --><!-- /ko --> </div> <!-- /ko --> </div></div> <div id=\\x22toolimages\\x22 class=\\x22slidebar\\x22 data-bind=\\x22scrollable: true, css: { hidden: $root.showGallery() === false }\\x22> <div class=\\x22close\\x22 data-bind=\\x22click: $root.showGallery.bind($element, false);\\x22>X</div> <span class=\\x22pane-title\\x22 data-bind=\\x22text: $root.t('Gallery:')\\x22>Gallery:</span> <div data-drop-content=\\x22Drop here\\x22 class=\\x22img-dropzone pane uploadzone\\x22 data-bind=\\x22attr: { 'data-drop-content': $root.t('Drop here') }, fudroppable: { activeClass: 'ui-state-highlight', hoverClass: 'ui-state-draghover' }\\x22> <div class=\\x22mo-uploadzone\\x22 style=\\x22position: relative; padding: 2em; border: 2px dotted #808080\\x22> <input class=\\x22fileupload\\x22 type=\\x22file\\x22 multiple name=\\x22files[]\\x22 data-bind=\\x22fileupload: { onerror: $root.notifier.error, onfile: $root.loadImage }\\x22 style=\\x22z-index: 10; position: absolute; top: 0; left: 0; right: 0; bottom: 0; min-width: 100%; min-height: 100%; font-zie: 999px; text-align: right; filter: alpha(opacity=0); opacity: 0; outline: none; cursor: inherit; display: block\\x22> <span data-bind=\\x22text: $root.t('Click or drag files here')\\x22>Click or drag files here</span> <div class=\\x22workzone\\x22 style=\\x22position: absolute; top: 0; left: 0; right: 0; bottom: 0; overflow: hidden;\\x22> <div class=\\x22progress\\x22 style=\\x22opacity: .5; width: 80%; margin-left: 10%; position: absolute; bottom: 30%; height: 20px; border: 2px solid black;\\x22> <div class=\\x22progress-bar progress-bar-success\\x22 style=\\x22height: 20px; background-color: black; \\x22></div> </div> </div> </div> </div> <!-- ko if: $root.showGallery() --> <div id=\\x22toolimagestab\\x22 class=\\x22tabs_horizontal\\x22 data-bind=\\x22tabs: { active: $root.selectedImageTab }\\x22> <ul> <li data-bind=\\x22tooltips: {}\\x22><a title=\\x22Session images\\x22 data-local=\\x22true\\x22 href=\\x22#toolimagesrecent\\x22 data-bind=\\x22attr: { title: $root.t('Session images') }, text: $root.t('Recents')\\x22>Recents</a></li> <li data-bind=\\x22tooltips: {}\\x22><a title=\\x22Remote gallery\\x22 data-local=\\x22true\\x22 href=\\x22#toolimagesgallery\\x22 data-bind=\\x22attr: { title: $root.t('Remote gallery') }, text: $root.t('Gallery')\\x22>Gallery</a></li> </ul> <div id=\\x22toolimagesrecent\\x22> <!-- ko if: galleryRecent().length == 0 --><div class=\\x22galleryEmpty\\x22 data-bind=\\x22text: $root.t('No images uploaded, yet')\\x22>No images uploaded, yet</div><!-- /ko --> <!-- ko template: {name: 'gallery-images', data: { items: galleryRecent } } --># recent gallery #<!-- /ko --> </div> <div id=\\x22toolimagesgallery\\x22 style=\\x22text-align: center\\x22> <!-- ko if: $root.galleryLoaded() === false --><a class=\\x22loadbutton\\x22 title=\\x22Show images from the gallery\\x22 href=\\x22javascript:void(0)\\x22 data-bind=\\x22attr: { title: $root.t('Show images from the gallery') }, click: $root.loadGallery, button: { disabled: $root.galleryLoaded, icons: { primary: 'fa fa-fw fa-picture-o' }, label: $root.galleryLoaded() == 'loading' ? $root.t('Loading...') : $root.t('Load gallery'), text: true }\\x22># load gally #</a><!-- /ko --> <!-- ko if: $root.galleryLoaded() === 'loading' --><div class=\\x22galleryEmpty\\x22 data-bind=\\x22text: $root.t('Loading gallery...')\\x22>Loading gallery...</div><!-- /ko --> <!-- ko if: $root.galleryLoaded() === 0 --><div class=\\x22galleryEmpty\\x22 data-bind=\\x22text: $root.t('The gallery is empty')\\x22>The gallery is empty</div><!-- /ko --> <!-- ko template: {name: 'gallery-images', data: { items: galleryRemote } } --># remote gallery #<!-- /ko --> </div> </div> <!-- /ko --></div><div id=\\x22tooldebug\\x22 class=\\x22slidebar\\x22 data-bind=\\x22css: { hidden: $root.debug() === false }\\x22> <div class=\\x22close\\x22 data-bind=\\x22click: $root.debug.bind($element, false);\\x22>X</div> <!-- ko if: $root.debug --> Content: <pre data-bind='text: ko.toJSON(content, null, 2)' style=\\x22overflow: auto; height: 20%\\x22></pre> BlockDefs: <pre data-bind='text: ko.toJSON(blockDefs, null, 2)' style=\\x22overflow: auto; height: 20%\\x22></pre> <!-- /ko --> <a href=\\x22javascript:void(0)\\x22 data-bind=\\x22click: $root.exportHTMLtoTextarea.bind($element, '#outputhtml'); clickBubble: false, button: { text: true, label:'Generate' }\\x22>Output</a> <a href=\\x22javascript:void(0)\\x22 data-bind=\\x22click: $root.exportJSONtoTextarea.bind($element, '#outputhtml'); clickBubble: false, button: { text: true, label:'Export' }\\x22>Export</a> <a href=\\x22javascript:void(0)\\x22 data-bind=\\x22click: $root.importJSONfromTextarea.bind($element, '#outputhtml'); clickBubble: false, button: { text: true, label:'Import' }\\x22>Import</a> <textarea id=\\x22outputhtml\\x22 rows=\\x2210\\x22 style=\\x22width: 100%;\\x22></textarea></div><div id=\\x22tooltheme\\x22 class=\\x22ui-widget slidebar\\x22 data-bind=\\x22css: { hidden: $root.showTheme() === false }\\x22> <div class=\\x22close\\x22 data-bind=\\x22click: $root.showTheme.bind($element, false);\\x22>X</div> <!-- ko withProperties: { templateMode: 'styler' } --> <!-- ko if: $root.showTheme --> <!-- ko block: $root.content().theme --><!-- /ko --> <!-- /ko --> <!-- /ko --></div>\");\n});\n",
|
|
99
|
+
"// http://wiki.commonjs.org/wiki/Unit_Testing/1.0\n//\n// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!\n//\n// Originally from narwhal.js (http://narwhaljs.org)\n// Copyright (c) 2009 Thomas Robinson <280north.com>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the 'Software'), to\n// deal in the Software without restriction, including without limitation the\n// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n// sell copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// when used in node, this will actually load the util module we depend on\n// versus loading the builtin util module as happens otherwise\n// this is a bug in node module loading as far as I am concerned\nvar util = require('util/');\n\nvar pSlice = Array.prototype.slice;\nvar hasOwn = Object.prototype.hasOwnProperty;\n\n// 1. The assert module provides functions that throw\n// AssertionError's when particular conditions are not met. The\n// assert module must conform to the following interface.\n\nvar assert = module.exports = ok;\n\n// 2. The AssertionError is defined in assert.\n// new assert.AssertionError({ message: message,\n// actual: actual,\n// expected: expected })\n\nassert.AssertionError = function AssertionError(options) {\n this.name = 'AssertionError';\n this.actual = options.actual;\n this.expected = options.expected;\n this.operator = options.operator;\n if (options.message) {\n this.message = options.message;\n this.generatedMessage = false;\n } else {\n this.message = getMessage(this);\n this.generatedMessage = true;\n }\n var stackStartFunction = options.stackStartFunction || fail;\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, stackStartFunction);\n }\n else {\n // non v8 browsers so we can have a stacktrace\n var err = new Error();\n if (err.stack) {\n var out = err.stack;\n\n // try to strip useless frames\n var fn_name = stackStartFunction.name;\n var idx = out.indexOf('\\n' + fn_name);\n if (idx >= 0) {\n // once we have located the function frame\n // we need to strip out everything before it (and its line)\n var next_line = out.indexOf('\\n', idx + 1);\n out = out.substring(next_line + 1);\n }\n\n this.stack = out;\n }\n }\n};\n\n// assert.AssertionError instanceof Error\nutil.inherits(assert.AssertionError, Error);\n\nfunction replacer(key, value) {\n if (util.isUndefined(value)) {\n return '' + value;\n }\n if (util.isNumber(value) && !isFinite(value)) {\n return value.toString();\n }\n if (util.isFunction(value) || util.isRegExp(value)) {\n return value.toString();\n }\n return value;\n}\n\nfunction truncate(s, n) {\n if (util.isString(s)) {\n return s.length < n ? s : s.slice(0, n);\n } else {\n return s;\n }\n}\n\nfunction getMessage(self) {\n return truncate(JSON.stringify(self.actual, replacer), 128) + ' ' +\n self.operator + ' ' +\n truncate(JSON.stringify(self.expected, replacer), 128);\n}\n\n// At present only the three keys mentioned above are used and\n// understood by the spec. Implementations or sub modules can pass\n// other keys to the AssertionError's constructor - they will be\n// ignored.\n\n// 3. All of the following functions must throw an AssertionError\n// when a corresponding condition is not met, with a message that\n// may be undefined if not provided. All assertion methods provide\n// both the actual and expected values to the assertion error for\n// display purposes.\n\nfunction fail(actual, expected, message, operator, stackStartFunction) {\n throw new assert.AssertionError({\n message: message,\n actual: actual,\n expected: expected,\n operator: operator,\n stackStartFunction: stackStartFunction\n });\n}\n\n// EXTENSION! allows for well behaved errors defined elsewhere.\nassert.fail = fail;\n\n// 4. Pure assertion tests whether a value is truthy, as determined\n// by !!guard.\n// assert.ok(guard, message_opt);\n// This statement is equivalent to assert.equal(true, !!guard,\n// message_opt);. To test strictly for the value true, use\n// assert.strictEqual(true, guard, message_opt);.\n\nfunction ok(value, message) {\n if (!value) fail(value, true, message, '==', assert.ok);\n}\nassert.ok = ok;\n\n// 5. The equality assertion tests shallow, coercive equality with\n// ==.\n// assert.equal(actual, expected, message_opt);\n\nassert.equal = function equal(actual, expected, message) {\n if (actual != expected) fail(actual, expected, message, '==', assert.equal);\n};\n\n// 6. The non-equality assertion tests for whether two objects are not equal\n// with != assert.notEqual(actual, expected, message_opt);\n\nassert.notEqual = function notEqual(actual, expected, message) {\n if (actual == expected) {\n fail(actual, expected, message, '!=', assert.notEqual);\n }\n};\n\n// 7. The equivalence assertion tests a deep equality relation.\n// assert.deepEqual(actual, expected, message_opt);\n\nassert.deepEqual = function deepEqual(actual, expected, message) {\n if (!_deepEqual(actual, expected)) {\n fail(actual, expected, message, 'deepEqual', assert.deepEqual);\n }\n};\n\nfunction _deepEqual(actual, expected) {\n // 7.1. All identical values are equivalent, as determined by ===.\n if (actual === expected) {\n return true;\n\n } else if (util.isBuffer(actual) && util.isBuffer(expected)) {\n if (actual.length != expected.length) return false;\n\n for (var i = 0; i < actual.length; i++) {\n if (actual[i] !== expected[i]) return false;\n }\n\n return true;\n\n // 7.2. If the expected value is a Date object, the actual value is\n // equivalent if it is also a Date object that refers to the same time.\n } else if (util.isDate(actual) && util.isDate(expected)) {\n return actual.getTime() === expected.getTime();\n\n // 7.3 If the expected value is a RegExp object, the actual value is\n // equivalent if it is also a RegExp object with the same source and\n // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).\n } else if (util.isRegExp(actual) && util.isRegExp(expected)) {\n return actual.source === expected.source &&\n actual.global === expected.global &&\n actual.multiline === expected.multiline &&\n actual.lastIndex === expected.lastIndex &&\n actual.ignoreCase === expected.ignoreCase;\n\n // 7.4. Other pairs that do not both pass typeof value == 'object',\n // equivalence is determined by ==.\n } else if (!util.isObject(actual) && !util.isObject(expected)) {\n return actual == expected;\n\n // 7.5 For all other Object pairs, including Array objects, equivalence is\n // determined by having the same number of owned properties (as verified\n // with Object.prototype.hasOwnProperty.call), the same set of keys\n // (although not necessarily the same order), equivalent values for every\n // corresponding key, and an identical 'prototype' property. Note: this\n // accounts for both named and indexed properties on Arrays.\n } else {\n return objEquiv(actual, expected);\n }\n}\n\nfunction isArguments(object) {\n return Object.prototype.toString.call(object) == '[object Arguments]';\n}\n\nfunction objEquiv(a, b) {\n if (util.isNullOrUndefined(a) || util.isNullOrUndefined(b))\n return false;\n // an identical 'prototype' property.\n if (a.prototype !== b.prototype) return false;\n // if one is a primitive, the other must be same\n if (util.isPrimitive(a) || util.isPrimitive(b)) {\n return a === b;\n }\n var aIsArgs = isArguments(a),\n bIsArgs = isArguments(b);\n if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs))\n return false;\n if (aIsArgs) {\n a = pSlice.call(a);\n b = pSlice.call(b);\n return _deepEqual(a, b);\n }\n var ka = objectKeys(a),\n kb = objectKeys(b),\n key, i;\n // having the same number of owned properties (keys incorporates\n // hasOwnProperty)\n if (ka.length != kb.length)\n return false;\n //the same set of keys (although not necessarily the same order),\n ka.sort();\n kb.sort();\n //~~~cheap key test\n for (i = ka.length - 1; i >= 0; i--) {\n if (ka[i] != kb[i])\n return false;\n }\n //equivalent values for every corresponding key, and\n //~~~possibly expensive deep test\n for (i = ka.length - 1; i >= 0; i--) {\n key = ka[i];\n if (!_deepEqual(a[key], b[key])) return false;\n }\n return true;\n}\n\n// 8. The non-equivalence assertion tests for any deep inequality.\n// assert.notDeepEqual(actual, expected, message_opt);\n\nassert.notDeepEqual = function notDeepEqual(actual, expected, message) {\n if (_deepEqual(actual, expected)) {\n fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual);\n }\n};\n\n// 9. The strict equality assertion tests strict equality, as determined by ===.\n// assert.strictEqual(actual, expected, message_opt);\n\nassert.strictEqual = function strictEqual(actual, expected, message) {\n if (actual !== expected) {\n fail(actual, expected, message, '===', assert.strictEqual);\n }\n};\n\n// 10. The strict non-equality assertion tests for strict inequality, as\n// determined by !==. assert.notStrictEqual(actual, expected, message_opt);\n\nassert.notStrictEqual = function notStrictEqual(actual, expected, message) {\n if (actual === expected) {\n fail(actual, expected, message, '!==', assert.notStrictEqual);\n }\n};\n\nfunction expectedException(actual, expected) {\n if (!actual || !expected) {\n return false;\n }\n\n if (Object.prototype.toString.call(expected) == '[object RegExp]') {\n return expected.test(actual);\n } else if (actual instanceof expected) {\n return true;\n } else if (expected.call({}, actual) === true) {\n return true;\n }\n\n return false;\n}\n\nfunction _throws(shouldThrow, block, expected, message) {\n var actual;\n\n if (util.isString(expected)) {\n message = expected;\n expected = null;\n }\n\n try {\n block();\n } catch (e) {\n actual = e;\n }\n\n message = (expected && expected.name ? ' (' + expected.name + ').' : '.') +\n (message ? ' ' + message : '.');\n\n if (shouldThrow && !actual) {\n fail(actual, expected, 'Missing expected exception' + message);\n }\n\n if (!shouldThrow && expectedException(actual, expected)) {\n fail(actual, expected, 'Got unwanted exception' + message);\n }\n\n if ((shouldThrow && actual && expected &&\n !expectedException(actual, expected)) || (!shouldThrow && actual)) {\n throw actual;\n }\n}\n\n// 11. Expected to throw an error:\n// assert.throws(block, Error_opt, message_opt);\n\nassert.throws = function(block, /*optional*/error, /*optional*/message) {\n _throws.apply(this, [true].concat(pSlice.call(arguments)));\n};\n\n// EXTENSION! This is annoying to write outside this module.\nassert.doesNotThrow = function(block, /*optional*/message) {\n _throws.apply(this, [false].concat(pSlice.call(arguments)));\n};\n\nassert.ifError = function(err) { if (err) {throw err;}};\n\nvar objectKeys = Object.keys || function (obj) {\n var keys = [];\n for (var key in obj) {\n if (hasOwn.call(obj, key)) keys.push(key);\n }\n return keys;\n};\n",
|
|
100
|
+
"exports.endianness = function () { return 'LE' };\n\nexports.hostname = function () {\n if (typeof location !== 'undefined') {\n return location.hostname\n }\n else return '';\n};\n\nexports.loadavg = function () { return [] };\n\nexports.uptime = function () { return 0 };\n\nexports.freemem = function () {\n return Number.MAX_VALUE;\n};\n\nexports.totalmem = function () {\n return Number.MAX_VALUE;\n};\n\nexports.cpus = function () { return [] };\n\nexports.type = function () { return 'Browser' };\n\nexports.release = function () {\n if (typeof navigator !== 'undefined') {\n return navigator.appVersion;\n }\n return '';\n};\n\nexports.networkInterfaces\n= exports.getNetworkInterfaces\n= function () { return {} };\n\nexports.arch = function () { return 'javascript' };\n\nexports.platform = function () { return 'browser' };\n\nexports.tmpdir = exports.tmpDir = function () {\n return '/tmp';\n};\n\nexports.EOL = '\\n';\n",
|
|
101
|
+
"// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n",
|
|
102
|
+
"if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n}\n",
|
|
103
|
+
"module.exports = function isBuffer(arg) {\n return arg && typeof arg === 'object'\n && typeof arg.copy === 'function'\n && typeof arg.fill === 'function'\n && typeof arg.readUInt8 === 'function';\n}",
|
|
104
|
+
"// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar formatRegExp = /%[sdj%]/g;\nexports.format = function(f) {\n if (!isString(f)) {\n var objects = [];\n for (var i = 0; i < arguments.length; i++) {\n objects.push(inspect(arguments[i]));\n }\n return objects.join(' ');\n }\n\n var i = 1;\n var args = arguments;\n var len = args.length;\n var str = String(f).replace(formatRegExp, function(x) {\n if (x === '%%') return '%';\n if (i >= len) return x;\n switch (x) {\n case '%s': return String(args[i++]);\n case '%d': return Number(args[i++]);\n case '%j':\n try {\n return JSON.stringify(args[i++]);\n } catch (_) {\n return '[Circular]';\n }\n default:\n return x;\n }\n });\n for (var x = args[i]; i < len; x = args[++i]) {\n if (isNull(x) || !isObject(x)) {\n str += ' ' + x;\n } else {\n str += ' ' + inspect(x);\n }\n }\n return str;\n};\n\n\n// Mark that a method should not be used.\n// Returns a modified function which warns once by default.\n// If --no-deprecation is set, then it is a no-op.\nexports.deprecate = function(fn, msg) {\n // Allow for deprecating things in the process of starting up.\n if (isUndefined(global.process)) {\n return function() {\n return exports.deprecate(fn, msg).apply(this, arguments);\n };\n }\n\n if (process.noDeprecation === true) {\n return fn;\n }\n\n var warned = false;\n function deprecated() {\n if (!warned) {\n if (process.throwDeprecation) {\n throw new Error(msg);\n } else if (process.traceDeprecation) {\n console.trace(msg);\n } else {\n console.error(msg);\n }\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n\n return deprecated;\n};\n\n\nvar debugs = {};\nvar debugEnviron;\nexports.debuglog = function(set) {\n if (isUndefined(debugEnviron))\n debugEnviron = process.env.NODE_DEBUG || '';\n set = set.toUpperCase();\n if (!debugs[set]) {\n if (new RegExp('\\\\b' + set + '\\\\b', 'i').test(debugEnviron)) {\n var pid = process.pid;\n debugs[set] = function() {\n var msg = exports.format.apply(exports, arguments);\n console.error('%s %d: %s', set, pid, msg);\n };\n } else {\n debugs[set] = function() {};\n }\n }\n return debugs[set];\n};\n\n\n/**\n * Echos the value of a value. Trys to print the value out\n * in the best way possible given the different types.\n *\n * @param {Object} obj The object to print out.\n * @param {Object} opts Optional options object that alters the output.\n */\n/* legacy: obj, showHidden, depth, colors*/\nfunction inspect(obj, opts) {\n // default options\n var ctx = {\n seen: [],\n stylize: stylizeNoColor\n };\n // legacy...\n if (arguments.length >= 3) ctx.depth = arguments[2];\n if (arguments.length >= 4) ctx.colors = arguments[3];\n if (isBoolean(opts)) {\n // legacy...\n ctx.showHidden = opts;\n } else if (opts) {\n // got an \"options\" object\n exports._extend(ctx, opts);\n }\n // set default options\n if (isUndefined(ctx.showHidden)) ctx.showHidden = false;\n if (isUndefined(ctx.depth)) ctx.depth = 2;\n if (isUndefined(ctx.colors)) ctx.colors = false;\n if (isUndefined(ctx.customInspect)) ctx.customInspect = true;\n if (ctx.colors) ctx.stylize = stylizeWithColor;\n return formatValue(ctx, obj, ctx.depth);\n}\nexports.inspect = inspect;\n\n\n// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics\ninspect.colors = {\n 'bold' : [1, 22],\n 'italic' : [3, 23],\n 'underline' : [4, 24],\n 'inverse' : [7, 27],\n 'white' : [37, 39],\n 'grey' : [90, 39],\n 'black' : [30, 39],\n 'blue' : [34, 39],\n 'cyan' : [36, 39],\n 'green' : [32, 39],\n 'magenta' : [35, 39],\n 'red' : [31, 39],\n 'yellow' : [33, 39]\n};\n\n// Don't use 'blue' not visible on cmd.exe\ninspect.styles = {\n 'special': 'cyan',\n 'number': 'yellow',\n 'boolean': 'yellow',\n 'undefined': 'grey',\n 'null': 'bold',\n 'string': 'green',\n 'date': 'magenta',\n // \"name\": intentionally not styling\n 'regexp': 'red'\n};\n\n\nfunction stylizeWithColor(str, styleType) {\n var style = inspect.styles[styleType];\n\n if (style) {\n return '\\u001b[' + inspect.colors[style][0] + 'm' + str +\n '\\u001b[' + inspect.colors[style][1] + 'm';\n } else {\n return str;\n }\n}\n\n\nfunction stylizeNoColor(str, styleType) {\n return str;\n}\n\n\nfunction arrayToHash(array) {\n var hash = {};\n\n array.forEach(function(val, idx) {\n hash[val] = true;\n });\n\n return hash;\n}\n\n\nfunction formatValue(ctx, value, recurseTimes) {\n // Provide a hook for user-specified inspect functions.\n // Check that value is an object with an inspect function on it\n if (ctx.customInspect &&\n value &&\n isFunction(value.inspect) &&\n // Filter out the util module, it's inspect function is special\n value.inspect !== exports.inspect &&\n // Also filter out any prototype objects using the circular check.\n !(value.constructor && value.constructor.prototype === value)) {\n var ret = value.inspect(recurseTimes, ctx);\n if (!isString(ret)) {\n ret = formatValue(ctx, ret, recurseTimes);\n }\n return ret;\n }\n\n // Primitive types cannot have properties\n var primitive = formatPrimitive(ctx, value);\n if (primitive) {\n return primitive;\n }\n\n // Look up the keys of the object.\n var keys = Object.keys(value);\n var visibleKeys = arrayToHash(keys);\n\n if (ctx.showHidden) {\n keys = Object.getOwnPropertyNames(value);\n }\n\n // IE doesn't make error fields non-enumerable\n // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx\n if (isError(value)\n && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {\n return formatError(value);\n }\n\n // Some type of object without properties can be shortcutted.\n if (keys.length === 0) {\n if (isFunction(value)) {\n var name = value.name ? ': ' + value.name : '';\n return ctx.stylize('[Function' + name + ']', 'special');\n }\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n }\n if (isDate(value)) {\n return ctx.stylize(Date.prototype.toString.call(value), 'date');\n }\n if (isError(value)) {\n return formatError(value);\n }\n }\n\n var base = '', array = false, braces = ['{', '}'];\n\n // Make Array say that they are Array\n if (isArray(value)) {\n array = true;\n braces = ['[', ']'];\n }\n\n // Make functions say that they are functions\n if (isFunction(value)) {\n var n = value.name ? ': ' + value.name : '';\n base = ' [Function' + n + ']';\n }\n\n // Make RegExps say that they are RegExps\n if (isRegExp(value)) {\n base = ' ' + RegExp.prototype.toString.call(value);\n }\n\n // Make dates with properties first say the date\n if (isDate(value)) {\n base = ' ' + Date.prototype.toUTCString.call(value);\n }\n\n // Make error with message first say the error\n if (isError(value)) {\n base = ' ' + formatError(value);\n }\n\n if (keys.length === 0 && (!array || value.length == 0)) {\n return braces[0] + base + braces[1];\n }\n\n if (recurseTimes < 0) {\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n } else {\n return ctx.stylize('[Object]', 'special');\n }\n }\n\n ctx.seen.push(value);\n\n var output;\n if (array) {\n output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n } else {\n output = keys.map(function(key) {\n return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n });\n }\n\n ctx.seen.pop();\n\n return reduceToSingleString(output, base, braces);\n}\n\n\nfunction formatPrimitive(ctx, value) {\n if (isUndefined(value))\n return ctx.stylize('undefined', 'undefined');\n if (isString(value)) {\n var simple = '\\'' + JSON.stringify(value).replace(/^\"|\"$/g, '')\n .replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"') + '\\'';\n return ctx.stylize(simple, 'string');\n }\n if (isNumber(value))\n return ctx.stylize('' + value, 'number');\n if (isBoolean(value))\n return ctx.stylize('' + value, 'boolean');\n // For some reason typeof null is \"object\", so special case here.\n if (isNull(value))\n return ctx.stylize('null', 'null');\n}\n\n\nfunction formatError(value) {\n return '[' + Error.prototype.toString.call(value) + ']';\n}\n\n\nfunction formatArray(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n for (var i = 0, l = value.length; i < l; ++i) {\n if (hasOwnProperty(value, String(i))) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n String(i), true));\n } else {\n output.push('');\n }\n }\n keys.forEach(function(key) {\n if (!key.match(/^\\d+$/)) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n key, true));\n }\n });\n return output;\n}\n\n\nfunction formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };\n if (desc.get) {\n if (desc.set) {\n str = ctx.stylize('[Getter/Setter]', 'special');\n } else {\n str = ctx.stylize('[Getter]', 'special');\n }\n } else {\n if (desc.set) {\n str = ctx.stylize('[Setter]', 'special');\n }\n }\n if (!hasOwnProperty(visibleKeys, key)) {\n name = '[' + key + ']';\n }\n if (!str) {\n if (ctx.seen.indexOf(desc.value) < 0) {\n if (isNull(recurseTimes)) {\n str = formatValue(ctx, desc.value, null);\n } else {\n str = formatValue(ctx, desc.value, recurseTimes - 1);\n }\n if (str.indexOf('\\n') > -1) {\n if (array) {\n str = str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n').substr(2);\n } else {\n str = '\\n' + str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n');\n }\n }\n } else {\n str = ctx.stylize('[Circular]', 'special');\n }\n }\n if (isUndefined(name)) {\n if (array && key.match(/^\\d+$/)) {\n return str;\n }\n name = JSON.stringify('' + key);\n if (name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)) {\n name = name.substr(1, name.length - 2);\n name = ctx.stylize(name, 'name');\n } else {\n name = name.replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"')\n .replace(/(^\"|\"$)/g, \"'\");\n name = ctx.stylize(name, 'string');\n }\n }\n\n return name + ': ' + str;\n}\n\n\nfunction reduceToSingleString(output, base, braces) {\n var numLinesEst = 0;\n var length = output.reduce(function(prev, cur) {\n numLinesEst++;\n if (cur.indexOf('\\n') >= 0) numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d?m/g, '').length + 1;\n }, 0);\n\n if (length > 60) {\n return braces[0] +\n (base === '' ? '' : base + '\\n ') +\n ' ' +\n output.join(',\\n ') +\n ' ' +\n braces[1];\n }\n\n return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];\n}\n\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\nfunction isArray(ar) {\n return Array.isArray(ar);\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n return isObject(re) && objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n return isObject(d) && objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\n\nfunction isError(e) {\n return isObject(e) &&\n (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = require('./support/isBuffer');\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n\n\nfunction pad(n) {\n return n < 10 ? '0' + n.toString(10) : n.toString(10);\n}\n\n\nvar months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',\n 'Oct', 'Nov', 'Dec'];\n\n// 26 Feb 16:19:34\nfunction timestamp() {\n var d = new Date();\n var time = [pad(d.getHours()),\n pad(d.getMinutes()),\n pad(d.getSeconds())].join(':');\n return [d.getDate(), months[d.getMonth()], time].join(' ');\n}\n\n\n// log is just a thin wrapper to console.log that prepends a timestamp\nexports.log = function() {\n console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));\n};\n\n\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * The Function.prototype.inherits from lang.js rewritten as a standalone\n * function (not on Function.prototype). NOTE: If this file is to be loaded\n * during bootstrapping this function needs to be rewritten using some native\n * functions as prototype setup using normal JavaScript does not work as\n * expected during bootstrapping (see mirror.js in r114903).\n *\n * @param {function} ctor Constructor function which needs to inherit the\n * prototype.\n * @param {function} superCtor Constructor function to inherit prototype from.\n */\nexports.inherits = require('inherits');\n\nexports._extend = function(origin, add) {\n // Don't do anything if add isn't an object\n if (!add || !isObject(add)) return origin;\n\n var keys = Object.keys(add);\n var i = keys.length;\n while (i--) {\n origin[keys[i]] = add[keys[i]];\n }\n return origin;\n};\n\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n",
|
|
105
|
+
"\"use strict\";\n/* global global: false */\n/* global XMLHttpRequest: false */\n\nvar templateLoader = require('./template-loader.js');\nvar console = require(\"console\");\nvar ko = require(\"knockout\");\nvar $ = require(\"jquery\");\nrequire(\"./ko-bindings.js\");\nvar performanceAwareCaller = require(\"./timed-call.js\").timedCall;\n\nvar addUndoStackExtensionMaker = require(\"./undomanager/undomain.js\");\nvar colorPlugin = require(\"./ext/color.js\");\nvar inlinerPlugin = require(\"./ext/inliner.js\");\n\nvar localStorageLoader = require(\"./ext/localstorage.js\");\n\nif (typeof ko == 'undefined') throw \"Cannot find knockout.js library!\";\nif (typeof $ == 'undefined') throw \"Cannot find jquery library!\";\n\nfunction _canonicalize(url) {\n var div = global.document.createElement('div');\n div.innerHTML = \"<a></a>\";\n div.firstChild.href = url; // Ensures that the href is properly escaped\n div.innerHTML = div.innerHTML; // Run the current innerHTML back through the parser\n return div.firstChild.href;\n}\n\nvar applyBindingOptions = function(options, ko) {\n // push \"convertedUrl\" method to the wysiwygSrc binding\n ko.bindingHandlers.wysiwygSrc.convertedUrl = function(src, method, width, height) {\n var imgProcessorBackend = options.imgProcessorBackend ? options.imgProcessorBackend : './upload';\n var backEndMatch = imgProcessorBackend.match(/^(https?:\\/\\/[^\\/]*\\/).*$/);\n var srcMatch = src.match(/^(https?:\\/\\/[^\\/]*\\/).*$/);\n if (backEndMatch === null || (srcMatch !== null && backEndMatch[1] == srcMatch[1])) {\n var queryParamSeparator = imgProcessorBackend.indexOf('?') == -1 ? '?' : '&';\n return imgProcessorBackend + queryParamSeparator + \"src=\" + encodeURIComponent(src) + \"&method=\" + encodeURIComponent(method) + \"¶ms=\" + encodeURIComponent(width + \",\" + height);\n } else {\n console.log(\"Cannot apply backend image resizing to non-local resources \", src, method, width, height, backEndMatch, srcMatch);\n return src + \"?method=\" + method + \"&width=\" + width + (height !== null ? \"&height=\" + height : '');\n }\n };\n\n ko.bindingHandlers.wysiwygSrc.placeholderUrl = function(width, height, text) {\n return options.imgProcessorBackend + \"?method=\" + 'placeholder' + \"¶ms=\" + width + encodeURIComponent(\",\") + height;\n };\n\n // pushes custom tinymce configurations from options to the binding\n if (options && options.tinymceConfig)\n ko.bindingHandlers.wysiwyg.standardOptions = options.tinymceConfig;\n if (options && options.tinymceConfigFull)\n ko.bindingHandlers.wysiwyg.fullOptions = options.tinymceConfigFull;\n};\n\nvar start = function(options, templateFile, templateMetadata, jsorjson, customExtensions) {\n\n\n\n templateLoader.fixPageEvents();\n\n var fileUploadMessagesExtension = function(vm) {\n var fileuploadConfig = {\n messages: {\n unknownError: vm.t('Unknown error'),\n uploadedBytes: vm.t('Uploaded bytes exceed file size'),\n maxNumberOfFiles: vm.t('Maximum number of files exceeded'),\n acceptFileTypes: vm.t('File type not allowed'),\n maxFileSize: vm.t('File is too large'),\n minFileSize: vm.t('File is too small'),\n post_max_size: vm.t('The uploaded file exceeds the post_max_size directive in php.ini'),\n max_file_size: vm.t('File is too big'),\n min_file_size: vm.t('File is too small'),\n accept_file_types: vm.t('Filetype not allowed'),\n max_number_of_files: vm.t('Maximum number of files exceeded'),\n max_width: vm.t('Image exceeds maximum width'),\n min_width: vm.t('Image requires a minimum width'),\n max_height: vm.t('Image exceeds maximum height'),\n min_height: vm.t('Image requires a minimum height'),\n abort: vm.t('File upload aborted'),\n image_resize: vm.t('Failed to resize image'),\n generic: vm.t('Unexpected upload error')\n }\n };\n // fileUpload options.\n if (options && options.fileuploadConfig)\n fileuploadConfig = $.extend(true, fileuploadConfig, options.fileuploadConfig);\n\n ko.bindingHandlers['fileupload'].extendOptions = fileuploadConfig;\n\n };\n\n var simpleTranslationPlugin = function(vm) {\n if (options && options.strings) {\n vm.t = function(key, objParam) {\n var res = options.strings[key];\n if (typeof res == 'undefined') {\n console.warn(\"Missing translation string for\",key,\": using default string\");\n res = key;\n }\n return vm.tt(res, objParam);\n };\n }\n };\n\n // simpleTranslationPlugin must be before the undoStack to translate undo/redo labels\n var extensions = [simpleTranslationPlugin, addUndoStackExtensionMaker(performanceAwareCaller), colorPlugin, inlinerPlugin];\n if (typeof customExtensions !== 'undefined')\n for (var k = 0; k < customExtensions.length; k++) extensions.push(customExtensions[k]);\n extensions.push(fileUploadMessagesExtension);\n\n var galleryUrl = options.fileuploadConfig ? options.fileuploadConfig.url : '/upload/';\n applyBindingOptions(options, ko);\n\n // TODO what about appending to another element?\n $(\"<!-- ko template: 'main' --><!-- /ko -->\").appendTo(global.document.body);\n\n // templateFile may override the template path in templateMetadata\n if (typeof templateFile == 'undefined' && typeof templateMetadata != 'undefined') {\n templateFile = templateMetadata.template;\n }\n // TODO canonicalize templateFile to absolute or relative depending on \"relativeUrlsException\" plugin\n\n templateLoader.load(performanceAwareCaller, templateFile, templateMetadata, jsorjson, extensions, galleryUrl);\n\n};\n\nvar initFromLocalStorage = function(options, hash_key, customExtensions) {\n try {\n var lsData = localStorageLoader(hash_key, options.emailProcessorBackend);\n var extensions = typeof customExtensions !== 'undefined' ? customExtensions : [];\n extensions.push(lsData.extension);\n var template = _canonicalize(lsData.metadata.template);\n start(options, template, lsData.metadata, lsData.model, extensions);\n } catch (e) {\n console.error(\"TODO not found \", hash_key, e);\n }\n};\n\nvar init = function(options, customExtensions) {\n\n var hash = global.location.hash ? global.location.href.split(\"#\")[1] : undefined;\n\n // Loading from configured template or configured metadata\n if (options && (options.template || options.data)) {\n if (options.data) {\n var data = JSON.parse(options.data);\n start(options, undefined, data.metadata, data.content, customExtensions);\n } else {\n start(options, options.template, undefined, undefined, customExtensions);\n }\n // Loading from LocalStorage (if url hash has a 7chars key)\n } else if (hash && hash.length == 7) {\n initFromLocalStorage(options, hash, customExtensions);\n // Loading from template url as hash (if hash is not a valid localstorage key)\n } else if (hash) {\n start(options, _canonicalize(hash), undefined, undefined, customExtensions);\n } else {\n return false;\n }\n return true;\n};\n\nmodule.exports = {\n isCompatible: templateLoader.isCompatible,\n init: init,\n start: start\n};",
|
|
106
|
+
"\"use strict\";\n\nvar ko = require(\"knockout\");\nvar console = require(\"console\");\n\n// @see also script-template.js pushTemplate\nvar addScriptTemplate = function(doc, templateName, templateMarkup) {\n var scriptTag = doc.createElement('script');\n scriptTag.setAttribute('type', 'text/html');\n scriptTag.setAttribute('id', templateName);\n scriptTag.text = templateMarkup;\n doc.body.appendChild(scriptTag);\n return scriptTag;\n // $('<script type=\"text/html\"></sc' + 'ript>').text(templateMarkup).attr('id', templateName).appendTo($('body'));\n};\n\n// used for live preview in iframe.\nko.bindingHandlers.bindIframe = {\n // tpl will be overriden with the structure parsed by the input template.\n tpl: \"<!DOCTYPE html>\\r\\n<html>\\r\\n<head>\\r\\n</head>\\r\\n<body><div data-bind=\\\"block: content\\\"></div></body>\\r\\n</html>\\r\\n\",\n init: function(element, valueAccessor) {\n function bindIframe(local) {\n try {\n var iframe = element.contentDocument;\n iframe.open();\n iframe.write(ko.bindingHandlers.bindIframe.tpl);\n iframe.close();\n\n try {\n var iframedoc = iframe.body;\n if (iframedoc) {\n // scripts have to be duplicated (maybe this is not needed anymore since using string-templates)\n var templates = element.contentWindow.parent.document.getElementsByTagName('script');\n for (var i = 0; i < templates.length; i++) {\n if (templates[i].getAttribute('type') == 'text/html' && templates[i].getAttribute('id')) {\n addScriptTemplate(iframe, templates[i].getAttribute('id'), templates[i].innerHTML);\n }\n }\n\n var html = iframe.getElementsByTagName(\"HTML\");\n\n ko.utils.domNodeDisposal.addDisposeCallback(element, function() {\n ko.cleanNode(html[0] || iframedoc);\n });\n\n ko.applyBindings(valueAccessor(), html[0] || iframedoc);\n } else {\n console.log(\"no iframedoc\", local);\n }\n } catch (e) {\n console.log(\"error reading iframe.body\", e, local);\n throw e;\n }\n } catch (e) {\n console.log(\"error reading iframe contentDocument\", e, local);\n throw e;\n // ignored\n }\n }\n bindIframe(\"first call\");\n // older browsers needed this\n // ko.utils.registerEventHandler(element, 'load', bindIframe);\n }\n};",
|
|
107
|
+
"\"use strict\";\n/* globals global:false */\n\nvar ko = require(\"knockout\");\nvar console = require(\"console\");\n\n\nko.bindingHandlers['withProperties'] = {\n init: function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n // Make a modified binding context, with a extra properties, and apply it to descendant elements\n var childBindingContext = bindingContext.createChildContext(\n bindingContext.$rawData,\n null, // Optionally, pass a string here as an alias for the data item in descendant contexts\n function(context) {\n ko.utils.extend(context, valueAccessor());\n }\n );\n ko.applyBindingsToDescendants(childBindingContext, element);\n\n // Also tell KO *not* to bind the descendants itself, otherwise they will be bound twice\n return {\n controlsDescendantBindings: true\n };\n }\n};\nko.virtualElements.allowedBindings['withProperties'] = true;\n\nko.bindingHandlers['log'] = {\n init: function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n console.log(\"log\", valueAccessor());\n }\n};\n\n\nko.bindingHandlers['block'] = {\n\n templateExists: function(id) {\n var el = global.document.getElementById(id);\n if (el) return true;\n else return false;\n },\n\n _chooseTemplate: function(isArray, prefix, action, fallback) {\n var id = prefix + '-' + action;\n if (ko.bindingHandlers['block'].templateExists(id)) return id;\n if (typeof fallback != 'undefined' && fallback !== null) return ko.bindingHandlers['block']._chooseTemplate(isArray, prefix, fallback);\n else {\n var fallBackId = isArray ? 'array' : 'object-' + action;\n if (ko.bindingHandlers['block'].templateExists(fallBackId)) return fallBackId;\n else throw \"cannot find template for \" + id + \"/\" + fallBackId;\n }\n },\n\n // compute displayMode depending on templateMode set using \"withProperties\" binding.\n _displayMode: function(unwrapped, bindingContext) {\n var prefix = typeof unwrapped.type != 'undefined' ? ko.utils.unwrapObservable(unwrapped.type) : 'notablock-' + typeof(unwrapped);\n var isArray = typeof unwrapped.splice !== 'undefined';\n var templateMode = bindingContext.templateMode ? bindingContext.templateMode : 'show';\n return ko.bindingHandlers['block']._chooseTemplate(isArray, prefix, templateMode, bindingContext.templateModeFallback);\n },\n\n _makeTemplateValueAccessor: function(valueAccessor, bindingContext) {\n return function() {\n var value = valueAccessor(),\n unwrappedValue = ko.utils.peekObservable(value); // Unwrap without setting a dependency here\n\n // If unwrappedValue.data is the array, preserve all relevant options and unwrap again value so we get updates\n var modelValue;\n var template;\n\n if ((!unwrappedValue) || (typeof unwrappedValue.data != 'object' && typeof unwrappedValue.data != 'function')) {\n modelValue = value;\n } else {\n modelValue = unwrappedValue.data;\n if (typeof unwrappedValue.template != 'undefined') {\n var templateParam = ko.utils.unwrapObservable(unwrappedValue.template);\n var templateMode = bindingContext.templateMode ? bindingContext.templateMode : 'show';\n template = ko.bindingHandlers['block']._chooseTemplate(false, templateParam, templateMode, bindingContext.templateModeFallback);\n }\n }\n\n var unwrappedModelValue = ko.utils.unwrapObservable(modelValue);\n if (ko.isObservable(unwrappedModelValue)) console.log(\"doubleObservable\", unwrappedModelValue);\n\n if (typeof template == 'undefined') {\n // NOTE IE8 used to break here, but we don't support it anymore, so maybe this is not needed.\n if (modelValue === undefined) {\n template = 'empty';\n } else {\n try {\n template = ko.bindingHandlers['block']._displayMode(unwrappedModelValue, bindingContext);\n } catch (e) {\n console.log(e, unwrappedModelValue, bindingContext['$data'], bindingContext.templateMode);\n throw e;\n }\n }\n }\n\n return {\n 'name': template,\n 'data': modelValue,\n 'templateEngine': ko.nativeTemplateEngine.instance\n };\n };\n },\n\n 'init': function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n if (typeof valueAccessor() === 'undefined') console.log(\"found a null block: check ending commas in arrays defs in IE\");\n var newValueAccessor = ko.bindingHandlers['block']._makeTemplateValueAccessor(valueAccessor, bindingContext);\n return ko.bindingHandlers['template']['init'](element, newValueAccessor);\n },\n 'update': function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n var newValueAccessor = ko.bindingHandlers['block']._makeTemplateValueAccessor(valueAccessor, bindingContext);\n return ko.bindingHandlers['template']['update'](element, newValueAccessor, allBindings, viewModel, bindingContext);\n }\n};\nko.expressionRewriting.bindingRewriteValidators['block'] = false; // Can't rewrite control flow bindings\nko.virtualElements.allowedBindings['block'] = true;",
|
|
108
|
+
"\"use strict\";\n\n// script template is the one provided by KO and deals with tempaltes defined as <script type=text/html.\n// string template defines them in memory and avoids polluting the HTML: seems to work better in Mosaico.\n\nmodule.exports = require('./string-template.js');\n// module.exports = require('./script-template.js');",
|
|
109
|
+
"\"use strict\";\n/* global global: false */\n\nrequire(\"evol-colorpicker\");\n\nvar $ = require(\"jquery\");\nvar ko = require(\"knockout\");\nvar kojqui = require(\"knockout-jqueryui\");\n\n\nvar ColorPicker = function() {\n kojqui.BindingHandler.call(this, 'colorpicker');\n};\nColorPicker.prototype = kojqui.utils.createObject(kojqui.BindingHandler.prototype);\nColorPicker.prototype.constructor = ColorPicker;\n\nColorPicker.prototype.init = function(element, valueAccessor, allBindings) {\n var va = valueAccessor();\n var value = va.color;\n\n // In order to have a correct dependency tracking in \"ifSubs\" we have to ensure we use a single computer for each editable\n // property. Given this binding needs 2 of them, we create a computed so to \"proxy\" the dependencies.\n var newDO = ko.computed({\n read: value,\n write: value,\n disposeWhenNodeIsRemoved: element\n });\n var newVA = function() {\n return newDO;\n };\n\n ko.bindingHandlers.value.init(element, newVA, allBindings);\n\n var changePropagator = function(event, color) {\n if (typeof color !== 'undefined') newDO(color);\n };\n $(element).on('change.color', changePropagator);\n\n ko.computed({\n read: function() {\n var opt = {\n color: ko.utils.unwrapObservable(newDO),\n showOn: 'button'\n };\n for (var prop in va)\n if (prop !== 'color' && va.hasOwnProperty(prop)) opt[prop] = ko.utils.unwrapObservable(va[prop]);\n $(element).colorpicker(opt);\n },\n disposeWhenNodeIsRemoved: element\n });\n\n ko.utils.domNodeDisposal.addDisposeCallback(element, function() {\n $(element).off('change.color', changePropagator);\n $(element).colorpicker('destroy');\n });\n\n};\nkojqui.utils.register(ColorPicker);",
|
|
110
|
+
"\"use strict\";\n\nvar ko = require(\"knockout\");\n\n/* https://github.com/knockout/knockout/issues/1171 */\nko.bindingHandlers.cssText = {\n 'update': function(node, valueAccessor, allBindings) {\n var text = ko.utils.unwrapObservable(valueAccessor());\n try {\n node.innerText = text;\n } catch (e) {\n if (!node.styleSheet) node.innerHTML = \"a{}\";\n node.styleSheet.cssText = text;\n }\n }\n};",
|
|
111
|
+
"\"use strict\";\n\nvar $ = require(\"jquery\");\nvar ko = require(\"knockout\");\n\n/* knockout droppable, with simplified UMD */\n;(function(factory) {\n factory(ko, $);\n})(function(ko, $) {\n var ITEMKEY = \"ko_sortItem\",\n INDEXKEY = \"ko_sourceIndex\",\n LISTKEY = \"ko_sortList\",\n PARENTKEY = \"ko_parentList\",\n DRAGKEY = \"ko_dragItem\",\n unwrap = ko.utils.unwrapObservable,\n dataGet = ko.utils.domData.get,\n dataSet = ko.utils.domData.set;\n\n ko.bindingHandlers.droppable = {\n init: function(element, valueAccessor, allBindingsAccessor, data, context) {\n var $element = $(element),\n value = ko.utils.unwrapObservable(valueAccessor()) || {},\n droppable = {},\n dropActual;\n\n $.extend(true, droppable, ko.bindingHandlers.droppable);\n if (value.data) {\n if (value.options && droppable.options) {\n ko.utils.extend(droppable.options, value.options);\n delete value.options;\n }\n ko.utils.extend(droppable, value);\n } else {\n droppable.data = value;\n }\n\n dropActual = droppable.options.drop;\n\n $element.droppable(ko.utils.extend(droppable.options, {\n drop: function(event, ui) {\n\n var el = ui.draggable[0],\n item = dataGet(el, ITEMKEY) || dataGet(el, DRAGKEY);\n\n if (item) {\n\n if (item.clone) {\n item = item.clone();\n }\n\n if (droppable.dragged) {\n item = droppable.dragged.call(this, item, event, ui) || item;\n }\n\n if (droppable.data) {\n droppable.data(item);\n }\n\n }\n\n if (dropActual) {\n dropActual.apply(this, arguments);\n }\n\n }\n }));\n\n //handle enabling/disabling\n if (droppable.isEnabled !== undefined) {\n ko.computed({\n read: function() {\n $element.droppable(ko.utils.unwrapObservable(droppable.isEnabled) ? \"enable\" : \"disable\");\n },\n disposeWhenNodeIsRemoved: element\n });\n }\n\n },\n update: function(element, valueAccessor, allBindingsAccessor, data, context) {\n\n },\n targetIndex: null,\n afterMove: null,\n beforeMove: null,\n options: {}\n };\n});",
|
|
112
|
+
"\"use strict\";\n\nvar ko = require(\"knockout\");\nvar $ = require(\"jquery\");\nvar console = require(\"console\");\n\n/* utility for togetherjs */\nko.bindingHandlers.focusable = {\n 'focus': function() {},\n 'blur': function() {},\n 'init': function(element) {\n ko.utils.domNodeDisposal.addDisposeCallback(element, function() {\n $(element).off(\"focusin\", ko.bindingHandlers.focusable.focus);\n $(element).off(\"focusout\", ko.bindingHandlers.focusable.blur);\n });\n\n $(element).on(\"focusin\", ko.bindingHandlers.focusable.focus);\n $(element).on(\"focusout\", ko.bindingHandlers.focusable.blur);\n\n }\n};\n\nko.bindingHandlers.scrollable = {\n 'scroll': function() {},\n 'init': function(element) {\n ko.utils.domNodeDisposal.addDisposeCallback(element, function() {\n $(element).off(\"scroll\", ko.bindingHandlers.scrollable.scroll);\n });\n\n $(element).on(\"scroll\", ko.bindingHandlers.scrollable.scroll);\n\n }\n};",
|
|
113
|
+
"\"use strict\";\n\nvar ko = require(\"knockout\");\n\nko.extenders.paging = function(target, pageSize) {\n var _pageSize = ko.observable(pageSize || 10),\n // default pageSize to 10\n _currentPage = ko.observable(1); // default current page to 1\n target.pageSize = ko.computed({\n read: _pageSize,\n write: function(newValue) {\n if (newValue > 0) {\n _pageSize(newValue);\n } else {\n _pageSize(10);\n }\n }\n });\n\n target.currentPage = ko.computed({\n read: _currentPage,\n write: function(newValue) {\n if (newValue > target.pageCount()) {\n _currentPage(target.pageCount());\n } else if (newValue <= 0) {\n _currentPage(1);\n } else {\n _currentPage(newValue);\n }\n }\n });\n\n target.pageCount = ko.computed(function() {\n return Math.ceil(target().length / target.pageSize()) || 1;\n });\n\n target.currentPageData = ko.computed(function() {\n var pageSize = _pageSize(),\n pageIndex = _currentPage(),\n startIndex = pageSize * (pageIndex - 1),\n endIndex = pageSize * pageIndex;\n\n return target().slice(startIndex, endIndex);\n });\n\n target.moveFirst = function() {\n target.currentPage(1);\n };\n target.movePrevious = function() {\n target.currentPage(target.currentPage() - 1);\n };\n target.moveNext = function() {\n target.currentPage(target.currentPage() + 1);\n };\n target.moveLast = function() {\n target.currentPage(target.pageCount());\n };\n\n return target;\n};",
|
|
114
|
+
"\"use strict\";\n/* globals global: true */\n\nvar $ = require(\"jquery\");\nvar ko = require(\"knockout\");\nvar sortable = require(\"jquery-ui/sortable\");\nvar draggable = require(\"jquery-ui/draggable\");\nvar console = require(\"console\");\nrequire(\"knockout-sortable\");\n\nif (typeof sortable == 'undefined') throw \"Cannot find jquery-ui sortable widget dependency!\";\nif (typeof draggable == 'undefined') throw \"Cannot find jquery-ui sortable widget dependency!\";\n\nvar isDraggingHelper = function(writable, e) {\n if (writable()) {\n if (e.type == writable() + 'stop') writable(false);\n } else {\n if (e.type == 'dragstart' || e.type == 'sortstart') writable(e.type.substring(0, 4));\n }\n};\n\nvar makeExtendedValueAccessor = function(valueAccessor) {\n return function() {\n var modelValue = valueAccessor(),\n unwrappedValue = ko.utils.peekObservable(modelValue); // Unwrap without setting a dependency here\n\n ko.utils.unwrapObservable(modelValue);\n\n if (modelValue.options == 'undefined') {\n modelValue.options = {};\n }\n\n var origStart = modelValue.options.start;\n modelValue.options.start = function(e, ui) {\n if (typeof modelValue.dragging != 'undefined' && ko.isWritableObservable(modelValue.dragging)) isDraggingHelper(modelValue.dragging, e);\n if (typeof modelValue.dropContainer != 'undefined') {\n modelValue.scrollInterval = global.setInterval(function() {\n var foo = $(modelValue.dropContainer).scrollTop();\n $(modelValue.dropContainer).scrollTop(foo + modelValue.adding);\n }, 20);\n }\n if (typeof origStart != 'undefined') return origStart(e, ui);\n };\n var origStop = modelValue.options.stop;\n modelValue.options.stop = function(e, ui) {\n if (typeof modelValue.dragging != 'undefined' && ko.isWritableObservable(modelValue.dragging)) isDraggingHelper(modelValue.dragging, e);\n if (typeof modelValue.dropContainer != 'undefined') {\n global.clearInterval(modelValue.scrollInterval);\n }\n if (typeof origStop != 'undefined') return origStop(e, ui);\n };\n var origDrag = modelValue.options.drag;\n modelValue.options.drag = function(e, ui) {\n if (typeof modelValue.dropContainer != 'undefined') {\n var top = e.pageY - $(modelValue.dropContainer).offset().top;\n var bottom = top - $(modelValue.dropContainer).height();\n // Handle scrolling speed depending on distance from border.\n if (top < -20) {\n modelValue.adding = -20;\n // console.log(\"<<<\");\n } else if (top < 0) {\n modelValue.adding = -10;\n // console.log(\"<<\");\n } else if (top < 10) {\n modelValue.adding = -5;\n // console.log(\"<\");\n } else if (bottom > 20) {\n modelValue.adding = 20;\n // console.log(\">>>\");\n } else if (bottom > 0) {\n modelValue.adding = 10;\n // console.log(\">>\");\n } else if (bottom > -10) {\n modelValue.adding = 5;\n // console.log(\">\");\n } else {\n modelValue.adding = 0;\n }\n }\n if (typeof origDrag != 'undefined') return origDrag(e, ui);\n };\n\n return modelValue;\n };\n};\n\nko.bindingHandlers.extsortable = {\n init: function(element, valueAccessor, allBindingsAccessor, data, context) {\n return ko.bindingHandlers.sortable.init(element, makeExtendedValueAccessor(valueAccessor), allBindingsAccessor, data, context);\n },\n update: function(element, valueAccessor, allBindingsAccessor, data, context) {\n return ko.bindingHandlers.sortable.update(element, makeExtendedValueAccessor(valueAccessor), allBindingsAccessor, data, context);\n }\n};\n\nko.bindingHandlers.extdraggable = {\n init: function(element, valueAccessor, allBindingsAccessor, data, context) {\n return ko.bindingHandlers.draggable.init(element, makeExtendedValueAccessor(valueAccessor), allBindingsAccessor, data, context);\n },\n update: function(element, valueAccessor, allBindingsAccessor, data, context) {\n return ko.bindingHandlers.draggable.update(element, makeExtendedValueAccessor(valueAccessor), allBindingsAccessor, data, context);\n }\n};",
|
|
115
|
+
"\"use strict\";\n/* global global: false, Image: false */\n\n// This module depends on those files, but it doesn't have a direct dependency, so we don't require them here.\n\n//require(\"blueimp-canvas-to-blob\");\n//require(\"jquery-file-upload/js/jquery.iframe-transport.js\");\n//require(\"jquery-file-upload/js/jquery.fileupload.js\");\n//require(\"jquery-file-upload/js/jquery.fileupload-process.js\");\n//require(\"jquery-file-upload/js/jquery.fileupload-image.js\");\n//require(\"jquery-file-upload/js/jquery.fileupload-validate.js\");\n\nvar $ = require(\"jquery\");\nvar ko = require(\"knockout\");\nvar console = require(\"console\");\n\n// experimental image preloading.\nko.bindingHandlers['preloader'] = {\n init: function(element, valueAccessor) {\n var value = valueAccessor();\n if (typeof value.preloaded == 'undefined') {\n value.preloaded = ko.observable(\"\");\n\n var preloader = function(newValue) {\n if (newValue != value.preloaded()) {\n if (newValue !== '') {\n var img = new Image();\n img.onload = function() {\n value.preloaded(newValue);\n };\n img.onerror = function() {\n value.preloaded(newValue);\n };\n img.src = newValue;\n } else {\n value.preloaded(newValue);\n }\n }\n };\n\n value.subscribe(preloader);\n preloader(value());\n }\n }\n};\n\n// TODO we don't use advattr and advstyle, maybe we should simply remove this code.\nko.bindingHandlers['advattr'] = {\n 'init': function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n var value = ko.utils.unwrapObservable(valueAccessor() || {});\n ko.utils.objectForEach(value, function(attrName, attrValueAccessor) {\n var attrValue = element.getAttribute(attrName);\n\n if (ko.isWriteableObservable(attrValueAccessor)) {\n var oldValue = attrValueAccessor();\n if (oldValue != attrValue) {\n attrValueAccessor(attrValue);\n if (oldValue !== null) {\n console.log(\"AdvAttr found a value different from the default\", attrName, oldValue, attrValue);\n }\n }\n }\n });\n },\n 'update': function(element, valueAccessor, allBindings) {\n var value = ko.utils.unwrapObservable(valueAccessor()) || {};\n ko.utils.objectForEach(value, function(attrName, attrValue) {\n attrValue = ko.utils.unwrapObservable(attrValue);\n // To cover cases like \"attr: { checked:someProp }\", we want to remove the attribute entirely\n // when someProp is a \"no value\"-like value (strictly null, false, or undefined)\n // (because the absence of the \"checked\" attr is how to mark an element as not checked, etc.)\n var toRemove = (attrValue === false) || (attrValue === null) || (attrValue === undefined);\n if (toRemove) element.removeAttribute(attrName);\n else element.setAttribute(attrName, attrValue.toString());\n });\n }\n};\nko.bindingHandlers['advstyle'] = {\n 'init': function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n var value = ko.utils.unwrapObservable(valueAccessor() || {});\n ko.utils.objectForEach(value, function(styleName, styleValueAccessor) {\n var styleValue;\n if (styleName.match(/Px$/)) {\n styleName = styleName.substr(0, styleName.length - 2);\n styleValue = element.style[styleName];\n if (styleValue.match(/px$/)) {\n styleValue = styleValue.replace(/px$/, '');\n } else {\n console.log(\"AdvStyle binding found an unexpected default value\", styleName, styleValue, element);\n }\n } else {\n styleValue = element.style[styleName];\n }\n\n if (ko.isWriteableObservable(styleValueAccessor)) {\n var oldValue = styleValueAccessor();\n if (oldValue != styleValue) {\n styleValueAccessor(styleValue);\n if (oldValue !== null) {\n console.log(\"AdvStyle found a value different from the default\", styleName, oldValue, styleValue);\n }\n }\n }\n });\n },\n 'update': function(element, valueAccessor) {\n var value = ko.utils.unwrapObservable(valueAccessor() || {});\n ko.utils.objectForEach(value, function(styleName, styleValue) {\n styleValue = ko.utils.unwrapObservable(styleValue);\n\n if (styleValue === null || typeof styleValue === 'undefined' || styleValue === false) {\n styleValue = \"\";\n }\n\n if (styleName.match(/Px$/)) {\n styleName = styleName.substr(0, styleName.length - 2);\n styleValue = styleValue + \"px\";\n }\n\n element.style[styleName] = styleValue;\n });\n }\n};\n\n// Utility to log inizialization and disposal of DOM elements.\nko.bindingHandlers['domlog'] = {\n init: function(element, valueAccessor) {\n console.log(\"initialized\", element);\n ko.utils.domNodeDisposal.addDisposeCallback(element, function() {\n console.log(\"disposed\", element);\n });\n }\n};\n\nko.bindingHandlers['fudroppable'] = {\n init: function(element, valueAccessor) {\n var opt = valueAccessor() || {};\n var timeoutsObj = {};\n\n var over = function(timeouts, dropZoneTimeout, element, className, observable, event) {\n\n if (!timeouts[dropZoneTimeout]) {\n if (typeof className !== 'undefined') {\n element.classList.add(className);\n }\n if (ko.isWriteableObservable(observable) && !observable()) {\n observable(true);\n }\n } else {\n global.clearTimeout(timeouts[dropZoneTimeout]);\n }\n\n var stop = function() {\n timeouts[dropZoneTimeout] = null;\n if (typeof className !== 'undefined') {\n element.classList.remove(className);\n }\n if (ko.isWriteableObservable(observable) && observable()) {\n observable(false);\n }\n };\n\n if (event.type == 'dragleave') stop();\n else {\n // Using 100 it doens't work fine on Linux (chome/firefox), using 200 still shows issues on slow Linux boxes\n timeouts[dropZoneTimeout] = global.setTimeout(stop, 500);\n }\n\n };\n\n if (opt.active || opt.activeClass) {\n ko.utils.registerEventHandler(global, 'dragover', over.bind(undefined, timeoutsObj, 'activeTimeout', element, opt.activeClass, opt.active));\n }\n if (opt.hoverClass) {\n // dragenter and dragleave are not required but they speedup feedback when used.\n ko.utils.registerEventHandler(element, 'dragover dragenter dragleave', over.bind(undefined, timeoutsObj, 'hoverTimeout', element, opt.hoverClass, undefined));\n }\n }\n};\n\nko.bindingHandlers['fileupload'] = {\n extendOptions: {},\n remoteFilePreprocessor: function(url) { return url; },\n init: function(element, valueAccessor) {\n // TODO domnodedisposal doesn't work when the upload is done by \"clicking\"\n // Probably jquery-fileupload moves the DOM somewhere else so that KO doesn't \n // detect the removal anymore.\n ko.utils.domNodeDisposal.addDisposeCallback(element, function() {\n $(element).fileupload('destroy');\n });\n\n // if we leave the title the native control will show us a tooltip we don't want.\n // In WebKit the right way to remove it is leaving a \"whitespace\".\n // In Gecko we have to set it empty.\n if (global.webkitURL)\n $(element).attr('title', ' ');\n else\n $(element).attr('title', '');\n },\n\n update: function(element, valueAccessor) {\n var options = valueAccessor() || {};\n\n var $fu = $(element);\n var $parent = $fu.parents('.uploadzone');\n\n var dataValue = options.data;\n options.data = undefined;\n\n var canvasPreview = options.canvasPreview;\n\n // TODO remove hardcoded url\n ko.utils.extend(options, {\n url: '/upload/',\n dataType: 'json',\n dropZone: $parent.find('.mo-uploadzone')[0],\n autoUpload: true,\n acceptFileTypes: /(\\.|\\/)(gif|jpe?g|png)$/i,\n maxFileSize: 1024 * 1024,\n // Enable image resizing, except for Android and Opera,\n // which actually support image resizing, but fail to\n // send Blob objects via XHR requests:\n disableImageResize: /Android(?!.*Chrome)|Opera/.test(global.navigator.userAgent),\n previewMaxWidth: 200,\n previewMaxHeight: 200,\n previewCrop: false,\n replaceFileInput: false, // replaceFileInput true breaks after uploading using \"input\" (using mouse clic instead of dropping)\n\n messages: {\n // client side\n unknownError: 'Unknown error',\n uploadedBytes: 'Uploaded bytes exceed file size',\n maxNumberOfFiles: 'Maximum number of files exceeded',\n acceptFileTypes: 'File type not allowed',\n maxFileSize: 'File is too large',\n minFileSize: 'File is too small',\n // server side\n post_max_size: 'The uploaded file exceeds the post_max_size directive in php.ini',\n max_file_size: 'File is too big',\n min_file_size: 'File is too small',\n accept_file_types: 'Filetype not allowed',\n max_number_of_files: 'Maximum number of files exceeded',\n max_width: 'Image exceeds maximum width',\n min_width: 'Image requires a minimum width',\n max_height: 'Image exceeds maximum height',\n min_height: 'Image requires a minimum height',\n abort: 'File upload aborted',\n image_resize: 'Failed to resize image',\n generic: 'Unexpected upload error'\n }\n });\n\n ko.utils.extend(options, ko.bindingHandlers['fileupload'].extendOptions);\n\n var working = 0;\n var firstWorked = '';\n\n var cleanup = function() {\n if (--working === 0) {\n if (dataValue) {\n dataValue(firstWorked);\n }\n firstWorked = '';\n if (canvasPreview) {\n $parent.find('img').show();\n $parent.find('canvas').remove();\n }\n $parent.removeClass(\"uploading\");\n $parent.find('.progress-bar').css('width', 0);\n }\n };\n\n var translatedMessage = function(text) {\n if (typeof options.messages == 'object' && options.messages !== null) {\n var match = text.match(/^([^ ]+)(.*)$/);\n if (match) {\n if (typeof options.messages[match[1]] !== 'undefined') {\n return options.messages[match[1]] + match[2];\n }\n }\n }\n return text;\n };\n\n $fu.fileupload(options);\n\n var events = ['fileuploadadd', 'fileuploadprocessalways', 'fileuploadprogressall', 'fileuploaddone', 'fileuploadfail'];\n var eventHandler = function(e, data) {\n if (e.type == 'fileuploadadd') {\n working++;\n }\n if (e.type == 'fileuploadfail') {\n console.log(\"fileuploadfail\", e, data);\n if (options.onerror) {\n if (data.errorThrown === '' && data.textStatus == 'error') {\n options.onerror(translatedMessage('generic'));\n } else {\n options.onerror(translatedMessage('generic (' + data.errorThrown + ')'));\n }\n }\n cleanup();\n }\n if (e.type == 'fileuploaddone') {\n if (typeof data.result.files[0].url !== 'undefined') {\n if (options.onfile) {\n for (var i = 0; i < data.result.files.length; i++) {\n data.result.files[i] = ko.bindingHandlers['fileupload'].remoteFilePreprocessor(data.result.files[i]);\n options.onfile(data.result.files[i]);\n }\n }\n\n if (firstWorked === '') firstWorked = data.result.files[0].url;\n\n if (canvasPreview) {\n var img = new Image();\n img.onload = cleanup;\n img.onerror = cleanup;\n img.src = data.result.files[0].url;\n } else {\n cleanup();\n }\n } else if (typeof data.result.files[0].error !== 'undefined') {\n console.log(\"remote error\", e, data);\n if (options.onerror) {\n options.onerror(translatedMessage(data.result.files[0].error));\n }\n cleanup();\n } else {\n console.log(\"unexpected error\", e, data);\n if (options.onerror) {\n options.onerror(translatedMessage('generic (Unexpected Error retrieving uploaded file)'));\n }\n cleanup();\n }\n }\n if (e.type == 'fileuploadprocessalways') {\n var index = data.index,\n file = data.files[index];\n if (file.preview && index === 0) {\n // if we have a canvas we had multiple uploaded files\n if ($parent.find('canvas').length === 0) {\n if (canvasPreview) {\n var el = $(file.preview).css('width', '100%'); // .css('position', 'absolute').css('left', '0');\n $parent.find('img').hide();\n $parent.prepend(el);\n }\n $parent.addClass(\"uploading\");\n $parent.find('.progress-bar').css('width', 0);\n }\n }\n if (file.error) {\n // File type not allowed\n // File is too large\n if (options.onerror) {\n options.onerror(translatedMessage(file.error));\n }\n cleanup();\n }\n }\n if (e.type == 'fileuploadprogressall') {\n var progress = parseInt(data.loaded / data.total * 100, 10);\n $parent.find('.progress-bar').css('width', progress + '%');\n }\n };\n for (var i = events.length - 1; i >= 0; i--) {\n var eventName = events[i];\n $fu.on(eventName, eventHandler);\n }\n if (!$.support.fileInput) {\n $fu.prop('disabled', true).parent().addClass('disabled');\n }\n }\n};",
|
|
116
|
+
"\"use strict\";\n\nvar ko = require(\"knockout\");\nvar console = require(\"console\");\n\nko.bindingHandlers['ifSubs'] = {\n // cloneNodes from ko.utils.cloneNodes (missing in minimized KO)\n cloneNodes: function(nodesArray, shouldCleanNodes) {\n for (var i = 0, j = nodesArray.length, newNodesArray = []; i < j; i++) {\n var clonedNode = nodesArray[i].cloneNode(true);\n newNodesArray.push(shouldCleanNodes ? ko.cleanNode(clonedNode) : clonedNode);\n }\n return newNodesArray;\n },\n 'init': function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n var didDisplayOnLastUpdate,\n savedNodes,\n valueAcc = valueAccessor();\n if (typeof valueAcc.data.subsCount === 'undefined') {\n ko.extenders['subscriptionsCount'](valueAcc.data);\n // NOTE I can't simply listen on \"thresholds\" because multiple bindings to the same observable could use different thresholds.\n }\n ko.computed(function() {\n var dataValue = ko.utils.unwrapObservable(valueAccessor().data.subsCount),\n isFirstRender = !savedNodes,\n shouldDisplay, needsRefresh, gutter;\n\n gutter = -(typeof valueAccessor().gutter !== 'undefined' ? valueAccessor().gutter : 1);\n shouldDisplay = dataValue + (didDisplayOnLastUpdate ? gutter : 0) >= ko.utils.unwrapObservable(valueAcc.threshold);\n if (typeof valueAccessor().not !== 'undefined' && valueAccessor().not) {\n shouldDisplay = !shouldDisplay;\n }\n needsRefresh = isFirstRender || (shouldDisplay !== didDisplayOnLastUpdate);\n\n if (needsRefresh) {\n // Save a copy of the inner nodes on the initial update, but only if we have dependencies.\n if (isFirstRender && ko.computedContext.getDependenciesCount()) {\n savedNodes = ko.bindingHandlers['ifSubs'].cloneNodes(ko.virtualElements.childNodes(element), true /* shouldCleanNodes */ );\n }\n\n if (shouldDisplay) {\n if (!isFirstRender) {\n ko.virtualElements.setDomNodeChildren(element, ko.bindingHandlers['ifSubs'].cloneNodes(savedNodes));\n }\n ko.applyBindingsToDescendants(bindingContext, element);\n } else {\n ko.virtualElements.emptyNode(element);\n }\n\n didDisplayOnLastUpdate = shouldDisplay;\n }\n }, null, {\n disposeWhenNodeIsRemoved: element\n });\n return {\n 'controlsDescendantBindings': true\n };\n }\n};\nko.virtualElements.allowedBindings['ifSubs'] = true;\n\n// ko.isWritableObservable (without \"e\") has been introduced in 3.2.0, that is also our min requirement.\n// minimized knockout \"obfuscate\" the beforeSubscriptionAdd and afterSubscriptionRemove methods that we hack here.\n// so we have to explicitly know that.\n// Note: we used to use ko.DEBUG to detect the debug version of KO, but this was removed in KO 3.4.0+, \n// so we switched to ko.subscription function that only exists in DEBUG versions.\nvar beforeSubscriptionProp;\nvar afterSubscriptionProp;\nif (typeof ko.subscription == 'function' && typeof ko.isWritableObservable !== 'undefined') {\n beforeSubscriptionProp = 'beforeSubscriptionAdd';\n afterSubscriptionProp = 'afterSubscriptionRemove';\n} else if (ko.version == \"3.2.0\") {\n beforeSubscriptionProp = 'va';\n afterSubscriptionProp = 'nb';\n} else if (ko.version == \"3.3.0\") {\n beforeSubscriptionProp = 'ja';\n afterSubscriptionProp = 'ua';\n} else if (ko.version == \"3.4.0\") {\n beforeSubscriptionProp = 'sa';\n afterSubscriptionProp = 'Ia';\n} else if (ko.version == \"3.4.1\") {\n beforeSubscriptionProp = 'sa';\n afterSubscriptionProp = 'Ia';\n}\nelse throw \"Unsupported minimized Knockout version \" + ko.version + \" (supported DEBUG or minimized 3.2.0 ... 3.4.1)\";\n\n// internally used by ifsubs binding.\n// WARNING this break when used with pureComputed or deferredEvaluated\nko.extenders['subscriptionsCount'] = function(target, l1, l2) {\n if (typeof target.subsCount === 'undefined') {\n target.subsCount = ko.observable(target.getSubscriptionsCount()).extend({\n notify: 'always'\n });\n var underlyingBeforeSubscriptionAddFunction = target[beforeSubscriptionProp];\n var underlyingAfterSubscriptionRemoveFunction = target[afterSubscriptionProp];\n target[beforeSubscriptionProp] = function(event) {\n if (underlyingBeforeSubscriptionAddFunction) underlyingBeforeSubscriptionAddFunction.call(target, event);\n var c = target.getSubscriptionsCount() + 1;\n if (typeof l1 === 'undefined' || c == l1 || typeof l2 === 'undefined' || c == l2) target.subsCount(c);\n };\n target[afterSubscriptionProp] = function(event) {\n if (underlyingAfterSubscriptionRemoveFunction) underlyingAfterSubscriptionRemoveFunction.call(target, event);\n var c = target.getSubscriptionsCount();\n if (typeof l1 === 'undefined' || c == l1 || typeof l2 === 'undefined' || c == l2) target.subsCount(c);\n };\n } else {\n console.log(\"already applied subscriptionCount to observable\");\n }\n return null;\n};\n",
|
|
117
|
+
"\"use strict\";\n\n// Overrides native jQuery spinner to avoid validation of the \"step\".\n// We wants to use the step but also wants to leave the user the ability to select specific values.\n\nvar $ = require('jquery');\nvar spinner = require(\"jquery-ui/spinner\");\nvar console = require('console');\n\nif (typeof spinner == 'undefined') throw \"Cannot find jquery-ui spinner widget dependency!\";\n\n$.widget(\"ui.spinner\", spinner, {\n _adjustValue: function(value) {\n var adj = this._super(value);\n\n var options = this.options;\n\n // fix precision from bad JS floating point math\n value = parseFloat(value.toFixed(this._precision()));\n\n // clamp the value\n if (options.max !== null && value > options.max) {\n return options.max;\n }\n if (options.min !== null && value < options.min) {\n return options.min;\n }\n\n return value;\n }\n});\n",
|
|
118
|
+
"\"use strict\";\n\n// Overrides native jQuery tabs to make tabs working also when using a base tag\n// in order to avoid conflicts you have to add a data-local=\"true\" attribute to your tab links.\n\nvar $ = require('jquery');\nvar console = require('console');\nvar tabs = require(\"jquery-ui/tabs\");\n\nif (typeof tabs == 'undefined') throw \"Cannot find jquery-ui tabs widget dependency!\";\n\n$.widget(\"ui.tabs\", tabs, {\n _isLocal: function( anchor ) {\n if (anchor.getAttribute('data-local') == \"true\") return true;\n else return this._superApply( arguments );\n }\n});",
|
|
119
|
+
"\"use strict\";\n/* globals global: false */\n\nfunction pushTemplate(templateName, templateText) {\n var scriptTag = global.document.createElement('script');\n scriptTag.setAttribute('type', 'text/html');\n scriptTag.setAttribute('id', templateName);\n scriptTag.text = templateText;\n global.document.body.appendChild(scriptTag);\n}\n\nfunction removeTemplate(templateName) {\n var el = global.document.getElementById(templateName);\n if (el) el.parentNode.removeChild(el);\n}\n\nfunction init() {}\n\nfunction getTemplateContent(id) {\n var el = global.document.getElementById(id);\n if (el) return el.innerHTML;\n else return undefined;\n}\n\nmodule.exports = {\n init: init,\n addTemplate: pushTemplate,\n removeTemplate: removeTemplate,\n getTemplateContent: getTemplateContent\n};",
|
|
120
|
+
"\"use strict\";\n/* global global: false */\n\nvar ko = require(\"knockout\");\nvar $ = require(\"jquery\");\nvar console = require(\"console\");\nvar tinymce = require(\"tinymce\");\n\nvar timeout;\n\nvar render = function() {\n\n timeout = undefined;\n\n if (typeof tinymce.activeEditor !== 'undefined' && tinymce.activeEditor !== null &&\n typeof tinymce.activeEditor.theme !== 'undefined' && tinymce.activeEditor.theme !== null && \n typeof tinymce.activeEditor.theme.panel !== 'undefined' && tinymce.activeEditor.theme.panel !== null &&\n typeof tinymce.activeEditor.theme.panel.visible !== 'undefined') {\n // @see FloatPanel.js function repositionPanel(panel)\n // First condition group is for Tinymce 4.0/4.1\n // Second condition group is for Tinymce 4.2/4.3 where \"._property\" are now available as \".state.get('property')\".\n if ((typeof tinymce.activeEditor.theme.panel._visible !== 'undefined' && tinymce.activeEditor.theme.panel._visible && tinymce.activeEditor.theme.panel._fixed) || \n (typeof tinymce.activeEditor.theme.panel.state !== 'undefined' && tinymce.activeEditor.theme.panel.state.get('visible') && tinymce.activeEditor.theme.panel.state.get('fixed'))) {\n tinymce.activeEditor.theme.panel.fixed(false);\n }\n\n tinymce.activeEditor.nodeChanged();\n tinymce.activeEditor.theme.panel.visible(true);\n if (tinymce.activeEditor.theme.panel.layoutRect().y <= 40)\n tinymce.activeEditor.theme.panel.moveBy(0, 40 - tinymce.activeEditor.theme.panel.layoutRect().y);\n\n }\n};\n\nko.bindingHandlers.wysiwygScrollfix = {\n 'scroll': function(event) {\n if (timeout) global.clearTimeout(timeout);\n timeout = global.setTimeout(render, 50);\n },\n 'init': function(element) {\n ko.utils.domNodeDisposal.addDisposeCallback(element, function() {\n $(element).off(\"scroll\", ko.bindingHandlers.wysiwygScrollfix.scroll);\n });\n\n $(element).on(\"scroll\", ko.bindingHandlers.wysiwygScrollfix.scroll);\n\n }\n};",
|
|
121
|
+
"\"use strict\";\n\nvar $ = require(\"jquery\");\nvar ko = require(\"knockout\");\nvar console = require(\"console\");\n\nvar _scrollIntoView = function($element, alignTop, scrollParent, moveBy) {\n var currentScrollTop = scrollParent.scrollTop();\n var newScrollTop = currentScrollTop - moveBy - (alignTop ? 20 : -20);\n // iframe scrolls the window and animation is not supported\n var animate = typeof scrollParent[0].nodeType !== 'undefined';\n if (animate) {\n var action = {\n 'scrollTop': \"\" + Math.round(newScrollTop) + \"px\"\n };\n var time = Math.round(Math.abs(newScrollTop - currentScrollTop));\n scrollParent.stop().animate(action, time);\n } else {\n scrollParent.scrollTop(newScrollTop);\n }\n // native scrollIntoView is not well supported and doesn't work fine.\n // element.scrollIntoView(alignTop);\n};\n\nko.bindingHandlers.scrollIntoView = {\n update: function(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {\n var selected = ko.utils.unwrapObservable(valueAccessor());\n if (!selected) return;\n try {\n\n while (element.nodeType === 8) {\n // element is a comment, move to the next sibling...\n element = element.nextSibling;\n }\n if (element.nodeType !== 8) {\n var scrollParent = $(element).scrollParent();\n\n var parentTop;\n var relativeOffset = false;\n if (scrollParent[0].nodeType == 9) {\n // scrollparent is document, replacing with body...\n scrollParent = $(scrollParent[0].defaultView);\n parentTop = 0;\n relativeOffset = true;\n } else {\n parentTop = scrollParent.offset().top;\n }\n\n var parentHeight = scrollParent.height();\n var parentScroll = scrollParent.scrollTop();\n var parentBottom = parentTop + parentHeight;\n\n // scrollParent is the document.\n var $element = $(element);\n var elTop = $element.offset().top;\n // when we are in \"iframe\" with scrollbar everythijng changes.\n if (relativeOffset) elTop = elTop - parentScroll;\n var elHeight = $element.height();\n var elBottom = elTop + elHeight;\n if (elTop > parentTop && elTop + elHeight < parentBottom) {\n // both borders are visible => don't do anything.\n } else if (elHeight < parentHeight) {\n // if the block is smaller than the viewPort\n if (elTop < parentTop) _scrollIntoView(element, true, scrollParent, parentTop - elTop);\n // -> if the upper border is higher than the top, then I move it to the top.\n if (elBottom > parentBottom) _scrollIntoView(element, false, scrollParent, parentBottom - elBottom);\n // -> if the bottom border is lower than the bottom then I move it to the bottom.\n } else {\n // if the block is larger than the viewPort we do the opposite!\n // -> if the upper border is higher than the top and the lower is higher than the bottom I move the lower it to the bottom.\n if (elTop < parentTop && elBottom < parentBottom) _scrollIntoView(element, false, scrollParent, parentBottom - elBottom);\n // -> if the bottom border il lower than bottom and the upper is lower than the top I move the upper border to the viewport top\n if (elTop > parentTop && elBottom > parentBottom) _scrollIntoView(element, true, scrollParent, parentTop - elTop);\n }\n\n // element.scrollIntoView(true);\n }\n } catch (e) {\n console.log(\"TODO exception scrolling into view\", e);\n }\n }\n};\nko.virtualElements.allowedBindings['scrollIntoView'] = true;",
|
|
122
|
+
"\"use strict\";\n\nvar ko = require(\"knockout\");\nvar origTemplateSystem = require(\"./script-template.js\");\n\nvar templates = {};\n\n//define a template source that simply treats the template name as its content\nko.templateSources.stringTemplate = function(templateName, template) {\n this.templateName = templateName;\n this.template = template;\n this._data = {};\n};\n\nko.utils.extend(ko.templateSources.stringTemplate.prototype, {\n data: function(key, value) {\n // console.log(\"data\", key, value, this.templateName);\n if (arguments.length === 1) {\n return this._data[key];\n }\n\n this._data[key] = value;\n },\n text: function(value) {\n // console.log(\"text\", value, this.templateName)\n if (arguments.length === 0) {\n return this.template;\n }\n this.template = value;\n }\n});\n\n\n//modify an existing templateEngine to work with string templates\nfunction createStringTemplateEngine(templateEngine) {\n var orig = templateEngine.makeTemplateSource;\n templateEngine.makeTemplateSource = function(templateName) {\n if (typeof templates[templateName] !== 'undefined') {\n return new ko.templateSources.stringTemplate(templateName, templates[templateName]);\n } else {\n return orig(templateName);\n }\n };\n return templateEngine;\n}\n\nfunction pushTemplate(templateName, templateText) {\n templates[templateName] = templateText;\n}\n\nfunction removeTemplate(templateName) {\n if (typeof templates[templateName] !== 'undefined') {\n templates[templateName] = undefined;\n } else {\n origTemplateSystem.removeTemplate(templateName);\n }\n}\n\nfunction init() {\n ko.setTemplateEngine(createStringTemplateEngine(new ko.nativeTemplateEngine()));\n}\n\nfunction getTemplateContent(id) {\n if (typeof templates[id] !== 'undefined') {\n return templates[id];\n } else {\n return origTemplateSystem.getTemplateContent(id);\n }\n}\n\nmodule.exports = {\n init: init,\n addTemplate: pushTemplate,\n removeTemplate: removeTemplate,\n getTemplateContent: getTemplateContent\n};",
|
|
123
|
+
"\"use strict\";\n\nvar ko = require(\"knockout\");\nvar $ = require(\"jquery\");\nvar kojqui = require(\"knockout-jqueryui\");\nvar console = require(\"console\");\n\nvar extendValueAccessor = function(valueAccessor, obj) {\n return function() {\n ko.utils.extend(obj, valueAccessor());\n return obj;\n };\n};\n\nvar options = {\n show: {\n delay: 500\n },\n track: true,\n items: '[title][title!=\"\"][title!=\" \"]'\n};\n\nko.bindingHandlers.tooltips = {\n init: function(element, valueAccessor, allBindingsAccessor, data, context) {\n if (typeof $.fn.tooltip !== 'undefined' && typeof ko.bindingHandlers.tooltip !== 'undefined') {\n // position: { my: \"left+15 top+15\", at: \"center+30 center+30\" }\n // NOTE title with \"\" and \" \" is needed to avoid default tooltips in native file upload controls\n return ko.bindingHandlers.tooltip.init(element, extendValueAccessor(valueAccessor, options), allBindingsAccessor, data, context);\n }\n },\n update: function(element, valueAccessor, allBindingsAccessor, data, context) {\n if (typeof $.fn.tooltip !== 'undefined' && typeof ko.bindingHandlers.tooltip !== 'undefined') {\n return ko.bindingHandlers.tooltip.update(element, extendValueAccessor(valueAccessor, options), allBindingsAccessor, data, context);\n }\n },\n};",
|
|
124
|
+
"\"use strict\";\n\nvar ko = require('knockout');\nvar console = require('console');\n\n// equals to \"value\" binding but apply \"invalid\" class if \"pattern\" attribute is defined and value matches the rule\nko.bindingHandlers['validatedValue'] = {\n\tinit: function(element, valueAccessor, allBindings) {\n\t\tvar newValueAccessor = valueAccessor;\n\t\tif (typeof element.pattern !== 'undefined') {\n\t\t\tvar re = new RegExp('^(?:' + element.pattern + ')$');\n\t\t\tvar computed = ko.computed({\n\t\t\t\tread: function() {\n\t\t\t\t\tvar res = ko.utils.unwrapObservable(valueAccessor());\n\t\t\t\t\t// TODO support for element.required ?\n\t\t\t\t\tvar valid = res === null || res === '' || re.test(res);\n\t\t\t\t\t// IE11 doesn't support classList.toggle('invalid', state)\n\t\t\t\t\tif (valid) {\n\t\t\t\t\t\telement.classList.remove('invalid');\n\t\t\t\t\t} else {\n\t\t\t\t\t\telement.classList.add('invalid');\n\t\t\t\t\t}\n\t\t\t\t\treturn res;\n\t\t\t\t},\n\t\t\t\twrite: ko.isWriteableObservable(valueAccessor()) && function(value) {\n\t\t\t\t\t// @see https://github.com/voidlabs/mosaico/issues/103\n\t\t\t\t\tko.selectExtensions.writeValue(element, value);\n\t\t\t\t\tvar updValue = ko.selectExtensions.readValue(element);\n\t\t\t\t\tvalueAccessor()(updValue);\n\t\t\t\t},\n\t\t\t\tdisposeWhenNodeIsRemoved: element\n\t\t\t});\n\t\t\tnewValueAccessor = function() {\n\t\t\t\treturn computed;\n\t\t\t};\n\t\t}\n\t\tko.bindingHandlers['value'].init(element, newValueAccessor, allBindings);\n\t}\n};\nko.expressionRewriting._twoWayBindings['validatedValue'] = true;\n",
|
|
125
|
+
"\"use strict\";\n/* globals global:false */\n\nvar ko = require(\"knockout\");\nvar console = require(\"console\");\n\nko.bindingHandlers['uniqueId'] = {\n currentIndex: 0,\n 'init': function(element, valueAccessor) {\n var data = ko.utils.unwrapObservable(valueAccessor()) || {};\n if (data.id() === '') {\n var id, el, prefix;\n // TODO we need a better prefix\n prefix = 'ko_' + (typeof data.type !== 'undefined' ? ko.utils.unwrapObservable(data.type) : 'block');\n // when loading an exising model, IDs could be already assigned.\n do {\n id = prefix + '_' + (++ko.bindingHandlers['uniqueId'].currentIndex);\n el = global.document.getElementById(id);\n if (el) {\n // when loading an existing model my \"currentIndex\" is empty.\n // but we have existing blocks, so I must be sure I don't reuse their IDs.\n // We use different prefixes (per block type) so that a hidden block \n // (for which we have no id in the page, e.g: preheader in versafix-1)\n // will break everthing once we reuse its name.\n }\n } while (el);\n data.id(id);\n }\n }\n};\nko.virtualElements.allowedBindings['uniqueId'] = true;\n\nko.bindingHandlers['virtualAttr'] = {\n update: function(element, valueAccessor) {\n if (element.nodeType !== 8) {\n ko.bindingHandlers['attr'].update(element, valueAccessor);\n }\n }\n};\nko.virtualElements.allowedBindings['virtualAttr'] = true;\n\nko.bindingHandlers['virtualAttrStyle'] = {\n update: function(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {\n if (element.nodeType !== 8) {\n // In \"preview\" we also set \"replacedstyle\" so to have an attribute to be used by IE (IE breaks the STYLE) to do the export.\n var isNotWysiwygMode = (typeof bindingContext.templateMode == 'undefined' || bindingContext.templateMode != 'wysiwyg');\n var attrs = [\"style\"];\n if (isNotWysiwygMode) attrs.push(\"replacedstyle\");\n var attrValue = ko.utils.unwrapObservable(valueAccessor());\n for (var i = 0; i < attrs.length; i++) {\n var attrName = attrs[i];\n var toRemove = (attrValue === false) || (attrValue === null) || (attrValue === undefined);\n if (toRemove)\n element.removeAttribute(attrName);\n else\n element.setAttribute(attrName, attrValue.toString());\n }\n }\n }\n};\nko.virtualElements.allowedBindings['virtualAttrStyle'] = true;\n\nko.bindingHandlers['virtualStyle'] = {\n update: function(element, valueAccessor) {\n if (element.nodeType !== 8) {\n ko.bindingHandlers['style'].update(element, valueAccessor);\n }\n }\n};\nko.virtualElements.allowedBindings['virtualStyle'] = true;\n\n\nko.bindingHandlers['virtualHtml'] = {\n init: ko.bindingHandlers['html'].init,\n update: function(element, valueAccessor) {\n if (element.nodeType === 8) {\n var html = ko.utils.unwrapObservable(valueAccessor());\n\n ko.virtualElements.emptyNode(element);\n if ((html !== null) && (html !== undefined)) {\n if (typeof html !== 'string') {\n html = html.toString();\n }\n\n var parsedNodes = ko.utils.parseHtmlFragment(html);\n if (parsedNodes) {\n var endCommentNode = element.nextSibling;\n for (var i = 0, j = parsedNodes.length; i < j; i++)\n endCommentNode.parentNode.insertBefore(parsedNodes[i], endCommentNode);\n }\n }\n } else { // plain node\n ko.bindingHandlers['html'].update(element, valueAccessor);\n }\n\n // Content for virtualHTML must not be parsed by KO, it is simple content.\n return {\n controlsDescendantBindings: true\n };\n }\n};\nko.virtualElements.allowedBindings['virtualHtml'] = true;",
|
|
126
|
+
"\"use strict\";\n/* global global: false */\n\nvar tinymce = require(\"tinymce\");\nvar $ = require(\"jquery\");\nvar ko = require(\"knockout\");\nvar console = require(\"console\");\nrequire(\"./eventable.js\");\n\nko.bindingHandlers.wysiwygOrHtml = {\n init: function(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {\n var isNotWysiwygMode = (typeof bindingContext.templateMode == 'undefined' || bindingContext.templateMode != 'wysiwyg');\n\n if (isNotWysiwygMode)\n return ko.bindingHandlers['virtualHtml'].init();\n else\n return ko.bindingHandlers.wysiwyg.init(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext);\n },\n update: function(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {\n var isNotWysiwygMode = (typeof bindingContext.templateMode == 'undefined' || bindingContext.templateMode != 'wysiwyg');\n if (isNotWysiwygMode)\n return ko.bindingHandlers['virtualHtml'].update(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext);\n //else \n // return ko.bindingHandlers.wysiwyg.update(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext);\n }\n};\nko.virtualElements.allowedBindings['wysiwygOrHtml'] = true;\n\nko.bindingHandlers.wysiwygHref = {\n init: function(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {\n if (element.nodeType !== 8) {\n var v = valueAccessor();\n\n var isNotWysiwygMode = (typeof bindingContext.templateMode == 'undefined' || bindingContext.templateMode != 'wysiwyg');\n // console.log(\"XXX\", bindingContext.templateMode, isNotWysiwygMode, element.getAttribute(\"href\"));\n if (isNotWysiwygMode) {\n element.setAttribute('target', '_new');\n } else {\n /*jshint scripturl:true*/\n // 20150226: removed href to work around FF issues with <a href=\"\"><div contenteditable=\"true\">..</div></a>\n // element.setAttribute('href', 'javascript:void(0)');\n // 20150309: on IE, an editable <a href=\"\" data-editable=\"\"> prevent tinymce toolbar to be shown.\n // so I change behaviour based on the use of \"wysiwygOrHtml\"\n // @see: http://www.tinymce.com/develop/bugtracker_view.php?id=7432\n var allbindings = allBindingsAccessor();\n if (typeof allbindings.wysiwygOrHtml !== 'undefined') {\n element.setAttribute('href', 'javascript:void(0)');\n } else {\n element.removeAttribute('href');\n element.setAttribute('disabledhref', '#');\n }\n }\n }\n },\n update: function(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {\n if (element.nodeType !== 8) {\n var isNotWysiwygMode = (typeof bindingContext.templateMode == 'undefined' || bindingContext.templateMode != 'wysiwyg');\n // NOTE this unwrap is needed also in \"wysiwyg\" mode, otherwise dependency tracking dies.\n var attrValue = ko.utils.unwrapObservable(valueAccessor());\n if (isNotWysiwygMode) {\n if ((attrValue === false) || (attrValue === null) || (attrValue === undefined))\n element.removeAttribute('href');\n else\n element.setAttribute('href', attrValue.toString());\n }\n }\n }\n};\nko.virtualElements.allowedBindings['wysiwygHref'] = true;\n\nko.bindingHandlers.wysiwygSrc = {\n convertedUrl: function(src, method, width, height) {\n var res = src + \"?method=\" + method + \"&width=\" + width + (height !== null ? \"&height=\" + height : '');\n console.log(\"basic converterUrl\", res);\n return res;\n },\n placeholderUrl: function(plwidth, plheight, pltext) {\n var placeholdersrc = \"'http://lorempixel.com/g/'+\" + plwidth + \"+'/'+\" + plheight + \"+'/abstract/'+encodeURIComponent(\" + pltext + \")\";\n // http://placehold.it/200x150.png/cccccc/333333&text=placehold.it#sthash.nA3r26vR.dpuf\n // placeholdersrc = \"'http://placehold.it/'+\"+width+\"+'x'+\"+height+\"+'.png/cccccc/333333&text='+\"+size;\n // placeholdersrc = \"'\"+converterUtils.addSlashes(defaultValue)+\"'\";\n },\n update: function(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {\n var value = ko.utils.unwrapObservable(valueAccessor());\n var attrValue = ko.utils.unwrapObservable(value.src);\n var placeholderValue = ko.utils.unwrapObservable(value.placeholder);\n var width = ko.utils.unwrapObservable(value.width);\n var height = ko.utils.unwrapObservable(value.height);\n if ((attrValue === false) || (attrValue === null) || (attrValue === undefined) || (attrValue === '')) {\n if (typeof placeholderValue == 'object' && placeholderValue !== null) element.setAttribute('src', ko.bindingHandlers.wysiwygSrc.placeholderUrl(placeholderValue.width, placeholderValue.height, placeholderValue.text));\n else element.removeAttribute('src');\n } else {\n var method = ko.utils.unwrapObservable(value.method);\n if (!method) method = width > 0 && height > 0 ? 'cover' : 'resize';\n var src = ko.bindingHandlers.wysiwygSrc.convertedUrl(attrValue.toString(), method, width, height);\n element.setAttribute('src', src);\n }\n if (typeof width !== 'undefined' && width !== null) element.setAttribute(\"width\", width);\n else element.removeAttribute(\"width\");\n if (typeof height !== 'undefined' && height !== null) element.setAttribute(\"height\", height);\n else element.removeAttribute(\"height\");\n }\n};\n\nko.bindingHandlers.wysiwygId = {\n init: function(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {\n var isNotWysiwygMode = (typeof bindingContext.templateMode == 'undefined' || bindingContext.templateMode != 'wysiwyg');\n if (!isNotWysiwygMode)\n element.setAttribute('id', ko.utils.unwrapObservable(valueAccessor()));\n },\n update: function(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {\n var isNotWysiwygMode = (typeof bindingContext.templateMode == 'undefined' || bindingContext.templateMode != 'wysiwyg');\n if (!isNotWysiwygMode)\n element.setAttribute('id', ko.utils.unwrapObservable(valueAccessor()));\n }\n};\nko.virtualElements.allowedBindings['wysiwygId'] = true;\n\n// used on editable \"item\" so to bind clicks only in wysiwyg mode.\nko.bindingHandlers.wysiwygClick = {\n init: function(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {\n var isNotWysiwygMode = (typeof bindingContext.templateMode == 'undefined' || bindingContext.templateMode != 'wysiwyg');\n if (!isNotWysiwygMode)\n ko.bindingHandlers.click.init(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext);\n }\n};\nko.virtualElements.allowedBindings['wysiwygClick'] = true;\n\n// used on editable \"item\" so to bind css only in wysiwyg mode.\nko.bindingHandlers.wysiwygCss = {\n update: function(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {\n var isNotWysiwygMode = (typeof bindingContext.templateMode == 'undefined' || bindingContext.templateMode != 'wysiwyg');\n if (!isNotWysiwygMode)\n ko.bindingHandlers.css.update(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext);\n }\n};\nko.virtualElements.allowedBindings['wysiwygCss'] = true;\n\nko.bindingHandlers.wysiwygImg = {\n makeTemplateValueAccessor: function(valueAccessor, bindingContext) {\n return function() {\n var isWysiwygMode = (typeof bindingContext.templateMode != 'undefined' && bindingContext.templateMode == 'wysiwyg');\n\n var modelValue = valueAccessor(),\n unwrappedValue = ko.utils.peekObservable(modelValue); // Unwrap without setting a dependency here\n\n // If unwrappedValue.data is the array, preserve all relevant options and unwrap again value so we get updates\n ko.utils.unwrapObservable(modelValue);\n\n return {\n 'name': isWysiwygMode ? unwrappedValue['_editTemplate'] : unwrappedValue['_template'],\n 'templateEngine': ko.nativeTemplateEngine.instance\n };\n };\n },\n 'init': function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n return ko.bindingHandlers['template']['init'](element, ko.bindingHandlers['wysiwygImg'].makeTemplateValueAccessor(valueAccessor, bindingContext));\n },\n 'update': function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n bindingContext = bindingContext['extend'](valueAccessor());\n return ko.bindingHandlers['template']['update'](element, ko.bindingHandlers['wysiwygImg'].makeTemplateValueAccessor(valueAccessor, bindingContext), allBindings, viewModel, bindingContext);\n }\n};\nko.virtualElements.allowedBindings['wysiwygImg'] = true;\n\n// NOTE: there are issues with the \"raw\" format and trash left around by tinymce workarounds for contenteditable issues.\n// setting \"forced_root_block: false\" disable the default behaviour of adding a wrapper <p> when needed and this seems to fix many issues in IE.\n// also, maybe we should use the \"raw\" only for the \"before SetContent\" and instead read the \"non-raw\" content (the raw content sometimes have data- attributes and too many ending <br> in the code)\nko.bindingHandlers.wysiwyg = {\n currentIndex: 0,\n standardOptions: {},\n fullOptions: {\n toolbar1: 'bold italic forecolor backcolor hr styleselect removeformat | link unlink | pastetext code',\n //toolbar1: \"bold italic | forecolor backcolor | link unlink | hr | pastetext code\", // | newsletter_profile newsletter_optlink newsletter_unsubscribe newsletter_showlink\";\n //toolbar2: \"formatselect fontselect fontsizeselect | alignleft aligncenter alignright alignjustify | bullist numlist\",\n plugins: [\"link hr paste lists textcolor code\"],\n // valid_elements: 'strong/b,em/i,*[*]',\n // extended_valid_elements: 'strong/b,em/i,*[*]',\n // Removed: image fullscreen contextmenu \n // download custom:\n // jquery version con legacyoutput, anchor, code, importcss, link, paste, textcolor, hr, lists\n },\n init: function(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {\n // TODO ugly, but works...\n ko.bindingHandlers.focusable.init(element);\n\n ko.utils.domNodeDisposal.addDisposeCallback(element, function() {\n tinymce.remove('#' + element.getAttribute('id'));\n });\n\n var value = valueAccessor();\n\n if (!ko.isObservable(value)) throw \"Wysiwyg binding called with non observable\";\n if (element.nodeType === 8) throw \"Wysiwyg binding called on virtual node, ignoring....\" + element.innerHTML;\n\n var selectorId = element.getAttribute('id');\n if (!selectorId) {\n selectorId = 'wysiwyg_' + (++ko.bindingHandlers['wysiwyg'].currentIndex);\n element.setAttribute('id', selectorId);\n }\n\n var fullEditor = element.tagName == 'DIV' || element.tagName == 'TD';\n var isSubscriberChange = false;\n var thisEditor;\n var isEditorChange = false;\n\n var options = {\n selector: '#' + selectorId,\n inline: true,\n // maybe not needed, but won't hurt.\n hidden_input: false,\n plugins: [\"paste\"],\n toolbar1: \"bold italic\",\n toolbar2: \"\",\n // we have to disable preview_styles otherwise tinymce push inline every style he things will be applied and this makes the style menu to inherit color/font-family and more.\n preview_styles: false,\n paste_as_text: true,\n language: 'en',\n schema: \"html5\",\n extended_valid_elements: 'strong/b,em/i,*[*]',\n menubar: false,\n skin: 'gray-flat',\n setup: function(editor) {\n // TODO change sometimes doesn't trigger (we have to document when)\n // listening on keyup would increase correctness but we would need a rateLimit to avoid flooding.\n editor.on('change redo undo', function() {\n if (!isSubscriberChange) {\n isEditorChange = true;\n // we failed with other ways to do this:\n // value($(element).html());\n // value(element.innerHTML);\n value(editor.getContent({\n format: 'raw'\n }));\n isEditorChange = false;\n }\n });\n // Clicking on the element on focus change allow the \"clic\" code to be triggered and propagate the selection.\n // Not elegant, maybe we have better options.\n editor.on('focus', function() {\n // Used by scrollfix.js (maybe this is not needed by new scrollfix.js)\n editor.nodeChanged();\n editor.getElement().click();\n });\n\n // NOTE: this fixes issue with \"leading spaces\" in default content that were lost during initialization.\n editor.on('BeforeSetContent', function(args) {\n if (args.initial) args.format = 'raw';\n });\n\n /* NOTE: disabling \"ENTER\" in tiny editor, not a good thing but may be needed to work around contenteditable issues\n if (!fullEditor) {\n // se non abbiamo il \"full Editor\", disabilitiamo l'invio. (vari bug)\n editor.on('keydown', function(e) {\n if (e.keyCode == 13) { e.preventDefault(); }\n });\n }\n */\n\n thisEditor = editor;\n\n }\n };\n\n ko.utils.extend(options, ko.bindingHandlers.wysiwyg.standardOptions);\n if (fullEditor) ko.utils.extend(options, ko.bindingHandlers.wysiwyg.fullOptions);\n\n // we have to put initialization in a settimeout, otherwise switching from \"1\" to \"2\" columns blocks\n // will start the new editors before disposing the old ones and IDs get temporarily duplicated.\n // using setTimeout the dispose/create order is correct on every browser tested.\n global.setTimeout(function() {\n tinymce.init(options);\n });\n\n ko.computed(function() {\n var content = ko.utils.unwrapObservable(valueAccessor());\n if (!isEditorChange) {\n try {\n isSubscriberChange = true;\n // we failed setting contents in other ways...\n // $(element).html(content);\n if (typeof thisEditor !== 'undefined') {\n thisEditor.setContent(content, {\n format: 'raw'\n });\n } else {\n ko.utils.setHtml(element, content);\n }\n } catch (e) {\n console.log(\"TODO exception setting content to editable element\", typeof thisEditor, e);\n }\n isSubscriberChange = false;\n }\n }, null, {\n disposeWhenNodeIsRemoved: element\n });\n\n // do not parse html content for KO bindings!!\n return {\n controlsDescendantBindings: true\n };\n\n }\n};",
|
|
127
|
+
"\"use strict\";\nvar console = require(\"console\");\n\n// returns 0 if equal (0.0.x release), 1 with backward compatible additions (0.x.0 release), 2 on lost data or incompatible data (x.0.0 release)\nvar checkModel = function(reference, blockDefs, model, origPrefix, reverse) {\n var blockDefsObj, i, prefix;\n var valid = 0;\n if (typeof reverse == 'undefined') reverse = false;\n if (typeof blockDefs !== 'undefined' && typeof blockDefs.splice == 'function') {\n blockDefsObj = {};\n for (i = 0; i < blockDefs.length; i++) blockDefsObj[blockDefs[i].type] = blockDefs[i];\n } else {\n blockDefsObj = blockDefs;\n }\n for (var prop in reference)\n if (reference.hasOwnProperty(prop)) {\n prefix = typeof origPrefix !== 'undefined' ? origPrefix + \".\" + prop : prop;\n if (!model.hasOwnProperty(prop)) {\n if (reverse) {\n console.warn(\"WARN Property \", prefix, \"found in model is not defined by template: removing it!\");\n valid = Math.max(valid, 2);\n delete reference[prop];\n } else {\n console.log(\"INFO Property \", prefix, \"missing in model, cloning from reference!\");\n valid = Math.max(valid, 1);\n model[prop] = reference[prop];\n }\n } else if (typeof model[prop] != typeof reference[prop]) {\n // se sono di tipo diverso allora provo a vedere se l'altro, convertito di tipo mantiene un valore equivalente.\n if (model[prop] !== null && reference[prop] !== null) {\n if (typeof model[prop] == 'string') {\n if (String(reference[prop]) != reference[prop]) {\n console.log(\"TODO Different type 1 \", prefix, typeof model[prop], typeof reference[prop], model[prop], reference[prop]);\n valid = Math.max(valid, 2);\n }\n } else if (typeof model[prop] == 'number') {\n if (Number(reference[prop]) != reference[prop]) {\n console.log(\"TODO Different type 2 \", prefix, typeof model[prop], typeof reference[prop], model[prop], reference[prop]);\n valid = Math.max(valid, 2);\n }\n } else {\n console.log(\"TODO Different type 3 \", prefix, typeof model[prop], typeof reference[prop], model[prop], reference[prop]);\n valid = Math.max(valid, 2);\n }\n }\n } else if (typeof reference[prop] == 'object') {\n if (reference[prop] !== null) {\n if (typeof reference[prop].splice !== 'undefined') {\n if (reference[prop].length > 0) {\n if (model[prop].length > 0) {\n // TODO needs sorting?\n var j = 0;\n for (i = 0; i < model[prop].length; i++) {\n if (typeof model[prop][i].type == 'string') {\n while (j < reference[prop].length && reference[prop][j].type !== model[prop][i].type) {\n console.log(\"ignoring \", prefix, reference[prop][j].type, \" block type in reference not found in model\");\n j++;\n }\n if (j >= reference[prop].length) {\n console.log(\"WARN cannot find \", prefix, model[prop][i].type, \" block in reference\");\n valid = Math.max(valid, 2);\n break;\n }\n // reverse condition so to skip \"deep traversing\" on error\n valid = Math.max(valid, checkModel(reference[prop][j], undefined, model[prop][i], prefix + \"[\" + i + \".\" + model[prop][i].type + \"]\"));\n }\n }\n } else {\n // in the case of different array we check blockDefs\n for (i = 0; i < reference[prop].length; i++) {\n if (typeof reference[prop][i].type !== 'string') {\n console.log(\"TODO found an object with no type\", prefix, reference[prop][i]);\n valid = Math.max(valid, 2);\n } else if (!blockDefsObj.hasOwnProperty(reference[prop][i].type)) {\n console.warn(\"TODO the model uses a block type not defined by the template. REMOVING IT!!\", prefix, reference[prop][i]);\n reference[prop].splice(i, 1);\n i--;\n valid = Math.max(valid, 2);\n } else {\n valid = Math.max(valid, checkModel(blockDefsObj[reference[prop][i].type], blockDefsObj, reference[prop][i], prefix + \"[\" + i + \".\" + reference[prop][i].type + \"]\"));\n }\n }\n }\n }\n } else {\n if (model[prop] === null) {\n if (reverse) {\n console.log(\"WARN Null object in model \", prefix, \"instead of\", reference[prop], \"deleting it\");\n valid = Math.max(valid, 2);\n delete reference[prop];\n } else {\n console.log(\"INFO Null object in model \", prefix, \"instead of\", reference[prop], \"cloning it from the reference\");\n valid = Math.max(valid, 1);\n model[prop] = reference[prop];\n }\n } else {\n valid = Math.max(valid, checkModel(reference[prop], blockDefsObj, model[prop], prefix, reverse));\n }\n }\n } else if (model[prop] !== null) {\n console.log(\"TODO Null in reference but not null in model\", prefix, model[prop]);\n valid = Math.max(valid, 2);\n }\n } else if (typeof reference[prop] !== 'string' && typeof reference[prop] !== 'boolean' && typeof reference[prop] !== 'number') {\n console.log(\"TODO unsupported type\", prefix, typeof reference[prop]);\n valid = Math.max(valid, 2);\n }\n\n }\n if (!reverse) valid = Math.max(valid, checkModel(model, blockDefs, reference, typeof origPrefix !== 'undefined' ? origPrefix + \"!R\" : \"!R\", true));\n return valid;\n};\n\nmodule.exports = checkModel;",
|
|
128
|
+
"\"use strict\";\n\n// Parses CSS declarations and supports the property language (-ko-*) found between them.\n// Create KO bindings but doesn't depend on KO.\n// Needs a bindingProvider.\n\nvar converterUtils = require(\"./utils.js\");\nvar cssParse = require(\"mensch/lib/parser.js\");\nvar console = require(\"console\");\nvar domutils = require(\"./domutils.js\");\n\nvar _declarationValueLookup = function(declarations, propertyname, templateUrlConverter) {\n for (var i = declarations.length - 1; i >= 0; i--) {\n if (declarations[i].type == 'property' && declarations[i].name == propertyname) {\n return _declarationValueUrlPrefixer(declarations[i].value, templateUrlConverter);\n }\n }\n return null;\n};\n\nvar _propToCamelCase = function(propName) {\n return propName.replace(/-([a-z])/g, function(match, contents, offset, s) {\n return contents.toUpperCase();\n });\n};\n\nvar _declarationValueUrlPrefixer = function(value, templateUrlConverter) {\n if (value.match(/url\\(.*\\)/)) {\n var replaced = value.replace(/(url\\()([^\\)]*)(\\))/g, function(matched, prefix, url, postfix) {\n var trimmed = url.trim();\n var apice = url.trim().charAt(0);\n if (apice == '\\'' || apice == '\"') {\n trimmed = trimmed.substr(1, trimmed.length - 2);\n } else {\n apice = '';\n }\n var newUrl = templateUrlConverter(trimmed);\n if (newUrl !== null) {\n return prefix + apice + newUrl + apice + postfix;\n } else {\n return matched;\n }\n });\n return replaced;\n } else {\n return value;\n }\n};\n\nvar elaborateDeclarations = function(style, declarations, templateUrlConverter, bindingProvider, element, basicBindings, removeDisplayNone) {\n var newBindings = typeof basicBindings == 'object' && basicBindings !== null ? basicBindings : {};\n var newStyle = null;\n var skipLines = 0;\n if (typeof declarations == 'undefined') {\n var styleSheet = cssParse(\"#{\\n\" + style + \"}\", {\n comments: true,\n position: true\n });\n declarations = styleSheet.stylesheet.rules[0].declarations;\n skipLines = 1;\n }\n for (var i = declarations.length - 1; i >= 0; i--)\n if (declarations[i].type == 'property') {\n if (removeDisplayNone === true && declarations[i].name == 'display' && declarations[i].value == 'none') {\n if (newStyle === null) newStyle = style;\n newStyle = converterUtils.removeStyle(newStyle, declarations[i].position.start, declarations[i].position.end, skipLines, 0, 0, '');\n } else {\n var decl = declarations[i].name.match(/^-ko-(bind-|attr-)?([a-z0-9-]*?)(-if|-ifnot)?$/);\n if (decl !== null) {\n // rimozione dello stile -ko- dall'attributo style.\n if (newStyle === null && typeof style != 'undefined') newStyle = style;\n\n var isAttr = decl[1] == 'attr-';\n var isBind = decl[1] == 'bind-';\n var propName = decl[2];\n\n var isIf = decl[3] == '-if' || decl[3] == '-ifnot';\n var condDecl;\n var bindValue;\n var propDefaultValue;\n\n if (isIf) {\n condDecl = declarations[i].name.substr(0, declarations[i].name.length - decl[3].length);\n var conditionedDeclaration = _declarationValueLookup(declarations, condDecl, templateUrlConverter);\n if (conditionedDeclaration === null) throw \"Unable to find declaration \" + condDecl + \" for \" + declarations[i].name;\n } else {\n\n if ((isAttr || isBind) && (typeof element == 'undefined' && typeof style != 'undefined')) throw \"Attributes and bind declarations are only allowed in inline styles!\";\n\n var needDefaultValue = true;\n var bindType;\n if (isAttr) {\n propDefaultValue = domutils.getAttribute(element, propName);\n needDefaultValue = false;\n bindType = 'virtualAttr';\n } else if (!isBind) {\n needDefaultValue = typeof style !== 'undefined';\n if (needDefaultValue) propDefaultValue = _declarationValueLookup(declarations, propName, templateUrlConverter);\n bindType = 'virtualStyle';\n } else {\n bindType = null;\n if (propName == 'text') {\n if (typeof element !== 'undefined') {\n propDefaultValue = domutils.getInnerText(element);\n } else {\n needDefaultValue = false;\n }\n } else if (propName == 'html') {\n if (typeof element !== 'undefined') {\n propDefaultValue = domutils.getInnerHtml(element);\n } else {\n needDefaultValue = false;\n }\n } else {\n needDefaultValue = false;\n }\n }\n\n if (needDefaultValue && propDefaultValue === null) {\n console.error(\"Cannot find default value for\", declarations[i].name, declarations);\n throw \"Cannot find default value for \" + declarations[i].name + \": \" + declarations[i].value + \" in \" + element + \" (\" + typeof style + \"/\" + propName + \")\";\n }\n var bindDefaultValue = propDefaultValue;\n\n var bindName = _propToCamelCase(propName);\n\n try {\n bindValue = converterUtils.expressionBinding(declarations[i].value, bindingProvider, bindDefaultValue);\n } catch (e) {\n console.error(\"Model ensure path failed\", e.stack, \"name\", declarations[i].name, \"value\", declarations[i].value, \"default\", propDefaultValue, \"element\", element);\n throw e;\n }\n\n if (bindType !== null && typeof newBindings[bindType] == 'undefined') newBindings[bindType] = {};\n\n\n // Special handling for HREFs\n if (bindType == 'virtualAttr' && bindName == 'href') {\n bindType = null;\n bindName = 'wysiwygHref';\n // We have to remove it, otherwise we ends up with 2 rules writing it.\n if (typeof element != 'undefined' && element !== null) {\n domutils.removeAttribute(element, \"href\");\n }\n }\n\n // TODO evaluate the use of \"-then\" (and -else) postfixes to complete the -if instead of relaying\n // on the same basic sintax (or maybe it is better to support ternary operator COND ? THEN : ELSE).\n var declarationCondition = _declarationValueLookup(declarations, declarations[i].name + '-if', templateUrlConverter);\n var not = false;\n if (declarationCondition === null) {\n declarationCondition = _declarationValueLookup(declarations, declarations[i].name + '-ifnot', templateUrlConverter);\n not = true;\n } else {\n if (_declarationValueLookup(declarations, declarations[i].name + '-ifnot', templateUrlConverter) !== null) {\n throw \"Unexpected error: cannot use both -if and -ifnot property conditions\";\n }\n }\n if (declarationCondition !== null) {\n try {\n var bindingCond = converterUtils.conditionBinding(declarationCondition, bindingProvider);\n bindValue = (not ? '!' : '') + \"(\" + bindingCond + \") ? \" + bindValue + \" : null\";\n } catch (e) {\n console.error(\"Unable to deal with -ko style binding condition\", declarationCondition, declarations[i].name);\n throw e;\n }\n }\n\n if (bindType !== null) newBindings[bindType][bindName] = bindValue;\n else newBindings[bindName] = bindValue;\n }\n\n // parsing @supports :preview\n if (newStyle !== null) {\n\n try {\n // if \"element\" is defined then we are parsing an \"inline\" style and we want to remove it.\n if (typeof element != 'undefined' && element !== null) {\n newStyle = converterUtils.removeStyle(newStyle, declarations[i].position.start, declarations[i].position.end, skipLines, 0, 0, '');\n } else {\n // otherwise we are parsing a full stylesheet.. let's rewrite the full \"prop: value\" without caring about the original syntax.\n var replacedWith = '';\n // if it is an \"if\" we simply have to remove it, otherwise we replace the input code with \"prop: value\" generating expression.\n if (!isIf) replacedWith = propName + ': <!-- ko text: ' + bindValue + ' -->' + propDefaultValue + '<!-- /ko -->';\n newStyle = converterUtils.removeStyle(newStyle, declarations[i].position.start, declarations[i].position.end, skipLines, 0, 0, replacedWith);\n }\n } catch (e) {\n console.warn(\"Remove style failed\", e, \"name\", declarations[i]);\n throw e;\n }\n\n }\n\n } else {\n // prefixing urls\n var replacedValue = _declarationValueUrlPrefixer(declarations[i].value, templateUrlConverter);\n if (replacedValue != declarations[i].value) {\n if (newStyle === null && typeof style !== 'undefined') newStyle = style;\n if (newStyle !== null) {\n try {\n newStyle = converterUtils.removeStyle(newStyle, declarations[i].position.start, declarations[i].position.end, skipLines, 0, 0, declarations[i].name + \": \" + replacedValue);\n } catch (e) {\n console.log(\"Remove style failed replacing url\", e, \"name\", declarations[i]);\n throw e;\n }\n }\n }\n\n // Style handling by concatenated \"style attribute\" (worse performance but more stable than direct style handling)\n var bindName2 = _propToCamelCase(declarations[i].name);\n var bind = 'virtualAttrStyle';\n var bindVal2 = typeof newBindings['virtualStyle'] !== 'undefined' ? newBindings['virtualStyle'][bindName2] : undefined;\n\n var dist = ' ';\n if (typeof newBindings[bind] == 'undefined') {\n newBindings[bind] = \"''\";\n dist = '';\n }\n\n if (typeof bindVal2 !== 'undefined') {\n newBindings[bind] = \"'\" + declarations[i].name + \": '+(\" + bindVal2 + \")+';\" + dist + \"'+\" + newBindings[bind];\n delete newBindings['virtualStyle'][bindName2];\n } else {\n newBindings[bind] = \"'\" + declarations[i].name + \": \" + converterUtils.addSlashes(replacedValue) + \";\" + dist + \"'+\" + newBindings[bind];\n }\n\n }\n }\n }\n\n if (typeof element != 'undefined' && element !== null) {\n for (var prop in newBindings['virtualStyle'])\n if (newBindings['virtualStyle'].hasOwnProperty(prop)) {\n console.log(\"Unexpected virtualStyle binding after conversion to virtualAttr.style\", prop, newBindings['virtualStyle'][prop], style);\n throw \"Unexpected virtualStyle binding after conversion to virtualAttr.style for \" + prop;\n }\n delete newBindings['virtualStyle'];\n\n var currentBindings = domutils.getAttribute(element, 'data-bind');\n var dataBind = (currentBindings !== null ? currentBindings + \", \" : \"\") + _bindingSerializer(newBindings);\n domutils.setAttribute(element, 'data-bind', dataBind);\n }\n\n // TODO a function whose return type depends on the input parameters is very ugly.. please FIX ME.\n if (typeof style == 'undefined') {\n // clean virtualStyle if empty\n var hasVirtualStyle = false;\n for (var prop1 in newBindings['virtualStyle'])\n if (newBindings['virtualStyle'].hasOwnProperty(prop1)) {\n hasVirtualStyle = true;\n break;\n }\n if (!hasVirtualStyle) delete newBindings['virtualStyle'];\n else {\n // remove and add back virtualAttrStyle so it gets appended BEFORE virtualAttrStyle (_bindingSerializer reverse them...)\n if (typeof newBindings['virtualAttrStyle'] !== 'undefined') {\n var vs = newBindings['virtualAttrStyle'];\n delete newBindings['virtualAttrStyle'];\n newBindings['virtualAttrStyle'] = vs;\n }\n }\n // returns new serialized bindings\n return _bindingSerializer(newBindings);\n }\n\n return newStyle;\n};\n\nvar _bindingSerializer = function(val) {\n var res = [];\n for (var prop in val)\n if (val.hasOwnProperty(prop)) {\n if (typeof val[prop] == 'object') res.push(prop + \": \" + \"{ \" + _bindingSerializer(val[prop]) + \" }\");\n else res.push(prop + \": \" + val[prop]);\n }\n return res.reverse().join(', ');\n};\n\nmodule.exports = elaborateDeclarations;",
|
|
129
|
+
"\"use strict\";\n\n// This deals with Cheerio/jQuery issues.\n// Most of this could be done without jQuery, too, but jQuery is easier to be mocked with Cheerio\n// Otherwise we would need jsDom to run the compiler in the server (without a real browser)\n\nvar $ = require(\"jquery\");\n\nfunction _extend(target, source) {\n if (source) {\n for (var prop in source) {\n if (source.hasOwnProperty(prop)) {\n target[prop] = source[prop];\n }\n }\n }\n return target;\n}\n\nvar objExtend = function(obj, extender) {\n if (typeof $.extend == 'function') {\n return $.extend(true, obj, extender);\n } else {\n return _extend(obj, JSON.parse(JSON.stringify(extender)));\n }\n};\n\nvar getAttribute = function(element, attribute) {\n var res = $(element).attr(attribute);\n if (typeof res == 'undefined') res = null;\n return res;\n // return element.getAttribute(attribute);\n};\n\nvar setAttribute = function(element, attribute, value) {\n $(element).attr(attribute, value);\n // element.setAttribute(attribute, value);\n};\n\nvar removeAttribute = function(element, attribute) {\n $(element).removeAttr(attribute);\n // element.removeAttribute(attribute);\n};\n\nvar getInnerText = function(element) {\n return $(element).text();\n // if (typeof element.innerText != 'undefined') return element.innerText;\n // else return element.textContent;\n};\n\nvar getInnerHtml = function(element) {\n return $(element).html();\n // return element.innerHTML;\n};\n\nvar getLowerTagName = function(element) {\n // sometimes cheerio doesn't have tagName but \"name\".\n // Browsers have \"name\" with empty string\n // Sometimes cheerio has tagName but no prop function.\n if (element.tagName === '' && typeof element.name == 'string') return element.name.toLowerCase();\n if (element.tagName !== '') return element.tagName.toLowerCase();\n return $(element).prop(\"tagName\").toLowerCase();\n // return element.tagName.toLowerCase();\n};\n\nvar setContent = function(element, content) {\n $(element).html(content);\n // element.innerHTML = content;\n};\n\nvar replaceHtml = function(element, html) {\n $(element).replaceWith(html);\n // element.outerHTML = html;\n};\n\nvar removeElements = function($elements, tryDetach) {\n if (tryDetach && typeof $elements.detach !== 'undefined') $elements.detach();\n // NOTE: we don't need an else, as detach is simply an optimization\n $elements.remove();\n};\n\nmodule.exports = {\n getAttribute: getAttribute,\n setAttribute: setAttribute,\n removeAttribute: removeAttribute,\n getInnerText: getInnerText,\n getInnerHtml: getInnerHtml,\n getLowerTagName: getLowerTagName,\n setContent: setContent,\n replaceHtml: replaceHtml,\n removeElements: removeElements,\n objExtend: objExtend\n};",
|
|
130
|
+
"\"use strict\";\n\nvar console = require(\"console\");\nvar elaborateDeclarations = require(\"./declarations.js\");\nvar utils = require('./utils.js');\nvar modelDef = require('./model.js');\n\nvar _getOptionsObject = function(options) {\n var optionsCouples = options.split('|');\n var opts = {};\n for (var i = 0; i < optionsCouples.length; i++) {\n var opt = optionsCouples[i].split('=');\n opts[opt[0]] = opt.length > 1 ? opt[1] : opt[0];\n }\n return opts;\n};\n\n// TODO this should not have hardcoded rules (we now have a way to declare them in the template definition)\n// Category \"style\" is used by editType \"styler\"\n// Cateogry \"content\" is used by editType \"edit\"\n// TODO maybe we should use a common string here, and rely only on the original category.\nvar _filterProps = function(model, editType, level) {\n var res = [];\n for (var prop in model)\n if (!prop.match(/^customStyle$/) && !prop.match(/^_/) && model.hasOwnProperty(prop)) {\n var isStyleProp = model[prop] !== null && typeof model[prop]._category != 'undefined' && model[prop]._category == 'style';\n if (prop == 'id' || prop == 'type' || prop.match(/Blocks$/)) {} else if (editType == 'styler') {\n if (isStyleProp || level > 0) res.push(prop);\n } else if (editType == 'edit') {\n // Editing for properties in the \"content\" category but not defined in the context of a block\n var isContentProp = model[prop] !== null && typeof model[prop]._category != 'undefined' && model[prop]._category == 'content' &&\n (typeof model[prop]._context == 'undefined' || model[prop]._context != 'block');\n if (isContentProp) res.push(prop);\n } else if (typeof editType == 'undefined') {\n res.push(prop);\n }\n }\n return res;\n};\n\nvar _propInput = function(model, prop, propAccessor, editType, widgets) {\n var html = \"\";\n var widget;\n if (model !== null && typeof model._widget != 'undefined') widget = model._widget;\n\n if (typeof widget == 'undefined') {\n throw \"Unknown data type for \" + prop;\n }\n\n // For content editors we deal with focusing (clicking is handled by the container DIV).\n var onfocusbinding = 'focusable: true';\n if (editType == 'edit') {\n onfocusbinding += ', event: { focus: function(ui, event) { $($element).click(); } } ';\n }\n\n html += '<label class=\"data-' + widget + '\"' + (widget == 'boolean' ? ' data-bind=\"event: { mousedown: function(ui, evt) { if (evt.button == 0) { var input = $($element).find(\\'input\\'); var ch = input.prop(\\'checked\\'); setTimeout(function() { input.click(); input.prop(\\'checked\\', !ch); input.trigger(\\'change\\'); }, 0); } } }, click: function(ui, evt) { evt.preventDefault(); }, clickBubble: false\"' : '') + '>';\n\n if (typeof widgets !== 'undefined' && typeof widgets[widget] !== 'undefined') {\n var w = widgets[widget];\n var parameters = {};\n if (typeof w.parameters !== 'undefined')\n for (var p in w.parameters)\n if (w.parameters.hasOwnProperty(p) && typeof model['_'+p] !== 'undefined')\n parameters[p] = model['_'+p];\n html += w.html(propAccessor, onfocusbinding, parameters);\n } else if (widget == 'boolean') {\n html += '<input type=\"checkbox\" value=\"nothing\" data-bind=\"checked: ' + propAccessor + ', ' + onfocusbinding + '\" />';\n html += '<span class=\"checkbox-replacer\" ></span>'; /* data-bind=\"css: { checked: '+propAccessor+' }\" */\n } else if (widget == 'color') {\n html += '<input size=\"7\" type=\"text\" data-bind=\"colorpicker: { color: ' + propAccessor + ', strings: $root.t(\\'Theme Colors,Standard Colors,Web Colors,Theme Colors,Back to Palette,History,No history yet.\\') }, ' + ', ' + onfocusbinding + '\" />';\n } else if (widget == 'select') {\n if (typeof model._options != 'undefined') {\n var opts = _getOptionsObject(model._options);\n // var opts = model._options;\n html += '<select data-bind=\"value: ' + propAccessor + ', ' + onfocusbinding + '\">';\n for (var opt in opts)\n if (opts.hasOwnProperty(opt)) {\n html += '<option value=\"' + opt + '\" data-bind=\"text: $root.ut(\\'template\\', \\'' + utils.addSlashes(opts[opt]) + '\\')\">' + opts[opt] + '</option>';\n }\n html += '</select>';\n }\n } else if (widget == 'font') {\n html += '<select type=\"text\" data-bind=\"value: ' + propAccessor + ', ' + onfocusbinding + '\">';\n html += '<optgroup label=\"Sans-Serif Fonts\">';\n html += '<option value=\"Arial,Helvetica,sans-serif\">Arial</option>';\n html += '<option value=\"\\'Comic Sans MS\\',cursive,sans-serif\">Comic Sans MS</option>';\n html += '<option value=\"Impact,Charcoal,sans-serif\">Impact</option>';\n html += '<option value=\"\\'Trebuchet MS\\',Helvetica,sans-serif\">Trebuchet MS</option>';\n html += '<option value=\"Verdana,Geneva,sans-serif\">Verdana</option>';\n html += '</optgroup>';\n html += '<optgroup label=\"Serif Fonts\">';\n html += '<option value=\"Georgia,serif\">Georgia</option>';\n html += '<option value=\"\\'Times New Roman\\',Times,serif\">Times New Roman</option>';\n html += '</optgroup>';\n html += '<optgroup label=\"Monospace Fonts\">';\n html += '<option value=\"\\'Courier New\\',Courier,monospace\">Courier New</option>';\n html += '</optgroup>';\n html += '</select>';\n } else if (widget == 'url') {\n html += '<div class=\"ui-textbutton\">';\n // <a class=\"ui-spinner-button ui-spinner-down ui-corner-br ui-button ui-widget ui-state-default ui-button-text-only\" tabindex=\"-1\" role=\"button\"><span class=\"ui-button-text\"><span class=\"ui-icon fa fa-fw caret-down\">▼</span></span></a>\n html += '<input class=\"ui-textbutton-input\" size=\"7\" type=\"url\" pattern=\"(mailto:.+@.+|https?://.+\\\\..+|\\\\[.*\\\\].*)\" value=\"nothing\" data-bind=\"css: { withButton: typeof $root.linkDialog !== \\'undefined\\' }, validatedValue: ' + propAccessor + ', ' + onfocusbinding + '\" />';\n html += '<a class=\"ui-textbutton-button\" data-bind=\"visible: typeof $root.linkDialog !== \\'undefined\\', click: typeof $root.linkDialog !== \\'undefined\\' ? $root.linkDialog.bind($element.previousSibling) : false, button: { icons: { primary: \\'fa fa-fw fa-ellipsis-h\\' }, label: \\'Opzioni\\', text: false }\">Opzioni</a>';\n html += '</div>';\n } else if (widget == 'integer') {\n // at this time the \"step\" depends on max being greater than 100.\n // maybe we should expose \"step\" as a configuration, too\n var min = 0;\n var max = 1000;\n if (model !== null && typeof model._max !== 'undefined') max = model._max;\n if (model !== null && typeof model._min !== 'undefined') min = model._min;\n var step = (max - min) >= 100 ? 10 : 1;\n var page = step * 5;\n html += '<input class=\"number-spinner\" size=\"7\" step=\"' + step + '\" type=\"number\" value=\"-1\" data-bind=\"spinner: { min: ' + min + ', max: ' + max + ', page: ' + page + ', value: ' + propAccessor + ' }, valueUpdate: [\\'change\\', \\'spin\\']' + ', ' + onfocusbinding + '\" />';\n } else {\n html += '<input size=\"7\" type=\"text\" value=\"nothing\" data-bind=\"value: ' + propAccessor + ', ' + onfocusbinding + '\" />';\n }\n\n html += '</label>';\n\n return html;\n};\n\nvar _getGlobalStyleProp = function(globalStyles, model, prop, path) {\n var globalStyleProp;\n if (typeof model !== 'object' || model === null || typeof model._widget !== 'undefined') {\n if (typeof prop !== 'undefined' && typeof path !== 'undefined' && path.length > 0 && typeof globalStyles == 'object' && typeof globalStyles[path] != 'undefined') {\n globalStyleProp = globalStyles[path];\n }\n }\n return globalStyleProp;\n};\n\nvar _propEditor = function(withBindingProvider, widgets, templateUrlConverter, model, themeModel, path, prop, editType, level, baseThreshold, globalStyles, globalStyleProp, trackUsage, rootPreviewBinding, previewBackground) {\n if (typeof level == 'undefined') level = 0;\n\n if (typeof prop !== 'undefined' && typeof model == 'object' && model !== null && typeof model._usecount === 'undefined') {\n console.log(\"TODO EDITOR ignoring\", path, \"property because it is not used by the template\", \"prop:\", prop, \"type:\", editType, \"level:\", level, withBindingProvider._templateName);\n return \"\";\n }\n\n var propAccessor = typeof globalStyleProp != 'undefined' ? prop + '._defaultComputed' : prop;\n\n var html = \"\";\n var title;\n var ifSubsProp = propAccessor;\n var ifSubsGutter = 1;\n // typeof globalStyleProp != 'undefined' ? 1 : 2;\n var ifSubsThreshold = 1;\n\n // The visibility handling is a PITA\n // \n // Here are some \"edge cases\" to test whenever we change something here:\n // LM social footer: removing shareVisibile must be reflected in the booleans sub-checks\n // FLUID social block: multiple clicks on the \"wand\" should not make the editor invisible\n // BIS heroMenu - By changing the menu visibility it should be reflected in style editors for the menu links\n // FLUID almost every block with a color variant sometimes keeps showing style editor for the hidden variant.\n if (typeof model == 'object' && model !== null && typeof model._widget == 'undefined') {\n // Do nothing here\n } else {\n if (typeof globalStyleProp == 'undefined') {\n ifSubsGutter += 1;\n }\n }\n\n // NOTE baseThreshold is added only when globalStyle is not defined because when we have globalStyle\n // we're going to bind the computed values and not the original and this way we don't add ourserf to the dependency \n // tracking (subscriptionCount)\n // NOTE baseThreshold is an \"expression\" and not a fixed number, so this is a concatenation\n if (typeof globalStyleProp == 'undefined' && typeof baseThreshold !== 'undefined') ifSubsThreshold += baseThreshold;\n\n if (typeof prop != 'undefined' && !!trackUsage) {\n html += '<!-- ko ifSubs: { data: ' + ifSubsProp + ', threshold: ' + ifSubsThreshold + ', gutter: ' + ifSubsGutter + ' } -->';\n }\n\n if (typeof prop != 'undefined' && (model === null || typeof model._name == 'undefined')) {\n // TODO throw exception?\n console.log(\"TODO WARN Missing label for property \", prop);\n }\n if (typeof prop == 'undefined' && model !== null && typeof model._name == 'undefined') {\n console.log(\"TODO WARN Missing label for object \", model.type /*, model */ );\n }\n\n if (typeof model == 'object' && model !== null && typeof model._widget == 'undefined') {\n var props = _filterProps(model, editType, level);\n\n var hasCustomStyle = editType == 'styler' && model !== null && typeof model.customStyle !== 'undefined' && typeof globalStyleProp !== 'undefined';\n var selectedItemBinding = '';\n var additionalClasses = '';\n if (typeof prop !== 'undefined' && editType == 'edit') {\n selectedItemBinding = ', click: function(obj, evt) { $root.selectItem(' + prop + ', $data); return false }, clickBubble: false, css: { selecteditem: $root.isSelectedItem(' + prop + ') }, scrollIntoView: $root.isSelectedItem(' + prop + '), ';\n additionalClasses += ' selectable';\n }\n if (hasCustomStyle) {\n additionalClasses += ' supportsCustomStyles';\n }\n html += '<div class=\"objEdit level' + level + additionalClasses + '\" data-bind=\"tooltips: {}' + selectedItemBinding + '\">';\n var modelName = (model !== null && typeof model._name != 'undefined' ? model._name : (typeof prop !== 'undefined' ? '[' + prop + ']' : ''));\n if (hasCustomStyle) {\n var themeSectionName = 'Stile';\n if (typeof themeModel !== 'undefined' && themeModel !== null && typeof themeModel._name !== 'undefined') {\n themeSectionName = themeModel._name;\n } else {\n console.log(\"TODO missing label for theme section \", prop, model !== null ? model.type : '-');\n }\n\n modelName = '<span class=\"blockSelectionMethod\" data-bind=\"text: customStyle() ? $root.ut(\\'template\\', \\'' + utils.addSlashes(modelName) + '\\') : $root.ut(\\'template\\', \\'' + utils.addSlashes(themeSectionName) + '\\')\">Block</span>';\n } else {\n modelName = '<span data-bind=\"text: $root.ut(\\'template\\', \\'' + utils.addSlashes(modelName) + '\\')\">' + modelName + '</span>';\n }\n title = model !== null && typeof model._help !== 'undefined' ? ' title=\"' + utils.addSlashes(model._help) + '\" data-bind=\"attr: { title: $root.ut(\\'template\\', \\'' + utils.addSlashes(model._help) + '\\') }\"' : '';\n html += '<span' + title + ' class=\"objLabel level' + level + '\">' + modelName + '</span>';\n\n if (editType == 'edit' && typeof model._blockDescription !== 'undefined') {\n html += '<div class=\"blockDescription\" data-bind=\"html: $root.ut(\\'template\\', \\'' + utils.addSlashes(model._blockDescription) + '\\')\">' + model._blockDescription + '</div>';\n }\n\n /* CUSTOM STYLE */\n if (hasCustomStyle) {\n html += '<label class=\"data-boolean blockCheck\" data-bind=\"tooltips: { }\">';\n html += '<input type=\"checkbox\" value=\"nothing\" data-bind=\"focusable: true, checked: customStyle\" />';\n html += '<span title=\"Switch between global and block level styles editing\" data-bind=\"attr: { title: $root.t(\\'Switch between global and block level styles editing\\') }\" class=\"checkbox-replacer checkbox-replacer-onoff\"></span>'; // data-bind=\"tooltip: { content: \\'personalizza tutti\\' }\"\n html += '</label>';\n html += '<!-- ko template: { name: \\'customstyle\\', if: customStyle } --><!-- /ko -->';\n }\n\n if (typeof prop != 'undefined') {\n html += '<!-- ko with: ' + prop + ' -->';\n\n /* PREVIEW */\n if (level == 1 && typeof prop != 'undefined') {\n if (typeof model._previewBindings != 'undefined' && typeof withBindingProvider != 'undefined') {\n if (typeof rootPreviewBinding != 'undefined') html += '<!-- ko with: $root.content() --><div class=\"objPreview\" data-bind=\"' + rootPreviewBinding + '\"></div><!-- /ko -->';\n if (typeof previewBackground != 'undefined') html += '<!-- ko with: $parent --><div class=\"objPreview\" data-bind=\"' + previewBackground + '\"></div><!-- /ko -->';\n var previewBindings = elaborateDeclarations(undefined, model._previewBindings, templateUrlConverter, withBindingProvider.bind(this, path + '.'));\n html += '<div class=\"objPreview\"><div class=\"objPreviewInner\" data-bind=\"' + previewBindings + '\"></div></div>';\n }\n }\n }\n\n /* PREVIEW */\n var previewBG;\n if (level === 0) {\n if (typeof model._previewBindings != 'undefined') {\n previewBG = elaborateDeclarations(undefined, model._previewBindings, templateUrlConverter, withBindingProvider.bind(this, path.length > 0 ? path + '.' : ''));\n }\n }\n\n var i, newPath;\n\n var before = html.length;\n\n var newThemeModel;\n var newGlobalStyleProp;\n\n for (i = 0; i < props.length; i++) {\n newPath = path.length > 0 ? path + \".\" + props[i] : props[i];\n if (typeof model[props[i]] != 'object' || model[props[i]] === null || typeof model[props[i]]._widget != 'undefined') {\n newGlobalStyleProp = undefined;\n if (level === 0 && props[i] == 'theme')\n html += _propEditor(withBindingProvider, widgets, templateUrlConverter, model[props[i]], newThemeModel, newPath, props[i], editType, 0, baseThreshold, undefined, undefined, trackUsage, rootPreviewBinding);\n else {\n newGlobalStyleProp = _getGlobalStyleProp(globalStyles, model[props[i]], props[i], newPath);\n html += _propEditor(withBindingProvider, widgets, templateUrlConverter, model[props[i]], newThemeModel, newPath, props[i], editType, level + 1, baseThreshold, globalStyles, newGlobalStyleProp, trackUsage, rootPreviewBinding, previewBG);\n }\n }\n }\n for (i = 0; i < props.length; i++) {\n newPath = path.length > 0 ? path + \".\" + props[i] : props[i];\n if (!(typeof model[props[i]] != 'object' || model[props[i]] === null || typeof model[props[i]]._widget != 'undefined')) {\n newGlobalStyleProp = undefined;\n if (level === 0 && props[i] == 'theme')\n html += _propEditor(withBindingProvider, widgets, templateUrlConverter, model[props[i]], newThemeModel, newPath, props[i], editType, 0, baseThreshold, undefined, undefined, trackUsage, rootPreviewBinding);\n else {\n newGlobalStyleProp = _getGlobalStyleProp(globalStyles, model[props[i]], props[i], newPath);\n html += _propEditor(withBindingProvider, widgets, templateUrlConverter, model[props[i]], newThemeModel, newPath, props[i], editType, level + 1, baseThreshold, globalStyles, newGlobalStyleProp, trackUsage, rootPreviewBinding, previewBG);\n }\n }\n }\n\n var added = html.length - before;\n if (added === 0) {\n // No editable content: if this is in context \"template\" we leave it empty, otherwise we show an help.\n if (typeof model == 'object' && model !== null && model._context == 'template') {\n return '';\n } else {\n // TODO move me to a tmpl?\n html += '<div class=\"objEmpty\" data-bind=\"html: $root.t(\\'Selected element has no editable properties\\')\">Selected element has no editable properties</div>';\n }\n }\n\n if (typeof prop != 'undefined') {\n html += '<!-- /ko -->';\n }\n html += '</div>';\n\n } else {\n var checkboxes = true;\n\n if (typeof globalStyles == 'undefined') checkboxes = false;\n\n if (model === null || typeof model != 'object' || typeof model._widget != 'undefined') {\n var bindings = [];\n\n if (typeof globalStyleProp != 'undefined') bindings.push('css: { notnull: ' + prop + '() !== null }');\n title = model !== null && typeof model._help !== 'undefined' ? ' title=\"' + utils.addSlashes(model._help) + '\" data-bind=\"attr: { title: $root.ut(\\'template\\', \\'' + utils.addSlashes(model._help) + '\\') }\"' : '';\n if (title.length > 0) bindings.push('tooltips: {}');\n var bind = bindings.length > 0 ? 'data-bind=\"' + utils.addSlashes(bindings.join()) + '\"' : '';\n html += '<div class=\"propEditor ' + (checkboxes ? 'checkboxes' : '') + '\"' + bind + '>';\n\n var modelName2 = (model !== null && typeof model._name != 'undefined' ? model._name : (typeof prop !== 'undefined' ? '[' + prop + ']' : ''));\n modelName2 = '<span data-bind=\"text: $root.ut(\\'template\\', \\'' + utils.addSlashes(modelName2) + '\\')\">' + modelName2 + '</span>';\n html += '<span' + title + ' class=\"propLabel\">' + modelName2 + '</span>';\n html += '<div class=\"propInput ' + (typeof globalStyles != 'undefined' ? 'local' : '') + '\" data-bind=\"css: { default: ' + prop + '() === null }\">';\n html += _propInput(model, prop, propAccessor, editType, widgets);\n html += '</div>';\n if (typeof globalStyleProp != 'undefined') {\n html += '<div class=\"propInput global\" data-bind=\"css: { overridden: ' + prop + '() !== null }\">';\n html += _propInput(model, prop, globalStyleProp, editType, widgets);\n html += '</div>';\n\n if (checkboxes) {\n html += '<div class=\"propCheck\"><label data-bind=\"tooltips: {}\"><input type=\"checkbox\" data-bind=\"focusable: true, click: function(evt, obj) { $root.localGlobalSwitch(' + prop + ', ' + globalStyleProp + '); return true; }, checked: ' + prop + '() !== null\">';\n html += '<span class=\"checkbox-replacer\" data-bind=\"css: { checked: ' + prop + '() !== null }, attr: { title: $root.t(\\'This style is specific for this block: click here to remove the custom style and revert to the theme value\\') }\"></span>';\n html += '</label></div>';\n }\n }\n html += '</div>';\n } else if (model === null || typeof model != 'object') {\n // TODO remove debug output\n html += '<div class=\"propEditor unknown\">[A|' + prop + \"|\" + typeof model + ']</div>';\n } else {\n // TODO remove debug output\n html += '<div class=\"propEditor unknown\">[B|' + prop + \"|\" + typeof model + ']</div>';\n }\n\n\n }\n\n if (typeof prop != 'undefined' && !!trackUsage) {\n html += '<!-- /ko -->';\n html += '<!-- ko ifSubs: { not: true, data: ' + ifSubsProp + ', threshold: ' + ifSubsThreshold + ', gutter: 0 } -->';\n html += '<span class=\"label notused\">(' + prop + ')</span>';\n html += '<!-- /ko -->';\n }\n\n return html;\n};\n\n\nvar createBlockEditor = function(defs, widgets, themeUpdater, templateUrlConverter, rootModelName, templateName, editType, templateCreator, baseThreshold, trackGlobalStyles, trackUsage, fromLevel) {\n if (typeof trackUsage == 'undefined') trackUsage = true;\n var model = modelDef.getDef(defs, templateName);\n\n var rootModel = modelDef.getDef(defs, rootModelName);\n var rootPreviewBindings;\n if (typeof rootModel._previewBindings != 'undefined' && templateName != 'thaeme' && editType == 'styler') {\n rootPreviewBindings = elaborateDeclarations(undefined, rootModel._previewBindings, templateUrlConverter, modelDef.getBindValue.bind(undefined, defs, themeUpdater, rootModelName, rootModelName, ''));\n }\n\n var globalStyles = typeof trackGlobalStyles != 'undefined' && trackGlobalStyles ? defs[templateName]._globalStyles : undefined;\n var globalStyleProp = typeof trackGlobalStyles != 'undefined' && trackGlobalStyles ? defs[templateName]._globalStyle : undefined;\n\n\n var themeModel;\n if (typeof globalStyleProp !== 'undefined') {\n var mm = modelDef.getDef(defs, 'theme');\n // TODO remove deprecated $theme\n themeModel = mm[globalStyleProp.replace(/^(\\$theme|_theme_)\\./, '')];\n }\n\n\n var withBindingProvider = modelDef.getBindValue.bind(undefined, defs, themeUpdater, rootModelName, templateName);\n withBindingProvider._templateName = templateName;\n\n var html = '<div class=\"editor\">';\n html += \"<div class=\\\"blockType\" + (typeof globalStyles != 'undefined' ? \" withdefaults\" : \"\") + \"\\\">\" + model.type + \"</div>\";\n\n var editorContent = _propEditor(withBindingProvider, widgets, templateUrlConverter, model, themeModel, \"\", undefined, editType, fromLevel, baseThreshold, globalStyles, globalStyleProp, trackUsage, rootPreviewBindings);\n if (editorContent.length > 0) {\n html += editorContent;\n }\n\n html += '</div>';\n\n templateCreator(html, templateName, editType);\n};\n\nvar createBlockEditors = function(defs, widgets, themeUpdater, templateUrlConverter, rootModelName, templateName, templateCreator, baseThreshold) {\n createBlockEditor(defs, widgets, themeUpdater, templateUrlConverter, rootModelName, templateName, 'edit', templateCreator, baseThreshold);\n createBlockEditor(defs, widgets, themeUpdater, templateUrlConverter, rootModelName, templateName, 'styler', templateCreator, baseThreshold, true);\n};\n\nvar generateEditors = function(templateDef, widgets, templateUrlConverter, templateCreator, baseThreshold) {\n var defs = templateDef._defs;\n var templateName = templateDef.templateName;\n var blocks = templateDef._blocks;\n var idx;\n var blockDefs = [];\n for (idx = 0; idx < blocks.length; idx++) {\n if (typeof blocks[idx].container !== 'undefined') {\n blockDefs.push(modelDef.generateModel(defs, blocks[idx].block));\n }\n createBlockEditors(defs, widgets, undefined, templateUrlConverter, blocks[idx].root, blocks[idx].block, templateCreator, baseThreshold);\n }\n\n if (typeof defs['theme'] != 'undefined') createBlockEditor(defs, widgets, undefined, templateUrlConverter, templateName, 'theme', 'styler', templateCreator, undefined, false, false, -1);\n return blockDefs;\n};\n\nmodule.exports = generateEditors;\n",
|
|
131
|
+
"\"use strict\";\n/* global global: false */\n\nvar modelDef = require(\"./model.js\");\n\nvar wrappedResultModel = function(templateDef) {\n var defs = templateDef._defs;\n var templateName = templateDef.templateName;\n var finalModelContentDef = modelDef.getDef(defs, templateName);\n\n var finalModelContent = modelDef.generateResultModel(templateDef);\n\n var wrapper = require(\"./wrapper.js\");\n var res = wrapper(finalModelContent, finalModelContentDef, defs);\n\n return res;\n};\n\n// requires only when imported\nvar translateTemplate = function() {\n var tt = require('./parser.js');\n return tt.apply(tt, arguments);\n};\n\n// requires only when imported\nvar generateEditors = function() {\n var ge = require('./editor.js');\n return ge.apply(ge, arguments);\n};\n\nvar checkModel = function() {\n var cm = require('./checkmodel.js');\n return cm.apply(cm, arguments);\n};\n\nmodule.exports = {\n translateTemplate: translateTemplate,\n wrappedResultModel: wrappedResultModel,\n generateResultModel: modelDef.generateResultModel,\n generateEditors: generateEditors,\n checkModel: checkModel\n};",
|
|
132
|
+
"\"use strict\";\n\nvar objExtend = require(\"./domutils.js\").objExtend;\nvar console = require(\"console\");\n\nvar _valueSet = function(defs, model, prop, value) {\n var dotPos = prop.indexOf('.');\n if (dotPos == -1) {\n if (typeof model[prop] == 'undefined') {\n console.log(\"Undefined prop \" + prop + \" while setting value \" + value + \" in model._valueSet\");\n } else if (model[prop] === null) {\n if (typeof value == 'object' && value !== null && typeof value.push == 'undefined') console.log(\"nullpropobjectvalue\", prop, value);\n model[prop] = value;\n } else if (typeof model[prop] == 'object' && typeof model[prop].push == 'function') {\n var values;\n if (typeof value === 'string') {\n var valuesString = value.match(/^\\[(.*)\\]$/);\n if (valuesString !== null) {\n values = valuesString[1].split(',');\n } else {\n throw \"Unexpected default value for array property \" + prop + \": \" + value;\n }\n } else if (typeof value === 'object' && typeof value.push !== 'undefined') {\n values = value;\n } else {\n throw \"Unexpected default value for array property \" + prop + \": \" + value + \" typeof \" + (typeof value);\n }\n var res = [];\n for (var i = 0; i < values.length; i++) {\n if (values[i].substr(0, 1) == '@') {\n // TODO remove this legacy support (@), so we can remove \"defs\" from this function, too.\n res.push(_generateModel(defs, values[i].substr(1)));\n } else if (values[i].length > 0) {\n res.push(values[i]);\n }\n }\n model[prop] = res;\n } else if (typeof model[prop] == 'string' || typeof model[prop] == 'boolean') {\n // TODO does this still happen? Debug/test me.\n model[prop] = value;\n } else if (typeof model[prop] == 'object' && model[prop] !== null && typeof model[prop]._widget != 'undefined') {\n if (typeof value == 'object' && value !== null) console.log(\"objectvalue\", prop, model[prop]._widget, value);\n // _data is defined for primitive types\n model[prop] = value;\n } else {\n console.log(\"setting\", typeof model[prop], model[prop], prop, value);\n }\n } else {\n var propName = prop.substr(0, dotPos);\n _valueSet(defs, model[propName], prop.substr(dotPos + 1), value);\n }\n};\n\nvar _modelCreateOrUpdateBlockDef = function(defs, templateName, properties, namedProperties) {\n if (typeof defs[templateName] !== 'undefined' && defs[templateName]._initialized && !defs[templateName]._writeable) {\n console.log(\"_modelCreateOrUpdateBlockDef\", defs, templateName, properties, namedProperties);\n throw \"Trying to alter non writeable model: \" + templateName + \" / \" + properties;\n }\n\n if (typeof defs[templateName] == 'undefined') {\n defs[templateName] = {\n _writeable: true\n };\n // Fallback computation of \"category\" depending on the property name\n // TODO remove me: this should be always defined in the template definition, no need to hardcode this stuff.\n if (typeof namedProperties == 'undefined') namedProperties = {};\n if (typeof namedProperties.category == 'undefined' && typeof defs[templateName]._category == 'undefined') {\n if (templateName.match(/(^t|.T)heme$/) || templateName.match(/(^s|.S)tyle$/) || templateName.match(/(^c|.C)olor$/) || templateName.match(/(^r|.R)adius$/)) {\n namedProperties.category = 'style';\n } else {\n namedProperties.category = 'content';\n }\n }\n }\n\n\n if (typeof namedProperties !== 'undefined') {\n // TODO check if this is needed before the ending namedProperty \"loop\" or not.\n if (typeof namedProperties.name != 'undefined') defs[templateName]._name = namedProperties.name;\n\n if (typeof namedProperties.themeOverride != 'undefined') {\n defs[templateName]._themeOverride = namedProperties.themeOverride;\n }\n if (typeof namedProperties.globalStyle != 'undefined') {\n defs[templateName]._globalStyle = namedProperties.globalStyle;\n // TODO remove deprecated $theme\n var globalStyleSub = namedProperties.globalStyle.replace(/^(\\$theme|_theme_)\\./, '');\n var p = globalStyleSub.indexOf('.');\n var gs = p != -1 ? globalStyleSub.substr(0, p) : globalStyleSub;\n _modelCreateOrUpdateBlockDef(defs, 'theme', gs);\n\n if (typeof defs[templateName]._themeOverride === 'undefined' || !!defs[templateName]._themeOverride) {\n _modelCreateOrUpdateBlockDef(defs, templateName, \"customStyle=false\");\n }\n }\n if (typeof namedProperties.contextName !== 'undefined') {\n defs[templateName]._context = namedProperties.contextName;\n // TODO is it correct to fallback to \"bodyTheme\" for blocks not declaring a default theme?\n // Maybe it would be better to simply declare it as mandatory but leave the default configutation\n // to the template definition.\n if (namedProperties.contextName == 'block' && typeof defs[templateName]._globalStyle == 'undefined') {\n defs[templateName]._globalStyle = '_theme_.bodyTheme';\n _modelCreateOrUpdateBlockDef(defs, 'theme', 'bodyTheme');\n\n if (typeof defs[templateName]._themeOverride == 'undefined' || defs[templateName]._themeOverride) {\n _modelCreateOrUpdateBlockDef(defs, templateName, \"customStyle=false\");\n }\n }\n }\n if (typeof namedProperties.extend != 'undefined') defs[templateName].type = namedProperties.extend;\n }\n\n for (var np in namedProperties) if (namedProperties.hasOwnProperty(np) && typeof namedProperties[np] !== 'undefined' && ['name', 'extend', 'contextName', 'globalStyle','themeOverride'].indexOf(np) == -1) {\n defs[templateName]['_'+np] = namedProperties[np];\n }\n\n if (typeof properties != 'undefined' && properties.length > 0) {\n defs[templateName]._props = typeof defs[templateName]._props != 'undefined' && defs[templateName]._props.length > 0 ? defs[templateName]._props + \" \" + properties : properties;\n }\n};\n\n// remove the first \"sequence\" in a camelcased word (e.g: myCamelCase => camelCase).\nvar _removePrefix = function(str) {\n var res = str.match(/^[^A-Z]+([A-Z])(.*)$/);\n return res !== null ? res[1].toLowerCase() + res[2] : null;\n};\n\n// TODO defs is needed only because _valueSet needs it.. we should remove it downstream.\nvar _generateModelFromDef = function(modelDef, defs) {\n var res = {};\n\n for (var prop in modelDef)\n if (!prop.match(/^_.*/) && modelDef.hasOwnProperty(prop)) {\n var value = modelDef[prop];\n if (typeof value == 'object' && value !== null && typeof value._complex != 'undefined' && value._complex) {\n res[prop] = _generateModelFromDef(value, defs);\n } else if (prop == 'type') {\n res[prop] = value;\n } else if (typeof value == 'object') {\n // most times this will be overwritten by _valueSet\n res[prop] = null;\n // for customStyle this is set to null.\n } else {\n console.error(\"Unexpected model def\", prop, value, modelDef);\n throw \"Unexpected model def [\" + prop + \"]=\" + value;\n }\n }\n\n if (typeof modelDef._defaultValues != 'undefined') {\n var defaults = modelDef._defaultValues;\n for (var prop2 in defaults)\n if (defaults.hasOwnProperty(prop2)) {\n _valueSet(defs, res, prop2, defaults[prop2]);\n }\n }\n\n return res;\n};\n\nvar _generateModel = function(defs, name) {\n var modelDef = _getModelDef(defs, name, false, true);\n return _generateModelFromDef(modelDef, defs);\n};\n\nvar _getDef = function(defs, name) {\n return _getModelDef(defs, name, false, true);\n};\n\nvar _getModelDef = function(defs, name, returnClone, readonly) {\n // lookup \"name\" in the template definition\n if (typeof defs[name] == 'undefined') {\n // if the name has a space then returns.\n if (name.indexOf(' ') != -1) return null;\n // otherwise try looking up using a deprefixed name.\n var res = _removePrefix(name);\n if (res !== null) {\n // TODO the deprefixing is powerful, but maybe not really needed.\n return _getModelDef(defs, res, returnClone, readonly);\n }\n // not a prefixed name\n // TODO should we raise an error?\n return null;\n } else {\n // when the name is already defined...\n var defObj = defs[name];\n if (typeof defObj != 'object') throw \"Block definition must be an object: found \" + defObj + \" for \" + name;\n\n if (typeof defObj._initialized == 'undefined') {\n // Populate \"type\" depending on name\n if (typeof defObj.type == 'undefined') {\n if (name.indexOf(' ') == -1) {\n defObj.type = name;\n } else {\n defObj.type = name.substr(name.indexOf(' ') + 1);\n }\n }\n\n // If it is not a \"data\" type then let's deal with inheritance\n if (defObj.type != name && typeof defObj._widget == 'undefined') {\n var typeDef = _getModelDef(defs, defObj.type, true);\n var extended = objExtend(typeDef, defObj);\n defObj = extended;\n defs[name] = defObj;\n } else if (typeof defObj._widget == 'undefined' && typeof defObj._props == 'undefined' && typeof defObj._complex == 'undefined') {\n // TODO here I tried to deal with inheritance for every object without a \"type\" by using a simple deprefix.\n // but this break on theme containing \"pageTheme\" that would inherit from is parent. (creating a loop)\n /*\n var superType = _removePrefix(defObj.type);\n if (superType !== null) {\n console.log(\"Extending\", typeDef, name, superType, defObj.type);\n var typeDef = _getModelDef(defs, superType, true);\n \n var extended = jQuery.extend(true, typeDef, defObj);\n defObj = extended;\n defs[name] = defObj;\n }\n */\n }\n defObj._writeable = true;\n defObj._initialized = true;\n }\n\n if (typeof defObj._props != 'undefined') {\n var def = defObj._props;\n def = def.split(\" \");\n\n if (def.length > 0 && typeof defObj._writeable == 'undefined') {\n console.error(\"Altering a non writable object \", name, def, defObj);\n throw \"Altering a non writable object: \" + name + \" def: \" + def;\n }\n\n if (typeof defObj._processedDefs == 'undefined') {\n defObj._processedDefs = {};\n }\n\n if (typeof defObj._globalStyles == 'undefined') {\n defObj._globalStyles = {};\n }\n\n if (typeof defObj._defaultValues == 'undefined') {\n defObj._defaultValues = {};\n }\n\n for (var i = 0; i < def.length; i++) {\n var prop = def[i];\n if (prop.length === 0) continue;\n var origProp = prop;\n var defValue = null;\n // parses \"prop\" \"prop=value\" and \"prop[]\" declarations\n var propDef = prop.match(/^([^=\\[\\]]+)(\\[\\])?(=?)(.*)$/);\n if (propDef !== null) {\n prop = propDef[1];\n // TODO array definition should be done differently\n if (propDef[2] == '[]') {\n // TODO type should not be defined in this function\n if (typeof defObj[prop] == 'undefined') defObj[prop] = [];\n defValue = [];\n }\n if (propDef[3] == '=') {\n // TODO remove hardcoded \"visible\" matching (this should be defined in the template definition)\n if (prop.match(/(^v|V)isible$/)) defValue = String(propDef[4]).toLowerCase() == 'true';\n else if (prop.match(/^customStyle$/)) {\n defValue = String(propDef[4]).toLowerCase() == 'true';\n } else defValue = propDef[4];\n }\n }\n // default values found in \"properties\" are not being processed by \"modelEnsureValue\" and by consequence do not call \"themeUpdater\".\n // TODO document why this is needed, or remove.\n if (defValue !== null) {\n if (typeof defObj._defaultValues[prop] == 'undefined') {\n // if (prop.match(/^_/)) console.log(\"defValue for\", prop, \"in\", name);\n defObj._defaultValues[prop] = defValue;\n }\n }\n\n if (typeof defObj[prop] == 'undefined') {\n var val = _getModelDef(defs, name + ' ' + prop, true);\n if (val === null) {\n val = _getModelDef(defs, prop, true);\n }\n defObj[prop] = val;\n }\n\n defObj._processedDefs[prop] = origProp;\n defObj._complex = true;\n }\n\n delete defObj._props;\n }\n\n if (returnClone) {\n defObj._writeable = false;\n var cloned = objExtend({}, defObj);\n return cloned;\n } else if (readonly) {\n defObj._writeable = false;\n return defObj;\n } else {\n if (typeof defObj._writeable == 'undefined' || defObj._writeable === false) throw \"Retrieving non writeable object definition: \" + name;\n return defObj;\n }\n }\n};\n\nvar _increaseUseCount = function(readonly, model) {\n if (!readonly) {\n if (typeof model._usecount == 'undefined') model._usecount = 0;\n model._usecount++;\n } else if (typeof model._usecount == 'undefined') {\n console.error(\"ERROR trying to bind an unused property while readonly\", model);\n throw \"ERROR trying to bind an unused property\";\n }\n};\n\nvar ensureGlobalStyle = function(defs, readonly, gsBindingProvider, modelName, path, gsFullPath, defaultValue, overrideDefault) {\n\n var globalStyleBindingBindValue = gsBindingProvider(gsFullPath, defaultValue, overrideDefault);\n\n if (typeof defs[modelName]._globalStyles[path] == 'undefined') {\n if (readonly) throw \"Cannot find _globalStyle for \" + path + \" in \" + modelName + \"!\";\n if (path.indexOf('.') != -1 || (typeof defs[modelName][path] == 'object' && typeof defs[modelName][path]._widget !== 'undefined')) {\n defs[modelName]._globalStyles[path] = globalStyleBindingBindValue;\n }\n } else if (defs[modelName]._globalStyles[path] != globalStyleBindingBindValue) throw \"Unexpected conflicting globalStyle [2] for \" + modelName + \"/\" + path + \": old=\" + defs[modelName]._globalStyles[path] + \" new=\" + globalStyleBindingBindValue;\n};\n\n// themeUpdater, defaultValue, overrideDefault, setcategory are only used in !readonly mode\nvar modelEnsurePathAndGetBindValue = function(readonly, defs, themeUpdater, rootModelName, templateName, within, fullPath, defaultValue, overrideDefault, setcategory) {\n var modelName;\n var res;\n var path;\n // TODO remove '$' and '#' handing\n if (fullPath.substr(0, 1) == '$') {\n console.warn(\"DEPRECATED $ in bindingProvider: \", fullPath, templateName);\n var p = fullPath.indexOf('.');\n if (p == -1) {\n throw \"Unexpected fullPath: \" + fullPath + \"/\" + within + \"/\" + templateName + \"/\" + defaultValue + \"/\" + overrideDefault;\n } else {\n modelName = fullPath.substr(1, p - 1);\n path = fullPath.substr(p + 1);\n // TODO refactor me please\n if (modelName == 'theme') {\n var p2 = path.indexOf('.');\n modelName = path.substr(0, p2);\n path = path.substr(p2 + 1);\n } else {\n throw \"Unexpected $ sequence: \" + modelName + \" in \" + fullPath;\n }\n res = \"$root.content().theme().\" + modelName + \"().\" + path.replace(new RegExp('\\\\.', 'g'), '().');\n }\n } else if (fullPath.substr(0, 1) == '#') {\n console.warn(\"DEPRECATED # in bindingProvider: \", fullPath, templateName);\n modelName = rootModelName;\n path = fullPath.substr(1);\n res = \"$root.content().\" + path.replace(new RegExp('\\\\.', 'g'), '().');\n } else if (fullPath.substr(0, 8) == '_theme_.') {\n var p3 = fullPath.indexOf('.', 8);\n modelName = fullPath.substr(8, p3 - 8);\n path = fullPath.substr(p3 + 1);\n res = \"$root.content().theme().\" + modelName + \"().\" + path.replace(new RegExp('\\\\.', 'g'), '().');\n } else if (fullPath.substr(0, 7) == '_root_.') {\n modelName = rootModelName;\n path = fullPath.substr(7);\n res = \"$root.content().\" + path.replace(new RegExp('\\\\.', 'g'), '().');\n } else {\n modelName = templateName;\n path = within + fullPath;\n res = fullPath.replace(new RegExp('\\\\.', 'g'), '().');\n }\n\n if (typeof defs[modelName] === 'undefined') throw \"Cannot find model def for [\" + modelName + \"]\";\n\n var propPos = path.indexOf('.');\n var propName = propPos == -1 ? path : path.substr(0, propPos);\n\n if (modelName.indexOf('-') != -1) {\n console.error(\"ERROR cannot use - for block names\", modelName);\n throw \"ERROR unexpected char in block name: \" + modelName;\n }\n if (propName.indexOf('-') != -1) {\n console.error(\"ERROR cannot use - for property names\", propName);\n throw \"ERROR unexpected char in property name: \" + modelName;\n }\n\n // Fastpath\n if (readonly) {\n if (typeof defs[modelName]._globalStyle !== 'undefined' && typeof defs[modelName][propName] !== 'undefined' && defs[modelName][propName]._category == 'style') {\n res += '._defaultComputed';\n }\n return res;\n }\n\n // gets the writable model when \"!readonly\" or the readonly model otherwise\n var model;\n if (readonly) {\n if (typeof defaultValue !== 'undefined') throw \"Cannot use defaultValue in readonly mode!\";\n if (overrideDefault) throw \"Cannot use overrideDefault in readonly mode for \" + modelName + \"/\" + path + \"/\" + overrideDefault + \"!\";\n if (typeof setcategory !== 'undefined') throw \"Cannot set category for \" + modelName + \"/\" + path + \"/\" + setcategory + \" in readonly mode!\";\n model = _getModelDef(defs, modelName, false, true);\n } else {\n if (defs[modelName]._writeable === false) console.log(\"TODO debug use cases for this condition\", modelName, path);\n model = _getModelDef(defs, modelName, defs[modelName]._writeable === false);\n }\n\n if (model === null) throw \"Unexpected model for [\" + modelName + \"]\";\n\n // if the property does not exists we have to create it.\n if (typeof model[propName] == 'undefined') {\n // when in readonly mode this cannot be done!\n if (readonly) throw \"Cannot find path \" + propName + \" for \" + modelName + \"!\";\n _modelCreateOrUpdateBlockDef(defs, modelName, propName);\n model = _getModelDef(defs, modelName, false);\n }\n\n // Needs to do this again, because \"_modelCreateOrUpdateBlockDef\" could have been just created the property (e.g: backgroundColor buttonBlock not getting defaultComputed in template-lm)\n if (typeof defs[modelName]._globalStyle !== 'undefined' && typeof defs[modelName][propName] !== 'undefined' && defs[modelName][propName] !== null && defs[modelName][propName]._category == 'style') {\n res += '._defaultComputed';\n }\n\n var childModel = model;\n try {\n _increaseUseCount(readonly, childModel);\n if (propPos != -1) {\n var mypath = path;\n do {\n var prop = mypath.substr(0, propPos);\n if (typeof childModel[prop] == 'undefined') {\n throw \"Found an unexpected prop \" + prop + \" for model \" + modelName + \" for \" + path;\n }\n\n childModel = childModel[prop];\n _increaseUseCount(readonly, childModel);\n mypath = mypath.substr(propPos + 1);\n propPos = mypath.indexOf('.');\n } while (propPos != -1);\n\n if (typeof childModel[mypath] == 'undefined' || childModel[mypath] === null) {\n throw \"Found an unexpected path termination \" + mypath + \" for model \" + modelName + \" for \" + path;\n }\n childModel = childModel[mypath];\n } else {\n childModel = childModel[path];\n }\n\n if (typeof childModel === 'undefined' || childModel === null) throw \"Unexpected null model for \" + modelName + \"/\" + within + \"/\" + fullPath;\n\n if (typeof setcategory !== 'undefined') {\n childModel._category = setcategory;\n }\n\n _increaseUseCount(readonly, childModel);\n } catch (e) {\n console.error(\"TODO ERROR Property lookup exception\", e, modelName, path, templateName, fullPath, defs);\n throw e;\n }\n\n if (typeof defs[modelName]._globalStyle !== 'undefined' && typeof defs[modelName][propName] == 'object' && defs[modelName][propName] !== null && typeof defs[modelName][propName]._category != 'undefined' && defs[modelName][propName]._category == 'style') {\n // TODO can I restrict this code to !readonly mode?\n var gsBindingProvider = modelEnsurePathAndGetBindValue.bind(undefined, readonly, defs, themeUpdater, rootModelName, templateName, '');\n\n var subPath = path.indexOf('.') != -1 ? path.substr(path.indexOf('.')) : '';\n\n // The next code supports only properties with one dot (object.property).\n if (subPath.indexOf('.', 1) != -1) throw \"TODO unsupported object nesting! \" + path;\n\n var gsPath = defs[modelName]._globalStyle + '.' + propName;\n if (typeof defs[modelName][propName] == 'object' && defs[modelName][propName] !== null && typeof defs[modelName][propName]._globalStyle != 'undefined') {\n gsPath = defs[modelName][propName]._globalStyle;\n }\n\n ensureGlobalStyle(defs, readonly, gsBindingProvider, modelName, propName, gsPath, undefined, false);\n\n var gsFullPath = gsPath + subPath;\n\n if (typeof defaultValue == 'undefined' && defs[modelName]._defaultValues[path] !== null) defaultValue = defs[modelName]._defaultValues[path];\n\n ensureGlobalStyle(defs, readonly, gsBindingProvider, modelName, path, gsFullPath, defaultValue, overrideDefault);\n\n if (typeof defaultValue !== 'undefined') {\n if (readonly) {\n console.error(\"Cannot set a new theme default value\", gsFullPath.substr(7), defaultValue, \"while in readonly mode\");\n throw \"Cannot set a new theme default value (\" + defaultValue + \") for \" + gsFullPath.substr(7) + \" while in readonly mode!\";\n }\n themeUpdater('default', gsFullPath.substr(7), defaultValue);\n }\n\n // TODO complex stuff. If the theme uses inheritance we enforce it using with the same value, but this is a limit.\n defaultValue = null;\n\n }\n\n if (typeof defaultValue != 'undefined') {\n if (typeof defs[modelName]._defaultValues[path] == 'undefined' || (typeof overrideDefault != 'undefined' && overrideDefault)) {\n if (readonly) throw \"Cannot set new _defaultValues [1] for \" + path + \" in \" + modelName + \"!\";\n defs[modelName]._defaultValues[path] = defaultValue;\n } else {\n if (defaultValue === null) {\n if (readonly && defs[modelName]._defaultValues[path] !== null) {\n throw \"Cannot set new _defaultValues [2] for \" + path + \" in \" + modelName + \"!\";\n }\n // This remove default value. Ugly. (Needs this for defaults in template-lm socialLinksIcon)\n defs[modelName]._defaultValues[path] = null;\n } else if (defs[modelName]._defaultValues[path] != defaultValue) {\n console.error(\"TODO error!!! Trying to set a new default value for \" + modelName + \" \" + path + \" while it already exists (current: \" + defs[modelName]._defaultValues[path] + \", new: \" + defaultValue + \")\");\n throw \"Trying to set a new default value for \" + modelName + \" \" + path + \" while it already exists (current: \" + defs[modelName].defaultValues[path] + \", new: \" + defaultValue + \")\";\n }\n }\n }\n\n return res;\n};\n\nvar generateResultModel = function(templateDef) {\n var defs = templateDef._defs;\n var templateName = templateDef.templateName;\n\n var finalModelContent = _generateModel(defs, templateName);\n\n // TODO ugly to add this manually\n if (typeof defs['theme'] !== 'undefined') {\n finalModelContent.theme = _generateModel(defs, 'theme');\n }\n\n return finalModelContent;\n};\n\nmodule.exports = {\n // used to compile the template\n ensurePathAndGetBindValue: modelEnsurePathAndGetBindValue.bind(undefined, false),\n // used in runtime the template\n getBindValue: modelEnsurePathAndGetBindValue.bind(undefined, true),\n generateModel: _generateModel,\n generateResultModel: generateResultModel,\n getDef: _getDef,\n createOrUpdateBlockDef: _modelCreateOrUpdateBlockDef\n};",
|
|
133
|
+
"\"use strict\";\n/* global global: false */\n\nvar $ = require(\"jquery\");\nvar console = require(\"console\");\nvar converterUtils = require(\"./utils.js\");\nvar elaborateDeclarations = require(\"./declarations.js\");\nvar processStylesheetRules = require(\"./stylesheet.js\");\nvar modelDef = require(\"./model.js\");\nvar domutils = require(\"./domutils.js\");\n\nvar wrapElementWithCondition = function(attribute, element, bindingProvider) {\n var cond = domutils.getAttribute(element, attribute);\n\n try {\n var binding = converterUtils.conditionBinding(cond, bindingProvider);\n $(element).before('<!-- ko if: ' + binding + ' -->');\n $(element).after('<!-- /ko -->');\n domutils.removeAttribute(element, attribute);\n } catch (e) {\n console.warn(\"Model ensure path failed in if/variant\", element, cond, attribute);\n throw e;\n }\n\n};\n\nvar replacedAttributes = function(element, attributeName) {\n domutils.setAttribute(element, attributeName, domutils.getAttribute(element, \"replaced\" + attributeName));\n};\n\nvar processStyle = function(element, templateUrlConverter, bindingProvider, addUniqueId) {\n var style = domutils.getAttribute(element, 'replacedstyle');\n var newStyle = null;\n var newBindings;\n if (addUniqueId) newBindings = {\n uniqueId: '$data',\n attr: {\n id: 'id'\n }\n };\n\n var removeDisplayNone = domutils.getAttribute(element, 'data-ko-display') !== null;\n\n newStyle = elaborateDeclarations(style, undefined, templateUrlConverter, bindingProvider, element, newBindings, removeDisplayNone);\n\n // only when using \"replaced\"\n if (newStyle === null) {\n newStyle = style;\n } else {\n // in case there are no bindings we keep replacedstyle to be used by IE during output\n // otherwise I remove it because it will be overwritten by virtualAttrStyle binding.\n // TODO maybe we better use different names for \"replaced\" used during template conversion\n // and the ones used to create the output.\n domutils.removeAttribute(element, 'replacedstyle');\n }\n\n if (newStyle !== null) {\n if (newStyle.trim().length > 0) {\n domutils.setAttribute(element, 'style', newStyle);\n } else domutils.removeAttribute(element, 'style');\n }\n};\n\n\n// TODO fixing URLs is also needed where styles uses path (e.g: background-image, @import)\nvar _fixRelativePath = function(attribute, templateUrlConverter, index, element) {\n var url = domutils.getAttribute(element, attribute);\n var newUrl = templateUrlConverter(url);\n if (newUrl !== null) {\n domutils.setAttribute(element, attribute, newUrl);\n }\n};\n\n\nvar processBlock = function(element, defs, themeUpdater, blockPusher, templateUrlConverter, contextName, rootModelName, containerName, generateUniqueId, templateCreator) {\n\n try {\n\n var templateName;\n var variantName = '',\n variantDef = '';\n if (contextName == 'block') {\n templateName = domutils.getAttribute(element, 'data-ko-block');\n domutils.removeAttribute(element, 'data-ko-block');\n } else if (contextName == 'template') {\n templateName = rootModelName;\n } else {\n throw \"Unexpected context name while processing block: \" + contextName;\n }\n\n // console.log(\"processBlock\", contextName, rootModelName, containerName, templateName);\n\n // Remove element\n $('[data-ko-remove]', element).remove();\n\n var fixedBlocks = $('[data-ko-block]', element).replaceWith('<replacedblock>');\n\n // Urls in these attributes needs \"relativization\"\n var urlattrs = ['href', 'src', 'data-ko-placeholder-src', 'background'];\n for (var i = 0; i < urlattrs.length; i++) {\n // faccio il bind per non definire funzioni in un loop (jshint)\n var func = _fixRelativePath.bind(undefined, urlattrs[i], templateUrlConverter);\n $('[' + urlattrs[i] + ']', element).each(func);\n }\n\n var dataDefs = domutils.getAttribute(element, 'data-ko-properties');\n if (dataDefs === null) dataDefs = \"\";\n $(\"[data-ko-properties]\", element).each(function(index, element) {\n if (dataDefs.length > 0) dataDefs = dataDefs + \" \";\n dataDefs = dataDefs + domutils.getAttribute(element, 'data-ko-properties');\n domutils.removeAttribute(element, 'data-ko-properties');\n });\n\n modelDef.createOrUpdateBlockDef(defs, templateName, dataDefs, { contextName: contextName });\n\n var bindingProvider = modelDef.ensurePathAndGetBindValue.bind(undefined, defs, themeUpdater, rootModelName, templateName, '');\n if (contextName == 'block') bindingProvider('id', '');\n\n $('style', element).each(function(index, element) {\n var style = domutils.getInnerHtml(element);\n\n var blockDefsUpdater = modelDef.createOrUpdateBlockDef.bind(undefined, defs);\n var localWithBindingProvider = modelDef.ensurePathAndGetBindValue.bind(undefined, defs, themeUpdater, rootModelName);\n var newStyle = processStylesheetRules(style, undefined, localWithBindingProvider, blockDefsUpdater, themeUpdater, templateUrlConverter, rootModelName, templateName);\n\n if (newStyle != style) {\n if (newStyle.trim() !== '') {\n var tmpName = templateCreator(newStyle);\n domutils.setAttribute(element, 'data-bind', 'template: { name: \\'' + tmpName + '\\' }');\n // ho creato il template quindi posso svuotare il sorgente.\n domutils.setContent(element, '');\n } else {\n // remove empty styles blocks\n domutils.removeElements($(element));\n }\n }\n });\n\n processStyle(element, templateUrlConverter, bindingProvider, generateUniqueId);\n\n // TODO href should be supported. data-ko-display and data-ko-wrap should never happen in here.\n var notsupported = ['data-ko-display', 'data-ko-editable', 'data-ko-wrap', 'href'];\n for (var j = 0; j < notsupported.length; j++) {\n var attr = domutils.getAttribute(element, notsupported[j]);\n if (attr) {\n console.warn(\"ERROR: Unsupported \" + notsupported[j] + \" used together with data-ko-block\", element);\n throw \"ERROR: Unsupported \" + notsupported[j] + \" used together with data-ko-block\";\n }\n }\n\n // simply preprocessed as data-ko-wrap + -ko-attr-href\n $(\"[data-ko-link]\", element).each(function(index, element) {\n var urlVar = domutils.getAttribute(element, 'data-ko-link');\n var repStyle = domutils.getAttribute(element, 'replacedstyle');\n if (typeof repStyle == 'undefined' || repStyle === null) repStyle = '';\n if (repStyle !== '') repStyle = '-ko-attr-href: @' + urlVar + \"; \" + repStyle;\n else repStyle = '-ko-attr-href: @' + urlVar;\n domutils.setAttribute(element, 'replacedstyle', repStyle);\n domutils.setAttribute(element, 'data-ko-wrap', urlVar);\n domutils.removeAttribute(element, 'data-ko-link');\n });\n\n $(\"[replacedstyle]\", element).each(function(index, element) {\n processStyle(element, templateUrlConverter, bindingProvider, false);\n });\n\n $(\"[replacedhttp-equiv]\", element).each(function(index, element) {\n replacedAttributes(element, \"http-equiv\");\n });\n\n $(\"[data-ko-display]\", element).each(function(index, element) {\n wrapElementWithCondition('data-ko-display', element, bindingProvider);\n });\n\n $(\"[data-ko-editable]\", element).each(function(index, element) {\n var newBinding, defaultValue, model, currentBindings, dataBind;\n\n\n var dataEditable = domutils.getAttribute(element, \"data-ko-editable\");\n\n // TODO add validation of the editable\n\n var itemBindValue;\n var selectBinding;\n if (dataEditable.lastIndexOf('.') > 0) {\n var subs = dataEditable.substr(0, dataEditable.lastIndexOf('.'));\n itemBindValue = bindingProvider(subs);\n } else {\n itemBindValue = bindingProvider(dataEditable);\n }\n selectBinding = \"wysiwygClick: function(obj, evt) { $root.selectItem(\" + itemBindValue + \", $data); return false }, clickBubble: false, wysiwygCss: { selecteditem: $root.isSelectedItem(\" + itemBindValue + \") }, scrollIntoView: $root.isSelectedItem(\" + itemBindValue + \")\";\n\n if (domutils.getLowerTagName(element) != 'img') {\n\n\n defaultValue = domutils.getInnerHtml(element);\n var modelBindValue = bindingProvider(dataEditable, defaultValue, true, 'wysiwyg');\n newBinding = \"\";\n\n if (!domutils.getAttribute(element, \"id\")) {\n newBinding += \"wysiwygId: id()+'_\" + dataEditable.replace('.', '_') + \"', \";\n }\n\n if (typeof selectBinding !== 'undefined') {\n newBinding += selectBinding + \", \";\n }\n\n newBinding += \"wysiwygOrHtml: \" + modelBindValue;\n\n if (domutils.getLowerTagName(element) == 'td') {\n var wrappingDiv = $('<div data-ko-wrap=\"false\" style=\"width: 100%; height: 100%\"></div>')[0];\n domutils.setAttribute(wrappingDiv, 'data-bind', newBinding);\n var newContent = domutils.getInnerHtml($('<div></div>').append(wrappingDiv));\n domutils.setContent(element, newContent);\n } else {\n currentBindings = domutils.getAttribute(element, 'data-bind');\n dataBind = (currentBindings !== null ? currentBindings + \", \" : \"\") + newBinding;\n domutils.setAttribute(element, 'data-bind', dataBind);\n domutils.setContent(element, '');\n }\n domutils.removeAttribute(element, 'data-ko-editable');\n } else {\n var width = domutils.getAttribute(element, 'width');\n if (width === '') width = null;\n if (width === null) {\n console.error(\"ERROR: data-ko-editable images must declare a WIDTH attribute!\", element);\n throw \"ERROR: data-ko-editable images must declare a WIDTH attribute!\";\n }\n var height = domutils.getAttribute(element, 'height');\n if (height === '') height = null;\n\n var align = domutils.getAttribute(element, 'align');\n\n currentBindings = domutils.getAttribute(element, 'data-bind');\n\n // TODO this is ugly... maybe a better strategy is to pass this around using \"data-\" attributes\n var dynHeight = currentBindings && currentBindings.match(/virtualAttr: {[^}]* height: ([^,}]*)[,}]/);\n if (dynHeight) height = dynHeight[1];\n var dynWidth = currentBindings && currentBindings.match(/virtualAttr: {[^}]* width: ([^,}]*)[,}]/);\n if (dynWidth) width = dynWidth[1];\n\n var method;\n\n defaultValue = domutils.getAttribute(element, 'data-ko-placeholder-src');\n // TODO make sure this default value is the same as the one checked by img-wysiwyg template.\n var value = '';\n if (defaultValue) {\n value = domutils.getAttribute(element, 'src');\n } else {\n defaultValue = domutils.getAttribute(element, 'src');\n }\n\n var size;\n if (width && height) {\n size = width + \"+'x'+\" + height;\n } else if (!height) {\n size = \"'w'+\" + width + \"+''\";\n } else if (!width) {\n size = \"'h'+\" + height + \"+''\";\n }\n var placeholdersrc;\n var plheight = height || domutils.getAttribute(element, 'data-ko-placeholder-height');\n var plwidth = width || domutils.getAttribute(element, 'data-ko-placeholder-width');\n\n domutils.removeAttribute(element, 'src');\n domutils.removeAttribute(element, 'data-ko-editable');\n domutils.removeAttribute(element, 'data-ko-placeholder-height');\n domutils.removeAttribute(element, 'data-ko-placeholder-width');\n domutils.removeAttribute(element, 'data-ko-placeholder-src');\n\n if (defaultValue) {\n placeholdersrc = \"{ width: \" + plwidth + \", height: \" + plheight + \", text: \" + size + \"}\";\n }\n\n if (!plwidth || !plheight) {\n // TODO raise an exception?\n console.error(\"IMG data-ko-editable must declare width and height attributes, or their placeholder counterparts data-ko-placeholder-width/data-ko-placeholder-height\", element);\n throw \"ERROR: IMG data-ko-editable MUST declare width and height attributes, or their placeholder counterparts data-ko-placeholder-width/data-ko-placeholder-height\";\n }\n\n var bindingValue = bindingProvider(dataEditable, value, false, 'wysiwyg');\n newBinding = \"wysiwygSrc: { width: \" + width + \", height: \" + height + \", src: \" + bindingValue + \", placeholder: \" + placeholdersrc + \" }\";\n dataBind = (currentBindings !== null ? currentBindings + \", \" : \"\") + newBinding;\n domutils.setAttribute(element, 'data-bind', dataBind);\n\n var tmplName = templateCreator(element);\n\n var containerBind = '{ width: ' + width;\n if (align == 'left') containerBind += ', float: \\'left\\'';\n else if (align == 'right') containerBind += ', float: \\'right\\'';\n else if (align == 'center') console.log('non so cosa fa align=center su una img e quindi non so come simularne l\\'editing');\n else if (align == 'top') containerBind += ', verticalAlign: \\'top\\'';\n else if (align == 'middle') containerBind += ', verticalAlign: \\'middle\\'';\n else if (align == 'bottom') containerBind += ', verticalAlign: \\'bottom\\'';\n containerBind += '}';\n\n $(element).before('<!-- ko wysiwygImg: { _data: $data, _item: ' + itemBindValue + ', _template: \\'' + tmplName + '\\', _editTemplate: \\'img-wysiwyg\\', _src: ' + bindingValue + ', _width: ' + width + ', _height: ' + height + ', _align: ' + (align === null ? undefined : '\\'' + align + '\\'') + ', _size: ' + size + ', _method: ' + method + ', _placeholdersrc: ' + placeholdersrc + ', _stylebind: ' + containerBind + ' } -->');\n $(element).after('<!-- /ko -->');\n }\n\n });\n\n // Applied after the data-editable so to avoid processing hrefs for editable content\n $(\"[href]\", element).each(function(index, element) {\n var attrValue = domutils.getAttribute(element, 'href');\n var newBinding = 'wysiwygHref: \\'' + converterUtils.addSlashes(attrValue) + '\\'';\n var currentBindings = domutils.getAttribute(element, 'data-bind');\n var dataBind = (currentBindings !== null ? currentBindings + \", \" : \"\") + newBinding;\n domutils.setAttribute(element, 'data-bind', dataBind);\n });\n\n $(\"replacedblock\", element).each(function(index, element) {\n var blockElement = fixedBlocks[index];\n\n var blockName = processBlock(blockElement, defs, themeUpdater, blockPusher, templateUrlConverter, 'block', templateName, containerName, true, templateCreator);\n // replaced blocks are defined in the model root\n var modelBindValue = modelDef.ensurePathAndGetBindValue(defs, themeUpdater, rootModelName, templateName, '', blockName);\n\n // this way we call block-wysiwyg or block-show and not directly the right block\n $(element).before('<!-- ko block: { data: ' + converterUtils.addSlashes(modelBindValue) + ', template: \\'block\\' } -->');\n $(element).after('<!-- /ko -->');\n $(element).remove();\n });\n\n // TODO do we really need to loop in reverse order?\n // data-ko-wrap have to be processed at the end, expecially after \"replaceblocks\"\n // otherwise a data-ko-wrap wrapping a data-ko-block would break everything.\n $($(\"[data-ko-wrap]\", element).get().reverse(), element).each(function(index, element) {\n var cond = domutils.getAttribute(element, 'data-ko-wrap');\n if (typeof cond === 'undefined' || cond === '' || cond === 'true') {\n throw \"Unsupported empty value for data-ko-wrap: use false value if you want to always remove the tag\";\n }\n\n var condBinding = converterUtils.conditionBinding(cond, bindingProvider);\n\n /*\n var condBinding = false;\n if (typeof cond === 'undefined' || cond === '') {\n throw \"Unsupported empty value for data-ko-wrap: use false value if you want to always remove the tag\";\n } else if (cond === 'false') {\n condBinding = false;\n } else if (cond === 'true') {\n throw \"Unsupported true value for data-ko-wrap. This makes no sense: use false or a variable\";\n } else {\n condBinding = bindingProvider(cond)+'()';\n }\n */\n\n var dataBind = domutils.getAttribute(element, 'data-bind');\n\n var innerTmplName, outerTmplName;\n // TODO ugly hardcoded handling: at the very least this should be invoked by the data-container caller.\n if (dataBind !== '' && dataBind !== null && dataBind.match(/(block|wysiwygOrHtml):/)) {\n // we can't put the content in a template because it will be overwritten by the binding\n var innerTmplContent = '<!-- ko ' + dataBind + ' -->' + domutils.getInnerHtml(element) + '<!-- /ko -->';\n innerTmplName = templateCreator(innerTmplContent);\n domutils.removeAttribute(element, 'data-ko-wrap');\n outerTmplName = templateCreator(element);\n domutils.replaceHtml(element, '<!-- ko template: /* special */ (typeof templateMode != \\'undefined\\' && templateMode == \\'wysiwyg\\') || ' + condBinding + ' ? \\'' + outerTmplName + '\\' : \\'' + innerTmplName + '\\' --><!-- /ko -->');\n } else {\n // we put the content in a template and the frame in another template including this one.\n innerTmplName = templateCreator(domutils.getInnerHtml(element));\n domutils.removeAttribute(element, 'data-ko-wrap');\n domutils.setContent(element, '<!-- ko template: \\'' + innerTmplName + '\\' --><!-- /ko -->');\n outerTmplName = templateCreator(element);\n domutils.replaceHtml(element, '<!-- ko template: (typeof templateMode != \\'undefined\\' && templateMode == \\'wysiwyg\\') || ' + condBinding + ' ? \\'' + outerTmplName + '\\' : \\'' + innerTmplName + '\\' --><!-- /ko -->');\n }\n\n });\n\n templateCreator(element, templateName, 'show');\n\n blockPusher(rootModelName, templateName, contextName, containerName);\n\n return templateName;\n\n } catch (e) {\n console.error(\"Exception while parsing the template\", e, element);\n throw e;\n }\n\n};\n\nfunction conditional_replace(html) {\n return html.replace(/<!--\\[if ([^\\]]*)\\]>((?:(?!--)[\\s\\S])*?)<!\\[endif\\]-->/g, function(match, condition, body) {\n var dd = '<!-- cc:start -->';\n dd += body.replace(/<([A-Za-z:]+)/g, '<!-- cc:bo:$1 --><cc') // before open tag\n .replace(/<\\/([A-Za-z:]+)>/g,'<!-- cc:bc:$1 --></cc><!-- cc:ac:$1 -->') // before/after close tag\n .replace(/\\/>/g,'/><!-- cc:sc -->'); // self-close tag\n dd += '<!-- cc:end -->';\n var output = '<replacedcc condition=\"'+condition+'\" style=\"display: none\">';\n output += $('<div>').append($(dd)).html()\n .replace(/^<!-- cc:start -->/, '')\n .replace(/<!-- cc:end -->$/, '');\n output += '</replacedcc>';\n return output;\n });\n}\n\n\nvar translateTemplate = function(templateName, html, templateUrlConverter, templateCreator) {\n var defs = {};\n var replacedHtml = conditional_replace(html.replace(/(<[^>]+\\s)(style|http-equiv)(=\"[^\"]*\"[^>]*>)/gi, function(match, p1, p2, p3) {\n return p1 + 'replaced' + p2 + p3;\n }));\n var content = $(replacedHtml);\n var element = content[0];\n\n var blocks = []; // {rootName, blockName, containerName}\n var _blockPusher = function(rootName, blockName, contextName, containerName) {\n blocks.push({\n root: rootName,\n block: blockName,\n context: contextName,\n container: containerName\n });\n };\n\n // TODO have to accept nulls as undefineds (because of model.js behaviour)\n var themeUpdater = function(name, key, val) {\n if (typeof defs['themes'] === 'undefined') defs['themes'] = {};\n if (typeof defs['themes'][name] === 'undefined') defs['themes'][name] = {};\n if (typeof defs['themes'][name][key] === 'undefined' || defs['themes'][name][key] === null) defs['themes'][name][key] = val;\n else if (typeof val !== 'undefined' && val !== null) {\n var precVal = defs['themes'][name][key];\n if (precVal != val) console.log(\"Error setting a new default for property \" + key + \" in theme \" + name + \". old:\" + precVal + \" new:\" + val + \"!\");\n }\n };\n\n var containers = $(\"[data-ko-container]\", content);\n var containersDom = {};\n containers.each(function(index, element) {\n var containerName = domutils.getAttribute(element, 'data-ko-container') + \"Blocks\";\n\n domutils.removeAttribute(element, 'data-ko-container');\n domutils.setAttribute(element, 'data-bind', 'block: ' + containerName);\n\n var containerBlocks = $(\"> [data-ko-block]\", element);\n domutils.removeElements(containerBlocks, true);\n\n containersDom[containerName] = containerBlocks;\n });\n\n // TODO remove hardcoded properties: we need them because without these loading a basic template fails.\n // Needed in order to use data-ko-block\n modelDef.createOrUpdateBlockDef(defs, 'id');\n // Needed always as it is the default theme section.\n modelDef.createOrUpdateBlockDef(defs, 'bodyTheme');\n // Needed for data-ko-container\n modelDef.createOrUpdateBlockDef(defs, 'blocks', 'blocks[]');\n\n // Needed if you want to use a text variable? TODO this should not be needed!\n modelDef.createOrUpdateBlockDef(defs, 'text');\n\n processBlock(element, defs, themeUpdater, _blockPusher, templateUrlConverter, 'template', templateName, undefined, false, templateCreator);\n\n var blockProcess = function(containerName, index, element) {\n processBlock(element, defs, themeUpdater, _blockPusher, templateUrlConverter, 'block', templateName, containerName, true, templateCreator);\n };\n\n for (var prop in containersDom)\n if (containersDom.hasOwnProperty(prop)) {\n var containerBlocks = containersDom[prop];\n var containerName = prop;\n\n modelDef.ensurePathAndGetBindValue(defs, themeUpdater, templateName, templateName, '', containerName + \".blocks\", \"[]\");\n\n containerBlocks.each(blockProcess.bind(undefined, containerName));\n }\n\n var templateDef = {\n _defs: defs,\n templateName: templateName,\n _blocks: blocks\n };\n\n if (typeof defs[templateName]._version !== 'undefined') {\n templateDef.version = defs[templateName]._version;\n }\n\n return templateDef;\n};\n\n\nmodule.exports = translateTemplate;",
|
|
134
|
+
"\"use strict\";\n\n// Parses CSS/stylesheets declarations -ko-blockdefs/-ko-themes\n// It returns KO bindings but doesn't depend on KO\n// Needs a bindingProvider\n// Also uses a blockDefsUpdater to update definitions while parsing the stylesheet.\n\nvar cssParse = require(\"mensch/lib/parser.js\");\nvar console = require(\"console\");\nvar converterUtils = require(\"./utils.js\");\nvar elaborateDeclarations = require(\"./declarations.js\");\n\n/* Temporary experimental code not used\nvar _processStyleSheetRules_processThemes = function (bindingProvider, themeUpdater, rules) {\n var sels, decls, i, j, k;\n for( i = 0; i < rules.length; i++) {\n if (rules[i].type == 'rule') {\n sels = rules[i].selectors;\n decls = rules[i].declarations;\n for (j = 0; j < sels.length; j++) {\n for (k = 0; k < decls.length; k++) if (decls[k].type == 'property') {\n try {\n var bindVal = bindingProvider('$'+decls[k].name);\n themeUpdater(sels[j], decls[k].name, decls[k].value, bindVal);\n } catch (e) {\n console.log(\"Exception setting theme for\", decls[k].name, decls[k].value, e);\n }\n }\n }\n }\n }\n};\n*/\n\nvar _processStyleSheetRules_processBlockDef = function(blockDefsUpdater, rules) {\n var properties, namedProps, decls;\n // name, contextName, globalStyle, themeOverride, extend, min, max, widget, options, category, variant, help, blockDescription, version, \n for (var i = 0; i < rules.length; i++) {\n if (rules[i].type == 'rule') {\n var sels = rules[i].selectors;\n var hasDeclarations = false;\n var hasPreviews = false;\n for (var j = 0; j < sels.length; j++) {\n if (sels[j].match(/:preview$/)) {\n hasPreviews = true;\n } else {\n hasDeclarations = true;\n }\n }\n if (hasPreviews && hasDeclarations) {\n console.log(\"cannot mix selectors type (:preview and declarations) in @supports -ko-blockdefs \", sels);\n throw \"Cannot mix selectors type (:preview and declarations) in @supports -ko-blockdefs\";\n }\n if (!hasPreviews && !hasDeclarations) {\n console.log(\"cannot find known selectors in @supports -ko-blockdefs \", sels);\n throw \"Cannot find known selectors in @supports -ko-blockdefs\";\n }\n if (hasDeclarations) {\n properties = '';\n namedProps = {};\n\n/*\n name = undefined;\n contextName = undefined;\n globalStyle = undefined;\n themeOverride = undefined;\n extend = undefined;\n max = undefined;\n min = undefined;\n widget = undefined;\n options = undefined;\n category = undefined;\n variant = undefined;\n help = undefined;\n blockDescription = undefined;\n version = undefined;\n */\n decls = rules[i].declarations;\n for (var k = 0; k < decls.length; k++) if (decls[k].type == 'property') {\n if (decls[k].name == 'label') namedProps.name = decls[k].value;\n else if (decls[k].name == 'context') namedProps.contextName = decls[k].value;\n else if (decls[k].name == 'properties') properties = decls[k].value;\n else if (decls[k].name == 'theme') namedProps.globalStyle = '_theme_.' + decls[k].value;\n else if (decls[k].name == 'themeOverride') namedProps.themeOverride = String(decls[k].value).toLowerCase() == 'true';\n // else if (decls[k].name == 'extend') extend = decls[k].value;\n\n // else if (decls[k].name == 'max') max = decls[k].value;\n // else if (decls[k].name == 'min') min = decls[k].value;\n // else if (decls[k].name == 'options') options = decls[k].value;\n\n // else if (decls[k].name == 'widget') widget = decls[k].value;\n // else if (decls[k].name == 'category') category = decls[k].value;\n // else if (decls[k].name == 'variant') variant = decls[k].value;\n // else if (decls[k].name == 'help') help = decls[k].value;\n // else if (decls[k].name == 'blockDescription') blockDescription = decls[k].value;\n // else if (decls[k].name == 'version') version = decls[k].value;\n else {\n namedProps[decls[k].name] = decls[k].value;\n // TODO in past we detected unsupported properties, while now we simple push every declaration in a namedProperty.\n // This make it harder to spot errors in declarations.\n // console.warn(\"Unknown property processing @supports -ko-blockdefs \", decls[k], sels);\n }\n }\n for (var l = 0; l < sels.length; l++) {\n blockDefsUpdater(sels[l], properties, namedProps);\n }\n }\n if (hasPreviews) {\n for (var m = 0; m < sels.length; m++) {\n var localBlockName = sels[m].substr(0, sels[m].indexOf(':'));\n var previewBindings = rules[i].declarations;\n blockDefsUpdater(localBlockName, undefined, { previewBindings: previewBindings });\n }\n }\n\n } else {\n // Ignoring comments or other content\n }\n }\n};\n\nvar processStylesheetRules = function(style, rules, localWithBindingProvider, blockDefsUpdater, themeUpdater, templateUrlConverter, rootModelName, templateName) {\n var newStyle = style;\n var lastStart = null;\n\n if (typeof rules == 'undefined') {\n var styleSheet = cssParse(style, {\n comments: true,\n position: true\n });\n if (styleSheet.type != 'stylesheet' || typeof styleSheet.stylesheet == 'undefined') {\n console.log(\"unable to process styleSheet\", styleSheet);\n throw \"Unable to parse stylesheet\";\n }\n rules = styleSheet.stylesheet.rules;\n }\n\n // WARN currenlty this parses rules in reverse order so that string replacements works using input \"positions\"\n // otherwise it should compute new offsets on every replacement.\n // But this create issues because of definitions being parsed in reverse order, so this is not a good idea.\n // Sometimes, to work around this issues, you need to create 2 different <style> blocks.\n var bindingProvider;\n\n for (var i = rules.length - 1; i >= 0; i--) {\n if (rules[i].type == 'supports' && rules[i].name == '-ko-blockdefs') {\n _processStyleSheetRules_processBlockDef(blockDefsUpdater, rules[i].rules);\n newStyle = converterUtils.removeStyle(newStyle, rules[i].position.start, lastStart, 0, 0, 0, '');\n /* temporary experimental code not used\n } else if (rules[i].type == 'supports' && rules[i].name == '-ko-themes') {\n bindingProvider = localWithBindingProvider.bind(this, 'theme', '');\n _processStyleSheetRules_processThemes(bindingProvider, themeUpdater, rules[i].rules);\n newStyle = converterUtils.removeStyle(newStyle, rules[i].position.start, lastStart, 0, 0, 0, '');\n */\n } else if (rules[i].type == 'media' || rules[i].type == 'supports') {\n newStyle = processStylesheetRules(newStyle, rules[i].rules, localWithBindingProvider, blockDefsUpdater, themeUpdater, templateUrlConverter, rootModelName, templateName);\n } else if (rules[i].type == 'comment') {\n // ignore comments\n } else if (rules[i].type == 'rule') {\n var sels = rules[i].selectors;\n var newSel = \"\";\n var foundBlockMatch = null;\n for (var j = 0; j < sels.length; j++) {\n if (newSel.length > 0) newSel += \", \";\n var match = sels[j].match(/\\[data-ko-block=([^ ]*)\\]/);\n if (match !== null) {\n if (foundBlockMatch !== null && foundBlockMatch != match[1]) throw \"Found multiple block-match attribute selectors: cannot translate it (\" + foundBlockMatch + \" vs \" + match[1] + \")\";\n foundBlockMatch = match[1];\n }\n newSel += '<!-- ko text: templateMode ==\\'wysiwyg\\' ? \\'#main-wysiwyg-area \\' : \\'\\' --><!-- /ko -->' + sels[j];\n }\n if (foundBlockMatch) {\n var loopPrefix = '<!-- ko foreach: $root.findObjectsOfType($data, \\'' + foundBlockMatch + '\\') -->';\n var loopPostfix = '<!-- /ko -->';\n var end = lastStart;\n var spacing = \" \";\n if (rules[i].declarations.length > 0) {\n if (rules[i].declarations[0].position.start.line != rules[i].position.end.line) {\n spacing = \"\\n\" + (new Array(rules[i].position.start.col)).join(\" \");\n }\n end = rules[i].declarations[rules[i].declarations.length - 1].position.end;\n }\n if (end === null) newStyle += spacing + loopPostfix;\n else if (end == lastStart) newStyle = converterUtils.removeStyle(newStyle, end, lastStart, 0, 0, 0, spacing + loopPostfix);\n else newStyle = converterUtils.removeStyle(newStyle, end, lastStart, 0, 0, 0, spacing + '}' + spacing + loopPostfix);\n newSel = loopPrefix + spacing + newSel.replace(new RegExp('\\\\[data-ko-block=' + foundBlockMatch + '\\\\]', 'g'), '<!-- ko text: \\'#\\'+id() -->' + foundBlockMatch + '<!-- /ko -->');\n\n blockDefsUpdater(foundBlockMatch, '', { contextName: 'block' });\n }\n // TODO mensch update (using original mensch library we needed this line, while the patched one doesn't need this code)\n // newSel += \" {\";\n var localBlockName = foundBlockMatch ? foundBlockMatch : templateName;\n bindingProvider = localWithBindingProvider.bind(this, localBlockName, '');\n var elaboratedStyle = elaborateDeclarations(newStyle, rules[i].declarations, templateUrlConverter, bindingProvider);\n if (elaboratedStyle !== null) newStyle = elaboratedStyle;\n\n newStyle = converterUtils.removeStyle(newStyle, rules[i].position.start, rules[i].position.end, 0, 0, 0, newSel);\n } else {\n console.log(\"Unknown rule type\", rules[i].type, \"while parsing <style> rules\");\n }\n lastStart = rules[i].position.start;\n }\n return newStyle;\n};\n\nmodule.exports = processStylesheetRules;",
|
|
135
|
+
"\"use strict\";\nvar console = require('console');\nvar jsep = require('jsep');\n\njsep.addBinaryOp(\"or\", 1);\njsep.addBinaryOp(\"and\", 2);\njsep.addBinaryOp(\"eq\", 6);\njsep.addBinaryOp(\"neq\", 6);\njsep.addBinaryOp(\"lt\", 7);\njsep.addBinaryOp(\"lte\", 7);\njsep.addBinaryOp(\"gt\", 7);\njsep.addBinaryOp(\"gte\", 7);\n\nvar addSlashes = function(str) {\n return str.replace(/[\\\\\"']/g, '\\\\$&').replace(/\\u0000/g, '\\\\0');\n};\n\nvar removeStyle = function(style, startPos, endPos, skipRows, startOffset, endOffset, insert) {\n var styleRows = style.split(\"\\n\");\n var start = startOffset;\n var end = endOffset;\n for (var r = 1 + skipRows; r < startPos.line; r++) start += styleRows[r - 1 - skipRows].length + 1;\n start += startPos.col;\n if (endPos !== null) {\n for (var r2 = 1 + skipRows; r2 < endPos.line; r2++) end += styleRows[r2 - 1 - skipRows].length + 1;\n end += endPos.col;\n } else end += style.length + 1;\n var newStyle = style.substr(0, start - 1) + insert + style.substr(end - 1);\n return newStyle;\n};\n\nvar expressionGenerator = function(node, bindingProvider, defVal) {\n function mapOperator(op) {\n switch (op) {\n case 'or':\n return '||';\n case 'and':\n return '&&';\n case 'lt':\n return '<';\n case 'lte':\n return '<=';\n case 'gt':\n return '>';\n case 'gte':\n return '>=';\n case 'eq':\n return '==';\n case 'neq':\n return '!=';\n default:\n return op;\n }\n }\n\n function gen(node, bindingProvider, lookupmember, defVal) {\n if (typeof lookupmember == 'undefined') lookupmember = true;\n\n if (typeof defVal !== 'undefined' && node.type !== \"Identifier\" && node.type !== \"MemberExpression\") console.log(\"Cannot apply default value to variable when using expressions\");\n\n if (node.type === \"BinaryExpression\" || node.type === \"LogicalExpression\") {\n return '(' + gen(node.left, bindingProvider, lookupmember) + ' ' + mapOperator(node.operator) + ' ' + gen(node.right, bindingProvider, lookupmember) + ')';\n } else if (node.type === 'CallExpression') {\n var args = node.arguments.map(function(n) {\n return gen(n, bindingProvider, lookupmember);\n });\n return gen(node.callee, bindingProvider, lookupmember) + '(' + args.join(', ') + ')';\n } else if (node.type === \"UnaryExpression\") {\n return node.operator + gen(node.argument, bindingProvider, lookupmember);\n } else if (node.type == 'MemberExpression' && node.computed) {\n throw \"Unexpected computed member expression\";\n // return gen(node.object) + '[' + gen(node.property) + ']';\n } else if (node.type == 'MemberExpression' && !node.computed) {\n var me = gen(node.object, bindingProvider, false) + '.' + gen(node.property, bindingProvider, false);\n if (lookupmember && node.object.name !== 'Math' && node.object.name !== 'Color') return bindingProvider(me, defVal) + '()';\n return me;\n } else if (node.type === \"Literal\") {\n return node.raw;\n } else if (node.type === 'Identifier') {\n var id = node.name;\n if (lookupmember) return bindingProvider(id, defVal) + '()';\n else return id;\n } else if (node.type === 'ConditionalExpression') {\n return '(' + gen(node.test, bindingProvider, lookupmember) + ' ? ' + gen(node.consequent, bindingProvider, lookupmember) + ' : ' + gen(node.alternate, bindingProvider, lookupmember) + ')';\n } else if (node.type === 'Compound') {\n throw \"Syntax error in expression: operator expected after \" + gen(node.body[0], bindingProvider, false);\n } else {\n throw \"Found an unsupported expression type: \" + node.type;\n }\n }\n\n return gen(node, bindingProvider, undefined, defVal);\n};\n\nvar expressionBinding = function(expression, bindingProvider, defaultValue) {\n var matches;\n if (typeof defaultValue !== 'undefined' && defaultValue !== null) {\n var check = expression.trim().replace(/@\\[([^\\]]+)\\]|@([a-zA-Z0-9\\._]+)\\b/g, '###var###');\n check = check.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, \"\\\\$&\");\n if (check == '###var###') matches = [null, defaultValue];\n else {\n check = '^' + check.replace(/###var###/g, '(.+)') + '$';\n matches = defaultValue.trim().match(new RegExp(check));\n if (!matches) {\n // TODO throw error?\n console.log(\"Cannot find matches\", matches, \"for\", defaultValue, expression, check, expression);\n throw \"Cannot find default value for \" + expression + \" in \" + defaultValue;\n }\n }\n }\n try {\n var vars = 0;\n var result = \"'\" + expression.replace(/@\\[([^\\]]+)\\]|@([a-zA-Z0-9\\._]+)\\b|(')/g, function(match, p1, p2, p3) {\n // escaping..\n if (p3) return \"\\\\\" + p3;\n vars++;\n var varName = p1 || p2;\n var defVal;\n if (matches) {\n if (typeof matches[vars] !== 'undefined') {\n defVal = matches[vars].trim();\n } else {\n console.log(\"ABZZZ Cannot find default value for\", varName, \"in\", matches, \"as\", vars);\n }\n }\n // in case we found p1 we are in a @[sequence] so we start an expression parser\n if (p1) {\n var parsetree = jsep(p1);\n var gentree = expressionGenerator(parsetree, bindingProvider, defVal);\n return \"'+\" + gentree + \"+'\";\n }\n return \"'+\" + bindingProvider(varName, defVal) + \"()+'\";\n }) + \"'\";\n result = result.replace(/(^|[^\\\\])''\\+/g, '$1').replace(/\\+''/g, '');\n\n if (vars === 0 && result !== 'false' && result !== 'true') {\n console.error(\"Unexpected expression with no valid @variable references\", expression);\n }\n return result;\n } catch (e) {\n throw \"Exception parsing expression \" + expression + \" \" + e;\n }\n};\n\nvar conditionBinding = function(condition, bindingProvider) {\n var parsetree = jsep(condition);\n var gentree = expressionGenerator(parsetree, bindingProvider);\n return gentree;\n};\n\nmodule.exports = {\n addSlashes: addSlashes,\n removeStyle: removeStyle,\n conditionBinding: conditionBinding,\n expressionBinding: expressionBinding\n};",
|
|
136
|
+
"\"use strict\";\n\n// This is complex code to handle \"live\" model instrumentation and dependency tracking.\n// This adds _wrap and _unwrap methods to the model and also instrument the block list so to automatically\n// wrap/upwrap objects on simple array methods (push, splice)\n\nvar ko = require(\"knockout\");\nvar kowrap = require(\"knockout.wrap\");\nvar console = require(\"console\");\n\nvar _getOptionsObject = function(options) {\n var optionsCouples = options.split('|');\n var opts = {};\n for (var i = 0; i < optionsCouples.length; i++) {\n var opt = optionsCouples[i].split('=');\n opts[opt[0]] = opt.length > 1 ? opt[1] : opt[0];\n }\n return opts;\n};\n\n// generate a computed variable handling the fallback to theme variable\nvar _makeComputed = function(target, def, nullIfEqual, schemeSelector, themePath, themes) {\n var res = ko.computed({\n 'read': function() {\n var val = target();\n if (val === null) {\n var scheme = ko.utils.unwrapObservable(schemeSelector);\n if (typeof scheme == 'undefined' || scheme == 'custom') {\n return ko.utils.unwrapObservable(def);\n } else {\n return themes[scheme][themePath];\n }\n } else {\n return val;\n }\n },\n 'write': function(value) {\n var scheme = ko.utils.unwrapObservable(schemeSelector);\n var defVal;\n if (typeof scheme == 'undefined' || scheme == 'custom') {\n defVal = ko.utils.peekObservable(def);\n } else {\n defVal = themes[scheme][themePath];\n }\n\n if (!!nullIfEqual) {\n if (value == defVal) target(null);\n else target(value);\n } else {\n var current = ko.utils.peekObservable(target);\n if (value != defVal || current !== null) target(value);\n }\n\n }\n });\n return res;\n};\n\nvar _nextVariantFunction = function(ko, prop, variants) {\n var currentValue = ko.utils.unwrapObservable(prop);\n var variantValue;\n\n for (var i = 0; i < variants.length; i++) {\n variantValue = ko.utils.peekObservable(variants[i]);\n if (variantValue == currentValue) break;\n }\n\n if (i == variants.length) {\n console.warn(\"Didn't find a variant!\", prop, currentValue, variants);\n i = variants.length - 1;\n }\n\n var nextVariant = i + 1;\n if (nextVariant == variants.length) nextVariant = 0;\n var nextValue = ko.utils.peekObservable(variants[nextVariant]);\n\n prop(nextValue);\n};\n\nvar _getVariants = function(def) {\n var variantProp = def._variant;\n var variantOptions;\n if (typeof def[variantProp] !== 'object' || typeof def[variantProp]._widget === 'undefined' || (typeof def[variantProp]._options !== 'string' && def[variantProp]._widget !== 'boolean')) {\n console.error(\"Unexpected variant declaration\", variantProp, def[variantProp]);\n throw \"Unexpected variant declaration: cannot find property \" + variantProp + \" or its _options string and it is not a boolean\";\n }\n // TODO I read the \"keys\" but this is not 100% correct because they are not garanteed to be sorted as in declaration\n if (typeof def[variantProp]._options == 'string') {\n variantOptions = Object.keys(_getOptionsObject(def[variantProp]._options));\n } else {\n variantOptions = [true, false];\n }\n return variantOptions;\n};\n\nvar _makeComputedFunction = function(def, defs, thms, ko, contentModel, isContent, t) {\n if (typeof def == 'undefined') {\n if (typeof ko.utils.unwrapObservable(t).type === 'undefined') {\n console.log(\"TODO ERROR Found a non-typed def \", def, t);\n throw \"Found a non-typed def \" + def;\n }\n var type = ko.utils.unwrapObservable(ko.utils.unwrapObservable(t).type);\n def = defs[type];\n if (typeof def !== 'object') console.log(\"TODO ERROR Found a non-object def \", def, \"for\", type);\n }\n\n if (typeof contentModel == 'undefined' && typeof isContent != 'undefined' && isContent) {\n contentModel = t;\n }\n\n var selfPath = '$root.content().';\n\n var pp = def._globalStyles;\n if (typeof pp != 'undefined')\n for (var p in pp)\n if (pp.hasOwnProperty(p)) {\n var schemePathOrig = '$root.content().theme().scheme';\n var schemePath, vm, path;\n\n if (pp[p].substr(0, selfPath.length) == selfPath) {\n path = pp[p].substr(selfPath.length);\n vm = contentModel;\n } else {\n throw \"UNEXPECTED globalStyle path (\" + pp[p] + \") outside selfPath (\" + selfPath + \")\";\n }\n if (schemePathOrig.substr(0, selfPath.length) == selfPath) {\n schemePath = schemePathOrig.substr(selfPath.length);\n } else {\n console.log(\"IS THIS CORRECT?\", schemePathOrig, selfPath);\n schemePath = schemePathOrig;\n }\n\n var schemeSelector = vm;\n\n var pathParts = path.split('().');\n var themePath = '';\n var skip = true;\n for (var i = 0; i < pathParts.length; i++) {\n vm = ko.utils.unwrapObservable(vm)[pathParts[i]];\n // ugly thing to find the path to the schema color property (sometimes we have theme.bodyTheme, some other we have content.theme.bodyTheme...)\n if (skip) {\n if (pathParts[i] == 'theme') skip = false;\n } else {\n if (themePath.length > 0) themePath += '.';\n themePath += pathParts[i];\n }\n }\n\n var schemeParts = schemePath.split('().');\n for (var i3 = 0; i3 < schemeParts.length; i3++) {\n schemeSelector = ko.utils.unwrapObservable(schemeSelector)[schemeParts[i3]];\n }\n\n var nullIfEqual = true;\n var tParts = p.split('.');\n var target = t;\n for (var i2 = 0; i2 < tParts.length; i2++) {\n target = ko.utils.unwrapObservable(target)[tParts[i2]];\n }\n\n if (!ko.isObservable(target)) throw \"Unexpected non observable target \" + p + \"/\" + themePath;\n\n target._defaultComputed = _makeComputed(target, vm, nullIfEqual, schemeSelector, themePath, thms);\n }\n\n if (typeof def._variant != 'undefined') {\n var pParts = def._variant.split('.');\n // looks in t and not contentModel because variants are declared on single blocks.\n var pTarget = t;\n var pParent = ko.utils.unwrapObservable(t);\n for (var i4 = 0; i4 < pParts.length; i4++) {\n pTarget = ko.utils.unwrapObservable(pTarget)[pParts[i4]];\n }\n if (typeof pTarget._defaultComputed != 'undefined') {\n console.log(\"Found variant on a style property: beware variants should be only used on content properties because they don't match the theme fallback behaviour\", def._variant);\n pTarget = pTarget._defaultComputed;\n }\n if (typeof pTarget == 'undefined') {\n console.log(\"ERROR looking for variant target\", def._variant, t);\n throw \"ERROR looking for variant target \" + def._variant;\n }\n pParent._nextVariant = _nextVariantFunction.bind(pTarget, ko, pTarget, _getVariants(def));\n }\n\n for (var prop2 in def)\n if (def.hasOwnProperty(prop2)) {\n var val = def[prop2];\n if (typeof val == 'object' && val !== null && typeof val._context != 'undefined' && val._context == 'block') {\n var propVm = contentModel[prop2]();\n var newVm = _makeComputedFunction(defs[prop2], defs, thms, ko, contentModel, isContent, propVm);\n t[prop2](newVm);\n } else if (typeof val == 'object' && val !== null && val.type == 'blocks') {\n var mainVm = contentModel[prop2]();\n var blocksVm = mainVm.blocks();\n var oldBlock, blockType, newBlock;\n for (var ib = 0; ib < blocksVm.length; ib++) {\n oldBlock = ko.utils.unwrapObservable(blocksVm[ib]);\n blockType = ko.utils.unwrapObservable(oldBlock.type);\n newBlock = _makeComputedFunction(defs[blockType], defs, thms, ko, contentModel, isContent, oldBlock);\n blocksVm[ib](newBlock);\n }\n\n var blocksObs = mainVm.blocks;\n\n _augmentBlocksObservable(blocksObs, _blockInstrumentFunction.bind(mainVm, undefined, defs, thms, ko, undefined, contentModel, isContent));\n\n contentModel[prop2]._wrap = _makeBlocksWrap.bind(contentModel[prop2], blocksObs._instrumentBlock);\n contentModel[prop2]._unwrap = _unwrap.bind(contentModel[prop2]);\n }\n }\n\n return t;\n};\n\nvar _augmentBlocksObservable = function(blocksObs, instrument) {\n blocksObs._instrumentBlock = instrument;\n if (typeof blocksObs.origPush == 'undefined') {\n blocksObs.origPush = blocksObs.push;\n blocksObs.push = _makePush.bind(blocksObs);\n blocksObs.origSplice = blocksObs.splice;\n blocksObs.splice = _makeSplice.bind(blocksObs);\n }\n};\n\nvar _makeBlocksWrap = function(instrument, inputModel) {\n var model = ko.toJS(inputModel);\n var input = model.blocks;\n model.blocks = [];\n var res = kowrap.fromJS(model, undefined, true)();\n _augmentBlocksObservable(res.blocks, instrument);\n for (var i = 0; i < input.length; i++) {\n var obj = ko.toJS(input[i]);\n // console.log(\"_makeBlocksWrap set blockId\", obj.id, 'block_'+i);\n obj.id = 'block_' + i;\n res.blocks.push(obj);\n }\n this(res);\n};\n\nvar _makePush = function() {\n if (arguments.length > 1) throw \"Array push with multiple arguments not implemented\";\n // unwrap observable blocks, otherwise visibility (dependency) handling breaks\n if (arguments.length > 0 && ko.isObservable(arguments[0])) {\n if (typeof arguments[0]._unwrap == 'function') {\n arguments[0] = arguments[0]._unwrap();\n } else {\n console.log(\"WARN: pushing observable with no _unwrap function (TODO remove me, expected condition)\");\n }\n }\n if (!ko.isObservable(arguments[0])) {\n var instrumented = this._instrumentBlock(arguments[0]);\n return this.origPush.apply(this, [instrumented]);\n } else {\n return this.origPush.apply(this, arguments);\n }\n};\n\nvar _makeSplice = function() {\n if (arguments.length > 3) throw \"Array splice with multiple objects not implemented\";\n if (arguments.length > 2 && ko.isObservable(arguments[2])) {\n if (typeof arguments[2]._unwrap == 'function') {\n arguments[2] = arguments[2]._unwrap();\n } else {\n console.log(\"WARN: splicing observable with no _unwrap function (TODO remove me, expected condition)\");\n }\n }\n if (arguments.length > 2 && !ko.isObservable(arguments[2])) {\n var instrumented = this._instrumentBlock(arguments[2]);\n return this.origSplice.apply(this, [arguments[0], arguments[1], instrumented]);\n } else {\n return this.origSplice.apply(this, arguments);\n }\n};\n\n// def, defs and themes are bound in \"_modelInstrument\" while the next parameters are exposed by this module\nvar _blockInstrumentFunction = function(def, defs, themes, knockout, self, modelContent, isContent, self2) {\n // ugly: sometimes we have to bind content but not self, so we repeat self at the end as \"self2\"\n if (typeof self == 'undefined') self = self2;\n\n var computedFunctions;\n computedFunctions = {\n '': _makeComputedFunction.bind(self, def, defs, themes, knockout, modelContent, isContent)\n };\n\n var res = kowrap.fromJS(self, computedFunctions, true);\n res._unwrap = _unwrap.bind(res);\n return res;\n};\n\nvar _wrap = function(instrument, unwrapped) {\n var newContent = ko.utils.unwrapObservable(instrument(ko, unwrapped, undefined, true));\n this(newContent);\n};\n\nvar _unwrap = function() {\n return ko.toJS(this);\n};\n\nvar _modelInstrument = function(model, modelDef, defs) {\n var _instrument = _blockInstrumentFunction.bind(undefined, modelDef, defs, defs['themes']);\n var res = _instrument(ko, model, undefined, true);\n // res._instrument = _instrument;\n res._wrap = _wrap.bind(res, _instrument);\n res._unwrap = _unwrap.bind(res);\n return res;\n};\n\nmodule.exports = _modelInstrument;",
|
|
137
|
+
"var tinycolor = require('tinycolor');\n\nfunction Color(tinycolor) {\n this.getBrightness = function(color) {\n return tinycolor(color).getBrightness();\n };\n this.isLight = function(color) {\n return tinycolor(color).isLight();\n };\n this.isDark = function(color) {\n return tinycolor(color).isDark();\n };\n this.getLuminance = function(color) {\n return tinycolor(color).getLuminance();\n };\n\n\n this.lighten = function(color, amount) {\n return tinycolor(color).lighten(amount).toHexString();\n };\n this.brighten = function(color, amount) {\n return tinycolor(color).brighten(amount).toHexString();\n };\n this.darken = function(color, amount) {\n return tinycolor(color).darken(amount).toHexString();\n };\n this.desaturate = function(color, amount) {\n return tinycolor(color).desaturate(amount).toHexString();\n };\n this.saturate = function(color, amount) {\n return tinycolor(color).saturate(amount).toHexString();\n };\n this.greyscale = function(color) {\n return tinycolor(color).greyscale().toHexString();\n };\n this.spin = function(color, amount) {\n return tinycolor(color).spin(amount).toHexString();\n };\n this.complement = function(color) {\n return tinycolor(color).complement().toHexString();\n };\n\n this.mix = tinycolor.mix;\n this.readability = tinycolor.readability;\n this.isReadable = tinycolor.isReadable;\n this.mostReadable = tinycolor.mostReadable;\n}\n\nvar colorPlugin = function(vm) {\n global.Color = new Color(tinycolor);\n};\n\nmodule.exports = colorPlugin;",
|
|
138
|
+
"\"use strict\";\n/* global global: false */\nvar console = require(\"console\");\nvar $ = require(\"jquery\");\nvar inlineDocument = require(\"juice/lib/inline\")({}).inlineDocument;\n\nvar inlinerPlugin = function(vm) {\n vm.inline = function(doc) {\n // tinymce may have added style attributes to elements that will also have global styles to be inlined\n $('[style]:not([replacedstyle])', doc).each(function(index, el) {\n var $el = $(el);\n $el.attr('replacedstyle', $el.attr('style'));\n });\n\n var style = [];\n $('style[data-inline=\"true\"]', doc).each(function(index, element) {\n var content = $(element).html();\n content = content.replace(/<!-- ko ((?!--).)*? -->/g, ''); // this replaces the above with a more formal (but slower) solution\n content = content.replace(/<!-- \\/ko -->/g, '');\n style.push(content);\n $(element).removeAttr('data-inline');\n });\n var styleText = style.join(\"\\n\");\n var $context = function(selector, context) {\n if (typeof context == 'undefined') context = doc;\n return $(selector, context);\n };\n $context.root = function() {\n return $(':root', doc);\n };\n inlineDocument($context, styleText, { styleAttributeName: 'replacedstyle' });\n };\n};\n\nmodule.exports = inlinerPlugin;",
|
|
139
|
+
"\"use strict\";\n/* global global: false */\nvar console = require(\"console\");\nvar ko = require(\"knockout\");\nvar $ = require(\"jquery\");\n\nvar lsLoader = function(hash_key, emailProcessorBackend) {\n var mdStr = global.localStorage.getItem(\"metadata-\" + hash_key);\n if (mdStr !== null) {\n var model;\n var td = global.localStorage.getItem(\"template-\" + hash_key);\n if (td !== null) model = JSON.parse(td);\n var md = JSON.parse(mdStr);\n return {\n metadata: md,\n model: model,\n extension: lsCommandPluginFactory(md, emailProcessorBackend)\n };\n } else {\n throw \"Cannot find stored data for \"+hash_key;\n }\n};\n\nvar lsCommandPluginFactory = function(md, emailProcessorBackend) {\n var commandsPlugin = function(mdkey, mdname, viewModel) {\n\n // console.log(\"loading from metadata\", md, model);\n var saveCmd = {\n name: 'Save', // l10n happens in the template\n enabled: ko.observable(true)\n };\n saveCmd.execute = function() {\n saveCmd.enabled(false);\n viewModel.metadata.changed = Date.now();\n if (typeof viewModel.metadata.key == 'undefined') {\n console.warn(\"Unable to find ket in metadata object...\", viewModel.metadata);\n viewModel.metadata.key = mdkey;\n }\n global.localStorage.setItem(\"metadata-\" + mdkey, viewModel.exportMetadata());\n global.localStorage.setItem(\"template-\" + mdkey, viewModel.exportJSON());\n saveCmd.enabled(true);\n };\n var testCmd = {\n name: 'Test', // l10n happens in the template\n enabled: ko.observable(true)\n };\n var downloadCmd = {\n name: 'Download', // l10n happens in the template\n enabled: ko.observable(true)\n };\n testCmd.execute = function() {\n testCmd.enabled(false);\n var email = global.localStorage.getItem(\"testemail\");\n if (email === null || email == 'null') email = viewModel.t('Insert here the recipient email address');\n email = global.prompt(viewModel.t(\"Test email address\"), email);\n if (email.match(/@/)) {\n global.localStorage.setItem(\"testemail\", email);\n console.log(\"TODO testing...\", email);\n var postUrl = emailProcessorBackend ? emailProcessorBackend : '/dl/';\n var post = $.post(postUrl, {\n action: 'email',\n rcpt: email,\n subject: \"[test] \" + mdkey + \" - \" + mdname,\n html: viewModel.exportHTML()\n }, null, 'html');\n post.fail(function() {\n console.log(\"fail\", arguments);\n viewModel.notifier.error(viewModel.t('Unexpected error talking to server: contact us!'));\n });\n post.success(function() {\n console.log(\"success\", arguments);\n viewModel.notifier.success(viewModel.t(\"Test email sent...\"));\n });\n post.always(function() {\n testCmd.enabled(true);\n });\n } else {\n global.alert(viewModel.t('Invalid email address'));\n testCmd.enabled(true);\n }\n };\n downloadCmd.execute = function() {\n downloadCmd.enabled(false);\n viewModel.notifier.info(viewModel.t(\"Downloading...\"));\n viewModel.exportHTMLtoTextarea('#downloadHtmlTextarea');\n var postUrl = emailProcessorBackend ? emailProcessorBackend : '/dl/';\n global.document.getElementById('downloadForm').setAttribute(\"action\", postUrl);\n global.document.getElementById('downloadForm').submit();\n downloadCmd.enabled(true);\n };\n\n viewModel.save = saveCmd;\n viewModel.test = testCmd;\n viewModel.download = downloadCmd;\n }.bind(undefined, md.key, md.name);\n\n return commandsPlugin;\n};\n\nmodule.exports = lsLoader;",
|
|
140
|
+
"\"use strict\";\n\nrequire(\"knockout-sortable\");\n\nrequire(\"./bindings/jqueryui-spinner.js\");\nrequire(\"./bindings/jqueryui-tabs.js\");\nrequire(\"./bindings/colorpicker.js\");\nrequire(\"./bindings/blocks.js\");\nrequire(\"./bindings/csstext.js\");\nrequire(\"./bindings/bind-iframe.js\");\nrequire(\"./bindings/droppable.js\");\nrequire(\"./bindings/fileupload.js\");\nrequire(\"./bindings/virtuals.js\");\nrequire(\"./bindings/wysiwygs.js\");\nrequire(\"./bindings/scrollfix.js\");\nrequire(\"./bindings/if-subs.js\");\nrequire(\"./bindings/extsortables.js\");\nrequire(\"./bindings/eventable.js\");\nrequire(\"./bindings/tooltips.js\");\nrequire(\"./bindings/extender-pagination.js\");\nrequire(\"./bindings/validated-value.js\");\nrequire(\"./bindings/scrollintoview.js\");",
|
|
141
|
+
"\"use strict\";\n/* global global: false */\n\nvar $ = require(\"jquery\");\nvar ko = require(\"knockout\");\nvar kojqui = require(\"knockout-jqueryui\"); // just for the widget plugins\nvar templateConverter = require(\"./converter/main.js\");\nvar console = require(\"console\");\nvar initializeViewmodel = require(\"./viewmodel.js\");\nvar templateSystem = require('./bindings/choose-template.js');\n\n// call a given method on every plugin implementing it.\n// supports a \"reverse\" parameter to call the methods from the last one to the first one.\nvar pluginsCall = function(plugins, methodName, args, reverse) {\n var start, end, diff, res, results;\n results = [];\n if (typeof reverse !== 'undefined' && reverse) {\n start = plugins.length - 1;\n end = 0;\n diff = -1;\n } else {\n start = 0;\n end = plugins.length - 1;\n diff = 1;\n }\n for (var i = start; i != end + diff; i += diff) {\n if (typeof plugins[i][methodName] !== 'undefined') {\n res = plugins[i][methodName].apply(plugins[i], args);\n if (typeof res !== 'undefined') results.push(res);\n }\n }\n return results;\n};\n\n// workaround for knockout-jqueryui's buttonset/button disposal:\n// https://github.com/gvas/knockout-jqueryui/issues/25\nvar origDisposeCallback = ko.utils.domNodeDisposal.addDisposeCallback;\nko.utils.domNodeDisposal.addDisposeCallback = function(node, callback) {\n var newCallback = function(node) {\n try {\n callback(node);\n } catch (e) {\n console.warn(\"Caught unexpected dispose callback exception\", e);\n }\n };\n origDisposeCallback(node, newCallback);\n};\n\nvar bindingPluginMaker = function(performanceAwareCaller) {\n return {\n viewModel: function(viewModel) {\n try {\n performanceAwareCaller('applyBindings', ko.applyBindings.bind(undefined, viewModel));\n } catch (err) {\n console.warn(err, err.stack);\n throw err;\n }\n },\n dispose: function() {\n try {\n performanceAwareCaller('unapplyBindings', ko.cleanNode.bind(this, global.document.body));\n } catch (err) {\n console.warn(err, err.stack);\n throw err;\n }\n }\n };\n};\n\nvar templateCreator = function(templatePlugin, htmlOrElement, optionalName, templateMode) {\n var tmpName = optionalName;\n if (typeof optionalName != 'undefined' && typeof templateMode != 'undefined') {\n if (typeof htmlOrElement != 'object' || htmlOrElement.tagName.toLowerCase() != 'replacedhtml') tmpName += '-' + templateMode;\n }\n\n while (typeof tmpName == 'undefined' || tmpName === null || templatePlugin.exists(tmpName)) {\n tmpName = 'anonymous-' + Math.floor((Math.random() * 100000) + 1);\n }\n\n if (typeof htmlOrElement == 'object' && htmlOrElement.tagName.toLowerCase() == 'replacedhtml') {\n var $el = $(htmlOrElement);\n var $head = $('replacedhead', $el);\n var $body = $('replacedbody', $el);\n templatePlugin.adder(tmpName + '-head', $head.html() || '');\n templatePlugin.adder(tmpName + '-show', $body.html() || '');\n templatePlugin.adder(tmpName + '-preview', $el.html());\n templatePlugin.adder(tmpName + '-wysiwyg', $el.html());\n\n // $head.attr('data-bind', 'block: content');\n $head.children().detach();\n $head.html(\"<!-- ko block: content --><!-- /ko -->\");\n $head.before('<!-- ko withProperties: { templateMode: \\'head\\' } -->');\n $head.after('<!-- /ko -->');\n $body.html(\"<!-- ko block: content --><!-- /ko -->\");\n\n templatePlugin.adder(tmpName + '-iframe', $el[0].outerHTML);\n\n } else if (typeof htmlOrElement == 'object') {\n templatePlugin.adder(tmpName, htmlOrElement.outerHTML);\n } else {\n templatePlugin.adder(tmpName, htmlOrElement);\n }\n\n return tmpName;\n};\n\n// Adapter to transform \"viewModel plugins\" into more generic plugins.\nfunction _viewModelPluginInstance(pluginFunction) {\n var instance;\n return {\n viewModel: function(viewModel) {\n instance = pluginFunction(viewModel);\n },\n init: function() {\n if (typeof instance !== 'undefined' && typeof instance.init !== 'undefined') instance.init();\n },\n dispose: function() {\n if (typeof instance !== 'undefined' && typeof instance.dispose !== 'undefined') instance.dispose();\n }\n };\n}\n\nvar _templateUrlConverter = function(basePath, url) {\n if (!url.match(/^[^\\/]*:/) && !url.match(/^\\//) && !url.match(/^\\[/) && !url.match(/^#?$/)) {\n // TODO this could be smarter joining the urls...\n return basePath + url;\n } else {\n return null;\n }\n};\n\nvar templateLoader = function(performanceAwareCaller, templateFileName, templateMetadata, jsorjson, extensions, galleryUrl) {\n var templateFile = typeof templateFileName == 'string' ? templateFileName : templateMetadata.template;\n var templatePath = \"./\";\n var p = templateFile.lastIndexOf('/');\n if (p != -1) {\n templatePath = templateFile.substr(0, p + 1);\n }\n\n var templateUrlConverter = _templateUrlConverter.bind(undefined, templatePath);\n\n var metadata;\n if (typeof templateMetadata == 'undefined') {\n metadata = {\n template: templateFile,\n // TODO l10n?\n name: 'No name',\n created: Date.now()\n };\n } else {\n metadata = templateMetadata;\n }\n\n $.get(templateFile, function(templatecode) {\n var res = templateCompiler(performanceAwareCaller, templateUrlConverter, \"template\", templatecode, jsorjson, metadata, extensions, galleryUrl);\n res.init();\n });\n};\n\nvar templateCompiler = function(performanceAwareCaller, templateUrlConverter, templateName, templatecode, jsorjson, metadata, extensions, galleryUrl) {\n // we strip content before <html> tag and after </html> because jquery doesn't parse it.\n // we'll keep it \"raw\" and use it in the preview/output methods.\n var res = templatecode.match(/^([\\S\\s]*)([<]html[^>]*>[\\S\\s]*<\\/html>)([\\S\\s]*)$/i);\n if (res === null) throw \"Unable to find <html> opening and closing tags in the template\";\n var prefix = res[1];\n // we parse the html content after replacing the tag name for html/head/body so to avoid jquery issues in parsing.\n var basicStructure = { '<html': 0, '<head': 0, '<body': 0, '</html': 0, '</body': 0, '</head': 0 };\n var html = res[2].replace(/(<\\/?)(html|head|body)([^>]*>)/gi, function(match, p1, p2, p3) {\n basicStructure[(p1+p2).toLowerCase()] += 1;\n return p1 + 'replaced' + p2 + p3;\n });\n for (var ele in basicStructure) if (basicStructure.hasOwnProperty(ele)) if (basicStructure[ele] != 1) {\n if (basicStructure[ele] === 0) throw \"ERROR: missing mandatory element \"+ele+\">\";\n if (basicStructure[ele] > 1) throw \"ERROR: multiple element \"+ele+\"> occourences are not supported (found \"+basicStructure[ele]+\" occourences)\";\n }\n var postfix = res[3];\n var blockDefs = [];\n var enableUndo = true;\n var enableRecorder = true;\n var baseThreshold = '+$root.contentListeners()';\n\n var plugins = [];\n\n if (typeof extensions !== 'undefined') {\n for (var i = 0; i < extensions.length; i++) {\n if (typeof extensions[i] == 'function') {\n plugins.push(_viewModelPluginInstance(extensions[i]));\n } else {\n plugins.push(extensions[i]);\n }\n }\n }\n\n var createdTemplates = [];\n var templatesPlugin = {\n adder: function(id, html) {\n if (typeof html !== 'string') throw \"Template system: cannot create new template \" + id;\n var trash = html.match(/(data)?-ko-[^ =:]*/g);\n if (trash) {\n console.error(\"ERROR: found unexpected -ko- attribute in compiled template\", id, \", you probably mispelled it:\", trash);\n }\n templateSystem.addTemplate(id, html);\n createdTemplates.push(id);\n },\n exists: function(id) {\n var el = templateSystem.getTemplateContent(id);\n if (typeof el !== 'undefined') return true;\n else return false;\n },\n dispose: function() {\n for (var i = createdTemplates.length - 1; i >= 0; i--) {\n templateSystem.removeTemplate(createdTemplates[i]);\n }\n }\n };\n\n ko.bindingHandlers['block'].templateExists = templatesPlugin.exists;\n\n // templatecreator tracks created template (via templateAdder) so to be able to dispose them later\n var myTemplateCreator = templateCreator.bind(undefined, templatesPlugin);\n\n // first pass: we \"compile\" the template into a termplateDef object\n var templateDef = performanceAwareCaller('translateTemplate', templateConverter.translateTemplate.bind(undefined, templateName, html, templateUrlConverter, myTemplateCreator));\n\n // second pass: given the templateDef we create a base content model object for this template.\n var content = performanceAwareCaller('generateModel', templateConverter.wrappedResultModel.bind(undefined, templateDef));\n\n // third pass: we create \"style/content editors\" for every block\n var widgets = {};\n var widgetPlugins = pluginsCall(plugins, 'widget', [$, ko, kojqui]);\n for (var wi = 0; wi < widgetPlugins.length; wi++) {\n widgets[widgetPlugins[wi].widget] = widgetPlugins[wi];\n }\n blockDefs.push.apply(blockDefs, performanceAwareCaller('generateEditors', templateConverter.generateEditors.bind(undefined, templateDef, widgets, templateUrlConverter, myTemplateCreator, baseThreshold)));\n\n var incompatibleTemplate = false;\n if (typeof jsorjson !== 'undefined' && jsorjson !== null) {\n var unwrapped;\n if (typeof jsorjson == 'string') {\n unwrapped = ko.utils.parseJson(jsorjson);\n } else {\n unwrapped = jsorjson;\n }\n\n // we run a basic compatibility check between the content-model we expect and the initialization model\n var checkModelRes = performanceAwareCaller('checkModel', templateConverter.checkModel.bind(undefined, content._unwrap(), blockDefs, unwrapped));\n // if checkModelRes is 1 then the model is not fully compatible but we fixed it\n if (checkModelRes == 2) {\n console.error(\"Trying to compile an incompatible template version!\", content._unwrap(), blockDefs, unwrapped);\n incompatibleTemplate = true;\n }\n\n try {\n content._wrap(unwrapped);\n } catch (ex) {\n console.error(\"Unable to inject model content!\", ex);\n incompatibleTemplate = true;\n }\n }\n\n // This build the template for the preview/output, but concatenating prefix, template and content and stripping the \"replaced\" prefix added to \"problematic\" tag (html/head/body)\n var iframeTpl = prefix + templateSystem.getTemplateContent(templateName + '-iframe').replace(/(<\\/?)replaced(html|head|body)([^>]*>)/gi, function(match, p1, p2, p3) {\n return p1 + p2 + p3;\n }) + postfix;\n\n // store this so to restore it on disposale\n var origiFrameTpl = ko.bindingHandlers.bindIframe.tpl;\n ko.bindingHandlers.bindIframe.tpl = iframeTpl;\n var iFramePlugin = {\n dispose: function() {\n ko.bindingHandlers.bindIframe.tpl = origiFrameTpl;\n }\n };\n\n plugins.push(iFramePlugin);\n plugins.push(templatesPlugin);\n\n // initialize the viewModel object based on the content model.\n var viewModel = performanceAwareCaller('initializeViewmodel', initializeViewmodel.bind(this, content, blockDefs, templateUrlConverter, galleryUrl));\n\n viewModel.metadata = metadata;\n // let's run some version check on template and editor used to build the model being loaded.\n var editver = '0.16.0';\n if (typeof viewModel.metadata.editorversion !== 'undefined' && viewModel.metadata.editorversion !== editver) {\n console.warn(\"The model being loaded has been created with an older editor version\", viewModel.metadata.editorversion, \"vs\", editver);\n }\n viewModel.metadata.editorversion = editver;\n\n if (typeof templateDef.version !== 'undefined') {\n if (typeof viewModel.metadata.templateversion !== 'undefined' && viewModel.metadata.templateversion !== templateDef.version) {\n console.error(\"The model being loaded has been created with a different template version\", templateDef.version, \"vs\", viewModel.metadata.templateversion);\n }\n viewModel.metadata.templateversion = templateDef.version;\n }\n\n templateSystem.init();\n\n // everything's ready, start knockout bindings.\n plugins.push(bindingPluginMaker(performanceAwareCaller));\n\n pluginsCall(plugins, 'viewModel', [viewModel]);\n\n if (incompatibleTemplate) {\n $('#incompatible-template').dialog({\n modal: true,\n appendTo: '#mo-body',\n buttons: {\n Ok: function() {\n $(this).dialog(\"close\");\n }\n }\n });\n }\n\n return {\n model: viewModel,\n init: function() {\n pluginsCall(plugins, 'init', undefined, true);\n },\n dispose: function() {\n pluginsCall(plugins, 'dispose', undefined, true);\n }\n };\n\n};\n\n\nvar checkFeature = function(feature, func) {\n if (!func()) {\n console.warn(\"Missing feature\", feature);\n throw \"Missing feature \" + feature;\n }\n};\n\nvar isCompatible = function() {\n try {\n // window.msMatchMedia would match also IE9\n // IE9 wouldn't be so hard to support, but it doesn't worth it. (preview iframe and automatic scroll are 2 things not working in IE9)\n checkFeature('matchMedia', function() {\n return typeof global.matchMedia != 'undefined';\n });\n checkFeature('XMLHttpRequest 2', function() {\n return 'XMLHttpRequest' in global && 'withCredentials' in new global.XMLHttpRequest();\n });\n checkFeature('ES5 strict', function() {\n return function() { /* \"use strict\";*/\n return typeof this == 'undefined';\n }();\n });\n checkFeature('CSS borderRadius', function() {\n return typeof global.document.body.style['borderRadius'] != 'undefined';\n });\n checkFeature('CSS boxShadow', function() {\n return typeof global.document.body.style['boxShadow'] != 'undefined';\n });\n checkFeature('CSS boxSizing', function() {\n return typeof global.document.body.style['boxSizing'] != 'undefined';\n });\n checkFeature('CSS backgroundSize', function() {\n return typeof global.document.body.style['backgroundSize'] != 'undefined';\n });\n checkFeature('CSS backgroundOrigin', function() {\n return typeof global.document.body.style['backgroundOrigin'] != 'undefined';\n });\n checkBadBrowserExtensions();\n return true;\n } catch (exception) {\n return false;\n }\n};\n\nvar checkBadBrowserExtensions = function() {\n var id = 'checkbadbrowsersframe';\n var origTpl = ko.bindingHandlers.bindIframe.tpl;\n ko.bindingHandlers.bindIframe.tpl = \"<!DOCTYPE html>\\r\\n<html>\\r\\n<head><title>A</title>\\r\\n</head>\\r\\n<body><p style=\\\"color: blue\\\" align=\\\"right\\\" data-bind=\\\"style: { color: 'red' }\\\">B</p><div data-bind=\\\"text: content\\\"></div></body>\\r\\n</html>\\r\\n\";\n $('body').append('<iframe id=\"' + id + '\" data-bind=\"bindIframe: $data\"></iframe>');\n var frameEl = global.document.getElementById(id);\n ko.applyBindings({ content: \"dummy content\" }, frameEl);\n // Obsolete method didn't work on IE11 when using \"HTML5 doctype\":\n // var docType = new XMLSerializer().serializeToString(global.document.doctype);\n var node = frameEl.contentWindow.document.doctype;\n var docType = \"<!DOCTYPE \" + node.name +\n (node.publicId ? ' PUBLIC \"' + node.publicId + '\"' : '') +\n (!node.publicId && node.systemId ? ' SYSTEM' : '') +\n (node.systemId ? ' \"' + node.systemId + '\"' : '') + '>';\n var content = docType + \"\\n\" + frameEl.contentWindow.document.documentElement.outerHTML;\n ko.cleanNode(frameEl);\n ko.removeNode(frameEl);\n ko.bindingHandlers.bindIframe.tpl = origTpl;\n\n var expected = \"<!DOCTYPE html>\\n<html><head><title>A</title>\\n</head>\\n<body><p align=\\\"right\\\" style=\\\"color: red;\\\" data-bind=\\\"style: { color: 'red' }\\\">B</p><div data-bind=\\\"text: content\\\">dummy content</div>\\n\\n</body></html>\";\n var expected2 = \"<!DOCTYPE html>\\n<html><head><title>A</title>\\n</head>\\n<body><p style=\\\"color: red;\\\" data-bind=\\\"style: { color: 'red' }\\\" align=\\\"right\\\">B</p><div data-bind=\\\"text: content\\\">dummy content</div>\\n\\n</body></html>\";\n var expected3 = \"<!DOCTYPE html>\\n<html><head><title>A</title>\\n</head>\\n<body><p style=\\\"color: red;\\\" align=\\\"right\\\" data-bind=\\\"style: { color: 'red' }\\\">B</p><div data-bind=\\\"text: content\\\">dummy content</div>\\n\\n</body></html>\";\n if (expected !== content && expected2 !== content && expected3 !== content) {\n console.info(\"BadBrowser.FrameContentCheck\", content.length, expected.length, expected2.length, expected3.length, content == expected, content == expected2, content == expected3);\n console.info(content);\n throw \"Unexpected frame content. Misbehaving browser: \"+content.length+\"/\"+expected.length+\"/\"+expected2.length+\"/\"+expected3.length;\n }\n};\n\nvar fixPageEvents = function() {\n // This is global code to prevent dragging/dropping in the page where we don't deal with it.\n // IE8 doesn't have window.addEventListener, but doesn't support drag&drop too.\n if (global.addEventListener) {\n // prevent generic file droppping in the page\n global.addEventListener(\"drag\", function(e) {\n // console.log(\"browser is using drag listener on window\");\n e = e || global.event;\n e.preventDefault();\n }, false);\n global.addEventListener(\"dragstart\", function(e) {\n // console.log(\"browser is using dragstart listener on window\");\n e = e || global.event;\n e.preventDefault();\n }, false);\n global.addEventListener(\"dragover\", function(e) {\n // this is called on mouse move on every supported browser.\n // console.log(\"browser is using dragover listener on window\");\n e = e || global.event;\n e.preventDefault();\n }, false);\n global.addEventListener(\"drop\", function(e) {\n // console.log(\"browser is using drop listener on window\");\n e = e || global.event;\n e.preventDefault();\n }, false);\n global.document.body.addEventListener('drop', function(e) {\n // I browser supportati entrato tutti qui quando si droppa qualcosa sul body\n // console.log(\"browser is using drop listener on body tag\");\n e.preventDefault();\n }, false);\n }\n if (global.document.ondragstart) {\n global.document.ondragstart = function() {\n // console.log(\"browser called ondragstart. return false!\");\n return false;\n };\n }\n};\n\nmodule.exports = {\n compile: templateCompiler,\n load: templateLoader,\n isCompatible: isCompatible,\n fixPageEvents: fixPageEvents\n};",
|
|
142
|
+
"\"use strict\";\n\nvar console = require(\"console\");\n\nvar _call = function(whatToCall) {\n return whatToCall();\n};\n\nvar logs = [];\n\nvar _timedCall = function(name, whatToCall) {\n var res;\n var start = new Date().getTime();\n if (typeof console == 'object' && console.time) console.time(name);\n res = _call(whatToCall);\n if (typeof console == 'object' && console.time) console.timeEnd(name);\n var diff = new Date().getTime() - start;\n if (typeof console == 'object' && !console.time) console.log(name, \"took\", diff, \"ms\");\n logs.push({\n name: name,\n time: diff\n });\n // max logs\n if (logs.length > 100) logs.unshift();\n return res;\n};\n\nmodule.exports = {\n timedCall: _timedCall,\n logs: logs\n};",
|
|
143
|
+
"\"use strict\";\n\nvar ko = require(\"knockout\");\nvar undoManager = require('knockout-undomanager');\nvar undoserializer = require(\"./undoserializer.js\");\n\nvar addUndoStackExtensionMaker = function(performanceAwareCaller) {\n return function(viewModel) {\n\n viewModel.contentListeners(viewModel.contentListeners() + 2);\n\n // TODO the labels should be computed observables (needs changes in undomanager projects)\n var undoRedoStack = undoManager(viewModel.content, {\n levels: 100,\n undoLabel: ko.computed(function() { return viewModel.t(\"Undo (#COUNT#)\"); }),\n redoLabel: ko.computed(function() { return viewModel.t(\"Redo\"); })\n });\n viewModel.undo = undoRedoStack.undoCommand;\n viewModel.undo.execute = performanceAwareCaller.bind(viewModel, 'undo', viewModel.undo.execute);\n viewModel.redo = undoRedoStack.redoCommand;\n viewModel.redo.execute = performanceAwareCaller.bind(viewModel, 'redo', viewModel.redo.execute);\n viewModel.undoReset = performanceAwareCaller.bind(viewModel, 'undoReset', undoRedoStack.reset);\n viewModel.setUndoModeMerge = undoRedoStack.setModeMerge;\n viewModel.setUndoModeOnce = undoRedoStack.setModeOnce;\n undoRedoStack.setModeIgnore();\n undoRedoStack.setUndoActionMaker(undoserializer.makeUndoAction.bind(undefined, viewModel.content));\n undoserializer.watchEnabled(true);\n\n return {\n pause: function() {\n undoRedoStack.setModeIgnore();\n },\n run: function() {\n undoRedoStack.setModeOnce();\n },\n init: function() {\n undoRedoStack.setModeOnce();\n },\n dispose: function() {\n viewModel.contentListeners(viewModel.contentListeners() - 2);\n undoserializer.watchEnabled(false);\n undoRedoStack.dispose();\n }\n };\n\n };\n};\n\nmodule.exports = addUndoStackExtensionMaker;",
|
|
144
|
+
"\"use strict\";\nvar ko = require(\"knockout\");\nvar console = require(\"console\");\n// This module deals with serialization/deserialization of a \"tree-path\" representing the path to reach the given leaf.\n// In order to be correctly serialized we have to move from \"reference\" to \"string\" and viceversa.\n\nvar _reference = function(model, path) {\n var p = 0;\n var p1, p2;\n var m = model;\n while (p < path.length) {\n switch (path.charAt(p)) {\n case '(':\n if (path.charAt(p + 1) == ')') {\n m = m();\n } else {\n // TODO error\n }\n p += 2;\n break;\n case '[':\n p2 = path.indexOf(']', p);\n m = m[path.substring(p + 1, p2)];\n p = p2 + 1;\n break;\n case '.':\n p1 = path.indexOf('(', p);\n if (p1 == -1) p1 = path.length;\n p2 = path.indexOf('[', p);\n if (p2 == -1) p2 = path.length;\n p2 = Math.min(p1, p2);\n m = m[path.substring(p + 1, p2)];\n p = p2;\n break;\n default:\n // TODO error\n }\n }\n return m;\n};\n\nvar _getPath = function(parents, child) {\n var path = \"\";\n var p;\n for (var k = 0; k <= parents.length; k++) {\n p = k < parents.length ? parents[k] : child;\n if (ko.isObservable(p)) path += '()';\n if (typeof p._fieldName !== 'undefined') {\n path += \".\" + p._fieldName;\n } else if (k > 0 && typeof parents[k - 1].pop == 'function') {\n var parentArray = ko.isObservable(parents[k - 1]) ? ko.utils.peekObservable(parents[k - 1]) : parents[k - 1];\n var pos = ko.utils.arrayIndexOf(parentArray, p);\n if (pos != -1) {\n path += \"[\" + pos + \"]\";\n } else {\n // NOTE this happen, sometimes when TinyMCE sends updates for objects already removed.\n console.error(\"Unexpected object not found in parent array\", parentArray, p, k, parents.length, ko.toJS(parentArray), ko.utils.unwrapObservable(p));\n throw \"Unexpected object not found in parent array\";\n }\n } else {\n console.error(\"Unexpected parent with no _fieldName and no parent array\", k, parents);\n throw \"Unexpected parent with no _fieldName and no parent array\";\n }\n }\n return path;\n};\n\nvar makeDereferencedUndoAction = function(undoFunc, model, path, value, item) {\n var child = _reference(model, path);\n undoFunc(child, value, item);\n};\n\nvar listener;\n\nvar _setListener = function(listenfunc) {\n listener = listenfunc;\n};\n\n/* dereferencing path and changing value with \"toJS\" */\nvar makeUndoActionDereferenced = function(model, undoFunc, parents, child, oldVal, item) {\n try {\n var path = _getPath(parents, child);\n\n // Transform actions in simple JS objects.\n if (typeof oldVal === 'object' || typeof oldVal === 'function') oldVal = ko.toJS(oldVal);\n if (typeof item !== 'undefined' && (typeof item.value === 'object' || typeof item.value === 'function')) {\n var newItem = ko.toJS(item);\n item = newItem;\n }\n\n if (typeof listener !== 'undefined') {\n try {\n listener(path, child, oldVal, item);\n } catch (e) {\n console.log(\"Undoserializer ignoring exception in listener callback\");\n }\n }\n\n return makeDereferencedUndoAction.bind(undefined, undoFunc, model, path, oldVal, item);\n } catch (e) {\n // NOTE this happens, from time to time, when TinyMCE sends updates for deleted content.\n console.error(\"Exception processing undo\", e, parents, child, item);\n }\n};\n\nvar watchEnabled;\nvar _watchEnabled = function(newVal) {\n if (typeof newVal !== 'undefined')\n watchEnabled = newVal;\n else\n return watchEnabled;\n};\n\nmodule.exports = {\n dereference: _getPath,\n reference: _reference,\n makeUndoAction: makeUndoActionDereferenced,\n setListener: _setListener,\n watchEnabled: _watchEnabled\n};",
|
|
145
|
+
"\"use strict\";\n/* global global: false */\n\nvar $ = require(\"jquery\");\nvar ko = require(\"knockout\");\nvar console = require(\"console\");\nvar performanceAwareCaller = require(\"./timed-call.js\").timedCall;\n\nvar toastr = require(\"toastr\");\ntoastr.options = {\n \"closeButton\": false,\n \"debug\": false,\n \"positionClass\": \"toast-bottom-full-width\",\n \"target\": \"#mo-body\",\n \"onclick\": null,\n \"showDuration\": \"300\",\n \"hideDuration\": \"1000\",\n \"timeOut\": \"5000\",\n \"extendedTimeOut\": \"1000\",\n \"showEasing\": \"swing\",\n \"hideEasing\": \"linear\",\n \"showMethod\": \"fadeIn\",\n \"hideMethod\": \"fadeOut\"\n};\n\n/* NOTE: translations moved to \"plugin\"\nvar strings = {\n 'show preview and send test': 'Visualizza una anteprima e fai un invio di test',\n // Strings for app.js\n 'Download': 'Download',\n 'Test': 'Test',\n 'Save': 'Salva',\n 'Downloading...': \"Download in corso...\",\n 'Invalid email address': \"Indirizzo email invalido\",\n \"Test email sent...\": \"Email di test inviata...\",\n 'Unexpected error talking to server: contact us!': 'Errore di comunicazione con il server: contattaci!',\n 'Insert here the recipient email address': 'Inserisci qui l\\'indirizzo email a cui spedire',\n \"Test email address\": \"Indirizzo email di test\",\n // viewModel\n 'Block removed: use undo button to restore it...': 'Blocco eliminato: usa il pulsante annulla per recuperarlo...',\n 'New block added after the selected one (__pos__)': 'Nuovo blocco aggiunto sotto a quello selezionato (__pos__)',\n 'New block added at the model bottom (__pos__)': 'Nuovo blocco aggiunto in fondo al modello (__pos__)',\n // undomain.js\n 'Undo (#COUNT#)': 'Annulla (#COUNT#)',\n 'Redo': 'Ripristina',\n // editor.js\n 'Selected element has no editable properties': 'L\\'elemento selezionato non fornisce proprietà editabili',\n 'This style is specific for this block: click here to remove the custom style and revert to the theme value': 'Questo stile è specifico di questo blocco: clicca qui per annullare lo stile personalizzato',\n 'Switch between global and block level styles editing': 'Permette di specificare se si vuole modificare lo stile generale o solamente quello specifico del blocco selezionato',\n // main.tpl.html\n 'Undo last operation': 'Annulla ultima operazione',\n 'Redo last operation': 'Ripeti operazione annullata',\n 'Show image gallery': 'Visualizza galleria immagini',\n 'Gallery': 'Galleria',\n 'Preview': 'Anteprima',\n 'Show live preview': 'Mostra anteprima live',\n 'Large screen': 'Schermo grande',\n 'Tablet': 'Tablet',\n 'Smartphone': 'Smartphone',\n 'Show preview and send test': 'Visualizza una anteprima e fai un invio di test',\n 'Download template': 'Scarica il template',\n 'Save template': 'Salva il template',\n 'Saved model is obsolete': 'Modello salvato obsoleto',\n '<p>The saved model has been created with a previous, non completely compatible version, of the template</p><p>Some content or style in the model <b>COULD BE LOST</b> if you will <b>save</b></p><p>Contact us for more informations!</p>': '<p>Il modello salvato è stato creato con una versione precedente del template non del tutto compatibile</p><p>Alcuni contenuti o stili del modello <b>POTREBBERO ESSERE PERSI</b> se procederai e deciderai di <b>salvare</b></p><p>Contattaci se hai dei dubbi!</p>',\n\n // TODO this cannot be done in knockout as with uncompatible browsers we don't initialize\n // 'Usupported browser': 'Browser non compatibile', \n // '<p>Your browser is not supported.</p><p>Use a different browser or try updaring your browser.</p><p>Supported browsers: <ul><li>Internet Explorer >= 10</li><li>Google Chrome >= 30</li><li>Apple Safari >= 5</li><li>Mozilla Firefix >= 20</li></ul></p>': '<p>Il tuo browser non è supportato.</p><p>Accedi con un browser differente o prova ad aggiornare il tuo browser.</p><p>Browser supportati: <ul><li>Internet Explorer >= 10</li><li>Google Chrome >= 30</li><li>Apple Safari >= 5</li><li>Mozilla Firefix >= 20</li></ul></p>',\n\n // toolbox\n 'Blocks': 'Blocchi',\n 'Blocks ready to be added to the template': 'Elenco contenuti aggiungibili al messaggio',\n 'Content': 'Contenuto',\n 'Edit content options': 'Modifica opzioni contenuti',\n 'Style': 'Stile',\n 'Edit style options': 'Modifica opzioni grafiche',\n 'Block __name__': 'Blocco __name__',\n 'Click or drag to add this block to the template': 'Clicca o trascina per aggiungere al messaggio',\n 'Add': 'Aggiungi',\n 'By clicking on message parts you will select a block and content options, if any, will show here': 'Cliccando su alcune parti del messaggio selezionerai un blocco e le opzioni contenutistiche, se disponibili, compariranno qui',\n 'By clicking on message parts you will select a block and style options, if available, will show here': 'Cliccando su alcune parti del messaggio selezionerai un blocco e le opzioni di stile, se disponibili, compariranno qui',\n 'Click or drag files here': 'Clicca o trascina i file qui!',\n 'No images uploaded, yet': 'Non hai ancora caricato immagini',\n 'Show images from the gallery': 'Visualizza le immagini caricate nella tua area',\n 'Loading...': 'Caricamento...',\n 'Load gallery': 'Carica galleria',\n 'Loading gallery...': 'Caricamento in corso...',\n 'The gallery is empty': 'Nessuna immagine nella galleria',\n // img-wysiwyg.tmlp\n 'Remove image': 'Rimuovi immagine',\n 'Open the image editing tool': 'Avvia strumento modifica immagine',\n 'Upload a new image': 'Carica una nuova immagine',\n 'Drop an image here': 'Trascina una immagine qui',\n 'Drop an image here or click the upload button': 'Trascina una immagine qui o clicca sul pulsante di caricamento',\n // gallery\n 'Drag this image and drop it on any template image placeholder': 'Trascina questa immagine sulla posizione in cui vuoi inserirla',\n 'Gallery:': 'Galleria:',\n 'Session images': 'Immagini di sessione',\n 'Recents': 'Recenti',\n 'Remote gallery': 'Galleria remota',\n\n // customstyle\n 'Customized block.<ul><li>In this status changes to properties will be specific to the current block (instead of being global to all blocks in the same section)</li><li>A <span class=\"customStyled\"><span>\"small cube\" </span></span> icon beside the property will mark the customization. By clicking this icon the property value will be reverted to the value defined for the section.</li></ul>': 'Blocco personalizzato.<ul><li>In questa modalità se cambi una proprietà verrà modificata solamente per questo specifico blocco (invece che per tutti i blocchi della stessa sezione).</li><li>Per segnalare la personalizzazione apparirà l\\'icona <span class=\"customStyled\"><span> del \"cubetto\"</span></span> a fianco delle proprietà. Cliccando questa icona tornerai al valore comune.</li></ul>',\n // blocks-wysiwyg\n 'Drop here blocks from the \"Blocks\" tab': 'Trascina qui i blocchi dalla scheda \\'Blocchi\\'',\n // block-wysiwyg\n 'Drag this handle to move the block': 'Trascina per spostare il blocco altrove',\n 'Move this block upside': 'Sposta il blocco in su',\n 'Move this block downside': 'Sposta il blocco in giu',\n 'Delete block': 'Elimina blocco',\n 'Duplicate block': 'Duplica blocco',\n 'Switch block variant': 'Cambia variante blocco',\n // colorpicker\n 'Theme Colors,Standard Colors,Web Colors,Theme Colors,Back to Palette,History,No history yet.': 'Colori Tema,Colori Standard,Colori Web,Colori Tema,Torna alla tavolozza,Storico,storico colori vuoto',\n\n 'Drop here': 'Rilascia qui',\n\n};\n*/\n\nfunction initializeEditor(content, blockDefs, thumbPathConverter, galleryUrl) {\n\n var viewModel = {\n galleryRecent: ko.observableArray([]).extend({\n paging: 16\n }),\n galleryRemote: ko.observableArray([]).extend({\n paging: 16\n }),\n selectedBlock: ko.observable(null),\n selectedItem: ko.observable(null),\n selectedTool: ko.observable(0),\n selectedImageTab: ko.observable(0),\n dragging: ko.observable(false),\n draggingImage: ko.observable(false),\n galleryLoaded: ko.observable(false),\n showPreviewFrame: ko.observable(false),\n previewMode: ko.observable('mobile'),\n showToolbox: ko.observable(true),\n showTheme: ko.observable(false),\n showGallery: ko.observable(false),\n debug: ko.observable(false),\n contentListeners: ko.observable(0),\n \n logoPath: 'dist/img/mosaico32.png',\n logoUrl: '.',\n logoAlt: 'mosaico'\n };\n\n // viewModel.content = content._instrument(ko, content, undefined, true);\n viewModel.content = content;\n viewModel.blockDefs = blockDefs;\n\n viewModel.notifier = toastr;\n\n // Does token substitution in i18next style\n viewModel.tt = function(key, paramObj) {\n if (typeof paramObj !== 'undefined')\n for (var prop in paramObj)\n if (paramObj.hasOwnProperty(prop)) {\n key = key.replace(new RegExp('__' + prop + '__', 'g'), paramObj[prop]);\n }\n return key;\n };\n\n // Simply maps to tt: language plugins can override this method to define their own language\n // handling.\n // If this method invokes an observable (e.g: viewModel.lang()) then the UI language will automatically\n // update when the \"lang\" observable changes.\n viewModel.t = viewModel.tt;\n\n // currently called by editor.html to translate template-defined keys (label, help, descriptions)\n // the editor always uses the \"template\" category for that strings.\n // you can override this method as you like in order to provide translation or change the strings in any way.\n viewModel.ut = function(category, key) {\n return key;\n };\n\n viewModel.templatePath = thumbPathConverter;\n\n viewModel.remoteUrlProcessor = function(url) {\n return url;\n };\n\n viewModel.remoteFileProcessor = function(fileObj) {\n if (typeof fileObj.url !== 'undefined') fileObj.url = viewModel.remoteUrlProcessor(fileObj.url);\n if (typeof fileObj.thumbnailUrl !== 'undefined') fileObj.thumbnailUrl = viewModel.remoteUrlProcessor(fileObj.thumbnailUrl);\n // deleteUrl?\n return fileObj;\n };\n\n // toolbox.tmpl.html\n viewModel.loadGallery = function() {\n viewModel.galleryLoaded('loading');\n var url = galleryUrl ? galleryUrl : '/upload/';\n // retrieve the full list of remote files\n $.getJSON(url, function(data) {\n for (var i = 0; i < data.files.length; i++) data.files[i] = viewModel.remoteFileProcessor(data.files[i]);\n viewModel.galleryLoaded(data.files.length);\n // TODO do I want this call to return relative paths? Or just absolute paths?\n viewModel.galleryRemote(data.files.reverse());\n }).fail(function() {\n viewModel.galleryLoaded(false);\n viewModel.notifier.error(viewModel.t('Unexpected error listing files'));\n });\n };\n\n // img-wysiwyg.tmpl.html\n viewModel.fileToImage = function(obj, event, ui) {\n // console.log(\"fileToImage\", obj);\n return obj.url;\n };\n\n // block-wysiwyg.tmpl.html\n viewModel.removeBlock = function(data, parent) {\n // let's unselect the block\n if (ko.utils.unwrapObservable(viewModel.selectedBlock) == ko.utils.unwrapObservable(data)) {\n viewModel.selectBlock(null, true);\n }\n var res = parent.blocks.remove(data);\n // TODO This message should be different depending on undo plugin presence.\n viewModel.notifier.info(viewModel.t('Block removed: use undo button to restore it...'));\n return res;\n };\n\n // block-wysiwyg.tmpl.html\n viewModel.duplicateBlock = function(index, parent) {\n var idx = ko.utils.unwrapObservable(index);\n // Deinstrument/deobserve the object\n var unwrapped = ko.toJS(ko.utils.unwrapObservable(parent.blocks)[idx]);\n // We need to remove the id so that a new one will be assigned to the clone\n if (typeof unwrapped.id !== 'undefined') unwrapped.id = '';\n // insert the cloned block\n parent.blocks.splice(idx + 1, 0, unwrapped);\n };\n\n // block-wysiwyg.tmpl.html\n viewModel.moveBlock = function(index, parent, up) {\n var idx = ko.utils.unwrapObservable(index);\n var parentBlocks = ko.utils.unwrapObservable(parent.blocks);\n if ((up && idx > 0) || (!up && idx < parentBlocks.length - 1)) {\n var destIndex = idx + (up ? -1 : 1);\n var destBlock = parentBlocks[destIndex];\n viewModel.startMultiple();\n parent.blocks.splice(destIndex, 1);\n parent.blocks.splice(idx, 0, destBlock);\n viewModel.stopMultiple();\n }\n };\n\n // test method, command line use only\n viewModel.loadDefaultBlocks = function() {\n // cloning the whole \"mainBlocks\" object so that undomanager will\n // see it as a single operation (maybe I could use \"startMultiple\"/\"stopMultiple\".\n var res = ko.toJS(viewModel.content().mainBlocks);\n res.blocks = [];\n var input = ko.utils.unwrapObservable(viewModel.blockDefs);\n for (var i = 0; i < input.length; i++) {\n var obj = ko.toJS(input[i]);\n // generating ids for blocks, maybe this would work also leaving it empty.\n obj.id = 'block_' + i;\n res.blocks.push(obj);\n }\n performanceAwareCaller('setMainBlocks', viewModel.content().mainBlocks._wrap.bind(viewModel.content().mainBlocks, res));\n };\n\n // gallery-images.tmpl.html\n viewModel.addImage = function(img) {\n var selectedImg = $('#main-wysiwyg-area .selectable-img.selecteditem');\n if (selectedImg.length == 1 && typeof img == 'object' && typeof img.url !== 'undefined') {\n ko.contextFor(selectedImg[0])._src(img.url);\n return true;\n } else {\n return false;\n }\n };\n\n // toolbox.tmpl.html\n viewModel.addBlock = function(obj, event) {\n // if there is a selected block we try to add the block just after the selected one.\n var selected = viewModel.selectedBlock();\n // search the selected block position.\n var found;\n if (selected !== null) {\n // TODO \"mainBlocks\" is an hardcoded thing.\n for (var i = viewModel.content().mainBlocks().blocks().length - 1; i >= 0; i--) {\n if (viewModel.content().mainBlocks().blocks()[i]() == selected) {\n found = i;\n break;\n }\n }\n }\n var pos;\n if (typeof found !== 'undefined') {\n pos = found + 1;\n viewModel.content().mainBlocks().blocks.splice(pos, 0, obj);\n viewModel.notifier.info(viewModel.t('New block added after the selected one (__pos__)', {\n pos: pos\n }));\n } else {\n viewModel.content().mainBlocks().blocks.push(obj);\n pos = viewModel.content().mainBlocks().blocks().length - 1;\n viewModel.notifier.info(viewModel.t('New block added at the model bottom (__pos__)', {\n pos: pos\n }));\n }\n // find the newly added block and select it!\n var added = viewModel.content().mainBlocks().blocks()[pos]();\n viewModel.selectBlock(added, true);\n // prevent click propagation (losing url hash - see #43)\n return false;\n };\n\n // Used by stylesheet.js to create multiple styles\n viewModel.findObjectsOfType = function(data, type) {\n var res = [];\n var obj = ko.utils.unwrapObservable(data);\n for (var prop in obj)\n if (obj.hasOwnProperty(prop)) {\n var val = ko.utils.unwrapObservable(obj[prop]);\n // TODO this is not the right way to deal with \"block list\" objects.\n if (prop.match(/Blocks$/)) {\n var contents = ko.utils.unwrapObservable(val.blocks);\n for (var i = 0; i < contents.length; i++) {\n var c = ko.utils.unwrapObservable(contents[i]);\n if (type === null || ko.utils.unwrapObservable(c.type) == type) res.push(c);\n }\n // TODO investigate which condition provide a null value.\n } else if (typeof val == 'object' && val !== null) {\n if (type === null || ko.utils.unwrapObservable(val.type) == type) res.push(val);\n }\n }\n return res;\n };\n\n /*\n viewModel.placeholderHelper = 'sortable-placeholder';\n if (false) {\n viewModel.placeholderHelper = {\n element: function(currentItem) {\n return $('<div />').removeClass('ui-draggable').addClass('sortable-placeholder').css('position', 'relative').css('width', '100%').css('height', currentItem.css('height')).css('opacity', '.8')[0];\n },\n update: function(container, p) {\n return;\n }\n };\n }\n */\n\n // Attempt to insert the block in the destination layout during dragging\n viewModel.placeholderHelper = {\n element: function(currentItem) {\n return $(currentItem[0].outerHTML).removeClass('ui-draggable').addClass('sortable-placeholder').css('display', 'block').css('position', 'relative').css('width', '100%').css('height', 'auto').css('opacity', '.8')[0];\n },\n update: function(container, p) {\n return;\n }\n };\n\n // TODO the undumanager should be pluggable.\n // Used by \"moveBlock\" and blocks-wysiwyg.tmpl.html to \"merge\" drag/drop operations into a single undo/redo op.\n viewModel.startMultiple = function() {\n if (typeof viewModel.setUndoModeMerge !== 'undefined') viewModel.setUndoModeMerge();\n };\n viewModel.stopMultiple = function() {\n if (typeof viewModel.setUndoModeOnce !== 'undefined') viewModel.setUndoModeOnce();\n };\n\n // Used by code generated by editor.js \n viewModel.localGlobalSwitch = function(prop, globalProp) {\n var current = prop();\n if (current === null) prop(globalProp());\n else prop(null);\n return false;\n };\n\n // Used by editor and main \"converter\" to support item selection\n viewModel.selectItem = function(valueAccessor, item, block) {\n var val = ko.utils.peekObservable(valueAccessor);\n if (typeof block !== 'undefined') viewModel.selectBlock(block, false, true);\n if (val != item) {\n valueAccessor(item);\n // On selectItem if we were on \"Blocks\" toolbox tab we move to \"Content\" toolbox tab.\n if (item !== null && viewModel.selectedTool() === 0) viewModel.selectedTool(1);\n }\n return false;\n }.bind(viewModel, viewModel.selectedItem);\n\n viewModel.isSelectedItem = function(item) {\n return viewModel.selectedItem() == item;\n };\n\n viewModel.selectBlock = function(valueAccessor, item, doNotSelect, doNotUnselectItem) {\n var val = ko.utils.peekObservable(valueAccessor);\n if (!doNotUnselectItem) viewModel.selectItem(null);\n if (val != item) {\n valueAccessor(item);\n // hide gallery on block selection\n viewModel.showGallery(false);\n if (item !== null && !doNotSelect && viewModel.selectedTool() === 0) viewModel.selectedTool(1);\n }\n }.bind(viewModel, viewModel.selectedBlock);\n\n // DEBUG\n viewModel.countSubscriptions = function(model, debug) {\n var res = 0;\n for (var prop in model)\n if (model.hasOwnProperty(prop)) {\n var p = model[prop];\n if (ko.isObservable(p)) {\n if (typeof p._defaultComputed != 'undefined') {\n if (typeof debug != 'undefined') console.log(debug + \"/\" + prop + \"/_\", p._defaultComputed.getSubscriptionsCount());\n res += p._defaultComputed.getSubscriptionsCount();\n }\n if (typeof debug != 'undefined') console.log(debug + \"/\" + prop + \"/-\", p.getSubscriptionsCount());\n res += p.getSubscriptionsCount();\n p = ko.utils.unwrapObservable(p);\n }\n if (typeof p == 'object' && p !== null) {\n var tot = viewModel.countSubscriptions(p, typeof debug != 'undefined' ? debug + '/' + prop + \"@\" : undefined);\n if (typeof debug != 'undefined') console.log(debug + \"/\" + prop + \"@\", tot);\n res += tot;\n }\n }\n return res;\n };\n\n // DEBUG\n viewModel.loopSubscriptionsCount = function() {\n var count = viewModel.countSubscriptions(viewModel.content());\n global.document.getElementById('subscriptionsCount').innerHTML = count;\n global.setTimeout(viewModel.loopSubscriptionsCount, 1000);\n };\n\n viewModel.export = function() {\n var content = performanceAwareCaller(\"exportHTML\", viewModel.exportHTML);\n return content;\n };\n\n function conditional_restore(html) {\n return html.replace(/<replacedcc[^>]* condition=\"([^\"]*)\"[^>]*>([\\s\\S]*?)<\\/replacedcc>/g, function(match, condition, body) {\n var dd = '<!--[if '+condition.replace(/&/, '&')+']>';\n dd += body.replace(/<!-- cc:bc:([A-Za-z:]*) -->(<\\/cc>)?<!-- cc:ac:\\1 -->/g, '</$1>') // restore closing tags (including lost tags)\n .replace(/><\\/cc><!-- cc:sc -->/g, '/>') // restore selfclosing tags\n .replace(/<!-- cc:bo:([A-Za-z:]*) --><cc/g, '<$1') // restore open tags\n .replace(/^.*<!-- cc:start -->/,'') // remove content before start\n .replace(/<!-- cc:end -->.*$/,''); // remove content after end\n dd += '<![endif]-->';\n return dd;\n });\n }\n\n viewModel.exportHTML = function() {\n var id = 'exportframe';\n $('body').append('<iframe id=\"' + id + '\" data-bind=\"bindIframe: $data\"></iframe>');\n var frameEl = global.document.getElementById(id);\n ko.applyBindings(viewModel, frameEl);\n\n ko.cleanNode(frameEl);\n\n if (viewModel.inline) viewModel.inline(frameEl.contentWindow.document);\n\n // Obsolete method didn't work on IE11 when using \"HTML5 doctype\":\n // var docType = new XMLSerializer().serializeToString(global.document.doctype);\n var node = frameEl.contentWindow.document.doctype;\n var docType = \"<!DOCTYPE \" + node.name +\n (node.publicId ? ' PUBLIC \"' + node.publicId + '\"' : '') +\n (!node.publicId && node.systemId ? ' SYSTEM' : '') +\n (node.systemId ? ' \"' + node.systemId + '\"' : '') + '>';\n var content = docType + \"\\n\" + frameEl.contentWindow.document.documentElement.outerHTML;\n ko.removeNode(frameEl);\n\n content = content.replace(/<script ([^>]* )?type=\"text\\/html\"[^>]*>[\\s\\S]*?<\\/script>/gm, '');\n // content = content.replace(/<!-- ko .*? -->/g, ''); // sometimes we have expressions like (<!-- ko var > 2 -->)\n content = content.replace(/<!-- ko ((?!--).)*? -->/g, ''); // this replaces the above with a more formal (but slower) solution\n content = content.replace(/<!-- \\/ko -->/g, '');\n // Remove data-bind/data-block attributes\n content = content.replace(/ data-bind=\"[^\"]*\"/gm, '');\n // Remove trash leftover by TinyMCE\n content = content.replace(/ data-mce-(href|src|style)=\"[^\"]*\"/gm, '');\n\n // Replace \"replacedstyle\" to \"style\" attributes (chrome puts replacedstyle after style)\n content = content.replace(/ style=\"[^\"]*\"([^>]*) replaced(style=\"[^\"]*\")/gm, '$1 $2');\n // Replace \"replacedstyle\" to \"style\" attributes (ie/ff have reverse order)\n content = content.replace(/ replaced(style=\"[^\"]*\")([^>]*) style=\"[^\"]*\"/gm, ' $1$2');\n content = content.replace(/ replaced(style=\"[^\"]*\")/gm, ' $1');\n\n // same as style, but for http-equiv (some browser break it if we don't replace, but then we find it duplicated)\n content = content.replace(/ http-equiv=\"[^\"]*\"([^>]*) replaced(http-equiv=\"[^\"]*\")/gm, '$1 $2');\n content = content.replace(/ replaced(http-equiv=\"[^\"]*\")([^>]*) http-equiv=\"[^\"]*\"/gm, ' $1$2');\n content = content.replace(/ replaced(http-equiv=\"[^\"]*\")/gm, ' $1');\n\n // We already replace style and http-equiv and we don't need this.\n // content = content.replace(/ replaced([^= ]*=)/gm, ' $1');\n // Restore conditional comments\n content = conditional_restore(content);\n var trash = content.match(/ data-[^ =]+(=\"[^\"]+\")? /) || content.match(/ replaced([^= ]*=)/);\n if (trash) {\n console.warn(\"Output HTML contains unexpected data- attributes or replaced attributes\", trash);\n }\n\n return content;\n };\n\n viewModel.exportHTMLtoTextarea = function(textareaid) {\n $(textareaid).val(viewModel.exportHTML());\n };\n\n viewModel.exportJSONtoTextarea = function(textareaid) {\n $(textareaid).val(viewModel.exportJSON());\n };\n\n viewModel.importJSONfromTextarea = function(textareaid) {\n viewModel.importJSON($(textareaid).val());\n };\n\n viewModel.exportMetadata = function() {\n var json = ko.toJSON(viewModel.metadata);\n return json;\n };\n\n viewModel.exportJSON = function() {\n var json = ko.toJSON(viewModel.content);\n return json;\n };\n\n viewModel.exportJS = function() {\n return ko.toJS(viewModel.content);\n };\n\n viewModel.importJSON = function(json) {\n var unwrapped = ko.utils.parseJson(json);\n viewModel.content._wrap(unwrapped);\n };\n\n viewModel.exportTheme = function() {\n var flat = {};\n var mod = viewModel.content().theme();\n\n var _export = function(prefix, flat, mod) {\n for (var prop in mod)\n if (mod.hasOwnProperty(prop)) {\n var a = ko.utils.unwrapObservable(mod[prop]);\n if (a !== null && typeof a == 'object') {\n _export(prop + '.', flat, a);\n } else {\n flat[prefix + prop] = a;\n }\n }\n };\n\n _export('', flat, mod);\n\n var output = '';\n for (var prop in flat)\n if (flat.hasOwnProperty(prop) && prop != 'type') {\n output += prop + \": \" + flat[prop] + \";\" + \"\\n\";\n }\n\n return output;\n };\n\n // moxiemanager (or file browser/imageeditor) extension points.\n // Just implement editImage or linkDialog methods\n // viewModel.editImage = function(src, done) {} : implement this method to enable image editing (src is a wirtableObservable).\n // viewModel.linkDialog = function() {}: implement this method using \"this\" to find the input element $(this).val is a writableObservable.\n\n viewModel.loadImage = function(img) {\n // push image at top of \"recent\" gallery\n viewModel.galleryRecent.unshift(img);\n // select recent gallery tab\n viewModel.selectedImageTab(0);\n };\n\n viewModel.dialog = function(selector, options) {\n $(selector).dialog(options);\n };\n\n // Dummy log method overridden by extensions\n viewModel.log = function(category, msg) {\n // console.log(\"viewModel.log\", category, msg);\n };\n\n // automatically load the gallery when the gallery tab is selected\n viewModel.selectedImageTab.subscribe(function(newValue) {\n if (newValue == 1 && viewModel.galleryLoaded() === false) {\n viewModel.loadGallery();\n }\n }, viewModel, 'change');\n\n return viewModel;\n\n}\n\nmodule.exports = initializeEditor;"
|
|
146
|
+
]
|
|
147
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
!function(t){"use strict";var e=t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype,o=t.Blob&&function(){try{return Boolean(new Blob)}catch(t){return!1}}(),n=o&&t.Uint8Array&&function(){try{return 100===new Blob([new Uint8Array(100)]).size}catch(t){return!1}}(),r=t.BlobBuilder||t.WebKitBlobBuilder||t.MozBlobBuilder||t.MSBlobBuilder,a=/^data:((.*?)(;charset=.*?)?)(;base64)?,/,i=(o||r)&&t.atob&&t.ArrayBuffer&&t.Uint8Array&&function(t){var e,i,l,u,b,c,d,B,f;if(e=t.match(a),!e)throw new Error("invalid data URI");for(i=e[2]?e[1]:"text/plain"+(e[3]||";charset=US-ASCII"),l=!!e[4],u=t.slice(e[0].length),b=l?atob(u):decodeURIComponent(u),c=new ArrayBuffer(b.length),d=new Uint8Array(c),B=0;B<b.length;B+=1)d[B]=b.charCodeAt(B);return o?new Blob([n?d:c],{type:i}):(f=new r,f.append(c),f.getBlob(i))};t.HTMLCanvasElement&&!e.toBlob&&(e.mozGetAsFile?e.toBlob=function(t,o,n){t(n&&e.toDataURL&&i?i(this.toDataURL(o,n)):this.mozGetAsFile("blob",o))}:e.toDataURL&&i&&(e.toBlob=function(t,e,o){t(i(this.toDataURL(e,o)))})),"function"==typeof define&&define.amd?define(function(){return i}):"object"==typeof module&&module.exports?module.exports=i:t.dataURLtoBlob=i}(window);
|
|
2
|
+
//# sourceMappingURL=canvas-to-blob.min.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/*! jQuery UI - v1.11.4 - 2015-03-11
|
|
2
|
+
* http://jqueryui.com
|
|
3
|
+
* Includes: core.css, accordion.css, autocomplete.css, button.css, datepicker.css, dialog.css, draggable.css, menu.css, progressbar.css, resizable.css, selectable.css, selectmenu.css, slider.css, sortable.css, spinner.css, tabs.css, tooltip.css, theme.css
|
|
4
|
+
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
|
|
5
|
+
* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */
|
|
6
|
+
|
|
7
|
+
.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin:2px 0 0 0;padding:.5em .5em .5em .7em;min-height:0;font-size:100%}.ui-accordion .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-icons .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-header .ui-accordion-header-icon{position:absolute;left:.5em;top:50%;margin-top:-8px}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-button{display:inline-block;position:relative;padding:0;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;overflow:visible}.ui-button,.ui-button:link,.ui-button:visited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-icon-only{width:2.2em}button.ui-button-icon-only{width:2.4em}.ui-button-icons-only{width:3.4em}button.ui-button-icons-only{width:3.7em}.ui-button .ui-button-text{display:block;line-height:normal}.ui-button-text-only .ui-button-text{padding:.4em 1em}.ui-button-icon-only .ui-button-text,.ui-button-icons-only .ui-button-text{padding:.4em;text-indent:-9999999px}.ui-button-text-icon-primary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 1em .4em 2.1em}.ui-button-text-icon-secondary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 2.1em .4em 1em}.ui-button-text-icons .ui-button-text{padding-left:2.1em;padding-right:2.1em}input.ui-button{padding:.4em 1em}.ui-button-icon-only .ui-icon,.ui-button-text-icon-primary .ui-icon,.ui-button-text-icon-secondary .ui-icon,.ui-button-text-icons .ui-icon,.ui-button-icons-only .ui-icon{position:absolute;top:50%;margin-top:-8px}.ui-button-icon-only .ui-icon{left:50%;margin-left:-8px}.ui-button-text-icon-primary .ui-button-icon-primary,.ui-button-text-icons .ui-button-icon-primary,.ui-button-icons-only .ui-button-icon-primary{left:.5em}.ui-button-text-icon-secondary .ui-button-icon-secondary,.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em}.ui-buttonset{margin-right:7px}.ui-buttonset .ui-button{margin-left:0;margin-right:-.3em}input.ui-button::-moz-focus-inner,button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:45%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:bold;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-dialog{overflow:hidden;position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:20px;margin:-10px 0 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:none;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-se{width:12px;height:12px;right:-5px;bottom:-5px;background-position:16px 16px}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-draggable-handle{-ms-touch-action:none;touch-action:none}.ui-menu{list-style:none;padding:0;margin:0;display:block;outline:none}.ui-menu .ui-menu{position:absolute}.ui-menu .ui-menu-item{position:relative;margin:0;padding:3px 1em 3px .4em;cursor:pointer;min-height:0;list-style-image:url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7")}.ui-menu .ui-menu-divider{margin:5px 0;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-state-focus,.ui-menu .ui-state-active{margin:-1px}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item{padding-left:2em}.ui-menu .ui-icon{position:absolute;top:0;bottom:0;left:.2em;margin:auto 0}.ui-menu .ui-menu-icon{left:auto;right:0}.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-progressbar-overlay{background:url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZb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aElaqrq56Bq7VAAAOw==");height:100%;filter:alpha(opacity=25);opacity:0.25}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:0.1px;display:block;-ms-touch-action:none;touch-action:none}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-selectable{-ms-touch-action:none;touch-action:none}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted black}.ui-selectmenu-menu{padding:0;margin:0;position:absolute;top:0;left:0;display:none}.ui-selectmenu-menu .ui-menu{overflow:auto;overflow-x:hidden;padding-bottom:1px}.ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup{font-size:1em;font-weight:bold;line-height:1.5;padding:2px 0.4em;margin:0.5em 0 0 0;height:auto;border:0}.ui-selectmenu-open{display:block}.ui-selectmenu-button{display:inline-block;overflow:hidden;position:relative;text-decoration:none;cursor:pointer}.ui-selectmenu-button span.ui-icon{right:0.5em;left:auto;margin-top:-8px;position:absolute;top:50%}.ui-selectmenu-button span.ui-selectmenu-text{text-align:left;padding:0.4em 2.1em 0.4em 1em;display:block;line-height:1.4;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default;-ms-touch-action:none;touch-action:none}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider.ui-state-disabled .ui-slider-handle,.ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.ui-sortable-handle{-ms-touch-action:none;touch-action:none}.ui-spinner{position:relative;display:inline-block;overflow:hidden;padding:0;vertical-align:middle}.ui-spinner-input{border:none;background:none;color:inherit;padding:0;margin:.2em 0;vertical-align:middle;margin-left:.4em;margin-right:22px}.ui-spinner-button{width:16px;height:50%;font-size:.5em;padding:0;margin:0;text-align:center;position:absolute;cursor:default;display:block;overflow:hidden;right:0}.ui-spinner a.ui-spinner-button{border-top:none;border-bottom:none;border-right:none}.ui-spinner .ui-icon{position:absolute;margin-top:-8px;top:50%;left:0}.ui-spinner-up{top:0}.ui-spinner-down{bottom:0}.ui-spinner .ui-icon-triangle-1-s{background-position:-65px -16px}.ui-tabs{position:relative;padding:.2em}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom-width:0;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav .ui-tabs-anchor{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor{cursor:text}.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:none}.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px;-webkit-box-shadow:0 0 5px #aaa;box-shadow:0 0 5px #aaa}body .ui-tooltip{border-width:2px}.ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #aaa;background:#fff url("images/ui-bg_flat_75_ffffff_40x100.png") 50% 50% repeat-x;color:#222}.ui-widget-content a{color:#222}.ui-widget-header{border:1px solid #aaa;background:#ccc url("images/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x;color:#222;font-weight:bold}.ui-widget-header a{color:#222}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #d3d3d3;background:#e6e6e6 url("images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#555}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#555;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #999;background:#dadada url("images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited{color:#212121;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #aaa;background:#fff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fcefa1;background:#fbf9ee url("images/ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x;color:#363636}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#fef1ec url("images/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x;color:#cd0a0a}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#cd0a0a}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#cd0a0a}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url("images/ui-icons_222222_256x240.png")}.ui-widget-header .ui-icon{background-image:url("images/ui-icons_222222_256x240.png")}.ui-state-default .ui-icon{background-image:url("images/ui-icons_888888_256x240.png")}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url("images/ui-icons_454545_256x240.png")}.ui-state-active .ui-icon{background-image:url("images/ui-icons_454545_256x240.png")}.ui-state-highlight .ui-icon{background-image:url("images/ui-icons_2e83ff_256x240.png")}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url("images/ui-icons_cd0a0a_256x240.png")}.ui-icon-blank{background-position:16px 16px}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:4px}.ui-widget-overlay{background:#aaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30);border-radius:8px}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*! jQuery UI - v1.11.4 - 2015-03-11
|
|
2
|
+
* http://jqueryui.com
|
|
3
|
+
* Includes: core.js, widget.js, mouse.js, position.js, accordion.js, autocomplete.js, button.js, datepicker.js, dialog.js, draggable.js, droppable.js, effect.js, effect-blind.js, effect-bounce.js, effect-clip.js, effect-drop.js, effect-explode.js, effect-fade.js, effect-fold.js, effect-highlight.js, effect-puff.js, effect-pulsate.js, effect-scale.js, effect-shake.js, effect-size.js, effect-slide.js, effect-transfer.js, menu.js, progressbar.js, resizable.js, selectable.js, selectmenu.js, slider.js, sortable.js, spinner.js, tabs.js, tooltip.js
|
|
4
|
+
* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */
|
|
5
|
+
|
|
6
|
+
(function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)})(function(e){function t(t,s){var n,a,o,r=t.nodeName.toLowerCase();return"area"===r?(n=t.parentNode,a=n.name,t.href&&a&&"map"===n.nodeName.toLowerCase()?(o=e("img[usemap='#"+a+"']")[0],!!o&&i(o)):!1):(/^(input|select|textarea|button|object)$/.test(r)?!t.disabled:"a"===r?t.href||s:s)&&i(t)}function i(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}function s(e){for(var t,i;e.length&&e[0]!==document;){if(t=e.css("position"),("absolute"===t||"relative"===t||"fixed"===t)&&(i=parseInt(e.css("zIndex"),10),!isNaN(i)&&0!==i))return i;e=e.parent()}return 0}function n(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},e.extend(this._defaults,this.regional[""]),this.regional.en=e.extend(!0,{},this.regional[""]),this.regional["en-US"]=e.extend(!0,{},this.regional.en),this.dpDiv=a(e("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function a(t){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.delegate(i,"mouseout",function(){e(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).removeClass("ui-datepicker-next-hover")}).delegate(i,"mouseover",o)}function o(){e.datepicker._isDisabledDatepicker(v.inline?v.dpDiv.parent()[0]:v.input[0])||(e(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),e(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).addClass("ui-datepicker-next-hover"))}function r(t,i){e.extend(t,i);for(var s in i)null==i[s]&&(t[s]=i[s]);return t}function h(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger("change")}}e.ui=e.ui||{},e.extend(e.ui,{version:"1.11.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({scrollParent:function(t){var i=this.css("position"),s="absolute"===i,n=t?/(auto|scroll|hidden)/:/(auto|scroll)/,a=this.parents().filter(function(){var t=e(this);return s&&"static"===t.css("position")?!1:n.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==i&&a.length?a:e(this[0].ownerDocument||document)},uniqueId:function(){var e=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,s){return!!e.data(t,s[3])},focusable:function(i){return t(i,!isNaN(e.attr(i,"tabindex")))},tabbable:function(i){var s=e.attr(i,"tabindex"),n=isNaN(s);return(n||s>=0)&&t(i,!n)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(t,i){function s(t,i,s,a){return e.each(n,function(){i-=parseFloat(e.css(t,"padding"+this))||0,s&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),a&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],a=i.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+i]=function(t){return void 0===t?o["inner"+i].call(this):this.each(function(){e(this).css(a,s(this,t)+"px")})},e.fn["outer"+i]=function(t,n){return"number"!=typeof t?o["outer"+i].call(this,t):this.each(function(){e(this).css(a,s(this,t,!0,n)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.fn.extend({focus:function(t){return function(i,s){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),s&&s.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),disableSelection:function(){var e="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(e+".ui-disableSelection",function(e){e.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(t){if(void 0!==t)return this.css("zIndex",t);if(this.length)for(var i,s,n=e(this[0]);n.length&&n[0]!==document;){if(i=n.css("position"),("absolute"===i||"relative"===i||"fixed"===i)&&(s=parseInt(n.css("zIndex"),10),!isNaN(s)&&0!==s))return s;n=n.parent()}return 0}}),e.ui.plugin={add:function(t,i,s){var n,a=e.ui[t].prototype;for(n in s)a.plugins[n]=a.plugins[n]||[],a.plugins[n].push([i,s[n]])},call:function(e,t,i,s){var n,a=e.plugins[t];if(a&&(s||e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType))for(n=0;a.length>n;n++)e.options[a[n][0]]&&a[n][1].apply(e.element,i)}};var l=0,u=Array.prototype.slice;e.cleanData=function(t){return function(i){var s,n,a;for(a=0;null!=(n=i[a]);a++)try{s=e._data(n,"events"),s&&s.remove&&e(n).triggerHandler("remove")}catch(o){}t(i)}}(e.cleanData),e.widget=function(t,i,s){var n,a,o,r,h={},l=t.split(".")[0];return t=t.split(".")[1],n=l+"-"+t,s||(s=i,i=e.Widget),e.expr[":"][n.toLowerCase()]=function(t){return!!e.data(t,n)},e[l]=e[l]||{},a=e[l][t],o=e[l][t]=function(e,t){return this._createWidget?(arguments.length&&this._createWidget(e,t),void 0):new o(e,t)},e.extend(o,a,{version:s.version,_proto:e.extend({},s),_childConstructors:[]}),r=new i,r.options=e.widget.extend({},r.options),e.each(s,function(t,s){return e.isFunction(s)?(h[t]=function(){var e=function(){return i.prototype[t].apply(this,arguments)},n=function(e){return i.prototype[t].apply(this,e)};return function(){var t,i=this._super,a=this._superApply;return this._super=e,this._superApply=n,t=s.apply(this,arguments),this._super=i,this._superApply=a,t}}(),void 0):(h[t]=s,void 0)}),o.prototype=e.widget.extend(r,{widgetEventPrefix:a?r.widgetEventPrefix||t:t},h,{constructor:o,namespace:l,widgetName:t,widgetFullName:n}),a?(e.each(a._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete a._childConstructors):i._childConstructors.push(o),e.widget.bridge(t,o),o},e.widget.extend=function(t){for(var i,s,n=u.call(arguments,1),a=0,o=n.length;o>a;a++)for(i in n[a])s=n[a][i],n[a].hasOwnProperty(i)&&void 0!==s&&(t[i]=e.isPlainObject(s)?e.isPlainObject(t[i])?e.widget.extend({},t[i],s):e.widget.extend({},s):s);return t},e.widget.bridge=function(t,i){var s=i.prototype.widgetFullName||t;e.fn[t]=function(n){var a="string"==typeof n,o=u.call(arguments,1),r=this;return a?this.each(function(){var i,a=e.data(this,s);return"instance"===n?(r=a,!1):a?e.isFunction(a[n])&&"_"!==n.charAt(0)?(i=a[n].apply(a,o),i!==a&&void 0!==i?(r=i&&i.jquery?r.pushStack(i.get()):i,!1):void 0):e.error("no such method '"+n+"' for "+t+" widget instance"):e.error("cannot call methods on "+t+" prior to initialization; "+"attempted to call method '"+n+"'")}):(o.length&&(n=e.widget.extend.apply(null,[n].concat(o))),this.each(function(){var t=e.data(this,s);t?(t.option(n||{}),t._init&&t._init()):e.data(this,s,new i(n,this))})),r}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,i){i=e(i||this.defaultElement||this)[0],this.element=e(i),this.uuid=l++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),i!==this&&(e.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===i&&this.destroy()}}),this.document=e(i.style?i.ownerDocument:i.document||i),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(t,i){var s,n,a,o=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(o={},s=t.split("."),t=s.shift(),s.length){for(n=o[t]=e.widget.extend({},this.options[t]),a=0;s.length-1>a;a++)n[s[a]]=n[s[a]]||{},n=n[s[a]];if(t=s.pop(),1===arguments.length)return void 0===n[t]?null:n[t];n[t]=i}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=i}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!t),t&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(t,i,s){var n,a=this;"boolean"!=typeof t&&(s=i,i=t,t=!1),s?(i=n=e(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),e.each(s,function(s,o){function r(){return t||a.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof o?a[o]:o).apply(a,arguments):void 0}"string"!=typeof o&&(r.guid=o.guid=o.guid||r.guid||e.guid++);var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+a.eventNamespace,u=h[2];u?n.delegate(u,l,r):i.bind(l,r)})},_off:function(t,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(i).undelegate(i),this.bindings=e(this.bindings.not(t).get()),this.focusable=e(this.focusable.not(t).get()),this.hoverable=e(this.hoverable.not(t).get())},_delay:function(e,t){function i(){return("string"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,s){var n,a,o=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],a=i.originalEvent)for(n in a)n in i||(i[n]=a[n]);return this.element.trigger(i,s),!(e.isFunction(o)&&o.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(s,n,a){"string"==typeof n&&(n={effect:n});var o,r=n?n===!0||"number"==typeof n?i:n.effect||i:t;n=n||{},"number"==typeof n&&(n={duration:n}),o=!e.isEmptyObject(n),n.complete=a,n.delay&&s.delay(n.delay),o&&e.effects&&e.effects.effect[r]?s[t](n):r!==t&&s[r]?s[r](n.duration,n.easing,a):s.queue(function(i){e(this)[t](),a&&a.call(s[0]),i()})}}),e.widget;var d=!1;e(document).mouseup(function(){d=!1}),e.widget("ui.mouse",{version:"1.11.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(i){return!0===e.data(i.target,t.widgetName+".preventClickEvent")?(e.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!d){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var i=this,s=1===t.which,n="string"==typeof this.options.cancel&&t.target.nodeName?e(t.target).closest(this.options.cancel).length:!1;return s&&!n&&this._mouseCapture(t)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(t)!==!1,!this._mouseStarted)?(t.preventDefault(),!0):(!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return i._mouseMove(e)},this._mouseUpDelegate=function(e){return i._mouseUp(e)},this.document.bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),d=!0,!0)):!0}},_mouseMove:function(t){if(this._mouseMoved){if(e.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button)return this._mouseUp(t);if(!t.which)return this._mouseUp(t)}return(t.which||t.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){return this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),d=!1,!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),function(){function t(e,t,i){return[parseFloat(e[0])*(p.test(e[0])?t/100:1),parseFloat(e[1])*(p.test(e[1])?i/100:1)]}function i(t,i){return parseInt(e.css(t,i),10)||0}function s(t){var i=t[0];return 9===i.nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:e.isWindow(i)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}e.ui=e.ui||{};var n,a,o=Math.max,r=Math.abs,h=Math.round,l=/left|center|right/,u=/top|center|bottom/,d=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,p=/%$/,f=e.fn.position;e.position={scrollbarWidth:function(){if(void 0!==n)return n;var t,i,s=e("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),a=s.children()[0];return e("body").append(s),t=a.offsetWidth,s.css("overflow","scroll"),i=a.offsetWidth,t===i&&(i=s[0].clientWidth),s.remove(),n=t-i},getScrollInfo:function(t){var i=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),s=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),n="scroll"===i||"auto"===i&&t.width<t.element[0].scrollWidth,a="scroll"===s||"auto"===s&&t.height<t.element[0].scrollHeight;return{width:a?e.position.scrollbarWidth():0,height:n?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var i=e(t||window),s=e.isWindow(i[0]),n=!!i[0]&&9===i[0].nodeType;return{element:i,isWindow:s,isDocument:n,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:s||n?i.width():i.outerWidth(),height:s||n?i.height():i.outerHeight()}}},e.fn.position=function(n){if(!n||!n.of)return f.apply(this,arguments);n=e.extend({},n);var p,m,g,v,y,b,_=e(n.of),x=e.position.getWithinInfo(n.within),w=e.position.getScrollInfo(x),k=(n.collision||"flip").split(" "),T={};return b=s(_),_[0].preventDefault&&(n.at="left top"),m=b.width,g=b.height,v=b.offset,y=e.extend({},v),e.each(["my","at"],function(){var e,t,i=(n[this]||"").split(" ");1===i.length&&(i=l.test(i[0])?i.concat(["center"]):u.test(i[0])?["center"].concat(i):["center","center"]),i[0]=l.test(i[0])?i[0]:"center",i[1]=u.test(i[1])?i[1]:"center",e=d.exec(i[0]),t=d.exec(i[1]),T[this]=[e?e[0]:0,t?t[0]:0],n[this]=[c.exec(i[0])[0],c.exec(i[1])[0]]}),1===k.length&&(k[1]=k[0]),"right"===n.at[0]?y.left+=m:"center"===n.at[0]&&(y.left+=m/2),"bottom"===n.at[1]?y.top+=g:"center"===n.at[1]&&(y.top+=g/2),p=t(T.at,m,g),y.left+=p[0],y.top+=p[1],this.each(function(){var s,l,u=e(this),d=u.outerWidth(),c=u.outerHeight(),f=i(this,"marginLeft"),b=i(this,"marginTop"),D=d+f+i(this,"marginRight")+w.width,S=c+b+i(this,"marginBottom")+w.height,M=e.extend({},y),C=t(T.my,u.outerWidth(),u.outerHeight());"right"===n.my[0]?M.left-=d:"center"===n.my[0]&&(M.left-=d/2),"bottom"===n.my[1]?M.top-=c:"center"===n.my[1]&&(M.top-=c/2),M.left+=C[0],M.top+=C[1],a||(M.left=h(M.left),M.top=h(M.top)),s={marginLeft:f,marginTop:b},e.each(["left","top"],function(t,i){e.ui.position[k[t]]&&e.ui.position[k[t]][i](M,{targetWidth:m,targetHeight:g,elemWidth:d,elemHeight:c,collisionPosition:s,collisionWidth:D,collisionHeight:S,offset:[p[0]+C[0],p[1]+C[1]],my:n.my,at:n.at,within:x,elem:u})}),n.using&&(l=function(e){var t=v.left-M.left,i=t+m-d,s=v.top-M.top,a=s+g-c,h={target:{element:_,left:v.left,top:v.top,width:m,height:g},element:{element:u,left:M.left,top:M.top,width:d,height:c},horizontal:0>i?"left":t>0?"right":"center",vertical:0>a?"top":s>0?"bottom":"middle"};d>m&&m>r(t+i)&&(h.horizontal="center"),c>g&&g>r(s+a)&&(h.vertical="middle"),h.important=o(r(t),r(i))>o(r(s),r(a))?"horizontal":"vertical",n.using.call(this,e,h)}),u.offset(e.extend(M,{using:l}))})},e.ui.position={fit:{left:function(e,t){var i,s=t.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=e.left-t.collisionPosition.marginLeft,h=n-r,l=r+t.collisionWidth-a-n;t.collisionWidth>a?h>0&&0>=l?(i=e.left+h+t.collisionWidth-a-n,e.left+=h-i):e.left=l>0&&0>=h?n:h>l?n+a-t.collisionWidth:n:h>0?e.left+=h:l>0?e.left-=l:e.left=o(e.left-r,e.left)},top:function(e,t){var i,s=t.within,n=s.isWindow?s.scrollTop:s.offset.top,a=t.within.height,r=e.top-t.collisionPosition.marginTop,h=n-r,l=r+t.collisionHeight-a-n;t.collisionHeight>a?h>0&&0>=l?(i=e.top+h+t.collisionHeight-a-n,e.top+=h-i):e.top=l>0&&0>=h?n:h>l?n+a-t.collisionHeight:n:h>0?e.top+=h:l>0?e.top-=l:e.top=o(e.top-r,e.top)}},flip:{left:function(e,t){var i,s,n=t.within,a=n.offset.left+n.scrollLeft,o=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=e.left-t.collisionPosition.marginLeft,u=l-h,d=l+t.collisionWidth-o-h,c="left"===t.my[0]?-t.elemWidth:"right"===t.my[0]?t.elemWidth:0,p="left"===t.at[0]?t.targetWidth:"right"===t.at[0]?-t.targetWidth:0,f=-2*t.offset[0];0>u?(i=e.left+c+p+f+t.collisionWidth-o-a,(0>i||r(u)>i)&&(e.left+=c+p+f)):d>0&&(s=e.left-t.collisionPosition.marginLeft+c+p+f-h,(s>0||d>r(s))&&(e.left+=c+p+f))},top:function(e,t){var i,s,n=t.within,a=n.offset.top+n.scrollTop,o=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=e.top-t.collisionPosition.marginTop,u=l-h,d=l+t.collisionHeight-o-h,c="top"===t.my[1],p=c?-t.elemHeight:"bottom"===t.my[1]?t.elemHeight:0,f="top"===t.at[1]?t.targetHeight:"bottom"===t.at[1]?-t.targetHeight:0,m=-2*t.offset[1];0>u?(s=e.top+p+f+m+t.collisionHeight-o-a,(0>s||r(u)>s)&&(e.top+=p+f+m)):d>0&&(i=e.top-t.collisionPosition.marginTop+p+f+m-h,(i>0||d>r(i))&&(e.top+=p+f+m))}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}},function(){var t,i,s,n,o,r=document.getElementsByTagName("body")[0],h=document.createElement("div");t=document.createElement(r?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},r&&e.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(o in s)t.style[o]=s[o];t.appendChild(h),i=r||document.documentElement,i.insertBefore(t,i.firstChild),h.style.cssText="position: absolute; left: 10.7432222px;",n=e(h).offset().left,a=n>10&&11>n,t.innerHTML="",i.removeChild(t)}()}(),e.ui.position,e.widget("ui.accordion",{version:"1.11.4",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var t=this.options;this.prevShow=this.prevHide=e(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),t.collapsible||t.active!==!1&&null!=t.active||(t.active=0),this._processPanels(),0>t.active&&(t.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():e()}},_createIcons:function(){var t=this.options.icons;t&&(e("<span>").addClass("ui-accordion-header-icon ui-icon "+t.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(t.header).addClass(t.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var e;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").removeUniqueId(),this._destroyIcons(),e=this.headers.next().removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").css("display","").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&e.css("height","")},_setOption:function(e,t){return"active"===e?(this._activate(t),void 0):("event"===e&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),"collapsible"!==e||t||this.options.active!==!1||this._activate(0),"icons"===e&&(this._destroyIcons(),t&&this._createIcons()),"disabled"===e&&(this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!t)),void 0)},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var i=e.ui.keyCode,s=this.headers.length,n=this.headers.index(t.target),a=!1;switch(t.keyCode){case i.RIGHT:case i.DOWN:a=this.headers[(n+1)%s];break;case i.LEFT:case i.UP:a=this.headers[(n-1+s)%s];break;case i.SPACE:case i.ENTER:this._eventHandler(t);break;case i.HOME:a=this.headers[0];break;case i.END:a=this.headers[s-1]}a&&(e(t.target).attr("tabIndex",-1),e(a).attr("tabIndex",0),a.focus(),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===e.ui.keyCode.UP&&t.ctrlKey&&e(t.currentTarget).prev().focus()},refresh:function(){var t=this.options;this._processPanels(),t.active===!1&&t.collapsible===!0||!this.headers.length?(t.active=!1,this.active=e()):t.active===!1?this._activate(0):this.active.length&&!e.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=e()):this._activate(Math.max(0,t.active-1)):t.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var e=this.headers,t=this.panels;this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-state-default ui-corner-all"),this.panels=this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide(),t&&(this._off(e.not(this.headers)),this._off(t.not(this.panels)))},_refresh:function(){var t,i=this.options,s=i.heightStyle,n=this.element.parent();this.active=this._findActive(i.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(){var t=e(this),i=t.uniqueId().attr("id"),s=t.next(),n=s.uniqueId().attr("id");t.attr("aria-controls",n),s.attr("aria-labelledby",i)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(i.event),"fill"===s?(t=n.height(),this.element.siblings(":visible").each(function(){var i=e(this),s=i.css("position");"absolute"!==s&&"fixed"!==s&&(t-=i.outerHeight(!0))}),this.headers.each(function(){t-=e(this).outerHeight(!0)}),this.headers.next().each(function(){e(this).height(Math.max(0,t-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===s&&(t=0,this.headers.next().each(function(){t=Math.max(t,e(this).css("height","").height())}).height(t))},_activate:function(t){var i=this._findActive(t)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return"number"==typeof t?this.headers.eq(t):e()},_setupEvents:function(t){var i={keydown:"_keydown"};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(t){var i=this.options,s=this.active,n=e(t.currentTarget),a=n[0]===s[0],o=a&&i.collapsible,r=o?e():n.next(),h=s.next(),l={oldHeader:s,oldPanel:h,newHeader:o?e():n,newPanel:r};t.preventDefault(),a&&!i.collapsible||this._trigger("beforeActivate",t,l)===!1||(i.active=o?!1:this.headers.index(n),this.active=a?e():n,this._toggle(l),s.removeClass("ui-accordion-header-active ui-state-active"),i.icons&&s.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header),a||(n.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),i.icons&&n.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader),n.next().addClass("ui-accordion-content-active")))},_toggle:function(t){var i=t.newPanel,s=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=s,this.options.animate?this._animate(i,s,t):(s.hide(),i.show(),this._toggleComplete(t)),s.attr({"aria-hidden":"true"}),s.prev().attr({"aria-selected":"false","aria-expanded":"false"}),i.length&&s.length?s.prev().attr({tabIndex:-1,"aria-expanded":"false"}):i.length&&this.headers.filter(function(){return 0===parseInt(e(this).attr("tabIndex"),10)}).attr("tabIndex",-1),i.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(e,t,i){var s,n,a,o=this,r=0,h=e.css("box-sizing"),l=e.length&&(!t.length||e.index()<t.index()),u=this.options.animate||{},d=l&&u.down||u,c=function(){o._toggleComplete(i)};return"number"==typeof d&&(a=d),"string"==typeof d&&(n=d),n=n||d.easing||u.easing,a=a||d.duration||u.duration,t.length?e.length?(s=e.show().outerHeight(),t.animate(this.hideProps,{duration:a,easing:n,step:function(e,t){t.now=Math.round(e)}}),e.hide().animate(this.showProps,{duration:a,easing:n,complete:c,step:function(e,i){i.now=Math.round(e),"height"!==i.prop?"content-box"===h&&(r+=i.now):"content"!==o.options.heightStyle&&(i.now=Math.round(s-t.outerHeight()-r),r=0)}}),void 0):t.animate(this.hideProps,a,n,c):e.animate(this.showProps,a,n,c)},_toggleComplete:function(e){var t=e.oldPanel;t.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"),t.length&&(t.parent()[0].className=t.parent()[0].className),this._trigger("activate",null,e)}}),e.widget("ui.menu",{version:"1.11.4",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},items:"> *",menus:"ul",position:{my:"left-1 top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item":function(e){e.preventDefault()},"click .ui-menu-item":function(t){var i=e(t.target);!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(t),t.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(t):!this.element.is(":focus")&&e(this.document[0].activeElement).closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(t){if(!this.previousFilter){var i=e(t.currentTarget);
|
|
7
|
+
i.siblings(".ui-state-active").removeClass("ui-state-active"),this.focus(t,i)}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(e,t){var i=this.active||this.element.find(this.options.items).eq(0);t||this.focus(e,i)},blur:function(t){this._delay(function(){e.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){this._closeOnDocumentClick(e)&&this.collapseAll(e),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-menu-icons ui-front").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").removeUniqueId().removeClass("ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var t=e(this);t.data("ui-menu-submenu-carat")&&t.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(t){var i,s,n,a,o=!0;switch(t.keyCode){case e.ui.keyCode.PAGE_UP:this.previousPage(t);break;case e.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case e.ui.keyCode.HOME:this._move("first","first",t);break;case e.ui.keyCode.END:this._move("last","last",t);break;case e.ui.keyCode.UP:this.previous(t);break;case e.ui.keyCode.DOWN:this.next(t);break;case e.ui.keyCode.LEFT:this.collapse(t);break;case e.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case e.ui.keyCode.ENTER:case e.ui.keyCode.SPACE:this._activate(t);break;case e.ui.keyCode.ESCAPE:this.collapse(t);break;default:o=!1,s=this.previousFilter||"",n=String.fromCharCode(t.keyCode),a=!1,clearTimeout(this.filterTimer),n===s?a=!0:n=s+n,i=this._filterMenuItems(n),i=a&&-1!==i.index(this.active.next())?this.active.nextAll(".ui-menu-item"):i,i.length||(n=String.fromCharCode(t.keyCode),i=this._filterMenuItems(n)),i.length?(this.focus(t,i),this.previousFilter=n,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}o&&t.preventDefault()},_activate:function(e){this.active.is(".ui-state-disabled")||(this.active.is("[aria-haspopup='true']")?this.expand(e):this.select(e))},refresh:function(){var t,i,s=this,n=this.options.icons.submenu,a=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length),a.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-front").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=e(this),i=t.parent(),s=e("<span>").addClass("ui-menu-icon ui-icon "+n).data("ui-menu-submenu-carat",!0);i.attr("aria-haspopup","true").prepend(s),t.attr("aria-labelledby",i.attr("id"))}),t=a.add(this.element),i=t.find(this.options.items),i.not(".ui-menu-item").each(function(){var t=e(this);s._isDivider(t)&&t.addClass("ui-widget-content ui-menu-divider")}),i.not(".ui-menu-item, .ui-menu-divider").addClass("ui-menu-item").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),i.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!e.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(e,t){"icons"===e&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(t.submenu),"disabled"===e&&this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this._super(e,t)},focus:function(e,t){var i,s;this.blur(e,e&&"focus"===e.type),this._scrollIntoView(t),this.active=t.first(),s=this.active.addClass("ui-state-focus").removeClass("ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),this.active.parent().closest(".ui-menu-item").addClass("ui-state-active"),e&&"keydown"===e.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=t.children(".ui-menu"),i.length&&e&&/^mouse/.test(e.type)&&this._startOpening(i),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(t){var i,s,n,a,o,r;this._hasScroll()&&(i=parseFloat(e.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(e.css(this.activeMenu[0],"paddingTop"))||0,n=t.offset().top-this.activeMenu.offset().top-i-s,a=this.activeMenu.scrollTop(),o=this.activeMenu.height(),r=t.outerHeight(),0>n?this.activeMenu.scrollTop(a+n):n+r>o&&this.activeMenu.scrollTop(a+n-o+r))},blur:function(e,t){t||clearTimeout(this.timer),this.active&&(this.active.removeClass("ui-state-focus"),this.active=null,this._trigger("blur",e,{item:this.active}))},_startOpening:function(e){clearTimeout(this.timer),"true"===e.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(e)},this.delay))},_open:function(t){var i=e.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(t,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:e(t&&t.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(t),this.activeMenu=s},this.delay)},_close:function(e){e||(e=this.active?this.active.parent():this.element),e.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find(".ui-state-active").not(".ui-state-focus").removeClass("ui-state-active")},_closeOnDocumentClick:function(t){return!e(t.target).closest(".ui-menu").length},_isDivider:function(e){return!/[^\-\u2014\u2013\s]/.test(e.text())},collapse:function(e){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(e,t))},expand:function(e){var t=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(e,t)}))},next:function(e){this._move("next","first",e)},previous:function(e){this._move("prev","last",e)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(e,t,i){var s;this.active&&(s="first"===e||"last"===e?this.active["first"===e?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[e+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.find(this.options.items)[t]()),this.focus(i,s)},nextPage:function(t){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=e(this),0>i.offset().top-s-n}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items)[this.active?"last":"first"]())),void 0):(this.next(t),void 0)},previousPage:function(t){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=e(this),i.offset().top-s+n>0}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items).first())),void 0):(this.next(t),void 0)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||e(t.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,i)},_filterMenuItems:function(t){var i=t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),s=RegExp("^"+i,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return s.test(e.trim(e(this).text()))})}}),e.widget("ui.autocomplete",{version:"1.11.4",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var t,i,s,n=this.element[0].nodeName.toLowerCase(),a="textarea"===n,o="input"===n;this.isMultiLine=a?!0:o?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[a||o?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return t=!0,s=!0,i=!0,void 0;t=!1,s=!1,i=!1;var a=e.ui.keyCode;switch(n.keyCode){case a.PAGE_UP:t=!0,this._move("previousPage",n);break;case a.PAGE_DOWN:t=!0,this._move("nextPage",n);break;case a.UP:t=!0,this._keyEvent("previous",n);break;case a.DOWN:t=!0,this._keyEvent("next",n);break;case a.ENTER:this.menu.active&&(t=!0,n.preventDefault(),this.menu.select(n));break;case a.TAB:this.menu.active&&this.menu.select(n);break;case a.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(t)return t=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),void 0;if(!i){var n=e.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(e){return s?(s=!1,e.preventDefault(),void 0):(this._searchTimeout(e),void 0)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,void 0):(clearTimeout(this.searching),this.close(e),this._change(e),void 0)}}),this._initSource(),this.menu=e("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var i=this.menu.element[0];e(t.target).closest(".ui-menu-item").length||this._delay(function(){var t=this;this.document.one("mousedown",function(s){s.target===t.element[0]||s.target===i||e.contains(i,s.target)||t.close()})})},menufocus:function(t,i){var s,n;return this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type))?(this.menu.blur(),this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)}),void 0):(n=i.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",t,{item:n})&&t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(n.value),s=i.item.attr("aria-label")||n.value,s&&e.trim(s).length&&(this.liveRegion.children().hide(),e("<div>").text(s).appendTo(this.liveRegion)),void 0)},menuselect:function(e,t){var i=t.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",e,{item:i})&&this._value(i.value),this.term=this._value(),this.close(e),this.selectedItem=i}}),this.liveRegion=e("<span>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),"source"===e&&this._initSource(),"appendTo"===e&&this.menu.element.appendTo(this._appendTo()),"disabled"===e&&t&&this.xhr&&this.xhr.abort()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t&&t[0]||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_initSource:function(){var t,i,s=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(i,s){s(e.ui.autocomplete.filter(t,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(t,n){s.xhr&&s.xhr.abort(),s.xhr=e.ajax({url:i,data:t,dataType:"json",success:function(e){n(e)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(e){clearTimeout(this.searching),this.searching=this._delay(function(){var t=this.term===this._value(),i=this.menu.element.is(":visible"),s=e.altKey||e.ctrlKey||e.metaKey||e.shiftKey;(!t||t&&!i&&!s)&&(this.selectedItem=null,this.search(null,e))},this.options.delay)},search:function(e,t){return e=null!=e?e:this._value(),this.term=this._value(),e.length<this.options.minLength?this.close(t):this._trigger("search",t)!==!1?this._search(e):void 0},_search:function(e){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var t=++this.requestIndex;return e.proxy(function(e){t===this.requestIndex&&this.__response(e),this.pending--,this.pending||this.element.removeClass("ui-autocomplete-loading")},this)},__response:function(e){e&&(e=this._normalize(e)),this._trigger("response",null,{content:e}),!this.options.disabled&&e&&e.length&&!this.cancelSearch?(this._suggest(e),this._trigger("open")):this._close()},close:function(e){this.cancelSearch=!0,this._close(e)},_close:function(e){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",e))},_change:function(e){this.previous!==this._value()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:e.map(t,function(t){return"string"==typeof t?{label:t,value:t}:e.extend({},t,{label:t.label||t.value,value:t.value||t.label})})},_suggest:function(t){var i=this.menu.element.empty();this._renderMenu(i,t),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(e.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(t,i){var s=this;e.each(i,function(e,i){s._renderItemData(t,i)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(t,i){return e("<li>").text(i.label).appendTo(t)},_move:function(e,t){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)?(this.isMultiLine||this._value(this.term),this.menu.blur(),void 0):(this.menu[e](t),void 0):(this.search(null,t),void 0)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(e,t),t.preventDefault())}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,i){var s=RegExp(e.ui.autocomplete.escapeRegex(i),"i");return e.grep(t,function(e){return s.test(e.label||e.value||e)})}}),e.widget("ui.autocomplete",e.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(e>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var i;this._superApply(arguments),this.options.disabled||this.cancelSearch||(i=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,this.liveRegion.children().hide(),e("<div>").text(i).appendTo(this.liveRegion))}}),e.ui.autocomplete;var c,p="ui-button ui-widget ui-state-default ui-corner-all",f="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",m=function(){var t=e(this);setTimeout(function(){t.find(":ui-button").button("refresh")},1)},g=function(t){var i=t.name,s=t.form,n=e([]);return i&&(i=i.replace(/'/g,"\\'"),n=s?e(s).find("[name='"+i+"'][type=radio]"):e("[name='"+i+"'][type=radio]",t.ownerDocument).filter(function(){return!this.form})),n};e.widget("ui.button",{version:"1.11.4",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,m),"boolean"!=typeof this.options.disabled?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var t=this,i=this.options,s="checkbox"===this.type||"radio"===this.type,n=s?"":"ui-state-active";null===i.label&&(i.label="input"===this.type?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(p).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){i.disabled||this===c&&e(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){i.disabled||e(this).removeClass(n)}).bind("click"+this.eventNamespace,function(e){i.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}),this._on({focus:function(){this.buttonElement.addClass("ui-state-focus")},blur:function(){this.buttonElement.removeClass("ui-state-focus")}}),s&&this.element.bind("change"+this.eventNamespace,function(){t.refresh()}),"checkbox"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){return i.disabled?!1:void 0}):"radio"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(i.disabled)return!1;e(this).addClass("ui-state-active"),t.buttonElement.attr("aria-pressed","true");var s=t.element[0];g(s).not(s).map(function(){return e(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){return i.disabled?!1:(e(this).addClass("ui-state-active"),c=this,t.document.one("mouseup",function(){c=null}),void 0)}).bind("mouseup"+this.eventNamespace,function(){return i.disabled?!1:(e(this).removeClass("ui-state-active"),void 0)}).bind("keydown"+this.eventNamespace,function(t){return i.disabled?!1:((t.keyCode===e.ui.keyCode.SPACE||t.keyCode===e.ui.keyCode.ENTER)&&e(this).addClass("ui-state-active"),void 0)}).bind("keyup"+this.eventNamespace+" blur"+this.eventNamespace,function(){e(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(t){t.keyCode===e.ui.keyCode.SPACE&&e(this).click()})),this._setOption("disabled",i.disabled),this._resetButton()},_determineButtonType:function(){var e,t,i;this.type=this.element.is("[type=checkbox]")?"checkbox":this.element.is("[type=radio]")?"radio":this.element.is("input")?"input":"button","checkbox"===this.type||"radio"===this.type?(e=this.element.parents().last(),t="label[for='"+this.element.attr("id")+"']",this.buttonElement=e.find(t),this.buttonElement.length||(e=e.length?e.siblings():this.element.siblings(),this.buttonElement=e.filter(t),this.buttonElement.length||(this.buttonElement=e.find(t))),this.element.addClass("ui-helper-hidden-accessible"),i=this.element.is(":checked"),i&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",i)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(p+" ui-state-active "+f).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(e,t){return this._super(e,t),"disabled"===e?(this.widget().toggleClass("ui-state-disabled",!!t),this.element.prop("disabled",!!t),t&&("checkbox"===this.type||"radio"===this.type?this.buttonElement.removeClass("ui-state-focus"):this.buttonElement.removeClass("ui-state-focus ui-state-active")),void 0):(this._resetButton(),void 0)},refresh:function(){var t=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOption("disabled",t),"radio"===this.type?g(this.element[0]).each(function(){e(this).is(":checked")?e(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):e(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):"checkbox"===this.type&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if("input"===this.type)return this.options.label&&this.element.val(this.options.label),void 0;var t=this.buttonElement.removeClass(f),i=e("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(t.empty()).text(),s=this.options.icons,n=s.primary&&s.secondary,a=[];s.primary||s.secondary?(this.options.text&&a.push("ui-button-text-icon"+(n?"s":s.primary?"-primary":"-secondary")),s.primary&&t.prepend("<span class='ui-button-icon-primary ui-icon "+s.primary+"'></span>"),s.secondary&&t.append("<span class='ui-button-icon-secondary ui-icon "+s.secondary+"'></span>"),this.options.text||(a.push(n?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||t.attr("title",e.trim(i)))):a.push("ui-button-text-only"),t.addClass(a.join(" "))}}),e.widget("ui.buttonset",{version:"1.11.4",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(e,t){"disabled"===e&&this.buttons.button("option",e,t),this._super(e,t)},refresh:function(){var t="rtl"===this.element.css("direction"),i=this.element.find(this.options.items),s=i.filter(":ui-button");i.not(":ui-button").button(),s.button("refresh"),this.buttons=i.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(t?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(t?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}}),e.ui.button,e.extend(e.ui,{datepicker:{version:"1.11.4"}});var v;e.extend(n.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return r(this._defaults,e||{}),this},_attachDatepicker:function(t,i){var s,n,a;s=t.nodeName.toLowerCase(),n="div"===s||"span"===s,t.id||(this.uuid+=1,t.id="dp"+this.uuid),a=this._newInst(e(t),n),a.settings=e.extend({},i||{}),"input"===s?this._connectDatepicker(t,a):n&&this._inlineDatepicker(t,a)},_newInst:function(t,i){var s=t[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:s,input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?a(e("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(t,i){var s=e(t);i.append=e([]),i.trigger=e([]),s.hasClass(this.markerClassName)||(this._attachments(s,i),s.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(i),e.data(t,"datepicker",i),i.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,i){var s,n,a,o=this._get(i,"appendText"),r=this._get(i,"isRTL");i.append&&i.append.remove(),o&&(i.append=e("<span class='"+this._appendClass+"'>"+o+"</span>"),t[r?"before":"after"](i.append)),t.unbind("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),s=this._get(i,"showOn"),("focus"===s||"both"===s)&&t.focus(this._showDatepicker),("button"===s||"both"===s)&&(n=this._get(i,"buttonText"),a=this._get(i,"buttonImage"),i.trigger=e(this._get(i,"buttonImageOnly")?e("<img/>").addClass(this._triggerClass).attr({src:a,alt:n,title:n}):e("<button type='button'></button>").addClass(this._triggerClass).html(a?e("<img/>").attr({src:a,alt:n,title:n}):n)),t[r?"before":"after"](i.trigger),i.trigger.click(function(){return e.datepicker._datepickerShowing&&e.datepicker._lastInput===t[0]?e.datepicker._hideDatepicker():e.datepicker._datepickerShowing&&e.datepicker._lastInput!==t[0]?(e.datepicker._hideDatepicker(),e.datepicker._showDatepicker(t[0])):e.datepicker._showDatepicker(t[0]),!1}))},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t,i,s,n,a=new Date(2009,11,20),o=this._get(e,"dateFormat");o.match(/[DM]/)&&(t=function(e){for(i=0,s=0,n=0;e.length>n;n++)e[n].length>i&&(i=e[n].length,s=n);return s},a.setMonth(t(this._get(e,o.match(/MM/)?"monthNames":"monthNamesShort"))),a.setDate(t(this._get(e,o.match(/DD/)?"dayNames":"dayNamesShort"))+20-a.getDay())),e.input.attr("size",this._formatDate(e,a).length)}},_inlineDatepicker:function(t,i){var s=e(t);s.hasClass(this.markerClassName)||(s.addClass(this.markerClassName).append(i.dpDiv),e.data(t,"datepicker",i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(t),i.dpDiv.css("display","block"))},_dialogDatepicker:function(t,i,s,n,a){var o,h,l,u,d,c=this._dialogInst;return c||(this.uuid+=1,o="dp"+this.uuid,this._dialogInput=e("<input type='text' id='"+o+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.keydown(this._doKeyDown),e("body").append(this._dialogInput),c=this._dialogInst=this._newInst(this._dialogInput,!1),c.settings={},e.data(this._dialogInput[0],"datepicker",c)),r(c.settings,n||{}),i=i&&i.constructor===Date?this._formatDate(c,i):i,this._dialogInput.val(i),this._pos=a?a.length?a:[a.pageX,a.pageY]:null,this._pos||(h=document.documentElement.clientWidth,l=document.documentElement.clientHeight,u=document.documentElement.scrollLeft||document.body.scrollLeft,d=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[h/2-100+u,l/2-150+d]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),c.settings.onSelect=s,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),e.blockUI&&e.blockUI(this.dpDiv),e.data(this._dialogInput[0],"datepicker",c),this},_destroyDatepicker:function(t){var i,s=e(t),n=e.data(t,"datepicker");s.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),e.removeData(t,"datepicker"),"input"===i?(n.append.remove(),n.trigger.remove(),s.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"===i||"span"===i)&&s.removeClass(this.markerClassName).empty(),v===n&&(v=null))},_enableDatepicker:function(t){var i,s,n=e(t),a=e.data(t,"datepicker");n.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!1,a.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().removeClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}))},_disableDatepicker:function(t){var i,s,n=e(t),a=e.data(t,"datepicker");n.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!0,a.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().addClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;this._disabledInputs.length>t;t++)if(this._disabledInputs[t]===e)return!0;return!1},_getInst:function(t){try{return e.data(t,"datepicker")}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(t,i,s){var n,a,o,h,l=this._getInst(t);return 2===arguments.length&&"string"==typeof i?"defaults"===i?e.extend({},e.datepicker._defaults):l?"all"===i?e.extend({},l.settings):this._get(l,i):null:(n=i||{},"string"==typeof i&&(n={},n[i]=s),l&&(this._curInst===l&&this._hideDatepicker(),a=this._getDateDatepicker(t,!0),o=this._getMinMaxDate(l,"min"),h=this._getMinMaxDate(l,"max"),r(l.settings,n),null!==o&&void 0!==n.dateFormat&&void 0===n.minDate&&(l.settings.minDate=this._formatDate(l,o)),null!==h&&void 0!==n.dateFormat&&void 0===n.maxDate&&(l.settings.maxDate=this._formatDate(l,h)),"disabled"in n&&(n.disabled?this._disableDatepicker(t):this._enableDatepicker(t)),this._attachments(e(t),l),this._autoSize(l),this._setDate(l,a),this._updateAlternate(l),this._updateDatepicker(l)),void 0)},_changeDatepicker:function(e,t,i){this._optionDatepicker(e,t,i)},_refreshDatepicker:function(e){var t=this._getInst(e);t&&this._updateDatepicker(t)},_setDateDatepicker:function(e,t){var i=this._getInst(e);i&&(this._setDate(i,t),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(e,t){var i=this._getInst(e);return i&&!i.inline&&this._setDateFromField(i,t),i?this._getDate(i):null},_doKeyDown:function(t){var i,s,n,a=e.datepicker._getInst(t.target),o=!0,r=a.dpDiv.is(".ui-datepicker-rtl");if(a._keyEvent=!0,e.datepicker._datepickerShowing)switch(t.keyCode){case 9:e.datepicker._hideDatepicker(),o=!1;break;case 13:return n=e("td."+e.datepicker._dayOverClass+":not(."+e.datepicker._currentClass+")",a.dpDiv),n[0]&&e.datepicker._selectDay(t.target,a.selectedMonth,a.selectedYear,n[0]),i=e.datepicker._get(a,"onSelect"),i?(s=e.datepicker._formatDate(a),i.apply(a.input?a.input[0]:null,[s,a])):e.datepicker._hideDatepicker(),!1;case 27:e.datepicker._hideDatepicker();break;case 33:e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(a,"stepBigMonths"):-e.datepicker._get(a,"stepMonths"),"M");break;case 34:e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(a,"stepBigMonths"):+e.datepicker._get(a,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&e.datepicker._clearDate(t.target),o=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&e.datepicker._gotoToday(t.target),o=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,r?1:-1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(a,"stepBigMonths"):-e.datepicker._get(a,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,-7,"D"),o=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,r?-1:1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(a,"stepBigMonths"):+e.datepicker._get(a,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,7,"D"),o=t.ctrlKey||t.metaKey;break;default:o=!1}else 36===t.keyCode&&t.ctrlKey?e.datepicker._showDatepicker(this):o=!1;o&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(t){var i,s,n=e.datepicker._getInst(t.target);
|
|
8
|
+
return e.datepicker._get(n,"constrainInput")?(i=e.datepicker._possibleChars(e.datepicker._get(n,"dateFormat")),s=String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),t.ctrlKey||t.metaKey||" ">s||!i||i.indexOf(s)>-1):void 0},_doKeyUp:function(t){var i,s=e.datepicker._getInst(t.target);if(s.input.val()!==s.lastVal)try{i=e.datepicker.parseDate(e.datepicker._get(s,"dateFormat"),s.input?s.input.val():null,e.datepicker._getFormatConfig(s)),i&&(e.datepicker._setDateFromField(s),e.datepicker._updateAlternate(s),e.datepicker._updateDatepicker(s))}catch(n){}return!0},_showDatepicker:function(t){if(t=t.target||t,"input"!==t.nodeName.toLowerCase()&&(t=e("input",t.parentNode)[0]),!e.datepicker._isDisabledDatepicker(t)&&e.datepicker._lastInput!==t){var i,n,a,o,h,l,u;i=e.datepicker._getInst(t),e.datepicker._curInst&&e.datepicker._curInst!==i&&(e.datepicker._curInst.dpDiv.stop(!0,!0),i&&e.datepicker._datepickerShowing&&e.datepicker._hideDatepicker(e.datepicker._curInst.input[0])),n=e.datepicker._get(i,"beforeShow"),a=n?n.apply(t,[t,i]):{},a!==!1&&(r(i.settings,a),i.lastVal=null,e.datepicker._lastInput=t,e.datepicker._setDateFromField(i),e.datepicker._inDialog&&(t.value=""),e.datepicker._pos||(e.datepicker._pos=e.datepicker._findPos(t),e.datepicker._pos[1]+=t.offsetHeight),o=!1,e(t).parents().each(function(){return o|="fixed"===e(this).css("position"),!o}),h={left:e.datepicker._pos[0],top:e.datepicker._pos[1]},e.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),e.datepicker._updateDatepicker(i),h=e.datepicker._checkOffset(i,h,o),i.dpDiv.css({position:e.datepicker._inDialog&&e.blockUI?"static":o?"fixed":"absolute",display:"none",left:h.left+"px",top:h.top+"px"}),i.inline||(l=e.datepicker._get(i,"showAnim"),u=e.datepicker._get(i,"duration"),i.dpDiv.css("z-index",s(e(t))+1),e.datepicker._datepickerShowing=!0,e.effects&&e.effects.effect[l]?i.dpDiv.show(l,e.datepicker._get(i,"showOptions"),u):i.dpDiv[l||"show"](l?u:null),e.datepicker._shouldFocusInput(i)&&i.input.focus(),e.datepicker._curInst=i))}},_updateDatepicker:function(t){this.maxRows=4,v=t,t.dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t);var i,s=this._getNumberOfMonths(t),n=s[1],a=17,r=t.dpDiv.find("."+this._dayOverClass+" a");r.length>0&&o.apply(r.get(0)),t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),n>1&&t.dpDiv.addClass("ui-datepicker-multi-"+n).css("width",a*n+"em"),t.dpDiv[(1!==s[0]||1!==s[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t===e.datepicker._curInst&&e.datepicker._datepickerShowing&&e.datepicker._shouldFocusInput(t)&&t.input.focus(),t.yearshtml&&(i=t.yearshtml,setTimeout(function(){i===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml),i=t.yearshtml=null},0))},_shouldFocusInput:function(e){return e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&!e.input.is(":focus")},_checkOffset:function(t,i,s){var n=t.dpDiv.outerWidth(),a=t.dpDiv.outerHeight(),o=t.input?t.input.outerWidth():0,r=t.input?t.input.outerHeight():0,h=document.documentElement.clientWidth+(s?0:e(document).scrollLeft()),l=document.documentElement.clientHeight+(s?0:e(document).scrollTop());return i.left-=this._get(t,"isRTL")?n-o:0,i.left-=s&&i.left===t.input.offset().left?e(document).scrollLeft():0,i.top-=s&&i.top===t.input.offset().top+r?e(document).scrollTop():0,i.left-=Math.min(i.left,i.left+n>h&&h>n?Math.abs(i.left+n-h):0),i.top-=Math.min(i.top,i.top+a>l&&l>a?Math.abs(a+r):0),i},_findPos:function(t){for(var i,s=this._getInst(t),n=this._get(s,"isRTL");t&&("hidden"===t.type||1!==t.nodeType||e.expr.filters.hidden(t));)t=t[n?"previousSibling":"nextSibling"];return i=e(t).offset(),[i.left,i.top]},_hideDatepicker:function(t){var i,s,n,a,o=this._curInst;!o||t&&o!==e.data(t,"datepicker")||this._datepickerShowing&&(i=this._get(o,"showAnim"),s=this._get(o,"duration"),n=function(){e.datepicker._tidyDialog(o)},e.effects&&(e.effects.effect[i]||e.effects[i])?o.dpDiv.hide(i,e.datepicker._get(o,"showOptions"),s,n):o.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?s:null,n),i||n(),this._datepickerShowing=!1,a=this._get(o,"onClose"),a&&a.apply(o.input?o.input[0]:null,[o.input?o.input.val():"",o]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),e.blockUI&&(e.unblockUI(),e("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(t){if(e.datepicker._curInst){var i=e(t.target),s=e.datepicker._getInst(i[0]);(i[0].id!==e.datepicker._mainDivId&&0===i.parents("#"+e.datepicker._mainDivId).length&&!i.hasClass(e.datepicker.markerClassName)&&!i.closest("."+e.datepicker._triggerClass).length&&e.datepicker._datepickerShowing&&(!e.datepicker._inDialog||!e.blockUI)||i.hasClass(e.datepicker.markerClassName)&&e.datepicker._curInst!==s)&&e.datepicker._hideDatepicker()}},_adjustDate:function(t,i,s){var n=e(t),a=this._getInst(n[0]);this._isDisabledDatepicker(n[0])||(this._adjustInstDate(a,i+("M"===s?this._get(a,"showCurrentAtPos"):0),s),this._updateDatepicker(a))},_gotoToday:function(t){var i,s=e(t),n=this._getInst(s[0]);this._get(n,"gotoCurrent")&&n.currentDay?(n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear):(i=new Date,n.selectedDay=i.getDate(),n.drawMonth=n.selectedMonth=i.getMonth(),n.drawYear=n.selectedYear=i.getFullYear()),this._notifyChange(n),this._adjustDate(s)},_selectMonthYear:function(t,i,s){var n=e(t),a=this._getInst(n[0]);a["selected"+("M"===s?"Month":"Year")]=a["draw"+("M"===s?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(a),this._adjustDate(n)},_selectDay:function(t,i,s,n){var a,o=e(t);e(n).hasClass(this._unselectableClass)||this._isDisabledDatepicker(o[0])||(a=this._getInst(o[0]),a.selectedDay=a.currentDay=e("a",n).html(),a.selectedMonth=a.currentMonth=i,a.selectedYear=a.currentYear=s,this._selectDate(t,this._formatDate(a,a.currentDay,a.currentMonth,a.currentYear)))},_clearDate:function(t){var i=e(t);this._selectDate(i,"")},_selectDate:function(t,i){var s,n=e(t),a=this._getInst(n[0]);i=null!=i?i:this._formatDate(a),a.input&&a.input.val(i),this._updateAlternate(a),s=this._get(a,"onSelect"),s?s.apply(a.input?a.input[0]:null,[i,a]):a.input&&a.input.trigger("change"),a.inline?this._updateDatepicker(a):(this._hideDatepicker(),this._lastInput=a.input[0],"object"!=typeof a.input[0]&&a.input.focus(),this._lastInput=null)},_updateAlternate:function(t){var i,s,n,a=this._get(t,"altField");a&&(i=this._get(t,"altFormat")||this._get(t,"dateFormat"),s=this._getDate(t),n=this.formatDate(i,s,this._getFormatConfig(t)),e(a).each(function(){e(this).val(n)}))},noWeekends:function(e){var t=e.getDay();return[t>0&&6>t,""]},iso8601Week:function(e){var t,i=new Date(e.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),t=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((t-i)/864e5)/7)+1},parseDate:function(t,i,s){if(null==t||null==i)throw"Invalid arguments";if(i="object"==typeof i?""+i:i+"",""===i)return null;var n,a,o,r,h=0,l=(s?s.shortYearCutoff:null)||this._defaults.shortYearCutoff,u="string"!=typeof l?l:(new Date).getFullYear()%100+parseInt(l,10),d=(s?s.dayNamesShort:null)||this._defaults.dayNamesShort,c=(s?s.dayNames:null)||this._defaults.dayNames,p=(s?s.monthNamesShort:null)||this._defaults.monthNamesShort,f=(s?s.monthNames:null)||this._defaults.monthNames,m=-1,g=-1,v=-1,y=-1,b=!1,_=function(e){var i=t.length>n+1&&t.charAt(n+1)===e;return i&&n++,i},x=function(e){var t=_(e),s="@"===e?14:"!"===e?20:"y"===e&&t?4:"o"===e?3:2,n="y"===e?s:1,a=RegExp("^\\d{"+n+","+s+"}"),o=i.substring(h).match(a);if(!o)throw"Missing number at position "+h;return h+=o[0].length,parseInt(o[0],10)},w=function(t,s,n){var a=-1,o=e.map(_(t)?n:s,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)});if(e.each(o,function(e,t){var s=t[1];return i.substr(h,s.length).toLowerCase()===s.toLowerCase()?(a=t[0],h+=s.length,!1):void 0}),-1!==a)return a+1;throw"Unknown name at position "+h},k=function(){if(i.charAt(h)!==t.charAt(n))throw"Unexpected literal at position "+h;h++};for(n=0;t.length>n;n++)if(b)"'"!==t.charAt(n)||_("'")?k():b=!1;else switch(t.charAt(n)){case"d":v=x("d");break;case"D":w("D",d,c);break;case"o":y=x("o");break;case"m":g=x("m");break;case"M":g=w("M",p,f);break;case"y":m=x("y");break;case"@":r=new Date(x("@")),m=r.getFullYear(),g=r.getMonth()+1,v=r.getDate();break;case"!":r=new Date((x("!")-this._ticksTo1970)/1e4),m=r.getFullYear(),g=r.getMonth()+1,v=r.getDate();break;case"'":_("'")?k():b=!0;break;default:k()}if(i.length>h&&(o=i.substr(h),!/^\s+/.test(o)))throw"Extra/unparsed characters found in date: "+o;if(-1===m?m=(new Date).getFullYear():100>m&&(m+=(new Date).getFullYear()-(new Date).getFullYear()%100+(u>=m?0:-100)),y>-1)for(g=1,v=y;;){if(a=this._getDaysInMonth(m,g-1),a>=v)break;g++,v-=a}if(r=this._daylightSavingAdjust(new Date(m,g-1,v)),r.getFullYear()!==m||r.getMonth()+1!==g||r.getDate()!==v)throw"Invalid date";return r},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(e,t,i){if(!t)return"";var s,n=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,a=(i?i.dayNames:null)||this._defaults.dayNames,o=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,r=(i?i.monthNames:null)||this._defaults.monthNames,h=function(t){var i=e.length>s+1&&e.charAt(s+1)===t;return i&&s++,i},l=function(e,t,i){var s=""+t;if(h(e))for(;i>s.length;)s="0"+s;return s},u=function(e,t,i,s){return h(e)?s[t]:i[t]},d="",c=!1;if(t)for(s=0;e.length>s;s++)if(c)"'"!==e.charAt(s)||h("'")?d+=e.charAt(s):c=!1;else switch(e.charAt(s)){case"d":d+=l("d",t.getDate(),2);break;case"D":d+=u("D",t.getDay(),n,a);break;case"o":d+=l("o",Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5),3);break;case"m":d+=l("m",t.getMonth()+1,2);break;case"M":d+=u("M",t.getMonth(),o,r);break;case"y":d+=h("y")?t.getFullYear():(10>t.getYear()%100?"0":"")+t.getYear()%100;break;case"@":d+=t.getTime();break;case"!":d+=1e4*t.getTime()+this._ticksTo1970;break;case"'":h("'")?d+="'":c=!0;break;default:d+=e.charAt(s)}return d},_possibleChars:function(e){var t,i="",s=!1,n=function(i){var s=e.length>t+1&&e.charAt(t+1)===i;return s&&t++,s};for(t=0;e.length>t;t++)if(s)"'"!==e.charAt(t)||n("'")?i+=e.charAt(t):s=!1;else switch(e.charAt(t)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":n("'")?i+="'":s=!0;break;default:i+=e.charAt(t)}return i},_get:function(e,t){return void 0!==e.settings[t]?e.settings[t]:this._defaults[t]},_setDateFromField:function(e,t){if(e.input.val()!==e.lastVal){var i=this._get(e,"dateFormat"),s=e.lastVal=e.input?e.input.val():null,n=this._getDefaultDate(e),a=n,o=this._getFormatConfig(e);try{a=this.parseDate(i,s,o)||n}catch(r){s=t?"":s}e.selectedDay=a.getDate(),e.drawMonth=e.selectedMonth=a.getMonth(),e.drawYear=e.selectedYear=a.getFullYear(),e.currentDay=s?a.getDate():0,e.currentMonth=s?a.getMonth():0,e.currentYear=s?a.getFullYear():0,this._adjustInstDate(e)}},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(t,i,s){var n=function(e){var t=new Date;return t.setDate(t.getDate()+e),t},a=function(i){try{return e.datepicker.parseDate(e.datepicker._get(t,"dateFormat"),i,e.datepicker._getFormatConfig(t))}catch(s){}for(var n=(i.toLowerCase().match(/^c/)?e.datepicker._getDate(t):null)||new Date,a=n.getFullYear(),o=n.getMonth(),r=n.getDate(),h=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,l=h.exec(i);l;){switch(l[2]||"d"){case"d":case"D":r+=parseInt(l[1],10);break;case"w":case"W":r+=7*parseInt(l[1],10);break;case"m":case"M":o+=parseInt(l[1],10),r=Math.min(r,e.datepicker._getDaysInMonth(a,o));break;case"y":case"Y":a+=parseInt(l[1],10),r=Math.min(r,e.datepicker._getDaysInMonth(a,o))}l=h.exec(i)}return new Date(a,o,r)},o=null==i||""===i?s:"string"==typeof i?a(i):"number"==typeof i?isNaN(i)?s:n(i):new Date(i.getTime());return o=o&&"Invalid Date"==""+o?s:o,o&&(o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0)),this._daylightSavingAdjust(o)},_daylightSavingAdjust:function(e){return e?(e.setHours(e.getHours()>12?e.getHours()+2:0),e):null},_setDate:function(e,t,i){var s=!t,n=e.selectedMonth,a=e.selectedYear,o=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=o.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=o.getMonth(),e.drawYear=e.selectedYear=e.currentYear=o.getFullYear(),n===e.selectedMonth&&a===e.selectedYear||i||this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(s?"":this._formatDate(e))},_getDate:function(e){var t=!e.currentYear||e.input&&""===e.input.val()?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return t},_attachHandlers:function(t){var i=this._get(t,"stepMonths"),s="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){e.datepicker._adjustDate(s,-i,"M")},next:function(){e.datepicker._adjustDate(s,+i,"M")},hide:function(){e.datepicker._hideDatepicker()},today:function(){e.datepicker._gotoToday(s)},selectDay:function(){return e.datepicker._selectDay(s,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return e.datepicker._selectMonthYear(s,this,"M"),!1},selectYear:function(){return e.datepicker._selectMonthYear(s,this,"Y"),!1}};e(this).bind(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t,i,s,n,a,o,r,h,l,u,d,c,p,f,m,g,v,y,b,_,x,w,k,T,D,S,M,C,N,A,P,I,H,z,F,E,O,j,W,L=new Date,R=this._daylightSavingAdjust(new Date(L.getFullYear(),L.getMonth(),L.getDate())),Y=this._get(e,"isRTL"),B=this._get(e,"showButtonPanel"),J=this._get(e,"hideIfNoPrevNext"),q=this._get(e,"navigationAsDateFormat"),K=this._getNumberOfMonths(e),V=this._get(e,"showCurrentAtPos"),U=this._get(e,"stepMonths"),Q=1!==K[0]||1!==K[1],G=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),X=this._getMinMaxDate(e,"min"),$=this._getMinMaxDate(e,"max"),Z=e.drawMonth-V,et=e.drawYear;if(0>Z&&(Z+=12,et--),$)for(t=this._daylightSavingAdjust(new Date($.getFullYear(),$.getMonth()-K[0]*K[1]+1,$.getDate())),t=X&&X>t?X:t;this._daylightSavingAdjust(new Date(et,Z,1))>t;)Z--,0>Z&&(Z=11,et--);for(e.drawMonth=Z,e.drawYear=et,i=this._get(e,"prevText"),i=q?this.formatDate(i,this._daylightSavingAdjust(new Date(et,Z-U,1)),this._getFormatConfig(e)):i,s=this._canAdjustMonth(e,-1,et,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>":J?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>",n=this._get(e,"nextText"),n=q?this.formatDate(n,this._daylightSavingAdjust(new Date(et,Z+U,1)),this._getFormatConfig(e)):n,a=this._canAdjustMonth(e,1,et,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>":J?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>",o=this._get(e,"currentText"),r=this._get(e,"gotoCurrent")&&e.currentDay?G:R,o=q?this.formatDate(o,r,this._getFormatConfig(e)):o,h=e.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(e,"closeText")+"</button>",l=B?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(Y?h:"")+(this._isInRange(e,r)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+o+"</button>":"")+(Y?"":h)+"</div>":"",u=parseInt(this._get(e,"firstDay"),10),u=isNaN(u)?0:u,d=this._get(e,"showWeek"),c=this._get(e,"dayNames"),p=this._get(e,"dayNamesMin"),f=this._get(e,"monthNames"),m=this._get(e,"monthNamesShort"),g=this._get(e,"beforeShowDay"),v=this._get(e,"showOtherMonths"),y=this._get(e,"selectOtherMonths"),b=this._getDefaultDate(e),_="",w=0;K[0]>w;w++){for(k="",this.maxRows=4,T=0;K[1]>T;T++){if(D=this._daylightSavingAdjust(new Date(et,Z,e.selectedDay)),S=" ui-corner-all",M="",Q){if(M+="<div class='ui-datepicker-group",K[1]>1)switch(T){case 0:M+=" ui-datepicker-group-first",S=" ui-corner-"+(Y?"right":"left");break;case K[1]-1:M+=" ui-datepicker-group-last",S=" ui-corner-"+(Y?"left":"right");break;default:M+=" ui-datepicker-group-middle",S=""}M+="'>"}for(M+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+S+"'>"+(/all|left/.test(S)&&0===w?Y?a:s:"")+(/all|right/.test(S)&&0===w?Y?s:a:"")+this._generateMonthYearHeader(e,Z,et,X,$,w>0||T>0,f,m)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",C=d?"<th class='ui-datepicker-week-col'>"+this._get(e,"weekHeader")+"</th>":"",x=0;7>x;x++)N=(x+u)%7,C+="<th scope='col'"+((x+u+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+c[N]+"'>"+p[N]+"</span></th>";for(M+=C+"</tr></thead><tbody>",A=this._getDaysInMonth(et,Z),et===e.selectedYear&&Z===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,A)),P=(this._getFirstDayOfMonth(et,Z)-u+7)%7,I=Math.ceil((P+A)/7),H=Q?this.maxRows>I?this.maxRows:I:I,this.maxRows=H,z=this._daylightSavingAdjust(new Date(et,Z,1-P)),F=0;H>F;F++){for(M+="<tr>",E=d?"<td class='ui-datepicker-week-col'>"+this._get(e,"calculateWeek")(z)+"</td>":"",x=0;7>x;x++)O=g?g.apply(e.input?e.input[0]:null,[z]):[!0,""],j=z.getMonth()!==Z,W=j&&!y||!O[0]||X&&X>z||$&&z>$,E+="<td class='"+((x+u+6)%7>=5?" ui-datepicker-week-end":"")+(j?" ui-datepicker-other-month":"")+(z.getTime()===D.getTime()&&Z===e.selectedMonth&&e._keyEvent||b.getTime()===z.getTime()&&b.getTime()===D.getTime()?" "+this._dayOverClass:"")+(W?" "+this._unselectableClass+" ui-state-disabled":"")+(j&&!v?"":" "+O[1]+(z.getTime()===G.getTime()?" "+this._currentClass:"")+(z.getTime()===R.getTime()?" ui-datepicker-today":""))+"'"+(j&&!v||!O[2]?"":" title='"+O[2].replace(/'/g,"'")+"'")+(W?"":" data-handler='selectDay' data-event='click' data-month='"+z.getMonth()+"' data-year='"+z.getFullYear()+"'")+">"+(j&&!v?" ":W?"<span class='ui-state-default'>"+z.getDate()+"</span>":"<a class='ui-state-default"+(z.getTime()===R.getTime()?" ui-state-highlight":"")+(z.getTime()===G.getTime()?" ui-state-active":"")+(j?" ui-priority-secondary":"")+"' href='#'>"+z.getDate()+"</a>")+"</td>",z.setDate(z.getDate()+1),z=this._daylightSavingAdjust(z);M+=E+"</tr>"}Z++,Z>11&&(Z=0,et++),M+="</tbody></table>"+(Q?"</div>"+(K[0]>0&&T===K[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),k+=M}_+=k}return _+=l,e._keyEvent=!1,_},_generateMonthYearHeader:function(e,t,i,s,n,a,o,r){var h,l,u,d,c,p,f,m,g=this._get(e,"changeMonth"),v=this._get(e,"changeYear"),y=this._get(e,"showMonthAfterYear"),b="<div class='ui-datepicker-title'>",_="";if(a||!g)_+="<span class='ui-datepicker-month'>"+o[t]+"</span>";else{for(h=s&&s.getFullYear()===i,l=n&&n.getFullYear()===i,_+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",u=0;12>u;u++)(!h||u>=s.getMonth())&&(!l||n.getMonth()>=u)&&(_+="<option value='"+u+"'"+(u===t?" selected='selected'":"")+">"+r[u]+"</option>");_+="</select>"}if(y||(b+=_+(!a&&g&&v?"":" ")),!e.yearshtml)if(e.yearshtml="",a||!v)b+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(d=this._get(e,"yearRange").split(":"),c=(new Date).getFullYear(),p=function(e){var t=e.match(/c[+\-].*/)?i+parseInt(e.substring(1),10):e.match(/[+\-].*/)?c+parseInt(e,10):parseInt(e,10);return isNaN(t)?c:t},f=p(d[0]),m=Math.max(f,p(d[1]||"")),f=s?Math.max(f,s.getFullYear()):f,m=n?Math.min(m,n.getFullYear()):m,e.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";m>=f;f++)e.yearshtml+="<option value='"+f+"'"+(f===i?" selected='selected'":"")+">"+f+"</option>";e.yearshtml+="</select>",b+=e.yearshtml,e.yearshtml=null}return b+=this._get(e,"yearSuffix"),y&&(b+=(!a&&g&&v?"":" ")+_),b+="</div>"},_adjustInstDate:function(e,t,i){var s=e.drawYear+("Y"===i?t:0),n=e.drawMonth+("M"===i?t:0),a=Math.min(e.selectedDay,this._getDaysInMonth(s,n))+("D"===i?t:0),o=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(s,n,a)));e.selectedDay=o.getDate(),e.drawMonth=e.selectedMonth=o.getMonth(),e.drawYear=e.selectedYear=o.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(e)},_restrictMinMax:function(e,t){var i=this._getMinMaxDate(e,"min"),s=this._getMinMaxDate(e,"max"),n=i&&i>t?i:t;return s&&n>s?s:n},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return null==t?[1,1]:"number"==typeof t?[1,t]:t},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return new Date(e,t,1).getDay()},_canAdjustMonth:function(e,t,i,s){var n=this._getNumberOfMonths(e),a=this._daylightSavingAdjust(new Date(i,s+(0>t?t:n[0]*n[1]),1));return 0>t&&a.setDate(this._getDaysInMonth(a.getFullYear(),a.getMonth())),this._isInRange(e,a)},_isInRange:function(e,t){var i,s,n=this._getMinMaxDate(e,"min"),a=this._getMinMaxDate(e,"max"),o=null,r=null,h=this._get(e,"yearRange");return h&&(i=h.split(":"),s=(new Date).getFullYear(),o=parseInt(i[0],10),r=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(o+=s),i[1].match(/[+\-].*/)&&(r+=s)),(!n||t.getTime()>=n.getTime())&&(!a||t.getTime()<=a.getTime())&&(!o||t.getFullYear()>=o)&&(!r||r>=t.getFullYear())},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t="string"!=typeof t?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,i,s){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var n=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(s,i,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),n,this._getFormatConfig(e))}}),e.fn.datepicker=function(t){if(!this.length)return this;e.datepicker.initialized||(e(document).mousedown(e.datepicker._checkExternalClick),e.datepicker.initialized=!0),0===e("#"+e.datepicker._mainDivId).length&&e("body").append(e.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof t||"isDisabled"!==t&&"getDate"!==t&&"widget"!==t?"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof t?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this].concat(i)):e.datepicker._attachDatepicker(this,t)}):e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i))},e.datepicker=new n,e.datepicker.initialized=!1,e.datepicker.uuid=(new Date).getTime(),e.datepicker.version="1.11.4",e.datepicker,e.widget("ui.draggable",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._setHandleClassName(),this._mouseInit()},_setOption:function(e,t){this._super(e,t),"handle"===e&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?(this.destroyOnClear=!0,void 0):(this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._removeHandleClassName(),this._mouseDestroy(),void 0)},_mouseCapture:function(t){var i=this.options;return this._blurActiveElement(t),this.helper||i.disabled||e(t.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(t),this.handle?(this._blockFrames(i.iframeFix===!0?"iframe":i.iframeFix),!0):!1)},_blockFrames:function(t){this.iframeBlocks=this.document.find(t).map(function(){var t=e(this);return e("<div>").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(t){var i=this.document[0];if(this.handleElement.is(t.target))try{i.activeElement&&"body"!==i.activeElement.nodeName.toLowerCase()&&e(i.activeElement).blur()}catch(s){}},_mouseStart:function(t){var i=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===e(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(t),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._normalizeRightBottom(),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_refreshOffsets:function(e){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:e.pageX-this.offset.left,top:e.pageY-this.offset.top}},_mouseDrag:function(t,i){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",t,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var i=this,s=!1;return e.ui.ddmanager&&!this.options.dropBehaviour&&(s=e.ui.ddmanager.drop(this,t)),this.dropped&&(s=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",t)!==!1&&i._clear()}):this._trigger("stop",t)!==!1&&this._clear(),!1},_mouseUp:function(t){return this._unblockFrames(),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),this.handleElement.is(t.target)&&this.element.focus(),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){return this.options.handle?!!e(t.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this.handleElement.addClass("ui-draggable-handle")},_removeHandleClassName:function(){this.handleElement.removeClass("ui-draggable-handle")},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper),n=s?e(i.helper.apply(this.element[0],[t])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return n.parents("body").length||n.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s&&n[0]===this.element[0]&&this._setPositionRelative(),n[0]===this.element[0]||/(fixed|absolute)/.test(n.css("position"))||n.css("position","absolute"),n},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_isRootNode:function(e){return/(html|body)/i.test(e.tagName)||e===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),i=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==i&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var e=this.element.position(),t=this._isRootNode(this.scrollParent[0]);return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+(t?0:this.scrollParent.scrollTop()),left:e.left-(parseInt(this.helper.css("left"),10)||0)+(t?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,n=this.options,a=this.document[0];return this.relativeContainer=null,n.containment?"window"===n.containment?(this.containment=[e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,e(window).scrollLeft()+e(window).width()-this.helperProportions.width-this.margins.left,e(window).scrollTop()+(e(window).height()||a.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):"document"===n.containment?(this.containment=[0,0,e(a).width()-this.helperProportions.width-this.margins.left,(e(a).height()||a.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):n.containment.constructor===Array?(this.containment=n.containment,void 0):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=e(n.containment),s=i[0],s&&(t=/(scroll|auto)/.test(i.css("overflow")),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(t?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=i),void 0):(this.containment=null,void 0)
|
|
9
|
+
},_convertPositionTo:function(e,t){t||(t=this.position);var i="absolute"===e?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:t.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:s?0:this.offset.scroll.top)*i,left:t.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:s?0:this.offset.scroll.left)*i}},_generatePosition:function(e,t){var i,s,n,a,o=this.options,r=this._isRootNode(this.scrollParent[0]),h=e.pageX,l=e.pageY;return r&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),t&&(this.containment&&(this.relativeContainer?(s=this.relativeContainer.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,e.pageX-this.offset.click.left<i[0]&&(h=i[0]+this.offset.click.left),e.pageY-this.offset.click.top<i[1]&&(l=i[1]+this.offset.click.top),e.pageX-this.offset.click.left>i[2]&&(h=i[2]+this.offset.click.left),e.pageY-this.offset.click.top>i[3]&&(l=i[3]+this.offset.click.top)),o.grid&&(n=o.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,l=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-o.grid[1]:n+o.grid[1]:n,a=o.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,h=i?a-this.offset.click.left>=i[0]||a-this.offset.click.left>i[2]?a:a-this.offset.click.left>=i[0]?a-o.grid[0]:a+o.grid[0]:a),"y"===o.axis&&(h=this.originalPageX),"x"===o.axis&&(l=this.originalPageY)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:r?0:this.offset.scroll.top),left:h-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:r?0:this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_normalizeRightBottom:function(){"y"!==this.options.axis&&"auto"!==this.helper.css("right")&&(this.helper.width(this.helper.width()),this.helper.css("right","auto")),"x"!==this.options.axis&&"auto"!==this.helper.css("bottom")&&(this.helper.height(this.helper.height()),this.helper.css("bottom","auto"))},_trigger:function(t,i,s){return s=s||this._uiHash(),e.ui.plugin.call(this,t,[i,s,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),s.offset=this.positionAbs),e.Widget.prototype._trigger.call(this,t,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,i,s){var n=e.extend({},i,{item:s.element});s.sortables=[],e(s.options.connectToSortable).each(function(){var i=e(this).sortable("instance");i&&!i.options.disabled&&(s.sortables.push(i),i.refreshPositions(),i._trigger("activate",t,n))})},stop:function(t,i,s){var n=e.extend({},i,{item:s.element});s.cancelHelperRemoval=!1,e.each(s.sortables,function(){var e=this;e.isOver?(e.isOver=0,s.cancelHelperRemoval=!0,e.cancelHelperRemoval=!1,e._storedCSS={position:e.placeholder.css("position"),top:e.placeholder.css("top"),left:e.placeholder.css("left")},e._mouseStop(t),e.options.helper=e.options._helper):(e.cancelHelperRemoval=!0,e._trigger("deactivate",t,n))})},drag:function(t,i,s){e.each(s.sortables,function(){var n=!1,a=this;a.positionAbs=s.positionAbs,a.helperProportions=s.helperProportions,a.offset.click=s.offset.click,a._intersectsWith(a.containerCache)&&(n=!0,e.each(s.sortables,function(){return this.positionAbs=s.positionAbs,this.helperProportions=s.helperProportions,this.offset.click=s.offset.click,this!==a&&this._intersectsWith(this.containerCache)&&e.contains(a.element[0],this.element[0])&&(n=!1),n})),n?(a.isOver||(a.isOver=1,s._parent=i.helper.parent(),a.currentItem=i.helper.appendTo(a.element).data("ui-sortable-item",!0),a.options._helper=a.options.helper,a.options.helper=function(){return i.helper[0]},t.target=a.currentItem[0],a._mouseCapture(t,!0),a._mouseStart(t,!0,!0),a.offset.click.top=s.offset.click.top,a.offset.click.left=s.offset.click.left,a.offset.parent.left-=s.offset.parent.left-a.offset.parent.left,a.offset.parent.top-=s.offset.parent.top-a.offset.parent.top,s._trigger("toSortable",t),s.dropped=a.element,e.each(s.sortables,function(){this.refreshPositions()}),s.currentItem=s.element,a.fromOutside=s),a.currentItem&&(a._mouseDrag(t),i.position=a.position)):a.isOver&&(a.isOver=0,a.cancelHelperRemoval=!0,a.options._revert=a.options.revert,a.options.revert=!1,a._trigger("out",t,a._uiHash(a)),a._mouseStop(t,!0),a.options.revert=a.options._revert,a.options.helper=a.options._helper,a.placeholder&&a.placeholder.remove(),i.helper.appendTo(s._parent),s._refreshOffsets(t),i.position=s._generatePosition(t,!0),s._trigger("fromSortable",t),s.dropped=!1,e.each(s.sortables,function(){this.refreshPositions()}))})}}),e.ui.plugin.add("draggable","cursor",{start:function(t,i,s){var n=e("body"),a=s.options;n.css("cursor")&&(a._cursor=n.css("cursor")),n.css("cursor",a.cursor)},stop:function(t,i,s){var n=s.options;n._cursor&&e("body").css("cursor",n._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,i,s){var n=e(i.helper),a=s.options;n.css("opacity")&&(a._opacity=n.css("opacity")),n.css("opacity",a.opacity)},stop:function(t,i,s){var n=s.options;n._opacity&&e(i.helper).css("opacity",n._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(e,t,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(t,i,s){var n=s.options,a=!1,o=s.scrollParentNotHidden[0],r=s.document[0];o!==r&&"HTML"!==o.tagName?(n.axis&&"x"===n.axis||(s.overflowOffset.top+o.offsetHeight-t.pageY<n.scrollSensitivity?o.scrollTop=a=o.scrollTop+n.scrollSpeed:t.pageY-s.overflowOffset.top<n.scrollSensitivity&&(o.scrollTop=a=o.scrollTop-n.scrollSpeed)),n.axis&&"y"===n.axis||(s.overflowOffset.left+o.offsetWidth-t.pageX<n.scrollSensitivity?o.scrollLeft=a=o.scrollLeft+n.scrollSpeed:t.pageX-s.overflowOffset.left<n.scrollSensitivity&&(o.scrollLeft=a=o.scrollLeft-n.scrollSpeed))):(n.axis&&"x"===n.axis||(t.pageY-e(r).scrollTop()<n.scrollSensitivity?a=e(r).scrollTop(e(r).scrollTop()-n.scrollSpeed):e(window).height()-(t.pageY-e(r).scrollTop())<n.scrollSensitivity&&(a=e(r).scrollTop(e(r).scrollTop()+n.scrollSpeed))),n.axis&&"y"===n.axis||(t.pageX-e(r).scrollLeft()<n.scrollSensitivity?a=e(r).scrollLeft(e(r).scrollLeft()-n.scrollSpeed):e(window).width()-(t.pageX-e(r).scrollLeft())<n.scrollSensitivity&&(a=e(r).scrollLeft(e(r).scrollLeft()+n.scrollSpeed)))),a!==!1&&e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(s,t)}}),e.ui.plugin.add("draggable","snap",{start:function(t,i,s){var n=s.options;s.snapElements=[],e(n.snap.constructor!==String?n.snap.items||":data(ui-draggable)":n.snap).each(function(){var t=e(this),i=t.offset();this!==s.element[0]&&s.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:i.top,left:i.left})})},drag:function(t,i,s){var n,a,o,r,h,l,u,d,c,p,f=s.options,m=f.snapTolerance,g=i.offset.left,v=g+s.helperProportions.width,y=i.offset.top,b=y+s.helperProportions.height;for(c=s.snapElements.length-1;c>=0;c--)h=s.snapElements[c].left-s.margins.left,l=h+s.snapElements[c].width,u=s.snapElements[c].top-s.margins.top,d=u+s.snapElements[c].height,h-m>v||g>l+m||u-m>b||y>d+m||!e.contains(s.snapElements[c].item.ownerDocument,s.snapElements[c].item)?(s.snapElements[c].snapping&&s.options.snap.release&&s.options.snap.release.call(s.element,t,e.extend(s._uiHash(),{snapItem:s.snapElements[c].item})),s.snapElements[c].snapping=!1):("inner"!==f.snapMode&&(n=m>=Math.abs(u-b),a=m>=Math.abs(d-y),o=m>=Math.abs(h-v),r=m>=Math.abs(l-g),n&&(i.position.top=s._convertPositionTo("relative",{top:u-s.helperProportions.height,left:0}).top),a&&(i.position.top=s._convertPositionTo("relative",{top:d,left:0}).top),o&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h-s.helperProportions.width}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l}).left)),p=n||a||o||r,"outer"!==f.snapMode&&(n=m>=Math.abs(u-y),a=m>=Math.abs(d-b),o=m>=Math.abs(h-g),r=m>=Math.abs(l-v),n&&(i.position.top=s._convertPositionTo("relative",{top:u,left:0}).top),a&&(i.position.top=s._convertPositionTo("relative",{top:d-s.helperProportions.height,left:0}).top),o&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l-s.helperProportions.width}).left)),!s.snapElements[c].snapping&&(n||a||o||r||p)&&s.options.snap.snap&&s.options.snap.snap.call(s.element,t,e.extend(s._uiHash(),{snapItem:s.snapElements[c].item})),s.snapElements[c].snapping=n||a||o||r||p)}}),e.ui.plugin.add("draggable","stack",{start:function(t,i,s){var n,a=s.options,o=e.makeArray(e(a.stack)).sort(function(t,i){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(i).css("zIndex"),10)||0)});o.length&&(n=parseInt(e(o[0]).css("zIndex"),10)||0,e(o).each(function(t){e(this).css("zIndex",n+t)}),this.css("zIndex",n+o.length))}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,i,s){var n=e(i.helper),a=s.options;n.css("zIndex")&&(a._zIndex=n.css("zIndex")),n.css("zIndex",a.zIndex)},stop:function(t,i,s){var n=s.options;n._zIndex&&e(i.helper).css("zIndex",n._zIndex)}}),e.ui.draggable,e.widget("ui.resizable",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(e){return parseInt(e,10)||0},_isNumber:function(e){return!isNaN(parseInt(e,10))},_hasScroll:function(t,i){if("hidden"===e(t).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",n=!1;return t[s]>0?!0:(t[s]=1,n=t[s]>0,t[s]=0,n)},_create:function(){var t,i,s,n,a,o=this,r=this.options;if(this.element.addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!r.aspectRatio,aspectRatio:r.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:r.helper||r.ghost||r.animate?r.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(e("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=r.handles||(e(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=e(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),t=this.handles.split(","),this.handles={},i=0;t.length>i;i++)s=e.trim(t[i]),a="ui-resizable-"+s,n=e("<div class='ui-resizable-handle "+a+"'></div>"),n.css({zIndex:r.zIndex}),"se"===s&&n.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(n);this._renderAxis=function(t){var i,s,n,a;t=t||this.element;for(i in this.handles)this.handles[i].constructor===String?this.handles[i]=this.element.children(this.handles[i]).first().show():(this.handles[i].jquery||this.handles[i].nodeType)&&(this.handles[i]=e(this.handles[i]),this._on(this.handles[i],{mousedown:o._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(s=e(this.handles[i],this.element),a=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),t.css(n,a),this._proportionallyResize()),this._handles=this._handles.add(this.handles[i])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.mouseover(function(){o.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),o.axis=n&&n[1]?n[1]:"se")}),r.autoHide&&(this._handles.hide(),e(this.element).addClass("ui-resizable-autohide").mouseenter(function(){r.disabled||(e(this).removeClass("ui-resizable-autohide"),o._handles.show())}).mouseleave(function(){r.disabled||o.resizing||(e(this).addClass("ui-resizable-autohide"),o._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t,i=function(t){e(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),t=this.element,this.originalElement.css({position:t.css("position"),width:t.outerWidth(),height:t.outerHeight(),top:t.css("top"),left:t.css("left")}).insertAfter(t),t.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_mouseCapture:function(t){var i,s,n=!1;for(i in this.handles)s=e(this.handles[i])[0],(s===t.target||e.contains(s,t.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(t){var i,s,n,a=this.options,o=this.element;return this.resizing=!0,this._renderProxy(),i=this._num(this.helper.css("left")),s=this._num(this.helper.css("top")),a.containment&&(i+=e(a.containment).scrollLeft()||0,s+=e(a.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:i,top:s},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:o.width(),height:o.height()},this.originalSize=this._helper?{width:o.outerWidth(),height:o.outerHeight()}:{width:o.width(),height:o.height()},this.sizeDiff={width:o.outerWidth()-o.width(),height:o.outerHeight()-o.height()},this.originalPosition={left:i,top:s},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof a.aspectRatio?a.aspectRatio:this.originalSize.width/this.originalSize.height||1,n=e(".ui-resizable-"+this.axis).css("cursor"),e("body").css("cursor","auto"===n?this.axis+"-resize":n),o.addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var i,s,n=this.originalMousePosition,a=this.axis,o=t.pageX-n.left||0,r=t.pageY-n.top||0,h=this._change[a];return this._updatePrevProperties(),h?(i=h.apply(this,[t,o,r]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(i=this._updateRatio(i,t)),i=this._respectSize(i,t),this._updateCache(i),this._propagate("resize",t),s=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),e.isEmptyObject(s)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges()),!1):!1},_mouseStop:function(t){this.resizing=!1;var i,s,n,a,o,r,h,l=this.options,u=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&this._hasScroll(i[0],"left")?0:u.sizeDiff.height,a=s?0:u.sizeDiff.width,o={width:u.helper.width()-a,height:u.helper.height()-n},r=parseInt(u.element.css("left"),10)+(u.position.left-u.originalPosition.left)||null,h=parseInt(u.element.css("top"),10)+(u.position.top-u.originalPosition.top)||null,l.animate||this.element.css(e.extend(o,{top:h,left:r})),u.helper.height(u.size.height),u.helper.width(u.size.width),this._helper&&!l.animate&&this._proportionallyResize()),e("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var e={};return this.position.top!==this.prevPosition.top&&(e.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(e.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(e.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(e.height=this.size.height+"px"),this.helper.css(e),e},_updateVirtualBoundaries:function(e){var t,i,s,n,a,o=this.options;a={minWidth:this._isNumber(o.minWidth)?o.minWidth:0,maxWidth:this._isNumber(o.maxWidth)?o.maxWidth:1/0,minHeight:this._isNumber(o.minHeight)?o.minHeight:0,maxHeight:this._isNumber(o.maxHeight)?o.maxHeight:1/0},(this._aspectRatio||e)&&(t=a.minHeight*this.aspectRatio,s=a.minWidth/this.aspectRatio,i=a.maxHeight*this.aspectRatio,n=a.maxWidth/this.aspectRatio,t>a.minWidth&&(a.minWidth=t),s>a.minHeight&&(a.minHeight=s),a.maxWidth>i&&(a.maxWidth=i),a.maxHeight>n&&(a.maxHeight=n)),this._vBoundaries=a},_updateCache:function(e){this.offset=this.helper.offset(),this._isNumber(e.left)&&(this.position.left=e.left),this._isNumber(e.top)&&(this.position.top=e.top),this._isNumber(e.height)&&(this.size.height=e.height),this._isNumber(e.width)&&(this.size.width=e.width)},_updateRatio:function(e){var t=this.position,i=this.size,s=this.axis;return this._isNumber(e.height)?e.width=e.height*this.aspectRatio:this._isNumber(e.width)&&(e.height=e.width/this.aspectRatio),"sw"===s&&(e.left=t.left+(i.width-e.width),e.top=null),"nw"===s&&(e.top=t.top+(i.height-e.height),e.left=t.left+(i.width-e.width)),e},_respectSize:function(e){var t=this._vBoundaries,i=this.axis,s=this._isNumber(e.width)&&t.maxWidth&&t.maxWidth<e.width,n=this._isNumber(e.height)&&t.maxHeight&&t.maxHeight<e.height,a=this._isNumber(e.width)&&t.minWidth&&t.minWidth>e.width,o=this._isNumber(e.height)&&t.minHeight&&t.minHeight>e.height,r=this.originalPosition.left+this.originalSize.width,h=this.position.top+this.size.height,l=/sw|nw|w/.test(i),u=/nw|ne|n/.test(i);return a&&(e.width=t.minWidth),o&&(e.height=t.minHeight),s&&(e.width=t.maxWidth),n&&(e.height=t.maxHeight),a&&l&&(e.left=r-t.minWidth),s&&l&&(e.left=r-t.maxWidth),o&&u&&(e.top=h-t.minHeight),n&&u&&(e.top=h-t.maxHeight),e.width||e.height||e.left||!e.top?e.width||e.height||e.top||!e.left||(e.left=null):e.top=null,e},_getPaddingPlusBorderDimensions:function(e){for(var t=0,i=[],s=[e.css("borderTopWidth"),e.css("borderRightWidth"),e.css("borderBottomWidth"),e.css("borderLeftWidth")],n=[e.css("paddingTop"),e.css("paddingRight"),e.css("paddingBottom"),e.css("paddingLeft")];4>t;t++)i[t]=parseInt(s[t],10)||0,i[t]+=parseInt(n[t],10)||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var e,t=0,i=this.helper||this.element;this._proportionallyResizeElements.length>t;t++)e=this._proportionallyResizeElements[t],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(e)),e.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var t=this.element,i=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||e("<div style='overflow:hidden;'></div>"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(e,t){return{width:this.originalSize.width+t}},w:function(e,t){var i=this.originalSize,s=this.originalPosition;return{left:s.left+t,width:i.width-t}},n:function(e,t,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(e,t,i){return{height:this.originalSize.height+i}},se:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},sw:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,i,s]))},ne:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},nw:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,i,s]))}},_propagate:function(t,i){e.ui.plugin.call(this,t,[i,this.ui()]),"resize"!==t&&this._trigger(t,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),e.ui.plugin.add("resizable","animate",{stop:function(t){var i=e(this).resizable("instance"),s=i.options,n=i._proportionallyResizeElements,a=n.length&&/textarea/i.test(n[0].nodeName),o=a&&i._hasScroll(n[0],"left")?0:i.sizeDiff.height,r=a?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-o},l=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,u=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(e.extend(h,u&&l?{top:u,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};n&&n.length&&e(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(){var t,i,s,n,a,o,r,h=e(this).resizable("instance"),l=h.options,u=h.element,d=l.containment,c=d instanceof e?d.get(0):/parent/.test(d)?u.parent().get(0):d;c&&(h.containerElement=e(c),/document/.test(d)||d===document?(h.containerOffset={left:0,top:0},h.containerPosition={left:0,top:0},h.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}):(t=e(c),i=[],e(["Top","Right","Left","Bottom"]).each(function(e,s){i[e]=h._num(t.css("padding"+s))}),h.containerOffset=t.offset(),h.containerPosition=t.position(),h.containerSize={height:t.innerHeight()-i[3],width:t.innerWidth()-i[1]},s=h.containerOffset,n=h.containerSize.height,a=h.containerSize.width,o=h._hasScroll(c,"left")?c.scrollWidth:a,r=h._hasScroll(c)?c.scrollHeight:n,h.parentData={element:c,left:s.left,top:s.top,width:o,height:r}))},resize:function(t){var i,s,n,a,o=e(this).resizable("instance"),r=o.options,h=o.containerOffset,l=o.position,u=o._aspectRatio||t.shiftKey,d={top:0,left:0},c=o.containerElement,p=!0;c[0]!==document&&/static/.test(c.css("position"))&&(d=h),l.left<(o._helper?h.left:0)&&(o.size.width=o.size.width+(o._helper?o.position.left-h.left:o.position.left-d.left),u&&(o.size.height=o.size.width/o.aspectRatio,p=!1),o.position.left=r.helper?h.left:0),l.top<(o._helper?h.top:0)&&(o.size.height=o.size.height+(o._helper?o.position.top-h.top:o.position.top),u&&(o.size.width=o.size.height*o.aspectRatio,p=!1),o.position.top=o._helper?h.top:0),n=o.containerElement.get(0)===o.element.parent().get(0),a=/relative|absolute/.test(o.containerElement.css("position")),n&&a?(o.offset.left=o.parentData.left+o.position.left,o.offset.top=o.parentData.top+o.position.top):(o.offset.left=o.element.offset().left,o.offset.top=o.element.offset().top),i=Math.abs(o.sizeDiff.width+(o._helper?o.offset.left-d.left:o.offset.left-h.left)),s=Math.abs(o.sizeDiff.height+(o._helper?o.offset.top-d.top:o.offset.top-h.top)),i+o.size.width>=o.parentData.width&&(o.size.width=o.parentData.width-i,u&&(o.size.height=o.size.width/o.aspectRatio,p=!1)),s+o.size.height>=o.parentData.height&&(o.size.height=o.parentData.height-s,u&&(o.size.width=o.size.height*o.aspectRatio,p=!1)),p||(o.position.left=o.prevPosition.left,o.position.top=o.prevPosition.top,o.size.width=o.prevSize.width,o.size.height=o.prevSize.height)},stop:function(){var t=e(this).resizable("instance"),i=t.options,s=t.containerOffset,n=t.containerPosition,a=t.containerElement,o=e(t.helper),r=o.offset(),h=o.outerWidth()-t.sizeDiff.width,l=o.outerHeight()-t.sizeDiff.height;t._helper&&!i.animate&&/relative/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l}),t._helper&&!i.animate&&/static/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),e.ui.plugin.add("resizable","alsoResize",{start:function(){var t=e(this).resizable("instance"),i=t.options;e(i.alsoResize).each(function(){var t=e(this);t.data("ui-resizable-alsoresize",{width:parseInt(t.width(),10),height:parseInt(t.height(),10),left:parseInt(t.css("left"),10),top:parseInt(t.css("top"),10)})})},resize:function(t,i){var s=e(this).resizable("instance"),n=s.options,a=s.originalSize,o=s.originalPosition,r={height:s.size.height-a.height||0,width:s.size.width-a.width||0,top:s.position.top-o.top||0,left:s.position.left-o.left||0};e(n.alsoResize).each(function(){var t=e(this),s=e(this).data("ui-resizable-alsoresize"),n={},a=t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(a,function(e,t){var i=(s[t]||0)+(r[t]||0);i&&i>=0&&(n[t]=i||null)}),t.css(n)})},stop:function(){e(this).removeData("resizable-alsoresize")}}),e.ui.plugin.add("resizable","ghost",{start:function(){var t=e(this).resizable("instance"),i=t.options,s=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof i.ghost?i.ghost:""),t.ghost.appendTo(t.helper)},resize:function(){var t=e(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=e(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(){var t,i=e(this).resizable("instance"),s=i.options,n=i.size,a=i.originalSize,o=i.originalPosition,r=i.axis,h="number"==typeof s.grid?[s.grid,s.grid]:s.grid,l=h[0]||1,u=h[1]||1,d=Math.round((n.width-a.width)/l)*l,c=Math.round((n.height-a.height)/u)*u,p=a.width+d,f=a.height+c,m=s.maxWidth&&p>s.maxWidth,g=s.maxHeight&&f>s.maxHeight,v=s.minWidth&&s.minWidth>p,y=s.minHeight&&s.minHeight>f;s.grid=h,v&&(p+=l),y&&(f+=u),m&&(p-=l),g&&(f-=u),/^(se|s|e)$/.test(r)?(i.size.width=p,i.size.height=f):/^(ne)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.top=o.top-c):/^(sw)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.left=o.left-d):((0>=f-u||0>=p-l)&&(t=i._getPaddingPlusBorderDimensions(this)),f-u>0?(i.size.height=f,i.position.top=o.top-c):(f=u-t.height,i.size.height=f,i.position.top=o.top+a.height-f),p-l>0?(i.size.width=p,i.position.left=o.left-d):(p=l-t.width,i.size.width=p,i.position.left=o.left+a.width-p))}}),e.ui.resizable,e.widget("ui.dialog",{version:"1.11.4",options:{appendTo:"body",autoOpen:!0,buttons:[],closeOnEscape:!0,closeText:"Close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var i=e(this).css(t).offset().top;0>i&&e(this).css("top",t.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),this.options.title=this.options.title||this.originalTitle,this._createWrapper(),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&e.fn.draggable&&this._makeDraggable(),this.options.resizable&&e.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?e(t):this.document.find(t||"body").eq(0)},_destroy:function(){var e,t=this.originalPosition;this._untrackInstance(),this._destroyOverlay(),this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(),this.uiDialog.stop(!0,!0).remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),e=t.parent.children().eq(t.index),e.length&&e[0]!==this.element[0]?e.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},disable:e.noop,enable:e.noop,close:function(t){var i,s=this;if(this._isOpen&&this._trigger("beforeClose",t)!==!1){if(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),!this.opener.filter(":focusable").focus().length)try{i=this.document[0].activeElement,i&&"body"!==i.nodeName.toLowerCase()&&e(i).blur()}catch(n){}this._hide(this.uiDialog,this.options.hide,function(){s._trigger("close",t)})}},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,i){var s=!1,n=this.uiDialog.siblings(".ui-front:visible").map(function(){return+e(this).css("z-index")}).get(),a=Math.max.apply(null,n);return a>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",a+1),s=!0),s&&!i&&this._trigger("focus",t),s},open:function(){var t=this;return this._isOpen?(this._moveToTop()&&this._focusTabbable(),void 0):(this._isOpen=!0,this.opener=e(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){t._focusTabbable(),t._trigger("focus")}),this._makeFocusTarget(),this._trigger("open"),void 0)},_focusTabbable:function(){var e=this._focusedElement;e||(e=this.element.find("[autofocus]")),e.length||(e=this.element.find(":tabbable")),e.length||(e=this.uiDialogButtonPane.find(":tabbable")),e.length||(e=this.uiDialogTitlebarClose.filter(":tabbable")),e.length||(e=this.uiDialog),e.eq(0).focus()},_keepFocus:function(t){function i(){var t=this.document[0].activeElement,i=this.uiDialog[0]===t||e.contains(this.uiDialog[0],t);i||this._focusTabbable()}t.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=e("<div>").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._on(this.uiDialog,{keydown:function(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===e.ui.keyCode.ESCAPE)return t.preventDefault(),this.close(t),void 0;
|
|
10
|
+
if(t.keyCode===e.ui.keyCode.TAB&&!t.isDefaultPrevented()){var i=this.uiDialog.find(":tabbable"),s=i.filter(":first"),n=i.filter(":last");t.target!==n[0]&&t.target!==this.uiDialog[0]||t.shiftKey?t.target!==s[0]&&t.target!==this.uiDialog[0]||!t.shiftKey||(this._delay(function(){n.focus()}),t.preventDefault()):(this._delay(function(){s.focus()}),t.preventDefault())}},mousedown:function(e){this._moveToTop(e)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=e("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog),this._on(this.uiDialogTitlebar,{mousedown:function(t){e(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.focus()}}),this.uiDialogTitlebarClose=e("<button type='button'></button>").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:!1}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar),this._on(this.uiDialogTitlebarClose,{click:function(e){e.preventDefault(),this.close(e)}}),t=e("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar),this._title(t),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(e){this.options.title||e.html(" "),e.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=e("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),this.uiButtonSet=e("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane),this._createButtons()},_createButtons:function(){var t=this,i=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),e.isEmptyObject(i)||e.isArray(i)&&!i.length?(this.uiDialog.removeClass("ui-dialog-buttons"),void 0):(e.each(i,function(i,s){var n,a;s=e.isFunction(s)?{click:s,text:i}:s,s=e.extend({type:"button"},s),n=s.click,s.click=function(){n.apply(t.element[0],arguments)},a={icons:s.icons,text:s.showText},delete s.icons,delete s.showText,e("<button></button>",s).button(a).appendTo(t.uiButtonSet)}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog),void 0)},_makeDraggable:function(){function t(e){return{position:e.position,offset:e.offset}}var i=this,s=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(s,n){e(this).addClass("ui-dialog-dragging"),i._blockFrames(),i._trigger("dragStart",s,t(n))},drag:function(e,s){i._trigger("drag",e,t(s))},stop:function(n,a){var o=a.offset.left-i.document.scrollLeft(),r=a.offset.top-i.document.scrollTop();s.position={my:"left top",at:"left"+(o>=0?"+":"")+o+" "+"top"+(r>=0?"+":"")+r,of:i.window},e(this).removeClass("ui-dialog-dragging"),i._unblockFrames(),i._trigger("dragStop",n,t(a))}})},_makeResizable:function(){function t(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}var i=this,s=this.options,n=s.resizable,a=this.uiDialog.css("position"),o="string"==typeof n?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:s.maxWidth,maxHeight:s.maxHeight,minWidth:s.minWidth,minHeight:this._minHeight(),handles:o,start:function(s,n){e(this).addClass("ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",s,t(n))},resize:function(e,s){i._trigger("resize",e,t(s))},stop:function(n,a){var o=i.uiDialog.offset(),r=o.left-i.document.scrollLeft(),h=o.top-i.document.scrollTop();s.height=i.uiDialog.height(),s.width=i.uiDialog.width(),s.position={my:"left top",at:"left"+(r>=0?"+":"")+r+" "+"top"+(h>=0?"+":"")+h,of:i.window},e(this).removeClass("ui-dialog-resizing"),i._unblockFrames(),i._trigger("resizeStop",n,t(a))}}).css("position",a)},_trackFocus:function(){this._on(this.widget(),{focusin:function(t){this._makeFocusTarget(),this._focusedElement=e(t.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var t=this._trackingInstances(),i=e.inArray(this,t);-1!==i&&t.splice(i,1)},_trackingInstances:function(){var e=this.document.data("ui-dialog-instances");return e||(e=[],this.document.data("ui-dialog-instances",e)),e},_minHeight:function(){var e=this.options;return"auto"===e.height?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(){var e=this.uiDialog.is(":visible");e||this.uiDialog.show(),this.uiDialog.position(this.options.position),e||this.uiDialog.hide()},_setOptions:function(t){var i=this,s=!1,n={};e.each(t,function(e,t){i._setOption(e,t),e in i.sizeRelatedOptions&&(s=!0),e in i.resizableRelatedOptions&&(n[e]=t)}),s&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",n)},_setOption:function(e,t){var i,s,n=this.uiDialog;"dialogClass"===e&&n.removeClass(this.options.dialogClass).addClass(t),"disabled"!==e&&(this._super(e,t),"appendTo"===e&&this.uiDialog.appendTo(this._appendTo()),"buttons"===e&&this._createButtons(),"closeText"===e&&this.uiDialogTitlebarClose.button({label:""+t}),"draggable"===e&&(i=n.is(":data(ui-draggable)"),i&&!t&&n.draggable("destroy"),!i&&t&&this._makeDraggable()),"position"===e&&this._position(),"resizable"===e&&(s=n.is(":data(ui-resizable)"),s&&!t&&n.resizable("destroy"),s&&"string"==typeof t&&n.resizable("option","handles",t),s||t===!1||this._makeResizable()),"title"===e&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var e,t,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),e=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),t=Math.max(0,s.minHeight-e),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-e):"none","auto"===s.height?this.element.css({minHeight:t,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-e)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=e(this);return e("<div>").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(t){return e(t.target).closest(".ui-dialog").length?!0:!!e(t.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var t=!0;this._delay(function(){t=!1}),this.document.data("ui-dialog-overlays")||this._on(this.document,{focusin:function(e){t||this._allowInteraction(e)||(e.preventDefault(),this._trackingInstances()[0]._focusTabbable())}}),this.overlay=e("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1)}},_destroyOverlay:function(){if(this.options.modal&&this.overlay){var e=this.document.data("ui-dialog-overlays")-1;e?this.document.data("ui-dialog-overlays",e):this.document.unbind("focusin").removeData("ui-dialog-overlays"),this.overlay.remove(),this.overlay=null}}}),e.widget("ui.droppable",{version:"1.11.4",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t,i=this.options,s=i.accept;this.isover=!1,this.isout=!0,this.accept=e.isFunction(s)?s:function(e){return e.is(s)},this.proportions=function(){return arguments.length?(t=arguments[0],void 0):t?t:t={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},this._addToManager(i.scope),i.addClasses&&this.element.addClass("ui-droppable")},_addToManager:function(t){e.ui.ddmanager.droppables[t]=e.ui.ddmanager.droppables[t]||[],e.ui.ddmanager.droppables[t].push(this)},_splice:function(e){for(var t=0;e.length>t;t++)e[t]===this&&e.splice(t,1)},_destroy:function(){var t=e.ui.ddmanager.droppables[this.options.scope];this._splice(t),this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(t,i){if("accept"===t)this.accept=e.isFunction(i)?i:function(e){return e.is(i)};else if("scope"===t){var s=e.ui.ddmanager.droppables[this.options.scope];this._splice(s),this._addToManager(i)}this._super(t,i)},_activate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),i&&this._trigger("activate",t,this.ui(i))},_deactivate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),i&&this._trigger("deactivate",t,this.ui(i))},_over:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",t,this.ui(i)))},_out:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",t,this.ui(i)))},_drop:function(t,i){var s=i||e.ui.ddmanager.current,n=!1;return s&&(s.currentItem||s.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var i=e(this).droppable("instance");return i.options.greedy&&!i.options.disabled&&i.options.scope===s.options.scope&&i.accept.call(i.element[0],s.currentItem||s.element)&&e.ui.intersect(s,e.extend(i,{offset:i.element.offset()}),i.options.tolerance,t)?(n=!0,!1):void 0}),n?!1:this.accept.call(this.element[0],s.currentItem||s.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",t,this.ui(s)),this.element):!1):!1},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}}}),e.ui.intersect=function(){function e(e,t,i){return e>=t&&t+i>e}return function(t,i,s,n){if(!i.offset)return!1;var a=(t.positionAbs||t.position.absolute).left+t.margins.left,o=(t.positionAbs||t.position.absolute).top+t.margins.top,r=a+t.helperProportions.width,h=o+t.helperProportions.height,l=i.offset.left,u=i.offset.top,d=l+i.proportions().width,c=u+i.proportions().height;switch(s){case"fit":return a>=l&&d>=r&&o>=u&&c>=h;case"intersect":return a+t.helperProportions.width/2>l&&d>r-t.helperProportions.width/2&&o+t.helperProportions.height/2>u&&c>h-t.helperProportions.height/2;case"pointer":return e(n.pageY,u,i.proportions().height)&&e(n.pageX,l,i.proportions().width);case"touch":return(o>=u&&c>=o||h>=u&&c>=h||u>o&&h>c)&&(a>=l&&d>=a||r>=l&&d>=r||l>a&&r>d);default:return!1}}}(),e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,i){var s,n,a=e.ui.ddmanager.droppables[t.options.scope]||[],o=i?i.type:null,r=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();e:for(s=0;a.length>s;s++)if(!(a[s].options.disabled||t&&!a[s].accept.call(a[s].element[0],t.currentItem||t.element))){for(n=0;r.length>n;n++)if(r[n]===a[s].element[0]){a[s].proportions().height=0;continue e}a[s].visible="none"!==a[s].element.css("display"),a[s].visible&&("mousedown"===o&&a[s]._activate.call(a[s],i),a[s].offset=a[s].element.offset(),a[s].proportions({width:a[s].element[0].offsetWidth,height:a[s].element[0].offsetHeight}))}},drop:function(t,i){var s=!1;return e.each((e.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance,i)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(t,i){t.element.parentsUntil("body").bind("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)})},drag:function(t,i){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,i),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,a,o=e.ui.intersect(t,this,this.options.tolerance,i),r=!o&&this.isover?"isout":o&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,a=this.element.parents(":data(ui-droppable)").filter(function(){return e(this).droppable("instance").options.scope===n}),a.length&&(s=e(a[0]).droppable("instance"),s.greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(t,i){t.element.parentsUntil("body").unbind("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)}},e.ui.droppable;var y="ui-effects-",b=e;e.effects={effect:{}},function(e,t){function i(e,t,i){var s=d[t.type]||{};return null==e?i||!t.def?null:t.def:(e=s.floor?~~e:parseFloat(e),isNaN(e)?t.def:s.mod?(e+s.mod)%s.mod:0>e?0:e>s.max?s.max:e)}function s(i){var s=l(),n=s._rgba=[];return i=i.toLowerCase(),f(h,function(e,a){var o,r=a.re.exec(i),h=r&&a.parse(r),l=a.space||"rgba";return h?(o=s[l](h),s[u[l].cache]=o[u[l].cache],n=s._rgba=o._rgba,!1):t}),n.length?("0,0,0,0"===n.join()&&e.extend(n,a.transparent),s):a[i]}function n(e,t,i){return i=(i+1)%1,1>6*i?e+6*(t-e)*i:1>2*i?t:2>3*i?e+6*(t-e)*(2/3-i):e}var a,o="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,h=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1],e[2],e[3],e[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[2.55*e[1],2.55*e[2],2.55*e[3],e[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(e){return[e[1],e[2]/100,e[3]/100,e[4]]}}],l=e.Color=function(t,i,s,n){return new e.Color.fn.parse(t,i,s,n)},u={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},d={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},c=l.support={},p=e("<p>")[0],f=e.each;p.style.cssText="background-color:rgba(1,1,1,.5)",c.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(u,function(e,t){t.cache="_"+e,t.props.alpha={idx:3,type:"percent",def:1}}),l.fn=e.extend(l.prototype,{parse:function(n,o,r,h){if(n===t)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=e(n).css(o),o=t);var d=this,c=e.type(n),p=this._rgba=[];return o!==t&&(n=[n,o,r,h],c="array"),"string"===c?this.parse(s(n)||a._default):"array"===c?(f(u.rgba.props,function(e,t){p[t.idx]=i(n[t.idx],t)}),this):"object"===c?(n instanceof l?f(u,function(e,t){n[t.cache]&&(d[t.cache]=n[t.cache].slice())}):f(u,function(t,s){var a=s.cache;f(s.props,function(e,t){if(!d[a]&&s.to){if("alpha"===e||null==n[e])return;d[a]=s.to(d._rgba)}d[a][t.idx]=i(n[e],t,!0)}),d[a]&&0>e.inArray(null,d[a].slice(0,3))&&(d[a][3]=1,s.from&&(d._rgba=s.from(d[a])))}),this):t},is:function(e){var i=l(e),s=!0,n=this;return f(u,function(e,a){var o,r=i[a.cache];return r&&(o=n[a.cache]||a.to&&a.to(n._rgba)||[],f(a.props,function(e,i){return null!=r[i.idx]?s=r[i.idx]===o[i.idx]:t})),s}),s},_space:function(){var e=[],t=this;return f(u,function(i,s){t[s.cache]&&e.push(i)}),e.pop()},transition:function(e,t){var s=l(e),n=s._space(),a=u[n],o=0===this.alpha()?l("transparent"):this,r=o[a.cache]||a.to(o._rgba),h=r.slice();return s=s[a.cache],f(a.props,function(e,n){var a=n.idx,o=r[a],l=s[a],u=d[n.type]||{};null!==l&&(null===o?h[a]=l:(u.mod&&(l-o>u.mod/2?o+=u.mod:o-l>u.mod/2&&(o-=u.mod)),h[a]=i((l-o)*t+o,n)))}),this[n](h)},blend:function(t){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=l(t)._rgba;return l(e.map(i,function(e,t){return(1-s)*n[t]+s*e}))},toRgbaString:function(){var t="rgba(",i=e.map(this._rgba,function(e,t){return null==e?t>2?1:0:e});return 1===i[3]&&(i.pop(),t="rgb("),t+i.join()+")"},toHslaString:function(){var t="hsla(",i=e.map(this.hsla(),function(e,t){return null==e&&(e=t>2?1:0),t&&3>t&&(e=Math.round(100*e)+"%"),e});return 1===i[3]&&(i.pop(),t="hsl("),t+i.join()+")"},toHexString:function(t){var i=this._rgba.slice(),s=i.pop();return t&&i.push(~~(255*s)),"#"+e.map(i,function(e){return e=(e||0).toString(16),1===e.length?"0"+e:e}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),l.fn.parse.prototype=l.fn,u.hsla.to=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t,i,s=e[0]/255,n=e[1]/255,a=e[2]/255,o=e[3],r=Math.max(s,n,a),h=Math.min(s,n,a),l=r-h,u=r+h,d=.5*u;return t=h===r?0:s===r?60*(n-a)/l+360:n===r?60*(a-s)/l+120:60*(s-n)/l+240,i=0===l?0:.5>=d?l/u:l/(2-u),[Math.round(t)%360,i,d,null==o?1:o]},u.hsla.from=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t=e[0]/360,i=e[1],s=e[2],a=e[3],o=.5>=s?s*(1+i):s+i-s*i,r=2*s-o;return[Math.round(255*n(r,o,t+1/3)),Math.round(255*n(r,o,t)),Math.round(255*n(r,o,t-1/3)),a]},f(u,function(s,n){var a=n.props,o=n.cache,h=n.to,u=n.from;l.fn[s]=function(s){if(h&&!this[o]&&(this[o]=h(this._rgba)),s===t)return this[o].slice();var n,r=e.type(s),d="array"===r||"object"===r?s:arguments,c=this[o].slice();return f(a,function(e,t){var s=d["object"===r?e:t.idx];null==s&&(s=c[t.idx]),c[t.idx]=i(s,t)}),u?(n=l(u(c)),n[o]=c,n):l(c)},f(a,function(t,i){l.fn[t]||(l.fn[t]=function(n){var a,o=e.type(n),h="alpha"===t?this._hsla?"hsla":"rgba":s,l=this[h](),u=l[i.idx];return"undefined"===o?u:("function"===o&&(n=n.call(this,u),o=e.type(n)),null==n&&i.empty?this:("string"===o&&(a=r.exec(n),a&&(n=u+parseFloat(a[2])*("+"===a[1]?1:-1))),l[i.idx]=n,this[h](l)))})})}),l.hook=function(t){var i=t.split(" ");f(i,function(t,i){e.cssHooks[i]={set:function(t,n){var a,o,r="";if("transparent"!==n&&("string"!==e.type(n)||(a=s(n)))){if(n=l(a||n),!c.rgba&&1!==n._rgba[3]){for(o="backgroundColor"===i?t.parentNode:t;(""===r||"transparent"===r)&&o&&o.style;)try{r=e.css(o,"backgroundColor"),o=o.parentNode}catch(h){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{t.style[i]=n}catch(h){}}},e.fx.step[i]=function(t){t.colorInit||(t.start=l(t.elem,i),t.end=l(t.end),t.colorInit=!0),e.cssHooks[i].set(t.elem,t.start.transition(t.end,t.pos))}})},l.hook(o),e.cssHooks.borderColor={expand:function(e){var t={};return f(["Top","Right","Bottom","Left"],function(i,s){t["border"+s+"Color"]=e}),t}},a=e.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(b),function(){function t(t){var i,s,n=t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(t,null):t.currentStyle,a={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(a[e.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(a[i]=n[i]);return a}function i(t,i){var s,a,o={};for(s in i)a=i[s],t[s]!==a&&(n[s]||(e.fx.step[s]||!isNaN(parseFloat(a)))&&(o[s]=a));return o}var s=["add","remove","toggle"],n={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};e.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,i){e.fx.step[i]=function(e){("none"!==e.end&&!e.setAttr||1===e.pos&&!e.setAttr)&&(b.style(e.elem,i,e.end),e.setAttr=!0)}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e.effects.animateClass=function(n,a,o,r){var h=e.speed(a,o,r);return this.queue(function(){var a,o=e(this),r=o.attr("class")||"",l=h.children?o.find("*").addBack():o;l=l.map(function(){var i=e(this);return{el:i,start:t(this)}}),a=function(){e.each(s,function(e,t){n[t]&&o[t+"Class"](n[t])})},a(),l=l.map(function(){return this.end=t(this.el[0]),this.diff=i(this.start,this.end),this}),o.attr("class",r),l=l.map(function(){var t=this,i=e.Deferred(),s=e.extend({},h,{queue:!1,complete:function(){i.resolve(t)}});return this.el.animate(this.diff,s),i.promise()}),e.when.apply(e,l.get()).done(function(){a(),e.each(arguments,function(){var t=this.el;e.each(this.diff,function(e){t.css(e,"")})}),h.complete.call(o[0])})})},e.fn.extend({addClass:function(t){return function(i,s,n,a){return s?e.effects.animateClass.call(this,{add:i},s,n,a):t.apply(this,arguments)}}(e.fn.addClass),removeClass:function(t){return function(i,s,n,a){return arguments.length>1?e.effects.animateClass.call(this,{remove:i},s,n,a):t.apply(this,arguments)}}(e.fn.removeClass),toggleClass:function(t){return function(i,s,n,a,o){return"boolean"==typeof s||void 0===s?n?e.effects.animateClass.call(this,s?{add:i}:{remove:i},n,a,o):t.apply(this,arguments):e.effects.animateClass.call(this,{toggle:i},s,n,a)}}(e.fn.toggleClass),switchClass:function(t,i,s,n,a){return e.effects.animateClass.call(this,{add:i,remove:t},s,n,a)}})}(),function(){function t(t,i,s,n){return e.isPlainObject(t)&&(i=t,t=t.effect),t={effect:t},null==i&&(i={}),e.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||e.fx.speeds[i])&&(n=s,s=i,i={}),e.isFunction(s)&&(n=s,s=null),i&&e.extend(t,i),s=s||i.duration,t.duration=e.fx.off?0:"number"==typeof s?s:s in e.fx.speeds?e.fx.speeds[s]:e.fx.speeds._default,t.complete=n||i.complete,t}function i(t){return!t||"number"==typeof t||e.fx.speeds[t]?!0:"string"!=typeof t||e.effects.effect[t]?e.isFunction(t)?!0:"object"!=typeof t||t.effect?!1:!0:!0}e.extend(e.effects,{version:"1.11.4",save:function(e,t){for(var i=0;t.length>i;i++)null!==t[i]&&e.data(y+t[i],e[0].style[t[i]])},restore:function(e,t){var i,s;for(s=0;t.length>s;s++)null!==t[s]&&(i=e.data(y+t[s]),void 0===i&&(i=""),e.css(t[s],i))},setMode:function(e,t){return"toggle"===t&&(t=e.is(":hidden")?"show":"hide"),t},getBaseline:function(e,t){var i,s;switch(e[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=e[0]/t.height}switch(e[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=e[1]/t.width}return{x:s,y:i}},createWrapper:function(t){if(t.parent().is(".ui-effects-wrapper"))return t.parent();var i={width:t.outerWidth(!0),height:t.outerHeight(!0),"float":t.css("float")},s=e("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:t.width(),height:t.height()},a=document.activeElement;try{a.id}catch(o){a=document.body}return t.wrap(s),(t[0]===a||e.contains(t[0],a))&&e(a).focus(),s=t.parent(),"static"===t.css("position")?(s.css({position:"relative"}),t.css({position:"relative"})):(e.extend(i,{position:t.css("position"),zIndex:t.css("z-index")}),e.each(["top","left","bottom","right"],function(e,s){i[s]=t.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),t.css(n),s.css(i).show()},removeWrapper:function(t){var i=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),(t[0]===i||e.contains(t[0],i))&&e(i).focus()),t},setTransition:function(t,i,s,n){return n=n||{},e.each(i,function(e,i){var a=t.cssUnit(i);a[0]>0&&(n[i]=a[0]*s+a[1])}),n}}),e.fn.extend({effect:function(){function i(t){function i(){e.isFunction(a)&&a.call(n[0]),e.isFunction(t)&&t()}var n=e(this),a=s.complete,r=s.mode;(n.is(":hidden")?"hide"===r:"show"===r)?(n[r](),i()):o.call(n[0],s,i)}var s=t.apply(this,arguments),n=s.mode,a=s.queue,o=e.effects.effect[s.effect];return e.fx.off||!o?n?this[n](s.duration,s.complete):this.each(function(){s.complete&&s.complete.call(this)}):a===!1?this.each(i):this.queue(a||"fx",i)},show:function(e){return function(s){if(i(s))return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="show",this.effect.call(this,n)}}(e.fn.show),hide:function(e){return function(s){if(i(s))return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="hide",this.effect.call(this,n)}}(e.fn.hide),toggle:function(e){return function(s){if(i(s)||"boolean"==typeof s)return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)}}(e.fn.toggle),cssUnit:function(t){var i=this.css(t),s=[];return e.each(["em","px","%","pt"],function(e,t){i.indexOf(t)>0&&(s=[parseFloat(i),t])}),s}})}(),function(){var t={};e.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,i){t[i]=function(t){return Math.pow(t,e+2)}}),e.extend(t,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return 0===e||1===e?e:-Math.pow(2,8*(e-1))*Math.sin((80*(e-1)-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){for(var t,i=4;((t=Math.pow(2,--i))-1)/11>e;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*t-2)/22-e,2)}}),e.each(t,function(t,i){e.easing["easeIn"+t]=i,e.easing["easeOut"+t]=function(e){return 1-i(1-e)},e.easing["easeInOut"+t]=function(e){return.5>e?i(2*e)/2:1-i(-2*e+2)/2}})}(),e.effects,e.effects.effect.blind=function(t,i){var s,n,a,o=e(this),r=/up|down|vertical/,h=/up|left|vertical|horizontal/,l=["position","top","bottom","left","right","height","width"],u=e.effects.setMode(o,t.mode||"hide"),d=t.direction||"up",c=r.test(d),p=c?"height":"width",f=c?"top":"left",m=h.test(d),g={},v="show"===u;o.parent().is(".ui-effects-wrapper")?e.effects.save(o.parent(),l):e.effects.save(o,l),o.show(),s=e.effects.createWrapper(o).css({overflow:"hidden"}),n=s[p](),a=parseFloat(s.css(f))||0,g[p]=v?n:0,m||(o.css(c?"bottom":"right",0).css(c?"top":"left","auto").css({position:"absolute"}),g[f]=v?a:n+a),v&&(s.css(p,0),m||s.css(f,a+n)),s.animate(g,{duration:t.duration,easing:t.easing,queue:!1,complete:function(){"hide"===u&&o.hide(),e.effects.restore(o,l),e.effects.removeWrapper(o),i()}})},e.effects.effect.bounce=function(t,i){var s,n,a,o=e(this),r=["position","top","bottom","left","right","height","width"],h=e.effects.setMode(o,t.mode||"effect"),l="hide"===h,u="show"===h,d=t.direction||"up",c=t.distance,p=t.times||5,f=2*p+(u||l?1:0),m=t.duration/f,g=t.easing,v="up"===d||"down"===d?"top":"left",y="up"===d||"left"===d,b=o.queue(),_=b.length;for((u||l)&&r.push("opacity"),e.effects.save(o,r),o.show(),e.effects.createWrapper(o),c||(c=o["top"===v?"outerHeight":"outerWidth"]()/3),u&&(a={opacity:1},a[v]=0,o.css("opacity",0).css(v,y?2*-c:2*c).animate(a,m,g)),l&&(c/=Math.pow(2,p-1)),a={},a[v]=0,s=0;p>s;s++)n={},n[v]=(y?"-=":"+=")+c,o.animate(n,m,g).animate(a,m,g),c=l?2*c:c/2;l&&(n={opacity:0},n[v]=(y?"-=":"+=")+c,o.animate(n,m,g)),o.queue(function(){l&&o.hide(),e.effects.restore(o,r),e.effects.removeWrapper(o),i()}),_>1&&b.splice.apply(b,[1,0].concat(b.splice(_,f+1))),o.dequeue()},e.effects.effect.clip=function(t,i){var s,n,a,o=e(this),r=["position","top","bottom","left","right","height","width"],h=e.effects.setMode(o,t.mode||"hide"),l="show"===h,u=t.direction||"vertical",d="vertical"===u,c=d?"height":"width",p=d?"top":"left",f={};e.effects.save(o,r),o.show(),s=e.effects.createWrapper(o).css({overflow:"hidden"}),n="IMG"===o[0].tagName?s:o,a=n[c](),l&&(n.css(c,0),n.css(p,a/2)),f[c]=l?a:0,f[p]=l?0:a/2,n.animate(f,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){l||o.hide(),e.effects.restore(o,r),e.effects.removeWrapper(o),i()}})},e.effects.effect.drop=function(t,i){var s,n=e(this),a=["position","top","bottom","left","right","opacity","height","width"],o=e.effects.setMode(n,t.mode||"hide"),r="show"===o,h=t.direction||"left",l="up"===h||"down"===h?"top":"left",u="up"===h||"left"===h?"pos":"neg",d={opacity:r?1:0};e.effects.save(n,a),n.show(),e.effects.createWrapper(n),s=t.distance||n["top"===l?"outerHeight":"outerWidth"](!0)/2,r&&n.css("opacity",0).css(l,"pos"===u?-s:s),d[l]=(r?"pos"===u?"+=":"-=":"pos"===u?"-=":"+=")+s,n.animate(d,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===o&&n.hide(),e.effects.restore(n,a),e.effects.removeWrapper(n),i()}})},e.effects.effect.explode=function(t,i){function s(){b.push(this),b.length===d*c&&n()}function n(){p.css({visibility:"visible"}),e(b).remove(),m||p.hide(),i()}var a,o,r,h,l,u,d=t.pieces?Math.round(Math.sqrt(t.pieces)):3,c=d,p=e(this),f=e.effects.setMode(p,t.mode||"hide"),m="show"===f,g=p.show().css("visibility","hidden").offset(),v=Math.ceil(p.outerWidth()/c),y=Math.ceil(p.outerHeight()/d),b=[];for(a=0;d>a;a++)for(h=g.top+a*y,u=a-(d-1)/2,o=0;c>o;o++)r=g.left+o*v,l=o-(c-1)/2,p.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-o*v,top:-a*y}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:v,height:y,left:r+(m?l*v:0),top:h+(m?u*y:0),opacity:m?0:1}).animate({left:r+(m?0:l*v),top:h+(m?0:u*y),opacity:m?1:0},t.duration||500,t.easing,s)},e.effects.effect.fade=function(t,i){var s=e(this),n=e.effects.setMode(s,t.mode||"toggle");s.animate({opacity:n},{queue:!1,duration:t.duration,easing:t.easing,complete:i})},e.effects.effect.fold=function(t,i){var s,n,a=e(this),o=["position","top","bottom","left","right","height","width"],r=e.effects.setMode(a,t.mode||"hide"),h="show"===r,l="hide"===r,u=t.size||15,d=/([0-9]+)%/.exec(u),c=!!t.horizFirst,p=h!==c,f=p?["width","height"]:["height","width"],m=t.duration/2,g={},v={};e.effects.save(a,o),a.show(),s=e.effects.createWrapper(a).css({overflow:"hidden"}),n=p?[s.width(),s.height()]:[s.height(),s.width()],d&&(u=parseInt(d[1],10)/100*n[l?0:1]),h&&s.css(c?{height:0,width:u}:{height:u,width:0}),g[f[0]]=h?n[0]:u,v[f[1]]=h?n[1]:0,s.animate(g,m,t.easing).animate(v,m,t.easing,function(){l&&a.hide(),e.effects.restore(a,o),e.effects.removeWrapper(a),i()})},e.effects.effect.highlight=function(t,i){var s=e(this),n=["backgroundImage","backgroundColor","opacity"],a=e.effects.setMode(s,t.mode||"show"),o={backgroundColor:s.css("backgroundColor")};"hide"===a&&(o.opacity=0),e.effects.save(s,n),s.show().css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(o,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===a&&s.hide(),e.effects.restore(s,n),i()}})},e.effects.effect.size=function(t,i){var s,n,a,o=e(this),r=["position","top","bottom","left","right","width","height","overflow","opacity"],h=["position","top","bottom","left","right","overflow","opacity"],l=["width","height","overflow"],u=["fontSize"],d=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],c=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=e.effects.setMode(o,t.mode||"effect"),f=t.restore||"effect"!==p,m=t.scale||"both",g=t.origin||["middle","center"],v=o.css("position"),y=f?r:h,b={height:0,width:0,outerHeight:0,outerWidth:0};"show"===p&&o.show(),s={height:o.height(),width:o.width(),outerHeight:o.outerHeight(),outerWidth:o.outerWidth()},"toggle"===t.mode&&"show"===p?(o.from=t.to||b,o.to=t.from||s):(o.from=t.from||("show"===p?b:s),o.to=t.to||("hide"===p?b:s)),a={from:{y:o.from.height/s.height,x:o.from.width/s.width},to:{y:o.to.height/s.height,x:o.to.width/s.width}},("box"===m||"both"===m)&&(a.from.y!==a.to.y&&(y=y.concat(d),o.from=e.effects.setTransition(o,d,a.from.y,o.from),o.to=e.effects.setTransition(o,d,a.to.y,o.to)),a.from.x!==a.to.x&&(y=y.concat(c),o.from=e.effects.setTransition(o,c,a.from.x,o.from),o.to=e.effects.setTransition(o,c,a.to.x,o.to))),("content"===m||"both"===m)&&a.from.y!==a.to.y&&(y=y.concat(u).concat(l),o.from=e.effects.setTransition(o,u,a.from.y,o.from),o.to=e.effects.setTransition(o,u,a.to.y,o.to)),e.effects.save(o,y),o.show(),e.effects.createWrapper(o),o.css("overflow","hidden").css(o.from),g&&(n=e.effects.getBaseline(g,s),o.from.top=(s.outerHeight-o.outerHeight())*n.y,o.from.left=(s.outerWidth-o.outerWidth())*n.x,o.to.top=(s.outerHeight-o.to.outerHeight)*n.y,o.to.left=(s.outerWidth-o.to.outerWidth)*n.x),o.css(o.from),("content"===m||"both"===m)&&(d=d.concat(["marginTop","marginBottom"]).concat(u),c=c.concat(["marginLeft","marginRight"]),l=r.concat(d).concat(c),o.find("*[width]").each(function(){var i=e(this),s={height:i.height(),width:i.width(),outerHeight:i.outerHeight(),outerWidth:i.outerWidth()};
|
|
11
|
+
f&&e.effects.save(i,l),i.from={height:s.height*a.from.y,width:s.width*a.from.x,outerHeight:s.outerHeight*a.from.y,outerWidth:s.outerWidth*a.from.x},i.to={height:s.height*a.to.y,width:s.width*a.to.x,outerHeight:s.height*a.to.y,outerWidth:s.width*a.to.x},a.from.y!==a.to.y&&(i.from=e.effects.setTransition(i,d,a.from.y,i.from),i.to=e.effects.setTransition(i,d,a.to.y,i.to)),a.from.x!==a.to.x&&(i.from=e.effects.setTransition(i,c,a.from.x,i.from),i.to=e.effects.setTransition(i,c,a.to.x,i.to)),i.css(i.from),i.animate(i.to,t.duration,t.easing,function(){f&&e.effects.restore(i,l)})})),o.animate(o.to,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){0===o.to.opacity&&o.css("opacity",o.from.opacity),"hide"===p&&o.hide(),e.effects.restore(o,y),f||("static"===v?o.css({position:"relative",top:o.to.top,left:o.to.left}):e.each(["top","left"],function(e,t){o.css(t,function(t,i){var s=parseInt(i,10),n=e?o.to.left:o.to.top;return"auto"===i?n+"px":s+n+"px"})})),e.effects.removeWrapper(o),i()}})},e.effects.effect.scale=function(t,i){var s=e(this),n=e.extend(!0,{},t),a=e.effects.setMode(s,t.mode||"effect"),o=parseInt(t.percent,10)||(0===parseInt(t.percent,10)?0:"hide"===a?0:100),r=t.direction||"both",h=t.origin,l={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()},u={y:"horizontal"!==r?o/100:1,x:"vertical"!==r?o/100:1};n.effect="size",n.queue=!1,n.complete=i,"effect"!==a&&(n.origin=h||["middle","center"],n.restore=!0),n.from=t.from||("show"===a?{height:0,width:0,outerHeight:0,outerWidth:0}:l),n.to={height:l.height*u.y,width:l.width*u.x,outerHeight:l.outerHeight*u.y,outerWidth:l.outerWidth*u.x},n.fade&&("show"===a&&(n.from.opacity=0,n.to.opacity=1),"hide"===a&&(n.from.opacity=1,n.to.opacity=0)),s.effect(n)},e.effects.effect.puff=function(t,i){var s=e(this),n=e.effects.setMode(s,t.mode||"hide"),a="hide"===n,o=parseInt(t.percent,10)||150,r=o/100,h={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()};e.extend(t,{effect:"scale",queue:!1,fade:!0,mode:n,complete:i,percent:a?o:100,from:a?h:{height:h.height*r,width:h.width*r,outerHeight:h.outerHeight*r,outerWidth:h.outerWidth*r}}),s.effect(t)},e.effects.effect.pulsate=function(t,i){var s,n=e(this),a=e.effects.setMode(n,t.mode||"show"),o="show"===a,r="hide"===a,h=o||"hide"===a,l=2*(t.times||5)+(h?1:0),u=t.duration/l,d=0,c=n.queue(),p=c.length;for((o||!n.is(":visible"))&&(n.css("opacity",0).show(),d=1),s=1;l>s;s++)n.animate({opacity:d},u,t.easing),d=1-d;n.animate({opacity:d},u,t.easing),n.queue(function(){r&&n.hide(),i()}),p>1&&c.splice.apply(c,[1,0].concat(c.splice(p,l+1))),n.dequeue()},e.effects.effect.shake=function(t,i){var s,n=e(this),a=["position","top","bottom","left","right","height","width"],o=e.effects.setMode(n,t.mode||"effect"),r=t.direction||"left",h=t.distance||20,l=t.times||3,u=2*l+1,d=Math.round(t.duration/u),c="up"===r||"down"===r?"top":"left",p="up"===r||"left"===r,f={},m={},g={},v=n.queue(),y=v.length;for(e.effects.save(n,a),n.show(),e.effects.createWrapper(n),f[c]=(p?"-=":"+=")+h,m[c]=(p?"+=":"-=")+2*h,g[c]=(p?"-=":"+=")+2*h,n.animate(f,d,t.easing),s=1;l>s;s++)n.animate(m,d,t.easing).animate(g,d,t.easing);n.animate(m,d,t.easing).animate(f,d/2,t.easing).queue(function(){"hide"===o&&n.hide(),e.effects.restore(n,a),e.effects.removeWrapper(n),i()}),y>1&&v.splice.apply(v,[1,0].concat(v.splice(y,u+1))),n.dequeue()},e.effects.effect.slide=function(t,i){var s,n=e(this),a=["position","top","bottom","left","right","width","height"],o=e.effects.setMode(n,t.mode||"show"),r="show"===o,h=t.direction||"left",l="up"===h||"down"===h?"top":"left",u="up"===h||"left"===h,d={};e.effects.save(n,a),n.show(),s=t.distance||n["top"===l?"outerHeight":"outerWidth"](!0),e.effects.createWrapper(n).css({overflow:"hidden"}),r&&n.css(l,u?isNaN(s)?"-"+s:-s:s),d[l]=(r?u?"+=":"-=":u?"-=":"+=")+s,n.animate(d,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===o&&n.hide(),e.effects.restore(n,a),e.effects.removeWrapper(n),i()}})},e.effects.effect.transfer=function(t,i){var s=e(this),n=e(t.to),a="fixed"===n.css("position"),o=e("body"),r=a?o.scrollTop():0,h=a?o.scrollLeft():0,l=n.offset(),u={top:l.top-r,left:l.left-h,height:n.innerHeight(),width:n.innerWidth()},d=s.offset(),c=e("<div class='ui-effects-transfer'></div>").appendTo(document.body).addClass(t.className).css({top:d.top-r,left:d.left-h,height:s.innerHeight(),width:s.innerWidth(),position:a?"fixed":"absolute"}).animate(u,t.duration,t.easing,function(){c.remove(),i()})},e.widget("ui.progressbar",{version:"1.11.4",options:{max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min}),this.valueDiv=e("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(e){return void 0===e?this.options.value:(this.options.value=this._constrainedValue(e),this._refreshValue(),void 0)},_constrainedValue:function(e){return void 0===e&&(e=this.options.value),this.indeterminate=e===!1,"number"!=typeof e&&(e=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,e))},_setOptions:function(e){var t=e.value;delete e.value,this._super(e),this.options.value=this._constrainedValue(t),this._refreshValue()},_setOption:function(e,t){"max"===e&&(t=Math.max(this.min,t)),"disabled"===e&&this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this._super(e,t)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var t=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||t>this.min).toggleClass("ui-corner-right",t===this.options.max).width(i.toFixed(0)+"%"),this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=e("<div class='ui-progressbar-overlay'></div>").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":t}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==t&&(this.oldValue=t,this._trigger("change")),t===this.options.max&&this._trigger("complete")}}),e.widget("ui.selectable",e.ui.mouse,{version:"1.11.4",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var t,i=this;this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){t=e(i.options.filter,i.element[0]),t.addClass("ui-selectee"),t.each(function(){var t=e(this),i=t.offset();e.data(this,"selectable-item",{element:this,$element:t,left:i.left,top:i.top,right:i.left+t.outerWidth(),bottom:i.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=t.addClass("ui-selectee"),this._mouseInit(),this.helper=e("<div class='ui-selectable-helper'></div>")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(t){var i=this,s=this.options;this.opos=[t.pageX,t.pageY],this.options.disabled||(this.selectees=e(s.filter,this.element[0]),this._trigger("start",t),e(s.appendTo).append(this.helper),this.helper.css({left:t.pageX,top:t.pageY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var s=e.data(this,"selectable-item");s.startselected=!0,t.metaKey||t.ctrlKey||(s.$element.removeClass("ui-selected"),s.selected=!1,s.$element.addClass("ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",t,{unselecting:s.element}))}),e(t.target).parents().addBack().each(function(){var s,n=e.data(this,"selectable-item");return n?(s=!t.metaKey&&!t.ctrlKey||!n.$element.hasClass("ui-selected"),n.$element.removeClass(s?"ui-unselecting":"ui-selected").addClass(s?"ui-selecting":"ui-unselecting"),n.unselecting=!s,n.selecting=s,n.selected=s,s?i._trigger("selecting",t,{selecting:n.element}):i._trigger("unselecting",t,{unselecting:n.element}),!1):void 0}))},_mouseDrag:function(t){if(this.dragged=!0,!this.options.disabled){var i,s=this,n=this.options,a=this.opos[0],o=this.opos[1],r=t.pageX,h=t.pageY;return a>r&&(i=r,r=a,a=i),o>h&&(i=h,h=o,o=i),this.helper.css({left:a,top:o,width:r-a,height:h-o}),this.selectees.each(function(){var i=e.data(this,"selectable-item"),l=!1;i&&i.element!==s.element[0]&&("touch"===n.tolerance?l=!(i.left>r||a>i.right||i.top>h||o>i.bottom):"fit"===n.tolerance&&(l=i.left>a&&r>i.right&&i.top>o&&h>i.bottom),l?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,s._trigger("selecting",t,{selecting:i.element}))):(i.selecting&&((t.metaKey||t.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),s._trigger("unselecting",t,{unselecting:i.element}))),i.selected&&(t.metaKey||t.ctrlKey||i.startselected||(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,s._trigger("unselecting",t,{unselecting:i.element})))))}),!1}},_mouseStop:function(t){var i=this;return this.dragged=!1,e(".ui-unselecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",t,{unselected:s.element})}),e(".ui-selecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-selecting").addClass("ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",t,{selected:s.element})}),this._trigger("stop",t),this.helper.remove(),!1}}),e.widget("ui.selectmenu",{version:"1.11.4",defaultElement:"<select>",options:{appendTo:null,disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"},width:null,change:null,close:null,focus:null,open:null,select:null},_create:function(){var e=this.element.uniqueId().attr("id");this.ids={element:e,button:e+"-button",menu:e+"-menu"},this._drawButton(),this._drawMenu(),this.options.disabled&&this.disable()},_drawButton:function(){var t=this;this.label=e("label[for='"+this.ids.element+"']").attr("for",this.ids.button),this._on(this.label,{click:function(e){this.button.focus(),e.preventDefault()}}),this.element.hide(),this.button=e("<span>",{"class":"ui-selectmenu-button ui-widget ui-state-default ui-corner-all",tabindex:this.options.disabled?-1:0,id:this.ids.button,role:"combobox","aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":"true"}).insertAfter(this.element),e("<span>",{"class":"ui-icon "+this.options.icons.button}).prependTo(this.button),this.buttonText=e("<span>",{"class":"ui-selectmenu-text"}).appendTo(this.button),this._setText(this.buttonText,this.element.find("option:selected").text()),this._resizeButton(),this._on(this.button,this._buttonEvents),this.button.one("focusin",function(){t.menuItems||t._refreshMenu()}),this._hoverable(this.button),this._focusable(this.button)},_drawMenu:function(){var t=this;this.menu=e("<ul>",{"aria-hidden":"true","aria-labelledby":this.ids.button,id:this.ids.menu}),this.menuWrap=e("<div>",{"class":"ui-selectmenu-menu ui-front"}).append(this.menu).appendTo(this._appendTo()),this.menuInstance=this.menu.menu({role:"listbox",select:function(e,i){e.preventDefault(),t._setSelection(),t._select(i.item.data("ui-selectmenu-item"),e)},focus:function(e,i){var s=i.item.data("ui-selectmenu-item");null!=t.focusIndex&&s.index!==t.focusIndex&&(t._trigger("focus",e,{item:s}),t.isOpen||t._select(s,e)),t.focusIndex=s.index,t.button.attr("aria-activedescendant",t.menuItems.eq(s.index).attr("id"))}}).menu("instance"),this.menu.addClass("ui-corner-bottom").removeClass("ui-corner-all"),this.menuInstance._off(this.menu,"mouseleave"),this.menuInstance._closeOnDocumentClick=function(){return!1},this.menuInstance._isDivider=function(){return!1}},refresh:function(){this._refreshMenu(),this._setText(this.buttonText,this._getSelectedItem().text()),this.options.width||this._resizeButton()},_refreshMenu:function(){this.menu.empty();var e,t=this.element.find("option");t.length&&(this._parseOptions(t),this._renderMenu(this.menu,this.items),this.menuInstance.refresh(),this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup"),e=this._getSelectedItem(),this.menuInstance.focus(null,e),this._setAria(e.data("ui-selectmenu-item")),this._setOption("disabled",this.element.prop("disabled")))},open:function(e){this.options.disabled||(this.menuItems?(this.menu.find(".ui-state-focus").removeClass("ui-state-focus"),this.menuInstance.focus(null,this._getSelectedItem())):this._refreshMenu(),this.isOpen=!0,this._toggleAttr(),this._resizeMenu(),this._position(),this._on(this.document,this._documentClick),this._trigger("open",e))},_position:function(){this.menuWrap.position(e.extend({of:this.button},this.options.position))},close:function(e){this.isOpen&&(this.isOpen=!1,this._toggleAttr(),this.range=null,this._off(this.document),this._trigger("close",e))},widget:function(){return this.button},menuWidget:function(){return this.menu},_renderMenu:function(t,i){var s=this,n="";e.each(i,function(i,a){a.optgroup!==n&&(e("<li>",{"class":"ui-selectmenu-optgroup ui-menu-divider"+(a.element.parent("optgroup").prop("disabled")?" ui-state-disabled":""),text:a.optgroup}).appendTo(t),n=a.optgroup),s._renderItemData(t,a)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-selectmenu-item",t)},_renderItem:function(t,i){var s=e("<li>");return i.disabled&&s.addClass("ui-state-disabled"),this._setText(s,i.label),s.appendTo(t)},_setText:function(e,t){t?e.text(t):e.html(" ")},_move:function(e,t){var i,s,n=".ui-menu-item";this.isOpen?i=this.menuItems.eq(this.focusIndex):(i=this.menuItems.eq(this.element[0].selectedIndex),n+=":not(.ui-state-disabled)"),s="first"===e||"last"===e?i["first"===e?"prevAll":"nextAll"](n).eq(-1):i[e+"All"](n).eq(0),s.length&&this.menuInstance.focus(t,s)},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex)},_toggle:function(e){this[this.isOpen?"close":"open"](e)},_setSelection:function(){var e;this.range&&(window.getSelection?(e=window.getSelection(),e.removeAllRanges(),e.addRange(this.range)):this.range.select(),this.button.focus())},_documentClick:{mousedown:function(t){this.isOpen&&(e(t.target).closest(".ui-selectmenu-menu, #"+this.ids.button).length||this.close(t))}},_buttonEvents:{mousedown:function(){var e;window.getSelection?(e=window.getSelection(),e.rangeCount&&(this.range=e.getRangeAt(0))):this.range=document.selection.createRange()},click:function(e){this._setSelection(),this._toggle(e)},keydown:function(t){var i=!0;switch(t.keyCode){case e.ui.keyCode.TAB:case e.ui.keyCode.ESCAPE:this.close(t),i=!1;break;case e.ui.keyCode.ENTER:this.isOpen&&this._selectFocusedItem(t);break;case e.ui.keyCode.UP:t.altKey?this._toggle(t):this._move("prev",t);break;case e.ui.keyCode.DOWN:t.altKey?this._toggle(t):this._move("next",t);break;case e.ui.keyCode.SPACE:this.isOpen?this._selectFocusedItem(t):this._toggle(t);break;case e.ui.keyCode.LEFT:this._move("prev",t);break;case e.ui.keyCode.RIGHT:this._move("next",t);break;case e.ui.keyCode.HOME:case e.ui.keyCode.PAGE_UP:this._move("first",t);break;case e.ui.keyCode.END:case e.ui.keyCode.PAGE_DOWN:this._move("last",t);break;default:this.menu.trigger(t),i=!1}i&&t.preventDefault()}},_selectFocusedItem:function(e){var t=this.menuItems.eq(this.focusIndex);t.hasClass("ui-state-disabled")||this._select(t.data("ui-selectmenu-item"),e)},_select:function(e,t){var i=this.element[0].selectedIndex;this.element[0].selectedIndex=e.index,this._setText(this.buttonText,e.label),this._setAria(e),this._trigger("select",t,{item:e}),e.index!==i&&this._trigger("change",t,{item:e}),this.close(t)},_setAria:function(e){var t=this.menuItems.eq(e.index).attr("id");this.button.attr({"aria-labelledby":t,"aria-activedescendant":t}),this.menu.attr("aria-activedescendant",t)},_setOption:function(e,t){"icons"===e&&this.button.find("span.ui-icon").removeClass(this.options.icons.button).addClass(t.button),this._super(e,t),"appendTo"===e&&this.menuWrap.appendTo(this._appendTo()),"disabled"===e&&(this.menuInstance.option("disabled",t),this.button.toggleClass("ui-state-disabled",t).attr("aria-disabled",t),this.element.prop("disabled",t),t?(this.button.attr("tabindex",-1),this.close()):this.button.attr("tabindex",0)),"width"===e&&this._resizeButton()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t&&t[0]||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_toggleAttr:function(){this.button.toggleClass("ui-corner-top",this.isOpen).toggleClass("ui-corner-all",!this.isOpen).attr("aria-expanded",this.isOpen),this.menuWrap.toggleClass("ui-selectmenu-open",this.isOpen),this.menu.attr("aria-hidden",!this.isOpen)},_resizeButton:function(){var e=this.options.width;e||(e=this.element.show().outerWidth(),this.element.hide()),this.button.outerWidth(e)},_resizeMenu:function(){this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width("").outerWidth()+1))},_getCreateOptions:function(){return{disabled:this.element.prop("disabled")}},_parseOptions:function(t){var i=[];t.each(function(t,s){var n=e(s),a=n.parent("optgroup");i.push({element:n,index:t,value:n.val(),label:n.text(),optgroup:a.attr("label")||"",disabled:a.prop("disabled")||n.prop("disabled")})}),this.items=i},_destroy:function(){this.menuWrap.remove(),this.button.remove(),this.element.show(),this.element.removeUniqueId(),this.label.attr("for",this.ids.element)}}),e.widget("ui.slider",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var t,i,s=this.options,n=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),a="<span class='ui-slider-handle ui-state-default ui-corner-all' tabindex='0'></span>",o=[];for(i=s.values&&s.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),t=n.length;i>t;t++)o.push(a);this.handles=n.add(e(o.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(t){e(this).data("ui-slider-handle-index",t)})},_createRange:function(){var t=this.options,i="";t.range?(t.range===!0&&(t.values?t.values.length&&2!==t.values.length?t.values=[t.values[0],t.values[0]]:e.isArray(t.values)&&(t.values=t.values.slice(0)):t.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=e("<div></div>").appendTo(this.element),i="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(i+("min"===t.range||"max"===t.range?" ui-slider-range-"+t.range:""))):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(t){var i,s,n,a,o,r,h,l,u=this,d=this.options;return d.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:t.pageX,y:t.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(t){var i=Math.abs(s-u.values(t));(n>i||n===i&&(t===u._lastChangedValue||u.values(t)===d.min))&&(n=i,a=e(this),o=t)}),r=this._start(t,o),r===!1?!1:(this._mouseSliding=!0,this._handleIndex=o,a.addClass("ui-state-active").focus(),h=a.offset(),l=!e(t.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:t.pageX-h.left-a.width()/2,top:t.pageY-h.top-a.height()/2-(parseInt(a.css("borderTopWidth"),10)||0)-(parseInt(a.css("borderBottomWidth"),10)||0)+(parseInt(a.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,o,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(e){var t={x:e.pageX,y:e.pageY},i=this._normValueFromMouse(t);return this._slide(e,this._handleIndex,i),!1},_mouseStop:function(e){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(e,this._handleIndex),this._change(e,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(e){var t,i,s,n,a;return"horizontal"===this.orientation?(t=this.elementSize.width,i=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(t=this.elementSize.height,i=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),s=i/t,s>1&&(s=1),0>s&&(s=0),"vertical"===this.orientation&&(s=1-s),n=this._valueMax()-this._valueMin(),a=this._valueMin()+s*n,this._trimAlignValue(a)},_start:function(e,t){var i={handle:this.handles[t],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._trigger("start",e,i)},_slide:function(e,t,i){var s,n,a;this.options.values&&this.options.values.length?(s=this.values(t?0:1),2===this.options.values.length&&this.options.range===!0&&(0===t&&i>s||1===t&&s>i)&&(i=s),i!==this.values(t)&&(n=this.values(),n[t]=i,a=this._trigger("slide",e,{handle:this.handles[t],value:i,values:n}),s=this.values(t?0:1),a!==!1&&this.values(t,i))):i!==this.value()&&(a=this._trigger("slide",e,{handle:this.handles[t],value:i}),a!==!1&&this.value(i))},_stop:function(e,t){var i={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._trigger("stop",e,i)},_change:function(e,t){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._lastChangedValue=t,this._trigger("change",e,i)}},value:function(e){return arguments.length?(this.options.value=this._trimAlignValue(e),this._refreshValue(),this._change(null,0),void 0):this._value()},values:function(t,i){var s,n,a;if(arguments.length>1)return this.options.values[t]=this._trimAlignValue(i),this._refreshValue(),this._change(null,t),void 0;if(!arguments.length)return this._values();if(!e.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(t):this.value();for(s=this.options.values,n=arguments[0],a=0;s.length>a;a+=1)s[a]=this._trimAlignValue(n[a]),this._change(null,a);this._refreshValue()},_setOption:function(t,i){var s,n=0;switch("range"===t&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),e.isArray(this.options.values)&&(n=this.options.values.length),"disabled"===t&&this.element.toggleClass("ui-state-disabled",!!i),this._super(t,i),t){case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue(),this.handles.css("horizontal"===i?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),s=0;n>s;s+=1)this._change(null,s);this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){var e=this.options.value;return e=this._trimAlignValue(e)},_values:function(e){var t,i,s;if(arguments.length)return t=this.options.values[e],t=this._trimAlignValue(t);if(this.options.values&&this.options.values.length){for(i=this.options.values.slice(),s=0;i.length>s;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(e){if(this._valueMin()>=e)return this._valueMin();if(e>=this._valueMax())return this._valueMax();var t=this.options.step>0?this.options.step:1,i=(e-this._valueMin())%t,s=e-i;return 2*Math.abs(i)>=t&&(s+=i>0?t:-t),parseFloat(s.toFixed(5))},_calculateNewMax:function(){var e=this.options.max,t=this._valueMin(),i=this.options.step,s=Math.floor(+(e-t).toFixed(this._precision())/i)*i;e=s+t,this.max=parseFloat(e.toFixed(this._precision()))},_precision:function(){var e=this._precisionOf(this.options.step);return null!==this.options.min&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=""+e,i=t.indexOf(".");return-1===i?0:t.length-i-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshValue:function(){var t,i,s,n,a,o=this.options.range,r=this.options,h=this,l=this._animateOff?!1:r.animate,u={};this.options.values&&this.options.values.length?this.handles.each(function(s){i=100*((h.values(s)-h._valueMin())/(h._valueMax()-h._valueMin())),u["horizontal"===h.orientation?"left":"bottom"]=i+"%",e(this).stop(1,1)[l?"animate":"css"](u,r.animate),h.options.range===!0&&("horizontal"===h.orientation?(0===s&&h.range.stop(1,1)[l?"animate":"css"]({left:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({width:i-t+"%"},{queue:!1,duration:r.animate})):(0===s&&h.range.stop(1,1)[l?"animate":"css"]({bottom:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({height:i-t+"%"},{queue:!1,duration:r.animate}))),t=i}):(s=this.value(),n=this._valueMin(),a=this._valueMax(),i=a!==n?100*((s-n)/(a-n)):0,u["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[l?"animate":"css"](u,r.animate),"min"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:i+"%"},r.animate),"max"===o&&"horizontal"===this.orientation&&this.range[l?"animate":"css"]({width:100-i+"%"},{queue:!1,duration:r.animate}),"min"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:i+"%"},r.animate),"max"===o&&"vertical"===this.orientation&&this.range[l?"animate":"css"]({height:100-i+"%"},{queue:!1,duration:r.animate}))},_handleEvents:{keydown:function(t){var i,s,n,a,o=e(t.target).data("ui-slider-handle-index");switch(t.keyCode){case e.ui.keyCode.HOME:case e.ui.keyCode.END:case e.ui.keyCode.PAGE_UP:case e.ui.keyCode.PAGE_DOWN:case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(t.preventDefault(),!this._keySliding&&(this._keySliding=!0,e(t.target).addClass("ui-state-active"),i=this._start(t,o),i===!1))return}switch(a=this.options.step,s=n=this.options.values&&this.options.values.length?this.values(o):this.value(),t.keyCode){case e.ui.keyCode.HOME:n=this._valueMin();break;case e.ui.keyCode.END:n=this._valueMax();break;case e.ui.keyCode.PAGE_UP:n=this._trimAlignValue(s+(this._valueMax()-this._valueMin())/this.numPages);break;case e.ui.keyCode.PAGE_DOWN:n=this._trimAlignValue(s-(this._valueMax()-this._valueMin())/this.numPages);break;case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:if(s===this._valueMax())return;n=this._trimAlignValue(s+a);break;case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(s===this._valueMin())return;n=this._trimAlignValue(s-a)}this._slide(t,o,n)},keyup:function(t){var i=e(t.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(t,i),this._change(t,i),e(t.target).removeClass("ui-state-active"))}}}),e.widget("ui.sortable",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(e,t,i){return e>=t&&t+i>e},_isFloating:function(e){return/left|right/.test(e.css("float"))||/inline|table-cell/.test(e.css("display"))},_create:function(){this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(e,t){this._super(e,t),"handle"===e&&this._setHandleClassName()},_setHandleClassName:function(){this.element.find(".ui-sortable-handle").removeClass("ui-sortable-handle"),e.each(this.items,function(){(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item).addClass("ui-sortable-handle")})},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").find(".ui-sortable-handle").removeClass("ui-sortable-handle"),this._mouseDestroy();for(var e=this.items.length-1;e>=0;e--)this.items[e].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(t,i){var s=null,n=!1,a=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(t),e(t.target).parents().each(function(){return e.data(this,a.widgetName+"-item")===a?(s=e(this),!1):void 0}),e.data(t.target,a.widgetName+"-item")===a&&(s=e(t.target)),s?!this.options.handle||i||(e(this.options.handle,s).find("*").addBack().each(function(){this===t.target&&(n=!0)}),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(t,i,s){var n,a,o=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),o.containment&&this._setContainment(),o.cursor&&"auto"!==o.cursor&&(a=this.document.find("body"),this.storedCursor=a.css("cursor"),a.css("cursor",o.cursor),this.storedStylesheet=e("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(a)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",t,this._uiHash(this));
|
|
12
|
+
return e.ui.ddmanager&&(e.ui.ddmanager.current=this),e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){var i,s,n,a,o=this.options,r=!1;for(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<o.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+o.scrollSpeed:t.pageY-this.overflowOffset.top<o.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-o.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<o.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+o.scrollSpeed:t.pageX-this.overflowOffset.left<o.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-o.scrollSpeed)):(t.pageY-this.document.scrollTop()<o.scrollSensitivity?r=this.document.scrollTop(this.document.scrollTop()-o.scrollSpeed):this.window.height()-(t.pageY-this.document.scrollTop())<o.scrollSensitivity&&(r=this.document.scrollTop(this.document.scrollTop()+o.scrollSpeed)),t.pageX-this.document.scrollLeft()<o.scrollSensitivity?r=this.document.scrollLeft(this.document.scrollLeft()-o.scrollSpeed):this.window.width()-(t.pageX-this.document.scrollLeft())<o.scrollSensitivity&&(r=this.document.scrollLeft(this.document.scrollLeft()+o.scrollSpeed))),r!==!1&&e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(s=this.items[i],n=s.item[0],a=this._intersectsWithPointer(s),a&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===a?"next":"prev"]()[0]!==n&&!e.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!e.contains(this.element[0],n):!0)){if(this.direction=1===a?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(t,s),this._trigger("change",t,this._uiHash());break}return this._contactContainers(t),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,i){if(t){if(e.ui.ddmanager&&!this.options.dropBehaviour&&e.ui.ddmanager.drop(this,t),this.options.revert){var s=this,n=this.placeholder.offset(),a=this.options.axis,o={};a&&"x"!==a||(o.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),a&&"y"!==a||(o.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,e(this.helper).animate(o,parseInt(this.options.revert,10)||500,function(){s._clear(t)})}else this._clear(t,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var t=this.containers.length-1;t>=0;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),e.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?e(this.domPosition.prev).after(this.currentItem):e(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var i=this._getItemsAsjQuery(t&&t.connected),s=[];return t=t||{},e(i).each(function(){var i=(e(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[\-=_](.+)/);i&&s.push((t.key||i[1]+"[]")+"="+(t.key&&t.expression?i[1]:i[2]))}),!s.length&&t.key&&s.push(t.key+"="),s.join("&")},toArray:function(t){var i=this._getItemsAsjQuery(t&&t.connected),s=[];return t=t||{},i.each(function(){s.push(e(t.item||this).attr(t.attribute||"id")||"")}),s},_intersectsWith:function(e){var t=this.positionAbs.left,i=t+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,a=e.left,o=a+e.width,r=e.top,h=r+e.height,l=this.offset.click.top,u=this.offset.click.left,d="x"===this.options.axis||s+l>r&&h>s+l,c="y"===this.options.axis||t+u>a&&o>t+u,p=d&&c;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>e[this.floating?"width":"height"]?p:t+this.helperProportions.width/2>a&&o>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&h>n-this.helperProportions.height/2},_intersectsWithPointer:function(e){var t="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top,e.height),i="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left,e.width),s=t&&i,n=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return s?this.floating?a&&"right"===a||"down"===n?2:1:n&&("down"===n?2:1):!1},_intersectsWithSides:function(e){var t=this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top+e.height/2,e.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left+e.width/2,e.width),s=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection();return this.floating&&n?"right"===n&&i||"left"===n&&!i:s&&("down"===s&&t||"up"===s&&!t)},_getDragVerticalDirection:function(){var e=this.positionAbs.top-this.lastPositionAbs.top;return 0!==e&&(e>0?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return 0!==e&&(e>0?"right":"left")},refresh:function(e){return this._refreshItems(e),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var e=this.options;return e.connectWith.constructor===String?[e.connectWith]:e.connectWith},_getItemsAsjQuery:function(t){function i(){r.push(this)}var s,n,a,o,r=[],h=[],l=this._connectWith();if(l&&t)for(s=l.length-1;s>=0;s--)for(a=e(l[s],this.document[0]),n=a.length-1;n>=0;n--)o=e.data(a[n],this.widgetFullName),o&&o!==this&&!o.options.disabled&&h.push([e.isFunction(o.options.items)?o.options.items.call(o.element):e(o.options.items,o.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),o]);for(h.push([e.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):e(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),s=h.length-1;s>=0;s--)h[s][0].each(i);return e(r)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=e.grep(this.items,function(e){for(var i=0;t.length>i;i++)if(t[i]===e.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var i,s,n,a,o,r,h,l,u=this.items,d=[[e.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):e(this.options.items,this.element),this]],c=this._connectWith();if(c&&this.ready)for(i=c.length-1;i>=0;i--)for(n=e(c[i],this.document[0]),s=n.length-1;s>=0;s--)a=e.data(n[s],this.widgetFullName),a&&a!==this&&!a.options.disabled&&(d.push([e.isFunction(a.options.items)?a.options.items.call(a.element[0],t,{item:this.currentItem}):e(a.options.items,a.element),a]),this.containers.push(a));for(i=d.length-1;i>=0;i--)for(o=d[i][1],r=d[i][0],s=0,l=r.length;l>s;s++)h=e(r[s]),h.data(this.widgetName+"-item",o),u.push({item:h,instance:o,width:0,height:0,left:0,top:0})},refreshPositions:function(t){this.floating=this.items.length?"x"===this.options.axis||this._isFloating(this.items[0].item):!1,this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,a;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?e(this.options.toleranceElement,s.item):s.item,t||(s.width=n.outerWidth(),s.height=n.outerHeight()),a=n.offset(),s.left=a.left,s.top=a.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)a=this.containers[i].element.offset(),this.containers[i].containerCache.left=a.left,this.containers[i].containerCache.top=a.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(t){t=t||this;var i,s=t.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=t.currentItem[0].nodeName.toLowerCase(),n=e("<"+s+">",t.document[0]).addClass(i||t.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tbody"===s?t._createTrPlaceholder(t.currentItem.find("tr").eq(0),e("<tr>",t.document[0]).appendTo(n)):"tr"===s?t._createTrPlaceholder(t.currentItem,n):"img"===s&&n.attr("src",t.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(e,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(t.currentItem.innerHeight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10)))}}),t.placeholder=e(s.placeholder.element.call(t.element,t.currentItem)),t.currentItem.after(t.placeholder),s.placeholder.update(t,t.placeholder)},_createTrPlaceholder:function(t,i){var s=this;t.children().each(function(){e("<td> </td>",s.document[0]).attr("colspan",e(this).attr("colspan")||1).appendTo(i)})},_contactContainers:function(t){var i,s,n,a,o,r,h,l,u,d,c=null,p=null;for(i=this.containers.length-1;i>=0;i--)if(!e.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(c&&e.contains(this.containers[i].element[0],c.element[0]))continue;c=this.containers[i],p=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",t,this._uiHash(this)),this.containers[i].containerCache.over=0);if(c)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(n=1e4,a=null,u=c.floating||this._isFloating(this.currentItem),o=u?"left":"top",r=u?"width":"height",d=u?"clientX":"clientY",s=this.items.length-1;s>=0;s--)e.contains(this.containers[p].element[0],this.items[s].item[0])&&this.items[s].item[0]!==this.currentItem[0]&&(h=this.items[s].item.offset()[o],l=!1,t[d]-h>this.items[s][r]/2&&(l=!0),n>Math.abs(t[d]-h)&&(n=Math.abs(t[d]-h),a=this.items[s],this.direction=l?"up":"down"));if(!a&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[p])return this.currentContainer.containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash()),this.currentContainer.containerCache.over=1),void 0;a?this._rearrange(t,a,null,!0):this._rearrange(t,null,this.containers[p].element,!0),this._trigger("change",t,this._uiHash()),this.containers[p]._trigger("change",t,this._uiHash(this)),this.currentContainer=this.containers[p],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1}},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper)?e(i.helper.apply(this.element[0],[t,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||e("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&e.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var e=this.currentItem.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===n.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===n.containment?this.document.width():this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(t=e(n.containment)[0],i=e(n.containment).offset(),s="hidden"!==e(t).css("overflow"),this.containment=[i.left+(parseInt(e(t).css("borderLeftWidth"),10)||0)+(parseInt(e(t).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(e(t).css("borderTopWidth"),10)||0)+(parseInt(e(t).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(e(t).css("borderLeftWidth"),10)||0)-(parseInt(e(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(e(t).css("borderTopWidth"),10)||0)-(parseInt(e(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(t,i){i||(i=this.position);var s="absolute"===t?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,a=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():a?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():a?0:n.scrollLeft())*s}},_generatePosition:function(t){var i,s,n=this.options,a=t.pageX,o=t.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(a=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(o=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(a=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1],o=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((a-this.originalPageX)/n.grid[0])*n.grid[0],a=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_rearrange:function(e,t,i,s){i?i[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?t.item[0]:t.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(e,t){function i(e,t,i){return function(s){i._trigger(e,s,t._uiHash(t))}}this.reverting=!1;var s,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(s in this._storedCSS)("auto"===this._storedCSS[s]||"static"===this._storedCSS[s])&&(this._storedCSS[s]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!t&&n.push(function(e){this._trigger("receive",e,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||t||n.push(function(e){this._trigger("update",e,this._uiHash())}),this!==this.currentContainer&&(t||(n.push(function(e){this._trigger("remove",e,this._uiHash())}),n.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),s=this.containers.length-1;s>=0;s--)t||n.push(i("deactivate",this,this.containers[s])),this.containers[s].containerCache.over&&(n.push(i("out",this,this.containers[s])),this.containers[s].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,t||this._trigger("beforeStop",e,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!t){for(s=0;n.length>s;s++)n[s].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){e.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(t){var i=t||this;return{helper:i.helper,placeholder:i.placeholder||e([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:t?t.element:null}}}),e.widget("ui.spinner",{version:"1.11.4",defaultElement:"<input>",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var t={},i=this.element;return e.each(["min","max","step"],function(e,s){var n=i.attr(s);void 0!==n&&n.length&&(t[s]=n)}),t},_events:{keydown:function(e){this._start(e)&&this._keydown(e)&&e.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,void 0):(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",e),void 0)},mousewheel:function(e,t){if(t){if(!this.spinning&&!this._start(e))return!1;this._spin((t>0?1:-1)*this.options.step,e),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(e)},100),e.preventDefault()}},"mousedown .ui-spinner-button":function(t){function i(){var e=this.element[0]===this.document[0].activeElement;e||(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s}))}var s;s=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),t.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),this._start(t)!==!1&&this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){return e(t.currentTarget).hasClass("ui-state-active")?this._start(t)===!1?!1:(this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t),void 0):void 0},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var e=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=e.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(.5*e.height())&&e.height()>0&&e.height(e.height()),this.options.disabled&&this.disable()},_keydown:function(t){var i=this.options,s=e.ui.keyCode;switch(t.keyCode){case s.UP:return this._repeat(null,1,t),!0;case s.DOWN:return this._repeat(null,-1,t),!0;case s.PAGE_UP:return this._repeat(null,i.page,t),!0;case s.PAGE_DOWN:return this._repeat(null,-i.page,t),!0}return!1},_uiSpinnerHtml:function(){return"<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>"},_buttonHtml:function(){return"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon "+this.options.icons.up+"'>▲</span>"+"</a>"+"<a class='ui-spinner-button ui-spinner-down ui-corner-br'>"+"<span class='ui-icon "+this.options.icons.down+"'>▼</span>"+"</a>"},_start:function(e){return this.spinning||this._trigger("start",e)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_repeat:function(e,t,i){e=e||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,t,i)},e),this._spin(t*this.options.step,i)},_spin:function(e,t){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+e*this._increment(this.counter)),this.spinning&&this._trigger("spin",t,{value:i})===!1||(this._value(i),this.counter++)},_increment:function(t){var i=this.options.incremental;return i?e.isFunction(i)?i(t):Math.floor(t*t*t/5e4-t*t/500+17*t/200+1):1},_precision:function(){var e=this._precisionOf(this.options.step);return null!==this.options.min&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=""+e,i=t.indexOf(".");return-1===i?0:t.length-i-1},_adjustValue:function(e){var t,i,s=this.options;return t=null!==s.min?s.min:0,i=e-t,i=Math.round(i/s.step)*s.step,e=t+i,e=parseFloat(e.toFixed(this._precision())),null!==s.max&&e>s.max?s.max:null!==s.min&&s.min>e?s.min:e},_stop:function(e){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",e))},_setOption:function(e,t){if("culture"===e||"numberFormat"===e){var i=this._parse(this.element.val());return this.options[e]=t,this.element.val(this._format(i)),void 0}("max"===e||"min"===e||"step"===e)&&"string"==typeof t&&(t=this._parse(t)),"icons"===e&&(this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(t.up),this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(t.down)),this._super(e,t),"disabled"===e&&(this.widget().toggleClass("ui-state-disabled",!!t),this.element.prop("disabled",!!t),this.buttons.button(t?"disable":"enable"))},_setOptions:h(function(e){this._super(e)}),_parse:function(e){return"string"==typeof e&&""!==e&&(e=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(e,10,this.options.culture):+e),""===e||isNaN(e)?null:e},_format:function(e){return""===e?"":window.Globalize&&this.options.numberFormat?Globalize.format(e,this.options.numberFormat,this.options.culture):e},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var e=this.value();return null===e?!1:e===this._adjustValue(e)},_value:function(e,t){var i;""!==e&&(i=this._parse(e),null!==i&&(t||(i=this._adjustValue(i)),e=this._format(i))),this.element.val(e),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:h(function(e){this._stepUp(e)}),_stepUp:function(e){this._start()&&(this._spin((e||1)*this.options.step),this._stop())},stepDown:h(function(e){this._stepDown(e)}),_stepDown:function(e){this._start()&&(this._spin((e||1)*-this.options.step),this._stop())},pageUp:h(function(e){this._stepUp((e||1)*this.options.page)}),pageDown:h(function(e){this._stepDown((e||1)*this.options.page)}),value:function(e){return arguments.length?(h(this._value).call(this,e),void 0):this._parse(this.element.val())},widget:function(){return this.uiSpinner}}),e.widget("ui.tabs",{version:"1.11.4",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:function(){var e=/#.*$/;return function(t){var i,s;t=t.cloneNode(!1),i=t.href.replace(e,""),s=location.href.replace(e,"");try{i=decodeURIComponent(i)}catch(n){}try{s=decodeURIComponent(s)}catch(n){}return t.hash.length>1&&i===s}}(),_create:function(){var t=this,i=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",i.collapsible),this._processTabs(),i.active=this._initialActive(),e.isArray(i.disabled)&&(i.disabled=e.unique(i.disabled.concat(e.map(this.tabs.filter(".ui-state-disabled"),function(e){return t.tabs.index(e)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):e(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var t=this.options.active,i=this.options.collapsible,s=location.hash.substring(1);return null===t&&(s&&this.tabs.each(function(i,n){return e(n).attr("aria-controls")===s?(t=i,!1):void 0}),null===t&&(t=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===t||-1===t)&&(t=this.tabs.length?0:!1)),t!==!1&&(t=this.tabs.index(this.tabs.eq(t)),-1===t&&(t=i?!1:0)),!i&&t===!1&&this.anchors.length&&(t=0),t},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):e()}},_tabKeydown:function(t){var i=e(this.document[0].activeElement).closest("li"),s=this.tabs.index(i),n=!0;if(!this._handlePageNav(t)){switch(t.keyCode){case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:s++;break;case e.ui.keyCode.UP:case e.ui.keyCode.LEFT:n=!1,s--;break;case e.ui.keyCode.END:s=this.anchors.length-1;break;case e.ui.keyCode.HOME:s=0;break;case e.ui.keyCode.SPACE:return t.preventDefault(),clearTimeout(this.activating),this._activate(s),void 0;case e.ui.keyCode.ENTER:return t.preventDefault(),clearTimeout(this.activating),this._activate(s===this.options.active?!1:s),void 0;default:return}t.preventDefault(),clearTimeout(this.activating),s=this._focusNextTab(s,n),t.ctrlKey||t.metaKey||(i.attr("aria-selected","false"),this.tabs.eq(s).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",s)},this.delay))}},_panelKeydown:function(t){this._handlePageNav(t)||t.ctrlKey&&t.keyCode===e.ui.keyCode.UP&&(t.preventDefault(),this.active.focus())},_handlePageNav:function(t){return t.altKey&&t.keyCode===e.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):t.altKey&&t.keyCode===e.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(t,i){function s(){return t>n&&(t=0),0>t&&(t=n),t}for(var n=this.tabs.length-1;-1!==e.inArray(s(),this.options.disabled);)t=i?t+1:t-1;return t},_focusNextTab:function(e,t){return e=this._findNextTab(e,t),this.tabs.eq(e).focus(),e},_setOption:function(e,t){return"active"===e?(this._activate(t),void 0):"disabled"===e?(this._setupDisabled(t),void 0):(this._super(e,t),"collapsible"===e&&(this.element.toggleClass("ui-tabs-collapsible",t),t||this.options.active!==!1||this._activate(0)),"event"===e&&this._setupEvents(t),"heightStyle"===e&&this._setupHeightStyle(t),void 0)},_sanitizeSelector:function(e){return e?e.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,i=this.tablist.children(":has(a[href])");t.disabled=e.map(i.filter(".ui-state-disabled"),function(e){return i.index(e)}),this._processTabs(),t.active!==!1&&this.anchors.length?this.active.length&&!e.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=e()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=e()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var t=this,i=this.tabs,s=this.anchors,n=this.panels;
|
|
13
|
+
this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist").delegate("> li","mousedown"+this.eventNamespace,function(t){e(this).is(".ui-state-disabled")&&t.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){e(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return e("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=e(),this.anchors.each(function(i,s){var n,a,o,r=e(s).uniqueId().attr("id"),h=e(s).closest("li"),l=h.attr("aria-controls");t._isLocal(s)?(n=s.hash,o=n.substring(1),a=t.element.find(t._sanitizeSelector(n))):(o=h.attr("aria-controls")||e({}).uniqueId()[0].id,n="#"+o,a=t.element.find(n),a.length||(a=t._createPanel(o),a.insertAfter(t.panels[i-1]||t.tablist)),a.attr("aria-live","polite")),a.length&&(t.panels=t.panels.add(a)),l&&h.data("ui-tabs-aria-controls",l),h.attr({"aria-controls":o,"aria-labelledby":r}),a.attr("aria-labelledby",r)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel"),i&&(this._off(i.not(this.tabs)),this._off(s.not(this.anchors)),this._off(n.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol,ul").eq(0)},_createPanel:function(t){return e("<div>").attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(t){e.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1);for(var i,s=0;i=this.tabs[s];s++)t===!0||-1!==e.inArray(s,t)?e(i).addClass("ui-state-disabled").attr("aria-disabled","true"):e(i).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=t},_setupEvents:function(t){var i={};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(e){e.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var i,s=this.element.parent();"fill"===t?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=e(this),s=t.css("position");"absolute"!==s&&"fixed"!==s&&(i-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=e(this).outerHeight(!0)}),this.panels.each(function(){e(this).height(Math.max(0,i-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.panels.each(function(){i=Math.max(i,e(this).height("").height())}).height(i))},_eventHandler:function(t){var i=this.options,s=this.active,n=e(t.currentTarget),a=n.closest("li"),o=a[0]===s[0],r=o&&i.collapsible,h=r?e():this._getPanelForTab(a),l=s.length?this._getPanelForTab(s):e(),u={oldTab:s,oldPanel:l,newTab:r?e():a,newPanel:h};t.preventDefault(),a.hasClass("ui-state-disabled")||a.hasClass("ui-tabs-loading")||this.running||o&&!i.collapsible||this._trigger("beforeActivate",t,u)===!1||(i.active=r?!1:this.tabs.index(a),this.active=o?e():a,this.xhr&&this.xhr.abort(),l.length||h.length||e.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(a),t),this._toggle(t,u))},_toggle:function(t,i){function s(){a.running=!1,a._trigger("activate",t,i)}function n(){i.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),o.length&&a.options.show?a._show(o,a.options.show,s):(o.show(),s())}var a=this,o=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),n()}):(i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r.hide(),n()),r.attr("aria-hidden","true"),i.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),o.length&&r.length?i.oldTab.attr("tabIndex",-1):o.length&&this.tabs.filter(function(){return 0===e(this).attr("tabIndex")}).attr("tabIndex",-1),o.attr("aria-hidden","false"),i.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(t){var i,s=this._findActive(t);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return t===!1?e():this.tabs.eq(t)},_getIndex:function(e){return"string"==typeof e&&(e=this.anchors.index(this.anchors.filter("[href$='"+e+"']"))),e},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(),this.tablist.unbind(this.eventNamespace),this.tabs.add(this.panels).each(function(){e.data(this,"ui-tabs-destroy")?e(this).remove():e(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var t=e(this),i=t.data("ui-tabs-aria-controls");i?t.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(t){var i=this.options.disabled;i!==!1&&(void 0===t?i=!1:(t=this._getIndex(t),i=e.isArray(i)?e.map(i,function(e){return e!==t?e:null}):e.map(this.tabs,function(e,i){return i!==t?i:null})),this._setupDisabled(i))},disable:function(t){var i=this.options.disabled;if(i!==!0){if(void 0===t)i=!0;else{if(t=this._getIndex(t),-1!==e.inArray(t,i))return;i=e.isArray(i)?e.merge([t],i).sort():[t]}this._setupDisabled(i)}},load:function(t,i){t=this._getIndex(t);var s=this,n=this.tabs.eq(t),a=n.find(".ui-tabs-anchor"),o=this._getPanelForTab(n),r={tab:n,panel:o},h=function(e,t){"abort"===t&&s.panels.stop(!1,!0),n.removeClass("ui-tabs-loading"),o.removeAttr("aria-busy"),e===s.xhr&&delete s.xhr};this._isLocal(a[0])||(this.xhr=e.ajax(this._ajaxSettings(a,i,r)),this.xhr&&"canceled"!==this.xhr.statusText&&(n.addClass("ui-tabs-loading"),o.attr("aria-busy","true"),this.xhr.done(function(e,t,n){setTimeout(function(){o.html(e),s._trigger("load",i,r),h(n,t)},1)}).fail(function(e,t){setTimeout(function(){h(e,t)},1)})))},_ajaxSettings:function(t,i,s){var n=this;return{url:t.attr("href"),beforeSend:function(t,a){return n._trigger("beforeLoad",i,e.extend({jqXHR:t,ajaxSettings:a},s))}}},_getPanelForTab:function(t){var i=e(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}}),e.widget("ui.tooltip",{version:"1.11.4",options:{content:function(){var t=e(this).attr("title")||"";return e("<a>").text(t).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_addDescribedBy:function(t,i){var s=(t.attr("aria-describedby")||"").split(/\s+/);s.push(i),t.data("ui-tooltip-id",i).attr("aria-describedby",e.trim(s.join(" ")))},_removeDescribedBy:function(t){var i=t.data("ui-tooltip-id"),s=(t.attr("aria-describedby")||"").split(/\s+/),n=e.inArray(i,s);-1!==n&&s.splice(n,1),t.removeData("ui-tooltip-id"),s=e.trim(s.join(" ")),s?t.attr("aria-describedby",s):t.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable(),this.liveRegion=e("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body)},_setOption:function(t,i){var s=this;return"disabled"===t?(this[i?"_disable":"_enable"](),this.options[t]=i,void 0):(this._super(t,i),"content"===t&&e.each(this.tooltips,function(e,t){s._updateContent(t.element)}),void 0)},_disable:function(){var t=this;e.each(this.tooltips,function(i,s){var n=e.Event("blur");n.target=n.currentTarget=s.element[0],t.close(n,!0)}),this.element.find(this.options.items).addBack().each(function(){var t=e(this);t.is("[title]")&&t.data("ui-tooltip-title",t.attr("title")).removeAttr("title")})},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var t=e(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))})},open:function(t){var i=this,s=e(t?t.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),t&&"mouseover"===t.type&&s.parents().each(function(){var t,s=e(this);s.data("ui-tooltip-open")&&(t=e.Event("blur"),t.target=t.currentTarget=this,i.close(t,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}),this._registerCloseHandlers(t,s),this._updateContent(s,t))},_updateContent:function(e,t){var i,s=this.options.content,n=this,a=t?t.type:null;return"string"==typeof s?this._open(t,e,s):(i=s.call(e[0],function(i){n._delay(function(){e.data("ui-tooltip-open")&&(t&&(t.type=a),this._open(t,e,i))})}),i&&this._open(t,e,i),void 0)},_open:function(t,i,s){function n(e){l.of=e,o.is(":hidden")||o.position(l)}var a,o,r,h,l=e.extend({},this.options.position);if(s){if(a=this._find(i))return a.tooltip.find(".ui-tooltip-content").html(s),void 0;i.is("[title]")&&(t&&"mouseover"===t.type?i.attr("title",""):i.removeAttr("title")),a=this._tooltip(i),o=a.tooltip,this._addDescribedBy(i,o.attr("id")),o.find(".ui-tooltip-content").html(s),this.liveRegion.children().hide(),s.clone?(h=s.clone(),h.removeAttr("id").find("[id]").removeAttr("id")):h=s,e("<div>").html(h).appendTo(this.liveRegion),this.options.track&&t&&/^mouse/.test(t.type)?(this._on(this.document,{mousemove:n}),n(t)):o.position(e.extend({of:i},this.options.position)),o.hide(),this._show(o,this.options.show),this.options.show&&this.options.show.delay&&(r=this.delayedShow=setInterval(function(){o.is(":visible")&&(n(l.of),clearInterval(r))},e.fx.interval)),this._trigger("open",t,{tooltip:o})}},_registerCloseHandlers:function(t,i){var s={keyup:function(t){if(t.keyCode===e.ui.keyCode.ESCAPE){var s=e.Event(t);s.currentTarget=i[0],this.close(s,!0)}}};i[0]!==this.element[0]&&(s.remove=function(){this._removeTooltip(this._find(i).tooltip)}),t&&"mouseover"!==t.type||(s.mouseleave="close"),t&&"focusin"!==t.type||(s.focusout="close"),this._on(!0,i,s)},close:function(t){var i,s=this,n=e(t?t.currentTarget:this.element),a=this._find(n);return a?(i=a.tooltip,a.closing||(clearInterval(this.delayedShow),n.data("ui-tooltip-title")&&!n.attr("title")&&n.attr("title",n.data("ui-tooltip-title")),this._removeDescribedBy(n),a.hiding=!0,i.stop(!0),this._hide(i,this.options.hide,function(){s._removeTooltip(e(this))}),n.removeData("ui-tooltip-open"),this._off(n,"mouseleave focusout keyup"),n[0]!==this.element[0]&&this._off(n,"remove"),this._off(this.document,"mousemove"),t&&"mouseleave"===t.type&&e.each(this.parents,function(t,i){e(i.element).attr("title",i.title),delete s.parents[t]}),a.closing=!0,this._trigger("close",t,{tooltip:i}),a.hiding||(a.closing=!1)),void 0):(n.removeData("ui-tooltip-open"),void 0)},_tooltip:function(t){var i=e("<div>").attr("role","tooltip").addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||"")),s=i.uniqueId().attr("id");return e("<div>").addClass("ui-tooltip-content").appendTo(i),i.appendTo(this.document[0].body),this.tooltips[s]={element:t,tooltip:i}},_find:function(e){var t=e.data("ui-tooltip-id");return t?this.tooltips[t]:null},_removeTooltip:function(e){e.remove(),delete this.tooltips[e.attr("id")]},_destroy:function(){var t=this;e.each(this.tooltips,function(i,s){var n=e.Event("blur"),a=s.element;n.target=n.currentTarget=a[0],t.close(n,!0),e("#"+i).remove(),a.data("ui-tooltip-title")&&(a.attr("title")||a.attr("title",a.data("ui-tooltip-title")),a.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}})});
|
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* jQuery File Upload Image Preview & Resize Plugin
|
|
3
|
+
* https://github.com/blueimp/jQuery-File-Upload
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2013, Sebastian Tschan
|
|
6
|
+
* https://blueimp.net
|
|
7
|
+
*
|
|
8
|
+
* Licensed under the MIT license:
|
|
9
|
+
* http://www.opensource.org/licenses/MIT
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/* jshint nomen:false */
|
|
13
|
+
/* global define, require, window, Blob */
|
|
14
|
+
|
|
15
|
+
;(function (factory) {
|
|
16
|
+
'use strict';
|
|
17
|
+
if (typeof define === 'function' && define.amd) {
|
|
18
|
+
// Register as an anonymous AMD module:
|
|
19
|
+
define([
|
|
20
|
+
'jquery',
|
|
21
|
+
'load-image',
|
|
22
|
+
'load-image-meta',
|
|
23
|
+
'load-image-exif',
|
|
24
|
+
'canvas-to-blob',
|
|
25
|
+
'./jquery.fileupload-process'
|
|
26
|
+
], factory);
|
|
27
|
+
} else if (typeof exports === 'object') {
|
|
28
|
+
// Node/CommonJS:
|
|
29
|
+
factory(
|
|
30
|
+
require('jquery'),
|
|
31
|
+
require('blueimp-load-image/js/load-image'),
|
|
32
|
+
require('blueimp-load-image/js/load-image-meta'),
|
|
33
|
+
require('blueimp-load-image/js/load-image-exif'),
|
|
34
|
+
require('blueimp-canvas-to-blob'),
|
|
35
|
+
require('./jquery.fileupload-process')
|
|
36
|
+
);
|
|
37
|
+
} else {
|
|
38
|
+
// Browser globals:
|
|
39
|
+
factory(
|
|
40
|
+
window.jQuery,
|
|
41
|
+
window.loadImage
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
}(function ($, loadImage) {
|
|
45
|
+
'use strict';
|
|
46
|
+
|
|
47
|
+
// Prepend to the default processQueue:
|
|
48
|
+
$.blueimp.fileupload.prototype.options.processQueue.unshift(
|
|
49
|
+
{
|
|
50
|
+
action: 'loadImageMetaData',
|
|
51
|
+
disableImageHead: '@',
|
|
52
|
+
disableExif: '@',
|
|
53
|
+
disableExifThumbnail: '@',
|
|
54
|
+
disableExifSub: '@',
|
|
55
|
+
disableExifGps: '@',
|
|
56
|
+
disabled: '@disableImageMetaDataLoad'
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
action: 'loadImage',
|
|
60
|
+
// Use the action as prefix for the "@" options:
|
|
61
|
+
prefix: true,
|
|
62
|
+
fileTypes: '@',
|
|
63
|
+
maxFileSize: '@',
|
|
64
|
+
noRevoke: '@',
|
|
65
|
+
disabled: '@disableImageLoad'
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
action: 'resizeImage',
|
|
69
|
+
// Use "image" as prefix for the "@" options:
|
|
70
|
+
prefix: 'image',
|
|
71
|
+
maxWidth: '@',
|
|
72
|
+
maxHeight: '@',
|
|
73
|
+
minWidth: '@',
|
|
74
|
+
minHeight: '@',
|
|
75
|
+
crop: '@',
|
|
76
|
+
orientation: '@',
|
|
77
|
+
forceResize: '@',
|
|
78
|
+
disabled: '@disableImageResize'
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
action: 'saveImage',
|
|
82
|
+
quality: '@imageQuality',
|
|
83
|
+
type: '@imageType',
|
|
84
|
+
disabled: '@disableImageResize'
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
action: 'saveImageMetaData',
|
|
88
|
+
disabled: '@disableImageMetaDataSave'
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
action: 'resizeImage',
|
|
92
|
+
// Use "preview" as prefix for the "@" options:
|
|
93
|
+
prefix: 'preview',
|
|
94
|
+
maxWidth: '@',
|
|
95
|
+
maxHeight: '@',
|
|
96
|
+
minWidth: '@',
|
|
97
|
+
minHeight: '@',
|
|
98
|
+
crop: '@',
|
|
99
|
+
orientation: '@',
|
|
100
|
+
thumbnail: '@',
|
|
101
|
+
canvas: '@',
|
|
102
|
+
disabled: '@disableImagePreview'
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
action: 'setImage',
|
|
106
|
+
name: '@imagePreviewName',
|
|
107
|
+
disabled: '@disableImagePreview'
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
action: 'deleteImageReferences',
|
|
111
|
+
disabled: '@disableImageReferencesDeletion'
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
|
|
115
|
+
// The File Upload Resize plugin extends the fileupload widget
|
|
116
|
+
// with image resize functionality:
|
|
117
|
+
$.widget('blueimp.fileupload', $.blueimp.fileupload, {
|
|
118
|
+
|
|
119
|
+
options: {
|
|
120
|
+
// The regular expression for the types of images to load:
|
|
121
|
+
// matched against the file type:
|
|
122
|
+
loadImageFileTypes: /^image\/(gif|jpeg|png|svg\+xml)$/,
|
|
123
|
+
// The maximum file size of images to load:
|
|
124
|
+
loadImageMaxFileSize: 10000000, // 10MB
|
|
125
|
+
// The maximum width of resized images:
|
|
126
|
+
imageMaxWidth: 1920,
|
|
127
|
+
// The maximum height of resized images:
|
|
128
|
+
imageMaxHeight: 1080,
|
|
129
|
+
// Defines the image orientation (1-8) or takes the orientation
|
|
130
|
+
// value from Exif data if set to true:
|
|
131
|
+
imageOrientation: false,
|
|
132
|
+
// Define if resized images should be cropped or only scaled:
|
|
133
|
+
imageCrop: false,
|
|
134
|
+
// Disable the resize image functionality by default:
|
|
135
|
+
disableImageResize: true,
|
|
136
|
+
// The maximum width of the preview images:
|
|
137
|
+
previewMaxWidth: 80,
|
|
138
|
+
// The maximum height of the preview images:
|
|
139
|
+
previewMaxHeight: 80,
|
|
140
|
+
// Defines the preview orientation (1-8) or takes the orientation
|
|
141
|
+
// value from Exif data if set to true:
|
|
142
|
+
previewOrientation: true,
|
|
143
|
+
// Create the preview using the Exif data thumbnail:
|
|
144
|
+
previewThumbnail: true,
|
|
145
|
+
// Define if preview images should be cropped or only scaled:
|
|
146
|
+
previewCrop: false,
|
|
147
|
+
// Define if preview images should be resized as canvas elements:
|
|
148
|
+
previewCanvas: true
|
|
149
|
+
},
|
|
150
|
+
|
|
151
|
+
processActions: {
|
|
152
|
+
|
|
153
|
+
// Loads the image given via data.files and data.index
|
|
154
|
+
// as img element, if the browser supports the File API.
|
|
155
|
+
// Accepts the options fileTypes (regular expression)
|
|
156
|
+
// and maxFileSize (integer) to limit the files to load:
|
|
157
|
+
loadImage: function (data, options) {
|
|
158
|
+
if (options.disabled) {
|
|
159
|
+
return data;
|
|
160
|
+
}
|
|
161
|
+
var that = this,
|
|
162
|
+
file = data.files[data.index],
|
|
163
|
+
dfd = $.Deferred();
|
|
164
|
+
if (($.type(options.maxFileSize) === 'number' &&
|
|
165
|
+
file.size > options.maxFileSize) ||
|
|
166
|
+
(options.fileTypes &&
|
|
167
|
+
!options.fileTypes.test(file.type)) ||
|
|
168
|
+
!loadImage(
|
|
169
|
+
file,
|
|
170
|
+
function (img) {
|
|
171
|
+
if (img.src) {
|
|
172
|
+
data.img = img;
|
|
173
|
+
}
|
|
174
|
+
dfd.resolveWith(that, [data]);
|
|
175
|
+
},
|
|
176
|
+
options
|
|
177
|
+
)) {
|
|
178
|
+
return data;
|
|
179
|
+
}
|
|
180
|
+
return dfd.promise();
|
|
181
|
+
},
|
|
182
|
+
|
|
183
|
+
// Resizes the image given as data.canvas or data.img
|
|
184
|
+
// and updates data.canvas or data.img with the resized image.
|
|
185
|
+
// Also stores the resized image as preview property.
|
|
186
|
+
// Accepts the options maxWidth, maxHeight, minWidth,
|
|
187
|
+
// minHeight, canvas and crop:
|
|
188
|
+
resizeImage: function (data, options) {
|
|
189
|
+
if (options.disabled || !(data.canvas || data.img)) {
|
|
190
|
+
return data;
|
|
191
|
+
}
|
|
192
|
+
options = $.extend({canvas: true}, options);
|
|
193
|
+
var that = this,
|
|
194
|
+
dfd = $.Deferred(),
|
|
195
|
+
img = (options.canvas && data.canvas) || data.img,
|
|
196
|
+
resolve = function (newImg) {
|
|
197
|
+
if (newImg && (newImg.width !== img.width ||
|
|
198
|
+
newImg.height !== img.height ||
|
|
199
|
+
options.forceResize)) {
|
|
200
|
+
data[newImg.getContext ? 'canvas' : 'img'] = newImg;
|
|
201
|
+
}
|
|
202
|
+
data.preview = newImg;
|
|
203
|
+
dfd.resolveWith(that, [data]);
|
|
204
|
+
},
|
|
205
|
+
thumbnail;
|
|
206
|
+
if (data.exif) {
|
|
207
|
+
if (options.orientation === true) {
|
|
208
|
+
options.orientation = data.exif.get('Orientation');
|
|
209
|
+
}
|
|
210
|
+
if (options.thumbnail) {
|
|
211
|
+
thumbnail = data.exif.get('Thumbnail');
|
|
212
|
+
if (thumbnail) {
|
|
213
|
+
loadImage(thumbnail, resolve, options);
|
|
214
|
+
return dfd.promise();
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
// Prevent orienting the same image twice:
|
|
218
|
+
if (data.orientation) {
|
|
219
|
+
delete options.orientation;
|
|
220
|
+
} else {
|
|
221
|
+
data.orientation = options.orientation;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
if (img) {
|
|
225
|
+
resolve(loadImage.scale(img, options));
|
|
226
|
+
return dfd.promise();
|
|
227
|
+
}
|
|
228
|
+
return data;
|
|
229
|
+
},
|
|
230
|
+
|
|
231
|
+
// Saves the processed image given as data.canvas
|
|
232
|
+
// inplace at data.index of data.files:
|
|
233
|
+
saveImage: function (data, options) {
|
|
234
|
+
if (!data.canvas || options.disabled) {
|
|
235
|
+
return data;
|
|
236
|
+
}
|
|
237
|
+
var that = this,
|
|
238
|
+
file = data.files[data.index],
|
|
239
|
+
dfd = $.Deferred();
|
|
240
|
+
if (data.canvas.toBlob) {
|
|
241
|
+
data.canvas.toBlob(
|
|
242
|
+
function (blob) {
|
|
243
|
+
if (!blob.name) {
|
|
244
|
+
if (file.type === blob.type) {
|
|
245
|
+
blob.name = file.name;
|
|
246
|
+
} else if (file.name) {
|
|
247
|
+
blob.name = file.name.replace(
|
|
248
|
+
/\.\w+$/,
|
|
249
|
+
'.' + blob.type.substr(6)
|
|
250
|
+
);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
// Don't restore invalid meta data:
|
|
254
|
+
if (file.type !== blob.type) {
|
|
255
|
+
delete data.imageHead;
|
|
256
|
+
}
|
|
257
|
+
// Store the created blob at the position
|
|
258
|
+
// of the original file in the files list:
|
|
259
|
+
data.files[data.index] = blob;
|
|
260
|
+
dfd.resolveWith(that, [data]);
|
|
261
|
+
},
|
|
262
|
+
options.type || file.type,
|
|
263
|
+
options.quality
|
|
264
|
+
);
|
|
265
|
+
} else {
|
|
266
|
+
return data;
|
|
267
|
+
}
|
|
268
|
+
return dfd.promise();
|
|
269
|
+
},
|
|
270
|
+
|
|
271
|
+
loadImageMetaData: function (data, options) {
|
|
272
|
+
if (options.disabled) {
|
|
273
|
+
return data;
|
|
274
|
+
}
|
|
275
|
+
var that = this,
|
|
276
|
+
dfd = $.Deferred();
|
|
277
|
+
loadImage.parseMetaData(data.files[data.index], function (result) {
|
|
278
|
+
$.extend(data, result);
|
|
279
|
+
dfd.resolveWith(that, [data]);
|
|
280
|
+
}, options);
|
|
281
|
+
return dfd.promise();
|
|
282
|
+
},
|
|
283
|
+
|
|
284
|
+
saveImageMetaData: function (data, options) {
|
|
285
|
+
if (!(data.imageHead && data.canvas &&
|
|
286
|
+
data.canvas.toBlob && !options.disabled)) {
|
|
287
|
+
return data;
|
|
288
|
+
}
|
|
289
|
+
var file = data.files[data.index],
|
|
290
|
+
blob = new Blob([
|
|
291
|
+
data.imageHead,
|
|
292
|
+
// Resized images always have a head size of 20 bytes,
|
|
293
|
+
// including the JPEG marker and a minimal JFIF header:
|
|
294
|
+
this._blobSlice.call(file, 20)
|
|
295
|
+
], {type: file.type});
|
|
296
|
+
blob.name = file.name;
|
|
297
|
+
data.files[data.index] = blob;
|
|
298
|
+
return data;
|
|
299
|
+
},
|
|
300
|
+
|
|
301
|
+
// Sets the resized version of the image as a property of the
|
|
302
|
+
// file object, must be called after "saveImage":
|
|
303
|
+
setImage: function (data, options) {
|
|
304
|
+
if (data.preview && !options.disabled) {
|
|
305
|
+
data.files[data.index][options.name || 'preview'] = data.preview;
|
|
306
|
+
}
|
|
307
|
+
return data;
|
|
308
|
+
},
|
|
309
|
+
|
|
310
|
+
deleteImageReferences: function (data, options) {
|
|
311
|
+
if (!options.disabled) {
|
|
312
|
+
delete data.img;
|
|
313
|
+
delete data.canvas;
|
|
314
|
+
delete data.preview;
|
|
315
|
+
delete data.imageHead;
|
|
316
|
+
}
|
|
317
|
+
return data;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
});
|
|
323
|
+
|
|
324
|
+
}));
|