fix odl patches
[ccsdk/distribution.git] / dgbuilder / core_nodes / io / 23-watch.html
1 <!--
2   Copyright 2013 IBM Corp.
3
4   Licensed under the Apache License, Version 2.0 (the "License");
5   you may not use this file except in compliance with the License.
6   You may obtain a copy of the License at
7
8   http://www.apache.org/licenses/LICENSE-2.0
9
10   Unless required by applicable law or agreed to in writing, software
11   distributed under the License is distributed on an "AS IS" BASIS,
12   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   See the License for the specific language governing permissions and
14   limitations under the License.
15 -->
16
17 <script type="text/x-red" data-template-name="watch">
18     <div class="form-row node-input-filename">
19          <label for="node-input-files"><i class="fa fa-file"></i> File(s)</label>
20          <input type="text" id="node-input-files" placeholder="File(s) or Directory">
21     </div>
22     <div class="form-row">
23         <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
24         <input type="text" id="node-input-name" placeholder="Name">
25     </div>
26      <div id="node-input-tip" class="form-tips">On Windows you must use double slashes \\ in any directory names.</div>
27 </script>
28
29 <script type="text/x-red" data-help-name="watch">
30     <p>Watches a directory or file for any changes.</p>
31     <p>You can enter a list of comma separated directories or files if you like. You will need to put " around any that have spaces in.</p>
32     <p>On Windows you must use double slashes \\ in any directory names.</p>
33     <p>The full filename of the file that actually changed is put into <b>msg.payload</b>, while a stringified version of the watched criteria is returned in <b>msg.topic</b>.</p>
34     <p><b>msg.file</b> contains just the short filename of the file that changed.</p>
35     <p>Of course in Linux, <i>everything</i> could be a file and thus watched...</p>
36     <p><b>Note: </b>The directory or file must exist in order to be watched. If the file or directory gets deleted it may no longer be monitored even if it gets re-created.</p>
37 </script>
38
39 <script type="text/javascript">
40     RED.nodes.registerType('watch',{
41         category: 'advanced-input',
42         defaults: {
43             name: {value:""},
44             files: {value:"",required:true}
45         },
46         color:"BurlyWood",
47         inputs:0,
48         outputs:1,
49         icon: "watch.png",
50         label: function() {
51             return this.name||this.files;
52         },
53         labelStyle: function() {
54             return this.name?"node_label_italic":"";
55         }
56     });
57 </script>