|
99 | 99 | </script> |
100 | 100 |
|
101 | 101 | <script type="text/javascript"> |
| 102 | + // Need to simulate a namespace, so that some of the variables don't leak across nodes |
| 103 | + function NaturalLanguageClassifierV1 () {} |
102 | 104 |
|
103 | | -// This is the on edit prepare function, which will be |
104 | | -//invoked everytime the dialog is shown. |
105 | | -function nlconeditprepare() { |
106 | | - $('#node-input-mode').change(function () { |
107 | | - var mode = $('#node-input-mode').val(); |
108 | | - $('.form-row.mode.' + mode).show(); |
109 | | - $('.form-row.mode:not(.' + mode + ')').hide(); |
110 | | - }) |
111 | | - $.getJSON('watson-natural-language-classifier/vcap/') |
112 | | - .done(function (service) { |
113 | | - $('.credentials').toggle(!service); |
114 | | - }) |
115 | | - .fail(function () { |
116 | | - $('.credentials').show(); |
117 | | - }).always(function () { |
118 | | - $('#credentials-check').hide(); |
| 105 | + // This is the namespace for this version of this Node. |
| 106 | + var nlcV1 = new NaturalLanguageClassifierV1(); |
| 107 | + |
| 108 | + // This is the on edit prepare function, which will be |
| 109 | + //invoked everytime the dialog is shown. |
| 110 | + function nlconeditprepare() { |
| 111 | + $('#node-input-mode').change(function () { |
| 112 | + var mode = $('#node-input-mode').val(); |
| 113 | + $('.form-row.mode.' + mode).show(); |
| 114 | + $('.form-row.mode:not(.' + mode + ')').hide(); |
119 | 115 | }) |
120 | | -} |
| 116 | + $.getJSON('watson-natural-language-classifier/vcap/') |
| 117 | + .done(function (service) { |
| 118 | + $('.credentials').toggle(!service); |
| 119 | + }) |
| 120 | + .fail(function () { |
| 121 | + $('.credentials').show(); |
| 122 | + }).always(function () { |
| 123 | + $('#credentials-check').hide(); |
| 124 | + }) |
| 125 | + } |
121 | 126 |
|
122 | 127 |
|
123 | 128 | (function() { |
|
0 commit comments