fixed LazyCrypt and fixed git problem

This commit is contained in:
mdipierro
2015-10-07 13:02:30 -05:00
13 changed files with 83 additions and 47 deletions
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
div.flash {
div.w2p_flash {
background-image: none;
border-radius: 4px;
-o-border-radius: 4px;
@@ -15,13 +15,13 @@ div.flash {
margin: 0 0 20px;
padding: 15px 35px 15px 15px;
}
div.flash.alert:hover {
div.w2p_flash.alert:hover {
opacity: 1;
}
.ie-lte8 div.flash {
.ie-lte8 div.w2p_flash {
filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#222222', endColorstr='#000000', GradientType=0);
}
.ie-lte8 div.flash:hover {
.ie-lte8 div.w2p_flash:hover {
filter: alpha(opacity=25);
}
.main-container {
@@ -37,7 +37,7 @@ div.error {
display: inline-block;
padding: 5px;
}
div.flash.alert {
div.w2p_flash.alert {
display: none;
position: fixed;
top: 70px;
@@ -136,7 +136,7 @@ header h1 {
header .jumbotron {
background-color: transparent;
}
.flash {
.w2p_flash {
opacity: 0.9!important;
right: 100px;
}
+6 -6
View File
@@ -33,7 +33,7 @@ audio {width:200px}
[type="text"], [type="password"], select {
margin-right: 5px; width: 300px;
}
.hidden {display:none;visibility:visible}
.w2p_hidden {display:none;visibility:visible}
.right {float:right; text-align:right}
.left {float:left; text-align:left}
.center {width:100%; text-align:center; vertical-align:middle}
@@ -88,7 +88,7 @@ div.w2p_export_menu a, div.w2p_wiki_tags a, div.w2p_cloud a {margin-left:5px; pa
#web2py_user_form td {vertical-align:top}
/*********** web2py specific ***********/
div.flash {
div.w2p_flash {
font-weight:bold;
display:none;
position:fixed;
@@ -117,11 +117,11 @@ div.flash {
z-index:2000;
}
div.flash #closeflash{color:inherit; float:right; margin-left:15px;}
div.w2p_flash #closeflash{color:inherit; float:right; margin-left:15px;}
.ie-lte7 div.flash #closeflash
{color:expression(this.parentNode.currentStyle['color']);float:none;position:absolute;right:4px;}
div.flash:hover { opacity:0.25; }
div.w2p_flash:hover { opacity:0.25; }
div.error_wrapper {display:block}
div.error {
@@ -304,8 +304,8 @@ li.w2p_grid_breadcrumb_elem {
/* fix some IE problems */
.ie-lte7 .topbar .container {z-index:2}
.ie-lte8 div.flash{ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#222222', endColorstr='#000000', GradientType=0 ); }
.ie-lte8 div.flash:hover {filter:alpha(opacity=25);}
.ie-lte8 div.w2p_flash{ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#222222', endColorstr='#000000', GradientType=0 ); }
.ie-lte8 div.w2p_flash:hover {filter:alpha(opacity=25);}
.ie9 #w2p_query_panel {padding-bottom:2px}
.web2py_console .form-control {width: 20%; display: inline;}
@@ -18,9 +18,9 @@
function pe(ul, e) {
var new_line = ml(ul);
rel(ul);
if ($(e.target).parent().is(':visible')) {
if ($(e.target).closest('li').is(':visible')) {
/* make sure we didn't delete the element before we insert after */
new_line.insertAfter($(e.target).parent());
new_line.insertAfter($(e.target).closest('li'));
} else {
/* the line we clicked on was deleted, just add to end of list */
new_line.appendTo(ul);
@@ -30,9 +30,9 @@
}
function rl(ul, e) {
if ($(ul).children().length > 1) {
if ($(ul).find('li').length > 1) {
/* only remove if we have more than 1 item so the list is never empty */
$(e.target).parent().remove();
$(e.target).closest('li').remove();
}
}
@@ -46,13 +46,13 @@
function rel(ul) {
/* keep only as many as needed*/
$(ul).find("li").each(function() {
var trimmed = $.trim($(this.firstChild).val());
var trimmed = $.trim($(this).find(":text").val());
if (trimmed == '') $(this).remove();
else $(this.firstChild).val(trimmed);
else $(this).find(":text").val(trimmed);
});
}
var ul = this;
$(ul).find(":text").after('<a class="btn btn-default" href="#">+</a>&nbsp;<a class="btn btn-default" href="#">-</a>').keypress(function(e) {
$(ul).find(":text").addClass('form-control').wrap("<div class='input-group'></div>").after('<div class="input-group-addon"><i class="glyphicon glyphicon-plus"></i></div><div class="input-group-addon"><i class="glyphicon glyphicon-minus"></i></div>').keypress(function(e) {
return (e.which == 13) ? pe(ul, e) : true;
}).next().click(function(e) {
pe(ul, e);
+6 -6
View File
@@ -133,7 +133,7 @@
},
ajax_init: function(target) {
/*called whenever a fragment gets loaded */
$('.hidden', target).hide();
$('.w2p_hidden', target).hide();
web2py.manage_errors(target);
web2py.ajax_fields(target);
web2py.show_if_handler(target);
@@ -161,7 +161,7 @@
* and require no dom manipulations
*/
var doc = $(document);
doc.on('click', '.flash', function(e) {
doc.on('click', '.w2p_flash', function(e) {
var t = $(this);
if(t.css('top') == '0px') t.slideUp('slow');
else t.fadeOut();
@@ -241,7 +241,7 @@
/*personally I don't like it.
*if there's an error it it flashed and can be removed
*as any other message
*doc.off('click', '.flash')
*doc.off('click', '.w2p_flash')
*/
switch(xhr.status) {
case 500:
@@ -530,13 +530,13 @@
},
/*helper for flash messages*/
flash: function(message, status) {
var flash = $('.flash');
var flash = $('.w2p_flash');
web2py.hide_flash();
flash.html(message).addClass(status);
if(flash.html()) flash.append('<span id="closeflash"> &times; </span>').slideDown();
},
hide_flash: function() {
$('.flash').fadeOut(0).html('');
$('.w2p_flash').fadeOut(0).html('');
},
show_if_handler: function(target) {
var triggers = {};
@@ -692,7 +692,7 @@
$.web2py.component_handler(target);
},
main_hook: function() {
var flash = $('.flash');
var flash = $('.w2p_flash');
flash.hide();
if(flash.html()) web2py.flash(flash.html());
web2py.ajax_init(document);
+8 -8
View File
@@ -155,8 +155,8 @@
{{=T.M("Cache contains items up to **%(hours)02d** %%{hour(hours)} **%(min)02d** %%{minute(min)} **%(sec)02d** %%{second(sec)} old.",
dict(hours=total['oldest'][0], min=total['oldest'][1], sec=total['oldest'][2]))}}
</p>
{{=BUTTON(T('Cache Keys'), _onclick='jQuery("#all_keys").toggle().toggleClass( "hidden" );')}}
<div class="hidden" id="all_keys">
{{=BUTTON(T('Cache Keys'), _onclick='jQuery("#all_keys").toggle().toggleClass( "w2p_hidden" );')}}
<div class="w2p_hidden" id="all_keys">
{{=total['keys']}}
</div>
<br />
@@ -183,8 +183,8 @@
{{=T.M("RAM contains items up to **%(hours)02d** %%{hour(hours)} **%(min)02d** %%{minute(min)} **%(sec)02d** %%{second(sec)} old.",
dict(hours=ram['oldest'][0], min=ram['oldest'][1], sec=ram['oldest'][2]))}}
</p>
{{=BUTTON(T('RAM Cache Keys'), _onclick='jQuery("#ram_keys").toggle().toggleClass( "hidden" );')}}
<div class="hidden" id="ram_keys">
{{=BUTTON(T('RAM Cache Keys'), _onclick='jQuery("#ram_keys").toggle().toggleClass( "w2p_hidden" );')}}
<div class="w2p_hidden" id="ram_keys">
{{=ram['keys']}}
</div>
<br />
@@ -212,8 +212,8 @@
{{=T.M("DISK contains items up to **%(hours)02d** %%{hour(hours)} **%(min)02d** %%{minute(min)} **%(sec)02d** %%{second(sec)} old.",
dict(hours=disk['oldest'][0], min=disk['oldest'][1], sec=disk['oldest'][2]))}}
</p>
{{=BUTTON(T('Disk Cache Keys'), _onclick='jQuery("#disk_keys").toggle().toggleClass( "hidden" );')}}
<div class="hidden" id="disk_keys">
{{=BUTTON(T('Disk Cache Keys'), _onclick='jQuery("#disk_keys").toggle().toggleClass( "w2p_hidden" );')}}
<div class="w2p_hidden" id="disk_keys">
{{=disk['keys']}}
</div>
<br />
@@ -249,8 +249,8 @@
<li><a href="{{=URL('appadmin', 'bg_graph_model', args=['png'])}}">png</a></li>
<li><a href="{{=URL('appadmin', 'bg_graph_model', args=['svg'])}}">svg</a></li>
<li><a href="{{=URL('appadmin', 'bg_graph_model', args=['pdf'])}}">pdf</a></li>
<li><a href="{{=URL('appadmin', 'bg_graph_model', args=['ps'])}}">ps</a></li>
<li><a href="{{=URL('appadmin', 'bg_graph_model', args=['dot'])}}">dot</a></li>
<li><a href="{{=URL('appadmin', 'bg_graph_model', args=['ps'])}}">ps</a></li>
<li><a href="{{=URL('appadmin', 'bg_graph_model', args=['dot'])}}">dot</a></li>
</ul>
</div>
<br />
+1 -1
View File
@@ -46,7 +46,7 @@
</head>
<body>
<!--[if lt IE 8]><p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p><![endif]-->
<div class="flash alert alert-dismissable">{{=response.flash or ''}}</div>
<div class="w2p_flash alert alert-dismissable">{{=response.flash or ''}}</div>
<!-- Navbar ======================================= -->
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container-fluid">
@@ -0,0 +1,5 @@
{{extend 'layout.html'}}
{{=form}}
{{=grid}}
+30 -8
View File
@@ -16,7 +16,7 @@ def quote(text):
class Node:
def __init__(self, name, value, url='.', readonly=False, active=True,
onchange=None, **kwarg):
onchange=None, select=False, size=4, **kwarg):
self.url = url
self.name = name
self.value = str(value)
@@ -26,11 +26,21 @@ class Node:
self.readonly = readonly
self.active = active
self.onchange = onchange
self.size = 4
self.size = size
self.locked = False
self.select = value if select and not isinstance(value, str) else False
def xml(self):
return """<input name="%s" id="%s" value="%s" size="%s"
if self.select:
selectAttributes = dict(_name=self.name,_id=self.name,_size=self.size,
_onblur="ajax('%s/blur',['%s']);"%(self.url,self.name))
# _onkeyup="ajax('%s/keyup',['%s'], ':eval');"%(self.url,self.name),
# _onfocus="ajax('%s/focus',['%s'], ':eval');"%(self.url,self.name),
for k,v in selectAttributes.items():
self.select[k] = v
return self.select.xml()
else:
return """<input name="%s" id="%s" value="%s" size="%s"
onkeyup="ajax('%s/keyup',['%s'], ':eval');"
onfocus="ajax('%s/focus',['%s'], ':eval');"
onblur="ajax('%s/blur',['%s'], ':eval');" %s/>
@@ -391,7 +401,8 @@ class Sheet:
def __init__(self, rows, cols, url='.', readonly=False,
active=True, onchange=None, value=None, data=None,
headers=None, update_button="", **kwarg):
headers=None, update_button="", c_headers=None,
r_headers=None, **kwarg):
"""
Arguments:
@@ -425,6 +436,9 @@ class Sheet:
self.tr_attributes = {}
self.td_attributes = {}
self.c_headers = c_headers
self.r_headers = r_headers
self.data = data
self.readonly = readonly
@@ -505,7 +519,7 @@ class Sheet:
self.environment[name] = obj
def cell(self, key, value, readonly=False, active=True,
onchange=None, **kwarg):
onchange=None, select=False, **kwarg):
"""
key is the name of the cell
value is the initial value of the cell. It can be a formula "=1+3"
@@ -528,7 +542,7 @@ class Sheet:
value = value(r, c)
node = Node(key, value, self.url, readonly, active,
onchange, **kwarg)
onchange, select=select, **kwarg)
self.nodes[key] = node
self[key] = value
@@ -781,11 +795,19 @@ class Sheet:
gluon.html.TH, gluon.html.BR, gluon.html.SCRIPT)
regex = re.compile('r\d+c\d+')
header = TR(TH(), *[TH('c%s' % c)
if not self.c_headers:
header = TR(TH(), *[TH('c%s' % c)
for c in range(self.cols)])
else:
header = TR(TH(), *[TH('%s' % c)
for c in self.c_headers])
rows = []
for r in range(self.rows):
tds = [TH('r%s' % r), ]
if not self.r_headers:
tds = [TH('r%s' % r), ]
else:
tds = [TH('%s' % self.r_headers[r]), ]
for c in range(self.cols):
key = 'r%sc%s' % (r, c)
attributes = {"_class": "w2p_spreadsheet_col_%s" %
+2 -2
View File
@@ -370,8 +370,8 @@ def wsgibase(environ, responder):
cid = env.http_web2py_component_element,
is_local = (env.remote_addr in local_hosts and
client == env.remote_addr),
is_shell = cmd_opts and cmd_opts.shell,
is_sheduler = cmd_opts and cmd_opts.scheduler,
is_shell = False,
is_scheduler = False,
is_https = env.wsgi_url_scheme in HTTPS_SCHEMES or \
request.env.http_x_forwarded_proto in HTTPS_SCHEMES \
or env.https == 'on'
+2
View File
@@ -129,6 +129,8 @@ def env(
if global_settings.cmd_options:
ip = global_settings.cmd_options.ip
port = global_settings.cmd_options.port
request.is_shell = global_settings.cmd_options.shell is not None
request.is_scheduler = global_settings.cmd_options.scheduler is not None
else:
ip, port = '127.0.0.1', '8000'
request.env.http_host = '%s:%s' % (ip, port)
+5
View File
@@ -938,6 +938,8 @@ def formstyle_bootstrap3_inline_factory(col_label_size=3):
elif isinstance(controls, UL):
for e in controls.elements("input"):
e.add_class('form-control')
elif controls is None or isinstance(controls, basestring):
_controls = P(controls, _class="form-control-static %s" % col_class)
if isinstance(label, LABEL):
label['_class'] = 'control-label %s' % label_col_class
@@ -1668,6 +1670,9 @@ class SQLFORM(FORM):
elif field.type == 'double':
if value is not None:
fields[fieldname] = safe_float(value)
elif field.type in ('string', 'text'):
if fieldname in self.request_vars:
fields[fieldname] = self.request_vars[fieldname]
for fieldname in self.vars:
if fieldname != 'id' and fieldname in self.table.fields\
+2 -2
View File
@@ -578,9 +578,9 @@ class IS_IN_DB(Validator):
records = self.dbset(table).select(table.ALL, **dd)
self.theset = [str(r[self.kfield]) for r in records]
if isinstance(self.label, str):
self.labels = [self.label % r for r in records]
self.labels = [self.label % r for r in records.render()]
else:
self.labels = [self.label(r) for r in records]
self.labels = [self.label(r) for r in records.render]
def options(self, zero=True):
self.build_set()