コード例 #1
0
ファイル: wmodmarketpanels.py プロジェクト: timelf123/DEXhub
def init(comm):
    global Comm, Panels, Panel_count
    # globals survive between module calls, clean
    Comm = comm
    Comm.send({
        'operation': 'enqueue',
        'module': "main",
        'what': 'open_positions'
    })
    print("init---------")
    print(Panel_count)
    if Panel_count == 0:
        Panels = {}
        Comm.send({
            'operation': 'enqueue',
            'module': "marketpanels",
            'what': 'marketpanels_loadlayout'
        })
    else:
        Panel_count = 0
        reload_panels()

    jq('.draggable-container [class*=col]').sortable({
        "handle": ".panel-body",
        "connectWith": "[class*=col]",
        "receive": drag_receive,
        "tolerance": 'pointer',
        "forcePlaceholderSize": True,
        "opacity": 0.8
    }).disableSelection()
    wglobals.set_timer(0, refresh_data, 5)
コード例 #2
0
window.toastr.info('Welcome to DEX HUB<br>A Bitshares portfolio manager.', None, {"debug": 0, "newestOnTop": 1, "positionClass": "toast-top-center", "closeButton": 1, "progressBar": True})


wglobals.Ws_comm = wwebsockets.Wscomm("ws://127.0.0.1:8808/comm", ws_received)


def init_data():
	if wglobals.Ws_comm.open:
		#wglobals.Ws_comm.send({'call': 'open_positions', 'module': "general", 'operation': 'enqueue_bg'})
		#Ws_comm.send({'call': 'get_balances', 'module': "general", 'operation': 'enqueue_bg'})
		wglobals.clear_timer(0)
	wmodgeneral.Data.data['master_unlocked'] = False

# one time initialisation
wglobals.set_timer(0, init_data, 0.5)


def master_unlock(ev):
	print("unlock:", document["iMPpasshrase"].value)
	wglobals.Ws_comm.send({'call': 'master_unlock', 'data': document["iMPpasshrase"].value, 'module': "general", 'operation': 'enqueue'})


def show_status(ev):
	jq('#infopanel1').toggleClass('hidden')


# bind menu links
for bind in wglobals.Menu_binds.items():
	try:
		document[bind[0]].bind('click', wmodules.menu_click)
コード例 #3
0
document['fassethold'].value = ''
document['fassethold'].bind('change', fassethold_chg)

document['fkey'].value = ''
document['famount'].value = 0
document['famount'].bind('change', famount_chg)

document['fratio'].value = 0
document['fratio'].bind('change', fratio_chg)

document['fholdminimum'].value = 0
document['fminimum'].value = 0
document['ftransferfee'].value = 0.04

document['lidasset'].innerHTML = 'id: ???'
document['lidassethold'].innerHTML = 'id: ???'

document['lblsnapshot_holders'].innerHTML = " ?"
document['lblsnapshot_balance'].innerHTML = " ?"
document['lblsnapshot_status'].innerHTML = " ?"
document['dcsv'].innerHTML = ''

document['btnlaunch'].disabled = True
document['btnsnapshot'].disabled = True

document['btnlaunch'].bind('click', launch_distribution)
document['btnsnapshot'].bind('click', launch_snapshot)

wglobals.set_timer(0, messages_refresh, 2)