compass-jquery-plugin 0.2.4.4 → 0.2.4.5

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 (41) hide show
  1. data/README.textile +2 -2
  2. data/VERSION.yml +2 -2
  3. data/compass-jquery-plugin.gemspec +2 -2
  4. data/lib/jquery/jqgrid.rb +59 -19
  5. data/templates/jqgrid/i18n/jqgrid/locale-bg.js +132 -132
  6. data/templates/jqgrid/i18n/jqgrid/locale-bg1251.js +132 -132
  7. data/templates/jqgrid/i18n/jqgrid/locale-cat.js +128 -128
  8. data/templates/jqgrid/i18n/jqgrid/locale-cs.js +127 -127
  9. data/templates/jqgrid/i18n/jqgrid/locale-de.js +127 -127
  10. data/templates/jqgrid/i18n/jqgrid/locale-dk.js +128 -128
  11. data/templates/jqgrid/i18n/jqgrid/locale-el.js +126 -126
  12. data/templates/jqgrid/i18n/jqgrid/locale-en.js +128 -128
  13. data/templates/jqgrid/i18n/jqgrid/locale-fa.js +125 -125
  14. data/templates/jqgrid/i18n/jqgrid/locale-fi.js +128 -128
  15. data/templates/jqgrid/i18n/jqgrid/locale-fr.js +126 -126
  16. data/templates/jqgrid/i18n/jqgrid/locale-he.js +127 -127
  17. data/templates/jqgrid/i18n/jqgrid/locale-is.js +126 -126
  18. data/templates/jqgrid/i18n/jqgrid/locale-it.js +126 -126
  19. data/templates/jqgrid/i18n/jqgrid/locale-jp.js +127 -127
  20. data/templates/jqgrid/i18n/jqgrid/locale-nl.js +148 -148
  21. data/templates/jqgrid/i18n/jqgrid/locale-no.js +121 -121
  22. data/templates/jqgrid/i18n/jqgrid/locale-pl.js +126 -126
  23. data/templates/jqgrid/i18n/jqgrid/locale-pt-br.js +127 -127
  24. data/templates/jqgrid/i18n/jqgrid/locale-pt-br.min.js +1 -1
  25. data/templates/jqgrid/i18n/jqgrid/locale-pt.js +125 -125
  26. data/templates/jqgrid/i18n/jqgrid/locale-ro.js +139 -139
  27. data/templates/jqgrid/i18n/jqgrid/locale-ru.js +127 -127
  28. data/templates/jqgrid/i18n/jqgrid/locale-sp.js +128 -128
  29. data/templates/jqgrid/i18n/jqgrid/locale-sv.js +117 -117
  30. data/templates/jqgrid/i18n/jqgrid/locale-tr.js +126 -126
  31. data/templates/jqgrid/i18n/jqgrid/locale-ua.js +127 -127
  32. data/templates/jqgrid/jquery.jqGrid.js +9921 -9913
  33. data/templates/jqgrid/jquery.jqGrid.min.js +1 -1
  34. data/templates/jqgrid/jquery.ui/jqGrid.sass +746 -745
  35. data/templates/jqgrid/manifest.rb +62 -62
  36. data/templates/jqgrid/public/stylesheets/ellipsis-xbl.xml +13 -13
  37. data/templates/jrails/jquery.js +7644 -7644
  38. data/templates/jrails/jquery.min.js +18 -18
  39. data/templates/jrails/jrails.js +192 -192
  40. data/templates/secret_sauce/app/views/ui/_ui_grid_for_without_block.js.haml +139 -139
  41. metadata +2 -2
data/README.textile CHANGED
@@ -10,7 +10,7 @@ h2. Description
10
10
  A Sass-based Meta-Framework for Compass that allows you to mix and match any of the following:
11
11
 
12
12
  * jRails with jQuery and jQuery.UI including themes
13
- * jqGrid V3.6
13
+ * jqGrid V3.6.1
14
14
  * dynatree V0.5.1
15
15
 
16
16
  This library requires <b>"Compass":http://wiki.github.com/chriseppstein/compass</b>.
@@ -108,7 +108,7 @@ h3. Rails
108
108
  * David Turnbull for <b>"compass-jquery":http://github.com/dturnbull/compass-jquery/tree/master</b>
109
109
  * ahe for <b>"2dc_jqgrid":http://github.com/ahe/2dc_jqgrid/tree/master</b>
110
110
  * scrubber for <b>"jquery_grid_for_rails":http://github.com/scrubber/jquery_grid_for_rails/tree/master</b>
111
- * ariesroyaal for <b>"secret_sauce":http://github.com/ariesroyaal/secret_sauce/tree/master</b>
111
+ * ariesroyaal for <b>"secret_sauce":http://github.com/ariesroyaal/secret_sauce/tree/master</b> now <b>"at":http://github.com/fugufish/secret_sauce</b>.
112
112
 
113
113
  h3. jQuery Plugins included
114
114
 
data/VERSION.yml CHANGED
@@ -1,5 +1,5 @@
1
- ---
2
- :commit: 4
1
+ ---
2
+ :commit: 5
3
3
  :patch: 4
4
4
  :minor: 2
5
5
  :major: 0
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{compass-jquery-plugin}
8
- s.version = "0.2.4.4"
8
+ s.version = "0.2.4.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kosmas Schuetz"]
12
- s.date = %q{2009-11-19}
12
+ s.date = %q{2009-12-05}
13
13
  s.description = %q{A compass plugin that integrates jRails, jQuery, jQuery UI and Themes, jqGrid and more into the Compass Sass framework.}
14
14
  s.email = %q{kosmas.schuetz@gmx.com}
15
15
  s.extra_rdoc_files = [
data/lib/jquery/jqgrid.rb CHANGED
@@ -315,14 +315,20 @@ module ActionView
315
315
  col_names.chop! << "]"
316
316
  col_model.chop! << "]"
317
317
  [col_names, col_model]
318
- end
319
-
318
+ end
319
+
320
320
  # Generate a list of attributes for related column (align:'right', sortable:true, resizable:false, ...)
321
321
  def get_attributes(column)
322
322
  options = ","
323
323
  column.except(:field, :label).each do |couple|
324
324
  if couple[0] == :editoptions
325
- options << "editoptions:#{get_edit_options(couple[1])},"
325
+ options << "editoptions:#{get_sub_options(couple[1])},"
326
+ elsif couple[0] == :formoptions
327
+ options << "formoptions:#{get_sub_options(couple[1])},"
328
+ elsif couple[0] == :searchoptions
329
+ options << "searchoptions:#{get_sub_options(couple[1])},"
330
+ elsif couple[0] == :editrules
331
+ options << "editrules:#{get_sub_options(couple[1])},"
326
332
  else
327
333
  if couple[1].class == String
328
334
  options << "#{couple[0]}:'#{couple[1]}',"
@@ -335,7 +341,7 @@ module ActionView
335
341
  end
336
342
 
337
343
  # Generate options for editable fields (value, data, width, maxvalue, cols, rows, ...)
338
- def get_edit_options(editoptions)
344
+ def get_sub_options(editoptions)
339
345
  options = "{"
340
346
  editoptions.each do |couple|
341
347
  if couple[0] == :value # :value => [[1, "Rails"], [2, "Ruby"], [3, "jQuery"]]
@@ -346,33 +352,67 @@ module ActionView
346
352
  options.chop! << %Q/",/
347
353
  elsif couple[0] == :data # :data => [Category.all, :id, :title])
348
354
  options << %Q/value:"/
349
- couple[1].first.each do |v|
350
- options << "#{v[couple[1].second]}:#{v[couple[1].third]};"
355
+ couple[1].first.each do |obj|
356
+ options << "%s:%s;" % [obj.send(couple[1].second), obj.send(couple[1].third)]
351
357
  end
352
358
  options.chop! << %Q/",/
353
359
  else # :size => 30, :rows => 5, :maxlength => 20, ...
354
- options << %Q/#{couple[0]}:"#{couple[1]}",/
360
+ if couple[1].instance_of?(Fixnum) || couple[1] == 'true' || couple[1] == 'false' || couple[1] == true || couple[1] == false
361
+ options << %Q/#{couple[0]}:#{couple[1]},/
362
+ else
363
+ options << %Q/#{couple[0]}:"#{couple[1]}",/
364
+ end
355
365
  end
356
366
  end
357
367
  options.chop! << "}"
358
- end
359
- end
368
+ end
369
+ end
360
370
  end
361
371
 
362
372
  module JqgridJson
373
+ include ActionView::Helpers::JavaScriptHelper
374
+
363
375
  def to_jqgrid_json(attributes, current_page, per_page, total)
364
- json = %Q({"page":"#{current_page}","total":#{total/per_page.to_i+1},"records":"#{total}","rows":[)
365
- each do |elem|
366
- json << %Q({"id":"#{elem.id}","cell":[)
367
- couples = elem.attributes.symbolize_keys
368
- attributes.each do |atr|
369
- value = couples[atr]
370
- value = elem.try(atr) if elem.respond_to?(:try) && value.blank?
371
- json << %Q("#{value}",)
376
+ json = %Q({"page":"#{current_page}","total":#{total/per_page.to_i+1},"records":"#{total}")
377
+ if total > 0
378
+ json << %Q(,"rows":[)
379
+ each do |elem|
380
+ elem.id ||= index(elem)
381
+ json << %Q({"id":"#{elem.id}","cell":[)
382
+ couples = elem.attributes.symbolize_keys
383
+ attributes.each do |atr|
384
+ value = get_atr_value(elem, atr, couples)
385
+ value = escape_javascript(value) if value and value.is_a? String
386
+ json << %Q("#{value}",)
387
+ end
388
+ json.chop! << "]},"
372
389
  end
373
- json.chop! << "]},"
390
+ json.chop! << "]}"
391
+ else
392
+ json << "}"
374
393
  end
375
- json.chomp!(',') << "]}"
394
+ end
395
+
396
+ private
397
+
398
+ def get_atr_value(elem, atr, couples)
399
+ if atr.to_s.include?('.')
400
+ value = get_nested_atr_value(elem, atr.to_s.split('.').reverse)
401
+ else
402
+ value = couples[atr]
403
+ value = elem.send(atr.to_sym) if value.blank? && elem.respond_to?(atr) # Required for virtual attributes
404
+ end
405
+ value
406
+ end
407
+
408
+ def get_nested_atr_value(elem, hierarchy)
409
+ return nil if hierarchy.size == 0
410
+ atr = hierarchy.pop
411
+ raise ArgumentError, "#{atr} doesn't exist on #{elem.inspect}" unless elem.respond_to?(atr)
412
+ nested_elem = elem.send(atr)
413
+ return "" if nested_elem.nil?
414
+ value = get_nested_atr_value(nested_elem, hierarchy)
415
+ value.nil? ? nested_elem : value
376
416
  end
377
417
  end
378
418
 
@@ -1,132 +1,132 @@
1
- ;(function($){
2
- /**
3
- * jqGrid Bulgarian Translation
4
- * Tony Tomov tony@trirand.com
5
- * http://trirand.com/blog/
6
- * Dual licensed under the MIT and GPL licenses:
7
- * http://www.opensource.org/licenses/mit-license.php
8
- * http://www.gnu.org/licenses/gpl.html
9
- **/
10
- $.jgrid = {
11
- defaults : {
12
- recordtext: "{0} - {1} от {2}",
13
- emptyrecords: "Няма запис(и)",
14
- loadtext: "Зареждам...",
15
- pgtext : "Стр. {0} от {1}"
16
- },
17
- search : {
18
- caption: "Търсене...",
19
- Find: "Намери",
20
- Reset: "Изчисти",
21
- odata : ['равно', 'различно', 'по-малко', 'по-малко или=','по-голямо','по-голямо или =', 'започва с','не започва с','се намира в','не се намира в','завършва с','не завършава с','съдържа', 'не съдържа' ],
22
- groupOps: [ { op: "AND", text: "&nbsp;И " }, { op: "OR", text: "ИЛИ" } ],
23
- matchText: " включи",
24
- rulesText: " клауза"
25
- },
26
- edit : {
27
- addCaption: "Нов Запис",
28
- editCaption: "Редакция Запис",
29
- bSubmit: "Запиши",
30
- bCancel: "Изход",
31
- bClose: "Затвори",
32
- saveData: "Данните са променени! Да съхраня ли промените?",
33
- bYes : "Да",
34
- bNo : "Не",
35
- bExit : "Отказ",
36
- msg: {
37
- required:"Полето е задължително",
38
- number:"Въведете валидно число!",
39
- minValue:"стойността трябва да е по-голяма или равна от",
40
- maxValue:"стойността трябва да е по-малка или равна от",
41
- email: "не е валиден ел. адрес",
42
- integer: "Въведете валидно цяло число",
43
- date: "Въведете валидна дата",
44
- url: "e невалиден URL. Изискава се префикс('http://' или 'https://')",
45
- nodefined : " е недефинирана!",
46
- novalue : " изисква връщане на стойност!",
47
- customarray : "Потреб. Функция трябва да върне масив!",
48
- customfcheck : "Потребителска функция е задължителна при този тип елемент!"
49
- }
50
- },
51
- view : {
52
- caption: "Преглед запис",
53
- bClose: "Затвори"
54
- },
55
- del : {
56
- caption: "Изтриване",
57
- msg: "Да изтрия ли избраният запис?",
58
- bSubmit: "Изтрий",
59
- bCancel: "Отказ"
60
- },
61
- nav : {
62
- edittext: " ",
63
- edittitle: "Редакция избран запис",
64
- addtext:" ",
65
- addtitle: "Добавяне нов запис",
66
- deltext: " ",
67
- deltitle: "Изтриване избран запис",
68
- searchtext: " ",
69
- searchtitle: "Търсене запис(и)",
70
- refreshtext: "",
71
- refreshtitle: "Обнови таблица",
72
- alertcap: "Предупреждение",
73
- alerttext: "Моля, изберете запис",
74
- viewtext: "",
75
- viewtitle: "Преглед избран запис"
76
- },
77
- col : {
78
- caption: "Избери колони",
79
- bSubmit: "Ок",
80
- bCancel: "Изход"
81
- },
82
- errors : {
83
- errcap : "Грешка",
84
- nourl : "Няма посочен url адрес",
85
- norecords: "Няма запис за обработка",
86
- model : "Модела не съответства на имената!"
87
- },
88
- formatter : {
89
- integer : {thousandsSeparator: " ", defaultValue: '0'},
90
- number : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.00'},
91
- currency : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:" лв.", defaultValue: '0.00'},
92
- date : {
93
- dayNames: [
94
- "Нед", "Пон", "Вт", "Ср", "Чет", "Пет", "Съб",
95
- "Неделя", "Понеделник", "Вторник", "Сряда", "Четвъртък", "Петък", "Събота"
96
- ],
97
- monthNames: [
98
- "Яну", "Фев", "Мар", "Апр", "Май", "Юни", "Юли", "Авг", "Сеп", "Окт", "Нов", "Дек",
99
- "Януари", "Февруари", "Март", "Април", "Май", "Юни", "Юли", "Август", "Септември", "Октомври", "Ноември", "Декември"
100
- ],
101
- AmPm : ["","","",""],
102
- S: function (j) {
103
- if(j==7 || j==8 || j== 27 || j== 28) {
104
- return 'ми';
105
- }
106
- return ['ви', 'ри', 'ти'][Math.min((j - 1) % 10, 2)];
107
- },
108
- srcformat: 'Y-m-d',
109
- newformat: 'd/m/Y',
110
- masks : {
111
- ISO8601Long:"Y-m-d H:i:s",
112
- ISO8601Short:"Y-m-d",
113
- ShortDate: "n/j/Y",
114
- LongDate: "l, F d, Y",
115
- FullDateTime: "l, F d, Y g:i:s A",
116
- MonthDay: "F d",
117
- ShortTime: "g:i A",
118
- LongTime: "g:i:s A",
119
- SortableDateTime: "Y-m-d\\TH:i:s",
120
- UniversalSortableDateTime: "Y-m-d H:i:sO",
121
- YearMonth: "F, Y"
122
- },
123
- reformatAfterEdit : false
124
- },
125
- baseLinkUrl: '',
126
- showAction: '',
127
- target: '',
128
- checkbox : {disabled:true},
129
- idName : 'id'
130
- }
131
- };
132
- })(jQuery);
1
+ ;(function($){
2
+ /**
3
+ * jqGrid Bulgarian Translation
4
+ * Tony Tomov tony@trirand.com
5
+ * http://trirand.com/blog/
6
+ * Dual licensed under the MIT and GPL licenses:
7
+ * http://www.opensource.org/licenses/mit-license.php
8
+ * http://www.gnu.org/licenses/gpl.html
9
+ **/
10
+ $.jgrid = {
11
+ defaults : {
12
+ recordtext: "{0} - {1} от {2}",
13
+ emptyrecords: "Няма запис(и)",
14
+ loadtext: "Зареждам...",
15
+ pgtext : "Стр. {0} от {1}"
16
+ },
17
+ search : {
18
+ caption: "Търсене...",
19
+ Find: "Намери",
20
+ Reset: "Изчисти",
21
+ odata : ['равно', 'различно', 'по-малко', 'по-малко или=','по-голямо','по-голямо или =', 'започва с','не започва с','се намира в','не се намира в','завършва с','не завършава с','съдържа', 'не съдържа' ],
22
+ groupOps: [ { op: "AND", text: "&nbsp;И " }, { op: "OR", text: "ИЛИ" } ],
23
+ matchText: " включи",
24
+ rulesText: " клауза"
25
+ },
26
+ edit : {
27
+ addCaption: "Нов Запис",
28
+ editCaption: "Редакция Запис",
29
+ bSubmit: "Запиши",
30
+ bCancel: "Изход",
31
+ bClose: "Затвори",
32
+ saveData: "Данните са променени! Да съхраня ли промените?",
33
+ bYes : "Да",
34
+ bNo : "Не",
35
+ bExit : "Отказ",
36
+ msg: {
37
+ required:"Полето е задължително",
38
+ number:"Въведете валидно число!",
39
+ minValue:"стойността трябва да е по-голяма или равна от",
40
+ maxValue:"стойността трябва да е по-малка или равна от",
41
+ email: "не е валиден ел. адрес",
42
+ integer: "Въведете валидно цяло число",
43
+ date: "Въведете валидна дата",
44
+ url: "e невалиден URL. Изискава се префикс('http://' или 'https://')",
45
+ nodefined : " е недефинирана!",
46
+ novalue : " изисква връщане на стойност!",
47
+ customarray : "Потреб. Функция трябва да върне масив!",
48
+ customfcheck : "Потребителска функция е задължителна при този тип елемент!"
49
+ }
50
+ },
51
+ view : {
52
+ caption: "Преглед запис",
53
+ bClose: "Затвори"
54
+ },
55
+ del : {
56
+ caption: "Изтриване",
57
+ msg: "Да изтрия ли избраният запис?",
58
+ bSubmit: "Изтрий",
59
+ bCancel: "Отказ"
60
+ },
61
+ nav : {
62
+ edittext: " ",
63
+ edittitle: "Редакция избран запис",
64
+ addtext:" ",
65
+ addtitle: "Добавяне нов запис",
66
+ deltext: " ",
67
+ deltitle: "Изтриване избран запис",
68
+ searchtext: " ",
69
+ searchtitle: "Търсене запис(и)",
70
+ refreshtext: "",
71
+ refreshtitle: "Обнови таблица",
72
+ alertcap: "Предупреждение",
73
+ alerttext: "Моля, изберете запис",
74
+ viewtext: "",
75
+ viewtitle: "Преглед избран запис"
76
+ },
77
+ col : {
78
+ caption: "Избери колони",
79
+ bSubmit: "Ок",
80
+ bCancel: "Изход"
81
+ },
82
+ errors : {
83
+ errcap : "Грешка",
84
+ nourl : "Няма посочен url адрес",
85
+ norecords: "Няма запис за обработка",
86
+ model : "Модела не съответства на имената!"
87
+ },
88
+ formatter : {
89
+ integer : {thousandsSeparator: " ", defaultValue: '0'},
90
+ number : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.00'},
91
+ currency : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:" лв.", defaultValue: '0.00'},
92
+ date : {
93
+ dayNames: [
94
+ "Нед", "Пон", "Вт", "Ср", "Чет", "Пет", "Съб",
95
+ "Неделя", "Понеделник", "Вторник", "Сряда", "Четвъртък", "Петък", "Събота"
96
+ ],
97
+ monthNames: [
98
+ "Яну", "Фев", "Мар", "Апр", "Май", "Юни", "Юли", "Авг", "Сеп", "Окт", "Нов", "Дек",
99
+ "Януари", "Февруари", "Март", "Април", "Май", "Юни", "Юли", "Август", "Септември", "Октомври", "Ноември", "Декември"
100
+ ],
101
+ AmPm : ["","","",""],
102
+ S: function (j) {
103
+ if(j==7 || j==8 || j== 27 || j== 28) {
104
+ return 'ми';
105
+ }
106
+ return ['ви', 'ри', 'ти'][Math.min((j - 1) % 10, 2)];
107
+ },
108
+ srcformat: 'Y-m-d',
109
+ newformat: 'd/m/Y',
110
+ masks : {
111
+ ISO8601Long:"Y-m-d H:i:s",
112
+ ISO8601Short:"Y-m-d",
113
+ ShortDate: "n/j/Y",
114
+ LongDate: "l, F d, Y",
115
+ FullDateTime: "l, F d, Y g:i:s A",
116
+ MonthDay: "F d",
117
+ ShortTime: "g:i A",
118
+ LongTime: "g:i:s A",
119
+ SortableDateTime: "Y-m-d\\TH:i:s",
120
+ UniversalSortableDateTime: "Y-m-d H:i:sO",
121
+ YearMonth: "F, Y"
122
+ },
123
+ reformatAfterEdit : false
124
+ },
125
+ baseLinkUrl: '',
126
+ showAction: '',
127
+ target: '',
128
+ checkbox : {disabled:true},
129
+ idName : 'id'
130
+ }
131
+ };
132
+ })(jQuery);