whowish_word 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,25 +1,29 @@
1
1
  var WhowishWordAttributeHandler = WhowishWordContentHandler.extend({
2
2
 
3
3
  init: function(elem,attributeName){
4
- this.element = elem;
4
+ this.element_id = elem.id;
5
5
  this.attributeName = attributeName;
6
6
  },
7
7
 
8
8
  setContent: function(content){
9
9
 
10
+ var elem = $w('#' + this.element_id)[0];
11
+
10
12
  try {
11
- this.element[this.attributeName] = content;
13
+ elem[this.attributeName] = content;
12
14
  } catch(e) {}
13
15
 
14
16
  try {
15
- this.element.attributes[this.attributeName].value = content;
17
+ elem.attributes[this.attributeName].value = content;
16
18
  } catch (e) {}
17
19
 
18
- $w(this.element).attr(this.attributeName, content);
20
+ $w(elem).attr(this.attributeName, content);
19
21
  },
20
22
 
21
23
  getContent: function(){
22
- return $(this.element).attr(this.attributeName);
24
+ var elem = $w('#' + this.element_id)[0];
25
+ return $w(elem).attr(this.attributeName);
26
+
23
27
  }
24
28
 
25
29
  });
@@ -1,15 +1,18 @@
1
1
  var WhowishWordHtmlHandler = WhowishWordContentHandler.extend({
2
2
 
3
3
  init: function(elem){
4
- this.element = elem;
4
+ this.element_id = elem.id;
5
5
  },
6
6
 
7
7
  setContent: function(content){
8
- $w(this.element).html(content);
8
+ var elem = $w('#' + this.element_id)[0];
9
+ $w(elem).html(content);
9
10
  },
10
11
 
11
12
  getContent: function(){
12
- return $w(this.element).html();
13
+
14
+ var elem = $w('#' + this.element_id)[0];
15
+ return $w(elem).html();
13
16
  }
14
17
 
15
18
  });
@@ -1,15 +1,17 @@
1
1
  var WhowishWordTextHandler = WhowishWordContentHandler.extend({
2
2
 
3
3
  init: function(elem){
4
- this.element = elem;
4
+ this.element_id = elem.id;
5
5
  },
6
6
 
7
7
  setContent: function(content){
8
- $w(this.element).text(content);
8
+ var elem = $w('#' + this.element_id)[0];
9
+ $w(elem).text(content);
9
10
  },
10
11
 
11
12
  getContent: function() {
12
- return $w(this.element).text();
13
+ var elem = $w('#' + this.element_id)[0];
14
+ return $w(elem).text();
13
15
  }
14
16
 
15
17
  });
@@ -1,25 +1,28 @@
1
1
  var WhowishWordValueHandler = WhowishWordContentHandler.extend({
2
2
 
3
3
  init: function(elem){
4
- this.element = elem;
4
+ this.element_id = elem.id;
5
5
  },
6
6
 
7
7
  setContent: function(content){
8
- $w(this.element).val(content);
8
+ var elem = $w('#' + this.element_id)[0];
9
+
10
+ $w(elem).val(content);
9
11
 
10
- if (this.element.attributes['value'] != undefined) {
11
- this.element.attributes['value'].value = content;
12
+ if (elem.attributes['value'] != undefined) {
13
+ elem.attributes['value'].value = content;
12
14
  }
13
15
 
14
- if (this.element.value != undefined) {
15
- this.element.value = content;
16
+ if (elem.value != undefined) {
17
+ elem.value = content;
16
18
  }
17
19
 
18
- $w(this.element).attr('value', content);
20
+ $w(elem).attr('value', content);
19
21
  },
20
22
 
21
23
  getContent: function(){
22
- return $w(this.element).val();
24
+ var elem = $w('#' + this.element_id)[0];
25
+ return $w(elem).val();
23
26
  }
24
27
 
25
28
  });
data/whowish_word.gemspec CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "whowish_word"
6
- s.version = "0.1.7"
6
+ s.version = "0.1.8"
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ["Tanin Na Nakorn"]
9
9
  s.email = ["tanin47@yahoo.com"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: whowish_word
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: