Some typical variations:
- Report Requirements
- Specific Components Usage
- Additional Tiers of Competition
2017 Rules per Region
2016 Rules per Region
2015 Rules per Region
2014 Rules per Region
[ARCHIVE] 2013 Rules per Region
%3CLINGO-SUB%20id%3D%22lingo-sub-1120511%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ENXP%20Cup%20Rules%20by%20Region%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1120511%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CH2%20id%3D%22toc-hId--1414614505%22%20id%3D%22toc-hId--498485358%22%3ESome%20typical%20variations%3A%3C%2FH2%3E%3CUL%3E%3CLI%3EReport%20Requirements%3C%2FLI%3E%3CLI%3ESpecific%20Components%20Usage%3C%2FLI%3E%3CLI%3EAdditional%20Tiers%20of%20Competition%3C%2FLI%3E%3C%2FUL%3E%3CH1%20id%3D%22toc-hId--1425117609%22%20id%3D%22toc-hId--508988462%22%3E%3C%2FH1%3E%3CH1%20id%3D%22toc-hId-1062395224%22%20id%3D%22toc-hId-1978524371%22%3E%3CSPAN%20style%3D%22text-decoration%3A%20underline%3B%22%3E2017%20Rules%20per%20Region%3C%2FSPAN%3E%3C%2FH1%3E%3CH1%20id%3D%22toc-hId--745059239%22%20id%3D%22toc-hId-171069908%22%3E%3C%2FH1%3E%3CUL%3E%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fdocs%2FDOC-332303%22%20target%3D%22_blank%22%3EEMEA%20University%20Challenge%202016-2017%3C%2FA%3E%20%3C%2FLI%3E%3C%2FUL%3E%3CH1%20id%3D%22toc-hId-1742453594%22%20id%3D%22toc-hId--1636384555%22%3E%3C%2FH1%3E%3CH1%20id%3D%22toc-hId--65000869%22%20id%3D%22toc-hId-851128278%22%3E%3CSPAN%20style%3D%22text-decoration%3A%20underline%3B%22%3E2016%20Rules%20per%20Region%3C%2FSPAN%3E%3C%2FH1%3E%3CUL%3E%3CLI%3E%3CSPAN%20style%3D%22text-decoration%3A%20underline%3B%22%3E%3CA%20_jive_internal%3D%22true%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fdocs%2FDOC-329616%22%20target%3D%22_blank%22%3EAmericas%2C%20Malaysia%20and%20Taiwan.%3C%2FA%3E%E2%80%8B%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%20style%3D%22text-decoration%3A%20underline%3B%22%3E%3CA%20_jive_internal%3D%22true%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fdocs%2FDOC-105423%22%20target%3D%22_blank%22%3EEMEA%20University%20Program%20Challenge%3CBR%20%2F%3E%3C%2FA%3E%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CA%20_jive_internal%3D%22true%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fdocs%2FDOC-105424%22%20target%3D%22_blank%22%3EEMEA%20High%20School%20Challenge%3C%2FA%3E%3C%2FLI%3E%3C%2FUL%3E%3CH1%20id%3D%22toc-hId--1872455332%22%20id%3D%22toc-hId--956326185%22%3E%3CSPAN%20style%3D%22color%3A%20%23333333%3B%20text-decoration%3A%20underline%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23808080%3B%20text-decoration%3A%20underline%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23333399%3B%20text-decoration%3A%20underline%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23333333%3B%20text-decoration%3A%20underline%3B%22%3E2015%20Rules%20per%20Region%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FH1%3E%3CP%3E%3C%2FP%3E%3CUL%3E%3CLI%3E%3CSPAN%20style%3D%22color%3A%20%23333333%3B%20text-decoration%3A%20underline%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23808080%3B%20text-decoration%3A%20underline%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23333399%3B%20text-decoration%3A%20underline%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23333333%3B%20text-decoration%3A%20underline%3B%22%3E%3CA%20_jive_internal%3D%22true%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fdocs%2FDOC-103126%22%20target%3D%22_blank%22%3EWorldwide%20Challenge%20Rules%3C%2FA%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CA%20_jive_internal%3D%22true%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fdocs%2FDOC-101287%22%20style%3D%22font-size%3A%2010pt%3B%20line-height%3A%201.5em%3B%22%20target%3D%22_blank%22%3EEMEA%3C%2FA%3E%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2018pt%3B%20text-decoration%3A%20underline%3B%22%3E%3CSTRONG%3E2014%20Rules%20per%20Region%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CUL%3E%3CLI%3E%3CSPAN%20style%3D%22text-decoration%3A%20underline%3B%22%3E%3CA%20_jive_internal%3D%22true%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fdocs%2FDOC-94949%22%20target%3D%22_blank%22%3EEMEA%3C%2FA%3E%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%20style%3D%22text-decoration%3A%20underline%3B%22%3E%3CA%20_jive_internal%3D%22true%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fdocs%2FDOC-98806%22%20target%3D%22_blank%22%3EWorldwide%20Challenge%20Rules%3C%2FA%3E%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%20style%3D%22text-decoration%3A%20underline%3B%22%3E%3CA%20_jive_internal%3D%22true%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fdocs%2FDOC-99007%22%20target%3D%22_blank%22%3EUSA%3C%2FA%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%3C%2FP%3E%3CH1%20id%3D%22toc-hId-615057501%22%20id%3D%22toc-hId-1531186648%22%3E%3CSPAN%20style%3D%22text-decoration%3A%20underline%3B%22%3E%5BARCHIVE%5D%202013%20Rules%20per%20Region%3C%2FSPAN%3E%3C%2FH1%3E%3CP%3E%3C%2FP%3E%3CUL%3E%3CLI%3E%3CA%20_jive_internal%3D%22true%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fdocs%2FDOC-94833%22%20target%3D%22_blank%22%3EMalaysia%3C%2FA%3E%3C%2FLI%3E%3CLI%3E%3CA%20_jive_internal%3D%22true%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fservlet%2FJiveServlet%2Fdownload%2F93225-33-249327%2FTFC_Rules_LATAM_rev16Mar2012.pdf%22%20target%3D%22_blank%22%3ELatin%20America%3C%2FA%3E%3C%2FLI%3E%3CLI%3E%3CA%20_jive_internal%3D%22true%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fservlet%2FJiveServlet%2Fdownload%2F93225-33-249328%2FTFC_Rules_LATAM_ADVANCED_rev293Ago.pdf%22%20target%3D%22_blank%22%3ELatin%20America%20-%20Advanced%3C%2FA%3E%3C%2FLI%3E%3CLI%3E%3CA%20_jive_internal%3D%22true%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fservlet%2FJiveServlet%2Fdownload%2F93225-33-255494%2FTFC_Rules_USA_2013_v2.pdf%22%20target%3D%22_blank%22%3EUSA%3C%2FA%3E%3C%2FLI%3E%3CLI%3E%3CA%20_jive_internal%3D%22true%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fservlet%2FJiveServlet%2Fdownload%2F93225-33-261358%2FTFC%20Global%20Championship%202013%20Rules_Final_Updated_20May2013.pdf%22%20target%3D%22_blank%22%3EGlobal%20Championship%20%3C%2FA%3E%3C%2FLI%3E%3C%2FUL%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1120511%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3EFreescale%20Cup%20Content%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1120521%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20NXP%20Cup%20Rules%20by%20Region%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1120521%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20Flavio%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EI%20think%20it%20is%20clear%20now%20that%20the%20battery%20that%20can%20be%20used%20is%20NiMH%2C%20NiCd%20and%20Li-Ion.%20Also%2C%20I%20wasnt%20aware%20of%20the%20plane%20regulations.%20Most%20li-po%20batteries%20are%207.4V%20instead%20of%207.2V.%20I%20must%20have%20overlooked%20the%20differences.%3C%2FP%3E%3CP%3ETHANK%20U!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1120520%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20NXP%20Cup%20Rules%20by%20Region%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1120520%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EDavid%2C%20the%20battery%20you%20are%20referring%20to%20is%20LiPo%20and%20we%20do%20not%20allow%20LiPo%20in%20our%20challenge.%20Main%20reason%20is%20because%20depending%20how%20far%20you%20get%20into%20the%20challenge%2C%20you%20might%20be%20called%20upon%20flying%20with%20your%20car%20in%20your%20hand%20carriage%20or%20in%20your%20checked%20luggage.%20Those%20batteries%20are%20strictly%20regulated%20on%20how%20they%20can%20be%20shipped%20and%20carried%20around.%3C%2FP%3E%3CP%3EPlease%20stick%20to%20the%20battery%20types%20listed%20in%20the%20rules.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1120519%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20NXP%20Cup%20Rules%20by%20Region%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1120519%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHey%20Andy%2C%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3Eit%C2%B4s%20not%20about%20an%20special%20Kind%20of%20Battery.%20%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EIt%20is%20the%20Question%2C%20because%20in%20the%20Rules%20it%20is%20said%20that%3A%20(Part%202)%20%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2011.5px%3B%20font-family%3A%20Arial%3B%22%3E%3CEM%3E%22The%20participants%20must%20provide%20the%20battery.%20The%20electrical%20restrictions%20are%3A%20%3C%2FEM%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2011.5px%3B%20font-family%3A%20Arial%3B%22%3E%3CEM%3E1.%207.2V%2C%20%26lt%3B%3D3000mAh%2C%20rechargeable%20NiCd%2C%20NiMH%20or%20Li-ION.%3C%2FEM%3E%22%20-%20TFC%202016%20EMEA%20Rules%20V2%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2011.5px%3B%20font-family%3A%20Arial%3B%22%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2011.5px%3B%20font-family%3A%20Arial%3B%22%3E7.2%20Volts%20(nominal)%20is%20just%20Possible%20with%20the%20use%20of%201%2C2V%20(NiCd%20or%20NiMH)%20Cells%3A%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2011.5px%3B%20font-family%3A%20Arial%3B%22%3E7%2C2V%20%2F%201%2C2V%2FCell%20%3D%206%20Cells%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2011.5px%3B%20font-family%3A%20Arial%3B%22%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2011.5px%3B%20font-family%3A%20Arial%3B%22%3ELi-ION%20Cells%20have%20an%20nominal%20Voltage%20of%203%2C7V%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2011.5px%3B%20font-family%3A%20Arial%3B%22%3Ethat%20means%3A%20Either%20you%20can%20use%20One%20Cell%20%3D%203%2C7V%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2011.5px%3B%20font-family%3A%20Arial%3B%22%3EOR%20you%20can%20use%3A%202%20Cells%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2011.5px%3B%20font-family%3A%20Arial%3B%22%3E2%20*%203%2C7V%2FCell%20%3D%207%2C4V%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2011.5px%3B%20font-family%3A%20Arial%3B%22%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2011.5px%3B%20font-family%3A%20Arial%3B%22%3ESo%20according%20to%20the%20Rules%20its%20not%20allowed%20to%20use%202%20Cells%20because%20you%20are%20nominal%200%2C2V%20OVER%20the%20Max%20Voltage.%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2011.5px%3B%20font-family%3A%20Arial%3B%22%3EBut%20nobody%20would%20use%203%2C7V%20Li-ION%20Cell%20when%20he%20can%20use%207%2C2V%20NiXX%20Cell.%20%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3ESo%20there%20would%20be%20no%20reason%20to%20Allow%20Li-ION%20in%20first%20Place.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EAn%20Idea%20of%20which%20Battery%20can%20give%20you%20following%20Link%3A%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fwww.conrad.de%2Fde%2Fmodellbau-akkupack-lipo-74-v-900-mah-25-c-hacker-ec3-239504.html%22%20title%3D%22https%3A%2F%2Fwww.conrad.de%2Fde%2Fmodellbau-akkupack-lipo-74-v-900-mah-25-c-hacker-ec3-239504.html%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3EModellbau-Akkupack%20(LiPo)%207.4%20V%20900%20mAh%2025%20C%20Hacker%20EC3%20zum%20Conrad%20Online-Shop%20%7C%20000239504%3C%2FA%3E%20%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3ESo%20Please%20clarify%20if%20we%20can%20use%202%20Cell%20Li-ION%20(LiPo)%20Batterys%20or%20not.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3ESincerely%2C%3C%2FP%3E%3CP%3EDavid%20%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1120518%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20NXP%20Cup%20Rules%20by%20Region%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1120518%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ECan%20you%20send%20me%20a%20photo%20of%20the%20battery%20you%20want%20to%20use%20and%20a%20description%20of%20the%20battery%2C%20as%20well%20as%20the%20URL%20of%20where%20to%20be%20purchased%3F%3C%2FP%3E%3CP%3EThanks%20you%2C%3C%2FP%3E%3CP%3EAndy%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EAndy%20Mastronardi%3C%2FP%3E%3CP%3EManager%20University%20Programs%3C%2FP%3E%3CP%3EFreescale%3C%2FP%3E%3CP%3E6501%20William%20Cannon%20Drive%3C%2FP%3E%3CP%3EAustin%2C%20TX%20%2078735%3C%2FP%3E%3CP%3E%3CA%20href%3D%22www.freescale.com%2Funiversityprograms%26lt%3Bhttp%3A%2F%2Fwww.freescale.com%2Funiversityprograms%26gt%3B%22%20target%3D%22test_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ewww.freescale.com%2Funiversityprograms%26lt%3B%26gt%3B%3C%2FA%3E%3B%3C%2FP%3E%3CP%3EP%3A%20512-895-6447%3C%2FP%3E%3CP%3EC%3A%20512-656-2479%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1120517%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20NXP%20Cup%20Rules%20by%20Region%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1120517%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20%3C%2FP%3E%3CP%3EI%20would%20like%20to%20get%20some%20clarification%20on%20the%20rules%20regarding%20the%20batteries%20as%20well.%20Can%20we%20use%20Li-Po%20batteries%20as%20they%20are%20quite%20similar%20to%20Li-ion.%20Or%20the%20rules%20are%20fixed%3B%20ONLY%20NiMH%2C%20NiCad%20or%20Li-ion%20batteries%20are%20allowed.%20There%20are%20many%20Li-Po%20batteries%20with%20lower%20capacity%20and%20lighter%2C%20so%20we%20were%20wondering%20if%20its%20ok%20to%20use%20it%20during%20the%20race.%20Kindly%20advice.%20Thank%20u!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1120516%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20NXP%20Cup%20Rules%20by%20Region%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1120516%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHow%20is%20it%20with%20Li-ION%20Batterys.%3C%2FP%3E%3CP%3EIs%20it%20allowed%20to%20use%3A%202Cells%20%3D%207%2C4V%3F%20%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1120515%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20NXP%20Cup%20Rules%20by%20Region%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1120515%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20Tommy%2C%20the%20rules%20are%20pretty%20clear.%20The%20MCU%20control%20board%20and%20the%20motor%20control%20unit%20must%20be%20approved%20boards%20per%20the%20rules.%20This%20means%20no%20custom%20boards%20for%20those%20functions%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1120514%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20NXP%20Cup%20Rules%20by%20Region%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1120514%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EFlavio%2C%3C%2FP%3E%3CP%3EThe%20Worldwide%20Challenge%20Rules%20said%20that%20we%20must%20use%20approved%20controller%20and%20motor%20dirver%20boards.Does%20that%20mean%20we%20must%20use%20controller%20board%20designed%20by%20Freescale%2Cor%20controller%20board%20designed%20by%20ourselves%20with%20chip%20described%20below%3F%20%3C%2FP%3E%3CP%3Ecxd%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1120513%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20NXP%20Cup%20Rules%20by%20Region%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1120513%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20Daniel%2C%20you%20might%20have%20a%20look%20at%20the%20introduction%20presentation.%20We%20are%20officially%20starting%20a%20program%20with%20High%20Schools%20and%20we%20are%20finishing%20to%20work%20on%20the%20Innovation%20Challenge%20that%20would%20target%20more%20Master%20students.%20The%20Freescale%20Cup%20for%20Bachelors%20with%20participation%20(max%201%20student%2Fteam)%20of%20Master%20level%20student%20remains%20our%20most%20focus%20challenge%20at%20this%20point.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1120512%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20NXP%20Cup%20Rules%20by%20Region%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1120512%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EFlavio%2C%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3ESo%20other%20than%20track%20change%2C%20same%20rules%20as%20last%20year%3F%20%20What%20is%20meant%20by%20%E2%80%9Cadditional%20tiers%20of%20competition%E2%80%9D%20%3F%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EDaniel%3C%2FP%3E%3C%2FLINGO-BODY%3E
Last update:
09-09-2012
12:02 PM
'
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 = "This content was translated from lilicon-trans-text using AI-assisted tools.".replace(/lilicon-trans-text/g, tr_obj[0].title);
tr_text +='View original';
try {
if ($scope.wootMessages[$rootScope.profLang] != undefined) {
tr_text = $scope.wootMessages[$rootScope.profLang].replace(/lilicon-trans-text/g, tr_obj[0].title);
tr_text +='View original';
}
} 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", "Translate icon");
// tr_fTag.setAttribute("title", "Disclaimer for Translate icon");
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 == '1120511' && "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 + '';
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 == "1120511") {
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 = "This content was translated from lilicon-trans-text using AI-assisted tools.".replace(/lilicon-trans-text/g, tr_obj[0].title);
tr_text += 'View original';
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 +='View original';
}
} 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", "Translate icon");
//tr_fTag.setAttribute("title", "Disclaimer for Translate icon");
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, '1120511');
console.log("Language",lang);
},5000)
} catch (e) {
console.log(e);
}*/
/** Display Translated content **/
var getTranslation = lithiumPlugin.getTranslation(lang, "1120511");
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(/