dynaspan 0.1.5 → 1.0.0
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 +5 -5
- data/CHANGELOG.md +105 -0
- data/LICENSE +1 -1
- data/README.md +244 -159
- data/app/assets/javascripts/dynaspan/dynaspan.js +271 -0
- data/app/assets/stylesheets/dynaspan/dynaspan.css +44 -0
- data/app/helpers/dynaspan/application_helper.rb +161 -48
- data/app/views/dynaspan/_dynaspan.html.erb +32 -0
- data/config/importmap.rb +3 -0
- data/lib/dynaspan/engine.rb +32 -0
- data/lib/dynaspan/version.rb +3 -1
- data/lib/dynaspan.rb +4 -28
- metadata +81 -28
- data/.gitignore +0 -19
- data/CODE_OF_CONDUCT.md +0 -3
- data/Gemfile +0 -4
- data/Rakefile +0 -13
- data/app/views/dynaspan/_dynaspan_text_area.html.erb +0 -24
- data/app/views/dynaspan/_dynaspan_text_field.html.erb +0 -24
- data/app/views/dynaspan/_dynaspan_text_select.html.erb +0 -26
- data/config/routes.rb +0 -2
- data/dynaspan.gemspec +0 -20
- data/lib/assets/javascripts/dynaspan/basepath.js.erb +0 -6
- data/lib/assets/javascripts/dynaspan-jquery.js +0 -2
- data/lib/dynaspan/tasks.rake +0 -13
- data/vendor/assets/javascripts/dynaspan/dynaspan.js +0 -56
metadata
CHANGED
|
@@ -1,45 +1,102 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dynaspan
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 1.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Daniel P. Clark
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
12
|
-
dependencies:
|
|
13
|
-
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
+
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: actionpack
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - ">="
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '7.1'
|
|
19
|
+
- - "<"
|
|
20
|
+
- !ruby/object:Gem::Version
|
|
21
|
+
version: '9'
|
|
22
|
+
type: :runtime
|
|
23
|
+
prerelease: false
|
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
25
|
+
requirements:
|
|
26
|
+
- - ">="
|
|
27
|
+
- !ruby/object:Gem::Version
|
|
28
|
+
version: '7.1'
|
|
29
|
+
- - "<"
|
|
30
|
+
- !ruby/object:Gem::Version
|
|
31
|
+
version: '9'
|
|
32
|
+
- !ruby/object:Gem::Dependency
|
|
33
|
+
name: actionview
|
|
34
|
+
requirement: !ruby/object:Gem::Requirement
|
|
35
|
+
requirements:
|
|
36
|
+
- - ">="
|
|
37
|
+
- !ruby/object:Gem::Version
|
|
38
|
+
version: '7.1'
|
|
39
|
+
- - "<"
|
|
40
|
+
- !ruby/object:Gem::Version
|
|
41
|
+
version: '9'
|
|
42
|
+
type: :runtime
|
|
43
|
+
prerelease: false
|
|
44
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
45
|
+
requirements:
|
|
46
|
+
- - ">="
|
|
47
|
+
- !ruby/object:Gem::Version
|
|
48
|
+
version: '7.1'
|
|
49
|
+
- - "<"
|
|
50
|
+
- !ruby/object:Gem::Version
|
|
51
|
+
version: '9'
|
|
52
|
+
- !ruby/object:Gem::Dependency
|
|
53
|
+
name: railties
|
|
54
|
+
requirement: !ruby/object:Gem::Requirement
|
|
55
|
+
requirements:
|
|
56
|
+
- - ">="
|
|
57
|
+
- !ruby/object:Gem::Version
|
|
58
|
+
version: '7.1'
|
|
59
|
+
- - "<"
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '9'
|
|
62
|
+
type: :runtime
|
|
63
|
+
prerelease: false
|
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
+
requirements:
|
|
66
|
+
- - ">="
|
|
67
|
+
- !ruby/object:Gem::Version
|
|
68
|
+
version: '7.1'
|
|
69
|
+
- - "<"
|
|
70
|
+
- !ruby/object:Gem::Version
|
|
71
|
+
version: '9'
|
|
72
|
+
description: Dynaspan renders plain text that turns into a text field, text area or
|
|
73
|
+
select when clicked, and saves the change over AJAX when the field loses focus.
|
|
74
|
+
No jQuery required.
|
|
14
75
|
email:
|
|
15
76
|
- 6ftdan@gmail.com
|
|
16
77
|
executables: []
|
|
17
78
|
extensions: []
|
|
18
79
|
extra_rdoc_files: []
|
|
19
80
|
files:
|
|
20
|
-
-
|
|
21
|
-
- CODE_OF_CONDUCT.md
|
|
22
|
-
- Gemfile
|
|
81
|
+
- CHANGELOG.md
|
|
23
82
|
- LICENSE
|
|
24
83
|
- README.md
|
|
25
|
-
-
|
|
84
|
+
- app/assets/javascripts/dynaspan/dynaspan.js
|
|
85
|
+
- app/assets/stylesheets/dynaspan/dynaspan.css
|
|
26
86
|
- app/helpers/dynaspan/application_helper.rb
|
|
27
|
-
- app/views/dynaspan/
|
|
28
|
-
-
|
|
29
|
-
- app/views/dynaspan/_dynaspan_text_select.html.erb
|
|
30
|
-
- config/routes.rb
|
|
31
|
-
- dynaspan.gemspec
|
|
32
|
-
- lib/assets/javascripts/dynaspan-jquery.js
|
|
33
|
-
- lib/assets/javascripts/dynaspan/basepath.js.erb
|
|
87
|
+
- app/views/dynaspan/_dynaspan.html.erb
|
|
88
|
+
- config/importmap.rb
|
|
34
89
|
- lib/dynaspan.rb
|
|
35
|
-
- lib/dynaspan/
|
|
90
|
+
- lib/dynaspan/engine.rb
|
|
36
91
|
- lib/dynaspan/version.rb
|
|
37
|
-
- vendor/assets/javascripts/dynaspan/dynaspan.js
|
|
38
92
|
homepage: https://github.com/danielpclark/dynaspan
|
|
39
93
|
licenses:
|
|
40
94
|
- MIT
|
|
41
|
-
metadata:
|
|
42
|
-
|
|
95
|
+
metadata:
|
|
96
|
+
source_code_uri: https://github.com/danielpclark/dynaspan
|
|
97
|
+
changelog_uri: https://github.com/danielpclark/dynaspan/blob/master/CHANGELOG.md
|
|
98
|
+
bug_tracker_uri: https://github.com/danielpclark/dynaspan/issues
|
|
99
|
+
rubygems_mfa_required: 'true'
|
|
43
100
|
rdoc_options: []
|
|
44
101
|
require_paths:
|
|
45
102
|
- lib
|
|
@@ -47,18 +104,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
47
104
|
requirements:
|
|
48
105
|
- - ">="
|
|
49
106
|
- !ruby/object:Gem::Version
|
|
50
|
-
version: '
|
|
107
|
+
version: '3.1'
|
|
51
108
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
52
109
|
requirements:
|
|
53
110
|
- - ">="
|
|
54
111
|
- !ruby/object:Gem::Version
|
|
55
112
|
version: '0'
|
|
56
|
-
requirements:
|
|
57
|
-
|
|
58
|
-
- Rails
|
|
59
|
-
rubyforge_project:
|
|
60
|
-
rubygems_version: 2.6.4
|
|
61
|
-
signing_key:
|
|
113
|
+
requirements: []
|
|
114
|
+
rubygems_version: 3.6.9
|
|
62
115
|
specification_version: 4
|
|
63
|
-
summary:
|
|
116
|
+
summary: Click-to-edit, in-place AJAX text editing for Rails.
|
|
64
117
|
test_files: []
|
data/.gitignore
DELETED
data/CODE_OF_CONDUCT.md
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
# Contributor Code of Conduct
|
|
2
|
-
|
|
3
|
-
For you, brethren, have been called to liberty; only do not use liberty as an opportunity for the flesh, but through love serve one another. For all the law is fulfilled in one word, even in this: “You shall love your neighbor as yourself.” But if you bite and devour one another, beware lest you be consumed by one another! - [Galatians 5:13-15](https://www.biblegateway.com/passage/?search=Gal.5.13-Gal.5.15&version=NKJV)
|
data/Gemfile
DELETED
data/Rakefile
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env rake
|
|
2
|
-
require 'bundler/gem_tasks'
|
|
3
|
-
#require File.expand_path('../lib/dynaspan/source_file', __FILE__)
|
|
4
|
-
|
|
5
|
-
desc 'Update Dynaspan Library, VERSION is required.'
|
|
6
|
-
task 'update_dynaspan' do
|
|
7
|
-
files = SourceFile.new
|
|
8
|
-
files.fetch ENV['VERSION']
|
|
9
|
-
files.destination_root = 'vendor/assets'
|
|
10
|
-
files.move
|
|
11
|
-
files.fix_css
|
|
12
|
-
files.cleanup
|
|
13
|
-
end
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
<%# This is used through the helper method dynaspan_text_area %>
|
|
2
|
-
<div id="dyna_span_block<%= unique_ref_id %>" <%= "data-ds-callback-on-update=\"#{ds_callback_on_update}\" " if ds_callback_on_update.present? %> <%= "data-ds-callback-with-values=\"#{ds_callback_with_values}\" " if ds_callback_with_values.present? %>class='dyna-span<%= ' ds-content-present' if (attr_object.try(attrib).present? || master_ds_object.try(attrib).present?) %>'>
|
|
3
|
-
<%= hidden_field_tag "last_dyna_span_val_#{unique_ref_id}", attr_object.try(attrib) || master_ds_object.try(attrib), id: "last_dyna_span_val_#{unique_ref_id}" %>
|
|
4
|
-
<div id="<%= "dyna_span_div#{unique_ref_id}" %>" style="display:none;">
|
|
5
|
-
<%= form_for(master_ds_object, **form_for_options.symbolize_keys) do |f| %>
|
|
6
|
-
<% if master_ds_object.nested_attributes_options.keys.any? {|i| i.to_s.=~(/#{attr_object.class.try(:model_name).try(:i18n_key).to_s}/) || i.to_s.=~(/#{attr_object.class.try(:table_name)}/) } and !attr_object.nil? %>
|
|
7
|
-
<%= f.fields_for master_ds_object.nested_attributes_options.keys.select {|i| i.to_s.=~(/#{attr_object.class.model_name.i18n_key.to_s}/) || i.to_s.=~(/#{attr_object.class.table_name}/) }.first, attr_object do |a|%>
|
|
8
|
-
<%= a.hidden_field(:id, value: attr_object.id) if attr_object.id.present? %>
|
|
9
|
-
<% hidden_fields.each do |hkey, hval| %>
|
|
10
|
-
<%= a.hidden_field hkey.to_sym, value: hval %>
|
|
11
|
-
<% end if hidden_fields %>
|
|
12
|
-
<%= a.text_area attrib, id: "dyna_span_field_val_#{unique_ref_id}", onfocus: "$().dynaspan.upLast('#{unique_ref_id}');", onblur: "$().dynaspan.upHide('#{unique_ref_id}');", **html_options.symbolize_keys %>
|
|
13
|
-
<% end %>
|
|
14
|
-
<% else %>
|
|
15
|
-
<%= f.text_area attrib, id: "dyna_span_field_val_#{unique_ref_id}", onfocus: "$().dynaspan.upLast('#{unique_ref_id}');", onblur: "$().dynaspan.upHide('#{unique_ref_id}');", **html_options.symbolize_keys %>
|
|
16
|
-
<% hidden_fields.each do |hkey, hval| %>
|
|
17
|
-
<%= f.hidden_field hkey.to_sym, value: hval %>
|
|
18
|
-
<% end if hidden_fields %>
|
|
19
|
-
<% end %>
|
|
20
|
-
<% end %>
|
|
21
|
-
</div>
|
|
22
|
-
<%= content_tag 'span', attr_object.try(attrib) || master_ds_object.try(attrib), id: "dyna_span_span#{unique_ref_id}", onclick: "$().dynaspan.upShow('#{unique_ref_id}');", class: 'dyna-span dyna-span-text', style: 'display:block;' %>
|
|
23
|
-
<%= content_tag('div', dyna_span_edit_text, class: 'dyna-span-edit-text pull-right', onclick: "$().dynaspan.upShow('#{unique_ref_id}');", style: 'cursor:pointer;') %>
|
|
24
|
-
</div>
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
<%# This is used through the helper method dynaspan_text_field %>
|
|
2
|
-
<div id="dyna_span_block<%= unique_ref_id %>" <%= "data-ds-callback-on-update=\"#{ds_callback_on_update}\" " if ds_callback_on_update.present? %> <%= "data-ds-callback-with-values=\"#{ds_callback_with_values}\" " if ds_callback_with_values.present? %>class='dyna-span<%= ' ds-content-present' if (attr_object.try(attrib).present? || master_ds_object.try(attrib).present?) %>'>
|
|
3
|
-
<%= hidden_field_tag "last_dyna_span_val_#{unique_ref_id}", attr_object.try(attrib) || master_ds_object.try(attrib), id: "last_dyna_span_val_#{unique_ref_id}" %>
|
|
4
|
-
<div id="<%= "dyna_span_div#{unique_ref_id}" %>" style="display:none;">
|
|
5
|
-
<%= form_for(master_ds_object, **form_for_options.symbolize_keys) do |f| %>
|
|
6
|
-
<% if master_ds_object.nested_attributes_options.keys.any? {|i| i.to_s.=~(/#{attr_object.class.try(:model_name).try(:i18n_key).to_s}/) || i.to_s.=~(/#{attr_object.class.try(:table_name)}/) } and !attr_object.nil? %>
|
|
7
|
-
<%= f.fields_for master_ds_object.nested_attributes_options.keys.select {|i| i.to_s.=~(/#{attr_object.class.model_name.i18n_key.to_s}/) || i.to_s.=~(/#{attr_object.class.table_name}/) }.first, attr_object do |a|%>
|
|
8
|
-
<%= a.hidden_field(:id, value: attr_object.id) if attr_object.id.present? %>
|
|
9
|
-
<% hidden_fields.each do |hkey, hval| %>
|
|
10
|
-
<%= a.hidden_field hkey.to_sym, value: hval %>
|
|
11
|
-
<% end if hidden_fields %>
|
|
12
|
-
<%= a.text_field attrib, id: "dyna_span_field_val_#{unique_ref_id}", onfocus: "$().dynaspan.upLast('#{unique_ref_id}');", onblur: "$().dynaspan.upHide('#{unique_ref_id}');", **html_options.symbolize_keys %>
|
|
13
|
-
<% end %>
|
|
14
|
-
<% else %>
|
|
15
|
-
<%= f.text_field attrib, id: "dyna_span_field_val_#{unique_ref_id}", onfocus: "$().dynaspan.upLast('#{unique_ref_id}');", onblur: "$().dynaspan.upHide('#{unique_ref_id}');", **html_options.symbolize_keys %>
|
|
16
|
-
<% hidden_fields.each do |hkey, hval| %>
|
|
17
|
-
<%= f.hidden_field hkey.to_sym, value: hval %>
|
|
18
|
-
<% end if hidden_fields %>
|
|
19
|
-
<% end %>
|
|
20
|
-
<% end %>
|
|
21
|
-
</div>
|
|
22
|
-
<%= content_tag 'span', attr_object.try(attrib) || master_ds_object.try(attrib), id: "dyna_span_span#{unique_ref_id}", onclick: "$().dynaspan.upShow('#{unique_ref_id}');", class: 'dyna-span dyna-span-text', style: 'display:block;' %>
|
|
23
|
-
<%= content_tag('div', dyna_span_edit_text, class: 'dyna-span-edit-text pull-right', onclick: "$().dynaspan.upShow('#{unique_ref_id}');", style: 'cursor:pointer;') %>
|
|
24
|
-
</div>
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<%# This is used through the helper method dynaspan_text_field %>
|
|
2
|
-
<div id="dyna_span_block<%= unique_ref_id %>" <%= "data-ds-callback-on-update=\"#{ds_callback_on_update}\" " if ds_callback_on_update.present? %> <%= "data-ds-callback-with-values=\"#{ds_callback_with_values}\" " if ds_callback_with_values.present? %>class='dyna-span<%= ' ds-content-present' if (attr_object.try(attrib).present? || master_ds_object.try(attrib).present?) %>'>
|
|
3
|
-
<%= hidden_field_tag "last_dyna_span_val_#{unique_ref_id}", attr_object.try(attrib) || master_ds_object.try(attrib), id: "last_dyna_span_val_#{unique_ref_id}" %>
|
|
4
|
-
<div id="<%= "dyna_span_div#{unique_ref_id}" %>" style="display:none;">
|
|
5
|
-
<%= form_for(master_ds_object, **form_for_options.symbolize_keys) do |f| %>
|
|
6
|
-
<% if master_ds_object.nested_attributes_options.keys.any? {|i| i.to_s.=~(/#{attr_object.class.try(:model_name).try(:i18n_key).to_s}/) || i.to_s.=~(/#{attr_object.class.try(:table_name)}/) } and !attr_object.nil? %>
|
|
7
|
-
<%= f.fields_for master_ds_object.nested_attributes_options.keys.select {|i| i.to_s.=~(/#{attr_object.class.model_name.i18n_key.to_s}/) || i.to_s.=~(/#{attr_object.class.table_name}/) }.first, attr_object do |a|%>
|
|
8
|
-
<%= a.hidden_field(:id, value: attr_object.id) if attr_object.id.present? %>
|
|
9
|
-
<% hidden_fields.each do |hkey, hval| %>
|
|
10
|
-
<%= a.hidden_field hkey.to_sym, value: hval %>
|
|
11
|
-
<% end if hidden_fields %>
|
|
12
|
-
<%= a.select( attrib, choices, options.symbolize_keys, {**html_options.symbolize_keys, id: "dyna_span_field_val_#{unique_ref_id}", onfocus: "$().dynaspan.upLast('#{unique_ref_id}');", onblur: "$().dynaspan.upHide('#{unique_ref_id}');"}, &block) %>
|
|
13
|
-
<% end %>
|
|
14
|
-
<% else %>
|
|
15
|
-
<%= f.select( attrib, choices, options.symbolize_keys, {**html_options.symbolize_keys, id: "dyna_span_field_val_#{unique_ref_id}", onfocus: "$().dynaspan.upLast('#{unique_ref_id}');", onblur: "$().dynaspan.upHide('#{unique_ref_id}');"}, &block) %>
|
|
16
|
-
<% hidden_fields.each do |hkey, hval| %>
|
|
17
|
-
<%= f.hidden_field hkey.to_sym, value: hval %>
|
|
18
|
-
<% end if hidden_fields %>
|
|
19
|
-
<% end %>
|
|
20
|
-
<% end %>
|
|
21
|
-
</div>
|
|
22
|
-
<% current_value = attr_object.try(attrib) || master_ds_object.try(attrib) %>
|
|
23
|
-
<% display_text = begin choices.match(/value="#{current_value}".*>(.+)</)[1] rescue nil end %>
|
|
24
|
-
<%= content_tag 'span', display_text || current_value, id: "dyna_span_span#{unique_ref_id}", onclick: "$().dynaspan.upShow('#{unique_ref_id}');", class: 'dyna-span dyna-span-text', style: 'display:block;' %>
|
|
25
|
-
<%= content_tag('div', dyna_span_edit_text, class: 'dyna-span-edit-text pull-right', onclick: "$().dynaspan.upShow('#{unique_ref_id}');", style: 'cursor:pointer;') %>
|
|
26
|
-
</div>
|
data/config/routes.rb
DELETED
data/dynaspan.gemspec
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
|
2
|
-
require File.expand_path('../lib/dynaspan/version', __FILE__)
|
|
3
|
-
|
|
4
|
-
Gem::Specification.new do |gem|
|
|
5
|
-
gem.authors = ['Daniel P. Clark']
|
|
6
|
-
gem.email = ['6ftdan@gmail.com']
|
|
7
|
-
gem.description = %q{In place text editing with AJAX substituting text to input field.}
|
|
8
|
-
gem.summary = %q{Text to AJAX editing in place.}
|
|
9
|
-
gem.homepage = 'https://github.com/danielpclark/dynaspan'
|
|
10
|
-
gem.licenses = ['MIT']
|
|
11
|
-
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
|
12
|
-
gem.files = `git ls-files`.split("\n")
|
|
13
|
-
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
|
14
|
-
gem.name = 'dynaspan'
|
|
15
|
-
gem.require_paths = ['lib']
|
|
16
|
-
gem.required_ruby_version = '>= 2.0'
|
|
17
|
-
gem.version = Dynaspan::VERSION
|
|
18
|
-
gem.requirements << "jQuery"
|
|
19
|
-
gem.requirements << "Rails"
|
|
20
|
-
end
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
<%
|
|
2
|
-
base_path = Rails.application.config.assets.prefix + '/dynaspan/'
|
|
3
|
-
base_path = Rails.application.config.action_controller.relative_url_root + base_path if Rails.application.config.action_controller.relative_url_root
|
|
4
|
-
%>
|
|
5
|
-
|
|
6
|
-
var DYNASPAN_BASEPATH = "<%= base_path %>";
|
data/lib/dynaspan/tasks.rake
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
require 'fileutils'
|
|
2
|
-
|
|
3
|
-
desc "Create nondigest versions of all dynaspan digest assets"
|
|
4
|
-
task "assets:precompile" do
|
|
5
|
-
fingerprint = /\-[0-9a-f]{32}\./
|
|
6
|
-
for file in Dir["public/assets/dynaspan/**/*"]
|
|
7
|
-
next unless file =~ fingerprint
|
|
8
|
-
nondigest = file.sub fingerprint, '.'
|
|
9
|
-
if !File.exist?(nondigest) or File.mtime(file) > File.mtime(nondigest)
|
|
10
|
-
FileUtils.cp file, nondigest, verbose: true
|
|
11
|
-
end
|
|
12
|
-
end
|
|
13
|
-
end
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
// MIT LICENSE
|
|
2
|
-
// Copyright (c) 2014 Daniel P. Clark
|
|
3
|
-
(function($){
|
|
4
|
-
$.fn.dynaspan = function(){};
|
|
5
|
-
|
|
6
|
-
$.fn.dynaspan.appendParameter = function(excmd,append_param){
|
|
7
|
-
var regExp = [/\(([^)]+)\);?$/,/\(\);?$/];
|
|
8
|
-
var matches = [regExp[0].exec(excmd), regExp[1].exec(excmd)];
|
|
9
|
-
if (matches[0]){
|
|
10
|
-
return(excmd.replace(matches[0][0],'(' + matches[0][1] + ',' + append_param +');'));
|
|
11
|
-
} else if (matches[1]) {
|
|
12
|
-
return(excmd.replace(matches[1][0],'(' + append_param + ');'));
|
|
13
|
-
} else {
|
|
14
|
-
return excmd.replace(/;$/,'') + '(' + append_param + ');';
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
$.fn.dynaspan.upLast = function(uniq_id_ref){
|
|
19
|
-
$('#dyna_span_field_val_' + uniq_id_ref).val($('#last_dyna_span_val_' + uniq_id_ref).val());
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
$.fn.dynaspan.upShow = function(uniq_id_ref){
|
|
23
|
-
$('#dyna_span_div' + uniq_id_ref).show().find('.dyna-span-input').focus();
|
|
24
|
-
$('#dyna_span_span' + uniq_id_ref).hide();
|
|
25
|
-
$("#dyna_span_block" + uniq_id_ref).addClass("ds-dialog-open");
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
$.fn.dynaspan.upHide = function(uniq_id_ref){
|
|
29
|
-
var field_val = $('#dyna_span_field_val_' + uniq_id_ref).val();
|
|
30
|
-
$('#dyna_span_div' + uniq_id_ref + ' > form').trigger('submit.rails');
|
|
31
|
-
$('#last_dyna_span_val_' + uniq_id_ref).val(field_val);
|
|
32
|
-
$('select#dyna_span_field_val_' + uniq_id_ref).each(function(){
|
|
33
|
-
field_val = $(this).children("option:selected").text()
|
|
34
|
-
});
|
|
35
|
-
$('#dyna_span_span' + uniq_id_ref).show().html(field_val);
|
|
36
|
-
$('#dyna_span_div' + uniq_id_ref).hide();
|
|
37
|
-
var ds_block = $("#dyna_span_block" + uniq_id_ref);
|
|
38
|
-
ds_block.removeClass("ds-dialog-open");
|
|
39
|
-
if (field_val.length == 0){
|
|
40
|
-
ds_block.removeClass("ds-content-present")
|
|
41
|
-
} else {
|
|
42
|
-
ds_block.addClass("ds-content-present")
|
|
43
|
-
}
|
|
44
|
-
if (ds_block.data('dsCallbackWithValues')){
|
|
45
|
-
eval(
|
|
46
|
-
$.fn.dynaspan.appendParameter(
|
|
47
|
-
ds_block.data('dsCallbackWithValues'),
|
|
48
|
-
"{ds_selector:'#dyna_span_block" + uniq_id_ref + "',ds_input:'" + field_val + "'}"
|
|
49
|
-
)
|
|
50
|
-
)
|
|
51
|
-
}
|
|
52
|
-
if (ds_block.data('dsCallbackOnUpdate')){
|
|
53
|
-
eval(ds_block.data('dsCallbackOnUpdate'))
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
})(jQuery);
|