lipsiadmin 5.0.3 → 5.0.4

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.
data/CHANGELOG CHANGED
@@ -1,3 +1,9 @@
1
+ 2009-09-07
2
+ * Bump to 5.0.4
3
+ * Fix for monthnames in locale.js
4
+ * Fix for daynames in locale.js
5
+ * Added the possibility to remove listners to cellmousedown and afteredit
6
+
1
7
  2009-08-01
2
8
  * Improved performance of Ext store_data using length instead of size for count records
3
9
 
@@ -6,6 +6,8 @@ module Lipsiadmin
6
6
  # and content definition format. Written in 100% pure Java, it allows users to easily add PDF generation
7
7
  # functionality to end products.
8
8
  #
9
+ # Remember to install jdk ex: yum install java-1.6.0-openjdk-devel.i386
10
+ #
9
11
  # For generate a pdf you can simply do
10
12
  #
11
13
  # script/generate pdf invoice
@@ -2,7 +2,7 @@ module Lipsiadmin
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 5
4
4
  MINOR = 0
5
- TINY = 3
5
+ TINY = 4
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -22,7 +22,7 @@ module Lipsiadmin#:nodoc:
22
22
  @var = options.delete(:var)
23
23
  @config = Configuration.new(options)
24
24
  @before, @after = [], []
25
- @items = {}
25
+ @items, @un = {}, {}
26
26
  if self.class == Component && block_given?
27
27
  yield self
28
28
  end
@@ -123,6 +123,7 @@ module Lipsiadmin#:nodoc:
123
123
  def on(event, function=nil, scope=nil, &block)
124
124
  # Remove old handlers
125
125
  un(event)
126
+ @un[event.to_sym] = false # we need to reset it
126
127
  scope = ", #{scope.to_l}" unless scope.blank?
127
128
  if function
128
129
  after << "#{get_var}.on(#{event.to_json}, #{function}#{scope});"
@@ -137,6 +138,7 @@ module Lipsiadmin#:nodoc:
137
138
  # Example: grid.un(:dblclick)
138
139
  #
139
140
  def un(event)
141
+ @un[event.to_sym] = true
140
142
  found = @after.delete_if { |s| s.start_with?("#{get_var}.on(#{event.to_json}") if s.is_a?(String) }
141
143
  after << "#{get_var}.un(#{event.to_json})" unless found
142
144
  end
@@ -275,16 +275,16 @@ module Lipsiadmin
275
275
  raise_error "You must provide the store." if config[:store].blank?
276
276
  end
277
277
 
278
- after << render_javascript(:grid_functions, :var => get_var, :store => config[:store], :sm => config[:sm], :tbar => config[:tbar], :editable => @editable)
278
+ after << render_javascript(:grid_functions, :var => get_var, :store => config[:store], :sm => config[:sm], :tbar => config[:tbar], :editable => @editable, :un => @un)
279
279
 
280
- if config[:store] && @render
281
- after << "#{config[:store]}.on('beforeload', function(){ Backend.app.mask(); });"
282
- after << "#{config[:store]}.on('load', function(){ Backend.app.unmask(); });"
283
- after << "#{config[:store]}.load();"
280
+ if @render
281
+ after << "Backend.app.addItem(#{get_var});" if @render
282
+ if config[:store]
283
+ after << "#{config[:store]}.on('beforeload', function(){ Backend.app.mask(); });"
284
+ after << "#{config[:store]}.on('load', function(){ Backend.app.unmask(); });"
285
+ after << "#{config[:store]}.load();"
286
+ end
284
287
  end
285
-
286
- after << "Backend.app.addItem(#{get_var});" if @render
287
-
288
288
  super
289
289
  end
290
290
  end
@@ -16,6 +16,7 @@
16
16
  <% end %>
17
17
 
18
18
  <% if @editable %>
19
+ <% unless @un[:cellmousedown] %>
19
20
  <%= @var %>.on('cellmousedown', function(grid, rowIndex, colIndex, e){
20
21
  var columnId = grid.getColumnModel().getColumnId(colIndex);
21
22
  var column = grid.getColumnModel().getColumnById(columnId);
@@ -38,8 +39,8 @@
38
39
  grid.fireEvent('afteredit', editEvent);
39
40
  }
40
41
  });
41
-
42
-
42
+ <% end %>
43
+ <% unless @un[:afteredit] %>
43
44
  <%= @var %>.on('afteredit', function(e){
44
45
  var columnId = <%= @var %>.getColumnModel().getColumnId(e.column);
45
46
  var column = <%= @var %>.getColumnModel().getColumnById(columnId);
@@ -64,6 +65,7 @@
64
65
  });
65
66
  });
66
67
  <% end %>
68
+ <% end %>
67
69
  <% if @ttbar_add %>
68
70
  function add(){
69
71
  Backend.app.load('<%= @new_path.blank? ? "#{@base_path}/new" : @new_path %>');
@@ -24,7 +24,7 @@ if(Ext.LoadMask){
24
24
  Ext.LoadMask.prototype.msg = "<%= I18n.t('extjs.msg') %>";
25
25
  }
26
26
 
27
- Date.monthNames = [<%= I18n.t('date.month_names').compact.to_json %>];
27
+ Date.monthNames = <%= I18n.t('date.month_names').compact.to_json %>;
28
28
 
29
29
  Date.getShortMonthName = function(month) {
30
30
  return Date.monthNames[month].substring(0, 3);
@@ -49,7 +49,7 @@ Date.getMonthNumber = function(name) {
49
49
  return Date.monthNumbers[name.substring(0, 1).toUpperCase() + name.substring(1, 3).toLowerCase()];
50
50
  };
51
51
 
52
- Date.dayNames = [<%= I18n.t('date.day_names').compact.to_json %>];
52
+ Date.dayNames = <%= I18n.t('date.day_names').compact.to_json %>;
53
53
 
54
54
  Date.getShortDayName = function(day) {
55
55
  return Date.dayNames[day].substring(0, 3);
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lipsiadmin
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.3
4
+ version: 5.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Davide D'Agostino
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-08-01 00:00:00 +02:00
12
+ date: 2009-08-08 00:00:00 +02:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency