netzke-core 1.0.0.0.pre3 → 1.0.0.0.pre4
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.
- checksums.yaml +7 -0
- data/CHANGELOG.md +13 -0
- data/config/ci/before-travis.sh +2 -0
- data/config/routes.rb +3 -0
- data/lib/netzke/core/client_class_config.rb +4 -4
- data/lib/netzke/core/client_code.rb +20 -2
- data/lib/netzke/core/version.rb +1 -1
- metadata +23 -27
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c416391cef65576a5c36f064f79f64a91c0b4993
|
4
|
+
data.tar.gz: 1c3a58a7b46c736d829aa9f041349fb5c5a60c08
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 2175ca63de1a604840348f297dd98ea972d73529d1077c679008a000a9ae6f3f3488f9bf01ab0d99262617067b48069856ea492371cb10a9cb22507ebd5e36d3
|
7
|
+
data.tar.gz: e5f55ae2d2192b49f01381bb77bfcecf6bfd26313ea375db1e7ecad5724356481614fa0c9cde1420305496ab79fcb1e513b8118b1b1ae8949f5b117046428cd6
|
data/CHANGELOG.md
CHANGED
@@ -20,6 +20,17 @@
|
|
20
20
|
|
21
21
|
* `Base.js_configure` has been renamed to `Base.client_class`. There's also no longer need to call it just for the purpose of including the default mixin (which is now `<component_name>/client/<component_name>.js`).
|
22
22
|
|
23
|
+
* Assigning inline JS functions inside the `client_class` (former `js_configure`) block no longer makes a JSON literal
|
24
|
+
of them; instead, wrap it with the `l` method accessible for all components:
|
25
|
+
|
26
|
+
client_class do |c|
|
27
|
+
c.on_refresh = l(<<-JS)
|
28
|
+
function(){
|
29
|
+
this.setTitle("Refresh tool clicked");
|
30
|
+
}
|
31
|
+
JS
|
32
|
+
end
|
33
|
+
|
23
34
|
* `Base.css_configure` has been renamed to `Base.client_styles`.
|
24
35
|
|
25
36
|
* The `mixin` method in the former `js_configure` block (now `client_class`) has been renamed to `include`.
|
@@ -104,4 +115,6 @@
|
|
104
115
|
|
105
116
|
* Calling `callParent` in JS functions from the "mixins" will now properly call the previous override if that was defined; see `spec/rails_app/app/components/js_mixins.rb` for an example.
|
106
117
|
|
118
|
+
* There's no longer need to call `netzke` in routes.rb unless you want to modify routing defaults.
|
119
|
+
|
107
120
|
Please check [0-12](https://github.com/netzke/netzke-core/blob/0-12/CHANGELOG.md) for previous changes.
|
data/config/routes.rb
ADDED
@@ -31,7 +31,7 @@ module Netzke
|
|
31
31
|
# c.title = "My cool component"
|
32
32
|
#
|
33
33
|
# # this will result in the +onButtonPress+ function defined on the client class prototype
|
34
|
-
# c.on_button_press = <<-JS
|
34
|
+
# c.on_button_press = l(<<-JS)
|
35
35
|
# function(){
|
36
36
|
# // ...
|
37
37
|
# }
|
@@ -39,7 +39,7 @@ module Netzke
|
|
39
39
|
# end
|
40
40
|
# end
|
41
41
|
#
|
42
|
-
# An
|
42
|
+
# An better way to define prototype properties though is by using {ClientClassConfig#include}
|
43
43
|
#
|
44
44
|
# As attributes are accessible from inside +client_class+:
|
45
45
|
#
|
@@ -51,7 +51,7 @@ module Netzke
|
|
51
51
|
# end
|
52
52
|
# end
|
53
53
|
#
|
54
|
-
# ...
|
54
|
+
# ...you can configure your component on a class level like this:
|
55
55
|
#
|
56
56
|
# # e.g. in Rails initializers
|
57
57
|
# MyComponent.title = "New title for all MyComponents"
|
@@ -64,7 +64,7 @@ module Netzke
|
|
64
64
|
def method_missing(name, *args)
|
65
65
|
if name =~ /(.+)=$/
|
66
66
|
value = args.first
|
67
|
-
@properties[$1.to_sym] = value
|
67
|
+
@properties[$1.to_sym] = value
|
68
68
|
else
|
69
69
|
@properties[name.to_sym]
|
70
70
|
end
|
@@ -50,6 +50,12 @@ module Netzke::Core
|
|
50
50
|
def dir(cllr)
|
51
51
|
%Q(#{cllr.split(".rb:").first})
|
52
52
|
end
|
53
|
+
|
54
|
+
# Converts given string to a string that returns itself as its JSON-encoded form for given string. See
|
55
|
+
# {ClientCode#l}
|
56
|
+
def l(str)
|
57
|
+
Netzke::Core::JsonLiteral.new(str)
|
58
|
+
end
|
53
59
|
end
|
54
60
|
|
55
61
|
# Builds {#js_config} used for instantiating a client class. Override it when you need to extend/modify the config for the JS component intance. It's *not* being called when the *server* class is being instantiated (e.g. to process an endpoint call). With other words, it's only being called before a component is first being loaded in the browser. so, it's ok to do heavy stuf fhere, like building a tree panel nodes from the database.
|
@@ -125,6 +131,18 @@ module Netzke::Core
|
|
125
131
|
|
126
132
|
protected
|
127
133
|
|
134
|
+
# Converts given string to a string that returns itself as its JSON-encoded form for given string. Can sometimes be hande, for example, to pass simple client-side handler inline in the Ruby code:
|
135
|
+
#
|
136
|
+
# def configure(c)
|
137
|
+
# super
|
138
|
+
# c.tools = [
|
139
|
+
# { type: :refresh, handler: l("function(){alert('Refresh clicked')}") }
|
140
|
+
# ]
|
141
|
+
# end
|
142
|
+
def l(str)
|
143
|
+
self.class.l(str)
|
144
|
+
end
|
145
|
+
|
128
146
|
# Allows referring to client-side function that will be called in the scope of the component. Handy to specify
|
129
147
|
# handlers for tools/actions, or any other functions that have to be passed as configuration to different Ext JS
|
130
148
|
# components. Usage:
|
@@ -136,11 +154,11 @@ module Netzke::Core
|
|
136
154
|
# end
|
137
155
|
# end
|
138
156
|
#
|
139
|
-
# As a result, `MyComponent`'s client-side `doExport` function will be called in the component's scope
|
157
|
+
# As a result, `MyComponent`'s client-side `doExport` function will be called *in the component's scope*, receiving all the
|
140
158
|
# usual handler parameters from Ext JS.
|
141
159
|
# Read more on how to define client-side functions in `Netzke::Core::ClientClassConfig`.
|
142
160
|
def f(name)
|
143
|
-
|
161
|
+
l("function(){var c=Ext.getCmp('#{js_id}'); return c.#{name.to_s.camelize(:lower)}.apply(c, arguments);}")
|
144
162
|
end
|
145
163
|
|
146
164
|
private
|
data/lib/netzke/core/version.rb
CHANGED
metadata
CHANGED
@@ -1,46 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: netzke-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.0.
|
5
|
-
prerelease: 8
|
4
|
+
version: 1.0.0.0.pre4
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Max Gorin
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-29 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: uglifier
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '0'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: execjs
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - ">="
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '0'
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - ">="
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '0'
|
46
41
|
description: Build complex web GUI in a modular way
|
@@ -49,14 +44,24 @@ executables: []
|
|
49
44
|
extensions: []
|
50
45
|
extra_rdoc_files: []
|
51
46
|
files:
|
47
|
+
- CHANGELOG.md
|
48
|
+
- Gemfile
|
49
|
+
- LICENSE
|
50
|
+
- README.md
|
51
|
+
- Rakefile
|
52
52
|
- app/controllers/netzke_controller.rb
|
53
|
+
- config/ci/before-travis.sh
|
54
|
+
- config/routes.rb
|
55
|
+
- init.rb
|
53
56
|
- javascripts/base.js
|
54
57
|
- javascripts/core.js
|
55
58
|
- javascripts/js_extensions.js
|
56
59
|
- javascripts/notifications.js
|
57
60
|
- javascripts/remoting_provider.js
|
58
61
|
- javascripts/routing.js
|
62
|
+
- lib/netzke-core.rb
|
59
63
|
- lib/netzke/base.rb
|
64
|
+
- lib/netzke/core.rb
|
60
65
|
- lib/netzke/core/action_config.rb
|
61
66
|
- lib/netzke/core/actions.rb
|
62
67
|
- lib/netzke/core/client_class_config.rb
|
@@ -74,56 +79,47 @@ files:
|
|
74
79
|
- lib/netzke/core/json_literal.rb
|
75
80
|
- lib/netzke/core/panel.rb
|
76
81
|
- lib/netzke/core/plugins.rb
|
82
|
+
- lib/netzke/core/railz.rb
|
77
83
|
- lib/netzke/core/railz/action_view_ext.rb
|
78
84
|
- lib/netzke/core/railz/controller_extensions.rb
|
79
85
|
- lib/netzke/core/railz/engine.rb
|
80
86
|
- lib/netzke/core/railz/routes.rb
|
81
|
-
- lib/netzke/core/
|
87
|
+
- lib/netzke/core/ruby_ext.rb
|
82
88
|
- lib/netzke/core/ruby_ext/array.rb
|
83
89
|
- lib/netzke/core/ruby_ext/hash.rb
|
84
90
|
- lib/netzke/core/ruby_ext/time_with_zone.rb
|
85
|
-
- lib/netzke/core/ruby_ext.rb
|
86
91
|
- lib/netzke/core/services.rb
|
87
92
|
- lib/netzke/core/session.rb
|
88
93
|
- lib/netzke/core/state.rb
|
89
94
|
- lib/netzke/core/stylesheets.rb
|
90
95
|
- lib/netzke/core/version.rb
|
91
|
-
- lib/netzke/core.rb
|
92
96
|
- lib/netzke/plugin.rb
|
93
|
-
- lib/netzke-core.rb
|
94
97
|
- lib/tasks/netzke_core_tasks.rake
|
95
98
|
- stylesheets/core.css
|
96
99
|
- tasks/app_test_tasks.rake
|
97
100
|
- tasks/rake_helper.rb
|
98
|
-
- CHANGELOG.md
|
99
|
-
- Gemfile
|
100
|
-
- LICENSE
|
101
|
-
- Rakefile
|
102
|
-
- README.md
|
103
|
-
- init.rb
|
104
101
|
homepage: http://netzke.org
|
105
102
|
licenses: []
|
103
|
+
metadata: {}
|
106
104
|
post_install_message:
|
107
105
|
rdoc_options: []
|
108
106
|
require_paths:
|
109
107
|
- lib
|
110
108
|
required_ruby_version: !ruby/object:Gem::Requirement
|
111
|
-
none: false
|
112
109
|
requirements:
|
113
|
-
- -
|
110
|
+
- - ">="
|
114
111
|
- !ruby/object:Gem::Version
|
115
112
|
version: '0'
|
116
113
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
117
|
-
none: false
|
118
114
|
requirements:
|
119
|
-
- -
|
115
|
+
- - ">="
|
120
116
|
- !ruby/object:Gem::Version
|
121
117
|
version: 1.3.4
|
122
118
|
requirements: []
|
123
119
|
rubyforge_project:
|
124
|
-
rubygems_version:
|
120
|
+
rubygems_version: 2.5.1
|
125
121
|
signing_key:
|
126
|
-
specification_version:
|
122
|
+
specification_version: 4
|
127
123
|
summary: Client-server GUI components with Sencha Ext JS and Ruby on Rails
|
128
124
|
test_files: []
|
129
125
|
has_rdoc:
|