html_utils.js 103 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398
  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. // html2text
  53. test("html2text", function() {
  54. var source = "<div>Some</div><div>Value</div><div><br></div><div>Test</div>"
  55. var should = "Some\nValue\n\nTest"
  56. var result = App.Utils.html2text(source)
  57. equal(result, should, source)
  58. source = "<div>Some</div><div>Value</div>"
  59. should = "Some\nValue"
  60. result = App.Utils.html2text(source)
  61. equal(result, should, source)
  62. source = "<div>Some<br/>Value</div>"
  63. should = "Some\nValue"
  64. result = App.Utils.html2text(source)
  65. equal(result, should, source)
  66. source = "<div>Some</div><div>&lt;b&gt;Value&lt;/b&gt;</div>"
  67. should = "Some\n<b>Value</b>"
  68. result = App.Utils.html2text(source)
  69. equal(result, should, source)
  70. 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>"
  71. should = "> Welcome!\n>\n> Thank you for installing Zammad.\n>\n> You will find ..."
  72. result = App.Utils.html2text(source)
  73. equal(result, should, source)
  74. source = "<div>test 123 <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>--<br/>Bob Smith</div>"
  75. should = "test 123 \n\n--\nBob Smith"
  76. result = App.Utils.html2text(source)
  77. equal(result, should, source)
  78. source = "test 123 <br><br><br><br><br><br><br><br><br><br><br>--<br>Bob Smith"
  79. should = "test 123 \n\n--\nBob Smith"
  80. result = App.Utils.html2text(source)
  81. equal(result, should, source)
  82. 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>"
  83. should = "1\n\nVon: Martin Edenhofer via Znuny Support [mailto:support@znuny.inc]\nGesendet: Donnerstag, 2. April 2015 11:32"
  84. result = App.Utils.html2text(source)
  85. equal(result, should, source)
  86. source = "<div>test 123<br/>lalala<p>--</p>some test</div>"
  87. should = "test 123\nlalala\n--\nsome test"
  88. result = App.Utils.html2text(source)
  89. equal(result, should, source)
  90. source = "<p><span>Was\nsoll verbessert werden:</span></p>"
  91. should = "Was soll verbessert werden:"
  92. result = App.Utils.html2text(source)
  93. equal(result, should, source)
  94. // in raw format, without cleanup
  95. source = "<div>Some</div><div>1234</div>"
  96. should = "Some\n1234\n"
  97. result = App.Utils.html2text(source, true)
  98. equal(result, should, source)
  99. source = "<div>Some</div><div> 1234</div>"
  100. should = "Some\n 1234\n"
  101. result = App.Utils.html2text(source, true)
  102. equal(result, should, source)
  103. source = "\n\n<div>Some</div>\n<div> 1234</div>"
  104. should = "Some\n 1234\n"
  105. result = App.Utils.html2text(source, true)
  106. equal(result, should, source)
  107. source = "<div>Some</div><div> 1234</div>"
  108. should = "Some\n 1234\n"
  109. result = App.Utils.html2text(source, true)
  110. equal(result, should, source)
  111. source = "<div>Some</div>\n\n<div> 1234</div>\n"
  112. should = "Some\n 1234\n"
  113. result = App.Utils.html2text(source, true)
  114. equal(result, should, source)
  115. source = "<div>test<br>new line<br></div>"
  116. should = "test\nnew line\n\n"
  117. result = App.Utils.html2text(source, true)
  118. equal(result, should, source)
  119. source = "<p><span>Was\nsoll verbessert werden:</span></p>"
  120. should = "Was soll verbessert werden:\n"
  121. result = App.Utils.html2text(source, true)
  122. equal(result, should, source)
  123. });
  124. // linkify
  125. test("linkify", function() {
  126. var source = "http://example.com"
  127. var should = '<a href="http://example.com" title="http://example.com" target="_blank">http://example.com</a>'
  128. var result = App.Utils.linkify(source)
  129. equal(result, should, source)
  130. source = "http://example.com?some_param=lalala"
  131. 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>'
  132. result = App.Utils.linkify(source)
  133. equal(result, should, source)
  134. source = "example.com"
  135. should = '<a href="http://example.com" title="http://example.com" target="_blank">example.com</a>'
  136. result = App.Utils.linkify(source)
  137. equal(result, should, source)
  138. source = "some text example.com"
  139. should = 'some text <a href="http://example.com" title="http://example.com" target="_blank">example.com</a>'
  140. result = App.Utils.linkify(source)
  141. equal(result, should, source)
  142. source = "example.com some text"
  143. should = '<a href="http://example.com" title="http://example.com" target="_blank">example.com</a> some text'
  144. result = App.Utils.linkify(source)
  145. equal(result, should, source)
  146. /*
  147. source = "<b>example.com</b>"
  148. should = '<b><a href="http://example.com" title="http://example.com" target="_blank">http://example.com</a></b>'
  149. result = App.Utils.linkify(source)
  150. equal(result, should, source)
  151. */
  152. });
  153. // htmlEscape
  154. test("htmlEscape", function() {
  155. var source = "<"
  156. var should = "&lt;"
  157. var result = App.Utils.htmlEscape(source)
  158. equal(result, should, source)
  159. source = ">"
  160. should = "&gt;"
  161. result = App.Utils.htmlEscape(source)
  162. equal(result, should, source)
  163. source = "&"
  164. should = "&amp;"
  165. result = App.Utils.htmlEscape(source)
  166. equal(result, should, source)
  167. source = "&amp;"
  168. should = "&amp;amp;"
  169. result = App.Utils.htmlEscape(source)
  170. equal(result, should, source)
  171. source = "&amp ;"
  172. should = "&amp;amp ;"
  173. result = App.Utils.htmlEscape(source)
  174. equal(result, should, source)
  175. source = "& amp;"
  176. should = "&amp; amp;"
  177. result = App.Utils.htmlEscape(source)
  178. equal(result, should, source)
  179. source = "'test'"
  180. should = "&#39;test&#39;"
  181. result = App.Utils.htmlEscape(source)
  182. equal(result, should, source)
  183. source = '"test"'
  184. should = "&quot;test&quot;"
  185. result = App.Utils.htmlEscape(source)
  186. equal(result, should, source)
  187. source = "<>"
  188. should = "&lt;&gt;"
  189. result = App.Utils.htmlEscape(source)
  190. equal(result, should, source)
  191. source = "<&lt;>"
  192. should = "&lt;&amp;lt;&gt;"
  193. result = App.Utils.htmlEscape(source)
  194. equal(result, should, source)
  195. });
  196. // htmlRemoveTags
  197. test("htmlRemoveTags", function() {
  198. var source = "<div>test</div>"
  199. //var should = "<div>test</div>"
  200. var should = "test"
  201. var result = App.Utils.htmlRemoveTags($(source))
  202. equal(result.html(), should, source)
  203. source = "<div>test<!-- some comment --></div>"
  204. //should = "<div>test</div>"
  205. should = "test"
  206. result = App.Utils.htmlRemoveTags($(source))
  207. equal(result.html(), should, source)
  208. source = "<a href=\"some_link\">some link to somewhere</a>"
  209. should = "some link to somewhere"
  210. result = App.Utils.htmlRemoveTags($(source))
  211. equal(result.html(), should, source)
  212. source = "<div><a href=\"some_link\">some link to somewhere</a></div>"
  213. //should = "<div>some link to somewhere</div>"
  214. should = "some link to somewhere"
  215. result = App.Utils.htmlRemoveTags($(source))
  216. equal(result.html(), should, source)
  217. source = "<div><a href=\"some_link\">some link to somewhere</a><input value=\"should not be shown\"></div>"
  218. //should = "<div>some link to somewhere</div>"
  219. should = "some link to somewhere"
  220. result = App.Utils.htmlRemoveTags($(source))
  221. equal(result.html(), should, source)
  222. source = "<div><a href=\"some_link\">some link to somewhere</a> <div><hr></div> <span>123</span> <img src=\"some_image\"/></div>"
  223. //should = "<div>some link to somewhere 123 </div>"
  224. should = "some link to somewhere 123 "
  225. result = App.Utils.htmlRemoveTags($(source))
  226. equal(result.html(), should, source)
  227. source = "<div><form class=\"xxx\">test 123</form><svg><use xlink:href=\"assets/images/icons.svg#icon-status\"></svg></div>"
  228. //should = "<div>test 123</div>"
  229. should = "test 123"
  230. result = App.Utils.htmlRemoveRichtext($(source))
  231. equal(result.html(), should, source)
  232. source = "<div><textarea class=\"xxx\">test 123</textarea></div>"
  233. //should = "<div>test 123</div>"
  234. should = "test 123"
  235. result = App.Utils.htmlRemoveRichtext($(source))
  236. equal(result.html(), should, source)
  237. source = "<div><font size=\"3\" color=\"red\">This is some text!</font></div>"
  238. //should = "<div>This is some text!</div>"
  239. should = "This is some text!"
  240. result = App.Utils.htmlRemoveRichtext($(source))
  241. equal(result.html(), should, source)
  242. result = App.Utils.htmlRemoveRichtext(source)
  243. equal(result.html(), should, source)
  244. });
  245. // htmlRemoveRichtext
  246. test("htmlRemoveRichtext", function() {
  247. var source = "<div><!--test comment--><a href=\"test\">test</a></div>"
  248. //var should = "<div>test</div>"
  249. var should = "test"
  250. var result = App.Utils.htmlRemoveRichtext($(source))
  251. equal(result.html(), should, source)
  252. 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>"
  253. //should = "<div><span>1.1.1<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span>Description</span></div>"
  254. should = "<span>1.1.1<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span>Description</span>"
  255. //should = '1.1.1 Description'
  256. result = App.Utils.htmlRemoveRichtext($(source))
  257. equal(result.html(), should, source)
  258. source = "<a href=\"some_link\">some link to somewhere</a>"
  259. should = "some link to somewhere"
  260. result = App.Utils.htmlRemoveRichtext($(source))
  261. equal(result.html(), should, source)
  262. source = "<div><a href=\"some_link\"></a> test </div>"
  263. //should = "<div> test </div>"
  264. should = " test "
  265. result = App.Utils.htmlRemoveRichtext($(source))
  266. equal(result.html(), should, source)
  267. source = "<div><b></b> test </div>"
  268. //should = "<div> test </div>"
  269. should = " test "
  270. result = App.Utils.htmlRemoveRichtext($(source))
  271. equal(result.html(), should, source)
  272. source = "<div><div><b></b> test </div></div>"
  273. //should = "<div><div> test </div></div>"
  274. should = "<div> test </div>"
  275. result = App.Utils.htmlRemoveRichtext($(source))
  276. equal(result.html(), should, source)
  277. source = "<div><div><b></b> test <input value=\"should not be shown\"></div></div>"
  278. //should = "<div><div> test </div></div>"
  279. should = "<div> test </div>"
  280. result = App.Utils.htmlRemoveRichtext($(source))
  281. equal(result.html(), should, source)
  282. source = "<div><div><b></b> test </div><span>123</span></div>"
  283. //should = "<div><div> test </div><span>123</span></div>"
  284. should = "<div> test </div><span>123</span>"
  285. //should = '<div> test </div>123'
  286. result = App.Utils.htmlRemoveRichtext($(source))
  287. equal(result.html(), should, source)
  288. source = "<div><div class=\"xxx\" title=\"some title\" lang=\"en\"><b></b> test </div></div>"
  289. //should = "<div><div> test </div></div>"
  290. should = "<div> test </div>"
  291. result = App.Utils.htmlRemoveRichtext($(source))
  292. equal(result.html(), should, source)
  293. source = "<div><textarea class=\"xxx\"> test </textarea></div>"
  294. //should = "<div> test </div>"
  295. should = " test "
  296. result = App.Utils.htmlRemoveRichtext($(source))
  297. equal(result.html(), should, source)
  298. source = "<div><br></div>"
  299. //should = "<div><br></div>"
  300. should = "<br>"
  301. result = App.Utils.htmlRemoveRichtext($(source))
  302. equal(result.html(), should, source)
  303. source = "<div><div class=\"xxx\"><br></div></div>"
  304. //should = "<div><div><br></div></div>"
  305. should = "<div><br></div>"
  306. result = App.Utils.htmlRemoveRichtext($(source))
  307. equal(result.html(), should, source)
  308. source = "<div><form class=\"xxx\">test 123</form></div>"
  309. //should = "<div>test 123</div>"
  310. should = "test 123"
  311. result = App.Utils.htmlRemoveRichtext($(source))
  312. equal(result.html(), should, source)
  313. 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"
  314. //should = "<div>test 123</div>"
  315. 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>'
  316. result = App.Utils.htmlRemoveRichtext(source)
  317. equal(result.html(), should, source)
  318. source = "<div><font size=\"3\" color=\"red\">This is some text!</font><svg><use xlink:href=\"assets/images/icons.svg#icon-status\"></svg></div>"
  319. //should = "<div>This is some text!</div>"
  320. should = "This is some text!"
  321. result = App.Utils.htmlRemoveRichtext($(source))
  322. equal(result.html(), should, source)
  323. result = App.Utils.htmlRemoveRichtext(source)
  324. equal(result.html(), should, source)
  325. });
  326. // htmlCleanup
  327. test("htmlCleanup", function() {
  328. var source = "<div><!--test comment--><a href=\"test\">test</a></div>"
  329. //var should = "<div>test</div>"
  330. var should = "test"
  331. var result = App.Utils.htmlCleanup($(source))
  332. equal(result.html(), should, source)
  333. source = "<a href=\"some_link\">some link to somewhere</a>"
  334. should = "some link to somewhere"
  335. result = App.Utils.htmlCleanup($(source))
  336. equal(result.html(), should, source)
  337. source = "<div><h1>some link to somewhere</h1></div>"
  338. //should = "<div><div>some link to somewhere</div></div>"
  339. should = "<div>some link to somewhere</div>"
  340. result = App.Utils.htmlCleanup($(source))
  341. equal(result.html(), should, source)
  342. source = "<div><small>some link to somewhere</small></a>"
  343. //should = "<div>some link to somewhere</div>"
  344. should = "some link to somewhere"
  345. result = App.Utils.htmlCleanup($(source))
  346. equal(result.html(), should, source)
  347. source = "<div><time>some link to somewhere</time></a>"
  348. //should = "<div>some link to somewhere</div>"
  349. should = "some link to somewhere"
  350. result = App.Utils.htmlCleanup($(source))
  351. equal(result.html(), should, source)
  352. source = "<div><h1>some h1 for somewhere</h1><p><hr></p></div>"
  353. //should = "<div><div>some h1 for somewhere</div><p></p><p></p></div>"
  354. should = "<div>some h1 for somewhere</div><p></p><p></p>"
  355. //should = '<div>some h1 for somewhere</div>'
  356. result = App.Utils.htmlCleanup($(source))
  357. equal(result.html(), should, source)
  358. source = "<div><br></div>"
  359. //should = "<div><br></div>"
  360. should = "<br>"
  361. result = App.Utils.htmlCleanup($(source))
  362. equal(result.html(), should, source)
  363. source = "<div><div class=\"xxx\"><br></div></div>"
  364. //should = "<div><div><br></div></div>"
  365. should = "<div><br></div>"
  366. result = App.Utils.htmlCleanup($(source))
  367. equal(result.html(), should, source)
  368. source = "<div><form class=\"xxx\">test 123</form></div>"
  369. //should = "<div>test 123<br></div>"
  370. should = "test 123"
  371. result = App.Utils.htmlCleanup($(source))
  372. equal(result.html(), should, source)
  373. source = "<div><form class=\"xxx\">test 123</form> some other value</div>"
  374. //should = "<div>test 123 some other value</div>"
  375. should = "test 123 some other value"
  376. result = App.Utils.htmlCleanup($(source))
  377. equal(result.html(), should, source)
  378. source = "<div><form class=\"xxx\">test 123</form> some other value<input value=\"should not be shown\"></div>"
  379. //should = "<div>test 123 some other value</div>"
  380. should = "test 123 some other value"
  381. result = App.Utils.htmlCleanup($(source))
  382. equal(result.html(), should, source)
  383. source = "<div><font size=\"3\" color=\"red\">This is some text!</font><svg><use xlink:href=\"assets/images/icons.svg#icon-status\"></svg></div>"
  384. //should = "<div>This is some text!</div>"
  385. should = "This is some text!"
  386. result = App.Utils.htmlCleanup($(source))
  387. equal(result.html(), should, source)
  388. source = "<div><p>some link to somewhere from word<w:sdt>abc</w:sdt></p><o:p></o:p></a>"
  389. //should = "<div><p>some link to somewhere from wordabc</p></div>"
  390. should = '<p>some link to somewhere from wordabc</p>'
  391. result = App.Utils.htmlCleanup($(source))
  392. equal(result.html(), should, source)
  393. 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"
  394. //should = "<div>test 123</div>"
  395. 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>'
  396. result = App.Utils.htmlCleanup(source)
  397. equal(result.html(), should, source)
  398. 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>"
  399. 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"
  400. result = App.Utils.htmlCleanup(source)
  401. equal(result.html(), should, source)
  402. 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>"
  403. 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"
  404. result = App.Utils.htmlCleanup(source)
  405. equal(result.html(), should, source)
  406. });
  407. // wrap
  408. test("wrap", function() {
  409. var source = "some text"
  410. var should = 'some text'
  411. var result = App.Utils.wrap(source)
  412. equal(result, should, source)
  413. source = "some text\nsome other text\n"
  414. should = "some text\nsome other text\n"
  415. result = App.Utils.wrap(source)
  416. equal(result, should, source)
  417. source = "some text with some line to wrap"
  418. should = "some text with\nsome line to\nwrap"
  419. result = App.Utils.wrap(source, 14)
  420. equal(result, should, source)
  421. source = "some text\nsome other text\n"
  422. should = "some text\nsome other text\n"
  423. result = App.Utils.wrap(source)
  424. equal(result, should, source)
  425. source = "1234567890 1234567890 1234567890 1234567890"
  426. should = "1234567890 1234567890 1234567890 1234567890"
  427. result = App.Utils.wrap(source)
  428. equal(result, should, source)
  429. source = "123456789012 123456789012 123456789012"
  430. should = "123456789012\n123456789012\n123456789012"
  431. result = App.Utils.wrap(source, 14)
  432. equal(result, should, source)
  433. });
  434. // remove empty lines
  435. test("remove empty lines", function() {
  436. var source = "\ntest 123\n"
  437. var should = "test 123\n"
  438. var result = App.Utils.removeEmptyLines(source)
  439. equal(result, should, source)
  440. source = "\ntest\n\n123\n"
  441. should = "test\n123\n"
  442. result = App.Utils.removeEmptyLines(source)
  443. equal(result, should, source)
  444. });
  445. // quote
  446. test("quote", function() {
  447. var source = "some text"
  448. var should = '> some text'
  449. var result = App.Utils.quote(source)
  450. equal(result, should, source)
  451. source = "some text\nsome other text\n"
  452. should = "> some text\n> some other text"
  453. result = App.Utils.quote(source)
  454. equal(result, should, source)
  455. source = "\n\nsome text\nsome other text\n \n"
  456. should = "> some text\n> some other text"
  457. result = App.Utils.quote(source)
  458. equal(result, should, source)
  459. source = "Welcome!\n\nThank you for installing Zammad.\n\nYou will find ..."
  460. should = "> Welcome!\n>\n> Thank you for installing Zammad.\n>\n> You will find ..."
  461. result = App.Utils.quote(source)
  462. equal(result, should, source)
  463. source = "Welcome! Thank you for installing Zammad. You will find ..."
  464. should = "> Welcome! Thank you\n> for installing\n> Zammad. You will\n> find ..."
  465. result = App.Utils.quote(source, 20)
  466. equal(result, should, source)
  467. });
  468. // check signature
  469. test("check signature", function() {
  470. var message = "<div>test 123 </div>"
  471. var signature = '<div>--<br>Some Signature<br>some department</div>'
  472. var result = App.Utils.signatureCheck(message, signature)
  473. equal(result, true)
  474. message = "<div>test 123 <div>--<br>Some Signature<br>some department\n</div></div>"
  475. signature = '<div>--<br>Some Signature<br>some department</div>'
  476. result = App.Utils.signatureCheck(message, signature)
  477. equal(result, false)
  478. message = "<div>test 123 <div>--<br>Some Signature\n<br>some department\n</div></div>"
  479. signature = '<div>--<br>Some Signature<br>some department</div>'
  480. result = App.Utils.signatureCheck(message, signature)
  481. equal(result, false)
  482. message = "<div>test 123 <div>--<p>Some Signature</p>\n<p><div>some department</div>\n</p>\n</div></div>"
  483. signature = '<div>--<br>Some Signature<br>some department</div>'
  484. result = App.Utils.signatureCheck(message, signature)
  485. equal(result, false)
  486. message = ""
  487. signature = '<div>--<br>Some Signature<br>some department</div>'
  488. result = App.Utils.signatureCheck(message, signature)
  489. equal(result, true)
  490. message = ""
  491. signature = "--\nSome Signature\nsome department"
  492. result = App.Utils.signatureCheck(message, signature)
  493. equal(result, true)
  494. });
  495. // identify signature
  496. test("identify signature", function() {
  497. var message = "<div>test 123 </div>"
  498. var should = '<div>test 123 </div>'
  499. var result = App.Utils.signatureIdentify(message)
  500. equal(result, should)
  501. message = "<div>test 123 <br/>--<br/>Bob Smith</div>"
  502. should = '<div>test 123 <br/>--<br/>Bob Smith</div>'
  503. result = App.Utils.signatureIdentify(message)
  504. equal(result, should)
  505. 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>"
  506. 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>'
  507. result = App.Utils.signatureIdentify(message)
  508. equal(result, should)
  509. message = "<div>test 123 <br/><br/>--no not match--<br/>--<br/>Bob Smith</div>"
  510. should = '<div>test 123 <br/><br/>--no not match--<br/><span class="js-signatureMarker"></span>--<br/>Bob Smith</div>'
  511. result = App.Utils.signatureIdentify(message, true)
  512. equal(result, should)
  513. message = "<div>test 123 <br/><br/>--no not match--<br/> -- <br/>Bob Smith</div>"
  514. should = '<div>test 123 <br/><br/>--no not match--<br/><span class="js-signatureMarker"></span> -- <br/>Bob Smith</div>'
  515. result = App.Utils.signatureIdentify(message, true)
  516. equal(result, should)
  517. message = "<div>test 123 <br/><br/>--<br/>Bob Smith<br/><br/><br/><br/><br/>--<br/>Bob Smith</div>"
  518. should = '<div>test 123 <br/><br/><span class="js-signatureMarker"></span>--<br/>Bob Smith<br/><br/><br/><br/><br/>--<br/>Bob Smith</div>'
  519. //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>'
  520. result = App.Utils.signatureIdentify(message, true)
  521. equal(result, should)
  522. message = "<div>test 123</div><div>test 123</div><div>--</div><div>Bob Smith</div>"
  523. should = "<div>test 123</div><div>test 123</div><div><span class=\"js-signatureMarker\"></span>--</div><div>Bob Smith</div>"
  524. result = App.Utils.signatureIdentify(message, true)
  525. equal(result, should)
  526. 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>"
  527. 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>"
  528. result = App.Utils.signatureIdentify(message, true)
  529. // apple
  530. // en
  531. 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>"
  532. 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>'
  533. result = App.Utils.signatureIdentify(message, true)
  534. equal(result, should)
  535. // de
  536. 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>"
  537. 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>'
  538. result = App.Utils.signatureIdentify(message, true)
  539. equal(result, should)
  540. // ms
  541. // en
  542. 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>"
  543. 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>'
  544. result = App.Utils.signatureIdentify(message, true)
  545. equal(result, should)
  546. 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>"
  547. 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>'
  548. result = App.Utils.signatureIdentify(message, true)
  549. equal(result, should)
  550. 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>"
  551. 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>'
  552. result = App.Utils.signatureIdentify(message, true)
  553. equal(result, should)
  554. // de
  555. 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>"
  556. 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>'
  557. result = App.Utils.signatureIdentify(message, true)
  558. equal(result, should)
  559. 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>"
  560. 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>"
  561. result = App.Utils.signatureIdentify(message, true)
  562. equal(result, should)
  563. 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>"
  564. 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>"
  565. result = App.Utils.signatureIdentify(message, true)
  566. equal(result, should)
  567. 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>"
  568. 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>"
  569. result = App.Utils.signatureIdentify(message, true)
  570. equal(result, should)
  571. 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>"
  572. 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>"
  573. result = App.Utils.signatureIdentify(message, true)
  574. equal(result, should)
  575. 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>"
  576. 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>"
  577. result = App.Utils.signatureIdentify(message, true)
  578. equal(result, should)
  579. 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>"
  580. 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>"
  581. result = App.Utils.signatureIdentify(message, true, true)
  582. equal(result, should)
  583. 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>"
  584. 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>"
  585. result = App.Utils.signatureIdentify(message, true, true)
  586. equal(result, should)
  587. 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>"
  588. 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>"
  589. result = App.Utils.signatureIdentify(message, false, true)
  590. equal(result, should)
  591. // fr
  592. 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>"
  593. 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>'
  594. result = App.Utils.signatureIdentify(message, true)
  595. equal(result, should)
  596. // thunderbird
  597. // de
  598. 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>"
  599. 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>"
  600. result = App.Utils.signatureIdentify(message, true)
  601. equal(result, should)
  602. // en - Thunderbird default - http://kb.mozillazine.org/Reply_header_settings
  603. 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>"
  604. 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>"
  605. result = App.Utils.signatureIdentify(message, true)
  606. equal(result, should)
  607. // en - http://kb.mozillazine.org/Reply_header_settings
  608. 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>"
  609. 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>"
  610. result = App.Utils.signatureIdentify(message, true)
  611. equal(result, should)
  612. // otrs
  613. // en
  614. 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>"
  615. 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>'
  616. result = App.Utils.signatureIdentify(message, true)
  617. equal(result, should)
  618. // de
  619. 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>"
  620. 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>'
  621. result = App.Utils.signatureIdentify(message, true)
  622. equal(result, should)
  623. message = "<div>test 123 <br/><br/></div><div>24.02.2015 14:20 - Roy Kaldung via Znuny Sales schrieb: &nbsp;</div>"
  624. 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>"
  625. result = App.Utils.signatureIdentify(message, true)
  626. equal(result, should)
  627. // zammad
  628. 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>"
  629. 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>"
  630. result = App.Utils.signatureIdentify(message, true)
  631. equal(result, should)
  632. message = "<div>test 123 <br/><br/>--no not match--<br/><br/>Bob Smith<br/><blockquote type=\"cite\">lalala</blockquote></div>"
  633. 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>"
  634. result = App.Utils.signatureIdentify(message, true)
  635. equal(result, should)
  636. // gmail
  637. message = "<div>test 123 <br/><br/>--no not match--<br/><br/>Bob Smith<br/><blockquote class=\"ecxgmail_quote\">lalala</blockquote></div>"
  638. 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>"
  639. result = App.Utils.signatureIdentify(message, true)
  640. equal(result, should)
  641. message = "<div>test 123 <br/><br/>--no not match--<br/><br/>Bob Smith<br/><blockquote class=\"gmail_quote\">lalala</blockquote></div>"
  642. 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>"
  643. result = App.Utils.signatureIdentify(message, true)
  644. equal(result, should)
  645. 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>"
  646. 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>"
  647. result = App.Utils.signatureIdentify(message, true)
  648. equal(result, should)
  649. // word 14
  650. // en
  651. message = "<div>test 123 <br/><br/>--no not match--<br/><br/>Bob Smith<br/>Bob Smith wrote:<br/>lalala</div>"
  652. 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>'
  653. result = App.Utils.signatureIdentify(message, true)
  654. equal(result, should)
  655. // de
  656. message = "<div>test 123 <br/><br/>--no not match--<br/><br/>Bob Smith<br/>Bob Smith schrieb:<br/>lalala</div>"
  657. 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>'
  658. result = App.Utils.signatureIdentify(message, true)
  659. equal(result, should)
  660. });
  661. // replace tags
  662. test("check replace tags", function() {
  663. var message = "<div>#{user.firstname} #{user.lastname}</div>"
  664. var result = '<div>Bob Smith</div>'
  665. var data = {
  666. user: {
  667. firstname: 'Bob',
  668. lastname: 'Smith',
  669. },
  670. }
  671. var verify = App.Utils.replaceTags(message, data)
  672. equal(verify, result)
  673. message = "<div>#{user.firstname} #{user.lastname}</div>"
  674. result = '<div>Bob Smith</div>'
  675. data = {
  676. user: {
  677. firstname: function() { return 'Bob' },
  678. lastname: function() { return 'Smith' },
  679. },
  680. }
  681. verify = App.Utils.replaceTags(message, data)
  682. equal(verify, result)
  683. message = "<div>#{user.firstname} #{user.lastname}</div>"
  684. result = '<div>Bob </div>'
  685. data = {
  686. user: {
  687. firstname: 'Bob',
  688. },
  689. }
  690. verify = App.Utils.replaceTags(message, data)
  691. equal(verify, result)
  692. });
  693. // check if last line is a empty line
  694. test("check if last line is a empty line", function() {
  695. var message = "123"
  696. var result = false
  697. var verify = App.Utils.lastLineEmpty(message)
  698. equal(verify, result, message)
  699. message = "<div>123</div>"
  700. result = false
  701. verify = App.Utils.lastLineEmpty(message)
  702. equal(verify, result, message)
  703. message = "<p><div>123 </div></p>"
  704. result = false
  705. verify = App.Utils.lastLineEmpty(message)
  706. equal(verify, result, message)
  707. message = "<div></div>"
  708. result = true
  709. verify = App.Utils.lastLineEmpty(message)
  710. equal(verify, result, message)
  711. message = "<div class=\"some_class\"></div>"
  712. result = true
  713. verify = App.Utils.lastLineEmpty(message)
  714. equal(verify, result, message)
  715. message = "<div class=\"some_class\"></div> "
  716. result = true
  717. verify = App.Utils.lastLineEmpty(message)
  718. equal(verify, result, message)
  719. message = "<div class=\"some_class\"></div> \n \n\t"
  720. result = true
  721. verify = App.Utils.lastLineEmpty(message)
  722. equal(verify, result, message)
  723. message = "<div class=\"some_class\"> </div> \n \n\t"
  724. result = true
  725. verify = App.Utils.lastLineEmpty(message)
  726. equal(verify, result, message)
  727. message = "<div class=\"some_class\"\n> \n</div> \n \n\t"
  728. result = true
  729. verify = App.Utils.lastLineEmpty(message)
  730. equal(verify, result, message)
  731. });
  732. // check attibute validation
  733. test("check attibute validation", function() {
  734. var string = '123'
  735. var result = '123'
  736. var verify = App.Utils.htmlAttributeCleanup(string)
  737. equal(verify, result, string)
  738. string = '123!'
  739. result = '123'
  740. verify = App.Utils.htmlAttributeCleanup(string)
  741. equal(verify, result, string)
  742. string = '12 3!'
  743. result = '123'
  744. verify = App.Utils.htmlAttributeCleanup(string)
  745. equal(verify, result, string)
  746. string = '12-3!'
  747. result = '12-3'
  748. verify = App.Utils.htmlAttributeCleanup(string)
  749. equal(verify, result, string)
  750. string = '12_3!'
  751. result = '12_3'
  752. verify = App.Utils.htmlAttributeCleanup(string)
  753. equal(verify, result, string)
  754. string = '^12_3!'
  755. result = '12_3'
  756. verify = App.Utils.htmlAttributeCleanup(string)
  757. equal(verify, result, string)
  758. string = '^1\n 2_3!'
  759. result = '12_3'
  760. verify = App.Utils.htmlAttributeCleanup(string)
  761. equal(verify, result, string)
  762. string = 'abc?'
  763. result = 'abc'
  764. verify = App.Utils.htmlAttributeCleanup(string)
  765. equal(verify, result, string)
  766. string = 'abc."'
  767. result = 'abc'
  768. verify = App.Utils.htmlAttributeCleanup(string)
  769. equal(verify, result, string)
  770. string = '#abc!^'
  771. result = 'abc'
  772. verify = App.Utils.htmlAttributeCleanup(string)
  773. equal(verify, result, string)
  774. string = 'abc()=$'
  775. result = 'abc'
  776. verify = App.Utils.htmlAttributeCleanup(string)
  777. equal(verify, result, string)
  778. string = "abc()=$\n123\rß"
  779. result = 'abc123'
  780. verify = App.Utils.htmlAttributeCleanup(string)
  781. equal(verify, result, string)
  782. });
  783. // check form diff
  784. test("check form diff", function() {
  785. var dataNow = {
  786. owner_id: 1,
  787. pending_date: '2015-01-28T09:39:00Z',
  788. }
  789. var dataLast = {
  790. owner_id: '',
  791. pending_date: '2015-01-28T09:39:00Z',
  792. }
  793. var diff = {}
  794. var result = App.Utils.formDiff(dataNow, dataLast)
  795. deepEqual(result, diff, 'check form diff')
  796. dataNow = {
  797. owner_id: '1',
  798. pending_date: '2015-01-28T09:39:00Z',
  799. }
  800. dataLast = {
  801. owner_id: '',
  802. pending_date: '2015-01-28T09:39:00Z',
  803. }
  804. diff = {}
  805. result = App.Utils.formDiff(dataNow, dataLast)
  806. deepEqual(result, diff, 'check form diff')
  807. dataNow = {
  808. pending_date: '2015-01-28T09:39:00Z',
  809. }
  810. dataLast = {
  811. owner_id: 1,
  812. pending_date: '2015-01-28T09:39:00Z',
  813. }
  814. diff = {}
  815. result = App.Utils.formDiff(dataNow, dataLast)
  816. deepEqual(result, diff, 'check form diff')
  817. dataNow = {
  818. owner_id: '',
  819. pending_date: '2015-01-28T09:39:00Z',
  820. }
  821. dataLast = {
  822. pending_date: '2015-01-28T09:39:00Z',
  823. }
  824. diff = {
  825. owner_id: '',
  826. }
  827. result = App.Utils.formDiff(dataNow, dataLast)
  828. deepEqual(result, diff, 'check form diff')
  829. dataNow = {
  830. owner_id: '',
  831. state_ids: [1,5,6,7],
  832. }
  833. dataLast = {}
  834. diff = {
  835. owner_id: '',
  836. state_ids: ['1','5','6','7'],
  837. }
  838. result = App.Utils.formDiff(dataNow, dataLast)
  839. deepEqual(result, diff, 'check form diff')
  840. dataNow = {
  841. owner_id: 1,
  842. state_ids: [1,5,7,6],
  843. }
  844. dataLast = {
  845. owner_id: '',
  846. state_ids: [1,5,6,7],
  847. }
  848. diff = {}
  849. result = App.Utils.formDiff(dataNow, dataLast)
  850. deepEqual(result, diff, 'check form diff')
  851. dataNow = {
  852. owner_id: 1,
  853. state_ids: [1,5,6,7],
  854. }
  855. dataLast = {
  856. state_ids: ['1','5','7'],
  857. }
  858. diff = {
  859. owner_id: '',
  860. state_ids: ['6'],
  861. }
  862. result = App.Utils.formDiff(dataNow, dataLast)
  863. deepEqual(result, diff, 'check form diff')
  864. dataNow = {
  865. owner_id: '',
  866. state_ids: [1,5,6,7],
  867. }
  868. dataLast = {
  869. owner_id: 1,
  870. state_ids: [1,5,6,7],
  871. }
  872. diff = {}
  873. result = App.Utils.formDiff(dataNow, dataLast)
  874. deepEqual(result, diff, 'check form diff')
  875. dataNow = {
  876. owner_id: '',
  877. state_ids: [1,5,6,7],
  878. }
  879. dataLast = {
  880. owner_id: 5,
  881. state_ids: [1,5,6,7],
  882. }
  883. diff = {
  884. owner_id: ''
  885. }
  886. result = App.Utils.formDiff(dataNow, dataLast)
  887. deepEqual(result, diff, 'check form diff')
  888. dataNow = {
  889. state_id: 4,
  890. pending_time: '2015-01-28T11:34:00Z'
  891. }
  892. dataLast = {
  893. state_id: 5,
  894. pending_time: undefined
  895. }
  896. diff = {
  897. state_id: '4',
  898. pending_time: '2015-01-28T11:34:00Z'
  899. }
  900. result = App.Utils.formDiff(dataNow, dataLast)
  901. deepEqual(result, diff, 'check form diff')
  902. dataNow = {
  903. pending_time: undefined
  904. }
  905. dataLast = {
  906. pending_time: null
  907. }
  908. diff = {}
  909. result = App.Utils.formDiff(dataNow, dataLast)
  910. deepEqual(result, diff, 'check form diff')
  911. dataNow = {
  912. ticket: {
  913. pending_time: undefined,
  914. },
  915. }
  916. dataLast = {
  917. ticket: {
  918. pending_time: null,
  919. },
  920. }
  921. diff = {}
  922. result = App.Utils.formDiff(dataNow, dataLast)
  923. deepEqual(result, diff, 'check form diff')
  924. dataNow = {
  925. test: '123',
  926. ticket: {
  927. pending_time: undefined,
  928. },
  929. }
  930. dataLast = {
  931. test: '123',
  932. ticket: {
  933. pending_time: null,
  934. },
  935. }
  936. diff = {}
  937. result = App.Utils.formDiff(dataNow, dataLast)
  938. deepEqual(result, diff, 'check form diff')
  939. dataNow = {
  940. test: '123',
  941. }
  942. dataLast = {}
  943. diff = {
  944. test: '123',
  945. }
  946. result = App.Utils.formDiff(dataNow, dataLast)
  947. deepEqual(result, diff, 'check form diff')
  948. dataNow = {
  949. test: '123',
  950. }
  951. dataLast = {
  952. test: [1,2,3,4]
  953. }
  954. diff = {
  955. test: '123',
  956. }
  957. result = App.Utils.formDiff(dataNow, dataLast)
  958. deepEqual(result, diff, 'check form diff')
  959. dataNow = {
  960. test: '123',
  961. }
  962. dataLast = {
  963. test: {
  964. 1: 1,
  965. 2: 2,
  966. }
  967. }
  968. diff = {
  969. test: '123',
  970. }
  971. result = App.Utils.formDiff(dataNow, dataLast)
  972. deepEqual(result, diff, 'check form diff')
  973. dataNow = {
  974. test: [1,2,3,'4']
  975. }
  976. dataLast = {
  977. test: '123',
  978. }
  979. diff = {
  980. test: ['1','2','3','4']
  981. }
  982. result = App.Utils.formDiff(dataNow, dataLast)
  983. deepEqual(result, diff, 'check form diff')
  984. dataNow = {
  985. test: {
  986. 1: 1,
  987. 2: 2,
  988. }
  989. }
  990. dataLast = {
  991. test: '123',
  992. }
  993. diff = {
  994. test: {
  995. 1: '1',
  996. 2: '2',
  997. }
  998. }
  999. result = App.Utils.formDiff(dataNow, dataLast)
  1000. deepEqual(result, diff, 'check form diff')
  1001. dataNow = {
  1002. test: '123',
  1003. ticket: {
  1004. pending_time: undefined,
  1005. },
  1006. }
  1007. dataLast = {
  1008. ticket: {
  1009. pending_time: null,
  1010. },
  1011. }
  1012. diff = {
  1013. test: '123',
  1014. }
  1015. result = App.Utils.formDiff(dataNow, dataLast)
  1016. deepEqual(result, diff, 'check form diff')
  1017. dataNow = undefined
  1018. dataLast = undefined
  1019. diff = {}
  1020. result = App.Utils.formDiff(dataNow, dataLast)
  1021. deepEqual(result, diff, 'check form diff')
  1022. dataNow = {}
  1023. 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}
  1024. diff = {}
  1025. result = App.Utils.formDiff(dataNow, dataLast)
  1026. deepEqual(result, diff, 'check form diff')
  1027. // do not compare content of data instances/objects
  1028. no = function test_object() {
  1029. this.a = function() { return 123; }
  1030. this.b = function() { return '1234'; }
  1031. this.c = function() { return [123]; }
  1032. this.d = [1,2,3];
  1033. this.e = 'abc';
  1034. }
  1035. no1 = new no()
  1036. no2 = new no()
  1037. no3 = new no()
  1038. dataNow = {
  1039. number:'10013',
  1040. Article: [no1],
  1041. }
  1042. dataLast = {
  1043. number: "10012",
  1044. title: "some subject 123äöü",
  1045. Article: [ no2, no3 ],
  1046. }
  1047. diff = {
  1048. number:'10013',
  1049. }
  1050. result = App.Utils.formDiff(dataNow, dataLast)
  1051. deepEqual(result, diff, 'check form diff')
  1052. dataNow = {
  1053. number:'10013',
  1054. Article: [no1,2],
  1055. }
  1056. dataLast = {
  1057. number: "10012",
  1058. title: "some subject 123äöü",
  1059. Article: [ no2, no3 ],
  1060. }
  1061. diff = {
  1062. number:'10013',
  1063. Article: ['2'],
  1064. }
  1065. result = App.Utils.formDiff(dataNow, dataLast)
  1066. deepEqual(result, diff, 'check form diff')
  1067. });
  1068. // check decimal format
  1069. test("check decimal format", function() {
  1070. var string = '123'
  1071. var result = '123.00'
  1072. var verify = App.Utils.decimal(string)
  1073. equal(verify, result, string)
  1074. string = '0.6'
  1075. result = '0.60'
  1076. verify = App.Utils.decimal(string)
  1077. equal(verify, result, string)
  1078. string = '6'
  1079. result = '6.00'
  1080. verify = App.Utils.decimal(string)
  1081. equal(verify, result, string)
  1082. string = 6.5
  1083. result = '6.50'
  1084. verify = App.Utils.decimal(string)
  1085. equal(verify, result, string)
  1086. string = '111111.6'
  1087. result = '111111.60'
  1088. verify = App.Utils.decimal(string)
  1089. equal(verify, result, string)
  1090. string = '111111.622'
  1091. result = '111111.62'
  1092. verify = App.Utils.decimal(string)
  1093. equal(verify, result, string)
  1094. string = 'abc.6'
  1095. result = 'abc.6'
  1096. verify = App.Utils.decimal(string)
  1097. equal(verify, result, string)
  1098. string = ''
  1099. result = ''
  1100. verify = App.Utils.decimal(string)
  1101. equal(verify, result, string)
  1102. string = undefined
  1103. result = ''
  1104. verify = App.Utils.decimal(string)
  1105. equal(verify, result, string)
  1106. string = null
  1107. result = ''
  1108. verify = App.Utils.decimal(string)
  1109. equal(verify, result, string)
  1110. });
  1111. // check formatTime format
  1112. test("check formatTime format", function() {
  1113. var string = '123'
  1114. var result = '123'
  1115. var verify = App.Utils.formatTime(string, 0)
  1116. equal(verify, result, string)
  1117. string = '6'
  1118. result = '06'
  1119. verify = App.Utils.formatTime(string, 2)
  1120. equal(verify, result, string)
  1121. string = ''
  1122. result = '00'
  1123. verify = App.Utils.formatTime(string, 2)
  1124. equal(verify, result, string)
  1125. string = undefined
  1126. result = ''
  1127. verify = App.Utils.formatTime(string, 2)
  1128. equal(verify, result, string)
  1129. string = null
  1130. result = ''
  1131. verify = App.Utils.formatTime(string, 2)
  1132. equal(verify, result, string)
  1133. });
  1134. }