spec/dummy_app/tmp/cache/assets/development/sprockets/a979dde04e397cb6c5c3bbfe0ff3d6cf in basepack-0.2.0 vs spec/dummy_app/tmp/cache/assets/development/sprockets/a979dde04e397cb6c5c3bbfe0ff3d6cf in basepack-1.0.0.pre.0

- old
+ new

@@ -1,10 +1,9 @@ {I" class:ETI"BundledAsset;FI"logical_path;TI"basepack/forms.js;FI" pathname;TI"O/home/lukas/projects/basepack/app/assets/javascripts/basepack/forms.coffee;FI"content_type;TI"application/javascript;TI" -mtime;Tl+¸Ü®RI" length;TiÿLI" digest;TI"%a078e499c43eebed5ccbb4042e1ab816;FI" source;TI"ÿL(function() { - var _ref, _ref1, _ref10, _ref11, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, - __hasProp = {}.hasOwnProperty, +mtime;Tl+FˆSI" length;Ti•LI" digest;TI"%e6faa4bac25f0e538e71dc2f0d5bd121;FI" source;TI"•L(function() { + var __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; $.fn.findExtended = function(selector) { if (_.str.startsWith(selector, "parent=")) { return this.parents(selector.substring("parent=".length)); @@ -123,12 +122,11 @@ Basepack.Form.Plugins.ColorPicker = (function(_super) { __extends(ColorPicker, _super); function ColorPicker() { - _ref = ColorPicker.__super__.constructor.apply(this, arguments); - return _ref; + return ColorPicker.__super__.constructor.apply(this, arguments); } ColorPicker.prototype.bind = function() { return this.form.find('[data-color]').each(function() { var that; @@ -157,12 +155,11 @@ Basepack.Form.Plugins.DateTime = (function(_super) { __extends(DateTime, _super); function DateTime() { - _ref1 = DateTime.__super__.constructor.apply(this, arguments); - return _ref1; + return DateTime.__super__.constructor.apply(this, arguments); } DateTime.prototype.bind = function() { return this.form.find('[data-datetimepicker]').each(function() { return $(this).datetimepicker($(this).data('options')); @@ -175,12 +172,11 @@ Basepack.Form.Plugins.FileUpload = (function(_super) { __extends(FileUpload, _super); function FileUpload() { - _ref2 = FileUpload.__super__.constructor.apply(this, arguments); - return _ref2; + return FileUpload.__super__.constructor.apply(this, arguments); } FileUpload.prototype.bind = function() { this.form.find('[data-fileupload]').each(function() { var input; @@ -217,27 +213,27 @@ Basepack.Form.Plugins.FilteringSelect = (function(_super) { __extends(FilteringSelect, _super); function FilteringSelect() { - _ref3 = FilteringSelect.__super__.constructor.apply(this, arguments); - return _ref3; + return FilteringSelect.__super__.constructor.apply(this, arguments); } FilteringSelect.prototype.bind = function() { return this.form.find('[data-filteringselect]').each(function() { return Basepack.Form.Plugins.FilteringSelect.select2($(this), $(this).data('options')); }); }; FilteringSelect.select2 = function($el, options) { + var select_options; options = _.extend({ remote_source_params: {}, init: {}, minimum_input_length: 0 }, options); - return $el.select2({ + select_options = { createSearchChoice: function(term, data) { if (options.create_search_choice) { return { id: term, text: term @@ -251,11 +247,22 @@ allowClear: !options.required, multiple: options.multiple, escapeMarkup: function(m) { return m; }, - ajax: { + initSelection: function(element, callback) { + if (options.multiple) { + return Basepack.Form.Plugins.FilteringSelect.select2InitSelectionMultiple(element, callback, options, $el); + } else { + return Basepack.Form.Plugins.FilteringSelect.select2InitSelection(element, callback, options, $el); + } + } + }; + if (options.precached_options) { + select_options.data = options.precached_options; + } else { + select_options.ajax = { url: options.remote_source, dataType: 'json', data: function(term, page) { var params; params = { @@ -270,19 +277,13 @@ return { more: data.length === (options.remote_source_params.per || 20), results: data }; } - }, - initSelection: function(element, callback) { - if (options.multiple) { - return Basepack.Form.Plugins.FilteringSelect.select2InitSelectionMultiple(element, callback, options, $el); - } else { - return Basepack.Form.Plugins.FilteringSelect.select2InitSelection(element, callback, options, $el); - } - } - }); + }; + } + return $el.select2(select_options); }; FilteringSelect.select2InitSelection = function(element, callback, options, $el) { var id; id = element.val(); @@ -350,12 +351,11 @@ Basepack.Form.Plugins.FilteringMultiSelect = (function(_super) { __extends(FilteringMultiSelect, _super); function FilteringMultiSelect() { - _ref4 = FilteringMultiSelect.__super__.constructor.apply(this, arguments); - return _ref4; + return FilteringMultiSelect.__super__.constructor.apply(this, arguments); } FilteringMultiSelect.prototype.bind = function() { return this.form.find('[data-filteringmultiselect]').each(function() { return $(this).select2({ @@ -370,12 +370,11 @@ Basepack.Form.Plugins.WysiwigHtml5 = (function(_super) { __extends(WysiwigHtml5, _super); function WysiwigHtml5() { - _ref5 = WysiwigHtml5.__super__.constructor.apply(this, arguments); - return _ref5; + return WysiwigHtml5.__super__.constructor.apply(this, arguments); } WysiwigHtml5.prototype.bind = function() { return this.form.find('[data-richtext=bootstrap-wysihtml5]').not('.bootstrap-wysihtml5ed').each(function() { $(this).addClass('bootstrap-wysihtml5ed'); @@ -390,12 +389,11 @@ Basepack.Form.Plugins.RemoveOnCollapse = (function(_super) { __extends(RemoveOnCollapse, _super); function RemoveOnCollapse() { - _ref6 = RemoveOnCollapse.__super__.constructor.apply(this, arguments); - return _ref6; + return RemoveOnCollapse.__super__.constructor.apply(this, arguments); } RemoveOnCollapse.priority = -1000; RemoveOnCollapse.prototype.bind = function() { @@ -428,12 +426,11 @@ Basepack.Form.Plugins.DependantFilteringSelect = (function(_super) { __extends(DependantFilteringSelect, _super); function DependantFilteringSelect() { - _ref7 = DependantFilteringSelect.__super__.constructor.apply(this, arguments); - return _ref7; + return DependantFilteringSelect.__super__.constructor.apply(this, arguments); } DependantFilteringSelect.prototype.bind = function() { return this.form.find('[data-dependant-filteringselect]').each(function() { var dependsOn, that; @@ -459,12 +456,11 @@ Basepack.Form.Plugins.HiddeningFilteringSelect = (function(_super) { __extends(HiddeningFilteringSelect, _super); function HiddeningFilteringSelect() { - _ref8 = HiddeningFilteringSelect.__super__.constructor.apply(this, arguments); - return _ref8; + return HiddeningFilteringSelect.__super__.constructor.apply(this, arguments); } HiddeningFilteringSelect.prototype.bind = function() { var plugin; plugin = this; @@ -497,29 +493,28 @@ return HiddeningFilteringSelect; })(Basepack.Form.Plugin); + /** * Dynamically show/hide fields based on other field value. * takes all elements with data-dynamic-fields and use this data attribute as an configuration: @param{data-dynamic-fields} array of actions. Each action is a hash with keys: condition - condition which should be met (Stirng: field has to equal, Array: field has to match one of item of array) field_actions - hash. Keys are other fields on which are taken action. * Exmaple: [{"condition":["aaa","hide"],"field_actions":{"www":{"visible":false}}},{"condition":"xxx","field_actions":{"www":{"visible":true}}}] - */ + */ - Basepack.Form.Plugins.DynamicFields = (function(_super) { __extends(DynamicFields, _super); function DynamicFields() { - _ref9 = DynamicFields.__super__.constructor.apply(this, arguments); - return _ref9; + return DynamicFields.__super__.constructor.apply(this, arguments); } DynamicFields.prototype.value_checker = function(field_value, value_condition) { if ((Object.prototype.toString.call(value_condition)) === '[object Array]') { return value_condition.indexOf(field_value) !== -1; @@ -580,12 +575,11 @@ Basepack.Form.Plugins.Select2 = (function(_super) { __extends(Select2, _super); function Select2() { - _ref10 = Select2.__super__.constructor.apply(this, arguments); - return _ref10; + return Select2.__super__.constructor.apply(this, arguments); } Select2.prototype.bind = function() { return this.form.find('[data-select]').each(function() { return $(this).select2($(this).data('select')); @@ -598,12 +592,11 @@ Basepack.Form.Plugins.Orderable = (function(_super) { __extends(Orderable, _super); function Orderable() { - _ref11 = Orderable.__super__.constructor.apply(this, arguments); - return _ref11; + return Orderable.__super__.constructor.apply(this, arguments); } Orderable.prototype.update_sort_order = function() { console.log('volam update_sort_order'); return this.form.find('.fields').each(function(idx, fields) { @@ -614,22 +607,23 @@ Orderable.prototype.bind = function() { var plugin; plugin = this; return this.form.find('[data-orderable]').each(function() { - var _this = this; return $(this).sortable({ handle: '.nested-form-drag', axis: "y", - stop: function() { - return plugin.update_sort_order(); - } + stop: (function(_this) { + return function() { + return plugin.update_sort_order(); + }; + })(this) }); }); }; return Orderable; })(Basepack.Form.Plugin); }).call(this); -;TI"required_assets_digest;TI"%f565d2f317d2ed6155f34b1426ec05ae;FI" _version;TI"%01dc9d4cb5b0ece13ed47cc1cabfeb41;F +;TI"required_assets_digest;TI"%25d542b4129650b0c978ee604c7bb408;FI" _version;TI"%361c512b9086418778df946c0d278f91;F \ No newline at end of file