Merge branch 'united' into big-o
This resolves two merge conflicts that arose because this branch was a few commits behind.
This commit is contained in:
commit
d7605a717b
64
aiserver.py
64
aiserver.py
|
@ -106,6 +106,7 @@ class vars:
|
||||||
svowname = "" # Filename that was flagged for overwrite confirm
|
svowname = "" # Filename that was flagged for overwrite confirm
|
||||||
saveow = False # Whether or not overwrite confirm has been displayed
|
saveow = False # Whether or not overwrite confirm has been displayed
|
||||||
genseqs = [] # Temporary storage for generated sequences
|
genseqs = [] # Temporary storage for generated sequences
|
||||||
|
recentback = False # Whether Back button was recently used without Submitting or Retrying after
|
||||||
useprompt = True # Whether to send the full prompt with every submit action
|
useprompt = True # Whether to send the full prompt with every submit action
|
||||||
breakmodel = False # For GPU users, whether to use both system RAM and VRAM to conserve VRAM while offering speedup compared to CPU-only
|
breakmodel = False # For GPU users, whether to use both system RAM and VRAM to conserve VRAM while offering speedup compared to CPU-only
|
||||||
bmsupported = False # Whether the breakmodel option is supported (GPT-Neo/GPT-J only, currently)
|
bmsupported = False # Whether the breakmodel option is supported (GPT-Neo/GPT-J only, currently)
|
||||||
|
@ -532,7 +533,7 @@ def do_connect():
|
||||||
#==================================================================#
|
#==================================================================#
|
||||||
@socketio.on('message')
|
@socketio.on('message')
|
||||||
def get_message(msg):
|
def get_message(msg):
|
||||||
print("{0}Data recieved:{1}{2}".format(colors.GREEN, msg, colors.END))
|
print("{0}Data received:{1}{2}".format(colors.GREEN, msg, colors.END))
|
||||||
# Submit action
|
# Submit action
|
||||||
if(msg['cmd'] == 'submit'):
|
if(msg['cmd'] == 'submit'):
|
||||||
if(vars.mode == "play"):
|
if(vars.mode == "play"):
|
||||||
|
@ -668,6 +669,10 @@ def get_message(msg):
|
||||||
vars.worldinfo[msg['data']]["selective"] = True
|
vars.worldinfo[msg['data']]["selective"] = True
|
||||||
elif(msg['cmd'] == 'wiseloff'):
|
elif(msg['cmd'] == 'wiseloff'):
|
||||||
vars.worldinfo[msg['data']]["selective"] = False
|
vars.worldinfo[msg['data']]["selective"] = False
|
||||||
|
elif(msg['cmd'] == 'wiconstanton'):
|
||||||
|
vars.worldinfo[msg['data']]["constant"] = True
|
||||||
|
elif(msg['cmd'] == 'wiconstantoff'):
|
||||||
|
vars.worldinfo[msg['data']]["constant"] = False
|
||||||
elif(msg['cmd'] == 'sendwilist'):
|
elif(msg['cmd'] == 'sendwilist'):
|
||||||
commitwi(msg['data'])
|
commitwi(msg['data'])
|
||||||
elif(msg['cmd'] == 'aidgimport'):
|
elif(msg['cmd'] == 'aidgimport'):
|
||||||
|
@ -828,6 +833,7 @@ def actionsubmit(data, actionmode=0):
|
||||||
return
|
return
|
||||||
set_aibusy(1)
|
set_aibusy(1)
|
||||||
|
|
||||||
|
vars.recentback = False
|
||||||
vars.actionmode = actionmode
|
vars.actionmode = actionmode
|
||||||
|
|
||||||
# "Action" mode
|
# "Action" mode
|
||||||
|
@ -881,13 +887,18 @@ def actionretry(data):
|
||||||
return
|
return
|
||||||
if(vars.aibusy):
|
if(vars.aibusy):
|
||||||
return
|
return
|
||||||
set_aibusy(1)
|
|
||||||
# Remove last action if possible and resubmit
|
# Remove last action if possible and resubmit
|
||||||
if(len(vars.actions) > 0):
|
if(vars.gamestarted if vars.useprompt else len(vars.actions) > 0):
|
||||||
last_key = vars.actions.get_last_key()
|
set_aibusy(1)
|
||||||
vars.actions.pop()
|
if(not vars.recentback and len(vars.actions) != 0 and len(vars.genseqs) == 0): # Don't pop if we're in the "Select sequence to keep" menu or if there are no non-prompt actions
|
||||||
remove_story_chunk(last_key + 1)
|
last_key = vars.actions.get_last_key()
|
||||||
|
vars.actions.pop()
|
||||||
|
remove_story_chunk(last_key + 1)
|
||||||
|
vars.genseqs = []
|
||||||
calcsubmit('')
|
calcsubmit('')
|
||||||
|
vars.recentback = False
|
||||||
|
elif(not vars.useprompt):
|
||||||
|
emit('from_server', {'cmd': 'errmsg', 'data': "Please enable \"Always Add Prompt\" to retry with your prompt."})
|
||||||
|
|
||||||
#==================================================================#
|
#==================================================================#
|
||||||
#
|
#
|
||||||
|
@ -896,10 +907,15 @@ def actionback():
|
||||||
if(vars.aibusy):
|
if(vars.aibusy):
|
||||||
return
|
return
|
||||||
# Remove last index of actions and refresh game screen
|
# Remove last index of actions and refresh game screen
|
||||||
if(len(vars.actions) > 0):
|
if(len(vars.genseqs) == 0 and len(vars.actions) > 0):
|
||||||
last_key = vars.actions.get_last_key()
|
last_key = vars.actions.get_last_key()
|
||||||
vars.actions.pop()
|
vars.actions.pop()
|
||||||
|
vars.recentback = True
|
||||||
remove_story_chunk(last_key + 1)
|
remove_story_chunk(last_key + 1)
|
||||||
|
elif(len(vars.genseqs) == 0):
|
||||||
|
emit('from_server', {'cmd': 'errmsg', 'data': "Cannot delete the prompt."})
|
||||||
|
else:
|
||||||
|
vars.genseqs = []
|
||||||
|
|
||||||
#==================================================================#
|
#==================================================================#
|
||||||
# Take submitted text and build the text to be given to generator
|
# Take submitted text and build the text to be given to generator
|
||||||
|
@ -1515,7 +1531,7 @@ def togglewimode():
|
||||||
#
|
#
|
||||||
#==================================================================#
|
#==================================================================#
|
||||||
def addwiitem():
|
def addwiitem():
|
||||||
ob = {"key": "", "keysecondary": "", "content": "", "num": len(vars.worldinfo), "init": False, "selective": False}
|
ob = {"key": "", "keysecondary": "", "content": "", "num": len(vars.worldinfo), "init": False, "selective": False, "constant": False}
|
||||||
vars.worldinfo.append(ob);
|
vars.worldinfo.append(ob);
|
||||||
emit('from_server', {'cmd': 'addwiitem', 'data': ob}, broadcast=True)
|
emit('from_server', {'cmd': 'addwiitem', 'data': ob}, broadcast=True)
|
||||||
|
|
||||||
|
@ -1570,6 +1586,7 @@ def commitwi(ar):
|
||||||
vars.worldinfo[ob["num"]]["keysecondary"] = ob["keysecondary"]
|
vars.worldinfo[ob["num"]]["keysecondary"] = ob["keysecondary"]
|
||||||
vars.worldinfo[ob["num"]]["content"] = ob["content"]
|
vars.worldinfo[ob["num"]]["content"] = ob["content"]
|
||||||
vars.worldinfo[ob["num"]]["selective"] = ob["selective"]
|
vars.worldinfo[ob["num"]]["selective"] = ob["selective"]
|
||||||
|
vars.worldinfo[ob["num"]]["constant"] = ob.get("constant", False)
|
||||||
# Was this a deletion request? If so, remove the requested index
|
# Was this a deletion request? If so, remove the requested index
|
||||||
if(vars.deletewi >= 0):
|
if(vars.deletewi >= 0):
|
||||||
del vars.worldinfo[vars.deletewi]
|
del vars.worldinfo[vars.deletewi]
|
||||||
|
@ -1628,6 +1645,10 @@ def checkworldinfo(txt):
|
||||||
# Scan text for matches on WI keys
|
# Scan text for matches on WI keys
|
||||||
wimem = ""
|
wimem = ""
|
||||||
for wi in vars.worldinfo:
|
for wi in vars.worldinfo:
|
||||||
|
if(wi.get("constant", False)):
|
||||||
|
wimem = wimem + wi["content"] + "\n"
|
||||||
|
continue
|
||||||
|
|
||||||
if(wi["key"] != ""):
|
if(wi["key"] != ""):
|
||||||
# Split comma-separated keys
|
# Split comma-separated keys
|
||||||
keys = wi["key"].split(",")
|
keys = wi["key"].split(",")
|
||||||
|
@ -1847,12 +1868,13 @@ def saveRequest(savpath):
|
||||||
|
|
||||||
# Extract only the important bits of WI
|
# Extract only the important bits of WI
|
||||||
for wi in vars.worldinfo:
|
for wi in vars.worldinfo:
|
||||||
if(wi["key"] != ""):
|
if(wi["constant"] or wi["key"] != ""):
|
||||||
js["worldinfo"].append({
|
js["worldinfo"].append({
|
||||||
"key": wi["key"],
|
"key": wi["key"],
|
||||||
"keysecondary": wi["keysecondary"],
|
"keysecondary": wi["keysecondary"],
|
||||||
"content": wi["content"],
|
"content": wi["content"],
|
||||||
"selective": wi["selective"]
|
"selective": wi["selective"],
|
||||||
|
"constant": wi["constant"]
|
||||||
})
|
})
|
||||||
|
|
||||||
# Write it
|
# Write it
|
||||||
|
@ -1917,7 +1939,8 @@ def loadRequest(loadpath):
|
||||||
"content": wi["content"],
|
"content": wi["content"],
|
||||||
"num": num,
|
"num": num,
|
||||||
"init": True,
|
"init": True,
|
||||||
"selective": wi.get("selective", False)
|
"selective": wi.get("selective", False),
|
||||||
|
"constant": wi.get("constant", False)
|
||||||
})
|
})
|
||||||
num += 1
|
num += 1
|
||||||
|
|
||||||
|
@ -2035,7 +2058,8 @@ def importgame():
|
||||||
"content": wi["entry"],
|
"content": wi["entry"],
|
||||||
"num": num,
|
"num": num,
|
||||||
"init": True,
|
"init": True,
|
||||||
"selective": wi.get("selective", False)
|
"selective": wi.get("selective", False),
|
||||||
|
"constant": wi.get("constant", False)
|
||||||
})
|
})
|
||||||
num += 1
|
num += 1
|
||||||
|
|
||||||
|
@ -2081,7 +2105,8 @@ def importAidgRequest(id):
|
||||||
"content": wi["entry"],
|
"content": wi["entry"],
|
||||||
"num": num,
|
"num": num,
|
||||||
"init": True,
|
"init": True,
|
||||||
"selective": wi.get("selective", False)
|
"selective": wi.get("selective", False),
|
||||||
|
"constant": wi.get("constant", False)
|
||||||
})
|
})
|
||||||
num += 1
|
num += 1
|
||||||
|
|
||||||
|
@ -2114,7 +2139,8 @@ def wiimportrequest():
|
||||||
"content": wi["entry"],
|
"content": wi["entry"],
|
||||||
"num": num,
|
"num": num,
|
||||||
"init": True,
|
"init": True,
|
||||||
"selective": wi.get("selective", False)
|
"selective": wi.get("selective", False),
|
||||||
|
"constant": wi.get("constant", False)
|
||||||
})
|
})
|
||||||
num += 1
|
num += 1
|
||||||
|
|
||||||
|
@ -2163,13 +2189,17 @@ if __name__ == "__main__":
|
||||||
loadsettings()
|
loadsettings()
|
||||||
|
|
||||||
# Start Flask/SocketIO (Blocking, so this must be last method!)
|
# Start Flask/SocketIO (Blocking, so this must be last method!)
|
||||||
print("{0}Server started!\rYou may now connect with a browser at http://127.0.0.1:5000/{1}".format(colors.GREEN, colors.END))
|
|
||||||
#socketio.run(app, host='0.0.0.0', port=5000)
|
#socketio.run(app, host='0.0.0.0', port=5000)
|
||||||
if(vars.remote):
|
if(vars.remote):
|
||||||
from flask_cloudflared import start_cloudflared
|
from flask_cloudflared import _run_cloudflared
|
||||||
start_cloudflared(5000)
|
cloudflare = _run_cloudflared(5000)
|
||||||
|
with open('cloudflare.log', 'w') as cloudflarelog:
|
||||||
|
cloudflarelog.write("KoboldAI has finished loading and is available in the following link : " + cloudflare)
|
||||||
|
print(format(colors.GREEN) + "KoboldAI has finished loading and is available in the following link : " + cloudflare + format(colors.END))
|
||||||
socketio.run(app, host='0.0.0.0', port=5000)
|
socketio.run(app, host='0.0.0.0', port=5000)
|
||||||
else:
|
else:
|
||||||
import webbrowser
|
import webbrowser
|
||||||
webbrowser.open_new('http://localhost:5000')
|
webbrowser.open_new('http://localhost:5000')
|
||||||
|
print("{0}Server started!\rYou may now connect with a browser at http://127.0.0.1:5000/{1}".format(colors.GREEN, colors.END))
|
||||||
socketio.run(app)
|
socketio.run(app)
|
||||||
|
|
19
fileops.py
19
fileops.py
|
@ -59,14 +59,23 @@ def getdirpath(dir, title):
|
||||||
#==================================================================#
|
#==================================================================#
|
||||||
def getstoryfiles():
|
def getstoryfiles():
|
||||||
list = []
|
list = []
|
||||||
for file in listdir(getcwd()+"/stories"):
|
for file in listdir(path.dirname(path.realpath(__file__))+"/stories"):
|
||||||
if file.endswith(".json"):
|
if file.endswith(".json"):
|
||||||
ob = {}
|
ob = {}
|
||||||
ob["name"] = file.replace(".json", "")
|
ob["name"] = file.replace(".json", "")
|
||||||
f = open(getcwd()+"/stories/"+file, "r")
|
f = open(path.dirname(path.realpath(__file__))+"/stories/"+file, "r")
|
||||||
js = json.load(f)
|
try:
|
||||||
|
js = json.load(f)
|
||||||
|
except:
|
||||||
|
print(f"Browser loading error: {file} is malformed or not a JSON file.")
|
||||||
|
f.close()
|
||||||
|
continue
|
||||||
f.close()
|
f.close()
|
||||||
ob["actions"] = len(js["actions"])
|
try:
|
||||||
|
ob["actions"] = len(js["actions"])
|
||||||
|
except TypeError:
|
||||||
|
print(f"Browser loading error: {file} has incorrect format.")
|
||||||
|
continue
|
||||||
list.append(ob)
|
list.append(ob)
|
||||||
return list
|
return list
|
||||||
|
|
||||||
|
@ -74,4 +83,4 @@ def getstoryfiles():
|
||||||
# Returns True if json file exists with requested save name
|
# Returns True if json file exists with requested save name
|
||||||
#==================================================================#
|
#==================================================================#
|
||||||
def saveexists(name):
|
def saveexists(name):
|
||||||
return path.exists(getcwd()+"/stories/"+name+".json")
|
return path.exists(path.dirname(path.realpath(__file__))+"/stories/"+name+".json")
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
transformers == 4.5.1
|
git+https://github.com/finetuneanon/transformers@gpt-neo-localattention3-rp-b
|
||||||
tensorflow-gpu
|
tensorflow-gpu
|
||||||
Flask == 1.1.2
|
Flask == 1.1.2
|
||||||
Flask-SocketIO == 5.0.1
|
Flask-SocketIO == 5.0.1
|
||||||
|
|
|
@ -189,13 +189,14 @@ function addWiLine(ob) {
|
||||||
<button type=\"button\" class=\"btn btn-success heighthalf hidden\" id=\"btn_widel"+ob.num+"\">✓</button>\
|
<button type=\"button\" class=\"btn btn-success heighthalf hidden\" id=\"btn_widel"+ob.num+"\">✓</button>\
|
||||||
<button type=\"button\" class=\"btn btn-danger heighthalf hidden\" id=\"btn_wican"+ob.num+"\">⮌</button>\
|
<button type=\"button\" class=\"btn btn-danger heighthalf hidden\" id=\"btn_wican"+ob.num+"\">⮌</button>\
|
||||||
</div>\
|
</div>\
|
||||||
<div class=\"wikey\">\
|
<div class=\"icon-container wikey\">\
|
||||||
<input class=\"form-control heightfull hidden\" type=\"text\" placeholder=\"Key(s)\" id=\"wikey"+ob.num+"\">\
|
<input class=\"form-control heightfull hidden\" type=\"text\" placeholder=\"Key(s)\" id=\"wikey"+ob.num+"\">\
|
||||||
<input class=\"form-control heighthalf\" type=\"text\" placeholder=\"Primary Key(s)\" id=\"wikeyprimary"+ob.num+"\">\
|
<input class=\"form-control heighthalf\" type=\"text\" placeholder=\"Primary Key(s)\" id=\"wikeyprimary"+ob.num+"\">\
|
||||||
<input class=\"form-control heighthalf\" type=\"text\" placeholder=\"Secondary Key(s)\" id=\"wikeysecondary"+ob.num+"\">\
|
<input class=\"form-control heighthalf\" type=\"text\" placeholder=\"Secondary Key(s)\" id=\"wikeysecondary"+ob.num+"\">\
|
||||||
|
<span class=\"constant-key-icon "+(ob.constant ? "constant-key-icon-enabled" : "")+" oi oi-pin\" id=\"constant-key-"+ob.num+"\" title=\"Toggle Constant Key mode (if enabled, this world info entry will always be included in memory)\" aria-hidden=\"true\"></span>\
|
||||||
</div>\
|
</div>\
|
||||||
<div class=\"wientry\">\
|
<div class=\"wientry\">\
|
||||||
<textarea class=\"form-control\" id=\"wientry"+ob.num+"\" placeholder=\"What To Remember\">"+ob.content+"</textarea>\
|
<textarea class=\"layer-bottom form-control\" id=\"wientry"+ob.num+"\" placeholder=\"What To Remember\">"+ob.content+"</textarea>\
|
||||||
</div>\
|
</div>\
|
||||||
<div class=\"wiselective\">\
|
<div class=\"wiselective\">\
|
||||||
<button type=\"button\" class=\"btn btn-success heightfull hidden\" id=\"btn_wiselon"+ob.num+"\">Enable Selective Mode</button>\
|
<button type=\"button\" class=\"btn btn-success heightfull hidden\" id=\"btn_wiselon"+ob.num+"\">Enable Selective Mode</button>\
|
||||||
|
@ -209,10 +210,11 @@ function addWiLine(ob) {
|
||||||
<button type=\"button\" class=\"btn btn-success heighthalf hidden\" id=\"btn_widel"+ob.num+"\">✓</button>\
|
<button type=\"button\" class=\"btn btn-success heighthalf hidden\" id=\"btn_widel"+ob.num+"\">✓</button>\
|
||||||
<button type=\"button\" class=\"btn btn-danger heighthalf hidden\" id=\"btn_wican"+ob.num+"\">⮌</button>\
|
<button type=\"button\" class=\"btn btn-danger heighthalf hidden\" id=\"btn_wican"+ob.num+"\">⮌</button>\
|
||||||
</div>\
|
</div>\
|
||||||
<div class=\"wikey\">\
|
<div class=\"icon-container wikey\">\
|
||||||
<input class=\"form-control heightfull\" type=\"text\" placeholder=\"Key(s)\" id=\"wikey"+ob.num+"\">\
|
<input class=\"form-control heightfull\" type=\"text\" placeholder=\"Key(s)\" id=\"wikey"+ob.num+"\">\
|
||||||
<input class=\"form-control heighthalf hidden\" type=\"text\" placeholder=\"Primary Key(s)\" id=\"wikeyprimary"+ob.num+"\">\
|
<input class=\"form-control heighthalf hidden\" type=\"text\" placeholder=\"Primary Key(s)\" id=\"wikeyprimary"+ob.num+"\">\
|
||||||
<input class=\"form-control heighthalf hidden\" type=\"text\" placeholder=\"Secondary Key(s)\" id=\"wikeysecondary"+ob.num+"\">\
|
<input class=\"form-control heighthalf hidden\" type=\"text\" placeholder=\"Secondary Key(s)\" id=\"wikeysecondary"+ob.num+"\">\
|
||||||
|
<span class=\"constant-key-icon "+(ob.constant ? "constant-key-icon-enabled" : "")+" oi oi-pin\" id=\"constant-key-"+ob.num+"\" title=\"Toggle Constant Key mode (if enabled, this world info entry will always be included in memory)\" aria-hidden=\"true\"></span>\
|
||||||
</div>\
|
</div>\
|
||||||
<div class=\"wientry\">\
|
<div class=\"wientry\">\
|
||||||
<textarea class=\"form-control\" id=\"wientry"+ob.num+"\" placeholder=\"What To Remember\">"+ob.content+"</textarea>\
|
<textarea class=\"form-control\" id=\"wientry"+ob.num+"\" placeholder=\"What To Remember\">"+ob.content+"</textarea>\
|
||||||
|
@ -239,13 +241,14 @@ function addWiLine(ob) {
|
||||||
<button type=\"button\" class=\"btn btn-success heighthalf hidden\" id=\"btn_widel"+ob.num+"\">✓</button>\
|
<button type=\"button\" class=\"btn btn-success heighthalf hidden\" id=\"btn_widel"+ob.num+"\">✓</button>\
|
||||||
<button type=\"button\" class=\"btn btn-danger heighthalf hidden\" id=\"btn_wican"+ob.num+"\">X</button>\
|
<button type=\"button\" class=\"btn btn-danger heighthalf hidden\" id=\"btn_wican"+ob.num+"\">X</button>\
|
||||||
</div>\
|
</div>\
|
||||||
<div class=\"wikey\">\
|
<div class=\"icon-container wikey\">\
|
||||||
<input class=\"form-control heightfull hidden\" type=\"text\" placeholder=\"Key(s)\" id=\"wikey"+ob.num+"\">\
|
<input class=\"form-control heightfull hidden\" type=\"text\" placeholder=\"Key(s)\" id=\"wikey"+ob.num+"\">\
|
||||||
<input class=\"form-control heighthalf hidden\" type=\"text\" placeholder=\"Primary Key(s)\" id=\"wikeyprimary"+ob.num+"\">\
|
<input class=\"form-control heighthalf hidden\" type=\"text\" placeholder=\"Primary Key(s)\" id=\"wikeyprimary"+ob.num+"\">\
|
||||||
<input class=\"form-control heighthalf hidden\" type=\"text\" placeholder=\"Secondary Key(s)\" id=\"wikeysecondary"+ob.num+"\">\
|
<input class=\"form-control heighthalf hidden\" type=\"text\" placeholder=\"Secondary Key(s)\" id=\"wikeysecondary"+ob.num+"\">\
|
||||||
|
<span class=\"constant-key-icon oi oi-pin hidden\" id=\"constant-key-"+ob.num+"\" title=\"Toggle Constant Key mode (if enabled, this world info entry will always be included in memory)\" aria-hidden=\"true\"></span>\
|
||||||
</div>\
|
</div>\
|
||||||
<div class=\"wientry\">\
|
<div class=\"wientry\">\
|
||||||
<textarea class=\"form-control hidden\" id=\"wientry"+ob.num+"\" placeholder=\"What To Remember\"></textarea>\
|
<textarea class=\"layer-bottom form-control hidden\" id=\"wientry"+ob.num+"\" placeholder=\"What To Remember\">"+ob.content+"</textarea>\
|
||||||
</div>\
|
</div>\
|
||||||
<div class=\"wiselective\">\
|
<div class=\"wiselective\">\
|
||||||
<button type=\"button\" class=\"btn btn-success heightfull hidden\" id=\"btn_wiselon"+ob.num+"\">Enable Selective Mode</button>\
|
<button type=\"button\" class=\"btn btn-success heightfull hidden\" id=\"btn_wiselon"+ob.num+"\">Enable Selective Mode</button>\
|
||||||
|
@ -258,6 +261,18 @@ function addWiLine(ob) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// Assign actions to other elements
|
// Assign actions to other elements
|
||||||
|
wientry_onfocus = function () {
|
||||||
|
$("#constant-key-"+ob.num).addClass("constant-key-icon-clickthrough");
|
||||||
|
}
|
||||||
|
wientry_onfocusout = function () {
|
||||||
|
$("#constant-key-"+ob.num).removeClass("constant-key-icon-clickthrough");
|
||||||
|
}
|
||||||
|
$("#wikey"+ob.num).on("focus", wientry_onfocus);
|
||||||
|
$("#wikeyprimary"+ob.num).on("focus", wientry_onfocus);
|
||||||
|
$("#wikeysecondary"+ob.num).on("focus", wientry_onfocus);
|
||||||
|
$("#wikey"+ob.num).on("focusout", wientry_onfocusout);
|
||||||
|
$("#wikeyprimary"+ob.num).on("focusout", wientry_onfocusout);
|
||||||
|
$("#wikeysecondary"+ob.num).on("focusout", wientry_onfocusout);
|
||||||
$("#btn_wican"+ob.num).on("click", function () {
|
$("#btn_wican"+ob.num).on("click", function () {
|
||||||
hideWiDeleteConfirm(ob.num);
|
hideWiDeleteConfirm(ob.num);
|
||||||
});
|
});
|
||||||
|
@ -270,10 +285,20 @@ function addWiLine(ob) {
|
||||||
$("#btn_wiseloff"+ob.num).on("click", function () {
|
$("#btn_wiseloff"+ob.num).on("click", function () {
|
||||||
disableWiSelective(ob.num);
|
disableWiSelective(ob.num);
|
||||||
});
|
});
|
||||||
|
$("#constant-key-"+ob.num).on("click", function () {
|
||||||
|
element = $("#constant-key-"+ob.num);
|
||||||
|
if(element.hasClass("constant-key-icon-enabled")) {
|
||||||
|
socket.send({'cmd': 'wiconstantoff', 'data': ob.num});
|
||||||
|
element.removeClass("constant-key-icon-enabled")
|
||||||
|
} else {
|
||||||
|
socket.send({'cmd': 'wiconstanton', 'data': ob.num});
|
||||||
|
element.addClass("constant-key-icon-enabled");
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function expandWiLine(num) {
|
function expandWiLine(num) {
|
||||||
show([$("#wikey"+num), $("#wientry"+num), $("#btn_wiselon"+num)]);
|
show([$("#wikey"+num), $("#wientry"+num), $("#constant-key-"+num), $("#btn_wiselon"+num)]);
|
||||||
$("#btn_wi"+num).html("X");
|
$("#btn_wi"+num).html("X");
|
||||||
$("#btn_wi"+num).off();
|
$("#btn_wi"+num).off();
|
||||||
// Tell server the WI entry was initialized
|
// Tell server the WI entry was initialized
|
||||||
|
@ -297,6 +322,7 @@ function enableWiSelective(num) {
|
||||||
hide([$("#btn_wiselon"+num), $("#wikey"+num)]);
|
hide([$("#btn_wiselon"+num), $("#wikey"+num)]);
|
||||||
// Tell server the WI entry is now selective
|
// Tell server the WI entry is now selective
|
||||||
socket.send({'cmd': 'wiselon', 'data': num});
|
socket.send({'cmd': 'wiselon', 'data': num});
|
||||||
|
$("#wikeyprimary"+num).val($("#wikey"+num).val());
|
||||||
show([$("#wikeyprimary"+num), $("#wikeysecondary"+num), $("#btn_wiseloff"+num)]);
|
show([$("#wikeyprimary"+num), $("#wikeysecondary"+num), $("#btn_wiseloff"+num)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -304,6 +330,7 @@ function disableWiSelective(num) {
|
||||||
hide([$("#btn_wiseloff"+num), $("#wikeyprimary"+num), $("#wikeysecondary"+num)]);
|
hide([$("#btn_wiseloff"+num), $("#wikeyprimary"+num), $("#wikeysecondary"+num)]);
|
||||||
// Tell server the WI entry is now non-selective
|
// Tell server the WI entry is now non-selective
|
||||||
socket.send({'cmd': 'wiseloff', 'data': num});
|
socket.send({'cmd': 'wiseloff', 'data': num});
|
||||||
|
$("#wikey"+num).val($("#wikeyprimary"+num).val());
|
||||||
show([$("#btn_wiselon"+num), $("#wikey"+num)]);
|
show([$("#btn_wiselon"+num), $("#wikey"+num)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -436,11 +463,12 @@ function returnWiList(ar) {
|
||||||
var list = [];
|
var list = [];
|
||||||
var i;
|
var i;
|
||||||
for(i=0; i<ar.length; i++) {
|
for(i=0; i<ar.length; i++) {
|
||||||
var ob = {"key": "", "keysecondary": "", "content": "", "num": ar[i], "selective": false};
|
var ob = {"key": "", "keysecondary": "", "content": "", "num": ar[i], "selective": false, "constant": false};
|
||||||
ob.selective = $("#wikeyprimary"+ar[i]).css("display") != "none"
|
ob.selective = $("#wikeyprimary"+ar[i]).css("display") != "none"
|
||||||
ob.key = ob.selective ? $("#wikeyprimary"+ar[i]).val() : $("#wikey"+ar[i]).val();
|
ob.key = ob.selective ? $("#wikeyprimary"+ar[i]).val() : $("#wikey"+ar[i]).val();
|
||||||
ob.keysecondary = $("#wikeysecondary"+ar[i]).val()
|
ob.keysecondary = $("#wikeysecondary"+ar[i]).val()
|
||||||
ob.content = $("#wientry"+ar[i]).val();
|
ob.content = $("#wientry"+ar[i]).val();
|
||||||
|
ob.constant = $("#constant-key-"+ar[i]).hasClass("constant-key-icon-enabled");
|
||||||
list.push(ob);
|
list.push(ob);
|
||||||
}
|
}
|
||||||
socket.send({'cmd': 'sendwilist', 'data': list});
|
socket.send({'cmd': 'sendwilist', 'data': list});
|
||||||
|
@ -1102,11 +1130,13 @@ $(document).ready(function(){
|
||||||
});
|
});
|
||||||
|
|
||||||
button_actretry.on("click", function(ev) {
|
button_actretry.on("click", function(ev) {
|
||||||
|
hideMessage();
|
||||||
socket.send({'cmd': 'retry', 'data': ''});
|
socket.send({'cmd': 'retry', 'data': ''});
|
||||||
hidegenseqs();
|
hidegenseqs();
|
||||||
});
|
});
|
||||||
|
|
||||||
button_actback.on("click", function(ev) {
|
button_actback.on("click", function(ev) {
|
||||||
|
hideMessage();
|
||||||
socket.send({'cmd': 'back', 'data': ''});
|
socket.send({'cmd': 'back', 'data': ''});
|
||||||
hidegenseqs();
|
hidegenseqs();
|
||||||
});
|
});
|
||||||
|
|
|
@ -507,6 +507,54 @@ chunk, chunk * {
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icon-container {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.constant-key-icon {
|
||||||
|
position: absolute !important;
|
||||||
|
top: 5px !important;
|
||||||
|
right: 5px !important;
|
||||||
|
z-index: 1;
|
||||||
|
transform: rotate(20deg);
|
||||||
|
-moz-transform: rotate(20deg);
|
||||||
|
-webkit-transform: rotate(20deg);
|
||||||
|
-ms-transform: rotate(20deg);
|
||||||
|
-o-transform: rotate(20deg);
|
||||||
|
opacity: 0%;
|
||||||
|
}
|
||||||
|
|
||||||
|
*:hover > .constant-key-icon {
|
||||||
|
opacity: 40%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.constant-key-icon:hover {
|
||||||
|
opacity: 65%;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.constant-key-icon-enabled {
|
||||||
|
color: #3bf723;
|
||||||
|
opacity: 65%
|
||||||
|
}
|
||||||
|
|
||||||
|
*:hover > .constant-key-icon-enabled {
|
||||||
|
opacity: 65%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.constant-key-icon-enabled:hover {
|
||||||
|
opacity: 100%
|
||||||
|
}
|
||||||
|
|
||||||
|
.constant-key-icon-clickthrough {
|
||||||
|
opacity: 0% !important;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.constant-key-icon-clickthrough.constant-key-icon-enabled {
|
||||||
|
opacity: 35% !important;
|
||||||
|
}
|
||||||
|
|
||||||
.loadlistheader {
|
.loadlistheader {
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
display: grid;
|
display: grid;
|
||||||
|
|
File diff suppressed because one or more lines are too long
Binary file not shown.
|
@ -13,6 +13,7 @@
|
||||||
<link rel="stylesheet" href="static/bootstrap.min.css">
|
<link rel="stylesheet" href="static/bootstrap.min.css">
|
||||||
<link rel="stylesheet" href="static/bootstrap-toggle.min.css">
|
<link rel="stylesheet" href="static/bootstrap-toggle.min.css">
|
||||||
<link rel="stylesheet" href="static/custom.css?ver=0.15.0g">
|
<link rel="stylesheet" href="static/custom.css?ver=0.15.0g">
|
||||||
|
<link rel="stylesheet" href="static/open-iconic-bootstrap.min.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|
Loading…
Reference in New Issue