agile_rails 0.0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (259) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +5 -0
  3. data/MIT-LICENSE +20 -0
  4. data/README.md +285 -0
  5. data/Rakefile +39 -0
  6. data/agile_rails.gemspec +36 -0
  7. data/app/assets/fonts/ibm-plex-sans-300.woff2 +0 -0
  8. data/app/assets/fonts/ibm-plex-sans-400.woff2 +0 -0
  9. data/app/assets/fonts/ibm-plex-sans-500.woff2 +0 -0
  10. data/app/assets/fonts/ibm-plex-sans-600.woff2 +0 -0
  11. data/app/assets/fonts/ibm-plex-sans-700.woff2 +0 -0
  12. data/app/assets/fonts/ibm-plex-sans-italic.woff2 +0 -0
  13. data/app/assets/images/32px.png +0 -0
  14. data/app/assets/images/throbber.gif +0 -0
  15. data/app/assets/javascripts/agile/agile.js +1489 -0
  16. data/app/assets/javascripts/agile/jquery-migrate.js +702 -0
  17. data/app/assets/javascripts/agile/jquery.bpopup.js +372 -0
  18. data/app/assets/javascripts/agile/jquery.datetimepicker.js +1353 -0
  19. data/app/assets/javascripts/agile/jstree.min.js +6 -0
  20. data/app/assets/javascripts/agile/select-multiple.js +459 -0
  21. data/app/assets/javascripts/agile/some_scripts.js +33 -0
  22. data/app/assets/javascripts/agile.js +22 -0
  23. data/app/assets/javascripts/agile_application.js +22 -0
  24. data/app/assets/javascripts/agile_editor.js +22 -0
  25. data/app/assets/stylesheets/agile/agile.css +1882 -0
  26. data/app/assets/stylesheets/agile/agile_apps.css +149 -0
  27. data/app/assets/stylesheets/agile/jquery.datetimepicker.css +304 -0
  28. data/app/assets/stylesheets/agile/jstree.css +1107 -0
  29. data/app/assets/stylesheets/agile/select-multiple.css +110 -0
  30. data/app/assets/stylesheets/agile/th-bg.png +0 -0
  31. data/app/assets/stylesheets/agile/theme.css +49 -0
  32. data/app/assets/stylesheets/agile.css +21 -0
  33. data/app/assets/stylesheets/agile_application.css +20 -0
  34. data/app/assets/stylesheets/agile_editor.css +19 -0
  35. data/app/controllers/agile_application_controller.rb +735 -0
  36. data/app/controllers/agile_common_controller.rb +345 -0
  37. data/app/controllers/agile_controller.rb +977 -0
  38. data/app/controllers/agile_main_controller.rb +36 -0
  39. data/app/controls/agile_control.rb +120 -0
  40. data/app/controls/agile_report.rb +364 -0
  41. data/app/controls/ar_category_control.rb +39 -0
  42. data/app/controls/ar_help_control.rb +139 -0
  43. data/app/controls/ar_image_control.rb +180 -0
  44. data/app/controls/ar_journal_control.rb +47 -0
  45. data/app/controls/ar_menu_item_control.rb +55 -0
  46. data/app/controls/ar_page_control.rb +64 -0
  47. data/app/controls/ar_poll_result_control.rb +84 -0
  48. data/app/controls/ar_setup_control.rb +62 -0
  49. data/app/controls/belongs_to_control.rb +61 -0
  50. data/app/controls/browse_models_control.rb +98 -0
  51. data/app/controls/settings_form_control.rb +137 -0
  52. data/app/forms/agile_help.yml +112 -0
  53. data/app/forms/agile_menu.yml +140 -0
  54. data/app/forms/agile_report_defaults.yml +39 -0
  55. data/app/forms/all_options.yml +810 -0
  56. data/app/forms/ar_ad.yml +121 -0
  57. data/app/forms/ar_big_table.yml +60 -0
  58. data/app/forms/ar_big_table_value.yml +52 -0
  59. data/app/forms/ar_browse_fields.yml +35 -0
  60. data/app/forms/ar_browse_models.yml +48 -0
  61. data/app/forms/ar_category.yml +73 -0
  62. data/app/forms/ar_category_as_tree.yml +31 -0
  63. data/app/forms/ar_design.yml +75 -0
  64. data/app/forms/ar_filter.yml +52 -0
  65. data/app/forms/ar_folder_permission.yml +56 -0
  66. data/app/forms/ar_folder_rule.yml +48 -0
  67. data/app/forms/ar_gallery.yml +55 -0
  68. data/app/forms/ar_image.yml +126 -0
  69. data/app/forms/ar_image_search.yml +83 -0
  70. data/app/forms/ar_journal.yml +76 -0
  71. data/app/forms/ar_json_ld.yml +56 -0
  72. data/app/forms/ar_key_value.yml +33 -0
  73. data/app/forms/ar_key_value_store.yml +33 -0
  74. data/app/forms/ar_link.yml +60 -0
  75. data/app/forms/ar_menu.yml +67 -0
  76. data/app/forms/ar_menu_item.yml +141 -0
  77. data/app/forms/ar_page.yml +187 -0
  78. data/app/forms/ar_part.yml +91 -0
  79. data/app/forms/ar_permission.yml +52 -0
  80. data/app/forms/ar_permission_rule.yml +40 -0
  81. data/app/forms/ar_piece.yml +106 -0
  82. data/app/forms/ar_policy.yml +64 -0
  83. data/app/forms/ar_policy_rule.yml +42 -0
  84. data/app/forms/ar_policy_rule_nocms.yml +40 -0
  85. data/app/forms/ar_poll.yml +118 -0
  86. data/app/forms/ar_poll_item.yml +78 -0
  87. data/app/forms/ar_poll_result.yml +88 -0
  88. data/app/forms/ar_poll_result_export.yml +35 -0
  89. data/app/forms/ar_removed_url.yml +41 -0
  90. data/app/forms/ar_role.yml +43 -0
  91. data/app/forms/ar_seo.yml +32 -0
  92. data/app/forms/ar_setup.yml +45 -0
  93. data/app/forms/ar_site.yml +149 -0
  94. data/app/forms/ar_steps_template.yml +51 -0
  95. data/app/forms/ar_user.yml +140 -0
  96. data/app/forms/ar_user_role.yml +57 -0
  97. data/app/forms/help/dc_category_as_tree.en +4 -0
  98. data/app/forms/help/dc_category_as_tree.sl +5 -0
  99. data/app/forms/json_ld_schema.yml +168 -0
  100. data/app/helpers/agile_application_helper.rb +1162 -0
  101. data/app/helpers/agile_category_helper.rb +128 -0
  102. data/app/helpers/agile_common_helper.rb +308 -0
  103. data/app/helpers/agile_edit_helper.rb +645 -0
  104. data/app/helpers/agile_helper.rb +509 -0
  105. data/app/helpers/agile_index_helper.rb +677 -0
  106. data/app/helpers/ar_image_helper.rb +128 -0
  107. data/app/models/agile_form_fields/action.rb +61 -0
  108. data/app/models/agile_form_fields/agile_form_field.rb +322 -0
  109. data/app/models/agile_form_fields/belongs_to.rb +112 -0
  110. data/app/models/agile_form_fields/check_box.rb +73 -0
  111. data/app/models/agile_form_fields/comment.rb +62 -0
  112. data/app/models/agile_form_fields/date_picker.rb +104 -0
  113. data/app/models/agile_form_fields/date_select.rb +68 -0
  114. data/app/models/agile_form_fields/datetime_picker.rb +88 -0
  115. data/app/models/agile_form_fields/datetime_select.rb +73 -0
  116. data/app/models/agile_form_fields/file_field.rb +52 -0
  117. data/app/models/agile_form_fields/file_select.rb +69 -0
  118. data/app/models/agile_form_fields/hidden_field.rb +51 -0
  119. data/app/models/agile_form_fields/html_field.rb +69 -0
  120. data/app/models/agile_form_fields/journal_diff.rb +62 -0
  121. data/app/models/agile_form_fields/link_to.rb +69 -0
  122. data/app/models/agile_form_fields/method.rb +66 -0
  123. data/app/models/agile_form_fields/multitext_autocomplete.rb +215 -0
  124. data/app/models/agile_form_fields/number_field.rb +92 -0
  125. data/app/models/agile_form_fields/password_field.rb +63 -0
  126. data/app/models/agile_form_fields/radio_button.rb +95 -0
  127. data/app/models/agile_form_fields/readonly.rb +77 -0
  128. data/app/models/agile_form_fields/select.rb +281 -0
  129. data/app/models/agile_form_fields/submit_tag.rb +58 -0
  130. data/app/models/agile_form_fields/text_area.rb +61 -0
  131. data/app/models/agile_form_fields/text_autocomplete.rb +171 -0
  132. data/app/models/agile_form_fields/text_field.rb +55 -0
  133. data/app/models/agile_form_fields/text_with_select.rb +94 -0
  134. data/app/models/agile_form_fields/tree_select.rb +170 -0
  135. data/app/models/ar_big_table.rb +82 -0
  136. data/app/models/ar_big_table_value.rb +53 -0
  137. data/app/models/ar_category.rb +109 -0
  138. data/app/models/ar_design.rb +116 -0
  139. data/app/models/ar_filter.rb +200 -0
  140. data/app/models/ar_folder_permission.rb +50 -0
  141. data/app/models/ar_folder_rule.rb +47 -0
  142. data/app/models/ar_gallery.rb +53 -0
  143. data/app/models/ar_image.rb +198 -0
  144. data/app/models/ar_internals.rb +60 -0
  145. data/app/models/ar_journal.rb +46 -0
  146. data/app/models/ar_json_ld.rb +131 -0
  147. data/app/models/ar_key_value_store.rb +128 -0
  148. data/app/models/ar_link.rb +48 -0
  149. data/app/models/ar_memory.rb +172 -0
  150. data/app/models/ar_menu.rb +144 -0
  151. data/app/models/ar_menu_item.rb +106 -0
  152. data/app/models/ar_page.rb +74 -0
  153. data/app/models/ar_part.rb +66 -0
  154. data/app/models/ar_permission.rb +180 -0
  155. data/app/models/ar_permission_rule.rb +65 -0
  156. data/app/models/ar_policy.rb +78 -0
  157. data/app/models/ar_policy_rule.rb +65 -0
  158. data/app/models/ar_poll.rb +74 -0
  159. data/app/models/ar_poll_item.rb +47 -0
  160. data/app/models/ar_poll_result.rb +38 -0
  161. data/app/models/ar_removed_url.rb +42 -0
  162. data/app/models/ar_role.rb +84 -0
  163. data/app/models/ar_setup.rb +115 -0
  164. data/app/models/ar_site.rb +68 -0
  165. data/app/models/ar_temp.rb +150 -0
  166. data/app/models/ar_user.rb +72 -0
  167. data/app/models/ar_user_group.rb +38 -0
  168. data/app/models/ar_user_role.rb +54 -0
  169. data/app/models/ar_visit.rb +41 -0
  170. data/app/models/concerns/ar_page_concern.rb +128 -0
  171. data/app/models/concerns/ar_part_concern.rb +48 -0
  172. data/app/models/concerns/ar_piece_concern.rb +48 -0
  173. data/app/models/concerns/ar_policy_rule_concern.rb +87 -0
  174. data/app/models/concerns/ar_seo_concern.rb +66 -0
  175. data/app/models/concerns/ar_site_concern.rb +103 -0
  176. data/app/models/concerns/ar_user_concern.rb +195 -0
  177. data/app/renderers/agile_common_renderer.rb +93 -0
  178. data/app/renderers/agile_renderer.rb +59 -0
  179. data/app/renderers/ar_ad_renderer.rb +219 -0
  180. data/app/renderers/ar_captcha_renderer.rb +113 -0
  181. data/app/renderers/ar_common_renderer.rb +90 -0
  182. data/app/renderers/ar_gallery_renderer.rb +107 -0
  183. data/app/renderers/ar_menu_renderer.rb +195 -0
  184. data/app/renderers/ar_page_renderer.rb +147 -0
  185. data/app/renderers/ar_part_renderer.rb +235 -0
  186. data/app/renderers/ar_piece_renderer.rb +119 -0
  187. data/app/renderers/ar_poll_renderer.rb +272 -0
  188. data/app/views/agile/_edit_stuff.html.erb +57 -0
  189. data/app/views/agile/_form.html.erb +24 -0
  190. data/app/views/agile/_result.html.erb +28 -0
  191. data/app/views/agile/edit.html.erb +13 -0
  192. data/app/views/agile/error.html.erb +2 -0
  193. data/app/views/agile/index.html.erb +14 -0
  194. data/app/views/agile/login.html.erb +19 -0
  195. data/app/views/agile/new.html.erb +12 -0
  196. data/app/views/agile_common/_help.html.erb +18 -0
  197. data/app/views/agile_common/_iframe_edit.html.erb +2 -0
  198. data/app/views/agile_common/paste_clipboard.html.erb +17 -0
  199. data/app/views/layouts/agile.html.erb +17 -0
  200. data/app/views/layouts/content.html.erb +20 -0
  201. data/app/views/models/dump_models.html.erb +47 -0
  202. data/config/initializers/kaminari_patch.rb +56 -0
  203. data/config/locales/agile_de.yml +138 -0
  204. data/config/locales/agile_en.yml +162 -0
  205. data/config/locales/agile_sl.yml +163 -0
  206. data/config/locales/datetimepicker.yml +19 -0
  207. data/config/locales/de.yml +231 -0
  208. data/config/locales/en.yml +13 -0
  209. data/config/locales/kaminari.yml +26 -0
  210. data/config/locales/models_en.yml +1032 -0
  211. data/config/locales/models_sl.yml +1065 -0
  212. data/config/locales/sl.yml +211 -0
  213. data/db/migrate/20240120160001_add_sessions_table.rb +12 -0
  214. data/db/migrate/20240120160002_ar_big_table.rb +17 -0
  215. data/db/migrate/20240120160003_ar_big_table_value.rb +18 -0
  216. data/db/migrate/20240120160004_ar_category.rb +22 -0
  217. data/db/migrate/20240120160005_ar_design.rb +20 -0
  218. data/db/migrate/20240120160006_ar_filter.rb +17 -0
  219. data/db/migrate/20240120160007_ar_gallery.rb +21 -0
  220. data/db/migrate/20240120160008_ar_journal.rb +19 -0
  221. data/db/migrate/20240120160009_ar_key_value_store.rb +11 -0
  222. data/db/migrate/20240120160010_ar_link.rb +19 -0
  223. data/db/migrate/20240120160011_ar_memory.rb +8 -0
  224. data/db/migrate/20240120160012_ar_menu.rb +21 -0
  225. data/db/migrate/20240120160013_ar_menu_item.rb +28 -0
  226. data/db/migrate/20240120160014_ar_page.rb +50 -0
  227. data/db/migrate/20240120160015_ar_part.rb +33 -0
  228. data/db/migrate/20240120160016_ar_permission.rb +16 -0
  229. data/db/migrate/20240120160017_ar_permission_rule.rb +17 -0
  230. data/db/migrate/20240120160018_ar_piece.rb +28 -0
  231. data/db/migrate/20240120160019_ar_policy.rb +21 -0
  232. data/db/migrate/20240120160020_ar_policy_rule.rb +18 -0
  233. data/db/migrate/20240120160021_ar_poll.rb +27 -0
  234. data/db/migrate/20240120160022_ar_poll_item.rb +23 -0
  235. data/db/migrate/20240120160023_ar_poll_result.rb +14 -0
  236. data/db/migrate/20240120160024_ar_removed_url.rb +16 -0
  237. data/db/migrate/20240120160025_ar_role.rb +17 -0
  238. data/db/migrate/20240120160026_ar_site.rb +37 -0
  239. data/db/migrate/20240120160027_ar_temp.rb +11 -0
  240. data/db/migrate/20240120160028_ar_user.rb +42 -0
  241. data/db/migrate/20240120160029_ar_user_group.rb +12 -0
  242. data/db/migrate/20240120160030_ar_user_role.rb +18 -0
  243. data/db/migrate/20240120160031_ar_visit.rb +15 -0
  244. data/db/migrate/20240703016001_ar_setup.rb +16 -0
  245. data/db/migrate/20240703016002_ar_folder_permission.rb +15 -0
  246. data/db/migrate/20240703016003_ar_folder_rule.rb +14 -0
  247. data/db/migrate/20250115000001_ar_image.rb +25 -0
  248. data/lib/agile/configuration.rb +43 -0
  249. data/lib/agile/engine.rb +29 -0
  250. data/lib/agile/version.rb +27 -0
  251. data/lib/agile.rb +282 -0
  252. data/lib/agile_rails.rb +1 -0
  253. data/lib/generators/agile/USAGE +11 -0
  254. data/lib/generators/agile/new_form_generator.rb +369 -0
  255. data/lib/generators/convert_to_ar/convert_to_ar_generator.rb +158 -0
  256. data/lib/tasks/agile_db_clone.rake +132 -0
  257. data/lib/tasks/agile_db_export_to_yaml.rake +37 -0
  258. data/lib/tasks/agile_db_migrate.rake +35 -0
  259. metadata +414 -0
@@ -0,0 +1,459 @@
1
+ /*
2
+ * SelectMultiple v0.1
3
+ * Copyright (c) 2015 krazedkrish( Shalil Awaley )
4
+ *
5
+ * This program is free software. It comes without any warranty, to
6
+ * the extent permitted by applicable law. You can redistribute it
7
+ * and/or modify it under the terms of the MIT LICENSE.
8
+ * See https://en.wikipedia.org/wiki/MIT_License for more details.
9
+ */
10
+
11
+ !function ($) {
12
+
13
+ "use strict";
14
+
15
+
16
+ /* SELECTMULTIPLE CLASS DEFINITION
17
+ * ====================== */
18
+
19
+ var SelectMultiple = function (element, options) {
20
+ this.options = options;
21
+ this.$element = $(element);
22
+ this.$container = $('<div/>', { 'class': "ms-container" });
23
+ this.$selectableContainer = $('<div/>', { 'class': 'ms-selectable' });
24
+ this.$selectableUl = $('<ul/>', { 'class': "ms-list", 'tabindex' : '-1' });
25
+ this.scrollTo = 0;
26
+ this.elemsSelector = 'li';
27
+ };
28
+
29
+ SelectMultiple.prototype = {
30
+ constructor: SelectMultiple,
31
+
32
+ init: function(){
33
+ var that = this,
34
+ ms = this.$element;
35
+
36
+ if (ms.next('.ms-container').length === 0){
37
+ ms.css({ position: 'absolute', left: '-9999px' });
38
+ ms.attr('id', ms.attr('id') ? ms.attr('id') : Math.ceil(Math.random()*1000)+'selectmultiple');
39
+ this.$container.attr('id', 'ms-'+ms.attr('id'));
40
+ this.$container.addClass(that.options.cssClass);
41
+ ms.find('option').each(function(){
42
+ that.generateLisFromOption(this);
43
+ });
44
+
45
+
46
+ if (that.options.selectableHeader){
47
+ that.$selectableContainer.append(that.options.selectableHeader);
48
+ }
49
+ that.$selectableContainer.append(that.$selectableUl);
50
+ if (that.options.selectableFooter){
51
+ that.$selectableContainer.append(that.options.selectableFooter);
52
+ }
53
+
54
+
55
+ that.$container.append(that.$selectableContainer);
56
+ ms.after(that.$container);
57
+
58
+ that.activeMouse(that.$selectableUl);
59
+ that.activeKeyboard(that.$selectableUl);
60
+
61
+ var action = that.options.dblClick ? 'dblclick' : 'click';
62
+
63
+ that.$selectableUl.on(action, '.ms-elem-selectable', function(){
64
+ that.select($(this).data('ms-value'));
65
+ });
66
+
67
+
68
+ ms.on('focus', function(){
69
+ that.$selectableUl.focus();
70
+ })
71
+ }
72
+
73
+ var selectedValues = ms.find('option:selected').map(function(){ return $(this).val(); }).get();
74
+ that.select(selectedValues, 'init');
75
+
76
+ if (typeof that.options.afterInit === 'function') {
77
+ that.options.afterInit.call(this, this.$container);
78
+ }
79
+ },
80
+
81
+ 'generateLisFromOption' : function(option, index, $container){
82
+ var that = this,
83
+ ms = that.$element,
84
+ attributes = "",
85
+ $option = $(option);
86
+
87
+ for (var cpt = 0; cpt < option.attributes.length; cpt++){
88
+ var attr = option.attributes[cpt];
89
+
90
+ if(attr.name !== 'value' && attr.name !== 'disabled'){
91
+ attributes += attr.name+'="'+attr.value+'" ';
92
+ }
93
+ }
94
+ var selectableLi = $('<li '+attributes+'><span>'+that.escapeHTML($option.text())+'</span><span class="pull-right ms-elem-selected">✔</span></li>'),
95
+ selectedLi = selectableLi.clone(),
96
+ value = $option.val(),
97
+ elementId = that.sanitize(value);
98
+
99
+ selectableLi.children('.ms-elem-selected').hide();
100
+
101
+ selectableLi
102
+ .data('ms-value', value)
103
+ .addClass('ms-elem-selectable')
104
+ .attr('id', elementId+'-selectable');
105
+
106
+
107
+ if ($option.prop('disabled') || ms.prop('disabled')){
108
+ selectableLi.addClass(that.options.disabledClass);
109
+ }
110
+
111
+ var $optgroup = $option.parent('optgroup');
112
+
113
+ if ($optgroup.length > 0){
114
+ var optgroupLabel = $optgroup.attr('label'),
115
+ optgroupId = that.sanitize(optgroupLabel),
116
+ $selectableOptgroup = that.$selectableUl.find('#optgroup-selectable-'+optgroupId);
117
+
118
+ if ($selectableOptgroup.length === 0){
119
+ var optgroupContainerTpl = '<li class="ms-optgroup-container"></li>',
120
+ optgroupTpl = '<ul class="ms-optgroup"><li class="ms-optgroup-label"><span>'+optgroupLabel+'</span></li></ul>';
121
+
122
+ $selectableOptgroup = $(optgroupContainerTpl);
123
+ $selectableOptgroup.attr('id', 'optgroup-selectable-'+optgroupId);
124
+ $selectableOptgroup.append($(optgroupTpl));
125
+ if (that.options.selectableOptgroup){
126
+ $selectableOptgroup.find('.ms-optgroup-label').on('click', function(){
127
+ var values = $optgroup.children(':not(:selected, :disabled)').map(function(){ return $(this).val() }).get();
128
+ that.select(values);
129
+ });
130
+ }
131
+ that.$selectableUl.append($selectableOptgroup);
132
+ }
133
+ index = index == undefined ? $selectableOptgroup.find('ul').children().length : index + 1;
134
+ selectableLi.insertAt(index, $selectableOptgroup.children());
135
+ } else {
136
+ index = index == undefined ? that.$selectableUl.children().length : index;
137
+
138
+ selectableLi.insertAt(index, that.$selectableUl);
139
+ }
140
+ },
141
+
142
+ 'addOption' : function(options){
143
+ var that = this;
144
+
145
+ if (options.value !== undefined && options.value !== null){
146
+ options = [options];
147
+ }
148
+ $.each(options, function(index, option){
149
+ if (option.value !== undefined && option.value !== null &&
150
+ that.$element.find("option[value='"+option.value+"']").length === 0){
151
+ var $option = $('<option value="'+option.value+'">'+option.text+'</option>'),
152
+ index = parseInt((typeof option.index === 'undefined' ? that.$element.children().length : option.index)),
153
+ $container = option.nested == undefined ? that.$element : $("optgroup[label='"+option.nested+"']")
154
+
155
+ $option.insertAt(index, $container);
156
+ that.generateLisFromOption($option.get(0), index, option.nested);
157
+ }
158
+ })
159
+ },
160
+
161
+ 'escapeHTML' : function(text){
162
+ return $("<div>").text(text).html();
163
+ },
164
+
165
+ 'activeKeyboard' : function($list){
166
+ var that = this;
167
+
168
+ $list.on('focus', function(){
169
+ $(this).addClass('ms-focus');
170
+ })
171
+ .on('blur', function(){
172
+ $(this).removeClass('ms-focus');
173
+ })
174
+ .on('keydown', function(e){
175
+ switch (e.which) {
176
+ case 40:
177
+ case 38:
178
+ e.preventDefault();
179
+ e.stopPropagation();
180
+ that.moveHighlight($(this), (e.which === 38) ? -1 : 1);
181
+ return;
182
+ case 9:
183
+ if(that.$element.is('[tabindex]')){
184
+ e.preventDefault();
185
+ var tabindex = parseInt(that.$element.attr('tabindex'), 10);
186
+ tabindex = (e.shiftKey) ? tabindex-1 : tabindex+1;
187
+ $('[tabindex="'+(tabindex)+'"]').focus();
188
+ return;
189
+ }else{
190
+ if(e.shiftKey){
191
+ that.$element.trigger('focus');
192
+ }
193
+ }
194
+ }
195
+ if($.inArray(e.which, that.options.keySelect) > -1){
196
+ e.preventDefault();
197
+ e.stopPropagation();
198
+ that.selectHighlighted($list);
199
+ return;
200
+ }
201
+ });
202
+ },
203
+
204
+ 'moveHighlight': function($list, direction){
205
+ var $elems = $list.find(this.elemsSelector),
206
+ $currElem = $elems.filter('.ms-hover'),
207
+ $nextElem = null,
208
+ elemHeight = $elems.first().outerHeight(),
209
+ containerHeight = $list.height(),
210
+ containerSelector = '#'+this.$container.prop('id');
211
+
212
+ $elems.removeClass('ms-hover');
213
+ if (direction === 1){ // DOWN
214
+
215
+ $nextElem = $currElem.nextAll(this.elemsSelector).first();
216
+ if ($nextElem.length === 0){
217
+ var $optgroupUl = $currElem.parent();
218
+
219
+ if ($optgroupUl.hasClass('ms-optgroup')){
220
+ var $optgroupLi = $optgroupUl.parent(),
221
+ $nextOptgroupLi = $optgroupLi.next(':visible');
222
+
223
+ if ($nextOptgroupLi.length > 0){
224
+ $nextElem = $nextOptgroupLi.find(this.elemsSelector).first();
225
+ } else {
226
+ $nextElem = $elems.first();
227
+ }
228
+ } else {
229
+ $nextElem = $elems.first();
230
+ }
231
+ }
232
+ } else if (direction === -1){ // UP
233
+
234
+ $nextElem = $currElem.prevAll(this.elemsSelector).first();
235
+ if ($nextElem.length === 0){
236
+ var $optgroupUl = $currElem.parent();
237
+
238
+ if ($optgroupUl.hasClass('ms-optgroup')){
239
+ var $optgroupLi = $optgroupUl.parent(),
240
+ $prevOptgroupLi = $optgroupLi.prev(':visible');
241
+
242
+ if ($prevOptgroupLi.length > 0){
243
+ $nextElem = $prevOptgroupLi.find(this.elemsSelector).last();
244
+ } else {
245
+ $nextElem = $elems.last();
246
+ }
247
+ } else {
248
+ $nextElem = $elems.last();
249
+ }
250
+ }
251
+ }
252
+ if ($nextElem.length > 0){
253
+ $nextElem.addClass('ms-hover');
254
+ var scrollTo = $list.scrollTop() + $nextElem.position().top -
255
+ containerHeight / 2 + elemHeight / 2;
256
+
257
+ $list.scrollTop(scrollTo);
258
+ }
259
+ },
260
+
261
+ 'selectHighlighted' : function($list){
262
+ var $elems = $list.find(this.elemsSelector),
263
+ $highlightedElem = $elems.filter('.ms-hover').first();
264
+
265
+ if ($highlightedElem.length > 0){
266
+ if ($list.parent().hasClass('ms-selectable')){
267
+ this.select($highlightedElem.data('ms-value'));
268
+ } else {
269
+ this.deselect($highlightedElem.data('ms-value'));
270
+ }
271
+ $elems.removeClass('ms-hover');
272
+ }
273
+ },
274
+
275
+ 'activeMouse' : function($list){
276
+ var that = this;
277
+
278
+ $('body').on('mouseenter', that.elemsSelector, function(){
279
+ $(this).parents('.ms-container').find(that.elemsSelector).removeClass('ms-hover');
280
+ $(this).addClass('ms-hover');
281
+ });
282
+
283
+ $('body').on('mouseleave', that.elemsSelector, function () {
284
+ $(this).parents('.ms-container').find(that.elemsSelector).removeClass('ms-hover');;
285
+ });
286
+ },
287
+
288
+ 'refresh' : function() {
289
+ this.destroy();
290
+ this.$element.selectMultiple(this.options);
291
+ },
292
+
293
+ 'destroy' : function(){
294
+ $("#ms-"+this.$element.attr("id")).remove();
295
+ this.$element.css('position', '').css('left', '')
296
+ this.$element.removeData('selectmultiple');
297
+ },
298
+
299
+ 'select' : function(value, method){
300
+ if (typeof value === 'string'){ value = [value]; }
301
+
302
+ var that = this,
303
+ ms = this.$element,
304
+ msIds = $.map(value, function(val){ return(that.sanitize(val)); }),
305
+ selectables = this.$selectableUl.find('#' + msIds.join('-selectable, #')+'-selectable').filter(':not(.'+that.options.disabledClass+')'),
306
+ options = ms.find('option:not(:disabled)').filter(function(){ return($.inArray(this.value, value) > -1); });
307
+
308
+ if (method === 'init'){
309
+ selectables = this.$selectableUl.find('#' + msIds.join('-selectable, #')+'-selectable');
310
+ }
311
+
312
+ if (selectables.length > 0){
313
+ selectables.addClass('ms-selected').children('.ms-elem-selected').show();
314
+
315
+ if (method !== 'init' && options.prop('selected') == true) {
316
+ that.deselect(value, method);
317
+ return;
318
+ }
319
+
320
+ options.prop('selected', true);
321
+
322
+ var selectableOptgroups = that.$selectableUl.children('.ms-optgroup-container');
323
+ if (selectableOptgroups.length > 0){
324
+ selectableOptgroups.each(function(){
325
+ var selectablesLi = $(this).find('.ms-elem-selectable');
326
+ if (that.options.hideOptGroupLabelOnAllSelected !== false && selectablesLi.length === selectablesLi.filter('.ms-selected').length){
327
+ $(this).find('.ms-optgroup-label').hide();
328
+ }
329
+ });
330
+
331
+ }
332
+ if (method !== 'init'){
333
+ ms.trigger('change');
334
+ if (typeof that.options.afterSelect === 'function') {
335
+ that.options.afterSelect.call(this, value);
336
+ }
337
+ }
338
+ }
339
+ },
340
+
341
+ 'deselect' : function(value, method){
342
+ if (typeof value === 'string'){ value = [value]; }
343
+
344
+ var that = this,
345
+ ms = this.$element,
346
+ msIds = $.map(value, function(val){ return(that.sanitize(val)); }),
347
+ selectables = this.$selectableUl.find('#' + msIds.join('-selectable, #')+'-selectable'),
348
+ options = ms.find('option').filter(function(){ return($.inArray(this.value, value) > -1); });
349
+
350
+ selectables.removeClass('ms-selected').children('.ms-elem-selected').hide();
351
+ options.prop('selected', false);
352
+
353
+ var selectableOptgroups = that.$selectableUl.children('.ms-optgroup-container');
354
+ if (selectableOptgroups.length > 0){
355
+ selectableOptgroups.each(function(){
356
+ var selectablesLi = $(this).find('.ms-elem-selectable');
357
+ if (selectablesLi.filter(':not(.ms-selected)').length > 0){
358
+ $(this).find('.ms-optgroup-label').show();
359
+ }
360
+ });
361
+
362
+ }
363
+ if (method !== 'init'){
364
+ ms.trigger('change');
365
+ if (typeof that.options.afterDeselect === 'function') {
366
+ that.options.afterDeselect.call(this, value);
367
+ }
368
+ }
369
+ },
370
+
371
+ 'select_all' : function(){
372
+ var ms = this.$element,
373
+ values = ms.val();
374
+
375
+ ms.find('option:not(":disabled")').prop('selected', true);
376
+ this.$selectableUl.find('.ms-elem-selectable').filter(':not(.'+this.options.disabledClass+')').addClass('ms-selected').children('.ms-elem-selected').show();
377
+ if(this.options.hideOptGroupLabelOnAllSelected !== false){
378
+ this.$selectableUl.find('.ms-optgroup-label').hide();
379
+ }
380
+ ms.trigger('change');
381
+ if (typeof this.options.afterSelect === 'function') {
382
+ var selectedValues = $.grep(ms.val(), function(item){
383
+ return $.inArray(item, values) < 0;
384
+ });
385
+ this.options.afterSelect.call(this, selectedValues);
386
+ }
387
+ },
388
+
389
+ 'deselect_all' : function(){
390
+ var ms = this.$element,
391
+ values = ms.val();
392
+
393
+ ms.find('option').prop('selected', false);
394
+ this.$selectableUl.find('.ms-elem-selectable').removeClass('ms-selected').children('.ms-elem-selected').hide();
395
+ this.$selectableUl.find('.ms-optgroup-label').show();
396
+ this.$selectableUl.focus();
397
+ ms.trigger('change');
398
+ if (typeof this.options.afterDeselect === 'function') {
399
+ this.options.afterDeselect.call(this, values);
400
+ }
401
+ },
402
+
403
+ sanitize: function(value){
404
+ var hash = 0, i, character;
405
+ if (value.length == 0) return hash;
406
+ var ls = 0;
407
+ for (i = 0, ls = value.length; i < ls; i++) {
408
+ character = value.charCodeAt(i);
409
+ hash = ((hash<<5)-hash)+character;
410
+ hash |= 0; // Convert to 32bit integer
411
+ }
412
+ return hash;
413
+ }
414
+ };
415
+
416
+ /* SELECTMULTIPLE PLUGIN DEFINITION
417
+ * ======================= */
418
+
419
+ $.fn.selectMultiple = function () {
420
+ var option = arguments[0],
421
+ args = arguments;
422
+
423
+ return this.each(function () {
424
+ var $this = $(this),
425
+ data = $this.data('selectmultiple'),
426
+ options = $.extend({}, $.fn.selectMultiple.defaults, $this.data(), typeof option === 'object' && option);
427
+
428
+ if (!data){ $this.data('selectmultiple', (data = new SelectMultiple(this, options))); }
429
+
430
+ if (typeof option === 'string'){
431
+ data[option](args[1]);
432
+ } else {
433
+ data.init();
434
+ }
435
+ });
436
+ };
437
+
438
+ $.fn.selectMultiple.defaults = {
439
+ keySelect: [32],
440
+ selectableOptgroup: false,
441
+ disabledClass : 'disabled',
442
+ dblClick : false,
443
+ cssClass: '',
444
+ hideOptGroupLabelOnAllSelected: true
445
+ };
446
+
447
+ $.fn.selectMultiple.Constructor = SelectMultiple;
448
+
449
+ $.fn.insertAt = function(index, $parent) {
450
+ return this.each(function() {
451
+ if (index === 0) {
452
+ $parent.prepend(this);
453
+ } else {
454
+ $parent.children().eq(index - 1).after(this);
455
+ }
456
+ });
457
+ }
458
+
459
+ }(window.jQuery);
@@ -0,0 +1,33 @@
1
+
2
+ // facebook recommend button
3
+ $(function() {
4
+ likebutton = '<fb:like href="" send="" width="100" show_faces="" ' +
5
+ 'font="" layout="button_count" action="recommend">' +
6
+ '</fb:like>';
7
+ $.getScript('http://connect.facebook.net/sl_SI/all.js', function() {
8
+ FB.init({ status: true,
9
+ // appId: 141936272547391,
10
+ cookie: true,
11
+ xfbml: true
12
+ });
13
+ $('#facebook').replaceWith(likebutton);
14
+ });
15
+ });
16
+
17
+
18
+
19
+ /*******************************************************************
20
+ * This is realy dirty hack, because firefox doesn't show ckeditor properly if on hidden id.
21
+ * Not working. Left as reminder. Newer version of ck_editor helped.
22
+ *******************************************************************/
23
+ /*
24
+ $(".ar-form-li").each(function() {
25
+ if (!$(this).hasClass('ar-form-li-selected')) {
26
+ attr = $(this).context.attributes[1].nodeValue
27
+ alert(attr);
28
+ console.log($(this));
29
+ $('#data_' + attr).toggleClass('div_hidden');
30
+ }
31
+ });
32
+ */
33
+
@@ -0,0 +1,22 @@
1
+ // This is a manifest file that'll be compiled into including all the files listed below.
2
+ // Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
3
+ // be included in the compiled file accessible from http://example.com/assets/application.js
4
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
5
+ // the compiled file.
6
+ //
7
+ //= require_self
8
+ //= require jquery3
9
+ //= require jquery_ujs
10
+
11
+ //= require jquery-ui/widgets/tooltip
12
+ //= require jquery-ui/widgets/autocomplete
13
+ //= require jquery-ui/widgets/draggable
14
+ //= require jquery-ui/widgets/droppable
15
+ //= require jquery-ui/widgets/selectable
16
+
17
+ //= require agile/agile
18
+ //= require agile/jquery.datetimepicker
19
+
20
+ //= require agile/jquery.bpopup
21
+ //= require agile/select-multiple
22
+ //= require agile/jstree.min
@@ -0,0 +1,22 @@
1
+ // This is a manifest file that'll be compiled into including all the files listed below.
2
+ // Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
3
+ // be included in the compiled file accessible from http://example.com/assets/application.js
4
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
5
+ // the compiled file.
6
+ //
7
+ //= require_self
8
+ //= require jquery3
9
+ //= require jquery_ujs
10
+
11
+ //= require jquery-ui/widgets/tooltip
12
+ //= require jquery-ui/widgets/autocomplete
13
+ //= require jquery-ui/widgets/draggable
14
+ //= require jquery-ui/widgets/droppable
15
+ //= require jquery-ui/widgets/selectable
16
+
17
+ //= require agile/agile
18
+ //= require agile/jquery.datetimepicker
19
+
20
+ //= require agile/jquery.bpopup
21
+ //= require agile/select-multiple
22
+ //= require agile/jstree.min
@@ -0,0 +1,22 @@
1
+ // This is a manifest file that'll be compiled into including all the files listed below.
2
+ // Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
3
+ // be included in the compiled file accessible from http://example.com/assets/application.js
4
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
5
+ // the compiled file.
6
+
7
+ //= require_self
8
+ //= require jquery3
9
+ //= require jquery_ujs
10
+
11
+ //= require jquery-ui/widgets/tooltip
12
+ //= require jquery-ui/widgets/autocomplete
13
+ //= require jquery-ui/widgets/draggable
14
+ //= require jquery-ui/widgets/droppable
15
+ //= require jquery-ui/widgets/selectable
16
+
17
+ //= require agile/agile
18
+ //= require agile/jquery.datetimepicker
19
+
20
+ //= require agile/jquery.bpopup
21
+ //= require agile/select-multiple
22
+ //= require agile/jstree.min