[MERGE] Merge with lp:openerp-web

bzr revid: hip@tinyerp.com-20121109054718-a8uyj818yzfnp15m
This commit is contained in:
Hiral Patel (OpenERP) 2012-11-09 11:17:18 +05:30
commit 2945aca3f0
57 changed files with 19954 additions and 5365 deletions

View File

@ -17,7 +17,7 @@ This module provides the core of the OpenERP Web Client.
"static/lib/datejs/parser.js", "static/lib/datejs/parser.js",
"static/lib/datejs/sugarpak.js", "static/lib/datejs/sugarpak.js",
"static/lib/datejs/extras.js", "static/lib/datejs/extras.js",
"static/lib/jquery/jquery-1.7.2.js", "static/lib/jquery/jquery-1.8.2.js",
"static/lib/jquery.MD5/jquery.md5.js", "static/lib/jquery.MD5/jquery.md5.js",
"static/lib/jquery.form/jquery.form.js", "static/lib/jquery.form/jquery.form.js",
"static/lib/jquery.validate/jquery.validate.js", "static/lib/jquery.validate/jquery.validate.js",
@ -25,7 +25,7 @@ This module provides the core of the OpenERP Web Client.
"static/lib/spinjs/spin.js", "static/lib/spinjs/spin.js",
"static/lib/jquery.autosize/jquery.autosize.js", "static/lib/jquery.autosize/jquery.autosize.js",
"static/lib/jquery.blockUI/jquery.blockUI.js", "static/lib/jquery.blockUI/jquery.blockUI.js",
"static/lib/jquery.ui/js/jquery-ui-1.8.17.custom.min.js", "static/lib/jquery.ui/js/jquery-ui-1.9.1.custom.js",
"static/lib/jquery.ui.timepicker/js/jquery-ui-timepicker-addon.js", "static/lib/jquery.ui.timepicker/js/jquery-ui-timepicker-addon.js",
"static/lib/jquery.ui.notify/js/jquery.notify.js", "static/lib/jquery.ui.notify/js/jquery.notify.js",
"static/lib/jquery.deferred-queue/jquery.deferred-queue.js", "static/lib/jquery.deferred-queue/jquery.deferred-queue.js",
@ -55,7 +55,7 @@ This module provides the core of the OpenERP Web Client.
"static/src/js/view_tree.js", "static/src/js/view_tree.js",
], ],
'css' : [ 'css' : [
"static/lib/jquery.ui.bootstrap/css/custom-theme/jquery-ui-1.8.16.custom.css", "static/lib/jquery.ui.bootstrap/css/custom-theme/jquery-ui-1.9.0.custom.css",
"static/lib/jquery.ui.timepicker/css/jquery-ui-timepicker-addon.css", "static/lib/jquery.ui.timepicker/css/jquery-ui-timepicker-addon.css",
"static/lib/jquery.ui.notify/css/ui.notify.css", "static/lib/jquery.ui.notify/css/ui.notify.css",
"static/lib/jquery.tipsy/tipsy.css", "static/lib/jquery.tipsy/tipsy.css",

View File

@ -11,12 +11,15 @@ Contents:
.. toctree:: .. toctree::
:maxdepth: 1 :maxdepth: 1
presentation
changelog-7.0 changelog-7.0
async async
rpc rpc
widget widget
qweb
search-view search-view
list-view list-view

View File

@ -0,0 +1,36 @@
Presentation
============
Prerequisites
-------------
Prerequisites to code addons for the OpenERP Web Client:
- Html
- Css
- Javascript
- jQuery
Once you know all this, that's only the beginning. Most usages of Javascript/jQuery are small hacks to make a web page nicer. The OpenERP Client Web is different: it's a web application, not a web site. It doesn't have multiple pages generated by a server side code. Only one unique empty page is loaded and all the html is generated by Javascript code, the page is never reloaded. If you never developed that kind of application you still have lot of good practices to learn.
Recommendations
---------------
First, here are the 5 golden rules when you create web 2.0 applications:
* **Do not use ids**. Html ids are evil, the key anti-feature that makes your components non-reusable. You want to identify a dom part? Save a jQuery object over that dom element. If you really need to use ids, use _.uniqueId(), but 99% of the time you don't need to, classes are sufficient.
* **Do not use predictable css class names** like "content" or "navigation", ten other developers will have the same idea than you and there will be clashes. A simple way to avoid this is to use prefixes. For example, if you need a css class for the button named "new" that is contained in the form view which is itself contained in the OpenERP application, name it "oe-form-view-new-button".
* **Do not use global selectors** like *$(".my-class")*, you never know if your component will be instantiated multiple times. Limit the selector with a context, like *$(".my-class", this.$el)*.
* As a general advice, **Never assume you own the page**. When you create a component, it is never unique and is always surrounded by a bunch of crazy html. You have to do with it.
* **Learn how to use jQuery's deferreds** [1]_. That concept may seem over-complicated, but the experience tell us that it is nearly impossible to create big-size javascript applications without that.
More recommendations related to the specific case of the OpenERP Web Client:
* Your components should inherit from the *Widget* class.
* Use QWeb templates for html rendering.
* Use *Widget* 's methods (*appendTo*, *replace*,...) to insert your component and its content into the dom.
* All css classes should have the prefix *oe-* .
* Functions that call rpc() should return a deferred, even if it calls it indirectly. So a function that calls a function that calls a function that calls rpc() should return a deferred too.
.. [1] http://api.jquery.com/category/deferred-object/

79
addons/web/doc/qweb.rst Normal file
View File

@ -0,0 +1,79 @@
QWeb Cookbook
=============
QWeb is the template engine used by the OpenERP Web Client. It is a home made engine create by OpenERP developers. There are a few things to note about it:
* Template are rendered in javascript on the client-side, the server does nothing.
* It is an xml template engine, like Facelets_ for example. The source file must be a valid xml.
* Templates are not interpreted. There are compiled to javascript. This makes them a lot faster to render, but sometimes harder to debug.
* Most of the time it is used through the Widget class, but you can also use it directly using *openerp.web.qweb.render()* .
.. _Facelets: http://en.wikipedia.org/wiki/Facelets
Here is a typical QWeb file:
::
<?xml version="1.0" encoding="UTF-8"?>
<templates>
<t t-name="Template1">
<div>...</div>
</t>
<t t-name="Template2">
<div>...</div>
</t>
</templates>
A QWeb file contains multiple templates, they are simply identified by a name.
Here is a sample QWeb template:
::
<t t-name="UserPage">
<div>
<p>Name: <t t-esc="widget.user_name"/></p>
<p>Password: <input type="text" t-att-value="widget.password"/></p>
<p t-if="widget.is_admin">This user is an Administrator</p>
<t t-foreach="widget.roles" t-as="role">
<p>User has role: <t t-esc="role"/></p>
</t>
</div>
</t>
*widget* is a variable given to the template engine by Widget sub-classes when they decide to render their associated template, it is simply *this*. Here is the corresponding Widget sub-class:
::
UserPageWidget = openerp.base.Widget.extend({
template: "UserPage",
init: function(parent) {
this._super(parent);
this.user_name = "Xavier";
this.password = "lilo";
this.is_admin = true;
this.roles = ["Web Developer", "IE Hater", "Steve Jobs Worshiper"];
},
});
It could output something like this:
::
<div>
<p>Name: Xavier</p>
<p>Password: <input type="text" value="lilo"/></p>
<p>This user is an Administrator</p
<p>User has role: Web Developer</p>
<p>User has role: IE Hater</p>
<p>User has role: Steve Jobs Worshiper</p>
</div>
A QWeb template should always contain one unique root element to be used effectively with the Widget class, here it is a *<div>*. QWeb only react to *<t>* elements or attributes prefixed by *t-*. The *<t>* is simply a null element, it is only used when you need to use a *t-* attribute without outputting an html element at the same time. Here are the effects of the most common QWeb attributes:
* *t-esc* outputs the result of the evaluation of the given javascript expression
* *t-att-ATTR* sets the value of the *ATTR* attribute to the result of the evaluation of the given javascript expression
* *t-if* outputs the element and its content only if the given javascript expression returns true
* *t-foreach* outputs as many times as contained in the list returned by the given javascript expression. For each iteration, a variable with the name defined by *t-as* contains the current element in the list.

View File

@ -1,21 +0,0 @@
Copyright 2011 Xavier Morel. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are
permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of
conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list
of conditions and the following disclaimer in the documentation and/or other materials
provided with the distribution.
THIS SOFTWARE IS PROVIDED BY XAVIER MOREL ``AS IS'' AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -1,59 +0,0 @@
.. -*- restructuredtext -*-
In jQuery 1.5, jQuery has introduced a Deferred object in order to
better handle callbacks.
Along with Deferred, it introduced ``jQuery.when`` which allows, among
other things, for multiplexing deferreds (waiting on multiple
deferreds at the same time).
While this is very nice if all deferreds are available at the same
point, it doesn't really work if the resolution of a deferred can
generate more deferreds, or for collections of deferreds coming from
multiple sources (which may not be aware of one another).
Deferred.queue tries to be a solution to this. It is based on the
principle of FIFO multiple-producers multiple-consumers tasks queues,
such as Python's `queue.Queue`_. Any code with a reference to the
queue can add a promise to the queue, and the queue (which is a
promise itself) will only be resolved once all promises within are
resolved.
Quickstart
----------
Deferred.queue has a very simple life cycle: it is dormant when
created, it starts working as soon as promises get added to it (via
``.push``, or by providing them directly to its constructor), and as
soon as the last promise in the queue is resolved it resolves itself.
If any promise in the queue fails, the queue itself will be rejected
(without waiting for further promises).
Once a queue has been resolved or rejected, adding new promises to it
results in an error.
API
---
``jQuery.Deferred.queue([promises...])``
Creates a new deferred queue. Can be primed with a series of promise
objects.
``.push(promise...)``
Adds promises to the queue. Returns the queue itself (can be
chained).
If the queue has already been resolved or rejected, raises an error.
``.then([doneCallbacks][, failCallbacks])``
Promise/A ``then`` method.
``.done(doneCallbacks)``
jQuery ``done`` extension to promise objects
``.fail(failCallbacks)``
jQuery ``fail`` extension to promise objects
.. _queue.Queue:
http://docs.python.org/dev/library/queue.html

View File

@ -1,34 +0,0 @@
(function ($) {
"use strict";
$.extend($.Deferred, {
queue: function () {
var queueDeferred = $.Deferred();
var promises = 0;
function resolve() {
if (--promises > 0) {
return;
}
setTimeout($.proxy(queueDeferred, 'resolve'), 0);
}
var promise = $.extend(queueDeferred.promise(), {
push: function () {
if (this.isResolved() || this.isRejected()) {
throw new Error("Can not add promises to a resolved "
+ "or rejected promise queue");
}
promises += 1;
$.when.apply(null, arguments).then(
resolve, $.proxy(queueDeferred, 'reject'));
return this;
}
});
if (arguments.length) {
promise.push.apply(promise, arguments);
}
return promise;
}
});
})(jQuery)

View File

@ -0,0 +1,31 @@
#jQuery UI Bootstrap
##Summary
This is a project I started to bring the beauty of Twitter's Bootstrap to jQuery UI widgets.
Twitter's Bootstrap was one of my favorite projects to come out of 2011, but having used it regularly it left me wanting two things:
* The ability to work side-by-side with jQuery UI (something which caused a number of widgets to break visually)
* The ability to theme jQuery UI widgets using Bootstrap styles. Whilst I love jQuery UI, I (like others) find some of the current themes to look a little dated. My hope is that this theme provides a decent alternative for others that feel the same.
To clarify, this project doesn't aim or intend to replace Twitter Bootstrap. It merely provides a jQuery UI-compatible theme inspired by Bootstrap's design. It also provides a version of Bootstrap CSS with a few (minor) sections commented out which enable the theme to work along-side it.
I welcome any and all feedback as I'd very much like this theme to be as solid as possible.
##Browser-support
All modern browsers are targeted by this theme with 'lo-res' experiences (i.e no gradients, border-radius etc.) provided for users using older browsers.
There *are* some minor known issues lingering that I'm working on, but the hope is that in time those will all get ironed out.
##jQuery UI support
This theme targets jQuery UI 1.8.16 and the default version of jQuery included in the (current) jQuery UI builds (jQuery 1.6.2). I'm aware of jQuery 1.7.1 and intend on upgrading anything necessary in the theme to use it when the jQuery UI team officially include it in their theme packs.
##Demo
For a live preview of the theme, see [http://addyosmani.github.com/jquery-ui-bootstrap](http://addyosmani.github.com/jquery-ui-bootstrap).
A [blog post](http://addyosmani.com/blog/jquery-ui-bootstrap/) with some more details about the project is also available.

View File

Before

Width:  |  Height:  |  Size: 180 B

After

Width:  |  Height:  |  Size: 180 B

View File

Before

Width:  |  Height:  |  Size: 120 B

After

Width:  |  Height:  |  Size: 120 B

View File

Before

Width:  |  Height:  |  Size: 105 B

After

Width:  |  Height:  |  Size: 105 B

View File

Before

Width:  |  Height:  |  Size: 111 B

After

Width:  |  Height:  |  Size: 111 B

View File

Before

Width:  |  Height:  |  Size: 110 B

After

Width:  |  Height:  |  Size: 110 B

View File

Before

Width:  |  Height:  |  Size: 107 B

After

Width:  |  Height:  |  Size: 107 B

View File

Before

Width:  |  Height:  |  Size: 101 B

After

Width:  |  Height:  |  Size: 101 B

View File

Before

Width:  |  Height:  |  Size: 123 B

After

Width:  |  Height:  |  Size: 123 B

View File

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@ -23,6 +23,7 @@
.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
/* Interaction Cues /* Interaction Cues
----------------------------------*/ ----------------------------------*/
.ui-state-disabled { cursor: default !important; } .ui-state-disabled { cursor: default !important; }
@ -59,7 +60,7 @@
----------------------------------*/ ----------------------------------*/
.ui-widget { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size:13px; } .ui-widget { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size:13px; }
.ui-widget .ui-widget { font-size: 1em; } .ui-widget .ui-widget { font-size: 1em; }
/*.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 1em; }*/ .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 1em; }
.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_75_ffffff_1x400.png) 50% 50% repeat-x; color: #404040; } .ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_75_ffffff_1x400.png) 50% 50% repeat-x; color: #404040; }
.ui-widget-content a { color: #404040; } .ui-widget-content a { color: #404040; }
.ui-widget-header { .ui-widget-header {
@ -399,7 +400,6 @@
.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } .ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
/* Overlays */ /* Overlays */
.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); } .ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); }
.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/* .ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/*
@ -432,9 +432,9 @@
*/ */
.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; } .ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
/* /*
* jQuery UI Accordion 1.8.16 * jQuery UI Accordion 1.9.0
* *
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses. * Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license * http://jquery.org/license
* *
@ -445,7 +445,7 @@
.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; font-weight:bold; } .ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; font-weight:bold; }
.ui-accordion .ui-accordion-li-fix { display: inline; } .ui-accordion .ui-accordion-li-fix { display: inline; }
.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } .ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; } .ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em 1.7em; }
.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; } .ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; }
.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } .ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; } .ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; }
@ -465,46 +465,55 @@
* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ * html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
/* /*
* jQuery UI Menu 1.8.16 * jQuery UI Menu 1.9.0
* *
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) * Copyright 2012-10-11, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses. * Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license * http://jquery.org/license
* *
* http://docs.jquery.com/UI/Menu#theming * http://docs.jquery.com/UI/Menu#theming
*/ */
.ui-menu {
list-style:none; .ui-menu { list-style:none; padding: 2px; margin: 0; display:block; float:left; outline: none; }
padding: 2px; .ui-menu .ui-menu { margin-top: -3px; position: absolute; }
margin: 0; .ui-menu .ui-menu-item { margin: 0; padding: 0; zoom: 1;float: left;clear: left; width: 100%; }
display:block; .ui-menu .ui-menu-divider { margin: 5px -2px 5px -2px; height: 0; font-size: 0; line-height: 0; border-width: 1px 0 0 0; }
float: left; .ui-menu .ui-menu-item a { text-decoration: none; display: block; padding: 2px .4em; line-height: 1.5; zoom: 1; font-weight: normal; }
} .ui-menu .ui-menu-item a.ui-state-focus,
.ui-menu .ui-menu { .ui-menu .ui-menu-item a.ui-state-active {
margin-top: -3px; font-weight: normal;
} margin: 0;
.ui-menu .ui-menu-item { color: #ffffff;
margin:0; background: #0064cd;
padding: 0; background-color: #0064cd;
zoom: 1; background-repeat: repeat-x;
float: left; background-image: -khtml-gradient(linear, left top, left bottom, from(#049cdb), to(#0064cd));
clear: left; background-image: -moz-linear-gradient(top, #049cdb, #0064cd);
width: 100%; background-image: -ms-linear-gradient(top, #049cdb, #0064cd);
} background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #049cdb), color-stop(100%, #0064cd));
.ui-menu .ui-menu-item a { background-image: -webkit-linear-gradient(top, #049cdb, #0064cd);
text-decoration:none; background-image: -o-linear-gradient(top, #049cdb, #0064cd);
display:block; background-image: linear-gradient(top, #049cdb, #0064cd);
padding:.2em .4em; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#049cdb', endColorstr='#0064cd', GradientType=0);
line-height:1.5; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
zoom:1; border-color: #0064cd #0064cd #003f81;
} border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
.ui-menu .ui-menu-item a.ui-state-hover,
.ui-menu .ui-menu-item a.ui-state-active {
font-weight: normal;
background:#0064CD;
color:#fff
} }
.ui-menu .ui-state-disabled { font-weight: normal; margin: .4em 0 .2em; line-height: 1.5; }
.ui-menu .ui-state-disabled a { cursor: default; }
/* icon support */
.ui-menu-icons { position: relative; }
.ui-menu-icons .ui-menu-item a { position: relative; padding-left: 2em; }
/* left-aligned */
.ui-menu .ui-icon { position: absolute; top: .2em; left: .2em; }
/* right-aligned */
.ui-menu .ui-menu-icon { position: static; float: right; }
.ui-menu { width: 200px; margin-bottom: 2em; }
/* /*
* jQuery UI Button 1.8.16 * jQuery UI Button 1.8.16
@ -651,7 +660,31 @@ button.ui-button-icons-only { width: 3.7em; }
/* workarounds */ /* workarounds */
button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
/*
* jQuery UI spinner 1.9.0
*
* Copyright 2012-10-11, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Menu#theming
*/
.ui-spinner { position:relative; display: inline-block; overflow: hidden; padding: 0; vertical-align: middle; }
.ui-spinner-input { border: none; background: none; padding: 0; margin: .2em 0; vertical-align: middle; margin-left: .4em; margin-right: 22px; }
.ui-spinner{}
.ui-spinner-button { width: 16px; height: 50%; font-size: .5em; padding: 0; margin: 0; z-index: 100; text-align: center; position: absolute; cursor: default; display: block; overflow: hidden; right: 0; }
.ui-spinner a.ui-spinner-button { border-top: none; border-bottom: none; border-right: none; } /* more specificity required here to overide default borders */
.ui-spinner .ui-icon { position: absolute; margin-top: -8px; top: 50%; left: 0; } /* vertical centre icon */
.ui-spinner-up { top: 0; }
.ui-spinner-down { bottom: 0; }
/* TR overrides */
span.ui-spinner { background: none; }
.ui-spinner .ui-icon-triangle-1-s {
/* need to fix icons sprite */
background-position:-65px -16px;
}
/* /*
* jQuery UI Dialog 1.8.16 * jQuery UI Dialog 1.8.16
@ -805,14 +838,16 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } .ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
.ui-slider-vertical .ui-slider-range-min { bottom: 0; } .ui-slider-vertical .ui-slider-range-min { bottom: 0; }
.ui-slider-vertical .ui-slider-range-max { top: 0; }/* .ui-slider-vertical .ui-slider-range-max { top: 0; }
* jQuery UI Tabs 1.8.16
/*
* jQuery UI Tabs 1.9.0
* *
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses. * Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license * http://jquery.org/license
* *
* http://docs.jquery.com/UI/Tabs#theming * http://jqueryui.com/tabs/
*/ */
.ui-tabs .ui-tabs-nav{ background:none; border-color: #ddd; .ui-tabs .ui-tabs-nav{ background:none; border-color: #ddd;
border-style: solid; border-style: solid;
@ -824,14 +859,11 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
background:whiteSmoke; background:whiteSmoke;
border-bottom:1px solid #ddd; border-bottom:1px solid #ddd;
padding-bottom:0px; padding-bottom:0px;
color:#4c4c4c; color:#00438A;
} }
.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; border-bottom:1px solid #DDD; } .ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; border-bottom:1px solid #DDD; }
.ui-tabs .ui-tabs-nav li { text-decoration: none; list-style: none; float: left; position: relative; top: 1px; padding: 0px 0px 1px 0px; white-space: nowrap; background:none; border:0px; .ui-tabs .ui-tabs-nav li { text-decoration: none; list-style: none; float: left; position: relative; top: 1px; padding: 0px 0px 1px 0px; white-space: nowrap; background:none; border:0px; }
}
.ui-tabs-nav .ui-state-default{ .ui-tabs-nav .ui-state-default{
-webkit-box-shadow: 0px 0px 0px #ffffff; /* Saf3-4, iOS 4.0.2 - 4.2, Android 2.3+ */ -webkit-box-shadow: 0px 0px 0px #ffffff; /* Saf3-4, iOS 4.0.2 - 4.2, Android 2.3+ */
@ -853,25 +885,24 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
} }
.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 0px; outline:none;}
.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { .ui-tabs .ui-tabs-nav li.ui-tabs-active { margin-bottom: 0; padding-bottom: 0px; outline:none;}
.ui-tabs .ui-tabs-nav li.ui-tabs-active a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a {
background-color: #ffffff; background-color: #ffffff;
border: 1px solid #ddd; border: 1px solid #ddd;
border-bottom-color: #ffffff; border-bottom-color: #ffffff;
cursor: default; cursor: default;
color:#4c4c4c; color:gray;
outline:none; outline:none;
} }
.ui-tabs .ui-tabs-nav li.ui-tabs-active:hover{
.ui-tabs .ui-tabs-nav li.ui-tabs-selected:hover{
background:#ffffff; background:#ffffff;
outline:none; outline:none;
} }
.ui-tabs .ui-tabs-nav li.ui-tabs-active a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-tabs-loading a { cursor: text; }
.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; color:#0069D6; background:none; font-weight:normal; margin-bottom:-1px;} .ui-tabs .ui-tabs-nav li a, .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a { cursor: pointer; color:#0069D6; background:none; font-weight:normal; margin-bottom:-1px;}
/* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; } .ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
.ui-tabs-panel .ui-button{text-decoration:none;} .ui-tabs-panel .ui-button{text-decoration:none;}
@ -883,16 +914,39 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
filter:none; filter:none;
} }
/* /*
* jQuery UI Datepicker 1.8.16 * jQuery UI Tooltip 1.9.0
* *
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Copyright 2012-10-11, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses. * Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license * http://jquery.org/license
* *
* http://docs.jquery.com/UI/Datepicker#theming * http://jqueryui.com/tooltip/
*/
.ui-tooltip {
padding:8px;
position:absolute;
z-index:9999;
-o-box-shadow: 0 0 5px #ddd;
-moz-box-shadow: 0 0 5px #ddd;
-webkit-box-shadow: 0 0 5px #ddd;
/*box-shadow: 0 2px 5px #ddd;*/
box-shadow: inset 0 1px 0 #ffffff;
}
/* Fades and background-images don't work well together in IE6, drop the image */
* html .ui-tooltip {
background-image: none;
}
body .ui-tooltip { border-width:2px; }
/*
* jQuery UI Datepicker 1.9.0
*
* Copyright 2012-10-11, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://jqueryui.com/datepicker/
*/ */
.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; } .ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; border:0px; font-weight: bold; width: 100%; padding: 4px 0; background-color: #f5f5f5; color: #808080; } .ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; border:0px; font-weight: bold; width: 100%; padding: 4px 0; background-color: #f5f5f5; color: #808080; }
@ -982,7 +1036,7 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
} }
.ui-datepicker td:hover{ .ui-datepicker td:hover{
color:white; color: #ffffff;
} }
.ui-datepicker td .ui-state-default { .ui-datepicker td .ui-state-default {
@ -1001,21 +1055,34 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
margin-bottom:0px; margin-bottom:0px;
font-size:normal; font-size:normal;
text-shadow: 0px; text-shadow: 0px;
color:white; color: #ffffff;
-webkit-border-radius: 4px; -webkit-border-radius: 4px;
-moz-border-radius: 4px; -moz-border-radius: 4px;
border-radius: 4px; border-radius: 4px;
} }
.ui-datepicker td .ui-state-default:hover{ .ui-datepicker td .ui-state-hover {
background:#0064cd; color: #ffffff;
color:white; background: #0064cd;
-webkit-border-radius: 4px; background-color: #0064cd;
-moz-border-radius: 4px; background-repeat: repeat-x;
border-radius: 4px; background-image: -khtml-gradient(linear, left top, left bottom, from(#049cdb), to(#0064cd));
background-image: -moz-linear-gradient(top, #049cdb, #0064cd);
background-image: -ms-linear-gradient(top, #049cdb, #0064cd);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #049cdb), color-stop(100%, #0064cd));
background-image: -webkit-linear-gradient(top, #049cdb, #0064cd);
background-image: -o-linear-gradient(top, #049cdb, #0064cd);
background-image: linear-gradient(top, #049cdb, #0064cd);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#049cdb', endColorstr='#0064cd', GradientType=0);
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
border-color: #0064cd #0064cd #003f81;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-khtml-border-radius: 4px;
border-radius: 4px;
} }
/* /*
* jQuery UI Progressbar 1.8.16 * jQuery UI Progressbar 1.8.16
* *
@ -1065,16 +1132,17 @@ input:focus, textarea:focus {
-moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6); -moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6);
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6);
} }
/*input[type=file]:focus, input[type=checkbox]:focus, select:focus { input[type=file]:focus, input[type=checkbox]:focus, select:focus {
-webkit-box-shadow: none; -webkit-box-shadow: none;
-moz-box-shadow: none; -moz-box-shadow: none;
box-shadow: none; box-shadow: none;
outline: 1px dotted #666; outline: 1px dotted #666;
}*/ }
/*input[type="text"], input[type="text"],
input[type="password"], input[type="password"],
textarea,*/ .ui-autocomplete-input,
textarea,
.uneditable-input { .uneditable-input {
display: inline-block; display: inline-block;
padding: 4px; padding: 4px;

View File

@ -1,5 +1,15 @@
.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-left, .ui-corner-bottom{ border-radius:0px;} .ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-left, .ui-corner-bottom{ border-radius:0px;}
/*
* jQuery UI Tabs 1.9.0
*
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://jqueryui.com/tabs/
*/
.ui-state-active,.ui-tabs-selected { border-radius:0px;} .ui-state-active,.ui-tabs-selected { border-radius:0px;}
.ui-tabs-selected { border-radius:0px;} .ui-tabs-selected { border-radius:0px;}
.ui-tabs .ui-tabs-nav li{ filter:none;} .ui-tabs .ui-tabs-nav li{ filter:none;}

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 B

After

Width:  |  Height:  |  Size: 144 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

@ -1,12 +1,8 @@
/* /*! jQuery UI - v1.9.1 - 2012-10-29
* jQuery UI CSS Framework 1.8.17 * http://jqueryui.com
* * Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
* Dual licensed under the MIT or GPL Version 2 licenses. * Copyright (c) 2012 jQuery Foundation and other contributors Licensed MIT */
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Theming/API
*/
/* Layout helpers /* Layout helpers
----------------------------------*/ ----------------------------------*/
@ -36,20 +32,198 @@
/* Overlays */ /* Overlays */
.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.ui-resizable { position: relative;}
.ui-resizable-handle { position: absolute;font-size: 0.1px; display: block; }
.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
.ui-accordion .ui-accordion-header { display: block; cursor: pointer; position: relative; margin-top: 2px; padding: .5em .5em .5em .7em; zoom: 1; }
.ui-accordion .ui-accordion-icons { padding-left: 2.2em; }
.ui-accordion .ui-accordion-noicons { padding-left: .7em; }
.ui-accordion .ui-accordion-icons .ui-accordion-icons { padding-left: 2.2em; }
.ui-accordion .ui-accordion-header .ui-accordion-header-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; overflow: auto; zoom: 1; }
.ui-autocomplete {
position: absolute;
top: 0; /* #8656 */
cursor: default;
}
/* workarounds */
* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
.ui-button, .ui-button:link, .ui-button:visited, .ui-button:hover, .ui-button:active { text-decoration: none; }
.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
.ui-button-icons-only { width: 3.4em; }
button.ui-button-icons-only { width: 3.7em; }
/* /*button text element */
* jQuery UI CSS Framework 1.8.17 .ui-button .ui-button-text { display: block; line-height: 1.4; }
* .ui-button-text-only .ui-button-text { padding: .4em 1em; }
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) .ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
* Dual licensed under the MIT or GPL Version 2 licenses. .ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
* http://jquery.org/license .ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
* .ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
* http://docs.jquery.com/UI/Theming/API /* no icon support for input elements, provide padding by default */
* input.ui-button { padding: .4em 1em; }
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana,Arial,sans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
*/
/*button icon element(s) */
.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
/*button sets*/
.ui-buttonset { margin-right: 7px; }
.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
/* workarounds */
button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
.ui-datepicker .ui-datepicker-prev { left:2px; }
.ui-datepicker .ui-datepicker-next { right:2px; }
.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
.ui-datepicker .ui-datepicker-next-hover { right:1px; }
.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
.ui-datepicker select.ui-datepicker-month,
.ui-datepicker select.ui-datepicker-year { width: 49%;}
.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
.ui-datepicker td { border: 0; padding: 1px; }
.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
/* with multiple calendars */
.ui-datepicker.ui-datepicker-multi { width:auto; }
.ui-datepicker-multi .ui-datepicker-group { float:left; }
.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
.ui-datepicker-row-break { clear:both; width:100%; font-size:0em; }
/* RTL support */
.ui-datepicker-rtl { direction: rtl; }
.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
.ui-datepicker-rtl .ui-datepicker-group { float:right; }
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
.ui-datepicker-cover {
position: absolute; /*must have*/
z-index: -1; /*must have*/
filter: mask(); /*must have*/
top: -4px; /*must have*/
left: -4px; /*must have*/
width: 200px; /*must have*/
height: 200px; /*must have*/
}.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; }
.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; }
.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; }
.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
.ui-draggable .ui-dialog-titlebar { cursor: move; }
.ui-menu { list-style:none; padding: 2px; margin: 0; display:block; outline: none; }
.ui-menu .ui-menu { margin-top: -3px; position: absolute; }
.ui-menu .ui-menu-item { margin: 0; padding: 0; zoom: 1; width: 100%; }
.ui-menu .ui-menu-divider { margin: 5px -2px 5px -2px; height: 0; font-size: 0; line-height: 0; border-width: 1px 0 0 0; }
.ui-menu .ui-menu-item a { text-decoration: none; display: block; padding: 2px .4em; line-height: 1.5; zoom: 1; font-weight: normal; }
.ui-menu .ui-menu-item a.ui-state-focus,
.ui-menu .ui-menu-item a.ui-state-active { font-weight: normal; margin: -1px; }
.ui-menu .ui-state-disabled { font-weight: normal; margin: .4em 0 .2em; line-height: 1.5; }
.ui-menu .ui-state-disabled a { cursor: default; }
/* icon support */
.ui-menu-icons { position: relative; }
.ui-menu-icons .ui-menu-item a { position: relative; padding-left: 2em; }
/* left-aligned */
.ui-menu .ui-icon { position: absolute; top: .2em; left: .2em; }
/* right-aligned */
.ui-menu .ui-menu-icon { position: static; float: right; }
.ui-progressbar { height:2em; text-align: left; overflow: hidden; }
.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }.ui-slider { position: relative; text-align: left; }
.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
.ui-slider-horizontal { height: .8em; }
.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
.ui-slider-horizontal .ui-slider-range-min { left: 0; }
.ui-slider-horizontal .ui-slider-range-max { right: 0; }
.ui-slider-vertical { width: .8em; height: 100px; }
.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
.ui-slider-vertical .ui-slider-range-max { top: 0; }.ui-spinner { position:relative; display: inline-block; overflow: hidden; padding: 0; vertical-align: middle; }
.ui-spinner-input { border: none; background: none; padding: 0; margin: .2em 0; vertical-align: middle; margin-left: .4em; margin-right: 22px; }
.ui-spinner-button { width: 16px; height: 50%; font-size: .5em; padding: 0; margin: 0; text-align: center; position: absolute; cursor: default; display: block; overflow: hidden; right: 0; }
.ui-spinner a.ui-spinner-button { border-top: none; border-bottom: none; border-right: none; } /* more specificity required here to overide default borders */
.ui-spinner .ui-icon { position: absolute; margin-top: -8px; top: 50%; left: 0; } /* vertical centre icon */
.ui-spinner-up { top: 0; }
.ui-spinner-down { bottom: 0; }
/* TR overrides */
.ui-spinner .ui-icon-triangle-1-s {
/* need to fix icons sprite */
background-position:-65px -16px;
}
.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 0; margin: 1px .2em 0 0; border-bottom: 0; padding: 0; white-space: nowrap; }
.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }
.ui-tabs .ui-tabs-nav li.ui-tabs-active { margin-bottom: -1px; padding-bottom: 1px; }
.ui-tabs .ui-tabs-nav li.ui-tabs-active a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-tabs-loading a { cursor: text; }
.ui-tabs .ui-tabs-nav li a, .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
.ui-tooltip {
padding: 8px;
position: absolute;
z-index: 9999;
max-width: 300px;
-webkit-box-shadow: 0 0 5px #aaa;
box-shadow: 0 0 5px #aaa;
}
/* Fades and background-images don't work well together in IE6, drop the image */
* html .ui-tooltip {
background-image: none;
}
body .ui-tooltip { border-width: 2px; }
/* Component containers /* Component containers
----------------------------------*/ ----------------------------------*/
@ -66,10 +240,9 @@
.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; } .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; }
.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; } .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; }
.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
.ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; } .ui-state-hover a, .ui-state-hover a:hover, .ui-state-hover a:link, .ui-state-hover a:visited { color: #212121; text-decoration: none; }
.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; } .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; }
.ui-widget :active { outline: none; }
/* Interaction Cues /* Interaction Cues
----------------------------------*/ ----------------------------------*/
@ -81,6 +254,7 @@
.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } .ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } .ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } .ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
.ui-state-disabled .ui-icon { filter:Alpha(Opacity=35); } /* For IE8 - See #6059 */
/* Icons /* Icons
----------------------------------*/ ----------------------------------*/
@ -222,8 +396,8 @@
.ui-icon-help { background-position: -48px -144px; } .ui-icon-help { background-position: -48px -144px; }
.ui-icon-check { background-position: -64px -144px; } .ui-icon-check { background-position: -64px -144px; }
.ui-icon-bullet { background-position: -80px -144px; } .ui-icon-bullet { background-position: -80px -144px; }
.ui-icon-radio-off { background-position: -96px -144px; } .ui-icon-radio-on { background-position: -96px -144px; }
.ui-icon-radio-on { background-position: -112px -144px; } .ui-icon-radio-off { background-position: -112px -144px; }
.ui-icon-pin-w { background-position: -128px -144px; } .ui-icon-pin-w { background-position: -128px -144px; }
.ui-icon-pin-s { background-position: -144px -144px; } .ui-icon-pin-s { background-position: -144px -144px; }
.ui-icon-play { background-position: 0 -160px; } .ui-icon-play { background-position: 0 -160px; }
@ -283,283 +457,5 @@
.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } .ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
/* Overlays */ /* Overlays */
.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); } .ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .3;filter:Alpha(Opacity=30); }
.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/* .ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .3;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }
* jQuery UI Resizable 1.8.17
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Resizable#theming
*/
.ui-resizable { position: relative;}
.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block; }
.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/*
* jQuery UI Selectable 1.8.17
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Selectable#theming
*/
.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
/*
* jQuery UI Accordion 1.8.17
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Accordion#theming
*/
/* IE/Win - Fix animation bug - #4615 */
.ui-accordion { width: 100%; }
.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; }
.ui-accordion .ui-accordion-li-fix { display: inline; }
.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; }
.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; }
.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; }
.ui-accordion .ui-accordion-content-active { display: block; }
/*
* jQuery UI Autocomplete 1.8.17
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Autocomplete#theming
*/
.ui-autocomplete { position: absolute; cursor: default; }
/* workarounds */
* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
/*
* jQuery UI Menu 1.8.17
*
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Menu#theming
*/
.ui-menu {
list-style:none;
padding: 2px;
margin: 0;
display:block;
float: left;
}
.ui-menu .ui-menu {
margin-top: -3px;
}
.ui-menu .ui-menu-item {
margin:0;
padding: 0;
zoom: 1;
float: left;
clear: left;
width: 100%;
}
.ui-menu .ui-menu-item a {
text-decoration:none;
display:block;
padding:.2em .4em;
line-height:1.5;
zoom:1;
}
.ui-menu .ui-menu-item a.ui-state-hover,
.ui-menu .ui-menu-item a.ui-state-active {
font-weight: normal;
margin: -1px;
}
/*
* jQuery UI Button 1.8.17
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Button#theming
*/
.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
.ui-button-icons-only { width: 3.4em; }
button.ui-button-icons-only { width: 3.7em; }
/*button text element */
.ui-button .ui-button-text { display: block; line-height: 1.4; }
.ui-button-text-only .ui-button-text { padding: .4em 1em; }
.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
/* no icon support for input elements, provide padding by default */
input.ui-button { padding: .4em 1em; }
/*button icon element(s) */
.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
/*button sets*/
.ui-buttonset { margin-right: 7px; }
.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
/* workarounds */
button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
/*
* jQuery UI Dialog 1.8.17
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Dialog#theming
*/
.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; }
.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; }
.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; }
.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
.ui-draggable .ui-dialog-titlebar { cursor: move; }
/*
* jQuery UI Slider 1.8.17
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Slider#theming
*/
.ui-slider { position: relative; text-align: left; }
.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
.ui-slider-horizontal { height: .8em; }
.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
.ui-slider-horizontal .ui-slider-range-min { left: 0; }
.ui-slider-horizontal .ui-slider-range-max { right: 0; }
.ui-slider-vertical { width: .8em; height: 100px; }
.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
.ui-slider-vertical .ui-slider-range-max { top: 0; }/*
* jQuery UI Tabs 1.8.17
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Tabs#theming
*/
.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; }
.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }
.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; }
.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }
.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
.ui-tabs .ui-tabs-hide { display: none !important; }
/*
* jQuery UI Datepicker 1.8.17
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Datepicker#theming
*/
.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
.ui-datepicker .ui-datepicker-prev { left:2px; }
.ui-datepicker .ui-datepicker-next { right:2px; }
.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
.ui-datepicker .ui-datepicker-next-hover { right:1px; }
.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
.ui-datepicker select.ui-datepicker-month,
.ui-datepicker select.ui-datepicker-year { width: 49%;}
.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
.ui-datepicker td { border: 0; padding: 1px; }
.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
/* with multiple calendars */
.ui-datepicker.ui-datepicker-multi { width:auto; }
.ui-datepicker-multi .ui-datepicker-group { float:left; }
.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
.ui-datepicker-row-break { clear:both; width:100%; font-size:0em; }
/* RTL support */
.ui-datepicker-rtl { direction: rtl; }
.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
.ui-datepicker-rtl .ui-datepicker-group { float:right; }
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
.ui-datepicker-cover {
display: none; /*sorry for IE5*/
display/**/: block; /*sorry for IE5*/
position: absolute; /*must have*/
z-index: -1; /*must have*/
filter: mask(); /*must have*/
top: -4px; /*must have*/
left: -4px; /*must have*/
width: 200px; /*must have*/
height: 200px; /*must have*/
}/*
* jQuery UI Progressbar 1.8.17
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Progressbar#theming
*/
.ui-progressbar { height:2em; text-align: left; overflow: hidden; }
.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -81,9 +81,6 @@ instance.web.Dialog = instance.web.Widget.extend({
} }
} }
if (options) { if (options) {
if (options.buttons) {
this.params_buttons = true;
}
_.extend(this.dialog_options, options); _.extend(this.dialog_options, options);
} }
this.on("closing", this, this._closing); this.on("closing", this, this._closing);
@ -129,6 +126,8 @@ instance.web.Dialog = instance.web.Widget.extend({
if (! this.dialog_inited) if (! this.dialog_inited)
this.init_dialog(); this.init_dialog();
var o = this.get_options(options); var o = this.get_options(options);
this.add_buttons(o.buttons);
delete(o.buttons);
this.$buttons.appendTo($("body")); this.$buttons.appendTo($("body"));
instance.web.dialog(this.$el, o).dialog('open'); instance.web.dialog(this.$el, o).dialog('open');
this.$el.dialog("widget").find(".ui-dialog-buttonpane").remove(); this.$el.dialog("widget").find(".ui-dialog-buttonpane").remove();
@ -138,22 +137,30 @@ instance.web.Dialog = instance.web.Widget.extend({
} }
return this; return this;
}, },
add_buttons: function(buttons) {
var self = this;
_.each(buttons, function(fn, but) {
var $but = $(QWeb.render('WidgetButton', { widget : { string: but, node: { attrs: {} }}}));
self.$buttons.append($but);
$but.on('click', function(ev) {
fn.call(self.$el, ev);
});
});
},
init_dialog: function(options) { init_dialog: function(options) {
this.renderElement(); this.renderElement();
var o = this.get_options(options); var o = this.get_options(options);
instance.web.dialog(this.$el, o); instance.web.dialog(this.$el, o);
if (! this.params_buttons) { this.$buttons = $('<div class="ui-dialog-buttonpane ui-widget-content ui-helper-clearfix" />');
this.$buttons = $('<div class="ui-dialog-buttonpane ui-widget-content ui-helper-clearfix" />'); this.$el.dialog("widget").append(this.$buttons);
this.$el.dialog("widget").append(this.$buttons);
} else {
this.$buttons = this.$el.dialog("widget").find(".ui-dialog-buttonpane");
}
this.dialog_inited = true; this.dialog_inited = true;
var res = this.start(); var res = this.start();
return res; return res;
}, },
close: function() { close: function() {
this.$el.dialog('close'); if (this.dialog_inited && this.$el.is(":data(dialog)")) {
this.$el.dialog('close');
}
}, },
_closing: function() { _closing: function() {
if (this.__tmp_dialog_destroying) if (this.__tmp_dialog_destroying)
@ -175,7 +182,7 @@ instance.web.Dialog = instance.web.Widget.extend({
this.close(); this.close();
this.__tmp_dialog_destroying = undefined; this.__tmp_dialog_destroying = undefined;
} }
if (! this.isDestroyed()) { if (this.dialog_inited && !this.isDestroyed()) {
this.$el.dialog('destroy'); this.$el.dialog('destroy');
} }
this._super(); this._super();
@ -294,7 +301,7 @@ instance.web.DatabaseManager = instance.web.Widget.extend({
start: function() { start: function() {
var self = this; var self = this;
$('.oe_secondary_menus_container,.oe_user_menu_placeholder').empty(); $('.oe_secondary_menus_container,.oe_user_menu_placeholder').empty();
var fetch_db = this.rpc("/web/database/get_list", {}).pipe( var fetch_db = this.rpc("/web/database/get_list", {}).then(
function(result) { function(result) {
self.db_list = result.db_list; self.db_list = result.db_list;
}, },
@ -302,10 +309,10 @@ instance.web.DatabaseManager = instance.web.Widget.extend({
ev.preventDefault(); ev.preventDefault();
self.db_list = null; self.db_list = null;
}); });
var fetch_langs = this.rpc("/web/session/get_lang_list", {}).then(function(result) { var fetch_langs = this.rpc("/web/session/get_lang_list", {}).done(function(result) {
self.lang_list = result.lang_list; self.lang_list = result.lang_list;
}); });
return $.when(fetch_db, fetch_langs).then(self.do_render); return $.when(fetch_db, fetch_langs).done(self.do_render);
}, },
do_render: function() { do_render: function() {
var self = this; var self = this;
@ -394,7 +401,7 @@ instance.web.DatabaseManager = instance.web.Widget.extend({
do_create: function(form) { do_create: function(form) {
var self = this; var self = this;
var fields = $(form).serializeArray(); var fields = $(form).serializeArray();
self.rpc("/web/database/create", {'fields': fields}).then(function(result) { self.rpc("/web/database/create", {'fields': fields}).done(function(result) {
var form_obj = self.to_object(fields); var form_obj = self.to_object(fields);
var client_action = { var client_action = {
type: 'ir.actions.client', type: 'ir.actions.client',
@ -420,7 +427,7 @@ instance.web.DatabaseManager = instance.web.Widget.extend({
if (!db || !confirm("Do you really want to delete the database: " + db + " ?")) { if (!db || !confirm("Do you really want to delete the database: " + db + " ?")) {
return; return;
} }
self.rpc("/web/database/drop", {'fields': fields}).then(function(result) { self.rpc("/web/database/drop", {'fields': fields}).done(function(result) {
if (result.error) { if (result.error) {
self.display_error(result); self.display_error(result);
return; return;
@ -483,7 +490,7 @@ instance.web.DatabaseManager = instance.web.Widget.extend({
var self = this; var self = this;
self.rpc("/web/database/change_password", { self.rpc("/web/database/change_password", {
'fields': $(form).serializeArray() 'fields': $(form).serializeArray()
}).then(function(result) { }).done(function(result) {
if (result.error) { if (result.error) {
self.display_error(result); self.display_error(result);
return; return;
@ -581,7 +588,7 @@ instance.web.Login = instance.web.Widget.extend({
var self = this; var self = this;
self.hide_error(); self.hide_error();
self.$(".oe_login_pane").fadeOut("slow"); self.$(".oe_login_pane").fadeOut("slow");
return this.session.session_authenticate(db, login, password).pipe(function() { return this.session.session_authenticate(db, login, password).then(function() {
if (self.has_local_storage) { if (self.has_local_storage) {
if(self.remember_credentials) { if(self.remember_credentials) {
localStorage.setItem('last_db_login_success', db); localStorage.setItem('last_db_login_success', db);
@ -664,7 +671,7 @@ instance.web.ChangePassword = instance.web.Widget.extend({
submitHandler: function (form) { submitHandler: function (form) {
self.rpc("/web/session/change_password",{ self.rpc("/web/session/change_password",{
'fields': $(form).serializeArray() 'fields': $(form).serializeArray()
}).then(function(result) { }).done(function(result) {
if (result.error) { if (result.error) {
self.display_error(result); self.display_error(result);
return; return;
@ -703,7 +710,7 @@ instance.web.Menu = instance.web.Widget.extend({
}, },
do_reload: function() { do_reload: function() {
var self = this; var self = this;
return this.rpc("/web/menu/load", {}).then(function(r) { return this.rpc("/web/menu/load", {}).done(function(r) {
self.menu_loaded(r); self.menu_loaded(r);
}); });
}, },
@ -873,7 +880,7 @@ instance.web.UserMenu = instance.web.Widget.extend({
if (!self.session.uid) if (!self.session.uid)
return; return;
var func = new instance.web.Model("res.users").get_func("read"); var func = new instance.web.Model("res.users").get_func("read");
return func(self.session.uid, ["name", "company_id"]).pipe(function(res) { return func(self.session.uid, ["name", "company_id"]).then(function(res) {
var topbar_name = res.name; var topbar_name = res.name;
if(instance.session.debug) if(instance.session.debug)
topbar_name = _.str.sprintf("%s (%s)", topbar_name, instance.session.db); topbar_name = _.str.sprintf("%s (%s)", topbar_name, instance.session.db);
@ -884,7 +891,7 @@ instance.web.UserMenu = instance.web.Widget.extend({
$avatar.attr('src', avatar_src); $avatar.attr('src', avatar_src);
}); });
}; };
this.update_promise = this.update_promise.pipe(fct, fct); this.update_promise = this.update_promise.then(fct, fct);
}, },
on_menu_logout: function() { on_menu_logout: function() {
this.trigger('user_logout'); this.trigger('user_logout');
@ -900,7 +907,7 @@ instance.web.UserMenu = instance.web.Widget.extend({
}, },
on_menu_about: function() { on_menu_about: function() {
var self = this; var self = this;
self.rpc("/web/webclient/version_info", {}).then(function(res) { self.rpc("/web/webclient/version_info", {}).done(function(res) {
var $help = $(QWeb.render("UserMenu.about", {version_info: res})); var $help = $(QWeb.render("UserMenu.about", {version_info: res}));
$help.find('a.oe_activate_debug_mode').click(function (e) { $help.find('a.oe_activate_debug_mode').click(function (e) {
e.preventDefault(); e.preventDefault();
@ -920,7 +927,7 @@ instance.web.Client = instance.web.Widget.extend({
}, },
start: function() { start: function() {
var self = this; var self = this;
return instance.session.session_bind(this.origin).pipe(function() { return instance.session.session_bind(this.origin).then(function() {
var $e = $(QWeb.render(self._template, {})); var $e = $(QWeb.render(self._template, {}));
self.replaceElement($e); self.replaceElement($e);
self.bind_events(); self.bind_events();
@ -987,7 +994,7 @@ instance.web.WebClient = instance.web.Client.extend({
}, },
start: function() { start: function() {
var self = this; var self = this;
return $.when(this._super()).pipe(function() { return $.when(this._super()).then(function() {
self.$el.on('click', '.oe_logo', function() { self.$el.on('click', '.oe_logo', function() {
self.action_manager.do_action('home'); self.action_manager.do_action('home');
}); });
@ -1056,8 +1063,8 @@ instance.web.WebClient = instance.web.Client.extend({
}, },
do_reload: function() { do_reload: function() {
var self = this; var self = this;
return this.session.session_reload().pipe(function () { return this.session.session_reload().then(function () {
instance.session.load_modules(true).pipe( instance.session.load_modules(true).then(
self.menu.proxy('do_reload')); }); self.menu.proxy('do_reload')); });
}, },
@ -1072,7 +1079,7 @@ instance.web.WebClient = instance.web.Client.extend({
on_logout: function() { on_logout: function() {
var self = this; var self = this;
if (!this.has_uncommitted_changes()) { if (!this.has_uncommitted_changes()) {
this.session.session_logout().then(function () { this.session.session_logout().done(function () {
$(window).unbind('hashchange', self.on_hashchange); $(window).unbind('hashchange', self.on_hashchange);
self.do_push_state({}); self.do_push_state({});
window.location.reload(); window.location.reload();
@ -1085,7 +1092,7 @@ instance.web.WebClient = instance.web.Client.extend({
var state = $.bbq.getState(true); var state = $.bbq.getState(true);
if (_.isEmpty(state) || state.action == "login") { if (_.isEmpty(state) || state.action == "login") {
self.menu.has_been_loaded.then(function() { self.menu.has_been_loaded.done(function() {
var first_menu_id = self.menu.$el.find("a:first").data("menu"); var first_menu_id = self.menu.$el.find("a:first").data("menu");
if(first_menu_id) { if(first_menu_id) {
self.menu.menu_click(first_menu_id); self.menu.menu_click(first_menu_id);
@ -1100,8 +1107,8 @@ instance.web.WebClient = instance.web.Client.extend({
var state = event.getState(true); var state = event.getState(true);
if (!_.isEqual(this._current_state, state)) { if (!_.isEqual(this._current_state, state)) {
if(state.action_id === undefined && state.menu_id) { if(state.action_id === undefined && state.menu_id) {
self.menu.has_been_loaded.then(function() { self.menu.has_been_loaded.done(function() {
self.menu.do_reload().then(function() { self.menu.do_reload().done(function() {
self.menu.menu_click(state.menu_id) self.menu.menu_click(state.menu_id)
}); });
}); });
@ -1118,11 +1125,12 @@ instance.web.WebClient = instance.web.Client.extend({
var url = '#' + $.param(state); var url = '#' + $.param(state);
this._current_state = _.clone(state); this._current_state = _.clone(state);
$.bbq.pushState(url); $.bbq.pushState(url);
this.trigger('state_pushed', state);
}, },
on_menu_action: function(options) { on_menu_action: function(options) {
var self = this; var self = this;
return this.rpc("/web/action/load", { action_id: options.action_id }) return this.rpc("/web/action/load", { action_id: options.action_id })
.pipe(function (result) { .then(function (result) {
var action = result; var action = result;
if (options.needaction) { if (options.needaction) {
action.context.search_default_message_unread = true; action.context.search_default_message_unread = true;
@ -1168,9 +1176,9 @@ instance.web.EmbeddedClient = instance.web.Client.extend({
}, },
start: function() { start: function() {
var self = this; var self = this;
return $.when(this._super()).pipe(function() { return $.when(this._super()).then(function() {
return instance.session.session_authenticate(self.dbname, self.login, self.key, true).pipe(function() { return instance.session.session_authenticate(self.dbname, self.login, self.key, true).then(function() {
return self.rpc("/web/action/load", { action_id: self.action_id }).then(function(result) { return self.rpc("/web/action/load", { action_id: self.action_id }).done(function(result) {
var action = result; var action = result;
action.flags = _.extend({ action.flags = _.extend({
//views_switcher : false, //views_switcher : false,

View File

@ -809,12 +809,12 @@ instance.web.Widget = instance.web.Class.extend(instance.web.WidgetMixin, {
return false; return false;
}, },
rpc: function(url, data, success, error) { rpc: function(url, data, success, error) {
var def = $.Deferred().then(success, error); var def = $.Deferred().done(success).fail(error);
var self = this; var self = this;
instance.session.rpc(url, data).then(function() { instance.session.rpc(url, data).done(function() {
if (!self.isDestroyed()) if (!self.isDestroyed())
def.resolve.apply(def, arguments); def.resolve.apply(def, arguments);
}, function() { }).fail(function() {
if (!self.isDestroyed()) if (!self.isDestroyed())
def.reject.apply(def, arguments); def.reject.apply(def, arguments);
}); });
@ -1287,7 +1287,7 @@ instance.web.JsonRPC = instance.web.CallbackEnabled.extend({
}; };
var deferred = $.Deferred(); var deferred = $.Deferred();
this.trigger('request', url, payload); this.trigger('request', url, payload);
var request = this.rpc_function(url, payload).then( var request = this.rpc_function(url, payload).done(
function (response, textStatus, jqXHR) { function (response, textStatus, jqXHR) {
self.trigger('response', response); self.trigger('response', response);
if (!response.error) { if (!response.error) {
@ -1300,7 +1300,8 @@ instance.web.JsonRPC = instance.web.CallbackEnabled.extend({
} else { } else {
deferred.reject(response.error, $.Event()); deferred.reject(response.error, $.Event());
} }
}, }
).fail(
function(jqXHR, textStatus, errorThrown) { function(jqXHR, textStatus, errorThrown) {
self.trigger('response_failed', jqXHR); self.trigger('response_failed', jqXHR);
var error = { var error = {
@ -1387,10 +1388,11 @@ instance.web.JsonRPC = instance.web.CallbackEnabled.extend({
$iframe.unbind('load').bind('load', function() { $iframe.unbind('load').bind('load', function() {
$.ajax(ajax).always(function() { $.ajax(ajax).always(function() {
cleanUp(); cleanUp();
}).then( }).done(function() {
function() { deferred.resolve.apply(deferred, arguments); }, deferred.resolve.apply(deferred, arguments);
function() { deferred.reject.apply(deferred, arguments); } }).fail(function() {
); deferred.reject.apply(deferred, arguments);
});
}); });
// now that the iframe can receive data, we fill and submit the form // now that the iframe can receive data, we fill and submit the form
$form.submit(); $form.submit();

View File

@ -51,15 +51,15 @@ instance.web.Session = instance.web.JsonRPC.extend( /** @lends instance.web.Sess
var self = this; var self = this;
// TODO: session store in cookie should be optional // TODO: session store in cookie should be optional
this.session_id = this.get_cookie('session_id'); this.session_id = this.get_cookie('session_id');
return this.session_reload().pipe(function(result) { return this.session_reload().then(function(result) {
var modules = instance._modules.join(','); var modules = instance._modules.join(',');
var deferred = self.rpc('/web/webclient/qweblist', {mods: modules}).pipe(self.do_load_qweb); var deferred = self.rpc('/web/webclient/qweblist', {mods: modules}).then(self.do_load_qweb);
if(self.session_is_valid()) { if(self.session_is_valid()) {
return deferred.pipe(function() { return self.load_modules(); }); return deferred.then(function() { return self.load_modules(); });
} }
return $.when( return $.when(
deferred, deferred,
self.rpc('/web/webclient/bootstrap_translations', {mods: instance._modules}).pipe(function(trans) { self.rpc('/web/webclient/bootstrap_translations', {mods: instance._modules}).then(function(trans) {
instance.web._t.database.set_bundle(trans); instance.web._t.database.set_bundle(trans);
}) })
); );
@ -73,7 +73,7 @@ instance.web.Session = instance.web.JsonRPC.extend( /** @lends instance.web.Sess
*/ */
session_reload: function () { session_reload: function () {
var self = this; var self = this;
return this.rpc("/web/session/get_session_info", {}).then(function(result) { return this.rpc("/web/session/get_session_info", {}).done(function(result) {
// If immediately follows a login (triggered by trying to restore // If immediately follows a login (triggered by trying to restore
// an invalid session or no session at all), refresh session data // an invalid session or no session at all), refresh session data
// (should not change, but just in case...) // (should not change, but just in case...)
@ -96,7 +96,7 @@ instance.web.Session = instance.web.JsonRPC.extend( /** @lends instance.web.Sess
var self = this; var self = this;
var base_location = document.location.protocol + '//' + document.location.host; var base_location = document.location.protocol + '//' + document.location.host;
var params = { db: db, login: login, password: password, base_location: base_location }; var params = { db: db, login: login, password: password, base_location: base_location };
return this.rpc("/web/session/authenticate", params).pipe(function(result) { return this.rpc("/web/session/authenticate", params).then(function(result) {
if (!result.uid) { if (!result.uid) {
return $.Deferred().reject(); return $.Deferred().reject();
} }
@ -154,30 +154,30 @@ instance.web.Session = instance.web.JsonRPC.extend( /** @lends instance.web.Sess
*/ */
load_modules: function() { load_modules: function() {
var self = this; var self = this;
return this.rpc('/web/session/modules', {}).pipe(function(result) { return this.rpc('/web/session/modules', {}).then(function(result) {
var lang = self.user_context.lang, var lang = self.user_context.lang,
all_modules = _.uniq(self.module_list.concat(result)); all_modules = _.uniq(self.module_list.concat(result));
var params = { mods: all_modules, lang: lang}; var params = { mods: all_modules, lang: lang};
var to_load = _.difference(result, self.module_list).join(','); var to_load = _.difference(result, self.module_list).join(',');
self.module_list = all_modules; self.module_list = all_modules;
var loaded = self.rpc('/web/webclient/translations', params).then(function(trans) { var loaded = self.rpc('/web/webclient/translations', params).done(function(trans) {
instance.web._t.database.set_bundle(trans); instance.web._t.database.set_bundle(trans);
}); });
var file_list = ["/web/static/lib/datejs/globalization/" + lang.replace("_", "-") + ".js"]; var file_list = ["/web/static/lib/datejs/globalization/" + lang.replace("_", "-") + ".js"];
if(to_load.length) { if(to_load.length) {
loaded = $.when( loaded = $.when(
loaded, loaded,
self.rpc('/web/webclient/csslist', {mods: to_load}).then(self.do_load_css), self.rpc('/web/webclient/csslist', {mods: to_load}).done(self.do_load_css),
self.rpc('/web/webclient/qweblist', {mods: to_load}).pipe(self.do_load_qweb), self.rpc('/web/webclient/qweblist', {mods: to_load}).then(self.do_load_qweb),
self.rpc('/web/webclient/jslist', {mods: to_load}).then(function(files) { self.rpc('/web/webclient/jslist', {mods: to_load}).done(function(files) {
file_list = file_list.concat(files); file_list = file_list.concat(files);
}) })
); );
} }
return loaded.pipe(function () { return loaded.then(function () {
return self.do_load_js(file_list); return self.do_load_js(file_list);
}).then(function() { }).done(function() {
self.on_modules_loaded(); self.on_modules_loaded();
self.trigger('module_loaded'); self.trigger('module_loaded');
if (!Date.CultureInfo.pmDesignator) { if (!Date.CultureInfo.pmDesignator) {
@ -212,7 +212,7 @@ instance.web.Session = instance.web.JsonRPC.extend( /** @lends instance.web.Sess
if ( (tag.readyState && tag.readyState != "loaded" && tag.readyState != "complete") || tag.onload_done ) if ( (tag.readyState && tag.readyState != "loaded" && tag.readyState != "complete") || tag.onload_done )
return; return;
tag.onload_done = true; tag.onload_done = true;
self.do_load_js(files).then(function () { self.do_load_js(files).done(function () {
d.resolve(); d.resolve();
}); });
}; };
@ -227,7 +227,7 @@ instance.web.Session = instance.web.JsonRPC.extend( /** @lends instance.web.Sess
var self = this; var self = this;
_.each(files, function(file) { _.each(files, function(file) {
self.qweb_mutex.exec(function() { self.qweb_mutex.exec(function() {
return self.rpc('/web/proxy/load', {path: file}).pipe(function(xml) { return self.rpc('/web/proxy/load', {path: file}).then(function(xml) {
if (!xml) { return; } if (!xml) { return; }
instance.web.qweb.add_template(_.str.trim(xml)); instance.web.qweb.add_template(_.str.trim(xml));
}); });
@ -462,7 +462,7 @@ $.Mutex = (function() {
Mutex.prototype.exec = function(action) { Mutex.prototype.exec = function(action) {
var current = this.def; var current = this.def;
var next = this.def = $.Deferred(); var next = this.def = $.Deferred();
return current.pipe(function() { return current.then(function() {
return $.when(action()).always(function() { return $.when(action()).always(function() {
next.resolve(); next.resolve();
}); });
@ -474,7 +474,7 @@ $.Mutex = (function() {
$.async_when = function() { $.async_when = function() {
var async = false; var async = false;
var def = $.Deferred(); var def = $.Deferred();
$.when.apply($, arguments).then(function() { $.when.apply($, arguments).done(function() {
var args = arguments; var args = arguments;
var action = function() { var action = function() {
def.resolve.apply(def, args); def.resolve.apply(def, args);
@ -483,7 +483,7 @@ $.async_when = function() {
action(); action();
else else
setTimeout(action, 0); setTimeout(action, 0);
}, function() { }).fail(function() {
var args = arguments; var args = arguments;
var action = function() { var action = function() {
def.reject.apply(def, args); def.reject.apply(def, args);

View File

@ -66,7 +66,7 @@ instance.web.Query = instance.web.Class.extend({
offset: this._offset, offset: this._offset,
limit: this._limit, limit: this._limit,
sort: instance.web.serialize_sort(this._order_by) sort: instance.web.serialize_sort(this._order_by)
}).pipe(function (results) { }).then(function (results) {
self._count = results.length; self._count = results.length;
return results.records; return results.records;
}, null); }, null);
@ -78,7 +78,7 @@ instance.web.Query = instance.web.Class.extend({
*/ */
first: function () { first: function () {
var self = this; var self = this;
return this.clone({limit: 1})._execute().pipe(function (records) { return this.clone({limit: 1})._execute().then(function (records) {
delete self._count; delete self._count;
if (records.length) { return records[0]; } if (records.length) { return records[0]; }
return null; return null;
@ -132,7 +132,7 @@ instance.web.Query = instance.web.Class.extend({
offset: this._offset, offset: this._offset,
limit: this._limit, limit: this._limit,
orderby: instance.web.serialize_sort(this._order_by) || false orderby: instance.web.serialize_sort(this._order_by) || false
}).pipe(function (results) { }).then(function (results) {
return _(results).map(function (result) { return _(results).map(function (result) {
// FIX: querygroup initialization // FIX: querygroup initialization
result.__context = result.__context || {}; result.__context = result.__context || {};
@ -443,7 +443,7 @@ instance.web.DataSet = instance.web.CallbackEnabled.extend({
return this._model.query(fields) return this._model.query(fields)
.limit(options.limit || false) .limit(options.limit || false)
.offset(options.offset || 0) .offset(options.offset || 0)
.all().then(function (records) { .all().done(function (records) {
self.ids = _(records).pluck('id'); self.ids = _(records).pluck('id');
}); });
}, },
@ -456,7 +456,7 @@ instance.web.DataSet = instance.web.CallbackEnabled.extend({
*/ */
read_index: function (fields, options) { read_index: function (fields, options) {
options = options || {}; options = options || {};
return this.read_ids([this.ids[this.index]], fields, options).pipe(function (records) { return this.read_ids([this.ids[this.index]], fields, options).then(function (records) {
if (_.isEmpty(records)) { return $.Deferred().reject().promise(); } if (_.isEmpty(records)) { return $.Deferred().reject().promise(); }
return records[0]; return records[0];
}); });
@ -493,7 +493,7 @@ instance.web.DataSet = instance.web.CallbackEnabled.extend({
*/ */
write: function (id, data, options) { write: function (id, data, options) {
options = options || {}; options = options || {};
return this._model.call('write', [[id], data], {context: this.get_context(options.context)}).then(this.trigger('dataset_changed', id, data, options)); return this._model.call('write', [[id], data], {context: this.get_context(options.context)}).done(this.trigger('dataset_changed', id, data, options));
}, },
/** /**
* Deletes an existing record from the database * Deletes an existing record from the database
@ -501,7 +501,7 @@ instance.web.DataSet = instance.web.CallbackEnabled.extend({
* @param {Number|String} ids identifier of the record to delete * @param {Number|String} ids identifier of the record to delete
*/ */
unlink: function(ids) { unlink: function(ids) {
return this._model.call('unlink', [ids], {context: this.get_context()}).then(this.trigger('dataset_changed', ids)); return this._model.call('unlink', [ids], {context: this.get_context()}).done(this.trigger('dataset_changed', ids));
}, },
/** /**
* Calls an arbitrary RPC method * Calls an arbitrary RPC method
@ -607,7 +607,7 @@ instance.web.DataSet = instance.web.CallbackEnabled.extend({
model: this.model, model: this.model,
ids: ids, ids: ids,
context: this.get_context(options.context), context: this.get_context(options.context),
}).pipe(function (results) { }).then(function (results) {
return results; return results;
}); });
}, },
@ -682,9 +682,9 @@ instance.web.DataSetSearch = instance.web.DataSet.extend({
.limit(options.limit || false); .limit(options.limit || false);
q = q.order_by.apply(q, this._sort); q = q.order_by.apply(q, this._sort);
return q.all().then(function (records) { return q.all().done(function (records) {
// FIXME: not sure about that one, *could* have discarded count // FIXME: not sure about that one, *could* have discarded count
q.count().then(function (count) { self._length = count; }); q.count().done(function (count) { self._length = count; });
self.ids = _(records).pluck('id'); self.ids = _(records).pluck('id');
}); });
}, },
@ -693,7 +693,7 @@ instance.web.DataSetSearch = instance.web.DataSet.extend({
}, },
unlink: function(ids, callback, error_callback) { unlink: function(ids, callback, error_callback) {
var self = this; var self = this;
return this._super(ids).then(function(result) { return this._super(ids).done(function(result) {
self.ids = _(self.ids).difference(ids); self.ids = _(self.ids).difference(ids);
if (self._length) { if (self._length) {
self._length -= 1; self._length -= 1;
@ -722,7 +722,7 @@ instance.web.BufferedDataSet = instance.web.DataSetStatic.extend({
this.last_default_get = {}; this.last_default_get = {};
}, },
default_get: function(fields, options) { default_get: function(fields, options) {
return this._super(fields, options).then(this.on_default_get); return this._super(fields, options).done(this.on_default_get);
}, },
on_default_get: function(res) { on_default_get: function(res) {
this.last_default_get = res; this.last_default_get = res;
@ -774,7 +774,7 @@ instance.web.BufferedDataSet = instance.web.DataSetStatic.extend({
this.cache = _.reject(this.cache, function(x) { return _.include(ids, x.id);}); this.cache = _.reject(this.cache, function(x) { return _.include(ids, x.id);});
this.set_ids(_.without.apply(_, [this.ids].concat(ids))); this.set_ids(_.without.apply(_, [this.ids].concat(ids)));
this.trigger("dataset_changed", ids, callback, error_callback); this.trigger("dataset_changed", ids, callback, error_callback);
return $.async_when({result: true}).then(callback); return $.async_when({result: true}).done(callback);
}, },
reset_ids: function(ids) { reset_ids: function(ids) {
this.set_ids(ids); this.set_ids(ids);
@ -836,7 +836,7 @@ instance.web.BufferedDataSet = instance.web.DataSetStatic.extend({
completion.resolve(records); completion.resolve(records);
}; };
if(to_get.length > 0) { if(to_get.length > 0) {
var rpc_promise = this._super(to_get, fields, options).then(function(records) { var rpc_promise = this._super(to_get, fields, options).done(function(records) {
_.each(records, function(record, index) { _.each(records, function(record, index) {
var id = to_get[index]; var id = to_get[index];
var cached = _.detect(self.cache, function(x) {return x.id === id;}); var cached = _.detect(self.cache, function(x) {return x.id === id;});
@ -991,14 +991,14 @@ instance.web.DropMisordered = instance.web.Class.extend({
var res = $.Deferred(); var res = $.Deferred();
var self = this, seq = this.lsn++; var self = this, seq = this.lsn++;
deferred.then(function () { deferred.done(function () {
if (seq > self.rsn) { if (seq > self.rsn) {
self.rsn = seq; self.rsn = seq;
res.resolve.apply(res, arguments); res.resolve.apply(res, arguments);
} else if (self.failMisordered) { } else if (self.failMisordered) {
res.reject(); res.reject();
} }
}, function () { }).fail(function () {
res.reject.apply(res, arguments); res.reject.apply(res, arguments);
}); });

View File

@ -51,7 +51,7 @@ instance.web.DataExport = instance.web.Dialog.extend({
self.rpc("/web/export/get_fields", { self.rpc("/web/export/get_fields", {
model: self.dataset.model, model: self.dataset.model,
import_compat: Boolean(import_comp) import_compat: Boolean(import_comp)
}).then(function (records) { }).done(function (records) {
got_fields.resolve(); got_fields.resolve();
self.on_show_data(records); self.on_show_data(records);
}); });
@ -59,7 +59,7 @@ instance.web.DataExport = instance.web.Dialog.extend({
return $.when( return $.when(
got_fields, got_fields,
this.rpc('/web/export/formats', {}).then(this.do_setup_export_formats), this.rpc('/web/export/formats', {}).done(this.do_setup_export_formats),
this.show_exports_list()); this.show_exports_list());
}, },
do_setup_export_formats: function (formats) { do_setup_export_formats: function (formats) {
@ -84,7 +84,7 @@ instance.web.DataExport = instance.web.Dialog.extend({
} }
return this.exports.read_slice(['name'], { return this.exports.read_slice(['name'], {
domain: [['resource', '=', this.dataset.model]] domain: [['resource', '=', this.dataset.model]]
}).then(function (export_list) { }).done(function (export_list) {
if (!export_list.length) { if (!export_list.length) {
return; return;
} }
@ -93,7 +93,7 @@ instance.web.DataExport = instance.web.Dialog.extend({
self.$el.find('#fields_list option').remove(); self.$el.find('#fields_list option').remove();
var export_id = self.$el.find('#saved_export_list option:selected').val(); var export_id = self.$el.find('#saved_export_list option:selected').val();
if (export_id) { if (export_id) {
self.rpc('/web/export/namelist', {'model': self.dataset.model, export_id: parseInt(export_id)}).then(self.do_load_export_field); self.rpc('/web/export/namelist', {'model': self.dataset.model, export_id: parseInt(export_id)}).done(self.do_load_export_field);
} }
}); });
self.$el.find('#delete_export_list').click(function() { self.$el.find('#delete_export_list').click(function() {
@ -183,7 +183,7 @@ instance.web.DataExport = instance.web.Dialog.extend({
import_compat: Boolean(import_comp), import_compat: Boolean(import_comp),
parent_field_type : record['field_type'], parent_field_type : record['field_type'],
exclude: exclude_fields exclude: exclude_fields
}).then(function(results) { }).done(function(results) {
record.loaded = true; record.loaded = true;
self.on_show_data(results, record.id); self.on_show_data(results, record.id);
}); });

View File

@ -236,7 +236,7 @@ my.FacetView = instance.web.Widget.extend({
start: function () { start: function () {
var self = this; var self = this;
var $e = this.$('> span:last-child'); var $e = this.$('> span:last-child');
return $.when(this._super()).pipe(function () { return $.when(this._super()).then(function () {
return $.when.apply(null, self.model.values.map(function (value) { return $.when.apply(null, self.model.values.map(function (value) {
return new my.FacetValueView(self, value).appendTo($e); return new my.FacetValueView(self, value).appendTo($e);
})); }));
@ -271,15 +271,6 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea
this.$('.oe_searchview_input:last').focus(); this.$('.oe_searchview_input:last').focus();
} }
}, },
// when the completion list opens/refreshes, automatically select the
// first completion item so if the user just hits [RETURN] or [TAB] it
// automatically selects it
'autocompleteopen': function () {
var menu = this.$el.data('autocomplete').menu;
menu.activate(
$.Event({ type: "mouseenter" }),
menu.element.children().first());
},
// search button // search button
'click button.oe_searchview_search': function (e) { 'click button.oe_searchview_search': function (e) {
e.stopImmediatePropagation(); e.stopImmediatePropagation();
@ -356,7 +347,7 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea
context: this.dataset.get_context() }); context: this.dataset.get_context() });
$.when(load_view) $.when(load_view)
.pipe(function(r) { .then(function(r) {
self.search_view_loaded(r) self.search_view_loaded(r)
}).fail(function () { }).fail(function () {
self.ready.reject.apply(null, arguments); self.ready.reject.apply(null, arguments);
@ -417,58 +408,46 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea
setup_global_completion: function () { setup_global_completion: function () {
var self = this; var self = this;
// autocomplete only correctly handles being initialized on the actual var autocomplete = this.$el.autocomplete({
// editable element (and only an element with a @value in 1.8 e.g.
// input or textarea), cheat by setting val() on $el
this.$el.on('keydown', function () {
// keydown is triggered *before* the element's value is set, so
// delay this. Pray that setTimeout are executed in FIFO (if they
// have the same delay) as autocomplete uses the exact same trick.
// FIXME: brittle as fuck
setTimeout(function () {
self.$el.val(self.currentInputValue());
}, 0);
});
this.$el.autocomplete({
source: this.proxy('complete_global_search'), source: this.proxy('complete_global_search'),
select: this.proxy('select_completion'), select: this.proxy('select_completion'),
focus: function (e) { e.preventDefault(); }, focus: function (e) { e.preventDefault(); },
html: true, html: true,
autoFocus: true,
minLength: 1, minLength: 1,
delay: 0 delay: 0
}).data('autocomplete')._renderItem = function (ul, item) { }).data('autocomplete');
// item of completion list
var $item = $( "<li></li>" )
.data( "item.autocomplete", item )
.appendTo( ul );
if (item.facet !== undefined) { // MonkeyPatch autocomplete instance
// regular completion item _.extend(autocomplete, {
return $item.append( _renderItem: function (ul, item) {
(item.label) // item of completion list
? $('<a>').html(item.label) var $item = $( "<li></li>" )
: $('<a>').text(item.value)); .data( "item.autocomplete", item )
} .appendTo( ul );
return $item.text(item.label)
.css({ if (item.facet !== undefined) {
borderTop: '1px solid #cccccc', // regular completion item
margin: 0, return $item.append(
padding: 0, (item.label)
zoom: 1, ? $('<a>').html(item.label)
'float': 'left', : $('<a>').text(item.value));
clear: 'left', }
width: '100%' return $item.text(item.label)
}); .css({
}; borderTop: '1px solid #cccccc',
}, margin: 0,
/** padding: 0,
* Gets value out of the currently focused "input" (a zoom: 1,
* div[contenteditable].oe_searchview_input) 'float': 'left',
*/ clear: 'left',
currentInputValue: function () { width: '100%'
return this.$('div.oe_searchview_input:focus').text(); });
},
_value: function() {
return self.$('div.oe_searchview_input').text();
},
});
}, },
/** /**
* Provide auto-completion result for req.term (an array to `resp`) * Provide auto-completion result for req.term (an array to `resp`)
@ -480,7 +459,7 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea
complete_global_search: function (req, resp) { complete_global_search: function (req, resp) {
$.when.apply(null, _(this.inputs).chain() $.when.apply(null, _(this.inputs).chain()
.invoke('complete', req.term) .invoke('complete', req.term)
.value()).then(function () { .value()).done(function () {
resp(_(_(arguments).compact()).flatten(true)); resp(_(_(arguments).compact()).flatten(true));
}); });
}, },
@ -548,7 +527,7 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea
childView.on('blurred', self, self.proxy('childBlurred')); childView.on('blurred', self, self.proxy('childBlurred'));
}); });
$.when.apply(null, started).then(function () { $.when.apply(null, started).done(function () {
var input_to_focus; var input_to_focus;
// options.at: facet inserted at given index, focus next input // options.at: facet inserted at given index, focus next input
// otherwise just focus last input // otherwise just focus last input
@ -656,12 +635,12 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea
// load defaults // load defaults
var defaults_fetched = $.when.apply(null, _(this.inputs).invoke( var defaults_fetched = $.when.apply(null, _(this.inputs).invoke(
'facet_for_defaults', this.defaults)).then(function () { 'facet_for_defaults', this.defaults)).done(function () {
self.query.reset(_(arguments).compact(), {preventSearch: true}); self.query.reset(_(arguments).compact(), {preventSearch: true});
}); });
return $.when(drawer_started, defaults_fetched) return $.when(drawer_started, defaults_fetched)
.then(function () { .done(function () {
self.trigger("search_view_loaded", data); self.trigger("search_view_loaded", data);
self.ready.resolve(); self.ready.resolve();
}); });
@ -1430,7 +1409,7 @@ instance.web.search.ManyToOneField = instance.web.search.CharField.extend({
name: needle, name: needle,
limit: 8, limit: 8,
context: {} context: {}
}).pipe(function (results) { }).then(function (results) {
if (_.isEmpty(results)) { return null; } if (_.isEmpty(results)) { return null; }
return [{label: self.attrs.string}].concat( return [{label: self.attrs.string}].concat(
_(results).map(function (result) { _(results).map(function (result) {
@ -1453,7 +1432,7 @@ instance.web.search.ManyToOneField = instance.web.search.CharField.extend({
// to handle this as if it were a single value. // to handle this as if it were a single value.
value = value[0]; value = value[0];
} }
return this.model.call('name_get', [value]).pipe(function (names) { return this.model.call('name_get', [value]).then(function (names) {
if (_(names).isEmpty()) { return null; } if (_(names).isEmpty()) { return null; }
return facet_from(self, names[0]); return facet_from(self, names[0]);
}) })
@ -1500,7 +1479,7 @@ instance.web.search.CustomFilters = instance.web.search.Input.extend({
// FIXME: local eval of domain and context to get rid of special endpoint // FIXME: local eval of domain and context to get rid of special endpoint
return this.rpc('/web/searchview/get_filters', { return this.rpc('/web/searchview/get_filters', {
model: this.view.model model: this.view.model
}).pipe(this.proxy('set_filters')); }).then(this.proxy('set_filters'));
}, },
clear_selection: function () { clear_selection: function () {
this.$('li.oe_selected').removeClass('oe_selected'); this.$('li.oe_selected').removeClass('oe_selected');
@ -1523,7 +1502,7 @@ instance.web.search.CustomFilters = instance.web.search.Input.extend({
$('<a class="oe_searchview_custom_delete">x</a>') $('<a class="oe_searchview_custom_delete">x</a>')
.click(function (e) { .click(function (e) {
e.stopPropagation(); e.stopPropagation();
self.model.call('unlink', [id]).then(function () { self.model.call('unlink', [id]).done(function () {
$filter.remove(); $filter.remove();
}); });
}) })
@ -1558,7 +1537,7 @@ instance.web.search.CustomFilters = instance.web.search.Input.extend({
domains: search.domains, domains: search.domains,
contexts: search.contexts, contexts: search.contexts,
group_by_seq: search.groupbys || [] group_by_seq: search.groupbys || []
}).then(function (results) { }).done(function (results) {
if (!_.isEmpty(results.group_by)) { if (!_.isEmpty(results.group_by)) {
results.context.group_by = results.group_by; results.context.group_by = results.group_by;
} }
@ -1570,7 +1549,7 @@ instance.web.search.CustomFilters = instance.web.search.Input.extend({
domain: results.domain domain: results.domain
}; };
// FIXME: current context? // FIXME: current context?
return self.model.call('create_or_replace', [filter]).then(function (id) { return self.model.call('create_or_replace', [filter]).done(function (id) {
filter.id = id; filter.id = id;
self.append_filter(filter); self.append_filter(filter);
self.$el self.$el
@ -1647,18 +1626,18 @@ instance.web.search.Advanced = instance.web.search.Input.extend({
}); });
return $.when( return $.when(
this._super(), this._super(),
this.rpc("/web/searchview/fields_get", {model: this.view.model}).then(function(data) { this.rpc("/web/searchview/fields_get", {model: this.view.model}).done(function(data) {
self.fields = _.extend({ self.fields = _.extend({
id: { string: 'ID', type: 'id' } id: { string: 'ID', type: 'id' }
}, data.fields); }, data.fields);
})).then(function () { })).done(function () {
self.append_proposition(); self.append_proposition();
}); });
}, },
append_proposition: function () { append_proposition: function () {
var self = this; var self = this;
return (new instance.web.search.ExtendedSearchProposition(this, this.fields)) return (new instance.web.search.ExtendedSearchProposition(this, this.fields))
.appendTo(this.$('ul')).then(function () { .appendTo(this.$('ul')).done(function () {
self.$('button.oe_apply').prop('disabled', false); self.$('button.oe_apply').prop('disabled', false);
}); });
}, },
@ -1723,7 +1702,7 @@ instance.web.search.ExtendedSearchProposition = instance.web.Widget.extend(/** @
this.value = null; this.value = null;
}, },
start: function () { start: function () {
return this._super().then(this.proxy('changed')); return this._super().done(this.proxy('changed'));
}, },
changed: function() { changed: function() {
var nval = this.$(".searchview_extended_prop_field").val(); var nval = this.$(".searchview_extended_prop_field").val();

View File

@ -32,20 +32,20 @@ openerp.test_support = {
window.openerp.web[tested_core](oe); window.openerp.web[tested_core](oe);
var done = openerp.test_support.setup_session(oe.session); var done = openerp.test_support.setup_session(oe.session);
if (nonliterals) { if (nonliterals) {
done = done.pipe(function () { done = done.then(function () {
return oe.session.rpc('/tests/add_nonliterals', { return oe.session.rpc('/tests/add_nonliterals', {
domains: nonliterals.domains || [], domains: nonliterals.domains || [],
contexts: nonliterals.contexts || [] contexts: nonliterals.contexts || []
}).then(function (r) { }).done(function (r) {
oe.domains = r.domains; oe.domains = r.domains;
oe.contexts = r.contexts; oe.contexts = r.contexts;
}); });
}); });
} }
done.always(QUnit.start) done.always(QUnit.start)
.then(function () { .done(function () {
conf.openerp = oe; conf.openerp = oe;
}, function (e) { }).fail(function (e) {
QUnit.test(title, function () { QUnit.test(title, function () {
console.error(e); console.error(e);
QUnit.ok(false, 'Could not obtain a session:' + e.debug); QUnit.ok(false, 'Could not obtain a session:' + e.debug);

File diff suppressed because it is too large Load Diff

View File

@ -508,7 +508,7 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi
_.pluck(_(this.columns).filter(function (r) { _.pluck(_(this.columns).filter(function (r) {
return r.tag === 'field'; return r.tag === 'field';
}), 'name') }), 'name')
).then(function (records) { ).done(function (records) {
_(records[0]).each(function (value, key) { _(records[0]).each(function (value, key) {
record.set(key, value, {silent: true}); record.set(key, value, {silent: true});
}); });
@ -553,7 +553,7 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi
this.no_leaf = !!context['group_by_no_leaf']; this.no_leaf = !!context['group_by_no_leaf'];
this.grouped = !!group_by; this.grouped = !!group_by;
return this.load_view(context).pipe( return this.load_view(context).then(
this.proxy('reload_content')); this.proxy('reload_content'));
}, },
/** /**
@ -566,7 +566,7 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi
return; return;
} }
var self = this; var self = this;
return $.when(this.dataset.unlink(ids)).then(function () { return $.when(this.dataset.unlink(ids)).done(function () {
_(ids).each(function (id) { _(ids).each(function (id) {
self.records.remove(self.records.get(id)); self.records.remove(self.records.get(id));
}); });
@ -976,7 +976,7 @@ instance.web.ListView.List = instance.web.Class.extend( /** @lends instance.web.
// to get a correctly displayable value in the field // to get a correctly displayable value in the field
var model = ref_match[1], var model = ref_match[1],
id = parseInt(ref_match[2], 10); id = parseInt(ref_match[2], 10);
new instance.web.DataSet(this.view, model).name_get([id]).then(function(names) { new instance.web.DataSet(this.view, model).name_get([id]).done(function(names) {
if (!names.length) { return; } if (!names.length) { return; }
record.set(column.id, names[0][1]); record.set(column.id, names[0][1]);
}); });
@ -992,7 +992,7 @@ instance.web.ListView.List = instance.web.Class.extend( /** @lends instance.web.
// and let the various registered events handle refreshing the // and let the various registered events handle refreshing the
// row // row
new instance.web.DataSet(this.view, column.relation) new instance.web.DataSet(this.view, column.relation)
.name_get([value]).then(function (names) { .name_get([value]).done(function (names) {
if (!names.length) { return; } if (!names.length) { return; }
record.set(column.id, names[0]); record.set(column.id, names[0]);
}); });
@ -1000,7 +1000,8 @@ instance.web.ListView.List = instance.web.Class.extend( /** @lends instance.web.
} else if (column.type === 'many2many') { } else if (column.type === 'many2many') {
value = record.get(column.id); value = record.get(column.id);
// non-resolved (string) m2m values are arrays // non-resolved (string) m2m values are arrays
if (value instanceof Array && !_.isEmpty(value)) { if (value instanceof Array && !_.isEmpty(value)
&& !record.get(column.id + '__display')) {
var ids; var ids;
// they come in two shapes: // they come in two shapes:
if (value[0] instanceof Array) { if (value[0] instanceof Array) {
@ -1015,9 +1016,14 @@ instance.web.ListView.List = instance.web.Class.extend( /** @lends instance.web.
ids = value; ids = value;
} }
new instance.web.Model(column.relation) new instance.web.Model(column.relation)
.call('name_get', [ids]).then(function (names) { .call('name_get', [ids]).done(function (names) {
record.set(column.id, _(names).pluck(1).join(', ')); // FIXME: nth horrible hack in this poor listview
}) record.set(column.id + '__display',
_(names).pluck(1).join(', '));
record.set(column.id, ids);
});
// temp empty value
record.set(column.id, false);
} }
} }
return column.format(record.toForm().data, { return column.format(record.toForm().data, {
@ -1385,43 +1391,45 @@ instance.web.ListView.Groups = instance.web.Class.extend( /** @lends instance.we
var fields = _.pluck(_.select(this.columns, function(x) {return x.tag == "field"}), 'name'); var fields = _.pluck(_.select(this.columns, function(x) {return x.tag == "field"}), 'name');
var options = { offset: page * limit, limit: limit, context: {bin_size: true} }; var options = { offset: page * limit, limit: limit, context: {bin_size: true} };
//TODO xmo: investigate why we need to put the setTimeout //TODO xmo: investigate why we need to put the setTimeout
$.async_when().then(function() {dataset.read_slice(fields, options).then(function (records) { $.async_when().done(function() {
// FIXME: ignominious hacks, parents (aka form view) should not send two ListView#reload_content concurrently dataset.read_slice(fields, options).done(function (records) {
if (self.records.length) { // FIXME: ignominious hacks, parents (aka form view) should not send two ListView#reload_content concurrently
self.records.reset(null, {silent: true}); if (self.records.length) {
} self.records.reset(null, {silent: true});
if (!self.datagroup.openable) { }
view.configure_pager(dataset); if (!self.datagroup.openable) {
} else { view.configure_pager(dataset);
if (dataset.size() == records.length) { } else {
// only one page if (dataset.size() == records.length) {
self.$row.find('td.oe_list_group_pagination').empty(); // only one page
} else { self.$row.find('td.oe_list_group_pagination').empty();
var pages = Math.ceil(dataset.size() / limit); } else {
self.$row var pages = Math.ceil(dataset.size() / limit);
.find('.oe_list_pager_state') self.$row
.text(_.str.sprintf(_t("%(page)d/%(page_count)d"), { .find('.oe_list_pager_state')
page: page + 1, .text(_.str.sprintf(_t("%(page)d/%(page_count)d"), {
page_count: pages page: page + 1,
})) page_count: pages
.end() }))
.find('button[data-pager-action=previous]') .end()
.css('visibility', .find('button[data-pager-action=previous]')
page === 0 ? 'hidden' : '') .css('visibility',
.end() page === 0 ? 'hidden' : '')
.find('button[data-pager-action=next]') .end()
.css('visibility', .find('button[data-pager-action=next]')
page === pages - 1 ? 'hidden' : ''); .css('visibility',
page === pages - 1 ? 'hidden' : '');
}
} }
}
self.records.add(records, {silent: true}); self.records.add(records, {silent: true});
list.render(); list.render();
d.resolve(list); d.resolve(list);
if (_.isEmpty(records)) { if (_.isEmpty(records)) {
view.no_result(); view.no_result();
} }
});}); });
});
return d.promise(); return d.promise();
}, },
setup_resequence_rows: function (list, dataset) { setup_resequence_rows: function (list, dataset) {
@ -1477,7 +1485,7 @@ instance.web.ListView.Groups = instance.web.Class.extend( /** @lends instance.we
// Accounting > Taxes > Taxes, child tax accounts) // Accounting > Taxes > Taxes, child tax accounts)
// when synchronous (without setTimeout) // when synchronous (without setTimeout)
(function (dataset, id, seq) { (function (dataset, id, seq) {
$.async_when().then(function () { $.async_when().done(function () {
var attrs = {}; var attrs = {};
attrs[seqname] = seq; attrs[seqname] = seq;
dataset.write(id, attrs); dataset.write(id, attrs);
@ -1502,7 +1510,7 @@ instance.web.ListView.Groups = instance.web.Class.extend( /** @lends instance.we
self.render_groups(groups)); self.render_groups(groups));
if (post_render) { post_render(); } if (post_render) { post_render(); }
}, function (dataset) { }, function (dataset) {
self.render_dataset(dataset).then(function (list) { self.render_dataset(dataset).done(function (list) {
self.children[null] = list; self.children[null] = list;
self.elements = self.elements =
[list.$current.replaceAll($el)[0]]; [list.$current.replaceAll($el)[0]];
@ -1562,7 +1570,7 @@ var DataGroup = instance.web.CallbackEnabled.extend({
list: function (fields, ifGroups, ifRecords) { list: function (fields, ifGroups, ifRecords) {
var self = this; var self = this;
var query = this.model.query(fields).order_by(this.sort).group_by(this.group_by); var query = this.model.query(fields).order_by(this.sort).group_by(this.group_by);
$.when(query).then(function (querygroups) { $.when(query).done(function (querygroups) {
// leaf node // leaf node
if (!querygroups) { if (!querygroups) {
var ds = new instance.web.DataSetSearch(self, self.model.name, self.model.context(), self.model.domain()); var ds = new instance.web.DataSetSearch(self, self.model.name, self.model.context(), self.model.domain());
@ -2013,6 +2021,7 @@ instance.web.list.columns = new instance.web.Registry({
'field.handle': 'instance.web.list.Handle', 'field.handle': 'instance.web.list.Handle',
'button': 'instance.web.list.Button', 'button': 'instance.web.list.Button',
'field.many2onebutton': 'instance.web.list.Many2OneButton', 'field.many2onebutton': 'instance.web.list.Many2OneButton',
'field.many2many': 'instance.web.list.Many2Many'
}); });
instance.web.list.columns.for_ = function (id, field, node) { instance.web.list.columns.for_ = function (id, field, node) {
var description = _.extend({tag: node.tag}, field, node.attrs); var description = _.extend({tag: node.tag}, field, node.attrs);
@ -2206,5 +2215,14 @@ instance.web.list.Many2OneButton = instance.web.list.Column.extend({
return QWeb.render('Many2OneButton.cell', {'widget': this}); return QWeb.render('Many2OneButton.cell', {'widget': this});
}, },
}); });
instance.web.list.Many2Many = instance.web.list.Column.extend({
_format: function (row_data, options) {
if (row_data[this.id].value) {
// If value, use __display version for printing
row_data[this.id] = row_data[this.id + '__display'];
}
return this._super(row_data, options);
}
});
}; };
// vim:et fdc=0 fdl=0 foldnestmax=3 fdm=syntax: // vim:et fdc=0 fdl=0 foldnestmax=3 fdm=syntax:

View File

@ -12,6 +12,8 @@ openerp.web.list_editable = function (instance) {
var self = this; var self = this;
this._super.apply(this, arguments); this._super.apply(this, arguments);
this.saving_mutex = new $.Mutex();
this._force_editability = null; this._force_editability = null;
this._context_editable = false; this._context_editable = false;
this.editor = this.make_editor(); this.editor = this.make_editor();
@ -127,7 +129,7 @@ openerp.web.list_editable = function (instance) {
// restartable // restartable
this.editor = this.make_editor(); this.editor = this.make_editor();
var editor_ready = this.editor.prependTo(this.$el) var editor_ready = this.editor.prependTo(this.$el)
.then(this.proxy('setup_events')); .done(this.proxy('setup_events'));
return $.when(result, editor_ready); return $.when(result, editor_ready);
} else { } else {
@ -146,7 +148,7 @@ openerp.web.list_editable = function (instance) {
}, },
do_button_action: function (name, id, callback) { do_button_action: function (name, id, callback) {
var self = this, args = arguments; var self = this, args = arguments;
this.ensure_saved().then(function (done) { this.ensure_saved().done(function (done) {
if (!id && done.created) { if (!id && done.created) {
id = done.record.get('id'); id = done.record.get('id');
} }
@ -162,10 +164,13 @@ openerp.web.list_editable = function (instance) {
* @returns {$.Deferred} * @returns {$.Deferred}
*/ */
ensure_saved: function () { ensure_saved: function () {
if (!this.editor.is_editing()) { var self = this;
return $.when(); return this.saving_mutex.exec(function() {
} if (!self.editor.is_editing()) {
return this.save_edition(); return $.when();
}
return self.save_edition();
});
}, },
/** /**
* Set up the edition of a record of the list view "inline" * Set up the edition of a record of the list view "inline"
@ -191,7 +196,7 @@ openerp.web.list_editable = function (instance) {
at: this.prepends_on_create() ? 0 : null}); at: this.prepends_on_create() ? 0 : null});
} }
return this.ensure_saved().pipe(function () { return this.ensure_saved().then(function () {
var $recordRow = self.groups.get_row_for(record); var $recordRow = self.groups.get_row_for(record);
var cells = self.get_cells_for($recordRow); var cells = self.get_cells_for($recordRow);
self.fields_for_resize.splice(0, self.fields_for_resize.length); self.fields_for_resize.splice(0, self.fields_for_resize.length);
@ -208,7 +213,7 @@ openerp.web.list_editable = function (instance) {
// FIXME: need better way to get the field back from bubbling (delegated) DOM events somehow // FIXME: need better way to get the field back from bubbling (delegated) DOM events somehow
field.$el.attr('data-fieldname', field_name); field.$el.attr('data-fieldname', field_name);
self.fields_for_resize.push({field: field, cell: cell}); self.fields_for_resize.push({field: field, cell: cell});
}, options).pipe(function () { }, options).then(function () {
$recordRow.addClass('oe_edition'); $recordRow.addClass('oe_edition');
self.resize_fields(); self.resize_fields();
return record.attributes; return record.attributes;
@ -237,7 +242,9 @@ openerp.web.list_editable = function (instance) {
if (!this.editor.is_editing()) { return; } if (!this.editor.is_editing()) { return; }
for(var i=0, len=this.fields_for_resize.length; i<len; ++i) { for(var i=0, len=this.fields_for_resize.length; i<len; ++i) {
var item = this.fields_for_resize[i]; var item = this.fields_for_resize[i];
this.resize_field(item.field, item.cell); if (!item.field.get('invisible')) {
this.resize_field(item.field, item.cell);
}
} }
}, },
/** /**
@ -249,7 +256,6 @@ openerp.web.list_editable = function (instance) {
*/ */
resize_field: function (field, cell) { resize_field: function (field, cell) {
var $cell = $(cell); var $cell = $(cell);
var position = $cell.position();
field.set_dimensions($cell.outerHeight(), $cell.outerWidth()); field.set_dimensions($cell.outerHeight(), $cell.outerWidth());
field.$el.position({ field.$el.position({
@ -268,7 +274,7 @@ openerp.web.list_editable = function (instance) {
form: this.editor.form, form: this.editor.form,
cancel: false cancel: false
}, function () { }, function () {
return this.editor.save().pipe(function (attrs) { return this.editor.save().then(function (attrs) {
var created = false; var created = false;
var record = self.records.get(attrs.id); var record = self.records.get(attrs.id);
if (!record) { if (!record) {
@ -282,9 +288,9 @@ openerp.web.list_editable = function (instance) {
// record which has *just* been saved, so first perform all // record which has *just* been saved, so first perform all
// onwrites then do a final reload of the record // onwrites then do a final reload of the record
return self.handle_onwrite(record) return self.handle_onwrite(record)
.pipe(function () { .then(function () {
return self.reload_record(record); }) return self.reload_record(record); })
.pipe(function () { .then(function () {
return { created: created, record: record }; }); return { created: created, record: record }; });
}); });
}); });
@ -300,7 +306,7 @@ openerp.web.list_editable = function (instance) {
form: this.editor.form, form: this.editor.form,
cancel: false cancel: false
}, function () { }, function () {
return this.editor.cancel(force).pipe(function (attrs) { return this.editor.cancel(force).then(function (attrs) {
if (attrs.id) { if (attrs.id) {
var record = self.records.get(attrs.id); var record = self.records.get(attrs.id);
if (!record) { if (!record) {
@ -344,7 +350,7 @@ openerp.web.list_editable = function (instance) {
message: _.str.sprintf("Event %s:before cancelled", message: _.str.sprintf("Event %s:before cancelled",
event_name)}); event_name)});
} }
return $.when(action.call(this)).then(function () { return $.when(action.call(this)).done(function () {
self.trigger.apply(self, [event_name + ':after'] self.trigger.apply(self, [event_name + ':after']
.concat(_.toArray(arguments))); .concat(_.toArray(arguments)));
}); });
@ -374,7 +380,7 @@ openerp.web.list_editable = function (instance) {
var on_write_callback = self.fields_view.arch.attrs.on_write; var on_write_callback = self.fields_view.arch.attrs.on_write;
if (!on_write_callback) { return $.when(); } if (!on_write_callback) { return $.when(); }
return this.dataset.call(on_write_callback, [source_record.get('id')]) return this.dataset.call(on_write_callback, [source_record.get('id')])
.pipe(function (ids) { .then(function (ids) {
return $.when.apply( return $.when.apply(
null, _(ids).map( null, _(ids).map(
_.bind(self.handle_onwrite_record, self, source_record))); _.bind(self.handle_onwrite_record, self, source_record)));
@ -435,7 +441,7 @@ openerp.web.list_editable = function (instance) {
_next: function (next_record, options) { _next: function (next_record, options) {
next_record = next_record || 'succ'; next_record = next_record || 'succ';
var self = this; var self = this;
return this.save_edition().pipe(function (saveInfo) { return this.save_edition().then(function (saveInfo) {
if (saveInfo.created) { if (saveInfo.created) {
return self.start_edition(); return self.start_edition();
} }
@ -642,7 +648,7 @@ openerp.web.list_editable = function (instance) {
var _super = this._super(); var _super = this._super();
this.form.embedded_view = this._validate_view( this.form.embedded_view = this._validate_view(
this.delegate.edition_view(this)); this.delegate.edition_view(this));
var form_ready = this.form.appendTo(this.$el).then( var form_ready = this.form.appendTo(this.$el).done(
self.form.proxy('do_hide')); self.form.proxy('do_hide'));
return $.when(_super, form_ready); return $.when(_super, form_ready);
}, },
@ -723,9 +729,9 @@ openerp.web.list_editable = function (instance) {
var loaded = record var loaded = record
? form.trigger('load_record', _.extend({}, record)) ? form.trigger('load_record', _.extend({}, record))
: form.load_defaults(); : form.load_defaults();
return $.when(loaded).pipe(function () { return $.when(loaded).then(function () {
return form.do_show({reload: false}); return form.do_show({reload: false});
}).pipe(function () { }).then(function () {
self.record = form.datarecord; self.record = form.datarecord;
_(form.fields).each(function (field, name) { _(form.fields).each(function (field, name) {
configureField(name, field); configureField(name, field);
@ -738,7 +744,7 @@ openerp.web.list_editable = function (instance) {
var self = this; var self = this;
return this.form return this.form
.save(this.delegate.prepends_on_create()) .save(this.delegate.prepends_on_create())
.pipe(function (result) { .then(function (result) {
var created = result.created && !self.record.id; var created = result.created && !self.record.id;
if (created) { if (created) {
self.record.id = result.result; self.record.id = result.result;

View File

@ -45,7 +45,7 @@ instance.web.TreeView = instance.web.View.extend(/** @lends instance.web.TreeVie
view_type: "tree", view_type: "tree",
toolbar: this.view_manager ? !!this.view_manager.sidebar : false, toolbar: this.view_manager ? !!this.view_manager.sidebar : false,
context: this.dataset.get_context() context: this.dataset.get_context()
}, this.on_loaded); }).done(this.on_loaded);
}, },
/** /**
* Returns the list of fields needed to correctly read objects. * Returns the list of fields needed to correctly read objects.
@ -86,7 +86,7 @@ instance.web.TreeView = instance.web.View.extend(/** @lends instance.web.TreeVie
})); }));
this.$el.addClass(this.fields_view.arch.attrs['class']); this.$el.addClass(this.fields_view.arch.attrs['class']);
this.dataset.read_slice(this.fields_list()).then(function(records) { this.dataset.read_slice(this.fields_list()).done(function(records) {
if (!has_toolbar) { if (!has_toolbar) {
// WARNING: will do a second read on the same ids, but only on // WARNING: will do a second read on the same ids, but only on
// first load so not very important // first load so not very important
@ -192,7 +192,7 @@ instance.web.TreeView = instance.web.View.extend(/** @lends instance.web.TreeVie
getdata: function (id, children_ids) { getdata: function (id, children_ids) {
var self = this; var self = this;
self.dataset.read_ids(children_ids, this.fields_list()).then(function(records) { self.dataset.read_ids(children_ids, this.fields_list()).done(function(records) {
_(records).each(function (record) { _(records).each(function (record) {
self.records[record.id] = record; self.records[record.id] = record;
}); });
@ -229,7 +229,7 @@ instance.web.TreeView = instance.web.View.extend(/** @lends instance.web.TreeVie
model: this.dataset.model, model: this.dataset.model,
context: new instance.web.CompoundContext( context: new instance.web.CompoundContext(
this.dataset.get_context(), local_context) this.dataset.get_context(), local_context)
}).pipe(function (actions) { }).then(function (actions) {
if (!actions.length) { return; } if (!actions.length) { return; }
var action = actions[0][2]; var action = actions[0][2];
var c = new instance.web.CompoundContext(local_context); var c = new instance.web.CompoundContext(local_context);
@ -238,7 +238,7 @@ instance.web.TreeView = instance.web.View.extend(/** @lends instance.web.TreeVie
} }
return self.rpc('/web/session/eval_domain_and_context', { return self.rpc('/web/session/eval_domain_and_context', {
contexts: [c], domains: [] contexts: [c], domains: []
}).pipe(function (res) { }).then(function (res) {
action.context = res.context; action.context = res.context;
return self.do_action(action); return self.do_action(action);
}, null); }, null);

View File

@ -200,7 +200,12 @@ instance.web.ActionManager = instance.web.Widget.extend({
action_loaded; action_loaded;
if (state.action) { if (state.action) {
if (_.isString(state.action) && instance.web.client_actions.contains(state.action)) { if (_.isString(state.action) && instance.web.client_actions.contains(state.action)) {
var action_client = {type: "ir.actions.client", tag: state.action, params: state}; var action_client = {
type: "ir.actions.client",
tag: state.action,
params: state,
_push_me: state._push_me,
};
this.null_action(); this.null_action();
action_loaded = this.do_action(action_client); action_loaded = this.do_action(action_client);
} else { } else {
@ -208,7 +213,7 @@ instance.web.ActionManager = instance.web.Widget.extend({
if (run_action) { if (run_action) {
this.null_action(); this.null_action();
action_loaded = this.do_action(state.action); action_loaded = this.do_action(state.action);
instance.webclient.menu.has_been_loaded.then(function() { instance.webclient.menu.has_been_loaded.done(function() {
instance.webclient.menu.open_action(state.action); instance.webclient.menu.open_action(state.action);
}); });
} }
@ -226,14 +231,14 @@ instance.web.ActionManager = instance.web.Widget.extend({
} else if (state.sa) { } else if (state.sa) {
// load session action // load session action
this.null_action(); this.null_action();
action_loaded = this.rpc('/web/session/get_session_action', {key: state.sa}).pipe(function(action) { action_loaded = this.rpc('/web/session/get_session_action', {key: state.sa}).then(function(action) {
if (action) { if (action) {
return self.do_action(action); return self.do_action(action);
} }
}); });
} }
$.when(action_loaded || null).then(function() { $.when(action_loaded || null).done(function() {
if (self.inner_widget && self.inner_widget.do_load_state) { if (self.inner_widget && self.inner_widget.do_load_state) {
self.inner_widget.do_load_state(state, warm); self.inner_widget.do_load_state(state, warm);
} }
@ -251,7 +256,7 @@ instance.web.ActionManager = instance.web.Widget.extend({
return this.do_action(action_client, options); return this.do_action(action_client, options);
} else if (_.isNumber(action) || _.isString(action)) { } else if (_.isNumber(action) || _.isString(action)) {
var self = this; var self = this;
return self.rpc("/web/action/load", { action_id: action }).pipe(function(result) { return self.rpc("/web/action/load", { action_id: action }).then(function(result) {
return self.do_action(result, options); return self.do_action(result, options);
}); });
} }
@ -379,7 +384,7 @@ instance.web.ActionManager = instance.web.Widget.extend({
this.rpc('/web/action/run', { this.rpc('/web/action/run', {
action_id: action.id, action_id: action.id,
context: action.context || {} context: action.context || {}
}).then(function (action) { }).done(function (action) {
self.do_action(action, options) self.do_action(action, options)
}); });
}, },
@ -389,7 +394,7 @@ instance.web.ActionManager = instance.web.Widget.extend({
self.rpc("/web/session/eval_domain_and_context", { self.rpc("/web/session/eval_domain_and_context", {
contexts: [action.context], contexts: [action.context],
domains: [] domains: []
}).then(function(res) { }).done(function(res) {
action = _.clone(action); action = _.clone(action);
action.context = res.context; action.context = res.context;
self.session.get_file({ self.session.get_file({
@ -487,7 +492,7 @@ instance.web.ViewManager = instance.web.Widget.extend({
} else if (this.searchview } else if (this.searchview
&& self.flags.auto_search && self.flags.auto_search
&& view.controller.searchable !== false) { && view.controller.searchable !== false) {
this.searchview.ready.then(this.searchview.do_search); this.searchview.ready.done(this.searchview.do_search);
} }
if (this.searchview) { if (this.searchview) {
@ -499,7 +504,7 @@ instance.web.ViewManager = instance.web.Widget.extend({
.find('.oe_view_manager_switch a').filter('[data-view-type="' + view_type + '"]') .find('.oe_view_manager_switch a').filter('[data-view-type="' + view_type + '"]')
.parent().addClass('active'); .parent().addClass('active');
r = $.when(view_promise).then(function () { r = $.when(view_promise).done(function () {
_.each(_.keys(self.views), function(view_name) { _.each(_.keys(self.views), function(view_name) {
var controller = self.views[view_name].controller; var controller = self.views[view_name].controller;
if (controller) { if (controller) {
@ -551,11 +556,11 @@ instance.web.ViewManager = instance.web.Widget.extend({
var view_promise = controller.appendTo(container); var view_promise = controller.appendTo(container);
this.views[view_type].controller = controller; this.views[view_type].controller = controller;
this.views[view_type].deferred.resolve(view_type); this.views[view_type].deferred.resolve(view_type);
return $.when(view_promise).then(function() { return $.when(view_promise).done(function() {
if (self.searchview if (self.searchview
&& self.flags.auto_search && self.flags.auto_search
&& view.controller.searchable !== false) { && view.controller.searchable !== false) {
self.searchview.ready.then(self.searchview.do_search); self.searchview.ready.done(self.searchview.do_search);
} }
self.trigger("controller_inited",view_type,controller); self.trigger("controller_inited",view_type,controller);
}); });
@ -582,7 +587,7 @@ instance.web.ViewManager = instance.web.Widget.extend({
var view_to_select = views[index]; var view_to_select = views[index];
var state = self.url_states[view_to_select]; var state = self.url_states[view_to_select];
self.do_push_state(state || {}); self.do_push_state(state || {});
$.when(self.switch_mode(view_to_select)).then(function() { $.when(self.switch_mode(view_to_select)).done(function() {
self.$el.show(); self.$el.show();
}); });
}, },
@ -661,7 +666,7 @@ instance.web.ViewManager = instance.web.Widget.extend({
domains: [this.action.domain || []].concat(domains || []), domains: [this.action.domain || []].concat(domains || []),
contexts: [action_context].concat(contexts || []), contexts: [action_context].concat(contexts || []),
group_by_seq: groupbys || [] group_by_seq: groupbys || []
}).then(function (results) { }).done(function (results) {
self.dataset._model = new instance.web.Model( self.dataset._model = new instance.web.Model(
self.dataset.model, results.context, results.domain); self.dataset.model, results.context, results.domain);
var groupby = results.group_by.length var groupby = results.group_by.length
@ -786,7 +791,7 @@ instance.web.ViewManagerAction = instance.web.ViewManager.extend({
case 'perm_read': case 'perm_read':
var ids = current_view.get_selected_ids(); var ids = current_view.get_selected_ids();
if (ids.length === 1) { if (ids.length === 1) {
this.dataset.call('perm_read', [ids]).then(function(result) { this.dataset.call('perm_read', [ids]).done(function(result) {
var dialog = new instance.web.Dialog(this, { var dialog = new instance.web.Dialog(this, {
title: _.str.sprintf(_t("View Log (%s)"), self.dataset.model), title: _.str.sprintf(_t("View Log (%s)"), self.dataset.model),
width: 400 width: 400
@ -812,7 +817,7 @@ instance.web.ViewManagerAction = instance.web.ViewManager.extend({
}); });
break; break;
case 'fields': case 'fields':
this.dataset.call('fields_get', [false, {}]).then(function (fields) { this.dataset.call('fields_get', [false, {}]).done(function (fields) {
var $root = $('<dl>'); var $root = $('<dl>');
_(fields).each(function (attributes, name) { _(fields).each(function (attributes, name) {
$root.append($('<dt>').append($('<h4>').text(name))); $root.append($('<dt>').append($('<h4>').text(name)));
@ -899,7 +904,7 @@ instance.web.ViewManagerAction = instance.web.ViewManager.extend({
switch_mode: function (view_type, no_store, options) { switch_mode: function (view_type, no_store, options) {
var self = this; var self = this;
return $.when(this._super.apply(this, arguments)).then(function () { return $.when(this._super.apply(this, arguments)).done(function () {
var controller = self.views[self.active_view].controller; var controller = self.views[self.active_view].controller;
self.$el.find('.oe_debug_view').html(QWeb.render('ViewManagerDebug', { self.$el.find('.oe_debug_view').html(QWeb.render('ViewManagerDebug', {
view: controller, view: controller,
@ -938,13 +943,13 @@ instance.web.ViewManagerAction = instance.web.ViewManager.extend({
defs = []; defs = [];
if (state.view_type && state.view_type !== this.active_view) { if (state.view_type && state.view_type !== this.active_view) {
defs.push( defs.push(
this.views[this.active_view].deferred.pipe(function() { this.views[this.active_view].deferred.then(function() {
return self.switch_mode(state.view_type, true); return self.switch_mode(state.view_type, true);
}) })
); );
} }
$.when(defs).then(function() { $.when(defs).done(function() {
self.views[self.active_view].controller.do_load_state(state, warm); self.views[self.active_view].controller.do_load_state(state, warm);
}); });
}, },
@ -1051,7 +1056,7 @@ instance.web.Sidebar = instance.web.Widget.extend({
}, },
on_item_action_clicked: function(item) { on_item_action_clicked: function(item) {
var self = this; var self = this;
self.getParent().sidebar_context().then(function (context) { self.getParent().sidebar_context().done(function (context) {
var ids = self.getParent().get_selected_ids(); var ids = self.getParent().get_selected_ids();
if (ids.length == 0) { if (ids.length == 0) {
instance.web.dialog($("<div />").text(_t("You must choose at least one record.")), { title: _t("Warning"), modal: true }); instance.web.dialog($("<div />").text(_t("You must choose at least one record.")), { title: _t("Warning"), modal: true });
@ -1065,7 +1070,7 @@ instance.web.Sidebar = instance.web.Widget.extend({
self.rpc("/web/action/load", { self.rpc("/web/action/load", {
action_id: item.action.id, action_id: item.action.id,
context: additional_context context: additional_context
}).then(function(result) { }).done(function(result) {
result.context = _.extend(result.context || {}, result.context = _.extend(result.context || {},
additional_context); additional_context);
result.flags = result.flags || {}; result.flags = result.flags || {};
@ -1087,7 +1092,7 @@ instance.web.Sidebar = instance.web.Widget.extend({
} else { } else {
var dom = [ ['res_model', '=', dataset.model], ['res_id', '=', model_id], ['type', 'in', ['binary', 'url']] ]; var dom = [ ['res_model', '=', dataset.model], ['res_id', '=', model_id], ['type', 'in', ['binary', 'url']] ];
var ds = new instance.web.DataSetSearch(this, 'ir.attachment', dataset.get_context(), dom); var ds = new instance.web.DataSetSearch(this, 'ir.attachment', dataset.get_context(), dom);
ds.read_slice(['name', 'url', 'type'], {}).then(this.on_attachments_loaded); ds.read_slice(['name', 'url', 'type'], {}).done(this.on_attachments_loaded);
} }
}, },
on_attachments_loaded: function(attachments) { on_attachments_loaded: function(attachments) {
@ -1122,7 +1127,7 @@ instance.web.Sidebar = instance.web.Widget.extend({
var self = this; var self = this;
var $e = $(e.currentTarget); var $e = $(e.currentTarget);
if (confirm(_t("Do you really want to delete this attachment ?"))) { if (confirm(_t("Do you really want to delete this attachment ?"))) {
(new instance.web.DataSet(this, 'ir.attachment')).unlink([parseInt($e.attr('data-id'), 10)]).then(function() { (new instance.web.DataSet(this, 'ir.attachment')).unlink([parseInt($e.attr('data-id'), 10)]).done(function() {
self.do_attachement_update(self.dataset, self.model_id); self.do_attachement_update(self.dataset, self.model_id);
}); });
} }
@ -1150,7 +1155,7 @@ instance.web.View = instance.web.Widget.extend({
var view_loaded; var view_loaded;
if (this.embedded_view) { if (this.embedded_view) {
view_loaded = $.Deferred(); view_loaded = $.Deferred();
$.async_when().then(function() { $.async_when().done(function() {
view_loaded.resolve(self.embedded_view); view_loaded.resolve(self.embedded_view);
}); });
} else { } else {
@ -1164,7 +1169,7 @@ instance.web.View = instance.web.Widget.extend({
context: this.dataset.get_context(context) context: this.dataset.get_context(context)
}); });
} }
return view_loaded.pipe(function(r) { return view_loaded.then(function(r) {
self.trigger('view_loaded', r); self.trigger('view_loaded', r);
// add css classes that reflect the (absence of) access rights // add css classes that reflect the (absence of) access rights
self.$el.addClass('oe_view') self.$el.addClass('oe_view')
@ -1220,7 +1225,7 @@ instance.web.View = instance.web.Widget.extend({
return self.rpc('/web/session/eval_domain_and_context', { return self.rpc('/web/session/eval_domain_and_context', {
contexts: [ncontext], contexts: [ncontext],
domains: [] domains: []
}).pipe(function (results) { }).then(function (results) {
action.context = results.context; action.context = results.context;
/* niv: previously we were overriding once more with action_data.context, /* niv: previously we were overriding once more with action_data.context,
* I assumed this was not a correct behavior and removed it * I assumed this was not a correct behavior and removed it
@ -1249,11 +1254,11 @@ instance.web.View = instance.web.Widget.extend({
} }
} }
args.push(context); args.push(context);
return dataset.call_button(action_data.name, args).then(handler); return dataset.call_button(action_data.name, args).done(handler);
} else if (action_data.type=="action") { } else if (action_data.type=="action") {
return this.rpc('/web/action/load', { action_id: action_data.name, context: context, do_not_eval: true}).then(handler); return this.rpc('/web/action/load', { action_id: action_data.name, context: context, do_not_eval: true}).done(handler);
} else { } else {
return dataset.exec_workflow(record_id, action_data.name).then(handler); return dataset.exec_workflow(record_id, action_data.name).done(handler);
} }
}, },
/** /**

View File

@ -82,7 +82,7 @@ $(document).ready(function () {
}); });
t.test('call', function (openerp) { t.test('call', function (openerp) {
var ds = new openerp.web.DataSet({session: openerp.session}, 'mod'); var ds = new openerp.web.DataSet({session: openerp.session}, 'mod');
t.expect(ds.call('frob', ['a', 'b', 42]).then(function (r) { t.expect(ds.call('frob', ['a', 'b', 42]).done(function (r) {
strictEqual(r.method, 'frob'); strictEqual(r.method, 'frob');
strictEqual(r.args.length, 3); strictEqual(r.args.length, 3);
@ -91,7 +91,7 @@ $(document).ready(function () {
ok(_.isEmpty(r.kwargs)); ok(_.isEmpty(r.kwargs));
})); }));
}); });
t.test('name_get').then(function (openerp) { t.test('name_get').done(function (openerp) {
var ds = new openerp.web.DataSet({session: openerp.session}, 'mod'); var ds = new openerp.web.DataSet({session: openerp.session}, 'mod');
t.expect(ds.name_get([1, 2], null), function (r) { t.expect(ds.name_get([1, 2], null), function (r) {
strictEqual(r.method, 'name_get'); strictEqual(r.method, 'name_get');

View File

@ -107,12 +107,12 @@ $(document).ready(function () {
}); });
var counter = 0; var counter = 0;
e.appendTo($fix) e.appendTo($fix)
.pipe(function () { .then(function () {
return e.edit({}, function () { return e.edit({}, function () {
++counter; ++counter;
}); });
}) })
.pipe(function (form) { .then(function (form) {
ok(e.is_editing(), "should be editing"); ok(e.is_editing(), "should be editing");
equal(counter, 3, "should have configured all fields"); equal(counter, 3, "should have configured all fields");
return e.save(); return e.save();
@ -137,12 +137,12 @@ $(document).ready(function () {
}); });
var counter = 0; var counter = 0;
e.appendTo($fix) e.appendTo($fix)
.pipe(function () { .then(function () {
return e.edit({}, function () { return e.edit({}, function () {
++counter; ++counter;
}); });
}) })
.pipe(function (form) { .then(function (form) {
return e.cancel(); return e.cancel();
}) })
.always(start) .always(start)
@ -170,12 +170,12 @@ $(document).ready(function () {
var counter = 0; var counter = 0;
var warnings = 0; var warnings = 0;
e.appendTo($fix) e.appendTo($fix)
.pipe(function () { .then(function () {
return e.edit({}, function () { return e.edit({}, function () {
++counter; ++counter;
}); });
}) })
.pipe(function (form) { .then(function (form) {
return e.save(); return e.save();
}) })
.always(start) .always(start)
@ -243,16 +243,16 @@ $(document).ready(function () {
var l = new instance.web.ListView({}, ds, false, {editable: 'top'}); var l = new instance.web.ListView({}, ds, false, {editable: 'top'});
l.appendTo($fix) l.appendTo($fix)
.pipe(l.proxy('reload_content')) .then(l.proxy('reload_content'))
.pipe(function () { .then(function () {
return l.start_edition(); return l.start_edition();
}) })
.always(start) .always(start)
.pipe(function () { .then(function () {
ok(got_defaults, "should have fetched default values for form"); ok(got_defaults, "should have fetched default values for form");
return l.save_edition(); return l.save_edition();
}) })
.pipe(function (result) { .then(function (result) {
ok(result.created, "should yield newly created record"); ok(result.created, "should yield newly created record");
equal(result.record.get('a'), "qux", equal(result.record.get('a'), "qux",
"should have used default values"); "should have used default values");
@ -307,14 +307,14 @@ $(document).ready(function () {
var l = new instance.web.ListView({}, ds, false, {editable: 'top'}); var l = new instance.web.ListView({}, ds, false, {editable: 'top'});
l.on('edit:before edit:after', o, o.onEvent); l.on('edit:before edit:after', o, o.onEvent);
l.appendTo($fix) l.appendTo($fix)
.pipe(l.proxy('reload_content')) .then(l.proxy('reload_content'))
.always(start) .always(start)
.pipe(function () { .then(function () {
ok(l.options.editable, "should be editable"); ok(l.options.editable, "should be editable");
equal(o.counter, 0, "should have seen no event yet"); equal(o.counter, 0, "should have seen no event yet");
return l.start_edition(l.records.get(1)); return l.start_edition(l.records.get(1));
}) })
.pipe(function () { .then(function () {
ok(l.editor.is_editing(), "should be editing"); ok(l.editor.is_editing(), "should be editing");
equal(o.counter, 2, "should have seen two edition events"); equal(o.counter, 2, "should have seen two edition events");
}) })
@ -332,14 +332,14 @@ $(document).ready(function () {
edit_after = true; edit_after = true;
}); });
l.appendTo($fix) l.appendTo($fix)
.pipe(l.proxy('reload_content')) .then(l.proxy('reload_content'))
.always(start) .always(start)
.pipe(function () { .then(function () {
ok(l.options.editable, "should be editable"); ok(l.options.editable, "should be editable");
return l.start_edition(); return l.start_edition();
}) })
// cancelling an event rejects the deferred // cancelling an event rejects the deferred
.pipe($.Deferred().reject(), function () { .then($.Deferred().reject(), function () {
ok(!l.editor.is_editing(), "should not be editing"); ok(!l.editor.is_editing(), "should not be editing");
ok(!edit_after, "should not have fired the edit:after event"); ok(!edit_after, "should not have fired the edit:after event");
return $.when(); return $.when();

View File

@ -29,10 +29,10 @@ $(document).ready(function () {
fail1 = false, fail2 = false; fail1 = false, fail2 = false;
var d1 = $.Deferred(), d2 = $.Deferred(); var d1 = $.Deferred(), d2 = $.Deferred();
dm.add(d1).then(function () { done1 = true; }, dm.add(d1).done(function () { done1 = true; })
function () { fail1 = true; }); .fail(function () { fail1 = true; });
dm.add(d2).then(function () { done2 = true; }, dm.add(d2).done(function () { done2 = true; })
function () { fail2 = true; }); .fail(function () { fail2 = true; });
d2.resolve(); d2.resolve();
d1.resolve(); d1.resolve();
@ -50,10 +50,10 @@ $(document).ready(function () {
fail1 = false, fail2 = false; fail1 = false, fail2 = false;
var d1 = $.Deferred(), d2 = $.Deferred(); var d1 = $.Deferred(), d2 = $.Deferred();
dm.add(d1).then(function () { done1 = true; }, dm.add(d1).done(function () { done1 = true; })
function () { fail1 = true; }); .fail(function () { fail1 = true; });
dm.add(d2).then(function () { done2 = true; }, dm.add(d2).done(function () { done2 = true; })
function () { fail2 = true; }); .fail(function () { fail2 = true; });
d2.resolve(); d2.resolve();
d1.resolve(); d1.resolve();
@ -86,10 +86,10 @@ $(document).ready(function () {
fail1 = false, fail2 = false; fail1 = false, fail2 = false;
var d1 = $.Deferred(), d2 = $.Deferred(); var d1 = $.Deferred(), d2 = $.Deferred();
dm.add(d1).then(function () { done1 = true; }, dm.add(d1).done(function () { done1 = true; })
function () { fail1 = true; }); .fail(function () { fail1 = true; });
dm.add(d2).then(function () { done2 = true; }, dm.add(d2).done(function () { done2 = true; })
function () { fail2 = true; }); .fail(function () { fail2 = true; });
setTimeout(function () { d1.resolve(); }, 200); setTimeout(function () { d1.resolve(); }, 200);
setTimeout(function () { d2.resolve(); }, 100); setTimeout(function () { d2.resolve(); }, 100);
@ -110,10 +110,10 @@ $(document).ready(function () {
fail1 = false, fail2 = false; fail1 = false, fail2 = false;
var d1 = $.Deferred(), d2 = $.Deferred(); var d1 = $.Deferred(), d2 = $.Deferred();
dm.add(d1).then(function () { done1 = true; }, dm.add(d1).done(function () { done1 = true; })
function () { fail1 = true; }); .fail(function () { fail1 = true; });
dm.add(d2).then(function () { done2 = true; }, dm.add(d2).done(function () { done2 = true; })
function () { fail2 = true; }); .fail(function () { fail2 = true; });
setTimeout(function () { d1.resolve(); }, 200); setTimeout(function () { d1.resolve(); }, 200);
setTimeout(function () { d2.resolve(); }, 100); setTimeout(function () { d2.resolve(); }, 100);

View File

@ -13,8 +13,8 @@
<script src="/web/static/lib/backbone/backbone.js" type="text/javascript"></script> <script src="/web/static/lib/backbone/backbone.js" type="text/javascript"></script>
<!-- jquery --> <!-- jquery -->
<script src="/web/static/lib/jquery/jquery-1.7.2.js"></script> <script src="/web/static/lib/jquery/jquery-1.8.2.js"></script>
<script src="/web/static/lib/jquery.ui/js/jquery-ui-1.8.17.custom.min.js"></script> <script src="/web/static/lib/jquery.ui/js/jquery-ui-1.9.1.custom.js"></script>
<script src="/web/static/lib/jquery.ba-bbq/jquery.ba-bbq.js"></script> <script src="/web/static/lib/jquery.ba-bbq/jquery.ba-bbq.js"></script>
<script src="/web/static/lib/datejs/globalization/en-US.js"></script> <script src="/web/static/lib/datejs/globalization/en-US.js"></script>

View File

@ -96,7 +96,7 @@ instance.web_calendar.CalendarView = instance.web.View.extend({
if (!this.sidebar && this.options.$sidebar) { if (!this.sidebar && this.options.$sidebar) {
this.sidebar = new instance.web_calendar.Sidebar(this); this.sidebar = new instance.web_calendar.Sidebar(this);
this.has_been_loaded.pipe(this.sidebar.appendTo(this.$el.find('.oe_calendar_sidebar_container'))); this.has_been_loaded.then(this.sidebar.appendTo(this.$el.find('.oe_calendar_sidebar_container')));
} }
this.trigger('calendar_view_loaded', data); this.trigger('calendar_view_loaded', data);
return this.has_been_loaded.resolve(); return this.has_been_loaded.resolve();
@ -236,7 +236,7 @@ instance.web_calendar.CalendarView = instance.web.View.extend({
} }
}, },
reload_event: function(id) { reload_event: function(id) {
this.dataset.read_ids([id], _.keys(this.fields)).then(this.proxy('events_loaded')); this.dataset.read_ids([id], _.keys(this.fields)).done(this.proxy('events_loaded'));
}, },
get_color: function(key) { get_color: function(key) {
if (this.color_map[key]) { if (this.color_map[key]) {
@ -347,12 +347,12 @@ instance.web_calendar.CalendarView = instance.web.View.extend({
ranged_search: function() { ranged_search: function() {
var self = this; var self = this;
scheduler.clearAll(); scheduler.clearAll();
$.when(this.has_been_loaded, this.ready).then(function() { $.when(this.has_been_loaded, this.ready).done(function() {
self.dataset.read_slice(_.keys(self.fields), { self.dataset.read_slice(_.keys(self.fields), {
offset: 0, offset: 0,
domain: self.get_range_domain(), domain: self.get_range_domain(),
context: self.last_search[1] context: self.last_search[1]
}).then(function(events) { }).done(function(events) {
self.dataset_events = events; self.dataset_events = events;
self.events_loaded(events); self.events_loaded(events);
}); });
@ -367,7 +367,7 @@ instance.web_calendar.CalendarView = instance.web.View.extend({
}, },
do_show: function () { do_show: function () {
var self = this; var self = this;
$.when(this.has_been_loaded).then(function() { $.when(this.has_been_loaded).done(function() {
self.$el.show(); self.$el.show();
self.do_push_state({}); self.do_push_state({});
}); });
@ -387,7 +387,7 @@ instance.web_calendar.CalendarView = instance.web.View.extend({
var index = this.dataset.get_id_index(event_id); var index = this.dataset.get_id_index(event_id);
if (index !== null) { if (index !== null) {
event_id = this.dataset.ids[index]; event_id = this.dataset.ids[index];
this.dataset.write(event_id, data, {}).then(function() { this.dataset.write(event_id, data, {}).done(function() {
self.refresh_minical(); self.refresh_minical();
}); });
} }
@ -395,13 +395,13 @@ instance.web_calendar.CalendarView = instance.web.View.extend({
quick_create: function(event_id, event_obj) { quick_create: function(event_id, event_obj) {
var self = this; var self = this;
var data = this.get_event_data(event_obj); var data = this.get_event_data(event_obj);
this.dataset.create(data).then(function(r) { this.dataset.create(data).done(function(r) {
var id = r; var id = r;
self.dataset.ids.push(id); self.dataset.ids.push(id);
scheduler.changeEventId(event_id, id); scheduler.changeEventId(event_id, id);
self.refresh_minical(); self.refresh_minical();
self.reload_event(id); self.reload_event(id);
}, function(r, event) { }).fail(function(r, event) {
event.preventDefault(); event.preventDefault();
self.slow_create(event_id, event_obj); self.slow_create(event_id, event_obj);
}); });
@ -472,7 +472,7 @@ instance.web_calendar.CalendarView = instance.web.View.extend({
var self = this; var self = this;
var index = this.dataset.get_id_index(event_id); var index = this.dataset.get_id_index(event_id);
if (index !== null) { if (index !== null) {
this.dataset.unlink(event_id).then(function() { this.dataset.unlink(event_id).done(function() {
self.refresh_minical(); self.refresh_minical();
}); });
} }

View File

@ -26,7 +26,7 @@ instance.web.DiagramView = instance.web.View.extend({
}, },
start: function() { start: function() {
var self = this; var self = this;
return this.rpc("/web_diagram/diagram/load", {"model": this.model, "view_id": this.view_id}).then(function(r) { return this.rpc("/web_diagram/diagram/load", {"model": this.model, "view_id": this.view_id}).done(function(r) {
self.load_diagram(r); self.load_diagram(r);
}); });
}, },
@ -105,7 +105,7 @@ instance.web.DiagramView = instance.web.View.extend({
}); });
this.rpc( this.rpc(
'/web_diagram/diagram/get_diagram_info',params).then(function(result) { '/web_diagram/diagram/get_diagram_info',params).done(function(result) {
self.draw_diagram(result); self.draw_diagram(result);
} }
); );
@ -256,7 +256,7 @@ instance.web.DiagramView = instance.web.View.extend({
); );
pop.on('write_completed', self, function() { pop.on('write_completed', self, function() {
self.dataset.read_index(_.keys(self.fields_view.fields)).pipe(self.on_diagram_loaded); self.dataset.read_index(_.keys(self.fields_view.fields)).then(self.on_diagram_loaded);
}); });
var form_fields = [self.parent_field]; var form_fields = [self.parent_field];
@ -290,7 +290,7 @@ instance.web.DiagramView = instance.web.View.extend({
self.context || self.dataset.context self.context || self.dataset.context
); );
pop.on("elements_selected", self, function(element_ids) { pop.on("elements_selected", self, function(element_ids) {
self.dataset.read_index(_.keys(self.fields_view.fields)).pipe(self.on_diagram_loaded); self.dataset.read_index(_.keys(self.fields_view.fields)).then(self.on_diagram_loaded);
}); });
var form_controller = pop.view_form; var form_controller = pop.view_form;
@ -320,7 +320,7 @@ instance.web.DiagramView = instance.web.View.extend({
} }
); );
pop.on('write_completed', self, function() { pop.on('write_completed', self, function() {
self.dataset.read_index(_.keys(self.fields_view.fields)).pipe(self.on_diagram_loaded); self.dataset.read_index(_.keys(self.fields_view.fields)).then(self.on_diagram_loaded);
}); });
}, },
@ -342,7 +342,7 @@ instance.web.DiagramView = instance.web.View.extend({
this.context || this.dataset.context this.context || this.dataset.context
); );
pop.on("elements_selected", self, function(element_ids) { pop.on("elements_selected", self, function(element_ids) {
self.dataset.read_index(_.keys(self.fields_view.fields)).pipe(self.on_diagram_loaded); self.dataset.read_index(_.keys(self.fields_view.fields)).then(self.on_diagram_loaded);
}); });
// We want to destroy the dummy edge after a creation cancel. This destroys it even if we save the changes. // We want to destroy the dummy edge after a creation cancel. This destroys it even if we save the changes.
// This is not a problem since the diagram is completely redrawn on saved changes. // This is not a problem since the diagram is completely redrawn on saved changes.
@ -390,7 +390,7 @@ instance.web.DiagramView = instance.web.View.extend({
pager_action_trigger: function(){ pager_action_trigger: function(){
var loaded = this.dataset.read_index(_.keys(this.fields_view.fields)) var loaded = this.dataset.read_index(_.keys(this.fields_view.fields))
.pipe(this.on_diagram_loaded); .then(this.on_diagram_loaded);
this.do_update_pager(); this.do_update_pager();
return loaded; return loaded;
}, },

View File

@ -87,12 +87,12 @@
dummy_circle.animate({'r': close_button_radius }, 400, 'linear'); dummy_circle.animate({'r': close_button_radius }, 400, 'linear');
if(entity_type == "node"){ if(entity_type == "node"){
$.when(GraphNode.destruction_callback(entity)).then(function () { $.when(GraphNode.destruction_callback(entity)).done(function () {
//console.log("remove node",entity); //console.log("remove node",entity);
entity.remove(); entity.remove();
}); });
}else if(entity_type == "edge"){ }else if(entity_type == "edge"){
$.when(GraphEdge.destruction_callback(entity)).then(function () { $.when(GraphEdge.destruction_callback(entity)).done(function () {
//console.log("remove edge",entity); //console.log("remove edge",entity);
entity.remove(); entity.remove();
}); });

View File

@ -22,7 +22,7 @@ instance.web_gantt.GanttView = instance.web.View.extend({
var self = this; var self = this;
this.fields_view = fields_view_get; this.fields_view = fields_view_get;
this.$el.addClass(this.fields_view.arch.attrs['class']); this.$el.addClass(this.fields_view.arch.attrs['class']);
return this.rpc("/web/searchview/fields_get", {"model": this.dataset.model}).pipe(function(fields_get) { return this.rpc("/web/searchview/fields_get", {"model": this.dataset.model}).then(function(fields_get) {
self.fields = fields_get.fields; self.fields = fields_get.fields;
self.has_been_loaded.resolve(); self.has_been_loaded.resolve();
}); });
@ -46,11 +46,11 @@ instance.web_gantt.GanttView = instance.web.View.extend({
})); }));
fields = _.uniq(fields.concat(n_group_bys)); fields = _.uniq(fields.concat(n_group_bys));
return $.when(this.has_been_loaded).pipe(function() { return $.when(this.has_been_loaded).then(function() {
return self.dataset.read_slice(fields, { return self.dataset.read_slice(fields, {
domain: domains, domain: domains,
context: contexts context: contexts
}).pipe(function(data) { }).then(function(data) {
return self.on_data_loaded(data, n_group_bys); return self.on_data_loaded(data, n_group_bys);
}); });
}); });
@ -62,7 +62,7 @@ instance.web_gantt.GanttView = instance.web.View.extend({
on_data_loaded: function(tasks, group_bys) { on_data_loaded: function(tasks, group_bys) {
var self = this; var self = this;
var ids = _.pluck(tasks, "id"); var ids = _.pluck(tasks, "id");
return this.dataset.name_get(ids).pipe(function(names) { return this.dataset.name_get(ids).then(function(names) {
var ntasks = _.map(tasks, function(task) { var ntasks = _.map(tasks, function(task) {
return _.extend({__name: _.detect(names, function(name) { return name[0] == task.id; })[1]}, task); return _.extend({__name: _.detect(names, function(name) { return name[0] == task.id; })[1]}, task);
}); });

View File

@ -94,7 +94,7 @@ instance.web_graph.GraphView = instance.web.View.extend({
if (self.legend == "top") { self.legend = "inside"; } if (self.legend == "top") { self.legend = "inside"; }
self.forcehtml = true; self.forcehtml = true;
self.graph_get_data().then(function (result) { self.graph_get_data().done(function (result) {
self.graph_render_all(result).download.saveImage('png'); self.graph_render_all(result).download.saveImage('png');
}).always(function () { }).always(function () {
self.forcehtml = false; self.forcehtml = false;
@ -243,7 +243,7 @@ instance.web_graph.GraphView = instance.web.View.extend({
var result = []; var result = [];
var ticks = {}; var ticks = {};
return obj.call("fields_view_get", [view_id, 'graph']).pipe(function(tmp) { return obj.call("fields_view_get", [view_id, 'graph']).then(function(tmp) {
view_get = tmp; view_get = tmp;
fields = view_get['fields']; fields = view_get['fields'];
var toload = _.select(group_by, function(x) { return fields[x] === undefined }); var toload = _.select(group_by, function(x) { return fields[x] === undefined });
@ -251,7 +251,7 @@ instance.web_graph.GraphView = instance.web.View.extend({
return obj.call("fields_get", [toload, context]); return obj.call("fields_get", [toload, context]);
else else
return $.when([]); return $.when([]);
}).pipe(function (fields_to_add) { }).then(function (fields_to_add) {
_.extend(fields, fields_to_add); _.extend(fields, fields_to_add);
var tree = $($.parseXML(view_get['arch'])); var tree = $($.parseXML(view_get['arch']));
@ -307,7 +307,7 @@ instance.web_graph.GraphView = instance.web.View.extend({
} }
if (mode === "pie") { if (mode === "pie") {
return obj.call("read_group", [domain, yaxis.concat([xaxis[0]]), [xaxis[0]]], {context: context}).pipe(function(res) { return obj.call("read_group", [domain, yaxis.concat([xaxis[0]]), [xaxis[0]]], {context: context}).then(function(res) {
_.each(res, function(record) { _.each(res, function(record) {
result.push({ result.push({
'data': [[_convert(xaxis[0], record[xaxis[0]]), record[yaxis[0]]]], 'data': [[_convert(xaxis[0], record[xaxis[0]]), record[yaxis[0]]]],
@ -318,11 +318,11 @@ instance.web_graph.GraphView = instance.web.View.extend({
} else if ((! stacked) || (xaxis.length < 2)) { } else if ((! stacked) || (xaxis.length < 2)) {
var defs = []; var defs = [];
_.each(xaxis, function(x) { _.each(xaxis, function(x) {
defs.push(obj.call("read_group", [domain, yaxis.concat([x]), [x]], {context: context}).pipe(function(res) { defs.push(obj.call("read_group", [domain, yaxis.concat([x]), [x]], {context: context}).then(function(res) {
return [x, res]; return [x, res];
})); }));
}); });
return $.when.apply($, defs).pipe(function() { return $.when.apply($, defs).then(function() {
_.each(_.toArray(arguments), function(res) { _.each(_.toArray(arguments), function(res) {
var x = res[0]; var x = res[0];
res = res[1]; res = res[1];
@ -336,15 +336,15 @@ instance.web_graph.GraphView = instance.web.View.extend({
}); });
} else { } else {
xaxis.reverse(); xaxis.reverse();
return obj.call("read_group", [domain, yaxis.concat(xaxis.slice(0, 1)), xaxis.slice(0, 1)], {context: context}).pipe(function(axis) { return obj.call("read_group", [domain, yaxis.concat(xaxis.slice(0, 1)), xaxis.slice(0, 1)], {context: context}).then(function(axis) {
var defs = []; var defs = [];
_.each(axis, function(x) { _.each(axis, function(x) {
var key = x[xaxis[0]] var key = x[xaxis[0]]
defs.push(obj.call("read_group", [domain, yaxis.concat(xaxis.slice(1, 2)), xaxis.slice(1, 2)], {context: context}).pipe(function(res) { defs.push(obj.call("read_group", [domain, yaxis.concat(xaxis.slice(1, 2)), xaxis.slice(1, 2)], {context: context}).then(function(res) {
return [x, key, res]; return [x, key, res];
})); }));
}); });
return $.when.apply($, defs).pipe(function() { return $.when.apply($, defs).then(function() {
_.each(_.toArray(arguments), function(res) { _.each(_.toArray(arguments), function(res) {
var x = res[0]; var x = res[0];
var key = res[1]; var key = res[1];
@ -359,7 +359,7 @@ instance.web_graph.GraphView = instance.web.View.extend({
}); });
}); });
} }
}).pipe(function() { }).then(function() {
var res = { var res = {
'data': result, 'data': result,
'ticks': _.map(ticks, function(el, key) { return [el, key] }) 'ticks': _.map(ticks, function(el, key) { return [el, key] })
@ -374,7 +374,7 @@ instance.web_graph.GraphView = instance.web.View.extend({
_.extend(this, options.data); _.extend(this, options.data);
return this.graph_get_data() return this.graph_get_data()
.then(this.proxy('graph_render_all')); .done(this.proxy('graph_render_all'));
}, },
graph_render_all: function (data) { graph_render_all: function (data) {

View File

@ -113,7 +113,7 @@
padding: 0; padding: 0;
margin: 0px; margin: 0px;
} }
.openerp .oe_kanban_view .oe_kanban_group_folded .oe_kanban_group_title, .openerp .oe_kanban_view .oe_kanban_group_folded.oe_kanban_column > *, .openerp .oe_kanban_view .oe_kanban_group_folded .oe_kanban_aggregates, .openerp .oe_kanban_view .oe_kanban_group_folded .oe_kanban_add { .openerp .oe_kanban_view .oe_kanban_group_folded .oe_kanban_group_title, .openerp .oe_kanban_view .oe_kanban_group_folded.oe_kanban_column *, .openerp .oe_kanban_view .oe_kanban_group_folded .oe_kanban_aggregates, .openerp .oe_kanban_view .oe_kanban_group_folded .oe_kanban_add {
display: none; display: none;
} }
.openerp .oe_kanban_view .oe_kanban_group_folded .oe_kanban_group_title_vertical { .openerp .oe_kanban_view .oe_kanban_group_folded .oe_kanban_group_title_vertical {

View File

@ -140,7 +140,7 @@
padding: 0 padding: 0
margin: 0px margin: 0px
.oe_kanban_group_folded .oe_kanban_group_folded
.oe_kanban_group_title, &.oe_kanban_column > *, .oe_kanban_aggregates, .oe_kanban_add .oe_kanban_group_title, &.oe_kanban_column *, .oe_kanban_aggregates, .oe_kanban_add
display: none display: none
.oe_kanban_group_title_vertical .oe_kanban_group_title_vertical
display: block display: block

View File

@ -198,7 +198,7 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
var form = am.dialog_widget.views.form.controller; var form = am.dialog_widget.views.form.controller;
form.on("on_button_cancel", am.dialog, am.dialog.close); form.on("on_button_cancel", am.dialog, am.dialog.close);
form.on('record_created', self, function(r) { form.on('record_created', self, function(r) {
(new instance.web.DataSet(self, self.group_by_field.relation)).name_get([r]).then(function(new_record) { (new instance.web.DataSet(self, self.group_by_field.relation)).name_get([r]).done(function(new_record) {
am.dialog.close(); am.dialog.close();
var domain = self.dataset.domain.slice(0); var domain = self.dataset.domain.slice(0);
domain.push([self.group_by, '=', new_record[0][0]]); domain.push([self.group_by, '=', new_record[0][0]]);
@ -212,7 +212,7 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
aggregates: {}, aggregates: {},
}; };
var new_group = new instance.web_kanban.KanbanGroup(self, [], datagroup, dataset); var new_group = new instance.web_kanban.KanbanGroup(self, [], datagroup, dataset);
self.do_add_groups([new_group]).then(function() { self.do_add_groups([new_group]).done(function() {
$(window).scrollTo(self.groups.slice(-1)[0].$el, { axis: 'x' }); $(window).scrollTo(self.groups.slice(-1)[0].$el, { axis: 'x' });
}); });
}); });
@ -224,14 +224,14 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
this.search_domain = domain; this.search_domain = domain;
this.search_context = context; this.search_context = context;
this.search_group_by = group_by; this.search_group_by = group_by;
$.when(this.has_been_loaded).then(function() { $.when(this.has_been_loaded).done(function() {
self.group_by = group_by.length ? group_by[0] : self.fields_view.arch.attrs.default_group_by; self.group_by = group_by.length ? group_by[0] : self.fields_view.arch.attrs.default_group_by;
self.group_by_field = self.fields_view.fields[self.group_by] || {}; self.group_by_field = self.fields_view.fields[self.group_by] || {};
self.grouped_by_m2o = (self.group_by_field.type === 'many2one'); self.grouped_by_m2o = (self.group_by_field.type === 'many2one');
self.$buttons.find('.oe_alternative').toggle(self.grouped_by_m2o); self.$buttons.find('.oe_alternative').toggle(self.grouped_by_m2o);
self.$el.toggleClass('oe_kanban_grouped_by_m2o', self.grouped_by_m2o); self.$el.toggleClass('oe_kanban_grouped_by_m2o', self.grouped_by_m2o);
var grouping = new instance.web.Model(self.dataset.model, context, domain).query().group_by(self.group_by); var grouping = new instance.web.Model(self.dataset.model, context, domain).query().group_by(self.group_by);
$.when(grouping).then(function(groups) { $.when(grouping).done(function(groups) {
if (groups) { if (groups) {
self.do_process_groups(groups); self.do_process_groups(groups);
} else { } else {
@ -252,7 +252,7 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
var dataset = new instance.web.DataSetSearch(self, self.dataset.model, var dataset = new instance.web.DataSetSearch(self, self.dataset.model,
new instance.web.CompoundContext(self.dataset.get_context(), group.model.context()), group.model.domain()); new instance.web.CompoundContext(self.dataset.get_context(), group.model.context()), group.model.domain());
return dataset.read_slice(self.fields_keys.concat(['__last_update']), { 'limit': self.limit }) return dataset.read_slice(self.fields_keys.concat(['__last_update']), { 'limit': self.limit })
.pipe(function(records) { .then(function(records) {
self.dataset.ids.push.apply(self.dataset.ids, dataset.ids); self.dataset.ids.push.apply(self.dataset.ids, dataset.ids);
groups_array[index] = new instance.web_kanban.KanbanGroup(self, records, group, dataset); groups_array[index] = new instance.web_kanban.KanbanGroup(self, records, group, dataset);
if (!remaining--) { if (!remaining--) {
@ -268,16 +268,16 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
this.$el.removeClass('oe_kanban_grouped').addClass('oe_kanban_ungrouped'); this.$el.removeClass('oe_kanban_grouped').addClass('oe_kanban_ungrouped');
this.add_group_mutex.exec(function() { this.add_group_mutex.exec(function() {
var def = $.Deferred(); var def = $.Deferred();
self.dataset.read_slice(self.fields_keys.concat(['__last_update']), { 'limit': self.limit }).then(function(records) { self.dataset.read_slice(self.fields_keys.concat(['__last_update']), { 'limit': self.limit }).done(function(records) {
self.do_clear_groups(); self.do_clear_groups();
var kgroup = new instance.web_kanban.KanbanGroup(self, records, null, self.dataset); var kgroup = new instance.web_kanban.KanbanGroup(self, records, null, self.dataset);
self.do_add_groups([kgroup]).then(function() { self.do_add_groups([kgroup]).done(function() {
if (_.isEmpty(records)) { if (_.isEmpty(records)) {
self.no_result(); self.no_result();
} }
def.resolve(); def.resolve();
}); });
}).then(null, function() { }).done(null, function() {
def.reject(); def.reject();
}); });
return def; return def;
@ -306,7 +306,7 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
return group.insertBefore($last_td); return group.insertBefore($last_td);
} }
}); });
return $.when.apply(null, groups_started).then(function () { return $.when.apply(null, groups_started).done(function () {
self.on_groups_started(); self.on_groups_started();
self.$el.appendTo($parent); self.$el.appendTo($parent);
_.each(self.groups, function(group) { _.each(self.groups, function(group) {
@ -375,7 +375,7 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
var tmp_group = self.groups.splice(start_index, 1)[0]; var tmp_group = self.groups.splice(start_index, 1)[0];
self.groups.splice(stop_index, 0, tmp_group); self.groups.splice(stop_index, 0, tmp_group);
var new_sequence = _.pluck(self.groups, 'value'); var new_sequence = _.pluck(self.groups, 'value');
(new instance.web.DataSet(self, self.group_by_field.relation)).resequence(new_sequence).then(function(r) { (new instance.web.DataSet(self, self.group_by_field.relation)).resequence(new_sequence).done(function(r) {
if (r === false) { if (r === false) {
console.error("Kanban: could not resequence model '%s'. Probably no 'sequence' field.", self.group_by_field.relation); console.error("Kanban: could not resequence model '%s'. Probably no 'sequence' field.", self.group_by_field.relation);
} }
@ -404,7 +404,7 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
record.group = new_group; record.group = new_group;
var data = {}; var data = {};
data[this.group_by] = new_group.value; data[this.group_by] = new_group.value;
this.dataset.write(record.id, data, {}).then(function() { this.dataset.write(record.id, data, {}).done(function() {
record.do_reload(); record.do_reload();
new_group.do_save_sequences(); new_group.do_save_sequences();
}).fail(function(error, evt) { }).fail(function(error, evt) {
@ -497,7 +497,7 @@ instance.web_kanban.KanbanView.postprocessing_widget_many2many_tags = function(s
if(model_list_id[model].length>0){ if(model_list_id[model].length>0){
var block = self.$el.find(".oe_form_field.oe_tags[model='" + model + "']"); var block = self.$el.find(".oe_form_field.oe_tags[model='" + model + "']");
var dataset = new instance.web.DataSetSearch(self, model, self.session.context); var dataset = new instance.web.DataSetSearch(self, model, self.session.context);
dataset.name_get(_.uniq( model_list_id[model] )).then( dataset.name_get(_.uniq( model_list_id[model] )).done(
function(result) { function(result) {
for(var t=0;t<result.length;t++){ for(var t=0;t<result.length;t++){
block.filter(function(){ return this.getAttribute("data").match(new RegExp('(^|,)'+result[t][0]+'(,|$)')); }) block.filter(function(){ return this.getAttribute("data").match(new RegExp('(^|,)'+result[t][0]+'(,|$)')); })
@ -557,7 +557,7 @@ instance.web_kanban.KanbanGroup = instance.web.Widget.extend({
this.$records = null; this.$records = null;
this.records = []; this.records = [];
this.$has_been_started.then(function() { this.$has_been_started.done(function() {
self.do_add_records(records); self.do_add_records(records);
}); });
}, },
@ -638,10 +638,21 @@ instance.web_kanban.KanbanGroup = instance.web.Widget.extend({
}, },
do_show_more: function(evt) { do_show_more: function(evt) {
var self = this; var self = this;
this.dataset.read_slice(this.view.fields_keys.concat(['__last_update']), { return this.dataset.read_slice(this.view.fields_keys.concat(['__last_update']), {
'limit': self.view.limit, 'limit': self.view.limit,
<<<<<<< TREE
'offset': self.dataset_offset 'offset': self.dataset_offset
}).then(this.do_add_records); }).then(this.do_add_records);
=======
'offset': self.dataset_offset += self.view.limit
}).then(function(records) {
records.forEach(function(r) {
self.view.dataset.ids.push(r.id);
});
self.do_add_records(records);
return records;
});
>>>>>>> MERGE-SOURCE
}, },
do_add_records: function(records, prepend) { do_add_records: function(records, prepend) {
var self = this; var self = this;
@ -704,7 +715,7 @@ instance.web_kanban.KanbanGroup = instance.web.Widget.extend({
do_action_delete: function() { do_action_delete: function() {
var self = this; var self = this;
if (confirm(_t("Are you sure to remove this column ?"))) { if (confirm(_t("Are you sure to remove this column ?"))) {
(new instance.web.DataSet(self, self.view.group_by_field.relation)).unlink([self.value]).then(function(r) { (new instance.web.DataSet(self, self.view.group_by_field.relation)).unlink([self.value]).done(function(r) {
self.view.do_reload(); self.view.do_reload();
}); });
} }
@ -724,7 +735,7 @@ instance.web_kanban.KanbanGroup = instance.web.Widget.extend({
quick_created: function (record) { quick_created: function (record) {
var id = record, self = this; var id = record, self = this;
this.dataset.read_ids([id], this.view.fields_keys) this.dataset.read_ids([id], this.view.fields_keys)
.then(function (records) { .done(function (records) {
self.view.dataset.ids.push(id); self.view.dataset.ids.push(id);
self.do_add_records(records, true); self.do_add_records(records, true);
}); });
@ -838,13 +849,13 @@ instance.web_kanban.KanbanRecord = instance.web.Widget.extend({
if (this.$el.find('.oe_kanban_global_click,.oe_kanban_global_click_edit').length) { if (this.$el.find('.oe_kanban_global_click,.oe_kanban_global_click_edit').length) {
this.$el.on('click', function(ev) { this.$el.on('click', function(ev) {
if (!ev.isTrigger && !$(ev.target).data('events')) { if (!ev.isTrigger && !$._data(ev.target, 'events')) {
var trigger = true; var trigger = true;
var elem = ev.target; var elem = ev.target;
var ischild = true; var ischild = true;
var children = []; var children = [];
while (elem) { while (elem) {
var events = $(elem).data('events'); var events = $._data(elem, 'events');
if (elem == ev.currentTarget) { if (elem == ev.currentTarget) {
ischild = false; ischild = false;
} }
@ -899,7 +910,7 @@ instance.web_kanban.KanbanRecord = instance.web.Widget.extend({
var color_field = $(this).parents('.oe_kanban_colorpicker').first().data('field') || 'color'; var color_field = $(this).parents('.oe_kanban_colorpicker').first().data('field') || 'color';
var data = {}; var data = {};
data[color_field] = $(this).data('color'); data[color_field] = $(this).data('color');
self.view.dataset.write(self.id, data, {}).then(function() { self.view.dataset.write(self.id, data, {}).done(function() {
self.record[color_field] = $(this).data('color'); self.record[color_field] = $(this).data('color');
self.do_reload(); self.do_reload();
}); });
@ -909,7 +920,7 @@ instance.web_kanban.KanbanRecord = instance.web.Widget.extend({
do_action_delete: function($action) { do_action_delete: function($action) {
var self = this; var self = this;
function do_it() { function do_it() {
return $.when(self.view.dataset.unlink([self.id])).then(function() { return $.when(self.view.dataset.unlink([self.id])).done(function() {
self.group.remove_record(self.id); self.group.remove_record(self.id);
self.destroy(); self.destroy();
}); });
@ -933,7 +944,7 @@ instance.web_kanban.KanbanRecord = instance.web.Widget.extend({
}, },
do_reload: function() { do_reload: function() {
var self = this; var self = this;
this.view.dataset.read_ids([this.id], this.view.fields_keys.concat(['__last_update'])).then(function(records) { this.view.dataset.read_ids([this.id], this.view.fields_keys.concat(['__last_update'])).done(function(records) {
if (records.length) { if (records.length) {
self.set_record(records[0]); self.set_record(records[0]);
self.renderElement(); self.renderElement();
@ -1063,7 +1074,7 @@ instance.web_kanban.QuickCreate = instance.web.Widget.extend({
this._dataset.call( this._dataset.call(
'name_create', [self.$input.val() || false, new instance.web.CompoundContext( 'name_create', [self.$input.val() || false, new instance.web.CompoundContext(
this._dataset.get_context(), this._context)]) this._dataset.get_context(), this._context)])
.pipe(function(record) { .then(function(record) {
self.$input.val(""); self.$input.val("");
self.trigger('added', record[0]); self.trigger('added', record[0]);
}, function(error, event) { }, function(error, event) {

View File

@ -18,7 +18,7 @@ openerp.web_tests = function (instance) {
start: function () { start: function () {
$.when( $.when(
this.dataset.read_slice(), this.dataset.read_slice(),
this.form.appendTo(this.$el)).then(this.on_everything_loaded); this.form.appendTo(this.$el)).done(this.on_everything_loaded);
}, },
on_everything_loaded: function (slice) { on_everything_loaded: function (slice) {
var records = slice[0].records; var records = slice[0].records;

View File

@ -70,7 +70,7 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({
this.main_view_id = this.parent.fields_view.view_id; this.main_view_id = this.parent.fields_view.view_id;
this.action_manager = new instance.web.ActionManager(this); this.action_manager = new instance.web.ActionManager(this);
this.action_manager.appendTo(this.view_edit_dialog.$el); this.action_manager.appendTo(this.view_edit_dialog.$el);
$.when(this.action_manager.do_action(action)).then(function() { $.when(this.action_manager.do_action(action)).done(function() {
var viewmanager = self.action_manager.inner_widget; var viewmanager = self.action_manager.inner_widget;
var controller = viewmanager.views[viewmanager.active_view].controller; var controller = viewmanager.views[viewmanager.active_view].controller;
controller.on('view_loaded', self, function(){ controller.on('view_loaded', self, function(){
@ -102,7 +102,7 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({
if (warn) { if (warn) {
self.on_valid_create_view(self.create_view_widget); self.on_valid_create_view(self.create_view_widget);
} else { } else {
$.when(self.do_save_view(view_values)).then(function() { $.when(self.do_save_view(view_values)).done(function() {
self.create_view_dialog.close(); self.create_view_dialog.close();
var controller = self.action_manager.inner_widget.views[self.action_manager.inner_widget.active_view].controller; var controller = self.action_manager.inner_widget.views[self.action_manager.inner_widget.active_view].controller;
controller.reload_content(); controller.reload_content();
@ -135,7 +135,7 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({
var field_dataset = new instance.web.DataSetSearch(this, this.model, null, null); var field_dataset = new instance.web.DataSetSearch(this, this.model, null, null);
var model_dataset = new instance.web.DataSetSearch(this, 'ir.model', null, null); var model_dataset = new instance.web.DataSetSearch(this, 'ir.model', null, null);
var view_string = "", field_name = false, self = this; var view_string = "", field_name = false, self = this;
field_dataset.call( 'fields_get', []).then(function(fields) { field_dataset.call( 'fields_get', []).done(function(fields) {
_.each(['name', 'x_name'], function(value) { _.each(['name', 'x_name'], function(value) {
if (_.include(_.keys(fields), value)) { if (_.include(_.keys(fields), value)) {
field_name = value; field_name = value;
@ -143,7 +143,7 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({
} }
}); });
if (field_name) { if (field_name) {
model_dataset.read_slice(['name','field_id'], {"domain": [['model','=',self.model]]}).then(function(records) { model_dataset.read_slice(['name','field_id'], {"domain": [['model','=',self.model]]}).done(function(records) {
if (records) {view_string = records[0].name;} if (records) {view_string = records[0].name;}
var arch = _.str.sprintf("<?xml version='1.0'?>\n<%s string='%s'>\n\t<field name='%s'/>\n</%s>", values.view_type, view_string, field_name, values.view_type); var arch = _.str.sprintf("<?xml version='1.0'?>\n<%s string='%s'>\n\t<field name='%s'/>\n</%s>", values.view_type, view_string, field_name, values.view_type);
var vals = {'model': self.model, 'name': values.view_name, 'priority': values.priority, 'type': values.view_type, 'arch': arch}; var vals = {'model': self.model, 'name': values.view_name, 'priority': values.priority, 'type': values.view_type, 'arch': arch};
@ -182,7 +182,7 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({
var self = this; var self = this;
if (confirm(_t("Do you really want to remove this view?"))) { if (confirm(_t("Do you really want to remove this view?"))) {
var controller = this.action_manager.inner_widget.views[this.action_manager.inner_widget.active_view].controller; var controller = this.action_manager.inner_widget.views[this.action_manager.inner_widget.active_view].controller;
this.dataset.unlink([this.main_view_id]).then(function() { this.dataset.unlink([this.main_view_id]).done(function() {
controller.reload_content(); controller.reload_content();
self.main_view_id = self.parent.fields_view.view_id; self.main_view_id = self.parent.fields_view.view_id;
}); });
@ -245,12 +245,12 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({
get_arch: function() { get_arch: function() {
var self = this; var self = this;
var view_arch_list = []; var view_arch_list = [];
this.dataset.read_ids([parseInt(self.main_view_id)], ['arch', 'type','priority']).then(function(arch) { this.dataset.read_ids([parseInt(self.main_view_id)], ['arch', 'type','priority']).done(function(arch) {
if (arch.length) { if (arch.length) {
var arch_object = self.parse_xml(arch[0].arch, self.main_view_id); var arch_object = self.parse_xml(arch[0].arch, self.main_view_id);
self.main_view_type = arch[0].type == 'tree'? 'list': arch[0].type; self.main_view_type = arch[0].type == 'tree'? 'list': arch[0].type;
view_arch_list.push({"view_id": self.main_view_id, "arch": arch[0].arch,"priority":arch[0].priority}); view_arch_list.push({"view_id": self.main_view_id, "arch": arch[0].arch,"priority":arch[0].priority});
self.dataset.read_slice([], {domain: [['inherit_id','=', parseInt(self.main_view_id)]]}).then(function(result) { self.dataset.read_slice([], {domain: [['inherit_id','=', parseInt(self.main_view_id)]]}).done(function(result) {
_.each(result, function(res) { _.each(result, function(res) {
view_arch_list.push({"view_id": res.id, "arch": res.arch,"priority":res.priority}); view_arch_list.push({"view_id": res.id, "arch": res.arch,"priority":res.priority});
self.inherit_view(arch_object, res); self.inherit_view(arch_object, res);
@ -455,7 +455,7 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({
var priority = _.detect(self.one_object['arch'], function(val) {return val.view_id == view_id;}); var priority = _.detect(self.one_object['arch'], function(val) {return val.view_id == view_id;});
var arch = _.str.sprintf("<?xml version='1.0'?>\n\t <field name='%s' position='after'> </field>", val[1]); var arch = _.str.sprintf("<?xml version='1.0'?>\n\t <field name='%s' position='after'> </field>", val[1]);
var vals = {'model': self.model, 'name': view_name, 'priority': priority.priority + 1, 'type': "form", 'arch': arch,'inherit_id':self.main_view_id}; var vals = {'model': self.model, 'name': view_name, 'priority': priority.priority + 1, 'type': "form", 'arch': arch,'inherit_id':self.main_view_id};
this.dataset.create(vals).then(function(id) { this.dataset.create(vals).done(function(id) {
var arch_to_obj = self.parse_xml(arch,id); var arch_to_obj = self.parse_xml(arch,id);
obj.child_id.push(arch_to_obj[0]); obj.child_id.push(arch_to_obj[0]);
self.one_object['parent_child_id'] = self.parent_child_list(self.one_object['main_object'],[]); self.one_object['parent_child_id'] = self.parent_child_list(self.one_object['main_object'],[]);
@ -538,7 +538,7 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({
var value = _.has(_CHILDREN, element) ? element : _.str.include(html_tag, element)?"html_tag":false; var value = _.has(_CHILDREN, element) ? element : _.str.include(html_tag, element)?"html_tag":false;
property_to_check.push(value); property_to_check.push(value);
}); });
field_dataset.call( 'fields_get', []).then(function(result) { field_dataset.call( 'fields_get', []).done(function(result) {
var fields = _.keys(result); var fields = _.keys(result);
fields.push(" "),fields.sort(); fields.push(" "),fields.sort();
self.on_add_node(property_to_check, fields); self.on_add_node(property_to_check, fields);
@ -890,7 +890,7 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({
var arch_val = self.get_object_by_id(this.one_object.clicked_tr_id,this.one_object['main_object'], []); var arch_val = self.get_object_by_id(this.one_object.clicked_tr_id,this.one_object['main_object'], []);
this.edit_node_dialog.$el.append('<table id="rec_table" style="width:400px" class="oe_form"></table>'); this.edit_node_dialog.$el.append('<table id="rec_table" style="width:400px" class="oe_form"></table>');
this.edit_widget = []; this.edit_widget = [];
self.ready = $.when(self.on_groups(properties)).then(function () { self.ready = $.when(self.on_groups(properties)).done(function () {
_PROPERTIES_ATTRIBUTES['groups']['selection'] = self.groups; _PROPERTIES_ATTRIBUTES['groups']['selection'] = self.groups;
var values = _.keys( instance.web.form.widgets.map); var values = _.keys( instance.web.form.widgets.map);
values.push(''); values.push('');
@ -993,7 +993,7 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({
table_selector.find("td[id^=]").attr("width","100px"); table_selector.find("td[id^=]").attr("width","100px");
self.add_node_dialog.$el.find('#new_field').click(function() { self.add_node_dialog.$el.find('#new_field').click(function() {
model_data = new instance.web.DataSetSearch(self,'ir.model', null, null); model_data = new instance.web.DataSetSearch(self,'ir.model', null, null);
model_data.read_slice([], {domain: [['model','=', self.model]]}).then(function(result) { model_data.read_slice([], {domain: [['model','=', self.model]]}).done(function(result) {
self.render_new_field(result[0]); self.render_new_field(result[0]);
}); });
}); });
@ -1011,7 +1011,7 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({
} }
}; };
var action_manager = new instance.web.ActionManager(self); var action_manager = new instance.web.ActionManager(self);
$.when(action_manager.do_action(action)).then(function() { $.when(action_manager.do_action(action)).done(function() {
var controller = action_manager.dialog_widget.views['form'].controller; var controller = action_manager.dialog_widget.views['form'].controller;
controller.on("on_button_cancel", self, function(){ controller.on("on_button_cancel", self, function(){
action_manager.destroy(); action_manager.destroy();