carnival 0.0.56 → 0.0.57
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/carnival/admin.js +3 -0
- data/app/assets/javascripts/carnival/admin.js.orig +25 -0
- data/app/assets/javascripts/carnival/external/select2/select2.min.js +23 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_ar.js +19 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_az.js +20 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_bg.js +20 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_ca.js +19 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_cs.js +51 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_da.js +19 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_de.js +18 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_el.js +19 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_en.js.template +20 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_es.js +17 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_et.js +19 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_eu.js +45 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_fa.js +21 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_fi.js +30 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_fr.js +18 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_gl.js +45 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_he.js +19 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_hr.js +24 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_hu.js +17 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_id.js +19 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_is.js +17 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_it.js +17 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_ja.js +17 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_ka.js +19 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_ko.js +19 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_lt.js +26 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_lv.js +19 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_mk.js +19 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_ms.js +19 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_nl.js +17 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_no.js +20 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_pl.js +25 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_pt-BR.js +17 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_pt-PT.js +17 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_ro.js +17 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_rs.js +19 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_ru.js +23 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_sk.js +50 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_sv.js +19 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_th.js +19 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_tr.js +19 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_ug-CN.js +16 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_uk.js +25 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_vi.js +20 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_zh-CN.js +16 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_zh-TW.js +16 -0
- data/app/assets/javascripts/carnival/select_remote.js +60 -0
- data/app/assets/javascripts/carnival/vizir_admin.js +2 -1
- data/app/assets/javascripts/carnival/vizir_admin.js.orig +144 -0
- data/app/assets/stylesheets/carnival/admin.css +1 -0
- data/app/assets/stylesheets/carnival/main.css +4 -0
- data/app/assets/stylesheets/carnival/select2-spinner.gif +0 -0
- data/app/assets/stylesheets/carnival/select2.css +704 -0
- data/app/assets/stylesheets/carnival/select2.png +0 -0
- data/app/assets/stylesheets/carnival/select2x2.png +0 -0
- data/app/controllers/carnival/base_admin_controller.rb +12 -0
- data/app/inputs/carnival_select_remote_input.rb +29 -0
- data/app/views/carnival/shared/form/_field.html.haml +7 -0
- data/app/views/carnival/shared/form/_field.html.haml.orig +14 -11
- data/app/views/carnival/shared/form/_form.html.haml +5 -1
- data/app/views/carnival/shared/form/_form.html.haml.orig +120 -0
- data/app/views/carnival/shared/form/_nested_form_options.html.haml +1 -1
- data/app/views/carnival/shared/form/_nested_form_options.html.haml.orig +47 -0
- data/lib/carnival/routes.rb +1 -0
- data/lib/carnival/routes.rb.orig +24 -0
- data/lib/carnival/version.rb +1 -1
- data/lib/carnival/version.rb.orig +3 -3
- data/test/dummy/app/controllers/admin/countries_controller.rb +1 -0
- data/test/dummy/app/presenters/admin/state_presenter.rb +2 -1
- data/test/dummy/app/presenters/admin/state_presenter.rb.orig +50 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/log/bullet.log +215 -0
- data/test/dummy/log/development.log +56326 -0
- data/test/dummy/tmp/cache/assets/development/sass/509d6df7de260d7d7b30aaf213f62ecc911d86f4/select2.scssc +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/018a93c2452c8104980bcd5778c4f903 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/0771f824a0b668f566e7c11953b6065e +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/0bbd04f3201327a4cdd08aa5beea2422 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/0e538066312487cf0c93484b2a433017 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/12adab320a9b9986d13ed94e39efe2e7 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/1367e1fa08f1b8c7abd298d4bbe85c1a +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/14a446a1806cd2ee255698c10b3cd391 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/22ee6768794b3c3c55570719479481c3 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/24d23fdd4c311a9447e4c8c19c97d48e +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/29317ab42cc07bf908f29827920b27d5 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/29c571d9350b75a47945757daf5ef26f +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/2c4a028e3e3b137a5e49c13178239cce +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/2dfdac7588010f579a833be228971375 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/30c8c2e6ca355103a267133f6b45b0ce +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/32d06d5bee6f865ba0f92224a787a90a +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/34dba06ee0eb7a742ecdfcba69edb56e +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/379fa199e19b70bbee3ac80c78e0d81e +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/39d34c0caaa6f36d684fac1898a7f88f +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/3d4686d9bb627b7c725f000130c5a61d +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/3d8100b6e405407290dcf994ef05e0b7 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/3eb8fc367b74dbe8ae50e0f98feec6bb +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/3f9e96f5004cdb0ba971394c41c76931 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/41249a08e767749660864b8a126871e4 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/43797547fd9a4d394bb0f7a99b2b3a94 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/43f27cc92ef38f6a01575708b2fa0e97 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/4771cad53166b45022c6d03cb4b8c1e2 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/48693f24b0d6df0cc626066ce01674e3 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/4a7a4dcd9fea9bd2e287771c51f96631 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/4b6e6db955179fabe966a77cecb884fc +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/4b8f852230d4e126ed2a8f54594bc2ca +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/4e4b1f24c5e69f2f305f6d6483a1605c +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/4fc67dc5428a9f07a32dd1bb9e1447ae +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/50b3d3fa409e82b9990432561974e533 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/51537bd5728cad7f016be9b074c4f3ee +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/51bc502ce2fcf333e1123f4b19fcf7f8 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/536648929c703c8c5e964b502b2095ff +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/5644ad965098c5b865233d32caa78fa2 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/565023fdd3960225e817ec043b2d9474 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/56a682a9df1f53c8d67f2467389995b2 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/63982917dbb816db857477c2a2e7f999 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/69b3c18a3b9e45cd69a6df6c91f1807b +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/6c56ac77ea3b80472eb076fda62e0259 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/6c95dc85b0bd5df72197be27cb987cb0 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/6d806eaa317f200bbf2832a0abf1c1cc +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/6dbcb09bb8b13a79ba150908ac8a5491 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/6ebd06491e132b3907c33181ba6455d8 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/752d59d33a640efa2745467df3e2cb7b +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/78b5037e05950c87864989c8fd18524a +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/79938d0a132e22a9a8f9cb59799aa546 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/79f249600921bff9906cd4f6418852d6 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/8576d7c22dbd8222ab27a6c47f56a65c +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/874ebf15c13c8699187b0c9e5dc52175 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/9285a4d2fa6444ced9a4d2775ebead57 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/929914a16eaca5537bbc9b4d33646223 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/9ae99eba4f0f2e46d6bd58c98d39a1f9 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/9dbe0a36629f740426a301876917b9d3 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/9dcf3f13f133f78ee4595ed37117b05b +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/a0a55ae2ade6651b5e3a02c48eb65f88 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/a104711413193d8cbfa431662760b38a +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/a23f793f10f58c10ce34d68d181ed32f +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/a515ea5e8aa465597bf897e31735b32d +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/a68cd2439f6cc8e7f002b1845ab3fd0c +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/adafe641ec176fcf476a9a200f7d561f +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/ae269fb1b4129501c9b8ca317b0cd7e7 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/b740fd10a7de993ae4db7f1f5df909d6 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/bc4c8f727196d1e399090596cae4a85b +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/bf313b342653b1b3e509da03d61866e2 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/bf81a479ccdf9a6ba78ef5a5647d8e16 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/bfae304b927120a1b379c8dfdcf03cbb +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/c34cb2d9c5caf3927f220b9e43f6762d +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/c72101732682999b6ca050f007fc6467 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/c753ab5855fa7322e298f05684a45d0f +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/c8927e934e7960fc7907b6fc02ea7f08 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/c980544b5828a643ecaa8e784897c2c2 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/caa549dc4bdcddd64e487a5827e64a80 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/cae24edceb694d087d7a1547f551ee34 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/cb180d1ba68a565b8373b22576170eb8 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/cc2c3f8b87c5b787305412a3076058db +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/d16461dfcae4b782f721ebd81e4f8740 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/d5a920fbfad1410d8ec2dbc5029bbaf6 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/d6327a0916e2e516fcf7ab7c5520c7a0 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/d73ac23504860006ee8365d9031bd98b +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/daf428b2f08afc738dfcd85d872d49c4 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/dc5a6e1e848dfc338a281846eb757ef2 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/dcedf863f6acc3e1f21ec11434a77bf7 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/e0352d0f97751491adbe6a94832772af +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/e4298973f799acdce289752c24bfddf2 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/e9c81ca91323dab8977ffd8a459cab06 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/eb7d39f60d584b68af01ee0b7fa59e9d +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/ef5b9ae70f88795292472efad672fc1b +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/f1e75c209067b23f5c0c7bf2006c43d0 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/f5c9348795319821f3309d4e03bb9fdb +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/f69e8aafb38584272cbcbca08f3085d3 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/f6b09a5a33ecad520452011007930e0e +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/f7ab949c8c6b7ef3f2b743ebd98f9f59 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
- metadata +267 -46
- data/app/models/carnival/field.rb.orig +0 -157
@@ -0,0 +1,23 @@
|
|
1
|
+
/**
|
2
|
+
* Select2 Russian translation.
|
3
|
+
*
|
4
|
+
* @author Uriy Efremochkin <efremochkin@uriy.me>
|
5
|
+
*/
|
6
|
+
(function ($) {
|
7
|
+
"use strict";
|
8
|
+
|
9
|
+
$.fn.select2.locales['ru'] = {
|
10
|
+
formatNoMatches: function () { return "Совпадений не найдено"; },
|
11
|
+
formatInputTooShort: function (input, min) { return "Пожалуйста, введите еще хотя бы" + character(min - input.length); },
|
12
|
+
formatInputTooLong: function (input, max) { return "Пожалуйста, введите на" + character(input.length - max) + " меньше"; },
|
13
|
+
formatSelectionTooBig: function (limit) { return "Вы можете выбрать не более " + limit + " элемент" + (limit%10 == 1 && limit%100 != 11 ? "а" : "ов"); },
|
14
|
+
formatLoadMore: function (pageNumber) { return "Загрузка данных…"; },
|
15
|
+
formatSearching: function () { return "Поиск…"; }
|
16
|
+
};
|
17
|
+
|
18
|
+
$.extend($.fn.select2.defaults, $.fn.select2.locales['ru']);
|
19
|
+
|
20
|
+
function character (n) {
|
21
|
+
return " " + n + " символ" + (n%10 < 5 && n%10 > 0 && (n%100 < 5 || n%100 > 20) ? n%10 > 1 ? "a" : "" : "ов");
|
22
|
+
}
|
23
|
+
})(jQuery);
|
@@ -0,0 +1,50 @@
|
|
1
|
+
/**
|
2
|
+
* Select2 Slovak translation.
|
3
|
+
*
|
4
|
+
* Author: David Vallner <david@vallner.net>
|
5
|
+
*/
|
6
|
+
(function ($) {
|
7
|
+
"use strict";
|
8
|
+
// use text for the numbers 2 through 4
|
9
|
+
var smallNumbers = {
|
10
|
+
2: function(masc) { return (masc ? "dva" : "dve"); },
|
11
|
+
3: function() { return "tri"; },
|
12
|
+
4: function() { return "štyri"; }
|
13
|
+
};
|
14
|
+
$.fn.select2.locales['sk'] = {
|
15
|
+
formatNoMatches: function () { return "Nenašli sa žiadne položky"; },
|
16
|
+
formatInputTooShort: function (input, min) {
|
17
|
+
var n = min - input.length;
|
18
|
+
if (n == 1) {
|
19
|
+
return "Prosím, zadajte ešte jeden znak";
|
20
|
+
} else if (n <= 4) {
|
21
|
+
return "Prosím, zadajte ešte ďalšie "+smallNumbers[n](true)+" znaky";
|
22
|
+
} else {
|
23
|
+
return "Prosím, zadajte ešte ďalších "+n+" znakov";
|
24
|
+
}
|
25
|
+
},
|
26
|
+
formatInputTooLong: function (input, max) {
|
27
|
+
var n = input.length - max;
|
28
|
+
if (n == 1) {
|
29
|
+
return "Prosím, zadajte o jeden znak menej";
|
30
|
+
} else if (n <= 4) {
|
31
|
+
return "Prosím, zadajte o "+smallNumbers[n](true)+" znaky menej";
|
32
|
+
} else {
|
33
|
+
return "Prosím, zadajte o "+n+" znakov menej";
|
34
|
+
}
|
35
|
+
},
|
36
|
+
formatSelectionTooBig: function (limit) {
|
37
|
+
if (limit == 1) {
|
38
|
+
return "Môžete zvoliť len jednu položku";
|
39
|
+
} else if (limit <= 4) {
|
40
|
+
return "Môžete zvoliť najviac "+smallNumbers[limit](false)+" položky";
|
41
|
+
} else {
|
42
|
+
return "Môžete zvoliť najviac "+limit+" položiek";
|
43
|
+
}
|
44
|
+
},
|
45
|
+
formatLoadMore: function (pageNumber) { return "Načítavajú sa ďalšie výsledky…"; },
|
46
|
+
formatSearching: function () { return "Vyhľadávanie…"; }
|
47
|
+
};
|
48
|
+
|
49
|
+
$.extend($.fn.select2.defaults, $.fn.select2.locales['sk']);
|
50
|
+
})(jQuery);
|
@@ -0,0 +1,19 @@
|
|
1
|
+
/**
|
2
|
+
* Select2 Swedish translation.
|
3
|
+
*
|
4
|
+
* Author: Jens Rantil <jens.rantil@telavox.com>
|
5
|
+
*/
|
6
|
+
(function ($) {
|
7
|
+
"use strict";
|
8
|
+
|
9
|
+
$.fn.select2.locales['sv'] = {
|
10
|
+
formatNoMatches: function () { return "Inga träffar"; },
|
11
|
+
formatInputTooShort: function (input, min) { var n = min - input.length; return "Var god skriv in " + n + (n>1 ? " till tecken" : " tecken till"); },
|
12
|
+
formatInputTooLong: function (input, max) { var n = input.length - max; return "Var god sudda ut " + n + " tecken"; },
|
13
|
+
formatSelectionTooBig: function (limit) { return "Du kan max välja " + limit + " element"; },
|
14
|
+
formatLoadMore: function (pageNumber) { return "Laddar fler resultat…"; },
|
15
|
+
formatSearching: function () { return "Söker…"; }
|
16
|
+
};
|
17
|
+
|
18
|
+
$.extend($.fn.select2.defaults, $.fn.select2.locales['sv']);
|
19
|
+
})(jQuery);
|
@@ -0,0 +1,19 @@
|
|
1
|
+
/**
|
2
|
+
* Select2 Thai translation.
|
3
|
+
*
|
4
|
+
* Author: Atsawin Chaowanakritsanakul <joke@nakhon.net>
|
5
|
+
*/
|
6
|
+
(function ($) {
|
7
|
+
"use strict";
|
8
|
+
|
9
|
+
$.fn.select2.locales['th'] = {
|
10
|
+
formatNoMatches: function () { return "ไม่พบข้อมูล"; },
|
11
|
+
formatInputTooShort: function (input, min) { var n = min - input.length; return "โปรดพิมพ์เพิ่มอีก " + n + " ตัวอักษร"; },
|
12
|
+
formatInputTooLong: function (input, max) { var n = input.length - max; return "โปรดลบออก " + n + " ตัวอักษร"; },
|
13
|
+
formatSelectionTooBig: function (limit) { return "คุณสามารถเลือกได้ไม่เกิน " + limit + " รายการ"; },
|
14
|
+
formatLoadMore: function (pageNumber) { return "กำลังค้นข้อมูลเพิ่ม…"; },
|
15
|
+
formatSearching: function () { return "กำลังค้นข้อมูล…"; }
|
16
|
+
};
|
17
|
+
|
18
|
+
$.extend($.fn.select2.defaults, $.fn.select2.locales['th']);
|
19
|
+
})(jQuery);
|
@@ -0,0 +1,19 @@
|
|
1
|
+
/**
|
2
|
+
* Select2 Turkish translation.
|
3
|
+
*
|
4
|
+
* Author: Salim KAYABAŞI <salim.kayabasi@gmail.com>
|
5
|
+
*/
|
6
|
+
(function ($) {
|
7
|
+
"use strict";
|
8
|
+
|
9
|
+
$.fn.select2.locales['tr'] = {
|
10
|
+
formatNoMatches: function () { return "Sonuç bulunamadı"; },
|
11
|
+
formatInputTooShort: function (input, min) { var n = min - input.length; return "En az " + n + " karakter daha girmelisiniz"; },
|
12
|
+
formatInputTooLong: function (input, max) { var n = input.length - max; return n + " karakter azaltmalısınız"; },
|
13
|
+
formatSelectionTooBig: function (limit) { return "Sadece " + limit + " seçim yapabilirsiniz"; },
|
14
|
+
formatLoadMore: function (pageNumber) { return "Daha fazla…"; },
|
15
|
+
formatSearching: function () { return "Aranıyor…"; }
|
16
|
+
};
|
17
|
+
|
18
|
+
$.extend($.fn.select2.defaults, $.fn.select2.locales['tr']);
|
19
|
+
})(jQuery);
|
@@ -0,0 +1,16 @@
|
|
1
|
+
/**
|
2
|
+
* Select2 Uyghur translation
|
3
|
+
*/
|
4
|
+
(function ($) {
|
5
|
+
"use strict";
|
6
|
+
$.fn.select2.locales['ug-CN'] = {
|
7
|
+
formatNoMatches: function () { return "ماس كېلىدىغان ئۇچۇر تېپىلمىدى"; },
|
8
|
+
formatInputTooShort: function (input, min) { var n = min - input.length; return "يەنە " + n + " ھەرپ كىرگۈزۈڭ";},
|
9
|
+
formatInputTooLong: function (input, max) { var n = input.length - max; return "" + n + "ھەرپ ئۆچۈرۈڭ";},
|
10
|
+
formatSelectionTooBig: function (limit) { return "ئەڭ كۆپ بولغاندا" + limit + " تال ئۇچۇر تاللىيالايسىز"; },
|
11
|
+
formatLoadMore: function (pageNumber) { return "ئۇچۇرلار ئوقۇلىۋاتىدۇ…"; },
|
12
|
+
formatSearching: function () { return "ئىزدەۋاتىدۇ…"; }
|
13
|
+
};
|
14
|
+
|
15
|
+
$.extend($.fn.select2.defaults, $.fn.select2.locales['ug-CN']);
|
16
|
+
})(jQuery);
|
@@ -0,0 +1,25 @@
|
|
1
|
+
/**
|
2
|
+
* Select2 Ukrainian translation.
|
3
|
+
*
|
4
|
+
* @author bigmihail <bigmihail@bigmir.net>
|
5
|
+
* @author Uriy Efremochkin <efremochkin@uriy.me>
|
6
|
+
*/
|
7
|
+
(function ($) {
|
8
|
+
"use strict";
|
9
|
+
|
10
|
+
$.fn.select2.locales['uk'] = {
|
11
|
+
formatMatches: function (matches) { return character(matches, "результат") + " знайдено, використовуйте клавіші зі стрілками вверх та вниз для навігації."; },
|
12
|
+
formatNoMatches: function () { return "Нічого не знайдено"; },
|
13
|
+
formatInputTooShort: function (input, min) { return "Введіть буль ласка ще " + character(min - input.length, "символ"); },
|
14
|
+
formatInputTooLong: function (input, max) { return "Введіть буль ласка на " + character(input.length - max, "символ") + " менше"; },
|
15
|
+
formatSelectionTooBig: function (limit) { return "Ви можете вибрати лише " + character(limit, "елемент"); },
|
16
|
+
formatLoadMore: function (pageNumber) { return "Завантаження даних…"; },
|
17
|
+
formatSearching: function () { return "Пошук…"; }
|
18
|
+
};
|
19
|
+
|
20
|
+
$.extend($.fn.select2.defaults, $.fn.select2.locales['uk']);
|
21
|
+
|
22
|
+
function character (n, word) {
|
23
|
+
return n + " " + word + (n%10 < 5 && n%10 > 0 && (n%100 < 5 || n%100 > 19) ? n%10 > 1 ? "и" : "" : "ів");
|
24
|
+
}
|
25
|
+
})(jQuery);
|
@@ -0,0 +1,20 @@
|
|
1
|
+
/**
|
2
|
+
* Select2 Vietnamese translation.
|
3
|
+
*
|
4
|
+
* Author: Long Nguyen <olragon@gmail.com>
|
5
|
+
*/
|
6
|
+
(function ($) {
|
7
|
+
"use strict";
|
8
|
+
|
9
|
+
$.fn.select2.locales['vi'] = {
|
10
|
+
formatNoMatches: function () { return "Không tìm thấy kết quả"; },
|
11
|
+
formatInputTooShort: function (input, min) { var n = min - input.length; return "Vui lòng nhập nhiều hơn " + n + " ký tự" + (n == 1 ? "" : "s"); },
|
12
|
+
formatInputTooLong: function (input, max) { var n = input.length - max; return "Vui lòng nhập ít hơn " + n + " ký tự" + (n == 1? "" : "s"); },
|
13
|
+
formatSelectionTooBig: function (limit) { return "Chỉ có thể chọn được " + limit + " tùy chọn" + (limit == 1 ? "" : "s"); },
|
14
|
+
formatLoadMore: function (pageNumber) { return "Đang lấy thêm kết quả…"; },
|
15
|
+
formatSearching: function () { return "Đang tìm…"; }
|
16
|
+
};
|
17
|
+
|
18
|
+
$.extend($.fn.select2.defaults, $.fn.select2.locales['vi']);
|
19
|
+
})(jQuery);
|
20
|
+
|
@@ -0,0 +1,16 @@
|
|
1
|
+
/**
|
2
|
+
* Select2 Chinese translation
|
3
|
+
*/
|
4
|
+
(function ($) {
|
5
|
+
"use strict";
|
6
|
+
$.fn.select2.locales['zh-CN'] = {
|
7
|
+
formatNoMatches: function () { return "没有找到匹配项"; },
|
8
|
+
formatInputTooShort: function (input, min) { var n = min - input.length; return "请再输入" + n + "个字符";},
|
9
|
+
formatInputTooLong: function (input, max) { var n = input.length - max; return "请删掉" + n + "个字符";},
|
10
|
+
formatSelectionTooBig: function (limit) { return "你只能选择最多" + limit + "项"; },
|
11
|
+
formatLoadMore: function (pageNumber) { return "加载结果中…"; },
|
12
|
+
formatSearching: function () { return "搜索中…"; }
|
13
|
+
};
|
14
|
+
|
15
|
+
$.extend($.fn.select2.defaults, $.fn.select2.locales['zh-CN']);
|
16
|
+
})(jQuery);
|
@@ -0,0 +1,16 @@
|
|
1
|
+
/**
|
2
|
+
* Select2 Traditional Chinese translation
|
3
|
+
*/
|
4
|
+
(function ($) {
|
5
|
+
"use strict";
|
6
|
+
$.fn.select2.locales['zh-TW'] = {
|
7
|
+
formatNoMatches: function () { return "沒有找到相符的項目"; },
|
8
|
+
formatInputTooShort: function (input, min) { var n = min - input.length; return "請再輸入" + n + "個字元";},
|
9
|
+
formatInputTooLong: function (input, max) { var n = input.length - max; return "請刪掉" + n + "個字元";},
|
10
|
+
formatSelectionTooBig: function (limit) { return "你只能選擇最多" + limit + "項"; },
|
11
|
+
formatLoadMore: function (pageNumber) { return "載入中…"; },
|
12
|
+
formatSearching: function () { return "搜尋中…"; }
|
13
|
+
};
|
14
|
+
|
15
|
+
$.extend($.fn.select2.defaults, $.fn.select2.locales['zh-TW']);
|
16
|
+
})(jQuery);
|
@@ -0,0 +1,60 @@
|
|
1
|
+
|
2
|
+
var selectRemote = function(){
|
3
|
+
|
4
|
+
$('.select2-remote').each(function(){
|
5
|
+
if(!$(this).closest('.nested-form-list').length)//Dont execute for nested forms selects
|
6
|
+
addSelect2ToField(this);
|
7
|
+
});
|
8
|
+
}
|
9
|
+
|
10
|
+
var addSelect2ToField = function(field){
|
11
|
+
var fieldParent = $(field).parent();
|
12
|
+
var modelName = fieldParent.data('select-model');
|
13
|
+
var searchField = fieldParent.data('select-search_field');
|
14
|
+
var presenterName = fieldParent.data('select-presenter');
|
15
|
+
|
16
|
+
$(field).select2({
|
17
|
+
placeholder: "Selecione ...",
|
18
|
+
minimumInputLength: 2,
|
19
|
+
width: '100%',
|
20
|
+
ajax: buildAjaxFunction(searchField, modelName, presenterName),
|
21
|
+
initSelection: function(element, callback) {
|
22
|
+
var text = fieldParent.data('select-text');
|
23
|
+
var id = fieldParent.data('select-id');
|
24
|
+
if(!id)
|
25
|
+
return;
|
26
|
+
var data = {
|
27
|
+
id: id,
|
28
|
+
text: text
|
29
|
+
}
|
30
|
+
callback(data);
|
31
|
+
},
|
32
|
+
dropdownCssClass: "bigdrop", // apply css that makes the dropdown taller
|
33
|
+
escapeMarkup: function (m) { return m; } // we do not want to escape markup since we are displaying html in results
|
34
|
+
});
|
35
|
+
$(field).on("change", function(e) {
|
36
|
+
var select = $(this).parent().find('select');
|
37
|
+
select.find('option').remove().end().append('<option value='+e.added.id+'>'+e.added.text+'</option>')
|
38
|
+
})
|
39
|
+
|
40
|
+
}
|
41
|
+
|
42
|
+
var buildAjaxFunction = function(searchField, modelName, presenterName){
|
43
|
+
var func = { // instead of writing the function to execute the request we use Select2's convenient helper
|
44
|
+
url: "/carnival/load_select_options",
|
45
|
+
dataType: 'json',
|
46
|
+
quietMillis: 1000,
|
47
|
+
data: function (term, page) {
|
48
|
+
return {
|
49
|
+
q: term,
|
50
|
+
search_field: searchField,
|
51
|
+
model_name: modelName,
|
52
|
+
presenter_name: presenterName
|
53
|
+
};
|
54
|
+
},
|
55
|
+
results: function (data, page) {
|
56
|
+
return {results: data};
|
57
|
+
}
|
58
|
+
}
|
59
|
+
return func;
|
60
|
+
}
|
@@ -98,8 +98,9 @@ var formLoad = function(){
|
|
98
98
|
$(".datepicker").datepicker({
|
99
99
|
dateFormat: 'yy-mm-dd'
|
100
100
|
});
|
101
|
-
$('
|
101
|
+
$('.chosen').chosen();
|
102
102
|
$(".chosen-container").css({width:$(".chosen-container").parent().css("width")})
|
103
|
+
selectRemote();
|
103
104
|
}
|
104
105
|
|
105
106
|
$(document).ready(function(){
|
@@ -0,0 +1,144 @@
|
|
1
|
+
// add/remove dynamic fields
|
2
|
+
var Carnival = {}
|
3
|
+
String.prototype.unescapeHtml = function () {
|
4
|
+
var temp = document.createElement("div");
|
5
|
+
temp.innerHTML = this;
|
6
|
+
var result = temp.childNodes[0].nodeValue;
|
7
|
+
temp.removeChild(temp.firstChild);
|
8
|
+
return result;
|
9
|
+
}
|
10
|
+
|
11
|
+
function removeFields(link) {
|
12
|
+
$(link).prev("input[type=hidden]").val("1");
|
13
|
+
$(link).closest(".fields").slideToggle("show");
|
14
|
+
}
|
15
|
+
|
16
|
+
function addFields(link, association, content) {
|
17
|
+
var numItems = $('.fields').length
|
18
|
+
var new_id = numItems
|
19
|
+
var regexp = new RegExp("new_" + association, "g")
|
20
|
+
$(link).parent().before(content.unescapeHtml().replace(regexp, new_id));
|
21
|
+
formLoad();
|
22
|
+
return false;
|
23
|
+
}
|
24
|
+
|
25
|
+
function openPopUp(url){
|
26
|
+
$.colorbox({href:url, opacity:0.5, width:"90%"});
|
27
|
+
}
|
28
|
+
|
29
|
+
function markActive(){
|
30
|
+
$('.dropdown_main_menu_sublevel a.actived').closest('.dropdown_main_menu_sublevel').show();
|
31
|
+
}
|
32
|
+
|
33
|
+
// page load functions
|
34
|
+
|
35
|
+
var pageLoad = function(){
|
36
|
+
$('ul.menu').clone().appendTo('div.menu.short');
|
37
|
+
|
38
|
+
|
39
|
+
$('.dropdown_main_menu_sublevel').hide(0);
|
40
|
+
|
41
|
+
$('.menu.full .sublevel').click(function(){
|
42
|
+
$(this).next().slideToggle(200)
|
43
|
+
return false
|
44
|
+
})
|
45
|
+
|
46
|
+
$('.menu.short .sublevel').parent().mouseover(function(){
|
47
|
+
$(this).children().next().fadeIn(0)
|
48
|
+
return false
|
49
|
+
})
|
50
|
+
|
51
|
+
$('.menu.short .sublevel').parent().mouseleave(function(){
|
52
|
+
$(this).children().next().fadeOut(0)
|
53
|
+
return false
|
54
|
+
})
|
55
|
+
|
56
|
+
$('.dataTables_info').insertAfter('.dataTables_paginate');
|
57
|
+
$(".chosen").chosen({no_results_text: "Nenhum resultado encontrado", disable_search_threshold: 5});
|
58
|
+
$(".popup").click(function(e){
|
59
|
+
e.preventDefault()
|
60
|
+
var url = $(this).attr('href')
|
61
|
+
abrirPopUp(url)
|
62
|
+
})
|
63
|
+
|
64
|
+
markActive()
|
65
|
+
|
66
|
+
$('div.menu.short').show(0);
|
67
|
+
$('div.menu.short .dropdown_main_menu_sublevel').hide();
|
68
|
+
$('#content').toggleClass('menu-opened');
|
69
|
+
$('.short ul.dropdown_main_menu li ul li a.actived').parent().parent().parent().addClass('active');
|
70
|
+
$('.full ul.dropdown_main_menu li ul li a.actived').parent().parent().parent().addClass('active');
|
71
|
+
|
72
|
+
if($('ul.menu li.active a').html())
|
73
|
+
$('#header').append("<h1>"+$('ul.menu li.active a').html()+" » "+$('ul.menu a.actived').html()+"</h1>")
|
74
|
+
|
75
|
+
$('.full ul.dropdown_main_menu li:has(ul)').each(function( index ) {
|
76
|
+
$('.short ul.dropdown_main_menu li:has(ul) > ul').eq(index).prepend('<h1>'+$('.full ul.dropdown_main_menu li:has(ul) > a').eq(index).html()+'</h1>')
|
77
|
+
});
|
78
|
+
|
79
|
+
var $lefty = $('div.menu.full');
|
80
|
+
$lefty.animate({
|
81
|
+
marginLeft: '-20%'
|
82
|
+
}, 100);
|
83
|
+
|
84
|
+
$('.minify').on("click", function(){
|
85
|
+
var $lefty = $('div.menu.full');
|
86
|
+
$lefty.animate({
|
87
|
+
marginLeft: parseInt($lefty.css('margin-left'),10) == 0 ?
|
88
|
+
-$lefty.outerWidth()-2:
|
89
|
+
0
|
90
|
+
}, 100);
|
91
|
+
setTimeout("$('div.menu.short').fadeToggle(100)", 0)
|
92
|
+
setTimeout("$('#content').toggleClass('menu-opened')", 0)
|
93
|
+
})
|
94
|
+
};
|
95
|
+
|
96
|
+
// form load functions
|
97
|
+
|
98
|
+
function setupDateFields(){
|
99
|
+
var dateOptions = {
|
100
|
+
format: 'Y/m/d',
|
101
|
+
mask: true,
|
102
|
+
timepicker: false
|
103
|
+
};
|
104
|
+
var dateTimeOptions = $.extend({}, dateOptions, { timepicker: true, format: 'Y/m/d H:i'})
|
105
|
+
|
106
|
+
$(".datepicker").datetimepicker(dateOptions);
|
107
|
+
$(".datetimepicker").datetimepicker(dateTimeOptions);
|
108
|
+
}
|
109
|
+
|
110
|
+
var formLoad = function(){
|
111
|
+
<<<<<<< HEAD
|
112
|
+
setupDateFields();
|
113
|
+
$('select').chosen();
|
114
|
+
$(".chosen-container").css({width:$(".chosen-container").parent().css("width")})
|
115
|
+
$('input.previewable').change(function() {
|
116
|
+
var that = $( this );
|
117
|
+
var reader = new FileReader();
|
118
|
+
var img = $(this).next('img.previewable');
|
119
|
+
|
120
|
+
reader.onload = function(e) {
|
121
|
+
var val = e.target.result;
|
122
|
+
img.attr('src', val);
|
123
|
+
}
|
124
|
+
|
125
|
+
if (this.files && this.files[0]) {
|
126
|
+
reader.readAsDataURL(this.files[0]);
|
127
|
+
} else {
|
128
|
+
img.attr('src', '');
|
129
|
+
}
|
130
|
+
});
|
131
|
+
=======
|
132
|
+
$(".datepicker").datepicker({
|
133
|
+
dateFormat: 'yy-mm-dd'
|
134
|
+
});
|
135
|
+
$('.chosen').chosen();
|
136
|
+
$(".chosen-container").css({width:$(".chosen-container").parent().css("width")})
|
137
|
+
selectRemote();
|
138
|
+
>>>>>>> v0.0.56-remote-select
|
139
|
+
}
|
140
|
+
|
141
|
+
$(document).ready(function(){
|
142
|
+
pageLoad();
|
143
|
+
formLoad();
|
144
|
+
});
|