master
Steve Nyemba 10 months ago
parent 98086570b6
commit e3d0632237

@ -121,13 +121,14 @@ def html (uri,_config) :
# return _config # return _config
def download(**_args): def download(**_args):
_auth = _args['config']['system']['source']['auth'] _auth = _args['config']['system']['source']['auth']
#
_request = _args['request']
_handler = login(_auth) _handler = login(_auth)
if _args['doc'][-2:] in ['md','ht']: if _request.args['doc'][-2:] in ['md','ht']:
_stream = html(_args['doc'],_args['config']) _stream = html(_request.args['doc'],_args['config'])
else: else:
_stream = _handler.get_file_contents(_args['doc']) _stream = _handler.get_file_contents(_request.args['doc'])
_handler.logout() _handler.logout()
return _stream return _stream
pass pass

@ -125,18 +125,19 @@ def _getproxy(module,name) :
uri = '/'.join(['api',module,name]) uri = '/'.join(['api',module,name])
_args = dict(request.args,**{}) # _args = dict(request.args,**{})
_args['config'] = _handler.config() # _args['config'] = _handler.config()
_plugins = _handler.plugins() _plugins = _handler.plugins()
if uri not in _plugins : if uri not in _plugins :
_data = {} _data = {}
_code = 404 _code = 404
else: else:
pointer = _plugins[uri] pointer = _plugins[uri]
if _args : # if _args :
_data = pointer (**_args) # _data = pointer (**_args)
else: # else:
_data = pointer() # _data = pointer()
_data = pointer(request=request,config=_handler.config())
_code = 200 if _data else 500 _code = 200 if _data else 500
@ -150,18 +151,20 @@ def _post (module,name):
_plugins = _handler.plugins() _plugins = _handler.plugins()
uri = '/'.join(['api',module,name]) uri = '/'.join(['api',module,name])
_args = request.json # _args = request.json
_args['config'] = _config # _args['config'] = _config
code = 404 code = 404
_info = "" _info = ""
if uri in _plugins and _args: if uri in _plugins :
_pointer = _plugins[uri] _pointer = _plugins[uri]
_info = _pointer(**_args) # _info = _pointer(**_args)
_info = _pointer(request=request,config=_handler.config() )
if _info: if _info:
code = 200 code = 200
else: else:
_info = "" # _info = ""
code = 500
# _info =io.BytesIO(_info) # _info =io.BytesIO(_info)

@ -3,7 +3,7 @@
padding:4px; padding:4px;
display:grid; display:grid;
grid-template-columns: 50% 50% ; gap:4px; grid-template-columns: 50% 50% ; gap:4px;
grid-template-rows: 48px 48px auto 32px; grid-template-rows: 48px 64px auto 32px;
font-family: sans-serif; font-family: sans-serif;
font-weight: lighter; font-weight: lighter;
font-size:18px; font-size:18px;
@ -24,11 +24,24 @@
.main .header .title {font-size:28px; text-transform: capitalize; font-weight:bold} .main .header .title {font-size:28px; text-transform: capitalize; font-weight:bold}
.main .header .subtitle {font-size:14px} .main .header .subtitle {font-size:14px}
.main .header img { width:44px; height:44px;} .main .header img { width:44px; height:44px;}
.main .menu { grid-row:2; grid-column: 1 / span 2; background-color: #f3f3f3; .main .menu { grid-row:2; grid-column: 1 / span 2; background-color: #FFFFFF;
display:grid; grid-template-columns: 75px repeat(3,250px) ; gap:4px; display:grid; grid-template-columns: 75px repeat(3,250px) ; gap:4px;
align-items: left; align-items: left;
border:0px;
padding:4px; padding:4px;
border-bottom:3px dotted darkgray;
} }
.main .menu img { width:28px; height:28px;}
.main .menu .icon .button {
border:1px solid #CAD5E0; border-radius:4px; padding:4px;
background-color:#f3f3f3;
height:100%;
;
}
.main .content { .main .content {
grid-row:3; grid-row:3;
grid-column: 1 ; grid-column: 1 ;
@ -40,6 +53,7 @@
} }
.main .content #index { .main .content #index {
text-align: left; text-align: left;
text-wrap: wrap; text-wrap: wrap;

@ -24,9 +24,15 @@
.main .header .subtitle {font-style:italic;font-size:14px; color:gray; text-transform: capitalize;} .main .header .subtitle {font-style:italic;font-size:14px; color:gray; text-transform: capitalize;}
.main .menu {border:0; background-color: #f3f3f3; height:64px; padding:0px; .main .menu {border:0; background-color: #f3f3f3; height:48px; padding:0px;
display:grid; grid-template:64px repeat(6,1fr); gap:4px; background-color: #ffffff; display:grid; grid-template:64px repeat(6,1fr); gap:4px; background-color: #f3f3f3;
align-items: center;
}
.main .menu .icon .button {
border:1px solid #CAD5E0; border-radius:8px; padding:2px;
;
} }
/* .main .content img{ /* .main .content img{
width:99%; width:99%;
border:1px solid #CAD5E0; border:1px solid #CAD5E0;
@ -40,6 +46,16 @@
} */ } */
blockquote { blockquote {
border-left:8px solid #D3D3D3; padding:4px; border-left:8px solid #D3D3D3; padding:4px;
background-color: #000000; color:#f3f3f3;
}
blockquote code { margin-top:8px;
background:black; color:#f3f3f3;padding:10px; text-wrap: nowrap;
line-height: 2; width:99%;
font-family: 'Courier New', Courier, monospace; font-weight:lighter; font-size:14px;}
.code {
padding:8px; font-family:'Courier New', Courier, monospace; font-weight: lighter;
background-color: #000000; color:#f3f3f3; font-size:14px;
} }
.main .content table {border-spacing: 2;} .main .content table {border-spacing: 2;}
.main .content table .active {font-size:14px} .main .content table .active {font-size:14px}
@ -48,9 +64,6 @@
padding:0px; padding:0px;
} }
.code { margin-top:8px;
background:black; color:#d3d3d3;padding:10px; text-wrap: nowrap;
font-family: 'Courier New', Courier, monospace; font-weight:lighter; font-size:13px;}
.main .pane { height:auto;} .main .pane { height:auto;}
.main .pane iframe{ width:100%; border:0px; height:80%;} .main .pane iframe{ width:100%; border:0px; height:80%;}

@ -1,85 +0,0 @@
var search = {}
search.find = function(id,_domid,_attr){
var nodes = jx.dom.get.children(id)
jx.dom.set.focus(_domid)
var term = jx.dom.get.value(_domid).trim()
term = term == ''?'*':term
if (term.length < 2){
$(nodes).show()
jx.dom.set.value('found',nodes.length)
return ;}
$(nodes).hide()
term = RegExp(term.replace(/ /,'|'),'ig')
_count = 0
jx.utils.patterns.visitor (nodes,function(_node){
var _data = _node.getAttribute('data') ;
if (_data[0] == '{' || _data[0] == '['){
_data = JSON.parse(_data)
_found = 0
_attr.forEach(function(_name){
_found += _data[_name].match(term) !=null?1:0
})
}else{
_found = _data.match(term)!=null?1:0
}
_count += _found
if (_found > 0){
$(_node).show()
}
})
jx.dom.set.value('found',_count)
}
search._find = function(id,_domid){
var nodes = jx.dom.get.children(id)
$(nodes).hide()
jx.dom.set.focus(_domid)
var term = jx.dom.get.value(_domid).trim()
if (term.trim().match(/^(author|paper)\:$|''/)){
$('.search .input-frame .found').text(0)
return ;
}
qfocus = (term.match(/author|paper/))
term.replace(/^((author|paper)\:*)/ig,'').trim()
term = RegExp(term.replace(/ /,'|'),'ig')
count = 0;
jx.utils.patterns.visitor(nodes,function(node){
try{
var _data = node.getAttribute('data') ;
if (_data != null){
var _data = JSON.parse( _data) ;
_hasauthors = _data.authors.match(term) != null
_hastitle = _data.title.match(term) != null
_haspub = _data.publication.match(term) != null
_hasname = _data.name.match(term) != null
if(qfocus != null){
if (qfocus[0].trim() == 'author'){
_hasauthors = _hastitle = _haspub = false
}else if (qfocus[0] == 'paper'){
_hasauthors = _haspub = _hasname =false
}
}
if (_hasauthors || _hastitle || _haspub || _hasname){
$(node).show()
++ count;
}
}
}catch(e){
// console.log(e);
;
}
$('.'+id).slideDown()
$('.search .input-frame .found').text(count)
})
}

@ -1,6 +1,6 @@
{%if system.portal %} {%if system.portal %}
<div class="icon active"> <div class="icon active">
<div align="center" class="border border-round" onclick="window.open('{{system.context}}/set/main','_self')" style="display:grid; grid-template-columns:auto auto; gap:4px; align-items:center"> <div align="center" class="button" onclick="window.open('{{system.context}}/set/main','_self')" style="display:grid; grid-template-columns:auto auto; gap:4px; align-items:center ">
<i class="fa-solid fa-chevron-left" style="color:darkgray; display:block"></i> <i class="fa-solid fa-chevron-left" style="color:darkgray; display:block"></i>
<img src="{{system.caller.icon}}" style="height:100%"/> <img src="{{system.caller.icon}}" style="height:100%"/>
</div> </div>

Loading…
Cancel
Save