html_utils.js 108 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605
  1. window.onload = function() {
  2. // textCleanup
  3. test("textCleanup", function() {
  4. var source = "Some\nValue\n\n\nTest"
  5. var should = "Some\nValue\n\nTest"
  6. var result = App.Utils.textCleanup(source)
  7. equal(result, should, source)
  8. source = "Some\nValue\n\n \n\n\nTest"
  9. should = "Some\nValue\n\nTest"
  10. result = App.Utils.textCleanup(source)
  11. equal(result, should, source)
  12. source = "Some\n\rValue\n\r\n\r\n\rTest"
  13. should = "Some\nValue\n\nTest"
  14. result = App.Utils.textCleanup(source)
  15. equal(result, should, source)
  16. source = "Some\n\rValue\n\r\n\r\n\rTest\r"
  17. should = "Some\nValue\n\nTest"
  18. result = App.Utils.textCleanup(source)
  19. equal(result, should, source)
  20. source = "Some\r\nValue\r\n\r\n\r\nTest\r\n"
  21. should = "Some\nValue\n\nTest"
  22. result = App.Utils.textCleanup(source)
  23. equal(result, should, source)
  24. source = "Some\r\nValue\r\n\r\n\r\n\r\n\r\n\r\nTest\r\n"
  25. should = "Some\nValue\n\nTest"
  26. result = App.Utils.textCleanup(source)
  27. equal(result, should, source)
  28. source = "> Welcome!\n> \n> Thank you for installing Zammad.\n> \n> You will find ..."
  29. should = "> Welcome!\n>\n> Thank you for installing Zammad.\n>\n> You will find ..."
  30. result = App.Utils.textCleanup(source)
  31. equal(result, should, source)
  32. });
  33. // text2html
  34. test("text2html", function() {
  35. var source = "Some\nValue\n\n\nTest"
  36. var should = "<div>Some</div><div>Value</div><div><br></div><div>Test</div>"
  37. var result = App.Utils.text2html(source)
  38. equal(result, should, source)
  39. source = "Some\nValue\n"
  40. should = "<div>Some</div><div>Value</div>"
  41. result = App.Utils.text2html(source)
  42. equal(result, should, source)
  43. source = "Some\n<b>Value</b>\n"
  44. should = "<div>Some</div><div>&lt;b&gt;Value&lt;/b&gt;</div>"
  45. result = App.Utils.text2html(source)
  46. equal(result, should, source)
  47. source = "> Welcome!\n> \n> Thank you for installing Zammad.\n> \n> You will find ..."
  48. should = "<div>&gt; Welcome!</div><div>&gt;</div><div>&gt; Thank you for installing Zammad.</div><div>&gt;</div><div>&gt; You will find ...</div>"
  49. result = App.Utils.text2html(source)
  50. equal(result, should, source)
  51. });
  52. // htmlStrip
  53. test("htmlStrip", function() {
  54. var source = $('<div><br><b>lala</b></div>')
  55. var should = '<div><b>lala</b></div>'
  56. App.Utils.htmlStrip(source)
  57. equal(source.get(0).outerHTML, should)
  58. source = $('<div><br><br><br><b>lala</b></div>')
  59. should = '<div><b>lala</b></div>'
  60. App.Utils.htmlStrip(source)
  61. equal(source.get(0).outerHTML, should)
  62. source = $('<div><br><br><br><b>lala</b><br><br></div>')
  63. should = '<div><b>lala</b></div>'
  64. App.Utils.htmlStrip(source)
  65. equal(source.get(0).outerHTML, should)
  66. source = $('<div><br><br><div><br></div><b>lala</b><br><br></div>')
  67. should = '<div><div><br></div><b>lala</b></div>'
  68. App.Utils.htmlStrip(source)
  69. equal(source.get(0).outerHTML, should)
  70. });
  71. // lastLineEmpty
  72. test("htmlLastLineEmpty", function() {
  73. var source = $('<div><br><b>lala</b></div>')
  74. equal(App.Utils.htmlLastLineEmpty(source), false)
  75. source = $('<div><br><b>lala</b><br></div>')
  76. equal(App.Utils.htmlLastLineEmpty(source), true)
  77. });
  78. // html2text
  79. test("html2text", function() {
  80. var source = "<div>Some</div><div>Value</div><div><br></div><div>Test</div>"
  81. var should = "Some\nValue\n\nTest"
  82. var result = App.Utils.html2text(source)
  83. equal(result, should, source)
  84. source = "<div>Some</div><div>Value</div>"
  85. should = "Some\nValue"
  86. result = App.Utils.html2text(source)
  87. equal(result, should, source)
  88. source = "<div>Some<br/>Value</div>"
  89. should = "Some\nValue"
  90. result = App.Utils.html2text(source)
  91. equal(result, should, source)
  92. source = "<div>Some &amp; &lt;Value&gt;</div>"
  93. should = "Some & <Value>"
  94. result = App.Utils.html2text(source)
  95. equal(result, should, source)
  96. source = "<div>Some</div><div>&lt;b&gt;Value&lt;/b&gt;</div>"
  97. should = "Some\n<b>Value</b>"
  98. result = App.Utils.html2text(source)
  99. equal(result, should, source)
  100. source = "<div>&gt; Welcome!</div><div>&gt;</div><div>&gt; Thank you for installing Zammad.</div><div>&gt;</div><div>&gt; You will find ...</div>"
  101. should = "> Welcome!\n>\n> Thank you for installing Zammad.\n>\n> You will find ..."
  102. result = App.Utils.html2text(source)
  103. equal(result, should, source)
  104. source = "<div>test 123 <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>--<br/>Bob Smith</div>"
  105. should = "test 123 \n\n--\nBob Smith"
  106. result = App.Utils.html2text(source)
  107. equal(result, should, source)
  108. source = "test 123 <br><br><br><br><br><br><br><br><br><br><br>--<br>Bob Smith"
  109. should = "test 123 \n\n--\nBob Smith"
  110. result = App.Utils.html2text(source)
  111. equal(result, should, source)
  112. source = "<div>1<br><br><br><br><br><br><br><br><br><br></div><div>Von: Martin Edenhofer via Znuny Support [<a href=\"mailto:support@znuny.inc\" title=\"mailto:support@znuny.inc\" target=\"_blank\">mailto:support@znuny.inc</a>]</div>\n<div>Gesendet: Donnerstag, 2. April 2015 11:32</div>"
  113. should = "1\n\nVon: Martin Edenhofer via Znuny Support [mailto:support@znuny.inc]\nGesendet: Donnerstag, 2. April 2015 11:32"
  114. result = App.Utils.html2text(source)
  115. equal(result, should, source)
  116. source = "<div>test 123<br/>lalala<p>--</p>some test</div>"
  117. should = "test 123\nlalala\n--\nsome test"
  118. result = App.Utils.html2text(source)
  119. equal(result, should, source)
  120. source = "<p><span>Was\nsoll verbessert werden:</span></p>"
  121. should = "Was soll verbessert werden:"
  122. result = App.Utils.html2text(source)
  123. equal(result, should, source)
  124. // in raw format, without cleanup
  125. source = "<div>Some</div><div>1234</div>"
  126. should = "Some\n1234\n"
  127. result = App.Utils.html2text(source, true)
  128. equal(result, should, source)
  129. source = "<div>Some</div><div> 1234</div>"
  130. should = "Some\n 1234\n"
  131. result = App.Utils.html2text(source, true)
  132. equal(result, should, source)
  133. source = "\n\n<div>Some</div>\n<div> 1234</div>"
  134. should = "Some\n 1234\n"
  135. result = App.Utils.html2text(source, true)
  136. equal(result, should, source)
  137. source = "<div>Some</div><div> 1234</div>"
  138. should = "Some\n 1234\n"
  139. result = App.Utils.html2text(source, true)
  140. equal(result, should, source)
  141. source = "<div>Some</div>\n\n<div> 1234</div>\n"
  142. should = "Some\n 1234\n"
  143. result = App.Utils.html2text(source, true)
  144. equal(result, should, source)
  145. source = "<div>test<br>new line<br></div>"
  146. should = "test\nnew line\n\n"
  147. result = App.Utils.html2text(source, true)
  148. equal(result, should, source)
  149. source = "<p><span>Was\nsoll verbessert werden:</span></p>"
  150. should = "Was soll verbessert werden:\n"
  151. result = App.Utils.html2text(source, true)
  152. equal(result, should, source)
  153. });
  154. // linkify
  155. test("linkify", function() {
  156. var source = "http://example.com"
  157. var should = '<a href="http://example.com" title="http://example.com" target="_blank">http://example.com</a>'
  158. var result = App.Utils.linkify(source)
  159. equal(result, should, source)
  160. source = "http://example.com?some_param=lalala"
  161. should = '<a href="http://example.com?some_param=lalala" title="http://example.com?some_param=lalala" target="_blank">http://example.com?some_param=lalala</a>'
  162. result = App.Utils.linkify(source)
  163. equal(result, should, source)
  164. source = "example.com"
  165. should = '<a href="http://example.com" title="http://example.com" target="_blank">example.com</a>'
  166. result = App.Utils.linkify(source)
  167. equal(result, should, source)
  168. source = "some text example.com"
  169. should = 'some text <a href="http://example.com" title="http://example.com" target="_blank">example.com</a>'
  170. result = App.Utils.linkify(source)
  171. equal(result, should, source)
  172. source = "example.com some text"
  173. should = '<a href="http://example.com" title="http://example.com" target="_blank">example.com</a> some text'
  174. result = App.Utils.linkify(source)
  175. equal(result, should, source)
  176. /*
  177. source = "<b>example.com</b>"
  178. should = '<b><a href="http://example.com" title="http://example.com" target="_blank">http://example.com</a></b>'
  179. result = App.Utils.linkify(source)
  180. equal(result, should, source)
  181. */
  182. });
  183. // htmlEscape
  184. test("htmlEscape", function() {
  185. var source = "<"
  186. var should = "&lt;"
  187. var result = App.Utils.htmlEscape(source)
  188. equal(result, should, source)
  189. source = ">"
  190. should = "&gt;"
  191. result = App.Utils.htmlEscape(source)
  192. equal(result, should, source)
  193. source = "&"
  194. should = "&amp;"
  195. result = App.Utils.htmlEscape(source)
  196. equal(result, should, source)
  197. source = "&amp;"
  198. should = "&amp;amp;"
  199. result = App.Utils.htmlEscape(source)
  200. equal(result, should, source)
  201. source = "&amp ;"
  202. should = "&amp;amp ;"
  203. result = App.Utils.htmlEscape(source)
  204. equal(result, should, source)
  205. source = "& amp;"
  206. should = "&amp; amp;"
  207. result = App.Utils.htmlEscape(source)
  208. equal(result, should, source)
  209. source = "'test'"
  210. should = "&#39;test&#39;"
  211. result = App.Utils.htmlEscape(source)
  212. equal(result, should, source)
  213. source = '"test"'
  214. should = "&quot;test&quot;"
  215. result = App.Utils.htmlEscape(source)
  216. equal(result, should, source)
  217. source = "<>"
  218. should = "&lt;&gt;"
  219. result = App.Utils.htmlEscape(source)
  220. equal(result, should, source)
  221. source = "<&lt;>"
  222. should = "&lt;&amp;lt;&gt;"
  223. result = App.Utils.htmlEscape(source)
  224. equal(result, should, source)
  225. });
  226. // htmlRemoveTags
  227. test("htmlRemoveTags", function() {
  228. var source = "<div>test</div>"
  229. //var should = "<div>test</div>"
  230. var should = "test"
  231. var result = App.Utils.htmlRemoveTags($(source))
  232. equal(result.html(), should, source)
  233. source = "<div>test<!-- some comment --></div>"
  234. //should = "<div>test</div>"
  235. should = "test"
  236. result = App.Utils.htmlRemoveTags($(source))
  237. equal(result.html(), should, source)
  238. source = "<a href=\"some_link\">some link to somewhere</a>"
  239. should = "some link to somewhere"
  240. result = App.Utils.htmlRemoveTags($(source))
  241. equal(result.html(), should, source)
  242. source = "<div><a href=\"some_link\">some link to somewhere</a></div>"
  243. //should = "<div>some link to somewhere</div>"
  244. should = "some link to somewhere"
  245. result = App.Utils.htmlRemoveTags($(source))
  246. equal(result.html(), should, source)
  247. source = "<div><a href=\"some_link\">some link to somewhere</a><input value=\"should not be shown\"></div>"
  248. //should = "<div>some link to somewhere</div>"
  249. should = "some link to somewhere"
  250. result = App.Utils.htmlRemoveTags($(source))
  251. equal(result.html(), should, source)
  252. source = "<div><a href=\"some_link\">some link to somewhere</a> <div><hr></div> <span>123</span> <img src=\"some_image\"/></div>"
  253. //should = "<div>some link to somewhere 123 </div>"
  254. should = "some link to somewhere 123 "
  255. result = App.Utils.htmlRemoveTags($(source))
  256. equal(result.html(), should, source)
  257. source = "<div><form class=\"xxx\">test 123</form><svg><use xlink:href=\"assets/images/icons.svg#icon-status\"></svg></div>"
  258. //should = "<div>test 123</div>"
  259. should = "test 123"
  260. result = App.Utils.htmlRemoveRichtext($(source))
  261. equal(result.html(), should, source)
  262. source = "<div><textarea class=\"xxx\">test 123</textarea></div>"
  263. //should = "<div>test 123</div>"
  264. should = "test 123"
  265. result = App.Utils.htmlRemoveRichtext($(source))
  266. equal(result.html(), should, source)
  267. source = "<div><p wrap=\"\">test 123</p></div>"
  268. should = "<p>test 123</p>"
  269. result = App.Utils.htmlRemoveRichtext($(source))
  270. equal(result.html(), should, source)
  271. source = "<div><font size=\"3\" color=\"red\">This is some text!</font></div>"
  272. should = "This is some text!"
  273. result = App.Utils.htmlRemoveRichtext($(source))
  274. equal(result.html(), should, source)
  275. should = "This is some text!"
  276. result = App.Utils.htmlRemoveRichtext(source)
  277. equal(result.html(), should, source)
  278. });
  279. // htmlRemoveRichtext
  280. test("htmlRemoveRichtext", function() {
  281. var source = "<div><!--test comment--><a href=\"test\">test</a></div>"
  282. //var should = "<div>test</div>"
  283. var should = "test"
  284. var result = App.Utils.htmlRemoveRichtext($(source))
  285. equal(result.html(), should, source)
  286. source = "<div><!--[if !supportLists]--><span lang=\"DE\">1.1.1<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><!--[endif]--><span lang=\"DE\">Description</span></div>"
  287. //should = "<div><span>1.1.1<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span>Description</span></div>"
  288. should = "<span>1.1.1<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span>Description</span>"
  289. //should = '1.1.1 Description'
  290. result = App.Utils.htmlRemoveRichtext($(source))
  291. equal(result.html(), should, source)
  292. source = "<a href=\"some_link\">some link to somewhere</a>"
  293. should = "some link to somewhere"
  294. result = App.Utils.htmlRemoveRichtext($(source))
  295. equal(result.html(), should, source)
  296. source = "<div><a href=\"some_link\"></a> test </div>"
  297. //should = "<div> test </div>"
  298. should = " test "
  299. result = App.Utils.htmlRemoveRichtext($(source))
  300. equal(result.html(), should, source)
  301. source = "<div><b></b> test </div>"
  302. //should = "<div> test </div>"
  303. should = " test "
  304. result = App.Utils.htmlRemoveRichtext($(source))
  305. equal(result.html(), should, source)
  306. source = "<div><div><b></b> test </div></div>"
  307. //should = "<div><div> test </div></div>"
  308. should = "<div> test </div>"
  309. result = App.Utils.htmlRemoveRichtext($(source))
  310. equal(result.html(), should, source)
  311. source = "<div><div><b></b> test <input value=\"should not be shown\"></div></div>"
  312. //should = "<div><div> test </div></div>"
  313. should = "<div> test </div>"
  314. result = App.Utils.htmlRemoveRichtext($(source))
  315. equal(result.html(), should, source)
  316. source = "<div><div><b></b> test </div><span>123</span></div>"
  317. //should = "<div><div> test </div><span>123</span></div>"
  318. should = "<div> test </div><span>123</span>"
  319. //should = '<div> test </div>123'
  320. result = App.Utils.htmlRemoveRichtext($(source))
  321. equal(result.html(), should, source)
  322. source = "<div><div class=\"xxx\" title=\"some title\" lang=\"en\"><b></b> test </div></div>"
  323. //should = "<div><div> test </div></div>"
  324. should = "<div> test </div>"
  325. result = App.Utils.htmlRemoveRichtext($(source))
  326. equal(result.html(), should, source)
  327. source = "<div><textarea class=\"xxx\"> test </textarea></div>"
  328. //should = "<div> test </div>"
  329. should = " test "
  330. result = App.Utils.htmlRemoveRichtext($(source))
  331. equal(result.html(), should, source)
  332. source = "<div><br></div>"
  333. //should = "<div><br></div>"
  334. should = "<br>"
  335. result = App.Utils.htmlRemoveRichtext($(source))
  336. equal(result.html(), should, source)
  337. source = "<div><div class=\"xxx\"><br></div></div>"
  338. //should = "<div><div><br></div></div>"
  339. should = "<div><br></div>"
  340. result = App.Utils.htmlRemoveRichtext($(source))
  341. equal(result.html(), should, source)
  342. source = "<div><form class=\"xxx\">test 123</form></div>"
  343. //should = "<div>test 123</div>"
  344. should = "test 123"
  345. result = App.Utils.htmlRemoveRichtext($(source))
  346. equal(result.html(), should, source)
  347. source = "<div><div><label for=\"Ticket_888344_group_id\">Gruppe <span>*</span></label></div><div><div></div></div><div><div><span></span><span></span></div></div><div><div><label for=\"Ticket_888344_owner_id\">Besitzer <span></span></label></div><div><div></div></div></div><div><div><div><svg><use xlink:href=\"http://localhost:3000/assets/images/icons.svg#icon-arrow-down\"></use></svg></div><span></span><span></span></div></div><div><div> <label for=\"Ticket_888344_state_id\">Status <span>*</span></label></div></div></div>\n"
  348. //should = "<div>test 123</div>"
  349. should = '<div>Gruppe <span>*</span></div><div><div></div></div><div><div><span></span><span></span></div></div><div><div>Besitzer <span></span></div><div><div></div></div></div><div><div><div></div><span></span><span></span></div></div><div><div> Status <span>*</span></div></div>'
  350. result = App.Utils.htmlRemoveRichtext(source)
  351. equal(result.html(), should, source)
  352. source = "<div><font size=\"3\" color=\"red\">This is some text!</font><svg><use xlink:href=\"assets/images/icons.svg#icon-status\"></svg></div>"
  353. should = "This is some text!"
  354. result = App.Utils.htmlRemoveRichtext($(source))
  355. equal(result.html(), should, source)
  356. should = "This is some text!"
  357. result = App.Utils.htmlRemoveRichtext(source)
  358. equal(result.html(), should, source)
  359. });
  360. // htmlCleanup
  361. test("htmlCleanup", function() {
  362. var source = "<div><!--test comment--><a href=\"test\">test</a></div>"
  363. //var should = "<div>test</div>"
  364. var should = "test"
  365. var result = App.Utils.htmlCleanup($(source))
  366. equal(result.html(), should, source)
  367. source = "<div><!--test comment--><a href=\"test\">test</a></div>"
  368. should = "test"
  369. result = App.Utils.htmlCleanup(source)
  370. equal(result.html(), should, source)
  371. source = "some link to somewhere"
  372. should = "some link to somewhere"
  373. result = App.Utils.htmlCleanup(source)
  374. equal(result.html(), should, source)
  375. source = "<li>a</li><li>b</li>"
  376. should = "<li>a</li><li>b</li>"
  377. result = App.Utils.htmlCleanup(source)
  378. equal(result.html(), should, source)
  379. source = "<a href=\"some_link\">some link to somewhere</a>"
  380. should = "some link to somewhere"
  381. result = App.Utils.htmlCleanup($(source))
  382. equal(result.html(), should, source)
  383. source = "<div><h1>some link to somewhere</h1></div>"
  384. should = "<h1>some link to somewhere</h1>"
  385. result = App.Utils.htmlCleanup($(source))
  386. equal(result.html(), should, source)
  387. source = "<div><p id=\"123\" data-id=\"abc\">some link to somewhere</p></div>"
  388. should = "<p>some link to somewhere</p>"
  389. result = App.Utils.htmlCleanup($(source))
  390. equal(result.html(), should, source)
  391. source = "<div><small>some link to somewhere</small></a>"
  392. //should = "<div>some link to somewhere</div>"
  393. should = "some link to somewhere"
  394. result = App.Utils.htmlCleanup($(source))
  395. equal(result.html(), should, source)
  396. source = "<div><time>some link to somewhere</time></a>"
  397. //should = "<div>some link to somewhere</div>"
  398. should = "some link to somewhere"
  399. result = App.Utils.htmlCleanup($(source))
  400. equal(result.html(), should, source)
  401. source = "<div><h1>some h1 for somewhere</h1><p><hr></p></div>"
  402. should = "<h1>some h1 for somewhere</h1><p></p><hr><p></p>"
  403. result = App.Utils.htmlCleanup($(source))
  404. equal(result.html(), should, source)
  405. source = "<div><br></div>"
  406. //should = "<div><br></div>"
  407. should = "<br>"
  408. result = App.Utils.htmlCleanup($(source))
  409. equal(result.html(), should, source)
  410. source = "<div><div class=\"xxx\"><br></div></div>"
  411. //should = "<div><div><br></div></div>"
  412. should = "<div><br></div>"
  413. result = App.Utils.htmlCleanup($(source))
  414. equal(result.html(), should, source)
  415. source = "<div><form class=\"xxx\">test 123</form></div>"
  416. //should = "<div>test 123<br></div>"
  417. should = "test 123"
  418. result = App.Utils.htmlCleanup($(source))
  419. equal(result.html(), should, source)
  420. source = "<div><form class=\"xxx\">test 123</form> some other value</div>"
  421. //should = "<div>test 123 some other value</div>"
  422. should = "test 123 some other value"
  423. result = App.Utils.htmlCleanup($(source))
  424. equal(result.html(), should, source)
  425. source = "<div><form class=\"xxx\">test 123</form> some other value<input value=\"should not be shown\"></div>"
  426. //should = "<div>test 123 some other value</div>"
  427. should = "test 123 some other value"
  428. result = App.Utils.htmlCleanup($(source))
  429. equal(result.html(), should, source)
  430. source = "<div><font size=\"3\" color=\"red\">This is some text!</font><svg><use xlink:href=\"assets/images/icons.svg#icon-status\"></svg></div>"
  431. //should = "<div>This is some text!</div>"
  432. should = "This is some text!"
  433. result = App.Utils.htmlCleanup($(source))
  434. equal(result.html(), should, source)
  435. source = "<div><p>some link to somewhere from word<w:sdt>abc</w:sdt></p><o:p></o:p></a>"
  436. //should = "<div><p>some link to somewhere from wordabc</p></div>"
  437. should = '<p>some link to somewhere from wordabc</p>'
  438. result = App.Utils.htmlCleanup($(source))
  439. equal(result.html(), should, source)
  440. source = "<div><div><label for=\"Ticket_888344_group_id\">Gruppe <span>*</span></label></div><div><div></div></div><div><div><span></span><span></span></div></div><div><div><label for=\"Ticket_888344_owner_id\">Besitzer <span></span></label></div><div><div></div></div></div><div><div><div><svg><use xlink:href=\"http://localhost:3000/assets/images/icons.svg#icon-arrow-down\"></use></svg></div><span></span><span></span></div></div><div><div> <label for=\"Ticket_888344_state_id\">Status <span>*</span></label></div></div></div>\n"
  441. //should = "<div>test 123</div>"
  442. should = '<div>Gruppe <span>*</span></div><div><div></div></div><div><div><span></span><span></span></div></div><div><div>Besitzer <span></span></div><div><div></div></div></div><div><div><div></div><span></span><span></span></div></div><div><div> Status <span>*</span></div></div>'
  443. result = App.Utils.htmlCleanup(source)
  444. equal(result.html(), should, source)
  445. source = "<html xmlns:o=\"urn:schemas-microsoft-com:office:office\"\nxmlns:w=\"urn:schemas-microsoft-com:office:word\"\nxmlns:m=\"http://schemas.microsoft.com/office/2004/12/omml\"\nxmlns=\"http://www.w3.org/TR/REC-html40\">\n\n<head>\n<meta name=Titel content=\"\">\n<meta name=Stichwörter content=\"\">\n<meta http-equiv=Content-Type content=\"text/html; charset=utf-8\">\n<meta name=ProgId content=Word.Document>\n<meta name=Generator content=\"Microsoft Word 15\">\n<meta name=Originator content=\"Microsoft Word 15\">\n<link rel=File-List\nhref=\"file://localhost/Users/johannes/Library/Group%20Containers/UBF8T346G9.Office/msoclip1/01/clip_filelist.xml\">\n<!--[if gte mso 9]><xml>\n <o:OfficeDocumentSettings>\n <o:AllowPNG/>\n <o:PixelsPerInch>96</o:PixelsPerInch>\n </o:OfficeDocumentSettings>\n</xml><![endif]-->\n<link rel=themeData\nhref=\"file://localhost/Users/johannes/Library/Group%20Containers/UBF8T346G9.Office/msoclip1/01/clip_themedata.thmx\">\n<!--[if gte mso 9]><xml>\n <w:WordDocument>\n <w:View>Normal</w:View>\n <w:Zoom>0</w:Zoom>\n <w:TrackMoves/>\n <w:TrackFormatting/>\n <w:HyphenationZone>21</w:HyphenationZone>\n <w:PunctuationKerning/>\n <w:ValidateAgainstSchemas/>\n <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>\n <w:IgnoreMixedContent>false</w:IgnoreMixedContent>\n <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>\n <w:DoNotPromoteQF/>\n <w:LidThemeOther>DE</w:LidThemeOther>\n <w:LidThemeAsian>X-NONE</w:LidThemeAsian>\n <w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>\n <w:Compatibility>\n <w:BreakWrappedTables/>\n <w:SnapToGridInCell/>\n <w:WrapTextWithPunct/>\n <w:UseAsianBreakRules/>\n <w:DontGrowAutofit/>\n <w:SplitPgBreakAndParaMark/>\n <w:EnableOpenTypeKerning/>\n <w:DontFlipMirrorIndents/>\n <w:OverrideTableStyleHps/>\n </w:Compatibility>\n <m:mathPr>\n <m:mathFont m:val=\"Cambria Math\"/>\n <m:brkBin m:val=\"before\"/>\n <m:brkBinSub m:val=\"&#45;-\"/>\n <m:smallFrac m:val=\"off\"/>\n <m:dispDef/>\n <m:lMargin m:val=\"0\"/>\n <m:rMargin m:val=\"0\"/>\n <m:defJc m:val=\"centerGroup\"/>\n <m:wrapIndent m:val=\"1440\"/>\n <m:intLim m:val=\"subSup\"/>\n <m:naryLim m:val=\"undOvr\"/>\n </m:mathPr></w:WordDocument>\n</xml><![endif]--><!--[if gte mso 9]><xml>\n <w:LatentStyles DefLockedState=\"false\" DefUnhideWhenUsed=\"false\"\n DefSemiHidden=\"false\" DefQFormat=\"false\" DefPriority=\"99\"\n LatentStyleCount=\"380\">\n <w:LsdException Locked=\"false\" Priority=\"0\" QFormat=\"true\" Name=\"Normal\"/>\n <w:LsdException Locked=\"false\" Priority=\"0\" QFormat=\"true\" Name=\"heading 1\"/>\n <w:LsdException Locked=\"false\" Priority=\"0\" SemiHidden=\"true\"\n UnhideWhenUsed=\"true\" QFormat=\"true\" Name=\"heading 2\"/>\n <w:LsdException Locked=\"false\" Priority=\"0\" SemiHidden=\"true\"\n UnhideWhenUsed=\"true\" QFormat=\"true\" Name=\"heading 3\"/>\n <w:LsdException Locked=\"false\" Priority=\"0\" SemiHidden=\"true\"\n UnhideWhenUsed=\"true\" QFormat=\"true\" Name=\"heading 4\"/>\n <w:LsdException Locked=\"false\" Priority=\"0\" SemiHidden=\"true\"\n UnhideWhenUsed=\"true\" QFormat=\"true\" Name=\"heading 5\"/>\n <w:LsdException Locked=\"false\" Priority=\"9\" SemiHidden=\"true\"\n UnhideWhenUsed=\"true\" QFormat=\"true\" Name=\"heading 6\"/>\n <w:LsdException Locked=\"false\" Priority=\"9\" SemiHidden=\"true\"\n UnhideWhenUsed=\"true\" QFormat=\"true\" Name=\"heading 7\"/>\n <w:LsdException Locked=\"false\" Priority=\"9\" SemiHidden=\"true\"\n UnhideWhenUsed=\"true\" QFormat=\"true\" Name=\"heading 8\"/>\n <w:LsdException Locked=\"false\" Priority=\"9\" SemiHidden=\"true\"\n UnhideWhenUsed=\"true\" QFormat=\"true\" Name=\"heading 9\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"index 1\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"index 2\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"index 3\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"index 4\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"index 5\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"index 6\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"index 7\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"index 8\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"index 9\"/>\n <w:LsdException Locked=\"false\" Priority=\"39\" SemiHidden=\"true\"\n UnhideWhenUsed=\"true\" Name=\"toc 1\"/>\n <w:LsdException Locked=\"false\" Priority=\"39\" SemiHidden=\"true\"\n UnhideWhenUsed=\"true\" Name=\"toc 2\"/>\n <w:LsdException Locked=\"false\" Priority=\"39\" SemiHidden=\"true\"\n UnhideWhenUsed=\"true\" Name=\"toc 3\"/>\n <w:LsdException Locked=\"false\" Priority=\"39\" SemiHidden=\"true\"\n UnhideWhenUsed=\"true\" Name=\"toc 4\"/>\n <w:LsdException Locked=\"false\" Priority=\"39\" SemiHidden=\"true\"\n UnhideWhenUsed=\"true\" Name=\"toc 5\"/>\n <w:LsdException Locked=\"false\" Priority=\"39\" SemiHidden=\"true\"\n UnhideWhenUsed=\"true\" Name=\"toc 6\"/>\n <w:LsdException Locked=\"false\" Priority=\"39\" SemiHidden=\"true\"\n UnhideWhenUsed=\"true\" Name=\"toc 7\"/>\n <w:LsdException Locked=\"false\" Priority=\"39\" SemiHidden=\"true\"\n UnhideWhenUsed=\"true\" Name=\"toc 8\"/>\n <w:LsdException Locked=\"false\" Priority=\"39\" SemiHidden=\"true\"\n UnhideWhenUsed=\"true\" Name=\"toc 9\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Normal Indent\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"footnote text\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"annotation text\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"header\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"footer\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"index heading\"/>\n <w:LsdException Locked=\"false\" Priority=\"35\" SemiHidden=\"true\"\n UnhideWhenUsed=\"true\" QFormat=\"true\" Name=\"caption\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"table of figures\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"envelope address\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"envelope return\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"footnote reference\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"annotation reference\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"line number\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"page number\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"endnote reference\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"endnote text\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"table of authorities\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"macro\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"toa heading\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"List\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"List Bullet\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"List Number\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"List 2\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"List 3\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"List 4\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"List 5\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"List Bullet 2\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"List Bullet 3\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"List Bullet 4\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"List Bullet 5\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"List Number 2\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"List Number 3\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"List Number 4\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"List Number 5\"/>\n <w:LsdException Locked=\"false\" Priority=\"10\" QFormat=\"true\" Name=\"Title\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Closing\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Signature\"/>\n <w:LsdException Locked=\"false\" Priority=\"1\" SemiHidden=\"true\"\n UnhideWhenUsed=\"true\" Name=\"Default Paragraph Font\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Body Text\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Body Text Indent\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"List Continue\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"List Continue 2\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"List Continue 3\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"List Continue 4\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"List Continue 5\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Message Header\"/>\n <w:LsdException Locked=\"false\" Priority=\"11\" QFormat=\"true\" Name=\"Subtitle\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Salutation\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Date\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Body Text First Indent\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Body Text First Indent 2\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Note Heading\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Body Text 2\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Body Text 3\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Body Text Indent 2\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Body Text Indent 3\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Block Text\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Hyperlink\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"FollowedHyperlink\"/>\n <w:LsdException Locked=\"false\" Priority=\"22\" QFormat=\"true\" Name=\"Strong\"/>\n <w:LsdException Locked=\"false\" Priority=\"20\" QFormat=\"true\" Name=\"Emphasis\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Document Map\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Plain Text\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"E-mail Signature\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"HTML Top of Form\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"HTML Bottom of Form\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Normal (Web)\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"HTML Acronym\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"HTML Address\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"HTML Cite\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"HTML Code\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"HTML Definition\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"HTML Keyboard\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"HTML Preformatted\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"HTML Sample\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"HTML Typewriter\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"HTML Variable\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Normal Table\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"annotation subject\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"No List\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Outline List 1\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Outline List 2\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Outline List 3\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Table Simple 1\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Table Simple 2\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Table Simple 3\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Table Classic 1\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Table Classic 2\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Table Classic 3\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Table Classic 4\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Table Colorful 1\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Table Colorful 2\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Table Colorful 3\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Table Columns 1\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Table Columns 2\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Table Columns 3\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Table Columns 4\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Table Columns 5\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Table Grid 1\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Table Grid 2\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Table Grid 3\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Table Grid 4\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Table Grid 5\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Table Grid 6\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Table Grid 7\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Table Grid 8\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Table List 1\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Table List 2\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Table List 3\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Table List 4\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Table List 5\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Table List 6\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Table List 7\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Table List 8\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Table 3D effects 1\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Table 3D effects 2\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Table 3D effects 3\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Table Contemporary\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Table Elegant\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Table Professional\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Table Subtle 1\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Table Subtle 2\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Table Web 1\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Table Web 2\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Table Web 3\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Balloon Text\"/>\n <w:LsdException Locked=\"false\" Priority=\"39\" Name=\"Table Grid\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Table Theme\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Note Level 1\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Note Level 2\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Note Level 3\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Note Level 4\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Note Level 5\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Note Level 6\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Note Level 7\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Note Level 8\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" UnhideWhenUsed=\"true\"\n Name=\"Note Level 9\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" Name=\"Placeholder Text\"/>\n <w:LsdException Locked=\"false\" Priority=\"1\" QFormat=\"true\" Name=\"No Spacing\"/>\n <w:LsdException Locked=\"false\" Priority=\"60\" Name=\"Light Shading\"/>\n <w:LsdException Locked=\"false\" Priority=\"61\" Name=\"Light List\"/>\n <w:LsdException Locked=\"false\" Priority=\"62\" Name=\"Light Grid\"/>\n <w:LsdException Locked=\"false\" Priority=\"63\" Name=\"Medium Shading 1\"/>\n <w:LsdException Locked=\"false\" Priority=\"64\" Name=\"Medium Shading 2\"/>\n <w:LsdException Locked=\"false\" Priority=\"65\" Name=\"Medium List 1\"/>\n <w:LsdException Locked=\"false\" Priority=\"66\" Name=\"Medium List 2\"/>\n <w:LsdException Locked=\"false\" Priority=\"67\" Name=\"Medium Grid 1\"/>\n <w:LsdException Locked=\"false\" Priority=\"68\" Name=\"Medium Grid 2\"/>\n <w:LsdException Locked=\"false\" Priority=\"69\" Name=\"Medium Grid 3\"/>\n <w:LsdException Locked=\"false\" Priority=\"70\" Name=\"Dark List\"/>\n <w:LsdException Locked=\"false\" Priority=\"71\" Name=\"Colorful Shading\"/>\n <w:LsdException Locked=\"false\" Priority=\"72\" Name=\"Colorful List\"/>\n <w:LsdException Locked=\"false\" Priority=\"73\" Name=\"Colorful Grid\"/>\n <w:LsdException Locked=\"false\" Priority=\"60\" Name=\"Light Shading Accent 1\"/>\n <w:LsdException Locked=\"false\" Priority=\"61\" Name=\"Light List Accent 1\"/>\n <w:LsdException Locked=\"false\" Priority=\"62\" Name=\"Light Grid Accent 1\"/>\n <w:LsdException Locked=\"false\" Priority=\"63\" Name=\"Medium Shading 1 Accent 1\"/>\n <w:LsdException Locked=\"false\" Priority=\"64\" Name=\"Medium Shading 2 Accent 1\"/>\n <w:LsdException Locked=\"false\" Priority=\"65\" Name=\"Medium List 1 Accent 1\"/>\n <w:LsdException Locked=\"false\" SemiHidden=\"true\" Name=\"Revision\"/>\n <w:LsdException Locked=\"false\" Priority=\"34\" QFormat=\"true\"\n Name=\"List Paragraph\"/>\n <w:LsdException Locked=\"false\" Priority=\"29\" QFormat=\"true\" Name=\"Quote\"/>\n <w:LsdException Locked=\"false\" Priority=\"30\" QFormat=\"true\"\n Name=\"Intense Quote\"/>\n <w:LsdException Locked=\"false\" Priority=\"66\" Name=\"Medium List 2 Accent 1\"/>\n <w:LsdException Locked=\"false\" Priority=\"67\" Name=\"Medium Grid 1 Accent 1\"/>\n <w:LsdException Locked=\"false\" Priority=\"68\" Name=\"Medium Grid 2 Accent 1\"/>\n <w:LsdException Locked=\"false\" Priority=\"69\" Name=\"Medium Grid 3 Accent 1\"/>\n <w:LsdException Locked=\"false\" Priority=\"70\" Name=\"Dark List Accent 1\"/>\n <w:LsdException Locked=\"false\" Priority=\"71\" Name=\"Colorful Shading Accent 1\"/>\n <w:LsdException Locked=\"false\" Priority=\"72\" Name=\"Colorful List Accent 1\"/>\n <w:LsdException Locked=\"false\" Priority=\"73\" Name=\"Colorful Grid Accent 1\"/>\n <w:LsdException Locked=\"false\" Priority=\"60\" Name=\"Light Shading Accent 2\"/>\n <w:LsdException Locked=\"false\" Priority=\"61\" Name=\"Light List Accent 2\"/>\n <w:LsdException Locked=\"false\" Priority=\"62\" Name=\"Light Grid Accent 2\"/>\n <w:LsdException Locked=\"false\" Priority=\"63\" Name=\"Medium Shading 1 Accent 2\"/>\n <w:LsdException Locked=\"false\" Priority=\"64\" Name=\"Medium Shading 2 Accent 2\"/>\n <w:LsdException Locked=\"false\" Priority=\"65\" Name=\"Medium List 1 Accent 2\"/>\n <w:LsdException Locked=\"false\" Priority=\"66\" Name=\"Medium List 2 Accent 2\"/>\n <w:LsdException Locked=\"false\" Priority=\"67\" Name=\"Medium Grid 1 Accent 2\"/>\n <w:LsdException Locked=\"false\" Priority=\"68\" Name=\"Medium Grid 2 Accent 2\"/>\n <w:LsdException Locked=\"false\" Priority=\"69\" Name=\"Medium Grid 3 Accent 2\"/>\n <w:LsdException Locked=\"false\" Priority=\"70\" Name=\"Dark List Accent 2\"/>\n <w:LsdException Locked=\"false\" Priority=\"71\" Name=\"Colorful Shading Accent 2\"/>\n <w:LsdException Locked=\"false\" Priority=\"72\" Name=\"Colorful List Accent 2\"/>\n <w:LsdException Locked=\"false\" Priority=\"73\" Name=\"Colorful Grid Accent 2\"/>\n <w:LsdException Locked=\"false\" Priority=\"60\" Name=\"Light Shading Accent 3\"/>\n <w:LsdException Locked=\"false\" Priority=\"61\" Name=\"Light List Accent 3\"/>\n <w:LsdException Locked=\"false\" Priority=\"62\" Name=\"Light Grid Accent 3\"/>\n <w:LsdException Locked=\"false\" Priority=\"63\" Name=\"Medium Shading 1 Accent 3\"/>\n <w:LsdException Locked=\"false\" Priority=\"64\" Name=\"Medium Shading 2 Accent 3\"/>\n <w:LsdException Locked=\"false\" Priority=\"65\" Name=\"Medium List 1 Accent 3\"/>\n <w:LsdException Locked=\"false\" Priority=\"66\" Name=\"Medium List 2 Accent 3\"/>\n <w:LsdException Locked=\"false\" Priority=\"67\" Name=\"Medium Grid 1 Accent 3\"/>\n <w:LsdException Locked=\"false\" Priority=\"68\" Name=\"Medium Grid 2 Accent 3\"/>\n <w:LsdException Locked=\"false\" Priority=\"69\" Name=\"Medium Grid 3 Accent 3\"/>\n <w:LsdException Locked=\"false\" Priority=\"70\" Name=\"Dark List Accent 3\"/>\n <w:LsdException Locked=\"false\" Priority=\"71\" Name=\"Colorful Shading Accent 3\"/>\n <w:LsdException Locked=\"false\" Priority=\"72\" Name=\"Colorful List Accent 3\"/>\n <w:LsdException Locked=\"false\" Priority=\"73\" Name=\"Colorful Grid Accent 3\"/>\n <w:LsdException Locked=\"false\" Priority=\"60\" Name=\"Light Shading Accent 4\"/>\n <w:LsdException Locked=\"false\" Priority=\"61\" Name=\"Light List Accent 4\"/>\n <w:LsdException Locked=\"false\" Priority=\"62\" Name=\"Light Grid Accent 4\"/>\n <w:LsdException Locked=\"false\" Priority=\"63\" Name=\"Medium Shading 1 Accent 4\"/>\n <w:LsdException Locked=\"false\" Priority=\"64\" Name=\"Medium Shading 2 Accent 4\"/>\n <w:LsdException Locked=\"false\" Priority=\"65\" Name=\"Medium List 1 Accent 4\"/>\n <w:LsdException Locked=\"false\" Priority=\"66\" Name=\"Medium List 2 Accent 4\"/>\n <w:LsdException Locked=\"false\" Priority=\"67\" Name=\"Medium Grid 1 Accent 4\"/>\n <w:LsdException Locked=\"false\" Priority=\"68\" Name=\"Medium Grid 2 Accent 4\"/>\n <w:LsdException Locked=\"false\" Priority=\"69\" Name=\"Medium Grid 3 Accent 4\"/>\n <w:LsdException Locked=\"false\" Priority=\"70\" Name=\"Dark List Accent 4\"/>\n <w:LsdException Locked=\"false\" Priority=\"71\" Name=\"Colorful Shading Accent 4\"/>\n <w:LsdException Locked=\"false\" Priority=\"72\" Name=\"Colorful List Accent 4\"/>\n <w:LsdException Locked=\"false\" Priority=\"73\" Name=\"Colorful Grid Accent 4\"/>\n <w:LsdException Locked=\"false\" Priority=\"60\" Name=\"Light Shading Accent 5\"/>\n <w:LsdException Locked=\"false\" Priority=\"61\" Name=\"Light List Accent 5\"/>\n <w:LsdException Locked=\"false\" Priority=\"62\" Name=\"Light Grid Accent 5\"/>\n <w:LsdException Locked=\"false\" Priority=\"63\" Name=\"Medium Shading 1 Accent 5\"/>\n <w:LsdException Locked=\"false\" Priority=\"64\" Name=\"Medium Shading 2 Accent 5\"/>\n <w:LsdException Locked=\"false\" Priority=\"65\" Name=\"Medium List 1 Accent 5\"/>\n <w:LsdException Locked=\"false\" Priority=\"66\" Name=\"Medium List 2 Accent 5\"/>\n <w:LsdException Locked=\"false\" Priority=\"67\" Name=\"Medium Grid 1 Accent 5\"/>\n <w:LsdException Locked=\"false\" Priority=\"68\" Name=\"Medium Grid 2 Accent 5\"/>\n <w:LsdException Locked=\"false\" Priority=\"69\" Name=\"Medium Grid 3 Accent 5\"/>\n <w:LsdException Locked=\"false\" Priority=\"70\" Name=\"Dark List Accent 5\"/>\n <w:LsdException Locked=\"false\" Priority=\"71\" Name=\"Colorful Shading Accent 5\"/>\n <w:LsdException Locked=\"false\" Priority=\"72\" Name=\"Colorful List Accent 5\"/>\n <w:LsdException Locked=\"false\" Priority=\"73\" Name=\"Colorful Grid Accent 5\"/>\n <w:LsdException Locked=\"false\" Priority=\"60\" Name=\"Light Shading Accent 6\"/>\n <w:LsdException Locked=\"false\" Priority=\"61\" Name=\"Light List Accent 6\"/>\n <w:LsdException Locked=\"false\" Priority=\"62\" Name=\"Light Grid Accent 6\"/>\n <w:LsdException Locked=\"false\" Priority=\"63\" Name=\"Medium Shading 1 Accent 6\"/>\n <w:LsdException Locked=\"false\" Priority=\"64\" Name=\"Medium Shading 2 Accent 6\"/>\n <w:LsdException Locked=\"false\" Priority=\"65\" Name=\"Medium List 1 Accent 6\"/>\n <w:LsdException Locked=\"false\" Priority=\"66\" Name=\"Medium List 2 Accent 6\"/>\n <w:LsdException Locked=\"false\" Priority=\"67\" Name=\"Medium Grid 1 Accent 6\"/>\n <w:LsdException Locked=\"false\" Priority=\"68\" Name=\"Medium Grid 2 Accent 6\"/>\n <w:LsdException Locked=\"false\" Priority=\"69\" Name=\"Medium Grid 3 Accent 6\"/>\n <w:LsdException Locked=\"false\" Priority=\"70\" Name=\"Dark List Accent 6\"/>\n <w:LsdException Locked=\"false\" Priority=\"71\" Name=\"Colorful Shading Accent 6\"/>\n <w:LsdException Locked=\"false\" Priority=\"72\" Name=\"Colorful List Accent 6\"/>\n <w:LsdException Locked=\"false\" Priority=\"73\" Name=\"Colorful Grid Accent 6\"/>\n <w:LsdException Locked=\"false\" Priority=\"19\" QFormat=\"true\"\n Name=\"Subtle Emphasis\"/>\n <w:LsdException Locked=\"false\" Priority=\"21\" QFormat=\"true\"\n Name=\"Intense Emphasis\"/>\n <w:LsdException Locked=\"false\" Priority=\"31\" QFormat=\"true\"\n Name=\"Subtle Reference\"/>\n <w:LsdException Locked=\"false\" Priority=\"32\" QFormat=\"true\"\n Name=\"Intense Reference\"/>\n <w:LsdException Locked=\"false\" Priority=\"33\" QFormat=\"true\" Name=\"Book Title\"/>\n <w:LsdException Locked=\"false\" Priority=\"37\" SemiHidden=\"true\"\n UnhideWhenUsed=\"true\" Name=\"Bibliography\"/>\n <w:LsdException Locked=\"false\" Priority=\"39\" SemiHidden=\"true\"\n UnhideWhenUsed=\"true\" QFormat=\"true\" Name=\"TOC Heading\"/>\n <w:LsdException Locked=\"false\" Priority=\"41\" Name=\"Plain Table 1\"/>\n <w:LsdException Locked=\"false\" Priority=\"42\" Name=\"Plain Table 2\"/>\n <w:LsdException Locked=\"false\" Priority=\"43\" Name=\"Plain Table 3\"/>\n <w:LsdException Locked=\"false\" Priority=\"44\" Name=\"Plain Table 4\"/>\n <w:LsdException Locked=\"false\" Priority=\"45\" Name=\"Plain Table 5\"/>\n <w:LsdException Locked=\"false\" Priority=\"40\" Name=\"Grid Table Light\"/>\n <w:LsdException Locked=\"false\" Priority=\"46\" Name=\"Grid Table 1 Light\"/>\n <w:LsdException Locked=\"false\" Priority=\"47\" Name=\"Grid Table 2\"/>\n <w:LsdException Locked=\"false\" Priority=\"48\" Name=\"Grid Table 3\"/>\n <w:LsdException Locked=\"false\" Priority=\"49\" Name=\"Grid Table 4\"/>\n <w:LsdException Locked=\"false\" Priority=\"50\" Name=\"Grid Table 5 Dark\"/>\n <w:LsdException Locked=\"false\" Priority=\"51\" Name=\"Grid Table 6 Colorful\"/>\n <w:LsdException Locked=\"false\" Priority=\"52\" Name=\"Grid Table 7 Colorful\"/>\n <w:LsdException Locked=\"false\" Priority=\"46\"\n Name=\"Grid Table 1 Light Accent 1\"/>\n <w:LsdException Locked=\"false\" Priority=\"47\" Name=\"Grid Table 2 Accent 1\"/>\n <w:LsdException Locked=\"false\" Priority=\"48\" Name=\"Grid Table 3 Accent 1\"/>\n <w:LsdException Locked=\"false\" Priority=\"49\" Name=\"Grid Table 4 Accent 1\"/>\n <w:LsdException Locked=\"false\" Priority=\"50\" Name=\"Grid Table 5 Dark Accent 1\"/>\n <w:LsdException Locked=\"false\" Priority=\"51\"\n Name=\"Grid Table 6 Colorful Accent 1\"/>\n <w:LsdException Locked=\"false\" Priority=\"52\"\n Name=\"Grid Table 7 Colorful Accent 1\"/>\n <w:LsdException Locked=\"false\" Priority=\"46\"\n Name=\"Grid Table 1 Light Accent 2\"/>\n <w:LsdException Locked=\"false\" Priority=\"47\" Name=\"Grid Table 2 Accent 2\"/>\n <w:LsdException Locked=\"false\" Priority=\"48\" Name=\"Grid Table 3 Accent 2\"/>\n <w:LsdException Locked=\"false\" Priority=\"49\" Name=\"Grid Table 4 Accent 2\"/>\n <w:LsdException Locked=\"false\" Priority=\"50\" Name=\"Grid Table 5 Dark Accent 2\"/>\n <w:LsdException Locked=\"false\" Priority=\"51\"\n Name=\"Grid Table 6 Colorful Accent 2\"/>\n <w:LsdException Locked=\"false\" Priority=\"52\"\n Name=\"Grid Table 7 Colorful Accent 2\"/>\n <w:LsdException Locked=\"false\" Priority=\"46\"\n Name=\"Grid Table 1 Light Accent 3\"/>\n <w:LsdException Locked=\"false\" Priority=\"47\" Name=\"Grid Table 2 Accent 3\"/>\n <w:LsdException Locked=\"false\" Priority=\"48\" Name=\"Grid Table 3 Accent 3\"/>\n <w:LsdException Locked=\"false\" Priority=\"49\" Name=\"Grid Table 4 Accent 3\"/>\n <w:LsdException Locked=\"false\" Priority=\"50\" Name=\"Grid Table 5 Dark Accent 3\"/>\n <w:LsdException Locked=\"false\" Priority=\"51\"\n Name=\"Grid Table 6 Colorful Accent 3\"/>\n <w:LsdException Locked=\"false\" Priority=\"52\"\n Name=\"Grid Table 7 Colorful Accent 3\"/>\n <w:LsdException Locked=\"false\" Priority=\"46\"\n Name=\"Grid Table 1 Light Accent 4\"/>\n <w:LsdException Locked=\"false\" Priority=\"47\" Name=\"Grid Table 2 Accent 4\"/>\n <w:LsdException Locked=\"false\" Priority=\"48\" Name=\"Grid Table 3 Accent 4\"/>\n <w:LsdException Locked=\"false\" Priority=\"49\" Name=\"Grid Table 4 Accent 4\"/>\n <w:LsdException Locked=\"false\" Priority=\"50\" Name=\"Grid Table 5 Dark Accent 4\"/>\n <w:LsdException Locked=\"false\" Priority=\"51\"\n Name=\"Grid Table 6 Colorful Accent 4\"/>\n <w:LsdException Locked=\"false\" Priority=\"52\"\n Name=\"Grid Table 7 Colorful Accent 4\"/>\n <w:LsdException Locked=\"false\" Priority=\"46\"\n Name=\"Grid Table 1 Light Accent 5\"/>\n <w:LsdException Locked=\"false\" Priority=\"47\" Name=\"Grid Table 2 Accent 5\"/>\n <w:LsdException Locked=\"false\" Priority=\"48\" Name=\"Grid Table 3 Accent 5\"/>\n <w:LsdException Locked=\"false\" Priority=\"49\" Name=\"Grid Table 4 Accent 5\"/>\n <w:LsdException Locked=\"false\" Priority=\"50\" Name=\"Grid Table 5 Dark Accent 5\"/>\n <w:LsdException Locked=\"false\" Priority=\"51\"\n Name=\"Grid Table 6 Colorful Accent 5\"/>\n <w:LsdException Locked=\"false\" Priority=\"52\"\n Name=\"Grid Table 7 Colorful Accent 5\"/>\n <w:LsdException Locked=\"false\" Priority=\"46\"\n Name=\"Grid Table 1 Light Accent 6\"/>\n <w:LsdException Locked=\"false\" Priority=\"47\" Name=\"Grid Table 2 Accent 6\"/>\n <w:LsdException Locked=\"false\" Priority=\"48\" Name=\"Grid Table 3 Accent 6\"/>\n <w:LsdException Locked=\"false\" Priority=\"49\" Name=\"Grid Table 4 Accent 6\"/>\n <w:LsdException Locked=\"false\" Priority=\"50\" Name=\"Grid Table 5 Dark Accent 6\"/>\n <w:LsdException Locked=\"false\" Priority=\"51\"\n Name=\"Grid Table 6 Colorful Accent 6\"/>\n <w:LsdException Locked=\"false\" Priority=\"52\"\n Name=\"Grid Table 7 Colorful Accent 6\"/>\n <w:LsdException Locked=\"false\" Priority=\"46\" Name=\"List Table 1 Light\"/>\n <w:LsdException Locked=\"false\" Priority=\"47\" Name=\"List Table 2\"/>\n <w:LsdException Locked=\"false\" Priority=\"48\" Name=\"List Table 3\"/>\n <w:LsdException Locked=\"false\" Priority=\"49\" Name=\"List Table 4\"/>\n <w:LsdException Locked=\"false\" Priority=\"50\" Name=\"List Table 5 Dark\"/>\n <w:LsdException Locked=\"false\" Priority=\"51\" Name=\"List Table 6 Colorful\"/>\n <w:LsdException Locked=\"false\" Priority=\"52\" Name=\"List Table 7 Colorful\"/>\n <w:LsdException Locked=\"false\" Priority=\"46\"\n Name=\"List Table 1 Light Accent 1\"/>\n <w:LsdException Locked=\"false\" Priority=\"47\" Name=\"List Table 2 Accent 1\"/>\n <w:LsdException Locked=\"false\" Priority=\"48\" Name=\"List Table 3 Accent 1\"/>\n <w:LsdException Locked=\"false\" Priority=\"49\" Name=\"List Table 4 Accent 1\"/>\n <w:LsdException Locked=\"false\" Priority=\"50\" Name=\"List Table 5 Dark Accent 1\"/>\n <w:LsdException Locked=\"false\" Priority=\"51\"\n Name=\"List Table 6 Colorful Accent 1\"/>\n <w:LsdException Locked=\"false\" Priority=\"52\"\n Name=\"List Table 7 Colorful Accent 1\"/>\n <w:LsdException Locked=\"false\" Priority=\"46\"\n Name=\"List Table 1 Light Accent 2\"/>\n <w:LsdException Locked=\"false\" Priority=\"47\" Name=\"List Table 2 Accent 2\"/>\n <w:LsdException Locked=\"false\" Priority=\"48\" Name=\"List Table 3 Accent 2\"/>\n <w:LsdException Locked=\"false\" Priority=\"49\" Name=\"List Table 4 Accent 2\"/>\n <w:LsdException Locked=\"false\" Priority=\"50\" Name=\"List Table 5 Dark Accent 2\"/>\n <w:LsdException Locked=\"false\" Priority=\"51\"\n Name=\"List Table 6 Colorful Accent 2\"/>\n <w:LsdException Locked=\"false\" Priority=\"52\"\n Name=\"List Table 7 Colorful Accent 2\"/>\n <w:LsdException Locked=\"false\" Priority=\"46\"\n Name=\"List Table 1 Light Accent 3\"/>\n <w:LsdException Locked=\"false\" Priority=\"47\" Name=\"List Table 2 Accent 3\"/>\n <w:LsdException Locked=\"false\" Priority=\"48\" Name=\"List Table 3 Accent 3\"/>\n <w:LsdException Locked=\"false\" Priority=\"49\" Name=\"List Table 4 Accent 3\"/>\n <w:LsdException Locked=\"false\" Priority=\"50\" Name=\"List Table 5 Dark Accent 3\"/>\n <w:LsdException Locked=\"false\" Priority=\"51\"\n Name=\"List Table 6 Colorful Accent 3\"/>\n <w:LsdException Locked=\"false\" Priority=\"52\"\n Name=\"List Table 7 Colorful Accent 3\"/>\n <w:LsdException Locked=\"false\" Priority=\"46\"\n Name=\"List Table 1 Light Accent 4\"/>\n <w:LsdException Locked=\"false\" Priority=\"47\" Name=\"List Table 2 Accent 4\"/>\n <w:LsdException Locked=\"false\" Priority=\"48\" Name=\"List Table 3 Accent 4\"/>\n <w:LsdException Locked=\"false\" Priority=\"49\" Name=\"List Table 4 Accent 4\"/>\n <w:LsdException Locked=\"false\" Priority=\"50\" Name=\"List Table 5 Dark Accent 4\"/>\n <w:LsdException Locked=\"false\" Priority=\"51\"\n Name=\"List Table 6 Colorful Accent 4\"/>\n <w:LsdException Locked=\"false\" Priority=\"52\"\n Name=\"List Table 7 Colorful Accent 4\"/>\n <w:LsdException Locked=\"false\" Priority=\"46\"\n Name=\"List Table 1 Light Accent 5\"/>\n <w:LsdException Locked=\"false\" Priority=\"47\" Name=\"List Table 2 Accent 5\"/>\n <w:LsdException Locked=\"false\" Priority=\"48\" Name=\"List Table 3 Accent 5\"/>\n <w:LsdException Locked=\"false\" Priority=\"49\" Name=\"List Table 4 Accent 5\"/>\n <w:LsdException Locked=\"false\" Priority=\"50\" Name=\"List Table 5 Dark Accent 5\"/>\n <w:LsdException Locked=\"false\" Priority=\"51\"\n Name=\"List Table 6 Colorful Accent 5\"/>\n <w:LsdException Locked=\"false\" Priority=\"52\"\n Name=\"List Table 7 Colorful Accent 5\"/>\n <w:LsdException Locked=\"false\" Priority=\"46\"\n Name=\"List Table 1 Light Accent 6\"/>\n <w:LsdException Locked=\"false\" Priority=\"47\" Name=\"List Table 2 Accent 6\"/>\n <w:LsdException Locked=\"false\" Priority=\"48\" Name=\"List Table 3 Accent 6\"/>\n <w:LsdException Locked=\"false\" Priority=\"49\" Name=\"List Table 4 Accent 6\"/>\n <w:LsdException Locked=\"false\" Priority=\"50\" Name=\"List Table 5 Dark Accent 6\"/>\n <w:LsdException Locked=\"false\" Priority=\"51\"\n Name=\"List Table 6 Colorful Accent 6\"/>\n <w:LsdException Locked=\"false\" Priority=\"52\"\n Name=\"List Table 7 Colorful Accent 6\"/>\n </w:LatentStyles>\n</xml><![endif]-->\n<style>\n<!--\n /* Font Definitions */\n@font-face\n {font-family:\"Courier New\";\n panose-1:2 7 3 9 2 2 5 2 4 4;\n mso-font-charset:0;\n mso-generic-font-family:auto;\n mso-font-pitch:variable;\n mso-font-signature:-536859905 -1073711037 9 0 511 0;}\n@font-face\n {font-family:Wingdings;\n panose-1:5 0 0 0 0 0 0 0 0 0;\n mso-font-charset:2;\n mso-generic-font-family:auto;\n mso-font-pitch:variable;\n mso-font-signature:0 268435456 0 0 -2147483648 0;}\n@font-face\n {font-family:\"Cambria Math\";\n panose-1:2 4 5 3 5 4 6 3 2 4;\n mso-font-charset:0;\n mso-generic-font-family:auto;\n mso-font-pitch:variable;\n mso-font-signature:-536870145 1107305727 0 0 415 0;}\n@font-face\n {font-family:Calibri;\n panose-1:2 15 5 2 2 2 4 3 2 4;\n mso-font-charset:0;\n mso-generic-font-family:auto;\n mso-font-pitch:variable;\n mso-font-signature:-536870145 1073786111 1 0 415 0;}\n /* Style Definitions */\np.MsoNormal, li.MsoNormal, div.MsoNormal\n {mso-style-unhide:no;\n mso-style-qformat:yes;\n mso-style-parent:\"\";\n margin:0cm;\n margin-bottom:.0001pt;\n mso-pagination:widow-orphan;\n font-size:12.0pt;\n font-family:Calibri;\n mso-ascii-font-family:Calibri;\n mso-ascii-theme-font:minor-latin;\n mso-fareast-font-family:Calibri;\n mso-fareast-theme-font:minor-latin;\n mso-hansi-font-family:Calibri;\n mso-hansi-theme-font:minor-latin;\n mso-bidi-font-family:\"Times New Roman\";\n mso-bidi-theme-font:minor-bidi;\n mso-fareast-language:EN-US;}\np.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph\n {mso-style-priority:34;\n mso-style-unhide:no;\n mso-style-qformat:yes;\n margin-top:0cm;\n margin-right:0cm;\n margin-bottom:0cm;\n margin-left:36.0pt;\n margin-bottom:.0001pt;\n mso-add-space:auto;\n mso-pagination:widow-orphan;\n font-size:12.0pt;\n font-family:Calibri;\n mso-ascii-font-family:Calibri;\n mso-ascii-theme-font:minor-latin;\n mso-fareast-font-family:Calibri;\n mso-fareast-theme-font:minor-latin;\n mso-hansi-font-family:Calibri;\n mso-hansi-theme-font:minor-latin;\n mso-bidi-font-family:\"Times New Roman\";\n mso-bidi-theme-font:minor-bidi;\n mso-fareast-language:EN-US;}\np.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphCxSpFirst\n {mso-style-priority:34;\n mso-style-unhide:no;\n mso-style-qformat:yes;\n mso-style-type:export-only;\n margin-top:0cm;\n margin-right:0cm;\n margin-bottom:0cm;\n margin-left:36.0pt;\n margin-bottom:.0001pt;\n mso-add-space:auto;\n mso-pagination:widow-orphan;\n font-size:12.0pt;\n font-family:Calibri;\n mso-ascii-font-family:Calibri;\n mso-ascii-theme-font:minor-latin;\n mso-fareast-font-family:Calibri;\n mso-fareast-theme-font:minor-latin;\n mso-hansi-font-family:Calibri;\n mso-hansi-theme-font:minor-latin;\n mso-bidi-font-family:\"Times New Roman\";\n mso-bidi-theme-font:minor-bidi;\n mso-fareast-language:EN-US;}\np.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagraphCxSpMiddle\n {mso-style-priority:34;\n mso-style-unhide:no;\n mso-style-qformat:yes;\n mso-style-type:export-only;\n margin-top:0cm;\n margin-right:0cm;\n margin-bottom:0cm;\n margin-left:36.0pt;\n margin-bottom:.0001pt;\n mso-add-space:auto;\n mso-pagination:widow-orphan;\n font-size:12.0pt;\n font-family:Calibri;\n mso-ascii-font-family:Calibri;\n mso-ascii-theme-font:minor-latin;\n mso-fareast-font-family:Calibri;\n mso-fareast-theme-font:minor-latin;\n mso-hansi-font-family:Calibri;\n mso-hansi-theme-font:minor-latin;\n mso-bidi-font-family:\"Times New Roman\";\n mso-bidi-theme-font:minor-bidi;\n mso-fareast-language:EN-US;}\np.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxSpLast\n {mso-style-priority:34;\n mso-style-unhide:no;\n mso-style-qformat:yes;\n mso-style-type:export-only;\n margin-top:0cm;\n margin-right:0cm;\n margin-bottom:0cm;\n margin-left:36.0pt;\n margin-bottom:.0001pt;\n mso-add-space:auto;\n mso-pagination:widow-orphan;\n font-size:12.0pt;\n font-family:Calibri;\n mso-ascii-font-family:Calibri;\n mso-ascii-theme-font:minor-latin;\n mso-fareast-font-family:Calibri;\n mso-fareast-theme-font:minor-latin;\n mso-hansi-font-family:Calibri;\n mso-hansi-theme-font:minor-latin;\n mso-bidi-font-family:\"Times New Roman\";\n mso-bidi-theme-font:minor-bidi;\n mso-fareast-language:EN-US;}\n.MsoChpDefault\n {mso-style-type:export-only;\n mso-default-props:yes;\n font-family:Calibri;\n mso-ascii-font-family:Calibri;\n mso-ascii-theme-font:minor-latin;\n mso-fareast-font-family:Calibri;\n mso-fareast-theme-font:minor-latin;\n mso-hansi-font-family:Calibri;\n mso-hansi-theme-font:minor-latin;\n mso-bidi-font-family:\"Times New Roman\";\n mso-bidi-theme-font:minor-bidi;\n mso-fareast-language:EN-US;}\n@page WordSection1\n {size:595.0pt 842.0pt;\n margin:70.85pt 70.85pt 2.0cm 70.85pt;\n mso-header-margin:35.4pt;\n mso-footer-margin:35.4pt;\n mso-paper-source:0;}\ndiv.WordSection1\n {page:WordSection1;}\n /* List Definitions */\n@list l0\n {mso-list-id:240799396;\n mso-list-type:hybrid;\n mso-list-template-ids:1377200210 67567617 67567619 67567621 67567617 67567619 67567621 67567617 67567619 67567621;}\n@list l0:level1\n {mso-level-number-format:bullet;\n mso-level-text:;\n mso-level-tab-stop:none;\n mso-level-number-position:left;\n text-indent:-18.0pt;\n font-family:Symbol;}\n@list l0:level2\n {mso-level-number-format:bullet;\n mso-level-text:o;\n mso-level-tab-stop:none;\n mso-level-number-position:left;\n text-indent:-18.0pt;\n font-family:\"Courier New\";}\n@list l0:level3\n {mso-level-number-format:bullet;\n mso-level-text:;\n mso-level-tab-stop:none;\n mso-level-number-position:left;\n text-indent:-18.0pt;\n font-family:Wingdings;}\n@list l0:level4\n {mso-level-number-format:bullet;\n mso-level-text:;\n mso-level-tab-stop:none;\n mso-level-number-position:left;\n text-indent:-18.0pt;\n font-family:Symbol;}\n@list l0:level5\n {mso-level-number-format:bullet;\n mso-level-text:o;\n mso-level-tab-stop:none;\n mso-level-number-position:left;\n text-indent:-18.0pt;\n font-family:\"Courier New\";}\n@list l0:level6\n {mso-level-number-format:bullet;\n mso-level-text:;\n mso-level-tab-stop:none;\n mso-level-number-position:left;\n text-indent:-18.0pt;\n font-family:Wingdings;}\n@list l0:level7\n {mso-level-number-format:bullet;\n mso-level-text:;\n mso-level-tab-stop:none;\n mso-level-number-position:left;\n text-indent:-18.0pt;\n font-family:Symbol;}\n@list l0:level8\n {mso-level-number-format:bullet;\n mso-level-text:o;\n mso-level-tab-stop:none;\n mso-level-number-position:left;\n text-indent:-18.0pt;\n font-family:\"Courier New\";}\n@list l0:level9\n {mso-level-number-format:bullet;\n mso-level-text:;\n mso-level-tab-stop:none;\n mso-level-number-position:left;\n text-indent:-18.0pt;\n font-family:Wingdings;}\nol\n {margin-bottom:0cm;}\nul\n {margin-bottom:0cm;}\n-->\n</style>\n<!--[if gte mso 10]>\n<style>\n /* Style Definitions */\ntable.MsoNormalTable\n {mso-style-name:\"Normale Tabelle\";\n mso-tstyle-rowband-size:0;\n mso-tstyle-colband-size:0;\n mso-style-noshow:yes;\n mso-style-priority:99;\n mso-style-parent:\"\";\n mso-padding-alt:0cm 5.4pt 0cm 5.4pt;\n mso-para-margin:0cm;\n mso-para-margin-bottom:.0001pt;\n mso-pagination:widow-orphan;\n font-size:12.0pt;\n font-family:Calibri;\n mso-ascii-font-family:Calibri;\n mso-ascii-theme-font:minor-latin;\n mso-hansi-font-family:Calibri;\n mso-hansi-theme-font:minor-latin;\n mso-fareast-language:EN-US;}\n</style>\n<![endif]-->\n</head>\n\n<body bgcolor=white lang=DE style='tab-interval:35.4pt'>\n<!--StartFragment-->\n\n<p class=MsoListParagraphCxSpFirst style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><span\nstyle='font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:\nSymbol'><span style='mso-list:Ignore'>·<span style='font:7.0pt \"Times New Roman\"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n</span></span></span><![endif]>Test 1<o:p></o:p></p>\n\n<p class=MsoListParagraphCxSpMiddle style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><span\nstyle='font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:\nSymbol'><span style='mso-list:Ignore'>·<span style='font:7.0pt \"Times New Roman\"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n</span></span></span><![endif]>Test 2<o:p></o:p></p>\n\n<p class=MsoListParagraphCxSpMiddle style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><span\nstyle='font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:\nSymbol'><span style='mso-list:Ignore'>·<span style='font:7.0pt \"Times New Roman\"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n</span></span></span><![endif]><i style='mso-bidi-font-style:normal'>Test 3<o:p></o:p></i></p>\n\n<p class=MsoListParagraphCxSpMiddle style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><span\nstyle='font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:\nSymbol'><span style='mso-list:Ignore'>·<span style='font:7.0pt \"Times New Roman\"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n</span></span></span><![endif]>Test 4<o:p></o:p></p>\n\n<p class=MsoListParagraphCxSpLast style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><span\nstyle='font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:\nSymbol'><span style='mso-list:Ignore'>·<span style='font:7.0pt \"Times New Roman\"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n</span></span></span><![endif]><b style='mso-bidi-font-weight:normal'>Test5<o:p></o:p></b></p>\n\n<!--EndFragment-->\n</body>\n\n</html>"
  446. should = "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<p>· \nTest 1</p>\n\n<p>· \nTest 2</p>\n\n<p>· \n<i>Test 3</i></p>\n\n<p>· \nTest 4</p>\n\n<p>· \n<b>Test5</b></p>\n\n\n\n\n"
  447. result = App.Utils.htmlCleanup(source)
  448. equal(result.html(), should, source)
  449. source = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n<html>\n<head>\n <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\"/>\n <title></title>\n <meta name=\"generator\" content=\"LibreOffice 4.4.7.2 (MacOSX)\"/>\n <style type=\"text/css\">\n @page { margin: 0.79in }\n p { margin-bottom: 0.1in; line-height: 120% }\n a:link { so-language: zxx }\n </style>\n</head>\n<body lang=\"en-US\" dir=\"ltr\">\n<p align=\"center\" style=\"margin-bottom: 0in; line-height: 100%\">1.\nGehe a<b>uf </b><b>https://www.pfe</b>rdiathek.ge</p>\n<p align=\"center\" style=\"margin-bottom: 0in; line-height: 100%\"><br/>\n\n</p>\n<p align=\"center\" style=\"margin-bottom: 0in; line-height: 100%\">2.\nMel<font color=\"#800000\">de Dich mit folgende</font> Zugangsdaten an:</p>\n<p align=\"center\" style=\"margin-bottom: 0in; line-height: 100%\">Benutzer:\nme@xxx.net</p>\n<p align=\"center\" style=\"margin-bottom: 0in; line-height: 100%\">Passwort:\nxxx.</p>\n</body>\n</html>"
  450. should = "\n\n\n \n \n \n \n\n\n<p align=\"center\">1.\nGehe a<b>uf </b><b>https://www.pfe</b>rdiathek.ge</p>\n<p align=\"center\"><br>\n\n</p>\n<p align=\"center\">2.\nMelde Dich mit folgende Zugangsdaten an:</p>\n<p align=\"center\">Benutzer:\nme@xxx.net</p>\n<p align=\"center\">Passwort:\nxxx.</p>\n\n"
  451. result = App.Utils.htmlCleanup(source)
  452. equal(result.html(), should, source)
  453. });
  454. // wrap
  455. test("wrap", function() {
  456. var source = "some text"
  457. var should = 'some text'
  458. var result = App.Utils.wrap(source)
  459. equal(result, should, source)
  460. source = "some text\nsome other text\n"
  461. should = "some text\nsome other text\n"
  462. result = App.Utils.wrap(source)
  463. equal(result, should, source)
  464. source = "some text with some line to wrap"
  465. should = "some text with\nsome line to\nwrap"
  466. result = App.Utils.wrap(source, 14)
  467. equal(result, should, source)
  468. source = "some text\nsome other text\n"
  469. should = "some text\nsome other text\n"
  470. result = App.Utils.wrap(source)
  471. equal(result, should, source)
  472. source = "1234567890 1234567890 1234567890 1234567890"
  473. should = "1234567890 1234567890 1234567890 1234567890"
  474. result = App.Utils.wrap(source)
  475. equal(result, should, source)
  476. source = "123456789012 123456789012 123456789012"
  477. should = "123456789012\n123456789012\n123456789012"
  478. result = App.Utils.wrap(source, 14)
  479. equal(result, should, source)
  480. });
  481. // remove empty lines
  482. test("remove empty lines", function() {
  483. var source = "\ntest 123\n"
  484. var should = "test 123\n"
  485. var result = App.Utils.removeEmptyLines(source)
  486. equal(result, should, source)
  487. source = "\ntest\n\n123\n"
  488. should = "test\n123\n"
  489. result = App.Utils.removeEmptyLines(source)
  490. equal(result, should, source)
  491. });
  492. // quote
  493. test("quote", function() {
  494. var source = "some text"
  495. var should = '> some text'
  496. var result = App.Utils.quote(source)
  497. equal(result, should, source)
  498. source = "some text\nsome other text\n"
  499. should = "> some text\n> some other text"
  500. result = App.Utils.quote(source)
  501. equal(result, should, source)
  502. source = "\n\nsome text\nsome other text\n \n"
  503. should = "> some text\n> some other text"
  504. result = App.Utils.quote(source)
  505. equal(result, should, source)
  506. source = "Welcome!\n\nThank you for installing Zammad.\n\nYou will find ..."
  507. should = "> Welcome!\n>\n> Thank you for installing Zammad.\n>\n> You will find ..."
  508. result = App.Utils.quote(source)
  509. equal(result, should, source)
  510. source = "Welcome! Thank you for installing Zammad. You will find ..."
  511. should = "> Welcome! Thank you\n> for installing\n> Zammad. You will\n> find ..."
  512. result = App.Utils.quote(source, 20)
  513. equal(result, should, source)
  514. });
  515. // check signature
  516. test("check signature", function() {
  517. var message = "<div>test 123 </div>"
  518. var signature = '<div>--<br>Some Signature<br>some department</div>'
  519. var result = App.Utils.signatureCheck(message, signature)
  520. equal(result, true)
  521. message = "<div>test 123 <div>--<br>Some Signature<br>some department\n</div></div>"
  522. signature = '<div>--<br>Some Signature<br>some department</div>'
  523. result = App.Utils.signatureCheck(message, signature)
  524. equal(result, false)
  525. message = "<div>test 123 <div>--<br>Some Signature\n<br>some department\n</div></div>"
  526. signature = '<div>--<br>Some Signature<br>some department</div>'
  527. result = App.Utils.signatureCheck(message, signature)
  528. equal(result, false)
  529. message = "<div>test 123 <div>--<p>Some Signature</p>\n<p><div>some department</div>\n</p>\n</div></div>"
  530. signature = '<div>--<br>Some Signature<br>some department</div>'
  531. result = App.Utils.signatureCheck(message, signature)
  532. equal(result, false)
  533. message = ""
  534. signature = '<div>--<br>Some Signature<br>some department</div>'
  535. result = App.Utils.signatureCheck(message, signature)
  536. equal(result, true)
  537. message = ""
  538. signature = "--\nSome Signature\nsome department"
  539. result = App.Utils.signatureCheck(message, signature)
  540. equal(result, true)
  541. });
  542. // identify signature
  543. test("identify signature", function() {
  544. var message = "<div>test 123 </div>"
  545. var should = '<div>test 123 </div>'
  546. var result = App.Utils.signatureIdentify(message)
  547. equal(result, should)
  548. message = "<div>test 123 <br/>--<br/>Bob Smith</div>"
  549. should = '<div>test 123 <br/>--<br/>Bob Smith</div>'
  550. result = App.Utils.signatureIdentify(message)
  551. equal(result, should)
  552. message = "<div>test 123 <br/>1<br/>2<br/>3<br/>4<br/>5<br/>6<br/>7<br/>8<br/>9<br/><br/>--<br/>Bob Smith</div>"
  553. should = '<div>test 123 <br/>1<br/>2<br/>3<br/>4<br/>5<br/>6<br/>7<br/>8<br/>9<br/><br/><span class="js-signatureMarker"></span>--<br/>Bob Smith</div>'
  554. result = App.Utils.signatureIdentify(message)
  555. equal(result, should)
  556. message = "<div>test 123 <br/><br/>--no not match--<br/>--<br/>Bob Smith</div>"
  557. should = '<div>test 123 <br/><br/>--no not match--<br/><span class="js-signatureMarker"></span>--<br/>Bob Smith</div>'
  558. result = App.Utils.signatureIdentify(message, true)
  559. equal(result, should)
  560. message = "<div>test 123 <br/><br/>--no not match--<br/> -- <br/>Bob Smith</div>"
  561. should = '<div>test 123 <br/><br/>--no not match--<br/><span class="js-signatureMarker"></span> -- <br/>Bob Smith</div>'
  562. result = App.Utils.signatureIdentify(message, true)
  563. equal(result, should)
  564. message = "<div>test 123 <br/><br/>--<br/>Bob Smith<br/><br/><br/><br/><br/>--<br/>Bob Smith</div>"
  565. should = '<div>test 123 <br/><br/><span class="js-signatureMarker"></span>--<br/>Bob Smith<br/><br/><br/><br/><br/>--<br/>Bob Smith</div>'
  566. //should = '<div>test 123 <br><br><br><br><br><br><br><br><br><br><br><span class="js-signatureMarker"></span>--<br>Bob Smith<br/><br/><br/><br/><br/>--<br/>Bob Smith</div>'
  567. result = App.Utils.signatureIdentify(message, true)
  568. equal(result, should)
  569. message = "<div>test 123</div><div>test 123</div><div>--</div><div>Bob Smith</div>"
  570. should = "<div>test 123</div><div>test 123</div><div><span class=\"js-signatureMarker\"></span>--</div><div>Bob Smith</div>"
  571. result = App.Utils.signatureIdentify(message, true)
  572. equal(result, should)
  573. message = "<p><span>test 123</span></p><p><span>test 123</span></p><p><span>--</span></p><p><span>Bob Smith</span></p><div></div>"
  574. should = "<p><span>test 123</span></p><p><span>test 123</span></p><p><span><span class=\"js-signatureMarker\"></span>--</span></p><p><span>Bob Smith</span></p><div></div>"
  575. result = App.Utils.signatureIdentify(message, true)
  576. equal(result, should)
  577. message = "Test reply to zammad<br><br>Am 24.10.2016 18:55 schrieb &quot;Android Support&quot; &lt;android-support@example.com&gt;:<br><br>&gt; <u></u><br>&gt; Sehr geehrte Damen"
  578. should = "Test reply to zammad<br><br><span class=\"js-signatureMarker\"></span>Am 24.10.2016 18:55 schrieb &quot;Android Support&quot; &lt;android-support@example.com&gt;:<br><br>&gt; <u></u><br>&gt; Sehr geehrte Damen"
  579. result = App.Utils.signatureIdentify(message, true)
  580. equal(result, should)
  581. message = "<br>&lt; On 20 Oct 2016, at 12:23, Martin Edenhofer via Zammad Helpdesk wrote:<br>"
  582. should = "<br><span class=\"js-signatureMarker\"></span>&lt; On 20 Oct 2016, at 12:23, Martin Edenhofer via Zammad Helpdesk wrote:<br>"
  583. result = App.Utils.signatureIdentify(message, true)
  584. equal(result, should)
  585. // apple
  586. // en
  587. message = "<div>test 123 <br/><br/>--no not match--<br/><br/>Bob Smith<br/>On 01/04/15 10:55, Bob Smith wrote:<br/>lalala<p>--</p>some test</div>"
  588. should = '<div>test 123 <br/><br/>--no not match--<br/><br/>Bob Smith<br/><span class="js-signatureMarker"></span>On 01/04/15 10:55, Bob Smith wrote:<br/>lalala<p>--</p>some test</div>'
  589. result = App.Utils.signatureIdentify(message, true)
  590. equal(result, should)
  591. // de
  592. message = "<div>test 123 <br/><br/>--no not match--<br/><br/>Bob Smith<br/>Am 03.04.2015 um 20:58 schrieb Bob Smith &lt;bob@example.com&gt;:<br/>lalala</div>"
  593. should = '<div>test 123 <br/><br/>--no not match--<br/><br/>Bob Smith<br/><span class="js-signatureMarker"></span>Am 03.04.2015 um 20:58 schrieb Bob Smith &lt;bob@example.com&gt;:<br/>lalala</div>'
  594. result = App.Utils.signatureIdentify(message, true)
  595. equal(result, should)
  596. // ms
  597. // en
  598. message = "<div>test 123 <br/><br/>--no not match--<br/><br/>Bob Smith<br/>From: Martin Edenhofer via Znuny Support [mailto:support@znuny.inc]<br/>Sent: Donnerstag, 2. April 2015 10:00<br/>lalala</div>"
  599. should = '<div>test 123 <br/><br/>--no not match--<br/><br/>Bob Smith<br/>From: Martin Edenhofer via Znuny Support [mailto:support@znuny.inc]<br/>Sent: Donnerstag, 2. April 2015 10:00<br/>lalala</div>'
  600. result = App.Utils.signatureIdentify(message, true)
  601. equal(result, should)
  602. message = "<div>test 123 <br/><br/>--no not match--<br/><br/>Bob Smith<br/>From: Martin Edenhofer via Znuny Support [mailto:support@znuny.inc]<br/>Sent: Donnerstag, 2. April 2015 10:00<br/>Subject: lalala</div>"
  603. should = '<div>test 123 <br/><br/>--no not match--<br/><br/>Bob Smith<br/><span class="js-signatureMarker"></span>From: Martin Edenhofer via Znuny Support [mailto:support@znuny.inc]<br/>Sent: Donnerstag, 2. April 2015 10:00<br/>Subject: lalala</div>'
  604. result = App.Utils.signatureIdentify(message, true)
  605. equal(result, should)
  606. message = "<div>test 123 <br/><br/>--no not match--<br/><br/>Bob Smith<br/>From: Martin Edenhofer via Znuny Support [mailto:support@znuny.inc]<br/>Sent: Donnerstag, 2. April 2015 10:00<br/>1<br/>2<br/>3<br/>4<br/>4<br/>Subject: lalala</div>"
  607. should = '<div>test 123 <br/><br/>--no not match--<br/><br/>Bob Smith<br/>From: Martin Edenhofer via Znuny Support [mailto:support@znuny.inc]<br/>Sent: Donnerstag, 2. April 2015 10:00<br/>1<br/>2<br/>3<br/>4<br/>4<br/>Subject: lalala</div>'
  608. result = App.Utils.signatureIdentify(message, true)
  609. equal(result, should)
  610. // de
  611. message = "<div>test 123 <br/><br/>--no not match--<br/><br/>Bob Smith<br/>Von: Martin Edenhofer via Znuny Support [mailto:support@znuny.inc]<br/>Gesendet: Donnerstag, 2. April 2015 10:00<br/>Betreff: lalala</div>"
  612. should = '<div>test 123 <br/><br/>--no not match--<br/><br/>Bob Smith<br/><span class="js-signatureMarker"></span>Von: Martin Edenhofer via Znuny Support [mailto:support@znuny.inc]<br/>Gesendet: Donnerstag, 2. April 2015 10:00<br/>Betreff: lalala</div>'
  613. result = App.Utils.signatureIdentify(message, true)
  614. equal(result, should)
  615. message = "<div>1<br><br></div><div>Von: Martin Edenhofer via Znuny Support [<a href=\"mailto:support@znuny.inc\" title=\"mailto:support@znuny.inc\" target=\"_blank\">mailto:support@znuny.inc</a>]</div>\n<div>Gesendet: Donnerstag, 2. April 2015 11:32</div>"
  616. should = "<div>1<br><br></div><div>Von: Martin Edenhofer via Znuny Support [<a href=\"mailto:support@znuny.inc\" title=\"mailto:support@znuny.inc\" target=\"_blank\">mailto:support@znuny.inc</a>]</div>\n<div>Gesendet: Donnerstag, 2. April 2015 11:32</div>"
  617. result = App.Utils.signatureIdentify(message, true)
  618. equal(result, should)
  619. message = "<div>1<br><br></div><div>Von: Martin Edenhofer via Znuny Support [<a href=\"mailto:support@znuny.inc\" title=\"mailto:support@znuny.inc\" target=\"_blank\">mailto:support@znuny.inc</a>]</div>\n<div>Gesendet: Donnerstag, 2. April 2015 11:32</div><div>Betreff: lalala</div>"
  620. should = "<div>1<br><br></div><div><span class=\"js-signatureMarker\"></span>Von: Martin Edenhofer via Znuny Support [<a href=\"mailto:support@znuny.inc\" title=\"mailto:support@znuny.inc\" target=\"_blank\">mailto:support@znuny.inc</a>]</div>\n<div>Gesendet: Donnerstag, 2. April 2015 11:32</div><div>Betreff: lalala</div>"
  621. result = App.Utils.signatureIdentify(message, true)
  622. equal(result, should)
  623. message = "<div>1<br><br></div><div>Von: Martin Edenhofer via Znuny Support &lt;<a href=\"mailto:support@znuny.inc\" title=\"mailto:support@znuny.inc\" target=\"_blank\">mailto:support@znuny.inc</a>&gt;</div>\n<div>An: somebody</div><div>Datum: Donnerstag, 2. April 2015 11:32</div><div>Betreff: lalala</div>"
  624. should = "<div>1<br><br></div><div><span class=\"js-signatureMarker\"></span>Von: Martin Edenhofer via Znuny Support &lt;<a href=\"mailto:support@znuny.inc\" title=\"mailto:support@znuny.inc\" target=\"_blank\">mailto:support@znuny.inc</a>&gt;</div>\n<div>An: somebody</div><div>Datum: Donnerstag, 2. April 2015 11:32</div><div>Betreff: lalala</div>"
  625. result = App.Utils.signatureIdentify(message, true)
  626. equal(result, should)
  627. message = "<div>Von: &quot;Johannes Nickel via Znuny Projects&quot; &lt;<a href=\"mailto:projects@znuny.inc\" title=\"mailto:projects@znuny.inc\">projects@znuny.inc</a>&gt;</div><div>An: \"Lisa Smith\" &lt;<a href=\"mailto:lisa.smith@example.com\" title=\"mailto:lisa.smith@example.com\">lisa.smith@example.com</a>&gt;</div><div>Gesendet: Donnerstag, 2. April 2015 10:11:12</div><div>Betreff: Angebot Redundanz / Paket mit Silver Subscription [Ticket#424242]</div><div><br></div><div>Hallo Frau Smith,</div>"
  628. should = "<div><span class=\"js-signatureMarker\"></span>Von: &quot;Johannes Nickel via Znuny Projects&quot; &lt;<a href=\"mailto:projects@znuny.inc\" title=\"mailto:projects@znuny.inc\">projects@znuny.inc</a>&gt;</div><div>An: \"Lisa Smith\" &lt;<a href=\"mailto:lisa.smith@example.com\" title=\"mailto:lisa.smith@example.com\">lisa.smith@example.com</a>&gt;</div><div>Gesendet: Donnerstag, 2. April 2015 10:11:12</div><div>Betreff: Angebot Redundanz / Paket mit Silver Subscription [Ticket#424242]</div><div><br></div><div>Hallo Frau Smith,</div>"
  629. result = App.Utils.signatureIdentify(message, true)
  630. equal(result, should)
  631. message = "<div>Hi Johannes,</div><div><br></div><div>das Angebot für den halben Tag bitte an uns.</div><div>Der Termin hat sich jetzt auf 10-12 Uhr verschoben, hab ich dir weitergeleitet.</div><div><br></div><div>Viele Grüße</div><div>Max</div><div><br></div><div>&gt; On 07 Oct 2015, at 11:55, Johannes Smith &lt;<a href=mailto:smith@example.com title=mailto:smith@example.com target=_blank>smith@example.com</a> &lt;<a href=mailto:smith@example.com title=mailto:smith@example.com target=_blank>mailto:smith@example.com</a>&gt;&gt; wrote:</div><div>&gt;</div><div>&gt; Hi,</div><div>&gt;</div><div>&gt; OK. Wer kriegt das Angebot? Ist das wirklich nur ein halber Tag?</div></div>"
  632. should = "<div>Hi Johannes,</div><div><br></div><div>das Angebot für den halben Tag bitte an uns.</div><div>Der Termin hat sich jetzt auf 10-12 Uhr verschoben, hab ich dir weitergeleitet.</div><div><br></div><div>Viele Grüße</div><div>Max</div><div><br></div><div><span class=\"js-signatureMarker\"></span>&gt; On 07 Oct 2015, at 11:55, Johannes Smith &lt;<a href=mailto:smith@example.com title=mailto:smith@example.com target=_blank>smith@example.com</a> &lt;<a href=mailto:smith@example.com title=mailto:smith@example.com target=_blank>mailto:smith@example.com</a>&gt;&gt; wrote:</div><div>&gt;</div><div>&gt; Hi,</div><div>&gt;</div><div>&gt; OK. Wer kriegt das Angebot? Ist das wirklich nur ein halber Tag?</div></div>"
  633. result = App.Utils.signatureIdentify(message, true)
  634. equal(result, should)
  635. message = "Dear Mr. Smith,<div><br></div><div>it seems to be, dass Sie den AutoIncrement Nummerngenerator für Ihre ITSMChangeManagement Installation verwenden. Seit ABC 3.2 wird führend vor der sich in der Datei&nbsp;<span style=\"line-height: 1.45; background-color: initial;\">&lt;ABC_CONFIG_Home&gt;/war/log/ITSMChangeCounter.log &nbsp;befindenden Zahl die SystemID (SysConfig) geschrieben. Dies ist ein Standardverhalten, dass auch bei der Ticketnummer verwendet wird.<br><br>Please ask me if you have questions.</span></div><div><span style=\"line-height: 1.45; background-color: initial;\"><br></span></div><div><span style=\"line-height: 1.45; background-color: initial;\">Viele Grüße,</span></div><div><div data-signature=\"true\" data-signature-id=\"1\">&nbsp; Thorsten Smith\n<br>\n<br>--\n<br>Enterprise Services for ABC\n<br>\n<br>Znuny GmbH // Marienstraße 11 // 10117 Berlin // Germany\n<br>\n<br>P: +49 (0) 30 111 111 111-0\n<br>F: +49 (0) 30 111 111 111-8\n<br>W: http://znuny.com \n<br>\n<br>Location: Berlin - HRB 12345678 B Amtsgericht Berlin-Charlottenburg\n<br>Managing Director: Martin Edenhofer\n<br></div></div>"
  636. should = "Dear Mr. Smith,<div><br></div><div>it seems to be, dass Sie den AutoIncrement Nummerngenerator für Ihre ITSMChangeManagement Installation verwenden. Seit ABC 3.2 wird führend vor der sich in der Datei&nbsp;<span style=\"line-height: 1.45; background-color: initial;\">&lt;ABC_CONFIG_Home&gt;/war/log/ITSMChangeCounter.log &nbsp;befindenden Zahl die SystemID (SysConfig) geschrieben. Dies ist ein Standardverhalten, dass auch bei der Ticketnummer verwendet wird.<br><br>Please ask me if you have questions.</span></div><div><span style=\"line-height: 1.45; background-color: initial;\"><br></span></div><div><span style=\"line-height: 1.45; background-color: initial;\">Viele Grüße,</span></div><div><span class=\"js-signatureMarker\"></span><div data-signature=\"true\" data-signature-id=\"1\">&nbsp; Thorsten Smith\n<br>\n<br>--\n<br>Enterprise Services for ABC\n<br>\n<br>Znuny GmbH // Marienstraße 11 // 10117 Berlin // Germany\n<br>\n<br>P: +49 (0) 30 111 111 111-0\n<br>F: +49 (0) 30 111 111 111-8\n<br>W: http://znuny.com \n<br>\n<br>Location: Berlin - HRB 12345678 B Amtsgericht Berlin-Charlottenburg\n<br>Managing Director: Martin Edenhofer\n<br></div></div>"
  637. result = App.Utils.signatureIdentify(message, true, true)
  638. equal(result, should)
  639. message = "Dear Mr. Smith, nice to read you,<div><div data-signature=\"true\" data-signature-id=\"1\">&nbsp; Thorsten Smith\n<br>\n<br>--\n</div></div>"
  640. should = "Dear Mr. Smith, nice to read you,<div><span class=\"js-signatureMarker\"></span><div data-signature=\"true\" data-signature-id=\"1\">&nbsp; Thorsten Smith\n<br>\n<br>--\n</div></div>"
  641. result = App.Utils.signatureIdentify(message, true, true)
  642. equal(result, should)
  643. message = "Dear Mr. Smith, nice to read you,<div><div data-signature=\"true\" data-signature-id=\"9999\">&nbsp; Thorsten Smith\n<br>\n<br>--\n</div></div>"
  644. should = "Dear Mr. Smith, nice to read you,<div><div data-signature=\"true\" data-signature-id=\"9999\">&nbsp; Thorsten Smith\n<br>\n<br>--\n</div></div>"
  645. result = App.Utils.signatureIdentify(message, false, true)
  646. equal(result, should)
  647. // fr
  648. message = "<div>test 123 <br/><br/>--no not match--<br/><br/>Bob Smith<br/>De : Martin Edenhofer via Znuny Support [mailto:support@znuny.inc]<br/>Envoyé : mercredi 29 avril 2015 17:31<br/>Objet : lalala</div>"
  649. should = '<div>test 123 <br/><br/>--no not match--<br/><br/>Bob Smith<br/><span class="js-signatureMarker"></span>De : Martin Edenhofer via Znuny Support [mailto:support@znuny.inc]<br/>Envoyé : mercredi 29 avril 2015 17:31<br/>Objet : lalala</div>'
  650. result = App.Utils.signatureIdentify(message, true)
  651. equal(result, should)
  652. // thunderbird
  653. // de
  654. message = "<div><br></div><div>Viele Grüße,</div><div>Christian</div><div><br></div><div>Am 04.03.2015 um 12:47 schrieb Martin Edenhofer via Znuny Sales:</div><div>&gt; Hallo Christian,</div>"
  655. should = "<div><br></div><div>Viele Grüße,</div><div>Christian</div><div><br></div><div><span class=\"js-signatureMarker\"></span>Am 04.03.2015 um 12:47 schrieb Martin Edenhofer via Znuny Sales:</div><div>&gt; Hallo Christian,</div>"
  656. result = App.Utils.signatureIdentify(message, true)
  657. equal(result, should)
  658. // en - Thunderbird default - http://kb.mozillazine.org/Reply_header_settings
  659. message = "<div><br></div><div>Viele Grüße,</div><div>Christian</div><div><br></div><div>On 01-01-2007 11:00 AM, Alf Aardvark wrote:</div><div>&gt; Hallo Christian,</div>"
  660. should = "<div><br></div><div>Viele Grüße,</div><div>Christian</div><div><br></div><div><span class=\"js-signatureMarker\"></span>On 01-01-2007 11:00 AM, Alf Aardvark wrote:</div><div>&gt; Hallo Christian,</div>"
  661. result = App.Utils.signatureIdentify(message, true)
  662. equal(result, should)
  663. // en - http://kb.mozillazine.org/Reply_header_settings
  664. message = "<div><br></div><div>Viele Grüße,</div><div>Christian</div><div><br></div><div>Alf Aardvark wrote, on 01-01-2007 11:00 AM:</div><div>&gt; Hallo Christian,</div>"
  665. should = "<div><br></div><div>Viele Grüße,</div><div>Christian</div><div><br></div><div><span class=\"js-signatureMarker\"></span>Alf Aardvark wrote, on 01-01-2007 11:00 AM:</div><div>&gt; Hallo Christian,</div>"
  666. result = App.Utils.signatureIdentify(message, true)
  667. equal(result, should)
  668. // otrs
  669. // en
  670. message = "<div>test 123 <br/><br/>--no not match--<br/><br/>Bob Smith<br/>01/04/15 10:55 - Bob Smith wrote:<br/>lalala</div>"
  671. should = '<div>test 123 <br/><br/>--no not match--<br/><br/>Bob Smith<br/><span class="js-signatureMarker"></span>01/04/15 10:55 - Bob Smith wrote:<br/>lalala</div>'
  672. result = App.Utils.signatureIdentify(message, true)
  673. equal(result, should)
  674. // de
  675. message = "<div>test 123 <br/><br/>--no not match--<br/><br/>Bob Smith<br/>01/04/15 10:55 - Bob Smith schrieb:<br/>lalala</div>"
  676. should = '<div>test 123 <br/><br/>--no not match--<br/><br/>Bob Smith<br/><span class="js-signatureMarker"></span>01/04/15 10:55 - Bob Smith schrieb:<br/>lalala</div>'
  677. result = App.Utils.signatureIdentify(message, true)
  678. equal(result, should)
  679. message = "<div>test 123 <br/><br/></div><div>24.02.2015 14:20 - Roy Kaldung via Znuny Sales schrieb: &nbsp;</div>"
  680. should = "<div>test 123 <br/><br/></div><div><span class=\"js-signatureMarker\"></span>24.02.2015 14:20 - Roy Kaldung via Znuny Sales schrieb: &nbsp;</div>"
  681. result = App.Utils.signatureIdentify(message, true)
  682. equal(result, should)
  683. // zammad
  684. message = "<div>test 123 <br/><br/>--no not match--<br/><br/>Bob Smith<br/><div data-signature=\"true\" data-signature-id=\"5\">lalala</div></div>"
  685. should = "<div>test 123 <br/><br/>--no not match--<br/><br/>Bob Smith<br/><span class=\"js-signatureMarker\"></span><div data-signature=\"true\" data-signature-id=\"5\">lalala</div></div>"
  686. result = App.Utils.signatureIdentify(message, true)
  687. equal(result, should)
  688. message = "<div>test 123 <br/><br/>--no not match--<br/><br/>Bob Smith<br/><blockquote type=\"cite\">lalala</blockquote></div>"
  689. should = "<div>test 123 <br/><br/>--no not match--<br/><br/>Bob Smith<br/><span class=\"js-signatureMarker\"></span><blockquote type=\"cite\">lalala</blockquote></div>"
  690. result = App.Utils.signatureIdentify(message, true)
  691. equal(result, should)
  692. // gmail
  693. message = "<div>test 123 <br/><br/>--no not match--<br/><br/>Bob Smith<br/><blockquote class=\"ecxgmail_quote\">lalala</blockquote></div>"
  694. should = "<div>test 123 <br/><br/>--no not match--<br/><br/>Bob Smith<br/><span class=\"js-signatureMarker\"></span><blockquote class=\"ecxgmail_quote\">lalala</blockquote></div>"
  695. result = App.Utils.signatureIdentify(message, true)
  696. equal(result, should)
  697. message = "<div>test 123 <br/><br/>--no not match--<br/><br/>Bob Smith<br/><blockquote class=\"gmail_quote\">lalala</blockquote></div>"
  698. should = "<div>test 123 <br/><br/>--no not match--<br/><br/>Bob Smith<br/><span class=\"js-signatureMarker\"></span><blockquote class=\"gmail_quote\">lalala</blockquote></div>"
  699. result = App.Utils.signatureIdentify(message, true)
  700. equal(result, should)
  701. message = "<div>test 123 <br/><br/>--no not match--<br/><br/>Bob Smith<br/>Am 24. Dezember 2015 um 07:45 schrieb kathrine &lt;kathrine@example.com&gt;:<br/>lalala</div>"
  702. should = "<div>test 123 <br/><br/>--no not match--<br/><br/>Bob Smith<br/><span class=\"js-signatureMarker\"></span>Am 24. Dezember 2015 um 07:45 schrieb kathrine &lt;kathrine@example.com&gt;:<br/>lalala</div>"
  703. result = App.Utils.signatureIdentify(message, true)
  704. equal(result, should)
  705. // word 14
  706. // en
  707. message = "<div>test 123 <br/><br/>--no not match--<br/><br/>Bob Smith<br/>Bob Smith wrote:<br/>lalala</div>"
  708. should = '<div>test 123 <br/><br/>--no not match--<br/><br/>Bob Smith<br/><span class="js-signatureMarker"></span>Bob Smith wrote:<br/>lalala</div>'
  709. result = App.Utils.signatureIdentify(message, true)
  710. equal(result, should)
  711. // de
  712. message = "<div>test 123 <br/><br/>--no not match--<br/><br/>Bob Smith<br/>Bob Smith schrieb:<br/>lalala</div>"
  713. should = '<div>test 123 <br/><br/>--no not match--<br/><br/>Bob Smith<br/><span class="js-signatureMarker"></span>Bob Smith schrieb:<br/>lalala</div>'
  714. result = App.Utils.signatureIdentify(message, true)
  715. equal(result, should)
  716. });
  717. // check attachment references
  718. test("check replace tags", function() {
  719. var message = 'some not existing'
  720. var result = false
  721. var verify = App.Utils.checkAttachmentReference(message)
  722. equal(verify, result)
  723. message = 'some attachment for you'
  724. result = 'Attachment'
  725. verify = App.Utils.checkAttachmentReference(message)
  726. equal(verify, result)
  727. message = 'your attachment.'
  728. result = 'Attachment'
  729. verify = App.Utils.checkAttachmentReference(message)
  730. equal(verify, result)
  731. message = 'some otherattachment for you'
  732. result = false
  733. verify = App.Utils.checkAttachmentReference(message)
  734. equal(verify, result)
  735. message = 'some attachmentother for you'
  736. result = false
  737. verify = App.Utils.checkAttachmentReference(message)
  738. equal(verify, result)
  739. message = 'someattachment'
  740. result = false
  741. verify = App.Utils.checkAttachmentReference(message)
  742. equal(verify, result)
  743. message = 'As enclosed you will find.'
  744. result = 'Enclosed'
  745. verify = App.Utils.checkAttachmentReference(message)
  746. equal(verify, result)
  747. });
  748. // replace tags
  749. test("check replace tags", function() {
  750. var message = "<div>#{user.firstname} #{user.lastname}</div>"
  751. var result = '<div>Bob Smith</div>'
  752. var data = {
  753. user: {
  754. firstname: 'Bob',
  755. lastname: 'Smith',
  756. },
  757. }
  758. var verify = App.Utils.replaceTags(message, data)
  759. equal(verify, result)
  760. message = "<div>#{user.firstname} #{user.lastname}</div>"
  761. result = '<div>Bob Smith</div>'
  762. data = {
  763. user: {
  764. firstname: function() { return 'Bob' },
  765. lastname: function() { return 'Smith' },
  766. },
  767. }
  768. verify = App.Utils.replaceTags(message, data)
  769. equal(verify, result)
  770. message = "<div>#{user.firstname} #{user.lastname}</div>"
  771. result = '<div>Bob -</div>'
  772. data = {
  773. user: {
  774. firstname: 'Bob',
  775. },
  776. }
  777. verify = App.Utils.replaceTags(message, data)
  778. equal(verify, result)
  779. message = "<div>#{user.firstname} #{user.lastname}</div>"
  780. result = '<div>Bob 0</div>'
  781. data = {
  782. user: {
  783. firstname: 'Bob',
  784. lastname: 0,
  785. },
  786. }
  787. verify = App.Utils.replaceTags(message, data)
  788. equal(verify, result)
  789. message = "<div>#{user.firstname} #{user.lastname}</div>"
  790. result = '<div>Bob -</div>'
  791. data = {
  792. user: {
  793. firstname: 'Bob',
  794. lastname: '',
  795. },
  796. }
  797. verify = App.Utils.replaceTags(message, data)
  798. equal(verify, result)
  799. message = "<div>#{user.firstname} #{user.not.existing.test}</div>"
  800. result = '<div>Bob -</div>'
  801. data = {
  802. user: {
  803. firstname: 'Bob',
  804. },
  805. }
  806. verify = App.Utils.replaceTags(message, data)
  807. equal(verify, result)
  808. message = "<div>#{user.firstname} #{not.existing.test}</div>"
  809. result = '<div>Bob -</div>'
  810. data = {
  811. user: {
  812. firstname: 'Bob',
  813. },
  814. }
  815. verify = App.Utils.replaceTags(message, data)
  816. equal(verify, result)
  817. message = "<div>#{user.firstname} #{not.existing.test}</div>"
  818. result = '<div>Bob -</div>'
  819. data = {
  820. user: {
  821. firstname: 'Bob',
  822. not: null,
  823. },
  824. }
  825. verify = App.Utils.replaceTags(message, data)
  826. equal(verify, result)
  827. message = "<div>#{user.firstname} #{not.existing.test}</div>"
  828. result = '<div>Bob -</div>'
  829. data = {
  830. user: {
  831. firstname: 'Bob',
  832. not: {},
  833. },
  834. }
  835. verify = App.Utils.replaceTags(message, data)
  836. equal(verify, result)
  837. });
  838. // check attibute validation
  839. test("check attibute validation", function() {
  840. var string = '123'
  841. var result = '123'
  842. var verify = App.Utils.htmlAttributeCleanup(string)
  843. equal(verify, result, string)
  844. string = '123!'
  845. result = '123'
  846. verify = App.Utils.htmlAttributeCleanup(string)
  847. equal(verify, result, string)
  848. string = '12 3!'
  849. result = '123'
  850. verify = App.Utils.htmlAttributeCleanup(string)
  851. equal(verify, result, string)
  852. string = '12-3!'
  853. result = '12-3'
  854. verify = App.Utils.htmlAttributeCleanup(string)
  855. equal(verify, result, string)
  856. string = '12_3!'
  857. result = '12_3'
  858. verify = App.Utils.htmlAttributeCleanup(string)
  859. equal(verify, result, string)
  860. string = '^12_3!'
  861. result = '12_3'
  862. verify = App.Utils.htmlAttributeCleanup(string)
  863. equal(verify, result, string)
  864. string = '^1\n 2_3!'
  865. result = '12_3'
  866. verify = App.Utils.htmlAttributeCleanup(string)
  867. equal(verify, result, string)
  868. string = 'abc?'
  869. result = 'abc'
  870. verify = App.Utils.htmlAttributeCleanup(string)
  871. equal(verify, result, string)
  872. string = 'abc."'
  873. result = 'abc'
  874. verify = App.Utils.htmlAttributeCleanup(string)
  875. equal(verify, result, string)
  876. string = '#abc!^'
  877. result = 'abc'
  878. verify = App.Utils.htmlAttributeCleanup(string)
  879. equal(verify, result, string)
  880. string = 'abc()=$'
  881. result = 'abc'
  882. verify = App.Utils.htmlAttributeCleanup(string)
  883. equal(verify, result, string)
  884. string = "abc()=$\n123\rß"
  885. result = 'abc123'
  886. verify = App.Utils.htmlAttributeCleanup(string)
  887. equal(verify, result, string)
  888. });
  889. // check form diff
  890. test("check form diff", function() {
  891. var dataNow = {
  892. owner_id: 1,
  893. pending_date: '2015-01-28T09:39:00Z',
  894. }
  895. var dataLast = {
  896. owner_id: '',
  897. pending_date: '2015-01-28T09:39:00Z',
  898. }
  899. var diff = {}
  900. var result = App.Utils.formDiff(dataNow, dataLast)
  901. deepEqual(result, diff, 'check form diff')
  902. dataNow = {
  903. owner_id: '1',
  904. pending_date: '2015-01-28T09:39:00Z',
  905. }
  906. dataLast = {
  907. owner_id: '',
  908. pending_date: '2015-01-28T09:39:00Z',
  909. }
  910. diff = {}
  911. result = App.Utils.formDiff(dataNow, dataLast)
  912. deepEqual(result, diff, 'check form diff')
  913. dataNow = {
  914. pending_date: '2015-01-28T09:39:00Z',
  915. }
  916. dataLast = {
  917. owner_id: 1,
  918. pending_date: '2015-01-28T09:39:00Z',
  919. }
  920. diff = {}
  921. result = App.Utils.formDiff(dataNow, dataLast)
  922. deepEqual(result, diff, 'check form diff')
  923. dataNow = {
  924. owner_id: '',
  925. pending_date: '2015-01-28T09:39:00Z',
  926. }
  927. dataLast = {
  928. pending_date: '2015-01-28T09:39:00Z',
  929. }
  930. diff = {
  931. owner_id: '',
  932. }
  933. result = App.Utils.formDiff(dataNow, dataLast)
  934. deepEqual(result, diff, 'check form diff')
  935. dataNow = {
  936. owner_id: '',
  937. state_ids: [1,5,6,7],
  938. }
  939. dataLast = {}
  940. diff = {
  941. owner_id: '',
  942. state_ids: ['1','5','6','7'],
  943. }
  944. result = App.Utils.formDiff(dataNow, dataLast)
  945. deepEqual(result, diff, 'check form diff')
  946. dataNow = {
  947. owner_id: 1,
  948. state_ids: [1,5,7,6],
  949. }
  950. dataLast = {
  951. owner_id: '',
  952. state_ids: [1,5,6,7],
  953. }
  954. diff = {}
  955. result = App.Utils.formDiff(dataNow, dataLast)
  956. deepEqual(result, diff, 'check form diff')
  957. dataNow = {
  958. owner_id: 1,
  959. state_ids: [1,5,6,7],
  960. }
  961. dataLast = {
  962. state_ids: ['1','5','7'],
  963. }
  964. diff = {
  965. owner_id: '',
  966. state_ids: ['6'],
  967. }
  968. result = App.Utils.formDiff(dataNow, dataLast)
  969. deepEqual(result, diff, 'check form diff')
  970. dataNow = {
  971. owner_id: '',
  972. state_ids: [1,5,6,7],
  973. }
  974. dataLast = {
  975. owner_id: 1,
  976. state_ids: [1,5,6,7],
  977. }
  978. diff = {}
  979. result = App.Utils.formDiff(dataNow, dataLast)
  980. deepEqual(result, diff, 'check form diff')
  981. dataNow = {
  982. owner_id: '',
  983. state_ids: [1,5,6,7],
  984. }
  985. dataLast = {
  986. owner_id: 5,
  987. state_ids: [1,5,6,7],
  988. }
  989. diff = {
  990. owner_id: ''
  991. }
  992. result = App.Utils.formDiff(dataNow, dataLast)
  993. deepEqual(result, diff, 'check form diff')
  994. dataNow = {
  995. state_id: 4,
  996. pending_time: '2015-01-28T11:34:00Z'
  997. }
  998. dataLast = {
  999. state_id: 5,
  1000. pending_time: undefined
  1001. }
  1002. diff = {
  1003. state_id: '4',
  1004. pending_time: '2015-01-28T11:34:00Z'
  1005. }
  1006. result = App.Utils.formDiff(dataNow, dataLast)
  1007. deepEqual(result, diff, 'check form diff')
  1008. dataNow = {
  1009. pending_time: undefined
  1010. }
  1011. dataLast = {
  1012. pending_time: null
  1013. }
  1014. diff = {}
  1015. result = App.Utils.formDiff(dataNow, dataLast)
  1016. deepEqual(result, diff, 'check form diff')
  1017. dataNow = {
  1018. ticket: {
  1019. pending_time: undefined,
  1020. },
  1021. }
  1022. dataLast = {
  1023. ticket: {
  1024. pending_time: null,
  1025. },
  1026. }
  1027. diff = {}
  1028. result = App.Utils.formDiff(dataNow, dataLast)
  1029. deepEqual(result, diff, 'check form diff')
  1030. dataNow = {
  1031. test: '123',
  1032. ticket: {
  1033. pending_time: undefined,
  1034. },
  1035. }
  1036. dataLast = {
  1037. test: '123',
  1038. ticket: {
  1039. pending_time: null,
  1040. },
  1041. }
  1042. diff = {}
  1043. result = App.Utils.formDiff(dataNow, dataLast)
  1044. deepEqual(result, diff, 'check form diff')
  1045. dataNow = {
  1046. test: '123',
  1047. }
  1048. dataLast = {}
  1049. diff = {
  1050. test: '123',
  1051. }
  1052. result = App.Utils.formDiff(dataNow, dataLast)
  1053. deepEqual(result, diff, 'check form diff')
  1054. dataNow = {
  1055. test: '123',
  1056. }
  1057. dataLast = {
  1058. test: [1,2,3,4]
  1059. }
  1060. diff = {
  1061. test: '123',
  1062. }
  1063. result = App.Utils.formDiff(dataNow, dataLast)
  1064. deepEqual(result, diff, 'check form diff')
  1065. dataNow = {
  1066. test: '123',
  1067. }
  1068. dataLast = {
  1069. test: {
  1070. 1: 1,
  1071. 2: 2,
  1072. }
  1073. }
  1074. diff = {
  1075. test: '123',
  1076. }
  1077. result = App.Utils.formDiff(dataNow, dataLast)
  1078. deepEqual(result, diff, 'check form diff')
  1079. dataNow = {
  1080. test: [1,2,3,'4']
  1081. }
  1082. dataLast = {
  1083. test: '123',
  1084. }
  1085. diff = {
  1086. test: ['1','2','3','4']
  1087. }
  1088. result = App.Utils.formDiff(dataNow, dataLast)
  1089. deepEqual(result, diff, 'check form diff')
  1090. dataNow = {
  1091. test: {
  1092. 1: 1,
  1093. 2: 2,
  1094. }
  1095. }
  1096. dataLast = {
  1097. test: '123',
  1098. }
  1099. diff = {
  1100. test: {
  1101. 1: '1',
  1102. 2: '2',
  1103. }
  1104. }
  1105. result = App.Utils.formDiff(dataNow, dataLast)
  1106. deepEqual(result, diff, 'check form diff')
  1107. dataNow = {
  1108. test: '123',
  1109. ticket: {
  1110. pending_time: undefined,
  1111. },
  1112. }
  1113. dataLast = {
  1114. ticket: {
  1115. pending_time: null,
  1116. },
  1117. }
  1118. diff = {
  1119. test: '123',
  1120. }
  1121. result = App.Utils.formDiff(dataNow, dataLast)
  1122. deepEqual(result, diff, 'check form diff')
  1123. dataNow = undefined
  1124. dataLast = undefined
  1125. diff = {}
  1126. result = App.Utils.formDiff(dataNow, dataLast)
  1127. deepEqual(result, diff, 'check form diff')
  1128. dataNow = {}
  1129. dataLast = {"number":"10012","title":"some subject 123äöü","group_id":1,"owner_id":1,"customer_id":2,"state_id":3,"priority_id":2,"article":{"from":"Test Master Agent","to":"","cc":"","body":"dasdad","content_type":"text/html","ticket_id":12,"type_id":9,"sender_id":1,"internal":false,"form_id":"523405147"},"updated_at":"2015-01-29T09:22:23.000Z","pending_time":"2015-01-28T22:22:00.000Z","id":12}
  1130. diff = {}
  1131. result = App.Utils.formDiff(dataNow, dataLast)
  1132. deepEqual(result, diff, 'check form diff')
  1133. // do not compare content of data instances/objects
  1134. no = function test_object() {
  1135. this.a = function() { return 123; }
  1136. this.b = function() { return '1234'; }
  1137. this.c = function() { return [123]; }
  1138. this.d = [1,2,3];
  1139. this.e = 'abc';
  1140. }
  1141. no1 = new no()
  1142. no2 = new no()
  1143. no3 = new no()
  1144. dataNow = {
  1145. number:'10013',
  1146. Article: [no1],
  1147. }
  1148. dataLast = {
  1149. number: "10012",
  1150. title: "some subject 123äöü",
  1151. Article: [ no2, no3 ],
  1152. }
  1153. diff = {
  1154. number:'10013',
  1155. }
  1156. result = App.Utils.formDiff(dataNow, dataLast)
  1157. deepEqual(result, diff, 'check form diff')
  1158. dataNow = {
  1159. number:'10013',
  1160. Article: [no1,2],
  1161. }
  1162. dataLast = {
  1163. number: "10012",
  1164. title: "some subject 123äöü",
  1165. Article: [ no2, no3 ],
  1166. }
  1167. diff = {
  1168. number:'10013',
  1169. Article: ['2'],
  1170. }
  1171. result = App.Utils.formDiff(dataNow, dataLast)
  1172. deepEqual(result, diff, 'check form diff')
  1173. });
  1174. // check decimal format
  1175. test("check decimal format", function() {
  1176. var string = '123'
  1177. var result = '123.00'
  1178. var verify = App.Utils.decimal(string)
  1179. equal(verify, result, string)
  1180. string = '0.6'
  1181. result = '0.60'
  1182. verify = App.Utils.decimal(string)
  1183. equal(verify, result, string)
  1184. string = '6'
  1185. result = '6.00'
  1186. verify = App.Utils.decimal(string)
  1187. equal(verify, result, string)
  1188. string = 6.5
  1189. result = '6.50'
  1190. verify = App.Utils.decimal(string)
  1191. equal(verify, result, string)
  1192. string = '111111.6'
  1193. result = '111111.60'
  1194. verify = App.Utils.decimal(string)
  1195. equal(verify, result, string)
  1196. string = '111111.622'
  1197. result = '111111.62'
  1198. verify = App.Utils.decimal(string)
  1199. equal(verify, result, string)
  1200. string = 'abc.6'
  1201. result = 'abc.6'
  1202. verify = App.Utils.decimal(string)
  1203. equal(verify, result, string)
  1204. string = ''
  1205. result = ''
  1206. verify = App.Utils.decimal(string)
  1207. equal(verify, result, string)
  1208. string = undefined
  1209. result = ''
  1210. verify = App.Utils.decimal(string)
  1211. equal(verify, result, string)
  1212. string = null
  1213. result = ''
  1214. verify = App.Utils.decimal(string)
  1215. equal(verify, result, string)
  1216. });
  1217. // check formatTime format
  1218. test("check formatTime format", function() {
  1219. var string = '123'
  1220. var result = '123'
  1221. var verify = App.Utils.formatTime(string, 0)
  1222. equal(verify, result, string)
  1223. string = '6'
  1224. result = '06'
  1225. verify = App.Utils.formatTime(string, 2)
  1226. equal(verify, result, string)
  1227. string = ''
  1228. result = '00'
  1229. verify = App.Utils.formatTime(string, 2)
  1230. equal(verify, result, string)
  1231. string = undefined
  1232. result = ''
  1233. verify = App.Utils.formatTime(string, 2)
  1234. equal(verify, result, string)
  1235. string = null
  1236. result = ''
  1237. verify = App.Utils.formatTime(string, 2)
  1238. equal(verify, result, string)
  1239. });
  1240. // check diffPosition
  1241. test("check diffPosition format", function() {
  1242. var a = [1,2,3,4]
  1243. var b = [1,2,3,4,5]
  1244. var result = [
  1245. {
  1246. position: 4,
  1247. id: 5,
  1248. },
  1249. ]
  1250. var verify = App.Utils.diffPositionAdd(a, b)
  1251. deepEqual(verify, result)
  1252. a = [2,3,4]
  1253. b = [1,2,3,4]
  1254. result = [
  1255. {
  1256. position: 0,
  1257. id: 1,
  1258. },
  1259. ]
  1260. verify = App.Utils.diffPositionAdd(a, b)
  1261. deepEqual(verify, result)
  1262. a = [2,3,4]
  1263. b = [1,2,3,4,5]
  1264. result = [
  1265. {
  1266. position: 0,
  1267. id: 1,
  1268. },
  1269. {
  1270. position: 4,
  1271. id: 5,
  1272. },
  1273. ]
  1274. verify = App.Utils.diffPositionAdd(a, b)
  1275. deepEqual(verify, result)
  1276. a = [2,3,4]
  1277. b = [1,99,12,2,3,4,5]
  1278. result = [
  1279. {
  1280. position: 0,
  1281. id: 1,
  1282. },
  1283. {
  1284. position: 1,
  1285. id: 99,
  1286. },
  1287. {
  1288. position: 2,
  1289. id: 12,
  1290. },
  1291. {
  1292. position: 6,
  1293. id: 5,
  1294. },
  1295. ]
  1296. verify = App.Utils.diffPositionAdd(a, b)
  1297. deepEqual(verify, result)
  1298. a = [4,3,1]
  1299. b = [1,2,3,4,5]
  1300. result = false
  1301. verify = App.Utils.diffPositionAdd(a, b)
  1302. deepEqual(verify, result)
  1303. a = ['Ticket-347', 'TicketCreateScreen-2217']
  1304. b = ['Ticket-347', 'TicketCreateScreen-2217', 'TicketCreateScreen-71517']
  1305. result = [
  1306. {
  1307. position: 2,
  1308. id: 'TicketCreateScreen-71517',
  1309. },
  1310. ]
  1311. verify = App.Utils.diffPositionAdd(a, b)
  1312. deepEqual(verify, result)
  1313. });
  1314. }