From beb341da50d99586168c3bd9c55b7c17c4e793a4 Mon Sep 17 00:00:00 2001 From: ryoichi-u Date: Mon, 27 Nov 2017 13:12:25 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20webpack=E6=9C=AA=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E7=89=88=E3=81=A7=E3=83=99=E3=83=BC=E3=82=BF=E7=89=88=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chatworkHelper.js | 24 +++++++++++++++++++++--- manifest.json | 2 +- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/chatworkHelper.js b/chatworkHelper.js index 680db7f..ca9d097 100644 --- a/chatworkHelper.js +++ b/chatworkHelper.js @@ -2,7 +2,7 @@ // @name chatwork helper // @match https://www.chatwork.com/* // @match https://kcw.kddi.ne.jp/* -// @version 1.5.6 +// @version 1.6.0 /* load jQuery */ // @require https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js // ==/UserScript== @@ -17,6 +17,14 @@ }, false); document.body.appendChild(script); })(function ($) { + +const isNewRoomList = queryStrings().preview == 'newRoomList'; +const allOpenedButton = isNewRoomList + ? '
' + : ''; +const attachingElementSelector = isNewRoomList ? '#_sideChatMoveMyChat' : '#_sideContentTitle'; + + var _chatText = $('#_chatText'); var _taskNameInput = $('#_taskNameInput'); @@ -110,6 +118,16 @@ }, ]; + function queryStrings() { + var arg = new Object; + var pair=location.search.substring(1).split('&'); + for(var i=0;pair[i];i++) { + var kv = pair[i].split('='); + arg[kv[0]]=kv[1]; + } + return arg; + } + // shortcut for main massege area _chatText.on('keypress', function(e) { @@ -151,9 +169,9 @@ // all openedButton - var allOpenedButton = ''; $('#_openedButton').remove(); - $('#_sideContentTitle').append(allOpenedButton); + $(attachingElementSelector).after(allOpenedButton); + $('#_openedButton').on('click', function(e) { var d=new Date(); diff --git a/manifest.json b/manifest.json index c986546..dbb44cb 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "chatwork helper", - "version": "1.5.6", + "version": "2.0.3", "homepage_url": "https://github.com/ryoichi-u/chatwork_helper", "content_scripts": [{ "matches": [