diff --git a/addons/web/__openerp__.py b/addons/web/__openerp__.py index 5c8d27e11cb..bb9fcaa0dbd 100644 --- a/addons/web/__openerp__.py +++ b/addons/web/__openerp__.py @@ -13,6 +13,7 @@ This module provides the core of the OpenERP Web Client. 'auto_install': True, 'post_load': 'wsgi_postload', 'js' : [ + "static/lib/es5-shim/es5-shim.min.js", "static/lib/datejs/globalization/en-US.js", "static/lib/datejs/core.js", "static/lib/datejs/parser.js", @@ -26,6 +27,7 @@ This module provides the core of the OpenERP Web Client. "static/lib/spinjs/spin.js", "static/lib/jquery.autosize/jquery.autosize.js", "static/lib/jquery.blockUI/jquery.blockUI.js", + "static/lib/jquery.hotkeys/jquery.hotkeys.js", "static/lib/jquery.placeholder/jquery.placeholder.js", "static/lib/jquery.ui/js/jquery-ui-1.9.1.custom.js", "static/lib/jquery.ui.timepicker/js/jquery-ui-timepicker-addon.js", @@ -63,6 +65,7 @@ This module provides the core of the OpenERP Web Client. "static/lib/jquery.ui.notify/css/ui.notify.css", "static/lib/jquery.tipsy/tipsy.css", "static/lib/jquery.textext/jquery.textext.css", + "static/lib/fontawesome/css/font-awesome.css", "static/src/css/base.css", "static/src/css/data_export.css", "static/lib/cleditor/jquery.cleditor.css", diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index 9ac4877d3d4..5ed0c8326f4 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -1685,8 +1685,6 @@ class Reports(http.Controller): if 'ids' in action['datas']: report_ids = action['datas'].pop('ids') report_data.update(action['datas']) - if not report_ids: - raise ValueError("action['datas']['ids'] and context['active_ids'] are undefined") report_id = report_srv.report( request.session.db, request.session.uid, request.session.password, diff --git a/addons/web/http.py b/addons/web/http.py index d2d3a78cf06..7bad66cb7c4 100644 --- a/addons/web/http.py +++ b/addons/web/http.py @@ -21,6 +21,7 @@ import urlparse import uuid import errno import re +import warnings import babel.core import simplejson @@ -35,7 +36,7 @@ import urllib import urllib2 import openerp -import openerp.service.security as security +from openerp.service import security, model as service_model from openerp.tools import config import inspect @@ -181,9 +182,15 @@ class WebRequest(object): def debug(self): return 'debug' in self.httprequest.args + @contextlib.contextmanager + def registry_cr(self): + warnings.warn('please use request.registry and request.cr directly', DeprecationWarning) + yield (self.registry, self.cr) def auth_method_user(): request.uid = request.session.uid + if not request.uid: + raise SessionExpiredException("Session expired") def auth_method_admin(): if not request.db: @@ -390,7 +397,7 @@ def jsonrequest(f): base = f.__name__.lstrip('/') if f.__name__ == "index": base = "" - return route([base, base + "/"], type="json", auth="none")(f) + return route([base, base + "/"], type="json", auth="user")(f) class HttpRequest(WebRequest): """ Regular GET/POST request @@ -400,21 +407,12 @@ class HttpRequest(WebRequest): def __init__(self, *args): super(HttpRequest, self).__init__(*args) params = dict(self.httprequest.args) - ex = set(["session_id"]) - for k in params.keys(): - if k in ex: - del params[k] params.update(self.httprequest.form) params.update(self.httprequest.files) + params.pop('session_id', None) self.params = params def dispatch(self): - akw = {} - for key, value in self.httprequest.args.iteritems(): - if isinstance(value, basestring) and len(value) < 1024: - akw[key] = value - else: - akw[key] = type(value) try: r = self._call_function(**self.params) except werkzeug.exceptions.HTTPException, e: @@ -468,7 +466,7 @@ def httprequest(f): base = f.__name__.lstrip('/') if f.__name__ == "index": base = "" - return route([base, base + "/"], type="http", auth="none")(f) + return route([base, base + "/"], type="http", auth="user")(f) #---------------------------------------------------------- # Local storage of requests @@ -477,18 +475,20 @@ from werkzeug.local import LocalStack _request_stack = LocalStack() -def set_request(request): - class with_obj(object): - def __enter__(self): - _request_stack.push(request) - def __exit__(self, *args): - _request_stack.pop() - return with_obj() +@contextlib.contextmanager +def set_request(req): + _request_stack.push(req) + try: + yield + finally: + _request_stack.pop() + + +request = _request_stack() """ A global proxy that always redirect to the current request object. """ -request = _request_stack() #---------------------------------------------------------- # Controller registration with a metaclass @@ -974,7 +974,7 @@ class Root(object): def _build_router(self, db): _logger.info("Generating routing configuration for database %s" % db) - routing_map = routing.Map() + routing_map = routing.Map(strict_slashes=False) def gen(modules, nodb_only): for module in modules: @@ -1010,11 +1010,11 @@ class Root(object): with registry.cursor() as cr: m = registry.get('ir.module.module') ids = m.search(cr, openerp.SUPERUSER_ID, [('state', '=', 'installed'), ('name', '!=', 'web')]) - installed = set([x['name'] for x in m.read(cr, 1, ids, ['name'])]) - modules_set = modules_set.intersection(set(installed)) - modules = ["web"] + sorted(modules_set) + installed = set(x['name'] for x in m.read(cr, 1, ids, ['name'])) + modules_set = modules_set & installed + # building all other methods - gen(modules, False) + gen(["web"] + sorted(modules_set), False) return routing_map @@ -1040,10 +1040,17 @@ class Root(object): func, arguments = urls.match(path) arguments = dict([(k, v) for k, v in arguments.items() if not k.startswith("_ignored_")]) + @service_model.check + def checked_call(dbname, *a, **kw): + return func(*a, **kw) + def nfunc(*args, **kwargs): kwargs.update(arguments) if getattr(func, '_first_arg_is_req', False): args = (request,) + args + + if request.db: + return checked_call(request.db, *args, **kwargs) return func(*args, **kwargs) request.func = nfunc diff --git a/addons/web/i18n/ar.po b/addons/web/i18n/ar.po index d14cb5d71e0..77fbcf87db1 100644 --- a/addons/web/i18n/ar.po +++ b/addons/web/i18n/ar.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:55+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:54+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/bg.po b/addons/web/i18n/bg.po index e472ccb4169..cfd4094bf8b 100644 --- a/addons/web/i18n/bg.po +++ b/addons/web/i18n/bg.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:55+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:54+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/bn.po b/addons/web/i18n/bn.po index a590ef5ce6f..3b33d0a9df0 100644 --- a/addons/web/i18n/bn.po +++ b/addons/web/i18n/bn.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:55+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:54+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/bs.po b/addons/web/i18n/bs.po index e7d3fe33f4f..b00756011e9 100644 --- a/addons/web/i18n/bs.po +++ b/addons/web/i18n/bs.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:55+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:54+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/ca.po b/addons/web/i18n/ca.po index 205aa498f3d..b6767afb0f6 100644 --- a/addons/web/i18n/ca.po +++ b/addons/web/i18n/ca.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:55+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:54+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/cs.po b/addons/web/i18n/cs.po index 71eeed2e204..13566df5824 100644 --- a/addons/web/i18n/cs.po +++ b/addons/web/i18n/cs.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:55+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:54+0000\n" "X-Generator: Launchpad (build 16799)\n" "X-Poedit-Language: Czech\n" diff --git a/addons/web/i18n/da.po b/addons/web/i18n/da.po index 10b48991673..56a1d357286 100644 --- a/addons/web/i18n/da.po +++ b/addons/web/i18n/da.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:55+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:54+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/de.po b/addons/web/i18n/de.po index 4192e5db42d..93e14a69183 100644 --- a/addons/web/i18n/de.po +++ b/addons/web/i18n/de.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:55+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:54+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/en_AU.po b/addons/web/i18n/en_AU.po index 4001bbdeedb..fa4e75923be 100644 --- a/addons/web/i18n/en_AU.po +++ b/addons/web/i18n/en_AU.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:56+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:55+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/en_GB.po b/addons/web/i18n/en_GB.po index e88dcb592cf..0c5a2a74ec0 100644 --- a/addons/web/i18n/en_GB.po +++ b/addons/web/i18n/en_GB.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:56+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:55+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/es.po b/addons/web/i18n/es.po index 963e418810d..55288154645 100644 --- a/addons/web/i18n/es.po +++ b/addons/web/i18n/es.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:56+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:55+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/es_CL.po b/addons/web/i18n/es_CL.po index 131219d8cc9..386de09f35f 100644 --- a/addons/web/i18n/es_CL.po +++ b/addons/web/i18n/es_CL.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:56+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:55+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/es_CR.po b/addons/web/i18n/es_CR.po index a5f6ba209d9..20d2a5da09a 100644 --- a/addons/web/i18n/es_CR.po +++ b/addons/web/i18n/es_CR.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:56+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:55+0000\n" "X-Generator: Launchpad (build 16799)\n" "Language: es\n" diff --git a/addons/web/i18n/es_DO.po b/addons/web/i18n/es_DO.po index 15c81f7b627..364d12517bd 100644 --- a/addons/web/i18n/es_DO.po +++ b/addons/web/i18n/es_DO.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:56+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:55+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/es_EC.po b/addons/web/i18n/es_EC.po index 362004da28f..5181ea01047 100644 --- a/addons/web/i18n/es_EC.po +++ b/addons/web/i18n/es_EC.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:56+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:55+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/es_MX.po b/addons/web/i18n/es_MX.po index 3977317eb62..3eae32128ac 100644 --- a/addons/web/i18n/es_MX.po +++ b/addons/web/i18n/es_MX.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:56+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:55+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/et.po b/addons/web/i18n/et.po index 40999f2fd97..69758104a95 100644 --- a/addons/web/i18n/et.po +++ b/addons/web/i18n/et.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:55+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:54+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/eu.po b/addons/web/i18n/eu.po index d8db9dacf82..fff79dfd4be 100644 --- a/addons/web/i18n/eu.po +++ b/addons/web/i18n/eu.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:55+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:54+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/fa.po b/addons/web/i18n/fa.po index fd79b47dd88..012a5ec7767 100644 --- a/addons/web/i18n/fa.po +++ b/addons/web/i18n/fa.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:56+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:54+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/fi.po b/addons/web/i18n/fi.po index d443e4b2d24..e176267b439 100644 --- a/addons/web/i18n/fi.po +++ b/addons/web/i18n/fi.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:55+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:54+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/fr.po b/addons/web/i18n/fr.po index 51faf2a482f..a37a779ba42 100644 --- a/addons/web/i18n/fr.po +++ b/addons/web/i18n/fr.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:55+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:54+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/fr_CA.po b/addons/web/i18n/fr_CA.po index c7208b6abae..debc0d4354e 100644 --- a/addons/web/i18n/fr_CA.po +++ b/addons/web/i18n/fr_CA.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:56+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:55+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/gl.po b/addons/web/i18n/gl.po index 666f980f78b..7171e92e491 100644 --- a/addons/web/i18n/gl.po +++ b/addons/web/i18n/gl.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:55+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:54+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/gu.po b/addons/web/i18n/gu.po index 5092f5ffaa5..e17601ad29c 100644 --- a/addons/web/i18n/gu.po +++ b/addons/web/i18n/gu.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:55+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:54+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/hi.po b/addons/web/i18n/hi.po index b629c298ae8..38e4fe56386 100644 --- a/addons/web/i18n/hi.po +++ b/addons/web/i18n/hi.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:55+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:54+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/hr.po b/addons/web/i18n/hr.po index 9d6183c45fa..0e2c87eb4fc 100644 --- a/addons/web/i18n/hr.po +++ b/addons/web/i18n/hr.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:56+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:55+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/hu.po b/addons/web/i18n/hu.po index b3450746ab5..9ae94131c6b 100644 --- a/addons/web/i18n/hu.po +++ b/addons/web/i18n/hu.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:55+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:54+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/id.po b/addons/web/i18n/id.po index e70960939fe..7371b20abe6 100644 --- a/addons/web/i18n/id.po +++ b/addons/web/i18n/id.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:55+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:54+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/it.po b/addons/web/i18n/it.po index f276140ff4e..2ba15f0f52e 100644 --- a/addons/web/i18n/it.po +++ b/addons/web/i18n/it.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:55+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:54+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/ja.po b/addons/web/i18n/ja.po index cd0f4c6d9ca..678febbe3c1 100644 --- a/addons/web/i18n/ja.po +++ b/addons/web/i18n/ja.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:55+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:54+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/ka.po b/addons/web/i18n/ka.po index bd84fece68e..c6b59dcc055 100644 --- a/addons/web/i18n/ka.po +++ b/addons/web/i18n/ka.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:55+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:54+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/ko.po b/addons/web/i18n/ko.po index 103fe5a5f97..602985545ec 100644 --- a/addons/web/i18n/ko.po +++ b/addons/web/i18n/ko.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:55+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:54+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/lo.po b/addons/web/i18n/lo.po index 58546c13cdd..a02d3b0b12c 100644 --- a/addons/web/i18n/lo.po +++ b/addons/web/i18n/lo.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:55+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:54+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/lt.po b/addons/web/i18n/lt.po index 31b3738c837..f99426a05ed 100644 --- a/addons/web/i18n/lt.po +++ b/addons/web/i18n/lt.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:56+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:54+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/lv.po b/addons/web/i18n/lv.po index eee0b7816ed..18797599bb6 100644 --- a/addons/web/i18n/lv.po +++ b/addons/web/i18n/lv.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:56+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:54+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/mk.po b/addons/web/i18n/mk.po index 4cd92634cf3..223f66d278a 100644 --- a/addons/web/i18n/mk.po +++ b/addons/web/i18n/mk.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:56+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:54+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/mn.po b/addons/web/i18n/mn.po index 65f623684ce..2ea95fafe1d 100644 --- a/addons/web/i18n/mn.po +++ b/addons/web/i18n/mn.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:56+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:54+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/nb.po b/addons/web/i18n/nb.po index 9a0496b2e2f..476a5401a0c 100644 --- a/addons/web/i18n/nb.po +++ b/addons/web/i18n/nb.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:56+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:54+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/nl.po b/addons/web/i18n/nl.po index 4f473bb0af2..86a13deddf0 100644 --- a/addons/web/i18n/nl.po +++ b/addons/web/i18n/nl.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:55+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:54+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/nl_BE.po b/addons/web/i18n/nl_BE.po index 6c3cf6fdac5..19d0065a003 100644 --- a/addons/web/i18n/nl_BE.po +++ b/addons/web/i18n/nl_BE.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:56+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:55+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/pl.po b/addons/web/i18n/pl.po index 9bb77bba817..21e178c8a5c 100644 --- a/addons/web/i18n/pl.po +++ b/addons/web/i18n/pl.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:56+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:55+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/pt.po b/addons/web/i18n/pt.po index 7557f419228..6a1c3e499e4 100644 --- a/addons/web/i18n/pt.po +++ b/addons/web/i18n/pt.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:56+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:55+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/pt_BR.po b/addons/web/i18n/pt_BR.po index 5b403ad0a7b..5090d3ed7a1 100644 --- a/addons/web/i18n/pt_BR.po +++ b/addons/web/i18n/pt_BR.po @@ -15,7 +15,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:56+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:55+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/ro.po b/addons/web/i18n/ro.po index f39c73d87aa..714f69cc56d 100644 --- a/addons/web/i18n/ro.po +++ b/addons/web/i18n/ro.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:56+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:55+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/ru.po b/addons/web/i18n/ru.po index 73d1084f83d..35e6a9cae6e 100644 --- a/addons/web/i18n/ru.po +++ b/addons/web/i18n/ru.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:56+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:55+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/sk.po b/addons/web/i18n/sk.po index 11edb68d438..75bf02324bc 100644 --- a/addons/web/i18n/sk.po +++ b/addons/web/i18n/sk.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:56+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:55+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/sl.po b/addons/web/i18n/sl.po index a597d6eacb5..3d8b824c56e 100644 --- a/addons/web/i18n/sl.po +++ b/addons/web/i18n/sl.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:56+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:55+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/sq.po b/addons/web/i18n/sq.po index fefe78ddc61..fea62cffd15 100644 --- a/addons/web/i18n/sq.po +++ b/addons/web/i18n/sq.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:55+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:54+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/sr@latin.po b/addons/web/i18n/sr@latin.po index c56f39b28f4..86360c1396b 100644 --- a/addons/web/i18n/sr@latin.po +++ b/addons/web/i18n/sr@latin.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:56+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:55+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/sv.po b/addons/web/i18n/sv.po index 74dd4599fa5..168ecb12c68 100644 --- a/addons/web/i18n/sv.po +++ b/addons/web/i18n/sv.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:56+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:55+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/th.po b/addons/web/i18n/th.po index 98bc630be4b..42a64dae641 100644 --- a/addons/web/i18n/th.po +++ b/addons/web/i18n/th.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:56+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:55+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/tr.po b/addons/web/i18n/tr.po index 93598e42c75..b7f21e68930 100644 --- a/addons/web/i18n/tr.po +++ b/addons/web/i18n/tr.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:56+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:55+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/uk.po b/addons/web/i18n/uk.po index 3cb75052c4d..280598c22ad 100644 --- a/addons/web/i18n/uk.po +++ b/addons/web/i18n/uk.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:56+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:55+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/vi.po b/addons/web/i18n/vi.po index 2c85d55d305..94150bf766c 100644 --- a/addons/web/i18n/vi.po +++ b/addons/web/i18n/vi.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:56+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:55+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/zh_CN.po b/addons/web/i18n/zh_CN.po index dc66e59541e..4a4af8ded0e 100644 --- a/addons/web/i18n/zh_CN.po +++ b/addons/web/i18n/zh_CN.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:56+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:55+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/i18n/zh_TW.po b/addons/web/i18n/zh_TW.po index 6d3a0a577c5..86fb38f395b 100644 --- a/addons/web/i18n/zh_TW.po +++ b/addons/web/i18n/zh_TW.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-10-08 05:56+0000\n" +"X-Launchpad-Export-Date: 2013-10-16 04:55+0000\n" "X-Generator: Launchpad (build 16799)\n" #. module: web diff --git a/addons/web/static/lib/es5-shim/README.md b/addons/web/static/lib/es5-shim/README.md new file mode 100644 index 00000000000..abe7abe2857 --- /dev/null +++ b/addons/web/static/lib/es5-shim/README.md @@ -0,0 +1,155 @@ +`es5-shim.js` and `es5-shim.min.js` monkey-patch a JavaScript context to +contain all EcmaScript 5 methods that can be faithfully emulated with a +legacy JavaScript engine. + +`es5-sham.js` and `es5-sham.min.js` monkey-patch other ES5 methods as +closely as possible. For these methods, as closely as possible to ES5 +is not very close. Many of these shams are intended only to allow code +to be written to ES5 without causing run-time errors in older engines. +In many cases, this means that these shams cause many ES5 methods to +silently fail. Decide carefully whether this is what you want. + + +## Tests + +The tests are written with the Jasmine BDD test framework. +To run the tests, navigate to /tests/. + +In order to run against the shim-code, the tests attempt to kill the current +implementation of the missing methods. This happens in /tests/helpers/h-kill.js. +So in order to run the tests against the built-in methods, invalidate that file somehow +(comment-out, delete the file, delete the script-tag, etc.). + +## Shims + +### Complete tests ### + +* Array.prototype.every +* Array.prototype.filter +* Array.prototype.forEach +* Array.prototype.indexOf +* Array.prototype.lastIndexOf +* Array.prototype.map +* Array.prototype.some +* Array.prototype.reduce +* Array.prototype.reduceRight +* Array.isArray +* Date.now +* Date.prototype.toJSON +* Function.prototype.bind + * :warning: Caveat: the bound function's length is always 0. + * :warning: Caveat: the bound function has a prototype property. + * :warning: Caveat: bound functions do not try too hard to keep you + from manipulating their ``arguments`` and ``caller`` properties. + * :warning: Caveat: bound functions don't have checks in ``call`` and + ``apply`` to avoid executing as a constructor. +* Number.prototype.toFixed +* Object.keys +* String.prototype.split +* String.prototype.trim +* Date.parse (for ISO parsing) +* Date.prototype.toISOString + +## Shams + +* :warning: Object.create + + For the case of simply "begetting" an object that inherits + prototypically from another, this should work fine across legacy + engines. + + :warning: Object.create(null) will work only in browsers that + support prototype assignment. This creates an object that does not + have any properties inherited from Object.prototype. It will + silently fail otherwise. + + :warning: The second argument is passed to Object.defineProperties + which will probably fail either silently or with extreme predudice. + +* :warning: Object.getPrototypeOf + + This will return "undefined" in some cases. It uses `__proto__` if + it's available. Failing that, it uses constructor.prototype, which + depends on the constructor property of the object's prototype having + not been replaced. If your object was created like this, it won't + work: + + function Foo() { + } + Foo.prototype = {}; + + Because the prototype reassignment destroys the constructor + property. + + This will work for all objects that were created using + `Object.create` implemented with this library. + +* :warning: Object.getOwnPropertyNames + + This method uses Object.keys, so it will not be accurate on legacy + engines. + +* Object.isSealed + + Returns "false" in all legacy engines for all objects, which is + conveniently guaranteed to be accurate. + +* Object.isFrozen + + Returns "false" in all legacy engines for all objects, which is + conveniently guaranteed to be accurate. + +* Object.isExtensible + + Works like a charm, by trying very hard to extend the object then + redacting the extension. + +### May fail + +* :warning: Object.getOwnPropertyDescriptor + + The behavior of this shim does not conform to ES5. It should + probably not be used at this time, until its behavior has been + reviewed and been confirmed to be useful in legacy engines. + +* :warning: Object.defineProperty + + In the worst of circumstances, IE 8 provides a version of this + method that only works on DOM objects. This sham will not be + installed. The given version of `defineProperty` will throw an + exception if used on non-DOM objects. + + In slightly better circumstances, this method will silently fail to + set "writable", "enumerable", and "configurable" properties. + + Providing a getter or setter with "get" or "set" on a descriptor + will silently fail on engines that lack "__defineGetter__" and + "__defineSetter__", which include all versions of IE. + + https://github.com/kriskowal/es5-shim/issues#issue/5 + +* :warning: Object.defineProperties + + This uses the Object.defineProperty shim + +* Object.seal + + Silently fails on all legacy engines. This should be + fine unless you are depending on the safety and security + provisions of this method, which you cannot possibly + obtain in legacy engines. + +* Object.freeze + + Silently fails on all legacy engines. This should be + fine unless you are depending on the safety and security + provisions of this method, which you cannot possibly + obtain in legacy engines. + +* Object.preventExtensions + + Silently fails on all legacy engines. This should be + fine unless you are depending on the safety and security + provisions of this method, which you cannot possibly + obtain in legacy engines. + diff --git a/addons/web/static/lib/es5-shim/es5-shim.js b/addons/web/static/lib/es5-shim/es5-shim.js new file mode 100644 index 00000000000..4609ea2f77a --- /dev/null +++ b/addons/web/static/lib/es5-shim/es5-shim.js @@ -0,0 +1,1320 @@ +// Copyright 2009-2012 by contributors, MIT License +// vim: ts=4 sts=4 sw=4 expandtab + +// Module systems magic dance +(function (definition) { + // RequireJS + if (typeof define == "function") { + define(definition); + // YUI3 + } else if (typeof YUI == "function") { + YUI.add("es5", definition); + // CommonJS and