netzke-core 0.12.0.beta → 0.12.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 073a4d9f4ceedcbe7914a36c134f449f66696bfc
4
- data.tar.gz: d1b57f39a6edfd7b8765c2786a874a4863c865ac
3
+ metadata.gz: 81d97b53ee053cd6e51cd1c6357cef5a1da6e38a
4
+ data.tar.gz: f57dceaa5c506811e9a08a3525069bf10e48df0e
5
5
  SHA512:
6
- metadata.gz: b280ad883700d563153498e19853ab3381c2bfc699fcfba0b674c62574ff2c8563146265c82ffa231bef8667dd55163d0e24177efc6b3d893fdd7551d349430b
7
- data.tar.gz: 462b1831d5542627d8fd3e941d7965944666abdb993f9c56a71572ae9b2b39773d7ce9a3d7a7fea5f4028b7086825d334c6f27e7d27ea32f6e218ad01ce661e4
6
+ metadata.gz: 1daaf66a1fd8018749f8f49251d06f48ef6fdde1c59002eb388c3e98f4bb9ac31600999d8ade81bc92a85d6f6ed0fda9562e300960b26432eb173796ff663dfc
7
+ data.tar.gz: ee974614db16d80c6f671fce8d9138f92c97b4c9e8034c832080db9f9ee7161d11b93cb9fb9223cd33f7ba819b676cce2218c2679af0ab280acbe9b60bebec7f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ # v0.12.0.rc1 - 2015-03-13
2
+
3
+ * More reliable implementation of netzkeGetParentComponent()
4
+ * Callback passed to netzkeLoadComponent() will receive a second parameter with config object passed to netzkeLoadComponent()
5
+
1
6
  # v0.11.0 - 2015-02-05
2
7
 
3
8
  * Rails 4.2
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [RDocs](http://rdoc.info/projects/netzke/netzke-core)
4
4
 
5
- Netzke Core is the bare bones of the [Netzke framework](http://netzke.org). For pre-built full-featured components (like grids, forms, tab/accordion panels, etc), see [netzke-basepack](http://github.com/netzke/netzke-basepack) and [netzke-communitypack](http://github.com/netzke/netzke-communitypack).
5
+ Netzke Core is the bare bones of the [Netzke framework](http://netzke.org). For pre-built full-featured components (like grids, forms, tab/accordion panels, etc), see [netzke-basepack](http://github.com/netzke/netzke-basepack).
6
6
 
7
7
  Some knowledge of Sencha Ext JS will be needed in order to fully understand this overview.
8
8
 
data/javascripts/base.js CHANGED
@@ -185,6 +185,7 @@ Ext.define("Netzke.classes.Core.Mixin", {
185
185
  cmpName = cfg.netzkeComponent;
186
186
  cmpCfg = this.netzkeComponents[cmpName.camelize(true)];
187
187
  if (!cmpCfg) throw "Netzke: unknown component " + cmpName;
188
+ cmpCfg.netzkeParent = this;
188
189
  items[i] = Ext.apply(cmpCfg, cfg);
189
190
  delete(item);
190
191
 
data/javascripts/ext.js CHANGED
@@ -56,20 +56,6 @@ Ext.define('Netzke.FeedbackGhost', {
56
56
  Ext.define('Netzke.classes.NetzkeRemotingProvider', {
57
57
  extend: 'Ext.direct.RemotingProvider',
58
58
 
59
- initComponent: function() {
60
- this.callParent();
61
- this.addEvent('serverexception'); // because 'exception' is reserved by Ext JS (but never used!)
62
- },
63
-
64
- listeners: {
65
- // work-around the fact that 'exception' is never thrown by Ext JS
66
- data: function(self, e) {
67
- if (Ext.getClass(e) == Ext.direct.ExceptionEvent) {
68
- this.fireEvent('serverexception', e);
69
- }
70
- }
71
- },
72
-
73
59
  getPayload: function(t){
74
60
  return {
75
61
  path: t.action,
@@ -195,6 +181,7 @@ Ext.define(null, {
195
181
  var cfgs = this.buildParentClientConfigs();
196
182
  var remotingArgs = {args: args, configs: cfgs};
197
183
 
184
+ // Calling Ext.Direct's function
198
185
  Netzke.providers[config.id][methodName].call(scope, remotingArgs, function(result, e) {
199
186
  var callbackParam = e;
200
187
 
@@ -363,8 +350,10 @@ Ext.define(null, {
363
350
  var storedConfig = this.netzkeUndoLoadingComponent(config.itemId),
364
351
  callbackParam;
365
352
 
353
+ config.netzkeParent = this;
354
+
366
355
  if (storedConfig.configOnly) {
367
- callbackParam = config;
356
+ callbackParam = Ext.apply(config, storedConfig);
368
357
  } else {
369
358
  var currentCmp = Ext.ComponentManager.get(config.id);
370
359
  if (currentCmp) currentCmp.destroy();
@@ -388,7 +377,7 @@ Ext.define(null, {
388
377
  }
389
378
 
390
379
  if (storedConfig.callback) {
391
- storedConfig.callback.call(storedConfig.scope || this, callbackParam);
380
+ storedConfig.callback.call(storedConfig.scope || this, callbackParam, storedConfig);
392
381
  }
393
382
  },
394
383
 
@@ -427,13 +416,7 @@ Ext.define(null, {
427
416
  * Returns parent Netzke component
428
417
  */
429
418
  netzkeGetParentComponent: function(){
430
- // simply cutting the last part of the id: some_parent__a_kid__a_great_kid => some_parent__a_kid
431
- var idSplit = this.id.split("__");
432
- idSplit.pop();
433
- var parentId = idSplit.join("__");
434
-
435
- var res = parentId === "" ? null : Ext.getCmp(parentId);
436
- return res;
419
+ return this.netzkeParent;
437
420
  },
438
421
 
439
422
  /**
@@ -34,7 +34,7 @@ module Netzke::Core
34
34
 
35
35
  # An array of server class config options that should not be passed to the client class. Can be overridden.
36
36
  def server_side_config_options
37
- [:eager_loading, :klass]
37
+ [:eager_loading, :klass, :client_config]
38
38
  end
39
39
  end
40
40
 
@@ -40,7 +40,7 @@ module Netzke
40
40
  # Generates initial javascript code that is dependent on Rails settings
41
41
  def initial_dynamic_javascript(form_authenticity_token)
42
42
  res = []
43
- res << %(Ext.Ajax.extraParams = {authenticity_token: '#{form_authenticity_token}'}; // Rails' forgery protection)
43
+ res << %(Ext.Ajax.setExtraParams({authenticity_token: '#{form_authenticity_token}'}); // Rails' forgery protection)
44
44
  res << %{Ext.ns('Netzke');}
45
45
  res << %{Ext.ns('Netzke.core');}
46
46
  res << %{Netzke.RelativeUrlRoot = '#{ActionController::Base.config.relative_url_root}';}
@@ -18,7 +18,7 @@ module Netzke
18
18
  def args
19
19
  # for backward compatibility, fall back to old data structure (with the endpoint params being in the root of
20
20
  # 'data')
21
- remoting_args["configs"] ? remoting_args["args"] : remoting_args
21
+ remoting_args.has_key?("args") ? remoting_args["args"] : remoting_args.reject{|k,v| k == 'configs' }
22
22
  end
23
23
 
24
24
  def client_configs
@@ -137,7 +137,7 @@ module Netzke::Core
137
137
  # Called when the method_missing tries to processes a non-existing component. Override when needed.
138
138
  # Note: this should actually never happen unless you mess up with Netzke component loading mechanisms.
139
139
  def component_missing(missing_component, params, this)
140
- this.netzke_feedback "Unknown component #{missing_component} for #{name}"
140
+ this.netzke_feedback "Unknown component '#{missing_component}' in '#{name}'"
141
141
  end
142
142
 
143
143
  end
@@ -1,5 +1,5 @@
1
1
  module Netzke
2
2
  module Core
3
- VERSION = "0.12.0.beta"
3
+ VERSION = "0.12.0.rc1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: netzke-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0.beta
4
+ version: 0.12.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max Gorin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-08 00:00:00.000000000 Z
11
+ date: 2015-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: uglifier