How to use getInstanceId method in Best

Best JavaScript code snippet using best

draft.js

Source:draft.js Github

copy

Full Screen

1var roleName = soyut.Session.role;2var fontSize = '24px';3var getId = getParam('id');4var getCurid = getParam('curid');5var getScenario = getParam('scenario');6soyut.rig.getRigListReceiversWasdal(getScenario, function (listReceiverWasdal) {7 soyut.rig.getRigListSender(getScenario, function (listSenderWasdal) {8 soyut.rig.renderRigListAuthor(getScenario, function (listAuthor) {9 var vmlist;10 // var limit = function (event) {11 // var linha = $(this).attr("limit");12 // var array = $(this).val().split("\n");13 // $.each(array, function (i, value) {14 // array[i] = value.slice(0, linha);15 // });16 // $(this).val(array.join("\n"))17 // }18 // $("textarea[limit]").keydown(limit).keyup(limit);19 Vue.filter('truncate', function (value) {20 var length = 50;21 if (value.length <= length) {22 return value;23 }24 else {25 return value.substring(0, length) + '...';26 }27 });28 Vue.filter('fromfilter', function (value) {29 var length = 12;30 if (value.length <= length) {31 return value;32 }33 else {34 return value.substring(0, length) + '...';35 }36 });37 Vue.filter('stringtime', function (time) {38 var stringTime = "";39 if (time != null) {40 stringTime = moment(time).format("DD") + '-' + moment(time).format("MM") + '-' + soyut.radiogram.yearNumToSimStr(moment(time).format("YYYY")) + ' ' + moment(time).format("hh") + ':' + moment(time).format("mm");41 }42 else {43 stringTime = "-";44 }45 return stringTime;46 });47 Vue.filter('wstime', function (sendTime, createTime, status) {48 var stringTime = '';49 if(status == 'draft' || status == 'trash'){50 stringTime = 'dibuat ' + moment(createTime).format("DD-MM-YYYY h:mm");51 }52 else {53 stringTime = 'ws ' + moment(sendTime).format("DD-MM-YYYY h:mm");54 }55 return stringTime;56 });57 Vue.filter('watime', function (simTime, status) {58 var stringTime = '';59 if(simTime != null) {60 var getRealTime = moment(simTime).format("DD") + '-' + moment(simTime).format("MM") + '-' + soyut.radiogram.yearNumToSimStr(moment(simTime).format("YYYY")) + ' ' + moment(simTime).format("hh") + ':' + moment(simTime).format("mm");61 if (status != 'draft' || status != 'trash') {62 stringTime = 'wa ' + getRealTime;63 }64 return stringTime;65 }66 });67 Vue.filter('stringuppercase', function (value) {68 var stringTime = value.toUpperCase();69 return stringTime;70 });71 $(getInstanceID("Number")).keydown(function(event) {72 if (event.keyCode == 32) {73 event.preventDefault();74 }75 });76 $(getInstanceID("Number")).blur(function(event) {77 var textNumber = $(getInstanceID("Number")).val();78 var reNumber = textNumber.replace(/\s/g, '');79 $(getInstanceID("Number")).val(reNumber);80 });81 soyut.radiogram.rigClearInput = function() {82 $(getInstanceID("editId")).val('');83 $(getInstanceID("panggilan")).val('');84 $(getInstanceID("jenis")).val('');85 $(getInstanceID("nomor")).val('');86 $(getInstanceID("instruksi")).val('');87 $(getInstanceID("senderid")).val('');88 $(getInstanceID("sender")).val('');89 $(getInstanceID("receiversid")).val('');90 $(getInstanceID("receivers")).val('');91 $(".optCC").val('');92 $(getInstanceID("tandadinas")).val('');93 $(getInstanceID("group")).val('');94 $(getInstanceID("title")).val('');95 $(getInstanceID("Number")).val('');96 $(getInstanceID("message-input")).val('');97 $(getInstanceID("sender-name")).val('');98 $(getInstanceID("sender-pangkat")).val('');99 $(getInstanceID("sender-signature")).val('');100 $(getInstanceID("alamataksi")).val('');101 $(getInstanceID("alamattembusan")).val('');102 $(getInstanceID("cara")).val('');103 $(getInstanceID("paraf")).val('');104 $(getInstanceID("jam")).val('');105 $(getInstanceID("tanggal")).val('');106 };107 soyut.radiogram.rigRenderContent = function () {108 if(getCurid == ""){109 soyut.radiogram.rigRenderCompose('','');110 }111 else{112 soyut.radiogram.rigEditMessage();113 }114 $(getInstanceID("btnSaveMessage")).click(function (event) {115 var editId = $(getInstanceID("editId")).val();116 var realtime = $(getInstanceID("realtime")).val();117 var panggilan = $(getInstanceID("panggilan")).val();118 var jenis = $(getInstanceID("jenis")).val();119 var nomor = $(getInstanceID("nomor")).val();120 var derajat = $(getInstanceID("derajat")).val();121 var instruksi = $(getInstanceID("instruksi")).val();122 var senderRole = $(".optSender").val();123 var receiverRole = $(".optReceiver").val();124 var tembusan = $(".optCC").val();125 var author = $(".optAuthor").val();126 var materi = $("input:checkbox[name=checkbox-materi]:checked");127 var approval = $("input:checkbox[name=checkbox-approval]:checked");128 var attachmentUrl = $('.attachment-url').val();129 var attachmentName = $('.attachment-name').val();130 var tandadinas = $(getInstanceID("tandadinas")).val();131 var group = $(getInstanceID("group")).val();132 var klasifikasi = $(getInstanceID("klasifikasi")).val();133 var no = $(getInstanceID("Number")).val();134 var message = $(getInstanceID("message-input")).val();135 var senderName = $(getInstanceID("sender-name")).val();136 var senderRank = $(getInstanceID("sender-pangkat")).val();137 var senderSignature = $(getInstanceID("signature")).val();138 var alamataksi = $(getInstanceID("alamataksi")).val();139 var alamattembusan = $(getInstanceID("alamattembusan")).val();140 var cara = $(getInstanceID("cara")).val();141 var paraf = $(getInstanceID("paraf")).val();142 var jam = $(getInstanceID("jam")).val();143 var tanggal = $(getInstanceID("tanggal")).val();144 var refauthor = $(getInstanceID("refauthor")).val();145 var error = "";146 if (senderRole == "" || senderRole == null) {147 $('.parent-sender').addClass('has-error');148 $('.sender-error').removeClass('valid');149 $('.sender-error').html('Harus diisi!');150 error += "receivers Error";151 }152 else {153 $('.parent-sender').removeClass('has-error');154 $('.parent-sender').addClass('has-success');155 $('.sender-error').addClass('valid');156 $('.sender-error').html('');157 error += "";158 }159 if (receiverRole == "" || receiverRole == null) {160 $('.parent-receivers').addClass('has-error');161 $('.receivers-error').removeClass('valid');162 $('.receivers-error').html('Harus diisi!');163 error += "receivers Error";164 }165 else {166 $('.parent-receivers').removeClass('has-error');167 $('.parent-receivers').addClass('has-success');168 $('.receivers-error').addClass('valid');169 $('.receivers-error').html('');170 error += "";171 }172 if (author == "" || author == null) {173 $('.parent-author').addClass('has-error');174 $('.author-error').removeClass('valid');175 $('.author-error').html('Harus diisi!');176 error += "author Error";177 }178 else {179 $('.parent-author').removeClass('has-error');180 $('.parent-author').addClass('has-success');181 $('.author-error').addClass('valid');182 $('.author-error').html('');183 error += "";184 }185 if(error != ""){186 return false;187 }188 else {189 var arrMateri = [];190 materi.each(function(){191 arrMateri.push($(this).val());192 });193 var arrApproval = [];194 approval.each(function(){195 arrApproval.push($(this).val());196 });197 var attachment = {198 "name": attachmentName,199 "url": attachmentUrl200 }201 var convertTime = soyut.radiogram.rigParseDate(realtime);202 var getRealDate = new Date(convertTime);203 var curInputDate = getRealDate.toISOString();204 if(editId == null || editId == "") {205 var vroleRcv = [];206 var roleRcv = [];207 var alsRcv = [];208 var vroleCc = [];209 var roleCc = [];210 var alsCc = [];211 if(receiverRole != null) {212 receiverRole.forEach(function (i) {213 var mi = i.split(":");214 if (mi[1] == "vrole") {215 vroleRcv.push(mi[0]);216 }217 else if (mi[1] == 'role') {218 roleRcv.push(mi[0]);219 }220 else {221 alsRcv.push(mi[0]);222 }223 });224 }225 if(tembusan != null) {226 tembusan.forEach(function (i) {227 var mi = i.split(":");228 if (mi[1] == "vrole") {229 vroleCc.push(mi[0]);230 }231 else if (mi[1] == 'role') {232 roleCc.push(mi[0]);233 }234 else {235 alsCc.push(mi[0]);236 }237 });238 }239 var objReceiver = [];240 var objTembusan = [];241 soyut.radiogram.renderSenderObj(senderRole, true, function (sender) {242 soyut.radiogram.renderListVRoleDetail(vroleRcv, function (vroleReceivers) {243 soyut.radiogram.renderListRoleDetail(roleRcv, function (roleReceivers) {244 soyut.radiogram.renderListAliasDetail(alsRcv, function (alsreceivers) {245 soyut.radiogram.renderListVRoleDetail(vroleCc, function (vroleTembusan) {246 soyut.radiogram.renderListRoleDetail(roleCc, function (roleTembusan) {247 soyut.radiogram.renderListAliasDetail(alsCc, function (alsTembusan) {248 soyut.radiogram.renderListKolatReceiver(function (owner) {249 objReceiver = vroleReceivers.concat(roleReceivers, alsreceivers);250 objTembusan = vroleTembusan.concat(roleTembusan, alsTembusan);251 var arrAliasRcv = [];252 alsreceivers.forEach(function (i) {253 arrAliasRcv = arrAliasRcv + i.position + ", ";254 });255 var arrVroleRcv = [];256 vroleReceivers.forEach(function (i) {257 arrVroleRcv = arrVroleRcv + i.position + ", ";258 });259 var arrRoleRcv = [];260 roleReceivers.forEach(function (i) {261 arrRoleRcv = arrRoleRcv + i.position + ", ";262 });263 var arrAliasCc = [];264 alsTembusan.forEach(function (i) {265 arrAliasCc = arrAliasCc + i.position + ", ";266 });267 var arrVroleCc = [];268 vroleTembusan.forEach(function (i) {269 arrVroleCc = arrVroleCc + i.position + ", ";270 });271 var arrRoleCc = [];272 roleTembusan.forEach(function (i) {273 arrRoleCc = arrRoleCc + i.position + ", ";274 });275 var curReceiver = arrAliasRcv + arrRoleRcv + arrVroleRcv;276 var curCc = arrAliasCc + arrRoleCc + arrVroleCc;277 278 $(getInstanceID("btnSaveMessage")).css('display', 'none');279 soyut.radiogram.DraftRIG({280 panggilan: panggilan,281 jenis: jenis,282 nomor: nomor,283 derajat: derajat,284 instruksi: instruksi,285 tandadinas: tandadinas,286 group: group,287 classification: klasifikasi,288 materi: arrMateri,289 approved: arrApproval,290 Number: no,291 cara: cara,292 paraf: paraf,293 alamataksi: alamataksi,294 alamattembusan: alamattembusan,295 content: message,296 readStatus: 'unread',297 owner: owner,298 sender: sender,299 senderDetail: sender.position,300 receivers: objReceiver,301 receiverDetail: curReceiver,302 cc: objTembusan,303 ccDetail: curCc,304 senderName: senderName,305 senderRank: senderRank,306 author: author,307 scenario: getScenario,308 createTime: curInputDate,309 attachment: attachment,310 referenceId: ""311 }, function (res) {312 soyut.radiogram.rigClearInput();313 soyut.radiogram.CreateLogs({314 radiogram: no,315 actions: 'create',316 user: roleName.position + " - " + roleName.roleGroupName,317 scenario: getScenario318 }, function(reslog){319 console.log(reslog)320 });321 soyut.rig.renderRigRadiogramParent(res, function (resvalid) {322 console.log("resvalid ", resvalid);323 var mainStatus = '';324 if(resvalid.length <= 0){325 mainStatus = 'invalid';326 }327 else {328 mainStatus = 'valid';329 }330 331 soyut.rig.Rig_CreateList({332 rig: getId,333 scenario: getScenario,334 type: 'RIL',335 status: 'draft',336 title: no,337 radiogram: res,338 message: mainStatus,339 action: '',340 description: '',341 SendTime: curInputDate,342 simtime: curInputDate343 }, function (err, reslist) {344 console.log("ril list created!");345 346 $(getInstanceID("btnSaveMessage")).css('display', '');347 var activity = getActivityInstance();348 activity.context.invoke('listril_selected', getId);349 activity.window.close();350 });351 });352 });353 });354 });355 });356 });357 });358 });359 });360 });361 }362 else {363 var vroleRcv = [];364 var roleRcv = [];365 var alsRcv = [];366 var vroleCc = [];367 var roleCc = [];368 var alsCc = [];369 if(receiverRole != null) {370 receiverRole.forEach(function (i) {371 var mi = i.split(":");372 if (mi[1] == "vrole") {373 vroleRcv.push(mi[0]);374 }375 else if (mi[1] == 'role') {376 roleRcv.push(mi[0]);377 }378 else {379 alsRcv.push(mi[0]);380 }381 });382 }383 if(tembusan != null) {384 tembusan.forEach(function (i) {385 var mi = i.split(":");386 if (mi[1] == "vrole") {387 vroleCc.push(mi[0]);388 }389 else if (mi[1] == 'role') {390 roleCc.push(mi[0]);391 }392 else {393 alsCc.push(mi[0]);394 }395 });396 }397 var objReceiver = [];398 var objTembusan = [];399 soyut.radiogram.renderRadiogramDetail(editId, function(res){400 soyut.radiogram.renderSenderObj(senderRole, true, function (sender) {401 soyut.radiogram.renderListVRoleDetail(vroleRcv, function (vroleReceivers) {402 soyut.radiogram.renderListRoleDetail(roleRcv, function (roleReceivers) {403 soyut.radiogram.renderListAliasDetail(alsRcv, function (alsreceivers) {404 soyut.radiogram.renderListVRoleDetail(vroleCc, function (vroleTembusan) {405 soyut.radiogram.renderListRoleDetail(roleCc, function (roleTembusan) {406 soyut.radiogram.renderListAliasDetail(alsCc, function (alsTembusan) {407 soyut.radiogram.renderListKolatReceiver(function (owner) {408 objReceiver = vroleReceivers.concat(roleReceivers, alsreceivers);409 objTembusan = vroleTembusan.concat(roleTembusan, alsTembusan);410 var arrAliasRcv = [];411 alsreceivers.forEach(function (i) {412 arrAliasRcv = arrAliasRcv + i.position + ", ";413 });414 var arrVroleRcv = [];415 vroleReceivers.forEach(function (i) {416 arrVroleRcv = arrVroleRcv + i.position + ", ";417 });418 var arrRoleRcv = [];419 roleReceivers.forEach(function (i) {420 arrRoleRcv = arrRoleRcv + i.position + ", ";421 });422 var arrAliasCc = [];423 alsTembusan.forEach(function (i) {424 arrAliasCc = arrAliasCc + i.position + ", ";425 });426 var arrVroleCc = [];427 vroleTembusan.forEach(function (i) {428 arrVroleCc = arrVroleCc + i.position + ", ";429 });430 var arrRoleCc = [];431 roleTembusan.forEach(function (i) {432 arrRoleCc = arrRoleCc + i.position + ", ";433 });434 var curReceiver = arrAliasRcv + arrRoleRcv + arrVroleRcv;435 var curCc = arrAliasCc + arrRoleCc + arrVroleCc;436 437 $(getInstanceID("btnSaveMessage")).css('display', 'none');438 soyut.radiogram.UpdateDraftRIG({439 id: res.id,440 panggilan: panggilan,441 jenis: jenis,442 nomor: nomor,443 derajat: derajat,444 instruksi: instruksi,445 tandadinas: tandadinas,446 group: group,447 classification: klasifikasi,448 materi: arrMateri,449 approved: arrApproval,450 Number: no,451 cara: cara,452 paraf: paraf,453 alamataksi: alamataksi,454 alamattembusan: alamattembusan,455 content: message,456 sender: sender,457 senderDetail: sender.position,458 receivers: objReceiver,459 receiverDetail: curReceiver,460 cc: objTembusan,461 ccDetail: curCc,462 senderName: senderName,463 senderRank: senderRank,464 author: author,465 scenario: getScenario,466 createTime: curInputDate,467 attachment: attachment,468 referenceId: ""469 },function(resdraft){470 soyut.radiogram.rigClearInput();471 var data = {472 id: getId,473 radiogram: res.id,474 radiogramno: no,475 radiogramcontent: message476 };477 soyut.radiogram.CreateLogs({478 radiogram: res.Number + " -> " + no,479 actions: 'edit',480 user: roleName.position + " - " + roleName.roleGroupName,481 scenario: getScenario482 }, function(reslog){483 console.log(reslog)484 });485 soyut.rig.renderRigRadiogramParent(res.id, function (resvalid) {486 console.log("resvalid ", resvalid);487 var mainStatus = '';488 if(resvalid.length <= 0){489 mainStatus = 'invalid';490 }491 else {492 mainStatus = 'valid';493 }494 soyut.rig.Rig_UpdateList({495 id: getCurid,496 rig: getId,497 scenario: getScenario,498 title: no,499 radiogram: res.id,500 message: mainStatus,501 action: '',502 description: '',503 SendTime: curInputDate,504 simtime: curInputDate505 }, function (err, res) {506 console.log("ril list created!");507 $(getInstanceID("btnSaveMessage")).css('display', '');508 509 var activity = getActivityInstance();510 activity.context.invoke('listril_selected', getId);511 activity.window.close();512 });513 });514 });515 });516 });517 });518 });519 });520 });521 });522 });523 });524 }525 }526 });527 };528 soyut.radiogram.rigRenderCompose = function (referenceId, refSender, refMateri) {529 soyut.radiogram.rigClearInput();530 $('.rdgdraft-main').css({"font-size": fontSize});531 $('textarea, select, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"]').css({"font-size": fontSize});532 $('.btn').css({"font-size": fontSize});533 $(getInstanceID("rdgdraft-email-form")).removeClass('disable');534 $(getInstanceID("rdgdraft-email-content")).addClass('disable');535 $(getInstanceID('nomor')).keypress(function(key) {536 if(key.charCode < 48 || key.charCode > 57) return false;537 });538 $(getInstanceID('tandadinas')).keypress(function(key) {539 if(key.charCode < 48 || key.charCode > 57) return false;540 });541 soyut.radiogram.rigRenderSenderWasdal('new', null);542 soyut.radiogram.rigRenderReceiverWasdal('new', null);543 soyut.radiogram.rigRenderCCWasdal('new', null);544 soyut.radiogram.rigRenderMateriWasdal('new', null);545 soyut.radiogram.rigRenderAuthorWasdal('new', null);546 soyut.radiogram.rigRenderSimtime('');547 $(getInstanceID("list-materi")).css('visibility', 'hidden');548 $(getInstanceID("list-materi")).css('height', '5px');549 soyut.radiogram.rigRenderAttachment('new', null);550 };551 soyut.radiogram.rigRenderAttachment = function (state, value) {552 $(getInstanceID("list-attachment")).html('');553 if(state == 'new'){554 var html = '<h3>ATTACHMENT :</h3>' +555 '<label class="attachment-label" style="display:none;"></label>' +556 '<input type="hidden" name="attachment-url" id="attachment-url" class="attachment-url" value="">' +557 '<input type="hidden" name="attachment-name" id="attachment-name" class="attachment-name" value="">' +558 '<a href="#" class="btn btn-success btn-attachment" onclick="soyut.radiogram.rigBrowseAttachment()"><i class="icon-plus"></i> Pilih File</a>';559 $(getInstanceID("list-attachment")).append(html);560 }561 else {562 var html = '<h3>ATTACHMENT :</h3>' +563 '<label class="attachment-label" style="display:none;"></label>' +564 '<input type="hidden" name="attachment-url" id="attachment-url" class="attachment-url" value="">' +565 '<input type="hidden" name="attachment-name" id="attachment-name" class="attachment-name" value="">' +566 '<a href="#" class="btn btn-success btn-attachment" onclick="soyut.radiogram.rigBrowseAttachment()"><i class="icon-plus"></i> Pilih File</a>';567 $(getInstanceID("list-attachment")).append(html);568 }569 }570 soyut.radiogram.rigBrowseAttachment = function(){571 var app = getAppInstance();572 var activitylistener = getActivityInstanceAsync();573 activitylistener.then(function (activity) {574 app.launchExternalActivity("soyut.module.browser.selector", {p1: '', p2: ''}, app, function (instance) {575 // console.log(activity)576 });577 });578 app.on('loadfile_selected', function (data) {579 var url = $(".attachment-url").val(data.files.url);580 $(".attachment-name").val(data.files.name);581 var html = "";582 if(url != ""){583 html += data.files.name +' <a href="#" class="btn btn-sm btn-danger" onclick="soyut.radiogram.rigRemoveAttachment()"><i class="icon-delete121"></i></a>';584 $('.attachment-label').html(html);585 $('.attachment-label').css('display', '');586 $('.btn-attachment').css('display', 'none');587 }588 });589 }590 soyut.radiogram.rigRemoveAttachment = function(){591 $(".attachment-url").val('');592 $(".attachment-name").val('');593 $('.attachment-label').html('');594 $('.attachment-label').css('display', 'none');595 $('.btn-attachment').css('display', '');596 }597 soyut.radiogram.rigEditMessage = function(){598 soyut.radiogram.rigClearInput();599 $(getInstanceID("rdgdraft-email-form")).removeClass('disable');600 $(getInstanceID("rdgdraft-email-content")).addClass('disable');601 $(getInstanceID('nomor')).keypress(function(key) {602 if(key.charCode < 48 || key.charCode > 57) return false;603 });604 $(getInstanceID('tandadinas')).keypress(function(key) {605 if(key.charCode < 48 || key.charCode > 57) return false;606 });607 soyut.rig.renderRigList(getCurid, function(result){608 soyut.radiogram.renderRadiogramDetail(result.radiogram, function(res) {609 soyut.radiogram.rigRenderMateriWasdal('edit', res.materi);610 soyut.radiogram.rigRenderSenderWasdal('edit', res.sender);611 soyut.radiogram.rigRenderReceiverWasdal('edit', res.receivers);612 soyut.radiogram.rigRenderCCWasdal('edit', res.cc);613 soyut.radiogram.rigRenderApproval('edit', res.approved);614 soyut.radiogram.rigRenderAuthorWasdal('edit', res.author);615 soyut.radiogram.rigRenderSimtime(result.SendTime);616 $(getInstanceID("list-approval")).css('visibility', 'hidden');617 $(getInstanceID("list-approval")).css('height', '5px');618 $(getInstanceID("list-materi")).css('visibility', 'hidden');619 $(getInstanceID("list-materi")).css('height', '5px');620 $(getInstanceID("editId")).val(res.id);621 $(getInstanceID("refauthor")).val(res.author);622 $(getInstanceID("panggilan")).val(res.panggilan);623 $(getInstanceID("jenis")).val(res.jenis);624 $(getInstanceID("nomor")).val(res.nomor);625 $(getInstanceID("derajat")).val(res.derajat);626 $(getInstanceID("instruksi")).val(res.instruksi);627 $(getInstanceID("tandadinas")).val(res.tandadinas);628 $(getInstanceID("group")).val(res.group);629 $(getInstanceID("klasifikasi")).val(res.classification);630 $(getInstanceID("Number")).val(res.Number);631 $(getInstanceID("message-input")).val(res.content);632 $(getInstanceID('sender-name')).val(res.senderName);633 $(getInstanceID('sender-pangkat')).val(res.senderRank);634 $(getInstanceID("alamataksi")).val(res.alamataksi);635 $(getInstanceID("alamattembusan")).val(res.alamattembusan);636 $(getInstanceID("cara")).val(res.cara);637 $(getInstanceID("paraf")).val(res.paraf);638 $(getInstanceID("jam")).val();639 $(getInstanceID("tanggal")).val();640 });641 });642 };643 Vue.component('email-reader', {644 props: ['contents', 'messages', 'attributes'],645 template: '#email-reader',646 methods: {647 moment: function (date) {648 return moment(date);649 },650 SubmitMessage: function(){651 this.$root.SubmitMessage(this.contents);652 },653 EditMessage: function(){654 this.$root.EditMessage(this.contents);655 },656 PrintPaper: function () {657 this.$root.PrintPaper(this.contents);658 },659 PrintPdf: function () {660 this.$root.PrintPdf(this.contents);661 },662 SavePdf: function(){663 this.$root.SavePdf(this.contents);664 },665 loadMoveButton: function(val){666 if(val == 'trash'){667 var attr;668 attr = {669 'style': 'display:none'670 };671 return attr;672 }673 },674 MoveMessage: function(){675 this.$root.MoveMessage(this.contents);676 },677 loadDeleteButton: function(val){678 if(val != 'trash'){679 var attr;680 attr = {681 'style': 'display:none'682 };683 return attr;684 }685 },686 DeleteMessage: function(){687 this.$root.DeleteMessage(this.contents);688 },689 loadPrintButton: function(val){690 if(val == 'trash'){691 var attr;692 attr = {693 'style': 'display:none'694 };695 return attr;696 }697 },698 loadPDFButton: function(val){699 if(val == 'trash'){700 var attr;701 attr = {702 'style': 'display:none'703 };704 return attr;705 }706 },707 loadChangeButton: function(val){708 if(val == 'sent' || val == 'inbox' || val == 'trash' ){709 var attr;710 attr = {711 'style': 'display:none'712 };713 return attr;714 }715 },716 loadSentButton: function(val){717 if(val == 'trash'){718 var attr;719 attr = {720 'style': 'display:none'721 };722 return attr;723 }724 }725 }726 });727 soyut.radiogram.rigRenderMessageDetail = function (elSelector, message, state) {728 var vm;729 var $el = $(elSelector);730 $el.html('');731 $el.append('<email-reader :contents="contents" :messages="messages" :attributes="attributes"></email-reader>');732 soyut.radiogram.renderMessageObj(message, function(data){733 var textArray = data.content.split('\n');734 var renderMessage = "";735 for (var i = 0; i < textArray.length; i++) {736 renderMessage += textArray[i] + "<br />";737 }738 var arrMateri = '';739 if(data.materi != null ) {740 data.materi.forEach(function (i) {741 arrMateri = arrMateri + i.toUpperCase() + ", ";742 });743 }744 else {745 arrMateri = '';746 }747 var arrApproved = '';748 if(data.approved != null ) {749 data.approved.forEach(function (i) {750 arrApproved = arrApproved + i.toUpperCase() + ", ";751 });752 }753 else {754 arrApproved = '';755 }756 var attributes = '';757 attributes +=758 '<div class="col-md-8">' +759 '<div class="form-group"><p class="text-bold">DIPOSISI KE AS/PA :</p> ' + arrMateri + ' </div>' +760 '</div>' +761 '<div class="col-md-4">' +762 '<div class="form-group pull-right"><p class="text-bold">Author</p> ' + data.author + '</div>' +763 '</div>';764 vm = new Vue({765 el: elSelector,766 data: {767 contents: data,768 messages: renderMessage,769 attributes: attributes770 },771 methods: {772 MoveMessage: function(content){773 var r = confirm("Anda Yakin?");774 if (r == true) {775 console.log('radiogram Warning, delete radiogram');776 soyut.radiogram.Radiogram_UpdateToTrash({id: content.id}, function (err, data) {777 if(!err){778 switch(state){779 case 'draft':780 $(getInstanceID("rdgdraft-navigation-menu")).children().removeClass("active");781 $(getInstanceID("rdgdraft-navigation-menu")).children().removeClass("open");782 soyut.radiogram.rigRenderDraft();783 break;784 }785 }786 });787 }788 },789 DeleteMessage: function(content){790 var r = confirm("Anda Yakin?");791 if (r == true) {792 console.log('radiogram Warning, delete radiogram');793 soyut.radiogram.deleteRadiogram(content.id, function (result) {794 soyut.radiogram.deleteChildRadiogram(content.id, function (res) {795 soyut.radiogram.rigRenderTrash();796 });797 });798 }799 },800 EditMessage: function(content){801 $(getInstanceID("rdgdraft-navigation-menu")).children().removeClass("active");802 $(getInstanceID("rdgdraft-navigation-menu")).children().removeClass("open");803 soyut.radiogram.rigEditMessage(content.id);804 },805 PrintPdf: function (content) {806 soyut.radiogram.rigPrintPDF(content.id);807 },808 SavePdf: function (content) {809 soyut.radiogram.rigSavePdf(content.id);810 },811 SubmitMessage: function(content){812 var data = {813 id: getId,814 radiogram: content.id,815 radiogramno: content.no,816 radiogramcontent: content.content,817 session: content.session818 };819 var activity = getActivityInstance();820 activity.context.invoke('loadradiogram_selected', data);821 activity.window.close();822 }823 }824 });825 });826 };827 soyut.radiogram.rigSavePdf = function(val){828 soyut.radiogram.RenderPrinterPDF(val, function(res){829 soyut.radiogram.rigSaveFilePDF(res, function (err, result) {830 soyut.radiogram.rigShow_PdfViewer(result);831 });832 });833 };834 soyut.radiogram.rigSaveFilePDF = function(val, rescallback) {835 var dataurl = "https://"+soyut.radiogram.origin+"/data/"+val;836 var curUrl = soyut.radiogram.origin.split(':');837 var storageServer = 'pivot.filesystem.soyut';838 function getFile(url, callback) {839 var xhr = new XMLHttpRequest();840 xhr.open('GET', url, true);841 xhr.responseType = 'blob';842 xhr.onload = function(e) {843 if (this.status == 200) {844 // get binary data as a response845 callback(false, this.response);846 }847 };848 xhr.onerror = function (e) {849 callback(true, e);850 };851 xhr.send();852 }853 function saveFileToSystem(targetFolder){854 soyut.storage.getStorageKeyAsync({userId: fileSystem.userid}).then(function(storageKey) {855 var storagePath = targetFolder + "/" +val;856 var fileUrl = 'https://'+ storageServer +':5454/storage/' + storageKey + storagePath;857 function getPosition(str, m, i) { return str.split(m, i).join(m).length; }858 var safeUrl = dataurl.substring(0, 8) + storageServer + dataurl.substring(getPosition(dataurl, ':', 2));859 // debugger;860 getFile(safeUrl, function(err, dataBuffer) {861 if (err) return;862 soyut.storage.putAsync({863 storageKey: storageKey,864 path: storagePath,865 dataBuffer: dataBuffer866 }).then(function() {867 console.log("File PDF telah berhasil di simpan ke file browser!");868 rescallback(false, fileUrl);869 });870 });871 });872 }873 soyut.clock.getCurrentActualTime({}, function(err, reclock){874 var strFolder = "RDG-" + moment(reclock).format('DD-MM-YYYY');875 var tgtDir = "/" + strFolder;876 fileSystem.ls(tgtDir, function (err, files) {877 if(files.length == 0){878 fileSystem.mkdir(tgtDir, function(err, res) {879 saveFileToSystem(tgtDir);880 });881 }882 else{883 saveFileToSystem(tgtDir);884 }885 });886 });887 };888 soyut.radiogram.rigselectProvider = function (val) {889 console.log("provider selected "+val);890 if(val != undefined){891 soyut.printserver.listProviders(function(res){892 var provider = res.providers[val];893 console.log("pro "+ provider);894 var html = 'Printer: <select id="printer-name" name="printer-name" class="printer-name form-control">';895 provider.printers.forEach(function(i){896 console.log(i);897 html += '<option value="'+ i +'">'+ i +'</option>';898 });899 html += '</select>';900 $(getInstanceID('lp-printer')).html(html);901 });902 }903 };904 soyut.radiogram.rigPrintPDF = function(val){905 $(getInstanceID('printerAlertModal')).modal();906 $(getInstanceID('printerAlertModal')).appendTo(".wdl-main");907 $('.modal-backdrop').css("z-index", "-1");908 soyut.radiogram.renderProviderPrinter(roleName.roleGroup, function (print) {909 var html = 'Provider: <select id="provider-name" name="provider-name" class="provider-name form-control" onchange="soyut.radiogram.selectProvider(this.value)">';910 print.forEach(function (i) {911 html += '<option value="'+ i.name +'">'+ i.name +'</option>';912 });913 html += '</select>';914 $(getInstanceID('lp-provider')).html(html);915 soyut.radiogram.rigselectProvider($('.provider-name').val());916 });917 $(getInstanceID("btn-print-radiogram")).click(function (event) {918 soyut.radiogram.RenderPrinterPDF(val, function (res) {919 soyut.radiogram.rigSaveFilePDF(res, function (err, result) {920 var providerName = $('.provider-name').val();921 var printerName = $('.printer-name').val();922 console.log("print "+providerName+" - "+ printerName);923 soyut.printserver.print({924 docURL : result,925 origin : 'Radiogram',926 provider : providerName,927 printer : printerName928 }, function(print){929 console.log(print);930 $(getInstanceID('printerAlertModal')).modal('hide');931 })932 });933 });934 });935 };936 soyut.radiogram.rigShow_PdfViewer = function(val) {937 var app = getAppInstance();938 app.launchActivity("soyut.module.app.radiogram.pdfviewer", {file: val});939 };940 soyut.radiogram.rigRenderSimtime = function(val){941 if(val == ""){942 soyut.clock.getCurrentActualTime({}, function (err, reclock) {943 console.log(reclock)944 var getTime = new Date(reclock);945 var real = moment(getTime).format('DD/MM/YYYY HH:mm');946 $(getInstanceID('realtime')).datetimepicker({947 format: 'DD/MM/YYYY HH:mm'948 });949 $(getInstanceID('realtime')).val(real);950 });951 }952 else{953 var getTime = new Date(val);954 var real = moment(getTime).format('DD/MM/YYYY HH:mm');955 $(getInstanceID('realtime')).datetimepicker({956 format: 'DD/MM/YYYY HH:mm'957 });958 $(getInstanceID('realtime')).val(real);959 }960 };961 soyut.radiogram.rigRenderSelectedMateri = function () {962 var selmateri = $("input:checkbox[name=select-materi]:checked");963 var getMateri = [];964 selmateri.each(function () {965 getMateri.push($(this).val());966 });967 function containAll(arr1, arr2) {968 for (var i = 0; i < arr1.length; i++) {969 if (arr2.indexOf(arr1[i]) == -1) {970 return false;971 }972 return true;973 }974 }975 if(getMateri.length > 0 ) {976 $('ul.messages-list > li').each(function () {977 var mid = $(this).attr('data-id');978 if ($(this).css("display") != 'none') {979 var materi = $(this).attr('data-materi');980 if (materi != '') {981 var tempArray = [];982 var myarray = materi.split(',');983 for (var i = 0; i < myarray.length; i++) {984 tempArray.push(myarray[i]);985 }986 if (containAll(getMateri, tempArray)) {987 console.log('Do not hidden this array!')988 }989 else {990 $('.message-data-' + mid).css('display', 'none');991 }992 }993 else {994 $('.message-data-' + mid).css('display', 'none');995 }996 }997 else {998 $('.message-data-' + mid).css('display', 'none');999 }1000 });1001 }1002 };1003 soyut.radiogram.rigSetSenderDetail = function(val){1004 if(val != ""){1005 soyut.radiogram.renderSenderWasdalDetail(val, function (res) {1006 $(getInstanceID('sender-name')).val(res.data.callsign);1007 $(getInstanceID('sender-pangkat')).val(res.data.rank);1008 });1009 };1010 };1011 soyut.radiogram.rigRenderApproval = function (state, value) {1012 $(getInstanceID("list-approval")).html('');1013 var checked1 = '';1014 var checked2 = '';1015 value.forEach(function (i) {1016 if(i == 'panglima'){1017 checked1 = 'checked';1018 }1019 else {1020 checked2 = 'checked';1021 }1022 });1023 var html = '<h3>Di Setujui :</h3>';1024 html += '<label class="checkbox-inline"><input type="checkbox" name="checkbox-approval" value="panglima" '+ checked1 +'>PANGLIMA</label>';1025 $(getInstanceID("list-approval")).append(html);1026 };1027 soyut.radiogram.rigRenderMateriWasdal = function (state, value) {1028 $(getInstanceID("list-materi")).html('');1029 if(state == 'new'){1030 var html = '<h3>DIPOSISI KE AS/PA :</h3>' +1031 '<label class="checkbox-inline"><input type="checkbox" name="checkbox-materi" value="intelijen">INTELIJEN</label>' +1032 '<label class="checkbox-inline"><input type="checkbox" name="checkbox-materi" value="operasi">OPERASI</label>' +1033 '<label class="checkbox-inline"><input type="checkbox" name="checkbox-materi" value="personel">PERSONEL</label>' +1034 '<label class="checkbox-inline"><input type="checkbox" name="checkbox-materi" value="logistik">LOGISTIK</label>' +1035 '<label class="checkbox-inline"><input type="checkbox" name="checkbox-materi" value="komlek">KOMLEK</label>';1036 $(getInstanceID("list-materi")).append(html);1037 }1038 else {1039 var checked1 = '';1040 var checked2 = '';1041 var checked3 = '';1042 var checked4 = '';1043 var checked5 = '';1044 value.forEach(function (i) {1045 if(i == 'intelijen'){1046 checked1 = 'checked';1047 }1048 else if(i == 'operasi'){1049 checked2 = 'checked';1050 }1051 else if(i == 'personel'){1052 checked3 = 'checked';1053 }1054 else if(i == 'logistik'){1055 checked4 = 'checked';1056 }1057 else if(i == 'komlek'){1058 checked5 = 'checked';1059 }1060 });1061 var html = '<h3>DIPOSISI KE AS/PA :</h3>';1062 html += '<label class="checkbox-inline"><input type="checkbox" name="checkbox-materi" value="intelijen" '+ checked1 +'>INTELIJEN</label>';1063 html += '<label class="checkbox-inline"><input type="checkbox" name="checkbox-materi" value="operasi" '+ checked2 +'>OPERASI</label>';1064 html += '<label class="checkbox-inline"><input type="checkbox" name="checkbox-materi" value="personel" '+ checked3 +'>PERSONEL</label>';1065 html += '<label class="checkbox-inline"><input type="checkbox" name="checkbox-materi" value="logistik" '+ checked4 +'>LOGISTIK</label>';1066 html += '<label class="checkbox-inline"><input type="checkbox" name="checkbox-materi" value="komlek" '+ checked5 +'>KOMLEK</label>';1067 $(getInstanceID("list-materi")).append(html);1068 }1069 };1070 /*sender and receiver WASDAL */1071 soyut.radiogram.rigRenderAuthorWasdal = function (state, value) {1072 $(getInstanceID("list-author")).html('');1073 if(state == 'new'){1074 var html = '<select name="optAuthor" id="optAuthor" class="form-control optAuthor col-md-6" style="display:none">';1075 html += '<option value="">Cari..</option>';1076 listAuthor.forEach(function (i) {1077 if(i.isWASDAL && i.isSet){1078 html += '<option value="'+ i.position +'">'+ i.position +'</option>';1079 }1080 });1081 html +='</select>';1082 html +='<span class="author-error help-block valid"></span>';1083 $(getInstanceID("list-author")).append(html);1084 $(".optAuthor").select2({ width: '100%' });1085 }1086 else{1087 if(value != null){1088 var html = '<select name="optAuthor" id="optAuthor" class="form-control optAuthor col-md-6" style="display:none">';1089 html += '<option value="">Cari..</option>';1090 listAuthor.forEach(function (i) {1091 var selected = "";1092 if(value != null){1093 if(value == i.position){1094 selected = "selected";1095 }1096 }1097 if(i.isWASDAL && i.isSet){1098 html += '<option value="'+ i.position +'" '+selected+'>'+ i.position +'</option>';1099 }1100 });1101 html +='</select>';1102 html +='<span class="author-error help-block valid"></span>';1103 $(getInstanceID("list-author")).append(html);1104 $(".optAuthor").select2({ width: '100%' });1105 }1106 }1107 };1108 soyut.radiogram.rigRenderReceiverWasdal = function (state, value) {1109 $(getInstanceID("list-receiver")).html('');1110 if(state == 'new'){1111 var html = '<select name="optReceiver[]" multiple id="optReceiver" class="form-control optReceiver">';1112 listReceiverWasdal.forEach(function (i) {1113 html += '<option value="' + i.id + ':' + i.type + '">' + i.name + '</option>';1114 });1115 html += '</select>';1116 html += '<span class="receivers-error help-block valid"></span>';1117 $(getInstanceID("list-receiver")).append(html);1118 $('.optReceiver').multiselect({1119 columns: 1,1120 placeholder: 'Cari...',1121 search: true,1122 selectAll: false1123 });1124 }1125 else{1126 if(value != null){1127 var html = '<select name="optReceiver[]" multiple id="optReceiver" class="form-control optReceiver">';1128 listReceiverWasdal.forEach(function (i) {1129 var selected = "";1130 if (value != null) {1131 soyut.radiogram.checkReceivers(value, i.type, i.id, function (sel) {1132 if (sel) {1133 selected += "selected";1134 }1135 });1136 }1137 html += '<option value="' + i.id + ':' + i.type + '" ' + selected + '>' + i.name + '</option>';1138 });1139 html += '</select>';1140 html += '<span class="receivers-error help-block valid"></span>';1141 $(getInstanceID("list-receiver")).append(html);1142 $('.optReceiver').multiselect({1143 columns: 1,1144 placeholder: 'Cari...',1145 search: true,1146 selectAll: false1147 });1148 }1149 }1150 };1151 soyut.radiogram.rigRenderSenderWasdal = function (state, value) {1152 $(getInstanceID("list-sender")).html('');1153 if(state == 'new'){1154 var html = '<select name="optSender" id="optSender" class="form-control optSender" style="display:none" onchange="soyut.radiogram.rigSetSenderDetail(this.value)">';1155 html += '<option value="">Cari..</option>';1156 listSenderWasdal.forEach(function (i) {1157 html += '<option value="'+ i.id +'">'+ i.name +'</option>';1158 });1159 html +='</select>';1160 html +='<span class="sender-error help-block valid"></span>';1161 $(getInstanceID("list-sender")).append(html);1162 $(".optSender").select2({ width: '100%' });1163 }1164 else{1165 if(value != null){1166 var html = '<select name="optSender" id="optSender" class="form-control optSender" style="display:none" onchange="soyut.radiogram.rigSetSenderDetail(this.value)">';1167 html += '<option value="">Cari..</option>';1168 listSenderWasdal.forEach(function (i) {1169 var selected = "";1170 if(value != null){1171 if(value.id == i.id){1172 selected = "selected";1173 }1174 }1175 html += '<option value="'+ i.id +'" '+selected+'>'+ i.name +'</option>';1176 });1177 html +='</select>';1178 html +='<span class="sender-error help-block valid"></span>';1179 $(getInstanceID("list-sender")).append(html);1180 $(".optSender").select2({ width: '100%' });1181 }1182 }1183 };1184 soyut.radiogram.rigRenderCCWasdal = function (state, value) {1185 $(getInstanceID("list-tembusan")).html('');1186 if(state == 'new'){1187 var html = '<select name="optCC[]" multiple id="optCC" class="optCC">';1188 listReceiverWasdal.forEach(function (i) {1189 html += '<option value="' + i.id + ':' + i.type + '">' + i.name + '</option>';1190 });1191 html += '</select>';1192 $(getInstanceID("list-tembusan")).append(html);1193 $('.optCC').multiselect({1194 columns: 1,1195 placeholder: 'Cari...',1196 search: true,1197 selectAll: false1198 });1199 }1200 else{1201 if(value != null){1202 var html = '<select name="optCC[]" multiple id="optCC" class="form-control optCC">';1203 listReceiverWasdal.forEach(function (i) {1204 var selected = "";1205 if (value != null) {1206 soyut.radiogram.checkReceivers(value, i.type, i.id, function (sel) {1207 if (sel) {1208 selected += "selected";1209 }1210 });1211 }1212 html += '<option value="' + i.id + ':' + i.type + '" ' + selected + '>' + i.name + '</option>';1213 });1214 html += '</select>';1215 $(getInstanceID("list-tembusan")).append(html);1216 $('.optCC').multiselect({1217 columns: 1,1218 placeholder: 'Cari...',1219 search: true,1220 selectAll: false1221 });1222 }1223 }1224 };1225 soyut.radiogram.rigParseDate = function(value){1226 var m = value.split(" ");1227 var mDate = m[0].split("/");1228 var mTime = m[1].split(":");1229 var maindate = mDate[1]+"/"+mDate[0]+"/"+mDate[2]+" "+mTime[0]+":"+mTime[1];1230 return maindate;1231 };1232 soyut.radiogram.rigInit = function () {1233 soyut.radiogram.rigRenderContent();1234 $(".derajat").select2({ width: '100%' });1235 };1236 soyut.radiogram.rigInit();1237 });1238 });...

Full Screen

Full Screen

EnemyProv.js

Source:EnemyProv.js Github

copy

Full Screen

1//#pragma strict2//public var prov : ExtractProvenance = null;3//public var hp : Health;4//public var enemyType : String;5//function Awake()6//{7// // Load provenance pointers8// hp = GetComponent(Health);9 10// prov = GetComponent(ExtractProvenance); 11// if(prov == null) {12// prov = GetComponentInParent(ExtractProvenance); 13// }14// Prov_Enemy();15 16//}17////==========================================================18//// Configurable19////==========================================================20//// Enemy Attributes21//public function Prov_GetEnemyAttributes()22//{ 23// prov.AddAttribute("Health", hp.health.ToString());24//}25////==========================================================26//// Enemy27////==========================================================28//// <INTERFACE> Enemy Agent29//public function Prov_Enemy()30//{31// Prov_GetEnemyAttributes();32// prov.NewAgentVertex(enemyType);33// Prov_Idle();34//}35//// <INTERFACE> Enemy Idle action36//public function Prov_Idle()37//{38// Prov_GetEnemyAttributes();39// prov.NewActivityVertex("Idle", this.gameObject);40// prov.HasInfluence("Enemy");41//}42//// <INTERFACE> Enemy Spot action43//public function Prov_OnSpot()44//{45// Prov_GetEnemyAttributes();46// prov.NewActivityVertex("Spotted", this.gameObject);47// prov.GenerateInfluenceC("Player", this.GetInstanceID().ToString(), "Spotted", "1", 1);48// prov.HasInfluence("Enemy");49// return this.GetInstanceID().ToString();50//}51//// <INTERFACE> Enemy Lost Track action52//public function Prov_LostTrack()53//{54// Prov_GetEnemyAttributes();55// prov.NewActivityVertex("LostTrack", this.gameObject);56// prov.GenerateInfluenceC("Player", this.GetInstanceID().ToString(), "Spotted", "-1", 1);57// prov.HasInfluence("Enemy");58// return this.GetInstanceID().ToString();59//}60//// <INTERFACE> Enemy Attack action61//public function Prov_Attack(damageAmount : float)62//{63// Prov_GetEnemyAttributes();64// prov.NewActivityVertex("Attacking", this.gameObject);65// prov.HasInfluence("Enemy");66// prov.GenerateInfluenceCE("PlayerDamage", this.GetInstanceID().ToString(), "Health (Player)", (-damageAmount).ToString(), 1, Time.time + 5);67// return this.GetInstanceID().ToString();68//}69//// <INTERFACE> Enemy Regeneration action70//public function Prov_Regenerate(regValue : float)71//{72// prov.GenerateInfluenceC("Enemy", this.GetInstanceID().ToString(), "Health (Enemy)", regValue.ToString(), 1);73//}74//// <INTERFACE> Enemy Death action75//public function Prov_Death(scoreValue : float)76//{77// Prov_GetEnemyAttributes();78// prov.NewActivityVertex("Dead", this.gameObject);79// prov.HasInfluence("Enemy");80 81// if(scoreValue != 0)82// prov.GenerateInfluenceC("Player", this.GetInstanceID().ToString(), "Score", scoreValue.ToString(), 1);83//}84//// <INTERFACE> Enemy Death action85//public function Prov_Suicide()86//{87// Prov_GetEnemyAttributes();88// prov.NewActivityVertex("Suicided", this.gameObject);89// prov.HasInfluence("Enemy");90// prov.GenerateInfluenceC("Player", this.GetInstanceID().ToString(), "Score Missed", "0", 1);91//}92//// <INTERFACE> Enemy Escaped (the scene) action93//public function Prov_Escaped()94//{95// Prov_GetEnemyAttributes();96// prov.NewActivityVertex("Escaped", this.gameObject);97// prov.HasInfluence("Enemy");98// prov.GenerateInfluenceC("Player", this.GetInstanceID().ToString(), "Score Missed", "0", 1);99//}100//// <INTERFACE> Enemy took damage101//function Prov_TakeDamage(enemy : GameObject, damageAmount : float)102//{103// Prov_generateTakeDamage(damageAmount);104// Prov_Hurt(this.GetInstanceID().ToString());105//}106//// Influence from taking damage107//function Prov_generateTakeDamage(damageAmount : float)108//{109// var heroObj : GameObject = GameObject.FindGameObjectWithTag("Player");110// var player : PlayerProv = heroObj.GetComponent(PlayerProv);111// player.Prov_Attack();112// player.prov.GenerateInfluenceC("Enemy", "Enemy" + this.GetInstanceID().ToString(), "Health (Enemy)", (-damageAmount).ToString(), 1);113//}114//// Enemy took damage115//public function Prov_Hurt(infID : String)116//{117// Prov_GetEnemyAttributes();118// prov.NewActivityVertex("Taking Hit", this.gameObject);119// prov.HasInfluence_ID("Enemy" + infID);120//}...

Full Screen

Full Screen

BufferArrayProxy.js

Source:BufferArrayProxy.js Github

copy

Full Screen

1import { assert } from 'chai';2import BufferArrayProxy from 'osg/BufferArrayProxy';3import BufferArray from 'osg/BufferArray';4export default function() {5 test('BufferArrayProxy', function() {6 (function() {7 var bufferArrayA = new BufferArray();8 var bufferArrayB = new BufferArray();9 var bufferArrayProxyA = new BufferArrayProxy(bufferArrayA);10 var bufferArrayProxyB = new BufferArrayProxy(bufferArrayB);11 bufferArrayProxyA.setBufferArray(bufferArrayB);12 bufferArrayProxyB.setBufferArray(bufferArrayA);13 assert.equal(14 bufferArrayProxyA.getInstanceID(),15 bufferArrayB.getInstanceID(),16 'check proxyA use B'17 );18 assert.equal(19 bufferArrayProxyB.getInstanceID(),20 bufferArrayA.getInstanceID(),21 'check proxyB use A'22 );23 assert.equal(24 bufferArrayProxyA.getInitialBufferArray().getInstanceID(),25 bufferArrayA.getInstanceID(),26 'check initial buffer'27 );28 bufferArrayProxyA.setBufferArray(bufferArrayProxyB);29 assert.equal(30 bufferArrayProxyA.getInstanceID(),31 bufferArrayProxyB.getBufferArray().getInstanceID(),32 'check proxy with proxy'33 );34 })();35 });...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var bestpay = require('../index.js');2bestpay.getInstanceId(function(err, instanceId) {3 if (err) {4 console.log(err);5 } else {6 console.log(instanceId);7 }8});

Full Screen

Using AI Code Generation

copy

Full Screen

1var BestBuy = require("./BestBuy.js");2var bestBuy = new BestBuy();3bestBuy.getInstanceId();4var BestBuy = function() {5 var instanceId = 0;6 var getInstanceId = function() {7 return instanceId;8 };9 var setInstanceId = function(value) {10 instanceId = value;11 };12 return {13 };14};15module.exports = BestBuy;16var BestBuy = require("./BestBuy.js");17var bestBuy = new BestBuy();18bestBuy.getInstanceId();19var BestBuy = function() {20 var instanceId = 0;21 var getInstanceId = function() {22 return instanceId;23 };24 var setInstanceId = function(value) {25 instanceId = value;26 };27 return {28 };29};30module.exports = BestBuy;31var BestBuy = require("./BestBuy.js");32var bestBuy = new BestBuy();33bestBuy.getInstanceId();34var BestBuy = function() {35 var instanceId = 0;36 var getInstanceId = function() {37 return instanceId;38 };39 var setInstanceId = function(value) {40 instanceId = value;41 };42 return {43 };44};45module.exports = BestBuy;46var BestBuy = require("./BestBuy.js");47var bestBuy = new BestBuy();48bestBuy.getInstanceId();49var BestBuy = function() {50 var instanceId = 0;51 var getInstanceId = function() {52 return instanceId;53 };54 var setInstanceId = function(value) {55 instanceId = value;56 };57 return {58 };59};

Full Screen

Using AI Code Generation

copy

Full Screen

1const BestBuy = require('./bestbuy');2const bestBuy = new BestBuy();3bestBuy.getInstanceId();4const BestBuy = require('./bestbuy');5const bestBuy = new BestBuy();6bestBuy.getInstanceId();7const BestBuy = require('./bestbuy');8const bestBuy = new BestBuy();9bestBuy.getInstanceId();10const BestBuy = require('./bestbuy');11const bestBuy = new BestBuy();12bestBuy.getInstanceId();13const BestBuy = require('./bestbuy');14const bestBuy = new BestBuy();15bestBuy.getInstanceId();16const BestBuy = require('./bestbuy');17const bestBuy = new BestBuy();18bestBuy.getInstanceId();19const BestBuy = require('./bestbuy');20const bestBuy = new BestBuy();21bestBuy.getInstanceId();

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Best automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful