commit
69c2bfba9a
4 files changed
+16
-9
No files matched your search
@@ -47,3 +47,4 @@ if 'adminLanguage' in request.cookies and not (request.cookies['adminLanguage']
|
||||
#set static_version
|
||||
from gluon.settings import global_settings
|
||||
response.static_version = global_settings.web2py_version.split('-')[0]
|
||||
response.static_version_urls = True
|
||||
@@ -9,7 +9,7 @@ var current_editor = "{{=editor_settings['editor']}}"; //Default editor
|
||||
{{pass}}
|
||||
var current_font_incr = 0; // Default font-size, 0 means don't set
|
||||
</script>
|
||||
{{cm=URL('static%s' % (response.static_version and '/_' + response.static_version or ''),'codemirror')}}
|
||||
{{cm=URL('static', 'codemirror')}}
|
||||
<link rel="stylesheet" href="{{=cm}}/lib/codemirror.css">
|
||||
<link rel="stylesheet" href="{{='%s/theme/%s.css' % (cm, editor_settings['theme'])}}">
|
||||
<script src="{{=cm}}/lib/codemirror.js"></script>
|
||||
|
||||
@@ -44,9 +44,9 @@ def file_create_form(location, anchor=None, helptext=""):
|
||||
url = URL('edit', args=args, vars=vars)
|
||||
return A(file, _class='editor_filelink', _href=url, _style='word-wrap: nowrap;')
|
||||
}}
|
||||
{{cm=URL('static%s' % (response.static_version and '/_' + response.static_version or ''),'codemirror')}}
|
||||
{{js_url=URL('static%s' % (response.static_version and '/_' + response.static_version or ''),'js')}}
|
||||
{{css_url=URL('static%s' % (response.static_version and '/_' + response.static_version or ''),'css')}}
|
||||
{{cm=URL('static', 'codemirror')}}
|
||||
{{js_url=URL('static', 'js')}}
|
||||
{{css_url=URL('static', 'css')}}
|
||||
<link rel="stylesheet" href="{{=cm}}/lib/codemirror.css">
|
||||
<link rel="stylesheet" href="{{='%s/theme/%s.css' % (cm, editor_settings['theme'])}}">
|
||||
<script src="{{=cm}}/lib/codemirror.js"></script>
|
||||
@@ -311,8 +311,8 @@ $(document).ready(function() {
|
||||
});
|
||||
</script>
|
||||
<!-- Typeahead scripts here so the page load faster -->
|
||||
<script src="{{=URL('static%s' % (response.static_version and '/_' + response.static_version or ''), 'js/typeahead.min.js')}}"></script>
|
||||
<script src="{{=URL('static%s' % (response.static_version and '/_' + response.static_version or ''), 'js/hogan-2.0.0.js')}}"></script>
|
||||
<script src="{{=URL('static', 'js/typeahead.min.js')}}"></script>
|
||||
<script src="{{=URL('static', 'js/hogan-2.0.0.js')}}"></script>
|
||||
<script>
|
||||
$('.typeahead-tw').typeahead({
|
||||
name: 'files',
|
||||
|
||||
+9
-3
@@ -234,7 +234,8 @@ class Request(Storage):
|
||||
dpost = cgi.FieldStorage(fp=body, environ=env, keep_blank_values=1)
|
||||
try:
|
||||
post_vars.update(dpost)
|
||||
except: pass
|
||||
except:
|
||||
pass
|
||||
if query_string is not None:
|
||||
env['QUERY_STRING'] = query_string
|
||||
# The same detection used by FieldStorage to detect multipart POSTs
|
||||
@@ -490,7 +491,11 @@ class Response(Storage):
|
||||
for item in files:
|
||||
if isinstance(item, str):
|
||||
f = item.lower().split('?')[0]
|
||||
if self.static_version:
|
||||
# if static_version we need also to check for
|
||||
# static_version_urls. In that case, the _.x.x.x
|
||||
# bit would have already been added by the URL()
|
||||
# function
|
||||
if self.static_version and not self.static_version_urls:
|
||||
item = item.replace(
|
||||
'/static/', '/static/_%s/' % self.static_version, 1)
|
||||
if f.endswith('.css'):
|
||||
@@ -1007,7 +1012,7 @@ class Session(Storage):
|
||||
elif self._secure and response.session_id_name in rcookies:
|
||||
rcookies[response.session_id_name]['secure'] = True
|
||||
|
||||
def clear_session_cookies(sefl):
|
||||
def clear_session_cookies(self):
|
||||
request = current.request
|
||||
response = current.response
|
||||
session = response.session
|
||||
@@ -1189,6 +1194,7 @@ class Session(Storage):
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
def pickle_session(s):
|
||||
return Session, (dict(s),)
|
||||
|
||||
|
||||
Reference in new issue
Block a user