gluttonberg-core 2.5.4 → 2.5.5
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/images/{arrow.png → gb_arrow.png} +0 -0
- data/app/assets/images/{bg.png → gb_bg.png} +0 -0
- data/app/assets/images/{button_bkg_grey.gif → gb_button_bkg_grey.gif} +0 -0
- data/app/assets/images/{drag_handle.png → gb_drag_handle.png} +0 -0
- data/app/assets/images/{icon_add.png → gb_icon_add.png} +0 -0
- data/app/assets/images/{icon_asset.png → gb_icon_asset.png} +0 -0
- data/app/assets/images/{icon_blog.png → gb_icon_blog.png} +0 -0
- data/app/assets/images/{icon_collection.png → gb_icon_collection.png} +0 -0
- data/app/assets/images/{icon_content.png → gb_icon_content.png} +0 -0
- data/app/assets/images/{icon_content_2.png → gb_icon_content_2.png} +0 -0
- data/app/assets/images/{icon_dash.png → gb_icon_dash.png} +0 -0
- data/app/assets/images/{icon_dashboard.png → gb_icon_dashboard.png} +0 -0
- data/app/assets/images/{icon_default.png → gb_icon_default.png} +0 -0
- data/app/assets/images/{icon_group.png → gb_icon_group.png} +0 -0
- data/app/assets/images/{icon_library.png → gb_icon_library.png} +0 -0
- data/app/assets/images/{icon_library_2.png → gb_icon_library_2.png} +0 -0
- data/app/assets/images/{icon_member.png → gb_icon_member.png} +0 -0
- data/app/assets/images/{icon_members.png → gb_icon_members.png} +0 -0
- data/app/assets/images/{icon_pages.png → gb_icon_pages.png} +0 -0
- data/app/assets/images/{icon_settings.png → gb_icon_settings.png} +0 -0
- data/app/assets/images/{icon_upload.png → gb_icon_upload.png} +0 -0
- data/app/assets/images/{page_content_fillin.gif → gb_page_content_fillin.gif} +0 -0
- data/app/assets/images/{paginator.gif → gb_paginator.gif} +0 -0
- data/app/assets/images/{row_divider.jpg → gb_row_divider.jpg} +0 -0
- data/app/assets/images/{spinner.gif → gb_spinner.gif} +0 -0
- data/app/assets/images/{spinner_for_dialouge.gif → gb_spinner_for_dialouge.gif} +0 -0
- data/app/assets/images/{sub_nav_back_bkg.gif → gb_sub_nav_back_bkg.gif} +0 -0
- data/app/assets/images/{subnav_bkg.gif → gb_subnav_bkg.gif} +0 -0
- data/app/assets/images/{table_head_bkg.gif → gb_table_head_bkg.gif} +0 -0
- data/app/assets/images/{wrapper_bkg.png → gb_wrapper_bkg.png} +0 -0
- data/app/assets/images/help/{help.jpg → gb_help.jpg} +0 -0
- data/app/assets/images/icons/{collapsed.png → gb_collapsed.png} +0 -0
- data/app/assets/images/icons/{expanded.png → gb_expanded.png} +0 -0
- data/app/assets/images/library/{back.gif → gb_back.gif} +0 -0
- data/app/assets/images/library/{dialog_overlay.png → gb_dialog_overlay.png} +0 -0
- data/app/assets/images/library/{inactive_tab.jpg → gb_inactive_tab.jpg} +0 -0
- data/app/assets/images/library/{search_icon.gif → gb_search_icon.gif} +0 -0
- data/app/assets/images/library/{sort_by_asc.png → gb_sort_by_asc.png} +0 -0
- data/app/assets/images/library/{sort_by_desc.png → gb_sort_by_desc.png} +0 -0
- data/app/assets/javascripts/{ajaxfileupload.js → gb_ajaxfileupload.js} +0 -0
- data/app/assets/javascripts/gb_application.js +30 -30
- data/app/assets/javascripts/{bootstrap-datepicker.js → gb_bootstrap-datepicker.js} +0 -0
- data/app/assets/javascripts/{bootstrap.js → gb_bootstrap.js} +0 -0
- data/app/assets/javascripts/{expander.js → gb_expander.js} +0 -0
- data/app/assets/javascripts/{jeditable.js → gb_jeditable.js} +0 -0
- data/app/assets/javascripts/{jquery-dragTree.js → gb_jquery-dragTree.js} +0 -0
- data/app/assets/javascripts/{jquery-tagarea.js → gb_jquery-tagarea.js} +0 -0
- data/app/assets/javascripts/jcrop/css/{Jcrop.gif → gb_Jcrop.gif} +0 -0
- data/app/assets/javascripts/jcrop/css/{jquery-Jcrop.css → gb_jquery-Jcrop.css} +1 -1
- data/app/assets/stylesheets/{admin-ie6.sass → gb_admin-ie6.sass} +0 -0
- data/app/assets/stylesheets/{admin-ie7.sass → gb_admin-ie7.sass} +1 -1
- data/app/assets/stylesheets/{admin-override.sass → gb_admin-override.sass} +22 -22
- data/app/assets/stylesheets/{bootstrap-responsive.css → gb_bootstrap-responsive.css} +0 -0
- data/app/assets/stylesheets/{bootstrap.css → gb_bootstrap.css} +0 -0
- data/app/views/gluttonberg/admin/asset_library/assets/_browser_root.html.haml +1 -1
- data/app/views/gluttonberg/admin/content/galleries/_images_list.html.haml +1 -1
- data/app/views/gluttonberg/admin/settings/generic_settings/index.html.haml +2 -2
- data/app/views/gluttonberg/admin/shared/delete.html.haml +8 -8
- data/app/views/gluttonberg/public/members/_form.html.haml +17 -18
- data/app/views/gluttonberg/public/members/edit.html.haml +18 -18
- data/app/views/gluttonberg/public/members/show.html.haml +8 -8
- data/app/views/gluttonberg/public/pages/restrict_site_access.html.haml +12 -12
- data/app/views/layouts/bare.html.haml +5 -5
- data/app/views/layouts/gluttonberg.html.haml +4 -4
- data/lib/generators/gluttonberg/resource/templates/backend_view_index.html.haml +2 -0
- data/lib/gluttonberg/version.rb +1 -1
- metadata +55 -288
- data/app/assets/images/content/blogs.png +0 -0
- data/app/assets/images/content/pages.png +0 -0
- data/app/assets/images/form/field_bg.jpg +0 -0
- data/app/assets/images/form/field_bg_active.jpg +0 -0
- data/app/assets/images/form/input_bkg.gif +0 -0
- data/app/assets/images/form/input_bkg.jpg +0 -0
- data/app/assets/images/form/login_bg.png +0 -0
- data/app/assets/images/form/login_form_bg.jpg +0 -0
- data/app/assets/images/form/plus_and_minus.gif +0 -0
- data/app/assets/images/form/warning.gif +0 -0
- data/app/assets/images/icons/cross.png +0 -0
- data/app/assets/images/icons/folder.png +0 -0
- data/app/assets/images/icons/symbol-add.png +0 -0
- data/app/assets/images/library/all.png +0 -0
- data/app/assets/images/library/audio.png +0 -0
- data/app/assets/images/library/icon_document.jpg +0 -0
- data/app/assets/images/library/image.png +0 -0
- data/app/assets/images/library/other.png +0 -0
- data/app/assets/images/library/video.png +0 -0
- data/app/assets/images/settings/config.png +0 -0
- data/app/assets/images/settings/locale.jpg +0 -0
- data/app/assets/images/settings/stylesheet.gif +0 -0
- data/app/assets/images/settings/users.png +0 -0
- data/app/assets/images/sidebar/icon_content.png +0 -0
- data/app/assets/images/sidebar/icon_dashboard.png +0 -0
- data/app/assets/images/sidebar/icon_feedback.png +0 -0
- data/app/assets/images/sidebar/icon_library.png +0 -0
- data/app/assets/images/sidebar/icon_settings.png +0 -0
- data/app/assets/images/sidebar/menu_active.jpg +0 -0
- data/app/assets/images/sidebar/menu_expanded_bg.jpg +0 -0
- data/app/assets/images/sidebar/menu_off.jpg +0 -0
- data/app/assets/images/sidebar/menu_over.jpg +0 -0
- data/app/assets/images/sidebar/nav_closed.png +0 -0
- data/app/assets/images/sidebar/nav_open.png +0 -0
- data/app/assets/javascripts/bootstrap.min.js +0 -1
- data/app/assets/javascripts/jcrop/MIT-LICENSE.txt +0 -22
- data/app/assets/javascripts/jcrop/build/LICENSE +0 -7
- data/app/assets/javascripts/jcrop/build/README +0 -11
- data/app/assets/javascripts/jcrop/build/minimize.bash +0 -10
- data/app/assets/javascripts/jcrop/build/pre-commit.bash +0 -11
- data/app/assets/javascripts/jcrop/demos/crop.php +0 -106
- data/app/assets/javascripts/jcrop/demos/demo_files/demos.css +0 -36
- data/app/assets/javascripts/jcrop/demos/demo_files/flowers.jpg +0 -0
- data/app/assets/javascripts/jcrop/demos/demo_files/sago.jpg +0 -0
- data/app/assets/javascripts/jcrop/demos/demo_files/sagomod.jpg +0 -0
- data/app/assets/javascripts/jcrop/demos/demo_files/sagomod.png +0 -0
- data/app/assets/javascripts/jcrop/demos/tutorial1.html +0 -47
- data/app/assets/javascripts/jcrop/demos/tutorial2.html +0 -94
- data/app/assets/javascripts/jcrop/demos/tutorial3.html +0 -94
- data/app/assets/javascripts/jcrop/demos/tutorial4.html +0 -154
- data/app/assets/javascripts/jcrop/demos/tutorial5.html +0 -240
- data/app/assets/javascripts/jcrop/index.html +0 -63
- data/app/assets/javascripts/jcrop/js/jquery.Jcrop.js +0 -1605
- data/app/assets/javascripts/jcrop/js/jquery.color.js +0 -123
- data/app/assets/javascripts/jcrop/js/jquery.min.js +0 -18
- data/app/assets/javascripts/jquery-1-4-2-min.js +0 -154
- data/app/assets/javascripts/jquery-ui-1-8-1-custom-min.js +0 -756
- data/app/assets/javascripts/jquery-ui-1-8-18-custom-min.js +0 -356
- data/app/assets/javascripts/jquery-ui-1-8-18-custom2-min.js +0 -266
- data/app/assets/javascripts/jquery-ui-datetimepicker-min.js +0 -1060
- data/app/assets/javascripts/tiny_mce/license.txt +0 -504
- data/app/assets/javascripts/tiny_mce/plugins/advhr/editor_plugin_src.js +0 -57
- data/app/assets/javascripts/tiny_mce/plugins/advimage/css/advimage.css +0 -13
- data/app/assets/javascripts/tiny_mce/plugins/advimage/editor_plugin.js +0 -1
- data/app/assets/javascripts/tiny_mce/plugins/advimage/editor_plugin_src.js +0 -50
- data/app/assets/javascripts/tiny_mce/plugins/advimage/image.htm +0 -235
- data/app/assets/javascripts/tiny_mce/plugins/advimage/img/sample.gif +0 -0
- data/app/assets/javascripts/tiny_mce/plugins/advimage/js/image.js +0 -458
- data/app/assets/javascripts/tiny_mce/plugins/advimage/langs/en_dlg.js +0 -45
- data/app/assets/javascripts/tiny_mce/plugins/advlink/editor_plugin_src.js +0 -61
- data/app/assets/javascripts/tiny_mce/plugins/advlist/editor_plugin_src.js +0 -161
- data/app/assets/javascripts/tiny_mce/plugins/autolink/editor_plugin_src.js +0 -172
- data/app/assets/javascripts/tiny_mce/plugins/autoresize/editor_plugin.js +0 -1
- data/app/assets/javascripts/tiny_mce/plugins/autoresize/editor_plugin_src.js +0 -137
- data/app/assets/javascripts/tiny_mce/plugins/autosave/editor_plugin.js +0 -1
- data/app/assets/javascripts/tiny_mce/plugins/autosave/editor_plugin_src.js +0 -431
- data/app/assets/javascripts/tiny_mce/plugins/autosave/langs/en.js +0 -4
- data/app/assets/javascripts/tiny_mce/plugins/bbcode/editor_plugin.js +0 -1
- data/app/assets/javascripts/tiny_mce/plugins/bbcode/editor_plugin_src.js +0 -120
- data/app/assets/javascripts/tiny_mce/plugins/contextmenu/editor_plugin.js +0 -1
- data/app/assets/javascripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js +0 -160
- data/app/assets/javascripts/tiny_mce/plugins/directionality/editor_plugin.js +0 -1
- data/app/assets/javascripts/tiny_mce/plugins/directionality/editor_plugin_src.js +0 -82
- data/app/assets/javascripts/tiny_mce/plugins/emotions/editor_plugin.js +0 -1
- data/app/assets/javascripts/tiny_mce/plugins/emotions/editor_plugin_src.js +0 -43
- data/app/assets/javascripts/tiny_mce/plugins/emotions/emotions.htm +0 -41
- data/app/assets/javascripts/tiny_mce/plugins/emotions/img/smiley-cool.gif +0 -0
- data/app/assets/javascripts/tiny_mce/plugins/emotions/img/smiley-cry.gif +0 -0
- data/app/assets/javascripts/tiny_mce/plugins/emotions/img/smiley-embarassed.gif +0 -0
- data/app/assets/javascripts/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif +0 -0
- data/app/assets/javascripts/tiny_mce/plugins/emotions/img/smiley-frown.gif +0 -0
- data/app/assets/javascripts/tiny_mce/plugins/emotions/img/smiley-innocent.gif +0 -0
- data/app/assets/javascripts/tiny_mce/plugins/emotions/img/smiley-kiss.gif +0 -0
- data/app/assets/javascripts/tiny_mce/plugins/emotions/img/smiley-laughing.gif +0 -0
- data/app/assets/javascripts/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif +0 -0
- data/app/assets/javascripts/tiny_mce/plugins/emotions/img/smiley-sealed.gif +0 -0
- data/app/assets/javascripts/tiny_mce/plugins/emotions/img/smiley-smile.gif +0 -0
- data/app/assets/javascripts/tiny_mce/plugins/emotions/img/smiley-surprised.gif +0 -0
- data/app/assets/javascripts/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif +0 -0
- data/app/assets/javascripts/tiny_mce/plugins/emotions/img/smiley-undecided.gif +0 -0
- data/app/assets/javascripts/tiny_mce/plugins/emotions/img/smiley-wink.gif +0 -0
- data/app/assets/javascripts/tiny_mce/plugins/emotions/img/smiley-yell.gif +0 -0
- data/app/assets/javascripts/tiny_mce/plugins/emotions/js/emotions.js +0 -22
- data/app/assets/javascripts/tiny_mce/plugins/emotions/langs/en_dlg.js +0 -20
- data/app/assets/javascripts/tiny_mce/plugins/example/dialog.htm +0 -22
- data/app/assets/javascripts/tiny_mce/plugins/example/editor_plugin.js +0 -1
- data/app/assets/javascripts/tiny_mce/plugins/example/editor_plugin_src.js +0 -84
- data/app/assets/javascripts/tiny_mce/plugins/example/img/example.gif +0 -0
- data/app/assets/javascripts/tiny_mce/plugins/example/js/dialog.js +0 -19
- data/app/assets/javascripts/tiny_mce/plugins/example/langs/en.js +0 -3
- data/app/assets/javascripts/tiny_mce/plugins/example/langs/en_dlg.js +0 -3
- data/app/assets/javascripts/tiny_mce/plugins/example_dependency/editor_plugin.js +0 -1
- data/app/assets/javascripts/tiny_mce/plugins/example_dependency/editor_plugin_src.js +0 -50
- data/app/assets/javascripts/tiny_mce/plugins/fullpage/css/fullpage.css +0 -143
- data/app/assets/javascripts/tiny_mce/plugins/fullpage/editor_plugin.js +0 -1
- data/app/assets/javascripts/tiny_mce/plugins/fullpage/editor_plugin_src.js +0 -399
- data/app/assets/javascripts/tiny_mce/plugins/fullpage/fullpage.htm +0 -259
- data/app/assets/javascripts/tiny_mce/plugins/fullpage/js/fullpage.js +0 -232
- data/app/assets/javascripts/tiny_mce/plugins/fullpage/langs/en_dlg.js +0 -85
- data/app/assets/javascripts/tiny_mce/plugins/fullscreen/editor_plugin_src.js +0 -159
- data/app/assets/javascripts/tiny_mce/plugins/iespell/editor_plugin.js +0 -1
- data/app/assets/javascripts/tiny_mce/plugins/iespell/editor_plugin_src.js +0 -54
- data/app/assets/javascripts/tiny_mce/plugins/inlinepopups/editor_plugin_src.js +0 -696
- data/app/assets/javascripts/tiny_mce/plugins/insertdatetime/editor_plugin_src.js +0 -83
- data/app/assets/javascripts/tiny_mce/plugins/layer/editor_plugin.js +0 -1
- data/app/assets/javascripts/tiny_mce/plugins/layer/editor_plugin_src.js +0 -214
- data/app/assets/javascripts/tiny_mce/plugins/legacyoutput/editor_plugin.js +0 -1
- data/app/assets/javascripts/tiny_mce/plugins/legacyoutput/editor_plugin_src.js +0 -139
- data/app/assets/javascripts/tiny_mce/plugins/lists/editor_plugin_src.js +0 -688
- data/app/assets/javascripts/tiny_mce/plugins/media/css/media.css +0 -17
- data/app/assets/javascripts/tiny_mce/plugins/media/editor_plugin.js +0 -1
- data/app/assets/javascripts/tiny_mce/plugins/media/editor_plugin_src.js +0 -777
- data/app/assets/javascripts/tiny_mce/plugins/media/js/embed.js +0 -73
- data/app/assets/javascripts/tiny_mce/plugins/media/js/media.js +0 -355
- data/app/assets/javascripts/tiny_mce/plugins/media/langs/en_dlg.js +0 -109
- data/app/assets/javascripts/tiny_mce/plugins/media/media.htm +0 -812
- data/app/assets/javascripts/tiny_mce/plugins/media/moxieplayer.swf +0 -0
- data/app/assets/javascripts/tiny_mce/plugins/nonbreaking/editor_plugin.js +0 -1
- data/app/assets/javascripts/tiny_mce/plugins/nonbreaking/editor_plugin_src.js +0 -53
- data/app/assets/javascripts/tiny_mce/plugins/noneditable/editor_plugin.js +0 -1
- data/app/assets/javascripts/tiny_mce/plugins/noneditable/editor_plugin_src.js +0 -92
- data/app/assets/javascripts/tiny_mce/plugins/pagebreak/editor_plugin.js +0 -1
- data/app/assets/javascripts/tiny_mce/plugins/pagebreak/editor_plugin_src.js +0 -74
- data/app/assets/javascripts/tiny_mce/plugins/paste/editor_plugin_src.js +0 -941
- data/app/assets/javascripts/tiny_mce/plugins/preview/editor_plugin_src.js +0 -53
- data/app/assets/javascripts/tiny_mce/plugins/preview/example.html +0 -28
- data/app/assets/javascripts/tiny_mce/plugins/print/editor_plugin.js +0 -1
- data/app/assets/javascripts/tiny_mce/plugins/print/editor_plugin_src.js +0 -34
- data/app/assets/javascripts/tiny_mce/plugins/save/editor_plugin.js +0 -1
- data/app/assets/javascripts/tiny_mce/plugins/save/editor_plugin_src.js +0 -101
- data/app/assets/javascripts/tiny_mce/plugins/searchreplace/css/searchreplace.css +0 -6
- data/app/assets/javascripts/tiny_mce/plugins/searchreplace/editor_plugin.js +0 -1
- data/app/assets/javascripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js +0 -61
- data/app/assets/javascripts/tiny_mce/plugins/searchreplace/js/searchreplace.js +0 -142
- data/app/assets/javascripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js +0 -16
- data/app/assets/javascripts/tiny_mce/plugins/searchreplace/searchreplace.htm +0 -100
- data/app/assets/javascripts/tiny_mce/plugins/spellchecker/css/content.css +0 -1
- data/app/assets/javascripts/tiny_mce/plugins/spellchecker/editor_plugin.js +0 -1
- data/app/assets/javascripts/tiny_mce/plugins/spellchecker/editor_plugin_src.js +0 -434
- data/app/assets/javascripts/tiny_mce/plugins/spellchecker/img/wline.gif +0 -0
- data/app/assets/javascripts/tiny_mce/plugins/style/editor_plugin_src.js +0 -55
- data/app/assets/javascripts/tiny_mce/plugins/tabfocus/editor_plugin.js +0 -1
- data/app/assets/javascripts/tiny_mce/plugins/tabfocus/editor_plugin_src.js +0 -114
- data/app/assets/javascripts/tiny_mce/plugins/table/editor_plugin_src.js +0 -1209
- data/app/assets/javascripts/tiny_mce/plugins/template/blank.htm +0 -12
- data/app/assets/javascripts/tiny_mce/plugins/template/css/template.css +0 -23
- data/app/assets/javascripts/tiny_mce/plugins/template/editor_plugin.js +0 -1
- data/app/assets/javascripts/tiny_mce/plugins/template/editor_plugin_src.js +0 -159
- data/app/assets/javascripts/tiny_mce/plugins/template/js/template.js +0 -106
- data/app/assets/javascripts/tiny_mce/plugins/template/langs/en_dlg.js +0 -15
- data/app/assets/javascripts/tiny_mce/plugins/template/template.htm +0 -31
- data/app/assets/javascripts/tiny_mce/plugins/visualchars/editor_plugin.js +0 -1
- data/app/assets/javascripts/tiny_mce/plugins/visualchars/editor_plugin_src.js +0 -83
- data/app/assets/javascripts/tiny_mce/plugins/wordcount/editor_plugin_src.js +0 -114
- data/app/assets/javascripts/tiny_mce/plugins/xhtmlxtras/abbr.htm +0 -142
- data/app/assets/javascripts/tiny_mce/plugins/xhtmlxtras/acronym.htm +0 -142
- data/app/assets/javascripts/tiny_mce/plugins/xhtmlxtras/attributes.htm +0 -149
- data/app/assets/javascripts/tiny_mce/plugins/xhtmlxtras/cite.htm +0 -142
- data/app/assets/javascripts/tiny_mce/plugins/xhtmlxtras/css/attributes.css +0 -11
- data/app/assets/javascripts/tiny_mce/plugins/xhtmlxtras/css/popup.css +0 -9
- data/app/assets/javascripts/tiny_mce/plugins/xhtmlxtras/del.htm +0 -162
- data/app/assets/javascripts/tiny_mce/plugins/xhtmlxtras/editor_plugin.js +0 -1
- data/app/assets/javascripts/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js +0 -132
- data/app/assets/javascripts/tiny_mce/plugins/xhtmlxtras/ins.htm +0 -162
- data/app/assets/javascripts/tiny_mce/plugins/xhtmlxtras/js/abbr.js +0 -28
- data/app/assets/javascripts/tiny_mce/plugins/xhtmlxtras/js/acronym.js +0 -28
- data/app/assets/javascripts/tiny_mce/plugins/xhtmlxtras/js/attributes.js +0 -111
- data/app/assets/javascripts/tiny_mce/plugins/xhtmlxtras/js/cite.js +0 -28
- data/app/assets/javascripts/tiny_mce/plugins/xhtmlxtras/js/del.js +0 -53
- data/app/assets/javascripts/tiny_mce/plugins/xhtmlxtras/js/element_common.js +0 -229
- data/app/assets/javascripts/tiny_mce/plugins/xhtmlxtras/js/ins.js +0 -53
- data/app/assets/javascripts/tiny_mce/plugins/xhtmlxtras/langs/en_dlg.js +0 -32
- data/app/assets/javascripts/tiny_mce/themes/advanced/about.htm +0 -52
- data/app/assets/javascripts/tiny_mce/themes/advanced/charmap.htm +0 -51
- data/app/assets/javascripts/tiny_mce/themes/advanced/color_picker.htm +0 -74
- data/app/assets/javascripts/tiny_mce/themes/advanced/image.htm +0 -80
- data/app/assets/javascripts/tiny_mce/themes/advanced/img/colorpicker.jpg +0 -0
- data/app/assets/javascripts/tiny_mce/themes/advanced/img/flash.gif +0 -0
- data/app/assets/javascripts/tiny_mce/themes/advanced/img/iframe.gif +0 -0
- data/app/assets/javascripts/tiny_mce/themes/advanced/img/pagebreak.gif +0 -0
- data/app/assets/javascripts/tiny_mce/themes/advanced/img/quicktime.gif +0 -0
- data/app/assets/javascripts/tiny_mce/themes/advanced/img/realmedia.gif +0 -0
- data/app/assets/javascripts/tiny_mce/themes/advanced/img/shockwave.gif +0 -0
- data/app/assets/javascripts/tiny_mce/themes/advanced/img/video.gif +0 -0
- data/app/assets/javascripts/tiny_mce/themes/advanced/img/windowsmedia.gif +0 -0
- data/app/assets/javascripts/tiny_mce/themes/advanced/js/about.js +0 -73
- data/app/assets/javascripts/tiny_mce/themes/advanced/js/charmap.js +0 -355
- data/app/assets/javascripts/tiny_mce/themes/advanced/js/color_picker.js +0 -329
- data/app/assets/javascripts/tiny_mce/themes/advanced/js/image.js +0 -247
- data/app/assets/javascripts/tiny_mce/themes/advanced/link.htm +0 -57
- data/app/assets/javascripts/tiny_mce/themes/advanced/shortcuts.htm +0 -47
- data/app/assets/javascripts/tiny_mce/themes/advanced/skins/highcontrast/content.css +0 -23
- data/app/assets/javascripts/tiny_mce/themes/advanced/skins/highcontrast/dialog.css +0 -105
- data/app/assets/javascripts/tiny_mce/themes/advanced/skins/highcontrast/ui.css +0 -102
- data/app/assets/javascripts/tiny_mce/themes/advanced/skins/o2k7/content.css +0 -46
- data/app/assets/javascripts/tiny_mce/themes/advanced/skins/o2k7/dialog.css +0 -117
- data/app/assets/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png +0 -0
- data/app/assets/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png +0 -0
- data/app/assets/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png +0 -0
- data/app/assets/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui.css +0 -217
- data/app/assets/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui_black.css +0 -8
- data/app/assets/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css +0 -5
- data/app/assets/javascripts/tiny_mce/themes/simple/editor_template.js +0 -1
- data/app/assets/javascripts/tiny_mce/themes/simple/editor_template_src.js +0 -84
- data/app/assets/javascripts/tiny_mce/themes/simple/img/icons.gif +0 -0
- data/app/assets/javascripts/tiny_mce/themes/simple/langs/en.js +0 -11
- data/app/assets/javascripts/tiny_mce/themes/simple/skins/default/content.css +0 -25
- data/app/assets/javascripts/tiny_mce/themes/simple/skins/default/ui.css +0 -32
- data/app/assets/javascripts/tiny_mce/themes/simple/skins/o2k7/content.css +0 -17
- data/app/assets/javascripts/tiny_mce/themes/simple/skins/o2k7/img/button_bg.png +0 -0
- data/app/assets/javascripts/tiny_mce/themes/simple/skins/o2k7/ui.css +0 -35
- data/app/assets/javascripts/tiny_mce/tiny_mce_src.js +0 -15216
- data/app/assets/stylesheets/admin.sass +0 -2919
@@ -1,1605 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* jquery.Jcrop.js v0.9.9
|
3
|
-
* jQuery Image Cropping Plugin
|
4
|
-
* @author Kelly Hallman <khallman@gmail.com>
|
5
|
-
* Copyright (c) 2008-2011 Kelly Hallman - released under MIT License {{{
|
6
|
-
*
|
7
|
-
* Permission is hereby granted, free of charge, to any person
|
8
|
-
* obtaining a copy of this software and associated documentation
|
9
|
-
* files (the "Software"), to deal in the Software without
|
10
|
-
* restriction, including without limitation the rights to use,
|
11
|
-
* copy, modify, merge, publish, distribute, sublicense, and/or sell
|
12
|
-
* copies of the Software, and to permit persons to whom the
|
13
|
-
* Software is furnished to do so, subject to the following
|
14
|
-
* conditions:
|
15
|
-
*
|
16
|
-
* The above copyright notice and this permission notice shall be
|
17
|
-
* included in all copies or substantial portions of the Software.
|
18
|
-
*
|
19
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
20
|
-
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
21
|
-
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
22
|
-
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
23
|
-
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
24
|
-
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
25
|
-
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
26
|
-
* OTHER DEALINGS IN THE SOFTWARE.
|
27
|
-
*
|
28
|
-
* }}}
|
29
|
-
*/
|
30
|
-
|
31
|
-
(function ($) {
|
32
|
-
|
33
|
-
$.Jcrop = function (obj, opt) {
|
34
|
-
var options = $.extend({}, $.Jcrop.defaults),
|
35
|
-
docOffset, lastcurs, ie6mode = false;
|
36
|
-
|
37
|
-
// Internal Methods {{{
|
38
|
-
function px(n) {
|
39
|
-
return parseInt(n, 10) + 'px';
|
40
|
-
}
|
41
|
-
function pct(n) {
|
42
|
-
return parseInt(n, 10) + '%';
|
43
|
-
}
|
44
|
-
function cssClass(cl) {
|
45
|
-
return options.baseClass + '-' + cl;
|
46
|
-
}
|
47
|
-
function supportsColorFade() {
|
48
|
-
return $.fx.step.hasOwnProperty('backgroundColor');
|
49
|
-
}
|
50
|
-
function getPos(obj) //{{{
|
51
|
-
{
|
52
|
-
// Updated in v0.9.4 to use built-in dimensions plugin
|
53
|
-
var pos = $(obj).offset();
|
54
|
-
return [pos.left, pos.top];
|
55
|
-
}
|
56
|
-
//}}}
|
57
|
-
function mouseAbs(e) //{{{
|
58
|
-
{
|
59
|
-
return [(e.pageX - docOffset[0]), (e.pageY - docOffset[1])];
|
60
|
-
}
|
61
|
-
//}}}
|
62
|
-
function setOptions(opt) //{{{
|
63
|
-
{
|
64
|
-
if (typeof(opt) !== 'object') {
|
65
|
-
opt = {};
|
66
|
-
}
|
67
|
-
options = $.extend(options, opt);
|
68
|
-
|
69
|
-
if (typeof(options.onChange) !== 'function') {
|
70
|
-
options.onChange = function () {};
|
71
|
-
}
|
72
|
-
if (typeof(options.onSelect) !== 'function') {
|
73
|
-
options.onSelect = function () {};
|
74
|
-
}
|
75
|
-
if (typeof(options.onRelease) !== 'function') {
|
76
|
-
options.onRelease = function () {};
|
77
|
-
}
|
78
|
-
}
|
79
|
-
//}}}
|
80
|
-
function myCursor(type) //{{{
|
81
|
-
{
|
82
|
-
if (type !== lastcurs) {
|
83
|
-
Tracker.setCursor(type);
|
84
|
-
lastcurs = type;
|
85
|
-
}
|
86
|
-
}
|
87
|
-
//}}}
|
88
|
-
function startDragMode(mode, pos) //{{{
|
89
|
-
{
|
90
|
-
docOffset = getPos($img);
|
91
|
-
Tracker.setCursor(mode === 'move' ? mode : mode + '-resize');
|
92
|
-
|
93
|
-
if (mode === 'move') {
|
94
|
-
return Tracker.activateHandlers(createMover(pos), doneSelect);
|
95
|
-
}
|
96
|
-
|
97
|
-
var fc = Coords.getFixed();
|
98
|
-
var opp = oppLockCorner(mode);
|
99
|
-
var opc = Coords.getCorner(oppLockCorner(opp));
|
100
|
-
|
101
|
-
Coords.setPressed(Coords.getCorner(opp));
|
102
|
-
Coords.setCurrent(opc);
|
103
|
-
|
104
|
-
Tracker.activateHandlers(dragmodeHandler(mode, fc), doneSelect);
|
105
|
-
}
|
106
|
-
//}}}
|
107
|
-
function dragmodeHandler(mode, f) //{{{
|
108
|
-
{
|
109
|
-
return function (pos) {
|
110
|
-
if (!options.aspectRatio) {
|
111
|
-
switch (mode) {
|
112
|
-
case 'e':
|
113
|
-
pos[1] = f.y2;
|
114
|
-
break;
|
115
|
-
case 'w':
|
116
|
-
pos[1] = f.y2;
|
117
|
-
break;
|
118
|
-
case 'n':
|
119
|
-
pos[0] = f.x2;
|
120
|
-
break;
|
121
|
-
case 's':
|
122
|
-
pos[0] = f.x2;
|
123
|
-
break;
|
124
|
-
}
|
125
|
-
} else {
|
126
|
-
switch (mode) {
|
127
|
-
case 'e':
|
128
|
-
pos[1] = f.y + 1;
|
129
|
-
break;
|
130
|
-
case 'w':
|
131
|
-
pos[1] = f.y + 1;
|
132
|
-
break;
|
133
|
-
case 'n':
|
134
|
-
pos[0] = f.x + 1;
|
135
|
-
break;
|
136
|
-
case 's':
|
137
|
-
pos[0] = f.x + 1;
|
138
|
-
break;
|
139
|
-
}
|
140
|
-
}
|
141
|
-
Coords.setCurrent(pos);
|
142
|
-
Selection.update();
|
143
|
-
};
|
144
|
-
}
|
145
|
-
//}}}
|
146
|
-
function createMover(pos) //{{{
|
147
|
-
{
|
148
|
-
var lloc = pos;
|
149
|
-
KeyManager.watchKeys();
|
150
|
-
|
151
|
-
return function (pos) {
|
152
|
-
Coords.moveOffset([pos[0] - lloc[0], pos[1] - lloc[1]]);
|
153
|
-
lloc = pos;
|
154
|
-
|
155
|
-
Selection.update();
|
156
|
-
};
|
157
|
-
}
|
158
|
-
//}}}
|
159
|
-
function oppLockCorner(ord) //{{{
|
160
|
-
{
|
161
|
-
switch (ord) {
|
162
|
-
case 'n':
|
163
|
-
return 'sw';
|
164
|
-
case 's':
|
165
|
-
return 'nw';
|
166
|
-
case 'e':
|
167
|
-
return 'nw';
|
168
|
-
case 'w':
|
169
|
-
return 'ne';
|
170
|
-
case 'ne':
|
171
|
-
return 'sw';
|
172
|
-
case 'nw':
|
173
|
-
return 'se';
|
174
|
-
case 'se':
|
175
|
-
return 'nw';
|
176
|
-
case 'sw':
|
177
|
-
return 'ne';
|
178
|
-
}
|
179
|
-
}
|
180
|
-
//}}}
|
181
|
-
function createDragger(ord) //{{{
|
182
|
-
{
|
183
|
-
return function (e) {
|
184
|
-
if (options.disabled) {
|
185
|
-
return false;
|
186
|
-
}
|
187
|
-
if ((ord === 'move') && !options.allowMove) {
|
188
|
-
return false;
|
189
|
-
}
|
190
|
-
btndown = true;
|
191
|
-
startDragMode(ord, mouseAbs(e));
|
192
|
-
e.stopPropagation();
|
193
|
-
e.preventDefault();
|
194
|
-
return false;
|
195
|
-
};
|
196
|
-
}
|
197
|
-
//}}}
|
198
|
-
function presize($obj, w, h) //{{{
|
199
|
-
{
|
200
|
-
var nw = $obj.width(),
|
201
|
-
nh = $obj.height();
|
202
|
-
if ((nw > w) && w > 0) {
|
203
|
-
nw = w;
|
204
|
-
nh = (w / $obj.width()) * $obj.height();
|
205
|
-
}
|
206
|
-
if ((nh > h) && h > 0) {
|
207
|
-
nh = h;
|
208
|
-
nw = (h / $obj.height()) * $obj.width();
|
209
|
-
}
|
210
|
-
xscale = $obj.width() / nw;
|
211
|
-
yscale = $obj.height() / nh;
|
212
|
-
$obj.width(nw).height(nh);
|
213
|
-
}
|
214
|
-
//}}}
|
215
|
-
function unscale(c) //{{{
|
216
|
-
{
|
217
|
-
return {
|
218
|
-
x: parseInt(c.x * xscale, 10),
|
219
|
-
y: parseInt(c.y * yscale, 10),
|
220
|
-
x2: parseInt(c.x2 * xscale, 10),
|
221
|
-
y2: parseInt(c.y2 * yscale, 10),
|
222
|
-
w: parseInt(c.w * xscale, 10),
|
223
|
-
h: parseInt(c.h * yscale, 10)
|
224
|
-
};
|
225
|
-
}
|
226
|
-
//}}}
|
227
|
-
function doneSelect(pos) //{{{
|
228
|
-
{
|
229
|
-
var c = Coords.getFixed();
|
230
|
-
if ((c.w > options.minSelect[0]) && (c.h > options.minSelect[1])) {
|
231
|
-
Selection.enableHandles();
|
232
|
-
Selection.done();
|
233
|
-
} else {
|
234
|
-
Selection.release();
|
235
|
-
}
|
236
|
-
Tracker.setCursor(options.allowSelect ? 'crosshair' : 'default');
|
237
|
-
}
|
238
|
-
//}}}
|
239
|
-
function newSelection(e) //{{{
|
240
|
-
{
|
241
|
-
if (options.disabled) {
|
242
|
-
return false;
|
243
|
-
}
|
244
|
-
if (!options.allowSelect) {
|
245
|
-
return false;
|
246
|
-
}
|
247
|
-
btndown = true;
|
248
|
-
docOffset = getPos($img);
|
249
|
-
Selection.disableHandles();
|
250
|
-
myCursor('crosshair');
|
251
|
-
var pos = mouseAbs(e);
|
252
|
-
Coords.setPressed(pos);
|
253
|
-
Selection.update();
|
254
|
-
Tracker.activateHandlers(selectDrag, doneSelect);
|
255
|
-
KeyManager.watchKeys();
|
256
|
-
|
257
|
-
e.stopPropagation();
|
258
|
-
e.preventDefault();
|
259
|
-
return false;
|
260
|
-
}
|
261
|
-
//}}}
|
262
|
-
function selectDrag(pos) //{{{
|
263
|
-
{
|
264
|
-
Coords.setCurrent(pos);
|
265
|
-
Selection.update();
|
266
|
-
}
|
267
|
-
//}}}
|
268
|
-
function newTracker() //{{{
|
269
|
-
{
|
270
|
-
var trk = $('<div></div>').addClass(cssClass('tracker'));
|
271
|
-
if ($.browser.msie) {
|
272
|
-
trk.css({
|
273
|
-
opacity: 0,
|
274
|
-
backgroundColor: 'white'
|
275
|
-
});
|
276
|
-
}
|
277
|
-
return trk;
|
278
|
-
}
|
279
|
-
//}}}
|
280
|
-
|
281
|
-
// }}}
|
282
|
-
// Initialization {{{
|
283
|
-
// Sanitize some options {{{
|
284
|
-
if ($.browser.msie && ($.browser.version.split('.')[0] === '6')) {
|
285
|
-
ie6mode = true;
|
286
|
-
}
|
287
|
-
if (typeof(obj) !== 'object') {
|
288
|
-
obj = $(obj)[0];
|
289
|
-
}
|
290
|
-
if (typeof(opt) !== 'object') {
|
291
|
-
opt = {};
|
292
|
-
}
|
293
|
-
// }}}
|
294
|
-
setOptions(opt);
|
295
|
-
// Initialize some jQuery objects {{{
|
296
|
-
// The values are SET on the image(s) for the interface
|
297
|
-
// If the original image has any of these set, they will be reset
|
298
|
-
// However, if you destroy() the Jcrop instance the original image's
|
299
|
-
// character in the DOM will be as you left it.
|
300
|
-
var img_css = {
|
301
|
-
border: 'none',
|
302
|
-
margin: 0,
|
303
|
-
padding: 0,
|
304
|
-
position: 'absolute'
|
305
|
-
};
|
306
|
-
|
307
|
-
var $origimg = $(obj);
|
308
|
-
var $img = $origimg.clone().removeAttr('id').css(img_css);
|
309
|
-
|
310
|
-
$img.width($origimg.width());
|
311
|
-
$img.height($origimg.height());
|
312
|
-
$origimg.after($img).hide();
|
313
|
-
|
314
|
-
presize($img, options.boxWidth, options.boxHeight);
|
315
|
-
|
316
|
-
var boundx = $img.width(),
|
317
|
-
boundy = $img.height(),
|
318
|
-
|
319
|
-
|
320
|
-
$div = $('<div />').width(boundx).height(boundy).addClass(cssClass('holder')).css({
|
321
|
-
position: 'relative',
|
322
|
-
backgroundColor: options.bgColor
|
323
|
-
}).insertAfter($origimg).append($img);
|
324
|
-
|
325
|
-
delete(options.bgColor);
|
326
|
-
if (options.addClass) {
|
327
|
-
$div.addClass(options.addClass);
|
328
|
-
}
|
329
|
-
|
330
|
-
var $img2 = $('<img />')
|
331
|
-
.attr('src', $img.attr('src')).css(img_css).width(boundx).height(boundy),
|
332
|
-
|
333
|
-
$img_holder = $('<div />')
|
334
|
-
.width(pct(100)).height(pct(100)).css({
|
335
|
-
zIndex: 310,
|
336
|
-
position: 'absolute',
|
337
|
-
overflow: 'hidden'
|
338
|
-
}).append($img2),
|
339
|
-
|
340
|
-
$hdl_holder = $('<div />')
|
341
|
-
.width(pct(100)).height(pct(100)).css('zIndex', 320),
|
342
|
-
|
343
|
-
$sel = $('<div />')
|
344
|
-
.css({
|
345
|
-
position: 'absolute',
|
346
|
-
zIndex: 300
|
347
|
-
}).insertBefore($img).append($img_holder, $hdl_holder);
|
348
|
-
|
349
|
-
if (ie6mode) {
|
350
|
-
$sel.css({
|
351
|
-
overflowY: 'hidden'
|
352
|
-
});
|
353
|
-
}
|
354
|
-
|
355
|
-
var bound = options.boundary;
|
356
|
-
var $trk = newTracker().width(boundx + (bound * 2)).height(boundy + (bound * 2)).css({
|
357
|
-
position: 'absolute',
|
358
|
-
top: px(-bound),
|
359
|
-
left: px(-bound),
|
360
|
-
zIndex: 290
|
361
|
-
}).mousedown(newSelection);
|
362
|
-
|
363
|
-
/* }}} */
|
364
|
-
// Set more variables {{{
|
365
|
-
var bgopacity = options.bgOpacity,
|
366
|
-
xlimit, ylimit, xmin, ymin, xscale, yscale, enabled = true,
|
367
|
-
btndown, animating, shift_down;
|
368
|
-
|
369
|
-
docOffset = getPos($img);
|
370
|
-
// }}}
|
371
|
-
// }}}
|
372
|
-
// Internal Modules {{{
|
373
|
-
// Touch Module {{{
|
374
|
-
var Touch = (function () {
|
375
|
-
// Touch support detection function adapted (under MIT License)
|
376
|
-
// from code by Jeffrey Sambells - http://github.com/iamamused/
|
377
|
-
function hasTouchSupport() {
|
378
|
-
var support = {},
|
379
|
-
events = ['touchstart', 'touchmove', 'touchend'],
|
380
|
-
el = document.createElement('div'), i;
|
381
|
-
|
382
|
-
try {
|
383
|
-
for(i=0; i<events.length; i++) {
|
384
|
-
var eventName = events[i];
|
385
|
-
eventName = 'on' + eventName;
|
386
|
-
var isSupported = (eventName in el);
|
387
|
-
if (!isSupported) {
|
388
|
-
el.setAttribute(eventName, 'return;');
|
389
|
-
isSupported = typeof el[eventName] == 'function';
|
390
|
-
}
|
391
|
-
support[events[i]] = isSupported;
|
392
|
-
}
|
393
|
-
return support.touchstart && support.touchend && support.touchmove;
|
394
|
-
}
|
395
|
-
catch(err) {
|
396
|
-
return false;
|
397
|
-
}
|
398
|
-
}
|
399
|
-
|
400
|
-
function detectSupport() {
|
401
|
-
if ((options.touchSupport === true) || (options.touchSupport === false)) return options.touchSupport;
|
402
|
-
else return hasTouchSupport();
|
403
|
-
}
|
404
|
-
return {
|
405
|
-
createDragger: function (ord) {
|
406
|
-
return function (e) {
|
407
|
-
e.pageX = e.originalEvent.changedTouches[0].pageX;
|
408
|
-
e.pageY = e.originalEvent.changedTouches[0].pageY;
|
409
|
-
if (options.disabled) {
|
410
|
-
return false;
|
411
|
-
}
|
412
|
-
if ((ord === 'move') && !options.allowMove) {
|
413
|
-
return false;
|
414
|
-
}
|
415
|
-
btndown = true;
|
416
|
-
startDragMode(ord, mouseAbs(e));
|
417
|
-
e.stopPropagation();
|
418
|
-
e.preventDefault();
|
419
|
-
return false;
|
420
|
-
};
|
421
|
-
},
|
422
|
-
newSelection: function (e) {
|
423
|
-
e.pageX = e.originalEvent.changedTouches[0].pageX;
|
424
|
-
e.pageY = e.originalEvent.changedTouches[0].pageY;
|
425
|
-
return newSelection(e);
|
426
|
-
},
|
427
|
-
isSupported: hasTouchSupport,
|
428
|
-
support: detectSupport()
|
429
|
-
};
|
430
|
-
}());
|
431
|
-
// }}}
|
432
|
-
// Coords Module {{{
|
433
|
-
var Coords = (function () {
|
434
|
-
var x1 = 0,
|
435
|
-
y1 = 0,
|
436
|
-
x2 = 0,
|
437
|
-
y2 = 0,
|
438
|
-
ox, oy;
|
439
|
-
|
440
|
-
function setPressed(pos) //{{{
|
441
|
-
{
|
442
|
-
pos = rebound(pos);
|
443
|
-
x2 = x1 = pos[0];
|
444
|
-
y2 = y1 = pos[1];
|
445
|
-
}
|
446
|
-
//}}}
|
447
|
-
function setCurrent(pos) //{{{
|
448
|
-
{
|
449
|
-
pos = rebound(pos);
|
450
|
-
ox = pos[0] - x2;
|
451
|
-
oy = pos[1] - y2;
|
452
|
-
x2 = pos[0];
|
453
|
-
y2 = pos[1];
|
454
|
-
}
|
455
|
-
//}}}
|
456
|
-
function getOffset() //{{{
|
457
|
-
{
|
458
|
-
return [ox, oy];
|
459
|
-
}
|
460
|
-
//}}}
|
461
|
-
function moveOffset(offset) //{{{
|
462
|
-
{
|
463
|
-
var ox = offset[0],
|
464
|
-
oy = offset[1];
|
465
|
-
|
466
|
-
if (0 > x1 + ox) {
|
467
|
-
ox -= ox + x1;
|
468
|
-
}
|
469
|
-
if (0 > y1 + oy) {
|
470
|
-
oy -= oy + y1;
|
471
|
-
}
|
472
|
-
|
473
|
-
if (boundy < y2 + oy) {
|
474
|
-
oy += boundy - (y2 + oy);
|
475
|
-
}
|
476
|
-
if (boundx < x2 + ox) {
|
477
|
-
ox += boundx - (x2 + ox);
|
478
|
-
}
|
479
|
-
|
480
|
-
x1 += ox;
|
481
|
-
x2 += ox;
|
482
|
-
y1 += oy;
|
483
|
-
y2 += oy;
|
484
|
-
}
|
485
|
-
//}}}
|
486
|
-
function getCorner(ord) //{{{
|
487
|
-
{
|
488
|
-
var c = getFixed();
|
489
|
-
switch (ord) {
|
490
|
-
case 'ne':
|
491
|
-
return [c.x2, c.y];
|
492
|
-
case 'nw':
|
493
|
-
return [c.x, c.y];
|
494
|
-
case 'se':
|
495
|
-
return [c.x2, c.y2];
|
496
|
-
case 'sw':
|
497
|
-
return [c.x, c.y2];
|
498
|
-
}
|
499
|
-
}
|
500
|
-
//}}}
|
501
|
-
function getFixed() //{{{
|
502
|
-
{
|
503
|
-
if (!options.aspectRatio) {
|
504
|
-
return getRect();
|
505
|
-
}
|
506
|
-
// This function could use some optimization I think...
|
507
|
-
var aspect = options.aspectRatio,
|
508
|
-
min_x = options.minSize[0] / xscale,
|
509
|
-
|
510
|
-
|
511
|
-
//min_y = options.minSize[1]/yscale,
|
512
|
-
max_x = options.maxSize[0] / xscale,
|
513
|
-
max_y = options.maxSize[1] / yscale,
|
514
|
-
rw = x2 - x1,
|
515
|
-
rh = y2 - y1,
|
516
|
-
rwa = Math.abs(rw),
|
517
|
-
rha = Math.abs(rh),
|
518
|
-
real_ratio = rwa / rha,
|
519
|
-
xx, yy;
|
520
|
-
|
521
|
-
if (max_x === 0) {
|
522
|
-
max_x = boundx * 10;
|
523
|
-
}
|
524
|
-
if (max_y === 0) {
|
525
|
-
max_y = boundy * 10;
|
526
|
-
}
|
527
|
-
if (real_ratio < aspect) {
|
528
|
-
yy = y2;
|
529
|
-
w = rha * aspect;
|
530
|
-
xx = rw < 0 ? x1 - w : w + x1;
|
531
|
-
|
532
|
-
if (xx < 0) {
|
533
|
-
xx = 0;
|
534
|
-
h = Math.abs((xx - x1) / aspect);
|
535
|
-
yy = rh < 0 ? y1 - h : h + y1;
|
536
|
-
} else if (xx > boundx) {
|
537
|
-
xx = boundx;
|
538
|
-
h = Math.abs((xx - x1) / aspect);
|
539
|
-
yy = rh < 0 ? y1 - h : h + y1;
|
540
|
-
}
|
541
|
-
} else {
|
542
|
-
xx = x2;
|
543
|
-
h = rwa / aspect;
|
544
|
-
yy = rh < 0 ? y1 - h : y1 + h;
|
545
|
-
if (yy < 0) {
|
546
|
-
yy = 0;
|
547
|
-
w = Math.abs((yy - y1) * aspect);
|
548
|
-
xx = rw < 0 ? x1 - w : w + x1;
|
549
|
-
} else if (yy > boundy) {
|
550
|
-
yy = boundy;
|
551
|
-
w = Math.abs(yy - y1) * aspect;
|
552
|
-
xx = rw < 0 ? x1 - w : w + x1;
|
553
|
-
}
|
554
|
-
}
|
555
|
-
|
556
|
-
// Magic %-)
|
557
|
-
if (xx > x1) { // right side
|
558
|
-
if (xx - x1 < min_x) {
|
559
|
-
xx = x1 + min_x;
|
560
|
-
} else if (xx - x1 > max_x) {
|
561
|
-
xx = x1 + max_x;
|
562
|
-
}
|
563
|
-
if (yy > y1) {
|
564
|
-
yy = y1 + (xx - x1) / aspect;
|
565
|
-
} else {
|
566
|
-
yy = y1 - (xx - x1) / aspect;
|
567
|
-
}
|
568
|
-
} else if (xx < x1) { // left side
|
569
|
-
if (x1 - xx < min_x) {
|
570
|
-
xx = x1 - min_x;
|
571
|
-
} else if (x1 - xx > max_x) {
|
572
|
-
xx = x1 - max_x;
|
573
|
-
}
|
574
|
-
if (yy > y1) {
|
575
|
-
yy = y1 + (x1 - xx) / aspect;
|
576
|
-
} else {
|
577
|
-
yy = y1 - (x1 - xx) / aspect;
|
578
|
-
}
|
579
|
-
}
|
580
|
-
|
581
|
-
if (xx < 0) {
|
582
|
-
x1 -= xx;
|
583
|
-
xx = 0;
|
584
|
-
} else if (xx > boundx) {
|
585
|
-
x1 -= xx - boundx;
|
586
|
-
xx = boundx;
|
587
|
-
}
|
588
|
-
|
589
|
-
if (yy < 0) {
|
590
|
-
y1 -= yy;
|
591
|
-
yy = 0;
|
592
|
-
} else if (yy > boundy) {
|
593
|
-
y1 -= yy - boundy;
|
594
|
-
yy = boundy;
|
595
|
-
}
|
596
|
-
|
597
|
-
return makeObj(flipCoords(x1, y1, xx, yy));
|
598
|
-
}
|
599
|
-
//}}}
|
600
|
-
function rebound(p) //{{{
|
601
|
-
{
|
602
|
-
if (p[0] < 0) {
|
603
|
-
p[0] = 0;
|
604
|
-
}
|
605
|
-
if (p[1] < 0) {
|
606
|
-
p[1] = 0;
|
607
|
-
}
|
608
|
-
|
609
|
-
if (p[0] > boundx) {
|
610
|
-
p[0] = boundx;
|
611
|
-
}
|
612
|
-
if (p[1] > boundy) {
|
613
|
-
p[1] = boundy;
|
614
|
-
}
|
615
|
-
|
616
|
-
return [p[0], p[1]];
|
617
|
-
}
|
618
|
-
//}}}
|
619
|
-
function flipCoords(x1, y1, x2, y2) //{{{
|
620
|
-
{
|
621
|
-
var xa = x1,
|
622
|
-
xb = x2,
|
623
|
-
ya = y1,
|
624
|
-
yb = y2;
|
625
|
-
if (x2 < x1) {
|
626
|
-
xa = x2;
|
627
|
-
xb = x1;
|
628
|
-
}
|
629
|
-
if (y2 < y1) {
|
630
|
-
ya = y2;
|
631
|
-
yb = y1;
|
632
|
-
}
|
633
|
-
return [Math.round(xa), Math.round(ya), Math.round(xb), Math.round(yb)];
|
634
|
-
}
|
635
|
-
//}}}
|
636
|
-
function getRect() //{{{
|
637
|
-
{
|
638
|
-
var xsize = x2 - x1,
|
639
|
-
ysize = y2 - y1,
|
640
|
-
delta;
|
641
|
-
|
642
|
-
if (xlimit && (Math.abs(xsize) > xlimit)) {
|
643
|
-
x2 = (xsize > 0) ? (x1 + xlimit) : (x1 - xlimit);
|
644
|
-
}
|
645
|
-
if (ylimit && (Math.abs(ysize) > ylimit)) {
|
646
|
-
y2 = (ysize > 0) ? (y1 + ylimit) : (y1 - ylimit);
|
647
|
-
}
|
648
|
-
|
649
|
-
if (ymin / yscale && (Math.abs(ysize) < ymin / yscale)) {
|
650
|
-
y2 = (ysize > 0) ? (y1 + ymin / yscale) : (y1 - ymin / yscale);
|
651
|
-
}
|
652
|
-
if (xmin / xscale && (Math.abs(xsize) < xmin / xscale)) {
|
653
|
-
x2 = (xsize > 0) ? (x1 + xmin / xscale) : (x1 - xmin / xscale);
|
654
|
-
}
|
655
|
-
|
656
|
-
if (x1 < 0) {
|
657
|
-
x2 -= x1;
|
658
|
-
x1 -= x1;
|
659
|
-
}
|
660
|
-
if (y1 < 0) {
|
661
|
-
y2 -= y1;
|
662
|
-
y1 -= y1;
|
663
|
-
}
|
664
|
-
if (x2 < 0) {
|
665
|
-
x1 -= x2;
|
666
|
-
x2 -= x2;
|
667
|
-
}
|
668
|
-
if (y2 < 0) {
|
669
|
-
y1 -= y2;
|
670
|
-
y2 -= y2;
|
671
|
-
}
|
672
|
-
if (x2 > boundx) {
|
673
|
-
delta = x2 - boundx;
|
674
|
-
x1 -= delta;
|
675
|
-
x2 -= delta;
|
676
|
-
}
|
677
|
-
if (y2 > boundy) {
|
678
|
-
delta = y2 - boundy;
|
679
|
-
y1 -= delta;
|
680
|
-
y2 -= delta;
|
681
|
-
}
|
682
|
-
if (x1 > boundx) {
|
683
|
-
delta = x1 - boundy;
|
684
|
-
y2 -= delta;
|
685
|
-
y1 -= delta;
|
686
|
-
}
|
687
|
-
if (y1 > boundy) {
|
688
|
-
delta = y1 - boundy;
|
689
|
-
y2 -= delta;
|
690
|
-
y1 -= delta;
|
691
|
-
}
|
692
|
-
|
693
|
-
return makeObj(flipCoords(x1, y1, x2, y2));
|
694
|
-
}
|
695
|
-
//}}}
|
696
|
-
function makeObj(a) //{{{
|
697
|
-
{
|
698
|
-
return {
|
699
|
-
x: a[0],
|
700
|
-
y: a[1],
|
701
|
-
x2: a[2],
|
702
|
-
y2: a[3],
|
703
|
-
w: a[2] - a[0],
|
704
|
-
h: a[3] - a[1]
|
705
|
-
};
|
706
|
-
}
|
707
|
-
//}}}
|
708
|
-
|
709
|
-
return {
|
710
|
-
flipCoords: flipCoords,
|
711
|
-
setPressed: setPressed,
|
712
|
-
setCurrent: setCurrent,
|
713
|
-
getOffset: getOffset,
|
714
|
-
moveOffset: moveOffset,
|
715
|
-
getCorner: getCorner,
|
716
|
-
getFixed: getFixed
|
717
|
-
};
|
718
|
-
}());
|
719
|
-
|
720
|
-
//}}}
|
721
|
-
// Tracker Module {{{
|
722
|
-
var Tracker = (function () {
|
723
|
-
var onMove = function () {},
|
724
|
-
onDone = function () {},
|
725
|
-
trackDoc = options.trackDocument;
|
726
|
-
|
727
|
-
function toFront() //{{{
|
728
|
-
{
|
729
|
-
$trk.css({
|
730
|
-
zIndex: 450
|
731
|
-
});
|
732
|
-
if (trackDoc) {
|
733
|
-
$(document)
|
734
|
-
.bind('mousemove',trackMove)
|
735
|
-
.bind('mouseup',trackUp);
|
736
|
-
}
|
737
|
-
}
|
738
|
-
//}}}
|
739
|
-
function toBack() //{{{
|
740
|
-
{
|
741
|
-
$trk.css({
|
742
|
-
zIndex: 290
|
743
|
-
});
|
744
|
-
if (trackDoc) {
|
745
|
-
$(document)
|
746
|
-
.unbind('mousemove', trackMove)
|
747
|
-
.unbind('mouseup', trackUp);
|
748
|
-
}
|
749
|
-
}
|
750
|
-
//}}}
|
751
|
-
function trackMove(e) //{{{
|
752
|
-
{
|
753
|
-
onMove(mouseAbs(e));
|
754
|
-
return false;
|
755
|
-
}
|
756
|
-
//}}}
|
757
|
-
function trackUp(e) //{{{
|
758
|
-
{
|
759
|
-
e.preventDefault();
|
760
|
-
e.stopPropagation();
|
761
|
-
|
762
|
-
if (btndown) {
|
763
|
-
btndown = false;
|
764
|
-
|
765
|
-
onDone(mouseAbs(e));
|
766
|
-
|
767
|
-
if (Selection.isAwake()) {
|
768
|
-
options.onSelect.call(api, unscale(Coords.getFixed()));
|
769
|
-
}
|
770
|
-
|
771
|
-
toBack();
|
772
|
-
onMove = function () {};
|
773
|
-
onDone = function () {};
|
774
|
-
}
|
775
|
-
|
776
|
-
return false;
|
777
|
-
}
|
778
|
-
//}}}
|
779
|
-
function activateHandlers(move, done) //{{{
|
780
|
-
{
|
781
|
-
btndown = true;
|
782
|
-
onMove = move;
|
783
|
-
onDone = done;
|
784
|
-
toFront();
|
785
|
-
return false;
|
786
|
-
}
|
787
|
-
//}}}
|
788
|
-
function trackTouchMove(e) //{{{
|
789
|
-
{
|
790
|
-
e.pageX = e.originalEvent.changedTouches[0].pageX;
|
791
|
-
e.pageY = e.originalEvent.changedTouches[0].pageY;
|
792
|
-
return trackMove(e);
|
793
|
-
}
|
794
|
-
//}}}
|
795
|
-
function trackTouchEnd(e) //{{{
|
796
|
-
{
|
797
|
-
e.pageX = e.originalEvent.changedTouches[0].pageX;
|
798
|
-
e.pageY = e.originalEvent.changedTouches[0].pageY;
|
799
|
-
return trackUp(e);
|
800
|
-
}
|
801
|
-
//}}}
|
802
|
-
function setCursor(t) //{{{
|
803
|
-
{
|
804
|
-
$trk.css('cursor', t);
|
805
|
-
}
|
806
|
-
//}}}
|
807
|
-
|
808
|
-
if (Touch.support) {
|
809
|
-
$trk
|
810
|
-
.bind('touchmove', trackTouchMove)
|
811
|
-
.bind('touchend', trackTouchEnd);
|
812
|
-
}
|
813
|
-
|
814
|
-
if (!trackDoc) {
|
815
|
-
$trk.mousemove(trackMove).mouseup(trackUp).mouseout(trackUp);
|
816
|
-
}
|
817
|
-
|
818
|
-
$img.before($trk);
|
819
|
-
return {
|
820
|
-
trackTouchMove: trackTouchMove,
|
821
|
-
activateHandlers: activateHandlers,
|
822
|
-
setCursor: setCursor
|
823
|
-
};
|
824
|
-
}());
|
825
|
-
//}}}
|
826
|
-
// Selection Module {{{
|
827
|
-
var Selection = (function () {
|
828
|
-
var awake, hdep = 370;
|
829
|
-
var borders = {};
|
830
|
-
var handle = {};
|
831
|
-
var seehandles = false;
|
832
|
-
var hhs = options.handleOffset;
|
833
|
-
|
834
|
-
// Private Methods
|
835
|
-
function insertBorder(type) //{{{
|
836
|
-
{
|
837
|
-
var jq = $('<div />').css({
|
838
|
-
position: 'absolute',
|
839
|
-
opacity: options.borderOpacity
|
840
|
-
}).addClass(cssClass(type));
|
841
|
-
$img_holder.append(jq);
|
842
|
-
return jq;
|
843
|
-
}
|
844
|
-
//}}}
|
845
|
-
function dragDiv(ord, zi) //{{{
|
846
|
-
{
|
847
|
-
var jq = $('<div />').mousedown(createDragger(ord)).css({
|
848
|
-
cursor: ord + '-resize',
|
849
|
-
position: 'absolute',
|
850
|
-
zIndex: zi
|
851
|
-
});
|
852
|
-
|
853
|
-
if (Touch.support) {
|
854
|
-
jq.bind('touchstart', Touch.createDragger(ord))
|
855
|
-
.bind('touchmove', Tracker.trackTouchMove)
|
856
|
-
.bind('touchend', Tracker.trackTouchEnd);
|
857
|
-
}
|
858
|
-
|
859
|
-
$hdl_holder.append(jq);
|
860
|
-
return jq;
|
861
|
-
}
|
862
|
-
//}}}
|
863
|
-
function insertHandle(ord) //{{{
|
864
|
-
{
|
865
|
-
return dragDiv(ord, hdep++).css({
|
866
|
-
top: px(-hhs + 1),
|
867
|
-
left: px(-hhs + 1),
|
868
|
-
opacity: options.handleOpacity
|
869
|
-
}).addClass(cssClass('handle'));
|
870
|
-
}
|
871
|
-
//}}}
|
872
|
-
function insertDragbar(ord) //{{{
|
873
|
-
{
|
874
|
-
var s = options.handleSize,
|
875
|
-
h = s,
|
876
|
-
w = s,
|
877
|
-
t = hhs,
|
878
|
-
l = hhs;
|
879
|
-
|
880
|
-
switch (ord) {
|
881
|
-
case 'n':
|
882
|
-
case 's':
|
883
|
-
w = pct(100);
|
884
|
-
break;
|
885
|
-
case 'e':
|
886
|
-
case 'w':
|
887
|
-
h = pct(100);
|
888
|
-
break;
|
889
|
-
}
|
890
|
-
|
891
|
-
return dragDiv(ord, hdep++).width(w).height(h).css({
|
892
|
-
top: px(-t + 1),
|
893
|
-
left: px(-l + 1)
|
894
|
-
});
|
895
|
-
}
|
896
|
-
//}}}
|
897
|
-
function createHandles(li) //{{{
|
898
|
-
{
|
899
|
-
var i;
|
900
|
-
for (i = 0; i < li.length; i++) {
|
901
|
-
handle[li[i]] = insertHandle(li[i]);
|
902
|
-
}
|
903
|
-
}
|
904
|
-
//}}}
|
905
|
-
function moveHandles(c) //{{{
|
906
|
-
{
|
907
|
-
var midvert = Math.round((c.h / 2) - hhs),
|
908
|
-
midhoriz = Math.round((c.w / 2) - hhs),
|
909
|
-
north = -hhs + 1,
|
910
|
-
west = -hhs + 1,
|
911
|
-
east = c.w - hhs,
|
912
|
-
south = c.h - hhs,
|
913
|
-
x, y;
|
914
|
-
|
915
|
-
if (handle.e) {
|
916
|
-
handle.e.css({
|
917
|
-
top: px(midvert),
|
918
|
-
left: px(east)
|
919
|
-
});
|
920
|
-
handle.w.css({
|
921
|
-
top: px(midvert)
|
922
|
-
});
|
923
|
-
handle.s.css({
|
924
|
-
top: px(south),
|
925
|
-
left: px(midhoriz)
|
926
|
-
});
|
927
|
-
handle.n.css({
|
928
|
-
left: px(midhoriz)
|
929
|
-
});
|
930
|
-
}
|
931
|
-
if (handle.ne) {
|
932
|
-
handle.ne.css({
|
933
|
-
left: px(east)
|
934
|
-
});
|
935
|
-
handle.se.css({
|
936
|
-
top: px(south),
|
937
|
-
left: px(east)
|
938
|
-
});
|
939
|
-
handle.sw.css({
|
940
|
-
top: px(south)
|
941
|
-
});
|
942
|
-
}
|
943
|
-
if (handle.b) {
|
944
|
-
handle.b.css({
|
945
|
-
top: px(south)
|
946
|
-
});
|
947
|
-
handle.r.css({
|
948
|
-
left: px(east)
|
949
|
-
});
|
950
|
-
}
|
951
|
-
}
|
952
|
-
//}}}
|
953
|
-
function moveto(x, y) //{{{
|
954
|
-
{
|
955
|
-
$img2.css({
|
956
|
-
top: px(-y),
|
957
|
-
left: px(-x)
|
958
|
-
});
|
959
|
-
$sel.css({
|
960
|
-
top: px(y),
|
961
|
-
left: px(x)
|
962
|
-
});
|
963
|
-
}
|
964
|
-
//}}}
|
965
|
-
function resize(w, h) //{{{
|
966
|
-
{
|
967
|
-
$sel.width(w).height(h);
|
968
|
-
}
|
969
|
-
//}}}
|
970
|
-
function refresh() //{{{
|
971
|
-
{
|
972
|
-
var c = Coords.getFixed();
|
973
|
-
|
974
|
-
Coords.setPressed([c.x, c.y]);
|
975
|
-
Coords.setCurrent([c.x2, c.y2]);
|
976
|
-
|
977
|
-
updateVisible();
|
978
|
-
}
|
979
|
-
//}}}
|
980
|
-
|
981
|
-
// Internal Methods
|
982
|
-
function updateVisible() //{{{
|
983
|
-
{
|
984
|
-
if (awake) {
|
985
|
-
return update();
|
986
|
-
}
|
987
|
-
}
|
988
|
-
//}}}
|
989
|
-
function update() //{{{
|
990
|
-
{
|
991
|
-
var c = Coords.getFixed();
|
992
|
-
|
993
|
-
resize(c.w, c.h);
|
994
|
-
moveto(c.x, c.y);
|
995
|
-
|
996
|
-
/*
|
997
|
-
options.drawBorders &&
|
998
|
-
borders.right.css({ left: px(c.w-1) }) &&
|
999
|
-
borders.bottom.css({ top: px(c.h-1) });
|
1000
|
-
*/
|
1001
|
-
|
1002
|
-
if (seehandles) {
|
1003
|
-
moveHandles(c);
|
1004
|
-
}
|
1005
|
-
if (!awake) {
|
1006
|
-
show();
|
1007
|
-
}
|
1008
|
-
|
1009
|
-
options.onChange.call(api, unscale(c));
|
1010
|
-
}
|
1011
|
-
//}}}
|
1012
|
-
function show() //{{{
|
1013
|
-
{
|
1014
|
-
$sel.show();
|
1015
|
-
|
1016
|
-
if (options.bgFade) {
|
1017
|
-
$img.fadeTo(options.fadeTime, bgopacity);
|
1018
|
-
} else {
|
1019
|
-
$img.css('opacity', bgopacity);
|
1020
|
-
}
|
1021
|
-
|
1022
|
-
awake = true;
|
1023
|
-
}
|
1024
|
-
//}}}
|
1025
|
-
function release() //{{{
|
1026
|
-
{
|
1027
|
-
disableHandles();
|
1028
|
-
$sel.hide();
|
1029
|
-
|
1030
|
-
if (options.bgFade) {
|
1031
|
-
$img.fadeTo(options.fadeTime, 1);
|
1032
|
-
} else {
|
1033
|
-
$img.css('opacity', 1);
|
1034
|
-
}
|
1035
|
-
|
1036
|
-
awake = false;
|
1037
|
-
options.onRelease.call(api);
|
1038
|
-
}
|
1039
|
-
//}}}
|
1040
|
-
function showHandles() //{{{
|
1041
|
-
{
|
1042
|
-
if (seehandles) {
|
1043
|
-
moveHandles(Coords.getFixed());
|
1044
|
-
$hdl_holder.show();
|
1045
|
-
}
|
1046
|
-
}
|
1047
|
-
//}}}
|
1048
|
-
function enableHandles() //{{{
|
1049
|
-
{
|
1050
|
-
seehandles = true;
|
1051
|
-
if (options.allowResize) {
|
1052
|
-
moveHandles(Coords.getFixed());
|
1053
|
-
$hdl_holder.show();
|
1054
|
-
return true;
|
1055
|
-
}
|
1056
|
-
}
|
1057
|
-
//}}}
|
1058
|
-
function disableHandles() //{{{
|
1059
|
-
{
|
1060
|
-
seehandles = false;
|
1061
|
-
$hdl_holder.hide();
|
1062
|
-
}
|
1063
|
-
//}}}
|
1064
|
-
function animMode(v) //{{{
|
1065
|
-
{
|
1066
|
-
if (animating === v) {
|
1067
|
-
disableHandles();
|
1068
|
-
} else {
|
1069
|
-
enableHandles();
|
1070
|
-
}
|
1071
|
-
}
|
1072
|
-
//}}}
|
1073
|
-
function done() //{{{
|
1074
|
-
{
|
1075
|
-
animMode(false);
|
1076
|
-
refresh();
|
1077
|
-
}
|
1078
|
-
//}}}
|
1079
|
-
/* Insert draggable elements {{{*/
|
1080
|
-
|
1081
|
-
// Insert border divs for outline
|
1082
|
-
if (options.drawBorders) {
|
1083
|
-
borders = {
|
1084
|
-
top: insertBorder('hline'),
|
1085
|
-
bottom: insertBorder('hline bottom'),
|
1086
|
-
left: insertBorder('vline'),
|
1087
|
-
right: insertBorder('vline right')
|
1088
|
-
};
|
1089
|
-
}
|
1090
|
-
|
1091
|
-
// Insert handles on edges
|
1092
|
-
if (options.dragEdges) {
|
1093
|
-
handle.t = insertDragbar('n');
|
1094
|
-
handle.b = insertDragbar('s');
|
1095
|
-
handle.r = insertDragbar('e');
|
1096
|
-
handle.l = insertDragbar('w');
|
1097
|
-
}
|
1098
|
-
|
1099
|
-
// Insert side and corner handles
|
1100
|
-
if (options.sideHandles) {
|
1101
|
-
createHandles(['n', 's', 'e', 'w']);
|
1102
|
-
}
|
1103
|
-
if (options.cornerHandles) {
|
1104
|
-
createHandles(['sw', 'nw', 'ne', 'se']);
|
1105
|
-
}
|
1106
|
-
|
1107
|
-
|
1108
|
-
//}}}
|
1109
|
-
|
1110
|
-
var $track = newTracker().mousedown(createDragger('move')).css({
|
1111
|
-
cursor: 'move',
|
1112
|
-
position: 'absolute',
|
1113
|
-
zIndex: 360
|
1114
|
-
});
|
1115
|
-
|
1116
|
-
if (Touch.support) {
|
1117
|
-
$track.bind('touchstart.jcrop', Touch.createDragger('move'))
|
1118
|
-
.bind('touchmove', Tracker.trackTouchMove)
|
1119
|
-
.bind('touchend', Tracker.trackTouchEnd);
|
1120
|
-
}
|
1121
|
-
|
1122
|
-
$img_holder.append($track);
|
1123
|
-
disableHandles();
|
1124
|
-
|
1125
|
-
return {
|
1126
|
-
updateVisible: updateVisible,
|
1127
|
-
update: update,
|
1128
|
-
release: release,
|
1129
|
-
refresh: refresh,
|
1130
|
-
isAwake: function () {
|
1131
|
-
return awake;
|
1132
|
-
},
|
1133
|
-
setCursor: function (cursor) {
|
1134
|
-
$track.css('cursor', cursor);
|
1135
|
-
},
|
1136
|
-
enableHandles: enableHandles,
|
1137
|
-
enableOnly: function () {
|
1138
|
-
seehandles = true;
|
1139
|
-
},
|
1140
|
-
showHandles: showHandles,
|
1141
|
-
disableHandles: disableHandles,
|
1142
|
-
animMode: animMode,
|
1143
|
-
done: done
|
1144
|
-
};
|
1145
|
-
}());
|
1146
|
-
|
1147
|
-
//}}}
|
1148
|
-
// KeyManager Module {{{
|
1149
|
-
var KeyManager = (function () {
|
1150
|
-
var $keymgr = $('<input type="radio" />').css({
|
1151
|
-
position: 'fixed',
|
1152
|
-
left: '-120px',
|
1153
|
-
width: '12px'
|
1154
|
-
}),
|
1155
|
-
$keywrap = $('<div />').css({
|
1156
|
-
position: 'absolute',
|
1157
|
-
overflow: 'hidden'
|
1158
|
-
}).append($keymgr);
|
1159
|
-
|
1160
|
-
function watchKeys() //{{{
|
1161
|
-
{
|
1162
|
-
if (options.keySupport) {
|
1163
|
-
$keymgr.show();
|
1164
|
-
$keymgr.focus();
|
1165
|
-
}
|
1166
|
-
}
|
1167
|
-
//}}}
|
1168
|
-
function onBlur(e) //{{{
|
1169
|
-
{
|
1170
|
-
$keymgr.hide();
|
1171
|
-
}
|
1172
|
-
//}}}
|
1173
|
-
function doNudge(e, x, y) //{{{
|
1174
|
-
{
|
1175
|
-
if (options.allowMove) {
|
1176
|
-
Coords.moveOffset([x, y]);
|
1177
|
-
Selection.updateVisible();
|
1178
|
-
}
|
1179
|
-
e.preventDefault();
|
1180
|
-
e.stopPropagation();
|
1181
|
-
}
|
1182
|
-
//}}}
|
1183
|
-
function parseKey(e) //{{{
|
1184
|
-
{
|
1185
|
-
if (e.ctrlKey) {
|
1186
|
-
return true;
|
1187
|
-
}
|
1188
|
-
shift_down = e.shiftKey ? true : false;
|
1189
|
-
var nudge = shift_down ? 10 : 1;
|
1190
|
-
|
1191
|
-
switch (e.keyCode) {
|
1192
|
-
case 37:
|
1193
|
-
doNudge(e, -nudge, 0);
|
1194
|
-
break;
|
1195
|
-
case 39:
|
1196
|
-
doNudge(e, nudge, 0);
|
1197
|
-
break;
|
1198
|
-
case 38:
|
1199
|
-
doNudge(e, 0, -nudge);
|
1200
|
-
break;
|
1201
|
-
case 40:
|
1202
|
-
doNudge(e, 0, nudge);
|
1203
|
-
break;
|
1204
|
-
case 27:
|
1205
|
-
Selection.release();
|
1206
|
-
break;
|
1207
|
-
case 9:
|
1208
|
-
return true;
|
1209
|
-
}
|
1210
|
-
|
1211
|
-
return false;
|
1212
|
-
}
|
1213
|
-
//}}}
|
1214
|
-
|
1215
|
-
if (options.keySupport) {
|
1216
|
-
$keymgr.keydown(parseKey).blur(onBlur);
|
1217
|
-
if (ie6mode || !options.fixedSupport) {
|
1218
|
-
$keymgr.css({
|
1219
|
-
position: 'absolute',
|
1220
|
-
left: '-20px'
|
1221
|
-
});
|
1222
|
-
$keywrap.append($keymgr).insertBefore($img);
|
1223
|
-
} else {
|
1224
|
-
$keymgr.insertBefore($img);
|
1225
|
-
}
|
1226
|
-
}
|
1227
|
-
|
1228
|
-
|
1229
|
-
return {
|
1230
|
-
watchKeys: watchKeys
|
1231
|
-
};
|
1232
|
-
}());
|
1233
|
-
//}}}
|
1234
|
-
// }}}
|
1235
|
-
// API methods {{{
|
1236
|
-
function setClass(cname) //{{{
|
1237
|
-
{
|
1238
|
-
$div.removeClass().addClass(cssClass('holder')).addClass(cname);
|
1239
|
-
}
|
1240
|
-
//}}}
|
1241
|
-
function animateTo(a, callback) //{{{
|
1242
|
-
{
|
1243
|
-
var x1 = parseInt(a[0], 10) / xscale,
|
1244
|
-
y1 = parseInt(a[1], 10) / yscale,
|
1245
|
-
x2 = parseInt(a[2], 10) / xscale,
|
1246
|
-
y2 = parseInt(a[3], 10) / yscale;
|
1247
|
-
|
1248
|
-
if (animating) {
|
1249
|
-
return;
|
1250
|
-
}
|
1251
|
-
|
1252
|
-
var animto = Coords.flipCoords(x1, y1, x2, y2),
|
1253
|
-
c = Coords.getFixed(),
|
1254
|
-
initcr = [c.x, c.y, c.x2, c.y2],
|
1255
|
-
animat = initcr,
|
1256
|
-
interv = options.animationDelay,
|
1257
|
-
ix1 = animto[0] - initcr[0],
|
1258
|
-
iy1 = animto[1] - initcr[1],
|
1259
|
-
ix2 = animto[2] - initcr[2],
|
1260
|
-
iy2 = animto[3] - initcr[3],
|
1261
|
-
pcent = 0,
|
1262
|
-
velocity = options.swingSpeed;
|
1263
|
-
|
1264
|
-
x = animat[0];
|
1265
|
-
y = animat[1];
|
1266
|
-
x2 = animat[2];
|
1267
|
-
y2 = animat[3];
|
1268
|
-
|
1269
|
-
Selection.animMode(true);
|
1270
|
-
var anim_timer;
|
1271
|
-
|
1272
|
-
function queueAnimator() {
|
1273
|
-
window.setTimeout(animator, interv);
|
1274
|
-
}
|
1275
|
-
var animator = (function () {
|
1276
|
-
return function () {
|
1277
|
-
pcent += (100 - pcent) / velocity;
|
1278
|
-
|
1279
|
-
animat[0] = x + ((pcent / 100) * ix1);
|
1280
|
-
animat[1] = y + ((pcent / 100) * iy1);
|
1281
|
-
animat[2] = x2 + ((pcent / 100) * ix2);
|
1282
|
-
animat[3] = y2 + ((pcent / 100) * iy2);
|
1283
|
-
|
1284
|
-
if (pcent >= 99.8) {
|
1285
|
-
pcent = 100;
|
1286
|
-
}
|
1287
|
-
if (pcent < 100) {
|
1288
|
-
setSelectRaw(animat);
|
1289
|
-
queueAnimator();
|
1290
|
-
} else {
|
1291
|
-
Selection.done();
|
1292
|
-
if (typeof(callback) === 'function') {
|
1293
|
-
callback.call(api);
|
1294
|
-
}
|
1295
|
-
}
|
1296
|
-
};
|
1297
|
-
}());
|
1298
|
-
queueAnimator();
|
1299
|
-
}
|
1300
|
-
//}}}
|
1301
|
-
function setSelect(rect) //{{{
|
1302
|
-
{
|
1303
|
-
setSelectRaw([
|
1304
|
-
parseInt(rect[0], 10) / xscale, parseInt(rect[1], 10) / yscale, parseInt(rect[2], 10) / xscale, parseInt(rect[3], 10) / yscale]);
|
1305
|
-
}
|
1306
|
-
//}}}
|
1307
|
-
function setSelectRaw(l) //{{{
|
1308
|
-
{
|
1309
|
-
Coords.setPressed([l[0], l[1]]);
|
1310
|
-
Coords.setCurrent([l[2], l[3]]);
|
1311
|
-
Selection.update();
|
1312
|
-
}
|
1313
|
-
//}}}
|
1314
|
-
function tellSelect() //{{{
|
1315
|
-
{
|
1316
|
-
return unscale(Coords.getFixed());
|
1317
|
-
}
|
1318
|
-
//}}}
|
1319
|
-
function tellScaled() //{{{
|
1320
|
-
{
|
1321
|
-
return Coords.getFixed();
|
1322
|
-
}
|
1323
|
-
//}}}
|
1324
|
-
function setOptionsNew(opt) //{{{
|
1325
|
-
{
|
1326
|
-
setOptions(opt);
|
1327
|
-
interfaceUpdate();
|
1328
|
-
}
|
1329
|
-
//}}}
|
1330
|
-
function disableCrop() //{{{
|
1331
|
-
{
|
1332
|
-
options.disabled = true;
|
1333
|
-
Selection.disableHandles();
|
1334
|
-
Selection.setCursor('default');
|
1335
|
-
Tracker.setCursor('default');
|
1336
|
-
}
|
1337
|
-
//}}}
|
1338
|
-
function enableCrop() //{{{
|
1339
|
-
{
|
1340
|
-
options.disabled = false;
|
1341
|
-
interfaceUpdate();
|
1342
|
-
}
|
1343
|
-
//}}}
|
1344
|
-
function cancelCrop() //{{{
|
1345
|
-
{
|
1346
|
-
Selection.done();
|
1347
|
-
Tracker.activateHandlers(null, null);
|
1348
|
-
}
|
1349
|
-
//}}}
|
1350
|
-
function destroy() //{{{
|
1351
|
-
{
|
1352
|
-
$div.remove();
|
1353
|
-
$origimg.show();
|
1354
|
-
$(obj).removeData('Jcrop');
|
1355
|
-
}
|
1356
|
-
//}}}
|
1357
|
-
function setImage(src, callback) //{{{
|
1358
|
-
{
|
1359
|
-
Selection.release();
|
1360
|
-
disableCrop();
|
1361
|
-
var img = new Image();
|
1362
|
-
img.onload = function () {
|
1363
|
-
var iw = img.width;
|
1364
|
-
var ih = img.height;
|
1365
|
-
var bw = options.boxWidth;
|
1366
|
-
var bh = options.boxHeight;
|
1367
|
-
$img.width(iw).height(ih);
|
1368
|
-
$img.attr('src', src);
|
1369
|
-
$img2.attr('src', src);
|
1370
|
-
presize($img, bw, bh);
|
1371
|
-
boundx = $img.width();
|
1372
|
-
boundy = $img.height();
|
1373
|
-
$img2.width(boundx).height(boundy);
|
1374
|
-
$trk.width(boundx + (bound * 2)).height(boundy + (bound * 2));
|
1375
|
-
$div.width(boundx).height(boundy);
|
1376
|
-
enableCrop();
|
1377
|
-
|
1378
|
-
if (typeof(callback) === 'function') {
|
1379
|
-
callback.call(api);
|
1380
|
-
}
|
1381
|
-
};
|
1382
|
-
img.src = src;
|
1383
|
-
}
|
1384
|
-
//}}}
|
1385
|
-
function interfaceUpdate(alt) //{{{
|
1386
|
-
// This method tweaks the interface based on options object.
|
1387
|
-
// Called when options are changed and at end of initialization.
|
1388
|
-
{
|
1389
|
-
if (options.allowResize) {
|
1390
|
-
if (alt) {
|
1391
|
-
Selection.enableOnly();
|
1392
|
-
} else {
|
1393
|
-
Selection.enableHandles();
|
1394
|
-
}
|
1395
|
-
} else {
|
1396
|
-
Selection.disableHandles();
|
1397
|
-
}
|
1398
|
-
|
1399
|
-
Tracker.setCursor(options.allowSelect ? 'crosshair' : 'default');
|
1400
|
-
Selection.setCursor(options.allowMove ? 'move' : 'default');
|
1401
|
-
|
1402
|
-
|
1403
|
-
if (options.hasOwnProperty('setSelect')) {
|
1404
|
-
setSelect(options.setSelect);
|
1405
|
-
Selection.done();
|
1406
|
-
delete(options.setSelect);
|
1407
|
-
}
|
1408
|
-
|
1409
|
-
if (options.hasOwnProperty('trueSize')) {
|
1410
|
-
xscale = options.trueSize[0] / boundx;
|
1411
|
-
yscale = options.trueSize[1] / boundy;
|
1412
|
-
}
|
1413
|
-
if (options.hasOwnProperty('bgColor')) {
|
1414
|
-
|
1415
|
-
if (supportsColorFade() && options.fadeTime) {
|
1416
|
-
$div.animate({
|
1417
|
-
backgroundColor: options.bgColor
|
1418
|
-
}, {
|
1419
|
-
queue: false,
|
1420
|
-
duration: options.fadeTime
|
1421
|
-
});
|
1422
|
-
} else {
|
1423
|
-
$div.css('backgroundColor', options.bgColor);
|
1424
|
-
}
|
1425
|
-
|
1426
|
-
delete(options.bgColor);
|
1427
|
-
}
|
1428
|
-
if (options.hasOwnProperty('bgOpacity')) {
|
1429
|
-
bgopacity = options.bgOpacity;
|
1430
|
-
|
1431
|
-
if (Selection.isAwake()) {
|
1432
|
-
if (options.fadeTime) {
|
1433
|
-
$img.fadeTo(options.fadeTime, bgopacity);
|
1434
|
-
} else {
|
1435
|
-
$div.css('opacity', options.opacity);
|
1436
|
-
}
|
1437
|
-
}
|
1438
|
-
delete(options.bgOpacity);
|
1439
|
-
}
|
1440
|
-
|
1441
|
-
xlimit = options.maxSize[0] || 0;
|
1442
|
-
ylimit = options.maxSize[1] || 0;
|
1443
|
-
xmin = options.minSize[0] || 0;
|
1444
|
-
ymin = options.minSize[1] || 0;
|
1445
|
-
|
1446
|
-
if (options.hasOwnProperty('outerImage')) {
|
1447
|
-
$img.attr('src', options.outerImage);
|
1448
|
-
delete(options.outerImage);
|
1449
|
-
}
|
1450
|
-
|
1451
|
-
Selection.refresh();
|
1452
|
-
}
|
1453
|
-
//}}}
|
1454
|
-
//}}}
|
1455
|
-
|
1456
|
-
if (Touch.support) {
|
1457
|
-
$trk.bind('touchstart', Touch.newSelection);
|
1458
|
-
}
|
1459
|
-
|
1460
|
-
$hdl_holder.hide();
|
1461
|
-
interfaceUpdate(true);
|
1462
|
-
|
1463
|
-
var api = {
|
1464
|
-
setImage: setImage,
|
1465
|
-
animateTo: animateTo,
|
1466
|
-
setSelect: setSelect,
|
1467
|
-
setOptions: setOptionsNew,
|
1468
|
-
tellSelect: tellSelect,
|
1469
|
-
tellScaled: tellScaled,
|
1470
|
-
setClass: setClass,
|
1471
|
-
|
1472
|
-
disable: disableCrop,
|
1473
|
-
enable: enableCrop,
|
1474
|
-
cancel: cancelCrop,
|
1475
|
-
release: Selection.release,
|
1476
|
-
destroy: destroy,
|
1477
|
-
|
1478
|
-
focus: KeyManager.watchKeys,
|
1479
|
-
|
1480
|
-
getBounds: function () {
|
1481
|
-
return [boundx * xscale, boundy * yscale];
|
1482
|
-
},
|
1483
|
-
getWidgetSize: function () {
|
1484
|
-
return [boundx, boundy];
|
1485
|
-
},
|
1486
|
-
getScaleFactor: function () {
|
1487
|
-
return [xscale, yscale];
|
1488
|
-
},
|
1489
|
-
|
1490
|
-
ui: {
|
1491
|
-
holder: $div,
|
1492
|
-
selection: $sel
|
1493
|
-
}
|
1494
|
-
};
|
1495
|
-
|
1496
|
-
if ($.browser.msie) {
|
1497
|
-
$div.bind('selectstart', function () {
|
1498
|
-
return false;
|
1499
|
-
});
|
1500
|
-
}
|
1501
|
-
|
1502
|
-
$origimg.data('Jcrop', api);
|
1503
|
-
return api;
|
1504
|
-
};
|
1505
|
-
$.fn.Jcrop = function (options, callback) //{{{
|
1506
|
-
{
|
1507
|
-
|
1508
|
-
function attachWhenDone(from) //{{{
|
1509
|
-
{
|
1510
|
-
var opt = (typeof(options) === 'object') ? options : {};
|
1511
|
-
var loadsrc = opt.useImg || from.src;
|
1512
|
-
var img = new Image();
|
1513
|
-
img.onload = function () {
|
1514
|
-
function attachJcrop() {
|
1515
|
-
var api = $.Jcrop(from, opt);
|
1516
|
-
if (typeof(callback) === 'function') {
|
1517
|
-
callback.call(api);
|
1518
|
-
}
|
1519
|
-
}
|
1520
|
-
|
1521
|
-
function attachAttempt() {
|
1522
|
-
if (!img.width || !img.height) {
|
1523
|
-
window.setTimeout(attachAttempt, 50);
|
1524
|
-
} else {
|
1525
|
-
attachJcrop();
|
1526
|
-
}
|
1527
|
-
}
|
1528
|
-
window.setTimeout(attachAttempt, 50);
|
1529
|
-
};
|
1530
|
-
img.src = loadsrc;
|
1531
|
-
}
|
1532
|
-
//}}}
|
1533
|
-
|
1534
|
-
// Iterate over each object, attach Jcrop
|
1535
|
-
this.each(function () {
|
1536
|
-
// If we've already attached to this object
|
1537
|
-
if ($(this).data('Jcrop')) {
|
1538
|
-
// The API can be requested this way (undocumented)
|
1539
|
-
if (options === 'api') {
|
1540
|
-
return $(this).data('Jcrop');
|
1541
|
-
}
|
1542
|
-
// Otherwise, we just reset the options...
|
1543
|
-
else {
|
1544
|
-
$(this).data('Jcrop').setOptions(options);
|
1545
|
-
}
|
1546
|
-
}
|
1547
|
-
// If we haven't been attached, preload and attach
|
1548
|
-
else {
|
1549
|
-
attachWhenDone(this);
|
1550
|
-
}
|
1551
|
-
});
|
1552
|
-
|
1553
|
-
// Return "this" so the object is chainable (jQuery-style)
|
1554
|
-
return this;
|
1555
|
-
};
|
1556
|
-
//}}}
|
1557
|
-
// Global Defaults {{{
|
1558
|
-
$.Jcrop.defaults = {
|
1559
|
-
|
1560
|
-
// Basic Settings
|
1561
|
-
allowSelect: true,
|
1562
|
-
allowMove: true,
|
1563
|
-
allowResize: true,
|
1564
|
-
|
1565
|
-
trackDocument: true,
|
1566
|
-
|
1567
|
-
// Styling Options
|
1568
|
-
baseClass: 'jcrop',
|
1569
|
-
addClass: null,
|
1570
|
-
bgColor: 'black',
|
1571
|
-
bgOpacity: 0.6,
|
1572
|
-
bgFade: false,
|
1573
|
-
borderOpacity: 0.4,
|
1574
|
-
handleOpacity: 0.5,
|
1575
|
-
handleSize: 9,
|
1576
|
-
handleOffset: 5,
|
1577
|
-
|
1578
|
-
aspectRatio: 0,
|
1579
|
-
keySupport: true,
|
1580
|
-
cornerHandles: true,
|
1581
|
-
sideHandles: true,
|
1582
|
-
drawBorders: true,
|
1583
|
-
dragEdges: true,
|
1584
|
-
fixedSupport: true,
|
1585
|
-
touchSupport: null,
|
1586
|
-
|
1587
|
-
boxWidth: 0,
|
1588
|
-
boxHeight: 0,
|
1589
|
-
boundary: 2,
|
1590
|
-
fadeTime: 400,
|
1591
|
-
animationDelay: 20,
|
1592
|
-
swingSpeed: 3,
|
1593
|
-
|
1594
|
-
minSelect: [0, 0],
|
1595
|
-
maxSize: [0, 0],
|
1596
|
-
minSize: [0, 0],
|
1597
|
-
|
1598
|
-
// Callbacks / Event Handlers
|
1599
|
-
onChange: function () {},
|
1600
|
-
onSelect: function () {},
|
1601
|
-
onRelease: function () {}
|
1602
|
-
};
|
1603
|
-
|
1604
|
-
// }}}
|
1605
|
-
}(jQuery));
|