ZoneTwelve / Wootalk_ToolBar

// ==UserScript==
// @name        Wootalk_ToolBar
// @namespace   Wootalk工具列
// @description Wootalk 簡易工具列 by.ZoneTwelve
// @include     none
// @exclude     none
// @version     v1.0
// @grant       none
// ==/UserScript==
var toolbar = new Object();
window.onload = function(){
  console.log("ZoneTwelve Wootalk toolbar");
  toolbar.index = document.querySelector(".toolbar");
  var tmp = toolbar.index.querySelectorAll(".button");
  var list = create();
  for(var i=0;i<tmp.length;i++){
    var t = tmp[i];
    t.style.width = `${200/tmp.length}px`;
    t.style.float = "right";
    list.appendChild(t);
  }
  document.body.appendChild(list);
  
  /*
  var startBtn = document.querySelector("#startButton");
  startBtn.style.position = "absolute";
  startBtn.style.bottom = "-100px";
  startBtn.style.left = "0px";
  
  
  toolbar.msgInput = document.querySelector("#messageInput");
  document.querySelector('input[value="離開"]').onmouseover = () => toolbar.msgInput.value = "男";
  */
}

function create(){
  var tmp = document.createElement("div");
  tmp.id = "demo";
  tmp.style.width = "200px";
  tmp.style.height = "50px"
  tmp.style.position = "absolute";
  tmp.style.top = "10px";
  tmp.style.right = "10px";
  tmp.style.color = "white";
  tmp.style.zIndex = 99;
  return tmp;
}

/*
  toolbar.tag = document.querySelector("#toolbar")
  toolbar.uploadImage = document.createElement("input");
  toolbar.uploadImage.onclick = toolbar.tag.querySelector(".button").onclick;
  toolbar.value = "上傳圖片"
  console.log(toolbar.uploadImage)
  document.querySelector("#changeButton").appendChild(toolbar.uploadImage);

*/