# HG changeset patch # User Sylvain Thénault # Date 1278429325 -7200 # Node ID 9af8ac182f53b1067fa198bbd9fdccb9bfc4e200 # Parent 91c61feb5bc87fb41fb12cfafd759d24aea446f6 [javascript] fix some javascript errors and remove some deprecation warnings diff -r 91c61feb5bc8 -r 9af8ac182f53 web/data/cubicweb.ajax.js --- a/web/data/cubicweb.ajax.js Tue Jul 06 17:11:44 2010 +0200 +++ b/web/data/cubicweb.ajax.js Tue Jul 06 17:15:25 2010 +0200 @@ -567,7 +567,7 @@ rql = rql || ''; nodeid = nodeid || (compid + 'Component'); extraargs = extraargs || {}; - var node = jqNode(nodeid); + var node = cw.jqNode(nodeid); return node.loadxhtml('json', ajaxFuncArgs('component', null, compid, rql, registry, extraargs)); } diff -r 91c61feb5bc8 -r 9af8ac182f53 web/data/cubicweb.edition.js --- a/web/data/cubicweb.edition.js Tue Jul 06 17:11:44 2010 +0200 +++ b/web/data/cubicweb.edition.js Tue Jul 06 17:15:25 2010 +0200 @@ -45,7 +45,7 @@ var tabindex = (start == null) ? 15: start; cw.utils.nodeWalkDepthFirst(form, function(elem) { var tagName = elem.tagName.toUpperCase(); - if (inputTypes.contains(tagName)) { + if ($.inArray(tagName, inputTypes)) { if (jQuery(elem).attr('tabindex') != null) { tabindex += 1; jQuery(elem).attr('tabindex', tabindex); @@ -309,7 +309,7 @@ var d = loadRemote('json', args); d.addCallback(function(response) { var dom = getDomFromResponse(response); - preprocessAjaxLoad(null, dom); + loadAjaxHtmlHead(dom); var form = jQuery(dom); form.css('display', 'none'); form.insertBefore(insertBefore).slideDown('fast'); @@ -323,7 +323,7 @@ // to set encoding too. form.closest('form').attr('enctype', 'multipart/form-data').attr('encoding', 'multipart/form-data'); } - postAjaxLoad(dom); + _postAjaxLoad(dom); }); d.addErrback(function(xxx) { log('xxx =', xxx); diff -r 91c61feb5bc8 -r 9af8ac182f53 web/data/cubicweb.widgets.js --- a/web/data/cubicweb.widgets.js Tue Jul 06 17:11:44 2010 +0200 +++ b/web/data/cubicweb.widgets.js Tue Jul 06 17:15:25 2010 +0200 @@ -355,7 +355,7 @@ var variableRegexp = /%\((\w+)\)s/g; // emulates rgx.findAll() while (group = variableRegexp.exec(text)) { - if (!self.variables.contains(group[1])) { + if (!$.inArray(group[1], self.variables)) { unknownVariables.push(group[1]); } it++; diff -r 91c61feb5bc8 -r 9af8ac182f53 web/formwidgets.py --- a/web/formwidgets.py Tue Jul 06 17:11:44 2010 +0200 +++ b/web/formwidgets.py Tue Jul 06 17:15:25 2010 +0200 @@ -570,7 +570,7 @@ # XXX find a way to understand every format fmt = req.property_value('ui.date-format') fmt = fmt.replace('%Y', 'yy').replace('%m', 'mm').replace('%d', 'dd') - req.add_onload(u'jqNode("%s").datepicker(' + req.add_onload(u'cw.jqNode("%s").datepicker(' '{buttonImage: "%s", dateFormat: "%s", firstDay: 1,' ' showOn: "button", buttonImageOnly: true})' % ( domid, req.uiprops['CALENDAR_ICON'], fmt)) @@ -598,7 +598,7 @@ def _render(self, form, field, renderer): req = form._cw domid = field.dom_id(form, self.suffix) - req.add_onload(u'jqNode("%s").timePicker({selectedTime: "%s", step: %s, separator: "%s"})' % ( + req.add_onload(u'cw.jqNode("%s").timePicker({selectedTime: "%s", step: %s, separator: "%s"})' % ( domid, self.timestr, self.timesteps, self.separator)) if self.timestr is None: value = self.values(form, field)[0]