|
149 | 149 | }); |
150 | 150 | }, |
151 | 151 | oneditprepare: function() { |
152 | | - |
| 152 | + |
153 | 153 | // Configures popover options for all popovers that appear when an editor option is hovered over |
154 | 154 | $('.popover-right').popover({ |
155 | 155 | placement:"right", |
|
158 | 158 | container: '#main-container', |
159 | 159 | delay: { show: 500, hide: 50 } |
160 | 160 | }); |
161 | | - |
| 161 | + |
162 | 162 | //Configures popover options for parameter info link |
163 | 163 | $('#node-config-input-parameter-info').popover({ |
164 | 164 | placement:"left", |
|
168 | 168 | content: this._("swagger.content.parameter-info"), |
169 | 169 | delay: { show: 500, hide: 50 } |
170 | 170 | }); |
171 | | - |
| 171 | + |
172 | 172 | //Configures popover options for response info link |
173 | 173 | $('#node-config-input-response-info').popover({ |
174 | 174 | placement:"left", |
|
291 | 291 | style: "width: 150px;", |
292 | 292 | type: "text" |
293 | 293 | }).val(opts.format).appendTo(row); |
294 | | - |
| 294 | + |
295 | 295 | if(!opts.propertyRow){ |
296 | 296 | var collFormatSelect = $('<select/>', { |
297 | 297 | class: "node-swagger-type-collection-format", |
|
315 | 315 | $(this).parent().find(".node-swagger-type-format").show(); |
316 | 316 | $(this).parent().find(".node-swagger-type-format-label").text(formatText); |
317 | 317 | $(this).parent().find(".node-swagger-type-collection-format").hide(); |
318 | | - |
| 318 | + |
319 | 319 | if (t == "ref") { |
320 | 320 | $(this).parent().find(".node-swagger-type-format-label").text(""); |
321 | 321 | } else { |
|
390 | 390 | This function is called anytime a new paramater is created. |
391 | 391 | This is called several times when parsing through the swagger doc. |
392 | 392 | If expand is true, the inner properties of the parameter will be showing when the editor opens. |
393 | | - */ |
| 393 | + */ |
394 | 394 | var generateParameterLine = function(opts, expand) { |
395 | 395 | var li = $("<li/>", { |
396 | 396 | style: "background: #fff; margin:4px 0; border: 1px solid #ccc;" |
|
632 | 632 | This function is called anytime a new response is created. |
633 | 633 | It is run when parsing through the swagger doc. |
634 | 634 | If expand is true, the inner properties of the response will be shown when the editor opens. |
635 | | - */ |
| 635 | + */ |
636 | 636 | var generateResponseLine = function(opts, expand) { |
637 | 637 | var li = $("<li/>", { |
638 | 638 | style: "background: #fff; margin:4px 0; border: 1px solid #ccc;" |
|
813 | 813 | }, false); |
814 | 814 | pathParams.splice(pathParams.indexOf(p.name), 1); |
815 | 815 | } else{//param is no longer a path param |
816 | | - console.log('removing outdated path param: ' + p.name); |
| 816 | + //console.log('removing outdated path param: ' + p.name); |
817 | 817 | delete p; |
818 | 818 | } |
819 | 819 | } else{ |
|
833 | 833 |
|
834 | 834 | //Add path params that weren't found above |
835 | 835 | pathParams.forEach(function(p){ |
836 | | - console.log('adding path param: ' + p); |
| 836 | + //console.log('adding path param: ' + p); |
837 | 837 | generateParameterLine({ |
838 | 838 | name: p, |
839 | 839 | in : 'path', |
|
876 | 876 | } |
877 | 877 | return items; |
878 | 878 | } |
879 | | - |
| 879 | + |
880 | 880 | //Parse parameters and generate list |
881 | 881 | var params = []; |
882 | 882 | $("#node-config-parameter-list li").each(function() { |
|
900 | 900 | var name = $(this).find(".node-swagger-type-name").val(); |
901 | 901 |
|
902 | 902 | var row = $(this).find(".node-swagger-type-top-row"); |
903 | | - |
| 903 | + |
904 | 904 | var current = property; |
905 | 905 | var ctype = row.children(".node-swagger-type-select").val(); |
906 | | - |
| 906 | + |
907 | 907 | if(ctype){ |
908 | 908 | if (ctype != "ref") { |
909 | 909 | current.type = ctype; |
910 | 910 | if (current.type == "array") { |
911 | | - |
| 911 | + |
912 | 912 | var collFormat = row.children(".node-swagger-type-collection-format").val(); |
913 | 913 | if(collFormat) |
914 | 914 | current.collectionFormat = collFormat; |
915 | | - |
| 915 | + |
916 | 916 | var nextRow = row.children(".node-swagger-type-row"); |
917 | | - |
| 917 | + |
918 | 918 | current.items = getArrayItems(nextRow); |
919 | 919 |
|
920 | 920 | } else { |
|
937 | 937 | } |
938 | 938 | } else { |
939 | 939 | var row = $(this).find(".node-swagger-type-top-row"); |
940 | | - |
| 940 | + |
941 | 941 | var current = param; |
942 | | - |
| 942 | + |
943 | 943 | var ctype = row.children(".node-swagger-type-select").val(); |
944 | | - |
| 944 | + |
945 | 945 | if(ctype){ |
946 | 946 | if (ctype != "ref") { |
947 | 947 | current.type = ctype; |
948 | 948 | if (current.type == "array") { |
949 | 949 | var collFormat = row.children(".node-swagger-type-collection-format").val(); |
950 | 950 | current.collectionFormat = collFormat; |
951 | | - |
| 951 | + |
952 | 952 | var nextRow = row.children(".node-swagger-type-row"); |
953 | | - |
| 953 | + |
954 | 954 | current.items = getArrayItems(nextRow); |
955 | 955 |
|
956 | 956 | } else { |
|
991 | 991 |
|
992 | 992 | var current = property; |
993 | 993 | var ctype = row.children(".node-swagger-type-select").val(); |
994 | | - |
| 994 | + |
995 | 995 | if(ctype){ |
996 | 996 | if (ctype != "ref") { |
997 | 997 | current.type = ctype; |
998 | 998 | if (current.type == "array") { |
999 | | - |
| 999 | + |
1000 | 1000 | var collFormat = row.children(".node-swagger-type-collection-format").val(); |
1001 | 1001 | if(collFormat) |
1002 | 1002 | current.collectionFormat = collFormat; |
1003 | | - |
| 1003 | + |
1004 | 1004 | var nextRow = row.children(".node-swagger-type-row"); |
1005 | | - |
| 1005 | + |
1006 | 1006 | current.items = getArrayItems(nextRow); |
1007 | 1007 |
|
1008 | 1008 | } else { |
|
0 commit comments