Browse code

add remove i18n (dont work)

devnewton authored on 07/09/2017 12:48:41
Showing 2 changed files
... ...
@@ -1,21 +1,21 @@
1 1
 <script type="text/x-red" data-template-name="cheerio">
2 2
     <div class="form-row">
3
-        <label for="node-input-tag"><i class="fa fa-filter"></i> <span data-i18n="cheerio.label.select"></span></label>
4
-        <input type="text" id="node-input-tag" placeholder="h1">
3
+        <label for="node-input-tag"><i class="fa fa-filter"></i> Selector</label>
4
+        <input type="text" id="node-input-tag" placeholder="h1" title="Elements selector">
5 5
     </div>
6 6
     <div class="form-row">
7
-        <label for="node-input-ret"><i class="fa fa-sign-out"></i> <span data-i18n="cheerio.label.output"></span></label>
7
+        <label for="node-input-ret"><i class="fa fa-sign-out"></i> Output</span></label>
8 8
         <select id="node-input-ret" style="width:70%">
9
-            <option value="html" data-i18n="cheerio.output.html"></option>
10
-            <option value="text" data-i18n="cheerio.output.text"></option>
11
-            <option value="object" data-i18n="cheerio.output.object"></option>
9
+            <option value="html">html</option>
10
+            <option value="text">text</option>
11
+            <option value="object">map to objects</option>
12 12
         </select>
13 13
     </div>
14 14
     <div class="form-row">
15 15
         <label for="node-input-as">&nbsp;</label>
16 16
         <select id="node-input-as" style="width:70%">
17
-            <option value="single" data-i18n="cheerio.format.single"></option>
18
-            <option value="multi" data-i18n="cheerio.format.multi"></option>
17
+            <option value="single">as a single message containing an array</option>
18
+            <option value="multi">as multiple messages, one for each element</option>
19 19
         </select>
20 20
     </div>
21 21
     <div class="form-row">
... ...
@@ -40,8 +40,8 @@
40 40
     </div>
41 41
     <br/>
42 42
     <div class="form-row">
43
-        <label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
44
-        <input type="text" id="node-input-name" style="width:70%" data-i18n="[placeholder]common.label.name">
43
+        <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
44
+        <input type="text" id="node-input-name" style="width:70%" placeholder="name">
45 45
     </div>
46 46
 </script>
47 47
 
... ...
@@ -51,8 +51,6 @@
51 51
     <dl class="message-properties">
52 52
         <dt>payload <span class="property-type">string</span></dt>
53 53
         <dd>the html string from which to extract elements.</dd>
54
-        <dt class="optional">select <span class="property-type">string</span></dt>
55
-        <dd>if not configured in the edit panel the selector can be set as a property of msg.</dd>
56 54
     </dl>
57 55
     <h3>Output</h3>
58 56
     <dl class="message-properties">
... ...
@@ -64,6 +62,7 @@
64 62
     <p>This node supports a combination of CSS and jQuery selectors. See the
65 63
     <a href="https://github.com/fb55/CSSselect#user-content-supported-selectors" target="_blank">css-select documentation</a> for more information
66 64
     on the supported syntax.</p>
65
+     <p>Output can be plain text, html or complex mapping to objects using sub selectors.</p>
67 66
 </script>
68 67
 
69 68
 <script type="text/javascript">
... ...
@@ -97,12 +96,12 @@
97 96
             function generateRow(mapping) {
98 97
                 var container = $('<li/>',{style:"margin:0; padding:8px 0px; border-bottom: 1px solid #ccc;"});
99 98
                 var row = $('<div/>').appendTo(container);
100
-                var searchField = $('<input/>',{class:"node-input-mapping-search",type:"text",style:"margin-left: 5px; width: 25%;",placeholder:"Search", title:"Selector"}).appendTo(row);
99
+                var searchField = $('<input/>',{class:"node-input-mapping-search",type:"text",style:"margin-left: 5px; width: 20%;",placeholder:"Selector", title:"Sub elements selector"}).appendTo(row);
101 100
                 var retField = $('<select></select>',{class:"node-input-mapping-ret",style:"margin-left: 5px; width: 20%;", title:"Return"}).appendTo(row);
102 101
                 $('<option value="text">text</option><option value="html">html</option><option value="attribute">attribute</option>').appendTo(retField);
103
-                var attrField = $('<input/>',{class:"node-input-mapping-attr",type:"text",style:"margin-left: 5px; width: 10%;",placeholder:"attribute", title:"Attribute"}).appendTo(row);
102
+                var attrField = $('<input/>',{class:"node-input-mapping-attr",type:"text",style:"margin-left: 5px; width: 20%;",placeholder:"Attribute", title:"Attribute name"}).appendTo(row);
104 103
                 $('<span/>',{class:"fa fa-arrow-right",style:"margin: 5px"}).appendTo(row);
105
-                var replaceField = $('<input/>',{class:"node-input-mapping-replace",type:"text",style:"width: 25%;",placeholder:"Replace", title: 'Output field'}).appendTo(row);
104
+                var replaceField = $('<input/>',{class:"node-input-mapping-replace",type:"text",style:"width: 20%;",placeholder:"Field", title: 'Output field'}).appendTo(row);
106 105
                 searchField.val(mapping.search);
107 106
                 retField.val(mapping.ret);
108 107
                 attrField.val(mapping.attr);
109 108
deleted file mode 100644
... ...
@@ -1,17 +0,0 @@
1
-{
2
-    "cheerio": {
3
-        "label": {
4
-            "select": "Root selector",
5
-            "output": "Output"
6
-        },
7
-        "output": {
8
-            "html": "html content of the elements",
9
-            "text": "text content of the elements",
10
-            "object": "map to objects"
11
-        },
12
-        "format": {
13
-            "single": "as a single message containing an array",
14
-            "multi": "as multiple messages, one for each element"
15
-        }
16
-    }
17
-}