{"id":112663,"student_id":2002,"content":"var name = prompt(\"名子?\") || \"匿名\";\nvar comments = [];\nvar users = {\n 12938: {\n id: 12938, name: \"test01\"\n },\n 35858: {\n id: 35858, name: \"test02\"\n },\n 56898: {\n id: 56898, name: \"test03\"\n },\n};\nvar rand = Math.floor(Math.random() * 10000) + 1;\nusers[rand] = {\n id: rand,\n name: name,\n time: Date.now()\n};\nDB.broadcast(\"update\", users[rand]);\nDB.onMessage(\"update\", function (data) {\n users[data.id] = data;\n});\nforever(function() {\n for (var id in users)\n if (Date.now() - users[id].time \u003e 15000) {\n var time = Date.now();\n comments.push(time.toLocaleTimeString() + users[id].name + \"已經離開.\");\n delete users[id];\n }\n\n for (var i = 0; i \u003c comments.length; i++) {\n print(comments[i], 10 + 60, 20*i +30);\n }\n});\n\nwhen(\"click\", function() {\n var msg = `【` + (new Date).toLocaleTimeString() + `】` + name + \":\" + prompt(\"?\");\n comments.push(msg);\n DB.broadcast(\"message\", msg);\n});\nDB.onMessage(\"message\", function (data) {\n comments.push(data);\n});","created_at":"2019-12-07T14:18:32.164+08:00","updated_at":"2019-12-14T17:56:24.355+08:00","name":"聊天室 副本","language":"javascript","screenshot":{"url":"https://cdn8.koding.school/uploads/project/screenshot/112663/fd1ac05835b665cf0d7e3c5532c7c2d7.jpg"},"parent_id":34007,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":100,"hashid":"p93syrqp","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
到這台電腦