kirgudu_base 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/MIT-LICENSE +20 -0
- data/README.rdoc +3 -0
- data/Rakefile +40 -0
- data/app/assets/images/kirgudu_base/404-fry.png +0 -0
- data/app/assets/images/kirgudu_base/Documents.gif +0 -0
- data/app/assets/images/kirgudu_base/Meetings.gif +0 -0
- data/app/assets/images/kirgudu_base/Repair.gif +0 -0
- data/app/assets/images/kirgudu_base/ajax-loader.gif +0 -0
- data/app/assets/images/kirgudu_base/alpha.png +0 -0
- data/app/assets/images/kirgudu_base/alpha2.png +0 -0
- data/app/assets/images/kirgudu_base/arrow.png +0 -0
- data/app/assets/images/kirgudu_base/box.gif +0 -0
- data/app/assets/images/kirgudu_base/chosen-sprite.png +0 -0
- data/app/assets/images/kirgudu_base/company_pxg.png +0 -0
- data/app/assets/images/kirgudu_base/datatables/back_disabled.png +0 -0
- data/app/assets/images/kirgudu_base/datatables/back_enabled.png +0 -0
- data/app/assets/images/kirgudu_base/datatables/back_enabled_hover.png +0 -0
- data/app/assets/images/kirgudu_base/datatables/forward_disabled.png +0 -0
- data/app/assets/images/kirgudu_base/datatables/forward_enabled.png +0 -0
- data/app/assets/images/kirgudu_base/datatables/forward_enabled_hover.png +0 -0
- data/app/assets/images/kirgudu_base/datatables/sort_asc.png +0 -0
- data/app/assets/images/kirgudu_base/datatables/sort_asc_disabled.png +0 -0
- data/app/assets/images/kirgudu_base/datatables/sort_both.png +0 -0
- data/app/assets/images/kirgudu_base/datatables/sort_desc.png +0 -0
- data/app/assets/images/kirgudu_base/datatables/sort_desc_disabled.png +0 -0
- data/app/assets/images/kirgudu_base/fancybox/blank.gif +0 -0
- data/app/assets/images/kirgudu_base/fancybox/fancybox_buttons.png +0 -0
- data/app/assets/images/kirgudu_base/fancybox/fancybox_loading.gif +0 -0
- data/app/assets/images/kirgudu_base/fancybox/fancybox_overlay.png +0 -0
- data/app/assets/images/kirgudu_base/fancybox/fancybox_sprite.png +0 -0
- data/app/assets/images/kirgudu_base/favicon.png +0 -0
- data/app/assets/images/kirgudu_base/general/clock.png +0 -0
- data/app/assets/images/kirgudu_base/general/clock2.png +0 -0
- data/app/assets/images/kirgudu_base/general/coffee.png +0 -0
- data/app/assets/images/kirgudu_base/general/coffee2.png +0 -0
- data/app/assets/images/kirgudu_base/general/flipchart.png +0 -0
- data/app/assets/images/kirgudu_base/general/flipchart2.png +0 -0
- data/app/assets/images/kirgudu_base/general/sun.png +0 -0
- data/app/assets/images/kirgudu_base/general/sun2.png +0 -0
- data/app/assets/images/kirgudu_base/glyphicons-halflings-white.png +0 -0
- data/app/assets/images/kirgudu_base/glyphicons-halflings.png +0 -0
- data/app/assets/images/kirgudu_base/gradient1.png +0 -0
- data/app/assets/images/kirgudu_base/hue2.png +0 -0
- data/app/assets/images/kirgudu_base/ico_16_4_d.gif +0 -0
- data/app/assets/images/kirgudu_base/ico_18_1010.gif +0 -0
- data/app/assets/images/kirgudu_base/ico_18_112.gif +0 -0
- data/app/assets/images/kirgudu_base/ico_18_2020.gif +0 -0
- data/app/assets/images/kirgudu_base/icon-contacts.gif +0 -0
- data/app/assets/images/kirgudu_base/icon-employees.gif +0 -0
- data/app/assets/images/kirgudu_base/icon-list.gif +0 -0
- data/app/assets/images/kirgudu_base/icon-orders-green.gif +0 -0
- data/app/assets/images/kirgudu_base/icon-orders.gif +0 -0
- data/app/assets/images/kirgudu_base/icon-tenders.gif +0 -0
- data/app/assets/images/kirgudu_base/icons-sa7c41345d9.png +0 -0
- data/app/assets/images/kirgudu_base/login-corner.png +0 -0
- data/app/assets/images/kirgudu_base/login-corner2.png +0 -0
- data/app/assets/images/kirgudu_base/logo.png +0 -0
- data/app/assets/images/kirgudu_base/maps/m1.png +0 -0
- data/app/assets/images/kirgudu_base/maps/m2.png +0 -0
- data/app/assets/images/kirgudu_base/maps/m3.png +0 -0
- data/app/assets/images/kirgudu_base/meeting-schedule.gif +0 -0
- data/app/assets/images/kirgudu_base/menu_icons/calendar.png +0 -0
- data/app/assets/images/kirgudu_base/menu_icons/dashboard.png +0 -0
- data/app/assets/images/kirgudu_base/menu_icons/forms.png +0 -0
- data/app/assets/images/kirgudu_base/menu_icons/gallery.png +0 -0
- data/app/assets/images/kirgudu_base/menu_icons/grid.png +0 -0
- data/app/assets/images/kirgudu_base/menu_icons/maps.png +0 -0
- data/app/assets/images/kirgudu_base/menu_icons/others.png +0 -0
- data/app/assets/images/kirgudu_base/menu_icons/statistics.png +0 -0
- data/app/assets/images/kirgudu_base/menu_icons/tables.png +0 -0
- data/app/assets/images/kirgudu_base/menu_icons/widgets.png +0 -0
- data/app/assets/images/kirgudu_base/menu_top/profile-avatar.png +0 -0
- data/app/assets/images/kirgudu_base/menu_top/profile-messages.png +0 -0
- data/app/assets/images/kirgudu_base/message_avatar1.png +0 -0
- data/app/assets/images/kirgudu_base/message_avatar2.png +0 -0
- data/app/assets/images/kirgudu_base/message_avatar3.png +0 -0
- data/app/assets/images/kirgudu_base/message_avatar4.png +0 -0
- data/app/assets/images/kirgudu_base/message_avatar5.png +0 -0
- data/app/assets/images/kirgudu_base/message_avatar6.png +0 -0
- data/app/assets/images/kirgudu_base/message_avatar7.png +0 -0
- data/app/assets/images/kirgudu_base/news-icon-16.gif +0 -0
- data/app/assets/images/kirgudu_base/operator-def.png +0 -0
- data/app/assets/images/kirgudu_base/patterns/bg_dark.png +0 -0
- data/app/assets/images/kirgudu_base/patterns/bg_dark2.png +0 -0
- data/app/assets/images/kirgudu_base/patterns/bg_dark3.png +0 -0
- data/app/assets/images/kirgudu_base/patterns/whitey.png +0 -0
- data/app/assets/images/kirgudu_base/people-16-16-256.gif +0 -0
- data/app/assets/images/kirgudu_base/sales_24x24 (1).gif +0 -0
- data/app/assets/images/kirgudu_base/sample_avatar_big.jpg +0 -0
- data/app/assets/images/kirgudu_base/saturation2.png +0 -0
- data/app/assets/images/kirgudu_base/search.png +0 -0
- data/app/assets/images/kirgudu_base/toggle.png +0 -0
- data/app/assets/images/kirgudu_base/ui-bg_fine-grain_10_e7e7e7_60x60.png +0 -0
- data/app/assets/images/kirgudu_base/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/app/assets/images/kirgudu_base/ui-bg_flat_0_ef4622_40x100.png +0 -0
- data/app/assets/images/kirgudu_base/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/app/assets/images/kirgudu_base/ui-bg_highlight-hard_100_e1e1e1_1x100.png +0 -0
- data/app/assets/images/kirgudu_base/ui-bg_highlight-hard_100_eeeeee_1x100.png +0 -0
- data/app/assets/images/kirgudu_base/ui-bg_highlight-hard_75_dddddd_1x100.png +0 -0
- data/app/assets/images/kirgudu_base/ui-bg_inset-soft_95_fef1ec_1x100.png +0 -0
- data/app/assets/images/kirgudu_base/ui-icons_454545_256x240.png +0 -0
- data/app/assets/images/kirgudu_base/ui-icons_525d66_256x240.png +0 -0
- data/app/assets/images/kirgudu_base/ui-icons_cd0a0a_256x240.png +0 -0
- data/app/assets/images/kirgudu_base/ui-icons_ffffff_256x240.png +0 -0
- data/app/assets/images/kirgudu_base/uploadify-cancel.png +0 -0
- data/app/assets/javascripts/kirgudu_base/ajax_form.js +52 -0
- data/app/assets/javascripts/kirgudu_base/application.js +15 -0
- data/app/assets/javascripts/kirgudu_base/avgrund.js +85 -0
- data/app/assets/javascripts/kirgudu_base/bootstrap-alert.js +90 -0
- data/app/assets/javascripts/kirgudu_base/bootstrap-button.js +96 -0
- data/app/assets/javascripts/kirgudu_base/bootstrap-carousel.js +176 -0
- data/app/assets/javascripts/kirgudu_base/bootstrap-collapse.js +158 -0
- data/app/assets/javascripts/kirgudu_base/bootstrap-colorpicker.js +520 -0
- data/app/assets/javascripts/kirgudu_base/bootstrap-datepicker.js +401 -0
- data/app/assets/javascripts/kirgudu_base/bootstrap-dropdown.js +150 -0
- data/app/assets/javascripts/kirgudu_base/bootstrap-modal.js +239 -0
- data/app/assets/javascripts/kirgudu_base/bootstrap-popover.js +103 -0
- data/app/assets/javascripts/kirgudu_base/bootstrap-scrollspy.js +151 -0
- data/app/assets/javascripts/kirgudu_base/bootstrap-tab.js +135 -0
- data/app/assets/javascripts/kirgudu_base/bootstrap-tooltip.js +275 -0
- data/app/assets/javascripts/kirgudu_base/bootstrap-transition.js +60 -0
- data/app/assets/javascripts/kirgudu_base/bootstrap-typeahead.js +300 -0
- data/app/assets/javascripts/kirgudu_base/bootstrap-wysihtml5.js +458 -0
- data/app/assets/javascripts/kirgudu_base/bootstrap.js +6 -0
- data/app/assets/javascripts/kirgudu_base/character-limit.js +18 -0
- data/app/assets/javascripts/kirgudu_base/chosen.jquery.min.js +10 -0
- data/app/assets/javascripts/kirgudu_base/client_main.js +1017 -0
- data/app/assets/javascripts/kirgudu_base/delete.js +67 -0
- data/app/assets/javascripts/kirgudu_base/excanvas.compiled.js +35 -0
- data/app/assets/javascripts/kirgudu_base/fileinput.jquery.js +98 -0
- data/app/assets/javascripts/kirgudu_base/fullcalendar.js +5220 -0
- data/app/assets/javascripts/kirgudu_base/gmap3.min.js +39 -0
- data/app/assets/javascripts/kirgudu_base/highcharts.js +246 -0
- data/app/assets/javascripts/kirgudu_base/jdpicker.js +555 -0
- data/app/assets/javascripts/kirgudu_base/jnavigate.jquery.min.js +2 -0
- data/app/assets/javascripts/kirgudu_base/jquery-ui-1.8.23.custom.min.js +125 -0
- data/app/assets/javascripts/kirgudu_base/jquery-ui-1.8.23.custom.min_d9931121.js +125 -0
- data/app/assets/javascripts/kirgudu_base/jquery.blockUI.js +534 -0
- data/app/assets/javascripts/kirgudu_base/jquery.bookblock.js +533 -0
- data/app/assets/javascripts/kirgudu_base/jquery.cookie.js +94 -0
- data/app/assets/javascripts/kirgudu_base/jquery.dataTables.js +12092 -0
- data/app/assets/javascripts/kirgudu_base/jquery.endless-scroll.js +343 -0
- data/app/assets/javascripts/kirgudu_base/jquery.fancybox-buttons.js +121 -0
- data/app/assets/javascripts/kirgudu_base/jquery.fancybox-media.js +196 -0
- data/app/assets/javascripts/kirgudu_base/jquery.fancybox-thumbs.js +162 -0
- data/app/assets/javascripts/kirgudu_base/jquery.fancybox.js +1985 -0
- data/app/assets/javascripts/kirgudu_base/jquery.flot.crosshair.js +167 -0
- data/app/assets/javascripts/kirgudu_base/jquery.flot.js +2599 -0
- data/app/assets/javascripts/kirgudu_base/jquery.flot.pie.js +751 -0
- data/app/assets/javascripts/kirgudu_base/jquery.flot.resize.js +60 -0
- data/app/assets/javascripts/kirgudu_base/jquery.flot.spider.js +314 -0
- data/app/assets/javascripts/kirgudu_base/jquery.flot.stack.js +184 -0
- data/app/assets/javascripts/kirgudu_base/jquery.history.js +1 -0
- data/app/assets/javascripts/kirgudu_base/jquery.jcarousel.min.js +16 -0
- data/app/assets/javascripts/kirgudu_base/jquery.jeditable.js +543 -0
- data/app/assets/javascripts/kirgudu_base/jquery.js +2 -0
- data/app/assets/javascripts/kirgudu_base/jquery.json-2.3.min.js +23 -0
- data/app/assets/javascripts/kirgudu_base/jquery.maskedinput-1.3.js +258 -0
- data/app/assets/javascripts/kirgudu_base/jquery.mousewheel-min.js +12 -0
- data/app/assets/javascripts/kirgudu_base/jquery.peity.min.js +11 -0
- data/app/assets/javascripts/kirgudu_base/jquery.simplemodal-1.4.4.js +716 -0
- data/app/assets/javascripts/kirgudu_base/jquery.slides.min.js +7 -0
- data/app/assets/javascripts/kirgudu_base/jquery.sparkline.min.js +5 -0
- data/app/assets/javascripts/kirgudu_base/jquery.tagsinput.js +354 -0
- data/app/assets/javascripts/kirgudu_base/jquery.tools.min.js +17 -0
- data/app/assets/javascripts/kirgudu_base/jquery.touchdown.js +54 -0
- data/app/assets/javascripts/kirgudu_base/jquery.uniform.min.js +17 -0
- data/app/assets/javascripts/kirgudu_base/jquery.uploadify-3.1.js +975 -0
- data/app/assets/javascripts/kirgudu_base/jquery.uploadify.min.js +16 -0
- data/app/assets/javascripts/kirgudu_base/jquery.url-2.0.js +174 -0
- data/app/assets/javascripts/kirgudu_base/jquery.validate.min.js +4 -0
- data/app/assets/javascripts/kirgudu_base/jquerypp.custom.js +301 -0
- data/app/assets/javascripts/kirgudu_base/justgage.1.0.1.min.js +12 -0
- data/app/assets/javascripts/kirgudu_base/main.js +157 -0
- data/app/assets/javascripts/kirgudu_base/modernizr.custom.32549.js +815 -0
- data/app/assets/javascripts/kirgudu_base/mustache.js +532 -0
- data/app/assets/javascripts/kirgudu_base/popbox.js +57 -0
- data/app/assets/javascripts/kirgudu_base/raphael.2.1.0.min.js +10 -0
- data/app/assets/javascripts/kirgudu_base/scripts.js +1277 -0
- data/app/assets/javascripts/kirgudu_base/scripts_OLD.js +204 -0
- data/app/assets/javascripts/kirgudu_base/sub_select.js +50 -0
- data/app/assets/javascripts/kirgudu_base/swfobject.js +5 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shAutoloader.js +17 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushAS3.js +59 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushAppleScript.js +75 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushBash.js +59 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushCSharp.js +65 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushColdFusion.js +100 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushCpp.js +97 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushCss.js +91 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushDelphi.js +55 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushDiff.js +41 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushErlang.js +52 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushGroovy.js +67 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushJScript.js +52 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushJava.js +57 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushJavaFX.js +58 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushPerl.js +72 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushPhp.js +88 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushPlain.js +33 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushPowerShell.js +74 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushPython.js +64 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushRuby.js +55 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushSass.js +94 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushScala.js +51 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushSql.js +66 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushVb.js +56 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shBrushXml.js +69 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shCore.js +17 -0
- data/app/assets/javascripts/kirgudu_base/syntax-highlighter/shLegacy.js +17 -0
- data/app/assets/javascripts/kirgudu_base/textarea-autogrow.js +55 -0
- data/app/assets/javascripts/kirgudu_base/tiny_mce.js +1 -0
- data/app/assets/javascripts/kirgudu_base/watch.js +81 -0
- data/app/assets/javascripts/kirgudu_base/web/inputPlaceholder.js +82 -0
- data/app/assets/javascripts/kirgudu_base/web/js.js +91 -0
- data/app/assets/javascripts/kirgudu_base/web/navigate.js +20 -0
- data/app/assets/javascripts/kirgudu_base/web/watch.js +1706 -0
- data/app/assets/javascripts/kirgudu_base/wysihtml5-0.3.0.min.js +261 -0
- data/app/assets/stylesheets/kirgudu_base/bootstrap.css +4551 -0
- data/app/assets/stylesheets/kirgudu_base/chosen.css +397 -0
- data/app/assets/stylesheets/kirgudu_base/fullcalendar.css +655 -0
- data/app/assets/stylesheets/kirgudu_base/info-message.css +79 -0
- data/app/assets/stylesheets/kirgudu_base/jdpicker.css +200 -0
- data/app/assets/stylesheets/kirgudu_base/jquery-ui-1.8.23.custom.css +1235 -0
- data/app/assets/stylesheets/kirgudu_base/jquery.fancybox-buttons.css +96 -0
- data/app/assets/stylesheets/kirgudu_base/jquery.fancybox-thumbs.css +54 -0
- data/app/assets/stylesheets/kirgudu_base/jquery.fancybox.css +249 -0
- data/app/assets/stylesheets/kirgudu_base/jquery.tagsinput.css +7 -0
- data/app/assets/stylesheets/kirgudu_base/main.css +1368 -0
- data/app/assets/stylesheets/kirgudu_base/menu.css +159 -0
- data/app/assets/stylesheets/kirgudu_base/popbox.css +58 -0
- data/app/assets/stylesheets/kirgudu_base/responsive.css +2249 -0
- data/app/assets/stylesheets/kirgudu_base/switcher.css +80 -0
- data/app/assets/stylesheets/kirgudu_base/syntax-higlignter/shCore.css +226 -0
- data/app/assets/stylesheets/kirgudu_base/syntax-higlignter/shCoreDefault.css +328 -0
- data/app/assets/stylesheets/kirgudu_base/syntax-higlignter/shCoreDjango.css +331 -0
- data/app/assets/stylesheets/kirgudu_base/syntax-higlignter/shCoreEclipse.css +339 -0
- data/app/assets/stylesheets/kirgudu_base/syntax-higlignter/shCoreEmacs.css +324 -0
- data/app/assets/stylesheets/kirgudu_base/syntax-higlignter/shCoreFadeToGrey.css +328 -0
- data/app/assets/stylesheets/kirgudu_base/syntax-higlignter/shCoreMDUltra.css +324 -0
- data/app/assets/stylesheets/kirgudu_base/syntax-higlignter/shCoreMidnight.css +324 -0
- data/app/assets/stylesheets/kirgudu_base/syntax-higlignter/shCoreRDark.css +324 -0
- data/app/assets/stylesheets/kirgudu_base/syntax-higlignter/shThemeDefault.css +117 -0
- data/app/assets/stylesheets/kirgudu_base/syntax-higlignter/shThemeDjango.css +120 -0
- data/app/assets/stylesheets/kirgudu_base/syntax-higlignter/shThemeEclipse.css +128 -0
- data/app/assets/stylesheets/kirgudu_base/syntax-higlignter/shThemeEmacs.css +113 -0
- data/app/assets/stylesheets/kirgudu_base/syntax-higlignter/shThemeFadeToGrey.css +117 -0
- data/app/assets/stylesheets/kirgudu_base/syntax-higlignter/shThemeMDUltra.css +113 -0
- data/app/assets/stylesheets/kirgudu_base/syntax-higlignter/shThemeMidnight.css +113 -0
- data/app/assets/stylesheets/kirgudu_base/syntax-higlignter/shThemeRDark.css +113 -0
- data/app/assets/stylesheets/kirgudu_base/uploadify.css +92 -0
- data/app/controllers/kirgudu_base/admin_controller.rb +91 -0
- data/app/controllers/kirgudu_base/application_controller.rb +676 -0
- data/app/controllers/kirgudu_base/cabinet_controller.rb +93 -0
- data/app/controllers/kirgudu_base/facade_controller.rb +82 -0
- data/app/helpers/kirgudu_base/application_helper.rb +486 -0
- data/app/helpers/kirgudu_base/breadcrumbs_helper.rb +27 -0
- data/app/helpers/kirgudu_base/class_helper.rb +32 -0
- data/app/helpers/kirgudu_base/controllers/basic_actions.rb +625 -0
- data/app/helpers/kirgudu_base/controllers/container_items_management_actions.rb +118 -0
- data/app/helpers/kirgudu_base/controllers/container_items_sorting_actions.rb +64 -0
- data/app/helpers/kirgudu_base/controllers/dynamic_pages.rb +30 -0
- data/app/helpers/kirgudu_base/controllers/obligatory_filters.rb +29 -0
- data/app/helpers/kirgudu_base/controllers/transaction_wrapper.rb +138 -0
- data/app/helpers/kirgudu_base/form_builder.rb +474 -0
- data/app/helpers/kirgudu_base/gui_helper.rb +443 -0
- data/app/helpers/kirgudu_base/models/basic_management_urls.rb +104 -0
- data/app/helpers/kirgudu_base/models/data_filter.rb +236 -0
- data/app/helpers/kirgudu_base/models/exports.rb +167 -0
- data/app/helpers/kirgudu_base/models/filters.rb +32 -0
- data/app/helpers/kirgudu_base/models/form_properties.rb +108 -0
- data/app/helpers/kirgudu_base/models/form_property.rb +335 -0
- data/app/helpers/kirgudu_base/models/methods.rb +64 -0
- data/app/helpers/kirgudu_base/models/scopes.rb +157 -0
- data/app/helpers/kirgudu_base/models/sorting.rb +99 -0
- data/app/helpers/kirgudu_base/models/standard_actions.rb +50 -0
- data/app/helpers/kirgudu_base/models/uncloneable_properties.rb +21 -0
- data/app/helpers/kirgudu_base/old_form_builder.rb +340 -0
- data/app/helpers/kirgudu_base/url_helper.rb +18 -0
- data/app/models/kirgudu_base/base_model.rb +293 -0
- data/app/models/kirgudu_base/dynamic_pages/action_for.rb +78 -0
- data/app/models/kirgudu_base/dynamic_pages/action_for_builder.rb +46 -0
- data/app/models/kirgudu_base/dynamic_pages/data_source.rb +111 -0
- data/app/models/kirgudu_base/dynamic_pages/data_source_builder.rb +79 -0
- data/app/models/kirgudu_base/dynamic_pages/form.rb +99 -0
- data/app/models/kirgudu_base/dynamic_pages/form_builder.rb +85 -0
- data/app/models/kirgudu_base/dynamic_pages/input_type.rb +17 -0
- data/app/models/kirgudu_base/dynamic_pages/on_change.rb +40 -0
- data/app/models/kirgudu_base/dynamic_pages/on_change_builder.rb +38 -0
- data/app/models/kirgudu_base/dynamic_pages/page.rb +55 -0
- data/app/models/kirgudu_base/dynamic_pages/page_builder.rb +63 -0
- data/app/models/kirgudu_base/dynamic_pages/property.rb +185 -0
- data/app/models/kirgudu_base/dynamic_pages/property_builder.rb +123 -0
- data/app/models/kirgudu_base/template.rb +6 -0
- data/app/models/kirgudu_base/template_element.rb +6 -0
- data/app/views/layouts/kirgudu_base/application.html.erb +141 -0
- data/app/views/shared/kirgudu_base/_body_javascripts_files.html.erb +71 -0
- data/app/views/shared/kirgudu_base/_body_javascripts_scripts.html.erb +1099 -0
- data/app/views/shared/kirgudu_base/_breadcrumbs.html.erb +36 -0
- data/app/views/shared/kirgudu_base/_head_javascripts.html.erb +21 -0
- data/app/views/shared/kirgudu_base/_head_stylesheets.html.erb +21 -0
- data/app/views/shared/kirgudu_base/_index_page_filter.html.erb +43 -0
- data/app/views/shared/kirgudu_base/_left_menu_standard_actions.html.erb +57 -0
- data/app/views/shared/kirgudu_base/_services_top_line.html.erb +5 -0
- data/app/views/shared/kirgudu_base/_top_nav_bar.html.erb +58 -0
- data/app/views/shared/kirgudu_base/entry_edit_form_renderer.html.erb +70 -0
- data/app/views/shared/kirgudu_base/entry_index_renderer.html.erb +98 -0
- data/app/views/shared/kirgudu_base/entry_new_form_renderer.html.erb +68 -0
- data/app/views/shared/kirgudu_base/entry_not_found_renderer.html.erb +15 -0
- data/app/views/shared/kirgudu_base/entry_show_renderer.html.erb +28 -0
- data/app/views/shared/kirgudu_base/manage_images/managing_items_index.html.erb +34 -0
- data/app/views/shared/kirgudu_base/manage_images/managing_items_manage.html.erb +72 -0
- data/app/views/shared/kirgudu_base/manage_images/managing_items_sort_index.html.erb +33 -0
- data/app/views/shared/kirgudu_base/manage_items/managing_items_index.html.erb +42 -0
- data/app/views/shared/kirgudu_base/manage_items/managing_items_manage.html.erb +66 -0
- data/app/views/shared/kirgudu_base/manage_items/managing_items_sort_index.html.erb +33 -0
- data/config/routes.rb +3 -0
- data/db/migrate/20131114161828_create_kirgudu_base_templates.rb +17 -0
- data/db/migrate/20131114165013_create_kirgudu_base_template_elements.rb +18 -0
- data/lib/kirgudu_base/engine.rb +6 -0
- data/lib/kirgudu_base/version.rb +4 -0
- data/lib/kirgudu_base.rb +5 -0
- data/lib/tasks/kirgudu_base_tasks.rake +4 -0
- data/test/dummy/README.rdoc +261 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/assets/javascripts/application.js +15 -0
- data/test/dummy/app/assets/stylesheets/application.css +13 -0
- data/test/dummy/app/controllers/application_controller.rb +4 -0
- data/test/dummy/app/helpers/application_helper.rb +3 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/config/application.rb +60 -0
- data/test/dummy/config/boot.rb +11 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +6 -0
- data/test/dummy/config/environments/development.rb +38 -0
- data/test/dummy/config/environments/production.rb +68 -0
- data/test/dummy/config/environments/test.rb +38 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +8 -0
- data/test/dummy/config/initializers/inflections.rb +16 -0
- data/test/dummy/config/initializers/mime_types.rb +6 -0
- data/test/dummy/config/initializers/secret_token.rb +8 -0
- data/test/dummy/config/initializers/session_store.rb +9 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +15 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/routes.rb +5 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +25 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/fixtures/kirgudu_base/template_elements.yml +17 -0
- data/test/fixtures/kirgudu_base/templates.yml +15 -0
- data/test/integration/navigation_test.rb +11 -0
- data/test/kirgudu_base_test.rb +8 -0
- data/test/test_helper.rb +16 -0
- data/test/unit/kirgudu_base/template_element_test.rb +10 -0
- data/test/unit/kirgudu_base/template_test.rb +10 -0
- metadata +492 -0
@@ -0,0 +1,520 @@
|
|
1
|
+
/* =========================================================
|
2
|
+
* bootstrap-colorpicker.js
|
3
|
+
* http://www.eyecon.ro/bootstrap-colorpicker
|
4
|
+
* =========================================================
|
5
|
+
* Copyright 2012 Stefan Petre
|
6
|
+
*
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
* you may not use this file except in compliance with the License.
|
9
|
+
* You may obtain a copy of the License at
|
10
|
+
*
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
*
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
* See the License for the specific language governing permissions and
|
17
|
+
* limitations under the License.
|
18
|
+
* ========================================================= */
|
19
|
+
|
20
|
+
!function( $ ) {
|
21
|
+
|
22
|
+
// Color object
|
23
|
+
|
24
|
+
var Color = function(val) {
|
25
|
+
this.value = {
|
26
|
+
h: 1,
|
27
|
+
s: 1,
|
28
|
+
b: 1,
|
29
|
+
a: 1
|
30
|
+
};
|
31
|
+
this.setColor(val);
|
32
|
+
};
|
33
|
+
|
34
|
+
Color.prototype = {
|
35
|
+
constructor: Color,
|
36
|
+
|
37
|
+
//parse a string to HSB
|
38
|
+
setColor: function(val){
|
39
|
+
val = val.toLowerCase();
|
40
|
+
var that = this;
|
41
|
+
$.each( CPGlobal.stringParsers, function( i, parser ) {
|
42
|
+
var match = parser.re.exec( val ),
|
43
|
+
values = match && parser.parse( match ),
|
44
|
+
space = parser.space||'rgba';
|
45
|
+
if ( values ) {
|
46
|
+
if (space == 'hsla') {
|
47
|
+
that.value = CPGlobal.RGBtoHSB.apply(null, CPGlobal.HSLtoRGB.apply(null, values));
|
48
|
+
} else {
|
49
|
+
that.value = CPGlobal.RGBtoHSB.apply(null, values);
|
50
|
+
}
|
51
|
+
return false;
|
52
|
+
}
|
53
|
+
});
|
54
|
+
},
|
55
|
+
|
56
|
+
setHue: function(h) {
|
57
|
+
this.value.h = 1- h;
|
58
|
+
},
|
59
|
+
|
60
|
+
setSaturation: function(s) {
|
61
|
+
this.value.s = s;
|
62
|
+
},
|
63
|
+
|
64
|
+
setLightness: function(b) {
|
65
|
+
this.value.b = 1- b;
|
66
|
+
},
|
67
|
+
|
68
|
+
setAlpha: function(a) {
|
69
|
+
this.value.a = parseInt((1 - a)*170, 10)/170;
|
70
|
+
},
|
71
|
+
|
72
|
+
// HSBtoRGB from RaphaelJS
|
73
|
+
// https://github.com/DmitryBaranovskiy/raphael/
|
74
|
+
toRGB: function(h, s, b, a) {
|
75
|
+
if (!h) {
|
76
|
+
h = this.value.h;
|
77
|
+
s = this.value.s;
|
78
|
+
b = this.value.b;
|
79
|
+
}
|
80
|
+
h *= 360;
|
81
|
+
var R, G, B, X, C;
|
82
|
+
h = (h % 360) / 60;
|
83
|
+
C = b * s;
|
84
|
+
X = C * (1 - Math.abs(h % 2 - 1));
|
85
|
+
R = G = B = b - C;
|
86
|
+
|
87
|
+
h = ~~h;
|
88
|
+
R += [C, X, 0, 0, X, C][h];
|
89
|
+
G += [X, C, C, X, 0, 0][h];
|
90
|
+
B += [0, 0, X, C, C, X][h];
|
91
|
+
return {
|
92
|
+
r: Math.round(R*255),
|
93
|
+
g: Math.round(G*255),
|
94
|
+
b: Math.round(B*255),
|
95
|
+
a: a||this.value.a
|
96
|
+
};
|
97
|
+
},
|
98
|
+
|
99
|
+
toHex: function(h, s, b, a){
|
100
|
+
var rgb = this.toRGB(h, s, b, a);
|
101
|
+
return '#'+((1 << 24) | (parseInt(rgb.r) << 16) | (parseInt(rgb.g) << 8) | parseInt(rgb.b)).toString(16).substr(1);
|
102
|
+
},
|
103
|
+
|
104
|
+
toHSL: function(h, s, b, a){
|
105
|
+
if (!h) {
|
106
|
+
h = this.value.h;
|
107
|
+
s = this.value.s;
|
108
|
+
b = this.value.b;
|
109
|
+
}
|
110
|
+
var H = h,
|
111
|
+
L = (2 - s) * b,
|
112
|
+
S = s * b;
|
113
|
+
if (L > 0 && L <= 1) {
|
114
|
+
S /= L;
|
115
|
+
} else {
|
116
|
+
S /= 2 - L;
|
117
|
+
}
|
118
|
+
L /= 2;
|
119
|
+
if (S > 1) {
|
120
|
+
S = 1;
|
121
|
+
}
|
122
|
+
return {
|
123
|
+
h: H,
|
124
|
+
s: S,
|
125
|
+
l: L,
|
126
|
+
a: a||this.value.a
|
127
|
+
};
|
128
|
+
}
|
129
|
+
};
|
130
|
+
|
131
|
+
// Picker object
|
132
|
+
|
133
|
+
var Colorpicker = function(element, options){
|
134
|
+
this.element = $(element);
|
135
|
+
var format = options.format||this.element.data('color-format')||'hex';
|
136
|
+
this.format = CPGlobal.translateFormats[format];
|
137
|
+
this.isInput = this.element.is('input');
|
138
|
+
this.component = this.element.is('.color') ? this.element.find('.add-on') : false;
|
139
|
+
|
140
|
+
this.picker = $(CPGlobal.template)
|
141
|
+
.appendTo('body')
|
142
|
+
.on('mousedown', $.proxy(this.mousedown, this));
|
143
|
+
|
144
|
+
if (this.isInput) {
|
145
|
+
this.element.on({
|
146
|
+
'focus': $.proxy(this.show, this),
|
147
|
+
'keyup': $.proxy(this.update, this)
|
148
|
+
});
|
149
|
+
} else if (this.component){
|
150
|
+
this.component.on({
|
151
|
+
'click': $.proxy(this.show, this)
|
152
|
+
});
|
153
|
+
} else {
|
154
|
+
this.element.on({
|
155
|
+
'click': $.proxy(this.show, this)
|
156
|
+
});
|
157
|
+
}
|
158
|
+
if (format == 'rgba' || format == 'hsla') {
|
159
|
+
this.picker.addClass('alpha');
|
160
|
+
this.alpha = this.picker.find('.colorpicker-alpha')[0].style;
|
161
|
+
}
|
162
|
+
|
163
|
+
if (this.component){
|
164
|
+
this.picker.find('.colorpicker-color').hide();
|
165
|
+
this.preview = this.element.find('i')[0].style;
|
166
|
+
} else {
|
167
|
+
this.preview = this.picker.find('div:last')[0].style;
|
168
|
+
}
|
169
|
+
|
170
|
+
this.base = this.picker.find('div:first')[0].style;
|
171
|
+
this.update();
|
172
|
+
};
|
173
|
+
|
174
|
+
Colorpicker.prototype = {
|
175
|
+
constructor: Colorpicker,
|
176
|
+
|
177
|
+
show: function(e) {
|
178
|
+
this.picker.show();
|
179
|
+
this.height = this.component ? this.component.outerHeight() : this.element.outerHeight();
|
180
|
+
this.place();
|
181
|
+
$(window).on('resize', $.proxy(this.place, this));
|
182
|
+
if (!this.isInput) {
|
183
|
+
if (e) {
|
184
|
+
e.stopPropagation();
|
185
|
+
e.preventDefault();
|
186
|
+
}
|
187
|
+
}
|
188
|
+
$(document).on({
|
189
|
+
'mousedown': $.proxy(this.hide, this)
|
190
|
+
});
|
191
|
+
this.element.trigger({
|
192
|
+
type: 'show',
|
193
|
+
color: this.color
|
194
|
+
});
|
195
|
+
},
|
196
|
+
|
197
|
+
update: function(){
|
198
|
+
this.color = new Color(this.isInput ? this.element.prop('value') : this.element.data('color'));
|
199
|
+
this.picker.find('i')
|
200
|
+
.eq(0).css({left: this.color.value.s*170, top: 170 - this.color.value.b*170}).end()
|
201
|
+
.eq(1).css('top', 170 * (1 - this.color.value.h)).end()
|
202
|
+
.eq(2).css('top', 170 * (1 - this.color.value.a));
|
203
|
+
this.previewColor();
|
204
|
+
},
|
205
|
+
|
206
|
+
hide: function(){
|
207
|
+
this.picker.hide();
|
208
|
+
$(window).off('resize', this.place);
|
209
|
+
if (!this.isInput) {
|
210
|
+
$(document).off({
|
211
|
+
'mousedown': this.hide
|
212
|
+
});
|
213
|
+
if (this.component){
|
214
|
+
this.element.find('input').prop('value', this.format.call(this));
|
215
|
+
}
|
216
|
+
this.element.data('color', this.format.call(this));
|
217
|
+
} else {
|
218
|
+
this.element.prop('value', this.format.call(this));
|
219
|
+
}
|
220
|
+
this.element.trigger({
|
221
|
+
type: 'hide',
|
222
|
+
color: this.color
|
223
|
+
});
|
224
|
+
},
|
225
|
+
|
226
|
+
place: function(){
|
227
|
+
var offset = this.component ? this.component.offset() : this.element.offset();
|
228
|
+
this.picker.css({
|
229
|
+
top: offset.top + this.height,
|
230
|
+
left: offset.left
|
231
|
+
});
|
232
|
+
},
|
233
|
+
|
234
|
+
//preview color change
|
235
|
+
previewColor: function(){
|
236
|
+
this.preview.backgroundColor = this.format.call(this);
|
237
|
+
//set the color for brightness/saturation slider
|
238
|
+
this.base.backgroundColor = this.color.toHex(this.color.value.h, 1, 1, 1);
|
239
|
+
//set te color for alpha slider
|
240
|
+
if (this.alpha) {
|
241
|
+
this.alpha.backgroundColor = this.color.toHex();
|
242
|
+
}
|
243
|
+
},
|
244
|
+
|
245
|
+
pointer: null,
|
246
|
+
|
247
|
+
slider: null,
|
248
|
+
|
249
|
+
mousedown: function(e){
|
250
|
+
e.stopPropagation();
|
251
|
+
e.preventDefault();
|
252
|
+
|
253
|
+
var target = $(e.target);
|
254
|
+
|
255
|
+
//detect the slider and set the limits and callbacks
|
256
|
+
var zone = target.closest('div');
|
257
|
+
if (!zone.is('.colorpicker')) {
|
258
|
+
if (zone.is('.colorpicker-saturation')) {
|
259
|
+
this.slider = $.extend({}, CPGlobal.sliders['saturation']);
|
260
|
+
}
|
261
|
+
else if (zone.is('.colorpicker-hue')) {
|
262
|
+
this.slider = $.extend({}, CPGlobal.sliders['hue']);
|
263
|
+
}
|
264
|
+
else if (zone.is('.colorpicker-alpha')) {
|
265
|
+
this.slider = $.extend({}, CPGlobal.sliders['alpha']);
|
266
|
+
}
|
267
|
+
var offset = zone.offset();
|
268
|
+
//reference to knob's style
|
269
|
+
this.slider.knob = zone.find('i')[0].style;
|
270
|
+
this.slider.left = e.pageX - offset.left;
|
271
|
+
this.slider.top = e.pageY - offset.top;
|
272
|
+
this.pointer = {
|
273
|
+
left: e.pageX,
|
274
|
+
top: e.pageY
|
275
|
+
};
|
276
|
+
//trigger mousemove to move the knob to the current position
|
277
|
+
$(document).on({
|
278
|
+
mousemove: $.proxy(this.mousemove, this),
|
279
|
+
mouseup: $.proxy(this.mouseup, this)
|
280
|
+
}).trigger('mousemove');
|
281
|
+
}
|
282
|
+
return false;
|
283
|
+
},
|
284
|
+
|
285
|
+
mousemove: function(e){
|
286
|
+
e.stopPropagation();
|
287
|
+
e.preventDefault();
|
288
|
+
var left = Math.max(
|
289
|
+
0,
|
290
|
+
Math.min(
|
291
|
+
this.slider.maxLeft,
|
292
|
+
this.slider.left + ((e.pageX||this.pointer.left) - this.pointer.left)
|
293
|
+
)
|
294
|
+
);
|
295
|
+
var top = Math.max(
|
296
|
+
0,
|
297
|
+
Math.min(
|
298
|
+
this.slider.maxTop,
|
299
|
+
this.slider.top + ((e.pageY||this.pointer.top) - this.pointer.top)
|
300
|
+
)
|
301
|
+
);
|
302
|
+
this.slider.knob.left = left + 'px';
|
303
|
+
this.slider.knob.top = top + 'px';
|
304
|
+
if (this.slider.callLeft) {
|
305
|
+
this.color[this.slider.callLeft].call(this.color, left/170);
|
306
|
+
}
|
307
|
+
if (this.slider.callTop) {
|
308
|
+
this.color[this.slider.callTop].call(this.color, top/170);
|
309
|
+
}
|
310
|
+
this.previewColor();
|
311
|
+
this.element.trigger({
|
312
|
+
type: 'changeColor',
|
313
|
+
color: this.color
|
314
|
+
});
|
315
|
+
return false;
|
316
|
+
},
|
317
|
+
|
318
|
+
mouseup: function(e){
|
319
|
+
e.stopPropagation();
|
320
|
+
e.preventDefault();
|
321
|
+
$(document).off({
|
322
|
+
mousemove: this.mousemove,
|
323
|
+
mouseup: this.mouseup
|
324
|
+
});
|
325
|
+
return false;
|
326
|
+
}
|
327
|
+
}
|
328
|
+
|
329
|
+
$.fn.colorpicker = function ( option ) {
|
330
|
+
return this.each(function () {
|
331
|
+
var $this = $(this),
|
332
|
+
data = $this.data('colorpicker'),
|
333
|
+
options = typeof option == 'object' && option;
|
334
|
+
if (!data) {
|
335
|
+
$this.data('colorpicker', (data = new Colorpicker(this, $.extend({}, $.fn.colorpicker.defaults,options))));
|
336
|
+
}
|
337
|
+
if (typeof option == 'string') data[option]();
|
338
|
+
});
|
339
|
+
};
|
340
|
+
|
341
|
+
$.fn.colorpicker.defaults = {
|
342
|
+
};
|
343
|
+
|
344
|
+
$.fn.colorpicker.Constructor = Colorpicker;
|
345
|
+
|
346
|
+
var CPGlobal = {
|
347
|
+
|
348
|
+
// translate a format from Color object to a string
|
349
|
+
translateFormats: {
|
350
|
+
'rgb': function(){
|
351
|
+
var rgb = this.color.toRGB();
|
352
|
+
return 'rgb('+rgb.r+','+rgb.g+','+rgb.b+')';
|
353
|
+
},
|
354
|
+
|
355
|
+
'rgba': function(){
|
356
|
+
var rgb = this.color.toRGB();
|
357
|
+
return 'rgba('+rgb.r+','+rgb.g+','+rgb.b+','+rgb.a+')';
|
358
|
+
},
|
359
|
+
|
360
|
+
'hsl': function(){
|
361
|
+
var hsl = this.color.toHSL();
|
362
|
+
return 'hsl('+Math.round(hsl.h*360)+','+Math.round(hsl.s*170)+'%,'+Math.round(hsl.l*170)+'%)';
|
363
|
+
},
|
364
|
+
|
365
|
+
'hsla': function(){
|
366
|
+
var hsl = this.color.toHSL();
|
367
|
+
return 'hsla('+Math.round(hsl.h*360)+','+Math.round(hsl.s*170)+'%,'+Math.round(hsl.l*170)+'%,'+hsl.a+')';
|
368
|
+
},
|
369
|
+
|
370
|
+
'hex': function(){
|
371
|
+
return this.color.toHex();
|
372
|
+
}
|
373
|
+
},
|
374
|
+
|
375
|
+
sliders: {
|
376
|
+
saturation: {
|
377
|
+
maxLeft: 170,
|
378
|
+
maxTop: 170,
|
379
|
+
callLeft: 'setSaturation',
|
380
|
+
callTop: 'setLightness'
|
381
|
+
},
|
382
|
+
|
383
|
+
hue: {
|
384
|
+
maxLeft: 0,
|
385
|
+
maxTop: 170,
|
386
|
+
callLeft: false,
|
387
|
+
callTop: 'setHue'
|
388
|
+
},
|
389
|
+
|
390
|
+
alpha: {
|
391
|
+
maxLeft: 0,
|
392
|
+
maxTop: 170,
|
393
|
+
callLeft: false,
|
394
|
+
callTop: 'setAlpha'
|
395
|
+
}
|
396
|
+
},
|
397
|
+
|
398
|
+
// HSBtoRGB from RaphaelJS
|
399
|
+
// https://github.com/DmitryBaranovskiy/raphael/
|
400
|
+
RGBtoHSB: function (r, g, b, a){
|
401
|
+
r /= 255;
|
402
|
+
g /= 255;
|
403
|
+
b /= 255;
|
404
|
+
|
405
|
+
var H, S, V, C;
|
406
|
+
V = Math.max(r, g, b);
|
407
|
+
C = V - Math.min(r, g, b);
|
408
|
+
H = (C == 0 ? null :
|
409
|
+
V == r ? (g - b) / C :
|
410
|
+
V == g ? (b - r) / C + 2 :
|
411
|
+
(r - g) / C + 4
|
412
|
+
);
|
413
|
+
H = ((H + 360) % 6) * 60 / 360;
|
414
|
+
S = C == 0 ? 0 : C / V;
|
415
|
+
return {h: H||1, s: S, b: V, a: a||1};
|
416
|
+
},
|
417
|
+
|
418
|
+
HueToRGB: function (p, q, h) {
|
419
|
+
if (h < 0)
|
420
|
+
h += 1;
|
421
|
+
else if (h > 1)
|
422
|
+
h -= 1;
|
423
|
+
|
424
|
+
if ((h * 6) < 1)
|
425
|
+
return p + (q - p) * h * 6;
|
426
|
+
else if ((h * 2) < 1)
|
427
|
+
return q;
|
428
|
+
else if ((h * 3) < 2)
|
429
|
+
return p + (q - p) * ((2 / 3) - h) * 6;
|
430
|
+
else
|
431
|
+
return p;
|
432
|
+
},
|
433
|
+
|
434
|
+
HSLtoRGB: function (h, s, l, a)
|
435
|
+
{
|
436
|
+
|
437
|
+
if (s < 0)
|
438
|
+
s = 0;
|
439
|
+
|
440
|
+
if (l <= 0.5)
|
441
|
+
var q = l * (1 + s);
|
442
|
+
else
|
443
|
+
var q = l + s - (l * s);
|
444
|
+
|
445
|
+
var p = 2 * l - q;
|
446
|
+
|
447
|
+
var tr = h + (1 / 3);
|
448
|
+
var tg = h;
|
449
|
+
var tb = h - (1 / 3);
|
450
|
+
|
451
|
+
var r = Math.round(CPGlobal.HueToRGB(p, q, tr) * 255);
|
452
|
+
var g = Math.round(CPGlobal.HueToRGB(p, q, tg) * 255);
|
453
|
+
var b = Math.round(CPGlobal.HueToRGB(p, q, tb) * 255);
|
454
|
+
return [r, g, b, a||1];
|
455
|
+
},
|
456
|
+
|
457
|
+
// a set of RE's that can match strings and generate color tuples.
|
458
|
+
// from John Resig color plugin
|
459
|
+
// https://github.com/jquery/jquery-color/
|
460
|
+
stringParsers: [
|
461
|
+
{
|
462
|
+
re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,
|
463
|
+
parse: function( execResult ) {
|
464
|
+
return [
|
465
|
+
execResult[ 1 ],
|
466
|
+
execResult[ 2 ],
|
467
|
+
execResult[ 3 ],
|
468
|
+
execResult[ 4 ]
|
469
|
+
];
|
470
|
+
}
|
471
|
+
}, {
|
472
|
+
re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,
|
473
|
+
parse: function( execResult ) {
|
474
|
+
return [
|
475
|
+
2.55 * execResult[1],
|
476
|
+
2.55 * execResult[2],
|
477
|
+
2.55 * execResult[3],
|
478
|
+
execResult[ 4 ]
|
479
|
+
];
|
480
|
+
}
|
481
|
+
}, {
|
482
|
+
re: /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/,
|
483
|
+
parse: function( execResult ) {
|
484
|
+
return [
|
485
|
+
parseInt( execResult[ 1 ], 16 ),
|
486
|
+
parseInt( execResult[ 2 ], 16 ),
|
487
|
+
parseInt( execResult[ 3 ], 16 )
|
488
|
+
];
|
489
|
+
}
|
490
|
+
}, {
|
491
|
+
re: /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/,
|
492
|
+
parse: function( execResult ) {
|
493
|
+
return [
|
494
|
+
parseInt( execResult[ 1 ] + execResult[ 1 ], 16 ),
|
495
|
+
parseInt( execResult[ 2 ] + execResult[ 2 ], 16 ),
|
496
|
+
parseInt( execResult[ 3 ] + execResult[ 3 ], 16 )
|
497
|
+
];
|
498
|
+
}
|
499
|
+
}, {
|
500
|
+
re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,
|
501
|
+
space: 'hsla',
|
502
|
+
parse: function( execResult ) {
|
503
|
+
return [
|
504
|
+
execResult[1]/360,
|
505
|
+
execResult[2] / 170,
|
506
|
+
execResult[3] / 170,
|
507
|
+
execResult[4]
|
508
|
+
];
|
509
|
+
}
|
510
|
+
}
|
511
|
+
],
|
512
|
+
template: '<div class="colorpicker dropdown-menu">'+
|
513
|
+
'<div class="colorpicker-saturation"><i><b></b></i></div>'+
|
514
|
+
'<div class="colorpicker-hue"><i></i></div>'+
|
515
|
+
'<div class="colorpicker-alpha"><i></i></div>'+
|
516
|
+
'<div class="colorpicker-color"><div /></div>'+
|
517
|
+
'</div>'
|
518
|
+
};
|
519
|
+
|
520
|
+
}( window.jQuery )
|