{"id":21458,"student_id":119,"content":"var name = prompt(\"名子是?\") || \"匿名\";\r\nforever(function(){\r\n print(name+\"加入了聊天室\", 300, 30, \"black\", 20);\r\n});\r\nvar id = Math.floor(Math.random() * 10000)\r\nvar ii = 0;\r\nvar users = {\r\n\r\n}\r\nvar iii = 0;\r\nvar msg;\r\nvar comments = [];\r\nusers[id] = {\r\n id: id,\r\n name: name,\r\n time: Date.now()\r\n}\r\nforever(function () {\r\n ii = 0;\r\n for (var i = 0; i \u003c comments.length; i++) {\r\n print(comments[i], 300, i * 30, \"black\", 20);\r\n }\r\n for (var iii in users) {\r\n print(users[iii].name, 0, ii * 20, \"black\", 20);\r\n if (Date.now() - users[iii].time \u003e 150000) {\r\n delete users[iii];\r\n }\r\n ii++;\r\n }\r\n DB.broadcast(\"user\", users[id]);\r\n\r\n\r\n});\r\nDB.onMessage(\"user\", function (data) {\r\n users[data.id] = data\r\n\r\n});\r\nwhen(\"click\", function () {\r\n var time = new Date()\r\n time = time.toLocaleTimeString();\r\n msg = prompt(\"留言?\");\r\n msg = time + \" \" + name + \"說:\" + msg;\r\n DB.broadcast(\"message\", msg);\r\n comments.push(msg);\r\n});\r\nDB.onMessage(\"message\", function (data) {\r\n console.log(data);\r\n comments.push(data);\r\n});","created_at":"2018-02-03T10:08:45.669+08:00","updated_at":"2019-07-19T14:34:53.646+08:00","name":"emptyJS","language":"javascript","screenshot":{"url":"https://cdn9.koding.school/uploads/project/screenshot/21458/a24ae9cb41781862136e19f87a5dd611.jpg"},"parent_id":14981,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":81,"hashid":"gk4spj9d","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦