Browse Source

added error console

version-14
Rushabh Mehta 13 years ago
parent
commit
16d4dc97f6
4 changed files with 17 additions and 12 deletions
  1. +8
    -0
      js/legacy/globals.js
  2. +0
    -6
      js/legacy/webpage/body.js
  3. +1
    -1
      py/webnotes/boot.py
  4. +8
    -5
      py/webnotes/session_cache.py

+ 8
- 0
js/legacy/globals.js View File

@@ -78,3 +78,11 @@ var validated = true;
var validation_message = ''; var validation_message = '';
var tinymce_loaded = null; var tinymce_loaded = null;
var cur_autosug = null; var cur_autosug = null;

if(!console) {
var console = {
log: function(txt) {
errprint(txt);
}
}
}

+ 0
- 6
js/legacy/webpage/body.js View File

@@ -82,12 +82,6 @@ function Body() {
this.wrapper = $a($i('body_div'),'div'); this.wrapper = $a($i('body_div'),'div');
this.body = $a(this.wrapper, 'div'); this.body = $a(this.wrapper, 'div');
// sidebars
if(user_defaults.hide_sidebars) {
this.cp.left_sidebar_width = null;
this.cp.right_sidebar_width = null;
}


this.setup_page_areas(); this.setup_page_areas();




+ 1
- 1
py/webnotes/boot.py View File

@@ -22,7 +22,7 @@ def get_bootinfo():
del cp[field] del cp[field]
# system info # system info
bootinfo['control_panel'] = cp
bootinfo['control_panel'] = cp.copy()
bootinfo['account_name'] = cp.get('account_id') bootinfo['account_name'] = cp.get('account_id')
bootinfo['sysdefaults'] = webnotes.utils.get_defaults() bootinfo['sysdefaults'] = webnotes.utils.get_defaults()




+ 8
- 5
py/webnotes/session_cache.py View File

@@ -60,15 +60,18 @@ def load(country):
else: else:
raise e raise e
def add_to_cache(sd, country):
def add_to_cache(bootinfo, country):
"""add to cache""" """add to cache"""
import webnotes.model.utils import webnotes.model.utils


if sd.get('docs'):
sd['docs'] = webnotes.model.utils.compress(sd['docs'])
if bootinfo.get('docs'):
bootinfo['docs'] = webnotes.model.utils.compress(bootinfo['docs'])


# delete earlier (?) # delete earlier (?)
webnotes.conn.sql("delete from __SessionCache where user=%s and country=%s", (webnotes.session['user'], country))
webnotes.conn.sql("""delete from __SessionCache where user=%s
and country=%s""", (webnotes.session['user'], country))


# make new # make new
webnotes.conn.sql("insert into `__SessionCache` (user, country, cache) VALUES (%s, %s, %s)", (webnotes.session['user'], country, str(sd)))
webnotes.conn.sql("""insert into `__SessionCache`
(user, country, cache) VALUES (%s, %s, %s)""", \
(webnotes.session['user'], country, str(bootinfo)))

Loading…
Cancel
Save