Forums
5
Product Forums
25
General Purpose MicrocontrollersGeneral Purpose Microcontrollers
i.MX Forumsi.MX Forums
QorIQ Processing PlatformsQorIQ Processing Platforms
Identification and SecurityIdentification and Security
Power ManagementPower Management
Wireless ConnectivityWireless Connectivity
RFID / NFCRFID / NFC
Advanced AnalogAdvanced Analog
MCX Microcontrollers
S32G
S32K
S32V
MPC5xxx
Other NXP Products
S12 / MagniV Microcontrollers
Powertrain and Electrification Analog Drivers
Sensors
Vybrid Processors
Digital Signal Controllers
8-bit Microcontrollers
ColdFire/68K Microcontrollers and Processors
PowerQUICC Processors
OSBDM and TBDML
S32M
S32Z/E
Solution Forums
4
Smart Home
Power & Energy
Mobile Robotics
Motor Control
Software Forums
16
MCUXpresso Software and ToolsMCUXpresso Software and Tools
CodeWarriorCodeWarrior
MQX Software SolutionsMQX Software Solutions
Model-Based Design Toolbox (MBDT)Model-Based Design Toolbox (MBDT)
FreeMASTER
eIQ Machine Learning Software
Embedded Software and Tools Clinic
S32 SDK
S32 Design Studio
GUI Guider
Zephyr Project
Voice Technology
Application Software Packs
Secure Provisioning SDK (SPSDK)
Processor Expert Software
Generative AI & LLMs
Topics
8
Mobile Robotics - Drones and RoversMobile Robotics - Drones and Rovers
NXP Training ContentNXP Training Content
University ProgramsUniversity Programs
Rapid IoT
NXP Designs
SafeAssure-Community
OSS Security & Maintenance
Using Our Community
Cloud Lab Forums
2
Hardware
Cloud Lab Knowledge Base
Knowledge Bases
21
ARM Microcontrollers
7
K32 L Series Microcontrollers Knowledge Base
Kinetis Microcontrollers Knowledge Base
Kinetis Motor Suite Knowledge Base
LPC FAQs Knowledge Base
LPC Microcontrollers Knowledge Base
LPCware Archive Content
MCX Microcontrollers Knowledge Base
i.MX Processors
5
i.MX RT Crossover MCUs Knowledge Base
i.MX Graphics Knowledge Base
i.MX Processors Knowledge Base
i.MX Solutions Knowledge Base
i.MX 한국어 커뮤니티 Knowledge Base
Identification and Security
3
EdgeLock 2GO Secure Service Knowledge Base
Secure Authentication Knowledge Base
Smart Cards and Secure Element Knowledge Base
Model-Based Design Toolbox (MBDT)
0
QorIQ Processing Platforms
0
S32 Automotive Processing Platform
0
Wireless Connectivity
3
Other Connectivity Knowledge Base
Wi-Fi® + Bluetooth® + 802.15.4 Knowledge Base
Wireless Connectivity Knowledge Base
CodeWarrior
0
MCUXpresso Suite of Software and Tools
0
MQX Software Solutions
0
RFID / NFC
0
Advanced Analog
2
High Performance Analog Front End Interfaces
In Vehicle Networking
8-bit Microcontrollers Knowledge Base
Motor Control and Smart Energy Knowledge Base
Power Management Knowledge Base
FRDM Training Hub
MCUXpresso Training Hub
Zephyr Project Knowledge Base
Generative AI & LLMs Knowledge Base
Embedded World NXP Connectivity Workshop Knowledge Base
Hands-on workshop in Japan (ハンズオン・ワークショップ [日本]) Knowledge Base
NXP Tech Blogs
1
NXP Tech Blog
Ideas
Blogs
フォーラム
ナレッジベース
アイデア
ブログ
NXP.COM
サインイン
ヘルプ
日本語
英语(美国) | English (US)
日本語 | Japanese
中文 | Chinese (Simplified)
Home
:
RFID / NFC
:
NFCナレッジベース
:
MIFARE DESFire Light read and write demonstration
MIFARE DESFire Light read and write demonstration
すべてのコミュニティ
このカテゴリ
この掲示板
ナレッジベース
ユーザー
製品
キャンセル
提案をオンにする
自動提案では、入力時に可能な一致が提案されるので検索結果を素早く絞り込むことができます。
次の結果を表示
表示
限定
|
次の代わりに検索
もしかして:
オプション
RSS フィードを購読する
新着としてマーク
既読としてマーク
ブックマーク
購読
印刷用ページ
不適切なコンテンツを報告
MIFARE DESFire Light read and write demonstration
MIFARE DESFire Light read and write demonstration
MIFARE DESFire Light read and write demonstration
(マイビデオを表示)
タグ
(1)
mifare desfire light
%3CLINGO-SUB%20id%3D%22lingo-sub-1130408%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EMIFARE%20DESFire%20Light%E3%81%AE%E8%AA%AD%E3%81%BF%E5%8F%96%E3%82%8A%E3%81%A8%E6%9B%B8%E3%81%8D%E8%BE%BC%E3%81%BF%E3%81%AE%E3%83%87%E3%83%A2%E3%83%B3%E3%82%B9%E3%83%88%E3%83%AC%E3%83%BC%E3%82%B7%E3%83%A7%E3%83%B3%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1130408%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%26lt%3Bmeta%20http-equiv%3D%22Content-Type%22%20content%3D%22text%2Fhtml%3B%20charset%3Dutf-8%22%20%2F%26gt%3B%0A%3CP%3E%3CA%20_jive_internal%3D%22true%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fdocs%2FDOC-345275%22%20target%3D%22_blank%22%3EMIFARE%20DESFire%20Light%E3%81%AE%E8%AA%AD%E3%81%BF%E5%8F%96%E3%82%8A%E3%81%A8%E6%9B%B8%E3%81%8D%E8%BE%BC%E3%81%BF%E3%81%AE%E3%83%87%E3%83%A2%E3%83%B3%E3%82%B9%E3%83%88%E3%83%AC%E3%83%BC%E3%82%B7%E3%83%A7%E3%83%B3%3C%2FA%3E%3C%2FP%3E%3CDIV%20class%3D%22lia-vid-container%20video-embed-center%22%3E%3CDIV%20id%3D%22lia-vid-6185796061001w320h240r691%22%20class%3D%22lia-video-brightcove-player-container%22%3E%3CVIDEO-JS%20data-video-id%3D%226185796061001%22%20data-account%3D%226153537070001%22%20data-player%3D%22default%22%20data-embed%3D%22default%22%20class%3D%22vjs-fluid%22%20controls%3D%22%22%20data-application-id%3D%22%22%20style%3D%22width%3A%20100%25%3B%20height%3A%20100%25%3B%22%3E%3C%2FVIDEO-JS%3E%3C%2FDIV%3E%3CSCRIPT%20src%3D%22https%3A%2F%2Fplayers.brightcove.net%2F6153537070001%2Fdefault_default%2Findex.min.js%22%3E%3C%2FSCRIPT%3E%3CA%20class%3D%22video-embed-link%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fvideo%2Fgallerypage%2Fvideo-id%2F6185796061001%22%20target%3D%22_blank%22%3E(%E3%83%9E%E3%82%A4%E3%83%93%E3%83%87%E3%82%AA%E3%81%A7%E8%A6%96%E8%81%B4)%3C%2FA%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E
評価なし
バージョン履歴
最終更新日:
12-19-2019
01:22 AM
更新者:
Kan_Li
' var data = div.getElementsByClassName("video-js"); var script = document.createElement('script'); script.src = "https://players.brightcove.net/" + data_account + "/" + data_palyer + "_default/index.min.js"; for(var i=0;i< data.length;i++){ videodata.push(data[i]); } } } for(var i=0;i< videodata.length;i++){ document.getElementsByClassName('lia-vid-container')[i].innerHTML = videodata[i].outerHTML; document.body.appendChild(script); } } catch(e){ } /* Re compile html */ $compile(rootElement.querySelectorAll('div.lia-message-body-content')[0])($scope); } if (code_l.toLowerCase() != newBody.getAttribute("slang").toLowerCase()) { /* Adding Translation flag */ var tr_obj = $filter('filter')($scope.sourceLangList, function (obj_l) { return obj_l.code.toLowerCase() === newBody.getAttribute("slang").toLowerCase() }); if (tr_obj.length > 0) { tr_text = "このコンテンツはlilicon-trans-textからAI支援ツールを使って翻訳されました。".replace(/lilicon-trans-text/g, tr_obj[0].title); tr_text +='
原文を見る
'; try { if ($scope.wootMessages[$rootScope.profLang] != undefined) { tr_text = $scope.wootMessages[$rootScope.profLang].replace(/lilicon-trans-text/g, tr_obj[0].title); tr_text +='
原文を見る
'; } } catch (e) { } } else { //tr_text = "This message was translated for your convenience!"; tr_text = "lilicon-trans.your.convenience"; } try { if (!document.getElementById("tr-msz-" + value)) { var tr_para = document.createElement("P"); tr_para.setAttribute("id", "tr-msz-" + value); tr_para.setAttribute("class", "tr-msz"); tr_para.style.textAlign = 'justify'; var tr_fTag = document.createElement("IMG"); tr_fTag.setAttribute("class", "tFlag"); tr_fTag.setAttribute("alt", "翻訳アイコン"); // tr_fTag.setAttribute("title", "翻訳アイコンの免責事項"); tr_fTag.setAttribute("src", "/html/assets/translate-icon.svg"); tr_para.appendChild(tr_fTag); var container = document.createElement('span'); container.innerHTML = tr_text; //var tr_textNode = document.createTextNode(container); tr_para.appendChild(container); /* Woot message only for multi source */ if(rootElement.querySelector(".lia-message-body-content").previousElementSibling != null && rootElement.querySelector(".lia-message-body-content").previousElementSibling.getAttributeNames().includes("data-generation-timestamp")){ rootElement.querySelector(".lia-message-body-content").previousElementSibling.remove() } if(rootElement.querySelector(".lia-quilt-forum-message")){ rootElement.querySelector(".lia-quilt-forum-message .lia-message-body").insertBefore(tr_para,rootElement.querySelector(".lia-message-body-content")); } else if(rootElement.querySelector(".lia-message-view-blog-topic-message")) { rootElement.querySelector(".lia-message-view-blog-topic-message .lia-message-body").insertBefore(tr_para,rootElement.querySelector(".lia-message-body-content")); } else if(rootElement.querySelector(".lia-quilt-blog-reply-message")){ rootElement.querySelector(".lia-quilt-blog-reply-message .lia-message-body").insertBefore(tr_para,rootElement.querySelector(".lia-message-body-content")); } else if(rootElement.querySelector(".lia-quilt-tkb-message")){ rootElement.querySelectorAll(".lia-quilt-tkb-message .lia-message-body")[0].insertBefore(tr_para,rootElement.querySelector(".lia-message-body-content")); } else if(rootElement.querySelector(".lia-quilt-tkb-reply-message")){ rootElement.querySelectorAll(".lia-quilt-tkb-reply-message .lia-message-body")[0].insertBefore(tr_para,rootElement.querySelector(".lia-message-body-content")); } else if(rootElement.querySelector(".lia-quilt-idea-message")){ rootElement.querySelector(".lia-quilt-idea-message .lia-message-body").insertBefore(tr_para,rootElement.querySelector(".lia-message-body-content")); } else if(rootElement.querySelector(".lia-quilt-idea-reply-message")){ rootElement.querySelector(".lia-quilt-idea-reply-message .lia-message-body").insertBefore(tr_para,rootElement.querySelector(".lia-message-body-content")); } else if(rootElement.querySelector('.lia-quilt-occasion-message')){ rootElement.querySelector('.lia-quilt-occasion-message .lia-message-body').insertBefore(tr_para,rootElement.querySelector(".lia-message-body-content")); } else { if (rootElement.querySelectorAll('div.lia-quilt-row-footer').length > 0) { rootElement.querySelectorAll('div.lia-quilt-row-footer')[0].appendChild(tr_para); } else { rootElement.querySelectorAll('div.lia-quilt-column-message-footer')[0].appendChild(tr_para); } } } } catch (e) { } } } else { /* Do not display button for same language */ // syncList.remove(value); var index = $scope.syncList.indexOf(value); if (index > -1) { $scope.syncList.splice(index, 1); } } } } } } /*if(mszList_l.length <= 0){ setTimeout(()=>{ var mszListl = []; angular.forEach(document.querySelectorAll("[class*='lia-js-data-messageUid']"), function(element) { var mszId = element.getAttribute("data-lia-message-uid"); if (mszId != null) { mszListl.push(mszId); } }); var mszListid = mszListl; console.log("mszListl:",mszListl); },2000) }else{ var mszListid = mszList_l; }*/ console.log("mszList_l:",mszList_l.length); angular.forEach(mszList_l, function (value) { if (document.querySelectorAll('div.lia-js-data-messageUid-' + value).length > 0) { var rootElements = document.querySelectorAll('div.lia-js-data-messageUid-' + value); }else if(document.querySelectorAll('.lia-occasion-message-view .lia-component-occasion-message-view').length >0){ var rootElements = document.querySelectorAll('.lia-occasion-message-view .lia-component-occasion-message-view')[0].querySelectorAll('.lia-occasion-description')[0]; }else { var rootElements = document.querySelectorAll('div.message-uid-' + value); } angular.forEach(rootElements, function (rootElement) { if (value == '1130408' && "TkbArticlePage" == "TkbArticlePage") { rootElement = document.querySelector('.lia-thread-topic'); } /* V1.1 Remove from UI */ if (document.getElementById("tr-msz-" + value)) { document.getElementById("tr-msz-" + value).remove(); } if (document.getElementById("tr-sync-" + value)) { document.getElementById("tr-sync-" + value).remove(); } /* XPath expression for subject and Body */ var lingoRBExp = "//lingo-body[@id = "+"'lingo-body-"+value+"'"+"]"; lingoRSExp = "//lingo-sub[@id = "+"'lingo-sub-"+value+"'"+"]"; /* Get translated subject of the message */ lingoRSXML = doc.evaluate(lingoRSExp, doc, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); for(var i=0;i
0){ angular.forEach(document.querySelectorAll(".PageTitle"), function(subEle) { subEle.textContent = sub_L; }); } } } // Label translation try{ var labelEle = document.querySelector("#labelsForMessage"); if(!labelEle){ labelEle = document.querySelector(".LabelsList"); } if(labelEle) { var listContains = labelEle.querySelector('.label'); if (listContains) { /* Commenting this code as bussiness want to point search with source language label */ // var tagHLink = labelEle.querySelectorAll(".label")[0].querySelector(".label-link").href.split("label-name")[0]; var lingoLabelExp = "//lingo-label/text()"; trLabels = []; trLabelsHtml = ""; /* Get translated labels of the message */ lingoLXML = doc.evaluate(lingoLabelExp, doc, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); var labelsLength = document.querySelector(".LabelsList").querySelectorAll(".label").length; var labelSnapshotLength = lingoLXML.snapshotLength; if (labelsLength == labelSnapshotLength){ for (var k = 0; k < lingoLXML.snapshotLength; k++) { //trLabels.push(lingoLXML.snapshotItem(i).textContent); if (k != 0) { //trLabelsHtml = trLabelsHtml + '
,
'; //diffVariable = kValue } try{ if(labelEle.querySelectorAll(".label")[k]){ tagHLink = labelEle.querySelectorAll(".label")[k].querySelector(".label-link").href; if ("TkbArticlePage" == "BlogArticlePage") { trLabelsHtml = trLabelsHtml + '
' + lingoLXML.snapshotItem(k).textContent + '
'; } else { // trLabelsHtml = trLabelsHtml + '
' + lingoLXML.snapshotItem(k).textContent + '
'; trLabelsHtml = trLabelsHtml + '
' + lingoLXML.snapshotItem(k).textContent + '
'; } } } catch(e){ } } } if (newSub.getAttribute("slang").toLowerCase() != code_l.toLowerCase()) { if (trLabelsHtml != "") { var labelSname = ""; if(labelEle.querySelector("ul li:nth-child(1)").getAttribute("aria-hidden")){ labelSname = labelEle.querySelector("ul li:nth-child(1)").outerHTML; } labelEle.querySelector("ul").innerHTML = ""; labelEle.querySelector("ul").innerHTML = labelSname + trLabelsHtml; } } } } } catch(e){ } } } /* V 2.0:3 = Store not translated reply id */ if(lingoRSXML.snapshotLength == 0){ if($scope.falseReplyID == "") { $.ajax({ url : "/api/2.0/search?q=select id,c_unsupported_language from messages where id ='"+value+"'", method:"GET", success : function(data){ console.log("Success :",data.data.items[0]); if(!data.data.items[0].c_unsupported_language){ console.log("false reply id:",value); $scope.falseReplyID = value; } }, error : function(data){ console.log("error",data); } }); } } /* Get translated Body of Replies/Comments */ var lingoRBXML = doc.evaluate(lingoRBExp, doc, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); for(var i=0;i
0) { var attachDiv = rootElement.querySelector('div.lia-quilt-row-main').querySelector('div.custom-attachments'); if (attachDiv) { attachDiv = attachDiv.outerHTML; }else if(rootElement.querySelector('div.lia-quilt-row-main').querySelectorAll('#attachments').length > 0){ if ("TkbArticlePage" == "BlogArticlePage") { attachDiv = rootElement.querySelector('div.lia-quilt-row-main .lia-message-body-content').querySelector('#attachments'); if (attachDiv) { attachDiv = attachDiv.outerHTML; } else{ attachDiv = ""; } }else{ attachDiv = rootElement.querySelector('div.lia-quilt-row-main').querySelector('#attachments').outerHTML; } } else { attachDiv = ""; } /* Feedback Div */ var feedbackDiv = ""; var feedbackDivs = rootElement.querySelector('div.lia-quilt-row-main').querySelectorAll('div.lia-panel-feedback-banner-safe'); if (feedbackDivs.length > 0) { for (var k = 0; k < feedbackDivs.length; k++) { feedbackDiv = feedbackDiv + feedbackDivs[k].outerHTML; } } }else { var attachDiv = rootElement.querySelector('div.lia-message-body-content').querySelector('div.Attachments.preview-attachments'); if (attachDiv) { attachDiv = attachDiv.outerHTML; } else { attachDiv = ""; } /* Everyone tags links */ if (document.querySelectorAll("div.TagList").length > 0){ var everyoneTagslink = document.querySelector('div.lia-quilt-row-main').querySelector(".MessageTagsTaplet .TagList"); if ((everyoneTagslink != null)||(everyoneTagslink != undefined)){ everyoneTagslink = everyoneTagslink.outerHTML; } else{ everyoneTagslink = ""; } } /* Feedback Div */ var feedbackDiv = ""; var feedbackDivs = rootElement.querySelector('div.lia-message-body-content').querySelectorAll('div.lia-panel-feedback-banner-safe'); if (feedbackDivs.length > 0) { for (var m = 0; m < feedbackDivs.length; m++) { feedbackDiv = feedbackDiv + feedbackDivs[m].outerHTML; } } } } } catch (e) { } if (body_L == "") { /* V 2.0:7 Replacing translated video data with source video data */ var newBodyVideoData = newBody.querySelectorAll('div[class*="vid-container"]'); angular.forEach($scope.videoData[value], function (sourceVideoElement, index) { if (index <= (newBodyVideoData.length - 1)) { newBodyVideoData[index].outerHTML = sourceVideoElement.outerHTML; } }); /* V 2.0:7 = Replacing translated image data with source data */ var newBodyImageData = newBody.querySelectorAll('[class*="lia-image"]'); angular.forEach($scope.imageData[value], function (sourceImgElement, index) { if($scope.imageData[value].length == newBodyImageData.length){ if (index <= (newBodyImageData.length - 1)) { if(newBodyImageData[index].querySelectorAll('img').length > 0){ newBodyImageData[index].outerHTML = sourceImgElement.outerHTML; // console.log("image of the loop2"); } } }else{ if (index <= (newBodyImageData.length - 1)) { try{ if(newBodyImageData[index].querySelectorAll('img').length > 0){ if(newBodyImageData[index].querySelector('img').getAttribute('title') == $scope.imageData[value][index].querySelector('img').getAttribute('title')){ newBodyImageData[index].outerHTML = sourceImgElement.outerHTML; } } }catch(e){ console.log(e); } } } }); /* V 2.0:7 = Replacing translated pre tag data with source data */ var newBodyPreTagData = newBody.querySelectorAll('pre'); angular.forEach($scope.preTagData[value], function (sourcePreTagElement, index) { if (index <= (newBodyPreTagData.length - 1)) { newBodyPreTagData[index].outerHTML = sourcePreTagElement.outerHTML; } }); } var copyBodySubject = false; if (body_L == "") { copyBodySubject = true; body_L = newBody.innerHTML; } /* This code is written as part of video fix by iTalent */ /* try{ var iframeHTMLText = body_L; var searchIframeText = "<IFRAME"; var foundiFrameTag; if (iframeHTMLText.indexOf(searchIframeText) > -1) { foundiFrameTag = decodeHTMLEntities(iframeHTMLText); foundiFrameTag = foundiFrameTag.split('src="
')[1]; body_L = foundiFrameTag; } } catch(e){ } */ /* This code is placed to remove the extra meta tag adding in the UI*/ try{ // body_L = body_L.replace('<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />',''); body_L = body_L.replace(/<meta\s+http-equiv=["']Content-Type["']\s+content=["']text\/html;\s*charset=utf-8["']\s*\/?>/i, ''); } catch(e){ } /** We should not replace the source content if user profile language and selected target language matches with source language **/ if(showTrContent) { var compiled = false; if(value == "1130408") { var description = document.querySelector('meta[name="description"]'); var metaDescription = document.querySelector('meta[property="og:description"]'); description.setAttribute("content",removeTags(body_L)); metaDescription.setAttribute("content",removeTags(body_L)); } if("TkbArticlePage"=="IdeaPage"){ // var customAttachDiv = '
'; rootElement.querySelectorAll('div.lia-message-body-content')[0].innerHTML = body_L + feedbackDiv ; $compile(rootElement.querySelectorAll('div.lia-message-body-content')[0])($scope); compiled = true; /* Attach atttach div */ // document.querySelector("div.translation-attachments-"+value).innerHTML = attachDiv; rootElement.querySelectorAll('div.lia-message-body-content')[0].insertAdjacentHTML('afterend',attachDiv); if(rootElement.querySelectorAll('div.lia-quilt-idea-message .lia-message-body .lia-attachments-message').length > 1){ rootElement.querySelectorAll('div.lia-quilt-idea-message .lia-message-body .lia-attachments-message')[1].remove(); } } else { if("TkbArticlePage"=="TkbArticlePage" || "TkbArticlePage"=="QandAQuestionPage" || "TkbArticlePage" == "BlogArticlePage"){ rootElement.querySelectorAll('div.lia-message-body-content')[0].innerHTML = body_L + feedbackDiv ; /* $compile(rootElement.querySelectorAll('div.lia-message-body-content')[0])($scope);*/ }else{ if(rootElement.querySelectorAll('div.lia-message-body-content')[0]){ rootElement.querySelectorAll('div.lia-message-body-content')[0].innerHTML = body_L + feedbackDiv + attachDiv; compiled = true; } } } /* Destroy and recreate OOyala player videos to restore the videos in target languages which is written by iTalent as part of iTrack LILICON-79 */ /* Destroy and recreate OOyala player videos */ /*try{ // $scope.videoData[value][0].querySelector("div").getAttribute("id"); for(var vidIndex=0; vidIndex<$scope.videoData[value].length; vidIndex++){ if( $scope.videoData[value][vidIndex].querySelector("div") != null){ var containerId = LITHIUM.OOYALA.players[$scope.videoData[value][vidIndex].querySelector("div").getAttribute("id")].containerId; videoId = LITHIUM.OOYALA.players[$scope.videoData[value][vidIndex].querySelector("div").getAttribute("id")].videoId; vid = OO.Player.create(containerId,videoId); vid.destroy(); var vid = OO.Player.create(containerId,videoId); } } } catch(e){ }*/ try{ for(var vidIndex=0; vidIndex<($scope.videoData[value].length); vidIndex++){ if($scope.videoData[value][vidIndex].querySelector('video-js') != null){ var data_id = $scope.videoData[value][vidIndex].querySelector('video-js').getAttribute('data-video-id'); var data_account = $scope.videoData[value][vidIndex].querySelector('video-js').getAttribute('data-account'); var data_palyer = $scope.videoData[value][vidIndex].querySelector('video-js').getAttribute('data-player'); var div = document.createElement('video-js'); div.id = "brightcove"; div.class = "brightcove-player"; div.innerHTML = '
(view in my videos)
' var data = div.getElementsByClassName("video-js"); var script = document.createElement('script'); script.src = "https://players.brightcove.net/"+data_account+"/"+data_palyer+"_default/index.min.js"; for(var i=0;i< data.length;i++){ videodata.push(data[i]); } } } for(var i=0;i< videodata.length;i++){ const container = document.getElementsByClassName('lia-vid-container')[i].querySelector('.lia-video-brightcove-player-container'); container.innerHTML = videodata[i].outerHTML; container.appendChild(script); //document.getElementsByClassName('lia-vid-container')[i].querySelector('.lia-video-brightcove-player-container').innerHTML = videodata[i].outerHTML; //document.body.appendChild(script); } } catch(e){ } // if(!compiled){ /* Re compile html */ $compile(rootElement.querySelectorAll('div.lia-message-body-content')[0])($scope); // } } var tr_div = document.createElement("div"); var attrSet = { "data-aigc":"true", "data-content-type":"text", "data-content-id":"AIGC-TXT-M-P-"+value, "data-platform":"https://community.nxp.com", } for (const [key, val] of Object.entries(attrSet)) { tr_div.setAttribute(key, val); } let parseReply; if(replies != undefined){ parseReply = JSON.parse(replies) } if (code_l.toLowerCase() != newBody.getAttribute("slang").toLowerCase()) { /* Adding Translation flag */ var tr_obj = $filter('filter')($scope.sourceLangList, function (obj_l) { return obj_l.code.toLowerCase() === newBody.getAttribute("slang").toLowerCase() }); tr_div.setAttribute("data-explicit-label", "This content was translated from "+tr_obj[0].title+" using AI-assisted tools") if (tr_obj.length > 0) { let url = LITHIUM.CommunityJsonObject.Community.viewHref.slice(0, -1)+LITHIUM.CommunityJsonObject.Page.object.viewHref+"?trMode=source"; tr_text = "このコンテンツはlilicon-trans-textからAI支援ツールを使って翻訳されました。".replace(/lilicon-trans-text/g, tr_obj[0].title); tr_text += '
原文を見る
'; try { if ($scope.wootMessages[$rootScope.profLang] != undefined) { tr_text = $scope.wootMessages[$rootScope.profLang].replace(/lilicon-trans-text/g, tr_obj[0].title); //url = url + "&" tr_text +='
原文を見る
'; } } catch (e) { } } else { //tr_text = "This message was translated for your convenience!"; tr_text = "lilicon-trans.your.convenience"; } try { if (!document.getElementById("tr-msz-" + value)) { var tr_para = document.createElement("P"); tr_para.setAttribute("id", "tr-msz-" + value); tr_para.setAttribute("class", "tr-msz"); tr_para.style.textAlign = 'justify'; var tr_fTag = document.createElement("IMG"); tr_fTag.setAttribute("class", "tFlag"); tr_fTag.setAttribute("alt", "翻訳アイコン"); //tr_fTag.setAttribute("title", "翻訳アイコンの免責事項"); tr_fTag.setAttribute("src", "/html/assets/translate-icon.svg"); tr_para.appendChild(tr_fTag); var container = document.createElement('span'); container.innerHTML = tr_text; //var tr_textNode = document.createTextNode(tr_text); tr_para.appendChild(container); parseReply.map(item => { if (item.id === parseInt(value)) { tr_div.setAttribute("data-generation-timestamp", item.date) } }); if(!rootElement.querySelector(".lia-message-body-content").parentElement.getAttributeNames().includes("data-generation-timestamp")){ rootElement.querySelector(".lia-message-body-content").parentNode.insertBefore(tr_div, rootElement.querySelector(".lia-message-body-content")); tr_div.appendChild(rootElement.querySelector(".lia-message-body-content")); } /* Woot message only for multi source */ if(rootElement.querySelector(".lia-message-body-content").previousElementSibling != null && rootElement.querySelector(".lia-message-body-content").previousElementSibling.getAttributeNames().includes("data-generation-timestamp")){ rootElement.querySelector(".lia-message-body-content").previousElementSibling.remove(); } if(rootElement.querySelector(".lia-quilt-forum-message")){ const parent = rootElement.querySelector(".lia-quilt-forum-message [data-aigc]"); const content = parent.querySelector(".lia-message-body-content"); parent.insertBefore(tr_para, content); } else if(rootElement.querySelector(".lia-message-view-blog-topic-message")) { const parent = rootElement.querySelector(".lia-message-view-blog-topic-message [data-aigc]"); const content = parent.querySelector(".lia-message-body-content"); parent.insertBefore(tr_para, content); } else if(rootElement.querySelector(".lia-quilt-blog-reply-message")){ const parent = rootElement.querySelector(".lia-quilt-blog-reply-message [data-aigc]"); const content = parent.querySelector(".lia-message-body-content"); parent.insertBefore(tr_para, content); } else if(rootElement.querySelector(".lia-quilt-tkb-message")){ const parent = rootElement.querySelector(".lia-quilt-tkb-message [data-aigc]"); const content = parent.querySelector(".lia-message-body-content"); parent.insertBefore(tr_para, content); } else if(rootElement.querySelector(".lia-quilt-tkb-reply-message")){ const parent = rootElement.querySelector(".lia-quilt-tkb-reply-message [data-aigc]"); const content = parent.querySelector(".lia-message-body-content"); parent.insertBefore(tr_para, content); } else if(rootElement.querySelector(".lia-quilt-idea-message")){ const parent = rootElement.querySelector(".lia-quilt-idea-message [data-aigc]"); const content = parent.querySelector(".lia-message-body-content"); parent.insertBefore(tr_para, content); } else if(rootElement.querySelector(".lia-quilt-idea-reply-message")){ const parent = rootElement.querySelector(".lia-quilt-idea-reply-message [data-aigc]"); const content = parent.querySelector(".lia-message-body-content"); parent.insertBefore(tr_para, content); } else if(rootElement.querySelector('.lia-quilt-occasion-message')){ const parent = rootElement.querySelector(".lia-quilt-occasion-message [data-aigc]"); const content = parent.querySelector(".lia-message-body-content"); parent.insertBefore(tr_para, content); } else { if(document.querySelectorAll(".threaded-message-list .lia-quilt-forum-message")){ var parentDiv = document.querySelectorAll(".threaded-message-list .lia-quilt-forum-message") if(parentDiv.length > 0){ var noClassDiv = Array.from(childDiv).find(div => !div.hasAttribute("class") && div.attributes.length > 0 ); if(noClassDiv != undefined && noClassDiv.getAttribute("data-aigc") && noClassDiv.getAttribute("data-content-id").includes(value)){ noClassDiv.remove(); tr_div.append(tr_para) parentDiv[0].appendChild(tr_div); } } }else if (rootElement.querySelectorAll('div.lia-quilt-row-footer').length > 0) { rootElement.querySelectorAll('div.lia-quilt-row-footer')[0].appendChild(tr_para); } else if(rootElement.querySelectorAll('div.lia-quilt-row-message-footer').length > 0){ rootElement.querySelectorAll('div.lia-quilt-row-message-footer')[0].appendChild(tr_para); }else { rootElement.querySelectorAll('div.lia-quilt-column-message-footer')[0].appendChild(tr_para); } } } } catch (e) { } } } else { /* Do not display button for same language */ // syncList.remove(value); var index = $scope.syncList.indexOf(value); if (index > -1) { $scope.syncList.splice(index, 1); } } } } /*$.ajax({ url : "/api/2.0/search?q=select id,c_unsupported_language from messages where id ='"+value+"'", method:"GET", success : function(data){ console.log("Success :",data.data.items[0]); if(data.data.items[0].c_unsupported_language){ tr_text = "Content originally entered in an unsupported language, then edited to a supported one, may yield less accurate automatic translations. We recommend reviewing the translated output."; if (!document.getElementById("tr-msz-" + value)) { var tr_para = document.createElement("P"); tr_para.setAttribute("id", "tr-msz-" + value); tr_para.setAttribute("class", "tr-msz"); tr_para.style.textAlign = 'justify'; var tr_fTag = document.createElement("IMG"); tr_fTag.setAttribute("class", "tFlag"); tr_fTag.setAttribute("src", "/html/assets/translate-icon.svg"); tr_para.appendChild(tr_fTag); var container = document.createElement('span'); container.innerHTML = tr_text; //var tr_textNode = document.createTextNode(tr_text); tr_para.appendChild(container); if(rootElement.querySelector(".lia-quilt-forum-message")){ rootElement.querySelector(".lia-quilt-forum-message .lia-message-body").insertBefore(tr_para,rootElement.querySelector(".lia-message-body-content")); } else if(rootElement.querySelector(".lia-message-view-blog-topic-message")) { rootElement.querySelector(".lia-message-view-blog-topic-message .lia-message-body").insertBefore(tr_para,rootElement.querySelector(".lia-message-body-content")); } else if(rootElement.querySelector(".lia-quilt-blog-reply-message")){ rootElement.querySelector(".lia-quilt-blog-reply-message .lia-message-body").insertBefore(tr_para,rootElement.querySelector(".lia-message-body-content")); } else if(rootElement.querySelector(".lia-quilt-tkb-message")){ rootElement.querySelectorAll(".lia-quilt-tkb-message .lia-message-body")[0].insertBefore(tr_para,rootElement.querySelector(".lia-message-body-content")); } else if(rootElement.querySelector(".lia-quilt-tkb-reply-message")){ rootElement.querySelectorAll(".lia-quilt-tkb-reply-message .lia-message-body")[0].insertBefore(tr_para,rootElement.querySelector(".lia-message-body-content")); } else if(rootElement.querySelector(".lia-quilt-idea-message")){ rootElement.querySelector(".lia-quilt-idea-message .lia-message-body").insertBefore(tr_para,rootElement.querySelector(".lia-message-body-content")); } else if(rootElement.querySelector(".lia-quilt-idea-reply-message")){ rootElement.querySelector(".lia-quilt-idea-reply-message .lia-message-body").insertBefore(tr_para,rootElement.querySelector(".lia-message-body-content")); } else if(rootElement.querySelector('.lia-quilt-occasion-message')){ rootElement.querySelector('.lia-quilt-occasion-message .lia-message-body').insertBefore(tr_para,rootElement.querySelector(".lia-message-body-content")); } else { if (rootElement.querySelectorAll('div.lia-quilt-row-footer').length > 0) { rootElement.querySelectorAll('div.lia-quilt-row-footer')[0].appendChild(tr_para); } else if(rootElement.querySelectorAll('div.lia-quilt-row-message-footer').length > 0){ rootElement.querySelectorAll('div.lia-quilt-row-message-footer')[0].appendChild(tr_para); }else { rootElement.querySelectorAll('div.lia-quilt-column-message-footer')[0].appendChild(tr_para); } } } } }, error : function(data){ console.log("error",data); } });*/ }); }); /* V 1.1:2 = Reply Sync button for multi source translation */ } catch(e){ console.log(e); } }; if((rContent != undefined) && (rContent != "")) { drawCanvas(decodeURIComponent(rContent)); /** Update variable with selected language code **/ $scope.previousSelCode = code_l; } }; /* removeTags for the meta tags */ function removeTags(innertext) { const unescaped = innertext .replace(/\\n/g, '\n') .replace(/\\t/g, '\t') .replace(/\\\\/g, '\\'); const tempDiv = document.createElement('div'); tempDiv.innerHTML = unescaped; const text = tempDiv.textContent || tempDiv.innerText || ''; const content_text = text.replace(/\s+\n/g, '').replace(/\n\s+/g, '').trim(); return content_text.slice(0,300); } /** * @function selectThisLang * @description Called on select dropdown. * @param {string} lang - Language code * */ $scope.selectThisLang = function (lang, anonymousFlag) { /* 1.4:3 Update Analytics on language selection */ /*try { setTimeout(()=>{ lingoThreadLangSelected(lang, '1130408'); console.log("Language",lang); },5000) } catch (e) { console.log(e); }*/ /** Display Translated content **/ var getTranslation = lithiumPlugin.getTranslation(lang, "1130408"); getTranslation.then(function (trContent) { if (trContent.body != "") { $scope.showPreview(trContent.body, $scope.mszList, lang, trContent.id, trContent.replies); } else { //$rootScope.errorMsg = "Translation is in progress. Please check again in a few minutes." //$rootScope.errorMsg = "lilicon-trans.is_in.progress" } }); }; var decodeEntities = (function() { // this prevents any overhead from creating the object each time var element = document.createElement('div'); function decodeHTMLEntities (str) { if(str && typeof str === 'string') { // strip script/html tags str = str.replace(/