svg.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515
  1. if (!String.prototype.encodeHTML) {
  2. String.prototype.encodeHTML = function () {
  3. return this.replace(/&/g, '&')
  4. .replace(/</g, '&lt;')
  5. .replace(/>/g, '&gt;')
  6. .replace(/"/g, '&quot;')
  7. .replace(/'/g, '&apos;');
  8. };
  9. }
  10. var transition = {pid: '', port: '8080' };
  11. // BERT Protocol
  12. var players = ["Gabrielo","Mustafa","Alina","Me"];
  13. function statsRow(start_name,i,games) {
  14. var start_score = 200;
  15. var name = template_engine(
  16. '<tspan xmlns="http://www.w3.org/2000/svg" x="{this.x}" y="{this.y}">{this.body}</tspan>',{
  17. x: start_name,
  18. y: 180+25*i,
  19. body: games[i].value[0][0] + " — " + games[i].value[0][1]});
  20. var element1 = svg(name);
  21. document.getElementById('Stat-Right').appendChild(element1);
  22. }
  23. var user_count = 0;
  24. function handle_web_socket(body) {
  25. // console.log(dec(body).value[0][0].value);
  26. switch (dec(body).value[0][0].value) {
  27. case 'roster_item':
  28. var id = dec(body).value[0][1].value;
  29. var names = dec(body).value[0][2].value;
  30. var surnames = dec(body).value[0][3].value;
  31. addOnlineUser(id,names+" "+surnames+ " "+user_count++,'appendChild');
  32. break;
  33. case 'roster_group':
  34. var list = dec(body).value[0][1];
  35. console.log(list);
  36. for (var i=0;i<list.length;i++) {
  37. var item = list[i];
  38. var id = item.value[0][0].value;
  39. var names = item.value[0][1].value;
  40. var surnames = item.value[0][2].value;
  41. addOnlineUser(id,names+" "+surnames+ " "+user_count++,'appendChild');
  42. }
  43. break;
  44. case 'roster_end':
  45. onlineHover();
  46. mouseWheelHandler({'detail':5,'wheelDelta':5});
  47. onlineHoverOut();
  48. break;
  49. case 'online_number':
  50. var number = dec(body).value[0][1];
  51. document.getElementById("723").textContent = number.toString();
  52. break;
  53. case 'stats_event':
  54. document.getElementById('Player-Statistics').style.display = '';
  55. var games = dec(body).value[0][2];
  56. var reveals = dec(body).value[0][3];
  57. var protocol = dec(body).value[0][4];
  58. removeChilds(document.getElementById('Stat-Left'));
  59. removeChilds(document.getElementById('Stat-Right'));
  60. for (var i=0;i<games.length;i++) { statsRow(24, i,games); }
  61. for (var i=0;i<protocol.length;i++) { statsRow(340,i,protocol); }
  62. // for (var i=0;i<reveals.length;i++) { statsRow(340,i,reveals); }
  63. break;
  64. }
  65. switch (dec(body).value[0][2].value) {
  66. case 'okey_game_info':
  67. var a = dec(body).value[0][3][0].value[0][1];
  68. // console.log("Players: " + a.length);
  69. for (var i=0;i<a.length;i++) {
  70. var c = a[i].value[0][3].value;
  71. var v = a[i].value[0][4].value;
  72. setPlayerName(players[i],c + " " + v);
  73. // console.log("Player: " + c + " " + v);
  74. }
  75. break;
  76. case 'okey_game_started':
  77. var a = dec(body).value[0][3][0].value[0][1];
  78. // console.log("Cards: " + a.length);
  79. for (var i=1;i<=a.length;i++) {
  80. var c = a[i-1].value[0][1];
  81. var v = a[i-1].value[0][2];
  82. // console.log("Card: " + c + " " + v);
  83. place_card(i,rand(1,2),c,v);
  84. }
  85. break;
  86. case 'okey_game_player_state': /// these two messages should be combined
  87. var a = dec(body).value[0][3][3].value[0][1];
  88. // console.log("Cards: " + a.length);
  89. for (var i=1;i<=a.length;i++) {
  90. var c = a[i-1].value[0][1];
  91. var v = a[i-1].value[0][2];
  92. // console.log("Card: " + c + " " + v);
  93. place_card(i,1,c,v);
  94. }
  95. break;
  96. case 'okey_tile_discarded':
  97. console.log(String(dec(body)));
  98. var player = dec(body).value[0][3][0].value[0][1];
  99. var tile = dec(body).value[0][3][1].value[0][1];
  100. if (player.value == document.user) {
  101. console.log("Discard: " + player.value);
  102. var p = findCardOnTable(tile.value[0][1],tile.value[0][2]);
  103. empty_card(p.x,p.y);
  104. }
  105. break;
  106. case 'okey_tile_taken':
  107. console.log(String(dec(body)));
  108. var player = dec(body).value[0][3][0].value[0][1];
  109. var taken = dec(body).value[0][3][2].value[0][1];
  110. if (taken.value != 'null' && player.value == document.user) {
  111. console.log("Taken: " + player.value);
  112. var c = taken.value[0][1];
  113. var v = taken.value[0][2];
  114. var pos = findPlace();
  115. // console.log(pos);
  116. place_card(pos.x,pos.y,c,v);
  117. }
  118. break;
  119. default:
  120. console.log(String(dec(body)));
  121. }
  122. }
  123. // SVG DOM and Template Engine
  124. function template_engine(html, data) {
  125. var re = /{([^}]+)?}/g, code = 'var r=[];', cursor = 0;
  126. var add = function(line,js) {
  127. js? (code += 'r.push(' + line + ');') :
  128. (code += line != '' ? 'r.push("' + line.replace(/"/g, '\\"') + '");' : '');
  129. return add; }
  130. while(match = re.exec(html)) {
  131. add(html.slice(cursor, match.index))(match[1],true);
  132. cursor = match.index + match[0].length; }
  133. add(html.substr(cursor, html.length - cursor));
  134. code += 'return r.join("");';
  135. return new Function(code.replace(/[\r\t\n]/g, '')).apply(data); }
  136. function reload(file, name) { var slot = document.getElementById(name);
  137. slot.parentNode.replaceChild(svg(localStorage.getItem(file)),slot);}
  138. function reload_cont(cont,name,element) { if (null != cont) (cont)(); else reload(name,element); }
  139. function loadFile(name,cont,element) {
  140. if (localStorage.getItem(name) == null) {
  141. var client = new XMLHttpRequest();
  142. client.open('GET', name, true);
  143. client.onload = function() {
  144. localStorage.setItem(name,client.responseText);
  145. reload_cont(cont,name,element); }
  146. client.send(); }
  147. else reload_cont(cont,name,element); }
  148. function svg(html) {
  149. return new DOMParser().parseFromString(html, "text/xml").firstChild;
  150. }
  151. function svgBulk() {
  152. var res = [];
  153. var node = new DOMParser().parseFromString(html, "text/xml").firstChild;
  154. for (var i=0;i<node.childnode.length;i++) { var child = childNodes.item(i);
  155. if (child.tagName != undefined) res.push(child); } }
  156. // The Card
  157. //var color = ['#CE290F','#3B5998','#48AF5E','#FFEC00'];
  158. var color = ['#DE3F26','#606060','#48AF5E','#FFC800'];
  159. var slotName = slotNameDef;
  160. function slotNameDef(x,y) { return "Slot-"+y+","+x; }
  161. function card(line,pos,col,v) {
  162. return template_engine(
  163. localStorage.getItem("templates/Card.svg"),
  164. { name: slotName(pos,line),
  165. suit: color[col-1],
  166. value: v,
  167. y: (line-1)*69,
  168. x: (pos-1)*42 }); }
  169. // Game Scene
  170. function setPlayerName(e, playerName) {
  171. var dx = (document.getElementById(e).attributes['fill'].value == "#FFFFFF") ? 65 : 20;
  172. document.getElementById(e).setAttribute("y",27);
  173. document.getElementById(e).setAttribute("x",dx);
  174. document.getElementById(e).textContent = playerName;
  175. // console.log("Bounding Box: " + document.getElementById(e).getBBox().width);
  176. document.getElementById(e+"-Pad").setAttribute('width',
  177. document.getElementById(e).getBBox().width + 45); }
  178. function place_card(x,y,c,v) {
  179. var slot = document.getElementById(slotName(x,y));
  180. slot.parentNode.replaceChild(svg(card(y,x,c,v)),slot); }
  181. function empty_card(x,y) { var slot = document.getElementById(slotName(x,y));
  182. var html = '<g xmlns="http://www.w3.org/2000/svg" id="'+slotName(x,y)+'"/>';
  183. slot.parentNode.replaceChild(svg(html),slot); }
  184. function rand(lo,hi) { return Math.floor((Math.random()*hi)+lo); }
  185. function loadScene() {
  186. reload("Kakaranet-Scene.svg", "Refined");
  187. for (var i=1;i<16;i++) { empty_card(i,2); empty_card(i,1); }
  188. //drawSampleCards();
  189. }
  190. function findPlace() {
  191. for (var y=1;y<3;y++) for (var x=1;x<15;x++) {
  192. var e = document.getElementById(slotName(x,y));
  193. if (e.childElementCount == 0) {
  194. var pos = e.attributes['id'].value.split("-")[1].split(",");
  195. console.log("Free");
  196. console.log(pos[0]);
  197. console.log(pos[1]);
  198. return { y: pos[0], x: pos[1] }; } } }
  199. function findCardOnTable(c,v) {
  200. console.log("Find Card " + c + " " + v);
  201. for (var y=1;y<3;y++) for (var x=1;x<15;x++) {
  202. var e = document.getElementById(slotName(x,y));
  203. if (e.childElementCount > 0) {
  204. var value = e.lastChild.textContent;
  205. var col = color.indexOf(e.lastChild.attributes['fill'].value) + 1;
  206. console.log(col + " " + value);
  207. if (c == col && v == value) return { 'x': x, 'y': y }; } }
  208. console.log("Card Not Found");
  209. return ""; }
  210. function loadAppend(file, animation, name) {
  211. loadFile(file, function() {
  212. var slot = document.getElementById(name);
  213. var r = template_engine(localStorage.getItem(file),{'name': animation});
  214. document.getElementById(name).appendChild(svg(r)); }); }
  215. function loadAnimationForButton(a, b) { return loadAppend('templates/ButtonAnimation.svg', a, b); }
  216. // TODO: Rollout Monadic Chain here
  217. loadFile('templates/Card.svg', function() {
  218. loadFile('Kakaranet-Scene.svg', function() {
  219. loadScene();
  220. var a = [{button: "Create", pathes: ["CreateShow", "CreateHide"]},
  221. {button: "Play", pathes: ["PlayShow", "PlayHide"]}];
  222. for (var y=0;y<a.length;y++) for (var x=0;x<a[y].pathes.length;x++)
  223. loadAnimationForButton(a[y].pathes[x],a[y].button);
  224. document.getElementById("Right-Menu") .setAttribute('onclick', 'onRightMenu(evt)');
  225. document.getElementById("Play") .setAttribute('onclick', 'onRightMenuDown(evt)');
  226. document.getElementById("Create") .setAttribute('onclick', 'onRightMenuDown(evt)');
  227. document.getElementById("Point-Table").setAttribute('onclick', 'onPlayerInfo(evt)');
  228. document.getElementById("Player-Statistics").setAttribute('onclick', 'onPlayerInfoClose(evt)');
  229. document.getElementById('Page-1').addEventListener("mousewheel", mouseWheelHandler, false);
  230. onRightMenuDown();
  231. });
  232. });
  233. var clipPath1 = svg('<clipPath id="myClip1"><rect xmlns="http://www.w3.org/2000/svg" id="Clip-Path-Left" x="0" y="0" width="216" height="400"/></clipPath>');
  234. var clipPath2 = svg('<clipPath id="myClip2"><rect xmlns="http://www.w3.org/2000/svg" id="Clip-Path-Right" x="0" y="0" width="216" height="400"/></clipPath>');
  235. document.getElementsByTagName('defs').item(0).appendChild(clipPath1);
  236. document.getElementsByTagName('defs').item(0).appendChild(clipPath2);
  237. document.getElementById("Online-List").setAttribute("clip-path","url(#myClip1)");
  238. document.getElementById("Chat").setAttribute("clip-path","url(#myClip2)");
  239. document.getElementById("Clip-Path-Left").setAttribute("transform", "translate(0,0)");
  240. document.getElementById("Clip-Path-Right").setAttribute("transform", "translate(0,0)");
  241. document.getElementById('Player-Statistics').style.display = 'none';
  242. document.getElementById("Right-Bar").setAttribute("fill","skyblue");
  243. document.getElementById("Right-Bar").onmouseover = barHover;
  244. document.getElementById("Right-Bar").onmouseout = barHoverOut;
  245. document.getElementById("Left-Bar").onmouseover = onlineHover;
  246. document.getElementById("Left-Bar").onmouseout = onlineHoverOut;
  247. document.getElementById('edit').setAttribute("contentEditable","true");
  248. document.getElementById('edit').onkeydown = chatEditor;
  249. var removeChilds = function (node) {
  250. var last;
  251. while (last = node.lastChild) node.removeChild(last);
  252. };
  253. function onPlayerInfo(evt) {
  254. ws.send(enc(tuple(atom('client'),
  255. tuple(atom('stats_action'),bin(document.user),atom('game_okey')))));
  256. }
  257. function onPlayerInfoClose(evt) {
  258. document.getElementById('Player-Statistics').style.display = 'none';
  259. }
  260. function onRightMenu(evt) {
  261. localStorage.clear();
  262. ["PlayShow","CreateShow"].map(function (x) {
  263. document.getElementById(x+"-Motion").beginElement(); }); }
  264. function onRightMenuDown(evt) {
  265. ["PlayHide","CreateHide"].map(function (x) {
  266. document.getElementById(x+"-Motion").beginElement(); }); }
  267. // SVG Samples for svg.htm
  268. /*
  269. loadFile('templates/Mustafa-Persona.svg', null, "Mustafa-Persona-Sample");
  270. loadFile('templates/Mustafa-Selection.svg', null, "Mustafa-Selection-Sample");
  271. document.getElementById("MustafaSelection").addEventListener('click', function() {
  272. var style = document.getElementById("Mustafa-Selection-Sample").style;
  273. if (style.display == 'none') style.display = 'block';
  274. else style.display = 'none'; });
  275. */
  276. function slotName1(x,y) { return "1Slot-"+y+","+x; }
  277. function drawSampleCards() {
  278. slotName = slotName1;
  279. for (var i=1;i<15;i++) { place_card(i,rand(1,2),rand(1,4),rand(1,13)); }
  280. slotName = slotNameDef; }
  281. var scrollSensitivity = 0.2;
  282. var scroll_left = 5;
  283. var scroll_right = -10000;
  284. function chatMessage(id, me, string) {
  285. var i=0;
  286. var colors=['#FDFDFD','#DFF1F4'];
  287. var x1 = 7;
  288. var y1 = 0;
  289. var translate_y = parseFloat(document.getElementById("Chat").getBBox().height);
  290. var x2 = 205;
  291. var textElement = chatText(id,me,string);
  292. var dy = translate_y == 0 ? 0 : translate_y + 10;
  293. var html = "<g xmlns='http://www.w3.org/2000/svg' " +
  294. "id='Message-"+id+"' transform='translate(0,"+dy+")'></g>";
  295. var messageElement = svg(html);
  296. messageElement.appendChild(textElement);
  297. document.getElementById("Chat").appendChild(messageElement);
  298. create_multiline(textElement);
  299. var y2 = textElement.getBBox().height + 5;
  300. var box = "<path xmlns='http://www.w3.org/2000/svg' d='M"+x1+","+y1+
  301. " L"+x2+","+y1+
  302. ((me == "Maxim") ?
  303. (" L"+x2+","+parseFloat(y2-7)+
  304. " L"+parseFloat(x2+7)+","+y2+
  305. " L"+x1+","+y2)
  306. :
  307. (" L"+x2+","+y2+
  308. " L"+0+","+y2+
  309. " L"+x1+","+parseFloat(y2-7)))
  310. + " L"+x1+","+y1+"' fill='"+colors[me=="Maxim"?1:0]+"'></path>";
  311. var boxElement = svg(box);
  312. messageElement.insertBefore(boxElement,textElement);
  313. boxElement.setAttribute("mouseover","barHover(evt);");
  314. boxElement.setAttribute("mouseout","barHoverOut(evt);");
  315. textElement.setAttribute("mouseover","barHover(evt);");
  316. textElement.setAttribute("mouseout","barHoverOut(evt);");
  317. messageElement.setAttribute("onmouseover","barHover(evt);");
  318. messageElement.setAttribute("onmouseout","barHoverOut(evt);");
  319. // console.log(messageElement);
  320. }
  321. function chatText(id, me, string) {
  322. var i = 0;
  323. var colors=['#3B5998'];
  324. var html = "<text id='ChatText-"+id+"' width='180' " +
  325. " xmlns='http://www.w3.org/2000/svg' "+
  326. " font-family='Exo 2' font-size='16' font-weight='normal' fill='"+colors[i]+"'>" +
  327. string + "</text>";
  328. // console.log(html);
  329. return svg(html);
  330. }
  331. function mouseWheelHandler(e) {
  332. var leftBar = document.getElementById("Left-Bar");
  333. var rightBar = document.getElementById("Right-Bar");
  334. var leftFill = leftBar.getAttribute("fill");
  335. var rightFill = rightBar.getAttribute("fill");
  336. var leftActive = leftFill == "skyblue";
  337. var rightActive = rightFill == "skyblue";
  338. if (!leftActive && !rightActive) return;
  339. // console.log(leftActive);
  340. var evt = e;
  341. var scroll_dy = evt.detail ? evt.detail * scrollSensitivity : evt.wheelDelta * scrollSensitivity;
  342. var ori = leftActive ? scroll_left : scroll_right;
  343. var scroll = parseFloat(scroll_dy) + parseFloat(ori);
  344. var selectedBar = leftActive ? "Online-List" : "Chat";
  345. var selectedClip = leftActive ? "Clip-Path-Left" : "Clip-Path-Right";
  346. var selectedBarShift = leftActive ? 0 : 857;
  347. var limit = parseFloat(document.getElementById(selectedBar).getBBox().height) - 400;
  348. if (scroll > 5) scroll = 5;
  349. if (scroll < -limit) scroll = -limit;
  350. document.getElementById(selectedClip).setAttribute("transform", "translate(0,"+parseFloat(-scroll)+")");
  351. document.getElementById(selectedBar).setAttribute("transform", "translate("+selectedBarShift+","+(parseFloat(95+scroll))+")");
  352. if (leftActive) scroll_left = scroll; else scroll_right = scroll;
  353. return true;
  354. }
  355. var svgNS = "http://www.w3.org/2000/svg";
  356. function create_multiline(target) {
  357. var text_element = target; // evt.target;
  358. var width = 190; //target.getAttribute("width");
  359. var words = text_element.firstChild.data.split('');
  360. // console.log(words);
  361. // var words = [].concat.apply([],lines.map(function(line) { return line.split(' '); }));;
  362. var start_x = 15; //text_element.getAttribute('x');
  363. text_element.firstChild.data = '';
  364. var tspan_element = document.createElementNS(svgNS, "tspan");
  365. tspan_element.setAttribute("x", start_x);
  366. tspan_element.setAttribute("dy", 18);
  367. var text_node = document.createTextNode(words[0]);
  368. tspan_element.appendChild(text_node);
  369. text_element.appendChild(tspan_element);
  370. for(var i=1; i<words.length; i++) {
  371. if (words[i]=="") continue;
  372. var len = tspan_element.firstChild.data.length;
  373. tspan_element.firstChild.data += words[i];
  374. if (tspan_element.getComputedTextLength() > width || words[i]=="\n") {
  375. if (words[i]=='\n') words[i]="";
  376. tspan_element.firstChild.data = tspan_element.firstChild.data.slice(0, len);
  377. var tspan_element = document.createElementNS(svgNS, "tspan");
  378. tspan_element.setAttribute("x", start_x);
  379. tspan_element.setAttribute("dy", 18);
  380. text_node = document.createTextNode(words[i]);
  381. tspan_element.appendChild(text_node);
  382. text_element.appendChild(tspan_element);
  383. }
  384. }
  385. }
  386. function barHover(evt) { document.getElementById("Right-Bar").setAttribute("fill","skyblue"); }
  387. function barHoverOut(evt) { document.getElementById("Right-Bar").setAttribute("fill","lightblue"); }
  388. function onlineHover(evt) { document.getElementById("Left-Bar").setAttribute("fill","skyblue"); }
  389. function onlineHoverOut(evt) { document.getElementById("Left-Bar").setAttribute("fill","lightblue"); }
  390. function onlineHoverColor(evt) {
  391. onlineHover(evt);
  392. var name = evt.target.getAttribute("xmlns:data");
  393. if (null != name) document.getElementById(name).setAttribute("fill","#FFF687");
  394. }
  395. function onlineHoverOutColor(evt) {
  396. onlineHoverOut(evt);
  397. var name = evt.target.getAttribute("xmlns:data");
  398. if (null != name) document.getElementById(name).setAttribute("fill","#DBEBED");
  399. }
  400. function chatEditor(evt) {
  401. if (evt.keyCode == 13 && evt.metaKey == false) {
  402. var e = document.getElementById('edit');
  403. if (e.innerText.trim() != ""){
  404. chatMessage("100","Maxim",e.innerText.trim().encodeHTML());
  405. e.innerHTML = '';
  406. }
  407. } else if (evt.keyCode == 13 && evt.metaKey == true) {
  408. document.execCommand('insertText',false, '\n');
  409. }
  410. var scroll = -1000000;
  411. mouseWheelHandler({'detail':scroll,'wheelDelta':scroll});
  412. }
  413. function addOnlineUser(name,full_name,insertMode) {
  414. var listElement = document.getElementById("Online-List");
  415. var y = listElement.getBBox().height;
  416. // console.log(y);
  417. var html = '<g xmlns="http://www.w3.org/2000/svg" height="60" transform="translate(0, '+y+')">' +
  418. '<g xmlns:data="'+name+'"fill="#DBEBED" onmouseover="onlineHoverColor(evt);" onmouseout="onlineHoverOutColor(evt);">' +
  419. ' <rect xmlns:data="'+name+'"fill="#DBEBED" id="'+name+'" x="10" y="0" width="196" height="48" onmouseover="onlineHoverColor(evt);" onmouseout="onlineHoverOutColor(evt);"></rect></g>' +
  420. '<text xmlns:data="'+name+'" onmouseover="onlineHoverColor(evt);" onmouseout="onlineHoverOutColor(evt);" '+
  421. 'font-family="Exo 2" font-size="18" font-weight="normal" line-spacing="18"'+
  422. ' fill="#3B5998">' +
  423. '<tspan xmlns:data="'+name+'" font-weight="normal" fill="green" x="19" y="22">'+full_name+'</tspan>' +
  424. '<tspan xmlns:data="'+name+'" font-size="14" x="19" y="40">Score: 1043 Pos: 13</tspan></text>'+
  425. '<rect onmouseover="onlineHover(evt);" onmouseout="onlineHoverOut(evt);"'+
  426. ' x="10" y="48" width="196" height="8"></rect></g>';
  427. var element = svg(html);
  428. // element.setAttribute("mouseover","onlineHoverColor(evt);");
  429. // element.setAttribute("mouseout","onlineHoverOutColor(evt);");
  430. // console.log(element);
  431. listElement.appendChild(element);
  432. }
  433. chatMessage("1","Maxim2","Joe:\nHello There!".encodeHTML());
  434. chatMessage("2","Maxim2","Alice:\nYou got new Design. Eh?".encodeHTML());
  435. chatMessage("3","Maxim","Maxim So:\nThis was made with pure SVG".encodeHTML());
  436. /*
  437. for (var i=0;i<5;i++) {
  438. addOnlineUser("Maxim1"+i,"Maxim Sokhatsky",'appendChild');
  439. addOnlineUser("Maxim2"+i,"Sinan Ustel",'appendChild');
  440. addOnlineUser("Maxim3"+i,"Ahmet Tez",'appendChild');
  441. addOnlineUser("Maxim4"+i,"Alice Cooper",'appendChild');
  442. }
  443. */
  444. barHover();
  445. mouseWheelHandler({'detail':-100000,'wheelDelta':-100000});
  446. barHoverOut();