2 ============LICENSE_START=======================================================
4 ================================================================================
5 Copyright (C) 2017 AT&T Intellectual Property. All rights
7 ================================================================================
8 Licensed under the Apache License, Version 2.0 (the "License");
9 you may not use this file except in compliance with the License.
10 You may obtain a copy of the License at
12 http://www.apache.org/licenses/LICENSE-2.0
14 Unless required by applicable law or agreed to in writing, software
15 distributed under the License is distributed on an "AS IS" BASIS,
16 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 See the License for the specific language governing permissions and
18 limitations under the License.
19 ============LICENSE_END============================================
20 ===================================================================
21 ECOMP is a trademark and service mark of AT&T Intellectual Property.
30 .fileUpload input.upload {
39 filter: alpha(opacity=0);
44 display: inline-block;
57 <div attribute-test="templatemodel" id="configure-widgets" >
58 <div attribute-test="templatemodelh" class="modal-header">
59 <button type="button" class="close" ng-click="close(false)" aria-hidden="true" style="margin-top: -3px">×</button>
62 <div class="modal-body" style="height: 280px">
63 <div style="height: 10px">
65 <form id="saveProps" name="t" class="form-horizontal">
68 <div class="form-group">
69 <label for="schemaLocation" class="col-sm-4 control-label">ID</label>
71 <div class="col-sm-8">
72 <input class="form-control" type="text" focus="true" name="_id" id="_id" readonly>
73 <div hidden id="warnings_">Special Characters are not allowed in template id.</span> <!-- <span ng-show="nameinUse" style="color: red"> Model Name Already In Use</span> --></div>
80 <div attribute-test="templatemodelf" class="modal-footer">
81 <button id="savePropsBtn" class="btn btn-primary" ng-disabled="t._id.$error.pattern" >Close</button>
82 <button ng-click="close(true)" id="close_button" class="btn btn-primary">Cancel</button>
86 loadPropertyWindow("template");
87 var el=elementMap[lastElementSelected];
89 //console.log(lastElementSelected)
90 //$("#id").val("lolololol")
91 // $('.modal-header > h4').html($('.djs-visual > text').val());
94 for(var i=0;i<el.length;i++){
95 console.log(el.length)
96 console.log(el[i].name)
97 console.log(el[i].value)
98 $("#"+el[i].name).val(el[i].value);
101 $("#_id").keyup(function(){
102 var pattern=/^\s*[\w\-]*\s*$/
103 if( !pattern.test($(this).val()) && !$(this).is("[disabled]")){
104 $("#savePropsBtn").attr("disabled","");
105 $("#warnings_").removeAttr("hidden")
106 console.log("remove hidden")
109 //console.log($(this).is("[disabled]"))
110 console.log("add hidden ")
111 if($("#savePropsBtn").is("[disabled]")){
112 $("#savePropsBtn").removeAttr("disabled");
113 $("#warnings_").attr("hidden", "");
114 console.log("add hidden if")
120 $("#saveProps").on('submit', function (event) {
121 //console.log(lastElementSelected)
122 saveProperties($(this).serializeArray())
123 event.preventDefault();
124 $("#close_button").click();
127 $("#savePropsBtn").click(function (event) {
128 $("#saveProps").submit();