User:Bluedeck/etc/sandbox/box1471954884884
function bluedeck_scope_dykn_utility() {
"use strict"; this.date_now = Date.now().toString(); this.css = "<style>#bluedeck_dom_node_date_now_"+this.date_now+"{position:fixed;display:none;overflow-y:auto;overflow-x:auto;max-height:90vh;padding-left:20px;padding-bottom:10px;padding-right:20px;padding-top:30px;top:0;left:0;right:0;width:70%;min-width:200px;margin:auto;border-radius:0px 0px 9px 9px;background:rgb(249,249,252);z-index:1000;border-bottom:solid 1px #aaaaaa;border-left:solid 1px #aaaaaa;border-right:solid 1px #aaaaaa;box-shadow:0px 0px 11px rgba(0,0,0,0.3);}#bluedeck_dom_node_date_now_"+this.date_now+" input{background:rgba(255,255,255,0.8);border:1px solid #aaa;margin-left:8px;}</style>";
this.interact_html = '
条目名<input type="text" name="article_name"></input>
作者<label><input type="radio" name="author" value="me"></input>我</label><label><input type="radio" name="author" value="others"></input>其他用户:</label><input type="text" name="other_author_name"></input><label><input type="radio" name="author" value="n/a"></input>不适用</label>
类别<input type="text" name="cat"></input>
DYK问题
感言<textarea name="remark"></textarea>
</form>代码预览<textarea id="code_preview"></textarea>
'; this.trigger_html = '
'; if(navigator.language === "zh-CN" || navigator.language === "zh-SG"){this.user_language_code = "zh_cn";} else if(navigator.language === "zh-HK"){this.user_language_code = "zh_hk";} else if(navigator.language === "zh-TW"){this.user_language_code = "zh_tw";} else{this.user_language_code = "zh_cn";} this.ui_insert_elements = function() // just use the pretty print since it won't be instanciated twice anyway { document.getElementsByTagName("head")[0].insertAdjacentHTML("beforeend",this.css); document.getElementsByTagName("body")[0].insertAdjacentHTML("afterbegin",this.interact_html); if(document.getElementById("p-cactions").className === "vectorMenu") { document.getElementById("p-cactions").childNodes[3].childNodes[1].insertAdjacentHTML("beforeend",this.trigger_html); } else if(document.getElementById("ca-watch")) { document.getElementById("ca-watch").insertAdjacentHTML("beforebegin",this.trigger_html); } else if(document.getElementById("ca-unwatch")) { document.getElementById("ca-unwatch").insertAdjacentHTML("beforebegin",this.trigger_html); } else { document.getElementById("p-views").childNodes[3].insertAdjacentHTML("beforeend",this.trigger_html); } } this.ui_start_interface = function() { document.getElementById("bluedeck_dom_node_date_now_"+this.date_now).style.display="block"; } this.ui_end_interface = function() { document.getElementById("bluedeck_dom_node_date_now_"+this.date_now).style.display="none"; } } var bluedeck_dykn_utility = new bluedeck_scope_dykn_utility(); bluedeck_dykn_utility.ui_insert_elements();