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.
- data/lib/whowish_word/rails/public/javascripts/7_whowish_word_attribute_handler.js +9 -5
- data/lib/whowish_word/rails/public/javascripts/7_whowish_word_html_handler.js +6 -3
- data/lib/whowish_word/rails/public/javascripts/7_whowish_word_text_handler.js +5 -3
- data/lib/whowish_word/rails/public/javascripts/7_whowish_word_value_handler.js +11 -8
- data/whowish_word.gemspec +1 -1
- metadata +1 -1
@@ -1,25 +1,29 @@
|
|
1
1
|
var WhowishWordAttributeHandler = WhowishWordContentHandler.extend({
|
2
2
|
|
3
3
|
init: function(elem,attributeName){
|
4
|
-
this.
|
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
|
-
|
13
|
+
elem[this.attributeName] = content;
|
12
14
|
} catch(e) {}
|
13
15
|
|
14
16
|
try {
|
15
|
-
|
17
|
+
elem.attributes[this.attributeName].value = content;
|
16
18
|
} catch (e) {}
|
17
19
|
|
18
|
-
$w(
|
20
|
+
$w(elem).attr(this.attributeName, content);
|
19
21
|
},
|
20
22
|
|
21
23
|
getContent: function(){
|
22
|
-
|
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.
|
4
|
+
this.element_id = elem.id;
|
5
5
|
},
|
6
6
|
|
7
7
|
setContent: function(content){
|
8
|
-
|
8
|
+
var elem = $w('#' + this.element_id)[0];
|
9
|
+
$w(elem).html(content);
|
9
10
|
},
|
10
11
|
|
11
12
|
getContent: function(){
|
12
|
-
|
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.
|
4
|
+
this.element_id = elem.id;
|
5
5
|
},
|
6
6
|
|
7
7
|
setContent: function(content){
|
8
|
-
|
8
|
+
var elem = $w('#' + this.element_id)[0];
|
9
|
+
$w(elem).text(content);
|
9
10
|
},
|
10
11
|
|
11
12
|
getContent: function() {
|
12
|
-
|
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.
|
4
|
+
this.element_id = elem.id;
|
5
5
|
},
|
6
6
|
|
7
7
|
setContent: function(content){
|
8
|
-
|
8
|
+
var elem = $w('#' + this.element_id)[0];
|
9
|
+
|
10
|
+
$w(elem).val(content);
|
9
11
|
|
10
|
-
if (
|
11
|
-
|
12
|
+
if (elem.attributes['value'] != undefined) {
|
13
|
+
elem.attributes['value'].value = content;
|
12
14
|
}
|
13
15
|
|
14
|
-
if (
|
15
|
-
|
16
|
+
if (elem.value != undefined) {
|
17
|
+
elem.value = content;
|
16
18
|
}
|
17
19
|
|
18
|
-
$w(
|
20
|
+
$w(elem).attr('value', content);
|
19
21
|
},
|
20
22
|
|
21
23
|
getContent: function(){
|
22
|
-
|
24
|
+
var elem = $w('#' + this.element_id)[0];
|
25
|
+
return $w(elem).val();
|
23
26
|
}
|
24
27
|
|
25
28
|
});
|
data/whowish_word.gemspec
CHANGED