whowish_word 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
@@ -11,7 +11,7 @@ var WhowishWordElementCreator = WhowishWordCreator.extend({
|
|
11
11
|
$w(editIcon).attr('id', this.getEditIconId(attrs[i]));
|
12
12
|
$w(editIcon).attr('title', attrs[i]);
|
13
13
|
|
14
|
-
var whowishWordIdPackage = whowishWordHelper.extractWhowishWordIdFromText(this.element
|
14
|
+
var whowishWordIdPackage = whowishWordHelper.extractWhowishWordIdFromText($w(this.element).attr(attrs[i]));
|
15
15
|
var idPackage = whowishWordHelper.parseWhowishWordIdPackage(whowishWordIdPackage);
|
16
16
|
|
17
17
|
editIcon.whowishWord = {};
|
@@ -32,9 +32,19 @@ var WhowishWordElementCreator = WhowishWordCreator.extend({
|
|
32
32
|
var attrs = this.getRelevantAttributes();
|
33
33
|
|
34
34
|
for (var i=0;i<attrs.length;i++) {
|
35
|
-
|
36
|
-
this.element.
|
37
|
-
|
35
|
+
|
36
|
+
var newValue = $w(this.element).attr(attrs[i]).replace(whowishWordVariables.attributeValuePattern,"$2");
|
37
|
+
|
38
|
+
try {
|
39
|
+
this.element[attrs[i]] = newValue;
|
40
|
+
} catch(e) {}
|
41
|
+
|
42
|
+
try {
|
43
|
+
this.element.attributes[attrs[i]].value = newValue;
|
44
|
+
} catch (e) {}
|
45
|
+
|
46
|
+
$w(this.element).attr(attrs[i], newValue);
|
47
|
+
|
38
48
|
}
|
39
49
|
|
40
50
|
},
|
@@ -6,12 +6,20 @@ var WhowishWordAttributeHandler = WhowishWordContentHandler.extend({
|
|
6
6
|
},
|
7
7
|
|
8
8
|
setContent: function(content){
|
9
|
-
|
10
|
-
|
9
|
+
|
10
|
+
try {
|
11
|
+
this.element[this.attributeName] = content;
|
12
|
+
} catch(e) {}
|
13
|
+
|
14
|
+
try {
|
15
|
+
this.element.attributes[this.attributeName].value = content;
|
16
|
+
} catch (e) {}
|
17
|
+
|
18
|
+
$w(this.element).attr(this.attributeName, content);
|
11
19
|
},
|
12
20
|
|
13
21
|
getContent: function(){
|
14
|
-
return this.element
|
22
|
+
return $(this.element).attr(this.attributeName);
|
15
23
|
}
|
16
24
|
|
17
25
|
});
|
@@ -24,23 +24,23 @@
|
|
24
24
|
<input type="text" name="some_textbox">
|
25
25
|
</span>
|
26
26
|
<span>
|
27
|
-
<b>Textbox: </b> <input type="textbox"
|
27
|
+
<b>Textbox: </b> <input type="textbox" name="<%=rand(1000)%>"
|
28
28
|
title="<%=word_for_attr :textbox_title%>"
|
29
29
|
value="<%=word_for_attr :textbox_value%>"
|
30
30
|
placeholder="<%=word_for_attr :textbox_placeholder%>">
|
31
31
|
</span>
|
32
32
|
<span>
|
33
|
-
<b>Textarea: </b> <textarea
|
33
|
+
<b>Textarea: </b> <textarea name="<%=rand(1000)%>"
|
34
34
|
title="<%=word_for_attr :textarea_title%>"
|
35
35
|
placeholder="<%=word_for_attr :textarea_placeholder%>"><%=word_for_attr :textarea_value%></textarea>
|
36
36
|
</span>
|
37
37
|
<span>
|
38
|
-
<b>Checkbox: </b> <input type="checkbox"
|
38
|
+
<b>Checkbox: </b> <input type="checkbox" name="<%=rand(1000)%>"
|
39
39
|
title="<%=word_for_attr :checkbox_title%>"
|
40
40
|
value="<%=word_for_attr :checkbox_value%>">
|
41
41
|
</span>
|
42
42
|
<span>
|
43
|
-
<b>Radio: </b> <input type="radio"
|
43
|
+
<b>Radio: </b> <input type="radio" name="<%=rand(1000)%>"
|
44
44
|
title="<%=word_for_attr :radio_title%>"
|
45
45
|
value="<%=word_for_attr :radio_value%>">
|
46
46
|
</span>
|
@@ -75,7 +75,7 @@
|
|
75
75
|
</script>
|
76
76
|
</span>
|
77
77
|
<span>
|
78
|
-
<b>Late Textbox: </b> <input type="textbox" id="late_textbox"
|
78
|
+
<b>Late Textbox: </b> <input type="textbox" id="late_textbox" name="<%=rand(1000)%>"
|
79
79
|
title="title"
|
80
80
|
value="value"
|
81
81
|
placeholder="placeholder">
|
data/whowish_word.gemspec
CHANGED