diff options
| author | vta vta@openerp.com <> | 2012-11-08 14:20:49 +0100 |
|---|---|---|
| committer | vta vta@openerp.com <> | 2012-11-08 14:20:49 +0100 |
| commit | 2576cd9d5cdf34c3233a0cdae7d8439bce85de1c (patch) | |
| tree | 08b44ce4e44d01018a32097acb902ee1eb2bb2fa | |
| parent | 6a229f4385db0a2961116fcf599502288089cb38 (diff) | |
| parent | d0400362d636cbe2677c29a9196d63f419b72bff (diff) | |
[MERGE] Latest trunk.
bzr revid: vta@openerp.com-20121108132049-7ape10oz1gvz4vi8
270 files changed, 32389 insertions, 20733 deletions
diff --git a/addons/web/__openerp__.py b/addons/web/__openerp__.py index fcfdca60a2a..51712954c53 100644 --- a/addons/web/__openerp__.py +++ b/addons/web/__openerp__.py @@ -17,7 +17,7 @@ This module provides the core of the OpenERP Web Client. "static/lib/datejs/parser.js", "static/lib/datejs/sugarpak.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.form/jquery.form.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/jquery.autosize/jquery.autosize.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.notify/js/jquery.notify.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", ], '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.notify/css/ui.notify.css", "static/lib/jquery.tipsy/tipsy.css", diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index 72ffd9567f6..ad8d91ed1dd 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -575,6 +575,20 @@ def from_elementtree(el, preserve_whitespaces=False): res["children"] = kids return res + +def content_disposition(filename, req): + filename = filename.encode('utf8') + escaped = urllib2.quote(filename) + browser = req.httprequest.user_agent.browser + version = int((req.httprequest.user_agent.version or '0').split('.')[0]) + if browser == 'msie' and version < 9: + return "attachment; filename=%s" % escaped + elif browser == 'safari': + return "attachment; filename=%s" % filename + else: + return "attachment; filename*=UTF-8''%s" % escaped + + #---------------------------------------------------------- # OpenERP Web web Controllers #---------------------------------------------------------- @@ -841,7 +855,7 @@ class Database(openerpweb.Controller): } return req.make_response(db_dump, [('Content-Type', 'application/octet-stream; charset=binary'), - ('Content-Disposition', 'attachment; filename="' + filename + '"')], + ('Content-Disposition', content_disposition(filename, req))], {'fileToken': int(token)} ) except xmlrpclib.Fault, e: @@ -1520,17 +1534,6 @@ class Binary(openerpweb.Controller): def placeholder(self, req): addons_path = openerpweb.addons_manifest['web']['addons_path'] return open(os.path.join(addons_path, 'web', 'static', 'src', 'img', 'placeholder.png'), 'rb').read() - def content_disposition(self, filename, req): - filename = filename.encode('utf8') - escaped = urllib2.quote(filename) - browser = req.httprequest.user_agent.browser - version = int((req.httprequest.user_agent.version or '0').split('.')[0]) - if browser == 'msie' and version < 9: - return "attachment; filename=%s" % escaped - elif browser == 'safari': - return "attachment; filename=%s" % filename - else: - return "attachment; filename*=UTF-8''%s" % escaped @openerpweb.httprequest def saveas(self, req, model, field, id=None, filename_field=None, **kw): @@ -1566,7 +1569,7 @@ class Binary(openerpweb.Controller): filename = res.get(filename_field, '') or filename return req.make_response(filecontent, [('Content-Type', 'application/octet-stream'), - ('Content-Disposition', self.content_disposition(filename, req))]) + ('Content-Disposition', content_disposition(filename, req))]) @openerpweb.httprequest def saveas_ajax(self, req, data, token): @@ -1596,7 +1599,7 @@ class Binary(openerpweb.Controller): filename = res.get(filename_field, '') or filename return req.make_response(filecontent, headers=[('Content-Type', 'application/octet-stream'), - ('Content-Disposition', self.content_disposition(filename, req))], + ('Content-Disposition', content_disposition(filename, req))], cookies={'fileToken': int(token)}) @openerpweb.httprequest @@ -1861,7 +1864,8 @@ class Export(View): return req.make_response(self.from_data(columns_headers, import_data), - headers=[('Content-Disposition', 'attachment; filename="%s"' % self.filename(model)), + headers=[('Content-Disposition', + content_disposition(self.filename(model), req)), ('Content-Type', self.content_type)], cookies={'fileToken': int(token)}) @@ -1997,11 +2001,11 @@ class Reports(View): file_name = reports.read(res_id[0], ['name'], context)['name'] else: file_name = action['report_name'] + file_name = '%s.%s' % (file_name, report_struct['format']) return req.make_response(report, headers=[ - # maybe we should take of what characters can appear in a file name? - ('Content-Disposition', 'attachment; filename="%s.%s"' % (file_name, report_struct['format'])), + ('Content-Disposition', content_disposition(file_name, req)), ('Content-Type', report_mimetype), ('Content-Length', len(report))], cookies={'fileToken': int(token)}) diff --git a/addons/web/doc/index.rst b/addons/web/doc/index.rst index 6a0d8dee2d4..99edd1156e0 100644 --- a/addons/web/doc/index.rst +++ b/addons/web/doc/index.rst @@ -11,12 +11,15 @@ Contents: .. toctree:: :maxdepth: 1 + presentation + changelog-7.0 async rpc widget + qweb search-view list-view diff --git a/addons/web/doc/presentation.rst b/addons/web/doc/presentation.rst new file mode 100644 index 00000000000..c249b540513 --- /dev/null +++ b/addons/web/doc/presentation.rst @@ -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/ diff --git a/addons/web/doc/qweb.rst b/addons/web/doc/qweb.rst new file mode 100644 index 00000000000..85719c6742d --- /dev/null +++ b/addons/web/doc/qweb.rst @@ -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. diff --git a/addons/web/i18n/hu.po b/addons/web/i18n/hu.po index 2e6f36cb2cf..cea5493c029 100644 --- a/addons/web/i18n/hu.po +++ b/addons/web/i18n/hu.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: openerp-web\n" "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" "POT-Creation-Date: 2012-07-02 09:06+0200\n" -"PO-Revision-Date: 2012-08-24 09:16+0000\n" +"PO-Revision-Date: 2012-10-26 12:17+0000\n" "Last-Translator: Herczeg Péter <herczegp@gmail.com>\n" "Language-Team: Hungarian <hu@li.org>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-10-21 05:02+0000\n" -"X-Generator: Launchpad (build 16165)\n" +"X-Launchpad-Export-Date: 2012-10-27 05:15+0000\n" +"X-Generator: Launchpad (build 16194)\n" #. openerp-web #: addons/web/static/src/js/chrome.js:176 @@ -755,7 +755,7 @@ msgstr "Választani kell legalább egy rekordot!" #. openerp-web #: addons/web/static/src/js/views.js:875 msgid "Uploading..." -msgstr "" +msgstr "Feltöltés" #. openerp-web #: addons/web/static/src/js/views.js:885 diff --git a/addons/web/i18n/ru.po b/addons/web/i18n/ru.po index fa80053a306..ed5735602d0 100644 --- a/addons/web/i18n/ru.po +++ b/addons/web/i18n/ru.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: openerp-web\n" "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" "POT-Creation-Date: 2012-07-02 09:06+0200\n" -"PO-Revision-Date: 2012-10-23 14:30+0000\n" +"PO-Revision-Date: 2012-11-01 12:07+0000\n" "Last-Translator: Chertykov Denis <chertykov@gmail.com>\n" "Language-Team: Russian <ru@li.org>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-10-24 05:20+0000\n" -"X-Generator: Launchpad (build 16179)\n" +"X-Launchpad-Export-Date: 2012-11-02 05:20+0000\n" +"X-Generator: Launchpad (build 16218)\n" #. openerp-web #: addons/web/static/src/js/chrome.js:176 @@ -306,7 +306,7 @@ msgstr "Группировать по: %s" #. openerp-web #: addons/web/static/src/js/search.js:1132 msgid "GroupBy" -msgstr "" +msgstr "Группировать по" #. openerp-web #: addons/web/static/src/js/search.js:1267 @@ -535,7 +535,7 @@ msgstr "Удалить" #. openerp-web #: addons/web/static/src/xml/base.xml:762 msgid "Duplicate" -msgstr "Клонировать" +msgstr "Дублировать" #. openerp-web #: addons/web/static/src/js/view_form.js:133 @@ -867,13 +867,13 @@ msgstr "Удалить" #: addons/web/static/src/xml/base.xml:166 #: addons/web/static/src/xml/base.xml:329 msgid "Backup" -msgstr "Резервное копирование" +msgstr "Резервная копия" #. openerp-web #: addons/web/static/src/xml/base.xml:195 #: addons/web/static/src/xml/base.xml:330 msgid "Restore" -msgstr "Востановить" +msgstr "Восстановить" #. openerp-web #: addons/web/static/src/xml/base.xml:332 @@ -908,7 +908,7 @@ msgstr "Язык по умолчанию:" #. openerp-web #: addons/web/static/src/xml/base.xml:91 msgid "Admin password:" -msgstr "Пароль Администратора:" +msgstr "Пароль администратора:" #. openerp-web #: addons/web/static/src/xml/base.xml:95 @@ -1080,7 +1080,7 @@ msgstr "Изменить действие" #. openerp-web #: addons/web/static/src/xml/base.xml:486 msgid "Edit Workflow" -msgstr "Редактировать Процесс" +msgstr "Редактировать процесс" #. openerp-web #: addons/web/static/src/xml/base.xml:491 @@ -1222,7 +1222,7 @@ msgstr "При изменении:" #. openerp-web #: addons/web/static/src/xml/base.xml:981 msgid "Relation:" -msgstr "Отношение:" +msgstr "Связь:" #. openerp-web #: addons/web/static/src/xml/base.xml:985 @@ -1411,12 +1411,12 @@ msgstr "Применить" #. openerp-web #: addons/web/static/src/xml/base.xml:1509 msgid "Save & New" -msgstr "Сохранить и Создать" +msgstr "Сохранить и создать" #. openerp-web #: addons/web/static/src/xml/base.xml:1510 msgid "Save & Close" -msgstr "Сохранить и Закрыть" +msgstr "Сохранить и закрыть" #. openerp-web #: addons/web/static/src/xml/base.xml:1617 @@ -1556,7 +1556,7 @@ msgid "" "For use if CSV files have titles on multiple lines, skips more than a single " "line during import" msgstr "" -"Применимо если в CSV файле заголовки расположены в нескольких строках и из " +"Применимо если в CSV файле заголовки расположены в нескольких строках и их " "необходимо пропустить" #. openerp-web @@ -1669,9 +1669,6 @@ msgstr "Предпросмотр файла, который система не #~ msgid "Activate the developper mode" #~ msgstr "Активировать режим разработчика" -#~ msgid "Notebook Page \"" -#~ msgstr "Страница Блокнота \"" - #~ msgid "Filter disabled due to invalid syntax" #~ msgstr "Фильтр отключен из-за неверного синтаксиса" @@ -1686,3 +1683,6 @@ msgstr "Предпросмотр файла, который система не #~ msgid "Advanced Filters" #~ msgstr "Расширенные фильтры" + +#~ msgid "Notebook Page \"" +#~ msgstr "Страница блокнота \"" diff --git a/addons/web/i18n/sl.po b/addons/web/i18n/sl.po index e15e7b572bc..687742a1775 100644 --- a/addons/web/i18n/sl.po +++ b/addons/web/i18n/sl.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: openerp-web\n" "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" "POT-Creation-Date: 2012-07-02 09:06+0200\n" -"PO-Revision-Date: 2012-01-31 06:25+0000\n" -"Last-Translator: ERP Basing <erp@basing.si>\n" +"PO-Revision-Date: 2012-11-01 16:38+0000\n" +"Last-Translator: Dusan Laznik <laznik@mentis.si>\n" "Language-Team: Slovenian <sl@li.org>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-10-21 05:02+0000\n" -"X-Generator: Launchpad (build 16165)\n" +"X-Launchpad-Export-Date: 2012-11-02 05:20+0000\n" +"X-Generator: Launchpad (build 16218)\n" #. openerp-web #: addons/web/static/src/js/chrome.js:176 @@ -129,62 +129,62 @@ msgstr "OpenERP-Community Version" #. openerp-web #: addons/web/static/src/js/coresetup.js:619 msgid "less than a minute ago" -msgstr "" +msgstr "manj kot minuto nazaj" #. openerp-web #: addons/web/static/src/js/coresetup.js:620 msgid "about a minute ago" -msgstr "" +msgstr "približno pred minuto" #. openerp-web #: addons/web/static/src/js/coresetup.js:621 #, python-format msgid "%d minutes ago" -msgstr "" +msgstr "pred %d minutami" #. openerp-web #: addons/web/static/src/js/coresetup.js:622 msgid "about an hour ago" -msgstr "" +msgstr "pred približno eno uro" #. openerp-web #: addons/web/static/src/js/coresetup.js:623 #, python-format msgid "%d hours ago" -msgstr "" +msgstr "Pred %d urami" #. openerp-web #: addons/web/static/src/js/coresetup.js:624 msgid "a day ago" -msgstr "" +msgstr "pred enim dnevom" #. openerp-web #: addons/web/static/src/js/coresetup.js:625 #, python-format msgid "%d days ago" -msgstr "" +msgstr "pred %d dnevi" #. openerp-web #: addons/web/static/src/js/coresetup.js:626 msgid "about a month ago" -msgstr "" +msgstr "približno pred enim mesecem" #. openerp-web #: addons/web/static/src/js/coresetup.js:627 #, python-format msgid "%d months ago" -msgstr "" +msgstr "pred %d meseci" #. openerp-web #: addons/web/static/src/js/coresetup.js:628 msgid "about a year ago" -msgstr "" +msgstr "približno pred enim letom" #. openerp-web #: addons/web/static/src/js/coresetup.js:629 #, python-format msgid "%d years ago" -msgstr "" +msgstr "Pred %d leti" #. openerp-web #: addons/web/static/src/js/data_export.js:6 @@ -293,13 +293,13 @@ msgstr "" #. openerp-web #: addons/web/static/src/js/search.js:999 msgid "Filter" -msgstr "" +msgstr "Filter:" #. openerp-web #: addons/web/static/src/js/search.js:1108 #, python-format msgid "Group by: %s" -msgstr "" +msgstr "Združi po: %s" #. openerp-web #: addons/web/static/src/js/search.js:1132 @@ -347,7 +347,7 @@ msgstr "Filtri" #. openerp-web #: addons/web/static/src/js/search.js:1762 msgid "Advanced" -msgstr "" +msgstr "Napredeno" #. openerp-web #: addons/web/static/src/js/search.js:1853 @@ -632,7 +632,7 @@ msgstr "Dodaj: " #. openerp-web #: addons/web/static/src/js/view_form.js:4230 msgid "Save As..." -msgstr "" +msgstr "Shrani kot ..." #. openerp-web #: addons/web/static/src/js/view_form.js:4230 @@ -669,7 +669,7 @@ msgstr "Skupina" #. openerp-web #: addons/web/static/src/js/view_list.js:549 msgid "Do you really want to remove these records?" -msgstr "" +msgstr "Res želite odstraniti te zapise?" #. openerp-web #: addons/web/static/src/js/views.js:925 @@ -679,7 +679,7 @@ msgstr "Opozorilo" #. openerp-web #: addons/web/static/src/js/view_list.js:716 msgid "You must select at least one record." -msgstr "" +msgstr "Izbrati morate vsaj en zapis" #. openerp-web #: addons/web/static/src/js/view_list.js:1243 @@ -727,17 +727,17 @@ msgstr "" #. openerp-web #: addons/web/static/src/js/views.js:716 msgid "Print" -msgstr "" +msgstr "Tiskanje" #. openerp-web #: addons/web/static/src/js/views.js:717 msgid "Attachment" -msgstr "" +msgstr "Priponka" #. openerp-web #: addons/web/static/src/js/views.js:718 addons/web/static/src/xml/base.xml:276 msgid "More" -msgstr "" +msgstr "Dodatno" #. openerp-web #: addons/web/static/src/js/views.js:810 @@ -757,7 +757,7 @@ msgstr "Izbrati morate vsaj en zapis." #. openerp-web #: addons/web/static/src/js/views.js:875 msgid "Uploading..." -msgstr "" +msgstr "Pošiljanje ..." #. openerp-web #: addons/web/static/src/js/views.js:885 @@ -963,7 +963,7 @@ msgstr "" #. openerp-web #: addons/web/static/src/xml/base.xml:327 msgid "Log out" -msgstr "" +msgstr "Odjava" #. openerp-web #: addons/web/static/src/xml/base.xml:333 @@ -1028,7 +1028,7 @@ msgstr "Potrditev gesla:" #. openerp-web #: addons/web/static/src/xml/base.xml:390 msgid "Open" -msgstr "" +msgstr "Odpri" #. openerp-web #: addons/web/static/src/xml/base.xml:390 @@ -1123,18 +1123,18 @@ msgstr "" #. openerp-web #: addons/web/static/src/xml/base.xml:527 msgid "Add..." -msgstr "" +msgstr "Dodaj ..." #. openerp-web #: addons/web/static/src/xml/base.xml:622 #: addons/web/static/src/xml/base.xml:687 msgid "or" -msgstr "" +msgstr "ali" #. openerp-web #: addons/web/static/src/xml/base.xml:687 msgid "Discard" -msgstr "" +msgstr "Opusti" #. openerp-web #: addons/web/static/src/xml/base.xml:806 @@ -1220,7 +1220,7 @@ msgstr "" #. openerp-web #: addons/web/static/src/xml/base.xml:981 msgid "Relation:" -msgstr "" +msgstr "Relacija:" #. openerp-web #: addons/web/static/src/xml/base.xml:985 @@ -1235,7 +1235,7 @@ msgstr "Odpri vir" #. openerp-web #: addons/web/static/src/xml/base.xml:1063 msgid "Select date" -msgstr "" +msgstr "Izberi datum" #. openerp-web #: addons/web/static/src/xml/base.xml:948 @@ -1298,7 +1298,7 @@ msgstr "" #. openerp-web #: addons/web/static/src/xml/base.xml:1260 msgid "Button Type:" -msgstr "" +msgstr "Vrsta tipke:" #. openerp-web #: addons/web/static/src/xml/base.xml:1264 @@ -1318,7 +1318,7 @@ msgstr "Polje" #. openerp-web #: addons/web/static/src/xml/base.xml:1205 msgid "Advanced Search..." -msgstr "" +msgstr "Napredno iskanje ..." #. openerp-web #: addons/web/static/src/xml/base.xml:1287 @@ -1363,7 +1363,7 @@ msgstr "" #. openerp-web #: addons/web/static/src/xml/base.xml:1381 msgid "Filter name" -msgstr "" +msgstr "Ime filtra" #. openerp-web #: addons/web/static/src/xml/base.xml:1383 diff --git a/addons/web/i18n/zh_CN.po b/addons/web/i18n/zh_CN.po index 69cd72339ae..09a7d041b88 100644 --- a/addons/web/i18n/zh_CN.po +++ b/addons/web/i18n/zh_CN.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: openerp-web\n" "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" "POT-Creation-Date: 2012-07-02 09:06+0200\n" -"PO-Revision-Date: 2012-02-17 07:29+0000\n" -"Last-Translator: Jeff Wang <wjfonhand@hotmail.com>\n" +"PO-Revision-Date: 2012-11-06 04:40+0000\n" +"Last-Translator: Wei \"oldrev\" Li <oldrev@gmail.com>\n" "Language-Team: Chinese (Simplified) <zh_CN@li.org>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-10-21 05:03+0000\n" -"X-Generator: Launchpad (build 16165)\n" +"X-Launchpad-Export-Date: 2012-11-07 04:55+0000\n" +"X-Generator: Launchpad (build 16232)\n" #. openerp-web #: addons/web/static/src/js/chrome.js:176 @@ -129,56 +129,56 @@ msgstr "OpenERP社区支持版" #. openerp-web #: addons/web/static/src/js/coresetup.js:619 msgid "less than a minute ago" -msgstr "" +msgstr "一分钟内" #. openerp-web #: addons/web/static/src/js/coresetup.js:620 msgid "about a minute ago" -msgstr "" +msgstr "大约一分钟" #. openerp-web #: addons/web/static/src/js/coresetup.js:621 #, python-format msgid "%d minutes ago" -msgstr "" +msgstr "%d 分钟之前" #. openerp-web #: addons/web/static/src/js/coresetup.js:622 msgid "about an hour ago" -msgstr "" +msgstr "大约一小时前" #. openerp-web #: addons/web/static/src/js/coresetup.js:623 #, python-format msgid "%d hours ago" -msgstr "" +msgstr "%d 小时前" #. openerp-web #: addons/web/static/src/js/coresetup.js:624 msgid "a day ago" -msgstr "" +msgstr "一天前" #. openerp-web #: addons/web/static/src/js/coresetup.js:625 #, python-format msgid "%d days ago" -msgstr "" +msgstr "%d 天前" #. openerp-web #: addons/web/static/src/js/coresetup.js:626 msgid "about a month ago" -msgstr "" +msgstr "大约一月前" #. openerp-web #: addons/web/static/src/js/coresetup.js:627 #, python-format msgid "%d months ago" -msgstr "" +msgstr "%d 月前" #. openerp-web #: addons/web/static/src/js/coresetup.js:628 msgid "about a year ago" -msgstr "" +msgstr "大约一年前" #. openerp-web #: addons/web/static/src/js/coresetup.js:629 @@ -247,13 +247,13 @@ msgstr "" #. openerp-web #: addons/web/static/src/js/data_import.js:386 msgid "*Required Fields are not selected :" -msgstr "" +msgstr "*没有选择必须的字段:" #. openerp-web #: addons/web/static/src/js/formats.js:139 #, python-format msgid "(%d records)" -msgstr "" +msgstr "(%d 条记录)" #. openerp-web #: addons/web/static/src/js/formats.js:325 diff --git a/addons/web/static/lib/cleditor/jquery.cleditor.js b/addons/web/static/lib/cleditor/jquery.cleditor.js index c0763136c99..0fff0152776 100644 --- a/addons/web/static/lib/cleditor/jquery.cleditor.js +++ b/addons/web/static/lib/cleditor/jquery.cleditor.js @@ -295,7 +295,12 @@ // Bind the window resize event when the width or height is auto or %
if (/auto|%/.test("" + options.width + options.height))
- $(window).resize(function() {refresh(editor);});
+ $(window).resize(function() {
+ // CHM Note MonkeyPatch: if the DOM is not remove, refresh the cleditor
+ if(editor.$main.parent().parent().size()) {
+ refresh(editor);
+ }
+ });
// Create the iframe and resize the controls
refresh(editor);
@@ -562,7 +567,7 @@ //==================
// Private Functions
//==================
- +
// checksum - returns a checksum using the Adler-32 method
function checksum(text)
{
diff --git a/addons/web/static/lib/jquery.deferred-queue/LICENSE b/addons/web/static/lib/jquery.deferred-queue/LICENSE deleted file mode 100644 index ee8cf44578c..00000000000 --- a/addons/web/static/lib/jquery.deferred-queue/LICENSE +++ /dev/null @@ -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. diff --git a/addons/web/static/lib/jquery.deferred-queue/README b/addons/web/static/lib/jquery.deferred-queue/README deleted file mode 100644 index 71d980199c9..00000000000 --- a/addons/web/static/lib/jquery.deferred-queue/README +++ /dev/null @@ -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 diff --git a/addons/web/static/lib/jquery.deferred-queue/jquery.deferred-queue.js b/addons/web/static/lib/jquery.deferred-queue/jquery.deferred-queue.js deleted file mode 100644 index 7ef83342f77..00000000000 --- a/addons/web/static/lib/jquery.deferred-queue/jquery.deferred-queue.js +++ /dev/null @@ -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) diff --git a/addons/web/static/lib/jquery.ui.bootstrap/README.md b/addons/web/static/lib/jquery.ui.bootstrap/README.md new file mode 100644 index 00000000000..dfa1ad75302 --- /dev/null +++ b/addons/web/static/lib/jquery.ui.bootstrap/README.md @@ -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. diff --git a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_flat_0_aaaaaa_40x100.png b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_flat_0_aaaaaa_40x100.png Binary files differindex 5b5dab2ab7b..5b5dab2ab7b 100755..100644 --- a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_flat_0_aaaaaa_40x100.png +++ b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_flat_0_aaaaaa_40x100.png diff --git a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_55_fbf9ee_1x400.png b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_55_fbf9ee_1x400.png Binary files differindex ad3d6346e00..ad3d6346e00 100755..100644 --- a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_55_fbf9ee_1x400.png +++ b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_55_fbf9ee_1x400.png diff --git a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_65_ffffff_1x400.png b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_65_ffffff_1x400.png Binary files differindex 42ccba269b6..42ccba269b6 100755..100644 --- a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_65_ffffff_1x400.png +++ b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_65_ffffff_1x400.png diff --git a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_75_dadada_1x400.png b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_75_dadada_1x400.png Binary files differindex 5a46b47cb16..5a46b47cb16 100755..100644 --- a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_75_dadada_1x400.png +++ b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_75_dadada_1x400.png diff --git a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_75_e6e6e6_1x400.png b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_75_e6e6e6_1x400.png Binary files differindex 86c2baa655e..86c2baa655e 100755..100644 --- a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_75_e6e6e6_1x400.png +++ b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_75_e6e6e6_1x400.png diff --git a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_75_ffffff_1x400.png b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_75_ffffff_1x400.png Binary files differindex e65ca1297c7..e65ca1297c7 100755..100644 --- a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_75_ffffff_1x400.png +++ b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_glass_75_ffffff_1x400.png diff --git a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_highlight-soft_75_cccccc_1x100.png Binary files differindex 7c9fa6c6edc..7c9fa6c6edc 100755..100644 --- a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_highlight-soft_75_cccccc_1x100.png +++ b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_highlight-soft_75_cccccc_1x100.png diff --git a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_inset-soft_95_fef1ec_1x100.png b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_inset-soft_95_fef1ec_1x100.png Binary files differindex 0e05810fffe..0e05810fffe 100755..100644 --- a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_inset-soft_95_fef1ec_1x100.png +++ b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-bg_inset-soft_95_fef1ec_1x100.png diff --git a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_222222_256x240.png b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_222222_256x240.png Binary files differindex b273ff111d2..b273ff111d2 100755..100644 --- a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_222222_256x240.png +++ b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_222222_256x240.png diff --git a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_2e83ff_256x240.png b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_2e83ff_256x240.png Binary files differindex 09d1cdc856c..09d1cdc856c 100755..100644 --- a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_2e83ff_256x240.png +++ b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_2e83ff_256x240.png diff --git a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_454545_256x240.png b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_454545_256x240.png Binary files differindex 59bd45b907c..59bd45b907c 100755..100644 --- a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_454545_256x240.png +++ b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_454545_256x240.png diff --git a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_888888_256x240.png b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_888888_256x240.png Binary files differindex 6d02426c114..6d02426c114 100755..100644 --- a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_888888_256x240.png +++ b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_888888_256x240.png diff --git a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_cd0a0a_256x240.png b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_cd0a0a_256x240.png Binary files differindex 2ab019b73ec..2ab019b73ec 100755..100644 --- a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_cd0a0a_256x240.png +++ b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/images/ui-icons_cd0a0a_256x240.png diff --git a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/jquery-ui-1.8.16.custom.css b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/jquery-ui-1.9.0.custom.css index 513fd4abe59..a06e9447afc 100644 --- a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/jquery-ui-1.8.16.custom.css +++ b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/jquery-ui-1.9.0.custom.css @@ -23,6 +23,7 @@ .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } + /* Interaction Cues ----------------------------------*/ .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 .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 a { color: #404040; } .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; } - /* 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-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; } /* - * 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. * 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-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 .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 .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; } @@ -465,46 +465,55 @@ * 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. * 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; - background:#0064CD; - color:#fff + +.ui-menu { list-style:none; padding: 2px; margin: 0; display:block; float:left; outline: none; } +.ui-menu .ui-menu { margin-top: -3px; position: absolute; } +.ui-menu .ui-menu-item { margin: 0; padding: 0; zoom: 1;float: left;clear: left; 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: 0; + color: #ffffff; + background: #0064cd; + background-color: #0064cd; + background-repeat: repeat-x; + 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); } +.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 @@ -651,7 +660,31 @@ button.ui-button-icons-only { width: 3.7em; } /* workarounds */ 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 @@ -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-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.16 +.ui-slider-vertical .ui-slider-range-max { top: 0; } + +/* + * 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. * 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; border-style: solid; @@ -824,14 +859,11 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad background:whiteSmoke; border-bottom:1px solid #ddd; 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 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{ -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; border: 1px solid #ddd; border-bottom-color: #ffffff; cursor: default; - color:#4c4c4c; + color:gray; outline:none; } - -.ui-tabs .ui-tabs-nav li.ui-tabs-selected:hover{ +.ui-tabs .ui-tabs-nav li.ui-tabs-active:hover{ background:#ffffff; outline:none; } - -.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.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; 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... */ .ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: 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; } - +/* + * jQuery UI Tooltip 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/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.8.16 + * jQuery UI Datepicker 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. * http://jquery.org/license * - * http://docs.jquery.com/UI/Datepicker#theming + * http://jqueryui.com/datepicker/ */ .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; } @@ -982,7 +1036,7 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad } .ui-datepicker td:hover{ - color:white; + color: #ffffff; } .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; font-size:normal; text-shadow: 0px; - color:white; + color: #ffffff; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } -.ui-datepicker td .ui-state-default:hover{ - background:#0064cd; - color:white; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; +.ui-datepicker td .ui-state-hover { + color: #ffffff; + background: #0064cd; + background-color: #0064cd; + background-repeat: repeat-x; + 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 * @@ -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); 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; -moz-box-shadow: none; box-shadow: none; outline: 1px dotted #666; -}*/ +} -/*input[type="text"], +input[type="text"], input[type="password"], -textarea,*/ +.ui-autocomplete-input, +textarea, .uneditable-input { display: inline-block; padding: 4px; diff --git a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/jquery.ui.1.8.16.ie.css b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/jquery.ui.1.9.0.ie.css index b24b9fb8ab0..b7392b0cd69 100644 --- a/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/jquery.ui.1.8.16.ie.css +++ b/addons/web/static/lib/jquery.ui.bootstrap/css/custom-theme/jquery.ui.1.9.0.ie.css @@ -1,5 +1,15 @@ .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-tabs-selected { border-radius:0px;} .ui-tabs .ui-tabs-nav li{ filter:none;} diff --git a/addons/web/static/lib/jquery.ui.bootstrap/css/less/forms.less b/addons/web/static/lib/jquery.ui.bootstrap/css/less/forms.less index 835890f33f4..835890f33f4 100755..100644 --- a/addons/web/static/lib/jquery.ui.bootstrap/css/less/forms.less +++ b/addons/web/static/lib/jquery.ui.bootstrap/css/less/forms.less diff --git a/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png b/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png Binary files differindex ad3d6346e00..b39a6fb27ff 100644 --- a/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +++ b/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png diff --git a/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-icons_2e83ff_256x240.png b/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-icons_2e83ff_256x240.png Binary files differindex 09d1cdc856c..84defe6e8ab 100644 --- a/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-icons_2e83ff_256x240.png +++ b/addons/web/static/lib/jquery.ui/css/smoothness/images/ui-icons_2e83ff_256x240.png diff --git a/addons/web/static/lib/jquery.ui/css/smoothness/jquery-ui-1.8.17.custom.css b/addons/web/static/lib/jquery.ui/css/smoothness/jquery-ui-1.9.1.custom.css index 3a4da3911c3..557e531a476 100644 --- a/addons/web/static/lib/jquery.ui/css/smoothness/jquery-ui-1.8.17.custom.css +++ b/addons/web/static/lib/jquery.ui/css/smoothness/jquery-ui-1.9.1.custom.css @@ -1,12 +1,8 @@ -/* - * jQuery UI CSS Framework 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/Theming/API - */ +/*! jQuery UI - v1.9.1 - 2012-10-29 +* 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 +* 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 +* Copyright (c) 2012 jQuery Foundation and other contributors Licensed MIT */ /* Layout helpers ----------------------------------*/ @@ -36,20 +32,198 @@ /* Overlays */ .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 */ +.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 */ +.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; } -/* - * jQuery UI CSS Framework 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/Theming/API - * - * 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 - */ +.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 ----------------------------------*/ @@ -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 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 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 a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; } -.ui-widget :active { outline: none; } /* 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-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-icon { filter:Alpha(Opacity=35); } /* For IE8 - See #6059 */ /* Icons ----------------------------------*/ @@ -222,8 +396,8 @@ .ui-icon-help { background-position: -48px -144px; } .ui-icon-check { background-position: -64px -144px; } .ui-icon-bullet { background-position: -80px -144px; } -.ui-icon-radio-off { background-position: -96px -144px; } -.ui-icon-radio-on { background-position: -112px -144px; } +.ui-icon-radio-on { background-position: -96px -144px; } +.ui-icon-radio-off { background-position: -112px -144px; } .ui-icon-pin-w { background-position: -128px -144px; } .ui-icon-pin-s { background-position: -144px -144px; } .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; } /* 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-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; }/* - * 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%; }
\ No newline at end of file +.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: .3;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }
\ No newline at end of file diff --git a/addons/web/static/lib/jquery.ui/css/smoothness/jquery-ui-1.9.1.custom.min.css b/addons/web/static/lib/jquery.ui/css/smoothness/jquery-ui-1.9.1.custom.min.css new file mode 100644 index 00000000000..57670ffe715 --- /dev/null +++ b/addons/web/static/lib/jquery.ui/css/smoothness/jquery-ui-1.9.1.custom.min.css @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.9.1 - 2012-10-29 +* 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 +* 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 +* Copyright (c) 2012 jQuery Foundation and other contributors Licensed MIT */.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{position:absolute!important;clip:rect(1px);clip:rect(1px,1px,1px,1px)}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{zoom:1}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.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;cursor:default}* html .ui-autocomplete{width:1px}.ui-button{display:inline-block;position:relative;padding:0;margin-right:.1em;cursor:pointer;text-align:center;zoom:1;overflow:visible}.ui-button,.ui-button:link,.ui-button:visited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-icon-only{width:2.2em}button.ui-button-icon-only{width:2.4em}.ui-button-icons-only{width:3.4em}button.ui-button-icons-only{width:3.7em}.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}input.ui-button{padding:.4em 1em}.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}.ui-buttonset{margin-right:7px}.ui-buttonset .ui-button{margin-left:0;margin-right:-.3em}button.ui-button::-moz-focus-inner{border:0;padding:0}.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}.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}.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}.ui-datepicker-cover{position:absolute;z-index:-1;filter:mask();top:-4px;left:-4px;width:200px;height:200px}.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}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item a{position:relative;padding-left:2em}.ui-menu .ui-icon{position:absolute;top:.2em;left:.2em}.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}.ui-spinner .ui-icon{position:absolute;margin-top:-8px;top:50%;left:0}.ui-spinner-up{top:0}.ui-spinner-down{bottom:0}.ui-spinner .ui-icon-triangle-1-s{background-position:-65px -16px}.ui-tabs{position:relative;padding:.2em;zoom:1}.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}.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}* html .ui-tooltip{background-image:none}body .ui-tooltip{border-width:2px}.ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #aaa;background:#fff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;color:#222}.ui-widget-content a{color:#222}.ui-widget-header{border:1px solid #aaa;background:#ccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x;color:#222;font-weight:bold}.ui-widget-header a{color:#222}.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:#555}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#555;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 #999;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,.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 #aaa;background:#fff 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-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fcefa1;background:#fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x;color:#363636}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x;color:#cd0a0a}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#cd0a0a}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#cd0a0a}.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-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)}.ui-icon{width:16px;height:16px;background-image:url(images/ui-icons_222222_256x240.png)}.ui-widget-content .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-widget-header .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-state-default .ui-icon{background-image:url(images/ui-icons_888888_256x240.png)}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}.ui-state-active .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}.ui-state-highlight .ui-icon{background-image:url(images/ui-icons_2e83ff_256x240.png)}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url(images/ui-icons_cd0a0a_256x240.png)}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{-moz-border-radius-topleft:4px;-webkit-border-top-left-radius:4px;-khtml-border-top-left-radius:4px;border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{-moz-border-radius-topright:4px;-webkit-border-top-right-radius:4px;-khtml-border-top-right-radius:4px;border-top-right-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{-moz-border-radius-bottomleft:4px;-webkit-border-bottom-left-radius:4px;-khtml-border-bottom-left-radius:4px;border-bottom-left-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}.ui-widget-overlay{background:#aaa 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:#aaa 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}
\ No newline at end of file diff --git a/addons/web/static/lib/jquery.ui/js/jquery-ui-1.8.17.custom.min.js b/addons/web/static/lib/jquery.ui/js/jquery-ui-1.8.17.custom.min.js deleted file mode 100644 index 991cb8d0a67..00000000000 --- a/addons/web/static/lib/jquery.ui/js/jquery-ui-1.8.17.custom.min.js +++ /dev/null @@ -1,356 +0,0 @@ -/*! - * jQuery UI 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 - */(function(a,b){function d(b){return!a(b).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}function c(b,c){var e=b.nodeName.toLowerCase();if("area"===e){var f=b.parentNode,g=f.name,h;if(!b.href||!g||f.nodeName.toLowerCase()!=="map")return!1;h=a("img[usemap=#"+g+"]")[0];return!!h&&d(h)}return(/input|select|textarea|button|object/.test(e)?!b.disabled:"a"==e?b.href||c:c)&&d(b)}a.ui=a.ui||{};a.ui.version||(a.extend(a.ui,{version:"1.8.17",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(b,c){return typeof b=="number"?this.each(function(){var d=this;setTimeout(function(){a(d).focus(),c&&c.call(d)},b)}):this._focus.apply(this,arguments)},scrollParent:function(){var b;a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?b=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):b=this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!b.length?a(document):b},zIndex:function(c){if(c!==b)return this.css("zIndex",c);if(this.length){var d=a(this[0]),e,f;while(d.length&&d[0]!==document){e=d.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){f=parseInt(d.css("zIndex"),10);if(!isNaN(f)&&f!==0)return f}d=d.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),a.each(["Width","Height"],function(c,d){function h(b,c,d,f){a.each(e,function(){c-=parseFloat(a.curCSS(b,"padding"+this,!0))||0,d&&(c-=parseFloat(a.curCSS(b,"border"+this+"Width",!0))||0),f&&(c-=parseFloat(a.curCSS(b,"margin"+this,!0))||0)});return c}var e=d==="Width"?["Left","Right"]:["Top","Bottom"],f=d.toLowerCase(),g={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+d]=function(c){if(c===b)return g["inner"+d].call(this);return this.each(function(){a(this).css(f,h(this,c)+"px")})},a.fn["outer"+d]=function(b,c){if(typeof b!="number")return g["outer"+d].call(this,b);return this.each(function(){a(this).css(f,h(this,b,!0,c)+"px")})}}),a.extend(a.expr[":"],{data:function(b,c,d){return!!a.data(b,d[3])},focusable:function(b){return c(b,!isNaN(a.attr(b,"tabindex")))},tabbable:function(b){var d=a.attr(b,"tabindex"),e=isNaN(d);return(e||d>=0)&&c(b,!e)}}),a(function(){var b=document.body,c=b.appendChild(c=document.createElement("div"));a.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),a.support.minHeight=c.offsetHeight===100,a.support.selectstart="onselectstart"in c,b.removeChild(c).style.display="none"}),a.extend(a.ui,{plugin:{add:function(b,c,d){var e=a.ui[b].prototype;for(var f in d)e.plugins[f]=e.plugins[f]||[],e.plugins[f].push([c,d[f]])},call:function(a,b,c){var d=a.plugins[b];if(!!d&&!!a.element[0].parentNode)for(var e=0;e<d.length;e++)a.options[d[e][0]]&&d[e][1].apply(a.element,c)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(b,c){if(a(b).css("overflow")==="hidden")return!1;var d=c&&c==="left"?"scrollLeft":"scrollTop",e=!1;if(b[d]>0)return!0;b[d]=1,e=b[d]>0,b[d]=0;return e},isOverAxis:function(a,b,c){return a>b&&a<b+c},isOver:function(b,c,d,e,f,g){return a.ui.isOverAxis(b,d,f)&&a.ui.isOverAxis(c,e,g)}}))})(jQuery);/*! - * jQuery UI Widget 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/Widget - */(function(a,b){if(a.cleanData){var c=a.cleanData;a.cleanData=function(b){for(var d=0,e;(e=b[d])!=null;d++)try{a(e).triggerHandler("remove")}catch(f){}c(b)}}else{var d=a.fn.remove;a.fn.remove=function(b,c){return this.each(function(){c||(!b||a.filter(b,[this]).length)&&a("*",this).add([this]).each(function(){try{a(this).triggerHandler("remove")}catch(b){}});return d.call(a(this),b,c)})}}a.widget=function(b,c,d){var e=b.split(".")[0],f;b=b.split(".")[1],f=e+"-"+b,d||(d=c,c=a.Widget),a.expr[":"][f]=function(c){return!!a.data(c,b)},a[e]=a[e]||{},a[e][b]=function(a,b){arguments.length&&this._createWidget(a,b)};var g=new c;g.options=a.extend(!0,{},g.options),a[e][b].prototype=a.extend(!0,g,{namespace:e,widgetName:b,widgetEventPrefix:a[e][b].prototype.widgetEventPrefix||b,widgetBaseClass:f},d),a.widget.bridge(b,a[e][b])},a.widget.bridge=function(c,d){a.fn[c]=function(e){var f=typeof e=="string",g=Array.prototype.slice.call(arguments,1),h=this;e=!f&&g.length?a.extend.apply(null,[!0,e].concat(g)):e;if(f&&e.charAt(0)==="_")return h;f?this.each(function(){var d=a.data(this,c),f=d&&a.isFunction(d[e])?d[e].apply(d,g):d;if(f!==d&&f!==b){h=f;return!1}}):this.each(function(){var b=a.data(this,c);b?b.option(e||{})._init():a.data(this,c,new d(e,this))});return h}},a.Widget=function(a,b){arguments.length&&this._createWidget(a,b)},a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:!1},_createWidget:function(b,c){a.data(c,this.widgetName,this),this.element=a(c),this.options=a.extend(!0,{},this.options,this._getCreateOptions(),b);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()}),this._create(),this._trigger("create"),this._init()},_getCreateOptions:function(){return a.metadata&&a.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName),this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled "+"ui-state-disabled")},widget:function(){return this.element},option:function(c,d){var e=c;if(arguments.length===0)return a.extend({},this.options);if(typeof c=="string"){if(d===b)return this.options[c];e={},e[c]=d}this._setOptions(e);return this},_setOptions:function(b){var c=this;a.each(b,function(a,b){c._setOption(a,b)});return this},_setOption:function(a,b){this.options[a]=b,a==="disabled"&&this.widget()[b?"addClass":"removeClass"](this.widgetBaseClass+"-disabled"+" "+"ui-state-disabled").attr("aria-disabled",b);return this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_trigger:function(b,c,d){var e,f,g=this.options[b];d=d||{},c=a.Event(c),c.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase(),c.target=this.element[0],f=c.originalEvent;if(f)for(e in f)e in c||(c[e]=f[e]);this.element.trigger(c,d);return!(a.isFunction(g)&&g.call(this.element[0],c,d)===!1||c.isDefaultPrevented())}}})(jQuery);/*! - * jQuery UI Mouse 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/Mouse - * - * Depends: - * jquery.ui.widget.js - */(function(a,b){var c=!1;a(document).mouseup(function(a){c=!1}),a.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var b=this;this.element.bind("mousedown."+this.widgetName,function(a){return b._mouseDown(a)}).bind("click."+this.widgetName,function(c){if(!0===a.data(c.target,b.widgetName+".preventClickEvent")){a.removeData(c.target,b.widgetName+".preventClickEvent"),c.stopImmediatePropagation();return!1}}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(b){if(!c){this._mouseStarted&&this._mouseUp(b),this._mouseDownEvent=b;var d=this,e=b.which==1,f=typeof this.options.cancel=="string"&&b.target.nodeName?a(b.target).closest(this.options.cancel).length:!1;if(!e||f||!this._mouseCapture(b))return!0;this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){d.mouseDelayMet=!0},this.options.delay));if(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)){this._mouseStarted=this._mouseStart(b)!==!1;if(!this._mouseStarted){b.preventDefault();return!0}}!0===a.data(b.target,this.widgetName+".preventClickEvent")&&a.removeData(b.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(a){return d._mouseMove(a)},this._mouseUpDelegate=function(a){return d._mouseUp(a)},a(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),b.preventDefault(),c=!0;return!0}},_mouseMove:function(b){if(a.browser.msie&&!(document.documentMode>=9)&&!b.button)return this._mouseUp(b);if(this._mouseStarted){this._mouseDrag(b);return b.preventDefault()}this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==!1,this._mouseStarted?this._mouseDrag(b):this._mouseUp(b));return!this._mouseStarted},_mouseUp:function(b){a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,b.target==this._mouseDownEvent.target&&a.data(b.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(b));return!1},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(a){return this.mouseDelayMet},_mouseStart:function(a){},_mouseDrag:function(a){},_mouseStop:function(a){},_mouseCapture:function(a){return!0}})})(jQuery);/* - * jQuery UI Position 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/Position - */(function(a,b){a.ui=a.ui||{};var c=/left|center|right/,d=/top|center|bottom/,e="center",f={},g=a.fn.position,h=a.fn.offset;a.fn.position=function(b){if(!b||!b.of)return g.apply(this,arguments);b=a.extend({},b);var h=a(b.of),i=h[0],j=(b.collision||"flip").split(" "),k=b.offset?b.offset.split(" "):[0,0],l,m,n;i.nodeType===9?(l=h.width(),m=h.height(),n={top:0,left:0}):i.setTimeout?(l=h.width(),m=h.height(),n={top:h.scrollTop(),left:h.scrollLeft()}):i.preventDefault?(b.at="left top",l=m=0,n={top:b.of.pageY,left:b.of.pageX}):(l=h.outerWidth(),m=h.outerHeight(),n=h.offset()),a.each(["my","at"],function(){var a=(b[this]||"").split(" ");a.length===1&&(a=c.test(a[0])?a.concat([e]):d.test(a[0])?[e].concat(a):[e,e]),a[0]=c.test(a[0])?a[0]:e,a[1]=d.test(a[1])?a[1]:e,b[this]=a}),j.length===1&&(j[1]=j[0]),k[0]=parseInt(k[0],10)||0,k.length===1&&(k[1]=k[0]),k[1]=parseInt(k[1],10)||0,b.at[0]==="right"?n.left+=l:b.at[0]===e&&(n.left+=l/2),b.at[1]==="bottom"?n.top+=m:b.at[1]===e&&(n.top+=m/2),n.left+=k[0],n.top+=k[1];return this.each(function(){var c=a(this),d=c.outerWidth(),g=c.outerHeight(),h=parseInt(a.curCSS(this,"marginLeft",!0))||0,i=parseInt(a.curCSS(this,"marginTop",!0))||0,o=d+h+(parseInt(a.curCSS(this,"marginRight",!0))||0),p=g+i+(parseInt(a.curCSS(this,"marginBottom",!0))||0),q=a.extend({},n),r;b.my[0]==="right"?q.left-=d:b.my[0]===e&&(q.left-=d/2),b.my[1]==="bottom"?q.top-=g:b.my[1]===e&&(q.top-=g/2),f.fractions||(q.left=Math.round(q.left),q.top=Math.round(q.top)),r={left:q.left-h,top:q.top-i},a.each(["left","top"],function(c,e){a.ui.position[j[c]]&&a.ui.position[j[c]][e](q,{targetWidth:l,targetHeight:m,elemWidth:d,elemHeight:g,collisionPosition:r,collisionWidth:o,collisionHeight:p,offset:k,my:b.my,at:b.at})}),a.fn.bgiframe&&c.bgiframe(),c.offset(a.extend(q,{using:b.using}))})},a.ui.position={fit:{left:function(b,c){var d=a(window),e=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft();b.left=e>0?b.left-e:Math.max(b.left-c.collisionPosition.left,b.left)},top:function(b,c){var d=a(window),e=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop();b.top=e>0?b.top-e:Math.max(b.top-c.collisionPosition.top,b.top)}},flip:{left:function(b,c){if(c.at[0]!==e){var d=a(window),f=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft(),g=c.my[0]==="left"?-c.elemWidth:c.my[0]==="right"?c.elemWidth:0,h=c.at[0]==="left"?c.targetWidth:-c.targetWidth,i=-2*c.offset[0];b.left+=c.collisionPosition.left<0?g+h+i:f>0?g+h+i:0}},top:function(b,c){if(c.at[1]!==e){var d=a(window),f=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop(),g=c.my[1]==="top"?-c.elemHeight:c.my[1]==="bottom"?c.elemHeight:0,h=c.at[1]==="top"?c.targetHeight:-c.targetHeight,i=-2*c.offset[1];b.top+=c.collisionPosition.top<0?g+h+i:f>0?g+h+i:0}}}},a.offset.setOffset||(a.offset.setOffset=function(b,c){/static/.test(a.curCSS(b,"position"))&&(b.style.position="relative");var d=a(b),e=d.offset(),f=parseInt(a.curCSS(b,"top",!0),10)||0,g=parseInt(a.curCSS(b,"left",!0),10)||0,h={top:c.top-e.top+f,left:c.left-e.left+g};"using"in c?c.using.call(b,h):d.css(h)},a.fn.offset=function(b){var c=this[0];if(!c||!c.ownerDocument)return null;if(b)return this.each(function(){a.offset.setOffset(this,b)});return h.call(this)}),function(){var b=document.getElementsByTagName("body")[0],c=document.createElement("div"),d,e,g,h,i;d=document.createElement(b?"div":"body"),g={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},b&&jQuery.extend(g,{position:"absolute",left:"-1000px",top:"-1000px"});for(var j in g)d.style[j]=g[j];d.appendChild(c),e=b||document.documentElement,e.insertBefore(d,e.firstChild),c.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;",h=a(c).offset(function(a,b){return b}).offset(),d.innerHTML="",e.removeChild(d),i=h.top+h.left+(b?2e3:0),f.fractions=i>21&&i<22}()})(jQuery);/* - * jQuery UI Draggable 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/Draggables - * - * Depends: - * jquery.ui.core.js - * jquery.ui.mouse.js - * jquery.ui.widget.js - */(function(a,b){a.widget("ui.draggable",a.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))&&(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},destroy:function(){if(!!this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy();return this}},_mouseCapture:function(b){var c=this.options;if(this.helper||c.disabled||a(b.target).is(".ui-resizable-handle"))return!1;this.handle=this._getHandle(b);if(!this.handle)return!1;c.iframeFix&&a(c.iframeFix===!0?"iframe":c.iframeFix).each(function(){a('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(a(this).offset()).appendTo("body")});return!0},_mouseStart:function(b){var c=this.options;this.helper=this._createHelper(b),this._cacheHelperProportions(),a.ui.ddmanager&&(a.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt),c.containment&&this._setContainment();if(this._trigger("start",b)===!1){this._clear();return!1}this._cacheHelperProportions(),a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.helper.addClass("ui-draggable-dragging"),this._mouseDrag(b,!0),a.ui.ddmanager&&a.ui.ddmanager.dragStart(this,b);return!0},_mouseDrag:function(b,c){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute");if(!c){var d=this._uiHash();if(this._trigger("drag",b,d)===!1){this._mouseUp({});return!1}this.position=d.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";a.ui.ddmanager&&a.ui.ddmanager.drag(this,b);return!1},_mouseStop:function(b){var c=!1;a.ui.ddmanager&&!this.options.dropBehaviour&&(c=a.ui.ddmanager.drop(this,b)),this.dropped&&(c=this.dropped,this.dropped=!1);if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return!1;if(this.options.revert=="invalid"&&!c||this.options.revert=="valid"&&c||this.options.revert===!0||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,c)){var d=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){d._trigger("stop",b)!==!1&&d._clear()})}else this._trigger("stop",b)!==!1&&this._clear();return!1},_mouseUp:function(b){this.options.iframeFix===!0&&a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),a.ui.ddmanager&&a.ui.ddmanager.dragStop(this,b);return a.ui.mouse.prototype._mouseUp.call(this,b)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?!0:!1;a(this.options.handle,this.element).find("*").andSelf().each(function(){this==b.target&&(c=!0)});return c},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b])):c.helper=="clone"?this.element.clone().removeAttr("id"):this.element;d.parents("body").length||d.appendTo(c.appendTo=="parent"?this.element[0].parentNode:c.appendTo),d[0]!=this.element[0]&&!/(fixed|absolute)/.test(d.css("position"))&&d.css("position","absolute");return d},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[b.containment=="document"?0:a(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,b.containment=="document"?0:a(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(b.containment=="document"?0:a(window).scrollLeft())+a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(b.containment=="document"?0:a(window).scrollTop())+(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)&&b.containment.constructor!=Array){var c=a(b.containment),d=c[0];if(!d)return;var e=c.offset(),f=a(d).css("overflow")!="hidden";this.containment=[(parseInt(a(d).css("borderLeftWidth"),10)||0)+(parseInt(a(d).css("paddingLeft"),10)||0),(parseInt(a(d).css("borderTopWidth"),10)||0)+(parseInt(a(d).css("paddingTop"),10)||0),(f?Math.max(d.scrollWidth,d.offsetWidth):d.offsetWidth)-(parseInt(a(d).css("borderLeftWidth"),10)||0)-(parseInt(a(d).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(f?Math.max(d.scrollHeight,d.offsetHeight):d.offsetHeight)-(parseInt(a(d).css("borderTopWidth"),10)||0)-(parseInt(a(d).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=c}else b.containment.constructor==Array&&(this.containment=b.containment)},_convertPositionTo:function(b,c){c||(c=this.position);var d=b=="absolute"?1:-1,e=this.options,f=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(f[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:f.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())*d)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(d[0].tagName),f=b.pageX,g=b.pageY;if(this.originalPosition){var h;if(this.containment){if(this.relative_container){var i=this.relative_container.offset();h=[this.containment[0]+i.left,this.containment[1]+i.top,this.containment[2]+i.left,this.containment[3]+i.top]}else h=this.containment;b.pageX-this.offset.click.left<h[0]&&(f=h[0]+this.offset.click.left),b.pageY-this.offset.click.top<h[1]&&(g=h[1]+this.offset.click.top),b.pageX-this.offset.click.left>h[2]&&(f=h[2]+this.offset.click.left),b.pageY-this.offset.click.top>h[3]&&(g=h[3]+this.offset.click.top)}if(c.grid){var j=c.grid[1]?this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1]:this.originalPageY;g=h?j-this.offset.click.top<h[1]||j-this.offset.click.top>h[3]?j-this.offset.click.top<h[1]?j+c.grid[1]:j-c.grid[1]:j:j;var k=c.grid[0]?this.originalPageX+Math.round((f-this.originalPageX)/c.grid[0])*c.grid[0]:this.originalPageX;f=h?k-this.offset.click.left<h[0]||k-this.offset.click.left>h[2]?k-this.offset.click.left<h[0]?k+c.grid[0]:k-c.grid[0]:k:k}}return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:d.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:d.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(b,c,d){d=d||this._uiHash(),a.ui.plugin.call(this,b,[c,d]),b=="drag"&&(this.positionAbs=this._convertPositionTo("absolute"));return a.Widget.prototype._trigger.call(this,b,c,d)},plugins:{},_uiHash:function(a){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),a.extend(a.ui.draggable,{version:"1.8.17"}),a.ui.plugin.add("draggable","connectToSortable",{start:function(b,c){var d=a(this).data("draggable"),e=d.options,f=a.extend({},c,{item:d.element});d.sortables=[],a(e.connectToSortable).each(function(){var c=a.data(this,"sortable");c&&!c.options.disabled&&(d.sortables.push({instance:c,shouldRevert:c.options.revert}),c.refreshPositions(),c._trigger("activate",b,f))})},stop:function(b,c){var d=a(this).data("draggable"),e=a.extend({},c,{item:d.element});a.each(d.sortables,function(){this.instance.isOver?(this.instance.isOver=0,d.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=!0),this.instance._mouseStop(b),this.instance.options.helper=this.instance.options._helper,d.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",b,e))})},drag:function(b,c){var d=a(this).data("draggable"),e=this,f=function(b){var c=this.offset.click.top,d=this.offset.click.left,e=this.positionAbs.top,f=this.positionAbs.left,g=b.height,h=b.width,i=b.top,j=b.left;return a.ui.isOver(e+c,f+d,i,j,g,h)};a.each(d.sortables,function(f){this.instance.positionAbs=d.positionAbs,this.instance.helperProportions=d.helperProportions,this.instance.offset.click=d.offset.click,this.instance._intersectsWith(this.instance.containerCache)?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=a(e).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return c.helper[0]},b.target=this.instance.currentItem[0],this.instance._mouseCapture(b,!0),this.instance._mouseStart(b,!0,!0),this.instance.offset.click.top=d.offset.click.top,this.instance.offset.click.left=d.offset.click.left,this.instance.offset.parent.left-=d.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=d.offset.parent.top-this.instance.offset.parent.top,d._trigger("toSortable",b),d.dropped=this.instance.element,d.currentItem=d.element,this.instance.fromOutside=d),this.instance.currentItem&&this.instance._mouseDrag(b)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",b,this.instance._uiHash(this.instance)),this.instance._mouseStop(b,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),d._trigger("fromSortable",b),d.dropped=!1)})}}),a.ui.plugin.add("draggable","cursor",{start:function(b,c){var d=a("body"),e=a(this).data("draggable").options;d.css("cursor")&&(e._cursor=d.css("cursor")),d.css("cursor",e.cursor)},stop:function(b,c){var d=a(this).data("draggable").options;d._cursor&&a("body").css("cursor",d._cursor)}}),a.ui.plugin.add("draggable","opacity",{start:function(b,c){var d=a(c.helper),e=a(this).data("draggable").options;d.css("opacity")&&(e._opacity=d.css("opacity")),d.css("opacity",e.opacity)},stop:function(b,c){var d=a(this).data("draggable").options;d._opacity&&a(c.helper).css("opacity",d._opacity)}}),a.ui.plugin.add("draggable","scroll",{start:function(b,c){var d=a(this).data("draggable");d.scrollParent[0]!=document&&d.scrollParent[0].tagName!="HTML"&&(d.overflowOffset=d.scrollParent.offset())},drag:function(b,c){var d=a(this).data("draggable"),e=d.options,f=!1;if(d.scrollParent[0]!=document&&d.scrollParent[0].tagName!="HTML"){if(!e.axis||e.axis!="x")d.overflowOffset.top+d.scrollParent[0].offsetHeight-b.pageY<e.scrollSensitivity?d.scrollParent[0].scrollTop=f=d.scrollParent[0].scrollTop+e.scrollSpeed:b.pageY-d.overflowOffset.top<e.scrollSensitivity&&(d.scrollParent[0].scrollTop=f=d.scrollParent[0].scrollTop-e.scrollSpeed);if(!e.axis||e.axis!="y")d.overflowOffset.left+d.scrollParent[0].offsetWidth-b.pageX<e.scrollSensitivity?d.scrollParent[0].scrollLeft=f=d.scrollParent[0].scrollLeft+e.scrollSpeed:b.pageX-d.overflowOffset.left<e.scrollSensitivity&&(d.scrollParent[0].scrollLeft=f=d.scrollParent[0].scrollLeft-e.scrollSpeed)}else{if(!e.axis||e.axis!="x")b.pageY-a(document).scrollTop()<e.scrollSensitivity?f=a(document).scrollTop(a(document).scrollTop()-e.scrollSpeed):a(window).height()-(b.pageY-a(document).scrollTop())<e.scrollSensitivity&&(f=a(document).scrollTop(a(document).scrollTop()+e.scrollSpeed));if(!e.axis||e.axis!="y")b.pageX-a(document).scrollLeft()<e.scrollSensitivity?f=a(document).scrollLeft(a(document).scrollLeft()-e.scrollSpeed):a(window).width()-(b.pageX-a(document).scrollLeft())<e.scrollSensitivity&&(f=a(document).scrollLeft(a(document).scrollLeft()+e.scrollSpeed))}f!==!1&&a.ui.ddmanager&&!e.dropBehaviour&&a.ui.ddmanager.prepareOffsets(d,b)}}),a.ui.plugin.add("draggable","snap",{start:function(b,c){var d=a(this).data("draggable"),e=d.options;d.snapElements=[],a(e.snap.constructor!=String?e.snap.items||":data(draggable)":e.snap).each(function(){var b=a(this),c=b.offset();this!=d.element[0]&&d.snapElements.push({item:this,width:b.outerWidth(),height:b.outerHeight(),top:c.top,left:c.left})})},drag:function(b,c){var d=a(this).data("draggable"),e=d.options,f=e.snapTolerance,g=c.offset.left,h=g+d.helperProportions.width,i=c.offset.top,j=i+d.helperProportions.height;for(var k=d.snapElements.length-1;k>=0;k--){var l=d.snapElements[k].left,m=l+d.snapElements[k].width,n=d.snapElements[k].top,o=n+d.snapElements[k].height;if(!(l-f<g&&g<m+f&&n-f<i&&i<o+f||l-f<g&&g<m+f&&n-f<j&&j<o+f||l-f<h&&h<m+f&&n-f<i&&i<o+f||l-f<h&&h<m+f&&n-f<j&&j<o+f)){d.snapElements[k].snapping&&d.options.snap.release&&d.options.snap.release.call(d.element,b,a.extend(d._uiHash(),{snapItem:d.snapElements[k].item})),d.snapElements[k].snapping=!1;continue}if(e.snapMode!="inner"){var p=Math.abs(n-j)<=f,q=Math.abs(o-i)<=f,r=Math.abs(l-h)<=f,s=Math.abs(m-g)<=f;p&&(c.position.top=d._convertPositionTo("relative",{top:n-d.helperProportions.height,left:0}).top-d.margins.top),q&&(c.position.top=d._convertPositionTo("relative",{top:o,left:0}).top-d.margins.top),r&&(c.position.left=d._convertPositionTo("relative",{top:0,left:l-d.helperProportions.width}).left-d.margins.left),s&&(c.position.left=d._convertPositionTo("relative",{top:0,left:m}).left-d.margins.left)}var t=p||q||r||s;if(e.snapMode!="outer"){var p=Math.abs(n-i)<=f,q=Math.abs(o-j)<=f,r=Math.abs(l-g)<=f,s=Math.abs(m-h)<=f;p&&(c.position.top=d._convertPositionTo("relative",{top:n,left:0}).top-d.margins.top),q&&(c.position.top=d._convertPositionTo("relative",{top:o-d.helperProportions.height,left:0}).top-d.margins.top),r&&(c.position.left=d._convertPositionTo("relative",{top:0,left:l}).left-d.margins.left),s&&(c.position.left=d._convertPositionTo("relative",{top:0,left:m-d.helperProportions.width}).left-d.margins.left)}!d.snapElements[k].snapping&&(p||q||r||s||t)&&d.options.snap.snap&&d.options.snap.snap.call(d.element,b,a.extend(d._uiHash(),{snapItem:d.snapElements[k].item})),d.snapElements[k].snapping=p||q||r||s||t}}}),a.ui.plugin.add("draggable","stack",{start:function(b,c){var d=a(this).data("draggable").options,e=a.makeArray(a(d.stack)).sort(function(b,c){return(parseInt(a(b).css("zIndex"),10)||0)-(parseInt(a(c).css("zIndex"),10)||0)});if(!!e.length){var f=parseInt(e[0].style.zIndex)||0;a(e).each(function(a){this.style.zIndex=f+a}),this[0].style.zIndex=f+e.length}}}),a.ui.plugin.add("draggable","zIndex",{start:function(b,c){var d=a(c.helper),e=a(this).data("draggable").options;d.css("zIndex")&&(e._zIndex=d.css("zIndex")),d.css("zIndex",e.zIndex)},stop:function(b,c){var d=a(this).data("draggable").options;d._zIndex&&a(c.helper).css("zIndex",d._zIndex)}})})(jQuery);/* - * jQuery UI Droppable 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/Droppables - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - * jquery.ui.mouse.js - * jquery.ui.draggable.js - */(function(a,b){a.widget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect"},_create:function(){var b=this.options,c=b.accept;this.isover=0,this.isout=1,this.accept=a.isFunction(c)?c:function(a){return a.is(c)},this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight},a.ui.ddmanager.droppables[b.scope]=a.ui.ddmanager.droppables[b.scope]||[],a.ui.ddmanager.droppables[b.scope].push(this),b.addClasses&&this.element.addClass("ui-droppable")},destroy:function(){var b=a.ui.ddmanager.droppables[this.options.scope];for(var c=0;c<b.length;c++)b[c]==this&&b.splice(c,1);this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable");return this},_setOption:function(b,c){b=="accept"&&(this.accept=a.isFunction(c)?c:function(a){return a.is(c)}),a.Widget.prototype._setOption.apply(this,arguments)},_activate:function(b){var c=a.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),c&&this._trigger("activate",b,this.ui(c))},_deactivate:function(b){var c=a.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),c&&this._trigger("deactivate",b,this.ui(c))},_over:function(b){var c=a.ui.ddmanager.current;!!c&&(c.currentItem||c.element)[0]!=this.element[0]&&this.accept.call(this.element[0],c.currentItem||c.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",b,this.ui(c)))},_out:function(b){var c=a.ui.ddmanager.current;!!c&&(c.currentItem||c.element)[0]!=this.element[0]&&this.accept.call(this.element[0],c.currentItem||c.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",b,this.ui(c)))},_drop:function(b,c){var d=c||a.ui.ddmanager.current;if(!d||(d.currentItem||d.element)[0]==this.element[0])return!1;var e=!1;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var b=a.data(this,"droppable");if(b.options.greedy&&!b.options.disabled&&b.options.scope==d.options.scope&&b.accept.call(b.element[0],d.currentItem||d.element)&&a.ui.intersect(d,a.extend(b,{offset:b.element.offset()}),b.options.tolerance)){e=!0;return!1}});if(e)return!1;if(this.accept.call(this.element[0],d.currentItem||d.element)){this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",b,this.ui(d));return this.element}return!1},ui:function(a){return{draggable:a.currentItem||a.element,helper:a.helper,position:a.position,offset:a.positionAbs}}}),a.extend(a.ui.droppable,{version:"1.8.17"}),a.ui.intersect=function(b,c,d){if(!c.offset)return!1;var e=(b.positionAbs||b.position.absolute).left,f=e+b.helperProportions.width,g=(b.positionAbs||b.position.absolute).top,h=g+b.helperProportions.height,i=c.offset.left,j=i+c.proportions.width,k=c.offset.top,l=k+c.proportions.height;switch(d){case"fit":return i<=e&&f<=j&&k<=g&&h<=l;case"intersect":return i<e+b.helperProportions.width/2&&f-b.helperProportions.width/2<j&&k<g+b.helperProportions.height/2&&h-b.helperProportions.height/2<l;case"pointer":var m=(b.positionAbs||b.position.absolute).left+(b.clickOffset||b.offset.click).left,n=(b.positionAbs||b.position.absolute).top+(b.clickOffset||b.offset.click).top,o=a.ui.isOver(n,m,k,i,c.proportions.height,c.proportions.width);return o;case"touch":return(g>=k&&g<=l||h>=k&&h<=l||g<k&&h>l)&&(e>=i&&e<=j||f>=i&&f<=j||e<i&&f>j);default:return!1}},a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(b,c){var d=a.ui.ddmanager.droppables[b.options.scope]||[],e=c?c.type:null,f=(b.currentItem||b.element).find(":data(droppable)").andSelf();droppablesLoop:for(var g=0;g<d.length;g++){if(d[g].options.disabled||b&&!d[g].accept.call(d[g].element[0],b.currentItem||b.element))continue;for(var h=0;h<f.length;h++)if(f[h]==d[g].element[0]){d[g].proportions.height=0;continue droppablesLoop}d[g].visible=d[g].element.css("display")!="none";if(!d[g].visible)continue;e=="mousedown"&&d[g]._activate.call(d[g],c),d[g].offset=d[g].element.offset(),d[g].proportions={width:d[g].element[0].offsetWidth,height:d[g].element[0].offsetHeight}}},drop:function(b,c){var d=!1;a.each(a.ui.ddmanager.droppables[b.options.scope]||[],function(){!this.options||(!this.options.disabled&&this.visible&&a.ui.intersect(b,this,this.options.tolerance)&&(d=this._drop.call(this,c)||d),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],b.currentItem||b.element)&&(this.isout=1,this.isover=0,this._deactivate.call(this,c)))});return d},dragStart:function(b,c){b.element.parents(":not(body,html)").bind("scroll.droppable",function(){b.options.refreshPositions||a.ui.ddmanager.prepareOffsets(b,c)})},drag:function(b,c){b.options.refreshPositions&&a.ui.ddmanager.prepareOffsets(b,c),a.each(a.ui.ddmanager.droppables[b.options.scope]||[],function(){if(!(this.options.disabled||this.greedyChild||!this.visible)){var d=a.ui.intersect(b,this,this.options.tolerance),e=!d&&this.isover==1?"isout":d&&this.isover==0?"isover":null;if(!e)return;var f;if(this.options.greedy){var g=this.element.parents(":data(droppable):eq(0)");g.length&&(f=a.data(g[0],"droppable"),f.greedyChild=e=="isover"?1:0)}f&&e=="isover"&&(f.isover=0,f.isout=1,f._out.call(f,c)),this[e]=1,this[e=="isout"?"isover":"isout"]=0,this[e=="isover"?"_over":"_out"].call(this,c),f&&e=="isout"&&(f.isout=0,f.isover=1,f._over.call(f,c))}})},dragStop:function(b,c){b.element.parents(":not(body,html)").unbind("scroll.droppable"),b.options.refreshPositions||a.ui.ddmanager.prepareOffsets(b,c)}}})(jQuery);/* - * 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/Resizables - * - * Depends: - * jquery.ui.core.js - * jquery.ui.mouse.js - * jquery.ui.widget.js - */(function(a,b){a.widget("ui.resizable",a.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1e3},_create:function(){var b=this,c=this.options;this.element.addClass("ui-resizable"),a.extend(this,{_aspectRatio:!!c.aspectRatio,aspectRatio:c.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:c.helper||c.ghost||c.animate?c.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(/relative/.test(this.element.css("position"))&&a.browser.opera&&this.element.css({position:"relative",top:"auto",left:"auto"}),this.element.wrap(a('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("resizable",this.element.data("resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=c.handles||(a(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se");if(this.handles.constructor==String){this.handles=="all"&&(this.handles="n,e,s,w,se,sw,ne,nw");var d=this.handles.split(",");this.handles={};for(var e=0;e<d.length;e++){var f=a.trim(d[e]),g="ui-resizable-"+f,h=a('<div class="ui-resizable-handle '+g+'"></div>');/sw|se|ne|nw/.test(f)&&h.css({zIndex:++c.zIndex}),"se"==f&&h.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[f]=".ui-resizable-"+f,this.element.append(h)}}this._renderAxis=function(b){b=b||this.element;for(var c in this.handles){this.handles[c].constructor==String&&(this.handles[c]=a(this.handles[c],this.element).show());if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var d=a(this.handles[c],this.element),e=0;e=/sw|ne|nw|se|n|s/.test(c)?d.outerHeight():d.outerWidth();var f=["padding",/ne|nw|n/.test(c)?"Top":/se|sw|s/.test(c)?"Bottom":/^e$/.test(c)?"Right":"Left"].join("");b.css(f,e),this._proportionallyResize()}if(!a(this.handles[c]).length)continue}},this._renderAxis(this.element),this._handles=a(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){if(!b.resizing){if(this.className)var a=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=a&&a[1]?a[1]:"se"}}),c.autoHide&&(this._handles.hide(),a(this.element).addClass("ui-resizable-autohide").hover(function(){c.disabled||(a(this).removeClass("ui-resizable-autohide"),b._handles.show())},function(){c.disabled||b.resizing||(a(this).addClass("ui-resizable-autohide"),b._handles.hide())})),this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(b){a(b).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){b(this.element);var c=this.element;c.after(this.originalElement.css({position:c.css("position"),width:c.outerWidth(),height:c.outerHeight(),top:c.css("top"),left:c.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle),b(this.originalElement);return this},_mouseCapture:function(b){var c=!1;for(var d in this.handles)a(this.handles[d])[0]==b.target&&(c=!0);return!this.options.disabled&&c},_mouseStart:function(b){var d=this.options,e=this.element.position(),f=this.element;this.resizing=!0,this.documentScroll={top:a(document).scrollTop(),left:a(document).scrollLeft()},(f.is(".ui-draggable")||/absolute/.test(f.css("position")))&&f.css({position:"absolute",top:e.top,left:e.left}),a.browser.opera&&/relative/.test(f.css("position"))&&f.css({position:"relative",top:"auto",left:"auto"}),this._renderProxy();var g=c(this.helper.css("left")),h=c(this.helper.css("top"));d.containment&&(g+=a(d.containment).scrollLeft()||0,h+=a(d.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:g,top:h},this.size=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()},this.originalSize=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()},this.originalPosition={left:g,top:h},this.sizeDiff={width:f.outerWidth()-f.width(),height:f.outerHeight()-f.height()},this.originalMousePosition={left:b.pageX,top:b.pageY},this.aspectRatio=typeof d.aspectRatio=="number"?d.aspectRatio:this.originalSize.width/this.originalSize.height||1;var i=a(".ui-resizable-"+this.axis).css("cursor");a("body").css("cursor",i=="auto"?this.axis+"-resize":i),f.addClass("ui-resizable-resizing"),this._propagate("start",b);return!0},_mouseDrag:function(b){var c=this.helper,d=this.options,e={},f=this,g=this.originalMousePosition,h=this.axis,i=b.pageX-g.left||0,j=b.pageY-g.top||0,k=this._change[h];if(!k)return!1;var l=k.apply(this,[b,i,j]),m=a.browser.msie&&a.browser.version<7,n=this.sizeDiff;this._updateVirtualBoundaries(b.shiftKey);if(this._aspectRatio||b.shiftKey)l=this._updateRatio(l,b);l=this._respectSize(l,b),this._propagate("resize",b),c.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"}),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),this._updateCache(l),this._trigger("resize",b,this.ui());return!1},_mouseStop:function(b){this.resizing=!1;var c=this.options,d=this;if(this._helper){var e=this._proportionallyResizeElements,f=e.length&&/textarea/i.test(e[0].nodeName),g=f&&a.ui.hasScroll(e[0],"left")?0:d.sizeDiff.height,h=f?0:d.sizeDiff.width,i={width:d.helper.width()-h,height:d.helper.height()-g},j=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,k=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;c.animate||this.element.css(a.extend(i,{top:k,left:j})),d.helper.height(d.size.height),d.helper.width(d.size.width),this._helper&&!c.animate&&this._proportionallyResize()}a("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",b),this._helper&&this.helper.remove();return!1},_updateVirtualBoundaries:function(a){var b=this.options,c,e,f,g,h;h={minWidth:d(b.minWidth)?b.minWidth:0,maxWidth:d(b.maxWidth)?b.maxWidth:Infinity,minHeight:d(b.minHeight)?b.minHeight:0,maxHeight:d(b.maxHeight)?b.maxHeight:Infinity};if(this._aspectRatio||a)c=h.minHeight*this.aspectRatio,f=h.minWidth/this.aspectRatio,e=h.maxHeight*this.aspectRatio,g=h.maxWidth/this.aspectRatio,c>h.minWidth&&(h.minWidth=c),f>h.minHeight&&(h.minHeight=f),e<h.maxWidth&&(h.maxWidth=e),g<h.maxHeight&&(h.maxHeight=g);this._vBoundaries=h},_updateCache:function(a){var b=this.options;this.offset=this.helper.offset(),d(a.left)&&(this.position.left=a.left),d(a.top)&&(this.position.top=a.top),d(a.height)&&(this.size.height=a.height),d(a.width)&&(this.size.width=a.width)},_updateRatio:function(a,b){var c=this.options,e=this.position,f=this.size,g=this.axis;d(a.height)?a.width=a.height*this.aspectRatio:d(a.width)&&(a.height=a.width/this.aspectRatio),g=="sw"&&(a.left=e.left+(f.width-a.width),a.top=null),g=="nw"&&(a.top=e.top+(f.height-a.height),a.left=e.left+(f.width-a.width));return a},_respectSize:function(a,b){var c=this.helper,e=this._vBoundaries,f=this._aspectRatio||b.shiftKey,g=this.axis,h=d(a.width)&&e.maxWidth&&e.maxWidth<a.width,i=d(a.height)&&e.maxHeight&&e.maxHeight<a.height,j=d(a.width)&&e.minWidth&&e.minWidth>a.width,k=d(a.height)&&e.minHeight&&e.minHeight>a.height;j&&(a.width=e.minWidth),k&&(a.height=e.minHeight),h&&(a.width=e.maxWidth),i&&(a.height=e.maxHeight);var l=this.originalPosition.left+this.originalSize.width,m=this.position.top+this.size.height,n=/sw|nw|w/.test(g),o=/nw|ne|n/.test(g);j&&n&&(a.left=l-e.minWidth),h&&n&&(a.left=l-e.maxWidth),k&&o&&(a.top=m-e.minHeight),i&&o&&(a.top=m-e.maxHeight);var p=!a.width&&!a.height;p&&!a.left&&a.top?a.top=null:p&&!a.top&&a.left&&(a.left=null);return a},_proportionallyResize:function(){var b=this.options;if(!!this._proportionallyResizeElements.length){var c=this.helper||this.element;for(var d=0;d<this._proportionallyResizeElements.length;d++){var e=this._proportionallyResizeElements[d];if(!this.borderDif){var f=[e.css("borderTopWidth"),e.css("borderRightWidth"),e.css("borderBottomWidth"),e.css("borderLeftWidth")],g=[e.css("paddingTop"),e.css("paddingRight"),e.css("paddingBottom"),e.css("paddingLeft")];this.borderDif=a.map(f,function(a,b){var c=parseInt(a,10)||0,d=parseInt(g[b],10)||0;return c+d})}if(a.browser.msie&&(!!a(c).is(":hidden")||!!a(c).parents(":hidden").length))continue;e.css({height:c.height()-this.borderDif[0]-this.borderDif[2]||0,width:c.width()-this.borderDif[1]-this.borderDif[3]||0})}}},_renderProxy:function(){var b=this.element,c=this.options;this.elementOffset=b.offset();if(this._helper){this.helper=this.helper||a('<div style="overflow:hidden;"></div>');var d=a.browser.msie&&a.browser.version<7,e=d?1:0,f=d?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+f,height:this.element.outerHeight()+f,position:"absolute",left:this.elementOffset.left-e+"px",top:this.elementOffset.top-e+"px",zIndex:++c.zIndex}),this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(a,b,c){return{width:this.originalSize.width+b}},w:function(a,b,c){var d=this.options,e=this.originalSize,f=this.originalPosition;return{left:f.left+b,width:e.width-b}},n:function(a,b,c){var d=this.options,e=this.originalSize,f=this.originalPosition;return{top:f.top+c,height:e.height-c}},s:function(a,b,c){return{height:this.originalSize.height+c}},se:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},sw:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,c,d]))},ne:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},nw:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,c,d]))}},_propagate:function(b,c){a.ui.plugin.call(this,b,[c,this.ui()]),b!="resize"&&this._trigger(b,c,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),a.extend(a.ui.resizable,{version:"1.8.17"}),a.ui.plugin.add("resizable","alsoResize",{start:function(b,c){var d=a(this).data("resizable"),e=d.options,f=function(b){a(b).each(function(){var b=a(this);b.data("resizable-alsoresize",{width:parseInt(b.width(),10),height:parseInt(b.height(),10),left:parseInt(b.css("left"),10),top:parseInt(b.css("top"),10),position:b.css("position")})})};typeof e.alsoResize=="object"&&!e.alsoResize.parentNode?e.alsoResize.length?(e.alsoResize=e.alsoResize[0],f(e.alsoResize)):a.each(e.alsoResize,function(a){f(a)}):f(e.alsoResize)},resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.originalSize,g=d.originalPosition,h={height:d.size.height-f.height||0,width:d.size.width-f.width||0,top:d.position.top-g.top||0,left:d.position.left-g.left||0},i=function(b,e){a(b).each(function(){var b=a(this),f=a(this).data("resizable-alsoresize"),g={},i=e&&e.length?e:b.parents(c.originalElement[0]).length?["width","height"]:["width","height","top","left"];a.each(i,function(a,b){var c=(f[b]||0)+(h[b]||0);c&&c>=0&&(g[b]=c||null)}),a.browser.opera&&/relative/.test(b.css("position"))&&(d._revertToRelativePosition=!0,b.css({position:"absolute",top:"auto",left:"auto"})),b.css(g)})};typeof e.alsoResize=="object"&&!e.alsoResize.nodeType?a.each(e.alsoResize,function(a,b){i(a,b)}):i(e.alsoResize)},stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=function(b){a(b).each(function(){var b=a(this);b.css({position:b.data("resizable-alsoresize").position})})};d._revertToRelativePosition&&(d._revertToRelativePosition=!1,typeof e.alsoResize=="object"&&!e.alsoResize.nodeType?a.each(e.alsoResize,function(a){f(a)}):f(e.alsoResize)),a(this).removeData("resizable-alsoresize")}}),a.ui.plugin.add("resizable","animate",{stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d._proportionallyResizeElements,g=f.length&&/textarea/i.test(f[0].nodeName),h=g&&a.ui.hasScroll(f[0],"left")?0:d.sizeDiff.height,i=g?0:d.sizeDiff.width,j={width:d.size.width-i,height:d.size.height-h},k=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,l=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;d.element.animate(a.extend(j,l&&k?{top:l,left:k}:{}),{duration:e.animateDuration,easing:e.animateEasing,step:function(){var c={width:parseInt(d.element.css("width"),10),height:parseInt(d.element.css("height"),10),top:parseInt(d.element.css("top"),10),left:parseInt(d.element.css("left"),10)};f&&f.length&&a(f[0]).css({width:c.width,height:c.height}),d._updateCache(c),d._propagate("resize",b)}})}}),a.ui.plugin.add("resizable","containment",{start:function(b,d){var e=a(this).data("resizable"),f=e.options,g=e.element,h=f.containment,i=h instanceof a?h.get(0):/parent/.test(h)?g.parent().get(0):h;if(!!i){e.containerElement=a(i);if(/document/.test(h)||h==document)e.containerOffset={left:0,top:0},e.containerPosition={left:0,top:0},e.parentData={element:a(document),left:0,top:0,width:a(document).width(),height:a(document).height()||document.body.parentNode.scrollHeight};else{var j=a(i),k=[];a(["Top","Right","Left","Bottom"]).each(function(a,b){k[a]=c(j.css("padding"+b))}),e.containerOffset=j.offset(),e.containerPosition=j.position(),e.containerSize={height:j.innerHeight()-k[3],width:j.innerWidth()-k[1]};var l=e.containerOffset,m=e.containerSize.height,n=e.containerSize.width,o=a.ui.hasScroll(i,"left")?i.scrollWidth:n,p=a.ui.hasScroll(i)?i.scrollHeight:m;e.parentData={element:i,left:l.left,top:l.top,width:o,height:p}}}},resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.containerSize,g=d.containerOffset,h=d.size,i=d.position,j=d._aspectRatio||b.shiftKey,k={top:0,left:0},l=d.containerElement;l[0]!=document&&/static/.test(l.css("position"))&&(k=g),i.left<(d._helper?g.left:0)&&(d.size.width=d.size.width+(d._helper?d.position.left-g.left:d.position.left-k.left),j&&(d.size.height=d.size.width/e.aspectRatio),d.position.left=e.helper?g.left:0),i.top<(d._helper?g.top:0)&&(d.size.height=d.size.height+(d._helper?d.position.top-g.top:d.position.top),j&&(d.size.width=d.size.height*e.aspectRatio),d.position.top=d._helper?g.top:0),d.offset.left=d.parentData.left+d.position.left,d.offset.top=d.parentData.top+d.position.top;var m=Math.abs((d._helper?d.offset.left-k.left:d.offset.left-k.left)+d.sizeDiff.width),n=Math.abs((d._helper?d.offset.top-k.top:d.offset.top-g.top)+d.sizeDiff.height),o=d.containerElement.get(0)==d.element.parent().get(0),p=/relative|absolute/.test(d.containerElement.css("position"));o&&p&&(m-=d.parentData.left),m+d.size.width>=d.parentData.width&&(d.size.width=d.parentData.width-m,j&&(d.size.height=d.size.width/d.aspectRatio)),n+d.size.height>=d.parentData.height&&(d.size.height=d.parentData.height-n,j&&(d.size.width=d.size.height*d.aspectRatio))},stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.position,g=d.containerOffset,h=d.containerPosition,i=d.containerElement,j=a(d.helper),k=j.offset(),l=j.outerWidth()-d.sizeDiff.width,m=j.outerHeight()-d.sizeDiff.height;d._helper&&!e.animate&&/relative/.test(i.css("position"))&&a(this).css({left:k.left-h.left-g.left,width:l,height:m}),d._helper&&!e.animate&&/static/.test(i.css("position"))&&a(this).css({left:k.left-h.left-g.left,width:l,height:m})}}),a.ui.plugin.add("resizable","ghost",{start:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.size;d.ghost=d.originalElement.clone(),d.ghost.css({opacity:.25,display:"block",position:"relative",height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof e.ghost=="string"?e.ghost:""),d.ghost.appendTo(d.helper)},resize:function(b,c){var d=a(this).data("resizable"),e=d.options;d.ghost&&d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})},stop:function(b,c){var d=a(this).data("resizable"),e=d.options;d.ghost&&d.helper&&d.helper.get(0).removeChild(d.ghost.get(0))}}),a.ui.plugin.add("resizable","grid",{resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.size,g=d.originalSize,h=d.originalPosition,i=d.axis,j=e._aspectRatio||b.shiftKey;e.grid=typeof e.grid=="number"?[e.grid,e.grid]:e.grid;var k=Math.round((f.width-g.width)/(e.grid[0]||1))*(e.grid[0]||1),l=Math.round((f.height-g.height)/(e.grid[1]||1))*(e.grid[1]||1);/^(se|s|e)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l):/^(ne)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l,d.position.top=h.top-l):/^(sw)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l,d.position.left=h.left-k):(d.size.width=g.width+k,d.size.height=g.height+l,d.position.top=h.top-l,d.position.left=h.left-k)}});var c=function(a){return parseInt(a,10)||0},d=function(a){return!isNaN(parseInt(a,10))}})(jQuery);/* - * 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/Selectables - * - * Depends: - * jquery.ui.core.js - * jquery.ui.mouse.js - * jquery.ui.widget.js - */(function(a,b){a.widget("ui.selectable",a.ui.mouse,{options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch"},_create:function(){var b=this;this.element.addClass("ui-selectable"),this.dragged=!1;var c;this.refresh=function(){c=a(b.options.filter,b.element[0]),c.addClass("ui-selectee"),c.each(function(){var b=a(this),c=b.offset();a.data(this,"selectable-item",{element:this,$element:b,left:c.left,top:c.top,right:c.left+b.outerWidth(),bottom:c.top+b.outerHeight(),startselected:!1,selected:b.hasClass("ui-selected"),selecting:b.hasClass("ui-selecting"),unselecting:b.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=c.addClass("ui-selectee"),this._mouseInit(),this.helper=a("<div class='ui-selectable-helper'></div>")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable"),this._mouseDestroy();return this},_mouseStart:function(b){var c=this;this.opos=[b.pageX,b.pageY];if(!this.options.disabled){var d=this.options;this.selectees=a(d.filter,this.element[0]),this._trigger("start",b),a(d.appendTo).append(this.helper),this.helper.css({left:b.clientX,top:b.clientY,width:0,height:0}),d.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var d=a.data(this,"selectable-item");d.startselected=!0,!b.metaKey&&!b.ctrlKey&&(d.$element.removeClass("ui-selected"),d.selected=!1,d.$element.addClass("ui-unselecting"),d.unselecting=!0,c._trigger("unselecting",b,{unselecting:d.element}))}),a(b.target).parents().andSelf().each(function(){var d=a.data(this,"selectable-item");if(d){var e=!b.metaKey&&!b.ctrlKey||!d.$element.hasClass("ui-selected");d.$element.removeClass(e?"ui-unselecting":"ui-selected").addClass(e?"ui-selecting":"ui-unselecting"),d.unselecting=!e,d.selecting=e,d.selected=e,e?c._trigger("selecting",b,{selecting:d.element}):c._trigger("unselecting",b,{unselecting:d.element});return!1}})}},_mouseDrag:function(b){var c=this;this.dragged=!0;if(!this.options.disabled){var d=this.options,e=this.opos[0],f=this.opos[1],g=b.pageX,h=b.pageY;if(e>g){var i=g;g=e,e=i}if(f>h){var i=h;h=f,f=i}this.helper.css({left:e,top:f,width:g-e,height:h-f}),this.selectees.each(function(){var i=a.data(this,"selectable-item");if(!!i&&i.element!=c.element[0]){var j=!1;d.tolerance=="touch"?j=!(i.left>g||i.right<e||i.top>h||i.bottom<f):d.tolerance=="fit"&&(j=i.left>e&&i.right<g&&i.top>f&&i.bottom<h),j?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,c._trigger("selecting",b,{selecting:i.element}))):(i.selecting&&((b.metaKey||b.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),c._trigger("unselecting",b,{unselecting:i.element}))),i.selected&&!b.metaKey&&!b.ctrlKey&&!i.startselected&&(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,c._trigger("unselecting",b,{unselecting:i.element})))}});return!1}},_mouseStop:function(b){var c=this;this.dragged=!1;var d=this.options;a(".ui-unselecting",this.element[0]).each(function(){var d=a.data(this,"selectable-item");d.$element.removeClass("ui-unselecting"),d.unselecting=!1,d.startselected=!1,c._trigger("unselected",b,{unselected:d.element})}),a(".ui-selecting",this.element[0]).each(function(){var d=a.data(this,"selectable-item");d.$element.removeClass("ui-selecting").addClass("ui-selected"),d.selecting=!1,d.selected=!0,d.startselected=!0,c._trigger("selected",b,{selected:d.element})}),this._trigger("stop",b),this.helper.remove();return!1}}),a.extend(a.ui.selectable,{version:"1.8.17"})})(jQuery);/* - * jQuery UI Sortable 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/Sortables - * - * Depends: - * jquery.ui.core.js - * jquery.ui.mouse.js - * jquery.ui.widget.js - */(function(a,b){a.widget("ui.sortable",a.ui.mouse,{widgetEventPrefix:"sort",options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3},_create:function(){var a=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?a.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):!1,this.offset=this.element.offset(),this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--)this.items[a].item.removeData(this.widgetName+"-item");return this},_setOption:function(b,c){b==="disabled"?(this.options[b]=c,this.widget()[c?"addClass":"removeClass"]("ui-sortable-disabled")):a.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(b,c){var d=this;if(this.reverting)return!1;if(this.options.disabled||this.options.type=="static")return!1;this._refreshItems(b);var e=null,f=this,g=a(b.target).parents().each(function(){if(a.data(this,d.widgetName+"-item")==f){e=a(this);return!1}});a.data(b.target,d.widgetName+"-item")==f&&(e=a(b.target));if(!e)return!1;if(this.options.handle&&!c){var h=!1;a(this.options.handle,e).find("*").andSelf().each(function(){this==b.target&&(h=!0)});if(!h)return!1}this.currentItem=e,this._removeCurrentsFromItems();return!0},_mouseStart:function(b,c,d){var e=this.options,f=this;this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(b),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!=this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),e.containment&&this._setContainment(),e.cursor&&(a("body").css("cursor")&&(this._storedCursor=a("body").css("cursor")),a("body").css("cursor",e.cursor)),e.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",e.opacity)),e.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",e.zIndex)),this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",b,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions();if(!d)for(var g=this.containers.length-1;g>=0;g--)this.containers[g]._trigger("activate",b,f._uiHash(this));a.ui.ddmanager&&(a.ui.ddmanager.current=this),a.ui.ddmanager&&!e.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(b);return!0},_mouseDrag:function(b){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs);if(this.options.scroll){var c=this.options,d=!1;this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-b.pageY<c.scrollSensitivity?this.scrollParent[0].scrollTop=d=this.scrollParent[0].scrollTop+c.scrollSpeed:b.pageY-this.overflowOffset.top<c.scrollSensitivity&&(this.scrollParent[0].scrollTop=d=this.scrollParent[0].scrollTop-c.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-b.pageX<c.scrollSensitivity?this.scrollParent[0].scrollLeft=d=this.scrollParent[0].scrollLeft+c.scrollSpeed:b.pageX-this.overflowOffset.left<c.scrollSensitivity&&(this.scrollParent[0].scrollLeft=d=this.scrollParent[0].scrollLeft-c.scrollSpeed)):(b.pageY-a(document).scrollTop()<c.scrollSensitivity?d=a(document).scrollTop(a(document).scrollTop()-c.scrollSpeed):a(window).height()-(b.pageY-a(document).scrollTop())<c.scrollSensitivity&&(d=a(document).scrollTop(a(document).scrollTop()+c.scrollSpeed)),b.pageX-a(document).scrollLeft()<c.scrollSensitivity?d=a(document).scrollLeft(a(document).scrollLeft()-c.scrollSpeed):a(window).width()-(b.pageX-a(document).scrollLeft())<c.scrollSensitivity&&(d=a(document).scrollLeft(a(document).scrollLeft()+c.scrollSpeed))),d!==!1&&a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b)}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";for(var e=this.items.length-1;e>=0;e--){var f=this.items[e],g=f.item[0],h=this._intersectsWithPointer(f);if(!h)continue;if(g!=this.currentItem[0]&&this.placeholder[h==1?"next":"prev"]()[0]!=g&&!a.ui.contains(this.placeholder[0],g)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],g):!0)){this.direction=h==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(f))this._rearrange(b,f);else break;this._trigger("change",b,this._uiHash());break}}this._contactContainers(b),a.ui.ddmanager&&a.ui.ddmanager.drag(this,b),this._trigger("sort",b,this._uiHash()),this.lastPositionAbs=this.positionAbs;return!1},_mouseStop:function(b,c){if(!!b){a.ui.ddmanager&&!this.options.dropBehaviour&&a.ui.ddmanager.drop(this,b);if(this.options.revert){var d=this,e=d.placeholder.offset();d.reverting=!0,a(this.helper).animate({left:e.left-this.offset.parent.left-d.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:e.top-this.offset.parent.top-d.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){d._clear(b)})}else this._clear(b,c);return!1}},cancel:function(){var b=this;if(this.dragging){this._mouseUp({target:null}),this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("deactivate",null,b._uiHash(this)),this.containers[c].containerCache.over&&(this.containers[c]._trigger("out",null,b._uiHash(this)),this.containers[c].containerCache.over=0)}this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),a.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?a(this.domPosition.prev).after(this.currentItem):a(this.domPosition.parent).prepend(this.currentItem));return this},serialize:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];b=b||{},a(c).each(function(){var c=(a(b.item||this).attr(b.attribute||"id")||"").match(b.expression||/(.+)[-=_](.+)/);c&&d.push((b.key||c[1]+"[]")+"="+(b.key&&b.expression?c[1]:c[2]))}),!d.length&&b.key&&d.push(b.key+"=");return d.join("&")},toArray:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];b=b||{},c.each(function(){d.push(a(b.item||this).attr(b.attribute||"id")||"")});return d},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,d=this.positionAbs.top,e=d+this.helperProportions.height,f=a.left,g=f+a.width,h=a.top,i=h+a.height,j=this.offset.click.top,k=this.offset.click.left,l=d+j>h&&d+j<i&&b+k>f&&b+k<g;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>a[this.floating?"width":"height"]?l:f<b+this.helperProportions.width/2&&c-this.helperProportions.width/2<g&&h<d+this.helperProportions.height/2&&e-this.helperProportions.height/2<i},_intersectsWithPointer:function(b){var c=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,b.top,b.height),d=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,b.left,b.width),e=c&&d,f=this._getDragVerticalDirection(),g=this._getDragHorizontalDirection();if(!e)return!1;return this.floating?g&&g=="right"||f=="down"?2:1:f&&(f=="down"?2:1)},_intersectsWithSides:function(b){var c=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,b.top+b.height/2,b.height),d=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,b.left+b.width/2,b.width),e=this._getDragVerticalDirection(),f=this._getDragHorizontalDirection();return this.floating&&f?f=="right"&&d||f=="left"&&!d:e&&(e=="down"&&c||e=="up"&&!c)},_getDragVerticalDirection:function(){var a=this.positionAbs.top-this.lastPositionAbs.top;return a!=0&&(a>0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a),this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(b){var c=this,d=[],e=[],f=this._connectWith();if(f&&b)for(var g=f.length-1;g>=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&e.push([a.isFunction(j.options.items)?j.options.items.call(j.element):a(j.options.items,j.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),j])}}e.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(var g=e.length-1;g>=0;g--)e[g][0].each(function(){d.push(this)});return a(d)},_removeCurrentsFromItems:function(){var a=this.currentItem.find(":data("+this.widgetName+"-item)");for(var b=0;b<this.items.length;b++)for(var c=0;c<a.length;c++)a[c]==this.items[b].item[0]&&this.items.splice(b,1)},_refreshItems:function(b){this.items=[],this.containers=[this];var c=this.items,d=this,e=[[a.isFunction(this.options.items)?this.options.items.call(this.element[0],b,{item:this.currentItem}):a(this.options.items,this.element),this]],f=this._connectWith();if(f)for(var g=f.length-1;g>=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&(e.push([a.isFunction(j.options.items)?j.options.items.call(j.element[0],b,{item:this.currentItem}):a(j.options.items,j.element),j]),this.containers.push(j))}}for(var g=e.length-1;g>=0;g--){var k=e[g][1],l=e[g][0];for(var i=0,m=l.length;i<m;i++){var n=a(l[i]);n.data(this.widgetName+"-item",k),c.push({item:n,instance:k,width:0,height:0,left:0,top:0})}}},refreshPositions:function(b){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());for(var c=this.items.length-1;c>=0;c--){var d=this.items[c];if(d.instance!=this.currentContainer&&this.currentContainer&&d.item[0]!=this.currentItem[0])continue;var e=this.options.toleranceElement?a(this.options.toleranceElement,d.item):d.item;b||(d.width=e.outerWidth(),d.height=e.outerHeight());var f=e.offset();d.left=f.left,d.top=f.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(var c=this.containers.length-1;c>=0;c--){var f=this.containers[c].element.offset();this.containers[c].containerCache.left=f.left,this.containers[c].containerCache.top=f.top,this.containers[c].containerCache.width=this.containers[c].element.outerWidth(),this.containers[c].containerCache.height=this.containers[c].element.outerHeight()}return this},_createPlaceholder:function(b){var c=b||this,d=c.options;if(!d.placeholder||d.placeholder.constructor==String){var e=d.placeholder;d.placeholder={element:function(){var b=a(document.createElement(c.currentItem[0].nodeName)).addClass(e||c.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];e||(b.style.visibility="hidden");return b},update:function(a,b){if(!e||!!d.forcePlaceholderSize)b.height()||b.height(c.currentItem.innerHeight()-parseInt(c.currentItem.css("paddingTop")||0,10)-parseInt(c.currentItem.css("paddingBottom")||0,10)),b.width()||b.width(c.currentItem.innerWidth()-parseInt(c.currentItem.css("paddingLeft")||0,10)-parseInt(c.currentItem.css("paddingRight")||0,10))}}}c.placeholder=a(d.placeholder.element.call(c.element,c.currentItem)),c.currentItem.after(c.placeholder),d.placeholder.update(c,c.placeholder)},_contactContainers:function(b){var c=null,d=null;for(var e=this.containers.length-1;e>=0;e--){if(a.ui.contains(this.currentItem[0],this.containers[e].element[0]))continue;if(this._intersectsWith(this.containers[e].containerCache)){if(c&&a.ui.contains(this.containers[e].element[0],c.element[0]))continue;c=this.containers[e],d=e}else this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",b,this._uiHash(this)),this.containers[e].containerCache.over=0)}if(!!c)if(this.containers.length===1)this.containers[d]._trigger("over",b,this._uiHash(this)),this.containers[d].containerCache.over=1;else if(this.currentContainer!=this.containers[d]){var f=1e4,g=null,h=this.positionAbs[this.containers[d].floating?"left":"top"];for(var i=this.items.length-1;i>=0;i--){if(!a.ui.contains(this.containers[d].element[0],this.items[i].item[0]))continue;var j=this.items[i][this.containers[d].floating?"left":"top"];Math.abs(j-h)<f&&(f=Math.abs(j-h),g=this.items[i])}if(!g&&!this.options.dropOnEmpty)return;this.currentContainer=this.containers[d],g?this._rearrange(b,g,null,!0):this._rearrange(b,null,this.containers[d].element,!0),this._trigger("change",b,this._uiHash()),this.containers[d]._trigger("change",b,this._uiHash(this)),this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[d]._trigger("over",b,this._uiHash(this)),this.containers[d].containerCache.over=1}},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b,this.currentItem])):c.helper=="clone"?this.currentItem.clone():this.currentItem;d.parents("body").length||a(c.appendTo!="parent"?c.appendTo:this.currentItem[0].parentNode)[0].appendChild(d[0]),d[0]==this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(d[0].style.width==""||c.forceHelperSize)&&d.width(this.currentItem.width()),(d[0].style.height==""||c.forceHelperSize)&&d.height(this.currentItem.height());return d},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.currentItem.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)){var c=a(b.containment)[0],d=a(b.containment).offset(),e=a(c).css("overflow")!="hidden";this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(e?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(e?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(b,c){c||(c=this.position);var d=b=="absolute"?1:-1,e=this.options,f=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(f[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:f.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())*d)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(d[0].tagName);this.cssPosition=="relative"&&(this.scrollParent[0]==document||this.scrollParent[0]==this.offsetParent[0])&&(this.offset.relative=this._getRelativeOffset());var f=b.pageX,g=b.pageY;if(this.originalPosition){this.containment&&(b.pageX-this.offset.click.left<this.containment[0]&&(f=this.containment[0]+this.offset.click.left),b.pageY-this.offset.click.top<this.containment[1]&&(g=this.containment[1]+this.offset.click.top),b.pageX-this.offset.click.left>this.containment[2]&&(f=this.containment[2]+this.offset.click.left),b.pageY-this.offset.click.top>this.containment[3]&&(g=this.containment[3]+this.offset.click.top));if(c.grid){var h=this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1];g=this.containment?h-this.offset.click.top<this.containment[1]||h-this.offset.click.top>this.containment[3]?h-this.offset.click.top<this.containment[1]?h+c.grid[1]:h-c.grid[1]:h:h;var i=this.originalPageX+Math.round((f-this.originalPageX)/c.grid[0])*c.grid[0];f=this.containment?i-this.offset.click.left<this.containment[0]||i-this.offset.click.left>this.containment[2]?i-this.offset.click.left<this.containment[0]?i+c.grid[0]:i-c.grid[0]:i:i}}return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:d.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:d.scrollLeft())}},_rearrange:function(a,b,c,d){c?c[0].appendChild(this.placeholder[0]):b.item[0].parentNode.insertBefore(this.placeholder[0],this.direction=="down"?b.item[0]:b.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var e=this,f=this.counter;window.setTimeout(function(){f==e.counter&&e.refreshPositions(!d)},0)},_clear:function(b,c){this.reverting=!1;var d=[],e=this;!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var f in this._storedCSS)if(this._storedCSS[f]=="auto"||this._storedCSS[f]=="static")this._storedCSS[f]="";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!c&&d.push(function(a){this._trigger("receive",a,this._uiHash(this.fromOutside))}),(this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!c&&d.push(function(a){this._trigger("update",a,this._uiHash())});if(!a.ui.contains(this.element[0],this.currentItem[0])){c||d.push(function(a){this._trigger("remove",a,this._uiHash())});for(var f=this.containers.length-1;f>=0;f--)a.ui.contains(this.containers[f].element[0],this.currentItem[0])&&!c&&(d.push(function(a){return function(b){a._trigger("receive",b,this._uiHash(this))}}.call(this,this.containers[f])),d.push(function(a){return function(b){a._trigger("update",b,this._uiHash(this))}}.call(this,this.containers[f])))}for(var f=this.containers.length-1;f>=0;f--)c||d.push(function(a){return function(b){a._trigger("deactivate",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over&&(d.push(function(a){return function(b){a._trigger("out",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over=0);this._storedCursor&&a("body").css("cursor",this._storedCursor),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex),this.dragging=!1;if(this.cancelHelperRemoval){if(!c){this._trigger("beforeStop",b,this._uiHash());for(var f=0;f<d.length;f++)d[f].call(this,b);this._trigger("stop",b,this._uiHash())}return!1}c||this._trigger("beforeStop",b,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!=this.currentItem[0]&&this.helper.remove(),this.helper=null;if(!c){for(var f=0;f<d.length;f++)d[f].call(this,b);this._trigger("stop",b,this._uiHash())}this.fromOutside=!1;return!0},_trigger:function(){a.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(b){var c=b||this;return{helper:c.helper,placeholder:c.placeholder||a([]),position:c.position,originalPosition:c.originalPosition,offset:c.positionAbs,item:c.currentItem,sender:b?b.element:null}}}),a.extend(a.ui.sortable,{version:"1.8.17"})})(jQuery);/* - * 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 - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - */(function(a,b){a.widget("ui.accordion",{options:{active:0,animated:"slide",autoHeight:!0,clearStyle:!1,collapsible:!1,event:"click",fillSpace:!1,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:!1,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var b=this,c=b.options;b.running=0,b.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix"),b.headers=b.element.find(c.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){c.disabled||a(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){c.disabled||a(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){c.disabled||a(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){c.disabled||a(this).removeClass("ui-state-focus")}),b.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");if(c.navigation){var d=b.element.find("a").filter(c.navigationFilter).eq(0);if(d.length){var e=d.closest(".ui-accordion-header");e.length?b.active=e:b.active=d.closest(".ui-accordion-content").prev()}}b.active=b._findActive(b.active||c.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top"),b.active.next().addClass("ui-accordion-content-active"),b._createIcons(),b.resize(),b.element.attr("role","tablist"),b.headers.attr("role","tab").bind("keydown.accordion",function(a){return b._keydown(a)}).next().attr("role","tabpanel"),b.headers.not(b.active||"").attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).next().hide(),b.active.length?b.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}):b.headers.eq(0).attr("tabIndex",0),a.browser.safari||b.headers.find("a").attr("tabIndex",-1),c.event&&b.headers.bind(c.event.split(" ").join(".accordion ")+".accordion",function(a){b._clickHandler.call(b,a,this),a.preventDefault()})},_createIcons:function(){var b=this.options;b.icons&&(a("<span></span>").addClass("ui-icon "+b.icons.header).prependTo(this.headers),this.active.children(".ui-icon").toggleClass(b.icons.header).toggleClass(b.icons.headerSelected),this.element.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.children(".ui-icon").remove(),this.element.removeClass("ui-accordion-icons")},destroy:function(){var b=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex"),this.headers.find("a").removeAttr("tabIndex"),this._destroyIcons();var c=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");(b.autoHeight||b.fillHeight)&&c.css("height","");return a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments),b=="active"&&this.activate(c),b=="icons"&&(this._destroyIcons(),c&&this._createIcons()),b=="disabled"&&this.headers.add(this.headers.next())[c?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(b){if(!(this.options.disabled||b.altKey||b.ctrlKey)){var c=a.ui.keyCode,d=this.headers.length,e=this.headers.index(b.target),f=!1;switch(b.keyCode){case c.RIGHT:case c.DOWN:f=this.headers[(e+1)%d];break;case c.LEFT:case c.UP:f=this.headers[(e-1+d)%d];break;case c.SPACE:case c.ENTER:this._clickHandler({target:b.target},b.target),b.preventDefault()}if(f){a(b.target).attr("tabIndex",-1),a(f).attr("tabIndex",0),f.focus();return!1}return!0}},resize:function(){var b=this.options,c;if(b.fillSpace){if(a.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}c=this.element.parent().height(),a.browser.msie&&this.element.parent().css("overflow",d),this.headers.each(function(){c-=a(this).outerHeight(!0)}),this.headers.next().each(function(){a(this).height(Math.max(0,c-a(this).innerHeight()+a(this).height()))}).css("overflow","auto")}else b.autoHeight&&(c=0,this.headers.next().each(function(){c=Math.max(c,a(this).height("").height())}).height(c));return this},activate:function(a){this.options.active=a;var b=this._findActive(a)[0];this._clickHandler({target:b},b);return this},_findActive:function(b){return b?typeof b=="number"?this.headers.filter(":eq("+b+")"):this.headers.not(this.headers.not(b)):b===!1?a([]):this.headers.filter(":eq(0)")},_clickHandler:function(b,c){var d=this.options;if(!d.disabled){if(!b.target){if(!d.collapsible)return;this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header),this.active.next().addClass("ui-accordion-content-active");var e=this.active.next(),f={options:d,newHeader:a([]),oldHeader:d.active,newContent:a([]),oldContent:e},g=this.active=a([]);this._toggle(g,e,f);return}var h=a(b.currentTarget||c),i=h[0]===this.active[0];d.active=d.collapsible&&i?!1:this.headers.index(h);if(this.running||!d.collapsible&&i)return;var j=this.active,g=h.next(),e=this.active.next(),f={options:d,newHeader:i&&d.collapsible?a([]):h,oldHeader:this.active,newContent:i&&d.collapsible?a([]):g,oldContent:e},k=this.headers.index(this.active[0])>this.headers.index(h[0]);this.active=i?a([]):h,this._toggle(g,e,f,i,k),j.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header),i||(h.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected),h.next().addClass("ui-accordion-content-active"));return}},_toggle:function(b,c,d,e,f){var g=this,h=g.options;g.toShow=b,g.toHide=c,g.data=d;var i=function(){if(!!g)return g._completed.apply(g,arguments)};g._trigger("changestart",null,g.data),g.running=c.size()===0?b.size():c.size();if(h.animated){var j={};h.collapsible&&e?j={toShow:a([]),toHide:c,complete:i,down:f,autoHeight:h.autoHeight||h.fillSpace}:j={toShow:b,toHide:c,complete:i,down:f,autoHeight:h.autoHeight||h.fillSpace},h.proxied||(h.proxied=h.animated),h.proxiedDuration||(h.proxiedDuration=h.duration),h.animated=a.isFunction(h.proxied)?h.proxied(j):h.proxied,h.duration=a.isFunction(h.proxiedDuration)?h.proxiedDuration(j):h.proxiedDuration;var k=a.ui.accordion.animations,l=h.duration,m=h.animated;m&&!k[m]&&!a.easing[m]&&(m="slide"),k[m]||(k[m]=function(a){this.slide(a,{easing:m,duration:l||700})}),k[m](j)}else h.collapsible&&e?b.toggle():(c.hide(),b.show()),i(!0);c.prev().attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).blur(),b.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus()},_completed:function(a){this.running=a?0:--this.running;this.running||(this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""}),this.toHide.removeClass("ui-accordion-content-active"),this.toHide.length&&(this.toHide.parent()[0].className=this.toHide.parent()[0].className),this._trigger("change",null,this.data))}}),a.extend(a.ui.accordion,{version:"1.8.17",animations:{slide:function(b,c){b=a.extend({easing:"swing",duration:300},b,c);if(!b.toHide.size())b.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},b);else{if(!b.toShow.size()){b.toHide.animate({height:"hide",paddingTop:"hide",paddingBottom:"hide"},b);return}var d=b.toShow.css("overflow"),e=0,f={},g={},h=["height","paddingTop","paddingBottom"],i,j=b.toShow;i=j[0].style.width,j.width(j.parent().width()-parseFloat(j.css("paddingLeft"))-parseFloat(j.css("paddingRight"))-(parseFloat(j.css("borderLeftWidth"))||0)-(parseFloat(j.css("borderRightWidth"))||0)),a.each(h,function(c,d){g[d]="hide";var e=(""+a.css(b.toShow[0],d)).match(/^([\d+-.]+)(.*)$/);f[d]={value:e[1],unit:e[2]||"px"}}),b.toShow.css({height:0,overflow:"hidden"}).show(),b.toHide.filter(":hidden").each(b.complete).end().filter(":visible").animate(g,{step:function(a,c){c.prop=="height"&&(e=c.end-c.start===0?0:(c.now-c.start)/(c.end-c.start)),b.toShow[0].style[c.prop]=e*f[c.prop].value+f[c.prop].unit},duration:b.duration,easing:b.easing,complete:function(){b.autoHeight||b.toShow.css("height",""),b.toShow.css({width:i,overflow:d}),b.complete()}})}},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1e3:200})}}})})(jQuery);/* - * 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 - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - * jquery.ui.position.js - */(function(a,b){var c=0;a.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var b=this,c=this.element[0].ownerDocument,d;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(!b.options.disabled&&!b.element.propAttr("readOnly")){d=!1;var e=a.ui.keyCode;switch(c.keyCode){case e.PAGE_UP:b._move("previousPage",c);break;case e.PAGE_DOWN:b._move("nextPage",c);break;case e.UP:b._move("previous",c),c.preventDefault();break;case e.DOWN:b._move("next",c),c.preventDefault();break;case e.ENTER:case e.NUMPAD_ENTER:b.menu.active&&(d=!0,c.preventDefault());case e.TAB:if(!b.menu.active)return;b.menu.select(c);break;case e.ESCAPE:b.element.val(b.term),b.close(c);break;default:clearTimeout(b.searching),b.searching=setTimeout(function(){b.term!=b.element.val()&&(b.selectedItem=null,b.search(null,c))},b.options.delay)}}}).bind("keypress.autocomplete",function(a){d&&(d=!1,a.preventDefault())}).bind("focus.autocomplete",function(){b.options.disabled||(b.selectedItem=null,b.previous=b.element.val())}).bind("blur.autocomplete",function(a){b.options.disabled||(clearTimeout(b.searching),b.closing=setTimeout(function(){b.close(a),b._change(a)},150))}),this._initSource(),this.response=function(){return b._response.apply(b,arguments)},this.menu=a("<ul></ul>").addClass("ui-autocomplete").appendTo(a(this.options.appendTo||"body",c)[0]).mousedown(function(c){var d=b.menu.element[0];a(c.target).closest(".ui-menu-item").length||setTimeout(function(){a(document).one("mousedown",function(c){c.target!==b.element[0]&&c.target!==d&&!a.ui.contains(d,c.target)&&b.close()})},1),setTimeout(function(){clearTimeout(b.closing)},13)}).menu({focus:function(a,c){var d=c.item.data("item.autocomplete");!1!==b._trigger("focus",a,{item:d})&&/^key/.test(a.originalEvent.type)&&b.element.val(d.value)},selected:function(a,d){var e=d.item.data("item.autocomplete"),f=b.previous;b.element[0]!==c.activeElement&&(b.element.focus(),b.previous=f,setTimeout(function(){b.previous=f,b.selectedItem=e},1)),!1!==b._trigger("select",a,{item:e})&&b.element.val(e.value),b.term=b.element.val(),b.close(a),b.selectedItem=e},blur:function(a,c){b.menu.element.is(":visible")&&b.element.val()!==b.term&&b.element.val(b.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu"),a.fn.bgiframe&&this.menu.element.bgiframe(),b.beforeunloadHandler=function(){b.element.removeAttr("autocomplete")},a(window).bind("beforeunload",b.beforeunloadHandler)},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup"),this.menu.element.remove(),a(window).unbind("beforeunload",this.beforeunloadHandler),a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments),b==="source"&&this._initSource(),b==="appendTo"&&this.menu.element.appendTo(a(c||"body",this.element[0].ownerDocument)[0]),b==="disabled"&&c&&this.xhr&&this.xhr.abort()},_initSource:function(){var b=this,d,e;a.isArray(this.options.source)?(d=this.options.source,this.source=function(b,c){c(a.ui.autocomplete.filter(d,b.term))}):typeof this.options.source=="string"?(e=this.options.source,this.source=function(d,f){b.xhr&&b.xhr.abort(),b.xhr=a.ajax({url:e,data:d,dataType:"json",autocompleteRequest:++c,success:function(a,b){this.autocompleteRequest===c&&f(a)},error:function(){this.autocompleteRequest===c&&f([])}})}):this.source=this.options.source},search:function(a,b){a=a!=null?a:this.element.val(),this.term=this.element.val();if(a.length<this.options.minLength)return this.close(b);clearTimeout(this.closing);if(this._trigger("search",b)!==!1)return this._search(a)},_search:function(a){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.source({term:a},this.response)},_response:function(a){!this.options.disabled&&a&&a.length?(a=this._normalize(a),this._suggest(a),this._trigger("open")):this.close(),this.pending--,this.pending||this.element.removeClass("ui-autocomplete-loading")},close:function(a){clearTimeout(this.closing),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.deactivate(),this._trigger("close",a))},_change:function(a){this.previous!==this.element.val()&&this._trigger("change",a,{item:this.selectedItem})},_normalize:function(b){if(b.length&&b[0].label&&b[0].value)return b;return a.map(b,function(b){if(typeof b=="string")return{label:b,value:b};return a.extend({label:b.label||b.value,value:b.value||b.label},b)})},_suggest:function(b){var c=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(c,b),this.menu.deactivate(),this.menu.refresh(),c.show(),this._resizeMenu(),c.position(a.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(new a.Event("mouseover"))},_resizeMenu:function(){var a=this.menu.element;a.outerWidth(Math.max(a.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(b,c){var d=this;a.each(c,function(a,c){d._renderItem(b,c)})},_renderItem:function(b,c){return a("<li></li>").data("item.autocomplete",c).append(a("<a></a>").text(c.label)).appendTo(b)},_move:function(a,b){if(!this.menu.element.is(":visible"))this.search(null,b);else{if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term),this.menu.deactivate();return}this.menu[a](b)}},widget:function(){return this.menu.element}}),a.extend(a.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(b,c){var d=new RegExp(a.ui.autocomplete.escapeRegex(c),"i");return a.grep(b,function(a){return d.test(a.label||a.value||a)})}})})(jQuery),function(a){a.widget("ui.menu",{_create:function(){var b=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(c){!a(c.target).closest(".ui-menu-item a").length||(c.preventDefault(),b.select(c))}),this.refresh()},refresh:function(){var b=this,c=this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem");c.children("a").addClass("ui-corner-all").attr("tabindex",-1).mouseenter(function(c){b.activate(c,a(this).parent())}).mouseleave(function(){b.deactivate()})},activate:function(a,b){this.deactivate();if(this.hasScroll()){var c=b.offset().top-this.element.offset().top,d=this.element.scrollTop(),e=this.element.height();c<0?this.element.scrollTop(d+c):c>=e&&this.element.scrollTop(d+c-e+b.height())}this.active=b.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end(),this._trigger("focus",a,{item:b})},deactivate:function(){!this.active||(this.active.children("a").removeClass("ui-state-hover").removeAttr("id"),this._trigger("blur"),this.active=null)},next:function(a){this.move("next",".ui-menu-item:first",a)},previous:function(a){this.move("prev",".ui-menu-item:last",a)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(a,b,c){if(!this.active)this.activate(c,this.element.children(b));else{var d=this.active[a+"All"](".ui-menu-item").eq(0);d.length?this.activate(c,d):this.activate(c,this.element.children(b))}},nextPage:function(b){if(this.hasScroll()){if(!this.active||this.last()){this.activate(b,this.element.children(".ui-menu-item:first"));return}var c=this.active.offset().top,d=this.element.height(),e=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c-d+a(this).height();return b<10&&b>-10});e.length||(e=this.element.children(".ui-menu-item:last")),this.activate(b,e)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))},previousPage:function(b){if(this.hasScroll()){if(!this.active||this.first()){this.activate(b,this.element.children(".ui-menu-item:last"));return}var c=this.active.offset().top,d=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c+d-a(this).height();return b<10&&b>-10}),result.length||(result=this.element.children(".ui-menu-item:first")),this.activate(b,result)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()<this.element[a.fn.prop?"prop":"attr"]("scrollHeight")},select:function(a){this._trigger("selected",a,{item:this.active})}})}(jQuery);/* - * 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 - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - */(function(a,b){var c,d,e,f,g="ui-button ui-widget ui-state-default ui-corner-all",h="ui-state-hover ui-state-active ",i="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",j=function(){var b=a(this).find(":ui-button");setTimeout(function(){b.button("refresh")},1)},k=function(b){var c=b.name,d=b.form,e=a([]);c&&(d?e=a(d).find("[name='"+c+"']"):e=a("[name='"+c+"']",b.ownerDocument).filter(function(){return!this.form}));return e};a.widget("ui.button",{options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset.button").bind("reset.button",j),typeof this.options.disabled!="boolean"&&(this.options.disabled=this.element.propAttr("disabled")),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var b=this,h=this.options,i=this.type==="checkbox"||this.type==="radio",l="ui-state-hover"+(i?"":" ui-state-active"),m="ui-state-focus";h.label===null&&(h.label=this.buttonElement.html()),this.element.is(":disabled")&&(h.disabled=!0),this.buttonElement.addClass(g).attr("role","button").bind("mouseenter.button",function(){h.disabled||(a(this).addClass("ui-state-hover"),this===c&&a(this).addClass("ui-state-active"))}).bind("mouseleave.button",function(){h.disabled||a(this).removeClass(l)}).bind("click.button",function(a){h.disabled&&(a.preventDefault(),a.stopImmediatePropagation())}),this.element.bind("focus.button",function(){b.buttonElement.addClass(m)}).bind("blur.button",function(){b.buttonElement.removeClass(m)}),i&&(this.element.bind("change.button",function(){f||b.refresh()}),this.buttonElement.bind("mousedown.button",function(a){h.disabled||(f=!1,d=a.pageX,e=a.pageY)}).bind("mouseup.button",function(a){!h.disabled&&(d!==a.pageX||e!==a.pageY)&&(f=!0)})),this.type==="checkbox"?this.buttonElement.bind("click.button",function(){if(h.disabled||f)return!1;a(this).toggleClass("ui-state-active"),b.buttonElement.attr("aria-pressed",b.element[0].checked)}):this.type==="radio"?this.buttonElement.bind("click.button",function(){if(h.disabled||f)return!1;a(this).addClass("ui-state-active"),b.buttonElement.attr("aria-pressed","true");var c=b.element[0];k(c).not(c).map(function(){return a(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown.button",function(){if(h.disabled)return!1;a(this).addClass("ui-state-active"),c=this,a(document).one("mouseup",function(){c=null})}).bind("mouseup.button",function(){if(h.disabled)return!1;a(this).removeClass("ui-state-active")}).bind("keydown.button",function(b){if(h.disabled)return!1;(b.keyCode==a.ui.keyCode.SPACE||b.keyCode==a.ui.keyCode.ENTER)&&a(this).addClass("ui-state-active")}).bind("keyup.button",function(){a(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(b){b.keyCode===a.ui.keyCode.SPACE&&a(this).click()})),this._setOption("disabled",h.disabled),this._resetButton()},_determineButtonType:function(){this.element.is(":checkbox")?this.type="checkbox":this.element.is(":radio")?this.type="radio":this.element.is("input")?this.type="input":this.type="button";if(this.type==="checkbox"||this.type==="radio"){var a=this.element.parents().filter(":last"),b="label[for='"+this.element.attr("id")+"']";this.buttonElement=a.find(b),this.buttonElement.length||(a=a.length?a.siblings():this.element.siblings(),this.buttonElement=a.filter(b),this.buttonElement.length||(this.buttonElement=a.find(b))),this.element.addClass("ui-helper-hidden-accessible");var c=this.element.is(":checked");c&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.attr("aria-pressed",c)}else this.buttonElement=this.element},widget:function(){return this.buttonElement},destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(g+" "+h+" "+i).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title"),a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments);b==="disabled"?c?this.element.propAttr("disabled",!0):this.element.propAttr("disabled",!1):this._resetButton()},refresh:function(){var b=this.element.is(":disabled");b!==this.options.disabled&&this._setOption("disabled",b),this.type==="radio"?k(this.element[0]).each(function(){a(this).is(":checked")?a(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):a(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):this.type==="checkbox"&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if(this.type==="input")this.options.label&&this.element.val(this.options.label);else{var b=this.buttonElement.removeClass(i),c=a("<span></span>",this.element[0].ownerDocument).addClass("ui-button-text").html(this.options.label).appendTo(b.empty()).text(),d=this.options.icons,e=d.primary&&d.secondary,f=[];d.primary||d.secondary?(this.options.text&&f.push("ui-button-text-icon"+(e?"s":d.primary?"-primary":"-secondary")),d.primary&&b.prepend("<span class='ui-button-icon-primary ui-icon "+d.primary+"'></span>"),d.secondary&&b.append("<span class='ui-button-icon-secondary ui-icon "+d.secondary+"'></span>"),this.options.text||(f.push(e?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||b.attr("title",c))):f.push("ui-button-text-only"),b.addClass(f.join(" "))}}}),a.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(b,c){b==="disabled"&&this.buttons.button("option",b,c),a.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var b=this.element.css("direction")==="rtl";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(b?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(b?"ui-corner-left":"ui-corner-right").end().end()},destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy"),a.Widget.prototype.destroy.call(this)}})})(jQuery);/* - * 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 - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - * jquery.ui.button.js - * jquery.ui.draggable.js - * jquery.ui.mouse.js - * jquery.ui.position.js - * jquery.ui.resizable.js - */(function(a,b){var c="ui-dialog ui-widget ui-widget-content ui-corner-all ",d={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},e={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},f=a.attrFn||{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0,click:!0};a.widget("ui.dialog",{options:{autoOpen:!0,buttons:{},closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:!1,maxWidth:!1,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",collision:"fit",using:function(b){var c=a(this).css(b).offset().top;c<0&&a(this).css("top",b.top-c)}},resizable:!0,show:null,stack:!0,title:"",width:300,zIndex:1e3},_create:function(){this.originalTitle=this.element.attr("title"),typeof this.originalTitle!="string"&&(this.originalTitle=""),this.options.title=this.options.title||this.originalTitle;var b=this,d=b.options,e=d.title||" ",f=a.ui.dialog.getTitleId(b.element),g=(b.uiDialog=a("<div></div>")).appendTo(document.body).hide().addClass(c+d.dialogClass).css({zIndex:d.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(c){d.closeOnEscape&&!c.isDefaultPrevented()&&c.keyCode&&c.keyCode===a.ui.keyCode.ESCAPE&&(b.close(c),c.preventDefault())}).attr({role:"dialog","aria-labelledby":f}).mousedown(function(a){b.moveToTop(!1,a)}),h=b.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g),i=(b.uiDialogTitlebar=a("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g),j=a('<a href="#"></a>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){j.addClass("ui-state-hover")},function(){j.removeClass("ui-state-hover")}).focus(function(){j.addClass("ui-state-focus")}).blur(function(){j.removeClass("ui-state-focus")}).click(function(a){b.close(a);return!1}).appendTo(i),k=(b.uiDialogTitlebarCloseText=a("<span></span>")).addClass("ui-icon ui-icon-closethick").text(d.closeText).appendTo(j),l=a("<span></span>").addClass("ui-dialog-title").attr("id",f).html(e).prependTo(i);a.isFunction(d.beforeclose)&&!a.isFunction(d.beforeClose)&&(d.beforeClose=d.beforeclose),i.find("*").add(i).disableSelection(),d.draggable&&a.fn.draggable&&b._makeDraggable(),d.resizable&&a.fn.resizable&&b._makeResizable(),b._createButtons(d.buttons),b._isOpen=!1,a.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;a.overlay&&a.overlay.destroy(),a.uiDialog.hide(),a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"),a.uiDialog.remove(),a.originalTitle&&a.element.attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog},close:function(b){var c=this,d,e;if(!1!==c._trigger("beforeClose",b)){c.overlay&&c.overlay.destroy(),c.uiDialog.unbind("keypress.ui-dialog"),c._isOpen=!1,c.options.hide?c.uiDialog.hide(c.options.hide,function(){c._trigger("close",b)}):(c.uiDialog.hide(),c._trigger("close",b)),a.ui.dialog.overlay.resize(),c.options.modal&&(d=0,a(".ui-dialog").each(function(){this!==c.uiDialog[0]&&(e=a(this).css("z-index"),isNaN(e)||(d=Math.max(d,e)))}),a.ui.dialog.maxZ=d);return c}},isOpen:function(){return this._isOpen},moveToTop:function(b,c){var d=this,e=d.options,f;if(e.modal&&!b||!e.stack&&!e.modal)return d._trigger("focus",c);e.zIndex>a.ui.dialog.maxZ&&(a.ui.dialog.maxZ=e.zIndex),d.overlay&&(a.ui.dialog.maxZ+=1,d.overlay.$el.css("z-index",a.ui.dialog.overlay.maxZ=a.ui.dialog.maxZ)),f={scrollTop:d.element.scrollTop(),scrollLeft:d.element.scrollLeft()},a.ui.dialog.maxZ+=1,d.uiDialog.css("z-index",a.ui.dialog.maxZ),d.element.attr(f),d._trigger("focus",c);return d},open:function(){if(!this._isOpen){var b=this,c=b.options,d=b.uiDialog;b.overlay=c.modal?new a.ui.dialog.overlay(b):null,b._size(),b._position(c.position),d.show(c.show),b.moveToTop(!0),c.modal&&d.bind("keydown.ui-dialog",function(b){if(b.keyCode===a.ui.keyCode.TAB){var c=a(":tabbable",this),d=c.filter(":first"),e=c.filter(":last");if(b.target===e[0]&&!b.shiftKey){d.focus(1);return!1}if(b.target===d[0]&&b.shiftKey){e.focus(1);return!1}}}),a(b.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus(),b._isOpen=!0,b._trigger("open");return b}},_createButtons:function(b){var c=this,d=!1,e=a("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=a("<div></div>").addClass("ui-dialog-buttonset").appendTo(e);c.uiDialog.find(".ui-dialog-buttonpane").remove(),typeof b=="object"&&b!==null&&a.each(b,function(){return!(d=!0)}),d&&(a.each(b,function(b,d){d=a.isFunction(d)?{click:d,text:b}:d;var e=a('<button type="button"></button>').click(function(){d.click.apply(c.element[0],arguments)}).appendTo(g);a.each(d,function(a,b){a!=="click"&&(a in f?e[a](b):e.attr(a,b))}),a.fn.button&&e.button()}),e.appendTo(c.uiDialog))},_makeDraggable:function(){function f(a){return{position:a.position,offset:a.offset}}var b=this,c=b.options,d=a(document),e;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(d,g){e=c.height==="auto"?"auto":a(this).height(),a(this).height(a(this).height()).addClass("ui-dialog-dragging"),b._trigger("dragStart",d,f(g))},drag:function(a,c){b._trigger("drag",a,f(c))},stop:function(g,h){c.position=[h.position.left-d.scrollLeft(),h.position.top-d.scrollTop()],a(this).removeClass("ui-dialog-dragging").height(e),b._trigger("dragStop",g,f(h)),a.ui.dialog.overlay.resize()}})},_makeResizable:function(c){function h(a){return{originalPosition:a.originalPosition,originalSize:a.originalSize,position:a.position,size:a.size}}c=c===b?this.options.resizable:c;var d=this,e=d.options,f=d.uiDialog.css("position"),g=typeof c=="string"?c:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:g,start:function(b,c){a(this).addClass("ui-dialog-resizing"),d._trigger("resizeStart",b,h(c))},resize:function(a,b){d._trigger("resize",a,h(b))},stop:function(b,c){a(this).removeClass("ui-dialog-resizing"),e.height=a(this).height(),e.width=a(this).width(),d._trigger("resizeStop",b,h(c)),a.ui.dialog.overlay.resize()}}).css("position",f).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(b){var c=[],d=[0,0],e;if(b){if(typeof b=="string"||typeof b=="object"&&"0"in b)c=b.split?b.split(" "):[b[0],b[1]],c.length===1&&(c[1]=c[0]),a.each(["left","top"],function(a,b){+c[a]===c[a]&&(d[a]=c[a],c[a]=b)}),b={my:c.join(" "),at:c.join(" "),offset:d.join(" ")};b=a.extend({},a.ui.dialog.prototype.options.position,b)}else b=a.ui.dialog.prototype.options.position;e=this.uiDialog.is(":visible"),e||this.uiDialog.show(),this.uiDialog.css({top:0,left:0}).position(a.extend({of:window},b)),e||this.uiDialog.hide()},_setOptions:function(b){var c=this,f={},g=!1;a.each(b,function(a,b){c._setOption(a,b),a in d&&(g=!0),a in e&&(f[a]=b)}),g&&this._size(),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",f)},_setOption:function(b,d){var e=this,f=e.uiDialog;switch(b){case"beforeclose":b="beforeClose";break;case"buttons":e._createButtons(d);break;case"closeText":e.uiDialogTitlebarCloseText.text(""+d);break;case"dialogClass":f.removeClass(e.options.dialogClass).addClass(c+d);break;case"disabled":d?f.addClass("ui-dialog-disabled"):f.removeClass("ui-dialog-disabled");break;case"draggable":var g=f.is(":data(draggable)");g&&!d&&f.draggable("destroy"),!g&&d&&e._makeDraggable();break;case"position":e._position(d);break;case"resizable":var h=f.is(":data(resizable)");h&&!d&&f.resizable("destroy"),h&&typeof d=="string"&&f.resizable("option","handles",d),!h&&d!==!1&&e._makeResizable(d);break;case"title":a(".ui-dialog-title",e.uiDialogTitlebar).html(""+(d||" "))}a.Widget.prototype._setOption.apply(e,arguments)},_size:function(){var b=this.options,c,d,e=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0}),b.minWidth>b.width&&(b.width=b.minWidth),c=this.uiDialog.css({height:"auto",width:b.width}).height(),d=Math.max(0,b.minHeight-c);if(b.height==="auto")if(a.support.minHeight)this.element.css({minHeight:d,height:"auto"});else{this.uiDialog.show();var f=this.element.css("height","auto").height();e||this.uiDialog.hide(),this.element.height(Math.max(f,d))}else this.element.height(Math.max(b.height-c,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}}),a.extend(a.ui.dialog,{version:"1.8.17",uuid:0,maxZ:0,getTitleId:function(a){var b=a.attr("id");b||(this.uuid+=1,b=this.uuid);return"ui-dialog-title-"+b},overlay:function(b){this.$el=a.ui.dialog.overlay.create(b)}}),a.extend(a.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:a.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "),create:function(b){this.instances.length===0&&(setTimeout(function(){a.ui.dialog.overlay.instances.length&&a(document).bind(a.ui.dialog.overlay.events,function(b){if(a(b.target).zIndex()<a.ui.dialog.overlay.maxZ)return!1})},1),a(document).bind("keydown.dialog-overlay",function(c){b.options.closeOnEscape&&!c.isDefaultPrevented()&&c.keyCode&&c.keyCode===a.ui.keyCode.ESCAPE&&(b.close(c),c.preventDefault())}),a(window).bind("resize.dialog-overlay",a.ui.dialog.overlay.resize));var c=(this.oldInstances.pop()||a("<div></div>").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});a.fn.bgiframe&&c.bgiframe(),this.instances.push(c);return c},destroy:function(b){var c=a.inArray(b,this.instances);c!=-1&&this.oldInstances.push(this.instances.splice(c,1)[0]),this.instances.length===0&&a([document,window]).unbind(".dialog-overlay"),b.remove();var d=0;a.each(this.instances,function(){d=Math.max(d,this.css("z-index"))}),this.maxZ=d},height:function(){var b,c;if(a.browser.msie&&a.browser.version<7){b=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),c=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return b<c?a(window).height()+"px":b+"px"}return a(document).height()+"px"},width:function(){var b,c;if(a.browser.msie){b=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),c=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);return b<c?a(window).width()+"px":b+"px"}return a(document).width()+"px"},resize:function(){var b=a([]);a.each(a.ui.dialog.overlay.instances,function(){b=b.add(this)}),b.css({width:0,height:0}).css({width:a.ui.dialog.overlay.width(),height:a.ui.dialog.overlay.height()})}}),a.extend(a.ui.dialog.overlay.prototype,{destroy:function(){a.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);/* - * 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 - * - * Depends: - * jquery.ui.core.js - * jquery.ui.mouse.js - * jquery.ui.widget.js - */(function(a,b){var c=5;a.widget("ui.slider",a.ui.mouse,{widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var b=this,d=this.options,e=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),f="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",g=d.values&&d.values.length||1,h=[];this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"+(d.disabled?" ui-slider-disabled ui-disabled":"")),this.range=a([]),d.range&&(d.range===!0&&(d.values||(d.values=[this._valueMin(),this._valueMin()]),d.values.length&&d.values.length!==2&&(d.values=[d.values[0],d.values[0]])),this.range=a("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(d.range==="min"||d.range==="max"?" ui-slider-range-"+d.range:"")));for(var i=e.length;i<g;i+=1)h.push(f);this.handles=e.add(a(h.join("")).appendTo(b.element)),this.handle=this.handles.eq(0),this.handles.add(this.range).filter("a").click(function(a){a.preventDefault()}).hover(function(){d.disabled||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")}).focus(function(){d.disabled?a(this).blur():(a(".ui-slider .ui-state-focus").removeClass("ui-state-focus"),a(this).addClass("ui-state-focus"))}).blur(function(){a(this).removeClass("ui-state-focus")}),this.handles.each(function(b){a(this).data("index.ui-slider-handle",b)}),this.handles.keydown(function(d){var e=!0,f=a(this).data("index.ui-slider-handle"),g,h,i,j;if(!b.options.disabled){switch(d.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.PAGE_UP:case a.ui.keyCode.PAGE_DOWN:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:e=!1;if(!b._keySliding){b._keySliding=!0,a(this).addClass("ui-state-active"),g=b._start(d,f);if(g===!1)return}}j=b.options.step,b.options.values&&b.options.values.length?h=i=b.values(f):h=i=b.value();switch(d.keyCode){case a.ui.keyCode.HOME:i=b._valueMin();break;case a.ui.keyCode.END:i=b._valueMax();break;case a.ui.keyCode.PAGE_UP:i=b._trimAlignValue(h+(b._valueMax()-b._valueMin())/c);break;case a.ui.keyCode.PAGE_DOWN:i=b._trimAlignValue(h-(b._valueMax()-b._valueMin())/c);break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(h===b._valueMax())return;i=b._trimAlignValue(h+j);break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(h===b._valueMin())return;i=b._trimAlignValue(h-j)}b._slide(d,f,i);return e}}).keyup(function(c){var d=a(this).data("index.ui-slider-handle");b._keySliding&&(b._keySliding=!1,b._stop(c,d),b._change(c,d),a(this).removeClass("ui-state-active"))}),this._refreshValue(),this._animateOff=!1},destroy:function(){this.handles.remove(),this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider"),this._mouseDestroy();return this},_mouseCapture:function(b){var c=this.options,d,e,f,g,h,i,j,k,l;if(c.disabled)return!1;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),d={x:b.pageX,y:b.pageY},e=this._normValueFromMouse(d),f=this._valueMax()-this._valueMin()+1,h=this,this.handles.each(function(b){var c=Math.abs(e-h.values(b));f>c&&(f=c,g=a(this),i=b)}),c.range===!0&&this.values(1)===c.min&&(i+=1,g=a(this.handles[i])),j=this._start(b,i);if(j===!1)return!1;this._mouseSliding=!0,h._handleIndex=i,g.addClass("ui-state-active").focus(),k=g.offset(),l=!a(b.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:b.pageX-k.left-g.width()/2,top:b.pageY-k.top-g.height()/2-(parseInt(g.css("borderTopWidth"),10)||0)-(parseInt(g.css("borderBottomWidth"),10)||0)+(parseInt(g.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(b,i,e),this._animateOff=!0;return!0},_mouseStart:function(a){return!0},_mouseDrag:function(a){var b={x:a.pageX,y:a.pageY},c=this._normValueFromMouse(b);this._slide(a,this._handleIndex,c);return!1},_mouseStop:function(a){this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(a,this._handleIndex),this._change(a,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1;return!1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b,c,d,e,f;this.orientation==="horizontal"?(b=this.elementSize.width,c=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(b=this.elementSize.height,c=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),d=c/b,d>1&&(d=1),d<0&&(d=0),this.orientation==="vertical"&&(d=1-d),e=this._valueMax()-this._valueMin(),f=this._valueMin()+d*e;return this._trimAlignValue(f)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values());return this._trigger("start",a,c)},_slide:function(a,b,c){var d,e,f;this.options.values&&this.options.values.length?(d=this.values(b?0:1),this.options.values.length===2&&this.options.range===!0&&(b===0&&c>d||b===1&&c<d)&&(c=d),c!==this.values(b)&&(e=this.values(),e[b]=c,f=this._trigger("slide",a,{handle:this.handles[b],value:c,values:e}),d=this.values(b?0:1),f!==!1&&this.values(b,c,!0))):c!==this.value()&&(f=this._trigger("slide",a,{handle:this.handles[b],value:c}),f!==!1&&this.value(c))},_stop:function(a,b){var c={handle:this.handles[b],value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values()),this._trigger("stop",a,c)},_change:function(a,b){if(!this._keySliding&&!this._mouseSliding){var c={handle:this.handles[b],value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values()),this._trigger("change",a,c)}},value:function(a){if(arguments.length)this.options.value=this._trimAlignValue(a),this._refreshValue(),this._change(null,0);else return this._value()},values:function(b,c){var d,e,f;if(arguments.length>1)this.options.values[b]=this._trimAlignValue(c),this._refreshValue(),this._change(null,b);else{if(!arguments.length)return this._values();if(!a.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(b):this.value();d=this.options.values,e=arguments[0];for(f=0;f<d.length;f+=1)d[f]=this._trimAlignValue(e[f]),this._change(null,f);this._refreshValue()}},_setOption:function(b,c){var d,e=0;a.isArray(this.options.values)&&(e=this.options.values.length),a.Widget.prototype._setOption.apply(this,arguments);switch(b){case"disabled":c?(this.handles.filter(".ui-state-focus").blur(),this.handles.removeClass("ui-state-hover"),this.handles.propAttr("disabled",!0),this.element.addClass("ui-disabled")):(this.handles.propAttr("disabled",!1),this.element.removeClass("ui-disabled"));break;case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":this._animateOff=!0,this._refreshValue();for(d=0;d<e;d+=1)this._change(null,d);this._animateOff=!1}},_value:function(){var a=this.options.value;a=this._trimAlignValue(a);return a},_values:function(a){var b,c,d;if(arguments.length){b=this.options.values[a],b=this._trimAlignValue(b);return b}c=this.options.values.slice();for(d=0;d<c.length;d+=1)c[d]=this._trimAlignValue(c[d]);return c},_trimAlignValue:function(a){if(a<=this._valueMin())return this._valueMin();if(a>=this._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=(a-this._valueMin())%b,d=a-c;Math.abs(c)*2>=b&&(d+=c>0?b:-b);return parseFloat(d.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var b=this.options.range,c=this.options,d=this,e=this._animateOff?!1:c.animate,f,g={},h,i,j,k;this.options.values&&this.options.values.length?this.handles.each(function(b,i){f=(d.values(b)-d._valueMin())/(d._valueMax()-d._valueMin())*100,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",a(this).stop(1,1)[e?"animate":"css"](g,c.animate),d.options.range===!0&&(d.orientation==="horizontal"?(b===0&&d.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({width:f-h+"%"},{queue:!1,duration:c.animate})):(b===0&&d.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({height:f-h+"%"},{queue:!1,duration:c.animate}))),h=f}):(i=this.value(),j=this._valueMin(),k=this._valueMax(),f=k!==j?(i-j)/(k-j)*100:0,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",this.handle.stop(1,1)[e?"animate":"css"](g,c.animate),b==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[e?"animate":"css"]({width:f+"%"},c.animate),b==="max"&&this.orientation==="horizontal"&&this.range[e?"animate":"css"]({width:100-f+"%"},{queue:!1,duration:c.animate}),b==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},c.animate),b==="max"&&this.orientation==="vertical"&&this.range[e?"animate":"css"]({height:100-f+"%"},{queue:!1,duration:c.animate}))}}),a.extend(a.ui.slider,{version:"1.8.17"})})(jQuery);/* - * 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 - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - */(function(a,b){function f(){return++d}function e(){return++c}var c=0,d=0;a.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:!1,cookie:null,collapsible:!1,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"<div></div>",remove:null,select:null,show:null,spinner:"<em>Loading…</em>",tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},_create:function(){this._tabify(!0)},_setOption:function(a,b){if(a=="selected"){if(this.options.collapsible&&b==this.options.selected)return;this.select(b)}else this.options[a]=b,this._tabify()},_tabId:function(a){return a.title&&a.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+e()},_sanitizeSelector:function(a){return a.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+f());return a.cookie.apply(null,[b].concat(a.makeArray(arguments)))},_ui:function(a,b){return{tab:a,panel:b,index:this.anchors.index(a)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=a(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(c){function m(b,c){b.css("display",""),!a.support.opacity&&c.opacity&&b[0].style.removeAttribute("filter")}var d=this,e=this.options,f=/^#.+/;this.list=this.element.find("ol,ul").eq(0),this.lis=a(" > li:has(a[href])",this.list),this.anchors=this.lis.map(function(){return a("a",this)[0]}),this.panels=a([]),this.anchors.each(function(b,c){var g=a(c).attr("href"),h=g.split("#")[0],i;h&&(h===location.toString().split("#")[0]||(i=a("base")[0])&&h===i.href)&&(g=c.hash,c.href=g);if(f.test(g))d.panels=d.panels.add(d.element.find(d._sanitizeSelector(g)));else if(g&&g!=="#"){a.data(c,"href.tabs",g),a.data(c,"load.tabs",g.replace(/#.*$/,""));var j=d._tabId(c);c.href="#"+j;var k=d.element.find("#"+j);k.length||(k=a(e.panelTemplate).attr("id",j).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(d.panels[b-1]||d.list),k.data("destroy.tabs",!0)),d.panels=d.panels.add(k)}else e.disabled.push(b)}),c?(this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"),this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),this.lis.addClass("ui-state-default ui-corner-top"),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom"),e.selected===b?(location.hash&&this.anchors.each(function(a,b){if(b.hash==location.hash){e.selected=a;return!1}}),typeof e.selected!="number"&&e.cookie&&(e.selected=parseInt(d._cookie(),10)),typeof e.selected!="number"&&this.lis.filter(".ui-tabs-selected").length&&(e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))),e.selected=e.selected||(this.lis.length?0:-1)):e.selected===null&&(e.selected=-1),e.selected=e.selected>=0&&this.anchors[e.selected]||e.selected<0?e.selected:0,e.disabled=a.unique(e.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(a,b){return d.lis.index(a)}))).sort(),a.inArray(e.selected,e.disabled)!=-1&&e.disabled.splice(a.inArray(e.selected,e.disabled),1),this.panels.addClass("ui-tabs-hide"),this.lis.removeClass("ui-tabs-selected ui-state-active"),e.selected>=0&&this.anchors.length&&(d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash)).removeClass("ui-tabs-hide"),this.lis.eq(e.selected).addClass("ui-tabs-selected ui-state-active"),d.element.queue("tabs",function(){d._trigger("show",null,d._ui(d.anchors[e.selected],d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash))[0]))}),this.load(e.selected)),a(window).bind("unload",function(){d.lis.add(d.anchors).unbind(".tabs"),d.lis=d.anchors=d.panels=null})):e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")),this.element[e.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible"),e.cookie&&this._cookie(e.selected,e.cookie);for(var g=0,h;h=this.lis[g];g++)a(h)[a.inArray(g,e.disabled)!=-1&&!a(h).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");e.cache===!1&&this.anchors.removeData("cache.tabs"),this.lis.add(this.anchors).unbind(".tabs");if(e.event!=="mouseover"){var i=function(a,b){b.is(":not(.ui-state-disabled)")&&b.addClass("ui-state-"+a)},j=function(a,b){b.removeClass("ui-state-"+a)};this.lis.bind("mouseover.tabs",function(){i("hover",a(this))}),this.lis.bind("mouseout.tabs",function(){j("hover",a(this))}),this.anchors.bind("focus.tabs",function(){i("focus",a(this).closest("li"))}),this.anchors.bind("blur.tabs",function(){j("focus",a(this).closest("li"))})}var k,l;e.fx&&(a.isArray(e.fx)?(k=e.fx[0],l=e.fx[1]):k=l=e.fx);var n=l?function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.hide().removeClass("ui-tabs-hide").animate(l,l.duration||"normal",function(){m(c,l),d._trigger("show",null,d._ui(b,c[0]))})}:function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.removeClass("ui-tabs-hide"),d._trigger("show",null,d._ui(b,c[0]))},o=k?function(a,b){b.animate(k,k.duration||"normal",function(){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),m(b,k),d.element.dequeue("tabs")})}:function(a,b,c){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),d.element.dequeue("tabs")};this.anchors.bind(e.event+".tabs",function(){var b=this,c=a(b).closest("li"),f=d.panels.filter(":not(.ui-tabs-hide)"),g=d.element.find(d._sanitizeSelector(b.hash));if(c.hasClass("ui-tabs-selected")&&!e.collapsible||c.hasClass("ui-state-disabled")||c.hasClass("ui-state-processing")||d.panels.filter(":animated").length||d._trigger("select",null,d._ui(this,g[0]))===!1){this.blur();return!1}e.selected=d.anchors.index(this),d.abort();if(e.collapsible){if(c.hasClass("ui-tabs-selected")){e.selected=-1,e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){o(b,f)}).dequeue("tabs"),this.blur();return!1}if(!f.length){e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this)),this.blur();return!1}}e.cookie&&d._cookie(e.selected,e.cookie);if(g.length)f.length&&d.element.queue("tabs",function(){o(b,f)}),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this));else throw"jQuery UI Tabs: Mismatching fragment identifier.";a.browser.msie&&this.blur()}),this.anchors.bind("click.tabs",function(){return!1})},_getIndex:function(a){typeof a=="string"&&(a=this.anchors.index(this.anchors.filter("[href$="+a+"]")));return a},destroy:function(){var b=this.options;this.abort(),this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs"),this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),this.anchors.each(function(){var b=a.data(this,"href.tabs");b&&(this.href=b);var c=a(this).unbind(".tabs");a.each(["href","load","cache"],function(a,b){c.removeData(b+".tabs")})}),this.lis.unbind(".tabs").add(this.panels).each(function(){a.data(this,"destroy.tabs")?a(this).remove():a(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}),b.cookie&&this._cookie(null,b.cookie);return this},add:function(c,d,e){e===b&&(e=this.anchors.length);var f=this,g=this.options,h=a(g.tabTemplate.replace(/#\{href\}/g,c).replace(/#\{label\}/g,d)),i=c.indexOf("#")?this._tabId(a("a",h)[0]):c.replace("#","");h.addClass("ui-state-default ui-corner-top").data("destroy.tabs",!0);var j=f.element.find("#"+i);j.length||(j=a(g.panelTemplate).attr("id",i).data("destroy.tabs",!0)),j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide"),e>=this.lis.length?(h.appendTo(this.list),j.appendTo(this.list[0].parentNode)):(h.insertBefore(this.lis[e]),j.insertBefore(this.panels[e])),g.disabled=a.map(g.disabled,function(a,b){return a>=e?++a:a}),this._tabify(),this.anchors.length==1&&(g.selected=0,h.addClass("ui-tabs-selected ui-state-active"),j.removeClass("ui-tabs-hide"),this.element.queue("tabs",function(){f._trigger("show",null,f._ui(f.anchors[0],f.panels[0]))}),this.load(0)),this._trigger("add",null,this._ui(this.anchors[e],this.panels[e]));return this},remove:function(b){b=this._getIndex(b);var c=this.options,d=this.lis.eq(b).remove(),e=this.panels.eq(b).remove();d.hasClass("ui-tabs-selected")&&this.anchors.length>1&&this.select(b+(b+1<this.anchors.length?1:-1)),c.disabled=a.map(a.grep(c.disabled,function(a,c){return a!=b}),function(a,c){return a>=b?--a:a}),this._tabify(),this._trigger("remove",null,this._ui(d.find("a")[0],e[0]));return this},enable:function(b){b=this._getIndex(b);var c=this.options;if(a.inArray(b,c.disabled)!=-1){this.lis.eq(b).removeClass("ui-state-disabled"),c.disabled=a.grep(c.disabled,function(a,c){return a!=b}),this._trigger("enable",null,this._ui(this.anchors[b],this.panels[b]));return this}},disable:function(a){a=this._getIndex(a);var b=this,c=this.options;a!=c.selected&&(this.lis.eq(a).addClass("ui-state-disabled"),c.disabled.push(a),c.disabled.sort(),this._trigger("disable",null,this._ui(this.anchors[a],this.panels[a])));return this},select:function(a){a=this._getIndex(a);if(a==-1)if(this.options.collapsible&&this.options.selected!=-1)a=this.options.selected;else return this;this.anchors.eq(a).trigger(this.options.event+".tabs");return this},load:function(b){b=this._getIndex(b);var c=this,d=this.options,e=this.anchors.eq(b)[0],f=a.data(e,"load.tabs");this.abort();if(!f||this.element.queue("tabs").length!==0&&a.data(e,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(b).addClass("ui-state-processing");if(d.spinner){var g=a("span",e);g.data("label.tabs",g.html()).html(d.spinner)}this.xhr=a.ajax(a.extend({},d.ajaxOptions,{url:f,success:function(f,g){c.element.find(c._sanitizeSelector(e.hash)).html(f),c._cleanup(),d.cache&&a.data(e,"cache.tabs",!0),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.success(f,g)}catch(h){}},error:function(a,f,g){c._cleanup(),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.error(a,f,b,e)}catch(g){}}})),c.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]),this.panels.stop(!1,!0),this.element.queue("tabs",this.element.queue("tabs").splice(-2,2)),this.xhr&&(this.xhr.abort(),delete this.xhr),this._cleanup();return this},url:function(a,b){this.anchors.eq(a).removeData("cache.tabs").data("load.tabs",b);return this},length:function(){return this.anchors.length}}),a.extend(a.ui.tabs,{version:"1.8.17"}),a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(a,b){var c=this,d=this.options,e=c._rotate||(c._rotate=function(b){clearTimeout(c.rotation),c.rotation=setTimeout(function(){var a=d.selected;c.select(++a<c.anchors.length?a:0)},a),b&&b.stopPropagation()}),f=c._unrotate||(c._unrotate=b?function(a){t=d.selected,e()}:function(a){a.clientX&&c.rotate(null)});a?(this.element.bind("tabsshow",e),this.anchors.bind(d.event+".tabs",f),e()):(clearTimeout(c.rotation),this.element.unbind("tabsshow",e),this.anchors.unbind(d.event+".tabs",f),delete this._rotate,delete this._unrotate);return this}})})(jQuery);/* - * 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 - * - * Depends: - * jquery.ui.core.js - */(function($,undefined){function isArray(a){return a&&($.browser.safari&&typeof a=="object"&&a.length||a.constructor&&a.constructor.toString().match(/\Array\(\)/))}function extendRemove(a,b){$.extend(a,b);for(var c in b)if(b[c]==null||b[c]==undefined)a[c]=b[c];return a}function bindHover(a){var b="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return a.bind("mouseout",function(a){var c=$(a.target).closest(b);!c.length||c.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(c){var d=$(c.target).closest(b);!$.datepicker._isDisabledDatepicker(instActive.inline?a.parent()[0]:instActive.input[0])&&!!d.length&&(d.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),d.addClass("ui-state-hover"),d.hasClass("ui-datepicker-prev")&&d.addClass("ui-datepicker-prev-hover"),d.hasClass("ui-datepicker-next")&&d.addClass("ui-datepicker-next-hover"))})}function Datepicker(){this.debug=!1,this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},$.extend(this._defaults,this.regional[""]),this.dpDiv=bindHover($('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}$.extend($.ui,{datepicker:{version:"1.8.17"}});var PROP_NAME="datepicker",dpuuid=(new Date).getTime(),instActive;$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){extendRemove(this._defaults,a||{});return this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase(),inline=nodeName=="div"||nodeName=="span";target.id||(this.uuid+=1,target.id="dp"+this.uuid);var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{}),nodeName=="input"?this._connectDatepicker(target,inst):inline&&this._inlineDatepicker(target,inst)},_newInst:function(a,b){var c=a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1");return{id:c,input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:b?bindHover($('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')):this.dpDiv}},_connectDatepicker:function(a,b){var c=$(a);b.append=$([]),b.trigger=$([]);c.hasClass(this.markerClassName)||(this._attachments(c,b),c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),this._autoSize(b),$.data(a,PROP_NAME,b),b.settings.disabled&&this._disableDatepicker(a))},_attachments:function(a,b){var c=this._get(b,"appendText"),d=this._get(b,"isRTL");b.append&&b.append.remove(),c&&(b.append=$('<span class="'+this._appendClass+'">'+c+"</span>"),a[d?"before":"after"](b.append)),a.unbind("focus",this._showDatepicker),b.trigger&&b.trigger.remove();var e=this._get(b,"showOn");(e=="focus"||e=="both")&&a.focus(this._showDatepicker);if(e=="button"||e=="both"){var f=this._get(b,"buttonText"),g=this._get(b,"buttonImage");b.trigger=$(this._get(b,"buttonImageOnly")?$("<img/>").addClass(this._triggerClass).attr({src:g,alt:f,title:f}):$('<button type="button"></button>').addClass(this._triggerClass).html(g==""?f:$("<img/>").attr({src:g,alt:f,title:f}))),a[d?"before":"after"](b.trigger),b.trigger.click(function(){$.datepicker._datepickerShowing&&$.datepicker._lastInput==a[0]?$.datepicker._hideDatepicker():$.datepicker._showDatepicker(a[0]);return!1})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var d=function(a){var b=0,c=0;for(var d=0;d<a.length;d++)a[d].length>b&&(b=a[d].length,c=d);return c};b.setMonth(d(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort"))),b.setDate(d(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=$(a);c.hasClass(this.markerClassName)||(c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),$.data(a,PROP_NAME,b),this._setDate(b,this._getDefaultDate(b),!0),this._updateDatepicker(b),this._updateAlternate(b),b.settings.disabled&&this._disableDatepicker(a),b.dpDiv.css("display","block"))},_dialogDatepicker:function(a,b,c,d,e){var f=this._dialogInst;if(!f){this.uuid+=1;var g="dp"+this.uuid;this._dialogInput=$('<input type="text" id="'+g+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>'),this._dialogInput.keydown(this._doKeyDown),$("body").append(this._dialogInput),f=this._dialogInst=this._newInst(this._dialogInput,!1),f.settings={},$.data(this._dialogInput[0],PROP_NAME,f)}extendRemove(f.settings,d||{}),b=b&&b.constructor==Date?this._formatDate(f,b):b,this._dialogInput.val(b),this._pos=e?e.length?e:[e.pageX,e.pageY]:null;if(!this._pos){var h=document.documentElement.clientWidth,i=document.documentElement.clientHeight,j=document.documentElement.scrollLeft||document.body.scrollLeft,k=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[h/2-100+j,i/2-150+k]}this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),f.settings.onSelect=c,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),$.blockUI&&$.blockUI(this.dpDiv),$.data(this._dialogInput[0],PROP_NAME,f);return this},_destroyDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();$.removeData(a,PROP_NAME),d=="input"?(c.append.remove(),c.trigger.remove(),b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):(d=="div"||d=="span")&&b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!1,c.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().removeClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b})}},_disableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!0,c.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().addClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b}),this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return!1;for(var b=0;b<this._disabledInputs.length;b++)if(this._disabledInputs[b]==a)return!0;return!1},_getInst:function(a){try{return $.data(a,PROP_NAME)}catch(b){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(a,b,c){var d=this._getInst(a);if(arguments.length==2&&typeof b=="string")return b=="defaults"?$.extend({},$.datepicker._defaults):d?b=="all"?$.extend({},d.settings):this._get(d,b):null;var e=b||{};typeof b=="string"&&(e={},e[b]=c);if(d){this._curInst==d&&this._hideDatepicker();var f=this._getDateDatepicker(a,!0),g=this._getMinMaxDate(d,"min"),h=this._getMinMaxDate(d,"max");extendRemove(d.settings,e),g!==null&&e.dateFormat!==undefined&&e.minDate===undefined&&(d.settings.minDate=this._formatDate(d,g)),h!==null&&e.dateFormat!==undefined&&e.maxDate===undefined&&(d.settings.maxDate=this._formatDate(d,h)),this._attachments($(a),d),this._autoSize(d),this._setDate(d,f),this._updateAlternate(d),this._updateDatepicker(d)}},_changeDatepicker:function(a,b,c){this._optionDatepicker(a,b,c)},_refreshDatepicker:function(a){var b=this._getInst(a);b&&this._updateDatepicker(b)},_setDateDatepicker:function(a,b){var c=this._getInst(a);c&&(this._setDate(c,b),this._updateDatepicker(c),this._updateAlternate(c))},_getDateDatepicker:function(a,b){var c=this._getInst(a);c&&!c.inline&&this._setDateFromField(c,b);return c?this._getDate(c):null},_doKeyDown:function(a){var b=$.datepicker._getInst(a.target),c=!0,d=b.dpDiv.is(".ui-datepicker-rtl");b._keyEvent=!0;if($.datepicker._datepickerShowing)switch(a.keyCode){case 9:$.datepicker._hideDatepicker(),c=!1;break;case 13:var e=$("td."+$.datepicker._dayOverClass+":not(."+$.datepicker._currentClass+")",b.dpDiv);e[0]&&$.datepicker._selectDay(a.target,b.selectedMonth,b.selectedYear,e[0]);var f=$.datepicker._get(b,"onSelect");if(f){var g=$.datepicker._formatDate(b);f.apply(b.input?b.input[0]:null,[g,b])}else $.datepicker._hideDatepicker();return!1;case 27:$.datepicker._hideDatepicker();break;case 33:$.datepicker._adjustDate(a.target,a.ctrlKey?-$.datepicker._get(b,"stepBigMonths"):-$.datepicker._get(b,"stepMonths"),"M");break;case 34:$.datepicker._adjustDate(a.target,a.ctrlKey?+$.datepicker._get(b,"stepBigMonths"):+$.datepicker._get(b,"stepMonths"),"M");break;case 35:(a.ctrlKey||a.metaKey)&&$.datepicker._clearDate(a.target),c=a.ctrlKey||a.metaKey;break;case 36:(a.ctrlKey||a.metaKey)&&$.datepicker._gotoToday(a.target),c=a.ctrlKey||a.metaKey;break;case 37:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,d?1:-1,"D"),c=a.ctrlKey||a.metaKey,a.originalEvent.altKey&&$.datepicker._adjustDate(a.target,a.ctrlKey?-$.datepicker._get(b,"stepBigMonths"):-$.datepicker._get(b,"stepMonths"),"M");break;case 38:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,-7,"D"),c=a.ctrlKey||a.metaKey;break;case 39:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,d?-1:1,"D"),c=a.ctrlKey||a.metaKey,a.originalEvent.altKey&&$.datepicker._adjustDate(a.target,a.ctrlKey?+$.datepicker._get(b,"stepBigMonths"):+$.datepicker._get(b,"stepMonths"),"M");break;case 40:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,7,"D"),c=a.ctrlKey||a.metaKey;break;default:c=!1}else a.keyCode==36&&a.ctrlKey?$.datepicker._showDatepicker(this):c=!1;c&&(a.preventDefault(),a.stopPropagation())},_doKeyPress:function(a){var b=$.datepicker._getInst(a.target);if($.datepicker._get(b,"constrainInput")){var c=$.datepicker._possibleChars($.datepicker._get(b,"dateFormat")),d=String.fromCharCode(a.charCode==undefined?a.keyCode:a.charCode);return a.ctrlKey||a.metaKey||d<" "||!c||c.indexOf(d)>-1}},_doKeyUp:function(a){var b=$.datepicker._getInst(a.target);if(b.input.val()!=b.lastVal)try{var c=$.datepicker.parseDate($.datepicker._get(b,"dateFormat"),b.input?b.input.val():null,$.datepicker._getFormatConfig(b));c&&($.datepicker._setDateFromField(b),$.datepicker._updateAlternate(b),$.datepicker._updateDatepicker(b))}catch(a){$.datepicker.log(a)}return!0},_showDatepicker:function(a){a=a.target||a,a.nodeName.toLowerCase()!="input"&&(a=$("input",a.parentNode)[0]);if(!$.datepicker._isDisabledDatepicker(a)&&$.datepicker._lastInput!=a){var b=$.datepicker._getInst(a);$.datepicker._curInst&&$.datepicker._curInst!=b&&($.datepicker._curInst.dpDiv.stop(!0,!0),b&&$.datepicker._datepickerShowing&&$.datepicker._hideDatepicker($.datepicker._curInst.input[0]));var c=$.datepicker._get(b,"beforeShow"),d=c?c.apply(a,[a,b]):{};if(d===!1)return;extendRemove(b.settings,d),b.lastVal=null,$.datepicker._lastInput=a,$.datepicker._setDateFromField(b),$.datepicker._inDialog&&(a.value=""),$.datepicker._pos||($.datepicker._pos=$.datepicker._findPos(a),$.datepicker._pos[1]+=a.offsetHeight);var e=!1;$(a).parents().each(function(){e|=$(this).css("position")=="fixed";return!e}),e&&$.browser.opera&&($.datepicker._pos[0]-=document.documentElement.scrollLeft,$.datepicker._pos[1]-=document.documentElement.scrollTop);var f={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null,b.dpDiv.empty(),b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),$.datepicker._updateDatepicker(b),f=$.datepicker._checkOffset(b,f,e),b.dpDiv.css({position:$.datepicker._inDialog&&$.blockUI?"static":e?"fixed":"absolute",display:"none",left:f.left+"px",top:f.top+"px"});if(!b.inline){var g=$.datepicker._get(b,"showAnim"),h=$.datepicker._get(b,"duration"),i=function(){var a=b.dpDiv.find("iframe.ui-datepicker-cover");if(!!a.length){var c=$.datepicker._getBorders(b.dpDiv);a.css({left:-c[0],top:-c[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex($(a).zIndex()+1),$.datepicker._datepickerShowing=!0,$.effects&&$.effects[g]?b.dpDiv.show(g,$.datepicker._get(b,"showOptions"),h,i):b.dpDiv[g||"show"](g?h:null,i),(!g||!h)&&i(),b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus(),$.datepicker._curInst=b}}},_updateDatepicker:function(a){var b=this;b.maxRows=4;var c=$.datepicker._getBorders(a.dpDiv);instActive=a,a.dpDiv.empty().append(this._generateHTML(a));var d=a.dpDiv.find("iframe.ui-datepicker-cover");!d.length||d.css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}),a.dpDiv.find("."+this._dayOverClass+" a").mouseover();var e=this._getNumberOfMonths(a),f=e[1],g=17;a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),f>1&&a.dpDiv.addClass("ui-datepicker-multi-"+f).css("width",g*f+"em"),a.dpDiv[(e[0]!=1||e[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi"),a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),a==$.datepicker._curInst&&$.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var h=a.yearshtml;setTimeout(function(){h===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml),h=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(a){return{thin:1,medium:2,thick:3}[a]||a};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var d=a.dpDiv.outerWidth(),e=a.dpDiv.outerHeight(),f=a.input?a.input.outerWidth():0,g=a.input?a.input.outerHeight():0,h=document.documentElement.clientWidth+$(document).scrollLeft(),i=document.documentElement.clientHeight+$(document).scrollTop();b.left-=this._get(a,"isRTL")?d-f:0,b.left-=c&&b.left==a.input.offset().left?$(document).scrollLeft():0,b.top-=c&&b.top==a.input.offset().top+g?$(document).scrollTop():0,b.left-=Math.min(b.left,b.left+d>h&&h>d?Math.abs(b.left+d-h):0),b.top-=Math.min(b.top,b.top+e>i&&i>e?Math.abs(e+g):0);return b},_findPos:function(a){var b=this._getInst(a),c=this._get(b,"isRTL");while(a&&(a.type=="hidden"||a.nodeType!=1||$.expr.filters.hidden(a)))a=a[c?"previousSibling":"nextSibling"];var d=$(a).offset();return[d.left,d.top]},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=$.data(a,PROP_NAME))&&this._datepickerShowing){var c=this._get(b,"showAnim"),d=this._get(b,"duration"),e=this,f=function(){$.datepicker._tidyDialog(b),e._curInst=null};$.effects&&$.effects[c]?b.dpDiv.hide(c,$.datepicker._get(b,"showOptions"),d,f):b.dpDiv[c=="slideDown"?"slideUp":c=="fadeIn"?"fadeOut":"hide"](c?d:null,f),c||f(),this._datepickerShowing=!1;var g=this._get(b,"onClose");g&&g.apply(b.input?b.input[0]:null,[b.input?b.input.val():"",b]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),$.blockUI&&($.unblockUI(),$("body").append(this.dpDiv))),this._inDialog=!1}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(!!$.datepicker._curInst){var b=$(a.target),c=$.datepicker._getInst(b[0]);(b[0].id!=$.datepicker._mainDivId&&b.parents("#"+$.datepicker._mainDivId).length==0&&!b.hasClass($.datepicker.markerClassName)&&!b.hasClass($.datepicker._triggerClass)&&$.datepicker._datepickerShowing&&(!$.datepicker._inDialog||!$.blockUI)||b.hasClass($.datepicker.markerClassName)&&$.datepicker._curInst!=c)&&$.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){var d=$(a),e=this._getInst(d[0]);this._isDisabledDatepicker(d[0])||(this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c),this._updateDatepicker(e))},_gotoToday:function(a){var b=$(a),c=this._getInst(b[0]);if(this._get(c,"gotoCurrent")&&c.currentDay)c.selectedDay=c.currentDay,c.drawMonth=c.selectedMonth=c.currentMonth,c.drawYear=c.selectedYear=c.currentYear;else{var d=new Date;c.selectedDay=d.getDate(),c.drawMonth=c.selectedMonth=d.getMonth(),c.drawYear=c.selectedYear=d.getFullYear()}this._notifyChange(c),this._adjustDate(b)},_selectMonthYear:function(a,b,c){var d=$(a),e=this._getInst(d[0]);e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10),this._notifyChange(e),this._adjustDate(d)},_selectDay:function(a,b,c,d){var e=$(a);if(!$(d).hasClass(this._unselectableClass)&&!this._isDisabledDatepicker(e[0])){var f=this._getInst(e[0]);f.selectedDay=f.currentDay=$("a",d).html(),f.selectedMonth=f.currentMonth=b,f.selectedYear=f.currentYear=c,this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){var b=$(a),c=this._getInst(b[0]);this._selectDate(b,"")},_selectDate:function(a,b){var c=$(a),d=this._getInst(c[0]);b=b!=null?b:this._formatDate(d),d.input&&d.input.val(b),this._updateAlternate(d);var e=this._get(d,"onSelect");e?e.apply(d.input?d.input[0]:null,[b,d]):d.input&&d.input.trigger("change"),d.inline?this._updateDatepicker(d):(this._hideDatepicker(),this._lastInput=d.input[0],typeof d.input[0]!="object"&&d.input.focus(),this._lastInput=null)},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),d=this._getDate(a),e=this.formatDate(c,d,this._getFormatConfig(a));$(b).each(function(){$(this).val(e)})}},noWeekends:function(a){var b=a.getDay();return[b>0&&b<6,""]},iso8601Week:function(a){var b=new Date(a.getTime());b.setDate(b.getDate()+4-(b.getDay()||7));var c=b.getTime();b.setMonth(0),b.setDate(1);return Math.floor(Math.round((c-b)/864e5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null;var d=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;d=typeof d!="string"?d:(new Date).getFullYear()%100+parseInt(d,10);var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,g=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,h=(c?c.monthNames:null)||this._defaults.monthNames,i=-1,j=-1,k=-1,l=-1,m=!1,n=function(b){var c=s+1<a.length&&a.charAt(s+1)==b;c&&s++;return c},o=function(a){var c=n(a),d=a=="@"?14:a=="!"?20:a=="y"&&c?4:a=="o"?3:2,e=new RegExp("^\\d{1,"+d+"}"),f=b.substring(r).match(e);if(!f)throw"Missing number at position "+r;r+=f[0].length;return parseInt(f[0],10)},p=function(a,c,d){var e=$.map(n(a)?d:c,function(a,b){return[[b,a]]}).sort(function(a,b){return-(a[1].length-b[1].length)}),f=-1;$.each(e,function(a,c){var d=c[1];if(b.substr(r,d.length).toLowerCase()==d.toLowerCase()){f=c[0],r+=d.length;return!1}});if(f!=-1)return f+1;throw"Unknown name at position "+r},q=function(){if(b.charAt(r)!=a.charAt(s))throw"Unexpected literal at position "+r;r++},r=0;for(var s=0;s<a.length;s++)if(m)a.charAt(s)=="'"&&!n("'")?m=!1:q();else switch(a.charAt(s)){case"d":k=o("d");break;case"D":p("D",e,f);break;case"o":l=o("o");break;case"m":j=o("m");break;case"M":j=p("M",g,h);break;case"y":i=o("y");break;case"@":var t=new Date(o("@"));i=t.getFullYear(),j=t.getMonth()+1,k=t.getDate();break;case"!":var t=new Date((o("!")-this._ticksTo1970)/1e4);i=t.getFullYear(),j=t.getMonth()+1,k=t.getDate();break;case"'":n("'")?q():m=!0;break;default:q()}if(r<b.length)throw"Extra/unparsed characters found in date: "+b.substring(r);i==-1?i=(new Date).getFullYear():i<100&&(i+=(new Date).getFullYear()-(new Date).getFullYear()%100+(i<=d?0:-100));if(l>-1){j=1,k=l;for(;;){var u=this._getDaysInMonth(i,j-1);if(k<=u)break;j++,k-=u}}var t=this._daylightSavingAdjust(new Date(i,j-1,k));if(t.getFullYear()!=i||t.getMonth()+1!=j||t.getDate()!=k)throw"Invalid date";return t},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1e7,formatDate:function(a,b,c){if(!b)return"";var d=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,e=(c?c.dayNames:null)||this._defaults.dayNames,f=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,h=function(b){var c=m+1<a.length&&a.charAt(m+1)==b;c&&m++;return c},i=function(a,b,c){var d=""+b;if(h(a))while(d.length<c)d="0"+d;return d},j=function(a,b,c,d){return h(a)?d[b]:c[b]},k="",l=!1;if(b)for(var m=0;m<a.length;m++)if(l)a.charAt(m)=="'"&&!h("'")?l=!1:k+=a.charAt(m);else switch(a.charAt(m)){case"d":k+=i("d",b.getDate(),2);break;case"D":k+=j("D",b.getDay(),d,e);break;case"o":k+=i("o",Math.round(((new Date(b.getFullYear(),b.getMonth(),b.getDate())).getTime()-(new Date(b.getFullYear(),0,0)).getTime())/864e5),3);break;case"m":k+=i("m",b.getMonth()+1,2);break;case"M":k+=j("M",b.getMonth(),f,g);break;case"y":k+=h("y")?b.getFullYear():(b.getYear()%100<10?"0":"")+b.getYear()%100;break;case"@":k+=b.getTime();break;case"!":k+=b.getTime()*1e4+this._ticksTo1970;break;case"'":h("'")?k+="'":l=!0;break;default:k+=a.charAt(m)}return k},_possibleChars:function(a){var b="",c=!1,d=function(b){var c=e+1<a.length&&a.charAt(e+1)==b;c&&e++;return c};for(var e=0;e<a.length;e++)if(c)a.charAt(e)=="'"&&!d("'")?c=!1:b+=a.charAt(e);else switch(a.charAt(e)){case"d":case"m":case"y":case"@":b+="0123456789";break;case"D":case"M":return null;case"'":d("'")?b+="'":c=!0;break;default:b+=a.charAt(e)}return b},_get:function(a,b){return a.settings[b]!==undefined?a.settings[b]:this._defaults[b]},_setDateFromField:function(a,b){if(a.input.val()!=a.lastVal){var c=this._get(a,"dateFormat"),d=a.lastVal=a.input?a.input.val():null,e,f;e=f=this._getDefaultDate(a);var g=this._getFormatConfig(a);try{e=this.parseDate(c,d,g)||f}catch(h){this.log(h),d=b?"":d}a.selectedDay=e.getDate(),a.drawMonth=a.selectedMonth=e.getMonth(),a.drawYear=a.selectedYear=e.getFullYear(),a.currentDay=d?e.getDate():0,a.currentMonth=d?e.getMonth():0,a.currentYear=d?e.getFullYear():0,this._adjustInstDate(a)}},_getDefaultDate:function(a){return this._restrictMinMax(a,this._determineDate(a,this._get(a,"defaultDate"),new Date))},_determineDate:function(a,b,c){var d=function(a){var b=new Date;b.setDate(b.getDate()+a);return b},e=function(b){try{return $.datepicker.parseDate($.datepicker._get(a,"dateFormat"),b,$.datepicker._getFormatConfig(a))}catch(c){}var d=(b.toLowerCase().match(/^c/)?$.datepicker._getDate(a):null)||new Date,e=d.getFullYear(),f=d.getMonth(),g=d.getDate(),h=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,i=h.exec(b);while(i){switch(i[2]||"d"){case"d":case"D":g+=parseInt(i[1],10);break;case"w":case"W":g+=parseInt(i[1],10)*7;break;case"m":case"M":f+=parseInt(i[1],10),g=Math.min(g,$.datepicker._getDaysInMonth(e,f));break;case"y":case"Y":e+=parseInt(i[1],10),g=Math.min(g,$.datepicker._getDaysInMonth(e,f))}i=h.exec(b)}return new Date(e,f,g)},f=b==null||b===""?c:typeof b=="string"?e(b):typeof b=="number"?isNaN(b)?c:d(b):new Date(b.getTime());f=f&&f.toString()=="Invalid Date"?c:f,f&&(f.setHours(0),f.setMinutes(0),f.setSeconds(0),f.setMilliseconds(0));return this._daylightSavingAdjust(f)},_daylightSavingAdjust:function(a){if(!a)return null;a.setHours(a.getHours()>12?a.getHours()+2:0);return a},_setDate:function(a,b,c){var d=!b,e=a.selectedMonth,f=a.selectedYear,g=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=g.getDate(),a.drawMonth=a.selectedMonth=a.currentMonth=g.getMonth(),a.drawYear=a.selectedYear=a.currentYear=g.getFullYear(),(e!=a.selectedMonth||f!=a.selectedYear)&&!c&&this._notifyChange(a),this._adjustInstDate(a),a.input&&a.input.val(d?"":this._formatDate(a))},_getDate:function(a){var b=!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return b},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),d=this._get(a,"showButtonPanel"),e=this._get(a,"hideIfNoPrevNext"),f=this._get(a,"navigationAsDateFormat"),g=this._getNumberOfMonths(a),h=this._get(a,"showCurrentAtPos"),i=this._get(a,"stepMonths"),j=g[0]!=1||g[1]!=1,k=this._daylightSavingAdjust(a.currentDay?new Date(a.currentYear,a.currentMonth,a.currentDay):new Date(9999,9,9)),l=this._getMinMaxDate(a,"min"),m=this._getMinMaxDate(a,"max"),n=a.drawMonth-h,o=a.drawYear;n<0&&(n+=12,o--);if(m){var p=this._daylightSavingAdjust(new Date(m.getFullYear(),m.getMonth()-g[0]*g[1]+1,m.getDate()));p=l&&p<l?l:p;while(this._daylightSavingAdjust(new Date(o,n,1))>p)n--,n<0&&(n=11,o--)}a.drawMonth=n,a.drawYear=o;var q=this._get(a,"prevText");q=f?this.formatDate(q,this._daylightSavingAdjust(new Date(o,n-i,1)),this._getFormatConfig(a)):q;var r=this._canAdjustMonth(a,-1,o,n)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+dpuuid+".datepicker._adjustDate('#"+a.id+"', -"+i+", 'M');\""+' title="'+q+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+q+"</span></a>":e?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+q+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+q+"</span></a>",s=this._get(a,"nextText");s=f?this.formatDate(s,this._daylightSavingAdjust(new Date(o,n+i,1)),this._getFormatConfig(a)):s;var t=this._canAdjustMonth(a,1,o,n)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+dpuuid+".datepicker._adjustDate('#"+a.id+"', +"+i+", 'M');\""+' title="'+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>":e?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>",u=this._get(a,"currentText"),v=this._get(a,"gotoCurrent")&&a.currentDay?k:b;u=f?this.formatDate(u,v,this._getFormatConfig(a)):u;var w=a.inline?"":'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+dpuuid+'.datepicker._hideDatepicker();">'+this._get(a,"closeText")+"</button>",x=d?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(c?w:"")+(this._isInRange(a,v)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+dpuuid+".datepicker._gotoToday('#"+a.id+"');\""+">"+u+"</button>":"")+(c?"":w)+"</div>":"",y=parseInt(this._get(a,"firstDay"),10);y=isNaN(y)?0:y;var z=this._get(a,"showWeek"),A=this._get(a,"dayNames"),B=this._get(a,"dayNamesShort"),C=this._get(a,"dayNamesMin"),D=this._get(a,"monthNames"),E=this._get(a,"monthNamesShort"),F=this._get(a,"beforeShowDay"),G=this._get(a,"showOtherMonths"),H=this._get(a,"selectOtherMonths"),I=this._get(a,"calculateWeek")||this.iso8601Week,J=this._getDefaultDate(a),K="";for(var L=0;L<g[0];L++){var M="";this.maxRows=4;for(var N=0;N<g[1];N++){var O=this._daylightSavingAdjust(new Date(o,n,a.selectedDay)),P=" ui-corner-all",Q="";if(j){Q+='<div class="ui-datepicker-group';if(g[1]>1)switch(N){case 0:Q+=" ui-datepicker-group-first",P=" ui-corner-"+(c?"right":"left");break;case g[1]-1:Q+=" ui-datepicker-group-last",P=" ui-corner-"+(c?"left":"right");break;default:Q+=" ui-datepicker-group-middle",P=""}Q+='">'}Q+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+P+'">'+(/all|left/.test(P)&&L==0?c?t:r:"")+(/all|right/.test(P)&&L==0?c?r:t:"")+this._generateMonthYearHeader(a,n,o,l,m,L>0||N>0,D,E)+'</div><table class="ui-datepicker-calendar"><thead>'+"<tr>";var R=z?'<th class="ui-datepicker-week-col">'+this._get(a,"weekHeader")+"</th>":"";for(var S=0;S<7;S++){var T=(S+y)%7;R+="<th"+((S+y+6)%7>=5?' class="ui-datepicker-week-end"':"")+">"+'<span title="'+A[T]+'">'+C[T]+"</span></th>"}Q+=R+"</tr></thead><tbody>";var U=this._getDaysInMonth(o,n);o==a.selectedYear&&n==a.selectedMonth&&(a.selectedDay=Math.min(a.selectedDay,U));var V=(this._getFirstDayOfMonth(o,n)-y+7)%7,W=Math.ceil((V+U)/7),X=j?this.maxRows>W?this.maxRows:W:W;this.maxRows=X;var Y=this._daylightSavingAdjust(new Date(o,n,1-V));for(var Z=0;Z<X;Z++){Q+="<tr>";var _=z?'<td class="ui-datepicker-week-col">'+this._get(a,"calculateWeek")(Y)+"</td>":"";for(var S=0;S<7;S++){var ba=F?F.apply(a.input?a.input[0]:null,[Y]):[!0,""],bb=Y.getMonth()!=n,bc=bb&&!H||!ba[0]||l&&Y<l||m&&Y>m;_+='<td class="'+((S+y+6)%7>=5?" ui-datepicker-week-end":"")+(bb?" ui-datepicker-other-month":"")+(Y.getTime()==O.getTime()&&n==a.selectedMonth&&a._keyEvent||J.getTime()==Y.getTime()&&J.getTime()==O.getTime()?" "+this._dayOverClass:"")+(bc?" "+this._unselectableClass+" ui-state-disabled":"")+(bb&&!G?"":" "+ba[1]+(Y.getTime()==k.getTime()?" "+this._currentClass:"")+(Y.getTime()==b.getTime()?" ui-datepicker-today":""))+'"'+((!bb||G)&&ba[2]?' title="'+ba[2]+'"':"")+(bc?"":' onclick="DP_jQuery_'+dpuuid+".datepicker._selectDay('#"+a.id+"',"+Y.getMonth()+","+Y.getFullYear()+', this);return false;"')+">"+(bb&&!G?" ":bc?'<span class="ui-state-default">'+Y.getDate()+"</span>":'<a class="ui-state-default'+(Y.getTime()==b.getTime()?" ui-state-highlight":"")+(Y.getTime()==k.getTime()?" ui-state-active":"")+(bb?" ui-priority-secondary":"")+'" href="#">'+Y.getDate()+"</a>")+"</td>",Y.setDate(Y.getDate()+1),Y=this._daylightSavingAdjust(Y)}Q+=_+"</tr>"}n++,n>11&&(n=0,o++),Q+="</tbody></table>"+(j?"</div>"+(g[0]>0&&N==g[1]-1?'<div class="ui-datepicker-row-break"></div>':""):""),M+=Q}K+=M}K+=x+($.browser.msie&&parseInt($.browser.version,10)<7&&!a.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':""),a._keyEvent=!1;return K},_generateMonthYearHeader:function(a,b,c,d,e,f,g,h){var i=this._get(a,"changeMonth"),j=this._get(a,"changeYear"),k=this -._get(a,"showMonthAfterYear"),l='<div class="ui-datepicker-title">',m="";if(f||!i)m+='<span class="ui-datepicker-month">'+g[b]+"</span>";else{var n=d&&d.getFullYear()==c,o=e&&e.getFullYear()==c;m+='<select class="ui-datepicker-month" onchange="DP_jQuery_'+dpuuid+".datepicker._selectMonthYear('#"+a.id+"', this, 'M');\" "+">";for(var p=0;p<12;p++)(!n||p>=d.getMonth())&&(!o||p<=e.getMonth())&&(m+='<option value="'+p+'"'+(p==b?' selected="selected"':"")+">"+h[p]+"</option>");m+="</select>"}k||(l+=m+(f||!i||!j?" ":""));if(!a.yearshtml){a.yearshtml="";if(f||!j)l+='<span class="ui-datepicker-year">'+c+"</span>";else{var q=this._get(a,"yearRange").split(":"),r=(new Date).getFullYear(),s=function(a){var b=a.match(/c[+-].*/)?c+parseInt(a.substring(1),10):a.match(/[+-].*/)?r+parseInt(a,10):parseInt(a,10);return isNaN(b)?r:b},t=s(q[0]),u=Math.max(t,s(q[1]||""));t=d?Math.max(t,d.getFullYear()):t,u=e?Math.min(u,e.getFullYear()):u,a.yearshtml+='<select class="ui-datepicker-year" onchange="DP_jQuery_'+dpuuid+".datepicker._selectMonthYear('#"+a.id+"', this, 'Y');\" "+">";for(;t<=u;t++)a.yearshtml+='<option value="'+t+'"'+(t==c?' selected="selected"':"")+">"+t+"</option>";a.yearshtml+="</select>",l+=a.yearshtml,a.yearshtml=null}}l+=this._get(a,"yearSuffix"),k&&(l+=(f||!i||!j?" ":"")+m),l+="</div>";return l},_adjustInstDate:function(a,b,c){var d=a.drawYear+(c=="Y"?b:0),e=a.drawMonth+(c=="M"?b:0),f=Math.min(a.selectedDay,this._getDaysInMonth(d,e))+(c=="D"?b:0),g=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(d,e,f)));a.selectedDay=g.getDate(),a.drawMonth=a.selectedMonth=g.getMonth(),a.drawYear=a.selectedYear=g.getFullYear(),(c=="M"||c=="Y")&&this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max"),e=c&&b<c?c:b;e=d&&e>d?d:e;return e},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");b&&b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){var b=this._get(a,"numberOfMonths");return b==null?[1,1]:typeof b=="number"?[1,b]:b},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,d){var e=this._getNumberOfMonths(a),f=this._daylightSavingAdjust(new Date(c,d+(b<0?b:e[0]*e[1]),1));b<0&&f.setDate(this._getDaysInMonth(f.getFullYear(),f.getMonth()));return this._isInRange(a,f)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!d||b.getTime()<=d.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,d){b||(a.currentDay=a.selectedDay,a.currentMonth=a.selectedMonth,a.currentYear=a.selectedYear);var e=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(d,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),e,this._getFormatConfig(a))}}),$.fn.datepicker=function(a){if(!this.length)return this;$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv),$.datepicker.initialized=!0);var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return $.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return $.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b));return this.each(function(){typeof a=="string"?$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this].concat(b)):$.datepicker._attachDatepicker(this,a)})},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.8.17",window["DP_jQuery_"+dpuuid]=$})(jQuery);/* - * 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 - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - */(function(a,b){a.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()}),this.valueDiv=a("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this.oldValue=this._value(),this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove(),a.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===b)return this._value();this._setOption("value",a);return this},_setOption:function(b,c){b==="value"&&(this.options.value=c,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete")),a.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;typeof a!="number"&&(a=0);return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var a=this.value(),b=this._percentage();this.oldValue!==a&&(this.oldValue=a,this._trigger("change")),this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(b.toFixed(0)+"%"),this.element.attr("aria-valuenow",a)}}),a.extend(a.ui.progressbar,{version:"1.8.17"})})(jQuery);/* - * jQuery UI Effects 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/Effects/ - */jQuery.effects||function(a,b){function l(b){if(!b||typeof b=="number"||a.fx.speeds[b])return!0;if(typeof b=="string"&&!a.effects[b])return!0;return!1}function k(b,c,d,e){typeof b=="object"&&(e=c,d=null,c=b,b=c.effect),a.isFunction(c)&&(e=c,d=null,c={});if(typeof c=="number"||a.fx.speeds[c])e=d,d=c,c={};a.isFunction(d)&&(e=d,d=null),c=c||{},d=d||c.duration,d=a.fx.off?0:typeof d=="number"?d:d in a.fx.speeds?a.fx.speeds[d]:a.fx.speeds._default,e=e||c.complete;return[b,c,d,e]}function j(a,b){var c={_:0},d;for(d in b)a[d]!=b[d]&&(c[d]=b[d]);return c}function i(b){var c,d;for(c in b)d=b[c],(d==null||a.isFunction(d)||c in g||/scrollbar/.test(c)||!/color/i.test(c)&&isNaN(parseFloat(d)))&&delete b[c];return b}function h(){var a=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,b={},c,d;if(a&&a.length&&a[0]&&a[a[0]]){var e=a.length;while(e--)c=a[e],typeof a[c]=="string"&&(d=c.replace(/\-(\w)/g,function(a,b){return b.toUpperCase()}),b[d]=a[c])}else for(c in a)typeof a[c]=="string"&&(b[c]=a[c]);return b}function d(b,d){var e;do{e=a.curCSS(b,d);if(e!=""&&e!="transparent"||a.nodeName(b,"body"))break;d="backgroundColor"}while(b=b.parentNode);return c(e)}function c(b){var c;if(b&&b.constructor==Array&&b.length==3)return b;if(c=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(b))return[parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)];if(c=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(b))return[parseFloat(c[1])*2.55,parseFloat(c[2])*2.55,parseFloat(c[3])*2.55];if(c=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(b))return[parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)];if(c=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(b))return[parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)];if(c=/rgba\(0, 0, 0, 0\)/.exec(b))return e.transparent;return e[a.trim(b).toLowerCase()]}a.effects={},a.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","borderColor","color","outlineColor"],function(b,e){a.fx.step[e]=function(a){a.colorInit||(a.start=d(a.elem,e),a.end=c(a.end),a.colorInit=!0),a.elem.style[e]="rgb("+Math.max(Math.min(parseInt(a.pos*(a.end[0]-a.start[0])+a.start[0],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[1]-a.start[1])+a.start[1],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[2]-a.start[2])+a.start[2],10),255),0)+")"}});var e={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},f=["add","remove","toggle"],g={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};a.effects.animateClass=function(b,c,d,e){a.isFunction(d)&&(e=d,d=null);return this.queue(function(){var g=a(this),k=g.attr("style")||" ",l=i(h.call(this)),m,n=g.attr("class");a.each(f,function(a,c){b[c]&&g[c+"Class"](b[c])}),m=i(h.call(this)),g.attr("class",n),g.animate(j(l,m),{queue:!1,duration:c,easing:d,complete:function(){a.each(f,function(a,c){b[c]&&g[c+"Class"](b[c])}),typeof g.attr("style")=="object"?(g.attr("style").cssText="",g.attr("style").cssText=k):g.attr("style",k),e&&e.apply(this,arguments),a.dequeue(this)}})})},a.fn.extend({_addClass:a.fn.addClass,addClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{add:b},c,d,e]):this._addClass(b)},_removeClass:a.fn.removeClass,removeClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{remove:b},c,d,e]):this._removeClass(b)},_toggleClass:a.fn.toggleClass,toggleClass:function(c,d,e,f,g){return typeof d=="boolean"||d===b?e?a.effects.animateClass.apply(this,[d?{add:c}:{remove:c},e,f,g]):this._toggleClass(c,d):a.effects.animateClass.apply(this,[{toggle:c},d,e,f])},switchClass:function(b,c,d,e,f){return a.effects.animateClass.apply(this,[{add:c,remove:b},d,e,f])}}),a.extend(a.effects,{version:"1.8.17",save:function(a,b){for(var c=0;c<b.length;c++)b[c]!==null&&a.data("ec.storage."+b[c],a[0].style[b[c]])},restore:function(a,b){for(var c=0;c<b.length;c++)b[c]!==null&&a.css(b[c],a.data("ec.storage."+b[c]))},setMode:function(a,b){b=="toggle"&&(b=a.is(":hidden")?"show":"hide");return b},getBaseline:function(a,b){var c,d;switch(a[0]){case"top":c=0;break;case"middle":c=.5;break;case"bottom":c=1;break;default:c=a[0]/b.height}switch(a[1]){case"left":d=0;break;case"center":d=.5;break;case"right":d=1;break;default:d=a[1]/b.width}return{x:d,y:c}},createWrapper:function(b){if(b.parent().is(".ui-effects-wrapper"))return b.parent();var c={width:b.outerWidth(!0),height:b.outerHeight(!0),"float":b.css("float")},d=a("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e=document.activeElement;b.wrap(d),(b[0]===e||a.contains(b[0],e))&&a(e).focus(),d=b.parent(),b.css("position")=="static"?(d.css({position:"relative"}),b.css({position:"relative"})):(a.extend(c,{position:b.css("position"),zIndex:b.css("z-index")}),a.each(["top","left","bottom","right"],function(a,d){c[d]=b.css(d),isNaN(parseInt(c[d],10))&&(c[d]="auto")}),b.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"}));return d.css(c).show()},removeWrapper:function(b){var c,d=document.activeElement;if(b.parent().is(".ui-effects-wrapper")){c=b.parent().replaceWith(b),(b[0]===d||a.contains(b[0],d))&&a(d).focus();return c}return b},setTransition:function(b,c,d,e){e=e||{},a.each(c,function(a,c){unit=b.cssUnit(c),unit[0]>0&&(e[c]=unit[0]*d+unit[1])});return e}}),a.fn.extend({effect:function(b,c,d,e){var f=k.apply(this,arguments),g={options:f[1],duration:f[2],callback:f[3]},h=g.options.mode,i=a.effects[b];if(a.fx.off||!i)return h?this[h](g.duration,g.callback):this.each(function(){g.callback&&g.callback.call(this)});return i.call(this,g)},_show:a.fn.show,show:function(a){if(l(a))return this._show.apply(this,arguments);var b=k.apply(this,arguments);b[1].mode="show";return this.effect.apply(this,b)},_hide:a.fn.hide,hide:function(a){if(l(a))return this._hide.apply(this,arguments);var b=k.apply(this,arguments);b[1].mode="hide";return this.effect.apply(this,b)},__toggle:a.fn.toggle,toggle:function(b){if(l(b)||typeof b=="boolean"||a.isFunction(b))return this.__toggle.apply(this,arguments);var c=k.apply(this,arguments);c[1].mode="toggle";return this.effect.apply(this,c)},cssUnit:function(b){var c=this.css(b),d=[];a.each(["em","px","%","pt"],function(a,b){c.indexOf(b)>0&&(d=[parseFloat(c),b])});return d}}),a.easing.jswing=a.easing.swing,a.extend(a.easing,{def:"easeOutQuad",swing:function(b,c,d,e,f){return a.easing[a.easing.def](b,c,d,e,f)},easeInQuad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeInOutQuad:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b+c;return-d/2*(--b*(b-2)-1)+c},easeInCubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeOutCubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeInOutCubic:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b+c;return d/2*((b-=2)*b*b+2)+c},easeInQuart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeOutQuart:function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c},easeInOutQuart:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b+c;return-d/2*((b-=2)*b*b*b-2)+c},easeInQuint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeOutQuint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeInOutQuint:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b*b+c;return d/2*((b-=2)*b*b*b*b+2)+c},easeInSine:function(a,b,c,d,e){return-d*Math.cos(b/e*(Math.PI/2))+d+c},easeOutSine:function(a,b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c},easeInOutSine:function(a,b,c,d,e){return-d/2*(Math.cos(Math.PI*b/e)-1)+c},easeInExpo:function(a,b,c,d,e){return b==0?c:d*Math.pow(2,10*(b/e-1))+c},easeOutExpo:function(a,b,c,d,e){return b==e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c},easeInOutExpo:function(a,b,c,d,e){if(b==0)return c;if(b==e)return c+d;if((b/=e/2)<1)return d/2*Math.pow(2,10*(b-1))+c;return d/2*(-Math.pow(2,-10*--b)+2)+c},easeInCirc:function(a,b,c,d,e){return-d*(Math.sqrt(1-(b/=e)*b)-1)+c},easeOutCirc:function(a,b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c},easeInOutCirc:function(a,b,c,d,e){if((b/=e/2)<1)return-d/2*(Math.sqrt(1-b*b)-1)+c;return d/2*(Math.sqrt(1-(b-=2)*b)+1)+c},easeInElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e)==1)return c+d;g||(g=e*.3);if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);return-(h*Math.pow(2,10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g))+c},easeOutElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e)==1)return c+d;g||(g=e*.3);if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);return h*Math.pow(2,-10*b)*Math.sin((b*e-f)*2*Math.PI/g)+d+c},easeInOutElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e/2)==2)return c+d;g||(g=e*.3*1.5);if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);if(b<1)return-0.5*h*Math.pow(2,10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g)+c;return h*Math.pow(2,-10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g)*.5+d+c},easeInBack:function(a,c,d,e,f,g){g==b&&(g=1.70158);return e*(c/=f)*c*((g+1)*c-g)+d},easeOutBack:function(a,c,d,e,f,g){g==b&&(g=1.70158);return e*((c=c/f-1)*c*((g+1)*c+g)+1)+d},easeInOutBack:function(a,c,d,e,f,g){g==b&&(g=1.70158);if((c/=f/2)<1)return e/2*c*c*(((g*=1.525)+1)*c-g)+d;return e/2*((c-=2)*c*(((g*=1.525)+1)*c+g)+2)+d},easeInBounce:function(b,c,d,e,f){return e-a.easing.easeOutBounce(b,f-c,0,e,f)+d},easeOutBounce:function(a,b,c,d,e){return(b/=e)<1/2.75?d*7.5625*b*b+c:b<2/2.75?d*(7.5625*(b-=1.5/2.75)*b+.75)+c:b<2.5/2.75?d*(7.5625*(b-=2.25/2.75)*b+.9375)+c:d*(7.5625*(b-=2.625/2.75)*b+.984375)+c},easeInOutBounce:function(b,c,d,e,f){if(c<f/2)return a.easing.easeInBounce(b,c*2,0,e,f)*.5+d;return a.easing.easeOutBounce(b,c*2-f,0,e,f)*.5+e*.5+d}})}(jQuery);/* - * jQuery UI Effects Blind 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/Effects/Blind - * - * Depends: - * jquery.effects.core.js - */(function(a,b){a.effects.blind=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.direction||"vertical";a.effects.save(c,d),c.show();var g=a.effects.createWrapper(c).css({overflow:"hidden"}),h=f=="vertical"?"height":"width",i=f=="vertical"?g.height():g.width();e=="show"&&g.css(h,0);var j={};j[h]=e=="show"?i:0,g.animate(j,b.duration,b.options.easing,function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery);/* - * jQuery UI Effects Bounce 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/Effects/Bounce - * - * Depends: - * jquery.effects.core.js - */(function(a,b){a.effects.bounce=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"effect"),f=b.options.direction||"up",g=b.options.distance||20,h=b.options.times||5,i=b.duration||250;/show|hide/.test(e)&&d.push("opacity"),a.effects.save(c,d),c.show(),a.effects.createWrapper(c);var j=f=="up"||f=="down"?"top":"left",k=f=="up"||f=="left"?"pos":"neg",g=b.options.distance||(j=="top"?c.outerHeight({margin:!0})/3:c.outerWidth({margin:!0})/3);e=="show"&&c.css("opacity",0).css(j,k=="pos"?-g:g),e=="hide"&&(g=g/(h*2)),e!="hide"&&h--;if(e=="show"){var l={opacity:1};l[j]=(k=="pos"?"+=":"-=")+g,c.animate(l,i/2,b.options.easing),g=g/2,h--}for(var m=0;m<h;m++){var n={},p={};n[j]=(k=="pos"?"-=":"+=")+g,p[j]=(k=="pos"?"+=":"-=")+g,c.animate(n,i/2,b.options.easing).animate(p,i/2,b.options.easing),g=e=="hide"?g*2:g/2}if(e=="hide"){var l={opacity:0};l[j]=(k=="pos"?"-=":"+=")+g,c.animate(l,i/2,b.options.easing,function(){c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments)})}else{var n={},p={};n[j]=(k=="pos"?"-=":"+=")+g,p[j]=(k=="pos"?"+=":"-=")+g,c.animate(n,i/2,b.options.easing).animate(p,i/2,b.options.easing,function(){a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments)})}c.queue("fx",function(){c.dequeue()}),c.dequeue()})}})(jQuery);/* - * jQuery UI Effects Clip 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/Effects/Clip - * - * Depends: - * jquery.effects.core.js - */(function(a,b){a.effects.clip=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right","height","width"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.direction||"vertical";a.effects.save(c,d),c.show();var g=a.effects.createWrapper(c).css({overflow:"hidden"}),h=c[0].tagName=="IMG"?g:c,i={size:f=="vertical"?"height":"width",position:f=="vertical"?"top":"left"},j=f=="vertical"?h.height():h.width();e=="show"&&(h.css(i.size,0),h.css(i.position,j/2));var k={};k[i.size]=e=="show"?j:0,k[i.position]=e=="show"?0:j/2,h.animate(k,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()}})})}})(jQuery);/* - * jQuery UI Effects Drop 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/Effects/Drop - * - * Depends: - * jquery.effects.core.js - */(function(a,b){a.effects.drop=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right","opacity"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.direction||"left";a.effects.save(c,d),c.show(),a.effects.createWrapper(c);var g=f=="up"||f=="down"?"top":"left",h=f=="up"||f=="left"?"pos":"neg",i=b.options.distance||(g=="top"?c.outerHeight({margin:!0})/2:c.outerWidth({margin:!0})/2);e=="show"&&c.css("opacity",0).css(g,h=="pos"?-i:i);var j={opacity:e=="show"?1:0};j[g]=(e=="show"?h=="pos"?"+=":"-=":h=="pos"?"-=":"+=")+i,c.animate(j,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/* - * jQuery UI Effects Explode 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/Effects/Explode - * - * Depends: - * jquery.effects.core.js - */(function(a,b){a.effects.explode=function(b){return this.queue(function(){var c=b.options.pieces?Math.round(Math.sqrt(b.options.pieces)):3,d=b.options.pieces?Math.round(Math.sqrt(b.options.pieces)):3;b.options.mode=b.options.mode=="toggle"?a(this).is(":visible")?"hide":"show":b.options.mode;var e=a(this).show().css("visibility","hidden"),f=e.offset();f.top-=parseInt(e.css("marginTop"),10)||0,f.left-=parseInt(e.css("marginLeft"),10)||0;var g=e.outerWidth(!0),h=e.outerHeight(!0);for(var i=0;i<c;i++)for(var j=0;j<d;j++)e.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-j*(g/d),top:-i*(h/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:g/d,height:h/c,left:f.left+j*(g/d)+(b.options.mode=="show"?(j-Math.floor(d/2))*(g/d):0),top:f.top+i*(h/c)+(b.options.mode=="show"?(i-Math.floor(c/2))*(h/c):0),opacity:b.options.mode=="show"?0:1}).animate({left:f.left+j*(g/d)+(b.options.mode=="show"?0:(j-Math.floor(d/2))*(g/d)),top:f.top+i*(h/c)+(b.options.mode=="show"?0:(i-Math.floor(c/2))*(h/c)),opacity:b.options.mode=="show"?1:0},b.duration||500);setTimeout(function(){b.options.mode=="show"?e.css({visibility:"visible"}):e.css({visibility:"visible"}).hide(),b.callback&&b.callback.apply(e[0]),e.dequeue(),a("div.ui-effects-explode").remove()},b.duration||500)})}})(jQuery);/* - * jQuery UI Effects Fade 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/Effects/Fade - * - * Depends: - * jquery.effects.core.js - */(function(a,b){a.effects.fade=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"hide");c.animate({opacity:d},{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/* - * jQuery UI Effects Fold 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/Effects/Fold - * - * Depends: - * jquery.effects.core.js - */(function(a,b){a.effects.fold=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.size||15,g=!!b.options.horizFirst,h=b.duration?b.duration/2:a.fx.speeds._default/2;a.effects.save(c,d),c.show();var i=a.effects.createWrapper(c).css({overflow:"hidden"}),j=e=="show"!=g,k=j?["width","height"]:["height","width"],l=j?[i.width(),i.height()]:[i.height(),i.width()],m=/([0-9]+)%/.exec(f);m&&(f=parseInt(m[1],10)/100*l[e=="hide"?0:1]),e=="show"&&i.css(g?{height:0,width:f}:{height:f,width:0});var n={},p={};n[k[0]]=e=="show"?l[0]:f,p[k[1]]=e=="show"?l[1]:0,i.animate(n,h,b.options.easing).animate(p,h,b.options.easing,function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery);/* - * jQuery UI Effects Highlight 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/Effects/Highlight - * - * Depends: - * jquery.effects.core.js - */(function(a,b){a.effects.highlight=function(b){return this.queue(function(){var c=a(this),d=["backgroundImage","backgroundColor","opacity"],e=a.effects.setMode(c,b.options.mode||"show"),f={backgroundColor:c.css("backgroundColor")};e=="hide"&&(f.opacity=0),a.effects.save(c,d),c.show().css({backgroundImage:"none",backgroundColor:b.options.color||"#ffff99"}).animate(f,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),e=="show"&&!a.support.opacity&&this.style.removeAttribute("filter"),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/* - * jQuery UI Effects Pulsate 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/Effects/Pulsate - * - * Depends: - * jquery.effects.core.js - */(function(a,b){a.effects.pulsate=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"show");times=(b.options.times||5)*2-1,duration=b.duration?b.duration/2:a.fx.speeds._default/2,isVisible=c.is(":visible"),animateTo=0,isVisible||(c.css("opacity",0).show(),animateTo=1),(d=="hide"&&isVisible||d=="show"&&!isVisible)&×--;for(var e=0;e<times;e++)c.animate({opacity:animateTo},duration,b.options.easing),animateTo=(animateTo+1)%2;c.animate({opacity:animateTo},duration,b.options.easing,function(){animateTo==0&&c.hide(),b.callback&&b.callback.apply(this,arguments)}),c.queue("fx",function(){c.dequeue()}).dequeue()})}})(jQuery);/* - * jQuery UI Effects Scale 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/Effects/Scale - * - * Depends: - * jquery.effects.core.js - */(function(a,b){a.effects.puff=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"hide"),e=parseInt(b.options.percent,10)||150,f=e/100,g={height:c.height(),width:c.width()};a.extend(b.options,{fade:!0,mode:d,percent:d=="hide"?e:100,from:d=="hide"?g:{height:g.height*f,width:g.width*f}}),c.effect("scale",b.options,b.duration,b.callback),c.dequeue()})},a.effects.scale=function(b){return this.queue(function(){var c=a(this),d=a.extend(!0,{},b.options),e=a.effects.setMode(c,b.options.mode||"effect"),f=parseInt(b.options.percent,10)||(parseInt(b.options.percent,10)==0?0:e=="hide"?0:100),g=b.options.direction||"both",h=b.options.origin;e!="effect"&&(d.origin=h||["middle","center"],d.restore=!0);var i={height:c.height(),width:c.width()};c.from=b.options.from||(e=="show"?{height:0,width:0}:i);var j={y:g!="horizontal"?f/100:1,x:g!="vertical"?f/100:1};c.to={height:i.height*j.y,width:i.width*j.x},b.options.fade&&(e=="show"&&(c.from.opacity=0,c.to.opacity=1),e=="hide"&&(c.from.opacity=1,c.to.opacity=0)),d.from=c.from,d.to=c.to,d.mode=e,c.effect("size",d,b.duration,b.callback),c.dequeue()})},a.effects.size=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right","width","height","overflow","opacity"],e=["position","top","bottom","left","right","overflow","opacity"],f=["width","height","overflow"],g=["fontSize"],h=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],i=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],j=a.effects.setMode(c,b.options.mode||"effect"),k=b.options.restore||!1,l=b.options.scale||"both",m=b.options.origin,n={height:c.height(),width:c.width()};c.from=b.options.from||n,c.to=b.options.to||n;if(m){var p=a.effects.getBaseline(m,n);c.from.top=(n.height-c.from.height)*p.y,c.from.left=(n.width-c.from.width)*p.x,c.to.top=(n.height-c.to.height)*p.y,c.to.left=(n.width-c.to.width)*p.x}var q={from:{y:c.from.height/n.height,x:c.from.width/n.width},to:{y:c.to.height/n.height,x:c.to.width/n.width}};if(l=="box"||l=="both")q.from.y!=q.to.y&&(d=d.concat(h),c.from=a.effects.setTransition(c,h,q.from.y,c.from),c.to=a.effects.setTransition(c,h,q.to.y,c.to)),q.from.x!=q.to.x&&(d=d.concat(i),c.from=a.effects.setTransition(c,i,q.from.x,c.from),c.to=a.effects.setTransition(c,i,q.to.x,c.to));(l=="content"||l=="both")&&q.from.y!=q.to.y&&(d=d.concat(g),c.from=a.effects.setTransition(c,g,q.from.y,c.from),c.to=a.effects.setTransition(c,g,q.to.y,c.to)),a.effects.save(c,k?d:e),c.show(),a.effects.createWrapper(c),c.css("overflow","hidden").css(c.from);if(l=="content"||l=="both")h=h.concat(["marginTop","marginBottom"]).concat(g),i=i.concat(["marginLeft","marginRight"]),f=d.concat(h).concat(i),c.find("*[width]").each(function(){child=a(this),k&&a.effects.save(child,f);var c={height:child.height(),width:child.width()};child.from={height:c.height*q.from.y,width:c.width*q.from.x},child.to={height:c.height*q.to.y,width:c.width*q.to.x},q.from.y!=q.to.y&&(child.from=a.effects.setTransition(child,h,q.from.y,child.from),child.to=a.effects.setTransition(child,h,q.to.y,child.to)),q.from.x!=q.to.x&&(child.from=a.effects.setTransition(child,i,q.from.x,child.from),child.to=a.effects.setTransition(child,i,q.to.x,child.to)),child.css(child.from),child.animate(child.to,b.duration,b.options.easing,function(){k&&a.effects.restore(child,f)})});c.animate(c.to,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){c.to.opacity===0&&c.css("opacity",c.from.opacity),j=="hide"&&c.hide(),a.effects.restore(c,k?d:e),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/* - * jQuery UI Effects Shake 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/Effects/Shake - * - * Depends: - * jquery.effects.core.js - */(function(a,b){a.effects.shake=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"effect"),f=b.options.direction||"left",g=b.options.distance||20,h=b.options.times||3,i=b.duration||b.options.duration||140;a.effects.save(c,d),c.show(),a.effects.createWrapper(c);var j=f=="up"||f=="down"?"top":"left",k=f=="up"||f=="left"?"pos":"neg",l={},m={},n={};l[j]=(k=="pos"?"-=":"+=")+g,m[j]=(k=="pos"?"+=":"-=")+g*2,n[j]=(k=="pos"?"-=":"+=")+g*2,c.animate(l,i,b.options.easing);for(var p=1;p<h;p++)c.animate(m,i,b.options.easing).animate(n,i,b.options.easing);c.animate(m,i,b.options.easing).animate(l,i/2,b.options.easing,function(){a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments)}),c.queue("fx",function(){c.dequeue()}),c.dequeue()})}})(jQuery);/* - * jQuery UI Effects Slide 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/Effects/Slide - * - * Depends: - * jquery.effects.core.js - */(function(a,b){a.effects.slide=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"show"),f=b.options.direction||"left";a.effects.save(c,d),c.show(),a.effects.createWrapper(c).css({overflow:"hidden"});var g=f=="up"||f=="down"?"top":"left",h=f=="up"||f=="left"?"pos":"neg",i=b.options.distance||(g=="top"?c.outerHeight({margin:!0}):c.outerWidth({margin:!0}));e=="show"&&c.css(g,h=="pos"?isNaN(i)?"-"+i:-i:i);var j={};j[g]=(e=="show"?h=="pos"?"+=":"-=":h=="pos"?"-=":"+=")+i,c.animate(j,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/* - * jQuery UI Effects Transfer 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/Effects/Transfer - * - * Depends: - * jquery.effects.core.js - */(function(a,b){a.effects.transfer=function(b){return this.queue(function(){var c=a(this),d=a(b.options.to),e=d.offset(),f={top:e.top,left:e.left,height:d.innerHeight(),width:d.innerWidth()},g=c.offset(),h=a('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(b.options.className).css({top:g.top,left:g.left,height:c.innerHeight(),width:c.innerWidth(),position:"absolute"}).animate(f,b.duration,b.options.easing,function(){h.remove(),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery);
\ No newline at end of file diff --git a/addons/web/static/lib/jquery.ui/js/jquery-ui-1.9.1.custom.js b/addons/web/static/lib/jquery.ui/js/jquery-ui-1.9.1.custom.js new file mode 100644 index 00000000000..8ff02b23145 --- /dev/null +++ b/addons/web/static/lib/jquery.ui/js/jquery-ui-1.9.1.custom.js @@ -0,0 +1,14823 @@ +/*! jQuery UI - v1.9.1 - 2012-10-29 +* http://jqueryui.com +* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.position.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.sortable.js, jquery.ui.accordion.js, jquery.ui.autocomplete.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.dialog.js, jquery.ui.menu.js, jquery.ui.progressbar.js, jquery.ui.slider.js, jquery.ui.spinner.js, jquery.ui.tabs.js, jquery.ui.tooltip.js, jquery.ui.effect.js, jquery.ui.effect-blind.js, jquery.ui.effect-bounce.js, jquery.ui.effect-clip.js, jquery.ui.effect-drop.js, jquery.ui.effect-explode.js, jquery.ui.effect-fade.js, jquery.ui.effect-fold.js, jquery.ui.effect-highlight.js, jquery.ui.effect-pulsate.js, jquery.ui.effect-scale.js, jquery.ui.effect-shake.js, jquery.ui.effect-slide.js, jquery.ui.effect-transfer.js +* Copyright (c) 2012 jQuery Foundation and other contributors Licensed MIT */ + +(function( $, undefined ) { + +var uuid = 0, + runiqueId = /^ui-id-\d+$/; + +// prevent duplicate loading +// this is only a problem because we proxy existing functions +// and we don't want to double proxy them +$.ui = $.ui || {}; +if ( $.ui.version ) { + return; +} + +$.extend( $.ui, { + version: "1.9.1", + + keyCode: { + BACKSPACE: 8, + COMMA: 188, + DELETE: 46, + DOWN: 40, + END: 35, + ENTER: 13, + ESCAPE: 27, + HOME: 36, + LEFT: 37, + NUMPAD_ADD: 107, + NUMPAD_DECIMAL: 110, + NUMPAD_DIVIDE: 111, + NUMPAD_ENTER: 108, + NUMPAD_MULTIPLY: 106, + NUMPAD_SUBTRACT: 109, + PAGE_DOWN: 34, + PAGE_UP: 33, + PERIOD: 190, + RIGHT: 39, + SPACE: 32, + TAB: 9, + UP: 38 + } +}); + +// plugins +$.fn.extend({ + _focus: $.fn.focus, + focus: function( delay, fn ) { + return typeof delay === "number" ? + this.each(function() { + var elem = this; + setTimeout(function() { + $( elem ).focus(); + if ( fn ) { + fn.call( elem ); + } + }, delay ); + }) : + this._focus.apply( this, arguments ); + }, + + scrollParent: function() { + var scrollParent; + if (($.ui.ie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) { + scrollParent = this.parents().filter(function() { + return (/(relative|absolute|fixed)/).test($.css(this,'position')) && (/(auto|scroll)/).test($.css(this,'overflow')+$.css(this,'overflow-y')+$.css(this,'overflow-x')); + }).eq(0); + } else { + scrollParent = this.parents().filter(function() { + return (/(auto|scroll)/).test($.css(this,'overflow')+$.css(this,'overflow-y')+$.css(this,'overflow-x')); + }).eq(0); + } + + return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent; + }, + + zIndex: function( zIndex ) { + if ( zIndex !== undefined ) { + return this.css( "zIndex", zIndex ); + } + + if ( this.length ) { + var elem = $( this[ 0 ] ), position, value; + while ( elem.length && elem[ 0 ] !== document ) { + // Ignore z-index if position is set to a value where z-index is ignored by the browser + // This makes behavior of this function consistent across browsers + // WebKit always returns auto if the element is positioned + position = elem.css( "position" ); + if ( position === "absolute" || position === "relative" || position === "fixed" ) { + // IE returns 0 when zIndex is not specified + // other browsers return a string + // we ignore the case of nested elements with an explicit value of 0 + // <div style="z-index: -10;"><div style="z-index: 0;"></div></div> + value = parseInt( elem.css( "zIndex" ), 10 ); + if ( !isNaN( value ) && value !== 0 ) { + return value; + } + } + elem = elem.parent(); + } + } + + return 0; + }, + + uniqueId: function() { + return this.each(function() { + if ( !this.id ) { + this.id = "ui-id-" + (++uuid); + } + }); + }, + + removeUniqueId: function() { + return this.each(function() { + if ( runiqueId.test( this.id ) ) { + $( this ).removeAttr( "id" ); + } + }); + } +}); + +// support: jQuery <1.8 +if ( !$( "<a>" ).outerWidth( 1 ).jquery ) { + $.each( [ "Width", "Height" ], function( i, name ) { + var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ], + type = name.toLowerCase(), + orig = { + innerWidth: $.fn.innerWidth, + innerHeight: $.fn.innerHeight, + outerWidth: $.fn.outerWidth, + outerHeight: $.fn.outerHeight + }; + + function reduce( elem, size, border, margin ) { + $.each( side, function() { + size -= parseFloat( $.css( elem, "padding" + this ) ) || 0; + if ( border ) { + size -= parseFloat( $.css( elem, "border" + this + "Width" ) ) || 0; + } + if ( margin ) { + size -= parseFloat( $.css( elem, "margin" + this ) ) || 0; + } + }); + return size; + } + + $.fn[ "inner" + name ] = function( size ) { + if ( size === undefined ) { + return orig[ "inner" + name ].call( this ); + } + + return this.each(function() { + $( this ).css( type, reduce( this, size ) + "px" ); + }); + }; + + $.fn[ "outer" + name] = function( size, margin ) { + if ( typeof size !== "number" ) { + return orig[ "outer" + name ].call( this, size ); + } + + return this.each(function() { + $( this).css( type, reduce( this, size, true, margin ) + "px" ); + }); + }; + }); +} + +// selectors +function focusable( element, isTabIndexNotNaN ) { + var map, mapName, img, + nodeName = element.nodeName.toLowerCase(); + if ( "area" === nodeName ) { + map = element.parentNode; + mapName = map.name; + if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) { + return false; + } + img = $( "img[usemap=#" + mapName + "]" )[0]; + return !!img && visible( img ); + } + return ( /input|select|textarea|button|object/.test( nodeName ) ? + !element.disabled : + "a" === nodeName ? + element.href || isTabIndexNotNaN : + isTabIndexNotNaN) && + // the element and all of its ancestors must be visible + visible( element ); +} + +function visible( element ) { + return $.expr.filters.visible( element ) && + !$( element ).parents().andSelf().filter(function() { + return $.css( this, "visibility" ) === "hidden"; + }).length; +} + +$.extend( $.expr[ ":" ], { + data: $.expr.createPseudo ? + $.expr.createPseudo(function( dataName ) { + return function( elem ) { + return !!$.data( elem, dataName ); + }; + }) : + // support: jQuery <1.8 + function( elem, i, match ) { + return !!$.data( elem, match[ 3 ] ); + }, + + focusable: function( element ) { + return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) ); + }, + + tabbable: function( element ) { + var tabIndex = $.attr( element, "tabindex" ), + isTabIndexNaN = isNaN( tabIndex ); + return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN ); + } +}); + +// support +$(function() { + var body = document.body, + div = body.appendChild( div = document.createElement( "div" ) ); + + // access offsetHeight before setting the style to prevent a layout bug + // in IE 9 which causes the element to continue to take up space even + // after it is removed from the DOM (#8026) + div.offsetHeight; + + $.extend( div.style, { + minHeight: "100px", + height: "auto", + padding: 0, + borderWidth: 0 + }); + + $.support.minHeight = div.offsetHeight === 100; + $.support.selectstart = "onselectstart" in div; + + // set display to none to avoid a layout bug in IE + // http://dev.jquery.com/ticket/4014 + body.removeChild( div ).style.display = "none"; +}); + + + + + +// deprecated + +(function() { + var uaMatch = /msie ([\w.]+)/.exec( navigator.userAgent.toLowerCase() ) || []; + $.ui.ie = uaMatch.length ? true : false; + $.ui.ie6 = parseFloat( uaMatch[ 1 ], 10 ) === 6; +})(); + +$.fn.extend({ + disableSelection: function() { + return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) + + ".ui-disableSelection", function( event ) { + event.preventDefault(); + }); + }, + + enableSelection: function() { + return this.unbind( ".ui-disableSelection" ); + } +}); + +$.extend( $.ui, { + // $.ui.plugin is deprecated. Use the proxy pattern instead. + plugin: { + add: function( module, option, set ) { + var i, + proto = $.ui[ module ].prototype; + for ( i in set ) { + proto.plugins[ i ] = proto.plugins[ i ] || []; + proto.plugins[ i ].push( [ option, set[ i ] ] ); + } + }, + call: function( instance, name, args ) { + var i, + set = instance.plugins[ name ]; + if ( !set || !instance.element[ 0 ].parentNode || instance.element[ 0 ].parentNode.nodeType === 11 ) { + return; + } + + for ( i = 0; i < set.length; i++ ) { + if ( instance.options[ set[ i ][ 0 ] ] ) { + set[ i ][ 1 ].apply( instance.element, args ); + } + } + } + }, + + contains: $.contains, + + // only used by resizable + hasScroll: function( el, a ) { + + //If overflow is hidden, the element might have extra content, but the user wants to hide it + if ( $( el ).css( "overflow" ) === "hidden") { + return false; + } + + var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop", + has = false; + + if ( el[ scroll ] > 0 ) { + return true; + } + + // TODO: determine which cases actually cause this to happen + // if the element doesn't have the scroll set, see if it's possible to + // set the scroll + el[ scroll ] = 1; + has = ( el[ scroll ] > 0 ); + el[ scroll ] = 0; + return has; + }, + + // these are odd functions, fix the API or move into individual plugins + isOverAxis: function( x, reference, size ) { + //Determines when x coordinate is over "b" element axis + return ( x > reference ) && ( x < ( reference + size ) ); + }, + isOver: function( y, x, top, left, height, width ) { + //Determines when x, y coordinates is over "b" element + return $.ui.isOverAxis( y, top, height ) && $.ui.isOverAxis( x, left, width ); + } +}); + +})( jQuery ); +(function( $, undefined ) { + +var uuid = 0, + slice = Array.prototype.slice, + _cleanData = $.cleanData; +$.cleanData = function( elems ) { + for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { + try { + $( elem ).triggerHandler( "remove" ); + // http://bugs.jquery.com/ticket/8235 + } catch( e ) {} + } + _cleanData( elems ); +}; + +$.widget = function( name, base, prototype ) { + var fullName, existingConstructor, constructor, basePrototype, + namespace = name.split( "." )[ 0 ]; + + name = name.split( "." )[ 1 ]; + fullName = namespace + "-" + name; + + if ( !prototype ) { + prototype = base; + base = $.Widget; + } + + // create selector for plugin + $.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) { + return !!$.data( elem, fullName ); + }; + + $[ namespace ] = $[ namespace ] || {}; + existingConstructor = $[ namespace ][ name ]; + constructor = $[ namespace ][ name ] = function( options, element ) { + // allow instantiation without "new" keyword + if ( !this._createWidget ) { + return new constructor( options, element ); + } + + // allow instantiation without initializing for simple inheritance + // must use "new" keyword (the code above always passes args) + if ( arguments.length ) { + this._createWidget( options, element ); + } + }; + // extend with the existing constructor to carry over any static properties + $.extend( constructor, existingConstructor, { + version: prototype.version, + // copy the object used to create the prototype in case we need to + // redefine the widget later + _proto: $.extend( {}, prototype ), + // track widgets that inherit from this widget in case this widget is + // redefined after a widget inherits from it + _childConstructors: [] + }); + + basePrototype = new base(); + // we need to make the options hash a property directly on the new instance + // otherwise we'll modify the options hash on the prototype that we're + // inheriting from + basePrototype.options = $.widget.extend( {}, basePrototype.options ); + $.each( prototype, function( prop, value ) { + if ( $.isFunction( value ) ) { + prototype[ prop ] = (function() { + var _super = function() { + return base.prototype[ prop ].apply( this, arguments ); + }, + _superApply = function( args ) { + return base.prototype[ prop ].apply( this, args ); + }; + return function() { + var __super = this._super, + __superApply = this._superApply, + returnValue; + + this._super = _super; + this._superApply = _superApply; + + returnValue = value.apply( this, arguments ); + + this._super = __super; + this._superApply = __superApply; + + return returnValue; + }; + })(); + } + }); + constructor.prototype = $.widget.extend( basePrototype, { + // TODO: remove support for widgetEventPrefix + // always use the name + a colon as the prefix, e.g., draggable:start + // don't prefix for widgets that aren't DOM-based + widgetEventPrefix: basePrototype.widgetEventPrefix || name + }, prototype, { + constructor: constructor, + namespace: namespace, + widgetName: name, + // TODO remove widgetBaseClass, see #8155 + widgetBaseClass: fullName, + widgetFullName: fullName + }); + + // If this widget is being redefined then we need to find all widgets that + // are inheriting from it and redefine all of them so that they inherit from + // the new version of this widget. We're essentially trying to replace one + // level in the prototype chain. + if ( existingConstructor ) { + $.each( existingConstructor._childConstructors, function( i, child ) { + var childPrototype = child.prototype; + + // redefine the child widget using the same prototype that was + // originally used, but inherit from the new version of the base + $.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto ); + }); + // remove the list of existing child constructors from the old constructor + // so the old child constructors can be garbage collected + delete existingConstructor._childConstructors; + } else { + base._childConstructors.push( constructor ); + } + + $.widget.bridge( name, constructor ); +}; + +$.widget.extend = function( target ) { + var input = slice.call( arguments, 1 ), + inputIndex = 0, + inputLength = input.length, + key, + value; + for ( ; inputIndex < inputLength; inputIndex++ ) { + for ( key in input[ inputIndex ] ) { + value = input[ inputIndex ][ key ]; + if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) { + // Clone objects + if ( $.isPlainObject( value ) ) { + target[ key ] = $.isPlainObject( target[ key ] ) ? + $.widget.extend( {}, target[ key ], value ) : + // Don't extend strings, arrays, etc. with objects + $.widget.extend( {}, value ); + // Copy everything else by reference + } else { + target[ key ] = value; + } + } + } + } + return target; +}; + +$.widget.bridge = function( name, object ) { + var fullName = object.prototype.widgetFullName; + $.fn[ name ] = function( options ) { + var isMethodCall = typeof options === "string", + args = slice.call( arguments, 1 ), + returnValue = this; + + // allow multiple hashes to be passed on init + options = !isMethodCall && args.length ? + $.widget.extend.apply( null, [ options ].concat(args) ) : + options; + + if ( isMethodCall ) { + this.each(function() { + var methodValue, + instance = $.data( this, fullName ); + if ( !instance ) { + return $.error( "cannot call methods on " + name + " prior to initialization; " + + "attempted to call method '" + options + "'" ); + } + if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) { + return $.error( "no such method '" + options + "' for " + name + " widget instance" ); + } + methodValue = instance[ options ].apply( instance, args ); + if ( methodValue !== instance && methodValue !== undefined ) { + returnValue = methodValue && methodValue.jquery ? + returnValue.pushStack( methodValue.get() ) : + methodValue; + return false; + } + }); + } else { + this.each(function() { + var instance = $.data( this, fullName ); + if ( instance ) { + instance.option( options || {} )._init(); + } else { + new object( options, this ); + } + }); + } + + return returnValue; + }; +}; + +$.Widget = function( /* options, element */ ) {}; +$.Widget._childConstructors = []; + +$.Widget.prototype = { + widgetName: "widget", + widgetEventPrefix: "", + defaultElement: "<div>", + options: { + disabled: false, + + // callbacks + create: null + }, + _createWidget: function( options, element ) { + element = $( element || this.defaultElement || this )[ 0 ]; + this.element = $( element ); + this.uuid = uuid++; + this.eventNamespace = "." + this.widgetName + this.uuid; + this.options = $.widget.extend( {}, + this.options, + this._getCreateOptions(), + options ); + + this.bindings = $(); + this.hoverable = $(); + this.focusable = $(); + + if ( element !== this ) { + // 1.9 BC for #7810 + // TODO remove dual storage + $.data( element, this.widgetName, this ); + $.data( element, this.widgetFullName, this ); + this._on( this.element, { + remove: function( event ) { + if ( event.target === element ) { + this.destroy(); + } + } + }); + this.document = $( element.style ? + // element within the document + element.ownerDocument : + // element is window or document + element.document || element ); + this.window = $( this.document[0].defaultView || this.document[0].parentWindow ); + } + + this._create(); + this._trigger( "create", null, this._getCreateEventData() ); + this._init(); + }, + _getCreateOptions: $.noop, + _getCreateEventData: $.noop, + _create: $.noop, + _init: $.noop, + + destroy: function() { + this._destroy(); + // we can probably remove the unbind calls in 2.0 + // all event bindings should go through this._on() + this.element + .unbind( this.eventNamespace ) + // 1.9 BC for #7810 + // TODO remove dual storage + .removeData( this.widgetName ) + .removeData( this.widgetFullName ) + // support: jquery <1.6.3 + // http://bugs.jquery.com/ticket/9413 + .removeData( $.camelCase( this.widgetFullName ) ); + this.widget() + .unbind( this.eventNamespace ) + .removeAttr( "aria-disabled" ) + .removeClass( + this.widgetFullName + "-disabled " + + "ui-state-disabled" ); + + // clean up events and states + this.bindings.unbind( this.eventNamespace ); + this.hoverable.removeClass( "ui-state-hover" ); + this.focusable.removeClass( "ui-state-focus" ); + }, + _destroy: $.noop, + + widget: function() { + return this.element; + }, + + option: function( key, value ) { + var options = key, + parts, + curOption, + i; + + if ( arguments.length === 0 ) { + // don't return a reference to the internal hash + return $.widget.extend( {}, this.options ); + } + + if ( typeof key === "string" ) { + // handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } } + options = {}; + parts = key.split( "." ); + key = parts.shift(); + if ( parts.length ) { + curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] ); + for ( i = 0; i < parts.length - 1; i++ ) { + curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {}; + curOption = curOption[ parts[ i ] ]; + } + key = parts.pop(); + if ( value === undefined ) { + return curOption[ key ] === undefined ? null : curOption[ key ]; + } + curOption[ key ] = value; + } else { + if ( value === undefined ) { + return this.options[ key ] === undefined ? null : this.options[ key ]; + } + options[ key ] = value; + } + } + + this._setOptions( options ); + + return this; + }, + _setOptions: function( options ) { + var key; + + for ( key in options ) { + this._setOption( key, options[ key ] ); + } + + return this; + }, + _setOption: function( key, value ) { + this.options[ key ] = value; + + if ( key === "disabled" ) { + this.widget() + .toggleClass( this.widgetFullName + "-disabled ui-state-disabled", !!value ) + .attr( "aria-disabled", value ); + this.hoverable.removeClass( "ui-state-hover" ); + this.focusable.removeClass( "ui-state-focus" ); + } + + return this; + }, + + enable: function() { + return this._setOption( "disabled", false ); + }, + disable: function() { + return this._setOption( "disabled", true ); + }, + + _on: function( element, handlers ) { + var delegateElement, + instance = this; + // no element argument, shuffle and use this.element + if ( !handlers ) { + handlers = element; + element = this.element; + delegateElement = this.widget(); + } else { + // accept selectors, DOM elements + element = delegateElement = $( element ); + this.bindings = this.bindings.add( element ); + } + + $.each( handlers, function( event, handler ) { + function handlerProxy() { + // allow widgets to customize the disabled handling + // - disabled as an array instead of boolean + // - disabled class as method for disabling individual parts + if ( instance.options.disabled === true || + $( this ).hasClass( "ui-state-disabled" ) ) { + return; + } + return ( typeof handler === "string" ? instance[ handler ] : handler ) + .apply( instance, arguments ); + } + + // copy the guid so direct unbinding works + if ( typeof handler !== "string" ) { + handlerProxy.guid = handler.guid = + handler.guid || handlerProxy.guid || $.guid++; + } + + var match = event.match( /^(\w+)\s*(.*)$/ ), + eventName = match[1] + instance.eventNamespace, + selector = match[2]; + if ( selector ) { + delegateElement.delegate( selector, eventName, handlerProxy ); + } else { + element.bind( eventName, handlerProxy ); + } + }); + }, + + _off: function( element, eventName ) { + eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) + this.eventNamespace; + element.unbind( eventName ).undelegate( eventName ); + }, + + _delay: function( handler, delay ) { + function handlerProxy() { + return ( typeof handler === "string" ? instance[ handler ] : handler ) + .apply( instance, arguments ); + } + var instance = this; + return setTimeout( handlerProxy, delay || 0 ); + }, + + _hoverable: function( element ) { + this.hoverable = this.hoverable.add( element ); + this._on( element, { + mouseenter: function( event ) { + $( event.currentTarget ).addClass( "ui-state-hover" ); + }, + mouseleave: function( event ) { + $( event.currentTarget ).removeClass( "ui-state-hover" ); + } + }); + }, + + _focusable: function( element ) { + this.focusable = this.focusable.add( element ); + this._on( element, { + focusin: function( event ) { + $( event.currentTarget ).addClass( "ui-state-focus" ); + }, + focusout: function( event ) { + $( event.currentTarget ).removeClass( "ui-state-focus" ); + } + }); + }, + + _trigger: function( type, event, data ) { + var prop, orig, + callback = this.options[ type ]; + + data = data || {}; + event = $.Event( event ); + event.type = ( type === this.widgetEventPrefix ? + type : + this.widgetEventPrefix + type ).toLowerCase(); + // the original event may come from any element + // so we need to reset the target on the new event + event.target = this.element[ 0 ]; + + // copy original event properties over to the new event + orig = event.originalEvent; + if ( orig ) { + for ( prop in orig ) { + if ( !( prop in event ) ) { + event[ prop ] = orig[ prop ]; + } + } + } + + this.element.trigger( event, data ); + return !( $.isFunction( callback ) && + callback.apply( this.element[0], [ event ].concat( data ) ) === false || + event.isDefaultPrevented() ); + } +}; + +$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) { + $.Widget.prototype[ "_" + method ] = function( element, options, callback ) { + if ( typeof options === "string" ) { + options = { effect: options }; + } + var hasOptions, + effectName = !options ? + method : + options === true || typeof options === "number" ? + defaultEffect : + options.effect || defaultEffect; + options = options || {}; + if ( typeof options === "number" ) { + options = { duration: options }; + } + hasOptions = !$.isEmptyObject( options ); + options.complete = callback; + if ( options.delay ) { + element.delay( options.delay ); + } + if ( hasOptions && $.effects && ( $.effects.effect[ effectName ] || $.uiBackCompat !== false && $.effects[ effectName ] ) ) { + element[ method ]( options ); + } else if ( effectName !== method && element[ effectName ] ) { + element[ effectName ]( options.duration, options.easing, callback ); + } else { + element.queue(function( next ) { + $( this )[ method ](); + if ( callback ) { + callback.call( element[ 0 ] ); + } + next(); + }); + } + }; +}); + +// DEPRECATED +if ( $.uiBackCompat !== false ) { + $.Widget.prototype._getCreateOptions = function() { + return $.metadata && $.metadata.get( this.element[0] )[ this.widgetName ]; + }; +} + +})( jQuery ); +(function( $, undefined ) { + +var mouseHandled = false; +$( document ).mouseup( function( e ) { + mouseHandled = false; +}); + +$.widget("ui.mouse", { + version: "1.9.1", + options: { + cancel: 'input,textarea,button,select,option', + distance: 1, + delay: 0 + }, + _mouseInit: function() { + var that = this; + + this.element + .bind('mousedown.'+this.widgetName, function(event) { + return that._mouseDown(event); + }) + .bind('click.'+this.widgetName, function(event) { + if (true === $.data(event.target, that.widgetName + '.preventClickEvent')) { + $.removeData(event.target, that.widgetName + '.preventClickEvent'); + event.stopImmediatePropagation(); + return false; + } + }); + + this.started = false; + }, + + // TODO: make sure destroying one instance of mouse doesn't mess with + // other instances of mouse + _mouseDestroy: function() { + this.element.unbind('.'+this.widgetName); + if ( this._mouseMoveDelegate ) { + $(document) + .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate) + .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate); + } + }, + + _mouseDown: function(event) { + // don't let more than one widget handle mouseStart + if( mouseHandled ) { return; } + + // we may have missed mouseup (out of window) + (this._mouseStarted && this._mouseUp(event)); + + this._mouseDownEvent = event; + + var that = this, + btnIsLeft = (event.which === 1), + // event.target.nodeName works around a bug in IE 8 with + // disabled inputs (#7620) + elIsCancel = (typeof this.options.cancel === "string" && event.target.nodeName ? $(event.target).closest(this.options.cancel).length : false); + if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) { + return true; + } + + this.mouseDelayMet = !this.options.delay; + if (!this.mouseDelayMet) { + this._mouseDelayTimer = setTimeout(function() { + that.mouseDelayMet = true; + }, this.options.delay); + } + + if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { + this._mouseStarted = (this._mouseStart(event) !== false); + if (!this._mouseStarted) { + event.preventDefault(); + return true; + } + } + + // Click event may never have fired (Gecko & Opera) + if (true === $.data(event.target, this.widgetName + '.preventClickEvent')) { + $.removeData(event.target, this.widgetName + '.preventClickEvent'); + } + + // these delegates are required to keep context + this._mouseMoveDelegate = function(event) { + return that._mouseMove(event); + }; + this._mouseUpDelegate = function(event) { + return that._mouseUp(event); + }; + $(document) + .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate) + .bind('mouseup.'+this.widgetName, this._mouseUpDelegate); + + event.preventDefault(); + + mouseHandled = true; + return true; + }, + + _mouseMove: function(event) { + // IE mouseup check - mouseup happened when mouse was out of window + if ($.ui.ie && !(document.documentMode >= 9) && !event.button) { + return this._mouseUp(event); + } + + if (this._mouseStarted) { + this._mouseDrag(event); + return event.preventDefault(); + } + + if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { + this._mouseStarted = + (this._mouseStart(this._mouseDownEvent, event) !== false); + (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event)); + } + + return !this._mouseStarted; + }, + + _mouseUp: function(event) { + $(document) + .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate) + .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate); + + if (this._mouseStarted) { + this._mouseStarted = false; + + if (event.target === this._mouseDownEvent.target) { + $.data(event.target, this.widgetName + '.preventClickEvent', true); + } + + this._mouseStop(event); + } + + return false; + }, + + _mouseDistanceMet: function(event) { + return (Math.max( + Math.abs(this._mouseDownEvent.pageX - event.pageX), + Math.abs(this._mouseDownEvent.pageY - event.pageY) + ) >= this.options.distance + ); + }, + + _mouseDelayMet: function(event) { + return this.mouseDelayMet; + }, + + // These are placeholder methods, to be overriden by extending plugin + _mouseStart: function(event) {}, + _mouseDrag: function(event) {}, + _mouseStop: function(event) {}, + _mouseCapture: function(event) { return true; } +}); + +})(jQuery); +(function( $, undefined ) { + +$.ui = $.ui || {}; + +var cachedScrollbarWidth, + max = Math.max, + abs = Math.abs, + round = Math.round, + rhorizontal = /left|center|right/, + rvertical = /top|center|bottom/, + roffset = /[\+\-]\d+%?/, + rposition = /^\w+/, + rpercent = /%$/, + _position = $.fn.position; + +function getOffsets( offsets, width, height ) { + return [ + parseInt( offsets[ 0 ], 10 ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ), + parseInt( offsets[ 1 ], 10 ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 ) + ]; +} +function parseCss( element, property ) { + return parseInt( $.css( element, property ), 10 ) || 0; +} + +$.position = { + scrollbarWidth: function() { + if ( cachedScrollbarWidth !== undefined ) { + return cachedScrollbarWidth; + } + var w1, w2, + div = $( "<div style='display:block;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>" ), + innerDiv = div.children()[0]; + + $( "body" ).append( div ); + w1 = innerDiv.offsetWidth; + div.css( "overflow", "scroll" ); + + w2 = innerDiv.offsetWidth; + + if ( w1 === w2 ) { + w2 = div[0].clientWidth; + } + + div.remove(); + + return (cachedScrollbarWidth = w1 - w2); + }, + getScrollInfo: function( within ) { + var overflowX = within.isWindow ? "" : within.element.css( "overflow-x" ), + overflowY = within.isWindow ? "" : within.element.css( "overflow-y" ), + hasOverflowX = overflowX === "scroll" || + ( overflowX === "auto" && within.width < within.element[0].scrollWidth ), + hasOverflowY = overflowY === "scroll" || + ( overflowY === "auto" && within.height < within.element[0].scrollHeight ); + return { + width: hasOverflowX ? $.position.scrollbarWidth() : 0, + height: hasOverflowY ? $.position.scrollbarWidth() : 0 + }; + }, + getWithinInfo: function( element ) { + var withinElement = $( element || window ), + isWindow = $.isWindow( withinElement[0] ); + return { + element: withinElement, + isWindow: isWindow, + offset: withinElement.offset() || { left: 0, top: 0 }, + scrollLeft: withinElement.scrollLeft(), + scrollTop: withinElement.scrollTop(), + width: isWindow ? withinElement.width() : withinElement.outerWidth(), + height: isWindow ? withinElement.height() : withinElement.outerHeight() + }; + } +}; + +$.fn.position = function( options ) { + if ( !options || !options.of ) { + return _position.apply( this, arguments ); + } + + // make a copy, we don't want to modify arguments + options = $.extend( {}, options ); + + var atOffset, targetWidth, targetHeight, targetOffset, basePosition, + target = $( options.of ), + within = $.position.getWithinInfo( options.within ), + scrollInfo = $.position.getScrollInfo( within ), + targetElem = target[0], + collision = ( options.collision || "flip" ).split( " " ), + offsets = {}; + + if ( targetElem.nodeType === 9 ) { + targetWidth = target.width(); + targetHeight = target.height(); + targetOffset = { top: 0, left: 0 }; + } else if ( $.isWindow( targetElem ) ) { + targetWidth = target.width(); + targetHeight = target.height(); + targetOffset = { top: target.scrollTop(), left: target.scrollLeft() }; + } else if ( targetElem.preventDefault ) { + // force left top to allow flipping + options.at = "left top"; + targetWidth = targetHeight = 0; + targetOffset = { top: targetElem.pageY, left: targetElem.pageX }; + } else { + targetWidth = target.outerWidth(); + targetHeight = target.outerHeight(); + targetOffset = target.offset(); + } + // clone to reuse original targetOffset later + basePosition = $.extend( {}, targetOffset ); + + // force my and at to have valid horizontal and vertical positions + // if a value is missing or invalid, it will be converted to center + $.each( [ "my", "at" ], function() { + var pos = ( options[ this ] || "" ).split( " " ), + horizontalOffset, + verticalOffset; + + if ( pos.length === 1) { + pos = rhorizontal.test( pos[ 0 ] ) ? + pos.concat( [ "center" ] ) : + rvertical.test( pos[ 0 ] ) ? + [ "center" ].concat( pos ) : + [ "center", "center" ]; + } + pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center"; + pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center"; + + // calculate offsets + horizontalOffset = roffset.exec( pos[ 0 ] ); + verticalOffset = roffset.exec( pos[ 1 ] ); + offsets[ this ] = [ + horizontalOffset ? horizontalOffset[ 0 ] : 0, + verticalOffset ? verticalOffset[ 0 ] : 0 + ]; + + // reduce to just the positions without the offsets + options[ this ] = [ + rposition.exec( pos[ 0 ] )[ 0 ], + rposition.exec( pos[ 1 ] )[ 0 ] + ]; + }); + + // normalize collision option + if ( collision.length === 1 ) { + collision[ 1 ] = collision[ 0 ]; + } + + if ( options.at[ 0 ] === "right" ) { + basePosition.left += targetWidth; + } else if ( options.at[ 0 ] === "center" ) { + basePosition.left += targetWidth / 2; + } + + if ( options.at[ 1 ] === "bottom" ) { + basePosition.top += targetHeight; + } else if ( options.at[ 1 ] === "center" ) { + basePosition.top += targetHeight / 2; + } + + atOffset = getOffsets( offsets.at, targetWidth, targetHeight ); + basePosition.left += atOffset[ 0 ]; + basePosition.top += atOffset[ 1 ]; + + return this.each(function() { + var collisionPosition, using, + elem = $( this ), + elemWidth = elem.outerWidth(), + elemHeight = elem.outerHeight(), + marginLeft = parseCss( this, "marginLeft" ), + marginTop = parseCss( this, "marginTop" ), + collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) + scrollInfo.width, + collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) + scrollInfo.height, + position = $.extend( {}, basePosition ), + myOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() ); + + if ( options.my[ 0 ] === "right" ) { + position.left -= elemWidth; + } else if ( options.my[ 0 ] === "center" ) { + position.left -= elemWidth / 2; + } + + if ( options.my[ 1 ] === "bottom" ) { + position.top -= elemHeight; + } else if ( options.my[ 1 ] === "center" ) { + position.top -= elemHeight / 2; + } + + position.left += myOffset[ 0 ]; + position.top += myOffset[ 1 ]; + + // if the browser doesn't support fractions, then round for consistent results + if ( !$.support.offsetFractions ) { + position.left = round( position.left ); + position.top = round( position.top ); + } + + collisionPosition = { + marginLeft: marginLeft, + marginTop: marginTop + }; + + $.each( [ "left", "top" ], function( i, dir ) { + if ( $.ui.position[ collision[ i ] ] ) { + $.ui.position[ collision[ i ] ][ dir ]( position, { + targetWidth: targetWidth, + targetHeight: targetHeight, + elemWidth: elemWidth, + elemHeight: elemHeight, + collisionPosition: collisionPosition, + collisionWidth: collisionWidth, + collisionHeight: collisionHeight, + offset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ], + my: options.my, + at: options.at, + within: within, + elem : elem + }); + } + }); + + if ( $.fn.bgiframe ) { + elem.bgiframe(); + } + + if ( options.using ) { + // adds feedback as second argument to using callback, if present + using = function( props ) { + var left = targetOffset.left - position.left, + right = left + targetWidth - elemWidth, + top = targetOffset.top - position.top, + bottom = top + targetHeight - elemHeight, + feedback = { + target: { + element: target, + left: targetOffset.left, + top: targetOffset.top, + width: targetWidth, + height: targetHeight + }, + element: { + element: elem, + left: position.left, + top: position.top, + width: elemWidth, + height: elemHeight + }, + horizontal: right < 0 ? "left" : left > 0 ? "right" : "center", + vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle" + }; + if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) { + feedback.horizontal = "center"; + } + if ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) { + feedback.vertical = "middle"; + } + if ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) { + feedback.important = "horizontal"; + } else { + feedback.important = "vertical"; + } + options.using.call( this, props, feedback ); + }; + } + + elem.offset( $.extend( position, { using: using } ) ); + }); +}; + +$.ui.position = { + fit: { + left: function( position, data ) { + var within = data.within, + withinOffset = within.isWindow ? within.scrollLeft : within.offset.left, + outerWidth = within.width, + collisionPosLeft = position.left - data.collisionPosition.marginLeft, + overLeft = withinOffset - collisionPosLeft, + overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset, + newOverRight; + + // element is wider than within + if ( data.collisionWidth > outerWidth ) { + // element is initially over the left side of within + if ( overLeft > 0 && overRight <= 0 ) { + newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset; + position.left += overLeft - newOverRight; + // element is initially over right side of within + } else if ( overRight > 0 && overLeft <= 0 ) { + position.left = withinOffset; + // element is initially over both left and right sides of within + } else { + if ( overLeft > overRight ) { + position.left = withinOffset + outerWidth - data.collisionWidth; + } else { + position.left = withinOffset; + } + } + // too far left -> align with left edge + } else if ( overLeft > 0 ) { + position.left += overLeft; + // too far right -> align with right edge + } else if ( overRight > 0 ) { + position.left -= overRight; + // adjust based on position and margin + } else { + position.left = max( position.left - collisionPosLeft, position.left ); + } + }, + top: function( position, data ) { + var within = data.within, + withinOffset = within.isWindow ? within.scrollTop : within.offset.top, + outerHeight = data.within.height, + collisionPosTop = position.top - data.collisionPosition.marginTop, + overTop = withinOffset - collisionPosTop, + overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset, + newOverBottom; + + // element is taller than within + if ( data.collisionHeight > outerHeight ) { + // element is initially over the top of within + if ( overTop > 0 && overBottom <= 0 ) { + newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset; + position.top += overTop - newOverBottom; + // element is initially over bottom of within + } else if ( overBottom > 0 && overTop <= 0 ) { + position.top = withinOffset; + // element is initially over both top and bottom of within + } else { + if ( overTop > overBottom ) { + position.top = withinOffset + outerHeight - data.collisionHeight; + } else { + position.top = withinOffset; + } + } + // too far up -> align with top + } else if ( overTop > 0 ) { + position.top += overTop; + // too far down -> align with bottom edge + } else if ( overBottom > 0 ) { + position.top -= overBottom; + // adjust based on position and margin + } else { + position.top = max( position.top - collisionPosTop, position.top ); + } + } + }, + flip: { + left: function( position, data ) { + var within = data.within, + withinOffset = within.offset.left + within.scrollLeft, + outerWidth = within.width, + offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left, + collisionPosLeft = position.left - data.collisionPosition.marginLeft, + overLeft = collisionPosLeft - offsetLeft, + overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft, + myOffset = data.my[ 0 ] === "left" ? + -data.elemWidth : + data.my[ 0 ] === "right" ? + data.elemWidth : + 0, + atOffset = data.at[ 0 ] === "left" ? + data.targetWidth : + data.at[ 0 ] === "right" ? + -data.targetWidth : + 0, + offset = -2 * data.offset[ 0 ], + newOverRight, + newOverLeft; + + if ( overLeft < 0 ) { + newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset; + if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) { + position.left += myOffset + atOffset + offset; + } + } + else if ( overRight > 0 ) { + newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft; + if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) { + position.left += myOffset + atOffset + offset; + } + } + }, + top: function( position, data ) { + var within = data.within, + withinOffset = within.offset.top + within.scrollTop, + outerHeight = within.height, + offsetTop = within.isWindow ? within.scrollTop : within.offset.top, + collisionPosTop = position.top - data.collisionPosition.marginTop, + overTop = collisionPosTop - offsetTop, + overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop, + top = data.my[ 1 ] === "top", + myOffset = top ? + -data.elemHeight : + data.my[ 1 ] === "bottom" ? + data.elemHeight : + 0, + atOffset = data.at[ 1 ] === "top" ? + data.targetHeight : + data.at[ 1 ] === "bottom" ? + -data.targetHeight : + 0, + offset = -2 * data.offset[ 1 ], + newOverTop, + newOverBottom; + if ( overTop < 0 ) { + newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset; + if ( ( position.top + myOffset + atOffset + offset) > overTop && ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) ) { + position.top += myOffset + atOffset + offset; + } + } + else if ( overBottom > 0 ) { + newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop; + if ( ( position.top + myOffset + atOffset + offset) > overBottom && ( newOverTop > 0 || abs( newOverTop ) < overBottom ) ) { + position.top += myOffset + atOffset + offset; + } + } + } + }, + flipfit: { + left: function() { + $.ui.position.flip.left.apply( this, arguments ); + $.ui.position.fit.left.apply( this, arguments ); + }, + top: function() { + $.ui.position.flip.top.apply( this, arguments ); + $.ui.position.fit.top.apply( this, arguments ); + } + } +}; + +// fraction support test +(function () { + var testElement, testElementParent, testElementStyle, offsetLeft, i, + body = document.getElementsByTagName( "body" )[ 0 ], + div = document.createElement( "div" ); + + //Create a "fake body" for testing based on method used in jQuery.support + testElement = document.createElement( body ? "div" : "body" ); + testElementStyle = { + visibility: "hidden", + width: 0, + height: 0, + border: 0, + margin: 0, + background: "none" + }; + if ( body ) { + $.extend( testElementStyle, { + position: "absolute", + left: "-1000px", + top: "-1000px" + }); + } + for ( i in testElementStyle ) { + testElement.style[ i ] = testElementStyle[ i ]; + } + testElement.appendChild( div ); + testElementParent = body || document.documentElement; + testElementParent.insertBefore( testElement, testElementParent.firstChild ); + + div.style.cssText = "position: absolute; left: 10.7432222px;"; + + offsetLeft = $( div ).offset().left; + $.support.offsetFractions = offsetLeft > 10 && offsetLeft < 11; + + testElement.innerHTML = ""; + testElementParent.removeChild( testElement ); +})(); + +// DEPRECATED +if ( $.uiBackCompat !== false ) { + // offset option + (function( $ ) { + var _position = $.fn.position; + $.fn.position = function( options ) { + if ( !options || !options.offset ) { + return _position.call( this, options ); + } + var offset = options.offset.split( " " ), + at = options.at.split( " " ); + if ( offset.length === 1 ) { + offset[ 1 ] = offset[ 0 ]; + } + if ( /^\d/.test( offset[ 0 ] ) ) { + offset[ 0 ] = "+" + offset[ 0 ]; + } + if ( /^\d/.test( offset[ 1 ] ) ) { + offset[ 1 ] = "+" + offset[ 1 ]; + } + if ( at.length === 1 ) { + if ( /left|center|right/.test( at[ 0 ] ) ) { + at[ 1 ] = "center"; + } else { + at[ 1 ] = at[ 0 ]; + at[ 0 ] = "center"; + } + } + return _position.call( this, $.extend( options, { + at: at[ 0 ] + offset[ 0 ] + " " + at[ 1 ] + offset[ 1 ], + offset: undefined + } ) ); + }; + }( jQuery ) ); +} + +}( jQuery ) ); +(function( $, undefined ) { + +$.widget("ui.draggable", $.ui.mouse, { + version: "1.9.1", + widgetEventPrefix: "drag", + options: { + addClasses: true, + appendTo: "parent", + axis: false, + connectToSortable: false, + containment: false, + cursor: "auto", + cursorAt: false, + grid: false, + handle: false, + helper: "original", + iframeFix: false, + opacity: false, + refreshPositions: false, + revert: false, + revertDuration: 500, + scope: "default", + scroll: true, + scrollSensitivity: 20, + scrollSpeed: 20, + snap: false, + snapMode: "both", + snapTolerance: 20, + stack: false, + zIndex: false + }, + _create: function() { + + if (this.options.helper == 'original' && !(/^(?:r|a|f)/).test(this.element.css("position"))) + this.element[0].style.position = 'relative'; + + (this.options.addClasses && this.element.addClass("ui-draggable")); + (this.options.disabled && this.element.addClass("ui-draggable-disabled")); + + this._mouseInit(); + + }, + + _destroy: function() { + this.element.removeClass( "ui-draggable ui-draggable-dragging ui-draggable-disabled" ); + this._mouseDestroy(); + }, + + _mouseCapture: function(event) { + + var o = this.options; + + // among others, prevent a drag on a resizable-handle + if (this.helper || o.disabled || $(event.target).is('.ui-resizable-handle')) + return false; + + //Quit if we're not on a valid handle + this.handle = this._getHandle(event); + if (!this.handle) + return false; + + $(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() { + $('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>') + .css({ + width: this.offsetWidth+"px", height: this.offsetHeight+"px", + position: "absolute", opacity: "0.001", zIndex: 1000 + }) + .css($(this).offset()) + .appendTo("body"); + }); + + return true; + + }, + + _mouseStart: function(event) { + + var o = this.options; + + //Create and append the visible helper + this.helper = this._createHelper(event); + + this.helper.addClass("ui-draggable-dragging"); + + //Cache the helper size + this._cacheHelperProportions(); + + //If ddmanager is used for droppables, set the global draggable + if($.ui.ddmanager) + $.ui.ddmanager.current = this; + + /* + * - Position generation - + * This block generates everything position related - it's the core of draggables. + */ + + //Cache the margins of the original element + this._cacheMargins(); + + //Store the helper's css position + this.cssPosition = this.helper.css("position"); + this.scrollParent = this.helper.scrollParent(); + + //The element's absolute position on the page minus margins + this.offset = this.positionAbs = this.element.offset(); + this.offset = { + top: this.offset.top - this.margins.top, + left: this.offset.left - this.margins.left + }; + + $.extend(this.offset, { + click: { //Where the click happened, relative to the element + left: event.pageX - this.offset.left, + top: event.pageY - this.offset.top + }, + parent: this._getParentOffset(), + relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper + }); + + //Generate the original position + this.originalPosition = this.position = this._generatePosition(event); + this.originalPageX = event.pageX; + this.originalPageY = event.pageY; + + //Adjust the mouse offset relative to the helper if 'cursorAt' is supplied + (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt)); + + //Set a containment if given in the options + if(o.containment) + this._setContainment(); + + //Trigger event + callbacks + if(this._trigger("start", event) === false) { + this._clear(); + return false; + } + + //Recache the helper size + this._cacheHelperProportions(); + + //Prepare the droppable offsets + if ($.ui.ddmanager && !o.dropBehaviour) + $.ui.ddmanager.prepareOffsets(this, event); + + + this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position + + //If the ddmanager is used for droppables, inform the manager that dragging has started (see #5003) + if ( $.ui.ddmanager ) $.ui.ddmanager.dragStart(this, event); + + return true; + }, + + _mouseDrag: function(event, noPropagation) { + + //Compute the helpers position + this.position = this._generatePosition(event); + this.positionAbs = this._convertPositionTo("absolute"); + + //Call plugins and callbacks and use the resulting position if something is returned + if (!noPropagation) { + var ui = this._uiHash(); + if(this._trigger('drag', event, ui) === false) { + this._mouseUp({}); + return false; + } + this.position = ui.position; + } + + if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px'; + if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px'; + if($.ui.ddmanager) $.ui.ddmanager.drag(this, event); + + return false; + }, + + _mouseStop: function(event) { + + //If we are using droppables, inform the manager about the drop + var dropped = false; + if ($.ui.ddmanager && !this.options.dropBehaviour) + dropped = $.ui.ddmanager.drop(this, event); + + //if a drop comes from outside (a sortable) + if(this.dropped) { + dropped = this.dropped; + this.dropped = false; + } + + //if the original element is no longer in the DOM don't bother to continue (see #8269) + var element = this.element[0], elementInDom = false; + while ( element && (element = element.parentNode) ) { + if (element == document ) { + elementInDom = true; + } + } + if ( !elementInDom && this.options.helper === "original" ) + return false; + + if((this.options.revert == "invalid" && !dropped) || (this.options.revert == "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) { + var that = this; + $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() { + if(that._trigger("stop", event) !== false) { + that._clear(); + } + }); + } else { + if(this._trigger("stop", event) !== false) { + this._clear(); + } + } + + return false; + }, + + _mouseUp: function(event) { + //Remove frame helpers + $("div.ui-draggable-iframeFix").each(function() { + this.parentNode.removeChild(this); + }); + + //If the ddmanager is used for droppables, inform the manager that dragging has stopped (see #5003) + if( $.ui.ddmanager ) $.ui.ddmanager.dragStop(this, event); + + return $.ui.mouse.prototype._mouseUp.call(this, event); + }, + + cancel: function() { + + if(this.helper.is(".ui-draggable-dragging")) { + this._mouseUp({}); + } else { + this._clear(); + } + + return this; + + }, + + _getHandle: function(event) { + + var handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false; + $(this.options.handle, this.element) + .find("*") + .andSelf() + .each(function() { + if(this == event.target) handle = true; + }); + + return handle; + + }, + + _createHelper: function(event) { + + var o = this.options; + var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper == 'clone' ? this.element.clone().removeAttr('id') : this.element); + + if(!helper.parents('body').length) + helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo)); + + if(helper[0] != this.element[0] && !(/(fixed|absolute)/).test(helper.css("position"))) + helper.css("position", "absolute"); + + return helper; + + }, + + _adjustOffsetFromHelper: function(obj) { + if (typeof obj == 'string') { + obj = obj.split(' '); + } + if ($.isArray(obj)) { + obj = {left: +obj[0], top: +obj[1] || 0}; + } + if ('left' in obj) { + this.offset.click.left = obj.left + this.margins.left; + } + if ('right' in obj) { + this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left; + } + if ('top' in obj) { + this.offset.click.top = obj.top + this.margins.top; + } + if ('bottom' in obj) { + this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top; + } + }, + + _getParentOffset: function() { + + //Get the offsetParent and cache its position + this.offsetParent = this.helper.offsetParent(); + var po = this.offsetParent.offset(); + + // This is a special case where we need to modify a offset calculated on start, since the following happened: + // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent + // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that + // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag + if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) { + po.left += this.scrollParent.scrollLeft(); + po.top += this.scrollParent.scrollTop(); + } + + if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information + || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.ui.ie)) //Ugly IE fix + po = { top: 0, left: 0 }; + + return { + top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0), + left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0) + }; + + }, + + _getRelativeOffset: function() { + + if(this.cssPosition == "relative") { + var p = this.element.position(); + return { + top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(), + left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft() + }; + } else { + return { top: 0, left: 0 }; + } + + }, + + _cacheMargins: function() { + this.margins = { + left: (parseInt(this.element.css("marginLeft"),10) || 0), + top: (parseInt(this.element.css("marginTop"),10) || 0), + right: (parseInt(this.element.css("marginRight"),10) || 0), + bottom: (parseInt(this.element.css("marginBottom"),10) || 0) + }; + }, + + _cacheHelperProportions: function() { + this.helperProportions = { + width: this.helper.outerWidth(), + height: this.helper.outerHeight() + }; + }, + + _setContainment: function() { + + var o = this.options; + if(o.containment == 'parent') o.containment = this.helper[0].parentNode; + if(o.containment == 'document' || o.containment == 'window') this.containment = [ + o.containment == 'document' ? 0 : $(window).scrollLeft() - this.offset.relative.left - this.offset.parent.left, + o.containment == 'document' ? 0 : $(window).scrollTop() - this.offset.relative.top - this.offset.parent.top, + (o.containment == 'document' ? 0 : $(window).scrollLeft()) + $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left, + (o.containment == 'document' ? 0 : $(window).scrollTop()) + ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top + ]; + + if(!(/^(document|window|parent)$/).test(o.containment) && o.containment.constructor != Array) { + var c = $(o.containment); + var ce = c[0]; if(!ce) return; + var co = c.offset(); + var over = ($(ce).css("overflow") != 'hidden'); + + this.containment = [ + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0), + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0), + (over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left - this.margins.right, + (over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top - this.margins.bottom + ]; + this.relative_container = c; + + } else if(o.containment.constructor == Array) { + this.containment = o.containment; + } + + }, + + _convertPositionTo: function(d, pos) { + + if(!pos) pos = this.position; + var mod = d == "absolute" ? 1 : -1; + var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); + + return { + top: ( + pos.top // The absolute mouse position + + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent + + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border) + - ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod) + ), + left: ( + pos.left // The absolute mouse position + + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent + + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border) + - ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod) + ) + }; + + }, + + _generatePosition: function(event) { + + var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); + var pageX = event.pageX; + var pageY = event.pageY; + + /* + * - Position constraining - + * Constrain the position to a mix of grid, containment. + */ + + if(this.originalPosition) { //If we are not dragging yet, we won't check for options + var containment; + if(this.containment) { + if (this.relative_container){ + var co = this.relative_container.offset(); + containment = [ this.containment[0] + co.left, + this.containment[1] + co.top, + this.containment[2] + co.left, + this.containment[3] + co.top ]; + } + else { + containment = this.containment; + } + + if(event.pageX - this.offset.click.left < containment[0]) pageX = containment[0] + this.offset.click.left; + if(event.pageY - this.offset.click.top < containment[1]) pageY = containment[1] + this.offset.click.top; + if(event.pageX - this.offset.click.left > containment[2]) pageX = containment[2] + this.offset.click.left; + if(event.pageY - this.offset.click.top > containment[3]) pageY = containment[3] + this.offset.click.top; + } + + if(o.grid) { + //Check for grid elements set to 0 to prevent divide by 0 error causing invalid argument errors in IE (see ticket #6950) + var top = o.grid[1] ? this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1] : this.originalPageY; + pageY = containment ? (!(top - this.offset.click.top < containment[1] || top - this.offset.click.top > containment[3]) ? top : (!(top - this.offset.click.top < containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top; + + var left = o.grid[0] ? this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0] : this.originalPageX; + pageX = containment ? (!(left - this.offset.click.left < containment[0] || left - this.offset.click.left > containment[2]) ? left : (!(left - this.offset.click.left < containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left; + } + + } + + return { + top: ( + pageY // The absolute mouse position + - this.offset.click.top // Click offset (relative to the element) + - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent + - this.offset.parent.top // The offsetParent's offset without borders (offset + border) + + ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) )) + ), + left: ( + pageX // The absolute mouse position + - this.offset.click.left // Click offset (relative to the element) + - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent + - this.offset.parent.left // The offsetParent's offset without borders (offset + border) + + ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() )) + ) + }; + + }, + + _clear: function() { + this.helper.removeClass("ui-draggable-dragging"); + if(this.helper[0] != this.element[0] && !this.cancelHelperRemoval) this.helper.remove(); + //if($.ui.ddmanager) $.ui.ddmanager.current = null; + this.helper = null; + this.cancelHelperRemoval = false; + }, + + // From now on bulk stuff - mainly helpers + + _trigger: function(type, event, ui) { + ui = ui || this._uiHash(); + $.ui.plugin.call(this, type, [event, ui]); + if(type == "drag") this.positionAbs = this._convertPositionTo("absolute"); //The absolute position has to be recalculated after plugins + return $.Widget.prototype._trigger.call(this, type, event, ui); + }, + + plugins: {}, + + _uiHash: function(event) { + return { + helper: this.helper, + position: this.position, + originalPosition: this.originalPosition, + offset: this.positionAbs + }; + } + +}); + +$.ui.plugin.add("draggable", "connectToSortable", { + start: function(event, ui) { + + var inst = $(this).data("draggable"), o = inst.options, + uiSortable = $.extend({}, ui, { item: inst.element }); + inst.sortables = []; + $(o.connectToSortable).each(function() { + var sortable = $.data(this, 'sortable'); + if (sortable && !sortable.options.disabled) { + inst.sortables.push({ + instance: sortable, + shouldRevert: sortable.options.revert + }); + sortable.refreshPositions(); // Call the sortable's refreshPositions at drag start to refresh the containerCache since the sortable container cache is used in drag and needs to be up to date (this will ensure it's initialised as well as being kept in step with any changes that might have happened on the page). + sortable._trigger("activate", event, uiSortable); + } + }); + + }, + stop: function(event, ui) { + + //If we are still over the sortable, we fake the stop event of the sortable, but also remove helper + var inst = $(this).data("draggable"), + uiSortable = $.extend({}, ui, { item: inst.element }); + + $.each(inst.sortables, function() { + if(this.instance.isOver) { + + this.instance.isOver = 0; + + inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance + this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work) + + //The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: 'valid/invalid' + if(this.shouldRevert) this.instance.options.revert = true; + + //Trigger the stop of the sortable + this.instance._mouseStop(event); + + this.instance.options.helper = this.instance.options._helper; + + //If the helper has been the original item, restore properties in the sortable + if(inst.options.helper == 'original') + this.instance.currentItem.css({ top: 'auto', left: 'auto' }); + + } else { + this.instance.cancelHelperRemoval = false; //Remove the helper in the sortable instance + this.instance._trigger("deactivate", event, uiSortable); + } + + }); + + }, + drag: function(event, ui) { + + var inst = $(this).data("draggable"), that = this; + + var checkPos = function(o) { + var dyClick = this.offset.click.top, dxClick = this.offset.click.left; + var helperTop = this.positionAbs.top, helperLeft = this.positionAbs.left; + var itemHeight = o.height, itemWidth = o.width; + var itemTop = o.top, itemLeft = o.left; + + return $.ui.isOver(helperTop + dyClick, helperLeft + dxClick, itemTop, itemLeft, itemHeight, itemWidth); + }; + + $.each(inst.sortables, function(i) { + + var innermostIntersecting = false; + var thisSortable = this; + //Copy over some variables to allow calling the sortable's native _intersectsWith + this.instance.positionAbs = inst.positionAbs; + this.instance.helperProportions = inst.helperProportions; + this.instance.offset.click = inst.offset.click; + + if(this.instance._intersectsWith(this.instance.containerCache)) { + innermostIntersecting = true; + $.each(inst.sortables, function () { + this.instance.positionAbs = inst.positionAbs; + this.instance.helperProportions = inst.helperProportions; + this.instance.offset.click = inst.offset.click; + if (this != thisSortable + && this.instance._intersectsWith(this.instance.containerCache) + && $.ui.contains(thisSortable.instance.element[0], this.instance.element[0])) + innermostIntersecting = false; + return innermostIntersecting; + }); + } + + + if(innermostIntersecting) { + //If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once + if(!this.instance.isOver) { + + this.instance.isOver = 1; + //Now we fake the start of dragging for the sortable instance, + //by cloning the list group item, appending it to the sortable and using it as inst.currentItem + //We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one) + this.instance.currentItem = $(that).clone().removeAttr('id').appendTo(this.instance.element).data("sortable-item", true); + this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it + this.instance.options.helper = function() { return ui.helper[0]; }; + + event.target = this.instance.currentItem[0]; + this.instance._mouseCapture(event, true); + this.instance._mouseStart(event, true, true); + + //Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes + this.instance.offset.click.top = inst.offset.click.top; + this.instance.offset.click.left = inst.offset.click.left; + this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left; + this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top; + + inst._trigger("toSortable", event); + inst.dropped = this.instance.element; //draggable revert needs that + //hack so receive/update callbacks work (mostly) + inst.currentItem = inst.element; + this.instance.fromOutside = inst; + + } + + //Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable + if(this.instance.currentItem) this.instance._mouseDrag(event); + + } else { + + //If it doesn't intersect with the sortable, and it intersected before, + //we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval + if(this.instance.isOver) { + + this.instance.isOver = 0; + this.instance.cancelHelperRemoval = true; + + //Prevent reverting on this forced stop + this.instance.options.revert = false; + + // The out event needs to be triggered independently + this.instance._trigger('out', event, this.instance._uiHash(this.instance)); + + this.instance._mouseStop(event, true); + this.instance.options.helper = this.instance.options._helper; + + //Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size + this.instance.currentItem.remove(); + if(this.instance.placeholder) this.instance.placeholder.remove(); + + inst._trigger("fromSortable", event); + inst.dropped = false; //draggable revert needs that + } + + }; + + }); + + } +}); + +$.ui.plugin.add("draggable", "cursor", { + start: function(event, ui) { + var t = $('body'), o = $(this).data('draggable').options; + if (t.css("cursor")) o._cursor = t.css("cursor"); + t.css("cursor", o.cursor); + }, + stop: function(event, ui) { + var o = $(this).data('draggable').options; + if (o._cursor) $('body').css("cursor", o._cursor); + } +}); + +$.ui.plugin.add("draggable", "opacity", { + start: function(event, ui) { + var t = $(ui.helper), o = $(this).data('draggable').options; + if(t.css("opacity")) o._opacity = t.css("opacity"); + t.css('opacity', o.opacity); + }, + stop: function(event, ui) { + var o = $(this).data('draggable').options; + if(o._opacity) $(ui.helper).css('opacity', o._opacity); + } +}); + +$.ui.plugin.add("draggable", "scroll", { + start: function(event, ui) { + var i = $(this).data("draggable"); + if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') i.overflowOffset = i.scrollParent.offset(); + }, + drag: function(event, ui) { + + var i = $(this).data("draggable"), o = i.options, scrolled = false; + + if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') { + + if(!o.axis || o.axis != 'x') { + if((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) + i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed; + else if(event.pageY - i.overflowOffset.top < o.scrollSensitivity) + i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop - o.scrollSpeed; + } + + if(!o.axis || o.axis != 'y') { + if((i.overflowOffset.left + i.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) + i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft + o.scrollSpeed; + else if(event.pageX - i.overflowOffset.left < o.scrollSensitivity) + i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft - o.scrollSpeed; + } + + } else { + + if(!o.axis || o.axis != 'x') { + if(event.pageY - $(document).scrollTop() < o.scrollSensitivity) + scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed); + else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) + scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed); + } + + if(!o.axis || o.axis != 'y') { + if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity) + scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed); + else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) + scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed); + } + + } + + if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) + $.ui.ddmanager.prepareOffsets(i, event); + + } +}); + +$.ui.plugin.add("draggable", "snap", { + start: function(event, ui) { + + var i = $(this).data("draggable"), o = i.options; + i.snapElements = []; + + $(o.snap.constructor != String ? ( o.snap.items || ':data(draggable)' ) : o.snap).each(function() { + var $t = $(this); var $o = $t.offset(); + if(this != i.element[0]) i.snapElements.push({ + item: this, + width: $t.outerWidth(), height: $t.outerHeight(), + top: $o.top, left: $o.left + }); + }); + + }, + drag: function(event, ui) { + + var inst = $(this).data("draggable"), o = inst.options; + var d = o.snapTolerance; + + var x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width, + y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height; + + for (var i = inst.snapElements.length - 1; i >= 0; i--){ + + var l = inst.snapElements[i].left, r = l + inst.snapElements[i].width, + t = inst.snapElements[i].top, b = t + inst.snapElements[i].height; + + //Yes, I know, this is insane ;) + if(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) { + if(inst.snapElements[i].snapping) (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item }))); + inst.snapElements[i].snapping = false; + continue; + } + + if(o.snapMode != 'inner') { + var ts = Math.abs(t - y2) <= d; + var bs = Math.abs(b - y1) <= d; + var ls = Math.abs(l - x2) <= d; + var rs = Math.abs(r - x1) <= d; + if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top - inst.margins.top; + if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top - inst.margins.top; + if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left - inst.margins.left; + if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left - inst.margins.left; + } + + var first = (ts || bs || ls || rs); + + if(o.snapMode != 'outer') { + var ts = Math.abs(t - y1) <= d; + var bs = Math.abs(b - y2) <= d; + var ls = Math.abs(l - x1) <= d; + var rs = Math.abs(r - x2) <= d; + if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top - inst.margins.top; + if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top - inst.margins.top; + if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left - inst.margins.left; + if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left - inst.margins.left; + } + + if(!inst.snapElements[i].snapping && (ts || bs || ls || rs || first)) + (inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item }))); + inst.snapElements[i].snapping = (ts || bs || ls || rs || first); + + }; + + } +}); + +$.ui.plugin.add("draggable", "stack", { + start: function(event, ui) { + + var o = $(this).data("draggable").options; + + var group = $.makeArray($(o.stack)).sort(function(a,b) { + return (parseInt($(a).css("zIndex"),10) || 0) - (parseInt($(b).css("zIndex"),10) || 0); + }); + if (!group.length) { return; } + + var min = parseInt(group[0].style.zIndex) || 0; + $(group).each(function(i) { + this.style.zIndex = min + i; + }); + + this[0].style.zIndex = min + group.length; + + } +}); + +$.ui.plugin.add("draggable", "zIndex", { + start: function(event, ui) { + var t = $(ui.helper), o = $(this).data("draggable").options; + if(t.css("zIndex")) o._zIndex = t.css("zIndex"); + t.css('zIndex', o.zIndex); + }, + stop: function(event, ui) { + var o = $(this).data("draggable").options; + if(o._zIndex) $(ui.helper).css('zIndex', o._zIndex); + } +}); + +})(jQuery); +(function( $, undefined ) { + +$.widget("ui.droppable", { + version: "1.9.1", + widgetEventPrefix: "drop", + options: { + accept: '*', + activeClass: false, + addClasses: true, + greedy: false, + hoverClass: false, + scope: 'default', + tolerance: 'intersect' + }, + _create: function() { + + var o = this.options, accept = o.accept; + this.isover = 0; this.isout = 1; + + this.accept = $.isFunction(accept) ? accept : function(d) { + return d.is(accept); + }; + + //Store the droppable's proportions + this.proportions = { width: this.element[0].offsetWidth, height: this.element[0].offsetHeight }; + + // Add the reference and positions to the manager + $.ui.ddmanager.droppables[o.scope] = $.ui.ddmanager.droppables[o.scope] || []; + $.ui.ddmanager.droppables[o.scope].push(this); + + (o.addClasses && this.element.addClass("ui-droppable")); + + }, + + _destroy: function() { + var drop = $.ui.ddmanager.droppables[this.options.scope]; + for ( var i = 0; i < drop.length; i++ ) + if ( drop[i] == this ) + drop.splice(i, 1); + + this.element.removeClass("ui-droppable ui-droppable-disabled"); + }, + + _setOption: function(key, value) { + + if(key == 'accept') { + this.accept = $.isFunction(value) ? value : function(d) { + return d.is(value); + }; + } + $.Widget.prototype._setOption.apply(this, arguments); + }, + + _activate: function(event) { + var draggable = $.ui.ddmanager.current; + if(this.options.activeClass) this.element.addClass(this.options.activeClass); + (draggable && this._trigger('activate', event, this.ui(draggable))); + }, + + _deactivate: function(event) { + var draggable = $.ui.ddmanager.current; + if(this.options.activeClass) this.element.removeClass(this.options.activeClass); + (draggable && this._trigger('deactivate', event, this.ui(draggable))); + }, + + _over: function(event) { + + var draggable = $.ui.ddmanager.current; + if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element + + if (this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) { + if(this.options.hoverClass) this.element.addClass(this.options.hoverClass); + this._trigger('over', event, this.ui(draggable)); + } + + }, + + _out: function(event) { + + var draggable = $.ui.ddmanager.current; + if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element + + if (this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) { + if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass); + this._trigger('out', event, this.ui(draggable)); + } + + }, + + _drop: function(event,custom) { + + var draggable = custom || $.ui.ddmanager.current; + if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return false; // Bail if draggable and droppable are same element + + var childrenIntersection = false; + this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function() { + var inst = $.data(this, 'droppable'); + if( + inst.options.greedy + && !inst.options.disabled + && inst.options.scope == draggable.options.scope + && inst.accept.call(inst.element[0], (draggable.currentItem || draggable.element)) + && $.ui.intersect(draggable, $.extend(inst, { offset: inst.element.offset() }), inst.options.tolerance) + ) { childrenIntersection = true; return false; } + }); + if(childrenIntersection) return false; + + if(this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) { + if(this.options.activeClass) this.element.removeClass(this.options.activeClass); + if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass); + this._trigger('drop', event, this.ui(draggable)); + return this.element; + } + + return false; + + }, + + ui: function(c) { + return { + draggable: (c.currentItem || c.element), + helper: c.helper, + position: c.position, + offset: c.positionAbs + }; + } + +}); + +$.ui.intersect = function(draggable, droppable, toleranceMode) { + + if (!droppable.offset) return false; + + var x1 = (draggable.positionAbs || draggable.position.absolute).left, x2 = x1 + draggable.helperProportions.width, + y1 = (draggable.positionAbs || draggable.position.absolute).top, y2 = y1 + draggable.helperProportions.height; + var l = droppable.offset.left, r = l + droppable.proportions.width, + t = droppable.offset.top, b = t + droppable.proportions.height; + + switch (toleranceMode) { + case 'fit': + return (l <= x1 && x2 <= r + && t <= y1 && y2 <= b); + break; + case 'intersect': + return (l < x1 + (draggable.helperProportions.width / 2) // Right Half + && x2 - (draggable.helperProportions.width / 2) < r // Left Half + && t < y1 + (draggable.helperProportions.height / 2) // Bottom Half + && y2 - (draggable.helperProportions.height / 2) < b ); // Top Half + break; + case 'pointer': + var draggableLeft = ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left), + draggableTop = ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top), + isOver = $.ui.isOver(draggableTop, draggableLeft, t, l, droppable.proportions.height, droppable.proportions.width); + return isOver; + break; + case 'touch': + return ( + (y1 >= t && y1 <= b) || // Top edge touching + (y2 >= t && y2 <= b) || // Bottom edge touching + (y1 < t && y2 > b) // Surrounded vertically + ) && ( + (x1 >= l && x1 <= r) || // Left edge touching + (x2 >= l && x2 <= r) || // Right edge touching + (x1 < l && x2 > r) // Surrounded horizontally + ); + break; + default: + return false; + break; + } + +}; + +/* + This manager tracks offsets of draggables and droppables +*/ +$.ui.ddmanager = { + current: null, + droppables: { 'default': [] }, + prepareOffsets: function(t, event) { + + var m = $.ui.ddmanager.droppables[t.options.scope] || []; + var type = event ? event.type : null; // workaround for #2317 + var list = (t.currentItem || t.element).find(":data(droppable)").andSelf(); + + droppablesLoop: for (var i = 0; i < m.length; i++) { + + if(m[i].options.disabled || (t && !m[i].accept.call(m[i].element[0],(t.currentItem || t.element)))) continue; //No disabled and non-accepted + for (var j=0; j < list.length; j++) { if(list[j] == m[i].element[0]) { m[i].proportions.height = 0; continue droppablesLoop; } }; //Filter out elements in the current dragged item + m[i].visible = m[i].element.css("display") != "none"; if(!m[i].visible) continue; //If the element is not visible, continue + + if(type == "mousedown") m[i]._activate.call(m[i], event); //Activate the droppable if used directly from draggables + + m[i].offset = m[i].element.offset(); + m[i].proportions = { width: m[i].element[0].offsetWidth, height: m[i].element[0].offsetHeight }; + + } + + }, + drop: function(draggable, event) { + + var dropped = false; + $.each($.ui.ddmanager.droppables[draggable.options.scope] || [], function() { + + if(!this.options) return; + if (!this.options.disabled && this.visible && $.ui.intersect(draggable, this, this.options.tolerance)) + dropped = this._drop.call(this, event) || dropped; + + if (!this.options.disabled && this.visible && this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) { + this.isout = 1; this.isover = 0; + this._deactivate.call(this, event); + } + + }); + return dropped; + + }, + dragStart: function( draggable, event ) { + //Listen for scrolling so that if the dragging causes scrolling the position of the droppables can be recalculated (see #5003) + draggable.element.parentsUntil( "body" ).bind( "scroll.droppable", function() { + if( !draggable.options.refreshPositions ) $.ui.ddmanager.prepareOffsets( draggable, event ); + }); + }, + drag: function(draggable, event) { + + //If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse. + if(draggable.options.refreshPositions) $.ui.ddmanager.prepareOffsets(draggable, event); + + //Run through all droppables and check their positions based on specific tolerance options + $.each($.ui.ddmanager.droppables[draggable.options.scope] || [], function() { + + if(this.options.disabled || this.greedyChild || !this.visible) return; + var intersects = $.ui.intersect(draggable, this, this.options.tolerance); + + var c = !intersects && this.isover == 1 ? 'isout' : (intersects && this.isover == 0 ? 'isover' : null); + if(!c) return; + + var parentInstance; + if (this.options.greedy) { + // find droppable parents with same scope + var scope = this.options.scope; + var parent = this.element.parents(':data(droppable)').filter(function () { + return $.data(this, 'droppable').options.scope === scope; + }); + + if (parent.length) { + parentInstance = $.data(parent[0], 'droppable'); + parentInstance.greedyChild = (c == 'isover' ? 1 : 0); + } + } + + // we just moved into a greedy child + if (parentInstance && c == 'isover') { + parentInstance['isover'] = 0; + parentInstance['isout'] = 1; + parentInstance._out.call(parentInstance, event); + } + + this[c] = 1; this[c == 'isout' ? 'isover' : 'isout'] = 0; + this[c == "isover" ? "_over" : "_out"].call(this, event); + + // we just moved out of a greedy child + if (parentInstance && c == 'isout') { + parentInstance['isout'] = 0; + parentInstance['isover'] = 1; + parentInstance._over.call(parentInstance, event); + } + }); + + }, + dragStop: function( draggable, event ) { + draggable.element.parentsUntil( "body" ).unbind( "scroll.droppable" ); + //Call prepareOffsets one final time since IE does not fire return scroll events when overflow was caused by drag (see #5003) + if( !draggable.options.refreshPositions ) $.ui.ddmanager.prepareOffsets( draggable, event ); + } +}; + +})(jQuery); +(function( $, undefined ) { + +$.widget("ui.resizable", $.ui.mouse, { + version: "1.9.1", + widgetEventPrefix: "resize", + options: { + alsoResize: false, + animate: false, + animateDuration: "slow", + animateEasing: "swing", + aspectRatio: false, + autoHide: false, + containment: false, + ghost: false, + grid: false, + handles: "e,s,se", + helper: false, + maxHeight: null, + maxWidth: null, + minHeight: 10, + minWidth: 10, + zIndex: 1000 + }, + _create: function() { + + var that = this, o = this.options; + this.element.addClass("ui-resizable"); + + $.extend(this, { + _aspectRatio: !!(o.aspectRatio), + aspectRatio: o.aspectRatio, + originalElement: this.element, + _proportionallyResizeElements: [], + _helper: o.helper || o.ghost || o.animate ? o.helper || 'ui-resizable-helper' : null + }); + + //Wrap the element if it cannot hold child nodes + if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)) { + + //Create a wrapper element and set the wrapper to the new current internal element + this.element.wrap( + $('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({ + position: this.element.css('position'), + width: this.element.outerWidth(), + height: this.element.outerHeight(), + top: this.element.css('top'), + left: this.element.css('left') + }) + ); + + //Overwrite the original this.element + this.element = this.element.parent().data( + "resizable", this.element.data('resizable') + ); + + this.elementIsWrapper = true; + + //Move margins to the wrapper + this.element.css({ marginLeft: this.originalElement.css("marginLeft"), marginTop: this.originalElement.css("marginTop"), marginRight: this.originalElement.css("marginRight"), marginBottom: this.originalElement.css("marginBottom") }); + this.originalElement.css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0}); + + //Prevent Safari textarea resize + this.originalResizeStyle = this.originalElement.css('resize'); + this.originalElement.css('resize', 'none'); + + //Push the actual element to our proportionallyResize internal array + this._proportionallyResizeElements.push(this.originalElement.css({ position: 'static', zoom: 1, display: 'block' })); + + // avoid IE jump (hard set the margin) + this.originalElement.css({ margin: this.originalElement.css('margin') }); + + // fix handlers offset + this._proportionallyResize(); + + } + + this.handles = o.handles || (!$('.ui-resizable-handle', this.element).length ? "e,s,se" : { n: '.ui-resizable-n', e: '.ui-resizable-e', s: '.ui-resizable-s', w: '.ui-resizable-w', se: '.ui-resizable-se', sw: '.ui-resizable-sw', ne: '.ui-resizable-ne', nw: '.ui-resizable-nw' }); + if(this.handles.constructor == String) { + + if(this.handles == 'all') this.handles = 'n,e,s,w,se,sw,ne,nw'; + var n = this.handles.split(","); this.handles = {}; + + for(var i = 0; i < n.length; i++) { + + var handle = $.trim(n[i]), hname = 'ui-resizable-'+handle; + var axis = $('<div class="ui-resizable-handle ' + hname + '"></div>'); + + // Apply zIndex to all handles - see #7960 + axis.css({ zIndex: o.zIndex }); + + //TODO : What's going on here? + if ('se' == handle) { + axis.addClass('ui-icon ui-icon-gripsmall-diagonal-se'); + }; + + //Insert into internal handles object and append to element + this.handles[handle] = '.ui-resizable-'+handle; + this.element.append(axis); + } + + } + + this._renderAxis = function(target) { + + target = target || this.element; + + for(var i in this.handles) { + + if(this.handles[i].constructor == String) + this.handles[i] = $(this.handles[i], this.element).show(); + + //Apply pad to wrapper element, needed to fix axis position (textarea, inputs, scrolls) + if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i)) { + + var axis = $(this.handles[i], this.element), padWrapper = 0; + + //Checking the correct pad and border + padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth(); + + //The padding type i have to apply... + var padPos = [ 'padding', + /ne|nw|n/.test(i) ? 'Top' : + /se|sw|s/.test(i) ? 'Bottom' : + /^e$/.test(i) ? 'Right' : 'Left' ].join(""); + + target.css(padPos, padWrapper); + + this._proportionallyResize(); + + } + + //TODO: What's that good for? There's not anything to be executed left + if(!$(this.handles[i]).length) + continue; + + } + }; + + //TODO: make renderAxis a prototype function + this._renderAxis(this.element); + + this._handles = $('.ui-resizable-handle', this.element) + .disableSelection(); + + //Matching axis name + this._handles.mouseover(function() { + if (!that.resizing) { + if (this.className) + var axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i); + //Axis, default = se + that.axis = axis && axis[1] ? axis[1] : 'se'; + } + }); + + //If we want to auto hide the elements + if (o.autoHide) { + this._handles.hide(); + $(this.element) + .addClass("ui-resizable-autohide") + .mouseenter(function() { + if (o.disabled) return; + $(this).removeClass("ui-resizable-autohide"); + that._handles.show(); + }) + .mouseleave(function(){ + if (o.disabled) return; + if (!that.resizing) { + $(this).addClass("ui-resizable-autohide"); + that._handles.hide(); + } + }); + } + + //Initialize the mouse interaction + this._mouseInit(); + + }, + + _destroy: function() { + + this._mouseDestroy(); + + var _destroy = function(exp) { + $(exp).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing") + .removeData("resizable").removeData("ui-resizable").unbind(".resizable").find('.ui-resizable-handle').remove(); + }; + + //TODO: Unwrap at same DOM position + if (this.elementIsWrapper) { + _destroy(this.element); + var wrapper = this.element; + this.originalElement.css({ + position: wrapper.css('position'), + width: wrapper.outerWidth(), + height: wrapper.outerHeight(), + top: wrapper.css('top'), + left: wrapper.css('left') + }).insertAfter( wrapper ); + wrapper.remove(); + } + + this.originalElement.css('resize', this.originalResizeStyle); + _destroy(this.originalElement); + + return this; + }, + + _mouseCapture: function(event) { + var handle = false; + for (var i in this.handles) { + if ($(this.handles[i])[0] == event.target) { + handle = true; + } + } + + return !this.options.disabled && handle; + }, + + _mouseStart: function(event) { + + var o = this.options, iniPos = this.element.position(), el = this.element; + + this.resizing = true; + this.documentScroll = { top: $(document).scrollTop(), left: $(document).scrollLeft() }; + + // bugfix for http://dev.jquery.com/ticket/1749 + if (el.is('.ui-draggable') || (/absolute/).test(el.css('position'))) { + el.css({ position: 'absolute', top: iniPos.top, left: iniPos.left }); + } + + this._renderProxy(); + + var curleft = num(this.helper.css('left')), curtop = num(this.helper.css('top')); + + if (o.containment) { + curleft += $(o.containment).scrollLeft() || 0; + curtop += $(o.containment).scrollTop() || 0; + } + + //Store needed variables + this.offset = this.helper.offset(); + this.position = { left: curleft, top: curtop }; + this.size = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() }; + this.originalSize = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() }; + this.originalPosition = { left: curleft, top: curtop }; + this.sizeDiff = { width: el.outerWidth() - el.width(), height: el.outerHeight() - el.height() }; + this.originalMousePosition = { left: event.pageX, top: event.pageY }; + + //Aspect Ratio + this.aspectRatio = (typeof o.aspectRatio == 'number') ? o.aspectRatio : ((this.originalSize.width / this.originalSize.height) || 1); + + var cursor = $('.ui-resizable-' + this.axis).css('cursor'); + $('body').css('cursor', cursor == 'auto' ? this.axis + '-resize' : cursor); + + el.addClass("ui-resizable-resizing"); + this._propagate("start", event); + return true; + }, + + _mouseDrag: function(event) { + + //Increase performance, avoid regex + var el = this.helper, o = this.options, props = {}, + that = this, smp = this.originalMousePosition, a = this.axis; + + var dx = (event.pageX-smp.left)||0, dy = (event.pageY-smp.top)||0; + var trigger = this._change[a]; + if (!trigger) return false; + + // Calculate the attrs that will be change + var data = trigger.apply(this, [event, dx, dy]); + + // Put this in the mouseDrag handler since the user can start pressing shift while resizing + this._updateVirtualBoundaries(event.shiftKey); + if (this._aspectRatio || event.shiftKey) + data = this._updateRatio(data, event); + + data = this._respectSize(data, event); + + // plugins callbacks need to be called first + this._propagate("resize", event); + + el.css({ + top: this.position.top + "px", left: this.position.left + "px", + width: this.size.width + "px", height: this.size.height + "px" + }); + + if (!this._helper && this._proportionallyResizeElements.length) + this._proportionallyResize(); + + this._updateCache(data); + + // calling the user callback at the end + this._trigger('resize', event, this.ui()); + + return false; + }, + + _mouseStop: function(event) { + + this.resizing = false; + var o = this.options, that = this; + + if(this._helper) { + var pr = this._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName), + soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : that.sizeDiff.height, + soffsetw = ista ? 0 : that.sizeDiff.width; + + var s = { width: (that.helper.width() - soffsetw), height: (that.helper.height() - soffseth) }, + left = (parseInt(that.element.css('left'), 10) + (that.position.left - that.originalPosition.left)) || null, + top = (parseInt(that.element.css('top'), 10) + (that.position.top - that.originalPosition.top)) || null; + + if (!o.animate) + this.element.css($.extend(s, { top: top, left: left })); + + that.helper.height(that.size.height); + that.helper.width(that.size.width); + + if (this._helper && !o.animate) this._proportionallyResize(); + } + + $('body').css('cursor', 'auto'); + + this.element.removeClass("ui-resizable-resizing"); + + this._propagate("stop", event); + + if (this._helper) this.helper.remove(); + return false; + + }, + + _updateVirtualBoundaries: function(forceAspectRatio) { + var o = this.options, pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b; + + b = { + minWidth: isNumber(o.minWidth) ? o.minWidth : 0, + maxWidth: isNumber(o.maxWidth) ? o.maxWidth : Infinity, + minHeight: isNumber(o.minHeight) ? o.minHeight : 0, + maxHeight: isNumber(o.maxHeight) ? o.maxHeight : Infinity + }; + + if(this._aspectRatio || forceAspectRatio) { + // We want to create an enclosing box whose aspect ration is the requested one + // First, compute the "projected" size for each dimension based on the aspect ratio and other dimension + pMinWidth = b.minHeight * this.aspectRatio; + pMinHeight = b.minWidth / this.aspectRatio; + pMaxWidth = b.maxHeight * this.aspectRatio; + pMaxHeight = b.maxWidth / this.aspectRatio; + + if(pMinWidth > b.minWidth) b.minWidth = pMinWidth; + if(pMinHeight > b.minHeight) b.minHeight = pMinHeight; + if(pMaxWidth < b.maxWidth) b.maxWidth = pMaxWidth; + if(pMaxHeight < b.maxHeight) b.maxHeight = pMaxHeight; + } + this._vBoundaries = b; + }, + + _updateCache: function(data) { + var o = this.options; + this.offset = this.helper.offset(); + if (isNumber(data.left)) this.position.left = data.left; + if (isNumber(data.top)) this.position.top = data.top; + if (isNumber(data.height)) this.size.height = data.height; + if (isNumber(data.width)) this.size.width = data.width; + }, + + _updateRatio: function(data, event) { + + var o = this.options, cpos = this.position, csize = this.size, a = this.axis; + + if (isNumber(data.height)) data.width = (data.height * this.aspectRatio); + else if (isNumber(data.width)) data.height = (data.width / this.aspectRatio); + + if (a == 'sw') { + data.left = cpos.left + (csize.width - data.width); + data.top = null; + } + if (a == 'nw') { + data.top = cpos.top + (csize.height - data.height); + data.left = cpos.left + (csize.width - data.width); + } + + return data; + }, + + _respectSize: function(data, event) { + + var el = this.helper, o = this._vBoundaries, pRatio = this._aspectRatio || event.shiftKey, a = this.axis, + ismaxw = isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width), ismaxh = isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height), + isminw = isNumber(data.width) && o.minWidth && (o.minWidth > data.width), isminh = isNumber(data.height) && o.minHeight && (o.minHeight > data.height); + + if (isminw) data.width = o.minWidth; + if (isminh) data.height = o.minHeight; + if (ismaxw) data.width = o.maxWidth; + if (ismaxh) data.height = o.maxHeight; + + var dw = this.originalPosition.left + this.originalSize.width, dh = this.position.top + this.size.height; + var cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a); + + if (isminw && cw) data.left = dw - o.minWidth; + if (ismaxw && cw) data.left = dw - o.maxWidth; + if (isminh && ch) data.top = dh - o.minHeight; + if (ismaxh && ch) data.top = dh - o.maxHeight; + + // fixing jump error on top/left - bug #2330 + var isNotwh = !data.width && !data.height; + if (isNotwh && !data.left && data.top) data.top = null; + else if (isNotwh && !data.top && data.left) data.left = null; + + return data; + }, + + _proportionallyResize: function() { + + var o = this.options; + if (!this._proportionallyResizeElements.length) return; + var element = this.helper || this.element; + + for (var i=0; i < this._proportionallyResizeElements.length; i++) { + + var prel = this._proportionallyResizeElements[i]; + + if (!this.borderDif) { + var b = [prel.css('borderTopWidth'), prel.css('borderRightWidth'), prel.css('borderBottomWidth'), prel.css('borderLeftWidth')], + p = [prel.css('paddingTop'), prel.css('paddingRight'), prel.css('paddingBottom'), prel.css('paddingLeft')]; + + this.borderDif = $.map(b, function(v, i) { + var border = parseInt(v,10)||0, padding = parseInt(p[i],10)||0; + return border + padding; + }); + } + + prel.css({ + height: (element.height() - this.borderDif[0] - this.borderDif[2]) || 0, + width: (element.width() - this.borderDif[1] - this.borderDif[3]) || 0 + }); + + }; + + }, + + _renderProxy: function() { + + var el = this.element, o = this.options; + this.elementOffset = el.offset(); + + if(this._helper) { + + this.helper = this.helper || $('<div style="overflow:hidden;"></div>'); + + // fix ie6 offset TODO: This seems broken + var ie6offset = ($.ui.ie6 ? 1 : 0), + pxyoffset = ( $.ui.ie6 ? 2 : -1 ); + + this.helper.addClass(this._helper).css({ + width: this.element.outerWidth() + pxyoffset, + height: this.element.outerHeight() + pxyoffset, + position: 'absolute', + left: this.elementOffset.left - ie6offset +'px', + top: this.elementOffset.top - ie6offset +'px', + zIndex: ++o.zIndex //TODO: Don't modify option + }); + + this.helper + .appendTo("body") + .disableSelection(); + + } else { + this.helper = this.element; + } + + }, + + _change: { + e: function(event, dx, dy) { + return { width: this.originalSize.width + dx }; + }, + w: function(event, dx, dy) { + var o = this.options, cs = this.originalSize, sp = this.originalPosition; + return { left: sp.left + dx, width: cs.width - dx }; + }, + n: function(event, dx, dy) { + var o = this.options, cs = this.originalSize, sp = this.originalPosition; + return { top: sp.top + dy, height: cs.height - dy }; + }, + s: function(event, dx, dy) { + return { height: this.originalSize.height + dy }; + }, + se: function(event, dx, dy) { + return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [event, dx, dy])); + }, + sw: function(event, dx, dy) { + return $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [event, dx, dy])); + }, + ne: function(event, dx, dy) { + return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [event, dx, dy])); + }, + nw: function(event, dx, dy) { + return $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [event, dx, dy])); + } + }, + + _propagate: function(n, event) { + $.ui.plugin.call(this, n, [event, this.ui()]); + (n != "resize" && this._trigger(n, event, this.ui())); + }, + + plugins: {}, + + ui: function() { + return { + originalElement: this.originalElement, + element: this.element, + helper: this.helper, + position: this.position, + size: this.size, + originalSize: this.originalSize, + originalPosition: this.originalPosition + }; + } + +}); + +/* + * Resizable Extensions + */ + +$.ui.plugin.add("resizable", "alsoResize", { + + start: function (event, ui) { + var that = $(this).data("resizable"), o = that.options; + + var _store = function (exp) { + $(exp).each(function() { + var el = $(this); + el.data("resizable-alsoresize", { + width: parseInt(el.width(), 10), height: parseInt(el.height(), 10), + left: parseInt(el.css('left'), 10), top: parseInt(el.css('top'), 10) + }); + }); + }; + + if (typeof(o.alsoResize) == 'object' && !o.alsoResize.parentNode) { + if (o.alsoResize.length) { o.alsoResize = o.alsoResize[0]; _store(o.alsoResize); } + else { $.each(o.alsoResize, function (exp) { _store(exp); }); } + }else{ + _store(o.alsoResize); + } + }, + + resize: function (event, ui) { + var that = $(this).data("resizable"), o = that.options, os = that.originalSize, op = that.originalPosition; + + var delta = { + height: (that.size.height - os.height) || 0, width: (that.size.width - os.width) || 0, + top: (that.position.top - op.top) || 0, left: (that.position.left - op.left) || 0 + }, + + _alsoResize = function (exp, c) { + $(exp).each(function() { + var el = $(this), start = $(this).data("resizable-alsoresize"), style = {}, + css = c && c.length ? c : el.parents(ui.originalElement[0]).length ? ['width', 'height'] : ['width', 'height', 'top', 'left']; + + $.each(css, function (i, prop) { + var sum = (start[prop]||0) + (delta[prop]||0); + if (sum && sum >= 0) + style[prop] = sum || null; + }); + + el.css(style); + }); + }; + + if (typeof(o.alsoResize) == 'object' && !o.alsoResize.nodeType) { + $.each(o.alsoResize, function (exp, c) { _alsoResize(exp, c); }); + }else{ + _alsoResize(o.alsoResize); + } + }, + + stop: function (event, ui) { + $(this).removeData("resizable-alsoresize"); + } +}); + +$.ui.plugin.add("resizable", "animate", { + + stop: function(event, ui) { + var that = $(this).data("resizable"), o = that.options; + + var pr = that._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName), + soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : that.sizeDiff.height, + soffsetw = ista ? 0 : that.sizeDiff.width; + + var style = { width: (that.size.width - soffsetw), height: (that.size.height - soffseth) }, + left = (parseInt(that.element.css('left'), 10) + (that.position.left - that.originalPosition.left)) || null, + top = (parseInt(that.element.css('top'), 10) + (that.position.top - that.originalPosition.top)) || null; + + that.element.animate( + $.extend(style, top && left ? { top: top, left: left } : {}), { + duration: o.animateDuration, + easing: o.animateEasing, + step: function() { + + var data = { + width: parseInt(that.element.css('width'), 10), + height: parseInt(that.element.css('height'), 10), + top: parseInt(that.element.css('top'), 10), + left: parseInt(that.element.css('left'), 10) + }; + + if (pr && pr.length) $(pr[0]).css({ width: data.width, height: data.height }); + + // propagating resize, and updating values for each animation step + that._updateCache(data); + that._propagate("resize", event); + + } + } + ); + } + +}); + +$.ui.plugin.add("resizable", "containment", { + + start: function(event, ui) { + var that = $(this).data("resizable"), o = that.options, el = that.element; + var oc = o.containment, ce = (oc instanceof $) ? oc.get(0) : (/parent/.test(oc)) ? el.parent().get(0) : oc; + if (!ce) return; + + that.containerElement = $(ce); + + if (/document/.test(oc) || oc == document) { + that.containerOffset = { left: 0, top: 0 }; + that.containerPosition = { left: 0, top: 0 }; + + that.parentData = { + element: $(document), left: 0, top: 0, + width: $(document).width(), height: $(document).height() || document.body.parentNode.scrollHeight + }; + } + + // i'm a node, so compute top, left, right, bottom + else { + var element = $(ce), p = []; + $([ "Top", "Right", "Left", "Bottom" ]).each(function(i, name) { p[i] = num(element.css("padding" + name)); }); + + that.containerOffset = element.offset(); + that.containerPosition = element.position(); + that.containerSize = { height: (element.innerHeight() - p[3]), width: (element.innerWidth() - p[1]) }; + + var co = that.containerOffset, ch = that.containerSize.height, cw = that.containerSize.width, + width = ($.ui.hasScroll(ce, "left") ? ce.scrollWidth : cw ), height = ($.ui.hasScroll(ce) ? ce.scrollHeight : ch); + + that.parentData = { + element: ce, left: co.left, top: co.top, width: width, height: height + }; + } + }, + + resize: function(event, ui) { + var that = $(this).data("resizable"), o = that.options, + ps = that.containerSize, co = that.containerOffset, cs = that.size, cp = that.position, + pRatio = that._aspectRatio || event.shiftKey, cop = { top:0, left:0 }, ce = that.containerElement; + + if (ce[0] != document && (/static/).test(ce.css('position'))) cop = co; + + if (cp.left < (that._helper ? co.left : 0)) { + that.size.width = that.size.width + (that._helper ? (that.position.left - co.left) : (that.position.left - cop.left)); + if (pRatio) that.size.height = that.size.width / that.aspectRatio; + that.position.left = o.helper ? co.left : 0; + } + + if (cp.top < (that._helper ? co.top : 0)) { + that.size.height = that.size.height + (that._helper ? (that.position.top - co.top) : that.position.top); + if (pRatio) that.size.width = that.size.height * that.aspectRatio; + that.position.top = that._helper ? co.top : 0; + } + + that.offset.left = that.parentData.left+that.position.left; + that.offset.top = that.parentData.top+that.position.top; + + var woset = Math.abs( (that._helper ? that.offset.left - cop.left : (that.offset.left - cop.left)) + that.sizeDiff.width ), + hoset = Math.abs( (that._helper ? that.offset.top - cop.top : (that.offset.top - co.top)) + that.sizeDiff.height ); + + var isParent = that.containerElement.get(0) == that.element.parent().get(0), + isOffsetRelative = /relative|absolute/.test(that.containerElement.css('position')); + + if(isParent && isOffsetRelative) woset -= that.parentData.left; + + if (woset + that.size.width >= that.parentData.width) { + that.size.width = that.parentData.width - woset; + if (pRatio) that.size.height = that.size.width / that.aspectRatio; + } + + if (hoset + that.size.height >= that.parentData.height) { + that.size.height = that.parentData.height - hoset; + if (pRatio) that.size.width = that.size.height * that.aspectRatio; + } + }, + + stop: function(event, ui){ + var that = $(this).data("resizable"), o = that.options, cp = that.position, + co = that.containerOffset, cop = that.containerPosition, ce = that.containerElement; + + var helper = $(that.helper), ho = helper.offset(), w = helper.outerWidth() - that.sizeDiff.width, h = helper.outerHeight() - that.sizeDiff.height; + + if (that._helper && !o.animate && (/relative/).test(ce.css('position'))) + $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h }); + + if (that._helper && !o.animate && (/static/).test(ce.css('position'))) + $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h }); + + } +}); + +$.ui.plugin.add("resizable", "ghost", { + + start: function(event, ui) { + + var that = $(this).data("resizable"), o = that.options, cs = that.size; + + that.ghost = that.originalElement.clone(); + that.ghost + .css({ opacity: .25, display: 'block', position: 'relative', height: cs.height, width: cs.width, margin: 0, left: 0, top: 0 }) + .addClass('ui-resizable-ghost') + .addClass(typeof o.ghost == 'string' ? o.ghost : ''); + + that.ghost.appendTo(that.helper); + + }, + + resize: function(event, ui){ + var that = $(this).data("resizable"), o = that.options; + if (that.ghost) that.ghost.css({ position: 'relative', height: that.size.height, width: that.size.width }); + }, + + stop: function(event, ui){ + var that = $(this).data("resizable"), o = that.options; + if (that.ghost && that.helper) that.helper.get(0).removeChild(that.ghost.get(0)); + } + +}); + +$.ui.plugin.add("resizable", "grid", { + + resize: function(event, ui) { + var that = $(this).data("resizable"), o = that.options, cs = that.size, os = that.originalSize, op = that.originalPosition, a = that.axis, ratio = o._aspectRatio || event.shiftKey; + o.grid = typeof o.grid == "number" ? [o.grid, o.grid] : o.grid; + var ox = Math.round((cs.width - os.width) / (o.grid[0]||1)) * (o.grid[0]||1), oy = Math.round((cs.height - os.height) / (o.grid[1]||1)) * (o.grid[1]||1); + + if (/^(se|s|e)$/.test(a)) { + that.size.width = os.width + ox; + that.size.height = os.height + oy; + } + else if (/^(ne)$/.test(a)) { + that.size.width = os.width + ox; + that.size.height = os.height + oy; + that.position.top = op.top - oy; + } + else if (/^(sw)$/.test(a)) { + that.size.width = os.width + ox; + that.size.height = os.height + oy; + that.position.left = op.left - ox; + } + else { + that.size.width = os.width + ox; + that.size.height = os.height + oy; + that.position.top = op.top - oy; + that.position.left = op.left - ox; + } + } + +}); + +var num = function(v) { + return parseInt(v, 10) || 0; +}; + +var isNumber = function(value) { + return !isNaN(parseInt(value, 10)); +}; + +})(jQuery); +(function( $, undefined ) { + +$.widget("ui.selectable", $.ui.mouse, { + version: "1.9.1", + options: { + appendTo: 'body', + autoRefresh: true, + distance: 0, + filter: '*', + tolerance: 'touch' + }, + _create: function() { + var that = this; + + this.element.addClass("ui-selectable"); + + this.dragged = false; + + // cache selectee children based on filter + var selectees; + this.refresh = function() { + selectees = $(that.options.filter, that.element[0]); + selectees.addClass("ui-selectee"); + selectees.each(function() { + var $this = $(this); + var pos = $this.offset(); + $.data(this, "selectable-item", { + element: this, + $element: $this, + left: pos.left, + top: pos.top, + right: pos.left + $this.outerWidth(), + bottom: pos.top + $this.outerHeight(), + startselected: false, + selected: $this.hasClass('ui-selected'), + selecting: $this.hasClass('ui-selecting'), + unselecting: $this.hasClass('ui-unselecting') + }); + }); + }; + this.refresh(); + + this.selectees = selectees.addClass("ui-selectee"); + + this._mouseInit(); + + this.helper = $("<div class='ui-selectable-helper'></div>"); + }, + + _destroy: function() { + this.selectees + .removeClass("ui-selectee") + .removeData("selectable-item"); + this.element + .removeClass("ui-selectable ui-selectable-disabled"); + this._mouseDestroy(); + }, + + _mouseStart: function(event) { + var that = this; + + this.opos = [event.pageX, event.pageY]; + + if (this.options.disabled) + return; + + var options = this.options; + + this.selectees = $(options.filter, this.element[0]); + + this._trigger("start", event); + + $(options.appendTo).append(this.helper); + // position helper (lasso) + this.helper.css({ + "left": event.clientX, + "top": event.clientY, + "width": 0, + "height": 0 + }); + + if (options.autoRefresh) { + this.refresh(); + } + + this.selectees.filter('.ui-selected').each(function() { + var selectee = $.data(this, "selectable-item"); + selectee.startselected = true; + if (!event.metaKey && !event.ctrlKey) { + selectee.$element.removeClass('ui-selected'); + selectee.selected = false; + selectee.$element.addClass('ui-unselecting'); + selectee.unselecting = true; + // selectable UNSELECTING callback + that._trigger("unselecting", event, { + unselecting: selectee.element + }); + } + }); + + $(event.target).parents().andSelf().each(function() { + var selectee = $.data(this, "selectable-item"); + if (selectee) { + var doSelect = (!event.metaKey && !event.ctrlKey) || !selectee.$element.hasClass('ui-selected'); + selectee.$element + .removeClass(doSelect ? "ui-unselecting" : "ui-selected") + .addClass(doSelect ? "ui-selecting" : "ui-unselecting"); + selectee.unselecting = !doSelect; + selectee.selecting = doSelect; + selectee.selected = doSelect; + // selectable (UN)SELECTING callback + if (doSelect) { + that._trigger("selecting", event, { + selecting: selectee.element + }); + } else { + that._trigger("unselecting", event, { + unselecting: selectee.element + }); + } + return false; + } + }); + + }, + + _mouseDrag: function(event) { + var that = this; + this.dragged = true; + + if (this.options.disabled) + return; + + var options = this.options; + + var x1 = this.opos[0], y1 = this.opos[1], x2 = event.pageX, y2 = event.pageY; + if (x1 > x2) { var tmp = x2; x2 = x1; x1 = tmp; } + if (y1 > y2) { var tmp = y2; y2 = y1; y1 = tmp; } + this.helper.css({left: x1, top: y1, width: x2-x1, height: y2-y1}); + + this.selectees.each(function() { + var selectee = $.data(this, "selectable-item"); + //prevent helper from being selected if appendTo: selectable + if (!selectee || selectee.element == that.element[0]) + return; + var hit = false; + if (options.tolerance == 'touch') { + hit = ( !(selectee.left > x2 || selectee.right < x1 || selectee.top > y2 || selectee.bottom < y1) ); + } else if (options.tolerance == 'fit') { + hit = (selectee.left > x1 && selectee.right < x2 && selectee.top > y1 && selectee.bottom < y2); + } + + if (hit) { + // SELECT + if (selectee.selected) { + selectee.$element.removeClass('ui-selected'); + selectee.selected = false; + } + if (selectee.unselecting) { + selectee.$element.removeClass('ui-unselecting'); + selectee.unselecting = false; + } + if (!selectee.selecting) { + selectee.$element.addClass('ui-selecting'); + selectee.selecting = true; + // selectable SELECTING callback + that._trigger("selecting", event, { + selecting: selectee.element + }); + } + } else { + // UNSELECT + if (selectee.selecting) { + if ((event.metaKey || event.ctrlKey) && selectee.startselected) { + selectee.$element.removeClass('ui-selecting'); + selectee.selecting = false; + selectee.$element.addClass('ui-selected'); + selectee.selected = true; + } else { + selectee.$element.removeClass('ui-selecting'); + selectee.selecting = false; + if (selectee.startselected) { + selectee.$element.addClass('ui-unselecting'); + selectee.unselecting = true; + } + // selectable UNSELECTING callback + that._trigger("unselecting", event, { + unselecting: selectee.element + }); + } + } + if (selectee.selected) { + if (!event.metaKey && !event.ctrlKey && !selectee.startselected) { + selectee.$element.removeClass('ui-selected'); + selectee.selected = false; + + selectee.$element.addClass('ui-unselecting'); + selectee.unselecting = true; + // selectable UNSELECTING callback + that._trigger("unselecting", event, { + unselecting: selectee.element + }); + } + } + } + }); + + return false; + }, + + _mouseStop: function(event) { + var that = this; + + this.dragged = false; + + var options = this.options; + + $('.ui-unselecting', this.element[0]).each(function() { + var selectee = $.data(this, "selectable-item"); + selectee.$element.removeClass('ui-unselecting'); + selectee.unselecting = false; + selectee.startselected = false; + that._trigger("unselected", event, { + unselected: selectee.element + }); + }); + $('.ui-selecting', this.element[0]).each(function() { + var selectee = $.data(this, "selectable-item"); + selectee.$element.removeClass('ui-selecting').addClass('ui-selected'); + selectee.selecting = false; + selectee.selected = true; + selectee.startselected = true; + that._trigger("selected", event, { + selected: selectee.element + }); + }); + this._trigger("stop", event); + + this.helper.remove(); + + return false; + } + +}); + +})(jQuery); +(function( $, undefined ) { + +$.widget("ui.sortable", $.ui.mouse, { + version: "1.9.1", + widgetEventPrefix: "sort", + ready: false, + options: { + appendTo: "parent", + axis: false, + connectWith: false, + containment: false, + cursor: 'auto', + cursorAt: false, + dropOnEmpty: true, + forcePlaceholderSize: false, + forceHelperSize: false, + grid: false, + handle: false, + helper: "original", + items: '> *', + opacity: false, + placeholder: false, + revert: false, + scroll: true, + scrollSensitivity: 20, + scrollSpeed: 20, + scope: "default", + tolerance: "intersect", + zIndex: 1000 + }, + _create: function() { + + var o = this.options; + this.containerCache = {}; + this.element.addClass("ui-sortable"); + + //Get the items + this.refresh(); + + //Let's determine if the items are being displayed horizontally + this.floating = this.items.length ? o.axis === 'x' || (/left|right/).test(this.items[0].item.css('float')) || (/inline|table-cell/).test(this.items[0].item.css('display')) : false; + + //Let's determine the parent's offset + this.offset = this.element.offset(); + + //Initialize mouse events for interaction + this._mouseInit(); + + //We're ready to go + this.ready = true + + }, + + _destroy: function() { + this.element + .removeClass("ui-sortable ui-sortable-disabled"); + this._mouseDestroy(); + + for ( var i = this.items.length - 1; i >= 0; i-- ) + this.items[i].item.removeData(this.widgetName + "-item"); + + return this; + }, + + _setOption: function(key, value){ + if ( key === "disabled" ) { + this.options[ key ] = value; + + this.widget().toggleClass( "ui-sortable-disabled", !!value ); + } else { + // Don't call widget base _setOption for disable as it adds ui-state-disabled class + $.Widget.prototype._setOption.apply(this, arguments); + } + }, + + _mouseCapture: function(event, overrideHandle) { + var that = this; + + if (this.reverting) { + return false; + } + + if(this.options.disabled || this.options.type == 'static') return false; + + //We have to refresh the items data once first + this._refreshItems(event); + + //Find out if the clicked node (or one of its parents) is a actual item in this.items + var currentItem = null, nodes = $(event.target).parents().each(function() { + if($.data(this, that.widgetName + '-item') == that) { + currentItem = $(this); + return false; + } + }); + if($.data(event.target, that.widgetName + '-item') == that) currentItem = $(event.target); + + if(!currentItem) return false; + if(this.options.handle && !overrideHandle) { + var validHandle = false; + + $(this.options.handle, currentItem).find("*").andSelf().each(function() { if(this == event.target) validHandle = true; }); + if(!validHandle) return false; + } + + this.currentItem = currentItem; + this._removeCurrentsFromItems(); + return true; + + }, + + _mouseStart: function(event, overrideHandle, noActivation) { + + var o = this.options; + this.currentContainer = this; + + //We only need to call refreshPositions, because the refreshItems call has been moved to mouseCapture + this.refreshPositions(); + + //Create and append the visible helper + this.helper = this._createHelper(event); + + //Cache the helper size + this._cacheHelperProportions(); + + /* + * - Position generation - + * This block generates everything position related - it's the core of draggables. + */ + + //Cache the margins of the original element + this._cacheMargins(); + + //Get the next scrolling parent + this.scrollParent = this.helper.scrollParent(); + + //The element's absolute position on the page minus margins + this.offset = this.currentItem.offset(); + this.offset = { + top: this.offset.top - this.margins.top, + left: this.offset.left - this.margins.left + }; + + $.extend(this.offset, { + click: { //Where the click happened, relative to the element + left: event.pageX - this.offset.left, + top: event.pageY - this.offset.top + }, + parent: this._getParentOffset(), + relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper + }); + + // Only after we got the offset, we can change the helper's position to absolute + // TODO: Still need to figure out a way to make relative sorting possible + this.helper.css("position", "absolute"); + this.cssPosition = this.helper.css("position"); + + //Generate the original position + this.originalPosition = this._generatePosition(event); + this.originalPageX = event.pageX; + this.originalPageY = event.pageY; + + //Adjust the mouse offset relative to the helper if 'cursorAt' is supplied + (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt)); + + //Cache the former DOM position + this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] }; + + //If the helper is not the original, hide the original so it's not playing any role during the drag, won't cause anything bad this way + if(this.helper[0] != this.currentItem[0]) { + this.currentItem.hide(); + } + + //Create the placeholder + this._createPlaceholder(); + + //Set a containment if given in the options + if(o.containment) + this._setContainment(); + + if(o.cursor) { // cursor option + if ($('body').css("cursor")) this._storedCursor = $('body').css("cursor"); + $('body').css("cursor", o.cursor); + } + + if(o.opacity) { // opacity option + if (this.helper.css("opacity")) this._storedOpacity = this.helper.css("opacity"); + this.helper.css("opacity", o.opacity); + } + + if(o.zIndex) { // zIndex option + if (this.helper.css("zIndex")) this._storedZIndex = this.helper.css("zIndex"); + this.helper.css("zIndex", o.zIndex); + } + + //Prepare scrolling + if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') + this.overflowOffset = this.scrollParent.offset(); + + //Call callbacks + this._trigger("start", event, this._uiHash()); + + //Recache the helper size + if(!this._preserveHelperProportions) + this._cacheHelperProportions(); + + + //Post 'activate' events to possible containers + if(!noActivation) { + for (var i = this.containers.length - 1; i >= 0; i--) { this.containers[i]._trigger("activate", event, this._uiHash(this)); } + } + + //Prepare possible droppables + if($.ui.ddmanager) + $.ui.ddmanager.current = this; + + if ($.ui.ddmanager && !o.dropBehaviour) + $.ui.ddmanager.prepareOffsets(this, event); + + this.dragging = true; + + this.helper.addClass("ui-sortable-helper"); + this._mouseDrag(event); //Execute the drag once - this causes the helper not to be visible before getting its correct position + return true; + + }, + + _mouseDrag: function(event) { + + //Compute the helpers position + this.position = this._generatePosition(event); + this.positionAbs = this._convertPositionTo("absolute"); + + if (!this.lastPositionAbs) { + this.lastPositionAbs = this.positionAbs; + } + + //Do scrolling + if(this.options.scroll) { + var o = this.options, scrolled = false; + if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') { + + if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) + this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed; + else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity) + this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed; + + if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) + this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed; + else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity) + this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed; + + } else { + + if(event.pageY - $(document).scrollTop() < o.scrollSensitivity) + scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed); + else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) + scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed); + + if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity) + scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed); + else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) + scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed); + + } + + if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) + $.ui.ddmanager.prepareOffsets(this, event); + } + + //Regenerate the absolute position used for position checks + this.positionAbs = this._convertPositionTo("absolute"); + + //Set the helper position + if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px'; + if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px'; + + //Rearrange + for (var i = this.items.length - 1; i >= 0; i--) { + + //Cache variables and intersection, continue if no intersection + var item = this.items[i], itemElement = item.item[0], intersection = this._intersectsWithPointer(item); + if (!intersection) continue; + + // Only put the placeholder inside the current Container, skip all + // items form other containers. This works because when moving + // an item from one container to another the + // currentContainer is switched before the placeholder is moved. + // + // Without this moving items in "sub-sortables" can cause the placeholder to jitter + // beetween the outer and inner container. + if (item.instance !== this.currentContainer) continue; + + if (itemElement != this.currentItem[0] //cannot intersect with itself + && this.placeholder[intersection == 1 ? "next" : "prev"]()[0] != itemElement //no useless actions that have been done before + && !$.contains(this.placeholder[0], itemElement) //no action if the item moved is the parent of the item checked + && (this.options.type == 'semi-dynamic' ? !$.contains(this.element[0], itemElement) : true) + //&& itemElement.parentNode == this.placeholder[0].parentNode // only rearrange items within the same container + ) { + + this.direction = intersection == 1 ? "down" : "up"; + + if (this.options.tolerance == "pointer" || this._intersectsWithSides(item)) { + this._rearrange(event, item); + } else { + break; + } + + this._trigger("change", event, this._uiHash()); + break; + } + } + + //Post events to containers + this._contactContainers(event); + + //Interconnect with droppables + if($.ui.ddmanager) $.ui.ddmanager.drag(this, event); + + //Call callbacks + this._trigger('sort', event, this._uiHash()); + + this.lastPositionAbs = this.positionAbs; + return false; + + }, + + _mouseStop: function(event, noPropagation) { + + if(!event) return; + + //If we are using droppables, inform the manager about the drop + if ($.ui.ddmanager && !this.options.dropBehaviour) + $.ui.ddmanager.drop(this, event); + + if(this.options.revert) { + var that = this; + var cur = this.placeholder.offset(); + + this.reverting = true; + + $(this.helper).animate({ + left: cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft), + top: cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop) + }, parseInt(this.options.revert, 10) || 500, function() { + that._clear(event); + }); + } else { + this._clear(event, noPropagation); + } + + return false; + + }, + + cancel: function() { + + if(this.dragging) { + + this._mouseUp({ target: null }); + + if(this.options.helper == "original") + this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"); + else + this.currentItem.show(); + + //Post deactivating events to containers + for (var i = this.containers.length - 1; i >= 0; i--){ + this.containers[i]._trigger("deactivate", null, this._uiHash(this)); + if(this.containers[i].containerCache.over) { + this.containers[i]._trigger("out", null, this._uiHash(this)); + this.containers[i].containerCache.over = 0; + } + } + + } + + if (this.placeholder) { + //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node! + if(this.placeholder[0].parentNode) this.placeholder[0].parentNode.removeChild(this.placeholder[0]); + if(this.options.helper != "original" && this.helper && this.helper[0].parentNode) this.helper.remove(); + + $.extend(this, { + helper: null, + dragging: false, + reverting: false, + _noFinalSort: null + }); + + if(this.domPosition.prev) { + $(this.domPosition.prev).after(this.currentItem); + } else { + $(this.domPosition.parent).prepend(this.currentItem); + } + } + + return this; + + }, + + serialize: function(o) { + + var items = this._getItemsAsjQuery(o && o.connected); + var str = []; o = o || {}; + + $(items).each(function() { + var res = ($(o.item || this).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/)); + if(res) str.push((o.key || res[1]+'[]')+'='+(o.key && o.expression ? res[1] : res[2])); + }); + + if(!str.length && o.key) { + str.push(o.key + '='); + } + + return str.join('&'); + + }, + + toArray: function(o) { + + var items = this._getItemsAsjQuery(o && o.connected); + var ret = []; o = o || {}; + + items.each(function() { ret.push($(o.item || this).attr(o.attribute || 'id') || ''); }); + return ret; + + }, + + /* Be careful with the following core functions */ + _intersectsWith: function(item) { + + var x1 = this.positionAbs.left, + x2 = x1 + this.helperProportions.width, + y1 = this.positionAbs.top, + y2 = y1 + this.helperProportions.height; + + var l = item.left, + r = l + item.width, + t = item.top, + b = t + item.height; + + var dyClick = this.offset.click.top, + dxClick = this.offset.click.left; + + var isOverElement = (y1 + dyClick) > t && (y1 + dyClick) < b && (x1 + dxClick) > l && (x1 + dxClick) < r; + + if( this.options.tolerance == "pointer" + || this.options.forcePointerForContainers + || (this.options.tolerance != "pointer" && this.helperProportions[this.floating ? 'width' : 'height'] > item[this.floating ? 'width' : 'height']) + ) { + return isOverElement; + } else { + + return (l < x1 + (this.helperProportions.width / 2) // Right Half + && x2 - (this.helperProportions.width / 2) < r // Left Half + && t < y1 + (this.helperProportions.height / 2) // Bottom Half + && y2 - (this.helperProportions.height / 2) < b ); // Top Half + + } + }, + + _intersectsWithPointer: function(item) { + + var isOverElementHeight = (this.options.axis === 'x') || $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height), + isOverElementWidth = (this.options.axis === 'y') || $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width), + isOverElement = isOverElementHeight && isOverElementWidth, + verticalDirection = this._getDragVerticalDirection(), + horizontalDirection = this._getDragHorizontalDirection(); + + if (!isOverElement) + return false; + + return this.floating ? + ( ((horizontalDirection && horizontalDirection == "right") || verticalDirection == "down") ? 2 : 1 ) + : ( verticalDirection && (verticalDirection == "down" ? 2 : 1) ); + + }, + + _intersectsWithSides: function(item) { + + var isOverBottomHalf = $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height), + isOverRightHalf = $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width), + verticalDirection = this._getDragVerticalDirection(), + horizontalDirection = this._getDragHorizontalDirection(); + + if (this.floating && horizontalDirection) { + return ((horizontalDirection == "right" && isOverRightHalf) || (horizontalDirection == "left" && !isOverRightHalf)); + } else { + return verticalDirection && ((verticalDirection == "down" && isOverBottomHalf) || (verticalDirection == "up" && !isOverBottomHalf)); + } + + }, + + _getDragVerticalDirection: function() { + var delta = this.positionAbs.top - this.lastPositionAbs.top; + return delta != 0 && (delta > 0 ? "down" : "up"); + }, + + _getDragHorizontalDirection: function() { + var delta = this.positionAbs.left - this.lastPositionAbs.left; + return delta != 0 && (delta > 0 ? "right" : "left"); + }, + + refresh: function(event) { + this._refreshItems(event); + this.refreshPositions(); + return this; + }, + + _connectWith: function() { + var options = this.options; + return options.connectWith.constructor == String + ? [options.connectWith] + : options.connectWith; + }, + + _getItemsAsjQuery: function(connected) { + + var items = []; + var queries = []; + var connectWith = this._connectWith(); + + if(connectWith && connected) { + for (var i = connectWith.length - 1; i >= 0; i--){ + var cur = $(connectWith[i]); + for (var j = cur.length - 1; j >= 0; j--){ + var inst = $.data(cur[j], this.widgetName); + if(inst && inst != this && !inst.options.disabled) { + queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(".ui-sortable-helper").not('.ui-sortable-placeholder'), inst]); + } + }; + }; + } + + queries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not(".ui-sortable-helper").not('.ui-sortable-placeholder'), this]); + + for (var i = queries.length - 1; i >= 0; i--){ + queries[i][0].each(function() { + items.push(this); + }); + }; + + return $(items); + + }, + + _removeCurrentsFromItems: function() { + + var list = this.currentItem.find(":data(" + this.widgetName + "-item)"); + + this.items = $.grep(this.items, function (item) { + for (var j=0; j < list.length; j++) { + if(list[j] == item.item[0]) + return false; + }; + return true; + }); + + }, + + _refreshItems: function(event) { + + this.items = []; + this.containers = [this]; + var items = this.items; + var queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]]; + var connectWith = this._connectWith(); + + if(connectWith && this.ready) { //Shouldn't be run the first time through due to massive slow-down + for (var i = connectWith.length - 1; i >= 0; i--){ + var cur = $(connectWith[i]); + for (var j = cur.length - 1; j >= 0; j--){ + var inst = $.data(cur[j], this.widgetName); + if(inst && inst != this && !inst.options.disabled) { + queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]); + this.containers.push(inst); + } + }; + }; + } + + for (var i = queries.length - 1; i >= 0; i--) { + var targetData = queries[i][1]; + var _queries = queries[i][0]; + + for (var j=0, queriesLength = _queries.length; j < queriesLength; j++) { + var item = $(_queries[j]); + + item.data(this.widgetName + '-item', targetData); // Data for target checking (mouse manager) + + items.push({ + item: item, + instance: targetData, + width: 0, height: 0, + left: 0, top: 0 + }); + }; + }; + + }, + + refreshPositions: function(fast) { + + //This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change + if(this.offsetParent && this.helper) { + this.offset.parent = this._getParentOffset(); + } + + for (var i = this.items.length - 1; i >= 0; i--){ + var item = this.items[i]; + + //We ignore calculating positions of all connected containers when we're not over them + if(item.instance != this.currentContainer && this.currentContainer && item.item[0] != this.currentItem[0]) + continue; + + var t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item; + + if (!fast) { + item.width = t.outerWidth(); + item.height = t.outerHeight(); + } + + var p = t.offset(); + item.left = p.left; + item.top = p.top; + }; + + if(this.options.custom && this.options.custom.refreshContainers) { + this.options.custom.refreshContainers.call(this); + } else { + for (var i = this.containers.length - 1; i >= 0; i--){ + var p = this.containers[i].element.offset(); + this.containers[i].containerCache.left = p.left; + this.containers[i].containerCache.top = p.top; + this.containers[i].containerCache.width = this.containers[i].element.outerWidth(); + this.containers[i].containerCache.height = this.containers[i].element.outerHeight(); + }; + } + + return this; + }, + + _createPlaceholder: function(that) { + that = that || this; + var o = that.options; + + if(!o.placeholder || o.placeholder.constructor == String) { + var className = o.placeholder; + o.placeholder = { + element: function() { + + var el = $(document.createElement(that.currentItem[0].nodeName)) + .addClass(className || that.currentItem[0].className+" ui-sortable-placeholder") + .removeClass("ui-sortable-helper")[0]; + + if(!className) + el.style.visibility = "hidden"; + + return el; + }, + update: function(container, p) { + + // 1. If a className is set as 'placeholder option, we don't force sizes - the class is responsible for that + // 2. The option 'forcePlaceholderSize can be enabled to force it even if a class name is specified + if(className && !o.forcePlaceholderSize) return; + + //If the element doesn't have a actual height by itself (without styles coming from a stylesheet), it receives the inline height from the dragged item + if(!p.height()) { p.height(that.currentItem.innerHeight() - parseInt(that.currentItem.css('paddingTop')||0, 10) - parseInt(that.currentItem.css('paddingBottom')||0, 10)); }; + if(!p.width()) { p.width(that.currentItem.innerWidth() - parseInt(that.currentItem.css('paddingLeft')||0, 10) - parseInt(that.currentItem.css('paddingRight')||0, 10)); }; + } + }; + } + + //Create the placeholder + that.placeholder = $(o.placeholder.element.call(that.element, that.currentItem)); + + //Append it after the actual current item + that.currentItem.after(that.placeholder); + + //Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317) + o.placeholder.update(that, that.placeholder); + + }, + + _contactContainers: function(event) { + + // get innermost container that intersects with item + var innermostContainer = null, innermostIndex = null; + + + for (var i = this.containers.length - 1; i >= 0; i--){ + + // never consider a container that's located within the item itself + if($.contains(this.currentItem[0], this.containers[i].element[0])) + continue; + + if(this._intersectsWith(this.containers[i].containerCache)) { + + // if we've already found a container and it's more "inner" than this, then continue + if(innermostContainer && $.contains(this.containers[i].element[0], innermostContainer.element[0])) + continue; + + innermostContainer = this.containers[i]; + innermostIndex = i; + + } else { + // container doesn't intersect. trigger "out" event if necessary + if(this.containers[i].containerCache.over) { + this.containers[i]._trigger("out", event, this._uiHash(this)); + this.containers[i].containerCache.over = 0; + } + } + + } + + // if no intersecting containers found, return + if(!innermostContainer) return; + + // move the item into the container if it's not there already + if(this.containers.length === 1) { + this.containers[innermostIndex]._trigger("over", event, this._uiHash(this)); + this.containers[innermostIndex].containerCache.over = 1; + } else { + + //When entering a new container, we will find the item with the least distance and append our item near it + var dist = 10000; var itemWithLeastDistance = null; + var posProperty = this.containers[innermostIndex].floating ? 'left' : 'top'; + var sizeProperty = this.containers[innermostIndex].floating ? 'width' : 'height'; + var base = this.positionAbs[posProperty] + this.offset.click[posProperty]; + for (var j = this.items.length - 1; j >= 0; j--) { + if(!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) continue; + if(this.items[j].item[0] == this.currentItem[0]) continue; + var cur = this.items[j].item.offset()[posProperty]; + var nearBottom = false; + if(Math.abs(cur - base) > Math.abs(cur + this.items[j][sizeProperty] - base)){ + nearBottom = true; + cur += this.items[j][sizeProperty]; + } + + if(Math.abs(cur - base) < dist) { + dist = Math.abs(cur - base); itemWithLeastDistance = this.items[j]; + this.direction = nearBottom ? "up": "down"; + } + } + + if(!itemWithLeastDistance && !this.options.dropOnEmpty) //Check if dropOnEmpty is enabled + return; + + this.currentContainer = this.containers[innermostIndex]; + itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true); + this._trigger("change", event, this._uiHash()); + this.containers[innermostIndex]._trigger("change", event, this._uiHash(this)); + + //Update the placeholder + this.options.placeholder.update(this.currentContainer, this.placeholder); + + this.containers[innermostIndex]._trigger("over", event, this._uiHash(this)); + this.containers[innermostIndex].containerCache.over = 1; + } + + + }, + + _createHelper: function(event) { + + var o = this.options; + var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper == 'clone' ? this.currentItem.clone() : this.currentItem); + + if(!helper.parents('body').length) //Add the helper to the DOM if that didn't happen already + $(o.appendTo != 'parent' ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]); + + if(helper[0] == this.currentItem[0]) + this._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css("position"), top: this.currentItem.css("top"), left: this.currentItem.css("left") }; + + if(helper[0].style.width == '' || o.forceHelperSize) helper.width(this.currentItem.width()); + if(helper[0].style.height == '' || o.forceHelperSize) helper.height(this.currentItem.height()); + + return helper; + + }, + + _adjustOffsetFromHelper: function(obj) { + if (typeof obj == 'string') { + obj = obj.split(' '); + } + if ($.isArray(obj)) { + obj = {left: +obj[0], top: +obj[1] || 0}; + } + if ('left' in obj) { + this.offset.click.left = obj.left + this.margins.left; + } + if ('right' in obj) { + this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left; + } + if ('top' in obj) { + this.offset.click.top = obj.top + this.margins.top; + } + if ('bottom' in obj) { + this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top; + } + }, + + _getParentOffset: function() { + + + //Get the offsetParent and cache its position + this.offsetParent = this.helper.offsetParent(); + var po = this.offsetParent.offset(); + + // This is a special case where we need to modify a offset calculated on start, since the following happened: + // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent + // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that + // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag + if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) { + po.left += this.scrollParent.scrollLeft(); + po.top += this.scrollParent.scrollTop(); + } + + if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information + || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.ui.ie)) //Ugly IE fix + po = { top: 0, left: 0 }; + + return { + top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0), + left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0) + }; + + }, + + _getRelativeOffset: function() { + + if(this.cssPosition == "relative") { + var p = this.currentItem.position(); + return { + top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(), + left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft() + }; + } else { + return { top: 0, left: 0 }; + } + + }, + + _cacheMargins: function() { + this.margins = { + left: (parseInt(this.currentItem.css("marginLeft"),10) || 0), + top: (parseInt(this.currentItem.css("marginTop"),10) || 0) + }; + }, + + _cacheHelperProportions: function() { + this.helperProportions = { + width: this.helper.outerWidth(), + height: this.helper.outerHeight() + }; + }, + + _setContainment: function() { + + var o = this.options; + if(o.containment == 'parent') o.containment = this.helper[0].parentNode; + if(o.containment == 'document' || o.containment == 'window') this.containment = [ + 0 - this.offset.relative.left - this.offset.parent.left, + 0 - this.offset.relative.top - this.offset.parent.top, + $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left, + ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top + ]; + + if(!(/^(document|window|parent)$/).test(o.containment)) { + var ce = $(o.containment)[0]; + var co = $(o.containment).offset(); + var over = ($(ce).css("overflow") != 'hidden'); + + this.containment = [ + co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left, + co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top, + co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left, + co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top + ]; + } + + }, + + _convertPositionTo: function(d, pos) { + + if(!pos) pos = this.position; + var mod = d == "absolute" ? 1 : -1; + var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); + + return { + top: ( + pos.top // The absolute mouse position + + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent + + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border) + - ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod) + ), + left: ( + pos.left // The absolute mouse position + + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent + + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border) + - ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod) + ) + }; + + }, + + _generatePosition: function(event) { + + var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); + + // This is another very weird special case that only happens for relative elements: + // 1. If the css position is relative + // 2. and the scroll parent is the document or similar to the offset parent + // we have to refresh the relative offset during the scroll so there are no jumps + if(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) { + this.offset.relative = this._getRelativeOffset(); + } + + var pageX = event.pageX; + var pageY = event.pageY; + + /* + * - Position constraining - + * Constrain the position to a mix of grid, containment. + */ + + if(this.originalPosition) { //If we are not dragging yet, we won't check for options + + if(this.containment) { + if(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left; + if(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top; + if(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left; + if(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top; + } + + if(o.grid) { + var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1]; + pageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top; + + var left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0]; + pageX = this.containment ? (!(left - this.offset.click.left < this.containment[0] || left - this.offset.click.left > this.containment[2]) ? left : (!(left - this.offset.click.left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left; + } + + } + + return { + top: ( + pageY // The absolute mouse position + - this.offset.click.top // Click offset (relative to the element) + - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent + - this.offset.parent.top // The offsetParent's offset without borders (offset + border) + + ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) )) + ), + left: ( + pageX // The absolute mouse position + - this.offset.click.left // Click offset (relative to the element) + - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent + - this.offset.parent.left // The offsetParent's offset without borders (offset + border) + + ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() )) + ) + }; + + }, + + _rearrange: function(event, i, a, hardRefresh) { + + a ? a[0].appendChild(this.placeholder[0]) : i.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction == 'down' ? i.item[0] : i.item[0].nextSibling)); + + //Various things done here to improve the performance: + // 1. we create a setTimeout, that calls refreshPositions + // 2. on the instance, we have a counter variable, that get's higher after every append + // 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same + // 4. this lets only the last addition to the timeout stack through + this.counter = this.counter ? ++this.counter : 1; + var counter = this.counter; + + this._delay(function() { + if(counter == this.counter) this.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove + }); + + }, + + _clear: function(event, noPropagation) { + + this.reverting = false; + // We delay all events that have to be triggered to after the point where the placeholder has been removed and + // everything else normalized again + var delayedTriggers = []; + + // We first have to update the dom position of the actual currentItem + // Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088) + if(!this._noFinalSort && this.currentItem.parent().length) this.placeholder.before(this.currentItem); + this._noFinalSort = null; + + if(this.helper[0] == this.currentItem[0]) { + for(var i in this._storedCSS) { + if(this._storedCSS[i] == 'auto' || this._storedCSS[i] == 'static') this._storedCSS[i] = ''; + } + this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"); + } else { + this.currentItem.show(); + } + + if(this.fromOutside && !noPropagation) delayedTriggers.push(function(event) { this._trigger("receive", event, this._uiHash(this.fromOutside)); }); + if((this.fromOutside || this.domPosition.prev != this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent != this.currentItem.parent()[0]) && !noPropagation) delayedTriggers.push(function(event) { this._trigger("update", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed + + // Check if the items Container has Changed and trigger appropriate + // events. + if (this !== this.currentContainer) { + if(!noPropagation) { + delayedTriggers.push(function(event) { this._trigger("remove", event, this._uiHash()); }); + delayedTriggers.push((function(c) { return function(event) { c._trigger("receive", event, this._uiHash(this)); }; }).call(this, this.currentContainer)); + delayedTriggers.push((function(c) { return function(event) { c._trigger("update", event, this._uiHash(this)); }; }).call(this, this.currentContainer)); + } + } + + + //Post events to containers + for (var i = this.containers.length - 1; i >= 0; i--){ + if(!noPropagation) delayedTriggers.push((function(c) { return function(event) { c._trigger("deactivate", event, this._uiHash(this)); }; }).call(this, this.containers[i])); + if(this.containers[i].containerCache.over) { + delayedTriggers.push((function(c) { return function(event) { c._trigger("out", event, this._uiHash(this)); }; }).call(this, this.containers[i])); + this.containers[i].containerCache.over = 0; + } + } + + //Do what was originally in plugins + if(this._storedCursor) $('body').css("cursor", this._storedCursor); //Reset cursor + if(this._storedOpacity) this.helper.css("opacity", this._storedOpacity); //Reset opacity + if(this._storedZIndex) this.helper.css("zIndex", this._storedZIndex == 'auto' ? '' : this._storedZIndex); //Reset z-index + + this.dragging = false; + if(this.cancelHelperRemoval) { + if(!noPropagation) { + this._trigger("beforeStop", event, this._uiHash()); + for (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events + this._trigger("stop", event, this._uiHash()); + } + + this.fromOutside = false; + return false; + } + + if(!noPropagation) this._trigger("beforeStop", event, this._uiHash()); + + //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node! + this.placeholder[0].parentNode.removeChild(this.placeholder[0]); + + if(this.helper[0] != this.currentItem[0]) this.helper.remove(); this.helper = null; + + if(!noPropagation) { + for (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events + this._trigger("stop", event, this._uiHash()); + } + + this.fromOutside = false; + return true; + + }, + + _trigger: function() { + if ($.Widget.prototype._trigger.apply(this, arguments) === false) { + this.cancel(); + } + }, + + _uiHash: function(_inst) { + var inst = _inst || this; + return { + helper: inst.helper, + placeholder: inst.placeholder || $([]), + position: inst.position, + originalPosition: inst.originalPosition, + offset: inst.positionAbs, + item: inst.currentItem, + sender: _inst ? _inst.element : null + }; + } + +}); + +})(jQuery); +(function( $, undefined ) { + +var uid = 0, + hideProps = {}, + showProps = {}; + +hideProps.height = hideProps.paddingTop = hideProps.paddingBottom = + hideProps.borderTopWidth = hideProps.borderBottomWidth = "hide"; +showProps.height = showProps.paddingTop = showProps.paddingBottom = + showProps.borderTopWidth = showProps.borderBottomWidth = "show"; + +$.widget( "ui.accordion", { + version: "1.9.1", + options: { + active: 0, + animate: {}, + collapsible: false, + event: "click", + header: "> li > :first-child,> :not(li):even", + heightStyle: "auto", + icons: { + activeHeader: "ui-icon-triangle-1-s", + header: "ui-icon-triangle-1-e" + }, + + // callbacks + activate: null, + beforeActivate: null + }, + + _create: function() { + var accordionId = this.accordionId = "ui-accordion-" + + (this.element.attr( "id" ) || ++uid), + options = this.options; + + this.prevShow = this.prevHide = $(); + this.element.addClass( "ui-accordion ui-widget ui-helper-reset" ); + + this.headers = this.element.find( options.header ) + .addClass( "ui-accordion-header ui-helper-reset ui-state-default ui-corner-all" ); + this._hoverable( this.headers ); + this._focusable( this.headers ); + + this.headers.next() + .addClass( "ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" ) + .hide(); + + // don't allow collapsible: false and active: false / null + if ( !options.collapsible && (options.active === false || options.active == null) ) { + options.active = 0; + } + // handle negative values + if ( options.active < 0 ) { + options.active += this.headers.length; + } + this.active = this._findActive( options.active ) + .addClass( "ui-accordion-header-active ui-state-active" ) + .toggleClass( "ui-corner-all ui-corner-top" ); + this.active.next() + .addClass( "ui-accordion-content-active" ) + .show(); + + this._createIcons(); + this.refresh(); + + // ARIA + this.element.attr( "role", "tablist" ); + + this.headers + .attr( "role", "tab" ) + .each(function( i ) { + var header = $( this ), + headerId = header.attr( "id" ), + panel = header.next(), + panelId = panel.attr( "id" ); + if ( !headerId ) { + headerId = accordionId + "-header-" + i; + header.attr( "id", headerId ); + } + if ( !panelId ) { + panelId = accordionId + "-panel-" + i; + panel.attr( "id", panelId ); + } + header.attr( "aria-controls", panelId ); + panel.attr( "aria-labelledby", headerId ); + }) + .next() + .attr( "role", "tabpanel" ); + + this.headers + .not( this.active ) + .attr({ + "aria-selected": "false", + tabIndex: -1 + }) + .next() + .attr({ + "aria-expanded": "false", + "aria-hidden": "true" + }) + .hide(); + + // make sure at least one header is in the tab order + if ( !this.active.length ) { + this.headers.eq( 0 ).attr( "tabIndex", 0 ); + } else { + this.active.attr({ + "aria-selected": "true", + tabIndex: 0 + }) + .next() + .attr({ + "aria-expanded": "true", + "aria-hidden": "false" + }); + } + + this._on( this.headers, { keydown: "_keydown" }); + this._on( this.headers.next(), { keydown: "_panelKeyDown" }); + this._setupEvents( options.event ); + }, + + _getCreateEventData: function() { + return { + header: this.active, + content: !this.active.length ? $() : this.active.next() + }; + }, + + _createIcons: function() { + var icons = this.options.icons; + if ( icons ) { + $( "<span>" ) + .addClass( "ui-accordion-header-icon ui-icon " + icons.header ) + .prependTo( this.headers ); + this.active.children( ".ui-accordion-header-icon" ) + .removeClass( icons.header ) + .addClass( icons.activeHeader ); + this.headers.addClass( "ui-accordion-icons" ); + } + }, + + _destroyIcons: function() { + this.headers + .removeClass( "ui-accordion-icons" ) + .children( ".ui-accordion-header-icon" ) + .remove(); + }, + + _destroy: function() { + var contents; + + // clean up main element + this.element + .removeClass( "ui-accordion ui-widget ui-helper-reset" ) + .removeAttr( "role" ); + + // clean up headers + this.headers + .removeClass( "ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top" ) + .removeAttr( "role" ) + .removeAttr( "aria-selected" ) + .removeAttr( "aria-controls" ) + .removeAttr( "tabIndex" ) + .each(function() { + if ( /^ui-accordion/.test( this.id ) ) { + this.removeAttribute( "id" ); + } + }); + this._destroyIcons(); + + // clean up content panels + contents = this.headers.next() + .css( "display", "" ) + .removeAttr( "role" ) + .removeAttr( "aria-expanded" ) + .removeAttr( "aria-hidden" ) + .removeAttr( "aria-labelledby" ) + .removeClass( "ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled" ) + .each(function() { + if ( /^ui-accordion/.test( this.id ) ) { + this.removeAttribute( "id" ); + } + }); + if ( this.options.heightStyle !== "content" ) { + contents.css( "height", "" ); + } + }, + + _setOption: function( key, value ) { + if ( key === "active" ) { + // _activate() will handle invalid values and update this.options + this._activate( value ); + return; + } + + if ( key === "event" ) { + if ( this.options.event ) { + this._off( this.headers, this.options.event ); + } + this._setupEvents( value ); + } + + this._super( key, value ); + + // setting collapsible: false while collapsed; open first panel + if ( key === "collapsible" && !value && this.options.active === false ) { + this._activate( 0 ); + } + + if ( key === "icons" ) { + this._destroyIcons(); + if ( value ) { + this._createIcons(); + } + } + + // #5332 - opacity doesn't cascade to positioned elements in IE + // so we need to add the disabled class to the headers and panels + if ( key === "disabled" ) { + this.headers.add( this.headers.next() ) + .toggleClass( "ui-state-disabled", !!value ); + } + }, + + _keydown: function( event ) { + if ( event.altKey || event.ctrlKey ) { + return; + } + + var keyCode = $.ui.keyCode, + length = this.headers.length, + currentIndex = this.headers.index( event.target ), + toFocus = false; + + switch ( event.keyCode ) { + case keyCode.RIGHT: + case keyCode.DOWN: + toFocus = this.headers[ ( currentIndex + 1 ) % length ]; + break; + case keyCode.LEFT: + case keyCode.UP: + toFocus = this.headers[ ( currentIndex - 1 + length ) % length ]; + break; + case keyCode.SPACE: + case keyCode.ENTER: + this._eventHandler( event ); + break; + case keyCode.HOME: + toFocus = this.headers[ 0 ]; + break; + case keyCode.END: + toFocus = this.headers[ length - 1 ]; + break; + } + + if ( toFocus ) { + $( event.target ).attr( "tabIndex", -1 ); + $( toFocus ).attr( "tabIndex", 0 ); + toFocus.focus(); + event.preventDefault(); + } + }, + + _panelKeyDown : function( event ) { + if ( event.keyCode === $.ui.keyCode.UP && event.ctrlKey ) { + $( event.currentTarget ).prev().focus(); + } + }, + + refresh: function() { + var maxHeight, overflow, + heightStyle = this.options.heightStyle, + parent = this.element.parent(); + + + if ( heightStyle === "fill" ) { + // IE 6 treats height like minHeight, so we need to turn off overflow + // in order to get a reliable height + // we use the minHeight support test because we assume that only + // browsers that don't support minHeight will treat height as minHeight + if ( !$.support.minHeight ) { + overflow = parent.css( "overflow" ); + parent.css( "overflow", "hidden"); + } + maxHeight = parent.height(); + this.element.siblings( ":visible" ).each(function() { + var elem = $( this ), + position = elem.css( "position" ); + + if ( position === "absolute" || position === "fixed" ) { + return; + } + maxHeight -= elem.outerHeight( true ); + }); + if ( overflow ) { + parent.css( "overflow", overflow ); + } + + this.headers.each(function() { + maxHeight -= $( this ).outerHeight( true ); + }); + + this.headers.next() + .each(function() { + $( this ).height( Math.max( 0, maxHeight - + $( this ).innerHeight() + $( this ).height() ) ); + }) + .css( "overflow", "auto" ); + } else if ( heightStyle === "auto" ) { + maxHeight = 0; + this.headers.next() + .each(function() { + maxHeight = Math.max( maxHeight, $( this ).height( "" ).height() ); + }) + .height( maxHeight ); + } + }, + + _activate: function( index ) { + var active = this._findActive( index )[ 0 ]; + + // trying to activate the already active panel + if ( active === this.active[ 0 ] ) { + return; + } + + // trying to collapse, simulate a click on the currently active header + active = active || this.active[ 0 ]; + + this._eventHandler({ + target: active, + currentTarget: active, + preventDefault: $.noop + }); + }, + + _findActive: function( selector ) { + return typeof selector === "number" ? this.headers.eq( selector ) : $(); + }, + + _setupEvents: function( event ) { + var events = {}; + if ( !event ) { + return; + } + $.each( event.split(" "), function( index, eventName ) { + events[ eventName ] = "_eventHandler"; + }); + this._on( this.headers, events ); + }, + + _eventHandler: function( event ) { + var options = this.options, + active = this.active, + clicked = $( event.currentTarget ), + clickedIsActive = clicked[ 0 ] === active[ 0 ], + collapsing = clickedIsActive && options.collapsible, + toShow = collapsing ? $() : clicked.next(), + toHide = active.next(), + eventData = { + oldHeader: active, + oldPanel: toHide, + newHeader: collapsing ? $() : clicked, + newPanel: toShow + }; + + event.preventDefault(); + + if ( + // click on active header, but not collapsible + ( clickedIsActive && !options.collapsible ) || + // allow canceling activation + ( this._trigger( "beforeActivate", event, eventData ) === false ) ) { + return; + } + + options.active = collapsing ? false : this.headers.index( clicked ); + + // when the call to ._toggle() comes after the class changes + // it causes a very odd bug in IE 8 (see #6720) + this.active = clickedIsActive ? $() : clicked; + this._toggle( eventData ); + + // switch classes + // corner classes on the previously active header stay after the animation + active.removeClass( "ui-accordion-header-active ui-state-active" ); + if ( options.icons ) { + active.children( ".ui-accordion-header-icon" ) + .removeClass( options.icons.activeHeader ) + .addClass( options.icons.header ); + } + + if ( !clickedIsActive ) { + clicked + .removeClass( "ui-corner-all" ) + .addClass( "ui-accordion-header-active ui-state-active ui-corner-top" ); + if ( options.icons ) { + clicked.children( ".ui-accordion-header-icon" ) + .removeClass( options.icons.header ) + .addClass( options.icons.activeHeader ); + } + + clicked + .next() + .addClass( "ui-accordion-content-active" ); + } + }, + + _toggle: function( data ) { + var toShow = data.newPanel, + toHide = this.prevShow.length ? this.prevShow : data.oldPanel; + + // handle activating a panel during the animation for another activation + this.prevShow.add( this.prevHide ).stop( true, true ); + this.prevShow = toShow; + this.prevHide = toHide; + + if ( this.options.animate ) { + this._animate( toShow, toHide, data ); + } else { + toHide.hide(); + toShow.show(); + this._toggleComplete( data ); + } + + toHide.attr({ + "aria-expanded": "false", + "aria-hidden": "true" + }); + toHide.prev().attr( "aria-selected", "false" ); + // if we're switching panels, remove the old header from the tab order + // if we're opening from collapsed state, remove the previous header from the tab order + // if we're collapsing, then keep the collapsing header in the tab order + if ( toShow.length && toHide.length ) { + toHide.prev().attr( "tabIndex", -1 ); + } else if ( toShow.length ) { + this.headers.filter(function() { + return $( this ).attr( "tabIndex" ) === 0; + }) + .attr( "tabIndex", -1 ); + } + + toShow + .attr({ + "aria-expanded": "true", + "aria-hidden": "false" + }) + .prev() + .attr({ + "aria-selected": "true", + tabIndex: 0 + }); + }, + + _animate: function( toShow, toHide, data ) { + var total, easing, duration, + that = this, + adjust = 0, + down = toShow.length && + ( !toHide.length || ( toShow.index() < toHide.index() ) ), + animate = this.options.animate || {}, + options = down && animate.down || animate, + complete = function() { + that._toggleComplete( data ); + }; + + if ( typeof options === "number" ) { + duration = options; + } + if ( typeof options === "string" ) { + easing = options; + } + // fall back from options to animation in case of partial down settings + easing = easing || options.easing || animate.easing; + duration = duration || options.duration || animate.duration; + + if ( !toHide.length ) { + return toShow.animate( showProps, duration, easing, complete ); + } + if ( !toShow.length ) { + return toHide.animate( hideProps, duration, easing, complete ); + } + + total = toShow.show().outerHeight(); + toHide.animate( hideProps, { + duration: duration, + easing: easing, + step: function( now, fx ) { + fx.now = Math.round( now ); + } + }); + toShow + .hide() + .animate( showProps, { + duration: duration, + easing: easing, + complete: complete, + step: function( now, fx ) { + fx.now = Math.round( now ); + if ( fx.prop !== "height" ) { + adjust += fx.now; + } else if ( that.options.heightStyle !== "content" ) { + fx.now = Math.round( total - toHide.outerHeight() - adjust ); + adjust = 0; + } + } + }); + }, + + _toggleComplete: function( data ) { + var toHide = data.oldPanel; + + toHide + .removeClass( "ui-accordion-content-active" ) + .prev() + .removeClass( "ui-corner-top" ) + .addClass( "ui-corner-all" ); + + // Work around for rendering bug in IE (#5421) + if ( toHide.length ) { + toHide.parent()[0].className = toHide.parent()[0].className; + } + + this._trigger( "activate", null, data ); + } +}); + + + +// DEPRECATED +if ( $.uiBackCompat !== false ) { + // navigation options + (function( $, prototype ) { + $.extend( prototype.options, { + navigation: false, + navigationFilter: function() { + return this.href.toLowerCase() === location.href.toLowerCase(); + } + }); + + var _create = prototype._create; + prototype._create = function() { + if ( this.options.navigation ) { + var that = this, + headers = this.element.find( this.options.header ), + content = headers.next(), + current = headers.add( content ) + .find( "a" ) + .filter( this.options.navigationFilter ) + [ 0 ]; + if ( current ) { + headers.add( content ).each( function( index ) { + if ( $.contains( this, current ) ) { + that.options.active = Math.floor( index / 2 ); + return false; + } + }); + } + } + _create.call( this ); + }; + }( jQuery, jQuery.ui.accordion.prototype ) ); + + // height options + (function( $, prototype ) { + $.extend( prototype.options, { + heightStyle: null, // remove default so we fall back to old values + autoHeight: true, // use heightStyle: "auto" + clearStyle: false, // use heightStyle: "content" + fillSpace: false // use heightStyle: "fill" + }); + + var _create = prototype._create, + _setOption = prototype._setOption; + + $.extend( prototype, { + _create: function() { + this.options.heightStyle = this.options.heightStyle || + this._mergeHeightStyle(); + + _create.call( this ); + }, + + _setOption: function( key ) { + if ( key === "autoHeight" || key === "clearStyle" || key === "fillSpace" ) { + this.options.heightStyle = this._mergeHeightStyle(); + } + _setOption.apply( this, arguments ); + }, + + _mergeHeightStyle: function() { + var options = this.options; + + if ( options.fillSpace ) { + return "fill"; + } + + if ( options.clearStyle ) { + return "content"; + } + + if ( options.autoHeight ) { + return "auto"; + } + } + }); + }( jQuery, jQuery.ui.accordion.prototype ) ); + + // icon options + (function( $, prototype ) { + $.extend( prototype.options.icons, { + activeHeader: null, // remove default so we fall back to old values + headerSelected: "ui-icon-triangle-1-s" + }); + + var _createIcons = prototype._createIcons; + prototype._createIcons = function() { + if ( this.options.icons ) { + this.options.icons.activeHeader = this.options.icons.activeHeader || + this.options.icons.headerSelected; + } + _createIcons.call( this ); + }; + }( jQuery, jQuery.ui.accordion.prototype ) ); + + // expanded active option, activate method + (function( $, prototype ) { + prototype.activate = prototype._activate; + + var _findActive = prototype._findActive; + prototype._findActive = function( index ) { + if ( index === -1 ) { + index = false; + } + if ( index && typeof index !== "number" ) { + index = this.headers.index( this.headers.filter( index ) ); + if ( index === -1 ) { + index = false; + } + } + return _findActive.call( this, index ); + }; + }( jQuery, jQuery.ui.accordion.prototype ) ); + + // resize method + jQuery.ui.accordion.prototype.resize = jQuery.ui.accordion.prototype.refresh; + + // change events + (function( $, prototype ) { + $.extend( prototype.options, { + change: null, + changestart: null + }); + + var _trigger = prototype._trigger; + prototype._trigger = function( type, event, data ) { + var ret = _trigger.apply( this, arguments ); + if ( !ret ) { + return false; + } + + if ( type === "beforeActivate" ) { + ret = _trigger.call( this, "changestart", event, { + oldHeader: data.oldHeader, + oldContent: data.oldPanel, + newHeader: data.newHeader, + newContent: data.newPanel + }); + } else if ( type === "activate" ) { + ret = _trigger.call( this, "change", event, { + oldHeader: data.oldHeader, + oldContent: data.oldPanel, + newHeader: data.newHeader, + newContent: data.newPanel + }); + } + return ret; + }; + }( jQuery, jQuery.ui.accordion.prototype ) ); + + // animated option + // NOTE: this only provides support for "slide", "bounceslide", and easings + // not the full $.ui.accordion.animations API + (function( $, prototype ) { + $.extend( prototype.options, { + animate: null, + animated: "slide" + }); + + var _create = prototype._create; + prototype._create = function() { + var options = this.options; + if ( options.animate === null ) { + if ( !options.animated ) { + options.animate = false; + } else if ( options.animated === "slide" ) { + options.animate = 300; + } else if ( options.animated === "bounceslide" ) { + options.animate = { + duration: 200, + down: { + easing: "easeOutBounce", + duration: 1000 + } + }; + } else { + options.animate = options.animated; + } + } + + _create.call( this ); + }; + }( jQuery, jQuery.ui.accordion.prototype ) ); +} + +})( jQuery ); +(function( $, undefined ) { + +// used to prevent race conditions with remote data sources +var requestIndex = 0; + +$.widget( "ui.autocomplete", { + version: "1.9.1", + defaultElement: "<input>", + options: { + appendTo: "body", + autoFocus: false, + delay: 300, + minLength: 1, + position: { + my: "left top", + at: "left bottom", + collision: "none" + }, + source: null, + + // callbacks + change: null, + close: null, + focus: null, + open: null, + response: null, + search: null, + select: null + }, + + pending: 0, + + _create: function() { + // Some browsers only repeat keydown events, not keypress events, + // so we use the suppressKeyPress flag to determine if we've already + // handled the keydown event. #7269 + // Unfortunately the code for & in keypress is the same as the up arrow, + // so we use the suppressKeyPressRepeat flag to avoid handling keypress + // events when we know the keydown event was used to modify the + // search term. #7799 + var suppressKeyPress, suppressKeyPressRepeat, suppressInput; + + this.isMultiLine = this._isMultiLine(); + this.valueMethod = this.element[ this.element.is( "input,textarea" ) ? "val" : "text" ]; + this.isNewMenu = true; + + this.element + .addClass( "ui-autocomplete-input" ) + .attr( "autocomplete", "off" ); + + this._on( this.element, { + keydown: function( event ) { + if ( this.element.prop( "readOnly" ) ) { + suppressKeyPress = true; + suppressInput = true; + suppressKeyPressRepeat = true; + return; + } + + suppressKeyPress = false; + suppressInput = false; + suppressKeyPressRepeat = false; + var keyCode = $.ui.keyCode; + switch( event.keyCode ) { + case keyCode.PAGE_UP: + suppressKeyPress = true; + this._move( "previousPage", event ); + break; + case keyCode.PAGE_DOWN: + suppressKeyPress = true; + this._move( "nextPage", event ); + break; + case keyCode.UP: + suppressKeyPress = true; + this._keyEvent( "previous", event ); + break; + case keyCode.DOWN: + suppressKeyPress = true; + this._keyEvent( "next", event ); + break; + case keyCode.ENTER: + case keyCode.NUMPAD_ENTER: + // when menu is open and has focus + if ( this.menu.active ) { + // #6055 - Opera still allows the keypress to occur + // which causes forms to submit + suppressKeyPress = true; + event.preventDefault(); + this.menu.select( event ); + } + break; + case keyCode.TAB: + if ( this.menu.active ) { + this.menu.select( event ); + } + break; + case keyCode.ESCAPE: + if ( this.menu.element.is( ":visible" ) ) { + this._value( this.term ); + this.close( event ); + // Different browsers have different default behavior for escape + // Single press can mean undo or clear + // Double press in IE means clear the whole form + event.preventDefault(); + } + break; + default: + suppressKeyPressRepeat = true; + // search timeout should be triggered before the input value is changed + this._searchTimeout( event ); + break; + } + }, + keypress: function( event ) { + if ( suppressKeyPress ) { + suppressKeyPress = false; + event.preventDefault(); + return; + } + if ( suppressKeyPressRepeat ) { + return; + } + + // replicate some key handlers to allow them to repeat in Firefox and Opera + var keyCode = $.ui.keyCode; + switch( event.keyCode ) { + case keyCode.PAGE_UP: + this._move( "previousPage", event ); + break; + case keyCode.PAGE_DOWN: + this._move( "nextPage", event ); + break; + case keyCode.UP: + this._keyEvent( "previous", event ); + break; + case keyCode.DOWN: + this._keyEvent( "next", event ); + break; + } + }, + input: function( event ) { + if ( suppressInput ) { + suppressInput = false; + event.preventDefault(); + return; + } + this._searchTimeout( event ); + }, + focus: function() { + this.selectedItem = null; + this.previous = this._value(); + }, + blur: function( event ) { + if ( this.cancelBlur ) { + delete this.cancelBlur; + return; + } + + clearTimeout( this.searching ); + this.close( event ); + this._change( event ); + } + }); + + this._initSource(); + this.menu = $( "<ul>" ) + .addClass( "ui-autocomplete" ) + .appendTo( this.document.find( this.options.appendTo || "body" )[ 0 ] ) + .menu({ + // custom key handling for now + input: $(), + // disable ARIA support, the live region takes care of that + role: null + }) + .zIndex( this.element.zIndex() + 1 ) + .hide() + .data( "menu" ); + + this._on( this.menu.element, { + mousedown: function( event ) { + // prevent moving focus out of the text field + event.preventDefault(); + + // IE doesn't prevent moving focus even with event.preventDefault() + // so we set a flag to know when we should ignore the blur event + this.cancelBlur = true; + this._delay(function() { + delete this.cancelBlur; + }); + + // clicking on the scrollbar causes focus to shift to the body + // but we can't detect a mouseup or a click immediately afterward + // so we have to track the next mousedown and close the menu if + // the user clicks somewhere outside of the autocomplete + var menuElement = this.menu.element[ 0 ]; + if ( !$( event.target ).closest( ".ui-menu-item" ).length ) { + this._delay(function() { + var that = this; + this.document.one( "mousedown", function( event ) { + if ( event.target !== that.element[ 0 ] && + event.target !== menuElement && + !$.contains( menuElement, event.target ) ) { + that.close(); + } + }); + }); + } + }, + menufocus: function( event, ui ) { + // #7024 - Prevent accidental activation of menu items in Firefox + if ( this.isNewMenu ) { + this.isNewMenu = false; + if ( event.originalEvent && /^mouse/.test( event.originalEvent.type ) ) { + this.menu.blur(); + + this.document.one( "mousemove", function() { + $( event.target ).trigger( event.originalEvent ); + }); + + return; + } + } + + // back compat for _renderItem using item.autocomplete, via #7810 + // TODO remove the fallback, see #8156 + var item = ui.item.data( "ui-autocomplete-item" ) || ui.item.data( "item.autocomplete" ); + if ( false !== this._trigger( "focus", event, { item: item } ) ) { + // use value to match what will end up in the input, if it was a key event + if ( event.originalEvent && /^key/.test( event.originalEvent.type ) ) { + this._value( item.value ); + } + } else { + // Normally the input is populated with the item's value as the + // menu is navigated, causing screen readers to notice a change and + // announce the item. Since the focus event was canceled, this doesn't + // happen, so we update the live region so that screen readers can + // still notice the change and announce it. + this.liveRegion.text( item.value ); + } + }, + menuselect: function( event, ui ) { + // back compat for _renderItem using item.autocomplete, via #7810 + // TODO remove the fallback, see #8156 + var item = ui.item.data( "ui-autocomplete-item" ) || ui.item.data( "item.autocomplete" ), + previous = this.previous; + + // only trigger when focus was lost (click on menu) + if ( this.element[0] !== this.document[0].activeElement ) { + this.element.focus(); + this.previous = previous; + // #6109 - IE triggers two focus events and the second + // is asynchronous, so we need to reset the previous + // term synchronously and asynchronously :-( + this._delay(function() { + this.previous = previous; + this.selectedItem = item; + }); + } + + if ( false !== this._trigger( "select", event, { item: item } ) ) { + this._value( item.value ); + } + // reset the term after the select event + // this allows custom select handling to work properly + this.term = this._value(); + + this.close( event ); + this.selectedItem = item; + } + }); + + this.liveRegion = $( "<span>", { + role: "status", + "aria-live": "polite" + }) + .addClass( "ui-helper-hidden-accessible" ) + .insertAfter( this.element ); + + if ( $.fn.bgiframe ) { + this.menu.element.bgiframe(); + } + + // turning off autocomplete prevents the browser from remembering the + // value when navigating through history, so we re-enable autocomplete + // if the page is unloaded before the widget is destroyed. #7790 + this._on( this.window, { + beforeunload: function() { + this.element.removeAttr( "autocomplete" ); + } + }); + }, + + _destroy: function() { + clearTimeout( this.searching ); + this.element + .removeClass( "ui-autocomplete-input" ) + .removeAttr( "autocomplete" ); + this.menu.element.remove(); + this.liveRegion.remove(); + }, + + _setOption: function( key, value ) { + this._super( key, value ); + if ( key === "source" ) { + this._initSource(); + } + if ( key === "appendTo" ) { + this.menu.element.appendTo( this.document.find( value || "body" )[0] ); + } + if ( key === "disabled" && value && this.xhr ) { + this.xhr.abort(); + } + }, + + _isMultiLine: function() { + // Textareas are always multi-line + if ( this.element.is( "textarea" ) ) { + return true; + } + // Inputs are always single-line, even if inside a contentEditable element + // IE also treats inputs as contentEditable + if ( this.element.is( "input" ) ) { + return false; + } + // All other element types are determined by whether or not they're contentEditable + return this.element.prop( "isContentEditable" ); + }, + + _initSource: function() { + var array, url, + that = this; + if ( $.isArray(this.options.source) ) { + array = this.options.source; + this.source = function( request, response ) { + response( $.ui.autocomplete.filter( array, request.term ) ); + }; + } else if ( typeof this.options.source === "string" ) { + url = this.options.source; + this.source = function( request, response ) { + if ( that.xhr ) { + that.xhr.abort(); + } + that.xhr = $.ajax({ + url: url, + data: request, + dataType: "json", + success: function( data ) { + response( data ); + }, + error: function() { + response( [] ); + } + }); + }; + } else { + this.source = this.options.source; + } + }, + + _searchTimeout: function( event ) { + clearTimeout( this.searching ); + this.searching = this._delay(function() { + // only search if the value has changed + if ( this.term !== this._value() ) { + this.selectedItem = null; + this.search( null, event ); + } + }, this.options.delay ); + }, + + search: function( value, event ) { + value = value != null ? value : this._value(); + + // always save the actual value, not the one passed as an argument + this.term = this._value(); + + if ( value.length < this.options.minLength ) { + return this.close( event ); + } + + if ( this._trigger( "search", event ) === false ) { + return; + } + + return this._search( value ); + }, + + _search: function( value ) { + this.pending++; + this.element.addClass( "ui-autocomplete-loading" ); + this.cancelSearch = false; + + this.source( { term: value }, this._response() ); + }, + + _response: function() { + var that = this, + index = ++requestIndex; + + return function( content ) { + if ( index === requestIndex ) { + that.__response( content ); + } + + that.pending--; + if ( !that.pending ) { + that.element.removeClass( "ui-autocomplete-loading" ); + } + }; + }, + + __response: function( content ) { + if ( content ) { + content = this._normalize( content ); + } + this._trigger( "response", null, { content: content } ); + if ( !this.options.disabled && content && content.length && !this.cancelSearch ) { + this._suggest( content ); + this._trigger( "open" ); + } else { + // use ._close() instead of .close() so we don't cancel future searches + this._close(); + } + }, + + close: function( event ) { + this.cancelSearch = true; + this._close( event ); + }, + + _close: function( event ) { + if ( this.menu.element.is( ":visible" ) ) { + this.menu.element.hide(); + this.menu.blur(); + this.isNewMenu = true; + this._trigger( "close", event ); + } + }, + + _change: function( event ) { + if ( this.previous !== this._value() ) { + this._trigger( "change", event, { item: this.selectedItem } ); + } + }, + + _normalize: function( items ) { + // assume all items have the right format when the first item is complete + if ( items.length && items[0].label && items[0].value ) { + return items; + } + return $.map( items, function( item ) { + if ( typeof item === "string" ) { + return { + label: item, + value: item + }; + } + return $.extend({ + label: item.label || item.value, + value: item.value || item.label + }, item ); + }); + }, + + _suggest: function( items ) { + var ul = this.menu.element + .empty() + .zIndex( this.element.zIndex() + 1 ); + this._renderMenu( ul, items ); + this.menu.refresh(); + + // size and position menu + ul.show(); + this._resizeMenu(); + ul.position( $.extend({ + of: this.element + }, this.options.position )); + + if ( this.options.autoFocus ) { + this.menu.next(); + } + }, + + _resizeMenu: function() { + var ul = this.menu.element; + ul.outerWidth( Math.max( + // Firefox wraps long text (possibly a rounding bug) + // so we add 1px to avoid the wrapping (#7513) + ul.width( "" ).outerWidth() + 1, + this.element.outerWidth() + ) ); + }, + + _renderMenu: function( ul, items ) { + var that = this; + $.each( items, function( index, item ) { + that._renderItemData( ul, item ); + }); + }, + + _renderItemData: function( ul, item ) { + return this._renderItem( ul, item ).data( "ui-autocomplete-item", item ); + }, + + _renderItem: function( ul, item ) { + return $( "<li>" ) + .append( $( "<a>" ).text( item.label ) ) + .appendTo( ul ); + }, + + _move: function( direction, event ) { + if ( !this.menu.element.is( ":visible" ) ) { + this.search( null, event ); + return; + } + if ( this.menu.isFirstItem() && /^previous/.test( direction ) || + this.menu.isLastItem() && /^next/.test( direction ) ) { + this._value( this.term ); + this.menu.blur(); + return; + } + this.menu[ direction ]( event ); + }, + + widget: function() { + return this.menu.element; + }, + + _value: function() { + return this.valueMethod.apply( this.element, arguments ); + }, + + _keyEvent: function( keyEvent, event ) { + if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) { + this._move( keyEvent, event ); + + // prevents moving cursor to beginning/end of the text field in some browsers + event.preventDefault(); + } + } +}); + +$.extend( $.ui.autocomplete, { + escapeRegex: function( value ) { + return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&"); + }, + filter: function(array, term) { + var matcher = new RegExp( $.ui.autocomplete.escapeRegex(term), "i" ); + return $.grep( array, function(value) { + return matcher.test( value.label || value.value || value ); + }); + } +}); + + +// live region extension, adding a `messages` option +// NOTE: This is an experimental API. We are still investigating +// a full solution for string manipulation and internationalization. +$.widget( "ui.autocomplete", $.ui.autocomplete, { + options: { + messages: { + noResults: "No search results.", + results: function( amount ) { + return amount + ( amount > 1 ? " results are" : " result is" ) + + " available, use up and down arrow keys to navigate."; + } + } + }, + + __response: function( content ) { + var message; + this._superApply( arguments ); + if ( this.options.disabled || this.cancelSearch ) { + return; + } + if ( content && content.length ) { + message = this.options.messages.results( content.length ); + } else { + message = this.options.messages.noResults; + } + this.liveRegion.text( message ); + } +}); + + +}( jQuery )); +(function( $, undefined ) { + +var lastActive, startXPos, startYPos, clickDragged, + baseClasses = "ui-button ui-widget ui-state-default ui-corner-all", + stateClasses = "ui-state-hover ui-state-active ", + typeClasses = "ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only", + formResetHandler = function() { + var buttons = $( this ).find( ":ui-button" ); + setTimeout(function() { + buttons.button( "refresh" ); + }, 1 ); + }, + radioGroup = function( radio ) { + var name = radio.name, + form = radio.form, + radios = $( [] ); + if ( name ) { + if ( form ) { + radios = $( form ).find( "[name='" + name + "']" ); + } else { + radios = $( "[name='" + name + "']", radio.ownerDocument ) + .filter(function() { + return !this.form; + }); + } + } + return radios; + }; + +$.widget( "ui.button", { + version: "1.9.1", + defaultElement: "<button>", + options: { + disabled: null, + text: true, + label: null, + icons: { + primary: null, + secondary: null + } + }, + _create: function() { + this.element.closest( "form" ) + .unbind( "reset" + this.eventNamespace ) + .bind( "reset" + this.eventNamespace, formResetHandler ); + + if ( typeof this.options.disabled !== "boolean" ) { + this.options.disabled = !!this.element.prop( "disabled" ); + } else { + this.element.prop( "disabled", this.options.disabled ); + } + + this._determineButtonType(); + this.hasTitle = !!this.buttonElement.attr( "title" ); + + var that = this, + options = this.options, + toggleButton = this.type === "checkbox" || this.type === "radio", + hoverClass = "ui-state-hover" + ( !toggleButton ? " ui-state-active" : "" ), + focusClass = "ui-state-focus"; + + if ( options.label === null ) { + options.label = (this.type === "input" ? this.buttonElement.val() : this.buttonElement.html()); + } + + this.buttonElement + .addClass( baseClasses ) + .attr( "role", "button" ) + .bind( "mouseenter" + this.eventNamespace, function() { + if ( options.disabled ) { + return; + } + $( this ).addClass( "ui-state-hover" ); + if ( this === lastActive ) { + $( this ).addClass( "ui-state-active" ); + } + }) + .bind( "mouseleave" + this.eventNamespace, function() { + if ( options.disabled ) { + return; + } + $( this ).removeClass( hoverClass ); + }) + .bind( "click" + this.eventNamespace, function( event ) { + if ( options.disabled ) { + event.preventDefault(); + event.stopImmediatePropagation(); + } + }); + + this.element + .bind( "focus" + this.eventNamespace, function() { + // no need to check disabled, focus won't be triggered anyway + that.buttonElement.addClass( focusClass ); + }) + .bind( "blur" + this.eventNamespace, function() { + that.buttonElement.removeClass( focusClass ); + }); + + if ( toggleButton ) { + this.element.bind( "change" + this.eventNamespace, function() { + if ( clickDragged ) { + return; + } + that.refresh(); + }); + // if mouse moves between mousedown and mouseup (drag) set clickDragged flag + // prevents issue where button state changes but checkbox/radio checked state + // does not in Firefox (see ticket #6970) + this.buttonElement + .bind( "mousedown" + this.eventNamespace, function( event ) { + if ( options.disabled ) { + return; + } + clickDragged = false; + startXPos = event.pageX; + startYPos = event.pageY; + }) + .bind( "mouseup" + this.eventNamespace, function( event ) { + if ( options.disabled ) { + return; + } + if ( startXPos !== event.pageX || startYPos !== event.pageY ) { + clickDragged = true; + } + }); + } + + if ( this.type === "checkbox" ) { + this.buttonElement.bind( "click" + this.eventNamespace, function() { + if ( options.disabled || clickDragged ) { + return false; + } + $( this ).toggleClass( "ui-state-active" ); + that.buttonElement.attr( "aria-pressed", that.element[0].checked ); + }); + } else if ( this.type === "radio" ) { + this.buttonElement.bind( "click" + this.eventNamespace, function() { + if ( options.disabled || clickDragged ) { + return false; + } + $( this ).addClass( "ui-state-active" ); + that.buttonElement.attr( "aria-pressed", "true" ); + + var radio = that.element[ 0 ]; + radioGroup( radio ) + .not( radio ) + .map(function() { + return $( this ).button( "widget" )[ 0 ]; + }) + .removeClass( "ui-state-active" ) + .attr( "aria-pressed", "false" ); + }); + } else { + this.buttonElement + .bind( "mousedown" + this.eventNamespace, function() { + if ( options.disabled ) { + return false; + } + $( this ).addClass( "ui-state-active" ); + lastActive = this; + that.document.one( "mouseup", function() { + lastActive = null; + }); + }) + .bind( "mouseup" + this.eventNamespace, function() { + if ( options.disabled ) { + return false; + } + $( this ).removeClass( "ui-state-active" ); + }) + .bind( "keydown" + this.eventNamespace, function(event) { + if ( options.disabled ) { + return false; + } + if ( event.keyCode === $.ui.keyCode.SPACE || event.keyCode === $.ui.keyCode.ENTER ) { + $( this ).addClass( "ui-state-active" ); + } + }) + .bind( "keyup" + this.eventNamespace, function() { + $( this ).removeClass( "ui-state-active" ); + }); + + if ( this.buttonElement.is("a") ) { + this.buttonElement.keyup(function(event) { + if ( event.keyCode === $.ui.keyCode.SPACE ) { + // TODO pass through original event correctly (just as 2nd argument doesn't work) + $( this ).click(); + } + }); + } + } + + // TODO: pull out $.Widget's handling for the disabled option into + // $.Widget.prototype._setOptionDisabled so it's easy to proxy and can + // be overridden by individual plugins + this._setOption( "disabled", options.disabled ); + this._resetButton(); + }, + + _determineButtonType: function() { + var ancestor, labelSelector, checked; + + if ( this.element.is("[type=checkbox]") ) { + this.type = "checkbox"; + } else if ( this.element.is("[type=radio]") ) { + this.type = "radio"; + } else if ( this.element.is("input") ) { + this.type = "input"; + } else { + this.type = "button"; + } + + if ( this.type === "checkbox" || this.type === "radio" ) { + // we don't search against the document in case the element + // is disconnected from the DOM + ancestor = this.element.parents().last(); + labelSelector = "label[for='" + this.element.attr("id") + "']"; + this.buttonElement = ancestor.find( labelSelector ); + if ( !this.buttonElement.length ) { + ancestor = ancestor.length ? ancestor.siblings() : this.element.siblings(); + this.buttonElement = ancestor.filter( labelSelector ); + if ( !this.buttonElement.length ) { + this.buttonElement = ancestor.find( labelSelector ); + } + } + this.element.addClass( "ui-helper-hidden-accessible" ); + + checked = this.element.is( ":checked" ); + if ( checked ) { + this.buttonElement.addClass( "ui-state-active" ); + } + this.buttonElement.prop( "aria-pressed", checked ); + } else { + this.buttonElement = this.element; + } + }, + + widget: function() { + return this.buttonElement; + }, + + _destroy: function() { + this.element + .removeClass( "ui-helper-hidden-accessible" ); + this.buttonElement + .removeClass( baseClasses + " " + stateClasses + " " + typeClasses ) + .removeAttr( "role" ) + .removeAttr( "aria-pressed" ) + .html( this.buttonElement.find(".ui-button-text").html() ); + + if ( !this.hasTitle ) { + this.buttonElement.removeAttr( "title" ); + } + }, + + _setOption: function( key, value ) { + this._super( key, value ); + if ( key === "disabled" ) { + if ( value ) { + this.element.prop( "disabled", true ); + } else { + this.element.prop( "disabled", false ); + } + return; + } + this._resetButton(); + }, + + refresh: function() { + var isDisabled = this.element.is( ":disabled" ) || this.element.hasClass( "ui-button-disabled" ); + if ( isDisabled !== this.options.disabled ) { + this._setOption( "disabled", isDisabled ); + } + if ( this.type === "radio" ) { + radioGroup( this.element[0] ).each(function() { + if ( $( this ).is( ":checked" ) ) { + $( this ).button( "widget" ) + .addClass( "ui-state-active" ) + .attr( "aria-pressed", "true" ); + } else { + $( this ).button( "widget" ) + .removeClass( "ui-state-active" ) + .attr( "aria-pressed", "false" ); + } + }); + } else if ( this.type === "checkbox" ) { + if ( this.element.is( ":checked" ) ) { + this.buttonElement + .addClass( "ui-state-active" ) + .attr( "aria-pressed", "true" ); + } else { + this.buttonElement + .removeClass( "ui-state-active" ) + .attr( "aria-pressed", "false" ); + } + } + }, + + _resetButton: function() { + if ( this.type === "input" ) { + if ( this.options.label ) { + this.element.val( this.options.label ); + } + return; + } + var buttonElement = this.buttonElement.removeClass( typeClasses ), + buttonText = $( "<span></span>", this.document[0] ) + .addClass( "ui-button-text" ) + .html( this.options.label ) + .appendTo( buttonElement.empty() ) + .text(), + icons = this.options.icons, + multipleIcons = icons.primary && icons.secondary, + buttonClasses = []; + + if ( icons.primary || icons.secondary ) { + if ( this.options.text ) { + buttonClasses.push( "ui-button-text-icon" + ( multipleIcons ? "s" : ( icons.primary ? "-primary" : "-secondary" ) ) ); + } + + if ( icons.primary ) { + buttonElement.prepend( "<span class='ui-button-icon-primary ui-icon " + icons.primary + "'></span>" ); + } + + if ( icons.secondary ) { + buttonElement.append( "<span class='ui-button-icon-secondary ui-icon " + icons.secondary + "'></span>" ); + } + + if ( !this.options.text ) { + buttonClasses.push( multipleIcons ? "ui-button-icons-only" : "ui-button-icon-only" ); + + if ( !this.hasTitle ) { + buttonElement.attr( "title", $.trim( buttonText ) ); + } + } + } else { + buttonClasses.push( "ui-button-text-only" ); + } + buttonElement.addClass( buttonClasses.join( " " ) ); + } +}); + +$.widget( "ui.buttonset", { + version: "1.9.1", + options: { + items: "button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(button)" + }, + + _create: function() { + this.element.addClass( "ui-buttonset" ); + }, + + _init: function() { + this.refresh(); + }, + + _setOption: function( key, value ) { + if ( key === "disabled" ) { + this.buttons.button( "option", key, value ); + } + + this._super( key, value ); + }, + + refresh: function() { + var rtl = this.element.css( "direction" ) === "rtl"; + + this.buttons = this.element.find( this.options.items ) + .filter( ":ui-button" ) + .button( "refresh" ) + .end() + .not( ":ui-button" ) + .button() + .end() + .map(function() { + return $( this ).button( "widget" )[ 0 ]; + }) + .removeClass( "ui-corner-all ui-corner-left ui-corner-right" ) + .filter( ":first" ) + .addClass( rtl ? "ui-corner-right" : "ui-corner-left" ) + .end() + .filter( ":last" ) + .addClass( rtl ? "ui-corner-left" : "ui-corner-right" ) + .end() + .end(); + }, + + _destroy: function() { + this.element.removeClass( "ui-buttonset" ); + this.buttons + .map(function() { + return $( this ).button( "widget" )[ 0 ]; + }) + .removeClass( "ui-corner-left ui-corner-right" ) + .end() + .button( "destroy" ); + } +}); + +}( jQuery ) ); +(function( $, undefined ) { + +$.extend($.ui, { datepicker: { version: "1.9.1" } }); + +var PROP_NAME = 'datepicker'; +var dpuuid = new Date().getTime(); +var instActive; + +/* Date picker manager. + Use the singleton instance of this class, $.datepicker, to interact with the date picker. + Settings for (groups of) date pickers are maintained in an instance object, + allowing multiple different settings on the same page. */ + +function Datepicker() { + this.debug = false; // Change this to true to start debugging + this._curInst = null; // The current instance in use + this._keyEvent = false; // If the last event was a key event + this._disabledInputs = []; // List of date picker inputs that have been disabled + this._datepickerShowing = false; // True if the popup picker is showing , false if not + this._inDialog = false; // True if showing within a "dialog", false if not + this._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division + this._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class + this._appendClass = 'ui-datepicker-append'; // The name of the append marker class + this._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class + this._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class + this._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class + this._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class + this._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class + this._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of the day hover marker class + this.regional = []; // Available regional settings, indexed by language code + this.regional[''] = { // Default regional settings + closeText: 'Done', // Display text for close link + prevText: 'Prev', // Display text for previous month link + nextText: 'Next', // Display text for next month link + currentText: 'Today', // Display text for current month link + monthNames: ['January','February','March','April','May','June', + 'July','August','September','October','November','December'], // Names of months for drop-down and formatting + monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting + dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting + dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting + dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday + weekHeader: 'Wk', // Column header for week of the year + dateFormat: 'mm/dd/yy', // See format options on parseDate + firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ... + isRTL: false, // True if right-to-left language, false if left-to-right + showMonthAfterYear: false, // True if the year select precedes month, false for month then year + yearSuffix: '' // Additional text to append to the year in the month headers + }; + this._defaults = { // Global defaults for all the date picker instances + showOn: 'focus', // 'focus' for popup on focus, + // 'button' for trigger button, or 'both' for either + showAnim: 'fadeIn', // Name of jQuery animation for popup + showOptions: {}, // Options for enhanced animations + defaultDate: null, // Used when field is blank: actual date, + // +/-number for offset from today, null for today + appendText: '', // Display text following the input box, e.g. showing the format + buttonText: '...', // Text for trigger button + buttonImage: '', // URL for trigger button image + buttonImageOnly: false, // True if the image appears alone, false if it appears on a button + hideIfNoPrevNext: false, // True to hide next/previous month links + // if not applicable, false to just disable them + navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links + gotoCurrent: false, // True if today link goes back to current selection instead + changeMonth: false, // True if month can be selected directly, false if only prev/next + changeYear: false, // True if year can be selected directly, false if only prev/next + yearRange: 'c-10:c+10', // Range of years to display in drop-down, + // either relative to today's year (-nn:+nn), relative to currently displayed year + // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n) + showOtherMonths: false, // True to show dates in other months, false to leave blank + selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable + showWeek: false, // True to show week of the year, false to not show it + calculateWeek: this.iso8601Week, // How to calculate the week of the year, + // takes a Date and returns the number of the week for it + shortYearCutoff: '+10', // Short year values < this are in the current century, + // > this are in the previous century, + // string value starting with '+' for current year + value + minDate: null, // The earliest selectable date, or null for no limit + maxDate: null, // The latest selectable date, or null for no limit + duration: 'fast', // Duration of display/closure + beforeShowDay: null, // Function that takes a date and returns an array with + // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '', + // [2] = cell title (optional), e.g. $.datepicker.noWeekends + beforeShow: null, // Function that takes an input field and + // returns a set of custom settings for the date picker + onSelect: null, // Define a callback function when a date is selected + onChangeMonthYear: null, // Define a callback function when the month or year is changed + onClose: null, // Define a callback function when the datepicker is closed + numberOfMonths: 1, // Number of months to show at a time + showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0) + stepMonths: 1, // Number of months to step back/forward + stepBigMonths: 12, // Number of months to step back/forward for the big links + altField: '', // Selector for an alternate field to store selected dates into + altFormat: '', // The date format to use for the alternate field + constrainInput: true, // The input is constrained by the current date format + showButtonPanel: false, // True to show button panel, false to not show it + autoSize: false, // True to size the input for the date format, false to leave as is + disabled: false // The initial disabled state + }; + $.extend(this._defaults, this.regional['']); + this.dpDiv = bindHover($('<div id="' + this._mainDivId + '" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')); +} + +$.extend(Datepicker.prototype, { + /* Class name added to elements to indicate already configured with a date picker. */ + markerClassName: 'hasDatepicker', + + //Keep track of the maximum number of rows displayed (see #7043) + maxRows: 4, + + /* Debug logging (if enabled). */ + log: function () { + if (this.debug) + console.log.apply('', arguments); + }, + + // TODO rename to "widget" when switching to widget factory + _widgetDatepicker: function() { + return this.dpDiv; + }, + + /* Override the default settings for all instances of the date picker. + @param settings object - the new settings to use as defaults (anonymous object) + @return the manager object */ + setDefaults: function(settings) { + extendRemove(this._defaults, settings || {}); + return this; + }, + + /* Attach the date picker to a jQuery selection. + @param target element - the target input field or division or span + @param settings object - the new settings to use for this date picker instance (anonymous) */ + _attachDatepicker: function(target, settings) { + // check for settings on the control itself - in namespace 'date:' + var inlineSettings = null; + for (var attrName in this._defaults) { + var attrValue = target.getAttribute('date:' + attrName); + if (attrValue) { + inlineSettings = inlineSettings || {}; + try { + inlineSettings[attrName] = eval(attrValue); + } catch (err) { + inlineSettings[attrName] = attrValue; + } + } + } + var nodeName = target.nodeName.toLowerCase(); + var inline = (nodeName == 'div' || nodeName == 'span'); + if (!target.id) { + this.uuid += 1; + target.id = 'dp' + this.uuid; + } + var inst = this._newInst($(target), inline); + inst.settings = $.extend({}, settings || {}, inlineSettings || {}); + if (nodeName == 'input') { + this._connectDatepicker(target, inst); + } else if (inline) { + this._inlineDatepicker(target, inst); + } + }, + + /* Create a new instance object. */ + _newInst: function(target, inline) { + var id = target[0].id.replace(/([^A-Za-z0-9_-])/g, '\\\\$1'); // escape jQuery meta chars + return {id: id, input: target, // associated target + selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection + drawMonth: 0, drawYear: 0, // month being drawn + inline: inline, // is datepicker inline or not + dpDiv: (!inline ? this.dpDiv : // presentation div + bindHover($('<div class="' + this._inlineClass + ' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')))}; + }, + + /* Attach the date picker to an input field. */ + _connectDatepicker: function(target, inst) { + var input = $(target); + inst.append = $([]); + inst.trigger = $([]); + if (input.hasClass(this.markerClassName)) + return; + this._attachments(input, inst); + input.addClass(this.markerClassName).keydown(this._doKeyDown). + keypress(this._doKeyPress).keyup(this._doKeyUp). + bind("setData.datepicker", function(event, key, value) { + inst.settings[key] = value; + }).bind("getData.datepicker", function(event, key) { + return this._get(inst, key); + }); + this._autoSize(inst); + $.data(target, PROP_NAME, inst); + //If disabled option is true, disable the datepicker once it has been attached to the input (see ticket #5665) + if( inst.settings.disabled ) { + this._disableDatepicker( target ); + } + }, + + /* Make attachments based on settings. */ + _attachments: function(input, inst) { + var appendText = this._get(inst, 'appendText'); + var isRTL = this._get(inst, 'isRTL'); + if (inst.append) + inst.append.remove(); + if (appendText) { + inst.append = $('<span class="' + this._appendClass + '">' + appendText + '</span>'); + input[isRTL ? 'before' : 'after'](inst.append); + } + input.unbind('focus', this._showDatepicker); + if (inst.trigger) + inst.trigger.remove(); + var showOn = this._get(inst, 'showOn'); + if (showOn == 'focus' || showOn == 'both') // pop-up date picker when in the marked field + input.focus(this._showDatepicker); + if (showOn == 'button' || showOn == 'both') { // pop-up date picker when button clicked + var buttonText = this._get(inst, 'buttonText'); + var buttonImage = this._get(inst, 'buttonImage'); + inst.trigger = $(this._get(inst, 'buttonImageOnly') ? + $('<img/>').addClass(this._triggerClass). + attr({ src: buttonImage, alt: buttonText, title: buttonText }) : + $('<button type="button"></button>').addClass(this._triggerClass). + html(buttonImage == '' ? buttonText : $('<img/>').attr( + { src:buttonImage, alt:buttonText, title:buttonText }))); + input[isRTL ? 'before' : 'after'](inst.trigger); + inst.trigger.click(function() { + if ($.datepicker._datepickerShowing && $.datepicker._lastInput == input[0]) + $.datepicker._hideDatepicker(); + else if ($.datepicker._datepickerShowing && $.datepicker._lastInput != input[0]) { + $.datepicker._hideDatepicker(); + $.datepicker._showDatepicker(input[0]); + } else + $.datepicker._showDatepicker(input[0]); + return false; + }); + } + }, + + /* Apply the maximum length for the date format. */ + _autoSize: function(inst) { + if (this._get(inst, 'autoSize') && !inst.inline) { + var date = new Date(2009, 12 - 1, 20); // Ensure double digits + var dateFormat = this._get(inst, 'dateFormat'); + if (dateFormat.match(/[DM]/)) { + var findMax = function(names) { + var max = 0; + var maxI = 0; + for (var i = 0; i < names.length; i++) { + if (names[i].length > max) { + max = names[i].length; + maxI = i; + } + } + return maxI; + }; + date.setMonth(findMax(this._get(inst, (dateFormat.match(/MM/) ? + 'monthNames' : 'monthNamesShort')))); + date.setDate(findMax(this._get(inst, (dateFormat.match(/DD/) ? + 'dayNames' : 'dayNamesShort'))) + 20 - date.getDay()); + } + inst.input.attr('size', this._formatDate(inst, date).length); + } + }, + + /* Attach an inline date picker to a div. */ + _inlineDatepicker: function(target, inst) { + var divSpan = $(target); + if (divSpan.hasClass(this.markerClassName)) + return; + divSpan.addClass(this.markerClassName).append(inst.dpDiv). + bind("setData.datepicker", function(event, key, value){ + inst.settings[key] = value; + }).bind("getData.datepicker", function(event, key){ + return this._get(inst, key); + }); + $.data(target, PROP_NAME, inst); + this._setDate(inst, this._getDefaultDate(inst), true); + this._updateDatepicker(inst); + this._updateAlternate(inst); + //If disabled option is true, disable the datepicker before showing it (see ticket #5665) + if( inst.settings.disabled ) { + this._disableDatepicker( target ); + } + // Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements + // http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height + inst.dpDiv.css( "display", "block" ); + }, + + /* Pop-up the date picker in a "dialog" box. + @param input element - ignored + @param date string or Date - the initial date to display + @param onSelect function - the function to call when a date is selected + @param settings object - update the dialog date picker instance's settings (anonymous object) + @param pos int[2] - coordinates for the dialog's position within the screen or + event - with x/y coordinates or + leave empty for default (screen centre) + @return the manager object */ + _dialogDatepicker: function(input, date, onSelect, settings, pos) { + var inst = this._dialogInst; // internal instance + if (!inst) { + this.uuid += 1; + var id = 'dp' + this.uuid; + this._dialogInput = $('<input type="text" id="' + id + + '" style="position: absolute; top: -100px; width: 0px;"/>'); + this._dialogInput.keydown(this._doKeyDown); + $('body').append(this._dialogInput); + inst = this._dialogInst = this._newInst(this._dialogInput, false); + inst.settings = {}; + $.data(this._dialogInput[0], PROP_NAME, inst); + } + extendRemove(inst.settings, settings || {}); + date = (date && date.constructor == Date ? this._formatDate(inst, date) : date); + this._dialogInput.val(date); + + this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null); + if (!this._pos) { + var browserWidth = document.documentElement.clientWidth; + var browserHeight = document.documentElement.clientHeight; + var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft; + var scrollY = document.documentElement.scrollTop || document.body.scrollTop; + this._pos = // should use actual width/height below + [(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY]; + } + + // move input on screen for focus, but hidden behind dialog + this._dialogInput.css('left', (this._pos[0] + 20) + 'px').css('top', this._pos[1] + 'px'); + inst.settings.onSelect = onSelect; + this._inDialog = true; + this.dpDiv.addClass(this._dialogClass); + this._showDatepicker(this._dialogInput[0]); + if ($.blockUI) + $.blockUI(this.dpDiv); + $.data(this._dialogInput[0], PROP_NAME, inst); + return this; + }, + + /* Detach a datepicker from its control. + @param target element - the target input field or division or span */ + _destroyDatepicker: function(target) { + var $target = $(target); + var inst = $.data(target, PROP_NAME); + if (!$target.hasClass(this.markerClassName)) { + return; + } + var nodeName = target.nodeName.toLowerCase(); + $.removeData(target, PROP_NAME); + if (nodeName == 'input') { + inst.append.remove(); + inst.trigger.remove(); + $target.removeClass(this.markerClassName). + unbind('focus', this._showDatepicker). + unbind('keydown', this._doKeyDown). + unbind('keypress', this._doKeyPress). + unbind('keyup', this._doKeyUp); + } else if (nodeName == 'div' || nodeName == 'span') + $target.removeClass(this.markerClassName).empty(); + }, + + /* Enable the date picker to a jQuery selection. + @param target element - the target input field or division or span */ + _enableDatepicker: function(target) { + var $target = $(target); + var inst = $.data(target, PROP_NAME); + if (!$target.hasClass(this.markerClassName)) { + return; + } + var nodeName = target.nodeName.toLowerCase(); + if (nodeName == 'input') { + target.disabled = false; + inst.trigger.filter('button'). + each(function() { this.disabled = false; }).end(). + filter('img').css({opacity: '1.0', cursor: ''}); + } + else if (nodeName == 'div' || nodeName == 'span') { + var inline = $target.children('.' + this._inlineClass); + inline.children().removeClass('ui-state-disabled'); + inline.find("select.ui-datepicker-month, select.ui-datepicker-year"). + prop("disabled", false); + } + this._disabledInputs = $.map(this._disabledInputs, + function(value) { return (value == target ? null : value); }); // delete entry + }, + + /* Disable the date picker to a jQuery selection. + @param target element - the target input field or division or span */ + _disableDatepicker: function(target) { + var $target = $(target); + var inst = $.data(target, PROP_NAME); + if (!$target.hasClass(this.markerClassName)) { + return; + } + var nodeName = target.nodeName.toLowerCase(); + if (nodeName == 'input') { + target.disabled = true; + inst.trigger.filter('button'). + each(function() { this.disabled = true; }).end(). + filter('img').css({opacity: '0.5', cursor: 'default'}); + } + else if (nodeName == 'div' || nodeName == 'span') { + var inline = $target.children('.' + this._inlineClass); + inline.children().addClass('ui-state-disabled'); + inline.find("select.ui-datepicker-month, select.ui-datepicker-year"). + prop("disabled", true); + } + this._disabledInputs = $.map(this._disabledInputs, + function(value) { return (value == target ? null : value); }); // delete entry + this._disabledInputs[this._disabledInputs.length] = target; + }, + + /* Is the first field in a jQuery collection disabled as a datepicker? + @param target element - the target input field or division or span + @return boolean - true if disabled, false if enabled */ + _isDisabledDatepicker: function(target) { + if (!target) { + return false; + } + for (var i = 0; i < this._disabledInputs.length; i++) { + if (this._disabledInputs[i] == target) + return true; + } + return false; + }, + + /* Retrieve the instance data for the target control. + @param target element - the target input field or division or span + @return object - the associated instance data + @throws error if a jQuery problem getting data */ + _getInst: function(target) { + try { + return $.data(target, PROP_NAME); + } + catch (err) { + throw 'Missing instance data for this datepicker'; + } + }, + + /* Update or retrieve the settings for a date picker attached to an input field or division. + @param target element - the target input field or division or span + @param name object - the new settings to update or + string - the name of the setting to change or retrieve, + when retrieving also 'all' for all instance settings or + 'defaults' for all global defaults + @param value any - the new value for the setting + (omit if above is an object or to retrieve a value) */ + _optionDatepicker: function(target, name, value) { + var inst = this._getInst(target); + if (arguments.length == 2 && typeof name == 'string') { + return (name == 'defaults' ? $.extend({}, $.datepicker._defaults) : + (inst ? (name == 'all' ? $.extend({}, inst.settings) : + this._get(inst, name)) : null)); + } + var settings = name || {}; + if (typeof name == 'string') { + settings = {}; + settings[name] = value; + } + if (inst) { + if (this._curInst == inst) { + this._hideDatepicker(); + } + var date = this._getDateDatepicker(target, true); + var minDate = this._getMinMaxDate(inst, 'min'); + var maxDate = this._getMinMaxDate(inst, 'max'); + extendRemove(inst.settings, settings); + // reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided + if (minDate !== null && settings['dateFormat'] !== undefined && settings['minDate'] === undefined) + inst.settings.minDate = this._formatDate(inst, minDate); + if (maxDate !== null && settings['dateFormat'] !== undefined && settings['maxDate'] === undefined) + inst.settings.maxDate = this._formatDate(inst, maxDate); + this._attachments($(target), inst); + this._autoSize(inst); + this._setDate(inst, date); + this._updateAlternate(inst); + this._updateDatepicker(inst); + } + }, + + // change method deprecated + _changeDatepicker: function(target, name, value) { + this._optionDatepicker(target, name, value); + }, + + /* Redraw the date picker attached to an input field or division. + @param target element - the target input field or division or span */ + _refreshDatepicker: function(target) { + var inst = this._getInst(target); + if (inst) { + this._updateDatepicker(inst); + } + }, + + /* Set the dates for a jQuery selection. + @param target element - the target input field or division or span + @param date Date - the new date */ + _setDateDatepicker: function(target, date) { + var inst = this._getInst(target); + if (inst) { + this._setDate(inst, date); + this._updateDatepicker(inst); + this._updateAlternate(inst); + } + }, + + /* Get the date(s) for the first entry in a jQuery selection. + @param target element - the target input field or division or span + @param noDefault boolean - true if no default date is to be used + @return Date - the current date */ + _getDateDatepicker: function(target, noDefault) { + var inst = this._getInst(target); + if (inst && !inst.inline) + this._setDateFromField(inst, noDefault); + return (inst ? this._getDate(inst) : null); + }, + + /* Handle keystrokes. */ + _doKeyDown: function(event) { + var inst = $.datepicker._getInst(event.target); + var handled = true; + var isRTL = inst.dpDiv.is('.ui-datepicker-rtl'); + inst._keyEvent = true; + if ($.datepicker._datepickerShowing) + switch (event.keyCode) { + case 9: $.datepicker._hideDatepicker(); + handled = false; + break; // hide on tab out + case 13: var sel = $('td.' + $.datepicker._dayOverClass + ':not(.' + + $.datepicker._currentClass + ')', inst.dpDiv); + if (sel[0]) + $.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]); + var onSelect = $.datepicker._get(inst, 'onSelect'); + if (onSelect) { + var dateStr = $.datepicker._formatDate(inst); + + // trigger custom callback + onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]); + } + else + $.datepicker._hideDatepicker(); + return false; // don't submit the form + break; // select the value on enter + case 27: $.datepicker._hideDatepicker(); + break; // hide on escape + case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ? + -$.datepicker._get(inst, 'stepBigMonths') : + -$.datepicker._get(inst, 'stepMonths')), 'M'); + break; // previous month/year on page up/+ ctrl + case 34: $.datepicker._adjustDate(event.target, (event.ctrlKey ? + +$.datepicker._get(inst, 'stepBigMonths') : + +$.datepicker._get(inst, 'stepMonths')), 'M'); + break; // next month/year on page down/+ ctrl + case 35: if (event.ctrlKey || event.metaKey) $.datepicker._clearDate(event.target); + handled = event.ctrlKey || event.metaKey; + break; // clear on ctrl or command +end + case 36: if (event.ctrlKey || event.metaKey) $.datepicker._gotoToday(event.target); + handled = event.ctrlKey || event.metaKey; + break; // current on ctrl or command +home + case 37: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), 'D'); + handled = event.ctrlKey || event.metaKey; + // -1 day on ctrl or command +left + if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ? + -$.datepicker._get(inst, 'stepBigMonths') : + -$.datepicker._get(inst, 'stepMonths')), 'M'); + // next month/year on alt +left on Mac + break; + case 38: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, -7, 'D'); + handled = event.ctrlKey || event.metaKey; + break; // -1 week on ctrl or command +up + case 39: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), 'D'); + handled = event.ctrlKey || event.metaKey; + // +1 day on ctrl or command +right + if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ? + +$.datepicker._get(inst, 'stepBigMonths') : + +$.datepicker._get(inst, 'stepMonths')), 'M'); + // next month/year on alt +right + break; + case 40: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, +7, 'D'); + handled = event.ctrlKey || event.metaKey; + break; // +1 week on ctrl or command +down + default: handled = false; + } + else if (event.keyCode == 36 && event.ctrlKey) // display the date picker on ctrl+home + $.datepicker._showDatepicker(this); + else { + handled = false; + } + if (handled) { + event.preventDefault(); + event.stopPropagation(); + } + }, + + /* Filter entered characters - based on date format. */ + _doKeyPress: function(event) { + var inst = $.datepicker._getInst(event.target); + if ($.datepicker._get(inst, 'constrainInput')) { + var chars = $.datepicker._possibleChars($.datepicker._get(inst, 'dateFormat')); + var chr = String.fromCharCode(event.charCode == undefined ? event.keyCode : event.charCode); + return event.ctrlKey || event.metaKey || (chr < ' ' || !chars || chars.indexOf(chr) > -1); + } + }, + + /* Synchronise manual entry and field/alternate field. */ + _doKeyUp: function(event) { + var inst = $.datepicker._getInst(event.target); + if (inst.input.val() != inst.lastVal) { + try { + var date = $.datepicker.parseDate($.datepicker._get(inst, 'dateFormat'), + (inst.input ? inst.input.val() : null), + $.datepicker._getFormatConfig(inst)); + if (date) { // only if valid + $.datepicker._setDateFromField(inst); + $.datepicker._updateAlternate(inst); + $.datepicker._updateDatepicker(inst); + } + } + catch (err) { + $.datepicker.log(err); + } + } + return true; + }, + + /* Pop-up the date picker for a given input field. + If false returned from beforeShow event handler do not show. + @param input element - the input field attached to the date picker or + event - if triggered by focus */ + _showDatepicker: function(input) { + input = input.target || input; + if (input.nodeName.toLowerCase() != 'input') // find from button/image trigger + input = $('input', input.parentNode)[0]; + if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput == input) // already here + return; + var inst = $.datepicker._getInst(input); + if ($.datepicker._curInst && $.datepicker._curInst != inst) { + $.datepicker._curInst.dpDiv.stop(true, true); + if ( inst && $.datepicker._datepickerShowing ) { + $.datepicker._hideDatepicker( $.datepicker._curInst.input[0] ); + } + } + var beforeShow = $.datepicker._get(inst, 'beforeShow'); + var beforeShowSettings = beforeShow ? beforeShow.apply(input, [input, inst]) : {}; + if(beforeShowSettings === false){ + //false + return; + } + extendRemove(inst.settings, beforeShowSettings); + inst.lastVal = null; + $.datepicker._lastInput = input; + $.datepicker._setDateFromField(inst); + if ($.datepicker._inDialog) // hide cursor + input.value = ''; + if (!$.datepicker._pos) { // position below input + $.datepicker._pos = $.datepicker._findPos(input); + $.datepicker._pos[1] += input.offsetHeight; // add the height + } + var isFixed = false; + $(input).parents().each(function() { + isFixed |= $(this).css('position') == 'fixed'; + return !isFixed; + }); + var offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]}; + $.datepicker._pos = null; + //to avoid flashes on Firefox + inst.dpDiv.empty(); + // determine sizing offscreen + inst.dpDiv.css({position: 'absolute', display: 'block', top: '-1000px'}); + $.datepicker._updateDatepicker(inst); + // fix width for dynamic number of date pickers + // and adjust position before showing + offset = $.datepicker._checkOffset(inst, offset, isFixed); + inst.dpDiv.css({position: ($.datepicker._inDialog && $.blockUI ? + 'static' : (isFixed ? 'fixed' : 'absolute')), display: 'none', + left: offset.left + 'px', top: offset.top + 'px'}); + if (!inst.inline) { + var showAnim = $.datepicker._get(inst, 'showAnim'); + var duration = $.datepicker._get(inst, 'duration'); + var postProcess = function() { + var cover = inst.dpDiv.find('iframe.ui-datepicker-cover'); // IE6- only + if( !! cover.length ){ + var borders = $.datepicker._getBorders(inst.dpDiv); + cover.css({left: -borders[0], top: -borders[1], + width: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight()}); + } + }; + inst.dpDiv.zIndex($(input).zIndex()+1); + $.datepicker._datepickerShowing = true; + + // DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed + if ( $.effects && ( $.effects.effect[ showAnim ] || $.effects[ showAnim ] ) ) + inst.dpDiv.show(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess); + else + inst.dpDiv[showAnim || 'show']((showAnim ? duration : null), postProcess); + if (!showAnim || !duration) + postProcess(); + if (inst.input.is(':visible') && !inst.input.is(':disabled')) + inst.input.focus(); + $.datepicker._curInst = inst; + } + }, + + /* Generate the date picker content. */ + _updateDatepicker: function(inst) { + this.maxRows = 4; //Reset the max number of rows being displayed (see #7043) + var borders = $.datepicker._getBorders(inst.dpDiv); + instActive = inst; // for delegate hover events + inst.dpDiv.empty().append(this._generateHTML(inst)); + this._attachHandlers(inst); + var cover = inst.dpDiv.find('iframe.ui-datepicker-cover'); // IE6- only + if( !!cover.length ){ //avoid call to outerXXXX() when not in IE6 + cover.css({left: -borders[0], top: -borders[1], width: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight()}) + } + inst.dpDiv.find('.' + this._dayOverClass + ' a').mouseover(); + var numMonths = this._getNumberOfMonths(inst); + var cols = numMonths[1]; + var width = 17; + inst.dpDiv.removeClass('ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4').width(''); + if (cols > 1) + inst.dpDiv.addClass('ui-datepicker-multi-' + cols).css('width', (width * cols) + 'em'); + inst.dpDiv[(numMonths[0] != 1 || numMonths[1] != 1 ? 'add' : 'remove') + + 'Class']('ui-datepicker-multi'); + inst.dpDiv[(this._get(inst, 'isRTL') ? 'add' : 'remove') + + 'Class']('ui-datepicker-rtl'); + if (inst == $.datepicker._curInst && $.datepicker._datepickerShowing && inst.input && + // #6694 - don't focus the input if it's already focused + // this breaks the change event in IE + inst.input.is(':visible') && !inst.input.is(':disabled') && inst.input[0] != document.activeElement) + inst.input.focus(); + // deffered render of the years select (to avoid flashes on Firefox) + if( inst.yearshtml ){ + var origyearshtml = inst.yearshtml; + setTimeout(function(){ + //assure that inst.yearshtml didn't change. + if( origyearshtml === inst.yearshtml && inst.yearshtml ){ + inst.dpDiv.find('select.ui-datepicker-year:first').replaceWith(inst.yearshtml); + } + origyearshtml = inst.yearshtml = null; + }, 0); + } + }, + + /* Retrieve the size of left and top borders for an element. + @param elem (jQuery object) the element of interest + @return (number[2]) the left and top borders */ + _getBorders: function(elem) { + var convert = function(value) { + return {thin: 1, medium: 2, thick: 3}[value] || value; + }; + return [parseFloat(convert(elem.css('border-left-width'))), + parseFloat(convert(elem.css('border-top-width')))]; + }, + + /* Check positioning to remain on screen. */ + _checkOffset: function(inst, offset, isFixed) { + var dpWidth = inst.dpDiv.outerWidth(); + var dpHeight = inst.dpDiv.outerHeight(); + var inputWidth = inst.input ? inst.input.outerWidth() : 0; + var inputHeight = inst.input ? inst.input.outerHeight() : 0; + var viewWidth = document.documentElement.clientWidth + (isFixed ? 0 : $(document).scrollLeft()); + var viewHeight = document.documentElement.clientHeight + (isFixed ? 0 : $(document).scrollTop()); + + offset.left -= (this._get(inst, 'isRTL') ? (dpWidth - inputWidth) : 0); + offset.left -= (isFixed && offset.left == inst.input.offset().left) ? $(document).scrollLeft() : 0; + offset.top -= (isFixed && offset.top == (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0; + + // now check if datepicker is showing outside window viewport - move to a better place if so. + offset.left -= Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ? + Math.abs(offset.left + dpWidth - viewWidth) : 0); + offset.top -= Math.min(offset.top, (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ? + Math.abs(dpHeight + inputHeight) : 0); + + return offset; + }, + + /* Find an object's position on the screen. */ + _findPos: function(obj) { + var inst = this._getInst(obj); + var isRTL = this._get(inst, 'isRTL'); + while (obj && (obj.type == 'hidden' || obj.nodeType != 1 || $.expr.filters.hidden(obj))) { + obj = obj[isRTL ? 'previousSibling' : 'nextSibling']; + } + var position = $(obj).offset(); + return [position.left, position.top]; + }, + + /* Hide the date picker from view. + @param input element - the input field attached to the date picker */ + _hideDatepicker: function(input) { + var inst = this._curInst; + if (!inst || (input && inst != $.data(input, PROP_NAME))) + return; + if (this._datepickerShowing) { + var showAnim = this._get(inst, 'showAnim'); + var duration = this._get(inst, 'duration'); + var postProcess = function() { + $.datepicker._tidyDialog(inst); + }; + + // DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed + if ( $.effects && ( $.effects.effect[ showAnim ] || $.effects[ showAnim ] ) ) + inst.dpDiv.hide(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess); + else + inst.dpDiv[(showAnim == 'slideDown' ? 'slideUp' : + (showAnim == 'fadeIn' ? 'fadeOut' : 'hide'))]((showAnim ? duration : null), postProcess); + if (!showAnim) + postProcess(); + this._datepickerShowing = false; + var onClose = this._get(inst, 'onClose'); + if (onClose) + onClose.apply((inst.input ? inst.input[0] : null), + [(inst.input ? inst.input.val() : ''), inst]); + this._lastInput = null; + if (this._inDialog) { + this._dialogInput.css({ position: 'absolute', left: '0', top: '-100px' }); + if ($.blockUI) { + $.unblockUI(); + $('body').append(this.dpDiv); + } + } + this._inDialog = false; + } + }, + + /* Tidy up after a dialog display. */ + _tidyDialog: function(inst) { + inst.dpDiv.removeClass(this._dialogClass).unbind('.ui-datepicker-calendar'); + }, + + /* Close date picker if clicked elsewhere. */ + _checkExternalClick: function(event) { + if (!$.datepicker._curInst) + return; + + var $target = $(event.target), + inst = $.datepicker._getInst($target[0]); + + if ( ( ( $target[0].id != $.datepicker._mainDivId && + $target.parents('#' + $.datepicker._mainDivId).length == 0 && + !$target.hasClass($.datepicker.markerClassName) && + !$target.closest("." + $.datepicker._triggerClass).length && + $.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI) ) ) || + ( $target.hasClass($.datepicker.markerClassName) && $.datepicker._curInst != inst ) ) + $.datepicker._hideDatepicker(); + }, + + /* Adjust one of the date sub-fields. */ + _adjustDate: function(id, offset, period) { + var target = $(id); + var inst = this._getInst(target[0]); + if (this._isDisabledDatepicker(target[0])) { + return; + } + this._adjustInstDate(inst, offset + + (period == 'M' ? this._get(inst, 'showCurrentAtPos') : 0), // undo positioning + period); + this._updateDatepicker(inst); + }, + + /* Action for current link. */ + _gotoToday: function(id) { + var target = $(id); + var inst = this._getInst(target[0]); + if (this._get(inst, 'gotoCurrent') && inst.currentDay) { + inst.selectedDay = inst.currentDay; + inst.drawMonth = inst.selectedMonth = inst.currentMonth; + inst.drawYear = inst.selectedYear = inst.currentYear; + } + else { + var date = new Date(); + inst.selectedDay = date.getDate(); + inst.drawMonth = inst.selectedMonth = date.getMonth(); + inst.drawYear = inst.selectedYear = date.getFullYear(); + } + this._notifyChange(inst); + this._adjustDate(target); + }, + + /* Action for selecting a new month/year. */ + _selectMonthYear: function(id, select, period) { + var target = $(id); + var inst = this._getInst(target[0]); + inst['selected' + (period == 'M' ? 'Month' : 'Year')] = + inst['draw' + (period == 'M' ? 'Month' : 'Year')] = + parseInt(select.options[select.selectedIndex].value,10); + this._notifyChange(inst); + this._adjustDate(target); + }, + + /* Action for selecting a day. */ + _selectDay: function(id, month, year, td) { + var target = $(id); + if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) { + return; + } + var inst = this._getInst(target[0]); + inst.selectedDay = inst.currentDay = $('a', td).html(); + inst.selectedMonth = inst.currentMonth = month; + inst.selectedYear = inst.currentYear = year; + this._selectDate(id, this._formatDate(inst, + inst.currentDay, inst.currentMonth, inst.currentYear)); + }, + + /* Erase the input field and hide the date picker. */ + _clearDate: function(id) { + var target = $(id); + var inst = this._getInst(target[0]); + this._selectDate(target, ''); + }, + + /* Update the input field with the selected date. */ + _selectDate: function(id, dateStr) { + var target = $(id); + var inst = this._getInst(target[0]); + dateStr = (dateStr != null ? dateStr : this._formatDate(inst)); + if (inst.input) + inst.input.val(dateStr); + this._updateAlternate(inst); + var onSelect = this._get(inst, 'onSelect'); + if (onSelect) + onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]); // trigger custom callback + else if (inst.input) + inst.input.trigger('change'); // fire the change event + if (inst.inline) + this._updateDatepicker(inst); + else { + this._hideDatepicker(); + this._lastInput = inst.input[0]; + if (typeof(inst.input[0]) != 'object') + inst.input.focus(); // restore focus + this._lastInput = null; + } + }, + + /* Update any alternate field to synchronise with the main field. */ + _updateAlternate: function(inst) { + var altField = this._get(inst, 'altField'); + if (altField) { // update alternate field too + var altFormat = this._get(inst, 'altFormat') || this._get(inst, 'dateFormat'); + var date = this._getDate(inst); + var dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst)); + $(altField).each(function() { $(this).val(dateStr); }); + } + }, + + /* Set as beforeShowDay function to prevent selection of weekends. + @param date Date - the date to customise + @return [boolean, string] - is this date selectable?, what is its CSS class? */ + noWeekends: function(date) { + var day = date.getDay(); + return [(day > 0 && day < 6), '']; + }, + + /* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition. + @param date Date - the date to get the week for + @return number - the number of the week within the year that contains this date */ + iso8601Week: function(date) { + var checkDate = new Date(date.getTime()); + // Find Thursday of this week starting on Monday + checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7)); + var time = checkDate.getTime(); + checkDate.setMonth(0); // Compare with Jan 1 + checkDate.setDate(1); + return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1; + }, + + /* Parse a string value into a date object. + See formatDate below for the possible formats. + + @param format string - the expected format of the date + @param value string - the date in the above format + @param settings Object - attributes include: + shortYearCutoff number - the cutoff year for determining the century (optional) + dayNamesShort string[7] - abbreviated names of the days from Sunday (optional) + dayNames string[7] - names of the days from Sunday (optional) + monthNamesShort string[12] - abbreviated names of the months (optional) + monthNames string[12] - names of the months (optional) + @return Date - the extracted date value or null if value is blank */ + parseDate: function (format, value, settings) { + if (format == null || value == null) + throw 'Invalid arguments'; + value = (typeof value == 'object' ? value.toString() : value + ''); + if (value == '') + return null; + var shortYearCutoff = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff; + shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff : + new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10)); + var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort; + var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames; + var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort; + var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames; + var year = -1; + var month = -1; + var day = -1; + var doy = -1; + var literal = false; + // Check whether a format character is doubled + var lookAhead = function(match) { + var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match); + if (matches) + iFormat++; + return matches; + }; + // Extract a number from the string value + var getNumber = function(match) { + var isDoubled = lookAhead(match); + var size = (match == '@' ? 14 : (match == '!' ? 20 : + (match == 'y' && isDoubled ? 4 : (match == 'o' ? 3 : 2)))); + var digits = new RegExp('^\\d{1,' + size + '}'); + var num = value.substring(iValue).match(digits); + if (!num) + throw 'Missing number at position ' + iValue; + iValue += num[0].length; + return parseInt(num[0], 10); + }; + // Extract a name from the string value and convert to an index + var getName = function(match, shortNames, longNames) { + var names = $.map(lookAhead(match) ? longNames : shortNames, function (v, k) { + return [ [k, v] ]; + }).sort(function (a, b) { + return -(a[1].length - b[1].length); + }); + var index = -1; + $.each(names, function (i, pair) { + var name = pair[1]; + if (value.substr(iValue, name.length).toLowerCase() == name.toLowerCase()) { + index = pair[0]; + iValue += name.length; + return false; + } + }); + if (index != -1) + return index + 1; + else + throw 'Unknown name at position ' + iValue; + }; + // Confirm that a literal character matches the string value + var checkLiteral = function() { + if (value.charAt(iValue) != format.charAt(iFormat)) + throw 'Unexpected literal at position ' + iValue; + iValue++; + }; + var iValue = 0; + for (var iFormat = 0; iFormat < format.length; iFormat++) { + if (literal) + if (format.charAt(iFormat) == "'" && !lookAhead("'")) + literal = false; + else + checkLiteral(); + else + switch (format.charAt(iFormat)) { + case 'd': + day = getNumber('d'); + break; + case 'D': + getName('D', dayNamesShort, dayNames); + break; + case 'o': + doy = getNumber('o'); + break; + case 'm': + month = getNumber('m'); + break; + case 'M': + month = getName('M', monthNamesShort, monthNames); + break; + case 'y': + year = getNumber('y'); + break; + case '@': + var date = new Date(getNumber('@')); + year = date.getFullYear(); + month = date.getMonth() + 1; + day = date.getDate(); + break; + case '!': + var date = new Date((getNumber('!') - this._ticksTo1970) / 10000); + year = date.getFullYear(); + month = date.getMonth() + 1; + day = date.getDate(); + break; + case "'": + if (lookAhead("'")) + checkLiteral(); + else + literal = true; + break; + default: + checkLiteral(); + } + } + if (iValue < value.length){ + var extra = value.substr(iValue); + if (!/^\s+/.test(extra)) { + throw "Extra/unparsed characters found in date: " + extra; + } + } + if (year == -1) + year = new Date().getFullYear(); + else if (year < 100) + year += new Date().getFullYear() - new Date().getFullYear() % 100 + + (year <= shortYearCutoff ? 0 : -100); + if (doy > -1) { + month = 1; + day = doy; + do { + var dim = this._getDaysInMonth(year, month - 1); + if (day <= dim) + break; + month++; + day -= dim; + } while (true); + } + var date = this._daylightSavingAdjust(new Date(year, month - 1, day)); + if (date.getFullYear() != year || date.getMonth() + 1 != month || date.getDate() != day) + throw 'Invalid date'; // E.g. 31/02/00 + return date; + }, + + /* Standard date formats. */ + ATOM: 'yy-mm-dd', // RFC 3339 (ISO 8601) + COOKIE: 'D, dd M yy', + ISO_8601: 'yy-mm-dd', + RFC_822: 'D, d M y', + RFC_850: 'DD, dd-M-y', + RFC_1036: 'D, d M y', + RFC_1123: 'D, d M yy', + RFC_2822: 'D, d M yy', + RSS: 'D, d M y', // RFC 822 + TICKS: '!', + TIMESTAMP: '@', + W3C: 'yy-mm-dd', // ISO 8601 + + _ticksTo1970: (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) + + Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000), + + /* Format a date object into a string value. + The format can be combinations of the following: + d - day of month (no leading zero) + dd - day of month (two digit) + o - day of year (no leading zeros) + oo - day of year (three digit) + D - day name short + DD - day name long + m - month of year (no leading zero) + mm - month of year (two digit) + M - month name short + MM - month name long + y - year (two digit) + yy - year (four digit) + @ - Unix timestamp (ms since 01/01/1970) + ! - Windows ticks (100ns since 01/01/0001) + '...' - literal text + '' - single quote + + @param format string - the desired format of the date + @param date Date - the date value to format + @param settings Object - attributes include: + dayNamesShort string[7] - abbreviated names of the days from Sunday (optional) + dayNames string[7] - names of the days from Sunday (optional) + monthNamesShort string[12] - abbreviated names of the months (optional) + monthNames string[12] - names of the months (optional) + @return string - the date in the above format */ + formatDate: function (format, date, settings) { + if (!date) + return ''; + var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort; + var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames; + var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort; + var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames; + // Check whether a format character is doubled + var lookAhead = function(match) { + var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match); + if (matches) + iFormat++; + return matches; + }; + // Format a number, with leading zero if necessary + var formatNumber = function(match, value, len) { + var num = '' + value; + if (lookAhead(match)) + while (num.length < len) + num = '0' + num; + return num; + }; + // Format a name, short or long as requested + var formatName = function(match, value, shortNames, longNames) { + return (lookAhead(match) ? longNames[value] : shortNames[value]); + }; + var output = ''; + var literal = false; + if (date) + for (var iFormat = 0; iFormat < format.length; iFormat++) { + if (literal) + if (format.charAt(iFormat) == "'" && !lookAhead("'")) + literal = false; + else + output += format.charAt(iFormat); + else + switch (format.charAt(iFormat)) { + case 'd': + output += formatNumber('d', date.getDate(), 2); + break; + case 'D': + output += formatName('D', date.getDay(), dayNamesShort, dayNames); + break; + case 'o': + output += formatNumber('o', + Math.round((new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3); + break; + case 'm': + output += formatNumber('m', date.getMonth() + 1, 2); + break; + case 'M': + output += formatName('M', date.getMonth(), monthNamesShort, monthNames); + break; + case 'y': + output += (lookAhead('y') ? date.getFullYear() : + (date.getYear() % 100 < 10 ? '0' : '') + date.getYear() % 100); + break; + case '@': + output += date.getTime(); + break; + case '!': + output += date.getTime() * 10000 + this._ticksTo1970; + break; + case "'": + if (lookAhead("'")) + output += "'"; + else + literal = true; + break; + default: + output += format.charAt(iFormat); + } + } + return output; + }, + + /* Extract all possible characters from the date format. */ + _possibleChars: function (format) { + var chars = ''; + var literal = false; + // Check whether a format character is doubled + var lookAhead = function(match) { + var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match); + if (matches) + iFormat++; + return matches; + }; + for (var iFormat = 0; iFormat < format.length; iFormat++) + if (literal) + if (format.charAt(iFormat) == "'" && !lookAhead("'")) + literal = false; + else + chars += format.charAt(iFormat); + else + switch (format.charAt(iFormat)) { + case 'd': case 'm': case 'y': case '@': + chars += '0123456789'; + break; + case 'D': case 'M': + return null; // Accept anything + case "'": + if (lookAhead("'")) + chars += "'"; + else + literal = true; + break; + default: + chars += format.charAt(iFormat); + } + return chars; + }, + + /* Get a setting value, defaulting if necessary. */ + _get: function(inst, name) { + return inst.settings[name] !== undefined ? + inst.settings[name] : this._defaults[name]; + }, + + /* Parse existing date and initialise date picker. */ + _setDateFromField: function(inst, noDefault) { + if (inst.input.val() == inst.lastVal) { + return; + } + var dateFormat = this._get(inst, 'dateFormat'); + var dates = inst.lastVal = inst.input ? inst.input.val() : null; + var date, defaultDate; + date = defaultDate = this._getDefaultDate(inst); + var settings = this._getFormatConfig(inst); + try { + date = this.parseDate(dateFormat, dates, settings) || defaultDate; + } catch (event) { + this.log(event); + dates = (noDefault ? '' : dates); + } + inst.selectedDay = date.getDate(); + inst.drawMonth = inst.selectedMonth = date.getMonth(); + inst.drawYear = inst.selectedYear = date.getFullYear(); + inst.currentDay = (dates ? date.getDate() : 0); + inst.currentMonth = (dates ? date.getMonth() : 0); + inst.currentYear = (dates ? date.getFullYear() : 0); + this._adjustInstDate(inst); + }, + + /* Retrieve the default date shown on opening. */ + _getDefaultDate: function(inst) { + return this._restrictMinMax(inst, + this._determineDate(inst, this._get(inst, 'defaultDate'), new Date())); + }, + + /* A date may be specified as an exact value or a relative one. */ + _determineDate: function(inst, date, defaultDate) { + var offsetNumeric = function(offset) { + var date = new Date(); + date.setDate(date.getDate() + offset); + return date; + }; + var offsetString = function(offset) { + try { + return $.datepicker.parseDate($.datepicker._get(inst, 'dateFormat'), + offset, $.datepicker._getFormatConfig(inst)); + } + catch (e) { + // Ignore + } + var date = (offset.toLowerCase().match(/^c/) ? + $.datepicker._getDate(inst) : null) || new Date(); + var year = date.getFullYear(); + var month = date.getMonth(); + var day = date.getDate(); + var pattern = /([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g; + var matches = pattern.exec(offset); + while (matches) { + switch (matches[2] || 'd') { + case 'd' : case 'D' : + day += parseInt(matches[1],10); break; + case 'w' : case 'W' : + day += parseInt(matches[1],10) * 7; break; + case 'm' : case 'M' : + month += parseInt(matches[1],10); + day = Math.min(day, $.datepicker._getDaysInMonth(year, month)); + break; + case 'y': case 'Y' : + year += parseInt(matches[1],10); + day = Math.min(day, $.datepicker._getDaysInMonth(year, month)); + break; + } + matches = pattern.exec(offset); + } + return new Date(year, month, day); + }; + var newDate = (date == null || date === '' ? defaultDate : (typeof date == 'string' ? offsetString(date) : + (typeof date == 'number' ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : new Date(date.getTime())))); + newDate = (newDate && newDate.toString() == 'Invalid Date' ? defaultDate : newDate); + if (newDate) { + newDate.setHours(0); + newDate.setMinutes(0); + newDate.setSeconds(0); + newDate.setMilliseconds(0); + } + return this._daylightSavingAdjust(newDate); + }, + + /* Handle switch to/from daylight saving. + Hours may be non-zero on daylight saving cut-over: + > 12 when midnight changeover, but then cannot generate + midnight datetime, so jump to 1AM, otherwise reset. + @param date (Date) the date to check + @return (Date) the corrected date */ + _daylightSavingAdjust: function(date) { + if (!date) return null; + date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0); + return date; + }, + + /* Set the date(s) directly. */ + _setDate: function(inst, date, noChange) { + var clear = !date; + var origMonth = inst.selectedMonth; + var origYear = inst.selectedYear; + var newDate = this._restrictMinMax(inst, this._determineDate(inst, date, new Date())); + inst.selectedDay = inst.currentDay = newDate.getDate(); + inst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth(); + inst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear(); + if ((origMonth != inst.selectedMonth || origYear != inst.selectedYear) && !noChange) + this._notifyChange(inst); + this._adjustInstDate(inst); + if (inst.input) { + inst.input.val(clear ? '' : this._formatDate(inst)); + } + }, + + /* Retrieve the date(s) directly. */ + _getDate: function(inst) { + var startDate = (!inst.currentYear || (inst.input && inst.input.val() == '') ? null : + this._daylightSavingAdjust(new Date( + inst.currentYear, inst.currentMonth, inst.currentDay))); + return startDate; + }, + + /* Attach the onxxx handlers. These are declared statically so + * they work with static code transformers like Caja. + */ + _attachHandlers: function(inst) { + var stepMonths = this._get(inst, 'stepMonths'); + var id = '#' + inst.id.replace( /\\\\/g, "\\" ); + inst.dpDiv.find('[data-handler]').map(function () { + var handler = { + prev: function () { + window['DP_jQuery_' + dpuuid].datepicker._adjustDate(id, -stepMonths, 'M'); + }, + next: function () { + window['DP_jQuery_' + dpuuid].datepicker._adjustDate(id, +stepMonths, 'M'); + }, + hide: function () { + window['DP_jQuery_' + dpuuid].datepicker._hideDatepicker(); + }, + today: function () { + window['DP_jQuery_' + dpuuid].datepicker._gotoToday(id); + }, + selectDay: function () { + window['DP_jQuery_' + dpuuid].datepicker._selectDay(id, +this.getAttribute('data-month'), +this.getAttribute('data-year'), this); + return false; + }, + selectMonth: function () { + window['DP_jQuery_' + dpuuid].datepicker._selectMonthYear(id, this, 'M'); + return false; + }, + selectYear: function () { + window['DP_jQuery_' + dpuuid].datepicker._selectMonthYear(id, this, 'Y'); + return false; + } + }; + $(this).bind(this.getAttribute('data-event'), handler[this.getAttribute('data-handler')]); + }); + }, + + /* Generate the HTML for the current state of the date picker. */ + _generateHTML: function(inst) { + var today = new Date(); + today = this._daylightSavingAdjust( + new Date(today.getFullYear(), today.getMonth(), today.getDate())); // clear time + var isRTL = this._get(inst, 'isRTL'); + var showButtonPanel = this._get(inst, 'showButtonPanel'); + var hideIfNoPrevNext = this._get(inst, 'hideIfNoPrevNext'); + var navigationAsDateFormat = this._get(inst, 'navigationAsDateFormat'); + var numMonths = this._getNumberOfMonths(inst); + var showCurrentAtPos = this._get(inst, 'showCurrentAtPos'); + var stepMonths = this._get(inst, 'stepMonths'); + var isMultiMonth = (numMonths[0] != 1 || numMonths[1] != 1); + var currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) : + new Date(inst.currentYear, inst.currentMonth, inst.currentDay))); + var minDate = this._getMinMaxDate(inst, 'min'); + var maxDate = this._getMinMaxDate(inst, 'max'); + var drawMonth = inst.drawMonth - showCurrentAtPos; + var drawYear = inst.drawYear; + if (drawMonth < 0) { + drawMonth += 12; + drawYear--; + } + if (maxDate) { + var maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(), + maxDate.getMonth() - (numMonths[0] * numMonths[1]) + 1, maxDate.getDate())); + maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw); + while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) { + drawMonth--; + if (drawMonth < 0) { + drawMonth = 11; + drawYear--; + } + } + } + inst.drawMonth = drawMonth; + inst.drawYear = drawYear; + var prevText = this._get(inst, 'prevText'); + prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText, + this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)), + this._getFormatConfig(inst))); + var prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ? + '<a class="ui-datepicker-prev ui-corner-all" data-handler="prev" data-event="click"' + + ' title="' + prevText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'e' : 'w') + '">' + prevText + '</span></a>' : + (hideIfNoPrevNext ? '' : '<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+ prevText +'"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'e' : 'w') + '">' + prevText + '</span></a>')); + var nextText = this._get(inst, 'nextText'); + nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText, + this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)), + this._getFormatConfig(inst))); + var next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ? + '<a class="ui-datepicker-next ui-corner-all" data-handler="next" data-event="click"' + + ' title="' + nextText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'w' : 'e') + '">' + nextText + '</span></a>' : + (hideIfNoPrevNext ? '' : '<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+ nextText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'w' : 'e') + '">' + nextText + '</span></a>')); + var currentText = this._get(inst, 'currentText'); + var gotoDate = (this._get(inst, 'gotoCurrent') && inst.currentDay ? currentDate : today); + currentText = (!navigationAsDateFormat ? currentText : + this.formatDate(currentText, gotoDate, this._getFormatConfig(inst))); + var controls = (!inst.inline ? '<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" data-handler="hide" data-event="click">' + + this._get(inst, 'closeText') + '</button>' : ''); + var buttonPanel = (showButtonPanel) ? '<div class="ui-datepicker-buttonpane ui-widget-content">' + (isRTL ? controls : '') + + (this._isInRange(inst, gotoDate) ? '<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" data-handler="today" data-event="click"' + + '>' + currentText + '</button>' : '') + (isRTL ? '' : controls) + '</div>' : ''; + var firstDay = parseInt(this._get(inst, 'firstDay'),10); + firstDay = (isNaN(firstDay) ? 0 : firstDay); + var showWeek = this._get(inst, 'showWeek'); + var dayNames = this._get(inst, 'dayNames'); + var dayNamesShort = this._get(inst, 'dayNamesShort'); + var dayNamesMin = this._get(inst, 'dayNamesMin'); + var monthNames = this._get(inst, 'monthNames'); + var monthNamesShort = this._get(inst, 'monthNamesShort'); + var beforeShowDay = this._get(inst, 'beforeShowDay'); + var showOtherMonths = this._get(inst, 'showOtherMonths'); + var selectOtherMonths = this._get(inst, 'selectOtherMonths'); + var calculateWeek = this._get(inst, 'calculateWeek') || this.iso8601Week; + var defaultDate = this._getDefaultDate(inst); + var html = ''; + for (var row = 0; row < numMonths[0]; row++) { + var group = ''; + this.maxRows = 4; + for (var col = 0; col < numMonths[1]; col++) { + var selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay)); + var cornerClass = ' ui-corner-all'; + var calender = ''; + if (isMultiMonth) { + calender += '<div class="ui-datepicker-group'; + if (numMonths[1] > 1) + switch (col) { + case 0: calender += ' ui-datepicker-group-first'; + cornerClass = ' ui-corner-' + (isRTL ? 'right' : 'left'); break; + case numMonths[1]-1: calender += ' ui-datepicker-group-last'; + cornerClass = ' ui-corner-' + (isRTL ? 'left' : 'right'); break; + default: calender += ' ui-datepicker-group-middle'; cornerClass = ''; break; + } + calender += '">'; + } + calender += '<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix' + cornerClass + '">' + + (/all|left/.test(cornerClass) && row == 0 ? (isRTL ? next : prev) : '') + + (/all|right/.test(cornerClass) && row == 0 ? (isRTL ? prev : next) : '') + + this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate, + row > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers + '</div><table class="ui-datepicker-calendar"><thead>' + + '<tr>'; + var thead = (showWeek ? '<th class="ui-datepicker-week-col">' + this._get(inst, 'weekHeader') + '</th>' : ''); + for (var dow = 0; dow < 7; dow++) { // days of the week + var day = (dow + firstDay) % 7; + thead += '<th' + ((dow + firstDay + 6) % 7 >= 5 ? ' class="ui-datepicker-week-end"' : '') + '>' + + '<span title="' + dayNames[day] + '">' + dayNamesMin[day] + '</span></th>'; + } + calender += thead + '</tr></thead><tbody>'; + var daysInMonth = this._getDaysInMonth(drawYear, drawMonth); + if (drawYear == inst.selectedYear && drawMonth == inst.selectedMonth) + inst.selectedDay = Math.min(inst.selectedDay, daysInMonth); + var leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7; + var curRows = Math.ceil((leadDays + daysInMonth) / 7); // calculate the number of rows to generate + var numRows = (isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows); //If multiple months, use the higher number of rows (see #7043) + this.maxRows = numRows; + var printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays)); + for (var dRow = 0; dRow < numRows; dRow++) { // create date picker rows + calender += '<tr>'; + var tbody = (!showWeek ? '' : '<td class="ui-datepicker-week-col">' + + this._get(inst, 'calculateWeek')(printDate) + '</td>'); + for (var dow = 0; dow < 7; dow++) { // create date picker days + var daySettings = (beforeShowDay ? + beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, '']); + var otherMonth = (printDate.getMonth() != drawMonth); + var unselectable = (otherMonth && !selectOtherMonths) || !daySettings[0] || + (minDate && printDate < minDate) || (maxDate && printDate > maxDate); + tbody += '<td class="' + + ((dow + firstDay + 6) % 7 >= 5 ? ' ui-datepicker-week-end' : '') + // highlight weekends + (otherMonth ? ' ui-datepicker-other-month' : '') + // highlight days from other months + ((printDate.getTime() == selectedDate.getTime() && drawMonth == inst.selectedMonth && inst._keyEvent) || // user pressed key + (defaultDate.getTime() == printDate.getTime() && defaultDate.getTime() == selectedDate.getTime()) ? + // or defaultDate is current printedDate and defaultDate is selectedDate + ' ' + this._dayOverClass : '') + // highlight selected day + (unselectable ? ' ' + this._unselectableClass + ' ui-state-disabled': '') + // highlight unselectable days + (otherMonth && !showOtherMonths ? '' : ' ' + daySettings[1] + // highlight custom dates + (printDate.getTime() == currentDate.getTime() ? ' ' + this._currentClass : '') + // highlight selected day + (printDate.getTime() == today.getTime() ? ' ui-datepicker-today' : '')) + '"' + // highlight today (if different) + ((!otherMonth || showOtherMonths) && daySettings[2] ? ' title="' + daySettings[2] + '"' : '') + // cell title + (unselectable ? '' : ' data-handler="selectDay" data-event="click" data-month="' + printDate.getMonth() + '" data-year="' + printDate.getFullYear() + '"') + '>' + // actions + (otherMonth && !showOtherMonths ? ' ' : // display for other months + (unselectable ? '<span class="ui-state-default">' + printDate.getDate() + '</span>' : '<a class="ui-state-default' + + (printDate.getTime() == today.getTime() ? ' ui-state-highlight' : '') + + (printDate.getTime() == currentDate.getTime() ? ' ui-state-active' : '') + // highlight selected day + (otherMonth ? ' ui-priority-secondary' : '') + // distinguish dates from other months + '" href="#">' + printDate.getDate() + '</a>')) + '</td>'; // display selectable date + printDate.setDate(printDate.getDate() + 1); + printDate = this._daylightSavingAdjust(printDate); + } + calender += tbody + '</tr>'; + } + drawMonth++; + if (drawMonth > 11) { + drawMonth = 0; + drawYear++; + } + calender += '</tbody></table>' + (isMultiMonth ? '</div>' + + ((numMonths[0] > 0 && col == numMonths[1]-1) ? '<div class="ui-datepicker-row-break"></div>' : '') : ''); + group += calender; + } + html += group; + } + html += buttonPanel + ($.ui.ie6 && !inst.inline ? + '<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>' : ''); + inst._keyEvent = false; + return html; + }, + + /* Generate the month and year header. */ + _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate, + secondary, monthNames, monthNamesShort) { + var changeMonth = this._get(inst, 'changeMonth'); + var changeYear = this._get(inst, 'changeYear'); + var showMonthAfterYear = this._get(inst, 'showMonthAfterYear'); + var html = '<div class="ui-datepicker-title">'; + var monthHtml = ''; + // month selection + if (secondary || !changeMonth) + monthHtml += '<span class="ui-datepicker-month">' + monthNames[drawMonth] + '</span>'; + else { + var inMinYear = (minDate && minDate.getFullYear() == drawYear); + var inMaxYear = (maxDate && maxDate.getFullYear() == drawYear); + monthHtml += '<select class="ui-datepicker-month" data-handler="selectMonth" data-event="change">'; + for (var month = 0; month < 12; month++) { + if ((!inMinYear || month >= minDate.getMonth()) && + (!inMaxYear || month <= maxDate.getMonth())) + monthHtml += '<option value="' + month + '"' + + (month == drawMonth ? ' selected="selected"' : '') + + '>' + monthNamesShort[month] + '</option>'; + } + monthHtml += '</select>'; + } + if (!showMonthAfterYear) + html += monthHtml + (secondary || !(changeMonth && changeYear) ? ' ' : ''); + // year selection + if ( !inst.yearshtml ) { + inst.yearshtml = ''; + if (secondary || !changeYear) + html += '<span class="ui-datepicker-year">' + drawYear + '</span>'; + else { + // determine range of years to display + var years = this._get(inst, 'yearRange').split(':'); + var thisYear = new Date().getFullYear(); + var determineYear = function(value) { + var year = (value.match(/c[+-].*/) ? drawYear + parseInt(value.substring(1), 10) : + (value.match(/[+-].*/) ? thisYear + parseInt(value, 10) : + parseInt(value, 10))); + return (isNaN(year) ? thisYear : year); + }; + var year = determineYear(years[0]); + var endYear = Math.max(year, determineYear(years[1] || '')); + year = (minDate ? Math.max(year, minDate.getFullYear()) : year); + endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear); + inst.yearshtml += '<select class="ui-datepicker-year" data-handler="selectYear" data-event="change">'; + for (; year <= endYear; year++) { + inst.yearshtml += '<option value="' + year + '"' + + (year == drawYear ? ' selected="selected"' : '') + + '>' + year + '</option>'; + } + inst.yearshtml += '</select>'; + + html += inst.yearshtml; + inst.yearshtml = null; + } + } + html += this._get(inst, 'yearSuffix'); + if (showMonthAfterYear) + html += (secondary || !(changeMonth && changeYear) ? ' ' : '') + monthHtml; + html += '</div>'; // Close datepicker_header + return html; + }, + + /* Adjust one of the date sub-fields. */ + _adjustInstDate: function(inst, offset, period) { + var year = inst.drawYear + (period == 'Y' ? offset : 0); + var month = inst.drawMonth + (period == 'M' ? offset : 0); + var day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + + (period == 'D' ? offset : 0); + var date = this._restrictMinMax(inst, + this._daylightSavingAdjust(new Date(year, month, day))); + inst.selectedDay = date.getDate(); + inst.drawMonth = inst.selectedMonth = date.getMonth(); + inst.drawYear = inst.selectedYear = date.getFullYear(); + if (period == 'M' || period == 'Y') + this._notifyChange(inst); + }, + + /* Ensure a date is within any min/max bounds. */ + _restrictMinMax: function(inst, date) { + var minDate = this._getMinMaxDate(inst, 'min'); + var maxDate = this._getMinMaxDate(inst, 'max'); + var newDate = (minDate && date < minDate ? minDate : date); + newDate = (maxDate && newDate > maxDate ? maxDate : newDate); + return newDate; + }, + + /* Notify change of month/year. */ + _notifyChange: function(inst) { + var onChange = this._get(inst, 'onChangeMonthYear'); + if (onChange) + onChange.apply((inst.input ? inst.input[0] : null), + [inst.selectedYear, inst.selectedMonth + 1, inst]); + }, + + /* Determine the number of months to show. */ + _getNumberOfMonths: function(inst) { + var numMonths = this._get(inst, 'numberOfMonths'); + return (numMonths == null ? [1, 1] : (typeof numMonths == 'number' ? [1, numMonths] : numMonths)); + }, + + /* Determine the current maximum date - ensure no time components are set. */ + _getMinMaxDate: function(inst, minMax) { + return this._determineDate(inst, this._get(inst, minMax + 'Date'), null); + }, + + /* Find the number of days in a given month. */ + _getDaysInMonth: function(year, month) { + return 32 - this._daylightSavingAdjust(new Date(year, month, 32)).getDate(); + }, + + /* Find the day of the week of the first of a month. */ + _getFirstDayOfMonth: function(year, month) { + return new Date(year, month, 1).getDay(); + }, + + /* Determines if we should allow a "next/prev" month display change. */ + _canAdjustMonth: function(inst, offset, curYear, curMonth) { + var numMonths = this._getNumberOfMonths(inst); + var date = this._daylightSavingAdjust(new Date(curYear, + curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1)); + if (offset < 0) + date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth())); + return this._isInRange(inst, date); + }, + + /* Is the given date in the accepted range? */ + _isInRange: function(inst, date) { + var minDate = this._getMinMaxDate(inst, 'min'); + var maxDate = this._getMinMaxDate(inst, 'max'); + return ((!minDate || date.getTime() >= minDate.getTime()) && + (!maxDate || date.getTime() <= maxDate.getTime())); + }, + + /* Provide the configuration settings for formatting/parsing. */ + _getFormatConfig: function(inst) { + var shortYearCutoff = this._get(inst, 'shortYearCutoff'); + shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff : + new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10)); + return {shortYearCutoff: shortYearCutoff, + dayNamesShort: this._get(inst, 'dayNamesShort'), dayNames: this._get(inst, 'dayNames'), + monthNamesShort: this._get(inst, 'monthNamesShort'), monthNames: this._get(inst, 'monthNames')}; + }, + + /* Format the given date for display. */ + _formatDate: function(inst, day, month, year) { + if (!day) { + inst.currentDay = inst.selectedDay; + inst.currentMonth = inst.selectedMonth; + inst.currentYear = inst.selectedYear; + } + var date = (day ? (typeof day == 'object' ? day : + this._daylightSavingAdjust(new Date(year, month, day))) : + this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay))); + return this.formatDate(this._get(inst, 'dateFormat'), date, this._getFormatConfig(inst)); + } +}); + +/* + * Bind hover events for datepicker elements. + * Done via delegate so the binding only occurs once in the lifetime of the parent div. + * Global instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker. + */ +function bindHover(dpDiv) { + var selector = 'button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a'; + return dpDiv.delegate(selector, 'mouseout', function() { + $(this).removeClass('ui-state-hover'); + if (this.className.indexOf('ui-datepicker-prev') != -1) $(this).removeClass('ui-datepicker-prev-hover'); + if (this.className.indexOf('ui-datepicker-next') != -1) $(this).removeClass('ui-datepicker-next-hover'); + }) + .delegate(selector, 'mouseover', function(){ + if (!$.datepicker._isDisabledDatepicker( instActive.inline ? dpDiv.parent()[0] : instActive.input[0])) { + $(this).parents('.ui-datepicker-calendar').find('a').removeClass('ui-state-hover'); + $(this).addClass('ui-state-hover'); + if (this.className.indexOf('ui-datepicker-prev') != -1) $(this).addClass('ui-datepicker-prev-hover'); + if (this.className.indexOf('ui-datepicker-next') != -1) $(this).addClass('ui-datepicker-next-hover'); + } + }); +} + +/* jQuery extend now ignores nulls! */ +function extendRemove(target, props) { + $.extend(target, props); + for (var name in props) + if (props[name] == null || props[name] == undefined) + target[name] = props[name]; + return target; +}; + +/* Invoke the datepicker functionality. + @param options string - a command, optionally followed by additional parameters or + Object - settings for attaching new datepicker functionality + @return jQuery object */ +$.fn.datepicker = function(options){ + + /* Verify an empty collection wasn't passed - Fixes #6976 */ + if ( !this.length ) { + return this; + } + + /* Initialise the date picker. */ + if (!$.datepicker.initialized) { + $(document).mousedown($.datepicker._checkExternalClick). + find(document.body).append($.datepicker.dpDiv); + $.datepicker.initialized = true; + } + + var otherArgs = Array.prototype.slice.call(arguments, 1); + if (typeof options == 'string' && (options == 'isDisabled' || options == 'getDate' || options == 'widget')) + return $.datepicker['_' + options + 'Datepicker']. + apply($.datepicker, [this[0]].concat(otherArgs)); + if (options == 'option' && arguments.length == 2 && typeof arguments[1] == 'string') + return $.datepicker['_' + options + 'Datepicker']. + apply($.datepicker, [this[0]].concat(otherArgs)); + return this.each(function() { + typeof options == 'string' ? + $.datepicker['_' + options + 'Datepicker']. + apply($.datepicker, [this].concat(otherArgs)) : + $.datepicker._attachDatepicker(this, options); + }); +}; + +$.datepicker = new Datepicker(); // singleton instance +$.datepicker.initialized = false; +$.datepicker.uuid = new Date().getTime(); +$.datepicker.version = "1.9.1"; + +// Workaround for #4055 +// Add another global to avoid noConflict issues with inline event handlers +window['DP_jQuery_' + dpuuid] = $; + +})(jQuery); +(function( $, undefined ) { + +var uiDialogClasses = "ui-dialog ui-widget ui-widget-content ui-corner-all ", + sizeRelatedOptions = { + buttons: true, + height: true, + maxHeight: true, + maxWidth: true, + minHeight: true, + minWidth: true, + width: true + }, + resizableRelatedOptions = { + maxHeight: true, + maxWidth: true, + minHeight: true, + minWidth: true + }; + +$.widget("ui.dialog", { + version: "1.9.1", + options: { + autoOpen: true, + buttons: {}, + closeOnEscape: true, + closeText: "close", + dialogClass: "", + draggable: true, + hide: null, + height: "auto", + maxHeight: false, + maxWidth: false, + minHeight: 150, + minWidth: 150, + modal: false, + position: { + my: "center", + at: "center", + of: window, + collision: "fit", + // ensure that the titlebar is never outside the document + using: function( pos ) { + var topOffset = $( this ).css( pos ).offset().top; + if ( topOffset < 0 ) { + $( this ).css( "top", pos.top - topOffset ); + } + } + }, + resizable: true, + show: null, + stack: true, + title: "", + width: 300, + zIndex: 1000 + }, + + _create: function() { + this.originalTitle = this.element.attr( "title" ); + // #5742 - .attr() might return a DOMElement + if ( typeof this.originalTitle !== "string" ) { + this.originalTitle = ""; + } + this.oldPosition = { + parent: this.element.parent(), + index: this.element.parent().children().index( this.element ) + }; + this.options.title = this.options.title || this.originalTitle; + var that = this, + options = this.options, + + title = options.title || " ", + uiDialog, + uiDialogTitlebar, + uiDialogTitlebarClose, + uiDialogTitle, + uiDialogButtonPane; + + uiDialog = ( this.uiDialog = $( "<div>" ) ) + .addClass( uiDialogClasses + options.dialogClass ) + .css({ + display: "none", + outline: 0, // TODO: move to stylesheet + zIndex: options.zIndex + }) + // setting tabIndex makes the div focusable + .attr( "tabIndex", -1) + .keydown(function( event ) { + if ( options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode && + event.keyCode === $.ui.keyCode.ESCAPE ) { + that.close( event ); + event.preventDefault(); + } + }) + .mousedown(function( event ) { + that.moveToTop( false, event ); + }) + .appendTo( "body" ); + + this.element + .show() + .removeAttr( "title" ) + .addClass( "ui-dialog-content ui-widget-content" ) + .appendTo( uiDialog ); + + uiDialogTitlebar = ( this.uiDialogTitlebar = $( "<div>" ) ) + .addClass( "ui-dialog-titlebar ui-widget-header " + + "ui-corner-all ui-helper-clearfix" ) + .bind( "mousedown", function() { + // Dialog isn't getting focus when dragging (#8063) + uiDialog.focus(); + }) + .prependTo( uiDialog ); + + uiDialogTitlebarClose = $( "<a href='#'></a>" ) + .addClass( "ui-dialog-titlebar-close ui-corner-all" ) + .attr( "role", "button" ) + .click(function( event ) { + event.preventDefault(); + that.close( event ); + }) + .appendTo( uiDialogTitlebar ); + + ( this.uiDialogTitlebarCloseText = $( "<span>" ) ) + .addClass( "ui-icon ui-icon-closethick" ) + .text( options.closeText ) + .appendTo( uiDialogTitlebarClose ); + + uiDialogTitle = $( "<span>" ) + .uniqueId() + .addClass( "ui-dialog-title" ) + .html( title ) + .prependTo( uiDialogTitlebar ); + + uiDialogButtonPane = ( this.uiDialogButtonPane = $( "<div>" ) ) + .addClass( "ui-dialog-buttonpane ui-widget-content ui-helper-clearfix" ); + + ( this.uiButtonSet = $( "<div>" ) ) + .addClass( "ui-dialog-buttonset" ) + .appendTo( uiDialogButtonPane ); + + uiDialog.attr({ + role: "dialog", + "aria-labelledby": uiDialogTitle.attr( "id" ) + }); + + uiDialogTitlebar.find( "*" ).add( uiDialogTitlebar ).disableSelection(); + this._hoverable( uiDialogTitlebarClose ); + this._focusable( uiDialogTitlebarClose ); + + if ( options.draggable && $.fn.draggable ) { + this._makeDraggable(); + } + if ( options.resizable && $.fn.resizable ) { + this._makeResizable(); + } + + this._createButtons( options.buttons ); + this._isOpen = false; + + if ( $.fn.bgiframe ) { + uiDialog.bgiframe(); + } + + // prevent tabbing out of modal dialogs + this._on( uiDialog, { keydown: function( event ) { + if ( !options.modal || event.keyCode !== $.ui.keyCode.TAB ) { + return; + } + + var tabbables = $( ":tabbable", uiDialog ), + first = tabbables.filter( ":first" ), + last = tabbables.filter( ":last" ); + + if ( event.target === last[0] && !event.shiftKey ) { + first.focus( 1 ); + return false; + } else if ( event.target === first[0] && event.shiftKey ) { + last.focus( 1 ); + return false; + } + }}); + }, + + _init: function() { + if ( this.options.autoOpen ) { + this.open(); + } + }, + + _destroy: function() { + var next, + oldPosition = this.oldPosition; + + if ( this.overlay ) { + this.overlay.destroy(); + } + this.uiDialog.hide(); + this.element + .removeClass( "ui-dialog-content ui-widget-content" ) + .hide() + .appendTo( "body" ); + this.uiDialog.remove(); + + if ( this.originalTitle ) { + this.element.attr( "title", this.originalTitle ); + } + + next = oldPosition.parent.children().eq( oldPosition.index ); + // Don't try to place the dialog next to itself (#8613) + if ( next.length && next[ 0 ] !== this.element[ 0 ] ) { + next.before( this.element ); + } else { + oldPosition.parent.append( this.element ); + } + }, + + widget: function() { + return this.uiDialog; + }, + + close: function( event ) { + var that = this, + maxZ, thisZ; + + if ( !this._isOpen ) { + return; + } + + if ( false === this._trigger( "beforeClose", event ) ) { + return; + } + + this._isOpen = false; + + if ( this.overlay ) { + this.overlay.destroy(); + } + + if ( this.options.hide ) { + this._hide( this.uiDialog, this.options.hide, function() { + that._trigger( "close", event ); + }); + } else { + this.uiDialog.hide(); + this._trigger( "close", event ); + } + + $.ui.dialog.overlay.resize(); + + // adjust the maxZ to allow other modal dialogs to continue to work (see #4309) + if ( this.options.modal ) { + maxZ = 0; + $( ".ui-dialog" ).each(function() { + if ( this !== that.uiDialog[0] ) { + thisZ = $( this ).css( "z-index" ); + if ( !isNaN( thisZ ) ) { + maxZ = Math.max( maxZ, thisZ ); + } + } + }); + $.ui.dialog.maxZ = maxZ; + } + + return this; + }, + + isOpen: function() { + return this._isOpen; + }, + + // the force parameter allows us to move modal dialogs to their correct + // position on open + moveToTop: function( force, event ) { + var options = this.options, + saveScroll; + + if ( ( options.modal && !force ) || + ( !options.stack && !options.modal ) ) { + return this._trigger( "focus", event ); + } + + if ( options.zIndex > $.ui.dialog.maxZ ) { + $.ui.dialog.maxZ = options.zIndex; + } + if ( this.overlay ) { + $.ui.dialog.maxZ += 1; + $.ui.dialog.overlay.maxZ = $.ui.dialog.maxZ; + this.overlay.$el.css( "z-index", $.ui.dialog.overlay.maxZ ); + } + + // Save and then restore scroll + // Opera 9.5+ resets when parent z-index is changed. + // http://bugs.jqueryui.com/ticket/3193 + saveScroll = { + scrollTop: this.element.scrollTop(), + scrollLeft: this.element.scrollLeft() + }; + $.ui.dialog.maxZ += 1; + this.uiDialog.css( "z-index", $.ui.dialog.maxZ ); + this.element.attr( saveScroll ); + this._trigger( "focus", event ); + + return this; + }, + + open: function() { + if ( this._isOpen ) { + return; + } + + var hasFocus, + options = this.options, + uiDialog = this.uiDialog; + + this._size(); + this._position( options.position ); + uiDialog.show( options.show ); + this.overlay = options.modal ? new $.ui.dialog.overlay( this ) : null; + this.moveToTop( true ); + + // set focus to the first tabbable element in the content area or the first button + // if there are no tabbable elements, set focus on the dialog itself + hasFocus = this.element.find( ":tabbable" ); + if ( !hasFocus.length ) { + hasFocus = this.uiDialogButtonPane.find( ":tabbable" ); + if ( !hasFocus.length ) { + hasFocus = uiDialog; + } + } + hasFocus.eq( 0 ).focus(); + + this._isOpen = true; + this._trigger( "open" ); + + return this; + }, + + _createButtons: function( buttons ) { + var that = this, + hasButtons = false; + + // if we already have a button pane, remove it + this.uiDialogButtonPane.remove(); + this.uiButtonSet.empty(); + + if ( typeof buttons === "object" && buttons !== null ) { + $.each( buttons, function() { + return !(hasButtons = true); + }); + } + if ( hasButtons ) { + $.each( buttons, function( name, props ) { + props = $.isFunction( props ) ? + { click: props, text: name } : + props; + var button = $( "<button type='button'></button>" ) + .attr( props, true ) + .unbind( "click" ) + .click(function() { + props.click.apply( that.element[0], arguments ); + }) + .appendTo( that.uiButtonSet ); + if ( $.fn.button ) { + button.button(); + } + }); + this.uiDialog.addClass( "ui-dialog-buttons" ); + this.uiDialogButtonPane.appendTo( this.uiDialog ); + } else { + this.uiDialog.removeClass( "ui-dialog-buttons" ); + } + }, + + _makeDraggable: function() { + var that = this, + options = this.options; + + function filteredUi( ui ) { + return { + position: ui.position, + offset: ui.offset + }; + } + + this.uiDialog.draggable({ + cancel: ".ui-dialog-content, .ui-dialog-titlebar-close", + handle: ".ui-dialog-titlebar", + containment: "document", + start: function( event, ui ) { + $( this ) + .addClass( "ui-dialog-dragging" ); + that._trigger( "dragStart", event, filteredUi( ui ) ); + }, + drag: function( event, ui ) { + that._trigger( "drag", event, filteredUi( ui ) ); + }, + stop: function( event, ui ) { + options.position = [ + ui.position.left - that.document.scrollLeft(), + ui.position.top - that.document.scrollTop() + ]; + $( this ) + .removeClass( "ui-dialog-dragging" ); + that._trigger( "dragStop", event, filteredUi( ui ) ); + $.ui.dialog.overlay.resize(); + } + }); + }, + + _makeResizable: function( handles ) { + handles = (handles === undefined ? this.options.resizable : handles); + var that = this, + options = this.options, + // .ui-resizable has position: relative defined in the stylesheet + // but dialogs have to use absolute or fixed positioning + position = this.uiDialog.css( "position" ), + resizeHandles = typeof handles === 'string' ? + handles : + "n,e,s,w,se,sw,ne,nw"; + + function filteredUi( ui ) { + return { + originalPosition: ui.originalPosition, + originalSize: ui.originalSize, + position: ui.position, + size: ui.size + }; + } + + this.uiDialog.resizable({ + cancel: ".ui-dialog-content", + containment: "document", + alsoResize: this.element, + maxWidth: options.maxWidth, + maxHeight: options.maxHeight, + minWidth: options.minWidth, + minHeight: this._minHeight(), + handles: resizeHandles, + start: function( event, ui ) { + $( this ).addClass( "ui-dialog-resizing" ); + that._trigger( "resizeStart", event, filteredUi( ui ) ); + }, + resize: function( event, ui ) { + that._trigger( "resize", event, filteredUi( ui ) ); + }, + stop: function( event, ui ) { + $( this ).removeClass( "ui-dialog-resizing" ); + options.height = $( this ).height(); + options.width = $( this ).width(); + that._trigger( "resizeStop", event, filteredUi( ui ) ); + $.ui.dialog.overlay.resize(); + } + }) + .css( "position", position ) + .find( ".ui-resizable-se" ) + .addClass( "ui-icon ui-icon-grip-diagonal-se" ); + }, + + _minHeight: function() { + var options = this.options; + + if ( options.height === "auto" ) { + return options.minHeight; + } else { + return Math.min( options.minHeight, options.height ); + } + }, + + _position: function( position ) { + var myAt = [], + offset = [ 0, 0 ], + isVisible; + + if ( position ) { + // deep extending converts arrays to objects in jQuery <= 1.3.2 :-( + // if (typeof position == 'string' || $.isArray(position)) { + // myAt = $.isArray(position) ? position : position.split(' '); + + if ( typeof position === "string" || (typeof position === "object" && "0" in position ) ) { + myAt = position.split ? position.split( " " ) : [ position[ 0 ], position[ 1 ] ]; + if ( myAt.length === 1 ) { + myAt[ 1 ] = myAt[ 0 ]; + } + + $.each( [ "left", "top" ], function( i, offsetPosition ) { + if ( +myAt[ i ] === myAt[ i ] ) { + offset[ i ] = myAt[ i ]; + myAt[ i ] = offsetPosition; + } + }); + + position = { + my: myAt[0] + (offset[0] < 0 ? offset[0] : "+" + offset[0]) + " " + + myAt[1] + (offset[1] < 0 ? offset[1] : "+" + offset[1]), + at: myAt.join( " " ) + }; + } + + position = $.extend( {}, $.ui.dialog.prototype.options.position, position ); + } else { + position = $.ui.dialog.prototype.options.position; + } + + // need to show the dialog to get the actual offset in the position plugin + isVisible = this.uiDialog.is( ":visible" ); + if ( !isVisible ) { + this.uiDialog.show(); + } + this.uiDialog.position( position ); + if ( !isVisible ) { + this.uiDialog.hide(); + } + }, + + _setOptions: function( options ) { + var that = this, + resizableOptions = {}, + resize = false; + + $.each( options, function( key, value ) { + that._setOption( key, value ); + + if ( key in sizeRelatedOptions ) { + resize = true; + } + if ( key in resizableRelatedOptions ) { + resizableOptions[ key ] = value; + } + }); + + if ( resize ) { + this._size(); + } + if ( this.uiDialog.is( ":data(resizable)" ) ) { + this.uiDialog.resizable( "option", resizableOptions ); + } + }, + + _setOption: function( key, value ) { + var isDraggable, isResizable, + uiDialog = this.uiDialog; + + switch ( key ) { + case "buttons": + this._createButtons( value ); + break; + case "closeText": + // ensure that we always pass a string + this.uiDialogTitlebarCloseText.text( "" + value ); + break; + case "dialogClass": + uiDialog + .removeClass( this.options.dialogClass ) + .addClass( uiDialogClasses + value ); + break; + case "disabled": + if ( value ) { + uiDialog.addClass( "ui-dialog-disabled" ); + } else { + uiDialog.removeClass( "ui-dialog-disabled" ); + } + break; + case "draggable": + isDraggable = uiDialog.is( ":data(draggable)" ); + if ( isDraggable && !value ) { + uiDialog.draggable( "destroy" ); + } + + if ( !isDraggable && value ) { + this._makeDraggable(); + } + break; + case "position": + this._position( value ); + break; + case "resizable": + // currently resizable, becoming non-resizable + isResizable = uiDialog.is( ":data(resizable)" ); + if ( isResizable && !value ) { + uiDialog.resizable( "destroy" ); + } + + // currently resizable, changing handles + if ( isResizable && typeof value === "string" ) { + uiDialog.resizable( "option", "handles", value ); + } + + // currently non-resizable, becoming resizable + if ( !isResizable && value !== false ) { + this._makeResizable( value ); + } + break; + case "title": + // convert whatever was passed in o a string, for html() to not throw up + $( ".ui-dialog-title", this.uiDialogTitlebar ) + .html( "" + ( value || " " ) ); + break; + } + + this._super( key, value ); + }, + + _size: function() { + /* If the user has resized the dialog, the .ui-dialog and .ui-dialog-content + * divs will both have width and height set, so we need to reset them + */ + var nonContentHeight, minContentHeight, autoHeight, + options = this.options, + isVisible = this.uiDialog.is( ":visible" ); + + // reset content sizing + this.element.show().css({ + width: "auto", + minHeight: 0, + height: 0 + }); + + if ( options.minWidth > options.width ) { + options.width = options.minWidth; + } + + // reset wrapper sizing + // determine the height of all the non-content elements + nonContentHeight = this.uiDialog.css({ + height: "auto", + width: options.width + }) + .outerHeight(); + minContentHeight = Math.max( 0, options.minHeight - nonContentHeight ); + + if ( options.height === "auto" ) { + // only needed for IE6 support + if ( $.support.minHeight ) { + this.element.css({ + minHeight: minContentHeight, + height: "auto" + }); + } else { + this.uiDialog.show(); + autoHeight = this.element.css( "height", "auto" ).height(); + if ( !isVisible ) { + this.uiDialog.hide(); + } + this.element.height( Math.max( autoHeight, minContentHeight ) ); + } + } else { + this.element.height( Math.max( options.height - nonContentHeight, 0 ) ); + } + + if (this.uiDialog.is( ":data(resizable)" ) ) { + this.uiDialog.resizable( "option", "minHeight", this._minHeight() ); + } + } +}); + +$.extend($.ui.dialog, { + uuid: 0, + maxZ: 0, + + getTitleId: function($el) { + var id = $el.attr( "id" ); + if ( !id ) { + this.uuid += 1; + id = this.uuid; + } + return "ui-dialog-title-" + id; + }, + + overlay: function( dialog ) { + this.$el = $.ui.dialog.overlay.create( dialog ); + } +}); + +$.extend( $.ui.dialog.overlay, { + instances: [], + // reuse old instances due to IE memory leak with alpha transparency (see #5185) + oldInstances: [], + maxZ: 0, + events: $.map( + "focus,mousedown,mouseup,keydown,keypress,click".split( "," ), + function( event ) { + return event + ".dialog-overlay"; + } + ).join( " " ), + create: function( dialog ) { + if ( this.instances.length === 0 ) { + // prevent use of anchors and inputs + // we use a setTimeout in case the overlay is created from an + // event that we're going to be cancelling (see #2804) + setTimeout(function() { + // handle $(el).dialog().dialog('close') (see #4065) + if ( $.ui.dialog.overlay.instances.length ) { + $( document ).bind( $.ui.dialog.overlay.events, function( event ) { + // stop events if the z-index of the target is < the z-index of the overlay + // we cannot return true when we don't want to cancel the event (#3523) + if ( $( event.target ).zIndex() < $.ui.dialog.overlay.maxZ ) { + return false; + } + }); + } + }, 1 ); + + // handle window resize + $( window ).bind( "resize.dialog-overlay", $.ui.dialog.overlay.resize ); + } + + var $el = ( this.oldInstances.pop() || $( "<div>" ).addClass( "ui-widget-overlay" ) ); + + // allow closing by pressing the escape key + $( document ).bind( "keydown.dialog-overlay", function( event ) { + var instances = $.ui.dialog.overlay.instances; + // only react to the event if we're the top overlay + if ( instances.length !== 0 && instances[ instances.length - 1 ] === $el && + dialog.options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode && + event.keyCode === $.ui.keyCode.ESCAPE ) { + + dialog.close( event ); + event.preventDefault(); + } + }); + + $el.appendTo( document.body ).css({ + width: this.width(), + height: this.height() + }); + + if ( $.fn.bgiframe ) { + $el.bgiframe(); + } + + this.instances.push( $el ); + return $el; + }, + + destroy: function( $el ) { + var indexOf = $.inArray( $el, this.instances ), + maxZ = 0; + + if ( indexOf !== -1 ) { + this.oldInstances.push( this.instances.splice( indexOf, 1 )[ 0 ] ); + } + + if ( this.instances.length === 0 ) { + $( [ document, window ] ).unbind( ".dialog-overlay" ); + } + + $el.height( 0 ).width( 0 ).remove(); + + // adjust the maxZ to allow other modal dialogs to continue to work (see #4309) + $.each( this.instances, function() { + maxZ = Math.max( maxZ, this.css( "z-index" ) ); + }); + this.maxZ = maxZ; + }, + + height: function() { + var scrollHeight, + offsetHeight; + // handle IE + if ( $.ui.ie ) { + scrollHeight = Math.max( + document.documentElement.scrollHeight, + document.body.scrollHeight + ); + offsetHeight = Math.max( + document.documentElement.offsetHeight, + document.body.offsetHeight + ); + + if ( scrollHeight < offsetHeight ) { + return $( window ).height() + "px"; + } else { + return scrollHeight + "px"; + } + // handle "good" browsers + } else { + return $( document ).height() + "px"; + } + }, + + width: function() { + var scrollWidth, + offsetWidth; + // handle IE + if ( $.ui.ie ) { + scrollWidth = Math.max( + document.documentElement.scrollWidth, + document.body.scrollWidth + ); + offsetWidth = Math.max( + document.documentElement.offsetWidth, + document.body.offsetWidth + ); + + if ( scrollWidth < offsetWidth ) { + return $( window ).width() + "px"; + } else { + return scrollWidth + "px"; + } + // handle "good" browsers + } else { + return $( document ).width() + "px"; + } + }, + + resize: function() { + /* If the dialog is draggable and the user drags it past the + * right edge of the window, the document becomes wider so we + * need to stretch the overlay. If the user then drags the + * dialog back to the left, the document will become narrower, + * so we need to shrink the overlay to the appropriate size. + * This is handled by shrinking the overlay before setting it + * to the full document size. + */ + var $overlays = $( [] ); + $.each( $.ui.dialog.overlay.instances, function() { + $overlays = $overlays.add( this ); + }); + + $overlays.css({ + width: 0, + height: 0 + }).css({ + width: $.ui.dialog.overlay.width(), + height: $.ui.dialog.overlay.height() + }); + } +}); + +$.extend( $.ui.dialog.overlay.prototype, { + destroy: function() { + $.ui.dialog.overlay.destroy( this.$el ); + } +}); + +}( jQuery ) ); +(function( $, undefined ) { + +var mouseHandled = false; + +$.widget( "ui.menu", { + version: "1.9.1", + defaultElement: "<ul>", + delay: 300, + options: { + icons: { + submenu: "ui-icon-carat-1-e" + }, + menus: "ul", + position: { + my: "left top", + at: "right top" + }, + role: "menu", + + // callbacks + blur: null, + focus: null, + select: null + }, + + _create: function() { + this.activeMenu = this.element; + this.element + .uniqueId() + .addClass( "ui-menu ui-widget ui-widget-content ui-corner-all" ) + .toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length ) + .attr({ + role: this.options.role, + tabIndex: 0 + }) + // need to catch all clicks on disabled menu + // not possible through _on + .bind( "click" + this.eventNamespace, $.proxy(function( event ) { + if ( this.options.disabled ) { + event.preventDefault(); + } + }, this )); + + if ( this.options.disabled ) { + this.element + .addClass( "ui-state-disabled" ) + .attr( "aria-disabled", "true" ); + } + + this._on({ + // Prevent focus from sticking to links inside menu after clicking + // them (focus should always stay on UL during navigation). + "mousedown .ui-menu-item > a": function( event ) { + event.preventDefault(); + }, + "click .ui-state-disabled > a": function( event ) { + event.preventDefault(); + }, + "click .ui-menu-item:has(a)": function( event ) { + var target = $( event.target ).closest( ".ui-menu-item" ); + if ( !mouseHandled && target.not( ".ui-state-disabled" ).length ) { + mouseHandled = true; + + this.select( event ); + // Open submenu on click + if ( target.has( ".ui-menu" ).length ) { + this.expand( event ); + } else if ( !this.element.is( ":focus" ) ) { + // Redirect focus to the menu + this.element.trigger( "focus", [ true ] ); + + // If the active item is on the top level, let it stay active. + // Otherwise, blur the active item since it is no longer visible. + if ( this.active && this.active.parents( ".ui-menu" ).length === 1 ) { + clearTimeout( this.timer ); + } + } + } + }, + "mouseenter .ui-menu-item": function( event ) { + var target = $( event.currentTarget ); + // Remove ui-state-active class from siblings of the newly focused menu item + // to avoid a jump caused by adjacent elements both having a class with a border + target.siblings().children( ".ui-state-active" ).removeClass( "ui-state-active" ); + this.focus( event, target ); + }, + mouseleave: "collapseAll", + "mouseleave .ui-menu": "collapseAll", + focus: function( event, keepActiveItem ) { + // If there's already an active item, keep it active + // If not, activate the first item + var item = this.active || this.element.children( ".ui-menu-item" ).eq( 0 ); + + if ( !keepActiveItem ) { + this.focus( event, item ); + } + }, + blur: function( event ) { + this._delay(function() { + if ( !$.contains( this.element[0], this.document[0].activeElement ) ) { + this.collapseAll( event ); + } + }); + }, + keydown: "_keydown" + }); + + this.refresh(); + + // Clicks outside of a menu collapse any open menus + this._on( this.document, { + click: function( event ) { + if ( !$( event.target ).closest( ".ui-menu" ).length ) { + this.collapseAll( event ); + } + + // Reset the mouseHandled flag + mouseHandled = false; + } + }); + }, + + _destroy: function() { + // Destroy (sub)menus + this.element + .removeAttr( "aria-activedescendant" ) + .find( ".ui-menu" ).andSelf() + .removeClass( "ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons" ) + .removeAttr( "role" ) + .removeAttr( "tabIndex" ) + .removeAttr( "aria-labelledby" ) + .removeAttr( "aria-expanded" ) + .removeAttr( "aria-hidden" ) + .removeAttr( "aria-disabled" ) + .removeUniqueId() + .show(); + + // Destroy menu items + this.element.find( ".ui-menu-item" ) + .removeClass( "ui-menu-item" ) + .removeAttr( "role" ) + .removeAttr( "aria-disabled" ) + .children( "a" ) + .removeUniqueId() + .removeClass( "ui-corner-all ui-state-hover" ) + .removeAttr( "tabIndex" ) + .removeAttr( "role" ) + .removeAttr( "aria-haspopup" ) + .children().each( function() { + var elem = $( this ); + if ( elem.data( "ui-menu-submenu-carat" ) ) { + elem.remove(); + } + }); + + // Destroy menu dividers + this.element.find( ".ui-menu-divider" ).removeClass( "ui-menu-divider ui-widget-content" ); + }, + + _keydown: function( event ) { + var match, prev, character, skip, regex, + preventDefault = true; + + function escape( value ) { + return value.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" ); + } + + switch ( event.keyCode ) { + case $.ui.keyCode.PAGE_UP: + this.previousPage( event ); + break; + case $.ui.keyCode.PAGE_DOWN: + this.nextPage( event ); + break; + case $.ui.keyCode.HOME: + this._move( "first", "first", event ); + break; + case $.ui.keyCode.END: + this._move( "last", "last", event ); + break; + case $.ui.keyCode.UP: + this.previous( event ); + break; + case $.ui.keyCode.DOWN: + this.next( event ); + break; + case $.ui.keyCode.LEFT: + this.collapse( event ); + break; + case $.ui.keyCode.RIGHT: + if ( this.active && !this.active.is( ".ui-state-disabled" ) ) { + this.expand( event ); + } + break; + case $.ui.keyCode.ENTER: + case $.ui.keyCode.SPACE: + this._activate( event ); + break; + case $.ui.keyCode.ESCAPE: + this.collapse( event ); + break; + default: + preventDefault = false; + prev = this.previousFilter || ""; + character = String.fromCharCode( event.keyCode ); + skip = false; + + clearTimeout( this.filterTimer ); + + if ( character === prev ) { + skip = true; + } else { + character = prev + character; + } + + regex = new RegExp( "^" + escape( character ), "i" ); + match = this.activeMenu.children( ".ui-menu-item" ).filter(function() { + return regex.test( $( this ).children( "a" ).text() ); + }); + match = skip && match.index( this.active.next() ) !== -1 ? + this.active.nextAll( ".ui-menu-item" ) : + match; + + // If no matches on the current filter, reset to the last character pressed + // to move down the menu to the first item that starts with that character + if ( !match.length ) { + character = String.fromCharCode( event.keyCode ); + regex = new RegExp( "^" + escape( character ), "i" ); + match = this.activeMenu.children( ".ui-menu-item" ).filter(function() { + return regex.test( $( this ).children( "a" ).text() ); + }); + } + + if ( match.length ) { + this.focus( event, match ); + if ( match.length > 1 ) { + this.previousFilter = character; + this.filterTimer = this._delay(function() { + delete this.previousFilter; + }, 1000 ); + } else { + delete this.previousFilter; + } + } else { + delete this.previousFilter; + } + } + + if ( preventDefault ) { + event.preventDefault(); + } + }, + + _activate: function( event ) { + if ( !this.active.is( ".ui-state-disabled" ) ) { + if ( this.active.children( "a[aria-haspopup='true']" ).length ) { + this.expand( event ); + } else { + this.select( event ); + } + } + }, + + refresh: function() { + // Initialize nested menus + var menus, + icon = this.options.icons.submenu, + submenus = this.element.find( this.options.menus + ":not(.ui-menu)" ) + .addClass( "ui-menu ui-widget ui-widget-content ui-corner-all" ) + .hide() + .attr({ + role: this.options.role, + "aria-hidden": "true", + "aria-expanded": "false" + }); + + // Don't refresh list items that are already adapted + menus = submenus.add( this.element ); + + menus.children( ":not(.ui-menu-item):has(a)" ) + .addClass( "ui-menu-item" ) + .attr( "role", "presentation" ) + .children( "a" ) + .uniqueId() + .addClass( "ui-corner-all" ) + .attr({ + tabIndex: -1, + role: this._itemRole() + }); + + // Initialize unlinked menu-items containing spaces and/or dashes only as dividers + menus.children( ":not(.ui-menu-item)" ).each(function() { + var item = $( this ); + // hyphen, em dash, en dash + if ( !/[^\-—–\s]/.test( item.text() ) ) { + item.addClass( "ui-widget-content ui-menu-divider" ); + } + }); + + // Add aria-disabled attribute to any disabled menu item + menus.children( ".ui-state-disabled" ).attr( "aria-disabled", "true" ); + + submenus.each(function() { + var menu = $( this ), + item = menu.prev( "a" ), + submenuCarat = $( "<span>" ) + .addClass( "ui-menu-icon ui-icon " + icon ) + .data( "ui-menu-submenu-carat", true ); + + item + .attr( "aria-haspopup", "true" ) + .prepend( submenuCarat ); + menu.attr( "aria-labelledby", item.attr( "id" ) ); + }); + + // If the active item has been removed, blur the menu + if ( this.active && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) { + this.blur(); + } + }, + + _itemRole: function() { + return { + menu: "menuitem", + listbox: "option" + }[ this.options.role ]; + }, + + focus: function( event, item ) { + var nested, focused; + this.blur( event, event && event.type === "focus" ); + + this._scrollIntoView( item ); + + this.active = item.first(); + focused = this.active.children( "a" ).addClass( "ui-state-focus" ); + // Only update aria-activedescendant if there's a role + // otherwise we assume focus is managed elsewhere + if ( this.options.role ) { + this.element.attr( "aria-activedescendant", focused.attr( "id" ) ); + } + + // Highlight active parent menu item, if any + this.active + .parent() + .closest( ".ui-menu-item" ) + .children( "a:first" ) + .addClass( "ui-state-active" ); + + if ( event && event.type === "keydown" ) { + this._close(); + } else { + this.timer = this._delay(function() { + this._close(); + }, this.delay ); + } + + nested = item.children( ".ui-menu" ); + if ( nested.length && ( /^mouse/.test( event.type ) ) ) { + this._startOpening(nested); + } + this.activeMenu = item.parent(); + + this._trigger( "focus", event, { item: item } ); + }, + + _scrollIntoView: function( item ) { + var borderTop, paddingTop, offset, scroll, elementHeight, itemHeight; + if ( this._hasScroll() ) { + borderTop = parseFloat( $.css( this.activeMenu[0], "borderTopWidth" ) ) || 0; + paddingTop = parseFloat( $.css( this.activeMenu[0], "paddingTop" ) ) || 0; + offset = item.offset().top - this.activeMenu.offset().top - borderTop - paddingTop; + scroll = this.activeMenu.scrollTop(); + elementHeight = this.activeMenu.height(); + itemHeight = item.height(); + + if ( offset < 0 ) { + this.activeMenu.scrollTop( scroll + offset ); + } else if ( offset + itemHeight > elementHeight ) { + this.activeMenu.scrollTop( scroll + offset - elementHeight + itemHeight ); + } + } + }, + + blur: function( event, fromFocus ) { + if ( !fromFocus ) { + clearTimeout( this.timer ); + } + + if ( !this.active ) { + return; + } + + this.active.children( "a" ).removeClass( "ui-state-focus" ); + this.active = null; + + this._trigger( "blur", event, { item: this.active } ); + }, + + _startOpening: function( submenu ) { + clearTimeout( this.timer ); + + // Don't open if already open fixes a Firefox bug that caused a .5 pixel + // shift in the submenu position when mousing over the carat icon + if ( submenu.attr( "aria-hidden" ) !== "true" ) { + return; + } + + this.timer = this._delay(function() { + this._close(); + this._open( submenu ); + }, this.delay ); + }, + + _open: function( submenu ) { + var position = $.extend({ + of: this.active + }, this.options.position ); + + clearTimeout( this.timer ); + this.element.find( ".ui-menu" ).not( submenu.parents( ".ui-menu" ) ) + .hide() + .attr( "aria-hidden", "true" ); + + submenu + .show() + .removeAttr( "aria-hidden" ) + .attr( "aria-expanded", "true" ) + .position( position ); + }, + + collapseAll: function( event, all ) { + clearTimeout( this.timer ); + this.timer = this._delay(function() { + // If we were passed an event, look for the submenu that contains the event + var currentMenu = all ? this.element : + $( event && event.target ).closest( this.element.find( ".ui-menu" ) ); + + // If we found no valid submenu ancestor, use the main menu to close all sub menus anyway + if ( !currentMenu.length ) { + currentMenu = this.element; + } + + this._close( currentMenu ); + + this.blur( event ); + this.activeMenu = currentMenu; + }, this.delay ); + }, + + // With no arguments, closes the currently active menu - if nothing is active + // it closes all menus. If passed an argument, it will search for menus BELOW + _close: function( startMenu ) { + if ( !startMenu ) { + startMenu = this.active ? this.active.parent() : this.element; + } + + startMenu + .find( ".ui-menu" ) + .hide() + .attr( "aria-hidden", "true" ) + .attr( "aria-expanded", "false" ) + .end() + .find( "a.ui-state-active" ) + .removeClass( "ui-state-active" ); + }, + + collapse: function( event ) { + var newItem = this.active && + this.active.parent().closest( ".ui-menu-item", this.element ); + if ( newItem && newItem.length ) { + this._close(); + this.focus( event, newItem ); + } + }, + + expand: function( event ) { + var newItem = this.active && + this.active + .children( ".ui-menu " ) + .children( ".ui-menu-item" ) + .first(); + + if ( newItem && newItem.length ) { + this._open( newItem.parent() ); + + // Delay so Firefox will not hide activedescendant change in expanding submenu from AT + this._delay(function() { + this.focus( event, newItem ); + }); + } + }, + + next: function( event ) { + this._move( "next", "first", event ); + }, + + previous: function( event ) { + this._move( "prev", "last", event ); + }, + + isFirstItem: function() { + return this.active && !this.active.prevAll( ".ui-menu-item" ).length; + }, + + isLastItem: function() { + return this.active && !this.active.nextAll( ".ui-menu-item" ).length; + }, + + _move: function( direction, filter, event ) { + var next; + if ( this.active ) { + if ( direction === "first" || direction === "last" ) { + next = this.active + [ direction === "first" ? "prevAll" : "nextAll" ]( ".ui-menu-item" ) + .eq( -1 ); + } else { + next = this.active + [ direction + "All" ]( ".ui-menu-item" ) + .eq( 0 ); + } + } + if ( !next || !next.length || !this.active ) { + next = this.activeMenu.children( ".ui-menu-item" )[ filter ](); + } + + this.focus( event, next ); + }, + + nextPage: function( event ) { + var item, base, height; + + if ( !this.active ) { + this.next( event ); + return; + } + if ( this.isLastItem() ) { + return; + } + if ( this._hasScroll() ) { + base = this.active.offset().top; + height = this.element.height(); + this.active.nextAll( ".ui-menu-item" ).each(function() { + item = $( this ); + return item.offset().top - base - height < 0; + }); + + this.focus( event, item ); + } else { + this.focus( event, this.activeMenu.children( ".ui-menu-item" ) + [ !this.active ? "first" : "last" ]() ); + } + }, + + previousPage: function( event ) { + var item, base, height; + if ( !this.active ) { + this.next( event ); + return; + } + if ( this.isFirstItem() ) { + return; + } + if ( this._hasScroll() ) { + base = this.active.offset().top; + height = this.element.height(); + this.active.prevAll( ".ui-menu-item" ).each(function() { + item = $( this ); + return item.offset().top - base + height > 0; + }); + + this.focus( event, item ); + } else { + this.focus( event, this.activeMenu.children( ".ui-menu-item" ).first() ); + } + }, + + _hasScroll: function() { + return this.element.outerHeight() < this.element.prop( "scrollHeight" ); + }, + + select: function( event ) { + // TODO: It should never be possible to not have an active item at this + // point, but the tests don't trigger mouseenter before click. + this.active = this.active || $( event.target ).closest( ".ui-menu-item" ); + var ui = { item: this.active }; + if ( !this.active.has( ".ui-menu" ).length ) { + this.collapseAll( event, true ); + } + this._trigger( "select", event, ui ); + } +}); + +}( jQuery )); +(function( $, undefined ) { + +$.widget( "ui.progressbar", { + version: "1.9.1", + options: { + value: 0, + max: 100 + }, + + min: 0, + + _create: function() { + this.element + .addClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" ) + .attr({ + role: "progressbar", + "aria-valuemin": this.min, + "aria-valuemax": this.options.max, + "aria-valuenow": this._value() + }); + + this.valueDiv = $( "<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>" ) + .appendTo( this.element ); + + this.oldValue = this._value(); + this._refreshValue(); + }, + + _destroy: function() { + this.element + .removeClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" ) + .removeAttr( "role" ) + .removeAttr( "aria-valuemin" ) + .removeAttr( "aria-valuemax" ) + .removeAttr( "aria-valuenow" ); + + this.valueDiv.remove(); + }, + + value: function( newValue ) { + if ( newValue === undefined ) { + return this._value(); + } + + this._setOption( "value", newValue ); + return this; + }, + + _setOption: function( key, value ) { + if ( key === "value" ) { + this.options.value = value; + this._refreshValue(); + if ( this._value() === this.options.max ) { + this._trigger( "complete" ); + } + } + + this._super( key, value ); + }, + + _value: function() { + var val = this.options.value; + // normalize invalid value + if ( typeof val !== "number" ) { + val = 0; + } + return Math.min( this.options.max, Math.max( this.min, val ) ); + }, + + _percentage: function() { + return 100 * this._value() / this.options.max; + }, + + _refreshValue: function() { + var value = this.value(), + percentage = this._percentage(); + + if ( this.oldValue !== value ) { + this.oldValue = value; + this._trigger( "change" ); + } + + this.valueDiv + .toggle( value > this.min ) + .toggleClass( "ui-corner-right", value === this.options.max ) + .width( percentage.toFixed(0) + "%" ); + this.element.attr( "aria-valuenow", value ); + } +}); + +})( jQuery ); +(function( $, undefined ) { + +// number of pages in a slider +// (how many times can you page up/down to go through the whole range) +var numPages = 5; + +$.widget( "ui.slider", $.ui.mouse, { + version: "1.9.1", + widgetEventPrefix: "slide", + + options: { + animate: false, + distance: 0, + max: 100, + min: 0, + orientation: "horizontal", + range: false, + step: 1, + value: 0, + values: null + }, + + _create: function() { + var i, handleCount, + o = this.options, + existingHandles = this.element.find( ".ui-slider-handle" ).addClass( "ui-state-default ui-corner-all" ), + handle = "<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>", + handles = []; + + this._keySliding = false; + this._mouseSliding = false; + this._animateOff = true; + this._handleIndex = null; + this._detectOrientation(); + this._mouseInit(); + + this.element + .addClass( "ui-slider" + + " ui-slider-" + this.orientation + + " ui-widget" + + " ui-widget-content" + + " ui-corner-all" + + ( o.disabled ? " ui-slider-disabled ui-disabled" : "" ) ); + + this.range = $([]); + + if ( o.range ) { + if ( o.range === true ) { + if ( !o.values ) { + o.values = [ this._valueMin(), this._valueMin() ]; + } + if ( o.values.length && o.values.length !== 2 ) { + o.values = [ o.values[0], o.values[0] ]; + } + } + + this.range = $( "<div></div>" ) + .appendTo( this.element ) + .addClass( "ui-slider-range" + + // note: this isn't the most fittingly semantic framework class for this element, + // but worked best visually with a variety of themes + " ui-widget-header" + + ( ( o.range === "min" || o.range === "max" ) ? " ui-slider-range-" + o.range : "" ) ); + } + + handleCount = ( o.values && o.values.length ) || 1; + + for ( i = existingHandles.length; i < handleCount; i++ ) { + handles.push( handle ); + } + + this.handles = existingHandles.add( $( handles.join( "" ) ).appendTo( this.element ) ); + + this.handle = this.handles.eq( 0 ); + + this.handles.add( this.range ).filter( "a" ) + .click(function( event ) { + event.preventDefault(); + }) + .mouseenter(function() { + if ( !o.disabled ) { + $( this ).addClass( "ui-state-hover" ); + } + }) + .mouseleave(function() { + $( this ).removeClass( "ui-state-hover" ); + }) + .focus(function() { + if ( !o.disabled ) { + $( ".ui-slider .ui-state-focus" ).removeClass( "ui-state-focus" ); + $( this ).addClass( "ui-state-focus" ); + } else { + $( this ).blur(); + } + }) + .blur(function() { + $( this ).removeClass( "ui-state-focus" ); + }); + + this.handles.each(function( i ) { + $( this ).data( "ui-slider-handle-index", i ); + }); + + this._on( this.handles, { + keydown: function( event ) { + var allowed, curVal, newVal, step, + index = $( event.target ).data( "ui-slider-handle-index" ); + + switch ( event.keyCode ) { + case $.ui.keyCode.HOME: + case $.ui.keyCode.END: + case $.ui.keyCode.PAGE_UP: + case $.ui.keyCode.PAGE_DOWN: + case $.ui.keyCode.UP: + case $.ui.keyCode.RIGHT: + case $.ui.keyCode.DOWN: + case $.ui.keyCode.LEFT: + event.preventDefault(); + if ( !this._keySliding ) { + this._keySliding = true; + $( event.target ).addClass( "ui-state-active" ); + allowed = this._start( event, index ); + if ( allowed === false ) { + return; + } + } + break; + } + + step = this.options.step; + if ( this.options.values && this.options.values.length ) { + curVal = newVal = this.values( index ); + } else { + curVal = newVal = this.value(); + } + + switch ( event.keyCode ) { + case $.ui.keyCode.HOME: + newVal = this._valueMin(); + break; + case $.ui.keyCode.END: + newVal = this._valueMax(); + break; + case $.ui.keyCode.PAGE_UP: + newVal = this._trimAlignValue( curVal + ( (this._valueMax() - this._valueMin()) / numPages ) ); + break; + case $.ui.keyCode.PAGE_DOWN: + newVal = this._trimAlignValue( curVal - ( (this._valueMax() - this._valueMin()) / numPages ) ); + break; + case $.ui.keyCode.UP: + case $.ui.keyCode.RIGHT: + if ( curVal === this._valueMax() ) { + return; + } + newVal = this._trimAlignValue( curVal + step ); + break; + case $.ui.keyCode.DOWN: + case $.ui.keyCode.LEFT: + if ( curVal === this._valueMin() ) { + return; + } + newVal = this._trimAlignValue( curVal - step ); + break; + } + + this._slide( event, index, newVal ); + }, + keyup: function( event ) { + var index = $( event.target ).data( "ui-slider-handle-index" ); + + if ( this._keySliding ) { + this._keySliding = false; + this._stop( event, index ); + this._change( event, index ); + $( event.target ).removeClass( "ui-state-active" ); + } + } + }); + + this._refreshValue(); + + this._animateOff = false; + }, + + _destroy: function() { + this.handles.remove(); + this.range.remove(); + + this.element + .removeClass( "ui-slider" + + " ui-slider-horizontal" + + " ui-slider-vertical" + + " ui-slider-disabled" + + " ui-widget" + + " ui-widget-content" + + " ui-corner-all" ); + + this._mouseDestroy(); + }, + + _mouseCapture: function( event ) { + var position, normValue, distance, closestHandle, index, allowed, offset, mouseOverHandle, + that = this, + o = this.options; + + if ( o.disabled ) { + return false; + } + + this.elementSize = { + width: this.element.outerWidth(), + height: this.element.outerHeight() + }; + this.elementOffset = this.element.offset(); + + position = { x: event.pageX, y: event.pageY }; + normValue = this._normValueFromMouse( position ); + distance = this._valueMax() - this._valueMin() + 1; + this.handles.each(function( i ) { + var thisDistance = Math.abs( normValue - that.values(i) ); + if ( distance > thisDistance ) { + distance = thisDistance; + closestHandle = $( this ); + index = i; + } + }); + + // workaround for bug #3736 (if both handles of a range are at 0, + // the first is always used as the one with least distance, + // and moving it is obviously prevented by preventing negative ranges) + if( o.range === true && this.values(1) === o.min ) { + index += 1; + closestHandle = $( this.handles[index] ); + } + + allowed = this._start( event, index ); + if ( allowed === false ) { + return false; + } + this._mouseSliding = true; + + this._handleIndex = index; + + closestHandle + .addClass( "ui-state-active" ) + .focus(); + + offset = closestHandle.offset(); + mouseOverHandle = !$( event.target ).parents().andSelf().is( ".ui-slider-handle" ); + this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : { + left: event.pageX - offset.left - ( closestHandle.width() / 2 ), + top: event.pageY - offset.top - + ( closestHandle.height() / 2 ) - + ( parseInt( closestHandle.css("borderTopWidth"), 10 ) || 0 ) - + ( parseInt( closestHandle.css("borderBottomWidth"), 10 ) || 0) + + ( parseInt( closestHandle.css("marginTop"), 10 ) || 0) + }; + + if ( !this.handles.hasClass( "ui-state-hover" ) ) { + this._slide( event, index, normValue ); + } + this._animateOff = true; + return true; + }, + + _mouseStart: function() { + return true; + }, + + _mouseDrag: function( event ) { + var position = { x: event.pageX, y: event.pageY }, + normValue = this._normValueFromMouse( position ); + + this._slide( event, this._handleIndex, normValue ); + + return false; + }, + + _mouseStop: function( event ) { + this.handles.removeClass( "ui-state-active" ); + this._mouseSliding = false; + + this._stop( event, this._handleIndex ); + this._change( event, this._handleIndex ); + + this._handleIndex = null; + this._clickOffset = null; + this._animateOff = false; + + return false; + }, + + _detectOrientation: function() { + this.orientation = ( this.options.orientation === "vertical" ) ? "vertical" : "horizontal"; + }, + + _normValueFromMouse: function( position ) { + var pixelTotal, + pixelMouse, + percentMouse, + valueTotal, + valueMouse; + + if ( this.orientation === "horizontal" ) { + pixelTotal = this.elementSize.width; + pixelMouse = position.x - this.elementOffset.left - ( this._clickOffset ? this._clickOffset.left : 0 ); + } else { + pixelTotal = this.elementSize.height; + pixelMouse = position.y - this.elementOffset.top - ( this._clickOffset ? this._clickOffset.top : 0 ); + } + + percentMouse = ( pixelMouse / pixelTotal ); + if ( percentMouse > 1 ) { + percentMouse = 1; + } + if ( percentMouse < 0 ) { + percentMouse = 0; + } + if ( this.orientation === "vertical" ) { + percentMouse = 1 - percentMouse; + } + + valueTotal = this._valueMax() - this._valueMin(); + valueMouse = this._valueMin() + percentMouse * valueTotal; + + return this._trimAlignValue( valueMouse ); + }, + + _start: function( event, index ) { + var uiHash = { + handle: this.handles[ index ], + value: this.value() + }; + if ( this.options.values && this.options.values.length ) { + uiHash.value = this.values( index ); + uiHash.values = this.values(); + } + return this._trigger( "start", event, uiHash ); + }, + + _slide: function( event, index, newVal ) { + var otherVal, + newValues, + allowed; + + if ( this.options.values && this.options.values.length ) { + otherVal = this.values( index ? 0 : 1 ); + + if ( ( this.options.values.length === 2 && this.options.range === true ) && + ( ( index === 0 && newVal > otherVal) || ( index === 1 && newVal < otherVal ) ) + ) { + newVal = otherVal; + } + + if ( newVal !== this.values( index ) ) { + newValues = this.values(); + newValues[ index ] = newVal; + // A slide can be canceled by returning false from the slide callback + allowed = this._trigger( "slide", event, { + handle: this.handles[ index ], + value: newVal, + values: newValues + } ); + otherVal = this.values( index ? 0 : 1 ); + if ( allowed !== false ) { + this.values( index, newVal, true ); + } + } + } else { + if ( newVal !== this.value() ) { + // A slide can be canceled by returning false from the slide callback + allowed = this._trigger( "slide", event, { + handle: this.handles[ index ], + value: newVal + } ); + if ( allowed !== false ) { + this.value( newVal ); + } + } + } + }, + + _stop: function( event, index ) { + var uiHash = { + handle: this.handles[ index ], + value: this.value() + }; + if ( this.options.values && this.options.values.length ) { + uiHash.value = this.values( index ); + uiHash.values = this.values(); + } + + this._trigger( "stop", event, uiHash ); + }, + + _change: function( event, index ) { + if ( !this._keySliding && !this._mouseSliding ) { + var uiHash = { + handle: this.handles[ index ], + value: this.value() + }; + if ( this.options.values && this.options.values.length ) { + uiHash.value = this.values( index ); + uiHash.values = this.values(); + } + + this._trigger( "change", event, uiHash ); + } + }, + + value: function( newValue ) { + if ( arguments.length ) { + this.options.value = this._trimAlignValue( newValue ); + this._refreshValue(); + this._change( null, 0 ); + return; + } + + return this._value(); + }, + + values: function( index, newValue ) { + var vals, + newValues, + i; + + if ( arguments.length > 1 ) { + this.options.values[ index ] = this._trimAlignValue( newValue ); + this._refreshValue(); + this._change( null, index ); + return; + } + + if ( arguments.length ) { + if ( $.isArray( arguments[ 0 ] ) ) { + vals = this.options.values; + newValues = arguments[ 0 ]; + for ( i = 0; i < vals.length; i += 1 ) { + vals[ i ] = this._trimAlignValue( newValues[ i ] ); + this._change( null, i ); + } + this._refreshValue(); + } else { + if ( this.options.values && this.options.values.length ) { + return this._values( index ); + } else { + return this.value(); + } + } + } else { + return this._values(); + } + }, + + _setOption: function( key, value ) { + var i, + valsLength = 0; + + if ( $.isArray( this.options.values ) ) { + valsLength = this.options.values.length; + } + + $.Widget.prototype._setOption.apply( this, arguments ); + + switch ( key ) { + case "disabled": + if ( value ) { + this.handles.filter( ".ui-state-focus" ).blur(); + this.handles.removeClass( "ui-state-hover" ); + this.handles.prop( "disabled", true ); + this.element.addClass( "ui-disabled" ); + } else { + this.handles.prop( "disabled", false ); + this.element.removeClass( "ui-disabled" ); + } + break; + case "orientation": + this._detectOrientation(); + this.element + .removeClass( "ui-slider-horizontal ui-slider-vertical" ) + .addClass( "ui-slider-" + this.orientation ); + this._refreshValue(); + break; + case "value": + this._animateOff = true; + this._refreshValue(); + this._change( null, 0 ); + this._animateOff = false; + break; + case "values": + this._animateOff = true; + this._refreshValue(); + for ( i = 0; i < valsLength; i += 1 ) { + this._change( null, i ); + } + this._animateOff = false; + break; + case "min": + case "max": + this._animateOff = true; + this._refreshValue(); + this._animateOff = false; + break; + } + }, + + //internal value getter + // _value() returns value trimmed by min and max, aligned by step + _value: function() { + var val = this.options.value; + val = this._trimAlignValue( val ); + + return val; + }, + + //internal values getter + // _values() returns array of values trimmed by min and max, aligned by step + // _values( index ) returns single value trimmed by min and max, aligned by step + _values: function( index ) { + var val, + vals, + i; + + if ( arguments.length ) { + val = this.options.values[ index ]; + val = this._trimAlignValue( val ); + + return val; + } else { + // .slice() creates a copy of the array + // this copy gets trimmed by min and max and then returned + vals = this.options.values.slice(); + for ( i = 0; i < vals.length; i+= 1) { + vals[ i ] = this._trimAlignValue( vals[ i ] ); + } + + return vals; + } + }, + + // returns the step-aligned value that val is closest to, between (inclusive) min and max + _trimAlignValue: function( val ) { + if ( val <= this._valueMin() ) { + return this._valueMin(); + } + if ( val >= this._valueMax() ) { + return this._valueMax(); + } + var step = ( this.options.step > 0 ) ? this.options.step : 1, + valModStep = (val - this._valueMin()) % step, + alignValue = val - valModStep; + + if ( Math.abs(valModStep) * 2 >= step ) { + alignValue += ( valModStep > 0 ) ? step : ( -step ); + } + + // Since JavaScript has problems with large floats, round + // the final value to 5 digits after the decimal point (see #4124) + return parseFloat( alignValue.toFixed(5) ); + }, + + _valueMin: function() { + return this.options.min; + }, + + _valueMax: function() { + return this.options.max; + }, + + _refreshValue: function() { + var lastValPercent, valPercent, value, valueMin, valueMax, + oRange = this.options.range, + o = this.options, + that = this, + animate = ( !this._animateOff ) ? o.animate : false, + _set = {}; + + if ( this.options.values && this.options.values.length ) { + this.handles.each(function( i ) { + valPercent = ( that.values(i) - that._valueMin() ) / ( that._valueMax() - that._valueMin() ) * 100; + _set[ that.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%"; + $( this ).stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate ); + if ( that.options.range === true ) { + if ( that.orientation === "horizontal" ) { + if ( i === 0 ) { + that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { left: valPercent + "%" }, o.animate ); + } + if ( i === 1 ) { + that.range[ animate ? "animate" : "css" ]( { width: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } ); + } + } else { + if ( i === 0 ) { + that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { bottom: ( valPercent ) + "%" }, o.animate ); + } + if ( i === 1 ) { + that.range[ animate ? "animate" : "css" ]( { height: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } ); + } + } + } + lastValPercent = valPercent; + }); + } else { + value = this.value(); + valueMin = this._valueMin(); + valueMax = this._valueMax(); + valPercent = ( valueMax !== valueMin ) ? + ( value - valueMin ) / ( valueMax - valueMin ) * 100 : + 0; + _set[ this.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%"; + this.handle.stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate ); + + if ( oRange === "min" && this.orientation === "horizontal" ) { + this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { width: valPercent + "%" }, o.animate ); + } + if ( oRange === "max" && this.orientation === "horizontal" ) { + this.range[ animate ? "animate" : "css" ]( { width: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } ); + } + if ( oRange === "min" && this.orientation === "vertical" ) { + this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { height: valPercent + "%" }, o.animate ); + } + if ( oRange === "max" && this.orientation === "vertical" ) { + this.range[ animate ? "animate" : "css" ]( { height: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } ); + } + } + } + +}); + +}(jQuery)); +(function( $ ) { + +function modifier( fn ) { + return function() { + var previous = this.element.val(); + fn.apply( this, arguments ); + this._refresh(); + if ( previous !== this.element.val() ) { + this._trigger( "change" ); + } + }; +} + +$.widget( "ui.spinner", { + version: "1.9.1", + defaultElement: "<input>", + widgetEventPrefix: "spin", + options: { + culture: null, + icons: { + down: "ui-icon-triangle-1-s", + up: "ui-icon-triangle-1-n" + }, + incremental: true, + max: null, + min: null, + numberFormat: null, + page: 10, + step: 1, + + change: null, + spin: null, + start: null, + stop: null + }, + + _create: function() { + // handle string values that need to be parsed + this._setOption( "max", this.options.max ); + this._setOption( "min", this.options.min ); + this._setOption( "step", this.options.step ); + + // format the value, but don't constrain + this._value( this.element.val(), true ); + + this._draw(); + this._on( this._events ); + this._refresh(); + + // turning off autocomplete prevents the browser from remembering the + // value when navigating through history, so we re-enable autocomplete + // if the page is unloaded before the widget is destroyed. #7790 + this._on( this.window, { + beforeunload: function() { + this.element.removeAttr( "autocomplete" ); + } + }); + }, + + _getCreateOptions: function() { + var options = {}, + element = this.element; + + $.each( [ "min", "max", "step" ], function( i, option ) { + var value = element.attr( option ); + if ( value !== undefined && value.length ) { + options[ option ] = value; + } + }); + + return options; + }, + + _events: { + keydown: function( event ) { + if ( this._start( event ) && this._keydown( event ) ) { + event.preventDefault(); + } + }, + keyup: "_stop", + focus: function() { + this.previous = this.element.val(); + }, + blur: function( event ) { + if ( this.cancelBlur ) { + delete this.cancelBlur; + return; + } + + this._refresh(); + if ( this.previous !== this.element.val() ) { + this._trigger( "change", event ); + } + }, + mousewheel: function( event, delta ) { + if ( !delta ) { + return; + } + if ( !this.spinning && !this._start( event ) ) { + return false; + } + + this._spin( (delta > 0 ? 1 : -1) * this.options.step, event ); + clearTimeout( this.mousewheelTimer ); + this.mousewheelTimer = this._delay(function() { + if ( this.spinning ) { + this._stop( event ); + } + }, 100 ); + event.preventDefault(); + }, + "mousedown .ui-spinner-button": function( event ) { + var previous; + + // We never want the buttons to have focus; whenever the user is + // interacting with the spinner, the focus should be on the input. + // If the input is focused then this.previous is properly set from + // when the input first received focus. If the input is not focused + // then we need to set this.previous based on the value before spinning. + previous = this.element[0] === this.document[0].activeElement ? + this.previous : this.element.val(); + function checkFocus() { + var isActive = this.element[0] === this.document[0].activeElement; + if ( !isActive ) { + this.element.focus(); + this.previous = previous; + // support: IE + // IE sets focus asynchronously, so we need to check if focus + // moved off of the input because the user clicked on the button. + this._delay(function() { + this.previous = previous; + }); + } + } + + // ensure focus is on (or stays on) the text field + event.preventDefault(); + checkFocus.call( this ); + + // support: IE + // IE doesn't prevent moving focus even with event.preventDefault() + // so we set a flag to know when we should ignore the blur event + // and check (again) if focus moved off of the input. + this.cancelBlur = true; + this._delay(function() { + delete this.cancelBlur; + checkFocus.call( this ); + }); + + if ( this._start( event ) === false ) { + return; + } + + this._repeat( null, $( event.currentTarget ).hasClass( "ui-spinner-up" ) ? 1 : -1, event ); + }, + "mouseup .ui-spinner-button": "_stop", + "mouseenter .ui-spinner-button": function( event ) { + // button will add ui-state-active if mouse was down while mouseleave and kept down + if ( !$( event.currentTarget ).hasClass( "ui-state-active" ) ) { + return; + } + + if ( this._start( event ) === false ) { + return false; + } + this._repeat( null, $( event.currentTarget ).hasClass( "ui-spinner-up" ) ? 1 : -1, event ); + }, + // TODO: do we really want to consider this a stop? + // shouldn't we just stop the repeater and wait until mouseup before + // we trigger the stop event? + "mouseleave .ui-spinner-button": "_stop" + }, + + _draw: function() { + var uiSpinner = this.uiSpinner = this.element + .addClass( "ui-spinner-input" ) + .attr( "autocomplete", "off" ) + .wrap( this._uiSpinnerHtml() ) + .parent() + // add buttons + .append( this._buttonHtml() ); + + this.element.attr( "role", "spinbutton" ); + + // button bindings + this.buttons = uiSpinner.find( ".ui-spinner-button" ) + .attr( "tabIndex", -1 ) + .button() + .removeClass( "ui-corner-all" ); + + // IE 6 doesn't understand height: 50% for the buttons + // unless the wrapper has an explicit height + if ( this.buttons.height() > Math.ceil( uiSpinner.height() * 0.5 ) && + uiSpinner.height() > 0 ) { + uiSpinner.height( uiSpinner.height() ); + } + + // disable spinner if element was already disabled + if ( this.options.disabled ) { + this.disable(); + } + }, + + _keydown: function( event ) { + var options = this.options, + keyCode = $.ui.keyCode; + + switch ( event.keyCode ) { + case keyCode.UP: + this._repeat( null, 1, event ); + return true; + case keyCode.DOWN: + this._repeat( null, -1, event ); + return true; + case keyCode.PAGE_UP: + this._repeat( null, options.page, event ); + return true; + case keyCode.PAGE_DOWN: + this._repeat( null, -options.page, event ); + return true; + } + + return false; + }, + + _uiSpinnerHtml: function() { + return "<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>"; + }, + + _buttonHtml: function() { + return "" + + "<a class='ui-spinner-button ui-spinner-up ui-corner-tr'>" + + "<span class='ui-icon " + this.options.icons.up + "'>▲</span>" + + "</a>" + + "<a class='ui-spinner-button ui-spinner-down ui-corner-br'>" + + "<span class='ui-icon " + this.options.icons.down + "'>▼</span>" + + "</a>"; + }, + + _start: function( event ) { + if ( !this.spinning && this._trigger( "start", event ) === false ) { + return false; + } + + if ( !this.counter ) { + this.counter = 1; + } + this.spinning = true; + return true; + }, + + _repeat: function( i, steps, event ) { + i = i || 500; + + clearTimeout( this.timer ); + this.timer = this._delay(function() { + this._repeat( 40, steps, event ); + }, i ); + + this._spin( steps * this.options.step, event ); + }, + + _spin: function( step, event ) { + var value = this.value() || 0; + + if ( !this.counter ) { + this.counter = 1; + } + + value = this._adjustValue( value + step * this._increment( this.counter ) ); + + if ( !this.spinning || this._trigger( "spin", event, { value: value } ) !== false) { + this._value( value ); + this.counter++; + } + }, + + _increment: function( i ) { + var incremental = this.options.incremental; + + if ( incremental ) { + return $.isFunction( incremental ) ? + incremental( i ) : + Math.floor( i*i*i/50000 - i*i/500 + 17*i/200 + 1 ); + } + + return 1; + }, + + _precision: function() { + var precision = this._precisionOf( this.options.step ); + if ( this.options.min !== null ) { + precision = Math.max( precision, this._precisionOf( this.options.min ) ); + } + return precision; + }, + + _precisionOf: function( num ) { + var str = num.toString(), + decimal = str.indexOf( "." ); + return decimal === -1 ? 0 : str.length - decimal - 1; + }, + + _adjustValue: function( value ) { + var base, aboveMin, + options = this.options; + + // make sure we're at a valid step + // - find out where we are relative to the base (min or 0) + base = options.min !== null ? options.min : 0; + aboveMin = value - base; + // - round to the nearest step + aboveMin = Math.round(aboveMin / options.step) * options.step; + // - rounding is based on 0, so adjust back to our base + value = base + aboveMin; + + // fix precision from bad JS floating point math + value = parseFloat( value.toFixed( this._precision() ) ); + + // clamp the value + if ( options.max !== null && value > options.max) { + return options.max; + } + if ( options.min !== null && value < options.min ) { + return options.min; + } + + return value; + }, + + _stop: function( event ) { + if ( !this.spinning ) { + return; + } + + clearTimeout( this.timer ); + clearTimeout( this.mousewheelTimer ); + this.counter = 0; + this.spinning = false; + this._trigger( "stop", event ); + }, + + _setOption: function( key, value ) { + if ( key === "culture" || key === "numberFormat" ) { + var prevValue = this._parse( this.element.val() ); + this.options[ key ] = value; + this.element.val( this._format( prevValue ) ); + return; + } + + if ( key === "max" || key === "min" || key === "step" ) { + if ( typeof value === "string" ) { + value = this._parse( value ); + } + } + + this._super( key, value ); + + if ( key === "disabled" ) { + if ( value ) { + this.element.prop( "disabled", true ); + this.buttons.button( "disable" ); + } else { + this.element.prop( "disabled", false ); + this.buttons.button( "enable" ); + } + } + }, + + _setOptions: modifier(function( options ) { + this._super( options ); + this._value( this.element.val() ); + }), + + _parse: function( val ) { + if ( typeof val === "string" && val !== "" ) { + val = window.Globalize && this.options.numberFormat ? + Globalize.parseFloat( val, 10, this.options.culture ) : +val; + } + return val === "" || isNaN( val ) ? null : val; + }, + + _format: function( value ) { + if ( value === "" ) { + return ""; + } + return window.Globalize && this.options.numberFormat ? + Globalize.format( value, this.options.numberFormat, this.options.culture ) : + value; + }, + + _refresh: function() { + this.element.attr({ + "aria-valuemin": this.options.min, + "aria-valuemax": this.options.max, + // TODO: what should we do with values that can't be parsed? + "aria-valuenow": this._parse( this.element.val() ) + }); + }, + + // update the value without triggering change + _value: function( value, allowAny ) { + var parsed; + if ( value !== "" ) { + parsed = this._parse( value ); + if ( parsed !== null ) { + if ( !allowAny ) { + parsed = this._adjustValue( parsed ); + } + value = this._format( parsed ); + } + } + this.element.val( value ); + this._refresh(); + }, + + _destroy: function() { + this.element + .removeClass( "ui-spinner-input" ) + .prop( "disabled", false ) + .removeAttr( "autocomplete" ) + .removeAttr( "role" ) + .removeAttr( "aria-valuemin" ) + .removeAttr( "aria-valuemax" ) + .removeAttr( "aria-valuenow" ); + this.uiSpinner.replaceWith( this.element ); + }, + + stepUp: modifier(function( steps ) { + this._stepUp( steps ); + }), + _stepUp: function( steps ) { + this._spin( (steps || 1) * this.options.step ); + }, + + stepDown: modifier(function( steps ) { + this._stepDown( steps ); + }), + _stepDown: function( steps ) { + this._spin( (steps || 1) * -this.options.step ); + }, + + pageUp: modifier(function( pages ) { + this._stepUp( (pages || 1) * this.options.page ); + }), + + pageDown: modifier(function( pages ) { + this._stepDown( (pages || 1) * this.options.page ); + }), + + value: function( newVal ) { + if ( !arguments.length ) { + return this._parse( this.element.val() ); + } + modifier( this._value ).call( this, newVal ); + }, + + widget: function() { + return this.uiSpinner; + } +}); + +}( jQuery ) ); +(function( $, undefined ) { + +var tabId = 0, + rhash = /#.*$/; + +function getNextTabId() { + return ++tabId; +} + +function isLocal( anchor ) { + return anchor.hash.length > 1 && + anchor.href.replace( rhash, "" ) === location.href.replace( rhash, "" ); +} + +$.widget( "ui.tabs", { + version: "1.9.1", + delay: 300, + options: { + active: null, + collapsible: false, + event: "click", + heightStyle: "content", + hide: null, + show: null, + + // callbacks + activate: null, + beforeActivate: null, + beforeLoad: null, + load: null + }, + + _create: function() { + var that = this, + options = this.options, + active = options.active, + locationHash = location.hash.substring( 1 ); + + this.running = false; + + this.element + .addClass( "ui-tabs ui-widget ui-widget-content ui-corner-all" ) + .toggleClass( "ui-tabs-collapsible", options.collapsible ) + // Prevent users from focusing disabled tabs via click + .delegate( ".ui-tabs-nav > li", "mousedown" + this.eventNamespace, function( event ) { + if ( $( this ).is( ".ui-state-disabled" ) ) { + event.preventDefault(); + } + }) + // support: IE <9 + // Preventing the default action in mousedown doesn't prevent IE + // from focusing the element, so if the anchor gets focused, blur. + // We don't have to worry about focusing the previously focused + // element since clicking on a non-focusable element should focus + // the body anyway. + .delegate( ".ui-tabs-anchor", "focus" + this.eventNamespace, function() { + if ( $( this ).closest( "li" ).is( ".ui-state-disabled" ) ) { + this.blur(); + } + }); + + this._processTabs(); + + if ( active === null ) { + // check the fragment identifier in the URL + if ( locationHash ) { + this.tabs.each(function( i, tab ) { + if ( $( tab ).attr( "aria-controls" ) === locationHash ) { + active = i; + return false; + } + }); + } + + // check for a tab marked active via a class + if ( active === null ) { + active = this.tabs.index( this.tabs.filter( ".ui-tabs-active" ) ); + } + + // no active tab, set to false + if ( active === null || active === -1 ) { + active = this.tabs.length ? 0 : false; + } + } + + // handle numbers: negative, out of range + if ( active !== false ) { + active = this.tabs.index( this.tabs.eq( active ) ); + if ( active === -1 ) { + active = options.collapsible ? false : 0; + } + } + options.active = active; + + // don't allow collapsible: false and active: false + if ( !options.collapsible && options.active === false && this.anchors.length ) { + options.active = 0; + } + + // Take disabling tabs via class attribute from HTML + // into account and update option properly. + if ( $.isArray( options.disabled ) ) { + options.disabled = $.unique( options.disabled.concat( + $.map( this.tabs.filter( ".ui-state-disabled" ), function( li ) { + return that.tabs.index( li ); + }) + ) ).sort(); + } + + // check for length avoids error when initializing empty list + if ( this.options.active !== false && this.anchors.length ) { + this.active = this._findActive( this.options.active ); + } else { + this.active = $(); + } + + this._refresh(); + + if ( this.active.length ) { + this.load( options.active ); + } + }, + + _getCreateEventData: function() { + return { + tab: this.active, + panel: !this.active.length ? $() : this._getPanelForTab( this.active ) + }; + }, + + _tabKeydown: function( event ) { + var focusedTab = $( this.document[0].activeElement ).closest( "li" ), + selectedIndex = this.tabs.index( focusedTab ), + goingForward = true; + + if ( this._handlePageNav( event ) ) { + return; + } + + switch ( event.keyCode ) { + case $.ui.keyCode.RIGHT: + case $.ui.keyCode.DOWN: + selectedIndex++; + break; + case $.ui.keyCode.UP: + case $.ui.keyCode.LEFT: + goingForward = false; + selectedIndex--; + break; + case $.ui.keyCode.END: + selectedIndex = this.anchors.length - 1; + break; + case $.ui.keyCode.HOME: + selectedIndex = 0; + break; + case $.ui.keyCode.SPACE: + // Activate only, no collapsing + event.preventDefault(); + clearTimeout( this.activating ); + this._activate( selectedIndex ); + return; + case $.ui.keyCode.ENTER: + // Toggle (cancel delayed activation, allow collapsing) + event.preventDefault(); + clearTimeout( this.activating ); + // Determine if we should collapse or activate + this._activate( selectedIndex === this.options.active ? false : selectedIndex ); + return; + default: + return; + } + + // Focus the appropriate tab, based on which key was pressed + event.preventDefault(); + clearTimeout( this.activating ); + selectedIndex = this._focusNextTab( selectedIndex, goingForward ); + + // Navigating with control key will prevent automatic activation + if ( !event.ctrlKey ) { + // Update aria-selected immediately so that AT think the tab is already selected. + // Otherwise AT may confuse the user by stating that they need to activate the tab, + // but the tab will already be activated by the time the announcement finishes. + focusedTab.attr( "aria-selected", "false" ); + this.tabs.eq( selectedIndex ).attr( "aria-selected", "true" ); + + this.activating = this._delay(function() { + this.option( "active", selectedIndex ); + }, this.delay ); + } + }, + + _panelKeydown: function( event ) { + if ( this._handlePageNav( event ) ) { + return; + } + + // Ctrl+up moves focus to the current tab + if ( event.ctrlKey && event.keyCode === $.ui.keyCode.UP ) { + event.preventDefault(); + this.active.focus(); + } + }, + + // Alt+page up/down moves focus to the previous/next tab (and activates) + _handlePageNav: function( event ) { + if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_UP ) { + this._activate( this._focusNextTab( this.options.active - 1, false ) ); + return true; + } + if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_DOWN ) { + this._activate( this._focusNextTab( this.options.active + 1, true ) ); + return true; + } + }, + + _findNextTab: function( index, goingForward ) { + var lastTabIndex = this.tabs.length - 1; + + function constrain() { + if ( index > lastTabIndex ) { + index = 0; + } + if ( index < 0 ) { + index = lastTabIndex; + } + return index; + } + + while ( $.inArray( constrain(), this.options.disabled ) !== -1 ) { + index = goingForward ? index + 1 : index - 1; + } + + return index; + }, + + _focusNextTab: function( index, goingForward ) { + index = this._findNextTab( index, goingForward ); + this.tabs.eq( index ).focus(); + return index; + }, + + _setOption: function( key, value ) { + if ( key === "active" ) { + // _activate() will handle invalid values and update this.options + this._activate( value ); + return; + } + + if ( key === "disabled" ) { + // don't use the widget factory's disabled handling + this._setupDisabled( value ); + return; + } + + this._super( key, value); + + if ( key === "collapsible" ) { + this.element.toggleClass( "ui-tabs-collapsible", value ); + // Setting collapsible: false while collapsed; open first panel + if ( !value && this.options.active === false ) { + this._activate( 0 ); + } + } + + if ( key === "event" ) { + this._setupEvents( value ); + } + + if ( key === "heightStyle" ) { + this._setupHeightStyle( value ); + } + }, + + _tabId: function( tab ) { + return tab.attr( "aria-controls" ) || "ui-tabs-" + getNextTabId(); + }, + + _sanitizeSelector: function( hash ) { + return hash ? hash.replace( /[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g, "\\$&" ) : ""; + }, + + refresh: function() { + var options = this.options, + lis = this.tablist.children( ":has(a[href])" ); + + // get disabled tabs from class attribute from HTML + // this will get converted to a boolean if needed in _refresh() + options.disabled = $.map( lis.filter( ".ui-state-disabled" ), function( tab ) { + return lis.index( tab ); + }); + + this._processTabs(); + + // was collapsed or no tabs + if ( options.active === false || !this.anchors.length ) { + options.active = false; + this.active = $(); + // was active, but active tab is gone + } else if ( this.active.length && !$.contains( this.tablist[ 0 ], this.active[ 0 ] ) ) { + // all remaining tabs are disabled + if ( this.tabs.length === options.disabled.length ) { + options.active = false; + this.active = $(); + // activate previous tab + } else { + this._activate( this._findNextTab( Math.max( 0, options.active - 1 ), false ) ); + } + // was active, active tab still exists + } else { + // make sure active index is correct + options.active = this.tabs.index( this.active ); + } + + this._refresh(); + }, + + _refresh: function() { + this._setupDisabled( this.options.disabled ); + this._setupEvents( this.options.event ); + this._setupHeightStyle( this.options.heightStyle ); + + this.tabs.not( this.active ).attr({ + "aria-selected": "false", + tabIndex: -1 + }); + this.panels.not( this._getPanelForTab( this.active ) ) + .hide() + .attr({ + "aria-expanded": "false", + "aria-hidden": "true" + }); + + // Make sure one tab is in the tab order + if ( !this.active.length ) { + this.tabs.eq( 0 ).attr( "tabIndex", 0 ); + } else { + this.active + .addClass( "ui-tabs-active ui-state-active" ) + .attr({ + "aria-selected": "true", + tabIndex: 0 + }); + this._getPanelForTab( this.active ) + .show() + .attr({ + "aria-expanded": "true", + "aria-hidden": "false" + }); + } + }, + + _processTabs: function() { + var that = this; + + this.tablist = this._getList() + .addClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" ) + .attr( "role", "tablist" ); + + this.tabs = this.tablist.find( "> li:has(a[href])" ) + .addClass( "ui-state-default ui-corner-top" ) + .attr({ + role: "tab", + tabIndex: -1 + }); + + this.anchors = this.tabs.map(function() { + return $( "a", this )[ 0 ]; + }) + .addClass( "ui-tabs-anchor" ) + .attr({ + role: "presentation", + tabIndex: -1 + }); + + this.panels = $(); + + this.anchors.each(function( i, anchor ) { + var selector, panel, panelId, + anchorId = $( anchor ).uniqueId().attr( "id" ), + tab = $( anchor ).closest( "li" ), + originalAriaControls = tab.attr( "aria-controls" ); + + // inline tab + if ( isLocal( anchor ) ) { + selector = anchor.hash; + panel = that.element.find( that._sanitizeSelector( selector ) ); + // remote tab + } else { + panelId = that._tabId( tab ); + selector = "#" + panelId; + panel = that.element.find( selector ); + if ( !panel.length ) { + panel = that._createPanel( panelId ); + panel.insertAfter( that.panels[ i - 1 ] || that.tablist ); + } + panel.attr( "aria-live", "polite" ); + } + + if ( panel.length) { + that.panels = that.panels.add( panel ); + } + if ( originalAriaControls ) { + tab.data( "ui-tabs-aria-controls", originalAriaControls ); + } + tab.attr({ + "aria-controls": selector.substring( 1 ), + "aria-labelledby": anchorId + }); + panel.attr( "aria-labelledby", anchorId ); + }); + + this.panels + .addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" ) + .attr( "role", "tabpanel" ); + }, + + // allow overriding how to find the list for rare usage scenarios (#7715) + _getList: function() { + return this.element.find( "ol,ul" ).eq( 0 ); + }, + + _createPanel: function( id ) { + return $( "<div>" ) + .attr( "id", id ) + .addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" ) + .data( "ui-tabs-destroy", true ); + }, + + _setupDisabled: function( disabled ) { + if ( $.isArray( disabled ) ) { + if ( !disabled.length ) { + disabled = false; + } else if ( disabled.length === this.anchors.length ) { + disabled = true; + } + } + + // disable tabs + for ( var i = 0, li; ( li = this.tabs[ i ] ); i++ ) { + if ( disabled === true || $.inArray( i, disabled ) !== -1 ) { + $( li ) + .addClass( "ui-state-disabled" ) + .attr( "aria-disabled", "true" ); + } else { + $( li ) + .removeClass( "ui-state-disabled" ) + .removeAttr( "aria-disabled" ); + } + } + + this.options.disabled = disabled; + }, + + _setupEvents: function( event ) { + var events = { + click: function( event ) { + event.preventDefault(); + } + }; + if ( event ) { + $.each( event.split(" "), function( index, eventName ) { + events[ eventName ] = "_eventHandler"; + }); + } + + this._off( this.anchors.add( this.tabs ).add( this.panels ) ); + this._on( this.anchors, events ); + this._on( this.tabs, { keydown: "_tabKeydown" } ); + this._on( this.panels, { keydown: "_panelKeydown" } ); + + this._focusable( this.tabs ); + this._hoverable( this.tabs ); + }, + + _setupHeightStyle: function( heightStyle ) { + var maxHeight, overflow, + parent = this.element.parent(); + + if ( heightStyle === "fill" ) { + // IE 6 treats height like minHeight, so we need to turn off overflow + // in order to get a reliable height + // we use the minHeight support test because we assume that only + // browsers that don't support minHeight will treat height as minHeight + if ( !$.support.minHeight ) { + overflow = parent.css( "overflow" ); + parent.css( "overflow", "hidden"); + } + maxHeight = parent.height(); + this.element.siblings( ":visible" ).each(function() { + var elem = $( this ), + position = elem.css( "position" ); + + if ( position === "absolute" || position === "fixed" ) { + return; + } + maxHeight -= elem.outerHeight( true ); + }); + if ( overflow ) { + parent.css( "overflow", overflow ); + } + + this.element.children().not( this.panels ).each(function() { + maxHeight -= $( this ).outerHeight( true ); + }); + + this.panels.each(function() { + $( this ).height( Math.max( 0, maxHeight - + $( this ).innerHeight() + $( this ).height() ) ); + }) + .css( "overflow", "auto" ); + } else if ( heightStyle === "auto" ) { + maxHeight = 0; + this.panels.each(function() { + maxHeight = Math.max( maxHeight, $( this ).height( "" ).height() ); + }).height( maxHeight ); + } + }, + + _eventHandler: function( event ) { + var options = this.options, + active = this.active, + anchor = $( event.currentTarget ), + tab = anchor.closest( "li" ), + clickedIsActive = tab[ 0 ] === active[ 0 ], + collapsing = clickedIsActive && options.collapsible, + toShow = collapsing ? $() : this._getPanelForTab( tab ), + toHide = !active.length ? $() : this._getPanelForTab( active ), + eventData = { + oldTab: active, + oldPanel: toHide, + newTab: collapsing ? $() : tab, + newPanel: toShow + }; + + event.preventDefault(); + + if ( tab.hasClass( "ui-state-disabled" ) || + // tab is already loading + tab.hasClass( "ui-tabs-loading" ) || + // can't switch durning an animation + this.running || + // click on active header, but not collapsible + ( clickedIsActive && !options.collapsible ) || + // allow canceling activation + ( this._trigger( "beforeActivate", event, eventData ) === false ) ) { + return; + } + + options.active = collapsing ? false : this.tabs.index( tab ); + + this.active = clickedIsActive ? $() : tab; + if ( this.xhr ) { + this.xhr.abort(); + } + + if ( !toHide.length && !toShow.length ) { + $.error( "jQuery UI Tabs: Mismatching fragment identifier." ); + } + + if ( toShow.length ) { + this.load( this.tabs.index( tab ), event ); + } + this._toggle( event, eventData ); + }, + + // handles show/hide for selecting tabs + _toggle: function( event, eventData ) { + var that = this, + toShow = eventData.newPanel, + toHide = eventData.oldPanel; + + this.running = true; + + function complete() { + that.running = false; + that._trigger( "activate", event, eventData ); + } + + function show() { + eventData.newTab.closest( "li" ).addClass( "ui-tabs-active ui-state-active" ); + + if ( toShow.length && that.options.show ) { + that._show( toShow, that.options.show, complete ); + } else { + toShow.show(); + complete(); + } + } + + // start out by hiding, then showing, then completing + if ( toHide.length && this.options.hide ) { + this._hide( toHide, this.options.hide, function() { + eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" ); + show(); + }); + } else { + eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" ); + toHide.hide(); + show(); + } + + toHide.attr({ + "aria-expanded": "false", + "aria-hidden": "true" + }); + eventData.oldTab.attr( "aria-selected", "false" ); + // If we're switching tabs, remove the old tab from the tab order. + // If we're opening from collapsed state, remove the previous tab from the tab order. + // If we're collapsing, then keep the collapsing tab in the tab order. + if ( toShow.length && toHide.length ) { + eventData.oldTab.attr( "tabIndex", -1 ); + } else if ( toShow.length ) { + this.tabs.filter(function() { + return $( this ).attr( "tabIndex" ) === 0; + }) + .attr( "tabIndex", -1 ); + } + + toShow.attr({ + "aria-expanded": "true", + "aria-hidden": "false" + }); + eventData.newTab.attr({ + "aria-selected": "true", + tabIndex: 0 + }); + }, + + _activate: function( index ) { + var anchor, + active = this._findActive( index ); + + // trying to activate the already active panel + if ( active[ 0 ] === this.active[ 0 ] ) { + return; + } + + // trying to collapse, simulate a click on the current active header + if ( !active.length ) { + active = this.active; + } + + anchor = active.find( ".ui-tabs-anchor" )[ 0 ]; + this._eventHandler({ + target: anchor, + currentTarget: anchor, + preventDefault: $.noop + }); + }, + + _findActive: function( index ) { + return index === false ? $() : this.tabs.eq( index ); + }, + + _getIndex: function( index ) { + // meta-function to give users option to provide a href string instead of a numerical index. + if ( typeof index === "string" ) { + index = this.anchors.index( this.anchors.filter( "[href$='" + index + "']" ) ); + } + + return index; + }, + + _destroy: function() { + if ( this.xhr ) { + this.xhr.abort(); + } + + this.element.removeClass( "ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible" ); + + this.tablist + .removeClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" ) + .removeAttr( "role" ); + + this.anchors + .removeClass( "ui-tabs-anchor" ) + .removeAttr( "role" ) + .removeAttr( "tabIndex" ) + .removeData( "href.tabs" ) + .removeData( "load.tabs" ) + .removeUniqueId(); + + this.tabs.add( this.panels ).each(function() { + if ( $.data( this, "ui-tabs-destroy" ) ) { + $( this ).remove(); + } else { + $( this ) + .removeClass( "ui-state-default ui-state-active ui-state-disabled " + + "ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel" ) + .removeAttr( "tabIndex" ) + .removeAttr( "aria-live" ) + .removeAttr( "aria-busy" ) + .removeAttr( "aria-selected" ) + .removeAttr( "aria-labelledby" ) + .removeAttr( "aria-hidden" ) + .removeAttr( "aria-expanded" ) + .removeAttr( "role" ); + } + }); + + this.tabs.each(function() { + var li = $( this ), + prev = li.data( "ui-tabs-aria-controls" ); + if ( prev ) { + li.attr( "aria-controls", prev ); + } else { + li.removeAttr( "aria-controls" ); + } + }); + + if ( this.options.heightStyle !== "content" ) { + this.panels.css( "height", "" ); + } + }, + + enable: function( index ) { + var disabled = this.options.disabled; + if ( disabled === false ) { + return; + } + + if ( index === undefined ) { + disabled = false; + } else { + index = this._getIndex( index ); + if ( $.isArray( disabled ) ) { + disabled = $.map( disabled, function( num ) { + return num !== index ? num : null; + }); + } else { + disabled = $.map( this.tabs, function( li, num ) { + return num !== index ? num : null; + }); + } + } + this._setupDisabled( disabled ); + }, + + disable: function( index ) { + var disabled = this.options.disabled; + if ( disabled === true ) { + return; + } + + if ( index === undefined ) { + disabled = true; + } else { + index = this._getIndex( index ); + if ( $.inArray( index, disabled ) !== -1 ) { + return; + } + if ( $.isArray( disabled ) ) { + disabled = $.merge( [ index ], disabled ).sort(); + } else { + disabled = [ index ]; + } + } + this._setupDisabled( disabled ); + }, + + load: function( index, event ) { + index = this._getIndex( index ); + var that = this, + tab = this.tabs.eq( index ), + anchor = tab.find( ".ui-tabs-anchor" ), + panel = this._getPanelForTab( tab ), + eventData = { + tab: tab, + panel: panel + }; + + // not remote + if ( isLocal( anchor[ 0 ] ) ) { + return; + } + + this.xhr = $.ajax( this._ajaxSettings( anchor, event, eventData ) ); + + // support: jQuery <1.8 + // jQuery <1.8 returns false if the request is canceled in beforeSend, + // but as of 1.8, $.ajax() always returns a jqXHR object. + if ( this.xhr && this.xhr.statusText !== "canceled" ) { + tab.addClass( "ui-tabs-loading" ); + panel.attr( "aria-busy", "true" ); + + this.xhr + .success(function( response ) { + // support: jQuery <1.8 + // http://bugs.jquery.com/ticket/11778 + setTimeout(function() { + panel.html( response ); + that._trigger( "load", event, eventData ); + }, 1 ); + }) + .complete(function( jqXHR, status ) { + // support: jQuery <1.8 + // http://bugs.jquery.com/ticket/11778 + setTimeout(function() { + if ( status === "abort" ) { + that.panels.stop( false, true ); + } + + tab.removeClass( "ui-tabs-loading" ); + panel.removeAttr( "aria-busy" ); + + if ( jqXHR === that.xhr ) { + delete that.xhr; + } + }, 1 ); + }); + } + }, + + // TODO: Remove this function in 1.10 when ajaxOptions is removed + _ajaxSettings: function( anchor, event, eventData ) { + var that = this; + return { + url: anchor.attr( "href" ), + beforeSend: function( jqXHR, settings ) { + return that._trigger( "beforeLoad", event, + $.extend( { jqXHR : jqXHR, ajaxSettings: settings }, eventData ) ); + } + }; + }, + + _getPanelForTab: function( tab ) { + var id = $( tab ).attr( "aria-controls" ); + return this.element.find( this._sanitizeSelector( "#" + id ) ); + } +}); + +// DEPRECATED +if ( $.uiBackCompat !== false ) { + + // helper method for a lot of the back compat extensions + $.ui.tabs.prototype._ui = function( tab, panel ) { + return { + tab: tab, + panel: panel, + index: this.anchors.index( tab ) + }; + }; + + // url method + $.widget( "ui.tabs", $.ui.tabs, { + url: function( index, url ) { + this.anchors.eq( index ).attr( "href", url ); + } + }); + + // TODO: Remove _ajaxSettings() method when removing this extension + // ajaxOptions and cache options + $.widget( "ui.tabs", $.ui.tabs, { + options: { + ajaxOptions: null, + cache: false + }, + + _create: function() { + this._super(); + + var that = this; + + this._on({ tabsbeforeload: function( event, ui ) { + // tab is already cached + if ( $.data( ui.tab[ 0 ], "cache.tabs" ) ) { + event.preventDefault(); + return; + } + + ui.jqXHR.success(function() { + if ( that.options.cache ) { + $.data( ui.tab[ 0 ], "cache.tabs", true ); + } + }); + }}); + }, + + _ajaxSettings: function( anchor, event, ui ) { + var ajaxOptions = this.options.ajaxOptions; + return $.extend( {}, ajaxOptions, { + error: function( xhr, status ) { + try { + // Passing index avoid a race condition when this method is + // called after the user has selected another tab. + // Pass the anchor that initiated this request allows + // loadError to manipulate the tab content panel via $(a.hash) + ajaxOptions.error( + xhr, status, ui.tab.closest( "li" ).index(), ui.tab[ 0 ] ); + } + catch ( error ) {} + } + }, this._superApply( arguments ) ); + }, + + _setOption: function( key, value ) { + // reset cache if switching from cached to not cached + if ( key === "cache" && value === false ) { + this.anchors.removeData( "cache.tabs" ); + } + this._super( key, value ); + }, + + _destroy: function() { + this.anchors.removeData( "cache.tabs" ); + this._super(); + }, + + url: function( index ){ + this.anchors.eq( index ).removeData( "cache.tabs" ); + this._superApply( arguments ); + } + }); + + // abort method + $.widget( "ui.tabs", $.ui.tabs, { + abort: function() { + if ( this.xhr ) { + this.xhr.abort(); + } + } + }); + + // spinner + $.widget( "ui.tabs", $.ui.tabs, { + options: { + spinner: "<em>Loading…</em>" + }, + _create: function() { + this._super(); + this._on({ + tabsbeforeload: function( event, ui ) { + // Don't react to nested tabs or tabs that don't use a spinner + if ( event.target !== this.element[ 0 ] || + !this.options.spinner ) { + return; + } + + var span = ui.tab.find( "span" ), + html = span.html(); + span.html( this.options.spinner ); + ui.jqXHR.complete(function() { + span.html( html ); + }); + } + }); + } + }); + + // enable/disable events + $.widget( "ui.tabs", $.ui.tabs, { + options: { + enable: null, + disable: null + }, + + enable: function( index ) { + var options = this.options, + trigger; + + if ( index && options.disabled === true || + ( $.isArray( options.disabled ) && $.inArray( index, options.disabled ) !== -1 ) ) { + trigger = true; + } + + this._superApply( arguments ); + + if ( trigger ) { + this._trigger( "enable", null, this._ui( this.anchors[ index ], this.panels[ index ] ) ); + } + }, + + disable: function( index ) { + var options = this.options, + trigger; + + if ( index && options.disabled === false || + ( $.isArray( options.disabled ) && $.inArray( index, options.disabled ) === -1 ) ) { + trigger = true; + } + + this._superApply( arguments ); + + if ( trigger ) { + this._trigger( "disable", null, this._ui( this.anchors[ index ], this.panels[ index ] ) ); + } + } + }); + + // add/remove methods and events + $.widget( "ui.tabs", $.ui.tabs, { + options: { + add: null, + remove: null, + tabTemplate: "<li><a href='#{href}'><span>#{label}</span></a></li>" + }, + + add: function( url, label, index ) { + if ( index === undefined ) { + index = this.anchors.length; + } + + var doInsertAfter, panel, + options = this.options, + li = $( options.tabTemplate + .replace( /#\{href\}/g, url ) + .replace( /#\{label\}/g, label ) ), + id = !url.indexOf( "#" ) ? + url.replace( "#", "" ) : + this._tabId( li ); + + li.addClass( "ui-state-default ui-corner-top" ).data( "ui-tabs-destroy", true ); + li.attr( "aria-controls", id ); + + doInsertAfter = index >= this.tabs.length; + + // try to find an existing element before creating a new one + panel = this.element.find( "#" + id ); + if ( !panel.length ) { + panel = this._createPanel( id ); + if ( doInsertAfter ) { + if ( index > 0 ) { + panel.insertAfter( this.panels.eq( -1 ) ); + } else { + panel.appendTo( this.element ); + } + } else { + panel.insertBefore( this.panels[ index ] ); + } + } + panel.addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" ).hide(); + + if ( doInsertAfter ) { + li.appendTo( this.tablist ); + } else { + li.insertBefore( this.tabs[ index ] ); + } + + options.disabled = $.map( options.disabled, function( n ) { + return n >= index ? ++n : n; + }); + + this.refresh(); + if ( this.tabs.length === 1 && options.active === false ) { + this.option( "active", 0 ); + } + + this._trigger( "add", null, this._ui( this.anchors[ index ], this.panels[ index ] ) ); + return this; + }, + + remove: function( index ) { + index = this._getIndex( index ); + var options = this.options, + tab = this.tabs.eq( index ).remove(), + panel = this._getPanelForTab( tab ).remove(); + + // If selected tab was removed focus tab to the right or + // in case the last tab was removed the tab to the left. + // We check for more than 2 tabs, because if there are only 2, + // then when we remove this tab, there will only be one tab left + // so we don't need to detect which tab to activate. + if ( tab.hasClass( "ui-tabs-active" ) && this.anchors.length > 2 ) { + this._activate( index + ( index + 1 < this.anchors.length ? 1 : -1 ) ); + } + + options.disabled = $.map( + $.grep( options.disabled, function( n ) { + return n !== index; + }), + function( n ) { + return n >= index ? --n : n; + }); + + this.refresh(); + + this._trigger( "remove", null, this._ui( tab.find( "a" )[ 0 ], panel[ 0 ] ) ); + return this; + } + }); + + // length method + $.widget( "ui.tabs", $.ui.tabs, { + length: function() { + return this.anchors.length; + } + }); + + // panel ids (idPrefix option + title attribute) + $.widget( "ui.tabs", $.ui.tabs, { + options: { + idPrefix: "ui-tabs-" + }, + + _tabId: function( tab ) { + var a = tab.is( "li" ) ? tab.find( "a[href]" ) : tab; + a = a[0]; + return $( a ).closest( "li" ).attr( "aria-controls" ) || + a.title && a.title.replace( /\s/g, "_" ).replace( /[^\w\u00c0-\uFFFF\-]/g, "" ) || + this.options.idPrefix + getNextTabId(); + } + }); + + // _createPanel method + $.widget( "ui.tabs", $.ui.tabs, { + options: { + panelTemplate: "<div></div>" + }, + + _createPanel: function( id ) { + return $( this.options.panelTemplate ) + .attr( "id", id ) + .addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" ) + .data( "ui-tabs-destroy", true ); + } + }); + + // selected option + $.widget( "ui.tabs", $.ui.tabs, { + _create: function() { + var options = this.options; + if ( options.active === null && options.selected !== undefined ) { + options.active = options.selected === -1 ? false : options.selected; + } + this._super(); + options.selected = options.active; + if ( options.selected === false ) { + options.selected = -1; + } + }, + + _setOption: function( key, value ) { + if ( key !== "selected" ) { + return this._super( key, value ); + } + + var options = this.options; + this._super( "active", value === -1 ? false : value ); + options.selected = options.active; + if ( options.selected === false ) { + options.selected = -1; + } + }, + + _eventHandler: function() { + this._superApply( arguments ); + this.options.selected = this.options.active; + if ( this.options.selected === false ) { + this.options.selected = -1; + } + } + }); + + // show and select event + $.widget( "ui.tabs", $.ui.tabs, { + options: { + show: null, + select: null + }, + _create: function() { + this._super(); + if ( this.options.active !== false ) { + this._trigger( "show", null, this._ui( + this.active.find( ".ui-tabs-anchor" )[ 0 ], + this._getPanelForTab( this.active )[ 0 ] ) ); + } + }, + _trigger: function( type, event, data ) { + var ret = this._superApply( arguments ); + if ( !ret ) { + return false; + } + if ( type === "beforeActivate" && data.newTab.length ) { + ret = this._super( "select", event, { + tab: data.newTab.find( ".ui-tabs-anchor" )[ 0], + panel: data.newPanel[ 0 ], + index: data.newTab.closest( "li" ).index() + }); + } else if ( type === "activate" && data.newTab.length ) { + ret = this._super( "show", event, { + tab: data.newTab.find( ".ui-tabs-anchor" )[ 0 ], + panel: data.newPanel[ 0 ], + index: data.newTab.closest( "li" ).index() + }); + } + return ret; + } + }); + + // select method + $.widget( "ui.tabs", $.ui.tabs, { + select: function( index ) { + index = this._getIndex( index ); + if ( index === -1 ) { + if ( this.options.collapsible && this.options.selected !== -1 ) { + index = this.options.selected; + } else { + return; + } + } + this.anchors.eq( index ).trigger( this.options.event + this.eventNamespace ); + } + }); + + // cookie option + (function() { + + var listId = 0; + + $.widget( "ui.tabs", $.ui.tabs, { + options: { + cookie: null // e.g. { expires: 7, path: '/', domain: 'jquery.com', secure: true } + }, + _create: function() { + var options = this.options, + active; + if ( options.active == null && options.cookie ) { + active = parseInt( this._cookie(), 10 ); + if ( active === -1 ) { + active = false; + } + options.active = active; + } + this._super(); + }, + _cookie: function( active ) { + var cookie = [ this.cookie || + ( this.cookie = this.options.cookie.name || "ui-tabs-" + (++listId) ) ]; + if ( arguments.length ) { + cookie.push( active === false ? -1 : active ); + cookie.push( this.options.cookie ); + } + return $.cookie.apply( null, cookie ); + }, + _refresh: function() { + this._super(); + if ( this.options.cookie ) { + this._cookie( this.options.active, this.options.cookie ); + } + }, + _eventHandler: function() { + this._superApply( arguments ); + if ( this.options.cookie ) { + this._cookie( this.options.active, this.options.cookie ); + } + }, + _destroy: function() { + this._super(); + if ( this.options.cookie ) { + this._cookie( null, this.options.cookie ); + } + } + }); + + })(); + + // load event + $.widget( "ui.tabs", $.ui.tabs, { + _trigger: function( type, event, data ) { + var _data = $.extend( {}, data ); + if ( type === "load" ) { + _data.panel = _data.panel[ 0 ]; + _data.tab = _data.tab.find( ".ui-tabs-anchor" )[ 0 ]; + } + return this._super( type, event, _data ); + } + }); + + // fx option + // The new animation options (show, hide) conflict with the old show callback. + // The old fx option wins over show/hide anyway (always favor back-compat). + // If a user wants to use the new animation API, they must give up the old API. + $.widget( "ui.tabs", $.ui.tabs, { + options: { + fx: null // e.g. { height: "toggle", opacity: "toggle", duration: 200 } + }, + + _getFx: function() { + var hide, show, + fx = this.options.fx; + + if ( fx ) { + if ( $.isArray( fx ) ) { + hide = fx[ 0 ]; + show = fx[ 1 ]; + } else { + hide = show = fx; + } + } + + return fx ? { show: show, hide: hide } : null; + }, + + _toggle: function( event, eventData ) { + var that = this, + toShow = eventData.newPanel, + toHide = eventData.oldPanel, + fx = this._getFx(); + + if ( !fx ) { + return this._super( event, eventData ); + } + + that.running = true; + + function complete() { + that.running = false; + that._trigger( "activate", event, eventData ); + } + + function show() { + eventData.newTab.closest( "li" ).addClass( "ui-tabs-active ui-state-active" ); + + if ( toShow.length && fx.show ) { + toShow + .animate( fx.show, fx.show.duration, function() { + complete(); + }); + } else { + toShow.show(); + complete(); + } + } + + // start out by hiding, then showing, then completing + if ( toHide.length && fx.hide ) { + toHide.animate( fx.hide, fx.hide.duration, function() { + eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" ); + show(); + }); + } else { + eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" ); + toHide.hide(); + show(); + } + } + }); +} + +})( jQuery ); +(function( $ ) { + +var increments = 0; + +function addDescribedBy( elem, id ) { + var describedby = (elem.attr( "aria-describedby" ) || "").split( /\s+/ ); + describedby.push( id ); + elem + .data( "ui-tooltip-id", id ) + .attr( "aria-describedby", $.trim( describedby.join( " " ) ) ); +} + +function removeDescribedBy( elem ) { + var id = elem.data( "ui-tooltip-id" ), + describedby = (elem.attr( "aria-describedby" ) || "").split( /\s+/ ), + index = $.inArray( id, describedby ); + if ( index !== -1 ) { + describedby.splice( index, 1 ); + } + + elem.removeData( "ui-tooltip-id" ); + describedby = $.trim( describedby.join( " " ) ); + if ( describedby ) { + elem.attr( "aria-describedby", describedby ); + } else { + elem.removeAttr( "aria-describedby" ); + } +} + +$.widget( "ui.tooltip", { + version: "1.9.1", + options: { + content: function() { + return $( this ).attr( "title" ); + }, + hide: true, + // Disabled elements have inconsistent behavior across browsers (#8661) + items: "[title]:not([disabled])", + position: { + my: "left top+15", + at: "left bottom", + collision: "flipfit flipfit" + }, + show: true, + tooltipClass: null, + track: false, + + // callbacks + close: null, + open: null + }, + + _create: function() { + this._on({ + mouseover: "open", + focusin: "open" + }); + + // IDs of generated tooltips, needed for destroy + this.tooltips = {}; + // IDs of parent tooltips where we removed the title attribute + this.parents = {}; + + if ( this.options.disabled ) { + this._disable(); + } + }, + + _setOption: function( key, value ) { + var that = this; + + if ( key === "disabled" ) { + this[ value ? "_disable" : "_enable" ](); + this.options[ key ] = value; + // disable element style changes + return; + } + + this._super( key, value ); + + if ( key === "content" ) { + $.each( this.tooltips, function( id, element ) { + that._updateContent( element ); + }); + } + }, + + _disable: function() { + var that = this; + + // close open tooltips + $.each( this.tooltips, function( id, element ) { + var event = $.Event( "blur" ); + event.target = event.currentTarget = element[0]; + that.close( event, true ); + }); + + // remove title attributes to prevent native tooltips + this.element.find( this.options.items ).andSelf().each(function() { + var element = $( this ); + if ( element.is( "[title]" ) ) { + element + .data( "ui-tooltip-title", element.attr( "title" ) ) + .attr( "title", "" ); + } + }); + }, + + _enable: function() { + // restore title attributes + this.element.find( this.options.items ).andSelf().each(function() { + var element = $( this ); + if ( element.data( "ui-tooltip-title" ) ) { + element.attr( "title", element.data( "ui-tooltip-title" ) ); + } + }); + }, + + open: function( event ) { + var that = this, + target = $( event ? event.target : this.element ) + // we need closest here due to mouseover bubbling, + // but always pointing at the same event target + .closest( this.options.items ); + + // No element to show a tooltip for + if ( !target.length ) { + return; + } + + // If the tooltip is open and we're tracking then reposition the tooltip. + // This makes sure that a tracking tooltip doesn't obscure a focused element + // if the user was hovering when the element gained focused. + if ( this.options.track && target.data( "ui-tooltip-id" ) ) { + this._find( target ).position( $.extend({ + of: target + }, this.options.position ) ); + // Stop tracking (#8622) + this._off( this.document, "mousemove" ); + return; + } + + if ( target.attr( "title" ) ) { + target.data( "ui-tooltip-title", target.attr( "title" ) ); + } + + target.data( "tooltip-open", true ); + + // kill parent tooltips, custom or native, for hover + if ( event && event.type === "mouseover" ) { + target.parents().each(function() { + var blurEvent; + if ( $( this ).data( "tooltip-open" ) ) { + blurEvent = $.Event( "blur" ); + blurEvent.target = blurEvent.currentTarget = this; + that.close( blurEvent, true ); + } + if ( this.title ) { + $( this ).uniqueId(); + that.parents[ this.id ] = { + element: this, + title: this.title + }; + this.title = ""; + } + }); + } + + this._updateContent( target, event ); + }, + + _updateContent: function( target, event ) { + var content, + contentOption = this.options.content, + that = this; + + if ( typeof contentOption === "string" ) { + return this._open( event, target, contentOption ); + } + + content = contentOption.call( target[0], function( response ) { + // ignore async response if tooltip was closed already + if ( !target.data( "tooltip-open" ) ) { + return; + } + // IE may instantly serve a cached response for ajax requests + // delay this call to _open so the other call to _open runs first + that._delay(function() { + this._open( event, target, response ); + }); + }); + if ( content ) { + this._open( event, target, content ); + } + }, + + _open: function( event, target, content ) { + var tooltip, events, delayedShow, + positionOption = $.extend( {}, this.options.position ); + + if ( !content ) { + return; + } + + // Content can be updated multiple times. If the tooltip already + // exists, then just update the content and bail. + tooltip = this._find( target ); + if ( tooltip.length ) { + tooltip.find( ".ui-tooltip-content" ).html( content ); + return; + } + + // if we have a title, clear it to prevent the native tooltip + // we have to check first to avoid defining a title if none exists + // (we don't want to cause an element to start matching [title]) + // + // We use removeAttr only for key events, to allow IE to export the correct + // accessible attributes. For mouse events, set to empty string to avoid + // native tooltip showing up (happens only when removing inside mouseover). + if ( target.is( "[title]" ) ) { + if ( event && event.type === "mouseover" ) { + target.attr( "title", "" ); + } else { + target.removeAttr( "title" ); + } + } + + tooltip = this._tooltip( target ); + addDescribedBy( target, tooltip.attr( "id" ) ); + tooltip.find( ".ui-tooltip-content" ).html( content ); + + function position( event ) { + positionOption.of = event; + if ( tooltip.is( ":hidden" ) ) { + return; + } + tooltip.position( positionOption ); + } + if ( this.options.track && event && /^mouse/.test( event.originalEvent.type ) ) { + this._on( this.document, { + mousemove: position + }); + // trigger once to override element-relative positioning + position( event ); + } else { + tooltip.position( $.extend({ + of: target + }, this.options.position ) ); + } + + tooltip.hide(); + + this._show( tooltip, this.options.show ); + // Handle tracking tooltips that are shown with a delay (#8644). As soon + // as the tooltip is visible, position the tooltip using the most recent + // event. + if ( this.options.show && this.options.show.delay ) { + delayedShow = setInterval(function() { + if ( tooltip.is( ":visible" ) ) { + position( positionOption.of ); + clearInterval( delayedShow ); + } + }, $.fx.interval ); + } + + this._trigger( "open", event, { tooltip: tooltip } ); + + events = { + keyup: function( event ) { + if ( event.keyCode === $.ui.keyCode.ESCAPE ) { + var fakeEvent = $.Event(event); + fakeEvent.currentTarget = target[0]; + this.close( fakeEvent, true ); + } + }, + remove: function() { + this._removeTooltip( tooltip ); + } + }; + if ( !event || event.type === "mouseover" ) { + events.mouseleave = "close"; + } + if ( !event || event.type === "focusin" ) { + events.focusout = "close"; + } + this._on( target, events ); + }, + + close: function( event ) { + var that = this, + target = $( event ? event.currentTarget : this.element ), + tooltip = this._find( target ); + + // disabling closes the tooltip, so we need to track when we're closing + // to avoid an infinite loop in case the tooltip becomes disabled on close + if ( this.closing ) { + return; + } + + // only set title if we had one before (see comment in _open()) + if ( target.data( "ui-tooltip-title" ) ) { + target.attr( "title", target.data( "ui-tooltip-title" ) ); + } + + removeDescribedBy( target ); + + tooltip.stop( true ); + this._hide( tooltip, this.options.hide, function() { + that._removeTooltip( $( this ) ); + }); + + target.removeData( "tooltip-open" ); + this._off( target, "mouseleave focusout keyup" ); + // Remove 'remove' binding only on delegated targets + if ( target[0] !== this.element[0] ) { + this._off( target, "remove" ); + } + this._off( this.document, "mousemove" ); + + if ( event && event.type === "mouseleave" ) { + $.each( this.parents, function( id, parent ) { + parent.element.title = parent.title; + delete that.parents[ id ]; + }); + } + + this.closing = true; + this._trigger( "close", event, { tooltip: tooltip } ); + this.closing = false; + }, + + _tooltip: function( element ) { + var id = "ui-tooltip-" + increments++, + tooltip = $( "<div>" ) + .attr({ + id: id, + role: "tooltip" + }) + .addClass( "ui-tooltip ui-widget ui-corner-all ui-widget-content " + + ( this.options.tooltipClass || "" ) ); + $( "<div>" ) + .addClass( "ui-tooltip-content" ) + .appendTo( tooltip ); + tooltip.appendTo( this.document[0].body ); + if ( $.fn.bgiframe ) { + tooltip.bgiframe(); + } + this.tooltips[ id ] = element; + return tooltip; + }, + + _find: function( target ) { + var id = target.data( "ui-tooltip-id" ); + return id ? $( "#" + id ) : $(); + }, + + _removeTooltip: function( tooltip ) { + tooltip.remove(); + delete this.tooltips[ tooltip.attr( "id" ) ]; + }, + + _destroy: function() { + var that = this; + + // close open tooltips + $.each( this.tooltips, function( id, element ) { + // Delegate to close method to handle common cleanup + var event = $.Event( "blur" ); + event.target = event.currentTarget = element[0]; + that.close( event, true ); + + // Remove immediately; destroying an open tooltip doesn't use the + // hide animation + $( "#" + id ).remove(); + + // Restore the title + if ( element.data( "ui-tooltip-title" ) ) { + element.attr( "title", element.data( "ui-tooltip-title" ) ); + element.removeData( "ui-tooltip-title" ); + } + }); + } +}); + +}( jQuery ) ); +;(jQuery.effects || (function($, undefined) { + +var backCompat = $.uiBackCompat !== false, + // prefix used for storing data on .data() + dataSpace = "ui-effects-"; + +$.effects = { + effect: {} +}; + +/*! + * jQuery Color Animations v2.0.0 + * http://jquery.com/ + * + * Copyright 2012 jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + * + * Date: Mon Aug 13 13:41:02 2012 -0500 + */ +(function( jQuery, undefined ) { + + var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor".split(" "), + + // plusequals test for += 100 -= 100 + rplusequals = /^([\-+])=\s*(\d+\.?\d*)/, + // a set of RE's that can match strings and generate color tuples. + stringParsers = [{ + re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/, + parse: function( execResult ) { + return [ + execResult[ 1 ], + execResult[ 2 ], + execResult[ 3 ], + execResult[ 4 ] + ]; + } + }, { + re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/, + parse: function( execResult ) { + return [ + execResult[ 1 ] * 2.55, + execResult[ 2 ] * 2.55, + execResult[ 3 ] * 2.55, + execResult[ 4 ] + ]; + } + }, { + // this regex ignores A-F because it's compared against an already lowercased string + re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/, + parse: function( execResult ) { + return [ + parseInt( execResult[ 1 ], 16 ), + parseInt( execResult[ 2 ], 16 ), + parseInt( execResult[ 3 ], 16 ) + ]; + } + }, { + // this regex ignores A-F because it's compared against an already lowercased string + re: /#([a-f0-9])([a-f0-9])([a-f0-9])/, + parse: function( execResult ) { + return [ + parseInt( execResult[ 1 ] + execResult[ 1 ], 16 ), + parseInt( execResult[ 2 ] + execResult[ 2 ], 16 ), + parseInt( execResult[ 3 ] + execResult[ 3 ], 16 ) + ]; + } + }, { + re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/, + space: "hsla", + parse: function( execResult ) { + return [ + execResult[ 1 ], + execResult[ 2 ] / 100, + execResult[ 3 ] / 100, + execResult[ 4 ] + ]; + } + }], + + // jQuery.Color( ) + color = jQuery.Color = function( color, green, blue, alpha ) { + return new jQuery.Color.fn.parse( color, green, blue, alpha ); + }, + spaces = { + rgba: { + props: { + red: { + idx: 0, + type: "byte" + }, + green: { + idx: 1, + type: "byte" + }, + blue: { + idx: 2, + type: "byte" + } + } + }, + + hsla: { + props: { + hue: { + idx: 0, + type: "degrees" + }, + saturation: { + idx: 1, + type: "percent" + }, + lightness: { + idx: 2, + type: "percent" + } + } + } + }, + propTypes = { + "byte": { + floor: true, + max: 255 + }, + "percent": { + max: 1 + }, + "degrees": { + mod: 360, + floor: true + } + }, + support = color.support = {}, + + // element for support tests + supportElem = jQuery( "<p>" )[ 0 ], + + // colors = jQuery.Color.names + colors, + + // local aliases of functions called often + each = jQuery.each; + +// determine rgba support immediately +supportElem.style.cssText = "background-color:rgba(1,1,1,.5)"; +support.rgba = supportElem.style.backgroundColor.indexOf( "rgba" ) > -1; + +// define cache name and alpha properties +// for rgba and hsla spaces +each( spaces, function( spaceName, space ) { + space.cache = "_" + spaceName; + space.props.alpha = { + idx: 3, + type: "percent", + def: 1 + }; +}); + +function clamp( value, prop, allowEmpty ) { + var type = propTypes[ prop.type ] || {}; + + if ( value == null ) { + return (allowEmpty || !prop.def) ? null : prop.def; + } + + // ~~ is an short way of doing floor for positive numbers + value = type.floor ? ~~value : parseFloat( value ); + + // IE will pass in empty strings as value for alpha, + // which will hit this case + if ( isNaN( value ) ) { + return prop.def; + } + + if ( type.mod ) { + // we add mod before modding to make sure that negatives values + // get converted properly: -10 -> 350 + return (value + type.mod) % type.mod; + } + + // for now all property types without mod have min and max + return 0 > value ? 0 : type.max < value ? type.max : value; +} + +function stringParse( string ) { + var inst = color(), + rgba = inst._rgba = []; + + string = string.toLowerCase(); + + each( stringParsers, function( i, parser ) { + var parsed, + match = parser.re.exec( string ), + values = match && parser.parse( match ), + spaceName = parser.space || "rgba"; + + if ( values ) { + parsed = inst[ spaceName ]( values ); + + // if this was an rgba parse the assignment might happen twice + // oh well.... + inst[ spaces[ spaceName ].cache ] = parsed[ spaces[ spaceName ].cache ]; + rgba = inst._rgba = parsed._rgba; + + // exit each( stringParsers ) here because we matched + return false; + } + }); + + // Found a stringParser that handled it + if ( rgba.length ) { + + // if this came from a parsed string, force "transparent" when alpha is 0 + // chrome, (and maybe others) return "transparent" as rgba(0,0,0,0) + if ( rgba.join() === "0,0,0,0" ) { + jQuery.extend( rgba, colors.transparent ); + } + return inst; + } + + // named colors + return colors[ string ]; +} + +color.fn = jQuery.extend( color.prototype, { + parse: function( red, green, blue, alpha ) { + if ( red === undefined ) { + this._rgba = [ null, null, null, null ]; + return this; + } + if ( red.jquery || red.nodeType ) { + red = jQuery( red ).css( green ); + green = undefined; + } + + var inst = this, + type = jQuery.type( red ), + rgba = this._rgba = []; + + // more than 1 argument specified - assume ( red, green, blue, alpha ) + if ( green !== undefined ) { + red = [ red, green, blue, alpha ]; + type = "array"; + } + + if ( type === "string" ) { + return this.parse( stringParse( red ) || colors._default ); + } + + if ( type === "array" ) { + each( spaces.rgba.props, function( key, prop ) { + rgba[ prop.idx ] = clamp( red[ prop.idx ], prop ); + }); + return this; + } + + if ( type === "object" ) { + if ( red instanceof color ) { + each( spaces, function( spaceName, space ) { + if ( red[ space.cache ] ) { + inst[ space.cache ] = red[ space.cache ].slice(); + } + }); + } else { + each( spaces, function( spaceName, space ) { + var cache = space.cache; + each( space.props, function( key, prop ) { + + // if the cache doesn't exist, and we know how to convert + if ( !inst[ cache ] && space.to ) { + + // if the value was null, we don't need to copy it + // if the key was alpha, we don't need to copy it either + if ( key === "alpha" || red[ key ] == null ) { + return; + } + inst[ cache ] = space.to( inst._rgba ); + } + + // this is the only case where we allow nulls for ALL properties. + // call clamp with alwaysAllowEmpty + inst[ cache ][ prop.idx ] = clamp( red[ key ], prop, true ); + }); + + // everything defined but alpha? + if ( inst[ cache ] && $.inArray( null, inst[ cache ].slice( 0, 3 ) ) < 0 ) { + // use the default of 1 + inst[ cache ][ 3 ] = 1; + if ( space.from ) { + inst._rgba = space.from( inst[ cache ] ); + } + } + }); + } + return this; + } + }, + is: function( compare ) { + var is = color( compare ), + same = true, + inst = this; + + each( spaces, function( _, space ) { + var localCache, + isCache = is[ space.cache ]; + if (isCache) { + localCache = inst[ space.cache ] || space.to && space.to( inst._rgba ) || []; + each( space.props, function( _, prop ) { + if ( isCache[ prop.idx ] != null ) { + same = ( isCache[ prop.idx ] === localCache[ prop.idx ] ); + return same; + } + }); + } + return same; + }); + return same; + }, + _space: function() { + var used = [], + inst = this; + each( spaces, function( spaceName, space ) { + if ( inst[ space.cache ] ) { + used.push( spaceName ); + } + }); + return used.pop(); + }, + transition: function( other, distance ) { + var end = color( other ), + spaceName = end._space(), + space = spaces[ spaceName ], + startColor = this.alpha() === 0 ? color( "transparent" ) : this, + start = startColor[ space.cache ] || space.to( startColor._rgba ), + result = start.slice(); + + end = end[ space.cache ]; + each( space.props, function( key, prop ) { + var index = prop.idx, + startValue = start[ index ], + endValue = end[ index ], + type = propTypes[ prop.type ] || {}; + + // if null, don't override start value + if ( endValue === null ) { + return; + } + // if null - use end + if ( startValue === null ) { + result[ index ] = endValue; + } else { + if ( type.mod ) { + if ( endValue - startValue > type.mod / 2 ) { + startValue += type.mod; + } else if ( startValue - endValue > type.mod / 2 ) { + startValue -= type.mod; + } + } + result[ index ] = clamp( ( endValue - startValue ) * distance + startValue, prop ); + } + }); + return this[ spaceName ]( result ); + }, + blend: function( opaque ) { + // if we are already opaque - return ourself + if ( this._rgba[ 3 ] === 1 ) { + return this; + } + + var rgb = this._rgba.slice(), + a = rgb.pop(), + blend = color( opaque )._rgba; + + return color( jQuery.map( rgb, function( v, i ) { + return ( 1 - a ) * blend[ i ] + a * v; + })); + }, + toRgbaString: function() { + var prefix = "rgba(", + rgba = jQuery.map( this._rgba, function( v, i ) { + return v == null ? ( i > 2 ? 1 : 0 ) : v; + }); + + if ( rgba[ 3 ] === 1 ) { + rgba.pop(); + prefix = "rgb("; + } + + return prefix + rgba.join() + ")"; + }, + toHslaString: function() { + var prefix = "hsla(", + hsla = jQuery.map( this.hsla(), function( v, i ) { + if ( v == null ) { + v = i > 2 ? 1 : 0; + } + + // catch 1 and 2 + if ( i && i < 3 ) { + v = Math.round( v * 100 ) + "%"; + } + return v; + }); + + if ( hsla[ 3 ] === 1 ) { + hsla.pop(); + prefix = "hsl("; + } + return prefix + hsla.join() + ")"; + }, + toHexString: function( includeAlpha ) { + var rgba = this._rgba.slice(), + alpha = rgba.pop(); + + if ( includeAlpha ) { + rgba.push( ~~( alpha * 255 ) ); + } + + return "#" + jQuery.map( rgba, function( v ) { + + // default to 0 when nulls exist + v = ( v || 0 ).toString( 16 ); + return v.length === 1 ? "0" + v : v; + }).join(""); + }, + toString: function() { + return this._rgba[ 3 ] === 0 ? "transparent" : this.toRgbaString(); + } +}); +color.fn.parse.prototype = color.fn; + +// hsla conversions adapted from: +// https://code.google.com/p/maashaack/source/browse/packages/graphics/trunk/src/graphics/colors/HUE2RGB.as?r=5021 + +function hue2rgb( p, q, h ) { + h = ( h + 1 ) % 1; + if ( h * 6 < 1 ) { + return p + (q - p) * h * 6; + } + if ( h * 2 < 1) { + return q; + } + if ( h * 3 < 2 ) { + return p + (q - p) * ((2/3) - h) * 6; + } + return p; +} + +spaces.hsla.to = function ( rgba ) { + if ( rgba[ 0 ] == null || rgba[ 1 ] == null || rgba[ 2 ] == null ) { + return [ null, null, null, rgba[ 3 ] ]; + } + var r = rgba[ 0 ] / 255, + g = rgba[ 1 ] / 255, + b = rgba[ 2 ] / 255, + a = rgba[ 3 ], + max = Math.max( r, g, b ), + min = Math.min( r, g, b ), + diff = max - min, + add = max + min, + l = add * 0.5, + h, s; + + if ( min === max ) { + h = 0; + } else if ( r === max ) { + h = ( 60 * ( g - b ) / diff ) + 360; + } else if ( g === max ) { + h = ( 60 * ( b - r ) / diff ) + 120; + } else { + h = ( 60 * ( r - g ) / diff ) + 240; + } + + if ( l === 0 || l === 1 ) { + s = l; + } else if ( l <= 0.5 ) { + s = diff / add; + } else { + s = diff / ( 2 - add ); + } + return [ Math.round(h) % 360, s, l, a == null ? 1 : a ]; +}; + +spaces.hsla.from = function ( hsla ) { + if ( hsla[ 0 ] == null || hsla[ 1 ] == null || hsla[ 2 ] == null ) { + return [ null, null, null, hsla[ 3 ] ]; + } + var h = hsla[ 0 ] / 360, + s = hsla[ 1 ], + l = hsla[ 2 ], + a = hsla[ 3 ], + q = l <= 0.5 ? l * ( 1 + s ) : l + s - l * s, + p = 2 * l - q; + + return [ + Math.round( hue2rgb( p, q, h + ( 1 / 3 ) ) * 255 ), + Math.round( hue2rgb( p, q, h ) * 255 ), + Math.round( hue2rgb( p, q, h - ( 1 / 3 ) ) * 255 ), + a + ]; +}; + + +each( spaces, function( spaceName, space ) { + var props = space.props, + cache = space.cache, + to = space.to, + from = space.from; + + // makes rgba() and hsla() + color.fn[ spaceName ] = function( value ) { + + // generate a cache for this space if it doesn't exist + if ( to && !this[ cache ] ) { + this[ cache ] = to( this._rgba ); + } + if ( value === undefined ) { + return this[ cache ].slice(); + } + + var ret, + type = jQuery.type( value ), + arr = ( type === "array" || type === "object" ) ? value : arguments, + local = this[ cache ].slice(); + + each( props, function( key, prop ) { + var val = arr[ type === "object" ? key : prop.idx ]; + if ( val == null ) { + val = local[ prop.idx ]; + } + local[ prop.idx ] = clamp( val, prop ); + }); + + if ( from ) { + ret = color( from( local ) ); + ret[ cache ] = local; + return ret; + } else { + return color( local ); + } + }; + + // makes red() green() blue() alpha() hue() saturation() lightness() + each( props, function( key, prop ) { + // alpha is included in more than one space + if ( color.fn[ key ] ) { + return; + } + color.fn[ key ] = function( value ) { + var vtype = jQuery.type( value ), + fn = ( key === "alpha" ? ( this._hsla ? "hsla" : "rgba" ) : spaceName ), + local = this[ fn ](), + cur = local[ prop.idx ], + match; + + if ( vtype === "undefined" ) { + return cur; + } + + if ( vtype === "function" ) { + value = value.call( this, cur ); + vtype = jQuery.type( value ); + } + if ( value == null && prop.empty ) { + return this; + } + if ( vtype === "string" ) { + match = rplusequals.exec( value ); + if ( match ) { + value = cur + parseFloat( match[ 2 ] ) * ( match[ 1 ] === "+" ? 1 : -1 ); + } + } + local[ prop.idx ] = value; + return this[ fn ]( local ); + }; + }); +}); + +// add .fx.step functions +each( stepHooks, function( i, hook ) { + jQuery.cssHooks[ hook ] = { + set: function( elem, value ) { + var parsed, curElem, + backgroundColor = ""; + + if ( jQuery.type( value ) !== "string" || ( parsed = stringParse( value ) ) ) { + value = color( parsed || value ); + if ( !support.rgba && value._rgba[ 3 ] !== 1 ) { + curElem = hook === "backgroundColor" ? elem.parentNode : elem; + while ( + (backgroundColor === "" || backgroundColor === "transparent") && + curElem && curElem.style + ) { + try { + backgroundColor = jQuery.css( curElem, "backgroundColor" ); + curElem = curElem.parentNode; + } catch ( e ) { + } + } + + value = value.blend( backgroundColor && backgroundColor !== "transparent" ? + backgroundColor : + "_default" ); + } + + value = value.toRgbaString(); + } + try { + elem.style[ hook ] = value; + } catch( error ) { + // wrapped to prevent IE from throwing errors on "invalid" values like 'auto' or 'inherit' + } + } + }; + jQuery.fx.step[ hook ] = function( fx ) { + if ( !fx.colorInit ) { + fx.start = color( fx.elem, hook ); + fx.end = color( fx.end ); + fx.colorInit = true; + } + jQuery.cssHooks[ hook ].set( fx.elem, fx.start.transition( fx.end, fx.pos ) ); + }; +}); + +jQuery.cssHooks.borderColor = { + expand: function( value ) { + var expanded = {}; + + each( [ "Top", "Right", "Bottom", "Left" ], function( i, part ) { + expanded[ "border" + part + "Color" ] = value; + }); + return expanded; + } +}; + +// Basic color names only. +// Usage of any of the other color names requires adding yourself or including +// jquery.color.svg-names.js. +colors = jQuery.Color.names = { + // 4.1. Basic color keywords + aqua: "#00ffff", + black: "#000000", + blue: "#0000ff", + fuchsia: "#ff00ff", + gray: "#808080", + green: "#008000", + lime: "#00ff00", + maroon: "#800000", + navy: "#000080", + olive: "#808000", + purple: "#800080", + red: "#ff0000", + silver: "#c0c0c0", + teal: "#008080", + white: "#ffffff", + yellow: "#ffff00", + + // 4.2.3. "transparent" color keyword + transparent: [ null, null, null, 0 ], + + _default: "#ffffff" +}; + +})( jQuery ); + + + +/******************************************************************************/ +/****************************** CLASS ANIMATIONS ******************************/ +/******************************************************************************/ +(function() { + +var classAnimationActions = [ "add", "remove", "toggle" ], + shorthandStyles = { + border: 1, + borderBottom: 1, + borderColor: 1, + borderLeft: 1, + borderRight: 1, + borderTop: 1, + borderWidth: 1, + margin: 1, + padding: 1 + }; + +$.each([ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle" ], function( _, prop ) { + $.fx.step[ prop ] = function( fx ) { + if ( fx.end !== "none" && !fx.setAttr || fx.pos === 1 && !fx.setAttr ) { + jQuery.style( fx.elem, prop, fx.end ); + fx.setAttr = true; + } + }; +}); + +function getElementStyles() { + var style = this.ownerDocument.defaultView ? + this.ownerDocument.defaultView.getComputedStyle( this, null ) : + this.currentStyle, + newStyle = {}, + key, + len; + + // webkit enumerates style porperties + if ( style && style.length && style[ 0 ] && style[ style[ 0 ] ] ) { + len = style.length; + while ( len-- ) { + key = style[ len ]; + if ( typeof style[ key ] === "string" ) { + newStyle[ $.camelCase( key ) ] = style[ key ]; + } + } + } else { + for ( key in style ) { + if ( typeof style[ key ] === "string" ) { + newStyle[ key ] = style[ key ]; + } + } + } + + return newStyle; +} + + +function styleDifference( oldStyle, newStyle ) { + var diff = {}, + name, value; + + for ( name in newStyle ) { + value = newStyle[ name ]; + if ( oldStyle[ name ] !== value ) { + if ( !shorthandStyles[ name ] ) { + if ( $.fx.step[ name ] || !isNaN( parseFloat( value ) ) ) { + diff[ name ] = value; + } + } + } + } + + return diff; +} + +$.effects.animateClass = function( value, duration, easing, callback ) { + var o = $.speed( duration, easing, callback ); + + return this.queue( function() { + var animated = $( this ), + baseClass = animated.attr( "class" ) || "", + applyClassChange, + allAnimations = o.children ? animated.find( "*" ).andSelf() : animated; + + // map the animated objects to store the original styles. + allAnimations = allAnimations.map(function() { + var el = $( this ); + return { + el: el, + start: getElementStyles.call( this ) + }; + }); + + // apply class change + applyClassChange = function() { + $.each( classAnimationActions, function(i, action) { + if ( value[ action ] ) { + animated[ action + "Class" ]( value[ action ] ); + } + }); + }; + applyClassChange(); + + // map all animated objects again - calculate new styles and diff + allAnimations = allAnimations.map(function() { + this.end = getElementStyles.call( this.el[ 0 ] ); + this.diff = styleDifference( this.start, this.end ); + return this; + }); + + // apply original class + animated.attr( "class", baseClass ); + + // map all animated objects again - this time collecting a promise + allAnimations = allAnimations.map(function() { + var styleInfo = this, + dfd = $.Deferred(), + opts = jQuery.extend({}, o, { + queue: false, + complete: function() { + dfd.resolve( styleInfo ); + } + }); + + this.el.animate( this.diff, opts ); + return dfd.promise(); + }); + + // once all animations have completed: + $.when.apply( $, allAnimations.get() ).done(function() { + + // set the final class + applyClassChange(); + + // for each animated element, + // clear all css properties that were animated + $.each( arguments, function() { + var el = this.el; + $.each( this.diff, function(key) { + el.css( key, '' ); + }); + }); + + // this is guarnteed to be there if you use jQuery.speed() + // it also handles dequeuing the next anim... + o.complete.call( animated[ 0 ] ); + }); + }); +}; + +$.fn.extend({ + _addClass: $.fn.addClass, + addClass: function( classNames, speed, easing, callback ) { + return speed ? + $.effects.animateClass.call( this, + { add: classNames }, speed, easing, callback ) : + this._addClass( classNames ); + }, + + _removeClass: $.fn.removeClass, + removeClass: function( classNames, speed, easing, callback ) { + return speed ? + $.effects.animateClass.call( this, + { remove: classNames }, speed, easing, callback ) : + this._removeClass( classNames ); + }, + + _toggleClass: $.fn.toggleClass, + toggleClass: function( classNames, force, speed, easing, callback ) { + if ( typeof force === "boolean" || force === undefined ) { + if ( !speed ) { + // without speed parameter + return this._toggleClass( classNames, force ); + } else { + return $.effects.animateClass.call( this, + (force ? { add: classNames } : { remove: classNames }), + speed, easing, callback ); + } + } else { + // without force parameter + return $.effects.animateClass.call( this, + { toggle: classNames }, force, speed, easing ); + } + }, + + switchClass: function( remove, add, speed, easing, callback) { + return $.effects.animateClass.call( this, { + add: add, + remove: remove + }, speed, easing, callback ); + } +}); + +})(); + +/******************************************************************************/ +/*********************************** EFFECTS **********************************/ +/******************************************************************************/ + +(function() { + +$.extend( $.effects, { + version: "1.9.1", + + // Saves a set of properties in a data storage + save: function( element, set ) { + for( var i=0; i < set.length; i++ ) { + if ( set[ i ] !== null ) { + element.data( dataSpace + set[ i ], element[ 0 ].style[ set[ i ] ] ); + } + } + }, + + // Restores a set of previously saved properties from a data storage + restore: function( element, set ) { + var val, i; + for( i=0; i < set.length; i++ ) { + if ( set[ i ] !== null ) { + val = element.data( dataSpace + set[ i ] ); + // support: jQuery 1.6.2 + // http://bugs.jquery.com/ticket/9917 + // jQuery 1.6.2 incorrectly returns undefined for any falsy value. + // We can't differentiate between "" and 0 here, so we just assume + // empty string since it's likely to be a more common value... + if ( val === undefined ) { + val = ""; + } + element.css( set[ i ], val ); + } + } + }, + + setMode: function( el, mode ) { + if (mode === "toggle") { + mode = el.is( ":hidden" ) ? "show" : "hide"; + } + return mode; + }, + + // Translates a [top,left] array into a baseline value + // this should be a little more flexible in the future to handle a string & hash + getBaseline: function( origin, original ) { + var y, x; + switch ( origin[ 0 ] ) { + case "top": y = 0; break; + case "middle": y = 0.5; break; + case "bottom": y = 1; break; + default: y = origin[ 0 ] / original.height; + } + switch ( origin[ 1 ] ) { + case "left": x = 0; break; + case "center": x = 0.5; break; + case "right": x = 1; break; + default: x = origin[ 1 ] / original.width; + } + return { + x: x, + y: y + }; + }, + + // Wraps the element around a wrapper that copies position properties + createWrapper: function( element ) { + + // if the element is already wrapped, return it + if ( element.parent().is( ".ui-effects-wrapper" )) { + return element.parent(); + } + + // wrap the element + var props = { + width: element.outerWidth(true), + height: element.outerHeight(true), + "float": element.css( "float" ) + }, + wrapper = $( "<div></div>" ) + .addClass( "ui-effects-wrapper" ) + .css({ + fontSize: "100%", + background: "transparent", + border: "none", + margin: 0, + padding: 0 + }), + // Store the size in case width/height are defined in % - Fixes #5245 + size = { + width: element.width(), + height: element.height() + }, + active = document.activeElement; + + // support: Firefox + // Firefox incorrectly exposes anonymous content + // https://bugzilla.mozilla.org/show_bug.cgi?id=561664 + try { + active.id; + } catch( e ) { + active = document.body; + } + + element.wrap( wrapper ); + + // Fixes #7595 - Elements lose focus when wrapped. + if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) { + $( active ).focus(); + } + + wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually lose the reference to the wrapped element + + // transfer positioning properties to the wrapper + if ( element.css( "position" ) === "static" ) { + wrapper.css({ position: "relative" }); + element.css({ position: "relative" }); + } else { + $.extend( props, { + position: element.css( "position" ), + zIndex: element.css( "z-index" ) + }); + $.each([ "top", "left", "bottom", "right" ], function(i, pos) { + props[ pos ] = element.css( pos ); + if ( isNaN( parseInt( props[ pos ], 10 ) ) ) { + props[ pos ] = "auto"; + } + }); + element.css({ + position: "relative", + top: 0, + left: 0, + right: "auto", + bottom: "auto" + }); + } + element.css(size); + + return wrapper.css( props ).show(); + }, + + removeWrapper: function( element ) { + var active = document.activeElement; + + if ( element.parent().is( ".ui-effects-wrapper" ) ) { + element.parent().replaceWith( element ); + + // Fixes #7595 - Elements lose focus when wrapped. + if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) { + $( active ).focus(); + } + } + + + return element; + }, + + setTransition: function( element, list, factor, value ) { + value = value || {}; + $.each( list, function( i, x ) { + var unit = element.cssUnit( x ); + if ( unit[ 0 ] > 0 ) { + value[ x ] = unit[ 0 ] * factor + unit[ 1 ]; + } + }); + return value; + } +}); + +// return an effect options object for the given parameters: +function _normalizeArguments( effect, options, speed, callback ) { + + // allow passing all options as the first parameter + if ( $.isPlainObject( effect ) ) { + options = effect; + effect = effect.effect; + } + + // convert to an object + effect = { effect: effect }; + + // catch (effect, null, ...) + if ( options == null ) { + options = {}; + } + + // catch (effect, callback) + if ( $.isFunction( options ) ) { + callback = options; + speed = null; + options = {}; + } + + // catch (effect, speed, ?) + if ( typeof options === "number" || $.fx.speeds[ options ] ) { + callback = speed; + speed = options; + options = {}; + } + + // catch (effect, options, callback) + if ( $.isFunction( speed ) ) { + callback = speed; + speed = null; + } + + // add options to effect + if ( options ) { + $.extend( effect, options ); + } + + speed = speed || options.duration; + effect.duration = $.fx.off ? 0 : + typeof speed === "number" ? speed : + speed in $.fx.speeds ? $.fx.speeds[ speed ] : + $.fx.speeds._default; + + effect.complete = callback || options.complete; + + return effect; +} + +function standardSpeed( speed ) { + // valid standard speeds + if ( !speed || typeof speed === "number" || $.fx.speeds[ speed ] ) { + return true; + } + + // invalid strings - treat as "normal" speed + if ( typeof speed === "string" && !$.effects.effect[ speed ] ) { + // TODO: remove in 2.0 (#7115) + if ( backCompat && $.effects[ speed ] ) { + return false; + } + return true; + } + + return false; +} + +$.fn.extend({ + effect: function( /* effect, options, speed, callback */ ) { + var args = _normalizeArguments.apply( this, arguments ), + mode = args.mode, + queue = args.queue, + effectMethod = $.effects.effect[ args.effect ], + + // DEPRECATED: remove in 2.0 (#7115) + oldEffectMethod = !effectMethod && backCompat && $.effects[ args.effect ]; + + if ( $.fx.off || !( effectMethod || oldEffectMethod ) ) { + // delegate to the original method (e.g., .show()) if possible + if ( mode ) { + return this[ mode ]( args.duration, args.complete ); + } else { + return this.each( function() { + if ( args.complete ) { + args.complete.call( this ); + } + }); + } + } + + function run( next ) { + var elem = $( this ), + complete = args.complete, + mode = args.mode; + + function done() { + if ( $.isFunction( complete ) ) { + complete.call( elem[0] ); + } + if ( $.isFunction( next ) ) { + next(); + } + } + + // if the element is hiddden and mode is hide, + // or element is visible and mode is show + if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) { + done(); + } else { + effectMethod.call( elem[0], args, done ); + } + } + + // TODO: remove this check in 2.0, effectMethod will always be true + if ( effectMethod ) { + return queue === false ? this.each( run ) : this.queue( queue || "fx", run ); + } else { + // DEPRECATED: remove in 2.0 (#7115) + return oldEffectMethod.call(this, { + options: args, + duration: args.duration, + callback: args.complete, + mode: args.mode + }); + } + }, + + _show: $.fn.show, + show: function( speed ) { + if ( standardSpeed( speed ) ) { + return this._show.apply( this, arguments ); + } else { + var args = _normalizeArguments.apply( this, arguments ); + args.mode = "show"; + return this.effect.call( this, args ); + } + }, + + _hide: $.fn.hide, + hide: function( speed ) { + if ( standardSpeed( speed ) ) { + return this._hide.apply( this, arguments ); + } else { + var args = _normalizeArguments.apply( this, arguments ); + args.mode = "hide"; + return this.effect.call( this, args ); + } + }, + + // jQuery core overloads toggle and creates _toggle + __toggle: $.fn.toggle, + toggle: function( speed ) { + if ( standardSpeed( speed ) || typeof speed === "boolean" || $.isFunction( speed ) ) { + return this.__toggle.apply( this, arguments ); + } else { + var args = _normalizeArguments.apply( this, arguments ); + args.mode = "toggle"; + return this.effect.call( this, args ); + } + }, + + // helper functions + cssUnit: function(key) { + var style = this.css( key ), + val = []; + + $.each( [ "em", "px", "%", "pt" ], function( i, unit ) { + if ( style.indexOf( unit ) > 0 ) { + val = [ parseFloat( style ), unit ]; + } + }); + return val; + } +}); + +})(); + +/******************************************************************************/ +/*********************************** EASING ***********************************/ +/******************************************************************************/ + +(function() { + +// based on easing equations from Robert Penner (http://www.robertpenner.com/easing) + +var baseEasings = {}; + +$.each( [ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function( i, name ) { + baseEasings[ name ] = function( p ) { + return Math.pow( p, i + 2 ); + }; +}); + +$.extend( baseEasings, { + Sine: function ( p ) { + return 1 - Math.cos( p * Math.PI / 2 ); + }, + Circ: function ( p ) { + return 1 - Math.sqrt( 1 - p * p ); + }, + Elastic: function( p ) { + return p === 0 || p === 1 ? p : + -Math.pow( 2, 8 * (p - 1) ) * Math.sin( ( (p - 1) * 80 - 7.5 ) * Math.PI / 15 ); + }, + Back: function( p ) { + return p * p * ( 3 * p - 2 ); + }, + Bounce: function ( p ) { + var pow2, + bounce = 4; + + while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) {} + return 1 / Math.pow( 4, 3 - bounce ) - 7.5625 * Math.pow( ( pow2 * 3 - 2 ) / 22 - p, 2 ); + } +}); + +$.each( baseEasings, function( name, easeIn ) { + $.easing[ "easeIn" + name ] = easeIn; + $.easing[ "easeOut" + name ] = function( p ) { + return 1 - easeIn( 1 - p ); + }; + $.easing[ "easeInOut" + name ] = function( p ) { + return p < 0.5 ? + easeIn( p * 2 ) / 2 : + 1 - easeIn( p * -2 + 2 ) / 2; + }; +}); + +})(); + +})(jQuery)); +(function( $, undefined ) { + +var rvertical = /up|down|vertical/, + rpositivemotion = /up|left|vertical|horizontal/; + +$.effects.effect.blind = function( o, done ) { + // Create element + var el = $( this ), + props = [ "position", "top", "bottom", "left", "right", "height", "width" ], + mode = $.effects.setMode( el, o.mode || "hide" ), + direction = o.direction || "up", + vertical = rvertical.test( direction ), + ref = vertical ? "height" : "width", + ref2 = vertical ? "top" : "left", + motion = rpositivemotion.test( direction ), + animation = {}, + show = mode === "show", + wrapper, distance, margin; + + // if already wrapped, the wrapper's properties are my property. #6245 + if ( el.parent().is( ".ui-effects-wrapper" ) ) { + $.effects.save( el.parent(), props ); + } else { + $.effects.save( el, props ); + } + el.show(); + wrapper = $.effects.createWrapper( el ).css({ + overflow: "hidden" + }); + + distance = wrapper[ ref ](); + margin = parseFloat( wrapper.css( ref2 ) ) || 0; + + animation[ ref ] = show ? distance : 0; + if ( !motion ) { + el + .css( vertical ? "bottom" : "right", 0 ) + .css( vertical ? "top" : "left", "auto" ) + .css({ position: "absolute" }); + + animation[ ref2 ] = show ? margin : distance + margin; + } + + // start at 0 if we are showing + if ( show ) { + wrapper.css( ref, 0 ); + if ( ! motion ) { + wrapper.css( ref2, margin + distance ); + } + } + + // Animate + wrapper.animate( animation, { + duration: o.duration, + easing: o.easing, + queue: false, + complete: function() { + if ( mode === "hide" ) { + el.hide(); + } + $.effects.restore( el, props ); + $.effects.removeWrapper( el ); + done(); + } + }); + +}; + +})(jQuery); +(function( $, undefined ) { + +$.effects.effect.bounce = function( o, done ) { + var el = $( this ), + props = [ "position", "top", "bottom", "left", "right", "height", "width" ], + + // defaults: + mode = $.effects.setMode( el, o.mode || "effect" ), + hide = mode === "hide", + show = mode === "show", + direction = o.direction || "up", + distance = o.distance, + times = o.times || 5, + + // number of internal animations + anims = times * 2 + ( show || hide ? 1 : 0 ), + speed = o.duration / anims, + easing = o.easing, + + // utility: + ref = ( direction === "up" || direction === "down" ) ? "top" : "left", + motion = ( direction === "up" || direction === "left" ), + i, + upAnim, + downAnim, + + // we will need to re-assemble the queue to stack our animations in place + queue = el.queue(), + queuelen = queue.length; + + // Avoid touching opacity to prevent clearType and PNG issues in IE + if ( show || hide ) { + props.push( "opacity" ); + } + + $.effects.save( el, props ); + el.show(); + $.effects.createWrapper( el ); // Create Wrapper + + // default distance for the BIGGEST bounce is the outer Distance / 3 + if ( !distance ) { + distance = el[ ref === "top" ? "outerHeight" : "outerWidth" ]() / 3; + } + + if ( show ) { + downAnim = { opacity: 1 }; + downAnim[ ref ] = 0; + + // if we are showing, force opacity 0 and set the initial position + // then do the "first" animation + el.css( "opacity", 0 ) + .css( ref, motion ? -distance * 2 : distance * 2 ) + .animate( downAnim, speed, easing ); + } + + // start at the smallest distance if we are hiding + if ( hide ) { + distance = distance / Math.pow( 2, times - 1 ); + } + + downAnim = {}; + downAnim[ ref ] = 0; + // Bounces up/down/left/right then back to 0 -- times * 2 animations happen here + for ( i = 0; i < times; i++ ) { + upAnim = {}; + upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance; + + el.animate( upAnim, speed, easing ) + .animate( downAnim, speed, easing ); + + distance = hide ? distance * 2 : distance / 2; + } + + // Last Bounce when Hiding + if ( hide ) { + upAnim = { opacity: 0 }; + upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance; + + el.animate( upAnim, speed, easing ); + } + + el.queue(function() { + if ( hide ) { + el.hide(); + } + $.effects.restore( el, props ); + $.effects.removeWrapper( el ); + done(); + }); + + // inject all the animations we just queued to be first in line (after "inprogress") + if ( queuelen > 1) { + queue.splice.apply( queue, + [ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) ); + } + el.dequeue(); + +}; + +})(jQuery); +(function( $, undefined ) { + +$.effects.effect.clip = function( o, done ) { + // Create element + var el = $( this ), + props = [ "position", "top", "bottom", "left", "right", "height", "width" ], + mode = $.effects.setMode( el, o.mode || "hide" ), + show = mode === "show", + direction = o.direction || "vertical", + vert = direction === "vertical", + size = vert ? "height" : "width", + position = vert ? "top" : "left", + animation = {}, + wrapper, animate, distance; + + // Save & Show + $.effects.save( el, props ); + el.show(); + + // Create Wrapper + wrapper = $.effects.createWrapper( el ).css({ + overflow: "hidden" + }); + animate = ( el[0].tagName === "IMG" ) ? wrapper : el; + distance = animate[ size ](); + + // Shift + if ( show ) { + animate.css( size, 0 ); + animate.css( position, distance / 2 ); + } + + // Create Animation Object: + animation[ size ] = show ? distance : 0; + animation[ position ] = show ? 0 : distance / 2; + + // Animate + animate.animate( animation, { + queue: false, + duration: o.duration, + easing: o.easing, + complete: function() { + if ( !show ) { + el.hide(); + } + $.effects.restore( el, props ); + $.effects.removeWrapper( el ); + done(); + } + }); + +}; + +})(jQuery); +(function( $, undefined ) { + +$.effects.effect.drop = function( o, done ) { + + var el = $( this ), + props = [ "position", "top", "bottom", "left", "right", "opacity", "height", "width" ], + mode = $.effects.setMode( el, o.mode || "hide" ), + show = mode === "show", + direction = o.direction || "left", + ref = ( direction === "up" || direction === "down" ) ? "top" : "left", + motion = ( direction === "up" || direction === "left" ) ? "pos" : "neg", + animation = { + opacity: show ? 1 : 0 + }, + distance; + + // Adjust + $.effects.save( el, props ); + el.show(); + $.effects.createWrapper( el ); + + distance = o.distance || el[ ref === "top" ? "outerHeight": "outerWidth" ]( true ) / 2; + + if ( show ) { + el + .css( "opacity", 0 ) + .css( ref, motion === "pos" ? -distance : distance ); + } + + // Animation + animation[ ref ] = ( show ? + ( motion === "pos" ? "+=" : "-=" ) : + ( motion === "pos" ? "-=" : "+=" ) ) + + distance; + + // Animate + el.animate( animation, { + queue: false, + duration: o.duration, + easing: o.easing, + complete: function() { + if ( mode === "hide" ) { + el.hide(); + } + $.effects.restore( el, props ); + $.effects.removeWrapper( el ); + done(); + } + }); +}; + +})(jQuery); +(function( $, undefined ) { + +$.effects.effect.explode = function( o, done ) { + + var rows = o.pieces ? Math.round( Math.sqrt( o.pieces ) ) : 3, + cells = rows, + el = $( this ), + mode = $.effects.setMode( el, o.mode || "hide" ), + show = mode === "show", + + // show and then visibility:hidden the element before calculating offset + offset = el.show().css( "visibility", "hidden" ).offset(), + + // width and height of a piece + width = Math.ceil( el.outerWidth() / cells ), + height = Math.ceil( el.outerHeight() / rows ), + pieces = [], + + // loop + i, j, left, top, mx, my; + + // children animate complete: + function childComplete() { + pieces.push( this ); + if ( pieces.length === rows * cells ) { + animComplete(); + } + } + + // clone the element for each row and cell. + for( i = 0; i < rows ; i++ ) { // ===> + top = offset.top + i * height; + my = i - ( rows - 1 ) / 2 ; + + for( j = 0; j < cells ; j++ ) { // ||| + left = offset.left + j * width; + mx = j - ( cells - 1 ) / 2 ; + + // Create a clone of the now hidden main element that will be absolute positioned + // within a wrapper div off the -left and -top equal to size of our pieces + el + .clone() + .appendTo( "body" ) + .wrap( "<div></div>" ) + .css({ + position: "absolute", + visibility: "visible", + left: -j * width, + top: -i * height + }) + + // select the wrapper - make it overflow: hidden and absolute positioned based on + // where the original was located +left and +top equal to the size of pieces + .parent() + .addClass( "ui-effects-explode" ) + .css({ + position: "absolute", + overflow: "hidden", + width: width, + height: height, + left: left + ( show ? mx * width : 0 ), + top: top + ( show ? my * height : 0 ), + opacity: show ? 0 : 1 + }).animate({ + left: left + ( show ? 0 : mx * width ), + top: top + ( show ? 0 : my * height ), + opacity: show ? 1 : 0 + }, o.duration || 500, o.easing, childComplete ); + } + } + + function animComplete() { + el.css({ + visibility: "visible" + }); + $( pieces ).remove(); + if ( !show ) { + el.hide(); + } + done(); + } +}; + +})(jQuery); +(function( $, undefined ) { + +$.effects.effect.fade = function( o, done ) { + var el = $( this ), + mode = $.effects.setMode( el, o.mode || "toggle" ); + + el.animate({ + opacity: mode + }, { + queue: false, + duration: o.duration, + easing: o.easing, + complete: done + }); +}; + +})( jQuery ); +(function( $, undefined ) { + +$.effects.effect.fold = function( o, done ) { + + // Create element + var el = $( this ), + props = [ "position", "top", "bottom", "left", "right", "height", "width" ], + mode = $.effects.setMode( el, o.mode || "hide" ), + show = mode === "show", + hide = mode === "hide", + size = o.size || 15, + percent = /([0-9]+)%/.exec( size ), + horizFirst = !!o.horizFirst, + widthFirst = show !== horizFirst, + ref = widthFirst ? [ "width", "height" ] : [ "height", "width" ], + duration = o.duration / 2, + wrapper, distance, + animation1 = {}, + animation2 = {}; + + $.effects.save( el, props ); + el.show(); + + // Create Wrapper + wrapper = $.effects.createWrapper( el ).css({ + overflow: "hidden" + }); + distance = widthFirst ? + [ wrapper.width(), wrapper.height() ] : + [ wrapper.height(), wrapper.width() ]; + + if ( percent ) { + size = parseInt( percent[ 1 ], 10 ) / 100 * distance[ hide ? 0 : 1 ]; + } + if ( show ) { + wrapper.css( horizFirst ? { + height: 0, + width: size + } : { + height: size, + width: 0 + }); + } + + // Animation + animation1[ ref[ 0 ] ] = show ? distance[ 0 ] : size; + animation2[ ref[ 1 ] ] = show ? distance[ 1 ] : 0; + + // Animate + wrapper + .animate( animation1, duration, o.easing ) + .animate( animation2, duration, o.easing, function() { + if ( hide ) { + el.hide(); + } + $.effects.restore( el, props ); + $.effects.removeWrapper( el ); + done(); + }); + +}; + +})(jQuery); +(function( $, undefined ) { + +$.effects.effect.highlight = function( o, done ) { + var elem = $( this ), + props = [ "backgroundImage", "backgroundColor", "opacity" ], + mode = $.effects.setMode( elem, o.mode || "show" ), + animation = { + backgroundColor: elem.css( "backgroundColor" ) + }; + + if (mode === "hide") { + animation.opacity = 0; + } + + $.effects.save( elem, props ); + + elem + .show() + .css({ + backgroundImage: "none", + backgroundColor: o.color || "#ffff99" + }) + .animate( animation, { + queue: false, + duration: o.duration, + easing: o.easing, + complete: function() { + if ( mode === "hide" ) { + elem.hide(); + } + $.effects.restore( elem, props ); + done(); + } + }); +}; + +})(jQuery); +(function( $, undefined ) { + +$.effects.effect.pulsate = function( o, done ) { + var elem = $( this ), + mode = $.effects.setMode( elem, o.mode || "show" ), + show = mode === "show", + hide = mode === "hide", + showhide = ( show || mode === "hide" ), + + // showing or hiding leaves of the "last" animation + anims = ( ( o.times || 5 ) * 2 ) + ( showhide ? 1 : 0 ), + duration = o.duration / anims, + animateTo = 0, + queue = elem.queue(), + queuelen = queue.length, + i; + + if ( show || !elem.is(":visible")) { + elem.css( "opacity", 0 ).show(); + animateTo = 1; + } + + // anims - 1 opacity "toggles" + for ( i = 1; i < anims; i++ ) { + elem.animate({ + opacity: animateTo + }, duration, o.easing ); + animateTo = 1 - animateTo; + } + + elem.animate({ + opacity: animateTo + }, duration, o.easing); + + elem.queue(function() { + if ( hide ) { + elem.hide(); + } + done(); + }); + + // We just queued up "anims" animations, we need to put them next in the queue + if ( queuelen > 1 ) { + queue.splice.apply( queue, + [ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) ); + } + elem.dequeue(); +}; + +})(jQuery); +(function( $, undefined ) { + +$.effects.effect.puff = function( o, done ) { + var elem = $( this ), + mode = $.effects.setMode( elem, o.mode || "hide" ), + hide = mode === "hide", + percent = parseInt( o.percent, 10 ) || 150, + factor = percent / 100, + original = { + height: elem.height(), + width: elem.width() + }; + + $.extend( o, { + effect: "scale", + queue: false, + fade: true, + mode: mode, + complete: done, + percent: hide ? percent : 100, + from: hide ? + original : + { + height: original.height * factor, + width: original.width * factor + } + }); + + elem.effect( o ); +}; + +$.effects.effect.scale = function( o, done ) { + + // Create element + var el = $( this ), + options = $.extend( true, {}, o ), + mode = $.effects.setMode( el, o.mode || "effect" ), + percent = parseInt( o.percent, 10 ) || + ( parseInt( o.percent, 10 ) === 0 ? 0 : ( mode === "hide" ? 0 : 100 ) ), + direction = o.direction || "both", + origin = o.origin, + original = { + height: el.height(), + width: el.width(), + outerHeight: el.outerHeight(), + outerWidth: el.outerWidth() + }, + factor = { + y: direction !== "horizontal" ? (percent / 100) : 1, + x: direction !== "vertical" ? (percent / 100) : 1 + }; + + // We are going to pass this effect to the size effect: + options.effect = "size"; + options.queue = false; + options.complete = done; + + // Set default origin and restore for show/hide + if ( mode !== "effect" ) { + options.origin = origin || ["middle","center"]; + options.restore = true; + } + + options.from = o.from || ( mode === "show" ? { height: 0, width: 0 } : original ); + options.to = { + height: original.height * factor.y, + width: original.width * factor.x, + outerHeight: original.outerHeight * factor.y, + outerWidth: original.outerWidth * factor.x + }; + + // Fade option to support puff + if ( options.fade ) { + if ( mode === "show" ) { + options.from.opacity = 0; + options.to.opacity = 1; + } + if ( mode === "hide" ) { + options.from.opacity = 1; + options.to.opacity = 0; + } + } + + // Animate + el.effect( options ); + +}; + +$.effects.effect.size = function( o, done ) { + + // Create element + var original, baseline, factor, + el = $( this ), + props0 = [ "position", "top", "bottom", "left", "right", "width", "height", "overflow", "opacity" ], + + // Always restore + props1 = [ "position", "top", "bottom", "left", "right", "overflow", "opacity" ], + + // Copy for children + props2 = [ "width", "height", "overflow" ], + cProps = [ "fontSize" ], + vProps = [ "borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom" ], + hProps = [ "borderLeftWidth", "borderRightWidth", "paddingLeft", "paddingRight" ], + + // Set options + mode = $.effects.setMode( el, o.mode || "effect" ), + restore = o.restore || mode !== "effect", + scale = o.scale || "both", + origin = o.origin || [ "middle", "center" ], + position = el.css( "position" ), + props = restore ? props0 : props1, + zero = { + height: 0, + width: 0 + }; + + if ( mode === "show" ) { + el.show(); + } + original = { + height: el.height(), + width: el.width(), + outerHeight: el.outerHeight(), + outerWidth: el.outerWidth() + }; + + if ( o.mode === "toggle" && mode === "show" ) { + el.from = o.to || zero; + el.to = o.from || original; + } else { + el.from = o.from || ( mode === "show" ? zero : original ); + el.to = o.to || ( mode === "hide" ? zero : original ); + } + + // Set scaling factor + factor = { + from: { + y: el.from.height / original.height, + x: el.from.width / original.width + }, + to: { + y: el.to.height / original.height, + x: el.to.width / original.width + } + }; + + // Scale the css box + if ( scale === "box" || scale === "both" ) { + + // Vertical props scaling + if ( factor.from.y !== factor.to.y ) { + props = props.concat( vProps ); + el.from = $.effects.setTransition( el, vProps, factor.from.y, el.from ); + el.to = $.effects.setTransition( el, vProps, factor.to.y, el.to ); + } + + // Horizontal props scaling + if ( factor.from.x !== factor.to.x ) { + props = props.concat( hProps ); + el.from = $.effects.setTransition( el, hProps, factor.from.x, el.from ); + el.to = $.effects.setTransition( el, hProps, factor.to.x, el.to ); + } + } + + // Scale the content + if ( scale === "content" || scale === "both" ) { + + // Vertical props scaling + if ( factor.from.y !== factor.to.y ) { + props = props.concat( cProps ).concat( props2 ); + el.from = $.effects.setTransition( el, cProps, factor.from.y, el.from ); + el.to = $.effects.setTransition( el, cProps, factor.to.y, el.to ); + } + } + + $.effects.save( el, props ); + el.show(); + $.effects.createWrapper( el ); + el.css( "overflow", "hidden" ).css( el.from ); + + // Adjust + if (origin) { // Calculate baseline shifts + baseline = $.effects.getBaseline( origin, original ); + el.from.top = ( original.outerHeight - el.outerHeight() ) * baseline.y; + el.from.left = ( original.outerWidth - el.outerWidth() ) * baseline.x; + el.to.top = ( original.outerHeight - el.to.outerHeight ) * baseline.y; + el.to.left = ( original.outerWidth - el.to.outerWidth ) * baseline.x; + } + el.css( el.from ); // set top & left + + // Animate + if ( scale === "content" || scale === "both" ) { // Scale the children + + // Add margins/font-size + vProps = vProps.concat([ "marginTop", "marginBottom" ]).concat(cProps); + hProps = hProps.concat([ "marginLeft", "marginRight" ]); + props2 = props0.concat(vProps).concat(hProps); + + el.find( "*[width]" ).each( function(){ + var child = $( this ), + c_original = { + height: child.height(), + width: child.width() + }; + if (restore) { + $.effects.save(child, props2); + } + + child.from = { + height: c_original.height * factor.from.y, + width: c_original.width * factor.from.x + }; + child.to = { + height: c_original.height * factor.to.y, + width: c_original.width * factor.to.x + }; + + // Vertical props scaling + if ( factor.from.y !== factor.to.y ) { + child.from = $.effects.setTransition( child, vProps, factor.from.y, child.from ); + child.to = $.effects.setTransition( child, vProps, factor.to.y, child.to ); + } + + // Horizontal props scaling + if ( factor.from.x !== factor.to.x ) { + child.from = $.effects.setTransition( child, hProps, factor.from.x, child.from ); + child.to = $.effects.setTransition( child, hProps, factor.to.x, child.to ); + } + + // Animate children + child.css( child.from ); + child.animate( child.to, o.duration, o.easing, function() { + + // Restore children + if ( restore ) { + $.effects.restore( child, props2 ); + } + }); + }); + } + + // Animate + el.animate( el.to, { + queue: false, + duration: o.duration, + easing: o.easing, + complete: function() { + if ( el.to.opacity === 0 ) { + el.css( "opacity", el.from.opacity ); + } + if( mode === "hide" ) { + el.hide(); + } + $.effects.restore( el, props ); + if ( !restore ) { + + // we need to calculate our new positioning based on the scaling + if ( position === "static" ) { + el.css({ + position: "relative", + top: el.to.top, + left: el.to.left + }); + } else { + $.each([ "top", "left" ], function( idx, pos ) { + el.css( pos, function( _, str ) { + var val = parseInt( str, 10 ), + toRef = idx ? el.to.left : el.to.top; + + // if original was "auto", recalculate the new value from wrapper + if ( str === "auto" ) { + return toRef + "px"; + } + + return val + toRef + "px"; + }); + }); + } + } + + $.effects.removeWrapper( el ); + done(); + } + }); + +}; + +})(jQuery); +(function( $, undefined ) { + +$.effects.effect.shake = function( o, done ) { + + var el = $( this ), + props = [ "position", "top", "bottom", "left", "right", "height", "width" ], + mode = $.effects.setMode( el, o.mode || "effect" ), + direction = o.direction || "left", + distance = o.distance || 20, + times = o.times || 3, + anims = times * 2 + 1, + speed = Math.round(o.duration/anims), + ref = (direction === "up" || direction === "down") ? "top" : "left", + positiveMotion = (direction === "up" || direction === "left"), + animation = {}, + animation1 = {}, + animation2 = {}, + i, + + // we will need to re-assemble the queue to stack our animations in place + queue = el.queue(), + queuelen = queue.length; + + $.effects.save( el, props ); + el.show(); + $.effects.createWrapper( el ); + + // Animation + animation[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance; + animation1[ ref ] = ( positiveMotion ? "+=" : "-=" ) + distance * 2; + animation2[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance * 2; + + // Animate + el.animate( animation, speed, o.easing ); + + // Shakes + for ( i = 1; i < times; i++ ) { + el.animate( animation1, speed, o.easing ).animate( animation2, speed, o.easing ); + } + el + .animate( animation1, speed, o.easing ) + .animate( animation, speed / 2, o.easing ) + .queue(function() { + if ( mode === "hide" ) { + el.hide(); + } + $.effects.restore( el, props ); + $.effects.removeWrapper( el ); + done(); + }); + + // inject all the animations we just queued to be first in line (after "inprogress") + if ( queuelen > 1) { + queue.splice.apply( queue, + [ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) ); + } + el.dequeue(); + +}; + +})(jQuery); +(function( $, undefined ) { + +$.effects.effect.slide = function( o, done ) { + + // Create element + var el = $( this ), + props = [ "position", "top", "bottom", "left", "right", "width", "height" ], + mode = $.effects.setMode( el, o.mode || "show" ), + show = mode === "show", + direction = o.direction || "left", + ref = (direction === "up" || direction === "down") ? "top" : "left", + positiveMotion = (direction === "up" || direction === "left"), + distance, + animation = {}; + + // Adjust + $.effects.save( el, props ); + el.show(); + distance = o.distance || el[ ref === "top" ? "outerHeight" : "outerWidth" ]( true ); + + $.effects.createWrapper( el ).css({ + overflow: "hidden" + }); + + if ( show ) { + el.css( ref, positiveMotion ? (isNaN(distance) ? "-" + distance : -distance) : distance ); + } + + // Animation + animation[ ref ] = ( show ? + ( positiveMotion ? "+=" : "-=") : + ( positiveMotion ? "-=" : "+=")) + + distance; + + // Animate + el.animate( animation, { + queue: false, + duration: o.duration, + easing: o.easing, + complete: function() { + if ( mode === "hide" ) { + el.hide(); + } + $.effects.restore( el, props ); + $.effects.removeWrapper( el ); + done(); + } + }); +}; + +})(jQuery); +(function( $, undefined ) { + +$.effects.effect.transfer = function( o, done ) { + var elem = $( this ), + target = $( o.to ), + targetFixed = target.css( "position" ) === "fixed", + body = $("body"), + fixTop = targetFixed ? body.scrollTop() : 0, + fixLeft = targetFixed ? body.scrollLeft() : 0, + endPosition = target.offset(), + animation = { + top: endPosition.top - fixTop , + left: endPosition.left - fixLeft , + height: target.innerHeight(), + width: target.innerWidth() + }, + startPosition = elem.offset(), + transfer = $( '<div class="ui-effects-transfer"></div>' ) + .appendTo( document.body ) + .addClass( o.className ) + .css({ + top: startPosition.top - fixTop , + left: startPosition.left - fixLeft , + height: elem.innerHeight(), + width: elem.innerWidth(), + position: targetFixed ? "fixed" : "absolute" + }) + .animate( animation, o.duration, o.easing, function() { + transfer.remove(); + done(); + }); +}; + +})(jQuery); diff --git a/addons/web/static/lib/jquery/jquery-1.7.2.js b/addons/web/static/lib/jquery/jquery-1.8.2.js index 3774ff98613..1ec3382a6a3 100644 --- a/addons/web/static/lib/jquery/jquery-1.7.2.js +++ b/addons/web/static/lib/jquery/jquery-1.8.2.js @@ -1,31 +1,28 @@ /*! - * jQuery JavaScript Library v1.7.2 + * jQuery JavaScript Library v1.8.2 * http://jquery.com/ * - * Copyright 2011, John Resig - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * * Includes Sizzle.js * http://sizzlejs.com/ - * Copyright 2011, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. * - * Date: Wed Mar 21 12:46:34 2012 -0700 + * Copyright 2012 jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: Thu Sep 20 2012 21:13:05 GMT-0400 (Eastern Daylight Time) */ (function( window, undefined ) { +var + // A central reference to the root jQuery(document) + rootjQuery, -// Use the correct document accordingly with window argument (sandbox) -var document = window.document, - navigator = window.navigator, - location = window.location; -var jQuery = (function() { + // The deferred used on DOM ready + readyList, -// Define a local copy of jQuery -var jQuery = function( selector, context ) { - // The jQuery object is actually just the init constructor 'enhanced' - return new jQuery.fn.init( selector, context, rootjQuery ); - }, + // Use the correct document accordingly with window argument (sandbox) + document = window.document, + location = window.location, + navigator = window.navigator, // Map over jQuery in case of overwrite _jQuery = window.jQuery, @@ -33,63 +30,64 @@ var jQuery = function( selector, context ) { // Map over the $ in case of overwrite _$ = window.$, - // A central reference to the root jQuery(document) - rootjQuery, + // Save a reference to some core methods + core_push = Array.prototype.push, + core_slice = Array.prototype.slice, + core_indexOf = Array.prototype.indexOf, + core_toString = Object.prototype.toString, + core_hasOwn = Object.prototype.hasOwnProperty, + core_trim = String.prototype.trim, + + // Define a local copy of jQuery + jQuery = function( selector, context ) { + // The jQuery object is actually just the init constructor 'enhanced' + return new jQuery.fn.init( selector, context, rootjQuery ); + }, - // A simple way to check for HTML strings or ID strings - // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) - quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/, + // Used for matching numbers + core_pnum = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source, + + // Used for detecting and trimming whitespace + core_rnotwhite = /\S/, + core_rspace = /\s+/, - // Check if a string has a non-whitespace character in it - rnotwhite = /\S/, + // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE) + rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, - // Used for trimming whitespace - trimLeft = /^\s+/, - trimRight = /\s+$/, + // A simple way to check for HTML strings + // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) + rquickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/, // Match a standalone tag - rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, + rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, // JSON RegExp rvalidchars = /^[\],:{}\s]*$/, - rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, - rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, - - // Useragent RegExp - rwebkit = /(webkit)[ \/]([\w.]+)/, - ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/, - rmsie = /(msie) ([\w.]+)/, - rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/, + rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g, + rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g, // Matches dashed string for camelizing - rdashAlpha = /-([a-z]|[0-9])/ig, rmsPrefix = /^-ms-/, + rdashAlpha = /-([\da-z])/gi, // Used by jQuery.camelCase as callback to replace() fcamelCase = function( all, letter ) { return ( letter + "" ).toUpperCase(); }, - // Keep a UserAgent string for use with jQuery.browser - userAgent = navigator.userAgent, - - // For matching the engine and version of the browser - browserMatch, - - // The deferred used on DOM ready - readyList, - - // The ready event handler - DOMContentLoaded, - - // Save a reference to some core methods - toString = Object.prototype.toString, - hasOwn = Object.prototype.hasOwnProperty, - push = Array.prototype.push, - slice = Array.prototype.slice, - trim = String.prototype.trim, - indexOf = Array.prototype.indexOf, + // The ready event handler and self cleanup method + DOMContentLoaded = function() { + if ( document.addEventListener ) { + document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); + jQuery.ready(); + } else if ( document.readyState === "complete" ) { + // we're here because readyState === "complete" in oldIE + // which is good enough for us to call the dom ready! + document.detachEvent( "onreadystatechange", DOMContentLoaded ); + jQuery.ready(); + } + }, // [[Class]] -> type pairs class2type = {}; @@ -99,7 +97,7 @@ jQuery.fn = jQuery.prototype = { init: function( selector, context, rootjQuery ) { var match, elem, ret, doc; - // Handle $(""), $(null), or $(undefined) + // Handle $(""), $(null), $(undefined), $(false) if ( !selector ) { return this; } @@ -111,55 +109,33 @@ jQuery.fn = jQuery.prototype = { return this; } - // The body element only exists once, optimize finding it - if ( selector === "body" && !context && document.body ) { - this.context = document; - this[0] = document.body; - this.selector = selector; - this.length = 1; - return this; - } - // Handle HTML strings if ( typeof selector === "string" ) { - // Are we dealing with HTML string or an ID? if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { // Assume that strings that start and end with <> are HTML and skip the regex check match = [ null, selector, null ]; } else { - match = quickExpr.exec( selector ); + match = rquickExpr.exec( selector ); } - // Verify a match, and that no context was specified for #id + // Match html or make sure no context is specified for #id if ( match && (match[1] || !context) ) { // HANDLE: $(html) -> $(array) if ( match[1] ) { context = context instanceof jQuery ? context[0] : context; - doc = ( context ? context.ownerDocument || context : document ); - - // If a single string is passed in and it's a single tag - // just do a createElement and skip the rest - ret = rsingleTag.exec( selector ); - - if ( ret ) { - if ( jQuery.isPlainObject( context ) ) { - selector = [ document.createElement( ret[1] ) ]; - jQuery.fn.attr.call( selector, context, true ); - - } else { - selector = [ doc.createElement( ret[1] ) ]; - } + doc = ( context && context.nodeType ? context.ownerDocument || context : document ); - } else { - ret = jQuery.buildFragment( [ match[1] ], [ doc ] ); - selector = ( ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment ).childNodes; + // scripts is true for back-compat + selector = jQuery.parseHTML( match[1], doc, true ); + if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { + this.attr.call( selector, context, true ); } return jQuery.merge( this, selector ); - // HANDLE: $("#id") + // HANDLE: $(#id) } else { elem = document.getElementById( match[2] ); @@ -210,7 +186,7 @@ jQuery.fn = jQuery.prototype = { selector: "", // The current version of jQuery being used - jquery: "1.7.2", + jquery: "1.8.2", // The default length of a jQuery object is 0 length: 0, @@ -221,7 +197,7 @@ jQuery.fn = jQuery.prototype = { }, toArray: function() { - return slice.call( this, 0 ); + return core_slice.call( this ); }, // Get the Nth element in the matched element set OR @@ -239,15 +215,9 @@ jQuery.fn = jQuery.prototype = { // Take an array of elements and push it onto the stack // (returning the new matched element set) pushStack: function( elems, name, selector ) { - // Build a new jQuery matched element set - var ret = this.constructor(); - - if ( jQuery.isArray( elems ) ) { - push.apply( ret, elems ); - } else { - jQuery.merge( ret, elems ); - } + // Build a new jQuery matched element set + var ret = jQuery.merge( this.constructor(), elems ); // Add the old object onto the stack (as a reference) ret.prevObject = this; @@ -272,11 +242,8 @@ jQuery.fn = jQuery.prototype = { }, ready: function( fn ) { - // Attach the listeners - jQuery.bindReady(); - // Add the callback - readyList.add( fn ); + jQuery.ready.promise().done( fn ); return this; }, @@ -297,8 +264,8 @@ jQuery.fn = jQuery.prototype = { }, slice: function() { - return this.pushStack( slice.apply( this, arguments ), - "slice", slice.call(arguments).join(",") ); + return this.pushStack( core_slice.apply( this, arguments ), + "slice", core_slice.call(arguments).join(",") ); }, map: function( callback ) { @@ -313,7 +280,7 @@ jQuery.fn = jQuery.prototype = { // For internal use only. // Behaves like an Array's method, not like a jQuery method. - push: push, + push: core_push, sort: [].sort, splice: [].splice }; @@ -416,73 +383,31 @@ jQuery.extend({ // Handle when the DOM is ready ready: function( wait ) { - // Either a released hold or an DOMready/load event and not yet ready - if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) { - // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). - if ( !document.body ) { - return setTimeout( jQuery.ready, 1 ); - } - - // Remember that the DOM is ready - jQuery.isReady = true; - // If a normal DOM Ready event fired, decrement, and wait if need be - if ( wait !== true && --jQuery.readyWait > 0 ) { - return; - } - - // If there are functions bound, to execute - readyList.fireWith( document, [ jQuery ] ); - - // Trigger any bound ready events - if ( jQuery.fn.trigger ) { - jQuery( document ).trigger( "ready" ).off( "ready" ); - } - } - }, - - bindReady: function() { - if ( readyList ) { + // Abort if there are pending holds or we're already ready + if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { return; } - readyList = jQuery.Callbacks( "once memory" ); - - // Catch cases where $(document).ready() is called after the - // browser event has already occurred. - if ( document.readyState === "complete" ) { - // Handle it asynchronously to allow scripts the opportunity to delay ready + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). + if ( !document.body ) { return setTimeout( jQuery.ready, 1 ); } - // Mozilla, Opera and webkit nightlies currently support this event - if ( document.addEventListener ) { - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); - - // A fallback to window.onload, that will always work - window.addEventListener( "load", jQuery.ready, false ); - - // If IE event model is used - } else if ( document.attachEvent ) { - // ensure firing before onload, - // maybe late but safe also for iframes - document.attachEvent( "onreadystatechange", DOMContentLoaded ); - - // A fallback to window.onload, that will always work - window.attachEvent( "onload", jQuery.ready ); + // Remember that the DOM is ready + jQuery.isReady = true; - // If IE and not a frame - // continually check to see if the document is ready - var toplevel = false; + // If a normal DOM Ready event fired, decrement, and wait if need be + if ( wait !== true && --jQuery.readyWait > 0 ) { + return; + } - try { - toplevel = window.frameElement == null; - } catch(e) {} + // If there are functions bound, to execute + readyList.resolveWith( document, [ jQuery ] ); - if ( document.documentElement.doScroll && toplevel ) { - doScrollCheck(); - } + // Trigger any bound ready events + if ( jQuery.fn.trigger ) { + jQuery( document ).trigger("ready").off("ready"); } }, @@ -508,7 +433,7 @@ jQuery.extend({ type: function( obj ) { return obj == null ? String( obj ) : - class2type[ toString.call(obj) ] || "object"; + class2type[ core_toString.call(obj) ] || "object"; }, isPlainObject: function( obj ) { @@ -522,8 +447,8 @@ jQuery.extend({ try { // Not own constructor property must be Object if ( obj.constructor && - !hasOwn.call(obj, "constructor") && - !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { + !core_hasOwn.call(obj, "constructor") && + !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { return false; } } catch ( e ) { @@ -537,11 +462,12 @@ jQuery.extend({ var key; for ( key in obj ) {} - return key === undefined || hasOwn.call( obj, key ); + return key === undefined || core_hasOwn.call( obj, key ); }, isEmptyObject: function( obj ) { - for ( var name in obj ) { + var name; + for ( name in obj ) { return false; } return true; @@ -551,8 +477,32 @@ jQuery.extend({ throw new Error( msg ); }, + // data: string of html + // context (optional): If specified, the fragment will be created in this context, defaults to document + // scripts (optional): If true, will include scripts passed in the html string + parseHTML: function( data, context, scripts ) { + var parsed; + if ( !data || typeof data !== "string" ) { + return null; + } + if ( typeof context === "boolean" ) { + scripts = context; + context = 0; + } + context = context || document; + + // Single tag + if ( (parsed = rsingleTag.exec( data )) ) { + return [ context.createElement( parsed[1] ) ]; + } + + parsed = jQuery.buildFragment( [ data ], context, scripts ? null : [] ); + return jQuery.merge( [], + (parsed.cacheable ? jQuery.clone( parsed.fragment ) : parsed.fragment).childNodes ); + }, + parseJSON: function( data ) { - if ( typeof data !== "string" || !data ) { + if ( !data || typeof data !== "string") { return null; } @@ -578,10 +528,10 @@ jQuery.extend({ // Cross-browser xml parsing parseXML: function( data ) { - if ( typeof data !== "string" || !data ) { + var xml, tmp; + if ( !data || typeof data !== "string" ) { return null; } - var xml, tmp; try { if ( window.DOMParser ) { // Standard tmp = new DOMParser(); @@ -606,7 +556,7 @@ jQuery.extend({ // Workarounds based on findings by Jim Driscoll // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context globalEval: function( data ) { - if ( data && rnotwhite.test( data ) ) { + if ( data && core_rnotwhite.test( data ) ) { // We use execScript on Internet Explorer // We use an anonymous function so that context is window // rather than jQuery in Firefox @@ -623,25 +573,26 @@ jQuery.extend({ }, nodeName: function( elem, name ) { - return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); + return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); }, // args is for internal usage only - each: function( object, callback, args ) { - var name, i = 0, - length = object.length, - isObj = length === undefined || jQuery.isFunction( object ); + each: function( obj, callback, args ) { + var name, + i = 0, + length = obj.length, + isObj = length === undefined || jQuery.isFunction( obj ); if ( args ) { if ( isObj ) { - for ( name in object ) { - if ( callback.apply( object[ name ], args ) === false ) { + for ( name in obj ) { + if ( callback.apply( obj[ name ], args ) === false ) { break; } } } else { for ( ; i < length; ) { - if ( callback.apply( object[ i++ ], args ) === false ) { + if ( callback.apply( obj[ i++ ], args ) === false ) { break; } } @@ -650,71 +601,72 @@ jQuery.extend({ // A special, fast, case for the most common use of each } else { if ( isObj ) { - for ( name in object ) { - if ( callback.call( object[ name ], name, object[ name ] ) === false ) { + for ( name in obj ) { + if ( callback.call( obj[ name ], name, obj[ name ] ) === false ) { break; } } } else { for ( ; i < length; ) { - if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) { + if ( callback.call( obj[ i ], i, obj[ i++ ] ) === false ) { break; } } } } - return object; + return obj; }, // Use native String.trim function wherever possible - trim: trim ? + trim: core_trim && !core_trim.call("\uFEFF\xA0") ? function( text ) { return text == null ? "" : - trim.call( text ); + core_trim.call( text ); } : // Otherwise use our own trimming functionality function( text ) { return text == null ? "" : - text.toString().replace( trimLeft, "" ).replace( trimRight, "" ); + ( text + "" ).replace( rtrim, "" ); }, // results is for internal usage only - makeArray: function( array, results ) { - var ret = results || []; + makeArray: function( arr, results ) { + var type, + ret = results || []; - if ( array != null ) { + if ( arr != null ) { // The window, strings (and functions) also have 'length' // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930 - var type = jQuery.type( array ); + type = jQuery.type( arr ); - if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) { - push.call( ret, array ); + if ( arr.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( arr ) ) { + core_push.call( ret, arr ); } else { - jQuery.merge( ret, array ); + jQuery.merge( ret, arr ); } } return ret; }, - inArray: function( elem, array, i ) { + inArray: function( elem, arr, i ) { var len; - if ( array ) { - if ( indexOf ) { - return indexOf.call( array, elem, i ); + if ( arr ) { + if ( core_indexOf ) { + return core_indexOf.call( arr, elem, i ); } - len = array.length; + len = arr.length; i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; for ( ; i < len; i++ ) { // Skip accessing in sparse arrays - if ( i in array && array[ i ] === elem ) { + if ( i in arr && arr[ i ] === elem ) { return i; } } @@ -724,11 +676,12 @@ jQuery.extend({ }, merge: function( first, second ) { - var i = first.length, + var l = second.length, + i = first.length, j = 0; - if ( typeof second.length === "number" ) { - for ( var l = second.length; j < l; j++ ) { + if ( typeof l === "number" ) { + for ( ; j < l; j++ ) { first[ i++ ] = second[ j ]; } @@ -744,12 +697,15 @@ jQuery.extend({ }, grep: function( elems, callback, inv ) { - var ret = [], retVal; + var retVal, + ret = [], + i = 0, + length = elems.length; inv = !!inv; // Go through the array, only saving the items // that pass the validator function - for ( var i = 0, length = elems.length; i < length; i++ ) { + for ( ; i < length; i++ ) { retVal = !!callback( elems[ i ], i ); if ( inv !== retVal ) { ret.push( elems[ i ] ); @@ -761,7 +717,8 @@ jQuery.extend({ // arg is for internal usage only map: function( elems, callback, arg ) { - var value, key, ret = [], + var value, key, + ret = [], i = 0, length = elems.length, // jquery objects are treated as arrays @@ -798,8 +755,10 @@ jQuery.extend({ // Bind a function to a context, optionally partially applying any // arguments. proxy: function( fn, context ) { + var tmp, args, proxy; + if ( typeof context === "string" ) { - var tmp = fn[ context ]; + tmp = fn[ context ]; context = fn; fn = tmp; } @@ -811,18 +770,18 @@ jQuery.extend({ } // Simulated bind - var args = slice.call( arguments, 2 ), - proxy = function() { - return fn.apply( context, args.concat( slice.call( arguments ) ) ); - }; + args = core_slice.call( arguments, 2 ); + proxy = function() { + return fn.apply( context, args.concat( core_slice.call( arguments ) ) ); + }; // Set the guid of unique handler to the same of original handler, so it can be removed - proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++; + proxy.guid = fn.guid = fn.guid || jQuery.guid++; return proxy; }, - // Mutifunctional method to get and set values to a collection + // Multifunctional method to get and set values of a collection // The value/s can optionally be executed if it's a function access: function( elems, fn, key, value, chainable, emptyGet, pass ) { var exec, @@ -877,136 +836,96 @@ jQuery.extend({ now: function() { return ( new Date() ).getTime(); - }, - - // Use of jQuery.browser is frowned upon. - // More details: http://docs.jquery.com/Utilities/jQuery.browser - uaMatch: function( ua ) { - ua = ua.toLowerCase(); + } +}); - var match = rwebkit.exec( ua ) || - ropera.exec( ua ) || - rmsie.exec( ua ) || - ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) || - []; +jQuery.ready.promise = function( obj ) { + if ( !readyList ) { - return { browser: match[1] || "", version: match[2] || "0" }; - }, + readyList = jQuery.Deferred(); - sub: function() { - function jQuerySub( selector, context ) { - return new jQuerySub.fn.init( selector, context ); - } - jQuery.extend( true, jQuerySub, this ); - jQuerySub.superclass = this; - jQuerySub.fn = jQuerySub.prototype = this(); - jQuerySub.fn.constructor = jQuerySub; - jQuerySub.sub = this.sub; - jQuerySub.fn.init = function init( selector, context ) { - if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) { - context = jQuerySub( context ); - } + // Catch cases where $(document).ready() is called after the browser event has already occurred. + // we once tried to use readyState "interactive" here, but it caused issues like the one + // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 + if ( document.readyState === "complete" ) { + // Handle it asynchronously to allow scripts the opportunity to delay ready + setTimeout( jQuery.ready, 1 ); - return jQuery.fn.init.call( this, selector, context, rootjQuerySub ); - }; - jQuerySub.fn.init.prototype = jQuerySub.fn; - var rootjQuerySub = jQuerySub(document); - return jQuerySub; - }, + // Standards-based browsers support DOMContentLoaded + } else if ( document.addEventListener ) { + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); - browser: {} -}); + // A fallback to window.onload, that will always work + window.addEventListener( "load", jQuery.ready, false ); -// Populate the class2type map -jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) { - class2type[ "[object " + name + "]" ] = name.toLowerCase(); -}); + // If IE event model is used + } else { + // Ensure firing before onload, maybe late but safe also for iframes + document.attachEvent( "onreadystatechange", DOMContentLoaded ); -browserMatch = jQuery.uaMatch( userAgent ); -if ( browserMatch.browser ) { - jQuery.browser[ browserMatch.browser ] = true; - jQuery.browser.version = browserMatch.version; -} + // A fallback to window.onload, that will always work + window.attachEvent( "onload", jQuery.ready ); -// Deprecated, use jQuery.browser.webkit instead -if ( jQuery.browser.webkit ) { - jQuery.browser.safari = true; -} + // If IE and not a frame + // continually check to see if the document is ready + var top = false; -// IE doesn't match non-breaking spaces with \s -if ( rnotwhite.test( "\xA0" ) ) { - trimLeft = /^[\s\xA0]+/; - trimRight = /[\s\xA0]+$/; -} + try { + top = window.frameElement == null && document.documentElement; + } catch(e) {} -// All jQuery objects should point back to these -rootjQuery = jQuery(document); + if ( top && top.doScroll ) { + (function doScrollCheck() { + if ( !jQuery.isReady ) { -// Cleanup functions for the document ready method -if ( document.addEventListener ) { - DOMContentLoaded = function() { - document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); - jQuery.ready(); - }; + try { + // Use the trick by Diego Perini + // http://javascript.nwbox.com/IEContentLoaded/ + top.doScroll("left"); + } catch(e) { + return setTimeout( doScrollCheck, 50 ); + } -} else if ( document.attachEvent ) { - DOMContentLoaded = function() { - // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). - if ( document.readyState === "complete" ) { - document.detachEvent( "onreadystatechange", DOMContentLoaded ); - jQuery.ready(); + // and execute any waiting functions + jQuery.ready(); + } + })(); + } } - }; -} - -// The DOM ready check for Internet Explorer -function doScrollCheck() { - if ( jQuery.isReady ) { - return; - } - - try { - // If IE is used, use the trick by Diego Perini - // http://javascript.nwbox.com/IEContentLoaded/ - document.documentElement.doScroll("left"); - } catch(e) { - setTimeout( doScrollCheck, 1 ); - return; } + return readyList.promise( obj ); +}; - // and execute any waiting functions - jQuery.ready(); -} - -return jQuery; - -})(); - - -// String to Object flags format cache -var flagsCache = {}; +// Populate the class2type map +jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); +}); -// Convert String-formatted flags into Object-formatted ones and store in cache -function createFlags( flags ) { - var object = flagsCache[ flags ] = {}, - i, length; - flags = flags.split( /\s+/ ); - for ( i = 0, length = flags.length; i < length; i++ ) { - object[ flags[i] ] = true; - } +// All jQuery objects should point back to these +rootjQuery = jQuery(document); +// String to Object options format cache +var optionsCache = {}; + +// Convert String-formatted options into Object-formatted ones and store in cache +function createOptions( options ) { + var object = optionsCache[ options ] = {}; + jQuery.each( options.split( core_rspace ), function( _, flag ) { + object[ flag ] = true; + }); return object; } /* * Create a callback list using the following parameters: * - * flags: an optional list of space-separated flags that will change how - * the callback list behaves + * options: an optional list of space-separated options that will change how + * the callback list behaves or a more traditional option object * * By default a callback list will act like an event callback list and can be * "fired" multiple times. * - * Possible flags: + * Possible options: * * once: will ensure the callback list can only be fired once (like a Deferred) * @@ -1019,17 +938,15 @@ function createFlags( flags ) { * stopOnFalse: interrupt callings when a callback returns false * */ -jQuery.Callbacks = function( flags ) { +jQuery.Callbacks = function( options ) { - // Convert flags from String-formatted to Object-formatted + // Convert options from String-formatted to Object-formatted if needed // (we check in cache first) - flags = flags ? ( flagsCache[ flags ] || createFlags( flags ) ) : {}; + options = typeof options === "string" ? + ( optionsCache[ options ] || createOptions( options ) ) : + jQuery.extend( {}, options ); - var // Actual callback list - list = [], - // Stack of fire calls for repeatable lists - stack = [], - // Last fire value (for non-forgettable lists) + var // Last fire value (for non-forgettable lists) memory, // Flag to know if list was already fired fired, @@ -1041,53 +958,34 @@ jQuery.Callbacks = function( flags ) { firingLength, // Index of currently firing callback (modified by remove if needed) firingIndex, - // Add one or several callbacks to the list - add = function( args ) { - var i, - length, - elem, - type, - actual; - for ( i = 0, length = args.length; i < length; i++ ) { - elem = args[ i ]; - type = jQuery.type( elem ); - if ( type === "array" ) { - // Inspect recursively - add( elem ); - } else if ( type === "function" ) { - // Add if not in unique mode and callback is not in - if ( !flags.unique || !self.has( elem ) ) { - list.push( elem ); - } - } - } - }, + // Actual callback list + list = [], + // Stack of fire calls for repeatable lists + stack = !options.once && [], // Fire callbacks - fire = function( context, args ) { - args = args || []; - memory = !flags.memory || [ context, args ]; + fire = function( data ) { + memory = options.memory && data; fired = true; - firing = true; firingIndex = firingStart || 0; firingStart = 0; firingLength = list.length; + firing = true; for ( ; list && firingIndex < firingLength; firingIndex++ ) { - if ( list[ firingIndex ].apply( context, args ) === false && flags.stopOnFalse ) { - memory = true; // Mark as halted + if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { + memory = false; // To prevent further calls using add break; } } firing = false; if ( list ) { - if ( !flags.once ) { - if ( stack && stack.length ) { - memory = stack.shift(); - self.fireWith( memory[ 0 ], memory[ 1 ] ); + if ( stack ) { + if ( stack.length ) { + fire( stack.shift() ); } - } else if ( memory === true ) { - self.disable(); - } else { + } else if ( memory ) { list = []; + } else { + self.disable(); } } }, @@ -1096,18 +994,28 @@ jQuery.Callbacks = function( flags ) { // Add a callback or a collection of callbacks to the list add: function() { if ( list ) { - var length = list.length; - add( arguments ); + // First, we save the current length + var start = list.length; + (function add( args ) { + jQuery.each( args, function( _, arg ) { + var type = jQuery.type( arg ); + if ( type === "function" && ( !options.unique || !self.has( arg ) ) ) { + list.push( arg ); + } else if ( arg && arg.length && type !== "string" ) { + // Inspect recursively + add( arg ); + } + }); + })( arguments ); // Do we need to add the callbacks to the // current firing batch? if ( firing ) { firingLength = list.length; // With memory, if we're not firing then - // we should call right away, unless previous - // firing was halted (stopOnFalse) - } else if ( memory && memory !== true ) { - firingStart = length; - fire( memory[ 0 ], memory[ 1 ] ); + // we should call right away + } else if ( memory ) { + firingStart = start; + fire( memory ); } } return this; @@ -1115,46 +1023,27 @@ jQuery.Callbacks = function( flags ) { // Remove a callback from the list remove: function() { if ( list ) { - var args = arguments, - argIndex = 0, - argLength = args.length; - for ( ; argIndex < argLength ; argIndex++ ) { - for ( var i = 0; i < list.length; i++ ) { - if ( args[ argIndex ] === list[ i ] ) { - // Handle firingIndex and firingLength - if ( firing ) { - if ( i <= firingLength ) { - firingLength--; - if ( i <= firingIndex ) { - firingIndex--; - } - } + jQuery.each( arguments, function( _, arg ) { + var index; + while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { + list.splice( index, 1 ); + // Handle firing indexes + if ( firing ) { + if ( index <= firingLength ) { + firingLength--; } - // Remove the element - list.splice( i--, 1 ); - // If we have some unicity property then - // we only need to do this once - if ( flags.unique ) { - break; + if ( index <= firingIndex ) { + firingIndex--; } } } - } + }); } return this; }, // Control if a given callback is in the list has: function( fn ) { - if ( list ) { - var i = 0, - length = list.length; - for ( ; i < length; i++ ) { - if ( fn === list[ i ] ) { - return true; - } - } - } - return false; + return jQuery.inArray( fn, list ) > -1; }, // Remove all callbacks from the list empty: function() { @@ -1173,7 +1062,7 @@ jQuery.Callbacks = function( flags ) { // Lock the list in its current state lock: function() { stack = undefined; - if ( !memory || memory === true ) { + if ( !memory ) { self.disable(); } return this; @@ -1184,13 +1073,13 @@ jQuery.Callbacks = function( flags ) { }, // Call all callbacks with the given context and arguments fireWith: function( context, args ) { - if ( stack ) { + args = args || []; + args = [ context, args.slice ? args.slice() : args ]; + if ( list && ( !fired || stack ) ) { if ( firing ) { - if ( !flags.once ) { - stack.push( [ context, args ] ); - } - } else if ( !( flags.once && memory ) ) { - fire( context, args ); + stack.push( args ); + } else { + fire( args ); } } return this; @@ -1208,98 +1097,89 @@ jQuery.Callbacks = function( flags ) { return self; }; - - - - -var // Static reference to slice - sliceDeferred = [].slice; - jQuery.extend({ Deferred: function( func ) { - var doneList = jQuery.Callbacks( "once memory" ), - failList = jQuery.Callbacks( "once memory" ), - progressList = jQuery.Callbacks( "memory" ), + var tuples = [ + // action, add listener, listener list, final state + [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], + [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], + [ "notify", "progress", jQuery.Callbacks("memory") ] + ], state = "pending", - lists = { - resolve: doneList, - reject: failList, - notify: progressList - }, promise = { - done: doneList.add, - fail: failList.add, - progress: progressList.add, - state: function() { return state; }, - - // Deprecated - isResolved: doneList.fired, - isRejected: failList.fired, - - then: function( doneCallbacks, failCallbacks, progressCallbacks ) { - deferred.done( doneCallbacks ).fail( failCallbacks ).progress( progressCallbacks ); - return this; - }, always: function() { - deferred.done.apply( deferred, arguments ).fail.apply( deferred, arguments ); + deferred.done( arguments ).fail( arguments ); return this; }, - pipe: function( fnDone, fnFail, fnProgress ) { + then: function( /* fnDone, fnFail, fnProgress */ ) { + var fns = arguments; return jQuery.Deferred(function( newDefer ) { - jQuery.each( { - done: [ fnDone, "resolve" ], - fail: [ fnFail, "reject" ], - progress: [ fnProgress, "notify" ] - }, function( handler, data ) { - var fn = data[ 0 ], - action = data[ 1 ], - returned; - if ( jQuery.isFunction( fn ) ) { - deferred[ handler ](function() { - returned = fn.apply( this, arguments ); + jQuery.each( tuples, function( i, tuple ) { + var action = tuple[ 0 ], + fn = fns[ i ]; + // deferred[ done | fail | progress ] for forwarding actions to newDefer + deferred[ tuple[1] ]( jQuery.isFunction( fn ) ? + function() { + var returned = fn.apply( this, arguments ); if ( returned && jQuery.isFunction( returned.promise ) ) { - returned.promise().then( newDefer.resolve, newDefer.reject, newDefer.notify ); + returned.promise() + .done( newDefer.resolve ) + .fail( newDefer.reject ) + .progress( newDefer.notify ); } else { newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] ); } - }); - } else { - deferred[ handler ]( newDefer[ action ] ); - } + } : + newDefer[ action ] + ); }); + fns = null; }).promise(); }, // Get a promise for this deferred // If obj is provided, the promise aspect is added to the object promise: function( obj ) { - if ( obj == null ) { - obj = promise; - } else { - for ( var key in promise ) { - obj[ key ] = promise[ key ]; - } - } - return obj; + return obj != null ? jQuery.extend( obj, promise ) : promise; } }, - deferred = promise.promise({}), - key; + deferred = {}; - for ( key in lists ) { - deferred[ key ] = lists[ key ].fire; - deferred[ key + "With" ] = lists[ key ].fireWith; - } + // Keep pipe for back-compat + //promise.pipe = promise.then; + promise.pipe = function() { + console.error("$.Deferred().pipe() is deprecated. Use .then() instead."); + return promise.then.apply(this, arguments); + }; + + // Add list-specific methods + jQuery.each( tuples, function( i, tuple ) { + var list = tuple[ 2 ], + stateString = tuple[ 3 ]; + + // promise[ done | fail | progress ] = list.add + promise[ tuple[1] ] = list.add; - // Handle state - deferred.done( function() { - state = "resolved"; - }, failList.disable, progressList.lock ).fail( function() { - state = "rejected"; - }, doneList.disable, progressList.lock ); + // Handle state + if ( stateString ) { + list.add(function() { + // state = [ resolved | rejected ] + state = stateString; + + // [ reject_list | resolve_list ].disable; progress_list.lock + }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); + } + + // deferred[ resolve | reject | notify ] = list.fire + deferred[ tuple[0] ] = list.fire; + deferred[ tuple[0] + "With" ] = list.fireWith; + }); + + // Make the deferred a promise + promise.promise( deferred ); // Call given func if any if ( func ) { @@ -1311,52 +1191,57 @@ jQuery.extend({ }, // Deferred helper - when: function( firstParam ) { - var args = sliceDeferred.call( arguments, 0 ), - i = 0, - length = args.length, - pValues = new Array( length ), - count = length, - pCount = length, - deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ? - firstParam : - jQuery.Deferred(), - promise = deferred.promise(); - function resolveFunc( i ) { - return function( value ) { - args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value; - if ( !( --count ) ) { - deferred.resolveWith( deferred, args ); - } - }; - } - function progressFunc( i ) { - return function( value ) { - pValues[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value; - deferred.notifyWith( promise, pValues ); - }; - } + when: function( subordinate /* , ..., subordinateN */ ) { + var i = 0, + resolveValues = core_slice.call( arguments ), + length = resolveValues.length, + + // the count of uncompleted subordinates + remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, + + // the master Deferred. If resolveValues consist of only a single Deferred, just use that. + deferred = remaining === 1 ? subordinate : jQuery.Deferred(), + + // Update function for both resolve and progress values + updateFunc = function( i, contexts, values ) { + return function( value ) { + contexts[ i ] = this; + values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value; + if( values === progressValues ) { + deferred.notifyWith( contexts, values ); + } else if ( !( --remaining ) ) { + deferred.resolveWith( contexts, values ); + } + }; + }, + + progressValues, progressContexts, resolveContexts; + + // add listeners to Deferred subordinates; treat others as resolved if ( length > 1 ) { + progressValues = new Array( length ); + progressContexts = new Array( length ); + resolveContexts = new Array( length ); for ( ; i < length; i++ ) { - if ( args[ i ] && args[ i ].promise && jQuery.isFunction( args[ i ].promise ) ) { - args[ i ].promise().then( resolveFunc(i), deferred.reject, progressFunc(i) ); + if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { + resolveValues[ i ].promise() + .done( updateFunc( i, resolveContexts, resolveValues ) ) + .fail( deferred.reject ) + .progress( updateFunc( i, progressContexts, progressValues ) ); } else { - --count; + --remaining; } } - if ( !count ) { - deferred.resolveWith( deferred, args ); - } - } else if ( deferred !== firstParam ) { - deferred.resolveWith( deferred, length ? [ firstParam ] : [] ); } - return promise; - } -}); - - + // if we're not waiting on anything, resolve the master + if ( !remaining ) { + deferred.resolveWith( resolveContexts, resolveValues ); + } + return deferred.promise(); + } +}); jQuery.support = (function() { var support, @@ -1366,30 +1251,29 @@ jQuery.support = (function() { opt, input, fragment, - tds, - events, eventName, i, isSupported, - div = document.createElement( "div" ), - documentElement = document.documentElement; + clickFn, + div = document.createElement("div"); // Preliminary tests - div.setAttribute("className", "t"); - div.innerHTML = " <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>"; + div.setAttribute( "className", "t" ); + div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; - all = div.getElementsByTagName( "*" ); - a = div.getElementsByTagName( "a" )[ 0 ]; + all = div.getElementsByTagName("*"); + a = div.getElementsByTagName("a")[ 0 ]; + a.style.cssText = "top:1px;float:left;opacity:.5"; // Can't get basic test support - if ( !all || !all.length || !a ) { + if ( !all || !all.length ) { return {}; } // First batch of supports tests - select = document.createElement( "select" ); + select = document.createElement("select"); opt = select.appendChild( document.createElement("option") ); - input = div.getElementsByTagName( "input" )[ 0 ]; + input = div.getElementsByTagName("input")[ 0 ]; support = { // IE strips leading whitespace when .innerHTML is used @@ -1414,7 +1298,7 @@ jQuery.support = (function() { // Make sure that element opacity exists // (IE uses filter instead) // Use a regex to work around a WebKit issue. See #5145 - opacity: /^0.55/.test( a.style.opacity ), + opacity: /^0.5/.test( a.style.opacity ), // Verify style float existence // (IE uses styleFloat instead of cssFloat) @@ -1439,6 +1323,9 @@ jQuery.support = (function() { // Where outerHTML is undefined, this still works html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>", + // jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode + boxModel: ( document.compatMode === "CSS1Compat" ), + // Will be defined later submitBubbles: true, changeBubbles: true, @@ -1448,12 +1335,10 @@ jQuery.support = (function() { inlineBlockNeedsLayout: false, shrinkWrapBlocks: false, reliableMarginRight: true, - pixelMargin: true + boxSizingReliable: true, + pixelPosition: false }; - // jQuery.boxModel DEPRECATED in 1.3, use jQuery.support.boxModel instead - jQuery.boxModel = support.boxModel = (document.compatMode === "CSS1Compat"); - // Make sure checked status is properly cloned input.checked = true; support.noCloneChecked = input.cloneNode( true ).checked; @@ -1472,22 +1357,23 @@ jQuery.support = (function() { } if ( !div.addEventListener && div.attachEvent && div.fireEvent ) { - div.attachEvent( "onclick", function() { + div.attachEvent( "onclick", clickFn = function() { // Cloning a node shouldn't copy over any // bound event handlers (IE does this) support.noCloneEvent = false; }); - div.cloneNode( true ).fireEvent( "onclick" ); + div.cloneNode( true ).fireEvent("onclick"); + div.detachEvent( "onclick", clickFn ); } // Check if a radio maintains its value // after being appended to the DOM input = document.createElement("input"); input.value = "t"; - input.setAttribute("type", "radio"); + input.setAttribute( "type", "radio" ); support.radioValue = input.value === "t"; - input.setAttribute("checked", "checked"); + input.setAttribute( "checked", "checked" ); // #11217 - WebKit loses check when the name is after the checked attribute input.setAttribute( "name", "t" ); @@ -1514,9 +1400,9 @@ jQuery.support = (function() { // to go haywire. See: https://developer.mozilla.org/en/Security/CSP if ( div.attachEvent ) { for ( i in { - submit: 1, - change: 1, - focusin: 1 + submit: true, + change: true, + focusin: true }) { eventName = "on" + i; isSupported = ( eventName in div ); @@ -1528,16 +1414,10 @@ jQuery.support = (function() { } } - fragment.removeChild( div ); - - // Null elements to avoid leaks in IE - fragment = select = opt = div = input = null; - // Run tests that need a body at doc ready jQuery(function() { - var container, outer, inner, table, td, offsetSupport, - marginDiv, conMarginTop, style, html, positionTopLeftWidthHeight, - paddingMarginBorderVisibility, paddingMarginBorder, + var container, div, tds, marginDiv, + divReset = "padding:0;margin:0;border:0;display:block;overflow:hidden;", body = document.getElementsByTagName("body")[0]; if ( !body ) { @@ -1545,17 +1425,8 @@ jQuery.support = (function() { return; } - conMarginTop = 1; - paddingMarginBorder = "padding:0;margin:0;border:"; - positionTopLeftWidthHeight = "position:absolute;top:0;left:0;width:1px;height:1px;"; - paddingMarginBorderVisibility = paddingMarginBorder + "0;visibility:hidden;"; - style = "style='" + positionTopLeftWidthHeight + paddingMarginBorder + "5px solid #000;"; - html = "<div " + style + "display:block;'><div style='" + paddingMarginBorder + "0;display:block;overflow:hidden;'></div></div>" + - "<table " + style + "' cellpadding='0' cellspacing='0'>" + - "<tr><td></td></tr></table>"; - container = document.createElement("div"); - container.style.cssText = paddingMarginBorderVisibility + "width:0;height:0;position:static;top:0;margin-top:" + conMarginTop + "px"; + container.style.cssText = "visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px"; body.insertBefore( container, body.firstChild ); // Construct the test element @@ -1569,8 +1440,9 @@ jQuery.support = (function() { // display:none (it is still safe to use offsets if a parent element is // hidden; don safety goggles and see bug #4512 for more information). // (only IE 8 fails this test) - div.innerHTML = "<table><tr><td style='" + paddingMarginBorder + "0;display:none'></td><td>t</td></tr></table>"; - tds = div.getElementsByTagName( "td" ); + div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>"; + tds = div.getElementsByTagName("td"); + tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none"; isSupported = ( tds[ 0 ].offsetHeight === 0 ); tds[ 0 ].style.display = ""; @@ -1580,20 +1452,30 @@ jQuery.support = (function() { // (IE <= 8 fail this test) support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); - // Check if div with explicit width and no margin-right incorrectly - // gets computed margin-right based on width of container. For more - // info see bug #3333 - // Fails in WebKit before Feb 2011 nightlies - // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right + // Check box-sizing and margin behavior + div.innerHTML = ""; + div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;"; + support.boxSizing = ( div.offsetWidth === 4 ); + support.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== 1 ); + + // NOTE: To any future maintainer, we've window.getComputedStyle + // because jsdom on node.js will break without it. if ( window.getComputedStyle ) { - div.innerHTML = ""; - marginDiv = document.createElement( "div" ); - marginDiv.style.width = "0"; - marginDiv.style.marginRight = "0"; - div.style.width = "2px"; + support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%"; + support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px"; + + // Check if div with explicit width and no margin-right incorrectly + // gets computed margin-right based on width of container. For more + // info see bug #3333 + // Fails in WebKit before Feb 2011 nightlies + // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right + marginDiv = document.createElement("div"); + marginDiv.style.cssText = div.style.cssText = divReset; + marginDiv.style.marginRight = marginDiv.style.width = "0"; + div.style.width = "1px"; div.appendChild( marginDiv ); support.reliableMarginRight = - ( parseInt( ( window.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0; + !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight ); } if ( typeof div.style.zoom !== "undefined" ) { @@ -1602,74 +1484,40 @@ jQuery.support = (function() { // them layout // (IE < 8 does this) div.innerHTML = ""; - div.style.width = div.style.padding = "1px"; - div.style.border = 0; - div.style.overflow = "hidden"; - div.style.display = "inline"; - div.style.zoom = 1; + div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1"; support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 ); // Check if elements with layout shrink-wrap their children // (IE 6 does this) div.style.display = "block"; div.style.overflow = "visible"; - div.innerHTML = "<div style='width:5px;'></div>"; + div.innerHTML = "<div></div>"; + div.firstChild.style.width = "5px"; support.shrinkWrapBlocks = ( div.offsetWidth !== 3 ); - } - - div.style.cssText = positionTopLeftWidthHeight + paddingMarginBorderVisibility; - div.innerHTML = html; - - outer = div.firstChild; - inner = outer.firstChild; - td = outer.nextSibling.firstChild.firstChild; - - offsetSupport = { - doesNotAddBorder: ( inner.offsetTop !== 5 ), - doesAddBorderForTableAndCells: ( td.offsetTop === 5 ) - }; - - inner.style.position = "fixed"; - inner.style.top = "20px"; - - // safari subtracts parent border width here which is 5px - offsetSupport.fixedPosition = ( inner.offsetTop === 20 || inner.offsetTop === 15 ); - inner.style.position = inner.style.top = ""; - - outer.style.overflow = "hidden"; - outer.style.position = "relative"; - - offsetSupport.subtractsBorderForOverflowNotVisible = ( inner.offsetTop === -5 ); - offsetSupport.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== conMarginTop ); - - if ( window.getComputedStyle ) { - div.style.marginTop = "1%"; - support.pixelMargin = ( window.getComputedStyle( div, null ) || { marginTop: 0 } ).marginTop !== "1%"; - } - if ( typeof container.style.zoom !== "undefined" ) { container.style.zoom = 1; } + // Null elements to avoid leaks in IE body.removeChild( container ); - marginDiv = div = container = null; - - jQuery.extend( support, offsetSupport ); + container = div = tds = marginDiv = null; }); + // Null elements to avoid leaks in IE + fragment.removeChild( div ); + all = a = select = opt = input = fragment = div = null; + return support; })(); - - - - -var rbrace = /^(?:\{.*\}|\[.*\])$/, +var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, rmultiDash = /([A-Z])/g; jQuery.extend({ cache: {}, - // Please use with caution + deletedIds: [], + + // Remove at next major release (1.9/2.0) uuid: 0, // Unique for each copy of jQuery on the page @@ -1695,7 +1543,7 @@ jQuery.extend({ return; } - var privateCache, thisCache, ret, + var thisCache, ret, internalKey = jQuery.expando, getByName = typeof name === "string", @@ -1709,12 +1557,11 @@ jQuery.extend({ // Only defining an ID for JS objects if its cache already exists allows // the code to shortcut on the same path as a DOM node with no cache - id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey, - isEvents = name === "events"; + id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; // Avoid doing any more work than we need to when trying to get data on an // object that has no data at all - if ( (!id || !cache[id] || (!isEvents && !pvt && !cache[id].data)) && getByName && data === undefined ) { + if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && getByName && data === undefined ) { return; } @@ -1722,7 +1569,7 @@ jQuery.extend({ // Only DOM nodes need a new unique ID for each element since their data // ends up in the global cache if ( isNode ) { - elem[ internalKey ] = id = ++jQuery.uuid; + elem[ internalKey ] = id = jQuery.deletedIds.pop() || jQuery.guid++; } else { id = internalKey; } @@ -1748,7 +1595,7 @@ jQuery.extend({ } } - privateCache = thisCache = cache[ id ]; + thisCache = cache[ id ]; // jQuery data() is stored in a separate object inside the object's internal data // cache in order to avoid key collisions between internal data and user-defined @@ -1765,12 +1612,6 @@ jQuery.extend({ thisCache[ jQuery.camelCase( name ) ] = data; } - // Users should not attempt to inspect the internal events object using jQuery.data, - // it is undocumented and subject to change. But does anyone listen? No. - if ( isEvents && !thisCache[ name ] ) { - return privateCache.events; - } - // Check for both converted-to-camel and non-converted data property names // If a data property was specified if ( getByName ) { @@ -1798,16 +1639,11 @@ jQuery.extend({ var thisCache, i, l, - // Reference to internal data cache key - internalKey = jQuery.expando, - isNode = elem.nodeType, // See jQuery.data for more information cache = isNode ? jQuery.cache : elem, - - // See jQuery.data for more information - id = isNode ? elem[ internalKey ] : internalKey; + id = isNode ? elem[ jQuery.expando ] : jQuery.expando; // If there is already no cache entry for this object, there is no // purpose in continuing @@ -1834,7 +1670,7 @@ jQuery.extend({ if ( name in thisCache ) { name = [ name ]; } else { - name = name.split( " " ); + name = name.split(" "); } } } @@ -1857,35 +1693,23 @@ jQuery.extend({ // Don't destroy the parent cache unless the internal data object // had been the only thing left in it - if ( !isEmptyDataObject(cache[ id ]) ) { + if ( !isEmptyDataObject( cache[ id ] ) ) { return; } } - // Browsers that fail expando deletion also refuse to delete expandos on - // the window, but it will allow it on all other JS objects; other browsers - // don't care - // Ensure that `cache` is not a window object #10080 - if ( jQuery.support.deleteExpando || !cache.setInterval ) { + // Destroy the cache + if ( isNode ) { + jQuery.cleanData( [ elem ], true ); + + // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) + } else if ( jQuery.support.deleteExpando || cache != cache.window ) { delete cache[ id ]; + + // When all else fails, null } else { cache[ id ] = null; } - - // We destroyed the cache and need to eliminate the expando on the node to avoid - // false lookups in the cache for entries that no longer exist - if ( isNode ) { - // IE does not allow us to delete expando properties from nodes, - // nor does it have a removeAttribute function on Document nodes; - // we must handle all of these cases - if ( jQuery.support.deleteExpando ) { - delete elem[ internalKey ]; - } else if ( elem.removeAttribute ) { - elem.removeAttribute( internalKey ); - } else { - elem[ internalKey ] = null; - } - } }, // For internal use only. @@ -1895,15 +1719,10 @@ jQuery.extend({ // A method for determining if a DOM node can handle the data expando acceptData: function( elem ) { - if ( elem.nodeName ) { - var match = jQuery.noData[ elem.nodeName.toLowerCase() ]; - - if ( match ) { - return !(match === true || elem.getAttribute("classid") !== match); - } - } + var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ]; - return true; + // nodes accept data unless otherwise specified; rejection can be conditional + return !noData || noData !== true && elem.getAttribute("classid") === noData; } }); @@ -1924,7 +1743,7 @@ jQuery.fn.extend({ for ( l = attr.length; i < l; i++ ) { name = attr[i].name; - if ( name.indexOf( "data-" ) === 0 ) { + if ( !name.indexOf( "data-" ) ) { name = jQuery.camelCase( name.substring(5) ); dataAttr( elem, name, data[ name ] ); @@ -1996,8 +1815,9 @@ function dataAttr( elem, key, data ) { data = data === "true" ? true : data === "false" ? false : data === "null" ? null : - jQuery.isNumeric( data ) ? +data : - rbrace.test( data ) ? jQuery.parseJSON( data ) : + // Only convert to a number if it doesn't change the string + +data + "" === data ? +data : + rbrace.test( data ) ? jQuery.parseJSON( data ) : data; } catch( e ) {} @@ -2014,7 +1834,8 @@ function dataAttr( elem, key, data ) { // checks a cache object for emptiness function isEmptyDataObject( obj ) { - for ( var name in obj ) { + var name; + for ( name in obj ) { // if the public data object is empty, the private is still empty if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { @@ -2027,73 +1848,23 @@ function isEmptyDataObject( obj ) { return true; } - - - - -function handleQueueMarkDefer( elem, type, src ) { - var deferDataKey = type + "defer", - queueDataKey = type + "queue", - markDataKey = type + "mark", - defer = jQuery._data( elem, deferDataKey ); - if ( defer && - ( src === "queue" || !jQuery._data(elem, queueDataKey) ) && - ( src === "mark" || !jQuery._data(elem, markDataKey) ) ) { - // Give room for hard-coded callbacks to fire first - // and eventually mark/queue something else on the element - setTimeout( function() { - if ( !jQuery._data( elem, queueDataKey ) && - !jQuery._data( elem, markDataKey ) ) { - jQuery.removeData( elem, deferDataKey, true ); - defer.fire(); - } - }, 0 ); - } -} - jQuery.extend({ - - _mark: function( elem, type ) { - if ( elem ) { - type = ( type || "fx" ) + "mark"; - jQuery._data( elem, type, (jQuery._data( elem, type ) || 0) + 1 ); - } - }, - - _unmark: function( force, elem, type ) { - if ( force !== true ) { - type = elem; - elem = force; - force = false; - } - if ( elem ) { - type = type || "fx"; - var key = type + "mark", - count = force ? 0 : ( (jQuery._data( elem, key ) || 1) - 1 ); - if ( count ) { - jQuery._data( elem, key, count ); - } else { - jQuery.removeData( elem, key, true ); - handleQueueMarkDefer( elem, type, "mark" ); - } - } - }, - queue: function( elem, type, data ) { - var q; + var queue; + if ( elem ) { type = ( type || "fx" ) + "queue"; - q = jQuery._data( elem, type ); + queue = jQuery._data( elem, type ); // Speed up dequeue by getting out quickly if this is just a lookup if ( data ) { - if ( !q || jQuery.isArray(data) ) { - q = jQuery._data( elem, type, jQuery.makeArray(data) ); + if ( !queue || jQuery.isArray(data) ) { + queue = jQuery._data( elem, type, jQuery.makeArray(data) ); } else { - q.push( data ); + queue.push( data ); } } - return q || []; + return queue || []; } }, @@ -2101,31 +1872,46 @@ jQuery.extend({ type = type || "fx"; var queue = jQuery.queue( elem, type ), + startLength = queue.length, fn = queue.shift(), - hooks = {}; + hooks = jQuery._queueHooks( elem, type ), + next = function() { + jQuery.dequeue( elem, type ); + }; // If the fx queue is dequeued, always remove the progress sentinel if ( fn === "inprogress" ) { fn = queue.shift(); + startLength--; } if ( fn ) { + // Add a progress sentinel to prevent the fx queue from being // automatically dequeued if ( type === "fx" ) { queue.unshift( "inprogress" ); } - jQuery._data( elem, type + ".run", hooks ); - fn.call( elem, function() { - jQuery.dequeue( elem, type ); - }, hooks ); + // clear up the last queue stop function + delete hooks.stop; + fn.call( elem, next, hooks ); } - if ( !queue.length ) { - jQuery.removeData( elem, type + "queue " + type + ".run", true ); - handleQueueMarkDefer( elem, type, "queue" ); + if ( !startLength && hooks ) { + hooks.empty.fire(); } + }, + + // not intended for public consumption - generates a queueHooks object, or returns the current one + _queueHooks: function( elem, type ) { + var key = type + "queueHooks"; + return jQuery._data( elem, key ) || jQuery._data( elem, key, { + empty: jQuery.Callbacks("once memory").add(function() { + jQuery.removeData( elem, type + "queue", true ); + jQuery.removeData( elem, key, true ); + }) + }); } }); @@ -2148,6 +1934,9 @@ jQuery.fn.extend({ this.each(function() { var queue = jQuery.queue( this, type, data ); + // ensure a hooks for this queue + jQuery._queueHooks( this, type ); + if ( type === "fx" && queue[0] !== "inprogress" ) { jQuery.dequeue( this, type ); } @@ -2176,51 +1965,43 @@ jQuery.fn.extend({ }, // Get a promise resolved when queues of a certain type // are emptied (fx is the type by default) - promise: function( type, object ) { + promise: function( type, obj ) { + var tmp, + count = 1, + defer = jQuery.Deferred(), + elements = this, + i = this.length, + resolve = function() { + if ( !( --count ) ) { + defer.resolveWith( elements, [ elements ] ); + } + }; + if ( typeof type !== "string" ) { - object = type; + obj = type; type = undefined; } type = type || "fx"; - var defer = jQuery.Deferred(), - elements = this, - i = elements.length, - count = 1, - deferDataKey = type + "defer", - queueDataKey = type + "queue", - markDataKey = type + "mark", - tmp; - function resolve() { - if ( !( --count ) ) { - defer.resolveWith( elements, [ elements ] ); - } - } + while( i-- ) { - if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) || - ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) || - jQuery.data( elements[ i ], markDataKey, undefined, true ) ) && - jQuery.data( elements[ i ], deferDataKey, jQuery.Callbacks( "once memory" ), true ) )) { + tmp = jQuery._data( elements[ i ], type + "queueHooks" ); + if ( tmp && tmp.empty ) { count++; - tmp.add( resolve ); + tmp.empty.add( resolve ); } } resolve(); - return defer.promise( object ); + return defer.promise( obj ); } }); - - - - -var rclass = /[\n\t\r]/g, - rspace = /\s+/, +var nodeHook, boolHook, fixSpecified, + rclass = /[\t\r\n]/g, rreturn = /\r/g, rtype = /^(?:button|input)$/i, rfocusable = /^(?:button|input|object|select|textarea)$/i, - rclickable = /^a(?:rea)?$/i, + rclickable = /^a(?:rea|)$/i, rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, - getSetAttribute = jQuery.support.getSetAttribute, - nodeHook, boolHook, fixSpecified; + getSetAttribute = jQuery.support.getSetAttribute; jQuery.fn.extend({ attr: function( name, value ) { @@ -2259,7 +2040,7 @@ jQuery.fn.extend({ } if ( value && typeof value === "string" ) { - classNames = value.split( rspace ); + classNames = value.split( core_rspace ); for ( i = 0, l = this.length; i < l; i++ ) { elem = this[ i ]; @@ -2272,7 +2053,7 @@ jQuery.fn.extend({ setClass = " " + elem.className + " "; for ( c = 0, cl = classNames.length; c < cl; c++ ) { - if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) { + if ( setClass.indexOf( " " + classNames[ c ] + " " ) < 0 ) { setClass += classNames[ c ] + " "; } } @@ -2286,31 +2067,30 @@ jQuery.fn.extend({ }, removeClass: function( value ) { - var classNames, i, l, elem, className, c, cl; + var removes, className, elem, c, cl, i, l; if ( jQuery.isFunction( value ) ) { return this.each(function( j ) { jQuery( this ).removeClass( value.call(this, j, this.className) ); }); } - if ( (value && typeof value === "string") || value === undefined ) { - classNames = ( value || "" ).split( rspace ); + removes = ( value || "" ).split( core_rspace ); for ( i = 0, l = this.length; i < l; i++ ) { elem = this[ i ]; - if ( elem.nodeType === 1 && elem.className ) { - if ( value ) { - className = (" " + elem.className + " ").replace( rclass, " " ); - for ( c = 0, cl = classNames.length; c < cl; c++ ) { - className = className.replace(" " + classNames[ c ] + " ", " "); - } - elem.className = jQuery.trim( className ); - } else { - elem.className = ""; + className = (" " + elem.className + " ").replace( rclass, " " ); + + // loop over each item in the removal list + for ( c = 0, cl = removes.length; c < cl; c++ ) { + // Remove until there is nothing to remove, + while ( className.indexOf(" " + removes[ c ] + " ") >= 0 ) { + className = className.replace( " " + removes[ c ] + " " , " " ); + } } + elem.className = value ? jQuery.trim( className ) : ""; } } } @@ -2335,10 +2115,10 @@ jQuery.fn.extend({ i = 0, self = jQuery( this ), state = stateVal, - classNames = value.split( rspace ); + classNames = value.split( core_rspace ); while ( (className = classNames[ i++ ]) ) { - // check each className given, space seperated list + // check each className given, space separated list state = isBool ? state : !self.hasClass( className ); self[ state ? "addClass" : "removeClass" ]( className ); } @@ -2360,7 +2140,7 @@ jQuery.fn.extend({ i = 0, l = this.length; for ( ; i < l; i++ ) { - if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) { + if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) { return true; } } @@ -2395,7 +2175,8 @@ jQuery.fn.extend({ isFunction = jQuery.isFunction( value ); return this.each(function( i ) { - var self = jQuery(this), val; + var val, + self = jQuery(this); if ( this.nodeType !== 1 ) { return; @@ -2497,16 +2278,8 @@ jQuery.extend({ } }, - attrFn: { - val: true, - css: true, - html: true, - text: true, - data: true, - width: true, - height: true, - offset: true - }, + // Unused in 1.8, left in so attrFn-stabbers won't die; remove in 1.9 + attrFn: {}, attr: function( elem, name, value, pass ) { var ret, hooks, notxml, @@ -2517,7 +2290,7 @@ jQuery.extend({ return; } - if ( pass && name in jQuery.attrFn ) { + if ( pass && jQuery.isFunction( jQuery.fn[ name ] ) ) { return jQuery( elem )[ name ]( value ); } @@ -2545,7 +2318,7 @@ jQuery.extend({ return ret; } else { - elem.setAttribute( name, "" + value ); + elem.setAttribute( name, value + "" ); return value; } @@ -2564,14 +2337,14 @@ jQuery.extend({ }, removeAttr: function( elem, value ) { - var propName, attrNames, name, l, isBool, + var propName, attrNames, name, isBool, i = 0; if ( value && elem.nodeType === 1 ) { - attrNames = value.toLowerCase().split( rspace ); - l = attrNames.length; - for ( ; i < l; i++ ) { + attrNames = value.split( core_rspace ); + + for ( ; i < attrNames.length; i++ ) { name = attrNames[ i ]; if ( name ) { @@ -2701,9 +2474,6 @@ jQuery.extend({ } }); -// Add the tabIndex propHook to attrHooks for back-compat (different case is intentional) -jQuery.attrHooks.tabindex = jQuery.propHooks.tabIndex; - // Hook for boolean attributes boolHook = { get: function( elem, name ) { @@ -2750,8 +2520,8 @@ if ( !getSetAttribute ) { get: function( elem, name ) { var ret; ret = elem.getAttributeNode( name ); - return ret && ( fixSpecified[ name ] ? ret.nodeValue !== "" : ret.specified ) ? - ret.nodeValue : + return ret && ( fixSpecified[ name ] ? ret.value !== "" : ret.specified ) ? + ret.value : undefined; }, set: function( elem, value, name ) { @@ -2761,13 +2531,10 @@ if ( !getSetAttribute ) { ret = document.createAttribute( name ); elem.setAttributeNode( ret ); } - return ( ret.nodeValue = value + "" ); + return ( ret.value = value + "" ); } }; - // Apply the nodeHook to tabindex - jQuery.attrHooks.tabindex.set = nodeHook.set; - // Set width and height to auto instead of 0 on empty string( Bug #8150 ) // This is for removals jQuery.each([ "width", "height" ], function( i, name ) { @@ -2815,7 +2582,7 @@ if ( !jQuery.support.style ) { return elem.style.cssText.toLowerCase() || undefined; }, set: function( elem, value ) { - return ( elem.style.cssText = "" + value ); + return ( elem.style.cssText = value + "" ); } }; } @@ -2865,35 +2632,12 @@ jQuery.each([ "radio", "checkbox" ], function() { } }); }); - - - - var rformElems = /^(?:textarea|input|select)$/i, - rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/, - rhoverHack = /(?:^|\s)hover(\.\S+)?\b/, + rtypenamespace = /^([^\.]*|)(?:\.(.+)|)$/, + rhoverHack = /(?:^|\s)hover(\.\S+|)\b/, rkeyEvent = /^key/, rmouseEvent = /^(?:mouse|contextmenu)|click/, rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, - rquickIs = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/, - quickParse = function( selector ) { - var quick = rquickIs.exec( selector ); - if ( quick ) { - // 0 1 2 3 - // [ _, tag, id, class ] - quick[1] = ( quick[1] || "" ).toLowerCase(); - quick[3] = quick[3] && new RegExp( "(?:^|\\s)" + quick[3] + "(?:\\s|$)" ); - } - return quick; - }, - quickIs = function( elem, m ) { - var attrs = elem.attributes || {}; - return ( - (!m[1] || elem.nodeName.toLowerCase() === m[1]) && - (!m[2] || (attrs.id || {}).value === m[2]) && - (!m[3] || m[3].test( (attrs[ "class" ] || {}).value )) - ); - }, hoverHack = function( events ) { return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" ); }; @@ -2908,7 +2652,7 @@ jQuery.event = { var elemData, eventHandle, events, t, tns, type, namespaces, handleObj, - handleObjIn, quick, handlers, special; + handleObjIn, handlers, special; // Don't attach events to noData or text/comment nodes (allow plain objects tho) if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) { @@ -2971,7 +2715,7 @@ jQuery.event = { handler: handler, guid: handler.guid, selector: selector, - quick: selector && quickParse( selector ), + needsContext: selector && jQuery.expr.match.needsContext.test( selector ), namespace: namespaces.join(".") }, handleObjIn ); @@ -3021,9 +2765,9 @@ jQuery.event = { // Detach an event or set of events from an element remove: function( elem, types, handler, selector, mappedTypes ) { - var elemData = jQuery.hasData( elem ) && jQuery._data( elem ), - t, tns, type, origType, namespaces, origCount, - j, events, special, handle, eventType, handleObj; + var t, tns, type, origType, namespaces, origCount, + j, events, special, eventType, handleObj, + elemData = jQuery.hasData( elem ) && jQuery._data( elem ); if ( !elemData || !(events = elemData.events) ) { return; @@ -3048,7 +2792,7 @@ jQuery.event = { type = ( selector? special.delegateType : special.bindType ) || type; eventType = events[ type ] || []; origCount = eventType.length; - namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null; + namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.|)") + "(\\.|$)") : null; // Remove matching events for ( j = 0; j < eventType.length; j++ ) { @@ -3072,7 +2816,7 @@ jQuery.event = { // Remove generic event handler if we removed something and no more handlers exist // (avoids potential for endless recursion during removal of special event handlers) if ( eventType.length === 0 && origCount !== eventType.length ) { - if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) { + if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { jQuery.removeEvent( elem, type, elemData.handle ); } @@ -3082,14 +2826,11 @@ jQuery.event = { // Remove the expando if it's no longer used if ( jQuery.isEmptyObject( events ) ) { - handle = elemData.handle; - if ( handle ) { - handle.elem = null; - } + delete elemData.handle; // removeData also checks for emptiness and clears the expando if empty // so use it instead of delete - jQuery.removeData( elem, [ "events", "handle" ], true ); + jQuery.removeData( elem, "events", true ); } }, @@ -3108,9 +2849,9 @@ jQuery.event = { } // Event object or event type - var type = event.type || event, - namespaces = [], - cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType; + var cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType, + type = event.type || event, + namespaces = []; // focus/blur morphs to focusin/out; ensure we're not firing them right now if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { @@ -3148,7 +2889,7 @@ jQuery.event = { event.isTrigger = true; event.exclusive = exclusive; event.namespace = namespaces.join( "." ); - event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)") : null; + event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") : null; ontype = type.indexOf( ":" ) < 0 ? "on" + type : ""; // Handle a global trigger @@ -3187,14 +2928,13 @@ jQuery.event = { bubbleType = special.delegateType || type; cur = rfocusMorph.test( bubbleType + type ) ? elem : elem.parentNode; - old = null; - for ( ; cur; cur = cur.parentNode ) { + for ( old = elem; cur; cur = cur.parentNode ) { eventPath.push([ cur, bubbleType ]); old = cur; } // Only add window if we got to document (e.g., not plain obj or detached DOM) - if ( old && old === elem.ownerDocument ) { + if ( old === (elem.ownerDocument || document) ) { eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]); } } @@ -3211,7 +2951,7 @@ jQuery.event = { } // Note that this is a bare JS function and not a jQuery handler handle = ontype && cur[ ontype ]; - if ( handle && jQuery.acceptData( cur ) && handle.apply( cur, data ) === false ) { + if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) { event.preventDefault(); } } @@ -3256,13 +2996,13 @@ jQuery.event = { // Make a writable jQuery.Event from the native event object event = jQuery.event.fix( event || window.event ); - var handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []), + var i, j, cur, ret, selMatch, matched, matches, handleObj, sel, related, + handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []), delegateCount = handlers.delegateCount, - args = [].slice.call( arguments, 0 ), + args = core_slice.call( arguments ), run_all = !event.exclusive && !event.namespace, special = jQuery.event.special[ event.type ] || {}, - handlerQueue = [], - i, j, cur, jqcur, ret, selMatch, matched, matches, handleObj, sel, related; + handlerQueue = []; // Use the fix-ed jQuery.Event rather than the (read-only) native event args[0] = event; @@ -3277,25 +3017,20 @@ jQuery.event = { // Avoid non-left-click bubbling in Firefox (#3861) if ( delegateCount && !(event.button && event.type === "click") ) { - // Pregenerate a single jQuery object for reuse with .is() - jqcur = jQuery(this); - jqcur.context = this.ownerDocument || this; - for ( cur = event.target; cur != this; cur = cur.parentNode || this ) { - // Don't process events on disabled elements (#6911, #8165) - if ( cur.disabled !== true ) { + // Don't process clicks (ONLY) on disabled elements (#6911, #8165, #11382, #11764) + if ( cur.disabled !== true || event.type !== "click" ) { selMatch = {}; matches = []; - jqcur[0] = cur; for ( i = 0; i < delegateCount; i++ ) { handleObj = handlers[ i ]; sel = handleObj.selector; if ( selMatch[ sel ] === undefined ) { - selMatch[ sel ] = ( - handleObj.quick ? quickIs( cur, handleObj.quick ) : jqcur.is( sel ) - ); + selMatch[ sel ] = handleObj.needsContext ? + jQuery( sel, this ).index( cur ) >= 0 : + jQuery.find( sel, this, null, [ cur ] ).length; } if ( selMatch[ sel ] ) { matches.push( handleObj ); @@ -3429,20 +3164,13 @@ jQuery.event = { event.target = event.target.parentNode; } - // For mouse/key events; add metaKey if it's not there (#3368, IE6/7/8) - if ( event.metaKey === undefined ) { - event.metaKey = event.ctrlKey; - } + // For mouse/key events, metaKey==false if it's undefined (#3368, #11328; IE6/7/8) + event.metaKey = !!event.metaKey; return fixHook.filter? fixHook.filter( event, originalEvent ) : event; }, special: { - ready: { - // Make sure the ready event is setup - setup: jQuery.bindReady - }, - load: { // Prevent triggered image.load events from bubbling to window.load noBubble: true @@ -3505,8 +3233,17 @@ jQuery.removeEvent = document.removeEventListener ? } } : function( elem, type, handle ) { + var name = "on" + type; + if ( elem.detachEvent ) { - elem.detachEvent( "on" + type, handle ); + + // #8545, #7054, preventing memory leaks for custom events in IE6-8 – + // detachEvent needed property on element, by name of that event, to properly expose it to GC + if ( typeof elem[ name ] === "undefined" ) { + elem[ name ] = null; + } + + elem.detachEvent( name, handle ); } }; @@ -3603,11 +3340,11 @@ jQuery.each({ bindType: fix, handle: function( event ) { - var target = this, + var ret, + target = this, related = event.relatedTarget, handleObj = event.handleObj, - selector = handleObj.selector, - ret; + selector = handleObj.selector; // For mousenter/leave call the handler if related is outside the target. // NB: No relatedTarget if the mouse left/entered the browser window @@ -3636,16 +3373,16 @@ if ( !jQuery.support.submitBubbles ) { // Node name check avoids a VML-related crash in IE (#9807) var elem = e.target, form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; - if ( form && !form._submit_attached ) { + if ( form && !jQuery._data( form, "_submit_attached" ) ) { jQuery.event.add( form, "submit._submit", function( event ) { event._submit_bubble = true; }); - form._submit_attached = true; + jQuery._data( form, "_submit_attached", true ); } }); // return undefined since we don't need an event listener }, - + postDispatch: function( event ) { // If form was submitted by the user, bubble the event up the tree if ( event._submit_bubble ) { @@ -3688,8 +3425,9 @@ if ( !jQuery.support.changeBubbles ) { jQuery.event.add( this, "click._change", function( event ) { if ( this._just_changed && !event.isTrigger ) { this._just_changed = false; - jQuery.event.simulate( "change", this, event, true ); } + // Allow triggered, simulated change events (#11500) + jQuery.event.simulate( "change", this, event, true ); }); } return false; @@ -3698,13 +3436,13 @@ if ( !jQuery.support.changeBubbles ) { jQuery.event.add( this, "beforeactivate._change", function( e ) { var elem = e.target; - if ( rformElems.test( elem.nodeName ) && !elem._change_attached ) { + if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "_change_attached" ) ) { jQuery.event.add( elem, "change._change", function( event ) { if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { jQuery.event.simulate( "change", this.parentNode, event, true ); } }); - elem._change_attached = true; + jQuery._data( elem, "_change_attached", true ); } }); }, @@ -3721,7 +3459,7 @@ if ( !jQuery.support.changeBubbles ) { teardown: function() { jQuery.event.remove( this, "._change" ); - return rformElems.test( this.nodeName ); + return !rformElems.test( this.nodeName ); } }; } @@ -3810,9 +3548,10 @@ jQuery.fn.extend({ return this.on( types, selector, data, fn, 1 ); }, off: function( types, selector, fn ) { + var handleObj, type; if ( types && types.preventDefault && types.handleObj ) { // ( event ) dispatched jQuery.Event - var handleObj = types.handleObj; + handleObj = types.handleObj; jQuery( types.delegateTarget ).off( handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, handleObj.selector, @@ -3822,7 +3561,7 @@ jQuery.fn.extend({ } if ( typeof types === "object" ) { // ( types-object [, selector] ) - for ( var type in types ) { + for ( type in types ) { this.off( type, selector, types[ type ] ); } return this; @@ -3861,7 +3600,7 @@ jQuery.fn.extend({ }, undelegate: function( selector, types, fn ) { // ( namespace ) or ( selector, types [, fn] ) - return arguments.length == 1? this.off( selector, "**" ) : this.off( types, selector, fn ); + return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn ); }, trigger: function( type, data ) { @@ -3922,10 +3661,6 @@ jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblcl this.trigger( name ); }; - if ( jQuery.attrFn ) { - jQuery.attrFn[ name ] = true; - } - if ( rkeyEvent.test( name ) ) { jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks; } @@ -3934,1472 +3669,1683 @@ jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblcl jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks; } }); - - - -/*! - * Sizzle CSS Selector Engine - * Copyright 2011, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * More information: http://sizzlejs.com/ - */ -(function(){ - -var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, - expando = "sizcache" + (Math.random() + '').replace('.', ''), - done = 0, - toString = Object.prototype.toString, - hasDuplicate = false, - baseHasDuplicate = true, - rBackslash = /\\/g, - rReturn = /\r\n/g, - rNonWord = /\W/; - -// Here we check if the JavaScript engine is using some sort of -// optimization where it does not always call our comparision -// function. If that is the case, discard the hasDuplicate value. -// Thus far that includes Google Chrome. -[0, 0].sort(function() { - baseHasDuplicate = false; - return 0; -}); - -var Sizzle = function( selector, context, results, seed ) { - results = results || []; - context = context || document; - - var origContext = context; - - if ( context.nodeType !== 1 && context.nodeType !== 9 ) { - return []; - } - - if ( !selector || typeof selector !== "string" ) { - return results; - } - - var m, set, checkSet, extra, ret, cur, pop, i, - prune = true, - contextXML = Sizzle.isXML( context ), - parts = [], - soFar = selector; - - // Reset the position of the chunker regexp (start from head) - do { - chunker.exec( "" ); - m = chunker.exec( soFar ); - - if ( m ) { - soFar = m[3]; - - parts.push( m[1] ); - - if ( m[2] ) { - extra = m[3]; - break; - } - } - } while ( m ); - - if ( parts.length > 1 && origPOS.exec( selector ) ) { - - if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { - set = posProcess( parts[0] + parts[1], context, seed ); - - } else { - set = Expr.relative[ parts[0] ] ? - [ context ] : - Sizzle( parts.shift(), context ); - - while ( parts.length ) { - selector = parts.shift(); - - if ( Expr.relative[ selector ] ) { - selector += parts.shift(); - } - - set = posProcess( selector, set, seed ); - } - } - - } else { - // Take a shortcut and set the context if the root selector is an ID - // (but not if it'll be faster if the inner selector is an ID) - if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && - Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { - - ret = Sizzle.find( parts.shift(), context, contextXML ); - context = ret.expr ? - Sizzle.filter( ret.expr, ret.set )[0] : - ret.set[0]; - } - - if ( context ) { - ret = seed ? - { expr: parts.pop(), set: makeArray(seed) } : - Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); - - set = ret.expr ? - Sizzle.filter( ret.expr, ret.set ) : - ret.set; - - if ( parts.length > 0 ) { - checkSet = makeArray( set ); - - } else { - prune = false; - } - - while ( parts.length ) { - cur = parts.pop(); - pop = cur; - - if ( !Expr.relative[ cur ] ) { - cur = ""; - } else { - pop = parts.pop(); - } - - if ( pop == null ) { - pop = context; - } - - Expr.relative[ cur ]( checkSet, pop, contextXML ); - } - - } else { - checkSet = parts = []; - } - } - - if ( !checkSet ) { - checkSet = set; - } - - if ( !checkSet ) { - Sizzle.error( cur || selector ); - } - - if ( toString.call(checkSet) === "[object Array]" ) { - if ( !prune ) { - results.push.apply( results, checkSet ); - - } else if ( context && context.nodeType === 1 ) { - for ( i = 0; checkSet[i] != null; i++ ) { - if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) { - results.push( set[i] ); - } - } - - } else { - for ( i = 0; checkSet[i] != null; i++ ) { - if ( checkSet[i] && checkSet[i].nodeType === 1 ) { - results.push( set[i] ); - } - } - } - - } else { - makeArray( checkSet, results ); - } - - if ( extra ) { - Sizzle( extra, origContext, results, seed ); - Sizzle.uniqueSort( results ); - } - - return results; -}; - -Sizzle.uniqueSort = function( results ) { - if ( sortOrder ) { - hasDuplicate = baseHasDuplicate; - results.sort( sortOrder ); - - if ( hasDuplicate ) { - for ( var i = 1; i < results.length; i++ ) { - if ( results[i] === results[ i - 1 ] ) { - results.splice( i--, 1 ); - } - } - } - } - - return results; -}; - -Sizzle.matches = function( expr, set ) { - return Sizzle( expr, null, null, set ); -}; - -Sizzle.matchesSelector = function( node, expr ) { - return Sizzle( expr, null, null, [node] ).length > 0; -}; - -Sizzle.find = function( expr, context, isXML ) { - var set, i, len, match, type, left; - - if ( !expr ) { - return []; - } - - for ( i = 0, len = Expr.order.length; i < len; i++ ) { - type = Expr.order[i]; - - if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { - left = match[1]; - match.splice( 1, 1 ); - - if ( left.substr( left.length - 1 ) !== "\\" ) { - match[1] = (match[1] || "").replace( rBackslash, "" ); - set = Expr.find[ type ]( match, context, isXML ); - - if ( set != null ) { - expr = expr.replace( Expr.match[ type ], "" ); - break; - } - } - } - } - - if ( !set ) { - set = typeof context.getElementsByTagName !== "undefined" ? - context.getElementsByTagName( "*" ) : - []; - } - - return { set: set, expr: expr }; -}; - -Sizzle.filter = function( expr, set, inplace, not ) { - var match, anyFound, - type, found, item, filter, left, - i, pass, - old = expr, - result = [], - curLoop = set, - isXMLFilter = set && set[0] && Sizzle.isXML( set[0] ); - - while ( expr && set.length ) { - for ( type in Expr.filter ) { - if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) { - filter = Expr.filter[ type ]; - left = match[1]; - - anyFound = false; - - match.splice(1,1); - - if ( left.substr( left.length - 1 ) === "\\" ) { - continue; - } - - if ( curLoop === result ) { - result = []; - } - - if ( Expr.preFilter[ type ] ) { - match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); - - if ( !match ) { - anyFound = found = true; - - } else if ( match === true ) { - continue; - } - } - - if ( match ) { - for ( i = 0; (item = curLoop[i]) != null; i++ ) { - if ( item ) { - found = filter( item, match, i, curLoop ); - pass = not ^ found; - - if ( inplace && found != null ) { - if ( pass ) { - anyFound = true; - - } else { - curLoop[i] = false; - } - - } else if ( pass ) { - result.push( item ); - anyFound = true; - } - } - } - } - - if ( found !== undefined ) { - if ( !inplace ) { - curLoop = result; - } - - expr = expr.replace( Expr.match[ type ], "" ); - - if ( !anyFound ) { - return []; - } - - break; - } - } - } - - // Improper expression - if ( expr === old ) { - if ( anyFound == null ) { - Sizzle.error( expr ); - - } else { - break; - } - } - - old = expr; - } - - return curLoop; -}; - -Sizzle.error = function( msg ) { - throw new Error( "Syntax error, unrecognized expression: " + msg ); -}; - -/** - * Utility function for retreiving the text value of an array of DOM nodes - * @param {Array|Element} elem - */ -var getText = Sizzle.getText = function( elem ) { - var i, node, - nodeType = elem.nodeType, - ret = ""; - - if ( nodeType ) { - if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { - // Use textContent || innerText for elements - if ( typeof elem.textContent === 'string' ) { - return elem.textContent; - } else if ( typeof elem.innerText === 'string' ) { - // Replace IE's carriage returns - return elem.innerText.replace( rReturn, '' ); - } else { - // Traverse it's children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling) { - ret += getText( elem ); - } - } - } else if ( nodeType === 3 || nodeType === 4 ) { - return elem.nodeValue; - } - } else { - - // If no nodeType, this is expected to be an array - for ( i = 0; (node = elem[i]); i++ ) { - // Do not traverse comment nodes - if ( node.nodeType !== 8 ) { - ret += getText( node ); - } - } - } - return ret; -}; - -var Expr = Sizzle.selectors = { - order: [ "ID", "NAME", "TAG" ], - - match: { - ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, - CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, - NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, - ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/, - TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, - CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/, - POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, - PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ - }, - - leftMatch: {}, - - attrMap: { - "class": "className", - "for": "htmlFor" - }, - - attrHandle: { - href: function( elem ) { - return elem.getAttribute( "href" ); - }, - type: function( elem ) { - return elem.getAttribute( "type" ); - } - }, - - relative: { - "+": function(checkSet, part){ - var isPartStr = typeof part === "string", - isTag = isPartStr && !rNonWord.test( part ), - isPartStrNotTag = isPartStr && !isTag; - - if ( isTag ) { - part = part.toLowerCase(); - } - - for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { - if ( (elem = checkSet[i]) ) { - while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} - - checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? - elem || false : - elem === part; - } - } - - if ( isPartStrNotTag ) { - Sizzle.filter( part, checkSet, true ); - } - }, - - ">": function( checkSet, part ) { - var elem, - isPartStr = typeof part === "string", - i = 0, - l = checkSet.length; - - if ( isPartStr && !rNonWord.test( part ) ) { - part = part.toLowerCase(); - - for ( ; i < l; i++ ) { - elem = checkSet[i]; - - if ( elem ) { - var parent = elem.parentNode; - checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; - } - } - - } else { - for ( ; i < l; i++ ) { - elem = checkSet[i]; - - if ( elem ) { - checkSet[i] = isPartStr ? - elem.parentNode : - elem.parentNode === part; - } - } - - if ( isPartStr ) { - Sizzle.filter( part, checkSet, true ); - } - } - }, - - "": function(checkSet, part, isXML){ - var nodeCheck, - doneName = done++, - checkFn = dirCheck; - - if ( typeof part === "string" && !rNonWord.test( part ) ) { - part = part.toLowerCase(); - nodeCheck = part; - checkFn = dirNodeCheck; - } - - checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML ); - }, - - "~": function( checkSet, part, isXML ) { - var nodeCheck, - doneName = done++, - checkFn = dirCheck; - - if ( typeof part === "string" && !rNonWord.test( part ) ) { - part = part.toLowerCase(); - nodeCheck = part; - checkFn = dirNodeCheck; - } - - checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML ); - } - }, - - find: { - ID: function( match, context, isXML ) { - if ( typeof context.getElementById !== "undefined" && !isXML ) { - var m = context.getElementById(match[1]); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - return m && m.parentNode ? [m] : []; - } - }, - - NAME: function( match, context ) { - if ( typeof context.getElementsByName !== "undefined" ) { - var ret = [], - results = context.getElementsByName( match[1] ); - - for ( var i = 0, l = results.length; i < l; i++ ) { - if ( results[i].getAttribute("name") === match[1] ) { - ret.push( results[i] ); - } - } - - return ret.length === 0 ? null : ret; - } - }, - - TAG: function( match, context ) { - if ( typeof context.getElementsByTagName !== "undefined" ) { - return context.getElementsByTagName( match[1] ); - } - } - }, - preFilter: { - CLASS: function( match, curLoop, inplace, result, not, isXML ) { - match = " " + match[1].replace( rBackslash, "" ) + " "; - - if ( isXML ) { - return match; - } - - for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { - if ( elem ) { - if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) { - if ( !inplace ) { - result.push( elem ); - } - - } else if ( inplace ) { - curLoop[i] = false; - } - } - } - - return false; - }, - - ID: function( match ) { - return match[1].replace( rBackslash, "" ); - }, - - TAG: function( match, curLoop ) { - return match[1].replace( rBackslash, "" ).toLowerCase(); - }, - - CHILD: function( match ) { - if ( match[1] === "nth" ) { - if ( !match[2] ) { - Sizzle.error( match[0] ); - } - - match[2] = match[2].replace(/^\+|\s*/g, ''); - - // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' - var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec( - match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || - !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); - - // calculate the numbers (first)n+(last) including if they are negative - match[2] = (test[1] + (test[2] || 1)) - 0; - match[3] = test[3] - 0; - } - else if ( match[2] ) { - Sizzle.error( match[0] ); - } - - // TODO: Move to normal caching system - match[0] = done++; - - return match; - }, - - ATTR: function( match, curLoop, inplace, result, not, isXML ) { - var name = match[1] = match[1].replace( rBackslash, "" ); - - if ( !isXML && Expr.attrMap[name] ) { - match[1] = Expr.attrMap[name]; - } - - // Handle if an un-quoted value was used - match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" ); - - if ( match[2] === "~=" ) { - match[4] = " " + match[4] + " "; - } - - return match; - }, - - PSEUDO: function( match, curLoop, inplace, result, not ) { - if ( match[1] === "not" ) { - // If we're dealing with a complex expression, or a simple one - if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { - match[3] = Sizzle(match[3], null, null, curLoop); - - } else { - var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); - - if ( !inplace ) { - result.push.apply( result, ret ); - } - - return false; - } - - } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { - return true; - } - - return match; - }, - - POS: function( match ) { - match.unshift( true ); - - return match; - } - }, - - filters: { - enabled: function( elem ) { - return elem.disabled === false && elem.type !== "hidden"; - }, - - disabled: function( elem ) { - return elem.disabled === true; - }, - - checked: function( elem ) { - return elem.checked === true; - }, - - selected: function( elem ) { - // Accessing this property makes selected-by-default - // options in Safari work properly - if ( elem.parentNode ) { - elem.parentNode.selectedIndex; - } - - return elem.selected === true; - }, - - parent: function( elem ) { - return !!elem.firstChild; - }, - - empty: function( elem ) { - return !elem.firstChild; - }, - - has: function( elem, i, match ) { - return !!Sizzle( match[3], elem ).length; - }, - - header: function( elem ) { - return (/h\d/i).test( elem.nodeName ); - }, - - text: function( elem ) { - var attr = elem.getAttribute( "type" ), type = elem.type; - // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) - // use getAttribute instead to test this case - return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null ); - }, - - radio: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type; - }, - - checkbox: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type; - }, - - file: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "file" === elem.type; - }, - - password: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "password" === elem.type; - }, - - submit: function( elem ) { - var name = elem.nodeName.toLowerCase(); - return (name === "input" || name === "button") && "submit" === elem.type; - }, - - image: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "image" === elem.type; - }, - - reset: function( elem ) { - var name = elem.nodeName.toLowerCase(); - return (name === "input" || name === "button") && "reset" === elem.type; - }, - - button: function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && "button" === elem.type || name === "button"; - }, - - input: function( elem ) { - return (/input|select|textarea|button/i).test( elem.nodeName ); - }, - - focus: function( elem ) { - return elem === elem.ownerDocument.activeElement; - } - }, - setFilters: { - first: function( elem, i ) { - return i === 0; - }, - - last: function( elem, i, match, array ) { - return i === array.length - 1; - }, - - even: function( elem, i ) { - return i % 2 === 0; - }, - - odd: function( elem, i ) { - return i % 2 === 1; - }, - - lt: function( elem, i, match ) { - return i < match[3] - 0; - }, - - gt: function( elem, i, match ) { - return i > match[3] - 0; - }, - - nth: function( elem, i, match ) { - return match[3] - 0 === i; - }, - - eq: function( elem, i, match ) { - return match[3] - 0 === i; - } - }, - filter: { - PSEUDO: function( elem, match, i, array ) { - var name = match[1], - filter = Expr.filters[ name ]; - - if ( filter ) { - return filter( elem, i, match, array ); - - } else if ( name === "contains" ) { - return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0; - - } else if ( name === "not" ) { - var not = match[3]; - - for ( var j = 0, l = not.length; j < l; j++ ) { - if ( not[j] === elem ) { - return false; - } - } - - return true; - - } else { - Sizzle.error( name ); - } - }, - - CHILD: function( elem, match ) { - var first, last, - doneName, parent, cache, - count, diff, - type = match[1], - node = elem; - - switch ( type ) { - case "only": - case "first": - while ( (node = node.previousSibling) ) { - if ( node.nodeType === 1 ) { - return false; - } - } - - if ( type === "first" ) { - return true; - } - - node = elem; - - /* falls through */ - case "last": - while ( (node = node.nextSibling) ) { - if ( node.nodeType === 1 ) { - return false; - } - } - - return true; - - case "nth": - first = match[2]; - last = match[3]; - - if ( first === 1 && last === 0 ) { - return true; - } - - doneName = match[0]; - parent = elem.parentNode; - - if ( parent && (parent[ expando ] !== doneName || !elem.nodeIndex) ) { - count = 0; - - for ( node = parent.firstChild; node; node = node.nextSibling ) { - if ( node.nodeType === 1 ) { - node.nodeIndex = ++count; - } - } - - parent[ expando ] = doneName; - } - - diff = elem.nodeIndex - last; - - if ( first === 0 ) { - return diff === 0; - - } else { - return ( diff % first === 0 && diff / first >= 0 ); - } - } - }, - - ID: function( elem, match ) { - return elem.nodeType === 1 && elem.getAttribute("id") === match; - }, - - TAG: function( elem, match ) { - return (match === "*" && elem.nodeType === 1) || !!elem.nodeName && elem.nodeName.toLowerCase() === match; - }, - - CLASS: function( elem, match ) { - return (" " + (elem.className || elem.getAttribute("class")) + " ") - .indexOf( match ) > -1; - }, - - ATTR: function( elem, match ) { - var name = match[1], - result = Sizzle.attr ? - Sizzle.attr( elem, name ) : - Expr.attrHandle[ name ] ? - Expr.attrHandle[ name ]( elem ) : - elem[ name ] != null ? - elem[ name ] : - elem.getAttribute( name ), - value = result + "", - type = match[2], - check = match[4]; - - return result == null ? - type === "!=" : - !type && Sizzle.attr ? - result != null : - type === "=" ? - value === check : - type === "*=" ? - value.indexOf(check) >= 0 : - type === "~=" ? - (" " + value + " ").indexOf(check) >= 0 : - !check ? - value && result !== false : - type === "!=" ? - value !== check : - type === "^=" ? - value.indexOf(check) === 0 : - type === "$=" ? - value.substr(value.length - check.length) === check : - type === "|=" ? - value === check || value.substr(0, check.length + 1) === check + "-" : - false; - }, - - POS: function( elem, match, i, array ) { - var name = match[2], - filter = Expr.setFilters[ name ]; - - if ( filter ) { - return filter( elem, i, match, array ); - } - } - } -}; - -var origPOS = Expr.match.POS, - fescape = function(all, num){ - return "\\" + (num - 0 + 1); - }; - -for ( var type in Expr.match ) { - Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) ); - Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) ); -} -// Expose origPOS -// "global" as in regardless of relation to brackets/parens -Expr.match.globalPOS = origPOS; - -var makeArray = function( array, results ) { - array = Array.prototype.slice.call( array, 0 ); - - if ( results ) { - results.push.apply( results, array ); - return results; - } - - return array; -}; - -// Perform a simple check to determine if the browser is capable of -// converting a NodeList to an array using builtin methods. -// Also verifies that the returned array holds DOM nodes -// (which is not the case in the Blackberry browser) -try { - Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType; - -// Provide a fallback method if it does not work -} catch( e ) { - makeArray = function( array, results ) { - var i = 0, - ret = results || []; - - if ( toString.call(array) === "[object Array]" ) { - Array.prototype.push.apply( ret, array ); - - } else { - if ( typeof array.length === "number" ) { - for ( var l = array.length; i < l; i++ ) { - ret.push( array[i] ); - } - - } else { - for ( ; array[i]; i++ ) { - ret.push( array[i] ); - } - } - } - - return ret; - }; -} - -var sortOrder, siblingCheck; - -if ( document.documentElement.compareDocumentPosition ) { - sortOrder = function( a, b ) { - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { - return a.compareDocumentPosition ? -1 : 1; - } - - return a.compareDocumentPosition(b) & 4 ? -1 : 1; - }; - -} else { - sortOrder = function( a, b ) { - // The nodes are identical, we can exit early - if ( a === b ) { - hasDuplicate = true; - return 0; - - // Fallback to using sourceIndex (in IE) if it's available on both nodes - } else if ( a.sourceIndex && b.sourceIndex ) { - return a.sourceIndex - b.sourceIndex; - } - - var al, bl, - ap = [], - bp = [], - aup = a.parentNode, - bup = b.parentNode, - cur = aup; - - // If the nodes are siblings (or identical) we can do a quick check - if ( aup === bup ) { - return siblingCheck( a, b ); - - // If no parents were found then the nodes are disconnected - } else if ( !aup ) { - return -1; - - } else if ( !bup ) { - return 1; - } - - // Otherwise they're somewhere else in the tree so we need - // to build up a full list of the parentNodes for comparison - while ( cur ) { - ap.unshift( cur ); - cur = cur.parentNode; - } - - cur = bup; - - while ( cur ) { - bp.unshift( cur ); - cur = cur.parentNode; - } - - al = ap.length; - bl = bp.length; - - // Start walking down the tree looking for a discrepancy - for ( var i = 0; i < al && i < bl; i++ ) { - if ( ap[i] !== bp[i] ) { - return siblingCheck( ap[i], bp[i] ); - } - } - - // We ended someplace up the tree so do a sibling check - return i === al ? - siblingCheck( a, bp[i], -1 ) : - siblingCheck( ap[i], b, 1 ); - }; - - siblingCheck = function( a, b, ret ) { - if ( a === b ) { - return ret; - } - - var cur = a.nextSibling; - - while ( cur ) { - if ( cur === b ) { - return -1; - } - - cur = cur.nextSibling; - } - - return 1; - }; -} - -// Check to see if the browser returns elements by name when -// querying by getElementById (and provide a workaround) -(function(){ - // We're going to inject a fake input element with a specified name - var form = document.createElement("div"), - id = "script" + (new Date()).getTime(), - root = document.documentElement; - - form.innerHTML = "<a name='" + id + "'/>"; - - // Inject it into the root element, check its status, and remove it quickly - root.insertBefore( form, root.firstChild ); - - // The workaround has to do additional checks after a getElementById - // Which slows things down for other browsers (hence the branching) - if ( document.getElementById( id ) ) { - Expr.find.ID = function( match, context, isXML ) { - if ( typeof context.getElementById !== "undefined" && !isXML ) { - var m = context.getElementById(match[1]); - - return m ? - m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? - [m] : - undefined : - []; - } - }; - - Expr.filter.ID = function( elem, match ) { - var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); - - return elem.nodeType === 1 && node && node.nodeValue === match; - }; - } - - root.removeChild( form ); - - // release memory in IE - root = form = null; -})(); - -(function(){ - // Check to see if the browser returns only elements - // when doing getElementsByTagName("*") - - // Create a fake element - var div = document.createElement("div"); - div.appendChild( document.createComment("") ); - - // Make sure no comments are found - if ( div.getElementsByTagName("*").length > 0 ) { - Expr.find.TAG = function( match, context ) { - var results = context.getElementsByTagName( match[1] ); - - // Filter out possible comments - if ( match[1] === "*" ) { - var tmp = []; - - for ( var i = 0; results[i]; i++ ) { - if ( results[i].nodeType === 1 ) { - tmp.push( results[i] ); - } - } - - results = tmp; - } - - return results; - }; - } - - // Check to see if an attribute returns normalized href attributes - div.innerHTML = "<a href='#'></a>"; - - if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && - div.firstChild.getAttribute("href") !== "#" ) { - - Expr.attrHandle.href = function( elem ) { - return elem.getAttribute( "href", 2 ); - }; - } - - // release memory in IE - div = null; -})(); - -if ( document.querySelectorAll ) { - (function(){ - var oldSizzle = Sizzle, - div = document.createElement("div"), - id = "__sizzle__"; - - div.innerHTML = "<p class='TEST'></p>"; - - // Safari can't handle uppercase or unicode characters when - // in quirks mode. - if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { - return; - } - - Sizzle = function( query, context, extra, seed ) { - context = context || document; - - // Only use querySelectorAll on non-XML documents - // (ID selectors don't work in non-HTML documents) - if ( !seed && !Sizzle.isXML(context) ) { - // See if we find a selector to speed up - var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query ); - - if ( match && (context.nodeType === 1 || context.nodeType === 9) ) { - // Speed-up: Sizzle("TAG") - if ( match[1] ) { - return makeArray( context.getElementsByTagName( query ), extra ); - - // Speed-up: Sizzle(".CLASS") - } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) { - return makeArray( context.getElementsByClassName( match[2] ), extra ); - } - } - - if ( context.nodeType === 9 ) { - // Speed-up: Sizzle("body") - // The body element only exists once, optimize finding it - if ( query === "body" && context.body ) { - return makeArray( [ context.body ], extra ); - - // Speed-up: Sizzle("#ID") - } else if ( match && match[3] ) { - var elem = context.getElementById( match[3] ); - - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - if ( elem && elem.parentNode ) { - // Handle the case where IE and Opera return items - // by name instead of ID - if ( elem.id === match[3] ) { - return makeArray( [ elem ], extra ); - } - - } else { - return makeArray( [], extra ); - } - } - - try { - return makeArray( context.querySelectorAll(query), extra ); - } catch(qsaError) {} - - // qSA works strangely on Element-rooted queries - // We can work around this by specifying an extra ID on the root - // and working up from there (Thanks to Andrew Dupont for the technique) - // IE 8 doesn't work on object elements - } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { - var oldContext = context, - old = context.getAttribute( "id" ), - nid = old || id, - hasParent = context.parentNode, - relativeHierarchySelector = /^\s*[+~]/.test( query ); - - if ( !old ) { - context.setAttribute( "id", nid ); - } else { - nid = nid.replace( /'/g, "\\$&" ); - } - if ( relativeHierarchySelector && hasParent ) { - context = context.parentNode; - } - - try { - if ( !relativeHierarchySelector || hasParent ) { - return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra ); - } - - } catch(pseudoError) { - } finally { - if ( !old ) { - oldContext.removeAttribute( "id" ); - } - } - } - } - - return oldSizzle(query, context, extra, seed); - }; - - for ( var prop in oldSizzle ) { - Sizzle[ prop ] = oldSizzle[ prop ]; - } - - // release memory in IE - div = null; - })(); -} - -(function(){ - var html = document.documentElement, - matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector; - - if ( matches ) { - // Check to see if it's possible to do matchesSelector - // on a disconnected node (IE 9 fails this) - var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ), - pseudoWorks = false; - - try { - // This should fail with an exception - // Gecko does not error, returns false instead - matches.call( document.documentElement, "[test!='']:sizzle" ); - - } catch( pseudoError ) { - pseudoWorks = true; - } - - Sizzle.matchesSelector = function( node, expr ) { - // Make sure that attribute selectors are quoted - expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); - - if ( !Sizzle.isXML( node ) ) { - try { - if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) { - var ret = matches.call( node, expr ); - - // IE 9's matchesSelector returns false on disconnected nodes - if ( ret || !disconnectedMatch || - // As well, disconnected nodes are said to be in a document - // fragment in IE 9, so check for that - node.document && node.document.nodeType !== 11 ) { - return ret; - } - } - } catch(e) {} - } - - return Sizzle(expr, null, null, [node]).length > 0; - }; - } -})(); - -(function(){ - var div = document.createElement("div"); - - div.innerHTML = "<div class='test e'></div><div class='test'></div>"; - - // Opera can't find a second classname (in 9.6) - // Also, make sure that getElementsByClassName actually exists - if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) { - return; - } - - // Safari caches class attributes, doesn't catch changes (in 3.2) - div.lastChild.className = "e"; - - if ( div.getElementsByClassName("e").length === 1 ) { - return; - } - - Expr.order.splice(1, 0, "CLASS"); - Expr.find.CLASS = function( match, context, isXML ) { - if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { - return context.getElementsByClassName(match[1]); - } - }; - - // release memory in IE - div = null; -})(); - -function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - - if ( elem ) { - var match = false; - - elem = elem[dir]; - - while ( elem ) { - if ( elem[ expando ] === doneName ) { - match = checkSet[elem.sizset]; - break; - } - - if ( elem.nodeType === 1 && !isXML ){ - elem[ expando ] = doneName; - elem.sizset = i; - } - - if ( elem.nodeName.toLowerCase() === cur ) { - match = elem; - break; - } - - elem = elem[dir]; - } - - checkSet[i] = match; - } - } -} - -function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - - if ( elem ) { - var match = false; - - elem = elem[dir]; - - while ( elem ) { - if ( elem[ expando ] === doneName ) { - match = checkSet[elem.sizset]; - break; - } - - if ( elem.nodeType === 1 ) { - if ( !isXML ) { - elem[ expando ] = doneName; - elem.sizset = i; - } - - if ( typeof cur !== "string" ) { - if ( elem === cur ) { - match = true; - break; - } - - } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { - match = elem; - break; - } - } - - elem = elem[dir]; - } - - checkSet[i] = match; - } - } -} - -if ( document.documentElement.contains ) { - Sizzle.contains = function( a, b ) { - return a !== b && (a.contains ? a.contains(b) : true); - }; - -} else if ( document.documentElement.compareDocumentPosition ) { - Sizzle.contains = function( a, b ) { - return !!(a.compareDocumentPosition(b) & 16); - }; - -} else { - Sizzle.contains = function() { - return false; - }; -} - -Sizzle.isXML = function( elem ) { - // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) - var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; - - return documentElement ? documentElement.nodeName !== "HTML" : false; -}; - -var posProcess = function( selector, context, seed ) { - var match, - tmpSet = [], - later = "", - root = context.nodeType ? [context] : context; - - // Position selectors must be done after the filter - // And so must :not(positional) so we move all PSEUDOs to the end - while ( (match = Expr.match.PSEUDO.exec( selector )) ) { - later += match[0]; - selector = selector.replace( Expr.match.PSEUDO, "" ); - } - - selector = Expr.relative[selector] ? selector + "*" : selector; - - for ( var i = 0, l = root.length; i < l; i++ ) { - Sizzle( selector, root[i], tmpSet, seed ); - } - - return Sizzle.filter( later, tmpSet ); -}; - -// EXPOSE +/*!
+ * Sizzle CSS Selector Engine
+ * Copyright 2012 jQuery Foundation and other contributors
+ * Released under the MIT license
+ * http://sizzlejs.com/
+ */
+(function( window, undefined ) {
+
+var cachedruns,
+ assertGetIdNotName,
+ Expr,
+ getText,
+ isXML,
+ contains,
+ compile,
+ sortOrder,
+ hasDuplicate,
+ outermostContext,
+
+ baseHasDuplicate = true,
+ strundefined = "undefined",
+
+ expando = ( "sizcache" + Math.random() ).replace( ".", "" ),
+
+ Token = String,
+ document = window.document,
+ docElem = document.documentElement,
+ dirruns = 0,
+ done = 0,
+ pop = [].pop,
+ push = [].push,
+ slice = [].slice,
+ // Use a stripped-down indexOf if a native one is unavailable
+ indexOf = [].indexOf || function( elem ) {
+ var i = 0,
+ len = this.length;
+ for ( ; i < len; i++ ) {
+ if ( this[i] === elem ) {
+ return i;
+ }
+ }
+ return -1;
+ },
+
+ // Augment a function for special use by Sizzle
+ markFunction = function( fn, value ) {
+ fn[ expando ] = value == null || value;
+ return fn;
+ },
+
+ createCache = function() {
+ var cache = {},
+ keys = [];
+
+ return markFunction(function( key, value ) {
+ // Only keep the most recent entries
+ if ( keys.push( key ) > Expr.cacheLength ) {
+ delete cache[ keys.shift() ];
+ }
+
+ return (cache[ key ] = value);
+ }, cache );
+ },
+
+ classCache = createCache(),
+ tokenCache = createCache(),
+ compilerCache = createCache(),
+
+ // Regex
+
+ // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
+ whitespace = "[\\x20\\t\\r\\n\\f]",
+ // http://www.w3.org/TR/css3-syntax/#characters
+ characterEncoding = "(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",
+
+ // Loosely modeled on CSS identifier characters
+ // An unquoted value should be a CSS identifier (http://www.w3.org/TR/css3-selectors/#attribute-selectors)
+ // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
+ identifier = characterEncoding.replace( "w", "w#" ),
+
+ // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors
+ operators = "([*^$|!~]?=)",
+ attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace +
+ "*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",
+
+ // Prefer arguments not in parens/brackets,
+ // then attribute selectors and non-pseudos (denoted by :),
+ // then anything else
+ // These preferences are here to reduce the number of selectors
+ // needing tokenize in the PSEUDO preFilter
+ pseudos = ":(" + characterEncoding + ")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:" + attributes + ")|[^:]|\\\\.)*|.*))\\)|)",
+
+ // For matchExpr.POS and matchExpr.needsContext
+ pos = ":(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace +
+ "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)",
+
+ // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
+ rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
+
+ rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
+ rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ),
+ rpseudo = new RegExp( pseudos ),
+
+ // Easily-parseable/retrievable ID or TAG or CLASS selectors
+ rquickExpr = /^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,
+
+ rnot = /^:not/,
+ rsibling = /[\x20\t\r\n\f]*[+~]/,
+ rendsWithNot = /:not\($/,
+
+ rheader = /h\d/i,
+ rinputs = /input|select|textarea|button/i,
+
+ rbackslash = /\\(?!\\)/g,
+
+ matchExpr = {
+ "ID": new RegExp( "^#(" + characterEncoding + ")" ),
+ "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
+ "NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ),
+ "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
+ "ATTR": new RegExp( "^" + attributes ),
+ "PSEUDO": new RegExp( "^" + pseudos ),
+ "POS": new RegExp( pos, "i" ),
+ "CHILD": new RegExp( "^:(only|nth|first|last)-child(?:\\(" + whitespace +
+ "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
+ "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
+ // For use in libraries implementing .is()
+ "needsContext": new RegExp( "^" + whitespace + "*[>+~]|" + pos, "i" )
+ },
+
+ // Support
+
+ // Used for testing something on an element
+ assert = function( fn ) {
+ var div = document.createElement("div");
+
+ try {
+ return fn( div );
+ } catch (e) {
+ return false;
+ } finally {
+ // release memory in IE
+ div = null;
+ }
+ },
+
+ // Check if getElementsByTagName("*") returns only elements
+ assertTagNameNoComments = assert(function( div ) {
+ div.appendChild( document.createComment("") );
+ return !div.getElementsByTagName("*").length;
+ }),
+
+ // Check if getAttribute returns normalized href attributes
+ assertHrefNotNormalized = assert(function( div ) {
+ div.innerHTML = "<a href='#'></a>";
+ return div.firstChild && typeof div.firstChild.getAttribute !== strundefined &&
+ div.firstChild.getAttribute("href") === "#";
+ }),
+
+ // Check if attributes should be retrieved by attribute nodes
+ assertAttributes = assert(function( div ) {
+ div.innerHTML = "<select></select>";
+ var type = typeof div.lastChild.getAttribute("multiple");
+ // IE8 returns a string for some attributes even when not present
+ return type !== "boolean" && type !== "string";
+ }),
+
+ // Check if getElementsByClassName can be trusted
+ assertUsableClassName = assert(function( div ) {
+ // Opera can't find a second classname (in 9.6)
+ div.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>";
+ if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) {
+ return false;
+ }
+
+ // Safari 3.2 caches class attributes and doesn't catch changes
+ div.lastChild.className = "e";
+ return div.getElementsByClassName("e").length === 2;
+ }),
+
+ // Check if getElementById returns elements by name
+ // Check if getElementsByName privileges form controls or returns elements by ID
+ assertUsableName = assert(function( div ) {
+ // Inject content
+ div.id = expando + 0;
+ div.innerHTML = "<a name='" + expando + "'></a><div name='" + expando + "'></div>";
+ docElem.insertBefore( div, docElem.firstChild );
+
+ // Test
+ var pass = document.getElementsByName &&
+ // buggy browsers will return fewer than the correct 2
+ document.getElementsByName( expando ).length === 2 +
+ // buggy browsers will return more than the correct 0
+ document.getElementsByName( expando + 0 ).length;
+ assertGetIdNotName = !document.getElementById( expando );
+
+ // Cleanup
+ docElem.removeChild( div );
+
+ return pass;
+ });
+
+// If slice is not available, provide a backup
+try {
+ slice.call( docElem.childNodes, 0 )[0].nodeType;
+} catch ( e ) {
+ slice = function( i ) {
+ var elem,
+ results = [];
+ for ( ; (elem = this[i]); i++ ) {
+ results.push( elem );
+ }
+ return results;
+ };
+}
+
+function Sizzle( selector, context, results, seed ) {
+ results = results || [];
+ context = context || document;
+ var match, elem, xml, m,
+ nodeType = context.nodeType;
+
+ if ( !selector || typeof selector !== "string" ) {
+ return results;
+ }
+
+ if ( nodeType !== 1 && nodeType !== 9 ) {
+ return [];
+ }
+
+ xml = isXML( context );
+
+ if ( !xml && !seed ) {
+ if ( (match = rquickExpr.exec( selector )) ) {
+ // Speed-up: Sizzle("#ID")
+ if ( (m = match[1]) ) {
+ if ( nodeType === 9 ) {
+ elem = context.getElementById( m );
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ if ( elem && elem.parentNode ) {
+ // Handle the case where IE, Opera, and Webkit return items
+ // by name instead of ID
+ if ( elem.id === m ) {
+ results.push( elem );
+ return results;
+ }
+ } else {
+ return results;
+ }
+ } else {
+ // Context is not a document
+ if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
+ contains( context, elem ) && elem.id === m ) {
+ results.push( elem );
+ return results;
+ }
+ }
+
+ // Speed-up: Sizzle("TAG")
+ } else if ( match[2] ) {
+ push.apply( results, slice.call(context.getElementsByTagName( selector ), 0) );
+ return results;
+
+ // Speed-up: Sizzle(".CLASS")
+ } else if ( (m = match[3]) && assertUsableClassName && context.getElementsByClassName ) {
+ push.apply( results, slice.call(context.getElementsByClassName( m ), 0) );
+ return results;
+ }
+ }
+ }
+
+ // All others
+ return select( selector.replace( rtrim, "$1" ), context, results, seed, xml );
+}
+
+Sizzle.matches = function( expr, elements ) {
+ return Sizzle( expr, null, null, elements );
+};
+
+Sizzle.matchesSelector = function( elem, expr ) {
+ return Sizzle( expr, null, null, [ elem ] ).length > 0;
+};
+
+// Returns a function to use in pseudos for input types
+function createInputPseudo( type ) {
+ return function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return name === "input" && elem.type === type;
+ };
+}
+
+// Returns a function to use in pseudos for buttons
+function createButtonPseudo( type ) {
+ return function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return (name === "input" || name === "button") && elem.type === type;
+ };
+}
+
+// Returns a function to use in pseudos for positionals
+function createPositionalPseudo( fn ) {
+ return markFunction(function( argument ) {
+ argument = +argument;
+ return markFunction(function( seed, matches ) {
+ var j,
+ matchIndexes = fn( [], seed.length, argument ),
+ i = matchIndexes.length;
+
+ // Match elements found at the specified indexes
+ while ( i-- ) {
+ if ( seed[ (j = matchIndexes[i]) ] ) {
+ seed[j] = !(matches[j] = seed[j]);
+ }
+ }
+ });
+ });
+}
+
+/**
+ * Utility function for retrieving the text value of an array of DOM nodes
+ * @param {Array|Element} elem
+ */
+getText = Sizzle.getText = function( elem ) {
+ var node,
+ ret = "",
+ i = 0,
+ nodeType = elem.nodeType;
+
+ if ( nodeType ) {
+ if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
+ // Use textContent for elements
+ // innerText usage removed for consistency of new lines (see #11153)
+ if ( typeof elem.textContent === "string" ) {
+ return elem.textContent;
+ } else {
+ // Traverse its children
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
+ ret += getText( elem );
+ }
+ }
+ } else if ( nodeType === 3 || nodeType === 4 ) {
+ return elem.nodeValue;
+ }
+ // Do not include comment or processing instruction nodes
+ } else {
+
+ // If no nodeType, this is expected to be an array
+ for ( ; (node = elem[i]); i++ ) {
+ // Do not traverse comment nodes
+ ret += getText( node );
+ }
+ }
+ return ret;
+};
+
+isXML = Sizzle.isXML = function( elem ) {
+ // documentElement is verified for cases where it doesn't yet exist
+ // (such as loading iframes in IE - #4833)
+ var documentElement = elem && (elem.ownerDocument || elem).documentElement;
+ return documentElement ? documentElement.nodeName !== "HTML" : false;
+};
+
+// Element contains another
+contains = Sizzle.contains = docElem.contains ?
+ function( a, b ) {
+ var adown = a.nodeType === 9 ? a.documentElement : a,
+ bup = b && b.parentNode;
+ return a === bup || !!( bup && bup.nodeType === 1 && adown.contains && adown.contains(bup) );
+ } :
+ docElem.compareDocumentPosition ?
+ function( a, b ) {
+ return b && !!( a.compareDocumentPosition( b ) & 16 );
+ } :
+ function( a, b ) {
+ while ( (b = b.parentNode) ) {
+ if ( b === a ) {
+ return true;
+ }
+ }
+ return false;
+ };
+
+Sizzle.attr = function( elem, name ) {
+ var val,
+ xml = isXML( elem );
+
+ if ( !xml ) {
+ name = name.toLowerCase();
+ }
+ if ( (val = Expr.attrHandle[ name ]) ) {
+ return val( elem );
+ }
+ if ( xml || assertAttributes ) {
+ return elem.getAttribute( name );
+ }
+ val = elem.getAttributeNode( name );
+ return val ?
+ typeof elem[ name ] === "boolean" ?
+ elem[ name ] ? name : null :
+ val.specified ? val.value : null :
+ null;
+};
+
+Expr = Sizzle.selectors = {
+
+ // Can be adjusted by the user
+ cacheLength: 50,
+
+ createPseudo: markFunction,
+
+ match: matchExpr,
+
+ // IE6/7 return a modified href
+ attrHandle: assertHrefNotNormalized ?
+ {} :
+ {
+ "href": function( elem ) {
+ return elem.getAttribute( "href", 2 );
+ },
+ "type": function( elem ) {
+ return elem.getAttribute("type");
+ }
+ },
+
+ find: {
+ "ID": assertGetIdNotName ?
+ function( id, context, xml ) {
+ if ( typeof context.getElementById !== strundefined && !xml ) {
+ var m = context.getElementById( id );
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ return m && m.parentNode ? [m] : [];
+ }
+ } :
+ function( id, context, xml ) {
+ if ( typeof context.getElementById !== strundefined && !xml ) {
+ var m = context.getElementById( id );
+
+ return m ?
+ m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ?
+ [m] :
+ undefined :
+ [];
+ }
+ },
+
+ "TAG": assertTagNameNoComments ?
+ function( tag, context ) {
+ if ( typeof context.getElementsByTagName !== strundefined ) {
+ return context.getElementsByTagName( tag );
+ }
+ } :
+ function( tag, context ) {
+ var results = context.getElementsByTagName( tag );
+
+ // Filter out possible comments
+ if ( tag === "*" ) {
+ var elem,
+ tmp = [],
+ i = 0;
+
+ for ( ; (elem = results[i]); i++ ) {
+ if ( elem.nodeType === 1 ) {
+ tmp.push( elem );
+ }
+ }
+
+ return tmp;
+ }
+ return results;
+ },
+
+ "NAME": assertUsableName && function( tag, context ) {
+ if ( typeof context.getElementsByName !== strundefined ) {
+ return context.getElementsByName( name );
+ }
+ },
+
+ "CLASS": assertUsableClassName && function( className, context, xml ) {
+ if ( typeof context.getElementsByClassName !== strundefined && !xml ) {
+ return context.getElementsByClassName( className );
+ }
+ }
+ },
+
+ relative: {
+ ">": { dir: "parentNode", first: true },
+ " ": { dir: "parentNode" },
+ "+": { dir: "previousSibling", first: true },
+ "~": { dir: "previousSibling" }
+ },
+
+ preFilter: {
+ "ATTR": function( match ) {
+ match[1] = match[1].replace( rbackslash, "" );
+
+ // Move the given value to match[3] whether quoted or unquoted
+ match[3] = ( match[4] || match[5] || "" ).replace( rbackslash, "" );
+
+ if ( match[2] === "~=" ) {
+ match[3] = " " + match[3] + " ";
+ }
+
+ return match.slice( 0, 4 );
+ },
+
+ "CHILD": function( match ) {
+ /* matches from matchExpr["CHILD"]
+ 1 type (only|nth|...)
+ 2 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
+ 3 xn-component of xn+y argument ([+-]?\d*n|)
+ 4 sign of xn-component
+ 5 x of xn-component
+ 6 sign of y-component
+ 7 y of y-component
+ */
+ match[1] = match[1].toLowerCase();
+
+ if ( match[1] === "nth" ) {
+ // nth-child requires argument
+ if ( !match[2] ) {
+ Sizzle.error( match[0] );
+ }
+
+ // numeric x and y parameters for Expr.filter.CHILD
+ // remember that false/true cast respectively to 0/1
+ match[3] = +( match[3] ? match[4] + (match[5] || 1) : 2 * ( match[2] === "even" || match[2] === "odd" ) );
+ match[4] = +( ( match[6] + match[7] ) || match[2] === "odd" );
+
+ // other types prohibit arguments
+ } else if ( match[2] ) {
+ Sizzle.error( match[0] );
+ }
+
+ return match;
+ },
+
+ "PSEUDO": function( match ) {
+ var unquoted, excess;
+ if ( matchExpr["CHILD"].test( match[0] ) ) {
+ return null;
+ }
+
+ if ( match[3] ) {
+ match[2] = match[3];
+ } else if ( (unquoted = match[4]) ) {
+ // Only check arguments that contain a pseudo
+ if ( rpseudo.test(unquoted) &&
+ // Get excess from tokenize (recursively)
+ (excess = tokenize( unquoted, true )) &&
+ // advance to the next closing parenthesis
+ (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
+
+ // excess is a negative index
+ unquoted = unquoted.slice( 0, excess );
+ match[0] = match[0].slice( 0, excess );
+ }
+ match[2] = unquoted;
+ }
+
+ // Return only captures needed by the pseudo filter method (type and argument)
+ return match.slice( 0, 3 );
+ }
+ },
+
+ filter: {
+ "ID": assertGetIdNotName ?
+ function( id ) {
+ id = id.replace( rbackslash, "" );
+ return function( elem ) {
+ return elem.getAttribute("id") === id;
+ };
+ } :
+ function( id ) {
+ id = id.replace( rbackslash, "" );
+ return function( elem ) {
+ var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
+ return node && node.value === id;
+ };
+ },
+
+ "TAG": function( nodeName ) {
+ if ( nodeName === "*" ) {
+ return function() { return true; };
+ }
+ nodeName = nodeName.replace( rbackslash, "" ).toLowerCase();
+
+ return function( elem ) {
+ return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
+ };
+ },
+
+ "CLASS": function( className ) {
+ var pattern = classCache[ expando ][ className ];
+ if ( !pattern ) {
+ pattern = classCache( className, new RegExp("(^|" + whitespace + ")" + className + "(" + whitespace + "|$)") );
+ }
+ return function( elem ) {
+ return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" );
+ };
+ },
+
+ "ATTR": function( name, operator, check ) {
+ return function( elem, context ) {
+ var result = Sizzle.attr( elem, name );
+
+ if ( result == null ) {
+ return operator === "!=";
+ }
+ if ( !operator ) {
+ return true;
+ }
+
+ result += "";
+
+ return operator === "=" ? result === check :
+ operator === "!=" ? result !== check :
+ operator === "^=" ? check && result.indexOf( check ) === 0 :
+ operator === "*=" ? check && result.indexOf( check ) > -1 :
+ operator === "$=" ? check && result.substr( result.length - check.length ) === check :
+ operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
+ operator === "|=" ? result === check || result.substr( 0, check.length + 1 ) === check + "-" :
+ false;
+ };
+ },
+
+ "CHILD": function( type, argument, first, last ) {
+
+ if ( type === "nth" ) {
+ return function( elem ) {
+ var node, diff,
+ parent = elem.parentNode;
+
+ if ( first === 1 && last === 0 ) {
+ return true;
+ }
+
+ if ( parent ) {
+ diff = 0;
+ for ( node = parent.firstChild; node; node = node.nextSibling ) {
+ if ( node.nodeType === 1 ) {
+ diff++;
+ if ( elem === node ) {
+ break;
+ }
+ }
+ }
+ }
+
+ // Incorporate the offset (or cast to NaN), then check against cycle size
+ diff -= last;
+ return diff === first || ( diff % first === 0 && diff / first >= 0 );
+ };
+ }
+
+ return function( elem ) {
+ var node = elem;
+
+ switch ( type ) {
+ case "only":
+ case "first":
+ while ( (node = node.previousSibling) ) {
+ if ( node.nodeType === 1 ) {
+ return false;
+ }
+ }
+
+ if ( type === "first" ) {
+ return true;
+ }
+
+ node = elem;
+
+ /* falls through */
+ case "last":
+ while ( (node = node.nextSibling) ) {
+ if ( node.nodeType === 1 ) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+ };
+ },
+
+ "PSEUDO": function( pseudo, argument ) {
+ // pseudo-class names are case-insensitive
+ // http://www.w3.org/TR/selectors/#pseudo-classes
+ // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
+ // Remember that setFilters inherits from pseudos
+ var args,
+ fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
+ Sizzle.error( "unsupported pseudo: " + pseudo );
+
+ // The user may use createPseudo to indicate that
+ // arguments are needed to create the filter function
+ // just as Sizzle does
+ if ( fn[ expando ] ) {
+ return fn( argument );
+ }
+
+ // But maintain support for old signatures
+ if ( fn.length > 1 ) {
+ args = [ pseudo, pseudo, "", argument ];
+ return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
+ markFunction(function( seed, matches ) {
+ var idx,
+ matched = fn( seed, argument ),
+ i = matched.length;
+ while ( i-- ) {
+ idx = indexOf.call( seed, matched[i] );
+ seed[ idx ] = !( matches[ idx ] = matched[i] );
+ }
+ }) :
+ function( elem ) {
+ return fn( elem, 0, args );
+ };
+ }
+
+ return fn;
+ }
+ },
+
+ pseudos: {
+ "not": markFunction(function( selector ) {
+ // Trim the selector passed to compile
+ // to avoid treating leading and trailing
+ // spaces as combinators
+ var input = [],
+ results = [],
+ matcher = compile( selector.replace( rtrim, "$1" ) );
+
+ return matcher[ expando ] ?
+ markFunction(function( seed, matches, context, xml ) {
+ var elem,
+ unmatched = matcher( seed, null, xml, [] ),
+ i = seed.length;
+
+ // Match elements unmatched by `matcher`
+ while ( i-- ) {
+ if ( (elem = unmatched[i]) ) {
+ seed[i] = !(matches[i] = elem);
+ }
+ }
+ }) :
+ function( elem, context, xml ) {
+ input[0] = elem;
+ matcher( input, null, xml, results );
+ return !results.pop();
+ };
+ }),
+
+ "has": markFunction(function( selector ) {
+ return function( elem ) {
+ return Sizzle( selector, elem ).length > 0;
+ };
+ }),
+
+ "contains": markFunction(function( text ) {
+ return function( elem ) {
+ return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
+ };
+ }),
+
+ "enabled": function( elem ) {
+ return elem.disabled === false;
+ },
+
+ "disabled": function( elem ) {
+ return elem.disabled === true;
+ },
+
+ "checked": function( elem ) {
+ // In CSS3, :checked should return both checked and selected elements
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
+ var nodeName = elem.nodeName.toLowerCase();
+ return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
+ },
+
+ "selected": function( elem ) {
+ // Accessing this property makes selected-by-default
+ // options in Safari work properly
+ if ( elem.parentNode ) {
+ elem.parentNode.selectedIndex;
+ }
+
+ return elem.selected === true;
+ },
+
+ "parent": function( elem ) {
+ return !Expr.pseudos["empty"]( elem );
+ },
+
+ "empty": function( elem ) {
+ // http://www.w3.org/TR/selectors/#empty-pseudo
+ // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),
+ // not comment, processing instructions, or others
+ // Thanks to Diego Perini for the nodeName shortcut
+ // Greater than "@" means alpha characters (specifically not starting with "#" or "?")
+ var nodeType;
+ elem = elem.firstChild;
+ while ( elem ) {
+ if ( elem.nodeName > "@" || (nodeType = elem.nodeType) === 3 || nodeType === 4 ) {
+ return false;
+ }
+ elem = elem.nextSibling;
+ }
+ return true;
+ },
+
+ "header": function( elem ) {
+ return rheader.test( elem.nodeName );
+ },
+
+ "text": function( elem ) {
+ var type, attr;
+ // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
+ // use getAttribute instead to test this case
+ return elem.nodeName.toLowerCase() === "input" &&
+ (type = elem.type) === "text" &&
+ ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === type );
+ },
+
+ // Input types
+ "radio": createInputPseudo("radio"),
+ "checkbox": createInputPseudo("checkbox"),
+ "file": createInputPseudo("file"),
+ "password": createInputPseudo("password"),
+ "image": createInputPseudo("image"),
+
+ "submit": createButtonPseudo("submit"),
+ "reset": createButtonPseudo("reset"),
+
+ "button": function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return name === "input" && elem.type === "button" || name === "button";
+ },
+
+ "input": function( elem ) {
+ return rinputs.test( elem.nodeName );
+ },
+
+ "focus": function( elem ) {
+ var doc = elem.ownerDocument;
+ return elem === doc.activeElement && (!doc.hasFocus || doc.hasFocus()) && !!(elem.type || elem.href);
+ },
+
+ "active": function( elem ) {
+ return elem === elem.ownerDocument.activeElement;
+ },
+
+ // Positional types
+ "first": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ return [ 0 ];
+ }),
+
+ "last": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ return [ length - 1 ];
+ }),
+
+ "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ return [ argument < 0 ? argument + length : argument ];
+ }),
+
+ "even": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ for ( var i = 0; i < length; i += 2 ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "odd": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ for ( var i = 1; i < length; i += 2 ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ for ( var i = argument < 0 ? argument + length : argument; --i >= 0; ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ for ( var i = argument < 0 ? argument + length : argument; ++i < length; ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ })
+ }
+};
+
+function siblingCheck( a, b, ret ) {
+ if ( a === b ) {
+ return ret;
+ }
+
+ var cur = a.nextSibling;
+
+ while ( cur ) {
+ if ( cur === b ) {
+ return -1;
+ }
+
+ cur = cur.nextSibling;
+ }
+
+ return 1;
+}
+
+sortOrder = docElem.compareDocumentPosition ?
+ function( a, b ) {
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+ }
+
+ return ( !a.compareDocumentPosition || !b.compareDocumentPosition ?
+ a.compareDocumentPosition :
+ a.compareDocumentPosition(b) & 4
+ ) ? -1 : 1;
+ } :
+ function( a, b ) {
+ // The nodes are identical, we can exit early
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+
+ // Fallback to using sourceIndex (in IE) if it's available on both nodes
+ } else if ( a.sourceIndex && b.sourceIndex ) {
+ return a.sourceIndex - b.sourceIndex;
+ }
+
+ var al, bl,
+ ap = [],
+ bp = [],
+ aup = a.parentNode,
+ bup = b.parentNode,
+ cur = aup;
+
+ // If the nodes are siblings (or identical) we can do a quick check
+ if ( aup === bup ) {
+ return siblingCheck( a, b );
+
+ // If no parents were found then the nodes are disconnected
+ } else if ( !aup ) {
+ return -1;
+
+ } else if ( !bup ) {
+ return 1;
+ }
+
+ // Otherwise they're somewhere else in the tree so we need
+ // to build up a full list of the parentNodes for comparison
+ while ( cur ) {
+ ap.unshift( cur );
+ cur = cur.parentNode;
+ }
+
+ cur = bup;
+
+ while ( cur ) {
+ bp.unshift( cur );
+ cur = cur.parentNode;
+ }
+
+ al = ap.length;
+ bl = bp.length;
+
+ // Start walking down the tree looking for a discrepancy
+ for ( var i = 0; i < al && i < bl; i++ ) {
+ if ( ap[i] !== bp[i] ) {
+ return siblingCheck( ap[i], bp[i] );
+ }
+ }
+
+ // We ended someplace up the tree so do a sibling check
+ return i === al ?
+ siblingCheck( a, bp[i], -1 ) :
+ siblingCheck( ap[i], b, 1 );
+ };
+
+// Always assume the presence of duplicates if sort doesn't
+// pass them to our comparison function (as in Google Chrome).
+[0, 0].sort( sortOrder );
+baseHasDuplicate = !hasDuplicate;
+
+// Document sorting and removing duplicates
+Sizzle.uniqueSort = function( results ) {
+ var elem,
+ i = 1;
+
+ hasDuplicate = baseHasDuplicate;
+ results.sort( sortOrder );
+
+ if ( hasDuplicate ) {
+ for ( ; (elem = results[i]); i++ ) {
+ if ( elem === results[ i - 1 ] ) {
+ results.splice( i--, 1 );
+ }
+ }
+ }
+
+ return results;
+};
+
+Sizzle.error = function( msg ) {
+ throw new Error( "Syntax error, unrecognized expression: " + msg );
+};
+
+function tokenize( selector, parseOnly ) {
+ var matched, match, tokens, type, soFar, groups, preFilters,
+ cached = tokenCache[ expando ][ selector ];
+
+ if ( cached ) {
+ return parseOnly ? 0 : cached.slice( 0 );
+ }
+
+ soFar = selector;
+ groups = [];
+ preFilters = Expr.preFilter;
+
+ while ( soFar ) {
+
+ // Comma and first run
+ if ( !matched || (match = rcomma.exec( soFar )) ) {
+ if ( match ) {
+ soFar = soFar.slice( match[0].length );
+ }
+ groups.push( tokens = [] );
+ }
+
+ matched = false;
+
+ // Combinators
+ if ( (match = rcombinators.exec( soFar )) ) {
+ tokens.push( matched = new Token( match.shift() ) );
+ soFar = soFar.slice( matched.length );
+
+ // Cast descendant combinators to space
+ matched.type = match[0].replace( rtrim, " " );
+ }
+
+ // Filters
+ for ( type in Expr.filter ) {
+ if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
+ // The last two arguments here are (context, xml) for backCompat
+ (match = preFilters[ type ]( match, document, true ))) ) {
+
+ tokens.push( matched = new Token( match.shift() ) );
+ soFar = soFar.slice( matched.length );
+ matched.type = type;
+ matched.matches = match;
+ }
+ }
+
+ if ( !matched ) {
+ break;
+ }
+ }
+
+ // Return the length of the invalid excess
+ // if we're just parsing
+ // Otherwise, throw an error or return tokens
+ return parseOnly ?
+ soFar.length :
+ soFar ?
+ Sizzle.error( selector ) :
+ // Cache the tokens
+ tokenCache( selector, groups ).slice( 0 );
+}
+
+function addCombinator( matcher, combinator, base ) {
+ var dir = combinator.dir,
+ checkNonElements = base && combinator.dir === "parentNode",
+ doneName = done++;
+
+ return combinator.first ?
+ // Check against closest ancestor/preceding element
+ function( elem, context, xml ) {
+ while ( (elem = elem[ dir ]) ) {
+ if ( checkNonElements || elem.nodeType === 1 ) {
+ return matcher( elem, context, xml );
+ }
+ }
+ } :
+
+ // Check against all ancestor/preceding elements
+ function( elem, context, xml ) {
+ // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
+ if ( !xml ) {
+ var cache,
+ dirkey = dirruns + " " + doneName + " ",
+ cachedkey = dirkey + cachedruns;
+ while ( (elem = elem[ dir ]) ) {
+ if ( checkNonElements || elem.nodeType === 1 ) {
+ if ( (cache = elem[ expando ]) === cachedkey ) {
+ return elem.sizset;
+ } else if ( typeof cache === "string" && cache.indexOf(dirkey) === 0 ) {
+ if ( elem.sizset ) {
+ return elem;
+ }
+ } else {
+ elem[ expando ] = cachedkey;
+ if ( matcher( elem, context, xml ) ) {
+ elem.sizset = true;
+ return elem;
+ }
+ elem.sizset = false;
+ }
+ }
+ }
+ } else {
+ while ( (elem = elem[ dir ]) ) {
+ if ( checkNonElements || elem.nodeType === 1 ) {
+ if ( matcher( elem, context, xml ) ) {
+ return elem;
+ }
+ }
+ }
+ }
+ };
+}
+
+function elementMatcher( matchers ) {
+ return matchers.length > 1 ?
+ function( elem, context, xml ) {
+ var i = matchers.length;
+ while ( i-- ) {
+ if ( !matchers[i]( elem, context, xml ) ) {
+ return false;
+ }
+ }
+ return true;
+ } :
+ matchers[0];
+}
+
+function condense( unmatched, map, filter, context, xml ) {
+ var elem,
+ newUnmatched = [],
+ i = 0,
+ len = unmatched.length,
+ mapped = map != null;
+
+ for ( ; i < len; i++ ) {
+ if ( (elem = unmatched[i]) ) {
+ if ( !filter || filter( elem, context, xml ) ) {
+ newUnmatched.push( elem );
+ if ( mapped ) {
+ map.push( i );
+ }
+ }
+ }
+ }
+
+ return newUnmatched;
+}
+
+function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
+ if ( postFilter && !postFilter[ expando ] ) {
+ postFilter = setMatcher( postFilter );
+ }
+ if ( postFinder && !postFinder[ expando ] ) {
+ postFinder = setMatcher( postFinder, postSelector );
+ }
+ return markFunction(function( seed, results, context, xml ) {
+ // Positional selectors apply to seed elements, so it is invalid to follow them with relative ones
+ if ( seed && postFinder ) {
+ return;
+ }
+
+ var i, elem, postFilterIn,
+ preMap = [],
+ postMap = [],
+ preexisting = results.length,
+
+ // Get initial elements from seed or context
+ elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [], seed ),
+
+ // Prefilter to get matcher input, preserving a map for seed-results synchronization
+ matcherIn = preFilter && ( seed || !selector ) ?
+ condense( elems, preMap, preFilter, context, xml ) :
+ elems,
+
+ matcherOut = matcher ?
+ // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
+ postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
+
+ // ...intermediate processing is necessary
+ [] :
+
+ // ...otherwise use results directly
+ results :
+ matcherIn;
+
+ // Find primary matches
+ if ( matcher ) {
+ matcher( matcherIn, matcherOut, context, xml );
+ }
+
+ // Apply postFilter
+ if ( postFilter ) {
+ postFilterIn = condense( matcherOut, postMap );
+ postFilter( postFilterIn, [], context, xml );
+
+ // Un-match failing elements by moving them back to matcherIn
+ i = postFilterIn.length;
+ while ( i-- ) {
+ if ( (elem = postFilterIn[i]) ) {
+ matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
+ }
+ }
+ }
+
+ // Keep seed and results synchronized
+ if ( seed ) {
+ // Ignore postFinder because it can't coexist with seed
+ i = preFilter && matcherOut.length;
+ while ( i-- ) {
+ if ( (elem = matcherOut[i]) ) {
+ seed[ preMap[i] ] = !(results[ preMap[i] ] = elem);
+ }
+ }
+ } else {
+ matcherOut = condense(
+ matcherOut === results ?
+ matcherOut.splice( preexisting, matcherOut.length ) :
+ matcherOut
+ );
+ if ( postFinder ) {
+ postFinder( null, results, matcherOut, xml );
+ } else {
+ push.apply( results, matcherOut );
+ }
+ }
+ });
+}
+
+function matcherFromTokens( tokens ) {
+ var checkContext, matcher, j,
+ len = tokens.length,
+ leadingRelative = Expr.relative[ tokens[0].type ],
+ implicitRelative = leadingRelative || Expr.relative[" "],
+ i = leadingRelative ? 1 : 0,
+
+ // The foundational matcher ensures that elements are reachable from top-level context(s)
+ matchContext = addCombinator( function( elem ) {
+ return elem === checkContext;
+ }, implicitRelative, true ),
+ matchAnyContext = addCombinator( function( elem ) {
+ return indexOf.call( checkContext, elem ) > -1;
+ }, implicitRelative, true ),
+ matchers = [ function( elem, context, xml ) {
+ return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
+ (checkContext = context).nodeType ?
+ matchContext( elem, context, xml ) :
+ matchAnyContext( elem, context, xml ) );
+ } ];
+
+ for ( ; i < len; i++ ) {
+ if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
+ matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ];
+ } else {
+ // The concatenated values are (context, xml) for backCompat
+ matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
+
+ // Return special upon seeing a positional matcher
+ if ( matcher[ expando ] ) {
+ // Find the next relative operator (if any) for proper handling
+ j = ++i;
+ for ( ; j < len; j++ ) {
+ if ( Expr.relative[ tokens[j].type ] ) {
+ break;
+ }
+ }
+ return setMatcher(
+ i > 1 && elementMatcher( matchers ),
+ i > 1 && tokens.slice( 0, i - 1 ).join("").replace( rtrim, "$1" ),
+ matcher,
+ i < j && matcherFromTokens( tokens.slice( i, j ) ),
+ j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
+ j < len && tokens.join("")
+ );
+ }
+ matchers.push( matcher );
+ }
+ }
+
+ return elementMatcher( matchers );
+}
+
+function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
+ var bySet = setMatchers.length > 0,
+ byElement = elementMatchers.length > 0,
+ superMatcher = function( seed, context, xml, results, expandContext ) {
+ var elem, j, matcher,
+ setMatched = [],
+ matchedCount = 0,
+ i = "0",
+ unmatched = seed && [],
+ outermost = expandContext != null,
+ contextBackup = outermostContext,
+ // We must always have either seed elements or context
+ elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ),
+ // Nested matchers should use non-integer dirruns
+ dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.E);
+
+ if ( outermost ) {
+ outermostContext = context !== document && context;
+ cachedruns = superMatcher.el;
+ }
+
+ // Add elements passing elementMatchers directly to results
+ for ( ; (elem = elems[i]) != null; i++ ) {
+ if ( byElement && elem ) {
+ for ( j = 0; (matcher = elementMatchers[j]); j++ ) {
+ if ( matcher( elem, context, xml ) ) {
+ results.push( elem );
+ break;
+ }
+ }
+ if ( outermost ) {
+ dirruns = dirrunsUnique;
+ cachedruns = ++superMatcher.el;
+ }
+ }
+
+ // Track unmatched elements for set filters
+ if ( bySet ) {
+ // They will have gone through all possible matchers
+ if ( (elem = !matcher && elem) ) {
+ matchedCount--;
+ }
+
+ // Lengthen the array for every element, matched or not
+ if ( seed ) {
+ unmatched.push( elem );
+ }
+ }
+ }
+
+ // Apply set filters to unmatched elements
+ matchedCount += i;
+ if ( bySet && i !== matchedCount ) {
+ for ( j = 0; (matcher = setMatchers[j]); j++ ) {
+ matcher( unmatched, setMatched, context, xml );
+ }
+
+ if ( seed ) {
+ // Reintegrate element matches to eliminate the need for sorting
+ if ( matchedCount > 0 ) {
+ while ( i-- ) {
+ if ( !(unmatched[i] || setMatched[i]) ) {
+ setMatched[i] = pop.call( results );
+ }
+ }
+ }
+
+ // Discard index placeholder values to get only actual matches
+ setMatched = condense( setMatched );
+ }
+
+ // Add matches to results
+ push.apply( results, setMatched );
+
+ // Seedless set matches succeeding multiple successful matchers stipulate sorting
+ if ( outermost && !seed && setMatched.length > 0 &&
+ ( matchedCount + setMatchers.length ) > 1 ) {
+
+ Sizzle.uniqueSort( results );
+ }
+ }
+
+ // Override manipulation of globals by nested matchers
+ if ( outermost ) {
+ dirruns = dirrunsUnique;
+ outermostContext = contextBackup;
+ }
+
+ return unmatched;
+ };
+
+ superMatcher.el = 0;
+ return bySet ?
+ markFunction( superMatcher ) :
+ superMatcher;
+}
+
+compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {
+ var i,
+ setMatchers = [],
+ elementMatchers = [],
+ cached = compilerCache[ expando ][ selector ];
+
+ if ( !cached ) {
+ // Generate a function of recursive functions that can be used to check each element
+ if ( !group ) {
+ group = tokenize( selector );
+ }
+ i = group.length;
+ while ( i-- ) {
+ cached = matcherFromTokens( group[i] );
+ if ( cached[ expando ] ) {
+ setMatchers.push( cached );
+ } else {
+ elementMatchers.push( cached );
+ }
+ }
+
+ // Cache the compiled function
+ cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
+ }
+ return cached;
+};
+
+function multipleContexts( selector, contexts, results, seed ) {
+ var i = 0,
+ len = contexts.length;
+ for ( ; i < len; i++ ) {
+ Sizzle( selector, contexts[i], results, seed );
+ }
+ return results;
+}
+
+function select( selector, context, results, seed, xml ) {
+ var i, tokens, token, type, find,
+ match = tokenize( selector ),
+ j = match.length;
+
+ if ( !seed ) {
+ // Try to minimize operations if there is only one group
+ if ( match.length === 1 ) {
+
+ // Take a shortcut and set the context if the root selector is an ID
+ tokens = match[0] = match[0].slice( 0 );
+ if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
+ context.nodeType === 9 && !xml &&
+ Expr.relative[ tokens[1].type ] ) {
+
+ context = Expr.find["ID"]( token.matches[0].replace( rbackslash, "" ), context, xml )[0];
+ if ( !context ) {
+ return results;
+ }
+
+ selector = selector.slice( tokens.shift().length );
+ }
+
+ // Fetch a seed set for right-to-left matching
+ for ( i = matchExpr["POS"].test( selector ) ? -1 : tokens.length - 1; i >= 0; i-- ) {
+ token = tokens[i];
+
+ // Abort if we hit a combinator
+ if ( Expr.relative[ (type = token.type) ] ) {
+ break;
+ }
+ if ( (find = Expr.find[ type ]) ) {
+ // Search, expanding context for leading sibling combinators
+ if ( (seed = find(
+ token.matches[0].replace( rbackslash, "" ),
+ rsibling.test( tokens[0].type ) && context.parentNode || context,
+ xml
+ )) ) {
+
+ // If seed is empty or no tokens remain, we can return early
+ tokens.splice( i, 1 );
+ selector = seed.length && tokens.join("");
+ if ( !selector ) {
+ push.apply( results, slice.call( seed, 0 ) );
+ return results;
+ }
+
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ // Compile and execute a filtering function
+ // Provide `match` to avoid retokenization if we modified the selector above
+ compile( selector, match )(
+ seed,
+ context,
+ xml,
+ results,
+ rsibling.test( selector )
+ );
+ return results;
+}
+
+if ( document.querySelectorAll ) {
+ (function() {
+ var disconnectedMatch,
+ oldSelect = select,
+ rescape = /'|\\/g,
+ rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,
+
+ // qSa(:focus) reports false when true (Chrome 21),
+ // A support test would require too much code (would include document ready)
+ rbuggyQSA = [":focus"],
+
+ // matchesSelector(:focus) reports false when true (Chrome 21),
+ // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
+ // A support test would require too much code (would include document ready)
+ // just skip matchesSelector for :active
+ rbuggyMatches = [ ":active", ":focus" ],
+ matches = docElem.matchesSelector ||
+ docElem.mozMatchesSelector ||
+ docElem.webkitMatchesSelector ||
+ docElem.oMatchesSelector ||
+ docElem.msMatchesSelector;
+
+ // Build QSA regex
+ // Regex strategy adopted from Diego Perini
+ assert(function( div ) {
+ // Select is set to empty string on purpose
+ // This is to test IE's treatment of not explictly
+ // setting a boolean content attribute,
+ // since its presence should be enough
+ // http://bugs.jquery.com/ticket/12359
+ div.innerHTML = "<select><option selected=''></option></select>";
+
+ // IE8 - Some boolean attributes are not treated correctly
+ if ( !div.querySelectorAll("[selected]").length ) {
+ rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" );
+ }
+
+ // Webkit/Opera - :checked should return selected option elements
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
+ // IE8 throws error here (do not put tests after this one)
+ if ( !div.querySelectorAll(":checked").length ) {
+ rbuggyQSA.push(":checked");
+ }
+ });
+
+ assert(function( div ) {
+
+ // Opera 10-12/IE9 - ^= $= *= and empty values
+ // Should not select anything
+ div.innerHTML = "<p test=''></p>";
+ if ( div.querySelectorAll("[test^='']").length ) {
+ rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" );
+ }
+
+ // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
+ // IE8 throws error here (do not put tests after this one)
+ div.innerHTML = "<input type='hidden'/>";
+ if ( !div.querySelectorAll(":enabled").length ) {
+ rbuggyQSA.push(":enabled", ":disabled");
+ }
+ });
+
+ // rbuggyQSA always contains :focus, so no need for a length check
+ rbuggyQSA = /* rbuggyQSA.length && */ new RegExp( rbuggyQSA.join("|") );
+
+ select = function( selector, context, results, seed, xml ) {
+ // Only use querySelectorAll when not filtering,
+ // when this is not xml,
+ // and when no QSA bugs apply
+ if ( !seed && !xml && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
+ var groups, i,
+ old = true,
+ nid = expando,
+ newContext = context,
+ newSelector = context.nodeType === 9 && selector;
+
+ // qSA works strangely on Element-rooted queries
+ // We can work around this by specifying an extra ID on the root
+ // and working up from there (Thanks to Andrew Dupont for the technique)
+ // IE 8 doesn't work on object elements
+ if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
+ groups = tokenize( selector );
+
+ if ( (old = context.getAttribute("id")) ) {
+ nid = old.replace( rescape, "\\$&" );
+ } else {
+ context.setAttribute( "id", nid );
+ }
+ nid = "[id='" + nid + "'] ";
+
+ i = groups.length;
+ while ( i-- ) {
+ groups[i] = nid + groups[i].join("");
+ }
+ newContext = rsibling.test( selector ) && context.parentNode || context;
+ newSelector = groups.join(",");
+ }
+
+ if ( newSelector ) {
+ try {
+ push.apply( results, slice.call( newContext.querySelectorAll(
+ newSelector
+ ), 0 ) );
+ return results;
+ } catch(qsaError) {
+ } finally {
+ if ( !old ) {
+ context.removeAttribute("id");
+ }
+ }
+ }
+ }
+
+ return oldSelect( selector, context, results, seed, xml );
+ };
+
+ if ( matches ) {
+ assert(function( div ) {
+ // Check to see if it's possible to do matchesSelector
+ // on a disconnected node (IE 9)
+ disconnectedMatch = matches.call( div, "div" );
+
+ // This should fail with an exception
+ // Gecko does not error, returns false instead
+ try {
+ matches.call( div, "[test!='']:sizzle" );
+ rbuggyMatches.push( "!=", pseudos );
+ } catch ( e ) {}
+ });
+
+ // rbuggyMatches always contains :active and :focus, so no need for a length check
+ rbuggyMatches = /* rbuggyMatches.length && */ new RegExp( rbuggyMatches.join("|") );
+
+ Sizzle.matchesSelector = function( elem, expr ) {
+ // Make sure that attribute selectors are quoted
+ expr = expr.replace( rattributeQuotes, "='$1']" );
+
+ // rbuggyMatches always contains :active, so no need for an existence check
+ if ( !isXML( elem ) && !rbuggyMatches.test( expr ) && (!rbuggyQSA || !rbuggyQSA.test( expr )) ) {
+ try {
+ var ret = matches.call( elem, expr );
+
+ // IE 9's matchesSelector returns false on disconnected nodes
+ if ( ret || disconnectedMatch ||
+ // As well, disconnected nodes are said to be in a document
+ // fragment in IE 9
+ elem.document && elem.document.nodeType !== 11 ) {
+ return ret;
+ }
+ } catch(e) {}
+ }
+
+ return Sizzle( expr, null, null, [ elem ] ).length > 0;
+ };
+ }
+ })();
+}
+
+// Deprecated
+Expr.pseudos["nth"] = Expr.pseudos["eq"];
+
+// Back-compat
+function setFilters() {}
+Expr.filters = setFilters.prototype = Expr.pseudos;
+Expr.setFilters = new setFilters();
+
// Override sizzle attribute retrieval Sizzle.attr = jQuery.attr; -Sizzle.selectors.attrMap = {}; jQuery.find = Sizzle; jQuery.expr = Sizzle.selectors; -jQuery.expr[":"] = jQuery.expr.filters; +jQuery.expr[":"] = jQuery.expr.pseudos; jQuery.unique = Sizzle.uniqueSort; jQuery.text = Sizzle.getText; jQuery.isXMLDoc = Sizzle.isXML; jQuery.contains = Sizzle.contains; - - -})(); - - +
+
+})( window );
var runtil = /Until$/, - rparentsprev = /^(?:parents|prevUntil|prevAll)/, - // Note: This RegExp should be improved, or likely pulled from Sizzle - rmultiselector = /,/, + rparentsprev = /^(?:parents|prev(?:Until|All))/, isSimple = /^.[^:#\[\.,]*$/, - slice = Array.prototype.slice, - POS = jQuery.expr.match.globalPOS, + rneedsContext = jQuery.expr.match.needsContext, // methods guaranteed to produce a unique set when starting from a unique set guaranteedUnique = { children: true, @@ -5410,8 +5356,8 @@ var runtil = /Until$/, jQuery.fn.extend({ find: function( selector ) { - var self = this, - i, l; + var i, l, length, n, r, ret, + self = this; if ( typeof selector !== "string" ) { return jQuery( selector ).filter(function() { @@ -5423,8 +5369,7 @@ jQuery.fn.extend({ }); } - var ret = this.pushStack( "", "find", selector ), - length, n, r; + ret = this.pushStack( "", "find", selector ); for ( i = 0, l = this.length; i < l; i++ ) { length = ret.length; @@ -5447,9 +5392,12 @@ jQuery.fn.extend({ }, has: function( target ) { - var targets = jQuery( target ); + var i, + targets = jQuery( target, this ), + len = targets.length; + return this.filter(function() { - for ( var i = 0, l = targets.length; i < l; i++ ) { + for ( i = 0; i < len; i++ ) { if ( jQuery.contains( this, targets[i] ) ) { return true; } @@ -5468,55 +5416,32 @@ jQuery.fn.extend({ is: function( selector ) { return !!selector && ( typeof selector === "string" ? - // If this is a positional selector, check membership in the returned set + // If this is a positional/relative selector, check membership in the returned set // so $("p:first").is("p:last") won't return true for a doc with two "p". - POS.test( selector ) ? + rneedsContext.test( selector ) ? jQuery( selector, this.context ).index( this[0] ) >= 0 : jQuery.filter( selector, this ).length > 0 : this.filter( selector ).length > 0 ); }, closest: function( selectors, context ) { - var ret = [], i, l, cur = this[0]; - - // Array (deprecated as of jQuery 1.7) - if ( jQuery.isArray( selectors ) ) { - var level = 1; - - while ( cur && cur.ownerDocument && cur !== context ) { - for ( i = 0; i < selectors.length; i++ ) { - - if ( jQuery( cur ).is( selectors[ i ] ) ) { - ret.push({ selector: selectors[ i ], elem: cur, level: level }); - } - } - - cur = cur.parentNode; - level++; - } - - return ret; - } - - // String - var pos = POS.test( selectors ) || typeof selectors !== "string" ? + var cur, + i = 0, + l = this.length, + ret = [], + pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? jQuery( selectors, context || this.context ) : 0; - for ( i = 0, l = this.length; i < l; i++ ) { + for ( ; i < l; i++ ) { cur = this[i]; - while ( cur ) { + while ( cur && cur.ownerDocument && cur !== context && cur.nodeType !== 11 ) { if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) { ret.push( cur ); break; - - } else { - cur = cur.parentNode; - if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) { - break; - } } + cur = cur.parentNode; } } @@ -5556,17 +5481,29 @@ jQuery.fn.extend({ jQuery.unique( all ) ); }, - andSelf: function() { - return this.add( this.prevObject ); + addBack: function( selector ) { + return this.add( selector == null ? + this.prevObject : this.prevObject.filter(selector) + ); } }); +jQuery.fn.andSelf = jQuery.fn.addBack; + // A painfully simple check to see if an element is disconnected // from a document (should be improved, where feasible). function isDisconnected( node ) { return !node || !node.parentNode || node.parentNode.nodeType === 11; } +function sibling( cur, dir ) { + do { + cur = cur[ dir ]; + } while ( cur && cur.nodeType !== 1 ); + + return cur; +} + jQuery.each({ parent: function( elem ) { var parent = elem.parentNode; @@ -5579,10 +5516,10 @@ jQuery.each({ return jQuery.dir( elem, "parentNode", until ); }, next: function( elem ) { - return jQuery.nth( elem, 2, "nextSibling" ); + return sibling( elem, "nextSibling" ); }, prev: function( elem ) { - return jQuery.nth( elem, 2, "previousSibling" ); + return sibling( elem, "previousSibling" ); }, nextAll: function( elem ) { return jQuery.dir( elem, "nextSibling" ); @@ -5605,7 +5542,7 @@ jQuery.each({ contents: function( elem ) { return jQuery.nodeName( elem, "iframe" ) ? elem.contentDocument || elem.contentWindow.document : - jQuery.makeArray( elem.childNodes ); + jQuery.merge( [], elem.childNodes ); } }, function( name, fn ) { jQuery.fn[ name ] = function( until, selector ) { @@ -5621,11 +5558,11 @@ jQuery.each({ ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret; - if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) { + if ( this.length > 1 && rparentsprev.test( name ) ) { ret = ret.reverse(); } - return this.pushStack( ret, name, slice.call( arguments ).join(",") ); + return this.pushStack( ret, name, core_slice.call( arguments ).join(",") ); }; }); @@ -5653,19 +5590,6 @@ jQuery.extend({ return matched; }, - nth: function( cur, result, dir, elem ) { - result = result || 1; - var num = 0; - - for ( ; cur; cur = cur[dir] ) { - if ( cur.nodeType === 1 && ++num === result ) { - break; - } - } - - return cur; - }, - sibling: function( n, elem ) { var r = []; @@ -5713,10 +5637,6 @@ function winnow( elements, qualifier, keep ) { return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep; }); } - - - - function createSafeFragment( document ) { var list = nodeNames.split( "|" ), safeFrag = document.createDocumentFragment(); @@ -5733,19 +5653,20 @@ function createSafeFragment( document ) { var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", - rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, + rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, rleadingWhitespace = /^\s+/, - rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig, + rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, rtagName = /<([\w:]+)/, rtbody = /<tbody/i, rhtml = /<|&#?\w+;/, - rnoInnerhtml = /<(?:script|style)/i, + rnoInnerhtml = /<(?:script|style|link)/i, rnocache = /<(?:script|object|embed|option|style)/i, rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), + rcheckableType = /^(?:checkbox|radio)$/, // checked="checked" or checked rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, rscriptType = /\/(java|ecma)script/i, - rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)/, + rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g, wrapMap = { option: [ 1, "<select multiple='multiple'>", "</select>" ], legend: [ 1, "<fieldset>", "</fieldset>" ], @@ -5756,15 +5677,17 @@ var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figca area: [ 1, "<map>", "</map>" ], _default: [ 0, "", "" ] }, - safeFragment = createSafeFragment( document ); + safeFragment = createSafeFragment( document ), + fragmentDiv = safeFragment.appendChild( document.createElement("div") ); wrapMap.optgroup = wrapMap.option; wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; wrapMap.th = wrapMap.td; -// IE can't serialize <link> and <script> tags normally +// IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, +// unless wrapped in a div with non-breaking characters in front of it. if ( !jQuery.support.htmlSerialize ) { - wrapMap._default = [ 1, "div<div>", "</div>" ]; + wrapMap._default = [ 1, "X<div>", "</div>" ]; } jQuery.fn.extend({ @@ -5843,7 +5766,7 @@ jQuery.fn.extend({ append: function() { return this.domManip(arguments, true, function( elem ) { - if ( this.nodeType === 1 ) { + if ( this.nodeType === 1 || this.nodeType === 11 ) { this.appendChild( elem ); } }); @@ -5851,39 +5774,44 @@ jQuery.fn.extend({ prepend: function() { return this.domManip(arguments, true, function( elem ) { - if ( this.nodeType === 1 ) { + if ( this.nodeType === 1 || this.nodeType === 11 ) { this.insertBefore( elem, this.firstChild ); } }); }, before: function() { - if ( this[0] && this[0].parentNode ) { + if ( !isDisconnected( this[0] ) ) { return this.domManip(arguments, false, function( elem ) { this.parentNode.insertBefore( elem, this ); }); - } else if ( arguments.length ) { + } + + if ( arguments.length ) { var set = jQuery.clean( arguments ); - set.push.apply( set, this.toArray() ); - return this.pushStack( set, "before", arguments ); + return this.pushStack( jQuery.merge( set, this ), "before", this.selector ); } }, after: function() { - if ( this[0] && this[0].parentNode ) { + if ( !isDisconnected( this[0] ) ) { return this.domManip(arguments, false, function( elem ) { this.parentNode.insertBefore( elem, this.nextSibling ); }); - } else if ( arguments.length ) { - var set = this.pushStack( this, "after", arguments ); - set.push.apply( set, jQuery.clean(arguments) ); - return set; + } + + if ( arguments.length ) { + var set = jQuery.clean( arguments ); + return this.pushStack( jQuery.merge( this, set ), "after", this.selector ); } }, // keepData is for internal use only--do not document remove: function( selector, keepData ) { - for ( var i = 0, elem; (elem = this[i]) != null; i++ ) { + var elem, + i = 0; + + for ( ; (elem = this[i]) != null; i++ ) { if ( !selector || jQuery.filter( selector, [ elem ] ).length ) { if ( !keepData && elem.nodeType === 1 ) { jQuery.cleanData( elem.getElementsByTagName("*") ); @@ -5900,7 +5828,10 @@ jQuery.fn.extend({ }, empty: function() { - for ( var i = 0, elem; (elem = this[i]) != null; i++ ) { + var elem, + i = 0; + + for ( ; (elem = this[i]) != null; i++ ) { // Remove element nodes and prevent memory leaks if ( elem.nodeType === 1 ) { jQuery.cleanData( elem.getElementsByTagName("*") ); @@ -5933,11 +5864,12 @@ jQuery.fn.extend({ if ( value === undefined ) { return elem.nodeType === 1 ? elem.innerHTML.replace( rinlinejQuery, "" ) : - null; + undefined; } - + // See if we can take a shortcut and just use innerHTML if ( typeof value === "string" && !rnoInnerhtml.test( value ) && + ( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) && ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) { @@ -5966,7 +5898,7 @@ jQuery.fn.extend({ }, replaceWith: function( value ) { - if ( this[0] && this[0].parentNode ) { + if ( !isDisconnected( this[0] ) ) { // Make sure that the elements are removed from the DOM before they are inserted // this can help fix replacing a parent with child elements if ( jQuery.isFunction( value ) ) { @@ -5992,11 +5924,11 @@ jQuery.fn.extend({ jQuery(parent).append( value ); } }); - } else { - return this.length ? - this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) : - this; } + + return this.length ? + this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) : + this; }, detach: function( selector ) { @@ -6004,78 +5936,78 @@ jQuery.fn.extend({ }, domManip: function( args, table, callback ) { - var results, first, fragment, parent, + + // Flatten any nested arrays + args = [].concat.apply( [], args ); + + var results, first, fragment, iNoClone, + i = 0, value = args[0], - scripts = []; + scripts = [], + l = this.length; // We can't cloneNode fragments that contain checked, in WebKit - if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) { + if ( !jQuery.support.checkClone && l > 1 && typeof value === "string" && rchecked.test( value ) ) { return this.each(function() { - jQuery(this).domManip( args, table, callback, true ); + jQuery(this).domManip( args, table, callback ); }); } if ( jQuery.isFunction(value) ) { return this.each(function(i) { var self = jQuery(this); - args[0] = value.call(this, i, table ? self.html() : undefined); + args[0] = value.call( this, i, table ? self.html() : undefined ); self.domManip( args, table, callback ); }); } if ( this[0] ) { - parent = value && value.parentNode; - - // If we're in a fragment, just use that instead of building a new one - if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) { - results = { fragment: parent }; - - } else { - results = jQuery.buildFragment( args, this, scripts ); - } - + results = jQuery.buildFragment( args, this, scripts ); fragment = results.fragment; + first = fragment.firstChild; if ( fragment.childNodes.length === 1 ) { - first = fragment = fragment.firstChild; - } else { - first = fragment.firstChild; + fragment = first; } if ( first ) { table = table && jQuery.nodeName( first, "tr" ); - for ( var i = 0, l = this.length, lastIndex = l - 1; i < l; i++ ) { + // Use the original fragment for the last item instead of the first because it can end up + // being emptied incorrectly in certain situations (#8070). + // Fragments from the fragment cache must always be cloned and never used in place. + for ( iNoClone = results.cacheable || l - 1; i < l; i++ ) { callback.call( - table ? - root(this[i], first) : + table && jQuery.nodeName( this[i], "table" ) ? + findOrAppend( this[i], "tbody" ) : this[i], - // Make sure that we do not leak memory by inadvertently discarding - // the original fragment (which might have attached data) instead of - // using it; in addition, use the original fragment object for the last - // item instead of first because it can end up being emptied incorrectly - // in certain situations (Bug #8070). - // Fragments from the fragment cache must always be cloned and never used - // in place. - results.cacheable || ( l > 1 && i < lastIndex ) ? - jQuery.clone( fragment, true, true ) : - fragment + i === iNoClone ? + fragment : + jQuery.clone( fragment, true, true ) ); } } + // Fix #11809: Avoid leaking memory + fragment = first = null; + if ( scripts.length ) { jQuery.each( scripts, function( i, elem ) { if ( elem.src ) { - jQuery.ajax({ - type: "GET", - global: false, - url: elem.src, - async: false, - dataType: "script" - }); + if ( jQuery.ajax ) { + jQuery.ajax({ + url: elem.src, + type: "GET", + dataType: "script", + async: false, + global: false, + "throws": true + }); + } else { + jQuery.error("no ajax"); + } } else { - jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "/*$0*/" ) ); + jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "" ) ); } if ( elem.parentNode ) { @@ -6089,11 +6021,8 @@ jQuery.fn.extend({ } }); -function root( elem, cur ) { - return jQuery.nodeName(elem, "table") ? - (elem.getElementsByTagName("tbody")[0] || - elem.appendChild(elem.ownerDocument.createElement("tbody"))) : - elem; +function findOrAppend( elem, tag ) { + return elem.getElementsByTagName( tag )[0] || elem.appendChild( elem.ownerDocument.createElement( tag ) ); } function cloneCopyEvent( src, dest ) { @@ -6146,19 +6075,27 @@ function cloneFixAttributes( src, dest ) { nodeName = dest.nodeName.toLowerCase(); - // IE6-8 fail to clone children inside object elements that use - // the proprietary classid attribute value (rather than the type - // attribute) to identify the type of content to display if ( nodeName === "object" ) { - dest.outerHTML = src.outerHTML; + // IE6-10 improperly clones children of object elements using classid. + // IE10 throws NoModificationAllowedError if parent is null, #12132. + if ( dest.parentNode ) { + dest.outerHTML = src.outerHTML; + } + + // This path appears unavoidable for IE9. When cloning an object + // element in IE9, the outerHTML strategy above is not sufficient. + // If the src has innerHTML and the destination does not, + // copy the src.innerHTML into the dest.innerHTML. #10324 + if ( jQuery.support.html5Clone && (src.innerHTML && !jQuery.trim(dest.innerHTML)) ) { + dest.innerHTML = src.innerHTML; + } - } else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) { + } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) { // IE6-8 fails to persist the checked state of a cloned checkbox // or radio button. Worse, IE6-7 fail to give the cloned element // a checked appearance if the defaultChecked value isn't also set - if ( src.checked ) { - dest.defaultChecked = dest.checked = src.checked; - } + + dest.defaultChecked = dest.checked = src.checked; // IE6-7 get confused and end up setting the value of a cloned // checkbox/radio button to an empty string instead of "on" @@ -6184,56 +6121,44 @@ function cloneFixAttributes( src, dest ) { // Event data gets referenced instead of copied if the expando // gets copied too dest.removeAttribute( jQuery.expando ); - - // Clear flags for bubbling special change/submit events, they must - // be reattached when the newly cloned events are first activated - dest.removeAttribute( "_submit_attached" ); - dest.removeAttribute( "_change_attached" ); } -jQuery.buildFragment = function( args, nodes, scripts ) { - var fragment, cacheable, cacheresults, doc, - first = args[ 0 ]; +jQuery.buildFragment = function( args, context, scripts ) { + var fragment, cacheable, cachehit, + first = args[ 0 ]; - // nodes may contain either an explicit document object, - // a jQuery collection or context object. - // If nodes[0] contains a valid object to assign to doc - if ( nodes && nodes[0] ) { - doc = nodes[0].ownerDocument || nodes[0]; - } - - // Ensure that an attr object doesn't incorrectly stand in as a document object - // Chrome and Firefox seem to allow this to occur and will throw exception - // Fixes #8950 - if ( !doc.createDocumentFragment ) { - doc = document; - } + // Set context from what may come in as undefined or a jQuery collection or a node + // Updated to fix #12266 where accessing context[0] could throw an exception in IE9/10 & + // also doubles as fix for #8950 where plain objects caused createDocumentFragment exception + context = context || document; + context = !context.nodeType && context[0] || context; + context = context.ownerDocument || context; // Only cache "small" (1/2 KB) HTML strings that are associated with the main document // Cloning options loses the selected state, so don't cache them // IE 6 doesn't like it when you put <object> or <embed> elements in a fragment // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache // Lastly, IE6,7,8 will not correctly reuse cached fragments that were created from unknown elems #10501 - if ( args.length === 1 && typeof first === "string" && first.length < 512 && doc === document && + if ( args.length === 1 && typeof first === "string" && first.length < 512 && context === document && first.charAt(0) === "<" && !rnocache.test( first ) && (jQuery.support.checkClone || !rchecked.test( first )) && (jQuery.support.html5Clone || !rnoshimcache.test( first )) ) { + // Mark cacheable and look for a hit cacheable = true; - - cacheresults = jQuery.fragments[ first ]; - if ( cacheresults && cacheresults !== 1 ) { - fragment = cacheresults; - } + fragment = jQuery.fragments[ first ]; + cachehit = fragment !== undefined; } if ( !fragment ) { - fragment = doc.createDocumentFragment(); - jQuery.clean( args, doc, fragment, scripts ); - } + fragment = context.createDocumentFragment(); + jQuery.clean( args, context, fragment, scripts ); - if ( cacheable ) { - jQuery.fragments[ first ] = cacheresults ? fragment : 1; + // Update the cache, but only store false + // unless this is a second parsing of the same content + if ( cacheable ) { + jQuery.fragments[ first ] = cachehit && fragment; + } } return { fragment: fragment, cacheable: cacheable }; @@ -6249,17 +6174,19 @@ jQuery.each({ replaceAll: "replaceWith" }, function( name, original ) { jQuery.fn[ name ] = function( selector ) { - var ret = [], + var elems, + i = 0, + ret = [], insert = jQuery( selector ), + l = insert.length, parent = this.length === 1 && this[0].parentNode; - if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) { + if ( (parent == null || parent && parent.nodeType === 11 && parent.childNodes.length === 1) && l === 1 ) { insert[ original ]( this[0] ); return this; - } else { - for ( var i = 0, l = insert.length; i < l; i++ ) { - var elems = ( i > 0 ? this.clone(true) : this ).get(); + for ( ; i < l; i++ ) { + elems = ( i > 0 ? this.clone(true) : this ).get(); jQuery( insert[i] )[ original ]( elems ); ret = ret.concat( elems ); } @@ -6283,39 +6210,26 @@ function getAll( elem ) { // Used in clean, fixes the defaultChecked property function fixDefaultChecked( elem ) { - if ( elem.type === "checkbox" || elem.type === "radio" ) { + if ( rcheckableType.test( elem.type ) ) { elem.defaultChecked = elem.checked; } } -// Finds all inputs and passes them to fixDefaultChecked -function findInputs( elem ) { - var nodeName = ( elem.nodeName || "" ).toLowerCase(); - if ( nodeName === "input" ) { - fixDefaultChecked( elem ); - // Skip scripts, get other children - } else if ( nodeName !== "script" && typeof elem.getElementsByTagName !== "undefined" ) { - jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked ); - } -} - -// Derived From: http://www.iecss.com/shimprove/javascript/shimprove.1-0-1.js -function shimCloneNode( elem ) { - var div = document.createElement( "div" ); - safeFragment.appendChild( div ); - - div.innerHTML = elem.outerHTML; - return div.firstChild; -} jQuery.extend({ clone: function( elem, dataAndEvents, deepDataAndEvents ) { var srcElements, destElements, i, - // IE<=8 does not properly clone detached, unknown element nodes - clone = jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ? - elem.cloneNode( true ) : - shimCloneNode( elem ); + clone; + + if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { + clone = elem.cloneNode( true ); + + // IE<=8 does not properly clone detached, unknown element nodes + } else { + fragmentDiv.innerHTML = elem.outerHTML; + fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); + } if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { @@ -6363,17 +6277,17 @@ jQuery.extend({ }, clean: function( elems, context, fragment, scripts ) { - var checkScriptType, script, j, - ret = []; - - context = context || document; + var i, j, elem, tag, wrap, depth, div, hasBody, tbody, len, handleScript, jsTags, + safe = context === document && safeFragment, + ret = []; - // !context.createElement fails in IE with an error but returns typeof 'object' - if ( typeof context.createElement === "undefined" ) { - context = context.ownerDocument || context[0] && context[0].ownerDocument || document; + // Ensure that context is a document + if ( !context || typeof context.createDocumentFragment === "undefined" ) { + context = document; } - for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { + // Use the already-created safe fragment if context permits + for ( i = 0; (elem = elems[i]) != null; i++ ) { if ( typeof elem === "number" ) { elem += ""; } @@ -6387,27 +6301,18 @@ jQuery.extend({ if ( !rhtml.test( elem ) ) { elem = context.createTextNode( elem ); } else { + // Ensure a safe container in which to render the html + safe = safe || createSafeFragment( context ); + div = context.createElement("div"); + safe.appendChild( div ); + // Fix "XHTML"-style tags in all browsers elem = elem.replace(rxhtmlTag, "<$1></$2>"); - // Trim whitespace, otherwise indexOf won't work as expected - var tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(), - wrap = wrapMap[ tag ] || wrapMap._default, - depth = wrap[0], - div = context.createElement("div"), - safeChildNodes = safeFragment.childNodes, - remove; - - // Append wrapper element to unknown element safe doc fragment - if ( context === document ) { - // Use the fragment we've already created for this document - safeFragment.appendChild( div ); - } else { - // Use a fragment created with the owner document - createSafeFragment( context ).appendChild( div ); - } - // Go to html and back, then peel off extra wrappers + tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(); + wrap = wrapMap[ tag ] || wrapMap._default; + depth = wrap[0]; div.innerHTML = wrap[1] + elem + wrap[2]; // Move to the right depth @@ -6419,7 +6324,7 @@ jQuery.extend({ if ( !jQuery.support.tbody ) { // String was a <table>, *may* have spurious <tbody> - var hasBody = rtbody.test(elem), + hasBody = rtbody.test(elem); tbody = tag === "table" && !hasBody ? div.firstChild && div.firstChild.childNodes : @@ -6442,59 +6347,62 @@ jQuery.extend({ elem = div.childNodes; - // Clear elements from DocumentFragment (safeFragment or otherwise) - // to avoid hoarding elements. Fixes #11356 - if ( div ) { - div.parentNode.removeChild( div ); - - // Guard against -1 index exceptions in FF3.6 - if ( safeChildNodes.length > 0 ) { - remove = safeChildNodes[ safeChildNodes.length - 1 ]; - - if ( remove && remove.parentNode ) { - remove.parentNode.removeChild( remove ); - } - } - } - } - } - - // Resets defaultChecked for any radios and checkboxes - // about to be appended to the DOM in IE 6/7 (#8060) - var len; - if ( !jQuery.support.appendChecked ) { - if ( elem[0] && typeof (len = elem.length) === "number" ) { - for ( j = 0; j < len; j++ ) { - findInputs( elem[j] ); - } - } else { - findInputs( elem ); + // Take out of fragment container (we need a fresh div each time) + div.parentNode.removeChild( div ); } } if ( elem.nodeType ) { ret.push( elem ); } else { - ret = jQuery.merge( ret, elem ); + jQuery.merge( ret, elem ); } } + // Fix #11356: Clear elements from safeFragment + if ( div ) { + elem = div = safe = null; + } + + // Reset defaultChecked for any radios and checkboxes + // about to be appended to the DOM in IE 6/7 (#8060) + if ( !jQuery.support.appendChecked ) { + for ( i = 0; (elem = ret[i]) != null; i++ ) { + if ( jQuery.nodeName( elem, "input" ) ) { + fixDefaultChecked( elem ); + } else if ( typeof elem.getElementsByTagName !== "undefined" ) { + jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked ); + } + } + } + + // Append elements to a provided document fragment if ( fragment ) { - checkScriptType = function( elem ) { - return !elem.type || rscriptType.test( elem.type ); + // Special handling of each script element + handleScript = function( elem ) { + // Check if we consider it executable + if ( !elem.type || rscriptType.test( elem.type ) ) { + // Detach the script and store it in the scripts array (if provided) or the fragment + // Return truthy to indicate that it has been handled + return scripts ? + scripts.push( elem.parentNode ? elem.parentNode.removeChild( elem ) : elem ) : + fragment.appendChild( elem ); + } }; - for ( i = 0; ret[i]; i++ ) { - script = ret[i]; - if ( scripts && jQuery.nodeName( script, "script" ) && (!script.type || rscriptType.test( script.type )) ) { - scripts.push( script.parentNode ? script.parentNode.removeChild( script ) : script ); - } else { - if ( script.nodeType === 1 ) { - var jsTags = jQuery.grep( script.getElementsByTagName( "script" ), checkScriptType ); + for ( i = 0; (elem = ret[i]) != null; i++ ) { + // Check if we're done after handling an executable script + if ( !( jQuery.nodeName( elem, "script" ) && handleScript( elem ) ) ) { + // Append to fragment and handle embedded scripts + fragment.appendChild( elem ); + if ( typeof elem.getElementsByTagName !== "undefined" ) { + // handleScript alters the DOM, so use jQuery.merge to ensure snapshot iteration + jsTags = jQuery.grep( jQuery.merge( [], elem.getElementsByTagName("script") ), handleScript ); + // Splice the scripts into ret after their former ancestor and advance our index beyond them ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) ); + i += jsTags.length; } - fragment.appendChild( script ); } } } @@ -6502,81 +6410,253 @@ jQuery.extend({ return ret; }, - cleanData: function( elems ) { - var data, id, + cleanData: function( elems, /* internal */ acceptData ) { + var data, id, elem, type, + i = 0, + internalKey = jQuery.expando, cache = jQuery.cache, - special = jQuery.event.special, - deleteExpando = jQuery.support.deleteExpando; + deleteExpando = jQuery.support.deleteExpando, + special = jQuery.event.special; - for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { - if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) { - continue; - } + for ( ; (elem = elems[i]) != null; i++ ) { - id = elem[ jQuery.expando ]; + if ( acceptData || jQuery.acceptData( elem ) ) { - if ( id ) { - data = cache[ id ]; + id = elem[ internalKey ]; + data = id && cache[ id ]; - if ( data && data.events ) { - for ( var type in data.events ) { - if ( special[ type ] ) { - jQuery.event.remove( elem, type ); + if ( data ) { + if ( data.events ) { + for ( type in data.events ) { + if ( special[ type ] ) { + jQuery.event.remove( elem, type ); - // This is a shortcut to avoid jQuery.event.remove's overhead - } else { - jQuery.removeEvent( elem, type, data.handle ); + // This is a shortcut to avoid jQuery.event.remove's overhead + } else { + jQuery.removeEvent( elem, type, data.handle ); + } } } - // Null the DOM reference to avoid IE6/7/8 leak (#7054) - if ( data.handle ) { - data.handle.elem = null; - } - } + // Remove cache only if it was not already removed by jQuery.event.remove + if ( cache[ id ] ) { - if ( deleteExpando ) { - delete elem[ jQuery.expando ]; + delete cache[ id ]; - } else if ( elem.removeAttribute ) { - elem.removeAttribute( jQuery.expando ); - } + // IE does not allow us to delete expando properties from nodes, + // nor does it have a removeAttribute function on Document nodes; + // we must handle all of these cases + if ( deleteExpando ) { + delete elem[ internalKey ]; - delete cache[ id ]; + } else if ( elem.removeAttribute ) { + elem.removeAttribute( internalKey ); + + } else { + elem[ internalKey ] = null; + } + + jQuery.deletedIds.push( id ); + } + } } } } }); +// Limit scope pollution from any deprecated API +(function() { + +var matched, browser; + +// Use of jQuery.browser is frowned upon. +// More details: http://api.jquery.com/jQuery.browser +// jQuery.uaMatch maintained for back-compat +jQuery.uaMatch = function( ua ) { + ua = ua.toLowerCase(); + + var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) || + /(webkit)[ \/]([\w.]+)/.exec( ua ) || + /(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) || + /(msie) ([\w.]+)/.exec( ua ) || + ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) || + []; + + return { + browser: match[ 1 ] || "", + version: match[ 2 ] || "0" + }; +}; +matched = jQuery.uaMatch( navigator.userAgent ); +browser = {}; +if ( matched.browser ) { + browser[ matched.browser ] = true; + browser.version = matched.version; +} +// Chrome is Webkit, but Webkit is also Safari. +if ( browser.chrome ) { + browser.webkit = true; +} else if ( browser.webkit ) { + browser.safari = true; +} + +jQuery.browser = browser; + +jQuery.sub = function() { + function jQuerySub( selector, context ) { + return new jQuerySub.fn.init( selector, context ); + } + jQuery.extend( true, jQuerySub, this ); + jQuerySub.superclass = this; + jQuerySub.fn = jQuerySub.prototype = this(); + jQuerySub.fn.constructor = jQuerySub; + jQuerySub.sub = this.sub; + jQuerySub.fn.init = function init( selector, context ) { + if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) { + context = jQuerySub( context ); + } + + return jQuery.fn.init.call( this, selector, context, rootjQuerySub ); + }; + jQuerySub.fn.init.prototype = jQuerySub.fn; + var rootjQuerySub = jQuerySub(document); + return jQuerySub; +}; -var ralpha = /alpha\([^)]*\)/i, +})(); +var curCSS, iframe, iframeDoc, + ralpha = /alpha\([^)]*\)/i, ropacity = /opacity=([^)]*)/, - // fixed for IE9, see #8346 - rupper = /([A-Z]|^ms)/g, - rnum = /^[\-+]?(?:\d*\.)?\d+$/i, - rnumnonpx = /^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i, - rrelNum = /^([\-+])=([\-+.\de]+)/, + rposition = /^(top|right|bottom|left)$/, + // swappable if display is none or starts with table except "table", "table-cell", or "table-caption" + // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display + rdisplayswap = /^(none|table(?!-c[ea]).+)/, rmargin = /^margin/, + rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ), + rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ), + rrelNum = new RegExp( "^([-+])=(" + core_pnum + ")", "i" ), + elemdisplay = {}, cssShow = { position: "absolute", visibility: "hidden", display: "block" }, + cssNormalTransform = { + letterSpacing: 0, + fontWeight: 400 + }, - // order is important! cssExpand = [ "Top", "Right", "Bottom", "Left" ], + cssPrefixes = [ "Webkit", "O", "Moz", "ms" ], - curCSS, + eventsToggle = jQuery.fn.toggle; - getComputedStyle, - currentStyle; +// return a css property mapped to a potentially vendor prefixed property +function vendorPropName( style, name ) { -jQuery.fn.css = function( name, value ) { - return jQuery.access( this, function( elem, name, value ) { - return value !== undefined ? - jQuery.style( elem, name, value ) : - jQuery.css( elem, name ); - }, name, value, arguments.length > 1 ); -}; + // shortcut for names that are not vendor prefixed + if ( name in style ) { + return name; + } + + // check for vendor prefixed names + var capName = name.charAt(0).toUpperCase() + name.slice(1), + origName = name, + i = cssPrefixes.length; + + while ( i-- ) { + name = cssPrefixes[ i ] + capName; + if ( name in style ) { + return name; + } + } + + return origName; +} + +function isHidden( elem, el ) { + elem = el || elem; + return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); +} + +function showHide( elements, show ) { + var elem, display, + values = [], + index = 0, + length = elements.length; + + for ( ; index < length; index++ ) { + elem = elements[ index ]; + if ( !elem.style ) { + continue; + } + values[ index ] = jQuery._data( elem, "olddisplay" ); + if ( show ) { + // Reset the inline display of this element to learn if it is + // being hidden by cascaded rules or not + if ( !values[ index ] && elem.style.display === "none" ) { + elem.style.display = ""; + } + + // Set elements which have been overridden with display: none + // in a stylesheet to whatever the default browser style is + // for such an element + if ( elem.style.display === "" && isHidden( elem ) ) { + values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) ); + } + } else { + display = curCSS( elem, "display" ); + + if ( !values[ index ] && display !== "none" ) { + jQuery._data( elem, "olddisplay", display ); + } + } + } + + // Set the display of most of the elements in a second loop + // to avoid the constant reflow + for ( index = 0; index < length; index++ ) { + elem = elements[ index ]; + if ( !elem.style ) { + continue; + } + if ( !show || elem.style.display === "none" || elem.style.display === "" ) { + elem.style.display = show ? values[ index ] || "" : "none"; + } + } + + return elements; +} + +jQuery.fn.extend({ + css: function( name, value ) { + return jQuery.access( this, function( elem, name, value ) { + return value !== undefined ? + jQuery.style( elem, name, value ) : + jQuery.css( elem, name ); + }, name, value, arguments.length > 1 ); + }, + show: function() { + return showHide( this, true ); + }, + hide: function() { + return showHide( this ); + }, + toggle: function( state, fn2 ) { + var bool = typeof state === "boolean"; + + if ( jQuery.isFunction( state ) && jQuery.isFunction( fn2 ) ) { + return eventsToggle.apply( this, arguments ); + } + + return this.each(function() { + if ( bool ? state : isHidden( this ) ) { + jQuery( this ).show(); + } else { + jQuery( this ).hide(); + } + }); + } +}); jQuery.extend({ // Add in style property hooks for overriding the default @@ -6589,8 +6669,6 @@ jQuery.extend({ var ret = curCSS( elem, "opacity" ); return ret === "" ? "1" : ret; - } else { - return elem.style.opacity; } } } @@ -6623,10 +6701,15 @@ jQuery.extend({ } // Make sure that we're working with the right name - var ret, type, origName = jQuery.camelCase( name ), - style = elem.style, hooks = jQuery.cssHooks[ origName ]; + var ret, type, hooks, + origName = jQuery.camelCase( name ), + style = elem.style; + + name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) ); - name = jQuery.cssProps[ origName ] || origName; + // gets hook for the prefixed version + // followed by the unprefixed version + hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; // Check if we're setting a value if ( value !== undefined ) { @@ -6634,7 +6717,7 @@ jQuery.extend({ // convert relative number strings (+= or -=) to relative numbers. #7345 if ( type === "string" && (ret = rrelNum.exec( value )) ) { - value = ( +( ret[1] + 1) * +ret[2] ) + parseFloat( jQuery.css( elem, name ) ); + value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) ); // Fixes bug #9237 type = "number"; } @@ -6650,7 +6733,7 @@ jQuery.extend({ } // If a hook was provided, use that value, otherwise just set the specified value - if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) { + if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) { // Wrapped to prevent IE from throwing errors when 'invalid' values are provided // Fixes bug #5509 try { @@ -6669,33 +6752,44 @@ jQuery.extend({ } }, - css: function( elem, name, extra ) { - var ret, hooks; + css: function( elem, name, numeric, extra ) { + var val, num, hooks, + origName = jQuery.camelCase( name ); // Make sure that we're working with the right name - name = jQuery.camelCase( name ); - hooks = jQuery.cssHooks[ name ]; - name = jQuery.cssProps[ name ] || name; + name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) ); - // cssFloat needs a special treatment - if ( name === "cssFloat" ) { - name = "float"; - } + // gets hook for the prefixed version + // followed by the unprefixed version + hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; // If a hook was provided get the computed value from there - if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) { - return ret; + if ( hooks && "get" in hooks ) { + val = hooks.get( elem, true, extra ); + } // Otherwise, if a way to get the computed value exists, use that - } else if ( curCSS ) { - return curCSS( elem, name ); + if ( val === undefined ) { + val = curCSS( elem, name ); + } + + //convert "normal" to computed value + if ( val === "normal" && name in cssNormalTransform ) { + val = cssNormalTransform[ name ]; + } + + // Return, converting to number if forced or a qualifier was provided and val looks numeric + if ( numeric || extra !== undefined ) { + num = parseFloat( val ); + return numeric || jQuery.isNumeric( num ) ? num || 0 : val; } + return val; }, // A method for quickly swapping in/out CSS properties to get correct calculations swap: function( elem, options, callback ) { - var old = {}, - ret, name; + var ret, name, + old = {}; // Remember the old values, and insert the new ones for ( name in options ) { @@ -6714,49 +6808,51 @@ jQuery.extend({ } }); -// DEPRECATED in 1.3, Use jQuery.css() instead -jQuery.curCSS = jQuery.css; - -if ( document.defaultView && document.defaultView.getComputedStyle ) { - getComputedStyle = function( elem, name ) { - var ret, defaultView, computedStyle, width, +// NOTE: To any future maintainer, we've window.getComputedStyle +// because jsdom on node.js will break without it. +if ( window.getComputedStyle ) { + curCSS = function( elem, name ) { + var ret, width, minWidth, maxWidth, + computed = window.getComputedStyle( elem, null ), style = elem.style; - name = name.replace( rupper, "-$1" ).toLowerCase(); + if ( computed ) { - if ( (defaultView = elem.ownerDocument.defaultView) && - (computedStyle = defaultView.getComputedStyle( elem, null )) ) { - - ret = computedStyle.getPropertyValue( name ); - if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) { + ret = computed[ name ]; + if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { ret = jQuery.style( elem, name ); } - } - // A tribute to the "awesome hack by Dean Edwards" - // WebKit uses "computed value (percentage if specified)" instead of "used value" for margins - // which is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values - if ( !jQuery.support.pixelMargin && computedStyle && rmargin.test( name ) && rnumnonpx.test( ret ) ) { - width = style.width; - style.width = ret; - ret = computedStyle.width; - style.width = width; + // A tribute to the "awesome hack by Dean Edwards" + // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right + // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels + // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values + if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) { + width = style.width; + minWidth = style.minWidth; + maxWidth = style.maxWidth; + + style.minWidth = style.maxWidth = style.width = ret; + ret = computed.width; + + style.width = width; + style.minWidth = minWidth; + style.maxWidth = maxWidth; + } } return ret; }; -} - -if ( document.documentElement.currentStyle ) { - currentStyle = function( elem, name ) { - var left, rsLeft, uncomputed, +} else if ( document.documentElement.currentStyle ) { + curCSS = function( elem, name ) { + var left, rsLeft, ret = elem.currentStyle && elem.currentStyle[ name ], style = elem.style; // Avoid setting ret to empty string here // so we don't default to auto - if ( ret == null && style && (uncomputed = style[ name ]) ) { - ret = uncomputed; + if ( ret == null && style && style[ name ] ) { + ret = style[ name ]; } // From the awesome hack by Dean Edwards @@ -6764,7 +6860,9 @@ if ( document.documentElement.currentStyle ) { // If we're not dealing with a regular pixel number // but a number that has a weird ending, we need to convert it to pixels - if ( rnumnonpx.test( ret ) ) { + // but not position css attributes, as those are proportional to the parent element instead + // and we can't measure the parent instead because it might trigger a "stacking dolls" problem + if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) { // Remember the original values left = style.left; @@ -6788,80 +6886,165 @@ if ( document.documentElement.currentStyle ) { }; } -curCSS = getComputedStyle || currentStyle; +function setPositiveNumber( elem, value, subtract ) { + var matches = rnumsplit.exec( value ); + return matches ? + Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) : + value; +} + +function augmentWidthOrHeight( elem, name, extra, isBorderBox ) { + var i = extra === ( isBorderBox ? "border" : "content" ) ? + // If we already have the right measurement, avoid augmentation + 4 : + // Otherwise initialize for horizontal or vertical properties + name === "width" ? 1 : 0, + + val = 0; + + for ( ; i < 4; i += 2 ) { + // both box models exclude margin, so add it if we want it + if ( extra === "margin" ) { + // we use jQuery.css instead of curCSS here + // because of the reliableMarginRight CSS hook! + val += jQuery.css( elem, extra + cssExpand[ i ], true ); + } + + // From this point on we use curCSS for maximum performance (relevant in animations) + if ( isBorderBox ) { + // border-box includes padding, so remove it if we want content + if ( extra === "content" ) { + val -= parseFloat( curCSS( elem, "padding" + cssExpand[ i ] ) ) || 0; + } + + // at this point, extra isn't border nor margin, so remove border + if ( extra !== "margin" ) { + val -= parseFloat( curCSS( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0; + } + } else { + // at this point, extra isn't content, so add padding + val += parseFloat( curCSS( elem, "padding" + cssExpand[ i ] ) ) || 0; + + // at this point, extra isn't content nor padding, so add border + if ( extra !== "padding" ) { + val += parseFloat( curCSS( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0; + } + } + } + + return val; +} function getWidthOrHeight( elem, name, extra ) { - // Start with offset property + // Start with offset property, which is equivalent to the border-box value var val = name === "width" ? elem.offsetWidth : elem.offsetHeight, - i = name === "width" ? 1 : 0, - len = 4; - - if ( val > 0 ) { - if ( extra !== "border" ) { - for ( ; i < len; i += 2 ) { - if ( !extra ) { - val -= parseFloat( jQuery.css( elem, "padding" + cssExpand[ i ] ) ) || 0; - } - if ( extra === "margin" ) { - val += parseFloat( jQuery.css( elem, extra + cssExpand[ i ] ) ) || 0; - } else { - val -= parseFloat( jQuery.css( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0; - } - } + valueIsBorderBox = true, + isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing" ) === "border-box"; + + // some non-html elements return undefined for offsetWidth, so check for null/undefined + // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 + // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 + if ( val <= 0 || val == null ) { + // Fall back to computed then uncomputed css if necessary + val = curCSS( elem, name ); + if ( val < 0 || val == null ) { + val = elem.style[ name ]; } - return val + "px"; - } + // Computed unit is not pixels. Stop here and return. + if ( rnumnonpx.test(val) ) { + return val; + } + + // we need the check for style in case a browser which returns unreliable values + // for getComputedStyle silently falls back to the reliable elem.style + valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] ); - // Fall back to computed then uncomputed css if necessary - val = curCSS( elem, name ); - if ( val < 0 || val == null ) { - val = elem.style[ name ]; + // Normalize "", auto, and prepare for extra + val = parseFloat( val ) || 0; } - // Computed unit is not pixels. Stop here and return. - if ( rnumnonpx.test(val) ) { - return val; + // use the active box-sizing model to add/subtract irrelevant styles + return ( val + + augmentWidthOrHeight( + elem, + name, + extra || ( isBorderBox ? "border" : "content" ), + valueIsBorderBox + ) + ) + "px"; +} + + +// Try to determine the default display value of an element +function css_defaultDisplay( nodeName ) { + if ( elemdisplay[ nodeName ] ) { + return elemdisplay[ nodeName ]; } - // Normalize "", auto, and prepare for extra - val = parseFloat( val ) || 0; + var elem = jQuery( "<" + nodeName + ">" ).appendTo( document.body ), + display = elem.css("display"); + elem.remove(); + + // If the simple way fails, + // get element's real default display by attaching it to a temp iframe + if ( display === "none" || display === "" ) { + // Use the already-created iframe if possible + iframe = document.body.appendChild( + iframe || jQuery.extend( document.createElement("iframe"), { + frameBorder: 0, + width: 0, + height: 0 + }) + ); - // Add padding, border, margin - if ( extra ) { - for ( ; i < len; i += 2 ) { - val += parseFloat( jQuery.css( elem, "padding" + cssExpand[ i ] ) ) || 0; - if ( extra !== "padding" ) { - val += parseFloat( jQuery.css( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0; - } - if ( extra === "margin" ) { - val += parseFloat( jQuery.css( elem, extra + cssExpand[ i ]) ) || 0; - } + // Create a cacheable copy of the iframe document on first call. + // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML + // document to it; WebKit & Firefox won't allow reusing the iframe document. + if ( !iframeDoc || !iframe.createElement ) { + iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document; + iframeDoc.write("<!doctype html><html><body>"); + iframeDoc.close(); } + + elem = iframeDoc.body.appendChild( iframeDoc.createElement(nodeName) ); + + display = curCSS( elem, "display" ); + document.body.removeChild( iframe ); } - return val + "px"; + // Store the correct default display + elemdisplay[ nodeName ] = display; + + return display; } jQuery.each([ "height", "width" ], function( i, name ) { jQuery.cssHooks[ name ] = { get: function( elem, computed, extra ) { if ( computed ) { - if ( elem.offsetWidth !== 0 ) { - return getWidthOrHeight( elem, name, extra ); - } else { + // certain elements can have dimension info if we invisibly show them + // however, it must have a current display style that would benefit from this + if ( elem.offsetWidth === 0 && rdisplayswap.test( curCSS( elem, "display" ) ) ) { return jQuery.swap( elem, cssShow, function() { return getWidthOrHeight( elem, name, extra ); }); + } else { + return getWidthOrHeight( elem, name, extra ); } } }, - set: function( elem, value ) { - return rnum.test( value ) ? - value + "px" : - value; + set: function( elem, value, extra ) { + return setPositiveNumber( elem, value, extra ? + augmentWidthOrHeight( + elem, + name, + extra, + jQuery.support.boxSizing && jQuery.css( elem, "boxSizing" ) === "border-box" + ) : 0 + ); } }; }); @@ -6871,7 +7054,7 @@ if ( !jQuery.support.opacity ) { get: function( elem, computed ) { // IE uses filters for opacity return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ? - ( parseFloat( RegExp.$1 ) / 100 ) + "" : + ( 0.01 * parseFloat( RegExp.$1 ) ) + "" : computed ? "1" : ""; }, @@ -6886,7 +7069,8 @@ if ( !jQuery.support.opacity ) { style.zoom = 1; // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652 - if ( value >= 1 && jQuery.trim( filter.replace( ralpha, "" ) ) === "" ) { + if ( value >= 1 && jQuery.trim( filter.replace( ralpha, "" ) ) === "" && + style.removeAttribute ) { // Setting style.filter to null, "" & " " still leave "filter:" in the cssText // if "filter:" is present at all, clearType is disabled, we want to avoid this @@ -6907,9 +7091,9 @@ if ( !jQuery.support.opacity ) { }; } +// These hooks cannot be added until DOM ready because the support test +// for it is not run until after DOM ready jQuery(function() { - // This hook cannot be added until DOM ready because the support test - // for it is not run until after DOM ready if ( !jQuery.support.reliableMarginRight ) { jQuery.cssHooks.marginRight = { get: function( elem, computed ) { @@ -6917,22 +7101,35 @@ jQuery(function() { // Work around by temporarily setting element display to inline-block return jQuery.swap( elem, { "display": "inline-block" }, function() { if ( computed ) { - return curCSS( elem, "margin-right" ); - } else { - return elem.style.marginRight; + return curCSS( elem, "marginRight" ); } }); } }; } + + // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 + // getComputedStyle returns percent when specified for top/left/bottom/right + // rather than make the css module depend on the offset module, we just check for it here + if ( !jQuery.support.pixelPosition && jQuery.fn.position ) { + jQuery.each( [ "top", "left" ], function( i, prop ) { + jQuery.cssHooks[ prop ] = { + get: function( elem, computed ) { + if ( computed ) { + var ret = curCSS( elem, prop ); + // if curCSS returns percentage, fallback to offset + return rnumnonpx.test( ret ) ? jQuery( elem ).position()[ prop ] + "px" : ret; + } + } + }; + }); + } + }); if ( jQuery.expr && jQuery.expr.filters ) { jQuery.expr.filters.hidden = function( elem ) { - var width = elem.offsetWidth, - height = elem.offsetHeight; - - return ( width === 0 && height === 0 ) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none"); + return ( elem.offsetWidth === 0 && elem.offsetHeight === 0 ) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || curCSS( elem, "display" )) === "none"); }; jQuery.expr.filters.visible = function( elem ) { @@ -6946,7 +7143,6 @@ jQuery.each({ padding: "", border: "Width" }, function( prefix, suffix ) { - jQuery.cssHooks[ prefix + suffix ] = { expand: function( value ) { var i, @@ -6963,27 +7159,127 @@ jQuery.each({ return expanded; } }; + + if ( !rmargin.test( prefix ) ) { + jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; + } }); +var r20 = /%20/g, + rbracket = /\[\]$/, + rCRLF = /\r?\n/g, + rinput = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i, + rselectTextarea = /^(?:select|textarea)/i; +jQuery.fn.extend({ + serialize: function() { + return jQuery.param( this.serializeArray() ); + }, + serializeArray: function() { + return this.map(function(){ + return this.elements ? jQuery.makeArray( this.elements ) : this; + }) + .filter(function(){ + return this.name && !this.disabled && + ( this.checked || rselectTextarea.test( this.nodeName ) || + rinput.test( this.type ) ); + }) + .map(function( i, elem ){ + var val = jQuery( this ).val(); + return val == null ? + null : + jQuery.isArray( val ) ? + jQuery.map( val, function( val, i ){ + return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; + }) : + { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; + }).get(); + } +}); +//Serialize an array of form elements or a set of +//key/values into a query string +jQuery.param = function( a, traditional ) { + var prefix, + s = [], + add = function( key, value ) { + // If value is a function, invoke it and return its value + value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value ); + s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value ); + }; + + // Set traditional to true for jQuery <= 1.3.2 behavior. + if ( traditional === undefined ) { + traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional; + } + + // If an array was passed in, assume that it is an array of form elements. + if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { + // Serialize the form elements + jQuery.each( a, function() { + add( this.name, this.value ); + }); + + } else { + // If traditional, encode the "old" way (the way 1.3.2 or older + // did it), otherwise encode params recursively. + for ( prefix in a ) { + buildParams( prefix, a[ prefix ], traditional, add ); + } + } + + // Return the resulting serialization + return s.join( "&" ).replace( r20, "+" ); +}; + +function buildParams( prefix, obj, traditional, add ) { + var name; + + if ( jQuery.isArray( obj ) ) { + // Serialize array item. + jQuery.each( obj, function( i, v ) { + if ( traditional || rbracket.test( prefix ) ) { + // Treat each array item as a scalar. + add( prefix, v ); + + } else { + // If array item is non-scalar (array or object), encode its + // numeric index to resolve deserialization ambiguity issues. + // Note that rack (as of 1.0.0) can't currently deserialize + // nested arrays properly, and attempting to do so may cause + // a server error. Possible fixes are to modify rack's + // deserialization algorithm or to provide an option or flag + // to force array serialization to be shallow. + buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add ); + } + }); + + } else if ( !traditional && jQuery.type( obj ) === "object" ) { + // Serialize object item. + for ( name in obj ) { + buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); + } + + } else { + // Serialize scalar item. + add( prefix, obj ); + } +} +var + // Document location + ajaxLocParts, + ajaxLocation, -var r20 = /%20/g, - rbracket = /\[\]$/, - rCRLF = /\r?\n/g, rhash = /#.*$/, rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL - rinput = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i, // #7653, #8125, #8152: local protocol detection rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/, rnoContent = /^(?:GET|HEAD)$/, rprotocol = /^\/\//, rquery = /\?/, rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, - rselectTextarea = /^(?:select|textarea)/i, - rspacesAjax = /\s+/, rts = /([?&])_=[^&]*/, - rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/, + rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/, // Keep a copy of the old load method _load = jQuery.fn.load, @@ -7006,12 +7302,6 @@ var r20 = /%20/g, */ transports = {}, - // Document location - ajaxLocation, - - // Document location segments - ajaxLocParts, - // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression allTypes = ["*/"] + ["*"]; @@ -7041,14 +7331,12 @@ function addToPrefiltersOrTransports( structure ) { dataTypeExpression = "*"; } - if ( jQuery.isFunction( func ) ) { - var dataTypes = dataTypeExpression.toLowerCase().split( rspacesAjax ), - i = 0, - length = dataTypes.length, - dataType, - list, - placeBefore; + var dataType, list, placeBefore, + dataTypes = dataTypeExpression.toLowerCase().split( core_rspace ), + i = 0, + length = dataTypes.length; + if ( jQuery.isFunction( func ) ) { // For each dataType in the dataTypeExpression for ( ; i < length; i++ ) { dataType = dataTypes[ i ]; @@ -7075,11 +7363,11 @@ function inspectPrefiltersOrTransports( structure, options, originalOptions, jqX inspected[ dataType ] = true; - var list = structure[ dataType ], + var selection, + list = structure[ dataType ], i = 0, length = list ? list.length : 0, - executeOnly = ( structure === prefilters ), - selection; + executeOnly = ( structure === prefilters ); for ( ; i < length && ( executeOnly || !selection ); i++ ) { selection = list[ i ]( options, originalOptions, jqXHR ); @@ -7122,109 +7410,75 @@ function ajaxExtend( target, src ) { } } -jQuery.fn.extend({ - load: function( url, params, callback ) { - if ( typeof url !== "string" && _load ) { - return _load.apply( this, arguments ); +jQuery.fn.load = function( url, params, callback ) { + if ( typeof url !== "string" && _load ) { + return _load.apply( this, arguments ); + } - // Don't do a request if no elements are being requested - } else if ( !this.length ) { - return this; - } + // Don't do a request if no elements are being requested + if ( !this.length ) { + return this; + } - var off = url.indexOf( " " ); - if ( off >= 0 ) { - var selector = url.slice( off, url.length ); - url = url.slice( 0, off ); - } + var selector, type, response, + self = this, + off = url.indexOf(" "); + + if ( off >= 0 ) { + selector = url.slice( off, url.length ); + url = url.slice( 0, off ); + } + + // If it's a function + if ( jQuery.isFunction( params ) ) { + + // We assume that it's the callback + callback = params; + params = undefined; - // Default to a GET request - var type = "GET"; + // Otherwise, build a param string + } else if ( params && typeof params === "object" ) { + type = "POST"; + } - // If the second parameter was provided - if ( params ) { - // If it's a function - if ( jQuery.isFunction( params ) ) { - // We assume that it's the callback - callback = params; - params = undefined; + // Request the remote document + jQuery.ajax({ + url: url, - // Otherwise, build a param string - } else if ( typeof params === "object" ) { - params = jQuery.param( params, jQuery.ajaxSettings.traditional ); - type = "POST"; + // if "type" variable is undefined, then "GET" method will be used + type: type, + dataType: "html", + data: params, + complete: function( jqXHR, status ) { + if ( callback ) { + self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] ); } } + }).done(function( responseText ) { - var self = this; + // Save response for use in complete callback + response = arguments; - // Request the remote document - jQuery.ajax({ - url: url, - type: type, - dataType: "html", - data: params, - // Complete callback (responseText is used internally) - complete: function( jqXHR, status, responseText ) { - // Store the response as specified by the jqXHR object - responseText = jqXHR.responseText; - // If successful, inject the HTML into all the matched elements - if ( jqXHR.isResolved() ) { - // #4825: Get the actual response in case - // a dataFilter is present in ajaxSettings - jqXHR.done(function( r ) { - responseText = r; - }); - // See if a selector was specified - self.html( selector ? - // Create a dummy div to hold the results - jQuery("<div>") - // inject the contents of the document in, removing the scripts - // to avoid any 'Permission Denied' errors in IE - .append(responseText.replace(rscript, "")) - - // Locate the specified elements - .find(selector) : - - // If not, just inject the full result - responseText ); - } + // See if a selector was specified + self.html( selector ? - if ( callback ) { - self.each( callback, [ responseText, status, jqXHR ] ); - } - } - }); + // Create a dummy div to hold the results + jQuery("<div>") - return this; - }, + // inject the contents of the document in, removing the scripts + // to avoid any 'Permission Denied' errors in IE + .append( responseText.replace( rscript, "" ) ) - serialize: function() { - return jQuery.param( this.serializeArray() ); - }, + // Locate the specified elements + .find( selector ) : - serializeArray: function() { - return this.map(function(){ - return this.elements ? jQuery.makeArray( this.elements ) : this; - }) - .filter(function(){ - return this.name && !this.disabled && - ( this.checked || rselectTextarea.test( this.nodeName ) || - rinput.test( this.type ) ); - }) - .map(function( i, elem ){ - var val = jQuery( this ).val(); + // If not, just inject the full result + responseText ); - return val == null ? - null : - jQuery.isArray( val ) ? - jQuery.map( val, function( val, i ){ - return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; - }) : - { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; - }).get(); - } -}); + }); + + return this; +}; // Attach a bunch of functions for handling common AJAX events jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){ @@ -7293,6 +7547,7 @@ jQuery.extend({ username: null, password: null, cache: null, + throws: false, traditional: false, headers: {}, */ @@ -7359,7 +7614,22 @@ jQuery.extend({ // Force options to be an object options = options || {}; - var // Create the final options object + var // ifModified key + ifModifiedKey, + // Response headers + responseHeadersString, + responseHeaders, + // transport + transport, + // timeout handle + timeoutTimer, + // Cross-domain detection vars + parts, + // To know if global events are to be dispatched + fireGlobals, + // Loop variable + i, + // Create the final options object s = jQuery.ajaxSetup( {}, options ), // Callbacks context callbackContext = s.context || s, @@ -7374,26 +7644,13 @@ jQuery.extend({ completeDeferred = jQuery.Callbacks( "once memory" ), // Status-dependent callbacks statusCode = s.statusCode || {}, - // ifModified key - ifModifiedKey, // Headers (they are sent all at once) requestHeaders = {}, requestHeadersNames = {}, - // Response headers - responseHeadersString, - responseHeaders, - // transport - transport, - // timeout handle - timeoutTimer, - // Cross-domain detection vars - parts, // The jqXHR state state = 0, - // To know if global events are to be dispatched - fireGlobals, - // Loop variable - i, + // Default abort message + strAbort = "canceled", // Fake xhr jqXHR = { @@ -7439,7 +7696,7 @@ jQuery.extend({ // Cancel the request abort: function( statusText ) { - statusText = statusText || "abort"; + statusText = statusText || strAbort; if ( transport ) { transport.abort( statusText ); } @@ -7452,6 +7709,8 @@ jQuery.extend({ // It is defined here because jslint complains if it is declared // at the end of the function (which would be more logical and readable) function done( status, nativeStatusText, responses, headers ) { + var isSuccess, success, error, response, modified, + statusText = nativeStatusText; // Called once if ( state === 2 ) { @@ -7476,13 +7735,10 @@ jQuery.extend({ // Set readyState jqXHR.readyState = status > 0 ? 4 : 0; - var isSuccess, - success, - error, - statusText = nativeStatusText, - response = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined, - lastModified, - etag; + // Get response data + if ( responses ) { + response = ajaxHandleResponses( s, jqXHR, responses ); + } // If successful, handle type chaining if ( status >= 200 && status < 300 || status === 304 ) { @@ -7490,11 +7746,13 @@ jQuery.extend({ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { - if ( ( lastModified = jqXHR.getResponseHeader( "Last-Modified" ) ) ) { - jQuery.lastModified[ ifModifiedKey ] = lastModified; + modified = jqXHR.getResponseHeader("Last-Modified"); + if ( modified ) { + jQuery.lastModified[ ifModifiedKey ] = modified; } - if ( ( etag = jqXHR.getResponseHeader( "Etag" ) ) ) { - jQuery.etag[ ifModifiedKey ] = etag; + modified = jqXHR.getResponseHeader("Etag"); + if ( modified ) { + jQuery.etag[ ifModifiedKey ] = modified; } } @@ -7507,15 +7765,11 @@ jQuery.extend({ // If we have data } else { - try { - success = ajaxConvert( s, response ); - statusText = "success"; - isSuccess = true; - } catch(e) { - // We have a parsererror - statusText = "parsererror"; - error = e; - } + isSuccess = ajaxConvert( s, response ); + statusText = isSuccess.state; + success = isSuccess.data; + error = isSuccess.error; + isSuccess = !error; } } else { // We extract error from statusText @@ -7531,7 +7785,7 @@ jQuery.extend({ // Set data for the fake xhr object jqXHR.status = status; - jqXHR.statusText = "" + ( nativeStatusText || statusText ); + jqXHR.statusText = ( nativeStatusText || statusText ) + ""; // Success/Error if ( isSuccess ) { @@ -7577,7 +7831,7 @@ jQuery.extend({ } } else { tmp = map[ jqXHR.status ]; - jqXHR.then( tmp, tmp ); + jqXHR.always( tmp ); } } return this; @@ -7589,16 +7843,13 @@ jQuery.extend({ s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" ); // Extract dataTypes list - s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( rspacesAjax ); + s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( core_rspace ); - // Determine if a cross-domain request is in order + // A cross-domain request is in order when we have a protocol:host:port mismatch if ( s.crossDomain == null ) { - parts = rurl.exec( s.url.toLowerCase() ); - s.crossDomain = !!( parts && - ( parts[ 1 ] != ajaxLocParts[ 1 ] || parts[ 2 ] != ajaxLocParts[ 2 ] || - ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) != - ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) ) - ); + parts = rurl.exec( s.url.toLowerCase() ) || false; + s.crossDomain = parts && ( parts.join(":") + ( parts[ 3 ] ? "" : parts[ 1 ] === "http:" ? 80 : 443 ) ) !== + ( ajaxLocParts.join(":") + ( ajaxLocParts[ 3 ] ? "" : ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ); } // Convert data if not already a string @@ -7611,7 +7862,7 @@ jQuery.extend({ // If request was aborted inside a prefilter, stop there if ( state === 2 ) { - return false; + return jqXHR; } // We can fire global events as of now if asked to @@ -7684,12 +7935,14 @@ jQuery.extend({ // Allow custom headers/mimetypes and early abort if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) { - // Abort if not done already - jqXHR.abort(); - return false; + // Abort if not done already and return + return jqXHR.abort(); } + // aborting is no longer a cancellation + strAbort = "abort"; + // Install callbacks on deferreds for ( i in { success: 1, error: 1, complete: 1 } ) { jqXHR[ i ]( s[ i ] ); @@ -7731,77 +7984,6 @@ jQuery.extend({ return jqXHR; }, - // Serialize an array of form elements or a set of - // key/values into a query string - param: function( a, traditional ) { - var s = [], - add = function( key, value ) { - // If value is a function, invoke it and return its value - value = jQuery.isFunction( value ) ? value() : value; - s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value ); - }; - - // Set traditional to true for jQuery <= 1.3.2 behavior. - if ( traditional === undefined ) { - traditional = jQuery.ajaxSettings.traditional; - } - - // If an array was passed in, assume that it is an array of form elements. - if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { - // Serialize the form elements - jQuery.each( a, function() { - add( this.name, this.value ); - }); - - } else { - // If traditional, encode the "old" way (the way 1.3.2 or older - // did it), otherwise encode params recursively. - for ( var prefix in a ) { - buildParams( prefix, a[ prefix ], traditional, add ); - } - } - - // Return the resulting serialization - return s.join( "&" ).replace( r20, "+" ); - } -}); - -function buildParams( prefix, obj, traditional, add ) { - if ( jQuery.isArray( obj ) ) { - // Serialize array item. - jQuery.each( obj, function( i, v ) { - if ( traditional || rbracket.test( prefix ) ) { - // Treat each array item as a scalar. - add( prefix, v ); - - } else { - // If array item is non-scalar (array or object), encode its - // numeric index to resolve deserialization ambiguity issues. - // Note that rack (as of 1.0.0) can't currently deserialize - // nested arrays properly, and attempting to do so may cause - // a server error. Possible fixes are to modify rack's - // deserialization algorithm or to provide an option or flag - // to force array serialization to be shallow. - buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add ); - } - }); - - } else if ( !traditional && jQuery.type( obj ) === "object" ) { - // Serialize object item. - for ( var name in obj ) { - buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); - } - - } else { - // Serialize scalar item. - add( prefix, obj ); - } -} - -// This is still on the jQuery object... for now -// Want to move this to jQuery.ajax some day -jQuery.extend({ - // Counter for holding the number of active queries active: 0, @@ -7818,13 +8000,10 @@ jQuery.extend({ */ function ajaxHandleResponses( s, jqXHR, responses ) { - var contents = s.contents, + var ct, type, finalDataType, firstDataType, + contents = s.contents, dataTypes = s.dataTypes, - responseFields = s.responseFields, - ct, - type, - finalDataType, - firstDataType; + responseFields = s.responseFields; // Fill responseXXX fields for ( type in responseFields ) { @@ -7883,154 +8062,137 @@ function ajaxHandleResponses( s, jqXHR, responses ) { // Chain conversions given the request and the original response function ajaxConvert( s, response ) { + var conv, conv2, current, tmp, + // Work with a copy of dataTypes in case we need to modify it for conversion + dataTypes = s.dataTypes.slice(), + prev = dataTypes[ 0 ], + converters = {}, + i = 0; + // Apply the dataFilter if provided if ( s.dataFilter ) { response = s.dataFilter( response, s.dataType ); } - var dataTypes = s.dataTypes, - converters = {}, - i, - key, - length = dataTypes.length, - tmp, - // Current and previous dataTypes - current = dataTypes[ 0 ], - prev, - // Conversion expression - conversion, - // Conversion function - conv, - // Conversion functions (transitive conversion) - conv1, - conv2; - - // For each dataType in the chain - for ( i = 1; i < length; i++ ) { - - // Create converters map - // with lowercased keys - if ( i === 1 ) { - for ( key in s.converters ) { - if ( typeof key === "string" ) { - converters[ key.toLowerCase() ] = s.converters[ key ]; - } - } + // Create converters map with lowercased keys + if ( dataTypes[ 1 ] ) { + for ( conv in s.converters ) { + converters[ conv.toLowerCase() ] = s.converters[ conv ]; } + } + + // Convert to each sequential dataType, tolerating list modification + for ( ; (current = dataTypes[++i]); ) { + + // There's only work to do if current dataType is non-auto + if ( current !== "*" ) { - // Get the dataTypes - prev = current; - current = dataTypes[ i ]; - - // If current is auto dataType, update it to prev - if ( current === "*" ) { - current = prev; - // If no auto and dataTypes are actually different - } else if ( prev !== "*" && prev !== current ) { - - // Get the converter - conversion = prev + " " + current; - conv = converters[ conversion ] || converters[ "* " + current ]; - - // If there is no direct converter, search transitively - if ( !conv ) { - conv2 = undefined; - for ( conv1 in converters ) { - tmp = conv1.split( " " ); - if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) { - conv2 = converters[ tmp[1] + " " + current ]; - if ( conv2 ) { - conv1 = converters[ conv1 ]; - if ( conv1 === true ) { - conv = conv2; - } else if ( conv2 === true ) { - conv = conv1; + // Convert response if prev dataType is non-auto and differs from current + if ( prev !== "*" && prev !== current ) { + + // Seek a direct converter + conv = converters[ prev + " " + current ] || converters[ "* " + current ]; + + // If none found, seek a pair + if ( !conv ) { + for ( conv2 in converters ) { + + // If conv2 outputs current + tmp = conv2.split(" "); + if ( tmp[ 1 ] === current ) { + + // If prev can be converted to accepted input + conv = converters[ prev + " " + tmp[ 0 ] ] || + converters[ "* " + tmp[ 0 ] ]; + if ( conv ) { + // Condense equivalence converters + if ( conv === true ) { + conv = converters[ conv2 ]; + + // Otherwise, insert the intermediate dataType + } else if ( converters[ conv2 ] !== true ) { + current = tmp[ 0 ]; + dataTypes.splice( i--, 0, current ); + } + + break; } - break; } } } - } - // If we found no converter, dispatch an error - if ( !( conv || conv2 ) ) { - jQuery.error( "No conversion from " + conversion.replace(" "," to ") ); - } - // If found converter is not an equivalence - if ( conv !== true ) { - // Convert with 1 or 2 converters accordingly - response = conv ? conv( response ) : conv2( conv1(response) ); - } - } - } - return response; -} + // Apply converter (if not an equivalence) + if ( conv !== true ) { + // Unless errors are allowed to bubble, catch and return them + if ( conv && s["throws"] ) { + response = conv( response ); + } else { + try { + response = conv( response ); + } catch ( e ) { + return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current }; + } + } + } + } + // Update prev for next iteration + prev = current; + } + } -var jsc = jQuery.now(), - jsre = /(\=)\?(&|$)|\?\?/i; + return { state: "success", data: response }; +} +var oldCallbacks = [], + rquestion = /\?/, + rjsonp = /(=)\?(?=&|$)|\?\?/, + nonce = jQuery.now(); // Default jsonp settings jQuery.ajaxSetup({ jsonp: "callback", jsonpCallback: function() { - return jQuery.expando + "_" + ( jsc++ ); + var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) ); + this[ callback ] = true; + return callback; } }); // Detect, normalize options and install callbacks for jsonp requests jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { - var inspectData = ( typeof s.data === "string" ) && /^application\/x\-www\-form\-urlencoded/.test( s.contentType ); - - if ( s.dataTypes[ 0 ] === "jsonp" || - s.jsonp !== false && ( jsre.test( s.url ) || - inspectData && jsre.test( s.data ) ) ) { - - var responseContainer, - jsonpCallback = s.jsonpCallback = - jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback, - previous = window[ jsonpCallback ], - url = s.url, - data = s.data, - replace = "$1" + jsonpCallback + "$2"; - - if ( s.jsonp !== false ) { - url = url.replace( jsre, replace ); - if ( s.url === url ) { - if ( inspectData ) { - data = data.replace( jsre, replace ); - } - if ( s.data === data ) { - // Add callback manually - url += (/\?/.test( url ) ? "&" : "?") + s.jsonp + "=" + jsonpCallback; - } - } + var callbackName, overwritten, responseContainer, + data = s.data, + url = s.url, + hasCallback = s.jsonp !== false, + replaceInUrl = hasCallback && rjsonp.test( url ), + replaceInData = hasCallback && !replaceInUrl && typeof data === "string" && + !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && + rjsonp.test( data ); + + // Handle iff the expected data type is "jsonp" or we have a parameter to set + if ( s.dataTypes[ 0 ] === "jsonp" || replaceInUrl || replaceInData ) { + + // Get callback name, remembering preexisting value associated with it + callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ? + s.jsonpCallback() : + s.jsonpCallback; + overwritten = window[ callbackName ]; + + // Insert callback into url or form data + if ( replaceInUrl ) { + s.url = url.replace( rjsonp, "$1" + callbackName ); + } else if ( replaceInData ) { + s.data = data.replace( rjsonp, "$1" + callbackName ); + } else if ( hasCallback ) { + s.url += ( rquestion.test( url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; } - s.url = url; - s.data = data; - - // Install callback - window[ jsonpCallback ] = function( response ) { - responseContainer = [ response ]; - }; - - // Clean-up function - jqXHR.always(function() { - // Set callback back to previous value - window[ jsonpCallback ] = previous; - // Call if it was a function and we have a response - if ( responseContainer && jQuery.isFunction( previous ) ) { - window[ jsonpCallback ]( responseContainer[ 0 ] ); - } - }); - // Use data converter to retrieve json after script execution s.converters["script json"] = function() { if ( !responseContainer ) { - jQuery.error( jsonpCallback + " was not called" ); + jQuery.error( callbackName + " was not called" ); } return responseContainer[ 0 ]; }; @@ -8038,14 +8200,37 @@ jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { // force json dataType s.dataTypes[ 0 ] = "json"; - // Delegate to script - return "script"; - } -}); + // Install callback + window[ callbackName ] = function() { + responseContainer = arguments; + }; + // Clean-up function (fires after converters) + jqXHR.always(function() { + // Restore preexisting value + window[ callbackName ] = overwritten; + // Save back as free + if ( s[ callbackName ] ) { + // make sure that re-using the options doesn't screw things around + s.jsonpCallback = originalSettings.jsonpCallback; + // save the callback name for future use + oldCallbacks.push( callbackName ); + } + // Call if it was a function and we have a response + if ( responseContainer && jQuery.isFunction( overwritten ) ) { + overwritten( responseContainer[ 0 ] ); + } + + responseContainer = overwritten = undefined; + }); + + // Delegate to script + return "script"; + } +}); // Install script dataType jQuery.ajaxSetup({ accepts: { @@ -8131,19 +8316,15 @@ jQuery.ajaxTransport( "script", function(s) { }; } }); - - - - -var // #5280: Internet Explorer will keep connections alive if we don't abort on unload +var xhrCallbacks, + // #5280: Internet Explorer will keep connections alive if we don't abort on unload xhrOnUnloadAbort = window.ActiveXObject ? function() { // Abort all pending requests for ( var key in xhrCallbacks ) { xhrCallbacks[ key ]( 0, 1 ); } } : false, - xhrId = 0, - xhrCallbacks; + xhrId = 0; // Functions to create xhrs function createStandardXHR() { @@ -8194,9 +8375,8 @@ if ( jQuery.support.ajax ) { send: function( headers, complete ) { // Get a new xhr - var xhr = s.xhr(), - handle, - i; + var handle, i, + xhr = s.xhr(); // Open the socket // Passing null username, generates a login popup on Opera (#2865) @@ -8249,7 +8429,7 @@ if ( jQuery.support.ajax ) { xml; // Firefox throws exceptions when accessing properties - // of an xhr when a network error occured + // of an xhr when a network error occurred // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE) try { @@ -8325,11 +8505,13 @@ if ( jQuery.support.ajax ) { } }; - // if we're in sync mode or it's in cache - // and has been retrieved directly (IE6 & IE7) - // we need to manually fire the callback - if ( !s.async || xhr.readyState === 4 ) { + if ( !s.async ) { + // if we're in sync mode we fire the callback callback(); + } else if ( xhr.readyState === 4 ) { + // (IE6 & IE7) if it's in cache and has been + // retrieved directly we need to fire the callback + setTimeout( callback, 0 ); } else { handle = ++xhrId; if ( xhrOnUnloadAbort ) { @@ -8355,278 +8537,494 @@ if ( jQuery.support.ajax ) { } }); } - - - - -var elemdisplay = {}, - iframe, iframeDoc, +var fxNow, timerId, rfxtypes = /^(?:toggle|show|hide)$/, - rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i, - timerId, - fxAttrs = [ - // height animations - [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ], - // width animations - [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ], - // opacity animations - [ "opacity" ] - ], - fxNow; - -jQuery.fn.extend({ - show: function( speed, easing, callback ) { - var elem, display; - - if ( speed || speed === 0 ) { - return this.animate( genFx("show", 3), speed, easing, callback ); - - } else { - for ( var i = 0, j = this.length; i < j; i++ ) { - elem = this[ i ]; + rfxnum = new RegExp( "^(?:([-+])=|)(" + core_pnum + ")([a-z%]*)$", "i" ), + rrun = /queueHooks$/, + animationPrefilters = [ defaultPrefilter ], + tweeners = { + "*": [function( prop, value ) { + var end, unit, + tween = this.createTween( prop, value ), + parts = rfxnum.exec( value ), + target = tween.cur(), + start = +target || 0, + scale = 1, + maxIterations = 20; + + if ( parts ) { + end = +parts[2]; + unit = parts[3] || ( jQuery.cssNumber[ prop ] ? "" : "px" ); + + // We need to compute starting value + if ( unit !== "px" && start ) { + // Iteratively approximate from a nonzero starting point + // Prefer the current property, because this process will be trivial if it uses the same units + // Fallback to end or a simple constant + start = jQuery.css( tween.elem, prop, true ) || end || 1; + + do { + // If previous iteration zeroed out, double until we get *something* + // Use a string for doubling factor so we don't accidentally see scale as unchanged below + scale = scale || ".5"; + + // Adjust and apply + start = start / scale; + jQuery.style( tween.elem, prop, start + unit ); + + // Update scale, tolerating zero or NaN from tween.cur() + // And breaking the loop if scale is unchanged or perfect, or if we've just had enough + } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations ); + } + + tween.unit = unit; + tween.start = start; + // If a +=/-= token was provided, we're doing a relative animation + tween.end = parts[1] ? start + ( parts[1] + 1 ) * end : end; + } + return tween; + }] + }; - if ( elem.style ) { - display = elem.style.display; +// Animations created synchronously will run synchronously +function createFxNow() { + setTimeout(function() { + fxNow = undefined; + }, 0 ); + return ( fxNow = jQuery.now() ); +} - // Reset the inline display of this element to learn if it is - // being hidden by cascaded rules or not - if ( !jQuery._data(elem, "olddisplay") && display === "none" ) { - display = elem.style.display = ""; - } +function createTweens( animation, props ) { + jQuery.each( props, function( prop, value ) { + var collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ), + index = 0, + length = collection.length; + for ( ; index < length; index++ ) { + if ( collection[ index ].call( animation, prop, value ) ) { - // Set elements which have been overridden with display: none - // in a stylesheet to whatever the default browser style is - // for such an element - if ( (display === "" && jQuery.css(elem, "display") === "none") || - !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) { - jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) ); - } - } + // we're done with this property + return; } + } + }); +} - // Set the display of most of the elements in a second loop - // to avoid the constant reflow - for ( i = 0; i < j; i++ ) { - elem = this[ i ]; +function Animation( elem, properties, options ) { + var result, + index = 0, + tweenerIndex = 0, + length = animationPrefilters.length, + deferred = jQuery.Deferred().always( function() { + // don't match elem in the :animated selector + delete tick.elem; + }), + tick = function() { + var currentTime = fxNow || createFxNow(), + remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), + percent = 1 - ( remaining / animation.duration || 0 ), + index = 0, + length = animation.tweens.length; + + for ( ; index < length ; index++ ) { + animation.tweens[ index ].run( percent ); + } + + deferred.notifyWith( elem, [ animation, percent, remaining ]); + + if ( percent < 1 && length ) { + return remaining; + } else { + deferred.resolveWith( elem, [ animation ] ); + return false; + } + }, + animation = deferred.promise({ + elem: elem, + props: jQuery.extend( {}, properties ), + opts: jQuery.extend( true, { specialEasing: {} }, options ), + originalProperties: properties, + originalOptions: options, + startTime: fxNow || createFxNow(), + duration: options.duration, + tweens: [], + createTween: function( prop, end, easing ) { + var tween = jQuery.Tween( elem, animation.opts, prop, end, + animation.opts.specialEasing[ prop ] || animation.opts.easing ); + animation.tweens.push( tween ); + return tween; + }, + stop: function( gotoEnd ) { + var index = 0, + // if we are going to the end, we want to run all the tweens + // otherwise we skip this part + length = gotoEnd ? animation.tweens.length : 0; - if ( elem.style ) { - display = elem.style.display; + for ( ; index < length ; index++ ) { + animation.tweens[ index ].run( 1 ); + } - if ( display === "" || display === "none" ) { - elem.style.display = jQuery._data( elem, "olddisplay" ) || ""; - } + // resolve when we played the last frame + // otherwise, reject + if ( gotoEnd ) { + deferred.resolveWith( elem, [ animation, gotoEnd ] ); + } else { + deferred.rejectWith( elem, [ animation, gotoEnd ] ); } + return this; } + }), + props = animation.props; - return this; + propFilter( props, animation.opts.specialEasing ); + + for ( ; index < length ; index++ ) { + result = animationPrefilters[ index ].call( animation, elem, props, animation.opts ); + if ( result ) { + return result; } - }, + } - hide: function( speed, easing, callback ) { - if ( speed || speed === 0 ) { - return this.animate( genFx("hide", 3), speed, easing, callback); + createTweens( animation, props ); - } else { - var elem, display, - i = 0, - j = this.length; + if ( jQuery.isFunction( animation.opts.start ) ) { + animation.opts.start.call( elem, animation ); + } - for ( ; i < j; i++ ) { - elem = this[i]; - if ( elem.style ) { - display = jQuery.css( elem, "display" ); + jQuery.fx.timer( + jQuery.extend( tick, { + anim: animation, + queue: animation.opts.queue, + elem: elem + }) + ); - if ( display !== "none" && !jQuery._data( elem, "olddisplay" ) ) { - jQuery._data( elem, "olddisplay", display ); - } - } - } + // attach callbacks from options + return animation.progress( animation.opts.progress ) + .done( animation.opts.done, animation.opts.complete ) + .fail( animation.opts.fail ) + .always( animation.opts.always ); +} - // Set the display of the elements in a second loop - // to avoid the constant reflow - for ( i = 0; i < j; i++ ) { - if ( this[i].style ) { - this[i].style.display = "none"; - } - } +function propFilter( props, specialEasing ) { + var index, name, easing, value, hooks; - return this; + // camelCase, specialEasing and expand cssHook pass + for ( index in props ) { + name = jQuery.camelCase( index ); + easing = specialEasing[ name ]; + value = props[ index ]; + if ( jQuery.isArray( value ) ) { + easing = value[ 1 ]; + value = props[ index ] = value[ 0 ]; } - }, - // Save the old toggle function - _toggle: jQuery.fn.toggle, + if ( index !== name ) { + props[ name ] = value; + delete props[ index ]; + } - toggle: function( fn, fn2, callback ) { - var bool = typeof fn === "boolean"; + hooks = jQuery.cssHooks[ name ]; + if ( hooks && "expand" in hooks ) { + value = hooks.expand( value ); + delete props[ name ]; - if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) { - this._toggle.apply( this, arguments ); + // not quite $.extend, this wont overwrite keys already present. + // also - reusing 'index' from above because we have the correct "name" + for ( index in value ) { + if ( !( index in props ) ) { + props[ index ] = value[ index ]; + specialEasing[ index ] = easing; + } + } + } else { + specialEasing[ name ] = easing; + } + } +} - } else if ( fn == null || bool ) { - this.each(function() { - var state = bool ? fn : jQuery(this).is(":hidden"); - jQuery(this)[ state ? "show" : "hide" ](); - }); +jQuery.Animation = jQuery.extend( Animation, { + tweener: function( props, callback ) { + if ( jQuery.isFunction( props ) ) { + callback = props; + props = [ "*" ]; } else { - this.animate(genFx("toggle", 3), fn, fn2, callback); + props = props.split(" "); } - return this; - }, + var prop, + index = 0, + length = props.length; - fadeTo: function( speed, to, easing, callback ) { - return this.filter(":hidden").css("opacity", 0).show().end() - .animate({opacity: to}, speed, easing, callback); + for ( ; index < length ; index++ ) { + prop = props[ index ]; + tweeners[ prop ] = tweeners[ prop ] || []; + tweeners[ prop ].unshift( callback ); + } }, - animate: function( prop, speed, easing, callback ) { - var optall = jQuery.speed( speed, easing, callback ); + prefilter: function( callback, prepend ) { + if ( prepend ) { + animationPrefilters.unshift( callback ); + } else { + animationPrefilters.push( callback ); + } + } +}); - if ( jQuery.isEmptyObject( prop ) ) { - return this.each( optall.complete, [ false ] ); +function defaultPrefilter( elem, props, opts ) { + var index, prop, value, length, dataShow, tween, hooks, oldfire, + anim = this, + style = elem.style, + orig = {}, + handled = [], + hidden = elem.nodeType && isHidden( elem ); + + // handle queue: false promises + if ( !opts.queue ) { + hooks = jQuery._queueHooks( elem, "fx" ); + if ( hooks.unqueued == null ) { + hooks.unqueued = 0; + oldfire = hooks.empty.fire; + hooks.empty.fire = function() { + if ( !hooks.unqueued ) { + oldfire(); + } + }; } + hooks.unqueued++; - // Do not change referenced properties as per-property easing will be lost - prop = jQuery.extend( {}, prop ); + anim.always(function() { + // doing this makes sure that the complete handler will be called + // before this completes + anim.always(function() { + hooks.unqueued--; + if ( !jQuery.queue( elem, "fx" ).length ) { + hooks.empty.fire(); + } + }); + }); + } + + // height/width overflow pass + if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) { + // Make sure that nothing sneaks out + // Record all 3 overflow attributes because IE does not + // change the overflow attribute when overflowX and + // overflowY are set to the same value + opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; - function doAnimation() { - // XXX 'this' does not always have a nodeName when running the - // test suite + // Set display property to inline-block for height/width + // animations on inline elements that are having width/height animated + if ( jQuery.css( elem, "display" ) === "inline" && + jQuery.css( elem, "float" ) === "none" ) { - if ( optall.queue === false ) { - jQuery._mark( this ); + // inline-level elements accept inline-block; + // block-level elements need to be inline with layout + if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) { + style.display = "inline-block"; + + } else { + style.zoom = 1; } + } + } - var opt = jQuery.extend( {}, optall ), - isElement = this.nodeType === 1, - hidden = isElement && jQuery(this).is(":hidden"), - name, val, p, e, hooks, replace, - parts, start, end, unit, - method; + if ( opts.overflow ) { + style.overflow = "hidden"; + if ( !jQuery.support.shrinkWrapBlocks ) { + anim.done(function() { + style.overflow = opts.overflow[ 0 ]; + style.overflowX = opts.overflow[ 1 ]; + style.overflowY = opts.overflow[ 2 ]; + }); + } + } - // will store per property easing and be used to determine when an animation is complete - opt.animatedProperties = {}; - // first pass over propertys to expand / normalize - for ( p in prop ) { - name = jQuery.camelCase( p ); - if ( p !== name ) { - prop[ name ] = prop[ p ]; - delete prop[ p ]; - } + // show/hide pass + for ( index in props ) { + value = props[ index ]; + if ( rfxtypes.exec( value ) ) { + delete props[ index ]; + if ( value === ( hidden ? "hide" : "show" ) ) { + continue; + } + handled.push( index ); + } + } - if ( ( hooks = jQuery.cssHooks[ name ] ) && "expand" in hooks ) { - replace = hooks.expand( prop[ name ] ); - delete prop[ name ]; + length = handled.length; + if ( length ) { + dataShow = jQuery._data( elem, "fxshow" ) || jQuery._data( elem, "fxshow", {} ); + if ( hidden ) { + jQuery( elem ).show(); + } else { + anim.done(function() { + jQuery( elem ).hide(); + }); + } + anim.done(function() { + var prop; + jQuery.removeData( elem, "fxshow", true ); + for ( prop in orig ) { + jQuery.style( elem, prop, orig[ prop ] ); + } + }); + for ( index = 0 ; index < length ; index++ ) { + prop = handled[ index ]; + tween = anim.createTween( prop, hidden ? dataShow[ prop ] : 0 ); + orig[ prop ] = dataShow[ prop ] || jQuery.style( elem, prop ); - // not quite $.extend, this wont overwrite keys already present. - // also - reusing 'p' from above because we have the correct "name" - for ( p in replace ) { - if ( ! ( p in prop ) ) { - prop[ p ] = replace[ p ]; - } - } + if ( !( prop in dataShow ) ) { + dataShow[ prop ] = tween.start; + if ( hidden ) { + tween.end = tween.start; + tween.start = prop === "width" || prop === "height" ? 1 : 0; } } + } + } +} - for ( name in prop ) { - val = prop[ name ]; - // easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default) - if ( jQuery.isArray( val ) ) { - opt.animatedProperties[ name ] = val[ 1 ]; - val = prop[ name ] = val[ 0 ]; - } else { - opt.animatedProperties[ name ] = opt.specialEasing && opt.specialEasing[ name ] || opt.easing || 'swing'; - } +function Tween( elem, options, prop, end, easing ) { + return new Tween.prototype.init( elem, options, prop, end, easing ); +} +jQuery.Tween = Tween; - if ( val === "hide" && hidden || val === "show" && !hidden ) { - return opt.complete.call( this ); - } +Tween.prototype = { + constructor: Tween, + init: function( elem, options, prop, end, easing, unit ) { + this.elem = elem; + this.prop = prop; + this.easing = easing || "swing"; + this.options = options; + this.start = this.now = this.cur(); + this.end = end; + this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); + }, + cur: function() { + var hooks = Tween.propHooks[ this.prop ]; - if ( isElement && ( name === "height" || name === "width" ) ) { - // Make sure that nothing sneaks out - // Record all 3 overflow attributes because IE does not - // change the overflow attribute when overflowX and - // overflowY are set to the same value - opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ]; + return hooks && hooks.get ? + hooks.get( this ) : + Tween.propHooks._default.get( this ); + }, + run: function( percent ) { + var eased, + hooks = Tween.propHooks[ this.prop ]; - // Set display property to inline-block for height/width - // animations on inline elements that are having width/height animated - if ( jQuery.css( this, "display" ) === "inline" && - jQuery.css( this, "float" ) === "none" ) { + if ( this.options.duration ) { + this.pos = eased = jQuery.easing[ this.easing ]( + percent, this.options.duration * percent, 0, 1, this.options.duration + ); + } else { + this.pos = eased = percent; + } + this.now = ( this.end - this.start ) * eased + this.start; - // inline-level elements accept inline-block; - // block-level elements need to be inline with layout - if ( !jQuery.support.inlineBlockNeedsLayout || defaultDisplay( this.nodeName ) === "inline" ) { - this.style.display = "inline-block"; + if ( this.options.step ) { + this.options.step.call( this.elem, this.now, this ); + } - } else { - this.style.zoom = 1; - } - } - } + if ( hooks && hooks.set ) { + hooks.set( this ); + } else { + Tween.propHooks._default.set( this ); + } + return this; + } +}; + +Tween.prototype.init.prototype = Tween.prototype; + +Tween.propHooks = { + _default: { + get: function( tween ) { + var result; + + if ( tween.elem[ tween.prop ] != null && + (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) { + return tween.elem[ tween.prop ]; } - if ( opt.overflow != null ) { - this.style.overflow = "hidden"; + // passing any value as a 4th parameter to .css will automatically + // attempt a parseFloat and fallback to a string if the parse fails + // so, simple values such as "10px" are parsed to Float. + // complex values such as "rotate(1rad)" are returned as is. + result = jQuery.css( tween.elem, tween.prop, false, "" ); + // Empty strings, null, undefined and "auto" are converted to 0. + return !result || result === "auto" ? 0 : result; + }, + set: function( tween ) { + // use step hook for back compat - use cssHook if its there - use .style if its + // available and use plain properties where available + if ( jQuery.fx.step[ tween.prop ] ) { + jQuery.fx.step[ tween.prop ]( tween ); + } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) { + jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); + } else { + tween.elem[ tween.prop ] = tween.now; } + } + } +}; - for ( p in prop ) { - e = new jQuery.fx( this, opt, p ); - val = prop[ p ]; +// Remove in 2.0 - this supports IE8's panic based approach +// to setting things on disconnected nodes - if ( rfxtypes.test( val ) ) { +Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { + set: function( tween ) { + if ( tween.elem.nodeType && tween.elem.parentNode ) { + tween.elem[ tween.prop ] = tween.now; + } + } +}; - // Tracks whether to show or hide based on private - // data attached to the element - method = jQuery._data( this, "toggle" + p ) || ( val === "toggle" ? hidden ? "show" : "hide" : 0 ); - if ( method ) { - jQuery._data( this, "toggle" + p, method === "show" ? "hide" : "show" ); - e[ method ](); - } else { - e[ val ](); - } +jQuery.each([ "toggle", "show", "hide" ], function( i, name ) { + var cssFn = jQuery.fn[ name ]; + jQuery.fn[ name ] = function( speed, easing, callback ) { + return speed == null || typeof speed === "boolean" || + // special check for .toggle( handler, handler, ... ) + ( !i && jQuery.isFunction( speed ) && jQuery.isFunction( easing ) ) ? + cssFn.apply( this, arguments ) : + this.animate( genFx( name, true ), speed, easing, callback ); + }; +}); - } else { - parts = rfxnum.exec( val ); - start = e.cur(); - - if ( parts ) { - end = parseFloat( parts[2] ); - unit = parts[3] || ( jQuery.cssNumber[ p ] ? "" : "px" ); - - // We need to compute starting value - if ( unit !== "px" ) { - jQuery.style( this, p, (end || 1) + unit); - start = ( (end || 1) / e.cur() ) * start; - jQuery.style( this, p, start + unit); - } +jQuery.fn.extend({ + fadeTo: function( speed, to, easing, callback ) { - // If a +=/-= token was provided, we're doing a relative animation - if ( parts[1] ) { - end = ( (parts[ 1 ] === "-=" ? -1 : 1) * end ) + start; - } + // show any hidden elements after setting opacity to 0 + return this.filter( isHidden ).css( "opacity", 0 ).show() - e.custom( start, end, unit ); + // animate to the value specified + .end().animate({ opacity: to }, speed, easing, callback ); + }, + animate: function( prop, speed, easing, callback ) { + var empty = jQuery.isEmptyObject( prop ), + optall = jQuery.speed( speed, easing, callback ), + doAnimation = function() { + // Operate on a copy of prop so per-property easing won't be lost + var anim = Animation( this, jQuery.extend( {}, prop ), optall ); - } else { - e.custom( start, val, "" ); - } + // Empty animations resolve immediately + if ( empty ) { + anim.stop( true ); } - } - - // For JS strict compliance - return true; - } + }; - return optall.queue === false ? + return empty || optall.queue === false ? this.each( doAnimation ) : this.queue( optall.queue, doAnimation ); }, - stop: function( type, clearQueue, gotoEnd ) { + var stopQueue = function( hooks ) { + var stop = hooks.stop; + delete hooks.stop; + stop( gotoEnd ); + }; + if ( typeof type !== "string" ) { gotoEnd = clearQueue; clearQueue = type; @@ -8637,42 +9035,27 @@ jQuery.fn.extend({ } return this.each(function() { - var index, - hadTimers = false, + var dequeue = true, + index = type != null && type + "queueHooks", timers = jQuery.timers, data = jQuery._data( this ); - // clear marker counters if we know they won't be - if ( !gotoEnd ) { - jQuery._unmark( true, this ); - } - - function stopQueue( elem, data, index ) { - var hooks = data[ index ]; - jQuery.removeData( elem, index, true ); - hooks.stop( gotoEnd ); - } - - if ( type == null ) { + if ( index ) { + if ( data[ index ] && data[ index ].stop ) { + stopQueue( data[ index ] ); + } + } else { for ( index in data ) { - if ( data[ index ] && data[ index ].stop && index.indexOf(".run") === index.length - 4 ) { - stopQueue( this, data, index ); + if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { + stopQueue( data[ index ] ); } } - } else if ( data[ index = type + ".run" ] && data[ index ].stop ){ - stopQueue( this, data, index ); } for ( index = timers.length; index--; ) { if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) { - if ( gotoEnd ) { - - // force the next step to be the last - timers[ index ]( true ); - } else { - timers[ index ].saveState(); - } - hadTimers = true; + timers[ index ].anim.stop( gotoEnd ); + dequeue = false; timers.splice( index, 1 ); } } @@ -8680,40 +9063,39 @@ jQuery.fn.extend({ // start the next in the queue if the last step wasn't forced // timers currently will call their complete callbacks, which will dequeue // but only if they were gotoEnd - if ( !( gotoEnd && hadTimers ) ) { + if ( dequeue || !gotoEnd ) { jQuery.dequeue( this, type ); } }); } - }); -// Animations created synchronously will run synchronously -function createFxNow() { - setTimeout( clearFxNow, 0 ); - return ( fxNow = jQuery.now() ); -} - -function clearFxNow() { - fxNow = undefined; -} - // Generate parameters to create a standard animation -function genFx( type, num ) { - var obj = {}; +function genFx( type, includeWidth ) { + var which, + attrs = { height: type }, + i = 0; + + // if we include width, step value is 1 to do all cssExpand values, + // if we don't include width, step value is 2 to skip over Left and Right + includeWidth = includeWidth? 1 : 0; + for( ; i < 4 ; i += 2 - includeWidth ) { + which = cssExpand[ i ]; + attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; + } - jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice( 0, num )), function() { - obj[ this ] = type; - }); + if ( includeWidth ) { + attrs.opacity = attrs.width = type; + } - return obj; + return attrs; } // Generate shortcuts for custom animations jQuery.each({ - slideDown: genFx( "show", 1 ), - slideUp: genFx( "hide", 1 ), - slideToggle: genFx( "toggle", 1 ), + slideDown: genFx("show"), + slideUp: genFx("hide"), + slideToggle: genFx("toggle"), fadeIn: { opacity: "show" }, fadeOut: { opacity: "hide" }, fadeToggle: { opacity: "toggle" } @@ -8723,285 +9105,89 @@ jQuery.each({ }; }); -jQuery.extend({ - speed: function( speed, easing, fn ) { - var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { - complete: fn || !fn && easing || - jQuery.isFunction( speed ) && speed, - duration: speed, - easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing - }; - - opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : - opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default; - - // normalize opt.queue - true/undefined/null -> "fx" - if ( opt.queue == null || opt.queue === true ) { - opt.queue = "fx"; - } - - // Queueing - opt.old = opt.complete; - - opt.complete = function( noUnmark ) { - if ( jQuery.isFunction( opt.old ) ) { - opt.old.call( this ); - } - - if ( opt.queue ) { - jQuery.dequeue( this, opt.queue ); - } else if ( noUnmark !== false ) { - jQuery._unmark( this ); - } - }; - - return opt; - }, - - easing: { - linear: function( p ) { - return p; - }, - swing: function( p ) { - return ( -Math.cos( p*Math.PI ) / 2 ) + 0.5; - } - }, +jQuery.speed = function( speed, easing, fn ) { + var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { + complete: fn || !fn && easing || + jQuery.isFunction( speed ) && speed, + duration: speed, + easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing + }; - timers: [], + opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : + opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default; - fx: function( elem, options, prop ) { - this.options = options; - this.elem = elem; - this.prop = prop; - - options.orig = options.orig || {}; + // normalize opt.queue - true/undefined/null -> "fx" + if ( opt.queue == null || opt.queue === true ) { + opt.queue = "fx"; } -}); - -jQuery.fx.prototype = { - // Simple function for setting a style value - update: function() { - if ( this.options.step ) { - this.options.step.call( this.elem, this.now, this ); - } - - ( jQuery.fx.step[ this.prop ] || jQuery.fx.step._default )( this ); - }, + // Queueing + opt.old = opt.complete; - // Get the current size - cur: function() { - if ( this.elem[ this.prop ] != null && (!this.elem.style || this.elem.style[ this.prop ] == null) ) { - return this.elem[ this.prop ]; + opt.complete = function() { + if ( jQuery.isFunction( opt.old ) ) { + opt.old.call( this ); } - var parsed, - r = jQuery.css( this.elem, this.prop ); - // Empty strings, null, undefined and "auto" are converted to 0, - // complex values such as "rotate(1rad)" are returned as is, - // simple values such as "10px" are parsed to Float. - return isNaN( parsed = parseFloat( r ) ) ? !r || r === "auto" ? 0 : r : parsed; - }, - - // Start an animation from one number to another - custom: function( from, to, unit ) { - var self = this, - fx = jQuery.fx; - - this.startTime = fxNow || createFxNow(); - this.end = to; - this.now = this.start = from; - this.pos = this.state = 0; - this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" ); - - function t( gotoEnd ) { - return self.step( gotoEnd ); + if ( opt.queue ) { + jQuery.dequeue( this, opt.queue ); } + }; - t.queue = this.options.queue; - t.elem = this.elem; - t.saveState = function() { - if ( jQuery._data( self.elem, "fxshow" + self.prop ) === undefined ) { - if ( self.options.hide ) { - jQuery._data( self.elem, "fxshow" + self.prop, self.start ); - } else if ( self.options.show ) { - jQuery._data( self.elem, "fxshow" + self.prop, self.end ); - } - } - }; - - if ( t() && jQuery.timers.push(t) && !timerId ) { - timerId = setInterval( fx.tick, fx.interval ); - } - }, - - // Simple 'show' function - show: function() { - var dataShow = jQuery._data( this.elem, "fxshow" + this.prop ); - - // Remember where we started, so that we can go back to it later - this.options.orig[ this.prop ] = dataShow || jQuery.style( this.elem, this.prop ); - this.options.show = true; - - // Begin the animation - // Make sure that we start at a small width/height to avoid any flash of content - if ( dataShow !== undefined ) { - // This show is picking up where a previous hide or show left off - this.custom( this.cur(), dataShow ); - } else { - this.custom( this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur() ); - } - - // Start by showing the element - jQuery( this.elem ).show(); - }, - - // Simple 'hide' function - hide: function() { - // Remember where we started, so that we can go back to it later - this.options.orig[ this.prop ] = jQuery._data( this.elem, "fxshow" + this.prop ) || jQuery.style( this.elem, this.prop ); - this.options.hide = true; + return opt; +}; - // Begin the animation - this.custom( this.cur(), 0 ); +jQuery.easing = { + linear: function( p ) { + return p; }, - - // Each step of an animation - step: function( gotoEnd ) { - var p, n, complete, - t = fxNow || createFxNow(), - done = true, - elem = this.elem, - options = this.options; - - if ( gotoEnd || t >= options.duration + this.startTime ) { - this.now = this.end; - this.pos = this.state = 1; - this.update(); - - options.animatedProperties[ this.prop ] = true; - - for ( p in options.animatedProperties ) { - if ( options.animatedProperties[ p ] !== true ) { - done = false; - } - } - - if ( done ) { - // Reset the overflow - if ( options.overflow != null && !jQuery.support.shrinkWrapBlocks ) { - - jQuery.each( [ "", "X", "Y" ], function( index, value ) { - elem.style[ "overflow" + value ] = options.overflow[ index ]; - }); - } - - // Hide the element if the "hide" operation was done - if ( options.hide ) { - jQuery( elem ).hide(); - } - - // Reset the properties, if the item has been hidden or shown - if ( options.hide || options.show ) { - for ( p in options.animatedProperties ) { - jQuery.style( elem, p, options.orig[ p ] ); - jQuery.removeData( elem, "fxshow" + p, true ); - // Toggle data is no longer needed - jQuery.removeData( elem, "toggle" + p, true ); - } - } - - // Execute the complete function - // in the event that the complete function throws an exception - // we must ensure it won't be called twice. #5684 - - complete = options.complete; - if ( complete ) { - - options.complete = false; - complete.call( elem ); - } - } - - return false; - - } else { - // classical easing cannot be used with an Infinity duration - if ( options.duration == Infinity ) { - this.now = t; - } else { - n = t - this.startTime; - this.state = n / options.duration; - - // Perform the easing function, defaults to swing - this.pos = jQuery.easing[ options.animatedProperties[this.prop] ]( this.state, n, 0, 1, options.duration ); - this.now = this.start + ( (this.end - this.start) * this.pos ); - } - // Perform the next step of the animation - this.update(); - } - - return true; + swing: function( p ) { + return 0.5 - Math.cos( p*Math.PI ) / 2; } }; -jQuery.extend( jQuery.fx, { - tick: function() { - var timer, - timers = jQuery.timers, - i = 0; - - for ( ; i < timers.length; i++ ) { - timer = timers[ i ]; - // Checks the timer has not already been removed - if ( !timer() && timers[ i ] === timer ) { - timers.splice( i--, 1 ); - } - } +jQuery.timers = []; +jQuery.fx = Tween.prototype.init; +jQuery.fx.tick = function() { + var timer, + timers = jQuery.timers, + i = 0; - if ( !timers.length ) { - jQuery.fx.stop(); + for ( ; i < timers.length; i++ ) { + timer = timers[ i ]; + // Checks the timer has not already been removed + if ( !timer() && timers[ i ] === timer ) { + timers.splice( i--, 1 ); } - }, + } - interval: 13, + if ( !timers.length ) { + jQuery.fx.stop(); + } +}; - stop: function() { - clearInterval( timerId ); - timerId = null; - }, +jQuery.fx.timer = function( timer ) { + if ( timer() && jQuery.timers.push( timer ) && !timerId ) { + timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval ); + } +}; - speeds: { - slow: 600, - fast: 200, - // Default speed - _default: 400 - }, +jQuery.fx.interval = 13; - step: { - opacity: function( fx ) { - jQuery.style( fx.elem, "opacity", fx.now ); - }, +jQuery.fx.stop = function() { + clearInterval( timerId ); + timerId = null; +}; - _default: function( fx ) { - if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) { - fx.elem.style[ fx.prop ] = fx.now + fx.unit; - } else { - fx.elem[ fx.prop ] = fx.now; - } - } - } -}); +jQuery.fx.speeds = { + slow: 600, + fast: 200, + // Default speed + _default: 400 +}; -// Ensure props that can't be negative don't go there on undershoot easing -jQuery.each( fxAttrs.concat.apply( [], fxAttrs ), function( i, prop ) { - // exclude marginTop, marginLeft, marginBottom and marginRight from this list - if ( prop.indexOf( "margin" ) ) { - jQuery.fx.step[ prop ] = function( fx ) { - jQuery.style( fx.elem, prop, Math.max(0, fx.now) + fx.unit ); - }; - } -}); +// Back Compat <1.8 extension point +jQuery.fx.step = {}; if ( jQuery.expr && jQuery.expr.filters ) { jQuery.expr.filters.animated = function( elem ) { @@ -9010,136 +9196,7 @@ if ( jQuery.expr && jQuery.expr.filters ) { }).length; }; } - -// Try to restore the default display value of an element -function defaultDisplay( nodeName ) { - - if ( !elemdisplay[ nodeName ] ) { - - var body = document.body, - elem = jQuery( "<" + nodeName + ">" ).appendTo( body ), - display = elem.css( "display" ); - elem.remove(); - - // If the simple way fails, - // get element's real default display by attaching it to a temp iframe - if ( display === "none" || display === "" ) { - // No iframe to use yet, so create it - if ( !iframe ) { - iframe = document.createElement( "iframe" ); - iframe.frameBorder = iframe.width = iframe.height = 0; - } - - body.appendChild( iframe ); - - // Create a cacheable copy of the iframe document on first call. - // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML - // document to it; WebKit & Firefox won't allow reusing the iframe document. - if ( !iframeDoc || !iframe.createElement ) { - iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document; - iframeDoc.write( ( jQuery.support.boxModel ? "<!doctype html>" : "" ) + "<html><body>" ); - iframeDoc.close(); - } - - elem = iframeDoc.createElement( nodeName ); - - iframeDoc.body.appendChild( elem ); - - display = jQuery.css( elem, "display" ); - body.removeChild( iframe ); - } - - // Store the correct default display - elemdisplay[ nodeName ] = display; - } - - return elemdisplay[ nodeName ]; -} - - - - -var getOffset, - rtable = /^t(?:able|d|h)$/i, - rroot = /^(?:body|html)$/i; - -if ( "getBoundingClientRect" in document.documentElement ) { - getOffset = function( elem, doc, docElem, box ) { - try { - box = elem.getBoundingClientRect(); - } catch(e) {} - - // Make sure we're not dealing with a disconnected DOM node - if ( !box || !jQuery.contains( docElem, elem ) ) { - return box ? { top: box.top, left: box.left } : { top: 0, left: 0 }; - } - - var body = doc.body, - win = getWindow( doc ), - clientTop = docElem.clientTop || body.clientTop || 0, - clientLeft = docElem.clientLeft || body.clientLeft || 0, - scrollTop = win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop, - scrollLeft = win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft, - top = box.top + scrollTop - clientTop, - left = box.left + scrollLeft - clientLeft; - - return { top: top, left: left }; - }; - -} else { - getOffset = function( elem, doc, docElem ) { - var computedStyle, - offsetParent = elem.offsetParent, - prevOffsetParent = elem, - body = doc.body, - defaultView = doc.defaultView, - prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle, - top = elem.offsetTop, - left = elem.offsetLeft; - - while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) { - if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) { - break; - } - - computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle; - top -= elem.scrollTop; - left -= elem.scrollLeft; - - if ( elem === offsetParent ) { - top += elem.offsetTop; - left += elem.offsetLeft; - - if ( jQuery.support.doesNotAddBorder && !(jQuery.support.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) { - top += parseFloat( computedStyle.borderTopWidth ) || 0; - left += parseFloat( computedStyle.borderLeftWidth ) || 0; - } - - prevOffsetParent = offsetParent; - offsetParent = elem.offsetParent; - } - - if ( jQuery.support.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) { - top += parseFloat( computedStyle.borderTopWidth ) || 0; - left += parseFloat( computedStyle.borderLeftWidth ) || 0; - } - - prevComputedStyle = computedStyle; - } - - if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) { - top += body.offsetTop; - left += body.offsetLeft; - } - - if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) { - top += Math.max( docElem.scrollTop, body.scrollTop ); - left += Math.max( docElem.scrollLeft, body.scrollLeft ); - } - - return { top: top, left: left }; - }; -} +var rroot = /^(?:body|html)$/i; jQuery.fn.offset = function( options ) { if ( arguments.length ) { @@ -9150,18 +9207,40 @@ jQuery.fn.offset = function( options ) { }); } - var elem = this[0], + var docElem, body, win, clientTop, clientLeft, scrollTop, scrollLeft, + box = { top: 0, left: 0 }, + elem = this[ 0 ], doc = elem && elem.ownerDocument; if ( !doc ) { - return null; + return; } - if ( elem === doc.body ) { + if ( (body = doc.body) === elem ) { return jQuery.offset.bodyOffset( elem ); } - return getOffset( elem, doc, doc.documentElement ); + docElem = doc.documentElement; + + // Make sure it's not a disconnected DOM node + if ( !jQuery.contains( docElem, elem ) ) { + return box; + } + + // If we don't have gBCR, just use 0,0 rather than error + // BlackBerry 5, iOS 3 (original iPhone) + if ( typeof elem.getBoundingClientRect !== "undefined" ) { + box = elem.getBoundingClientRect(); + } + win = getWindow( doc ); + clientTop = docElem.clientTop || body.clientTop || 0; + clientLeft = docElem.clientLeft || body.clientLeft || 0; + scrollTop = win.pageYOffset || docElem.scrollTop; + scrollLeft = win.pageXOffset || docElem.scrollLeft; + return { + top: box.top + scrollTop - clientTop, + left: box.left + scrollLeft - clientLeft + }; }; jQuery.offset = { @@ -9227,7 +9306,7 @@ jQuery.fn.extend({ position: function() { if ( !this[0] ) { - return null; + return; } var elem = this[0], @@ -9262,7 +9341,7 @@ jQuery.fn.extend({ while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) { offsetParent = offsetParent.offsetParent; } - return offsetParent; + return offsetParent || document.body; }); } }); @@ -9278,8 +9357,7 @@ jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( me if ( val === undefined ) { return win ? (prop in win) ? win[ prop ] : - jQuery.support.boxModel && win.document.documentElement[ method ] || - win.document.body[ method ] : + win.document.documentElement[ method ] : elem[ method ]; } @@ -9303,83 +9381,47 @@ function getWindow( elem ) { elem.defaultView || elem.parentWindow : false; } - - - - -// Create width, height, innerHeight, innerWidth, outerHeight and outerWidth methods +// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { - var clientProp = "client" + name, - scrollProp = "scroll" + name, - offsetProp = "offset" + name; - - // innerHeight and innerWidth - jQuery.fn[ "inner" + name ] = function() { - var elem = this[0]; - return elem ? - elem.style ? - parseFloat( jQuery.css( elem, type, "padding" ) ) : - this[ type ]() : - null; - }; - - // outerHeight and outerWidth - jQuery.fn[ "outer" + name ] = function( margin ) { - var elem = this[0]; - return elem ? - elem.style ? - parseFloat( jQuery.css( elem, type, margin ? "margin" : "border" ) ) : - this[ type ]() : - null; - }; - - jQuery.fn[ type ] = function( value ) { - return jQuery.access( this, function( elem, type, value ) { - var doc, docElemProp, orig, ret; - - if ( jQuery.isWindow( elem ) ) { - // 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat - doc = elem.document; - docElemProp = doc.documentElement[ clientProp ]; - return jQuery.support.boxModel && docElemProp || - doc.body && doc.body[ clientProp ] || docElemProp; - } - - // Get document width or height - if ( elem.nodeType === 9 ) { - // Either scroll[Width/Height] or offset[Width/Height], whichever is greater - doc = elem.documentElement; - - // when a window > document, IE6 reports a offset[Width/Height] > client[Width/Height] - // so we can't use max, as it'll choose the incorrect offset[Width/Height] - // instead we use the correct client[Width/Height] - // support:IE6 - if ( doc[ clientProp ] >= doc[ scrollProp ] ) { - return doc[ clientProp ]; + jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) { + // margin is only for outerHeight, outerWidth + jQuery.fn[ funcName ] = function( margin, value ) { + var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), + extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); + + return jQuery.access( this, function( elem, type, value ) { + var doc; + + if ( jQuery.isWindow( elem ) ) { + // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there + // isn't a whole lot we can do. See pull request at this URL for discussion: + // https://github.com/jquery/jquery/pull/764 + return elem.document.documentElement[ "client" + name ]; + } + + // Get document width or height + if ( elem.nodeType === 9 ) { + doc = elem.documentElement; + + // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest + // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it. + return Math.max( + elem.body[ "scroll" + name ], doc[ "scroll" + name ], + elem.body[ "offset" + name ], doc[ "offset" + name ], + doc[ "client" + name ] + ); } - return Math.max( - elem.body[ scrollProp ], doc[ scrollProp ], - elem.body[ offsetProp ], doc[ offsetProp ] - ); - } + return value === undefined ? + // Get width or height on the element, requesting but not forcing parseFloat + jQuery.css( elem, type, value, extra ) : - // Get width or height on the element - if ( value === undefined ) { - orig = jQuery.css( elem, type ); - ret = parseFloat( orig ); - return jQuery.isNumeric( ret ) ? ret : orig; - } - - // Set the width or height on the element - jQuery( elem ).css( type, value ); - }, type, value, arguments.length, null ); - }; + // Set width or height on the element + jQuery.style( elem, type, value, extra ); + }, type, chainable ? margin : undefined, chainable, null ); + }; + }); }); - - - - // Expose jQuery to the global object window.jQuery = window.$ = jQuery; @@ -9399,6 +9441,4 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) { define( "jquery", [], function () { return jQuery; } ); } - - })( window ); diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index c3aac6089f0..94d02758ad0 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -25,7 +25,6 @@ display: none !important; } } - .openerp.openerp_webclient_container { height: 100%; } @@ -45,7 +44,7 @@ text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5); /* http://www.quirksmode.org/dom/inputfile.html * http://stackoverflow.com/questions/2855589/replace-input-type-file-by-an-image - */ */ + */ } .openerp :-moz-placeholder { color: #afafb6 !important; @@ -218,7 +217,7 @@ background-clip: padding-box; } .openerp.ui-dialog .ui-dialog-content { - padding: 0px; + padding: 0; } .openerp.ui-dialog .ui-dialog-titlebar, .openerp.ui-dialog .ui-dialog-content, .openerp.ui-dialog .ui-dialog-buttonpane { padding: 16px; @@ -660,7 +659,7 @@ cursor: pointer; } .openerp .oe_dropdown_toggle { - color: rgba(0, 0, 0, 0.5); + color: rgba(0, 0, 0, 0.3); font-weight: normal; } .openerp .oe_dropdown_hover:hover .oe_dropdown_menu, .openerp .oe_dropdown_menu.oe_opened { @@ -2061,10 +2060,11 @@ padding-bottom: 0; } .openerp .oe_form div.oe_chatter { - min-width: 650px; - max-width: 860px; + box-sizing: border-box; + min-width: 682px; + max-width: 892px; margin: 0 auto; - padding: 16px 0 48px; + padding: 16px 16px 48px; } .openerp .oe_form div.oe_form_configuration p, .openerp .oe_form div.oe_form_configuration ul, .openerp .oe_form div.oe_form_configuration ol { color: #aaaaaa; @@ -2519,6 +2519,9 @@ .openerp .oe_form_field_one2many > .oe_view_manager .oe_list_pager_single_page, .openerp .oe_form_field_many2many > .oe_view_manager .oe_list_pager_single_page { display: none !important; } +.openerp .oe_form_field_one2many > .oe_view_manager .oe_view_manager_view_list, .openerp .oe_form_field_many2many > .oe_view_manager .oe_view_manager_view_list { + min-height: 132px; +} .openerp .oe_form_field_one2many .oe_form_field_one2many_list_row_add, .openerp .oe_form_field_many2many .oe_form_field_one2many_list_row_add { font-weight: bold; } @@ -2562,13 +2565,11 @@ background-color: #eeeeee; } .openerp .oe_list_editable .oe_list_content td.oe_list_field_cell { - padding: 4px 6px 3px 6px; -} -.openerp .oe_list.oe_list_editable td.oe_list_record_delete { - position: absolute; + padding: 4px 6px 3px; } .openerp .oe_list.oe_list_editable.oe_editing .oe_edition .oe_list_field_cell:not(.oe_readonly) { color: transparent; + text-shadow: none; } .openerp .oe_list.oe_list_editable.oe_editing .oe_edition .oe_list_field_cell:not(.oe_readonly) * { visibility: hidden; @@ -2645,6 +2646,9 @@ margin: 0 !important; padding: 0; } +.openerp .oe_list .oe_form .oe_form_field_boolean { + padding: 1px 6px 3px; +} .openerp .oe_list .oe_list_content .oe_group_header { background-color: #fcfcfc; background-image: -webkit-gradient(linear, left top, left bottom, from(#fcfcfc), to(#dedede)); @@ -2776,6 +2780,9 @@ content: "}"; color: #e0e0e0; } +.openerp .oe_list_content .oe_list_field_progressbar progress { + width: 100%; +} .openerp .tree_header { background-color: #f0f0f0; border-bottom: 1px solid #cacaca; @@ -2875,6 +2882,78 @@ color: #333333; } +.openerp .oe_fileupload { + display: inline-block; + clear: both; + width: 100%; +} +.openerp .oe_fileupload .oe_add { + float: left; + position: relative; + width: 100%; + left: 2px; + top: 7px; +} +.openerp .oe_fileupload .oe_add button { + display: inline; + height: 24px; + font-size: 12px; + line-height: 12px; + vertical-align: middle; +} +.openerp .oe_fileupload .oe_add button.oe_attach { + width: 24px; + overflow: hidden; + width: 24px; + overflow: hidden; + background: transparent; + color: #7c7bad; + box-shadow: none; + border: none; + text-shadow: none; +} +.openerp .oe_fileupload .oe_add button.oe_attach .oe_e { + position: relative; + top: -1px; + left: -9px; +} +.openerp .oe_fileupload .oe_add input.oe_form_binary_file { + display: inline-block; + margin-left: -5px; + height: 28px; + width: 52px; + margin-top: -26px; +} +.openerp .oe_fileupload .oe_add .oe_attach_label { + color: #7c7bad; + margin-left: -3px; +} +.openerp .oe_fileupload .oe_attachments { + margin-bottom: 4px; + margin-right: 0px; + font-size: 12px; + border-radius: 2px; + border: solid 1px rgba(124, 123, 173, 0.14); +} +.openerp .oe_fileupload .oe_attachments .oe_attachment { + padding: 2px; + padding-left: 4px; + padding-right: 4px; +} +.openerp .oe_fileupload .oe_attachments .oe_attachment .oe_e { + font-size: 23px; + margin-top: -5px; +} +.openerp .oe_fileupload .oe_attachments .oe_attachment .oe_e:hover { + text-decoration: none; +} +.openerp .oe_fileupload .oe_attachments .oe_attachment:nth-child(odd) { + background: white; +} +.openerp .oe_fileupload .oe_attachments .oe_attachment:nth-child(even) { + background: #f4f5fa; +} + .kitten-mode-activated { background-image: url(http://placekitten.com/g/1365/769); background-size: cover; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index cf1cd38aad2..f911929e159 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -10,6 +10,8 @@ $tag-border-selected: #a6a6fe $hover-background: #f0f0fa $link-color: #7C7BAD $sheet-max-width: 860px +$sheet-min-width: 650px +$sheet-padding: 16px // }}} // Mixins {{{ @font-face @@ -256,6 +258,7 @@ $sheet-max-width: 860px // so remove position:relative .ui-tabs position: static + // Modal box &.ui-dialog display: none @@ -269,7 +272,7 @@ $sheet-max-width: 860px @include box-shadow(0 1px 12px rgba(0, 0, 0, 0.6)) @include background-clip() .ui-dialog-content - padding: 0px + padding: 0 .ui-dialog-titlebar, .ui-dialog-content, .ui-dialog-buttonpane padding: 16px .ui-dialog-titlebar @@ -566,7 +569,7 @@ $sheet-max-width: 860px position: relative cursor: pointer .oe_dropdown_toggle - color: rgba(0,0,0,0.5) + color: rgba(0,0,0,0.3) font-weight: normal .oe_dropdown_hover:hover .oe_dropdown_menu, .oe_dropdown_menu.oe_opened display: block @@ -1634,10 +1637,11 @@ $sheet-max-width: 860px width: 400px padding-bottom: 0 div.oe_chatter - min-width: 650px - max-width: $sheet-max-width + box-sizing: border-box + min-width: $sheet-min-width + 2* $sheet-padding + max-width: $sheet-max-width + 2* $sheet-padding margin: 0 auto - padding: 16px 0 48px + padding: 16px 16px 48px div.oe_form_configuration p, ul, ol color: #aaa @@ -1983,6 +1987,9 @@ $sheet-max-width: 860px > .oe_view_manager .oe_list_pager_single_page display: none !important + .oe_view_manager_view_list + min-height: 132px + .oe_form_field_one2many_list_row_add font-weight: bold .oe_list_content @@ -2023,18 +2030,14 @@ $sheet-max-width: 860px background-color: #eee $row-height: 27px - .oe_list_editable - .oe_list_content - td.oe_list_field_cell - padding: 4px 6px 3px 6px - .oe_list.oe_list_editable - td.oe_list_record_delete - position: absolute + .oe_list_editable .oe_list_content td.oe_list_field_cell + padding: 4px 6px 3px .oe_list.oe_list_editable.oe_editing .oe_edition .oe_list_field_cell:not(.oe_readonly) * visibility: hidden color: transparent + text-shadow: none .oe_m2o_drop_down_button top: 5px .oe_m2o_cm_button @@ -2101,6 +2104,10 @@ $sheet-max-width: 860px position: absolute margin: 0 !important // dammit padding: 0 + .oe_form_field_boolean + // use padding similar to actual cell to correctly position the + // checkbox + padding: 1px 6px 3px .oe_list_content .oe_group_header @include vertical-gradient(#fcfcfc, #dedede) @@ -2188,6 +2195,8 @@ $sheet-max-width: 860px .oe_list_handle @include text-to-entypo-icon("}",#E0E0E0,18px) margin-right: 7px + .oe_list_field_progressbar progress + width: 100% // }}} // Tree view {{{ .tree_header @@ -2273,6 +2282,67 @@ $sheet-max-width: 860px float: right color: #333 // }}} + +.openerp + .oe_fileupload + display: inline-block + clear: both + width: 100% + .oe_add + float: left + position: relative + width: 100% + left: +2px + top: +7px + button + display: inline + height: 24px + font-size: 12px + line-height: 12px + vertical-align: middle + button.oe_attach + width: 24px + overflow: hidden + width: 24px + overflow: hidden + background: transparent + color: #7C7BAD + box-shadow: none + border: none + text-shadow: none + .oe_e + position: relative + top: -1px + left: -9px + input.oe_form_binary_file + display: inline-block + margin-left: -5px + height: 28px + width: 52px + margin-top: -26px + .oe_attach_label + color: #7C7BAD + margin-left: -3px + .oe_attachments + margin-bottom: 4px + margin-right: 0px + font-size: 12px + border-radius: 2px + border: solid 1px rgba(124,123,173,0.14) + .oe_attachment + padding: 2px + padding-left: 4px + padding-right: 4px + .oe_e + font-size: 23px + margin-top: -5px + .oe_e:hover + text-decoration: none + .oe_attachment:nth-child(odd) + background: white + .oe_attachment:nth-child(even) + background: #F4F5FA + // Kitten Mode {{{ .kitten-mode-activated background-image: url(http://placekitten.com/g/1365/769) diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 81334cd6589..9c249a5fb0c 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -81,9 +81,6 @@ instance.web.Dialog = instance.web.Widget.extend({ } } if (options) { - if (options.buttons) { - this.params_buttons = true; - } _.extend(this.dialog_options, options); } this.on("closing", this, this._closing); @@ -129,6 +126,8 @@ instance.web.Dialog = instance.web.Widget.extend({ if (! this.dialog_inited) this.init_dialog(); var o = this.get_options(options); + this.add_buttons(o.buttons); + delete(o.buttons); this.$buttons.appendTo($("body")); instance.web.dialog(this.$el, o).dialog('open'); this.$el.dialog("widget").find(".ui-dialog-buttonpane").remove(); @@ -138,22 +137,30 @@ instance.web.Dialog = instance.web.Widget.extend({ } 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) { this.renderElement(); var o = this.get_options(options); instance.web.dialog(this.$el, o); - if (! this.params_buttons) { - this.$buttons = $('<div class="ui-dialog-buttonpane ui-widget-content ui-helper-clearfix" />'); - this.$el.dialog("widget").append(this.$buttons); - } else { - this.$buttons = this.$el.dialog("widget").find(".ui-dialog-buttonpane"); - } + this.$buttons = $('<div class="ui-dialog-buttonpane ui-widget-content ui-helper-clearfix" />'); + this.$el.dialog("widget").append(this.$buttons); this.dialog_inited = true; var res = this.start(); return res; }, close: function() { - this.$el.dialog('close'); + if (this.dialog_inited && this.$el.is(":data(dialog)")) { + this.$el.dialog('close'); + } }, _closing: function() { if (this.__tmp_dialog_destroying) @@ -175,7 +182,7 @@ instance.web.Dialog = instance.web.Widget.extend({ this.close(); this.__tmp_dialog_destroying = undefined; } - if (! this.isDestroyed()) { + if (this.dialog_inited && !this.isDestroyed()) { this.$el.dialog('destroy'); } this._super(); @@ -294,7 +301,7 @@ instance.web.DatabaseManager = instance.web.Widget.extend({ start: function() { var self = this; $('.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) { self.db_list = result.db_list; }, @@ -302,10 +309,10 @@ instance.web.DatabaseManager = instance.web.Widget.extend({ ev.preventDefault(); 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; }); - return $.when(fetch_db, fetch_langs).then(self.do_render); + return $.when(fetch_db, fetch_langs).done(self.do_render); }, do_render: function() { var self = this; @@ -394,7 +401,7 @@ instance.web.DatabaseManager = instance.web.Widget.extend({ do_create: function(form) { var self = this; 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 client_action = { 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 + " ?")) { return; } - self.rpc("/web/database/drop", {'fields': fields}).then(function(result) { + self.rpc("/web/database/drop", {'fields': fields}).done(function(result) { if (result.error) { self.display_error(result); return; @@ -483,7 +490,7 @@ instance.web.DatabaseManager = instance.web.Widget.extend({ var self = this; self.rpc("/web/database/change_password", { 'fields': $(form).serializeArray() - }).then(function(result) { + }).done(function(result) { if (result.error) { self.display_error(result); return; @@ -504,13 +511,13 @@ instance.web.Login = instance.web.Widget.extend({ template: "Login", remember_credentials: true, - init: function(parent, params) { + init: function(parent, action) { this._super(parent); this.has_local_storage = typeof(localStorage) != 'undefined'; this.db_list = null; this.selected_db = null; this.selected_login = null; - this.params = params || {}; + this.params = action.params || {}; if (this.params.login_successful) { this.on('login_successful', this, this.params.login_successful); @@ -581,7 +588,7 @@ instance.web.Login = instance.web.Widget.extend({ var self = this; self.hide_error(); 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.remember_credentials) { localStorage.setItem('last_db_login_success', db); @@ -616,8 +623,9 @@ instance.web.client_actions.add("login", "instance.web.Login"); * Client action to reload the whole interface. * If params has an entry 'menu_id', it opens the given menu entry. */ -instance.web.Reload = function(parent, params) { - var menu_id = (params && params.menu_id) || false; +instance.web.Reload = function(parent, action) { + var params = action.params || {}; + var menu_id = params.menu_id || false; var l = window.location; var sobj = $.deparam(l.search.substr(1)); @@ -638,7 +646,7 @@ instance.web.client_actions.add("reload", "instance.web.Reload"); * Client action to go back in breadcrumb history. * If can't go back in history stack, will go back to home. */ -instance.web.HistoryBack = function(parent, params) { +instance.web.HistoryBack = function(parent) { if (!parent.history_back()) { window.location = '/' + (window.location.search || ''); } @@ -649,7 +657,7 @@ instance.web.client_actions.add("history_back", "instance.web.HistoryBack"); * Client action to go back home. */ instance.web.Home = instance.web.Widget.extend({ - init: function(parent, params) { + init: function(parent) { window.location = '/' + (window.location.search || ''); } }); @@ -663,7 +671,7 @@ instance.web.ChangePassword = instance.web.Widget.extend({ submitHandler: function (form) { self.rpc("/web/session/change_password",{ 'fields': $(form).serializeArray() - }).then(function(result) { + }).done(function(result) { if (result.error) { self.display_error(result); return; @@ -702,7 +710,7 @@ instance.web.Menu = instance.web.Widget.extend({ }, do_reload: function() { 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); }); }, @@ -872,7 +880,7 @@ instance.web.UserMenu = instance.web.Widget.extend({ if (!self.session.uid) return; 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; if(instance.session.debug) topbar_name = _.str.sprintf("%s (%s)", topbar_name, instance.session.db); @@ -883,7 +891,7 @@ instance.web.UserMenu = instance.web.Widget.extend({ $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() { this.trigger('user_logout'); @@ -899,7 +907,7 @@ instance.web.UserMenu = instance.web.Widget.extend({ }, on_menu_about: function() { 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})); $help.find('a.oe_activate_debug_mode').click(function (e) { e.preventDefault(); @@ -919,7 +927,7 @@ instance.web.Client = instance.web.Widget.extend({ }, start: function() { 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, {})); self.replaceElement($e); self.bind_events(); @@ -986,7 +994,7 @@ instance.web.WebClient = instance.web.Client.extend({ }, start: function() { var self = this; - return $.when(this._super()).pipe(function() { + return $.when(this._super()).then(function() { self.$el.on('click', '.oe_logo', function() { self.action_manager.do_action('home'); }); @@ -1055,8 +1063,8 @@ instance.web.WebClient = instance.web.Client.extend({ }, do_reload: function() { var self = this; - return this.session.session_reload().pipe(function () { - instance.session.load_modules(true).pipe( + return this.session.session_reload().then(function () { + instance.session.load_modules(true).then( self.menu.proxy('do_reload')); }); }, @@ -1071,7 +1079,7 @@ instance.web.WebClient = instance.web.Client.extend({ on_logout: function() { var self = this; if (!this.has_uncommitted_changes()) { - this.session.session_logout().then(function () { + this.session.session_logout().done(function () { $(window).unbind('hashchange', self.on_hashchange); self.do_push_state({}); window.location.reload(); @@ -1084,7 +1092,7 @@ instance.web.WebClient = instance.web.Client.extend({ var state = $.bbq.getState(true); 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"); if(first_menu_id) { self.menu.menu_click(first_menu_id); @@ -1099,8 +1107,8 @@ instance.web.WebClient = instance.web.Client.extend({ var state = event.getState(true); if (!_.isEqual(this._current_state, state)) { if(state.action_id === undefined && state.menu_id) { - self.menu.has_been_loaded.then(function() { - self.menu.do_reload().then(function() { + self.menu.has_been_loaded.done(function() { + self.menu.do_reload().done(function() { self.menu.menu_click(state.menu_id) }); }); @@ -1122,7 +1130,7 @@ instance.web.WebClient = instance.web.Client.extend({ on_menu_action: function(options) { var self = this; return this.rpc("/web/action/load", { action_id: options.action_id }) - .pipe(function (result) { + .then(function (result) { var action = result; if (options.needaction) { action.context.search_default_message_unread = true; @@ -1168,9 +1176,9 @@ instance.web.EmbeddedClient = instance.web.Client.extend({ }, start: function() { var self = this; - return $.when(this._super()).pipe(function() { - return instance.session.session_authenticate(self.dbname, self.login, self.key, true).pipe(function() { - return self.rpc("/web/action/load", { action_id: self.action_id }).then(function(result) { + return $.when(this._super()).then(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 }).done(function(result) { var action = result; action.flags = _.extend({ //views_switcher : false, diff --git a/addons/web/static/src/js/corelib.js b/addons/web/static/src/js/corelib.js index 6ecbfdd01ac..d2e94d37939 100644 --- a/addons/web/static/src/js/corelib.js +++ b/addons/web/static/src/js/corelib.js @@ -809,12 +809,12 @@ instance.web.Widget = instance.web.Class.extend(instance.web.WidgetMixin, { return false; }, rpc: function(url, data, success, error) { - var def = $.Deferred().then(success, error); + var def = $.Deferred().done(success).fail(error); var self = this; - instance.session.rpc(url, data).then(function() { + instance.session.rpc(url, data).done(function() { if (!self.isDestroyed()) def.resolve.apply(def, arguments); - }, function() { + }).fail(function() { if (!self.isDestroyed()) def.reject.apply(def, arguments); }); @@ -1287,7 +1287,7 @@ instance.web.JsonRPC = instance.web.CallbackEnabled.extend({ }; var deferred = $.Deferred(); 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) { self.trigger('response', response); if (!response.error) { @@ -1300,7 +1300,8 @@ instance.web.JsonRPC = instance.web.CallbackEnabled.extend({ } else { deferred.reject(response.error, $.Event()); } - }, + } + ).fail( function(jqXHR, textStatus, errorThrown) { self.trigger('response_failed', jqXHR); var error = { @@ -1387,10 +1388,11 @@ instance.web.JsonRPC = instance.web.CallbackEnabled.extend({ $iframe.unbind('load').bind('load', function() { $.ajax(ajax).always(function() { cleanUp(); - }).then( - function() { deferred.resolve.apply(deferred, arguments); }, - function() { deferred.reject.apply(deferred, arguments); } - ); + }).done(function() { + deferred.resolve.apply(deferred, arguments); + }).fail(function() { + deferred.reject.apply(deferred, arguments); + }); }); // now that the iframe can receive data, we fill and submit the form $form.submit(); diff --git a/addons/web/static/src/js/coresetup.js b/addons/web/static/src/js/coresetup.js index 1f1112df2f2..b7dac303520 100644 --- a/addons/web/static/src/js/coresetup.js +++ b/addons/web/static/src/js/coresetup.js @@ -51,15 +51,15 @@ instance.web.Session = instance.web.JsonRPC.extend( /** @lends instance.web.Sess var self = this; // TODO: session store in cookie should be optional 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 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()) { - return deferred.pipe(function() { return self.load_modules(); }); + return deferred.then(function() { return self.load_modules(); }); } return $.when( 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); }) ); @@ -73,7 +73,7 @@ instance.web.Session = instance.web.JsonRPC.extend( /** @lends instance.web.Sess */ session_reload: function () { 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 // an invalid session or no session at all), refresh session data // (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 base_location = document.location.protocol + '//' + document.location.host; 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) { return $.Deferred().reject(); } @@ -154,30 +154,30 @@ instance.web.Session = instance.web.JsonRPC.extend( /** @lends instance.web.Sess */ load_modules: function() { 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, all_modules = _.uniq(self.module_list.concat(result)); var params = { mods: all_modules, lang: lang}; var to_load = _.difference(result, self.module_list).join(','); 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); }); var file_list = ["/web/static/lib/datejs/globalization/" + lang.replace("_", "-") + ".js"]; if(to_load.length) { loaded = $.when( loaded, - self.rpc('/web/webclient/csslist', {mods: to_load}).then(self.do_load_css), - self.rpc('/web/webclient/qweblist', {mods: to_load}).pipe(self.do_load_qweb), - self.rpc('/web/webclient/jslist', {mods: to_load}).then(function(files) { + self.rpc('/web/webclient/csslist', {mods: to_load}).done(self.do_load_css), + self.rpc('/web/webclient/qweblist', {mods: to_load}).then(self.do_load_qweb), + self.rpc('/web/webclient/jslist', {mods: to_load}).done(function(files) { file_list = file_list.concat(files); }) ); } - return loaded.pipe(function () { + return loaded.then(function () { return self.do_load_js(file_list); - }).then(function() { + }).done(function() { self.on_modules_loaded(); self.trigger('module_loaded'); 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 ) return; tag.onload_done = true; - self.do_load_js(files).then(function () { + self.do_load_js(files).done(function () { d.resolve(); }); }; @@ -227,7 +227,7 @@ instance.web.Session = instance.web.JsonRPC.extend( /** @lends instance.web.Sess var self = this; _.each(files, function(file) { 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; } instance.web.qweb.add_template(_.str.trim(xml)); }); @@ -462,7 +462,7 @@ $.Mutex = (function() { Mutex.prototype.exec = function(action) { var current = this.def; var next = this.def = $.Deferred(); - return current.pipe(function() { + return current.then(function() { return $.when(action()).always(function() { next.resolve(); }); @@ -474,7 +474,7 @@ $.Mutex = (function() { $.async_when = function() { var async = false; var def = $.Deferred(); - $.when.apply($, arguments).then(function() { + $.when.apply($, arguments).done(function() { var args = arguments; var action = function() { def.resolve.apply(def, args); @@ -483,7 +483,7 @@ $.async_when = function() { action(); else setTimeout(action, 0); - }, function() { + }).fail(function() { var args = arguments; var action = function() { def.reject.apply(def, args); @@ -530,7 +530,8 @@ instance.web.qweb.default_dict['__debug__'] = instance.session.debug; // Which o instance.web.qweb.debug = instance.session.debug; instance.web.qweb.default_dict = { '_' : _, - '_t' : instance.web._t + '_t' : instance.web._t, + 'JSON': JSON, }; instance.web.qweb.preprocess_node = function() { // Note that 'this' is the Qweb Node diff --git a/addons/web/static/src/js/data.js b/addons/web/static/src/js/data.js index e279ade6fb3..2f8679794b0 100644 --- a/addons/web/static/src/js/data.js +++ b/addons/web/static/src/js/data.js @@ -66,7 +66,7 @@ instance.web.Query = instance.web.Class.extend({ offset: this._offset, limit: this._limit, sort: instance.web.serialize_sort(this._order_by) - }).pipe(function (results) { + }).then(function (results) { self._count = results.length; return results.records; }, null); @@ -78,7 +78,7 @@ instance.web.Query = instance.web.Class.extend({ */ first: function () { var self = this; - return this.clone({limit: 1})._execute().pipe(function (records) { + return this.clone({limit: 1})._execute().then(function (records) { delete self._count; if (records.length) { return records[0]; } return null; @@ -132,7 +132,7 @@ instance.web.Query = instance.web.Class.extend({ offset: this._offset, limit: this._limit, orderby: instance.web.serialize_sort(this._order_by) || false - }).pipe(function (results) { + }).then(function (results) { return _(results).map(function (result) { // FIX: querygroup initialization result.__context = result.__context || {}; @@ -443,7 +443,7 @@ instance.web.DataSet = instance.web.CallbackEnabled.extend({ return this._model.query(fields) .limit(options.limit || false) .offset(options.offset || 0) - .all().then(function (records) { + .all().done(function (records) { self.ids = _(records).pluck('id'); }); }, @@ -456,7 +456,7 @@ instance.web.DataSet = instance.web.CallbackEnabled.extend({ */ read_index: function (fields, 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(); } return records[0]; }); @@ -471,7 +471,7 @@ instance.web.DataSet = instance.web.CallbackEnabled.extend({ default_get: function(fields, options) { options = options || {}; return this._model.call('default_get', - [fields], {context: this._model.context(options.context)}); + [fields], {context: this.get_context(options.context)}); }, /** * Creates a new record in db @@ -480,7 +480,7 @@ instance.web.DataSet = instance.web.CallbackEnabled.extend({ * @returns {$.Deferred} */ create: function(data) { - return this._model.call('create', [data], {context: this._model.context()}); + return this._model.call('create', [data], {context: this.get_context()}); }, /** * Saves the provided data in an existing db record @@ -493,7 +493,7 @@ instance.web.DataSet = instance.web.CallbackEnabled.extend({ */ write: function (id, data, options) { options = options || {}; - return this._model.call('write', [[id], data], {context: this._model.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 @@ -501,7 +501,7 @@ instance.web.DataSet = instance.web.CallbackEnabled.extend({ * @param {Number|String} ids identifier of the record to delete */ unlink: function(ids) { - return this._model.call('unlink', [ids], {context: this._model.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 @@ -532,7 +532,7 @@ instance.web.DataSet = instance.web.CallbackEnabled.extend({ * @returns {$.Deferred} */ name_get: function(ids) { - return this._model.call('name_get', [ids], {context: this._model.context()}); + return this._model.call('name_get', [ids], {context: this.get_context()}); }, /** * @@ -556,7 +556,7 @@ instance.web.DataSet = instance.web.CallbackEnabled.extend({ * @param name */ name_create: function(name) { - return this._model.call('name_create', [name], {context: this._model.context()}); + return this._model.call('name_create', [name], {context: this.get_context()}); }, exec_workflow: function (id, signal) { return this._model.exec_workflow(id, signal); @@ -606,8 +606,8 @@ instance.web.DataSet = instance.web.CallbackEnabled.extend({ return instance.session.rpc('/web/dataset/resequence', { model: this.model, ids: ids, - context: this._model.context(options.context), - }).pipe(function (results) { + context: this.get_context(options.context), + }).then(function (results) { return results; }); }, @@ -682,9 +682,9 @@ instance.web.DataSetSearch = instance.web.DataSet.extend({ .limit(options.limit || false); 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 - q.count().then(function (count) { self._length = count; }); + q.count().done(function (count) { self._length = count; }); self.ids = _(records).pluck('id'); }); }, @@ -693,7 +693,7 @@ instance.web.DataSetSearch = instance.web.DataSet.extend({ }, unlink: function(ids, callback, error_callback) { var self = this; - return this._super(ids).then(function(result) { + return this._super(ids).done(function(result) { self.ids = _(self.ids).difference(ids); if (self._length) { self._length -= 1; @@ -722,7 +722,7 @@ instance.web.BufferedDataSet = instance.web.DataSetStatic.extend({ this.last_default_get = {}; }, 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) { 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.set_ids(_.without.apply(_, [this.ids].concat(ids))); 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) { this.set_ids(ids); @@ -836,7 +836,7 @@ instance.web.BufferedDataSet = instance.web.DataSetStatic.extend({ completion.resolve(records); }; 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) { var id = to_get[index]; 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 self = this, seq = this.lsn++; - deferred.then(function () { + deferred.done(function () { if (seq > self.rsn) { self.rsn = seq; res.resolve.apply(res, arguments); } else if (self.failMisordered) { res.reject(); } - }, function () { + }).fail(function () { res.reject.apply(res, arguments); }); diff --git a/addons/web/static/src/js/data_export.js b/addons/web/static/src/js/data_export.js index b4beb4c3a58..477d89c99b3 100644 --- a/addons/web/static/src/js/data_export.js +++ b/addons/web/static/src/js/data_export.js @@ -51,7 +51,7 @@ instance.web.DataExport = instance.web.Dialog.extend({ self.rpc("/web/export/get_fields", { model: self.dataset.model, import_compat: Boolean(import_comp) - }).then(function (records) { + }).done(function (records) { got_fields.resolve(); self.on_show_data(records); }); @@ -59,7 +59,7 @@ instance.web.DataExport = instance.web.Dialog.extend({ return $.when( 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()); }, do_setup_export_formats: function (formats) { @@ -84,7 +84,7 @@ instance.web.DataExport = instance.web.Dialog.extend({ } return this.exports.read_slice(['name'], { domain: [['resource', '=', this.dataset.model]] - }).then(function (export_list) { + }).done(function (export_list) { if (!export_list.length) { return; } @@ -93,7 +93,7 @@ instance.web.DataExport = instance.web.Dialog.extend({ self.$el.find('#fields_list option').remove(); var export_id = self.$el.find('#saved_export_list option:selected').val(); 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() { @@ -183,7 +183,7 @@ instance.web.DataExport = instance.web.Dialog.extend({ import_compat: Boolean(import_comp), parent_field_type : record['field_type'], exclude: exclude_fields - }).then(function(results) { + }).done(function(results) { record.loaded = true; self.on_show_data(results, record.id); }); diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index 9351f621324..e84ea66ff9a 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -124,19 +124,10 @@ function assert(condition, message) { } my.InputView = instance.web.Widget.extend({ template: 'SearchView.InputView', - start: function () { - var p = this._super.apply(this, arguments); - this.$el.on('focus', this.proxy('onFocus')); - this.$el.on('blur', this.proxy('onBlur')); - this.$el.on('keydown', this.proxy('onKeydown')); - return p; - }, - onFocus: function () { - this.trigger('focused', this); - }, - onBlur: function () { - this.$el.text(''); - this.trigger('blurred', this); + events: { + focus: function () { this.trigger('focused', this); }, + blur: function () { this.$el.text(''); this.trigger('blurred', this); }, + keydown: 'onKeydown' }, getSelection: function () { // get Text node @@ -212,6 +203,27 @@ my.InputView = instance.web.Widget.extend({ }); my.FacetView = instance.web.Widget.extend({ template: 'SearchView.FacetView', + events: { + 'focus': function () { this.trigger('focused', this); }, + 'blur': function () { this.trigger('blurred', this); }, + 'click': function (e) { + if ($(e.target).is('.oe_facet_remove')) { + this.model.destroy(); + return false; + } + this.$el.focus(); + e.stopPropagation(); + }, + 'keydown': function (e) { + var keys = $.ui.keyCode; + switch (e.which) { + case keys.BACKSPACE: + case keys.DELETE: + this.model.destroy(); + return false; + } + } + }, init: function (parent, model) { this._super(parent); this.model = model; @@ -223,33 +235,11 @@ my.FacetView = instance.web.Widget.extend({ }, start: function () { var self = this; - this.$el.on('focus', function () { self.trigger('focused', self); }); - this.$el.on('blur', function () { self.trigger('blurred', self); }); - this.$el.on('click', function (e) { - if ($(e.target).is('.oe_facet_remove')) { - self.model.destroy(); - return false; - } - self.$el.focus(); - e.stopPropagation(); - }); - this.$el.on('keydown', function (e) { - var keys = $.ui.keyCode; - switch (e.which) { - case keys.BACKSPACE: - case keys.DELETE: - self.model.destroy(); - return false; - } - }); - var $e = self.$el.find('> span:last-child'); - var q = $.when(this._super()); - return q.pipe(function () { - var values = self.model.values.map(function (value) { + var $e = this.$('> span:last-child'); + return $.when(this._super()).then(function () { + return $.when.apply(null, self.model.values.map(function (value) { return new my.FacetValueView(self, value).appendTo($e); - }); - - return $.when.apply(null, values); + })); }); }, model_changed: function () { @@ -274,6 +264,39 @@ my.FacetValueView = instance.web.Widget.extend({ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.SearchView# */{ template: "SearchView", + events: { + // focus last input if view itself is clicked + 'click': function (e) { + if (e.target === this.$('.oe_searchview_facets')[0]) { + this.$('.oe_searchview_input:last').focus(); + } + }, + // search button + 'click button.oe_searchview_search': function (e) { + e.stopImmediatePropagation(); + this.do_search(); + }, + 'click .oe_searchview_clear': function (e) { + e.stopImmediatePropagation(); + this.query.reset(); + }, + 'click .oe_searchview_unfold_drawer': function (e) { + e.stopImmediatePropagation(); + this.$el.toggleClass('oe_searchview_open_drawer'); + }, + 'keydown .oe_searchview_input, .oe_searchview_facet': function (e) { + switch(e.which) { + case $.ui.keyCode.LEFT: + this.focusPreceding(this); + e.preventDefault(); + break; + case $.ui.keyCode.RIGHT: + this.focusFollowing(this); + e.preventDefault(); + break; + } + } + }, /** * @constructs instance.web.SearchView * @extends instance.web.Widget @@ -324,62 +347,18 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea context: this.dataset.get_context() }); $.when(load_view) - .pipe(function(r) { + .then(function(r) { self.search_view_loaded(r) }).fail(function () { self.ready.reject.apply(null, arguments); }); } - // Launch a search on clicking the oe_searchview_search button - this.$el.on('click', 'button.oe_searchview_search', function (e) { - e.stopImmediatePropagation(); - self.do_search(); - }); - - this.$el.on('keydown', - '.oe_searchview_input, .oe_searchview_facet', function (e) { - switch(e.which) { - case $.ui.keyCode.LEFT: - self.focusPreceding(this); - e.preventDefault(); - break; - case $.ui.keyCode.RIGHT: - self.focusFollowing(this); - e.preventDefault(); - break; - } - }); - - this.$el.on('click', '.oe_searchview_clear', function (e) { - e.stopImmediatePropagation(); - self.query.reset(); - }); - this.$el.on('click', '.oe_searchview_unfold_drawer', function (e) { - e.stopImmediatePropagation(); - self.$el.toggleClass('oe_searchview_open_drawer'); - }); instance.web.bus.on('click', this, function(ev) { if ($(ev.target).parents('.oe_searchview').length === 0) { self.$el.removeClass('oe_searchview_open_drawer'); } }); - // Focus last input if the view itself is clicked (empty section of - // facets element) - this.$el.on('click', function (e) { - if (e.target === self.$el.find('.oe_searchview_facets')[0]) { - self.$el.find('.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 - this.$el.on('autocompleteopen', function () { - var menu = self.$el.data('autocomplete').menu; - menu.activate( - $.Event({ type: "mouseenter" }), - menu.element.children().first()); - }); return $.when(p, this.ready); }, @@ -429,58 +408,46 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea setup_global_completion: function () { var self = this; - // autocomplete only correctly handles being initialized on the actual - // 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({ + var autocomplete = this.$el.autocomplete({ source: this.proxy('complete_global_search'), select: this.proxy('select_completion'), focus: function (e) { e.preventDefault(); }, html: true, + autoFocus: true, minLength: 1, delay: 0 - }).data('autocomplete')._renderItem = function (ul, item) { - // item of completion list - var $item = $( "<li></li>" ) - .data( "item.autocomplete", item ) - .appendTo( ul ); - - if (item.facet !== undefined) { - // regular completion item - return $item.append( - (item.label) - ? $('<a>').html(item.label) - : $('<a>').text(item.value)); - } - return $item.text(item.label) - .css({ - borderTop: '1px solid #cccccc', - margin: 0, - padding: 0, - zoom: 1, - 'float': 'left', - clear: 'left', - width: '100%' - }); - }; - }, - /** - * Gets value out of the currently focused "input" (a - * div[contenteditable].oe_searchview_input) - */ - currentInputValue: function () { - return this.$el.find('div.oe_searchview_input:focus').text(); + }).data('autocomplete'); + + // MonkeyPatch autocomplete instance + _.extend(autocomplete, { + _renderItem: function (ul, item) { + // item of completion list + var $item = $( "<li></li>" ) + .data( "item.autocomplete", item ) + .appendTo( ul ); + + if (item.facet !== undefined) { + // regular completion item + return $item.append( + (item.label) + ? $('<a>').html(item.label) + : $('<a>').text(item.value)); + } + return $item.text(item.label) + .css({ + borderTop: '1px solid #cccccc', + margin: 0, + padding: 0, + zoom: 1, + 'float': 'left', + clear: 'left', + width: '100%' + }); + }, + _value: function() { + return self.$('div.oe_searchview_input').text(); + }, + }); }, /** * Provide auto-completion result for req.term (an array to `resp`) @@ -492,7 +459,7 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea complete_global_search: function (req, resp) { $.when.apply(null, _(this.inputs).chain() .invoke('complete', req.term) - .value()).then(function () { + .value()).done(function () { resp(_(_(arguments).compact()).flatten(true)); }); }, @@ -510,7 +477,7 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea var input_index = _(this.input_subviews).indexOf( this.subviewForRoot( - this.$el.find('div.oe_searchview_input:focus')[0])); + this.$('div.oe_searchview_input:focus')[0])); this.query.add(ui.item.facet, {at: input_index / 2}); }, childFocused: function () { @@ -539,7 +506,7 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea // _2: undefined if event=change, otherwise model var self = this; var started = []; - var $e = this.$el.find('div.oe_searchview_facets'); + var $e = this.$('div.oe_searchview_facets'); _.invoke(this.input_subviews, 'destroy'); this.input_subviews = []; @@ -560,7 +527,7 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea childView.on('blurred', self, self.proxy('childBlurred')); }); - $.when.apply(null, started).then(function () { + $.when.apply(null, started).done(function () { var input_to_focus; // options.at: facet inserted at given index, focus next input // otherwise just focus last input @@ -664,16 +631,16 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea // build drawer var drawer_started = $.when.apply( null, _(this.select_for_drawer()).invoke( - 'appendTo', this.$el.find('.oe_searchview_drawer'))); + 'appendTo', this.$('.oe_searchview_drawer'))); // load defaults 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}); }); return $.when(drawer_started, defaults_fetched) - .then(function () { + .done(function () { self.trigger("search_view_loaded", data); self.ready.resolve(); }); @@ -736,6 +703,9 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea * * If at least one field failed its validation, triggers * :js:func:`instance.web.SearchView.on_invalid` instead. + * + * @param [_query] + * @param {Object} [options] */ do_search: function (_query, options) { if (options && options.preventSearch) { @@ -788,6 +758,7 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea instance.web.search.fields = new instance.web.Registry({ 'char': 'instance.web.search.CharField', 'text': 'instance.web.search.CharField', + 'html': 'instance.web.search.CharField', 'boolean': 'instance.web.search.BooleanField', 'integer': 'instance.web.search.IntegerField', 'id': 'instance.web.search.IntegerField', @@ -960,7 +931,7 @@ instance.web.search.FilterGroup = instance.web.search.Input.extend(/** @lends in */ search_change: function () { var self = this; - var $filters = this.$el.find('> li').removeClass('oe_selected'); + var $filters = this.$('> li').removeClass('oe_selected'); var facet = this.view.query.find(_.bind(this.match_facet, this)); if (!facet) { return; } facet.values.each(function (v) { @@ -1438,7 +1409,7 @@ instance.web.search.ManyToOneField = instance.web.search.CharField.extend({ name: needle, limit: 8, context: {} - }).pipe(function (results) { + }).then(function (results) { if (_.isEmpty(results)) { return null; } return [{label: self.attrs.string}].concat( _(results).map(function (result) { @@ -1461,7 +1432,7 @@ instance.web.search.ManyToOneField = instance.web.search.CharField.extend({ // to handle this as if it were a single value. 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; } return facet_from(self, names[0]); }) @@ -1508,10 +1479,10 @@ instance.web.search.CustomFilters = instance.web.search.Input.extend({ // FIXME: local eval of domain and context to get rid of special endpoint return this.rpc('/web/searchview/get_filters', { model: this.view.model - }).pipe(this.proxy('set_filters')); + }).then(this.proxy('set_filters')); }, clear_selection: function () { - this.$el.find('li.oe_selected').removeClass('oe_selected'); + this.$('li.oe_selected').removeClass('oe_selected'); }, append_filter: function (filter) { var self = this; @@ -1523,7 +1494,7 @@ instance.web.search.CustomFilters = instance.web.search.Input.extend({ } else { var id = filter.id; $filter = this.filters[key] = $('<li></li>') - .appendTo(this.$el.find('.oe_searchview_custom_list')) + .appendTo(this.$('.oe_searchview_custom_list')) .addClass(filter.user_id ? 'oe_searchview_custom_private' : 'oe_searchview_custom_public') .text(filter.name); @@ -1531,7 +1502,7 @@ instance.web.search.CustomFilters = instance.web.search.Input.extend({ $('<a class="oe_searchview_custom_delete">x</a>') .click(function (e) { e.stopPropagation(); - self.model.call('unlink', [id]).then(function () { + self.model.call('unlink', [id]).done(function () { $filter.remove(); }); }) @@ -1558,15 +1529,15 @@ instance.web.search.CustomFilters = instance.web.search.Input.extend({ }, save_current: function () { var self = this; - var $name = this.$el.find('input:first'); - var private_filter = !this.$el.find('input:last').prop('checked'); + var $name = this.$('input:first'); + var private_filter = !this.$('input:last').prop('checked'); var search = this.view.build_search_data(); this.rpc('/web/session/eval_domain_and_context', { domains: search.domains, contexts: search.contexts, group_by_seq: search.groupbys || [] - }).then(function (results) { + }).done(function (results) { if (!_.isEmpty(results.group_by)) { results.context.group_by = results.group_by; } @@ -1578,7 +1549,7 @@ instance.web.search.CustomFilters = instance.web.search.Input.extend({ domain: results.domain }; // 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; self.append_filter(filter); self.$el @@ -1655,20 +1626,29 @@ instance.web.search.Advanced = instance.web.search.Input.extend({ }); return $.when( 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({ id: { string: 'ID', type: 'id' } }, data.fields); - })).then(function () { + })).done(function () { self.append_proposition(); }); }, append_proposition: function () { + var self = this; return (new instance.web.search.ExtendedSearchProposition(this, this.fields)) - .appendTo(this.$el.find('ul')); + .appendTo(this.$('ul')).done(function () { + self.$('button.oe_apply').prop('disabled', false); + }); + }, + remove_proposition: function (prop) { + // removing last proposition, disable apply button + if (this.getChildren().length <= 1) { + this.$('button.oe_apply').prop('disabled', true); + } + prop.destroy(); }, commit_search: function () { - var self = this; // Get domain sections from all propositions var children = this.getChildren(); var propositions = _.invoke(children, 'get_proposition'); @@ -1698,6 +1678,13 @@ instance.web.search.Advanced = instance.web.search.Input.extend({ instance.web.search.ExtendedSearchProposition = instance.web.Widget.extend(/** @lends instance.web.search.ExtendedSearchProposition# */{ template: 'SearchView.extended_search.proposition', + events: { + 'change .searchview_extended_prop_field': 'changed', + 'click .searchview_extended_delete_prop': function (e) { + e.stopPropagation(); + this.getParent().remove_proposition(this); + } + }, /** * @constructs instance.web.search.ExtendedSearchProposition * @extends instance.web.Widget @@ -1715,17 +1702,10 @@ instance.web.search.ExtendedSearchProposition = instance.web.Widget.extend(/** @ this.value = null; }, start: function () { - var _this = this; - this.$el.find(".searchview_extended_prop_field").change(function() { - _this.changed(); - }); - this.$el.find('.searchview_extended_delete_prop').click(function () { - _this.destroy(); - }); - this.changed(); + return this._super().done(this.proxy('changed')); }, changed: function() { - var nval = this.$el.find(".searchview_extended_prop_field").val(); + var nval = this.$(".searchview_extended_prop_field").val(); if(this.attrs.selected == null || nval != this.attrs.selected.name) { this.select_field(_.detect(this.fields, function(x) {return x.name == nval;})); } @@ -1740,7 +1720,7 @@ instance.web.search.ExtendedSearchProposition = instance.web.Widget.extend(/** @ if(this.attrs.selected != null) { this.value.destroy(); this.value = null; - this.$el.find('.searchview_extended_prop_op').html(''); + this.$('.searchview_extended_prop_op').html(''); } this.attrs.selected = field; if(field == null) { @@ -1756,9 +1736,9 @@ instance.web.search.ExtendedSearchProposition = instance.web.Widget.extend(/** @ _.each(this.value.operators, function(operator) { $('<option>', {value: operator.value}) .text(String(operator.text)) - .appendTo(self.$el.find('.searchview_extended_prop_op')); + .appendTo(self.$('.searchview_extended_prop_op')); }); - var $value_loc = this.$el.find('.searchview_extended_prop_value').empty(); + var $value_loc = this.$('.searchview_extended_prop_value').empty(); this.value.appendTo($value_loc); }, @@ -1766,7 +1746,7 @@ instance.web.search.ExtendedSearchProposition = instance.web.Widget.extend(/** @ if ( this.attrs.selected == null) return null; var field = this.attrs.selected; - var op = this.$el.find('.searchview_extended_prop_op')[0]; + var op = this.$('.searchview_extended_prop_op')[0]; var operator = op.options[op.selectedIndex]; return { label: _.str.sprintf(_t('%(field)s %(operator)s "%(value)s"'), { diff --git a/addons/web/static/src/js/test_support.js b/addons/web/static/src/js/test_support.js index 8e1317ba2b0..90173f89845 100644 --- a/addons/web/static/src/js/test_support.js +++ b/addons/web/static/src/js/test_support.js @@ -32,20 +32,20 @@ openerp.test_support = { window.openerp.web[tested_core](oe); var done = openerp.test_support.setup_session(oe.session); if (nonliterals) { - done = done.pipe(function () { + done = done.then(function () { return oe.session.rpc('/tests/add_nonliterals', { domains: nonliterals.domains || [], contexts: nonliterals.contexts || [] - }).then(function (r) { + }).done(function (r) { oe.domains = r.domains; oe.contexts = r.contexts; }); }); } done.always(QUnit.start) - .then(function () { + .done(function () { conf.openerp = oe; - }, function (e) { + }).fail(function (e) { QUnit.test(title, function () { console.error(e); QUnit.ok(false, 'Could not obtain a session:' + e.debug); diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 67c5fa0292e..55f5b580015 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -114,13 +114,14 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM }); this.is_initialized = $.Deferred(); this.mutating_mutex = new $.Mutex(); - this.on_change_mutex = new $.Mutex(); + this.on_change_list = []; + this.save_list = []; this.reload_mutex = new $.Mutex(); this.__clicked_inside = false; this.__blur_timeout = null; this.rendering_engine = new instance.web.form.FormRenderingEngine(this); self.set({actual_mode: self.options.initial_mode}); - this.has_been_loaded.then(function() { + this.has_been_loaded.done(function() { self.on("change:actual_mode", self, self.check_actual_mode); self.check_actual_mode(); self.on("change:actual_mode", self, self.init_pager); @@ -274,7 +275,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM var shown = this.has_been_loaded; if (options.reload !== false) { - shown = shown.pipe(function() { + shown = shown.then(function() { if (self.dataset.index === null) { // null index means we should start a new record return self.on_button_new(); @@ -283,12 +284,12 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM fields.push('display_name'); return self.dataset.read_index(fields, { context: { 'bin_size': true, 'future_display_name' : true } - }).pipe(function(r) { + }).then(function(r) { self.trigger('load_record', r); }); }); } - return shown.pipe(function() { + return shown.then(function() { self._actualize_mode(options.mode || self.options.initial_mode); self.$el.css({ opacity: '1', @@ -326,7 +327,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM field._inhibit_on_change_flag = false; set_values.push(result); }); - return $.when.apply(null, set_values).pipe(function() { + return $.when.apply(null, set_values).then(function() { if (!record.id) { // New record: Second pass in order to trigger the onchanges // respecting the fields order defined in the view @@ -364,7 +365,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM var self = this; var keys = _.keys(this.fields_view.fields); if (keys.length) { - return this.dataset.default_get(keys).pipe(function(r) { + return this.dataset.default_get(keys).then(function(r) { self.trigger('load_record', r); }); } @@ -427,7 +428,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM var onchange = _.str.trim(on_change); var call = onchange.match(/^\s?(.*?)\((.*?)\)\s?$/); if (!call) { - return null; + throw new Error("Wrong on change format: " + onchange); } var method = call[1]; @@ -466,7 +467,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM var splitted = field.split('.'); if (splitted.length > 1 && _.str.trim(splitted[0]) === "parent" && self.dataset.parent_view) { if (parent_fields === null) { - parent_fields = self.dataset.parent_view.get_fields_values([self.dataset.child_name]); + parent_fields = self.dataset.parent_view.get_fields_values(); } var p_val = parent_fields[_.str.trim(splitted[1])]; if (p_val !== undefined) { @@ -492,38 +493,33 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM }, do_onchange: function(widget, processed) { var self = this; - return this.on_change_mutex.exec(function() { - try { - var response = {}, can_process_onchange = $.Deferred(); - processed = processed || []; - processed.push(widget.name); - var on_change = widget.node.attrs.on_change; - if (on_change) { - var change_spec = self.parse_on_change(on_change, widget); - if (change_spec) { - var ajax = { - url: '/web/dataset/onchange', - async: false - }; - can_process_onchange = self.rpc(ajax, { - model: self.dataset.model, - method: change_spec.method, - args: [(self.datarecord.id == null ? [] : [self.datarecord.id])].concat(change_spec.args), - context_id: change_spec.context_index == undefined ? null : change_spec.context_index + 1 - }).then(function(r) { - _.extend(response, r); - }); - } else { - console.warn("Wrong on_change format", on_change); - } - } - // fail if onchange failed - if (can_process_onchange.isRejected()) { - return can_process_onchange; - } - + this.on_change_list = [{widget: widget, processed: processed}].concat(this.on_change_list); + return this._process_operations(); + }, + _process_onchange: function(on_change_obj) { + var self = this; + var widget = on_change_obj.widget; + var processed = on_change_obj.processed; + try { + var def; + processed = processed || []; + processed.push(widget.name); + var on_change = widget.node.attrs.on_change; + if (on_change) { + var change_spec = self.parse_on_change(on_change, widget); + def = self.rpc('/web/dataset/onchange', { + model: self.dataset.model, + method: change_spec.method, + args: [(self.datarecord.id == null ? [] : [self.datarecord.id])].concat(change_spec.args), + context_id: change_spec.context_index == undefined ? null : change_spec.context_index + 1 + }); + } else { + def = $.when({}); + } + return def.then(function(response) { if (widget.field['change_default']) { - var fieldname = widget.name, value_; + var fieldname = widget.name + var value_; if (response.value && (fieldname in response.value)) { // Use value from onchange if onchange executed value_ = response.value[fieldname]; @@ -534,15 +530,14 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM var condition = fieldname + '=' + value_; if (value_) { - can_process_onchange = self.rpc({ - url: '/web/dataset/call', - async: false - }, { + return self.rpc('/web/dataset/call', { model: 'ir.values', method: 'get_defaults', args: [self.model, condition] }).then(function (results) { - if (!results.length) { return; } + if (!results.length) { + return response; + } if (!response.value) { response.value = {}; } @@ -551,20 +546,19 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM var triplet = results[i]; response.value[triplet[1]] = triplet[2]; } + return response; }); } } - if (can_process_onchange.isRejected()) { - return can_process_onchange; - } - + return response; + }).then(function(response) { return self.on_processed_onchange(response, processed); - } catch(e) { - console.error(e); - instance.webclient.crashmanager.show_message(e); - return $.Deferred().reject(); - } - }); + }); + } catch(e) { + console.error(e); + instance.webclient.crashmanager.show_message(e); + return $.Deferred().reject(); + } }, on_processed_onchange: function(result, processed) { try { @@ -600,6 +594,38 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM return $.Deferred().reject(); } }, + _process_operations: function() { + var self = this; + return this.mutating_mutex.exec(function() { + function iterate() { + var on_change_obj = self.on_change_list.shift(); + if (on_change_obj) { + return self._process_onchange(on_change_obj).then(function() { + return iterate(); + }); + } + var defs = []; + _.each(self.fields, function(field) { + defs.push(field.commit_value()); + }); + var args = _.toArray(arguments); + return $.when.apply($, defs).then(function() { + if (self.on_change_list.length !== 0) { + return iterate(); + } + var save_obj = self.save_list.pop(); + if (save_obj) { + return self._process_save(save_obj).then(function() { + save_obj.ret = _.toArray(arguments); + return iterate(); + }); + } + return $.when(); + }); + }; + return iterate(); + }); + }, _internal_set_values: function(values, exclude) { exclude = exclude || []; for (var f in values) { @@ -623,7 +649,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM }, set_values: function(values) { var self = this; - return this.on_change_mutex.exec(function() { + return this.mutating_mutex.exec(function() { self._internal_set_values(values); }); }, @@ -693,7 +719,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM }, on_button_save: function() { var self = this; - return this.save().then(function(result) { + return this.save().done(function(result) { self.trigger("save", result); self.to_view_mode(); }); @@ -713,7 +739,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM on_button_new: function() { var self = this; this.to_edit_mode(); - return $.when(this.has_been_loaded).pipe(function() { + return $.when(this.has_been_loaded).then(function() { if (self.can_be_discarded()) { return self.load_defaults(); } @@ -728,29 +754,24 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM }, on_button_duplicate: function() { var self = this; - var def = $.Deferred(); - $.when(this.has_been_loaded).then(function() { - self.dataset.call('copy', [self.datarecord.id, {}, self.dataset.context]).then(function(new_id) { - return self.record_created(new_id); - }).then(function() { - return self.to_edit_mode(); - }).then(function() { - def.resolve(); + return this.has_been_loaded.then(function() { + return self.dataset.call('copy', [self.datarecord.id, {}, self.dataset.context]).then(function(new_id) { + self.record_created(new_id); + self.to_edit_mode(); }); }); - return def.promise(); }, on_button_delete: function() { var self = this; var def = $.Deferred(); - $.when(this.has_been_loaded).then(function() { + this.has_been_loaded.done(function() { if (self.datarecord.id && confirm(_t("Do you really want to delete this record?"))) { - self.dataset.unlink([self.datarecord.id]).then(function() { + self.dataset.unlink([self.datarecord.id]).done(function() { self.execute_pager_action('next'); def.resolve(); }); } else { - $.async_when().then(function () { + $.async_when().done(function () { def.reject(); }) } @@ -777,8 +798,16 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM */ save: function(prepend_on_create) { var self = this; - return this.mutating_mutex.exec(function() { return self.is_initialized.pipe(function() { - try { + var save_obj = {prepend_on_create: prepend_on_create, ret: null}; + this.save_list.push(save_obj); + return this._process_operations().then(function() { + return $.when.apply($, save_obj.ret); + }); + }, + _process_save: function(save_obj) { + var self = this; + var prepend_on_create = save_obj.prepend_on_create; + try { var form_invalid = false, values = {}, first_invalid_field = null; @@ -807,7 +836,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM var save_deferral; if (!self.datarecord.id) { // Creation save - save_deferral = self.dataset.create(values).pipe(function(r) { + save_deferral = self.dataset.create(values).then(function(r) { return self.record_created(r, prepend_on_create); }, null); } else if (_.isEmpty(values) && ! self.force_dirty) { @@ -816,17 +845,16 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM } else { self.force_dirty = false; // Write save - save_deferral = self.dataset.write(self.datarecord.id, values, {}).pipe(function(r) { + save_deferral = self.dataset.write(self.datarecord.id, values, {}).then(function(r) { return self.record_saved(r); }, null); } return save_deferral; } - } catch (e) { - console.error(e); - return $.Deferred().reject(); - } - });}); + } catch (e) { + console.error(e); + return $.Deferred().reject(); + } }, on_invalid: function() { var warnings = _(this.fields).chain() @@ -851,7 +879,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM this.trigger('record_saved', r); return $.Deferred().reject(); } else { - return $.when(this.reload()).pipe(function () { + return $.when(this.reload()).then(function () { self.trigger('record_saved', r); return r; }); @@ -890,7 +918,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM this.sidebar.do_attachement_update(this.dataset, this.datarecord.id); } //openerp.log("The record has been created with id #" + this.datarecord.id); - return $.when(this.reload()).pipe(function () { + return $.when(this.reload()).then(function () { self.trigger('record_created', r); return _.extend(r, {created: true}); }); @@ -917,7 +945,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM 'bin_size': true, 'future_display_name': true } - }).pipe(function(r) { + }).then(function(r) { self.trigger('load_record', r); }); } @@ -928,15 +956,11 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM return obj instanceof instance.web.form.FormWidget; }); }, - get_fields_values: function(blacklist) { - blacklist = blacklist || []; + get_fields_values: function() { var values = {}; var ids = this.get_selected_ids(); values["id"] = ids.length > 0 ? ids[0] : false; _.each(this.fields, function(value_, key) { - if (_.include(blacklist, key)) { - return; - } values[key] = value_.get_value(); }); return values; @@ -947,7 +971,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM }, recursive_save: function() { var self = this; - return $.when(this.save()).pipe(function(res) { + return $.when(this.save()).then(function(res) { if (self.dataset.parent_view) return self.dataset.parent_view.recursive_save(); }); @@ -957,7 +981,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM var pre = $.when(); if (self.dataset.parent_view) pre = self.dataset.parent_view.recursive_reload(); - return pre.pipe(function() { + return pre.then(function() { return self.reload(); }); }, @@ -978,7 +1002,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM return true; }, sidebar_context: function () { - return this.save().pipe(_.bind(function() {return this.get_fields_values();}, this)); + return this.save().then(_.bind(function() {return this.get_fields_values();}, this)); }, open_defaults_dialog: function () { var self = this; @@ -1054,7 +1078,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM all_users, true, condition || false - ]).then(function () { d.close(); }); + ]).done(function () { d.close(); }); }} ] }); @@ -1097,9 +1121,9 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM compute_domain: function(expression) { return instance.web.form.compute_domain(expression, this.fields); }, - _build_view_fields_values: function(blacklist) { + _build_view_fields_values: function() { var a_dataset = this.dataset; - var fields_values = this.get_fields_values(blacklist); + var fields_values = this.get_fields_values(); var active_id = a_dataset.ids[a_dataset.index]; _.extend(fields_values, { active_id: active_id || false, @@ -1108,13 +1132,13 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM parent: {} }); if (a_dataset.parent_view) { - fields_values.parent = a_dataset.parent_view.get_fields_values([a_dataset.child_name]); + fields_values.parent = a_dataset.parent_view.get_fields_values(); } return fields_values; }, - build_eval_context: function(blacklist) { + build_eval_context: function() { var a_dataset = this.dataset; - return new instance.web.CompoundContext(a_dataset.get_context(), this._build_view_fields_values(blacklist)); + return new instance.web.CompoundContext(a_dataset.get_context(), this._build_view_fields_values()); }, }); @@ -1810,7 +1834,7 @@ instance.web.form.FormWidget = instance.web.Widget.extend(instance.web.form.Invi * Builds a new context usable for operations related to fields by merging * the fields'context with the action's context. */ - build_context: function(blacklist) { + build_context: function() { // only use the model's context if there is not context on the node var v_context = this.node.attrs.context; if (! v_context) { @@ -1818,7 +1842,7 @@ instance.web.form.FormWidget = instance.web.Widget.extend(instance.web.form.Invi } if (v_context.__ref || true) { //TODO: remove true - var fields_values = this.field_manager.build_eval_context(blacklist); + var fields_values = this.field_manager.build_eval_context(); v_context = new instance.web.CompoundContext(v_context).set_eval_context(fields_values); } return v_context; @@ -1883,7 +1907,7 @@ instance.web.form.WidgetButton = instance.web.form.FormWidget.extend({ } }, {text: _t("Ok"), click: function() { - self.on_confirmed().then(function() { + self.on_confirmed().done(function() { def.resolve(); }); $(this).dialog("close"); @@ -1898,7 +1922,7 @@ instance.web.form.WidgetButton = instance.web.form.FormWidget.extend({ }; if (!this.node.attrs.special) { this.view.force_dirty = true; - return this.view.recursive_save().pipe(exec_action); + return this.view.recursive_save().then(exec_action); } else { return exec_action(); } @@ -1991,6 +2015,11 @@ instance.web.form.FieldInterface = { * Called when the translate button is clicked. */ on_translate: function() {}, + /** + This method is called by the form view before reading on_change values and before saving. It tells + the field to save its value before reading it using get_value(). Must return a promise. + */ + commit_value: function() {}, }; /** @@ -2117,7 +2146,7 @@ instance.web.form.AbstractField = instance.web.form.FormWidget.extend(instance.w on_translate: function() { var self = this; var trans = new instance.web.DataSet(this, 'ir.translation'); - return trans.call_button('translate_fields', [this.view.dataset.model, this.view.datarecord.id, this.name, this.view.dataset.get_context()]).then(function(r) { + return trans.call_button('translate_fields', [this.view.dataset.model, this.view.datarecord.id, this.name, this.view.dataset.get_context()]).done(function(r) { self.do_action(r); }); }, @@ -2134,7 +2163,10 @@ instance.web.form.AbstractField = instance.web.form.FormWidget.extend(instance.w } this.$el.attr('style', style); this.$el.css('minHeight', height); - } + }, + commit_value: function() { + return $.when(); + }, }); /** @@ -2228,6 +2260,13 @@ instance.web.form.FieldChar = instance.web.form.AbstractField.extend(instance.we }, focus: function() { this.$('input:first').focus(); + }, + set_dimensions: function (height, width) { + this._super(height, width); + this.$('input').css({ + height: height, + width: width + }); } }); @@ -2454,6 +2493,10 @@ instance.web.form.FieldDatetime = instance.web.form.AbstractField.extend(instanc if (this.datewidget && this.datewidget.$input) { this.datewidget.$input.focus(); } + }, + set_dimensions: function (height, width) { + this._super(height, width); + this.datewidget.$input.css('height', height); } }); @@ -2514,7 +2557,7 @@ instance.web.form.FieldText = instance.web.form.AbstractField.extend(instance.we this.$textarea.focus(); }, set_dimensions: function (height, width) { - this._super(); + this._super(height, width); this.$textarea.css({ width: width, minHeight: height @@ -2539,7 +2582,7 @@ instance.web.form.FieldTextHtml = instance.web.form.AbstractField.extend(instanc if (! this.get("effective_readonly")) { self._updating_editor = false; this.$textarea = this.$el.find('textarea'); - var width = ((this.node.attrs || {}).editor_width || 468); + var width = ((this.node.attrs || {}).editor_width || '100%'); var height = ((this.node.attrs || {}).editor_height || 250); this.$textarea.cleditor({ width: width, // width not including margins, borders or padding @@ -2676,6 +2719,13 @@ instance.web.form.FieldSelection = instance.web.form.AbstractField.extend(instan }, focus: function() { this.$el.find('select:first').focus(); + }, + set_dimensions: function (height, width) { + this._super(height, width); + this.$('select').css({ + height: height, + width: width + }); } }); @@ -2732,7 +2782,7 @@ instance.web.form.CompletionFieldMixin = { return this.orderer.add(dataset.name_search( search_val, new instance.web.CompoundDomain(self.build_domain(), [["id", "not in", blacklist]]), - 'ilike', this.limit + 1, self.build_context())).pipe(function(data) { + 'ilike', this.limit + 1, self.build_context())).then(function(data) { self.last_search = data; // possible selections for the m2o var values = _.map(data, function(x) { @@ -2751,7 +2801,7 @@ instance.web.form.CompletionFieldMixin = { values.push({ label: _t("Search More..."), action: function() { - dataset.name_search(search_val, self.build_domain(), 'ilike', false).then(function(data) { + dataset.name_search(search_val, self.build_domain(), 'ilike', false).done(function(data) { self._search_create_popup("search", data); }); }, @@ -2792,7 +2842,7 @@ instance.web.form.CompletionFieldMixin = { }; if (self.options.quick_create === undefined || self.options.quick_create) { new instance.web.DataSet(this, this.field.relation, self.build_context()) - .name_create(name).then(function(data) { + .name_create(name).done(function(data) { self.add_id(data[0]); }).fail(function(error, event) { event.preventDefault(); @@ -2967,7 +3017,7 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc self.uned_def = $.Deferred(); var ed_delay = 200; var ed_duration = 15000; - var anyoneLoosesFocus = function() { + var anyoneLoosesFocus = function (e) { var used = false; if (self.floating) { if (self.last_search.length > 0) { @@ -2989,14 +3039,17 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc self.ed_def.reject(); self.uned_def.reject(); self.ed_def = $.Deferred(); - self.ed_def.then(function() { + self.ed_def.done(function() { self.show_error_displayer(); + ignore_blur = false; + self.trigger('focused'); }); + ignore_blur = true; setTimeout(function() { self.ed_def.resolve(); self.uned_def.reject(); self.uned_def = $.Deferred(); - self.uned_def.then(function() { + self.uned_def.done(function() { self.hide_error_displayer(); }); setTimeout(function() {self.uned_def.resolve();}, ed_duration); @@ -3026,7 +3079,7 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc // autocomplete this.$input.autocomplete({ source: function(req, resp) { - self.get_search_result(req.term).then(function(result) { + self.get_search_result(req.term).done(function(result) { resp(result); }); }, @@ -3077,7 +3130,7 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc } if (! no_recurse) { var dataset = new instance.web.DataSetStatic(this, this.field.relation, self.build_context()); - dataset.name_get([self.get("value")]).then(function(data) { + dataset.name_get([self.get("value")]).done(function(data) { self.display_value["" + self.get("value")] = data[0][1]; self.render_value(true); }); @@ -3110,7 +3163,6 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc type: 'ir.actions.act_window', res_model: self.field.relation, res_id: self.get("value"), - context: self.build_context(), views: [[false, 'form']], target: 'current' }); @@ -3156,6 +3208,62 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc this.ed_def.reject(); return instance.web.form.CompletionFieldMixin._search_create_popup.apply(this, arguments); }, + set_dimensions: function (height, width) { + this._super(height, width); + this.$input.css('height', height); + } +}); + +instance.web.form.Many2OneButton = instance.web.form.AbstractField.extend({ + template: 'Many2OneButton', + init: function(field_manager, node) { + this._super.apply(this, arguments); + }, + start: function() { + this._super.apply(this, arguments); + this.set_button(); + }, + set_button: function() { + var self = this; + if (this.$button) { + this.$button.remove(); + } + var options = {}; + try { + options = py.eval(this.node.attrs.options); + } catch (e) {} + if (options.label) { + this.string = this.get('value') ? _t(options.label.edit) : _t(options.label.create); + } else { + this.string = ''; + } + this.node.attrs.icon = this.get('value') ? '/web/static/src/img/icons/gtk-yes.png' : '/web/static/src/img/icons/gtk-no.png'; + this.$button = $(QWeb.render('WidgetButton', {'widget': this})); + this.$el.append(this.$button); + this.$button.on('click', self.on_click); + }, + on_click: function(ev) { + var self = this; + this.popup = new instance.web.form.FormOpenPopup(this); + this.popup.show_element( + this.field.relation, + this.get('value'), + this.build_context(), + {title: this.string} + ); + this.popup.on('create_completed write_completed', self, function(r) { + self.set_value(r); + }); + }, + set_value: function(value_) { + var self = this; + if (value_ instanceof Array) { + value_ = value_[0]; + } + value_ = value_ || false; + this.set('value', value_); + this.set_button(); + }, }); /* @@ -3231,11 +3339,11 @@ instance.web.form.FieldOne2Many = instance.web.form.AbstractField.extend({ var self = this; self.load_views(); - this.is_loaded.then(function() { + this.is_loaded.done(function() { self.on("change:effective_readonly", self, function() { - self.is_loaded = self.is_loaded.pipe(function() { + self.is_loaded = self.is_loaded.then(function() { self.viewmanager.destroy(); - return $.when(self.load_views()).then(function() { + return $.when(self.load_views()).done(function() { self.reload_current_view(); }); }); @@ -3245,10 +3353,7 @@ instance.web.form.FieldOne2Many = instance.web.form.AbstractField.extend({ this.reload_current_view(); }, trigger_on_change: function() { - var tmp = this.doing_on_change; - this.doing_on_change = true; this.trigger('changed_value'); - this.doing_on_change = tmp; }, load_views: function() { var self = this; @@ -3308,10 +3413,10 @@ instance.web.form.FieldOne2Many = instance.web.form.AbstractField.extend({ this.viewmanager = new instance.web.form.One2ManyViewManager(this, this.dataset, views, {}); this.viewmanager.o2m = self; - var once = $.Deferred().then(function() { + var once = $.Deferred().done(function() { self.init_form_last_update.resolve(); }); - var def = $.Deferred().then(function() { + var def = $.Deferred().done(function() { self.initial_is_loaded.resolve(); }); this.viewmanager.on("controller_inited", self, function(view_type, controller) { @@ -3322,7 +3427,7 @@ instance.web.form.FieldOne2Many = instance.web.form.AbstractField.extend({ e.cancel = true; }); _(controller.columns).find(function (column) { - if (!column instanceof instance.web.list.Handle) { + if (!(column instanceof instance.web.list.Handle)) { return false; } column.modifiers.invisible = true; @@ -3343,22 +3448,22 @@ instance.web.form.FieldOne2Many = instance.web.form.AbstractField.extend({ def.resolve(); }); this.viewmanager.on("switch_mode", self, function(n_mode, b, c, d, e) { - $.when(self.save_any_view()).then(function() { + $.when(self.save_any_view()).done(function() { if (n_mode === "list") { - $.async_when().then(function() { + $.async_when().done(function() { self.reload_current_view(); }); } }); }); - $.async_when().then(function () { + $.async_when().done(function () { self.viewmanager.appendTo(self.$el); }); return def; }, reload_current_view: function() { var self = this; - return self.is_loaded = self.is_loaded.pipe(function() { + return self.is_loaded = self.is_loaded.then(function() { var active_view = self.viewmanager.active_view; var view = self.viewmanager.views[active_view].controller; if(active_view === "list") { @@ -3370,7 +3475,7 @@ instance.web.form.FieldOne2Many = instance.web.form.AbstractField.extend({ var act = function() { return view.do_show(); }; - self.form_last_update = self.form_last_update.pipe(act, act); + self.form_last_update = self.form_last_update.then(act, act); return self.form_last_update; } else if (view.do_search) { return view.do_search(self.build_domain(), self.dataset.get_context(), []); @@ -3443,7 +3548,6 @@ instance.web.form.FieldOne2Many = instance.web.form.AbstractField.extend({ var self = this; if (!this.dataset) return []; - this.save_any_view(); var val = this.dataset.delete_all ? [commands.delete_all()] : []; val = val.concat(_.map(this.dataset.ids, function(id) { var alter_order = _.detect(self.dataset.to_create, function(x) {return x.id === id;}); @@ -3460,33 +3564,24 @@ instance.web.form.FieldOne2Many = instance.web.form.AbstractField.extend({ this.dataset.to_delete, function(x) { return commands['delete'](x.id);})); }, + commit_value: function() { + return this.save_any_view(); + }, save_any_view: function() { - if (this.doing_on_change) - return false; - return this.session.synchronized_mode(_.bind(function() { - if (this.viewmanager && this.viewmanager.views && this.viewmanager.active_view && - this.viewmanager.views[this.viewmanager.active_view] && - this.viewmanager.views[this.viewmanager.active_view].controller) { - var view = this.viewmanager.views[this.viewmanager.active_view].controller; - if (this.viewmanager.active_view === "form") { - if (!view.is_initialized.isResolved()) { - return false; - } - var res = $.when(view.save()); - if (!res.isResolved() && !res.isRejected()) { - console.warn("Asynchronous get_value() is not supported in form view."); - } - return res; - } else if (this.viewmanager.active_view === "list") { - var res = $.when(view.ensure_saved()); - if (!res.isResolved() && !res.isRejected()) { - console.warn("Asynchronous get_value() is not supported in list view."); - } - return res; + if (this.viewmanager && this.viewmanager.views && this.viewmanager.active_view && + this.viewmanager.views[this.viewmanager.active_view] && + this.viewmanager.views[this.viewmanager.active_view].controller) { + var view = this.viewmanager.views[this.viewmanager.active_view].controller; + if (this.viewmanager.active_view === "form") { + if (!view.is_initialized.state() === 'resolved') { + return $.when(false); } + return $.when(view.save()); + } else if (this.viewmanager.active_view === "list") { + return $.when(view.ensure_saved()); } - return false; - }, this)); + } + return $.when(false); }, is_syntax_valid: function() { if (! this.viewmanager || ! this.viewmanager.views[this.viewmanager.active_view]) @@ -3527,13 +3622,13 @@ instance.web.form.One2ManyViewManager = instance.web.ViewManager.extend({ pop.show_element(self.o2m.field.relation, id, self.o2m.build_context(), { title: _t("Open: ") + self.o2m.string, create_function: function(data) { - return self.o2m.dataset.create(data).then(function(r) { + return self.o2m.dataset.create(data).done(function(r) { self.o2m.dataset.set_ids(self.o2m.dataset.ids.concat([r])); self.o2m.dataset.trigger("dataset_changed", r); }); }, write_function: function(id, data, options) { - return self.o2m.dataset.write(id, data, {}).then(function() { + return self.o2m.dataset.write(id, data, {}).done(function() { self.o2m.reload_current_view(); }); }, @@ -3554,7 +3649,7 @@ instance.web.form.One2ManyViewManager = instance.web.ViewManager.extend({ instance.web.form.One2ManyDataSet = instance.web.BufferedDataSet.extend({ get_context: function() { - this.context = this.o2m.build_context([this.o2m.name]); + this.context = this.o2m.build_context(); return this.context; } }); @@ -3618,10 +3713,10 @@ instance.web.form.One2ManyListView = instance.web.ListView.extend({ initial_view: "form", alternative_form_view: self.o2m.field.views ? self.o2m.field.views["form"] : undefined, create_function: function(data, callback, error_callback) { - return self.o2m.dataset.create(data).then(function(r) { + return self.o2m.dataset.create(data).done(function(r) { self.o2m.dataset.set_ids(self.o2m.dataset.ids.concat([r])); self.o2m.dataset.trigger("dataset_changed", r); - }).then(callback, error_callback); + }).done(callback).fail(error_callback); }, read_function: function() { return self.o2m.dataset.read_ids.apply(self.o2m.dataset, arguments); @@ -3644,7 +3739,7 @@ instance.web.form.One2ManyListView = instance.web.ListView.extend({ pop.show_element(self.o2m.field.relation, id, self.o2m.build_context(), { title: _t("Open: ") + self.o2m.string, write_function: function(id, data) { - return self.o2m.dataset.write(id, data, {}).then(function() { + return self.o2m.dataset.write(id, data, {}).done(function() { self.o2m.reload_current_view(); }); }, @@ -3667,12 +3762,12 @@ instance.web.form.One2ManyListView = instance.web.ListView.extend({ } var parent_form = this.o2m.view; var self = this; - this.ensure_saved().pipe(function () { + this.ensure_saved().then(function () { if (parent_form) return parent_form.save(); else return $.when(); - }).then(function () { + }).done(function () { self.handle_button(name, id, callback); }); }, @@ -3709,7 +3804,7 @@ instance.web.form.One2ManyListView = instance.web.ListView.extend({ } // FIXME: why isn't there an API for this? if (this.editor.form.$el.hasClass('oe_form_dirty')) { - this.save_edition(); + this.ensure_saved(); return; } this.cancel_edition(); @@ -3732,7 +3827,7 @@ instance.web.form.One2ManyListView = instance.web.ListView.extend({ ids.splice(false_id_index, 1); next = this.cancel_edition(true); } - return next.pipe(function () { + return next.then(function () { // wheeee var confirm = window.confirm; window.confirm = function () { return true; }; @@ -3794,7 +3889,7 @@ instance.web.form.One2ManyList = instance.web.ListView.List.extend({ clearTimeout(self.view.editor.form.__blur_timeout); self.view.editor.form.__blur_timeout = false; } - self.view.ensure_saved().then(function () { + self.view.ensure_saved().done(function () { self.view.do_add_record(); }); })); @@ -3815,7 +3910,7 @@ instance.web.form.One2ManyFormView = instance.web.FormView.extend({ this._super(data); var self = this; this.$buttons.find('button.oe_form_button_create').click(function() { - self.save().then(self.on_button_new); + self.save().done(self.on_button_new); }); }, do_notify_change: function() { @@ -3828,11 +3923,11 @@ instance.web.form.One2ManyFormView = instance.web.FormView.extend({ }); var lazy_build_o2m_kanban_view = function() { -if (! instance.web_kanban || instance.web.form.One2ManyKanbanView) - return; -instance.web.form.One2ManyKanbanView = instance.web_kanban.KanbanView.extend({ -}); -} + if (! instance.web_kanban || instance.web.form.One2ManyKanbanView) + return; + instance.web.form.One2ManyKanbanView = instance.web_kanban.KanbanView.extend({ + }); +}; instance.web.form.FieldMany2ManyTags = instance.web.form.AbstractField.extend(instance.web.form.CompletionFieldMixin, instance.web.form.ReinitializeFieldMixin, { template: "FieldMany2ManyTags", @@ -3847,7 +3942,7 @@ instance.web.form.FieldMany2ManyTags = instance.web.form.AbstractField.extend(in if (this.get("effective_readonly")) return; var self = this; - self.$text = $("textarea", this.$el); + self.$text = this.$("textarea"); self.$text.textext({ plugins : 'tags arrow autocomplete', autocomplete: { @@ -3871,9 +3966,8 @@ instance.web.form.FieldMany2ManyTags = instance.web.form.AbstractField.extend(in }, tags: { isTagAllowed: function(tag) { - if (! tag.name) - return false; - return true; + return !!tag.name; + }, removeTag: function(tag) { var id = tag.data("id"); @@ -3893,7 +3987,7 @@ instance.web.form.FieldMany2ManyTags = instance.web.form.AbstractField.extend(in }).bind('getSuggestions', function(e, data) { var _this = this; var str = !!data ? data.query || '' : ''; - self.get_search_result(str).then(function(result) { + self.get_search_result(str).done(function(result) { self.search_result = result; $(_this).trigger('setSuggestions', {result : _.map(result, function(el, i) { return _.extend(el, {index:i}); @@ -3905,7 +3999,7 @@ instance.web.form.FieldMany2ManyTags = instance.web.form.AbstractField.extend(in self._drop_shown = true; }); self.tags = self.$text.textext()[0].tags(); - $("textarea", this.$el).focusout(function() { + self.$text.focusout(function() { self.$text.trigger("setInputData", ""); }).keydown(function(e) { if (e.which === $.ui.keyCode.TAB && self._drop_shown) { @@ -3930,8 +4024,10 @@ instance.web.form.FieldMany2ManyTags = instance.web.form.AbstractField.extend(in render_value: function() { var self = this; var dataset = new instance.web.DataSetStatic(this, this.field.relation, self.build_context()); - var values = self.get("value") + var values = self.get("value"); var handle_names = function(data) { + if (self.isDestroyed()) + return; var indexed = {}; _.each(data, function(el) { indexed[el[0]] = el; @@ -3939,14 +4035,14 @@ instance.web.form.FieldMany2ManyTags = instance.web.form.AbstractField.extend(in data = _.map(values, function(el) { return indexed[el]; }); if (! self.get("effective_readonly")) { self.tags.containerElement().children().remove(); - $("textarea", self.$el).css("padding-left", "3px"); + self.$('textarea').css("padding-left", "3px"); self.tags.addTags(_.map(data, function(el) {return {name: el[1], id:el[0]};})); } else { self.$el.html(QWeb.render("FieldMany2ManyTag", {elements: data})); } }; if (! values || values.length > 0) { - this._display_orderer.add(dataset.name_get(values)).then(handle_names); + this._display_orderer.add(dataset.name_get(values)).done(handle_names); } else { handle_names([]); } @@ -3983,11 +4079,11 @@ instance.web.form.FieldMany2Many = instance.web.form.AbstractField.extend({ var self = this; self.load_view(); - this.is_loaded.then(function() { + this.is_loaded.done(function() { self.on("change:effective_readonly", self, function() { - self.is_loaded = self.is_loaded.pipe(function() { + self.is_loaded = self.is_loaded.then(function() { self.list_view.destroy(); - return $.when(self.load_view()).then(function() { + return $.when(self.load_view()).done(function() { self.render_value(); }); }); @@ -4028,7 +4124,7 @@ instance.web.form.FieldMany2Many = instance.web.form.AbstractField.extend({ self.initial_is_loaded.resolve(); loaded.resolve(); }); - $.async_when().then(function () { + $.async_when().done(function () { self.list_view.appendTo(self.$el); }); return loaded; @@ -4036,7 +4132,7 @@ instance.web.form.FieldMany2Many = instance.web.form.AbstractField.extend({ render_value: function() { var self = this; this.dataset.set_ids(this.get("value")); - this.is_loaded = this.is_loaded.pipe(function() { + this.is_loaded = this.is_loaded.then(function() { return self.list_view.reload_content(); }); }, @@ -4097,7 +4193,7 @@ instance.web.form.Many2ManyListView = instance.web.ListView.extend(/** @lends in if (! this.m2m_field.options.reload_on_button) { return _sup(name, id, callback); } else { - return this.m2m_field.view.save().pipe(function() { + return this.m2m_field.view.save().then(function() { return _sup(name, id, function() { self.m2m_field.view.reload(); }); @@ -4128,11 +4224,11 @@ instance.web.form.FieldMany2ManyKanban = instance.web.form.AbstractField.extend( var self = this; self.load_view(); - this.is_loaded.then(function() { + this.is_loaded.done(function() { self.on("change:effective_readonly", self, function() { - self.is_loaded = self.is_loaded.pipe(function() { + self.is_loaded = self.is_loaded.then(function() { self.kanban_view.destroy(); - return $.when(self.load_view()).then(function() { + return $.when(self.load_view()).done(function() { self.render_value(); }); }); @@ -4169,7 +4265,7 @@ instance.web.form.FieldMany2ManyKanban = instance.web.form.AbstractField.extend( loaded.resolve(); }); this.kanban_view.on('switch_mode', this, this.open_popup); - $.async_when().then(function () { + $.async_when().done(function () { self.kanban_view.appendTo(self.$el); }); return loaded; @@ -4177,7 +4273,7 @@ instance.web.form.FieldMany2ManyKanban = instance.web.form.AbstractField.extend( render_value: function() { var self = this; this.dataset.set_ids(this.get("value")); - this.is_loaded = this.is_loaded.pipe(function() { + this.is_loaded = this.is_loaded.then(function() { return self.kanban_view.do_search(self.build_domain(), self.dataset.get_context(), []); }); }, @@ -4213,7 +4309,7 @@ instance.web.form.FieldMany2ManyKanban = instance.web.form.AbstractField.extend( pop.show_element(self.field.relation, id, self.build_context(), { title: _t("Open: ") + self.string, write_function: function(id, data, options) { - return self.dataset.write(id, data, {}).then(function() { + return self.dataset.write(id, data, {}).done(function() { self.render_value(); }); }, @@ -4286,7 +4382,7 @@ instance.web.form.Many2ManyQuickCreate = instance.web.Widget.extend({ }).bind('getSuggestions', function(e, data) { var _this = this; var str = !!data ? data.query || '' : ''; - self.m2m.get_search_result(str).then(function(result) { + self.m2m.get_search_result(str).done(function(result) { self.search_result = result; $(_this).trigger('setSuggestions', {result : _.map(result, function(el, i) { return _.extend(el, {index:i}); @@ -4341,14 +4437,15 @@ instance.web.form.AbstractFormPopup = instance.web.Widget.extend({ this.dataset.read_function = this.options.read_function; this.dataset.create_function = function(data, sup) { var fct = self.options.create_function || sup; - return fct.call(this, data).then(function(r) { + return fct.call(this, data).done(function(r) { + self.trigger('create_completed saved', r); self.created_elements.push(r); }); }; this.dataset.write_function = function(id, data, options, sup) { var fct = self.options.write_function || sup; - return fct.call(this, id, data, options).then(function() { - self.trigger('write_completed'); + return fct.call(this, id, data, options).done(function() { + self.trigger('write_completed saved'); }); }; this.dataset.parent_view = this.options.parent_view; @@ -4396,7 +4493,7 @@ instance.web.form.AbstractFormPopup = instance.web.Widget.extend({ })); var $snbutton = self.$buttonpane.find(".oe_abstractformpopup-form-save-new"); $snbutton.click(function() { - $.when(self.view_form.save()).then(function() { + $.when(self.view_form.save()).done(function() { self.view_form.reload_mutex.exec(function() { self.view_form.on_button_new(); }); @@ -4404,7 +4501,7 @@ instance.web.form.AbstractFormPopup = instance.web.Widget.extend({ }); var $sbutton = self.$buttonpane.find(".oe_abstractformpopup-form-save"); $sbutton.click(function() { - $.when(self.view_form.save()).then(function() { + $.when(self.view_form.save()).done(function() { self.view_form.reload_mutex.exec(function() { self.check_exit(); }); @@ -4425,10 +4522,14 @@ instance.web.form.AbstractFormPopup = instance.web.Widget.extend({ this.select_elements(this.created_elements); this.created_elements = []; } + this.trigger('closed'); this.destroy(); }, destroy: function () { - this.$el.dialog('close'); + this.trigger('closed'); + if (this.$el.is(":data(dialog)")) { + this.$el.dialog('close'); + } this._super(); }, }); @@ -4478,7 +4579,7 @@ instance.web.form.SelectCreatePopup = instance.web.form.AbstractFormPopup.extend self.rpc('/web/session/eval_domain_and_context', { domains: [], contexts: [this.context] - }).then(function (results) { + }).done(function (results) { var search_defaults = {}; _.each(results.context, function (value_, key) { var match = /^search_default_(.*)$/.exec(key); @@ -4520,9 +4621,9 @@ instance.web.form.SelectCreatePopup = instance.web.form.AbstractFormPopup.extend e.cancel = true; }); self.view_list.popup = self; - self.view_list.appendTo($(".oe_popup_list", self.$el)).pipe(function() { + self.view_list.appendTo($(".oe_popup_list", self.$el)).then(function() { self.view_list.do_show(); - }).pipe(function() { + }).then(function() { self.searchview.do_search(); }); self.view_list.on("list_view_loaded", self, function() { @@ -4550,7 +4651,7 @@ instance.web.form.SelectCreatePopup = instance.web.form.AbstractFormPopup.extend domains: domains || [], contexts: contexts || [], group_by_seq: groupbys || [] - }).then(function (results) { + }).done(function (results) { self.view_list.do_search(results.domain, results.context, results.group_by); }); }, @@ -4831,6 +4932,7 @@ instance.web.form.FieldBinaryFile = instance.web.form.FieldBinary.extend({ instance.web.form.FieldBinaryImage = instance.web.form.FieldBinary.extend({ template: 'FieldBinaryImage', + placeholder: "/web/static/src/img/placeholder.png", render_value: function() { var self = this; var url; @@ -4844,7 +4946,7 @@ instance.web.form.FieldBinaryImage = instance.web.form.FieldBinary.extend({ url = '/web/binary/image?session_id=' + this.session.session_id + '&model=' + this.view.dataset.model +'&id=' + id + '&field=' + field + '&t=' + (new Date().getTime()); } else { - url = "/web/static/src/img/placeholder.png"; + url = this.placeholder; } var $img = $(QWeb.render("FieldBinaryImage-img", { widget: this, url: url })); this.$el.find('> img').remove(); @@ -4857,10 +4959,10 @@ instance.web.form.FieldBinaryImage = instance.web.form.FieldBinary.extend({ $img.css("margin-left", "" + (self.options.size[0] - $img.width()) / 2 + "px"); $img.css("margin-top", "" + (self.options.size[1] - $img.height()) / 2 + "px"); }); - }, - on_file_change: function() { - this.render_value(); - this._super.apply(this, arguments); + $img.on('error', function() { + $img.attr('src', self.placeholder); + instance.webclient.notification.warn(_t("Image"), _t("Could not display the selected image.")); + }); }, on_file_uploaded_and_valid: function(size, name, content_type, file_base64) { this.internal_set_value(file_base64); @@ -4875,6 +4977,132 @@ instance.web.form.FieldBinaryImage = instance.web.form.FieldBinary.extend({ } }); +/** + * Widget for (one2many field) to upload one or more file in same time and display in list. + * The user can delete his files. + * Options on attribute ; "blockui" {Boolean} block the UI or not + * during the file is uploading + */ +instance.web.form.FieldOne2ManyBinaryMultiFiles = instance.web.form.AbstractField.extend({ + template: "FieldBinaryFileUploader", + init: function(field_manager, node) { + this._super(field_manager, node); + this.field_manager = field_manager; + this.node = node; + if(this.field.type != "one2many" || this.field.relation != 'ir.attachment') { + throw "The type of the field '"+this.field.string+"' must be a one2many field with a relation to 'ir.attachment' model."; + } + this.ds_file = new instance.web.DataSetSearch(this, 'ir.attachment'); + this.fileupload_id = _.uniqueId('oe_fileupload_temp'); + $(window).on(this.fileupload_id, _.bind(this.on_file_loaded, this)); + }, + start: function() { + this._super(this); + this.$el.on('change', 'input.oe_form_binary_file', this.on_file_change ); + }, + get_value: function() { + return _.map(this.get('value'), function (value) { return commands.link_to( value.id ); }); + }, + get_file_url: function (attachment) { + return instance.origin + '/web/binary/saveas?session_id=' + this.session.session_id + '&model=ir.attachment&field=datas&filename_field=datas_fname&id=' + attachment['id']; + }, + render_value: function () { + var render = $(instance.web.qweb.render('FieldBinaryFileUploader.files', {'widget': this})); + render.on('click', '.oe_delete', _.bind(this.on_file_delete, this)); + this.$('.oe_placeholder_files, .oe_attachments').replaceWith( render ); + + // reinit input type file + var $input = this.$('input.oe_form_binary_file'); + $input.after($input.clone(true)).remove(); + this.$(".oe_fileupload").show(); + }, + on_file_change: function (event) { + event.stopPropagation(); + var self = this; + var $target = $(event.target); + if ($target.val() !== '') { + + var filename = $target.val().replace(/.*[\\\/]/,''); + + // if the files is currently uploded, don't send again + if( !isNaN(_.find(this.get('value'), function (file) { return (file.filename || file.name) == filename && file.upload; } )) ) { + return false; + } + + // block UI or not + if(this.node.attrs.blockui) { + instance.web.blockUI(); + } + + // if the files exits for this answer, delete the file before upload + var files = _.filter(this.get('value'), function (file) { + if((file.filename || file.name) == filename) { + self.ds_file.unlink([file.id]); + return false; + } else { + return true; + } + }); + + // TODO : unactivate send on wizard and form + + // submit file + this.$('form.oe_form_binary_form').submit(); + this.$(".oe_fileupload").hide(); + + // add file on result + files.push({ + 'id': 0, + 'name': filename, + 'filename': filename, + 'url': '', + 'upload': true + }); + + this.set({'value': files}); + } + }, + on_file_loaded: function (event, result) { + // unblock UI + if(this.node.attrs.blockui) { + instance.web.unblockUI(); + } + + // TODO : activate send on wizard and form + + var files = this.get('value'); + for(var i in files){ + if(files[i].filename == result.filename && files[i].upload) { + files[i] = { + 'id': result.id, + 'name': result.name, + 'filename': result.filename, + 'url': this.get_file_url(result) + }; + } + } + + this.set({'value': files}); + this.render_value() + }, + on_file_delete: function (event) { + event.stopPropagation(); + var file_id=$(event.target).data("id"); + if (file_id) { + var files=[]; + for(var i in this.get('value')){ + if(file_id != this.get('value')[i].id){ + files.push(this.get('value')[i]); + } + else { + this.ds_file.unlink([file_id]); + } + } + this.set({'value': files}); + } + }, +}); + instance.web.form.FieldStatus = instance.web.form.AbstractField.extend({ template: "FieldStatus", init: function(field_manager, node) { @@ -4900,7 +5128,7 @@ instance.web.form.FieldStatus = instance.web.form.AbstractField.extend({ }, render_value: function() { var self = this; - self.get_selection().then(function() { + self.get_selection().done(function() { var content = QWeb.render("FieldStatus.content", {widget: self}); self.$el.html(content); var colors = JSON.parse((self.node.attrs || {}).statusbar_colors || "{}"); @@ -4924,7 +5152,7 @@ instance.web.form.FieldStatus = instance.web.form.AbstractField.extend({ domain = new instance.web.CompoundDomain(['|'], self.build_domain(), [['id', '=', self.get('value')]]); } var ds = new instance.web.DataSetSearch(this, this.field.relation, self.build_context(), domain); - return ds.read_slice(['name'], {}).pipe(function (records) { + return ds.read_slice(['name'], {}).then(function (records) { for(var i = 0; i < records.length; i++) { self.selection.push([records[i].id, records[i].name]); } @@ -4948,10 +5176,10 @@ instance.web.form.FieldStatus = instance.web.form.AbstractField.extend({ var $li = $(ev.currentTarget); var val = parseInt($li.data("id")); if (val != self.get('value')) { - this.view.recursive_save().then(function() { + this.view.recursive_save().done(function() { var change = {}; change[self.name] = val; - self.view.dataset.write(self.view.datarecord.id, change).then(function() { + self.view.dataset.write(self.view.datarecord.id, change).done(function() { self.view.reload(); }); }); @@ -4985,7 +5213,7 @@ instance.web.form.FieldMonetary = instance.web.form.FieldFloat.extend({ return; } return this.ci_dm.add(new instance.web.Model("res.currency").query(["symbol", "position"]) - .filter([["id", "=", self.get("currency")]]).first()).pipe(function(res) { + .filter([["id", "=", self.get("currency")]]).first()).then(function(res) { self.set({"currency_info": res}); }); }, @@ -5014,6 +5242,7 @@ instance.web.form.widgets = new instance.web.Registry({ 'datetime' : 'instance.web.form.FieldDatetime', 'selection' : 'instance.web.form.FieldSelection', 'many2one' : 'instance.web.form.FieldMany2One', + 'many2onebutton' : 'instance.web.form.Many2OneButton', 'many2many' : 'instance.web.form.FieldMany2Many', 'many2many_tags' : 'instance.web.form.FieldMany2ManyTags', 'many2many_kanban' : 'instance.web.form.FieldMany2ManyKanban', @@ -5027,6 +5256,7 @@ instance.web.form.widgets = new instance.web.Registry({ 'progressbar': 'instance.web.form.FieldProgressBar', 'image': 'instance.web.form.FieldBinaryImage', 'binary': 'instance.web.form.FieldBinaryFile', + 'one2many_binary': 'instance.web.form.FieldOne2ManyBinaryMultiFiles', 'statusbar': 'instance.web.form.FieldStatus', 'monetary': 'instance.web.form.FieldMonetary', }); diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index 5546105e901..f11a9a2e3ac 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -508,7 +508,7 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi _.pluck(_(this.columns).filter(function (r) { return r.tag === 'field'; }), 'name') - ).then(function (records) { + ).done(function (records) { _(records[0]).each(function (value, key) { 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.grouped = !!group_by; - return this.load_view(context).pipe( + return this.load_view(context).then( this.proxy('reload_content')); }, /** @@ -566,7 +566,7 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi return; } var self = this; - return $.when(this.dataset.unlink(ids)).then(function () { + return $.when(this.dataset.unlink(ids)).done(function () { _(ids).each(function (id) { self.records.remove(self.records.get(id)); }); @@ -970,13 +970,13 @@ instance.web.ListView.List = instance.web.Class.extend( /** @lends instance.web. // set) a human-readable version. m2o does not have this issue // because the non-human-readable is just a number, where the // human-readable version is a pair - if (value && (ref_match = /([\w\.]+),(\d+)/.exec(value))) { + if (value && (ref_match = /^([\w\.]+),(\d+)$/.exec(value))) { // reference values are in the shape "$model,$id" (as a // string), we need to split and name_get this pair in order // to get a correctly displayable value in the field var model = ref_match[1], 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; } 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 // row new instance.web.DataSet(this.view, column.relation) - .name_get([value]).then(function (names) { + .name_get([value]).done(function (names) { if (!names.length) { return; } record.set(column.id, names[0]); }); @@ -1015,7 +1015,7 @@ instance.web.ListView.List = instance.web.Class.extend( /** @lends instance.web. ids = value; } 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(', ')); }) } @@ -1100,7 +1100,6 @@ instance.web.ListView.List = instance.web.Class.extend( /** @lends instance.web. }, this); if (!this.$current) { return; } this.$current.remove(); - this.$current = null; }, get_records: function () { return this.records.map(function (record) { @@ -1307,9 +1306,11 @@ instance.web.ListView.Groups = instance.web.Class.extend( /** @lends instance.we process_modifiers: false }); } catch (e) { - group_label = row_data[group_column.id].value; + group_label = _.str.escapeHTML(row_data[group_column.id].value); } - $group_column.text(_.str.sprintf("%s (%d)", + // group_label is html-clean (through format or explicit + // escaping if format failed), can inject straight into HTML + $group_column.html(_.str.sprintf("%s (%d)", group_label, group.length)); if (group.length && group.openable) { @@ -1384,43 +1385,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 options = { offset: page * limit, limit: limit, context: {bin_size: true} }; //TODO xmo: investigate why we need to put the setTimeout - $.async_when().then(function() {dataset.read_slice(fields, options).then(function (records) { - // FIXME: ignominious hacks, parents (aka form view) should not send two ListView#reload_content concurrently - if (self.records.length) { - self.records.reset(null, {silent: true}); - } - if (!self.datagroup.openable) { - view.configure_pager(dataset); - } else { - if (dataset.size() == records.length) { - // only one page - self.$row.find('td.oe_list_group_pagination').empty(); + $.async_when().done(function() { + dataset.read_slice(fields, options).done(function (records) { + // FIXME: ignominious hacks, parents (aka form view) should not send two ListView#reload_content concurrently + if (self.records.length) { + self.records.reset(null, {silent: true}); + } + if (!self.datagroup.openable) { + view.configure_pager(dataset); } else { - var pages = Math.ceil(dataset.size() / limit); - self.$row - .find('.oe_list_pager_state') - .text(_.str.sprintf(_t("%(page)d/%(page_count)d"), { - page: page + 1, - page_count: pages - })) - .end() - .find('button[data-pager-action=previous]') - .css('visibility', - page === 0 ? 'hidden' : '') - .end() - .find('button[data-pager-action=next]') - .css('visibility', - page === pages - 1 ? 'hidden' : ''); + if (dataset.size() == records.length) { + // only one page + self.$row.find('td.oe_list_group_pagination').empty(); + } else { + var pages = Math.ceil(dataset.size() / limit); + self.$row + .find('.oe_list_pager_state') + .text(_.str.sprintf(_t("%(page)d/%(page_count)d"), { + page: page + 1, + page_count: pages + })) + .end() + .find('button[data-pager-action=previous]') + .css('visibility', + page === 0 ? 'hidden' : '') + .end() + .find('button[data-pager-action=next]') + .css('visibility', + page === pages - 1 ? 'hidden' : ''); + } } - } - self.records.add(records, {silent: true}); - list.render(); - d.resolve(list); - if (_.isEmpty(records)) { - view.no_result(); - } - });}); + self.records.add(records, {silent: true}); + list.render(); + d.resolve(list); + if (_.isEmpty(records)) { + view.no_result(); + } + }); + }); return d.promise(); }, setup_resequence_rows: function (list, dataset) { @@ -1476,7 +1479,7 @@ instance.web.ListView.Groups = instance.web.Class.extend( /** @lends instance.we // Accounting > Taxes > Taxes, child tax accounts) // when synchronous (without setTimeout) (function (dataset, id, seq) { - $.async_when().then(function () { + $.async_when().done(function () { var attrs = {}; attrs[seqname] = seq; dataset.write(id, attrs); @@ -1501,7 +1504,7 @@ instance.web.ListView.Groups = instance.web.Class.extend( /** @lends instance.we self.render_groups(groups)); if (post_render) { post_render(); } }, function (dataset) { - self.render_dataset(dataset).then(function (list) { + self.render_dataset(dataset).done(function (list) { self.children[null] = list; self.elements = [list.$current.replaceAll($el)[0]]; @@ -1561,7 +1564,7 @@ var DataGroup = instance.web.CallbackEnabled.extend({ list: function (fields, ifGroups, ifRecords) { var self = this; 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 if (!querygroups) { var ds = new instance.web.DataSetSearch(self, self.model.name, self.model.context(), self.model.domain()); @@ -2011,6 +2014,7 @@ instance.web.list.columns = new instance.web.Registry({ 'field.progressbar': 'instance.web.list.ProgressBar', 'field.handle': 'instance.web.list.Handle', 'button': 'instance.web.list.Button', + 'field.many2onebutton': 'instance.web.list.Many2OneButton', }); instance.web.list.columns.for_ = function (id, field, node) { var description = _.extend({tag: node.tag}, field, node.attrs); @@ -2198,5 +2202,11 @@ instance.web.list.Handle = instance.web.list.Column.extend({ return '<div class="oe_list_handle">'; } }); +instance.web.list.Many2OneButton = instance.web.list.Column.extend({ + _format: function (row_data, options) { + this.has_value = !!row_data[this.id].value; + return QWeb.render('Many2OneButton.cell', {'widget': this}); + }, +}); }; // vim:et fdc=0 fdl=0 foldnestmax=3 fdm=syntax: diff --git a/addons/web/static/src/js/view_list_editable.js b/addons/web/static/src/js/view_list_editable.js index acc1d781976..3711bba16c1 100644 --- a/addons/web/static/src/js/view_list_editable.js +++ b/addons/web/static/src/js/view_list_editable.js @@ -12,6 +12,8 @@ openerp.web.list_editable = function (instance) { var self = this; this._super.apply(this, arguments); + this.saving_mutex = new $.Mutex(); + this._force_editability = null; this._context_editable = false; this.editor = this.make_editor(); @@ -127,7 +129,7 @@ openerp.web.list_editable = function (instance) { // restartable this.editor = this.make_editor(); var editor_ready = this.editor.prependTo(this.$el) - .then(this.proxy('setup_events')); + .done(this.proxy('setup_events')); return $.when(result, editor_ready); } else { @@ -146,7 +148,7 @@ openerp.web.list_editable = function (instance) { }, do_button_action: function (name, id, callback) { var self = this, args = arguments; - this.ensure_saved().then(function (done) { + this.ensure_saved().done(function (done) { if (!id && done.created) { id = done.record.get('id'); } @@ -162,10 +164,13 @@ openerp.web.list_editable = function (instance) { * @returns {$.Deferred} */ ensure_saved: function () { - if (!this.editor.is_editing()) { - return $.when(); - } - return this.save_edition(); + var self = this; + return this.saving_mutex.exec(function() { + if (!self.editor.is_editing()) { + return $.when(); + } + return self.save_edition(); + }); }, /** * 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}); } - return this.ensure_saved().pipe(function () { + return this.ensure_saved().then(function () { var $recordRow = self.groups.get_row_for(record); var cells = self.get_cells_for($recordRow); 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 field.$el.attr('data-fieldname', field_name); self.fields_for_resize.push({field: field, cell: cell}); - }, options).pipe(function () { + }, options).then(function () { $recordRow.addClass('oe_edition'); self.resize_fields(); return record.attributes; @@ -252,9 +257,10 @@ openerp.web.list_editable = function (instance) { var position = $cell.position(); field.set_dimensions($cell.outerHeight(), $cell.outerWidth()); - field.$el.css({ - top: position.top, - left: position.left, + field.$el.position({ + my: 'left top', + at: 'left top', + of: $cell }); }, /** @@ -267,7 +273,7 @@ openerp.web.list_editable = function (instance) { form: this.editor.form, cancel: false }, function () { - return this.editor.save().pipe(function (attrs) { + return this.editor.save().then(function (attrs) { var created = false; var record = self.records.get(attrs.id); if (!record) { @@ -281,9 +287,9 @@ openerp.web.list_editable = function (instance) { // record which has *just* been saved, so first perform all // onwrites then do a final reload of the record return self.handle_onwrite(record) - .pipe(function () { + .then(function () { return self.reload_record(record); }) - .pipe(function () { + .then(function () { return { created: created, record: record }; }); }); }); @@ -299,7 +305,7 @@ openerp.web.list_editable = function (instance) { form: this.editor.form, cancel: false }, function () { - return this.editor.cancel(force).pipe(function (attrs) { + return this.editor.cancel(force).then(function (attrs) { if (attrs.id) { var record = self.records.get(attrs.id); if (!record) { @@ -343,7 +349,7 @@ openerp.web.list_editable = function (instance) { message: _.str.sprintf("Event %s:before cancelled", event_name)}); } - return $.when(action.call(this)).then(function () { + return $.when(action.call(this)).done(function () { self.trigger.apply(self, [event_name + ':after'] .concat(_.toArray(arguments))); }); @@ -373,7 +379,7 @@ openerp.web.list_editable = function (instance) { var on_write_callback = self.fields_view.arch.attrs.on_write; if (!on_write_callback) { return $.when(); } return this.dataset.call(on_write_callback, [source_record.get('id')]) - .pipe(function (ids) { + .then(function (ids) { return $.when.apply( null, _(ids).map( _.bind(self.handle_onwrite_record, self, source_record))); @@ -410,15 +416,15 @@ openerp.web.list_editable = function (instance) { }); this.editor.$el.on('keyup keydown', function (e) { - if (!self.editor.is_editing()) { return; } + if (!self.editor.is_editing()) { return true; } var key = _($.ui.keyCode).chain() .map(function (v, k) { return {name: k, code: v}; }) .find(function (o) { return o.code === e.which; }) .value(); - if (!key) { return; } + if (!key) { return true; } var method = e.type + '_' + key.name; - if (!(method in self)) { return; } - self[method](e); + if (!(method in self)) { return true; } + return self[method](e); }); }, /** @@ -434,7 +440,7 @@ openerp.web.list_editable = function (instance) { _next: function (next_record, options) { next_record = next_record || 'succ'; var self = this; - return this.save_edition().pipe(function (saveInfo) { + return this.save_edition().then(function (saveInfo) { if (saveInfo.created) { return self.start_edition(); } @@ -446,7 +452,10 @@ openerp.web.list_editable = function (instance) { keyup_ENTER: function () { return this._next(); }, - keyup_ESCAPE: function () { + keydown_ESCAPE: function (e) { + return false; + }, + keyup_ESCAPE: function (e) { return this.cancel_edition(); }, /** @@ -638,7 +647,7 @@ openerp.web.list_editable = function (instance) { var _super = this._super(); this.form.embedded_view = this._validate_view( 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')); return $.when(_super, form_ready); }, @@ -719,9 +728,9 @@ openerp.web.list_editable = function (instance) { var loaded = record ? form.trigger('load_record', _.extend({}, record)) : form.load_defaults(); - return $.when(loaded).pipe(function () { + return $.when(loaded).then(function () { return form.do_show({reload: false}); - }).pipe(function () { + }).then(function () { self.record = form.datarecord; _(form.fields).each(function (field, name) { configureField(name, field); @@ -734,7 +743,7 @@ openerp.web.list_editable = function (instance) { var self = this; return this.form .save(this.delegate.prepends_on_create()) - .pipe(function (result) { + .then(function (result) { var created = result.created && !self.record.id; if (created) { self.record.id = result.result; diff --git a/addons/web/static/src/js/view_tree.js b/addons/web/static/src/js/view_tree.js index 05760420ba8..8265be77ba1 100644 --- a/addons/web/static/src/js/view_tree.js +++ b/addons/web/static/src/js/view_tree.js @@ -45,7 +45,7 @@ instance.web.TreeView = instance.web.View.extend(/** @lends instance.web.TreeVie view_type: "tree", toolbar: this.view_manager ? !!this.view_manager.sidebar : false, context: this.dataset.get_context() - }).then(this.on_loaded); + }).done(this.on_loaded); }, /** * Returns the list of fields needed to correctly read objects. @@ -63,12 +63,6 @@ instance.web.TreeView = instance.web.View.extend(/** @lends instance.web.TreeVie } return fields; }, - store_record:function(records){ - var self = this; - _(records).each(function (record) { - self.records[record.id] = record; - }); - }, on_loaded: function (fields_view) { var self = this; var has_toolbar = !!fields_view.arch.attrs.toolbar; @@ -92,20 +86,18 @@ instance.web.TreeView = instance.web.View.extend(/** @lends instance.web.TreeVie })); this.$el.addClass(this.fields_view.arch.attrs['class']); - this.dataset.read_slice(this.fields_list()).then(function(records) { - self.store_record(records); + this.dataset.read_slice(this.fields_list()).done(function(records) { if (!has_toolbar) { // WARNING: will do a second read on the same ids, but only on // first load so not very important - self.render_data({'null':records}) - self.getdata(_.pluck(records,"id")); + self.getdata(null, _(records).pluck('id')); return; } var $select = self.$el.find('select') .change(function () { var $option = $(this).find(':selected'); - self.getdata($option.val()); + self.getdata($option.val(), $option.data('children')); }); _(records).each(function (record) { self.records[record.id] = record; @@ -120,12 +112,7 @@ instance.web.TreeView = instance.web.View.extend(/** @lends instance.web.TreeVie $select.change(); } }); - this.$el.find("#tree_view_expand").click(function(){ - self.expand_all(); - }); - this.$el.find("#tree_view_collapse").click(function(){ - self.collpase_all(); - }); + // TODO store open nodes in url ?... this.do_push_state({}); @@ -141,22 +128,6 @@ instance.web.TreeView = instance.web.View.extend(/** @lends instance.web.TreeVie return [color, py.parse(py.tokenize(expr)), expr]; }).value(); }, - expand_all: function(){ - var self = this; - var tr = this.$el.find(".oe-treeview-table tbody tr[id^='treerow_']"); - _.each(tr,function(rec){ - self.showcontent($(rec).attr('data-id'),true); - }); - }, - collpase_all: function(){ - var self = this; - var root_tr = this.$el.find(".oe-treeview-table tbody tr[data-level='"+1+"']"); - _.each(root_tr,function(rec){ - if($(rec).hasClass('oe_open')){ - self.showcontent($(rec).attr('data-id'),false); - } - }); - }, /** * Returns the color for the provided record in the current view (from the * ``@colors`` attribute) @@ -193,44 +164,50 @@ instance.web.TreeView = instance.web.View.extend(/** @lends instance.web.TreeVie }); this.$el.delegate('.treeview-tr', 'click', function () { - var $this = $(this), + var is_loaded = 0, + $this = $(this), record_id = $this.data('id'), - bool = $this.parent().hasClass('oe_open'); - self.showcontent(record_id, !bool); + record = self.records[record_id], + children_ids = record[self.children_field]; + + _(children_ids).each(function(childid) { + if (self.$el.find('#treerow_' + childid).length) { + if (self.$el.find('#treerow_' + childid).is(':hidden')) { + is_loaded = -1; + } else { + is_loaded++; + } + } + }); + if (is_loaded === 0) { + if (!$this.parent().hasClass('oe_open')) { + self.getdata(record_id, children_ids); + } + } else { + self.showcontent(record_id, is_loaded < 0); + } }); }, // get child data of selected value - getdata: function (id) { + getdata: function (id, children_ids) { var self = this; - var parent_child ={}; - id = _.isArray(id)?id:parseInt(id); - var ir_model_data = new instance.web.Model(this.model,self.dataset.get_context() || {},[['id','child_of',id]]).query(); - ir_model_data._execute().then(function(records){ - self.store_record(records); - _.each(records,function(rec){ - if(rec[self.children_field].length === 0)return; - parent_child[rec.id] = []; - _.each(rec[self.children_field],function(key){ - parent_child[rec.id].push(self.records[key]); - }); - }) - self.render_data(parent_child); - }); - }, - render_data: function(groupby){ - var self = this; - _.each(_.keys(groupby),function(key){ - var $curr_node = self.$el.find('#treerow_' + key); - var record = groupby[key]; + + self.dataset.read_ids(children_ids, this.fields_list()).done(function(records) { + _(records).each(function (record) { + self.records[record.id] = record; + }); + + var $curr_node = self.$el.find('#treerow_' + id); var children_rows = QWeb.render('TreeView.rows', { - 'records': record, + 'records': records, 'children_field': self.children_field, 'fields_view': self.fields_view.arch.children, 'fields': self.fields, - 'level': ($curr_node.data('level') || 0) + 1, + 'level': $curr_node.data('level') || 0, 'render': instance.web.format_value, 'color_for': self.color_for }); + if ($curr_node.length) { $curr_node.addClass('oe_open'); $curr_node.after(children_rows); @@ -238,10 +215,8 @@ instance.web.TreeView = instance.web.View.extend(/** @lends instance.web.TreeVie self.$el.find('tbody').html(children_rows); } }); - self.collpase_all(); }, - // Get details in listview activate: function(id) { var self = this; @@ -254,7 +229,7 @@ instance.web.TreeView = instance.web.View.extend(/** @lends instance.web.TreeVie model: this.dataset.model, context: new instance.web.CompoundContext( this.dataset.get_context(), local_context) - }).pipe(function (actions) { + }).then(function (actions) { if (!actions.length) { return; } var action = actions[0][2]; var c = new instance.web.CompoundContext(local_context); @@ -263,7 +238,7 @@ instance.web.TreeView = instance.web.View.extend(/** @lends instance.web.TreeVie } return self.rpc('/web/session/eval_domain_and_context', { contexts: [c], domains: [] - }).pipe(function (res) { + }).then(function (res) { action.context = res.context; return self.do_action(action); }, null); @@ -284,5 +259,13 @@ instance.web.TreeView = instance.web.View.extend(/** @lends instance.web.TreeVie }, this); }, + do_show: function () { + this.$el.show(); + }, + + do_hide: function () { + this.$el.hide(); + this.hidden = true; + } }); }; diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index ebc7c326724..2f35ccf89b8 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -208,7 +208,7 @@ instance.web.ActionManager = instance.web.Widget.extend({ if (run_action) { this.null_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); }); } @@ -226,14 +226,14 @@ instance.web.ActionManager = instance.web.Widget.extend({ } else if (state.sa) { // load session 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) { 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) { self.inner_widget.do_load_state(state, warm); } @@ -247,11 +247,11 @@ instance.web.ActionManager = instance.web.Widget.extend({ action_menu_id: null, }); if (_.isString(action) && instance.web.client_actions.contains(action)) { - var action_client = { type: "ir.actions.client", tag: action }; + var action_client = { type: "ir.actions.client", tag: action, params: {} }; return this.do_action(action_client, options); } else if (_.isNumber(action) || _.isString(action)) { 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); }); } @@ -346,14 +346,14 @@ instance.web.ActionManager = instance.web.Widget.extend({ if (!(ClientWidget.prototype instanceof instance.web.Widget)) { var next; - if (next = ClientWidget(this, action.params)) { + if (next = ClientWidget(this, action)) { return this.do_action(next, options); } return $.when(); } return this.ir_actions_common({ - widget: function () { return new ClientWidget(self, action.params); }, + widget: function () { return new ClientWidget(self, action); }, action: action, klass: 'oe_act_client', post_process: function(widget) { @@ -379,7 +379,7 @@ instance.web.ActionManager = instance.web.Widget.extend({ this.rpc('/web/action/run', { action_id: action.id, context: action.context || {} - }).then(function (action) { + }).done(function (action) { self.do_action(action, options) }); }, @@ -389,7 +389,7 @@ instance.web.ActionManager = instance.web.Widget.extend({ self.rpc("/web/session/eval_domain_and_context", { contexts: [action.context], domains: [] - }).then(function(res) { + }).done(function(res) { action = _.clone(action); action.context = res.context; self.session.get_file({ @@ -487,7 +487,7 @@ instance.web.ViewManager = instance.web.Widget.extend({ } else if (this.searchview && self.flags.auto_search && view.controller.searchable !== false) { - this.searchview.ready.then(this.searchview.do_search); + this.searchview.ready.done(this.searchview.do_search); } if (this.searchview) { @@ -499,7 +499,7 @@ instance.web.ViewManager = instance.web.Widget.extend({ .find('.oe_view_manager_switch a').filter('[data-view-type="' + view_type + '"]') .parent().addClass('active'); - r = $.when(view_promise).then(function () { + r = $.when(view_promise).done(function () { _.each(_.keys(self.views), function(view_name) { var controller = self.views[view_name].controller; if (controller) { @@ -551,11 +551,11 @@ instance.web.ViewManager = instance.web.Widget.extend({ var view_promise = controller.appendTo(container); this.views[view_type].controller = controller; this.views[view_type].deferred.resolve(view_type); - return $.when(view_promise).then(function() { + return $.when(view_promise).done(function() { if (self.searchview && self.flags.auto_search && 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); }); @@ -582,7 +582,7 @@ instance.web.ViewManager = instance.web.Widget.extend({ var view_to_select = views[index]; var state = self.url_states[view_to_select]; 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(); }); }, @@ -661,7 +661,7 @@ instance.web.ViewManager = instance.web.Widget.extend({ domains: [this.action.domain || []].concat(domains || []), contexts: [action_context].concat(contexts || []), group_by_seq: groupbys || [] - }).then(function (results) { + }).done(function (results) { self.dataset._model = new instance.web.Model( self.dataset.model, results.context, results.domain); var groupby = results.group_by.length @@ -786,7 +786,7 @@ instance.web.ViewManagerAction = instance.web.ViewManager.extend({ case 'perm_read': var ids = current_view.get_selected_ids(); 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, { title: _.str.sprintf(_t("View Log (%s)"), self.dataset.model), width: 400 @@ -812,7 +812,7 @@ instance.web.ViewManagerAction = instance.web.ViewManager.extend({ }); break; case 'fields': - this.dataset.call('fields_get', [false, {}]).then(function (fields) { + this.dataset.call('fields_get', [false, {}]).done(function (fields) { var $root = $('<dl>'); _(fields).each(function (attributes, name) { $root.append($('<dt>').append($('<h4>').text(name))); @@ -899,7 +899,7 @@ instance.web.ViewManagerAction = instance.web.ViewManager.extend({ switch_mode: function (view_type, no_store, options) { 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; self.$el.find('.oe_debug_view').html(QWeb.render('ViewManagerDebug', { view: controller, @@ -938,13 +938,13 @@ instance.web.ViewManagerAction = instance.web.ViewManager.extend({ defs = []; if (state.view_type && state.view_type !== this.active_view) { 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); }) ); } - $.when(defs).then(function() { + $.when(defs).done(function() { self.views[self.active_view].controller.do_load_state(state, warm); }); }, @@ -1051,7 +1051,7 @@ instance.web.Sidebar = instance.web.Widget.extend({ }, on_item_action_clicked: function(item) { var self = this; - self.getParent().sidebar_context().then(function (context) { + self.getParent().sidebar_context().done(function (context) { var ids = self.getParent().get_selected_ids(); if (ids.length == 0) { instance.web.dialog($("<div />").text(_t("You must choose at least one record.")), { title: _t("Warning"), modal: true }); @@ -1065,7 +1065,7 @@ instance.web.Sidebar = instance.web.Widget.extend({ self.rpc("/web/action/load", { action_id: item.action.id, context: additional_context - }).then(function(result) { + }).done(function(result) { result.context = _.extend(result.context || {}, additional_context); result.flags = result.flags || {}; @@ -1087,7 +1087,7 @@ instance.web.Sidebar = instance.web.Widget.extend({ } else { 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); - 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) { @@ -1122,7 +1122,7 @@ instance.web.Sidebar = instance.web.Widget.extend({ var self = this; var $e = $(e.currentTarget); 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); }); } @@ -1150,7 +1150,7 @@ instance.web.View = instance.web.Widget.extend({ var view_loaded; if (this.embedded_view) { view_loaded = $.Deferred(); - $.async_when().then(function() { + $.async_when().done(function() { view_loaded.resolve(self.embedded_view); }); } else { @@ -1164,7 +1164,7 @@ instance.web.View = instance.web.Widget.extend({ context: this.dataset.get_context(context) }); } - return view_loaded.pipe(function(r) { + return view_loaded.then(function(r) { self.trigger('view_loaded', r); // add css classes that reflect the (absence of) access rights self.$el.addClass('oe_view') @@ -1220,7 +1220,7 @@ instance.web.View = instance.web.Widget.extend({ return self.rpc('/web/session/eval_domain_and_context', { contexts: [ncontext], domains: [] - }).pipe(function (results) { + }).then(function (results) { action.context = results.context; /* niv: previously we were overriding once more with action_data.context, * I assumed this was not a correct behavior and removed it @@ -1249,11 +1249,11 @@ instance.web.View = instance.web.Widget.extend({ } } 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") { - 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 { - return dataset.exec_workflow(record_id, action_data.name).then(handler); + return dataset.exec_workflow(record_id, action_data.name).done(handler); } }, /** diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 9880abd20f7..215374cb6fb 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -567,16 +567,14 @@ </t> <t t-name="TreeView"> - <div class = "tree_header"> - <select t-if="toolbar" ></select> - <button id = "tree_view_collapse">Collapse All</button> - <button id = "tree_view_expand">Expand All</button> - </div> - <table class="oe-treeview-table"> + <select t-if="toolbar" style="width: 30%"> + </select> + <table class="oe_tree_table oe-treeview-table"> <thead> <tr> <th t-foreach="fields_view" t-as="field" - t-if="!field.attrs.modifiers.tree_invisible"> + t-if="!field.attrs.modifiers.tree_invisible" + class="treeview-header"> <t t-esc="field_value.attrs.string || fields[field.attrs.name].string" /> </th> </tr> @@ -588,11 +586,11 @@ <tr t-name="TreeView.rows" t-foreach="records" t-as="record" t-att-id="'treerow_' + record.id" - t-att-data-id="record.id" t-att-data-level="level"> + t-att-data-id="record.id" t-att-data-level="level + 1"> <t t-set="children" t-value="record[children_field]"/> <t t-set="class" t-value="children and children.length ? 'treeview-tr' : 'treeview-td'"/> <t t-set="rank" t-value="'oe-treeview-first'"/> - <t t-set="style" t-value="'background-position: ' + 19*(level-1) + 'px; padding-left: ' + (4 + 19*(level-1)) + 'px;'"/> + <t t-set="style" t-value="'background-position: ' + 19*(level) + 'px; padding-left: ' + (4 + 19*(level)) + 'px;'"/> <td t-foreach="fields_view" t-as="field" t-if="!field.attrs.modifiers.tree_invisible" @@ -1029,6 +1027,13 @@ </t> </span> </t> +<t t-name="Many2OneButton"> + <span class="oe_form_field"> + </span> +</t> +<t t-name="Many2OneButton.cell" + ><img t-attf-src="#{_s}/web/static/src/img/icons/gtk-#{widget.has_value ? 'yes' : 'no'}.png" width="16" height="16"/> +</t> <t t-name="FieldMany2ManyTags"> <div class="oe_form_field oe_tags" t-att-style="widget.node.attrs.style"> <t t-if="! widget.get('effective_readonly')"> @@ -1169,11 +1174,54 @@ <input type="hidden" name="session_id" value=""/> <input type="hidden" name="callback" t-att-value="fileupload_id"/> <t t-raw="__content__"/> - <input type="file" class="oe_form_binary_file" name="ufile"/> + <input type="file" class="oe_form_binary_file" name="ufile" t-if="widget.widget!='image'"/> + <input type="file" class="oe_form_binary_file" name="ufile" accept="image/*" t-if="widget.widget=='image'"/> </form> <iframe t-att-id="fileupload_id" t-att-name="fileupload_id" style="display: none"/> </div> </t> +<t t-name="FieldBinaryFileUploader.files"> + <div class="oe_attachments"> + <t t-if="!widget.get('effective_readonly')" t-foreach="widget.get('value')" t-as="file"> + <div class="oe_attachment"> + <span t-if="(file.upload or file.percent_loaded<100)" t-attf-title="{(file.name || file.filename) + (file.date?' \n('+file.date+')':'' )}" t-attf-name="{file.name || file.filename}"> + <span class="oe_fileuploader_in_process">...Upload in progress...</span> + <t t-raw="file.name || file.filename"/> + </span> + <a t-if="(!file.upload or file.percent_loaded>=100)" t-att-href="file.url" t-attf-title="{(file.name || file.filename) + (file.date?' \n('+file.date+')':'' )}"> + <t t-raw="file.name || file.filename"/> + </a> + <t t-if="(!file.upload or file.percent_loaded>=100)"> + <a class="oe_right oe_delete oe_e" title="Delete this file" t-attf-data-id="{file.id}">[</a> + </t> + </div> + </t> + <t t-if="widget.get('effective_readonly')" t-foreach="widget.get('value')" t-as="file"> + <div> + <a t-att-href="file.url" t-attf-title="{(file.name || file.filename) + (file.date?' \n('+file.date+')':'' )}"> + <t t-raw="file.name || file.filename"/> + </a> + </div> + </t> + </div> +</t> +<t t-name="FieldBinaryFileUploader"> + <div t-att-style="widget.node.attrs.style" t-attf-class="oe_fileupload #{widget.node.attrs.class ? widget.node.attrs.class :''}"> + <div class="oe_placeholder_files"/> + <div class="oe_add" t-if="!widget.get('effective_readonly')"> + <!-- uploader of file --> + <button class="oe_attach"><span class="oe_e">'</span></button> + <span class='oe_attach_label'>File</span> + <t t-call="HiddenInputFile"> + <t t-set="fileupload_id" t-value="widget.fileupload_id"/> + <t t-set="fileupload_action">/web/binary/upload_attachment</t> + <input type="hidden" name="model" t-att-value="widget.view.model"/> + <input type="hidden" name="id" value="0"/> + <input type="hidden" name="session_id" t-att-value="widget.session.session_id"/> + </t> + </div> + </div> +</t> <t t-name="WidgetButton"> <button type="button" class="oe_button oe_form_button" t-att-style="widget.node.attrs.style" diff --git a/addons/web/static/test/fulltest/dataset.js b/addons/web/static/test/fulltest/dataset.js index f7e64fba53e..cc2d1b47d63 100644 --- a/addons/web/static/test/fulltest/dataset.js +++ b/addons/web/static/test/fulltest/dataset.js @@ -82,7 +82,7 @@ $(document).ready(function () { }); t.test('call', function (openerp) { 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.args.length, 3); @@ -91,7 +91,7 @@ $(document).ready(function () { 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'); t.expect(ds.name_get([1, 2], null), function (r) { strictEqual(r.method, 'name_get'); diff --git a/addons/web/static/test/list-editable.js b/addons/web/static/test/list-editable.js index 0388e56048d..459a6df397a 100644 --- a/addons/web/static/test/list-editable.js +++ b/addons/web/static/test/list-editable.js @@ -107,12 +107,12 @@ $(document).ready(function () { }); var counter = 0; e.appendTo($fix) - .pipe(function () { + .then(function () { return e.edit({}, function () { ++counter; }); }) - .pipe(function (form) { + .then(function (form) { ok(e.is_editing(), "should be editing"); equal(counter, 3, "should have configured all fields"); return e.save(); @@ -137,12 +137,12 @@ $(document).ready(function () { }); var counter = 0; e.appendTo($fix) - .pipe(function () { + .then(function () { return e.edit({}, function () { ++counter; }); }) - .pipe(function (form) { + .then(function (form) { return e.cancel(); }) .always(start) @@ -170,12 +170,12 @@ $(document).ready(function () { var counter = 0; var warnings = 0; e.appendTo($fix) - .pipe(function () { + .then(function () { return e.edit({}, function () { ++counter; }); }) - .pipe(function (form) { + .then(function (form) { return e.save(); }) .always(start) @@ -243,16 +243,16 @@ $(document).ready(function () { var l = new instance.web.ListView({}, ds, false, {editable: 'top'}); l.appendTo($fix) - .pipe(l.proxy('reload_content')) - .pipe(function () { + .then(l.proxy('reload_content')) + .then(function () { return l.start_edition(); }) .always(start) - .pipe(function () { + .then(function () { ok(got_defaults, "should have fetched default values for form"); return l.save_edition(); }) - .pipe(function (result) { + .then(function (result) { ok(result.created, "should yield newly created record"); equal(result.record.get('a'), "qux", "should have used default values"); @@ -307,14 +307,14 @@ $(document).ready(function () { var l = new instance.web.ListView({}, ds, false, {editable: 'top'}); l.on('edit:before edit:after', o, o.onEvent); l.appendTo($fix) - .pipe(l.proxy('reload_content')) + .then(l.proxy('reload_content')) .always(start) - .pipe(function () { + .then(function () { ok(l.options.editable, "should be editable"); equal(o.counter, 0, "should have seen no event yet"); return l.start_edition(l.records.get(1)); }) - .pipe(function () { + .then(function () { ok(l.editor.is_editing(), "should be editing"); equal(o.counter, 2, "should have seen two edition events"); }) @@ -332,14 +332,14 @@ $(document).ready(function () { edit_after = true; }); l.appendTo($fix) - .pipe(l.proxy('reload_content')) + .then(l.proxy('reload_content')) .always(start) - .pipe(function () { + .then(function () { ok(l.options.editable, "should be editable"); return l.start_edition(); }) // cancelling an event rejects the deferred - .pipe($.Deferred().reject(), function () { + .then($.Deferred().reject(), function () { ok(!l.editor.is_editing(), "should not be editing"); ok(!edit_after, "should not have fired the edit:after event"); return $.when(); diff --git a/addons/web/static/test/rpc.js b/addons/web/static/test/rpc.js index fbe7147f2e6..be7cbce9f41 100644 --- a/addons/web/static/test/rpc.js +++ b/addons/web/static/test/rpc.js @@ -29,10 +29,10 @@ $(document).ready(function () { fail1 = false, fail2 = false; var d1 = $.Deferred(), d2 = $.Deferred(); - dm.add(d1).then(function () { done1 = true; }, - function () { fail1 = true; }); - dm.add(d2).then(function () { done2 = true; }, - function () { fail2 = true; }); + dm.add(d1).done(function () { done1 = true; }) + .fail(function () { fail1 = true; }); + dm.add(d2).done(function () { done2 = true; }) + .fail(function () { fail2 = true; }); d2.resolve(); d1.resolve(); @@ -50,10 +50,10 @@ $(document).ready(function () { fail1 = false, fail2 = false; var d1 = $.Deferred(), d2 = $.Deferred(); - dm.add(d1).then(function () { done1 = true; }, - function () { fail1 = true; }); - dm.add(d2).then(function () { done2 = true; }, - function () { fail2 = true; }); + dm.add(d1).done(function () { done1 = true; }) + .fail(function () { fail1 = true; }); + dm.add(d2).done(function () { done2 = true; }) + .fail(function () { fail2 = true; }); d2.resolve(); d1.resolve(); @@ -86,10 +86,10 @@ $(document).ready(function () { fail1 = false, fail2 = false; var d1 = $.Deferred(), d2 = $.Deferred(); - dm.add(d1).then(function () { done1 = true; }, - function () { fail1 = true; }); - dm.add(d2).then(function () { done2 = true; }, - function () { fail2 = true; }); + dm.add(d1).done(function () { done1 = true; }) + .fail(function () { fail1 = true; }); + dm.add(d2).done(function () { done2 = true; }) + .fail(function () { fail2 = true; }); setTimeout(function () { d1.resolve(); }, 200); setTimeout(function () { d2.resolve(); }, 100); @@ -110,10 +110,10 @@ $(document).ready(function () { fail1 = false, fail2 = false; var d1 = $.Deferred(), d2 = $.Deferred(); - dm.add(d1).then(function () { done1 = true; }, - function () { fail1 = true; }); - dm.add(d2).then(function () { done2 = true; }, - function () { fail2 = true; }); + dm.add(d1).done(function () { done1 = true; }) + .fail(function () { fail1 = true; }); + dm.add(d2).done(function () { done2 = true; }) + .fail(function () { fail2 = true; }); setTimeout(function () { d1.resolve(); }, 200); setTimeout(function () { d2.resolve(); }, 100); diff --git a/addons/web/static/test/test.html b/addons/web/static/test/test.html index 209723af5a0..185125659cc 100644 --- a/addons/web/static/test/test.html +++ b/addons/web/static/test/test.html @@ -13,8 +13,8 @@ <script src="/web/static/lib/backbone/backbone.js" type="text/javascript"></script> <!-- jquery --> - <script src="/web/static/lib/jquery/jquery-1.7.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/jquery-1.8.2.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/datejs/globalization/en-US.js"></script> diff --git a/addons/web_calendar/__openerp__.py b/addons/web_calendar/__openerp__.py index 86b971976f9..d4b348bd17f 100644 --- a/addons/web_calendar/__openerp__.py +++ b/addons/web_calendar/__openerp__.py @@ -9,12 +9,14 @@ OpenERP Web Calendar view. 'version': '2.0', 'depends': ['web'], 'js': [ - 'static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler_debug.js', - 'static/lib/dhtmlxScheduler/sources/ext/ext_minical.js', + 'static/lib/dhtmlxScheduler/sources/dhtmlxscheduler.js', + 'static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_minical.js', 'static/src/js/calendar.js' ], 'css': [ - 'static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_ext.css', + #'static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler.css', + #'static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler_dhx_terrace.css', + 'static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler_glossy.css', 'static/src/css/web_calendar.css' ], 'qweb' : [ diff --git a/addons/web_calendar/i18n/sl.po b/addons/web_calendar/i18n/sl.po index 61259d9bde8..550fafc22d4 100644 --- a/addons/web_calendar/i18n/sl.po +++ b/addons/web_calendar/i18n/sl.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: openerp-web\n" "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" "POT-Creation-Date: 2012-07-02 09:06+0200\n" -"PO-Revision-Date: 2012-01-30 17:43+0000\n" -"Last-Translator: ERP Basing <erp@basing.si>\n" +"PO-Revision-Date: 2012-11-01 18:19+0000\n" +"Last-Translator: Dusan Laznik <laznik@mentis.si>\n" "Language-Team: Slovenian <sl@li.org>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-10-21 05:03+0000\n" -"X-Generator: Launchpad (build 16165)\n" +"X-Launchpad-Export-Date: 2012-11-02 05:20+0000\n" +"X-Generator: Launchpad (build 16218)\n" #. openerp-web #: addons/web_calendar/static/src/js/calendar.js:11 @@ -25,114 +25,114 @@ msgstr "Koledar" #. openerp-web #: addons/web_calendar/static/src/js/calendar.js:70 msgid "Filter" -msgstr "" +msgstr "Filter:" #. openerp-web #: addons/web_calendar/static/src/js/calendar.js:144 msgid "Today" -msgstr "" +msgstr "Danes" #. openerp-web #: addons/web_calendar/static/src/js/calendar.js:145 msgid "Day" -msgstr "" +msgstr "Dan" #. openerp-web #: addons/web_calendar/static/src/js/calendar.js:146 msgid "Week" -msgstr "" +msgstr "Teden" #. openerp-web #: addons/web_calendar/static/src/js/calendar.js:147 msgid "Month" -msgstr "" +msgstr "Mesec" #. openerp-web #: addons/web_calendar/static/src/js/calendar.js:148 msgid "New event" -msgstr "" +msgstr "Nov dogodek" #. openerp-web #: addons/web_calendar/static/src/js/calendar.js:149 msgid "Save" -msgstr "" +msgstr "Shrani" #. openerp-web #: addons/web_calendar/static/src/js/calendar.js:150 msgid "Cancel" -msgstr "" +msgstr "Prekliči" #. openerp-web #: addons/web_calendar/static/src/js/calendar.js:151 msgid "Details" -msgstr "" +msgstr "Podrobnosti" #. openerp-web #: addons/web_calendar/static/src/js/calendar.js:152 msgid "Edit" -msgstr "" +msgstr "Uredi" #. openerp-web #: addons/web_calendar/static/src/js/calendar.js:153 msgid "Delete" -msgstr "" +msgstr "Izbriši" #. openerp-web #: addons/web_calendar/static/src/js/calendar.js:155 msgid "Event will be deleted permanently, are you sure?" -msgstr "" +msgstr "Dogodek bo trajno izbrisan. Ste prepričani?" #. openerp-web #: addons/web_calendar/static/src/js/calendar.js:156 #: addons/web_calendar/static/src/js/calendar.js:169 msgid "Description" -msgstr "" +msgstr "Opis" #. openerp-web #: addons/web_calendar/static/src/js/calendar.js:157 msgid "Time period" -msgstr "" +msgstr "Obdobje" #. openerp-web #: addons/web_calendar/static/src/js/calendar.js:158 msgid "Full day" -msgstr "" +msgstr "Cel dan" #. openerp-web #: addons/web_calendar/static/src/js/calendar.js:161 msgid "Do you want to edit the whole set of repeated events?" -msgstr "" +msgstr "Želite urediti celotno zbirko ponavljajočih dogodkov?" #. openerp-web #: addons/web_calendar/static/src/js/calendar.js:162 msgid "Repeat event" -msgstr "" +msgstr "Ponavljajoč dogodek" #. openerp-web #: addons/web_calendar/static/src/js/calendar.js:163 msgid "Disabled" -msgstr "" +msgstr "Onemogočeno" #. openerp-web #: addons/web_calendar/static/src/js/calendar.js:164 msgid "Enabled" -msgstr "" +msgstr "Omogočeno" #. openerp-web #: addons/web_calendar/static/src/js/calendar.js:167 #: addons/web_calendar/static/src/js/calendar.js:175 msgid "Agenda" -msgstr "" +msgstr "Dnevni red" #. openerp-web #: addons/web_calendar/static/src/js/calendar.js:168 msgid "Date" -msgstr "" +msgstr "Datum" #. openerp-web #: addons/web_calendar/static/src/js/calendar.js:172 msgid "Year" -msgstr "" +msgstr "Leto" #. openerp-web #: addons/web_calendar/static/src/xml/web_calendar.xml:5 diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler.css b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler.css index 6259fe59eba..2e4cae2bdbf 100644 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler.css +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler.css @@ -1,5 +1,5 @@ /* This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details +to use it in non-GPL project. Please contact sales@dhtmlx.com for details */ -.dhx_cal_container{background-color:#C2D5FC;font-family:Tahoma;font-size:8pt;position:relative;overflow:hidden;}.dhx_cal_container div{-moz-user-select:none;-moz-user-select:-moz-none;}.dhx_cal_navline{height:20px;position:absolute;z-index:3;width:750px;color:#2F3A48;}.dhx_cal_navline div{position:absolute;top:2px;white-space:nowrap;}.dhx_cal_navline .dhx_cal_date{font-weight:600;left:210px;}.dhx_cal_button .dhx_left_bg{width:1px;overflow:hidden;height:17px;z-index:20;top:0;}.dhx_cal_prev_button{background-image:url(imgs/buttons.png);background-position:0 0;width:29px;height:17px;left:50px;cursor:pointer;}.dhx_cal_next_button{background-image:url(imgs/buttons.png);background-position:-30px 0;width:29px;height:17px;left:80px;cursor:pointer;}.dhx_cal_today_button{background-image:url(imgs/buttons.png);background-position:-60px 0;width:75px;height:17px;left:112px;cursor:pointer;text-align:center;text-decoration:underline;}.dhx_cal_tab{width:59px;height:19px;text-align:center;text-decoration:underline;padding-top:2px;cursor:pointer;background-color:#D8E1EA;-webkit-border-top-left-radius:4px;-webkit-border-top-right-radius:4px;-moz-border-radius-topleft:4px;-moz-border-radius-topright:4px;border-top-left-radius:4px;border-top-right-radius:4px;}.dhx_cal_tab.active{text-decoration:none;cursor:default;font-weight:bold;border:1px dotted #586A7E;border-bottom:0;background-color:#C2D5FC;}.dhx_cal_header{position:absolute;left:10px;top:23px;width:750px;border-top:1px dotted #8894A3;border-right:1px dotted #8894A3;z-index:2;overflow:hidden;color:#2F3A48;}.dhx_cal_data{border-top:1px dotted #8894A3;position:absolute;top:44px;width:600px;overflow-y:auto;overflow-x:hidden;}.dhx_scale_bar{position:absolute;text-align:center;background-color:#C2D5FC;padding-top:3px;border-left:1px dotted #586A7E;}.dhx_scale_holder{position:absolute;border-right:1px dotted #586A7E;background-image:url(imgs/databg.png);}.dhx_scale_holder_now{position:absolute;border-right:1px dotted #586A7E;background-image:url(imgs/databg_now.png);}.dhx_scale_hour{height:41px;width:50px;border-bottom:1px dotted #8894A3;background-color:#C2D5FC;text-align:center;line-height:40px;color:#586A7E;overflow:hidden;}.dhx_month_head{background-color:#EBEFF4;color:#2F3A48;border-right:1px dotted #586A7E;height:18px;padding-right:5px;padding-top:3px;text-align:right;}.dhx_month_body{border-right:1px dotted #586A7E;border-bottom:1px dotted #586A7E;background-color:#FFF;}.dhx_now .dhx_month_body{background-color:#E2EDFF;}.dhx_after .dhx_month_body,.dhx_before .dhx_month_body{background-color:#ECECEC;}.dhx_after .dhx_month_head,.dhx_before .dhx_month_head{background-color:#E2E3E6;color:#94A6BB;}.dhx_now .dhx_month_head{background-color:#D1DEF4;font-weight:bold;}.dhx_cal_drag{position:absolute;z-index:9999;background-color:#FFE763;border:1px solid #B7A543;opacity:.5;filter:alpha(opacity=50);}.dhx_loading{position:absolute;width:128px;height:15px;background-image:url(imgs/loading.gif);z-index:9999;}.dhx_multi_day_icon,.dhx_multi_day{background-color:#E1E6FF;background-repeat:no-repeat;border-right:1px dotted #8894A3;}.dhx_multi_day{position:absolute;border-top:1px dotted #8894A3;}.dhx_multi_day_icon{background-image:url(imgs/clock_big.gif);}.dhx_multi_day_icon_small{background-image:url(imgs/clock_small.gif);}.dhx_multi_day_icon,.dhx_multi_day_icon_small{background-position:center center;background-color:#E1E6FF;background-repeat:no-repeat;border-bottom:1px dotted #8894A3;border-right:1px dotted #8894A3;}.dhtmlxLayoutPolyContainer_dhx_skyblue .dhx_cal_container{background-color:#d0e5ff;}.dhx_cal_event div{background-color:#FFE763;border:1px solid #B7A543;color:#887A2E;overflow:hidden;width:100%;font-family:Tahoma;font-size:8pt;}.dhx_move_denied .dhx_cal_event .dhx_header,.dhx_move_denied .dhx_cal_event .dhx_title{cursor:default;}.dhx_cal_event .dhx_header{height:1px;margin-left:1px;border-width:1px 1px 0 1px;cursor:pointer;}.dhx_cal_event .dhx_title{height:12px;border-width:0 1px 1px 1px;border-bottom-style:dotted;font-size:7pt;font-weight:bold;text-align:center;background-position:right;background-repeat:no-repeat;cursor:pointer;}.dhx_cal_event .dhx_body{border-width:0 1px 1px 1px;padding:5px;}.dhx_resize_denied .dhx_cal_event .dhx_footer{cursor:default;}.dhx_cal_event .dhx_footer{height:1px;margin-left:2px;border-width:0 1px 1px 1px;cursor:s-resize;}.dhx_cal_event_line{background-color:#FFE763;border:1px solid #B7A543;border-radius:3px;font-family:Tahoma;font-size:8pt;height:13px;padding-left:10px;color:#887A2E;cursor:pointer;overflow:hidden;}.dhx_cal_event_clear{font-family:Tahoma;font-size:8pt;height:13px;padding-left:2px;color:#887A2E;white-space:nowrap;overflow:hidden;cursor:pointer;}.dhx_in_move{background-color:#FFFF80;}div.dhx_cal_editor{background-color:#FFE763;border:1px solid #B7A543;border-top-style:dotted;z-index:999;position:absolute;overflow:hidden;}textarea.dhx_cal_editor{width:100%;height:100%;border:0 solid black;margin:none;padding:none;overflow:auto;}div.dhx_menu_head{background-image:url(imgs/controls.gif);background-position:0 -43px;width:10px;height:10px;margin-left:5px;margin-top:1px;border:none;cursor:default;}div.dhx_menu_icon{background-image:url(imgs/controls.gif);width:20px;height:20px;margin-left:-5px;margin-top:0;border:none;cursor:pointer;}div.icon_details{background-position:0 0;}div.icon_edit{background-position:-22px 0;}div.icon_save{background-position:-84px -1px;}div.icon_cancel{background-position:-62px 0;}div.icon_delete{background-position:-42px 0;}div.dhx_now_time{position:absolute;width:100%;border-bottom:2px dotted red;z-index:1;}div.dhx_time_block{position:absolute;width:100%;background:silver;opacity:.4;filter:alpha(opacity=40);z-index:1;}.dhx_unselectable,.dhx_unselectable div{-webkit-user-select:none;-moz-user-select:none;-moz-user-select:-moz-none;}.dhx_cal_light{background-color:#FFE763;border-radius:5px;font-family:Tahoma;font-size:8pt;border:1px solid #B7A64B;color:#887A2E;position:absolute;z-index:10001;width:580px;height:300px;box-shadow:5px 5px 5px #888;}.dhx_cal_light_wide{width:650px;}.dhx_mark{position:relative;top:3px;background-image:url('./imgs/controls.gif');background-position:0 -43px;padding-left:10px;}.dhx_ie6 .dhx_mark{background-position:6px -41px;}.dhx_cal_light select{font-family:Tahoma;font-size:8pt;color:#887A2E;padding:2px;margin:0;}.dhx_cal_ltitle{padding:2px 0 2px 5px;overflow:hidden;white-space:nowrap;}.dhx_cal_ltitle span{white-space:nowrap;}.dhx_cal_lsection{background-color:#DBCF8C;color:#FFF4B5;font-weight:bold;padding:5px 0 3px 10px;}.dhx_section_time{background-color:#DBCF8C;}.dhx_cal_lsection .dhx_fullday{float:right;margin-right:5px;color:#887A2E;font-size:12px;font-weight:normal;line-height:20px;vertical-align:top;cursor:pointer;}.dhx_cal_lsection{font-size:18px;font-family:Arial;}.dhx_cal_ltext{padding:2px 0 2px 10px;overflow:hidden;}.dhx_cal_ltext textarea{background-color:#FFF4B5;overflow:auto;border:none;color:#887A2E;height:100%;width:100%;outline:none!important;}.dhx_time{font-weight:bold;}.dhx_cal_light .dhx_title{padding-left:10px;}.dhx_cal_larea{border:1px solid #DCC43E;background-color:#FFF4B5;overflow:hidden;margin-left:3px;width:572px;height:1px;}.dhx_btn_set{padding:5px 10px 0 10px;float:left;}.dhx_btn_set div{float:left;height:21px;line-height:21px;vertical-align:middle;cursor:pointer;}.dhx_save_btn{background-image:url('./imgs/controls.gif');background-position:-84px 0;width:21px;}.dhx_cancel_btn{background-image:url('./imgs/controls.gif');background-position:-63px 0;width:20px;}.dhx_delete_btn{background-image:url('./imgs/controls.gif');background-position:-42px 0;width:20px;}.dhx_cal_cover{width:100%;height:100%;position:absolute;z-index:10000;top:0;left:0;background-color:black;opacity:.1;filter:alpha(opacity=10);}.dhx_custom_button{padding:0 3px 0 3px;color:#887A2E;font-family:Tahoma;font-size:8pt;background-color:#FFE763;font-weight:normal;margin-right:5px;margin-top:0;cursor:pointer;}.dhx_custom_button div{cursor:pointer;float:left;height:21px;line-height:21px;vertical-align:middle;}.dhx_cal_light_wide .dhx_cal_larea{border-top-width:0;}.dhx_cal_light_wide .dhx_cal_lsection{border:0;float:left;text-align:right;width:100px;height:20px;font-size:16px;padding:5px 0 0 10px;}.dhx_cal_light_wide .dhx_wrap_section{border-top:1px solid #DBCF8C;position:relative;background-color:#DBCF8C;overflow:hidden;}.dhx_cal_light_wide .dhx_section_time{padding-top:2px!important;height:20px!important;}.dhx_section_time{text-align:center;}.dhx_cal_light_wide .dhx_cal_larea{width:730px;}.dhx_cal_light_wide{width:738px;}.dhx_cal_light_wide .dhx_section_time{background:transparent;}.dhx_cal_light_wide .dhx_cal_checkbox label{padding-left:0;}.dhx_cal_wide_checkbox input{margin-top:8px;margin-left:14px;}.dhx_cal_light input{font-family:Tahoma;font-size:8pt;color:#887A2E;}.dhx_cal_light_wide .dhx_cal_lsection .dhx_fullday{float:none;margin-right:0;color:#FFF4B5;font-weight:bold;font-size:16px;font-family:Arial;cursor:pointer;}.dhx_custom_button{float:right;height:21px;width:90px;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;}.dhx_cal_light_wide .dhx_custom_button{position:absolute;top:0;right:0;margin-top:2px;}.dhx_cal_light_wide .dhx_repeat_right{margin-right:55px;}.dhx_scale_bar_header{position:absolute;border-bottom:1px dotted #8894A3;width:100%;}.dhx_expand_icon{position:absolute;top:0;right:0;background-image:url(./imgs/colapce-expand-icon.gif);width:18px;height:18px;cursor:pointer;background-position:0 18px;z-index:16;}.dhx_agenda_area{width:100%;height:100%;overflow-y:auto;background-image:url(./imgs/databg.png);}.dhx_agenda_line{height:21px;clear:both;overflow:hidden;}.dhx_agenda_line div{float:left;width:188px;border-right:1px dotted #8894A3;text-align:center;line-height:21px;overflow:hidden;}.dhx_agenda_area .dhx_agenda_line div{border-right:0 dotted #8894A3;}.dhx_v_border{position:absolute;left:186px;top:0;border-right:1px dotted #8894A3;width:1px;height:100%;}.dhx_agenda_line .dhx_event_icon{width:20px;border-width:0;background:url(./imgs/icon.png) no-repeat;background-position:5px 4px;cursor:pointer;}.dhx_agenda_line span{padding-left:5px;line-height:21px;}.dhx_year_body{border-left:1px dotted #586A7E;}.dhx_year_week{position:relative;}.dhx_scale_bar_last{border-right:1px dotted #586A7E;}.dhx_year_month{height:18px;padding-top:3px;border:1px dotted #586A7E;text-align:center;vertical-align:middle;}.dhx_year_body .dhx_before .dhx_month_head,.dhx_year_body .dhx_after .dhx_month_head,.dhx_year_body .dhx_before .dhx_month_head a,.dhx_year_body .dhx_after .dhx_month_head a{color:#E2E3E6!important;}.dhx_year_body .dhx_month_body{height:0;overflow:hidden;}.dhx_month_head.dhx_year_event{background-color:#FFE763;}.dhx_year_body .dhx_before .dhx_month_head,.dhx_year_body .dhx_after .dhx_month_head{cursor:default;}.dhx_tooltip{border:1px solid #BBB;background-image:url(./imgs/databg.png);position:absolute;z-index:9998;width:300px;height:auto;font-family:Tahoma;font-size:8pt;overflow:hidden;}.dhx_tooltip_line{line-height:20px;height:20px;overflow:hidden;}.dhx_tooltip_line .dhx_event_icon{width:20px;height:20px;padding-right:10px;float:left;border-width:0;position:relative;background:url(./imgs/icon.png) no-repeat;background-position:5px 4px;cursor:pointer;}.dhx_tooltip_date{float:left;width:auto;padding-left:5px;text-align:center;}.dhx_text_disabled{color:#887A2E;font-family:Tahoma;font-size:8pt;}.dhx_mini_calendar{-moz-box-shadow:5px 5px 5px #888;-khtml-box-shadow:5px 5px 5px #888;}.dhx_mini_calendar .dhx_month_head{cursor:pointer;}.dhx_mini_calendar .dhx_calendar_click{background-color:#C2D5FC;}.dhx_cal_navline div.dhx_minical_icon{width:18px;height:18px;left:190px;top:1px;cursor:pointer;background-image:url(./imgs/calendar.gif);}.dhx_matrix_scell{height:100%;}.dhx_matrix_cell,.dhx_matrix_scell{overflow:hidden;text-align:center;vertical-align:middle;border-bottom:1px dotted #8894A3;border-right:1px dotted #8894A3;}.dhx_matrix_cell{background-color:white;}.dhx_matrix_line{overflow:hidden;}.dhx_matrix_cell div,.dhx_matrix_scell div{overflow:hidden;text-align:center;height:auto;}.dhx_cal_lsection .dhx_readonly{font-size:9pt;font-size:8pt;padding:2px;color:#887A2E;}.dhx_matrix_scell.folder,.dhx_data_table.folder .dhx_matrix_cell{background-color:#969394;cursor:pointer;}.dhx_matrix_scell .dhx_scell_level0{padding-left:5px;}.dhx_matrix_scell .dhx_scell_level1{padding-left:20px;}.dhx_matrix_scell .dhx_scell_level2{padding-left:35px;}.dhx_matrix_scell .dhx_scell_level3{padding-left:50px;}.dhx_matrix_scell .dhx_scell_level4{padding-left:65px;}.dhx_matrix_scell.folder{font-weight:bold;text-align:left;}.dhx_matrix_scell.folder .dhx_scell_expand{float:left;width:10px;padding-right:3px;}.dhx_matrix_scell.folder .dhx_scell_name{float:left;width:auto;}.dhx_matrix_scell.item .dhx_scell_name{padding-left:15px;text-align:left;}.dhx_data_table.folder .dhx_matrix_cell{border-right:0;}.dhx_section_timeline{overflow:hidden;padding:4px 0 2px 10px;}.dhx_section_timeline select{width:552px;}.dhx_map_area{width:100%;height:100%;overflow-y:auto;overflow-x:hidden;background-image:url(./imgs/databg.png);}.dhx_map_line .dhx_event_icon{width:20px;border-width:0;background:url(./imgs/icon.png) no-repeat;background-position:5px 4px;cursor:pointer;}.dhx_map_line{height:21px;clear:both;overflow:hidden;}.dhx_map{position:absolute;}.dhx_map_line div{float:left;border-right:1px dotted #8894A3;text-align:center;line-height:21px;overflow:hidden;}.dhx_map_line .headline_description{float:left;border-right:1px dotted #8894A3;text-align:center;line-height:21px;overflow:hidden;}.dhx_map_line .dhx_map_description{float:left;border-right:0 dotted #8894A3;text-align:center;line-height:21px;overflow:hidden;}.dhx_map_line .line_description{float:left;border-right:1px dotted #8894A3;text-align:left;padding-left:5px;line-height:21px;overflow:hidden;}.dhx_map_line.highlight{background-color:#C4C5CC;}.dhx_map_area .dhx_map_line div{border-right:0 dotted #8894A3;}.dhtmlXTooltip.tooltip{-moz-box-shadow:3px 3px 3px #888;-webkit-box-shadow:3px 3px 3px #888;-o-box-shadow:3px 3px 3px #888;box-shadow:3px 3px 3px #888;filter:progid:DXImageTransform.Microsoft.Shadow(color='#888888',Direction=135,Strength=5);background-color:white;border-left:1px dotted #887A2E;border-top:1px dotted #887A2E;color:#887A2E;cursor:default;padding:10px;position:absolute;z-index:500;}.dhx_cal_checkbox label{padding-left:5px;}.dhx_cal_light .radio{padding:2px 0 2px 10px;}.dhx_cal_light .radio input,.dhx_cal_light .radio label{line-height:15px;}.dhx_cal_light .radio input{vertical-align:middle;margin:0;padding:0;}.dhx_cal_light .radio label{vertical-align:middle;padding-right:10px;}.dhx_cal_light .combo{padding:4px;}.dhx_wa_column{float:left;}.dhx_wa_column_last .dhx_wa_day_cont{border-left:1px dotted #8894A3;}.dhx_wa_scale_bar{font-family:Tahoma;padding-left:10px;font-size:11px;border-top:1px dotted #8894A3;border-bottom:1px dotted #8894A3;}.dhx_wa_day_data{background-color:#FCFEFC;overflow-y:auto;}.dhx_wa_ev_body{border-bottom:1px dotted #789;font-size:12px;padding:5px 0 5px 7px;}.dhx_wa_dnd{font-family:Tahoma;position:absolute;padding-right:7px;color:#887AE2!important;background-color:#FFE763!important;border:1px solid #B7A543;}.dhx_cal_event_selected{background-color:#9cc1db;color:white;}.dhx_second_scale_bar{border-bottom:1px dotted #586A7E;padding-top:2px;}div.dhx_form_repeat input.radio{margin:-4px 0 0 -4px!ie;}div.dhx_form_repeat input.checkbox{margin:0 0 0 -4px!ie;}.dhx_form_repeat,.dhx_form_repeat input{padding:0;margin:0;padding-left:5px;font-family:Tahoma,Verdana;font-size:11px;line-height:24px;}.dhx_form_repeat{overflow:hidden;height:0;background-color:#FFF4B5;}.dhx_cal_light_wide .dhx_form_repeat{background-color:transparent;}.dhx_repeat_center,.dhx_repeat_left{height:115px;padding:10px 0 10px 10px;float:left;}.dhx_repeat_left{width:95px;}.dhx_repeat_center{width:335px;margin-top:12px;}.dhx_repeat_divider{float:left;height:115px;border-left:1px dotted #DCC43E;width:1px;}.dhx_repeat_right{float:right;height:115px;width:160px;padding:10px 3px 10px 10px;margin-top:7px;}input.dhx_repeat_text{height:16px;width:27px;margin:0 4px 0 4px;line-height:18px;padding:0 0 0 2px;}.dhx_form_repeat select{height:20px;width:87px;padding:0 0 0 2px;margin:0 4px 0 4px;}input.dhx_repeat_date{height:18px;width:80px;padding:0 0 0 2px;margin:0 4px 0 4px;background-repeat:no-repeat;background-position:64px 0;border:1px #7f9db9 solid;line-height:18px;}input.dhx_repeat_radio{margin-right:4px;}input.dhx_repeat_checkbox{margin:4px 4px 0 0;}.dhx_repeat_days td{padding-right:5px;}.dhx_repeat_days label{font-size:10px;}.dhx_custom_button{width:90px;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;}.dhx_custom_button_recurring{background-image:url(./imgs/but_repeat.gif);background-position:-5px 20px;width:20px;margin-right:10px;}.dhx_cal_light_rec{width:640px;}.dhx_cal_light_rec .dhx_cal_larea{width:632px;}.dhx_cal_light_rec.dhx_cal_light_wide{width:816px;}.dhx_cal_light_rec.dhx_cal_light_wide .dhx_cal_larea{width:808px;}
\ No newline at end of file +.dhtmlx_message_area{position:fixed;right:5px;width:250px;z-index:1000;}.dhtmlx-info{min-width:120px;padding:4px 4px 4px 20px;font-family:Tahoma;z-index:10000;margin:5px;margin-bottom:10px;-webkit-transition:all .5s ease;-moz-transition:all .5s ease;-o-transition:all .5s ease;transition:all .5s ease;}.dhtmlx-info.hidden{height:0;padding:0;border-width:0;margin:0;overflow:hidden;}.dhtmlx_modal_box{overflow:hidden;display:inline-block;min-width:300px;width:300px;text-align:center;position:fixed;background-color:#fff;background:-webkit-linear-gradient(top,#fff 1%,#d0d0d0 99%);background:-moz-linear-gradient(top,#fff 1%,#d0d0d0 99%);box-shadow:0 0 14px #888;font-family:Tahoma;z-index:20000;border-radius:6px;border:1px solid #fff;}.dhtmlx_popup_title{border-top-left-radius:5px;border-top-right-radius:5px;border-width:0;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAoCAMAAAAIaGBFAAAAhFBMVEVwcHBubm5sbGxqampoaGhmZmZlZWVjY2NhYWFfX19dXV1bW1taWlpYWFhWVlZUVFRSUlJRUVFPT09NTU1LS0tJSUlHR0dGRkZERERCQkJAQEA+Pj49PT09PT0+Pj5AQEBBQUFDQ0NERERGRkZHR0dJSUlKSkpMTExMTEw5OTk5OTk5OTkny8YEAAAAQklEQVQImQXBCRJCAAAAwKVSQqdyjSPXNP7/QLsIhA6OTiJnF7GrRCpzc/fw9PKW+/gqlCq1RqvTG/yMJrPF6m/bAVEhAxxnHG0oAAAAAElFTkSuQmCC);background-image:-webkit-linear-gradient(top,#707070 1%,#3d3d3d 70%,#4c4c4c 97%,#393939 97%);background-image:-moz-linear-gradient(top,#707070 1%,#3d3d3d 70%,#4c4c4c 97%,#393939 97%);}.dhtmlx-info,.dhtmlx_popup_button,.dhtmlx_button{user-select:none;-webkit-user-select:none;-moz-user-select:-moz-none;cursor:pointer;}.dhtmlx_popup_text{overflow:hidden;}.dhtmlx_popup_controls{border-radius:6px;padding:5px;}.dhtmlx_popup_button,.dhtmlx_button{height:30px;line-height:30px;display:inline-block;margin:0 5px;border-radius:6px;color:#FFF;}.dhtmlx_popup_button{min-width:120px;}div.dhx_modal_cover{background-color:#000;cursor:default;filter:alpha(opacity = 20);opacity:.2;position:fixed;z-index:19999;left:0;top:0;width:100%;height:100%;border:none;zoom:1;}.dhtmlx-info img,.dhtmlx_modal_box img{float:left;margin-right:20px;}.dhtmlx-alert-error .dhtmlx_popup_title,.dhtmlx-confirm-error .dhtmlx_popup_title{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAsCAIAAAArRUU2AAAATklEQVR4nIWLuw2AMBBDjVuQiBT2oWbRDATrnB0KQOJoqPzRe3BrHI6dcBASYREKovtK6/6DsDOX+stN+3H1YX9ciRgnYq5EWYhS2dftBIuLT4JyIrPCAAAAAElFTkSuQmCC);}.dhtmlx-alert-error,.dhtmlx-confirm-error{border:1px solid #f00;}.dhtmlx_button,.dhtmlx_popup_button{box-shadow:0 0 4px #888;border:1px solid #838383;}.dhtmlx_button input,.dhtmlx_popup_button div{border:1px solid #FFF;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAeCAMAAADaS4T1AAAAYFBMVEVwcHBtbW1ra2toaGhmZmZjY2NhYWFeXl5cXFxaWlpXV1dVVVVSUlJQUFBNTU1LS0tJSUlGRkZERERBQUE/Pz88PDw9PT0+Pj5AQEBCQkJDQ0NFRUVHR0dISEhKSkpMTEzqthaMAAAAMklEQVQImQXBhQ2AMAAAsOIMlwWH/8+kRSKVyRVKlVrQaHV6g9FktlhFm93hdLk9Xt8PIfgBvdUqyskAAAAASUVORK5CYII=);background-image:-webkit-linear-gradient(top,#707070 1%,#3d3d3d 70%,#4c4c4c 99%);background-image:-moz-linear-gradient(top,#707070 1%,#3d3d3d 70%,#4c4c4c 99%);border-radius:6px;font-size:15px;font-weight:normal;-moz-box-sizing:content-box;box-sizing:content-box;color:#fff;padding:0;margin:0;vertical-align:top;height:28px;line-height:28px;}.dhtmlx_button input:focus,.dhtmlx_button input:active,.dhtmlx_popup_button div:active,.dhtmlx_popup_button div:focus{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAeCAMAAADaS4T1AAAAXVBMVEVwcHBubm5tbW1sbGxra2tpaWloaGhnZ2dmZmZlZWVjY2NiYmJhYWFgYGBfX19dXV1cXFxbW1taWlpZWVlXV1dWVlZVVVVUVFRTU1NRUVFQUFBPT09OTk5NTU1LS0tT9SY0AAAAMUlEQVQImQXBhQGAMAAAIGxnx2z9/00BiVQmVyhVakGj1ekNRpPZYhVtdofT5fZ4fT8hpwG05JjexgAAAABJRU5ErkJggg==);background-image:-webkit-linear-gradient(top,#707070 1%,#4c4c4c 99%);background-image:-moz-linear-gradient(top,#707070 1%,#4c4c4c 99%);}.dhtmlx_popup_title{color:#fff;text-shadow:1px 1px #000;height:40px;line-height:40px;font-size:20px;}.dhtmlx_popup_text{margin:15px 15px 5px 15px;font-size:14px;color:#000;min-height:30px;border-radius:6px;}.dhtmlx-info,.dhtmlx-error{font-size:14px;color:#000;box-shadow:0 0 10px #888;padding:0;background-color:#FFF;border-radius:3px;border:1px solid #fff;}.dhtmlx-info div{padding:5px 10px 5px 10px;background-color:#fff;border-radius:3px;border:1px solid #B8B8B8;}.dhtmlx-error{background-color:#d81b1b;border:1px solid #ff3c3c;box-shadow:0 0 10px #000;}.dhtmlx-error div{background-color:#d81b1b;border:1px solid #940000;color:#FFF;}.dhx_cal_container{background-color:#C2D5FC;font-family:Tahoma;font-size:8pt;position:relative;overflow:hidden;}.dhx_cal_container div{-moz-user-select:none;-moz-user-select:-moz-none;}.dhx_cal_navline{height:20px;position:absolute;z-index:3;width:750px;color:#2F3A48;}.dhx_cal_navline div{position:absolute;top:2px;white-space:nowrap;}.dhx_cal_navline .dhx_cal_date{font-weight:600;left:210px;padding-top:1px;}.dhx_cal_button .dhx_left_bg{width:1px;overflow:hidden;height:17px;z-index:20;top:0;}.dhx_cal_prev_button{background-image:url(imgs/buttons.png);background-position:0 0;width:29px;height:17px;left:50px;cursor:pointer;}.dhx_cal_next_button{background-image:url(imgs/buttons.png);background-position:-30px 0;width:29px;height:17px;left:80px;cursor:pointer;}.dhx_cal_today_button{background-image:url(imgs/buttons.png);background-position:-60px 0;width:75px;height:17px;left:112px;cursor:pointer;text-align:center;text-decoration:underline;}.dhx_cal_tab{width:59px;height:19px;text-align:center;text-decoration:underline;padding-top:2px;cursor:pointer;background-color:#D8E1EA;-webkit-border-top-left-radius:4px;-webkit-border-top-right-radius:4px;-moz-border-radius-topleft:4px;-moz-border-radius-topright:4px;border-top-left-radius:4px;border-top-right-radius:4px;}.dhx_cal_tab.active{text-decoration:none;cursor:default;font-weight:bold;border:1px dotted #586A7E;border-bottom:0;background-color:#C2D5FC;}.dhx_cal_header{position:absolute;left:10px;top:23px;width:750px;border-top:1px dotted #8894A3;border-right:1px dotted #8894A3;z-index:2;overflow:hidden;color:#2F3A48;}.dhx_cal_data{border-top:1px dotted #8894A3;position:absolute;top:44px;width:600px;overflow-y:auto;overflow-x:hidden;}.dhx_scale_bar{position:absolute;text-align:center;background-color:#C2D5FC;padding-top:3px;border-left:1px dotted #586A7E;}.dhx_scale_holder{position:absolute;border-right:1px dotted #586A7E;background-image:url(imgs/databg.png);}.dhx_scale_holder_now{position:absolute;border-right:1px dotted #586A7E;background-image:url(imgs/databg_now.png);}.dhx_scale_hour{height:41px;width:50px;border-bottom:1px dotted #8894A3;background-color:#C2D5FC;text-align:center;line-height:40px;color:#586A7E;overflow:hidden;}.dhx_month_head{background-color:#EBEFF4;color:#2F3A48;border-right:1px dotted #586A7E;height:18px;padding-right:5px;padding-top:3px;text-align:right;}.dhx_month_body{border-right:1px dotted #586A7E;border-bottom:1px dotted #586A7E;background-color:#FFF;}.dhx_now .dhx_month_body{background-color:#E2EDFF;}.dhx_after .dhx_month_body,.dhx_before .dhx_month_body{background-color:#ECECEC;}.dhx_after .dhx_month_head,.dhx_before .dhx_month_head{background-color:#E2E3E6;color:#94A6BB;}.dhx_now .dhx_month_head{background-color:#D1DEF4;font-weight:bold;}.dhx_cal_drag{position:absolute;z-index:9999;background-color:#FFE763;border:1px solid #B7A543;opacity:.5;filter:alpha(opacity=50);}.dhx_loading{position:absolute;width:128px;height:15px;background-image:url(imgs/loading.gif);z-index:9999;}.dhx_multi_day_icon,.dhx_multi_day{background-color:#E1E6FF;background-repeat:no-repeat;border-right:1px dotted #8894A3;}.dhx_multi_day{position:absolute;border-top:1px dotted #8894A3;}.dhx_multi_day_icon,.dhx_multi_day_icon_small{background-position:center center;background-color:#E1E6FF;background-repeat:no-repeat;border-bottom:1px dotted #8894A3;border-right:1px dotted #8894A3;}.dhx_multi_day_icon{background-image:url(imgs/clock_big.gif);}.dhx_multi_day_icon_small{background-image:url(imgs/clock_small.gif);}.dhtmlxLayoutPolyContainer_dhx_skyblue .dhx_cal_container{background-color:#d0e5ff;}.dhx_cal_event .dhx_header,.dhx_cal_event .dhx_title,.dhx_cal_event .dhx_body,.dhx_cal_event .dhx_footer{background-color:#FFE763;border:1px solid #B7A543;color:#887A2E;overflow:hidden;width:100%;font-family:Tahoma;font-size:8pt;}.dhx_move_denied .dhx_cal_event .dhx_header,.dhx_move_denied .dhx_cal_event .dhx_title{cursor:default;}.dhx_cal_event .dhx_header{height:1px;margin-left:1px;border-width:1px 1px 0 1px;cursor:pointer;}.dhx_cal_event .dhx_title{height:12px;border-width:0 1px 1px 1px;border-bottom-style:dotted;font-size:7pt;font-weight:bold;text-align:center;background-position:right;background-repeat:no-repeat;cursor:pointer;}.dhx_cal_event .dhx_body,.dhx_cal_event.dhx_cal_select_menu .dhx_body{border-width:0 1px 1px 1px;padding:5px;}.dhx_resize_denied{cursor:default!important;}.dhx_cal_event .dhx_event_resize{cursor:s-resize;}.dhx_cal_event .dhx_footer,.dhx_cal_event .dhx_select_menu_footer{height:1px;margin-left:2px;border-width:0 1px 1px 1px;}.dhx_cal_event_line{background-color:#FFE763;border:1px solid #B7A543;border-radius:3px;font-family:Tahoma;font-size:8pt;height:13px;padding-left:10px;color:#887A2E;cursor:pointer;overflow:hidden;}.dhx_cal_event_clear{font-family:Tahoma;font-size:8pt;height:13px;padding-left:2px;color:#887A2E;white-space:nowrap;overflow:hidden;cursor:pointer;}.dhx_in_move{background-color:#FFFF80;}div.dhx_cal_editor{background-color:#FFE763;border:1px solid #B7A543;border-top-style:dotted;z-index:999;position:absolute;overflow:hidden;}textarea.dhx_cal_editor{width:100%;height:100%;border:0 solid black;margin:none;padding:none;overflow:auto;}div.dhx_menu_head{background-image:url(imgs/controls.gif);background-position:0 -43px;width:10px;height:10px;margin-left:5px;margin-top:1px;border:none;cursor:default;}div.dhx_menu_icon{background-image:url(imgs/controls.gif);width:20px;height:20px;margin-left:-5px;margin-top:0;border:none;cursor:pointer;}div.icon_details{background-position:0 0;}div.icon_edit{background-position:-22px 0;}div.icon_save{background-position:-84px -1px;}div.icon_cancel{background-position:-62px 0;}div.icon_delete{background-position:-42px 0;}.dhx_unselectable,.dhx_unselectable div{-webkit-user-select:none;-moz-user-select:none;-moz-user-select:-moz-none;}.dhx_cal_light{background-color:#FFE763;border-radius:5px;font-family:Tahoma;font-size:8pt;border:1px solid #B7A64B;color:#887A2E;position:absolute;z-index:10001;width:580px;height:300px;box-shadow:5px 5px 5px #888;}.dhx_cal_light_wide{width:650px;}.dhx_mark{position:relative;top:3px;background-image:url('./imgs/controls.gif');background-position:0 -43px;padding-left:10px;}.dhx_ie6 .dhx_mark{background-position:6px -41px;}.dhx_cal_light select{font-family:Tahoma;font-size:8pt;color:#887A2E;padding:2px;margin:0;}.dhx_cal_ltitle{padding:2px 0 2px 5px;overflow:hidden;white-space:nowrap;}.dhx_cal_ltitle span{white-space:nowrap;}.dhx_cal_lsection{background-color:#DBCF8C;color:#FFF4B5;font-weight:bold;padding:5px 0 3px 10px;}.dhx_section_time{background-color:#DBCF8C;white-space:nowrap;}.dhx_cal_lsection .dhx_fullday{float:right;margin-right:5px;color:#887A2E;font-size:12px;font-weight:normal;line-height:20px;vertical-align:top;cursor:pointer;}.dhx_cal_lsection{font-size:18px;font-family:Arial;}.dhx_cal_ltext{padding:2px 0 2px 10px;overflow:hidden;}.dhx_cal_ltext textarea{background-color:#FFF4B5;overflow:auto;border:none;color:#887A2E;height:100%;width:100%;outline:none!important;resize:none;}.dhx_time{font-weight:bold;}.dhx_cal_light .dhx_title{padding-left:10px;}.dhx_cal_larea{border:1px solid #DCC43E;background-color:#FFF4B5;overflow:hidden;margin-left:3px;width:572px;height:1px;}.dhx_btn_set{padding:5px 10px 0 10px;float:left;}.dhx_btn_set div{float:left;height:21px;line-height:21px;vertical-align:middle;cursor:pointer;}.dhx_save_btn{background-image:url('./imgs/controls.gif');background-position:-84px 0;width:21px;}.dhx_cancel_btn{background-image:url('./imgs/controls.gif');background-position:-63px 0;width:20px;}.dhx_delete_btn{background-image:url('./imgs/controls.gif');background-position:-42px 0;width:20px;}.dhx_cal_cover{width:100%;height:100%;position:absolute;z-index:10000;top:0;left:0;background-color:black;opacity:.1;filter:alpha(opacity=10);}.dhx_custom_button{padding:0 3px 0 3px;color:#887A2E;font-family:Tahoma;font-size:8pt;background-color:#FFE763;font-weight:normal;margin-right:5px;margin-top:0;cursor:pointer;}.dhx_custom_button div{cursor:pointer;float:left;height:21px;line-height:21px;vertical-align:middle;}.dhx_cal_light_wide .dhx_cal_larea{border-top-width:0;}.dhx_cal_light_wide .dhx_cal_lsection{border:0;float:left;text-align:right;width:100px;height:20px;font-size:16px;padding:5px 0 0 10px;}.dhx_cal_light_wide .dhx_wrap_section{border-top:1px solid #DBCF8C;position:relative;background-color:#DBCF8C;overflow:hidden;}.dhx_cal_light_wide .dhx_section_time{padding-top:2px!important;height:20px!important;}.dhx_section_time{text-align:center;}.dhx_cal_light_wide .dhx_cal_larea{width:730px;}.dhx_cal_light_wide{width:738px;}.dhx_cal_light_wide .dhx_section_time{background:transparent;}.dhx_cal_light_wide .dhx_cal_checkbox label{padding-left:0;}.dhx_cal_wide_checkbox input{margin-top:8px;margin-left:14px;}.dhx_cal_light input{font-family:Tahoma;font-size:8pt;color:#887A2E;}.dhx_cal_light_wide .dhx_cal_lsection .dhx_fullday{float:none;margin-right:0;color:#FFF4B5;font-weight:bold;font-size:16px;font-family:Arial;cursor:pointer;}.dhx_custom_button{float:right;height:21px;width:90px;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;}.dhx_cal_light_wide .dhx_custom_button{position:absolute;top:0;right:0;margin-top:2px;}.dhx_cal_light_wide .dhx_repeat_right{margin-right:55px;}.dhx_minical_popup{position:absolute;z-index:10100;width:251px;height:175px;}.dhx_scale_bar_header{position:absolute;border-bottom:1px dotted #8894A3;width:100%;}.dhx_expand_icon{position:absolute;top:0;right:0;background-image:url(./imgs/collapse_expand_icon.gif);width:18px;height:18px;cursor:pointer;background-position:0 18px;z-index:16;}.dhx_scheduler_agenda .dhx_cal_data{background-image:url(./imgs/databg.png);}.dhx_agenda_area{width:100%;overflow-y:auto;background-image:url(./imgs/databg.png);}.dhx_agenda_line{height:21px;clear:both;overflow:hidden;}.dhx_agenda_line div{float:left;width:188px;border-right:1px dotted #8894A3;text-align:center;line-height:21px;overflow:hidden;}.dhx_agenda_area .dhx_agenda_line div{border-right:0 dotted #8894A3;}.dhx_v_border{position:absolute;left:187px;top:0;border-right:1px dotted #8894A3;width:1px;height:100%;}.dhx_agenda_line .dhx_event_icon{width:20px;border-width:0;background:url(./imgs/icon.png) no-repeat;background-position:5px 4px;cursor:pointer;}.dhx_agenda_line span{padding-left:5px;line-height:21px;}.dhx_year_body{border-left:1px dotted #586A7E;}.dhx_year_week{position:relative;}.dhx_scale_bar_last{border-right:1px dotted #586A7E;}.dhx_year_month{height:18px;padding-top:3px;border:1px dotted #586A7E;text-align:center;vertical-align:middle;}.dhx_year_body .dhx_before .dhx_month_head,.dhx_year_body .dhx_after .dhx_month_head,.dhx_year_body .dhx_before .dhx_month_head a,.dhx_year_body .dhx_after .dhx_month_head a{color:#E2E3E6!important;}.dhx_year_body .dhx_month_body{height:0;overflow:hidden;}.dhx_month_head.dhx_year_event{background-color:#FFE763;}.dhx_year_body .dhx_before .dhx_month_head,.dhx_year_body .dhx_after .dhx_month_head{cursor:default;}.dhx_tooltip{border:1px solid #BBB;background-image:url(./imgs/databg.png);position:absolute;z-index:9998;width:300px;height:auto;font-family:Tahoma;font-size:8pt;overflow:hidden;}.dhx_tooltip_line{line-height:20px;height:20px;overflow:hidden;}.dhx_tooltip_line .dhx_event_icon{width:20px;height:20px;padding-right:10px;float:left;border-width:0;position:relative;background:url(./imgs/icon.png) no-repeat;background-position:5px 4px;cursor:pointer;}.dhx_tooltip_date{float:left;width:auto;padding-left:5px;text-align:center;}.dhx_text_disabled{color:#887A2E;font-family:Tahoma;font-size:8pt;}.dhx_mini_calendar{-moz-box-shadow:5px 5px 5px #888;-khtml-box-shadow:5px 5px 5px #888;}.dhx_mini_calendar .dhx_month_head{cursor:pointer;}.dhx_mini_calendar .dhx_calendar_click{background-color:#C2D5FC;}.dhx_cal_navline div.dhx_minical_icon{width:18px;height:18px;left:190px;top:1px;cursor:pointer;background-image:url(./imgs/calendar.gif);}.dhx_matrix_scell{height:100%;}.dhx_matrix_cell,.dhx_matrix_scell{overflow:hidden;text-align:center;vertical-align:middle;border-bottom:1px dotted #8894A3;border-right:1px dotted #8894A3;}.dhx_matrix_cell{background-color:white;}.dhx_matrix_line{overflow:hidden;}.dhx_matrix_cell div,.dhx_matrix_scell div{overflow:hidden;text-align:center;height:auto;}.dhx_cal_lsection .dhx_readonly{font-size:9pt;font-size:8pt;padding:2px;color:#887A2E;}.dhx_cal_event_line .dhx_event_resize{cursor:w-resize;background:url(./imgs/resize_dots.png) repeat-y;position:absolute;top:0;width:4px;}.dhx_event_resize_start{left:0;}.dhx_event_resize_end{right:0;}.dhx_matrix_scell.folder,.dhx_data_table.folder .dhx_matrix_cell{background-color:#969394;cursor:pointer;}.dhx_matrix_scell .dhx_scell_level0{padding-left:5px;}.dhx_matrix_scell .dhx_scell_level1{padding-left:20px;}.dhx_matrix_scell .dhx_scell_level2{padding-left:35px;}.dhx_matrix_scell .dhx_scell_level3{padding-left:50px;}.dhx_matrix_scell .dhx_scell_level4{padding-left:65px;}.dhx_matrix_scell.folder{font-weight:bold;text-align:left;}.dhx_matrix_scell.folder .dhx_scell_expand{float:left;width:10px;padding-right:3px;}.dhx_matrix_scell.folder .dhx_scell_name{float:left;width:auto;}.dhx_matrix_scell.item .dhx_scell_name{padding-left:15px;text-align:left;}.dhx_data_table.folder .dhx_matrix_cell{border-right:0;}.dhx_section_timeline{overflow:hidden;padding:4px 0 2px 10px;}.dhx_section_timeline select{width:552px;}.dhx_map_area{width:100%;height:100%;overflow-y:auto;overflow-x:hidden;background-image:url(./imgs/databg.png);}.dhx_map_line .dhx_event_icon{width:20px;border-width:0;background:url(./imgs/icon.png) no-repeat;background-position:5px 4px;cursor:pointer;}.dhx_map_line{height:21px;clear:both;overflow:hidden;}.dhx_map{position:absolute;}.dhx_map_line div{float:left;border-right:1px dotted #8894A3;text-align:center;line-height:21px;overflow:hidden;}.dhx_map_line .headline_description{float:left;border-right:1px dotted #8894A3;text-align:center;line-height:21px;overflow:hidden;}.dhx_map_line .dhx_map_description{float:left;border-right:0 dotted #8894A3;text-align:center;line-height:21px;overflow:hidden;}.dhx_map_line .headline_date,.dhx_map_line .headline_description{border-left:0;}.dhx_map_line .line_description{float:left;border-right:1px dotted #8894A3;text-align:left;padding-left:5px;line-height:21px;overflow:hidden;}.dhx_map_line.highlight{background-color:#C4C5CC;}.dhx_map_area .dhx_map_line div{border-right:0 dotted #8894A3;}.dhtmlXTooltip.tooltip{-moz-box-shadow:3px 3px 3px #888;-webkit-box-shadow:3px 3px 3px #888;-o-box-shadow:3px 3px 3px #888;box-shadow:3px 3px 3px #888;filter:progid:DXImageTransform.Microsoft.Shadow(color='#888888',Direction=135,Strength=5);background-color:white;border-left:1px dotted #887A2E;border-top:1px dotted #887A2E;color:#887A2E;cursor:default;padding:10px;position:absolute;z-index:500;}.dhx_cal_checkbox label{padding-left:5px;}.dhx_cal_light .radio{padding:2px 0 2px 10px;}.dhx_cal_light .radio input,.dhx_cal_light .radio label{line-height:15px;}.dhx_cal_light .radio input{vertical-align:middle;margin:0;padding:0;}.dhx_cal_light .radio label{vertical-align:middle;padding-right:10px;}.dhx_cal_light .combo{padding:4px;}.dhx_cal_light_wide .dhx_combo_box{width:608px!important;left:10px;}.dhx_wa_column{float:left;}.dhx_wa_column_last .dhx_wa_day_cont{border-left:1px dotted #8894A3;}.dhx_wa_scale_bar{font-family:Tahoma;padding-left:10px;font-size:11px;border-top:1px dotted #8894A3;border-bottom:1px dotted #8894A3;}.dhx_wa_day_data{background-color:#FCFEFC;overflow-y:auto;}.dhx_wa_ev_body{border-bottom:1px dotted #789;font-size:12px;padding:5px 0 5px 7px;}.dhx_wa_dnd{font-family:Tahoma;position:absolute;padding-right:7px;color:#887AE2!important;background-color:#FFE763!important;border:1px solid #B7A543;}.dhx_cal_event_selected{background-color:#9cc1db;color:white;}.dhx_second_scale_bar{border-bottom:1px dotted #586A7E;padding-top:2px;}.dhx_cal_header div div{border-left:1px dotted #8894A3;}.dhx_grid_area{width:100%;height:100%;overflow-y:auto;background-color:#FCFEFC;}.dhx_grid_area table{border-collapse:collapse;border-spacing:0;width:100%;table-layout:fixed;}.dhx_grid_area td{table-layout:fixed;text-align:center;}.dhx_grid_line{height:21px;clear:both;overflow:hidden;}.dhx_grid_line div{float:left;cursor:default;padding-top:0;padding-bottom:0;text-align:center;line-height:21px;overflow:hidden;}.dhx_grid_area td,.dhx_grid_line div{padding-left:8px;padding-right:8px;}.dhx_grid_area tr.dhx_grid_event{height:21px;overflow:hidden;margin:0 0 1px 0;}.dhx_grid_area tr.dhx_grid_event td{border-bottom:1px solid #ECEEF4;}.dhx_grid_area tr.dhx_grid_event:nth-child(2n+1) td,.dhx_grid_area tr.dhx_grid_event:nth-child(2n) td{border-bottom-width:0;border-bottom-style:none;}.dhx_grid_area tr.dhx_grid_event:nth-child(2n){background-color:#ECEEF4;;}.dhx_grid_area .dhx_grid_dummy{table-layout:auto;margin:0!important;padding:0!important;}.dhx_grid_v_border{position:absolute;border-right:1px solid #A4BED4;width:1px;height:100%;}.dhx_grid_event_selected{background-color:#9cc1db!important;color:white!important;}.dhx_grid_sort_desc .dhx_grid_view_sort{background-position:0 -55px;}.dhx_grid_sort_asc .dhx_grid_view_sort{background-position:0 -66px;}.dhx_grid_view_sort{width:10px;height:10px;position:absolute;border:none!important;top:5px;background-repeat:no-repeat;background-image:url(./imgs/images.png);}.dhx_marked_timespan{position:absolute;width:100%;}.dhx_time_block{position:absolute;width:100%;background:silver;opacity:.4;filter:alpha(opacity=40);z-index:1;}.dhx_time_block_reset{opacity:1;filter:alpha(opacity=100);}.dhx_scheduler_month .dhx_marked_timespan{display:none;}.dhx_mini_calendar .dhx_marked_timespan{display:none;}.dhx_now_time{width:100%;border-bottom:2px dotted red;z-index:1;}.dhx_scheduler_month .dhx_now_time{border-bottom:0;border-left:2px dotted red;}.dhx_matrix_now_time{border-left:2px dotted red;z-index:1;}div.dhx_form_repeat input.radio{margin:-4px 0 0 -4px!ie;}div.dhx_form_repeat input.checkbox{margin:0 0 0 -4px!ie;}.dhx_form_repeat,.dhx_form_repeat input{padding:0;margin:0;padding-left:5px;font-family:Tahoma,Verdana;font-size:11px;line-height:24px;}.dhx_form_repeat{overflow:hidden;height:0;background-color:#FFF4B5;}.dhx_cal_light_wide .dhx_form_repeat{background-color:transparent;}.dhx_repeat_center,.dhx_repeat_left{height:115px;padding:10px 0 10px 10px;float:left;}.dhx_repeat_left{width:95px;}.dhx_repeat_center{width:335px;margin-top:12px;}.dhx_repeat_divider{float:left;height:115px;border-left:1px dotted #DCC43E;width:1px;}.dhx_repeat_right{float:right;height:115px;width:160px;padding:10px 3px 10px 10px;margin-top:7px;}input.dhx_repeat_text{height:16px;width:27px;margin:0 4px 0 4px;line-height:18px;padding:0 0 0 2px;}.dhx_form_repeat select{height:20px;width:87px;padding:0 0 0 2px;margin:0 4px 0 4px;}input.dhx_repeat_date{height:18px;width:80px;padding:0 0 0 2px;margin:0 4px 0 4px;background-repeat:no-repeat;background-position:64px 0;border:1px #7f9db9 solid;line-height:18px;}input.dhx_repeat_radio{margin-right:4px;}input.dhx_repeat_checkbox{margin:4px 4px 0 0;}.dhx_repeat_days td{padding-right:5px;}.dhx_repeat_days label{font-size:10px;}.dhx_custom_button{width:90px;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;}.dhx_custom_button_recurring{background-image:url(./imgs/but_repeat.gif);background-position:-5px 20px;width:20px;margin-right:10px;}.dhx_cal_light_rec{width:640px;}.dhx_cal_light_rec .dhx_cal_larea{width:632px;}.dhx_cal_light_rec.dhx_cal_light_wide{width:816px;}.dhx_cal_light_rec.dhx_cal_light_wide .dhx_cal_larea{width:808px;}
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler.js deleted file mode 100644 index 2c78468e81e..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler.js +++ /dev/null @@ -1,195 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -dhtmlx=function(a){for(var b in a)dhtmlx[b]=a[b];return dhtmlx}; -dhtmlx.extend_api=function(a,b,c){var d=window[a];if(d)window[a]=function(a){if(a&&typeof a=="object"&&!a.tagName&&!(a instanceof Array)){var c=d.apply(this,b._init?b._init(a):arguments),g;for(g in dhtmlx)if(b[g])this[b[g]](dhtmlx[g]);for(g in a)if(b[g])this[b[g]](a[g]);else g.indexOf("on")==0&&this.attachEvent(g,a[g])}else c=d.apply(this,arguments);b._patch&&b._patch(this);return c||this},window[a].prototype=d.prototype,c&&dhtmlXHeir(window[a].prototype,c)}; -dhtmlxAjax={get:function(a,b){var c=new dtmlXMLLoaderObject(!0);c.async=arguments.length<3;c.waitCall=b;c.loadXML(a);return c},post:function(a,b,c){var d=new dtmlXMLLoaderObject(!0);d.async=arguments.length<4;d.waitCall=c;d.loadXML(a,!0,b);return d},getSync:function(a){return this.get(a,null,!0)},postSync:function(a,b){return this.post(a,b,null,!0)}}; -function dtmlXMLLoaderObject(a,b,c,d){this.xmlDoc="";this.async=typeof c!="undefined"?c:!0;this.onloadAction=a||null;this.mainObject=b||null;this.waitCall=null;this.rSeed=d||!1;return this} -dtmlXMLLoaderObject.prototype.waitLoadFunction=function(a){var b=!0;return this.check=function(){if(a&&a.onloadAction!=null&&(!a.xmlDoc.readyState||a.xmlDoc.readyState==4)&&b){b=!1;if(typeof a.onloadAction=="function")a.onloadAction(a.mainObject,null,null,null,a);if(a.waitCall)a.waitCall.call(this,a),a.waitCall=null}}}; -dtmlXMLLoaderObject.prototype.getXMLTopNode=function(a,b){if(this.xmlDoc.responseXML){var c=this.xmlDoc.responseXML.getElementsByTagName(a);c.length==0&&a.indexOf(":")!=-1&&(c=this.xmlDoc.responseXML.getElementsByTagName(a.split(":")[1]));var d=c[0]}else d=this.xmlDoc.documentElement;if(d)return this._retry=!1,d;if(_isIE&&!this._retry){var e=this.xmlDoc.responseText,b=this.xmlDoc;this._retry=!0;this.xmlDoc=new ActiveXObject("Microsoft.XMLDOM");this.xmlDoc.async=!1;this.xmlDoc.loadXML(e);return this.getXMLTopNode(a, -b)}dhtmlxError.throwError("LoadXML","Incorrect XML",[b||this.xmlDoc,this.mainObject]);return document.createElement("DIV")};dtmlXMLLoaderObject.prototype.loadXMLString=function(a){try{var b=new DOMParser;this.xmlDoc=b.parseFromString(a,"text/xml")}catch(c){this.xmlDoc=new ActiveXObject("Microsoft.XMLDOM"),this.xmlDoc.async=this.async,this.xmlDoc.loadXML(a)}this.onloadAction(this.mainObject,null,null,null,this);if(this.waitCall)this.waitCall(),this.waitCall=null}; -dtmlXMLLoaderObject.prototype.loadXML=function(a,b,c,d){this.rSeed&&(a+=(a.indexOf("?")!=-1?"&":"?")+"a_dhx_rSeed="+(new Date).valueOf());this.filePath=a;this.xmlDoc=!_isIE&&window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");if(this.async)this.xmlDoc.onreadystatechange=new this.waitLoadFunction(this);this.xmlDoc.open(b?"POST":"GET",a,this.async);d?(this.xmlDoc.setRequestHeader("User-Agent","dhtmlxRPC v0.1 ("+navigator.userAgent+")"),this.xmlDoc.setRequestHeader("Content-type", -"text/xml")):b&&this.xmlDoc.setRequestHeader("Content-type","application/x-www-form-urlencoded");this.xmlDoc.setRequestHeader("X-Requested-With","XMLHttpRequest");this.xmlDoc.send(c);this.async||(new this.waitLoadFunction(this))()};dtmlXMLLoaderObject.prototype.destructor=function(){return this.xmlDoc=this.mainObject=this.onloadAction=null}; -dtmlXMLLoaderObject.prototype.xmlNodeToJSON=function(a){for(var b={},c=0;c<a.attributes.length;c++)b[a.attributes[c].name]=a.attributes[c].value;b._tagvalue=a.firstChild?a.firstChild.nodeValue:"";for(c=0;c<a.childNodes.length;c++){var d=a.childNodes[c].tagName;d&&(b[d]||(b[d]=[]),b[d].push(this.xmlNodeToJSON(a.childNodes[c])))}return b};function callerFunction(a,b){return this.handler=function(c){if(!c)c=window.event;a(c,b);return!0}}function getAbsoluteLeft(a){return getOffset(a).left} -function getAbsoluteTop(a){return getOffset(a).top}function getOffsetSum(a){for(var b=0,c=0;a;)b+=parseInt(a.offsetTop),c+=parseInt(a.offsetLeft),a=a.offsetParent;return{top:b,left:c}} -function getOffsetRect(a){var b=a.getBoundingClientRect(),c=document.body,d=document.documentElement,e=window.pageYOffset||d.scrollTop||c.scrollTop,f=window.pageXOffset||d.scrollLeft||c.scrollLeft,g=d.clientTop||c.clientTop||0,h=d.clientLeft||c.clientLeft||0,i=b.top+e-g,k=b.left+f-h;return{top:Math.round(i),left:Math.round(k)}}function getOffset(a){return a.getBoundingClientRect&&!_isChrome?getOffsetRect(a):getOffsetSum(a)} -function convertStringToBoolean(a){typeof a=="string"&&(a=a.toLowerCase());switch(a){case "1":case "true":case "yes":case "y":case 1:case !0:return!0;default:return!1}}function getUrlSymbol(a){return a.indexOf("?")!=-1?"&":"?"}function dhtmlDragAndDropObject(){if(window.dhtmlDragAndDrop)return window.dhtmlDragAndDrop;this.dragStartObject=this.dragStartNode=this.dragNode=this.lastLanding=0;this.tempDOMM=this.tempDOMU=null;this.waitDrag=0;window.dhtmlDragAndDrop=this;return this} -dhtmlDragAndDropObject.prototype.removeDraggableItem=function(a){a.onmousedown=null;a.dragStarter=null;a.dragLanding=null};dhtmlDragAndDropObject.prototype.addDraggableItem=function(a,b){a.onmousedown=this.preCreateDragCopy;a.dragStarter=b;this.addDragLanding(a,b)};dhtmlDragAndDropObject.prototype.addDragLanding=function(a,b){a.dragLanding=b}; -dhtmlDragAndDropObject.prototype.preCreateDragCopy=function(a){if(!((a||event)&&(a||event).button==2)){if(window.dhtmlDragAndDrop.waitDrag)return window.dhtmlDragAndDrop.waitDrag=0,document.body.onmouseup=window.dhtmlDragAndDrop.tempDOMU,document.body.onmousemove=window.dhtmlDragAndDrop.tempDOMM,!1;window.dhtmlDragAndDrop.waitDrag=1;window.dhtmlDragAndDrop.tempDOMU=document.body.onmouseup;window.dhtmlDragAndDrop.tempDOMM=document.body.onmousemove;window.dhtmlDragAndDrop.dragStartNode=this;window.dhtmlDragAndDrop.dragStartObject= -this.dragStarter;document.body.onmouseup=window.dhtmlDragAndDrop.preCreateDragCopy;document.body.onmousemove=window.dhtmlDragAndDrop.callDrag;window.dhtmlDragAndDrop.downtime=(new Date).valueOf();a&&a.preventDefault&&a.preventDefault();return!1}}; -dhtmlDragAndDropObject.prototype.callDrag=function(a){if(!a)a=window.event;dragger=window.dhtmlDragAndDrop;if(!((new Date).valueOf()-dragger.downtime<100)){if(a.button==0&&_isIE)return dragger.stopDrag();if(!dragger.dragNode&&dragger.waitDrag){dragger.dragNode=dragger.dragStartObject._createDragNode(dragger.dragStartNode,a);if(!dragger.dragNode)return dragger.stopDrag();dragger.dragNode.onselectstart=function(){return!1};dragger.gldragNode=dragger.dragNode;document.body.appendChild(dragger.dragNode); -document.body.onmouseup=dragger.stopDrag;dragger.waitDrag=0;dragger.dragNode.pWindow=window;dragger.initFrameRoute()}if(dragger.dragNode.parentNode!=window.document.body){var b=dragger.gldragNode;if(dragger.gldragNode.old)b=dragger.gldragNode.old;b.parentNode.removeChild(b);var c=dragger.dragNode.pWindow;if(_isIE){var d=document.createElement("Div");d.innerHTML=dragger.dragNode.outerHTML;dragger.dragNode=d.childNodes[0]}else dragger.dragNode=dragger.dragNode.cloneNode(!0);dragger.dragNode.pWindow= -window;dragger.gldragNode.old=dragger.dragNode;document.body.appendChild(dragger.dragNode);c.dhtmlDragAndDrop.dragNode=dragger.dragNode}dragger.dragNode.style.left=a.clientX+15+(dragger.fx?dragger.fx*-1:0)+(document.body.scrollLeft||document.documentElement.scrollLeft)+"px";dragger.dragNode.style.top=a.clientY+3+(dragger.fy?dragger.fy*-1:0)+(document.body.scrollTop||document.documentElement.scrollTop)+"px";var e=a.srcElement?a.srcElement:a.target;dragger.checkLanding(e,a)}}; -dhtmlDragAndDropObject.prototype.calculateFramePosition=function(a){if(window.name){for(var b=parent.frames[window.name].frameElement.offsetParent,c=0,d=0;b;)c+=b.offsetLeft,d+=b.offsetTop,b=b.offsetParent;if(parent.dhtmlDragAndDrop){var e=parent.dhtmlDragAndDrop.calculateFramePosition(1);c+=e.split("_")[0]*1;d+=e.split("_")[1]*1}if(a)return c+"_"+d;else this.fx=c;this.fy=d}return"0_0"}; -dhtmlDragAndDropObject.prototype.checkLanding=function(a,b){a&&a.dragLanding?(this.lastLanding&&this.lastLanding.dragLanding._dragOut(this.lastLanding),this.lastLanding=a,this.lastLanding=this.lastLanding.dragLanding._dragIn(this.lastLanding,this.dragStartNode,b.clientX,b.clientY,b),this.lastLanding_scr=_isIE?b.srcElement:b.target):a&&a.tagName!="BODY"?this.checkLanding(a.parentNode,b):(this.lastLanding&&this.lastLanding.dragLanding._dragOut(this.lastLanding,b.clientX,b.clientY,b),this.lastLanding= -0,this._onNotFound&&this._onNotFound())}; -dhtmlDragAndDropObject.prototype.stopDrag=function(a,b){dragger=window.dhtmlDragAndDrop;if(!b){dragger.stopFrameRoute();var c=dragger.lastLanding;dragger.lastLanding=null;c&&c.dragLanding._drag(dragger.dragStartNode,dragger.dragStartObject,c,_isIE?event.srcElement:a.target)}dragger.lastLanding=null;dragger.dragNode&&dragger.dragNode.parentNode==document.body&&dragger.dragNode.parentNode.removeChild(dragger.dragNode);dragger.dragNode=0;dragger.gldragNode=0;dragger.fx=0;dragger.fy=0;dragger.dragStartNode= -0;dragger.dragStartObject=0;document.body.onmouseup=dragger.tempDOMU;document.body.onmousemove=dragger.tempDOMM;dragger.tempDOMU=null;dragger.tempDOMM=null;dragger.waitDrag=0};dhtmlDragAndDropObject.prototype.stopFrameRoute=function(a){a&&window.dhtmlDragAndDrop.stopDrag(1,1);for(var b=0;b<window.frames.length;b++)try{window.frames[b]!=a&&window.frames[b].dhtmlDragAndDrop&&window.frames[b].dhtmlDragAndDrop.stopFrameRoute(window)}catch(c){}try{parent.dhtmlDragAndDrop&&parent!=window&&parent!=a&&parent.dhtmlDragAndDrop.stopFrameRoute(window)}catch(d){}}; -dhtmlDragAndDropObject.prototype.initFrameRoute=function(a,b){if(a)window.dhtmlDragAndDrop.preCreateDragCopy({}),window.dhtmlDragAndDrop.dragStartNode=a.dhtmlDragAndDrop.dragStartNode,window.dhtmlDragAndDrop.dragStartObject=a.dhtmlDragAndDrop.dragStartObject,window.dhtmlDragAndDrop.dragNode=a.dhtmlDragAndDrop.dragNode,window.dhtmlDragAndDrop.gldragNode=a.dhtmlDragAndDrop.dragNode,window.document.body.onmouseup=window.dhtmlDragAndDrop.stopDrag,window.waitDrag=0,!_isIE&&b&&(!_isFF||w<1.8)&&window.dhtmlDragAndDrop.calculateFramePosition(); -try{parent.dhtmlDragAndDrop&&parent!=window&&parent!=a&&parent.dhtmlDragAndDrop.initFrameRoute(window)}catch(c){}for(var d=0;d<window.frames.length;d++)try{window.frames[d]!=a&&window.frames[d].dhtmlDragAndDrop&&window.frames[d].dhtmlDragAndDrop.initFrameRoute(window,!a||b?1:0)}catch(e){}};w=_OperaRv=x=_isChrome=_isMacOS=_isKHTML=_isOpera=_isIE=_isFF=!1;navigator.userAgent.indexOf("Macintosh")!=-1&&(_isMacOS=!0);navigator.userAgent.toLowerCase().indexOf("chrome")>-1&&(_isChrome=!0); -if(navigator.userAgent.indexOf("Safari")!=-1||navigator.userAgent.indexOf("Konqueror")!=-1){var x=parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf("Safari")+7,5));if(x>525){_isFF=!0;var w=1.9}else _isKHTML=!0}else navigator.userAgent.indexOf("Opera")!=-1?(_isOpera=!0,_OperaRv=parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf("Opera")+6,3))):navigator.appName.indexOf("Microsoft")!=-1?(_isIE=!0,navigator.appVersion.indexOf("MSIE 8.0")!=-1&&document.compatMode!="BackCompat"&& -(_isIE=8)):(_isFF=!0,w=parseFloat(navigator.userAgent.split("rv:")[1])); -dtmlXMLLoaderObject.prototype.doXPath=function(a,b,c,d){if(_isKHTML||!_isIE&&!window.XPathResult)return this.doXPathOpera(a,b);if(_isIE)return b||(b=this.xmlDoc.nodeName?this.xmlDoc:this.xmlDoc.responseXML),b||dhtmlxError.throwError("LoadXML","Incorrect XML",[b||this.xmlDoc,this.mainObject]),c!=null&&b.setProperty("SelectionNamespaces","xmlns:xsl='"+c+"'"),d=="single"?b.selectSingleNode(a):b.selectNodes(a)||[];else{var e=b;b||(b=this.xmlDoc.nodeName?this.xmlDoc:this.xmlDoc.responseXML);b||dhtmlxError.throwError("LoadXML", -"Incorrect XML",[b||this.xmlDoc,this.mainObject]);b.nodeName.indexOf("document")!=-1?e=b:(e=b,b=b.ownerDocument);var f=XPathResult.ANY_TYPE;if(d=="single")f=XPathResult.FIRST_ORDERED_NODE_TYPE;var g=[],h=b.evaluate(a,e,function(){return c},f,null);if(f==XPathResult.FIRST_ORDERED_NODE_TYPE)return h.singleNodeValue;for(var i=h.iterateNext();i;)g[g.length]=i,i=h.iterateNext();return g}};function z(){if(!this.catches)this.catches=[];return this}z.prototype.catchError=function(a,b){this.catches[a]=b}; -z.prototype.throwError=function(a,b,c){if(this.catches[a])return this.catches[a](a,b,c);if(this.catches.ALL)return this.catches.ALL(a,b,c);alert("Error type: "+a+"\nDescription: "+b);return null};window.dhtmlxError=new z; -dtmlXMLLoaderObject.prototype.doXPathOpera=function(a,b){var c=a.replace(/[\/]+/gi,"/").split("/"),d=null,e=1;if(!c.length)return[];if(c[0]==".")d=[b];else if(c[0]=="")d=(this.xmlDoc.responseXML||this.xmlDoc).getElementsByTagName(c[e].replace(/\[[^\]]*\]/g,"")),e++;else return[];for(;e<c.length;e++)d=this._getAllNamedChilds(d,c[e]);c[e-1].indexOf("[")!=-1&&(d=this._filterXPath(d,c[e-1]));return d}; -dtmlXMLLoaderObject.prototype._filterXPath=function(a,b){for(var c=[],b=b.replace(/[^\[]*\[\@/g,"").replace(/[\[\]\@]*/g,""),d=0;d<a.length;d++)a[d].getAttribute(b)&&(c[c.length]=a[d]);return c}; -dtmlXMLLoaderObject.prototype._getAllNamedChilds=function(a,b){var c=[];_isKHTML&&(b=b.toUpperCase());for(var d=0;d<a.length;d++)for(var e=0;e<a[d].childNodes.length;e++)_isKHTML?a[d].childNodes[e].tagName&&a[d].childNodes[e].tagName.toUpperCase()==b&&(c[c.length]=a[d].childNodes[e]):a[d].childNodes[e].tagName==b&&(c[c.length]=a[d].childNodes[e]);return c};function dhtmlXHeir(a,b){for(var c in b)typeof b[c]=="function"&&(a[c]=b[c]);return a} -function dhtmlxEvent(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent&&a.attachEvent("on"+b,c)}dtmlXMLLoaderObject.prototype.xslDoc=null;dtmlXMLLoaderObject.prototype.setXSLParamValue=function(a,b,c){if(!c)c=this.xslDoc;if(c.responseXML)c=c.responseXML;var d=this.doXPath("/xsl:stylesheet/xsl:variable[@name='"+a+"']",c,"http://www.w3.org/1999/XSL/Transform","single");if(d!=null)d.firstChild.nodeValue=b}; -dtmlXMLLoaderObject.prototype.doXSLTransToObject=function(a,b){if(!a)a=this.xslDoc;if(a.responseXML)a=a.responseXML;if(!b)b=this.xmlDoc;if(b.responseXML)b=b.responseXML;if(_isIE){d=new ActiveXObject("Msxml2.DOMDocument.3.0");try{b.transformNodeToObject(a,d)}catch(c){d=b.transformNode(a)}}else{if(!this.XSLProcessor)this.XSLProcessor=new XSLTProcessor,this.XSLProcessor.importStylesheet(a);var d=this.XSLProcessor.transformToDocument(b)}return d}; -dtmlXMLLoaderObject.prototype.doXSLTransToString=function(a,b){var c=this.doXSLTransToObject(a,b);return typeof c=="string"?c:this.doSerialization(c)};dtmlXMLLoaderObject.prototype.doSerialization=function(a){if(!a)a=this.xmlDoc;if(a.responseXML)a=a.responseXML;if(_isIE)return a.xml;else{var b=new XMLSerializer;return b.serializeToString(a)}}; -dhtmlxEventable=function(a){a.dhx_SeverCatcherPath="";a.attachEvent=function(a,c,d){a="ev_"+a.toLowerCase();this[a]||(this[a]=new this.eventCatcher(d||this));return a+":"+this[a].addEvent(c)};a.callEvent=function(a,c){a="ev_"+a.toLowerCase();return this[a]?this[a].apply(this,c):!0};a.checkEvent=function(a){return!!this["ev_"+a.toLowerCase()]};a.eventCatcher=function(a){var c=[],d=function(){for(var d=!0,f=0;f<c.length;f++)if(c[f]!=null)var g=c[f].apply(a,arguments),d=d&&g;return d};d.addEvent=function(a){typeof a!= -"function"&&(a=eval(a));return a?c.push(a)-1:!1};d.removeEvent=function(a){c[a]=null};return d};a.detachEvent=function(a){if(a!=!1){var c=a.split(":");this[c[0]].removeEvent(c[1])}};a.detachAllEvents=function(){for(var a in this)a.indexOf("ev_")==0&&delete this[a]}}; -function dataProcessor(a){this.serverProcessor=a;this.action_param="!nativeeditor_status";this.object=null;this.updatedRows=[];this.autoUpdate=!0;this.updateMode="cell";this._tMode="GET";this.post_delim="_";this._waitMode=0;this._in_progress={};this._invalid={};this.mandatoryFields=[];this.messages=[];this.styles={updated:"font-weight:bold;",inserted:"font-weight:bold;",deleted:"text-decoration : line-through;",invalid:"background-color:FFE0E0;",invalid_cell:"border-bottom:2px solid red;",clear:"font-weight:normal;text-decoration:none;"}; -this.enableUTFencoding(!0);dhtmlxEventable(this);return this} -dataProcessor.prototype={setTransactionMode:function(a,b){this._tMode=a;this._tSend=b},escape:function(a){return this._utf?encodeURIComponent(a):escape(a)},enableUTFencoding:function(a){this._utf=convertStringToBoolean(a)},setDataColumns:function(a){this._columns=typeof a=="string"?a.split(","):a},getSyncState:function(){return!this.updatedRows.length},enableDataNames:function(a){this._endnm=convertStringToBoolean(a)},enablePartialDataSend:function(a){this._changed=convertStringToBoolean(a)},setUpdateMode:function(a, -b){this.autoUpdate=a=="cell";this.updateMode=a;this.dnd=b},ignore:function(a,b){this._silent_mode=!0;a.call(b||window);this._silent_mode=!1},setUpdated:function(a,b,c){if(!this._silent_mode){var d=this.findRow(a),c=c||"updated",e=this.obj.getUserData(a,this.action_param);e&&c=="updated"&&(c=e);b?(this.set_invalid(a,!1),this.updatedRows[d]=a,this.obj.setUserData(a,this.action_param,c),this._in_progress[a]&&(this._in_progress[a]="wait")):this.is_invalid(a)||(this.updatedRows.splice(d,1),this.obj.setUserData(a, -this.action_param,""));b||this._clearUpdateFlag(a);this.markRow(a,b,c);b&&this.autoUpdate&&this.sendData(a)}},_clearUpdateFlag:function(){},markRow:function(a,b,c){var d="",e=this.is_invalid(a);e&&(d=this.styles[e],b=!0);if(this.callEvent("onRowMark",[a,b,c,e])&&(d=this.styles[b?c:"clear"]+d,this.obj[this._methods[0]](a,d),e&&e.details)){d+=this.styles[e+"_cell"];for(var f=0;f<e.details.length;f++)if(e.details[f])this.obj[this._methods[1]](a,f,d)}},getState:function(a){return this.obj.getUserData(a, -this.action_param)},is_invalid:function(a){return this._invalid[a]},set_invalid:function(a,b,c){c&&(b={value:b,details:c,toString:function(){return this.value.toString()}});this._invalid[a]=b},checkBeforeUpdate:function(){return!0},sendData:function(a){if(!this._waitMode||!(this.obj.mytype=="tree"||this.obj._h2)){this.obj.editStop&&this.obj.editStop();if(typeof a=="undefined"||this._tSend)return this.sendAllData();if(this._in_progress[a])return!1;this.messages=[];if(!this.checkBeforeUpdate(a)&&this.callEvent("onValidatationError", -[a,this.messages]))return!1;this._beforeSendData(this._getRowData(a),a)}},_beforeSendData:function(a,b){if(!this.callEvent("onBeforeUpdate",[b,this.getState(b),a]))return!1;this._sendData(a,b)},serialize:function(a,b){if(typeof a=="string")return a;if(typeof b!="undefined")return this.serialize_one(a,"");else{var c=[],d=[],e;for(e in a)a.hasOwnProperty(e)&&(c.push(this.serialize_one(a[e],e+this.post_delim)),d.push(e));c.push("ids="+this.escape(d.join(",")));return c.join("&")}},serialize_one:function(a, -b){if(typeof a=="string")return a;var c=[],d;for(d in a)a.hasOwnProperty(d)&&c.push(this.escape((b||"")+d)+"="+this.escape(a[d]));return c.join("&")},_sendData:function(a,b){if(a){if(!this.callEvent("onBeforeDataSending",b?[b,this.getState(b),a]:[null,null,a]))return!1;b&&(this._in_progress[b]=(new Date).valueOf());var c=new dtmlXMLLoaderObject(this.afterUpdate,this,!0),d=this.serverProcessor+(this._user?getUrlSymbol(this.serverProcessor)+["dhx_user="+this._user,"dhx_version="+this.obj.getUserData(0, -"version")].join("&"):"");this._tMode!="POST"?c.loadXML(d+(d.indexOf("?")!=-1?"&":"?")+this.serialize(a,b)):c.loadXML(d,!0,this.serialize(a,b));this._waitMode++}},sendAllData:function(){if(this.updatedRows.length){this.messages=[];for(var a=!0,b=0;b<this.updatedRows.length;b++)a&=this.checkBeforeUpdate(this.updatedRows[b]);if(!a&&!this.callEvent("onValidatationError",["",this.messages]))return!1;if(this._tSend)this._sendData(this._getAllData());else for(b=0;b<this.updatedRows.length;b++)if(!this._in_progress[this.updatedRows[b]]&& -!this.is_invalid(this.updatedRows[b])&&(this._beforeSendData(this._getRowData(this.updatedRows[b]),this.updatedRows[b]),this._waitMode&&(this.obj.mytype=="tree"||this.obj._h2)))break}},_getAllData:function(){for(var a={},b=!1,c=0;c<this.updatedRows.length;c++){var d=this.updatedRows[c];!this._in_progress[d]&&!this.is_invalid(d)&&this.callEvent("onBeforeUpdate",[d,this.getState(d)])&&(a[d]=this._getRowData(d,d+this.post_delim),b=!0,this._in_progress[d]=(new Date).valueOf())}return b?a:null},setVerificator:function(a, -b){this.mandatoryFields[a]=b||function(a){return a!=""}},clearVerificator:function(a){this.mandatoryFields[a]=!1},findRow:function(a){for(var b=0,b=0;b<this.updatedRows.length;b++)if(a==this.updatedRows[b])break;return b},defineAction:function(a,b){if(!this._uActions)this._uActions=[];this._uActions[a]=b},afterUpdateCallback:function(a,b,c,d){var e=a,f=c!="error"&&c!="invalid";f||this.set_invalid(a,c);if(this._uActions&&this._uActions[c]&&!this._uActions[c](d))return delete this._in_progress[e];this._in_progress[e]!= -"wait"&&this.setUpdated(a,!1);var g=a;switch(c){case "update":case "updated":case "inserted":case "insert":b!=a&&(this.obj[this._methods[2]](a,b),a=b);break;case "delete":case "deleted":return this.obj.setUserData(a,this.action_param,"true_deleted"),this.obj[this._methods[3]](a),delete this._in_progress[e],this.callEvent("onAfterUpdate",[a,c,b,d])}this._in_progress[e]!="wait"?(f&&this.obj.setUserData(a,this.action_param,""),delete this._in_progress[e]):(delete this._in_progress[e],this.setUpdated(b, -!0,this.obj.getUserData(a,this.action_param)));this.callEvent("onAfterUpdate",[a,c,b,d])},afterUpdate:function(a,b,c,d,e){e.getXMLTopNode("data");if(e.xmlDoc.responseXML){for(var f=e.doXPath("//data/action"),g=0;g<f.length;g++){var h=f[g],i=h.getAttribute("type"),k=h.getAttribute("sid"),j=h.getAttribute("tid");a.afterUpdateCallback(k,j,i,h)}a.finalizeUpdate()}},finalizeUpdate:function(){this._waitMode&&this._waitMode--;(this.obj.mytype=="tree"||this.obj._h2)&&this.updatedRows.length&&this.sendData(); -this.callEvent("onAfterUpdateFinish",[]);this.updatedRows.length||this.callEvent("onFullSync",[])},init:function(a){this.obj=a;this.obj._dp_init&&this.obj._dp_init(this)},setOnAfterUpdate:function(a){this.attachEvent("onAfterUpdate",a)},enableDebug:function(){},setOnBeforeUpdateHandler:function(a){this.attachEvent("onBeforeDataSending",a)},setAutoUpdate:function(a,b){a=a||2E3;this._user=b||(new Date).valueOf();this._need_update=!1;this._loader=null;this._update_busy=!1;this.attachEvent("onAfterUpdate", -function(a,b,c,g){this.afterAutoUpdate(a,b,c,g)});this.attachEvent("onFullSync",function(){this.fullSync()});var c=this;window.setInterval(function(){c.loadUpdate()},a)},afterAutoUpdate:function(a,b){return b=="collision"?(this._need_update=!0,!1):!0},fullSync:function(){if(this._need_update==!0)this._need_update=!1,this.loadUpdate();return!0},getUpdates:function(a,b){if(this._update_busy)return!1;else this._update_busy=!0;this._loader=this._loader||new dtmlXMLLoaderObject(!0);this._loader.async= -!0;this._loader.waitCall=b;this._loader.loadXML(a)},_v:function(a){return a.firstChild?a.firstChild.nodeValue:""},_a:function(a){for(var b=[],c=0;c<a.length;c++)b[c]=this._v(a[c]);return b},loadUpdate:function(){var a=this,b=this.obj.getUserData(0,"version"),c=this.serverProcessor+getUrlSymbol(this.serverProcessor)+["dhx_user="+this._user,"dhx_version="+b].join("&"),c=c.replace("editing=true&","");this.getUpdates(c,function(){var b=a._loader.doXPath("//userdata");a.obj.setUserData(0,"version",a._v(b[0])); -var c=a._loader.doXPath("//update");if(c.length){a._silent_mode=!0;for(var f=0;f<c.length;f++){var g=c[f].getAttribute("status"),h=c[f].getAttribute("id"),i=c[f].getAttribute("parent");switch(g){case "inserted":a.callEvent("insertCallback",[c[f],h,i]);break;case "updated":a.callEvent("updateCallback",[c[f],h,i]);break;case "deleted":a.callEvent("deleteCallback",[c[f],h,i])}}a._silent_mode=!1}a._update_busy=!1;a=null})}}; -if(window.dhtmlXGridObject)dhtmlXGridObject.prototype._init_point_connector=dhtmlXGridObject.prototype._init_point,dhtmlXGridObject.prototype._init_point=function(){var a=function(a){a=a.replace(/(\?|\&)connector[^\f]*/g,"");return a+(a.indexOf("?")!=-1?"&":"?")+"connector=true"+(this.hdr.rows.length>0?"&dhx_no_header=1":"")},b=function(b){return a.call(this,b)+(this._connector_sorting||"")+(this._connector_filter||"")},c=function(a,c,d){this._connector_sorting="&dhx_sort["+c+"]="+d;return b.call(this, -a)},d=function(a,c,d){for(var h=0;h<c.length;h++)c[h]="dhx_filter["+c[h]+"]="+encodeURIComponent(d[h]);this._connector_filter="&"+c.join("&");return b.call(this,a)};this.attachEvent("onCollectValues",function(a){return this._con_f_used[a]?typeof this._con_f_used[a]=="object"?this._con_f_used[a]:!1:!0});this.attachEvent("onDynXLS",function(){this.xmlFileUrl=b.call(this,this.xmlFileUrl);return!0});this.attachEvent("onBeforeSorting",function(a,b,d){if(b=="connector"){var h=this;this.clearAndLoad(c.call(this, -this.xmlFileUrl,a,d),function(){h.setSortImgState(!0,a,d)});return!1}return!0});this.attachEvent("onFilterStart",function(a,b){return this._con_f_used.length?(this.clearAndLoad(d.call(this,this.xmlFileUrl,a,b)),!1):!0});this.attachEvent("onXLE",function(){});this._init_point_connector&&this._init_point_connector()},dhtmlXGridObject.prototype._con_f_used=[],dhtmlXGridObject.prototype._in_header_connector_text_filter=function(a,b){this._con_f_used[b]||(this._con_f_used[b]=1);return this._in_header_text_filter(a, -b)},dhtmlXGridObject.prototype._in_header_connector_select_filter=function(a,b){this._con_f_used[b]||(this._con_f_used[b]=2);return this._in_header_select_filter(a,b)},dhtmlXGridObject.prototype.load_connector=dhtmlXGridObject.prototype.load,dhtmlXGridObject.prototype.load=function(a,b,c){if(!this._colls_loaded&&this.cellType){for(var d=[],e=0;e<this.cellType.length;e++)(this.cellType[e].indexOf("co")==0||this._con_f_used[e]==2)&&d.push(e);d.length&&(arguments[0]+=(arguments[0].indexOf("?")!=-1?"&": -"?")+"connector=true&dhx_colls="+d.join(","))}return this.load_connector.apply(this,arguments)},dhtmlXGridObject.prototype._parseHead_connector=dhtmlXGridObject.prototype._parseHead,dhtmlXGridObject.prototype._parseHead=function(a,b,c){this._parseHead_connector.apply(this,arguments);if(!this._colls_loaded){for(var d=this.xmlLoader.doXPath("./coll_options",arguments[0]),e=0;e<d.length;e++){var f=d[e].getAttribute("for"),g=[],h=null;this.cellType[f]=="combo"&&(h=this.getColumnCombo(f));this.cellType[f].indexOf("co")== -0&&(h=this.getCombo(f));for(var i=this.xmlLoader.doXPath("./item",d[e]),k=0;k<i.length;k++){var j=i[k].getAttribute("value");if(h){var l=i[k].getAttribute("label")||j;h.addOption?h.addOption([[j,l]]):h.put(j,l);g[g.length]=l}else g[g.length]=j}this._con_f_used[f*1]&&(this._con_f_used[f*1]=g)}this._colls_loaded=!0}}; -if(window.dataProcessor)dataProcessor.prototype.init_original=dataProcessor.prototype.init,dataProcessor.prototype.init=function(a){this.init_original(a);a._dataprocessor=this;this.setTransactionMode("POST",!0);this.serverProcessor+=(this.serverProcessor.indexOf("?")!=-1?"&":"?")+"editing=true"};dhtmlxError.catchError("LoadXML",function(a,b,c){c[0].status!=0&&alert(c[0].responseText)});window.dhtmlXScheduler=window.scheduler={version:3};dhtmlxEventable(scheduler); -scheduler.init=function(a,b,c){b=b||new Date;c=c||"week";scheduler.date.init();this._obj=typeof a=="string"?document.getElementById(a):a;this._els=[];this._scroll=!0;this._quirks=_isIE&&document.compatMode=="BackCompat";this._quirks7=_isIE&&navigator.appVersion.indexOf("MSIE 8")==-1;this.get_elements();this.init_templates();this.set_actions();dhtmlxEvent(window,"resize",function(){window.clearTimeout(scheduler._resize_timer);scheduler._resize_timer=window.setTimeout(function(){scheduler.callEvent("onSchedulerResize", -[])&&scheduler.update_view()},100)});this.set_sizes();scheduler.callEvent("onSchedulerReady",[]);this.setCurrentView(b,c)};scheduler.xy={nav_height:22,min_event_height:40,scale_width:50,bar_height:20,scroll_width:18,scale_height:20,month_scale_height:20,menu_width:25,margin_top:0,margin_left:0,editor_width:140};scheduler.keys={edit_save:13,edit_cancel:27}; -scheduler.set_sizes=function(){var a=this._x=this._obj.clientWidth-this.xy.margin_left,b=this._y=this._obj.clientHeight-this.xy.margin_top,c=this._table_view?0:this.xy.scale_width+this.xy.scroll_width,d=this._table_view?-1:this.xy.scale_width;this.set_xy(this._els.dhx_cal_navline[0],a,this.xy.nav_height,0,0);this.set_xy(this._els.dhx_cal_header[0],a-c,this.xy.scale_height,d,this.xy.nav_height+(this._quirks?-1:1));var e=this._els.dhx_cal_navline[0].offsetHeight;if(e>0)this.xy.nav_height=e;var f=this.xy.scale_height+ -this.xy.nav_height+(this._quirks?-2:0);this.set_xy(this._els.dhx_cal_data[0],a,b-(f+2),0,f+2)};scheduler.set_xy=function(a,b,c,d,e){a.style.width=Math.max(0,b)+"px";a.style.height=Math.max(0,c)+"px";if(arguments.length>3)a.style.left=d+"px",a.style.top=e+"px"}; -scheduler.get_elements=function(){for(var a=this._obj.getElementsByTagName("DIV"),b=0;b<a.length;b++){var c=a[b].className;this._els[c]||(this._els[c]=[]);this._els[c].push(a[b]);var d=scheduler.locale.labels[a[b].getAttribute("name")||c];if(d)a[b].innerHTML=d}}; -scheduler.set_actions=function(){for(var a in this._els)if(this._click[a])for(var b=0;b<this._els[a].length;b++)this._els[a][b].onclick=scheduler._click[a];this._obj.onselectstart=function(){return!1};this._obj.onmousemove=function(a){scheduler._on_mouse_move(a||event)};this._obj.onmousedown=function(a){scheduler._on_mouse_down(a||event)};this._obj.onmouseup=function(a){scheduler._on_mouse_up(a||event)};this._obj.ondblclick=function(a){scheduler._on_dbl_click(a||event)}}; -scheduler.select=function(a){if(!this._table_view&&this.getEvent(a)._timed&&this._select_id!=a)this.editStop(!1),this.unselect(),this._select_id=a,this.updateEvent(a)};scheduler.unselect=function(a){if(!(a&&a!=this._select_id)){var b=this._select_id;this._select_id=null;b&&this.updateEvent(b)}};scheduler.getState=function(){return{mode:this._mode,date:this._date,min_date:this._min_date,max_date:this._max_date,editor_id:this._edit_id,lightbox_id:this._lightbox_id,new_event:this._new_event}}; -scheduler._click={dhx_cal_data:function(a){var b=a?a.target:event.srcElement,c=scheduler._locate_event(b),a=a||event;if(!(c&&!scheduler.callEvent("onClick",[c,a])||scheduler.config.readonly))if(c){scheduler.select(c);var d=b.className;if(d.indexOf("_icon")!=-1)scheduler._click.buttons[d.split(" ")[1].replace("icon_","")](c)}else scheduler._close_not_saved()},dhx_cal_prev_button:function(){scheduler._click.dhx_cal_next_button(0,-1)},dhx_cal_next_button:function(a,b){scheduler.setCurrentView(scheduler.date.add(scheduler.date[scheduler._mode+ -"_start"](scheduler._date),b||1,scheduler._mode))},dhx_cal_today_button:function(){scheduler.setCurrentView(new Date)},dhx_cal_tab:function(){var a=this.getAttribute("name"),b=a.substring(0,a.search("_tab"));scheduler.setCurrentView(scheduler._date,b)},buttons:{"delete":function(a){var b=scheduler.locale.labels.confirm_deleting;(!b||confirm(b))&&scheduler.deleteEvent(a)},edit:function(a){scheduler.edit(a)},save:function(){scheduler.editStop(!0)},details:function(a){scheduler.showLightbox(a)},cancel:function(){scheduler.editStop(!1)}}}; -scheduler.addEventNow=function(a,b,c){var d={};a&&a.constructor.toString().match(/object/i)!==null&&(d=a,a=null);var e=(this.config.event_duration||this.config.time_step)*6E4;a||(a=Math.round((new Date).valueOf()/e)*e);var f=new Date(a);if(!b){var g=this.config.first_hour;g>f.getHours()&&(f.setHours(g),a=f.valueOf());b=a+e}var h=new Date(b);f.valueOf()==h.valueOf()&&h.setTime(h.valueOf()+e);d.start_date=d.start_date||f;d.end_date=d.end_date||h;d.text=d.text||this.locale.labels.new_event;d.id=this._drag_id= -this.uid();this._drag_mode="new-size";this._loading=!0;this.addEvent(d);this.callEvent("onEventCreated",[this._drag_id,c]);this._loading=!1;this._drag_event={};this._on_mouse_up(c)}; -scheduler._on_dbl_click=function(a,b){b=b||a.target||a.srcElement;if(!this.config.readonly){var c=b.className.split(" ")[0];switch(c){case "dhx_scale_holder":case "dhx_scale_holder_now":case "dhx_month_body":case "dhx_wa_day_data":if(!scheduler.config.dblclick_create)break;var d=this._mouse_coords(a),e=this._min_date.valueOf()+(d.y*this.config.time_step+(this._table_view?0:d.x)*1440)*6E4,e=this._correct_shift(e);this.addEventNow(e,null,a);break;case "dhx_body":case "dhx_wa_ev_body":case "dhx_cal_event_line":case "dhx_cal_event_clear":var f= -this._locate_event(b);if(!this.callEvent("onDblClick",[f,a]))break;this.config.details_on_dblclick||this._table_view||!this.getEvent(f)._timed?this.showLightbox(f):this.edit(f);break;case "":if(b.parentNode)return scheduler._on_dbl_click(a,b.parentNode);default:var g=this["dblclick_"+c];g&&g.call(this,a)}}}; -scheduler._mouse_coords=function(a){var b,c=document.body,d=document.documentElement;b=a.pageX||a.pageY?{x:a.pageX,y:a.pageY}:{x:a.clientX+(c.scrollLeft||d.scrollLeft||0)-c.clientLeft,y:a.clientY+(c.scrollTop||d.scrollTop||0)-c.clientTop};b.x-=getAbsoluteLeft(this._obj)+(this._table_view?0:this.xy.scale_width);b.y-=getAbsoluteTop(this._obj)+this.xy.nav_height+(this._dy_shift||0)+this.xy.scale_height-this._els.dhx_cal_data[0].scrollTop;b.ev=a;var e=this["mouse_"+this._mode];if(e)return e.call(this, -b);if(this._table_view){for(var f=0,f=1;f<this._colsS.heights.length;f++)if(this._colsS.heights[f]>b.y)break;b.y=(Math.max(0,Math.ceil(b.x/this._cols[0])-1)+Math.max(0,f-1)*7)*1440/this.config.time_step;b.x=0}else b.x=Math.max(0,Math.ceil(b.x/this._cols[0])-1),b.y=Math.max(0,Math.ceil(b.y*60/(this.config.time_step*this.config.hour_size_px))-1)+this.config.first_hour*(60/this.config.time_step);return b}; -scheduler._close_not_saved=function(){if((new Date).valueOf()-(scheduler._new_event||0)>500&&scheduler._edit_id){var a=scheduler.locale.labels.confirm_closing;(!a||confirm(a))&&scheduler.editStop(scheduler.config.positive_closing)}};scheduler._correct_shift=function(a,b){return a-=((new Date(scheduler._min_date)).getTimezoneOffset()-(new Date(a)).getTimezoneOffset())*6E4*(b?-1:1)}; -scheduler._on_mouse_move=function(a){if(this._drag_mode){var b=this._mouse_coords(a);if(!this._drag_pos||b.custom||this._drag_pos.x!=b.x||this._drag_pos.y!=b.y){this._edit_id!=this._drag_id&&this._close_not_saved();this._drag_pos=b;if(this._drag_mode=="create"){this._close_not_saved();this._loading=!0;var c=this._min_date.valueOf()+(b.y*this.config.time_step+(this._table_view?0:b.x)*1440)*6E4,c=this._correct_shift(c);if(!this._drag_start){this._drag_start=c;return}var d=c;if(d==this._drag_start)return; -this._drag_id=this.uid();this.addEvent(new Date(this._drag_start),new Date(d),this.locale.labels.new_event,this._drag_id,b.fields);this.callEvent("onEventCreated",[this._drag_id,a]);this._loading=!1;this._drag_mode="new-size"}var e=this.getEvent(this._drag_id);if(this._drag_mode=="move")c=this._min_date.valueOf()+(b.y*this.config.time_step+b.x*1440)*6E4,!b.custom&&this._table_view&&(c+=this.date.time_part(e.start_date)*1E3),c=this._correct_shift(c),d=e.end_date.valueOf()-(e.start_date.valueOf()-c); -else{c=e.start_date.valueOf();if(this._table_view)d=this._min_date.valueOf()+b.y*this.config.time_step*6E4+(b.custom?0:864E5),this._mode=="month"&&(d=this._correct_shift(d,!1));else if(d=this.date.date_part(new Date(e.end_date)).valueOf()+b.y*this.config.time_step*6E4,this._els.dhx_cal_data[0].style.cursor="s-resize",this._mode=="week"||this._mode=="day")d=this._correct_shift(d);if(this._drag_mode=="new-size")if(d<=this._drag_start)var f=b.shift||(this._table_view&&!b.custom?864E5:0),c=d-(b.shift? -0:f),d=this._drag_start+(f||this.config.time_step*6E4);else c=this._drag_start;else d<=c&&(d=c+this.config.time_step*6E4)}var g=new Date(d-1),h=new Date(c);if(this._table_view||g.getDate()==h.getDate()&&g.getHours()<this.config.last_hour||scheduler._wa&&scheduler._wa._dnd)e.start_date=h,e.end_date=new Date(d),this.config.update_render?this.update_view():this.updateEvent(this._drag_id);this._table_view&&this.for_rendered(this._drag_id,function(a){a.className+=" dhx_in_move"})}}else if(scheduler.checkEvent("onMouseMove")){var i= -this._locate_event(a.target||a.srcElement);this.callEvent("onMouseMove",[i,a])}};scheduler._on_mouse_context=function(a,b){return this.callEvent("onContextMenu",[this._locate_event(b),a])}; -scheduler._on_mouse_down=function(a,b){if(!this.config.readonly&&!this._drag_mode){b=b||a.target||a.srcElement;if(a.button==2||a.ctrlKey)return this._on_mouse_context(a,b);switch(b.className.split(" ")[0]){case "dhx_cal_event_line":case "dhx_cal_event_clear":if(this._table_view)this._drag_mode="move";break;case "dhx_header":case "dhx_title":case "dhx_wa_ev_body":this._drag_mode="move";break;case "dhx_footer":this._drag_mode="resize";break;case "dhx_scale_holder":case "dhx_scale_holder_now":case "dhx_month_body":case "dhx_matrix_cell":this._drag_mode= -"create";break;case "":if(b.parentNode)return scheduler._on_mouse_down(a,b.parentNode);default:this._drag_id=this._drag_mode=null}if(this._drag_mode){var c=this._locate_event(b);!this.config["drag_"+this._drag_mode]||!this.callEvent("onBeforeDrag",[c,this._drag_mode,a])?this._drag_mode=this._drag_id=0:(this._drag_id=c,this._drag_event=scheduler._lame_copy({},this._copy_event(this.getEvent(this._drag_id)||{})))}this._drag_start=null}}; -scheduler._on_mouse_up=function(a){if(this._drag_mode&&this._drag_id){this._els.dhx_cal_data[0].style.cursor="default";var b=this.getEvent(this._drag_id);if(this._drag_event._dhx_changed||!this._drag_event.start_date||b.start_date.valueOf()!=this._drag_event.start_date.valueOf()||b.end_date.valueOf()!=this._drag_event.end_date.valueOf()){var c=this._drag_mode=="new-size";if(this.callEvent("onBeforeEventChanged",[b,a,c]))if(c&&this.config.edit_on_create){this.unselect();this._new_event=new Date;if(this._table_view|| -this.config.details_on_create)return this._drag_mode=null,this.showLightbox(this._drag_id);this._drag_pos=!0;this._select_id=this._edit_id=this._drag_id}else this._new_event||this.callEvent(c?"onEventAdded":"onEventChanged",[this._drag_id,this.getEvent(this._drag_id)]);else c?this.deleteEvent(b.id,!0):(this._drag_event._dhx_changed=!1,scheduler._lame_copy(b,this._drag_event),this.updateEvent(b.id))}this._drag_pos&&this.render_view_data()}this._drag_pos=this._drag_mode=null}; -scheduler.update_view=function(){this._reset_scale();if(this._load_mode&&this._load())return this._render_wait=!0;this.render_view_data()}; -scheduler.setCurrentView=function(a,b){a=a||this._date;b=b||this._mode;if(this.callEvent("onBeforeViewChange",[this._mode,this._date,b,a])){var c="dhx_cal_data",d=this._mode==b&&this.config.preserve_scroll?this._els[c][0].scrollTop:!1;if(this[this._mode+"_view"]&&b&&this._mode!=b)this[this._mode+"_view"](!1);this._close_not_saved();var e="dhx_multi_day";this._els[e]&&(this._els[e][0].parentNode.removeChild(this._els[e][0]),this._els[e]=null);this._mode=b;this._date=a;this._table_view=this._mode== -"month";for(var f=this._els.dhx_cal_tab,g=0;g<f.length;g++)f[g].className="dhx_cal_tab"+(f[g].getAttribute("name")==this._mode+"_tab"?" active":"");var h=this[this._mode+"_view"];h?h(!0):this.update_view();if(typeof d=="number")this._els[c][0].scrollTop=d;this.callEvent("onViewChange",[this._mode,this._date])}}; -scheduler._render_x_header=function(a,b,c,d){var e=document.createElement("DIV");e.className="dhx_scale_bar";this.set_xy(e,this._cols[a]-1,this.xy.scale_height-2,b,0);e.innerHTML=this.templates[this._mode+"_scale_date"](c,this._mode);d.appendChild(e)}; -scheduler._reset_scale=function(){if(this.templates[this._mode+"_date"]){var a=this._els.dhx_cal_header[0],b=this._els.dhx_cal_data[0],c=this.config;a.innerHTML="";b.scrollTop=0;b.innerHTML="";var d=(c.readonly||!c.drag_resize?" dhx_resize_denied":"")+(c.readonly||!c.drag_move?" dhx_move_denied":"");if(d)b.className="dhx_cal_data"+d;this._cols=[];this._colsS={height:0};this._dy_shift=0;this.set_sizes();var e=parseInt(a.style.width),f=0,g,h,i,k;h=this.date[this._mode+"_start"](new Date(this._date.valueOf())); -g=i=this._table_view?scheduler.date.week_start(h):h;k=this.date.date_part(new Date);var j=scheduler.date.add(h,1,this._mode),l=7;if(!this._table_view){var o=this.date["get_"+this._mode+"_end"];o&&(j=o(h));l=Math.round((j.valueOf()-h.valueOf())/864E5)}this._min_date=g;this._els.dhx_cal_date[0].innerHTML=this.templates[this._mode+"_date"](h,j,this._mode);for(var m=0;m<l;m++){this._cols[m]=Math.floor(e/(l-m));this._render_x_header(m,f,g,a);if(!this._table_view){var n=document.createElement("DIV"),p= -"dhx_scale_holder";g.valueOf()==k.valueOf()&&(p="dhx_scale_holder_now");n.className=p+" "+this.templates.week_date_class(g,k);this.set_xy(n,this._cols[m]-1,c.hour_size_px*(c.last_hour-c.first_hour),f+this.xy.scale_width+1,0);b.appendChild(n);this.callEvent("onScaleAdd",[n,g])}g=this.date.add(g,1,"day");e-=this._cols[m];f+=this._cols[m];this._colsS[m]=(this._cols[m-1]||0)+(this._colsS[m-1]||(this._table_view?0:this.xy.scale_width+2));this._colsS.col_length=l+1}this._max_date=g;this._colsS[l]=this._cols[l- -1]+this._colsS[l-1];if(this._table_view)this._reset_month_scale(b,h,i);else{this._reset_hours_scale(b,h,i);if(c.multi_day){var q="dhx_multi_day";this._els[q]&&(this._els[q][0].parentNode.removeChild(this._els[q][0]),this._els[q]=null);var v=this._els.dhx_cal_navline[0],s=v.offsetHeight+this._els.dhx_cal_header[0].offsetHeight+1,r=document.createElement("DIV");r.className=q;r.style.visibility="hidden";this.set_xy(r,this._colsS[this._colsS.col_length-1]+this.xy.scroll_width,0,0,s);b.parentNode.insertBefore(r, -b);var u=r.cloneNode(!0);u.className=q+"_icon";u.style.visibility="hidden";this.set_xy(u,this.xy.scale_width,0,0,s);r.appendChild(u);this._els[q]=[r,u];this._els[q][0].onclick=this._click.dhx_cal_data}if(this.config.mark_now){var t=new Date;if(t<this._max_date&&t>this._min_date&&t.getHours()>=this.config.first_hour&&t.getHours()<this.config.last_hour){var A=this.locate_holder_day(t),B=t.getHours()*60+t.getMinutes(),y=document.createElement("DIV");y.className="dhx_now_time";y.style.top=Math.round((B* -6E4-this.config.first_hour*36E5)*this.config.hour_size_px/36E5)%(this.config.hour_size_px*24)+1+"px";b.childNodes[A].appendChild(y)}}}}}; -scheduler._reset_hours_scale=function(a){var b=document.createElement("DIV");b.className="dhx_scale_holder";for(var c=new Date(1980,1,1,this.config.first_hour,0,0),d=this.config.first_hour*1;d<this.config.last_hour;d++){var e=document.createElement("DIV");e.className="dhx_scale_hour";e.style.height=this.config.hour_size_px-(this._quirks?0:1)+"px";e.style.width=this.xy.scale_width+"px";e.innerHTML=scheduler.templates.hour_scale(c);b.appendChild(e);c=this.date.add(c,1,"hour")}a.appendChild(b);if(this.config.scroll_hour)a.scrollTop= -this.config.hour_size_px*(this.config.scroll_hour-this.config.first_hour)}; -scheduler._reset_month_scale=function(a,b,c){var d=scheduler.date.add(b,1,"month"),e=new Date;this.date.date_part(e);this.date.date_part(c);var f=Math.ceil(Math.round((d.valueOf()-c.valueOf())/864E5)/7),g=[],h=Math.floor(a.clientHeight/f)-22;this._colsS.height=h+22;for(var i=this._colsS.heights=[],k=0;k<=7;k++)g[k]=" style='height:"+h+"px; width:"+((this._cols[k]||0)-1)+"px;' ";var j=0;this._min_date=c;for(var l="<table cellpadding='0' cellspacing='0'>",k=0;k<f;k++){l+="<tr>";for(var o=0;o<7;o++){l+= -"<td";var m="";c<b?m="dhx_before":c>=d?m="dhx_after":c.valueOf()==e.valueOf()&&(m="dhx_now");l+=" class='"+m+" "+this.templates.month_date_class(c,e)+"' ";l+="><div class='dhx_month_head'>"+this.templates.month_day(c)+"</div><div class='dhx_month_body' "+g[o]+"></div></td>";c=this.date.add(c,1,"day")}l+="</tr>";i[k]=j;j+=this._colsS.height}l+="</table>";this._max_date=c;a.innerHTML=l;return c}; -scheduler.getLabel=function(a,b){for(var c=this.config.lightbox.sections,d=0;d<c.length;d++)if(c[d].map_to==a)for(var e=c[d].options,f=0;f<e.length;f++)if(e[f].key==b)return e[f].label;return""};scheduler.updateCollection=function(a,b){var c=scheduler.serverList(a);if(!c)return!1;c.splice(0,c.length);c.push.apply(c,b||[]);scheduler.callEvent("onOptionsLoad",[]);scheduler.resetLightbox();return!0};scheduler._lame_copy=function(a,b){for(var c in b)a[c]=b[c];return a}; -scheduler.date={init:function(){for(var a=scheduler.locale.date.month_short,b=scheduler.locale.date.month_short_hash={},c=0;c<a.length;c++)b[a[c]]=c;a=scheduler.locale.date.month_full;b=scheduler.locale.date.month_full_hash={};for(c=0;c<a.length;c++)b[a[c]]=c},date_part:function(a){a.setHours(0);a.setMinutes(0);a.setSeconds(0);a.setMilliseconds(0);return a},time_part:function(a){return(a.valueOf()/1E3-a.getTimezoneOffset()*60)%86400},week_start:function(a){var b=a.getDay();scheduler.config.start_on_monday&& -(b===0?b=6:b--);return this.date_part(this.add(a,-1*b,"day"))},month_start:function(a){a.setDate(1);return this.date_part(a)},year_start:function(a){a.setMonth(0);return this.month_start(a)},day_start:function(a){return this.date_part(a)},add:function(a,b,c){var d=new Date(a.valueOf());switch(c){case "day":d.setDate(d.getDate()+b);if(a.getDate()==d.getDate()&&b){do d.setTime(d.getTime()+36E5);while(a.getDate()==d.getDate())}break;case "week":d.setDate(d.getDate()+7*b);break;case "month":d.setMonth(d.getMonth()+ -b);break;case "year":d.setYear(d.getFullYear()+b);break;case "hour":d.setHours(d.getHours()+b);break;case "minute":d.setMinutes(d.getMinutes()+b);break;default:return scheduler.date["add_"+c](a,b,c)}return d},to_fixed:function(a){return a<10?"0"+a:a},copy:function(a){return new Date(a.valueOf())},date_to_str:function(a,b){a=a.replace(/%[a-zA-Z]/g,function(a){switch(a){case "%d":return'"+scheduler.date.to_fixed(date.getDate())+"';case "%m":return'"+scheduler.date.to_fixed((date.getMonth()+1))+"';case "%j":return'"+date.getDate()+"'; -case "%n":return'"+(date.getMonth()+1)+"';case "%y":return'"+scheduler.date.to_fixed(date.getFullYear()%100)+"';case "%Y":return'"+date.getFullYear()+"';case "%D":return'"+scheduler.locale.date.day_short[date.getDay()]+"';case "%l":return'"+scheduler.locale.date.day_full[date.getDay()]+"';case "%M":return'"+scheduler.locale.date.month_short[date.getMonth()]+"';case "%F":return'"+scheduler.locale.date.month_full[date.getMonth()]+"';case "%h":return'"+scheduler.date.to_fixed((date.getHours()+11)%12+1)+"'; -case "%g":return'"+((date.getHours()+11)%12+1)+"';case "%G":return'"+date.getHours()+"';case "%H":return'"+scheduler.date.to_fixed(date.getHours())+"';case "%i":return'"+scheduler.date.to_fixed(date.getMinutes())+"';case "%a":return'"+(date.getHours()>11?"pm":"am")+"';case "%A":return'"+(date.getHours()>11?"PM":"AM")+"';case "%s":return'"+scheduler.date.to_fixed(date.getSeconds())+"';case "%W":return'"+scheduler.date.to_fixed(scheduler.date.getISOWeek(date))+"';default:return a}});b&&(a=a.replace(/date\.get/g, -"date.getUTC"));return new Function("date",'return "'+a+'";')},str_to_date:function(a,b){for(var c="var temp=date.split(/[^0-9a-zA-Z]+/g);",d=a.match(/%[a-zA-Z]/g),e=0;e<d.length;e++)switch(d[e]){case "%j":case "%d":c+="set[2]=temp["+e+"]||1;";break;case "%n":case "%m":c+="set[1]=(temp["+e+"]||1)-1;";break;case "%y":c+="set[0]=temp["+e+"]*1+(temp["+e+"]>50?1900:2000);";break;case "%g":case "%G":case "%h":case "%H":c+="set[3]=temp["+e+"]||0;";break;case "%i":c+="set[4]=temp["+e+"]||0;";break;case "%Y":c+= -"set[0]=temp["+e+"]||0;";break;case "%a":case "%A":c+="set[3]=set[3]%12+((temp["+e+"]||'').toLowerCase()=='am'?0:12);";break;case "%s":c+="set[5]=temp["+e+"]||0;";break;case "%M":c+="set[1]=scheduler.locale.date.month_short_hash[temp["+e+"]]||0;";break;case "%F":c+="set[1]=scheduler.locale.date.month_full_hash[temp["+e+"]]||0;"}var f="set[0],set[1],set[2],set[3],set[4],set[5]";b&&(f=" Date.UTC("+f+")");return new Function("date","var set=[0,0,1,0,0,0]; "+c+" return new Date("+f+");")},getISOWeek:function(a){if(!a)return!1; -var b=a.getDay();b===0&&(b=7);var c=new Date(a.valueOf());c.setDate(a.getDate()+(4-b));var d=c.getFullYear(),e=Math.round((c.getTime()-(new Date(d,0,1)).getTime())/864E5),f=1+Math.floor(e/7);return f},getUTCISOWeek:function(a){return this.getISOWeek(a)}}; -scheduler.locale={date:{month_full:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),month_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),day_full:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")},labels:{dhx_cal_today_button:"Today",day_tab:"Day",week_tab:"Week",month_tab:"Month",new_event:"New event",icon_save:"Save",icon_cancel:"Cancel",icon_details:"Details", -icon_edit:"Edit",icon_delete:"Delete",confirm_closing:"",confirm_deleting:"Event will be deleted permanently, are you sure?",section_description:"Description",section_time:"Time period",full_day:"Full day",confirm_recurring:"Do you want to edit the whole set of repeated events?",section_recurring:"Repeat event",button_recurring:"Disabled",button_recurring_open:"Enabled",agenda_tab:"Agenda",date:"Date",description:"Description",year_tab:"Year",week_agenda_tab:"Agenda"}}; -scheduler.config={default_date:"%j %M %Y",month_date:"%F %Y",load_date:"%Y-%m-%d",week_date:"%l",day_date:"%D, %F %j",hour_date:"%H:%i",month_day:"%d",xml_date:"%m/%d/%Y %H:%i",api_date:"%d-%m-%Y %H:%i",hour_size_px:42,time_step:5,start_on_monday:1,first_hour:0,last_hour:24,readonly:!1,drag_resize:1,drag_move:1,drag_create:1,dblclick_create:1,edit_on_create:1,details_on_create:0,click_form_details:0,cascade_event_display:!1,cascade_event_count:4,cascade_event_margin:30,drag_lightbox:!0,preserve_scroll:!0, -server_utc:!1,positive_closing:!1,icons_edit:["icon_save","icon_cancel"],icons_select:["icon_details","icon_edit","icon_delete"],buttons_left:["dhx_save_btn","dhx_cancel_btn"],buttons_right:["dhx_delete_btn"],lightbox:{sections:[{name:"description",height:200,map_to:"text",type:"textarea",focus:!0},{name:"time",height:72,type:"time",map_to:"auto"}]},repeat_date_of_end:"01.01.2010"};scheduler.templates={}; -scheduler.init_templates=function(){var a=scheduler.date.date_to_str,b=scheduler.config,c=function(a,b){for(var c in b)a[c]||(a[c]=b[c])};c(scheduler.templates,{day_date:a(b.default_date),month_date:a(b.month_date),week_date:function(a,b){return scheduler.templates.day_date(a)+" – "+scheduler.templates.day_date(scheduler.date.add(b,-1,"day"))},day_scale_date:a(b.default_date),month_scale_date:a(b.week_date),week_scale_date:a(b.day_date),hour_scale:a(b.hour_date),time_picker:a(b.hour_date),event_date:a(b.hour_date), -month_day:a(b.month_day),xml_date:scheduler.date.str_to_date(b.xml_date,b.server_utc),load_format:a(b.load_date,b.server_utc),xml_format:a(b.xml_date,b.server_utc),api_date:scheduler.date.str_to_date(b.api_date),event_header:function(a,b){return scheduler.templates.event_date(a)+" - "+scheduler.templates.event_date(b)},event_text:function(a,b,c){return c.text},event_class:function(){return""},month_date_class:function(){return""},week_date_class:function(){return""},event_bar_date:function(a){return scheduler.templates.event_date(a)+ -" "},event_bar_text:function(a,b,c){return c.text}});this.callEvent("onTemplatesReady",[])};scheduler.uid=function(){if(!this._seed)this._seed=(new Date).valueOf();return this._seed++};scheduler._events={};scheduler.clearAll=function(){this._events={};this._loaded={};this.clear_view()}; -scheduler.addEvent=function(a,b,c,d,e){if(!arguments.length)return this.addEventNow();var f=a;if(arguments.length!=1)f=e||{},f.start_date=a,f.end_date=b,f.text=c,f.id=d;f.id=f.id||scheduler.uid();f.text=f.text||"";if(typeof f.start_date=="string")f.start_date=this.templates.api_date(f.start_date);if(typeof f.end_date=="string")f.end_date=this.templates.api_date(f.end_date);var g=(this.config.event_duration||this.config.time_step)*6E4;f.start_date.valueOf()==f.end_date.valueOf()&&f.end_date.setTime(f.end_date.valueOf()+ -g);f._timed=this.is_one_day_event(f);var h=!this._events[f.id];this._events[f.id]=f;this.event_updated(f);this._loading||this.callEvent(h?"onEventAdded":"onEventChanged",[f.id,f])};scheduler.deleteEvent=function(a,b){var c=this._events[a];if(b||this.callEvent("onBeforeEventDelete",[a,c])&&this.callEvent("onConfirmedBeforeEventDelete",[a,c]))c&&(delete this._events[a],this.unselect(a),this.event_updated(c)),this.callEvent("onEventDeleted",[a])};scheduler.getEvent=function(a){return this._events[a]}; -scheduler.setEvent=function(a,b){this._events[a]=b};scheduler.for_rendered=function(a,b){for(var c=this._rendered.length-1;c>=0;c--)this._rendered[c].getAttribute("event_id")==a&&b(this._rendered[c],c)};scheduler.changeEventId=function(a,b){if(a!=b){var c=this._events[a];if(c)c.id=b,this._events[b]=c,delete this._events[a];this.for_rendered(a,function(a){a.setAttribute("event_id",b)});if(this._select_id==a)this._select_id=b;if(this._edit_id==a)this._edit_id=b;this.callEvent("onEventIdChange",[a,b])}}; -(function(){for(var a="text,Text,start_date,StartDate,end_date,EndDate".split(","),b=function(a){return function(b){return scheduler.getEvent(b)[a]}},c=function(a){return function(b,c){var d=scheduler.getEvent(b);d[a]=c;d._changed=!0;d._timed=this.is_one_day_event(d);scheduler.event_updated(d,!0)}},d=0;d<a.length;d+=2)scheduler["getEvent"+a[d+1]]=b(a[d]),scheduler["setEvent"+a[d+1]]=c(a[d])})();scheduler.event_updated=function(a){this.is_visible_events(a)?this.render_view_data():this.clear_event(a.id)}; -scheduler.is_visible_events=function(a){return a.start_date<this._max_date&&this._min_date<a.end_date};scheduler.is_one_day_event=function(a){var b=a.end_date.getDate()-a.start_date.getDate();return b?(b<0&&(b=Math.ceil((a.end_date.valueOf()-a.start_date.valueOf())/864E5)),b==1&&!a.end_date.getHours()&&!a.end_date.getMinutes()&&(a.start_date.getHours()||a.start_date.getMinutes())):a.start_date.getMonth()==a.end_date.getMonth()&&a.start_date.getFullYear()==a.end_date.getFullYear()}; -scheduler.get_visible_events=function(){var a=[],b=this["filter_"+this._mode],c;for(c in this._events)if(this.is_visible_events(this._events[c])&&(this._table_view||this.config.multi_day||this._events[c]._timed))(!b||b(c,this._events[c]))&&a.push(this._events[c]);return a}; -scheduler.render_view_data=function(a,b){if(!a){if(this._not_render){this._render_wait=!0;return}this._render_wait=!1;this.clear_view();a=this.get_visible_events()}if(this.config.multi_day&&!this._table_view){for(var c=[],d=[],e=0;e<a.length;e++)a[e]._timed?c.push(a[e]):d.push(a[e]);this._rendered_location=this._els.dhx_multi_day[0];this._table_view=!0;this.render_data(d,b);this._table_view=!1;this._rendered_location=this._els.dhx_cal_data[0];this._table_view=!1;this.render_data(c,b)}else this._rendered_location= -this._els.dhx_cal_data[0],this.render_data(a,b)};scheduler.render_data=function(a,b){for(var a=this._pre_render_events(a,b),c=0;c<a.length;c++)this._table_view?this.render_event_bar(a[c]):this.render_event(a[c])}; -scheduler._pre_render_events=function(a,b){var c=this.xy.bar_height,d=this._colsS.heights,e=this._colsS.heights=[0,0,0,0,0,0,0],f=this._els.dhx_cal_data[0],a=this._table_view?this._pre_render_events_table(a,b):this._pre_render_events_line(a,b);if(this._table_view)if(b)this._colsS.heights=d;else{var g=f.firstChild;if(g.rows){for(var h=0;h<g.rows.length;h++){e[h]++;if(e[h]*c>this._colsS.height-22){for(var i=g.rows[h].cells,k=0;k<i.length;k++)i[k].childNodes[1].style.height=e[h]*c+"px";e[h]=(e[h-1]|| -0)+i[0].offsetHeight}e[h]=(e[h-1]||0)+g.rows[h].cells[0].offsetHeight}e.unshift(0);if(g.parentNode.offsetHeight<g.parentNode.scrollHeight&&!g._h_fix){for(h=0;h<g.rows.length;h++){var j=g.rows[h].cells[6].childNodes[0],l=j.offsetWidth-scheduler.xy.scroll_width+"px";j.style.width=l;j.nextSibling.style.width=l}g._h_fix=!0}}else if(!a.length&&this._els.dhx_multi_day[0].style.visibility=="visible"&&(e[0]=-1),a.length||e[0]==-1){var o=g.parentNode.childNodes,m=(e[0]+1)*c+1+"px";f.style.top=this._els.dhx_cal_navline[0].offsetHeight+ -this._els.dhx_cal_header[0].offsetHeight+parseInt(m)+"px";f.style.height=this._obj.offsetHeight-parseInt(f.style.top)-(this.xy.margin_top||0)+"px";var n=this._els.dhx_multi_day[0];n.style.height=m;n.style.visibility=e[0]==-1?"hidden":"visible";n=this._els.dhx_multi_day[1];n.style.height=m;n.style.visibility=e[0]==-1?"hidden":"visible";n.className=e[0]?"dhx_multi_day_icon":"dhx_multi_day_icon_small";this._dy_shift=(e[0]+1)*c;e[0]=0}}return a}; -scheduler._get_event_sday=function(a){return Math.floor((a.start_date.valueOf()-this._min_date.valueOf())/864E5)}; -scheduler._pre_render_events_line=function(a,b){a.sort(function(a,b){return a.start_date.valueOf()==b.start_date.valueOf()?a.id>b.id?1:-1:a.start_date>b.start_date?1:-1});for(var c=[],d=[],e=0;e<a.length;e++){var f=a[e],g=f.start_date.getHours(),h=f.end_date.getHours();f._sday=this._get_event_sday(f);c[f._sday]||(c[f._sday]=[]);if(!b){f._inner=!1;for(var i=c[f._sday];i.length&&i[i.length-1].end_date<=f.start_date;)i.splice(i.length-1,1);for(var k=!1,j=0;j<i.length;j++)if(i[j].end_date.valueOf()<f.start_date.valueOf()){k= -!0;f._sorder=i[j]._sorder;i.splice(j,1);f._inner=!0;break}if(i.length)i[i.length-1]._inner=!0;if(!k)if(i.length)if(i.length<=i[i.length-1]._sorder){if(i[i.length-1]._sorder)for(j=0;j<i.length;j++){var l=!1;for(k=0;k<i.length;k++)if(i[k]._sorder==j){l=!0;break}if(!l){f._sorder=j;break}}else f._sorder=0;f._inner=!0}else{l=i[0]._sorder;for(j=1;j<i.length;j++)if(i[j]._sorder>l)l=i[j]._sorder;f._sorder=l+1;f._inner=!1}else f._sorder=0;i.push(f);i.length>(i.max_count||0)?(i.max_count=i.length,f._count= -i.length):f._count=f._count?f._count:1}if(g<this.config.first_hour||h>=this.config.last_hour)if(d.push(f),a[e]=f=this._copy_event(f),g<this.config.first_hour&&(f.start_date.setHours(this.config.first_hour),f.start_date.setMinutes(0)),h>=this.config.last_hour&&(f.end_date.setMinutes(0),f.end_date.setHours(this.config.last_hour)),f.start_date>f.end_date||g==this.config.last_hour)a.splice(e,1),e--}if(!b){for(e=0;e<a.length;e++)a[e]._count=c[a[e]._sday].max_count;for(e=0;e<d.length;e++)d[e]._count=c[d[e]._sday].max_count}return a}; -scheduler._time_order=function(a){a.sort(function(a,c){return a.start_date.valueOf()==c.start_date.valueOf()?a._timed&&!c._timed?1:!a._timed&&c._timed?-1:a.id>c.id?1:-1:a.start_date>c.start_date?1:-1})}; -scheduler._pre_render_events_table=function(a,b){this._time_order(a);for(var c=[],d=[[],[],[],[],[],[],[]],e=this._colsS.heights,f,g=this._cols.length,h=0;h<a.length;h++){var i=a[h],k=f||i.start_date,j=i.end_date;if(k<this._min_date)k=this._min_date;if(j>this._max_date)j=this._max_date;var l=this.locate_holder_day(k,!1,i);i._sday=l%g;var o=this.locate_holder_day(j,!0,i)||g;i._eday=o%g||g;i._length=o-l;i._sweek=Math.floor((this._correct_shift(k.valueOf(),1)-this._min_date.valueOf())/(864E5*g));var m= -d[i._sweek],n;for(n=0;n<m.length;n++)if(m[n]._eday<=i._sday)break;if(!i._sorder||!b)i._sorder=n;if(i._sday+i._length<=g)f=null,c.push(i),m[n]=i,e[i._sweek]=m.length-1;else{var p=this._copy_event(i);p._length=g-i._sday;p._eday=g;p._sday=i._sday;p._sweek=i._sweek;p._sorder=i._sorder;p.end_date=this.date.add(k,p._length,"day");c.push(p);m[n]=p;f=p.end_date;e[i._sweek]=m.length-1;h--}}return c};scheduler._copy_dummy=function(){this.start_date=new Date(this.start_date);this.end_date=new Date(this.end_date)}; -scheduler._copy_event=function(a){this._copy_dummy.prototype=a;return new this._copy_dummy};scheduler._rendered=[];scheduler.clear_view=function(){for(var a=0;a<this._rendered.length;a++){var b=this._rendered[a];b.parentNode&&b.parentNode.removeChild(b)}this._rendered=[]};scheduler.updateEvent=function(a){var b=this.getEvent(a);this.clear_event(a);b&&this.is_visible_events(b)&&this.render_view_data([b],!0)}; -scheduler.clear_event=function(a){this.for_rendered(a,function(a,c){a.parentNode&&a.parentNode.removeChild(a);scheduler._rendered.splice(c,1)})}; -scheduler.render_event=function(a){var b=scheduler.xy.menu_width;if(!(a._sday<0)){var c=scheduler.locate_holder(a._sday);if(c){var d=a.start_date.getHours()*60+a.start_date.getMinutes(),e=a.end_date.getHours()*60+a.end_date.getMinutes()||scheduler.config.last_hour*60,f=Math.round((d*6E4-this.config.first_hour*36E5)*this.config.hour_size_px/36E5)%(this.config.hour_size_px*24)+1,g=Math.max(scheduler.xy.min_event_height,(e-d)*this.config.hour_size_px/60)+1,h=Math.floor((c.clientWidth-b)/a._count),i= -a._sorder*h+1;a._inner||(h*=a._count-a._sorder);if(this.config.cascade_event_display)var k=this.config.cascade_event_count,j=this.config.cascade_event_margin,i=a._sorder%k*j,l=a._inner?(a._count-a._sorder-1)%k*j/2:0,h=Math.floor(c.clientWidth-b-i-l);var o=this._render_v_bar(a.id,b+i,f,h,g,a._text_style,scheduler.templates.event_header(a.start_date,a.end_date,a),scheduler.templates.event_text(a.start_date,a.end_date,a));this._rendered.push(o);c.appendChild(o);i=i+parseInt(c.style.left,10)+b;if(this._edit_id== -a.id){o.style.zIndex=1;h=Math.max(h-4,scheduler.xy.editor_width);o=document.createElement("DIV");o.setAttribute("event_id",a.id);this.set_xy(o,h,g-20,i,f+14);o.className="dhx_cal_editor";var m=document.createElement("DIV");this.set_xy(m,h-6,g-26);m.style.cssText+=";margin:2px 2px 2px 2px;overflow:hidden;";o.appendChild(m);this._els.dhx_cal_data[0].appendChild(o);this._rendered.push(o);m.innerHTML="<textarea class='dhx_cal_editor'>"+a.text+"</textarea>";if(this._quirks7)m.firstChild.style.height=g- -12+"px";this._editor=m.firstChild;this._editor.onkeypress=function(a){if((a||event).shiftKey)return!0;var b=(a||event).keyCode;b==scheduler.keys.edit_save&&scheduler.editStop(!0);b==scheduler.keys.edit_cancel&&scheduler.editStop(!1)};this._editor.onselectstart=function(a){return(a||event).cancelBubble=!0};m.firstChild.focus();this._els.dhx_cal_data[0].scrollLeft=0;m.firstChild.select()}if(this._select_id==a.id){if(this.config.cascade_event_display&&this._drag_mode)o.style.zIndex=1;for(var n=this.config["icons_"+ -(this._edit_id==a.id?"edit":"select")],p="",q=a.color?"background-color:"+a.color+";":"",v=a.textColor?"color:"+a.textColor+";":"",s=0;s<n.length;s++)p+="<div class='dhx_menu_icon "+n[s]+"' style='"+q+""+v+"' title='"+this.locale.labels[n[s]]+"'></div>";var r=this._render_v_bar(a.id,i-b+1,f,b,n.length*20+26,"","<div style='"+q+""+v+"' class='dhx_menu_head'></div>",p,!0);r.style.left=i-b+1;this._els.dhx_cal_data[0].appendChild(r);this._rendered.push(r)}}}}; -scheduler._render_v_bar=function(a,b,c,d,e,f,g,h,i){var k=document.createElement("DIV"),j=this.getEvent(a),l="dhx_cal_event",o=scheduler.templates.event_class(j.start_date,j.end_date,j);o&&(l=l+" "+o);var m=j.color?"background-color:"+j.color+";":"",n=j.textColor?"color:"+j.textColor+";":"",p='<div event_id="'+a+'" class="'+l+'" style="position:absolute; top:'+c+"px; left:"+b+"px; width:"+(d-4)+"px; height:"+e+"px;"+(f||"")+'">';p+='<div class="dhx_header" style=" width:'+(d-6)+"px;"+m+'" > </div>'; -p+='<div class="dhx_title" style="'+m+""+n+'">'+g+"</div>";p+='<div class="dhx_body" style=" width:'+(d-(this._quirks?4:14))+"px; height:"+(e-(this._quirks?20:30))+"px;"+m+""+n+'">'+h+"</div>";p+='<div class="dhx_footer" style=" width:'+(d-8)+"px;"+(i?" margin-top:-1px;":"")+""+m+""+n+'" ></div></div>';k.innerHTML=p;return k.firstChild};scheduler.locate_holder=function(a){return this._mode=="day"?this._els.dhx_cal_data[0].firstChild:this._els.dhx_cal_data[0].childNodes[a]}; -scheduler.locate_holder_day=function(a,b){var c=Math.floor((this._correct_shift(a,1)-this._min_date)/864E5);b&&this.date.time_part(a)&&c++;return c}; -scheduler.render_event_bar=function(a){var b=this._rendered_location,c=this._colsS[a._sday],d=this._colsS[a._eday];d==c&&(d=this._colsS[a._eday+1]);var e=this.xy.bar_height,f=this._colsS.heights[a._sweek]+(this._colsS.height?this.xy.month_scale_height+2:2)+a._sorder*e,g=document.createElement("DIV"),h=a._timed?"dhx_cal_event_clear":"dhx_cal_event_line",i=scheduler.templates.event_class(a.start_date,a.end_date,a);i&&(h=h+" "+i);var k=a.color?"background-color:"+a.color+";":"",j=a.textColor?"color:"+ -a.textColor+";":"",l='<div event_id="'+a.id+'" class="'+h+'" style="position:absolute; top:'+f+"px; left:"+c+"px; width:"+(d-c-15)+"px;"+j+""+k+""+(a._text_style||"")+'">';a._timed&&(l+=scheduler.templates.event_bar_date(a.start_date,a.end_date,a));l+=scheduler.templates.event_bar_text(a.start_date,a.end_date,a)+"</div>";l+="</div>";g.innerHTML=l;this._rendered.push(g.firstChild);b.appendChild(g.firstChild)}; -scheduler._locate_event=function(a){for(var b=null;a&&!b&&a.getAttribute;)b=a.getAttribute("event_id"),a=a.parentNode;return b};scheduler.edit=function(a){if(this._edit_id!=a)this.editStop(!1,a),this._edit_id=a,this.updateEvent(a)};scheduler.editStop=function(a,b){if(!(b&&this._edit_id==b)){var c=this.getEvent(this._edit_id);if(c){if(a)c.text=this._editor.value;this._editor=this._edit_id=null;this.updateEvent(c.id);this._edit_stop_event(c,a)}}}; -scheduler._edit_stop_event=function(a,b){this._new_event?(b?this.callEvent("onEventAdded",[a.id,a]):this.deleteEvent(a.id,!0),this._new_event=null):b&&this.callEvent("onEventChanged",[a.id,a])};scheduler.getEvents=function(a,b){var c=[],d;for(d in this._events){var e=this._events[d];e&&e.start_date<b&&e.end_date>a&&c.push(e)}return c};scheduler._loaded={}; -scheduler._load=function(a,b){a=a||this._load_url;a+=(a.indexOf("?")==-1?"?":"&")+"timeshift="+(new Date).getTimezoneOffset();this.config.prevent_cache&&(a+="&uid="+this.uid());var c,b=b||this._date;if(this._load_mode){for(var d=this.templates.load_format,b=this.date[this._load_mode+"_start"](new Date(b.valueOf()));b>this._min_date;)b=this.date.add(b,-1,this._load_mode);c=b;for(var e=!0;c<this._max_date;)c=this.date.add(c,1,this._load_mode),this._loaded[d(b)]&&e?b=this.date.add(b,1,this._load_mode): -e=!1;var f=c;do c=f,f=this.date.add(c,-1,this._load_mode);while(f>b&&this._loaded[d(f)]);if(c<=b)return!1;for(dhtmlxAjax.get(a+"&from="+d(b)+"&to="+d(c),function(a){scheduler.on_load(a)});b<c;)this._loaded[d(b)]=!0,b=this.date.add(b,1,this._load_mode)}else dhtmlxAjax.get(a,function(a){scheduler.on_load(a)});this.callEvent("onXLS",[]);return!0}; -scheduler.on_load=function(a){this._loading=!0;var b;b=this._process?this[this._process].parse(a.xmlDoc.responseText):this._magic_parser(a);this._not_render=!0;for(var c=0;c<b.length;c++)this.callEvent("onEventLoading",[b[c]])&&this.addEvent(b[c]);this._not_render=!1;this._render_wait&&this.render_view_data();this._loading=!1;this._after_call&&this._after_call();this._after_call=null;this.callEvent("onXLE",[])};scheduler.json={}; -scheduler.json.parse=function(a){if(typeof a=="string")eval("scheduler._temp = "+a+";"),a=scheduler._temp;for(var b=[],c=0;c<a.length;c++)a[c].start_date=scheduler.templates.xml_date(a[c].start_date),a[c].end_date=scheduler.templates.xml_date(a[c].end_date),b.push(a[c]);return b};scheduler.parse=function(a,b){this._process=b;this.on_load({xmlDoc:{responseText:a}})};scheduler.load=function(a,b,c){if(typeof b=="string")this._process=b,b=c;this._load_url=a;this._after_call=b;this._load(a,this._date)}; -scheduler.setLoadMode=function(a){a=="all"&&(a="");this._load_mode=a};scheduler.refresh=function(){alert("not implemented")};scheduler.serverList=function(a,b){return b?this.serverList[a]=b.slice(0):this.serverList[a]=this.serverList[a]||[]};scheduler._userdata={}; -scheduler._magic_parser=function(a){var b;if(!a.getXMLTopNode){var c=a.xmlDoc.responseText,a=new dtmlXMLLoaderObject(function(){});a.loadXMLString(c)}b=a.getXMLTopNode("data");if(b.tagName!="data")return[];for(var d=a.doXPath("//coll_options"),e=0;e<d.length;e++){var f=d[e].getAttribute("for"),g=this.serverList[f];if(g){g.splice(0,g.length);for(var h=a.doXPath(".//item",d[e]),i=0;i<h.length;i++){for(var k=h[i],j=k.attributes,l={key:h[i].getAttribute("value"),label:h[i].getAttribute("label")},o=0;o< -j.length;o++){var m=j[o];if(!(m.nodeName=="value"||m.nodeName=="label"))l[m.nodeName]=m.nodeValue}g.push(l)}}}d.length&&scheduler.callEvent("onOptionsLoad",[]);for(var n=a.doXPath("//userdata"),e=0;e<n.length;e++){var p=this.xmlNodeToJSON(n[e]);this._userdata[p.name]=p.text}var q=[];b=a.doXPath("//event");for(e=0;e<b.length;e++)q[e]=this.xmlNodeToJSON(b[e]),q[e].text=q[e].text||q[e]._tagvalue,q[e].start_date=this.templates.xml_date(q[e].start_date),q[e].end_date=this.templates.xml_date(q[e].end_date); -return q};scheduler.xmlNodeToJSON=function(a){for(var b={},c=0;c<a.attributes.length;c++)b[a.attributes[c].name]=a.attributes[c].value;for(c=0;c<a.childNodes.length;c++){var d=a.childNodes[c];d.nodeType==1&&(b[d.tagName]=d.firstChild?d.firstChild.nodeValue:"")}if(!b.text)b.text=a.firstChild?a.firstChild.nodeValue:"";return b}; -scheduler.attachEvent("onXLS",function(){if(this.config.show_loading===!0){var a;a=this.config.show_loading=document.createElement("DIV");a.className="dhx_loading";a.style.left=Math.round((this._x-128)/2)+"px";a.style.top=Math.round((this._y-15)/2)+"px";this._obj.appendChild(a)}});scheduler.attachEvent("onXLE",function(){var a;if((a=this.config.show_loading)&&typeof a=="object")this._obj.removeChild(a),this.config.show_loading=!0}); -scheduler.ical={parse:function(a){var b=a.match(RegExp(this.c_start+"[^\u000c]*"+this.c_end,""));if(b.length){b[0]=b[0].replace(/[\r\n]+(?=[a-z \t])/g," ");b[0]=b[0].replace(/\;[^:\r\n]*/g,"");for(var c=[],d,e=RegExp("(?:"+this.e_start+")([^\u000c]*?)(?:"+this.e_end+")","g");d=e.exec(b);){for(var f={},g,h=/[^\r\n]+[\r\n]+/g;g=h.exec(d[1]);)this.parse_param(g.toString(),f);if(f.uid&&!f.id)f.id=f.uid;c.push(f)}return c}},parse_param:function(a,b){var c=a.indexOf(":");if(c!=-1){var d=a.substr(0,c).toLowerCase(), -e=a.substr(c+1).replace(/\\\,/g,",").replace(/[\r\n]+$/,"");d=="summary"?d="text":d=="dtstart"?(d="start_date",e=this.parse_date(e,0,0)):d=="dtend"&&(d="end_date",e=b.start_date&&b.start_date.getHours()==0?this.parse_date(e,24,0):this.parse_date(e,23,59));b[d]=e}},parse_date:function(a,b,c){var d=a.split("T");d[1]&&(b=d[1].substr(0,2),c=d[1].substr(2,2));var e=d[0].substr(0,4),f=parseInt(d[0].substr(4,2),10)-1,g=d[0].substr(6,2);return scheduler.config.server_utc&&!d[1]?new Date(Date.UTC(e,f,g,b, -c)):new Date(e,f,g,b,c)},c_start:"BEGIN:VCALENDAR",e_start:"BEGIN:VEVENT",e_end:"END:VEVENT",c_end:"END:VCALENDAR"};scheduler.formSection=function(a){for(var b=this.config.lightbox.sections,c=0;c<b.length;c++)if(b[c].name==a)break;var d=b[c],e=document.getElementById(d.id).nextSibling;return{getValue:function(a){return scheduler.form_blocks[d.type].get_value(e,a||{},d)},setValue:function(a,b){return scheduler.form_blocks[d.type].set_value(e,a,b||{},d)}}}; -scheduler.form_blocks={template:{render:function(a){var b=(a.height||"30")+"px";return"<div class='dhx_cal_ltext dhx_cal_template' style='height:"+b+";'></div>"},set_value:function(a,b){a.innerHTML=b||""},get_value:function(a){return a.innerHTML||""},focus:function(){}},textarea:{render:function(a){var b=(a.height||"130")+"px";return"<div class='dhx_cal_ltext' style='height:"+b+";'><textarea></textarea></div>"},set_value:function(a,b){a.firstChild.value=b||""},get_value:function(a){return a.firstChild.value}, -focus:function(a){var b=a.firstChild;b.select();b.focus()}},select:{render:function(a){for(var b=(a.height||"23")+"px",c="<div class='dhx_cal_ltext' style='height:"+b+";'><select style='width:100%;'>",d=0;d<a.options.length;d++)c+="<option value='"+a.options[d].key+"'>"+a.options[d].label+"</option>";c+="</select></div>";return c},set_value:function(a,b){if(typeof b=="undefined")b=(a.firstChild.options[0]||{}).value;a.firstChild.value=b||""},get_value:function(a){return a.firstChild.value},focus:function(a){var b= -a.firstChild;b.select&&b.select();b.focus()}},time:{render:function(){var a=scheduler.config,b=this.date.date_part(new Date),c=1440,d=0;scheduler.config.limit_time_select&&(c=60*a.last_hour+1,d=60*a.first_hour,b.setHours(a.first_hour));for(var e="<select>",f=d,g=b.getDate();f<c;){var h=this.templates.time_picker(b);e+="<option value='"+f+"'>"+h+"</option>";b.setTime(b.valueOf()+this.config.time_step*6E4);var i=b.getDate()!=g?1:0,f=i*1440+b.getHours()*60+b.getMinutes()}e+="</select> <select>";for(f= -1;f<32;f++)e+="<option value='"+f+"'>"+f+"</option>";e+="</select> <select>";for(f=0;f<12;f++)e+="<option value='"+f+"'>"+this.locale.date.month_full[f]+"</option>";e+="</select> <select>";b=b.getFullYear()-5;for(f=0;f<10;f++)e+="<option value='"+(b+f)+"'>"+(b+f)+"</option>";e+="</select> ";return"<div style='height:30px;padding-top:0px;font-size:inherit;' class='dhx_section_time'>"+e+"<span style='font-weight:normal; font-size:10pt;'> – </span>"+e+"</div>"},set_value:function(a, -b,c){function d(a,b,c){a[b+0].value=Math.round((c.getHours()*60+c.getMinutes())/scheduler.config.time_step)*scheduler.config.time_step;a[b+1].value=c.getDate();a[b+2].value=c.getMonth();a[b+3].value=c.getFullYear()}var e=a.getElementsByTagName("select");if(scheduler.config.full_day){if(!a._full_day){var f="<label class='dhx_fullday'><input type='checkbox' name='full_day' value='true'> "+scheduler.locale.labels.full_day+" </label></input>";scheduler.config.wide_form||(f=a.previousSibling.innerHTML+ -f);a.previousSibling.innerHTML=f;a._full_day=!0}var g=a.previousSibling.getElementsByTagName("input")[0],h=scheduler.date.time_part(c.start_date)===0&&scheduler.date.time_part(c.end_date)===0&&c.end_date.valueOf()-c.start_date.valueOf()<1728E5;g.checked=h;for(var i in e)e[i].disabled=g.checked;g.onclick=function(){if(g.checked){var a=new Date(c.start_date),b=new Date(c.end_date);scheduler.date.date_part(a);b=scheduler.date.add(a,1,"day")}for(var f in e)e[f].disabled=g.checked;d(e,0,a||c.start_date); -d(e,4,b||c.end_date)}}if(scheduler.config.auto_end_date&&scheduler.config.event_duration)for(var k=function(){c.start_date=new Date(e[3].value,e[2].value,e[1].value,0,e[0].value);c.end_date.setTime(c.start_date.getTime()+scheduler.config.event_duration*6E4);d(e,4,c.end_date)},j=0;j<4;j++)e[j].onchange=k;d(e,0,c.start_date);d(e,4,c.end_date)},get_value:function(a,b){s=a.getElementsByTagName("select");b.start_date=new Date(s[3].value,s[2].value,s[1].value,0,s[0].value);b.end_date=new Date(s[7].value, -s[6].value,s[5].value,0,s[4].value);if(b.end_date<=b.start_date)b.end_date=scheduler.date.add(b.start_date,scheduler.config.time_step,"minute")},focus:function(a){a.getElementsByTagName("select")[0].focus()}}}; -scheduler.showCover=function(a){if(a){a.style.display="block";var b=window.pageYOffset||document.body.scrollTop||document.documentElement.scrollTop,c=window.pageXOffset||document.body.scrollLeft||document.documentElement.scrollLeft,d=window.innerHeight||document.documentElement.clientHeight;a.style.top=b?Math.round(b+Math.max((d-a.offsetHeight)/2,0))+"px":Math.round(Math.max((d-a.offsetHeight)/2,0)+9)+"px";a.style.left=document.documentElement.scrollWidth>document.body.offsetWidth?Math.round(c+(document.body.offsetWidth- -a.offsetWidth)/2)+"px":Math.round((document.body.offsetWidth-a.offsetWidth)/2)+"px"}this.show_cover()};scheduler.showLightbox=function(a){if(a&&this.callEvent("onBeforeLightbox",[a])){var b=this._get_lightbox();this.showCover(b);this._fill_lightbox(a,b);this.callEvent("onLightbox",[a])}}; -scheduler._fill_lightbox=function(a,b){var c=this.getEvent(a),d=b.getElementsByTagName("span");scheduler.templates.lightbox_header?(d[1].innerHTML="",d[2].innerHTML=scheduler.templates.lightbox_header(c.start_date,c.end_date,c)):(d[1].innerHTML=this.templates.event_header(c.start_date,c.end_date,c),d[2].innerHTML=(this.templates.event_bar_text(c.start_date,c.end_date,c)||"").substr(0,70));for(var e=this.config.lightbox.sections,f=0;f<e.length;f++){var g=document.getElementById(e[f].id).nextSibling, -h=this.form_blocks[e[f].type];h.set_value.call(this,g,c[e[f].map_to],c,e[f]);e[f].focus&&h.focus.call(this,g)}scheduler._lightbox_id=a};scheduler._lightbox_out=function(a){for(var b=this.config.lightbox.sections,c=0;c<b.length;c++){var d=document.getElementById(b[c].id),d=d?d.nextSibling:d,e=this.form_blocks[b[c].type],f=e.get_value.call(this,d,a,b[c]);b[c].map_to!="auto"&&(a[b[c].map_to]=f)}return a}; -scheduler._empty_lightbox=function(){var a=scheduler._lightbox_id,b=this.getEvent(a),c=this._get_lightbox();this._lightbox_out(b);b._timed=this.is_one_day_event(b);this.setEvent(b.id,b);this._edit_stop_event(b,!0);this.render_view_data()};scheduler.hide_lightbox=function(){this.hideCover(this._get_lightbox());this._lightbox_id=null;this.callEvent("onAfterLightbox",[])};scheduler.hideCover=function(a){if(a)a.style.display="none";this.hide_cover()}; -scheduler.hide_cover=function(){this._cover&&this._cover.parentNode.removeChild(this._cover);this._cover=null};scheduler.show_cover=function(){this._cover=document.createElement("DIV");this._cover.className="dhx_cal_cover";var a=document.height!==void 0?document.height:document.body.offsetHeight,b=document.documentElement?document.documentElement.scrollHeight:0;this._cover.style.height=Math.max(a,b)+"px";document.body.appendChild(this._cover)}; -scheduler.save_lightbox=function(){if(!this.checkEvent("onEventSave")||this.callEvent("onEventSave",[this._lightbox_id,this._lightbox_out({id:this._lightbox_id}),this._new_event]))this._empty_lightbox(),this.hide_lightbox()};scheduler.startLightbox=function(a,b){this._lightbox_id=a;this.showCover(b)};scheduler.endLightbox=function(a,b){this._edit_stop_event(scheduler.getEvent(this._lightbox_id),a);a&&scheduler.render_view_data();this.hideCover(b)}; -scheduler.resetLightbox=function(){scheduler._lightbox&&scheduler._lightbox.parentNode.removeChild(scheduler._lightbox);scheduler._lightbox=null};scheduler.cancel_lightbox=function(){this.callEvent("onEventCancel",[this._lightbox_id,this._new_event]);this.endLightbox(!1);this.hide_lightbox()}; -scheduler._init_lightbox_events=function(){this._get_lightbox().onclick=function(a){var b=a?a.target:event.srcElement;if(!b.className)b=b.previousSibling;if(b&&b.className)switch(b.className){case "dhx_save_btn":scheduler.save_lightbox();break;case "dhx_delete_btn":var c=scheduler.locale.labels.confirm_deleting;if(!c||confirm(c))scheduler.deleteEvent(scheduler._lightbox_id),scheduler._new_event=null,scheduler.hide_lightbox();break;case "dhx_cancel_btn":scheduler.cancel_lightbox();break;default:if(b.getAttribute("dhx_button"))scheduler.callEvent("onLightboxButton", -[b.className,b,a]);else if(b.className.indexOf("dhx_custom_button_")!=-1){var d=b.parentNode.getAttribute("index"),e=scheduler.form_blocks[scheduler.config.lightbox.sections[d].type],f=b.parentNode.parentNode;e.button_click(d,b,f,f.nextSibling)}}};this._get_lightbox().onkeydown=function(a){switch((a||event).keyCode){case scheduler.keys.edit_save:if((a||event).shiftKey)break;scheduler.save_lightbox();break;case scheduler.keys.edit_cancel:scheduler.cancel_lightbox()}}}; -scheduler.setLightboxSize=function(){var a=this._lightbox;if(a){var b=a.childNodes[1];b.style.height="0px";b.style.height=b.scrollHeight+"px";a.style.height=b.scrollHeight+50+"px";b.style.height=b.scrollHeight+"px"}};scheduler._init_dnd_events=function(){dhtmlxEvent(document.body,"mousemove",scheduler._move_while_dnd);dhtmlxEvent(document.body,"mouseup",scheduler._finish_dnd);scheduler._init_dnd_events=function(){}}; -scheduler._move_while_dnd=function(a){if(scheduler._dnd_start_lb){if(!document.dhx_unselectable)document.body.className+=" dhx_unselectable",document.dhx_unselectable=!0;var b=scheduler._get_lightbox(),c=a&&a.target?[a.pageX,a.pageY]:[event.clientX,event.clientY];b.style.top=scheduler._lb_start[1]+c[1]-scheduler._dnd_start_lb[1]+"px";b.style.left=scheduler._lb_start[0]+c[0]-scheduler._dnd_start_lb[0]+"px"}}; -scheduler._ready_to_dnd=function(a){var b=scheduler._get_lightbox();scheduler._lb_start=[parseInt(b.style.left,10),parseInt(b.style.top,10)];scheduler._dnd_start_lb=a&&a.target?[a.pageX,a.pageY]:[event.clientX,event.clientY]};scheduler._finish_dnd=function(){if(scheduler._lb_start)scheduler._lb_start=scheduler._dnd_start_lb=!1,document.body.className=document.body.className.replace(" dhx_unselectable",""),document.dhx_unselectable=!1}; -scheduler._get_lightbox=function(){if(!this._lightbox){var a=document.createElement("DIV");a.className="dhx_cal_light";scheduler.config.wide_form&&(a.className+=" dhx_cal_light_wide");scheduler.form_blocks.recurring&&(a.className+=" dhx_cal_light_rec");/msie|MSIE 6/.test(navigator.userAgent)&&(a.className+=" dhx_ie6");a.style.visibility="hidden";var b=this._lightbox_template,c=this.config.buttons_left;scheduler.locale.labels.dhx_save_btn=scheduler.locale.labels.icon_save;scheduler.locale.labels.dhx_cancel_btn= -scheduler.locale.labels.icon_cancel;scheduler.locale.labels.dhx_delete_btn=scheduler.locale.labels.icon_delete;for(var d=0;d<c.length;d++)b+="<div class='dhx_btn_set'><div dhx_button='1' class='"+c[d]+"'></div><div>"+scheduler.locale.labels[c[d]]+"</div></div>";c=this.config.buttons_right;for(d=0;d<c.length;d++)b+="<div class='dhx_btn_set' style='float:right;'><div dhx_button='1' class='"+c[d]+"'></div><div>"+scheduler.locale.labels[c[d]]+"</div></div>";b+="</div>";a.innerHTML=b;if(scheduler.config.drag_lightbox)a.firstChild.onmousedown= -scheduler._ready_to_dnd,a.firstChild.onselectstart=function(){return!1},a.firstChild.style.cursor="pointer",scheduler._init_dnd_events();document.body.insertBefore(a,document.body.firstChild);this._lightbox=a;for(var e=this.config.lightbox.sections,b="",d=0;d<e.length;d++){var f=this.form_blocks[e[d].type];if(f){e[d].id="area_"+this.uid();var g="";e[d].button&&(g="<div class='dhx_custom_button' index='"+d+"'><div class='dhx_custom_button_"+e[d].button+"'></div><div>"+this.locale.labels["button_"+ -e[d].button]+"</div></div>");this.config.wide_form&&(b+="<div class='dhx_wrap_section'>");b+="<div id='"+e[d].id+"' class='dhx_cal_lsection'>"+g+this.locale.labels["section_"+e[d].name]+"</div>"+f.render.call(this,e[d]);b+="</div>"}}var h=a.getElementsByTagName("div");h[1].innerHTML=b;this.setLightboxSize();this._init_lightbox_events(this);a.style.display="none";a.style.visibility="visible"}return this._lightbox};scheduler._lightbox_template="<div class='dhx_cal_ltitle'><span class='dhx_mark'> </span><span class='dhx_time'></span><span class='dhx_title'></span></div><div class='dhx_cal_larea'></div>"; -scheduler._dp_init=function(a){a._methods=["setEventTextStyle","","changeEventId","deleteEvent"];this.attachEvent("onEventAdded",function(b){!this._loading&&this.validId(b)&&a.setUpdated(b,!0,"inserted")});this.attachEvent("onConfirmedBeforeEventDelete",function(b){if(this.validId(b)){var c=a.getState(b);if(c=="inserted"||this._new_event)return a.setUpdated(b,!1),!0;if(c=="deleted")return!1;if(c=="true_deleted")return!0;a.setUpdated(b,!0,"deleted");return!1}});this.attachEvent("onEventChanged",function(b){!this._loading&& -this.validId(b)&&a.setUpdated(b,!0,"updated")});a._getRowData=function(a){var c=this.obj.getEvent(a),d={},e;for(e in c)e.indexOf("_")!=0&&(d[e]=c[e]&&c[e].getUTCFullYear?this.obj.templates.xml_format(c[e]):c[e]);return d};a._clearUpdateFlag=function(){};a.attachEvent("insertCallback",scheduler._update_callback);a.attachEvent("updateCallback",scheduler._update_callback);a.attachEvent("deleteCallback",function(a,c){this.obj.setUserData(c,this.action_param,"true_deleted");this.obj.deleteEvent(c)})}; -scheduler.setUserData=function(a,b,c){a?this.getEvent(a)[b]=c:this._userdata[b]=c};scheduler.getUserData=function(a,b){return a?this.getEvent(a)[b]:this._userdata[b]};scheduler.setEventTextStyle=function(a,b){this.for_rendered(a,function(a){a.style.cssText+=";"+b});var c=this.getEvent(a);c._text_style=b;this.event_updated(c)};scheduler.validId=function(){return!0}; -scheduler._update_callback=function(a){var b=scheduler.xmlNodeToJSON(a.firstChild);b.text=b.text||b._tagvalue;b.start_date=scheduler.templates.xml_date(b.start_date);b.end_date=scheduler.templates.xml_date(b.end_date);scheduler.addEvent(b)}; diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler_dhx_terrace.css b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler_dhx_terrace.css new file mode 100644 index 00000000000..48230ffe08f --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler_dhx_terrace.css @@ -0,0 +1,5 @@ +/* +This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in non-GPL project. Please contact sales@dhtmlx.com for details +*/ +.dhtmlx_message_area{position:fixed;right:5px;width:250px;z-index:1000;}.dhtmlx-info{min-width:120px;padding:4px 4px 4px 20px;font-family:Tahoma;z-index:10000;margin:5px;margin-bottom:10px;-webkit-transition:all .5s ease;-moz-transition:all .5s ease;-o-transition:all .5s ease;transition:all .5s ease;}.dhtmlx-info.hidden{height:0;padding:0;border-width:0;margin:0;overflow:hidden;}.dhtmlx_modal_box{overflow:hidden;display:inline-block;min-width:300px;width:300px;text-align:center;position:fixed;background-color:#fff;background:-webkit-linear-gradient(top,#fff 1%,#d0d0d0 99%);background:-moz-linear-gradient(top,#fff 1%,#d0d0d0 99%);box-shadow:0 0 14px #888;font-family:Tahoma;z-index:20000;border-radius:6px;border:1px solid #fff;}.dhtmlx_popup_title{border-top-left-radius:5px;border-top-right-radius:5px;border-width:0;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAoCAMAAAAIaGBFAAAAhFBMVEVwcHBubm5sbGxqampoaGhmZmZlZWVjY2NhYWFfX19dXV1bW1taWlpYWFhWVlZUVFRSUlJRUVFPT09NTU1LS0tJSUlHR0dGRkZERERCQkJAQEA+Pj49PT09PT0+Pj5AQEBBQUFDQ0NERERGRkZHR0dJSUlKSkpMTExMTEw5OTk5OTk5OTkny8YEAAAAQklEQVQImQXBCRJCAAAAwKVSQqdyjSPXNP7/QLsIhA6OTiJnF7GrRCpzc/fw9PKW+/gqlCq1RqvTG/yMJrPF6m/bAVEhAxxnHG0oAAAAAElFTkSuQmCC);background-image:-webkit-linear-gradient(top,#707070 1%,#3d3d3d 70%,#4c4c4c 97%,#393939 97%);background-image:-moz-linear-gradient(top,#707070 1%,#3d3d3d 70%,#4c4c4c 97%,#393939 97%);}.dhtmlx-info,.dhtmlx_popup_button,.dhtmlx_button{user-select:none;-webkit-user-select:none;-moz-user-select:-moz-none;cursor:pointer;}.dhtmlx_popup_text{overflow:hidden;}.dhtmlx_popup_controls{border-radius:6px;padding:5px;}.dhtmlx_popup_button,.dhtmlx_button{height:30px;line-height:30px;display:inline-block;margin:0 5px;border-radius:6px;color:#FFF;}.dhtmlx_popup_button{min-width:120px;}div.dhx_modal_cover{background-color:#000;cursor:default;filter:alpha(opacity = 20);opacity:.2;position:fixed;z-index:19999;left:0;top:0;width:100%;height:100%;border:none;zoom:1;}.dhtmlx-info img,.dhtmlx_modal_box img{float:left;margin-right:20px;}.dhtmlx-alert-error .dhtmlx_popup_title,.dhtmlx-confirm-error .dhtmlx_popup_title{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAsCAIAAAArRUU2AAAATklEQVR4nIWLuw2AMBBDjVuQiBT2oWbRDATrnB0KQOJoqPzRe3BrHI6dcBASYREKovtK6/6DsDOX+stN+3H1YX9ciRgnYq5EWYhS2dftBIuLT4JyIrPCAAAAAElFTkSuQmCC);}.dhtmlx-alert-error,.dhtmlx-confirm-error{border:1px solid #f00;}.dhtmlx_button,.dhtmlx_popup_button{box-shadow:0 0 4px #888;border:1px solid #838383;}.dhtmlx_button input,.dhtmlx_popup_button div{border:1px solid #FFF;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAeCAMAAADaS4T1AAAAYFBMVEVwcHBtbW1ra2toaGhmZmZjY2NhYWFeXl5cXFxaWlpXV1dVVVVSUlJQUFBNTU1LS0tJSUlGRkZERERBQUE/Pz88PDw9PT0+Pj5AQEBCQkJDQ0NFRUVHR0dISEhKSkpMTEzqthaMAAAAMklEQVQImQXBhQ2AMAAAsOIMlwWH/8+kRSKVyRVKlVrQaHV6g9FktlhFm93hdLk9Xt8PIfgBvdUqyskAAAAASUVORK5CYII=);background-image:-webkit-linear-gradient(top,#707070 1%,#3d3d3d 70%,#4c4c4c 99%);background-image:-moz-linear-gradient(top,#707070 1%,#3d3d3d 70%,#4c4c4c 99%);border-radius:6px;font-size:15px;font-weight:normal;-moz-box-sizing:content-box;box-sizing:content-box;color:#fff;padding:0;margin:0;vertical-align:top;height:28px;line-height:28px;}.dhtmlx_button input:focus,.dhtmlx_button input:active,.dhtmlx_popup_button div:active,.dhtmlx_popup_button div:focus{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAeCAMAAADaS4T1AAAAXVBMVEVwcHBubm5tbW1sbGxra2tpaWloaGhnZ2dmZmZlZWVjY2NiYmJhYWFgYGBfX19dXV1cXFxbW1taWlpZWVlXV1dWVlZVVVVUVFRTU1NRUVFQUFBPT09OTk5NTU1LS0tT9SY0AAAAMUlEQVQImQXBhQGAMAAAIGxnx2z9/00BiVQmVyhVakGj1ekNRpPZYhVtdofT5fZ4fT8hpwG05JjexgAAAABJRU5ErkJggg==);background-image:-webkit-linear-gradient(top,#707070 1%,#4c4c4c 99%);background-image:-moz-linear-gradient(top,#707070 1%,#4c4c4c 99%);}.dhtmlx_popup_title{color:#fff;text-shadow:1px 1px #000;height:40px;line-height:40px;font-size:20px;}.dhtmlx_popup_text{margin:15px 15px 5px 15px;font-size:14px;color:#000;min-height:30px;border-radius:6px;}.dhtmlx-info,.dhtmlx-error{font-size:14px;color:#000;box-shadow:0 0 10px #888;padding:0;background-color:#FFF;border-radius:3px;border:1px solid #fff;}.dhtmlx-info div{padding:5px 10px 5px 10px;background-color:#fff;border-radius:3px;border:1px solid #B8B8B8;}.dhtmlx-error{background-color:#d81b1b;border:1px solid #ff3c3c;box-shadow:0 0 10px #000;}.dhtmlx-error div{background-color:#d81b1b;border:1px solid #940000;color:#FFF;}.dhx_cal_container{background-color:#C2D5FC;font-family:Tahoma;font-size:8pt;position:relative;overflow:hidden;}.dhx_cal_container div{-moz-user-select:none;-moz-user-select:-moz-none;}.dhx_cal_navline{height:20px;position:absolute;z-index:3;width:750px;color:#2F3A48;}.dhx_cal_navline div{position:absolute;top:2px;white-space:nowrap;}.dhx_cal_navline .dhx_cal_date{font-weight:600;left:210px;padding-top:1px;}.dhx_cal_button .dhx_left_bg{width:1px;overflow:hidden;height:17px;z-index:20;top:0;}.dhx_cal_prev_button{background-image:url(imgs/buttons.png);background-position:0 0;width:29px;height:17px;left:50px;cursor:pointer;}.dhx_cal_next_button{background-image:url(imgs/buttons.png);background-position:-30px 0;width:29px;height:17px;left:80px;cursor:pointer;}.dhx_cal_today_button{background-image:url(imgs/buttons.png);background-position:-60px 0;width:75px;height:17px;left:112px;cursor:pointer;text-align:center;text-decoration:underline;}.dhx_cal_tab{width:59px;height:19px;text-align:center;text-decoration:underline;padding-top:2px;cursor:pointer;background-color:#D8E1EA;-webkit-border-top-left-radius:4px;-webkit-border-top-right-radius:4px;-moz-border-radius-topleft:4px;-moz-border-radius-topright:4px;border-top-left-radius:4px;border-top-right-radius:4px;}.dhx_cal_tab.active{text-decoration:none;cursor:default;font-weight:bold;border:1px dotted #586A7E;border-bottom:0;background-color:#C2D5FC;}.dhx_cal_header{position:absolute;left:10px;top:23px;width:750px;border-top:1px dotted #8894A3;border-right:1px dotted #8894A3;z-index:2;overflow:hidden;color:#2F3A48;}.dhx_cal_data{border-top:1px dotted #8894A3;position:absolute;top:44px;width:600px;overflow-y:auto;overflow-x:hidden;}.dhx_scale_bar{position:absolute;text-align:center;background-color:#C2D5FC;padding-top:3px;border-left:1px dotted #586A7E;}.dhx_scale_holder{position:absolute;border-right:1px dotted #586A7E;background-image:url(imgs/databg.png);}.dhx_scale_holder_now{position:absolute;border-right:1px dotted #586A7E;background-image:url(imgs/databg_now.png);}.dhx_scale_hour{height:41px;width:50px;border-bottom:1px dotted #8894A3;background-color:#C2D5FC;text-align:center;line-height:40px;color:#586A7E;overflow:hidden;}.dhx_month_head{background-color:#EBEFF4;color:#2F3A48;border-right:1px dotted #586A7E;height:18px;padding-right:5px;padding-top:3px;text-align:right;}.dhx_month_body{border-right:1px dotted #586A7E;border-bottom:1px dotted #586A7E;background-color:#FFF;}.dhx_now .dhx_month_body{background-color:#E2EDFF;}.dhx_after .dhx_month_body,.dhx_before .dhx_month_body{background-color:#ECECEC;}.dhx_after .dhx_month_head,.dhx_before .dhx_month_head{background-color:#E2E3E6;color:#94A6BB;}.dhx_now .dhx_month_head{background-color:#D1DEF4;font-weight:bold;}.dhx_cal_drag{position:absolute;z-index:9999;background-color:#FFE763;border:1px solid #B7A543;opacity:.5;filter:alpha(opacity=50);}.dhx_loading{position:absolute;width:128px;height:15px;background-image:url(imgs/loading.gif);z-index:9999;}.dhx_multi_day_icon,.dhx_multi_day{background-color:#E1E6FF;background-repeat:no-repeat;border-right:1px dotted #8894A3;}.dhx_multi_day{position:absolute;border-top:1px dotted #8894A3;}.dhx_multi_day_icon,.dhx_multi_day_icon_small{background-position:center center;background-color:#E1E6FF;background-repeat:no-repeat;border-bottom:1px dotted #8894A3;border-right:1px dotted #8894A3;}.dhx_multi_day_icon{background-image:url(imgs/clock_big.gif);}.dhx_multi_day_icon_small{background-image:url(imgs/clock_small.gif);}.dhtmlxLayoutPolyContainer_dhx_skyblue .dhx_cal_container{background-color:#d0e5ff;}.dhx_cal_event .dhx_header,.dhx_cal_event .dhx_title,.dhx_cal_event .dhx_body,.dhx_cal_event .dhx_footer{background-color:#FFE763;border:1px solid #B7A543;color:#887A2E;overflow:hidden;width:100%;font-family:Tahoma;font-size:8pt;}.dhx_move_denied .dhx_cal_event .dhx_header,.dhx_move_denied .dhx_cal_event .dhx_title{cursor:default;}.dhx_cal_event .dhx_header{height:1px;margin-left:1px;border-width:1px 1px 0 1px;cursor:pointer;}.dhx_cal_event .dhx_title{height:12px;border-width:0 1px 1px 1px;border-bottom-style:dotted;font-size:7pt;font-weight:bold;text-align:center;background-position:right;background-repeat:no-repeat;cursor:pointer;}.dhx_cal_event .dhx_body,.dhx_cal_event.dhx_cal_select_menu .dhx_body{border-width:0 1px 1px 1px;padding:5px;}.dhx_resize_denied{cursor:default!important;}.dhx_cal_event .dhx_event_resize{cursor:s-resize;}.dhx_cal_event .dhx_footer,.dhx_cal_event .dhx_select_menu_footer{height:1px;margin-left:2px;border-width:0 1px 1px 1px;}.dhx_cal_event_line{background-color:#FFE763;border:1px solid #B7A543;border-radius:3px;font-family:Tahoma;font-size:8pt;height:13px;padding-left:10px;color:#887A2E;cursor:pointer;overflow:hidden;}.dhx_cal_event_clear{font-family:Tahoma;font-size:8pt;height:13px;padding-left:2px;color:#887A2E;white-space:nowrap;overflow:hidden;cursor:pointer;}.dhx_in_move{background-color:#FFFF80;}div.dhx_cal_editor{background-color:#FFE763;border:1px solid #B7A543;border-top-style:dotted;z-index:999;position:absolute;overflow:hidden;}textarea.dhx_cal_editor{width:100%;height:100%;border:0 solid black;margin:none;padding:none;overflow:auto;}div.dhx_menu_head{background-image:url(imgs/controls.gif);background-position:0 -43px;width:10px;height:10px;margin-left:5px;margin-top:1px;border:none;cursor:default;}div.dhx_menu_icon{background-image:url(imgs/controls.gif);width:20px;height:20px;margin-left:-5px;margin-top:0;border:none;cursor:pointer;}div.icon_details{background-position:0 0;}div.icon_edit{background-position:-22px 0;}div.icon_save{background-position:-84px -1px;}div.icon_cancel{background-position:-62px 0;}div.icon_delete{background-position:-42px 0;}.dhx_unselectable,.dhx_unselectable div{-webkit-user-select:none;-moz-user-select:none;-moz-user-select:-moz-none;}.dhx_cal_light{background-color:#FFE763;border-radius:5px;font-family:Tahoma;font-size:8pt;border:1px solid #B7A64B;color:#887A2E;position:absolute;z-index:10001;width:580px;height:300px;box-shadow:5px 5px 5px #888;}.dhx_cal_light_wide{width:650px;}.dhx_mark{position:relative;top:3px;background-image:url('./imgs/controls.gif');background-position:0 -43px;padding-left:10px;}.dhx_ie6 .dhx_mark{background-position:6px -41px;}.dhx_cal_light select{font-family:Tahoma;font-size:8pt;color:#887A2E;padding:2px;margin:0;}.dhx_cal_ltitle{padding:2px 0 2px 5px;overflow:hidden;white-space:nowrap;}.dhx_cal_ltitle span{white-space:nowrap;}.dhx_cal_lsection{background-color:#DBCF8C;color:#FFF4B5;font-weight:bold;padding:5px 0 3px 10px;}.dhx_section_time{background-color:#DBCF8C;white-space:nowrap;}.dhx_cal_lsection .dhx_fullday{float:right;margin-right:5px;color:#887A2E;font-size:12px;font-weight:normal;line-height:20px;vertical-align:top;cursor:pointer;}.dhx_cal_lsection{font-size:18px;font-family:Arial;}.dhx_cal_ltext{padding:2px 0 2px 10px;overflow:hidden;}.dhx_cal_ltext textarea{background-color:#FFF4B5;overflow:auto;border:none;color:#887A2E;height:100%;width:100%;outline:none!important;resize:none;}.dhx_time{font-weight:bold;}.dhx_cal_light .dhx_title{padding-left:10px;}.dhx_cal_larea{border:1px solid #DCC43E;background-color:#FFF4B5;overflow:hidden;margin-left:3px;width:572px;height:1px;}.dhx_btn_set{padding:5px 10px 0 10px;float:left;}.dhx_btn_set div{float:left;height:21px;line-height:21px;vertical-align:middle;cursor:pointer;}.dhx_save_btn{background-image:url('./imgs/controls.gif');background-position:-84px 0;width:21px;}.dhx_cancel_btn{background-image:url('./imgs/controls.gif');background-position:-63px 0;width:20px;}.dhx_delete_btn{background-image:url('./imgs/controls.gif');background-position:-42px 0;width:20px;}.dhx_cal_cover{width:100%;height:100%;position:absolute;z-index:10000;top:0;left:0;background-color:black;opacity:.1;filter:alpha(opacity=10);}.dhx_custom_button{padding:0 3px 0 3px;color:#887A2E;font-family:Tahoma;font-size:8pt;background-color:#FFE763;font-weight:normal;margin-right:5px;margin-top:0;cursor:pointer;}.dhx_custom_button div{cursor:pointer;float:left;height:21px;line-height:21px;vertical-align:middle;}.dhx_cal_light_wide .dhx_cal_larea{border-top-width:0;}.dhx_cal_light_wide .dhx_cal_lsection{border:0;float:left;text-align:right;width:100px;height:20px;font-size:16px;padding:5px 0 0 10px;}.dhx_cal_light_wide .dhx_wrap_section{border-top:1px solid #DBCF8C;position:relative;background-color:#DBCF8C;overflow:hidden;}.dhx_cal_light_wide .dhx_section_time{padding-top:2px!important;height:20px!important;}.dhx_section_time{text-align:center;}.dhx_cal_light_wide .dhx_cal_larea{width:730px;}.dhx_cal_light_wide{width:738px;}.dhx_cal_light_wide .dhx_section_time{background:transparent;}.dhx_cal_light_wide .dhx_cal_checkbox label{padding-left:0;}.dhx_cal_wide_checkbox input{margin-top:8px;margin-left:14px;}.dhx_cal_light input{font-family:Tahoma;font-size:8pt;color:#887A2E;}.dhx_cal_light_wide .dhx_cal_lsection .dhx_fullday{float:none;margin-right:0;color:#FFF4B5;font-weight:bold;font-size:16px;font-family:Arial;cursor:pointer;}.dhx_custom_button{float:right;height:21px;width:90px;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;}.dhx_cal_light_wide .dhx_custom_button{position:absolute;top:0;right:0;margin-top:2px;}.dhx_cal_light_wide .dhx_repeat_right{margin-right:55px;}.dhx_minical_popup{position:absolute;z-index:10100;width:251px;height:175px;}.dhx_scale_bar_header{position:absolute;border-bottom:1px dotted #8894A3;width:100%;}.dhx_expand_icon{position:absolute;top:0;right:0;background-image:url(./imgs/collapse_expand_icon.gif);width:18px;height:18px;cursor:pointer;background-position:0 18px;z-index:16;}.dhx_scheduler_agenda .dhx_cal_data{background-image:url(./imgs/databg.png);}.dhx_agenda_area{width:100%;overflow-y:auto;background-image:url(./imgs/databg.png);}.dhx_agenda_line{height:21px;clear:both;overflow:hidden;}.dhx_agenda_line div{float:left;width:188px;border-right:1px dotted #8894A3;text-align:center;line-height:21px;overflow:hidden;}.dhx_agenda_area .dhx_agenda_line div{border-right:0 dotted #8894A3;}.dhx_v_border{position:absolute;left:187px;top:0;border-right:1px dotted #8894A3;width:1px;height:100%;}.dhx_agenda_line .dhx_event_icon{width:20px;border-width:0;background:url(./imgs/icon.png) no-repeat;background-position:5px 4px;cursor:pointer;}.dhx_agenda_line span{padding-left:5px;line-height:21px;}.dhx_year_body{border-left:1px dotted #586A7E;}.dhx_year_week{position:relative;}.dhx_scale_bar_last{border-right:1px dotted #586A7E;}.dhx_year_month{height:18px;padding-top:3px;border:1px dotted #586A7E;text-align:center;vertical-align:middle;}.dhx_year_body .dhx_before .dhx_month_head,.dhx_year_body .dhx_after .dhx_month_head,.dhx_year_body .dhx_before .dhx_month_head a,.dhx_year_body .dhx_after .dhx_month_head a{color:#E2E3E6!important;}.dhx_year_body .dhx_month_body{height:0;overflow:hidden;}.dhx_month_head.dhx_year_event{background-color:#FFE763;}.dhx_year_body .dhx_before .dhx_month_head,.dhx_year_body .dhx_after .dhx_month_head{cursor:default;}.dhx_tooltip{border:1px solid #BBB;background-image:url(./imgs/databg.png);position:absolute;z-index:9998;width:300px;height:auto;font-family:Tahoma;font-size:8pt;overflow:hidden;}.dhx_tooltip_line{line-height:20px;height:20px;overflow:hidden;}.dhx_tooltip_line .dhx_event_icon{width:20px;height:20px;padding-right:10px;float:left;border-width:0;position:relative;background:url(./imgs/icon.png) no-repeat;background-position:5px 4px;cursor:pointer;}.dhx_tooltip_date{float:left;width:auto;padding-left:5px;text-align:center;}.dhx_text_disabled{color:#887A2E;font-family:Tahoma;font-size:8pt;}.dhx_mini_calendar{-moz-box-shadow:5px 5px 5px #888;-khtml-box-shadow:5px 5px 5px #888;}.dhx_mini_calendar .dhx_month_head{cursor:pointer;}.dhx_mini_calendar .dhx_calendar_click{background-color:#C2D5FC;}.dhx_cal_navline div.dhx_minical_icon{width:18px;height:18px;left:190px;top:1px;cursor:pointer;background-image:url(./imgs/calendar.gif);}.dhx_matrix_scell{height:100%;}.dhx_matrix_cell,.dhx_matrix_scell{overflow:hidden;text-align:center;vertical-align:middle;border-bottom:1px dotted #8894A3;border-right:1px dotted #8894A3;}.dhx_matrix_cell{background-color:white;}.dhx_matrix_line{overflow:hidden;}.dhx_matrix_cell div,.dhx_matrix_scell div{overflow:hidden;text-align:center;height:auto;}.dhx_cal_lsection .dhx_readonly{font-size:9pt;font-size:8pt;padding:2px;color:#887A2E;}.dhx_cal_event_line .dhx_event_resize{cursor:w-resize;background:url(./imgs/resize_dots.png) repeat-y;position:absolute;top:0;width:4px;}.dhx_event_resize_start{left:0;}.dhx_event_resize_end{right:0;}.dhx_matrix_scell.folder,.dhx_data_table.folder .dhx_matrix_cell{background-color:#969394;cursor:pointer;}.dhx_matrix_scell .dhx_scell_level0{padding-left:5px;}.dhx_matrix_scell .dhx_scell_level1{padding-left:20px;}.dhx_matrix_scell .dhx_scell_level2{padding-left:35px;}.dhx_matrix_scell .dhx_scell_level3{padding-left:50px;}.dhx_matrix_scell .dhx_scell_level4{padding-left:65px;}.dhx_matrix_scell.folder{font-weight:bold;text-align:left;}.dhx_matrix_scell.folder .dhx_scell_expand{float:left;width:10px;padding-right:3px;}.dhx_matrix_scell.folder .dhx_scell_name{float:left;width:auto;}.dhx_matrix_scell.item .dhx_scell_name{padding-left:15px;text-align:left;}.dhx_data_table.folder .dhx_matrix_cell{border-right:0;}.dhx_section_timeline{overflow:hidden;padding:4px 0 2px 10px;}.dhx_section_timeline select{width:552px;}.dhx_map_area{width:100%;height:100%;overflow-y:auto;overflow-x:hidden;background-image:url(./imgs/databg.png);}.dhx_map_line .dhx_event_icon{width:20px;border-width:0;background:url(./imgs/icon.png) no-repeat;background-position:5px 4px;cursor:pointer;}.dhx_map_line{height:21px;clear:both;overflow:hidden;}.dhx_map{position:absolute;}.dhx_map_line div{float:left;border-right:1px dotted #8894A3;text-align:center;line-height:21px;overflow:hidden;}.dhx_map_line .headline_description{float:left;border-right:1px dotted #8894A3;text-align:center;line-height:21px;overflow:hidden;}.dhx_map_line .dhx_map_description{float:left;border-right:0 dotted #8894A3;text-align:center;line-height:21px;overflow:hidden;}.dhx_map_line .headline_date,.dhx_map_line .headline_description{border-left:0;}.dhx_map_line .line_description{float:left;border-right:1px dotted #8894A3;text-align:left;padding-left:5px;line-height:21px;overflow:hidden;}.dhx_map_line.highlight{background-color:#C4C5CC;}.dhx_map_area .dhx_map_line div{border-right:0 dotted #8894A3;}.dhtmlXTooltip.tooltip{-moz-box-shadow:3px 3px 3px #888;-webkit-box-shadow:3px 3px 3px #888;-o-box-shadow:3px 3px 3px #888;box-shadow:3px 3px 3px #888;filter:progid:DXImageTransform.Microsoft.Shadow(color='#888888',Direction=135,Strength=5);background-color:white;border-left:1px dotted #887A2E;border-top:1px dotted #887A2E;color:#887A2E;cursor:default;padding:10px;position:absolute;z-index:500;}.dhx_cal_checkbox label{padding-left:5px;}.dhx_cal_light .radio{padding:2px 0 2px 10px;}.dhx_cal_light .radio input,.dhx_cal_light .radio label{line-height:15px;}.dhx_cal_light .radio input{vertical-align:middle;margin:0;padding:0;}.dhx_cal_light .radio label{vertical-align:middle;padding-right:10px;}.dhx_cal_light .combo{padding:4px;}.dhx_cal_light_wide .dhx_combo_box{width:608px!important;left:10px;}.dhx_wa_column{float:left;}.dhx_wa_column_last .dhx_wa_day_cont{border-left:1px dotted #8894A3;}.dhx_wa_scale_bar{font-family:Tahoma;padding-left:10px;font-size:11px;border-top:1px dotted #8894A3;border-bottom:1px dotted #8894A3;}.dhx_wa_day_data{background-color:#FCFEFC;overflow-y:auto;}.dhx_wa_ev_body{border-bottom:1px dotted #789;font-size:12px;padding:5px 0 5px 7px;}.dhx_wa_dnd{font-family:Tahoma;position:absolute;padding-right:7px;color:#887AE2!important;background-color:#FFE763!important;border:1px solid #B7A543;}.dhx_cal_event_selected{background-color:#9cc1db;color:white;}.dhx_second_scale_bar{border-bottom:1px dotted #586A7E;padding-top:2px;}.dhx_cal_header div div{border-left:1px dotted #8894A3;}.dhx_grid_area{width:100%;height:100%;overflow-y:auto;background-color:#FCFEFC;}.dhx_grid_area table{border-collapse:collapse;border-spacing:0;width:100%;table-layout:fixed;}.dhx_grid_area td{table-layout:fixed;text-align:center;}.dhx_grid_line{height:21px;clear:both;overflow:hidden;}.dhx_grid_line div{float:left;cursor:default;padding-top:0;padding-bottom:0;text-align:center;line-height:21px;overflow:hidden;}.dhx_grid_area td,.dhx_grid_line div{padding-left:8px;padding-right:8px;}.dhx_grid_area tr.dhx_grid_event{height:21px;overflow:hidden;margin:0 0 1px 0;}.dhx_grid_area tr.dhx_grid_event td{border-bottom:1px solid #ECEEF4;}.dhx_grid_area tr.dhx_grid_event:nth-child(2n+1) td,.dhx_grid_area tr.dhx_grid_event:nth-child(2n) td{border-bottom-width:0;border-bottom-style:none;}.dhx_grid_area tr.dhx_grid_event:nth-child(2n){background-color:#ECEEF4;;}.dhx_grid_area .dhx_grid_dummy{table-layout:auto;margin:0!important;padding:0!important;}.dhx_grid_v_border{position:absolute;border-right:1px solid #A4BED4;width:1px;height:100%;}.dhx_grid_event_selected{background-color:#9cc1db!important;color:white!important;}.dhx_grid_sort_desc .dhx_grid_view_sort{background-position:0 -55px;}.dhx_grid_sort_asc .dhx_grid_view_sort{background-position:0 -66px;}.dhx_grid_view_sort{width:10px;height:10px;position:absolute;border:none!important;top:5px;background-repeat:no-repeat;background-image:url(./imgs/images.png);}.dhx_marked_timespan{position:absolute;width:100%;}.dhx_time_block{position:absolute;width:100%;background:silver;opacity:.4;filter:alpha(opacity=40);z-index:1;}.dhx_time_block_reset{opacity:1;filter:alpha(opacity=100);}.dhx_scheduler_month .dhx_marked_timespan{display:none;}.dhx_mini_calendar .dhx_marked_timespan{display:none;}.dhx_now_time{width:100%;border-bottom:2px dotted red;z-index:1;}.dhx_scheduler_month .dhx_now_time{border-bottom:0;border-left:2px dotted red;}.dhx_matrix_now_time{border-left:2px dotted red;z-index:1;}div.dhx_form_repeat input.radio{margin:-4px 0 0 -4px!ie;}div.dhx_form_repeat input.checkbox{margin:0 0 0 -4px!ie;}.dhx_form_repeat,.dhx_form_repeat input{padding:0;margin:0;padding-left:5px;font-family:Tahoma,Verdana;font-size:11px;line-height:24px;}.dhx_form_repeat{overflow:hidden;height:0;background-color:#FFF4B5;}.dhx_cal_light_wide .dhx_form_repeat{background-color:transparent;}.dhx_repeat_center,.dhx_repeat_left{height:115px;padding:10px 0 10px 10px;float:left;}.dhx_repeat_left{width:95px;}.dhx_repeat_center{width:335px;margin-top:12px;}.dhx_repeat_divider{float:left;height:115px;border-left:1px dotted #DCC43E;width:1px;}.dhx_repeat_right{float:right;height:115px;width:160px;padding:10px 3px 10px 10px;margin-top:7px;}input.dhx_repeat_text{height:16px;width:27px;margin:0 4px 0 4px;line-height:18px;padding:0 0 0 2px;}.dhx_form_repeat select{height:20px;width:87px;padding:0 0 0 2px;margin:0 4px 0 4px;}input.dhx_repeat_date{height:18px;width:80px;padding:0 0 0 2px;margin:0 4px 0 4px;background-repeat:no-repeat;background-position:64px 0;border:1px #7f9db9 solid;line-height:18px;}input.dhx_repeat_radio{margin-right:4px;}input.dhx_repeat_checkbox{margin:4px 4px 0 0;}.dhx_repeat_days td{padding-right:5px;}.dhx_repeat_days label{font-size:10px;}.dhx_custom_button{width:90px;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;}.dhx_custom_button_recurring{background-image:url(./imgs/but_repeat.gif);background-position:-5px 20px;width:20px;margin-right:10px;}.dhx_cal_light_rec{width:640px;}.dhx_cal_light_rec .dhx_cal_larea{width:632px;}.dhx_cal_light_rec.dhx_cal_light_wide{width:816px;}.dhx_cal_light_rec.dhx_cal_light_wide .dhx_cal_larea{width:808px;}.dhx_cal_event .dhx_title{border-width:1px 1px 0 1px;padding-top:1px;-webkit-border-top-left-radius:4px;-webkit-border-top-right-radius:4px;-moz-border-radius-topleft:4px;-moz-border-radius-topright:4px;border-top-left-radius:4px;border-top-right-radius:4px;font-family:arial;font-weight:bold;font-size:12px;}.dhx_cal_event .dhx_body,.dhx_cal_event.dhx_cal_select_menu .dhx_body{padding-bottom:8px;-webkit-border-bottom-right-radius:4px;-webkit-border-bottom-left-radius:4px;-moz-border-radius-bottomright:4px;-moz-border-radius-bottomleft:4px;border-bottom-right-radius:4px;border-bottom-left-radius:4px;}.dhx_cal_event .dhx_header,.dhx_cal_event.dhx_cal_select_menu .dhx_footer{display:none;}.dhx_cal_event .dhx_footer{height:5px;border:0;margin-top:-6px;background:url(imgs_dhx_terrace/resizing.png) no-repeat center center;}.dhx_cal_event .dhx_header,.dhx_cal_event .dhx_footer,.dhx_cal_event .dhx_body,.dhx_cal_event .dhx_title{background-color:#1796b0;border-color:transparent;color:white;}div.dhx_cal_editor{border:1px solid transparent;background-color:#1796b0;}.dhx_cal_editor{font-size:12px;font-family:Arial,sans-serif;}div.dhx_menu_head,div.dhx_menu_icon{background-image:url(imgs_dhx_terrace/controls.png);}.dhx_cal_event_line{border:1px solid #1796b0;background-color:#1796b0;color:white;height:17px;line-height:17px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;}.dhx_cal_event_line_start{-webkit-border-top-left-radius:9px;-webkit-border-bottom-left-radius:9px;-moz-border-radius-topleft:9px;-moz-border-radius-bottomleft:9px;border-top-left-radius:9px;border-bottom-left-radius:9px;}.dhx_cal_event_line_end{-webkit-border-top-right-radius:9px;-webkit-border-bottom-right-radius:9px;-moz-border-radius-topright:9px;-moz-border-radius-bottomright:9px;border-top-right-radius:9px;border-bottom-right-radius:9px;}.dhx_cal_event .dhx_body,.dhx_cal_event_line{font-size:12px;font-family:Arial,sans-serif;}.dhx_cal_container{background-color:white;}.dhx_cal_data{border-top:1px solid #CECECE;}.dhx_scale_holder{background-image:url(imgs_dhx_terrace/databg.png);border-right:1px solid #CECECE;}.dhx_scale_holder_now{background-image:url(imgs_dhx_terrace/databg_now.png);border-right:1px solid #CECECE;}.dhx_scale_hour{border-bottom:1px solid #CECECE;background-color:white;font:11px/44px Arial;color:#767676;}.dhx_cal_header{border:1px solid #CECECE;border-left:0;border-bottom:0;}.dhx_scale_bar{border-left:1px solid #CECECE;}.dhx_scale_bar{font:11px/16px Arial;color:#767676;padding-top:2px;background-color:white;}.dhx_cal_navline div{top:14px;}.dhx_cal_tab,.dhx_cal_date,.dhx_cal_today_button,.dhx_cal_prev_button,.dhx_cal_next_button{color:#454544;height:30px;line-height:30px;background:none;border:1px solid #CECECE;}.dhx_cal_navline .dhx_cal_date{border:0;font-size:18px;font-weight:normal;font-family:arial;width:100%;top:14px;text-align:center;position:absolute;left:0;z-index:-1;}.dhx_cal_today_button{color:#747473;left:auto;right:123px;background:none;text-decoration:none;width:80px;font-size:12px;font-weight:bold;font-family:arial;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;}.dhx_cal_prev_button,.dhx_cal_next_button{left:auto;width:46px;}.dhx_cal_prev_button{right:61px;background:url(imgs_dhx_terrace/arrow_left.png) no-repeat center center;-webkit-border-top-left-radius:5px;-webkit-border-bottom-left-radius:5px;-moz-border-radius-topleft:5px;-moz-border-radius-bottomleft:5px;border-top-left-radius:5px;border-bottom-left-radius:5px;}.dhx_cal_next_button{right:14px;background:url(imgs_dhx_terrace/arrow_right.png) no-repeat center center;-webkit-border-top-right-radius:5px;-webkit-border-bottom-right-radius:5px;-moz-border-radius-topright:5px;-moz-border-radius-bottomright:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;}.dhx_cal_tab{color:#747473;width:60px;padding-top:0;text-decoration:none;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;font-weight:bold;font-family:arial;font-size:12px;}.dhx_cal_tab.active{background-color:#F0EDE7;color:#454544;border:1px solid #CECECE;text-shadow:0 1px 0 white;}.dhx_cal_tab_first{-webkit-border-top-left-radius:5px;-webkit-border-bottom-left-radius:5px;-moz-border-radius-topleft:5px;-moz-border-radius-bottomleft:5px;border-top-left-radius:5px;border-bottom-left-radius:5px;}.dhx_cal_tab_last{-webkit-border-top-right-radius:5px;-webkit-border-bottom-right-radius:5px;-moz-border-radius-topright:5px;-moz-border-radius-bottomright:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;}.dhx_cal_tab_standalone{-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;padding:0 5px;}.dhx_multi_day,.dhx_multi_day_icon_small,.dhx_multi_day_icon{background-color:white;}.dhx_multi_day{border-top:1px solid #CECECE;}.dhx_multi_day_icon,.dhx_multi_day_icon_small{border-bottom:1px solid #CECECE;border-right:1px solid #CECECE;}.dhx_multi_day_icon_small{background-image:url(imgs_dhx_terrace/clock_small.gif);}.dhx_multi_day_icon{background-image:url(imgs_dhx_terrace/clock_big.gif);}.dhx_month_head,.dhx_after .dhx_month_head,.dhx_before .dhx_month_head,.dhx_after .dhx_month_body,.dhx_before .dhx_month_body{background-color:white;}.dhx_month_head{height:21px;padding-top:0;font:12px/21px Arial;color:#362d26;border-right:1px solid #CECECE;}.dhx_after .dhx_month_head,.dhx_before .dhx_month_head,.dhx_after .dhx_month_head,.dhx_before .dhx_month_head{color:#bbb;}.dhx_month_body{border-right:1px solid #CECECE;border-bottom:1px solid #CECECE;}.dhx_now .dhx_month_head,.dhx_now .dhx_month_body{background-color:#FFF3A1;font-weight:normal;}.dhx_cal_event_clear{color:#0E64A0;}.dhx_cal_larea{margin-left:0;}.dhx_cal_light_wide .dhx_cal_larea{margin-left:3px;}.dhx_cal_light_wide .dhx_wrap_section{padding:5px 0;}.dhx_cal_light,.dhx_cal_larea,.dhx_cal_lsection,.dhx_wrap_section,.dhx_cal_light_wide .dhx_wrap_section,.dhx_cal_ltext textarea{background-color:white;}.dhx_cal_lsection,.dhx_cal_light_wide .dhx_cal_lsection .dhx_fullday,.dhx_cal_lsection .dhx_fullday,.dhx_cal_light input{color:#747473;}.dhx_cal_light_wide .dhx_wrap_section{border-top:0;border-bottom:1px solid #CECECE;}.dhx_cal_larea{border:1px solid transparent;}.dhx_cal_ltext textarea,.dhx_cal_light select,.dhx_cal_light{color:#2E2E2E;}.dhx_cal_light{border:1px solid #CECECE;}.dhx_cal_light_wide .dhx_cal_lsection,.dhx_cal_light_wide .dhx_cal_lsection .dhx_fullday{font-size:13px;}.dhx_section_time{background-color:transparent;}.dhx_save_btn,.dhx_cancel_btn,.dhx_delete_btn{display:none;}.dhx_btn_set,.dhx_btn_set div{height:30px;padding:0 20px;line-height:30px;}.dhx_btn_set{margin:12px 0 0 0;padding:0;font-size:12px;color:#454544;font-weight:bold;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;}.dhx_left_btn_set{margin-left:20px;}.dhx_right_btn_set{margin-right:20px;}.dhx_save_btn_set{border:1px solid #22A1BC;color:white;text-shadow:0 -1px 0 #6F6F6F;background-color:#22A1BC;}.dhx_cancel_btn_set{border:1px solid #CECECE;}.dhx_delete_btn_set{border:1px solid #FF8831;background-color:#FF8831;color:white;text-shadow:0 -1px 0 #93755F;}.dhx_cal_ltitle{height:30px;line-height:30px;border-bottom:1px solid #CECECE;}.dhx_mark{display:none;}.dhx_time{padding-left:10px;}.dhx_close_icon{float:right;width:9px;height:9px;background:url(imgs_dhx_terrace/close_icon.png) no-repeat center center;padding:10px;margin-top:1px;}.dhx_cal_light_wide .dhx_cal_ltext.dhx_cal_template{line-height:22px;}.dhx_cal_ltext textarea{line-height:20px;box-sizing:border-box;-moz-box-sizing:border-box;border:1px solid #CECECE;background-color:#F9F9F9;}.dhtmlx_modal_box{background:white;width:330px;}.dhtmlx_popup_controls{padding-bottom:9px;}.dhtmlx_popup_button,.dhtmlx_popup_button:active,.dhtmlx_popup_button div,.dhtmlx_popup_button div:active{color:#444;background:white;box-shadow:none;}.dhtmlx_popup_button.dhtmlx_ok_button{border:1px solid #22A1BC;background-color:#22A1BC;}.dhtmlx_popup_button.dhtmlx_ok_button div{background:#22A1BC;border:1px solid #22A1BC;color:white;text-shadow:0 -1px 0 #6F6F6F;}.dhx_cal_container.dhx_mini_calendar{box-sizing:border-box;border:1px solid #CECECE;box-shadow:2px 2px 5px #888;}.dhx_mini_calendar .dhx_year_month{border:1px solid #CECECE;font-family:Arial;}.dhx_mini_calendar .dhx_month_head,.dhx_mini_calendar .dhx_year_month,.dhx_mini_calendar .dhx_month_body,.dhx_mini_calendar .dhx_scale_bar,.dhx_mini_calendar .dhx_year_body{border-color:transparent;}.dhx_mini_calendar .dhx_year_body{padding-top:1px;}.dhx_mini_calendar .dhx_scale_bar{border-width:0;}.dhx_mini_calendar .dhx_year_week{border-bottom:1px solid #CECECE;padding-top:1px;}.dhx_mini_calendar .dhx_month_head{padding-right:0;margin-right:1px;text-align:center;}.dhx_mini_calendar .dhx_cal_prev_button,.dhx_mini_calendar .dhx_cal_next_button{border:0;height:20px;}.dhx_cal_navline div.dhx_minical_icon{left:210px;top:14px;width:30px;height:30px;background:url(./imgs_dhx_terrace/calendar.gif) no-repeat;background-position:3px 5px;}.dhx_cal_event_line .dhx_event_resize{background:url(./imgs_dhx_terrace/resize_dots.png) repeat-y;}.dhx_matrix_scell,.dhx_matrix_cell{border-bottom:1px solid #CECECE;border-right:1px solid #CECECE;}.dhx_cal_header div div{border-left:1px solid #CECECE;}.dhx_matrix_scell.folder{border-right:0;}.dhx_second_scale_bar{border-bottom:1px solid #CECECE;}.dhx_repeat_divider{border-left:1px solid #CECECE;}.dhx_custom_button{background-color:white;border:1px solid #CECECE;color:#747473;}.dhx_cal_light_wide .dhx_custom_button{margin-top:6px;}.dhx_custom_button_recurring{background-image:url(./imgs_dhx_terrace/but_repeat.gif);}.dhx_v_border,.dhx_agenda_line div{border-right:1px solid #CECECE;}.dhx_year_month{border:1px solid #CECECE;}.dhx_scale_bar_last{border-right:1px solid #CECECE;}.dhx_year_body{border-left:1px solid #CECECE;}.dhx_expand_icon{top:-3px;}.dhx_scale_bar .dhx_cal_next_button,.dhx_scale_bar .dhx_cal_prev_button{width:20px;height:20px;top:0!important;border:0;}.dhx_scale_bar .dhx_cal_next_button{right:1px!important;border-left:1px solid #CECECE;}.dhx_scale_bar .dhx_cal_prev_button{left:1px!important;border-right:1px solid #CECECE;}.dhx_map_line .headline_date,.dhx_map_line .headline_description{border:0;}.dhx_map_line .headline_date{border-right:1px solid #CECECE;}.dhtmlXTooltip.tooltip{border-left:1px solid #CECECE;border-top:1px solid #CECECE;color:#747473;font-size:12px;line-height:16px;}.dhx_wa_scale_bar{border-top:1px solid #CECECE;border-bottom:1px solid #CECECE;}.dhx_wa_column_last .dhx_wa_day_cont{border-left:1px solid #CECECE;}.dhx_wa_ev_body{border-bottom:1px solid #CECECE;}.dhx_wa_scale_bar{background-color:#f0ede7;}.dhx_wa_ev_body.dhx_cal_event_selected{background-color:#fff3a1;color:#362d26;}.dhx_wa_dnd{background-color:#fddb93!important;color:#747473!important;border:1px solid #ccb177;}.dhx_text_disabled{color:#2E2E2E;}.dhx_cal_ltext .dhx_text_disabled{line-height:22px;}.dhx_grid_v_border{border-right-color:#CECECE;}
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler_glossy.css b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler_glossy.css index 64cf1bc40c5..7831ca4028c 100644 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler_glossy.css +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler_glossy.css @@ -1,5 +1,5 @@ /* This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details +to use it in non-GPL project. Please contact sales@dhtmlx.com for details */ -.dhx_cal_container{background-color:#C2D5FC;font-family:Tahoma;font-size:8pt;position:relative;overflow:hidden;}.dhx_cal_container div{-moz-user-select:none;-moz-user-select:-moz-none;}.dhx_cal_navline{height:20px;position:absolute;z-index:3;width:750px;color:#2F3A48;}.dhx_cal_navline div{position:absolute;top:2px;white-space:nowrap;}.dhx_cal_navline .dhx_cal_date{font-weight:600;left:210px;}.dhx_cal_button .dhx_left_bg{width:1px;overflow:hidden;height:17px;z-index:20;top:0;}.dhx_cal_prev_button{background-image:url(imgs/buttons.png);background-position:0 0;width:29px;height:17px;left:50px;cursor:pointer;}.dhx_cal_next_button{background-image:url(imgs/buttons.png);background-position:-30px 0;width:29px;height:17px;left:80px;cursor:pointer;}.dhx_cal_today_button{background-image:url(imgs/buttons.png);background-position:-60px 0;width:75px;height:17px;left:112px;cursor:pointer;text-align:center;text-decoration:underline;}.dhx_cal_tab{width:59px;height:19px;text-align:center;text-decoration:underline;padding-top:2px;cursor:pointer;background-color:#D8E1EA;-webkit-border-top-left-radius:4px;-webkit-border-top-right-radius:4px;-moz-border-radius-topleft:4px;-moz-border-radius-topright:4px;border-top-left-radius:4px;border-top-right-radius:4px;}.dhx_cal_tab.active{text-decoration:none;cursor:default;font-weight:bold;border:1px dotted #586A7E;border-bottom:0;background-color:#C2D5FC;}.dhx_cal_header{position:absolute;left:10px;top:23px;width:750px;border-top:1px dotted #8894A3;border-right:1px dotted #8894A3;z-index:2;overflow:hidden;color:#2F3A48;}.dhx_cal_data{border-top:1px dotted #8894A3;position:absolute;top:44px;width:600px;overflow-y:auto;overflow-x:hidden;}.dhx_scale_bar{position:absolute;text-align:center;background-color:#C2D5FC;padding-top:3px;border-left:1px dotted #586A7E;}.dhx_scale_holder{position:absolute;border-right:1px dotted #586A7E;background-image:url(imgs/databg.png);}.dhx_scale_holder_now{position:absolute;border-right:1px dotted #586A7E;background-image:url(imgs/databg_now.png);}.dhx_scale_hour{height:41px;width:50px;border-bottom:1px dotted #8894A3;background-color:#C2D5FC;text-align:center;line-height:40px;color:#586A7E;overflow:hidden;}.dhx_month_head{background-color:#EBEFF4;color:#2F3A48;border-right:1px dotted #586A7E;height:18px;padding-right:5px;padding-top:3px;text-align:right;}.dhx_month_body{border-right:1px dotted #586A7E;border-bottom:1px dotted #586A7E;background-color:#FFF;}.dhx_now .dhx_month_body{background-color:#E2EDFF;}.dhx_after .dhx_month_body,.dhx_before .dhx_month_body{background-color:#ECECEC;}.dhx_after .dhx_month_head,.dhx_before .dhx_month_head{background-color:#E2E3E6;color:#94A6BB;}.dhx_now .dhx_month_head{background-color:#D1DEF4;font-weight:bold;}.dhx_cal_drag{position:absolute;z-index:9999;background-color:#FFE763;border:1px solid #B7A543;opacity:.5;filter:alpha(opacity=50);}.dhx_loading{position:absolute;width:128px;height:15px;background-image:url(imgs/loading.gif);z-index:9999;}.dhx_multi_day_icon,.dhx_multi_day{background-color:#E1E6FF;background-repeat:no-repeat;border-right:1px dotted #8894A3;}.dhx_multi_day{position:absolute;border-top:1px dotted #8894A3;}.dhx_multi_day_icon{background-image:url(imgs/clock_big.gif);}.dhx_multi_day_icon_small{background-image:url(imgs/clock_small.gif);}.dhx_multi_day_icon,.dhx_multi_day_icon_small{background-position:center center;background-color:#E1E6FF;background-repeat:no-repeat;border-bottom:1px dotted #8894A3;border-right:1px dotted #8894A3;}.dhtmlxLayoutPolyContainer_dhx_skyblue .dhx_cal_container{background-color:#d0e5ff;}.dhx_cal_event div{background-color:#FFE763;border:1px solid #B7A543;color:#887A2E;overflow:hidden;width:100%;font-family:Tahoma;font-size:8pt;}.dhx_move_denied .dhx_cal_event .dhx_header,.dhx_move_denied .dhx_cal_event .dhx_title{cursor:default;}.dhx_cal_event .dhx_header{height:1px;margin-left:1px;border-width:1px 1px 0 1px;cursor:pointer;}.dhx_cal_event .dhx_title{height:12px;border-width:0 1px 1px 1px;border-bottom-style:dotted;font-size:7pt;font-weight:bold;text-align:center;background-position:right;background-repeat:no-repeat;cursor:pointer;}.dhx_cal_event .dhx_body{border-width:0 1px 1px 1px;padding:5px;}.dhx_resize_denied .dhx_cal_event .dhx_footer{cursor:default;}.dhx_cal_event .dhx_footer{height:1px;margin-left:2px;border-width:0 1px 1px 1px;cursor:s-resize;}.dhx_cal_event_line{background-color:#FFE763;border:1px solid #B7A543;border-radius:3px;font-family:Tahoma;font-size:8pt;height:13px;padding-left:10px;color:#887A2E;cursor:pointer;overflow:hidden;}.dhx_cal_event_clear{font-family:Tahoma;font-size:8pt;height:13px;padding-left:2px;color:#887A2E;white-space:nowrap;overflow:hidden;cursor:pointer;}.dhx_in_move{background-color:#FFFF80;}div.dhx_cal_editor{background-color:#FFE763;border:1px solid #B7A543;border-top-style:dotted;z-index:999;position:absolute;overflow:hidden;}textarea.dhx_cal_editor{width:100%;height:100%;border:0 solid black;margin:none;padding:none;overflow:auto;}div.dhx_menu_head{background-image:url(imgs/controls.gif);background-position:0 -43px;width:10px;height:10px;margin-left:5px;margin-top:1px;border:none;cursor:default;}div.dhx_menu_icon{background-image:url(imgs/controls.gif);width:20px;height:20px;margin-left:-5px;margin-top:0;border:none;cursor:pointer;}div.icon_details{background-position:0 0;}div.icon_edit{background-position:-22px 0;}div.icon_save{background-position:-84px -1px;}div.icon_cancel{background-position:-62px 0;}div.icon_delete{background-position:-42px 0;}div.dhx_now_time{position:absolute;width:100%;border-bottom:2px dotted red;z-index:1;}div.dhx_time_block{position:absolute;width:100%;background:silver;opacity:.4;filter:alpha(opacity=40);z-index:1;}.dhx_unselectable,.dhx_unselectable div{-webkit-user-select:none;-moz-user-select:none;-moz-user-select:-moz-none;}.dhx_cal_light{background-color:#FFE763;border-radius:5px;font-family:Tahoma;font-size:8pt;border:1px solid #B7A64B;color:#887A2E;position:absolute;z-index:10001;width:580px;height:300px;box-shadow:5px 5px 5px #888;}.dhx_cal_light_wide{width:650px;}.dhx_mark{position:relative;top:3px;background-image:url('./imgs/controls.gif');background-position:0 -43px;padding-left:10px;}.dhx_ie6 .dhx_mark{background-position:6px -41px;}.dhx_cal_light select{font-family:Tahoma;font-size:8pt;color:#887A2E;padding:2px;margin:0;}.dhx_cal_ltitle{padding:2px 0 2px 5px;overflow:hidden;white-space:nowrap;}.dhx_cal_ltitle span{white-space:nowrap;}.dhx_cal_lsection{background-color:#DBCF8C;color:#FFF4B5;font-weight:bold;padding:5px 0 3px 10px;}.dhx_section_time{background-color:#DBCF8C;}.dhx_cal_lsection .dhx_fullday{float:right;margin-right:5px;color:#887A2E;font-size:12px;font-weight:normal;line-height:20px;vertical-align:top;cursor:pointer;}.dhx_cal_lsection{font-size:18px;font-family:Arial;}.dhx_cal_ltext{padding:2px 0 2px 10px;overflow:hidden;}.dhx_cal_ltext textarea{background-color:#FFF4B5;overflow:auto;border:none;color:#887A2E;height:100%;width:100%;outline:none!important;}.dhx_time{font-weight:bold;}.dhx_cal_light .dhx_title{padding-left:10px;}.dhx_cal_larea{border:1px solid #DCC43E;background-color:#FFF4B5;overflow:hidden;margin-left:3px;width:572px;height:1px;}.dhx_btn_set{padding:5px 10px 0 10px;float:left;}.dhx_btn_set div{float:left;height:21px;line-height:21px;vertical-align:middle;cursor:pointer;}.dhx_save_btn{background-image:url('./imgs/controls.gif');background-position:-84px 0;width:21px;}.dhx_cancel_btn{background-image:url('./imgs/controls.gif');background-position:-63px 0;width:20px;}.dhx_delete_btn{background-image:url('./imgs/controls.gif');background-position:-42px 0;width:20px;}.dhx_cal_cover{width:100%;height:100%;position:absolute;z-index:10000;top:0;left:0;background-color:black;opacity:.1;filter:alpha(opacity=10);}.dhx_custom_button{padding:0 3px 0 3px;color:#887A2E;font-family:Tahoma;font-size:8pt;background-color:#FFE763;font-weight:normal;margin-right:5px;margin-top:0;cursor:pointer;}.dhx_custom_button div{cursor:pointer;float:left;height:21px;line-height:21px;vertical-align:middle;}.dhx_cal_light_wide .dhx_cal_larea{border-top-width:0;}.dhx_cal_light_wide .dhx_cal_lsection{border:0;float:left;text-align:right;width:100px;height:20px;font-size:16px;padding:5px 0 0 10px;}.dhx_cal_light_wide .dhx_wrap_section{border-top:1px solid #DBCF8C;position:relative;background-color:#DBCF8C;overflow:hidden;}.dhx_cal_light_wide .dhx_section_time{padding-top:2px!important;height:20px!important;}.dhx_section_time{text-align:center;}.dhx_cal_light_wide .dhx_cal_larea{width:730px;}.dhx_cal_light_wide{width:738px;}.dhx_cal_light_wide .dhx_section_time{background:transparent;}.dhx_cal_light_wide .dhx_cal_checkbox label{padding-left:0;}.dhx_cal_wide_checkbox input{margin-top:8px;margin-left:14px;}.dhx_cal_light input{font-family:Tahoma;font-size:8pt;color:#887A2E;}.dhx_cal_light_wide .dhx_cal_lsection .dhx_fullday{float:none;margin-right:0;color:#FFF4B5;font-weight:bold;font-size:16px;font-family:Arial;cursor:pointer;}.dhx_custom_button{float:right;height:21px;width:90px;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;}.dhx_cal_light_wide .dhx_custom_button{position:absolute;top:0;right:0;margin-top:2px;}.dhx_cal_light_wide .dhx_repeat_right{margin-right:55px;}.dhx_scale_bar_header{position:absolute;border-bottom:1px dotted #8894A3;width:100%;}.dhx_expand_icon{position:absolute;top:0;right:0;background-image:url(./imgs/colapce-expand-icon.gif);width:18px;height:18px;cursor:pointer;background-position:0 18px;z-index:16;}.dhx_agenda_area{width:100%;height:100%;overflow-y:auto;background-image:url(./imgs/databg.png);}.dhx_agenda_line{height:21px;clear:both;overflow:hidden;}.dhx_agenda_line div{float:left;width:188px;border-right:1px dotted #8894A3;text-align:center;line-height:21px;overflow:hidden;}.dhx_agenda_area .dhx_agenda_line div{border-right:0 dotted #8894A3;}.dhx_v_border{position:absolute;left:186px;top:0;border-right:1px dotted #8894A3;width:1px;height:100%;}.dhx_agenda_line .dhx_event_icon{width:20px;border-width:0;background:url(./imgs/icon.png) no-repeat;background-position:5px 4px;cursor:pointer;}.dhx_agenda_line span{padding-left:5px;line-height:21px;}.dhx_year_body{border-left:1px dotted #586A7E;}.dhx_year_week{position:relative;}.dhx_scale_bar_last{border-right:1px dotted #586A7E;}.dhx_year_month{height:18px;padding-top:3px;border:1px dotted #586A7E;text-align:center;vertical-align:middle;}.dhx_year_body .dhx_before .dhx_month_head,.dhx_year_body .dhx_after .dhx_month_head,.dhx_year_body .dhx_before .dhx_month_head a,.dhx_year_body .dhx_after .dhx_month_head a{color:#E2E3E6!important;}.dhx_year_body .dhx_month_body{height:0;overflow:hidden;}.dhx_month_head.dhx_year_event{background-color:#FFE763;}.dhx_year_body .dhx_before .dhx_month_head,.dhx_year_body .dhx_after .dhx_month_head{cursor:default;}.dhx_tooltip{border:1px solid #BBB;background-image:url(./imgs/databg.png);position:absolute;z-index:9998;width:300px;height:auto;font-family:Tahoma;font-size:8pt;overflow:hidden;}.dhx_tooltip_line{line-height:20px;height:20px;overflow:hidden;}.dhx_tooltip_line .dhx_event_icon{width:20px;height:20px;padding-right:10px;float:left;border-width:0;position:relative;background:url(./imgs/icon.png) no-repeat;background-position:5px 4px;cursor:pointer;}.dhx_tooltip_date{float:left;width:auto;padding-left:5px;text-align:center;}.dhx_text_disabled{color:#887A2E;font-family:Tahoma;font-size:8pt;}.dhx_mini_calendar{-moz-box-shadow:5px 5px 5px #888;-khtml-box-shadow:5px 5px 5px #888;}.dhx_mini_calendar .dhx_month_head{cursor:pointer;}.dhx_mini_calendar .dhx_calendar_click{background-color:#C2D5FC;}.dhx_cal_navline div.dhx_minical_icon{width:18px;height:18px;left:190px;top:1px;cursor:pointer;background-image:url(./imgs/calendar.gif);}.dhx_matrix_scell{height:100%;}.dhx_matrix_cell,.dhx_matrix_scell{overflow:hidden;text-align:center;vertical-align:middle;border-bottom:1px dotted #8894A3;border-right:1px dotted #8894A3;}.dhx_matrix_cell{background-color:white;}.dhx_matrix_line{overflow:hidden;}.dhx_matrix_cell div,.dhx_matrix_scell div{overflow:hidden;text-align:center;height:auto;}.dhx_cal_lsection .dhx_readonly{font-size:9pt;font-size:8pt;padding:2px;color:#887A2E;}.dhx_matrix_scell.folder,.dhx_data_table.folder .dhx_matrix_cell{background-color:#969394;cursor:pointer;}.dhx_matrix_scell .dhx_scell_level0{padding-left:5px;}.dhx_matrix_scell .dhx_scell_level1{padding-left:20px;}.dhx_matrix_scell .dhx_scell_level2{padding-left:35px;}.dhx_matrix_scell .dhx_scell_level3{padding-left:50px;}.dhx_matrix_scell .dhx_scell_level4{padding-left:65px;}.dhx_matrix_scell.folder{font-weight:bold;text-align:left;}.dhx_matrix_scell.folder .dhx_scell_expand{float:left;width:10px;padding-right:3px;}.dhx_matrix_scell.folder .dhx_scell_name{float:left;width:auto;}.dhx_matrix_scell.item .dhx_scell_name{padding-left:15px;text-align:left;}.dhx_data_table.folder .dhx_matrix_cell{border-right:0;}.dhx_section_timeline{overflow:hidden;padding:4px 0 2px 10px;}.dhx_section_timeline select{width:552px;}.dhx_map_area{width:100%;height:100%;overflow-y:auto;overflow-x:hidden;background-image:url(./imgs/databg.png);}.dhx_map_line .dhx_event_icon{width:20px;border-width:0;background:url(./imgs/icon.png) no-repeat;background-position:5px 4px;cursor:pointer;}.dhx_map_line{height:21px;clear:both;overflow:hidden;}.dhx_map{position:absolute;}.dhx_map_line div{float:left;border-right:1px dotted #8894A3;text-align:center;line-height:21px;overflow:hidden;}.dhx_map_line .headline_description{float:left;border-right:1px dotted #8894A3;text-align:center;line-height:21px;overflow:hidden;}.dhx_map_line .dhx_map_description{float:left;border-right:0 dotted #8894A3;text-align:center;line-height:21px;overflow:hidden;}.dhx_map_line .line_description{float:left;border-right:1px dotted #8894A3;text-align:left;padding-left:5px;line-height:21px;overflow:hidden;}.dhx_map_line.highlight{background-color:#C4C5CC;}.dhx_map_area .dhx_map_line div{border-right:0 dotted #8894A3;}.dhtmlXTooltip.tooltip{-moz-box-shadow:3px 3px 3px #888;-webkit-box-shadow:3px 3px 3px #888;-o-box-shadow:3px 3px 3px #888;box-shadow:3px 3px 3px #888;filter:progid:DXImageTransform.Microsoft.Shadow(color='#888888',Direction=135,Strength=5);background-color:white;border-left:1px dotted #887A2E;border-top:1px dotted #887A2E;color:#887A2E;cursor:default;padding:10px;position:absolute;z-index:500;}.dhx_cal_checkbox label{padding-left:5px;}.dhx_cal_light .radio{padding:2px 0 2px 10px;}.dhx_cal_light .radio input,.dhx_cal_light .radio label{line-height:15px;}.dhx_cal_light .radio input{vertical-align:middle;margin:0;padding:0;}.dhx_cal_light .radio label{vertical-align:middle;padding-right:10px;}.dhx_cal_light .combo{padding:4px;}.dhx_wa_column{float:left;}.dhx_wa_column_last .dhx_wa_day_cont{border-left:1px dotted #8894A3;}.dhx_wa_scale_bar{font-family:Tahoma;padding-left:10px;font-size:11px;border-top:1px dotted #8894A3;border-bottom:1px dotted #8894A3;}.dhx_wa_day_data{background-color:#FCFEFC;overflow-y:auto;}.dhx_wa_ev_body{border-bottom:1px dotted #789;font-size:12px;padding:5px 0 5px 7px;}.dhx_wa_dnd{font-family:Tahoma;position:absolute;padding-right:7px;color:#887AE2!important;background-color:#FFE763!important;border:1px solid #B7A543;}.dhx_cal_event_selected{background-color:#9cc1db;color:white;}.dhx_second_scale_bar{border-bottom:1px dotted #586A7E;padding-top:2px;}div.dhx_form_repeat input.radio{margin:-4px 0 0 -4px!ie;}div.dhx_form_repeat input.checkbox{margin:0 0 0 -4px!ie;}.dhx_form_repeat,.dhx_form_repeat input{padding:0;margin:0;padding-left:5px;font-family:Tahoma,Verdana;font-size:11px;line-height:24px;}.dhx_form_repeat{overflow:hidden;height:0;background-color:#FFF4B5;}.dhx_cal_light_wide .dhx_form_repeat{background-color:transparent;}.dhx_repeat_center,.dhx_repeat_left{height:115px;padding:10px 0 10px 10px;float:left;}.dhx_repeat_left{width:95px;}.dhx_repeat_center{width:335px;margin-top:12px;}.dhx_repeat_divider{float:left;height:115px;border-left:1px dotted #DCC43E;width:1px;}.dhx_repeat_right{float:right;height:115px;width:160px;padding:10px 3px 10px 10px;margin-top:7px;}input.dhx_repeat_text{height:16px;width:27px;margin:0 4px 0 4px;line-height:18px;padding:0 0 0 2px;}.dhx_form_repeat select{height:20px;width:87px;padding:0 0 0 2px;margin:0 4px 0 4px;}input.dhx_repeat_date{height:18px;width:80px;padding:0 0 0 2px;margin:0 4px 0 4px;background-repeat:no-repeat;background-position:64px 0;border:1px #7f9db9 solid;line-height:18px;}input.dhx_repeat_radio{margin-right:4px;}input.dhx_repeat_checkbox{margin:4px 4px 0 0;}.dhx_repeat_days td{padding-right:5px;}.dhx_repeat_days label{font-size:10px;}.dhx_custom_button{width:90px;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;}.dhx_custom_button_recurring{background-image:url(./imgs/but_repeat.gif);background-position:-5px 20px;width:20px;margin-right:10px;}.dhx_cal_light_rec{width:640px;}.dhx_cal_light_rec .dhx_cal_larea{width:632px;}.dhx_cal_light_rec.dhx_cal_light_wide{width:816px;}.dhx_cal_light_rec.dhx_cal_light_wide .dhx_cal_larea{width:808px;}.dhx_cal_tab.active{border:none;}.dhx_multi_day{border:none;border-top:1px solid #A4BED4;}.dhx_multi_day_icon,.dhx_multi_day_icon_small{border-right:none;}.dhx_cal_container{background-image:url(imgs_glossy/top-days-bg.png);background-position:0 24px;background-repeat:repeat-x;background-color:#EBEBEB;}.dhx_cal_navline{background-color:#EBEBEB;height:23px!important;}.dhx_cal_prev_button{background-image:url(imgs_glossy/buttons.gif);width:30px;height:20px;}.dhx_cal_next_button{background-image:url(imgs_glossy/buttons.gif);width:30px;height:20px;}.dhx_cal_today_button{padding-top:3px;background-image:url(imgs_glossy/buttons.gif);width:67px;left:110px;text-decoration:none;}.dhx_cal_navline .dhx_cal_date{padding-top:4px;left:230px;}.dhx_cal_tab{background-image:url(imgs_glossy/white_tab.png);width:60px;height:15px;text-decoration:none;padding-top:4px;margin-top:4px;}.dhx_cal_tab.active{background-image:url(imgs_glossy/blue_tab.png);height:18px;width:60px;padding-top:4px;margin-top:2px;}.dhx_cal_data{border-top:1px solid #A4BED4;}.dhx_cal_header{background-image:url(imgs_glossy/top-days-bg.png);background-repeat:repeat-x;border-top:0;border-right:0;}.dhx_scale_bar{background-image:url(imgs_glossy/top-separator.gif);background-position:0 0;background-repeat:no-repeat;background-color:transparent;padding-top:3px;border-left:0;}.dhx_scale_holder{border-right:1px solid #A4BED4;}.dhx_scale_holder_now{border-right:1px solid #A4BED4;}.dhx_scale_hour{background-image:url(imgs_glossy/left-time-bg.png);border-bottom:1px solid #A4BED4;color:#2F3A48;}.dhx_multi_day{background-image:url(imgs_glossy/multi-days-bg.png);background-repeat:repeat;border-bottom:1px solid #A4BED4;border-left:0;}.dhx_multi_day_icon,.dhx_multi_day_icon_small{background-image:url(imgs_glossy/multi-days-bg.png);border-bottom:1px solid #A4BED4;border-left:1px solid #fff;background-position:0 0;background-repeat:repeat;}.dhx_month_head{background-color:#FFF;}.dhx_after .dhx_month_head,.dhx_before .dhx_month_head{background-color:#EFEDE2;}.dhx_now .dhx_month_head{background-color:#E4EFFF;}.dhx_after .dhx_month_body,.dhx_before .dhx_month_body{background-color:#EFEDE2;}.dhx_cal_event div{border:1px solid #FFBD51;background-color:#FFE4AB;color:#000;}.dhx_cal_event_clear{color:#000;}.dhx_cal_event_line{background-image:url(imgs_glossy/event-bg.png);border:1px solid #FFBD51;color:#000;}.dhx_in_move{background-image:url(imgs_glossy/move.png);}.dhx_cal_event .dhx_body{background-color:#FFE4AB;}.dhx_cal_event .dhx_title{background-color:#FFE4AB;}.dhx_cal_light{-moz-box-shadow:5px 5px 5px #888;-khtml-box-shadow:5px 5px 5px #888;background-color:#EBEBEB;border:2px solid #A4BED4;color:#000;}.dhx_cal_larea{border:1px solid #A4BED4;border-width:0 1px 1px;background-color:#FFF;}.dhx_cal_lsection{background-image:url(imgs_glossy/lightbox.png);font-size:14px;padding:5px 0 5px 10px;color:#000;}.dhx_cal_light_wide .dhx_cal_lsection{background-image:url(imgs_glossy/multi-days-bg.png);}.dhx_cal_ltext textarea{background-color:#fff;color:#000;}.dhx_cal_light select,.dhx_cal_light input{color:#000;}.dhx_save_btn{background-image:url(imgs_glossy/controlls5.png);}.dhx_cancel_btn{background-image:url(imgs_glossy/controlls5.png);}.dhx_delete_btn{background-image:url(imgs_glossy/controlls5.png);}div.dhx_menu_head{background-image:url(imgs_glossy/controlls5.png);border:1px solid #FFE4AB;}div.dhx_menu_icon{background-image:url(imgs_glossy/controlls5.png);border:medium none;}.dhx_section_time{height:20px!important;padding:7px 0!important;text-align:center;background:white;}div.dhx_cal_editor{background-color:#FFE4AB;}.dhx_year_month{background-image:url(imgs_glossy/top-days-bg.png);border:0;}.dhx_year_week{background-image:url(imgs_glossy/top-days-bg.png);}.dhx_month_head{border-right:1px solid #A4BED4;}.dhx_month_body{border-right:1px solid #A4BED4;border-bottom:1px solid #A4BED4;}.dhx_year_body{border-left:1px solid #A4BED4;}.dhx_scale_bar_last{border-right:none;}.dhx_month_head.dhx_year_event{background-color:#FFE4AB;}.dhx_year_body .dhx_before .dhx_month_head,.dhx_year_body .dhx_after .dhx_month_head,.dhx_year_body .dhx_before .dhx_month_head a,.dhx_year_body .dhx_after .dhx_month_head a{color:#EFEDE2!important;}.dhx_cal_lsection .dhx_readonly{color:#000;}.dhx_tooltip{-moz-box-shadow:2px 2px 2px #888;-khtml-box-shadow:2px 2px 2px #888;}.dhx_custom_button{margin-top:-2px;}.dhx_cal_lsection .dhx_fullday{color:#000;}.dhx_cal_lsection.dhx_cal_checkbox{height:16px;line-height:18px;}.dhx_cal_light_wide .dhx_cal_lsection.dhx_cal_checkbox{height:20px;}.dhx_cal_checkbox label{vertical-align:top;}.dhx_cal_light_wide .dhx_cal_lsection{color:black;}.dhx_cal_light_wide .dhx_wrap_section{border-top:1px solid #A4BED4;background-image:url(imgs_glossy/multi-days-bg.png);}.dhx_cal_light_wide .dhx_cal_ltext{border-left:1px solid #A4BED4;}.dhx_cal_light_wide .dhx_cal_ltext{background-color:white;}.dhx_custom_button{background:white;color:black;}.dhx_form_repeat{background:white;}.dhx_repeat_divider{border-left:1px solid #A4BED4;}.dhx_cal_header.dhx_second_cal_header{background-image:url("imgs_glossy/second-top-days-bg.png");padding-right:20px;}.dhx_scale_bar{padding-top:4px;}.dhx_second_scale_bar{border-bottom:0;padding-top:4px;}.dhx_cal_light_wide .dhx_cal_lsection .dhx_fullday,.dhx_cal_lsection .dhx_fullday{color:#000;font-size:14px;}.dhx_cal_light_wide .dhx_cal_lsection{font-size:14px;padding-right:10px;}
\ No newline at end of file +.dhtmlx_message_area{position:fixed;right:5px;width:250px;z-index:1000;}.dhtmlx-info{min-width:120px;padding:4px 4px 4px 20px;font-family:Tahoma;z-index:10000;margin:5px;margin-bottom:10px;-webkit-transition:all .5s ease;-moz-transition:all .5s ease;-o-transition:all .5s ease;transition:all .5s ease;}.dhtmlx-info.hidden{height:0;padding:0;border-width:0;margin:0;overflow:hidden;}.dhtmlx_modal_box{overflow:hidden;display:inline-block;min-width:300px;width:300px;text-align:center;position:fixed;background-color:#fff;background:-webkit-linear-gradient(top,#fff 1%,#d0d0d0 99%);background:-moz-linear-gradient(top,#fff 1%,#d0d0d0 99%);box-shadow:0 0 14px #888;font-family:Tahoma;z-index:20000;border-radius:6px;border:1px solid #fff;}.dhtmlx_popup_title{border-top-left-radius:5px;border-top-right-radius:5px;border-width:0;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAoCAMAAAAIaGBFAAAAhFBMVEVwcHBubm5sbGxqampoaGhmZmZlZWVjY2NhYWFfX19dXV1bW1taWlpYWFhWVlZUVFRSUlJRUVFPT09NTU1LS0tJSUlHR0dGRkZERERCQkJAQEA+Pj49PT09PT0+Pj5AQEBBQUFDQ0NERERGRkZHR0dJSUlKSkpMTExMTEw5OTk5OTk5OTkny8YEAAAAQklEQVQImQXBCRJCAAAAwKVSQqdyjSPXNP7/QLsIhA6OTiJnF7GrRCpzc/fw9PKW+/gqlCq1RqvTG/yMJrPF6m/bAVEhAxxnHG0oAAAAAElFTkSuQmCC);background-image:-webkit-linear-gradient(top,#707070 1%,#3d3d3d 70%,#4c4c4c 97%,#393939 97%);background-image:-moz-linear-gradient(top,#707070 1%,#3d3d3d 70%,#4c4c4c 97%,#393939 97%);}.dhtmlx-info,.dhtmlx_popup_button,.dhtmlx_button{user-select:none;-webkit-user-select:none;-moz-user-select:-moz-none;cursor:pointer;}.dhtmlx_popup_text{overflow:hidden;}.dhtmlx_popup_controls{border-radius:6px;padding:5px;}.dhtmlx_popup_button,.dhtmlx_button{height:30px;line-height:30px;display:inline-block;margin:0 5px;border-radius:6px;color:#FFF;}.dhtmlx_popup_button{min-width:120px;}div.dhx_modal_cover{background-color:#000;cursor:default;filter:alpha(opacity = 20);opacity:.2;position:fixed;z-index:19999;left:0;top:0;width:100%;height:100%;border:none;zoom:1;}.dhtmlx-info img,.dhtmlx_modal_box img{float:left;margin-right:20px;}.dhtmlx-alert-error .dhtmlx_popup_title,.dhtmlx-confirm-error .dhtmlx_popup_title{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAsCAIAAAArRUU2AAAATklEQVR4nIWLuw2AMBBDjVuQiBT2oWbRDATrnB0KQOJoqPzRe3BrHI6dcBASYREKovtK6/6DsDOX+stN+3H1YX9ciRgnYq5EWYhS2dftBIuLT4JyIrPCAAAAAElFTkSuQmCC);}.dhtmlx-alert-error,.dhtmlx-confirm-error{border:1px solid #f00;}.dhtmlx_button,.dhtmlx_popup_button{box-shadow:0 0 4px #888;border:1px solid #838383;}.dhtmlx_button input,.dhtmlx_popup_button div{border:1px solid #FFF;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAeCAMAAADaS4T1AAAAYFBMVEVwcHBtbW1ra2toaGhmZmZjY2NhYWFeXl5cXFxaWlpXV1dVVVVSUlJQUFBNTU1LS0tJSUlGRkZERERBQUE/Pz88PDw9PT0+Pj5AQEBCQkJDQ0NFRUVHR0dISEhKSkpMTEzqthaMAAAAMklEQVQImQXBhQ2AMAAAsOIMlwWH/8+kRSKVyRVKlVrQaHV6g9FktlhFm93hdLk9Xt8PIfgBvdUqyskAAAAASUVORK5CYII=);background-image:-webkit-linear-gradient(top,#707070 1%,#3d3d3d 70%,#4c4c4c 99%);background-image:-moz-linear-gradient(top,#707070 1%,#3d3d3d 70%,#4c4c4c 99%);border-radius:6px;font-size:15px;font-weight:normal;-moz-box-sizing:content-box;box-sizing:content-box;color:#fff;padding:0;margin:0;vertical-align:top;height:28px;line-height:28px;}.dhtmlx_button input:focus,.dhtmlx_button input:active,.dhtmlx_popup_button div:active,.dhtmlx_popup_button div:focus{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAeCAMAAADaS4T1AAAAXVBMVEVwcHBubm5tbW1sbGxra2tpaWloaGhnZ2dmZmZlZWVjY2NiYmJhYWFgYGBfX19dXV1cXFxbW1taWlpZWVlXV1dWVlZVVVVUVFRTU1NRUVFQUFBPT09OTk5NTU1LS0tT9SY0AAAAMUlEQVQImQXBhQGAMAAAIGxnx2z9/00BiVQmVyhVakGj1ekNRpPZYhVtdofT5fZ4fT8hpwG05JjexgAAAABJRU5ErkJggg==);background-image:-webkit-linear-gradient(top,#707070 1%,#4c4c4c 99%);background-image:-moz-linear-gradient(top,#707070 1%,#4c4c4c 99%);}.dhtmlx_popup_title{color:#fff;text-shadow:1px 1px #000;height:40px;line-height:40px;font-size:20px;}.dhtmlx_popup_text{margin:15px 15px 5px 15px;font-size:14px;color:#000;min-height:30px;border-radius:6px;}.dhtmlx-info,.dhtmlx-error{font-size:14px;color:#000;box-shadow:0 0 10px #888;padding:0;background-color:#FFF;border-radius:3px;border:1px solid #fff;}.dhtmlx-info div{padding:5px 10px 5px 10px;background-color:#fff;border-radius:3px;border:1px solid #B8B8B8;}.dhtmlx-error{background-color:#d81b1b;border:1px solid #ff3c3c;box-shadow:0 0 10px #000;}.dhtmlx-error div{background-color:#d81b1b;border:1px solid #940000;color:#FFF;}.dhx_cal_container{background-color:#C2D5FC;font-family:Tahoma;font-size:8pt;position:relative;overflow:hidden;}.dhx_cal_container div{-moz-user-select:none;-moz-user-select:-moz-none;}.dhx_cal_navline{height:20px;position:absolute;z-index:3;width:750px;color:#2F3A48;}.dhx_cal_navline div{position:absolute;top:2px;white-space:nowrap;}.dhx_cal_navline .dhx_cal_date{font-weight:600;left:210px;padding-top:1px;}.dhx_cal_button .dhx_left_bg{width:1px;overflow:hidden;height:17px;z-index:20;top:0;}.dhx_cal_prev_button{background-image:url(imgs/buttons.png);background-position:0 0;width:29px;height:17px;left:50px;cursor:pointer;}.dhx_cal_next_button{background-image:url(imgs/buttons.png);background-position:-30px 0;width:29px;height:17px;left:80px;cursor:pointer;}.dhx_cal_today_button{background-image:url(imgs/buttons.png);background-position:-60px 0;width:75px;height:17px;left:112px;cursor:pointer;text-align:center;text-decoration:underline;}.dhx_cal_tab{width:59px;height:19px;text-align:center;text-decoration:underline;padding-top:2px;cursor:pointer;background-color:#D8E1EA;-webkit-border-top-left-radius:4px;-webkit-border-top-right-radius:4px;-moz-border-radius-topleft:4px;-moz-border-radius-topright:4px;border-top-left-radius:4px;border-top-right-radius:4px;}.dhx_cal_tab.active{text-decoration:none;cursor:default;font-weight:bold;border:1px dotted #586A7E;border-bottom:0;background-color:#C2D5FC;}.dhx_cal_header{position:absolute;left:10px;top:23px;width:750px;border-top:1px dotted #8894A3;border-right:1px dotted #8894A3;z-index:2;overflow:hidden;color:#2F3A48;}.dhx_cal_data{border-top:1px dotted #8894A3;position:absolute;top:44px;width:600px;overflow-y:auto;overflow-x:hidden;}.dhx_scale_bar{position:absolute;text-align:center;background-color:#C2D5FC;padding-top:3px;border-left:1px dotted #586A7E;}.dhx_scale_holder{position:absolute;border-right:1px dotted #586A7E;background-image:url(imgs/databg.png);}.dhx_scale_holder_now{position:absolute;border-right:1px dotted #586A7E;background-image:url(imgs/databg_now.png);}.dhx_scale_hour{height:41px;width:50px;border-bottom:1px dotted #8894A3;background-color:#C2D5FC;text-align:center;line-height:40px;color:#586A7E;overflow:hidden;}.dhx_month_head{background-color:#EBEFF4;color:#2F3A48;border-right:1px dotted #586A7E;height:18px;padding-right:5px;padding-top:3px;text-align:right;}.dhx_month_body{border-right:1px dotted #586A7E;border-bottom:1px dotted #586A7E;background-color:#FFF;}.dhx_now .dhx_month_body{background-color:#E2EDFF;}.dhx_after .dhx_month_body,.dhx_before .dhx_month_body{background-color:#ECECEC;}.dhx_after .dhx_month_head,.dhx_before .dhx_month_head{background-color:#E2E3E6;color:#94A6BB;}.dhx_now .dhx_month_head{background-color:#D1DEF4;font-weight:bold;}.dhx_cal_drag{position:absolute;z-index:9999;background-color:#FFE763;border:1px solid #B7A543;opacity:.5;filter:alpha(opacity=50);}.dhx_loading{position:absolute;width:128px;height:15px;background-image:url(imgs/loading.gif);z-index:9999;}.dhx_multi_day_icon,.dhx_multi_day{background-color:#E1E6FF;background-repeat:no-repeat;border-right:1px dotted #8894A3;}.dhx_multi_day{position:absolute;border-top:1px dotted #8894A3;}.dhx_multi_day_icon,.dhx_multi_day_icon_small{background-position:center center;background-color:#E1E6FF;background-repeat:no-repeat;border-bottom:1px dotted #8894A3;border-right:1px dotted #8894A3;}.dhx_multi_day_icon{background-image:url(imgs/clock_big.gif);}.dhx_multi_day_icon_small{background-image:url(imgs/clock_small.gif);}.dhtmlxLayoutPolyContainer_dhx_skyblue .dhx_cal_container{background-color:#d0e5ff;}.dhx_cal_event .dhx_header,.dhx_cal_event .dhx_title,.dhx_cal_event .dhx_body,.dhx_cal_event .dhx_footer{background-color:#FFE763;border:1px solid #B7A543;color:#887A2E;overflow:hidden;width:100%;font-family:Tahoma;font-size:8pt;}.dhx_move_denied .dhx_cal_event .dhx_header,.dhx_move_denied .dhx_cal_event .dhx_title{cursor:default;}.dhx_cal_event .dhx_header{height:1px;margin-left:1px;border-width:1px 1px 0 1px;cursor:pointer;}.dhx_cal_event .dhx_title{height:12px;border-width:0 1px 1px 1px;border-bottom-style:dotted;font-size:7pt;font-weight:bold;text-align:center;background-position:right;background-repeat:no-repeat;cursor:pointer;}.dhx_cal_event .dhx_body,.dhx_cal_event.dhx_cal_select_menu .dhx_body{border-width:0 1px 1px 1px;padding:5px;}.dhx_resize_denied{cursor:default!important;}.dhx_cal_event .dhx_event_resize{cursor:s-resize;}.dhx_cal_event .dhx_footer,.dhx_cal_event .dhx_select_menu_footer{height:1px;margin-left:2px;border-width:0 1px 1px 1px;}.dhx_cal_event_line{background-color:#FFE763;border:1px solid #B7A543;border-radius:3px;font-family:Tahoma;font-size:8pt;height:13px;padding-left:10px;color:#887A2E;cursor:pointer;overflow:hidden;}.dhx_cal_event_clear{font-family:Tahoma;font-size:8pt;height:13px;padding-left:2px;color:#887A2E;white-space:nowrap;overflow:hidden;cursor:pointer;}.dhx_in_move{background-color:#FFFF80;}div.dhx_cal_editor{background-color:#FFE763;border:1px solid #B7A543;border-top-style:dotted;z-index:999;position:absolute;overflow:hidden;}textarea.dhx_cal_editor{width:100%;height:100%;border:0 solid black;margin:none;padding:none;overflow:auto;}div.dhx_menu_head{background-image:url(imgs/controls.gif);background-position:0 -43px;width:10px;height:10px;margin-left:5px;margin-top:1px;border:none;cursor:default;}div.dhx_menu_icon{background-image:url(imgs/controls.gif);width:20px;height:20px;margin-left:-5px;margin-top:0;border:none;cursor:pointer;}div.icon_details{background-position:0 0;}div.icon_edit{background-position:-22px 0;}div.icon_save{background-position:-84px -1px;}div.icon_cancel{background-position:-62px 0;}div.icon_delete{background-position:-42px 0;}.dhx_unselectable,.dhx_unselectable div{-webkit-user-select:none;-moz-user-select:none;-moz-user-select:-moz-none;}.dhx_cal_light{background-color:#FFE763;border-radius:5px;font-family:Tahoma;font-size:8pt;border:1px solid #B7A64B;color:#887A2E;position:absolute;z-index:10001;width:580px;height:300px;box-shadow:5px 5px 5px #888;}.dhx_cal_light_wide{width:650px;}.dhx_mark{position:relative;top:3px;background-image:url('./imgs/controls.gif');background-position:0 -43px;padding-left:10px;}.dhx_ie6 .dhx_mark{background-position:6px -41px;}.dhx_cal_light select{font-family:Tahoma;font-size:8pt;color:#887A2E;padding:2px;margin:0;}.dhx_cal_ltitle{padding:2px 0 2px 5px;overflow:hidden;white-space:nowrap;}.dhx_cal_ltitle span{white-space:nowrap;}.dhx_cal_lsection{background-color:#DBCF8C;color:#FFF4B5;font-weight:bold;padding:5px 0 3px 10px;}.dhx_section_time{background-color:#DBCF8C;white-space:nowrap;}.dhx_cal_lsection .dhx_fullday{float:right;margin-right:5px;color:#887A2E;font-size:12px;font-weight:normal;line-height:20px;vertical-align:top;cursor:pointer;}.dhx_cal_lsection{font-size:18px;font-family:Arial;}.dhx_cal_ltext{padding:2px 0 2px 10px;overflow:hidden;}.dhx_cal_ltext textarea{background-color:#FFF4B5;overflow:auto;border:none;color:#887A2E;height:100%;width:100%;outline:none!important;resize:none;}.dhx_time{font-weight:bold;}.dhx_cal_light .dhx_title{padding-left:10px;}.dhx_cal_larea{border:1px solid #DCC43E;background-color:#FFF4B5;overflow:hidden;margin-left:3px;width:572px;height:1px;}.dhx_btn_set{padding:5px 10px 0 10px;float:left;}.dhx_btn_set div{float:left;height:21px;line-height:21px;vertical-align:middle;cursor:pointer;}.dhx_save_btn{background-image:url('./imgs/controls.gif');background-position:-84px 0;width:21px;}.dhx_cancel_btn{background-image:url('./imgs/controls.gif');background-position:-63px 0;width:20px;}.dhx_delete_btn{background-image:url('./imgs/controls.gif');background-position:-42px 0;width:20px;}.dhx_cal_cover{width:100%;height:100%;position:absolute;z-index:10000;top:0;left:0;background-color:black;opacity:.1;filter:alpha(opacity=10);}.dhx_custom_button{padding:0 3px 0 3px;color:#887A2E;font-family:Tahoma;font-size:8pt;background-color:#FFE763;font-weight:normal;margin-right:5px;margin-top:0;cursor:pointer;}.dhx_custom_button div{cursor:pointer;float:left;height:21px;line-height:21px;vertical-align:middle;}.dhx_cal_light_wide .dhx_cal_larea{border-top-width:0;}.dhx_cal_light_wide .dhx_cal_lsection{border:0;float:left;text-align:right;width:100px;height:20px;font-size:16px;padding:5px 0 0 10px;}.dhx_cal_light_wide .dhx_wrap_section{border-top:1px solid #DBCF8C;position:relative;background-color:#DBCF8C;overflow:hidden;}.dhx_cal_light_wide .dhx_section_time{padding-top:2px!important;height:20px!important;}.dhx_section_time{text-align:center;}.dhx_cal_light_wide .dhx_cal_larea{width:730px;}.dhx_cal_light_wide{width:738px;}.dhx_cal_light_wide .dhx_section_time{background:transparent;}.dhx_cal_light_wide .dhx_cal_checkbox label{padding-left:0;}.dhx_cal_wide_checkbox input{margin-top:8px;margin-left:14px;}.dhx_cal_light input{font-family:Tahoma;font-size:8pt;color:#887A2E;}.dhx_cal_light_wide .dhx_cal_lsection .dhx_fullday{float:none;margin-right:0;color:#FFF4B5;font-weight:bold;font-size:16px;font-family:Arial;cursor:pointer;}.dhx_custom_button{float:right;height:21px;width:90px;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;}.dhx_cal_light_wide .dhx_custom_button{position:absolute;top:0;right:0;margin-top:2px;}.dhx_cal_light_wide .dhx_repeat_right{margin-right:55px;}.dhx_minical_popup{position:absolute;z-index:10100;width:251px;height:175px;}.dhx_scale_bar_header{position:absolute;border-bottom:1px dotted #8894A3;width:100%;}.dhx_expand_icon{position:absolute;top:0;right:0;background-image:url(./imgs/collapse_expand_icon.gif);width:18px;height:18px;cursor:pointer;background-position:0 18px;z-index:16;}.dhx_scheduler_agenda .dhx_cal_data{background-image:url(./imgs/databg.png);}.dhx_agenda_area{width:100%;overflow-y:auto;background-image:url(./imgs/databg.png);}.dhx_agenda_line{height:21px;clear:both;overflow:hidden;}.dhx_agenda_line div{float:left;width:188px;border-right:1px dotted #8894A3;text-align:center;line-height:21px;overflow:hidden;}.dhx_agenda_area .dhx_agenda_line div{border-right:0 dotted #8894A3;}.dhx_v_border{position:absolute;left:187px;top:0;border-right:1px dotted #8894A3;width:1px;height:100%;}.dhx_agenda_line .dhx_event_icon{width:20px;border-width:0;background:url(./imgs/icon.png) no-repeat;background-position:5px 4px;cursor:pointer;}.dhx_agenda_line span{padding-left:5px;line-height:21px;}.dhx_year_body{border-left:1px dotted #586A7E;}.dhx_year_week{position:relative;}.dhx_scale_bar_last{border-right:1px dotted #586A7E;}.dhx_year_month{height:18px;padding-top:3px;border:1px dotted #586A7E;text-align:center;vertical-align:middle;}.dhx_year_body .dhx_before .dhx_month_head,.dhx_year_body .dhx_after .dhx_month_head,.dhx_year_body .dhx_before .dhx_month_head a,.dhx_year_body .dhx_after .dhx_month_head a{color:#E2E3E6!important;}.dhx_year_body .dhx_month_body{height:0;overflow:hidden;}.dhx_month_head.dhx_year_event{background-color:#FFE763;}.dhx_year_body .dhx_before .dhx_month_head,.dhx_year_body .dhx_after .dhx_month_head{cursor:default;}.dhx_tooltip{border:1px solid #BBB;background-image:url(./imgs/databg.png);position:absolute;z-index:9998;width:300px;height:auto;font-family:Tahoma;font-size:8pt;overflow:hidden;}.dhx_tooltip_line{line-height:20px;height:20px;overflow:hidden;}.dhx_tooltip_line .dhx_event_icon{width:20px;height:20px;padding-right:10px;float:left;border-width:0;position:relative;background:url(./imgs/icon.png) no-repeat;background-position:5px 4px;cursor:pointer;}.dhx_tooltip_date{float:left;width:auto;padding-left:5px;text-align:center;}.dhx_text_disabled{color:#887A2E;font-family:Tahoma;font-size:8pt;}.dhx_mini_calendar{-moz-box-shadow:5px 5px 5px #888;-khtml-box-shadow:5px 5px 5px #888;}.dhx_mini_calendar .dhx_month_head{cursor:pointer;}.dhx_mini_calendar .dhx_calendar_click{background-color:#C2D5FC;}.dhx_cal_navline div.dhx_minical_icon{width:18px;height:18px;left:190px;top:1px;cursor:pointer;background-image:url(./imgs/calendar.gif);}.dhx_matrix_scell{height:100%;}.dhx_matrix_cell,.dhx_matrix_scell{overflow:hidden;text-align:center;vertical-align:middle;border-bottom:1px dotted #8894A3;border-right:1px dotted #8894A3;}.dhx_matrix_cell{background-color:white;}.dhx_matrix_line{overflow:hidden;}.dhx_matrix_cell div,.dhx_matrix_scell div{overflow:hidden;text-align:center;height:auto;}.dhx_cal_lsection .dhx_readonly{font-size:9pt;font-size:8pt;padding:2px;color:#887A2E;}.dhx_cal_event_line .dhx_event_resize{cursor:w-resize;background:url(./imgs/resize_dots.png) repeat-y;position:absolute;top:0;width:4px;}.dhx_event_resize_start{left:0;}.dhx_event_resize_end{right:0;}.dhx_matrix_scell.folder,.dhx_data_table.folder .dhx_matrix_cell{background-color:#969394;cursor:pointer;}.dhx_matrix_scell .dhx_scell_level0{padding-left:5px;}.dhx_matrix_scell .dhx_scell_level1{padding-left:20px;}.dhx_matrix_scell .dhx_scell_level2{padding-left:35px;}.dhx_matrix_scell .dhx_scell_level3{padding-left:50px;}.dhx_matrix_scell .dhx_scell_level4{padding-left:65px;}.dhx_matrix_scell.folder{font-weight:bold;text-align:left;}.dhx_matrix_scell.folder .dhx_scell_expand{float:left;width:10px;padding-right:3px;}.dhx_matrix_scell.folder .dhx_scell_name{float:left;width:auto;}.dhx_matrix_scell.item .dhx_scell_name{padding-left:15px;text-align:left;}.dhx_data_table.folder .dhx_matrix_cell{border-right:0;}.dhx_section_timeline{overflow:hidden;padding:4px 0 2px 10px;}.dhx_section_timeline select{width:552px;}.dhx_map_area{width:100%;height:100%;overflow-y:auto;overflow-x:hidden;background-image:url(./imgs/databg.png);}.dhx_map_line .dhx_event_icon{width:20px;border-width:0;background:url(./imgs/icon.png) no-repeat;background-position:5px 4px;cursor:pointer;}.dhx_map_line{height:21px;clear:both;overflow:hidden;}.dhx_map{position:absolute;}.dhx_map_line div{float:left;border-right:1px dotted #8894A3;text-align:center;line-height:21px;overflow:hidden;}.dhx_map_line .headline_description{float:left;border-right:1px dotted #8894A3;text-align:center;line-height:21px;overflow:hidden;}.dhx_map_line .dhx_map_description{float:left;border-right:0 dotted #8894A3;text-align:center;line-height:21px;overflow:hidden;}.dhx_map_line .headline_date,.dhx_map_line .headline_description{border-left:0;}.dhx_map_line .line_description{float:left;border-right:1px dotted #8894A3;text-align:left;padding-left:5px;line-height:21px;overflow:hidden;}.dhx_map_line.highlight{background-color:#C4C5CC;}.dhx_map_area .dhx_map_line div{border-right:0 dotted #8894A3;}.dhtmlXTooltip.tooltip{-moz-box-shadow:3px 3px 3px #888;-webkit-box-shadow:3px 3px 3px #888;-o-box-shadow:3px 3px 3px #888;box-shadow:3px 3px 3px #888;filter:progid:DXImageTransform.Microsoft.Shadow(color='#888888',Direction=135,Strength=5);background-color:white;border-left:1px dotted #887A2E;border-top:1px dotted #887A2E;color:#887A2E;cursor:default;padding:10px;position:absolute;z-index:500;}.dhx_cal_checkbox label{padding-left:5px;}.dhx_cal_light .radio{padding:2px 0 2px 10px;}.dhx_cal_light .radio input,.dhx_cal_light .radio label{line-height:15px;}.dhx_cal_light .radio input{vertical-align:middle;margin:0;padding:0;}.dhx_cal_light .radio label{vertical-align:middle;padding-right:10px;}.dhx_cal_light .combo{padding:4px;}.dhx_cal_light_wide .dhx_combo_box{width:608px!important;left:10px;}.dhx_wa_column{float:left;}.dhx_wa_column_last .dhx_wa_day_cont{border-left:1px dotted #8894A3;}.dhx_wa_scale_bar{font-family:Tahoma;padding-left:10px;font-size:11px;border-top:1px dotted #8894A3;border-bottom:1px dotted #8894A3;}.dhx_wa_day_data{background-color:#FCFEFC;overflow-y:auto;}.dhx_wa_ev_body{border-bottom:1px dotted #789;font-size:12px;padding:5px 0 5px 7px;}.dhx_wa_dnd{font-family:Tahoma;position:absolute;padding-right:7px;color:#887AE2!important;background-color:#FFE763!important;border:1px solid #B7A543;}.dhx_cal_event_selected{background-color:#9cc1db;color:white;}.dhx_second_scale_bar{border-bottom:1px dotted #586A7E;padding-top:2px;}.dhx_cal_header div div{border-left:1px dotted #8894A3;}.dhx_grid_area{width:100%;height:100%;overflow-y:auto;background-color:#FCFEFC;}.dhx_grid_area table{border-collapse:collapse;border-spacing:0;width:100%;table-layout:fixed;}.dhx_grid_area td{table-layout:fixed;text-align:center;}.dhx_grid_line{height:21px;clear:both;overflow:hidden;}.dhx_grid_line div{float:left;cursor:default;padding-top:0;padding-bottom:0;text-align:center;line-height:21px;overflow:hidden;}.dhx_grid_area td,.dhx_grid_line div{padding-left:8px;padding-right:8px;}.dhx_grid_area tr.dhx_grid_event{height:21px;overflow:hidden;margin:0 0 1px 0;}.dhx_grid_area tr.dhx_grid_event td{border-bottom:1px solid #ECEEF4;}.dhx_grid_area tr.dhx_grid_event:nth-child(2n+1) td,.dhx_grid_area tr.dhx_grid_event:nth-child(2n) td{border-bottom-width:0;border-bottom-style:none;}.dhx_grid_area tr.dhx_grid_event:nth-child(2n){background-color:#ECEEF4;;}.dhx_grid_area .dhx_grid_dummy{table-layout:auto;margin:0!important;padding:0!important;}.dhx_grid_v_border{position:absolute;border-right:1px solid #A4BED4;width:1px;height:100%;}.dhx_grid_event_selected{background-color:#9cc1db!important;color:white!important;}.dhx_grid_sort_desc .dhx_grid_view_sort{background-position:0 -55px;}.dhx_grid_sort_asc .dhx_grid_view_sort{background-position:0 -66px;}.dhx_grid_view_sort{width:10px;height:10px;position:absolute;border:none!important;top:5px;background-repeat:no-repeat;background-image:url(./imgs/images.png);}.dhx_marked_timespan{position:absolute;width:100%;}.dhx_time_block{position:absolute;width:100%;background:silver;opacity:.4;filter:alpha(opacity=40);z-index:1;}.dhx_time_block_reset{opacity:1;filter:alpha(opacity=100);}.dhx_scheduler_month .dhx_marked_timespan{display:none;}.dhx_mini_calendar .dhx_marked_timespan{display:none;}.dhx_now_time{width:100%;border-bottom:2px dotted red;z-index:1;}.dhx_scheduler_month .dhx_now_time{border-bottom:0;border-left:2px dotted red;}.dhx_matrix_now_time{border-left:2px dotted red;z-index:1;}div.dhx_form_repeat input.radio{margin:-4px 0 0 -4px!ie;}div.dhx_form_repeat input.checkbox{margin:0 0 0 -4px!ie;}.dhx_form_repeat,.dhx_form_repeat input{padding:0;margin:0;padding-left:5px;font-family:Tahoma,Verdana;font-size:11px;line-height:24px;}.dhx_form_repeat{overflow:hidden;height:0;background-color:#FFF4B5;}.dhx_cal_light_wide .dhx_form_repeat{background-color:transparent;}.dhx_repeat_center,.dhx_repeat_left{height:115px;padding:10px 0 10px 10px;float:left;}.dhx_repeat_left{width:95px;}.dhx_repeat_center{width:335px;margin-top:12px;}.dhx_repeat_divider{float:left;height:115px;border-left:1px dotted #DCC43E;width:1px;}.dhx_repeat_right{float:right;height:115px;width:160px;padding:10px 3px 10px 10px;margin-top:7px;}input.dhx_repeat_text{height:16px;width:27px;margin:0 4px 0 4px;line-height:18px;padding:0 0 0 2px;}.dhx_form_repeat select{height:20px;width:87px;padding:0 0 0 2px;margin:0 4px 0 4px;}input.dhx_repeat_date{height:18px;width:80px;padding:0 0 0 2px;margin:0 4px 0 4px;background-repeat:no-repeat;background-position:64px 0;border:1px #7f9db9 solid;line-height:18px;}input.dhx_repeat_radio{margin-right:4px;}input.dhx_repeat_checkbox{margin:4px 4px 0 0;}.dhx_repeat_days td{padding-right:5px;}.dhx_repeat_days label{font-size:10px;}.dhx_custom_button{width:90px;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;}.dhx_custom_button_recurring{background-image:url(./imgs/but_repeat.gif);background-position:-5px 20px;width:20px;margin-right:10px;}.dhx_cal_light_rec{width:640px;}.dhx_cal_light_rec .dhx_cal_larea{width:632px;}.dhx_cal_light_rec.dhx_cal_light_wide{width:816px;}.dhx_cal_light_rec.dhx_cal_light_wide .dhx_cal_larea{width:808px;}.dhx_cal_tab.active{border:none;}.dhx_multi_day{border:none;border-top:1px solid #A4BED4;}.dhx_multi_day_icon,.dhx_multi_day_icon_small{border-right:none;}.dhx_cal_container{background-image:url(imgs_glossy/top-days-bg.png);background-position:0 24px;background-repeat:repeat-x;background-color:#EBEBEB;}.dhx_cal_navline{background-color:#EBEBEB;height:23px!important;}.dhx_cal_prev_button{background-image:url(imgs_glossy/buttons.gif);width:30px;height:20px;}.dhx_cal_next_button{background-image:url(imgs_glossy/buttons.gif);width:30px;height:20px;}.dhx_cal_today_button{padding-top:3px;background-image:url(imgs_glossy/buttons.gif);width:67px;left:110px;text-decoration:none;}.dhx_cal_navline .dhx_cal_date{padding-top:4px;left:230px;}.dhx_cal_tab{background-image:url(imgs_glossy/white_tab.png);width:60px;height:15px;text-decoration:none;padding-top:4px;margin-top:4px;}.dhx_cal_tab.active{background-image:url(imgs_glossy/blue_tab.png);height:18px;width:60px;padding-top:4px;margin-top:2px;}.dhx_cal_data{border-top:1px solid #A4BED4;}.dhx_cal_header{background-image:url(imgs_glossy/top-days-bg.png);background-repeat:repeat-x;border-top:0;border-right:0;}.dhx_scale_bar{background-image:url(imgs_glossy/top-separator.gif);background-position:0 0;background-repeat:no-repeat;background-color:transparent;padding-top:3px;border-left:0;}.dhx_scale_holder{border-right:1px solid #A4BED4;}.dhx_scale_holder_now{border-right:1px solid #A4BED4;}.dhx_scale_hour{background-image:url(imgs_glossy/left-time-bg.png);border-bottom:1px solid #A4BED4;color:#2F3A48;}.dhx_multi_day{background-image:url(imgs_glossy/multi-days-bg.png);background-repeat:repeat;border-bottom:1px solid #A4BED4;border-left:0;}.dhx_multi_day_icon,.dhx_multi_day_icon_small{background-image:url(imgs_glossy/clock_big.png);border-bottom:1px solid #A4BED4;border-left:1px solid #fff;background-color:transparent;background-repeat:no-repeat;}.dhx_multi_day_icon_small{background-image:url(imgs_glossy/clock_small.png);}.dhx_month_head{background-color:#FFF;}.dhx_after .dhx_month_head,.dhx_before .dhx_month_head{background-color:#EFEDE2;}.dhx_now .dhx_month_head{background-color:#E4EFFF;}.dhx_after .dhx_month_body,.dhx_before .dhx_month_body{background-color:#EFEDE2;}.dhx_cal_event div{border:1px solid #FFBD51;background-color:#FFE4AB;color:#000;}.dhx_cal_event_clear{color:#000;}.dhx_cal_event_line{background-image:url(imgs_glossy/event-bg.png);border:1px solid #FFBD51;color:#000;}.dhx_in_move{background-image:url(imgs_glossy/move.png);}.dhx_cal_event .dhx_body{background-color:#FFE4AB;}.dhx_cal_event .dhx_title{background-color:#FFE4AB;}.dhx_cal_light{-moz-box-shadow:5px 5px 5px #888;-khtml-box-shadow:5px 5px 5px #888;background-color:#EBEBEB;border:2px solid #A4BED4;color:#000;}.dhx_cal_larea{border:1px solid #A4BED4;border-width:0 1px 1px;background-color:#FFF;}.dhx_cal_lsection{background-image:url(imgs_glossy/lightbox.png);font-size:14px;padding:5px 0 5px 10px;color:#000;}.dhx_cal_light_wide .dhx_cal_lsection{background-image:url(imgs_glossy/multi-days-bg.png);}.dhx_cal_ltext textarea{background-color:#fff;color:#000;}.dhx_cal_light select,.dhx_cal_light input{color:#000;}.dhx_save_btn{background-image:url(imgs_glossy/controlls5.png);}.dhx_cancel_btn{background-image:url(imgs_glossy/controlls5.png);}.dhx_delete_btn{background-image:url(imgs_glossy/controlls5.png);}div.dhx_menu_head{background-image:url(imgs_glossy/controlls5.png);border:1px solid #FFE4AB;}div.dhx_menu_icon{background-image:url(imgs_glossy/controlls5.png);border:medium none;}.dhx_section_time{height:20px!important;padding:7px 0!important;text-align:center;background:white;}div.dhx_cal_editor{background-color:#FFE4AB;}.dhx_year_month{background-image:url(imgs_glossy/top-days-bg.png);border:0;}.dhx_year_week{background-image:url(imgs_glossy/top-days-bg.png);}.dhx_month_head{border-right:1px solid #A4BED4;}.dhx_month_body,.dhx_matrix_cell,.dhx_matrix_scell{border-right:1px solid #A4BED4;border-bottom:1px solid #A4BED4;}.dhx_year_body{border-left:1px solid #A4BED4;}.dhx_scale_bar_last{border-right:none;}.dhx_month_head.dhx_year_event{background-color:#FFE4AB;}.dhx_year_body .dhx_before .dhx_month_head,.dhx_year_body .dhx_after .dhx_month_head,.dhx_year_body .dhx_before .dhx_month_head a,.dhx_year_body .dhx_after .dhx_month_head a{color:#EFEDE2!important;}.dhx_cal_lsection .dhx_readonly{color:#000;}.dhx_tooltip{-moz-box-shadow:2px 2px 2px #888;-khtml-box-shadow:2px 2px 2px #888;}.dhx_custom_button{margin-top:-2px;}.dhx_cal_lsection .dhx_fullday{color:#000;}.dhx_cal_lsection.dhx_cal_checkbox{height:16px;line-height:18px;}.dhx_cal_light_wide .dhx_cal_lsection.dhx_cal_checkbox{height:20px;}.dhx_cal_checkbox label{vertical-align:top;}.dhx_cal_light_wide .dhx_cal_lsection{color:black;}.dhx_cal_light_wide .dhx_wrap_section{border-top:1px solid #A4BED4;background-image:url(imgs_glossy/multi-days-bg.png);}.dhx_cal_light_wide .dhx_cal_ltext{border-left:1px solid #A4BED4;}.dhx_cal_light_wide .dhx_cal_ltext{background-color:white;}.dhx_custom_button{background:white;color:black;}.dhx_form_repeat{background:white;}.dhx_repeat_divider{border-left:1px solid #A4BED4;}.dhx_cal_header.dhx_second_cal_header{background-image:url("imgs_glossy/second-top-days-bg.png");padding-right:20px;}.dhx_cal_header div div{border-left:0;}.dhx_scale_bar{padding-top:4px;}.dhx_second_scale_bar{border-bottom:0;padding-top:4px;}.dhx_cal_light_wide .dhx_cal_lsection .dhx_fullday,.dhx_cal_lsection .dhx_fullday{color:#000;font-size:14px;}.dhx_cal_light_wide .dhx_cal_lsection{font-size:14px;padding-right:10px;}
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_active_links.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_active_links.js deleted file mode 100644 index 6499338d09b..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_active_links.js +++ /dev/null @@ -1,6 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.attachEvent("onTemplatesReady",function(){var d=scheduler.date.str_to_date(scheduler.config.api_date),b=scheduler.date.date_to_str(scheduler.config.api_date),e=scheduler.templates.month_day;scheduler.templates.month_day=function(a){return"<a jump_to='"+b(a)+"' href='#'>"+e(a)+"</a>"};var f=scheduler.templates.week_scale_date;scheduler.templates.week_scale_date=function(a){return"<a jump_to='"+b(a)+"' href='#'>"+f(a)+"</a>"};dhtmlxEvent(this._obj,"click",function(a){var b=a.target||event.srcElement, -c=b.getAttribute("jump_to");if(c)return scheduler.setCurrentView(d(c),"day"),a&&a.preventDefault&&a.preventDefault(),!1})}); diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_agenda_view.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_agenda_view.js deleted file mode 100644 index c0eb363b8d5..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_agenda_view.js +++ /dev/null @@ -1,10 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.date.add_agenda=function(b){return new Date(b.valueOf())};scheduler.dblclick_dhx_agenda_area=function(){!this.config.readonly&&this.config.dblclick_create&&this.addEventNow()};scheduler.templates.agenda_time=function(b,d,a){return a._timed?this.day_date(a.start_date,a.end_date,a)+" "+this.event_date(b):scheduler.templates.day_date(b)+" – "+scheduler.templates.day_date(d)};scheduler.templates.agenda_text=function(b,d,a){return a.text};scheduler.date.agenda_start=function(b){return b}; -scheduler.attachEvent("onTemplatesReady",function(){function b(b){if(b){var a=scheduler.locale.labels;scheduler._els.dhx_cal_header[0].innerHTML="<div class='dhx_agenda_line'><div>"+a.date+"</div><span style='padding-left:25px'>"+a.description+"</span></div>";scheduler._table_view=!0;scheduler.set_sizes()}}function d(){var b=scheduler._date,a=scheduler.get_visible_events();a.sort(function(a,b){return a.start_date>b.start_date?1:-1});for(var d="<div class='dhx_agenda_area'>",e=0;e<a.length;e++){var c= -a[e],f=c.color?"background-color:"+c.color+";":"",h=c.textColor?"color:"+c.textColor+";":"";d+="<div class='dhx_agenda_line' event_id='"+c.id+"' style='"+h+""+f+""+(c._text_style||"")+"'><div>"+scheduler.templates.agenda_time(c.start_date,c.end_date,c)+"</div>";d+="<div class='dhx_event_icon icon_details'> </div>";d+="<span>"+scheduler.templates.agenda_text(c.start_date,c.end_date,c)+"</span></div>"}d+="<div class='dhx_v_border'></div></div>";scheduler._els.dhx_cal_data[0].innerHTML=d;scheduler._els.dhx_cal_data[0].childNodes[0].scrollTop= -scheduler._agendaScrollTop||0;var g=scheduler._els.dhx_cal_data[0].firstChild.childNodes;scheduler._els.dhx_cal_date[0].innerHTML="";scheduler._rendered=[];for(e=0;e<g.length-1;e++)scheduler._rendered[e]=g[e]}scheduler.attachEvent("onSchedulerResize",function(){return this._mode=="agenda"?(this.agenda_view(!0),!1):!0});var a=scheduler.render_data;scheduler.render_data=function(b){if(this._mode=="agenda")d();else return a.apply(this,arguments)};var f=scheduler.render_view_data;scheduler.render_view_data= -function(){this._mode=="agenda"?(scheduler._agendaScrollTop=scheduler._els.dhx_cal_data[0].childNodes[0].scrollTop,scheduler._els.dhx_cal_data[0].childNodes[0].scrollTop=0,scheduler._els.dhx_cal_data[0].style.overflowY="hidden"):scheduler._els.dhx_cal_data[0].style.overflowY="auto";return f.apply(this,arguments)};scheduler.agenda_view=function(a){scheduler._min_date=scheduler.config.agenda_start||new Date;scheduler._max_date=scheduler.config.agenda_end||new Date(9999,1,1);scheduler._table_view=!0; -b(a);a&&d()}}); diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_collision.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_collision.js deleted file mode 100644 index d7aab4fddbe..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_collision.js +++ /dev/null @@ -1,8 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -(function(){function h(a){var b=scheduler._props?scheduler._props[scheduler._mode]:null,f=scheduler.matrix?scheduler.matrix[scheduler._mode]:null,c=b||f;if(b)var d=c.map_to;if(f)d=c.y_property;c&&a&&(n=scheduler.getEvent(a)[d])}function g(a){var b=[];if(a.rec_type){for(var f=scheduler.getRecDates(a),c=0;c<f.length;c++)for(var d=scheduler.getEvents(f[c].start_date,f[c].end_date),i=0;i<d.length;i++)(d[i].event_pid||d[i].id)!=a.id&&b.push(d[i]);b.push(a)}else b=scheduler.getEvents(a.start_date,a.end_date); -var e=scheduler._props?scheduler._props[scheduler._mode]:null,g=scheduler.matrix?scheduler.matrix[scheduler._mode]:null,m=e||g;if(e)var j=m.map_to;if(g)j=m.y_property;var k=!0;if(m){for(var h=0,l=0;l<b.length;l++)b[l][j]==a[j]&&b[l].id!=a.id&&h++;h>=scheduler.config.collision_limit&&(a[j]=n,k=!1)}else b.length>scheduler.config.collision_limit&&(k=!1);return!k?!scheduler.callEvent("onEventCollision",[a,b]):k}var n,e;scheduler.config.collision_limit=1;scheduler.attachEvent("onBeforeDrag",function(a){h(a); -return!0});scheduler.attachEvent("onBeforeLightbox",function(a){var b=scheduler.getEvent(a);e=[b.start_date,b.end_date];h(a);return!0});scheduler.attachEvent("onEventChanged",function(a){if(!a)return!0;var b=scheduler.getEvent(a);if(!g(b)){if(!e)return!1;b.start_date=e[0];b.end_date=e[1];b._timed=this.is_one_day_event(b)}return!0});scheduler.attachEvent("onBeforeEventChanged",function(a){return g(a)});scheduler.attachEvent("onEventSave",function(a,b){return b.rec_type?(scheduler._roll_back_dates(b), -g(b)):!0})})(); diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_cookie.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_cookie.js deleted file mode 100644 index ef80ea8e8d0..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_cookie.js +++ /dev/null @@ -1,6 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -(function(){function g(e,b,a){var c=e+"="+a+(b?"; "+b:"");document.cookie=c}function h(e){var b=e+"=";if(document.cookie.length>0){var a=document.cookie.indexOf(b);if(a!=-1){a+=b.length;var c=document.cookie.indexOf(";",a);if(c==-1)c=document.cookie.length;return document.cookie.substring(a,c)}}return""}var f=!0;scheduler.attachEvent("onBeforeViewChange",function(e,b,a,c){if(f){f=!1;var d=h("scheduler_settings");if(d)return d=d.split("@"),d[0]=this.templates.xml_date(d[0]),this.setCurrentView(d[0], -d[1]),!1}var i=this.templates.xml_format(c||b)+"@"+(a||e);g("scheduler_settings","expires=Sun, 31 Jan 9999 22:00:00 GMT",i);return!0})})(); diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_editors.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_editors.js deleted file mode 100644 index 38ba960c470..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_editors.js +++ /dev/null @@ -1,10 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.form_blocks.combo={render:function(a){var d="";d+="<div class='"+a.type+"' style='height:"+(a.height||20)+"px;' ></div>";return d},set_value:function(a,d,c,b){a._combo&&a._combo.destructor();window.dhx_globalImgPath=b.image_path||"/";a._combo=new dhtmlXCombo(a,b.name,a.offsetWidth-8);a._combo.enableFilteringMode(!!b.filtering,b.script_path||null,!!b.cache);if(b.script_path)a._combo.setComboValue(c[b.map_to]||null);else{for(var f=[],e=0;e<b.options.length;e++){var g=[];g.push(b.options[e].key); -g.push(b.options[e].label);f.push(g)}a._combo.addOption(f);if(c[b.map_to]){var h=a._combo.getIndexByValue(c[b.map_to]);a._combo.selectOption(h)}}},get_value:function(a){var d=a._combo.getSelectedValue();return d},focus:function(){}}; -scheduler.form_blocks.radio={render:function(a){var d="";d+="<div class='dhx_cal_ltext dhx_cal_radio' style='height:"+a.height+"px;' >";for(var c=0;c<a.options.length;c++){var b=scheduler.uid();d+="<input id='"+b+"' type='radio' name='"+a.name+"' value='"+a.options[c].key+"'><label for='"+b+"'> "+a.options[c].label+"</label>";a.vertical&&(d+="<br/>")}d+="</div>";return d},set_value:function(a,d,c,b){for(var f=a.getElementsByTagName("input"),e=0;e<f.length;e++)if(f[e].checked=!1,f[e].value==c[b.map_to])f[e].checked= -!0},get_value:function(a){for(var d=a.getElementsByTagName("input"),c=0;c<d.length;c++)if(d[c].checked)return d[c].value},focus:function(){}}; -scheduler.form_blocks.checkbox={render:function(){return scheduler.config.wide_form?'<div class="dhx_cal_wide_checkbox"></div>':""},set_value:function(a,d,c,b){var a=document.getElementById(b.id),f=scheduler.uid(),e=!1;typeof b.checked_value!="undefined"&&c[b.map_to]==b.checked_value&&(e=!0);a.className+=" dhx_cal_checkbox";var g="<input id='"+f+"' type='checkbox' value='true' name='"+b.name+"'"+(e?"checked='true'":"")+"'>",h="<label for='"+f+"'>"+(scheduler.locale.labels["section_"+b.name]||b.name)+ -"</label>";scheduler.config.wide_form?(a.innerHTML=h,a.nextSibling.innerHTML=g):a.innerHTML=g+h},get_value:function(a,d,c){var a=document.getElementById(c.id),b=a.getElementsByTagName("input")[0];b||(b=a.nextSibling.getElementsByTagName("input")[0]);return b.checked?c.checked_value||!0:c.unchecked_value||!1},focus:function(){}}; diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_expand.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_expand.js deleted file mode 100644 index 06a1187a723..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_expand.js +++ /dev/null @@ -1,8 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.expand=function(){var a=scheduler._obj;do a._position=a.style.position||"",a.style.position="static";while((a=a.parentNode)&&a.style);a=scheduler._obj;a.style.position="absolute";a._width=a.style.width;a._height=a.style.height;a.style.width=a.style.height="100%";a.style.top=a.style.left="0px";var b=document.body;b.scrollTop=0;if(b=b.parentNode)b.scrollTop=0;document.body._overflow=document.body.style.overflow||"";document.body.style.overflow="hidden";scheduler._maximize()}; -scheduler.collapse=function(){var a=scheduler._obj;do a.style.position=a._position;while((a=a.parentNode)&&a.style);a=scheduler._obj;a.style.width=a._width;a.style.height=a._height;document.body.style.overflow=document.body._overflow;scheduler._maximize()};scheduler.attachEvent("onTemplatesReady",function(){var a=document.createElement("DIV");a.className="dhx_expand_icon";scheduler.toggleIcon=a;scheduler._obj.appendChild(a);a.onclick=function(){scheduler.expanded?scheduler.collapse():scheduler.expand()}}); -scheduler._maximize=function(){this.expanded=!this.expanded;this.toggleIcon.style.backgroundPosition="0px "+(this.expanded?"0":"18")+"px";for(var a=["left","top"],b=0;b<a.length;b++){var d=scheduler.xy["margin_"+a[b]],c=scheduler["_prev_margin_"+a[b]];scheduler.xy["margin_"+a[b]]?(scheduler["_prev_margin_"+a[b]]=scheduler.xy["margin_"+a[b]],scheduler.xy["margin_"+a[b]]=0):c&&(scheduler.xy["margin_"+a[b]]=scheduler["_prev_margin_"+a[b]],delete scheduler["_prev_margin_"+a[b]])}scheduler.callEvent("onSchedulerResize", -[])&&scheduler.update_view()}; diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_html_templates.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_html_templates.js deleted file mode 100644 index d882becfd64..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_html_templates.js +++ /dev/null @@ -1,5 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.attachEvent("onTemplatesReady",function(){for(var c=document.body.getElementsByTagName("DIV"),b=0;b<c.length;b++){var a=c[b].className||"",a=a.split(":");if(a.length==2&&a[0]=="template"){var d='return "'+(c[b].innerHTML||"").replace(/\"/g,'\\"').replace(/[\n\r]+/g,"")+'";',d=unescape(d).replace(/\{event\.([a-z]+)\}/g,function(b,a){return'"+ev.'+a+'+"'});scheduler.templates[a[1]]=Function("start","end","ev",d);c[b].style.display="none"}}}); diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_key_nav.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_key_nav.js deleted file mode 100644 index 609a374040f..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_key_nav.js +++ /dev/null @@ -1,6 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -(function(){var b=!1;scheduler.attachEvent("onBeforeLightbox",function(){return b=!0});scheduler.attachEvent("onAfterLightbox",function(){b=!1;return!0});dhtmlxEvent(document,_isOpera?"keypress":"keydown",function(a){a=a||event;if(!b)if(a.keyCode==37||a.keyCode==39){a.cancelBubble=!0;var e=scheduler.date.add(scheduler._date,a.keyCode==37?-1:1,scheduler._mode);scheduler.setCurrentView(e);return!0}else if(a.ctrlKey&&a.keyCode==67)scheduler._copy_id=scheduler._select_id;else if(a.ctrlKey&&a.keyCode== -86){var c=scheduler.getEvent(scheduler._copy_id);if(c){var d=scheduler._copy_event(c);d.id=scheduler.uid();scheduler.addEvent(d)}}})})(); diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_limit.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_limit.js deleted file mode 100644 index baf0be0041e..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_limit.js +++ /dev/null @@ -1,12 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.config.limit_start=new Date(-3999,0,0);scheduler.config.limit_end=new Date(3999,0,0);scheduler.config.limit_view=!1; -(function(){var g=null,k={},l={},m=!1;scheduler.blockTime=function(b,a){var c=this.config.first_hour*60,d=this.config.last_hour*60;a=="fullday"&&(a=[c,d]);typeof b=="object"?k[this.date.date_part(b).valueOf()]=a:l[b]=a;for(var e=0;e<a.length;e+=2)a[e]<c&&(a[e]=c),a[e+1]>d&&(a[e+1]=d);m=!0};scheduler.attachEvent("onScaleAdd",function(b,a){var c=k[a.valueOf()]||l[a.getDay()];if(c)for(var d=0;d<c.length;d+=2){var e=c[d],f=c[d+1],h=document.createElement("DIV");h.className="dhx_time_block";var j;h.style.top= -Math.round((e*6E4-this.config.first_hour*36E5)*this.config.hour_size_px/36E5)%(this.config.hour_size_px*24)+"px";h.style.height=Math.round((f-e-1)*6E4*this.config.hour_size_px/36E5)%(this.config.hour_size_px*24)+"px";b.appendChild(h)}});scheduler.attachEvent("onBeforeViewChange",function(b,a,c,d){d=d||a;c=c||b;return scheduler.config.limit_view&&(d.valueOf()>scheduler.config.limit_end.valueOf()||this.date.add(d,1,c)<=scheduler.config.limit_start.valueOf())?(setTimeout(function(){scheduler.setCurrentView(scheduler._date, -c)},1),!1):!0});var f=function(b){var a=scheduler.config,c=b.start_date.valueOf()>=a.limit_start.valueOf()&&b.end_date.valueOf()<=a.limit_end.valueOf();if(c&&m&&b._timed){var d=scheduler.date.date_part(new Date(b.start_date.valueOf())),e=k[d.valueOf()]||l[d.getDay()],f=b.start_date.getHours()*60+b.start_date.getMinutes(),h=b.end_date.getHours()*60+b.end_date.getMinutes();if(e)for(var j=0;j<e.length;j+=2){var g=e[j],i=e[j+1];if(g<h&&i>f){if(f<=i&&f>=g){if(i==1440||h<i){c=!1;break}if(scheduler._drag_id&& -scheduler._drag_mode=="new-size")b.start_date.setHours(0),b.start_date.setMinutes(i);else{c=!1;break}}if(h>=g&&h<i)if(scheduler._drag_id&&scheduler._drag_mode=="new-size")b.end_date.setHours(0),b.end_date.setMinutes(g);else{c=!1;break}}}}if(!c)scheduler._drag_id=null,scheduler._drag_mode=null,scheduler.callEvent("onLimitViolation",[b.id,b]);return c};scheduler.attachEvent("onBeforeDrag",function(b){return!b?!0:f(scheduler.getEvent(b))});scheduler.attachEvent("onClick",function(b){return f(scheduler.getEvent(b))}); -scheduler.attachEvent("onBeforeLightbox",function(b){var a=scheduler.getEvent(b);g=[a.start_date,a.end_date];return f(a)});scheduler.attachEvent("onEventAdded",function(b){if(!b)return!0;var a=scheduler.getEvent(b);if(!f(a)){if(a.start_date<scheduler.config.limit_start)a.start_date=new Date(scheduler.config.limit_start);if(a.start_date.valueOf()>=scheduler.config.limit_end.valueOf())a.start_date=this.date.add(scheduler.config.limit_end,-1,"day");if(a.end_date<scheduler.config.limit_start)a.end_date= -new Date(scheduler.config.limit_start);if(a.end_date.valueOf()>=scheduler.config.limit_end.valueOf())a.end_date=this.date.add(scheduler.config.limit_end,-1,"day");if(a.start_date.valueOf()>=a.end_date.valueOf())a.end_date=this.date.add(a.start_date,this.config.event_duration||this.config.time_step,"minute");a._timed=this.is_one_day_event(a)}return!0});scheduler.attachEvent("onEventChanged",function(b){if(!b)return!0;var a=scheduler.getEvent(b);if(!f(a)){if(!g)return!1;a.start_date=g[0];a.end_date= -g[1];a._timed=this.is_one_day_event(a)}return!0});scheduler.attachEvent("onBeforeEventChanged",function(b){return f(b)})})(); diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_map_view.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_map_view.js deleted file mode 100644 index 57735c07a0e..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_map_view.js +++ /dev/null @@ -1,29 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.xy.map_date_width=188;scheduler.xy.map_description_width=400;scheduler.config.map_resolve_event_location=!0;scheduler.config.map_resolve_user_location=!0;scheduler.config.map_initial_position=new google.maps.LatLng(48.724,8.215);scheduler.config.map_error_position=new google.maps.LatLng(15,15);scheduler.config.map_infowindow_max_width=300;scheduler.config.map_type=google.maps.MapTypeId.ROADMAP;scheduler.config.map_zoom_after_resolve=15;scheduler.locale.labels.marker_geo_success="It seems you are here."; -scheduler.locale.labels.marker_geo_fail="Sorry, could not get your current position using geolocation.";scheduler.templates.marker_date=scheduler.date.date_to_str("%Y-%m-%d %H:%i");scheduler.templates.marker_text=function(f,g,e){return"<div><b>"+e.text+"</b><br/><br/>"+(e.event_location||"")+"<br/><br/>"+scheduler.templates.marker_date(f)+" - "+scheduler.templates.marker_date(g)+"</div>"}; -scheduler.dblclick_dhx_map_area=function(){!this.config.readonly&&this.config.dblclick_create&&this.addEventNow({start_date:scheduler._date,end_date:scheduler.date.add(scheduler._date,1,"hour")})};scheduler.templates.map_time=function(f,g,e){return e._timed?this.day_date(e.start_date,e.end_date,e)+" "+this.event_date(f):scheduler.templates.day_date(f)+" – "+scheduler.templates.day_date(g)};scheduler.templates.map_text=function(f,g,e){return e.text};scheduler.date.map_start=function(f){return f}; -scheduler.date.add_map=function(f){return new Date(f.valueOf())};scheduler.templates.map_date=function(){return""};scheduler._latLngUpdate=!1; -scheduler.attachEvent("onSchedulerReady",function(){function f(a){if(a){var c=scheduler.locale.labels;scheduler._els.dhx_cal_header[0].innerHTML="<div class='dhx_map_line' style='width: "+(scheduler.xy.map_date_width+scheduler.xy.map_description_width+2)+"px;' ><div style='width: "+scheduler.xy.map_date_width+"px;'>"+c.date+"</div><div class='headline_description' style='width: "+scheduler.xy.map_description_width+"px;'>"+c.description+"</div></div>";scheduler._table_view=!0;scheduler.set_sizes()}} -function g(){scheduler._selected_event_id=null;scheduler.map._infowindow.close();for(var a in scheduler.map._markers)scheduler.map._markers[a].setMap(null),delete scheduler.map._markers[a],scheduler.map._infowindows_content[a]&&delete scheduler.map._infowindows_content[a]}function e(){var a=scheduler.get_visible_events();a.sort(function(a,b){return a.start_date<b.start_date?-1:a.start_date.valueOf()==b.start_date.valueOf()?a.text<b.text?-1:a.text==b.text?0:1:1});for(var c="<div class='dhx_map_area'>", -d=0;d<a.length;d++){var b=a[d],h=b.id==scheduler._selected_event_id?"dhx_map_line highlight":"dhx_map_line",e=b.color?"background-color:"+b.color+";":"",f=b.textColor?"color:"+b.textColor+";":"";c+="<div class='"+h+"' event_id='"+b.id+"' style='"+e+""+f+""+(b._text_style||"")+" width: "+(scheduler.xy.map_date_width+scheduler.xy.map_description_width+2)+"px;'><div style='width: "+scheduler.xy.map_date_width+"px;' >"+scheduler.templates.map_time(b.start_date,b.end_date,b)+"</div>";c+="<div class='dhx_event_icon icon_details'> </div>"; -c+="<div class='line_description' style='width:"+(scheduler.xy.map_description_width-25)+"px;'>"+scheduler.templates.map_text(b.start_date,b.end_date,b)+"</div></div>"}c+="<div class='dhx_v_border' style='left: "+(scheduler.xy.map_date_width-2)+"px;'></div><div class='dhx_v_border_description'></div></div>";scheduler._els.dhx_cal_data[0].scrollTop=0;scheduler._els.dhx_cal_data[0].innerHTML=c;scheduler._els.dhx_cal_data[0].style.width=scheduler.xy.map_date_width+scheduler.xy.map_description_width+ -1+"px";var g=scheduler._els.dhx_cal_data[0].firstChild.childNodes;scheduler._els.dhx_cal_date[0].innerHTML=scheduler.templates[scheduler._mode+"_date"](scheduler._min_date,scheduler._max_date,scheduler._mode);scheduler._rendered=[];for(d=0;d<g.length-2;d++)scheduler._rendered[d]=g[d]}function k(a){var c=document.getElementById(a),d=scheduler._y-scheduler.xy.nav_height;d<0&&(d=0);var b=scheduler._x-scheduler.xy.map_date_width-scheduler.xy.map_description_width-1;b<0&&(b=0);c.style.height=d+"px";c.style.width= -b+"px";c.style.marginLeft=scheduler.xy.map_date_width+scheduler.xy.map_description_width+1+"px";c.style.marginTop=scheduler.xy.nav_height+2+"px"}(function(){scheduler._isMapPositionSet=!1;var a=document.createElement("div");a.className="dhx_map";a.id="dhx_gmap";a.style.dispay="none";var c=scheduler._obj;c.appendChild(a);scheduler._els.dhx_gmap=[];scheduler._els.dhx_gmap.push(a);k("dhx_gmap");var d={zoom:scheduler.config.map_inital_zoom||10,center:scheduler.config.map_initial_position,mapTypeId:scheduler.config.map_type|| -google.maps.MapTypeId.ROADMAP},b=new google.maps.Map(document.getElementById("dhx_gmap"),d);b.disableDefaultUI=!1;b.disableDoubleClickZoom=!scheduler.config.readonly;google.maps.event.addListener(b,"dblclick",function(a){if(!scheduler.config.readonly&&scheduler.config.dblclick_create){var b=a.latLng;geocoder.geocode({latLng:b},function(a,c){if(c==google.maps.GeocoderStatus.OK)b=a[0].geometry.location,scheduler.addEventNow({lat:b.lat(),lng:b.lng(),event_location:a[0].formatted_address,start_date:scheduler._date, -end_date:scheduler.date.add(scheduler._date,1,"hour")})})}});var e={content:""};if(scheduler.config.map_infowindow_max_width)e.maxWidth=scheduler.config.map_infowindow_max_width;scheduler.map={_points:[],_markers:[],_infowindow:new google.maps.InfoWindow(e),_infowindows_content:[],_initialization_count:-1,_obj:b};geocoder=new google.maps.Geocoder;scheduler.config.map_resolve_user_location&&navigator.geolocation&&(scheduler._isMapPositionSet||navigator.geolocation.getCurrentPosition(function(a){var c= -new google.maps.LatLng(a.coords.latitude,a.coords.longitude);b.setCenter(c);b.setZoom(scheduler.config.map_zoom_after_resolve||10);scheduler.map._infowindow.setContent(scheduler.locale.labels.marker_geo_success);scheduler.map._infowindow.position=b.getCenter();scheduler.map._infowindow.open(b);scheduler._isMapPositionSet=!0},function(){scheduler.map._infowindow.setContent(scheduler.locale.labels.marker_geo_fail);scheduler.map._infowindow.setPosition(b.getCenter());scheduler.map._infowindow.open(b); -scheduler._isMapPositionSet=!0}));google.maps.event.addListener(b,"resize",function(){a.style.zIndex="5";b.setZoom(b.getZoom())});google.maps.event.addListener(b,"tilesloaded",function(){a.style.zIndex="5"});a.style.display="none"})();scheduler.attachEvent("onSchedulerResize",function(){return this._mode=="map"?(this.map_view(!0),!1):!0});var l=scheduler.render_data;scheduler.render_data=function(a,c){if(this._mode=="map"){e();for(var d=scheduler.get_visible_events(),b=0;b<d.length;b++)scheduler.map._markers[d[b].id]|| -i(d[b],!1,!1)}else return l.apply(this,arguments)};scheduler.map_view=function(a){scheduler.map._initialization_count++;var c=scheduler._els.dhx_gmap[0];scheduler._els.dhx_cal_data[0].style.width=scheduler.xy.map_date_width+scheduler.xy.map_description_width+1+"px";scheduler._min_date=scheduler.config.map_start||new Date;scheduler._max_date=scheduler.config.map_end||new Date(9999,1,1);scheduler._table_view=!0;f(a);if(a){g();e();c.style.display="block";k("dhx_gmap");for(var d=scheduler.map._obj.getCenter(), -b=scheduler.get_visible_events(),h=0;h<b.length;h++)scheduler.map._markers[b[h].id]||i(b[h])}else c.style.display="none";google.maps.event.trigger(scheduler.map._obj,"resize");scheduler.map._initialization_count===0&&d&&scheduler.map._obj.setCenter(d);scheduler._selected_event_id&&m(scheduler._selected_event_id)};var m=function(a){scheduler.map._obj.setCenter(scheduler.map._points[a]);scheduler.callEvent("onClick",[a])},i=function(a,c,d){var b=scheduler.config.map_error_position;a.lat&&a.lng&&(b= -new google.maps.LatLng(a.lat,a.lng));var e=scheduler.templates.marker_text(a.start_date,a.end_date,a);scheduler._new_event||(scheduler.map._infowindows_content[a.id]=e,scheduler.map._markers[a.id]&&scheduler.map._markers[a.id].setMap(null),scheduler.map._markers[a.id]=new google.maps.Marker({position:b,map:scheduler.map._obj}),google.maps.event.addListener(scheduler.map._markers[a.id],"click",function(){scheduler.map._infowindow.setContent(scheduler.map._infowindows_content[a.id]);scheduler.map._infowindow.open(scheduler.map._obj, -scheduler.map._markers[a.id]);scheduler._selected_event_id=a.id;scheduler.render_data()}),scheduler.map._points[a.id]=b,c&&scheduler.map._obj.setCenter(scheduler.map._points[a.id]),d&&scheduler.callEvent("onClick",[a.id]))};scheduler.attachEvent("onClick",function(a){if(this._mode=="map"){scheduler._selected_event_id=a;for(var c=0;c<scheduler._rendered.length;c++)scheduler._rendered[c].className="dhx_map_line",scheduler._rendered[c].getAttribute("event_id")==a&&(scheduler._rendered[c].className+= -" highlight");scheduler.map._points[a]&&scheduler.map._markers[a]&&(scheduler.map._obj.setCenter(scheduler.map._points[a]),google.maps.event.trigger(scheduler.map._markers[a],"click"))}return!0});var j=function(a){a.event_location&&geocoder?geocoder.geocode({address:a.event_location,language:scheduler.uid().toString()},function(c,d){var b={};if(d!=google.maps.GeocoderStatus.OK){if(b=scheduler.callEvent("onLocationError",[a.id]),!b||b===!0)b=scheduler.config.map_error_position}else b=c[0].geometry.location; -a.lat=b.lat();a.lng=b.lng();scheduler._selected_event_id=a.id;scheduler._latLngUpdate=!0;scheduler.callEvent("onEventChanged",[a.id,a]);i(a,!0,!0)}):i(a,!0,!0)},n=function(a){a.event_location&&geocoder&&geocoder.geocode({address:a.event_location,language:scheduler.uid().toString()},function(c,d){var b={};if(d!=google.maps.GeocoderStatus.OK){if(b=scheduler.callEvent("onLocationError",[a.id]),!b||b===!0)b=scheduler.config.map_error_position}else b=c[0].geometry.location;a.lat=b.lat();a.lng=b.lng(); -scheduler._latLngUpdate=!0;scheduler.callEvent("onEventChanged",[a.id,a])})},o=function(a,c,d,b){setTimeout(function(){var b=a.apply(c,d);a=obj=d=null;return b},b||1)};scheduler.attachEvent("onEventChanged",function(a){if(this._latLngUpdate)this._latLngUpdate=!1;else{var c=scheduler.getEvent(a);c.start_date<scheduler._min_date&&c.end_date>scheduler._min_date||c.start_date<scheduler._max_date&&c.end_date>scheduler._max_date||c.start_date.valueOf()>=scheduler._min_date&&c.end_date.valueOf()<=scheduler._max_date? -(scheduler.map._markers[a]&&scheduler.map._markers[a].setMap(null),j(c)):(scheduler._selected_event_id=null,scheduler.map._infowindow.close(),scheduler.map._markers[a]&&scheduler.map._markers[a].setMap(null))}return!0});scheduler.attachEvent("onEventIdChange",function(a,c){var d=scheduler.getEvent(c);if(d.start_date<scheduler._min_date&&d.end_date>scheduler._min_date||d.start_date<scheduler._max_date&&d.end_date>scheduler._max_date||d.start_date.valueOf()>=scheduler._min_date&&d.end_date.valueOf()<= -scheduler._max_date)scheduler.map._markers[a]&&(scheduler.map._markers[a].setMap(null),delete scheduler.map._markers[a]),scheduler.map._infowindows_content[a]&&delete scheduler.map._infowindows_content[a],j(d);return!0});scheduler.attachEvent("onEventAdded",function(a,c){if(!scheduler._dataprocessor&&(c.start_date<scheduler._min_date&&c.end_date>scheduler._min_date||c.start_date<scheduler._max_date&&c.end_date>scheduler._max_date||c.start_date.valueOf()>=scheduler._min_date&&c.end_date.valueOf()<= -scheduler._max_date))scheduler.map._markers[a]&&scheduler.map._markers[a].setMap(null),j(c);return!0});scheduler.attachEvent("onBeforeEventDelete",function(a){scheduler.map._markers[a]&&scheduler.map._markers[a].setMap(null);scheduler._selected_event_id=null;scheduler.map._infowindow.close();return!0});scheduler._event_resolve_delay=1500;scheduler.attachEvent("onEventLoading",function(a){scheduler.config.map_resolve_event_location&&a.event_location&&!a.lat&&!a.lng&&(scheduler._event_resolve_delay+= -1500,o(n,this,[a],scheduler._event_resolve_delay));return!0});scheduler.attachEvent("onEventCancel",function(a,c){c&&(scheduler.map._markers[a]&&scheduler.map._markers[a].setMap(null),scheduler.map._infowindow.close());return!0})}); diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_minical.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_minical.js deleted file mode 100644 index b7b0ba1d21d..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_minical.js +++ /dev/null @@ -1,26 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.templates.calendar_month=scheduler.date.date_to_str("%F %Y");scheduler.templates.calendar_scale_date=scheduler.date.date_to_str("%D");scheduler.templates.calendar_date=scheduler.date.date_to_str("%d"); -scheduler.renderCalendar=function(b,c){var a=null,d=b.date||new Date;typeof d=="string"&&(d=this.templates.api_date(d));if(c)a=this._render_calendar(c.parentNode,d,b,c),scheduler.unmarkCalendar(a);else{var e=b.container,f=b.position;typeof e=="string"&&(e=document.getElementById(e));typeof f=="string"&&(f=document.getElementById(f));if(f&&typeof f.left=="undefined")var n=getOffset(f),f={top:n.top+f.offsetHeight,left:n.left};e||(e=scheduler._get_def_cont(f));a=this._render_calendar(e,d,b);a.onclick= -function(a){var a=a||event,b=a.target||a.srcElement;if(b.className.indexOf("dhx_month_head")!=-1){var c=b.parentNode.className;if(c.indexOf("dhx_after")==-1&&c.indexOf("dhx_before")==-1){var d=scheduler.templates.xml_date(this.getAttribute("date"));d.setDate(parseInt(b.innerHTML,10));scheduler.unmarkCalendar(this);scheduler.markCalendar(this,d,"dhx_calendar_click");this._last_date=d;this.conf.handler&&this.conf.handler.call(scheduler,d,this)}}}}for(var m=scheduler.date.month_start(d),k=scheduler.date.add(m, -1,"month"),p=this.getEvents(m,k),i=0;i<p.length;i++){var o=p[i],l=o.start_date;l.valueOf()<m.valueOf()&&(l=m);for(l=scheduler.date.date_part(new Date(l.valueOf()));l<o.end_date;)if(this.markCalendar(a,l,"dhx_year_event"),l=this.date.add(l,1,"day"),l.valueOf()>=k.valueOf())break}this._markCalendarCurrentDate(a);a.conf=b;return a}; -scheduler._get_def_cont=function(b){if(!this._def_count)this._def_count=document.createElement("DIV"),this._def_count.style.cssText="position:absolute;z-index:10100;width:251px; height:175px;",this._def_count.onclick=function(b){(b||event).cancelBubble=!0},document.body.appendChild(this._def_count);this._def_count.style.left=b.left+"px";this._def_count.style.top=b.top+"px";this._def_count._created=new Date;return this._def_count}; -scheduler._locateCalendar=function(b,c){var a=b.childNodes[2].childNodes[0];typeof c=="string"&&(c=scheduler.templates.api_date(c));var d=b.week_start+c.getDate()-1;return a.rows[Math.floor(d/7)].cells[d%7].firstChild};scheduler.markCalendar=function(b,c,a){this._locateCalendar(b,c).className+=" "+a};scheduler.unmarkCalendar=function(b,c,a){c=c||b._last_date;a=a||"dhx_calendar_click";if(c){var d=this._locateCalendar(b,c);d.className=(d.className||"").replace(RegExp(a,"g"))}}; -scheduler._week_template=function(b){for(var c=b||250,a=0,d=document.createElement("div"),e=this.date.week_start(new Date),f=0;f<7;f++)this._cols[f]=Math.floor(c/(7-f)),this._render_x_header(f,a,e,d),e=this.date.add(e,1,"day"),c-=this._cols[f],a+=this._cols[f];d.lastChild.className+=" dhx_scale_bar_last";return d};scheduler.updateCalendar=function(b,c){b.conf.date=c;this.renderCalendar(b.conf,b)};scheduler._mini_cal_arrows=[" "," "]; -scheduler._render_calendar=function(b,c,a,d){var e=scheduler.templates,f=this._cols;this._cols=[];var n=this._mode;this._mode="calendar";var m=this._colsS;this._colsS={height:0};var k=new Date(this._min_date),p=new Date(this._max_date),i=new Date(scheduler._date),o=e.month_day;e.month_day=e.calendar_date;var c=this.date.month_start(c),l=this._week_template(b.offsetWidth-1),g;d?g=d:(g=document.createElement("DIV"),g.className="dhx_cal_container dhx_mini_calendar");g.setAttribute("date",this.templates.xml_format(c)); -g.innerHTML="<div class='dhx_year_month'></div><div class='dhx_year_week'>"+l.innerHTML+"</div><div class='dhx_year_body'></div>";g.childNodes[0].innerHTML=this.templates.calendar_month(c);if(a.navigation){var h=document.createElement("DIV");h.className="dhx_cal_prev_button";h.style.cssText="left:1px;top:2px;position:absolute;";h.innerHTML=this._mini_cal_arrows[0];g.firstChild.appendChild(h);h.onclick=function(){scheduler.updateCalendar(g,scheduler.date.add(g._date,-1,"month"));scheduler._date.getMonth()== -g._date.getMonth()&&scheduler._date.getFullYear()==g._date.getFullYear()&&scheduler._markCalendarCurrentDate(g)};h=document.createElement("DIV");h.className="dhx_cal_next_button";h.style.cssText="left:auto; right:1px;top:2px;position:absolute;";h.innerHTML=this._mini_cal_arrows[1];g.firstChild.appendChild(h);h.onclick=function(){scheduler.updateCalendar(g,scheduler.date.add(g._date,1,"month"));scheduler._date.getMonth()==g._date.getMonth()&&scheduler._date.getFullYear()==g._date.getFullYear()&&scheduler._markCalendarCurrentDate(g)}}g._date= -new Date(c);g.week_start=(c.getDay()-(this.config.start_on_monday?1:0)+7)%7;var u=this.date.week_start(c);this._reset_month_scale(g.childNodes[2],c,u);for(var j=g.childNodes[2].firstChild.rows,q=j.length;q<6;q++){var t=j[j.length-1];j[0].parentNode.appendChild(t.cloneNode(!0));for(var r=parseInt(t.childNodes[t.childNodes.length-1].childNodes[0].innerHTML),r=r<10?r:0,s=0;s<j[q].childNodes.length;s++)j[q].childNodes[s].className="dhx_after",j[q].childNodes[s].childNodes[0].innerHTML=scheduler.date.to_fixed(++r)}d|| -b.appendChild(g);g.childNodes[1].style.height=g.childNodes[1].childNodes[0].offsetHeight<=0?"0px":g.childNodes[1].childNodes[0].offsetHeight-1+"px";this._cols=f;this._mode=n;this._colsS=m;this._min_date=k;this._max_date=p;scheduler._date=i;e.month_day=o;return g}; -scheduler.destroyCalendar=function(b,c){if(!b&&this._def_count&&this._def_count.firstChild&&(c||(new Date).valueOf()-this._def_count._created.valueOf()>500))b=this._def_count.firstChild;if(b&&(b.onclick=null,b.innerHTML="",b.parentNode&&b.parentNode.removeChild(b),this._def_count))this._def_count.style.top="-1000px"};scheduler.isCalendarVisible=function(){return this._def_count&&parseInt(this._def_count.style.top,10)>0?this._def_count:!1}; -scheduler.attachEvent("onTemplatesReady",function(){dhtmlxEvent(document.body,"click",function(){scheduler.destroyCalendar()})});scheduler.templates.calendar_time=scheduler.date.date_to_str("%d-%m-%Y"); -scheduler.form_blocks.calendar_time={render:function(){var b="<input class='dhx_readonly' type='text' readonly='true'>",c=scheduler.config,a=this.date.date_part(new Date);c.first_hour&&a.setHours(c.first_hour);b+=" <select>";for(var d=60*c.first_hour;d<60*c.last_hour;d+=this.config.time_step*1){var e=this.templates.time_picker(a);b+="<option value='"+d+"'>"+e+"</option>";a=this.date.add(a,this.config.time_step,"minute")}b+="</select>";var f=scheduler.config.full_day;return"<div style='height:30px;padding-top:0; font-size:inherit;' class='dhx_section_time'>"+ -b+"<span style='font-weight:normal; font-size:10pt;'> – </span>"+b+"</div>"},set_value:function(b,c,a){function d(a,b,c){n(a,b,c);a.value=scheduler.templates.calendar_time(b);a._date=scheduler.date.date_part(new Date(b))}var e=b.getElementsByTagName("input"),f=b.getElementsByTagName("select"),n=function(a,b,c){a.onclick=function(){scheduler.destroyCalendar(null,!0);scheduler.renderCalendar({position:a,date:new Date(this._date),navigation:!0,handler:function(b){a.value=scheduler.templates.calendar_time(b); -a._date=new Date(b);scheduler.destroyCalendar();scheduler.config.event_duration&&scheduler.config.auto_end_date&&c==0&&o()}})}};if(scheduler.config.full_day){if(!b._full_day){var m="<label class='dhx_fullday'><input type='checkbox' name='full_day' value='true'> "+scheduler.locale.labels.full_day+" </label></input>";scheduler.config.wide_form||(m=b.previousSibling.innerHTML+m);b.previousSibling.innerHTML=m;b._full_day=!0}var k=b.previousSibling.getElementsByTagName("input")[0],p=scheduler.date.time_part(a.start_date)== -0&&scheduler.date.time_part(a.end_date)==0&&a.end_date.valueOf()-a.start_date.valueOf()<1728E5;k.checked=p;for(var i in f)f[i].disabled=k.checked;for(i=0;i<e.length;i++)e[i].disabled=k.checked;k.onclick=function(){if(k.checked==!0){var b=new Date(a.start_date),c=new Date(a.end_date);scheduler.date.date_part(b);c=scheduler.date.add(b,1,"day")}var h=b||a.start_date,i=c||a.end_date;d(e[0],h);d(e[1],i);f[0].value=h.getHours()*60+h.getMinutes();f[1].value=i.getHours()*60+i.getMinutes();for(var j in f)f[j].disabled= -k.checked;for(j=0;j<e.length;j++)e[j].disabled=k.checked}}if(scheduler.config.event_duration&&scheduler.config.auto_end_date){var o=function(){a.start_date=scheduler.date.add(e[0]._date,f[0].value,"minute");a.end_date.setTime(a.start_date.getTime()+scheduler.config.event_duration*6E4);e[1].value=scheduler.templates.calendar_time(a.end_date);e[1]._date=scheduler.date.date_part(new Date(a.end_date));f[1].value=a.end_date.getHours()*60+a.end_date.getMinutes()};f[0].onchange=o}d(e[0],a.start_date,0); -d(e[1],a.end_date,1);n=function(){};f[0].value=a.start_date.getHours()*60+a.start_date.getMinutes();f[1].value=a.end_date.getHours()*60+a.end_date.getMinutes()},get_value:function(b,c){var a=b.getElementsByTagName("input"),d=b.getElementsByTagName("select");c.start_date=scheduler.date.add(a[0]._date,d[0].value,"minute");c.end_date=scheduler.date.add(a[1]._date,d[1].value,"minute");if(c.end_date<=c.start_date)c.end_date=scheduler.date.add(c.start_date,scheduler.config.time_step,"minute")},focus:function(){}}; -scheduler.linkCalendar=function(b,c){var a=function(){var a=scheduler._date,e=new Date(a.valueOf());c&&(e=c(e));e.setDate(1);scheduler.updateCalendar(b,e);return!0};scheduler.attachEvent("onViewChange",a);scheduler.attachEvent("onXLE",a);scheduler.attachEvent("onEventAdded",a);scheduler.attachEvent("onEventChanged",a);scheduler.attachEvent("onAfterEventDelete",a);a()}; -scheduler._markCalendarCurrentDate=function(b){var c=scheduler._date,a=scheduler._mode;if(b._date.getMonth()==c.getMonth()&&b._date.getFullYear()==c.getFullYear())if(a=="day"||this._props&&this._props[a])scheduler.markCalendar(b,c,"dhx_calendar_click");else if(a=="week")for(var d=scheduler.date.week_start(new Date(c.valueOf())),e=0;e<7;e++){var f=d.getMonth()+d.getYear()*12-c.getMonth()-c.getYear()*12;f||scheduler.markCalendar(b,d,"dhx_calendar_click");d=scheduler.date.add(d,1,"day")}}; diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_multiselect.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_multiselect.js deleted file mode 100644 index 432bad25af0..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_multiselect.js +++ /dev/null @@ -1,7 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.form_blocks.multiselect={render:function(d){for(var a="<div class='dhx_multi_select_"+d.name+"' style='overflow: auto; height: "+d.height+"px; position: relative;' >",b=0;b<d.options.length;b++)a+="<label><input type='checkbox' value='"+d.options[b].key+"'/>"+d.options[b].label+"</label>",convertStringToBoolean(d.vertical)&&(a+="<br/>");a+="</div>";return a},set_value:function(d,a,b,c){function h(b){for(var c=d.getElementsByTagName("input"),a=0;a<c.length;a++)c[a].checked=!!b[c[a].value]} -for(var f=d.getElementsByTagName("input"),e=0;e<f.length;e++)f[e].checked=!1;if(!scheduler._new_event)if(f=[],b[c.map_to]){for(var i=b[c.map_to].split(","),e=0;e<i.length;e++)f[i[e]]=!0;h(f)}else{var g=document.createElement("div");g.className="dhx_loading";g.style.cssText="position: absolute; top: 40%; left: 40%;";d.appendChild(g);dhtmlxAjax.get(c.script_url+"?dhx_crosslink_"+c.map_to+"="+b.id+"&uid="+scheduler.uid(),function(b){for(var a=b.doXPath("//data/item"),e=[],f=0;f<a.length;f++)e[a[f].getAttribute(c.map_to)]= -!0;h(e);d.removeChild(g)})}},get_value:function(d){for(var a=[],b=d.getElementsByTagName("input"),c=0;c<b.length;c++)b[c].checked&&a.push(b[c].value);return a.join(",")},focus:function(){}}; diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_multisource.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_multisource.js deleted file mode 100644 index 797ce06da4a..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_multisource.js +++ /dev/null @@ -1,5 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -(function(){function e(a){var b=function(){};b.prototype=a;return b}var d=scheduler._load;scheduler._load=function(a,b){a=a||this._load_url;if(typeof a=="object")for(var f=e(this._loaded),c=0;c<a.length;c++)this._loaded=new f,d.call(this,a[c],b);else d.apply(this,arguments)}})(); diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_offline.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_offline.js deleted file mode 100644 index fc429dd5e2d..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_offline.js +++ /dev/null @@ -1,9 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler._extra_xle=!1;scheduler.attachEvent("onXLE",function(){if(!scheduler._extra_xle){var a=!1,c;for(c in scheduler._events)if(scheduler._events[c].text){a=!0;break}if((localStorage._updated_events||!a)&&localStorage._events){scheduler._extra_xle=!0;scheduler.parse(localStorage._events,"json");scheduler._extra_xle=!1;var b=scheduler._dataprocessor,e=JSON.parse(localStorage._updated_events);b.setUpdateMode("off");for(var d in e)b.setUpdated(d,!0,e[d]);b.sendData();b.setUpdateMode("cell")}}}); -scheduler.attachEvent("onBeforeEventDelete",function(a){var c=scheduler._dataprocessor.getState(a);if(c=="inserted"&&localStorage._updated_events){var b=JSON.parse(localStorage._updated_events);delete b[a];for(a in b){localStorage._updated_events=JSON.stringify(b);break}}return!0});var old_delete_event=scheduler.deleteEvent;scheduler.deleteEvent=function(a,c){old_delete_event.apply(this,arguments);localStorage._events=scheduler.toJSON()};scheduler._offline={}; -scheduler._offline._after_update_events=[];var old_dp_init=scheduler._dp_init; -scheduler._dp_init=function(a){old_dp_init.apply(this,arguments);a.attachEvent("onAfterUpdate",function(c){scheduler._offline._after_update_events.push(c);return!0});a.attachEvent("onAfterUpdateFinish",function(){localStorage._events=scheduler.toJSON();for(var c=JSON.parse(localStorage._updated_events),b=0;b<scheduler._offline._after_update_events.length;b++)delete c[scheduler._offline._after_update_events[b]];var a=!1,d;for(d in c){a=!0;break}a?(localStorage._updated_events=JSON.stringify(c),scheduler._offline._after_update_event= -[]):delete localStorage._updated_events;return!0});a.attachEvent("onBeforeDataSending",function(a,b,e){var d={};localStorage._updated_events&&(d=JSON.parse(localStorage._updated_events));for(var f in e){var g=scheduler._dataprocessor.action_param;if(d[f]&&(d[f][g]=="inserted"||e[f][g]=="deleted")||!d[f])d[f]=e[f][g]}localStorage._events=scheduler.toJSON();localStorage._updated_events=JSON.stringify(d);return!0});dhtmlxError.catchError("LoadXML",function(){for(var a in scheduler._dataprocessor._in_progress)delete scheduler._dataprocessor._in_progress[a]})}; diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_outerdrag.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_outerdrag.js deleted file mode 100644 index b4ae32b1b60..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_outerdrag.js +++ /dev/null @@ -1,6 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.attachEvent("onTemplatesReady",function(){var a=new dhtmlDragAndDropObject,g=a.stopDrag,b;a.stopDrag=function(d){b=d||event;return g.apply(this,arguments)};a.addDragLanding(scheduler._els.dhx_cal_data[0],{_drag:function(d){var a=scheduler.attachEvent("onEventCreated",function(a,b){if(!scheduler.callEvent("onExternalDragIn",[a,d,b]))this._drag_mode=this._drag_id=null,this.deleteEvent(a)});if(scheduler.matrix&&scheduler.matrix[scheduler._mode])scheduler.dblclick_dhx_matrix_cell(b);else{var f= -document.createElement("div");f.className="dhx_month_body";var c={},e;for(e in b)c[e]=b[e];c.target=c.srcElement=f;scheduler._on_dbl_click(c)}scheduler.detachEvent(a)},_dragIn:function(a){return a},_dragOut:function(){return this}})}); diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_pdf.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_pdf.js deleted file mode 100644 index d8c34cffda4..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_pdf.js +++ /dev/null @@ -1,14 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.toPDF=function(x,f,m,n){function g(c){return c.replace(html_regexp,"")}function j(c){c=parseFloat(c);return isNaN(c)?"auto":100*c/(o+1)}function t(c){c=parseFloat(c);return isNaN(c)?"auto":100*c/k}function q(c){var a="";if(scheduler.matrix&&scheduler.matrix[scheduler._mode])c=c[0].childNodes;for(var b=0;b<c.length;b++)a+="\n<column><![CDATA["+g(c[b].innerHTML)+"]]\></column>";o=c[0].offsetWidth;return a}function y(c,a){for(var b=parseInt(c.style.left),d=0;d<scheduler._cols.length;d++)if(b-= -scheduler._cols[d],b<0)return d;return a}function z(c,a){for(var b=parseInt(c.style.top),d=0;d<scheduler._colsS.heights.length;d++)if(scheduler._colsS.heights[d]>b)return d;return a}function w(c){for(var a="",b=c.firstChild.rows,d=0;d<b.length;d++){for(var e=[],h=0;h<b[d].cells.length;h++)e.push(b[d].cells[h].firstChild.innerHTML);a+="\n<row height='"+c.firstChild.rows[d].cells[0].offsetHeight+"'><![CDATA["+g(e.join("|"))+"]]\></row>";k=c.firstChild.rows[0].cells[0].offsetHeight}return a}function A(c){var a= -"<data profile='"+c+"'";m&&(a+=" header='"+m+"'");n&&(a+=" footer='"+n+"'");a+=">";a+="<scale mode='"+scheduler._mode+"' today='"+scheduler._els.dhx_cal_date[0].innerHTML+"'>";if(scheduler._mode=="agenda"){var b=scheduler._els.dhx_cal_header[0].childNodes[0].childNodes;a+="<column>"+g(b[0].innerHTML)+"</column><column>"+g(b[1].innerHTML)+"</column>"}else if(scheduler._mode=="year")for(var b=scheduler._els.dhx_cal_data[0].childNodes,d=0;d<b.length;d++)a+="<month label='"+g(b[d].childNodes[0].innerHTML)+ -"'>",a+=q(b[d].childNodes[1].childNodes),a+=w(b[d].childNodes[2]),a+="</month>";else{a+="<x>";b=scheduler._els.dhx_cal_header[0].childNodes;a+=q(b);a+="</x>";var e=scheduler._els.dhx_cal_data[0];if(scheduler.matrix&&scheduler.matrix[scheduler._mode]){a+="<y>";for(d=0;d<e.firstChild.rows.length;d++)a+="<row><![CDATA["+e.firstChild.rows[d].cells[0].innerHTML+"]]\></row>";a+="</y>";k=e.firstChild.rows[0].cells[0].offsetHeight}else if(e.firstChild.tagName=="TABLE")a+=w(e);else{for(e=e.childNodes[e.childNodes.length- -1];e.className.indexOf("dhx_scale_holder")==-1;)e=e.previousSibling;e=e.childNodes;a+="<y>";for(d=0;d<e.length;d++)a+="\n<row><![CDATA["+g(e[d].innerHTML)+"]]\></row>";a+="</y>";k=e[0].offsetHeight}}a+="</scale>";return a}function r(c,a){return(window.getComputedStyle?window.getComputedStyle(c,null)[a]:c.currentStyle?c.currentStyle[a]:null)||""}function B(){var c="",a=scheduler._rendered;if(scheduler._mode=="agenda")for(var b=0;b<a.length;b++)c+="<event><head>"+g(a[b].childNodes[0].innerHTML)+"</head><body>"+ -g(a[b].childNodes[2].innerHTML)+"</body></event>";else if(scheduler._mode=="year"){a=scheduler.get_visible_events();for(b=0;b<a.length;b++){var d=a[b].start_date;if(d.valueOf()<scheduler._min_date.valueOf())d=scheduler._min_date;for(;d<a[b].end_date;){var e=d.getMonth()+12*(d.getFullYear()-scheduler._min_date.getFullYear())-scheduler.week_starts._month,h=scheduler.week_starts[e]+d.getDate()-1;c+="<event day='"+h%7+"' week='"+Math.floor(h/7)+"' month='"+e+"'></event>";d=scheduler.date.add(d,1,"day"); -if(d.valueOf()>=scheduler._max_date.valueOf())break}}}else for(b=0;b<a.length;b++){var f=j(a[b].style.left),i=j(a[b].style.width),l=t(a[b].style.top),m=t(a[b].style.height),n=a[b].className.split(" ")[0].replace("dhx_cal_",""),o=scheduler.getEvent(a[b].getAttribute("event_id")),h=o._sday,s=o._sweek;if(scheduler._mode!="month"){if(scheduler.matrix&&scheduler.matrix[scheduler._mode])h=0,s=a[b].parentNode.parentNode.parentNode.rowIndex,i+=j(10);else{i+=j(i*20/100);f-=j(20-f*20/100);if(a[b].parentNode== -scheduler._els.dhx_cal_data[0])continue;f+=j(a[b].parentNode.style.left);f-=j(51)}if(scheduler._mode=="timeline"){var q=k;k=180;l=t(a[b].style.top);k=q}}else m=parseInt(a[b].offsetHeight),l=parseInt(a[b].style.top)-22,h=y(a[b],h),s=z(a[b],s);c+="\n<event week='"+s+"' day='"+h+"' type='"+n+"' x='"+f+"' y='"+l+"' width='"+i+"' height='"+m+"'>";if(n=="event"){c+="<header><![CDATA["+g(a[b].childNodes[1].innerHTML)+"]]\></header>";var u=p?r(a[b].childNodes[2],"color"):"",v=p?r(a[b].childNodes[2],"backgroundColor"): -"";c+="<body backgroundColor='"+v+"' color='"+u+"'><![CDATA["+g(a[b].childNodes[2].innerHTML)+"]]\></body>"}else u=p?r(a[b],"color"):"",v=p?r(a[b],"backgroundColor"):"",c+="<body backgroundColor='"+v+"' color='"+u+"'><![CDATA["+g(a[b].innerHTML)+"]]\></body>";c+="</event>"}return c}function C(){var c="</data>";return c}var o=0,k=0,p=!1;f=="fullcolor"&&(p=!0,f="color");f=f||"color";html_regexp=RegExp("<[^>]*>","g");var l=(new Date).valueOf(),i=document.createElement("div");i.style.display="none";document.body.appendChild(i); -i.innerHTML='<form id="'+l+'" method="post" target="_blank" action="'+x+'" accept-charset="utf-8" enctype="application/x-www-form-urlencoded"><input type="hidden" name="mycoolxmlbody"/> </form>';document.getElementById(l).firstChild.value=A(f).replace("\u2013","-")+B()+C();document.getElementById(l).submit();i.parentNode.removeChild(i);grid=null}; diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_readonly.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_readonly.js deleted file mode 100644 index 066e5e5a57b..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_readonly.js +++ /dev/null @@ -1,9 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.attachEvent("onTemplatesReady",function(){function h(d,b,c,f){for(var e=b.getElementsByTagName(d),a=c.getElementsByTagName(d),g=a.length-1;g>=0;g--)if(c=a[g],f){var i=document.createElement("SPAN");i.className="dhx_text_disabled";i.innerHTML=f(e[g]);c.parentNode.insertBefore(i,c);c.parentNode.removeChild(c)}else c.disabled=!0}scheduler.attachEvent("onBeforeLightbox",function(d){if(this.config.readonly_form||this.getEvent(d).readonly)this.config.readonly_active=!0;else return this.config.readonly_active= -!1,!0;for(var b=0;b<this.config.lightbox.sections.length;b++)this.config.lightbox.sections[b].focus=!1;return!0});var k=scheduler._fill_lightbox;scheduler._fill_lightbox=function(){var d=this.config.lightbox.sections;if(this.config.readonly_active)for(var b=0;b<d.length;b++)if(d[b].type=="recurring"){var c=document.getElementById(d[b].id);c.style.display=c.nextSibling.style.display="none";d.splice(b,1);b--}var f=k.apply(this,arguments);if(this.config.readonly_active){var e=this._get_lightbox(),a= -this._lightbox_r=e.cloneNode(!0);a.id=scheduler.uid();a.style.color="red";h("textarea",e,a,function(a){return a.value});h("input",e,a,!1);h("select",e,a,function(a){return a.options[Math.max(a.selectedIndex||0,0)].text});a.removeChild(a.childNodes[2]);a.removeChild(a.childNodes[3]);e.parentNode.insertBefore(a,e);j.call(this,a);scheduler._lightbox&&scheduler._lightbox.parentNode.removeChild(scheduler._lightbox);this._lightbox=a;this.setLightboxSize();this._lightbox=null;a.onclick=function(a){var b= -a?a.target:event.srcElement;if(!b.className)b=b.previousSibling;if(b&&b.className)switch(b.className){case "dhx_cancel_btn":scheduler.callEvent("onEventCancel",[scheduler._lightbox_id]),scheduler._edit_stop_event(scheduler.getEvent(scheduler._lightbox_id),!1),scheduler.hide_lightbox()}}}return f};var j=scheduler.showCover;scheduler.showCover=function(){this.config.readonly_active||j.apply(this,arguments)};var l=scheduler.hide_lightbox;scheduler.hide_lightbox=function(){if(this._lightbox_r)this._lightbox_r.parentNode.removeChild(this._lightbox_r), -this._lightbox_r=null;return l.apply(this,arguments)}}); diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_recurring.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_recurring.js deleted file mode 100644 index b57b847683a..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_recurring.js +++ /dev/null @@ -1,35 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.form_blocks.recurring={render:function(){return scheduler.__recurring_template},_ds:{},_init_set_value:function(a,b,c){function d(a){for(var b=0;b<a.length;b++){var c=a[b];c.type=="checkbox"||c.type=="radio"?(g[c.name]||(g[c.name]=[]),g[c.name].push(c)):g[c.name]=c}}function f(a){for(var b=g[a],c=0;c<b.length;c++)if(b[c].checked)return b[c].value}function e(){m("dhx_repeat_day").style.display="none";m("dhx_repeat_week").style.display="none";m("dhx_repeat_month").style.display="none";m("dhx_repeat_year").style.display= -"none";m("dhx_repeat_"+this.value).style.display="block"}function h(a){var b=[f("repeat")];for(p[b[0]](b,a);b.length<5;)b.push("");var c="";if(g.end[0].checked)a.end=new Date(9999,1,1),c="no";else if(g.end[2].checked)a.end=i(g.date_of_end.value);else{scheduler.transpose_type(b.join("_"));var c=Math.max(1,g.occurences_count.value),e=b[0]=="week"&&b[4]&&b[4].toString().indexOf(scheduler.config.start_on_monday?1:0)==-1?1:0;a.end=scheduler.date.add(new Date(a.start),c+e,b.join("_"))}return b.join("_")+ -"#"+c}function j(a,b){var c=a.split("#"),a=c[0].split("_");q[a[0]](a,b);var e=g.repeat[{day:0,week:1,month:2,year:3}[a[0]]];switch(c[1]){case "no":g.end[0].checked=!0;break;case "":g.end[2].checked=!0;g.date_of_end.value=k(b.end);break;default:g.end[1].checked=!0,g.occurences_count.value=c[1]}e.checked=!0;e.onclick()}scheduler.form_blocks.recurring._ds={start:c.start_date,end:c._end_date};var i=scheduler.date.str_to_date(scheduler.config.repeat_date),k=scheduler.date.date_to_str(scheduler.config.repeat_date), -l=a.getElementsByTagName("FORM")[0],g=[];d(l.getElementsByTagName("INPUT"));d(l.getElementsByTagName("SELECT"));var m=function(a){return document.getElementById(a)};scheduler.form_blocks.recurring._get_repeat_code=h;var p={month:function(a,b){f("month_type")=="d"?(a.push(Math.max(1,g.month_count.value)),b.start.setDate(g.month_day.value)):(a.push(Math.max(1,g.month_count2.value)),a.push(g.month_day2.value),a.push(Math.max(1,g.month_week2.value)),b.start.setDate(1));b._start=!0},week:function(a,b){a.push(Math.max(1, -g.week_count.value));a.push("");a.push("");for(var c=[],e=g.week_day,d=0;d<e.length;d++)e[d].checked&&c.push(e[d].value);c.length||c.push(b.start.getDay());b.start=scheduler.date.week_start(b.start);b._start=!0;a.push(c.sort().join(","))},day:function(a){f("day_type")=="d"?a.push(Math.max(1,g.day_count.value)):(a.push("week"),a.push(1),a.push(""),a.push(""),a.push("1,2,3,4,5"),a.splice(0,1))},year:function(a,b){f("year_type")=="d"?(a.push("1"),b.start.setMonth(0),b.start.setDate(g.year_day.value), -b.start.setMonth(g.year_month.value)):(a.push("1"),a.push(g.year_day2.value),a.push(g.year_week2.value),b.start.setDate(1),b.start.setMonth(g.year_month2.value));b._start=!0}},q={week:function(a){g.week_count.value=a[1];for(var b=g.week_day,c=a[4].split(","),e={},d=0;d<c.length;d++)e[c[d]]=!0;for(d=0;d<b.length;d++)b[d].checked=!!e[b[d].value]},month:function(a,b){a[2]==""?(g.month_type[0].checked=!0,g.month_count.value=a[1],g.month_day.value=b.start.getDate()):(g.month_type[1].checked=!0,g.month_count2.value= -a[1],g.month_week2.value=a[3],g.month_day2.value=a[2])},day:function(a){g.day_type[0].checked=!0;g.day_count.value=a[1]},year:function(a,b){a[2]==""?(g.year_type[0].checked=!0,g.year_day.value=b.start.getDate(),g.year_month.value=b.start.getMonth()):(g.year_type[1].checked=!0,g.year_week2.value=a[3],g.year_day2.value=a[2],g.year_month2.value=b.start.getMonth())}};scheduler.form_blocks.recurring._set_repeat_code=j;for(var n=0;n<l.elements.length;n++){var o=l.elements[n];switch(o.name){case "repeat":o.onclick= -e}}scheduler._lightbox._rec_init_done=!0},set_value:function(a,b,c){var d=scheduler.form_blocks.recurring;scheduler._lightbox._rec_init_done||d._init_set_value(a,b,c);a.open=!c.rec_type;a.blocked=c.event_pid&&c.event_pid!="0"?!0:!1;var f=d._ds;f.start=c.start_date;f.end=c._end_date;d.button_click(0,a.previousSibling.firstChild.firstChild,a,a);b&&d._set_repeat_code(b,f)},get_value:function(a,b){if(a.open){var c=scheduler.form_blocks.recurring._ds;b.rec_type=scheduler.form_blocks.recurring._get_repeat_code(c); -c._start?(b.start_date=new Date(c.start),b._start_date=new Date(c.start),c._start=!1):b._start_date=null;b._end_date=b.end_date=c.end;b.rec_pattern=b.rec_type.split("#")[0]}else b.rec_type=b.rec_pattern="",b._end_date=b.end_date;return b.rec_type},focus:function(){},button_click:function(a,b,c,d){!d.open&&!d.blocked?(d.style.height="115px",b.style.backgroundPosition="-5px 0px",b.nextSibling.innerHTML=scheduler.locale.labels.button_recurring_open):(d.style.height="0px",b.style.backgroundPosition="-5px 20px", -b.nextSibling.innerHTML=scheduler.locale.labels.button_recurring);d.open=!d.open;scheduler.setLightboxSize()}};scheduler._rec_markers={};scheduler._rec_markers_pull={};scheduler._add_rec_marker=function(a,b){a._pid_time=b;this._rec_markers[a.id]=a;this._rec_markers_pull[a.event_pid]||(this._rec_markers_pull[a.event_pid]={});this._rec_markers_pull[a.event_pid][b]=a};scheduler._get_rec_marker=function(a,b){var c=this._rec_markers_pull[b];return c?c[a]:null}; -scheduler._get_rec_markers=function(a){return this._rec_markers_pull[a]||[]};scheduler._rec_temp=[];scheduler.attachEvent("onEventLoading",function(a){a.event_pid!=0&&scheduler._add_rec_marker(a,a.event_length*1E3);if(a.rec_type)a.rec_pattern=a.rec_type.split("#")[0];return!0}); -scheduler.attachEvent("onEventIdChange",function(a,b){if(!this._ignore_call){this._ignore_call=!0;for(var c=0;c<this._rec_temp.length;c++){var d=this._rec_temp[c];if(d.event_pid==a)d.event_pid=b,this.changeEventId(d.id,b+"#"+d.id.split("#")[1])}delete this._ignore_call}}); -scheduler.attachEvent("onBeforeEventDelete",function(a){var b=this.getEvent(a);if(a.toString().indexOf("#")!=-1||b.event_pid&&b.event_pid!="0"&&b.rec_type!="none"){var a=a.split("#"),c=this.uid(),d=a[1]?a[1]:b._pid_time/1E3,f=this._copy_event(b);f.id=c;f.event_pid=b.event_pid||a[0];f.event_length=d;f.rec_type=f.rec_pattern="none";this.addEvent(f);this._add_rec_marker(f,d*1E3)}else{b.rec_type&&this._roll_back_dates(b);var e=this._get_rec_markers(a),h;for(h in e)if(e.hasOwnProperty(h))a=e[h].id,this.getEvent(a)&& -this.deleteEvent(a,!0)}return!0}); -scheduler.attachEvent("onEventChanged",function(a){if(this._loading)return!0;var b=this.getEvent(a);if(a.toString().indexOf("#")!=-1){var a=a.split("#"),c=this.uid();this._not_render=!0;var d=this._copy_event(b);d.id=c;d.event_pid=a[0];d.event_length=a[1];d.rec_type=d.rec_pattern="";this.addEvent(d);this._not_render=!1;this._add_rec_marker(d,a[1]*1E3)}else{b.rec_type&&this._roll_back_dates(b);var f=this._get_rec_markers(a),e;for(e in f)f.hasOwnProperty(e)&&(delete this._rec_markers[f[e].id],this.deleteEvent(f[e].id, -!0));delete this._rec_markers_pull[a];for(var h=!1,j=0;j<this._rendered.length;j++)this._rendered[j].getAttribute("event_id")==a&&(h=!0);if(!h)this._select_id=null}return!0});scheduler.attachEvent("onEventAdded",function(a){if(!this._loading){var b=this.getEvent(a);b.rec_type&&!b.event_length&&this._roll_back_dates(b)}return!0});scheduler.attachEvent("onEventSave",function(a,b){var c=this.getEvent(a);if(!c.rec_type&&b.rec_type&&(a+"").indexOf("#")==-1)this._select_id=null;return!0}); -scheduler.attachEvent("onEventCreated",function(a){var b=this.getEvent(a);if(!b.rec_type)b.rec_type=b.rec_pattern=b.event_length=b.event_pid="";return!0});scheduler.attachEvent("onEventCancel",function(a){var b=this.getEvent(a);b.rec_type&&(this._roll_back_dates(b),this.render_view_data())}); -scheduler._roll_back_dates=function(a){a.event_length=(a.end_date.valueOf()-a.start_date.valueOf())/1E3;a.end_date=a._end_date;a._start_date&&(a.start_date.setMonth(0),a.start_date.setDate(a._start_date.getDate()),a.start_date.setMonth(a._start_date.getMonth()),a.start_date.setFullYear(a._start_date.getFullYear()))};scheduler.validId=function(a){return a.toString().indexOf("#")==-1};scheduler.showLightbox_rec=scheduler.showLightbox; -scheduler.showLightbox=function(a){var b=this.getEvent(a).event_pid;a.toString().indexOf("#")!=-1&&(b=a.split("#")[0]);if(!b||b==0||!this.locale.labels.confirm_recurring||!confirm(this.locale.labels.confirm_recurring))return this.showLightbox_rec(a);b=this.getEvent(b);b._end_date=b.end_date;b.end_date=new Date(b.start_date.valueOf()+b.event_length*1E3);return this.showLightbox_rec(b.id)};scheduler.get_visible_events_rec=scheduler.get_visible_events; -scheduler.get_visible_events=function(){for(var a=0;a<this._rec_temp.length;a++)delete this._events[this._rec_temp[a].id];this._rec_temp=[];for(var b=this.get_visible_events_rec(),c=[],a=0;a<b.length;a++)b[a].rec_type?b[a].rec_pattern!="none"&&this.repeat_date(b[a],c):c.push(b[a]);return c};(function(){var a=scheduler.is_one_day_event;scheduler.is_one_day_event=function(b){return b.rec_type?!0:a.call(this,b)}})();scheduler.transponse_size={day:1,week:7,month:1,year:12}; -scheduler.date.day_week=function(a,b,c){a.setDate(1);var c=(c-1)*7,d=a.getDay(),f=b*1+c-d+1;a.setDate(f<=c?f+7:f)};scheduler.transpose_day_week=function(a,b,c,d,f){for(var e=(a.getDay()||(scheduler.config.start_on_monday?7:0))-c,h=0;h<b.length;h++)if(b[h]>e)return a.setDate(a.getDate()+b[h]*1-e-(d?c:f));this.transpose_day_week(a,b,c+d,null,c)}; -scheduler.transpose_type=function(a){var b="transpose_"+a;if(!this.date[b]){var c=a.split("_"),d=864E5,f="add_"+a,e=this.transponse_size[c[0]]*c[1];if(c[0]=="day"||c[0]=="week"){var h=null;if(c[4]&&(h=c[4].split(","),scheduler.config.start_on_monday)){for(var j=0;j<h.length;j++)h[j]=h[j]*1||7;h.sort()}this.date[b]=function(a,b){var c=Math.floor((b.valueOf()-a.valueOf())/(d*e));c>0&&a.setDate(a.getDate()+c*e);h&&scheduler.transpose_day_week(a,h,1,e)};this.date[f]=function(a,b){var c=new Date(a.valueOf()); -if(h)for(var d=0;d<b;d++)scheduler.transpose_day_week(c,h,0,e);else c.setDate(c.getDate()+b*e);return c}}else if(c[0]=="month"||c[0]=="year")this.date[b]=function(a,b){var d=Math.ceil((b.getFullYear()*12+b.getMonth()*1-(a.getFullYear()*12+a.getMonth()*1))/e);d>=0&&a.setMonth(a.getMonth()+d*e);c[3]&&scheduler.date.day_week(a,c[2],c[3])},this.date[f]=function(a,b){var d=new Date(a.valueOf());d.setMonth(d.getMonth()+b*e);c[3]&&scheduler.date.day_week(d,c[2],c[3]);return d}}}; -scheduler.repeat_date=function(a,b,c,d,f){var d=d||this._min_date,f=f||this._max_date,e=new Date(a.start_date.valueOf());if(!a.rec_pattern&&a.rec_type)a.rec_pattern=a.rec_type.split("#")[0];this.transpose_type(a.rec_pattern);for(scheduler.date["transpose_"+a.rec_pattern](e,d);e<a.start_date||e.valueOf()+a.event_length*1E3<=d.valueOf();)e=this.date.add(e,1,a.rec_pattern);for(;e<f&&e<a.end_date;){var h=this._get_rec_marker(e.valueOf(),a.id);if(h)c&&b.push(h);else{var j=new Date(e.valueOf()+a.event_length* -1E3),i=this._copy_event(a);i.text=a.text;i.start_date=e;i.event_pid=a.id;i.id=a.id+"#"+Math.ceil(e.valueOf()/1E3);i.end_date=j;var k=i.start_date.getTimezoneOffset()-i.end_date.getTimezoneOffset();if(k)i.end_date=k>0?new Date(e.valueOf()+a.event_length*1E3-k*6E4):new Date(i.end_date.valueOf()+k*6E4);i._timed=this.is_one_day_event(i);if(!i._timed&&!this._table_view&&!this.config.multi_day)break;b.push(i);c||(this._events[i.id]=i,this._rec_temp.push(i))}e=this.date.add(e,1,a.rec_pattern)}}; -scheduler.getRecDates=function(a,b){var c=typeof a=="object"?a:scheduler.getEvent(a),d=0,f=[],b=b||1E3,e=new Date(c.start_date.valueOf()),h=new Date(e.valueOf());if(!c.rec_type)return[{start_date:c.start_date,end_date:c.end_date}];this.transpose_type(c.rec_pattern);for(scheduler.date["transpose_"+c.rec_pattern](e,h);e<c.start_date||e.valueOf()+c.event_length*1E3<=h.valueOf();)e=this.date.add(e,1,c.rec_pattern);for(;e<c.end_date;){var j=this._get_rec_marker(e.valueOf(),c.id),i=!0;if(j)j.rec_type== -"none"?i=!1:f.push({start_date:j.start_date,end_date:j.end_date});else{var k=new Date(e.valueOf()+c.event_length*1E3),l=new Date(e);f.push({start_date:l,end_date:k})}e=this.date.add(e,1,c.rec_pattern);if(i&&(d++,d==b))break}return f}; -scheduler.getEvents=function(a,b){var c=[],d;for(d in this._events){var f=this._events[d];if(f&&f.start_date<b&&f.end_date>a)if(f.rec_pattern){if(f.rec_pattern!="none"){var e=[];this.repeat_date(f,e,!0,a,b);for(var h=0;h<e.length;h++)!e[h].rec_pattern&&e[h].start_date<b&&e[h].end_date>a&&!this._rec_markers[e[h].id]&&c.push(e[h])}}else f.id.toString().indexOf("#")==-1&&c.push(f)}return c};scheduler.config.repeat_date="%m.%d.%Y"; -scheduler.config.lightbox.sections=[{name:"description",height:130,map_to:"text",type:"textarea",focus:!0},{name:"recurring",type:"recurring",map_to:"rec_type",button:"recurring"},{name:"time",height:72,type:"time",map_to:"auto"}];scheduler._copy_dummy=function(){this.start_date=new Date(this.start_date);this.end_date=new Date(this.end_date);this.event_length=this.event_pid=this.rec_pattern=this.rec_type=this._timed=null}; -scheduler.__recurring_template='<div class="dhx_form_repeat"> <form> <div class="dhx_repeat_left"> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="day" />Daily</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="week"/>Weekly</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="month" checked />Monthly</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="year" />Yearly</label> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_center"> <div style="display:none;" id="dhx_repeat_day"> <label><input class="dhx_repeat_radio" type="radio" name="day_type" value="d"/>Every</label><input class="dhx_repeat_text" type="text" name="day_count" value="1" />day<br /> <label><input class="dhx_repeat_radio" type="radio" name="day_type" checked value="w"/>Every workday</label> </div> <div style="display:none;" id="dhx_repeat_week"> Repeat every<input class="dhx_repeat_text" type="text" name="week_count" value="1" />week next days:<br /> <table class="dhx_repeat_days"> <tr> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="1" />Monday</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="4" />Thursday</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="2" />Tuesday</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="5" />Friday</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="3" />Wednesday</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="6" />Saturday</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="0" />Sunday</label><br /><br /> </td> </tr> </table> </div> <div id="dhx_repeat_month"> <label><input class="dhx_repeat_radio" type="radio" name="month_type" value="d"/>Repeat</label><input class="dhx_repeat_text" type="text" name="month_day" value="1" />day every<input class="dhx_repeat_text" type="text" name="month_count" value="1" />month<br /> <label><input class="dhx_repeat_radio" type="radio" name="month_type" checked value="w"/>On</label><input class="dhx_repeat_text" type="text" name="month_week2" value="1" /><select name="month_day2"><option value="1" selected >Monday<option value="2">Tuesday<option value="3">Wednesday<option value="4">Thursday<option value="5">Friday<option value="6">Saturday<option value="0">Sunday</select>every<input class="dhx_repeat_text" type="text" name="month_count2" value="1" />month<br /> </div> <div style="display:none;" id="dhx_repeat_year"> <label><input class="dhx_repeat_radio" type="radio" name="year_type" value="d"/>Every</label><input class="dhx_repeat_text" type="text" name="year_day" value="1" />day<select name="year_month"><option value="0" selected >January<option value="1">February<option value="2">March<option value="3">April<option value="4">May<option value="5">June<option value="6">July<option value="7">August<option value="8">September<option value="9">October<option value="10">November<option value="11">December</select>month<br /> <label><input class="dhx_repeat_radio" type="radio" name="year_type" checked value="w"/>On</label><input class="dhx_repeat_text" type="text" name="year_week2" value="1" /><select name="year_day2"><option value="1" selected >Monday<option value="2">Tuesday<option value="3">Wednesday<option value="4">Thursday<option value="5">Friday<option value="6">Saturday<option value="7">Sunday</select>of<select name="year_month2"><option value="0" selected >January<option value="1">February<option value="2">March<option value="3">April<option value="4">May<option value="5">June<option value="6">July<option value="7">August<option value="8">September<option value="9">October<option value="10">November<option value="11">December</select><br /> </div> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_right"> <label><input class="dhx_repeat_radio" type="radio" name="end" checked/>No end date</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="end" />After</label><input class="dhx_repeat_text" type="text" name="occurences_count" value="1" />occurrences<br /> <label><input class="dhx_repeat_radio" type="radio" name="end" />End by</label><input class="dhx_repeat_date" type="text" name="date_of_end" value="'+scheduler.config.repeat_date_of_end+ -'" /><br /> </div> </form> </div> <div style="clear:both"> </div>'; diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_serialize.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_serialize.js deleted file mode 100644 index fd3b34913bb..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_serialize.js +++ /dev/null @@ -1,8 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.data_attributes=function(){var f=[],d=scheduler.templates.xml_format,c;for(c in this._events){var e=this._events[c],a;for(a in e)a.substr(0,1)!="_"&&f.push([a,a=="start_date"||a=="end_date"?d:null]);break}return f}; -scheduler.toXML=function(f){var d=[],c=this.data_attributes(),e;for(e in this._events){var a=this._events[e];if(a.id.toString().indexOf("#")==-1){d.push("<event>");for(var b=0;b<c.length;b++)d.push("<"+c[b][0]+"><![CDATA["+(c[b][1]?c[b][1](a[c[b][0]]):a[c[b][0]])+"]]\></"+c[b][0]+">");d.push("</event>")}}return(f||"")+"<data>"+d.join("\n")+"</data>"}; -scheduler.toJSON=function(){var f=[],d=this.data_attributes(),c;for(c in this._events){var e=this._events[c];if(e.id.toString().indexOf("#")==-1){for(var e=this._events[c],a=[],b=0;b<d.length;b++)a.push(" "+d[b][0]+':"'+((d[b][1]?d[b][1](e[d[b][0]]):e[d[b][0]])||"").toString().replace(/\n/g,"")+'" ');f.push("{"+a.join(",")+"}")}}return"["+f.join(",\n")+"]"}; -scheduler.toICal=function(f){var d="BEGIN:VCALENDAR\nVERSION:2.0\nPRODID:-//dhtmlXScheduler//NONSGML v2.2//EN\nDESCRIPTION:",c="END:VCALENDAR",e=scheduler.date.date_to_str("%Y%m%dT%H%i%s"),a=[],b;for(b in this._events){var g=this._events[b];g.id.toString().indexOf("#")==-1&&(a.push("BEGIN:VEVENT"),a.push("DTSTART:"+e(g.start_date)),a.push("DTEND:"+e(g.end_date)),a.push("SUMMARY:"+g.text),a.push("END:VEVENT"))}return d+(f||"")+"\n"+a.join("\n")+"\n"+c}; diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_timeline.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_timeline.js deleted file mode 100644 index 00205d8394a..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_timeline.js +++ /dev/null @@ -1,34 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -(function(){function B(){for(var a=scheduler.get_visible_events(),b=[],c=0;c<this.y_unit.length;c++)b[c]=[];b[f]||(b[f]=[]);for(c=0;c<a.length;c++){for(var f=this.order[a[c][this.y_property]],d=0;this._trace_x[d+1]&&a[c].start_date>=this._trace_x[d+1];)d++;for(;this._trace_x[d]&&a[c].end_date>this._trace_x[d];)b[f][d]||(b[f][d]=[]),b[f][d].push(a[c]),d++}return b}function v(a,b,c){var f=0,d=b?a.end_date:a.start_date;if(d.valueOf()>scheduler._max_date.valueOf())d=scheduler._max_date;var i=d-scheduler._min_date_timeline; -if(i<0)k=0;else{var g=Math.round(i/(c*scheduler._cols[0]));if(g>scheduler._cols.length)g=scheduler._cols.length;for(var e=0;e<g;e++)f+=scheduler._cols[e];var j=scheduler.date.add(scheduler._min_date_timeline,scheduler.matrix[scheduler._mode].x_step*g,scheduler.matrix[scheduler._mode].x_unit),i=d-j,k=Math.floor(i/c)}f+=b?k-14:k+1;return f}function C(a){var b="<table style='table-layout:fixed;' cellspacing='0' cellpadding='0'>",c=[];scheduler._load_mode&&scheduler._load();if(this.render=="cell")c=B.call(this); -else for(var f=scheduler.get_visible_events(),d=0;d<f.length;d++){var i=this.order[f[d][this.y_property]];c[i]||(c[i]=[]);c[i].push(f[d])}for(var g=0,e=0;e<scheduler._cols.length;e++)g+=scheduler._cols[e];var j=new Date;this._step=j=(scheduler.date.add(j,this.x_step*this.x_size,this.x_unit)-j)/g;this._summ=g;var k=scheduler._colsS.heights=[];this._events_height={};for(e=0;e<this.y_unit.length;e++){var h=this._logic(this.render,this.y_unit[e],this);scheduler._merge(h,{height:this.dy});if(this.section_autoheight&& -this.y_unit.length*h.height<a.offsetHeight)h.height=Math.max(h.height,Math.floor((a.offsetHeight-1)/this.y_unit.length));scheduler._merge(h,{tr_className:"",style_height:"height:"+h.height+"px;",style_width:"width:"+(this.dx-1)+"px;",td_className:"dhx_matrix_scell"+(scheduler.templates[this.name+"_scaley_class"](this.y_unit[e].key,this.y_unit[e].label,this)?" "+scheduler.templates[this.name+"_scaley_class"](this.y_unit[e].key,this.y_unit[e].label,this):""),td_content:scheduler.templates[this.name+ -"_scale_label"](this.y_unit[e].key,this.y_unit[e].label,this.y_unit[e]),summ_width:"width:"+g+"px;",table_className:""});var o="";if(c[e]&&this.render!="cell"){c[e].sort(function(a,d){return a.start_date>d.start_date?1:-1});for(var l=[],d=0;d<c[e].length;d++){for(var m=c[e][d],n=0;l[n]&&l[n].end_date>m.start_date;)n++;l[n]=m;o+=scheduler.render_timeline_event.call(this,m,n)}}if(this.fit_events){var w=this._events_height[this.y_unit[e].key]||0;h.height=w>h.height?w:h.height;h.style_height="height:"+ -h.height+"px;"}b+="<tr class='"+h.tr_className+"' style='"+h.style_height+"'><td class='"+h.td_className+"' style='"+h.style_width+" height:"+(h.height-1)+"px;'>"+h.td_content+"</td>";if(this.render=="cell")for(d=0;d<scheduler._cols.length;d++)b+="<td class='dhx_matrix_cell "+scheduler.templates[this.name+"_cell_class"](c[e][d],this._trace_x[d],this.y_unit[e])+"' style='width:"+(scheduler._cols[d]-1)+"px'><div style='width:"+(scheduler._cols[d]-1)+"px'>"+scheduler.templates[this.name+"_cell_value"](c[e][d])+ -"</div></td>";else{b+="<td><div style='"+h.summ_width+" "+h.style_height+" position:relative;' class='dhx_matrix_line'>";b+=o;b+="<table class='"+h.table_className+"' cellpadding='0' cellspacing='0' style='"+h.summ_width+" "+h.style_height+"' >";for(d=0;d<scheduler._cols.length;d++)b+="<td class='dhx_matrix_cell "+scheduler.templates[this.name+"_cell_class"](c[e],this._trace_x[d],this.y_unit[e])+"' style='width:"+(scheduler._cols[d]-1)+"px'><div style='width:"+(scheduler._cols[d]-1)+"px'></div></td>"; -b+="</table>";b+="</div></td>"}b+="</tr>"}b+="</table>";this._matrix=c;a.innerHTML=b;scheduler._rendered=[];for(var q=document.getElementsByTagName("DIV"),e=0;e<q.length;e++)q[e].getAttribute("event_id")&&scheduler._rendered.push(q[e]);for(e=0;e<a.firstChild.rows.length;e++)k.push(a.firstChild.rows[e].offsetHeight)}function D(a){var b=scheduler.xy.scale_height,c=this._header_resized||scheduler.xy.scale_height;scheduler._cols=[];scheduler._colsS={height:0};this._trace_x=[];var f=scheduler._x-this.dx- -18,d=[this.dx],i=scheduler._els.dhx_cal_header[0];i.style.width=d[0]+f+"px";for(var g=scheduler._min_date_timeline=scheduler._min_date,e=0;e<this.x_size;e++)this._trace_x[e]=new Date(g),g=scheduler.date.add(g,this.x_step,this.x_unit),scheduler._cols[e]=Math.floor(f/(this.x_size-e)),f-=scheduler._cols[e],d[e+1]=d[e]+scheduler._cols[e];a.innerHTML="<div></div>";if(this.second_scale){for(var j=this.second_scale.x_unit,k=[this._trace_x[0]],h=[],o=[this.dx,this.dx],l=0,m=0;m<this._trace_x.length;m++){var n= -this._trace_x[m],w=E(j,n,k[l]);w&&(++l,k[l]=n,o[l+1]=o[l]);var q=l+1;h[l]=scheduler._cols[m]+(h[l]||0);o[q]+=scheduler._cols[m]}a.innerHTML="<div></div><div></div>";var p=a.firstChild;p.style.height=c+"px";var v=a.lastChild;v.style.position="relative";for(var r=0;r<k.length;r++){var t=k[r],u=scheduler.templates[this.name+"_second_scalex_class"](t),x=document.createElement("DIV");x.className="dhx_scale_bar dhx_second_scale_bar"+(u?" "+u:"");scheduler.set_xy(x,h[r]-1,c-3,o[r],0);x.innerHTML=scheduler.templates[this.name+ -"_second_scale_date"](t);p.appendChild(x)}}scheduler.xy.scale_height=c;for(var a=a.lastChild,s=0;s<this._trace_x.length;s++){g=this._trace_x[s];scheduler._render_x_header(s,d[s],g,a);var y=scheduler.templates[this.name+"_scalex_class"](g);y&&(a.lastChild.className+=" "+y)}scheduler.xy.scale_height=b;var z=this._trace_x;a.onclick=function(a){var d=A(a);d&&scheduler.callEvent("onXScaleClick",[d.x,z[d.x],a||event])};a.ondblclick=function(a){var d=A(a);d&&scheduler.callEvent("onXScaleDblClick",[d.x,z[d.x], -a||event])}}function E(a,b,c){switch(a){case "day":return!(b.getDate()==c.getDate()&&b.getMonth()==c.getMonth()&&b.getFullYear()==c.getFullYear());case "week":return!(scheduler.date.getISOWeek(b)==scheduler.date.getISOWeek(c)&&b.getFullYear()==c.getFullYear());case "month":return!(b.getMonth()==c.getMonth()&&b.getFullYear()==c.getFullYear());case "year":return b.getFullYear()!=c.getFullYear();default:return!1}}function p(a){if(a){scheduler.set_sizes();t();var b=scheduler._min_date;D.call(this,scheduler._els.dhx_cal_header[0]); -C.call(this,scheduler._els.dhx_cal_data[0]);scheduler._min_date=b;scheduler._els.dhx_cal_date[0].innerHTML=scheduler.templates[this.name+"_date"](scheduler._min_date,scheduler._max_date);scheduler._table_view=!0}}function u(){if(scheduler._tooltip)scheduler._tooltip.style.display="none",scheduler._tooltip.date=""}function F(a,b,c){if(a.render=="cell"){var f=b.x+"_"+b.y,d=a._matrix[b.y][b.x];if(!d)return u();d.sort(function(a,d){return a.start_date>d.start_date?1:-1});if(scheduler._tooltip){if(scheduler._tooltip.date== -f)return;scheduler._tooltip.innerHTML=""}else{var i=scheduler._tooltip=document.createElement("DIV");i.className="dhx_tooltip";document.body.appendChild(i);i.onclick=scheduler._click.dhx_cal_data}for(var g="",e=0;e<d.length;e++){var j=d[e].color?"background-color:"+d[e].color+";":"",k=d[e].textColor?"color:"+d[e].textColor+";":"";g+="<div class='dhx_tooltip_line' event_id='"+d[e].id+"' style='"+j+""+k+"'>";g+="<div class='dhx_tooltip_date'>"+(d[e]._timed?scheduler.templates.event_date(d[e].start_date): -"")+"</div>";g+="<div class='dhx_event_icon icon_details'> </div>";g+=scheduler.templates[a.name+"_tooltip"](d[e].start_date,d[e].end_date,d[e])+"</div>"}scheduler._tooltip.style.display="";scheduler._tooltip.style.top="0px";scheduler._tooltip.style.left=document.body.offsetWidth-c.left-scheduler._tooltip.offsetWidth<0?c.left-scheduler._tooltip.offsetWidth+"px":c.left+b.src.offsetWidth+"px";scheduler._tooltip.date=f;scheduler._tooltip.innerHTML=g;scheduler._tooltip.style.top=document.body.offsetHeight- -c.top-scheduler._tooltip.offsetHeight<0?c.top-scheduler._tooltip.offsetHeight+b.src.offsetHeight+"px":c.top+"px"}}function t(){dhtmlxEvent(scheduler._els.dhx_cal_data[0],"mouseover",function(a){var b=scheduler.matrix[scheduler._mode];if(b){var c=scheduler._locate_cell_timeline(a),a=a||event,f=a.target||a.srcElement;if(c)return F(b,c,getOffset(c.src))}u()});t=function(){}}function G(a){for(var b=a.parentNode.childNodes,c=0;c<b.length;c++)if(b[c]==a)return c;return-1}function A(a){for(var a=a||event, -b=a.target?a.target:a.srcElement;b&&b.tagName!="DIV";)b=b.parentNode;if(b&&b.tagName=="DIV"){var c=b.className.split(" ")[0];if(c=="dhx_scale_bar")return{x:G(b),y:-1,src:b,scale:!0}}}scheduler.matrix={};scheduler._merge=function(a,b){for(var c in b)typeof a[c]=="undefined"&&(a[c]=b[c])};scheduler.createTimelineView=function(a){scheduler._merge(a,{section_autoheight:!0,name:"matrix",x:"time",y:"time",x_step:1,x_unit:"hour",y_unit:"day",y_step:1,x_start:0,x_size:24,y_start:0,y_size:7,render:"cell", -dx:200,dy:50,fit_events:!0,second_scale:!1,_logic:function(a,b,c){var e={};scheduler.checkEvent("onBeforeViewRender")&&(e=scheduler.callEvent("onBeforeViewRender",[a,b,c]));return e}});scheduler.checkEvent("onTimelineCreated")&&scheduler.callEvent("onTimelineCreated",[a]);var b=scheduler.render_data;scheduler.render_data=function(d,c){if(this._mode==a.name)if(c)for(var f=0;f<d.length;f++)this.clear_event(d[f]),this.render_timeline_event.call(this.matrix[this._mode],d[f],0,!0);else p.call(a,!0);else return b.apply(this, -arguments)};scheduler.matrix[a.name]=a;scheduler.templates[a.name+"_cell_value"]=function(a){return a?a.length:""};scheduler.templates[a.name+"_cell_class"]=function(){return""};scheduler.templates[a.name+"_scalex_class"]=function(){return""};scheduler.templates[a.name+"_second_scalex_class"]=function(){return""};scheduler.templates[a.name+"_scaley_class"]=function(){return""};scheduler.templates[a.name+"_scale_label"]=function(a,b){return b};scheduler.templates[a.name+"_tooltip"]=function(a,b,c){return c.text}; -scheduler.templates[a.name+"_date"]=function(a,b){return a.getDay()==b.getDay()&&b-a<864E5?scheduler.templates.day_date(a):scheduler.templates.week_date(a,b)};scheduler.templates[a.name+"_scale_date"]=scheduler.date.date_to_str(a.x_date||scheduler.config.hour_date);scheduler.templates[a.name+"_second_scale_date"]=scheduler.date.date_to_str(a.second_scale&&a.second_scale.x_date?a.second_scale.x_date:scheduler.config.hour_date);scheduler.date["add_"+a.name]=function(b,c){return scheduler.date.add(b, -(a.x_length||a.x_size)*c*a.x_step,a.x_unit)};scheduler.date[a.name+"_start"]=scheduler.date[a.x_unit+"_start"]||scheduler.date.day_start;scheduler.attachEvent("onSchedulerResize",function(){return this._mode==a.name?(p.call(a,!0),!1):!0});scheduler.attachEvent("onOptionsLoad",function(){a.order={};scheduler.callEvent("onOptionsLoadStart",[]);for(var b=0;b<a.y_unit.length;b++)a.order[a.y_unit[b].key]=b;scheduler.callEvent("onOptionsLoadFinal",[]);scheduler._date&&a.name==scheduler._mode&&scheduler.setCurrentView(scheduler._date, -scheduler._mode)});scheduler.callEvent("onOptionsLoad",[a]);scheduler[a.name+"_view"]=function(){scheduler.renderMatrix.apply(a,arguments)};if(a.render!="cell"){var c=new Date,f=scheduler.date.add(c,a.x_step,a.x_unit).valueOf()-c.valueOf();scheduler["mouse_"+a.name]=function(b){var c=this._drag_event;if(this._drag_id)c=this.getEvent(this._drag_id),this._drag_event._dhx_changed=!0;b.x-=a.dx;for(var g=0,e=0,j=0;e<this._cols.length-1;e++)if(g+=this._cols[e],g>b.x)break;for(g=0;j<this._colsS.heights.length;j++)if(g+= -this._colsS.heights[j],g>b.y)break;b.fields={};a.y_unit[j]||(j=a.y_unit.length-1);b.fields[a.y_property]=c[a.y_property]=a.y_unit[j].key;b.x=0;this._drag_mode=="new-size"&&c.start_date*1==this._drag_start*1&&e++;var k=e>=a._trace_x.length?scheduler.date.add(a._trace_x[a._trace_x.length-1],a.x_step,a.x_unit):a._trace_x[e];b.y=Math.round((k-this._min_date)/(6E4*this.config.time_step));b.custom=!0;b.shift=f;return b}}};scheduler.render_timeline_event=function(a,b,c){var f=v(a,!1,this._step),d=v(a,!0, -this._step),i=scheduler.xy.bar_height,g=2+b*i,e=i+g-2,j=a[this.y_property];if(!this._events_height[j]||this._events_height[j]<e)this._events_height[j]=e;var k=scheduler.templates.event_class(a.start_date,a.end_date,a),k="dhx_cal_event_line "+(k||""),h=a.color?"background-color:"+a.color+";":"",o=a.textColor?"color:"+a.textColor+";":"",l='<div event_id="'+a.id+'" class="'+k+'" style="'+h+""+o+"position:absolute; top:"+g+"px; left:"+f+"px; width:"+Math.max(0,d-f)+"px;"+(a._text_style||"")+'">'+scheduler.templates.event_bar_text(a.start_date, -a.end_date,a)+"</div>";if(c){var m=document.createElement("DIV");m.innerHTML=l;var n=this.order[j],p=scheduler._els.dhx_cal_data[0].firstChild.rows[n].cells[1].firstChild;scheduler._rendered.push(m.firstChild);p.appendChild(m.firstChild)}else return l};scheduler.renderMatrix=function(a){scheduler._els.dhx_cal_data[0].scrollTop=0;var b=scheduler.date[this.name+"_start"](scheduler._date);scheduler._min_date=scheduler.date.add(b,this.x_start*this.x_step,this.x_unit);scheduler._max_date=scheduler.date.add(scheduler._min_date, -this.x_size*this.x_step,this.x_unit);scheduler._table_view=!0;if(this.second_scale){if(a&&!this._header_resized)this._header_resized=scheduler.xy.scale_height,scheduler.xy.scale_height*=2,scheduler._els.dhx_cal_header[0].className+=" dhx_second_cal_header";if(!a&&this._header_resized){scheduler.xy.scale_height/=2;this._header_resized=!1;var c=scheduler._els.dhx_cal_header[0];c.className=c.className.replace(/ dhx_second_cal_header/gi,"")}}p.call(this,a)};scheduler._locate_cell_timeline=function(a){for(var a= -a||event,b=a.target?a.target:a.srcElement;b&&b.tagName!="TD";)b=b.parentNode;if(b&&b.tagName=="TD"){var c=b.className.split(" ")[0];if(c=="dhx_matrix_cell")if(scheduler._isRender("cell"))return{x:b.cellIndex-1,y:b.parentNode.rowIndex,src:b};else{for(var f=b.parentNode;f&&f.tagName!="TD";)f=f.parentNode;return{x:b.cellIndex,y:f.parentNode.rowIndex,src:b}}else if(c=="dhx_matrix_scell")return{x:-1,y:b.parentNode.rowIndex,src:b,scale:!0}}return!1};var H=scheduler._click.dhx_cal_data;scheduler._click.dhx_cal_data= -function(a){var b=H.apply(this,arguments),c=scheduler.matrix[scheduler._mode];if(c){var f=scheduler._locate_cell_timeline(a);f&&(f.scale?scheduler.callEvent("onYScaleClick",[f.y,c.y_unit[f.y],a||event]):scheduler.callEvent("onCellClick",[f.x,f.y,c._trace_x[f.x],(c._matrix[f.y]||{})[f.x]||[],a||event]))}return b};scheduler.dblclick_dhx_matrix_cell=function(a){var b=scheduler.matrix[scheduler._mode];if(b){var c=scheduler._locate_cell_timeline(a);c&&(c.scale?scheduler.callEvent("onYScaleDblClick",[c.y, -b.y_unit[c.y],a||event]):scheduler.callEvent("onCellDblClick",[c.x,c.y,b._trace_x[c.x],(b._matrix[c.y]||{})[c.x]||[],a||event]))}};scheduler.dblclick_dhx_matrix_scell=function(a){return scheduler.dblclick_dhx_matrix_cell(a)};scheduler._isRender=function(a){return scheduler.matrix[scheduler._mode]&&scheduler.matrix[scheduler._mode].render==a};scheduler.attachEvent("onCellDblClick",function(a,b,c,f,d){if(!(this.config.readonly||d.type=="dblclick"&&!this.config.dblclick_create)){var i=scheduler.matrix[scheduler._mode], -g={};g.start_date=i._trace_x[a];g.end_date=i._trace_x[a+1]?i._trace_x[a+1]:scheduler.date.add(i._trace_x[a],i.x_step,i.x_unit);g[scheduler.matrix[scheduler._mode].y_property]=i.y_unit[b].key;scheduler.addEventNow(g,null,d)}});scheduler.attachEvent("onBeforeDrag",function(){return scheduler._isRender("cell")?!1:!0})})(); diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_tooltip.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_tooltip.js deleted file mode 100644 index 2458d37e841..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_tooltip.js +++ /dev/null @@ -1,11 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -window.dhtmlXTooltip={};dhtmlXTooltip.config={className:"dhtmlXTooltip tooltip",timeout_to_display:50,delta_x:15,delta_y:-20};dhtmlXTooltip.tooltip=document.createElement("div");dhtmlXTooltip.tooltip.className=dhtmlXTooltip.config.className; -dhtmlXTooltip.show=function(b,d){var c=dhtmlXTooltip,f=this.tooltip,a=f.style;c.tooltip.className=c.config.className;var e=this.position(b),k=b.target||b.srcElement;if(!this.isTooltip(k)){var g=0,l=0,h=scheduler._obj;if(h.offsetParent){do g+=h.offsetLeft,l+=h.offsetTop;while(h=h.offsetParent)}var i=e.x+(c.config.delta_x||0)-g,j=e.y-(c.config.delta_y||0)-l;a.visibility="hidden";a.removeAttribute?(a.removeAttribute("right"),a.removeAttribute("bottom")):(a.removeProperty("right"),a.removeProperty("bottom")); -a.left="0";a.top="0";this.tooltip.innerHTML=d;scheduler._obj.appendChild(this.tooltip);var m=this.tooltip.offsetWidth,n=this.tooltip.offsetHeight;scheduler._obj.offsetWidth-i-(scheduler.xy.margin_left||0)-m<0?(a.removeAttribute?a.removeAttribute("left"):a.removeProperty("left"),a.right=scheduler._obj.offsetWidth-i+2*(c.config.delta_x||0)+"px"):a.left=i<0?e.x+Math.abs(c.config.delta_x||0)+"px":i+"px";scheduler._obj.offsetHeight-j-(scheduler.xy.margin_top||0)-n<0?(a.removeAttribute?a.removeAttribute("top"): -a.removeProperty("top"),a.bottom=scheduler._obj.offsetHeight-j-2*(c.config.delta_y||0)+"px"):a.top=j<0?e.y+Math.abs(c.config.delta_y||0)+"px":j+"px";a.visibility="visible"}};dhtmlXTooltip.hide=function(){this.tooltip.parentNode&&this.tooltip.parentNode.removeChild(this.tooltip)};dhtmlXTooltip.delay=function(b,d,c,f){this.tooltip._timeout_id&&window.clearTimeout(this.tooltip._timeout_id);this.tooltip._timeout_id=setTimeout(function(){var a=b.apply(d,c);b=d=c=null;return a},f||this.config.timeout_to_display)}; -dhtmlXTooltip.isTooltip=function(b){for(var d=!1;b&&!d;)d=b.className==this.tooltip.className,b=b.parentNode;return d};dhtmlXTooltip.position=function(b){b=b||window.event;if(b.pageX||b.pageY)return{x:b.pageX,y:b.pageY};var d=dhtmlx._isIE&&document.compatMode!="BackCompat"?document.documentElement:document.body;return{x:b.clientX+d.scrollLeft-d.clientLeft,y:b.clientY+d.scrollTop-d.clientTop}}; -scheduler.attachEvent("onMouseMove",function(b,d){var c=window.event||d,f=c.target||c.srcElement,a=dhtmlXTooltip;if(b||a.isTooltip(f)){var e=scheduler.getEvent(b)||scheduler.getEvent(a.tooltip.event_id);if(e){a.tooltip.event_id=e.id;var k=scheduler.templates.tooltip_text(e.start_date,e.end_date,e),g=void 0;_isIE&&(g=document.createEventObject(c));a.delay(a.show,a,[g||c,k])}}else a.delay(a.hide,a,[])});scheduler.attachEvent("onBeforeDrag",function(){dhtmlXTooltip.hide();return!0}); -scheduler.templates.tooltip_date_format=scheduler.date.date_to_str("%Y-%m-%d %H:%i");scheduler.templates.tooltip_text=function(b,d,c){return"<b>Event:</b> "+c.text+"<br/><b>Start date:</b> "+scheduler.templates.tooltip_date_format(b)+"<br/><b>End date:</b> "+scheduler.templates.tooltip_date_format(d)}; diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_touch.css b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_touch.css deleted file mode 100644 index 212423da5d1..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_touch.css +++ /dev/null @@ -1,5 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -.dhx_cal_prev_button,.dhx_cal_next_button,.dhx_cal_today_button,.dhx_cal_add_button{top:6px!important;left:10px;border:1px solid #575D65;border-top:1px solid #4E5052;color:#FFF;text-shadow:0 -1px 0 #65696E;background-image:-webkit-gradient(linear,left top,left bottom,from(#B2B6BC),to(#6B737E));background-color:#989B9F;background-position:0 1px;background-repeat:repeat-x;-webkit-border-radius:5px;padding:3px;text-align:center;text-decoration:none;}.dhx_cal_today_button{left:55px;}.dhx_cal_next_button{left:146px;}.dhx_cal_add_button{right:9px;left:auto;width:20px;font-size:20px;padding:1px 2px 2px 2px;}.dhx_cal_navline .dhx_cal_date{top:7px;left:160px;right:350px;padding-top:4px;width:auto;text-align:center;color:#4F5459;}.dhx_cal_navline{background:-webkit-gradient(linear,0% 0,0% 100%,color-stop(0,#F4F5F8),color-stop(0.3,#F1F2F4),color-stop(0.7,#C4C7D0),color-stop(1,#A6AAB7));border-bottom:1px solid #797F90;height:40px!important;font-family:Helvetica;font-weight:bold;font-size:13px;}.dhx_cal_tab{top:6px!important;color:#4F5459;text-align:center;padding:5px 10px;width:80px;background-image:-webkit-gradient(linear,0% 0,0% 100%,from(#F7F7F7),to(#B9BDC7));background-color:#CFD0D1;background-position:0 1px;background-repeat:repeat-x;text-decoration:none;border:1px solid #95989F;border-top:1px solid #686A6A;height:16px;}.dhx_cal_tab.active{background-image:-webkit-gradient(linear,0% 0,0% 100%,from(#B0B2B6),to(#666D74));background-color:#949799;background-position:0 1px;background-repeat:repeat-x;border:1px solid #4C4D4F;border-top:1px solid #52585C;color:#F8F8F8;text-shadow:0 -1px 0 #5E6063;text-decoration:none;height:16px;padding:5px 10px;z-index:100;}.dhx_cal_light{-webkit-transition:-webkit-transform;-webkit-transform-style:preserve-3d;}.dhx_cal_cover{opacity:.5;}.dhx_cal_ltext{padding-top:0;padding-bottom:0;}.dhx_cal_ltext textarea{-webkit-background-size:0;-webkit-border-radius:0;height:94%;}.dhx_mini_calendar .dhx_month_head{height:35px;line-height:35px;text-align:center;padding-right:0;padding-left:0;}.dhx_mini_calendar .dhx_year_month{height:35px;line-height:30px;background:-webkit-gradient(linear,0% 0,0% 100%,from(#F4F5F8),to(#8A8E9A));font-family:Helvetica;font-weight:bold;font-size:13px;}.dhx_mini_calendar .dhx_year_month .dhx_cal_prev_button,.dhx_mini_calendar .dhx_year_month .dhx_cal_next_button{line-height:normal;}
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_touch.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_touch.js deleted file mode 100644 index 70b4abeda7c..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_touch.js +++ /dev/null @@ -1,26 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -TouchScroll=function(a,b,c,e){this.debug=!!b;this.compat=!!e;this.rough=!!c;this.axisX=this.axisY=!0;typeof a!="object"&&(a=document.getElementById(a));this._init();a.addEventListener("touchstart",this,!1);a.addEventListener("webkitTransitionEnd",this,!1);this.debug&&a.addEventListener("mousedown",this,!1);this.node=a;for(var d=0;d<a.childNodes.length;d++)if(a.childNodes[d].nodeType==1){this.area=a.childNodes[d];break}if(window.getComputedStyle(this.node).position=="static")this.node.style.position= -"relative";this.area.style.cssText+="-webkit-transition: -webkit-transform; -webkit-user-select:none; -webkit-transform-style:preserve-3d;";this.scrolls={}}; -TouchScroll.prototype={refresh:function(){this.node.style.webkitTransformStyle="flat";this.node.style.webkitTransformStyle="preserve-3d"},scrollTo:function(a,b,c){this.set_matrix({e:a,f:b},c||0)},onscroll:function(){},handleEvent:function(a){return this["ev_"+a.type](a)},get_matrix:function(a){return new WebKitCSSMatrix(window.getComputedStyle(a||this.area).webkitTransform)},set_matrix:function(a,b,c){(c||this.area).style.webkitTransform="translate("+Math.round(a.e)+"px,"+Math.round(a.f)+"px)";(c|| -this.area).style.webkitTransitionDuration=b},ev_touchstart:function(a){this.ev_mousedown(a.touches[0]);a.preventDefault();return!1},ev_mousedown:function(a){var b=a;this.x=b.pageX;this.y=b.pageY;this.dx=this.node.offsetWidth;this.dy=this.node.offsetHeight;this.mx=this.area.scrollWidth;this.my=this.area.scrollHeight;this.target=b.target;if(!this.rough){var c=this.get_matrix();this.target_x=c.e;this.target_y=c.f;if(!this.scroll&&this.compat)c.e=this.node.scrollLeft*-1,c.f=this.node.scrollTop*-1,this.node.scrollTop= -this.node.scrollLeft=0;this.set_matrix(c,0);this._correct_scroll(this.target_x,this.target_y)}this.scroll_x=this.scroll_y=this.scroll=!1;this._init_events()},ev_touchend:function(){return this.ev_mouseup()},ev_mouseup:function(){this._deinit_events();if(!this.scroll){this._remove_scroll();var a=document.createEvent("MouseEvent");a.initMouseEvent("click",!0,!0);this.target.dispatchEvent(a)}this.target=null},ev_webkitTransitionEnd:function(){if(!this.target&&this.scroll){this._remove_scroll();var a= -this.get_matrix();this.node.firstChild._scrollTop=-1*a.f;if(this.compat&&(a.e||a.f)){var b=a.f,c=a.e;a.e=a.f=0;this.set_matrix(a,0);this.node.scrollTop=-1*b;this.node.scrollLeft=-1*c}this.scroll=!1}},ev_touchmove:function(a){return this.ev_mousemove(a.touches[0])},ev_mousemove:function(a){if(this.target){var b=a,c=(b.pageX-this.x)*(this.axisX?5:0),e=(b.pageY-this.y)*(this.axisY?5:0);if(!(Math.abs(c)<10&&Math.abs(e)<10)){if(Math.abs(c)>50)this.scroll_x=!0;if(Math.abs(e)>50)this.scroll_y=!0;if(this.scroll_x|| -this.scroll_y){this.x=b.pageX;this.y=b.pageY;this.scroll=!0;var d=this.get_matrix();c+=this.target_x-d.e;e+=this.target_y-d.f;var f="2000ms",g="500ms";this.target_x=c+d.e;this.target_y=e+d.f;if(this.target_x>0)this.target_x=0,f=g;if(this.target_y>0)this.target_y=0,f=g;if(this.mx-this.dx+this.target_x<0)this.target_x=-this.mx+this.dx,f=g;if(this.my-this.dy+this.target_y<0)this.target_y=-this.my+this.dy,f=g;this.set_matrix({e:this.target_x,f:this.target_y},f);this._add_scroll(d.e,d.f);this._correct_scroll(this.target_x, -this.target_y,f);this.onscroll(this.target_x,this.target_y)}return!1}}},_correct_scroll:function(a,b,c){if(this.scrolls.x){var e=this.get_matrix(this.scrolls.x),d=this.dx*a/this.mx;this.set_matrix({e:-1*d,f:0},c,this.scrolls.x)}if(this.scrolls.y){var e=this.get_matrix(this.scrolls.y),f=this.dy*b/this.my;this.set_matrix({e:0,f:-1*f},c,this.scrolls.y)}},_remove_scroll:function(){this.scrolls.x&&this.scrolls.x.parentNode.removeChild(this.scrolls.x);this.scrolls.y&&this.scrolls.y.parentNode.removeChild(this.scrolls.y); -this.scrolls={}},_add_scroll:function(){if(!this.scrolls.ready){var a;if(this.my>5&&this.axisY){var b=this.dy*this.dy/this.my-1;this.scrolls.y=a=document.createElement("DIV");a.className="dhx_scroll_y";a.style.height=b+"px";this.node.appendChild(a)}if(this.mx>5&&this.axisX)b=this.dx*this.dx/this.mx,this.scrolls.x=a=document.createElement("DIV"),a.className="dhx_scroll_x",a.style.width=b+"px",this.node.appendChild(a);var c=this.get_matrix();this._correct_scroll(c.e,c.f,0);this.scrolls.ready=!0}},_init_events:function(){document.addEventListener("touchmove", -this,!1);document.addEventListener("touchend",this,!1);this.debug&&(document.addEventListener("mousemove",this,!1),document.addEventListener("mouseup",this,!1))},_deinit_events:function(){document.removeEventListener("touchmove",this,!1);document.removeEventListener("touchend",this,!1);this.debug&&(document.removeEventListener("mousemove",this,!1),document.removeEventListener("mouseup",this,!1))},_init:function(){document.styleSheets[0].insertRule(".dhx_scroll_x { width:50px;height:4px;background:rgba(0, 0, 0, 0.4);position:absolute; left:0px; bottom:3px; border:1px solid transparent; -webkit-border-radius:4px;-webkit-transition: -webkit-transform;}", -0);document.styleSheets[0].insertRule(".dhx_scroll_y { width:4px;height:50px;background:rgba(0, 0, 0, 0.4);position:absolute; top:0px; right:3px; border:1px solid transparent; -webkit-border-radius:4px;-webkit-transition: -webkit-transform;}",0);this._init=function(){}}}; -scheduler._ipad_before_init=function(){scheduler._ipad_before_init=function(){};scheduler.xy.scroll_width=0;for(var a=scheduler._els.dhx_cal_tab,b=42,c=a.length-1;c>=0;c--)a[c].style.cssText+="top:4px;",a[c].style.left="auto",a[c].style.right=b+"px",c==0&&(a[c].style.cssText+=";-webkit-border-top-left-radius: 5px; -webkit-border-bottom-left-radius: 5px;"),c==a.length-1&&(a[c].style.cssText+=";-webkit-border-top-right-radius: 5px; -webkit-border-bottom-right-radius: 5px;"),b+=100;scheduler._els.dhx_cal_prev_button[0].innerHTML= -"<";scheduler._els.dhx_cal_next_button[0].innerHTML=">";var e=document.createElement("div");e.className="dhx_cal_add_button";e.innerHTML="+ ";e.onclick=function(){var a=new Date;a>scheduler._min_date&&a<scheduler._max_date?scheduler.addEventNow():scheduler.addEventNow(scheduler._min_date.valueOf())};scheduler._els.dhx_cal_navline[0].appendChild(e);this._obj.onmousedown=this._obj.onmouseup=this._obj.onmousemove=function(){};var d=null,f=[];this._obj.ontouchmove=function(a){if(d){var b=Math.abs(a.touches[0].pageX- -f[0]),c=Math.abs(a.touches[0].pageY-f[1]);if(b>50||c>50)d=window.clearTimeout(d)}scheduler.config.touch_actions&&scheduler._on_mouse_move(a.touches[0])};this._obj.ontouchstart=function(a){scheduler._lightbox_id||(d=window.setTimeout(function(){scheduler._on_dbl_click(a.touches[0],a.target.className?a.target:a.target.parentNode)},400),f=[a.touches[0].pageX,a.touches[0].pageY],scheduler.config.touch_actions&&scheduler._on_mouse_down(a.touches[0]))};this._obj.ontouchend=function(a){d&&(d=window.clearTimeout(d)); -scheduler.config.touch_actions&&scheduler._on_mouse_up(a.touches[0])}}; -scheduler._ipad_init=function(){var a=document.createElement("DIV"),b=scheduler._els.dhx_cal_data[0];a.appendChild(b);a.style.cssText="overflow:hidden; width:100%; overflow:hidden;position:relative;";this._obj.appendChild(a);b.style.overflowY="hidden";var c=new TouchScroll(a);c.axisX=!1;scheduler._ipad_init=function(){b.parentNode.style.height=b.style.height;b.parentNode.style.top=b.style.top;b.style.height=b.scrollHeight+"px";b.style.top="0px";Math.abs(b.parentNode.offsetHeight-b.offsetHeight)<5? -(c.axisY=!1,c.scrollTo(0,0,0)):c.axisY=!0;c.refresh()};scheduler.attachEvent("onSchedulerResize",function(){setTimeout(function(){scheduler._ipad_init()});return!0});scheduler._ipad_init()};scheduler.attachEvent("onViewChange",function(){scheduler._ipad_init()});scheduler.attachEvent("onBeforeViewChange",function(){scheduler._ipad_before_init();return!0}); -scheduler.showCover=function(a){this.show_cover();if(a){a.style.display="block";var b=getOffset(this._obj);a.style.top=a.offsetHeight*-1+"px";a.style.left=Math.round(b.left+(this._obj.offsetWidth-a.offsetWidth)/2)+"px"}var c=this._get_lightbox(),e=c.addEventListener("webkitTransitionEnd",function(){c.style.top="41px";c.style.webkitTransform="";c.style.webkitTransition="";c.removeEventListener(e)},!1);c.style.webkitTransform="translate(0px,"+(a.offsetHeight+41)+"px)";c.style.webkitTransitionDuration= -"500ms"};scheduler.hideCover=function(a){if(a){var b=a.addEventListener("webkitTransitionEnd",function(){a.style.top=(a.offsetHeight+41)*-1+"px";a.style.webkitTransform="";a.style.webkitTransition="";a.removeEventListener(b)},!1);a.style.webkitTransform="translate(0px,"+(a.offsetHeight+41)*-1+"px)";a.style.webkitTransitionDuration="500ms"}this.hide_cover()};scheduler.config.lightbox.sections[0].height=100; -if(scheduler.form_blocks.calendar_time)scheduler.config.lightbox.sections[1].type="calendar_time",scheduler._mini_cal_arrows=["<",">"];scheduler.xy.menu_width=0;scheduler.attachEvent("onClick",function(){return!1});scheduler.locale.labels.new_event=""; -scheduler._mouse_coords=function(a){var b,c=document.body,e=document.documentElement;b=a.pageX||a.pageY?{x:a.pageX,y:a.pageY}:{x:a.clientX+(c.scrollLeft||e.scrollLeft||0)-c.clientLeft,y:a.clientY+(c.scrollTop||e.scrollTop||0)-c.clientTop};b.x-=getAbsoluteLeft(this._obj)+(this._table_view?0:this.xy.scale_width);var d=b.y-=getAbsoluteTop(this._obj)+this.xy.nav_height+this._dy_shift+this.xy.scale_height-(this._els.dhx_cal_data[0]._scrollTop||0);if(this._table_view){for(var f=0,f=1;f<this._colsS.heights.length;f++)if(this._colsS.heights[f]> -b.y)break;b.y=(Math.max(0,Math.ceil(b.x/this._cols[0])-1)+Math.max(0,f-1)*7)*1440/this.config.time_step;b.x=0}else b.x=Math.max(0,Math.ceil(b.x/this._cols[0])-1),b.y=Math.max(0,Math.ceil(b.y*60/(this.config.time_step*this.config.hour_size_px))-1)+this.config.first_hour*(60/this.config.time_step);return b}; diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_treetimeline.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_treetimeline.js deleted file mode 100644 index c131cb1eb13..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_treetimeline.js +++ /dev/null @@ -1,19 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.attachEvent("onTimelineCreated",function(a){if(a.render=="tree")a.y_unit_original=a.y_unit,a.y_unit=scheduler._getArrayToDisplay(a.y_unit_original),scheduler.attachEvent("onOptionsLoadStart",function(){a.y_unit=scheduler._getArrayToDisplay(a.y_unit_original)}),scheduler.form_blocks[a.name]={render:function(b){var c="<div class='dhx_section_timeline' style='overflow: hidden; height: "+b.height+"px'></div>";return c},set_value:function(b,c,g,e){var d=scheduler._getArrayForSelect(scheduler.matrix[e.type].y_unit_original, -e.type);b.innerHTML="";var a=document.createElement("select");b.appendChild(a);for(var i=b.getElementsByTagName("select")[0],j=0;j<d.length;j++){var h=document.createElement("option");h.value=d[j].key;if(h.value==g[scheduler.matrix[e.type].y_property])h.selected=!0;h.innerHTML=d[j].label;i.appendChild(h)}},get_value:function(b){return b.firstChild.value},focus:function(){}}}); -scheduler.attachEvent("onBeforeViewRender",function(a,b,c){var g={};if(a=="tree"){var e,d,f,i,j,h;b.children?(e=c.folder_dy||c.dy,c.folder_dy&&!c.section_autoheight&&(f="height:"+c.folder_dy+"px;"),d="dhx_row_folder",i="dhx_matrix_scell folder",j="<div class='dhx_scell_expand'>"+(b.open?"-":"+")+"</div>",h=c.folder_events_available?"dhx_data_table folder_events":"dhx_data_table folder"):(e=c.dy,d="dhx_row_item",i="dhx_matrix_scell item",j="",h="dhx_data_table");td_content="<div class='dhx_scell_level"+ -b.level+"'>"+j+"<div class='dhx_scell_name'>"+(scheduler.templates[c.name+"_scale_label"](b.key,b.label,b)||b.label)+"</div></div>";g={height:e,style_height:f,tr_className:d,td_className:i,td_content:td_content,table_className:h}}return g});var section_id_before; -scheduler.attachEvent("onBeforeEventChanged",function(a,b,c){if(scheduler._isRender("tree")){var g=scheduler.getSection(a[scheduler.matrix[scheduler._mode].y_property]);if(typeof g.children!="undefined"&&!scheduler.matrix[scheduler._mode].folder_events_available)return c||(a[scheduler.matrix[scheduler._mode].y_property]=section_id_before),!1}return!0}); -scheduler.attachEvent("onBeforeDrag",function(a,b,c){var g=scheduler._locate_cell_timeline(c);if(g){var e=scheduler.matrix[scheduler._mode].y_unit[g.y].key;if(typeof scheduler.matrix[scheduler._mode].y_unit[g.y].children!="undefined"&&!scheduler.matrix[scheduler._mode].folder_events_available)return!1}scheduler._isRender("tree")&&(ev=scheduler.getEvent(a),section_id_before=e||ev[scheduler.matrix[scheduler._mode].y_property]);return!0}); -scheduler._getArrayToDisplay=function(a){var b=[],c=function(a,e){for(var d=e||0,f=0;f<a.length;f++){a[f].level=d;if(typeof a[f].children!="undefined"&&typeof a[f].key=="undefined")a[f].key=scheduler.uid();b.push(a[f]);a[f].open&&a[f].children&&c(a[f].children,d+1)}};c(a);return b}; -scheduler._getArrayForSelect=function(a,b){var c=[],g=function(a){for(var d=0;d<a.length;d++)scheduler.matrix[b].folder_events_available?c.push(a[d]):typeof a[d].children=="undefined"&&c.push(a[d]),a[d].children&&g(a[d].children,b)};g(a);return c}; -scheduler._toggleFolderDisplay=function(a,b,c){var g,e=function(a,b,c,j){for(var h=0;h<b.length;h++){if((b[h].key==a||j)&&b[h].children)if(b[h].open=typeof c!="undefined"?c:!b[h].open,g=!0,!j&&g)break;b[h].children&&e(a,b[h].children,c,j)}};e(a,scheduler.matrix[scheduler._mode].y_unit_original,b,c);scheduler.matrix[scheduler._mode].y_unit=scheduler._getArrayToDisplay(scheduler.matrix[scheduler._mode].y_unit_original);scheduler.callEvent("onOptionsLoad",[])}; -scheduler.attachEvent("onCellClick",function(a,b){scheduler._isRender("tree")&&(scheduler.matrix[scheduler._mode].folder_events_available||typeof scheduler.matrix[scheduler._mode].y_unit[b].children!="undefined"&&scheduler._toggleFolderDisplay(scheduler.matrix[scheduler._mode].y_unit[b].key))});scheduler.attachEvent("onYScaleClick",function(a,b){scheduler._isRender("tree")&&typeof b.children!="undefined"&&scheduler._toggleFolderDisplay(b.key)}); -scheduler.getSection=function(a){if(scheduler._isRender("tree")){var b,c=function(a,e){for(var d=0;d<e.length;d++)e[d].key==a&&(b=e[d]),e[d].children&&c(a,e[d].children)};c(a,scheduler.matrix[scheduler._mode].y_unit_original);return b||null}}; -scheduler.deleteSection=function(a){if(scheduler._isRender("tree")){var b=!1,c=function(a,e){for(var d=0;d<e.length;d++){e[d].key==a&&(e.splice(d,1),b=!0);if(b)break;e[d].children&&c(a,e[d].children)}};c(a,scheduler.matrix[scheduler._mode].y_unit_original);scheduler.matrix[scheduler._mode].y_unit=scheduler._getArrayToDisplay(scheduler.matrix[scheduler._mode].y_unit_original);scheduler.callEvent("onOptionsLoad",[]);return b}}; -scheduler.deleteAllSections=function(){if(scheduler._isRender("tree"))scheduler.matrix[scheduler._mode].y_unit_original=[],scheduler.matrix[scheduler._mode].y_unit=scheduler._getArrayToDisplay(scheduler.matrix[scheduler._mode].y_unit_original),scheduler.callEvent("onOptionsLoad",[])}; -scheduler.addSection=function(a,b){if(scheduler._isRender("tree")){var c=!1,g=function(a,d,f){if(b)for(var i=0;i<f.length;i++){f[i].key==d&&typeof f[i].children!="undefined"&&(f[i].children.push(a),c=!0);if(c)break;f[i].children&&g(a,d,f[i].children)}else f.push(a),c=!0};g(a,b,scheduler.matrix[scheduler._mode].y_unit_original);scheduler.matrix[scheduler._mode].y_unit=scheduler._getArrayToDisplay(scheduler.matrix[scheduler._mode].y_unit_original);scheduler.callEvent("onOptionsLoad",[]);return c}}; -scheduler.openAllSections=function(){scheduler._isRender("tree")&&scheduler._toggleFolderDisplay(1,!0,!0)};scheduler.closeAllSections=function(){scheduler._isRender("tree")&&scheduler._toggleFolderDisplay(1,!1,!0)};scheduler.openSection=function(a){scheduler._isRender("tree")&&scheduler._toggleFolderDisplay(a,!0)};scheduler.closeSection=function(a){scheduler._isRender("tree")&&scheduler._toggleFolderDisplay(a,!1)}; diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_units.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_units.js deleted file mode 100644 index d6191895c97..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_units.js +++ /dev/null @@ -1,16 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler._props={}; -scheduler.createUnitsView=function(a,f,j,g,k,l){if(typeof a=="object")j=a.list,f=a.property,g=a.size||0,k=a.step||1,l=a.skip_incorrect,a=a.name;scheduler._props[a]={map_to:f,options:j,step:k,position:0};if(g>scheduler._props[a].options.length)scheduler._props[a]._original_size=g,g=0;scheduler._props[a].size=g;scheduler._props[a].skip_incorrect=l||!1;scheduler.date[a+"_start"]=scheduler.date.day_start;scheduler.templates[a+"_date"]=function(a){return scheduler.templates.day_date(a)};scheduler.templates[a+ -"_scale_date"]=function(c){var h=scheduler._props[a].options;if(!h.length)return"";var f=(scheduler._props[a].position||0)+Math.floor((scheduler._correct_shift(c.valueOf(),1)-scheduler._min_date.valueOf())/864E5);return h[f].css?"<span class='"+h[f].css+"'>"+h[f].label+"</span>":h[f].label};scheduler.date["add_"+a]=function(a,f){return scheduler.date.add(a,f,"day")};scheduler.date["get_"+a+"_end"]=function(c){return scheduler.date.add(c,scheduler._props[a].size||scheduler._props[a].options.length, -"day")};scheduler.attachEvent("onOptionsLoad",function(){for(var c=scheduler._props[a],f=c.order={},g=c.options,i=0;i<g.length;i++)f[g[i].key]=i;if(c._original_size&&c.size==0)c.size=c._original_size,delete c.original_size;c.size>g.length?(c._original_size=c.size,c.size=0):c.size=c._original_size||c.size;scheduler._date&&scheduler._mode==a&&scheduler.setCurrentView(scheduler._date,scheduler._mode)});scheduler.callEvent("onOptionsLoad",[])}; -scheduler.scrollUnit=function(a){var f=scheduler._props[this._mode];if(f)f.position=Math.min(Math.max(0,f.position+a),f.options.length-f.size),this.update_view()}; -(function(){var a=function(b){var d=scheduler._props[scheduler._mode];if(d&&d.order&&d.skip_incorrect){for(var a=[],e=0;e<b.length;e++)typeof d.order[b[e][d.map_to]]!="undefined"&&a.push(b[e]);b.splice(0,b.length);b.push.apply(b,a)}return b},f=scheduler._pre_render_events_table;scheduler._pre_render_events_table=function(b,d){b=a(b);return f.apply(this,[b,d])};var j=scheduler._pre_render_events_line;scheduler._pre_render_events_line=function(b,d){b=a(b);return j.apply(this,[b,d])};var g=function(b, -d){if(b&&typeof b.order[d[b.map_to]]=="undefined"){var a=scheduler,e=864E5,c=Math.floor((d.end_date-a._min_date)/e);d[b.map_to]=b.options[Math.min(c+b.position,b.options.length-1)].key;return!0}},k=scheduler._reset_scale,l=scheduler.is_visible_events;scheduler.is_visible_events=function(b){var d=l.apply(this,arguments);if(d){var a=scheduler._props[this._mode];if(a&&a.size){var e=a.order[b[a.map_to]];if(e<a.position||e>=a.size+a.position)return!1}}return d};scheduler._reset_scale=function(){var b= -scheduler._props[this._mode],a=k.apply(this,arguments);if(b){this._max_date=this.date.add(this._min_date,1,"day");for(var c=this._els.dhx_cal_data[0].childNodes,e=0;e<c.length;e++)c[e].className=c[e].className.replace("_now","");if(b.size&&b.size<b.options.length){var f=this._els.dhx_cal_header[0],g=document.createElement("DIV");if(b.position)g.className="dhx_cal_prev_button",g.style.cssText="left:1px;top:2px;position:absolute;",g.innerHTML=" ",f.firstChild.appendChild(g),g.onclick=function(){scheduler.scrollUnit(b.step* --1)};if(b.position+b.size<b.options.length)g=document.createElement("DIV"),g.className="dhx_cal_next_button",g.style.cssText="left:auto; right:0px;top:2px;position:absolute;",g.innerHTML=" ",f.lastChild.appendChild(g),g.onclick=function(){scheduler.scrollUnit(b.step)}}}return a};var c=scheduler._get_event_sday;scheduler._get_event_sday=function(b){var a=scheduler._props[this._mode];return a?(g(a,b),a.order[b[a.map_to]]-a.position):c.call(this,b)};var h=scheduler.locate_holder_day;scheduler.locate_holder_day= -function(a,d,c){var e=scheduler._props[this._mode];return e?(g(e,c),e.order[c[e.map_to]]*1+(d?1:0)-e.position):h.apply(this,arguments)};var m=scheduler._mouse_coords;scheduler._mouse_coords=function(){var a=scheduler._props[this._mode],d=m.apply(this,arguments);if(a){if(!this._drag_event)this._drag_event={};var c=this._drag_event;if(this._drag_id&&this._drag_mode)c=this.getEvent(this._drag_id),this._drag_event._dhx_changed=!0;var e=Math.min(d.x+a.position,a.options.length-1);c[a.map_to]=a.options[e].key; -d.x=0;d.custom=!0}return d};var i=scheduler._time_order;scheduler._time_order=function(a){var d=scheduler._props[this._mode];d?a.sort(function(a,b){return d.order[a[d.map_to]]>d.order[b[d.map_to]]?1:-1}):i.apply(this,arguments)};scheduler.attachEvent("onEventAdded",function(a,d){if(this._loading)return!0;for(var c in scheduler._props){var e=scheduler._props[c];if(typeof d[e.map_to]=="undefined")d[e.map_to]=e.options[0].key}return!0});scheduler.attachEvent("onEventCreated",function(a,c){var f=scheduler._props[this._mode]; -if(f){var e=this.getEvent(a);this._mouse_coords(c);g(f,e);this.event_updated(e)}return!0})})(); diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_url.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_url.js deleted file mode 100644 index bb342e484e0..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_url.js +++ /dev/null @@ -1,6 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.attachEvent("onTemplatesReady",function(){var d=!0,e=scheduler.date.str_to_date("%Y-%m-%d"),h=scheduler.date.date_to_str("%Y-%m-%d");scheduler.attachEvent("onBeforeViewChange",function(i,j,f,k){if(d){d=!1;for(var a={},g=(document.location.hash||"").replace("#","").split(","),b=0;b<g.length;b++){var c=g[b].split("=");c.length==2&&(a[c[0]]=c[1])}if(a.date||a.mode){try{this.setCurrentView(a.date?e(a.date):null,a.mode||null)}catch(m){this.setCurrentView(a.date?e(a.date):null,f)}return!1}}var l= -"#date="+h(k||j)+",mode="+(f||i);document.location.hash=l;return!0})}); diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_week_agenda.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_week_agenda.js deleted file mode 100644 index 60042f50080..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_week_agenda.js +++ /dev/null @@ -1,18 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler._wa={};scheduler.xy.week_agenda_scale_height=20;scheduler.templates.week_agenda_event_text=function(c,e,f){return scheduler.templates.event_date(c)+" "+f.text};scheduler.date.week_agenda_start=scheduler.date.week_start;scheduler.date.week_agenda_end=function(c){return scheduler.date.add(c,7,"day")};scheduler.date.add_week_agenda=function(c,e){return scheduler.date.add(c,e*7,"day")}; -scheduler.attachEvent("onSchedulerReady",function(){var c=scheduler.templates;if(!c.week_agenda_date)c.week_agenda_date=c.week_date});(function(){var c=scheduler.date.date_to_str("%l, %F %d");scheduler.templates.week_agenda_scale_date=function(e){return c(e)}})(); -scheduler.attachEvent("onTemplatesReady",function(){scheduler.attachEvent("onSchedulerResize",function(){return this._mode=="week_agenda"?(this.week_agenda_view(!0),!1):!0});var c=scheduler.render_data;scheduler.render_data=function(b){if(this._mode=="week_agenda")f();else return c.apply(this,arguments)};var e=function(){scheduler._cols=[];var b=parseInt(scheduler._els.dhx_cal_data[0].style.width);scheduler._cols.push(Math.floor(b/2));scheduler._cols.push(b-scheduler._cols[0]-1);scheduler._colsS= -{0:[],1:[]};for(var a=parseInt(scheduler._els.dhx_cal_data[0].style.height),m=0;m<3;m++)scheduler._colsS[0].push(Math.floor(a/(3-scheduler._colsS[0].length))),a-=scheduler._colsS[0][m];scheduler._colsS[1].push(scheduler._colsS[0][0]);scheduler._colsS[1].push(scheduler._colsS[0][1]);a=scheduler._colsS[0][scheduler._colsS[0].length-1];scheduler._colsS[1].push(Math.floor(a/2));scheduler._colsS[1].push(a-scheduler._colsS[1][scheduler._colsS[1].length-1])},f=function(){for(var b=scheduler._els.dhx_cal_data[0].innerHTML= -"",a=0;a<2;a++){var m=scheduler._cols[a],c="dhx_wa_column";a==1&&(c+=" dhx_wa_column_last");b+="<div class='"+c+"' style='width: "+m+"px;'>";for(var h=0;h<scheduler._colsS[a].length;h++){var k=scheduler.xy.week_agenda_scale_height-2,e=scheduler._colsS[a][h]-k-2;b+="<div class='dhx_wa_day_cont'><div style='height:"+k+"px; line-height:"+k+"px;' class='dhx_wa_scale_bar'></div><div style='height:"+e+"px;' class='dhx_wa_day_data'></div></div>"}b+="</div>"}scheduler._els.dhx_cal_date[0].innerHTML=scheduler.templates[scheduler._mode+ -"_date"](scheduler._min_date,scheduler._max_date,scheduler._mode);scheduler._els.dhx_cal_data[0].innerHTML=b;for(var i=scheduler._els.dhx_cal_data[0].getElementsByTagName("div"),l=[],a=0;a<i.length;a++)i[a].className=="dhx_wa_day_cont"&&l.push(i[a]);scheduler._wa._selected_divs=[];for(var f=scheduler.get_visible_events(),j=scheduler.date.week_start(scheduler._date),n=scheduler.date.add(j,1,"day"),a=0;a<7;a++){l[a]._date=j;var s=l[a].childNodes[0],t=l[a].childNodes[1];s.innerHTML=scheduler.templates.week_agenda_scale_date(j); -for(var o=[],q=0;q<f.length;q++){var r=f[q];r.start_date<n&&r.end_date>j&&o.push(r)}o.sort(function(a,b){return a.start_date.valueOf()==b.start_date.valueOf()?a.id>b.id?1:-1:a.start_date>b.start_date?1:-1});for(h=0;h<o.length;h++){var d=o[h],g=document.createElement("div");scheduler._rendered.push(g);g.className="dhx_wa_ev_body";if(d._text_style)g.style.cssText=d._text_style;if(d.color)g.style.backgroundColor=d.color;if(d.textColor)g.style.color=d.textColor;scheduler._select_id&&d.id==scheduler._select_id&& -(g.className+=" dhx_cal_event_selected",scheduler._wa._selected_divs.push(g));var p="";d._timed||(p="middle",d.start_date.valueOf()>=j.valueOf()&&d.start_date.valueOf()<=n.valueOf()&&(p="start"),d.end_date.valueOf()>=j.valueOf()&&d.end_date.valueOf()<=n.valueOf()&&(p="end"));g.innerHTML=scheduler.templates.week_agenda_event_text(d.start_date,d.end_date,d,j,p);g.setAttribute("event_id",d.id);t.appendChild(g)}j=scheduler.date.add(j,1,"day");n=scheduler.date.add(n,1,"day")}};scheduler.week_agenda_view= -function(b){scheduler._min_date=scheduler.date.week_start(scheduler._date);scheduler._max_date=scheduler.date.add(scheduler._min_date,1,"week");scheduler.set_sizes();if(b)scheduler._table_view=!0,scheduler._wa._prev_data_border=scheduler._els.dhx_cal_data[0].style.borderTop,scheduler._els.dhx_cal_data[0].style.borderTop=0,scheduler._els.dhx_cal_data[0].style.overflowY="hidden",scheduler._els.dhx_cal_date[0].innerHTML="",scheduler._els.dhx_cal_data[0].style.top=parseInt(scheduler._els.dhx_cal_data[0].style.top)- -scheduler.xy.bar_height-1+"px",scheduler._els.dhx_cal_data[0].style.height=parseInt(scheduler._els.dhx_cal_data[0].style.height)+scheduler.xy.bar_height+1+"px",scheduler._els.dhx_cal_header[0].style.display="none",e(),f();else{scheduler._table_view=!1;if(scheduler._wa._prev_data_border)scheduler._els.dhx_cal_data[0].style.borderTop=scheduler._wa._prev_data_border;scheduler._els.dhx_cal_data[0].style.overflowY="auto";scheduler._els.dhx_cal_data[0].style.top=parseInt(scheduler._els.dhx_cal_data[0].style.top)+ -scheduler.xy.bar_height+"px";scheduler._els.dhx_cal_data[0].style.height=parseInt(scheduler._els.dhx_cal_data[0].style.height)-scheduler.xy.bar_height+"px";scheduler._els.dhx_cal_header[0].style.display="block"}};scheduler.mouse_week_agenda=function(b){for(var a=b.ev,c=a.srcElement||a.target;c.parentNode;){if(c._date)var e=c._date;c=c.parentNode}if(!e)return b;b.x=0;var h=e.valueOf()-scheduler._min_date.valueOf();b.y=Math.ceil(h/6E4/this.config.time_step);if(this._drag_mode=="move"){this._drag_event._dhx_changed= -!0;this._select_id=this._drag_id;for(var k=0;k<scheduler._rendered.length;k++)if(scheduler._drag_id==this._rendered[k].getAttribute("event_id"))var f=this._rendered[k];if(!scheduler._wa._dnd){var i=f.cloneNode(!0);this._wa._dnd=i;i.className=f.className;i.id="dhx_wa_dnd";i.className+=" dhx_wa_dnd";document.body.appendChild(i)}var l=document.getElementById("dhx_wa_dnd");l.style.top=(a.pageY||a.clientY)+20+"px";l.style.left=(a.pageX||a.clientX)+20+"px"}return b};scheduler.attachEvent("onBeforeEventChanged", -function(){if(this._mode=="week_agenda"&&this._drag_mode=="move"){var b=document.getElementById("dhx_wa_dnd");b.parentNode.removeChild(b);scheduler._wa._dnd=!1}return!0});scheduler.attachEvent("onEventSave",function(b,a,c){if(c)this._select_id=b;return!0});scheduler._wa._selected_divs=[];scheduler.attachEvent("onClick",function(b){if(this._mode=="week_agenda"){if(scheduler._wa._selected_divs)for(var a=0;a<this._wa._selected_divs.length;a++){var c=this._wa._selected_divs[a];c.className=c.className.replace(/ dhx_cal_event_selected/, -"")}this.for_rendered(b,function(a){a.className+=" dhx_cal_event_selected";scheduler._wa._selected_divs.push(a)});this._select_id=b;return!1}return!0})}); diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_year_view.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_year_view.js deleted file mode 100644 index e17296b6f81..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_year_view.js +++ /dev/null @@ -1,17 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.config.year_x=4;scheduler.config.year_y=3;scheduler.config.year_mode_name="year";scheduler.xy.year_top=0;scheduler.templates.year_date=function(c){return scheduler.date.date_to_str(scheduler.locale.labels.year_tab+" %Y")(c)};scheduler.templates.year_month=scheduler.date.date_to_str("%F");scheduler.templates.year_scale_date=scheduler.date.date_to_str("%D");scheduler.templates.year_tooltip=function(c,o,p){return p.text}; -(function(){var c=function(){return scheduler._mode==scheduler.config.year_mode_name};scheduler.dblclick_dhx_month_head=function(a){if(c()){var b=a.target||a.srcElement;if(b.parentNode.className.indexOf("dhx_before")!=-1||b.parentNode.className.indexOf("dhx_after")!=-1)return!1;var d=this.templates.xml_date(b.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.getAttribute("date"));d.setDate(parseInt(b.innerHTML,10));var u=this.date.add(d,1,"day");!this.config.readonly&&this.config.dblclick_create&& -this.addEventNow(d.valueOf(),u.valueOf(),a)}};var o=scheduler.changeEventId;scheduler.changeEventId=function(){o.apply(this,arguments);c()&&this.year_view(!0)};var p=scheduler.render_data,v=scheduler.date.date_to_str("%Y/%m/%d"),w=scheduler.date.str_to_date("%Y/%m/%d");scheduler.render_data=function(a){if(!c())return p.apply(this,arguments);for(var b=0;b<a.length;b++)this._year_render_event(a[b])};var x=scheduler.clear_view;scheduler.clear_view=function(){if(!c())return x.apply(this,arguments);for(var a= -0;a<j.length;a++)j[a].className="dhx_month_head",j[a].setAttribute("date","");j=[]};scheduler.hideToolTip=function(){if(this._tooltip)this._tooltip.style.display="none",this._tooltip.date=new Date(9999,1,1)};scheduler.showToolTip=function(a,b,d,c){if(this._tooltip){if(this._tooltip.date.valueOf()==a.valueOf())return;this._tooltip.innerHTML=""}else{var k=this._tooltip=document.createElement("DIV");k.className="dhx_tooltip";document.body.appendChild(k);k.onclick=scheduler._click.dhx_cal_data}for(var h= -this.getEvents(a,this.date.add(a,1,"day")),l="",f=0;f<h.length;f++){var m=h[f],e=m.color?"background-color:"+m.color+";":"",g=m.textColor?"color:"+m.textColor+";":"";l+="<div class='dhx_tooltip_line' style='"+e+""+g+"' event_id='"+h[f].id+"'>";l+="<div class='dhx_tooltip_date' style='"+e+""+g+"'>"+(h[f]._timed?this.templates.event_date(h[f].start_date):"")+"</div>";l+="<div class='dhx_event_icon icon_details'> </div>";l+=this.templates.year_tooltip(h[f].start_date,h[f].end_date,h[f])+"</div>"}this._tooltip.style.display= -"";this._tooltip.style.top="0px";this._tooltip.style.left=document.body.offsetWidth-b.left-this._tooltip.offsetWidth<0?b.left-this._tooltip.offsetWidth+"px":b.left+c.offsetWidth+"px";this._tooltip.date=a;this._tooltip.innerHTML=l;this._tooltip.style.top=document.body.offsetHeight-b.top-this._tooltip.offsetHeight<0?b.top-this._tooltip.offsetHeight+c.offsetHeight+"px":b.top+"px"};scheduler._init_year_tooltip=function(){dhtmlxEvent(scheduler._els.dhx_cal_data[0],"mouseover",function(a){if(c()){var a= -a||event,b=a.target||a.srcElement;if(b.tagName.toLowerCase()=="a")b=b.parentNode;(b.className||"").indexOf("dhx_year_event")!=-1?scheduler.showToolTip(w(b.getAttribute("date")),getOffset(b),a,b):scheduler.hideToolTip()}});this._init_year_tooltip=function(){}};scheduler.attachEvent("onSchedulerResize",function(){return c()?(this.year_view(!0),!1):!0});scheduler._get_year_cell=function(a){var b=a.getMonth()+12*(a.getFullYear()-this._min_date.getFullYear())-this.week_starts._month,d=this._els.dhx_cal_data[0].childNodes[b], -a=this.week_starts[b]+a.getDate()-1;return d.childNodes[2].firstChild.rows[Math.floor(a/7)].cells[a%7].firstChild};var j=[];scheduler._mark_year_date=function(a,b){var d=this._get_year_cell(a);d.className="dhx_month_head dhx_year_event "+this.templates.event_class(b.start_date,b.end_date,b);d.setAttribute("date",v(a));j.push(d)};scheduler._unmark_year_date=function(a){this._get_year_cell(a).className="dhx_month_head"};scheduler._year_render_event=function(a){for(var b=a.start_date,b=b.valueOf()<this._min_date.valueOf()? -this._min_date:this.date.date_part(new Date(b));b<a.end_date;)if(this._mark_year_date(b,a),b=this.date.add(b,1,"day"),b.valueOf()>=this._max_date.valueOf())break};scheduler.year_view=function(a){if(a){var b=scheduler.xy.scale_height;scheduler.xy.scale_height=-1}scheduler._els.dhx_cal_header[0].style.display=a?"none":"";scheduler.set_sizes();if(a)scheduler.xy.scale_height=b;scheduler._table_view=a;if(!this._load_mode||!this._load())a?(scheduler._init_year_tooltip(),scheduler._reset_year_scale(),scheduler.render_view_data()): -scheduler.hideToolTip()};scheduler._reset_year_scale=function(){this._cols=[];this._colsS={};var a=[],b=this._els.dhx_cal_data[0],d=this.config;b.scrollTop=0;b.innerHTML="";var c=Math.floor(parseInt(b.style.width)/d.year_x),k=Math.floor((parseInt(b.style.height)-scheduler.xy.year_top)/d.year_y);k<190&&(k=190,c=Math.floor((parseInt(b.style.width)-scheduler.xy.scroll_width)/d.year_x));for(var h=c-11,l=0,f=document.createElement("div"),m=this.date.week_start(new Date),e=0;e<7;e++)this._cols[e]=Math.floor(h/ -(7-e)),this._render_x_header(e,l,m,f),m=this.date.add(m,1,"day"),h-=this._cols[e],l+=this._cols[e];f.lastChild.className+=" dhx_scale_bar_last";for(var g=this.date[this._mode+"_start"](this.date.copy(this._date)),j=g,e=0;e<d.year_y;e++)for(var r=0;r<d.year_x;r++){var i=document.createElement("DIV");i.style.cssText="position:absolute;";i.setAttribute("date",this.templates.xml_format(g));i.innerHTML="<div class='dhx_year_month'></div><div class='dhx_year_week'>"+f.innerHTML+"</div><div class='dhx_year_body'></div>"; -i.childNodes[0].innerHTML=this.templates.year_month(g);for(var p=this.date.week_start(g),t=this._reset_month_scale(i.childNodes[2],g,p),n=i.childNodes[2].firstChild.rows,q=n.length;q<6;q++){n[0].parentNode.appendChild(n[0].cloneNode(!0));for(var s=0;s<n[q].childNodes.length;s++)n[q].childNodes[s].className="dhx_after",n[q].childNodes[s].firstChild.innerHTML=scheduler.templates.month_day(t),t=scheduler.date.add(t,1,"day")}b.appendChild(i);i.childNodes[1].style.height=i.childNodes[1].childNodes[0].offsetHeight+ -"px";var o=Math.round((k-190)/2);i.style.marginTop=o+"px";this.set_xy(i,c-10,k-o-10,c*r+5,k*e+5+scheduler.xy.year_top);a[e*d.year_x+r]=(g.getDay()-(this.config.start_on_monday?1:0)+7)%7;g=this.date.add(g,1,"month")}this._els.dhx_cal_date[0].innerHTML=this.templates[this._mode+"_date"](j,g,this._mode);this.week_starts=a;a._month=j.getMonth();this._min_date=j;this._max_date=g}})(); diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/clock_small.gif b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/clock_small.gif Binary files differindex 3e4b179761e..9120ee7c9d0 100644 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/clock_small.gif +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/clock_small.gif diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/colapce-expand-icon.gif b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/collapse_expand_icon.gif Binary files differindex 64da9483ea6..64da9483ea6 100644 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/colapce-expand-icon.gif +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/collapse_expand_icon.gif diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/images.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/images.png Binary files differnew file mode 100644 index 00000000000..8faac638896 --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/images.png diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/lightbox.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/lightbox.png Binary files differdeleted file mode 100644 index 500ece60c3d..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/lightbox.png +++ /dev/null diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/move.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/move.png Binary files differdeleted file mode 100644 index ce5940f0d49..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/move.png +++ /dev/null diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/multi-days-bg.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/multi-days-bg.png Binary files differdeleted file mode 100644 index 8ed81e357dd..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/multi-days-bg.png +++ /dev/null diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/resize_dots.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/resize_dots.png Binary files differnew file mode 100644 index 00000000000..44045c21c35 --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/resize_dots.png diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/arrow_left.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/arrow_left.png Binary files differnew file mode 100644 index 00000000000..133dabca745 --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/arrow_left.png diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/arrow_right.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/arrow_right.png Binary files differnew file mode 100644 index 00000000000..ced03e5e4ed --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/arrow_right.png diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/but_repeat.gif b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/but_repeat.gif Binary files differnew file mode 100644 index 00000000000..93066671bd9 --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/but_repeat.gif diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/calendar.gif b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/calendar.gif Binary files differnew file mode 100644 index 00000000000..8c12c947abc --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/calendar.gif diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/clock_big.gif b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/clock_big.gif Binary files differnew file mode 100644 index 00000000000..26b331cf05e --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/clock_big.gif diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/clock_small.gif b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/clock_small.gif Binary files differnew file mode 100644 index 00000000000..9646dab0d16 --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/clock_small.gif diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/close_icon.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/close_icon.png Binary files differnew file mode 100644 index 00000000000..4aa5d6620e4 --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/close_icon.png diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/collapse_expand_icon.gif b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/collapse_expand_icon.gif Binary files differnew file mode 100644 index 00000000000..bf64cc8199c --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/collapse_expand_icon.gif diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/controls.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/controls.png Binary files differnew file mode 100644 index 00000000000..f9a99e21fae --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/controls.png diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/databg.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/databg.png Binary files differnew file mode 100644 index 00000000000..1b02c11f18a --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/databg.png diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/databg_now.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/databg_now.png Binary files differnew file mode 100644 index 00000000000..f1875140dbd --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/databg_now.png diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/resize_dots.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/resize_dots.png Binary files differnew file mode 100644 index 00000000000..c26e2a3aaff --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/resize_dots.png diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/resizing.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/resizing.png Binary files differnew file mode 100644 index 00000000000..389ca543e0d --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_dhx_terrace/resizing.png diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/blue_tab.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/blue_tab.png Binary files differnew file mode 100644 index 00000000000..f874fa321f7 --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/blue_tab.png diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/blue_tab_wide.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/blue_tab_wide.png Binary files differnew file mode 100644 index 00000000000..88e22e1682b --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/blue_tab_wide.png diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/but_repeat.gif b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/but_repeat.gif Binary files differnew file mode 100644 index 00000000000..dd6595e5d9e --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/but_repeat.gif diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/buttons.gif b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/buttons.gif Binary files differnew file mode 100644 index 00000000000..0c60904e75c --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/buttons.gif diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/calendar.gif b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/calendar.gif Binary files differnew file mode 100644 index 00000000000..67257083540 --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/calendar.gif diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/clock_big.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/clock_big.png Binary files differnew file mode 100644 index 00000000000..8f789556215 --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/clock_big.png diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/clock_small.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/clock_small.png Binary files differnew file mode 100644 index 00000000000..697be65515c --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/clock_small.png diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/collapse_expand_icon.gif b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/collapse_expand_icon.gif Binary files differnew file mode 100644 index 00000000000..64da9483ea6 --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/collapse_expand_icon.gif diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/controlls5.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/controlls5.png Binary files differindex 24957208fdc..24957208fdc 100644 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/controlls5.png +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/controlls5.png diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/databg.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/databg.png Binary files differnew file mode 100644 index 00000000000..f0ffbdabc10 --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/databg.png diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/databg_now.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/databg_now.png Binary files differnew file mode 100644 index 00000000000..9f371b4df71 --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/databg_now.png diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/event-bg.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/event-bg.png Binary files differnew file mode 100644 index 00000000000..a3bae3e0186 --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/event-bg.png diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/icon.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/icon.png Binary files differnew file mode 100644 index 00000000000..31d6626cdd4 --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/icon.png diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/left-separator.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/left-separator.png Binary files differnew file mode 100644 index 00000000000..22d630927f3 --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/left-separator.png diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/left-time-bg.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/left-time-bg.png Binary files differnew file mode 100644 index 00000000000..287a23bbdcf --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/left-time-bg.png diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/lightbox.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/lightbox.png Binary files differnew file mode 100644 index 00000000000..f0314fa6099 --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/lightbox.png diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/loading.gif b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/loading.gif Binary files differnew file mode 100644 index 00000000000..f5e71df6aa4 --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/loading.gif diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/move.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/move.png Binary files differnew file mode 100644 index 00000000000..15681b311e0 --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/move.png diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/multi-days-bg.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/multi-days-bg.png Binary files differnew file mode 100644 index 00000000000..f43a46357b2 --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/multi-days-bg.png diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/second-top-days-bg.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/second-top-days-bg.png Binary files differnew file mode 100644 index 00000000000..8f9a4f6da02 --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/second-top-days-bg.png diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/top-days-bg.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/top-days-bg.png Binary files differnew file mode 100644 index 00000000000..094b805f609 --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/top-days-bg.png diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/top-separator.gif b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/top-separator.gif Binary files differnew file mode 100644 index 00000000000..18b4bfa95b0 --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/top-separator.gif diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/white_tab.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/white_tab.png Binary files differnew file mode 100644 index 00000000000..7ee92852294 --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/white_tab.png diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/white_tab_wide.png b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/white_tab_wide.png Binary files differnew file mode 100644 index 00000000000..6e5ffb852f0 --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs_glossy/white_tab_wide.png diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/readme.txt b/addons/web_calendar/static/lib/dhtmlxScheduler/readme.txt index ccda9adb09a..0bc2f8df50d 100644 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/readme.txt +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/readme.txt @@ -1,4 +1,4 @@ -dhtmlxScheduler v.3.0 build 110727
+dhtmlxScheduler v.3.5 build 120823
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in non-GPL project. Please contact sales@dhtmlx.com for details
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/base.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/base.js deleted file mode 100644 index 45a6dc0c820..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/base.js +++ /dev/null @@ -1,161 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.date={
- init:function(){
- var s = scheduler.locale.date.month_short;
- var t = scheduler.locale.date.month_short_hash = {};
- for (var i = 0; i < s.length; i++)
- t[s[i]]=i;
-
- var s = scheduler.locale.date.month_full;
- var t = scheduler.locale.date.month_full_hash = {};
- for (var i = 0; i < s.length; i++)
- t[s[i]]=i;
- },
- date_part:function(date){
- date.setHours(0);
- date.setMinutes(0);
- date.setSeconds(0);
- date.setMilliseconds(0);
- return date;
- },
- time_part:function(date){
- return (date.valueOf()/1000 - date.getTimezoneOffset()*60)%86400;
- },
- week_start:function(date){
- var shift=date.getDay();
- if (scheduler.config.start_on_monday){
- if (shift===0) shift=6;
- else shift--;
- }
- return this.date_part(this.add(date,-1*shift,"day"));
- },
- month_start:function(date){
- date.setDate(1);
- return this.date_part(date);
- },
- year_start:function(date){
- date.setMonth(0);
- return this.month_start(date);
- },
- day_start:function(date){
- return this.date_part(date);
- },
- add:function(date,inc,mode){
- var ndate=new Date(date.valueOf());
- switch(mode){
- case "day":
- ndate.setDate(ndate.getDate()+inc);
- if(date.getDate()==ndate.getDate() && !!inc) {
- do {
- ndate.setTime(ndate.getTime()+60*60*1000);
- } while (date.getDate() == ndate.getDate())
- }
- break;
- case "week": ndate.setDate(ndate.getDate()+7*inc); break;
- case "month": ndate.setMonth(ndate.getMonth()+inc); break;
- case "year": ndate.setYear(ndate.getFullYear()+inc); break;
- case "hour": ndate.setHours(ndate.getHours()+inc); break;
- case "minute": ndate.setMinutes(ndate.getMinutes()+inc); break;
- default:
- return scheduler.date["add_"+mode](date,inc,mode);
- }
- return ndate;
- },
- to_fixed:function(num){
- if (num<10) return "0"+num;
- return num;
- },
- copy:function(date){
- return new Date(date.valueOf());
- },
- date_to_str:function(format,utc){
- format=format.replace(/%[a-zA-Z]/g,function(a){
- switch(a){
- case "%d": return "\"+scheduler.date.to_fixed(date.getDate())+\"";
- case "%m": return "\"+scheduler.date.to_fixed((date.getMonth()+1))+\"";
- case "%j": return "\"+date.getDate()+\"";
- case "%n": return "\"+(date.getMonth()+1)+\"";
- case "%y": return "\"+scheduler.date.to_fixed(date.getFullYear()%100)+\"";
- case "%Y": return "\"+date.getFullYear()+\"";
- case "%D": return "\"+scheduler.locale.date.day_short[date.getDay()]+\"";
- case "%l": return "\"+scheduler.locale.date.day_full[date.getDay()]+\"";
- case "%M": return "\"+scheduler.locale.date.month_short[date.getMonth()]+\"";
- case "%F": return "\"+scheduler.locale.date.month_full[date.getMonth()]+\"";
- case "%h": return "\"+scheduler.date.to_fixed((date.getHours()+11)%12+1)+\"";
- case "%g": return "\"+((date.getHours()+11)%12+1)+\"";
- case "%G": return "\"+date.getHours()+\"";
- case "%H": return "\"+scheduler.date.to_fixed(date.getHours())+\"";
- case "%i": return "\"+scheduler.date.to_fixed(date.getMinutes())+\"";
- case "%a": return "\"+(date.getHours()>11?\"pm\":\"am\")+\"";
- case "%A": return "\"+(date.getHours()>11?\"PM\":\"AM\")+\"";
- case "%s": return "\"+scheduler.date.to_fixed(date.getSeconds())+\"";
- case "%W": return "\"+scheduler.date.to_fixed(scheduler.date.getISOWeek(date))+\"";
- default: return a;
- }
- });
- if (utc) format=format.replace(/date\.get/g,"date.getUTC");
- return new Function("date","return \""+format+"\";");
- },
- str_to_date:function(format,utc){
- var splt="var temp=date.split(/[^0-9a-zA-Z]+/g);";
- var mask=format.match(/%[a-zA-Z]/g);
- for (var i=0; i<mask.length; i++){
- switch(mask[i]){
- case "%j":
- case "%d": splt+="set[2]=temp["+i+"]||1;";
- break;
- case "%n":
- case "%m": splt+="set[1]=(temp["+i+"]||1)-1;";
- break;
- case "%y": splt+="set[0]=temp["+i+"]*1+(temp["+i+"]>50?1900:2000);";
- break;
- case "%g":
- case "%G":
- case "%h":
- case "%H":
- splt+="set[3]=temp["+i+"]||0;";
- break;
- case "%i":
- splt+="set[4]=temp["+i+"]||0;";
- break;
- case "%Y": splt+="set[0]=temp["+i+"]||0;";
- break;
- case "%a":
- case "%A": splt+="set[3]=set[3]%12+((temp["+i+"]||'').toLowerCase()=='am'?0:12);";
- break;
- case "%s": splt+="set[5]=temp["+i+"]||0;";
- break;
- case "%M": splt+="set[1]=scheduler.locale.date.month_short_hash[temp["+i+"]]||0;";
- break;
- case "%F": splt+="set[1]=scheduler.locale.date.month_full_hash[temp["+i+"]]||0;";
- break;
- default:
- break;
- }
- }
- var code ="set[0],set[1],set[2],set[3],set[4],set[5]";
- if (utc) code =" Date.UTC("+code+")";
- return new Function("date","var set=[0,0,1,0,0,0]; "+splt+" return new Date("+code+");");
- },
-
- getISOWeek: function(ndate) {
- if(!ndate) return false;
- var nday = ndate.getDay();
- if (nday === 0) {
- nday = 7;
- }
- var first_thursday = new Date(ndate.valueOf());
- first_thursday.setDate(ndate.getDate() + (4 - nday));
- var year_number = first_thursday.getFullYear(); // year of the first Thursday
- var ordinal_date = Math.round( (first_thursday.getTime() - new Date(year_number, 0, 1).getTime()) / 86400000); //ordinal date of the first Thursday - 1 (so not really ordinal date)
- var week_number = 1 + Math.floor( ordinal_date / 7);
- return week_number;
- },
-
- getUTCISOWeek: function(ndate){
- return this.getISOWeek(ndate);
- }
-};
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/clear.css b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/clear.css deleted file mode 100644 index 3a3217e940a..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/clear.css +++ /dev/null @@ -1,110 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -.dhx_cal_ltext{
- text-align:left;
-}
-.dhx_agenda_line {
- overflow:hidden;
- white-space:nowrap;
-}
-.dhx_cal_light select{
- width:auto;
-}
-
-.dhx_custom_button {
- width:120px !important;
-}
-
-.dhx_cal_ltext{
- text-align:left;
-}
-.dhx_form_repeat{
- text-align:left;
- width:100%;
-}
-
-.dhx_cal_lsection {
- text-align:left;
-}
-.dhx_month_head{
- font-size:8pt;
-}
-.dhx_expand_icon {
- position:absolute; top:0px; right:2px;
- background-image:url(./imgs/colapce-expand-icon.gif);
- width:18px; height:18px;
- cursor:pointer;
- background-position:0px 18px;
- z-index:16;
-}
-
-div.dhx_cal_container table tr td {
- border-width:0 !important;
- padding:0 !important;
-}
-
-.dhx_cal_container table {
- border-collapse:separate !important;
- margin:0 0 !important;
-}
-
-.dhx_cal_container{
- z-index:999;
-}
-
-div.dhx_cal_event_clear, div.dhx_cal_event{
- line-height:100%;
-}
-
-.dhx_cal_ltext textarea {
- -moz-box-shadow:none;
- border-width:0;
- padding:0;
- background:transparent none repeat scroll 0 0;
- -webkit-box-shadow:none;
-}
-
-.dhx_cal_light{
- text-align:left;
-}
-.dhx_cal_light div, .dhx_cal_container div{
- line-height:normal;
-}
-
-.dhx_cal_light .dhx_form_repeat div,.dhx_cal_light .dhx_form_repeat{
- line-height:24px;
-}
-
-
-/* anti-joomla */
-div.dhx_cal_navline div, .dhx_scale_bar, .dhx_scale_hour, .dhx_title{
- text-align:center !important;
-}
-#whitebox div .dhx_month_head {
- text-align:right;
-}
-#whitebox div .dhx_cal_event_line, #whitebox div .dhx_body{
- text-align:left;
-}
-div.dhx_cal_container, div.dhx_cal_lsection{
- line-height:1em;
-}
-div.dhx_cal_container, div.dhx_cal_lsection{
- line-height:normal;
-}
-.dhx_cal_header .dhx_agenda_line div, .dhx_year_month{
- text-align:center !important;
-}
-.dhx_tooltip{
- text-align:left;
-}
-
-
-.dhx_cal_data table{
- border-width:0px !important;
-}
-.dhx_cal_data table tr td{
- border-top-width:0px !important;
-}
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/config.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/config.js deleted file mode 100644 index 460b6771c00..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/config.js +++ /dev/null @@ -1,117 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -/*
-%e Day of the month without leading zeros (01..31)
-%d Day of the month, 2 digits with leading zeros (01..31)
-%j Day of the year, 3 digits with leading zeros (001..366)
-%a A textual representation of a day, two letters
-%W A full textual representation of the day of the week
-
-%c Numeric representation of a month, without leading zeros (0..12)
-%m Numeric representation of a month, with leading zeros (00..12)
-%b A short textual representation of a month, three letters (Jan..Dec)
-%M A full textual representation of a month, such as January or March (January..December)
-
-%y A two digit representation of a year (93..03)
-%Y A full numeric representation of a year, 4 digits (1993..03)
-*/
-
-scheduler.config={
- default_date: "%j %M %Y",
- month_date: "%F %Y",
- load_date: "%Y-%m-%d",
- week_date: "%l",
- day_date: "%D, %F %j",
- hour_date: "%H:%i",
- month_day : "%d",
- xml_date:"%m/%d/%Y %H:%i",
- api_date:"%d-%m-%Y %H:%i",
-
- hour_size_px:42,
- time_step:5,
-
- start_on_monday:1,
- first_hour:0,
- last_hour:24,
- readonly:false,
- drag_resize:1,
- drag_move:1,
- drag_create:1,
- dblclick_create:1,
- edit_on_create:1,
- details_on_create:0,
- click_form_details:0,
- cascade_event_display: false,
- cascade_event_count:4,
- cascade_event_margin: 30,
- drag_lightbox:true,
- preserve_scroll:true,
-
- server_utc:false,
-
- positive_closing:false,
-
- icons_edit:["icon_save","icon_cancel"],
- icons_select:["icon_details","icon_edit","icon_delete"],
- buttons_left:["dhx_save_btn","dhx_cancel_btn"],
- buttons_right:["dhx_delete_btn"],
- lightbox:{
- sections:[ {name:"description", height:200, map_to:"text", type:"textarea" , focus:true},
- {name:"time", height:72, type:"time", map_to:"auto"} ]
- },
-
- repeat_date_of_end: "01.01.2010"
-};
-scheduler.templates={};
-scheduler.init_templates=function(){
- var d=scheduler.date.date_to_str;
- var c=scheduler.config;
- var f = function(a,b){
- for (var c in b)
- if (!a[c]) a[c]=b[c];
- };
- f(scheduler.templates,{
- day_date:d(c.default_date),
- month_date:d(c.month_date),
- week_date:function(d1,d2){
- return scheduler.templates.day_date(d1)+" – "+scheduler.templates.day_date(scheduler.date.add(d2,-1,"day"));
- },
- day_scale_date:d(c.default_date),
- month_scale_date:d(c.week_date),
- week_scale_date:d(c.day_date),
- hour_scale:d(c.hour_date),
- time_picker:d(c.hour_date),
- event_date:d(c.hour_date),
- month_day:d(c.month_day),
- xml_date:scheduler.date.str_to_date(c.xml_date,c.server_utc),
- load_format:d(c.load_date,c.server_utc),
- xml_format:d(c.xml_date,c.server_utc),
- api_date:scheduler.date.str_to_date(c.api_date),
- event_header:function(start,end,ev){
- return scheduler.templates.event_date(start)+" - "+scheduler.templates.event_date(end);
- },
- event_text:function(start,end,ev){
- return ev.text;
- },
- event_class:function(start,end,ev){
- return "";
- },
- month_date_class:function(d){
- return "";
- },
- week_date_class:function(d){
- return "";
- },
- event_bar_date:function(start,end,ev){
- return scheduler.templates.event_date(start)+" ";
- },
- event_bar_text:function(start,end,ev){
- return ev.text;
- }
- });
- this.callEvent("onTemplatesReady",[]);
-};
-
-
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/connector.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/connector.js deleted file mode 100644 index 72462172908..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/connector.js +++ /dev/null @@ -1,139 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -/*
- dhx_sort[index]=direction
- dhx_filter[index]=mask
-*/
-if (window.dhtmlXGridObject){
- dhtmlXGridObject.prototype._init_point_connector=dhtmlXGridObject.prototype._init_point;
- dhtmlXGridObject.prototype._init_point=function(){
- var clear_url=function(url){
- url=url.replace(/(\?|\&)connector[^\f]*/g,"");
- return url+(url.indexOf("?")!=-1?"&":"?")+"connector=true"+(this.hdr.rows.length > 0 ? "&dhx_no_header=1":"");
- };
- var combine_urls=function(url){
- return clear_url.call(this,url)+(this._connector_sorting||"")+(this._connector_filter||"");
- };
- var sorting_url=function(url,ind,dir){
- this._connector_sorting="&dhx_sort["+ind+"]="+dir;
- return combine_urls.call(this,url);
- };
- var filtering_url=function(url,inds,vals){
- for (var i=0; i<inds.length; i++)
- inds[i]="dhx_filter["+inds[i]+"]="+encodeURIComponent(vals[i]);
- this._connector_filter="&"+inds.join("&");
- return combine_urls.call(this,url);
- };
- this.attachEvent("onCollectValues",function(ind){
- if (this._con_f_used[ind]){
- if (typeof(this._con_f_used[ind]) == "object")
- return this._con_f_used[ind];
- else
- return false;
- }
- return true;
- });
- this.attachEvent("onDynXLS",function(){
- this.xmlFileUrl=combine_urls.call(this,this.xmlFileUrl);
- return true;
- });
- this.attachEvent("onBeforeSorting",function(ind,type,dir){
- if (type=="connector"){
- var self=this;
- this.clearAndLoad(sorting_url.call(this,this.xmlFileUrl,ind,dir),function(){
- self.setSortImgState(true,ind,dir);
- });
- return false;
- }
- return true;
- });
- this.attachEvent("onFilterStart",function(a,b){
- if (this._con_f_used.length){
- this.clearAndLoad(filtering_url.call(this,this.xmlFileUrl,a,b));
- return false;
- }
- return true;
- });
- this.attachEvent("onXLE",function(a,b,c,xml){
- if (!xml) return;
- });
-
- if (this._init_point_connector) this._init_point_connector();
- };
- dhtmlXGridObject.prototype._con_f_used=[];
- dhtmlXGridObject.prototype._in_header_connector_text_filter=function(t,i){
- if (!this._con_f_used[i])
- this._con_f_used[i]=1;
- return this._in_header_text_filter(t,i);
- };
- dhtmlXGridObject.prototype._in_header_connector_select_filter=function(t,i){
- if (!this._con_f_used[i])
- this._con_f_used[i]=2;
- return this._in_header_select_filter(t,i);
- };
- dhtmlXGridObject.prototype.load_connector=dhtmlXGridObject.prototype.load;
- dhtmlXGridObject.prototype.load=function(url, call, type){
- if (!this._colls_loaded && this.cellType){
- var ar=[];
- for (var i=0; i < this.cellType.length; i++)
- if (this.cellType[i].indexOf("co")==0 || this._con_f_used[i]==2) ar.push(i);
- if (ar.length)
- arguments[0]+=(arguments[0].indexOf("?")!=-1?"&":"?")+"connector=true&dhx_colls="+ar.join(",");
- }
- return this.load_connector.apply(this,arguments);
- };
- dhtmlXGridObject.prototype._parseHead_connector=dhtmlXGridObject.prototype._parseHead;
- dhtmlXGridObject.prototype._parseHead=function(url, call, type){
- this._parseHead_connector.apply(this,arguments);
- if (!this._colls_loaded){
- var cols = this.xmlLoader.doXPath("./coll_options", arguments[0]);
- for (var i=0; i < cols.length; i++){
- var f = cols[i].getAttribute("for");
- var v = [];
- var combo=null;
- if (this.cellType[f] == "combo")
- combo = this.getColumnCombo(f);
- if (this.cellType[f].indexOf("co")==0)
- combo=this.getCombo(f);
-
- var os = this.xmlLoader.doXPath("./item",cols[i]);
- for (var j=0; j<os.length; j++){
- var val=os[j].getAttribute("value");
-
- if (combo){
- var lab=os[j].getAttribute("label")||val;
-
- if (combo.addOption)
- combo.addOption([[val, lab]]);
- else
- combo.put(val,lab);
-
- v[v.length]=lab;
- } else
- v[v.length]=val;
- }
- if (this._con_f_used[f*1])
- this._con_f_used[f*1]=v;
- }
- this._colls_loaded=true;
- }
- };
-}
-
-if (window.dataProcessor){
- dataProcessor.prototype.init_original=dataProcessor.prototype.init;
- dataProcessor.prototype.init=function(obj){
- this.init_original(obj);
- obj._dataprocessor=this;
-
- this.setTransactionMode("POST",true);
- this.serverProcessor+=(this.serverProcessor.indexOf("?")!=-1?"&":"?")+"editing=true";
- };
-}
-dhtmlxError.catchError("LoadXML",function(a,b,c){
- if (c[0].status != 0) {
- alert(c[0].responseText);
- }
-});
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/dataprocessor_hook.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/dataprocessor_hook.js deleted file mode 100644 index 27741b6d147..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/dataprocessor_hook.js +++ /dev/null @@ -1,82 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler._dp_init=function(dp){
- dp._methods=["setEventTextStyle","","changeEventId","deleteEvent"];
-
- this.attachEvent("onEventAdded",function(id){
- if (!this._loading && this.validId(id))
- dp.setUpdated(id,true,"inserted");
- });
- this.attachEvent("onConfirmedBeforeEventDelete", function(id){
- if (!this.validId(id)) return;
- var z=dp.getState(id);
-
- if (z=="inserted" || this._new_event) { dp.setUpdated(id,false); return true; }
- if (z=="deleted") return false;
- if (z=="true_deleted") return true;
-
- dp.setUpdated(id,true,"deleted");
- return false;
- });
- this.attachEvent("onEventChanged",function(id){
- if (!this._loading && this.validId(id))
- dp.setUpdated(id,true,"updated");
- });
-
- dp._getRowData=function(id,pref){
- var ev=this.obj.getEvent(id);
- var data = {};
-
- for (var a in ev){
- if (a.indexOf("_")==0) continue;
- if (ev[a] && ev[a].getUTCFullYear) //not very good, but will work
- data[a] = this.obj.templates.xml_format(ev[a]);
- else
- data[a] = ev[a];
- }
-
- return data;
- };
- dp._clearUpdateFlag=function(){};
-
- dp.attachEvent("insertCallback", scheduler._update_callback);
- dp.attachEvent("updateCallback", scheduler._update_callback);
- dp.attachEvent("deleteCallback", function(upd, id) {
- this.obj.setUserData(id, this.action_param, "true_deleted");
- this.obj.deleteEvent(id);
- });
-
-};
-
-
-scheduler.setUserData=function(id,name,value){
- if (id)
- this.getEvent(id)[name]=value;
- else
- this._userdata[name]=value;
-};
-scheduler.getUserData=function(id,name){
- return id?this.getEvent(id)[name]:this._userdata[name];
-};
-scheduler.setEventTextStyle=function(id,style){
- this.for_rendered(id,function(r){
- r.style.cssText+=";"+style;
- });
- var ev = this.getEvent(id);
- ev["_text_style"]=style;
- this.event_updated(ev);
-};
-scheduler.validId=function(id){
- return true;
-};
-
-scheduler._update_callback = function(upd,id){
- var data = scheduler.xmlNodeToJSON(upd.firstChild);
- data.text = data.text||data._tagvalue;
- data.start_date = scheduler.templates.xml_date(data.start_date);
- data.end_date = scheduler.templates.xml_date(data.end_date);
-
- scheduler.addEvent(data);
-};
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/dayevents.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/dayevents.js deleted file mode 100644 index 4717fe2858b..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/dayevents.js +++ /dev/null @@ -1,200 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -dhx.protoUI({
- name:"dayevents",
- defaults:{
- hourFormat:"%H",
- hourClock:12,
- firstHour:0,
- lastHour:24,
- timeScaleWidth:45,
- timeScaleHeight: 30,
- scroll:true,
- scaleBorder:1,
- eventOffset:5,
- width:"auto",
- date: new Date()
- },
- $init:function(config){
- this.name = "DayEvents";
-
- this._dataobj.style.position = "relative";
- this.data.provideApi(this,true);
- this.data.attachEvent("onStoreUpdated",dhx.bind(this.render,this));
-
- this.attachEvent("onBeforeRender", function(){
- this._renderScale();
- this.type.color = this.config.color;
- this.type.textColor = this.config.textColor;
- this._renderobj = this._dataobj.firstChild;
- this._prepareEvents();
- if(window.scheduler)
- this.type.template = scheduler.templates.day_event;
- });
- if(window.scheduler){
- config.hourFormat = scheduler.config.scale_hour;
- config.timeScaleWidth = scheduler.xy.scale_width;
- config.timeScaleHeight = scheduler.xy.scale_height*2;
- }
- },
- _renderScale:function(){
- var html = "<div></div>";
- for(var h = this.config.firstHour; h<this.config.lastHour; h++){
- html += this.hourScaleItem(h);
- }
- this._dataobj.innerHTML = html;
- },
- _id:"dhx_l_id",
- on_click:{
- },
- hourScaleItem: function(hour){
- var isAM = (scheduler.config.hour_date.toLowerCase().indexOf("a")!=-1);
- var top = '00';
- var bottom = '30';
- if(isAM){
- if(hour===0)
- top = 'AM';
- if(hour==12)
- top = 'PM';
- hour = (hour+11)%12+1;
- }
- if(this.config.hourFormat.indexOf("H")!=-1)
- hour = dhx.math.toFixed(hour);
- var html = "";
- var timeScaleWidth = this.config.timeScaleWidth;
- var hourHeight = this.config.timeScaleHeight;
- var sectionWidth = Math.floor(this.config.timeScaleWidth/2);
- var heightTop = Math.floor(hourHeight/2);
- var heightBottom = heightTop-this.config.scaleBorder;
- var eventZoneWidth = this._content_width-this.config.scaleBorder-this.config.timeScaleWidth;
- html += "<div style='width: 100%; height:"+hourHeight+"px;' class='dhx_dayevents_scale_item'>";
- html += "<div class='dhx_dayevents_scale_hour' style='width:"+sectionWidth+"px; height:"+hourHeight+"px;line-height:"+hourHeight+"px;'>"+hour+"</div>";
- html += "<div class='dhx_dayevents_scale_minute' style='width:"+sectionWidth+"px'>";
- html += "<div class='dhx_dayevents_scale_top' style='width:"+sectionWidth+"px;line-height:"+heightTop+"px'>"+top+"</div>";
- html += "<div class='dhx_dayevents_scale_bottom' style='width:"+sectionWidth+"px;line-height:"+heightBottom+"px'>"+bottom+"</div>";
- html += "</div>";
- html += "<div class='dhx_dayevents_scale_event' style='width:"+eventZoneWidth+"px'>";
- html += "<div class='dhx_dayevents_scale_top' style='height:"+heightTop+"px;width:"+eventZoneWidth+"px'></div>";
- html += "<div class='dhx_dayevents_scale_bottom' style='width: "+eventZoneWidth+"px;height:"+heightBottom+"px; '></div>";
- html += "</div>";
- html += "</div>";
- return html;
- },
- type:{
- templateStart:dhx.Template("<div dhx_l_id='#id#' class='dhx_dayevents_event_item {common.templateCss()}' style='left:#$left#px;top:#$top#px;width:#$width#px;height:#$height#px;padding:{common.padding}px;overflow:hidden; background-color:{common.templateColor()} ;color:{common.templateTextColor()};'>"),
- template:scheduler.templates.day_event,
- templateEnd:dhx.Template("</div>"),
- templateCss:dhx.Template(""),
- templateColor:dhx.Template("#color#"),
- templateTextColor:dhx.Template("#textColor#"),
- padding:2
- },
- _prepareEvents:function(){
- var evs = this.data.getRange();
- var stack = [];
- var ev,i,j,k,_is_sorder,_max_sorder,_sorder_set;
- for(i=0; i< evs.length;i++){
- ev=evs[i];
- ev.$inner=false;
- while (stack.length && stack[stack.length-1].end_date.valueOf()<=ev.start_date.valueOf()){
- stack.splice(stack.length-1,1);
- }
- _sorder_set = false;
-
- for(j=0;j< stack.length;j++){
- if(stack[j].end_date.valueOf()<=ev.start_date.valueOf()){
- _sorder_set = true;
- ev.$sorder=stack[j].$sorder;
- stack.splice(j,1);
- ev.$inner=true;
- break;
- }
- }
-
- if (stack.length) stack[stack.length-1].$inner=true;
-
- if(!_sorder_set){
- if(stack.length){
- if(stack.length<=stack[stack.length-1].$sorder){
- if(!stack[stack.length-1].$sorder)
- ev.$sorder = 0;
- else
- for(j=0;j<stack.length;j++){
- _is_sorder = false;
- for(k=0;k<stack.length;k++){
- if(stack[k].$sorder==j){
- _is_sorder = true;
- break;
- }
- }
- if(!_is_sorder){
- ev.$sorder = j;
- break;
- }
- }
- ev.$inner = true;
- }
- else{
- var _max_sorder = stack[0].$sorder;
- for(j =1;j < stack.length; j++)
- if(stack[j].$sorder>_max_sorder)
- _max_sorder = stack[j].$sorder;
- ev.$sorder = _max_sorder+1;
- ev.$inner = false;
- }
- }
- else
- ev.$sorder = 0;
- }
- stack.push(ev);
- if (stack.length>(stack.max_count||0)) stack.max_count=stack.length;
- }
-
- for (var i=0; i < evs.length; i++){
- evs[i].$count=stack.max_count;
- this._setPosition(evs[i]);
- }
- },
- _setPosition:function(ev){
-
- var date = this.config.date.getValue?this.config.date.getValue():this.config.date;
-
- var start = dhx.Date.copy(ev.start_date);
- var end = dhx.Date.copy(ev.end_date);
- var sh = start.getHours();
- var eh = end.getHours();
- if(dhx.Date.datePart(start).valueOf()>dhx.Date.datePart(end).valueOf()){
- end = start;
- }
-
- if(dhx.Date.datePart(start).valueOf()<dhx.Date.datePart(date).valueOf()){
- start = dhx.Date.datePart(date);
- }
- if(dhx.Date.datePart(end).valueOf()>dhx.Date.datePart(date).valueOf()){
- end = dhx.Date.datePart(date);
- end.setMinutes(0);
- end.setHours(this.config.lastHour);
- }
- if (sh < this.config.firstHour || eh >= this.config.lastHour){
- if (sh < this.config.firstHour){
- end.setHours(this.config.firstHour);
- ev.start_date.setMinutes(0);
- }
- if (eh >= this.config.lastHour){
- end.setMinutes(0);
- end.setHours(this.config.lastHour);
- }
- }
- var temp_width = Math.floor((this._content_width-this.config.timeScaleWidth-this.config.eventOffset-8)/ev.$count);
- ev.$left=ev.$sorder*(temp_width)+this.config.timeScaleWidth+this.config.eventOffset;
- if (!ev.$inner) temp_width=temp_width*(ev.$count-ev.$sorder);
- ev.$width = temp_width-this.config.eventOffset-this.type.padding*2;
-
- var sm = start.getHours()*60+start.getMinutes();
- var em = (end.getHours()*60+end.getMinutes())||(this.config.lastHour*60);
- ev.$top = Math.round((sm-this.config.firstHour/60)*(this.config.timeScaleHeight+1)/60); //42px/hour
- ev.$height = Math.max(10,(em-sm)*(this.config.timeScaleHeight+1)/60-2)-this.type.padding*2;
- }
-}, dhx.MouseEvents, dhx.SelectionModel, dhx.Scrollable, dhx.RenderStack, dhx.DataLoader, dhx.ui.view, dhx.EventSystem, dhx.Settings);
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/dhtmlxcommon.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/dhtmlxcommon.js deleted file mode 100644 index ce3c3891f0f..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/dhtmlxcommon.js +++ /dev/null @@ -1,914 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -dhtmlx=function(obj){
- for (var a in obj) dhtmlx[a]=obj[a];
- return dhtmlx; //simple singleton
-};
-dhtmlx.extend_api=function(name,map,ext){
- var t = window[name];
- if (!t) return; //component not defined
- window[name]=function(obj){
- if (obj && typeof obj == "object" && !obj.tagName && !(obj instanceof Array)){
- var that = t.apply(this,(map._init?map._init(obj):arguments));
- //global settings
- for (var a in dhtmlx)
- if (map[a]) this[map[a]](dhtmlx[a]);
- //local settings
- for (var a in obj){
- if (map[a]) this[map[a]](obj[a]);
- else if (a.indexOf("on")==0){
- this.attachEvent(a,obj[a]);
- }
- }
- } else
- var that = t.apply(this,arguments);
- if (map._patch) map._patch(this);
- return that||this;
- };
- window[name].prototype=t.prototype;
- if (ext)
- dhtmlXHeir(window[name].prototype,ext);
-};
-
-dhtmlxAjax={
- get:function(url,callback){
- var t=new dtmlXMLLoaderObject(true);
- t.async=(arguments.length<3);
- t.waitCall=callback;
- t.loadXML(url)
- return t;
- },
- post:function(url,post,callback){
- var t=new dtmlXMLLoaderObject(true);
- t.async=(arguments.length<4);
- t.waitCall=callback;
- t.loadXML(url,true,post)
- return t;
- },
- getSync:function(url){
- return this.get(url,null,true)
- },
- postSync:function(url,post){
- return this.post(url,post,null,true);
- }
-}
-
-/**
- * @desc: xmlLoader object
- * @type: private
- * @param: funcObject - xml parser function
- * @param: object - jsControl object
- * @param: async - sync/async mode (async by default)
- * @param: rSeed - enable/disable random seed ( prevent IE caching)
- * @topic: 0
- */
-function dtmlXMLLoaderObject(funcObject, dhtmlObject, async, rSeed){
- this.xmlDoc="";
-
- if (typeof (async) != "undefined")
- this.async=async;
- else
- this.async=true;
-
- this.onloadAction=funcObject||null;
- this.mainObject=dhtmlObject||null;
- this.waitCall=null;
- this.rSeed=rSeed||false;
- return this;
-};
-/**
- * @desc: xml loading handler
- * @type: private
- * @param: dtmlObject - xmlLoader object
- * @topic: 0
- */
-dtmlXMLLoaderObject.prototype.waitLoadFunction=function(dhtmlObject){
- var once = true;
- this.check=function (){
- if ((dhtmlObject)&&(dhtmlObject.onloadAction != null)){
- if ((!dhtmlObject.xmlDoc.readyState)||(dhtmlObject.xmlDoc.readyState == 4)){
- if (!once)
- return;
-
- once=false; //IE 5 fix
- if (typeof dhtmlObject.onloadAction == "function")
- dhtmlObject.onloadAction(dhtmlObject.mainObject, null, null, null, dhtmlObject);
-
- if (dhtmlObject.waitCall){
- dhtmlObject.waitCall.call(this,dhtmlObject);
- dhtmlObject.waitCall=null;
- }
- }
- }
- };
- return this.check;
-};
-
-/**
- * @desc: return XML top node
- * @param: tagName - top XML node tag name (not used in IE, required for Safari and Mozilla)
- * @type: private
- * @returns: top XML node
- * @topic: 0
- */
-dtmlXMLLoaderObject.prototype.getXMLTopNode=function(tagName, oldObj){
- if (this.xmlDoc.responseXML){
- var temp = this.xmlDoc.responseXML.getElementsByTagName(tagName);
- if(temp.length==0 && tagName.indexOf(":")!=-1)
- var temp = this.xmlDoc.responseXML.getElementsByTagName((tagName.split(":"))[1]);
- var z = temp[0];
- } else
- var z = this.xmlDoc.documentElement;
-
- if (z){
- this._retry=false;
- return z;
- }
-
- if ((_isIE)&&(!this._retry)){
- //fall back to MS.XMLDOM
- var xmlString = this.xmlDoc.responseText;
- var oldObj = this.xmlDoc;
- this._retry=true;
- this.xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
- this.xmlDoc.async=false;
- this.xmlDoc["loadXM"+"L"](xmlString);
-
- return this.getXMLTopNode(tagName, oldObj);
- }
- dhtmlxError.throwError("LoadXML", "Incorrect XML", [
- (oldObj||this.xmlDoc),
- this.mainObject
- ]);
-
- return document.createElement("DIV");
-};
-
-/**
- * @desc: load XML from string
- * @type: private
- * @param: xmlString - xml string
- * @topic: 0
- */
-dtmlXMLLoaderObject.prototype.loadXMLString=function(xmlString){
- {
- try{
- var parser = new DOMParser();
- this.xmlDoc=parser.parseFromString(xmlString, "text/xml");
- }
- catch (e){
- this.xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
- this.xmlDoc.async=this.async;
- this.xmlDoc["loadXM"+"L"](xmlString);
- }
- }
-
- this.onloadAction(this.mainObject, null, null, null, this);
-
- if (this.waitCall){
- this.waitCall();
- this.waitCall=null;
- }
-}
-/**
- * @desc: load XML
- * @type: private
- * @param: filePath - xml file path
- * @param: postMode - send POST request
- * @param: postVars - list of vars for post request
- * @topic: 0
- */
-dtmlXMLLoaderObject.prototype.loadXML=function(filePath, postMode, postVars, rpc){
- if (this.rSeed)
- filePath+=((filePath.indexOf("?") != -1) ? "&" : "?")+"a_dhx_rSeed="+(new Date()).valueOf();
- this.filePath=filePath;
- if ((!_isIE)&&(window.XMLHttpRequest))
- this.xmlDoc=new XMLHttpRequest();
- else {
- this.xmlDoc=new ActiveXObject("Microsoft.XMLHTTP");
- }
-
- if (this.async)
- this.xmlDoc.onreadystatechange=new this.waitLoadFunction(this);
- this.xmlDoc.open(postMode ? "POST" : "GET", filePath, this.async);
-
- if (rpc){
- this.xmlDoc.setRequestHeader("User-Agent", "dhtmlxRPC v0.1 ("+navigator.userAgent+")");
- this.xmlDoc.setRequestHeader("Content-type", "text/xml");
- }
-
- else if (postMode)
- this.xmlDoc.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
-
- this.xmlDoc.setRequestHeader("X-Requested-With","XMLHttpRequest");
- this.xmlDoc.send(null||postVars);
-
- if (!this.async)
- (new this.waitLoadFunction(this))();
-};
-/**
- * @desc: destructor, cleans used memory
- * @type: private
- * @topic: 0
- */
-dtmlXMLLoaderObject.prototype.destructor=function(){
- this.onloadAction=null;
- this.mainObject=null;
- this.xmlDoc=null;
- return null;
-}
-
-dtmlXMLLoaderObject.prototype.xmlNodeToJSON = function(node){
- var t={};
- for (var i=0; i<node.attributes.length; i++)
- t[node.attributes[i].name]=node.attributes[i].value;
- t["_tagvalue"]=node.firstChild?node.firstChild.nodeValue:"";
- for (var i=0; i<node.childNodes.length; i++){
- var name=node.childNodes[i].tagName;
- if (name){
- if (!t[name]) t[name]=[];
- t[name].push(this.xmlNodeToJSON(node.childNodes[i]));
- }
- }
- return t;
- }
-
-/**
- * @desc: Call wrapper
- * @type: private
- * @param: funcObject - action handler
- * @param: dhtmlObject - user data
- * @returns: function handler
- * @topic: 0
- */
-function callerFunction(funcObject, dhtmlObject){
- this.handler=function(e){
- if (!e)
- e=window.event;
- funcObject(e, dhtmlObject);
- return true;
- };
- return this.handler;
-};
-
-/**
- * @desc: Calculate absolute position of html object
- * @type: private
- * @param: htmlObject - html object
- * @topic: 0
- */
-function getAbsoluteLeft(htmlObject){
- return getOffset(htmlObject).left;
-}
-/**
- * @desc: Calculate absolute position of html object
- * @type: private
- * @param: htmlObject - html object
- * @topic: 0
- */
-function getAbsoluteTop(htmlObject){
- return getOffset(htmlObject).top;
-}
-
-function getOffsetSum(elem) {
- var top=0, left=0;
- while(elem) {
- top = top + parseInt(elem.offsetTop);
- left = left + parseInt(elem.offsetLeft);
- elem = elem.offsetParent;
- }
- return {top: top, left: left};
-}
-function getOffsetRect(elem) {
- var box = elem.getBoundingClientRect();
- var body = document.body;
- var docElem = document.documentElement;
- var scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;
- var scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;
- var clientTop = docElem.clientTop || body.clientTop || 0;
- var clientLeft = docElem.clientLeft || body.clientLeft || 0;
- var top = box.top + scrollTop - clientTop;
- var left = box.left + scrollLeft - clientLeft;
- return { top: Math.round(top), left: Math.round(left) };
-}
-function getOffset(elem) {
- if (elem.getBoundingClientRect && !_isChrome) {
- return getOffsetRect(elem);
- } else {
- return getOffsetSum(elem);
- }
-}
-
-/**
-* @desc: Convert string to it boolean representation
-* @type: private
-* @param: inputString - string for covertion
-* @topic: 0
-*/
-function convertStringToBoolean(inputString){
- if (typeof (inputString) == "string")
- inputString=inputString.toLowerCase();
-
- switch (inputString){
- case "1":
- case "true":
- case "yes":
- case "y":
- case 1:
- case true:
- return true;
- break;
-
- default: return false;
- }
-}
-
-/**
-* @desc: find out what symbol to use as url param delimiters in further params
-* @type: private
-* @param: str - current url string
-* @topic: 0
-*/
-function getUrlSymbol(str){
- if (str.indexOf("?") != -1)
- return "&"
- else
- return "?"
-}
-
-function dhtmlDragAndDropObject(){
- if (window.dhtmlDragAndDrop)
- return window.dhtmlDragAndDrop;
-
- this.lastLanding=0;
- this.dragNode=0;
- this.dragStartNode=0;
- this.dragStartObject=0;
- this.tempDOMU=null;
- this.tempDOMM=null;
- this.waitDrag=0;
- window.dhtmlDragAndDrop=this;
-
- return this;
-};
-
-dhtmlDragAndDropObject.prototype.removeDraggableItem=function(htmlNode){
- htmlNode.onmousedown=null;
- htmlNode.dragStarter=null;
- htmlNode.dragLanding=null;
-}
-dhtmlDragAndDropObject.prototype.addDraggableItem=function(htmlNode, dhtmlObject){
- htmlNode.onmousedown=this.preCreateDragCopy;
- htmlNode.dragStarter=dhtmlObject;
- this.addDragLanding(htmlNode, dhtmlObject);
-}
-dhtmlDragAndDropObject.prototype.addDragLanding=function(htmlNode, dhtmlObject){
- htmlNode.dragLanding=dhtmlObject;
-}
-dhtmlDragAndDropObject.prototype.preCreateDragCopy=function(e){
- if ((e||event) && (e||event).button == 2)
- return;
-
- if (window.dhtmlDragAndDrop.waitDrag){
- window.dhtmlDragAndDrop.waitDrag=0;
- document.body.onmouseup=window.dhtmlDragAndDrop.tempDOMU;
- document.body.onmousemove=window.dhtmlDragAndDrop.tempDOMM;
- return false;
- }
-
- window.dhtmlDragAndDrop.waitDrag=1;
- window.dhtmlDragAndDrop.tempDOMU=document.body.onmouseup;
- window.dhtmlDragAndDrop.tempDOMM=document.body.onmousemove;
- window.dhtmlDragAndDrop.dragStartNode=this;
- window.dhtmlDragAndDrop.dragStartObject=this.dragStarter;
- document.body.onmouseup=window.dhtmlDragAndDrop.preCreateDragCopy;
- document.body.onmousemove=window.dhtmlDragAndDrop.callDrag;
- window.dhtmlDragAndDrop.downtime = new Date().valueOf();
-
-
- if ((e)&&(e.preventDefault)){
- e.preventDefault();
- return false;
- }
- return false;
-};
-dhtmlDragAndDropObject.prototype.callDrag=function(e){
- if (!e)
- e=window.event;
- dragger=window.dhtmlDragAndDrop;
- if ((new Date()).valueOf()-dragger.downtime<100) return;
-
- if ((e.button == 0)&&(_isIE))
- return dragger.stopDrag();
-
- if (!dragger.dragNode&&dragger.waitDrag){
- dragger.dragNode=dragger.dragStartObject._createDragNode(dragger.dragStartNode, e);
-
- if (!dragger.dragNode)
- return dragger.stopDrag();
-
- dragger.dragNode.onselectstart=function(){return false;}
- dragger.gldragNode=dragger.dragNode;
- document.body.appendChild(dragger.dragNode);
- document.body.onmouseup=dragger.stopDrag;
- dragger.waitDrag=0;
- dragger.dragNode.pWindow=window;
- dragger.initFrameRoute();
- }
-
- if (dragger.dragNode.parentNode != window.document.body){
- var grd = dragger.gldragNode;
-
- if (dragger.gldragNode.old)
- grd=dragger.gldragNode.old;
-
- //if (!document.all) dragger.calculateFramePosition();
- grd.parentNode.removeChild(grd);
- var oldBody = dragger.dragNode.pWindow;
-
- // var oldp=dragger.dragNode.parentObject;
- if (_isIE){
- var div = document.createElement("Div");
- div.innerHTML=dragger.dragNode.outerHTML;
- dragger.dragNode=div.childNodes[0];
- } else
- dragger.dragNode=dragger.dragNode.cloneNode(true);
-
- dragger.dragNode.pWindow=window;
- // dragger.dragNode.parentObject=oldp;
-
- dragger.gldragNode.old=dragger.dragNode;
- document.body.appendChild(dragger.dragNode);
- oldBody.dhtmlDragAndDrop.dragNode=dragger.dragNode;
- }
-
- dragger.dragNode.style.left=e.clientX+15+(dragger.fx
- ? dragger.fx*(-1)
- : 0)
- +(document.body.scrollLeft||document.documentElement.scrollLeft)+"px";
- dragger.dragNode.style.top=e.clientY+3+(dragger.fy
- ? dragger.fy*(-1)
- : 0)
- +(document.body.scrollTop||document.documentElement.scrollTop)+"px";
-
- if (!e.srcElement)
- var z = e.target;
- else
- z=e.srcElement;
- dragger.checkLanding(z, e);
-}
-
-dhtmlDragAndDropObject.prototype.calculateFramePosition=function(n){
- //this.fx = 0, this.fy = 0;
- if (window.name){
- var el = parent.frames[window.name].frameElement.offsetParent;
- var fx = 0;
- var fy = 0;
-
- while (el){
- fx+=el.offsetLeft;
- fy+=el.offsetTop;
- el=el.offsetParent;
- }
-
- if ((parent.dhtmlDragAndDrop)){
- var ls = parent.dhtmlDragAndDrop.calculateFramePosition(1);
- fx+=ls.split('_')[0]*1;
- fy+=ls.split('_')[1]*1;
- }
-
- if (n)
- return fx+"_"+fy;
- else
- this.fx=fx;
- this.fy=fy;
- }
- return "0_0";
-}
-dhtmlDragAndDropObject.prototype.checkLanding=function(htmlObject, e){
- if ((htmlObject)&&(htmlObject.dragLanding)){
- if (this.lastLanding)
- this.lastLanding.dragLanding._dragOut(this.lastLanding);
- this.lastLanding=htmlObject;
- this.lastLanding=this.lastLanding.dragLanding._dragIn(this.lastLanding, this.dragStartNode, e.clientX,
- e.clientY, e);
- this.lastLanding_scr=(_isIE ? e.srcElement : e.target);
- } else {
- if ((htmlObject)&&(htmlObject.tagName != "BODY"))
- this.checkLanding(htmlObject.parentNode, e);
- else {
- if (this.lastLanding)
- this.lastLanding.dragLanding._dragOut(this.lastLanding, e.clientX, e.clientY, e);
- this.lastLanding=0;
-
- if (this._onNotFound)
- this._onNotFound();
- }
- }
-}
-dhtmlDragAndDropObject.prototype.stopDrag=function(e, mode){
- dragger=window.dhtmlDragAndDrop;
-
- if (!mode){
- dragger.stopFrameRoute();
- var temp = dragger.lastLanding;
- dragger.lastLanding=null;
-
- if (temp)
- temp.dragLanding._drag(dragger.dragStartNode, dragger.dragStartObject, temp, (_isIE
- ? event.srcElement
- : e.target));
- }
- dragger.lastLanding=null;
-
- if ((dragger.dragNode)&&(dragger.dragNode.parentNode == document.body))
- dragger.dragNode.parentNode.removeChild(dragger.dragNode);
- dragger.dragNode=0;
- dragger.gldragNode=0;
- dragger.fx=0;
- dragger.fy=0;
- dragger.dragStartNode=0;
- dragger.dragStartObject=0;
- document.body.onmouseup=dragger.tempDOMU;
- document.body.onmousemove=dragger.tempDOMM;
- dragger.tempDOMU=null;
- dragger.tempDOMM=null;
- dragger.waitDrag=0;
-}
-
-dhtmlDragAndDropObject.prototype.stopFrameRoute=function(win){
- if (win)
- window.dhtmlDragAndDrop.stopDrag(1, 1);
-
- for (var i = 0; i < window.frames.length; i++){
- try{
- if ((window.frames[i] != win)&&(window.frames[i].dhtmlDragAndDrop))
- window.frames[i].dhtmlDragAndDrop.stopFrameRoute(window);
- } catch(e){}
- }
-
- try{
- if ((parent.dhtmlDragAndDrop)&&(parent != window)&&(parent != win))
- parent.dhtmlDragAndDrop.stopFrameRoute(window);
- } catch(e){}
-}
-dhtmlDragAndDropObject.prototype.initFrameRoute=function(win, mode){
- if (win){
- window.dhtmlDragAndDrop.preCreateDragCopy({});
- window.dhtmlDragAndDrop.dragStartNode=win.dhtmlDragAndDrop.dragStartNode;
- window.dhtmlDragAndDrop.dragStartObject=win.dhtmlDragAndDrop.dragStartObject;
- window.dhtmlDragAndDrop.dragNode=win.dhtmlDragAndDrop.dragNode;
- window.dhtmlDragAndDrop.gldragNode=win.dhtmlDragAndDrop.dragNode;
- window.document.body.onmouseup=window.dhtmlDragAndDrop.stopDrag;
- window.waitDrag=0;
-
- if (((!_isIE)&&(mode))&&((!_isFF)||(_FFrv < 1.8)))
- window.dhtmlDragAndDrop.calculateFramePosition();
- }
- try{
- if ((parent.dhtmlDragAndDrop)&&(parent != window)&&(parent != win))
- parent.dhtmlDragAndDrop.initFrameRoute(window);
- }catch(e){}
-
- for (var i = 0; i < window.frames.length; i++){
- try{
- if ((window.frames[i] != win)&&(window.frames[i].dhtmlDragAndDrop))
- window.frames[i].dhtmlDragAndDrop.initFrameRoute(window, ((!win||mode) ? 1 : 0));
- } catch(e){}
- }
-}
-
-_isFF = false;
-_isIE = false;
-_isOpera = false;
-_isKHTML = false;
-_isMacOS = false;
-_isChrome = false;
-_KHTMLrv = false;
-_OperaRv = false;
-_FFrv = false;
-
-if (navigator.userAgent.indexOf('Macintosh') != -1)
- _isMacOS=true;
-
-
-if (navigator.userAgent.toLowerCase().indexOf('chrome')>-1)
- _isChrome=true;
-
-if ((navigator.userAgent.indexOf('Safari') != -1)||(navigator.userAgent.indexOf('Konqueror') != -1)){
- var _KHTMLrv = parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf('Safari')+7, 5));
-
- if (_KHTMLrv > 525){ //mimic FF behavior for Safari 3.1+
- _isFF=true;
- var _FFrv = 1.9;
- } else
- _isKHTML=true;
-} else if (navigator.userAgent.indexOf('Opera') != -1){
- _isOpera=true;
- _OperaRv=parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf('Opera')+6, 3));
-}
-
-
-else if (navigator.appName.indexOf("Microsoft") != -1){
- _isIE=true;
- if (navigator.appVersion.indexOf("MSIE 8.0")!= -1 && document.compatMode != "BackCompat") _isIE=8;
-} else {
- _isFF=true;
- var _FFrv = parseFloat(navigator.userAgent.split("rv:")[1])
-}
-
-
-//multibrowser Xpath processor
-dtmlXMLLoaderObject.prototype.doXPath=function(xpathExp, docObj, namespace, result_type){
- if (_isKHTML || (!_isIE && !window.XPathResult))
- return this.doXPathOpera(xpathExp, docObj);
-
- if (_isIE){ //IE
- if (!docObj)
- if (!this.xmlDoc.nodeName)
- docObj=this.xmlDoc.responseXML
- else
- docObj=this.xmlDoc;
-
- if (!docObj)
- dhtmlxError.throwError("LoadXML", "Incorrect XML", [
- (docObj||this.xmlDoc),
- this.mainObject
- ]);
-
- if (namespace != null)
- docObj.setProperty("SelectionNamespaces", "xmlns:xsl='"+namespace+"'"); //
-
- if (result_type == 'single'){
- return docObj.selectSingleNode(xpathExp);
- }
- else {
- return docObj.selectNodes(xpathExp)||new Array(0);
- }
- } else { //Mozilla
- var nodeObj = docObj;
-
- if (!docObj){
- if (!this.xmlDoc.nodeName){
- docObj=this.xmlDoc.responseXML
- }
- else {
- docObj=this.xmlDoc;
- }
- }
-
- if (!docObj)
- dhtmlxError.throwError("LoadXML", "Incorrect XML", [
- (docObj||this.xmlDoc),
- this.mainObject
- ]);
-
- if (docObj.nodeName.indexOf("document") != -1){
- nodeObj=docObj;
- }
- else {
- nodeObj=docObj;
- docObj=docObj.ownerDocument;
- }
- var retType = XPathResult.ANY_TYPE;
-
- if (result_type == 'single')
- retType=XPathResult.FIRST_ORDERED_NODE_TYPE
- var rowsCol = new Array();
- var col = docObj.evaluate(xpathExp, nodeObj, function(pref){
- return namespace
- }, retType, null);
-
- if (retType == XPathResult.FIRST_ORDERED_NODE_TYPE){
- return col.singleNodeValue;
- }
- var thisColMemb = col.iterateNext();
-
- while (thisColMemb){
- rowsCol[rowsCol.length]=thisColMemb;
- thisColMemb=col.iterateNext();
- }
- return rowsCol;
- }
-}
-
-function _dhtmlxError(type, name, params){
- if (!this.catches)
- this.catches=new Array();
-
- return this;
-}
-
-_dhtmlxError.prototype.catchError=function(type, func_name){
- this.catches[type]=func_name;
-}
-_dhtmlxError.prototype.throwError=function(type, name, params){
- if (this.catches[type])
- return this.catches[type](type, name, params);
-
- if (this.catches["ALL"])
- return this.catches["ALL"](type, name, params);
-
- alert("Error type: "+arguments[0]+"\nDescription: "+arguments[1]);
- return null;
-}
-
-window.dhtmlxError=new _dhtmlxError();
-
-
-//opera fake, while 9.0 not released
-//multibrowser Xpath processor
-dtmlXMLLoaderObject.prototype.doXPathOpera=function(xpathExp, docObj){
- //this is fake for Opera
- var z = xpathExp.replace(/[\/]+/gi, "/").split('/');
- var obj = null;
- var i = 1;
-
- if (!z.length)
- return [];
-
- if (z[0] == ".")
- obj=[docObj]; else if (z[0] == ""){
- obj=(this.xmlDoc.responseXML||this.xmlDoc).getElementsByTagName(z[i].replace(/\[[^\]]*\]/g, ""));
- i++;
- } else
- return [];
-
- for (i; i < z.length; i++)obj=this._getAllNamedChilds(obj, z[i]);
-
- if (z[i-1].indexOf("[") != -1)
- obj=this._filterXPath(obj, z[i-1]);
- return obj;
-}
-
-dtmlXMLLoaderObject.prototype._filterXPath=function(a, b){
- var c = new Array();
- var b = b.replace(/[^\[]*\[\@/g, "").replace(/[\[\]\@]*/g, "");
-
- for (var i = 0; i < a.length; i++)
- if (a[i].getAttribute(b))
- c[c.length]=a[i];
-
- return c;
-}
-dtmlXMLLoaderObject.prototype._getAllNamedChilds=function(a, b){
- var c = new Array();
-
- if (_isKHTML)
- b=b.toUpperCase();
-
- for (var i = 0; i < a.length; i++)for (var j = 0; j < a[i].childNodes.length; j++){
- if (_isKHTML){
- if (a[i].childNodes[j].tagName&&a[i].childNodes[j].tagName.toUpperCase() == b)
- c[c.length]=a[i].childNodes[j];
- }
-
- else if (a[i].childNodes[j].tagName == b)
- c[c.length]=a[i].childNodes[j];
- }
-
- return c;
-}
-
-function dhtmlXHeir(a, b){
- for (var c in b)
- if (typeof (b[c]) == "function")
- a[c]=b[c];
- return a;
-}
-
-function dhtmlxEvent(el, event, handler){
- if (el.addEventListener)
- el.addEventListener(event, handler, false);
-
- else if (el.attachEvent)
- el.attachEvent("on"+event, handler);
-}
-
-//============= XSL Extension ===================================
-
-dtmlXMLLoaderObject.prototype.xslDoc=null;
-dtmlXMLLoaderObject.prototype.setXSLParamValue=function(paramName, paramValue, xslDoc){
- if (!xslDoc)
- xslDoc=this.xslDoc
-
- if (xslDoc.responseXML)
- xslDoc=xslDoc.responseXML;
- var item =
- this.doXPath("/xsl:stylesheet/xsl:variable[@name='"+paramName+"']", xslDoc,
- "http:/\/www.w3.org/1999/XSL/Transform", "single");
-
- if (item != null)
- item.firstChild.nodeValue=paramValue
-}
-dtmlXMLLoaderObject.prototype.doXSLTransToObject=function(xslDoc, xmlDoc){
- if (!xslDoc)
- xslDoc=this.xslDoc;
-
- if (xslDoc.responseXML)
- xslDoc=xslDoc.responseXML
-
- if (!xmlDoc)
- xmlDoc=this.xmlDoc;
-
- if (xmlDoc.responseXML)
- xmlDoc=xmlDoc.responseXML
-
- //MOzilla
- if (!_isIE){
- if (!this.XSLProcessor){
- this.XSLProcessor=new XSLTProcessor();
- this.XSLProcessor.importStylesheet(xslDoc);
- }
- var result = this.XSLProcessor.transformToDocument(xmlDoc);
- } else {
- var result = new ActiveXObject("Msxml2.DOMDocument.3.0");
- try{
- xmlDoc.transformNodeToObject(xslDoc, result);
- }catch(e){
- result = xmlDoc.transformNode(xslDoc);
- }
- }
- return result;
-}
-
-dtmlXMLLoaderObject.prototype.doXSLTransToString=function(xslDoc, xmlDoc){
- var res = this.doXSLTransToObject(xslDoc, xmlDoc);
- if(typeof(res)=="string")
- return res;
- return this.doSerialization(res);
-}
-
-dtmlXMLLoaderObject.prototype.doSerialization=function(xmlDoc){
- if (!xmlDoc)
- xmlDoc=this.xmlDoc;
- if (xmlDoc.responseXML)
- xmlDoc=xmlDoc.responseXML
- if (!_isIE){
- var xmlSerializer = new XMLSerializer();
- return xmlSerializer.serializeToString(xmlDoc);
- } else
- return xmlDoc.xml;
-}
-
-/**
-* @desc:
-* @type: private
-*/
-dhtmlxEventable=function(obj){
- obj.dhx_SeverCatcherPath="";
- obj.attachEvent=function(name, catcher, callObj){
- name='ev_'+name.toLowerCase();
- if (!this[name])
- this[name]=new this.eventCatcher(callObj||this);
-
- return(name+':'+this[name].addEvent(catcher)); //return ID (event name & event ID)
- }
- obj.callEvent=function(name, arg0){
- name='ev_'+name.toLowerCase();
- if (this[name])
- return this[name].apply(this, arg0);
- return true;
- }
- obj.checkEvent=function(name){
- return (!!this['ev_'+name.toLowerCase()])
- }
- obj.eventCatcher=function(obj){
- var dhx_catch = [];
- var z = function(){
- var res = true;
- for (var i = 0; i < dhx_catch.length; i++){
- if (dhx_catch[i] != null){
- var zr = dhx_catch[i].apply(obj, arguments);
- res=res&&zr;
- }
- }
- return res;
- }
- z.addEvent=function(ev){
- if (typeof (ev) != "function")
- ev=eval(ev);
- if (ev)
- return dhx_catch.push(ev)-1;
- return false;
- }
- z.removeEvent=function(id){
- dhx_catch[id]=null;
- }
- return z;
- }
- obj.detachEvent=function(id){
- if (id != false){
- var list = id.split(':'); //get EventName and ID
- this[list[0]].removeEvent(list[1]); //remove event
- }
- }
- obj.detachAllEvents = function(){
- for (var name in this){
- if (name.indexOf("ev_")==0)
- delete this[name];
- }
- }
-}
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/dhtmlxdataprocessor.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/dhtmlxdataprocessor.js deleted file mode 100644 index 4a4143f947f..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/dhtmlxdataprocessor.js +++ /dev/null @@ -1,587 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -/**
- * @desc: constructor, data processor object
- * @param: serverProcessorURL - url used for update
- * @type: public
- */
-function dataProcessor(serverProcessorURL){
- this.serverProcessor = serverProcessorURL;
- this.action_param="!nativeeditor_status";
-
- this.object = null;
- this.updatedRows = []; //ids of updated rows
-
- this.autoUpdate = true;
- this.updateMode = "cell";
- this._tMode="GET";
- this.post_delim = "_";
-
- this._waitMode=0;
- this._in_progress={};//?
- this._invalid={};
- this.mandatoryFields=[];
- this.messages=[];
-
- this.styles={
- updated:"font-weight:bold;",
- inserted:"font-weight:bold;",
- deleted:"text-decoration : line-through;",
- invalid:"background-color:FFE0E0;",
- invalid_cell:"border-bottom:2px solid red;",
- error:"color:red;",
- clear:"font-weight:normal;text-decoration:none;"
- };
-
- this.enableUTFencoding(true);
- dhtmlxEventable(this);
-
- return this;
- }
-
-dataProcessor.prototype={
- /**
- * @desc: select GET or POST transaction model
- * @param: mode - GET/POST
- * @param: total - true/false - send records row by row or all at once (for grid only)
- * @type: public
- */
- setTransactionMode:function(mode,total){
- this._tMode=mode;
- this._tSend=total;
- },
- escape:function(data){
- if (this._utf)
- return encodeURIComponent(data);
- else
- return escape(data);
- },
- /**
- * @desc: allows to set escaping mode
- * @param: true - utf based escaping, simple - use current page encoding
- * @type: public
- */
- enableUTFencoding:function(mode){
- this._utf=convertStringToBoolean(mode);
- },
- /**
- * @desc: allows to define, which column may trigger update
- * @param: val - array or list of true/false values
- * @type: public
- */
- setDataColumns:function(val){
- this._columns=(typeof val == "string")?val.split(","):val;
- },
- /**
- * @desc: get state of updating
- * @returns: true - all in sync with server, false - some items not updated yet.
- * @type: public
- */
- getSyncState:function(){
- return !this.updatedRows.length;
- },
- /**
- * @desc: enable/disable named field for data syncing, will use column ids for grid
- * @param: mode - true/false
- * @type: public
- */
- enableDataNames:function(mode){
- this._endnm=convertStringToBoolean(mode);
- },
- /**
- * @desc: enable/disable mode , when only changed fields and row id send to the server side, instead of all fields in default mode
- * @param: mode - true/false
- * @type: public
- */
- enablePartialDataSend:function(mode){
- this._changed=convertStringToBoolean(mode);
- },
- /**
- * @desc: set if rows should be send to server automaticaly
- * @param: mode - "row" - based on row selection changed, "cell" - based on cell editing finished, "off" - manual data sending
- * @type: public
- */
- setUpdateMode:function(mode,dnd){
- this.autoUpdate = (mode=="cell");
- this.updateMode = mode;
- this.dnd=dnd;
- },
- ignore:function(code,master){
- this._silent_mode=true;
- code.call(master||window);
- this._silent_mode=false;
- },
- /**
- * @desc: mark row as updated/normal. check mandatory fields,initiate autoupdate (if turned on)
- * @param: rowId - id of row to set update-status for
- * @param: state - true for "updated", false for "not updated"
- * @param: mode - update mode name
- * @type: public
- */
- setUpdated:function(rowId,state,mode){
- if (this._silent_mode) return;
- var ind=this.findRow(rowId);
-
- mode=mode||"updated";
- var existing = this.obj.getUserData(rowId,this.action_param);
- if (existing && mode == "updated") mode=existing;
- if (state){
- this.set_invalid(rowId,false); //clear previous error flag
- this.updatedRows[ind]=rowId;
- this.obj.setUserData(rowId,this.action_param,mode);
- if (this._in_progress[rowId])
- this._in_progress[rowId]="wait";
- } else{
- if (!this.is_invalid(rowId)){
- this.updatedRows.splice(ind,1);
- this.obj.setUserData(rowId,this.action_param,"");
- }
- }
-
- //clear changed flag
- if (!state)
- this._clearUpdateFlag(rowId);
-
- this.markRow(rowId,state,mode);
- if (state && this.autoUpdate) this.sendData(rowId);
- },
- _clearUpdateFlag:function(id){},
- markRow:function(id,state,mode){
- var str="";
- var invalid=this.is_invalid(id);
- if (invalid){
- str=this.styles[invalid];
- state=true;
- }
- if (this.callEvent("onRowMark",[id,state,mode,invalid])){
- //default logic
- str=this.styles[state?mode:"clear"]+str;
-
- this.obj[this._methods[0]](id,str);
-
- if (invalid && invalid.details){
- str+=this.styles[invalid+"_cell"];
- for (var i=0; i < invalid.details.length; i++)
- if (invalid.details[i])
- this.obj[this._methods[1]](id,i,str);
- }
- }
- },
- getState:function(id){
- return this.obj.getUserData(id,this.action_param);
- },
- is_invalid:function(id){
- return this._invalid[id];
- },
- set_invalid:function(id,mode,details){
- if (details) mode={value:mode, details:details, toString:function(){ return this.value.toString(); }};
- this._invalid[id]=mode;
- },
- /**
- * @desc: check mandatory fields and varify values of cells, initiate update (if specified)
- * @param: rowId - id of row to set update-status for
- * @type: public
- */
- checkBeforeUpdate:function(rowId){
- return true;
- },
- /**
- * @desc: send row(s) values to server
- * @param: rowId - id of row which data to send. If not specified, then all "updated" rows will be send
- * @type: public
- */
- sendData:function(rowId){
- if (this._waitMode && (this.obj.mytype=="tree" || this.obj._h2)) return;
- if (this.obj.editStop) this.obj.editStop();
-
-
- if(typeof rowId == "undefined" || this._tSend) return this.sendAllData();
- if (this._in_progress[rowId]) return false;
-
- this.messages=[];
- if (!this.checkBeforeUpdate(rowId) && this.callEvent("onValidatationError",[rowId,this.messages])) return false;
- this._beforeSendData(this._getRowData(rowId),rowId);
- },
- _beforeSendData:function(data,rowId){
- if (!this.callEvent("onBeforeUpdate",[rowId,this.getState(rowId),data])) return false;
- this._sendData(data,rowId);
- },
- serialize:function(data, id){
- if (typeof data == "string")
- return data;
- if (typeof id != "undefined")
- return this.serialize_one(data,"");
- else{
- var stack = [];
- var keys = [];
- for (var key in data)
- if (data.hasOwnProperty(key)){
- stack.push(this.serialize_one(data[key],key+this.post_delim));
- keys.push(key);
- }
- stack.push("ids="+this.escape(keys.join(",")));
- return stack.join("&");
- }
- },
- serialize_one:function(data, pref){
- if (typeof data == "string")
- return data;
- var stack = [];
- for (var key in data)
- if (data.hasOwnProperty(key))
- stack.push(this.escape((pref||"")+key)+"="+this.escape(data[key]));
- return stack.join("&");
- },
- _sendData:function(a1,rowId){
- if (!a1) return; //nothing to send
- if (!this.callEvent("onBeforeDataSending",rowId?[rowId,this.getState(rowId),a1]:[null, null, a1])) return false;
-
- if (rowId)
- this._in_progress[rowId]=(new Date()).valueOf();
- var a2=new dtmlXMLLoaderObject(this.afterUpdate,this,true);
-
- var a3 = this.serverProcessor+(this._user?(getUrlSymbol(this.serverProcessor)+["dhx_user="+this._user,"dhx_version="+this.obj.getUserData(0,"version")].join("&")):"");
-
- if (this._tMode!="POST")
- a2.loadXML(a3+((a3.indexOf("?")!=-1)?"&":"?")+this.serialize(a1,rowId));
- else
- a2.loadXML(a3,true,this.serialize(a1,rowId));
-
- this._waitMode++;
- },
- sendAllData:function(){
- if (!this.updatedRows.length) return;
-
- this.messages=[]; var valid=true;
- for (var i=0; i<this.updatedRows.length; i++)
- valid&=this.checkBeforeUpdate(this.updatedRows[i]);
- if (!valid && !this.callEvent("onValidatationError",["",this.messages])) return false;
-
- if (this._tSend)
- this._sendData(this._getAllData());
- else
- for (var i=0; i<this.updatedRows.length; i++)
- if (!this._in_progress[this.updatedRows[i]]){
- if (this.is_invalid(this.updatedRows[i])) continue;
- this._beforeSendData(this._getRowData(this.updatedRows[i]),this.updatedRows[i]);
- if (this._waitMode && (this.obj.mytype=="tree" || this.obj._h2)) return; //block send all for tree
- }
- },
-
-
-
-
-
-
-
-
- _getAllData:function(rowId){
- var out={};
- var has_one = false;
- for(var i=0;i<this.updatedRows.length;i++){
- var id=this.updatedRows[i];
- if (this._in_progress[id] || this.is_invalid(id)) continue;
- if (!this.callEvent("onBeforeUpdate",[id,this.getState(id)])) continue;
- out[id]=this._getRowData(id,id+this.post_delim);
- has_one = true;
- this._in_progress[id]=(new Date()).valueOf();
- }
- return has_one?out:null;
- },
-
-
- /**
- * @desc: specify column which value should be varified before sending to server
- * @param: ind - column index (0 based)
- * @param: verifFunction - function (object) which should verify cell value (if not specified, then value will be compared to empty string). Two arguments will be passed into it: value and column name
- * @type: public
- */
- setVerificator:function(ind,verifFunction){
- this.mandatoryFields[ind] = verifFunction||(function(value){return (value!="");});
- },
- /**
- * @desc: remove column from list of those which should be verified
- * @param: ind - column Index (0 based)
- * @type: public
- */
- clearVerificator:function(ind){
- this.mandatoryFields[ind] = false;
- },
-
-
-
-
-
- findRow:function(pattern){
- var i=0;
- for(i=0;i<this.updatedRows.length;i++)
- if(pattern==this.updatedRows[i]) break;
- return i;
- },
-
-
-
-
-
-
-
-
-
-
-
- /**
- * @desc: define custom actions
- * @param: name - name of action, same as value of action attribute
- * @param: handler - custom function, which receives a XMl response content for action
- * @type: private
- */
- defineAction:function(name,handler){
- if (!this._uActions) this._uActions=[];
- this._uActions[name]=handler;
- },
-
-
-
-
- /**
-* @desc: used in combination with setOnBeforeUpdateHandler to create custom client-server transport system
-* @param: sid - id of item before update
-* @param: tid - id of item after up0ate
-* @param: action - action name
-* @type: public
-* @topic: 0
-*/
- afterUpdateCallback:function(sid, tid, action, btag) {
- var marker = sid;
- var correct=(action!="error" && action!="invalid");
- if (!correct) this.set_invalid(sid,action);
- if ((this._uActions)&&(this._uActions[action])&&(!this._uActions[action](btag)))
- return (delete this._in_progress[marker]);
-
- if (this._in_progress[marker]!="wait")
- this.setUpdated(sid, false);
-
- var soid = sid;
-
- switch (action) {
- case "update":
- case "updated":
- case "inserted":
- case "insert":
- if (tid != sid) {
- this.obj[this._methods[2]](sid, tid);
- sid = tid;
- }
- break;
- case "delete":
- case "deleted":
- this.obj.setUserData(sid, this.action_param, "true_deleted");
- this.obj[this._methods[3]](sid);
- delete this._in_progress[marker];
- return this.callEvent("onAfterUpdate", [sid, action, tid, btag]);
- break;
- }
-
- if (this._in_progress[marker]!="wait"){
- if (correct) this.obj.setUserData(sid, this.action_param,'');
- delete this._in_progress[marker];
- } else {
- delete this._in_progress[marker];
- this.setUpdated(tid,true,this.obj.getUserData(sid,this.action_param));
- }
-
- this.callEvent("onAfterUpdate", [sid, action, tid, btag]);
- },
-
- /**
- * @desc: response from server
- * @param: xml - XMLLoader object with response XML
- * @type: private
- */
- afterUpdate:function(that,b,c,d,xml){
- xml.getXMLTopNode("data"); //fix incorrect content type in IE
- if (!xml.xmlDoc.responseXML) return;
- var atag=xml.doXPath("//data/action");
- for (var i=0; i<atag.length; i++){
- var btag=atag[i];
- var action = btag.getAttribute("type");
- var sid = btag.getAttribute("sid");
- var tid = btag.getAttribute("tid");
-
- that.afterUpdateCallback(sid,tid,action,btag);
- }
- that.finalizeUpdate();
- },
- finalizeUpdate:function(){
- if (this._waitMode) this._waitMode--;
-
- if ((this.obj.mytype=="tree" || this.obj._h2) && this.updatedRows.length)
- this.sendData();
- this.callEvent("onAfterUpdateFinish",[]);
- if (!this.updatedRows.length)
- this.callEvent("onFullSync",[]);
- },
-
-
-
-
-
- /**
- * @desc: initializes data-processor
- * @param: anObj - dhtmlxGrid object to attach this data-processor to
- * @type: public
- */
- init:function(anObj){
- this.obj = anObj;
- if (this.obj._dp_init)
- this.obj._dp_init(this);
- },
-
-
- setOnAfterUpdate:function(ev){
- this.attachEvent("onAfterUpdate",ev);
- },
- enableDebug:function(mode){
- },
- setOnBeforeUpdateHandler:function(func){
- this.attachEvent("onBeforeDataSending",func);
- },
-
-
-
- /*! starts autoupdate mode
- @param interval
- time interval for sending update requests
- */
- setAutoUpdate: function(interval, user) {
- interval = interval || 2000;
-
- this._user = user || (new Date()).valueOf();
- this._need_update = false;
- this._loader = null;
- this._update_busy = false;
-
- this.attachEvent("onAfterUpdate",function(sid,action,tid,xml_node){
- this.afterAutoUpdate(sid, action, tid, xml_node);
- });
- this.attachEvent("onFullSync",function(){
- this.fullSync();
- });
-
- var self = this;
- window.setInterval(function(){
- self.loadUpdate();
- }, interval);
- },
-
-
- /*! process updating request answer
- if status == collision version is depricated
- set flag for autoupdating immidiatly
- */
- afterAutoUpdate: function(sid, action, tid, xml_node) {
- if (action == 'collision') {
- this._need_update = true;
- return false;
- } else {
- return true;
- }
- },
-
-
- /*! callback function for onFillSync event
- call update function if it's need
- */
- fullSync: function() {
- if (this._need_update == true) {
- this._need_update = false;
- this.loadUpdate();
- }
- return true;
- },
-
-
- /*! sends query to the server and call callback function
- */
- getUpdates: function(url,callback){
- if (this._update_busy)
- return false;
- else
- this._update_busy = true;
-
- this._loader = this._loader || new dtmlXMLLoaderObject(true);
-
- this._loader.async=true;
- this._loader.waitCall=callback;
- this._loader.loadXML(url);
- },
-
-
- /*! returns xml node value
- @param node
- xml node
- */
- _v: function(node) {
- if (node.firstChild) return node.firstChild.nodeValue;
- return "";
- },
-
-
- /*! returns values array of xml nodes array
- @param arr
- array of xml nodes
- */
- _a: function(arr) {
- var res = [];
- for (var i=0; i < arr.length; i++) {
- res[i]=this._v(arr[i]);
- };
- return res;
- },
-
-
- /*! loads updates and processes them
- */
- loadUpdate: function(){
- var self = this;
- var version = this.obj.getUserData(0,"version");
- var url = this.serverProcessor+getUrlSymbol(this.serverProcessor)+["dhx_user="+this._user,"dhx_version="+version].join("&");
- url = url.replace("editing=true&","");
- this.getUpdates(url, function(){
- var vers = self._loader.doXPath("//userdata");
- self.obj.setUserData(0,"version",self._v(vers[0]));
-
- var upds = self._loader.doXPath("//update");
- if (upds.length){
- self._silent_mode = true;
-
- for (var i=0; i<upds.length; i++) {
- var status = upds[i].getAttribute('status');
- var id = upds[i].getAttribute('id');
- var parent = upds[i].getAttribute('parent');
- switch (status) {
- case 'inserted':
- self.callEvent("insertCallback",[upds[i], id, parent]);
- break;
- case 'updated':
- self.callEvent("updateCallback",[upds[i], id, parent]);
- break;
- case 'deleted':
- self.callEvent("deleteCallback",[upds[i], id, parent]);
- break;
- }
- }
-
- self._silent_mode = false;
- }
-
- self._update_busy = false;
- self = null;
- });
- }
-
-};
-
-//(c)dhtmlx ltd. www.dhtmlx.com
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/dhtmlxdataprocessor_debug.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/dhtmlxdataprocessor_debug.js deleted file mode 100644 index e26776e533a..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/dhtmlxdataprocessor_debug.js +++ /dev/null @@ -1,168 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -dataProcessor.prototype._o_init = dataProcessor.prototype.init;
-dataProcessor.prototype.init=function(obj){
- this._console=this._console||this._createConsole();
- this.attachEvent("onValidatationError",function(rowId){
- this._log("Validation error for ID="+(rowId||"[multiple]"));
- return true;
- });
- return this._o_init(obj);
-}
-
-dataProcessor.prototype._createConsole=function(){
- var c=document.createElement("DIV");
- c.style.cssText='width:450px; height:420px; overflow:auto; position:absolute; z-index:99999; background-color:white; top:0px; right:0px; border:1px dashed black; font-family:Tahoma; Font-size:10pt;';
- c.innerHTML="<div style='width:100%; background-color:gray; font-weight:bold; color:white;'><span style='cursor:pointer;float:right;' onclick='this.parentNode.parentNode.style.display=\"none\"'><sup>[close] </sup></span><span style='cursor:pointer;float:right;' onclick='this.parentNode.parentNode.childNodes[2].innerHTML=\"\"'><sup>[clear] </sup></span> DataProcessor</div><div style='width:100%; height:200px; overflow-Y:scroll;'> Current state</div><div style='width:100%; height:200px; overflow-Y:scroll;'> Log:</div>";
- if (document.body) document.body.insertBefore(c,document.body.firstChild);
- else dhtmlxEvent(window,"load",function(){
- document.body.insertBefore(c,document.body.firstChild);
- })
- dhtmlxEvent(window,"dblclick",function(){
- c.style.display='';
- })
- return c;
-}
-
-dataProcessor.prototype._error=function(data){
- this._log("<span style='color:red'>"+data+"</span>");
-}
-dataProcessor.prototype._log=function(data){
- var div=document.createElement("DIV");
- div.innerHTML = data;
- var parent=this._console.childNodes[2];
- parent.appendChild(div);
- parent.scrollTop=parent.scrollHeight;
-
- if (window.console && window.console.log)
- window.console.log("DataProcessor :: "+data.replace(" "," ").replace("<b>","").replace("</b>",""));
-
-}
-dataProcessor.prototype._updateStat=function(data){
- var data=[" Current state"];
- for(var i=0;i<this.updatedRows.length;i++)
- data.push(" ID:"+this.updatedRows[i]+" Status: "+(this.obj.getUserData(this.updatedRows[i],"!nativeeditor_status")||"updated")+", "+(this.is_invalid(this.updatedRows[i])||"valid"))
- this._console.childNodes[1].innerHTML=data.join("<br/>")+"<hr/>Current mode: "+this.updateMode;
-}
-dataProcessor.prototype.xml_analize=function(xml){
- if (_isFF){
- if (!xml.xmlDoc.responseXML)
- this._error("Not an XML, probably incorrect content type specified ( must be text/xml ), or some text output was started before XML data");
- else if (xml.xmlDoc.responseXML.firstChild.tagName=="parsererror")
- this._error(xml.xmlDoc.responseXML.firstChild.textContent);
- else return true;
- } else if (_isIE){
- if (xml.xmlDoc.responseXML.parseError.errorCode)
- this._error("XML error : "+xml.xmlDoc.responseXML.parseError.reason);
- else if (!xml.xmlDoc.responseXML.documentElement)
- this._error("Not an XML, probably incorrect content type specified ( must be text/xml ), or some text output was started before XML data");
- else return true;
- }
- return false;
-}
-
-dataProcessor.wrap=function(name,before,after){
- var d=dataProcessor.prototype;
- if (!d._wrap) d._wrap={};
- d._wrap[name]=d[name];
- d[name]=function(){
- if (before) before.apply(this,arguments);
- var res=d._wrap[name].apply(this,arguments);
- if (after) after.apply(this,[arguments,res]);
- return res;
- }
-};
-
-dataProcessor.wrap("setUpdated",function(rowId,state,mode){
- this._log(" row <b>"+rowId+"</b> "+(state?"marked":"unmarked")+" ["+(mode||"updated")+","+(this.is_invalid(rowId)||"valid")+"]");
-},function(){
- this._updateStat();
-});
-
-
-
-dataProcessor.wrap("sendData",function(rowId){
- if (rowId){
- this._log(" Initiating data sending for <b>"+rowId+"</b>");
- if (this.obj.mytype=="tree"){
- if (!this.obj._idpull[rowId])
- this._log(" Error! item with such ID not exists <b>"+rowId+"</b>");
- } else {
- if (this.rowsAr && !this.obj.rowsAr[rowId])
- this._log(" Error! row with such ID not exists <b>"+rowId+"</b>");
- }
- }
-},function(){
-
-});
-
-dataProcessor.wrap("sendAllData",function(){
- this._log(" Initiating data sending for <b>all</b> rows ");
-},function(){
-
-});
-dataProcessor.logSingle=function(data,id){
- var tdata = {};
- if (id)
- tdata[id] = data;
- else
- tdata = data;
-
- var url = [];
- for (var key in tdata) {
- url.push("<fieldset><legend>"+key+"</legend>");
- var suburl = [];
-
- for (var ikey in tdata[key])
- suburl.push(ikey+" = "+tdata[key][ikey]);
-
- url.push(suburl.join("<br>"));
- url.push("</fieldset>");
- }
- return url.join("");
-}
-dataProcessor.wrap("_sendData",function(data,rowId){
- if (rowId)
- this._log(" Sending in one-by-one mode, current ID = "+rowId);
- else
- this._log(" Sending all data at once");
- this._log(" Server url: "+this.serverProcessor+" <a onclick='this.parentNode.nextSibling.firstChild.style.display=\"block\"' href='#'>parameters</a>");
- var url = [];
- this._log("<blockquote style='display:none;'>"+dataProcessor.logSingle(data,rowId)+"<blockquote>");
-},function(){
-
-});
-
-
-dataProcessor.wrap("afterUpdate",function(that,b,c,d,xml){
- that._log(" Server response received <a onclick='this.nextSibling.style.display=\"block\"' href='#'>details</a><blockquote style='display:none'><code>"+(xml.xmlDoc.responseText||"").replace(/\&/g,"&").replace(/</g,"<").replace(/>/g,">")+"</code></blockquote>");
- if (!that.xml_analize(xml)) return;
- var atag=xml.doXPath("//data/action");
- if (!atag){
- that._log(" No actions found");
- var atag=xml.getXMLTopNode("data");
- if (!atag) that._log(" XML not valid");
- else that._log(" Incorrect content type - need to be text/xml");
- }
-},function(){
-
-});
-
-dataProcessor.wrap("afterUpdateCallback",function(sid,tid,action){
- if (this.obj.mytype=="tree"){
- if (!this.obj._idpull[sid]) this._log("Incorrect SID, item with such ID not exists in grid");
- } else {
- if (this.obj.rowsAr && !this.obj.rowsAr[sid]) this._log("Incorrect SID, row with such ID not exists in grid");
- }
- this._log(" Action: "+action+" SID:"+sid+" TID:"+tid);
-},function(){
-
-});
-
-
-
-
-
-
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/dhtmlxdataprocessor_jsonp.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/dhtmlxdataprocessor_jsonp.js deleted file mode 100644 index 19779666494..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/dhtmlxdataprocessor_jsonp.js +++ /dev/null @@ -1,57 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -if(dataProcessor) {
- dataProcessor.prototype.enableJSONP = function(mode) {
- if(mode) {
- this._jsonp_attach_id = this.attachEvent("onBeforeDataSending", function(rowId,rowIdState,a1){
- if (rowId)
- this._in_progress[rowId]=(new Date()).valueOf();
-
- var url = this.serverProcessor+(this._user?(getUrlSymbol(this.serverProcessor)+["dhx_user="+this._user,"dhx_version="+this.obj.getUserData(0,"version")].join("&")):"");
- url += ((url.indexOf("?")!=-1)?"&":"?")+this.serialize(a1,rowId);
-
- this._jsonp(url, [], function(data){
- var xml = new dtmlXMLLoaderObject(this.afterUpdate,this,true);
- xml.loadXMLString(data);
- this.afterUpdate(this, null, null, null, xml);
- }, this);
-
- this._waitMode++;
- return false;
- });
- }
- else {
- if(this._jsonp_attach_id)
- this.detachEvent(this._jsonp_attach_id);
- }
- };
- dataProcessor.prototype._jsonp = function(url, params, callback, master){
- var global_obj = "dataProcessor";
- var id = "dp_jsonp_"+new Date().valueOf();
- var script = document.createElement('script');
- script.id = id;
- script.type = 'text/javascript';
-
- var head = document.getElementsByTagName("head")[0];
-
- if (!params)
- params = {};
- params.jsonp = global_obj+"."+id; // would be called as dataProcessor.dp_jsonp_1938948394
- dataProcessor[id]=function(){
- callback.apply(master||window, arguments);
- script.parentNode.removeChild(script);
- callback = head = master = script = null;
- delete dataProcessor[id];
- };
-
- var vals = [];
- for (var key in params) vals.push(key+"="+encodeURIComponent(params[key]));
-
- url += (url.indexOf("?") == -1 ? "?" : "&")+vals.join("&");
-
- script.src = url ;
- head.appendChild(script);
- };
-}
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/dhtmlxscheduler.css b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/dhtmlxscheduler.css new file mode 100644 index 00000000000..e2b512bc030 --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/dhtmlxscheduler.css @@ -0,0 +1,1419 @@ +/* +This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in non-GPL project. Please contact sales@dhtmlx.com for details +*/ + +.dhtmlx_message_area{
+ position:fixed;
+ right:5px;
+ width:250px;
+ z-index:1000;
+}
+
+.dhtmlx-info{
+ min-width: 120px;
+ padding:4px 4px 4px 20px;
+ font-family:Tahoma;
+ z-index: 10000;
+
+ margin:5px;
+ margin-bottom:10px;
+
+ -webkit-transition: all .5s ease;
+ -moz-transition: all .5s ease;
+ -o-transition: all .5s ease;
+ transition: all .5s ease;
+}
+.dhtmlx-info.hidden{
+ height:0px;
+ padding:0px;
+ border-width:0px;
+ margin:0px;
+ overflow:hidden;
+}
+
+.dhtmlx_modal_box{
+ overflow:hidden;
+ display: inline-block;
+ min-width: 300px;
+ width: 300px;
+ text-align: center;
+ position:fixed;
+
+ background-color: #fff;
+ background:-webkit-linear-gradient(top, #ffffff 1%, #d0d0d0 99%);
+ background:-moz-linear-gradient(top, #ffffff 1%, #d0d0d0 99%);
+ box-shadow: 0px 0px 14px #888;
+
+ font-family: Tahoma;
+
+ z-index:20000;
+
+ border-radius:6px;
+ border: 1px solid #ffffff;
+}
+
+.dhtmlx_popup_title{
+ border-top-left-radius:5px;
+ border-top-right-radius:5px;
+
+ border-width:0px;
+
+ background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAoCAMAAAAIaGBFAAAAhFBMVEVwcHBubm5sbGxqampoaGhmZmZlZWVjY2NhYWFfX19dXV1bW1taWlpYWFhWVlZUVFRSUlJRUVFPT09NTU1LS0tJSUlHR0dGRkZERERCQkJAQEA+Pj49PT09PT0+Pj5AQEBBQUFDQ0NERERGRkZHR0dJSUlKSkpMTExMTEw5OTk5OTk5OTkny8YEAAAAQklEQVQImQXBCRJCAAAAwKVSQqdyjSPXNP7/QLsIhA6OTiJnF7GrRCpzc/fw9PKW+/gqlCq1RqvTG/yMJrPF6m/bAVEhAxxnHG0oAAAAAElFTkSuQmCC);
+ background-image: -webkit-linear-gradient(top, #707070 1%, #3d3d3d 70%, #4c4c4c 97%, #393939 97%);
+ background-image: -moz-linear-gradient(top, #707070 1%, #3d3d3d 70%, #4c4c4c 97%, #393939 97%);
+}
+
+.dhtmlx-info, .dhtmlx_popup_button, .dhtmlx_button{
+ user-select: none;
+ -webkit-user-select: none;
+ -moz-user-select:-moz-none;
+
+ cursor:pointer;
+}
+
+.dhtmlx_popup_text{
+ overflow:hidden;
+}
+
+.dhtmlx_popup_controls{
+ border-radius:6px;
+ padding:5px;
+}
+
+.dhtmlx_popup_button, .dhtmlx_button{
+ height: 30px;
+ line-height:30px;
+
+ display: inline-block;
+ margin: 0 5px;
+ border-radius: 6px;
+
+ color:#FFF;
+}
+.dhtmlx_popup_button{
+ min-width: 120px;
+}
+
+div.dhx_modal_cover {
+ background-color:#000;
+ cursor:default;
+
+ filter:alpha(opacity = 20);
+ opacity: 0.2;
+
+ position: fixed;
+ z-index:19999;
+ left: 0px; top: 0px;
+ width: 100%; height: 100%;
+
+ border: none;
+ zoom: 1;
+}
+
+.dhtmlx-info img, .dhtmlx_modal_box img{
+ float:left;
+ margin-right:20px;
+}
+
+.dhtmlx-alert-error .dhtmlx_popup_title, .dhtmlx-confirm-error .dhtmlx_popup_title{
+ background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAsCAIAAAArRUU2AAAATklEQVR4nIWLuw2AMBBDjVuQiBT2oWbRDATrnB0KQOJoqPzRe3BrHI6dcBASYREKovtK6/6DsDOX+stN+3H1YX9ciRgnYq5EWYhS2dftBIuLT4JyIrPCAAAAAElFTkSuQmCC);
+}
+.dhtmlx-alert-error, .dhtmlx-confirm-error {
+ border: 1px solid #ff0000;
+}
+
+/*Skin section*/
+.dhtmlx_button, .dhtmlx_popup_button{
+ box-shadow: 0px 0px 4px #888;
+ border:1px solid #838383;
+}
+.dhtmlx_button input, .dhtmlx_popup_button div{
+ border:1px solid #FFF;
+ background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAeCAMAAADaS4T1AAAAYFBMVEVwcHBtbW1ra2toaGhmZmZjY2NhYWFeXl5cXFxaWlpXV1dVVVVSUlJQUFBNTU1LS0tJSUlGRkZERERBQUE/Pz88PDw9PT0+Pj5AQEBCQkJDQ0NFRUVHR0dISEhKSkpMTEzqthaMAAAAMklEQVQImQXBhQ2AMAAAsOIMlwWH/8+kRSKVyRVKlVrQaHV6g9FktlhFm93hdLk9Xt8PIfgBvdUqyskAAAAASUVORK5CYII=);
+ background-image: -webkit-linear-gradient(top, #707070 1%, #3d3d3d 70%, #4c4c4c 99%);
+ background-image: -moz-linear-gradient(top, #707070 1%, #3d3d3d 70%, #4c4c4c 99%);
+
+ border-radius:6px;
+ font-size:15px;
+ font-weight:normal;
+ -moz-box-sizing:content-box;
+ box-sizing:content-box;
+
+ color:#fff; padding:0px; margin:0px;
+ vertical-align:top;
+
+ height:28px;
+ line-height:28px;
+}
+
+.dhtmlx_button input:focus, .dhtmlx_button input:active, .dhtmlx_popup_button div:active, .dhtmlx_popup_button div:focus{
+
+ background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAeCAMAAADaS4T1AAAAXVBMVEVwcHBubm5tbW1sbGxra2tpaWloaGhnZ2dmZmZlZWVjY2NiYmJhYWFgYGBfX19dXV1cXFxbW1taWlpZWVlXV1dWVlZVVVVUVFRTU1NRUVFQUFBPT09OTk5NTU1LS0tT9SY0AAAAMUlEQVQImQXBhQGAMAAAIGxnx2z9/00BiVQmVyhVakGj1ekNRpPZYhVtdofT5fZ4fT8hpwG05JjexgAAAABJRU5ErkJggg==);
+ background-image: -webkit-linear-gradient(top, #707070 1%, #4c4c4c 99%);
+ background-image: -moz-linear-gradient(top, #707070 1%, #4c4c4c 99%);
+}
+.dhtmlx_popup_title{
+ color:#fff;
+ text-shadow: 1px 1px #000;
+ height:40px; line-height:40px;
+ font-size:20px;
+}
+.dhtmlx_popup_text{
+ margin:15px 15px 5px 15px;
+ font-size:14px;
+ color:#000;
+ min-height:30px;
+ border-radius:6px;
+}
+
+
+.dhtmlx-info, .dhtmlx-error{
+ font-size:14px;
+ color:#000;
+ box-shadow: 0px 0px 10px #888;
+
+ padding:0px;
+
+ background-color:#FFF;
+ border-radius:3px;
+ border:1px solid #ffffff;
+}
+.dhtmlx-info div{
+ padding:5px 10px 5px 10px;
+ background-color: #fff;
+
+ border-radius:3px;
+ border:1px solid #B8B8B8;
+}
+.dhtmlx-error{
+ background-color: #d81b1b;
+ border:1px solid #ff3c3c;
+ box-shadow: 0px 0px 10px #000;
+}
+.dhtmlx-error div{
+ background-color: #d81b1b;
+ border:1px solid #940000;
+ color:#FFF;
+}
+
+ +.dhx_cal_container{
+ background-color:#C2D5FC;
+ font-family:Tahoma;
+ font-size:8pt;
+ position:relative;
+ overflow:hidden;
+}
+.dhx_cal_container div{
+ -moz-user-select:none;
+ -moz-user-select:-moz-none;
+}
+.dhx_cal_navline{
+ height:20px;
+ position:absolute;
+ z-index:3;
+ width:750px;
+ color:#2F3A48;
+}
+.dhx_cal_navline div{
+ position:absolute;
+ top:2px;
+ white-space:nowrap;
+}
+.dhx_cal_navline .dhx_cal_date {
+ font-weight:600;
+ left:210px;
+ padding-top: 1px;
+}
+.dhx_cal_button .dhx_left_bg{
+ width:1px; overflow:hidden;
+ height:17px;
+ z-index:20;
+ top:0px;
+}
+.dhx_cal_prev_button{
+ background-image:url(imgs/buttons.png);
+ background-position:0px 0px;
+ width:29px; height:17px;
+ left:50px; cursor:pointer;
+}
+.dhx_cal_next_button{
+ background-image:url(imgs/buttons.png);
+ background-position: -30px 0px;
+ width:29px; height:17px;
+ left:80px; cursor:pointer;
+}
+.dhx_cal_today_button{
+ background-image:url(imgs/buttons.png);
+ background-position: -60px 0px;
+ width:75px; height:17px;
+ left:112px; cursor:pointer;
+ text-align:center;
+ text-decoration:underline;
+}
+.dhx_cal_tab{
+ width:59px; height:19px;
+ text-align:center;
+ text-decoration:underline;
+ padding-top:2px;
+ cursor:pointer;
+ background-color: #D8E1EA;
+
+ -webkit-border-top-left-radius: 4px;
+ -webkit-border-top-right-radius: 4px;
+ -moz-border-radius-topleft: 4px;
+ -moz-border-radius-topright: 4px;
+ border-top-left-radius: 4px;
+ border-top-right-radius: 4px;
+}
+.dhx_cal_tab.active{
+ text-decoration:none;
+
+ cursor:default;
+ font-weight:bold;
+ border: 1px dotted #586A7E;
+ border-bottom: 0;
+ background-color: #C2D5FC;
+}
+.dhx_cal_header{
+ position:absolute;
+ left:10px; top:23px;
+ width:750px;
+ border-top:1px dotted #8894A3;
+ border-right:1px dotted #8894A3;
+ z-index:2;
+ overflow:hidden;
+ color:#2F3A48;
+}
+.dhx_cal_data{
+ border-top:1px dotted #8894A3;
+ position:absolute;
+ top:44px;
+ width:600px;
+ overflow-y:auto;
+ overflow-x:hidden;
+}
+.dhx_scale_bar{
+ position:absolute;
+ text-align:center;
+ background-color:#C2D5FC;
+ padding-top:3px;
+ border-left:1px dotted #586A7E;
+}
+.dhx_scale_holder{
+ position:absolute;
+ border-right:1px dotted #586A7E;
+ background-image:url(imgs/databg.png);
+}
+.dhx_scale_holder_now{
+ position:absolute;
+ border-right:1px dotted #586A7E;
+ background-image:url(imgs/databg_now.png);
+}
+.dhx_scale_hour{
+ height:41px;
+ width:50px;
+ border-bottom:1px dotted #8894A3;
+ background-color:#C2D5FC;
+ text-align:center;
+ line-height:40px;
+ color:#586A7E;
+ overflow:hidden;
+}
+.dhx_month_head{
+ background-color:#EBEFF4;
+ color:#2F3A48;
+ border-right:1px dotted #586A7E;
+ height:18px;
+ padding-right:5px;
+ padding-top:3px;
+ text-align:right;
+}
+.dhx_month_body{
+ border-right:1px dotted #586A7E;
+ border-bottom:1px dotted #586A7E;
+ background-color:#FFFFFF;
+}
+.dhx_now .dhx_month_body{
+ background-color:#E2EDFF;
+}
+.dhx_after .dhx_month_body, .dhx_before .dhx_month_body{
+ background-color:#ECECEC;
+}
+.dhx_after .dhx_month_head, .dhx_before .dhx_month_head{
+ background-color:#E2E3E6;
+ color:#94A6BB;
+}
+.dhx_now .dhx_month_head{
+ background-color:#D1DEF4;
+ font-weight:bold;
+}
+.dhx_cal_drag{
+ position:absolute;
+ z-index:9999;
+ background-color:#FFE763;
+ border:1px solid #B7A543;
+ opacity:0.5;
+ filter:alpha(opacity=50);
+}
+.dhx_loading{
+ position:absolute;
+ width:128px;
+ height:15px;
+ background-image:url(imgs/loading.gif);
+ z-index:9999;
+}
+.dhx_multi_day_icon, .dhx_multi_day{
+ background-color:#E1E6FF;
+ background-repeat:no-repeat;
+ border-right:1px dotted #8894A3;
+}
+.dhx_multi_day{
+ position: absolute;
+ border-top:1px dotted #8894A3;
+}
+.dhx_multi_day_icon, .dhx_multi_day_icon_small{
+ background-position: center center;
+ background-color:#E1E6FF;
+ background-repeat:no-repeat;
+ border-bottom:1px dotted #8894A3;
+ border-right:1px dotted #8894A3;
+}
+.dhx_multi_day_icon{
+ background-image:url(imgs/clock_big.gif);
+}
+.dhx_multi_day_icon_small{
+ background-image:url(imgs/clock_small.gif);
+
+}
+.dhtmlxLayoutPolyContainer_dhx_skyblue .dhx_cal_container {
+ background-color: #d0e5ff;
+} +.dhx_cal_event .dhx_header, .dhx_cal_event .dhx_title, .dhx_cal_event .dhx_body, .dhx_cal_event .dhx_footer {
+ background-color:#FFE763;
+ border:1px solid #B7A543;
+ color:#887A2E;
+ overflow:hidden;
+ width:100%;
+
+ font-family:Tahoma;
+ font-size:8pt;
+}
+.dhx_move_denied .dhx_cal_event .dhx_header, .dhx_move_denied .dhx_cal_event .dhx_title{
+ cursor:default;
+}
+.dhx_cal_event .dhx_header{
+ height:1px;
+ margin-left:1px;
+ border-width:1px 1px 0px 1px;
+ cursor:pointer;
+}
+.dhx_cal_event .dhx_title {
+ height:12px;
+ border-width:0px 1px 1px 1px;
+ border-bottom-style:dotted;
+
+ font-size:7pt;
+ font-weight:bold;
+ text-align:center;
+
+ background-position:right;
+ background-repeat:no-repeat;
+ cursor:pointer;
+}
+.dhx_cal_event .dhx_body, .dhx_cal_event.dhx_cal_select_menu .dhx_body{
+ border-width:0 1px 1px 1px;
+ padding:5px;
+}
+.dhx_resize_denied {
+ cursor:default !important;
+}
+.dhx_cal_event .dhx_event_resize {
+ cursor:s-resize;
+}
+.dhx_cal_event .dhx_footer, .dhx_cal_event .dhx_select_menu_footer{
+ height:1px;
+ margin-left:2px;
+ border-width:0px 1px 1px 1px;
+}
+.dhx_cal_event_line{
+ background-color:#FFE763;
+ border:1px solid #B7A543;
+ border-radius:3px;
+ font-family:Tahoma;
+ font-size:8pt;
+ height:13px;
+ padding-left:10px;
+ color:#887A2E;
+ cursor:pointer;
+ overflow:hidden;
+}
+.dhx_cal_event_clear{
+ font-family:Tahoma;
+ font-size:8pt;
+ height:13px;
+ padding-left:2px;
+ color:#887A2E;
+ white-space:nowrap;
+ overflow:hidden;
+ cursor:pointer;
+}
+.dhx_in_move{
+ background-color:#FFFF80;
+}
+div.dhx_cal_editor{
+ background-color:#FFE763;
+ border:1px solid #B7A543;
+ border-top-style:dotted;
+ z-index:999;
+ position:absolute;
+ overflow:hidden;
+}
+textarea.dhx_cal_editor{
+ width:100%;
+ height:100%;
+ border:0px solid black;
+ margin:none;
+ padding:none;
+ overflow:auto;
+}
+div.dhx_menu_head{
+ background-image:url(imgs/controls.gif);
+ background-position: 0px -43px;
+ width:10px; height:10px;
+ margin-left:5px; margin-top:1px;
+ border:none;
+ cursor:default;
+}
+div.dhx_menu_icon{
+ background-image:url(imgs/controls.gif);
+ width:20px; height:20px;
+ margin-left:-5px; margin-top:0px;
+ border:none;
+ cursor:pointer;
+}
+div.icon_details{
+ background-position: 0px 0px;
+}
+div.icon_edit{
+ background-position: -22px 0px;
+}
+div.icon_save{
+ background-position: -84px -1px;
+}
+div.icon_cancel{
+ background-position: -62px 0px;
+}
+div.icon_delete{
+ background-position: -42px 0px;
+} +.dhx_unselectable, .dhx_unselectable div{
+ -webkit-user-select:none;
+ -moz-user-select:none;
+ -moz-user-select:-moz-none;
+}
+.dhx_cal_light{
+ background-color:#FFE763;
+ border-radius:5px;
+ font-family:Tahoma;
+ font-size:8pt;
+ border:1px solid #B7A64B;
+ color:#887A2E;
+
+ position:absolute;
+ z-index:10001;
+
+ width:580px;
+ height:300px;
+
+ box-shadow:5px 5px 5px #888;
+}
+.dhx_cal_light_wide{
+ width:650px;
+}
+.dhx_mark{
+ position:relative; top:3px;
+ background-image:url('./imgs/controls.gif');
+ background-position: 0px -43px;
+ padding-left:10px;
+}
+.dhx_ie6 .dhx_mark{
+ background-position: 6px -41px;
+}
+
+.dhx_cal_light select{
+ font-family:Tahoma;
+ font-size:8pt;
+ color:#887A2E;
+ padding:2px;
+ margin:0px;
+}
+.dhx_cal_ltitle{
+ padding:2px 0px 2px 5px;
+ overflow:hidden;
+ white-space:nowrap;
+}
+.dhx_cal_ltitle span{
+ white-space:nowrap;
+}
+.dhx_cal_lsection{
+ background-color:#DBCF8C;
+ color:#FFF4B5;
+ font-weight:bold;
+ padding:5px 0px 3px 10px;
+}
+.dhx_section_time{
+ background-color:#DBCF8C;
+ white-space:nowrap;
+}
+.dhx_cal_lsection .dhx_fullday{
+ float:right;
+ margin-right:5px;
+ color:#887A2E;
+ font-size:12px;
+ font-weight:normal;
+ line-height:20px;
+ vertical-align:top;
+ cursor:pointer;
+}
+.dhx_cal_lsection{
+ font-size:18px;
+ font-family:Arial;
+}
+.dhx_cal_ltext{
+ padding:2px 0px 2px 10px;
+ overflow:hidden;
+}
+.dhx_cal_ltext textarea{
+ background-color: #FFF4B5; /* #FFF4B5; should be the same for dhx_cal_larea, was transperent */
+ overflow:auto;
+ border:none;
+ color:#887A2E;
+ height:100%;
+ width:100%;
+ outline:none !important;
+ resize: none;
+}
+.dhx_time{
+ font-weight:bold;
+}
+.dhx_cal_light .dhx_title{
+ padding-left:10px;
+}
+.dhx_cal_larea{
+ border:1px solid #DCC43E;
+ background-color:#FFF4B5;
+ overflow:hidden;
+
+ margin-left:3px;
+
+ width:572px;
+ height:1px;
+}
+.dhx_btn_set{
+ padding:5px 10px 0px 10px;
+ float:left;
+}
+.dhx_btn_set div{
+ float:left;
+ height:21px;
+ line-height:21px;
+ vertical-align:middle;
+ cursor:pointer;
+}
+.dhx_save_btn{
+ background-image:url('./imgs/controls.gif');
+ background-position:-84px 0px;
+ width:21px;
+
+}
+.dhx_cancel_btn{
+ background-image:url('./imgs/controls.gif');
+ background-position:-63px 0px;
+ width:20px;
+}
+.dhx_delete_btn{
+ background-image:url('./imgs/controls.gif');
+ background-position:-42px 0px;
+ width:20px;
+}
+.dhx_cal_cover{
+ width:100%;
+ height:100%;
+ position:absolute;
+ z-index:10000;
+ top:0px;
+ left:0px;
+ background-color:black;
+
+ opacity:0.1;
+ filter:alpha(opacity=10);
+}
+.dhx_custom_button{
+ padding:0px 3px 0px 3px;
+ color:#887A2E;
+ font-family:Tahoma;
+ font-size:8pt;
+ background-color:#FFE763;
+ font-weight:normal;
+ margin-right:5px;
+ margin-top:0px;
+ cursor:pointer;
+}
+.dhx_custom_button div{
+ cursor:pointer;
+ float:left;
+ height:21px;
+ line-height:21px;
+ vertical-align:middle;
+}
+
+
+.dhx_cal_light_wide .dhx_cal_larea{
+ border-top-width:0px;
+}
+.dhx_cal_light_wide .dhx_cal_lsection{
+ border:0px;
+ float:left;
+ text-align:right;
+ width:100px;
+ height:20px;
+ font-size:16px;
+ padding: 5px 0px 0px 10px;
+}
+.dhx_cal_light_wide .dhx_wrap_section{
+ border-top:1px solid #DBCF8C;
+ position:relative;
+ background-color:#DBCF8C;
+ overflow:hidden;
+}
+.dhx_cal_light_wide .dhx_section_time{
+ padding-top:2px !important;
+ height:20px !important;
+}
+.dhx_section_time{
+ text-align: center;
+}
+.dhx_cal_light_wide .dhx_cal_larea{
+ width:730px;
+}
+.dhx_cal_light_wide{
+ width:738px;
+}
+
+.dhx_cal_light_wide .dhx_section_time{
+ background:transparent;
+}
+.dhx_cal_light_wide .dhx_cal_checkbox label{
+ padding-left:0px;
+}
+.dhx_cal_wide_checkbox input{
+ margin-top:8px;
+ margin-left:14px;
+}
+.dhx_cal_light input{
+ font-family:Tahoma;
+ font-size:8pt;
+ color:#887A2E;
+}
+.dhx_cal_light_wide .dhx_cal_lsection .dhx_fullday{
+ float:none;
+ margin-right:0px;
+ color:#FFF4B5;
+ font-weight:bold;
+ font-size:16px;
+ font-family:Arial;
+ cursor:pointer;
+}
+.dhx_custom_button{
+ float: right;
+ height: 21px;
+ width:90px;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ -ms-border-radius: 4px;
+ -o-border-radius: 4px;
+ border-radius: 4px;
+}
+.dhx_cal_light_wide .dhx_custom_button {
+ position:absolute;
+ top:0;
+ right:0;
+ margin-top: 2px;
+}
+.dhx_cal_light_wide .dhx_repeat_right {
+ margin-right: 55px;
+} +.dhx_minical_popup{
+ position:absolute;z-index:10100;
+ width:251px; height:175px;
+}
+.dhx_scale_bar_header {
+ position: absolute;
+ border-bottom: 1px dotted #8894A3;
+ width: 100%;
+}
+.dhx_expand_icon {
+ position:absolute; top:0px; right:0px;
+ background-image:url(./imgs/collapse_expand_icon.gif);
+ width:18px; height:18px;
+ cursor:pointer;
+ background-position:0px 18px;
+ z-index:16;
+}
+.dhx_scheduler_agenda .dhx_cal_data {
+ background-image:url(./imgs/databg.png);
+}
+.dhx_agenda_area{
+ width:100%;
+ overflow-y:auto;
+ background-image:url(./imgs/databg.png);
+}
+.dhx_agenda_line{
+ height:21px;
+ clear:both;
+ overflow:hidden;
+}
+.dhx_agenda_line div{
+ float:left;
+ width:188px;
+ border-right:1px dotted #8894A3;
+ text-align:center;
+ line-height:21px;
+ overflow:hidden;
+}
+.dhx_agenda_area .dhx_agenda_line div{
+ border-right:0px dotted #8894A3;
+}
+.dhx_v_border{
+ position:absolute;
+ left:187px;
+ top:0;
+ border-right:1px dotted #8894A3;
+ width:1px;
+ height:100%;
+}
+.dhx_agenda_line .dhx_event_icon{
+ width:20px;
+ border-width:0px;
+ background:url(./imgs/icon.png) no-repeat;
+ background-position: 5px 4px;
+ cursor:pointer;
+}
+.dhx_agenda_line span{
+ padding-left:5px;
+ line-height:21px;
+}
+
+
+.dhx_year_body{
+ border-left:1px dotted #586A7E;
+}
+.dhx_year_week{
+ position:relative;
+}
+.dhx_scale_bar_last{
+ border-right:1px dotted #586A7E;
+}
+.dhx_year_month{
+ height:18px;
+ padding-top:3px;
+ border:1px dotted #586A7E;
+ text-align:center;
+ vertical-align:middle;
+}
+.dhx_year_body .dhx_before .dhx_month_head, .dhx_year_body .dhx_after .dhx_month_head, .dhx_year_body .dhx_before .dhx_month_head a, .dhx_year_body .dhx_after .dhx_month_head a{
+ color:#E2E3E6 !important;
+}
+.dhx_year_body .dhx_month_body{
+ height:0px;
+ overflow:hidden;
+}
+.dhx_month_head.dhx_year_event{
+ background-color:#FFE763;
+}
+.dhx_year_body .dhx_before .dhx_month_head, .dhx_year_body .dhx_after .dhx_month_head{
+ cursor: default;
+}
+.dhx_tooltip{
+ border:1px solid #BBBBBB;
+ background-image:url(./imgs/databg.png);
+ position:absolute;
+ z-index:9998;
+ width:300px;
+ height:auto;
+ font-family:Tahoma;
+ font-size:8pt;
+ overflow:hidden;
+}
+
+.dhx_tooltip_line{
+ line-height:20px;
+ height:20px;
+ overflow:hidden;
+}
+
+.dhx_tooltip_line .dhx_event_icon{
+ width:20px; height:20px;
+ padding-right:10px;
+ float:left;
+ border-width:0px;
+ position:relative;
+ background:url(./imgs/icon.png) no-repeat;
+ background-position: 5px 4px;
+ cursor:pointer;
+}
+
+.dhx_tooltip_date{
+ float:left;
+ width:auto;
+ padding-left:5px;
+ text-align:center;
+}
+
+.dhx_text_disabled{
+ color:#887A2E;
+ font-family:Tahoma;
+ font-size:8pt;
+}
+
+.dhx_mini_calendar{
+ -moz-box-shadow:5px 5px 5px #888; /*Doesn't work in IE*/
+ -khtml-box-shadow: 5px 5px 5px #888;
+}
+
+.dhx_mini_calendar .dhx_month_head{
+ cursor:pointer;
+}
+.dhx_mini_calendar .dhx_calendar_click{
+ background-color: #C2D5FC;
+}
+.dhx_cal_navline div.dhx_minical_icon{
+ width:18px;
+ height:18px;
+ left:190px;
+ top:1px;
+ cursor:pointer;
+ background-image:url(./imgs/calendar.gif);
+}
+
+.dhx_matrix_scell {
+ height: 100%;
+}
+
+.dhx_matrix_cell, .dhx_matrix_scell{
+ overflow:hidden;
+ text-align:center;
+ vertical-align:middle;
+ border-bottom:1px dotted #8894A3;
+ border-right:1px dotted #8894A3;
+}
+.dhx_matrix_cell{
+ background-color:white;
+}
+.dhx_matrix_line{
+ overflow: hidden;
+}
+.dhx_matrix_cell div, .dhx_matrix_scell div{
+ overflow:hidden;
+ text-align:center;
+ height:auto;
+}
+
+.dhx_cal_lsection .dhx_readonly{
+ font-size:9pt;
+ font-size:8pt;
+ padding:2px;
+ color:#887A2E;
+}
+.dhx_cal_event_line .dhx_event_resize {
+ cursor: w-resize;
+ background: url(./imgs/resize_dots.png) repeat-y;
+ position: absolute;
+ top: 0;
+ width: 4px;
+}
+.dhx_event_resize_start {
+ left: 0;
+}
+.dhx_event_resize_end {
+ right: 0;
+}
+
+/* Tree view */
+.dhx_matrix_scell.folder, .dhx_data_table.folder .dhx_matrix_cell{
+ background-color: #969394;
+ cursor: pointer;
+}
+.dhx_matrix_scell .dhx_scell_level0{
+ padding-left: 5px;
+}
+.dhx_matrix_scell .dhx_scell_level1{
+ padding-left: 20px;
+}
+.dhx_matrix_scell .dhx_scell_level2{
+ padding-left: 35px;
+}
+.dhx_matrix_scell .dhx_scell_level3{
+ padding-left: 50px;
+}
+.dhx_matrix_scell .dhx_scell_level4{
+ padding-left: 65px;
+}
+
+.dhx_matrix_scell.folder{
+ font-weight: bold;
+ text-align: left;
+}
+.dhx_matrix_scell.folder .dhx_scell_expand{
+ float: left;
+ width: 10px;
+ padding-right:3px;
+}
+.dhx_matrix_scell.folder .dhx_scell_name{
+ float: left;
+ width: auto;
+}
+.dhx_matrix_scell.item .dhx_scell_name{
+ padding-left:15px;
+ text-align: left;
+}
+.dhx_data_table.folder .dhx_matrix_cell{
+ border-right: 0;
+}
+.dhx_section_timeline {
+ overflow: hidden;
+ padding: 4px 0 2px 10px;
+}
+.dhx_section_timeline select{
+ width: 552px;
+}
+
+/* Tree view end*/
+
+/* Map view */
+.dhx_map_area{
+ width:100%;
+ height:100%;
+ overflow-y: auto;
+ overflow-x: hidden;
+ background-image:url(./imgs/databg.png);
+}
+.dhx_map_line .dhx_event_icon{
+ width:20px;
+ border-width:0px;
+ background:url(./imgs/icon.png) no-repeat;
+ background-position: 5px 4px;
+ cursor:pointer;
+}
+.dhx_map_line{
+ height:21px;
+ clear:both;
+ overflow:hidden;
+}
+.dhx_map {
+ position:absolute;
+}
+.dhx_map_line div{
+ float:left;
+ border-right:1px dotted #8894A3;
+ text-align:center;
+ line-height:21px;
+ overflow:hidden;
+}
+.dhx_map_line .headline_description{
+ float:left;
+
+ border-right:1px dotted #8894A3;
+ text-align:center;
+ line-height:21px;
+ overflow:hidden;
+}
+.dhx_map_line .dhx_map_description{
+ float:left;
+ border-right: 0 dotted #8894A3;
+ text-align:center;
+ line-height:21px;
+ overflow:hidden;
+}
+.dhx_map_line .headline_date, .dhx_map_line .headline_description {
+ border-left: 0;
+}
+.dhx_map_line .line_description {
+ float:left;
+ border-right:1px dotted #8894A3;
+ text-align:left;
+ padding-left:5px;
+ line-height:21px;
+ overflow:hidden;
+}
+.dhx_map_line.highlight{
+ background-color: #C4C5CC;
+}
+.dhx_map_area .dhx_map_line div{
+ border-right:0px dotted #8894A3;
+}
+/* Map view end */
+
+/* dhtmlXTooltip start */
+.dhtmlXTooltip.tooltip{
+ -moz-box-shadow:3px 3px 3px #888888;
+ -webkit-box-shadow:3px 3px 3px #888888;
+ -o-box-shadow:3px 3px 3px #888888;
+ box-shadow:3px 3px 3px #888888;
+ filter:
+ progid:DXImageTransform.Microsoft.Shadow(color='#888888', Direction=135, Strength=5)
+ ;
+ background-color:white;
+ border-left:1px dotted #887A2E;
+ border-top:1px dotted #887A2E;
+ color:#887A2E;
+ cursor:default;
+ padding:10px;
+ position:absolute;
+ z-index:500;
+}
+/* dhtmlXTooltip end */
+
+/* Lightbox checkbox section */
+.dhx_cal_checkbox label {
+ padding-left: 5px;
+}
+/* Lightbox checkbox section end */
+
+
+/* Lightbox radiobuttons section */
+.dhx_cal_light .radio {
+ padding: 2px 0px 2px 10px;
+}
+.dhx_cal_light .radio input, .dhx_cal_light .radio label{
+ line-height: 15px;
+}
+.dhx_cal_light .radio input {
+ vertical-align: middle;
+ margin: 0px;
+ padding: 0px;
+}
+.dhx_cal_light .radio label {
+ vertical-align: middle;
+ padding-right: 10px;
+}
+/* Lightbox radiobuttons section end */
+
+
+/* Lightbox dhtmlx combo section */
+.dhx_cal_light .combo {
+ padding: 4px;
+}
+.dhx_cal_light_wide .dhx_combo_box/*, .dhx_cal_light_wide .combo*/ {
+ width: 608px !important;
+ left: 10px;
+}
+/* Lightbox dhtmlx combo section end */
+
+/* Agenda week start */
+.dhx_wa_column {
+ float: left;
+}
+.dhx_wa_column_last .dhx_wa_day_cont{
+ border-left: 1px dotted #8894A3;
+}
+.dhx_wa_scale_bar {
+ font-family: Tahoma;
+ padding-left: 10px;
+ font-size: 11px;
+ border-top: 1px dotted #8894A3;
+ border-bottom: 1px dotted #8894A3;
+}
+.dhx_wa_day_data {
+ background-color: #FCFEFC;
+ overflow-y: auto;
+}
+.dhx_wa_ev_body {
+ border-bottom: 1px dotted #778899;
+ font-size: 12px;
+ padding: 5px 0 5px 7px;
+}
+.dhx_wa_dnd {
+ font-family: Tahoma;
+ position: absolute;
+ padding-right: 7px;
+ color: #887AE2 !important;
+ background-color: #FFE763 !important;
+ border: 1px solid #B7A543;
+}
+.dhx_cal_event_selected{
+ background-color: #9cc1db;
+ color: white;
+}
+/* Agenda week end */
+
+/* timeline second scale start */
+.dhx_second_scale_bar {
+ border-bottom: 1px dotted #586A7E;
+ padding-top: 2px;
+}
+/* timeline second scale end */
+
+
+/* grid view */
+
+.dhx_cal_header div div{
+ border-left: 1px dotted #8894A3;
+}
+
+.dhx_grid_area{
+ width:100%;
+ height:100%;
+ overflow-y:auto;
+ background-color:#FCFEFC;
+}
+.dhx_grid_area table{
+ border-collapse: collapse;
+ border-spacing: 0;
+ width:100%;
+ table-layout:fixed;
+}
+.dhx_grid_area td{
+ table-layout:fixed;
+ text-align:center;
+}
+
+.dhx_grid_line{
+ height:21px;
+ clear:both;
+ overflow:hidden;
+}
+.dhx_grid_line div{
+ float:left;
+ cursor:default;
+ padding-top: 0;
+ padding-bottom: 0;
+ text-align:center;
+ line-height:21px;
+ overflow:hidden;
+}
+
+.dhx_grid_area td, .dhx_grid_line div{
+ padding-left:8px;
+ padding-right:8px;
+}
+
+
+.dhx_grid_area tr.dhx_grid_event{
+ height:21px;
+ overflow:hidden;
+ margin:0 0 1px 0;
+}
+.dhx_grid_area tr.dhx_grid_event td{
+ /*borders for old ies*/
+ border-bottom:1px solid #ECEEF4;
+}
+.dhx_grid_area tr.dhx_grid_event:nth-child(2n+1) td, .dhx_grid_area tr.dhx_grid_event:nth-child(2n) td{
+ border-bottom-width:0px;
+ border-bottom-style:none;
+}
+.dhx_grid_area tr.dhx_grid_event:nth-child(2n){
+ background-color:#ECEEF4;;
+}
+.dhx_grid_area .dhx_grid_dummy{
+ table-layout:auto;
+ margin:0 !important;
+ padding:0 !important;
+}
+
+.dhx_grid_v_border{
+ position:absolute;
+ border-right:1px solid #A4BED4;
+ width:1px;
+ height:100%;
+}
+
+.dhx_grid_event_selected{
+ background-color: #9cc1db !important;
+ color: white !important;
+}
+
+.dhx_grid_sort_desc .dhx_grid_view_sort{
+ background-position: 0 -55px;
+}
+.dhx_grid_sort_asc .dhx_grid_view_sort{
+ background-position: 0 -66px;
+}
+.dhx_grid_view_sort{
+ width:10px;
+ height:10px;
+ position: absolute;
+ border:none !important;
+ top: 5px;
+ background-repeat:no-repeat;
+ background-image: url(./imgs/images.png);
+}
+/* end grid */
+
+/* marked timespans */
+.dhx_marked_timespan {
+ position: absolute;
+ width: 100%;
+}
+.dhx_time_block {
+ position:absolute;
+ width:100%;
+ background:silver;
+ opacity:0.4;
+ filter:alpha(opacity=40);
+ z-index:1;
+}
+.dhx_time_block_reset {
+ opacity: 1;
+ filter:alpha(opacity=100);
+}
+.dhx_scheduler_month .dhx_marked_timespan {
+ display: none;
+}
+.dhx_mini_calendar .dhx_marked_timespan {
+ display: none;
+}
+/* now time */
+.dhx_now_time {
+ width:100%;
+ border-bottom:2px dotted red;
+ z-index: 1;
+}
+.dhx_scheduler_month .dhx_now_time {
+ border-bottom: 0;
+ border-left: 2px dotted red;
+}
+.dhx_matrix_now_time {
+ border-left:2px dotted red;
+ z-index: 1;
+}
+
+ +/*IE*/
+div.dhx_form_repeat input.radio { margin:-4px 0 0 -4px !ie; }
+div.dhx_form_repeat input.checkbox { margin:0 0 0 -4px !ie; }
+
+/*All*/
+.dhx_form_repeat, .dhx_form_repeat input {
+ padding:0;
+ margin:0;
+ padding-left:5px;
+ font-family:Tahoma, Verdana;
+ font-size:11px;
+ line-height:24px;
+}
+
+.dhx_form_repeat {
+ overflow:hidden;
+ /*height:115px;*/
+ height:0px;
+ background-color: #FFF4B5;
+ /*border: 1px solid #DCC43E;*/
+}
+
+.dhx_cal_light_wide .dhx_form_repeat {
+ background-color: transparent;
+}
+
+
+.dhx_repeat_center, .dhx_repeat_left{
+ height:115px;
+ padding:10px 0 10px 10px;
+ float:left;
+}
+
+.dhx_repeat_left{
+ width:95px;
+}
+
+.dhx_repeat_center{
+ width:335px;
+ margin-top:12px;
+}
+
+.dhx_repeat_divider{
+ float:left;
+ height:115px;
+ border-left:1px dotted #DCC43E;
+ /*background-color: #DCC43E;*/
+ width:1px;
+}
+
+.dhx_repeat_right {
+ float:right;
+ height:115px;
+ width:160px;
+ padding:10px 3px 10px 10px;
+ margin-top:7px;
+}
+
+input.dhx_repeat_text {
+ height:16px;
+ width: 27px;
+ margin: 0 4px 0 4px;
+ line-height:18px;
+ padding: 0 0 0 2px;
+}
+
+.dhx_form_repeat select {
+ height: 20px;
+ width: 87px;
+ padding:0 0 0 2px;
+ margin: 0 4px 0 4px;
+}
+
+input.dhx_repeat_date{
+ height: 18px;
+ width: 80px;
+ padding:0 0 0 2px;
+ margin: 0 4px 0 4px;
+ background-repeat:no-repeat;
+ background-position:64px 0;
+ border:1px #7f9db9 solid;
+ line-height:18px;
+}
+
+input.dhx_repeat_radio {
+ margin-right:4px;
+}
+
+input.dhx_repeat_checkbox {
+ margin:4px 4px 0 0;
+}
+
+.dhx_repeat_days td {
+ padding-right:5px;
+}
+.dhx_repeat_days label {
+ font-size:10px;
+}
+.dhx_custom_button{
+ width:90px;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ -ms-border-radius: 4px;
+ -o-border-radius: 4px;
+ border-radius: 4px;
+}
+.dhx_custom_button_recurring{
+ background-image:url(./imgs/but_repeat.gif);
+ background-position:-5px 20px;
+ width:20px;
+ margin-right:10px;
+}
+
+/* increase width of lightbox */
+.dhx_cal_light_rec{
+ width:640px;
+}
+.dhx_cal_light_rec .dhx_cal_larea{
+ width:632px;
+}
+.dhx_cal_light_rec.dhx_cal_light_wide{
+ width:816px;
+}
+.dhx_cal_light_rec.dhx_cal_light_wide .dhx_cal_larea{
+ width:808px;
+}
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler_debug.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/dhtmlxscheduler.js index 30384b83b5c..3dc9dc4e46f 100644 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler_debug.js +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/dhtmlxscheduler.js @@ -1,21 +1,23 @@ /* This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details +to use it in non-GPL project. Please contact sales@dhtmlx.com for details */ -window.dhtmlx || (dhtmlx=function(obj){
- for (var a in obj) dhtmlx[a]=obj[a];
- return dhtmlx; //simple singleton
-}) +if (!window.dhtmlx) {
+ dhtmlx = function(obj){
+ for (var a in obj) dhtmlx[a]=obj[a];
+ return dhtmlx; //simple singleton
+ };
+}
dhtmlx.extend_api=function(name,map,ext){
var t = window[name];
if (!t) return; //component not defined
window[name]=function(obj){
- if (obj && typeof obj == "object" && !obj.tagName && !(obj instanceof Array)){
+ if (obj && typeof obj == "object" && !obj.tagName){
var that = t.apply(this,(map._init?map._init(obj):arguments));
//global settings
for (var a in dhtmlx)
- if (map[a]) this[map[a]](dhtmlx[a]);
+ if (map[a]) this[map[a]](dhtmlx[a]);
//local settings
for (var a in obj){
if (map[a]) this[map[a]](obj[a]);
@@ -52,19 +54,19 @@ dhtmlxAjax={ return this.get(url,null,true)
},
postSync:function(url,post){
- return this.post(url,post,null,true);
+ return this.post(url,post,null,true);
}
}
/**
- * @desc: xmlLoader object
- * @type: private
- * @param: funcObject - xml parser function
- * @param: object - jsControl object
- * @param: async - sync/async mode (async by default)
- * @param: rSeed - enable/disable random seed ( prevent IE caching)
- * @topic: 0
- */
+ * @desc: xmlLoader object
+ * @type: private
+ * @param: funcObject - xml parser function
+ * @param: object - jsControl object
+ * @param: async - sync/async mode (async by default)
+ * @param: rSeed - enable/disable random seed ( prevent IE caching)
+ * @topic: 0
+ */
function dtmlXMLLoaderObject(funcObject, dhtmlObject, async, rSeed){
this.xmlDoc="";
@@ -79,12 +81,15 @@ function dtmlXMLLoaderObject(funcObject, dhtmlObject, async, rSeed){ this.rSeed=rSeed||false;
return this;
};
+
+dtmlXMLLoaderObject.count = 0;
+
/**
- * @desc: xml loading handler
- * @type: private
- * @param: dtmlObject - xmlLoader object
- * @topic: 0
- */
+ * @desc: xml loading handler
+ * @type: private
+ * @param: dtmlObject - xmlLoader object
+ * @topic: 0
+ */
dtmlXMLLoaderObject.prototype.waitLoadFunction=function(dhtmlObject){
var once = true;
this.check=function (){
@@ -94,6 +99,7 @@ dtmlXMLLoaderObject.prototype.waitLoadFunction=function(dhtmlObject){ return;
once=false; //IE 5 fix
+ dtmlXMLLoaderObject.count++;
if (typeof dhtmlObject.onloadAction == "function")
dhtmlObject.onloadAction(dhtmlObject.mainObject, null, null, null, dhtmlObject);
@@ -108,12 +114,12 @@ dtmlXMLLoaderObject.prototype.waitLoadFunction=function(dhtmlObject){ };
/**
- * @desc: return XML top node
- * @param: tagName - top XML node tag name (not used in IE, required for Safari and Mozilla)
- * @type: private
- * @returns: top XML node
- * @topic: 0
- */
+ * @desc: return XML top node
+ * @param: tagName - top XML node tag name (not used in IE, required for Safari and Mozilla)
+ * @type: private
+ * @returns: top XML node
+ * @topic: 0
+ */
dtmlXMLLoaderObject.prototype.getXMLTopNode=function(tagName, oldObj){
if (this.xmlDoc.responseXML){
var temp = this.xmlDoc.responseXML.getElementsByTagName(tagName);
@@ -128,17 +134,13 @@ dtmlXMLLoaderObject.prototype.getXMLTopNode=function(tagName, oldObj){ return z;
}
- if ((_isIE)&&(!this._retry)){
- //fall back to MS.XMLDOM
- var xmlString = this.xmlDoc.responseText;
- var oldObj = this.xmlDoc;
+ if (!this._retry){
this._retry=true;
- this.xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
- this.xmlDoc.async=false;
- this.xmlDoc["loadXM"+"L"](xmlString);
-
+ var oldObj = this.xmlDoc;
+ this.loadXMLString(this.xmlDoc.responseText.replace(/^[\s]+/,""), true);
return this.getXMLTopNode(tagName, oldObj);
}
+
dhtmlxError.throwError("LoadXML", "Incorrect XML", [
(oldObj||this.xmlDoc),
this.mainObject
@@ -148,25 +150,28 @@ dtmlXMLLoaderObject.prototype.getXMLTopNode=function(tagName, oldObj){ };
/**
- * @desc: load XML from string
- * @type: private
- * @param: xmlString - xml string
- * @topic: 0
- */
-dtmlXMLLoaderObject.prototype.loadXMLString=function(xmlString){
- {
- try{
- var parser = new DOMParser();
- this.xmlDoc=parser.parseFromString(xmlString, "text/xml");
- }
- catch (e){
- this.xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
- this.xmlDoc.async=this.async;
- this.xmlDoc["loadXM"+"L"](xmlString);
- }
+ * @desc: load XML from string
+ * @type: private
+ * @param: xmlString - xml string
+ * @topic: 0
+ */
+dtmlXMLLoaderObject.prototype.loadXMLString=function(xmlString, silent){
+
+ if (!_isIE){
+ var parser = new DOMParser();
+ this.xmlDoc=parser.parseFromString(xmlString, "text/xml");
+ } else {
+ this.xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
+ this.xmlDoc.async=this.async;
+ this.xmlDoc.onreadystatechange = function(){};
+ this.xmlDoc["loadXM"+"L"](xmlString);
}
- this.onloadAction(this.mainObject, null, null, null, this);
+ if (silent)
+ return;
+
+ if (this.onloadAction)
+ this.onloadAction(this.mainObject, null, null, null, this);
if (this.waitCall){
this.waitCall();
@@ -174,17 +179,18 @@ dtmlXMLLoaderObject.prototype.loadXMLString=function(xmlString){ }
}
/**
- * @desc: load XML
- * @type: private
- * @param: filePath - xml file path
- * @param: postMode - send POST request
- * @param: postVars - list of vars for post request
- * @topic: 0
- */
+ * @desc: load XML
+ * @type: private
+ * @param: filePath - xml file path
+ * @param: postMode - send POST request
+ * @param: postVars - list of vars for post request
+ * @topic: 0
+ */
dtmlXMLLoaderObject.prototype.loadXML=function(filePath, postMode, postVars, rpc){
if (this.rSeed)
filePath+=((filePath.indexOf("?") != -1) ? "&" : "?")+"a_dhx_rSeed="+(new Date()).valueOf();
this.filePath=filePath;
+
if ((!_isIE)&&(window.XMLHttpRequest))
this.xmlDoc=new XMLHttpRequest();
else {
@@ -202,7 +208,7 @@ dtmlXMLLoaderObject.prototype.loadXML=function(filePath, postMode, postVars, rpc else if (postMode)
this.xmlDoc.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
-
+
this.xmlDoc.setRequestHeader("X-Requested-With","XMLHttpRequest");
this.xmlDoc.send(null||postVars);
@@ -210,40 +216,57 @@ dtmlXMLLoaderObject.prototype.loadXML=function(filePath, postMode, postVars, rpc (new this.waitLoadFunction(this))();
};
/**
- * @desc: destructor, cleans used memory
- * @type: private
- * @topic: 0
- */
+ * @desc: destructor, cleans used memory
+ * @type: private
+ * @topic: 0
+ */
dtmlXMLLoaderObject.prototype.destructor=function(){
- this.onloadAction=null;
- this.mainObject=null;
- this.xmlDoc=null;
+ this._filterXPath = null;
+ this._getAllNamedChilds = null;
+ this._retry = null;
+ this.async = null;
+ this.rSeed = null;
+ this.filePath = null;
+ this.onloadAction = null;
+ this.mainObject = null;
+ this.xmlDoc = null;
+ this.doXPath = null;
+ this.doXPathOpera = null;
+ this.doXSLTransToObject = null;
+ this.doXSLTransToString = null;
+ this.loadXML = null;
+ this.loadXMLString = null;
+ // this.waitLoadFunction = null;
+ this.doSerialization = null;
+ this.xmlNodeToJSON = null;
+ this.getXMLTopNode = null;
+ this.setXSLParamValue = null;
return null;
}
dtmlXMLLoaderObject.prototype.xmlNodeToJSON = function(node){
- var t={};
- for (var i=0; i<node.attributes.length; i++)
- t[node.attributes[i].name]=node.attributes[i].value;
- t["_tagvalue"]=node.firstChild?node.firstChild.nodeValue:"";
- for (var i=0; i<node.childNodes.length; i++){
- var name=node.childNodes[i].tagName;
- if (name){
- if (!t[name]) t[name]=[];
- t[name].push(this.xmlNodeToJSON(node.childNodes[i]));
- }
- }
- return t;
- }
+ var t={};
+ for (var i=0; i<node.attributes.length; i++)
+ t[node.attributes[i].name]=node.attributes[i].value;
+ t["_tagvalue"]=node.firstChild?node.firstChild.nodeValue:"";
+ for (var i=0; i<node.childNodes.length; i++){
+ var name=node.childNodes[i].tagName;
+ if (name){
+ if (!t[name]) t[name]=[];
+ t[name].push(this.xmlNodeToJSON(node.childNodes[i]));
+ }
+ }
+ return t;
+}
-/**
- * @desc: Call wrapper
- * @type: private
- * @param: funcObject - action handler
- * @param: dhtmlObject - user data
- * @returns: function handler
- * @topic: 0
- */
+/**
+ * @desc: Call wrapper
+ * @type: private
+ * @param: funcObject - action handler
+ * @param: dhtmlObject - user data
+ * @returns: function handler
+ * @topic: 0
+ */
function callerFunction(funcObject, dhtmlObject){
this.handler=function(e){
if (!e)
@@ -254,21 +277,21 @@ function callerFunction(funcObject, dhtmlObject){ return this.handler;
};
-/**
- * @desc: Calculate absolute position of html object
- * @type: private
- * @param: htmlObject - html object
- * @topic: 0
- */
+/**
+ * @desc: Calculate absolute position of html object
+ * @type: private
+ * @param: htmlObject - html object
+ * @topic: 0
+ */
function getAbsoluteLeft(htmlObject){
return getOffset(htmlObject).left;
}
/**
- * @desc: Calculate absolute position of html object
- * @type: private
- * @param: htmlObject - html object
- * @topic: 0
- */
+ * @desc: Calculate absolute position of html object
+ * @type: private
+ * @param: htmlObject - html object
+ * @topic: 0
+ */
function getAbsoluteTop(htmlObject){
return getOffset(htmlObject).top;
}
@@ -295,19 +318,19 @@ function getOffsetRect(elem) { return { top: Math.round(top), left: Math.round(left) };
}
function getOffset(elem) {
- if (elem.getBoundingClientRect && !_isChrome) {
+ if (elem.getBoundingClientRect) {
return getOffsetRect(elem);
} else {
return getOffsetSum(elem);
}
}
-/**
-* @desc: Convert string to it boolean representation
-* @type: private
-* @param: inputString - string for covertion
-* @topic: 0
-*/
+/**
+ * @desc: Convert string to it boolean representation
+ * @type: private
+ * @param: inputString - string for covertion
+ * @topic: 0
+ */
function convertStringToBoolean(inputString){
if (typeof (inputString) == "string")
inputString=inputString.toLowerCase();
@@ -326,12 +349,12 @@ function convertStringToBoolean(inputString){ }
}
-/**
-* @desc: find out what symbol to use as url param delimiters in further params
-* @type: private
-* @param: str - current url string
-* @topic: 0
-*/
+/**
+ * @desc: find out what symbol to use as url param delimiters in further params
+ * @type: private
+ * @param: str - current url string
+ * @topic: 0
+ */
function getUrlSymbol(str){
if (str.indexOf("?") != -1)
return "&"
@@ -369,7 +392,7 @@ dhtmlDragAndDropObject.prototype.addDragLanding=function(htmlNode, dhtmlObject){ htmlNode.dragLanding=dhtmlObject;
}
dhtmlDragAndDropObject.prototype.preCreateDragCopy=function(e){
- if ((e||event) && (e||event).button == 2)
+ if ((e||window.event) && (e||event).button == 2)
return;
if (window.dhtmlDragAndDrop.waitDrag){
@@ -379,6 +402,9 @@ dhtmlDragAndDropObject.prototype.preCreateDragCopy=function(e){ return false;
}
+ if (window.dhtmlDragAndDrop.dragNode)
+ window.dhtmlDragAndDrop.stopDrag(e);
+
window.dhtmlDragAndDrop.waitDrag=1;
window.dhtmlDragAndDrop.tempDOMU=document.body.onmouseup;
window.dhtmlDragAndDrop.tempDOMM=document.body.onmousemove;
@@ -387,7 +413,7 @@ dhtmlDragAndDropObject.prototype.preCreateDragCopy=function(e){ document.body.onmouseup=window.dhtmlDragAndDrop.preCreateDragCopy;
document.body.onmousemove=window.dhtmlDragAndDrop.callDrag;
window.dhtmlDragAndDrop.downtime = new Date().valueOf();
-
+
if ((e)&&(e.preventDefault)){
e.preventDefault();
@@ -401,25 +427,28 @@ dhtmlDragAndDropObject.prototype.callDrag=function(e){ dragger=window.dhtmlDragAndDrop;
if ((new Date()).valueOf()-dragger.downtime<100) return;
- if ((e.button == 0)&&(_isIE))
- return dragger.stopDrag();
+ //if ((e.button == 0)&&(_isIE))
+ // return dragger.stopDrag();
- if (!dragger.dragNode&&dragger.waitDrag){
- dragger.dragNode=dragger.dragStartObject._createDragNode(dragger.dragStartNode, e);
+ if (!dragger.dragNode){
+ if (dragger.waitDrag){
+ dragger.dragNode=dragger.dragStartObject._createDragNode(dragger.dragStartNode, e);
- if (!dragger.dragNode)
- return dragger.stopDrag();
+ if (!dragger.dragNode)
+ return dragger.stopDrag();
- dragger.dragNode.onselectstart=function(){return false;}
- dragger.gldragNode=dragger.dragNode;
- document.body.appendChild(dragger.dragNode);
- document.body.onmouseup=dragger.stopDrag;
- dragger.waitDrag=0;
- dragger.dragNode.pWindow=window;
- dragger.initFrameRoute();
+ dragger.dragNode.onselectstart=function(){return false;}
+ dragger.gldragNode=dragger.dragNode;
+ document.body.appendChild(dragger.dragNode);
+ document.body.onmouseup=dragger.stopDrag;
+ dragger.waitDrag=0;
+ dragger.dragNode.pWindow=window;
+ dragger.initFrameRoute();
+ }
+ else return dragger.stopDrag(e, true);
}
- if (dragger.dragNode.parentNode != window.document.body){
+ if (dragger.dragNode.parentNode != window.document.body && dragger.gldragNode){
var grd = dragger.gldragNode;
if (dragger.gldragNode.old)
@@ -429,6 +458,9 @@ dhtmlDragAndDropObject.prototype.callDrag=function(e){ grd.parentNode.removeChild(grd);
var oldBody = dragger.dragNode.pWindow;
+ if (grd.pWindow && grd.pWindow.dhtmlDragAndDrop.lastLanding)
+ grd.pWindow.dhtmlDragAndDrop.lastLanding.dragLanding._dragOut(grd.pWindow.dhtmlDragAndDrop.lastLanding);
+
// var oldp=dragger.dragNode.parentObject;
if (_isIE){
var div = document.createElement("Div");
@@ -545,19 +577,19 @@ dhtmlDragAndDropObject.prototype.stopFrameRoute=function(win){ for (var i = 0; i < window.frames.length; i++){
try{
- if ((window.frames[i] != win)&&(window.frames[i].dhtmlDragAndDrop))
- window.frames[i].dhtmlDragAndDrop.stopFrameRoute(window);
+ if ((window.frames[i] != win)&&(window.frames[i].dhtmlDragAndDrop))
+ window.frames[i].dhtmlDragAndDrop.stopFrameRoute(window);
} catch(e){}
}
try{
- if ((parent.dhtmlDragAndDrop)&&(parent != window)&&(parent != win))
- parent.dhtmlDragAndDrop.stopFrameRoute(window);
+ if ((parent.dhtmlDragAndDrop)&&(parent != window)&&(parent != win))
+ parent.dhtmlDragAndDrop.stopFrameRoute(window);
} catch(e){}
}
dhtmlDragAndDropObject.prototype.initFrameRoute=function(win, mode){
if (win){
- window.dhtmlDragAndDrop.preCreateDragCopy({});
+ window.dhtmlDragAndDrop.preCreateDragCopy();
window.dhtmlDragAndDrop.dragStartNode=win.dhtmlDragAndDrop.dragStartNode;
window.dhtmlDragAndDrop.dragStartObject=win.dhtmlDragAndDrop.dragStartObject;
window.dhtmlDragAndDrop.dragNode=win.dhtmlDragAndDrop.dragNode;
@@ -569,14 +601,14 @@ dhtmlDragAndDropObject.prototype.initFrameRoute=function(win, mode){ window.dhtmlDragAndDrop.calculateFramePosition();
}
try{
- if ((parent.dhtmlDragAndDrop)&&(parent != window)&&(parent != win))
- parent.dhtmlDragAndDrop.initFrameRoute(window);
+ if ((parent.dhtmlDragAndDrop)&&(parent != window)&&(parent != win))
+ parent.dhtmlDragAndDrop.initFrameRoute(window);
}catch(e){}
for (var i = 0; i < window.frames.length; i++){
try{
- if ((window.frames[i] != win)&&(window.frames[i].dhtmlDragAndDrop))
- window.frames[i].dhtmlDragAndDrop.initFrameRoute(window, ((!win||mode) ? 1 : 0));
+ if ((window.frames[i] != win)&&(window.frames[i].dhtmlDragAndDrop))
+ window.frames[i].dhtmlDragAndDrop.initFrameRoute(window, ((!win||mode) ? 1 : 0));
} catch(e){}
}
}
@@ -587,9 +619,9 @@ _isOpera = false; _isKHTML = false;
_isMacOS = false;
_isChrome = false;
+_FFrv = false;
_KHTMLrv = false;
_OperaRv = false;
-_FFrv = false;
if (navigator.userAgent.indexOf('Macintosh') != -1)
_isMacOS=true;
@@ -599,11 +631,11 @@ if (navigator.userAgent.toLowerCase().indexOf('chrome')>-1) _isChrome=true;
if ((navigator.userAgent.indexOf('Safari') != -1)||(navigator.userAgent.indexOf('Konqueror') != -1)){
- var _KHTMLrv = parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf('Safari')+7, 5));
+ _KHTMLrv = parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf('Safari')+7, 5));
if (_KHTMLrv > 525){ //mimic FF behavior for Safari 3.1+
_isFF=true;
- var _FFrv = 1.9;
+ _FFrv = 1.9;
} else
_isKHTML=true;
} else if (navigator.userAgent.indexOf('Opera') != -1){
@@ -614,10 +646,12 @@ if ((navigator.userAgent.indexOf('Safari') != -1)||(navigator.userAgent.indexOf( else if (navigator.appName.indexOf("Microsoft") != -1){
_isIE=true;
- if (navigator.appVersion.indexOf("MSIE 8.0")!= -1 && document.compatMode != "BackCompat") _isIE=8;
+ if ((navigator.appVersion.indexOf("MSIE 8.0")!= -1 || navigator.appVersion.indexOf("MSIE 9.0")!= -1 || navigator.appVersion.indexOf("MSIE 10.0")!= -1 ) && document.compatMode != "BackCompat"){
+ _isIE=8;
+ }
} else {
_isFF=true;
- var _FFrv = parseFloat(navigator.userAgent.split("rv:")[1])
+ _FFrv = parseFloat(navigator.userAgent.split("rv:")[1])
}
@@ -844,9 +878,9 @@ dtmlXMLLoaderObject.prototype.doXSLTransToString=function(xslDoc, xmlDoc){ dtmlXMLLoaderObject.prototype.doSerialization=function(xmlDoc){
if (!xmlDoc)
- xmlDoc=this.xmlDoc;
+ xmlDoc=this.xmlDoc;
if (xmlDoc.responseXML)
- xmlDoc=xmlDoc.responseXML
+ xmlDoc=xmlDoc.responseXML
if (!_isIE){
var xmlSerializer = new XMLSerializer();
return xmlSerializer.serializeToString(xmlDoc);
@@ -855,65 +889,314 @@ dtmlXMLLoaderObject.prototype.doSerialization=function(xmlDoc){ }
/**
-* @desc:
-* @type: private
-*/
+ * @desc:
+ * @type: private
+ */
dhtmlxEventable=function(obj){
- obj.dhx_SeverCatcherPath="";
- obj.attachEvent=function(name, catcher, callObj){
- name='ev_'+name.toLowerCase();
- if (!this[name])
- this[name]=new this.eventCatcher(callObj||this);
-
- return(name+':'+this[name].addEvent(catcher)); //return ID (event name & event ID)
+ obj.attachEvent=function(name, catcher, callObj){
+ name='ev_'+name.toLowerCase();
+ if (!this[name])
+ this[name]=new this.eventCatcher(callObj||this);
+
+ return(name+':'+this[name].addEvent(catcher)); //return ID (event name & event ID)
+ }
+ obj.callEvent=function(name, arg0){
+ name='ev_'+name.toLowerCase();
+ if (this[name])
+ return this[name].apply(this, arg0);
+ return true;
+ }
+ obj.checkEvent=function(name){
+ return (!!this['ev_'+name.toLowerCase()])
+ }
+ obj.eventCatcher=function(obj){
+ var dhx_catch = [];
+ var z = function(){
+ var res = true;
+ for (var i = 0; i < dhx_catch.length; i++){
+ if (dhx_catch[i] != null){
+ var zr = dhx_catch[i].apply(obj, arguments);
+ res=res&&zr;
+ }
+ }
+ return res;
}
- obj.callEvent=function(name, arg0){
- name='ev_'+name.toLowerCase();
- if (this[name])
- return this[name].apply(this, arg0);
- return true;
+ z.addEvent=function(ev){
+ if (typeof (ev) != "function")
+ ev=eval(ev);
+ if (ev)
+ return dhx_catch.push(ev)-1;
+ return false;
}
- obj.checkEvent=function(name){
- return (!!this['ev_'+name.toLowerCase()])
+ z.removeEvent=function(id){
+ dhx_catch[id]=null;
}
- obj.eventCatcher=function(obj){
- var dhx_catch = [];
- var z = function(){
- var res = true;
- for (var i = 0; i < dhx_catch.length; i++){
- if (dhx_catch[i] != null){
- var zr = dhx_catch[i].apply(obj, arguments);
- res=res&&zr;
- }
- }
- return res;
+ return z;
+ }
+ obj.detachEvent=function(id){
+ if (id != false){
+ var list = id.split(':'); //get EventName and ID
+ this[list[0]].removeEvent(list[1]); //remove event
+ }
+ }
+ obj.detachAllEvents = function(){
+ for (var name in this){
+ if (name.indexOf("ev_")==0)
+ delete this[name];
+ }
+ }
+ obj = null;
+};
+ +if(!window.dhtmlx)
+ window.dhtmlx = {};
+
+(function(){
+ var _dhx_msg_cfg = null;
+ function callback(config, result){
+ var usercall = config.callback;
+ modality(false);
+ config.box.parentNode.removeChild(config.box);
+ _dhx_msg_cfg = config.box = null;
+ if (usercall)
+ usercall(result);
+ }
+ function modal_key(e){
+ if (_dhx_msg_cfg){
+ e = e||event;
+ var code = e.which||event.keyCode;
+ if (dhtmlx.message.keyboard){
+ if (code == 13 || code == 32)
+ callback(_dhx_msg_cfg, true);
+ if (code == 27)
+ callback(_dhx_msg_cfg, false);
}
- z.addEvent=function(ev){
- if (typeof (ev) != "function")
- ev=eval(ev);
- if (ev)
- return dhx_catch.push(ev)-1;
- return false;
+ if (e.preventDefault)
+ e.preventDefault();
+ return !(e.cancelBubble = true);
+ }
+ }
+ if (document.attachEvent)
+ document.attachEvent("onkeydown", modal_key);
+ else
+ document.addEventListener("keydown", modal_key, true);
+
+ function modality(mode){
+ if(!modality.cover){
+ modality.cover = document.createElement("DIV");
+ //necessary for IE only
+ modality.cover.onkeydown = modal_key;
+ modality.cover.className = "dhx_modal_cover";
+ document.body.appendChild(modality.cover);
+ }
+ var height = document.body.scrollHeight;
+ modality.cover.style.display = mode?"inline-block":"none";
+ }
+
+ function button(text, result){
+ var button_css = "dhtmlx_"+text.toLowerCase().replace(/ /g, "_")+"_button"; // dhtmlx_ok_button, dhtmlx_click_me_button
+ return "<div class='dhtmlx_popup_button "+button_css+"' result='"+result+"' ><div>"+text+"</div></div>";
+ }
+
+ function info(text){
+ if (!t.area){
+ t.area = document.createElement("DIV");
+ t.area.className = "dhtmlx_message_area";
+ t.area.style[t.position]="5px";
+ document.body.appendChild(t.area);
+ }
+
+ t.hide(text.id);
+ var message = document.createElement("DIV");
+ message.innerHTML = "<div>"+text.text+"</div>";
+ message.className = "dhtmlx-info dhtmlx-" + text.type;
+ message.onclick = function(){
+ t.hide(text.id);
+ text = null;
+ };
+
+ if (t.position == "bottom" && t.area.firstChild)
+ t.area.insertBefore(message,t.area.firstChild);
+ else
+ t.area.appendChild(message);
+
+ if (text.expire > 0)
+ t.timers[text.id]=window.setTimeout(function(){
+ t.hide(text.id);
+ }, text.expire);
+
+ t.pull[text.id] = message;
+ message = null;
+
+ return text.id;
+ }
+ function _boxStructure(config, ok, cancel){
+ var box = document.createElement("DIV");
+ box.className = " dhtmlx_modal_box dhtmlx-"+config.type;
+ box.setAttribute("dhxbox", 1);
+
+ var inner = '';
+
+ if (config.width)
+ box.style.width = config.width;
+ if (config.height)
+ box.style.height = config.height;
+ if (config.title)
+ inner+='<div class="dhtmlx_popup_title">'+config.title+'</div>';
+ inner+='<div class="dhtmlx_popup_text"><span>'+(config.content?'':config.text)+'</span></div><div class="dhtmlx_popup_controls">';
+ if (ok)
+ inner += button(config.ok || "OK", true);
+ if (cancel)
+ inner += button(config.cancel || "Cancel", false);
+ if (config.buttons){
+ for (var i=0; i<config.buttons.length; i++)
+ inner += button(config.buttons[i],i);
+ }
+ inner += '</div>';
+ box.innerHTML = inner;
+
+ if (config.content){
+ var node = config.content;
+ if (typeof node == "string")
+ node = document.getElementById(node);
+ if (node.style.display == 'none')
+ node.style.display = "";
+ box.childNodes[config.title?1:0].appendChild(node);
+ }
+
+ box.onclick = function(e){
+ e = e ||event;
+ var source = e.target || e.srcElement;
+ if (!source.className) source = source.parentNode;
+ if (source.className.split(" ")[0] == "dhtmlx_popup_button"){
+ result = source.getAttribute("result");
+ result = (result == "true")||(result == "false"?false:result);
+ callback(config, result);
}
- z.removeEvent=function(id){
- dhx_catch[id]=null;
+ };
+ config.box = box;
+ if (ok||cancel)
+ _dhx_msg_cfg = config;
+
+ return box;
+ }
+ function _createBox(config, ok, cancel){
+ var box = config.tagName ? config : _boxStructure(config, ok, cancel);
+
+ if (!config.hidden)
+ modality(true);
+ document.body.appendChild(box);
+ var x = Math.abs(Math.floor(((window.innerWidth||document.documentElement.offsetWidth) - box.offsetWidth)/2));
+ var y = Math.abs(Math.floor(((window.innerHeight||document.documentElement.offsetHeight) - box.offsetHeight)/2));
+ if (config.position == "top")
+ box.style.top = "-3px";
+ else
+ box.style.top = y+'px';
+ box.style.left = x+'px';
+ //necessary for IE only
+ box.onkeydown = modal_key;
+
+ box.focus();
+ if (config.hidden)
+ dhtmlx.modalbox.hide(box);
+
+ return box;
+ }
+
+ function alertPopup(config){
+ return _createBox(config, true, false);
+ }
+ function confirmPopup(config){
+ return _createBox(config, true, true);
+ }
+ function boxPopup(config){
+ return _createBox(config);
+ }
+ function box_params(text, type, callback){
+ if (typeof text != "object"){
+ if (typeof type == "function"){
+ callback = type;
+ type = "";
}
- return z;
+ text = {text:text, type:type, callback:callback };
}
- obj.detachEvent=function(id){
- if (id != false){
- var list = id.split(':'); //get EventName and ID
- this[list[0]].removeEvent(list[1]); //remove event
- }
+ return text;
+ }
+ function params(text, type, expire, id){
+ if (typeof text != "object")
+ text = {text:text, type:type, expire:expire, id:id};
+ text.id = text.id||t.uid();
+ text.expire = text.expire||t.expire;
+ return text;
+ }
+ dhtmlx.alert = function(){
+ text = box_params.apply(this, arguments);
+ text.type = text.type || "confirm";
+ return alertPopup(text);
+ };
+ dhtmlx.confirm = function(){
+ text = box_params.apply(this, arguments);
+ text.type = text.type || "alert";
+ return confirmPopup(text);
+ };
+ dhtmlx.modalbox = function(){
+ text = box_params.apply(this, arguments);
+ text.type = text.type || "alert";
+ return boxPopup(text);
+ };
+ dhtmlx.modalbox.hide = function(node){
+ while (node && node.getAttribute && !node.getAttribute("dhxbox"))
+ node = node.parentNode;
+ if (node){
+ node.parentNode.removeChild(node);
+ modality(false);
}
- obj.detachAllEvents = function(){
- for (var name in this){
- if (name.indexOf("ev_")==0)
- delete this[name];
- }
+ };
+ var t = dhtmlx.message = function(text, type, expire, id){
+ text = params.apply(this, arguments);
+ text.type = text.type||"info";
+
+ var subtype = text.type.split("-")[0];
+ switch (subtype){
+ case "alert":
+ return alertPopup(text);
+ case "confirm":
+ return confirmPopup(text);
+ case "modalbox":
+ return boxPopup(text);
+ default:
+ return info(text);
+ break;
}
-}
- + };
+
+ t.seed = (new Date()).valueOf();
+ t.uid = function(){return t.seed++;};
+ t.expire = 4000;
+ t.keyboard = true;
+ t.position = "top";
+ t.pull = {};
+ t.timers = {};
+
+ t.hideAll = function(){
+ for (var key in t.pull)
+ t.hide(key);
+ };
+ t.hide = function(id){
+ var obj = t.pull[id];
+ if (obj && obj.parentNode){
+ window.setTimeout(function(){
+ obj.parentNode.removeChild(obj);
+ obj = null;
+ },2000);
+ obj.className+=" hidden";
+
+ if(t.timers[id])
+ window.clearTimeout(t.timers[id]);
+ delete t.pull[id];
+ }
+ };
+})(); /**
* @desc: constructor, data processor object
* @param: serverProcessorURL - url used for update
@@ -1134,6 +1417,8 @@ dataProcessor.prototype={ keys.push(key);
}
stack.push("ids="+this.escape(keys.join(",")));
+ if (dhtmlx.security_key)
+ stack.push("dhx_security="+dhtmlx.security_key);
return stack.join("&");
}
},
@@ -1153,7 +1438,7 @@ dataProcessor.prototype={ if (rowId)
this._in_progress[rowId]=(new Date()).valueOf();
var a2=new dtmlXMLLoaderObject(this.afterUpdate,this,true);
-
+
var a3 = this.serverProcessor+(this._user?(getUrlSymbol(this.serverProcessor)+["dhx_user="+this._user,"dhx_version="+this.obj.getUserData(0,"version")].join("&")):"");
if (this._tMode!="POST")
@@ -1497,171 +1782,6 @@ dataProcessor.prototype={ };
//(c)dhtmlx ltd. www.dhtmlx.com -dataProcessor.prototype._o_init = dataProcessor.prototype.init;
-dataProcessor.prototype.init=function(obj){
- this._console=this._console||this._createConsole();
- this.attachEvent("onValidatationError",function(rowId){
- this._log("Validation error for ID="+(rowId||"[multiple]"));
- return true;
- });
- return this._o_init(obj);
-}
-
-dataProcessor.prototype._createConsole=function(){
- var c=document.createElement("DIV");
- c.style.cssText='width:450px; height:420px; overflow:auto; position:absolute; z-index:99999; background-color:white; top:0px; right:0px; border:1px dashed black; font-family:Tahoma; Font-size:10pt;';
- c.innerHTML="<div style='width:100%; background-color:gray; font-weight:bold; color:white;'><span style='cursor:pointer;float:right;' onclick='this.parentNode.parentNode.style.display=\"none\"'><sup>[close] </sup></span><span style='cursor:pointer;float:right;' onclick='this.parentNode.parentNode.childNodes[2].innerHTML=\"\"'><sup>[clear] </sup></span> DataProcessor</div><div style='width:100%; height:200px; overflow-Y:scroll;'> Current state</div><div style='width:100%; height:200px; overflow-Y:scroll;'> Log:</div>";
- if (document.body) document.body.insertBefore(c,document.body.firstChild);
- else dhtmlxEvent(window,"load",function(){
- document.body.insertBefore(c,document.body.firstChild);
- })
- dhtmlxEvent(window,"dblclick",function(){
- c.style.display='';
- })
- return c;
-}
-
-dataProcessor.prototype._error=function(data){
- this._log("<span style='color:red'>"+data+"</span>");
-}
-dataProcessor.prototype._log=function(data){
- var div=document.createElement("DIV");
- div.innerHTML = data;
- var parent=this._console.childNodes[2];
- parent.appendChild(div);
- parent.scrollTop=parent.scrollHeight;
-
- if (window.console && window.console.log)
- window.console.log("DataProcessor :: "+data.replace(" "," ").replace("<b>","").replace("</b>",""));
-
-}
-dataProcessor.prototype._updateStat=function(data){
- var data=[" Current state"];
- for(var i=0;i<this.updatedRows.length;i++)
- data.push(" ID:"+this.updatedRows[i]+" Status: "+(this.obj.getUserData(this.updatedRows[i],"!nativeeditor_status")||"updated")+", "+(this.is_invalid(this.updatedRows[i])||"valid"))
- this._console.childNodes[1].innerHTML=data.join("<br/>")+"<hr/>Current mode: "+this.updateMode;
-}
-dataProcessor.prototype.xml_analize=function(xml){
- if (_isFF){
- if (!xml.xmlDoc.responseXML)
- this._error("Not an XML, probably incorrect content type specified ( must be text/xml ), or some text output was started before XML data");
- else if (xml.xmlDoc.responseXML.firstChild.tagName=="parsererror")
- this._error(xml.xmlDoc.responseXML.firstChild.textContent);
- else return true;
- } else if (_isIE){
- if (xml.xmlDoc.responseXML.parseError.errorCode)
- this._error("XML error : "+xml.xmlDoc.responseXML.parseError.reason);
- else if (!xml.xmlDoc.responseXML.documentElement)
- this._error("Not an XML, probably incorrect content type specified ( must be text/xml ), or some text output was started before XML data");
- else return true;
- }
- return false;
-}
-
-dataProcessor.wrap=function(name,before,after){
- var d=dataProcessor.prototype;
- if (!d._wrap) d._wrap={};
- d._wrap[name]=d[name];
- d[name]=function(){
- if (before) before.apply(this,arguments);
- var res=d._wrap[name].apply(this,arguments);
- if (after) after.apply(this,[arguments,res]);
- return res;
- }
-};
-
-dataProcessor.wrap("setUpdated",function(rowId,state,mode){
- this._log(" row <b>"+rowId+"</b> "+(state?"marked":"unmarked")+" ["+(mode||"updated")+","+(this.is_invalid(rowId)||"valid")+"]");
-},function(){
- this._updateStat();
-});
-
-
-
-dataProcessor.wrap("sendData",function(rowId){
- if (rowId){
- this._log(" Initiating data sending for <b>"+rowId+"</b>");
- if (this.obj.mytype=="tree"){
- if (!this.obj._idpull[rowId])
- this._log(" Error! item with such ID not exists <b>"+rowId+"</b>");
- } else {
- if (this.rowsAr && !this.obj.rowsAr[rowId])
- this._log(" Error! row with such ID not exists <b>"+rowId+"</b>");
- }
- }
-},function(){
-
-});
-
-dataProcessor.wrap("sendAllData",function(){
- this._log(" Initiating data sending for <b>all</b> rows ");
-},function(){
-
-});
-dataProcessor.logSingle=function(data,id){
- var tdata = {};
- if (id)
- tdata[id] = data;
- else
- tdata = data;
-
- var url = [];
- for (var key in tdata) {
- url.push("<fieldset><legend>"+key+"</legend>");
- var suburl = [];
-
- for (var ikey in tdata[key])
- suburl.push(ikey+" = "+tdata[key][ikey]);
-
- url.push(suburl.join("<br>"));
- url.push("</fieldset>");
- }
- return url.join("");
-}
-dataProcessor.wrap("_sendData",function(data,rowId){
- if (rowId)
- this._log(" Sending in one-by-one mode, current ID = "+rowId);
- else
- this._log(" Sending all data at once");
- this._log(" Server url: "+this.serverProcessor+" <a onclick='this.parentNode.nextSibling.firstChild.style.display=\"block\"' href='#'>parameters</a>");
- var url = [];
- this._log("<blockquote style='display:none;'>"+dataProcessor.logSingle(data,rowId)+"<blockquote>");
-},function(){
-
-});
-
-
-dataProcessor.wrap("afterUpdate",function(that,b,c,d,xml){
- that._log(" Server response received <a onclick='this.nextSibling.style.display=\"block\"' href='#'>details</a><blockquote style='display:none'><code>"+(xml.xmlDoc.responseText||"").replace(/\&/g,"&").replace(/</g,"<").replace(/>/g,">")+"</code></blockquote>");
- if (!that.xml_analize(xml)) return;
- var atag=xml.doXPath("//data/action");
- if (!atag){
- that._log(" No actions found");
- var atag=xml.getXMLTopNode("data");
- if (!atag) that._log(" XML not valid");
- else that._log(" Incorrect content type - need to be text/xml");
- }
-},function(){
-
-});
-
-dataProcessor.wrap("afterUpdateCallback",function(sid,tid,action){
- if (this.obj.mytype=="tree"){
- if (!this.obj._idpull[sid]) this._log("Incorrect SID, item with such ID not exists in grid");
- } else {
- if (this.obj.rowsAr && !this.obj.rowsAr[sid]) this._log("Incorrect SID, row with such ID not exists in grid");
- }
- this._log(" Action: "+action+" SID:"+sid+" TID:"+tid);
-},function(){
-
-});
-
-
-
-
-
-
- /*
dhx_sort[index]=direction
dhx_filter[index]=mask
@@ -1798,8 +1918,9 @@ dhtmlxError.catchError("LoadXML",function(a,b,c){ }
});
-window.dhtmlXScheduler=window.scheduler={version:3.0};
+window.dhtmlXScheduler = window.scheduler = { version: "3.5.0" };
dhtmlxEventable(scheduler);
+
scheduler.init=function(id,date,mode){
date=date||(new Date());
mode=mode||"week";
@@ -1818,8 +1939,10 @@ scheduler.init=function(id,date,mode){ dhtmlxEvent(window,"resize",function(){
window.clearTimeout(scheduler._resize_timer);
scheduler._resize_timer=window.setTimeout(function(){
- if (scheduler.callEvent("onSchedulerResize",[]))
+ if (scheduler.callEvent("onSchedulerResize",[])) {
scheduler.update_view();
+ scheduler.callEvent("onAfterSchedulerResize", []);
+ }
}, 100);
});
this.set_sizes();
@@ -1837,7 +1960,8 @@ scheduler.xy={ menu_width:25,
margin_top:0,
margin_left:0,
- editor_width:140
+ editor_width:140,
+ lightbox_additional_height:50
};
scheduler.keys={
edit_save:13,
@@ -1873,6 +1997,7 @@ scheduler.get_elements=function(){ var els=this._obj.getElementsByTagName("DIV");
for (var i=0; i < els.length; i++){
var name=els[i].className;
+ if (name) name = name.split(" ")[0];
if (!this._els[name]) this._els[name]=[];
this._els[name].push(els[i]);
@@ -1898,10 +2023,15 @@ scheduler.set_actions=function(){ };
this._obj.ondblclick=function(e){
scheduler._on_dbl_click(e||event);
- }
+ };
+ this._obj.oncontextmenu = function(e) {
+ var ev = e||event;
+ var src = ev.target||ev.srcElement;
+ var returnValue = scheduler.callEvent("onContextMenu", [scheduler._locate_event(src), ev]);
+ return returnValue;
+ };
};
scheduler.select=function(id){
- if (this._table_view || !this.getEvent(id)._timed) return; //temporary block
if (this._select_id==id) return;
this.editStop(false);
this.unselect();
@@ -1922,19 +2052,28 @@ scheduler.getState=function(){ max_date: this._max_date,
editor_id: this._edit_id,
lightbox_id: this._lightbox_id,
- new_event: this._new_event
+ new_event: this._new_event,
+ select_id: this._select_id,
+ expanded: this.expanded,
+ drag_id: this._drag_id,
+ drag_mode: this._drag_mode
};
};
scheduler._click={
dhx_cal_data:function(e){
- //debugger;
var trg = e?e.target:event.srcElement;
var id = scheduler._locate_event(trg);
e = e || event;
- if ((id && !scheduler.callEvent("onClick",[id,e])) ||scheduler.config.readonly) return;
-
- if (id) {
+
+ if (!id) {
+ scheduler.callEvent("onEmptyClick",[scheduler.getActionData(e).date, e]);
+ } else {
+ if ( !scheduler.callEvent("onClick",[id,e]) || scheduler.config.readonly ) return;
+ }
+
+ if (id && scheduler.config.select) {
+
scheduler.select(id);
var mask = trg.className;
if (mask.indexOf("_icon")!=-1)
@@ -1958,13 +2097,30 @@ scheduler._click={ scheduler.setCurrentView(scheduler._date,mode);
},
buttons:{
- "delete":function(id){ var c=scheduler.locale.labels.confirm_deleting; if (!c||confirm(c)) scheduler.deleteEvent(id); },
+ "delete":function(id){
+ var c = scheduler.locale.labels.confirm_deleting;
+ scheduler._dhtmlx_confirm(c, scheduler.locale.labels.title_confirm_deleting, function(){ scheduler.deleteEvent(id) });
+ },
edit:function(id){ scheduler.edit(id); },
save:function(id){ scheduler.editStop(true); },
details:function(id){ scheduler.showLightbox(id); },
cancel:function(id){ scheduler.editStop(false); }
}
};
+scheduler._dhtmlx_confirm = function(message, title, callback) {
+ if (!message)
+ return callback();
+ var opts = { text: message };
+ if (title)
+ opts.title = title;
+ if (callback) {
+ opts.callback = function(result) {
+ if (result)
+ callback();
+ };
+ }
+ dhtmlx.confirm(opts);
+};
scheduler.addEventNow=function(start,end,e){
var base = {};
if (start && start.constructor.toString().match(/object/i) !== null){
@@ -1981,7 +2137,7 @@ scheduler.addEventNow=function(start,end,e){ start_date.setHours(start_hour);
start = start_date.valueOf();
}
- end = start+d;
+ end = start.valueOf()+d;
}
var end_date = new Date(end);
@@ -2012,29 +2168,36 @@ scheduler._on_dbl_click=function(e,src){ case "dhx_scale_holder_now":
case "dhx_month_body":
case "dhx_wa_day_data":
+ case "dhx_marked_timespan":
if (!scheduler.config.dblclick_create) break;
- var pos=this._mouse_coords(e);
- var start=this._min_date.valueOf()+(pos.y*this.config.time_step+(this._table_view?0:pos.x)*24*60)*60000;
- start = this._correct_shift(start);
- this.addEventNow(start,null,e);
+ this.addEventNow(this.getActionData(e).date,null,e);
break;
- case "dhx_body":
+ case "dhx_cal_event":
case "dhx_wa_ev_body":
+ case "dhx_agenda_line":
+ case "dhx_grid_event":
case "dhx_cal_event_line":
case "dhx_cal_event_clear":
var id = this._locate_event(src);
if (!this.callEvent("onDblClick",[id,e])) return;
- if (this.config.details_on_dblclick || this._table_view || !this.getEvent(id)._timed)
+ if (this.config.details_on_dblclick || this._table_view || !this.getEvent(id)._timed || !this.config.select)
this.showLightbox(id);
else
this.edit(id);
break;
- case "":
- if (src.parentNode)
- return scheduler._on_dbl_click(e,src.parentNode);
+ case "dhx_time_block":
+ case "dhx_cal_container":
+ return;
+ break;
default:
var t = this["dblclick_"+name];
- if (t) t.call(this,e);
+ if (t) {
+ t.call(this,e);
+ }
+ else {
+ if (src.parentNode && src != this)
+ return scheduler._on_dbl_click(e,src.parentNode);
+ }
break;
}
};
@@ -2060,25 +2223,31 @@ scheduler._mouse_coords=function(ev){ return handler.call(this,pos);
//transform to date
- if (!this._table_view){
- pos.x=Math.max(0,Math.ceil(pos.x/this._cols[0])-1);
+ if (!this._table_view) {
+ pos.x=Math.min(this._cols.length-1, Math.max(0,Math.ceil(pos.x/this._cols[0])-1));
pos.y=Math.max(0,Math.ceil(pos.y*60/(this.config.time_step*this.config.hour_size_px))-1)+this.config.first_hour*(60/this.config.time_step);
} else {
+ if (!this._cols || !this._colsS) // agenda/map views
+ return pos;
var dy=0;
for (dy=1; dy < this._colsS.heights.length; dy++)
if (this._colsS.heights[dy]>pos.y) break;
- pos.y=(Math.max(0,Math.ceil(pos.x/this._cols[0])-1)+Math.max(0,dy-1)*7)*24*60/this.config.time_step;
+ pos.y=Math.ceil( (Math.max(0, pos.x/this._cols[0])+Math.max(0,dy-1)*7)*24*60/this.config.time_step );
+
+ if (scheduler._drag_mode || this._mode == "month")
+ pos.y=(Math.max(0,Math.ceil(pos.x/this._cols[0])-1)+Math.max(0,dy-1)*7)*24*60/this.config.time_step;
+
pos.x=0;
}
return pos;
-}
+};
scheduler._close_not_saved=function(){
if (new Date().valueOf()-(scheduler._new_event||0) > 500 && scheduler._edit_id){
var c=scheduler.locale.labels.confirm_closing;
- if (!c || confirm(c))
- scheduler.editStop(scheduler.config.positive_closing);
+
+ scheduler._dhtmlx_confirm(c, scheduler.locale.labels.title_confirm_closing, function() { scheduler.editStop(scheduler.config.positive_closing); });
}
};
scheduler._correct_shift=function(start, back){
@@ -2088,7 +2257,7 @@ scheduler._on_mouse_move=function(e){ if (this._drag_mode){
var pos=this._mouse_coords(e);
if (!this._drag_pos || pos.custom || this._drag_pos.x!=pos.x || this._drag_pos.y!=pos.y){
-
+ var start, end;
if (this._edit_id!=this._drag_id)
this._close_not_saved();
@@ -2098,14 +2267,16 @@ scheduler._on_mouse_move=function(e){ this._close_not_saved();
this._loading=true; //will be ignored by dataprocessor
- var start=this._min_date.valueOf()+(pos.y*this.config.time_step+(this._table_view?0:pos.x)*24*60)*60000;
- //if (this._mode != "week" && this._mode != "day")
- start = this._correct_shift(start);
-
+ start = this._get_date_from_pos(pos).valueOf();
+
+ var res = this.callEvent("onBeforeEventCreated", [e]);
+ if (!res)
+ return;
+
if (!this._drag_start){
this._drag_start=start; return;
}
- var end = start;
+ end = start;
if (end==this._drag_start) return;
this._drag_id=this.uid();
@@ -2118,26 +2289,31 @@ scheduler._on_mouse_move=function(e){ }
var ev=this.getEvent(this._drag_id);
- var start,end;
+
if (this._drag_mode=="move"){
start = this._min_date.valueOf()+(pos.y*this.config.time_step+pos.x*24*60)*60000;
if (!pos.custom && this._table_view) start+=this.date.time_part(ev.start_date)*1000;
start = this._correct_shift(start);
end = ev.end_date.valueOf()-(ev.start_date.valueOf()-start);
- } else {
+ } else { // resize
start = ev.start_date.valueOf();
+ end = ev.end_date.valueOf();
if (this._table_view) {
- end = this._min_date.valueOf()+pos.y*this.config.time_step*60000 + (pos.custom?0:24*60*60000);
+ var resize_date = this._min_date.valueOf()+pos.y*this.config.time_step*60000 + (pos.custom?0:24*60*60000);
if (this._mode == "month")
- end = this._correct_shift(end, false);
- }
- else{
+ resize_date = this._correct_shift(resize_date, false);
+
+ if (pos.resize_from_start)
+ start = resize_date;
+ else
+ end = resize_date;
+ } else {
end = this.date.date_part(new Date(ev.end_date)).valueOf()+pos.y*this.config.time_step*60000;
this._els["dhx_cal_data"][0].style.cursor="s-resize";
if (this._mode == "week" || this._mode == "day")
end = this._correct_shift(end);
}
- if (this._drag_mode == "new-size"){
+ if (this._drag_mode == "new-size") {
if (end <= this._drag_start){
var shift = pos.shift||((this._table_view && !pos.custom)?24*60*60000:0);
start = end-(pos.shift?0:shift);
@@ -2145,25 +2321,30 @@ scheduler._on_mouse_move=function(e){ } else {
start = this._drag_start;
}
-
- } else if (end<=start)
- end=start+this.config.time_step*60000;
+ } else {
+ if (end<=start)
+ end=start+this.config.time_step*60000;
+ }
}
var new_end = new Date(end-1);
var new_start = new Date(start);
//prevent out-of-borders situation for day|week view
- if ( this._table_view || (new_end.getDate()==new_start.getDate() && new_end.getHours()<this.config.last_hour) || (scheduler._wa && scheduler._wa._dnd) ){
+ if ( this._table_view || (new_end.getDate()==new_start.getDate() && new_end.getHours()<this.config.last_hour) || scheduler._allow_dnd ){
ev.start_date=new_start;
ev.end_date=new Date(end);
- if (this.config.update_render)
+ if (this.config.update_render){
+ //fix for repaint after dnd and scroll issue, #231
+ var sx = scheduler._els["dhx_cal_data"][0].scrollTop;
this.update_view();
- else
+ scheduler._els["dhx_cal_data"][0].scrollTop = sx;
+ } else
this.updateEvent(this._drag_id);
}
- if (this._table_view)
+ if (this._table_view) {
this.for_rendered(this._drag_id,function(r){
r.className+=" dhx_in_move";
- })
+ });
+ }
}
} else {
if (scheduler.checkEvent("onMouseMove")){
@@ -2173,39 +2354,43 @@ scheduler._on_mouse_move=function(e){ }
}
};
-scheduler._on_mouse_context=function(e,src){
- return this.callEvent("onContextMenu",[this._locate_event(src),e]);
-};
scheduler._on_mouse_down=function(e,src){
if (this.config.readonly || this._drag_mode) return;
src = src||(e.target||e.srcElement);
- if (e.button==2||e.ctrlKey) return this._on_mouse_context(e,src);
- switch(src.className.split(" ")[0]){
+ var classname = src.className && src.className.split(" ")[0];
+ switch (classname) {
case "dhx_cal_event_line":
case "dhx_cal_event_clear":
if (this._table_view)
this._drag_mode="move"; //item in table mode
break;
- case "dhx_header":
- case "dhx_title":
+ case "dhx_event_move":
case "dhx_wa_ev_body":
- this._drag_mode="move"; //item in table mode
+ this._drag_mode="move";
break;
- case "dhx_footer":
- this._drag_mode="resize"; //item in table mode
+ case "dhx_event_resize":
+ this._drag_mode="resize";
break;
case "dhx_scale_holder":
case "dhx_scale_holder_now":
case "dhx_month_body":
case "dhx_matrix_cell":
+ case "dhx_marked_timespan":
this._drag_mode="create";
+ this.unselect(this._select_id);
break;
case "":
if (src.parentNode)
return scheduler._on_mouse_down(e,src.parentNode);
default:
+ if (scheduler.checkEvent("onMouseDown") && scheduler.callEvent("onMouseDown", [classname])) {
+ if (src.parentNode && src != this) {
+ return scheduler._on_mouse_down(e,src.parentNode);
+ }
+ }
this._drag_mode=null;
this._drag_id=null;
+ break;
}
if (this._drag_mode){
var id = this._locate_event(src);
@@ -2213,7 +2398,7 @@ scheduler._on_mouse_down=function(e,src){ this._drag_mode=this._drag_id=0;
else {
this._drag_id= id;
- this._drag_event=scheduler._lame_copy({},this._copy_event(this.getEvent(this._drag_id)||{}));
+ this._drag_event = scheduler._lame_clone(this.getEvent(this._drag_id) || {});
}
}
this._drag_start=null;
@@ -2225,30 +2410,35 @@ scheduler._on_mouse_up=function(e){ var ev=this.getEvent(this._drag_id);
if (this._drag_event._dhx_changed || !this._drag_event.start_date || ev.start_date.valueOf()!=this._drag_event.start_date.valueOf() || ev.end_date.valueOf()!=this._drag_event.end_date.valueOf()){
var is_new=(this._drag_mode=="new-size");
- if (!this.callEvent("onBeforeEventChanged",[ev,e,is_new])){
+ if (!this.callEvent("onBeforeEventChanged",[ev,e,is_new,this._drag_event])){
if (is_new)
this.deleteEvent(ev.id, true);
else {
- this._drag_event._dhx_changed = false;
- scheduler._lame_copy(ev, this._drag_event);
+ this._drag_event._dhx_changed = false;
+ scheduler._lame_copy(ev, this._drag_event);
this.updateEvent(ev.id);
}
} else {
+ var drag_id = this._drag_id;
+ this._drag_id = this._drag_mode = null;
if (is_new && this.config.edit_on_create){
this.unselect();
this._new_event=new Date();//timestamp of creation
- if (this._table_view || this.config.details_on_create) {
- this._drag_mode=null;
- return this.showLightbox(this._drag_id);
+ //if selection disabled - force lightbox usage
+ if (this._table_view || this.config.details_on_create || !this.config.select) {
+ return this.showLightbox(drag_id);
}
- this._drag_pos=true; //set flag to trigger full redraw
- this._select_id=this._edit_id=this._drag_id;
- } else if (!this._new_event)
- this.callEvent(is_new?"onEventAdded":"onEventChanged",[this._drag_id,this.getEvent(this._drag_id)]);
+ this._drag_pos = true; //set flag to trigger full redraw
+ this._select_id = this._edit_id = drag_id;
+ } else {
+ if (!this._new_event)
+ this.callEvent(is_new?"onEventAdded":"onEventChanged",[drag_id,this.getEvent(drag_id)]);
+ }
}
}
if (this._drag_pos) this.render_view_data(); //redraw even if there is no real changes - necessary for correct positioning item after drag
}
+ this._drag_id = null;
this._drag_mode=null;
this._drag_pos=null;
};
@@ -2257,44 +2447,55 @@ scheduler.update_view=function(){ if (this._load_mode && this._load()) return this._render_wait = true;
this.render_view_data();
};
-scheduler.setCurrentView=function(date,mode){
+scheduler.updateView = function(date, mode) {
date = date || this._date;
- mode = mode || this._mode;
-
- if (!this.callEvent("onBeforeViewChange",[this._mode,this._date,mode,date])) return;
+ mode = mode || this._mode;
- var dhx_cal_data = 'dhx_cal_data';
- var prev_scroll = (this._mode == mode && this.config.preserve_scroll)?this._els[dhx_cal_data][0].scrollTop:false; // saving current scroll
+ var dhx_cal_data = 'dhx_cal_data';
+
+ if (!this._mode)
+ this._obj.className += " dhx_scheduler_" + mode; else {
+ this._obj.className = this._obj.className.replace("dhx_scheduler_" + this._mode, "dhx_scheduler_" + mode);
+ }
+
+ var prev_scroll = (this._mode == mode && this.config.preserve_scroll) ? this._els[dhx_cal_data][0].scrollTop : false; // saving current scroll
//hide old custom view
- if (this[this._mode+"_view"] && mode && this._mode!=mode)
- this[this._mode+"_view"](false);
-
+ if (this[this._mode + "_view"] && mode && this._mode != mode)
+ this[this._mode + "_view"](false);
+
this._close_not_saved();
- var dhx_multi_day = 'dhx_multi_day';
- if(this._els[dhx_multi_day]) {
+ var dhx_multi_day = 'dhx_multi_day';
+ if (this._els[dhx_multi_day]) {
this._els[dhx_multi_day][0].parentNode.removeChild(this._els[dhx_multi_day][0]);
this._els[dhx_multi_day] = null;
}
-
- this._mode=mode;
- this._date=date;
- this._table_view=(this._mode=="month");
-
- var tabs=this._els["dhx_cal_tab"];
- for (var i=0; i < tabs.length; i++) {
- tabs[i].className="dhx_cal_tab"+((tabs[i].getAttribute("name")==this._mode+"_tab")?" active":"");
+
+ this._mode = mode;
+ this._date = date;
+ this._table_view = (this._mode == "month");
+
+ var tabs = this._els["dhx_cal_tab"];
+ for (var i = 0; i < tabs.length; i++) {
+ var name = tabs[i].className;
+ name = name.replace(/ active/g, "");
+ if (tabs[i].getAttribute("name") == this._mode + "_tab")
+ name = name + " active";
+ tabs[i].className = name;
}
-
+
//show new view
- var view=this[this._mode+"_view"];
- view?view(true):this.update_view();
+ var view = this[this._mode + "_view"];
+ view ? view(true) : this.update_view();
- if(typeof prev_scroll == "number") // if we are updating or working with the same view scrollTop should be saved
- this._els[dhx_cal_data][0].scrollTop = prev_scroll; // restoring original scroll
-
- this.callEvent("onViewChange",[this._mode,this._date]);
+ if (typeof prev_scroll == "number") // if we are updating or working with the same view scrollTop should be saved
+ this._els[dhx_cal_data][0].scrollTop = prev_scroll; // restoring original scroll
+};
+scheduler.setCurrentView = function(date, mode) {
+ if (!this.callEvent("onBeforeViewChange", [this._mode, this._date, mode, date])) return;
+ this.updateView(date, mode);
+ this.callEvent("onViewChange", [this._mode, this._date]);
};
scheduler._render_x_header = function(i,left,d,h){
//header scale
@@ -2306,34 +2507,33 @@ scheduler._render_x_header = function(i,left,d,h){ scheduler._reset_scale=function(){
//current mode doesn't support scales
//we mustn't call reset_scale for such modes, so it just to be sure
- if (!this.templates[this._mode+"_date"]) return;
-
- var h=this._els["dhx_cal_header"][0];
- var b=this._els["dhx_cal_data"][0];
+ if (!this.templates[this._mode + "_date"]) return;
+
+ var h = this._els["dhx_cal_header"][0];
+ var b = this._els["dhx_cal_data"][0];
var c = this.config;
-
- h.innerHTML="";
- b.scrollTop=0; //fix flickering in FF
- b.innerHTML="";
-
-
- var str=((c.readonly||(!c.drag_resize))?" dhx_resize_denied":"")+((c.readonly||(!c.drag_move))?" dhx_move_denied":"");
- if (str) b.className = "dhx_cal_data"+str;
-
-
- this._cols=[]; //store for data section
- this._colsS={height:0};
- this._dy_shift=0;
-
+
+ h.innerHTML = "";
+ b.scrollTop = 0; //fix flickering in FF
+ b.innerHTML = "";
+
+ var str = ((c.readonly || (!c.drag_resize)) ? " dhx_resize_denied" : "") + ((c.readonly || (!c.drag_move)) ? " dhx_move_denied" : "");
+ if (str) b.className = "dhx_cal_data" + str;
+
+ this._scales = {};
+ this._cols = []; //store for data section
+ this._colsS = {height: 0};
+ this._dy_shift = 0;
+
this.set_sizes();
- var summ=parseInt(h.style.width); //border delta
+ var summ=parseInt(h.style.width,10); //border delta
var left=0;
-
+
var d,dd,sd,today;
dd=this.date[this._mode+"_start"](new Date(this._date.valueOf()));
d=sd=this._table_view?scheduler.date.week_start(dd):dd;
today=this.date.date_part(new Date());
-
+
//reset date in header
var ed=scheduler.date.add(dd,1,this._mode);
var count = 7;
@@ -2353,7 +2553,7 @@ scheduler._reset_scale=function(){ this._render_x_header(i,left,d,h);
if (!this._table_view){
var scales=document.createElement("DIV");
- var cls = "dhx_scale_holder"
+ var cls = "dhx_scale_holder";
if (d.valueOf()==today.valueOf()) cls = "dhx_scale_holder_now";
scales.className=cls+" "+this.templates.week_date_class(d,today);
this.set_xy(scales,this._cols[i]-1,c.hour_size_px*(c.last_hour-c.first_hour),left+this.xy.scale_width+1,0);//-1 for border
@@ -2374,8 +2574,8 @@ scheduler._reset_scale=function(){ this._reset_month_scale(b,dd,sd);
else{
this._reset_hours_scale(b,dd,sd);
- if (c.multi_day){
- var dhx_multi_day = 'dhx_multi_day';
+ if (c.multi_day) {
+ var dhx_multi_day = 'dhx_multi_day';
if(this._els[dhx_multi_day]) {
this._els[dhx_multi_day][0].parentNode.removeChild(this._els[dhx_multi_day][0]);
@@ -2398,20 +2598,8 @@ scheduler._reset_scale=function(){ c1.appendChild(c2);
this._els[dhx_multi_day]=[c1,c2];
- this._els[dhx_multi_day][0].onclick = this._click.dhx_cal_data;
+ this._els[dhx_multi_day][0].onclick = this._click.dhx_cal_data;
}
-
- if (this.config.mark_now){
- var now = new Date();
- if (now < this._max_date && now > this._min_date && now.getHours() >= this.config.first_hour && now.getHours()<this.config.last_hour){
- var day = this.locate_holder_day(now);
- var sm = now.getHours()*60+now.getMinutes();
- var now_time = document.createElement("DIV");
- now_time.className = "dhx_now_time";
- now_time.style.top = (Math.round((sm*60*1000-this.config.first_hour*60*60*1000)*this.config.hour_size_px/(60*60*1000)))%(this.config.hour_size_px*24)+1+"px";
- b.childNodes[day].appendChild(now_time);
- }
- }
}
};
scheduler._reset_hours_scale=function(b,dd,sd){
@@ -2428,7 +2616,7 @@ scheduler._reset_hours_scale=function(b,dd,sd){ c.appendChild(cc);
date=this.date.add(date,1,"hour");
- };
+ }
b.appendChild(c);
if (this.config.scroll_hour)
b.scrollTop = this.config.hour_size_px*(this.config.scroll_hour-this.config.first_hour);
@@ -2448,13 +2636,14 @@ scheduler._reset_month_scale=function(b,dd,sd){ this._colsS.height=height+22;
var h = this._colsS.heights = [];
for (var i=0; i<=7; i++)
- tdcss[i]=" style='height:"+height+"px; width:"+((this._cols[i]||0)-1)+"px;' "
+ tdcss[i]=" style='height:"+height+"px; width:"+((this._cols[i]||0)-1)+"px;' ";
var cellheight = 0;
this._min_date=sd;
var html="<table cellpadding='0' cellspacing='0'>";
+ var rendered_dates = [];
for (var i=0; i<rows; i++){
html+="<tr>";
for (var j=0; j<7; j++){
@@ -2468,6 +2657,7 @@ scheduler._reset_month_scale=function(b,dd,sd){ cls='dhx_now';
html+=" class='"+cls+" "+this.templates.month_date_class(sd,cd)+"' ";
html+="><div class='dhx_month_head'>"+this.templates.month_day(sd)+"</div><div class='dhx_month_body' "+tdcss[j]+"></div></td>";
+ rendered_dates.push(sd);
sd=this.date.add(sd,1,"day");
}
html+="</tr>";
@@ -2477,7 +2667,20 @@ scheduler._reset_month_scale=function(b,dd,sd){ html+="</table>";
this._max_date=sd;
- b.innerHTML=html;
+ b.innerHTML=html;
+
+ this._scales = {};
+ var divs = b.getElementsByTagName('div');
+ for (var i=0; i<rendered_dates.length; i++) { // [header, body, header, body, ...]
+ var div = divs[(i*2)+1];
+ var date = rendered_dates[i];
+ this._scales[+date] = div;
+ }
+ for (var i=0; i<rendered_dates.length; i++) {
+ var date = rendered_dates[i];
+ this.callEvent("onScaleAdd", [this._scales[+date], date]);
+ }
+
return sd;
};
scheduler.getLabel = function(property, key) {
@@ -2494,19 +2697,58 @@ scheduler.getLabel = function(property, key) { }
return "";
};
-scheduler.updateCollection = function(list_name, collection){
- var list = scheduler.serverList(list_name);
- if(!list) return false;
- list.splice(0,list.length);
- list.push.apply(list, collection||[]);
- scheduler.callEvent("onOptionsLoad", []);
- scheduler.resetLightbox();
- return true;
+scheduler.updateCollection = function(list_name, collection) {
+ var list = scheduler.serverList(list_name);
+ if (!list) return false;
+ list.splice(0, list.length);
+ list.push.apply(list, collection || []);
+ scheduler.callEvent("onOptionsLoad", []);
+ scheduler.resetLightbox();
+ return true;
+};
+scheduler._lame_clone = function(object, cache) {
+ var i, t, result; // iterator, types array, result
+
+ cache = cache || [];
+
+ for (i=0; i<cache.length; i+=2)
+ if(object === cache[i])
+ return cache[i+1];
+
+ if (object && typeof object == "object") {
+ result = {};
+ t = [Array,Date,Number,String,Boolean];
+ for (i=0; i<t.length; i++) {
+ if (object instanceof t[i])
+ result = i ? new t[i](object) : new t[i](); // first one is array
+ }
+ cache.push(object, result);
+ for (i in object) {
+ if (Object.prototype.hasOwnProperty.apply(object, [i]))
+ result[i] = scheduler._lame_clone(object[i], cache)
+ }
+ }
+ return result || object;
+};
+scheduler._lame_copy = function(target, source) {
+ for (var key in source) {
+ if (source.hasOwnProperty(key)) {
+ target[key] = source[key];
+ }
+ }
+ return target;
+};
+scheduler._get_date_from_pos = function(pos) {
+ var start=this._min_date.valueOf()+(pos.y*this.config.time_step+(this._table_view?0:pos.x)*24*60)*60000;
+ return new Date(this._correct_shift(start));
};
-scheduler._lame_copy=function(target, source){
- for(var key in source)
- target[key] = source[key];
- return target;
+// n_ev - native event
+scheduler.getActionData = function(n_ev) {
+ var pos = this._mouse_coords(n_ev);
+ return {
+ date:this._get_date_from_pos(pos),
+ section:pos.section
+ };
};
scheduler.date={
@@ -2525,19 +2767,21 @@ scheduler.date={ date.setHours(0);
date.setMinutes(0);
date.setSeconds(0);
- date.setMilliseconds(0);
+ date.setMilliseconds(0);
+ if (date.getHours() != 0)
+ date.setTime(date.getTime() + 60 * 60 * 1000 * (24 - date.getHours()));
return date;
},
time_part:function(date){
return (date.valueOf()/1000 - date.getTimezoneOffset()*60)%86400;
},
week_start:function(date){
- var shift=date.getDay();
- if (scheduler.config.start_on_monday){
- if (shift===0) shift=6;
- else shift--;
- }
- return this.date_part(this.add(date,-1*shift,"day"));
+ var shift=date.getDay();
+ if (scheduler.config.start_on_monday){
+ if (shift===0) shift=6;
+ else shift--;
+ }
+ return this.date_part(this.add(date,-1*shift,"day"));
},
month_start:function(date){
date.setDate(1);
@@ -2548,21 +2792,29 @@ scheduler.date={ return this.month_start(date);
},
day_start:function(date){
- return this.date_part(date);
+ return this.date_part(date);
},
add:function(date,inc,mode){
var ndate=new Date(date.valueOf());
switch(mode){
+ case "week":
+ inc *= 7;
case "day":
- ndate.setDate(ndate.getDate()+inc);
- if(date.getDate()==ndate.getDate() && !!inc) {
- do {
- ndate.setTime(ndate.getTime()+60*60*1000);
- } while (date.getDate() == ndate.getDate())
+ ndate.setDate(ndate.getDate() + inc);
+ if (!date.getHours() && ndate.getHours()) //shift to yesterday
+ ndate.setTime(ndate.getTime() + 60 * 60 * 1000 * (24 - ndate.getHours()));
+ break;
+ case "month":
+ var new_month = ndate.getMonth()+inc;
+ var t_ndate = new Date(ndate);
+ ndate.setMonth(new_month);
+ if (ndate.getMonth() != new_month && ndate.getMonth() != (new_month % 12)) { // 31 March +1 Month = 1 May, need to make 30 April
+ t_ndate.setDate(1);
+ t_ndate.setMonth(new_month);
+ t_ndate.setDate(new Date(t_ndate.getFullYear(),new_month+1,0).getDate());
+ ndate = t_ndate;
}
break;
- case "week": ndate.setDate(ndate.getDate()+7*inc); break;
- case "month": ndate.setMonth(ndate.getMonth()+inc); break;
case "year": ndate.setYear(ndate.getFullYear()+inc); break;
case "hour": ndate.setHours(ndate.getHours()+inc); break;
case "minute": ndate.setMinutes(ndate.getMinutes()+inc); break;
@@ -2607,7 +2859,7 @@ scheduler.date={ return new Function("date","return \""+format+"\";");
},
str_to_date:function(format,utc){
- var splt="var temp=date.split(/[^0-9a-zA-Z]+/g);";
+ var splt="var temp=date.match(/[a-zA-Z]+|[0-9]+/g);";
var mask=format.match(/%[a-zA-Z]/g);
for (var i=0; i<mask.length; i++){
switch(mask[i]){
@@ -2628,16 +2880,16 @@ scheduler.date={ case "%i":
splt+="set[4]=temp["+i+"]||0;";
break;
- case "%Y": splt+="set[0]=temp["+i+"]||0;";
+ case "%Y": splt+="set[0]=temp["+i+"]||0;";
break;
case "%a":
- case "%A": splt+="set[3]=set[3]%12+((temp["+i+"]||'').toLowerCase()=='am'?0:12);";
+ case "%A": splt+="set[3]=set[3]%12+((temp["+i+"]||'').toLowerCase()=='am'?0:12);";
break;
- case "%s": splt+="set[5]=temp["+i+"]||0;";
+ case "%s": splt+="set[5]=temp["+i+"]||0;";
break;
- case "%M": splt+="set[1]=scheduler.locale.date.month_short_hash[temp["+i+"]]||0;";
+ case "%M": splt+="set[1]=scheduler.locale.date.month_short_hash[temp["+i+"]]||0;";
break;
- case "%F": splt+="set[1]=scheduler.locale.date.month_full_hash[temp["+i+"]]||0;";
+ case "%F": splt+="set[1]=scheduler.locale.date.month_full_hash[temp["+i+"]]||0;";
break;
default:
break;
@@ -2647,7 +2899,6 @@ scheduler.date={ if (utc) code =" Date.UTC("+code+")";
return new Function("date","var set=[0,0,1,0,0,0]; "+splt+" return new Date("+code+");");
},
-
getISOWeek: function(ndate) {
if(!ndate) return false;
var nday = ndate.getDay();
@@ -2658,27 +2909,29 @@ scheduler.date={ first_thursday.setDate(ndate.getDate() + (4 - nday));
var year_number = first_thursday.getFullYear(); // year of the first Thursday
var ordinal_date = Math.round( (first_thursday.getTime() - new Date(year_number, 0, 1).getTime()) / 86400000); //ordinal date of the first Thursday - 1 (so not really ordinal date)
- var week_number = 1 + Math.floor( ordinal_date / 7);
+ var week_number = 1 + Math.floor( ordinal_date / 7);
return week_number;
},
-
getUTCISOWeek: function(ndate){
return this.getISOWeek(ndate);
- }
+ },
+ convert_to_utc: function(date) {
+ return new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds());
+ }
}; -scheduler.locale={
+scheduler.locale = {
date:{
month_full:["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
month_short:["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
day_full:["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
- day_short:["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
- },
- labels:{
- dhx_cal_today_button:"Today",
- day_tab:"Day",
- week_tab:"Week",
- month_tab:"Month",
- new_event:"New event",
+ day_short:["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
+ },
+ labels:{
+ dhx_cal_today_button:"Today",
+ day_tab:"Day",
+ week_tab:"Week",
+ month_tab:"Month",
+ new_event:"New event",
icon_save:"Save",
icon_cancel:"Cancel",
icon_details:"Details",
@@ -2689,24 +2942,29 @@ scheduler.locale={ section_description:"Description",
section_time:"Time period",
full_day:"Full day",
-
+
/*recurring events*/
confirm_recurring:"Do you want to edit the whole set of repeated events?",
section_recurring:"Repeat event",
button_recurring:"Disabled",
button_recurring_open:"Enabled",
-
+ button_edit_series: "Edit series",
+ button_edit_occurrence: "Edit occurrence",
+
/*agenda view extension*/
agenda_tab:"Agenda",
date:"Date",
description:"Description",
-
+
/*year view extension*/
year_tab:"Year",
- /* week agenda extension */
- week_agenda_tab: "Agenda"
- }
+ /* week agenda extension */
+ week_agenda_tab: "Agenda",
+
+ /*grid view extension*/
+ grid_tab: "Grid"
+ }
};
@@ -2733,47 +2991,57 @@ scheduler.config={ week_date: "%l",
day_date: "%D, %F %j",
hour_date: "%H:%i",
- month_day : "%d",
- xml_date:"%m/%d/%Y %H:%i",
- api_date:"%d-%m-%Y %H:%i",
-
- hour_size_px:42,
- time_step:5,
-
- start_on_monday:1,
- first_hour:0,
- last_hour:24,
- readonly:false,
- drag_resize:1,
- drag_move:1,
- drag_create:1,
- dblclick_create:1,
- edit_on_create:1,
- details_on_create:0,
- click_form_details:0,
- cascade_event_display: false,
- cascade_event_count:4,
+ month_day: "%d",
+ xml_date: "%m/%d/%Y %H:%i",
+ api_date: "%d-%m-%Y %H:%i",
+
+ hour_size_px: 42,
+ time_step: 5,
+
+ start_on_monday: 1,
+ first_hour: 0,
+ last_hour: 24,
+ readonly: false,
+ drag_resize: 1,
+ drag_move: 1,
+ drag_create: 1,
+ dblclick_create: 1,
+ edit_on_create: 1,
+ details_on_create: 0,
+ click_form_details: 0,
+ cascade_event_display: false,
+ cascade_event_count: 4,
cascade_event_margin: 30,
- drag_lightbox:true,
- preserve_scroll:true,
-
- server_utc:false,
-
- positive_closing:false,
-
- icons_edit:["icon_save","icon_cancel"],
- icons_select:["icon_details","icon_edit","icon_delete"],
- buttons_left:["dhx_save_btn","dhx_cancel_btn"],
- buttons_right:["dhx_delete_btn"],
- lightbox:{
- sections:[ {name:"description", height:200, map_to:"text", type:"textarea" , focus:true},
- {name:"time", height:72, type:"time", map_to:"auto"} ]
+ drag_lightbox: true,
+ preserve_scroll: true,
+ select: true,
+
+ server_utc: false,
+
+ positive_closing: false,
+
+ icons_edit: ["icon_save", "icon_cancel"],
+ icons_select: ["icon_details", "icon_edit", "icon_delete"],
+ buttons_left: ["dhx_save_btn", "dhx_cancel_btn"],
+ buttons_right: ["dhx_delete_btn"],
+ lightbox: {
+ sections: [
+ {name: "description", height: 200, map_to: "text", type: "textarea", focus: true},
+ {name: "time", height: 72, type: "time", map_to: "auto"}
+ ]
},
-
- repeat_date_of_end: "01.01.2010"
+ highlight_displayed_event: true,
+ displayed_event_color: "#ffc5ab",
+ displayed_event_text_color: "#7e2727"
};
scheduler.templates={};
scheduler.init_templates=function(){
+ var labels = scheduler.locale.labels;
+ labels.dhx_save_btn = labels.icon_save;
+ labels.dhx_cancel_btn = labels.icon_cancel;
+ labels.dhx_delete_btn = labels.icon_delete;
+
+
var d=scheduler.date.date_to_str;
var c=scheduler.config;
var f = function(a,b){
@@ -2824,171 +3092,174 @@ scheduler.init_templates=function(){ -scheduler.uid=function(){
- if (!this._seed) this._seed=(new Date).valueOf();
+scheduler.uid = function() {
+ if (!this._seed) this._seed = (new Date).valueOf();
return this._seed++;
};
-scheduler._events={};
-scheduler.clearAll=function(){
- this._events={};
- this._loaded={};
+scheduler._events = {};
+scheduler.clearAll = function() {
+ this._events = {};
+ this._loaded = {};
this.clear_view();
};
-scheduler.addEvent=function(start_date,end_date,text,id,extra_data){
- if(!arguments.length)
+scheduler.addEvent = function(start_date, end_date, text, id, extra_data) {
+ if (!arguments.length)
return this.addEventNow();
- var ev=start_date;
- if (arguments.length!=1){
- ev=extra_data||{};
- ev.start_date=start_date;
- ev.end_date=end_date;
- ev.text=text;
- ev.id=id;
+ var ev = start_date;
+ if (arguments.length != 1) {
+ ev = extra_data || {};
+ ev.start_date = start_date;
+ ev.end_date = end_date;
+ ev.text = text;
+ ev.id = id;
}
- ev.id = ev.id||scheduler.uid();
- ev.text = ev.text||"";
+ ev.id = ev.id || scheduler.uid();
+ ev.text = ev.text || "";
- if (typeof ev.start_date == "string") ev.start_date=this.templates.api_date(ev.start_date);
- if (typeof ev.end_date == "string") ev.end_date=this.templates.api_date(ev.end_date);
+ if (typeof ev.start_date == "string") ev.start_date = this.templates.api_date(ev.start_date);
+ if (typeof ev.end_date == "string") ev.end_date = this.templates.api_date(ev.end_date);
- var d = (this.config.event_duration||this.config.time_step)*60000;
- if(ev.start_date.valueOf() == ev.end_date.valueOf())
- ev.end_date.setTime(ev.end_date.valueOf()+d);
+ var d = (this.config.event_duration || this.config.time_step) * 60000;
+ if (ev.start_date.valueOf() == ev.end_date.valueOf())
+ ev.end_date.setTime(ev.end_date.valueOf() + d);
- ev._timed=this.is_one_day_event(ev);
+ ev._timed = this.is_one_day_event(ev);
- var is_new=!this._events[ev.id];
- this._events[ev.id]=ev;
+ var is_new = !this._events[ev.id];
+ this._events[ev.id] = ev;
this.event_updated(ev);
if (!this._loading)
- this.callEvent(is_new?"onEventAdded":"onEventChanged",[ev.id,ev]);
+ this.callEvent(is_new ? "onEventAdded" : "onEventChanged", [ev.id, ev]);
+ return ev.id;
};
-scheduler.deleteEvent=function(id,silent){
- var ev=this._events[id];
- if (!silent && (!this.callEvent("onBeforeEventDelete",[id,ev]) || !this.callEvent("onConfirmedBeforeEventDelete", [id,ev])))
- return;
- if (ev){
+scheduler.deleteEvent = function(id, silent) {
+ var ev = this._events[id];
+ if (!silent && (!this.callEvent("onBeforeEventDelete", [id, ev]) || !this.callEvent("onConfirmedBeforeEventDelete", [id, ev])))
+ return;
+ if (ev) {
delete this._events[id];
this.unselect(id);
this.event_updated(ev);
}
- this.callEvent("onEventDeleted", [id]);
+ this.callEvent("onEventDeleted", [id, ev]);
};
-scheduler.getEvent=function(id){
+scheduler.getEvent = function(id) {
return this._events[id];
};
-scheduler.setEvent=function(id,hash){
- this._events[id]=hash;
+scheduler.setEvent = function(id, hash) {
+ this._events[id] = hash;
};
-scheduler.for_rendered=function(id,method){
- for (var i=this._rendered.length-1; i>=0; i--)
- if (this._rendered[i].getAttribute("event_id")==id)
- method(this._rendered[i],i);
+scheduler.for_rendered = function(id, method) {
+ for (var i = this._rendered.length - 1; i >= 0; i--)
+ if (this._rendered[i].getAttribute("event_id") == id)
+ method(this._rendered[i], i);
};
-scheduler.changeEventId=function(id,new_id){
+scheduler.changeEventId = function(id, new_id) {
if (id == new_id) return;
- var ev=this._events[id];
- if (ev){
- ev.id=new_id;
- this._events[new_id]=ev;
+ var ev = this._events[id];
+ if (ev) {
+ ev.id = new_id;
+ this._events[new_id] = ev;
delete this._events[id];
}
- this.for_rendered(id,function(r){
- r.setAttribute("event_id",new_id);
+ this.for_rendered(id, function(r) {
+ r.setAttribute("event_id", new_id);
});
- if (this._select_id==id) this._select_id=new_id;
- if (this._edit_id==id) this._edit_id=new_id;
- //if (this._drag_id==id) this._drag_id=new_id;
- this.callEvent("onEventIdChange",[id,new_id]);
+ if (this._select_id == id) this._select_id = new_id;
+ if (this._edit_id == id) this._edit_id = new_id;
+ //if (this._drag_id==id) this._drag_id=new_id;
+ this.callEvent("onEventIdChange", [id, new_id]);
};
-(function(){
- var attrs=["text","Text","start_date","StartDate","end_date","EndDate"];
- var create_getter=function(name){
- return function(id){ return (scheduler.getEvent(id))[name]; };
+(function() {
+ var attrs = ["text", "Text", "start_date", "StartDate", "end_date", "EndDate"];
+ var create_getter = function(name) {
+ return function(id) { return (scheduler.getEvent(id))[name]; };
};
- var create_setter=function(name){
- return function(id,value){
- var ev=scheduler.getEvent(id); ev[name]=value;
- ev._changed=true;
- ev._timed=this.is_one_day_event(ev);
- scheduler.event_updated(ev,true);
+ var create_setter = function(name) {
+ return function(id, value) {
+ var ev = scheduler.getEvent(id);
+ ev[name] = value;
+ ev._changed = true;
+ ev._timed = this.is_one_day_event(ev);
+ scheduler.event_updated(ev, true);
};
};
- for (var i=0; i<attrs.length; i+=2){
- scheduler["getEvent"+attrs[i+1]]=create_getter(attrs[i]);
- scheduler["setEvent"+attrs[i+1]]=create_setter(attrs[i]);
+ for (var i = 0; i < attrs.length; i += 2) {
+ scheduler["getEvent" + attrs[i + 1]] = create_getter(attrs[i]);
+ scheduler["setEvent" + attrs[i + 1]] = create_setter(attrs[i]);
}
})();
-scheduler.event_updated=function(ev,force){
+scheduler.event_updated = function(ev, force) {
if (this.is_visible_events(ev))
this.render_view_data();
- else this.clear_event(ev.id);
+ else
+ this.clear_event(ev.id);
};
-scheduler.is_visible_events=function(ev){
- return (ev.start_date<this._max_date && this._min_date<ev.end_date);
+scheduler.is_visible_events = function(ev) {
+ return (ev.start_date < this._max_date && this._min_date < ev.end_date);
};
-scheduler.is_one_day_event=function(ev){
- var delta = ev.end_date.getDate()-ev.start_date.getDate();
-
+scheduler.is_one_day_event = function(ev) {
+ var delta = ev.end_date.getDate() - ev.start_date.getDate();
+
if (!delta)
- return ev.start_date.getMonth()==ev.end_date.getMonth() && ev.start_date.getFullYear()==ev.end_date.getFullYear();
+ return ev.start_date.getMonth() == ev.end_date.getMonth() && ev.start_date.getFullYear() == ev.end_date.getFullYear();
else {
- if (delta < 0) delta = Math.ceil((ev.end_date.valueOf()-ev.start_date.valueOf())/(24*60*60*1000));
+ if (delta < 0) delta = Math.ceil((ev.end_date.valueOf() - ev.start_date.valueOf()) / (24 * 60 * 60 * 1000));
return (delta == 1 && !ev.end_date.getHours() && !ev.end_date.getMinutes() && (ev.start_date.getHours() || ev.start_date.getMinutes() ));
}
-
+
};
-scheduler.get_visible_events=function(){
+scheduler.get_visible_events = function(only_timed) {
//not the best strategy for sure
- var stack=[];
- var filter = this["filter_"+this._mode];
-
- for( var id in this._events)
+ var stack = [];
+
+ for (var id in this._events)
if (this.is_visible_events(this._events[id]))
- if (this._table_view || this.config.multi_day || this._events[id]._timed)
- if (!filter || filter(id,this._events[id]))
+ if (!only_timed || this._events[id]._timed)
+ if (this.filter_event(id, this._events[id]))
stack.push(this._events[id]);
-
+
return stack;
};
-scheduler.render_view_data=function(evs, hold){
- if(!evs){
+scheduler.filter_event = function(id, ev) {
+ var filter = this["filter_" + this._mode];
+ return (filter) ? filter(id, ev) : true;
+};
+scheduler.render_view_data = function(evs, hold) {
+ if (!evs) {
if (this._not_render) {
- this._render_wait=true;
+ this._render_wait = true;
return;
}
- this._render_wait=false;
+ this._render_wait = false;
this.clear_view();
- evs=this.get_visible_events();
+ evs = this.get_visible_events(!(this._table_view || this.config.multi_day));
}
- if (this.config.multi_day && !this._table_view){
-
+ if (this.config.multi_day && !this._table_view) {
+
var tvs = [];
var tvd = [];
- for (var i=0; i < evs.length; i++){
+ for (var i = 0; i < evs.length; i++) {
if (evs[i]._timed)
- tvs.push(evs[i]);
+ tvs.push(evs[i]);
else
tvd.push(evs[i]);
}
// multiday events
-
-
-
this._rendered_location = this._els['dhx_multi_day'][0];
- this._table_view=true;
+ this._table_view = true;
this.render_data(tvd, hold);
- this._table_view=false;
+ this._table_view = false;
// normal events
this._rendered_location = this._els['dhx_cal_data'][0];
- this._table_view=false;
+ this._table_view = false;
this.render_data(tvs, hold);
} else {
@@ -2996,69 +3267,71 @@ scheduler.render_view_data=function(evs, hold){ this.render_data(evs, hold);
}
};
-scheduler.render_data=function(evs,hold){
- evs=this._pre_render_events(evs,hold);
- for (var i=0; i<evs.length; i++)
+scheduler.render_data = function(evs, hold) {
+ evs = this._pre_render_events(evs, hold);
+ for (var i = 0; i < evs.length; i++)
if (this._table_view)
this.render_event_bar(evs[i]);
else
this.render_event(evs[i]);
};
-scheduler._pre_render_events=function(evs,hold){
+scheduler._pre_render_events = function(evs, hold) {
var hb = this.xy.bar_height;
var h_old = this._colsS.heights;
- var h=this._colsS.heights=[0,0,0,0,0,0,0];
- var data = this._els["dhx_cal_data"][0];
+ var h = this._colsS.heights = [0, 0, 0, 0, 0, 0, 0];
+ var data = this._els["dhx_cal_data"][0];
- if (!this._table_view) evs=this._pre_render_events_line(evs,hold); //ignore long events for now
- else evs=this._pre_render_events_table(evs,hold);
+ if (!this._table_view)
+ evs = this._pre_render_events_line(evs, hold); //ignore long events for now
+ else
+ evs = this._pre_render_events_table(evs, hold);
- if (this._table_view){
+ if (this._table_view) {
if (hold)
this._colsS.heights = h_old;
else {
var evl = data.firstChild;
- if (evl.rows){
- for (var i=0; i<evl.rows.length; i++){
+ if (evl.rows) {
+ for (var i = 0; i < evl.rows.length; i++) {
h[i]++;
- if ((h[i])*hb > this._colsS.height-22){ // 22 - height of cell's header
+ if ((h[i]) * hb > this._colsS.height - 22) { // 22 - height of cell's header
//we have overflow, update heights
var cells = evl.rows[i].cells;
- for (var j=0; j < cells.length; j++) {
- cells[j].childNodes[1].style.height = h[i]*hb+"px";
+ for (var j = 0; j < cells.length; j++) {
+ cells[j].childNodes[1].style.height = h[i] * hb + "px";
}
- h[i]=(h[i-1]||0)+cells[0].offsetHeight;
+ h[i] = (h[i - 1] || 0) + cells[0].offsetHeight;
}
- h[i]=(h[i-1]||0)+evl.rows[i].cells[0].offsetHeight;
+ h[i] = (h[i - 1] || 0) + evl.rows[i].cells[0].offsetHeight;
}
h.unshift(0);
- if (evl.parentNode.offsetHeight<evl.parentNode.scrollHeight && !evl._h_fix){
+ if (evl.parentNode.offsetHeight < evl.parentNode.scrollHeight && !evl._h_fix) {
//we have v-scroll, decrease last day cell
- for (var i=0; i<evl.rows.length; i++){
+ for (var i = 0; i < evl.rows.length; i++) {
var cell = evl.rows[i].cells[6].childNodes[0];
- var w = cell.offsetWidth-scheduler.xy.scroll_width+"px";
+ var w = cell.offsetWidth - scheduler.xy.scroll_width + "px";
cell.style.width = w;
cell.nextSibling.style.width = w;
}
- evl._h_fix=true;
+ evl._h_fix = true;
}
- } else{
+ } else {
if (!evs.length && this._els["dhx_multi_day"][0].style.visibility == "visible")
- h[0]=-1;
- if (evs.length || h[0]==-1){
+ h[0] = -1;
+ if (evs.length || h[0] == -1) {
//shift days to have space for multiday events
var childs = evl.parentNode.childNodes;
- var dh = ((h[0]+1)*hb+1)+"px"; // +1 so multiday events would have 2px from top and 2px from bottom by default
- data.style.top = (this._els["dhx_cal_navline"][0].offsetHeight + this._els["dhx_cal_header"][0].offsetHeight + parseInt(dh)) + 'px';
- data.style.height = (this._obj.offsetHeight - parseInt(data.style.top) - (this.xy.margin_top||0)) + 'px';
+ var dh = ((h[0] + 1) * hb + 1) + "px"; // +1 so multiday events would have 2px from top and 2px from bottom by default
+ data.style.top = (this._els["dhx_cal_navline"][0].offsetHeight + this._els["dhx_cal_header"][0].offsetHeight + parseInt(dh, 10)) + 'px';
+ data.style.height = (this._obj.offsetHeight - parseInt(data.style.top, 10) - (this.xy.margin_top || 0)) + 'px';
var last = this._els["dhx_multi_day"][0];
- last.style.height=dh;
- last.style.visibility=(h[0]==-1?"hidden":"visible");
- last=this._els["dhx_multi_day"][1];
- last.style.height=dh;
- last.style.visibility=(h[0]==-1?"hidden":"visible");
- last.className=h[0]?"dhx_multi_day_icon":"dhx_multi_day_icon_small";
- this._dy_shift=(h[0]+1)*hb;
+ last.style.height = dh;
+ last.style.visibility = (h[0] == -1 ? "hidden" : "visible");
+ last = this._els["dhx_multi_day"][1];
+ last.style.height = dh;
+ last.style.visibility = (h[0] == -1 ? "hidden" : "visible");
+ last.className = h[0] ? "dhx_multi_day_icon" : "dhx_multi_day_icon_small";
+ this._dy_shift = (h[0] + 1) * hb;
h[0] = 0;
}
}
@@ -3067,409 +3340,551 @@ scheduler._pre_render_events=function(evs,hold){ return evs;
};
-scheduler._get_event_sday=function(ev){
- return Math.floor((ev.start_date.valueOf()-this._min_date.valueOf())/(24*60*60*1000));
+scheduler._get_event_sday = function(ev) {
+ return Math.floor((ev.start_date.valueOf() - this._min_date.valueOf()) / (24 * 60 * 60 * 1000));
+};
+scheduler._get_event_mapped_end_date = function(ev) {
+ var end_date = ev.end_date;
+ if (this.config.separate_short_events) {
+ var ev_duration = (ev.end_date - ev.start_date) / 60000; // minutes
+ if (ev_duration < this._min_mapped_duration) {
+ end_date = this.date.add(end_date, this._min_mapped_duration - ev_duration, "minute");
+ }
+ }
+ return end_date;
};
-scheduler._pre_render_events_line=function(evs,hold){
- evs.sort(function(a,b){
- if(a.start_date.valueOf()==b.start_date.valueOf())
- return a.id>b.id?1:-1;
- return a.start_date>b.start_date?1:-1;
- });
- var days=[]; //events by weeks
+scheduler._pre_render_events_line = function(evs, hold) {
+ evs.sort(function(a, b) {
+ if (a.start_date.valueOf() == b.start_date.valueOf())
+ return a.id > b.id ? 1 : -1;
+ return a.start_date > b.start_date ? 1 : -1;
+ });
+ var days = []; //events by weeks
var evs_originals = [];
- for (var i=0; i < evs.length; i++) {
- var ev=evs[i];
+ this._min_mapped_duration = Math.ceil(this.xy.min_event_height * 60 / this.config.hour_size_px); // values could change along the way
+
+ for (var i = 0; i < evs.length; i++) {
+ var ev = evs[i];
+
+ //check date overflow
+ var sd = ev.start_date;
+ var ed = ev.end_date;
//check scale overflow
- var sh = ev.start_date.getHours();
- var eh = ev.end_date.getHours();
-
- ev._sday=this._get_event_sday(ev);
- if (!days[ev._sday]) days[ev._sday]=[];
-
- if (!hold){
- ev._inner=false;
-
- var stack=days[ev._sday];
- while (stack.length && stack[stack.length-1].end_date<=ev.start_date)
- stack.splice(stack.length-1,1);
-
- var sorderSet = false;
- for(var j=0; j<stack.length; j++){
- if(stack[j].end_date.valueOf()<ev.start_date.valueOf()){
- sorderSet = true;
- ev._sorder=stack[j]._sorder;
- stack.splice(j,1);
- ev._inner=true;
- break;
- }
- }
-
- if (stack.length)
- stack[stack.length-1]._inner=true;
-
-
- if (!sorderSet) {
- if (stack.length) {
- if (stack.length <= stack[stack.length - 1]._sorder) {
- if (!stack[stack.length - 1]._sorder)
- ev._sorder = 0;
- else
- for (j = 0; j < stack.length; j++) {
- var _is_sorder = false;
- for (k = 0; k < stack.length; k++) {
- if (stack[k]._sorder == j) {
- _is_sorder = true;
- break;
- }
- }
- if (!_is_sorder) {
- ev._sorder = j;
- break;
- }
- }
- ev._inner = true;
- }
- else {
- var _max_sorder = stack[0]._sorder;
- for (j = 1; j < stack.length; j++)
- if (stack[j]._sorder > _max_sorder)
- _max_sorder = stack[j]._sorder;
- ev._sorder = _max_sorder + 1;
- ev._inner = false;
- }
-
- }
- else
- ev._sorder = 0;
- }
-
- stack.push(ev);
-
- if (stack.length>(stack.max_count||0)) {
- stack.max_count=stack.length;
- ev._count=stack.length;
- }
- else {
- ev._count=(ev._count)?ev._count:1;
- }
+ var sh = sd.getHours();
+ var eh = ed.getHours();
+
+ ev._sday = this._get_event_sday(ev); // sday based on event start_date
+ if (!days[ev._sday]) days[ev._sday] = [];
+
+ if (!hold) {
+ ev._inner = false;
+
+ var stack = days[ev._sday];
+
+ while (stack.length) {
+ var t_ev = stack[stack.length - 1];
+ var t_end_date = this._get_event_mapped_end_date(t_ev);
+ if (t_end_date.valueOf() <= ev.start_date.valueOf()) {
+ stack.splice(stack.length - 1, 1);
+ } else {
+ break;
+ }
+ }
+
+ var sorderSet = false;
+ for (var j = 0; j < stack.length; j++) {
+ var t_ev = stack[j];
+ var t_end_date = this._get_event_mapped_end_date(t_ev);
+ if (t_end_date.valueOf() <= ev.start_date.valueOf()) {
+ sorderSet = true;
+ ev._sorder = t_ev._sorder;
+ stack.splice(j, 1);
+ ev._inner = true;
+ break;
+ }
+ }
+
+ if (stack.length)
+ stack[stack.length - 1]._inner = true;
+
+ if (!sorderSet) {
+ if (stack.length) {
+ if (stack.length <= stack[stack.length - 1]._sorder) {
+ if (!stack[stack.length - 1]._sorder)
+ ev._sorder = 0;
+ else
+ for (j = 0; j < stack.length; j++) {
+ var _is_sorder = false;
+ for (var k = 0; k < stack.length; k++) {
+ if (stack[k]._sorder == j) {
+ _is_sorder = true;
+ break;
+ }
+ }
+ if (!_is_sorder) {
+ ev._sorder = j;
+ break;
+ }
+ }
+ ev._inner = true;
+ } else {
+ var _max_sorder = stack[0]._sorder;
+ for (j = 1; j < stack.length; j++) {
+ if (stack[j]._sorder > _max_sorder)
+ _max_sorder = stack[j]._sorder;
+ }
+ ev._sorder = _max_sorder + 1;
+ ev._inner = false;
+ }
+
+ } else
+ ev._sorder = 0;
+ }
+
+ stack.push(ev);
+
+ if (stack.length > (stack.max_count || 0)) {
+ stack.max_count = stack.length;
+ ev._count = stack.length;
+ } else {
+ ev._count = (ev._count) ? ev._count : 1;
+ }
}
-
- if (sh < this.config.first_hour || eh >= this.config.last_hour){
+
+ if (sh < this.config.first_hour || eh >= this.config.last_hour) {
+ // Need to create copy of event as we will be changing it's start/end date
+ // e.g. first_hour = 11 and event.start_date hours = 9. Need to preserve that info
evs_originals.push(ev);
- evs[i]=ev=this._copy_event(ev);
- if (sh < this.config.first_hour){
+ evs[i] = ev = this._copy_event(ev);
+
+ if (sh < this.config.first_hour) {
ev.start_date.setHours(this.config.first_hour);
ev.start_date.setMinutes(0);
}
- if (eh >= this.config.last_hour){
+ if (eh >= this.config.last_hour) {
ev.end_date.setMinutes(0);
ev.end_date.setHours(this.config.last_hour);
}
- if (ev.start_date>ev.end_date || sh==this.config.last_hour) {
- evs.splice(i,1); i--; continue;
+
+ if (ev.start_date > ev.end_date || sh == this.config.last_hour) {
+ evs.splice(i, 1);
+ i--;
+ continue;
}
}
}
- if (!hold){
- for (var i=0; i < evs.length; i++) {
- evs[i]._count = days[evs[i]._sday].max_count;
- }
- for (var i=0; i < evs_originals.length; i++)
- evs_originals[i]._count=days[evs_originals[i]._sday].max_count;
+ if (!hold) {
+ for (var i = 0; i < evs.length; i++) {
+ evs[i]._count = days[evs[i]._sday].max_count;
+ }
+ for (var i = 0; i < evs_originals.length; i++)
+ evs_originals[i]._count = days[evs_originals[i]._sday].max_count;
}
-
+
return evs;
};
-scheduler._time_order=function(evs){
- evs.sort(function(a,b){
- if (a.start_date.valueOf()==b.start_date.valueOf()){
+scheduler._time_order = function(evs) {
+ evs.sort(function(a, b) {
+ if (a.start_date.valueOf() == b.start_date.valueOf()) {
if (a._timed && !b._timed) return 1;
if (!a._timed && b._timed) return -1;
- return a.id>b.id?1:-1;
+ return a.id > b.id ? 1 : -1;
}
- return a.start_date>b.start_date?1:-1;
+ return a.start_date > b.start_date ? 1 : -1;
});
};
-scheduler._pre_render_events_table=function(evs,hold){ // max - max height of week slot
+scheduler._pre_render_events_table = function(evs, hold) { // max - max height of week slot
this._time_order(evs);
-
- var out=[];
- var weeks=[[],[],[],[],[],[],[]]; //events by weeks
+ var out = [];
+ var weeks = [
+ [],
+ [],
+ [],
+ [],
+ [],
+ [],
+ []
+ ]; //events by weeks
var max = this._colsS.heights;
var start_date;
var cols = this._cols.length;
-
- for (var i=0; i < evs.length; i++) {
- var ev=evs[i];
- var sd = (start_date||ev.start_date);
+ var chunks_info = {};
+
+ for (var i = 0; i < evs.length; i++) {
+ var ev = evs[i];
+ var id = ev.id;
+ if (!chunks_info[id]) {
+ chunks_info[id] = {
+ first_chunk: true,
+ last_chunk: true
+ };
+ }
+ var chunk_info = chunks_info[id];
+ var sd = (start_date || ev.start_date);
var ed = ev.end_date;
//trim events which are crossing through current view
- if (sd<this._min_date) sd=this._min_date;
- if (ed>this._max_date) ed=this._max_date;
-
- var locate_s = this.locate_holder_day(sd,false,ev);
- ev._sday=locate_s%cols;
- var locate_e = this.locate_holder_day(ed,true,ev)||cols;
- ev._eday=(locate_e%cols)||cols; //cols used to fill full week, when event end on monday
- ev._length=locate_e-locate_s;
-
+ if (sd < this._min_date) {
+ chunk_info.first_chunk = false;
+ sd = this._min_date;
+ }
+ if (ed > this._max_date) {
+ chunk_info.last_chunk = false;
+ ed = this._max_date;
+ }
+
+ var locate_s = this.locate_holder_day(sd, false, ev);
+ ev._sday = locate_s % cols;
+ var locate_e = this.locate_holder_day(ed, true, ev) || cols;
+ ev._eday = (locate_e % cols) || cols; //cols used to fill full week, when event end on monday
+ ev._length = locate_e - locate_s;
+
//3600000 - compensate 1 hour during winter|summer time shift
- ev._sweek=Math.floor((this._correct_shift(sd.valueOf(),1)-this._min_date.valueOf())/(60*60*1000*24*cols));
-
+ ev._sweek = Math.floor((this._correct_shift(sd.valueOf(), 1) - this._min_date.valueOf()) / (60 * 60 * 1000 * 24 * cols));
+
//current slot
- var stack=weeks[ev._sweek];
+ var stack = weeks[ev._sweek];
//check order position
var stack_line;
-
- for (stack_line=0; stack_line<stack.length; stack_line++)
- if (stack[stack_line]._eday<=ev._sday)
+
+ for (stack_line = 0; stack_line < stack.length; stack_line++)
+ if (stack[stack_line]._eday <= ev._sday)
break;
- if(!ev._sorder || !hold ) {
- ev._sorder=stack_line;
+ if (!ev._sorder || !hold) {
+ ev._sorder = stack_line;
}
-
- if (ev._sday+ev._length<=cols){
- start_date=null;
+
+ if (ev._sday + ev._length <= cols) {
+ start_date = null;
out.push(ev);
- stack[stack_line]=ev;
+ stack[stack_line] = ev;
//get max height of slot
- max[ev._sweek]=stack.length-1;
- } else{ // split long event in chunks
- var copy=this._copy_event(ev);
- copy._length=cols-ev._sday;
- copy._eday=cols; copy._sday=ev._sday;
- copy._sweek=ev._sweek; copy._sorder=ev._sorder;
- copy.end_date=this.date.add(sd,copy._length,"day");
-
+ max[ev._sweek] = stack.length - 1;
+ ev._first_chunk = chunk_info.first_chunk;
+ ev._last_chunk = chunk_info.last_chunk;
+ } else { // split long event in chunks
+ var copy = this._copy_event(ev);
+ copy.id = ev.id;
+ copy._length = cols - ev._sday;
+ copy._eday = cols;
+ copy._sday = ev._sday;
+ copy._sweek = ev._sweek;
+ copy._sorder = ev._sorder;
+ copy.end_date = this.date.add(sd, copy._length, "day");
+ copy._first_chunk = chunk_info.first_chunk;
+ if (chunk_info.first_chunk) {
+ chunk_info.first_chunk = false;
+ }
+
out.push(copy);
- stack[stack_line]=copy;
- start_date=copy.end_date;
+ stack[stack_line] = copy;
+ start_date = copy.end_date;
//get max height of slot
- max[ev._sweek]=stack.length-1;
- i--; continue; //repeat same step
+ max[ev._sweek] = stack.length - 1;
+ i--;
+ continue; //repeat same step
}
}
-
return out;
};
-scheduler._copy_dummy=function(){
- this.start_date=new Date(this.start_date);
- this.end_date=new Date(this.end_date);
+scheduler._copy_dummy = function() {
+ var a = new Date(this.start_date);
+ var b = new Date(this.end_date);
+ this.start_date = a;
+ this.end_date = b;
};
-scheduler._copy_event=function(ev){
+scheduler._copy_event = function(ev) {
this._copy_dummy.prototype = ev;
return new this._copy_dummy();
//return {start_date:ev.start_date, end_date:ev.end_date, text:ev.text, id:ev.id}
};
-scheduler._rendered=[];
-scheduler.clear_view=function(){
- for (var i=0; i<this._rendered.length; i++){
- var obj=this._rendered[i];
- if (obj.parentNode) obj.parentNode.removeChild(obj);
+scheduler._rendered = [];
+scheduler.clear_view = function() {
+ for (var i = 0; i < this._rendered.length; i++) {
+ var obj = this._rendered[i];
+ if (obj.parentNode) obj.parentNode.removeChild(obj);
}
- this._rendered=[];
+ this._rendered = [];
};
-scheduler.updateEvent=function(id){
- var ev=this.getEvent(id);
+scheduler.updateEvent = function(id) {
+ var ev = this.getEvent(id);
this.clear_event(id);
- if (ev && this.is_visible_events(ev))
- this.render_view_data([ev], true);
+
+ if (ev && this.is_visible_events(ev) && this.filter_event(id, ev) && (this._table_view || this.config.multi_day || ev._timed)) {
+ if (this.config.update_render)
+ this.render_view_data();
+ else
+ this.render_view_data([ev], true);
+ }
};
-scheduler.clear_event=function(id){
- this.for_rendered(id,function(node,i){
+scheduler.clear_event = function(id) {
+ this.for_rendered(id, function(node, i) {
if (node.parentNode)
node.parentNode.removeChild(node);
- scheduler._rendered.splice(i,1);
+ scheduler._rendered.splice(i, 1);
});
};
-scheduler.render_event=function(ev){
+scheduler.render_event = function(ev) {
var menu = scheduler.xy.menu_width;
- if (ev._sday<0) return; //can occur in case of recurring event during time shift
- var parent=scheduler.locate_holder(ev._sday);
+ if (ev._sday < 0) return; //can occur in case of recurring event during time shift
+ var parent = scheduler.locate_holder(ev._sday);
if (!parent) return; //attempt to render non-visible event
- var sm = ev.start_date.getHours()*60+ev.start_date.getMinutes();
- var em = (ev.end_date.getHours()*60+ev.end_date.getMinutes())||(scheduler.config.last_hour*60);
-
- var top = (Math.round((sm*60*1000-this.config.first_hour*60*60*1000)*this.config.hour_size_px/(60*60*1000)))%(this.config.hour_size_px*24)+1; //42px/hour
- var height = Math.max(scheduler.xy.min_event_height,(em-sm)*this.config.hour_size_px/60)+1; //42px/hour
- //var height = Math.max(25,Math.round((ev.end_date.valueOf()-ev.start_date.valueOf())*(this.config.hour_size_px+(this._quirks?1:0))/(60*60*1000))); //42px/hour
- var width=Math.floor((parent.clientWidth-menu)/ev._count);
- var left=ev._sorder*width+1;
- if (!ev._inner) width=width*(ev._count-ev._sorder);
- if(this.config.cascade_event_display) {
- var limit = this.config.cascade_event_count;
- var margin = this.config.cascade_event_margin;
- left = ev._sorder%limit*margin;
- var right = (ev._inner)?(ev._count-ev._sorder-1)%limit*margin/2:0;
- width=Math.floor(parent.clientWidth-menu-left-right);
- }
-
- var d=this._render_v_bar(ev.id,menu+left,top,width,height,ev._text_style,scheduler.templates.event_header(ev.start_date,ev.end_date,ev),scheduler.templates.event_text(ev.start_date,ev.end_date,ev));
-
+ var sm = ev.start_date.getHours() * 60 + ev.start_date.getMinutes();
+ var em = (ev.end_date.getHours() * 60 + ev.end_date.getMinutes()) || (scheduler.config.last_hour * 60);
+ var ev_count = ev._count || 1;
+ var ev_sorder = ev._sorder || 0;
+ var top = (Math.round((sm * 60 * 1000 - this.config.first_hour * 60 * 60 * 1000) * this.config.hour_size_px / (60 * 60 * 1000))) % (this.config.hour_size_px * 24); //42px/hour
+ var height = Math.max(scheduler.xy.min_event_height, (em - sm) * this.config.hour_size_px / 60); //42px/hour
+ var width = Math.floor((parent.clientWidth - menu) / ev_count);
+ var left = ev_sorder * width + 1;
+ if (!ev._inner) width = width * (ev_count - ev_sorder);
+ if (this.config.cascade_event_display) {
+ var limit = this.config.cascade_event_count;
+ var margin = this.config.cascade_event_margin;
+ left = ev_sorder % limit * margin;
+ var right = (ev._inner) ? (ev_count - ev_sorder - 1) % limit * margin / 2 : 0;
+ width = Math.floor(parent.clientWidth - menu - left - right);
+ }
+
+ var d = this._render_v_bar(ev.id, menu + left, top, width, height, ev._text_style, scheduler.templates.event_header(ev.start_date, ev.end_date, ev), scheduler.templates.event_text(ev.start_date, ev.end_date, ev));
+
this._rendered.push(d);
parent.appendChild(d);
-
- left=left+parseInt(parent.style.left,10)+menu;
-
- if (this._edit_id==ev.id){
+
+ left = left + parseInt(parent.style.left, 10) + menu;
+
+ if (this._edit_id == ev.id) {
d.style.zIndex = 1; //fix overlapping issue
- width=Math.max(width-4,scheduler.xy.editor_width);
- d=document.createElement("DIV");
- d.setAttribute("event_id",ev.id);
- this.set_xy(d,width,height-20,left,top+14);
- d.className="dhx_cal_editor";
-
- var d2=document.createElement("DIV");
- this.set_xy(d2,width-6,height-26);
- d2.style.cssText+=";margin:2px 2px 2px 2px;overflow:hidden;";
-
+ width = Math.max(width - 4, scheduler.xy.editor_width);
+ d = document.createElement("DIV");
+ d.setAttribute("event_id", ev.id);
+ this.set_xy(d, width, height - 20, left, top + 14);
+ d.className = "dhx_cal_editor";
+
+ var d2 = document.createElement("DIV");
+ this.set_xy(d2, width - 6, height - 26);
+ d2.style.cssText += ";margin:2px 2px 2px 2px;overflow:hidden;";
+
d.appendChild(d2);
this._els["dhx_cal_data"][0].appendChild(d);
this._rendered.push(d);
-
- d2.innerHTML="<textarea class='dhx_cal_editor'>"+ev.text+"</textarea>";
- if (this._quirks7) d2.firstChild.style.height=height-12+"px"; //IEFIX
- this._editor=d2.firstChild;
- this._editor.onkeypress=function(e){
- if ((e||event).shiftKey) return true;
- var code=(e||event).keyCode;
- if (code==scheduler.keys.edit_save) scheduler.editStop(true);
- if (code==scheduler.keys.edit_cancel) scheduler.editStop(false);
+
+ d2.innerHTML = "<textarea class='dhx_cal_editor'>" + ev.text + "</textarea>";
+ if (this._quirks7) d2.firstChild.style.height = height - 12 + "px"; //IEFIX
+ this._editor = d2.firstChild;
+ this._editor.onkeydown = function(e) {
+ if ((e || event).shiftKey) return true;
+ var code = (e || event).keyCode;
+ if (code == scheduler.keys.edit_save) scheduler.editStop(true);
+ if (code == scheduler.keys.edit_cancel) scheduler.editStop(false);
+ };
+ this._editor.onselectstart = function (e) {
+ return (e || event).cancelBubble = true;
};
- this._editor.onselectstart=function(e){ return (e||event).cancelBubble=true; };
d2.firstChild.focus();
//IE and opera can add x-scroll during focusing
- this._els["dhx_cal_data"][0].scrollLeft=0;
+ this._els["dhx_cal_data"][0].scrollLeft = 0;
d2.firstChild.select();
-
+
}
- if (this._select_id==ev.id){
- if(this.config.cascade_event_display && this._drag_mode)
- d.style.zIndex = 1; //fix overlapping issue for cascade view in case of dnd of selected event
- var icons=this.config["icons_"+((this._edit_id==ev.id)?"edit":"select")];
- var icons_str="";
- var bg_color = (ev.color?("background-color:"+ev.color+";"):"");
- var color = (ev.textColor?("color:"+ev.textColor+";"):"");
- for (var i=0; i<icons.length; i++)
- icons_str+="<div class='dhx_menu_icon "+icons[i]+"' style='"+bg_color+""+color+"' title='"+this.locale.labels[icons[i]]+"'></div>";
- var obj = this._render_v_bar(ev.id,left-menu+1,top,menu,icons.length*20+26,"","<div style='"+bg_color+""+color+"' class='dhx_menu_head'></div>",icons_str,true);
- obj.style.left=left-menu+1;
+ if (this.xy.menu_width !== 0 && this._select_id == ev.id) {
+ if (this.config.cascade_event_display && this._drag_mode)
+ d.style.zIndex = 1; //fix overlapping issue for cascade view in case of dnd of selected event
+ var icons = this.config["icons_" + ((this._edit_id == ev.id) ? "edit" : "select")];
+ var icons_str = "";
+ var bg_color = (ev.color ? ("background-color: " + ev.color + ";") : "");
+ var color = (ev.textColor ? ("color: " + ev.textColor + ";") : "");
+ for (var i = 0; i < icons.length; i++)
+ icons_str += "<div class='dhx_menu_icon " + icons[i] + "' style='" + bg_color + "" + color + "' title='" + this.locale.labels[icons[i]] + "'></div>";
+ var obj = this._render_v_bar(ev.id, left - menu + 1, top, menu, icons.length * 20 + 26 - 2, "", "<div style='" + bg_color + "" + color + "' class='dhx_menu_head'></div>", icons_str, true);
+ obj.style.left = left - menu + 1;
this._els["dhx_cal_data"][0].appendChild(obj);
this._rendered.push(obj);
}
};
-scheduler._render_v_bar=function(id,x,y,w,h,style,contentA,contentB,bottom){
- var d=document.createElement("DIV");
+scheduler._render_v_bar = function (id, x, y, w, h, style, contentA, contentB, bottom) {
+ var d = document.createElement("DIV");
var ev = this.getEvent(id);
- var cs = "dhx_cal_event";
- var cse = scheduler.templates.event_class(ev.start_date,ev.end_date,ev);
- if (cse) cs=cs+" "+cse;
- var bg_color = (ev.color?("background-color:"+ev.color+";"):"");
- var color = (ev.textColor?("color:"+ev.textColor+";"):"");
-
- var html='<div event_id="'+id+'" class="'+cs+'" style="position:absolute; top:'+y+'px; left:'+x+'px; width:'+(w-4)+'px; height:'+h+'px;'+(style||"")+'">';
- html+='<div class="dhx_header" style=" width:'+(w-6)+'px;'+bg_color+'" > </div>';
- html+='<div class="dhx_title" style="'+bg_color+''+color+'">'+contentA+'</div>';
- html+='<div class="dhx_body" style=" width:'+(w-(this._quirks?4:14))+'px; height:'+(h-(this._quirks?20:30))+'px;'+bg_color+''+color+'">'+contentB+'</div>';
- html+='<div class="dhx_footer" style=" width:'+(w-8)+'px;'+(bottom?' margin-top:-1px;':'')+''+bg_color+''+color+'" ></div></div>';
-
- d.innerHTML=html;
- return d.firstChild;
+ var cs = (bottom) ? "dhx_cal_event dhx_cal_select_menu" : "dhx_cal_event";
+
+ var cse = scheduler.templates.event_class(ev.start_date, ev.end_date, ev);
+ if (cse) cs = cs + " " + cse;
+
+ var bg_color = (ev.color ? ("background:" + ev.color + ";") : "");
+ var color = (ev.textColor ? ("color:" + ev.textColor + ";") : "");
+
+ var html = '<div event_id="' + id + '" class="' + cs + '" style="position:absolute; top:' + y + 'px; left:' + x + 'px; width:' + (w - 4) + 'px; height:' + h + 'px;' + (style || "") + '"></div>';
+ d.innerHTML = html;
+
+ var container = d.cloneNode(true).firstChild;
+
+ if (scheduler.renderEvent && !bottom && scheduler.renderEvent(container, ev)) {
+ return container;
+ } else {
+ container = d.firstChild;
+
+ var inner_html = '<div class="dhx_event_move dhx_header" style=" width:' + (w - 6) + 'px;' + bg_color + '" > </div>';
+ inner_html += '<div class="dhx_event_move dhx_title" style="' + bg_color + '' + color + '">' + contentA + '</div>';
+ inner_html += '<div class="dhx_body" style=" width:' + (w - (this._quirks ? 4 : 14)) + 'px; height:' + (h - (this._quirks ? 20 : 30) + 1) + 'px;' + bg_color + '' + color + '">' + contentB + '</div>'; // +2 css specific, moved from render_event
+
+ var footer_class = "dhx_event_resize dhx_footer";
+ if (bottom)
+ footer_class = "dhx_resize_denied " + footer_class;
+
+ inner_html += '<div class="' + footer_class + '" style=" width:' + (w - 8) + 'px;' + (bottom ? ' margin-top:-1px;' : '') + '' + bg_color + '' + color + '" ></div>';
+
+ container.innerHTML = inner_html;
+ }
+
+ return container;
};
-scheduler.locate_holder=function(day){
- if (this._mode=="day") return this._els["dhx_cal_data"][0].firstChild; //dirty
+scheduler.locate_holder = function(day) {
+ if (this._mode == "day") return this._els["dhx_cal_data"][0].firstChild; //dirty
return this._els["dhx_cal_data"][0].childNodes[day];
};
-scheduler.locate_holder_day=function(date,past){
- var day = Math.floor((this._correct_shift(date,1)-this._min_date)/(60*60*24*1000));
+scheduler.locate_holder_day = function(date, past) {
+ var day = Math.floor((this._correct_shift(date, 1) - this._min_date) / (60 * 60 * 24 * 1000));
//when locating end data of event , we need to use next day if time part was defined
if (past && this.date.time_part(date)) day++;
return day;
};
-scheduler.render_event_bar=function(ev){
- var parent=this._rendered_location;
+scheduler.render_event_bar = function (ev) {
+ var parent = this._rendered_location;
- var x=this._colsS[ev._sday];
- var x2=this._colsS[ev._eday];
- if (x2==x) x2=this._colsS[ev._eday+1];
+ var x = this._colsS[ev._sday];
+ var x2 = this._colsS[ev._eday];
+ if (x2 == x) x2 = this._colsS[ev._eday + 1];
var hb = this.xy.bar_height;
-
- var y=this._colsS.heights[ev._sweek]+(this._colsS.height?(this.xy.month_scale_height+2):2)+(ev._sorder*hb);
-
- var d=document.createElement("DIV");
- var cs = ev._timed?"dhx_cal_event_clear":"dhx_cal_event_line";
- var cse = scheduler.templates.event_class(ev.start_date,ev.end_date,ev);
- if (cse) cs=cs+" "+cse;
-
- var bg_color = (ev.color?("background-color:"+ev.color+";"):"");
- var color = (ev.textColor?("color:"+ev.textColor+";"):"");
- - var title_line = scheduler.templates.event_bar_text(ev.start_date,ev.end_date,ev); -
- var html='<div title="'+ title_line +'" event_id="'+ev.id+'" class="'+cs+'" style="position:absolute; top:'+y+'px; left:'+x+'px; width:'+(x2-x-15)+'px;'+color+''+bg_color+''+(ev._text_style||"")+'">';
-
+
+ var y = this._colsS.heights[ev._sweek] + (this._colsS.height ? (this.xy.month_scale_height + 2) : 2 ) + (ev._sorder * hb);
+
+ var d = document.createElement("DIV");
+ var cs = "dhx_cal_event_clear";
+ if (!ev._timed) {
+ cs = "dhx_cal_event_line";
+ if (ev.hasOwnProperty("_first_chunk") && ev._first_chunk)
+ cs += " dhx_cal_event_line_start";
+ if (ev.hasOwnProperty("_last_chunk") && ev._last_chunk)
+ cs += " dhx_cal_event_line_end";
+ }
+
+ var cse = scheduler.templates.event_class(ev.start_date, ev.end_date, ev);
+ if (cse) cs = cs + " " + cse;
+
+ var bg_color = (ev.color ? ("background:" + ev.color + ";") : "");
+ var color = (ev.textColor ? ("color:" + ev.textColor + ";") : "");
+
+ var html = '<div event_id="' + ev.id + '" class="' + cs + '" style="position:absolute; top:' + y + 'px; left:' + x + 'px; width:' + (x2 - x - 15) + 'px;' + color + '' + bg_color + '' + (ev._text_style || "") + '">';
+
+ ev = scheduler.getEvent(ev.id); // ev at this point could be a part of a larged event
if (ev._timed)
- html+=scheduler.templates.event_bar_date(ev.start_date,ev.end_date,ev);
- html+=scheduler.templates.event_bar_text(ev.start_date,ev.end_date,ev)+'</div>';
- html+='</div>';
-
- d.innerHTML=html;
-
+ html += scheduler.templates.event_bar_date(ev.start_date, ev.end_date, ev);
+ html += scheduler.templates.event_bar_text(ev.start_date, ev.end_date, ev) + '</div>';
+ html += '</div>';
+
+ d.innerHTML = html;
+
this._rendered.push(d.firstChild);
parent.appendChild(d.firstChild);
};
-scheduler._locate_event=function(node){
- var id=null;
- while (node && !id && node.getAttribute){
- id=node.getAttribute("event_id");
- node=node.parentNode;
+scheduler._locate_event = function(node) {
+ var id = null;
+ while (node && !id && node.getAttribute) {
+ id = node.getAttribute("event_id");
+ node = node.parentNode;
}
return id;
};
-
-scheduler.edit=function(id){
- if (this._edit_id==id) return;
- this.editStop(false,id);
- this._edit_id=id;
+scheduler.edit = function(id) {
+ if (this._edit_id == id) return;
+ this.editStop(false, id);
+ this._edit_id = id;
this.updateEvent(id);
};
-scheduler.editStop=function(mode,id){
- if (id && this._edit_id==id) return;
- var ev=this.getEvent(this._edit_id);
- if (ev){
- if (mode) ev.text=this._editor.value;
- this._edit_id=null;
- this._editor=null;
+scheduler.editStop = function(mode, id) {
+ if (id && this._edit_id == id) return;
+ var ev = this.getEvent(this._edit_id);
+ if (ev) {
+ if (mode) ev.text = this._editor.value;
+ this._edit_id = null;
+ this._editor = null;
this.updateEvent(ev.id);
- this._edit_stop_event(ev,mode);
+ this._edit_stop_event(ev, mode);
}
};
-scheduler._edit_stop_event=function(ev,mode){
- if (this._new_event){
- if (!mode) this.deleteEvent(ev.id,true);
- else this.callEvent("onEventAdded",[ev.id,ev]);
- this._new_event=null;
- } else
- if (mode) this.callEvent("onEventChanged",[ev.id,ev]);
+scheduler._edit_stop_event = function(ev, mode) {
+ if (this._new_event) {
+ if (!mode) {
+ if (ev) // in case of custom lightbox user can already delete event
+ this.deleteEvent(ev.id, true);
+ } else {
+ this.callEvent("onEventAdded", [ev.id, ev]);
+ }
+ this._new_event = null;
+ } else {
+ if (mode)
+ this.callEvent("onEventChanged", [ev.id, ev]);
+ }
};
-scheduler.getEvents = function(from,to){
+scheduler.getEvents = function(from, to) {
var result = [];
- for (var a in this._events){
+ for (var a in this._events) {
var ev = this._events[a];
- if (ev && ev.start_date<to && ev.end_date>from)
+ if (ev && ( (!from && !to) || (ev.start_date < to && ev.end_date > from) ))
result.push(ev);
}
return result;
};
- +scheduler.getRenderedEvent = function(id) {
+ if (!id)
+ return;
+ var rendered_events = scheduler._rendered;
+ for (var i=0; i<rendered_events.length; i++) {
+ var rendered_event = rendered_events[i];
+ if (rendered_event.getAttribute("event_id") == id) {
+ return rendered_event;
+ }
+ }
+ return null;
+};
+scheduler.showEvent = function(id, mode) {
+ var ev = (typeof id == "number" || typeof id == "string") ? scheduler.getEvent(id) : id;
+ mode = mode||scheduler._mode;
+
+ if (!ev || (this.checkEvent("onBeforeEventDisplay") && !this.callEvent("onBeforeEventDisplay", [ev, mode])))
+ return;
+
+ var scroll_hour = scheduler.config.scroll_hour;
+ scheduler.config.scroll_hour = ev.start_date.getHours();
+ var preserve_scroll = scheduler.config.preserve_scroll;
+ scheduler.config.preserve_scroll = false;
+
+ var original_color = ev.color;
+ var original_text_color = ev.textColor;
+ if (scheduler.config.highlight_displayed_event) {
+ ev.color = scheduler.config.displayed_event_color;
+ ev.textColor = scheduler.config.displayed_event_text_color;
+ }
+
+ scheduler.setCurrentView(new Date(ev.start_date), mode);
+
+ ev.color = original_color;
+ ev.textColor = original_text_color;
+ scheduler.config.scroll_hour = scroll_hour;
+ scheduler.config.preserve_scroll = preserve_scroll;
+
+ if (scheduler.matrix && scheduler.matrix[mode]) {
+ scheduler._els["dhx_cal_data"][0].scrollTop = getAbsoluteTop(scheduler.getRenderedEvent(ev.id));
+ }
+
+ scheduler.callEvent("onAfterEventDisplay", [ev, mode]);
+}; scheduler._loaded={};
scheduler._load=function(url,from){
url=url||this._load_url;
@@ -3512,13 +3927,18 @@ scheduler._load=function(url,from){ return true;
};
scheduler.on_load=function(loader){
- this._loading=true;
var evs;
if (this._process)
evs=this[this._process].parse(loader.xmlDoc.responseText);
else
evs=this._magic_parser(loader);
-
+
+ scheduler._process_loading(evs);
+
+ this.callEvent("onXLE",[]);
+};
+scheduler._process_loading = function(evs){
+ this._loading=true;
this._not_render=true;
for (var i=0; i<evs.length; i++){
if (!this.callEvent("onEventLoading",[evs[i]])) continue;
@@ -3530,15 +3950,43 @@ scheduler.on_load=function(loader){ this._loading=false;
if (this._after_call) this._after_call();
this._after_call=null;
-
- this.callEvent("onXLE",[]);
};
scheduler.json={};
scheduler.json.parse = function(data){
- if (typeof data == "string"){
- eval("scheduler._temp = "+data+";");
- data = scheduler._temp;
+ if (typeof data == "string") {
+ scheduler._temp = eval( "("+data+")" );
+ data = (scheduler._temp) ? scheduler._temp.data||scheduler._temp : [];
+ }
+
+ if (data.dhx_security)
+ dhtmlx.security_key = data.dhx_security;
+
+ var collections = (scheduler._temp && scheduler._temp.collections) ? scheduler._temp.collections : {};
+ var collections_loaded = false;
+ for (var key in collections) {
+ if (collections.hasOwnProperty(key)) {
+ collections_loaded = true;
+ var collection = collections[key];
+ var arr = scheduler.serverList[key];
+ if (!arr) continue;
+ arr.splice(0, arr.length); //clear old options
+ for (var j=0; j < collection.length; j++) {
+ var option = collection[j];
+ var obj = { key: option.value, label: option.label }; // resulting option object
+ for (var option_key in option) {
+ if (option.hasOwnProperty(option_key)) {
+ if (option_key == "value" || option_key == "label")
+ continue;
+ obj[option_key] = option[option_key]; // obj['value'] = option['value']
+ }
+ }
+ arr.push(obj);
+ }
+ }
}
+ if (collections_loaded)
+ scheduler.callEvent("onOptionsLoad",[]);
+
var evs = [];
for (var i=0; i < data.length; i++){
data[i].start_date = scheduler.templates.xml_date(data[i].start_date);
@@ -3592,6 +4040,9 @@ scheduler._magic_parser=function(loader){ xml=loader.getXMLTopNode("data");
if (xml.tagName!="data") return [];//not an xml
+ var skey = xml.getAttribute("dhx_security");
+ if (skey)
+ dhtmlx.security_key = skey;
var opts = loader.doXPath("//coll_options");
for (var i=0; i < opts.length; i++) {
@@ -3669,6 +4120,10 @@ scheduler.attachEvent("onXLE",function(){ }
});
+/*
+This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in not GPL project. Please contact sales@dhtmlx.com for details
+*/
scheduler.ical={
parse:function(str){
var data = str.match(RegExp(this.c_start+"[^\f]*"+this.c_end,""));
@@ -3708,10 +4163,7 @@ scheduler.ical={ }
else if (name=="dtend"){
name = "end_date";
- if (obj.start_date && obj.start_date.getHours()==0)
- value = this.parse_date(value,24,00);
- else
- value = this.parse_date(value,23,59);
+ value = this.parse_date(value,0,0);
}
obj[name]=value;
},
@@ -3734,6 +4186,7 @@ scheduler.ical={ e_end:"END:VEVENT",
c_end:"END:VCALENDAR"
}; +scheduler.lightbox = {};
scheduler.formSection = function(name){
var config = this.config.lightbox.sections;
var i =0;
@@ -3741,9 +4194,15 @@ scheduler.formSection = function(name){ if (config[i].name == name)
break;
var section = config[i];
- var node = document.getElementById(section.id).nextSibling;
-
- return {
+ if (!scheduler._lightbox)
+ scheduler.getLightbox();
+ var header = document.getElementById(section.id);
+ var node = header.nextSibling;
+
+ var result = {
+ section: section,
+ header: header,
+ node: node,
getValue:function(ev){
return scheduler.form_blocks[section.type].get_value(node, (ev||{}), section);
},
@@ -3751,22 +4210,41 @@ scheduler.formSection = function(name){ return scheduler.form_blocks[section.type].set_value(node, value, (ev||{}), section);
}
};
+
+ var handler = scheduler.lightbox["get_"+section.type+"_control"];
+ return handler?handler(result):result;
+};
+scheduler.lightbox.get_template_control = function(result) {
+ result.control = result.node;
+ return result;
+};
+scheduler.lightbox.get_select_control = function(result) {
+ result.control = result.node.getElementsByTagName('select')[0];
+ return result;
+};
+scheduler.lightbox.get_textarea_control = function(result) {
+ result.control = result.node.getElementsByTagName('textarea')[0];
+ return result;
+};
+scheduler.lightbox.get_time_control = function(result) {
+ result.control = result.node.getElementsByTagName('select'); // array
+ return result;
};
scheduler.form_blocks={
- template:{
- render: function(sns){
- var height=(sns.height||"30")+"px";
- return "<div class='dhx_cal_ltext dhx_cal_template' style='height:"+height+";'></div>";
- },
- set_value:function(node,value,ev,config){
- node.innerHTML = value||"";
- },
- get_value:function(node,ev,config){
- return node.innerHTML||"";
- },
- focus: function(node){
- }
- },
+ template:{
+ render: function(sns){
+ var height=(sns.height||"30")+"px";
+ return "<div class='dhx_cal_ltext dhx_cal_template' style='height:"+height+";'></div>";
+ },
+ set_value:function(node,value,ev,config){
+ node.innerHTML = value||"";
+ },
+ get_value:function(node,ev,config){
+ return node.innerHTML||"";
+ },
+ focus: function(node){
+ }
+ },
textarea:{
render:function(sns){
var height=(sns.height||"130")+"px";
@@ -3791,10 +4269,15 @@ scheduler.form_blocks={ html+="</select></div>";
return html;
},
- set_value:function(node,value,ev){
+ set_value:function(node,value,ev,sns){
+ var select = node.firstChild;
+ if (!select._dhx_onchange && sns.onchange) {
+ select.onchange = sns.onchange;
+ select._dhx_onchange = true;
+ }
if (typeof value == "undefined")
- value = (node.firstChild.options[0]||{}).value;
- node.firstChild.value=value||"";
+ value = (select.options[0]||{}).value;
+ select.value=value||"";
},
get_value:function(node,ev){
return node.firstChild.value;
@@ -3802,9 +4285,9 @@ scheduler.form_blocks={ focus:function(node){
var a=node.firstChild; if (a.select) a.select(); a.focus();
}
- },
+ },
time:{
- render:function(){
+ render:function(sns){
//hours
var cfg = scheduler.config;
var dt = this.date.date_part(new Date());
@@ -3814,46 +4297,46 @@ scheduler.form_blocks={ first = 60*cfg.first_hour;
dt.setHours(cfg.first_hour);
}
-
+
var html="<select>";
var i = first;
var tdate = dt.getDate();
+ sns._time_values = [];
while(i<last){
var time=this.templates.time_picker(dt);
html+="<option value='"+i+"'>"+time+"</option>";
-
+ sns._time_values.push(i);
dt.setTime(dt.valueOf()+this.config.time_step*60*1000);
- var diff = (dt.getDate()!=tdate)?1:0; // moved or not to the next day
- i=diff*24*60+dt.getHours()*60+dt.getMinutes();
+ var diff = (dt.getDate()!=tdate)?1:0; // moved or not to the next day
+ i=diff*24*60+dt.getHours()*60+dt.getMinutes();
}
-
+
//days
html+="</select> <select>";
for (var i=1; i < 32; i++)
html+="<option value='"+i+"'>"+i+"</option>";
-
+
//month
html+="</select> <select>";
for (var i=0; i < 12; i++)
html+="<option value='"+i+"'>"+this.locale.date.month_full[i]+"</option>";
-
+
//year
html+="</select> <select>";
dt = dt.getFullYear()-5; //maybe take from config?
for (var i=0; i < 10; i++)
html+="<option value='"+(dt+i)+"'>"+(dt+i)+"</option>";
html+="</select> ";
-
+
return "<div style='height:30px;padding-top:0px;font-size:inherit;' class='dhx_section_time'>"+html+"<span style='font-weight:normal; font-size:10pt;'> – </span>"+html+"</div>";
},
- set_value:function(node,value,ev){
-
-
+ set_value:function(node,value,ev,config){
+ var cfg = scheduler.config;
var s=node.getElementsByTagName("select");
- if(scheduler.config.full_day) {
+ if(cfg.full_day) {
if (!node._full_day){
var html = "<label class='dhx_fullday'><input type='checkbox' name='full_day' value='true'> "+scheduler.locale.labels.full_day+" </label></input>";
if (!scheduler.config.wide_form)
@@ -3862,46 +4345,63 @@ scheduler.form_blocks={ node._full_day=true;
}
var input=node.previousSibling.getElementsByTagName("input")[0];
- var isFulldayEvent = (scheduler.date.time_part(ev.start_date)===0 && scheduler.date.time_part(ev.end_date)===0 && ev.end_date.valueOf()-ev.start_date.valueOf() < 2*24*60*60*1000);
- input.checked = isFulldayEvent;
-
- for(var k in s)
- s[k].disabled=input.checked;
+ input.checked = (scheduler.date.time_part(ev.start_date)===0 && scheduler.date.time_part(ev.end_date)===0);
+
+ s[0].disabled=input.checked;
+ s[ s.length/2 ].disabled=input.checked;
input.onclick = function(){
if(input.checked) {
- var start_date = new Date(ev.start_date);
- var end_date = new Date(ev.end_date);
-
- scheduler.date.date_part(start_date);
- end_date = scheduler.date.add(start_date, 1, "day");
- }
- for(var i in s)
- s[i].disabled=input.checked;
+ var obj = {};
+ scheduler.form_blocks.time.get_value(node,obj);
+
+ var start_date = scheduler.date.date_part(obj.start_date);
+ var end_date = scheduler.date.date_part(obj.end_date);
+
+ if (+end_date == +start_date || (+end_date >= +start_date && (ev.end_date.getHours() != 0 || ev.end_date.getMinutes() != 0)))
+ end_date = scheduler.date.add(end_date, 1, "day");
+ }
+
+ s[0].disabled=input.checked;
+ s[ s.length/2 ].disabled=input.checked;
_fill_lightbox_select(s,0,start_date||ev.start_date);
_fill_lightbox_select(s,4,end_date||ev.end_date);
};
}
- if(scheduler.config.auto_end_date && scheduler.config.event_duration) {
+ if(cfg.auto_end_date && cfg.event_duration) {
function _update_lightbox_select() {
- ev.start_date=new Date(s[3].value,s[2].value,s[1].value,0,s[0].value);
- ev.end_date.setTime(ev.start_date.getTime() + (scheduler.config.event_duration * 60 * 1000));
- _fill_lightbox_select(s,4,ev.end_date);
+ var start_date = new Date(s[3].value,s[2].value,s[1].value,0,s[0].value);
+ var end_date = new Date(start_date.getTime() + (scheduler.config.event_duration * 60 * 1000));
+ _fill_lightbox_select(s, 4, end_date);
}
for(var i=0; i<4; i++) {
s[i].onchange = _update_lightbox_select;
}
}
- function _fill_lightbox_select(s,i,d){
- s[i+0].value=Math.round((d.getHours()*60+d.getMinutes())/scheduler.config.time_step)*scheduler.config.time_step;
+ function _fill_lightbox_select(s,i,d) {
+ var time_values = config._time_values;
+ var direct_value = d.getHours()*60+d.getMinutes();
+ var fixed_value = direct_value;
+ var value_found = false;
+ for (var k=0; k<time_values.length; k++) {
+ var t_v = time_values[k];
+ if (t_v === direct_value) {
+ value_found = true;
+ break;
+ }
+ if (t_v < direct_value)
+ fixed_value = t_v;
+ }
+
+ s[i+0].value=(value_found)?direct_value:fixed_value;
s[i+1].value=d.getDate();
s[i+2].value=d.getMonth();
s[i+3].value=d.getFullYear();
}
-
+
_fill_lightbox_select(s,0,ev.start_date);
_fill_lightbox_select(s,4,ev.end_date);
},
@@ -3911,6 +4411,10 @@ scheduler.form_blocks={ ev.end_date=new Date(s[7].value,s[6].value,s[5].value,0,s[4].value);
if (ev.end_date<=ev.start_date)
ev.end_date=scheduler.date.add(ev.start_date,scheduler.config.time_step,"minute");
+ return {
+ start_date: new Date(ev.start_date),
+ end_date: new Date(ev.end_date)
+ };
},
focus:function(node){
node.getElementsByTagName("select")[0].focus();
@@ -3924,9 +4428,9 @@ scheduler.showCover=function(box){ var scroll_top = window.pageYOffset||document.body.scrollTop||document.documentElement.scrollTop;
var scroll_left = window.pageXOffset||document.body.scrollLeft||document.documentElement.scrollLeft;
- var view_height = window.innerHeight||document.documentElement.clientHeight;
+ var view_height = window.innerHeight||document.documentElement.clientHeight;
- if(scroll_top) // if vertical scroll on window
+ if(scroll_top) // if vertical scroll on window
box.style.top=Math.round(scroll_top+Math.max((view_height-box.offsetHeight)/2, 0))+"px";
else // vertical scroll on body
box.style.top=Math.round(Math.max(((view_height-box.offsetHeight)/2), 0) + 9)+"px"; // +9 for compatibility with auto tests
@@ -3941,39 +4445,44 @@ scheduler.showCover=function(box){ };
scheduler.showLightbox=function(id){
if (!id) return;
- if (!this.callEvent("onBeforeLightbox",[id])) return;
- var box = this._get_lightbox();
+ if (!this.callEvent("onBeforeLightbox",[id])) {
+ if (this._new_event)
+ this._new_event = null;
+ return;
+ }
+ var box = this.getLightbox();
this.showCover(box);
this._fill_lightbox(id,box);
this.callEvent("onLightbox",[id]);
};
-scheduler._fill_lightbox=function(id,box){
- var ev=this.getEvent(id);
- var s=box.getElementsByTagName("span");
- if (scheduler.templates.lightbox_header){
- s[1].innerHTML="";
- s[2].innerHTML=scheduler.templates.lightbox_header(ev.start_date,ev.end_date,ev);
+scheduler._fill_lightbox = function(id, box) {
+ var ev = this.getEvent(id);
+ var s = box.getElementsByTagName("span");
+ if (scheduler.templates.lightbox_header) {
+ s[1].innerHTML = "";
+ s[2].innerHTML = scheduler.templates.lightbox_header(ev.start_date, ev.end_date, ev);
} else {
- s[1].innerHTML=this.templates.event_header(ev.start_date,ev.end_date,ev);
- s[2].innerHTML=(this.templates.event_bar_text(ev.start_date,ev.end_date,ev)||"").substr(0,70); //IE6 fix
+ s[1].innerHTML = this.templates.event_header(ev.start_date, ev.end_date, ev);
+ s[2].innerHTML = (this.templates.event_bar_text(ev.start_date, ev.end_date, ev) || "").substr(0, 70); //IE6 fix
}
-
-
- var sns = this.config.lightbox.sections;
- for (var i=0; i < sns.length; i++) {
- var node=document.getElementById(sns[i].id).nextSibling;
- var block=this.form_blocks[sns[i].type];
- block.set_value.call(this,node,ev[sns[i].map_to],ev, sns[i]);
+
+ var sns = this.config.lightbox.sections;
+ for (var i = 0; i < sns.length; i++) {
+ var current_sns = sns[i];
+ var node = document.getElementById(current_sns.id).nextSibling;
+ var block = this.form_blocks[current_sns.type];
+ var value = (ev[current_sns.map_to] !== undefined) ? ev[current_sns.map_to] : current_sns.default_value;
+ block.set_value.call(this, node, value, ev, current_sns);
if (sns[i].focus)
- block.focus.call(this,node);
+ block.focus.call(this, node);
}
-
- scheduler._lightbox_id=id;
+
+ scheduler._lightbox_id = id;
};
scheduler._lightbox_out=function(ev){
- var sns = this.config.lightbox.sections;
+ var sns = this.config.lightbox.sections;
for (var i=0; i < sns.length; i++) {
- var node = document.getElementById(sns[i].id);
+ var node = document.getElementById(sns[i].id);
node=(node?node.nextSibling:node);
var block=this.form_blocks[sns[i].type];
var res=block.get_value.call(this,node,ev, sns[i]);
@@ -3982,20 +4491,20 @@ scheduler._lightbox_out=function(ev){ }
return ev;
};
-scheduler._empty_lightbox=function(){
+scheduler._empty_lightbox=function(data){
var id=scheduler._lightbox_id;
var ev=this.getEvent(id);
- var box=this._get_lightbox();
-
- this._lightbox_out(ev);
-
+ var box=this.getLightbox();
+
+ this._lame_copy(ev, data);
+
ev._timed=this.is_one_day_event(ev);
this.setEvent(ev.id,ev);
this._edit_stop_event(ev,true);
this.render_view_data();
};
scheduler.hide_lightbox=function(id){
- this.hideCover(this._get_lightbox());
+ this.hideCover(this.getLightbox());
this._lightbox_id=null;
this.callEvent("onAfterLightbox",[]);
};
@@ -4017,13 +4526,15 @@ scheduler.show_cover=function(){ document.body.appendChild(this._cover);
};
scheduler.save_lightbox=function(){
- if (this.checkEvent("onEventSave") && !this.callEvent("onEventSave",[this._lightbox_id,this._lightbox_out({ id: this._lightbox_id}), this._new_event]))
+ var data = this._lightbox_out({}, this._lame_copy(this.getEvent(this._lightbox_id)));
+ if (this.checkEvent("onEventSave") && !this.callEvent("onEventSave",[this._lightbox_id, data, this._new_event]))
return;
- this._empty_lightbox();
+ this._empty_lightbox(data);
this.hide_lightbox();
};
scheduler.startLightbox = function(id, box){
this._lightbox_id=id;
+ this._lightbox = box;
this.showCover(box);
};
scheduler.endLightbox = function(mode, box){
@@ -4031,6 +4542,7 @@ scheduler.endLightbox = function(mode, box){ if (mode)
scheduler.render_view_data();
this.hideCover(box);
+ this._lightbox_id = null; // in case of custom lightbox user only calls endLightbox so we need to reset _lightbox_id
};
scheduler.resetLightbox = function(){
if (scheduler._lightbox)
@@ -4043,7 +4555,7 @@ scheduler.cancel_lightbox=function(){ this.hide_lightbox();
};
scheduler._init_lightbox_events=function(){
- this._get_lightbox().onclick=function(e){
+ this.getLightbox().onclick=function(e){
var src=e?e.target:event.srcElement;
if (!src.className) src=src.previousSibling;
if (src && src.className)
@@ -4052,30 +4564,43 @@ scheduler._init_lightbox_events=function(){ scheduler.save_lightbox();
break;
case "dhx_delete_btn":
- var c=scheduler.locale.labels.confirm_deleting;
- if (!c||confirm(c)) {
+ var c=scheduler.locale.labels.confirm_deleting;
+
+ scheduler._dhtmlx_confirm(c, scheduler.locale.labels.title_confirm_deleting, function(){
scheduler.deleteEvent(scheduler._lightbox_id);
scheduler._new_event = null; //clear flag, if it was unsaved event
scheduler.hide_lightbox();
- }
+ });
+
break;
case "dhx_cancel_btn":
scheduler.cancel_lightbox();
break;
-
+
default:
- if (src.getAttribute("dhx_button")){
+ if (src.getAttribute("dhx_button")) {
scheduler.callEvent("onLightboxButton", [src.className, src, e]);
- } else if (src.className.indexOf("dhx_custom_button_")!=-1){
- var index = src.parentNode.getAttribute("index");
- var block=scheduler.form_blocks[scheduler.config.lightbox.sections[index].type];
- var sec = src.parentNode.parentNode;
- block.button_click(index,src,sec,sec.nextSibling);
+ } else {
+ var index, block, sec;
+ if (src.className.indexOf("dhx_custom_button") != -1) {
+ if (src.className.indexOf("dhx_custom_button_") != -1) {
+ index = src.parentNode.getAttribute("index");
+ sec = src.parentNode.parentNode;
+ } else {
+ index = src.getAttribute("index");
+ sec = src.parentNode;
+ src = src.firstChild;
+ }
+ }
+ if (index) {
+ block = scheduler.form_blocks[scheduler.config.lightbox.sections[index].type];
+ block.button_click(index, src, sec, sec.nextSibling);
+ }
}
break;
}
};
- this._get_lightbox().onkeydown=function(e){
+ this.getLightbox().onkeydown=function(e){
switch((e||event).keyCode){
case scheduler.keys.edit_save:
if ((e||event).shiftKey) return;
@@ -4092,12 +4617,12 @@ scheduler._init_lightbox_events=function(){ scheduler.setLightboxSize=function(){
var d = this._lightbox;
if (!d) return;
-
+
var con = d.childNodes[1];
con.style.height="0px";
- con.style.height=con.scrollHeight+"px";
- d.style.height=con.scrollHeight+50+"px";
- con.style.height=con.scrollHeight+"px"; //it is incredible , how ugly IE can be
+ con.style.height=con.scrollHeight+"px";
+ d.style.height=con.scrollHeight+scheduler.xy.lightbox_additional_height+"px";
+ con.style.height=con.scrollHeight+"px"; //it is incredible , how ugly IE can be
};
scheduler._init_dnd_events = function(){
@@ -4111,14 +4636,14 @@ scheduler._move_while_dnd = function(e){ document.body.className += " dhx_unselectable";
document.dhx_unselectable = true;
}
- var lb = scheduler._get_lightbox();
+ var lb = scheduler.getLightbox();
var now = (e&&e.target)?[e.pageX, e.pageY]:[event.clientX, event.clientY];
lb.style.top = scheduler._lb_start[1]+now[1]-scheduler._dnd_start_lb[1]+"px";
lb.style.left = scheduler._lb_start[0]+now[0]-scheduler._dnd_start_lb[0]+"px";
}
};
scheduler._ready_to_dnd = function(e){
- var lb = scheduler._get_lightbox();
+ var lb = scheduler.getLightbox();
scheduler._lb_start = [parseInt(lb.style.left,10), parseInt(lb.style.top,10)];
scheduler._dnd_start_lb = (e&&e.target)?[e.pageX, e.pageY]:[event.clientX, event.clientY];
};
@@ -4129,7 +4654,7 @@ scheduler._finish_dnd = function(){ document.dhx_unselectable = false;
}
};
-scheduler._get_lightbox=function(){ //scheduler.config.wide_form=true;
+scheduler.getLightbox=function(){ //scheduler.config.wide_form=true;
if (!this._lightbox){
var d=document.createElement("DIV");
d.className="dhx_cal_light";
@@ -4141,17 +4666,16 @@ scheduler._get_lightbox=function(){ //scheduler.config.wide_form=true; if (/msie|MSIE 6/.test(navigator.userAgent))
d.className+=" dhx_ie6";
d.style.visibility="hidden";
- var html = this._lightbox_template
+ var html = this._lightbox_template;
+
var buttons = this.config.buttons_left;
- scheduler.locale.labels["dhx_save_btn"] = scheduler.locale.labels.icon_save;
- scheduler.locale.labels["dhx_cancel_btn"] = scheduler.locale.labels.icon_cancel;
- scheduler.locale.labels["dhx_delete_btn"] = scheduler.locale.labels.icon_delete;
for (var i = 0; i < buttons.length; i++)
- html+="<div class='dhx_btn_set'><div dhx_button='1' class='"+buttons[i]+"'></div><div>"+scheduler.locale.labels[buttons[i]]+"</div></div>";
+ html+="<div class='dhx_btn_set dhx_left_btn_set "+buttons[i]+"_set'><div dhx_button='1' class='"+buttons[i]+"'></div><div>"+scheduler.locale.labels[buttons[i]]+"</div></div>";
+
buttons = this.config.buttons_right;
for (var i = 0; i < buttons.length; i++)
- html+="<div class='dhx_btn_set' style='float:right;'><div dhx_button='1' class='"+buttons[i]+"'></div><div>"+scheduler.locale.labels[buttons[i]]+"</div></div>";
-
+ html+="<div class='dhx_btn_set dhx_right_btn_set "+buttons[i]+"_set' style='float:right;'><div dhx_button='1' class='"+buttons[i]+"'></div><div>"+scheduler.locale.labels[buttons[i]]+"</div></div>";
+
html+="</div>";
d.innerHTML=html;
if (scheduler.config.drag_lightbox){
@@ -4159,7 +4683,7 @@ scheduler._get_lightbox=function(){ //scheduler.config.wide_form=true; d.firstChild.onselectstart = function(){ return false; };
d.firstChild.style.cursor = "pointer";
scheduler._init_dnd_events();
-
+
}
document.body.insertBefore(d,document.body.firstChild);
this._lightbox=d;
@@ -4181,14 +4705,19 @@ scheduler._get_lightbox=function(){ //scheduler.config.wide_form=true; html+="<div id='"+sns[i].id+"' class='dhx_cal_lsection'>"+button+this.locale.labels["section_"+sns[i].name]+"</div>"+block.render.call(this,sns[i]);
html+="</div>"
}
-
- //localization
+
var ds=d.getElementsByTagName("div");
- //sections
- ds[1].innerHTML=html;
+ for (var i=0; i<ds.length; i++) {
+ var t_ds = ds[i];
+ if (t_ds.className == "dhx_cal_larea") {
+ t_ds.innerHTML = html;
+ break;
+ }
+ }
+
//sizes
this.setLightboxSize();
-
+
this._init_lightbox_events(this);
d.style.display="none";
d.style.visibility="visible";
@@ -4274,4 +4803,4 @@ scheduler._update_callback = function(upd,id){ data.end_date = scheduler.templates.xml_date(data.end_date);
scheduler.addEvent(data);
-}; +};
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/dhtmlxscheduler_dhx_terrace.css b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/dhtmlxscheduler_dhx_terrace.css new file mode 100644 index 00000000000..67b57d481d2 --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/dhtmlxscheduler_dhx_terrace.css @@ -0,0 +1,2018 @@ +/* +This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in non-GPL project. Please contact sales@dhtmlx.com for details +*/ + +.dhtmlx_message_area{
+ position:fixed;
+ right:5px;
+ width:250px;
+ z-index:1000;
+}
+
+.dhtmlx-info{
+ min-width: 120px;
+ padding:4px 4px 4px 20px;
+ font-family:Tahoma;
+ z-index: 10000;
+
+ margin:5px;
+ margin-bottom:10px;
+
+ -webkit-transition: all .5s ease;
+ -moz-transition: all .5s ease;
+ -o-transition: all .5s ease;
+ transition: all .5s ease;
+}
+.dhtmlx-info.hidden{
+ height:0px;
+ padding:0px;
+ border-width:0px;
+ margin:0px;
+ overflow:hidden;
+}
+
+.dhtmlx_modal_box{
+ overflow:hidden;
+ display: inline-block;
+ min-width: 300px;
+ width: 300px;
+ text-align: center;
+ position:fixed;
+
+ background-color: #fff;
+ background:-webkit-linear-gradient(top, #ffffff 1%, #d0d0d0 99%);
+ background:-moz-linear-gradient(top, #ffffff 1%, #d0d0d0 99%);
+ box-shadow: 0px 0px 14px #888;
+
+ font-family: Tahoma;
+
+ z-index:20000;
+
+ border-radius:6px;
+ border: 1px solid #ffffff;
+}
+
+.dhtmlx_popup_title{
+ border-top-left-radius:5px;
+ border-top-right-radius:5px;
+
+ border-width:0px;
+
+ background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAoCAMAAAAIaGBFAAAAhFBMVEVwcHBubm5sbGxqampoaGhmZmZlZWVjY2NhYWFfX19dXV1bW1taWlpYWFhWVlZUVFRSUlJRUVFPT09NTU1LS0tJSUlHR0dGRkZERERCQkJAQEA+Pj49PT09PT0+Pj5AQEBBQUFDQ0NERERGRkZHR0dJSUlKSkpMTExMTEw5OTk5OTk5OTkny8YEAAAAQklEQVQImQXBCRJCAAAAwKVSQqdyjSPXNP7/QLsIhA6OTiJnF7GrRCpzc/fw9PKW+/gqlCq1RqvTG/yMJrPF6m/bAVEhAxxnHG0oAAAAAElFTkSuQmCC);
+ background-image: -webkit-linear-gradient(top, #707070 1%, #3d3d3d 70%, #4c4c4c 97%, #393939 97%);
+ background-image: -moz-linear-gradient(top, #707070 1%, #3d3d3d 70%, #4c4c4c 97%, #393939 97%);
+}
+
+.dhtmlx-info, .dhtmlx_popup_button, .dhtmlx_button{
+ user-select: none;
+ -webkit-user-select: none;
+ -moz-user-select:-moz-none;
+
+ cursor:pointer;
+}
+
+.dhtmlx_popup_text{
+ overflow:hidden;
+}
+
+.dhtmlx_popup_controls{
+ border-radius:6px;
+ padding:5px;
+}
+
+.dhtmlx_popup_button, .dhtmlx_button{
+ height: 30px;
+ line-height:30px;
+
+ display: inline-block;
+ margin: 0 5px;
+ border-radius: 6px;
+
+ color:#FFF;
+}
+.dhtmlx_popup_button{
+ min-width: 120px;
+}
+
+div.dhx_modal_cover {
+ background-color:#000;
+ cursor:default;
+
+ filter:alpha(opacity = 20);
+ opacity: 0.2;
+
+ position: fixed;
+ z-index:19999;
+ left: 0px; top: 0px;
+ width: 100%; height: 100%;
+
+ border: none;
+ zoom: 1;
+}
+
+.dhtmlx-info img, .dhtmlx_modal_box img{
+ float:left;
+ margin-right:20px;
+}
+
+.dhtmlx-alert-error .dhtmlx_popup_title, .dhtmlx-confirm-error .dhtmlx_popup_title{
+ background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAsCAIAAAArRUU2AAAATklEQVR4nIWLuw2AMBBDjVuQiBT2oWbRDATrnB0KQOJoqPzRe3BrHI6dcBASYREKovtK6/6DsDOX+stN+3H1YX9ciRgnYq5EWYhS2dftBIuLT4JyIrPCAAAAAElFTkSuQmCC);
+}
+.dhtmlx-alert-error, .dhtmlx-confirm-error {
+ border: 1px solid #ff0000;
+}
+
+/*Skin section*/
+.dhtmlx_button, .dhtmlx_popup_button{
+ box-shadow: 0px 0px 4px #888;
+ border:1px solid #838383;
+}
+.dhtmlx_button input, .dhtmlx_popup_button div{
+ border:1px solid #FFF;
+ background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAeCAMAAADaS4T1AAAAYFBMVEVwcHBtbW1ra2toaGhmZmZjY2NhYWFeXl5cXFxaWlpXV1dVVVVSUlJQUFBNTU1LS0tJSUlGRkZERERBQUE/Pz88PDw9PT0+Pj5AQEBCQkJDQ0NFRUVHR0dISEhKSkpMTEzqthaMAAAAMklEQVQImQXBhQ2AMAAAsOIMlwWH/8+kRSKVyRVKlVrQaHV6g9FktlhFm93hdLk9Xt8PIfgBvdUqyskAAAAASUVORK5CYII=);
+ background-image: -webkit-linear-gradient(top, #707070 1%, #3d3d3d 70%, #4c4c4c 99%);
+ background-image: -moz-linear-gradient(top, #707070 1%, #3d3d3d 70%, #4c4c4c 99%);
+
+ border-radius:6px;
+ font-size:15px;
+ font-weight:normal;
+ -moz-box-sizing:content-box;
+ box-sizing:content-box;
+
+ color:#fff; padding:0px; margin:0px;
+ vertical-align:top;
+
+ height:28px;
+ line-height:28px;
+}
+
+.dhtmlx_button input:focus, .dhtmlx_button input:active, .dhtmlx_popup_button div:active, .dhtmlx_popup_button div:focus{
+
+ background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAeCAMAAADaS4T1AAAAXVBMVEVwcHBubm5tbW1sbGxra2tpaWloaGhnZ2dmZmZlZWVjY2NiYmJhYWFgYGBfX19dXV1cXFxbW1taWlpZWVlXV1dWVlZVVVVUVFRTU1NRUVFQUFBPT09OTk5NTU1LS0tT9SY0AAAAMUlEQVQImQXBhQGAMAAAIGxnx2z9/00BiVQmVyhVakGj1ekNRpPZYhVtdofT5fZ4fT8hpwG05JjexgAAAABJRU5ErkJggg==);
+ background-image: -webkit-linear-gradient(top, #707070 1%, #4c4c4c 99%);
+ background-image: -moz-linear-gradient(top, #707070 1%, #4c4c4c 99%);
+}
+.dhtmlx_popup_title{
+ color:#fff;
+ text-shadow: 1px 1px #000;
+ height:40px; line-height:40px;
+ font-size:20px;
+}
+.dhtmlx_popup_text{
+ margin:15px 15px 5px 15px;
+ font-size:14px;
+ color:#000;
+ min-height:30px;
+ border-radius:6px;
+}
+
+
+.dhtmlx-info, .dhtmlx-error{
+ font-size:14px;
+ color:#000;
+ box-shadow: 0px 0px 10px #888;
+
+ padding:0px;
+
+ background-color:#FFF;
+ border-radius:3px;
+ border:1px solid #ffffff;
+}
+.dhtmlx-info div{
+ padding:5px 10px 5px 10px;
+ background-color: #fff;
+
+ border-radius:3px;
+ border:1px solid #B8B8B8;
+}
+.dhtmlx-error{
+ background-color: #d81b1b;
+ border:1px solid #ff3c3c;
+ box-shadow: 0px 0px 10px #000;
+}
+.dhtmlx-error div{
+ background-color: #d81b1b;
+ border:1px solid #940000;
+ color:#FFF;
+}
+
+ +.dhx_cal_container{
+ background-color:#C2D5FC;
+ font-family:Tahoma;
+ font-size:8pt;
+ position:relative;
+ overflow:hidden;
+}
+.dhx_cal_container div{
+ -moz-user-select:none;
+ -moz-user-select:-moz-none;
+}
+.dhx_cal_navline{
+ height:20px;
+ position:absolute;
+ z-index:3;
+ width:750px;
+ color:#2F3A48;
+}
+.dhx_cal_navline div{
+ position:absolute;
+ top:2px;
+ white-space:nowrap;
+}
+.dhx_cal_navline .dhx_cal_date {
+ font-weight:600;
+ left:210px;
+ padding-top: 1px;
+}
+.dhx_cal_button .dhx_left_bg{
+ width:1px; overflow:hidden;
+ height:17px;
+ z-index:20;
+ top:0px;
+}
+.dhx_cal_prev_button{
+ background-image:url(imgs/buttons.png);
+ background-position:0px 0px;
+ width:29px; height:17px;
+ left:50px; cursor:pointer;
+}
+.dhx_cal_next_button{
+ background-image:url(imgs/buttons.png);
+ background-position: -30px 0px;
+ width:29px; height:17px;
+ left:80px; cursor:pointer;
+}
+.dhx_cal_today_button{
+ background-image:url(imgs/buttons.png);
+ background-position: -60px 0px;
+ width:75px; height:17px;
+ left:112px; cursor:pointer;
+ text-align:center;
+ text-decoration:underline;
+}
+.dhx_cal_tab{
+ width:59px; height:19px;
+ text-align:center;
+ text-decoration:underline;
+ padding-top:2px;
+ cursor:pointer;
+ background-color: #D8E1EA;
+
+ -webkit-border-top-left-radius: 4px;
+ -webkit-border-top-right-radius: 4px;
+ -moz-border-radius-topleft: 4px;
+ -moz-border-radius-topright: 4px;
+ border-top-left-radius: 4px;
+ border-top-right-radius: 4px;
+}
+.dhx_cal_tab.active{
+ text-decoration:none;
+
+ cursor:default;
+ font-weight:bold;
+ border: 1px dotted #586A7E;
+ border-bottom: 0;
+ background-color: #C2D5FC;
+}
+.dhx_cal_header{
+ position:absolute;
+ left:10px; top:23px;
+ width:750px;
+ border-top:1px dotted #8894A3;
+ border-right:1px dotted #8894A3;
+ z-index:2;
+ overflow:hidden;
+ color:#2F3A48;
+}
+.dhx_cal_data{
+ border-top:1px dotted #8894A3;
+ position:absolute;
+ top:44px;
+ width:600px;
+ overflow-y:auto;
+ overflow-x:hidden;
+}
+.dhx_scale_bar{
+ position:absolute;
+ text-align:center;
+ background-color:#C2D5FC;
+ padding-top:3px;
+ border-left:1px dotted #586A7E;
+}
+.dhx_scale_holder{
+ position:absolute;
+ border-right:1px dotted #586A7E;
+ background-image:url(imgs/databg.png);
+}
+.dhx_scale_holder_now{
+ position:absolute;
+ border-right:1px dotted #586A7E;
+ background-image:url(imgs/databg_now.png);
+}
+.dhx_scale_hour{
+ height:41px;
+ width:50px;
+ border-bottom:1px dotted #8894A3;
+ background-color:#C2D5FC;
+ text-align:center;
+ line-height:40px;
+ color:#586A7E;
+ overflow:hidden;
+}
+.dhx_month_head{
+ background-color:#EBEFF4;
+ color:#2F3A48;
+ border-right:1px dotted #586A7E;
+ height:18px;
+ padding-right:5px;
+ padding-top:3px;
+ text-align:right;
+}
+.dhx_month_body{
+ border-right:1px dotted #586A7E;
+ border-bottom:1px dotted #586A7E;
+ background-color:#FFFFFF;
+}
+.dhx_now .dhx_month_body{
+ background-color:#E2EDFF;
+}
+.dhx_after .dhx_month_body, .dhx_before .dhx_month_body{
+ background-color:#ECECEC;
+}
+.dhx_after .dhx_month_head, .dhx_before .dhx_month_head{
+ background-color:#E2E3E6;
+ color:#94A6BB;
+}
+.dhx_now .dhx_month_head{
+ background-color:#D1DEF4;
+ font-weight:bold;
+}
+.dhx_cal_drag{
+ position:absolute;
+ z-index:9999;
+ background-color:#FFE763;
+ border:1px solid #B7A543;
+ opacity:0.5;
+ filter:alpha(opacity=50);
+}
+.dhx_loading{
+ position:absolute;
+ width:128px;
+ height:15px;
+ background-image:url(imgs/loading.gif);
+ z-index:9999;
+}
+.dhx_multi_day_icon, .dhx_multi_day{
+ background-color:#E1E6FF;
+ background-repeat:no-repeat;
+ border-right:1px dotted #8894A3;
+}
+.dhx_multi_day{
+ position: absolute;
+ border-top:1px dotted #8894A3;
+}
+.dhx_multi_day_icon, .dhx_multi_day_icon_small{
+ background-position: center center;
+ background-color:#E1E6FF;
+ background-repeat:no-repeat;
+ border-bottom:1px dotted #8894A3;
+ border-right:1px dotted #8894A3;
+}
+.dhx_multi_day_icon{
+ background-image:url(imgs/clock_big.gif);
+}
+.dhx_multi_day_icon_small{
+ background-image:url(imgs/clock_small.gif);
+
+}
+.dhtmlxLayoutPolyContainer_dhx_skyblue .dhx_cal_container {
+ background-color: #d0e5ff;
+} +.dhx_cal_event .dhx_header, .dhx_cal_event .dhx_title, .dhx_cal_event .dhx_body, .dhx_cal_event .dhx_footer {
+ background-color:#FFE763;
+ border:1px solid #B7A543;
+ color:#887A2E;
+ overflow:hidden;
+ width:100%;
+
+ font-family:Tahoma;
+ font-size:8pt;
+}
+.dhx_move_denied .dhx_cal_event .dhx_header, .dhx_move_denied .dhx_cal_event .dhx_title{
+ cursor:default;
+}
+.dhx_cal_event .dhx_header{
+ height:1px;
+ margin-left:1px;
+ border-width:1px 1px 0px 1px;
+ cursor:pointer;
+}
+.dhx_cal_event .dhx_title {
+ height:12px;
+ border-width:0px 1px 1px 1px;
+ border-bottom-style:dotted;
+
+ font-size:7pt;
+ font-weight:bold;
+ text-align:center;
+
+ background-position:right;
+ background-repeat:no-repeat;
+ cursor:pointer;
+}
+.dhx_cal_event .dhx_body, .dhx_cal_event.dhx_cal_select_menu .dhx_body{
+ border-width:0 1px 1px 1px;
+ padding:5px;
+}
+.dhx_resize_denied {
+ cursor:default !important;
+}
+.dhx_cal_event .dhx_event_resize {
+ cursor:s-resize;
+}
+.dhx_cal_event .dhx_footer, .dhx_cal_event .dhx_select_menu_footer{
+ height:1px;
+ margin-left:2px;
+ border-width:0px 1px 1px 1px;
+}
+.dhx_cal_event_line{
+ background-color:#FFE763;
+ border:1px solid #B7A543;
+ border-radius:3px;
+ font-family:Tahoma;
+ font-size:8pt;
+ height:13px;
+ padding-left:10px;
+ color:#887A2E;
+ cursor:pointer;
+ overflow:hidden;
+}
+.dhx_cal_event_clear{
+ font-family:Tahoma;
+ font-size:8pt;
+ height:13px;
+ padding-left:2px;
+ color:#887A2E;
+ white-space:nowrap;
+ overflow:hidden;
+ cursor:pointer;
+}
+.dhx_in_move{
+ background-color:#FFFF80;
+}
+div.dhx_cal_editor{
+ background-color:#FFE763;
+ border:1px solid #B7A543;
+ border-top-style:dotted;
+ z-index:999;
+ position:absolute;
+ overflow:hidden;
+}
+textarea.dhx_cal_editor{
+ width:100%;
+ height:100%;
+ border:0px solid black;
+ margin:none;
+ padding:none;
+ overflow:auto;
+}
+div.dhx_menu_head{
+ background-image:url(imgs/controls.gif);
+ background-position: 0px -43px;
+ width:10px; height:10px;
+ margin-left:5px; margin-top:1px;
+ border:none;
+ cursor:default;
+}
+div.dhx_menu_icon{
+ background-image:url(imgs/controls.gif);
+ width:20px; height:20px;
+ margin-left:-5px; margin-top:0px;
+ border:none;
+ cursor:pointer;
+}
+div.icon_details{
+ background-position: 0px 0px;
+}
+div.icon_edit{
+ background-position: -22px 0px;
+}
+div.icon_save{
+ background-position: -84px -1px;
+}
+div.icon_cancel{
+ background-position: -62px 0px;
+}
+div.icon_delete{
+ background-position: -42px 0px;
+} +.dhx_unselectable, .dhx_unselectable div{
+ -webkit-user-select:none;
+ -moz-user-select:none;
+ -moz-user-select:-moz-none;
+}
+.dhx_cal_light{
+ background-color:#FFE763;
+ border-radius:5px;
+ font-family:Tahoma;
+ font-size:8pt;
+ border:1px solid #B7A64B;
+ color:#887A2E;
+
+ position:absolute;
+ z-index:10001;
+
+ width:580px;
+ height:300px;
+
+ box-shadow:5px 5px 5px #888;
+}
+.dhx_cal_light_wide{
+ width:650px;
+}
+.dhx_mark{
+ position:relative; top:3px;
+ background-image:url('./imgs/controls.gif');
+ background-position: 0px -43px;
+ padding-left:10px;
+}
+.dhx_ie6 .dhx_mark{
+ background-position: 6px -41px;
+}
+
+.dhx_cal_light select{
+ font-family:Tahoma;
+ font-size:8pt;
+ color:#887A2E;
+ padding:2px;
+ margin:0px;
+}
+.dhx_cal_ltitle{
+ padding:2px 0px 2px 5px;
+ overflow:hidden;
+ white-space:nowrap;
+}
+.dhx_cal_ltitle span{
+ white-space:nowrap;
+}
+.dhx_cal_lsection{
+ background-color:#DBCF8C;
+ color:#FFF4B5;
+ font-weight:bold;
+ padding:5px 0px 3px 10px;
+}
+.dhx_section_time{
+ background-color:#DBCF8C;
+ white-space:nowrap;
+}
+.dhx_cal_lsection .dhx_fullday{
+ float:right;
+ margin-right:5px;
+ color:#887A2E;
+ font-size:12px;
+ font-weight:normal;
+ line-height:20px;
+ vertical-align:top;
+ cursor:pointer;
+}
+.dhx_cal_lsection{
+ font-size:18px;
+ font-family:Arial;
+}
+.dhx_cal_ltext{
+ padding:2px 0px 2px 10px;
+ overflow:hidden;
+}
+.dhx_cal_ltext textarea{
+ background-color: #FFF4B5; /* #FFF4B5; should be the same for dhx_cal_larea, was transperent */
+ overflow:auto;
+ border:none;
+ color:#887A2E;
+ height:100%;
+ width:100%;
+ outline:none !important;
+ resize: none;
+}
+.dhx_time{
+ font-weight:bold;
+}
+.dhx_cal_light .dhx_title{
+ padding-left:10px;
+}
+.dhx_cal_larea{
+ border:1px solid #DCC43E;
+ background-color:#FFF4B5;
+ overflow:hidden;
+
+ margin-left:3px;
+
+ width:572px;
+ height:1px;
+}
+.dhx_btn_set{
+ padding:5px 10px 0px 10px;
+ float:left;
+}
+.dhx_btn_set div{
+ float:left;
+ height:21px;
+ line-height:21px;
+ vertical-align:middle;
+ cursor:pointer;
+}
+.dhx_save_btn{
+ background-image:url('./imgs/controls.gif');
+ background-position:-84px 0px;
+ width:21px;
+
+}
+.dhx_cancel_btn{
+ background-image:url('./imgs/controls.gif');
+ background-position:-63px 0px;
+ width:20px;
+}
+.dhx_delete_btn{
+ background-image:url('./imgs/controls.gif');
+ background-position:-42px 0px;
+ width:20px;
+}
+.dhx_cal_cover{
+ width:100%;
+ height:100%;
+ position:absolute;
+ z-index:10000;
+ top:0px;
+ left:0px;
+ background-color:black;
+
+ opacity:0.1;
+ filter:alpha(opacity=10);
+}
+.dhx_custom_button{
+ padding:0px 3px 0px 3px;
+ color:#887A2E;
+ font-family:Tahoma;
+ font-size:8pt;
+ background-color:#FFE763;
+ font-weight:normal;
+ margin-right:5px;
+ margin-top:0px;
+ cursor:pointer;
+}
+.dhx_custom_button div{
+ cursor:pointer;
+ float:left;
+ height:21px;
+ line-height:21px;
+ vertical-align:middle;
+}
+
+
+.dhx_cal_light_wide .dhx_cal_larea{
+ border-top-width:0px;
+}
+.dhx_cal_light_wide .dhx_cal_lsection{
+ border:0px;
+ float:left;
+ text-align:right;
+ width:100px;
+ height:20px;
+ font-size:16px;
+ padding: 5px 0px 0px 10px;
+}
+.dhx_cal_light_wide .dhx_wrap_section{
+ border-top:1px solid #DBCF8C;
+ position:relative;
+ background-color:#DBCF8C;
+ overflow:hidden;
+}
+.dhx_cal_light_wide .dhx_section_time{
+ padding-top:2px !important;
+ height:20px !important;
+}
+.dhx_section_time{
+ text-align: center;
+}
+.dhx_cal_light_wide .dhx_cal_larea{
+ width:730px;
+}
+.dhx_cal_light_wide{
+ width:738px;
+}
+
+.dhx_cal_light_wide .dhx_section_time{
+ background:transparent;
+}
+.dhx_cal_light_wide .dhx_cal_checkbox label{
+ padding-left:0px;
+}
+.dhx_cal_wide_checkbox input{
+ margin-top:8px;
+ margin-left:14px;
+}
+.dhx_cal_light input{
+ font-family:Tahoma;
+ font-size:8pt;
+ color:#887A2E;
+}
+.dhx_cal_light_wide .dhx_cal_lsection .dhx_fullday{
+ float:none;
+ margin-right:0px;
+ color:#FFF4B5;
+ font-weight:bold;
+ font-size:16px;
+ font-family:Arial;
+ cursor:pointer;
+}
+.dhx_custom_button{
+ float: right;
+ height: 21px;
+ width:90px;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ -ms-border-radius: 4px;
+ -o-border-radius: 4px;
+ border-radius: 4px;
+}
+.dhx_cal_light_wide .dhx_custom_button {
+ position:absolute;
+ top:0;
+ right:0;
+ margin-top: 2px;
+}
+.dhx_cal_light_wide .dhx_repeat_right {
+ margin-right: 55px;
+} +.dhx_minical_popup{
+ position:absolute;z-index:10100;
+ width:251px; height:175px;
+}
+.dhx_scale_bar_header {
+ position: absolute;
+ border-bottom: 1px dotted #8894A3;
+ width: 100%;
+}
+.dhx_expand_icon {
+ position:absolute; top:0px; right:0px;
+ background-image:url(./imgs/collapse_expand_icon.gif);
+ width:18px; height:18px;
+ cursor:pointer;
+ background-position:0px 18px;
+ z-index:16;
+}
+.dhx_scheduler_agenda .dhx_cal_data {
+ background-image:url(./imgs/databg.png);
+}
+.dhx_agenda_area{
+ width:100%;
+ overflow-y:auto;
+ background-image:url(./imgs/databg.png);
+}
+.dhx_agenda_line{
+ height:21px;
+ clear:both;
+ overflow:hidden;
+}
+.dhx_agenda_line div{
+ float:left;
+ width:188px;
+ border-right:1px dotted #8894A3;
+ text-align:center;
+ line-height:21px;
+ overflow:hidden;
+}
+.dhx_agenda_area .dhx_agenda_line div{
+ border-right:0px dotted #8894A3;
+}
+.dhx_v_border{
+ position:absolute;
+ left:187px;
+ top:0;
+ border-right:1px dotted #8894A3;
+ width:1px;
+ height:100%;
+}
+.dhx_agenda_line .dhx_event_icon{
+ width:20px;
+ border-width:0px;
+ background:url(./imgs/icon.png) no-repeat;
+ background-position: 5px 4px;
+ cursor:pointer;
+}
+.dhx_agenda_line span{
+ padding-left:5px;
+ line-height:21px;
+}
+
+
+.dhx_year_body{
+ border-left:1px dotted #586A7E;
+}
+.dhx_year_week{
+ position:relative;
+}
+.dhx_scale_bar_last{
+ border-right:1px dotted #586A7E;
+}
+.dhx_year_month{
+ height:18px;
+ padding-top:3px;
+ border:1px dotted #586A7E;
+ text-align:center;
+ vertical-align:middle;
+}
+.dhx_year_body .dhx_before .dhx_month_head, .dhx_year_body .dhx_after .dhx_month_head, .dhx_year_body .dhx_before .dhx_month_head a, .dhx_year_body .dhx_after .dhx_month_head a{
+ color:#E2E3E6 !important;
+}
+.dhx_year_body .dhx_month_body{
+ height:0px;
+ overflow:hidden;
+}
+.dhx_month_head.dhx_year_event{
+ background-color:#FFE763;
+}
+.dhx_year_body .dhx_before .dhx_month_head, .dhx_year_body .dhx_after .dhx_month_head{
+ cursor: default;
+}
+.dhx_tooltip{
+ border:1px solid #BBBBBB;
+ background-image:url(./imgs/databg.png);
+ position:absolute;
+ z-index:9998;
+ width:300px;
+ height:auto;
+ font-family:Tahoma;
+ font-size:8pt;
+ overflow:hidden;
+}
+
+.dhx_tooltip_line{
+ line-height:20px;
+ height:20px;
+ overflow:hidden;
+}
+
+.dhx_tooltip_line .dhx_event_icon{
+ width:20px; height:20px;
+ padding-right:10px;
+ float:left;
+ border-width:0px;
+ position:relative;
+ background:url(./imgs/icon.png) no-repeat;
+ background-position: 5px 4px;
+ cursor:pointer;
+}
+
+.dhx_tooltip_date{
+ float:left;
+ width:auto;
+ padding-left:5px;
+ text-align:center;
+}
+
+.dhx_text_disabled{
+ color:#887A2E;
+ font-family:Tahoma;
+ font-size:8pt;
+}
+
+.dhx_mini_calendar{
+ -moz-box-shadow:5px 5px 5px #888; /*Doesn't work in IE*/
+ -khtml-box-shadow: 5px 5px 5px #888;
+}
+
+.dhx_mini_calendar .dhx_month_head{
+ cursor:pointer;
+}
+.dhx_mini_calendar .dhx_calendar_click{
+ background-color: #C2D5FC;
+}
+.dhx_cal_navline div.dhx_minical_icon{
+ width:18px;
+ height:18px;
+ left:190px;
+ top:1px;
+ cursor:pointer;
+ background-image:url(./imgs/calendar.gif);
+}
+
+.dhx_matrix_scell {
+ height: 100%;
+}
+
+.dhx_matrix_cell, .dhx_matrix_scell{
+ overflow:hidden;
+ text-align:center;
+ vertical-align:middle;
+ border-bottom:1px dotted #8894A3;
+ border-right:1px dotted #8894A3;
+}
+.dhx_matrix_cell{
+ background-color:white;
+}
+.dhx_matrix_line{
+ overflow: hidden;
+}
+.dhx_matrix_cell div, .dhx_matrix_scell div{
+ overflow:hidden;
+ text-align:center;
+ height:auto;
+}
+
+.dhx_cal_lsection .dhx_readonly{
+ font-size:9pt;
+ font-size:8pt;
+ padding:2px;
+ color:#887A2E;
+}
+.dhx_cal_event_line .dhx_event_resize {
+ cursor: w-resize;
+ background: url(./imgs/resize_dots.png) repeat-y;
+ position: absolute;
+ top: 0;
+ width: 4px;
+}
+.dhx_event_resize_start {
+ left: 0;
+}
+.dhx_event_resize_end {
+ right: 0;
+}
+
+/* Tree view */
+.dhx_matrix_scell.folder, .dhx_data_table.folder .dhx_matrix_cell{
+ background-color: #969394;
+ cursor: pointer;
+}
+.dhx_matrix_scell .dhx_scell_level0{
+ padding-left: 5px;
+}
+.dhx_matrix_scell .dhx_scell_level1{
+ padding-left: 20px;
+}
+.dhx_matrix_scell .dhx_scell_level2{
+ padding-left: 35px;
+}
+.dhx_matrix_scell .dhx_scell_level3{
+ padding-left: 50px;
+}
+.dhx_matrix_scell .dhx_scell_level4{
+ padding-left: 65px;
+}
+
+.dhx_matrix_scell.folder{
+ font-weight: bold;
+ text-align: left;
+}
+.dhx_matrix_scell.folder .dhx_scell_expand{
+ float: left;
+ width: 10px;
+ padding-right:3px;
+}
+.dhx_matrix_scell.folder .dhx_scell_name{
+ float: left;
+ width: auto;
+}
+.dhx_matrix_scell.item .dhx_scell_name{
+ padding-left:15px;
+ text-align: left;
+}
+.dhx_data_table.folder .dhx_matrix_cell{
+ border-right: 0;
+}
+.dhx_section_timeline {
+ overflow: hidden;
+ padding: 4px 0 2px 10px;
+}
+.dhx_section_timeline select{
+ width: 552px;
+}
+
+/* Tree view end*/
+
+/* Map view */
+.dhx_map_area{
+ width:100%;
+ height:100%;
+ overflow-y: auto;
+ overflow-x: hidden;
+ background-image:url(./imgs/databg.png);
+}
+.dhx_map_line .dhx_event_icon{
+ width:20px;
+ border-width:0px;
+ background:url(./imgs/icon.png) no-repeat;
+ background-position: 5px 4px;
+ cursor:pointer;
+}
+.dhx_map_line{
+ height:21px;
+ clear:both;
+ overflow:hidden;
+}
+.dhx_map {
+ position:absolute;
+}
+.dhx_map_line div{
+ float:left;
+ border-right:1px dotted #8894A3;
+ text-align:center;
+ line-height:21px;
+ overflow:hidden;
+}
+.dhx_map_line .headline_description{
+ float:left;
+
+ border-right:1px dotted #8894A3;
+ text-align:center;
+ line-height:21px;
+ overflow:hidden;
+}
+.dhx_map_line .dhx_map_description{
+ float:left;
+ border-right: 0 dotted #8894A3;
+ text-align:center;
+ line-height:21px;
+ overflow:hidden;
+}
+.dhx_map_line .headline_date, .dhx_map_line .headline_description {
+ border-left: 0;
+}
+.dhx_map_line .line_description {
+ float:left;
+ border-right:1px dotted #8894A3;
+ text-align:left;
+ padding-left:5px;
+ line-height:21px;
+ overflow:hidden;
+}
+.dhx_map_line.highlight{
+ background-color: #C4C5CC;
+}
+.dhx_map_area .dhx_map_line div{
+ border-right:0px dotted #8894A3;
+}
+/* Map view end */
+
+/* dhtmlXTooltip start */
+.dhtmlXTooltip.tooltip{
+ -moz-box-shadow:3px 3px 3px #888888;
+ -webkit-box-shadow:3px 3px 3px #888888;
+ -o-box-shadow:3px 3px 3px #888888;
+ box-shadow:3px 3px 3px #888888;
+ filter:
+ progid:DXImageTransform.Microsoft.Shadow(color='#888888', Direction=135, Strength=5)
+ ;
+ background-color:white;
+ border-left:1px dotted #887A2E;
+ border-top:1px dotted #887A2E;
+ color:#887A2E;
+ cursor:default;
+ padding:10px;
+ position:absolute;
+ z-index:500;
+}
+/* dhtmlXTooltip end */
+
+/* Lightbox checkbox section */
+.dhx_cal_checkbox label {
+ padding-left: 5px;
+}
+/* Lightbox checkbox section end */
+
+
+/* Lightbox radiobuttons section */
+.dhx_cal_light .radio {
+ padding: 2px 0px 2px 10px;
+}
+.dhx_cal_light .radio input, .dhx_cal_light .radio label{
+ line-height: 15px;
+}
+.dhx_cal_light .radio input {
+ vertical-align: middle;
+ margin: 0px;
+ padding: 0px;
+}
+.dhx_cal_light .radio label {
+ vertical-align: middle;
+ padding-right: 10px;
+}
+/* Lightbox radiobuttons section end */
+
+
+/* Lightbox dhtmlx combo section */
+.dhx_cal_light .combo {
+ padding: 4px;
+}
+.dhx_cal_light_wide .dhx_combo_box/*, .dhx_cal_light_wide .combo*/ {
+ width: 608px !important;
+ left: 10px;
+}
+/* Lightbox dhtmlx combo section end */
+
+/* Agenda week start */
+.dhx_wa_column {
+ float: left;
+}
+.dhx_wa_column_last .dhx_wa_day_cont{
+ border-left: 1px dotted #8894A3;
+}
+.dhx_wa_scale_bar {
+ font-family: Tahoma;
+ padding-left: 10px;
+ font-size: 11px;
+ border-top: 1px dotted #8894A3;
+ border-bottom: 1px dotted #8894A3;
+}
+.dhx_wa_day_data {
+ background-color: #FCFEFC;
+ overflow-y: auto;
+}
+.dhx_wa_ev_body {
+ border-bottom: 1px dotted #778899;
+ font-size: 12px;
+ padding: 5px 0 5px 7px;
+}
+.dhx_wa_dnd {
+ font-family: Tahoma;
+ position: absolute;
+ padding-right: 7px;
+ color: #887AE2 !important;
+ background-color: #FFE763 !important;
+ border: 1px solid #B7A543;
+}
+.dhx_cal_event_selected{
+ background-color: #9cc1db;
+ color: white;
+}
+/* Agenda week end */
+
+/* timeline second scale start */
+.dhx_second_scale_bar {
+ border-bottom: 1px dotted #586A7E;
+ padding-top: 2px;
+}
+/* timeline second scale end */
+
+
+/* grid view */
+
+.dhx_cal_header div div{
+ border-left: 1px dotted #8894A3;
+}
+
+.dhx_grid_area{
+ width:100%;
+ height:100%;
+ overflow-y:auto;
+ background-color:#FCFEFC;
+}
+.dhx_grid_area table{
+ border-collapse: collapse;
+ border-spacing: 0;
+ width:100%;
+ table-layout:fixed;
+}
+.dhx_grid_area td{
+ table-layout:fixed;
+ text-align:center;
+}
+
+.dhx_grid_line{
+ height:21px;
+ clear:both;
+ overflow:hidden;
+}
+.dhx_grid_line div{
+ float:left;
+ cursor:default;
+ padding-top: 0;
+ padding-bottom: 0;
+ text-align:center;
+ line-height:21px;
+ overflow:hidden;
+}
+
+.dhx_grid_area td, .dhx_grid_line div{
+ padding-left:8px;
+ padding-right:8px;
+}
+
+
+.dhx_grid_area tr.dhx_grid_event{
+ height:21px;
+ overflow:hidden;
+ margin:0 0 1px 0;
+}
+.dhx_grid_area tr.dhx_grid_event td{
+ /*borders for old ies*/
+ border-bottom:1px solid #ECEEF4;
+}
+.dhx_grid_area tr.dhx_grid_event:nth-child(2n+1) td, .dhx_grid_area tr.dhx_grid_event:nth-child(2n) td{
+ border-bottom-width:0px;
+ border-bottom-style:none;
+}
+.dhx_grid_area tr.dhx_grid_event:nth-child(2n){
+ background-color:#ECEEF4;;
+}
+.dhx_grid_area .dhx_grid_dummy{
+ table-layout:auto;
+ margin:0 !important;
+ padding:0 !important;
+}
+
+.dhx_grid_v_border{
+ position:absolute;
+ border-right:1px solid #A4BED4;
+ width:1px;
+ height:100%;
+}
+
+.dhx_grid_event_selected{
+ background-color: #9cc1db !important;
+ color: white !important;
+}
+
+.dhx_grid_sort_desc .dhx_grid_view_sort{
+ background-position: 0 -55px;
+}
+.dhx_grid_sort_asc .dhx_grid_view_sort{
+ background-position: 0 -66px;
+}
+.dhx_grid_view_sort{
+ width:10px;
+ height:10px;
+ position: absolute;
+ border:none !important;
+ top: 5px;
+ background-repeat:no-repeat;
+ background-image: url(./imgs/images.png);
+}
+/* end grid */
+
+/* marked timespans */
+.dhx_marked_timespan {
+ position: absolute;
+ width: 100%;
+}
+.dhx_time_block {
+ position:absolute;
+ width:100%;
+ background:silver;
+ opacity:0.4;
+ filter:alpha(opacity=40);
+ z-index:1;
+}
+.dhx_time_block_reset {
+ opacity: 1;
+ filter:alpha(opacity=100);
+}
+.dhx_scheduler_month .dhx_marked_timespan {
+ display: none;
+}
+.dhx_mini_calendar .dhx_marked_timespan {
+ display: none;
+}
+/* now time */
+.dhx_now_time {
+ width:100%;
+ border-bottom:2px dotted red;
+ z-index: 1;
+}
+.dhx_scheduler_month .dhx_now_time {
+ border-bottom: 0;
+ border-left: 2px dotted red;
+}
+.dhx_matrix_now_time {
+ border-left:2px dotted red;
+ z-index: 1;
+}
+
+ +/*IE*/
+div.dhx_form_repeat input.radio { margin:-4px 0 0 -4px !ie; }
+div.dhx_form_repeat input.checkbox { margin:0 0 0 -4px !ie; }
+
+/*All*/
+.dhx_form_repeat, .dhx_form_repeat input {
+ padding:0;
+ margin:0;
+ padding-left:5px;
+ font-family:Tahoma, Verdana;
+ font-size:11px;
+ line-height:24px;
+}
+
+.dhx_form_repeat {
+ overflow:hidden;
+ /*height:115px;*/
+ height:0px;
+ background-color: #FFF4B5;
+ /*border: 1px solid #DCC43E;*/
+}
+
+.dhx_cal_light_wide .dhx_form_repeat {
+ background-color: transparent;
+}
+
+
+.dhx_repeat_center, .dhx_repeat_left{
+ height:115px;
+ padding:10px 0 10px 10px;
+ float:left;
+}
+
+.dhx_repeat_left{
+ width:95px;
+}
+
+.dhx_repeat_center{
+ width:335px;
+ margin-top:12px;
+}
+
+.dhx_repeat_divider{
+ float:left;
+ height:115px;
+ border-left:1px dotted #DCC43E;
+ /*background-color: #DCC43E;*/
+ width:1px;
+}
+
+.dhx_repeat_right {
+ float:right;
+ height:115px;
+ width:160px;
+ padding:10px 3px 10px 10px;
+ margin-top:7px;
+}
+
+input.dhx_repeat_text {
+ height:16px;
+ width: 27px;
+ margin: 0 4px 0 4px;
+ line-height:18px;
+ padding: 0 0 0 2px;
+}
+
+.dhx_form_repeat select {
+ height: 20px;
+ width: 87px;
+ padding:0 0 0 2px;
+ margin: 0 4px 0 4px;
+}
+
+input.dhx_repeat_date{
+ height: 18px;
+ width: 80px;
+ padding:0 0 0 2px;
+ margin: 0 4px 0 4px;
+ background-repeat:no-repeat;
+ background-position:64px 0;
+ border:1px #7f9db9 solid;
+ line-height:18px;
+}
+
+input.dhx_repeat_radio {
+ margin-right:4px;
+}
+
+input.dhx_repeat_checkbox {
+ margin:4px 4px 0 0;
+}
+
+.dhx_repeat_days td {
+ padding-right:5px;
+}
+.dhx_repeat_days label {
+ font-size:10px;
+}
+.dhx_custom_button{
+ width:90px;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ -ms-border-radius: 4px;
+ -o-border-radius: 4px;
+ border-radius: 4px;
+}
+.dhx_custom_button_recurring{
+ background-image:url(./imgs/but_repeat.gif);
+ background-position:-5px 20px;
+ width:20px;
+ margin-right:10px;
+}
+
+/* increase width of lightbox */
+.dhx_cal_light_rec{
+ width:640px;
+}
+.dhx_cal_light_rec .dhx_cal_larea{
+ width:632px;
+}
+.dhx_cal_light_rec.dhx_cal_light_wide{
+ width:816px;
+}
+.dhx_cal_light_rec.dhx_cal_light_wide .dhx_cal_larea{
+ width:808px;
+} +/* event start */
+.dhx_cal_event .dhx_title {
+ border-width: 1px 1px 0 1px;
+ padding-top: 1px;
+ -webkit-border-top-left-radius: 4px;
+ -webkit-border-top-right-radius: 4px;
+ -moz-border-radius-topleft: 4px;
+ -moz-border-radius-topright: 4px;
+ border-top-left-radius: 4px;
+ border-top-right-radius: 4px;
+
+ font-family: arial;
+ font-weight: bold;
+ font-size: 12px;
+}
+
+.dhx_cal_event .dhx_body, .dhx_cal_event.dhx_cal_select_menu .dhx_body {
+ padding-bottom: 8px;
+ -webkit-border-bottom-right-radius: 4px;
+ -webkit-border-bottom-left-radius: 4px;
+ -moz-border-radius-bottomright: 4px;
+ -moz-border-radius-bottomleft: 4px;
+ border-bottom-right-radius: 4px;
+ border-bottom-left-radius: 4px;
+
+}
+
+.dhx_cal_event .dhx_header, .dhx_cal_event.dhx_cal_select_menu .dhx_footer {
+ display: none;
+}
+
+.dhx_cal_event .dhx_footer {
+ height: 5px;
+ border: 0;
+ margin-top: -6px;
+ background: url(imgs_dhx_terrace/resizing.png) no-repeat center center;
+}
+
+.dhx_cal_event .dhx_header, .dhx_cal_event .dhx_footer, .dhx_cal_event .dhx_body, .dhx_cal_event .dhx_title {
+ background-color: #1796b0;
+ border-color: transparent;
+ color: white;
+}
+
+div.dhx_cal_editor {
+ border: 1px solid transparent;
+ background-color: #1796b0;
+}
+
+.dhx_cal_editor {
+ font-size: 12px;
+ font-family: Arial, sans-serif;
+}
+
+div.dhx_menu_head, div.dhx_menu_icon {
+ background-image: url(imgs_dhx_terrace/controls.png);
+}
+
+.dhx_cal_event_line {
+ border: 1px solid #1796b0;
+ background-color: #1796b0;
+ color: white;
+ height: 17px;
+ line-height: 17px;
+ -webkit-border-radius: 2px;
+ -moz-border-radius: 2px;
+ border-radius: 2px;
+}
+.dhx_cal_event_line_start {
+ -webkit-border-top-left-radius: 9px;
+ -webkit-border-bottom-left-radius: 9px;
+ -moz-border-radius-topleft: 9px;
+ -moz-border-radius-bottomleft: 9px;
+ border-top-left-radius: 9px;
+ border-bottom-left-radius: 9px;
+}
+.dhx_cal_event_line_end {
+ -webkit-border-top-right-radius: 9px;
+ -webkit-border-bottom-right-radius: 9px;
+ -moz-border-radius-topright: 9px;
+ -moz-border-radius-bottomright: 9px;
+ border-top-right-radius: 9px;
+ border-bottom-right-radius: 9px;
+}
+
+.dhx_cal_event .dhx_body, .dhx_cal_event_line {
+ font-size: 12px;
+ font-family: Arial, sans-serif;
+}
+
+/* event end */
+
+/* scales, containers start */
+.dhx_cal_container {
+ background-color: white;
+}
+
+.dhx_cal_data {
+ border-top: 1px solid #CECECE;
+}
+.dhx_scale_holder {
+ background-image: url(imgs_dhx_terrace/databg.png);
+ border-right: 1px solid #CECECE;
+}
+
+.dhx_scale_holder_now {
+ background-image: url(imgs_dhx_terrace/databg_now.png);
+ border-right: 1px solid #CECECE;
+}
+
+.dhx_scale_hour {
+ border-bottom: 1px solid #CECECE;
+ background-color: white;
+ font: 11px/44px Arial;
+ color: #767676;
+}
+
+.dhx_cal_header {
+ border: 1px solid #CECECE;
+ border-left: 0;
+ border-bottom: 0;
+}
+.dhx_scale_bar {
+ border-left: 1px solid #CECECE;
+}
+
+.dhx_scale_bar {
+ font: 11px/16px Arial;
+ color: #767676;
+ padding-top: 2px;
+ background-color: white;
+}
+
+/* scales, containers end */
+
+/* navigation start */
+.dhx_cal_navline div {
+ top: 14px;
+}
+.dhx_cal_tab, .dhx_cal_date, .dhx_cal_today_button, .dhx_cal_prev_button, .dhx_cal_next_button {
+ color: #454544;
+ height: 30px;
+ line-height: 30px;
+ background: none;
+ border: 1px solid #CECECE;
+}
+
+.dhx_cal_navline .dhx_cal_date {
+ border: 0;
+ font-size: 18px;
+ font-weight: normal;
+ font-family: arial;
+ width: 100%;
+ top: 14px;
+ text-align: center;
+ position: absolute;
+ left: 0;
+ z-index: -1;
+}
+.dhx_cal_today_button {
+ color: #747473;
+ left: auto;
+ right: 123px;
+ background: none;
+ text-decoration: none;
+
+ width: 80px;
+ font-size: 12px;
+ font-weight: bold;
+ font-family: arial;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ border-radius: 5px;
+}
+.dhx_cal_prev_button, .dhx_cal_next_button {
+ left: auto;
+ width: 46px;
+}
+.dhx_cal_prev_button {
+ right: 61px;
+ background: url(imgs_dhx_terrace/arrow_left.png) no-repeat center center;
+ -webkit-border-top-left-radius:5px;
+ -webkit-border-bottom-left-radius:5px;
+ -moz-border-radius-topleft:5px;
+ -moz-border-radius-bottomleft:5px;
+ border-top-left-radius:5px;
+ border-bottom-left-radius:5px;
+}
+.dhx_cal_next_button {
+ right: 14px;
+ background: url(imgs_dhx_terrace/arrow_right.png) no-repeat center center;
+ -webkit-border-top-right-radius:5px;
+ -webkit-border-bottom-right-radius:5px;
+ -moz-border-radius-topright:5px;
+ -moz-border-radius-bottomright:5px;
+ border-top-right-radius:5px;
+ border-bottom-right-radius:5px;
+}
+.dhx_cal_tab {
+ color: #747473;
+ width: 60px;
+ padding-top: 0;
+ text-decoration: none;
+ -webkit-border-radius: 0px;
+ -moz-border-radius: 0px;
+ border-radius: 0px;
+ font-weight: bold;
+ font-family: arial;
+ font-size: 12px;
+}
+.dhx_cal_tab.active {
+ background-color: #F0EDE7;
+ color: #454544;
+ border: 1px solid #CECECE;
+ text-shadow: 0px 1px 0px white;
+}
+.dhx_cal_tab_first {
+ -webkit-border-top-left-radius:5px;
+ -webkit-border-bottom-left-radius:5px;
+ -moz-border-radius-topleft:5px;
+ -moz-border-radius-bottomleft:5px;
+ border-top-left-radius:5px;
+ border-bottom-left-radius:5px;
+}
+.dhx_cal_tab_last {
+ -webkit-border-top-right-radius:5px;
+ -webkit-border-bottom-right-radius:5px;
+ -moz-border-radius-topright:5px;
+ -moz-border-radius-bottomright:5px;
+ border-top-right-radius:5px;
+ border-bottom-right-radius:5px;
+}
+.dhx_cal_tab_standalone {
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ border-radius: 5px;
+ padding: 0 5px;
+}
+.dhx_multi_day, .dhx_multi_day_icon_small, .dhx_multi_day_icon {
+ background-color: white;
+}
+.dhx_multi_day {
+ border-top: 1px solid #CECECE;
+}
+.dhx_multi_day_icon, .dhx_multi_day_icon_small {
+ border-bottom: 1px solid #CECECE;
+ border-right: 1px solid #CECECE;
+}
+.dhx_multi_day_icon_small {
+ background-image: url(imgs_dhx_terrace/clock_small.gif);
+}
+.dhx_multi_day_icon {
+ background-image: url(imgs_dhx_terrace/clock_big.gif);
+}
+/* navigation end */
+
+/* month view start */
+.dhx_month_head, .dhx_after .dhx_month_head, .dhx_before .dhx_month_head, .dhx_after .dhx_month_body,
+.dhx_before .dhx_month_body {
+ background-color: white;
+}
+
+.dhx_month_head {
+ height: 21px;
+ padding-top: 0;
+ font: 12px/21px Arial;
+ color: #362d26;
+ border-right: 1px solid #CECECE;
+}
+
+.dhx_after .dhx_month_head, .dhx_before .dhx_month_head, .dhx_after .dhx_month_head, .dhx_before .dhx_month_head {
+ color: #bbbbbb;
+}
+
+.dhx_month_body {
+ border-right: 1px solid #CECECE;
+ border-bottom: 1px solid #CECECE;
+}
+.dhx_now .dhx_month_head, .dhx_now .dhx_month_body {
+ background-color: #FFF3A1;
+ font-weight: normal;
+}
+.dhx_cal_event_clear {
+ color: #0E64A0;
+}
+/* month view end */
+
+
+/* lightbox start */
+.dhx_cal_larea {
+ margin-left: 0;
+}
+.dhx_cal_light_wide .dhx_cal_larea {
+ margin-left: 3px;
+}
+.dhx_cal_light_wide .dhx_wrap_section {
+ padding: 5px 0;
+}
+.dhx_cal_light, .dhx_cal_larea, .dhx_cal_lsection, .dhx_wrap_section, .dhx_cal_light_wide .dhx_wrap_section, .dhx_cal_ltext textarea {
+ background-color: white;
+}
+.dhx_cal_lsection, .dhx_cal_light_wide .dhx_cal_lsection .dhx_fullday, .dhx_cal_lsection .dhx_fullday, .dhx_cal_light input {
+ color: #747473;
+}
+.dhx_cal_light_wide .dhx_wrap_section {
+ border-top: 0;
+ border-bottom: 1px solid #CECECE;
+}
+.dhx_cal_larea {
+ border: 1px solid transparent;
+}
+.dhx_cal_ltext textarea, .dhx_cal_light select, .dhx_cal_light {
+ color: #2E2E2E;
+}
+.dhx_cal_light {
+ border: 1px solid #CECECE;
+}
+.dhx_cal_light_wide .dhx_cal_lsection, .dhx_cal_light_wide .dhx_cal_lsection .dhx_fullday {
+ font-size: 13px;
+}
+.dhx_section_time {
+ background-color: transparent;
+}
+.dhx_save_btn, .dhx_cancel_btn, .dhx_delete_btn {
+ display: none;
+}
+.dhx_btn_set, .dhx_btn_set div {
+ height: 30px;
+ padding: 0 20px;
+ line-height: 30px;
+}
+.dhx_btn_set {
+ margin: 12px 0 0 0;
+ padding: 0;
+ font-size: 12px;
+ color: #454544;
+ font-weight: bold;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+}
+.dhx_left_btn_set {
+ margin-left: 20px
+}
+.dhx_right_btn_set {
+ margin-right: 20px;
+}
+.dhx_save_btn_set {
+ border: 1px solid #22A1BC;
+ color: white;
+ text-shadow:0px -1px 0px #6F6F6F;
+ background-color: #22A1BC;
+}
+.dhx_cancel_btn_set {
+ border: 1px solid #CECECE;
+}
+.dhx_delete_btn_set {
+ border: 1px solid #FF8831;
+ background-color: #FF8831;
+ color: white;
+ text-shadow:0px -1px 0px #93755F;
+}
+.dhx_cal_ltitle {
+ height: 30px;
+ line-height: 30px;
+ border-bottom: 1px solid #CECECE;
+}
+.dhx_mark {
+ display: none;
+}
+.dhx_time {
+ padding-left: 10px;
+}
+.dhx_close_icon {
+ float: right;
+ width: 9px;
+ height: 9px;
+ background: url(imgs_dhx_terrace/close_icon.png) no-repeat center center;
+ padding: 10px;
+ margin-top: 1px;
+}
+.dhx_cal_light_wide .dhx_cal_ltext.dhx_cal_template {
+ line-height: 22px;
+}
+.dhx_cal_ltext textarea {
+ line-height: 20px;
+ box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ border: 1px solid #CECECE;
+ background-color: #F9F9F9;
+}
+/* lightbox end */
+
+/* modal box */
+.dhtmlx_modal_box {
+ background: white;
+ width: 330px;
+}
+.dhtmlx_popup_controls {
+ padding-bottom: 9px;
+}
+.dhtmlx_popup_button, .dhtmlx_popup_button:active, .dhtmlx_popup_button div, .dhtmlx_popup_button div:active {
+ color: #444;
+ background: white;
+ box-shadow: none;
+}
+.dhtmlx_popup_button.dhtmlx_ok_button {
+ border: 1px solid #22A1BC;
+ background-color: #22A1BC;
+}
+.dhtmlx_popup_button.dhtmlx_ok_button div {
+ background: #22A1BC;
+ border: 1px solid #22A1BC;
+ color: white;
+ text-shadow:0px -1px 0px #6F6F6F;
+}
+
+/* mobdal box end */
+
+/* minicalendar */
+.dhx_cal_container.dhx_mini_calendar {
+ box-sizing:border-box;
+ border: 1px solid #CECECE;
+ box-shadow:2px 2px 5px #888;
+}
+.dhx_mini_calendar .dhx_year_month {
+ border: 1px solid #CECECE;
+ font-family: Arial;
+}
+.dhx_mini_calendar .dhx_month_head, .dhx_mini_calendar .dhx_year_month, .dhx_mini_calendar .dhx_month_body,
+.dhx_mini_calendar .dhx_scale_bar, .dhx_mini_calendar .dhx_year_body{
+ border-color: transparent;
+}
+.dhx_mini_calendar .dhx_year_body{
+ padding-top:1px;
+}
+.dhx_mini_calendar .dhx_scale_bar {
+ border-width: 0;
+}
+.dhx_mini_calendar .dhx_year_week {
+ border-bottom: 1px solid #CECECE;
+ padding-top: 1px;
+}
+.dhx_mini_calendar .dhx_month_head {
+ padding-right: 0;
+ margin-right:1px;
+ text-align: center;
+}
+.dhx_mini_calendar .dhx_cal_prev_button, .dhx_mini_calendar .dhx_cal_next_button {
+ border: 0;
+ height: 20px;
+}
+/* minicalendar end */
+
+.dhx_cal_navline div.dhx_minical_icon{
+ left:210px;
+ top:14px;
+ width:30px; height:30px;
+ background: url(./imgs_dhx_terrace/calendar.gif) no-repeat;
+ background-position: 3px 5px;
+}
+
+/* timeline */
+.dhx_cal_event_line .dhx_event_resize {
+ background: url(./imgs_dhx_terrace/resize_dots.png) repeat-y;
+}
+.dhx_matrix_scell, .dhx_matrix_cell {
+ border-bottom: 1px solid #CECECE;
+ border-right: 1px solid #CECECE;
+}
+.dhx_cal_header div div {
+ border-left: 1px solid #CECECE;
+}
+.dhx_matrix_scell.folder {
+ border-right: 0;
+}
+.dhx_second_scale_bar {
+ border-bottom: 1px solid #CECECE;
+}
+
+/* timeline end */
+
+/* recurring */
+.dhx_repeat_divider {
+ border-left: 1px solid #CECECE;
+}
+.dhx_custom_button {
+ background-color: white;
+ border: 1px solid #CECECE;
+ color: #747473;
+}
+.dhx_cal_light_wide .dhx_custom_button {
+ margin-top: 6px;
+}
+.dhx_custom_button_recurring {
+ background-image: url(./imgs_dhx_terrace/but_repeat.gif);
+}
+/* recurring end */
+
+/* agenda */
+.dhx_v_border, .dhx_agenda_line div {
+ border-right: 1px solid #CECECE;
+}
+/* agenda end */
+
+/* year */
+.dhx_year_month {
+ border: 1px solid #CECECE;
+}
+.dhx_scale_bar_last {
+ border-right: 1px solid #CECECE;
+}
+.dhx_year_body {
+ border-left: 1px solid #CECECE;
+}
+/* year end */
+
+/* expand */
+.dhx_expand_icon {
+ top: -3px;
+}
+/* expand end */
+
+/* units view */
+.dhx_scale_bar .dhx_cal_next_button, .dhx_scale_bar .dhx_cal_prev_button {
+ width: 20px;
+ height: 20px;
+ top: 0px !important;
+ border: 0;
+}
+.dhx_scale_bar .dhx_cal_next_button {
+ right: 1px !important;
+ border-left: 1px solid #CECECE;
+}
+.dhx_scale_bar .dhx_cal_prev_button {
+ left: 1px !important;
+ border-right: 1px solid #CECECE;
+}
+/* units view end */
+
+/* map view */
+.dhx_map_line .headline_date, .dhx_map_line .headline_description {
+ border: 0;
+}
+.dhx_map_line .headline_date {
+ border-right: 1px solid #CECECE;
+}
+/* map view end */
+
+/* tooltip start */
+.dhtmlXTooltip.tooltip {
+ border-left: 1px solid #CECECE;
+ border-top: 1px solid #CECECE;
+ color: #747473;
+ font-size: 12px;
+ line-height: 16px;
+}
+/* tooltip end */
+
+/* week agenda start */
+.dhx_wa_scale_bar {
+ border-top: 1px solid #CECECE;
+ border-bottom: 1px solid #CECECE;
+}
+.dhx_wa_column_last .dhx_wa_day_cont {
+ border-left: 1px solid #CECECE;
+}
+.dhx_wa_ev_body {
+ border-bottom: 1px solid #CECECE;
+}
+.dhx_wa_scale_bar {
+ background-color: #f0ede7;
+}
+.dhx_wa_ev_body.dhx_cal_event_selected {
+ background-color: #fff3a1;
+ color: #362d26;
+}
+.dhx_wa_dnd {
+ background-color: #fddb93 !important;
+ color: #747473 !important;
+ border: 1px solid #ccb177;
+}
+/* week agenda end */
+
+/* readonly start */
+.dhx_text_disabled {
+ color: #2E2E2E;
+}
+.dhx_cal_ltext .dhx_text_disabled {
+ line-height: 22px;
+}
+/* readonly end */
+
+
+/* grid view start */
+.dhx_grid_v_border{
+ border-right-color:#CECECE;
+}
+/* grid view end*/
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/dhtmlxscheduler_glossy.css b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/dhtmlxscheduler_glossy.css new file mode 100644 index 00000000000..0bbb47053ed --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/dhtmlxscheduler_glossy.css @@ -0,0 +1,1715 @@ +/* +This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in non-GPL project. Please contact sales@dhtmlx.com for details +*/ + +.dhtmlx_message_area{
+ position:fixed;
+ right:5px;
+ width:250px;
+ z-index:1000;
+}
+
+.dhtmlx-info{
+ min-width: 120px;
+ padding:4px 4px 4px 20px;
+ font-family:Tahoma;
+ z-index: 10000;
+
+ margin:5px;
+ margin-bottom:10px;
+
+ -webkit-transition: all .5s ease;
+ -moz-transition: all .5s ease;
+ -o-transition: all .5s ease;
+ transition: all .5s ease;
+}
+.dhtmlx-info.hidden{
+ height:0px;
+ padding:0px;
+ border-width:0px;
+ margin:0px;
+ overflow:hidden;
+}
+
+.dhtmlx_modal_box{
+ overflow:hidden;
+ display: inline-block;
+ min-width: 300px;
+ width: 300px;
+ text-align: center;
+ position:fixed;
+
+ background-color: #fff;
+ background:-webkit-linear-gradient(top, #ffffff 1%, #d0d0d0 99%);
+ background:-moz-linear-gradient(top, #ffffff 1%, #d0d0d0 99%);
+ box-shadow: 0px 0px 14px #888;
+
+ font-family: Tahoma;
+
+ z-index:20000;
+
+ border-radius:6px;
+ border: 1px solid #ffffff;
+}
+
+.dhtmlx_popup_title{
+ border-top-left-radius:5px;
+ border-top-right-radius:5px;
+
+ border-width:0px;
+
+ background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAoCAMAAAAIaGBFAAAAhFBMVEVwcHBubm5sbGxqampoaGhmZmZlZWVjY2NhYWFfX19dXV1bW1taWlpYWFhWVlZUVFRSUlJRUVFPT09NTU1LS0tJSUlHR0dGRkZERERCQkJAQEA+Pj49PT09PT0+Pj5AQEBBQUFDQ0NERERGRkZHR0dJSUlKSkpMTExMTEw5OTk5OTk5OTkny8YEAAAAQklEQVQImQXBCRJCAAAAwKVSQqdyjSPXNP7/QLsIhA6OTiJnF7GrRCpzc/fw9PKW+/gqlCq1RqvTG/yMJrPF6m/bAVEhAxxnHG0oAAAAAElFTkSuQmCC);
+ background-image: -webkit-linear-gradient(top, #707070 1%, #3d3d3d 70%, #4c4c4c 97%, #393939 97%);
+ background-image: -moz-linear-gradient(top, #707070 1%, #3d3d3d 70%, #4c4c4c 97%, #393939 97%);
+}
+
+.dhtmlx-info, .dhtmlx_popup_button, .dhtmlx_button{
+ user-select: none;
+ -webkit-user-select: none;
+ -moz-user-select:-moz-none;
+
+ cursor:pointer;
+}
+
+.dhtmlx_popup_text{
+ overflow:hidden;
+}
+
+.dhtmlx_popup_controls{
+ border-radius:6px;
+ padding:5px;
+}
+
+.dhtmlx_popup_button, .dhtmlx_button{
+ height: 30px;
+ line-height:30px;
+
+ display: inline-block;
+ margin: 0 5px;
+ border-radius: 6px;
+
+ color:#FFF;
+}
+.dhtmlx_popup_button{
+ min-width: 120px;
+}
+
+div.dhx_modal_cover {
+ background-color:#000;
+ cursor:default;
+
+ filter:alpha(opacity = 20);
+ opacity: 0.2;
+
+ position: fixed;
+ z-index:19999;
+ left: 0px; top: 0px;
+ width: 100%; height: 100%;
+
+ border: none;
+ zoom: 1;
+}
+
+.dhtmlx-info img, .dhtmlx_modal_box img{
+ float:left;
+ margin-right:20px;
+}
+
+.dhtmlx-alert-error .dhtmlx_popup_title, .dhtmlx-confirm-error .dhtmlx_popup_title{
+ background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAsCAIAAAArRUU2AAAATklEQVR4nIWLuw2AMBBDjVuQiBT2oWbRDATrnB0KQOJoqPzRe3BrHI6dcBASYREKovtK6/6DsDOX+stN+3H1YX9ciRgnYq5EWYhS2dftBIuLT4JyIrPCAAAAAElFTkSuQmCC);
+}
+.dhtmlx-alert-error, .dhtmlx-confirm-error {
+ border: 1px solid #ff0000;
+}
+
+/*Skin section*/
+.dhtmlx_button, .dhtmlx_popup_button{
+ box-shadow: 0px 0px 4px #888;
+ border:1px solid #838383;
+}
+.dhtmlx_button input, .dhtmlx_popup_button div{
+ border:1px solid #FFF;
+ background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAeCAMAAADaS4T1AAAAYFBMVEVwcHBtbW1ra2toaGhmZmZjY2NhYWFeXl5cXFxaWlpXV1dVVVVSUlJQUFBNTU1LS0tJSUlGRkZERERBQUE/Pz88PDw9PT0+Pj5AQEBCQkJDQ0NFRUVHR0dISEhKSkpMTEzqthaMAAAAMklEQVQImQXBhQ2AMAAAsOIMlwWH/8+kRSKVyRVKlVrQaHV6g9FktlhFm93hdLk9Xt8PIfgBvdUqyskAAAAASUVORK5CYII=);
+ background-image: -webkit-linear-gradient(top, #707070 1%, #3d3d3d 70%, #4c4c4c 99%);
+ background-image: -moz-linear-gradient(top, #707070 1%, #3d3d3d 70%, #4c4c4c 99%);
+
+ border-radius:6px;
+ font-size:15px;
+ font-weight:normal;
+ -moz-box-sizing:content-box;
+ box-sizing:content-box;
+
+ color:#fff; padding:0px; margin:0px;
+ vertical-align:top;
+
+ height:28px;
+ line-height:28px;
+}
+
+.dhtmlx_button input:focus, .dhtmlx_button input:active, .dhtmlx_popup_button div:active, .dhtmlx_popup_button div:focus{
+
+ background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAeCAMAAADaS4T1AAAAXVBMVEVwcHBubm5tbW1sbGxra2tpaWloaGhnZ2dmZmZlZWVjY2NiYmJhYWFgYGBfX19dXV1cXFxbW1taWlpZWVlXV1dWVlZVVVVUVFRTU1NRUVFQUFBPT09OTk5NTU1LS0tT9SY0AAAAMUlEQVQImQXBhQGAMAAAIGxnx2z9/00BiVQmVyhVakGj1ekNRpPZYhVtdofT5fZ4fT8hpwG05JjexgAAAABJRU5ErkJggg==);
+ background-image: -webkit-linear-gradient(top, #707070 1%, #4c4c4c 99%);
+ background-image: -moz-linear-gradient(top, #707070 1%, #4c4c4c 99%);
+}
+.dhtmlx_popup_title{
+ color:#fff;
+ text-shadow: 1px 1px #000;
+ height:40px; line-height:40px;
+ font-size:20px;
+}
+.dhtmlx_popup_text{
+ margin:15px 15px 5px 15px;
+ font-size:14px;
+ color:#000;
+ min-height:30px;
+ border-radius:6px;
+}
+
+
+.dhtmlx-info, .dhtmlx-error{
+ font-size:14px;
+ color:#000;
+ box-shadow: 0px 0px 10px #888;
+
+ padding:0px;
+
+ background-color:#FFF;
+ border-radius:3px;
+ border:1px solid #ffffff;
+}
+.dhtmlx-info div{
+ padding:5px 10px 5px 10px;
+ background-color: #fff;
+
+ border-radius:3px;
+ border:1px solid #B8B8B8;
+}
+.dhtmlx-error{
+ background-color: #d81b1b;
+ border:1px solid #ff3c3c;
+ box-shadow: 0px 0px 10px #000;
+}
+.dhtmlx-error div{
+ background-color: #d81b1b;
+ border:1px solid #940000;
+ color:#FFF;
+}
+
+ +.dhx_cal_container{
+ background-color:#C2D5FC;
+ font-family:Tahoma;
+ font-size:8pt;
+ position:relative;
+ overflow:hidden;
+}
+.dhx_cal_container div{
+ -moz-user-select:none;
+ -moz-user-select:-moz-none;
+}
+.dhx_cal_navline{
+ height:20px;
+ position:absolute;
+ z-index:3;
+ width:750px;
+ color:#2F3A48;
+}
+.dhx_cal_navline div{
+ position:absolute;
+ top:2px;
+ white-space:nowrap;
+}
+.dhx_cal_navline .dhx_cal_date {
+ font-weight:600;
+ left:210px;
+ padding-top: 1px;
+}
+.dhx_cal_button .dhx_left_bg{
+ width:1px; overflow:hidden;
+ height:17px;
+ z-index:20;
+ top:0px;
+}
+.dhx_cal_prev_button{
+ background-image:url(imgs/buttons.png);
+ background-position:0px 0px;
+ width:29px; height:17px;
+ left:50px; cursor:pointer;
+}
+.dhx_cal_next_button{
+ background-image:url(imgs/buttons.png);
+ background-position: -30px 0px;
+ width:29px; height:17px;
+ left:80px; cursor:pointer;
+}
+.dhx_cal_today_button{
+ background-image:url(imgs/buttons.png);
+ background-position: -60px 0px;
+ width:75px; height:17px;
+ left:112px; cursor:pointer;
+ text-align:center;
+ text-decoration:underline;
+}
+.dhx_cal_tab{
+ width:59px; height:19px;
+ text-align:center;
+ text-decoration:underline;
+ padding-top:2px;
+ cursor:pointer;
+ background-color: #D8E1EA;
+
+ -webkit-border-top-left-radius: 4px;
+ -webkit-border-top-right-radius: 4px;
+ -moz-border-radius-topleft: 4px;
+ -moz-border-radius-topright: 4px;
+ border-top-left-radius: 4px;
+ border-top-right-radius: 4px;
+}
+.dhx_cal_tab.active{
+ text-decoration:none;
+
+ cursor:default;
+ font-weight:bold;
+ border: 1px dotted #586A7E;
+ border-bottom: 0;
+ background-color: #C2D5FC;
+}
+.dhx_cal_header{
+ position:absolute;
+ left:10px; top:23px;
+ width:750px;
+ border-top:1px dotted #8894A3;
+ border-right:1px dotted #8894A3;
+ z-index:2;
+ overflow:hidden;
+ color:#2F3A48;
+}
+.dhx_cal_data{
+ border-top:1px dotted #8894A3;
+ position:absolute;
+ top:44px;
+ width:600px;
+ overflow-y:auto;
+ overflow-x:hidden;
+}
+.dhx_scale_bar{
+ position:absolute;
+ text-align:center;
+ background-color:#C2D5FC;
+ padding-top:3px;
+ border-left:1px dotted #586A7E;
+}
+.dhx_scale_holder{
+ position:absolute;
+ border-right:1px dotted #586A7E;
+ background-image:url(imgs/databg.png);
+}
+.dhx_scale_holder_now{
+ position:absolute;
+ border-right:1px dotted #586A7E;
+ background-image:url(imgs/databg_now.png);
+}
+.dhx_scale_hour{
+ height:41px;
+ width:50px;
+ border-bottom:1px dotted #8894A3;
+ background-color:#C2D5FC;
+ text-align:center;
+ line-height:40px;
+ color:#586A7E;
+ overflow:hidden;
+}
+.dhx_month_head{
+ background-color:#EBEFF4;
+ color:#2F3A48;
+ border-right:1px dotted #586A7E;
+ height:18px;
+ padding-right:5px;
+ padding-top:3px;
+ text-align:right;
+}
+.dhx_month_body{
+ border-right:1px dotted #586A7E;
+ border-bottom:1px dotted #586A7E;
+ background-color:#FFFFFF;
+}
+.dhx_now .dhx_month_body{
+ background-color:#E2EDFF;
+}
+.dhx_after .dhx_month_body, .dhx_before .dhx_month_body{
+ background-color:#ECECEC;
+}
+.dhx_after .dhx_month_head, .dhx_before .dhx_month_head{
+ background-color:#E2E3E6;
+ color:#94A6BB;
+}
+.dhx_now .dhx_month_head{
+ background-color:#D1DEF4;
+ font-weight:bold;
+}
+.dhx_cal_drag{
+ position:absolute;
+ z-index:9999;
+ background-color:#FFE763;
+ border:1px solid #B7A543;
+ opacity:0.5;
+ filter:alpha(opacity=50);
+}
+.dhx_loading{
+ position:absolute;
+ width:128px;
+ height:15px;
+ background-image:url(imgs/loading.gif);
+ z-index:9999;
+}
+.dhx_multi_day_icon, .dhx_multi_day{
+ background-color:#E1E6FF;
+ background-repeat:no-repeat;
+ border-right:1px dotted #8894A3;
+}
+.dhx_multi_day{
+ position: absolute;
+ border-top:1px dotted #8894A3;
+}
+.dhx_multi_day_icon, .dhx_multi_day_icon_small{
+ background-position: center center;
+ background-color:#E1E6FF;
+ background-repeat:no-repeat;
+ border-bottom:1px dotted #8894A3;
+ border-right:1px dotted #8894A3;
+}
+.dhx_multi_day_icon{
+ background-image:url(imgs/clock_big.gif);
+}
+.dhx_multi_day_icon_small{
+ background-image:url(imgs/clock_small.gif);
+
+}
+.dhtmlxLayoutPolyContainer_dhx_skyblue .dhx_cal_container {
+ background-color: #d0e5ff;
+} +.dhx_cal_event .dhx_header, .dhx_cal_event .dhx_title, .dhx_cal_event .dhx_body, .dhx_cal_event .dhx_footer {
+ background-color:#FFE763;
+ border:1px solid #B7A543;
+ color:#887A2E;
+ overflow:hidden;
+ width:100%;
+
+ font-family:Tahoma;
+ font-size:8pt;
+}
+.dhx_move_denied .dhx_cal_event .dhx_header, .dhx_move_denied .dhx_cal_event .dhx_title{
+ cursor:default;
+}
+.dhx_cal_event .dhx_header{
+ height:1px;
+ margin-left:1px;
+ border-width:1px 1px 0px 1px;
+ cursor:pointer;
+}
+.dhx_cal_event .dhx_title {
+ height:12px;
+ border-width:0px 1px 1px 1px;
+ border-bottom-style:dotted;
+
+ font-size:7pt;
+ font-weight:bold;
+ text-align:center;
+
+ background-position:right;
+ background-repeat:no-repeat;
+ cursor:pointer;
+}
+.dhx_cal_event .dhx_body, .dhx_cal_event.dhx_cal_select_menu .dhx_body{
+ border-width:0 1px 1px 1px;
+ padding:5px;
+}
+.dhx_resize_denied {
+ cursor:default !important;
+}
+.dhx_cal_event .dhx_event_resize {
+ cursor:s-resize;
+}
+.dhx_cal_event .dhx_footer, .dhx_cal_event .dhx_select_menu_footer{
+ height:1px;
+ margin-left:2px;
+ border-width:0px 1px 1px 1px;
+}
+.dhx_cal_event_line{
+ background-color:#FFE763;
+ border:1px solid #B7A543;
+ border-radius:3px;
+ font-family:Tahoma;
+ font-size:8pt;
+ height:13px;
+ padding-left:10px;
+ color:#887A2E;
+ cursor:pointer;
+ overflow:hidden;
+}
+.dhx_cal_event_clear{
+ font-family:Tahoma;
+ font-size:8pt;
+ height:13px;
+ padding-left:2px;
+ color:#887A2E;
+ white-space:nowrap;
+ overflow:hidden;
+ cursor:pointer;
+}
+.dhx_in_move{
+ background-color:#FFFF80;
+}
+div.dhx_cal_editor{
+ background-color:#FFE763;
+ border:1px solid #B7A543;
+ border-top-style:dotted;
+ z-index:999;
+ position:absolute;
+ overflow:hidden;
+}
+textarea.dhx_cal_editor{
+ width:100%;
+ height:100%;
+ border:0px solid black;
+ margin:none;
+ padding:none;
+ overflow:auto;
+}
+div.dhx_menu_head{
+ background-image:url(imgs/controls.gif);
+ background-position: 0px -43px;
+ width:10px; height:10px;
+ margin-left:5px; margin-top:1px;
+ border:none;
+ cursor:default;
+}
+div.dhx_menu_icon{
+ background-image:url(imgs/controls.gif);
+ width:20px; height:20px;
+ margin-left:-5px; margin-top:0px;
+ border:none;
+ cursor:pointer;
+}
+div.icon_details{
+ background-position: 0px 0px;
+}
+div.icon_edit{
+ background-position: -22px 0px;
+}
+div.icon_save{
+ background-position: -84px -1px;
+}
+div.icon_cancel{
+ background-position: -62px 0px;
+}
+div.icon_delete{
+ background-position: -42px 0px;
+} +.dhx_unselectable, .dhx_unselectable div{
+ -webkit-user-select:none;
+ -moz-user-select:none;
+ -moz-user-select:-moz-none;
+}
+.dhx_cal_light{
+ background-color:#FFE763;
+ border-radius:5px;
+ font-family:Tahoma;
+ font-size:8pt;
+ border:1px solid #B7A64B;
+ color:#887A2E;
+
+ position:absolute;
+ z-index:10001;
+
+ width:580px;
+ height:300px;
+
+ box-shadow:5px 5px 5px #888;
+}
+.dhx_cal_light_wide{
+ width:650px;
+}
+.dhx_mark{
+ position:relative; top:3px;
+ background-image:url('./imgs/controls.gif');
+ background-position: 0px -43px;
+ padding-left:10px;
+}
+.dhx_ie6 .dhx_mark{
+ background-position: 6px -41px;
+}
+
+.dhx_cal_light select{
+ font-family:Tahoma;
+ font-size:8pt;
+ color:#887A2E;
+ padding:2px;
+ margin:0px;
+}
+.dhx_cal_ltitle{
+ padding:2px 0px 2px 5px;
+ overflow:hidden;
+ white-space:nowrap;
+}
+.dhx_cal_ltitle span{
+ white-space:nowrap;
+}
+.dhx_cal_lsection{
+ background-color:#DBCF8C;
+ color:#FFF4B5;
+ font-weight:bold;
+ padding:5px 0px 3px 10px;
+}
+.dhx_section_time{
+ background-color:#DBCF8C;
+ white-space:nowrap;
+}
+.dhx_cal_lsection .dhx_fullday{
+ float:right;
+ margin-right:5px;
+ color:#887A2E;
+ font-size:12px;
+ font-weight:normal;
+ line-height:20px;
+ vertical-align:top;
+ cursor:pointer;
+}
+.dhx_cal_lsection{
+ font-size:18px;
+ font-family:Arial;
+}
+.dhx_cal_ltext{
+ padding:2px 0px 2px 10px;
+ overflow:hidden;
+}
+.dhx_cal_ltext textarea{
+ background-color: #FFF4B5; /* #FFF4B5; should be the same for dhx_cal_larea, was transperent */
+ overflow:auto;
+ border:none;
+ color:#887A2E;
+ height:100%;
+ width:100%;
+ outline:none !important;
+ resize: none;
+}
+.dhx_time{
+ font-weight:bold;
+}
+.dhx_cal_light .dhx_title{
+ padding-left:10px;
+}
+.dhx_cal_larea{
+ border:1px solid #DCC43E;
+ background-color:#FFF4B5;
+ overflow:hidden;
+
+ margin-left:3px;
+
+ width:572px;
+ height:1px;
+}
+.dhx_btn_set{
+ padding:5px 10px 0px 10px;
+ float:left;
+}
+.dhx_btn_set div{
+ float:left;
+ height:21px;
+ line-height:21px;
+ vertical-align:middle;
+ cursor:pointer;
+}
+.dhx_save_btn{
+ background-image:url('./imgs/controls.gif');
+ background-position:-84px 0px;
+ width:21px;
+
+}
+.dhx_cancel_btn{
+ background-image:url('./imgs/controls.gif');
+ background-position:-63px 0px;
+ width:20px;
+}
+.dhx_delete_btn{
+ background-image:url('./imgs/controls.gif');
+ background-position:-42px 0px;
+ width:20px;
+}
+.dhx_cal_cover{
+ width:100%;
+ height:100%;
+ position:absolute;
+ z-index:10000;
+ top:0px;
+ left:0px;
+ background-color:black;
+
+ opacity:0.1;
+ filter:alpha(opacity=10);
+}
+.dhx_custom_button{
+ padding:0px 3px 0px 3px;
+ color:#887A2E;
+ font-family:Tahoma;
+ font-size:8pt;
+ background-color:#FFE763;
+ font-weight:normal;
+ margin-right:5px;
+ margin-top:0px;
+ cursor:pointer;
+}
+.dhx_custom_button div{
+ cursor:pointer;
+ float:left;
+ height:21px;
+ line-height:21px;
+ vertical-align:middle;
+}
+
+
+.dhx_cal_light_wide .dhx_cal_larea{
+ border-top-width:0px;
+}
+.dhx_cal_light_wide .dhx_cal_lsection{
+ border:0px;
+ float:left;
+ text-align:right;
+ width:100px;
+ height:20px;
+ font-size:16px;
+ padding: 5px 0px 0px 10px;
+}
+.dhx_cal_light_wide .dhx_wrap_section{
+ border-top:1px solid #DBCF8C;
+ position:relative;
+ background-color:#DBCF8C;
+ overflow:hidden;
+}
+.dhx_cal_light_wide .dhx_section_time{
+ padding-top:2px !important;
+ height:20px !important;
+}
+.dhx_section_time{
+ text-align: center;
+}
+.dhx_cal_light_wide .dhx_cal_larea{
+ width:730px;
+}
+.dhx_cal_light_wide{
+ width:738px;
+}
+
+.dhx_cal_light_wide .dhx_section_time{
+ background:transparent;
+}
+.dhx_cal_light_wide .dhx_cal_checkbox label{
+ padding-left:0px;
+}
+.dhx_cal_wide_checkbox input{
+ margin-top:8px;
+ margin-left:14px;
+}
+.dhx_cal_light input{
+ font-family:Tahoma;
+ font-size:8pt;
+ color:#887A2E;
+}
+.dhx_cal_light_wide .dhx_cal_lsection .dhx_fullday{
+ float:none;
+ margin-right:0px;
+ color:#FFF4B5;
+ font-weight:bold;
+ font-size:16px;
+ font-family:Arial;
+ cursor:pointer;
+}
+.dhx_custom_button{
+ float: right;
+ height: 21px;
+ width:90px;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ -ms-border-radius: 4px;
+ -o-border-radius: 4px;
+ border-radius: 4px;
+}
+.dhx_cal_light_wide .dhx_custom_button {
+ position:absolute;
+ top:0;
+ right:0;
+ margin-top: 2px;
+}
+.dhx_cal_light_wide .dhx_repeat_right {
+ margin-right: 55px;
+} +.dhx_minical_popup{
+ position:absolute;z-index:10100;
+ width:251px; height:175px;
+}
+.dhx_scale_bar_header {
+ position: absolute;
+ border-bottom: 1px dotted #8894A3;
+ width: 100%;
+}
+.dhx_expand_icon {
+ position:absolute; top:0px; right:0px;
+ background-image:url(./imgs/collapse_expand_icon.gif);
+ width:18px; height:18px;
+ cursor:pointer;
+ background-position:0px 18px;
+ z-index:16;
+}
+.dhx_scheduler_agenda .dhx_cal_data {
+ background-image:url(./imgs/databg.png);
+}
+.dhx_agenda_area{
+ width:100%;
+ overflow-y:auto;
+ background-image:url(./imgs/databg.png);
+}
+.dhx_agenda_line{
+ height:21px;
+ clear:both;
+ overflow:hidden;
+}
+.dhx_agenda_line div{
+ float:left;
+ width:188px;
+ border-right:1px dotted #8894A3;
+ text-align:center;
+ line-height:21px;
+ overflow:hidden;
+}
+.dhx_agenda_area .dhx_agenda_line div{
+ border-right:0px dotted #8894A3;
+}
+.dhx_v_border{
+ position:absolute;
+ left:187px;
+ top:0;
+ border-right:1px dotted #8894A3;
+ width:1px;
+ height:100%;
+}
+.dhx_agenda_line .dhx_event_icon{
+ width:20px;
+ border-width:0px;
+ background:url(./imgs/icon.png) no-repeat;
+ background-position: 5px 4px;
+ cursor:pointer;
+}
+.dhx_agenda_line span{
+ padding-left:5px;
+ line-height:21px;
+}
+
+
+.dhx_year_body{
+ border-left:1px dotted #586A7E;
+}
+.dhx_year_week{
+ position:relative;
+}
+.dhx_scale_bar_last{
+ border-right:1px dotted #586A7E;
+}
+.dhx_year_month{
+ height:18px;
+ padding-top:3px;
+ border:1px dotted #586A7E;
+ text-align:center;
+ vertical-align:middle;
+}
+.dhx_year_body .dhx_before .dhx_month_head, .dhx_year_body .dhx_after .dhx_month_head, .dhx_year_body .dhx_before .dhx_month_head a, .dhx_year_body .dhx_after .dhx_month_head a{
+ color:#E2E3E6 !important;
+}
+.dhx_year_body .dhx_month_body{
+ height:0px;
+ overflow:hidden;
+}
+.dhx_month_head.dhx_year_event{
+ background-color:#FFE763;
+}
+.dhx_year_body .dhx_before .dhx_month_head, .dhx_year_body .dhx_after .dhx_month_head{
+ cursor: default;
+}
+.dhx_tooltip{
+ border:1px solid #BBBBBB;
+ background-image:url(./imgs/databg.png);
+ position:absolute;
+ z-index:9998;
+ width:300px;
+ height:auto;
+ font-family:Tahoma;
+ font-size:8pt;
+ overflow:hidden;
+}
+
+.dhx_tooltip_line{
+ line-height:20px;
+ height:20px;
+ overflow:hidden;
+}
+
+.dhx_tooltip_line .dhx_event_icon{
+ width:20px; height:20px;
+ padding-right:10px;
+ float:left;
+ border-width:0px;
+ position:relative;
+ background:url(./imgs/icon.png) no-repeat;
+ background-position: 5px 4px;
+ cursor:pointer;
+}
+
+.dhx_tooltip_date{
+ float:left;
+ width:auto;
+ padding-left:5px;
+ text-align:center;
+}
+
+.dhx_text_disabled{
+ color:#887A2E;
+ font-family:Tahoma;
+ font-size:8pt;
+}
+
+.dhx_mini_calendar{
+ -moz-box-shadow:5px 5px 5px #888; /*Doesn't work in IE*/
+ -khtml-box-shadow: 5px 5px 5px #888;
+}
+
+.dhx_mini_calendar .dhx_month_head{
+ cursor:pointer;
+}
+.dhx_mini_calendar .dhx_calendar_click{
+ background-color: #C2D5FC;
+}
+.dhx_cal_navline div.dhx_minical_icon{
+ width:18px;
+ height:18px;
+ left:190px;
+ top:1px;
+ cursor:pointer;
+ background-image:url(./imgs/calendar.gif);
+}
+
+.dhx_matrix_scell {
+ height: 100%;
+}
+
+.dhx_matrix_cell, .dhx_matrix_scell{
+ overflow:hidden;
+ text-align:center;
+ vertical-align:middle;
+ border-bottom:1px dotted #8894A3;
+ border-right:1px dotted #8894A3;
+}
+.dhx_matrix_cell{
+ background-color:white;
+}
+.dhx_matrix_line{
+ overflow: hidden;
+}
+.dhx_matrix_cell div, .dhx_matrix_scell div{
+ overflow:hidden;
+ text-align:center;
+ height:auto;
+}
+
+.dhx_cal_lsection .dhx_readonly{
+ font-size:9pt;
+ font-size:8pt;
+ padding:2px;
+ color:#887A2E;
+}
+.dhx_cal_event_line .dhx_event_resize {
+ cursor: w-resize;
+ background: url(./imgs/resize_dots.png) repeat-y;
+ position: absolute;
+ top: 0;
+ width: 4px;
+}
+.dhx_event_resize_start {
+ left: 0;
+}
+.dhx_event_resize_end {
+ right: 0;
+}
+
+/* Tree view */
+.dhx_matrix_scell.folder, .dhx_data_table.folder .dhx_matrix_cell{
+ background-color: #969394;
+ cursor: pointer;
+}
+.dhx_matrix_scell .dhx_scell_level0{
+ padding-left: 5px;
+}
+.dhx_matrix_scell .dhx_scell_level1{
+ padding-left: 20px;
+}
+.dhx_matrix_scell .dhx_scell_level2{
+ padding-left: 35px;
+}
+.dhx_matrix_scell .dhx_scell_level3{
+ padding-left: 50px;
+}
+.dhx_matrix_scell .dhx_scell_level4{
+ padding-left: 65px;
+}
+
+.dhx_matrix_scell.folder{
+ font-weight: bold;
+ text-align: left;
+}
+.dhx_matrix_scell.folder .dhx_scell_expand{
+ float: left;
+ width: 10px;
+ padding-right:3px;
+}
+.dhx_matrix_scell.folder .dhx_scell_name{
+ float: left;
+ width: auto;
+}
+.dhx_matrix_scell.item .dhx_scell_name{
+ padding-left:15px;
+ text-align: left;
+}
+.dhx_data_table.folder .dhx_matrix_cell{
+ border-right: 0;
+}
+.dhx_section_timeline {
+ overflow: hidden;
+ padding: 4px 0 2px 10px;
+}
+.dhx_section_timeline select{
+ width: 552px;
+}
+
+/* Tree view end*/
+
+/* Map view */
+.dhx_map_area{
+ width:100%;
+ height:100%;
+ overflow-y: auto;
+ overflow-x: hidden;
+ background-image:url(./imgs/databg.png);
+}
+.dhx_map_line .dhx_event_icon{
+ width:20px;
+ border-width:0px;
+ background:url(./imgs/icon.png) no-repeat;
+ background-position: 5px 4px;
+ cursor:pointer;
+}
+.dhx_map_line{
+ height:21px;
+ clear:both;
+ overflow:hidden;
+}
+.dhx_map {
+ position:absolute;
+}
+.dhx_map_line div{
+ float:left;
+ border-right:1px dotted #8894A3;
+ text-align:center;
+ line-height:21px;
+ overflow:hidden;
+}
+.dhx_map_line .headline_description{
+ float:left;
+
+ border-right:1px dotted #8894A3;
+ text-align:center;
+ line-height:21px;
+ overflow:hidden;
+}
+.dhx_map_line .dhx_map_description{
+ float:left;
+ border-right: 0 dotted #8894A3;
+ text-align:center;
+ line-height:21px;
+ overflow:hidden;
+}
+.dhx_map_line .headline_date, .dhx_map_line .headline_description {
+ border-left: 0;
+}
+.dhx_map_line .line_description {
+ float:left;
+ border-right:1px dotted #8894A3;
+ text-align:left;
+ padding-left:5px;
+ line-height:21px;
+ overflow:hidden;
+}
+.dhx_map_line.highlight{
+ background-color: #C4C5CC;
+}
+.dhx_map_area .dhx_map_line div{
+ border-right:0px dotted #8894A3;
+}
+/* Map view end */
+
+/* dhtmlXTooltip start */
+.dhtmlXTooltip.tooltip{
+ -moz-box-shadow:3px 3px 3px #888888;
+ -webkit-box-shadow:3px 3px 3px #888888;
+ -o-box-shadow:3px 3px 3px #888888;
+ box-shadow:3px 3px 3px #888888;
+ filter:
+ progid:DXImageTransform.Microsoft.Shadow(color='#888888', Direction=135, Strength=5)
+ ;
+ background-color:white;
+ border-left:1px dotted #887A2E;
+ border-top:1px dotted #887A2E;
+ color:#887A2E;
+ cursor:default;
+ padding:10px;
+ position:absolute;
+ z-index:500;
+}
+/* dhtmlXTooltip end */
+
+/* Lightbox checkbox section */
+.dhx_cal_checkbox label {
+ padding-left: 5px;
+}
+/* Lightbox checkbox section end */
+
+
+/* Lightbox radiobuttons section */
+.dhx_cal_light .radio {
+ padding: 2px 0px 2px 10px;
+}
+.dhx_cal_light .radio input, .dhx_cal_light .radio label{
+ line-height: 15px;
+}
+.dhx_cal_light .radio input {
+ vertical-align: middle;
+ margin: 0px;
+ padding: 0px;
+}
+.dhx_cal_light .radio label {
+ vertical-align: middle;
+ padding-right: 10px;
+}
+/* Lightbox radiobuttons section end */
+
+
+/* Lightbox dhtmlx combo section */
+.dhx_cal_light .combo {
+ padding: 4px;
+}
+.dhx_cal_light_wide .dhx_combo_box/*, .dhx_cal_light_wide .combo*/ {
+ width: 608px !important;
+ left: 10px;
+}
+/* Lightbox dhtmlx combo section end */
+
+/* Agenda week start */
+.dhx_wa_column {
+ float: left;
+}
+.dhx_wa_column_last .dhx_wa_day_cont{
+ border-left: 1px dotted #8894A3;
+}
+.dhx_wa_scale_bar {
+ font-family: Tahoma;
+ padding-left: 10px;
+ font-size: 11px;
+ border-top: 1px dotted #8894A3;
+ border-bottom: 1px dotted #8894A3;
+}
+.dhx_wa_day_data {
+ background-color: #FCFEFC;
+ overflow-y: auto;
+}
+.dhx_wa_ev_body {
+ border-bottom: 1px dotted #778899;
+ font-size: 12px;
+ padding: 5px 0 5px 7px;
+}
+.dhx_wa_dnd {
+ font-family: Tahoma;
+ position: absolute;
+ padding-right: 7px;
+ color: #887AE2 !important;
+ background-color: #FFE763 !important;
+ border: 1px solid #B7A543;
+}
+.dhx_cal_event_selected{
+ background-color: #9cc1db;
+ color: white;
+}
+/* Agenda week end */
+
+/* timeline second scale start */
+.dhx_second_scale_bar {
+ border-bottom: 1px dotted #586A7E;
+ padding-top: 2px;
+}
+/* timeline second scale end */
+
+
+/* grid view */
+
+.dhx_cal_header div div{
+ border-left: 1px dotted #8894A3;
+}
+
+.dhx_grid_area{
+ width:100%;
+ height:100%;
+ overflow-y:auto;
+ background-color:#FCFEFC;
+}
+.dhx_grid_area table{
+ border-collapse: collapse;
+ border-spacing: 0;
+ width:100%;
+ table-layout:fixed;
+}
+.dhx_grid_area td{
+ table-layout:fixed;
+ text-align:center;
+}
+
+.dhx_grid_line{
+ height:21px;
+ clear:both;
+ overflow:hidden;
+}
+.dhx_grid_line div{
+ float:left;
+ cursor:default;
+ padding-top: 0;
+ padding-bottom: 0;
+ text-align:center;
+ line-height:21px;
+ overflow:hidden;
+}
+
+.dhx_grid_area td, .dhx_grid_line div{
+ padding-left:8px;
+ padding-right:8px;
+}
+
+
+.dhx_grid_area tr.dhx_grid_event{
+ height:21px;
+ overflow:hidden;
+ margin:0 0 1px 0;
+}
+.dhx_grid_area tr.dhx_grid_event td{
+ /*borders for old ies*/
+ border-bottom:1px solid #ECEEF4;
+}
+.dhx_grid_area tr.dhx_grid_event:nth-child(2n+1) td, .dhx_grid_area tr.dhx_grid_event:nth-child(2n) td{
+ border-bottom-width:0px;
+ border-bottom-style:none;
+}
+.dhx_grid_area tr.dhx_grid_event:nth-child(2n){
+ background-color:#ECEEF4;;
+}
+.dhx_grid_area .dhx_grid_dummy{
+ table-layout:auto;
+ margin:0 !important;
+ padding:0 !important;
+}
+
+.dhx_grid_v_border{
+ position:absolute;
+ border-right:1px solid #A4BED4;
+ width:1px;
+ height:100%;
+}
+
+.dhx_grid_event_selected{
+ background-color: #9cc1db !important;
+ color: white !important;
+}
+
+.dhx_grid_sort_desc .dhx_grid_view_sort{
+ background-position: 0 -55px;
+}
+.dhx_grid_sort_asc .dhx_grid_view_sort{
+ background-position: 0 -66px;
+}
+.dhx_grid_view_sort{
+ width:10px;
+ height:10px;
+ position: absolute;
+ border:none !important;
+ top: 5px;
+ background-repeat:no-repeat;
+ background-image: url(./imgs/images.png);
+}
+/* end grid */
+
+/* marked timespans */
+.dhx_marked_timespan {
+ position: absolute;
+ width: 100%;
+}
+.dhx_time_block {
+ position:absolute;
+ width:100%;
+ background:silver;
+ opacity:0.4;
+ filter:alpha(opacity=40);
+ z-index:1;
+}
+.dhx_time_block_reset {
+ opacity: 1;
+ filter:alpha(opacity=100);
+}
+.dhx_scheduler_month .dhx_marked_timespan {
+ display: none;
+}
+.dhx_mini_calendar .dhx_marked_timespan {
+ display: none;
+}
+/* now time */
+.dhx_now_time {
+ width:100%;
+ border-bottom:2px dotted red;
+ z-index: 1;
+}
+.dhx_scheduler_month .dhx_now_time {
+ border-bottom: 0;
+ border-left: 2px dotted red;
+}
+.dhx_matrix_now_time {
+ border-left:2px dotted red;
+ z-index: 1;
+}
+
+ +/*IE*/
+div.dhx_form_repeat input.radio { margin:-4px 0 0 -4px !ie; }
+div.dhx_form_repeat input.checkbox { margin:0 0 0 -4px !ie; }
+
+/*All*/
+.dhx_form_repeat, .dhx_form_repeat input {
+ padding:0;
+ margin:0;
+ padding-left:5px;
+ font-family:Tahoma, Verdana;
+ font-size:11px;
+ line-height:24px;
+}
+
+.dhx_form_repeat {
+ overflow:hidden;
+ /*height:115px;*/
+ height:0px;
+ background-color: #FFF4B5;
+ /*border: 1px solid #DCC43E;*/
+}
+
+.dhx_cal_light_wide .dhx_form_repeat {
+ background-color: transparent;
+}
+
+
+.dhx_repeat_center, .dhx_repeat_left{
+ height:115px;
+ padding:10px 0 10px 10px;
+ float:left;
+}
+
+.dhx_repeat_left{
+ width:95px;
+}
+
+.dhx_repeat_center{
+ width:335px;
+ margin-top:12px;
+}
+
+.dhx_repeat_divider{
+ float:left;
+ height:115px;
+ border-left:1px dotted #DCC43E;
+ /*background-color: #DCC43E;*/
+ width:1px;
+}
+
+.dhx_repeat_right {
+ float:right;
+ height:115px;
+ width:160px;
+ padding:10px 3px 10px 10px;
+ margin-top:7px;
+}
+
+input.dhx_repeat_text {
+ height:16px;
+ width: 27px;
+ margin: 0 4px 0 4px;
+ line-height:18px;
+ padding: 0 0 0 2px;
+}
+
+.dhx_form_repeat select {
+ height: 20px;
+ width: 87px;
+ padding:0 0 0 2px;
+ margin: 0 4px 0 4px;
+}
+
+input.dhx_repeat_date{
+ height: 18px;
+ width: 80px;
+ padding:0 0 0 2px;
+ margin: 0 4px 0 4px;
+ background-repeat:no-repeat;
+ background-position:64px 0;
+ border:1px #7f9db9 solid;
+ line-height:18px;
+}
+
+input.dhx_repeat_radio {
+ margin-right:4px;
+}
+
+input.dhx_repeat_checkbox {
+ margin:4px 4px 0 0;
+}
+
+.dhx_repeat_days td {
+ padding-right:5px;
+}
+.dhx_repeat_days label {
+ font-size:10px;
+}
+.dhx_custom_button{
+ width:90px;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ -ms-border-radius: 4px;
+ -o-border-radius: 4px;
+ border-radius: 4px;
+}
+.dhx_custom_button_recurring{
+ background-image:url(./imgs/but_repeat.gif);
+ background-position:-5px 20px;
+ width:20px;
+ margin-right:10px;
+}
+
+/* increase width of lightbox */
+.dhx_cal_light_rec{
+ width:640px;
+}
+.dhx_cal_light_rec .dhx_cal_larea{
+ width:632px;
+}
+.dhx_cal_light_rec.dhx_cal_light_wide{
+ width:816px;
+}
+.dhx_cal_light_rec.dhx_cal_light_wide .dhx_cal_larea{
+ width:808px;
+} +.dhx_cal_tab.active{
+ border:none;
+}
+.dhx_multi_day{
+ border:none;
+ border-top:1px solid #A4BED4;
+}
+.dhx_multi_day_icon, .dhx_multi_day_icon_small{
+ border-right:none;
+}
+.dhx_cal_container {
+ background-image:url(imgs_glossy/top-days-bg.png);
+ background-position:0 24px;
+ background-repeat:repeat-x;
+ background-color:#EBEBEB;
+}
+.dhx_cal_navline{
+ background-color:#EBEBEB;
+ height:23px !important;
+}
+.dhx_cal_prev_button{
+ background-image:url(imgs_glossy/buttons.gif);
+ width:30px;
+ height:20px;
+}
+.dhx_cal_next_button{
+ background-image:url(imgs_glossy/buttons.gif);
+ width:30px;
+ height:20px;
+}
+.dhx_cal_today_button{
+ padding-top:3px;
+ background-image:url(imgs_glossy/buttons.gif);
+ width:67px;
+ left:110px;
+ text-decoration:none;
+}
+.dhx_cal_navline .dhx_cal_date{
+ padding-top:4px;
+ left:230px;
+}
+.dhx_cal_tab{
+ background-image:url(imgs_glossy/white_tab.png);
+ width:60px;
+ height:15px;
+ text-decoration:none;
+ padding-top:4px;
+ margin-top: 4px;
+}
+.dhx_cal_tab.active{
+ background-image:url(imgs_glossy/blue_tab.png);
+ height:18px;
+ width:60px;
+ padding-top:4px;
+ margin-top: 2px;
+}
+.dhx_cal_data{
+ border-top: 1px solid #A4BED4;
+}
+.dhx_cal_header{
+ background-image:url(imgs_glossy/top-days-bg.png);
+ background-repeat:repeat-x;
+ border-top: 0px;
+ border-right: 0px;
+}
+.dhx_scale_bar{
+ background-image:url(imgs_glossy/top-separator.gif);
+ background-position: 0px 0px;
+ background-repeat:no-repeat;
+ background-color: transparent;
+ padding-top:3px;
+ border-left:0px;
+}
+
+.dhx_scale_holder {
+ border-right:1px solid #A4BED4;
+}
+.dhx_scale_holder_now{
+ border-right:1px solid #A4BED4;
+}
+.dhx_scale_hour{
+ background-image:url(imgs_glossy/left-time-bg.png);
+ border-bottom:1px solid #A4BED4;
+ color:#2F3A48;
+}
+.dhx_multi_day{
+ background-image:url(imgs_glossy/multi-days-bg.png);
+ background-repeat:repeat;
+ border-bottom:1px solid #A4BED4;
+ border-left:0px;
+}
+.dhx_multi_day_icon,.dhx_multi_day_icon_small{
+ background-image: url(imgs_glossy/clock_big.png);
+ border-bottom: 1px solid #A4BED4;
+ border-left: 1px solid #ffffff;
+ background-color: transparent;
+ background-repeat: no-repeat;
+}
+.dhx_multi_day_icon_small{
+ background-image:url(imgs_glossy/clock_small.png);
+}
+.dhx_month_head{
+ background-color:#FFFFFF;
+}
+.dhx_after .dhx_month_head,.dhx_before .dhx_month_head{
+ background-color:#EFEDE2;
+}
+.dhx_now .dhx_month_head{
+ background-color:#E4EFFF;
+}
+.dhx_after .dhx_month_body,.dhx_before .dhx_month_body{
+ background-color:#EFEDE2;
+}
+.dhx_cal_event div{
+ border:1px solid #FFBD51;
+ background-color:#FFE4AB;
+ color:#000000;
+}
+.dhx_cal_event_clear{
+ color:#000000;
+}
+.dhx_cal_event_line{
+ background-image:url(imgs_glossy/event-bg.png);
+ border:1px solid #FFBD51;
+ color:#000000;
+}
+.dhx_in_move{
+ background-image:url(imgs_glossy/move.png);
+}
+.dhx_cal_event .dhx_body{
+ background-color:#FFE4AB;
+}
+.dhx_cal_event .dhx_title{
+ background-color:#FFE4AB;
+}
+.dhx_cal_light{
+ -moz-box-shadow:5px 5px 5px #888888;
+ -khtml-box-shadow: 5px 5px 5px #888;
+ background-color:#EBEBEB;
+ border:2px solid #A4BED4;
+ color:#000000;
+}
+.dhx_cal_larea{
+ border:1px solid #A4BED4;
+ border-width:0 1px 1px;
+ background-color:#FFFFFF;
+}
+
+.dhx_cal_lsection{
+ background-image:url(imgs_glossy/lightbox.png);
+ font-size:14px;
+ padding:5px 0 5px 10px;
+ color:#000000;
+}
+.dhx_cal_light_wide .dhx_cal_lsection{
+ background-image:url(imgs_glossy/multi-days-bg.png);
+}
+
+
+.dhx_cal_ltext textarea{
+ background-color:#ffffff;
+ color:#000000;
+}
+
+.dhx_cal_light select, .dhx_cal_light input{
+ color:#000000;
+}
+.dhx_save_btn{
+ background-image:url(imgs_glossy/controlls5.png);
+}
+.dhx_cancel_btn{
+ background-image:url(imgs_glossy/controlls5.png);
+}
+.dhx_delete_btn{
+ background-image:url(imgs_glossy/controlls5.png);
+}
+div.dhx_menu_head{
+ background-image:url(imgs_glossy/controlls5.png);
+ border:1px solid #FFE4AB;
+}
+div.dhx_menu_icon{
+ background-image:url(imgs_glossy/controlls5.png);
+ border:medium none;
+}
+.dhx_section_time{
+ height:20px !important;
+ padding:7px 0 !important;
+ text-align:center;
+ background:white;
+}
+
+div.dhx_cal_editor{
+ background-color:#FFE4AB;
+}
+.dhx_year_month{
+ background-image:url(imgs_glossy/top-days-bg.png);
+ border: 0px;
+}
+.dhx_year_week{
+ background-image:url(imgs_glossy/top-days-bg.png);
+}
+.dhx_month_head{
+ border-right:1px solid #A4BED4;
+}
+.dhx_month_body, .dhx_matrix_cell, .dhx_matrix_scell{
+ border-right:1px solid #A4BED4;
+ border-bottom:1px solid #A4BED4;
+}
+.dhx_year_body{
+ border-left:1px solid #A4BED4;
+}
+.dhx_scale_bar_last{
+ border-right: none;
+}
+.dhx_month_head.dhx_year_event{
+ background-color:#FFE4AB;
+}
+.dhx_year_body .dhx_before .dhx_month_head, .dhx_year_body .dhx_after .dhx_month_head, .dhx_year_body .dhx_before .dhx_month_head a, .dhx_year_body .dhx_after .dhx_month_head a{
+ color:#EFEDE2 !important;
+}
+.dhx_cal_lsection .dhx_readonly{
+ color:#000000;
+}
+.dhx_tooltip{
+ -moz-box-shadow:2px 2px 2px #888; /*Doesn't work in IE*/
+ -khtml-box-shadow: 2px 2px 2px #888;
+}
+.dhx_custom_button {
+ margin-top: -2px;
+}
+/*2.3*/
+.dhx_cal_lsection .dhx_fullday{
+ color:#000000;
+}
+
+.dhx_cal_lsection.dhx_cal_checkbox{
+ height:16px;
+ line-height:18px;
+}
+.dhx_cal_light_wide .dhx_cal_lsection.dhx_cal_checkbox{
+ height:20px;
+}
+.dhx_cal_checkbox label{
+ vertical-align:top;
+}
+
+.dhx_cal_light_wide .dhx_cal_lsection{
+ color:black;
+}
+
+.dhx_cal_light_wide .dhx_wrap_section{
+ border-top:1px solid #A4BED4;
+ background-image:url(imgs_glossy/multi-days-bg.png);
+}
+.dhx_cal_light_wide .dhx_cal_ltext{
+ border-left:1px solid #A4BED4;
+}
+.dhx_cal_light_wide .dhx_cal_ltext {
+ background-color:white;
+}
+.dhx_custom_button{
+ background:white;
+ color:black;
+}
+.dhx_form_repeat{
+ background:white;
+}
+.dhx_repeat_divider{
+ border-left:1px solid #A4BED4;
+}
+
+/* timeline second scale start */
+.dhx_cal_header.dhx_second_cal_header {
+ background-image: url("imgs_glossy/second-top-days-bg.png");
+ padding-right: 20px;
+}
+.dhx_cal_header div div {
+ border-left: 0;
+}
+.dhx_scale_bar {
+ padding-top: 4px;
+}
+.dhx_second_scale_bar {
+ border-bottom: 0;
+ padding-top: 4px;
+}
+
+/* timeline second scale end */
+.dhx_cal_light_wide .dhx_cal_lsection .dhx_fullday, .dhx_cal_lsection .dhx_fullday{
+ color:#000000;
+ font-size: 14px;
+}
+.dhx_cal_light_wide .dhx_cal_lsection {
+ font-size: 14px;
+ padding-right:10px;
+}
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/event.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/event.js deleted file mode 100644 index 18542ecbe3b..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/event.js +++ /dev/null @@ -1,647 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.uid=function(){
- if (!this._seed) this._seed=(new Date).valueOf();
- return this._seed++;
-};
-scheduler._events={};
-scheduler.clearAll=function(){
- this._events={};
- this._loaded={};
- this.clear_view();
-};
-scheduler.addEvent=function(start_date,end_date,text,id,extra_data){
- if(!arguments.length)
- return this.addEventNow();
- var ev=start_date;
- if (arguments.length!=1){
- ev=extra_data||{};
- ev.start_date=start_date;
- ev.end_date=end_date;
- ev.text=text;
- ev.id=id;
- }
- ev.id = ev.id||scheduler.uid();
- ev.text = ev.text||"";
-
- if (typeof ev.start_date == "string") ev.start_date=this.templates.api_date(ev.start_date);
- if (typeof ev.end_date == "string") ev.end_date=this.templates.api_date(ev.end_date);
-
- var d = (this.config.event_duration||this.config.time_step)*60000;
- if(ev.start_date.valueOf() == ev.end_date.valueOf())
- ev.end_date.setTime(ev.end_date.valueOf()+d);
-
- ev._timed=this.is_one_day_event(ev);
-
- var is_new=!this._events[ev.id];
- this._events[ev.id]=ev;
- this.event_updated(ev);
- if (!this._loading)
- this.callEvent(is_new?"onEventAdded":"onEventChanged",[ev.id,ev]);
-};
-scheduler.deleteEvent=function(id,silent){
- var ev=this._events[id];
- if (!silent && (!this.callEvent("onBeforeEventDelete",[id,ev]) || !this.callEvent("onConfirmedBeforeEventDelete", [id,ev])))
- return;
- if (ev){
- delete this._events[id];
- this.unselect(id);
- this.event_updated(ev);
- }
-
- this.callEvent("onEventDeleted", [id]);
-};
-scheduler.getEvent=function(id){
- return this._events[id];
-};
-scheduler.setEvent=function(id,hash){
- this._events[id]=hash;
-};
-scheduler.for_rendered=function(id,method){
- for (var i=this._rendered.length-1; i>=0; i--)
- if (this._rendered[i].getAttribute("event_id")==id)
- method(this._rendered[i],i);
-};
-scheduler.changeEventId=function(id,new_id){
- if (id == new_id) return;
- var ev=this._events[id];
- if (ev){
- ev.id=new_id;
- this._events[new_id]=ev;
- delete this._events[id];
- }
- this.for_rendered(id,function(r){
- r.setAttribute("event_id",new_id);
- });
- if (this._select_id==id) this._select_id=new_id;
- if (this._edit_id==id) this._edit_id=new_id;
- //if (this._drag_id==id) this._drag_id=new_id;
- this.callEvent("onEventIdChange",[id,new_id]);
-};
-
-(function(){
- var attrs=["text","Text","start_date","StartDate","end_date","EndDate"];
- var create_getter=function(name){
- return function(id){ return (scheduler.getEvent(id))[name]; };
- };
- var create_setter=function(name){
- return function(id,value){
- var ev=scheduler.getEvent(id); ev[name]=value;
- ev._changed=true;
- ev._timed=this.is_one_day_event(ev);
- scheduler.event_updated(ev,true);
- };
- };
- for (var i=0; i<attrs.length; i+=2){
- scheduler["getEvent"+attrs[i+1]]=create_getter(attrs[i]);
- scheduler["setEvent"+attrs[i+1]]=create_setter(attrs[i]);
- }
-})();
-
-scheduler.event_updated=function(ev,force){
- if (this.is_visible_events(ev))
- this.render_view_data();
- else this.clear_event(ev.id);
-};
-scheduler.is_visible_events=function(ev){
- return (ev.start_date<this._max_date && this._min_date<ev.end_date);
-};
-scheduler.is_one_day_event=function(ev){
- var delta = ev.end_date.getDate()-ev.start_date.getDate();
-
- if (!delta)
- return ev.start_date.getMonth()==ev.end_date.getMonth() && ev.start_date.getFullYear()==ev.end_date.getFullYear();
- else {
- if (delta < 0) delta = Math.ceil((ev.end_date.valueOf()-ev.start_date.valueOf())/(24*60*60*1000));
- return (delta == 1 && !ev.end_date.getHours() && !ev.end_date.getMinutes() && (ev.start_date.getHours() || ev.start_date.getMinutes() ));
- }
-
-};
-scheduler.get_visible_events=function(){
- //not the best strategy for sure
- var stack=[];
- var filter = this["filter_"+this._mode];
-
- for( var id in this._events)
- if (this.is_visible_events(this._events[id]))
- if (this._table_view || this.config.multi_day || this._events[id]._timed)
- if (!filter || filter(id,this._events[id]))
- stack.push(this._events[id]);
-
- return stack;
-};
-scheduler.render_view_data=function(evs, hold){
- if(!evs){
- if (this._not_render) {
- this._render_wait=true;
- return;
- }
- this._render_wait=false;
-
- this.clear_view();
- evs=this.get_visible_events();
- }
-
- if (this.config.multi_day && !this._table_view){
-
- var tvs = [];
- var tvd = [];
- for (var i=0; i < evs.length; i++){
- if (evs[i]._timed)
- tvs.push(evs[i]);
- else
- tvd.push(evs[i]);
- }
-
- // multiday events
-
-
-
- this._rendered_location = this._els['dhx_multi_day'][0];
- this._table_view=true;
- this.render_data(tvd, hold);
- this._table_view=false;
-
- // normal events
- this._rendered_location = this._els['dhx_cal_data'][0];
- this._table_view=false;
- this.render_data(tvs, hold);
-
- } else {
- this._rendered_location = this._els['dhx_cal_data'][0];
- this.render_data(evs, hold);
- }
-};
-scheduler.render_data=function(evs,hold){
- evs=this._pre_render_events(evs,hold);
- for (var i=0; i<evs.length; i++)
- if (this._table_view)
- this.render_event_bar(evs[i]);
- else
- this.render_event(evs[i]);
-};
-scheduler._pre_render_events=function(evs,hold){
- var hb = this.xy.bar_height;
- var h_old = this._colsS.heights;
- var h=this._colsS.heights=[0,0,0,0,0,0,0];
- var data = this._els["dhx_cal_data"][0];
-
- if (!this._table_view) evs=this._pre_render_events_line(evs,hold); //ignore long events for now
- else evs=this._pre_render_events_table(evs,hold);
-
- if (this._table_view){
- if (hold)
- this._colsS.heights = h_old;
- else {
- var evl = data.firstChild;
- if (evl.rows){
- for (var i=0; i<evl.rows.length; i++){
- h[i]++;
- if ((h[i])*hb > this._colsS.height-22){ // 22 - height of cell's header
- //we have overflow, update heights
- var cells = evl.rows[i].cells;
- for (var j=0; j < cells.length; j++) {
- cells[j].childNodes[1].style.height = h[i]*hb+"px";
- }
- h[i]=(h[i-1]||0)+cells[0].offsetHeight;
- }
- h[i]=(h[i-1]||0)+evl.rows[i].cells[0].offsetHeight;
- }
- h.unshift(0);
- if (evl.parentNode.offsetHeight<evl.parentNode.scrollHeight && !evl._h_fix){
- //we have v-scroll, decrease last day cell
- for (var i=0; i<evl.rows.length; i++){
- var cell = evl.rows[i].cells[6].childNodes[0];
- var w = cell.offsetWidth-scheduler.xy.scroll_width+"px";
- cell.style.width = w;
- cell.nextSibling.style.width = w;
- }
- evl._h_fix=true;
- }
- } else{
- if (!evs.length && this._els["dhx_multi_day"][0].style.visibility == "visible")
- h[0]=-1;
- if (evs.length || h[0]==-1){
- //shift days to have space for multiday events
- var childs = evl.parentNode.childNodes;
- var dh = ((h[0]+1)*hb+1)+"px"; // +1 so multiday events would have 2px from top and 2px from bottom by default
- data.style.top = (this._els["dhx_cal_navline"][0].offsetHeight + this._els["dhx_cal_header"][0].offsetHeight + parseInt(dh)) + 'px';
- data.style.height = (this._obj.offsetHeight - parseInt(data.style.top) - (this.xy.margin_top||0)) + 'px';
- var last = this._els["dhx_multi_day"][0];
- last.style.height=dh;
- last.style.visibility=(h[0]==-1?"hidden":"visible");
- last=this._els["dhx_multi_day"][1];
- last.style.height=dh;
- last.style.visibility=(h[0]==-1?"hidden":"visible");
- last.className=h[0]?"dhx_multi_day_icon":"dhx_multi_day_icon_small";
- this._dy_shift=(h[0]+1)*hb;
- h[0] = 0;
- }
- }
- }
- }
-
- return evs;
-};
-scheduler._get_event_sday=function(ev){
- return Math.floor((ev.start_date.valueOf()-this._min_date.valueOf())/(24*60*60*1000));
-};
-scheduler._pre_render_events_line=function(evs,hold){
- evs.sort(function(a,b){
- if(a.start_date.valueOf()==b.start_date.valueOf())
- return a.id>b.id?1:-1;
- return a.start_date>b.start_date?1:-1;
- });
- var days=[]; //events by weeks
- var evs_originals = [];
- for (var i=0; i < evs.length; i++) {
- var ev=evs[i];
-
- //check scale overflow
- var sh = ev.start_date.getHours();
- var eh = ev.end_date.getHours();
-
- ev._sday=this._get_event_sday(ev);
- if (!days[ev._sday]) days[ev._sday]=[];
-
- if (!hold){
- ev._inner=false;
-
- var stack=days[ev._sday];
- while (stack.length && stack[stack.length-1].end_date<=ev.start_date)
- stack.splice(stack.length-1,1);
-
- var sorderSet = false;
- for(var j=0; j<stack.length; j++){
- if(stack[j].end_date.valueOf()<ev.start_date.valueOf()){
- sorderSet = true;
- ev._sorder=stack[j]._sorder;
- stack.splice(j,1);
- ev._inner=true;
- break;
- }
- }
-
- if (stack.length)
- stack[stack.length-1]._inner=true;
-
-
- if (!sorderSet) {
- if (stack.length) {
- if (stack.length <= stack[stack.length - 1]._sorder) {
- if (!stack[stack.length - 1]._sorder)
- ev._sorder = 0;
- else
- for (j = 0; j < stack.length; j++) {
- var _is_sorder = false;
- for (k = 0; k < stack.length; k++) {
- if (stack[k]._sorder == j) {
- _is_sorder = true;
- break;
- }
- }
- if (!_is_sorder) {
- ev._sorder = j;
- break;
- }
- }
- ev._inner = true;
- }
- else {
- var _max_sorder = stack[0]._sorder;
- for (j = 1; j < stack.length; j++)
- if (stack[j]._sorder > _max_sorder)
- _max_sorder = stack[j]._sorder;
- ev._sorder = _max_sorder + 1;
- ev._inner = false;
- }
-
- }
- else
- ev._sorder = 0;
- }
-
- stack.push(ev);
-
- if (stack.length>(stack.max_count||0)) {
- stack.max_count=stack.length;
- ev._count=stack.length;
- }
- else {
- ev._count=(ev._count)?ev._count:1;
- }
- }
-
- if (sh < this.config.first_hour || eh >= this.config.last_hour){
- evs_originals.push(ev);
- evs[i]=ev=this._copy_event(ev);
- if (sh < this.config.first_hour){
- ev.start_date.setHours(this.config.first_hour);
- ev.start_date.setMinutes(0);
- }
- if (eh >= this.config.last_hour){
- ev.end_date.setMinutes(0);
- ev.end_date.setHours(this.config.last_hour);
- }
- if (ev.start_date>ev.end_date || sh==this.config.last_hour) {
- evs.splice(i,1); i--; continue;
- }
- }
- }
- if (!hold){
- for (var i=0; i < evs.length; i++) {
- evs[i]._count = days[evs[i]._sday].max_count;
- }
- for (var i=0; i < evs_originals.length; i++)
- evs_originals[i]._count=days[evs_originals[i]._sday].max_count;
- }
-
- return evs;
-};
-scheduler._time_order=function(evs){
- evs.sort(function(a,b){
- if (a.start_date.valueOf()==b.start_date.valueOf()){
- if (a._timed && !b._timed) return 1;
- if (!a._timed && b._timed) return -1;
- return a.id>b.id?1:-1;
- }
- return a.start_date>b.start_date?1:-1;
- });
-};
-scheduler._pre_render_events_table=function(evs,hold){ // max - max height of week slot
- this._time_order(evs);
-
- var out=[];
- var weeks=[[],[],[],[],[],[],[]]; //events by weeks
- var max = this._colsS.heights;
- var start_date;
- var cols = this._cols.length;
-
- for (var i=0; i < evs.length; i++) {
- var ev=evs[i];
- var sd = (start_date||ev.start_date);
- var ed = ev.end_date;
- //trim events which are crossing through current view
- if (sd<this._min_date) sd=this._min_date;
- if (ed>this._max_date) ed=this._max_date;
-
- var locate_s = this.locate_holder_day(sd,false,ev);
- ev._sday=locate_s%cols;
- var locate_e = this.locate_holder_day(ed,true,ev)||cols;
- ev._eday=(locate_e%cols)||cols; //cols used to fill full week, when event end on monday
- ev._length=locate_e-locate_s;
-
- //3600000 - compensate 1 hour during winter|summer time shift
- ev._sweek=Math.floor((this._correct_shift(sd.valueOf(),1)-this._min_date.valueOf())/(60*60*1000*24*cols));
-
- //current slot
- var stack=weeks[ev._sweek];
- //check order position
- var stack_line;
-
- for (stack_line=0; stack_line<stack.length; stack_line++)
- if (stack[stack_line]._eday<=ev._sday)
- break;
-
- if(!ev._sorder || !hold ) {
- ev._sorder=stack_line;
- }
-
- if (ev._sday+ev._length<=cols){
- start_date=null;
- out.push(ev);
- stack[stack_line]=ev;
- //get max height of slot
- max[ev._sweek]=stack.length-1;
- } else{ // split long event in chunks
- var copy=this._copy_event(ev);
- copy._length=cols-ev._sday;
- copy._eday=cols; copy._sday=ev._sday;
- copy._sweek=ev._sweek; copy._sorder=ev._sorder;
- copy.end_date=this.date.add(sd,copy._length,"day");
-
- out.push(copy);
- stack[stack_line]=copy;
- start_date=copy.end_date;
- //get max height of slot
- max[ev._sweek]=stack.length-1;
- i--; continue; //repeat same step
- }
- }
-
- return out;
-};
-scheduler._copy_dummy=function(){
- this.start_date=new Date(this.start_date);
- this.end_date=new Date(this.end_date);
-};
-scheduler._copy_event=function(ev){
- this._copy_dummy.prototype = ev;
- return new this._copy_dummy();
- //return {start_date:ev.start_date, end_date:ev.end_date, text:ev.text, id:ev.id}
-};
-scheduler._rendered=[];
-scheduler.clear_view=function(){
- for (var i=0; i<this._rendered.length; i++){
- var obj=this._rendered[i];
- if (obj.parentNode) obj.parentNode.removeChild(obj);
- }
- this._rendered=[];
-};
-scheduler.updateEvent=function(id){
- var ev=this.getEvent(id);
- this.clear_event(id);
- if (ev && this.is_visible_events(ev))
- this.render_view_data([ev], true);
-};
-scheduler.clear_event=function(id){
- this.for_rendered(id,function(node,i){
- if (node.parentNode)
- node.parentNode.removeChild(node);
- scheduler._rendered.splice(i,1);
- });
-};
-scheduler.render_event=function(ev){
- var menu = scheduler.xy.menu_width;
- if (ev._sday<0) return; //can occur in case of recurring event during time shift
- var parent=scheduler.locate_holder(ev._sday);
- if (!parent) return; //attempt to render non-visible event
- var sm = ev.start_date.getHours()*60+ev.start_date.getMinutes();
- var em = (ev.end_date.getHours()*60+ev.end_date.getMinutes())||(scheduler.config.last_hour*60);
-
- var top = (Math.round((sm*60*1000-this.config.first_hour*60*60*1000)*this.config.hour_size_px/(60*60*1000)))%(this.config.hour_size_px*24)+1; //42px/hour
- var height = Math.max(scheduler.xy.min_event_height,(em-sm)*this.config.hour_size_px/60)+1; //42px/hour
- //var height = Math.max(25,Math.round((ev.end_date.valueOf()-ev.start_date.valueOf())*(this.config.hour_size_px+(this._quirks?1:0))/(60*60*1000))); //42px/hour
- var width=Math.floor((parent.clientWidth-menu)/ev._count);
- var left=ev._sorder*width+1;
- if (!ev._inner) width=width*(ev._count-ev._sorder);
- if(this.config.cascade_event_display) {
- var limit = this.config.cascade_event_count;
- var margin = this.config.cascade_event_margin;
- left = ev._sorder%limit*margin;
- var right = (ev._inner)?(ev._count-ev._sorder-1)%limit*margin/2:0;
- width=Math.floor(parent.clientWidth-menu-left-right);
- }
-
- var d=this._render_v_bar(ev.id,menu+left,top,width,height,ev._text_style,scheduler.templates.event_header(ev.start_date,ev.end_date,ev),scheduler.templates.event_text(ev.start_date,ev.end_date,ev));
-
- this._rendered.push(d);
- parent.appendChild(d);
-
- left=left+parseInt(parent.style.left,10)+menu;
-
- if (this._edit_id==ev.id){
-
- d.style.zIndex = 1; //fix overlapping issue
- width=Math.max(width-4,scheduler.xy.editor_width);
- d=document.createElement("DIV");
- d.setAttribute("event_id",ev.id);
- this.set_xy(d,width,height-20,left,top+14);
- d.className="dhx_cal_editor";
-
- var d2=document.createElement("DIV");
- this.set_xy(d2,width-6,height-26);
- d2.style.cssText+=";margin:2px 2px 2px 2px;overflow:hidden;";
-
- d.appendChild(d2);
- this._els["dhx_cal_data"][0].appendChild(d);
- this._rendered.push(d);
-
- d2.innerHTML="<textarea class='dhx_cal_editor'>"+ev.text+"</textarea>";
- if (this._quirks7) d2.firstChild.style.height=height-12+"px"; //IEFIX
- this._editor=d2.firstChild;
- this._editor.onkeypress=function(e){
- if ((e||event).shiftKey) return true;
- var code=(e||event).keyCode;
- if (code==scheduler.keys.edit_save) scheduler.editStop(true);
- if (code==scheduler.keys.edit_cancel) scheduler.editStop(false);
- };
- this._editor.onselectstart=function(e){ return (e||event).cancelBubble=true; };
- d2.firstChild.focus();
- //IE and opera can add x-scroll during focusing
- this._els["dhx_cal_data"][0].scrollLeft=0;
- d2.firstChild.select();
-
- }
- if (this._select_id==ev.id){
- if(this.config.cascade_event_display && this._drag_mode)
- d.style.zIndex = 1; //fix overlapping issue for cascade view in case of dnd of selected event
- var icons=this.config["icons_"+((this._edit_id==ev.id)?"edit":"select")];
- var icons_str="";
- var bg_color = (ev.color?("background-color:"+ev.color+";"):"");
- var color = (ev.textColor?("color:"+ev.textColor+";"):"");
- for (var i=0; i<icons.length; i++)
- icons_str+="<div class='dhx_menu_icon "+icons[i]+"' style='"+bg_color+""+color+"' title='"+this.locale.labels[icons[i]]+"'></div>";
- var obj = this._render_v_bar(ev.id,left-menu+1,top,menu,icons.length*20+26,"","<div style='"+bg_color+""+color+"' class='dhx_menu_head'></div>",icons_str,true);
- obj.style.left=left-menu+1;
- this._els["dhx_cal_data"][0].appendChild(obj);
- this._rendered.push(obj);
- }
-};
-scheduler._render_v_bar=function(id,x,y,w,h,style,contentA,contentB,bottom){
- var d=document.createElement("DIV");
- var ev = this.getEvent(id);
- var cs = "dhx_cal_event";
- var cse = scheduler.templates.event_class(ev.start_date,ev.end_date,ev);
- if (cse) cs=cs+" "+cse;
-
- var bg_color = (ev.color?("background-color:"+ev.color+";"):"");
- var color = (ev.textColor?("color:"+ev.textColor+";"):"");
-
- var html='<div event_id="'+id+'" class="'+cs+'" style="position:absolute; top:'+y+'px; left:'+x+'px; width:'+(w-4)+'px; height:'+h+'px;'+(style||"")+'">';
- html+='<div class="dhx_header" style=" width:'+(w-6)+'px;'+bg_color+'" > </div>';
- html+='<div class="dhx_title" style="'+bg_color+''+color+'">'+contentA+'</div>';
- html+='<div class="dhx_body" style=" width:'+(w-(this._quirks?4:14))+'px; height:'+(h-(this._quirks?20:30))+'px;'+bg_color+''+color+'">'+contentB+'</div>';
- html+='<div class="dhx_footer" style=" width:'+(w-8)+'px;'+(bottom?' margin-top:-1px;':'')+''+bg_color+''+color+'" ></div></div>';
-
- d.innerHTML=html;
- return d.firstChild;
-};
-scheduler.locate_holder=function(day){
- if (this._mode=="day") return this._els["dhx_cal_data"][0].firstChild; //dirty
- return this._els["dhx_cal_data"][0].childNodes[day];
-};
-scheduler.locate_holder_day=function(date,past){
- var day = Math.floor((this._correct_shift(date,1)-this._min_date)/(60*60*24*1000));
- //when locating end data of event , we need to use next day if time part was defined
- if (past && this.date.time_part(date)) day++;
- return day;
-};
-scheduler.render_event_bar=function(ev){
- var parent=this._rendered_location;
-
- var x=this._colsS[ev._sday];
- var x2=this._colsS[ev._eday];
- if (x2==x) x2=this._colsS[ev._eday+1];
- var hb = this.xy.bar_height;
-
- var y=this._colsS.heights[ev._sweek]+(this._colsS.height?(this.xy.month_scale_height+2):2)+(ev._sorder*hb);
-
- var d=document.createElement("DIV");
- var cs = ev._timed?"dhx_cal_event_clear":"dhx_cal_event_line";
- var cse = scheduler.templates.event_class(ev.start_date,ev.end_date,ev);
- if (cse) cs=cs+" "+cse;
-
- var bg_color = (ev.color?("background-color:"+ev.color+";"):"");
- var color = (ev.textColor?("color:"+ev.textColor+";"):"");
-
- var html='<div event_id="'+ev.id+'" class="'+cs+'" style="position:absolute; top:'+y+'px; left:'+x+'px; width:'+(x2-x-15)+'px;'+color+''+bg_color+''+(ev._text_style||"")+'">';
-
- if (ev._timed)
- html+=scheduler.templates.event_bar_date(ev.start_date,ev.end_date,ev);
- html+=scheduler.templates.event_bar_text(ev.start_date,ev.end_date,ev)+'</div>';
- html+='</div>';
-
- d.innerHTML=html;
-
- this._rendered.push(d.firstChild);
- parent.appendChild(d.firstChild);
-};
-
-scheduler._locate_event=function(node){
- var id=null;
- while (node && !id && node.getAttribute){
- id=node.getAttribute("event_id");
- node=node.parentNode;
- }
- return id;
-};
-
-
-scheduler.edit=function(id){
- if (this._edit_id==id) return;
- this.editStop(false,id);
- this._edit_id=id;
- this.updateEvent(id);
-};
-scheduler.editStop=function(mode,id){
- if (id && this._edit_id==id) return;
- var ev=this.getEvent(this._edit_id);
- if (ev){
- if (mode) ev.text=this._editor.value;
- this._edit_id=null;
- this._editor=null;
- this.updateEvent(ev.id);
- this._edit_stop_event(ev,mode);
- }
-};
-scheduler._edit_stop_event=function(ev,mode){
- if (this._new_event){
- if (!mode) this.deleteEvent(ev.id,true);
- else this.callEvent("onEventAdded",[ev.id,ev]);
- this._new_event=null;
- } else
- if (mode) this.callEvent("onEventChanged",[ev.id,ev]);
-};
-
-scheduler.getEvents = function(from,to){
- var result = [];
- for (var a in this._events){
- var ev = this._events[a];
- if (ev && ev.start_date<to && ev.end_date>from)
- result.push(ev);
- }
- return result;
-};
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext.css b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext.css deleted file mode 100644 index de19bca63ed..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext.css +++ /dev/null @@ -1,386 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -.dhx_scale_bar_header {
- position: absolute;
- border-bottom: 1px dotted #8894A3;
- width: 100%;
-}
-.dhx_expand_icon {
- position:absolute; top:0px; right:0px;
- background-image:url(./imgs/colapce-expand-icon.gif);
- width:18px; height:18px;
- cursor:pointer;
- background-position:0px 18px;
- z-index:16;
-}
-.dhx_agenda_area{
- width:100%;
- height:100%;
- overflow-y:auto;
- background-image:url(./imgs/databg.png);
-}
-.dhx_agenda_line{
- height:21px;
- clear:both;
- overflow:hidden;
-}
-.dhx_agenda_line div{
- float:left;
- width:188px;
- border-right:1px dotted #8894A3;
- text-align:center;
- line-height:21px;
- overflow:hidden;
-}
-.dhx_agenda_area .dhx_agenda_line div{
- border-right:0px dotted #8894A3;
-}
-.dhx_v_border{
- position:absolute; left:186px; top:0px;
- border-right:1px dotted #8894A3;
- width:1px;
- height:100%;
-}
-.dhx_agenda_line .dhx_event_icon{
- width:20px;
- border-width:0px;
- background:url(./imgs/icon.png) no-repeat;
- background-position: 5px 4px;
- cursor:pointer;
-}
-.dhx_agenda_line span{
- padding-left:5px;
- line-height:21px;
-}
-
-
-.dhx_year_body{
- border-left:1px dotted #586A7E;
-}
-.dhx_year_week{
- position:relative;
-}
-.dhx_scale_bar_last{
- border-right:1px dotted #586A7E;
-}
-.dhx_year_month{
- height:18px;
- padding-top:3px;
- border:1px dotted #586A7E;
- text-align:center;
- vertical-align:middle;
-}
-.dhx_year_body .dhx_before .dhx_month_head, .dhx_year_body .dhx_after .dhx_month_head, .dhx_year_body .dhx_before .dhx_month_head a, .dhx_year_body .dhx_after .dhx_month_head a{
- color:#E2E3E6 !important;
-}
-.dhx_year_body .dhx_month_body{
- height:0px;
- overflow:hidden;
-}
-.dhx_month_head.dhx_year_event{
- background-color:#FFE763;
-}
-.dhx_year_body .dhx_before .dhx_month_head, .dhx_year_body .dhx_after .dhx_month_head{
- cursor: default;
-}
-.dhx_tooltip{
- border:1px solid #BBBBBB;
- background-image:url(./imgs/databg.png);
- position:absolute;
- z-index:9998;
- width:300px;
- height:auto;
- font-family:Tahoma;
- font-size:8pt;
- overflow:hidden;
-}
-
-.dhx_tooltip_line{
- line-height:20px;
- height:20px;
- overflow:hidden;
-}
-
-.dhx_tooltip_line .dhx_event_icon{
- width:20px; height:20px;
- padding-right:10px;
- float:left;
- border-width:0px;
- position:relative;
- background:url(./imgs/icon.png) no-repeat;
- background-position: 5px 4px;
- cursor:pointer;
-}
-
-.dhx_tooltip_date{
- float:left;
- width:auto;
- padding-left:5px;
- text-align:center;
-}
-
-.dhx_text_disabled{
- color:#887A2E;
- font-family:Tahoma;
- font-size:8pt;
-}
-
-.dhx_mini_calendar{
- -moz-box-shadow:5px 5px 5px #888; /*Doesn't work in IE*/
- -khtml-box-shadow: 5px 5px 5px #888;
-}
-
-.dhx_mini_calendar .dhx_month_head{
- cursor:pointer;
-}
-.dhx_mini_calendar .dhx_calendar_click{
- background-color: #C2D5FC;
-}
-.dhx_cal_navline div.dhx_minical_icon{
- width:18px;
- height:18px;
- left:190px;
- top:1px;
- cursor:pointer;
- background-image:url(./imgs/calendar.gif);
-}
-
-.dhx_matrix_scell {
- height: 100%;
-}
-
-.dhx_matrix_cell, .dhx_matrix_scell{
- overflow:hidden;
- text-align:center;
- vertical-align:middle;
- border-bottom:1px dotted #8894A3;
- border-right:1px dotted #8894A3;
-}
-.dhx_matrix_cell{
- background-color:white;
-}
-.dhx_matrix_line{
- overflow: hidden;
-}
-.dhx_matrix_cell div, .dhx_matrix_scell div{
- overflow:hidden;
- text-align:center;
- height:auto;
-}
-
-.dhx_cal_lsection .dhx_readonly{
- font-size:9pt;
- font-size:8pt;
- padding:2px;
- color:#887A2E;
-}
-
-/* Tree view */
-.dhx_matrix_scell.folder, .dhx_data_table.folder .dhx_matrix_cell{
- background-color: #969394;
- cursor: pointer;
-}
-.dhx_matrix_scell .dhx_scell_level0{
- padding-left: 5px;
-}
-.dhx_matrix_scell .dhx_scell_level1{
- padding-left: 20px;
-}
-.dhx_matrix_scell .dhx_scell_level2{
- padding-left: 35px;
-}
-.dhx_matrix_scell .dhx_scell_level3{
- padding-left: 50px;
-}
-.dhx_matrix_scell .dhx_scell_level4{
- padding-left: 65px;
-}
-
-.dhx_matrix_scell.folder{
- font-weight: bold;
- text-align: left;
-}
-.dhx_matrix_scell.folder .dhx_scell_expand{
- float: left;
- width: 10px;
- padding-right:3px;
-}
-.dhx_matrix_scell.folder .dhx_scell_name{
- float: left;
- width: auto;
-}
-.dhx_matrix_scell.item .dhx_scell_name{
- padding-left:15px;
- text-align: left;
-}
-.dhx_data_table.folder .dhx_matrix_cell{
- border-right: 0;
-}
-.dhx_section_timeline {
- overflow: hidden;
- padding: 4px 0 2px 10px;
-}
-.dhx_section_timeline select{
- width: 552px;
-}
-
-/* Tree view end*/
-
-/* Map view */
-.dhx_map_area{
- width:100%;
- height:100%;
- overflow-y: auto;
- overflow-x: hidden;
- background-image:url(./imgs/databg.png);
-}
-.dhx_map_line .dhx_event_icon{
- width:20px;
- border-width:0px;
- background:url(./imgs/icon.png) no-repeat;
- background-position: 5px 4px;
- cursor:pointer;
-}
-.dhx_map_line{
- height:21px;
- clear:both;
- overflow:hidden;
-}
-.dhx_map {
- position:absolute;
-}
-.dhx_map_line div{
- float:left;
- border-right:1px dotted #8894A3;
- text-align:center;
- line-height:21px;
- overflow:hidden;
-}
-.dhx_map_line .headline_description{
- float:left;
-
- border-right:1px dotted #8894A3;
- text-align:center;
- line-height:21px;
- overflow:hidden;
-}
-.dhx_map_line .dhx_map_description{
- float:left;
- border-right: 0 dotted #8894A3;
- text-align:center;
- line-height:21px;
- overflow:hidden;
-}
-.dhx_map_line .line_description{
- float:left;
- border-right:1px dotted #8894A3;
- text-align:left;
- padding-left:5px;
- line-height:21px;
- overflow:hidden;
-}
-.dhx_map_line.highlight{
- background-color: #C4C5CC;
-}
-.dhx_map_area .dhx_map_line div{
- border-right:0px dotted #8894A3;
-}
-/* Map view end */
-
-/* dhtmlXTooltip start */
-.dhtmlXTooltip.tooltip{
- -moz-box-shadow:3px 3px 3px #888888;
- -webkit-box-shadow:3px 3px 3px #888888;
- -o-box-shadow:3px 3px 3px #888888;
- box-shadow:3px 3px 3px #888888;
- filter:
- progid:DXImageTransform.Microsoft.Shadow(color='#888888', Direction=135, Strength=5)
- ;
- background-color:white;
- border-left:1px dotted #887A2E;
- border-top:1px dotted #887A2E;
- color:#887A2E;
- cursor:default;
- padding:10px;
- position:absolute;
- z-index:500;
-}
-/* dhtmlXTooltip end */
-
-/* Lightbox checkbox section */
-.dhx_cal_checkbox label {
- padding-left: 5px;
-}
-/* Lightbox checkbox section end */
-
-
-/* Lightbox radiobuttons section */
-.dhx_cal_light .radio {
- padding: 2px 0px 2px 10px;
-}
-.dhx_cal_light .radio input, .dhx_cal_light .radio label{
- line-height: 15px;
-}
-.dhx_cal_light .radio input {
- vertical-align: middle;
- margin: 0px;
- padding: 0px;
-}
-.dhx_cal_light .radio label {
- vertical-align: middle;
- padding-right: 10px;
-}
-/* Lightbox radiobuttons section end */
-
-
-/* Lightbox dhtmlx combo section */
-.dhx_cal_light .combo {
- padding: 4px;
-}
-/* Lightbox dhtmlx combo section end */
-
-/* Agenda week start */
-.dhx_wa_column {
- float: left;
-}
-.dhx_wa_column_last .dhx_wa_day_cont{
- border-left: 1px dotted #8894A3;
-}
-.dhx_wa_scale_bar {
- font-family: Tahoma;
- padding-left: 10px;
- font-size: 11px;
- border-top: 1px dotted #8894A3;
- border-bottom: 1px dotted #8894A3;
-}
-.dhx_wa_day_data {
- background-color: #FCFEFC;
- overflow-y: auto;
-}
-.dhx_wa_ev_body {
- border-bottom: 1px dotted #778899;
- font-size: 12px;
- padding: 5px 0 5px 7px;
-}
-.dhx_wa_dnd {
- font-family: Tahoma;
- position: absolute;
- padding-right: 7px;
- color: #887AE2 !important;
- background-color: #FFE763 !important;
- border: 1px solid #B7A543;
-}
-.dhx_cal_event_selected{
- background-color: #9cc1db;
- color: white;
-}
-/* Agenda week end */
-
-/* timeline second scale start */
-.dhx_second_scale_bar {
- border-bottom: 1px dotted #586A7E;
- padding-top: 2px;
-}
-/* timeline second scale end */
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_active_links.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_active_links.js new file mode 100644 index 00000000000..3a2af4ecb93 --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_active_links.js @@ -0,0 +1,28 @@ +/* +This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in non-GPL project. Please contact sales@dhtmlx.com for details +*/ +scheduler.config.active_link_view = "day";
+scheduler.attachEvent("onTemplatesReady", function() {
+ var s_d = scheduler.date.str_to_date(scheduler.config.api_date);
+ var d_s = scheduler.date.date_to_str(scheduler.config.api_date);
+
+ var month_x = scheduler.templates.month_day;
+ scheduler.templates.month_day = function(date) {
+ return "<a jump_to='" + d_s(date) + "' href='#'>" + month_x(date) + "</a>";
+ };
+ var week_x = scheduler.templates.week_scale_date;
+ scheduler.templates.week_scale_date = function(date) {
+ return "<a jump_to='" + d_s(date) + "' href='#'>" + week_x(date) + "</a>";
+ };
+ dhtmlxEvent(this._obj, "click", function(e) {
+ var start = e.target || event.srcElement;
+ var to = start.getAttribute("jump_to");
+ if (to) {
+ scheduler.setCurrentView(s_d(to), scheduler.config.active_link_view);
+ if (e && e.preventDefault)
+ e.preventDefault();
+ return false;
+ }
+ })
+});
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_agenda_view.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_agenda_view.js index 08d06e0e644..ff93a8876fe 100644 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_agenda_view.js +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_agenda_view.js @@ -1,15 +1,11 @@ /* This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details +to use it in non-GPL project. Please contact sales@dhtmlx.com for details */ scheduler.date.add_agenda = function(date){
- return (new Date(date.valueOf()));
+ return scheduler.date.add(date, 1, "year");
};
-scheduler.dblclick_dhx_agenda_area=function(){
- if (!this.config.readonly && this.config.dblclick_create)
- this.addEventNow();
-};
scheduler.templates.agenda_time = function(start,end,ev){
if (ev._timed)
return this.day_date(ev.start_date, ev.end_date, ev)+" "+this.event_date(start);
@@ -19,41 +15,46 @@ scheduler.templates.agenda_time = function(start,end,ev){ scheduler.templates.agenda_text = function(start,end,event){
return event.text;
};
-scheduler.date.agenda_start=function(d){ return d; };
-
-scheduler.attachEvent("onTemplatesReady",function(){
-
+scheduler.templates.agenda_date = function(){ return ""; };
+scheduler.date.agenda_start=function(){ return scheduler.date.date_part(new Date()); };
+scheduler.attachEvent("onTemplatesReady",function() {
+ var old_dblclick_dhx_cal_data = scheduler.dblclick_dhx_cal_data;
+ scheduler.dblclick_dhx_cal_data = function() {
+ if (this._mode == "agenda") {
+ if (!this.config.readonly && this.config.dblclick_create)
+ this.addEventNow();
+ } else {
+ if (old_dblclick_dhx_cal_data)
+ return old_dblclick_dhx_cal_data.apply(this, arguments);
+ }
+ };
scheduler.attachEvent("onSchedulerResize",function(){
- if (this._mode == "agenda"){
- this.agenda_view(true);
- return false;
- }
- return true;
+ if (this._mode == "agenda"){
+ this.agenda_view(true);
+ return false;
+ }
+ return true;
});
var old = scheduler.render_data;
scheduler.render_data=function(evs){
if (this._mode == "agenda")
- fill_agenda_tab();
- else
- return old.apply(this,arguments);
- }
+ fill_agenda_tab();
+ else
+ return old.apply(this,arguments);
+ };
var old_render_view_data = scheduler.render_view_data;
- scheduler.render_view_data=function(){
+ scheduler.render_view_data = function(){
if(this._mode == "agenda") {
scheduler._agendaScrollTop = scheduler._els["dhx_cal_data"][0].childNodes[0].scrollTop;
scheduler._els["dhx_cal_data"][0].childNodes[0].scrollTop = 0;
- scheduler._els["dhx_cal_data"][0].style.overflowY = 'hidden';
- }
- else {
- scheduler._els["dhx_cal_data"][0].style.overflowY = 'auto';
}
return old_render_view_data.apply(this,arguments);
- }
+ };
function set_full_view(mode){
@@ -77,9 +78,10 @@ scheduler.attachEvent("onTemplatesReady",function(){ var html="<div class='dhx_agenda_area'>";
for (var i=0; i<events.length; i++){
var ev = events[i];
- var bg_color = (ev.color?("background-color:"+ev.color+";"):"");
- var color = (ev.textColor?("color:"+ev.textColor+";"):"");
- html+="<div class='dhx_agenda_line' event_id='"+ev.id+"' style='"+color+""+bg_color+""+(ev._text_style||"")+"'><div>"+scheduler.templates.agenda_time(ev.start_date, ev.end_date,ev)+"</div>";
+ var bg_color = (ev.color?("background:"+ev.color+";"):"");
+ var color = (ev.textColor?("color:"+ev.textColor+";"):"");
+ var ev_class = scheduler.templates.event_class(ev.start_date, ev.end_date, ev);
+ html+="<div class='dhx_agenda_line"+(ev_class?' '+ev_class:'')+"' event_id='"+ev.id+"' style='"+color+""+bg_color+""+(ev._text_style||"")+"'><div class='dhx_agenda_event_time'>"+scheduler.templates.agenda_time(ev.start_date, ev.end_date,ev)+"</div>";
html+="<div class='dhx_event_icon icon_details'> </div>";
html+="<span>"+scheduler.templates.agenda_text(ev.start_date, ev.end_date, ev)+"</span></div>";
}
@@ -88,9 +90,14 @@ scheduler.attachEvent("onTemplatesReady",function(){ //render html
scheduler._els["dhx_cal_data"][0].innerHTML = html;
scheduler._els["dhx_cal_data"][0].childNodes[0].scrollTop = scheduler._agendaScrollTop||0;
+
+ // setting up dhx_v_border size
+ var agenda_area = scheduler._els["dhx_cal_data"][0].childNodes[0];
+ var v_border = agenda_area.childNodes[agenda_area.childNodes.length-1];
+ v_border.style.height = (agenda_area.offsetHeight < scheduler._els["dhx_cal_data"][0].offsetHeight) ? "100%" : (agenda_area.offsetHeight+"px");
var t=scheduler._els["dhx_cal_data"][0].firstChild.childNodes;
- scheduler._els["dhx_cal_date"][0].innerHTML="";
+ scheduler._els["dhx_cal_date"][0].innerHTML=scheduler.templates.agenda_date(scheduler._min_date, scheduler._max_date, scheduler._mode);
scheduler._rendered=[];
for (var i=0; i < t.length-1; i++)
@@ -99,8 +106,8 @@ scheduler.attachEvent("onTemplatesReady",function(){ }
scheduler.agenda_view=function(mode){
- scheduler._min_date = scheduler.config.agenda_start||(new Date());
- scheduler._max_date = scheduler.config.agenda_end||(new Date(9999,1,1));
+ scheduler._min_date = scheduler.config.agenda_start||scheduler.date.agenda_start(scheduler._date);
+ scheduler._max_date = scheduler.config.agenda_end||scheduler.date.add_agenda(scheduler._min_date, 1);
scheduler._table_view = true;
set_full_view(mode);
if (mode){
@@ -110,4 +117,4 @@ scheduler.attachEvent("onTemplatesReady",function(){ //agenda tab de-activated
}
}
-})
+});
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_all_timed.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_all_timed.js new file mode 100644 index 00000000000..30d1d7066ef --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_all_timed.js @@ -0,0 +1,133 @@ +/* +This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in non-GPL project. Please contact sales@dhtmlx.com for details +*/ +(function(){
+
+ scheduler.config.all_timed = "short";
+ scheduler.config.update_render = true;
+
+ var is_event_short = function (ev) {
+ return !((ev.end_date - ev.start_date)/(1000*60*60) >= 24);
+ };
+
+ var old_prerender_events_line = scheduler._pre_render_events_line;
+ scheduler._pre_render_events_line = function(evs, hold){
+ if (!this.config.all_timed)
+ return old_prerender_events_line.call(this, evs, hold);
+
+ for (var i=0; i < evs.length; i++) {
+ var ev=evs[i];
+
+ if (!ev._timed) {
+
+ if (this.config.all_timed == "short") {
+ if (!is_event_short(ev)) {
+ evs.splice(i--,1);
+ continue;
+ }
+ }
+
+ var ce = this._lame_copy({}, ev); // current event (event for one specific day) is copy of original with modified dates
+
+ ce.start_date = new Date(ce.start_date); // as lame copy doesn't copy date objects
+
+ var next_day = scheduler.date.add(ev.start_date, 1, "day");
+ next_day = scheduler.date.date_part(next_day);
+
+ if (ev.end_date < next_day) {
+ ce.end_date = new Date(ev.end_date);
+ }
+ else {
+ ce.end_date = next_day;
+ if (this.config.last_hour != 24) { // if specific last_hour was set (e.g. 20)
+ ce.end_date = scheduler.date.date_part(new Date(ce.start_date));
+ ce.end_date.setHours(this.config.last_hour);
+ }
+ }
+
+ var event_changed = false;
+ if (ce.start_date < this._max_date && ce.end_date > this._min_date && ce.start_date < ce.end_date) {
+ evs[i] = ce; // adding another event in collection
+ event_changed = true;
+ }
+ if (ce.start_date > ce.end_date) {
+ evs.splice(i--,1);
+ }
+
+ var re = this._lame_copy({}, ev); // remaining event, copy of original with modified start_date (making range more narrow)
+ re.end_date = new Date(re.end_date);
+ if (re.start_date < this._min_date)
+ re.start_date = new Date(this._min_date);
+ else
+ re.start_date = this.date.add(ev.start_date, 1, "day");
+
+ re.start_date.setHours(this.config.first_hour);
+ re.start_date.setMinutes(0); // as we are starting only with whole hours
+ if (re.start_date < this._max_date && re.start_date < re.end_date) {
+ if (event_changed)
+ evs.splice(i+1,0,re);
+ else {
+ evs[i--] = re;
+ continue;
+ }
+ }
+ }
+ }
+ // in case of all_timed pre_render is not applied to the original event
+ // so we need to force redraw in case of dnd
+ var redraw = (this._drag_mode == 'move')?false:hold;
+ return old_prerender_events_line.call(this, evs, redraw);
+ };
+ var old_get_visible_events = scheduler.get_visible_events;
+ scheduler.get_visible_events = function(only_timed){
+ if (!this.config.all_timed)
+ return old_get_visible_events.call(this, only_timed);
+ return old_get_visible_events.call(this, false); // only timed = false
+ };
+ scheduler.attachEvent("onBeforeViewChange", function (old_mode, old_date, mode, date) {
+ scheduler._allow_dnd = (mode == "day" || mode == "week");
+ return true;
+ });
+
+ scheduler.render_view_data=function(evs, hold){
+ if(!evs){
+ if (this._not_render) {
+ this._render_wait=true;
+ return;
+ }
+ this._render_wait=false;
+
+ this.clear_view();
+ evs=this.get_visible_events( !(this._table_view || this.config.multi_day) );
+ }
+
+ if (this.config.multi_day && !this._table_view){
+
+ var tvs = [];
+ var tvd = [];
+ for (var i=0; i < evs.length; i++){
+ if (evs[i]._timed || this.config.all_timed === true || (this.config.all_timed == "short" && is_event_short(evs[i])) )
+ tvs.push(evs[i]);
+ else
+ tvd.push(evs[i]);
+ }
+
+ // normal events
+ this._rendered_location = this._els['dhx_cal_data'][0];
+ this._table_view=false;
+ this.render_data(tvs, hold);
+
+ // multiday events
+ this._rendered_location = this._els['dhx_multi_day'][0];
+ this._table_view = true;
+ this.render_data(tvd, hold);
+ this._table_view=false;
+
+ } else {
+ this._rendered_location = this._els['dhx_cal_data'][0];
+ this.render_data(evs, hold);
+ }
+ };
+
+})();
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_collision.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_collision.js index e1e5d0fb52f..700b8de19ed 100644 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_collision.js +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_collision.js @@ -1,6 +1,6 @@ /* This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details +to use it in non-GPL project. Please contact sales@dhtmlx.com for details */ (function(){
@@ -40,23 +40,25 @@ scheduler.attachEvent("onEventChanged",function(id){ ev.start_date = before[0];
ev.end_date = before[1];
ev._timed=this.is_one_day_event(ev);
- };
+ }
return true;
});
scheduler.attachEvent("onBeforeEventChanged",function(ev,e,is_new){
return collision_check(ev);
});
-scheduler.attachEvent("onEventSave",function(id, edited_ev){
+scheduler.attachEvent("onEventSave",function(id, edited_ev, is_new){
+ edited_ev = scheduler._lame_clone(edited_ev);
+ edited_ev.id = id;
+
if(edited_ev.rec_type){
- scheduler._roll_back_dates(edited_ev);
- return collision_check(edited_ev);
+ scheduler._roll_back_dates(data_copy);
}
- return true;
- //return collision_check(edited_ev);
+ return collision_check(edited_ev); // in case user creates event on one date but then edited it another
});
function collision_check(ev){
var evs = [];
+ var collision_limit = scheduler.config.collision_limit;
if (ev.rec_type) {
var evs_dates = scheduler.getRecDates(ev);
for(var k=0; k<evs_dates.length; k++) {
@@ -66,9 +68,14 @@ function collision_check(ev){ evs.push(tevs[j]);
}
}
- evs.push(ev);
} else {
evs = scheduler.getEvents(ev.start_date, ev.end_date);
+ for (var i=0; i<evs.length; i++) {
+ if (evs[i].id == ev.id) {
+ evs.splice(i,1);
+ break;
+ }
+ }
}
var pr = scheduler._props?scheduler._props[scheduler._mode]:null;
@@ -89,16 +96,22 @@ function collision_check(ev){ if (evs[i][map_to] == ev[map_to] && evs[i].id != ev.id)
count++;
- if (count >= scheduler.config.collision_limit) {
- ev[map_to] = temp_section; // from _setTempSection for custom views
+ if (count >= collision_limit) {
+
single = false;
}
}
else {
- if (evs.length > scheduler.config.collision_limit)
+ if ( evs.length >= collision_limit )
single = false;
}
- if (!single) return !scheduler.callEvent("onEventCollision",[ev,evs]);
+ if (!single) {
+ var res = !scheduler.callEvent("onEventCollision",[ev,evs]);
+ if (!res) {
+ ev[map_to] = temp_section||ev[map_to]; // from _setTempSection for custom views
+ }
+ return res;
+ }
return single;
}
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_cookie.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_cookie.js index 71f1d5e6794..f989ee8ddc5 100644 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_cookie.js +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_cookie.js @@ -1,6 +1,6 @@ /* This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details +to use it in non-GPL project. Please contact sales@dhtmlx.com for details */ (function(){
function setCookie(name,cookie_param,value) {
@@ -27,13 +27,15 @@ to use it in not GPL project. Please contact sales@dhtmlx.com for details first = false;
var data=getCookie("scheduler_settings");
if (data){
- data = data.split("@");
+ data = unescape(data).split("@");
data[0] = this.templates.xml_date(data[0]);
- this.setCurrentView(data[0],data[1]);
+ window.setTimeout(function(){
+ scheduler.setCurrentView(data[0],data[1]);
+ },1);
return false;
}
}
- var text = this.templates.xml_format(d||od)+"@"+(m||om);
+ var text = escape(this.templates.xml_format(d||od)+"@"+(m||om));
setCookie("scheduler_settings","expires=Sun, 31 Jan 9999 22:00:00 GMT",text);
return true;
});
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_dhx_terrace.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_dhx_terrace.js new file mode 100644 index 00000000000..613741bac43 --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_dhx_terrace.js @@ -0,0 +1,90 @@ +/* +This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in non-GPL project. Please contact sales@dhtmlx.com for details +*/ +(function(){
+
+ scheduler.config.fix_tab_position = true;
+ scheduler.config.use_select_menu_space = true;
+ scheduler.config.hour_size_px = 44;
+ scheduler.xy.nav_height = 59;
+ scheduler.xy.bar_height = 24;
+ scheduler.config.wide_form = true;
+ scheduler.xy.lightbox_additional_height = 90;
+
+ scheduler.config.displayed_event_color = "#ff4a4a";
+ scheduler.config.displayed_event_text_color = "#ffef80";
+
+ scheduler.templates.event_bar_date = function(start,end,ev) {
+ return "• <b>"+scheduler.templates.event_date(start)+"</b> ";
+ };
+
+ scheduler.attachEvent("onLightbox", function(){
+ var lightbox = scheduler.getLightbox();
+ var divs = lightbox.getElementsByTagName('div');
+ for (var i=0; i<divs.length; i++) {
+ var div = divs[i];
+ if (div.className == "dhx_close_icon") {
+ div.onclick = function() {
+ scheduler.endLightbox(false, lightbox);
+ };
+ break;
+ }
+ }
+ });
+
+ scheduler._lightbox_template="<div class='dhx_cal_ltitle'><span class='dhx_mark'> </span><span class='dhx_time'></span><span class='dhx_title'></span><div class='dhx_close_icon'></div></div><div class='dhx_cal_larea'></div>";
+
+ scheduler.attachEvent("onTemplatesReady", function() {
+
+ var date_to_str = scheduler.date.date_to_str("%d");
+ var old_month_day = scheduler.templates.month_day;
+ scheduler.templates.month_day = function(date) {
+ if (this._mode == "month") {
+ var label = date_to_str(date);
+ if (date.getDate() == 1) {
+ label = scheduler.locale.date.month_full[date.getMonth()] + " " + label;
+ }
+ if (+date == +scheduler.date.date_part(new Date)) {
+ label = scheduler.locale.labels.dhx_cal_today_button + " " + label;
+ }
+ return label;
+ } else {
+ return old_month_day.call(this, date);
+ }
+ };
+
+ if (scheduler.config.fix_tab_position){
+ var navline_divs = scheduler._els["dhx_cal_navline"][0].getElementsByTagName('div');
+ var tabs = [];
+ var last = 211;
+ for (var i=0; i<navline_divs.length; i++) {
+ var div = navline_divs[i];
+ var name = div.getAttribute("name");
+ if (name) { // mode tab
+ div.style.right = "auto";
+ switch (name) {
+ case "day_tab":
+ div.style.left = "14px";
+ div.className += " dhx_cal_tab_first";
+ break;
+ case "week_tab":
+ div.style.left = "75px";
+ break;
+ case "month_tab":
+ div.style.left = "136px";
+ div.className += " dhx_cal_tab_last";
+ break;
+ default:
+ div.style.left = last+"px";
+ div.className += " dhx_cal_tab_standalone";
+ last = last + 14 + div.offsetWidth;
+ }
+ }
+
+ }
+ }
+ });
+
+})();
+
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_editors.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_editors.js index e76eff631f4..5fe44741ec7 100644 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_editors.js +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_editors.js @@ -1,11 +1,13 @@ /* This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details +to use it in non-GPL project. Please contact sales@dhtmlx.com for details */ scheduler.form_blocks['combo']={
render:function(sns) {
+ if (!sns.cached_options)
+ sns.cached_options = {};
var res = '';
- res += "<div class='"+sns.type+"' style='height:"+(sns.height||20)+"px;' ></div>";
+ res += "<div class='"+sns.type+"' style='height:"+(sns.height||20)+"px;' ></div>";
return res;
},
set_value:function(node,value,ev,config){
@@ -13,8 +15,11 @@ scheduler.form_blocks['combo']={ node._combo.destructor();
}
window.dhx_globalImgPath = config.image_path||'/';
- node._combo = new dhtmlXCombo(node, config.name, node.offsetWidth-8);
- node._combo.enableFilteringMode(!!config.filtering, config.script_path||null, !!config.cache);
+ node._combo = new dhtmlXCombo(node, config.name, node.offsetWidth-8);
+ if (config.options_height)
+ node._combo.setOptionHeight(config.options_height);
+ var combo = node._combo;
+ combo.enableFilteringMode(!!config.filtering, config.script_path||null, !!config.cache);
if (!config.script_path) { // script-side filtration is used
var all_options = [];
@@ -24,17 +29,40 @@ scheduler.form_blocks['combo']={ single_option.push(config.options[i].label);
all_options.push(single_option);
}
- node._combo.addOption(all_options);
+ combo.addOption(all_options);
if (ev[config.map_to]) {
- var index = node._combo.getIndexByValue(ev[config.map_to]);
- node._combo.selectOption(index);
+ var index = combo.getIndexByValue(ev[config.map_to]);
+ combo.selectOption(index);
}
} else { // server-side filtration is used
- node._combo.setComboValue(ev[config.map_to]||null);
+ var selected_id = ev[config.map_to];
+ if (selected_id) {
+ if (config.cached_options[selected_id]) {
+ combo.addOption(selected_id, config.cached_options[selected_id]);
+ combo.disable(1);
+ combo.selectOption(0);
+ combo.disable(0);
+ } else {
+ dhtmlxAjax.get(config.script_path+"?id="+selected_id+"&uid="+scheduler.uid(), function(result){
+ var option = result.doXPath("//option")[0];
+ var label = option.childNodes[0].nodeValue;
+ config.cached_options[selected_id] = label;
+ combo.addOption(selected_id, label);
+ combo.disable(1);
+ combo.selectOption(0);
+ combo.disable(0);
+ });
+ }
+ } else {
+ combo.setComboValue(null);
+ }
}
},
- get_value:function(node,ev,config){
+ get_value:function(node,ev,config) {
var selected_id = node._combo.getSelectedValue(); // value = key
+ if (config.script_path) {
+ config.cached_options[selected_id] = node._combo.getSelectedText();
+ }
return selected_id;
},
focus:function(node){
@@ -59,7 +87,8 @@ scheduler.form_blocks['radio']={ var radiobuttons = node.getElementsByTagName('input');
for (var i = 0; i < radiobuttons.length; i++) {
radiobuttons[i].checked = false;
- if (radiobuttons[i].value == ev[config.map_to]) {
+ var checked_value = ev[config.map_to]||value;
+ if (radiobuttons[i].value == checked_value) {
radiobuttons[i].checked = true;
}
}
@@ -84,12 +113,9 @@ scheduler.form_blocks['checkbox']={ return '';
},
set_value:function(node,value,ev,config){
- node=document.getElementById(config.id);
+ node=document.getElementById(config.id);
var id = scheduler.uid();
- var isChecked = false;
- if (typeof config.checked_value != 'undefined' && ev[config.map_to] == config.checked_value) {
- isChecked = true;
- }
+ var isChecked = (typeof config.checked_value != "undefined") ? ev[config.map_to] == config.checked_value : !!value;
node.className += " dhx_cal_checkbox";
var check_html = "<input id='"+id+"' type='checkbox' value='true' name='"+config.name+"'"+((isChecked)?"checked='true'":'')+"'>";
var label_html = "<label for='"+id+"'>"+(scheduler.locale.labels["section_"+config.name]||config.name)+"</label>";
@@ -98,9 +124,14 @@ scheduler.form_blocks['checkbox']={ node.nextSibling.innerHTML=check_html;
} else
node.innerHTML=check_html+label_html;
+
+ if (config.handler) {
+ var checkbox = node.getElementsByTagName('input')[0];
+ checkbox.onclick = config.handler;
+ }
},
get_value:function(node,ev,config){
- node=document.getElementById(config.id);
+ node=document.getElementById(config.id);
var checkbox = node.getElementsByTagName('input')[0]; // moved to the header
if (!checkbox)
checkbox = node.nextSibling.getElementsByTagName('input')[0];
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_expand.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_expand.js index 5e916128cf9..1f00aa4e5ab 100644 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_expand.js +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_expand.js @@ -1,6 +1,6 @@ /* This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details +to use it in non-GPL project. Please contact sales@dhtmlx.com for details */ scheduler.expand = function(){
var t = scheduler._obj;
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_grid_view.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_grid_view.js new file mode 100644 index 00000000000..a25199a7c4f --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_grid_view.js @@ -0,0 +1,470 @@ +/* +This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in non-GPL project. Please contact sales@dhtmlx.com for details +*/ +(function(){
+ scheduler.grid = {
+ sort_rules:{
+ "int":function(a,b, getVal){ return getVal(a)*1 < getVal(b)*1?1:-1},
+ "str":function(a,b, getVal){ return getVal(a) < getVal(b)?1:-1},
+ "date":function(a,b, getVal){ return new Date(getVal(a))< new Date(getVal(b))?1:-1}
+ },
+ _getObjName:function(name){
+ return "grid_"+name;
+ },
+ _getViewName:function(objName){
+ return objName.replace(/^grid_/,'');
+ }
+ };
+}
+)();
+/*
+obj={
+ name:'grid_name'
+ fields:[
+ { id:"id", label:"Id", width:80, sort:"int/date/str", template:function(start_date, end_date, ev){ return ""}, align:"right/left/center" },
+ { id:"text", label:"Text", width:'*', css:"class_name", sort:function(a,b){ return 1 or -1}, valign:'top/bottom/middle' }
+ ...
+ ],
+ from:new Date(0),
+ to:Date:new Date(9999,1,1),
+ rowHeight:int,
+ paging:true/false,
+ select:true/false
+}
+*/
+
+
+scheduler.createGridView=function(obj){
+
+ var name = obj.name || 'grid';
+ var objName = scheduler.grid._getObjName(name);
+
+ scheduler.config[name + '_start'] = obj.from ||(new Date(0));
+ scheduler.config[name + '_end'] = obj.to || (new Date(9999,1,1));
+
+ scheduler[objName] = obj;
+ scheduler[objName].defPadding = 8;
+ scheduler[objName].columns = scheduler[objName].fields;
+ delete scheduler[objName].fields;
+ function isValidSize(size){
+ return !(size !== undefined && (size*1 != size || size < 0));
+ }
+
+ var cols = scheduler[objName].columns;
+ for(var i=0; i < cols.length; i++){
+ if(isValidSize(cols[i].width))
+ cols[i].initialWidth = cols[i].width;
+ if(!isValidSize(cols[i].paddingLeft))
+ delete cols[i].paddingLeft;
+ if(!isValidSize(cols[i].paddingRight))
+ delete cols[i].paddingRight;
+ }
+
+ scheduler[objName].select = obj.select === undefined ? true : obj.select;
+ if(scheduler.locale.labels[name +'_tab'] === undefined)
+ scheduler.locale.labels[name +'_tab'] = scheduler[objName].label || scheduler.locale.labels.grid_tab;
+
+ scheduler[objName]._selected_divs = [];
+
+ scheduler.date[name+'_start']=function(d){ return d; };
+ scheduler.date['add_' + name] = function(date, inc){
+ var ndate = new Date(date);
+ ndate.setMonth(ndate.getMonth()+inc);
+ return ndate;
+ };
+
+ scheduler.templates[name+"_date"] = function(start, end){
+ return scheduler.templates.day_date(start)+" - "+scheduler.templates.day_date(end)
+ }
+
+ scheduler.attachEvent("onTemplatesReady",function(){
+
+ scheduler.templates[name + '_full_date'] = function(start,end,ev){
+ if (ev._timed)
+ return this.day_date(ev.start_date, ev.end_date, ev)+" "+this.event_date(start);
+ else
+ return scheduler.templates.day_date(start)+" – "+scheduler.templates.day_date(end);
+ };
+ scheduler.templates[name + '_single_date'] = function(date){
+ return scheduler.templates.day_date(date)+" "+this.event_date(date);
+ }
+
+
+ scheduler.attachEvent("onDblClick",function(event_id, native_event_object){
+ if(this._mode == name){
+ scheduler._click.buttons['details'](event_id)
+ return false;
+ }
+ return true;
+ });
+
+ scheduler.attachEvent("onClick",function(event_id, native_event_object){
+ if(this._mode == name && scheduler[objName].select ){
+ scheduler.grid.unselectEvent('', name);
+ scheduler.grid.selectEvent(event_id, name, native_event_object);
+ return false;
+ }
+ return true;
+ });
+
+
+ scheduler.templates[name + '_field'] = function(field_name, event){
+ return event[field_name];
+ };
+
+ scheduler.attachEvent("onSchedulerResize", function() {
+ if (this._mode == name) {
+ this[name + '_view'](true);
+ // timeout used to run code after all onSchedulerResize handlers are finished
+ window.setTimeout(function(){
+ // we need to call event manually because handler return false, and blocks default logic
+ scheduler.callEvent("onAfterSchedulerResize", []);
+ },1);
+ return false;
+ }
+ return true;
+ });
+
+
+ var old = scheduler.render_data;
+ scheduler.render_data=function(evs){
+ if (this._mode == name)
+ scheduler.grid._fill_grid_tab(objName);
+ else
+ return old.apply(this,arguments);
+ };
+
+ var old_render_view_data = scheduler.render_view_data;
+ scheduler.render_view_data=function(){
+ if(this._mode == name) {
+ scheduler.grid._gridScrollTop = scheduler._els["dhx_cal_data"][0].childNodes[0].scrollTop;
+ scheduler._els["dhx_cal_data"][0].childNodes[0].scrollTop = 0;
+ scheduler._els["dhx_cal_data"][0].style.overflowY = 'auto';
+ }
+ else {
+ scheduler._els["dhx_cal_data"][0].style.overflowY = 'auto';
+ }
+ return old_render_view_data.apply(this,arguments);
+ }
+});
+
+
+ scheduler[name+'_view']=function(mode){
+ if (mode){
+ scheduler._min_date = scheduler[objName].paging ? scheduler.date[name+'_start'](new Date(scheduler._date)) : scheduler.config[name + '_start'];
+ scheduler._max_date = scheduler[objName].paging ? scheduler.date.add(scheduler._min_date, 1, name) : scheduler.config[name + '_end'];
+
+ scheduler.grid.set_full_view(objName);
+ if(scheduler._min_date > new Date(0) && scheduler._max_date < (new Date(9999,1,1)))
+ scheduler._els["dhx_cal_date"][0].innerHTML=scheduler.templates[name+"_date"](scheduler._min_date,scheduler._max_date);
+ else
+ scheduler._els["dhx_cal_date"][0].innerHTML="";
+
+ //grid tab activated
+ scheduler.grid._fill_grid_tab(objName);
+ scheduler._gridView = objName;
+ } else {
+ scheduler.grid._sort_marker = null;
+ delete scheduler._gridView;
+ scheduler._rendered=[];
+ scheduler[objName]._selected_divs = [];
+ //grid tab de-activated
+ }
+ };
+
+
+}
+
+
+scheduler.dblclick_dhx_grid_area=function(){
+ if (!this.config.readonly && this.config.dblclick_create)
+ this.addEventNow();
+};
+
+if(scheduler._click.dhx_cal_header){
+ scheduler._old_header_click = scheduler._click.dhx_cal_header;
+}
+scheduler._click.dhx_cal_header=function(e){
+ if(scheduler._gridView){
+ var event = e||window.event;
+ var params = scheduler.grid.get_sort_params(event, scheduler._gridView);
+
+ scheduler.grid.draw_sort_marker(event.originalTarget || event.srcElement, params.dir);
+
+ scheduler.clear_view();
+ scheduler.grid._fill_grid_tab(scheduler._gridView, params);
+ }
+ else if(scheduler._old_header_click)
+ return scheduler._old_header_click.apply(this,arguments);
+};
+
+scheduler.grid.selectEvent = function(id, view_name, native_event_object){
+ if(scheduler.callEvent("onBeforeRowSelect",[id,native_event_object])){
+ var objName = scheduler.grid._getObjName(view_name);
+
+ scheduler.for_rendered(id, function(event_div){
+ event_div.className += " dhx_grid_event_selected";
+ scheduler[objName]._selected_divs.push(event_div);
+ });
+ scheduler._select_id = id;
+ }
+};
+
+scheduler.grid._unselectDiv= function(div){
+ div.className = div.className.replace(/ dhx_grid_event_selected/,'');
+}
+scheduler.grid.unselectEvent = function(id, view_name){
+ var objName = scheduler.grid._getObjName(view_name);
+ if(!objName || !scheduler[objName]._selected_divs)
+ return;
+
+ if(!id){
+ for(var i=0; i<scheduler[objName]._selected_divs.length; i++)
+ scheduler.grid._unselectDiv(scheduler[objName]._selected_divs[i]);
+
+ scheduler[objName]._selected_divs = [];
+
+ }else{
+ for(var i=0; i<scheduler[objName]._selected_divs.length; i++)
+ if(scheduler[objName]._selected_divs[i].getAttribute('event_id') == id){
+ scheduler.grid._unselectDiv(scheduler[objName]._selected_divs[i]);
+ scheduler[objName]._selected_divs.slice(i,1);
+ break;
+ }
+
+ }
+};
+
+scheduler.grid.get_sort_params = function(event, objName){
+ var targ = event.originalTarget || event.srcElement;
+ if(targ.className == 'dhx_grid_view_sort')
+ targ = targ.parentNode;
+ if(!targ.className || targ.className.indexOf("dhx_grid_sort_asc") == -1)
+ var direction = 'asc';
+ else
+ var direction = 'desc';
+
+ var index = 0;
+ for(var i =0; i < targ.parentNode.childNodes.length; i++){
+ if(targ.parentNode.childNodes[i] == targ){
+ index = i;
+ break;
+ }
+ }
+
+
+
+ var value = null;
+ if(scheduler[objName].columns[index].template){
+ var template = scheduler[objName].columns[index].template
+ value = function(ev){
+ return template(ev.start_date, ev.end_date, ev);
+ };
+ }else{
+ var field = scheduler[objName].columns[index].id;
+ if(field == "date")
+ field = "start_date";
+ value = function(ev){ return ev[field];}
+ }
+
+ var rule = scheduler[objName].columns[index].sort;
+
+ if(typeof rule != 'function'){
+ rule = scheduler.grid.sort_rules[rule] || scheduler.grid.sort_rules['str'];
+ }
+
+ return {dir:direction, value:value, rule:rule};
+};
+
+scheduler.grid.draw_sort_marker = function(node, direction){
+ if(node.className == 'dhx_grid_view_sort')
+ node = node.parentNode;
+
+ if(scheduler.grid._sort_marker){
+ scheduler.grid._sort_marker.className = scheduler.grid._sort_marker.className.replace(/( )?dhx_grid_sort_(asc|desc)/, '');
+ scheduler.grid._sort_marker.removeChild(scheduler.grid._sort_marker.lastChild);
+ }
+
+ node.className += " dhx_grid_sort_"+direction;
+ scheduler.grid._sort_marker = node;
+ var html = "<div class='dhx_grid_view_sort' style='left:"+(+node.style.width.replace('px','') -15+node.offsetLeft)+"px'> </div>";
+ node.innerHTML += html;
+
+};
+
+scheduler.grid.sort_grid=function(sort){
+
+ var sort = sort || {dir:'desc', value:function(ev){return ev.start_date;}, rule:scheduler.grid.sort_rules['date']};
+
+ var events = scheduler.get_visible_events();
+
+ if(sort.dir == 'desc')
+ events.sort(function(a,b){return sort.rule(a,b,sort.value)});
+ else
+ events.sort(function(a,b){return -sort.rule(a,b, sort.value)});
+ return events;
+};
+
+
+
+scheduler.grid.set_full_view = function(mode){
+ if (mode){
+ var l = scheduler.locale.labels;
+ var html =scheduler.grid._print_grid_header(mode);
+
+ scheduler._els["dhx_cal_header"][0].innerHTML= html;
+ scheduler._table_view=true;
+ scheduler.set_sizes();
+ }
+};
+scheduler.grid._calcPadding = function(column, parent){
+ var padding = (column.paddingLeft !== undefined ? 1*column.paddingLeft : scheduler[parent].defPadding)
+ + (column.paddingRight !== undefined ? 1*column.paddingRight : scheduler[parent].defPadding);
+ return padding;
+};
+
+scheduler.grid._getStyles = function(column, items){
+ var cell_style = [], style = "";
+ for(var i=0; items[i]; i++ ){
+ style = items[i] + ":";
+ switch (items[i]){
+ case "text-align":
+ if(column.align)
+ cell_style.push(style+column.align);
+ break;
+ case "vertical-align":
+ if(column.valign)
+ cell_style.push(style+column.valign);
+ break;
+ case "padding-left":
+ if(column.paddingLeft != undefined)
+ cell_style.push(style+(column.paddingLeft||'0') + "px");
+ break;
+ case "padding-left":
+ if(column.paddingRight != undefined)
+ cell_style.push(style+(column.paddingRight||'0') + "px");
+ break;
+ }
+ }
+ return cell_style;
+};
+
+scheduler.grid._fill_grid_tab = function(objName, sort){
+ //get current date
+ var date = scheduler._date;
+ //select events for which data need to be printed
+ var events = scheduler.grid.sort_grid(sort)
+
+ //generate html for the view
+ var columns = scheduler[objName].columns;
+
+ var html = "<div>";
+ var left = -2;//column borders at the same pos as header borders...
+ for(var i=0; i < columns.length; i++){
+ var padding = scheduler.grid._calcPadding(columns[i], objName);
+ left +=columns[i].width + padding ;//
+ if(i < columns.length - 1)
+ html += "<div class='dhx_grid_v_border' style='left:"+(left)+"px'></div>";
+ }
+ html += "</div>"
+ html +="<div class='dhx_grid_area'><table>";
+
+ for (var i=0; i<events.length; i++){
+ html += scheduler.grid._print_event_row(events[i], objName);
+ }
+
+ html +="</table></div>";
+ //render html
+ scheduler._els["dhx_cal_data"][0].innerHTML = html;
+ scheduler._els["dhx_cal_data"][0].scrollTop = scheduler.grid._gridScrollTop||0;
+
+ var t=scheduler._els["dhx_cal_data"][0].getElementsByTagName("tr");
+
+ scheduler._rendered=[];
+ for (var i=0; i < t.length; i++){
+ scheduler._rendered[i]=t[i]
+ }
+
+};
+scheduler.grid._print_event_row = function(ev, objName){
+
+ var styles = [];
+ if(ev.color)
+ styles.push("background:"+ev.color);
+ if(ev.textColor)
+ styles.push("color:"+ev.textColor);
+ if(ev._text_style)
+ styles.push(ev._text_style);
+ if(scheduler[objName]['rowHeight'])
+ styles.push('height:'+scheduler[objName]['rowHeight'] + 'px');
+
+ var style = "";
+ if(styles.length){
+ style = "style='"+styles.join(";")+"'";
+ }
+
+ var columns = scheduler[objName].columns;
+ var ev_class = scheduler.templates.event_class(ev.start_date, ev.end_date, ev);
+
+ var html ="<tr class='dhx_grid_event"+(ev_class? ' '+ev_class:'')+"' event_id='"+ev.id+"' " + style + ">";
+
+ var name = scheduler.grid._getViewName(objName);
+ var availStyles = ["text-align", "vertical-align", "padding-left","padding-right"];
+ for(var i =0; i < columns.length; i++){
+ var value;
+ if(columns[i].template){
+ value = columns[i].template(ev.start_date, ev.end_date, ev);
+ }else if(columns[i].id == 'date') {
+ value = scheduler.templates[name + '_full_date'](ev.start_date, ev.end_date, ev);
+ }else if(columns[i].id == 'start_date' || columns[i].id == 'end_date' ){
+ value = scheduler.templates[name + '_single_date'](ev[columns[i].id]);
+ }else{
+ value = scheduler.templates[name + '_field'](columns[i].id, ev);
+ }
+
+ var cell_style = scheduler.grid._getStyles(columns[i], availStyles);
+
+ var className = columns[i].css ? (" class=\""+columns[i].css+"\"") : "";
+
+ html+= "<td style='width:"+ (columns[i].width )+"px;"+cell_style.join(";")+"' "+className+">"+value+"</td>";
+
+ }
+ html+="<td class='dhx_grid_dummy'></td></tr>";
+
+ return html;
+};
+
+scheduler.grid._print_grid_header = function(objName){
+ var head = "<div class='dhx_grid_line'>";
+
+ var columns = scheduler[objName].columns;
+ var widths = [];
+
+ var unsized_columns = columns.length;
+ var avail_width = scheduler._obj.clientWidth - 2*columns.length -20;//-20 for possible scrollbar, -length for borders
+ for(var ind=0; ind < columns.length; ind++){
+
+ var val = columns[ind].initialWidth*1;
+ if(!isNaN(val) && columns[ind].initialWidth != '' && columns[ind].initialWidth != null && typeof columns[ind].initialWidth != 'boolean'){
+
+ unsized_columns--;
+ avail_width -= val;
+ widths[ind] = val;
+ }else {
+ widths[ind] = null;
+ }
+ }
+
+ var unsized_width = Math.floor(avail_width / unsized_columns);
+ var availStyles = ["text-align", "padding-left","padding-right"];
+ for(var i=0; i < columns.length; i++){
+ var column_width = !widths[i] ? unsized_width : widths[i];
+ columns[i].width = column_width - scheduler.grid._calcPadding(columns[i], objName);
+ var cell_style = scheduler.grid._getStyles(columns[i], availStyles);
+ head += "<div style='width:"+(columns[i].width -1)+"px;"+cell_style.join(";")+"'>" + (columns[i].label === undefined ? columns[i].id : columns[i].label) + "</div>";
+ }
+ head +="</div>";
+
+ return head;
+};
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_html_templates.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_html_templates.js index a5123677c38..89f6a0ca984 100644 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_html_templates.js +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_html_templates.js @@ -1,6 +1,6 @@ /* This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details +to use it in non-GPL project. Please contact sales@dhtmlx.com for details */ scheduler.attachEvent("onTemplatesReady",function(){
var els = document.body.getElementsByTagName("DIV");
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_key_nav.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_key_nav.js new file mode 100644 index 00000000000..087a71cdaec --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_key_nav.js @@ -0,0 +1,79 @@ +/* +This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in non-GPL project. Please contact sales@dhtmlx.com for details +*/ +//Initial idea and implementation by Steve MC
+(function (){
+
+var isLightboxOpen = false;
+var date; // used for copy and paste operations
+var isCopy = null;
+
+scheduler.attachEvent("onBeforeLightbox",function(){ isLightboxOpen = true; return true; });
+scheduler.attachEvent("onAfterLightbox",function(){ isLightboxOpen = false; return true; });
+
+scheduler.attachEvent("onMouseMove", function(id,e){
+ date = scheduler.getActionData(e).date;
+});
+
+dhtmlxEvent(document,(_isOpera?"keypress":"keydown"),function(e){
+ e=e||event;
+ if (!isLightboxOpen){
+
+ var scheduler = window.scheduler;
+
+ if (e.keyCode == 37 || e.keyCode == 39) { // Left, Right arrows
+ e.cancelBubble = true;
+
+ var next = scheduler.date.add(scheduler._date,(e.keyCode == 37 ? -1 : 1 ),scheduler._mode);
+ scheduler.setCurrentView(next);
+ return true;
+ }
+
+ var select_id = scheduler._select_id;
+ if (e.ctrlKey && e.keyCode == 67) { // CTRL+C
+ if (select_id) {
+ scheduler._buffer_id = select_id;
+ isCopy = true;
+ scheduler.callEvent("onEventCopied", [scheduler.getEvent(select_id)]);
+ }
+ return true;
+ }
+ if (e.ctrlKey && e.keyCode == 88) { // CTRL+X
+ if (select_id) {
+ isCopy = false;
+ scheduler._buffer_id = select_id;
+ var ev = scheduler.getEvent(select_id);
+ scheduler.updateEvent(ev.id);
+ scheduler.callEvent("onEventCut", [ev]);
+ }
+ }
+
+ if (e.ctrlKey && e.keyCode == 86) { // CTRL+V
+ var ev = scheduler.getEvent(scheduler._buffer_id);
+ if (ev) {
+ var event_duration = ev.end_date-ev.start_date;
+ if (isCopy) {
+ var new_ev = scheduler._lame_clone(ev);
+ new_ev.id = scheduler.uid();
+ new_ev.start_date = new Date(date);
+ new_ev.end_date = new Date(new_ev.start_date.valueOf() + event_duration);
+ scheduler.addEvent(new_ev);
+ scheduler.callEvent("onEventPasted", [isCopy, new_ev, ev]);
+ }
+ else { // cut operation
+ var copy = scheduler._lame_copy({}, ev);
+ ev.start_date = new Date(date);
+ ev.end_date = new Date(ev.start_date.valueOf() + event_duration);
+ scheduler.render_view_data(); // need to redraw all events
+
+ scheduler.callEvent("onEventPasted", [isCopy, ev, copy]);
+ isCopy = true; // switch to copy after first paste operation
+ }
+ }
+ return true;
+ }
+ }
+});
+
+})();
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_limit.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_limit.js new file mode 100644 index 00000000000..0892024eb46 --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_limit.js @@ -0,0 +1,831 @@ +/* +This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in non-GPL project. Please contact sales@dhtmlx.com for details +*/ +scheduler.config.limit_start = null;
+scheduler.config.limit_end = null;
+scheduler.config.limit_view = false;
+scheduler.config.check_limits = true;
+scheduler.config.mark_now = true;
+scheduler.config.display_marked_timespans = true;
+
+(function(){
+ var before = null;
+ var dhx_time_block = "dhx_time_block";
+
+ var fix_options = function(options, days, zones) {
+ if (days instanceof Date && zones instanceof Date) {
+ options.start_date = days;
+ options.end_date = zones
+ } else {
+ options.days = days;
+ options.zones = zones;
+ }
+ return options;
+ };
+ var get_resulting_options = function(days, zones, sections) {
+ var options = (typeof days == "object") ? days : { days: days };
+ options.type = dhx_time_block;
+ options.css = "";
+ if (zones) {
+ if (sections)
+ options.sections = sections;
+ options = fix_options(options, days, zones);
+ }
+ return options;
+ };
+ scheduler.blockTime = function(days, zones, sections){
+ var options = get_resulting_options(days, zones, sections);
+ return scheduler.addMarkedTimespan(options);
+ };
+ scheduler.unblockTime = function(days, zones, sections) {
+ zones = zones || "fullday";
+ var options = get_resulting_options(days, zones, sections);
+ return scheduler.deleteMarkedTimespan(options);
+ };
+ scheduler.attachEvent("onBeforeViewChange",function(om,od,nm,nd){
+ nd = nd||od; nm = nm||om;
+ if (scheduler.config.limit_view){
+ if (nd.valueOf()>scheduler.config.limit_end.valueOf() || this.date.add(nd,1,nm)<=scheduler.config.limit_start.valueOf()){
+ setTimeout(function(){
+ scheduler.setCurrentView(scheduler._date, nm);
+ },1);
+ return false;
+ }
+ }
+ return true;
+ });
+ var get_relevant_blocked_zones = function(day_index, day_value, zones) {
+ var relevant_zones = (zones[day_value] && zones[day_value][dhx_time_block]) ? zones[day_value][dhx_time_block] :
+ (zones[day_index] && zones[day_index][dhx_time_block]) ? zones[day_index][dhx_time_block] : [];
+ return relevant_zones;
+ };
+ var blocker = function(event){
+ if(!event)
+ return true;
+ if (!scheduler.config.check_limits)
+ return true;
+ var s = scheduler;
+ var mode = s._mode;
+ var timespans = scheduler._marked_timespans;
+ var c = s.config;
+ var evs = [];
+ if (event.rec_type) {
+ evs = scheduler.getRecDates(event);
+ } else {
+ evs = [event];
+ }
+
+ var res = true;
+ for (var p=0; p<evs.length; p++) {
+ var ev = evs[p];
+
+ res = (c.limit_start && c.limit_end) ? (ev.start_date.valueOf() >= c.limit_start.valueOf() && ev.end_date.valueOf() <= c.limit_end.valueOf()) : true;
+ if (res){
+ var temp_start_date = new Date(ev.start_date.valueOf());
+ var temp_end_date = scheduler.date.add(temp_start_date, 1, "day");
+
+ for (; temp_start_date < ev.end_date; temp_start_date = scheduler.date.date_part(temp_end_date), temp_end_date = s.date.add(temp_start_date, 1, "day") ) {
+ var day_value = +scheduler.date.date_part( new Date(temp_start_date) ); // the first part of event not necessarily contains only date part
+ var day_index = temp_start_date.getDay();
+
+ var zones = [];
+ if(s._props && s._props[mode]){
+ var view = s._props[mode];
+ var block_units = timespans[mode];
+ if(block_units && block_units[ev[view.map_to]]) {
+ var unit_zones = block_units[ev[view.map_to]];
+ var blocked_unit_zones = get_relevant_blocked_zones(day_index, day_value, unit_zones);
+ for (var i=0; i<blocked_unit_zones.length; i++) {
+ zones = scheduler._add_timespan_zones(zones, blocked_unit_zones[i].zones);
+ }
+ }
+ }
+ if (s.matrix && s.matrix[mode]) {
+ var timeline_options = s.matrix[mode];
+ var timeline_units = timespans[mode];
+ if (timeline_units && timeline_units[ev[timeline_options.y_property]]) {
+ var timeline_zones = timeline_units[ev[timeline_options.y_property]];
+ var blocked_timeline_zones = get_relevant_blocked_zones(day_index, day_value, timeline_zones);
+ for (var i=0; i<blocked_timeline_zones.length; i++) {
+ zones = scheduler._add_timespan_zones(zones, blocked_timeline_zones[i].zones);
+ }
+ }
+ }
+ // now need to add day blocks
+ var block_days = timespans.global;
+ var blocked_day_zones = get_relevant_blocked_zones(day_index, day_value, block_days)
+ for (var i=0; i<blocked_day_zones.length; i++) {
+ zones = scheduler._add_timespan_zones(zones, blocked_day_zones[i].zones);
+ }
+
+ var sm = scheduler._get_zone_minutes(temp_start_date);
+ var em = ( ev.end_date>temp_end_date || ev.end_date.getDate() != temp_start_date.getDate() ) ? 1440 : scheduler._get_zone_minutes(ev.end_date);
+
+ if (zones){
+ for (var i = 0; i < zones.length; i+=2){
+ var sz = zones[i];
+ var ez = zones[i+1];
+ if (sz<em && ez>sm) {
+ if (sm<=ez && sm >=sz){
+ if (ez == 24*60 || em<ez){
+ res = false;
+ break;
+ }
+ if(ev._timed && s._drag_id && s._drag_mode == "new-size"){
+ ev.start_date.setHours(0);
+ ev.start_date.setMinutes(ez);
+ }
+ else {
+ res = false;
+ break;
+ }
+ }
+ if ((em>=sz && em<ez) || (sm < sz && em > ez)){
+ if(ev._timed && s._drag_id && s._drag_mode == "new-size"){
+ ev.end_date.setHours(0);
+ ev.end_date.setMinutes(sz);
+ }
+ else {
+ res = false;
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ if (!res) {
+ s._drag_id = null;
+ s._drag_mode = null;
+ res = (s.checkEvent("onLimitViolation")) ? s.callEvent("onLimitViolation",[ev.id, ev]) : res;
+ }
+ }
+ return res;
+ };
+ scheduler.attachEvent("onMouseDown", function(classname) {
+ return !(classname = dhx_time_block);
+ });
+ scheduler.attachEvent("onBeforeDrag",function(id){
+ if (!id) return true;
+ return blocker(scheduler.getEvent(id));
+ });
+ scheduler.attachEvent("onClick", function (event_id, native_event_object){
+ return blocker(scheduler.getEvent(event_id));
+ });
+ scheduler.attachEvent("onBeforeLightbox",function(id){
+
+ var ev = scheduler.getEvent(id);
+ before = [ev.start_date, ev.end_date];
+ return blocker(ev);
+ });
+ scheduler.attachEvent("onEventSave", function(id, data, is_new_event) {
+ if(data.rec_type){
+ var data_copy = scheduler._lame_clone(data);
+ scheduler._roll_back_dates(data_copy);
+ return blocker(data);
+ }
+ return blocker(data);
+ });
+ scheduler.attachEvent("onEventAdded",function(id){
+ if (!id) return true;
+ var ev = scheduler.getEvent(id);
+ if (!blocker(ev) && scheduler.config.limit_start && scheduler.config.limit_end) {
+ if (ev.start_date < scheduler.config.limit_start) {
+ ev.start_date = new Date(scheduler.config.limit_start);
+ }
+ if (ev.start_date.valueOf() >= scheduler.config.limit_end.valueOf()) {
+ ev.start_date = this.date.add(scheduler.config.limit_end, -1, "day");
+ }
+ if (ev.end_date < scheduler.config.limit_start) {
+ ev.end_date = new Date(scheduler.config.limit_start);
+ }
+ if (ev.end_date.valueOf() >= scheduler.config.limit_end.valueOf()) {
+ ev.end_date = this.date.add(scheduler.config.limit_end, -1, "day");
+ }
+ if (ev.start_date.valueOf() >= ev.end_date.valueOf()) {
+ ev.end_date = this.date.add(ev.start_date, (this.config.event_duration||this.config.time_step), "minute");
+ }
+ ev._timed=this.is_one_day_event(ev);
+ }
+ return true;
+ });
+ scheduler.attachEvent("onEventChanged",function(id){
+ if (!id) return true;
+ var ev = scheduler.getEvent(id);
+ if (!blocker(ev)){
+ if (!before) return false;
+ ev.start_date = before[0];
+ ev.end_date = before[1];
+ ev._timed=this.is_one_day_event(ev);
+ }
+ return true;
+ });
+ scheduler.attachEvent("onBeforeEventChanged",function(ev, native_object, is_new){
+ return blocker(ev);
+ });
+ scheduler.attachEvent("onBeforeEventCreated", function(ev) { // native event
+ var start_date = scheduler.getActionData(ev).date;
+ var event = {
+ _timed: true,
+ start_date: start_date,
+ end_date: scheduler.date.add(start_date, scheduler.config.time_step, "minute")
+ };
+ return blocker(event);
+ });
+
+ scheduler.attachEvent("onViewChange", function(){
+ scheduler.markNow();
+ });
+ scheduler.attachEvent("onSchedulerResize", function(){
+ window.setTimeout(function(){ scheduler.markNow(); }, 1);
+ return true;
+ });
+ scheduler.attachEvent("onTemplatesReady", function() {
+ scheduler._mark_now_timer = window.setInterval(function() {
+ scheduler.markNow();
+ }, 60000);
+ });
+ scheduler.markNow = function(hide) {
+ // day, week, units views
+ var dhx_now_time = 'dhx_now_time';
+ if (!this._els[dhx_now_time]) {
+ this._els[dhx_now_time] = [];
+ }
+ var now = scheduler.config.now_date || new Date();
+ var cfg = this.config;
+ scheduler._remove_mark_now(); // delete previous marks if they exist
+ if (!hide && cfg.mark_now && now < this._max_date && now > this._min_date && now.getHours() >= cfg.first_hour && now.getHours()<cfg.last_hour) {
+ var day_index = this.locate_holder_day(now);
+ this._els[dhx_now_time] = scheduler._append_mark_now(day_index, now);
+ }
+ };
+ scheduler._append_mark_now = function(day_index, now) {
+ var dhx_now_time = 'dhx_now_time';
+ var zone_start= scheduler._get_zone_minutes(now);
+ var options = {
+ zones: [zone_start, zone_start+1],
+ css: dhx_now_time,
+ type: dhx_now_time
+ };
+ if (!this._table_view) {
+ if (this._props && this._props[this._mode]) { // units view
+ var day_divs = this._els["dhx_cal_data"][0].childNodes;
+ var r_divs = [];
+
+ for (var i=0; i<day_divs.length-1; i++) {
+ var t_day = day_index+i; // as each unit is actually considered +1 day
+ options.days = t_day;
+ var t_div = scheduler._render_marked_timespan(options, null, t_day)[0];
+ r_divs.push(t_div)
+ }
+ return r_divs;
+ } else { // day/week views
+ options.days = day_index;
+ return scheduler._render_marked_timespan(options, null, day_index);
+ }
+ } else {
+ if (this._mode == "month") {
+ options.days = +scheduler.date.date_part(now);
+ return scheduler._render_marked_timespan(options, null, null);
+ }
+ }
+ };
+ scheduler._remove_mark_now = function() {
+ var dhx_now_time = 'dhx_now_time';
+ var els = this._els[dhx_now_time];
+ for (var i=0; i<els.length; i++) {
+ var div = els[i];
+ var parent = div.parentNode;
+ if (parent) {
+ parent.removeChild(div);
+ }
+ }
+ this._els[dhx_now_time] = [];
+ };
+
+ /*
+ scheduler._marked_timespans = {
+ "global": {
+ "0": {
+ "default": [
+ { // sunday
+ zones: [0, 100, 500, 600],
+ css: "yellow_box",
+ type: "default",
+ view: "global",
+ day: 0
+ }
+ ]
+ }
+ "112121312": {
+ "my_special_type": [
+ {
+ zones: [600, 900],
+ type: "block",
+ css: "some_class",
+ view: "global",
+ day: 112121312
+ },
+ {}
+ ]
+ }
+ },
+ "units": {
+ "5_id": {
+ "3": {
+ "special_type": [ {}, {}, {} ],
+ "another_type": [ {} ]
+ }
+ },
+ "6_id": {
+ "11212127": {
+ ...
+ }
+ }
+ }
+ }
+ */
+ scheduler._marked_timespans = { global: {} };
+
+ scheduler._get_zone_minutes = function(date) {
+ return date.getHours()*60 + date.getMinutes();
+ };
+ scheduler._prepare_timespan_options = function(config) { // receives 1 option, returns array of options
+ var r_configs = []; // resulting configs
+ var temp_configs = [];
+
+ if (config.days == "fullweek")
+ config.days = [0,1,2,3,4,5,6];
+
+ if (config.days instanceof Array) {
+ var t_days = config.days.slice();
+ for (var i=0; i<t_days.length; i++) {
+ var cloned_config = scheduler._lame_clone(config);
+ cloned_config.days = t_days[i];
+ r_configs.push.apply(r_configs, scheduler._prepare_timespan_options(cloned_config));
+ }
+ return r_configs;
+ }
+
+ if ( !config || !((config.start_date && config.end_date && config.end_date > config.start_date) || (config.days !== undefined && config.zones)) )
+ return r_configs; // incorrect config was provided
+
+ var min = 0;
+ var max = 24*60;
+ if (config.zones == "fullday")
+ config.zones = [min, max];
+ if (config.zones && config.invert_zones) {
+ config.zones = scheduler.invertZones(config.zones);
+ }
+
+ config.id = scheduler.uid();
+ config.css = config.css||"";
+ config.type = config.type||"default";
+
+ var sections = config.sections;
+ if (sections) {
+ for (var view_key in sections) {
+ if (sections.hasOwnProperty(view_key)) {
+ var ids = sections[view_key];
+ if (!(ids instanceof Array))
+ ids = [ids];
+ for (var i=0; i<ids.length; i++) {
+ var t_config = scheduler._lame_copy({}, config);
+ t_config.sections = {};
+ t_config.sections[view_key] = ids[i];
+ temp_configs.push(t_config);
+ }
+ }
+ }
+ } else {
+ temp_configs.push(config);
+ }
+
+ for (var k=0; k<temp_configs.length; k++) {
+ var c_config = temp_configs[k]; // config to be checked
+
+ var start_date = c_config.start_date;
+ var end_date = c_config.end_date;
+
+ if (start_date && end_date) {
+ var t_sd = scheduler.date.date_part(new Date(start_date)); // e.g. 05 october
+ var t_ed= scheduler.date.add(t_sd, 1, "day"); // 06 october, will both be incremented in the loop
+
+ while (t_sd < end_date) {
+ var t_config = scheduler._lame_copy({}, c_config);
+ delete t_config.start_date;
+ delete t_config.end_date;
+ t_config.days = t_sd.valueOf();
+ var zone_start = (start_date > t_sd) ? scheduler._get_zone_minutes(start_date) : min;
+ var zone_end = ( end_date>t_ed || end_date.getDate() != t_sd.getDate() ) ? max : scheduler._get_zone_minutes(end_date);
+ t_config.zones = [zone_start, zone_end];
+ r_configs.push(t_config);
+
+ t_sd = t_ed;
+ t_ed = scheduler.date.add(t_ed, 1, "day");
+ }
+ } else {
+ if (c_config.days instanceof Date)
+ c_config.days = (scheduler.date.date_part(c_config.days)).valueOf();
+ c_config.zones = config.zones.slice();
+ r_configs.push(c_config);
+ }
+ }
+ return r_configs;
+ };
+ scheduler._get_dates_by_index = function(index, start, end) {
+ var dates = [];
+ start = start||scheduler._min_date;
+ end = end||scheduler._max_date;
+ var start_day = start.getDay();
+ var delta = (index-start_day >= 0) ? (index-start_day) : (7-start.getDay()+index);
+ var t_date = scheduler.date.add(start, delta, "day");
+ for (; t_date < end; t_date = scheduler.date.add(t_date, 1, "week")) {
+ dates.push(t_date);
+ }
+ return dates;
+ };
+ scheduler._get_css_classes_by_config = function(config) {
+ var css_classes = [];
+ if (config.type == dhx_time_block) {
+ css_classes.push(dhx_time_block);
+ if (config.css)
+ css_classes.push(dhx_time_block+"_reset");
+ }
+ css_classes.push("dhx_marked_timespan", config.css);
+ return css_classes.join(" ");
+ };
+ scheduler._get_block_by_config = function(config) {
+ var block = document.createElement("DIV");
+ if (config.html) {
+ if (typeof config.html == "string")
+ block.innerHTML = config.html;
+ else
+ block.appendChild(config.html);
+ }
+ return block;
+ };
+ scheduler._render_marked_timespan = function(options, area, day) {
+ var blocks = []; // resulting block which will be rendered and returned
+ var c = scheduler.config;
+ var min_date = this._min_date;
+ var max_date = this._max_date;
+ var day_value = false; // if timespan for specific date should be displayed
+
+ if (!c.display_marked_timespans)
+ return blocks;
+
+ if (!day && day !== 0) { // in case of markTimespan
+ if (options.days < 7)
+ day = options.days;
+ else {
+ var date_to_display = new Date(options.days);
+ day_value = +date_to_display;
+
+ // in case of markTimespan date could be not in the viewing range, need to return
+ if ( !(+max_date >= +date_to_display && +min_date <= +date_to_display) )
+ return blocks;
+
+ var day_index = date_to_display.getDay();
+ if (scheduler.config.start_on_monday) {
+ day = (day_index == 0) ? 6 : day_index-1;
+ } else
+ day = day_index;
+ }
+ }
+ var zones = options.zones;
+ var css_classes = scheduler._get_css_classes_by_config(options);
+
+ if (scheduler._table_view && scheduler._mode == "month") {
+ var areas = [];
+ var days = [];
+
+
+ if (!area) {
+ days = (day_value) ? [day_value] : scheduler._get_dates_by_index(day);
+ for (var i=0; i < days.length; i++) {
+ areas.push( this._scales[days[i]] );
+ }
+ } else {
+ areas.push(area);
+ days.push(day);
+ }
+
+ for (var i=0; i < areas.length; i++) {
+ area = areas[i];
+ day = days[i];
+
+ for (var k=0; k < zones.length; k+=2) {
+ var start = zones[i];
+ var end = zones[i+1];
+ if (end <= start)
+ return [];
+
+ var block = scheduler._get_block_by_config(options);
+ block.className = css_classes;
+
+ var height = area.offsetHeight - 1; // 1 for bottom border
+ var width = area.offsetWidth - 1; // 1 for left border
+
+ var sweek = Math.floor((this._correct_shift(day,1)-min_date.valueOf())/(60*60*1000*24*this._cols.length));
+ var sday = this.locate_holder_day(day, false) % this._cols.length;
+
+ var left = this._colsS[sday];
+ var top = this._colsS.heights[sweek]+(this._colsS.height?(this.xy.month_scale_height+2):2)-1;
+
+ block.style.top = top + "px";
+ block.style.lineHeight = block.style.height = height + "px";
+
+ block.style.left = (left + Math.round( (start)/(24*60) * width)) + "px";
+ block.style.width = Math.round( (end-start)/(24*60) * width) + "px";
+
+ area.appendChild(block);
+ blocks.push(block);
+ }
+ }
+ } else {
+ area = area ? area : scheduler.locate_holder(day);
+
+ for (var i = 0; i < zones.length; i+=2){
+ var start = Math.max(zones[i], c.first_hour*60);
+ var end = Math.min(zones[i+1], c.last_hour*60);
+ if (end <= start)
+ return [];
+
+ var block = scheduler._get_block_by_config(options);
+ block.className = css_classes;
+
+ block.style.top = (Math.round((start*60*1000-this.config.first_hour*60*60*1000)*this.config.hour_size_px/(60*60*1000)))%(this.config.hour_size_px*24)+"px";
+ block.style.lineHeight = block.style.height = Math.max((Math.round(((end-start-1)*60*1000)*this.config.hour_size_px/(60*60*1000)))%(this.config.hour_size_px*24), 1)+"px";
+
+ area.appendChild(block);
+ blocks.push(block);
+ }
+ }
+
+ return blocks;
+ };
+ // just marks timespan, will be cleaned after refresh
+ scheduler.markTimespan = function(configuration) {
+ var configs = scheduler._prepare_timespan_options(configuration);
+ if (!configs.length)
+ return;
+ var divs = [];
+ for (var i=0; i<configs.length; i++) {
+ var config = configs[i];
+ var blocks = scheduler._render_marked_timespan(config, null, null);
+ if(blocks.length)
+ divs.push.apply(divs, blocks);
+ }
+ return divs;
+ };
+ scheduler.unmarkTimespan = function(divs) {
+ if (!divs)
+ return;
+ for (var i=0; i<divs.length; i++) {
+ var div = divs[i];
+ div.parentNode.removeChild(div);
+ }
+ };
+
+ scheduler._marked_timespans_ids = {};
+ // adds marked timespan to collections, persistent
+ scheduler.addMarkedTimespan = function(configuration) {
+ var configs = scheduler._prepare_timespan_options(configuration);
+ var global = "global";
+
+ if (!configs.length)
+ return; // options are incorrect, nothing to mark
+
+ var id = configs[0].id;
+ var timespans = scheduler._marked_timespans;
+ var ids = scheduler._marked_timespans_ids;
+ if (!ids[id])
+ ids[id] = [];
+
+ for (var i=0; i<configs.length; i++) {
+ var config = configs[i];
+ var day = config.days;
+ var zones = config.zones;
+ var css = config.css;
+ var sections = config.sections;
+ var type = config.type; // default or specified
+
+ if (sections) {
+ for (var view_key in sections) {
+ if (sections.hasOwnProperty(view_key)) {
+ if (!timespans[view_key])
+ timespans[view_key] = {};
+ var unit_id = sections[view_key];
+ var timespans_view = timespans[view_key];
+ if (!timespans_view[unit_id])
+ timespans_view[unit_id] = {};
+ if (!timespans_view[unit_id][day])
+ timespans_view[unit_id][day] = {};
+ if (!timespans_view[unit_id][day][type])
+ timespans_view[unit_id][day][type] = [];
+ var day_configs = timespans_view[unit_id][day][type];
+ config._array = day_configs;
+ day_configs.push(config);
+ ids[id].push(config);
+ }
+ }
+ } else {
+ if (!timespans[global][day])
+ timespans[global][day] = {};
+ if (!timespans[global][day][type])
+ timespans[global][day][type] = [];
+ var day_configs = timespans[global][day][type];
+ config._array = day_configs;
+ day_configs.push(config);
+ ids[id].push(config);
+ }
+ }
+ return id;
+ };
+ // not used for now
+ scheduler._add_timespan_zones = function(current_zones, zones) {
+ var resulting_zones = current_zones.slice();
+ zones = zones.slice();
+
+ if (!resulting_zones.length)
+ return zones;
+
+ for (var i=0; i<resulting_zones.length; i+=2) {
+ var c_zone_start = resulting_zones[i];
+ var c_zone_end = resulting_zones[i+1];
+ var isLast = (i+2 == resulting_zones.length);
+
+ for (var k=0; k<zones.length; k+=2) {
+ var zone_start = zones[k];
+ var zone_end = zones[k+1];
+ if ((zone_end > c_zone_end && zone_start <= c_zone_end) || (zone_start < c_zone_start && zone_end >= c_zone_start)) {
+ resulting_zones[i] = Math.min(c_zone_start, zone_start);
+ resulting_zones[i+1] = Math.max(c_zone_end, zone_end);
+ i -= 2;
+ } else {
+ if (!isLast) // do nothing, maybe next current zone will match or will be last
+ continue;
+
+ var offset = (c_zone_start > zone_start)?0:2;
+ resulting_zones.splice(i+offset, 0, zone_start, zone_end); // last current zone, need to add another
+ }
+ zones.splice(k--,2); // zone was merged or added, need to exclude it
+ break;
+ }
+ }
+ return resulting_zones;
+ };
+ scheduler._subtract_timespan_zones = function(current_zones, zones) {
+ var resulting_zones = current_zones.slice();
+ for (var i=0; i<resulting_zones.length; i+=2 ) {
+ var c_zone_start = resulting_zones[i];// current_zone_start
+ var c_zone_end = resulting_zones[i+1];
+ for (var k=0; k<zones.length; k+=2) {
+ var zone_start = zones[k];
+ var zone_end = zones[k+1];
+ if (zone_end > c_zone_start && zone_start < c_zone_end) {
+ var is_modified = false;
+ if (c_zone_start >= zone_start && c_zone_end <= zone_end) {
+ resulting_zones.splice(i, 2);
+ }
+ if (c_zone_start < zone_start) {
+ resulting_zones.splice(i, 2, c_zone_start, zone_start);
+ is_modified = true;
+ }
+ if (c_zone_end > zone_end) {
+ resulting_zones.splice( (is_modified)?(i+2):i, (is_modified)?0:2, zone_end, c_zone_end);
+ }
+ i -= 2;
+ break;
+ } else {
+ continue;
+ }
+ }
+ }
+ return resulting_zones;
+ };
+ scheduler.invertZones = function(zones) {
+ return scheduler._subtract_timespan_zones([0, 1440], zones.slice());
+ };
+ scheduler._delete_marked_timespan_by_id = function(id) {
+ var configs = scheduler._marked_timespans_ids[id];
+ if (configs) {
+ for (var i=0; i<configs.length; i++) {
+ var config = configs[i];
+ var parent_array = config._array;
+ for (var k=0; k<parent_array.length; k++) {
+ if (parent_array[k] == config) {
+ parent_array.splice(k, 1);
+ break;
+ }
+ }
+ }
+ }
+ };
+ scheduler._delete_marked_timespan_by_config = function(config) {
+ var timespans = scheduler._marked_timespans;
+ var sections = config.sections;
+ var day = config.days;
+ var type = config.type||"default";
+ var day_timespans = []; // array of timespans to subtract our config
+ if (sections) {
+ for (var view_key in sections) {
+ if (sections.hasOwnProperty(view_key) && timespans[view_key]) {
+ var unit_id = sections[view_key];
+ if (timespans[view_key][unit_id] && timespans[view_key][unit_id][day] && timespans[view_key][unit_id][day][type])
+ day_timespans = timespans[view_key][unit_id][day][type];
+ }
+ }
+ } else {
+ if (timespans.global[day] && timespans.global[day][type])
+ day_timespans = timespans.global[day][type];
+ }
+ for (var i=0; i<day_timespans.length; i++) {
+ var d_t = day_timespans[i];
+ var zones = scheduler._subtract_timespan_zones(d_t.zones, config.zones);
+ if (zones.length)
+ d_t.zones = zones;
+ else {
+ day_timespans.splice(i,1);
+ i--;
+ // need to update ids collection
+ var related_zones = scheduler._marked_timespans_ids[d_t.id];
+ for (var k=0; k<related_zones.length; k++) {
+ if (related_zones[k] == d_t) {
+ related_zones.splice(k, 1);
+ break;
+ }
+ }
+ }
+ }
+ };
+ scheduler.deleteMarkedTimespan = function(configuration) {
+ if (!arguments.length) // delete everything
+ scheduler._marked_timespans = { global: {} };
+ if (typeof configuration != "object") { // id was passed
+ scheduler._delete_marked_timespan_by_id(configuration);
+ } else { // normal configuration was passed
+ var configs = scheduler._prepare_timespan_options(configuration);
+ for (var i=0; i<configs.length; i++) {
+ var config = configs[i];
+ scheduler._delete_marked_timespan_by_config(configs[i]);
+ }
+ }
+ };
+ scheduler._get_types_to_render = function(common, specific) {
+ var types_to_render = (common) ? common : {};
+ for (var type in specific||{} ) {
+ if (specific.hasOwnProperty(type)) {
+ types_to_render[type] = specific[type];
+ }
+ }
+ return types_to_render;
+ };
+ scheduler._get_configs_to_render = function(types) {
+ var configs = [];
+ for (var type in types) {
+ if (types.hasOwnProperty(type)) {
+ configs.push.apply(configs, types[type]);
+ }
+ }
+ return configs;
+ };
+ scheduler.attachEvent("onScaleAdd", function(area, day) {
+ if (scheduler._table_view && scheduler._mode != "month")
+ return;
+
+ var day_index = day.getDay();
+ var day_value = day.valueOf();
+ var mode = this._mode;
+ var timespans = scheduler._marked_timespans;
+ var r_configs = [];
+
+ if (this._props && this._props[mode]) { // we are in the units view and need to draw it's sections as well
+ var view = this._props[mode]; // units view object
+ var units = view.options;
+ var index = (view.position||0)+Math.floor((this._correct_shift(day.valueOf(),1)-this._min_date.valueOf())/(60*60*24*1000)); // user index
+ var unit = units[index]; // key, label
+ day = scheduler.date.date_part(new Date(this._date)); // for units view actually only 1 day is displayed yet the day variable will change, need to use this._date for all calls
+ day_index = day.getDay();
+ day_value = day.valueOf();
+
+ if (timespans[mode] && timespans[mode][unit.key]) {
+ var unit_zones = timespans[mode][unit.key];
+ var unit_types = scheduler._get_types_to_render(unit_zones[day_index], unit_zones[day_value]);
+ r_configs.push.apply(r_configs, scheduler._get_configs_to_render(unit_types));
+ }
+ }
+
+ var global_data = timespans["global"];
+ var day_types = global_data[day_value]||global_data[day_index];
+ r_configs.push.apply(r_configs, scheduler._get_configs_to_render(day_types));
+
+ for (var i=0; i<r_configs.length; i++) {
+ scheduler._render_marked_timespan(r_configs[i], area, day);
+ }
+ });
+
+})();
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_map_view.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_map_view.js index e2e17d14e03..2cda69384b3 100644 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_map_view.js +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_map_view.js @@ -1,6 +1,6 @@ /* This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details +to use it in non-GPL project. Please contact sales@dhtmlx.com for details */ scheduler.xy.map_date_width = 188; // date column width
scheduler.xy.map_description_width = 400; // description column width
@@ -29,7 +29,7 @@ scheduler.dblclick_dhx_map_area = function() { if (!this.config.readonly && this.config.dblclick_create)
this.addEventNow({
start_date: scheduler._date,
- end_date: scheduler.date.add(scheduler._date, 1, "hour")
+ end_date: scheduler.date.add(scheduler._date, scheduler.config.time_step, "minute")
});
};
scheduler.templates.map_time = function(start, end, ev) {
@@ -87,20 +87,20 @@ scheduler.attachEvent("onSchedulerReady", function() { if (!scheduler.config.readonly && scheduler.config.dblclick_create) {
var point = event.latLng;
geocoder.geocode(
- { 'latLng': point },
- function(results, status) {
- if (status == google.maps.GeocoderStatus.OK) {
- point = results[0].geometry.location;
- scheduler.addEventNow({
- lat: point.lat(),
- lng: point.lng(),
- event_location: results[0].formatted_address,
- start_date: scheduler._date,
- end_date: scheduler.date.add(scheduler._date, 1, "hour")
- });
- }
+ { 'latLng': point },
+ function(results, status) {
+ if (status == google.maps.GeocoderStatus.OK) {
+ point = results[0].geometry.location;
+ scheduler.addEventNow({
+ lat: point.lat(),
+ lng: point.lng(),
+ event_location: results[0].formatted_address,
+ start_date: scheduler._date,
+ end_date: scheduler.date.add(scheduler._date, scheduler.config.time_step, "minute")
+ });
}
- );
+ }
+ );
}
});
@@ -182,7 +182,7 @@ scheduler.attachEvent("onSchedulerReady", function() { function set_full_view(mode) {
if (mode) {
var l = scheduler.locale.labels;
- scheduler._els["dhx_cal_header"][0].innerHTML = "<div class='dhx_map_line' style='width: " + (scheduler.xy.map_date_width + scheduler.xy.map_description_width + 2) + "px;' ><div style='width: " + scheduler.xy.map_date_width + "px;'>" + l.date + "</div><div class='headline_description' style='width: " + scheduler.xy.map_description_width + "px;'>" + l.description + "</div></div>";
+ scheduler._els["dhx_cal_header"][0].innerHTML = "<div class='dhx_map_line' style='width: " + (scheduler.xy.map_date_width + scheduler.xy.map_description_width + 2) + "px;' ><div class='headline_date' style='width: " + scheduler.xy.map_date_width + "px;'>" + l.date + "</div><div class='headline_description' style='width: " + scheduler.xy.map_description_width + "px;'>" + l.description + "</div></div>";
scheduler._table_view = true;
scheduler.set_sizes();
}
@@ -191,11 +191,14 @@ scheduler.attachEvent("onSchedulerReady", function() { function clear_map_tab() {
scheduler._selected_event_id = null;
scheduler.map._infowindow.close();
- for (var key in scheduler.map._markers) {
- scheduler.map._markers[key].setMap(null);
- delete scheduler.map._markers[key];
- if (scheduler.map._infowindows_content[key])
- delete scheduler.map._infowindows_content[key];
+ var markers = scheduler.map._markers;
+ for (var key in markers) {
+ if (markers.hasOwnProperty(key)) {
+ markers[key].setMap(null);
+ delete scheduler.map._markers[key];
+ if (scheduler.map._infowindows_content[key])
+ delete scheduler.map._infowindows_content[key];
+ }
}
}
@@ -203,20 +206,9 @@ scheduler.attachEvent("onSchedulerReady", function() { //select events for which data need to be printed
var events = scheduler.get_visible_events();
events.sort(function(a, b) {
- if (a.start_date < b.start_date)
- return -1;
- if (a.start_date.valueOf() == b.start_date.valueOf()) {
- if (a.text < b.text)
- return -1
- else {
- if (a.text == b.text)
- return 0;
- else
- return 1;
- }
- }
- else
- return 1;
+ if(a.start_date.valueOf()==b.start_date.valueOf())
+ return a.id>b.id?1:-1;
+ return a.start_date>b.start_date?1:-1;
});
//generate html for the view
@@ -224,7 +216,7 @@ scheduler.attachEvent("onSchedulerReady", function() { for (var i = 0; i < events.length; i++) {
var ev = events[i];
var event_class = (ev.id == scheduler._selected_event_id) ? 'dhx_map_line highlight' : 'dhx_map_line';
- var bg_color = (ev.color ? ("background-color:" + ev.color + ";") : "");
+ var bg_color = (ev.color ? ("background:" + ev.color + ";") : "");
var color = (ev.textColor ? ("color:" + ev.textColor + ";") : "");
html += "<div class='" + event_class + "' event_id='" + ev.id + "' style='" + bg_color + "" + color + "" + (ev._text_style || "") + " width: " + (scheduler.xy.map_date_width + scheduler.xy.map_description_width + 2) + "px;'><div style='width: " + scheduler.xy.map_date_width + "px;' >" + scheduler.templates.map_time(ev.start_date, ev.end_date, ev) + "</div>";
html += "<div class='dhx_event_icon icon_details'> </div>";
@@ -244,7 +236,6 @@ scheduler.attachEvent("onSchedulerReady", function() { for (var i = 0; i < t.length - 2; i++) {
scheduler._rendered[i] = t[i];
}
-
}
function _setMapSize(elem_id) { //input - map's div id
@@ -267,7 +258,7 @@ scheduler.attachEvent("onSchedulerReady", function() { scheduler._els.dhx_cal_data[0].style.width = (scheduler.xy.map_date_width + scheduler.xy.map_description_width + 1) + 'px';
scheduler._min_date = scheduler.config.map_start || (new Date());
- scheduler._max_date = scheduler.config.map_end || (new Date(9999, 1, 1));
+ scheduler._max_date = scheduler.config.map_end || scheduler.date.add(new Date(), 1, "year");
scheduler._table_view = true;
set_full_view(mode);
@@ -358,29 +349,29 @@ scheduler.attachEvent("onSchedulerReady", function() { var _displayEventOnMap = function(event) {
if (event.event_location && geocoder) {
geocoder.geocode(
- {
- 'address': event.event_location,
- 'language': scheduler.uid().toString()
- },
- function(results, status) {
- var point = {};
- if (status != google.maps.GeocoderStatus.OK) {
- point = scheduler.callEvent("onLocationError", [event.id]);
- if (!point || point === true)
- point = scheduler.config.map_error_position;
- } else {
- point = results[0].geometry.location;
- }
- event.lat = point.lat();
- event.lng = point.lng();
+ {
+ 'address': event.event_location,
+ 'language': scheduler.uid().toString()
+ },
+ function(results, status) {
+ var point = {};
+ if (status != google.maps.GeocoderStatus.OK) {
+ point = scheduler.callEvent("onLocationError", [event.id]);
+ if (!point || point === true)
+ point = scheduler.config.map_error_position;
+ } else {
+ point = results[0].geometry.location;
+ }
+ event.lat = point.lat();
+ event.lng = point.lng();
- scheduler._selected_event_id = event.id;
+ scheduler._selected_event_id = event.id;
- scheduler._latLngUpdate = true;
- scheduler.callEvent("onEventChanged", [event.id, event]);
- showAddress(event, true, true);
- }
- );
+ scheduler._latLngUpdate = true;
+ scheduler.callEvent("onEventChanged", [event.id, event]);
+ showAddress(event, true, true);
+ }
+ );
} else {
showAddress(event, true, true);
}
@@ -389,32 +380,32 @@ scheduler.attachEvent("onSchedulerReady", function() { var _updateEventLocation = function(event) { // update lat and lng in database
if (event.event_location && geocoder) {
geocoder.geocode(
- {
- 'address': event.event_location,
- 'language': scheduler.uid().toString()
- },
- function(results, status) {
- var point = {};
- if (status != google.maps.GeocoderStatus.OK) {
- point = scheduler.callEvent("onLocationError", [event.id]);
- if (!point || point === true)
- point = scheduler.config.map_error_position;
- } else {
- point = results[0].geometry.location;
- }
- event.lat = point.lat();
- event.lng = point.lng();
- scheduler._latLngUpdate = true;
- scheduler.callEvent("onEventChanged", [event.id, event]);
+ {
+ 'address': event.event_location,
+ 'language': scheduler.uid().toString()
+ },
+ function(results, status) {
+ var point = {};
+ if (status != google.maps.GeocoderStatus.OK) {
+ point = scheduler.callEvent("onLocationError", [event.id]);
+ if (!point || point === true)
+ point = scheduler.config.map_error_position;
+ } else {
+ point = results[0].geometry.location;
}
- );
+ event.lat = point.lat();
+ event.lng = point.lng();
+ scheduler._latLngUpdate = true;
+ scheduler.callEvent("onEventChanged", [event.id, event]);
+ }
+ );
}
};
var _delay = function(method, object, params, delay) {
setTimeout(function() {
var ret = method.apply(object, params);
- method = obj = params = null;
+ method = object = params = null;
return ret;
}, delay || 1);
};
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_minical.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_minical.js new file mode 100644 index 00000000000..595af055fce --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_minical.js @@ -0,0 +1,435 @@ +/* +This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in non-GPL project. Please contact sales@dhtmlx.com for details +*/ +scheduler.templates.calendar_month = scheduler.date.date_to_str("%F %Y");
+scheduler.templates.calendar_scale_date = scheduler.date.date_to_str("%D");
+scheduler.templates.calendar_date = scheduler.date.date_to_str("%d");
+scheduler.config.minicalendar = {
+ mark_events: true
+};
+scheduler._synced_minicalendars = [];
+scheduler.renderCalendar = function(obj, _prev, is_refresh) {
+ var cal = null;
+ var date = obj.date || (new Date());
+ if (typeof date == "string")
+ date = this.templates.api_date(date);
+
+ if (!_prev) {
+ var cont = obj.container;
+ var pos = obj.position;
+
+ if (typeof cont == "string")
+ cont = document.getElementById(cont);
+
+ if (typeof pos == "string")
+ pos = document.getElementById(pos);
+ if (pos && (typeof pos.left == "undefined")) {
+ var tpos = getOffset(pos);
+ pos = {
+ top: tpos.top + pos.offsetHeight,
+ left: tpos.left
+ };
+ }
+ if (!cont)
+ cont = scheduler._get_def_cont(pos);
+
+ cal = this._render_calendar(cont, date, obj);
+ cal.onclick = function(e) {
+ e = e || event;
+ var src = e.target || e.srcElement;
+
+ if (src.className.indexOf("dhx_month_head") != -1) {
+ var pname = src.parentNode.className;
+ if (pname.indexOf("dhx_after") == -1 && pname.indexOf("dhx_before") == -1) {
+ var newdate = scheduler.templates.xml_date(this.getAttribute("date"));
+ newdate.setDate(parseInt(src.innerHTML, 10));
+ scheduler.unmarkCalendar(this);
+ scheduler.markCalendar(this, newdate, "dhx_calendar_click");
+ this._last_date = newdate;
+ if (this.conf.handler) this.conf.handler.call(scheduler, newdate, this);
+ }
+ }
+ };
+ } else {
+ cal = this._render_calendar(_prev.parentNode, date, obj, _prev);
+ scheduler.unmarkCalendar(cal);
+ }
+
+ if (scheduler.config.minicalendar.mark_events) {
+ var start = scheduler.date.month_start(date);
+ var end = scheduler.date.add(start, 1, "month");
+ var evs = this.getEvents(start, end);
+ var filter = this["filter_" + this._mode];
+ for (var i = 0; i < evs.length; i++) {
+ var ev = evs[i];
+ if (filter && !filter(ev.id, ev))
+ continue;
+ var d = ev.start_date;
+ if (d.valueOf() < start.valueOf())
+ d = start;
+ d = scheduler.date.date_part(new Date(d.valueOf()));
+ while (d < ev.end_date) {
+ this.markCalendar(cal, d, "dhx_year_event");
+ d = this.date.add(d, 1, "day");
+ if (d.valueOf() >= end.valueOf())
+ break;
+ }
+ }
+ }
+
+ this._markCalendarCurrentDate(cal);
+
+ cal.conf = obj;
+ if (obj.sync && !is_refresh)
+ this._synced_minicalendars.push(cal);
+
+ return cal;
+};
+scheduler._get_def_cont = function(pos) {
+ if (!this._def_count) {
+ this._def_count = document.createElement("DIV");
+ this._def_count.className = "dhx_minical_popup";
+ this._def_count.onclick = function(e) { (e || event).cancelBubble = true; };
+ document.body.appendChild(this._def_count);
+ }
+
+ this._def_count.style.left = pos.left + "px";
+ this._def_count.style.top = pos.top + "px";
+ this._def_count._created = new Date();
+
+ return this._def_count;
+};
+scheduler._locateCalendar = function(cal, date) {
+ var table = cal.childNodes[2].childNodes[0];
+ if (typeof date == "string")
+ date = scheduler.templates.api_date(date);
+
+ var d = cal.week_start + date.getDate() - 1;
+ return table.rows[Math.floor(d / 7)].cells[d % 7].firstChild;
+};
+scheduler.markCalendar = function(cal, date, css) {
+ this._locateCalendar(cal, date).className += " " + css;
+};
+scheduler.unmarkCalendar = function(cal, date, css) {
+ date = date || cal._last_date;
+ css = css || "dhx_calendar_click";
+ if (!date) return;
+ var el = this._locateCalendar(cal, date);
+ el.className = (el.className || "").replace(RegExp(css, "g"));
+};
+scheduler._week_template = function(width) {
+ var summ = (width || 250);
+ var left = 0;
+
+ var week_template = document.createElement("div");
+ var dummy_date = this.date.week_start(new Date());
+ for (var i = 0; i < 7; i++) {
+ this._cols[i] = Math.floor(summ / (7 - i));
+ this._render_x_header(i, left, dummy_date, week_template);
+ dummy_date = this.date.add(dummy_date, 1, "day");
+ summ -= this._cols[i];
+ left += this._cols[i];
+ }
+ week_template.lastChild.className += " dhx_scale_bar_last";
+ return week_template;
+};
+scheduler.updateCalendar = function(obj, sd) {
+ obj.conf.date = sd;
+ this.renderCalendar(obj.conf, obj, true);
+};
+scheduler._mini_cal_arrows = [" ", " "];
+scheduler._render_calendar = function(obj, sd, conf, previous) {
+ /*store*/
+ var ts = scheduler.templates;
+ var temp = this._cols;
+ this._cols = [];
+ var temp2 = this._mode;
+ this._mode = "calendar";
+ var temp3 = this._colsS;
+ this._colsS = {height: 0};
+ var temp4 = new Date(this._min_date);
+ var temp5 = new Date(this._max_date);
+ var temp6 = new Date(scheduler._date);
+ var temp7 = ts.month_day;
+ ts.month_day = ts.calendar_date;
+
+ sd = this.date.month_start(sd);
+ var week_template = this._week_template(obj.offsetWidth - 1);
+
+ var d;
+ if (previous)
+ d = previous; else {
+ d = document.createElement("DIV");
+ d.className = "dhx_cal_container dhx_mini_calendar";
+ }
+ d.setAttribute("date", this.templates.xml_format(sd));
+ d.innerHTML = "<div class='dhx_year_month'></div><div class='dhx_year_week'>" + week_template.innerHTML + "</div><div class='dhx_year_body'></div>";
+
+ d.childNodes[0].innerHTML = this.templates.calendar_month(sd);
+ if (conf.navigation) {
+ var move_minicalendar_date = function(calendar, diff) {
+ var date = scheduler.date.add(calendar._date, diff, "month");
+ scheduler.updateCalendar(calendar, date);
+ if (scheduler._date.getMonth() == calendar._date.getMonth() && scheduler._date.getFullYear() == calendar._date.getFullYear()) {
+ scheduler._markCalendarCurrentDate(calendar);
+ }
+ };
+
+ var css_classnames = ["dhx_cal_prev_button", "dhx_cal_next_button"];
+ var css_texts = ["left:1px;top:2px;position:absolute;", "left:auto; right:1px;top:2px;position:absolute;"];
+ var diffs = [-1, 1];
+ var handler = function(diff) {
+ return function() {
+ if (conf.sync) {
+ var calendars = scheduler._synced_minicalendars;
+ for (var k = 0; k < calendars.length; k++) {
+ move_minicalendar_date(calendars[k], diff);
+ }
+ } else {
+ move_minicalendar_date(d, diff);
+ }
+ }
+ };
+ for (var j = 0; j < 2; j++) {
+ var arrow = document.createElement("DIV");
+ //var diff = diffs[j];
+ arrow.className = css_classnames[j];
+ arrow.style.cssText = css_texts[j];
+ arrow.innerHTML = this._mini_cal_arrows[j];
+ d.firstChild.appendChild(arrow);
+ arrow.onclick = handler(diffs[j])
+ }
+ }
+ d._date = new Date(sd);
+
+ d.week_start = (sd.getDay() - (this.config.start_on_monday ? 1 : 0) + 7) % 7;
+
+ var dd = this.date.week_start(sd);
+ this._reset_month_scale(d.childNodes[2], sd, dd);
+
+ var r = d.childNodes[2].firstChild.rows;
+ for (var k = r.length; k < 6; k++) {
+ var last_row = r[r.length - 1];
+ r[0].parentNode.appendChild(last_row.cloneNode(true));
+ var last_day_number = parseInt(last_row.childNodes[last_row.childNodes.length - 1].childNodes[0].innerHTML);
+ last_day_number = (last_day_number < 10) ? last_day_number : 0; // previous week could end on 28-31, so we should start with 0
+ for (var ri = 0; ri < r[k].childNodes.length; ri++) {
+ r[k].childNodes[ri].className = "dhx_after";
+ r[k].childNodes[ri].childNodes[0].innerHTML = scheduler.date.to_fixed(++last_day_number);
+ }
+ }
+
+ if (!previous)
+ obj.appendChild(d);
+
+ d.childNodes[1].style.height = (d.childNodes[1].childNodes[0].offsetHeight - 1) + "px"; // dhx_year_week should have height property so that day dates would get correct position. dhx_year_week height = height of it's child (with the day name)
+
+ /*restore*/
+ this._cols = temp;
+ this._mode = temp2;
+ this._colsS = temp3;
+ this._min_date = temp4;
+ this._max_date = temp5;
+ scheduler._date = temp6;
+ ts.month_day = temp7;
+ return d;
+};
+scheduler.destroyCalendar = function(cal, force) {
+ if (!cal && this._def_count && this._def_count.firstChild) {
+ if (force || (new Date()).valueOf() - this._def_count._created.valueOf() > 500)
+ cal = this._def_count.firstChild;
+ }
+ if (!cal) return;
+ cal.onclick = null;
+ cal.innerHTML = "";
+ if (cal.parentNode)
+ cal.parentNode.removeChild(cal);
+ if (this._def_count)
+ this._def_count.style.top = "-1000px";
+};
+scheduler.isCalendarVisible = function() {
+ if (this._def_count && parseInt(this._def_count.style.top, 10) > 0)
+ return this._def_count;
+ return false;
+};
+scheduler.attachEvent("onTemplatesReady", function() {
+ dhtmlxEvent(document.body, "click", function() { scheduler.destroyCalendar(); });
+});
+
+scheduler.templates.calendar_time = scheduler.date.date_to_str("%d-%m-%Y");
+
+scheduler.form_blocks.calendar_time = {
+ render: function() {
+ var html = "<input class='dhx_readonly' type='text' readonly='true'>";
+
+ var cfg = scheduler.config;
+ var dt = this.date.date_part(new Date());
+
+ var last = 24 * 60, first = 0;
+ if (cfg.limit_time_select) {
+ first = 60 * cfg.first_hour;
+ last = 60 * cfg.last_hour + 1; // to include "17:00" option if time select is limited
+ }
+ dt.setHours(first / 60);
+
+ html += " <select>";
+ for (var i = first; i < last; i += this.config.time_step * 1) { // `<` to exclude last "00:00" option
+ var time = this.templates.time_picker(dt);
+ html += "<option value='" + i + "'>" + time + "</option>";
+ dt = this.date.add(dt, this.config.time_step, "minute");
+ }
+ html += "</select>";
+
+ var full_day = scheduler.config.full_day;
+
+ return "<div style='height:30px;padding-top:0; font-size:inherit;' class='dhx_section_time'>" + html + "<span style='font-weight:normal; font-size:10pt;'> – </span>" + html + "</div>";
+ },
+ set_value: function(node, value, ev) {
+
+ var inputs = node.getElementsByTagName("input");
+ var selects = node.getElementsByTagName("select");
+
+ var _init_once = function(inp, date, number) {
+ inp.onclick = function() {
+ scheduler.destroyCalendar(null, true);
+ scheduler.renderCalendar({
+ position: inp,
+ date: new Date(this._date),
+ navigation: true,
+ handler: function(new_date) {
+ inp.value = scheduler.templates.calendar_time(new_date);
+ inp._date = new Date(new_date);
+ scheduler.destroyCalendar();
+ if (scheduler.config.event_duration && scheduler.config.auto_end_date && number == 0) { //first element = start date
+ _update_minical_select();
+ }
+ }
+ });
+ };
+ };
+
+ if (scheduler.config.full_day) {
+ if (!node._full_day) {
+ var html = "<label class='dhx_fullday'><input type='checkbox' name='full_day' value='true'> " + scheduler.locale.labels.full_day + " </label></input>";
+ if (!scheduler.config.wide_form)
+ html = node.previousSibling.innerHTML + html;
+ node.previousSibling.innerHTML = html;
+ node._full_day = true;
+ }
+ var input = node.previousSibling.getElementsByTagName("input")[0];
+
+ var isFulldayEvent = (scheduler.date.time_part(ev.start_date) == 0 && scheduler.date.time_part(ev.end_date) == 0);
+ input.checked = isFulldayEvent;
+
+ selects[0].disabled = input.checked;
+ selects[1].disabled = input.checked;
+
+ input.onclick = function() {
+ if (input.checked == true) {
+ var obj = {};
+ scheduler.form_blocks.calendar_time.get_value(node, obj);
+
+ var start_date = scheduler.date.date_part(obj.start_date);
+ var end_date = scheduler.date.date_part(obj.end_date);
+
+ if (+end_date == +start_date || (+end_date >= +start_date && (ev.end_date.getHours() != 0 || ev.end_date.getMinutes() != 0)))
+ end_date = scheduler.date.add(end_date, 1, "day");
+ }
+
+ var start = start_date || ev.start_date;
+ var end = end_date || ev.end_date;
+ _attach_action(inputs[0], start);
+ _attach_action(inputs[1], end);
+ selects[0].value = start.getHours() * 60 + start.getMinutes();
+ selects[1].value = end.getHours() * 60 + end.getMinutes();
+
+ selects[0].disabled = input.checked;
+ selects[1].disabled = input.checked;
+
+ };
+ }
+
+ if (scheduler.config.event_duration && scheduler.config.auto_end_date) {
+
+ function _update_minical_select() {
+ start_date = scheduler.date.add(inputs[0]._date, selects[0].value, "minute");
+ end_date = new Date(start_date.getTime() + (scheduler.config.event_duration * 60 * 1000));
+
+ inputs[1].value = scheduler.templates.calendar_time(end_date);
+ inputs[1]._date = scheduler.date.date_part(new Date(end_date));
+
+ selects[1].value = end_date.getHours() * 60 + end_date.getMinutes();
+ }
+
+ selects[0].onchange = _update_minical_select; // only update on first select should trigger update so user could define other end date if he wishes too
+ }
+
+ function _attach_action(inp, date, number) {
+ _init_once(inp, date, number);
+ inp.value = scheduler.templates.calendar_time(date);
+ inp._date = scheduler.date.date_part(new Date(date));
+ }
+
+ _attach_action(inputs[0], ev.start_date, 0);
+ _attach_action(inputs[1], ev.end_date, 1);
+ _init_once = function() {};
+
+ selects[0].value = ev.start_date.getHours() * 60 + ev.start_date.getMinutes();
+ selects[1].value = ev.end_date.getHours() * 60 + ev.end_date.getMinutes();
+
+ },
+ get_value: function(node, ev) {
+ var inputs = node.getElementsByTagName("input");
+ var selects = node.getElementsByTagName("select");
+
+ ev.start_date = scheduler.date.add(inputs[0]._date, selects[0].value, "minute");
+ ev.end_date = scheduler.date.add(inputs[1]._date, selects[1].value, "minute");
+
+ if (ev.end_date <= ev.start_date)
+ ev.end_date = scheduler.date.add(ev.start_date, scheduler.config.time_step, "minute");
+ },
+ focus: function(node) {
+ }
+};
+scheduler.linkCalendar = function(calendar, datediff) {
+ var action = function() {
+ var date = scheduler._date;
+ var dateNew = new Date(date.valueOf());
+ if (datediff) dateNew = datediff(dateNew);
+ dateNew.setDate(1);
+ scheduler.updateCalendar(calendar, dateNew);
+ return true;
+ };
+
+ scheduler.attachEvent("onViewChange", action);
+ scheduler.attachEvent("onXLE", action);
+ scheduler.attachEvent("onEventAdded", action);
+ scheduler.attachEvent("onEventChanged", action);
+ scheduler.attachEvent("onAfterEventDelete", action);
+ action();
+};
+
+scheduler._markCalendarCurrentDate = function(calendar) {
+ var date = scheduler._date;
+ var mode = scheduler._mode;
+ var month_start = scheduler.date.month_start(new Date(calendar._date));
+ var month_end = scheduler.date.add(month_start, 1, "month");
+
+ if (mode == 'day' || (this._props && !!this._props[mode])) { // if day or units view
+ if (month_start.valueOf() <= date.valueOf() && month_end > date) {
+ scheduler.markCalendar(calendar, date, "dhx_calendar_click");
+ }
+ } else if (mode == 'week') {
+ var dateNew = scheduler.date.week_start(new Date(date.valueOf()));
+ for (var i = 0; i < 7; i++) {
+ if (month_start.valueOf() <= dateNew.valueOf() && month_end > dateNew) // >= would mean mark first day of the next month
+ scheduler.markCalendar(calendar, dateNew, "dhx_calendar_click");
+ dateNew = scheduler.date.add(dateNew, 1, "day");
+ }
+ }
+};
+
+scheduler.attachEvent("onEventCancel", function(){
+ scheduler.destroyCalendar(null, true);
+});
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_multiselect.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_multiselect.js index 2890d0180a6..ccf9b911900 100644 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_multiselect.js +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_multiselect.js @@ -1,6 +1,6 @@ /* This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details +to use it in non-GPL project. Please contact sales@dhtmlx.com for details */ scheduler.form_blocks["multiselect"]={
render:function(sns) {
@@ -25,31 +25,30 @@ scheduler.form_blocks["multiselect"]={ _children[i].checked = !! ids[_children[i].value];
}
}
-
- if(!scheduler._new_event) { // if it is a new event - new to get saved options
- var _ids = [];
- if(ev[config.map_to]) {
- var results = ev[config.map_to].split(',');
- for(var i=0;i<results.length;i++){
- _ids[results[i]] = true;
+
+ var _ids = [];
+ if (ev[config.map_to]) {
+ var results = ev[config.map_to].split(',');
+ for (var i = 0; i < results.length; i++) {
+ _ids[results[i]] = true;
+ }
+ _mark_inputs(_ids);
+ } else {
+ if (scheduler._new_event || !config.script_url)
+ return;
+ var divLoading = document.createElement('div');
+ divLoading.className = 'dhx_loading';
+ divLoading.style.cssText = "position: absolute; top: 40%; left: 40%;";
+ node.appendChild(divLoading);
+ dhtmlxAjax.get(config.script_url + '?dhx_crosslink_' + config.map_to + '=' + ev.id + '&uid=' + scheduler.uid(), function(loader) {
+ var _result = loader.doXPath("//data/item");
+ var _ids = [];
+ for (var i = 0; i < _result.length; i++) {
+ _ids[_result[i].getAttribute(config.map_to)] = true;
}
_mark_inputs(_ids);
- }
- else {
- var divLoading = document.createElement('div');
- divLoading.className='dhx_loading';
- divLoading.style.cssText = "position: absolute; top: 40%; left: 40%;";
- node.appendChild(divLoading);
- dhtmlxAjax.get(config.script_url+'?dhx_crosslink_'+config.map_to+'='+ev.id+'&uid='+scheduler.uid(), function(loader) {
- var _result = loader.doXPath("//data/item");
- var _ids = [];
- for(var i=0;i<_result.length;i++){
- _ids[_result[i].getAttribute(config.map_to)] = true;
- }
- _mark_inputs(_ids);
- node.removeChild(divLoading);
- });
- }
+ node.removeChild(divLoading);
+ });
}
},
get_value:function(node,ev,config){
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_multisource.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_multisource.js index 2205f0553a0..eb8e193ca82 100644 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_multisource.js +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_multisource.js @@ -1,6 +1,6 @@ /* This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details +to use it in non-GPL project. Please contact sales@dhtmlx.com for details */ (function(){
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_offline.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_offline.js new file mode 100644 index 00000000000..0e8e2a21678 --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_offline.js @@ -0,0 +1,79 @@ +/* +This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in non-GPL project. Please contact sales@dhtmlx.com for details +*/ +scheduler.load=function(url,call){
+ if (typeof call == "string"){
+ this._process=call;
+ var type = call;
+ call = arguments[2];
+ }
+
+ this._load_url=url;
+ this._after_call=call;
+ if (url.$proxy) {
+ url.load(this, typeof type == "string" ? type : null);
+ return;
+ }
+
+ this._load(url,this._date);
+};
+
+scheduler._dp_init_backup = scheduler._dp_init;
+scheduler._dp_init = function(dp) {
+ dp._sendData = function(a1,rowId){
+ if (!a1) return; //nothing to send
+ if (!this.callEvent("onBeforeDataSending",rowId?[rowId,this.getState(rowId),a1]:[null, null, a1])) return false;
+ if (rowId)
+ this._in_progress[rowId]=(new Date()).valueOf();
+ if (this.serverProcessor.$proxy) {
+ var mode = this._tMode!="POST" ? 'get' : 'post';
+ var to_send = [];
+ for (var i in a1)
+ to_send.push({ id: i, data: a1[i], operation: this.getState(i)});
+ this.serverProcessor._send(to_send, mode, this);
+ return;
+ }
+
+ var a2=new dtmlXMLLoaderObject(this.afterUpdate,this,true);
+ var a3 = this.serverProcessor+(this._user?(getUrlSymbol(this.serverProcessor)+["dhx_user="+this._user,"dhx_version="+this.obj.getUserData(0,"version")].join("&")):"");
+ if (this._tMode!="POST")
+ a2.loadXML(a3+((a3.indexOf("?")!=-1)?"&":"?")+this.serialize(a1,rowId));
+ else
+ a2.loadXML(a3,true,this.serialize(a1,rowId));
+ this._waitMode++;
+ };
+
+ dp._updatesToParams = function(items) {
+ var stack = {};
+ for (var i = 0; i < items.length; i++)
+ stack[items[i].id] = items[i].data;
+ return this.serialize(stack);
+ };
+
+ dp._processResult = function(text, xml, loader) {
+ if (loader.status != 200) {
+ for (var i in this._in_progress) {
+ var state = this.getState(i);
+ this.afterUpdateCallback(i, i, state, null);
+ }
+ return;
+ }
+ xml = new dtmlXMLLoaderObject(function() {},this,true);
+ xml.loadXMLString(text);
+ xml.xmlDoc = loader;
+
+ this.afterUpdate(this, null, null, null, xml);
+ };
+ this._dp_init_backup(dp);
+}
+
+if (window.dataProcessor)
+ dataProcessor.prototype.init=function(obj){
+ this.init_original(obj);
+ obj._dataprocessor=this;
+
+ this.setTransactionMode("POST",true);
+ if (!this.serverProcessor.$proxy)
+ this.serverProcessor+=(this.serverProcessor.indexOf("?")!=-1?"&":"?")+"editing=true";
+ };
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_outerdrag.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_outerdrag.js index 406b1a02442..10cf72e6424 100644 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_outerdrag.js +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_outerdrag.js @@ -1,6 +1,6 @@ /* This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details +to use it in non-GPL project. Please contact sales@dhtmlx.com for details */ //lame old code doesn't provide raw event object
scheduler.attachEvent("onTemplatesReady", function(){
@@ -13,7 +13,10 @@ scheduler.attachEvent("onTemplatesReady", function(){ return old.apply(this, arguments);
};
dragger.addDragLanding(scheduler._els["dhx_cal_data"][0],{
- _drag:function(sourceHtmlObject,dhtmlObject,targetHtmlObject){
+ _drag:function(sourceHtmlObject,dhtmlObject,targetHtmlObject,targetHtml){
+
+ if (scheduler.checkEvent("onBeforeExternalDragIn") && !scheduler.callEvent("onBeforeExternalDragIn", [sourceHtmlObject,dhtmlObject,targetHtmlObject,targetHtml,last_event]))
+ return;
var temp = scheduler.attachEvent("onEventCreated", function(id,e){
if (!scheduler.callEvent("onExternalDragIn", [id, sourceHtmlObject, e])){
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_pdf.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_pdf.js new file mode 100644 index 00000000000..fad86c2e5d6 --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_pdf.js @@ -0,0 +1,276 @@ +/* +This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in non-GPL project. Please contact sales@dhtmlx.com for details +*/ +scheduler.toPDF=function(url,mode,header,footer){
+ var dx = 0;
+ var dy = 0;
+ var colors = false;
+ if (mode == "fullcolor"){
+ colors = true;
+ mode = "color";
+ }
+
+ mode = mode||"color";
+ html_regexp = new RegExp("<[^>]*>","g");
+ newline_regexp = new RegExp("<br[^>]*>","g");
+ function clean_html(val){
+ return val.replace(newline_regexp, "\n").replace(html_regexp,"");
+ }
+ function x_norm(x) {
+ x = parseFloat(x);
+ if (isNaN(x)) return "auto";
+ return 100 * x / (dx + 1);
+ }
+ function y_norm(y) {
+ y = parseFloat(y);
+ if (isNaN(y)) return "auto";
+ return 100 * y / dy;
+ }
+ function xml_month_scale(xh){
+ var xml="";
+ if (scheduler.matrix && scheduler.matrix[scheduler._mode]) {
+ if (scheduler.matrix[scheduler._mode].second_scale)
+ var xhs = xh[1].childNodes;
+
+ xh = xh[0].childNodes;
+ }
+
+
+ for (var i = 0; i < xh.length; i++)
+ xml += "\n<column><![CDATA[" + clean_html(xh[i].innerHTML) + "]]></column>";
+ dx = xh[0].offsetWidth;
+
+ if (xhs) {
+ var width = 0;
+ var top_width = xh[0].offsetWidth;
+ var top_col = 1;
+ for (var i = 0; i < xhs.length; i++) {
+ xml += "\n<column second_scale='"+top_col+"'><![CDATA[" + clean_html(xhs[i].innerHTML) + "]]></column>";
+ width+=xhs[i].offsetWidth;
+ if (width>=top_width){
+ top_width+=(xh[top_col] ? xh[top_col].offsetWidth: 0);
+ top_col++;
+ }
+ dx = xhs[0].offsetWidth;
+ }
+ }
+ return xml;
+ }
+ function de_day(node,n){
+ var x = parseInt(node.style.left,10);
+
+ for (var dx=0; dx < scheduler._cols.length; dx++){
+ x-=scheduler._cols[dx];
+ if (x<0) return dx;
+ }
+ return n;
+ }
+ function de_week(node,n){
+ var y = parseInt(node.style.top,10);
+ for (var dy=0; dy < scheduler._colsS.heights.length; dy++)
+ if (scheduler._colsS.heights[dy]>y) return dy;
+ return n;
+ }
+ function xml_month(yh){
+ var xml="";
+ var r = yh.firstChild.rows;
+ for (var i = 0; i < r.length; i++) {
+ var days = [];
+ for (var j = 0; j < r[i].cells.length; j++){
+ /* var dd = r[i].cells[j];
+ var css = dd.className;
+
+ if (css!=" " && css!="dhx_now ")
+ days.push("");
+ else*/
+ days.push(r[i].cells[j].firstChild.innerHTML);
+ }
+
+ xml += "\n<row height='"+yh.firstChild.rows[i].cells[0].offsetHeight+"'><![CDATA[" + clean_html(days.join("|")) + "]]></row>";
+ dy = yh.firstChild.rows[0].cells[0].offsetHeight;
+ }
+ return xml;
+ }
+ function xml_top(profile) {
+ var xml = "<data profile='"+profile+"'";
+ if (header)
+ xml+=" header='"+header+"'";
+ if (footer)
+ xml+=" footer='"+footer+"'";
+ xml+=">";
+ // detects if current mode is timeline
+ var mode = scheduler._mode;
+ if (scheduler.matrix && scheduler.matrix[scheduler._mode])
+ mode = (scheduler.matrix[scheduler._mode].render == "cell") ? "matrix" : "timeline";
+ xml += "<scale mode='" + mode + "' today='" + scheduler._els.dhx_cal_date[0].innerHTML + "'>";
+
+ if (scheduler._mode == "week_agenda"){
+ var xh = scheduler._els.dhx_cal_data[0].getElementsByTagName("DIV");
+ for (var i=0; i<xh.length; i++)
+ if (xh[i].className == "dhx_wa_scale_bar")
+ xml+="<column>"+clean_html(xh[i].innerHTML)+"</column>";
+ } else if (scheduler._mode == "agenda" || scheduler._mode == "map"){
+ var xh = scheduler._els.dhx_cal_header[0].childNodes[0].childNodes;
+
+ xml+="<column>"+clean_html(xh[0].innerHTML)+"</column><column>"+clean_html(xh[1].innerHTML)+"</column>";
+ } else if (scheduler._mode == "year"){
+ var xh = scheduler._els.dhx_cal_data[0].childNodes;
+ for (var i=0; i < xh.length; i++) {
+ xml+="<month label='"+clean_html(xh[i].childNodes[0].innerHTML)+"'>";
+ xml+=xml_month_scale(xh[i].childNodes[1].childNodes);
+ xml+=xml_month(xh[i].childNodes[2]);
+ xml+="</month>";
+ }
+ } else {
+ xml += "<x>";
+ var xh = scheduler._els.dhx_cal_header[0].childNodes;
+ xml+=xml_month_scale(xh);
+ xml += "</x>";
+
+ var yh = scheduler._els.dhx_cal_data[0];
+ if (scheduler.matrix && scheduler.matrix[scheduler._mode]) {
+ xml += "<y>";
+ for (var i=0; i < yh.firstChild.rows.length; i++) {
+ var el = yh.firstChild.rows[i];
+ xml+="<row><![CDATA["+clean_html(el.cells[0].innerHTML)+"]]></row>";
+ }
+ xml+="</y>";
+ dy = yh.firstChild.rows[0].cells[0].offsetHeight;
+ } else if (yh.firstChild.tagName == "TABLE") {
+ xml += xml_month(yh);
+ } else {
+ yh = yh.childNodes[yh.childNodes.length - 1];
+ while (yh.className.indexOf("dhx_scale_holder") == -1)
+ yh = yh.previousSibling;
+ yh = yh.childNodes;
+
+ xml += "<y>";
+ for (var i = 0; i < yh.length; i++)
+ xml += "\n<row><![CDATA[" + clean_html(yh[i].innerHTML) + "]]></row>";
+ xml += "</y>";
+ dy = yh[0].offsetHeight;
+ }
+ }
+ xml += "</scale>";
+ return xml;
+ }
+ function get_style(node, style){
+ return (window.getComputedStyle?(window.getComputedStyle(node, null)[style]):(node.currentStyle?node.currentStyle[style]:null))||"";
+ }
+ function xml_body() {
+ var xml = "";
+ var evs = scheduler._rendered;
+ if (scheduler._mode == "agenda" || scheduler._mode == "map"){
+ for (var i=0; i < evs.length; i++)
+ xml+="<event><head>"+clean_html(evs[i].childNodes[0].innerHTML)+"</head><body>"+clean_html(evs[i].childNodes[2].innerHTML)+"</body></event>";
+ } else if (scheduler._mode == "week_agenda"){
+ for (var i=0; i < evs.length; i++)
+ xml+="<event day='"+evs[i].parentNode.getAttribute("day")+"'><body>"+clean_html(evs[i].innerHTML)+"</body></event>";
+ } else if (scheduler._mode == "year"){
+ var evs = scheduler.get_visible_events();
+ for (var i=0; i < evs.length; i++) {
+ var d = evs[i].start_date;
+ if (d.valueOf()<scheduler._min_date.valueOf())
+ d = scheduler._min_date;
+ while (d<evs[i].end_date){
+ var m = d.getMonth()+12*(d.getFullYear()-scheduler._min_date.getFullYear())-scheduler.week_starts._month;
+ var day = scheduler.week_starts[m]+d.getDate()-1;
+ var text_color = colors?get_style(scheduler._get_year_cell(d),"color"):"";
+ var bg_color = colors?get_style(scheduler._get_year_cell(d),"backgroundColor"):"";
+
+ xml+="<event day='"+(day%7)+"' week='"+Math.floor(day/7)+"' month='"+m+"' backgroundColor='"+bg_color+"' color='" + text_color + "'></event>";
+ d = scheduler.date.add(d,1,"day");
+ if (d.valueOf()>=scheduler._max_date.valueOf())
+ break;
+ }
+ }
+ } else {
+ var matrix = scheduler.matrix && scheduler.matrix[scheduler._mode];
+ if (matrix && matrix.render == "cell"){
+ var evs = scheduler._els.dhx_cal_data[0].getElementsByTagName("TD");
+ for (var i = 0; i < evs.length; i++){
+ var text_color = colors?get_style(evs[i],"color"):"";
+ var bg_color = colors?get_style(evs[i],"backgroundColor"):"";
+ xml += "\n<event><body backgroundColor='"+bg_color+"' color='" + text_color + "'><![CDATA[" + clean_html(evs[i].innerHTML) + "]]></body></event>";
+ }
+ } else {
+ for (var i = 0; i < evs.length; i++) {
+ var zx = x_norm(evs[i].style.left);
+ var zdx = x_norm(evs[i].style.width);
+ if (isNaN(zdx*1)) continue;
+ var zy = y_norm(evs[i].style.top);
+ var zdy = y_norm(evs[i].style.height);
+ var e_type = evs[i].className.split(" ")[0].replace("dhx_cal_", "");
+ if (e_type === 'dhx_tooltip_line') continue;
+ var dets = scheduler.getEvent(evs[i].getAttribute("event_id"));
+// if (evs[i].parentNode == scheduler._els.dhx_cal_data[0]) continue;
+ var day = dets._sday;
+ var week = dets._sweek;
+ var length = dets._length || 0;
+ if (scheduler._mode != "month") {
+ if (scheduler.matrix && scheduler.matrix[scheduler._mode]){
+ day = 0;
+ var el = evs[i].parentNode.parentNode.parentNode;
+ week = el.rowIndex;
+ zdx += x_norm(10);
+ } else {
+
+ if (scheduler.xy.menu_width){
+ zdx+=x_norm(zdx*20/100);
+ zx-=x_norm(15-zx*20/100);
+ }
+
+ if (evs[i].parentNode == scheduler._els.dhx_cal_data[0]) continue;
+ zx += x_norm(evs[i].parentNode.style.left);
+ zx -= x_norm(51);
+ }
+ if (scheduler.matrix && scheduler.matrix[scheduler._mode]) {
+ var dy_copy = dy;
+ dy = evs[i].parentNode.offsetHeight;
+ zy = y_norm(evs[i].style.top);
+ zy -= zy*0.2;
+ dy = dy_copy;
+ }
+ } else {
+ zdy = parseInt(evs[i].offsetHeight,10);
+ zy = parseInt(evs[i].style.top,10) - 22;
+
+ day = de_day(evs[i],day);
+ week = de_week(evs[i],week);
+ }
+
+ xml += "\n<event week='"+week+"' day='"+day+"' type='" + e_type + "' x='" + zx + "' y='" + zy + "' width='" + zdx + "' height='" + zdy + "' len='" + length + "'>";
+
+
+ if (e_type == "event") {
+ xml += "<header><![CDATA[" + clean_html(evs[i].childNodes[1].innerHTML) + "]]></header>";
+ var text_color = colors?get_style(evs[i].childNodes[2],"color"):"";
+ var bg_color = colors?get_style(evs[i].childNodes[2],"backgroundColor"):"";
+ xml += "<body backgroundColor='"+bg_color+"' color='" + text_color + "'><![CDATA[" + clean_html(evs[i].childNodes[2].innerHTML) + "]]></body>";
+ } else {
+ var text_color = colors?get_style(evs[i],"color"):"";
+ var bg_color = colors?get_style(evs[i],"backgroundColor"):"";
+ xml += "<body backgroundColor='"+bg_color+"' color='" + text_color + "'><![CDATA[" + clean_html(evs[i].innerHTML) + "]]></body>";
+ }
+ xml += "</event>";
+ }
+ }
+ }
+ return xml;
+ }
+ function xml_end(){
+ var xml = "</data>";
+ return xml;
+ }
+
+ var uid = (new Date()).valueOf();
+ var d=document.createElement("div");
+ d.style.display="none";
+ document.body.appendChild(d);
+
+ d.innerHTML = '<form id="'+uid+'" method="post" target="_blank" action="'+url+'" accept-charset="utf-8" enctype="application/x-www-form-urlencoded"><input type="hidden" name="mycoolxmlbody"/> </form>';
+ document.getElementById(uid).firstChild.value = encodeURIComponent(xml_top(mode).replace("\u2013", "-") + xml_body() + xml_end());
+ document.getElementById(uid).submit();
+ d.parentNode.removeChild(d);grid = null;
+};
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_readonly.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_readonly.js index 9bd1df9d859..df888122424 100644 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_readonly.js +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_readonly.js @@ -1,20 +1,69 @@ /* This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details +to use it in non-GPL project. Please contact sales@dhtmlx.com for details */ scheduler.attachEvent("onTemplatesReady", function() {
+ var original_sns = scheduler.config.lightbox.sections;
+ var recurring_section = null;
+ var original_left_buttons = scheduler.config.buttons_left.slice();
+ var original_right_buttons = scheduler.config.buttons_right.slice();
+
+
scheduler.attachEvent("onBeforeLightbox", function(id) {
- if (this.config.readonly_form || this.getEvent(id).readonly)
+ if (this.config.readonly_form || this.getEvent(id).readonly) {
this.config.readonly_active = true;
+
+ for (var i = 0; i < this.config.lightbox.sections.length; i++) {
+ this.config.lightbox.sections[i].focus = false;
+ }
+ }
else {
this.config.readonly_active = false;
- return true;
+ scheduler.config.buttons_left = original_left_buttons.slice();
+ scheduler.config.buttons_right = original_right_buttons.slice();
}
- for (var i = 0; i < this.config.lightbox.sections.length; i++) {
- this.config.lightbox.sections[i].focus = false;
+ var sns = this.config.lightbox.sections;
+ if (this.config.readonly_active) {
+ var is_rec_found = false;
+ for (var i = 0; i < sns.length; i++) {
+ if (sns[i].type == 'recurring') {
+ recurring_section = sns[i];
+ if (this.config.readonly_active) {
+ sns.splice(i, 1);
+ }
+ break;
+ }
+ }
+ if (!is_rec_found && !this.config.readonly_active && recurring_section) {
+ // need to restore restore section
+ sns.splice(sns.length-2,0,recurring_section);
+ }
+
+ var forbidden_buttons = ["dhx_delete_btn", "dhx_save_btn"];
+ var button_arrays = [scheduler.config.buttons_left, scheduler.config.buttons_right];
+ for (var i = 0; i < forbidden_buttons.length; i++) {
+ var forbidden_button = forbidden_buttons[i];
+ for (var k = 0; k < button_arrays.length; k++) {
+ var button_array = button_arrays[k];
+ var index = -1;
+ for (var p = 0; p < button_array.length; p++) {
+ if (button_array[p] == forbidden_button) {
+ index = p;
+ break;
+ }
+ }
+ if (index != -1) {
+ button_array.splice(index, 1);
+ }
+ }
+ }
+
+
}
+ this.resetLightbox();
+
return true;
});
@@ -37,26 +86,13 @@ scheduler.attachEvent("onTemplatesReady", function() { var old = scheduler._fill_lightbox;
scheduler._fill_lightbox = function() {
- var sns = this.config.lightbox.sections;
- if (this.config.readonly_active) {
- for (var i = 0; i < sns.length; i++) {
- if (sns[i].type == 'recurring') {
- var s = document.getElementById(sns[i].id);
- s.style.display = s.nextSibling.style.display = 'none';
- sns.splice(i, 1);
- i--;
- }
- }
- }
-
var res = old.apply(this, arguments);
if (this.config.readonly_active) {
- var d = this._get_lightbox();
+ var d = this.getLightbox();
var n = this._lightbox_r = d.cloneNode(true);
n.id = scheduler.uid();
- n.style.color = "red";
txt_replace("textarea", d, n, function(a) {
return a.value;
@@ -66,9 +102,6 @@ scheduler.attachEvent("onTemplatesReady", function() { return a.options[Math.max((a.selectedIndex || 0), 0)].text;
});
- n.removeChild(n.childNodes[2]);
- n.removeChild(n.childNodes[3]);
-
d.parentNode.insertBefore(n, d);
olds.call(this, n);
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_recurring.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_recurring.js new file mode 100644 index 00000000000..998fe8bedd2 --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_recurring.js @@ -0,0 +1,750 @@ +/* +This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in non-GPL project. Please contact sales@dhtmlx.com for details +*/ + +scheduler.config.occurrence_timestamp_in_utc = false;
+scheduler.form_blocks["recurring"] = {
+ render:function(sns) {
+ return scheduler.__recurring_template;
+ },
+ _ds: {},
+ _init_set_value:function(node, value, ev) {
+ scheduler.form_blocks["recurring"]._ds = {start:ev.start_date, end:ev._end_date};
+
+ var str_date_format = scheduler.date.str_to_date(scheduler.config.repeat_date);
+ var str_date = function(str_date) {
+ var date = str_date_format(str_date);
+ if (scheduler.config.include_end_by)
+ date = scheduler.date.add(date, 1, 'day');
+ return date;
+ };
+
+ var date_str = scheduler.date.date_to_str(scheduler.config.repeat_date);
+
+ var top = node.getElementsByTagName("FORM")[0];
+ var els = [];
+
+ function register_els(inps) {
+ for (var i = 0; i < inps.length; i++) {
+ var inp = inps[i];
+ if (inp.type == "checkbox" || inp.type == "radio") {
+ if (!els[inp.name])
+ els[inp.name] = [];
+ els[inp.name].push(inp);
+ } else
+ els[inp.name] = inp;
+ }
+ }
+
+ register_els(top.getElementsByTagName("INPUT"));
+ register_els(top.getElementsByTagName("SELECT"));
+
+ if (!scheduler.config.repeat_date_of_end) {
+ var formatter = scheduler.date.date_to_str(scheduler.config.repeat_date);
+ scheduler.config.repeat_date_of_end = formatter(scheduler.date.add(new Date(), 30, "day"));
+ }
+ els["date_of_end"].value = scheduler.config.repeat_date_of_end;
+
+ var $ = function(a) {
+ return document.getElementById(a);
+ };
+
+ function get_radio_value(name) {
+ var col = els[name];
+ for (var i = 0; i < col.length; i++)
+ if (col[i].checked) return col[i].value;
+ }
+
+ function change_current_view() {
+ $("dhx_repeat_day").style.display = "none";
+ $("dhx_repeat_week").style.display = "none";
+ $("dhx_repeat_month").style.display = "none";
+ $("dhx_repeat_year").style.display = "none";
+ $("dhx_repeat_" + this.value).style.display = "block";
+ }
+
+ function get_repeat_code(dates) {
+ var code = [get_radio_value("repeat")];
+ get_rcode[code[0]](code, dates);
+
+ while (code.length < 5) code.push("");
+ var repeat = "";
+ if (els["end"][0].checked) {
+ dates.end = new Date(9999, 1, 1);
+ repeat = "no";
+ }
+ else if (els["end"][2].checked) {
+ dates.end = str_date(els["date_of_end"].value);
+ }
+ else {
+ scheduler.transpose_type(code.join("_"));
+ repeat = Math.max(1, els["occurences_count"].value);
+ var transp = ((code[0] == "week" && code[4] && code[4].toString().indexOf(scheduler.config.start_on_monday ? 1 : 0) == -1) ? 1 : 0);
+ dates.end = scheduler.date.add(new Date(dates.start), repeat + transp, code.join("_"));
+ }
+
+ return code.join("_") + "#" + repeat;
+ }
+
+ scheduler.form_blocks["recurring"]._get_repeat_code = get_repeat_code;
+ var get_rcode = {
+ month:function(code, dates) {
+ if (get_radio_value("month_type") == "d") {
+ code.push(Math.max(1, els["month_count"].value));
+ dates.start.setDate(els["month_day"].value);
+ } else {
+ code.push(Math.max(1, els["month_count2"].value));
+ code.push(els["month_day2"].value);
+ code.push(Math.max(1, els["month_week2"].value));
+ dates.start.setDate(1);
+ }
+ dates._start = true;
+ },
+ week:function(code, dates) {
+ code.push(Math.max(1, els["week_count"].value));
+ code.push("");
+ code.push("");
+ var t = [];
+ var col = els["week_day"];
+ for (var i = 0; i < col.length; i++) {
+ if (col[i].checked) t.push(col[i].value);
+ }
+ if (!t.length)
+ t.push(dates.start.getDay());
+
+ dates.start = scheduler.date.week_start(dates.start);
+ dates._start = true;
+
+ code.push(t.sort().join(","));
+ },
+ day:function(code) {
+ if (get_radio_value("day_type") == "d") {
+ code.push(Math.max(1, els["day_count"].value));
+ }
+ else {
+ code.push("week");
+ code.push(1);
+ code.push("");
+ code.push("");
+ code.push("1,2,3,4,5");
+ code.splice(0, 1);
+ }
+ },
+ year:function(code, dates) {
+ if (get_radio_value("year_type") == "d") {
+ code.push("1");
+ dates.start.setMonth(0);
+ dates.start.setDate(els["year_day"].value);
+ dates.start.setMonth(els["year_month"].value);
+
+ } else {
+ code.push("1");
+ code.push(els["year_day2"].value);
+ code.push(els["year_week2"].value);
+ dates.start.setDate(1);
+ dates.start.setMonth(els["year_month2"].value);
+ }
+ dates._start = true;
+ }
+ };
+ var set_rcode = {
+ week:function(code, dates) {
+ els["week_count"].value = code[1];
+ var col = els["week_day"];
+ var t = code[4].split(",");
+ var d = {};
+ for (var i = 0; i < t.length; i++) d[t[i]] = true;
+ for (var i = 0; i < col.length; i++)
+ col[i].checked = (!!d[col[i].value]);
+ },
+ month:function(code, dates) {
+ if (code[2] == "") {
+ els["month_type"][0].checked = true;
+ els["month_count"].value = code[1];
+ els["month_day"].value = dates.start.getDate();
+ } else {
+ els["month_type"][1].checked = true;
+ els["month_count2"].value = code[1];
+ els["month_week2"].value = code[3];
+ els["month_day2"].value = code[2];
+ }
+ },
+ day:function(code, dates) {
+ els["day_type"][0].checked = true;
+ els["day_count"].value = code[1];
+ },
+ year:function(code, dates) {
+ if (code[2] == "") {
+ els["year_type"][0].checked = true;
+ els["year_day"].value = dates.start.getDate();
+ els["year_month"].value = dates.start.getMonth();
+ } else {
+ els["year_type"][1].checked = true;
+ els["year_week2"].value = code[3];
+ els["year_day2"].value = code[2];
+ els["year_month2"].value = dates.start.getMonth();
+ }
+ }
+ };
+
+ function set_repeat_code(code, dates) {
+ var data = code.split("#");
+ code = data[0].split("_");
+ set_rcode[code[0]](code, dates);
+ var e = els["repeat"][({day:0, week:1, month:2, year:3})[code[0]]];
+ switch (data[1]) {
+ case "no":
+ els["end"][0].checked = true;
+ break;
+ case "":
+ els["end"][2].checked = true;
+ els["date_of_end"].value = date_str(dates.end);
+ break;
+ default:
+ els["end"][1].checked = true;
+ els["occurences_count"].value = data[1];
+ break;
+ }
+
+ e.checked = true;
+ e.onclick();
+ }
+
+ scheduler.form_blocks["recurring"]._set_repeat_code = set_repeat_code;
+
+ for (var i = 0; i < top.elements.length; i++) {
+ var el = top.elements[i];
+ switch (el.name) {
+ case "repeat":
+ el.onclick = change_current_view;
+ break;
+ }
+ }
+ scheduler._lightbox._rec_init_done = true;
+ },
+ set_value:function(node, value, ev) {
+ var rf = scheduler.form_blocks["recurring"];
+ if (!scheduler._lightbox._rec_init_done)
+ rf._init_set_value(node, value, ev);
+ node.open = !ev.rec_type;
+ if (ev.event_pid && ev.event_pid != "0")
+ node.blocked = true;
+ else node.blocked = false;
+
+ var ds = rf._ds;
+ ds.start = ev.start_date;
+ ds.end = ev._end_date;
+
+ rf.button_click(0, node.previousSibling.firstChild.firstChild, node, node);
+ if (value)
+ rf._set_repeat_code(value, ds);
+ },
+ get_value:function(node, ev) {
+ if (node.open) {
+ var ds = scheduler.form_blocks["recurring"]._ds;
+ var actual_dates = {};
+ this.formSection('time').getValue(actual_dates);
+ ds.start = actual_dates.start_date;
+ ev.rec_type = scheduler.form_blocks["recurring"]._get_repeat_code(ds);
+ if (ds._start) {
+ ev.start_date = new Date(ds.start);
+ ev._start_date = new Date(ds.start);
+ ds._start = false;
+ } else
+ ev._start_date = null;
+
+ ev._end_date = ev.end_date = ds.end;
+ ev.rec_pattern = ev.rec_type.split("#")[0];
+ } else {
+ ev.rec_type = ev.rec_pattern = "";
+ ev._end_date = ev.end_date;
+ }
+ return ev.rec_type;
+ },
+ focus:function(node) {
+ },
+ button_click:function(index, el, section, cont) {
+ if (!cont.open && !cont.blocked) {
+ cont.style.height = "115px";
+ el.style.backgroundPosition = "-5px 0px";
+ el.nextSibling.innerHTML = scheduler.locale.labels.button_recurring_open;
+ } else {
+ cont.style.height = "0px";
+ el.style.backgroundPosition = "-5px 20px";
+ el.nextSibling.innerHTML = scheduler.locale.labels.button_recurring;
+ }
+ cont.open = !cont.open;
+
+ scheduler.setLightboxSize();
+ }
+};
+
+
+//problem may occur if we will have two repeating events in the same moment of time
+scheduler._rec_markers = {};
+scheduler._rec_markers_pull = {};
+scheduler._add_rec_marker = function(ev, time) {
+ ev._pid_time = time;
+ this._rec_markers[ev.id] = ev;
+ if (!this._rec_markers_pull[ev.event_pid]) this._rec_markers_pull[ev.event_pid] = {};
+ this._rec_markers_pull[ev.event_pid][time] = ev;
+};
+scheduler._get_rec_marker = function(time, id) {
+ var ch = this._rec_markers_pull[id];
+ if (ch) return ch[time];
+ return null;
+};
+scheduler._get_rec_markers = function(id) {
+ return (this._rec_markers_pull[id] || []);
+};
+scheduler._rec_temp = [];
+(function() {
+ var old_add_event = scheduler.addEvent;
+ scheduler.addEvent = function(start_date, end_date, text, id, extra_data) {
+ var ev_id = old_add_event.apply(this, arguments);
+
+ if (ev_id) {
+ var ev = scheduler.getEvent(ev_id);
+ if (ev.event_pid != 0)
+ scheduler._add_rec_marker(ev, ev.event_length * 1000);
+ if (ev.rec_type)
+ ev.rec_pattern = ev.rec_type.split("#")[0];
+ }
+ };
+})();
+scheduler.attachEvent("onEventIdChange", function(id, new_id) {
+ if (this._ignore_call) return;
+ this._ignore_call = true;
+
+ for (var i = 0; i < this._rec_temp.length; i++) {
+ var tev = this._rec_temp[i];
+ if (tev.event_pid == id) {
+ tev.event_pid = new_id;
+ this.changeEventId(tev.id, new_id + "#" + tev.id.split("#")[1]);
+ }
+ }
+
+ delete this._ignore_call;
+});
+scheduler.attachEvent("onBeforeEventDelete", function(id) {
+ var ev = this.getEvent(id);
+ if (id.toString().indexOf("#") != -1 || (ev.event_pid && ev.event_pid != "0" && ev.rec_type && ev.rec_type != 'none')) {
+ id = id.split("#");
+ var nid = this.uid();
+ var tid = (id[1]) ? id[1] : (ev._pid_time / 1000);
+
+ var nev = this._copy_event(ev);
+ nev.id = nid;
+ nev.event_pid = ev.event_pid || id[0];
+ var timestamp = tid;
+ nev.event_length = timestamp;
+ nev.rec_type = nev.rec_pattern = "none";
+ this.addEvent(nev);
+
+ this._add_rec_marker(nev, timestamp * 1000);
+ } else {
+ if (ev.rec_type && this._lightbox_id)
+ this._roll_back_dates(ev);
+ var sub = this._get_rec_markers(id);
+ for (var i in sub) {
+ if (sub.hasOwnProperty(i)) {
+ id = sub[i].id;
+ if (this.getEvent(id))
+ this.deleteEvent(id, true);
+ }
+ }
+ }
+ return true;
+});
+
+scheduler.attachEvent("onEventChanged", function(id) {
+ if (this._loading) return true;
+
+ var ev = this.getEvent(id);
+ if (id.toString().indexOf("#") != -1) {
+ var id = id.split("#");
+ var nid = this.uid();
+ this._not_render = true;
+
+ var nev = this._copy_event(ev);
+ nev.id = nid;
+ nev.event_pid = id[0];
+ var timestamp = id[1];
+ nev.event_length = timestamp;
+ nev.rec_type = nev.rec_pattern = "";
+ this.addEvent(nev);
+
+ this._not_render = false;
+ this._add_rec_marker(nev, timestamp * 1000);
+ } else {
+ if (ev.rec_type && this._lightbox_id)
+ this._roll_back_dates(ev);
+ var sub = this._get_rec_markers(id);
+ for (var i in sub) {
+ if (sub.hasOwnProperty(i)) {
+ delete this._rec_markers[sub[i].id];
+ this.deleteEvent(sub[i].id, true);
+ }
+ }
+ delete this._rec_markers_pull[id];
+
+ // it's possible that after editing event is no longer exists, in such case we need to remove _select_id flag
+ var isEventFound = false;
+ for (var k = 0; k < this._rendered.length; k++) {
+ if (this._rendered[k].getAttribute('event_id') == id)
+ isEventFound = true;
+ }
+ if (!isEventFound)
+ this._select_id = null;
+ }
+ return true;
+});
+scheduler.attachEvent("onEventAdded", function(id) {
+ if (!this._loading) {
+ var ev = this.getEvent(id);
+ if (ev.rec_type && !ev.event_length)
+ this._roll_back_dates(ev);
+ }
+ return true;
+});
+scheduler.attachEvent("onEventSave", function(id, data, is_new_event) {
+ var ev = this.getEvent(id);
+ if (!ev.rec_type && data.rec_type && (id + '').indexOf('#') == -1)
+ this._select_id = null;
+ return true;
+});
+scheduler.attachEvent("onEventCreated", function(id) {
+ var ev = this.getEvent(id);
+ if (!ev.rec_type)
+ ev.rec_type = ev.rec_pattern = ev.event_length = ev.event_pid = "";
+ return true;
+});
+scheduler.attachEvent("onEventCancel", function(id) {
+ var ev = this.getEvent(id);
+ if (ev.rec_type) {
+ this._roll_back_dates(ev);
+ // a bit expensive, but we need to be sure that event re-rendered, because view can be corrupted by resize , during edit process
+ this.render_view_data();
+ }
+});
+scheduler._roll_back_dates = function(ev) {
+ ev.event_length = (ev.end_date.valueOf() - ev.start_date.valueOf()) / 1000;
+ ev.end_date = ev._end_date;
+ if (ev._start_date) {
+ ev.start_date.setMonth(0);
+ ev.start_date.setDate(ev._start_date.getDate());
+ ev.start_date.setMonth(ev._start_date.getMonth());
+ ev.start_date.setFullYear(ev._start_date.getFullYear());
+
+ }
+};
+
+scheduler.validId = function(id) {
+ return id.toString().indexOf("#") == -1;
+};
+
+scheduler.showLightbox_rec = scheduler.showLightbox;
+scheduler.showLightbox = function(id) {
+ var locale = this.locale;
+ var c = scheduler.config.lightbox_recurring;
+ var pid = this.getEvent(id).event_pid;
+ var isVirtual = (id.toString().indexOf("#") != -1);
+ if (isVirtual)
+ pid = id.split("#")[0];
+ if ( !pid || pid == 0 || ( (!locale.labels.confirm_recurring || c == 'instance') || (c == 'series' && !isVirtual)) ) {
+ return this.showLightbox_rec(id); // editing instance or non recurring event
+ }
+ // show series
+ var callback = function() {
+ pid = this.getEvent(pid);
+ pid._end_date = pid.end_date;
+ pid.end_date = new Date(pid.start_date.valueOf() + pid.event_length * 1000);
+ return this.showLightbox_rec(pid.id); // editing series
+ };
+ if (c == 'ask') {
+ var that = this;
+ dhtmlx.modalbox({
+ text: locale.labels.confirm_recurring,
+ title: locale.labels.title_confirm_recurring,
+ width: "500px",
+ position: "middle",
+ buttons:[locale.labels.button_edit_series, locale.labels.button_edit_occurrence, locale.labels.icon_cancel],
+ callback: function(index) {
+ switch(+index) {
+ case 0:
+ return callback.call(that);
+ case 1:
+ return that.showLightbox_rec(id);
+ case 2:
+ return;
+ }
+ }
+ });
+ } else {
+ callback();
+ }
+
+};
+
+
+scheduler.get_visible_events_rec = scheduler.get_visible_events;
+scheduler.get_visible_events = function(only_timed) {
+ for (var i = 0; i < this._rec_temp.length; i++)
+ delete this._events[this._rec_temp[i].id];
+ this._rec_temp = [];
+
+ var stack = this.get_visible_events_rec(only_timed);
+ var out = [];
+ for (var i = 0; i < stack.length; i++) {
+ if (stack[i].rec_type) {
+ //deleted element of serie
+ if (stack[i].rec_pattern != "none")
+ this.repeat_date(stack[i], out);
+ }
+ else out.push(stack[i]);
+ }
+ return out;
+};
+
+
+(function() {
+ var old = scheduler.is_one_day_event;
+ scheduler.is_one_day_event = function(ev) {
+ if (ev.rec_type) return true;
+ return old.call(this, ev);
+ };
+ var old_update_event = scheduler.updateEvent;
+ scheduler.updateEvent = function(id) {
+ var ev = scheduler.getEvent(id);
+ if (ev && ev.rec_type && id.toString().indexOf('#') === -1) {
+ scheduler.update_view();
+ } else {
+ old_update_event.call(this, id);
+ }
+ };
+})();
+
+scheduler.transponse_size = {
+ day:1, week:7, month:1, year:12
+};
+scheduler.date.day_week = function(sd, day, week) {
+ sd.setDate(1);
+ week = (week - 1) * 7;
+ var cday = sd.getDay();
+ var nday = day * 1 + week - cday + 1;
+ sd.setDate(nday <= week ? (nday + 7) : nday);
+};
+scheduler.transpose_day_week = function(sd, list, cor, size, cor2) {
+ var cday = (sd.getDay() || (scheduler.config.start_on_monday ? 7 : 0)) - cor;
+ for (var i = 0; i < list.length; i++) {
+ if (list[i] > cday)
+ return sd.setDate(sd.getDate() + list[i] * 1 - cday - (size ? cor : cor2));
+ }
+ this.transpose_day_week(sd, list, cor + size, null, cor);
+};
+scheduler.transpose_type = function(type) {
+ var f = "transpose_" + type;
+ if (!this.date[f]) {
+ var str = type.split("_");
+ var day = 60 * 60 * 24 * 1000;
+ var gf = "add_" + type;
+ var step = this.transponse_size[str[0]] * str[1];
+
+ if (str[0] == "day" || str[0] == "week") {
+ var days = null;
+ if (str[4]) {
+ days = str[4].split(",");
+ if (scheduler.config.start_on_monday) {
+ for (var i = 0; i < days.length; i++)
+ days[i] = (days[i] * 1) || 7;
+ days.sort();
+ }
+ }
+
+
+ this.date[f] = function(nd, td) {
+ var delta = Math.floor((td.valueOf() - nd.valueOf()) / (day * step));
+ if (delta > 0)
+ nd.setDate(nd.getDate() + delta * step);
+ if (days)
+ scheduler.transpose_day_week(nd, days, 1, step);
+ };
+ this.date[gf] = function(sd, inc) {
+ var nd = new Date(sd.valueOf());
+ if (days) {
+ for (var count = 0; count < inc; count++)
+ scheduler.transpose_day_week(nd, days, 0, step);
+ } else
+ nd.setDate(nd.getDate() + inc * step);
+
+ return nd;
+ };
+ }
+ else if (str[0] == "month" || str[0] == "year") {
+ this.date[f] = function(nd, td) {
+ var delta = Math.ceil(((td.getFullYear() * 12 + td.getMonth() * 1) - (nd.getFullYear() * 12 + nd.getMonth() * 1)) / (step));
+ if (delta >= 0)
+ nd.setMonth(nd.getMonth() + delta * step);
+ if (str[3])
+ scheduler.date.day_week(nd, str[2], str[3]);
+ };
+ this.date[gf] = function(sd, inc) {
+ var nd = new Date(sd.valueOf());
+ nd.setMonth(nd.getMonth() + inc * step);
+ if (str[3])
+ scheduler.date.day_week(nd, str[2], str[3]);
+ return nd;
+ };
+ }
+ }
+};
+scheduler.repeat_date = function(ev, stack, non_render, from, to) {
+
+ from = from || this._min_date;
+ to = to || this._max_date;
+
+ var td = new Date(ev.start_date.valueOf());
+
+ if (!ev.rec_pattern && ev.rec_type)
+ ev.rec_pattern = ev.rec_type.split("#")[0];
+
+ this.transpose_type(ev.rec_pattern);
+ scheduler.date["transpose_" + ev.rec_pattern](td, from);
+ while (td < ev.start_date || scheduler._fix_daylight_saving_date(td,from,ev,td,new Date(td.valueOf() + ev.event_length * 1000)).valueOf() <= from.valueOf() || td.valueOf() + ev.event_length * 1000 <= from.valueOf())
+ td = this.date.add(td, 1, ev.rec_pattern);
+ while (td < to && td < ev.end_date) {
+ var timestamp = (scheduler.config.occurrence_timestamp_in_utc) ? Date.UTC(td.getFullYear(), td.getMonth(), td.getDate(), td.getHours(), td.getMinutes(), td.getSeconds()) : td.valueOf();
+ var ch = this._get_rec_marker(timestamp, ev.id);
+ if (!ch) { // unmodified element of series
+ var ted = new Date(td.valueOf() + ev.event_length * 1000);
+ var copy = this._copy_event(ev);
+ //copy._timed = ev._timed;
+ copy.text = ev.text;
+ copy.start_date = td;
+ copy.event_pid = ev.id;
+ copy.id = ev.id + "#" + Math.ceil(timestamp / 1000);
+ copy.end_date = ted;
+
+ copy.end_date = scheduler._fix_daylight_saving_date(copy.start_date, copy.end_date, ev, td, copy.end_date);
+
+ copy._timed = this.is_one_day_event(copy);
+
+ if (!copy._timed && !this._table_view && !this.config.multi_day) return;
+ stack.push(copy);
+
+ if (!non_render) {
+ this._events[copy.id] = copy;
+ this._rec_temp.push(copy);
+ }
+
+ } else
+ if (non_render) stack.push(ch);
+
+ td = this.date.add(td, 1, ev.rec_pattern);
+ }
+};
+scheduler._fix_daylight_saving_date = function(start_date, end_date, ev, counter, default_date) {
+ var shift = start_date.getTimezoneOffset() - end_date.getTimezoneOffset();
+ if (shift) {
+ if (shift > 0) {
+ // e.g. 24h -> 23h
+ return new Date(counter.valueOf() + ev.event_length * 1000 - shift * 60 * 1000);
+ }
+ else {
+ // e.g. 24h -> 25h
+ return new Date(end_date.valueOf() - shift * 60 * 1000);
+ }
+ }
+ return new Date(default_date.valueOf());
+};
+scheduler.getRecDates = function(id, max) {
+ var ev = typeof id == "object" ? id : scheduler.getEvent(id);
+ var count = 0;
+ var result = [];
+ max = max || 100;
+
+ var td = new Date(ev.start_date.valueOf());
+ var from = new Date(td.valueOf());
+
+ if (!ev.rec_type) {
+ return [
+ { start_date: ev.start_date, end_date: ev.end_date }
+ ];
+ }
+ if (ev.rec_type == "none") {
+ return [];
+ }
+ this.transpose_type(ev.rec_pattern);
+ scheduler.date["transpose_" + ev.rec_pattern](td, from);
+
+ while (td < ev.start_date || (td.valueOf() + ev.event_length * 1000) <= from.valueOf())
+ td = this.date.add(td, 1, ev.rec_pattern);
+ while (td < ev.end_date) {
+ var ch = this._get_rec_marker(td.valueOf(), ev.id);
+ var res = true;
+ if (!ch) { // unmodified element of series
+ var sed = new Date(td);
+ var ted = new Date(td.valueOf() + ev.event_length * 1000);
+
+ ted = scheduler._fix_daylight_saving_date(sed, ted, ev, td, ted);
+
+ result.push({start_date:sed, end_date:ted});
+ } else {
+ (ch.rec_type == "none") ?
+ (res = false) :
+ result.push({ start_date: ch.start_date, end_date: ch.end_date });
+ }
+ td = this.date.add(td, 1, ev.rec_pattern);
+ if (res) {
+ count++;
+ if (count == max)
+ break;
+ }
+ }
+ return result;
+};
+scheduler.getEvents = function(from, to) {
+ var result = [];
+ for (var a in this._events) {
+ var ev = this._events[a];
+ if (ev && ev.start_date < to && ev.end_date > from) {
+ if (ev.rec_pattern) {
+ if (ev.rec_pattern == "none") continue;
+ var sev = [];
+ this.repeat_date(ev, sev, true, from, to);
+ for (var i = 0; i < sev.length; i++) {
+ // if event is in rec_markers then it will be checked by himself, here need to skip it
+ if (!sev[i].rec_pattern && sev[i].start_date < to && sev[i].end_date > from && !this._rec_markers[sev[i].id]) {
+ result.push(sev[i]);
+ }
+ }
+ } else if (ev.id.toString().indexOf("#") == -1) { // if it's virtual event we can skip it
+ result.push(ev);
+ }
+ }
+ }
+ return result;
+};
+
+scheduler.config.repeat_date = "%m.%d.%Y";
+scheduler.config.lightbox.sections = [
+ {name:"description", height:130, map_to:"text", type:"textarea" , focus:true},
+ {name:"recurring", type:"recurring", map_to:"rec_type", button:"recurring"},
+ {name:"time", height:72, type:"time", map_to:"auto"}
+];
+
+
+//drop secondary attributes
+scheduler._copy_dummy = function(ev) {
+ var start_date = new Date(this.start_date);
+ var end_date = new Date(this.end_date);
+ this.start_date = start_date;
+ this.end_date = end_date;
+ this.event_length = this.event_pid = this.rec_pattern = this.rec_type = null;
+};
+
+scheduler.config.include_end_by = false;
+scheduler.config.lightbox_recurring = 'ask'; // series, instance +scheduler.__recurring_template='<div class="dhx_form_repeat"> <form> <div class="dhx_repeat_left"> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="day" />Daily</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="week"/>Weekly</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="month" checked />Monthly</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="year" />Yearly</label> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_center"> <div style="display:none;" id="dhx_repeat_day"> <label><input class="dhx_repeat_radio" type="radio" name="day_type" value="d"/>Every</label><input class="dhx_repeat_text" type="text" name="day_count" value="1" />day<br /> <label><input class="dhx_repeat_radio" type="radio" name="day_type" checked value="w"/>Every workday</label> </div> <div style="display:none;" id="dhx_repeat_week"> Repeat every<input class="dhx_repeat_text" type="text" name="week_count" value="1" />week next days:<br /> <table class="dhx_repeat_days"> <tr> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="1" />Monday</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="4" />Thursday</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="2" />Tuesday</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="5" />Friday</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="3" />Wednesday</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="6" />Saturday</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="0" />Sunday</label><br /><br /> </td> </tr> </table> </div> <div id="dhx_repeat_month"> <label><input class="dhx_repeat_radio" type="radio" name="month_type" value="d"/>Repeat</label><input class="dhx_repeat_text" type="text" name="month_day" value="1" />day every<input class="dhx_repeat_text" type="text" name="month_count" value="1" />month<br /> <label><input class="dhx_repeat_radio" type="radio" name="month_type" checked value="w"/>On</label><input class="dhx_repeat_text" type="text" name="month_week2" value="1" /><select name="month_day2"><option value="1" selected >Monday<option value="2">Tuesday<option value="3">Wednesday<option value="4">Thursday<option value="5">Friday<option value="6">Saturday<option value="0">Sunday</select>every<input class="dhx_repeat_text" type="text" name="month_count2" value="1" />month<br /> </div> <div style="display:none;" id="dhx_repeat_year"> <label><input class="dhx_repeat_radio" type="radio" name="year_type" value="d"/>Every</label><input class="dhx_repeat_text" type="text" name="year_day" value="1" />day<select name="year_month"><option value="0" selected >January<option value="1">February<option value="2">March<option value="3">April<option value="4">May<option value="5">June<option value="6">July<option value="7">August<option value="8">September<option value="9">October<option value="10">November<option value="11">December</select>month<br /> <label><input class="dhx_repeat_radio" type="radio" name="year_type" checked value="w"/>On</label><input class="dhx_repeat_text" type="text" name="year_week2" value="1" /><select name="year_day2"><option value="1" selected >Monday<option value="2">Tuesday<option value="3">Wednesday<option value="4">Thursday<option value="5">Friday<option value="6">Saturday<option value="7">Sunday</select>of<select name="year_month2"><option value="0" selected >January<option value="1">February<option value="2">March<option value="3">April<option value="4">May<option value="5">June<option value="6">July<option value="7">August<option value="8">September<option value="9">October<option value="10">November<option value="11">December</select><br /> </div> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_right"> <label><input class="dhx_repeat_radio" type="radio" name="end" checked/>No end date</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="end" />After</label><input class="dhx_repeat_text" type="text" name="occurences_count" value="1" />occurrences<br /> <label><input class="dhx_repeat_radio" type="radio" name="end" />End by</label><input class="dhx_repeat_date" type="text" name="date_of_end" value="'+scheduler.config.repeat_date_of_end+'" /><br /> </div> </form> </div> <div style="clear:both"> </div>'; + diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_serialize.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_serialize.js index 9d19f520861..92273c13b44 100644 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_serialize.js +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_serialize.js @@ -1,6 +1,6 @@ /* This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details +to use it in non-GPL project. Please contact sales@dhtmlx.com for details */ //redefine this method, if you want to provide a custom set of attributes for serialization
scheduler.data_attributes=function(){
@@ -42,7 +42,7 @@ scheduler.toJSON = function(){ var ev = this._events[a];
var line =[];
for (var i=0; i < attrs.length; i++)
- line.push(' '+attrs[i][0]+':"'+((attrs[i][1]?attrs[i][1](ev[attrs[i][0]]):ev[attrs[i][0]])||"").toString().replace(/\n/g,"")+'" ');
+ line.push(' "'+attrs[i][0]+'": "'+((attrs[i][1]?attrs[i][1](ev[attrs[i][0]]):ev[attrs[i][0]])||"").toString().replace(/\n/g,"")+'" ');
json.push("{"+line.join(",")+"}");
}
return "["+json.join(",\n")+"]";
@@ -53,6 +53,7 @@ scheduler.toICal = function(header){ var start = "BEGIN:VCALENDAR\nVERSION:2.0\nPRODID:-//dhtmlXScheduler//NONSGML v2.2//EN\nDESCRIPTION:";
var end = "END:VCALENDAR";
var format = scheduler.date.date_to_str("%Y%m%dT%H%i%s");
+ var full_day_format = scheduler.date.date_to_str("%Y%m%d");
var ical = [];
for (var a in this._events){
@@ -61,8 +62,14 @@ scheduler.toICal = function(header){ ical.push("BEGIN:VEVENT");
- ical.push("DTSTART:"+format(ev.start_date));
- ical.push("DTEND:"+format(ev.end_date));
+ if (!ev._timed || (!ev.start_date.getHours() && !ev.start_date.getMinutes()))
+ ical.push("DTSTART:"+full_day_format(ev.start_date));
+ else
+ ical.push("DTSTART:"+format(ev.start_date));
+ if (!ev._timed || (!ev.end_date.getHours() && !ev.end_date.getMinutes()))
+ ical.push("DTEND:"+full_day_format(ev.end_date));
+ else
+ ical.push("DTEND:"+format(ev.end_date));
ical.push("SUMMARY:"+ev.text);
ical.push("END:VEVENT");
}
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_timeline.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_timeline.js new file mode 100644 index 00000000000..35ac0826158 --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_timeline.js @@ -0,0 +1,963 @@ +/* +This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in non-GPL project. Please contact sales@dhtmlx.com for details +*/ +(function(){
+scheduler.matrix = {};
+scheduler._merge=function(a,b){
+ for (var c in b)
+ if (typeof a[c] == "undefined")
+ a[c]=b[c];
+};
+scheduler.createTimelineView=function(obj){
+
+ scheduler._merge(obj,{
+ section_autoheight: true,
+ name:"matrix",
+ x:"time",
+ y:"time",
+ x_step:1,
+ x_unit:"hour",
+ y_unit:"day",
+ y_step:1,
+ x_start:0,
+ x_size:24,
+ y_start:0,
+ y_size: 7,
+ render:"cell",
+ dx:200,
+ dy:50,
+ event_dy: scheduler.xy.bar_height-5,
+ event_min_dy: scheduler.xy.bar_height-5,
+ resize_events: true,
+ fit_events: true,
+ second_scale: false,
+ _logic: function(render_name, y_unit, timeline) {
+ var res = {};
+ if(scheduler.checkEvent("onBeforeViewRender")) {
+ res = scheduler.callEvent("onBeforeViewRender", [render_name, y_unit, timeline]);
+ }
+ return res;
+ }
+ });
+
+ if (scheduler.checkEvent("onTimelineCreated")) {
+ scheduler.callEvent("onTimelineCreated", [obj]);
+ }
+
+ var old = scheduler.render_data;
+ scheduler.render_data=function(evs, mode){
+
+ if (this._mode == obj.name){
+ if (mode) //repaint single event, precision is not necessary
+ for (var i=0; i < evs.length; i++) {
+ this.clear_event(evs[i]);
+ this.render_timeline_event.call(this.matrix[this._mode], evs[i], true);
+ }
+ else
+ scheduler.renderMatrix.call(obj, true, true);
+ } else
+ return old.apply(this,arguments);
+ };
+
+ scheduler.matrix[obj.name]=obj;
+ scheduler.templates[obj.name+"_cell_value"] = function(ar){ return ar?ar.length:""; };
+ scheduler.templates[obj.name+"_cell_class"] = function(arr){ return ""; };
+ scheduler.templates[obj.name+"_scalex_class"] = function(date){ return ""; };
+ scheduler.templates[obj.name+"_second_scalex_class"] = function(date){ return ""; };
+
+ scheduler.templates[obj.name+"_scaley_class"] = function(section_id, section_label, section_options){ return ""; };
+ scheduler.templates[obj.name+"_scale_label"] = function(section_id, section_label, section_options){ return section_label; };
+
+ scheduler.templates[obj.name+"_tooltip"] = function(a,b,e){ return e.text; };
+ scheduler.templates[obj.name+"_date"] = function(datea, dateb){
+ if (datea.getDay()==dateb.getDay() && dateb-datea<(24*60*60*1000))
+ return scheduler.templates.day_date(datea);
+ return scheduler.templates.week_date(datea, dateb);
+ };
+
+ scheduler.templates[obj.name+"_scale_date"] = scheduler.date.date_to_str(obj.x_date||scheduler.config.hour_date);
+ scheduler.templates[obj.name+"_second_scale_date"] = scheduler.date.date_to_str((obj.second_scale && obj.second_scale.x_date)?obj.second_scale.x_date:scheduler.config.hour_date);
+
+ scheduler.date["add_"+obj.name]=function(a, b, c){
+ return scheduler.date.add(a, (obj.x_length||obj.x_size)*b*obj.x_step, obj.x_unit);
+ };
+
+ scheduler.date[obj.name+"_start"] = function(date) {
+ var func = scheduler.date[obj.x_unit+"_start"] || scheduler.date.day_start;
+ var start_date = func.call(scheduler.date, date);
+ start_date = scheduler.date.add(start_date, obj.x_step*obj.x_start, obj.x_unit);
+ return start_date;
+ };
+
+ scheduler.attachEvent("onSchedulerResize",function(){
+ if (this._mode == obj.name){
+ scheduler.renderMatrix.call(obj, true, true);
+ return false;
+ }
+ return true;
+ });
+
+ scheduler.attachEvent("onOptionsLoad",function(){
+ obj.order = {};
+ scheduler.callEvent('onOptionsLoadStart', []);
+ for(var i=0; i<obj.y_unit.length;i++)
+ obj.order[obj.y_unit[i].key]=i;
+ scheduler.callEvent('onOptionsLoadFinal', []);
+ if (scheduler._date && obj.name == scheduler._mode)
+ scheduler.setCurrentView(scheduler._date, scheduler._mode);
+ });
+ scheduler.callEvent("onOptionsLoad",[obj]);
+
+ //init custom wrappers
+ scheduler[obj.name+"_view"]=function(){
+ scheduler.renderMatrix.apply(obj, arguments);
+ };
+
+ //enable drag for non-cell modes
+ var temp_date = new Date();
+ var step_diff = (scheduler.date.add(temp_date, obj.x_step, obj.x_unit).valueOf() - temp_date.valueOf()); // "minute" + step in ms
+ scheduler["mouse_"+obj.name]=function(pos){ //mouse_coord handler
+ //get event object
+ var ev = this._drag_event;
+ if (this._drag_id){
+ ev = this.getEvent(this._drag_id);
+ this._drag_event._dhx_changed = true;
+ }
+
+ pos.x-=obj.dx;
+ var summ = 0, xind = 0, yind = 0;
+ for (xind; xind <= this._cols.length-1; xind++) {
+
+ var column_width = this._cols[xind];
+ summ += column_width;
+ if (summ>pos.x){ //index of section
+ var ratio = (pos.x-(summ-column_width))/column_width;
+ ratio = (ratio < 0) ? 0: ratio;
+ break;
+ }
+ }
+
+ summ = 0;
+ for (yind; yind < this._colsS.heights.length; yind++) {
+ summ+=this._colsS.heights[yind];
+ if (summ>pos.y)
+ break;
+ }
+
+ pos.fields={};
+ if(!obj.y_unit[yind]) {
+ yind=obj.y_unit.length-1;
+ }
+
+ if (yind >= 0 && obj.y_unit[yind]) {
+ pos.section = pos.fields[obj.y_property] = obj.y_unit[yind].key;
+ if (ev) {
+ ev[obj.y_property] = pos.section;
+ }
+ }
+
+ pos.x = 0;
+
+ var end_date;
+ if(xind >= obj._trace_x.length) { // if our event is at the end of the view
+ end_date = scheduler.date.add(obj._trace_x[obj._trace_x.length-1], obj.x_step, obj.x_unit);
+ } else {
+ var max_date = (obj._trace_x[xind+1]) ? obj._trace_x[xind+1] : scheduler.date.add(obj._trace_x[obj._trace_x.length-1], obj.x_step, obj.x_unit);
+ var timestamp_diff = Math.ceil(ratio*(max_date-obj._trace_x[xind]));
+ end_date = new Date(+obj._trace_x[xind]+timestamp_diff);
+ }
+
+ if (this._drag_mode == "move" && this._drag_id && this._drag_event) { // as we can simply be calling _locate_cell_timeline
+ var ev = this.getEvent(this._drag_id);
+ var drag_event = this._drag_event;
+
+ if (!drag_event._move_delta) {
+ drag_event._move_delta = (ev.start_date-end_date)/60000;
+ }
+
+ end_date = scheduler.date.add(end_date, drag_event._move_delta, "minute");
+ }
+
+ if (this._drag_mode == "resize" && ev) {
+ pos.resize_from_start = !!(Math.abs(ev.start_date-end_date) < Math.abs(ev.end_date-end_date));
+ }
+
+ pos.y = Math.round((end_date-this._min_date)/(1000*60*this.config.time_step));
+ pos.custom = true;
+ pos.shift = this.config.time_step //step_diff;
+ return pos;
+ }
+};
+
+scheduler.render_timeline_event = function(ev, attach){
+ var section = ev[this.y_property]; // section id
+
+ var sorder = ev._sorder;
+
+ var x_start = _getX(ev, false, this._step);
+ var x_end = _getX(ev, true, this._step);
+
+ var event_height = this.event_dy;
+ if (this.event_dy == "full") {
+ if (this.section_autoheight) {
+ event_height = this._section_height[section] - 6;
+ } else {
+ event_height = this.dy - 3;
+ }
+ }
+
+ if (this.resize_events) {
+ event_height = Math.max(Math.floor(event_height / ev._count), this.event_min_dy);
+ }
+
+ var hb = event_height - 2;// takes into account css sizes (border/padding)
+ if (!ev._inner && this.event_dy == "full") {
+ hb=(hb+2)*(ev._count-sorder)-2;
+ }
+
+ var y = 2+sorder*event_height+(sorder?(sorder*2):0); // original top + number_of_events * event_dy + default event top/bottom borders
+ if (scheduler.config.cascade_event_display) {
+ y =2+sorder*scheduler.config.cascade_event_margin+(sorder?(sorder*2):0);
+ }
+
+ var section_height = event_height+y+2;
+ if(!this._events_height[section] || (this._events_height[section] < section_height)){
+ this._events_height[section] = section_height;
+ }
+
+ var cs = scheduler.templates.event_class(ev.start_date,ev.end_date,ev);
+ cs = "dhx_cal_event_line "+(cs||"");
+
+ var bg_color = (ev.color?("background:"+ev.color+";"):"");
+ var color = (ev.textColor?("color:"+ev.textColor+";"):"");
+ var text = scheduler.templates.event_bar_text(ev.start_date,ev.end_date,ev);
+
+ var html='<div event_id="'+ev.id+'" class="'+cs+'" style="'+bg_color+''+color+'position:absolute; top:'+y+'px; height: '+hb+'px; left:'+x_start+'px; width:'+Math.max(0,x_end-x_start)+'px;'+(ev._text_style||"")+'">';
+ if (scheduler.config.drag_resize){
+ var dhx_event_resize = 'dhx_event_resize';
+ html += ("<div class='"+dhx_event_resize+" "+dhx_event_resize+"_start' style='height: "+hb+"px;'></div><div class='"+dhx_event_resize+" "+dhx_event_resize+"_end' style='height: "+hb+"px;'></div>");
+ }
+ html += (text+'</div>');
+
+ if (!attach)
+ return html;
+ else {
+ var d = document.createElement("DIV");
+ d.innerHTML = html;
+ var ind = this.order[section];
+ var parent = scheduler._els["dhx_cal_data"][0].firstChild.rows[ind].cells[1].firstChild;
+
+ scheduler._rendered.push(d.firstChild);
+ parent.appendChild(d.firstChild);
+ }
+};
+function trace_events(){
+ //minimize event set
+ var evs = scheduler.get_visible_events();
+ var matrix =[];
+ for (var i=0; i < this.y_unit.length; i++)
+ matrix[i]=[];
+
+ //next code defines row for undefined key
+ //most possible it is an artifact of incorrect configuration
+ if (!matrix[y])
+ matrix[y]=[];
+
+ for (var i=0; i < evs.length; i++) {
+ var y = this.order[evs[i][this.y_property]];
+ var x = 0;
+ while (this._trace_x[x+1] && evs[i].start_date>=this._trace_x[x+1]) x++;
+ while (this._trace_x[x] && evs[i].end_date>this._trace_x[x]) {
+ if (!matrix[y][x]) matrix[y][x]=[];
+ matrix[y][x].push(evs[i]);
+ x++;
+ }
+ }
+ return matrix;
+}
+
+// function used to get X (both start and end) coordinates for timeline bar view
+function _getX(ev, isEndPoint, step) {
+ var x = 0;
+ var date = (isEndPoint) ? ev.end_date : ev.start_date;
+ if(date.valueOf()>scheduler._max_date.valueOf())
+ date = scheduler._max_date;
+ var delta = date - scheduler._min_date_timeline;
+ if (delta<0) {
+ column_offset = 0;
+ } else {
+ var index = Math.round( delta/(step*scheduler._cols[0]) ); // results varies ~0.9 - ~24.17, e.g. that way we get 1 and 24
+ if(index>scheduler._cols.length) // if columns really small it's possible to get incorrect index
+ index = scheduler._cols.length;
+ for (var k=0; k<index; k++) {
+ x += scheduler._cols[k];
+ }
+ var column_date = scheduler.date.add(scheduler._min_date_timeline, scheduler.matrix[scheduler._mode].x_step*index, scheduler.matrix[scheduler._mode].x_unit);
+ delta = date - column_date;
+ var column_offset = Math.floor(delta/step);
+ }
+ x += (isEndPoint) ? column_offset-14 : column_offset+1;
+ return x;
+}
+function get_events_html(evs) {
+ var html = "";
+ if (evs && this.render != "cell"){
+ evs.sort(function(a,b){
+ if(a.start_date.valueOf()==b.start_date.valueOf())
+ return a.id>b.id?1:-1;
+ return a.start_date>b.start_date?1:-1;
+ });
+ var stack=[];
+ var evs_length = evs.length;
+ // prepare events for render
+ for (var j=0; j<evs_length; j++){
+ var ev = evs[j];
+ ev._inner = false;
+
+ // cutting stack from the last -> first event side
+ while (stack.length) {
+ if (stack[stack.length-1].end_date.valueOf() <= ev.start_date.valueOf()) {
+ stack.splice(stack.length-1,1);
+ } else {
+ break;
+ }
+ }
+
+ // cutting stack from the first -> last event side
+ var sorderSet = false;
+ for(var p=0; p<stack.length; p++){
+ var t_ev = stack[p];
+ if(t_ev.end_date.valueOf()<=ev.start_date.valueOf()){
+ sorderSet = true;
+ ev._sorder=t_ev._sorder;
+ stack.splice(p,1);
+ ev._inner=true;
+ break;
+ }
+ }
+
+
+ if (stack.length)
+ stack[stack.length-1]._inner=true;
+
+
+ if (!sorderSet) {
+ if (stack.length) {
+ if (stack.length <= stack[stack.length - 1]._sorder) {
+ if (!stack[stack.length - 1]._sorder)
+ ev._sorder = 0;
+ else
+ for (var h = 0; h < stack.length; h++) {
+ var _is_sorder = false;
+ for (var t = 0; t < stack.length; t++) {
+ if (stack[t]._sorder == h) {
+ _is_sorder = true;
+ break;
+ }
+ }
+ if (!_is_sorder) {
+ ev._sorder = h;
+ break;
+ }
+ }
+ ev._inner = true;
+ }
+ else {
+ var _max_sorder = stack[0]._sorder;
+ for (var w = 1; w < stack.length; w++)
+ if (stack[w]._sorder > _max_sorder)
+ _max_sorder = stack[w]._sorder;
+ ev._sorder = _max_sorder + 1;
+ ev._inner = false;
+ }
+ }
+ else
+ ev._sorder = 0;
+ }
+
+ stack.push(ev);
+
+ if (stack.length>(stack.max_count||0)) {
+ stack.max_count=stack.length;
+ ev._count=stack.length;
+ }
+ else {
+ ev._count=(ev._count)?ev._count:1;
+ }
+ }
+ // fix _count for every event
+ for (var m=0; m < evs.length; m++) {
+ evs[m]._count = stack.max_count;
+ }
+ // render events
+ for (var v=0; v<evs_length; v++) {
+ html+=scheduler.render_timeline_event.call(this, evs[v], false);
+ }
+ }
+ return html;
+}
+
+
+function y_scale(d) {
+ var html = "<table style='table-layout:fixed;' cellspacing='0' cellpadding='0'>";
+ var evs=[];
+ if(scheduler._load_mode)
+ scheduler._load();
+ if (this.render == "cell")
+ evs = trace_events.call(this);
+ else {
+ var tevs = scheduler.get_visible_events();
+ for (var j=0; j<tevs.length; j++){
+ var ind = this.order[ tevs[j][this.y_property] ];
+ if (!evs[ind]) evs[ind] = [];
+ evs[ind].push(tevs[j]);
+ }
+ }
+
+ var summ = 0;
+ for (var i=0; i < scheduler._cols.length; i++)
+ summ+=scheduler._cols[i];
+
+ var step = new Date();
+ step = (scheduler.date.add(step, this.x_step*this.x_size, this.x_unit)-step)/summ;
+
+ this._step = step;
+ this._summ = summ;
+
+ var heights = scheduler._colsS.heights=[];
+
+ this._events_height = {};
+ this._section_height = {};
+ for (var i=0; i<this.y_unit.length; i++){
+
+ var stats = this._logic(this.render, this.y_unit[i], this); // obj with custom style
+
+ scheduler._merge(stats, {
+ height: this.dy
+ });
+
+ //autosize height, if we have a free space
+ if(this.section_autoheight) {
+ if (this.y_unit.length * stats.height < d.offsetHeight) {
+ stats.height = Math.max(stats.height, Math.floor((d.offsetHeight - 1) / this.y_unit.length));
+ }
+ this._section_height[this.y_unit[i].key] = stats.height;
+ }
+
+ scheduler._merge(stats, {
+ //section 1
+ tr_className: "",
+ style_height: "height:"+stats.height+"px;",
+ style_width: "width:"+(this.dx-1)+"px;",
+ td_className: "dhx_matrix_scell"+((scheduler.templates[this.name+"_scaley_class"](this.y_unit[i].key, this.y_unit[i].label, this.y_unit[i]))?" "+scheduler.templates[this.name+"_scaley_class"](this.y_unit[i].key, this.y_unit[i].label, this.y_unit[i]):''),
+ td_content: scheduler.templates[this.name+'_scale_label'](this.y_unit[i].key, this.y_unit[i].label, this.y_unit[i]),
+ //section 2
+ summ_width: "width:"+summ+"px;",
+ //section 3
+ table_className: ''
+ });
+
+ // generating events html in a temporary file, calculating their height
+ var events_html = get_events_html.call(this, evs[i]);
+
+ if(this.fit_events){
+ var rendered_height = this._events_height[this.y_unit[i].key]||0;
+ stats.height = (rendered_height>stats.height)?rendered_height:stats.height;
+ stats.style_height = "height:"+stats.height+"px;";
+ this._section_height[this.y_unit[i].key] = stats.height;
+ }
+
+ // section 1
+ html+="<tr class='"+stats.tr_className+"' style='"+stats.style_height+"'><td class='"+stats.td_className+"' style='"+stats.style_width+" height:"+(stats.height-1)+"px;'>"+stats.td_content+"</td>";
+
+ if (this.render == "cell"){
+ for (var j=0; j < scheduler._cols.length; j++) {
+ html+="<td class='dhx_matrix_cell "+scheduler.templates[this.name+"_cell_class"](evs[i][j],this._trace_x[j],this.y_unit[i])+"' style='width:"+(scheduler._cols[j]-1)+"px'><div style='width:"+(scheduler._cols[j]-1)+"px'>"+scheduler.templates[this.name+"_cell_value"](evs[i][j])+"</div></td>";
+ }
+ } else {
+ //section 2
+ html+="<td><div style='"+stats.summ_width+" "+stats.style_height+" position:relative;' class='dhx_matrix_line'>";
+
+ // adding events
+ html += events_html;
+
+ //section 3
+ html+="<table class='"+stats.table_className+"' cellpadding='0' cellspacing='0' style='"+stats.summ_width+" "+stats.style_height+"' >";
+ for (var j=0; j < scheduler._cols.length; j++)
+ html+="<td class='dhx_matrix_cell "+scheduler.templates[this.name+"_cell_class"](evs[i],this._trace_x[j],this.y_unit[i])+"' style='width:"+(scheduler._cols[j]-1)+"px'><div style='width:"+(scheduler._cols[j]-1)+"px'></div></td>";
+ html+="</table>";
+ html+="</div></td>";
+ }
+ html+="</tr>";
+ }
+ html += "</table>";
+ this._matrix = evs;
+ //d.scrollTop = 0; //fix flickering in FF; disabled as it was impossible to create dnd event if scroll was used (window jumped to the top)
+ d.innerHTML = html;
+
+ scheduler._rendered = [];
+ var divs = scheduler._obj.getElementsByTagName("DIV");
+ for (var i=0; i < divs.length; i++)
+ if (divs[i].getAttribute("event_id"))
+ scheduler._rendered.push(divs[i]);
+
+ this._scales = {};
+ for (var i=0; i < d.firstChild.rows.length; i++) {
+ heights.push(d.firstChild.rows[i].offsetHeight);
+ var unit_key = this.y_unit[i].key;
+ var scale = this._scales[unit_key] = (scheduler._isRender('cell')) ? d.firstChild.rows[i] : d.firstChild.rows[i].childNodes[1].getElementsByTagName('div')[0];
+ scheduler.callEvent("onScaleAdd", [scale, unit_key]);
+ }
+}
+function x_scale(h){
+ var current_sh = scheduler.xy.scale_height;
+ var original_sh = this._header_resized||scheduler.xy.scale_height;
+ scheduler._cols=[]; //store for data section, each column width
+ scheduler._colsS={height:0}; // heights of the y sections
+ this._trace_x =[]; // list of dates per cells
+ var summ = scheduler._x-this.dx-18; //border delta, whole width
+ var left = [this.dx]; // left margins, initial left margin
+ var header = scheduler._els['dhx_cal_header'][0];
+ header.style.width = (left[0]+summ)+'px';
+
+ scheduler._min_date_timeline = scheduler._min_date;
+
+ var start = scheduler._min_date;
+ for (var k=0; k<this.x_size; k++){
+ // dates calculation
+ this._trace_x[k]=new Date(start);
+ start = scheduler.date.add(start, this.x_step, this.x_unit);
+
+ // position calculation
+ scheduler._cols[k]=Math.floor(summ/(this.x_size-k));
+ summ -= scheduler._cols[k];
+ left[k+1] = left[k] + scheduler._cols[k];
+ }
+
+ h.innerHTML = "<div></div>";
+
+ if(this.second_scale){
+ // additional calculations
+ var mode = this.second_scale.x_unit;
+ var control_dates = [this._trace_x[0]]; // first control date
+ var second_cols = []; // each column width of the secondary row
+ var second_left = [this.dx, this.dx]; // left margins of the secondary row
+ var t_index = 0; // temp index
+ for (var l = 0; l < this._trace_x.length; l++) {
+ var date = this._trace_x[l];
+ var res = is_new_interval(mode, date, control_dates[t_index]);
+
+ if(res) { // new interval
+ ++t_index; // starting new interval
+ control_dates[t_index] = date; // updating control date as we moved to the new interval
+ second_left[t_index+1] = second_left[t_index];
+ }
+ var t = t_index+1;
+ second_cols[t_index] = scheduler._cols[l] + (second_cols[t_index]||0);
+ second_left[t] += scheduler._cols[l];
+ }
+
+ h.innerHTML = "<div></div><div></div>";
+ var top = h.firstChild;
+ top.style.height = (original_sh)+'px'; // actually bottom header takes 21px
+ var bottom = h.lastChild;
+ bottom.style.position = "relative";
+
+ for (var m = 0; m < control_dates.length; m++) {
+ var tdate = control_dates[m];
+ var scs = scheduler.templates[this.name+"_second_scalex_class"](tdate);
+ var head=document.createElement("DIV"); head.className="dhx_scale_bar dhx_second_scale_bar"+((scs)?(" "+scs):"");
+ scheduler.set_xy(head,second_cols[m]-1,original_sh-3,second_left[m],0); //-1 for border, -3 = -2 padding -1 border bottom
+ head.innerHTML = scheduler.templates[this.name+"_second_scale_date"](tdate);
+ top.appendChild(head);
+ }
+ }
+
+ scheduler.xy.scale_height = original_sh; // fix for _render_x_header which uses current scale_height value
+ h = h.lastChild; // h - original scale
+ for (var i=0; i<this._trace_x.length; i++){
+ start = this._trace_x[i];
+ scheduler._render_x_header(i, left[i], start, h);
+ var cs = scheduler.templates[this.name+"_scalex_class"](start);
+ if (cs)
+ h.lastChild.className += " "+cs;
+ }
+ scheduler.xy.scale_height = current_sh; // restoring current value
+
+ var trace = this._trace_x;
+ h.onclick = function(e){
+ var pos = locate_hcell(e);
+ if (pos)
+ scheduler.callEvent("onXScaleClick",[pos.x, trace[pos.x], e||event]);
+ };
+ h.ondblclick = function(e){
+ var pos = locate_hcell(e);
+ if (pos)
+ scheduler.callEvent("onXScaleDblClick",[pos.x, trace[pos.x], e||event]);
+ };
+}
+function is_new_interval(mode, date, control_date){ // mode, date to check, control_date for which period should be checked
+ switch(mode) {
+ case "hour":
+ return ((date.getHours() != control_date.getHours()) || is_new_interval("day", date, control_date));
+ case "day":
+ return !(date.getDate() == control_date.getDate() && date.getMonth() == control_date.getMonth() && date.getFullYear() == control_date.getFullYear());
+ case "week":
+ return !(scheduler.date.getISOWeek(date) == scheduler.date.getISOWeek(control_date) && date.getFullYear() == control_date.getFullYear());
+ case "month":
+ return !(date.getMonth() == control_date.getMonth() && date.getFullYear() == control_date.getFullYear());
+ case "year":
+ return !(date.getFullYear() == control_date.getFullYear());
+ default:
+ return false; // same interval
+ }
+}
+function set_full_view(mode){
+ if (mode){
+ scheduler.set_sizes();
+ _init_matrix_tooltip();
+ //we need to have day-rounded scales for navigation
+ //in same time, during rendering scales may be shifted
+ var temp = scheduler._min_date;
+ x_scale.call(this,scheduler._els["dhx_cal_header"][0]);
+ y_scale.call(this,scheduler._els["dhx_cal_data"][0]);
+ scheduler._min_date = temp;
+ scheduler._els["dhx_cal_date"][0].innerHTML=scheduler.templates[this.name+"_date"](scheduler._min_date, scheduler._max_date);
+ }
+}
+
+
+function hideToolTip(){
+ if (scheduler._tooltip){
+ scheduler._tooltip.style.display = "none";
+ scheduler._tooltip.date = "";
+ }
+}
+function showToolTip(obj,pos,offset){
+ if (obj.render != "cell") return;
+ var mark = pos.x+"_"+pos.y;
+ var evs = obj._matrix[pos.y][pos.x];
+
+ if (!evs) return hideToolTip();
+
+ evs.sort(function(a,b){ return a.start_date>b.start_date?1:-1; });
+
+ if (scheduler._tooltip){
+ if (scheduler._tooltip.date == mark) return;
+ scheduler._tooltip.innerHTML="";
+ } else {
+ var t = scheduler._tooltip = document.createElement("DIV");
+ t.className = "dhx_tooltip";
+ document.body.appendChild(t);
+ t.onclick = scheduler._click.dhx_cal_data;
+ }
+
+ var html = "";
+
+ for (var i=0; i<evs.length; i++){
+ var bg_color = (evs[i].color?("background-color:"+evs[i].color+";"):"");
+ var color = (evs[i].textColor?("color:"+evs[i].textColor+";"):"");
+ html+="<div class='dhx_tooltip_line' event_id='"+evs[i].id+"' style='"+bg_color+""+color+"'>";
+ html+="<div class='dhx_tooltip_date'>"+(evs[i]._timed?scheduler.templates.event_date(evs[i].start_date):"")+"</div>";
+ html+="<div class='dhx_event_icon icon_details'> </div>";
+ html+=scheduler.templates[obj.name+"_tooltip"](evs[i].start_date, evs[i].end_date,evs[i])+"</div>";
+ }
+
+ scheduler._tooltip.style.display="";
+ scheduler._tooltip.style.top = "0px";
+
+ if (document.body.offsetWidth-offset.left-scheduler._tooltip.offsetWidth < 0)
+ scheduler._tooltip.style.left = offset.left-scheduler._tooltip.offsetWidth+"px";
+ else
+ scheduler._tooltip.style.left = offset.left+pos.src.offsetWidth+"px";
+
+ scheduler._tooltip.date = mark;
+ scheduler._tooltip.innerHTML = html;
+
+ if (document.body.offsetHeight-offset.top-scheduler._tooltip.offsetHeight < 0)
+ scheduler._tooltip.style.top= offset.top-scheduler._tooltip.offsetHeight+pos.src.offsetHeight+"px";
+ else
+ scheduler._tooltip.style.top= offset.top+"px";
+}
+
+function _init_matrix_tooltip() {
+ dhtmlxEvent(scheduler._els["dhx_cal_data"][0], "mouseover", function(e){
+ var obj = scheduler.matrix[scheduler._mode];
+ if (!obj || obj.render != "cell")
+ return;
+ if (obj){
+ var pos = scheduler._locate_cell_timeline(e);
+ var e = e || event;
+ var src = e.target||e.srcElement;
+ if (pos)
+ return showToolTip(obj,pos,getOffset(pos.src));
+ }
+ hideToolTip();
+ });
+ _init_matrix_tooltip=function(){};
+}
+
+scheduler.renderMatrix = function(mode, refresh) {
+ if (!refresh)
+ scheduler._els['dhx_cal_data'][0].scrollTop=0;
+
+ scheduler._min_date = scheduler.date[this.name+"_start"](scheduler._date);
+ scheduler._max_date = scheduler.date.add(scheduler._min_date, this.x_size*this.x_step, this.x_unit);
+ scheduler._table_view = true;
+ if (this.second_scale) {
+ if (mode && !this._header_resized) {
+ this._header_resized = scheduler.xy.scale_height;
+ scheduler.xy.scale_height *= 2;
+ scheduler._els['dhx_cal_header'][0].className += " dhx_second_cal_header";
+ }
+ if (!mode && this._header_resized) {
+ scheduler.xy.scale_height /= 2;
+ this._header_resized = false;
+ var header = scheduler._els['dhx_cal_header'][0];
+ header.className = header.className.replace(/ dhx_second_cal_header/gi,"");
+ }
+ }
+ set_full_view.call(this,mode);
+};
+
+function html_index(el) {
+ var p = el.parentNode.childNodes;
+ for (var i=0; i < p.length; i++)
+ if (p[i] == el) return i;
+ return -1;
+}
+function locate_hcell(e){
+ e = e||event;
+ var trg = e.target?e.target:e.srcElement;
+ while (trg && trg.tagName != "DIV")
+ trg=trg.parentNode;
+ if (trg && trg.tagName == "DIV"){
+ var cs = trg.className.split(" ")[0];
+ if (cs == "dhx_scale_bar")
+ return { x:html_index(trg), y:-1, src:trg, scale:true };
+ }
+}
+scheduler._locate_cell_timeline = function(e){
+ e = e||event;
+ var trg = e.target?e.target:e.srcElement;
+
+ var res = {};
+ var view = scheduler.matrix[scheduler._mode];
+ var pos = scheduler.getActionData(e);
+
+ for (var xind = 0; xind < view._trace_x.length-1; xind++) {
+ if (+pos.date <= view._trace_x[xind+1]) // | 8:00, 8:30 | 8:15 should be checked against 8:30
+ break;
+ }
+
+ res.x = xind;
+ res.y = view.order[pos.section];
+ var diff = scheduler._isRender('cell') ? 1 : 0;
+ res.src = view._scales[pos.section].getElementsByTagName('td')[xind+diff];
+
+ if (trg.className.split(" ")[0] == "dhx_matrix_scell") { // Y scale
+ res.x = -1;
+ res.src = trg;
+ res.scale = true;
+ }
+
+ return res;
+};
+
+var old_click = scheduler._click.dhx_cal_data;
+scheduler._click.dhx_marked_timespan = scheduler._click.dhx_cal_data = function(e){
+ var ret = old_click.apply(this,arguments);
+ var obj = scheduler.matrix[scheduler._mode];
+ if (obj){
+ var pos = scheduler._locate_cell_timeline(e);
+ if (pos){
+ if (pos.scale)
+ scheduler.callEvent("onYScaleClick",[pos.y, obj.y_unit[pos.y], e||event]);
+ else
+ scheduler.callEvent("onCellClick",[pos.x, pos.y, obj._trace_x[pos.x], (((obj._matrix[pos.y]||{})[pos.x])||[]), e||event]);
+ }
+ }
+ return ret;
+};
+
+scheduler.dblclick_dhx_marked_timespan = scheduler.dblclick_dhx_matrix_cell = function(e){
+ var obj = scheduler.matrix[scheduler._mode];
+ if (obj){
+ var pos = scheduler._locate_cell_timeline(e);
+ if (pos){
+ if (pos.scale)
+ scheduler.callEvent("onYScaleDblClick",[pos.y, obj.y_unit[pos.y], e||event]);
+ else
+ scheduler.callEvent("onCellDblClick",[pos.x, pos.y, obj._trace_x[pos.x], (((obj._matrix[pos.y]||{})[pos.x])||[]), e||event]);
+ }
+ }
+};
+scheduler.dblclick_dhx_matrix_scell = function(e){
+ return scheduler.dblclick_dhx_matrix_cell(e);
+};
+
+scheduler._isRender = function(mode){
+ return (scheduler.matrix[scheduler._mode] && scheduler.matrix[scheduler._mode].render == mode);
+};
+
+scheduler.attachEvent("onCellDblClick", function (x, y, a, b, event){
+ if (this.config.readonly|| (event.type == "dblclick" && !this.config.dblclick_create)) return;
+
+ var obj = scheduler.matrix[scheduler._mode];
+ var event_options = {};
+ event_options['start_date'] = obj._trace_x[x];
+ event_options['end_date'] = (obj._trace_x[x+1]) ? obj._trace_x[x+1] : scheduler.date.add(obj._trace_x[x], obj.x_step, obj.x_unit);
+ event_options[scheduler.matrix[scheduler._mode].y_property] = obj.y_unit[y].key;
+ scheduler.addEventNow(event_options, null, event);
+});
+
+scheduler.attachEvent("onBeforeDrag", function (event_id, mode, native_event_object){
+ return !scheduler._isRender("cell");
+});
+scheduler.attachEvent("onEventChanged", function(id, ev) {
+ ev._timed = this.is_one_day_event(ev);
+});
+var old_render_marked_timespan = scheduler._render_marked_timespan;
+scheduler._render_marked_timespan = function(options, area, unit_id) {
+ if (!scheduler.config.display_marked_timespans)
+ return [];
+
+ if (scheduler.matrix && scheduler.matrix[scheduler._mode]) {
+ if (scheduler._isRender('cell'))
+ return;
+
+ var view_opts = scheduler.matrix[scheduler._mode];
+ var blocks = [];
+
+ var units = [];
+ var areas = [];
+ if (!unit_id) { // should draw for every unit
+ var order = view_opts.order;
+ for (var key in order) {
+ if (order.hasOwnProperty(key)) {
+ units.push(key);
+ areas.push(view_opts._scales[key]);
+ }
+ }
+ } else {
+ areas = [area];
+ units = [unit_id]
+ }
+
+ var min_date = scheduler._min_date;
+ var max_date = scheduler._max_date;
+ var dates = [];
+
+ if (options.days > 6) {
+ var specific_date = new Date(options.days);
+ if (scheduler.date.date_part(new Date(min_date)) <= +specific_date && +max_date >= +specific_date)
+ dates.push(specific_date);
+ } else {
+ dates.push.apply(dates, scheduler._get_dates_by_index(options.days));
+ }
+
+ var zones = options.zones;
+ var css_classes = scheduler._get_css_classes_by_config(options);
+
+ for (var j=0; j<units.length; j++) {
+ area = areas[j];
+ unit_id = units[j];
+
+ for (var i=0; i<dates.length; i++) {
+ var date = dates[i];
+ for (var k=0; k<zones.length; k += 2) {
+ var zone_start = zones[k];
+ var zone_end = zones[k+1];
+ var start_date = new Date(+date + zone_start*60*1000);
+ var end_date = new Date(+date + zone_end*60*1000);
+
+ if (!(scheduler._min_date < end_date && scheduler._max_date > start_date))
+ continue;
+
+ var block = scheduler._get_block_by_config(options);
+ block.className = css_classes;
+
+ var start_pos = _getX({start_date: start_date}, false, view_opts._step)-1;
+ var end_pos = _getX({start_date: end_date}, false, view_opts._step)-1;
+ var width = end_pos - start_pos-1;
+ var height = view_opts._section_height[unit_id]-1;
+
+ block.style.cssText = "height: "+height+"px; left: "+start_pos+"px; width: "+width+"px; top: 0;";
+
+ area.insertBefore(block, area.firstChild);
+ blocks.push(block);
+ }
+ }
+ }
+
+ return blocks;
+
+ } else {
+ return old_render_marked_timespan.apply(scheduler, [options, area, unit_id]);
+ }
+};
+
+var old_append_mark_now = scheduler._append_mark_now;
+scheduler._append_mark_now = function(day_index) {
+ if (scheduler.matrix && scheduler.matrix[scheduler._mode]) {
+ var n_date = new Date();
+ var zone_start = scheduler._get_zone_minutes(n_date);
+ var options = {
+ days: +scheduler.date.date_part(n_date),
+ zones: [zone_start, zone_start+1],
+ css: "dhx_matrix_now_time",
+ type: "dhx_now_time"
+ };
+ return scheduler._render_marked_timespan(options);
+ } else {
+ return old_append_mark_now.apply(scheduler, [day_index]);
+ }
+};
+scheduler.attachEvent("onViewChange", function(date, mode) {
+ if (scheduler.matrix && scheduler.matrix[mode]) {
+ if (scheduler.markNow) {
+ scheduler.markNow();
+ }
+ }
+});
+
+scheduler.attachEvent("onScaleAdd", function(scale, unit_key) {
+ var timespans = scheduler._marked_timespans;
+
+ if (timespans && scheduler.matrix && scheduler.matrix[scheduler._mode]) {
+ var mode = scheduler._mode;
+
+ var min_date = scheduler._min_date;
+ var max_date = scheduler._max_date;
+ var global_data = timespans["global"];
+
+ for (var t_date = scheduler.date.date_part(new Date(min_date)); t_date < max_date; t_date = scheduler.date.add(t_date, 1, "day")) {
+ var day_value = +t_date;
+ var day_index = t_date.getDay();
+ var r_configs = [];
+
+ var day_types = global_data[day_value]||global_data[day_index];
+ r_configs.push.apply(r_configs, scheduler._get_configs_to_render(day_types));
+
+ if (timespans[mode] && timespans[mode][unit_key]) {
+ var unit_types = scheduler._get_types_to_render(timespans[mode][unit_key][day_index], timespans[mode][unit_key][day_value]);
+ r_configs.push.apply(r_configs, scheduler._get_configs_to_render(unit_types));
+ }
+
+ for (var i=0; i<r_configs.length; i++) {
+ var config = r_configs[i];
+ var day = config.days;
+ if (day < 7) {
+ day = day_value;
+ scheduler._render_marked_timespan(config, scale, unit_key);
+ day = day_index;
+ } else {
+ scheduler._render_marked_timespan(config, scale, unit_key);
+ }
+ }
+ }
+ }
+});
+
+})();
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_tooltip.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_tooltip.js new file mode 100644 index 00000000000..c6f13b7a28a --- /dev/null +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_tooltip.js @@ -0,0 +1,172 @@ +/* +This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
+to use it in non-GPL project. Please contact sales@dhtmlx.com for details +*/ +window.dhtmlXTooltip = {};
+
+dhtmlXTooltip.config = {
+ className: 'dhtmlXTooltip tooltip',
+ timeout_to_display: 50,
+ delta_x: 15,
+ delta_y: -20
+};
+
+dhtmlXTooltip.tooltip = document.createElement('div');
+dhtmlXTooltip.tooltip.className = dhtmlXTooltip.config.className;
+
+dhtmlXTooltip.show = function(event, text) { //browser event, text to display
+ var dhxTooltip = dhtmlXTooltip;
+ var tooltip_div = this.tooltip;
+ var tooltip_div_style = tooltip_div.style;
+ dhxTooltip.tooltip.className = dhxTooltip.config.className;
+ var pos = this.position(event);
+
+ var target = event.target || event.srcElement;
+ if (this.isTooltip(target)) {
+ return;
+ } // if we are over tooltip -- do nothing, just return (so tooltip won't move)
+
+ var offsetleft = 0;
+ var offsettop = 0;
+ var pobj = scheduler._obj;
+ if (pobj.offsetParent) {
+ do {
+ offsetleft += pobj.offsetLeft;
+ offsettop += pobj.offsetTop;
+ } while (pobj = pobj.offsetParent);
+ }
+
+ var actual_x = pos.x + (dhxTooltip.config.delta_x || 0) - offsetleft;
+ var actual_y = pos.y - (dhxTooltip.config.delta_y || 0) - offsettop;
+
+ tooltip_div_style.visibility = "hidden";
+
+ if (tooltip_div_style.removeAttribute) {
+ tooltip_div_style.removeAttribute("right");
+ tooltip_div_style.removeAttribute("bottom");
+ } else {
+ tooltip_div_style.removeProperty("right");
+ tooltip_div_style.removeProperty("bottom");
+ }
+
+ tooltip_div_style.left = "0";
+ tooltip_div_style.top = "0";
+
+ this.tooltip.innerHTML = text;
+ scheduler._obj.appendChild(this.tooltip);
+
+ var tooltip_width = this.tooltip.offsetWidth;
+ var tooltip_height = this.tooltip.offsetHeight;
+ var parent_scrollLeft = scheduler._obj.parentNode.scrollLeft || 0;
+ var visible_width = Math.min(scheduler._obj.offsetWidth, scheduler._obj.parentNode.offsetWidth);
+
+ if ((visible_width - actual_x - (scheduler.xy.margin_left || 0) - tooltip_width) < 0) { // tooltip is out of the right page bound
+ if (tooltip_div_style.removeAttribute)
+ tooltip_div_style.removeAttribute("left");
+ else
+ tooltip_div_style.removeProperty("left");
+ tooltip_div_style.right = (scheduler._obj.offsetWidth - parent_scrollLeft - actual_x + 2 * (dhxTooltip.config.delta_x || 0)) + "px";
+ } else {
+ if (actual_x < 0) { // tooltips is out of the left page bound
+ tooltip_div_style.left = (pos.x + Math.abs(dhxTooltip.config.delta_x || 0)) + "px";
+ } else { // normal situation
+ tooltip_div_style.left = (actual_x + parent_scrollLeft) + "px";
+ }
+ }
+
+ if ((scheduler._obj.offsetHeight - actual_y - (scheduler.xy.margin_top || 0) - tooltip_height) < 0) { // tooltip is below bottom of the page
+ if (tooltip_div_style.removeAttribute)
+ tooltip_div_style.removeAttribute("top");
+ else
+ tooltip_div_style.removeProperty("top");
+ tooltip_div_style.bottom = (scheduler._obj.offsetHeight - actual_y - 2 * (dhxTooltip.config.delta_y || 0)) + "px";
+ } else {
+ if (actual_y < 0) { // tooltip is higher then top of the page
+ tooltip_div_style.top = (pos.y + Math.abs(dhxTooltip.config.delta_y || 0)) + "px";
+ }
+ else { // normal situation
+ tooltip_div_style.top = actual_y + "px";
+ }
+ }
+
+ tooltip_div_style.visibility = "visible";
+};
+
+dhtmlXTooltip.hide = function() {
+ if (this.tooltip.parentNode) {
+ this.tooltip.parentNode.removeChild(this.tooltip);
+ }
+};
+dhtmlXTooltip.delay = function(method, object, params, delay) {
+ if (this.tooltip._timeout_id) {
+ window.clearTimeout(this.tooltip._timeout_id);
+ }
+ this.tooltip._timeout_id = setTimeout(function() {
+ var ret = method.apply(object, params);
+ method = object = params = null;
+ return ret;
+ }, delay || this.config.timeout_to_display);
+};
+
+dhtmlXTooltip.isTooltip = function(node) {
+ var res = false;
+ while (node && !res) {
+ res = (node.className == this.tooltip.className);
+ node = node.parentNode;
+ }
+ return res;
+};
+
+dhtmlXTooltip.position = function(ev) {
+ ev = ev || window.event;
+ if (ev.pageX || ev.pageY) //FF, KHTML
+ return {x:ev.pageX, y:ev.pageY};
+ //IE
+ var d = ((window._isIE) && (document.compatMode != "BackCompat")) ? document.documentElement : document.body;
+ return {
+ x:ev.clientX + d.scrollLeft - d.clientLeft,
+ y:ev.clientY + d.scrollTop - d.clientTop
+ };
+};
+
+scheduler.attachEvent("onMouseMove", function(event_id, e) { // (scheduler event_id, browser event)
+ var ev = window.event || e;
+ var target = ev.target || ev.srcElement;
+ var dhxTooltip = dhtmlXTooltip;
+
+ if (event_id || dhxTooltip.isTooltip(target)) { // if we are over event or tooltip
+ var event = scheduler.getEvent(event_id) || scheduler.getEvent(dhxTooltip.tooltip.event_id);
+ if (!event)
+ return;
+ dhxTooltip.tooltip.event_id = event.id;
+ var text = scheduler.templates.tooltip_text(event.start_date, event.end_date, event);
+ if (!text) return dhxTooltip.hide();
+
+ var evt = undefined;
+ if (_isIE) { //make a copy of event, will be used in timed call
+ evt = document.createEventObject(ev);
+ }
+
+ if (!scheduler.callEvent("onBeforeTooltip", [event_id, event]) || !text)
+ return;
+
+ dhxTooltip.delay(dhxTooltip.show, dhxTooltip, [(evt || ev), text]); // showing tooltip
+ } else {
+ dhxTooltip.delay(dhxTooltip.hide, dhxTooltip, []);
+ }
+});
+scheduler.attachEvent("onBeforeDrag", function() {
+ dhtmlXTooltip.hide();
+ return true;
+});
+scheduler.attachEvent("onEventDeleted", function() {
+ dhtmlXTooltip.hide();
+ return true;
+});
+
+/* Could be redifined */
+scheduler.templates.tooltip_date_format = scheduler.date.date_to_str("%Y-%m-%d %H:%i");
+
+scheduler.templates.tooltip_text = function(start, end, event) {
+ return "<b>Event:</b> " + event.text + "<br/><b>Start date:</b> " + scheduler.templates.tooltip_date_format(start) + "<br/><b>End date:</b> " + scheduler.templates.tooltip_date_format(end);
+};
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_treetimeline.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_treetimeline.js index d92a4be8428..001b8b0ae6d 100644 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_treetimeline.js +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_treetimeline.js @@ -1,6 +1,6 @@ /* This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details +to use it in non-GPL project. Please contact sales@dhtmlx.com for details */ scheduler.attachEvent("onTimelineCreated", function (obj){
@@ -90,7 +90,7 @@ var section_id_before; // section id of the event before dragging (to bring it b scheduler.attachEvent("onBeforeEventChanged", function(event_object, native_event, is_new) {
if (scheduler._isRender("tree")) { // if mode's render == tree
var section = scheduler.getSection(event_object[scheduler.matrix[scheduler._mode].y_property]);
- if (typeof section.children != 'undefined' && !scheduler.matrix[scheduler._mode].folder_events_available) {
+ if (section && typeof section.children != 'undefined' && !scheduler.matrix[scheduler._mode].folder_events_available) { // section itself could be not defined in case of new event (addEventNow)
if (!is_new) { //if old - move back
event_object[scheduler.matrix[scheduler._mode].y_property] = section_id_before;
}
@@ -101,15 +101,16 @@ scheduler.attachEvent("onBeforeEventChanged", function(event_object, native_even });
scheduler.attachEvent("onBeforeDrag", function (event_id, mode, native_event_object){
- var cell = scheduler._locate_cell_timeline(native_event_object);
- if(cell) {
- var section_id = scheduler.matrix[scheduler._mode].y_unit[cell.y].key;
- if(typeof scheduler.matrix[scheduler._mode].y_unit[cell.y].children != "undefined" && !scheduler.matrix[scheduler._mode].folder_events_available) {
- return false;
- }
- }
if(scheduler._isRender("tree")) {
- ev = scheduler.getEvent(event_id);
+ var cell = scheduler._locate_cell_timeline(native_event_object);
+ if(cell) {
+ var section_id = scheduler.matrix[scheduler._mode].y_unit[cell.y].key;
+ if(typeof scheduler.matrix[scheduler._mode].y_unit[cell.y].children != "undefined" && !scheduler.matrix[scheduler._mode].folder_events_available) {
+ return false;
+ }
+ }
+
+ var ev = scheduler.getEvent(event_id);
section_id_before = section_id||ev[scheduler.matrix[scheduler._mode].y_property]; // either event id or section_id will be available
}
return true;
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/property.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_units.js index 96f11ec64a5..39bd056338b 100644 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/property.js +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_units.js @@ -1,6 +1,6 @@ /* This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details +to use it in non-GPL project. Please contact sales@dhtmlx.com for details */ scheduler._props = {};
scheduler.createUnitsView=function(name,property,list,size,step,skip_incorrect){
@@ -170,7 +170,7 @@ scheduler.scrollUnit=function(step){ var l = scheduler.locate_holder_day;
scheduler.locate_holder_day=function(a,b,ev){
var pr = scheduler._props[this._mode];
- if (pr){
+ if (pr && ev) {
fix_und(pr,ev);
return pr.order[ev[pr.map_to]]*1+(b?1:0)-pr.position;
}
@@ -188,9 +188,9 @@ scheduler.scrollUnit=function(step){ this._drag_event._dhx_changed = true;
}
var unit_ind = Math.min(pos.x+pr.position,pr.options.length-1);
- ev[pr.map_to]=pr.options[unit_ind].key;
+ var key = pr.map_to;
+ pos.section = ev[key]=pr.options[unit_ind].key;
pos.x = 0;
- pos.custom = true;
}
return pos;
};
@@ -215,7 +215,7 @@ scheduler.scrollUnit=function(step){ });
scheduler.attachEvent("onEventCreated",function(id,n_ev){
var pr = scheduler._props[this._mode];
- if (pr){
+ if (pr && n_ev){
var ev = this.getEvent(id);
this._mouse_coords(n_ev);
fix_und(pr,ev);
@@ -224,18 +224,3 @@ scheduler.scrollUnit=function(step){ return true;
})
})();
-
-
-/* just in case, there shouldn't be any need for this
-
- scheduler.getUnitSection = function(event_id) {
- var ev = scheduler.getEvent(event_id);
- var options = scheduler._props['unit'].options;
- var section;
- for(var i=0; i<options.length; i++) {
- if(ev.section_id == options[i].key)
- section = options[i];
- }
- return section;
- };
-*/
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_url.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_url.js index 01d030ec83b..2d39d36d326 100644 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_url.js +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_url.js @@ -1,6 +1,6 @@ /* This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details +to use it in non-GPL project. Please contact sales@dhtmlx.com for details */ scheduler.attachEvent("onTemplatesReady",function(){
var first = true;
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_week_agenda.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_week_agenda.js index 9aa8b46d4cc..78e275b9d58 100644 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_week_agenda.js +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_week_agenda.js @@ -1,6 +1,6 @@ /* This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details +to use it in non-GPL project. Please contact sales@dhtmlx.com for details */ scheduler._wa = {};
scheduler.xy.week_agenda_scale_height = 20;
@@ -8,20 +8,20 @@ scheduler.templates.week_agenda_event_text = function(start_date, end_date, even return scheduler.templates.event_date(start_date) + " " + event.text;
};
scheduler.date.week_agenda_start = scheduler.date.week_start;
-scheduler.date.week_agenda_end = function(date){
+scheduler.date.week_agenda_end = function(date) {
return scheduler.date.add(date, 7, "day");
};
-scheduler.date.add_week_agenda = function(date, inc){
- return scheduler.date.add(date, inc*7, "day");
+scheduler.date.add_week_agenda = function(date, inc) {
+ return scheduler.date.add(date, inc * 7, "day");
};
-scheduler.attachEvent("onSchedulerReady", function(){
+scheduler.attachEvent("onSchedulerReady", function() {
var t = scheduler.templates;
- if(!t.week_agenda_date)
+ if (!t.week_agenda_date)
t.week_agenda_date = t.week_date;
});
-(function(){
+(function() {
var scale_date_format = scheduler.date.date_to_str("%l, %F %d");
scheduler.templates.week_agenda_scale_date = function(date) {
return scale_date_format(date);
@@ -41,9 +41,8 @@ scheduler.attachEvent("onTemplatesReady", function() { var old = scheduler.render_data;
scheduler.render_data = function(evs) {
if (this._mode == "week_agenda") {
- fillWeekAgendaTab();
- }
- else
+ scheduler.week_agenda_view(true);
+ } else
return old.apply(this, arguments);
};
@@ -72,7 +71,9 @@ scheduler.attachEvent("onTemplatesReady", function() { scheduler._colsS[1].push(theight - scheduler._colsS[1][scheduler._colsS[1].length - 1]);
};
var fillWeekAgendaTab = function() {
+ getColumnSizes();
scheduler._els["dhx_cal_data"][0].innerHTML = '';
+ scheduler._rendered = [];
var html = '';
for (var i = 0; i < 2; i++) {
var width = scheduler._cols[i];
@@ -83,11 +84,12 @@ scheduler.attachEvent("onTemplatesReady", function() { for (var k = 0; k < scheduler._colsS[i].length; k++) {
var scale_height = scheduler.xy.week_agenda_scale_height - 2;
var height = scheduler._colsS[i][k] - scale_height - 2;
- html += "<div class='dhx_wa_day_cont'><div style='height:" + scale_height + "px; line-height:" + scale_height + "px;' class='dhx_wa_scale_bar'></div><div style='height:" + height + "px;' class='dhx_wa_day_data'></div></div>";
+ var day = Math.min(6, k * 2 + i);
+ html += "<div class='dhx_wa_day_cont'><div style='height:" + scale_height + "px; line-height:" + scale_height + "px;' class='dhx_wa_scale_bar'></div><div style='height:" + height + "px;' class='dhx_wa_day_data' day='" + day + "'></div></div>";
}
html += "</div>";
}
- scheduler._els["dhx_cal_date"][0].innerHTML = scheduler.templates[scheduler._mode+"_date"](scheduler._min_date, scheduler._max_date, scheduler._mode);
+ scheduler._els["dhx_cal_date"][0].innerHTML = scheduler.templates[scheduler._mode + "_date"](scheduler._min_date, scheduler._max_date, scheduler._mode);
scheduler._els["dhx_cal_data"][0].innerHTML = html;
var all_divs = scheduler._els["dhx_cal_data"][0].getElementsByTagName('div');
var day_divs = [];
@@ -96,7 +98,7 @@ scheduler.attachEvent("onTemplatesReady", function() { day_divs.push(all_divs[i]);
}
scheduler._wa._selected_divs = [];
- var events = scheduler.get_visible_events(); // list of events to be displayed in current week
+ var events = scheduler.get_visible_events(); // list of events to be displayed in current week
var tstart = scheduler.date.week_start(scheduler._date);
var tend = scheduler.date.add(tstart, 1, "day");
for (var i = 0; i < 7; i++) {
@@ -104,38 +106,39 @@ scheduler.attachEvent("onTemplatesReady", function() { var scale_bar = day_divs[i].childNodes[0];
var events_div = day_divs[i].childNodes[1];
scale_bar.innerHTML = scheduler.templates.week_agenda_scale_date(tstart);
- var evs = []; // events which will be displayed in the current day
- for (var j = 0; j < events.length; j++) {
- var tev = events[j];
- if(tev.start_date<tend && tev.end_date>tstart)
- evs.push(tev);
- }
- evs.sort(function(a,b){
- if(a.start_date.valueOf()==b.start_date.valueOf())
- return a.id>b.id?1:-1;
- return a.start_date>b.start_date?1:-1;
+ var evs = []; // events which will be displayed in the current day
+ for (var j = 0; j < events.length; j++) {
+ var tev = events[j];
+ if (tev.start_date < tend && tev.end_date > tstart)
+ evs.push(tev);
+ }
+ evs.sort(function(a, b) {
+ if (a.start_date.valueOf() == b.start_date.valueOf())
+ return a.id > b.id ? 1 : -1;
+ return a.start_date > b.start_date ? 1 : -1;
});
for (var k = 0; k < evs.length; k++) {
var ev = evs[k];
var ev_div = document.createElement('div');
scheduler._rendered.push(ev_div);
- ev_div.className = 'dhx_wa_ev_body';
- if(ev._text_style)
- ev_div.style.cssText = ev._text_style;
- if(ev.color)
- ev_div.style.backgroundColor = ev.color;
- if(ev.textColor)
+ var ev_class = scheduler.templates.event_class(ev.start_date, ev.end_date, ev);
+ ev_div.className = 'dhx_wa_ev_body' + (ev_class ? (' ' + ev_class) : '');
+ if (ev._text_style)
+ ev_div.style.cssText = ev._text_style;
+ if (ev.color)
+ ev_div.style.background = ev.color;
+ if (ev.textColor)
ev_div.style.color = ev.textColor;
- if(scheduler._select_id && ev.id == scheduler._select_id) {
+ if (scheduler._select_id && ev.id == scheduler._select_id && !(!scheduler.config.week_agenda_select && scheduler.config.week_agenda_select !== undefined)) {
ev_div.className += " dhx_cal_event_selected";
scheduler._wa._selected_divs.push(ev_div);
}
var position = "";
- if(!ev._timed){
+ if (!ev._timed) {
position = "middle";
- if(ev.start_date.valueOf() >= tstart.valueOf() && ev.start_date.valueOf() <= tend.valueOf())
+ if (ev.start_date.valueOf() >= tstart.valueOf() && ev.start_date.valueOf() <= tend.valueOf())
position = "start";
- if(ev.end_date.valueOf() >= tstart.valueOf() && ev.end_date.valueOf() <= tend.valueOf())
+ if (ev.end_date.valueOf() >= tstart.valueOf() && ev.end_date.valueOf() <= tend.valueOf())
position = "end";
}
ev_div.innerHTML = scheduler.templates.week_agenda_event_text(ev.start_date, ev.end_date, ev, tstart, position);
@@ -151,34 +154,32 @@ scheduler.attachEvent("onTemplatesReady", function() { scheduler._max_date = scheduler.date.add(scheduler._min_date, 1, "week");
scheduler.set_sizes();
if (mode) { // mode enabled
- scheduler._table_view=true;
+ scheduler._table_view = scheduler._allow_dnd = true;
// hiding default top border from dhx_cal_data
scheduler._wa._prev_data_border = scheduler._els['dhx_cal_data'][0].style.borderTop;
scheduler._els['dhx_cal_data'][0].style.borderTop = 0;
scheduler._els['dhx_cal_data'][0].style.overflowY = 'hidden';
- // cleaning dhx_cal_date from the previous date
- scheduler._els['dhx_cal_date'][0].innerHTML = "";
+ // cleaning dhx_cal_date from the previous date
+ scheduler._els['dhx_cal_date'][0].innerHTML = "";
// 1 to make navline to be over data
- scheduler._els['dhx_cal_data'][0].style.top = (parseInt(scheduler._els['dhx_cal_data'][0].style.top)-scheduler.xy.bar_height-1) + 'px';
- scheduler._els['dhx_cal_data'][0].style.height = (parseInt(scheduler._els['dhx_cal_data'][0].style.height)+scheduler.xy.bar_height+1) + 'px';
-
+ scheduler._els['dhx_cal_data'][0].style.top = (parseInt(scheduler._els['dhx_cal_data'][0].style.top) - scheduler.xy.bar_height - 1) + 'px';
+ scheduler._els['dhx_cal_data'][0].style.height = (parseInt(scheduler._els['dhx_cal_data'][0].style.height) + scheduler.xy.bar_height + 1) + 'px';
+
scheduler._els['dhx_cal_header'][0].style.display = 'none';
- getColumnSizes();
fillWeekAgendaTab();
- }
- else { // leaving week_agenda mode
- scheduler._table_view=false;
+ } else { // leaving week_agenda mode
+ scheduler._table_view = scheduler._allow_dnd = false;
// restoring default top border to dhx_cal_data
if (scheduler._wa._prev_data_border)
scheduler._els['dhx_cal_data'][0].style.borderTop = scheduler._wa._prev_data_border;
scheduler._els['dhx_cal_data'][0].style.overflowY = 'auto';
- scheduler._els['dhx_cal_data'][0].style.top = (parseInt(scheduler._els['dhx_cal_data'][0].style.top)+scheduler.xy.bar_height) + 'px';
- scheduler._els['dhx_cal_data'][0].style.height = (parseInt(scheduler._els['dhx_cal_data'][0].style.height)-scheduler.xy.bar_height) + 'px';
+ scheduler._els['dhx_cal_data'][0].style.top = (parseInt(scheduler._els['dhx_cal_data'][0].style.top) + scheduler.xy.bar_height) + 'px';
+ scheduler._els['dhx_cal_data'][0].style.height = (parseInt(scheduler._els['dhx_cal_data'][0].style.height) - scheduler.xy.bar_height) + 'px';
scheduler._els['dhx_cal_header'][0].style.display = 'block';
}
};
@@ -190,7 +191,7 @@ scheduler.attachEvent("onTemplatesReady", function() { var date = src._date;
src = src.parentNode;
}
- if(!date)
+ if (!date)
return pos;
pos.x = 0;
var diff = date.valueOf() - scheduler._min_date.valueOf();
@@ -227,29 +228,29 @@ scheduler.attachEvent("onTemplatesReady", function() { return true;
});
- scheduler.attachEvent("onEventSave",function(id,data,is_new_event){
- if(is_new_event)
+ scheduler.attachEvent("onEventSave", function(id, data, is_new_event) {
+ if (is_new_event && this._mode == 'week_agenda')
this._select_id = id;
return true;
});
scheduler._wa._selected_divs = [];
- scheduler.attachEvent("onClick",function(event_id, native_event_object){
- if(this._mode == 'week_agenda'){
- if(scheduler._wa._selected_divs) {
- for(var i=0; i<this._wa._selected_divs.length; i++) {
+ scheduler.attachEvent("onClick", function(event_id, native_event_object) {
+ if (this._mode == 'week_agenda' && !(!scheduler.config.week_agenda_select && scheduler.config.week_agenda_select !== undefined)) {
+ if (scheduler._wa._selected_divs) {
+ for (var i = 0; i < this._wa._selected_divs.length; i++) {
var div = this._wa._selected_divs[i];
- div.className = div.className.replace(/ dhx_cal_event_selected/,'');
+ div.className = div.className.replace(/ dhx_cal_event_selected/, '');
}
}
- this.for_rendered(event_id, function(event_div){
+ this.for_rendered(event_id, function(event_div) {
event_div.className += " dhx_cal_event_selected";
scheduler._wa._selected_divs.push(event_div);
});
- this._select_id = event_id;
+ scheduler.select(event_id);
return false;
- }
- return true;
- });
+ }
+ return true;
+ });
});
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_year_view.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_year_view.js index f89bec4a7b1..3b01f67552d 100644 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_year_view.js +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/dhtmlxscheduler_year_view.js @@ -1,6 +1,6 @@ /* This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details +to use it in non-GPL project. Please contact sales@dhtmlx.com for details */ scheduler.config.year_x = 4;
scheduler.config.year_y = 3;
@@ -53,11 +53,14 @@ scheduler.templates.year_tooltip = function(s, e, ev) { var clear = scheduler.clear_view;
scheduler.clear_view = function() {
if (!is_year_mode()) return clear.apply(this, arguments);
- for (var i = 0; i < marked.length; i++) {
- marked[i].className = "dhx_month_head";
- marked[i].setAttribute("date", "")
+ for (var date in marked) {
+ if (marked.hasOwnProperty(date)) {
+ var div = marked[date];
+ div.className = "dhx_month_head";
+ div.setAttribute("date", "")
+ }
}
- marked = [];
+ marked = {};
};
scheduler.hideToolTip = function() {
@@ -83,7 +86,7 @@ scheduler.templates.year_tooltip = function(s, e, ev) { for (var i = 0; i < evs.length; i++) {
var ev = evs[i];
- var bg_color = (ev.color ? ("background-color:" + ev.color + ";") : "");
+ var bg_color = (ev.color ? ("background:" + ev.color + ";") : "");
var color = (ev.textColor ? ("color:" + ev.textColor + ";") : "");
html += "<div class='dhx_tooltip_line' style='" + bg_color + "" + color + "' event_id='" + evs[i].id + "'>";
@@ -145,12 +148,17 @@ scheduler.templates.year_tooltip = function(s, e, ev) { return t.childNodes[2].firstChild.rows[Math.floor(d / 7)].cells[d % 7].firstChild;
};
- var marked = [];
+ var marked = {};
scheduler._mark_year_date = function(d, ev) {
+ var date = to_attr(d);
var c = this._get_year_cell(d);
- c.className = "dhx_month_head dhx_year_event " + this.templates.event_class(ev.start_date, ev.end_date, ev);
- c.setAttribute("date", to_attr(d))
- marked.push(c);
+ var ev_class = this.templates.event_class(ev.start_date, ev.end_date, ev);
+ if (!marked[date]) {
+ c.className = "dhx_month_head dhx_year_event";
+ c.setAttribute("date", date);
+ marked[date] = c;
+ }
+ c.className += (ev_class) ? (" "+ev_class) : "";
};
scheduler._unmark_year_date = function(d) {
this._get_year_cell(d).className = "dhx_month_head";
@@ -188,6 +196,7 @@ scheduler.templates.year_tooltip = function(s, e, ev) { if (mode) {
scheduler._init_year_tooltip();
scheduler._reset_year_scale();
+ if (scheduler._load_mode && scheduler._load()) return scheduler._render_wait = true;
scheduler.render_view_data();
} else {
scheduler.hideToolTip();
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_active_links.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_active_links.js deleted file mode 100644 index 46bc624c1ea..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_active_links.js +++ /dev/null @@ -1,26 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.attachEvent("onTemplatesReady",function(){
- var s_d = scheduler.date.str_to_date(scheduler.config.api_date);
- var d_s = scheduler.date.date_to_str(scheduler.config.api_date);
-
- var month_x = scheduler.templates.month_day;
- scheduler.templates.month_day=function(date){
- return "<a jump_to='"+d_s(date)+"' href='#'>"+month_x(date)+"</a>";
- };
- var week_x = scheduler.templates.week_scale_date;
- scheduler.templates.week_scale_date=function(date){
- return "<a jump_to='"+d_s(date)+"' href='#'>"+week_x(date)+"</a>";
- };
- dhtmlxEvent(this._obj,"click",function(e){
- var start = e.target || event.srcElement;
- var to = start.getAttribute("jump_to");
- if (to) {
- scheduler.setCurrentView(s_d(to),"day");
- if (e && e.preventDefault) e.preventDefault();
- return false;
- }
- })
-});
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_key_nav.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_key_nav.js deleted file mode 100644 index 242f735a41f..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_key_nav.js +++ /dev/null @@ -1,36 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -//Initial idea and implementation by Steve MC
-(function (){
-
-var lightboxopen = false;
-
-scheduler.attachEvent("onBeforeLightbox",function(){ lightboxopen = true; return true; });
-scheduler.attachEvent("onAfterLightbox",function(){ lightboxopen = false; return true; });
-
-dhtmlxEvent(document,(_isOpera?"keypress":"keydown"),function(e){
- e=e||event;
- if (!lightboxopen){
-
- if (e.keyCode == 37 || e.keyCode == 39) { // Left-Arrow
- e.cancelBubble = true;
-
- var next = scheduler.date.add(scheduler._date,(e.keyCode == 37 ? -1 : 1 ),scheduler._mode);
- scheduler.setCurrentView(next);
- return true;
- } else if (e.ctrlKey && e.keyCode == 67){
- scheduler._copy_id = scheduler._select_id;
- } else if (e.ctrlKey && e.keyCode == 86){
- var ev = scheduler.getEvent(scheduler._copy_id);
- if (ev){
- var new_ev = scheduler._copy_event(ev);
- new_ev.id = scheduler.uid();
- scheduler.addEvent(new_ev);
- }
- }
- }
-});
-
-})();
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_layer.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_layer.js deleted file mode 100644 index 322f1668838..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_layer.js +++ /dev/null @@ -1,403 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.attachEvent("onTemplatesReady",function(){ - - this.layers.sort(function(a, b){ - return a.zIndex - b.zIndex; - }); - - scheduler._dp_init=function(dp){ - dp._methods=["setEventTextStyle","","changeEventId","deleteEvent"]; - - this.attachEvent("onEventAdded",function(id){ - if (!this._loading && this.validId(id) && this.getEvent(id) && this.getEvent(id).layer == dp.layer) - dp.setUpdated(id,true,"inserted"); - }); - this.attachEvent("onBeforeEventDelete",function(id){ - if(this.getEvent(id) && this.getEvent(id).layer == dp.layer) { - if (!this.validId(id)) return; - var z=dp.getState(id); - - if (z=="inserted" || this._new_event) { dp.setUpdated(id,false); return true; } - if (z=="deleted") return false; - if (z=="true_deleted") return true; - - dp.setUpdated(id,true,"deleted"); - return false; - } - else return true; - }); - this.attachEvent("onEventChanged",function(id){ - if (!this._loading && this.validId(id) && this.getEvent(id) && this.getEvent(id).layer == dp.layer) - dp.setUpdated(id,true,"updated"); - }); - - dp._getRowData=function(id,pref){ - var ev=this.obj.getEvent(id); - var data = {}; - - for (var a in ev){ - if (a.indexOf("_")==0) continue; - if (ev[a] && ev[a].getUTCFullYear) //not very good, but will work - data[a] = this.obj.templates.xml_format(ev[a]); - else - data[a] = ev[a]; - } - return data; - }; - dp._clearUpdateFlag=function(){}; - - dp.attachEvent("insertCallback", scheduler._update_callback); - dp.attachEvent("updateCallback", scheduler._update_callback); - dp.attachEvent("deleteCallback", function(upd, id) { - this.obj.setUserData(id, this.action_param, "true_deleted"); - this.obj.deleteEvent(id); - }); - }; - - (function() { - var _cloneObj = function(obj){ - if(obj == null || typeof(obj) != 'object') - return obj; - var temp = new obj.constructor(); - for(var key in obj) - temp[key] = _cloneObj(obj[key]); - return temp; - }; - - scheduler._dataprocessors = []; - scheduler._layers_zindex = {}; - for(var i=0; i<scheduler.layers.length; i++) { - scheduler.config['lightbox_'+scheduler.layers[i].name] = { }; - scheduler.config['lightbox_'+scheduler.layers[i].name].sections = _cloneObj(scheduler.config.lightbox.sections); - scheduler._layers_zindex[scheduler.layers[i].name] = scheduler.config.inital_layer_zindex||5 + i*3; - if(scheduler.layers[i].url) { - var dp = new dataProcessor(scheduler.layers[i].url); - dp.layer = scheduler.layers[i].name; - scheduler._dataprocessors.push(dp); - scheduler._dataprocessors[i].init(scheduler); - } - if(scheduler.layers[i].isDefault) - scheduler.defaultLayer = scheduler.layers[i].name; - } - })(); - - - scheduler.showLayer = function(tlayer) { - this.toggleLayer(tlayer, true); - }; - - scheduler.hideLayer = function(tlayer) { - this.toggleLayer(tlayer, false); - }; - - scheduler.toggleLayer = function(tlayer, visible) { // visible is optional - var layer = this.getLayer(tlayer); - - if(typeof visible != 'undefined') - layer.visible = !!visible; - else - layer.visible = !layer.visible; - - this.setCurrentView(this._date, this._mode); - }; - - scheduler.getLayer = function(tlayer) { // either string with layer name or event with layer property - if(typeof tlayer == 'string') - var layer_name = tlayer; - if(typeof tlayer == 'object') - var layer_name = tlayer.layer; - var layer; - for (var i=0; i<scheduler.layers.length; i++) { - if(scheduler.layers[i].name == layer_name) - layer = scheduler.layers[i]; - } - return layer; - }; - - scheduler.attachEvent("onBeforeLightbox", function (event_id){ - var ev = this.getEvent(event_id); - this.config.lightbox.sections = this.config['lightbox_'+ev.layer].sections; - scheduler.resetLightbox(); - return true; - }); - - scheduler.attachEvent("onClick", function (event_id, native_event_object){ - var ev = scheduler.getEvent(event_id); - return !scheduler.getLayer(ev.layer).noMenu; - }); - - scheduler.attachEvent('onEventCollision', function(ev, evs) { - var layer = this.getLayer(ev); - if(!layer.checkCollision) - return false; - var count = 0; - for(var i = 0; i<evs.length; i++) { - if(evs[i].layer == layer.name && evs[i].id != ev.id) - count++; - } - return (count >= scheduler.config.collision_limit); - }); - - scheduler.addEvent=function(start_date,end_date,text,id,extra_data){ - var ev=start_date; - if (arguments.length!=1){ - ev=extra_data||{}; - ev.start_date=start_date; - ev.end_date=end_date; - ev.text=text; - ev.id=id; - ev.layer = this.defaultLayer; - }; - ev.id = ev.id||scheduler.uid(); - ev.text = ev.text||""; - - - if (typeof ev.start_date == "string") ev.start_date=this.templates.api_date(ev.start_date); - if (typeof ev.end_date == "string") ev.end_date=this.templates.api_date(ev.end_date); - ev._timed=this.is_one_day_event(ev); - - var is_new=!this._events[ev.id]; - this._events[ev.id]=ev; - this.event_updated(ev); - if (!this._loading) - this.callEvent(is_new?"onEventAdded":"onEventChanged",[ev.id,ev]); - }; - - this._evs_layer = {}; - for (var i = 0; i < this.layers.length; i++) { // array in object for each layer - this._evs_layer[this.layers[i].name] = []; - } - - scheduler.addEventNow=function(start,end,e){ - var base = {}; - if (typeof start == "object"){ - base = start; - start = null; - } - - var d = (this.config.event_duration||this.config.time_step)*60000; - if (!start) start = Math.round((new Date()).valueOf()/d)*d; - var start_date = new Date(start); - if (!end){ - var start_hour = this.config.first_hour; - if (start_hour > start_date.getHours()){ - start_date.setHours(start_hour); - start = start_date.valueOf(); - } - end = start+d; - } - - - base.start_date = base.start_date||start_date; - base.end_date = base.end_date||new Date(end); - base.text = base.text||this.locale.labels.new_event; - base.id = this._drag_id = this.uid(); - base.layer = this.defaultLayer; - this._drag_mode="new-size"; - - this._loading=true; - this.addEvent(base); - this.callEvent("onEventCreated",[this._drag_id,e]); - this._loading=false; - - this._drag_event={}; //dummy , to trigger correct event updating logic - this._on_mouse_up(e); - } - - scheduler._t_render_view_data = function(events) { // helper - if (this.config.multi_day && !this._table_view) { - var tvs = []; - var tvd = []; - for (var k = 0; k < events.length; k++) { - if (events[k]._timed) - tvs.push(events[k]); - else - tvd.push(events[k]); - } - this._table_view = true; - this.render_data(tvd); - this._table_view = false; - this.render_data(tvs); - } - else - this.render_data(events); - }; - - scheduler.render_view_data = function(){ - if (this._not_render) { - this._render_wait = true; - return; - } - this._render_wait = false; - - this.clear_view(); - - this._evs_layer = {}; - for (var i = 0; i < this.layers.length; i++) { // array in object for each layer - this._evs_layer[this.layers[i].name] = []; - } - - var evs = this.get_visible_events(); - for (var i = 0; i < evs.length; i++) { // filling layer arrays with events - if(this._evs_layer[evs[i].layer]) - this._evs_layer[evs[i].layer].push(evs[i]); - } - - if(this._mode == 'month') { // old logic is used - var tevs = []; - for (var i = 0; i < this.layers.length; i++) { - if (this.layers[i].visible) - tevs = tevs.concat(this._evs_layer[this.layers[i].name]); - } - this._t_render_view_data(tevs); - } - else { // week, day; should use new logic - for (var i = 0; i < this.layers.length; i++) { - if (this.layers[i].visible) { - var evs_layer = this._evs_layer[this.layers[i].name]; - this._t_render_view_data(evs_layer); - } - } - } - }; - - scheduler._render_v_bar=function(id,x,y,w,h,style,contentA,contentB,bottom){ - var ev = this.getEvent(id); - if(contentA.indexOf('<div class=') == -1) - contentA = (scheduler.templates['event_header_'+ev.layer])?scheduler.templates['event_header_'+ev.layer](ev.start_date,ev.end_date,ev):contentA; - if(contentB.indexOf('<div class=') == -1) - contentB = (scheduler.templates['event_text_'+ev.layer])?scheduler.templates['event_text_'+ev.layer](ev.start_date,ev.end_date,ev):contentB; - - var d=document.createElement("DIV"); - - - var cs = "dhx_cal_event"; - var cse = (scheduler.templates['event_class_'+ev.layer])?scheduler.templates['event_class_'+ev.layer](ev.start_date,ev.end_date,ev):scheduler.templates.event_class(ev.start_date,ev.end_date,ev); - if (cse) cs=cs+" "+cse; - - var html='<div event_id="'+id+'" class="'+cs+'" style="position:absolute; top:'+y+'px; left:'+x+'px; width:'+(w-4)+'px; height:'+h+'px;'+(style||"")+'">'; - html+='<div class="dhx_header" style=" width:'+(w-6)+'px;" > </div>'; - html+='<div class="dhx_title">'+contentA+'</div>'; - html+='<div class="dhx_body" style=" width:'+(w-(this._quirks?4:14))+'px; height:'+(h-(this._quirks?20:30))+'px;">'+contentB+'</div>'; - html+='<div class="dhx_footer" style=" width:'+(w-8)+'px;'+(bottom?' margin-top:-1px;':'')+'" ></div></div>'; - - d.innerHTML=html; - d.style.zIndex = 100; - return d.firstChild; - }; - - scheduler.render_event_bar=function(ev){ - var parent=this._els["dhx_cal_data"][0]; - - var x=this._colsS[ev._sday]; - var x2=this._colsS[ev._eday]; - if (x2==x) x2=this._colsS[ev._eday+1]; - var hb = this.xy.bar_height; - - var y=this._colsS.heights[ev._sweek]+(this._colsS.height?(this.xy.month_scale_height+2):2)+ev._sorder*hb; - - var d=document.createElement("DIV"); - var cs = ev._timed?"dhx_cal_event_clear":"dhx_cal_event_line"; - var cse = (scheduler.templates['event_class_'+ev.layer])?scheduler.templates['event_class_'+ev.layer](ev.start_date,ev.end_date,ev):scheduler.templates.event_class(ev.start_date,ev.end_date,ev); - if (cse) cs=cs+" "+cse; - - var html='<div event_id="'+ev.id+'" class="'+cs+'" style="position:absolute; top:'+y+'px; left:'+x+'px; width:'+(x2-x-15)+'px;'+(ev._text_style||"")+'">'; - - if (ev._timed) - html+=(scheduler.templates['event_bar_date_'+ev.layer])?scheduler.templates['event_bar_date_'+ev.layer](ev.start_date,ev.end_date,ev):scheduler.templates.event_bar_date(ev.start_date,ev.end_date,ev); - html+=( (scheduler.templates['event_bar_text_'+ev.layer])?scheduler.templates['event_bar_text_'+ev.layer](ev.start_date,ev.end_date,ev):scheduler.templates.event_bar_text(ev.start_date,ev.end_date,ev) + '</div>)'); - html+='</div>'; - - d.innerHTML=html; - - this._rendered.push(d.firstChild); - parent.appendChild(d.firstChild); - }; - - scheduler.render_event=function(ev){ - var menu = scheduler.xy.menu_width; - if(scheduler.getLayer(ev.layer).noMenu) - menu = 0; - - if (ev._sday<0) return; //can occur in case of recurring event during time shift - var parent=scheduler.locate_holder(ev._sday); - if (!parent) return; //attempt to render non-visible event - var sm = ev.start_date.getHours()*60+ev.start_date.getMinutes(); - var em = (ev.end_date.getHours()*60+ev.end_date.getMinutes())||(scheduler.config.last_hour*60); - - var top = (Math.round((sm*60*1000-this.config.first_hour*60*60*1000)*this.config.hour_size_px/(60*60*1000)))%(this.config.hour_size_px*24)+1; //42px/hour - var height = Math.max(scheduler.xy.min_event_height,(em-sm)*this.config.hour_size_px/60)+1; //42px/hour - //var height = Math.max(25,Math.round((ev.end_date.valueOf()-ev.start_date.valueOf())*(this.config.hour_size_px+(this._quirks?1:0))/(60*60*1000))); //42px/hour - var width=Math.floor((parent.clientWidth-menu)/ev._count); - var left=ev._sorder*width+1; - if (!ev._inner) width=width*(ev._count-ev._sorder); - - - - var d=this._render_v_bar(ev.id,menu+left,top,width,height,ev._text_style,scheduler.templates.event_header(ev.start_date,ev.end_date,ev),scheduler.templates.event_text(ev.start_date,ev.end_date,ev)); - - this._rendered.push(d); - parent.appendChild(d); - - left=left+parseInt(parent.style.left,10)+menu; - - top+=this._dy_shift; //corrupt top, to include possible multi-day shift - d.style.zIndex = this._layers_zindex[ev.layer]; - - if (this._edit_id==ev.id){ - d.style.zIndex = parseInt(d.style.zIndex)+1; //fix overlapping issue - var new_zIndex = d.style.zIndex; - width=Math.max(width-4,scheduler.xy.editor_width); - var d=document.createElement("DIV"); - d.setAttribute("event_id",ev.id); - this.set_xy(d,width,height-20,left,top+14); - d.className="dhx_cal_editor"; - d.style.zIndex = new_zIndex; - var d2=document.createElement("DIV"); - this.set_xy(d2,width-6,height-26); - d2.style.cssText+=";margin:2px 2px 2px 2px;overflow:hidden;"; - - - d2.style.zIndex = new_zIndex; - d.appendChild(d2); - this._els["dhx_cal_data"][0].appendChild(d); - this._rendered.push(d); - - d2.innerHTML="<textarea class='dhx_cal_editor'>"+ev.text+"</textarea>"; - if (this._quirks7) d2.firstChild.style.height=height-12+"px"; //IEFIX - this._editor=d2.firstChild; - this._editor.onkeypress=function(e){ - if ((e||event).shiftKey) return true; - var code=(e||event).keyCode; - if (code==scheduler.keys.edit_save) scheduler.editStop(true); - if (code==scheduler.keys.edit_cancel) scheduler.editStop(false); - }; - this._editor.onselectstart=function(e){ return (e||event).cancelBubble=true; }; - d2.firstChild.focus(); - //IE and opera can add x-scroll during focusing - this._els["dhx_cal_data"][0].scrollLeft=0; - d2.firstChild.select(); - } - if (this._select_id==ev.id){ - d.style.zIndex = parseInt(d.style.zIndex)+1; //fix overlapping issue - var icons=this.config["icons_"+((this._edit_id==ev.id)?"edit":"select")]; - var icons_str=""; - for (var i=0; i<icons.length; i++) - icons_str+="<div class='dhx_menu_icon "+icons[i]+"' title='"+this.locale.labels[icons[i]]+"'></div>"; - var obj = this._render_v_bar(ev.id,left-menu+1,top,menu,icons.length*20+26,"","<div class='dhx_menu_head'></div>",icons_str,true); - obj.style.left=left-menu+1; - obj.style.zIndex = d.style.zIndex; - this._els["dhx_cal_data"][0].appendChild(obj); - this._rendered.push(obj); - } - - }; - - scheduler.filter_agenda = function(id, event) { - var layer = scheduler.getLayer(event.layer); - return (layer && layer.visible); - }; -}); diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_limit.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_limit.js deleted file mode 100644 index ad790cf3ea9..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_limit.js +++ /dev/null @@ -1,166 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.config.limit_start = new Date(-3999,0,0);
-scheduler.config.limit_end = new Date( 3999,0,0);
-scheduler.config.limit_view = false;
-
-(function(){
- var before = null;
-
- var block_days = {};
- var block_weeks = {};
- var time_block_set = false;
- scheduler.blockTime = function(day, zones){
- var bottom = this.config.first_hour*60
- var top = this.config.last_hour*60
- if (zones == "fullday")
- zones = [bottom,top];
-
- if (typeof day == "object")
- block_days[this.date.date_part(day).valueOf()] = zones;
- else
- block_weeks[day] = zones;
-
- for (var i=0; i<zones.length; i+=2){
- if (zones[i]<bottom)
- zones[i] = bottom;
- if (zones[i+1]>top)
- zones[i+1] = top;
- }
-
- time_block_set = true;
- };
-
- scheduler.attachEvent("onScaleAdd", function(area, day){
- var zones = block_days[day.valueOf()] || block_weeks[day.getDay()];
- if (zones){
- for (var i = 0; i < zones.length; i+=2){
- var start = zones[i];
- var end = zones[i+1];
- var block = document.createElement("DIV");
- block.className = "dhx_time_block";
-
- var h_px // FIXME
- block.style.top = (Math.round((start*60*1000-this.config.first_hour*60*60*1000)*this.config.hour_size_px/(60*60*1000)))%(this.config.hour_size_px*24)+"px";
- block.style.height = (Math.round(((end-start-1)*60*1000)*this.config.hour_size_px/(60*60*1000)))%(this.config.hour_size_px*24)+"px";
-
- area.appendChild(block);
- }
- }
- });
-
- scheduler.attachEvent("onBeforeViewChange",function(om,od,nm,nd){
- nd = nd||od; nm = nm||om;
- if (scheduler.config.limit_view){
- if (nd.valueOf()>scheduler.config.limit_end.valueOf() || this.date.add(nd,1,nm)<=scheduler.config.limit_start.valueOf()){
- setTimeout(function(){
- scheduler.setCurrentView(scheduler._date, nm);
- },1);
- return false;
- }
- }
- return true;
- });
- var blocker = function(ev){
- var c = scheduler.config;
- var res = (ev.start_date.valueOf() >= c.limit_start.valueOf() && ev.end_date.valueOf() <= c.limit_end.valueOf());
- if (res && time_block_set && ev._timed){
- var day = scheduler.date.date_part(new Date(ev.start_date.valueOf()));
- var zones = block_days[day.valueOf()] || block_weeks[day.getDay()];
- var sm = ev.start_date.getHours()*60+ev.start_date.getMinutes();
- var em = ev.end_date.getHours()*60+ev.end_date.getMinutes();
- if (zones){
- for (var i = 0; i < zones.length; i+=2){
- var sz = zones[i];
- var ez = zones[i+1];
- if (sz<em && ez>sm) {
- if (sm<=ez && sm >=sz){
- if (ez == 24*60 || em<ez){
- res = false;
- break;
- }
- if(scheduler._drag_id && scheduler._drag_mode == "new-size"){
- ev.start_date.setHours(0);
- ev.start_date.setMinutes(ez);
- }
- else {
- res = false;
- break;
- }
- }
- if (em>=sz && em<ez){
- if(scheduler._drag_id && scheduler._drag_mode == "new-size"){
- ev.end_date.setHours(0);
- ev.end_date.setMinutes(sz);
- }
- else {
- res = false;
- break;
- }
- }
- }
- }
- }
- }
- if (!res) {
- scheduler._drag_id = null;
- scheduler._drag_mode = null;
- scheduler.callEvent("onLimitViolation",[ev.id, ev]);
- }
- return res;
- };
-
- scheduler.attachEvent("onBeforeDrag",function(id){
- if (!id) return true;
- return blocker(scheduler.getEvent(id));
- });
- scheduler.attachEvent("onClick", function (event_id, native_event_object){
- return blocker(scheduler.getEvent(event_id));
- });
- scheduler.attachEvent("onBeforeLightbox",function(id){
-
- var ev = scheduler.getEvent(id);
- before = [ev.start_date, ev.end_date];
- return blocker(ev);
- });
- scheduler.attachEvent("onEventAdded",function(id){
- if (!id) return true;
- var ev = scheduler.getEvent(id);
- if (!blocker(ev)){
- if (ev.start_date < scheduler.config.limit_start) {
- ev.start_date = new Date(scheduler.config.limit_start);
- }
- if (ev.start_date.valueOf() >= scheduler.config.limit_end.valueOf()) {
- ev.start_date = this.date.add(scheduler.config.limit_end, -1, "day");
- }
- if (ev.end_date < scheduler.config.limit_start) {
- ev.end_date = new Date(scheduler.config.limit_start);
- }
- if (ev.end_date.valueOf() >= scheduler.config.limit_end.valueOf()) {
- ev.end_date = this.date.add(scheduler.config.limit_end, -1, "day");
- }
- if (ev.start_date.valueOf() >= ev.end_date.valueOf()) {
- ev.end_date = this.date.add(ev.start_date, (this.config.event_duration||this.config.time_step), "minute");
- }
- ev._timed=this.is_one_day_event(ev);
- }
- return true;
- });
- scheduler.attachEvent("onEventChanged",function(id){
- if (!id) return true;
- var ev = scheduler.getEvent(id);
- if (!blocker(ev)){
- if (!before) return false;
- ev.start_date = before[0];
- ev.end_date = before[1];
- ev._timed=this.is_one_day_event(ev);
- };
- return true;
- });
- scheduler.attachEvent("onBeforeEventChanged",function(ev, native_object, is_new){
- return blocker(ev);
- });
-
-})();
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_matrix.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_matrix.js deleted file mode 100644 index 07ea857c13f..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_matrix.js +++ /dev/null @@ -1,677 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -(function(){
-scheduler.matrix = {};
-scheduler._merge=function(a,b){
- for (var c in b)
- if (typeof a[c] == "undefined")
- a[c]=b[c];
-};
-scheduler.createTimelineView=function(obj){
-
-
- scheduler._merge(obj,{
- section_autoheight: true,
- name:"matrix",
- x:"time",
- y:"time",
- x_step:1,
- x_unit:"hour",
- y_unit:"day",
- y_step:1,
- x_start:0,
- x_size:24,
- y_start:0,
- y_size: 7,
- render:"cell",
- dx:200,
- dy:50,
- fit_events: true,
- second_scale: false,
- _logic: function(render_name, y_unit, timeline) {
- var res = {};
- if(scheduler.checkEvent("onBeforeViewRender")) {
- res = scheduler.callEvent("onBeforeViewRender", [render_name, y_unit, timeline]);
- }
- return res;
- }
- });
-
- if (scheduler.checkEvent("onTimelineCreated")) {
- scheduler.callEvent("onTimelineCreated", [obj]);
- }
-
- var old = scheduler.render_data;
- scheduler.render_data=function(evs, mode){
-
- if (this._mode == obj.name){
- if (mode) //repaint single event, precision is not necessary
- for (var i=0; i < evs.length; i++) {
- this.clear_event(evs[i]);
- this.render_timeline_event.call(this.matrix[this._mode], evs[i], 0, true);
- }
- else
- set_full_view.call(obj,true);
- } else
- return old.apply(this,arguments);
- };
-
- scheduler.matrix[obj.name]=obj;
- scheduler.templates[obj.name+"_cell_value"] = function(ar){ return ar?ar.length:""; };
- scheduler.templates[obj.name+"_cell_class"] = function(arr){ return ""; };
- scheduler.templates[obj.name+"_scalex_class"] = function(date){ return ""; };
- scheduler.templates[obj.name+"_second_scalex_class"] = function(date){ return ""; };
-
- scheduler.templates[obj.name+"_scaley_class"] = function(section_id, section_label, section_options){ return ""; };
- scheduler.templates[obj.name+"_scale_label"] = function(section_id, section_label, section_options){ return section_label; };
-
- scheduler.templates[obj.name+"_tooltip"] = function(a,b,e){ return e.text; };
- scheduler.templates[obj.name+"_date"] = function(datea, dateb){
- if (datea.getDay()==dateb.getDay() && dateb-datea<(24*60*60*1000))
- return scheduler.templates.day_date(datea);
- return scheduler.templates.week_date(datea, dateb);
- };
-
- scheduler.templates[obj.name+"_scale_date"] = scheduler.date.date_to_str(obj.x_date||scheduler.config.hour_date);
- scheduler.templates[obj.name+"_second_scale_date"] = scheduler.date.date_to_str((obj.second_scale && obj.second_scale.x_date)?obj.second_scale.x_date:scheduler.config.hour_date);
-
- scheduler.date["add_"+obj.name]=function(a,b,c){
- return scheduler.date.add(a,(obj.x_length||obj.x_size)*b*obj.x_step,obj.x_unit);
- };
-
- // note this is not correct start_date as it doesn't take into account x_start value (though scheduler._min_date is correct)
- scheduler.date[obj.name+"_start"] = scheduler.date[obj.x_unit+"_start"] || scheduler.date.day_start;
-
- scheduler.attachEvent("onSchedulerResize",function(){
- if (this._mode == obj.name){
- set_full_view.call(obj,true);
- return false;
- }
- return true;
- });
-
- scheduler.attachEvent("onOptionsLoad",function(){
- obj.order = {};
- scheduler.callEvent('onOptionsLoadStart', []);
- for(var i=0; i<obj.y_unit.length;i++)
- obj.order[obj.y_unit[i].key]=i;
- scheduler.callEvent('onOptionsLoadFinal', []);
- if (scheduler._date && obj.name == scheduler._mode)
- scheduler.setCurrentView(scheduler._date, scheduler._mode);
- });
- scheduler.callEvent("onOptionsLoad",[obj]);
-
- //init custom wrappers
- scheduler[obj.name+"_view"]=function(){
- scheduler.renderMatrix.apply(obj, arguments);
- };
-
- //enable drag for non-cell modes
- if (obj.render != "cell"){
- var temp_date = new Date();
- var step_diff = (scheduler.date.add(temp_date, obj.x_step, obj.x_unit).valueOf() - temp_date.valueOf()); // "minute" + step in ms
- scheduler["mouse_"+obj.name]=function(pos){ //mouse_coord handler
- //get event object
- var ev = this._drag_event;
- if (this._drag_id){
- ev = this.getEvent(this._drag_id);
- this._drag_event._dhx_changed = true;
- }
- pos.x-=obj.dx;
-
- var summ = 0, xind = 0, yind = 0;
- for (xind; xind < this._cols.length-1; xind++) {
- summ+=this._cols[xind];
- if (summ>pos.x){ //index of section
- break;
- }
- }
-
- summ = 0;
- for (yind; yind < this._colsS.heights.length; yind++) {
- summ+=this._colsS.heights[yind];
- if (summ>pos.y)
- break;
- }
-
- pos.fields={};
- if(!obj.y_unit[yind]) {
- yind=obj.y_unit.length-1;
- }
- pos.fields[obj.y_property] = ev[obj.y_property] = obj.y_unit[yind].key;
-
- pos.x = 0;
-
- if (this._drag_mode == "new-size" && ev.start_date*1==this._drag_start*1) {
- xind++;
- }
-
-
- if(xind >= obj._trace_x.length) { // if our event is at the end of the view
- var end_date = scheduler.date.add(obj._trace_x[obj._trace_x.length-1], obj.x_step, obj.x_unit);
- } else {
- var end_date = obj._trace_x[xind];
- }
-
- pos.y = Math.round((end_date-this._min_date)/(1000*60*this.config.time_step));
- pos.custom = true;
- pos.shift = step_diff;
- return pos;
- };
- }
-};
-
-scheduler.render_timeline_event = function(ev, stack, attach){
-
- var x_start = _getX(ev, false, this._step);
- var x_end = _getX(ev, true, this._step);
-
- var hb = scheduler.xy.bar_height;
- var y = 2+stack*hb;
-
- var height = hb+y-2;
- var section = ev[this.y_property];
- if(!this._events_height[section] || (this._events_height[section] < height)){
- this._events_height[section] = height;
- }
-
- var cs = scheduler.templates.event_class(ev.start_date,ev.end_date,ev);
- cs = "dhx_cal_event_line "+(cs||"");
-
- var bg_color = (ev.color?("background-color:"+ev.color+";"):"");
- var color = (ev.textColor?("color:"+ev.textColor+";"):"");
-
- var html='<div event_id="'+ev.id+'" class="'+cs+'" style="'+bg_color+''+color+'position:absolute; top:'+y+'px; left:'+x_start+'px; width:'+Math.max(0,x_end-x_start)+'px;'+(ev._text_style||"")+'">'+scheduler.templates.event_bar_text(ev.start_date,ev.end_date,ev)+'</div>';
-
- if (!attach)
- return html;
- else {
- var d = document.createElement("DIV");
- d.innerHTML = html;
- var ind = this.order[section];
- var parent = scheduler._els["dhx_cal_data"][0].firstChild.rows[ind].cells[1].firstChild;
-
- scheduler._rendered.push(d.firstChild);
- parent.appendChild(d.firstChild);
- }
-
-};
-function trace_events(){
- //minimize event set
- var evs = scheduler.get_visible_events();
- var matrix =[];
- for (var i=0; i < this.y_unit.length; i++)
- matrix[i]=[];
-
- //next code defines row for undefined key
- //most possible it is an artifact of incorrect configuration
- if (!matrix[y])
- matrix[y]=[];
-
- for (var i=0; i < evs.length; i++) {
- var y = this.order[evs[i][this.y_property]];
- var x = 0;
- while (this._trace_x[x+1] && evs[i].start_date>=this._trace_x[x+1]) x++;
- while (this._trace_x[x] && evs[i].end_date>this._trace_x[x]) {
- if (!matrix[y][x]) matrix[y][x]=[];
- matrix[y][x].push(evs[i]);
- x++;
- }
- }
- return matrix;
-}
-
-// function used to get X (both start and end) coordinates for timeline bar view
-function _getX(ev, isEndPoint, step) {
- var x = 0;
- var date = (isEndPoint) ? ev.end_date : ev.start_date;
- if(date.valueOf()>scheduler._max_date.valueOf())
- date = scheduler._max_date;
- var delta = date - scheduler._min_date_timeline;
- if (delta<0) {
- column_offset = 0;
- } else {
- var index = Math.round( delta/(step*scheduler._cols[0]) ); // results varies ~0.9 - ~24.17, e.g. that way we get 1 and 24
- if(index>scheduler._cols.length) // if columns really small it's possible to get incorrect index
- index = scheduler._cols.length;
- for (var k=0; k<index; k++) {
- x += scheduler._cols[k];
- }
- var column_date = scheduler.date.add(scheduler._min_date_timeline, scheduler.matrix[scheduler._mode].x_step*index, scheduler.matrix[scheduler._mode].x_unit);
- delta = date - column_date;
- var column_offset = Math.floor(delta/step);
- }
- x += (isEndPoint) ? column_offset-14 : column_offset+1;
- return x;
-}
-
-
-function y_scale(d){
- var html = "<table style='table-layout:fixed;' cellspacing='0' cellpadding='0'>";
- var evs=[];
- if(scheduler._load_mode)
- scheduler._load();
- if (this.render == "cell")
- evs = trace_events.call(this);
- else {
- var tevs = scheduler.get_visible_events();
- for (var j=0; j<tevs.length; j++){
- var ind = this.order[ tevs[j][this.y_property] ];
- if (!evs[ind]) evs[ind] = [];
- evs[ind].push(tevs[j]);
- }
- }
-
- var summ = 0;
- for (var i=0; i < scheduler._cols.length; i++)
- summ+=scheduler._cols[i];
-
- var step = new Date();
- step = (scheduler.date.add(step, this.x_step*this.x_size, this.x_unit)-step)/summ;
-
- this._step = step;
- this._summ = summ;
-
- var heights = scheduler._colsS.heights=[];
-
- this._events_height = {};
- for (var i=0; i<this.y_unit.length; i++){
-
- var stats = this._logic(this.render, this.y_unit[i], this); // obj with custom style
-
- scheduler._merge(stats, {
- height: this.dy
- });
-
- //autosize height, if we have a free space
- if(this.section_autoheight) {
- if (this.y_unit.length * stats.height < d.offsetHeight) {
- stats.height = Math.max(stats.height, Math.floor((d.offsetHeight - 1) / this.y_unit.length));
- }
- }
-
- scheduler._merge(stats, {
- //section 1
- tr_className: "",
- style_height: "height:"+stats.height+"px;",
- style_width: "width:"+(this.dx-1)+"px;",
- td_className: "dhx_matrix_scell"+((scheduler.templates[this.name+"_scaley_class"](this.y_unit[i].key, this.y_unit[i].label, this))?" "+scheduler.templates[this.name+"_scaley_class"](this.y_unit[i].key, this.y_unit[i].label, this):''),
- td_content: scheduler.templates[this.name+'_scale_label'](this.y_unit[i].key, this.y_unit[i].label, this.y_unit[i]),
- //section 2
- summ_width: "width:"+summ+"px;",
- //section 3
- table_className: ''
- });
-
- // generating events html in a temporary file, calculating their height
- var events_html = "";
- if (evs[i] && this.render != "cell"){
- evs[i].sort(function(a,b){ return a.start_date>b.start_date?1:-1; });
- var stack=[];
- for (var j=0; j<evs[i].length; j++){
- var ev = evs[i][j];
-
- //get line in stack
- var stack_pointer = 0;
-
- while (stack[stack_pointer] && stack[stack_pointer].end_date > ev.start_date)
- stack_pointer++;
- stack[stack_pointer]=ev;
- //render line
-
- events_html+=scheduler.render_timeline_event.call(this, ev, stack_pointer);
- }
- }
-
- if(this.fit_events){
- var rendered_height = this._events_height[this.y_unit[i].key]||0;
- stats.height = (rendered_height>stats.height)?rendered_height:stats.height;
- stats.style_height = "height:"+stats.height+"px;";
- }
-
- // section 1
- html+="<tr class='"+stats.tr_className+"' style='"+stats.style_height+"'><td class='"+stats.td_className+"' style='"+stats.style_width+" height:"+(stats.height-1)+"px;'>"+stats.td_content+"</td>";
-
- if (this.render == "cell"){
- for (var j=0; j < scheduler._cols.length; j++) {
- html+="<td class='dhx_matrix_cell "+scheduler.templates[this.name+"_cell_class"](evs[i][j],this._trace_x[j],this.y_unit[i])+"' style='width:"+(scheduler._cols[j]-1)+"px'><div style='width:"+(scheduler._cols[j]-1)+"px'>"+scheduler.templates[this.name+"_cell_value"](evs[i][j])+"</div></td>";
- }
- } else {
- //section 2
- html+="<td><div style='"+stats.summ_width+" "+stats.style_height+" position:relative;' class='dhx_matrix_line'>";
-
- // adding events
- html += events_html;
-
- //section 3
- html+="<table class='"+stats.table_className+"' cellpadding='0' cellspacing='0' style='"+stats.summ_width+" "+stats.style_height+"' >";
- for (var j=0; j < scheduler._cols.length; j++)
- html+="<td class='dhx_matrix_cell "+scheduler.templates[this.name+"_cell_class"](evs[i],this._trace_x[j],this.y_unit[i])+"' style='width:"+(scheduler._cols[j]-1)+"px'><div style='width:"+(scheduler._cols[j]-1)+"px'></div></td>";
- html+="</table>";
- html+="</div></td>";
- }
- html+="</tr>";
- }
- html += "</table>";
- this._matrix = evs;
- //d.scrollTop = 0; //fix flickering in FF; disabled as it was impossible to create dnd event if scroll was used (window jumped to the top)
- d.innerHTML = html;
-
- scheduler._rendered = [];
- var divs = document.getElementsByTagName("DIV");
- for (var i=0; i < divs.length; i++)
- if (divs[i].getAttribute("event_id"))
- scheduler._rendered.push(divs[i]);
-
- for (var i=0; i < d.firstChild.rows.length; i++)
- heights.push(d.firstChild.rows[i].offsetHeight);
-
-}
-function x_scale(h){
- var current_sh = scheduler.xy.scale_height;
- var original_sh = this._header_resized||scheduler.xy.scale_height;
- scheduler._cols=[]; //store for data section, each column width
- scheduler._colsS={height:0}; // heights of the y sections
- this._trace_x =[]; // list of dates per cells
- var summ = scheduler._x-this.dx-18; //border delta, whole width
- var left = [this.dx]; // left margins, initial left margin
- var header = scheduler._els['dhx_cal_header'][0];
- header.style.width = (left[0]+summ)+'px';
-
- scheduler._min_date_timeline = scheduler._min_date;
-
- var start = scheduler._min_date;
- for (var k=0; k<this.x_size; k++){
- // dates calculation
- this._trace_x[k]=new Date(start);
- start = scheduler.date.add(start, this.x_step, this.x_unit);
-
- // position calculation
- scheduler._cols[k]=Math.floor(summ/(this.x_size-k));
- summ -= scheduler._cols[k];
- left[k+1] = left[k] + scheduler._cols[k];
- }
-
-
- h.innerHTML = "<div></div>";
-
- if(this.second_scale){
- // additional calculations
- var mode = this.second_scale.x_unit;
- var control_dates = [this._trace_x[0]]; // first control date
- var second_cols = []; // each column width of the secondary row
- var second_left = [this.dx, this.dx]; // left margins of the secondary row
- var t_index = 0; // temp index
- for (var l = 0; l < this._trace_x.length; l++) {
- var date = this._trace_x[l];
- var res = is_new_interval(mode, date, control_dates[t_index]);
-
- if(res) { // new interval
- ++t_index; // starting new interval
- control_dates[t_index] = date; // updating control date as we moved to the new interval
- second_left[t_index+1] = second_left[t_index];
- }
- var t = t_index+1;
- second_cols[t_index] = scheduler._cols[l] + (second_cols[t_index]||0);
- second_left[t] += scheduler._cols[l];
- }
-
- h.innerHTML = "<div></div><div></div>";
- var top = h.firstChild;
- top.style.height = (original_sh)+'px'; // actually bottom header takes 21px
- var bottom = h.lastChild;
- bottom.style.position = "relative";
-
- for (var m = 0; m < control_dates.length; m++) {
- var tdate = control_dates[m];
- var scs = scheduler.templates[this.name+"_second_scalex_class"](tdate);
- var head=document.createElement("DIV"); head.className="dhx_scale_bar dhx_second_scale_bar"+((scs)?(" "+scs):"");
- scheduler.set_xy(head,second_cols[m]-1,original_sh-3,second_left[m],0); //-1 for border, -3 = -2 padding -1 border bottom
- head.innerHTML = scheduler.templates[this.name+"_second_scale_date"](tdate);
- top.appendChild(head);
- }
- }
-
-
- scheduler.xy.scale_height = original_sh; // fix for _render_x_header which uses current scale_height value
- h = h.lastChild; // h - original scale
- for (var i=0; i<this._trace_x.length; i++){
- start = this._trace_x[i];
- scheduler._render_x_header(i, left[i], start, h);
- var cs = scheduler.templates[this.name+"_scalex_class"](start);
- if (cs)
- h.lastChild.className += " "+cs;
- }
- scheduler.xy.scale_height = current_sh; // restoring current value
-
- var trace = this._trace_x;
- h.onclick = function(e){
- var pos = locate_hcell(e);
- if (pos)
- scheduler.callEvent("onXScaleClick",[pos.x, trace[pos.x], e||event]);
- };
- h.ondblclick = function(e){
- var pos = locate_hcell(e);
- if (pos)
- scheduler.callEvent("onXScaleDblClick",[pos.x, trace[pos.x], e||event]);
- };
-}
-function is_new_interval(mode, date, control_date){ // mode, date to check, control_date for which period should be checked
- switch(mode) {
- case "day":
- return !(date.getDate() == control_date.getDate() && date.getMonth() == control_date.getMonth() && date.getFullYear() == control_date.getFullYear());
- case "week":
- return !(scheduler.date.getISOWeek(date) == scheduler.date.getISOWeek(control_date) && date.getFullYear() == control_date.getFullYear());
- case "month":
- return !(date.getMonth() == control_date.getMonth() && date.getFullYear() == control_date.getFullYear());
- case "year":
- return !(date.getFullYear() == control_date.getFullYear());
- default:
- return false; // same interval
- }
-}
-function set_full_view(mode){
- if (mode){
- scheduler.set_sizes();
- _init_matrix_tooltip();
- //we need to have day-rounded scales for navigation
- //in same time, during rendering scales may be shifted
- var temp = scheduler._min_date;
- x_scale.call(this,scheduler._els["dhx_cal_header"][0]);
- y_scale.call(this,scheduler._els["dhx_cal_data"][0]);
- scheduler._min_date = temp;
- scheduler._els["dhx_cal_date"][0].innerHTML=scheduler.templates[this.name+"_date"](scheduler._min_date, scheduler._max_date);
- scheduler._table_view=true;
- }
-}
-
-
-function hideToolTip(){
- if (scheduler._tooltip){
- scheduler._tooltip.style.display = "none";
- scheduler._tooltip.date = "";
- }
-}
-function showToolTip(obj,pos,offset){
- if (obj.render != "cell") return;
- var mark = pos.x+"_"+pos.y;
- var evs = obj._matrix[pos.y][pos.x];
-
- if (!evs) return hideToolTip();
-
- evs.sort(function(a,b){ return a.start_date>b.start_date?1:-1; });
-
- if (scheduler._tooltip){
- if (scheduler._tooltip.date == mark) return;
- scheduler._tooltip.innerHTML="";
- } else {
- var t = scheduler._tooltip = document.createElement("DIV");
- t.className = "dhx_tooltip";
- document.body.appendChild(t);
- t.onclick = scheduler._click.dhx_cal_data;
- }
-
- var html = "";
-
- for (var i=0; i<evs.length; i++){
- var bg_color = (evs[i].color?("background-color:"+evs[i].color+";"):"");
- var color = (evs[i].textColor?("color:"+evs[i].textColor+";"):"");
- html+="<div class='dhx_tooltip_line' event_id='"+evs[i].id+"' style='"+bg_color+""+color+"'>";
- html+="<div class='dhx_tooltip_date'>"+(evs[i]._timed?scheduler.templates.event_date(evs[i].start_date):"")+"</div>";
- html+="<div class='dhx_event_icon icon_details'> </div>";
- html+=scheduler.templates[obj.name+"_tooltip"](evs[i].start_date, evs[i].end_date,evs[i])+"</div>";
- }
-
- scheduler._tooltip.style.display="";
- scheduler._tooltip.style.top = "0px";
-
- if (document.body.offsetWidth-offset.left-scheduler._tooltip.offsetWidth < 0)
- scheduler._tooltip.style.left = offset.left-scheduler._tooltip.offsetWidth+"px";
- else
- scheduler._tooltip.style.left = offset.left+pos.src.offsetWidth+"px";
-
- scheduler._tooltip.date = mark;
- scheduler._tooltip.innerHTML = html;
-
- if (document.body.offsetHeight-offset.top-scheduler._tooltip.offsetHeight < 0)
- scheduler._tooltip.style.top= offset.top-scheduler._tooltip.offsetHeight+pos.src.offsetHeight+"px";
- else
- scheduler._tooltip.style.top= offset.top+"px";
-}
-
-function _init_matrix_tooltip(){
- dhtmlxEvent(scheduler._els["dhx_cal_data"][0], "mouseover", function(e){
- var obj = scheduler.matrix[scheduler._mode];
- if (obj){
- var pos = scheduler._locate_cell_timeline(e);
- var e = e || event;
- var src = e.target||e.srcElement;
- if (pos)
- return showToolTip(obj,pos,getOffset(pos.src));
- }
- hideToolTip();
- });
- _init_matrix_tooltip=function(){};
-}
-
-scheduler.renderMatrix = function(mode){
- scheduler._els['dhx_cal_data'][0].scrollTop=0;
- var start_date = scheduler.date[this.name+"_start"](scheduler._date);
- scheduler._min_date = scheduler.date.add(start_date, this.x_start*this.x_step, this.x_unit);
- scheduler._max_date = scheduler.date.add(scheduler._min_date, this.x_size*this.x_step, this.x_unit);
- scheduler._table_view = true;
- if(this.second_scale) {
- if(mode && !this._header_resized) {
- this._header_resized = scheduler.xy.scale_height;
- scheduler.xy.scale_height *= 2;
- scheduler._els['dhx_cal_header'][0].className += " dhx_second_cal_header";
- }
- if(!mode && this._header_resized) {
- scheduler.xy.scale_height /= 2;
- this._header_resized = false;
- var header = scheduler._els['dhx_cal_header'][0];
- header.className = header.className.replace(/ dhx_second_cal_header/gi,"");
- }
- }
- set_full_view.call(this,mode);
-};
-
-function html_index(el) {
- var p = el.parentNode.childNodes;
- for (var i=0; i < p.length; i++)
- if (p[i] == el) return i;
- return -1;
-}
-function locate_hcell(e){
- e = e||event;
- var trg = e.target?e.target:e.srcElement;
- while (trg && trg.tagName != "DIV")
- trg=trg.parentNode;
- if (trg && trg.tagName == "DIV"){
- var cs = trg.className.split(" ")[0];
- if (cs == "dhx_scale_bar")
- return { x:html_index(trg), y:-1, src:trg, scale:true };
- }
-}
-scheduler._locate_cell_timeline = function(e){
- e = e||event;
- var trg = e.target?e.target:e.srcElement;
- while (trg && trg.tagName != "TD")
- trg=trg.parentNode;
- if (trg && trg.tagName == "TD"){
- var cs = trg.className.split(" ")[0];
- if (cs == "dhx_matrix_cell") {
-
- if(scheduler._isRender("cell")) {
- return { x:trg.cellIndex-1, y:trg.parentNode.rowIndex, src:trg };
- } else { // probably desired path for all modes except cell
- var trscell = trg.parentNode; // moving out from current td
- while(trscell && trscell.tagName != "TD") {
- trscell=trscell.parentNode;
- }
- return { x:trg.cellIndex, y:trscell.parentNode.rowIndex, src:trg };
- }
- }
- else if (cs == "dhx_matrix_scell")
- return { x:-1, y:trg.parentNode.rowIndex, src:trg, scale:true };
- }
- return false;
-};
-
-var old_click = scheduler._click.dhx_cal_data;
-scheduler._click.dhx_cal_data = function(e){
- var ret = old_click.apply(this,arguments);
- var obj = scheduler.matrix[scheduler._mode];
- if (obj){
- var pos = scheduler._locate_cell_timeline(e);
- if (pos){
- if (pos.scale)
- scheduler.callEvent("onYScaleClick",[pos.y, obj.y_unit[pos.y], e||event]);
- else
- scheduler.callEvent("onCellClick",[pos.x, pos.y, obj._trace_x[pos.x], (((obj._matrix[pos.y]||{})[pos.x])||[]), e||event]);
- }
- }
- return ret;
-};
-
-scheduler.dblclick_dhx_matrix_cell = function(e){
- var obj = scheduler.matrix[scheduler._mode];
- if (obj){
- var pos = scheduler._locate_cell_timeline(e);
- if (pos){
- if (pos.scale)
- scheduler.callEvent("onYScaleDblClick",[pos.y, obj.y_unit[pos.y], e||event]);
- else
- scheduler.callEvent("onCellDblClick",[pos.x, pos.y, obj._trace_x[pos.x], (((obj._matrix[pos.y]||{})[pos.x])||[]), e||event]);
- }
- }
-};
-scheduler.dblclick_dhx_matrix_scell = function(e){
- return scheduler.dblclick_dhx_matrix_cell(e);
-};
-
-scheduler._isRender = function(mode){
- return (scheduler.matrix[scheduler._mode] && scheduler.matrix[scheduler._mode].render == mode);
-};
-
-scheduler.attachEvent("onCellDblClick", function (x, y, a, b, event){
- if (this.config.readonly|| (event.type == "dblclick" && !this.config.dblclick_create)) return;
-
- var obj = scheduler.matrix[scheduler._mode];
- var event_options = {};
- event_options['start_date'] = obj._trace_x[x];
- event_options['end_date'] = (obj._trace_x[x+1]) ? obj._trace_x[x+1] : scheduler.date.add(obj._trace_x[x], obj.x_step, obj.x_unit);
- event_options[scheduler.matrix[scheduler._mode].y_property] = obj.y_unit[y].key;
- scheduler.addEventNow(event_options, null, event);
-});
-
-scheduler.attachEvent("onBeforeDrag", function (event_id, mode, native_event_object){
- if(scheduler._isRender("cell")) {
- return false;
- }
- return true;
-});
-
-})();
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_minical.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_minical.js deleted file mode 100644 index 0fa43fc3e0c..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_minical.js +++ /dev/null @@ -1,402 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.templates.calendar_month = scheduler.date.date_to_str("%F %Y");
-scheduler.templates.calendar_scale_date = scheduler.date.date_to_str("%D");
-scheduler.templates.calendar_date = scheduler.date.date_to_str("%d");
-
-
-scheduler.renderCalendar=function(obj, _prev){
- var cal = null;
- var date = obj.date||(new Date());
- if (typeof date == "string")
- date = this.templates.api_date(date);
-
- if (!_prev){
- var cont = obj.container;
- var pos = obj.position;
-
-
- if (typeof cont == "string")
- cont = document.getElementById(cont);
-
- if (typeof pos == "string")
- pos = document.getElementById(pos);
- if (pos && (typeof pos.left == "undefined")){
- var tpos = getOffset(pos);
- pos = {
- top:tpos.top + pos.offsetHeight,
- left:tpos.left
- };
- }
- if (!cont)
- cont = scheduler._get_def_cont(pos);
-
- cal = this._render_calendar(cont,date,obj);
- cal.onclick = function(e){
- e = e||event;
- var src = e.target||e.srcElement;
-
- if (src.className.indexOf("dhx_month_head")!=-1){
- var pname = src.parentNode.className;
- if (pname.indexOf("dhx_after")==-1 && pname.indexOf("dhx_before")==-1) {
- var newdate = scheduler.templates.xml_date(this.getAttribute("date"));
- newdate.setDate(parseInt(src.innerHTML,10));
- scheduler.unmarkCalendar(this);
- scheduler.markCalendar(this,newdate,"dhx_calendar_click");
- this._last_date=newdate;
- if (this.conf.handler) this.conf.handler.call(scheduler, newdate, this);
- }
- }
- };
- } else {
- cal = this._render_calendar(_prev.parentNode, date, obj, _prev);
- scheduler.unmarkCalendar(cal);
- }
-
-
- var start = scheduler.date.month_start(date);
- var end = scheduler.date.add(start,1,"month");
- var evs = this.getEvents(start,end);
- for (var i=0; i < evs.length; i++){
- var ev = evs[i];
- var d = ev.start_date;
- if (d.valueOf()<start.valueOf())
- d = start;
- d = scheduler.date.date_part(new Date(d.valueOf()));
- while (d<ev.end_date){
- this.markCalendar(cal,d,"dhx_year_event");
- d = this.date.add(d,1,"day");
- if (d.valueOf()>=end.valueOf())
- break;
- }
- }
-
-
- this._markCalendarCurrentDate(cal);
-
-
- cal.conf = obj;
- return cal;
-};
-scheduler._get_def_cont = function(pos){
- if (!this._def_count){
- this._def_count = document.createElement("DIV");
- this._def_count.style.cssText = "position:absolute;z-index:10100;width:251px; height:175px;";
- this._def_count.onclick = function(e){ (e||event).cancelBubble = true; };
- document.body.appendChild(this._def_count);
- }
-
- this._def_count.style.left = pos.left+"px";
- this._def_count.style.top = pos.top+"px";
- this._def_count._created = new Date();
-
- return this._def_count;
-};
-scheduler._locateCalendar=function(cal,date){
- var table=cal.childNodes[2].childNodes[0];
- if (typeof date == "string")
- date = scheduler.templates.api_date(date);
-
- var d = cal.week_start+date.getDate()-1;
- return table.rows[Math.floor(d/7)].cells[d%7].firstChild;
-};
-scheduler.markCalendar=function(cal,date,css){
- this._locateCalendar(cal,date).className+=" "+css;
-};
-scheduler.unmarkCalendar=function(cal,date,css){
- date=date||cal._last_date;
- css=css||"dhx_calendar_click";
- if (!date) return;
- var el = this._locateCalendar(cal,date);
- el.className= (el.className||"").replace(RegExp(css,"g"));
-};
-scheduler._week_template=function(width){
- var summ = (width || 250);
- var left = 0;
-
- var week_template = document.createElement("div");
- var dummy_date = this.date.week_start(new Date());
- for (var i=0; i<7; i++){
- this._cols[i]=Math.floor(summ/(7-i));
- this._render_x_header(i,left,dummy_date,week_template);
- dummy_date = this.date.add(dummy_date,1,"day");
- summ-=this._cols[i];
- left+=this._cols[i];
- }
- week_template.lastChild.className+=" dhx_scale_bar_last";
- return week_template;
-};
-scheduler.updateCalendar=function(obj,sd){
- obj.conf.date = sd;
- this.renderCalendar(obj.conf, obj);
-};
-scheduler._mini_cal_arrows = [" ", " "];
-scheduler._render_calendar=function(obj,sd,conf, previous){
- /*store*/
- var ts = scheduler.templates;
- var temp = this._cols; this._cols=[];
- var temp2 = this._mode; this._mode = "calendar";
- var temp3 = this._colsS; this._colsS = {height:0};
- var temp4 = new Date(this._min_date);
- var temp5 = new Date(this._max_date);
- var temp6 = new Date(scheduler._date);
- var temp7 = ts.month_day; ts.month_day=ts.calendar_date;
-
-
- sd = this.date.month_start(sd);
- var week_template = this._week_template(obj.offsetWidth-1);
-
- var d;
- if (previous)
- d = previous;
- else {
- d = document.createElement("DIV");
- d.className="dhx_cal_container dhx_mini_calendar";
- }
- d.setAttribute("date",this.templates.xml_format(sd));
- d.innerHTML="<div class='dhx_year_month'></div><div class='dhx_year_week'>"+week_template.innerHTML+"</div><div class='dhx_year_body'></div>";
-
- d.childNodes[0].innerHTML=this.templates.calendar_month(sd);
- if (conf.navigation){
- var arrow = document.createElement("DIV");
- arrow.className = "dhx_cal_prev_button";
- arrow.style.cssText="left:1px;top:2px;position:absolute;";
- arrow.innerHTML = this._mini_cal_arrows[0];
- d.firstChild.appendChild(arrow);
- arrow.onclick=function(){
- scheduler.updateCalendar(d, scheduler.date.add(d._date, -1, "month"));
- if(scheduler._date.getMonth() == d._date.getMonth() && scheduler._date.getFullYear() == d._date.getFullYear()) {
- scheduler._markCalendarCurrentDate(d);
- }
- };
-
- arrow = document.createElement("DIV");
- arrow.className = "dhx_cal_next_button";
- arrow.style.cssText="left:auto; right:1px;top:2px;position:absolute;";
- arrow.innerHTML = this._mini_cal_arrows[1];
- d.firstChild.appendChild(arrow);
- arrow.onclick=function(){
- scheduler.updateCalendar(d, scheduler.date.add(d._date, 1, "month"));
- if(scheduler._date.getMonth() == d._date.getMonth() && scheduler._date.getFullYear() == d._date.getFullYear()) {
- scheduler._markCalendarCurrentDate(d);
- }
- };
-
- }
- d._date = new Date(sd);
-
- d.week_start = (sd.getDay()-(this.config.start_on_monday?1:0)+7)%7;
-
- var dd = this.date.week_start(sd);
- this._reset_month_scale(d.childNodes[2],sd,dd);
-
- var r=d.childNodes[2].firstChild.rows;
- for (var k=r.length; k<6; k++) {
- var last_row = r[r.length-1];
- r[0].parentNode.appendChild(last_row.cloneNode(true));
- var last_day_number = parseInt(last_row.childNodes[last_row.childNodes.length-1].childNodes[0].innerHTML);
- last_day_number = (last_day_number<10)?last_day_number:0; // previous week could end on 28-31, so we should start with 0
- for (var ri=0; ri < r[k].childNodes.length; ri++) {
- r[k].childNodes[ri].className = "dhx_after";
- r[k].childNodes[ri].childNodes[0].innerHTML = scheduler.date.to_fixed(++last_day_number);
- }
- }
-
- if (!previous)
- obj.appendChild(d);
-
- d.childNodes[1].style.height = d.childNodes[1].childNodes[0].offsetHeight <= 0 ? "0px" : (d.childNodes[1].childNodes[0].offsetHeight-1)+"px"; // dhx_year_week should have height property so that day dates would get correct position. dhx_year_week height = height of it's child (with the day name)
-
- /*restore*/ this._cols=temp; this._mode = temp2; this._colsS = temp3; this._min_date=temp4; this._max_date=temp5; scheduler._date = temp6; ts.month_day=temp7;
- return d;
-};
-scheduler.destroyCalendar=function(cal,force){
- if (!cal && this._def_count && this._def_count.firstChild){
- if (force || (new Date()).valueOf() - this._def_count._created.valueOf() > 500)
- cal = this._def_count.firstChild;
- }
- if (!cal) return;
- cal.onclick=null;
- cal.innerHTML="";
- if (cal.parentNode)
- cal.parentNode.removeChild(cal);
- if (this._def_count)
- this._def_count.style.top = "-1000px";
-};
-scheduler.isCalendarVisible=function(){
- if (this._def_count && parseInt(this._def_count.style.top,10) > 0 )
- return this._def_count;
- return false;
-};
-scheduler.attachEvent("onTemplatesReady",function(){
- dhtmlxEvent(document.body, "click", function(){ scheduler.destroyCalendar(); });
-});
-
-scheduler.templates.calendar_time = scheduler.date.date_to_str("%d-%m-%Y");
-
-scheduler.form_blocks.calendar_time={
- render:function(){
- var html = "<input class='dhx_readonly' type='text' readonly='true'>";
-
- var cfg = scheduler.config;
- var dt = this.date.date_part(new Date());
- if (cfg.first_hour)
- dt.setHours(cfg.first_hour);
-
- html+=" <select>";
- for (var i=60*cfg.first_hour; i<60*cfg.last_hour; i+=this.config.time_step*1){
- var time=this.templates.time_picker(dt);
- html+="<option value='"+i+"'>"+time+"</option>";
- dt=this.date.add(dt,this.config.time_step,"minute");
- }
- html+="</select>";
-
- var full_day = scheduler.config.full_day;
-
- return "<div style='height:30px;padding-top:0; font-size:inherit;' class='dhx_section_time'>"+html+"<span style='font-weight:normal; font-size:10pt;'> – </span>"+html+"</div>";
- },
- set_value:function(node,value,ev){
-
- var inputs=node.getElementsByTagName("input");
- var selects=node.getElementsByTagName("select");
-
- var _init_once = function(inp,date,number){
- inp.onclick = function(){
- scheduler.destroyCalendar(null, true);
- scheduler.renderCalendar({
- position:inp,
- date:new Date(this._date),
- navigation:true,
- handler:function(new_date){
- inp.value = scheduler.templates.calendar_time(new_date);
- inp._date = new Date(new_date);
- scheduler.destroyCalendar();
- if(scheduler.config.event_duration && scheduler.config.auto_end_date && number == 0) { //first element = start date
- _update_minical_select();
- }
- }
- });
- };
- };
-
- if(scheduler.config.full_day) {
- if (!node._full_day){
- var html = "<label class='dhx_fullday'><input type='checkbox' name='full_day' value='true'> "+scheduler.locale.labels.full_day+" </label></input>";
- if (!scheduler.config.wide_form)
- html = node.previousSibling.innerHTML+html;
- node.previousSibling.innerHTML=html;
- node._full_day=true;
- }
- var input=node.previousSibling.getElementsByTagName("input")[0];
-
- var isFulldayEvent = (scheduler.date.time_part(ev.start_date)==0 && scheduler.date.time_part(ev.end_date)==0 && ev.end_date.valueOf()-ev.start_date.valueOf() < 2*24*60*60*1000);
- input.checked = isFulldayEvent;
- for(var i in selects)
- selects[i].disabled=input.checked;
- for(var i=0; i<inputs.length; i++)
- inputs[i].disabled=input.checked;
-
- input.onclick = function(){
- if(input.checked == true) {
- var start_date = new Date(ev.start_date);
- var end_date = new Date(ev.end_date);
-
- scheduler.date.date_part(start_date);
- end_date = scheduler.date.add(start_date, 1, "day");
- }
-
- var start = start_date||ev.start_date;
- var end = end_date||ev.end_date;
- _attach_action(inputs[0],start);
- _attach_action(inputs[1],end);
- selects[0].value=start.getHours()*60+start.getMinutes();
- selects[1].value=end.getHours()*60+end.getMinutes();
-
- for(var i in selects)
- selects[i].disabled=input.checked;
- for(var i=0; i<inputs.length; i++)
- inputs[i].disabled=input.checked;
-
- };
- }
-
- if(scheduler.config.event_duration && scheduler.config.auto_end_date) {
-
- function _update_minical_select() {
- ev.start_date = scheduler.date.add(inputs[0]._date, selects[0].value, "minute");
- ev.end_date.setTime(ev.start_date.getTime() + (scheduler.config.event_duration * 60 * 1000));
-
- inputs[1].value = scheduler.templates.calendar_time(ev.end_date);
- inputs[1]._date = scheduler.date.date_part(new Date(ev.end_date));
-
- selects[1].value=ev.end_date.getHours()*60+ev.end_date.getMinutes();
- }
-
- selects[0].onchange = _update_minical_select; // only update on first select should trigger update so user could define other end date if he wishes too
- }
-
- function _attach_action(inp, date, number){
- _init_once(inp,date,number);
- inp.value = scheduler.templates.calendar_time(date);
- inp._date = scheduler.date.date_part(new Date(date));
- };
-
- _attach_action(inputs[0],ev.start_date, 0);
- _attach_action(inputs[1],ev.end_date, 1);
- _init_once = function(){};
-
- selects[0].value=ev.start_date.getHours()*60+ev.start_date.getMinutes();
- selects[1].value=ev.end_date.getHours()*60+ev.end_date.getMinutes();
-
- },
- get_value:function(node,ev){
- var inputs = node.getElementsByTagName("input");
- var selects = node.getElementsByTagName("select");
-
- ev.start_date = scheduler.date.add(inputs[0]._date, selects[0].value, "minute");
- ev.end_date = scheduler.date.add(inputs[1]._date, selects[1].value, "minute");
-
- if (ev.end_date<=ev.start_date)
- ev.end_date=scheduler.date.add(ev.start_date,scheduler.config.time_step,"minute");
- },
- focus:function(node){
- }
-};
-scheduler.linkCalendar=function(calendar, datediff){
- var action = function(){
- var date = scheduler._date;
- var dateNew = new Date(date.valueOf());
- if (datediff) dateNew = datediff(dateNew);
- dateNew.setDate(1);
- scheduler.updateCalendar(calendar, dateNew);
- return true;
- };
-
- scheduler.attachEvent("onViewChange", action);
- scheduler.attachEvent("onXLE", action);
- scheduler.attachEvent("onEventAdded", action);
- scheduler.attachEvent("onEventChanged", action);
- scheduler.attachEvent("onAfterEventDelete", action);
- action();
-};
-
-scheduler._markCalendarCurrentDate = function(calendar) {
- var date = scheduler._date;
- var mode = scheduler._mode;
-
- if(calendar._date.getMonth() == date.getMonth() && calendar._date.getFullYear() == date.getFullYear()) {
- if (mode == 'day' || (this._props && !!this._props[mode])) {
- scheduler.markCalendar(calendar,date, "dhx_calendar_click");
- } else if (mode == 'week') {
- var dateNew = scheduler.date.week_start(new Date(date.valueOf()));
- for (var i = 0; i < 7; i++) {
- var diff = dateNew.getMonth() + dateNew.getYear()*12 - date.getMonth() - date.getYear()*12;
- if (!diff)
- scheduler.markCalendar(calendar, dateNew, "dhx_calendar_click");
- dateNew = scheduler.date.add(dateNew,1,"day");
- }
- }
- }
-};
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_monthheight.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_monthheight.js deleted file mode 100644 index 6b86b7524d2..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_monthheight.js +++ /dev/null @@ -1,31 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.attachEvent("onTemplatesReady",function(){
- scheduler.xy.scroll_width = 0;
-
- var old = scheduler.render_view_data;
- scheduler.render_view_data=function(){
- var data = this._els["dhx_cal_data"][0];
- data.firstChild._h_fix = true;
-
- old.apply(scheduler,arguments);
-
-
-
- var height = parseInt(data.style.height);
- data.style.height="1px";
- data.style.height=data.scrollHeight+"px";
-
- this._obj.style.height = this._obj.clientHeight + data.scrollHeight - height + "px";
- }
-
- var old_s=scheduler._reset_month_scale;
- scheduler._reset_month_scale=function(a,b,c){
- var dummy = {clientHeight:100};
- old_s.apply(scheduler,[dummy,b,c]);
- a.innerHTML = dummy.innerHTML;
- }
-
-});
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_offline.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_offline.js deleted file mode 100644 index f9e5f946476..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_offline.js +++ /dev/null @@ -1,102 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler._extra_xle = false; // flag if we are calling xle once again (we don't want to get into loop with scheduler.parse)
-scheduler.attachEvent("onXLE", function(){
- if(!scheduler._extra_xle){
- var isEventsLoaded = false;
- for(var key in scheduler._events){
- if(scheduler._events[key].text) {
- isEventsLoaded = true;
- break;
- }
- }
- if((localStorage._updated_events || !isEventsLoaded) && localStorage._events) {
- scheduler._extra_xle = true;
- scheduler.parse(localStorage._events, "json");
- scheduler._extra_xle = false;
- var dp = scheduler._dataprocessor;
- var updatedEvents = JSON.parse(localStorage._updated_events);
- dp.setUpdateMode("off");
- for(var id in updatedEvents)
- dp.setUpdated(id,true,updatedEvents[id]);
- dp.sendData();
- dp.setUpdateMode("cell");
- }
- }
-});
-scheduler.attachEvent("onBeforeEventDelete", function(id, object){
- var status = scheduler._dataprocessor.getState(id);
- if(status == 'inserted' && localStorage._updated_events) {
- var updated_events = JSON.parse(localStorage._updated_events);
- delete updated_events[id];
- for(var id in updated_events){
- localStorage._updated_events = JSON.stringify(updated_events);
- break;
- }
- }
- return true;
-});
-
-var old_delete_event = scheduler.deleteEvent;
-scheduler.deleteEvent = function(id, silent){
- old_delete_event.apply(this, arguments);
- localStorage._events = scheduler.toJSON();
-};
-
-scheduler._offline = {};
-scheduler._offline._after_update_events = [];
-
-var old_dp_init = scheduler._dp_init;
-scheduler._dp_init = function(dp){
- old_dp_init.apply(this, arguments);
-
- dp.attachEvent("onAfterUpdate",function(sid,action,tid,xml_node){
- scheduler._offline._after_update_events.push(sid);
- return true;
- });
- dp.attachEvent("onAfterUpdateFinish",function(sid,action,tid,xml_node){
- localStorage._events = scheduler.toJSON();
- var updated_events = JSON.parse(localStorage._updated_events);
- for(var i=0; i<scheduler._offline._after_update_events.length; i++){
- delete updated_events[scheduler._offline._after_update_events[i]];
- }
- var eventsLeft = false;
- for(var id in updated_events){
- eventsLeft = true;
- break;
- }
- if(eventsLeft) {
- localStorage._updated_events = JSON.stringify(updated_events);
- scheduler._offline._after_update_event = [];
- }
- else {
- delete localStorage._updated_events;
- }
- return true;
- });
- dp.attachEvent("onBeforeDataSending",function(id, b, rows){
- var updated_events = {};
- if(localStorage._updated_events)
- updated_events = JSON.parse(localStorage._updated_events);
-
- for(var ev_id in rows){
- var param = scheduler._dataprocessor.action_param;
- if((updated_events[ev_id] && (updated_events[ev_id][param] == 'inserted' || rows[ev_id][param] == 'deleted')) || !updated_events[ev_id])
- updated_events[ev_id] = rows[ev_id][param];
- }
-
- localStorage._events = scheduler.toJSON();
- localStorage._updated_events = JSON.stringify(updated_events);
-
- return true;
- });
- dhtmlxError.catchError("LoadXML",function(a,b,xml){
- for(var key in scheduler._dataprocessor._in_progress) {
- delete scheduler._dataprocessor._in_progress[key];
- }
- });
-
-};
-
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_pdf.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_pdf.js deleted file mode 100644 index 86439ab7e3a..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_pdf.js +++ /dev/null @@ -1,222 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.toPDF=function(url,mode,header,footer){
- var dx = 0;
- var dy = 0;
- var colors = false;
- if (mode == "fullcolor"){
- colors = true;
- mode = "color";
- }
-
- mode = mode||"color";
- html_regexp = new RegExp("<[^>]*>","g");
- function clean_html(val){
- return val.replace(html_regexp,"");
- }
- function x_norm(x) {
- x = parseFloat(x);
- if (isNaN(x)) return "auto";
- return 100 * x / (dx + 1);
- }
- function y_norm(y) {
- y = parseFloat(y);
- if (isNaN(y)) return "auto";
- return 100 * y / dy;
- }
- function xml_month_scale(xh){
- var xml="";
- if (scheduler.matrix && scheduler.matrix[scheduler._mode])
- xh = xh[0].childNodes;
- for (var i = 0; i < xh.length; i++)
- xml += "\n<column><![CDATA[" + clean_html(xh[i].innerHTML) + "]]></column>";
- dx = xh[0].offsetWidth;
- return xml;
- }
- function de_day(node,n){
- var x = parseInt(node.style.left);
-
- for (var dx=0; dx < scheduler._cols.length; dx++){
- x-=scheduler._cols[dx];
- if (x<0) return dx;
- }
- return n;
- }
- function de_week(node,n){
- var y = parseInt(node.style.top);
- for (var dy=0; dy < scheduler._colsS.heights.length; dy++)
- if (scheduler._colsS.heights[dy]>y) return dy;
- return n;
- }
- function xml_month(yh){
- var xml="";
- var r = yh.firstChild.rows;
- for (var i = 0; i < r.length; i++) {
- var days = [];
- for (var j = 0; j < r[i].cells.length; j++){
- /* var dd = r[i].cells[j];
- var css = dd.className;
-
- if (css!=" " && css!="dhx_now ")
- days.push("");
- else*/
- days.push(r[i].cells[j].firstChild.innerHTML);
- }
-
- xml += "\n<row height='"+yh.firstChild.rows[i].cells[0].offsetHeight+"'><![CDATA[" + clean_html(days.join("|")) + "]]></row>";
- dy = yh.firstChild.rows[0].cells[0].offsetHeight;
- }
- return xml;
- }
- function xml_top(profile) {
- var xml = "<data profile='"+profile+"'";
- if (header)
- xml+=" header='"+header+"'";
- if (footer)
- xml+=" footer='"+footer+"'";
- xml+=">";
- xml += "<scale mode='" + scheduler._mode + "' today='" + scheduler._els.dhx_cal_date[0].innerHTML + "'>";
-
- if (scheduler._mode == "agenda"){
- var xh = scheduler._els.dhx_cal_header[0].childNodes[0].childNodes;
-
- xml+="<column>"+clean_html(xh[0].innerHTML)+"</column><column>"+clean_html(xh[1].innerHTML)+"</column>"
- } else if (scheduler._mode == "year"){
- var xh = scheduler._els.dhx_cal_data[0].childNodes;
- for (var i=0; i < xh.length; i++) {
- xml+="<month label='"+clean_html(xh[i].childNodes[0].innerHTML)+"'>";
- xml+=xml_month_scale(xh[i].childNodes[1].childNodes);
- xml+=xml_month(xh[i].childNodes[2]);
- xml+="</month>";
- };
- } else {
- xml += "<x>";
- var xh = scheduler._els.dhx_cal_header[0].childNodes;
- xml+=xml_month_scale(xh);
- xml += "</x>";
-
- var yh = scheduler._els.dhx_cal_data[0];
- if (scheduler.matrix && scheduler.matrix[scheduler._mode]) {
- xml += "<y>"
- for (var i=0; i < yh.firstChild.rows.length; i++) {
- xml+="<row><![CDATA["+yh.firstChild.rows[i].cells[0].innerHTML+"]]></row>";
- };
- xml+="</y>";
- dy = yh.firstChild.rows[0].cells[0].offsetHeight;
- } else if (yh.firstChild.tagName == "TABLE") {
- xml += xml_month(yh);
- } else {
- yh = yh.childNodes[yh.childNodes.length - 1];
- while (yh.className.indexOf("dhx_scale_holder") == -1)
- yh = yh.previousSibling;
- yh = yh.childNodes;
-
- xml += "<y>";
- for (var i = 0; i < yh.length; i++)
- xml += "\n<row><![CDATA[" + clean_html(yh[i].innerHTML) + "]]></row>";
- xml += "</y>";
- dy = yh[0].offsetHeight;
- }
- }
-
- xml += "</scale>";
- return xml;
- }
- function get_style(node, style){
- return (window.getComputedStyle?(window.getComputedStyle(node, null)[style]):(node.currentStyle?node.currentStyle[style]:null))||"";
- }
- function xml_body() {
- var xml = "";
- var evs = scheduler._rendered;
-
- if (scheduler._mode == "agenda"){
- for (var i=0; i < evs.length; i++)
- xml+="<event><head>"+clean_html(evs[i].childNodes[0].innerHTML)+"</head><body>"+clean_html(evs[i].childNodes[2].innerHTML)+"</body></event>";
- } else if (scheduler._mode == "year"){
- var evs = scheduler.get_visible_events();
- for (var i=0; i < evs.length; i++) {
- var d = evs[i].start_date;
- if (d.valueOf()<scheduler._min_date.valueOf())
- d = scheduler._min_date;
- while (d<evs[i].end_date){
- var m = d.getMonth()+12*(d.getFullYear()-scheduler._min_date.getFullYear())-scheduler.week_starts._month;
- var day = scheduler.week_starts[m]+d.getDate()-1;
-
- xml+="<event day='"+(day%7)+"' week='"+Math.floor(day/7)+"' month='"+m+"'></event>";
- d = scheduler.date.add(d,1,"day");
- if (d.valueOf()>=scheduler._max_date.valueOf())
- break;
- }
- }
- } else {
- for (var i = 0; i < evs.length; i++) {
- var zx = x_norm(evs[i].style.left);
- var zdx = x_norm(evs[i].style.width);
- var zy = y_norm(evs[i].style.top);
- var zdy = y_norm(evs[i].style.height);
- var e_type = evs[i].className.split(" ")[0].replace("dhx_cal_", "");
- var dets = scheduler.getEvent(evs[i].getAttribute("event_id"))
- var day = dets._sday;
- var week = dets._sweek;
- if (scheduler._mode != "month") {
- if (scheduler.matrix && scheduler.matrix[scheduler._mode]){
- day = 0;
- week = evs[i].parentNode.parentNode.parentNode.rowIndex;
- zdx += x_norm(10);
- } else {
- zdx+=x_norm(zdx*20/100);
- zx-=x_norm(20-zx*20/100);
-
- if (evs[i].parentNode == scheduler._els.dhx_cal_data[0]) continue;
- zx += x_norm(evs[i].parentNode.style.left);
- zx -= x_norm(51);
- }
- if (scheduler._mode == "timeline") {
- var dy_copy = dy;
- dy = 180;
- zy = y_norm(evs[i].style.top);
- dy = dy_copy;
- }
- } else {
- zdy = parseInt(evs[i].offsetHeight);
- zy = parseInt(evs[i].style.top) - 22;
-
- day = de_day(evs[i],day);
- week = de_week(evs[i],week);
- }
-
- xml += "\n<event week='"+week+"' day='"+day+"' type='" + e_type + "' x='" + zx + "' y='" + zy + "' width='" + zdx + "' height='" + zdy + "'>";
-
-
- if (e_type == "event") {
- xml += "<header><![CDATA[" + clean_html(evs[i].childNodes[1].innerHTML) + "]]></header>";
- var text_color = colors?get_style(evs[i].childNodes[2],"color"):"";
- var bg_color = colors?get_style(evs[i].childNodes[2],"backgroundColor"):"";
- xml += "<body backgroundColor='"+bg_color+"' color='" + text_color + "'><![CDATA[" + clean_html(evs[i].childNodes[2].innerHTML) + "]]></body>";
- } else {
- var text_color = colors?get_style(evs[i],"color"):"";
- var bg_color = colors?get_style(evs[i],"backgroundColor"):"";
- xml += "<body backgroundColor='"+bg_color+"' color='" + text_color + "'><![CDATA[" + clean_html(evs[i].innerHTML) + "]]></body>";
- }
- xml += "</event>";
- }
- }
- return xml;
- }
- function xml_end(){
- var xml = "</data>";
- return xml;
- }
-
- var uid = (new Date()).valueOf();
- var d=document.createElement("div");
- d.style.display="none";
- document.body.appendChild(d);
-
- d.innerHTML = '<form id="'+uid+'" method="post" target="_blank" action="'+url+'" accept-charset="utf-8" enctype="application/x-www-form-urlencoded"><input type="hidden" name="mycoolxmlbody"/> </form>';
- document.getElementById(uid).firstChild.value = xml_top(mode).replace("\u2013", "-") + xml_body() + xml_end();
- document.getElementById(uid).submit();
- d.parentNode.removeChild(d);grid = null;
-}
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_tooltip.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_tooltip.js deleted file mode 100644 index 512cafebd5f..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_tooltip.js +++ /dev/null @@ -1,160 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -window.dhtmlXTooltip={};
-
-dhtmlXTooltip.config = {
- className: 'dhtmlXTooltip tooltip',
- timeout_to_display: 50,
- delta_x: 15,
- delta_y: -20
-};
-
-dhtmlXTooltip.tooltip = document.createElement('div');
-dhtmlXTooltip.tooltip.className = dhtmlXTooltip.config.className;
-
-dhtmlXTooltip.show = function(event, text) { //browser event, text to display
- var dhxTooltip = dhtmlXTooltip;
- var tooltip_div = this.tooltip;
- var tooltip_div_style = tooltip_div.style;
- dhxTooltip.tooltip.className = dhxTooltip.config.className;
- var pos=this.position(event);
-
- var target = event.target||event.srcElement;
- if (this.isTooltip(target)) {return;} // if we are over tooltip -- do nothing, just return (so tooltip won't move)
-
- var offsetleft = 0;
- var offsettop = 0;
- var pobj = scheduler._obj;
- if(pobj.offsetParent) {
- do {
- offsetleft += pobj.offsetLeft;
- offsettop += pobj.offsetTop;
- } while (pobj = pobj.offsetParent);
- }
-
- var actual_x = pos.x + (dhxTooltip.config.delta_x||0) - offsetleft;
- var actual_y = pos.y - (dhxTooltip.config.delta_y||0) - offsettop;
-
- tooltip_div_style.visibility = "hidden";
-
- if(tooltip_div_style.removeAttribute) {
- tooltip_div_style.removeAttribute("right");
- tooltip_div_style.removeAttribute("bottom");
- } else {
- tooltip_div_style.removeProperty("right");
- tooltip_div_style.removeProperty("bottom");
- }
-
- tooltip_div_style.left = "0";
- tooltip_div_style.top = "0";
-
- this.tooltip.innerHTML = text;
- scheduler._obj.appendChild(this.tooltip);
-
- var tooltip_width = this.tooltip.offsetWidth;
- var tooltip_height = this.tooltip.offsetHeight;
-
- if ((scheduler._obj.offsetWidth - actual_x - (scheduler.xy.margin_left||0) - tooltip_width) < 0) { // tooltip is out of the right page bound
- if(tooltip_div_style.removeAttribute)
- tooltip_div_style.removeAttribute("left");
- else
- tooltip_div_style.removeProperty("left");
- tooltip_div_style.right = (scheduler._obj.offsetWidth - actual_x + 2 * (dhxTooltip.config.delta_x||0)) + "px";
- } else {
- if (actual_x < 0) { // tooltips is out of the left page bound
- tooltip_div_style.left = (pos.x + Math.abs(dhxTooltip.config.delta_x||0)) + "px";
- } else { // normal situation
- tooltip_div_style.left = actual_x + "px";
- }
- }
-
- if ((scheduler._obj.offsetHeight - actual_y - (scheduler.xy.margin_top||0) - tooltip_height) < 0) { // tooltip is below bottom of the page
- if(tooltip_div_style.removeAttribute)
- tooltip_div_style.removeAttribute("top");
- else
- tooltip_div_style.removeProperty("top");
- tooltip_div_style.bottom = (scheduler._obj.offsetHeight - actual_y - 2 * (dhxTooltip.config.delta_y||0)) + "px";
- } else {
- if (actual_y < 0) { // tooltip is higher then top of the page
- tooltip_div_style.top = (pos.y + Math.abs(dhxTooltip.config.delta_y||0)) + "px";
- }
- else { // normal situation
- tooltip_div_style.top = actual_y + "px";
- }
- }
-
- tooltip_div_style.visibility = "visible";
-};
-
-dhtmlXTooltip.hide = function() {
- if(this.tooltip.parentNode) {
- this.tooltip.parentNode.removeChild(this.tooltip);
- }
-};
-dhtmlXTooltip.delay = function(method, object, params, delay) {
- if(this.tooltip._timeout_id) {
- window.clearTimeout(this.tooltip._timeout_id);
- }
- this.tooltip._timeout_id = setTimeout(function(){
- var ret = method.apply(object,params);
- method = object = params = null;
- return ret;
- },delay||this.config.timeout_to_display);
-};
-
-dhtmlXTooltip.isTooltip = function(node){
- var res = false;
- while (node && !res) {
- res = (node.className == this.tooltip.className);
- node=node.parentNode;
- }
- return res;
-};
-
-dhtmlXTooltip.position = function(ev) {
- ev = ev || window.event;
- if(ev.pageX || ev.pageY) //FF, KHTML
- return {x:ev.pageX, y:ev.pageY};
- //IE
- var d = ((dhtmlx._isIE)&&(document.compatMode != "BackCompat"))?document.documentElement:document.body;
- return {
- x:ev.clientX + d.scrollLeft - d.clientLeft,
- y:ev.clientY + d.scrollTop - d.clientTop
- };
-};
-
-scheduler.attachEvent("onMouseMove", function(event_id, e){ // (scheduler event_id, browser event)
- var ev = window.event||e;
- var target = ev.target||ev.srcElement;
- var dhxTooltip = dhtmlXTooltip;
-
- if (event_id || dhxTooltip.isTooltip(target)) { // if we are over event or tooltip
- var event = scheduler.getEvent(event_id) || scheduler.getEvent(dhxTooltip.tooltip.event_id);
- if(!event)
- return;
- dhxTooltip.tooltip.event_id = event.id;
- var text = scheduler.templates.tooltip_text(event.start_date, event.end_date, event);
-
- var evt = undefined;
- if (_isIE) { //make a copy of event, will be used in timed call
- evt = document.createEventObject(ev);
- }
-
- dhxTooltip.delay(dhxTooltip.show, dhxTooltip, [(evt||ev), text]); // showing tooltip
- } else {
- dhxTooltip.delay(dhxTooltip.hide, dhxTooltip, []);
- }
-});
-scheduler.attachEvent("onBeforeDrag", function(){
- dhtmlXTooltip.hide();
- return true;
-});
-
-/* Could be redifined */
-scheduler.templates.tooltip_date_format=scheduler.date.date_to_str("%Y-%m-%d %H:%i");
-
-scheduler.templates.tooltip_text = function(start,end,event) {
- return "<b>Event:</b> "+event.text+"<br/><b>Start date:</b> "+scheduler.templates.tooltip_date_format(start)+"<br/><b>End date:</b> "+scheduler.templates.tooltip_date_format(end);
-};
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_wp.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_wp.js deleted file mode 100644 index 7f85903674d..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_wp.js +++ /dev/null @@ -1,17 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.attachEvent("onLightBox",function(){
- if (this._cover){
- try{
- this._cover.style.height = this.expanded ? "100%" : ((document.body.parentNode||document.body).scrollHeight+"px");
- } catch(e) {};
- }
-});
-
-scheduler.form_blocks.select.set_value=function(node,value,ev){
- if (typeof value == "undefined" || value === "")
- value = (node.firstChild.options[0]||{}).value;
- node.firstChild.value=value||"";
-};
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/glossy.css b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/glossy.css deleted file mode 100644 index 51c4e99d668..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/glossy.css +++ /dev/null @@ -1,294 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -.dhx_cal_tab.active{
- border:none;
-}
-.dhx_multi_day{
- border:none;
- border-top:1px solid #A4BED4;
-}
-.dhx_multi_day_icon, .dhx_multi_day_icon_small{
- border-right:none;
-}
-.dhx_cal_container {
- background-image:url(imgs_glossy/top-days-bg.png);
- background-position:0 24px;
- background-repeat:repeat-x;
- background-color:#EBEBEB;
-}
-.dhx_cal_navline{
- background-color:#EBEBEB;
- height:23px !important;
-}
-.dhx_cal_prev_button{
- background-image:url(imgs_glossy/buttons.gif);
- width:30px;
- height:20px;
-}
-.dhx_cal_next_button{
- background-image:url(imgs_glossy/buttons.gif);
- width:30px;
- height:20px;
-}
-.dhx_cal_today_button{
- padding-top:3px;
- background-image:url(imgs_glossy/buttons.gif);
- width:67px;
- left:110px;
- text-decoration:none;
-}
-.dhx_cal_navline .dhx_cal_date{
- padding-top:4px;
- left:230px;
-}
-.dhx_cal_tab{
- background-image:url(imgs_glossy/white_tab.png);
- width:60px;
- height:15px;
- text-decoration:none;
- padding-top:4px;
- margin-top: 4px;
-}
-.dhx_cal_tab.active{
- background-image:url(imgs_glossy/blue_tab.png);
- height:18px;
- width:60px;
- padding-top:4px;
- margin-top: 2px;
-}
-.dhx_cal_data{
- border-top: 1px solid #A4BED4;
-}
-.dhx_cal_header{
- background-image:url(imgs_glossy/top-days-bg.png);
- background-repeat:repeat-x;
- border-top: 0px;
- border-right: 0px;
-}
-.dhx_scale_bar{
- background-image:url(imgs_glossy/top-separator.gif);
- background-position: 0px 0px;
- background-repeat:no-repeat;
- background-color: transparent;
- padding-top:3px;
- border-left:0px;
-}
-
-.dhx_scale_holder {
- border-right:1px solid #A4BED4;
-}
-.dhx_scale_holder_now{
- border-right:1px solid #A4BED4;
-}
-.dhx_scale_hour{
- background-image:url(imgs_glossy/left-time-bg.png);
- border-bottom:1px solid #A4BED4;
- color:#2F3A48;
-}
-.dhx_multi_day{
- background-image:url(imgs_glossy/multi-days-bg.png);
- background-repeat:repeat;
- border-bottom:1px solid #A4BED4;
- border-left:0px;
-}
-.dhx_multi_day_icon,.dhx_multi_day_icon_small{
- background-image:url(imgs_glossy/multi-days-bg.png);
- border-bottom:1px solid #A4BED4;
- border-left:1px solid #ffffff;
- background-position:0 0;
- background-repeat:repeat;
-}
-.dhx_month_head{
- background-color:#FFFFFF;
-}
-.dhx_after .dhx_month_head,.dhx_before .dhx_month_head{
- background-color:#EFEDE2;
-}
-.dhx_now .dhx_month_head{
- background-color:#E4EFFF;
-}
-.dhx_after .dhx_month_body,.dhx_before .dhx_month_body{
- background-color:#EFEDE2;
-}
-.dhx_cal_event div{
- border:1px solid #FFBD51;
- background-color:#FFE4AB;
- color:#000000;
-}
-.dhx_cal_event_clear{
- color:#000000;
-}
-.dhx_cal_event_line{
- background-image:url(imgs_glossy/event-bg.png);
- border:1px solid #FFBD51;
- color:#000000;
-}
-.dhx_in_move{
- background-image:url(imgs_glossy/move.png);
-}
-.dhx_cal_event .dhx_body{
- background-color:#FFE4AB;
-}
-.dhx_cal_event .dhx_title{
- background-color:#FFE4AB;
-}
-.dhx_cal_light{
- -moz-box-shadow:5px 5px 5px #888888;
- -khtml-box-shadow: 5px 5px 5px #888;
- background-color:#EBEBEB;
- border:2px solid #A4BED4;
- color:#000000;
-}
-.dhx_cal_larea{
- border:1px solid #A4BED4;
- border-width:0 1px 1px;
- background-color:#FFFFFF;
-}
-
-.dhx_cal_lsection{
- background-image:url(imgs_glossy/lightbox.png);
- font-size:14px;
- padding:5px 0 5px 10px;
- color:#000000;
-}
-.dhx_cal_light_wide .dhx_cal_lsection{
- background-image:url(imgs_glossy/multi-days-bg.png);
-}
-
-
-.dhx_cal_ltext textarea{
- background-color:#ffffff;
- color:#000000;
-}
-
-.dhx_cal_light select, .dhx_cal_light input{
- color:#000000;
-}
-.dhx_save_btn{
- background-image:url(imgs_glossy/controlls5.png);
-}
-.dhx_cancel_btn{
- background-image:url(imgs_glossy/controlls5.png);
-}
-.dhx_delete_btn{
- background-image:url(imgs_glossy/controlls5.png);
-}
-div.dhx_menu_head{
- background-image:url(imgs_glossy/controlls5.png);
- border:1px solid #FFE4AB;
-}
-div.dhx_menu_icon{
- background-image:url(imgs_glossy/controlls5.png);
- border:medium none;
-}
-.dhx_section_time{
- height:20px !important;
- padding:7px 0 !important;
- text-align:center;
- background:white;
-}
-
-div.dhx_cal_editor{
- background-color:#FFE4AB;
-}
-.dhx_year_month{
- background-image:url(imgs_glossy/top-days-bg.png);
- border: 0px;
-}
-.dhx_year_week{
- background-image:url(imgs_glossy/top-days-bg.png);
-}
-.dhx_month_head{
- border-right:1px solid #A4BED4;
-}
-.dhx_month_body{
- border-right:1px solid #A4BED4;
- border-bottom:1px solid #A4BED4;
-}
-.dhx_year_body{
- border-left:1px solid #A4BED4;
-}
-.dhx_scale_bar_last{
- border-right: none;
-}
-.dhx_month_head.dhx_year_event{
- background-color:#FFE4AB;
-}
-.dhx_year_body .dhx_before .dhx_month_head, .dhx_year_body .dhx_after .dhx_month_head, .dhx_year_body .dhx_before .dhx_month_head a, .dhx_year_body .dhx_after .dhx_month_head a{
- color:#EFEDE2 !important;
-}
-.dhx_cal_lsection .dhx_readonly{
- color:#000000;
-}
-.dhx_tooltip{
- -moz-box-shadow:2px 2px 2px #888; /*Doesn't work in IE*/
- -khtml-box-shadow: 2px 2px 2px #888;
-}
-.dhx_custom_button {
- margin-top: -2px;
-}
-/*2.3*/
-.dhx_cal_lsection .dhx_fullday{
- color:#000000;
-}
-
-.dhx_cal_lsection.dhx_cal_checkbox{
- height:16px;
- line-height:18px;
-}
-.dhx_cal_light_wide .dhx_cal_lsection.dhx_cal_checkbox{
- height:20px;
-}
-.dhx_cal_checkbox label{
- vertical-align:top;
-}
-
-.dhx_cal_light_wide .dhx_cal_lsection{
- color:black;
-}
-
-.dhx_cal_light_wide .dhx_wrap_section{
- border-top:1px solid #A4BED4;
- background-image:url(imgs_glossy/multi-days-bg.png);
-}
-.dhx_cal_light_wide .dhx_cal_ltext{
- border-left:1px solid #A4BED4;
-}
-.dhx_cal_light_wide .dhx_cal_ltext {
- background-color:white;
-}
-.dhx_custom_button{
- background:white;
- color:black;
-}
-.dhx_form_repeat{
- background:white;
-}
-.dhx_repeat_divider{
- border-left:1px solid #A4BED4;
-}
-
-/* timeline second scale start */
-.dhx_cal_header.dhx_second_cal_header {
- background-image: url("imgs_glossy/second-top-days-bg.png");
- padding-right: 20px;
-}
-.dhx_scale_bar {
- padding-top: 4px;
-}
-.dhx_second_scale_bar {
- border-bottom: 0;
- padding-top: 4px;
-}
-
-/* timeline second scale end */
-.dhx_cal_light_wide .dhx_cal_lsection .dhx_fullday, .dhx_cal_lsection .dhx_fullday{
- color:#000000;
- font-size: 14px;
-}
-.dhx_cal_light_wide .dhx_cal_lsection {
- font-size: 14px;
- padding-right:10px;
-}
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ical.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ical.js deleted file mode 100644 index 60dbfef8626..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ical.js +++ /dev/null @@ -1,69 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.ical={
- parse:function(str){
- var data = str.match(RegExp(this.c_start+"[^\f]*"+this.c_end,""));
- if (!data.length) return;
-
- //unfolding
- data[0]=data[0].replace(/[\r\n]+(?=[a-z \t])/g," ");
- //drop property
- data[0]=data[0].replace(/\;[^:\r\n]*/g,"");
-
-
- var incoming=[];
- var match;
- var event_r = RegExp("(?:"+this.e_start+")([^\f]*?)(?:"+this.e_end+")","g");
- while (match=event_r.exec(data)){
- var e={};
- var param;
- var param_r = /[^\r\n]+[\r\n]+/g;
- while (param=param_r.exec(match[1]))
- this.parse_param(param.toString(),e);
- if (e.uid && !e.id) e.id = e.uid; //fallback to UID, when ID is not defined
- incoming.push(e);
- }
- return incoming;
- },
- parse_param:function(str,obj){
- var d = str.indexOf(":");
- if (d==-1) return;
-
- var name = str.substr(0,d).toLowerCase();
- var value = str.substr(d+1).replace(/\\\,/g,",").replace(/[\r\n]+$/,"");
- if (name=="summary")
- name="text";
- else if (name=="dtstart"){
- name = "start_date";
- value = this.parse_date(value,0,0);
- }
- else if (name=="dtend"){
- name = "end_date";
- if (obj.start_date && obj.start_date.getHours()==0)
- value = this.parse_date(value,24,00);
- else
- value = this.parse_date(value,23,59);
- }
- obj[name]=value;
- },
- parse_date:function(value,dh,dm){
- var t = value.split("T");
- if (t[1]){
- dh=t[1].substr(0,2);
- dm=t[1].substr(2,2);
- }
- var dy = t[0].substr(0,4);
- var dn = parseInt(t[0].substr(4,2),10)-1;
- var dd = t[0].substr(6,2);
- if (scheduler.config.server_utc && !t[1]) { // if no hours/minutes were specified == full day event
- return new Date(Date.UTC(dy,dn,dd,dh,dm)) ;
- }
- return new Date(dy,dn,dd,dh,dm);
- },
- c_start:"BEGIN:VCALENDAR",
- e_start:"BEGIN:VEVENT",
- e_end:"END:VEVENT",
- c_end:"END:VCALENDAR"
-};
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/layout.css b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/layout.css deleted file mode 100644 index a888f4d0c79..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/layout.css +++ /dev/null @@ -1,194 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -.dhx_cal_container{
- background-color:#C2D5FC;
- font-family:Tahoma;
- font-size:8pt;
- position:relative;
- overflow:hidden;
-}
-.dhx_cal_container div{
- -moz-user-select:none;
- -moz-user-select:-moz-none;
-}
-.dhx_cal_navline{
- height:20px;
- position:absolute;
- z-index:3;
- width:750px;
- color:#2F3A48;
-}
-.dhx_cal_navline div{
- position:absolute;
- top:2px;
- white-space:nowrap;
-}
-.dhx_cal_navline .dhx_cal_date{
- font-weight:600;
- left:210px;
-}
-.dhx_cal_button .dhx_left_bg{
- width:1px; overflow:hidden;
- height:17px;
- z-index:20;
- top:0px;
-}
-.dhx_cal_prev_button{
- background-image:url(imgs/buttons.png);
- background-position:0px 0px;
- width:29px; height:17px;
- left:50px; cursor:pointer;
-}
-.dhx_cal_next_button{
- background-image:url(imgs/buttons.png);
- background-position: -30px 0px;
- width:29px; height:17px;
- left:80px; cursor:pointer;
-}
-.dhx_cal_today_button{
- background-image:url(imgs/buttons.png);
- background-position: -60px 0px;
- width:75px; height:17px;
- left:112px; cursor:pointer;
- text-align:center;
- text-decoration:underline;
-}
-.dhx_cal_tab{
- width:59px; height:19px;
- text-align:center;
- text-decoration:underline;
- padding-top:2px;
- cursor:pointer;
- background-color: #D8E1EA;
-
- -webkit-border-top-left-radius: 4px;
- -webkit-border-top-right-radius: 4px;
- -moz-border-radius-topleft: 4px;
- -moz-border-radius-topright: 4px;
- border-top-left-radius: 4px;
- border-top-right-radius: 4px;
-}
-.dhx_cal_tab.active{
- text-decoration:none;
-
- cursor:default;
- font-weight:bold;
- border: 1px dotted #586A7E;
- border-bottom: 0;
- background-color: #C2D5FC;
-}
-.dhx_cal_header{
- position:absolute;
- left:10px; top:23px;
- width:750px;
- border-top:1px dotted #8894A3;
- border-right:1px dotted #8894A3;
- z-index:2;
- overflow:hidden;
- color:#2F3A48;
-}
-.dhx_cal_data{
- border-top:1px dotted #8894A3;
- position:absolute;
- top:44px;
- width:600px;
- overflow-y:auto;
- overflow-x:hidden;
-}
-.dhx_scale_bar{
- position:absolute;
- text-align:center;
- background-color:#C2D5FC;
- padding-top:3px;
- border-left:1px dotted #586A7E;
-}
-.dhx_scale_holder{
- position:absolute;
- border-right:1px dotted #586A7E;
- background-image:url(imgs/databg.png);
-}
-.dhx_scale_holder_now{
- position:absolute;
- border-right:1px dotted #586A7E;
- background-image:url(imgs/databg_now.png);
-}
-.dhx_scale_hour{
- height:41px;
- width:50px;
- border-bottom:1px dotted #8894A3;
- background-color:#C2D5FC;
- text-align:center;
- line-height:40px;
- color:#586A7E;
- overflow:hidden;
-}
-.dhx_month_head{
- background-color:#EBEFF4;
- color:#2F3A48;
- border-right:1px dotted #586A7E;
- height:18px;
- padding-right:5px;
- padding-top:3px;
- text-align:right;
-}
-.dhx_month_body{
- border-right:1px dotted #586A7E;
- border-bottom:1px dotted #586A7E;
- background-color:#FFFFFF;
-}
-.dhx_now .dhx_month_body{
- background-color:#E2EDFF;
-}
-.dhx_after .dhx_month_body, .dhx_before .dhx_month_body{
- background-color:#ECECEC;
-}
-.dhx_after .dhx_month_head, .dhx_before .dhx_month_head{
- background-color:#E2E3E6;
- color:#94A6BB;
-}
-.dhx_now .dhx_month_head{
- background-color:#D1DEF4;
- font-weight:bold;
-}
-.dhx_cal_drag{
- position:absolute;
- z-index:9999;
- background-color:#FFE763;
- border:1px solid #B7A543;
- opacity:0.5;
- filter:alpha(opacity=50);
-}
-.dhx_loading{
- position:absolute;
- width:128px;
- height:15px;
- background-image:url(imgs/loading.gif);
- z-index:9999;
-}
-.dhx_multi_day_icon, .dhx_multi_day{
- background-color:#E1E6FF;
- background-repeat:no-repeat;
- border-right:1px dotted #8894A3;
-}
-.dhx_multi_day{
- position: absolute;
- border-top:1px dotted #8894A3;
-}
-.dhx_multi_day_icon{
- background-image:url(imgs/clock_big.gif);
-}
-.dhx_multi_day_icon_small{
- background-image:url(imgs/clock_small.gif);
-}
-.dhx_multi_day_icon, .dhx_multi_day_icon_small{
- background-position: center center;
- background-color:#E1E6FF;
- background-repeat:no-repeat;
- border-bottom:1px dotted #8894A3;
- border-right:1px dotted #8894A3;
-}
-.dhtmlxLayoutPolyContainer_dhx_skyblue .dhx_cal_container {
- background-color: #d0e5ff;
-}
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/lightbox.css b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/lightbox.css deleted file mode 100644 index afb83295be3..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/lightbox.css +++ /dev/null @@ -1,239 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -.dhx_unselectable, .dhx_unselectable div{
- -webkit-user-select:none;
- -moz-user-select:none;
- -moz-user-select:-moz-none;
-}
-.dhx_cal_light{
- background-color:#FFE763;
- border-radius:5px;
- font-family:Tahoma;
- font-size:8pt;
- border:1px solid #B7A64B;
- color:#887A2E;
-
- position:absolute;
- z-index:10001;
-
- width:580px;
- height:300px;
-
- box-shadow:5px 5px 5px #888;
-}
-.dhx_cal_light_wide{
- width:650px;
-}
-.dhx_mark{
- position:relative; top:3px;
- background-image:url('./imgs/controls.gif');
- background-position: 0px -43px;
- padding-left:10px;
-}
-.dhx_ie6 .dhx_mark{
- background-position: 6px -41px;
-}
-
-.dhx_cal_light select{
- font-family:Tahoma;
- font-size:8pt;
- color:#887A2E;
- padding:2px;
- margin:0px;
-}
-.dhx_cal_ltitle{
- padding:2px 0px 2px 5px;
- overflow:hidden;
- white-space:nowrap;
-}
-.dhx_cal_ltitle span{
- white-space:nowrap;
-}
-.dhx_cal_lsection{
- background-color:#DBCF8C;
- color:#FFF4B5;
- font-weight:bold;
- padding:5px 0px 3px 10px;
-}
-.dhx_section_time{
- background-color:#DBCF8C;
-}
-.dhx_cal_lsection .dhx_fullday{
- float:right;
- margin-right:5px;
- color:#887A2E;
- font-size:12px;
- font-weight:normal;
- line-height:20px;
- vertical-align:top;
- cursor:pointer;
-}
-.dhx_cal_lsection{
- font-size:18px;
- font-family:Arial;
-}
-.dhx_cal_ltext{
- padding:2px 0px 2px 10px;
- overflow:hidden;
-}
-.dhx_cal_ltext textarea{
- background-color: #FFF4B5; /* #FFF4B5; should be the same for dhx_cal_larea, was transperent */
- overflow:auto;
- border:none;
- color:#887A2E;
- height:100%;
- width:100%;
- outline:none !important;
-}
-.dhx_time{
- font-weight:bold;
-}
-.dhx_cal_light .dhx_title{
- padding-left:10px;
-}
-.dhx_cal_larea{
- border:1px solid #DCC43E;
- background-color:#FFF4B5;
- overflow:hidden;
-
- margin-left:3px;
-
- width:572px;
- height:1px;
-}
-.dhx_btn_set{
- padding:5px 10px 0px 10px;
- float:left;
-}
-.dhx_btn_set div{
- float:left;
- height:21px;
- line-height:21px;
- vertical-align:middle;
- cursor:pointer;
-}
-.dhx_save_btn{
- background-image:url('./imgs/controls.gif');
- background-position:-84px 0px;
- width:21px;
-
-}
-.dhx_cancel_btn{
- background-image:url('./imgs/controls.gif');
- background-position:-63px 0px;
- width:20px;
-}
-.dhx_delete_btn{
- background-image:url('./imgs/controls.gif');
- background-position:-42px 0px;
- width:20px;
-}
-.dhx_cal_cover{
- width:100%;
- height:100%;
- position:absolute;
- z-index:10000;
- top:0px;
- left:0px;
- background-color:black;
-
- opacity:0.1;
- filter:alpha(opacity=10);
-}
-.dhx_custom_button{
- padding:0px 3px 0px 3px;
- color:#887A2E;
- font-family:Tahoma;
- font-size:8pt;
- background-color:#FFE763;
- font-weight:normal;
- margin-right:5px;
- margin-top:0px;
- cursor:pointer;
-}
-.dhx_custom_button div{
- cursor:pointer;
- float:left;
- height:21px;
- line-height:21px;
- vertical-align:middle;
-}
-
-
-.dhx_cal_light_wide .dhx_cal_larea{
- border-top-width:0px;
-}
-.dhx_cal_light_wide .dhx_cal_lsection{
- border:0px;
- float:left;
- text-align:right;
- width:100px;
- height:20px;
- font-size:16px;
- padding: 5px 0px 0px 10px;
-}
-.dhx_cal_light_wide .dhx_wrap_section{
- border-top:1px solid #DBCF8C;
- position:relative;
- background-color:#DBCF8C;
- overflow:hidden;
-}
-.dhx_cal_light_wide .dhx_section_time{
- padding-top:2px !important;
- height:20px !important;
-}
-.dhx_section_time{
- text-align: center;
-}
-.dhx_cal_light_wide .dhx_cal_larea{
- width:730px;
-}
-.dhx_cal_light_wide{
- width:738px;
-}
-
-.dhx_cal_light_wide .dhx_section_time{
- background:transparent;
-}
-.dhx_cal_light_wide .dhx_cal_checkbox label{
- padding-left:0px;
-}
-.dhx_cal_wide_checkbox input{
- margin-top:8px;
- margin-left:14px;
-}
-.dhx_cal_light input{
- font-family:Tahoma;
- font-size:8pt;
- color:#887A2E;
-}
-.dhx_cal_light_wide .dhx_cal_lsection .dhx_fullday{
- float:none;
- margin-right:0px;
- color:#FFF4B5;
- font-weight:bold;
- font-size:16px;
- font-family:Arial;
- cursor:pointer;
-}
-.dhx_custom_button{
- float: right;
- height: 21px;
- width:90px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- -ms-border-radius: 4px;
- -o-border-radius: 4px;
- border-radius: 4px;
-}
-.dhx_cal_light_wide .dhx_custom_button {
- position:absolute;
- top:0;
- right:0;
- margin-top: 2px;
-}
-.dhx_cal_light_wide .dhx_repeat_right {
- margin-right: 55px;
-}
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/lightbox.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/lightbox.js deleted file mode 100644 index 7749ff6708c..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/lightbox.js +++ /dev/null @@ -1,466 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.formSection = function(name){
- var config = this.config.lightbox.sections;
- var i =0;
- for (i; i < config.length; i++)
- if (config[i].name == name)
- break;
- var section = config[i];
- var node = document.getElementById(section.id).nextSibling;
-
- return {
- getValue:function(ev){
- return scheduler.form_blocks[section.type].get_value(node, (ev||{}), section);
- },
- setValue:function(value, ev){
- return scheduler.form_blocks[section.type].set_value(node, value, (ev||{}), section);
- }
- };
-};
-scheduler.form_blocks={
- template:{
- render: function(sns){
- var height=(sns.height||"30")+"px";
- return "<div class='dhx_cal_ltext dhx_cal_template' style='height:"+height+";'></div>";
- },
- set_value:function(node,value,ev,config){
- node.innerHTML = value||"";
- },
- get_value:function(node,ev,config){
- return node.innerHTML||"";
- },
- focus: function(node){
- }
- },
- textarea:{
- render:function(sns){
- var height=(sns.height||"130")+"px";
- return "<div class='dhx_cal_ltext' style='height:"+height+";'><textarea></textarea></div>";
- },
- set_value:function(node,value,ev){
- node.firstChild.value=value||"";
- },
- get_value:function(node,ev){
- return node.firstChild.value;
- },
- focus:function(node){
- var a=node.firstChild; a.select(); a.focus();
- }
- },
- select:{
- render:function(sns){
- var height=(sns.height||"23")+"px";
- var html="<div class='dhx_cal_ltext' style='height:"+height+";'><select style='width:100%;'>";
- for (var i=0; i < sns.options.length; i++)
- html+="<option value='"+sns.options[i].key+"'>"+sns.options[i].label+"</option>";
- html+="</select></div>";
- return html;
- },
- set_value:function(node,value,ev){
- if (typeof value == "undefined")
- value = (node.firstChild.options[0]||{}).value;
- node.firstChild.value=value||"";
- },
- get_value:function(node,ev){
- return node.firstChild.value;
- },
- focus:function(node){
- var a=node.firstChild; if (a.select) a.select(); a.focus();
- }
- },
- time:{
- render:function(){
- //hours
- var cfg = scheduler.config;
- var dt = this.date.date_part(new Date());
- var last = 24*60, first = 0;
- if(scheduler.config.limit_time_select){
- last = 60*cfg.last_hour+1;
- first = 60*cfg.first_hour;
- dt.setHours(cfg.first_hour);
- }
-
- var html="<select>";
- var i = first;
- var tdate = dt.getDate();
-
- while(i<last){
- var time=this.templates.time_picker(dt);
- html+="<option value='"+i+"'>"+time+"</option>";
-
- dt.setTime(dt.valueOf()+this.config.time_step*60*1000);
- var diff = (dt.getDate()!=tdate)?1:0; // moved or not to the next day
- i=diff*24*60+dt.getHours()*60+dt.getMinutes();
- }
-
- //days
- html+="</select> <select>";
- for (var i=1; i < 32; i++)
- html+="<option value='"+i+"'>"+i+"</option>";
-
- //month
- html+="</select> <select>";
- for (var i=0; i < 12; i++)
- html+="<option value='"+i+"'>"+this.locale.date.month_full[i]+"</option>";
-
- //year
- html+="</select> <select>";
- dt = dt.getFullYear()-5; //maybe take from config?
- for (var i=0; i < 10; i++)
- html+="<option value='"+(dt+i)+"'>"+(dt+i)+"</option>";
- html+="</select> ";
-
- return "<div style='height:30px;padding-top:0px;font-size:inherit;' class='dhx_section_time'>"+html+"<span style='font-weight:normal; font-size:10pt;'> – </span>"+html+"</div>";
-
- },
- set_value:function(node,value,ev){
-
-
- var s=node.getElementsByTagName("select");
-
- if(scheduler.config.full_day) {
- if (!node._full_day){
- var html = "<label class='dhx_fullday'><input type='checkbox' name='full_day' value='true'> "+scheduler.locale.labels.full_day+" </label></input>";
- if (!scheduler.config.wide_form)
- html = node.previousSibling.innerHTML+html;
- node.previousSibling.innerHTML=html;
- node._full_day=true;
- }
- var input=node.previousSibling.getElementsByTagName("input")[0];
- var isFulldayEvent = (scheduler.date.time_part(ev.start_date)===0 && scheduler.date.time_part(ev.end_date)===0 && ev.end_date.valueOf()-ev.start_date.valueOf() < 2*24*60*60*1000);
- input.checked = isFulldayEvent;
-
- for(var k in s)
- s[k].disabled=input.checked;
-
- input.onclick = function(){
- if(input.checked) {
- var start_date = new Date(ev.start_date);
- var end_date = new Date(ev.end_date);
-
- scheduler.date.date_part(start_date);
- end_date = scheduler.date.add(start_date, 1, "day");
- }
- for(var i in s)
- s[i].disabled=input.checked;
-
- _fill_lightbox_select(s,0,start_date||ev.start_date);
- _fill_lightbox_select(s,4,end_date||ev.end_date);
- };
- }
-
- if(scheduler.config.auto_end_date && scheduler.config.event_duration) {
- function _update_lightbox_select() {
- ev.start_date=new Date(s[3].value,s[2].value,s[1].value,0,s[0].value);
- ev.end_date.setTime(ev.start_date.getTime() + (scheduler.config.event_duration * 60 * 1000));
- _fill_lightbox_select(s,4,ev.end_date);
- }
- for(var i=0; i<4; i++) {
- s[i].onchange = _update_lightbox_select;
- }
- }
-
- function _fill_lightbox_select(s,i,d){
- s[i+0].value=Math.round((d.getHours()*60+d.getMinutes())/scheduler.config.time_step)*scheduler.config.time_step;
- s[i+1].value=d.getDate();
- s[i+2].value=d.getMonth();
- s[i+3].value=d.getFullYear();
- }
-
- _fill_lightbox_select(s,0,ev.start_date);
- _fill_lightbox_select(s,4,ev.end_date);
- },
- get_value:function(node,ev){
- s=node.getElementsByTagName("select");
- ev.start_date=new Date(s[3].value,s[2].value,s[1].value,0,s[0].value);
- ev.end_date=new Date(s[7].value,s[6].value,s[5].value,0,s[4].value);
- if (ev.end_date<=ev.start_date)
- ev.end_date=scheduler.date.add(ev.start_date,scheduler.config.time_step,"minute");
- },
- focus:function(node){
- node.getElementsByTagName("select")[0].focus();
- }
- }
-};
-scheduler.showCover=function(box){
- if (box){
- box.style.display="block";
-
- var scroll_top = window.pageYOffset||document.body.scrollTop||document.documentElement.scrollTop;
- var scroll_left = window.pageXOffset||document.body.scrollLeft||document.documentElement.scrollLeft;
-
- var view_height = window.innerHeight||document.documentElement.clientHeight;
-
- if(scroll_top) // if vertical scroll on window
- box.style.top=Math.round(scroll_top+Math.max((view_height-box.offsetHeight)/2, 0))+"px";
- else // vertical scroll on body
- box.style.top=Math.round(Math.max(((view_height-box.offsetHeight)/2), 0) + 9)+"px"; // +9 for compatibility with auto tests
-
- // not quite accurate but used for compatibility reasons
- if(document.documentElement.scrollWidth > document.body.offsetWidth) // if horizontal scroll on the window
- box.style.left=Math.round(scroll_left+(document.body.offsetWidth-box.offsetWidth)/2)+"px";
- else // horizontal scroll on the body
- box.style.left=Math.round((document.body.offsetWidth-box.offsetWidth)/2)+"px";
- }
- this.show_cover();
-};
-scheduler.showLightbox=function(id){
- if (!id) return;
- if (!this.callEvent("onBeforeLightbox",[id])) return;
- var box = this._get_lightbox();
- this.showCover(box);
- this._fill_lightbox(id,box);
- this.callEvent("onLightbox",[id]);
-};
-scheduler._fill_lightbox=function(id,box){
- var ev=this.getEvent(id);
- var s=box.getElementsByTagName("span");
- if (scheduler.templates.lightbox_header){
- s[1].innerHTML="";
- s[2].innerHTML=scheduler.templates.lightbox_header(ev.start_date,ev.end_date,ev);
- } else {
- s[1].innerHTML=this.templates.event_header(ev.start_date,ev.end_date,ev);
- s[2].innerHTML=(this.templates.event_bar_text(ev.start_date,ev.end_date,ev)||"").substr(0,70); //IE6 fix
- }
-
-
- var sns = this.config.lightbox.sections;
- for (var i=0; i < sns.length; i++) {
- var node=document.getElementById(sns[i].id).nextSibling;
- var block=this.form_blocks[sns[i].type];
- block.set_value.call(this,node,ev[sns[i].map_to],ev, sns[i]);
- if (sns[i].focus)
- block.focus.call(this,node);
- }
-
- scheduler._lightbox_id=id;
-};
-scheduler._lightbox_out=function(ev){
- var sns = this.config.lightbox.sections;
- for (var i=0; i < sns.length; i++) {
- var node = document.getElementById(sns[i].id);
- node=(node?node.nextSibling:node);
- var block=this.form_blocks[sns[i].type];
- var res=block.get_value.call(this,node,ev, sns[i]);
- if (sns[i].map_to!="auto")
- ev[sns[i].map_to]=res;
- }
- return ev;
-};
-scheduler._empty_lightbox=function(){
- var id=scheduler._lightbox_id;
- var ev=this.getEvent(id);
- var box=this._get_lightbox();
-
- this._lightbox_out(ev);
-
- ev._timed=this.is_one_day_event(ev);
- this.setEvent(ev.id,ev);
- this._edit_stop_event(ev,true);
- this.render_view_data();
-};
-scheduler.hide_lightbox=function(id){
- this.hideCover(this._get_lightbox());
- this._lightbox_id=null;
- this.callEvent("onAfterLightbox",[]);
-};
-scheduler.hideCover=function(box){
- if (box) box.style.display="none";
- this.hide_cover();
-};
-scheduler.hide_cover=function(){
- if (this._cover)
- this._cover.parentNode.removeChild(this._cover);
- this._cover=null;
-};
-scheduler.show_cover=function(){
- this._cover=document.createElement("DIV");
- this._cover.className="dhx_cal_cover";
- var _document_height = ((document.height !== undefined) ? document.height : document.body.offsetHeight);
- var _scroll_height = ((document.documentElement) ? document.documentElement.scrollHeight : 0);
- this._cover.style.height = Math.max(_document_height, _scroll_height) + 'px';
- document.body.appendChild(this._cover);
-};
-scheduler.save_lightbox=function(){
- if (this.checkEvent("onEventSave") && !this.callEvent("onEventSave",[this._lightbox_id,this._lightbox_out({ id: this._lightbox_id}), this._new_event]))
- return;
- this._empty_lightbox();
- this.hide_lightbox();
-};
-scheduler.startLightbox = function(id, box){
- this._lightbox_id=id;
- this.showCover(box);
-};
-scheduler.endLightbox = function(mode, box){
- this._edit_stop_event(scheduler.getEvent(this._lightbox_id),mode);
- if (mode)
- scheduler.render_view_data();
- this.hideCover(box);
-};
-scheduler.resetLightbox = function(){
- if (scheduler._lightbox)
- scheduler._lightbox.parentNode.removeChild(scheduler._lightbox);
- scheduler._lightbox = null;
-};
-scheduler.cancel_lightbox=function(){
- this.callEvent("onEventCancel",[this._lightbox_id, this._new_event]);
- this.endLightbox(false);
- this.hide_lightbox();
-};
-scheduler._init_lightbox_events=function(){
- this._get_lightbox().onclick=function(e){
- var src=e?e.target:event.srcElement;
- if (!src.className) src=src.previousSibling;
- if (src && src.className)
- switch(src.className){
- case "dhx_save_btn":
- scheduler.save_lightbox();
- break;
- case "dhx_delete_btn":
- var c=scheduler.locale.labels.confirm_deleting;
- if (!c||confirm(c)) {
- scheduler.deleteEvent(scheduler._lightbox_id);
- scheduler._new_event = null; //clear flag, if it was unsaved event
- scheduler.hide_lightbox();
- }
- break;
- case "dhx_cancel_btn":
- scheduler.cancel_lightbox();
- break;
-
- default:
- if (src.getAttribute("dhx_button")){
- scheduler.callEvent("onLightboxButton", [src.className, src, e]);
- } else if (src.className.indexOf("dhx_custom_button_")!=-1){
- var index = src.parentNode.getAttribute("index");
- var block=scheduler.form_blocks[scheduler.config.lightbox.sections[index].type];
- var sec = src.parentNode.parentNode;
- block.button_click(index,src,sec,sec.nextSibling);
- }
- break;
- }
- };
- this._get_lightbox().onkeydown=function(e){
- switch((e||event).keyCode){
- case scheduler.keys.edit_save:
- if ((e||event).shiftKey) return;
- scheduler.save_lightbox();
- break;
- case scheduler.keys.edit_cancel:
- scheduler.cancel_lightbox();
- break;
- default:
- break;
- }
- };
-};
-scheduler.setLightboxSize=function(){
- var d = this._lightbox;
- if (!d) return;
-
- var con = d.childNodes[1];
- con.style.height="0px";
- con.style.height=con.scrollHeight+"px";
- d.style.height=con.scrollHeight+50+"px";
- con.style.height=con.scrollHeight+"px"; //it is incredible , how ugly IE can be
-};
-
-scheduler._init_dnd_events = function(){
- dhtmlxEvent(document.body, "mousemove", scheduler._move_while_dnd);
- dhtmlxEvent(document.body, "mouseup", scheduler._finish_dnd);
- scheduler._init_dnd_events = function(){};
-};
-scheduler._move_while_dnd = function(e){
- if (scheduler._dnd_start_lb){
- if (!document.dhx_unselectable){
- document.body.className += " dhx_unselectable";
- document.dhx_unselectable = true;
- }
- var lb = scheduler._get_lightbox();
- var now = (e&&e.target)?[e.pageX, e.pageY]:[event.clientX, event.clientY];
- lb.style.top = scheduler._lb_start[1]+now[1]-scheduler._dnd_start_lb[1]+"px";
- lb.style.left = scheduler._lb_start[0]+now[0]-scheduler._dnd_start_lb[0]+"px";
- }
-};
-scheduler._ready_to_dnd = function(e){
- var lb = scheduler._get_lightbox();
- scheduler._lb_start = [parseInt(lb.style.left,10), parseInt(lb.style.top,10)];
- scheduler._dnd_start_lb = (e&&e.target)?[e.pageX, e.pageY]:[event.clientX, event.clientY];
-};
-scheduler._finish_dnd = function(){
- if (scheduler._lb_start){
- scheduler._lb_start = scheduler._dnd_start_lb = false;
- document.body.className = document.body.className.replace(" dhx_unselectable","");
- document.dhx_unselectable = false;
- }
-};
-scheduler._get_lightbox=function(){ //scheduler.config.wide_form=true;
- if (!this._lightbox){
- var d=document.createElement("DIV");
- d.className="dhx_cal_light";
- if (scheduler.config.wide_form)
- d.className+=" dhx_cal_light_wide";
- if (scheduler.form_blocks.recurring)
- d.className+=" dhx_cal_light_rec";
-
- if (/msie|MSIE 6/.test(navigator.userAgent))
- d.className+=" dhx_ie6";
- d.style.visibility="hidden";
- var html = this._lightbox_template
- var buttons = this.config.buttons_left;
- scheduler.locale.labels["dhx_save_btn"] = scheduler.locale.labels.icon_save;
- scheduler.locale.labels["dhx_cancel_btn"] = scheduler.locale.labels.icon_cancel;
- scheduler.locale.labels["dhx_delete_btn"] = scheduler.locale.labels.icon_delete;
- for (var i = 0; i < buttons.length; i++)
- html+="<div class='dhx_btn_set'><div dhx_button='1' class='"+buttons[i]+"'></div><div>"+scheduler.locale.labels[buttons[i]]+"</div></div>";
- buttons = this.config.buttons_right;
- for (var i = 0; i < buttons.length; i++)
- html+="<div class='dhx_btn_set' style='float:right;'><div dhx_button='1' class='"+buttons[i]+"'></div><div>"+scheduler.locale.labels[buttons[i]]+"</div></div>";
-
- html+="</div>";
- d.innerHTML=html;
- if (scheduler.config.drag_lightbox){
- d.firstChild.onmousedown = scheduler._ready_to_dnd;
- d.firstChild.onselectstart = function(){ return false; };
- d.firstChild.style.cursor = "pointer";
- scheduler._init_dnd_events();
-
- }
- document.body.insertBefore(d,document.body.firstChild);
- this._lightbox=d;
-
- var sns=this.config.lightbox.sections;
- html="";
- for (var i=0; i < sns.length; i++) {
- var block=this.form_blocks[sns[i].type];
- if (!block) continue; //ignore incorrect blocks
- sns[i].id="area_"+this.uid();
- var button = "";
- if (sns[i].button){
- button = "<div class='dhx_custom_button' index='"+i+"'><div class='dhx_custom_button_"+sns[i].button+"'></div><div>"+this.locale.labels["button_"+sns[i].button]+"</div></div>";
- }
-
- if (this.config.wide_form){
- html+="<div class='dhx_wrap_section'>";
- }
- html+="<div id='"+sns[i].id+"' class='dhx_cal_lsection'>"+button+this.locale.labels["section_"+sns[i].name]+"</div>"+block.render.call(this,sns[i]);
- html+="</div>"
- }
-
- //localization
- var ds=d.getElementsByTagName("div");
- //sections
- ds[1].innerHTML=html;
- //sizes
- this.setLightboxSize();
-
- this._init_lightbox_events(this);
- d.style.display="none";
- d.style.visibility="visible";
- }
- return this._lightbox;
-};
-scheduler._lightbox_template="<div class='dhx_cal_ltitle'><span class='dhx_mark'> </span><span class='dhx_time'></span><span class='dhx_title'></span></div><div class='dhx_cal_larea'></div>";
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/load.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/load.js deleted file mode 100644 index 6d1579862ff..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/load.js +++ /dev/null @@ -1,202 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler._loaded={};
-scheduler._load=function(url,from){
- url=url||this._load_url;
- url+=(url.indexOf("?")==-1?"?":"&")+"timeshift="+(new Date()).getTimezoneOffset();
- if (this.config.prevent_cache) url+="&uid="+this.uid();
- var to;
- from=from||this._date;
-
- if (this._load_mode){
- var lf = this.templates.load_format;
-
- from = this.date[this._load_mode+"_start"](new Date(from.valueOf()));
- while (from>this._min_date) from=this.date.add(from,-1,this._load_mode);
- to = from;
-
- var cache_line = true;
- while (to<this._max_date){
- to=this.date.add(to,1,this._load_mode);
- if (this._loaded[lf(from)] && cache_line)
- from=this.date.add(from,1,this._load_mode);
- else cache_line = false;
- }
-
- var temp_to=to;
- do {
- to = temp_to;
- temp_to=this.date.add(to,-1,this._load_mode);
- } while (temp_to>from && this._loaded[lf(temp_to)]);
-
- if (to<=from)
- return false; //already loaded
- dhtmlxAjax.get(url+"&from="+lf(from)+"&to="+lf(to),function(l){scheduler.on_load(l);});
- while(from<to){
- this._loaded[lf(from)]=true;
- from=this.date.add(from,1,this._load_mode);
- }
- } else
- dhtmlxAjax.get(url,function(l){scheduler.on_load(l);});
- this.callEvent("onXLS",[]);
- return true;
-};
-scheduler.on_load=function(loader){
- this._loading=true;
- var evs;
- if (this._process)
- evs=this[this._process].parse(loader.xmlDoc.responseText);
- else
- evs=this._magic_parser(loader);
-
- this._not_render=true;
- for (var i=0; i<evs.length; i++){
- if (!this.callEvent("onEventLoading",[evs[i]])) continue;
- this.addEvent(evs[i]);
- }
- this._not_render=false;
- if (this._render_wait) this.render_view_data();
-
- this._loading=false;
- if (this._after_call) this._after_call();
- this._after_call=null;
-
- this.callEvent("onXLE",[]);
-};
-scheduler.json={};
-scheduler.json.parse = function(data){
- if (typeof data == "string"){
- eval("scheduler._temp = "+data+";");
- data = scheduler._temp;
- }
- var evs = [];
- for (var i=0; i < data.length; i++){
- data[i].start_date = scheduler.templates.xml_date(data[i].start_date);
- data[i].end_date = scheduler.templates.xml_date(data[i].end_date);
- evs.push(data[i]);
- }
- return evs;
-};
-scheduler.parse=function(data,type){
- this._process=type;
- this.on_load({xmlDoc:{responseText:data}});
-};
-scheduler.load=function(url,call){
- if (typeof call == "string"){
- this._process=call;
- call = arguments[2];
- }
-
- this._load_url=url;
- this._after_call=call;
- this._load(url,this._date);
-};
-//possible values - day,week,month,year,all
-scheduler.setLoadMode=function(mode){
- if (mode=="all") mode="";
- this._load_mode=mode;
-};
-
-//current view by default, or all data if "true" as parameter provided
-scheduler.refresh=function(refresh_all){
- alert("not implemented");
- /*
- this._loaded={};
- this._load();
- */
-};
-scheduler.serverList=function(name, array){
- if(array) {
- return this.serverList[name] = array.slice(0);
- }
- return this.serverList[name] = (this.serverList[name]||[]);
-};
-scheduler._userdata={};
-scheduler._magic_parser=function(loader){
- var xml;
- if (!loader.getXMLTopNode){ //from a string
- var xml_string = loader.xmlDoc.responseText;
- loader = new dtmlXMLLoaderObject(function(){});
- loader.loadXMLString(xml_string);
- }
-
- xml=loader.getXMLTopNode("data");
- if (xml.tagName!="data") return [];//not an xml
-
- var opts = loader.doXPath("//coll_options");
- for (var i=0; i < opts.length; i++) {
- var bind = opts[i].getAttribute("for");
- var arr = this.serverList[bind];
- if (!arr) continue;
- arr.splice(0,arr.length); //clear old options
- var itms = loader.doXPath(".//item",opts[i]);
- for (var j=0; j < itms.length; j++) {
- var itm = itms[j];
- var attrs = itm.attributes;
- var obj = { key:itms[j].getAttribute("value"), label:itms[j].getAttribute("label")};
- for (var k = 0; k < attrs.length; k++) {
- var attr = attrs[k];
- if(attr.nodeName == "value" || attr.nodeName == "label")
- continue;
- obj[attr.nodeName] = attr.nodeValue;
- }
- arr.push(obj);
- }
- }
- if (opts.length)
- scheduler.callEvent("onOptionsLoad",[]);
-
- var ud=loader.doXPath("//userdata");
- for (var i=0; i < ud.length; i++) {
- var udx = this.xmlNodeToJSON(ud[i]);
- this._userdata[udx.name]=udx.text;
- }
-
- var evs=[];
- xml=loader.doXPath("//event");
-
-
- for (var i=0; i < xml.length; i++) {
- evs[i]=this.xmlNodeToJSON(xml[i]);
-
- evs[i].text=evs[i].text||evs[i]._tagvalue;
- evs[i].start_date=this.templates.xml_date(evs[i].start_date);
- evs[i].end_date=this.templates.xml_date(evs[i].end_date);
- }
- return evs;
-};
-scheduler.xmlNodeToJSON = function(node){
- var t={};
- for (var i=0; i<node.attributes.length; i++)
- t[node.attributes[i].name]=node.attributes[i].value;
-
- for (var i=0; i<node.childNodes.length; i++){
- var child=node.childNodes[i];
- if (child.nodeType==1)
- t[child.tagName]=child.firstChild?child.firstChild.nodeValue:"";
- }
-
- if (!t.text) t.text=node.firstChild?node.firstChild.nodeValue:"";
-
- return t;
-};
-scheduler.attachEvent("onXLS",function(){
- if (this.config.show_loading===true){
- var t;
- t=this.config.show_loading=document.createElement("DIV");
- t.className='dhx_loading';
- t.style.left = Math.round((this._x-128)/2)+"px";
- t.style.top = Math.round((this._y-15)/2)+"px";
- this._obj.appendChild(t);
- }
-});
-scheduler.attachEvent("onXLE",function(){
- var t;
- if (t=this.config.show_loading)
- if (typeof t == "object"){
- this._obj.removeChild(t);
- this.config.show_loading=true;
- }
-});
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale.js deleted file mode 100644 index dc9298713c3..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale.js +++ /dev/null @@ -1,47 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.locale={
- date:{
- month_full:["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
- month_short:["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
- day_full:["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
- day_short:["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
- },
- labels:{
- dhx_cal_today_button:"Today",
- day_tab:"Day",
- week_tab:"Week",
- month_tab:"Month",
- new_event:"New event",
- icon_save:"Save",
- icon_cancel:"Cancel",
- icon_details:"Details",
- icon_edit:"Edit",
- icon_delete:"Delete",
- confirm_closing:"",//Your changes will be lost, are your sure ?
- confirm_deleting:"Event will be deleted permanently, are you sure?",
- section_description:"Description",
- section_time:"Time period",
- full_day:"Full day",
-
- /*recurring events*/
- confirm_recurring:"Do you want to edit the whole set of repeated events?",
- section_recurring:"Repeat event",
- button_recurring:"Disabled",
- button_recurring_open:"Enabled",
-
- /*agenda view extension*/
- agenda_tab:"Agenda",
- date:"Date",
- description:"Description",
-
- /*year view extension*/
- year_tab:"Year",
-
- /* week agenda extension */
- week_agenda_tab: "Agenda"
- }
-};
-
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_ar.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_ar.js deleted file mode 100644 index 396479bbf40..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_ar.js +++ /dev/null @@ -1,42 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -//v.2.0 build 90722
-/*
-Copyright DHTMLX LTD. http://www.dhtmlx.com
-You allowed to use this component or parts of it under GPL terms
-To use it on other terms or get Professional edition of the component please contact us at sales@dhtmlx.com
-*/
-scheduler.locale={
- date:{
- month_full:["كانون الثاني", "شباط", "آذار", "نيسان", "أيار", "حزيران", "تموز", "آب", "أيلول", "تشرين الأول", "تشرين الثاني", "كانون الأول"],
- month_short:["يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"],
- day_full:["الأحد", "الأثنين", "ألثلاثاء", "الأربعاء", "ألحميس", "ألجمعة", "السبت"],
- day_short:["احد", "اثنين", "ثلاثاء", "اربعاء", "خميس", "جمعة", "سبت"]
- },
- labels:{
- dhx_cal_today_button:"اليوم",
- day_tab:"يوم",
- week_tab:"أسبوع",
- month_tab:"شهر",
- new_event:"حدث جديد",
- icon_save:"اخزن",
- icon_cancel:"الغاء",
- icon_details:"تفاصيل",
- icon_edit:"تحرير",
- icon_delete:"حذف",
- confirm_closing:"التغييرات سوف تضيع, هل انت متأكد؟",//Your changes will be lost, are your sure ?
- confirm_deleting:"الحدث سيتم حذفها نهائيا ، هل أنت متأكد؟",
- section_description:"الوصف",
- section_time:"الفترة الزمنية",
- full_day:"طوال اليوم",
-
- confirm_recurring:"هل تريد تحرير مجموعة كاملة من الأحداث المتكررة؟",
- section_recurring:"تكرار الحدث",
- button_recurring:"تعطيل",
- button_recurring_open:"تمكين"
- }
-}
-
-
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_ca.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_ca.js deleted file mode 100644 index 7d997fe3081..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_ca.js +++ /dev/null @@ -1,48 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -/*
- @Traducido por Vicente Adria Bohigues - vicenteadria@hotmail.com
-*/
-scheduler.locale={
- date:{
- month_full:["Gener", "Febrer", "Març", "Abril", "Maig", "Juny", "Juliol", "Agost", "Setembre", "Octubre", "Novembre", "Desembre"],
- month_short:["Gen", "Feb", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Oct", "Nov", "Des"],
- day_full:["Diumenge", "Dilluns", "Dimarts", "Dimecres", "Dijous", "Divendres", "Dissabte"],
- day_short:["Dg", "Dl", "Dm", "Dc", "Dj", "Dv", "Ds"]
- },
- labels:{
- dhx_cal_today_button:"Hui",
- day_tab:"Dia",
- week_tab:"Setmana",
- month_tab:"Mes",
- new_event:"Nou esdeveniment",
- icon_save:"Guardar",
- icon_cancel:"Cancel·lar",
- icon_details:"Detalls",
- icon_edit:"Editar",
- icon_delete:"Esborrar",
- confirm_closing:"", //"Els seus canvis es perdràn, continuar ?"
- confirm_deleting:"L'esdeveniment s'esborrarà definitivament, continuar ?",
- section_description:"Descripció",
- section_time:"Periode de temps",
- full_day:"Tot el dia",
-
- confirm_recurring:"¿Desitja modificar el conjunt d'esdeveniments repetits?",
- section_recurring:"Repeteixca l'esdeveniment",
- button_recurring:"Impedit",
- button_recurring_open:"Permés",
-
- /*agenda view extension*/
- agenda_tab:"Agenda",
- date:"Data",
- description:"Descripció",
-
- /*year view extension*/
- year_tab:"Any",
-
- /*week agenda view extension*/
- week_agenda_tab: "Agenda"
- }
-};
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_cn.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_cn.js deleted file mode 100644 index 3d3fd8fbede..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_cn.js +++ /dev/null @@ -1,53 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -/*
-Translation by FreezeSoul
-*/
-scheduler.config.day_date="%M %d日 %D";
-scheduler.config.default_date="%Y年 %M %d日";
-scheduler.config.month_date="%Y年 %M";
-
-scheduler.locale={
- date: {
- month_full: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
- month_short: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
- day_full: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
- day_short: ["日", "一", "二", "三", "四", "五", "六"]
- },
- labels: {
- dhx_cal_today_button: "今天",
- day_tab: "日",
- week_tab: "周",
- month_tab: "月",
- new_event: "新建日程",
- icon_save: "保存",
- icon_cancel: "关闭",
- icon_details: "详细",
- icon_edit: "编辑",
- icon_delete: "删除",
- confirm_closing: "请确认是否撤销修改!", //Your changes will be lost, are your sure?
- confirm_deleting: "是否删除日程?",
- section_description: "描述",
- section_time: "时间范围",
- full_day: "整天",
-
- confirm_recurring:"请确认是否将日程设为重复模式?",
- section_recurring:"重复周期",
- button_recurring:"禁用",
- button_recurring_open:"启用",
-
- /*agenda view extension*/
- agenda_tab:"议程",
- date:"日期",
- description:"说明",
-
- /*year view extension*/
- year_tab:"今年",
-
- /*week agenda view extension*/
- week_agenda_tab: "议程"
- }
-};
-
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_cs.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_cs.js deleted file mode 100644 index 388c1af7fa2..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_cs.js +++ /dev/null @@ -1,47 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.locale={
- date:{
- month_full:["Leden", "Únor", "Březen", "Duben", "Květen", "Červen", "Červenec", "Srpen", "Září", "Říjen", "Listopad", "Prosinec"],
- month_short:["Led", "Ún", "Bře", "Dub", "Kvě", "Čer", "Čec", "Srp", "Září", "Říj", "List", "Pro"],
- day_full:["Neděle", "Pondělí", "Úterý", "Středa", "Čtvrtek", "Pátek", "Sobota"],
- day_short:["Ne", "Po", "Út", "St", "Čt", "Pá", "So"]
- },
- labels:{
- dhx_cal_today_button:"Dnes",
- day_tab:"Den",
- week_tab:"Týden",
- month_tab:"Měsíc",
- new_event:"Nová událost",
- icon_save:"Uložit",
- icon_cancel:"Zpět",
- icon_details:"Detail",
- icon_edit:"Edituj",
- icon_delete:"Smazat",
- confirm_closing:"",//Vaše změny budou ztraceny, opravdu ?
- confirm_deleting:"Událost bude trvale smazána, opravdu?",
- section_description:"Poznámky",
- section_time:"Doba platnosti",
-
- /*recurring events*/
- confirm_recurring:"Přejete si upravit celou řadu opakovaných událostí?",
- section_recurring:"Opakování události",
- button_recurring:"Vypnuto",
- button_recurring_open:"Zapnuto",
-
- /*agenda view extension*/
- agenda_tab:"Program",
- date:"Datum",
- description:"Poznámka",
-
- /*year view extension*/
- year_tab:"Rok",
- full_day:"Full day",
-
- /*week agenda view extension*/
- week_agenda_tab: "Program"
- }
-};
-
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_da.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_da.js deleted file mode 100644 index 868ee19f6b4..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_da.js +++ /dev/null @@ -1,46 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.locale={
- date:{
- month_full:["Januar", "Februar", "Marts", "April", "Maj", "Juni", "Juli", "August", "September", "Oktober", "November", "December"],
- month_short:["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"],
- day_full:["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"],
- day_short:["Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør"]
- },
- labels:{
- dhx_cal_today_button:"Idag",
- day_tab:"Dag",
- week_tab:"Uge",
- month_tab:"Måned",
- new_event:"Ny begivenhed",
- icon_save:"Gem",
- icon_cancel:"Fortryd",
- icon_details:"Detaljer",
- icon_edit:"Tilret",
- icon_delete:"Slet",
- confirm_closing:"Dine rettelser vil gå tabt.. Er dy sikker?",//Your changes will be lost, are your sure ?
- confirm_deleting:"Bigivenheden vil blive slettet permanent. Er du sikker?",
- section_description:"Beskrivelse",
- section_time:"Tidsperiode",
-
- /*recurring events*/
- confirm_recurring:"Vil du tilrette hele serien af gentagne begivenheder?",
- section_recurring:"Gentag begivenhed",
- button_recurring:"Frakoblet",
- button_recurring_open:"Tilkoblet",
-
- /*agenda view extension*/
- agenda_tab:"Dagsorden",
- date:"Dato",
- description:"Beskrivelse",
-
- /*year view extension*/
- year_tab:"År",
-
- /*week agenda view extension*/
- week_agenda_tab: "Dagsorden"
- }
-};
-
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_de.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_de.js deleted file mode 100644 index 99ee29552a6..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_de.js +++ /dev/null @@ -1,46 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.locale={
- date:{
- month_full:[" Januar", " Februar", " März ", " April", " Mai", " Juni", " Juli", " August", " September ", " Oktober", " November ", " Dezember"],
- month_short:["Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"],
- day_full:[ "Sonntag", "Montag", "Dienstag", " Mittwoch", " Donnerstag", "Freitag", "Samstag"],
- day_short:["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"]
- },
- labels:{
- dhx_cal_today_button: "Heute",
- day_tab:"Tag",
- week_tab:"Woche",
- month_tab:"Monat",
- new_event:"neuer Eintrag",
- icon_save:"Speichern",
- icon_cancel:"Annulieren",
- icon_details:"Details",
- icon_edit:"Ändern",
- icon_delete:"Löschen",
- confirm_closing:"",//"Ihre Veränderungen werden verloren sein, wollen Sie ergänzen? "
- confirm_deleting:"Der Eintrag wird gelöscht",
- section_description:"Beschreibung",
- section_time:"Zeitspanne",
- full_day:"Ganzer Tag",
-
- confirm_recurring:"Wollen Sie alle Einträge bearbeiten (OK) oder nur diesen einzelnen Eintrag (Abbrechen)?",
- section_recurring:"Wiederholung",
- button_recurring:"Aus",
- button_recurring_open:"An",
-
- /*agenda view extension*/
- agenda_tab:"Agenda",
- date:"Datum",
- description:"Beschreibung",
-
- /*year view extension*/
- year_tab:"Jahre",
-
- /*week agenda view extension*/
- week_agenda_tab: "Agenda"
- }
-};
-
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_el.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_el.js deleted file mode 100644 index 86829d63808..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_el.js +++ /dev/null @@ -1,47 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.locale={
- date:{
- month_full:["Ιανουάριος", "Φεβρουάριος", "Μάρτιος", "Απρίλιος", "Μάϊος", "Ιούνιος", "Ιούλιος", "Αύγουστος", "Σεπτέμβριος", "Οκτώβριος", "Νοέμβριος", "Δεκέμβριος"],
- month_short:["ΙΑΝ", "ΦΕΒ", "ΜΑΡ", "ΑΠΡ", "ΜΑΙ", "ΙΟΥΝ", "ΙΟΥΛ", "ΑΥΓ", "ΣΕΠ", "ΟΚΤ", "ΝΟΕ", "ΔΕΚ"],
- day_full:["Κυριακή", "Δευτέρα", "Τρίτη", "Τετάρτη", "Πέμπτη", "Παρασκευή", "Κυριακή"],
- day_short:["ΚΥ", "ΔΕ", "ΤΡ", "ΤΕ", "ΠΕ", "ΠΑ", "ΣΑ"]
- },
- labels:{
- dhx_cal_today_button:"Σήμερα",
- day_tab:"Ημέρα",
- week_tab:"Εβδομάδα",
- month_tab:"Μήνας",
- new_event:"Νέο έργο",
- icon_save:"Αποθήκευση",
- icon_cancel:"Άκυρο",
- icon_details:"Λεπτομέρειες",
- icon_edit:"Επεξεργασία",
- icon_delete:"Διαγραφή",
- confirm_closing:"",//Your changes will be lost, are your sure ?
- confirm_deleting:"Το έργο θα διαγραφεί οριστικά. Θέλετε να συνεχίσετε;",
- section_description:"Περιγραφή",
- section_time:"Χρονική περίοδος",
- full_day:"Πλήρης Ημέρα",
-
- /*recurring events*/
- confirm_recurring:"Θέλετε να επεξεργασθείτε ολόκληρη την ομάδα των επαναλαμβανόμενων έργων;",
- section_recurring:"Επαναλαμβανόμενο έργο",
- button_recurring:"Ανενεργό",
- button_recurring_open:"Ενεργό",
-
- /*agenda view extension*/
- agenda_tab:"Ημερήσια Διάταξη",
- date:"Ημερομηνία",
- description:"Περιγραφή",
-
- /*year view extension*/
- year_tab:"Έτος",
-
- /*week agenda view extension*/
- week_agenda_tab: "Ημερήσια Διάταξη"
- }
-};
-
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_es.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_es.js deleted file mode 100644 index 4f9826d546b..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_es.js +++ /dev/null @@ -1,48 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -/*
- @Autor Manuel Fernandez Panzuela - www.mfernandez.es
-*/
-scheduler.locale={
- date:{
- month_full:["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"],
- month_short:["Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic"],
- day_full:["Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado"],
- day_short:["Dom", "Lun", "Mar", "Mie", "Jue", "Vie", "Sab"]
- },
- labels:{
- dhx_cal_today_button:"Hoy",
- day_tab:"Día",
- week_tab:"Semana",
- month_tab:"Mes",
- new_event:"Nuevo evento",
- icon_save:"Guardar",
- icon_cancel:"Cancelar",
- icon_details:"Detalles",
- icon_edit:"Editar",
- icon_delete:"Eliminar",
- confirm_closing:"", //"Sus cambios se perderán, continuar ?"
- confirm_deleting:"El evento se borrará definitivamente, continuar ?",
- section_description:"Descripción",
- section_time:"Periodo de tiempo",
- full_day:"Todo el día",
-
- confirm_recurring:"¿Desea modificar el conjunto de eventos repetidos?",
- section_recurring:"Repita el evento",
- button_recurring:"Impedido",
- button_recurring_open:"Permitido",
-
- /*agenda view extension*/
- agenda_tab:"Dia",
- date:"Fecha",
- description:"Descripción",
-
- /*year view extension*/
- year_tab:"Año",
-
- /*week agenda view extension*/
- week_agenda_tab: "Dia"
- }
-};
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_fi.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_fi.js deleted file mode 100644 index 3ea32dbe9ea..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_fi.js +++ /dev/null @@ -1,47 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.locale={
- date:{
- month_full:["Tammikuu", "Helmikuu", "Maaliskuu", "Huhtikuu", "Toukokuu", "Kesäkuu", "Heinäkuu", "Elokuu", "Syyskuu", "Lokakuu", "Marraskuu", "Joulukuu"],
- month_short:["Tam", "Hel", "Maa", "Huh", "Tou", "Kes", "Hei", "Elo", "Syy", "Lok", "Mar", "Jou"],
- day_full:["Sunnuntai", "Maanantai", "Tiistai", "Keskiviikko", "Torstai", "Perjantai", "Lauantai"],
- day_short:["Su", "Ma", "Ti", "Ke", "To", "Pe", "La"]
- },
- labels:{
- dhx_cal_today_button:"Tänään",
- day_tab:"Päivä",
- week_tab:"Viikko",
- month_tab:"Kuukausi",
- new_event:"Uusi tapahtuma",
- icon_save:"Tallenna",
- icon_cancel:"Peru",
- icon_details:"Tiedot",
- icon_edit:"Muokkaa",
- icon_delete:"Poista",
- confirm_closing:"",//Your changes will be lost, are your sure ?
- confirm_deleting:"Haluatko varmasti poistaa tapahtuman?",
- section_description:"Kuvaus",
- section_time:"Aikajakso",
- full_day:"Koko päivä",
-
- confirm_recurring:"Haluatko varmasti muokata toistuvan tapahtuman kaikkia jaksoja?",
- section_recurring:"Toista tapahtuma",
- button_recurring:"Ei käytössä",
- button_recurring_open:"Käytössä",
-
- /*agenda view extension*/
- agenda_tab:"Esityslista",
- date:"Päivämäärä",
- description:"Kuvaus",
-
- /*year view extension*/
- year_tab:"Vuoden",
-
- /*week agenda view extension*/
- week_agenda_tab: "Esityslista"
- }
-};
-
-
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_fr.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_fr.js deleted file mode 100644 index 34639313e5e..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_fr.js +++ /dev/null @@ -1,45 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.locale={
- date:{
- month_full:["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"],
- month_short:["Jan", "Fév", "Mar", "Avr", "Mai", "Juin", "Juil", "Aôu", "Sep", "Oct", "Nov", "Déc"],
- day_full:["Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"],
- day_short:["Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam"]
- },
- labels:{
- dhx_cal_today_button:"Aujourd'hui",
- day_tab:"Jour",
- week_tab:"Semaine",
- month_tab:"Mois",
- new_event:"Nouvel événement",
- icon_save:"Enregistrer",
- icon_cancel:"Annuler",
- icon_details:"Détails",
- icon_edit:"Modifier",
- icon_delete:"Effacer",
- confirm_closing:"",//Vos modifications seront perdus, êtes-vous sûr ?
- confirm_deleting:"L'événement sera effacé sans appel, êtes-vous sûr ?",
- section_description:"Description",
- section_time:"Période de temps",
- full_day:"Journée complète",
-
- confirm_recurring:"Voulez-vous éditer toute une série d'évènements répétés?",
- section_recurring:"Répéter l'évènement",
- button_recurring:"Désactivé",
- button_recurring_open:"Activé",
-
- /*agenda view extension*/
- agenda_tab:"Jour",
- date:"Date",
- description:"Description",
-
- /*year view extension*/
- year_tab:"Année",
-
- /*week agenda view extension*/
- week_agenda_tab: "Jour"
- }
-};
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_he.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_he.js deleted file mode 100644 index bc3dd9cd794..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_he.js +++ /dev/null @@ -1,47 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.locale={
- date:{
- month_full:["ינואר", "פברואר", "מרץ", "אפריל", "מאי", "יוני", "יולי", "אוגוסט", "ספטמבר", "אוקטובר", "נובמבר", "דצמבר"],
- month_short:["ינו", "פבר", "מרץ", "אפר", "מאי", "יונ", "יול", "אוג", "ספט", "אוק", "נוב", "דצמ"],
- day_full:["ראשון", "שני", "שלישי", "רביעי", "חמישי", "שישי", "שבת"],
- day_short:["א", "ב", "ג", "ד", "ה", "ו", "ש"]
- },
- labels:{
- dhx_cal_today_button:"היום",
- day_tab:"יום",
- week_tab:"שבוע",
- month_tab:"חודש",
- new_event:"ארוע חדש",
- icon_save:"שמור",
- icon_cancel:"בטל",
- icon_details:"פרטים",
- icon_edit:"ערוך",
- icon_delete:"מחק",
- confirm_closing:"",//Your changes will be lost, are your sure ?
- confirm_deleting:"ארוע ימחק סופית.להמשיך?",
- section_description:"הסבר",
- section_time:"תקופה",
-
- confirm_recurring:"האם ברצונך לשנות כל סדרת ארועים מתמשכים?",
- section_recurring:"להעתיק ארוע",
- button_recurring:"לא פעיל",
- button_recurring_open:"פעיל",
- full_day:"יום שלם",
-
- /*agenda view extension*/
- agenda_tab:"סדר יום",
- date:"תאריך",
- description:"תיאור",
-
- /*year view extension*/
- year_tab:"לשנה",
-
- /*week agenda view extension*/
- week_agenda_tab: "סדר יום"
- }
-};
-
-
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_hu.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_hu.js deleted file mode 100644 index 0c37a28fb9f..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_hu.js +++ /dev/null @@ -1,47 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.locale={
- date:{
- month_full:["Janu�r", "Febru�r", "M�rcius", "�prilis", "M�jus", "J�nius", "J�lius", "Augusztus", "Szeptember", "Okt�ber", "November", "December"],
- month_short:["Jan", "Feb", "M�r", "�pr", "M�j", "J�n", "J�l", "Aug", "Sep", "Okt", "Nov", "Dec"],
- day_full:["Vas�rnap", "H�tf�", "Kedd", "Szerda", "Cs�t�rt�k", "P�ntek", "szombat"],
- day_short:["Va", "H�", "Ke", "Sze", "Cs�", "P�", "Szo"]
- },
- labels:{
- dhx_cal_today_button:"Ma",
- day_tab:"Nap",
- week_tab:"H�t",
- month_tab:"H�nap",
- new_event:"�j esem�ny",
- icon_save:"Ment�s",
- icon_cancel:"M�gse",
- icon_details:"R�szletek",
- icon_edit:"Szerkeszt�s",
- icon_delete:"T�rl�s",
- confirm_closing:"",//A v�ltoz�sok elvesznek, biztosan folytatja? "
- confirm_deleting:"Az esem�ny t�r�lve lesz, biztosan folytatja?",
- section_description:"Le�r�s",
- section_time:"Id�szak",
- full_day:"Egesz napos",
-
- /*ism�tl�d� esem�nyek*/
- confirm_recurring:"Biztosan szerkeszteni akarod az �sszes ism�tl�d� esem�ny be�ll�t�s�t?",
- section_recurring:"Esem�ny ism�tl�se",
- button_recurring:"Tilt�s",
- button_recurring_open:"Enged�lyez�s",
-
- /*napirendi n�zet*/
- agenda_tab:"Napirend",
- date:"D�tum",
- description:"Le�r�s",
-
- /*�ves n�zet*/
- year_tab:"�v",
-
- /*week agenda view extension*/
- week_agenda_tab: "Napirend"
- }
-};
-
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_id.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_id.js deleted file mode 100644 index 8f75fd0f617..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_id.js +++ /dev/null @@ -1,5 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.locale={
date:{
month_full:["Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember"],
month_short:["Jan", "Feb", "Mar", "Apr", "Mei", "Jun", "Jul", "Ags", "Sep", "Okt", "Nov", "Des"],
day_full:["Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu"],
day_short:["Ming", "Sen", "Sel", "Rab", "Kam", "Jum", "Sab"]
},
labels:{
dhx_cal_today_button:"Hari Ini",
day_tab:"Hari",
week_tab:"Minggu",
month_tab:"Bulan",
new_event:"Acara Baru",
icon_save:"Simpan",
icon_cancel:"Batal",
icon_details:"Detail",
icon_edit:"Edit",
icon_delete:"Hapus",
confirm_closing:"",//Perubahan tidak akan disimpan ?
confirm_deleting:"Acara akan dihapus",
section_description:"Keterangan",
section_time:"Periode",
full_day:"Hari penuh",
/*recurring events*/
confirm_recurring:"Apakah acara ini akan berulang?",
section_recurring:"Acara Rutin",
button_recurring:"Tidak Difungsikan",
button_recurring_open:"Difungsikan",
/*agenda view extension*/
agenda_tab:"Agenda",
date:"Tanggal",
description:"Keterangan",
/*year view extension*/
year_tab:"Tahun",
/*week agenda view extension*/
week_agenda_tab: "Agenda"
}
};
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_it.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_it.js deleted file mode 100644 index 2e1188ab4cc..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_it.js +++ /dev/null @@ -1,45 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.locale={
- date:{
- month_full:["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"],
- month_short:["Gen", "Feb", "Mar", "Apr", "Mag", "Giu", "Lug", "Ago", "Set", "Ott", "Nov", "Dic"],
- day_full:["Domenica", "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato"],
- day_short:["Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab"]
- },
- labels:{
- dhx_cal_today_button:"Oggi",
- day_tab:"Giorno",
- week_tab:"Settimana",
- month_tab:"Mese",
- new_event:"Nuovo evento",
- icon_save:"Salva",
- icon_cancel:"Cancella",
- icon_details:"Dettagli",
- icon_edit:"Modifica",
- icon_delete:"Elimina",
- confirm_closing:"",//Le modifiche apportate saranno perse, siete sicuri?
- confirm_deleting:"L'evento verrà eliminato, siete sicuri?",
- section_description:"Descrizione",
- section_time:"Periodo di tempo",
- full_day:"Intera giornata",
-
- confirm_recurring:"Vuoi modificare l'intera serie di eventi?",
- section_recurring:"Ripetere l'evento",
- button_recurring:"Disattivato",
- button_recurring_open:"Attivato",
-
- /*agenda view extension*/
- agenda_tab:"Giorno",
- date:"Data",
- description:"Descrizione",
-
- /*year view extension*/
- year_tab:"Anni",
-
- /*week agenda view extension*/
- week_agenda_tab: "Giorno"
- }
-};
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_jp.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_jp.js deleted file mode 100644 index 34274f7080f..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_jp.js +++ /dev/null @@ -1,49 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -/*
-Translation by Genexus Japan Inc.
-*/
-scheduler.locale={
- date: {
- month_full:["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
- month_short:[ "1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
- day_full:["日曜日", "月曜日", "火曜日", "水曜日", "木曜日", "金曜日", "土曜日"],
- day_short:["日", "月", "火", "水", "木", "金", "土"]
- },
- labels:{
- dhx_cal_today_button:"今日",
- day_tab:"日",
- week_tab:"週",
- month_tab:"月",
- new_event:"新イベント",
- icon_save:"保存",
- icon_cancel:"キャンセル",
- icon_details:"詳細",
- icon_edit:"編集",
- icon_delete:"削除",
- confirm_closing:"",//変更が取り消されます、宜しいですか?
- confirm_deleting:"イベント完全に削除されます、宜しいですか?",
- section_description:"デスクリプション",
- section_time:"期間",
- confirm_recurring:"繰り返されているイベントを全て編集しますか?",
- section_recurring:"イベントを繰り返す",
- button_recurring:"無効",
- button_recurring_open:"有効",
- full_day:"終日",
-
- /*agenda view extension*/
- agenda_tab:"議題は",
- date:"日付",
- description:"説明",
-
- /*year view extension*/
- year_tab:"今年",
-
- /*week agenda view extension*/
- week_agenda_tab: "議題は"
- }
-};
-
-
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_nb.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_nb.js deleted file mode 100644 index c431cf83f61..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_nb.js +++ /dev/null @@ -1,45 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.locale = {
- date:{
- month_full:["Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"],
- month_short:["Jan", "Feb", "Mar", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Des"],
- day_full:["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"],
- day_short:["Søn", "Mon", "Tir", "Ons", "Tor", "Fre", "Lør"]
- },
- labels:{
- dhx_cal_today_button:"I dag",
- day_tab:"Dag",
- week_tab:"Uke",
- month_tab:"Måned",
- new_event:"Ny hendelse",
- icon_save:"Lagre",
- icon_cancel:"Avbryt",
- icon_details:"Detaljer",
- icon_edit:"Rediger",
- icon_delete:"Slett",
- confirm_closing:"",//Your changes will be lost, are your sure ?
- confirm_deleting:"Hendelsen vil bli slettet permanent. Er du sikker?",
- section_description:"Beskrivelse",
- section_time:"Tidsperiode",
-
- /*recurring events*/
- confirm_recurring:"Vil du forandre hele dette settet av repeterende hendelser?",
- section_recurring:"Repeter hendelsen",
- button_recurring:"Av",
- button_recurring_open:"På",
-
- /*agenda view extension*/
- agenda_tab:"Agenda",
- date:"Dato",
- description:"Beskrivelse",
-
- /*year view extension*/
- year_tab:"År",
-
- /*week agenda view extension*/
- week_agenda_tab: "Agenda"
- }
-};
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_nl.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_nl.js deleted file mode 100644 index 045144c7509..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_nl.js +++ /dev/null @@ -1,47 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.locale={
- date:{
- month_full:["Januari", "Februari", "Maart", "April", "Mei", "Juni", "Juli", "Augustus", "September", "Oktober", "November", "December"],
- month_short:["Jan", "Feb", "mrt", "Apr", "Mei", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"],
- day_full:["Zondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag"],
- day_short:["Zo", "Ma", "Di", "Wo", "Do", "Vr", "Za"]
- },
- labels:{
- dhx_cal_today_button:"Vandaag",
- day_tab:"Dag",
- week_tab:"Week",
- month_tab:"Maand",
- new_event:"Nieuw item",
- icon_save:"Opslaan",
- icon_cancel:"Annuleren",
- icon_details:"Details",
- icon_edit:"Edit",
- icon_delete:"Verwijderen",
- confirm_closing:"",//Your changes will be lost, are your sure ?
- confirm_deleting:"Item zal permanent worden verwijderd, doorgaan?",
- section_description:"Beschrijving",
- section_time:"Tijd periode",
- full_day:"Hele dag",
-
- confirm_recurring:"Wilt u alle terugkerende items bijwerken?",
- section_recurring:"Item herhalen",
- button_recurring:"Uit",
- button_recurring_open:"Aan",
-
- /*agenda view extension*/
- agenda_tab:"Agenda",
- date:"Datum",
- description:"Omschrijving",
-
- /*year view extension*/
- year_tab:"Jaar",
-
- /*week agenda view extension*/
- week_agenda_tab: "Agenda"
- }
-};
-
-
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_no.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_no.js deleted file mode 100644 index 03981ba5b01..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_no.js +++ /dev/null @@ -1,47 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.locale={
- date:{
- month_full:["Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"],
- month_short:["Jan", "Feb", "Mar", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Des"],
- day_full:["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"],
- day_short:["Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør"]
- },
- labels:{
- dhx_cal_today_button:"Idag",
- day_tab:"Dag",
- week_tab:"Uke",
- month_tab:"Måned",
- new_event:"Ny",
- icon_save:"Lagre",
- icon_cancel:"Avbryt",
- icon_details:"Detaljer",
- icon_edit:"Endre",
- icon_delete:"Slett",
- confirm_closing:"Endringer blir ikke lagret, er du sikker?",//Endringer blir ikke lagret, er du sikker?
- confirm_deleting:"Oppføringen vil bli slettet, er du sikker?",
- section_description:"Beskrivelse",
- section_time:"Tidsperiode",
- full_day:"Full dag",
-
- /*recurring events*/
- confirm_recurring:"Vil du endre hele settet med repeterende oppføringer?",
- section_recurring:"Repeterende oppføring",
- button_recurring:"Ikke aktiv",
- button_recurring_open:"Aktiv",
-
- /*agenda view extension*/
- agenda_tab:"Agenda",
- date:"Dato",
- description:"Beskrivelse",
-
- /*year view extension*/
- year_tab:"År",
-
- /*week agenda view extension*/
- week_agenda_tab: "Agenda"
- }
-};
-
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_pl.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_pl.js deleted file mode 100644 index 649bdcf2160..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_pl.js +++ /dev/null @@ -1,47 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.locale={
- date:{
- month_full:["Styczeń", "Luty", "Marzec", "Kwiecień", "Maj", "Czerwiec", "Lipiec", "Sierpień", "Wrzesień", "Październik", "Listopad", "Grudzień"],
- month_short:["Sty", "Lut", "Mar", "Kwi", "Maj", "Cze", "Lip", "Sie", "Wrz", "Paź", "Lis", "Gru"],
- day_full:["Niedziela", "Poniedziałek", "Wtorek", "Środa", "Czwartek", "Piątek", "Sobota"],
- day_short:["Nie", "Pon", "Wto", "Śro", "Czw", "Pią", "Sob"]
- },
- labels:{
- dhx_cal_today_button:"Dziś",
- day_tab:"Dzień",
- week_tab:"Tydzień",
- month_tab:"Miesiąc",
- new_event:"Nowe zdarzenie",
- icon_save:"Zapisz",
- icon_cancel:"Anuluj",
- icon_details:"Szczegóły",
- icon_edit:"Edytuj",
- icon_delete:"Usuń",
- confirm_closing:"",//Zmiany zostaną usunięte, jesteś pewien?
- confirm_deleting:"Zdarzenie zostanie usunięte na zawsze, kontynuować?",
- section_description:"Opis",
- section_time:"Okres czasu",
- full_day:"Cały dzień",
-
- /*recurring events*/
- confirm_recurring:"Czy chcesz edytować cały zbiór powtarzających się zdarzeń?",
- section_recurring:"Powtórz zdarzenie",
- button_recurring:"Nieaktywne",
- button_recurring_open:"Aktywne",
-
- /*agenda view extension*/
- agenda_tab:"Agenda",
- date:"Data",
- description:"Opis",
-
- /*year view extension*/
- year_tab:"Rok",
-
- /*week agenda view extension*/
- week_agenda_tab: "Agenda"
- }
-};
-
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_pt.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_pt.js deleted file mode 100644 index 1bf5da01b1c..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_pt.js +++ /dev/null @@ -1,58 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -/*
-
- TRANSLATION BY MATTHEUS PIROVANI RORIZ GONЗALVES
-
- mattheusroriz@hotmail.com / mattheus.pirovani@gmail.com /
-
- www.atrixian.com.br
-
-*/
-
-
-scheduler.locale={
- date:{
- month_full:["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"],
- month_short:["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"],
- day_full:["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"],
- day_short:["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab"]
- },
- labels:{
- dhx_cal_today_button:"Hoje",
- day_tab:"Dia",
- week_tab:"Semana",
- month_tab:"Mês",
- new_event:"Novo evento",
- icon_save:"Salvar",
- icon_cancel:"Cancelar",
- icon_details:"Detalhes",
- icon_edit:"Editar",
- icon_delete:"Deletar",
- confirm_closing:"",//Your changes will be lost, are your sure ?
- confirm_deleting:"Tem certeza que deseja excluir?",
- section_description:"Descrição",
- section_time:"Período de tempo",
- full_day:"Dia inteiro",
-
- confirm_recurring:"Deseja editar todos esses eventos repetidos?",
- section_recurring:"Repetir evento",
- button_recurring:"Desabilitar",
- button_recurring_open:"Habilitar",
-
- /*agenda view extension*/
- agenda_tab:"Dia",
- date:"Data",
- description:"Descrição",
-
- /*year view extension*/
- year_tab:"Ano",
-
- /*week agenda view extension*/
- week_agenda_tab: "Dia"
- }
-};
-
-
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_cn.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_cn.js deleted file mode 100644 index 21c08b0319b..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_cn.js +++ /dev/null @@ -1,6 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.__recurring_template='<div class="dhx_form_repeat"> <form> <div class="dhx_repeat_left"> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="day" />按天</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="week"/>按周</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="month" checked />按月</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="year" />按年</label> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_center"> <div style="display:none;" id="dhx_repeat_day"> <label><input class="dhx_repeat_radio" type="radio" name="day_type" value="d"/>每</label><input class="dhx_repeat_text" type="text" name="day_count" value="1" />天<br /> <label><input class="dhx_repeat_radio" type="radio" name="day_type" checked value="w"/>每个工作日</label> </div> <div style="display:none;" id="dhx_repeat_week"> 重复 每<input class="dhx_repeat_text" type="text" name="week_count" value="1" />星期的:<br /> <table class="dhx_repeat_days"> <tr> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="1" />星期一</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="4" />星期四</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="2" />星期二</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="5" />星期五</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="3" />星期三</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="6" />星期六</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="0" />星期日</label><br /><br /> </td> </tr> </table> </div> <div id="dhx_repeat_month"> <label><input class="dhx_repeat_radio" type="radio" name="month_type" value="d"/>重复</label><input class="dhx_repeat_text" type="text" name="month_day" value="1" />日 每<input class="dhx_repeat_text" type="text" name="month_count" value="1" />月<br /> <label><input class="dhx_repeat_radio" type="radio" name="month_type" checked value="w"/>在</label><input class="dhx_repeat_text" type="text" name="month_week2" value="1" /><select name="month_day2"><option value="1" selected >星期一<option value="2">星期二<option value="3">星期三<option value="4">星期四<option value="5">星期五<option value="6">星期六<option value="0">星期日</select>每<input class="dhx_repeat_text" type="text" name="month_count2" value="1" />月<br /> </div> <div style="display:none;" id="dhx_repeat_year"> <label><input class="dhx_repeat_radio" type="radio" name="year_type" value="d"/>每</label><input class="dhx_repeat_text" type="text" name="year_day" value="1" />日<select name="year_month"><option value="0" selected >一月<option value="1">二月<option value="2">三月<option value="3">四月<option value="4">五月<option value="5">六月<option value="6">七月<option value="7">八月<option value="8">九月<option value="9">十月<option value="10">十一月<option value="11">十二月</select>月<br /> <label><input class="dhx_repeat_radio" type="radio" name="year_type" checked value="w"/>在</label><input class="dhx_repeat_text" type="text" name="year_week2" value="1" /><select name="year_day2"><option value="1" selected >星期一<option value="2">星期二<option value="3">星期三<option value="4">星期四<option value="5">星期五<option value="6">星期六<option value="7">星期日</select>的<select name="year_month2"><option value="0" selected >一月<option value="1">二月<option value="2">三月<option value="3">四月<option value="4">五月<option value="5">六月<option value="6">七月<option value="7">八月<option value="8">九月<option value="9">十月<option value="10">十一月<option value="11">十二月</select><br /> </div> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_right"> <label><input class="dhx_repeat_radio" type="radio" name="end" checked/>无结束日期</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="end" />重复</label><input class="dhx_repeat_text" type="text" name="occurences_count" value="1" />次结束<br /> <label><input class="dhx_repeat_radio" type="radio" name="end" />结束于</label><input class="dhx_repeat_date" type="text" name="date_of_end" value="'+scheduler.config.repeat_date_of_end+'" /><br /> </div> </form> </div> <div style="clear:both"> </div>'; - diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_cs.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_cs.js deleted file mode 100644 index 310f5c508fb..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_cs.js +++ /dev/null @@ -1,157 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.__recurring_template=' -<div class="dhx_form_repeat"> - <form> - <div class="dhx_repeat_left"> - <label> - <input class="dhx_repeat_radio" type="radio" name="repeat" value="day" />Denně - </label><br /> - <label> - <input class="dhx_repeat_radio" type="radio" name="repeat" value="week"/>Týdně - </label><br /> - <label> - <input class="dhx_repeat_radio" type="radio" name="repeat" value="month" checked />Měsíčně - </label><br /> - <label> - <input class="dhx_repeat_radio" type="radio" name="repeat" value="year" />Ročně - </label> - </div> - <div class="dhx_repeat_divider"> - </div> - <div class="dhx_repeat_center"> - <div style="display:none;" id="dhx_repeat_day"> - <label>Opakované: - <br/> - </label> - <label> - <input class="dhx_repeat_radio" type="radio" name="day_type" value="d"/>každý - </label> - <input class="dhx_repeat_text" type="text" name="day_count" value="1" />Den<br /> - <label> - <input class="dhx_repeat_radio" type="radio" name="day_type" checked value="w"/>pracovní dny - </label> - </div> - <div style="display:none;" id="dhx_repeat_week"> Opakuje každých - <input class="dhx_repeat_text" type="text" name="week_count" value="1" />Týdnů na:<br /> - <table class="dhx_repeat_days"> - <tr> <td> - <label> - <input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="1" />Pondělí - </label><br /> - <label> - <input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="4" />Čtvrtek - </label> </td> <td> - <label> - <input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="2" />Úterý - </label><br /> - <label> - <input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="5" />Pátek - </label> </td> <td> - <label> - <input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="3" />Středa - </label><br /> - <label> - <input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="6" />Sobota - </label> </td> <td> - <label> - <input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="0" />Neděle - </label><br /><br /> </td> - </tr> - </table> - </div> - <div id="dhx_repeat_month"> - <label>Opakované: - <br/> - </label> - <label> - <input class="dhx_repeat_radio" type="radio" name="month_type" value="d"/>u každého - </label> - <input class="dhx_repeat_text" type="text" name="month_day" value="1" />Den každého - <input class="dhx_repeat_text" type="text" name="month_count" value="1" />Měsíc<br /> - <label> - <input class="dhx_repeat_radio" type="radio" name="month_type" checked value="w"/>na - </label> - <input class="dhx_repeat_text" type="text" name="month_week2" value="1" /> - <select name="month_day2"> - <option value="1" selected >Pondělí - <option value="2">Úterý - <option value="3">Středa - <option value="4">Čtvrtek - <option value="5">Pátek - <option value="6">Sobota - <option value="0">Neděle - </select>každý - <input class="dhx_repeat_text" type="text" name="month_count2" value="1" />Měsíc<br /> - </div> - <div style="display:none;" id="dhx_repeat_year"> - <label>Opakované: - </label> - <label> - <input class="dhx_repeat_radio" type="radio" name="year_type" value="d"/>u každého - </label> - <input class="dhx_repeat_text" type="text" name="year_day" value="1" />Den v - <select name="year_month"> - <option value="0" selected >Leden - <option value="1">Únor - <option value="2">Březen - <option value="3">Duben - <option value="4">Květen - <option value="5">Červen - <option value="6">Červenec - <option value="7">Srpen - <option value="8">Září - <option value="9">Říjen - <option value="10">Listopad - <option value="11">Prosinec - </select><br /> - <label> - <input class="dhx_repeat_radio" type="radio" name="year_type" checked value="w"/>na - </label> - <input class="dhx_repeat_text" type="text" name="year_week2" value="1" /> - <select name="year_day2"> - <option value="1" selected >Pondělí - <option value="2">Úterý - <option value="3">Středa - <option value="4">Čtvrtek - <option value="5">Pátek - <option value="6">Sobota - <option value="0">Neděle - </select>v - <select name="year_month2"> - <option value="0" selected >Leden - <option value="1">Únor - <option value="2">Březen - <option value="3">Duben - <option value="4">Květen - <option value="5">Červen - <option value="6">Červenec - <option value="7">Srpen - <option value="8">Září - <option value="9">Říjen - <option value="10">Listopad - <option value="11">Prosinec - </select><br /> - </div> - </div> - <div class="dhx_repeat_divider"> - </div> - <div class="dhx_repeat_right"> - <label> - <input class="dhx_repeat_radio" type="radio" name="end" checked/>bez data ukončení - </label><br /> - <label> - <input class="dhx_repeat_radio" type="radio" name="end" />po - </label> - <input class="dhx_repeat_text" type="text" name="occurences_count" value="1" />Události<br /> - <label> - <input class="dhx_repeat_radio" type="radio" name="end" />Konec - </label> - <input class="dhx_repeat_date" type="text" name="date_of_end" value="'+scheduler.config.repeat_date_of_end+'" /><br /> - </div> - </form> -</div> -<div style="clear:both"> -</div>'; diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_da.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_da.js deleted file mode 100644 index 1d3e272a936..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_da.js +++ /dev/null @@ -1,6 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.__recurring_template='<div class="dhx_form_repeat"> <form> <div class="dhx_repeat_left"> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="day" />Daglig</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="week"/>Ugenlig</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="month" checked />Månedlig</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="year" />Årlig</label> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_center"> <div style="display:none;" id="dhx_repeat_day"> <label>Gentager sig:<br/></label> <label><input class="dhx_repeat_radio" type="radio" name="day_type" value="d"/>Hver</label><input class="dhx_repeat_text" type="text" name="day_count" value="1" />dag<br /> <label><input class="dhx_repeat_radio" type="radio" name="day_type" checked value="w"/>På hver arbejdsdag</label> </div> <div style="display:none;" id="dhx_repeat_week"> Gentager sig hver<input class="dhx_repeat_text" type="text" name="week_count" value="1" />uge på følgende dage:<br /> <table class="dhx_repeat_days"> <tr> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="1" />Mandag</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="4" />Torsdag</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="2" />Tirsdag</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="5" />Fredag</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="3" />Onsdag</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="6" />Lørdag</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="0" />Søndag</label><br /><br /> </td> </tr> </table> </div> <div id="dhx_repeat_month"> <label>Gentager sig:<br/></label> <label><input class="dhx_repeat_radio" type="radio" name="month_type" value="d"/>Hver den</label><input class="dhx_repeat_text" type="text" name="month_day" value="1" /> i hver<input class="dhx_repeat_text" type="text" name="month_count" value="1" />måned<br /> <label><input class="dhx_repeat_radio" type="radio" name="month_type" checked value="w"/>Den</label><input class="dhx_repeat_text" type="text" name="month_week2" value="1" /><select name="month_day2"><option value="1" selected >Mandag<option value="2">Tirsdag<option value="3">Onsdag<option value="4">Torsdag<option value="5">Fredag<option value="6">Lørdag<option value="0">Søndag</select>hver<input class="dhx_repeat_text" type="text" name="month_count2" value="1" />måned<br /> </div> <div style="display:none;" id="dhx_repeat_year"> <label>Gentager sig:</label> <label><input class="dhx_repeat_radio" type="radio" name="year_type" value="d"/>På hver</label><input class="dhx_repeat_text" type="text" name="year_day" value="1" />dag i<select name="year_month"><option value="0" selected >Januar<option value="1">Februar<option value="2">März<option value="3">April<option value="4">Mai<option value="5">Juni<option value="6">Juli<option value="7">August<option value="8">September<option value="9">Oktober<option value="10">November<option value="11">Dezember</select><br /> <label><input class="dhx_repeat_radio" type="radio" name="year_type" checked value="w"/>Den</label><input class="dhx_repeat_text" type="text" name="year_week2" value="1" /><select name="year_day2"><option value="1" selected >Mandag<option value="2">Tirsdag<option value="3">Onsdag<option value="4">Torsdag<option value="5">Fredag<option value="6">Lørdag<option value="0">Søndag</select>i<select name="year_month2"><option value="0" selected >Januar<option value="1">Februar<option value="2">März<option value="3">April<option value="4">Mai<option value="5">Juni<option value="6">Juli<option value="7">August<option value="8">September<option value="9">Oktober<option value="10">November<option value="11">Dezember</select><br /> </div> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_right"> <label><input class="dhx_repeat_radio" type="radio" name="end" checked/>Ingen slutdato</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="end" />Efter</label><input class="dhx_repeat_text" type="text" name="occurences_count" value="1" />gentagelse<br /> <label><input class="dhx_repeat_radio" type="radio" name="end" />Slut</label><input class="dhx_repeat_date" type="text" name="date_of_end" value="'+scheduler.config.repeat_date_of_end+'" /><br /> </div> </form> </div> <div style="clear:both"> </div>';
-
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_de.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_de.js deleted file mode 100644 index 71929e988ea..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_de.js +++ /dev/null @@ -1,6 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.__recurring_template='<div class="dhx_form_repeat"> <form> <div class="dhx_repeat_left"> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="day" />Täglich</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="week"/>Wöchentlich</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="month" checked />Monatlich</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="year" />Jährlich</label> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_center"> <div style="display:none;" id="dhx_repeat_day"> <label>Wiederholt sich:<br/></label> <label><input class="dhx_repeat_radio" type="radio" name="day_type" value="d"/>jeden</label><input class="dhx_repeat_text" type="text" name="day_count" value="1" />Tag<br /> <label><input class="dhx_repeat_radio" type="radio" name="day_type" checked value="w"/>an jedem Arbeitstag</label> </div> <div style="display:none;" id="dhx_repeat_week"> Wiederholt sich jede<input class="dhx_repeat_text" type="text" name="week_count" value="1" />Woche am:<br /> <table class="dhx_repeat_days"> <tr> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="1" />Montag</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="4" />Donnerstag</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="2" />Dienstag</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="5" />Freitag</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="3" />Mittwoch</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="6" />Samstag</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="0" />Sonntag</label><br /><br /> </td> </tr> </table> </div> <div id="dhx_repeat_month"> <label>Wiederholt sich:<br/></label> <label><input class="dhx_repeat_radio" type="radio" name="month_type" value="d"/>an jedem</label><input class="dhx_repeat_text" type="text" name="month_day" value="1" />Tag eines jeden<input class="dhx_repeat_text" type="text" name="month_count" value="1" />Monats<br /> <label><input class="dhx_repeat_radio" type="radio" name="month_type" checked value="w"/>am</label><input class="dhx_repeat_text" type="text" name="month_week2" value="1" /><select name="month_day2"><option value="1" selected >Montag<option value="2">Dienstag<option value="3">Mittwoch<option value="4">Donnerstag<option value="5">Freitag<option value="6">Samstag<option value="0">Sonntag</select>jeden<input class="dhx_repeat_text" type="text" name="month_count2" value="1" />Monats<br /> </div> <div style="display:none;" id="dhx_repeat_year"> <label>Wiederholt sich:</label> <label><input class="dhx_repeat_radio" type="radio" name="year_type" value="d"/>an jedem</label><input class="dhx_repeat_text" type="text" name="year_day" value="1" />Tag im<select name="year_month"><option value="0" selected >Januar<option value="1">Februar<option value="2">März<option value="3">April<option value="4">Mai<option value="5">Juni<option value="6">Juli<option value="7">August<option value="8">September<option value="9">Oktober<option value="10">November<option value="11">Dezember</select><br /> <label><input class="dhx_repeat_radio" type="radio" name="year_type" checked value="w"/>am</label><input class="dhx_repeat_text" type="text" name="year_week2" value="1" /><select name="year_day2"><option value="1" selected >Montag<option value="2">Dienstag<option value="3">Mittwoch<option value="4">Donnerstag<option value="5">Freitag<option value="6">Samstag<option value="0">Sonntag</select>im<select name="year_month2"><option value="0" selected >Januar<option value="1">Februar<option value="2">März<option value="3">April<option value="4">Mai<option value="5">Juni<option value="6">Juli<option value="7">August<option value="8">September<option value="9">Oktober<option value="10">November<option value="11">Dezember</select><br /> </div> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_right"> <label><input class="dhx_repeat_radio" type="radio" name="end" checked/>kein Enddatum</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="end" />nach</label><input class="dhx_repeat_text" type="text" name="occurences_count" value="1" />Ereignissen<br /> <label><input class="dhx_repeat_radio" type="radio" name="end" />Schluß</label><input class="dhx_repeat_date" type="text" name="date_of_end" value="'+scheduler.config.repeat_date_of_end+'" /><br /> </div> </form> </div> <div style="clear:both"> </div>'; - diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_el.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_el.js deleted file mode 100644 index d3d18ab4358..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_el.js +++ /dev/null @@ -1,6 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.__recurring_template='<div class="dhx_form_repeat"> <form> <div class="dhx_repeat_left"> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="day" />Ημερησίως</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="week"/>Εβδομαδιαίως</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="month" checked />Μηνιαίως</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="year" />Ετησίως</label> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_center"> <div style="display:none;" id="dhx_repeat_day"> <label><input class="dhx_repeat_radio" type="radio" name="day_type" value="d"/>Κάθε</label><input class="dhx_repeat_text" type="text" name="day_count" value="1" />ημέρα<br /> <label><input class="dhx_repeat_radio" type="radio" name="day_type" checked value="w"/>Κάθε εργάσιμη</label> </div> <div style="display:none;" id="dhx_repeat_week"> Επανάληψη κάθε<input class="dhx_repeat_text" type="text" name="week_count" value="1" />εβδομάδα τις επόμενες ημέρες:<br /> <table class="dhx_repeat_days"> <tr> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="1" />Δευτέρα</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="4" />Πέμπτη</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="2" />Τρίτη</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="5" />Παρασκευή</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="3" />Τετάρτη</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="6" />Σάββατο</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="0" />Κυριακή</label><br /><br /> </td> </tr> </table> </div> <div id="dhx_repeat_month"> <label><input class="dhx_repeat_radio" type="radio" name="month_type" value="d"/>Επανάληψη</label><input class="dhx_repeat_text" type="text" name="month_day" value="1" />ημέρα κάθε<input class="dhx_repeat_text" type="text" name="month_count" value="1" />μήνα<br /> <label><input class="dhx_repeat_radio" type="radio" name="month_type" checked value="w"/>Την</label><input class="dhx_repeat_text" type="text" name="month_week2" value="1" /><select name="month_day2"><option value="1" selected >Δευτέρα<option value="2">Τρίτη<option value="3">Τετάρτη<option value="4">Πέμπτη<option value="5">Παρασκευή<option value="6">Σάββατο<option value="0">Κυριακή</select>κάθε<input class="dhx_repeat_text" type="text" name="month_count2" value="1" />μήνα<br /> </div> <div style="display:none;" id="dhx_repeat_year"> <label><input class="dhx_repeat_radio" type="radio" name="year_type" value="d"/>Κάθε</label><input class="dhx_repeat_text" type="text" name="year_day" value="1" />ημέρα<select name="year_month"><option value="0" selected >Ιανουάριος<option value="1">Φεβρουάριος<option value="2">Μάρτιος<option value="3">Απρίλιος<option value="4">Μάϊος<option value="5">Ιούνιος<option value="6">Ιούλιος<option value="7">Αύγουστος<option value="8">Σεπτέμβριος<option value="9">Οκτώβριος<option value="10">Νοέμβριος<option value="11">Δεκέμβριος</select>μήνα<br /> <label><input class="dhx_repeat_radio" type="radio" name="year_type" checked value="w"/>Την</label><input class="dhx_repeat_text" type="text" name="year_week2" value="1" /><select name="year_day2"><option value="1" selected >Δευτέρα<option value="2">Τρίτη<option value="3">Τετάρτη<option value="4">Πέμπτη<option value="5">Παρασκευή<option value="6">Σάββατο<option value="7">Κυριακή</select>του<select name="year_month2"><option value="0" selected >Ιανουάριος<option value="1">Φεβρουάριος<option value="2">Μάρτιος<option value="3">Απρίλιος<option value="4">Μάϊος<option value="5">Ιούνιος<option value="6">Ιούλιος<option value="7">Αύγουστος<option value="8">Σεπτέμβριος<option value="9">Οκτώβριος<option value="10">Νοέμβριος<option value="11">Δεκέμβριος</select><br /> </div> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_right"> <label><input class="dhx_repeat_radio" type="radio" name="end" checked/>Χωρίς ημερομηνία λήξεως</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="end" />Μετά από</label><input class="dhx_repeat_text" type="text" name="occurences_count" value="1" />επαναλήψεις<br /> <label><input class="dhx_repeat_radio" type="radio" name="end" />Λήγει την</label><input class="dhx_repeat_date" type="text" name="date_of_end" value="'+scheduler.config.repeat_date_of_end+'" /><br /> </div> </form> </div> <div style="clear:both"> </div>'; - diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_es.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_es.js deleted file mode 100644 index 99bb3fdbfa5..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_es.js +++ /dev/null @@ -1,6 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.__recurring_template='<div class="dhx_form_repeat"> <form> <div class="dhx_repeat_left"> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="day" />Diariamente</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="week"/>Semanalment</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="month" checked />Mensualmente</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="year" />Anualmente</label> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_center"> <div style="display:none;" id="dhx_repeat_day"> <label><input class="dhx_repeat_radio" type="radio" name="day_type" value="d"/>Cada</label><input class="dhx_repeat_text" type="text" name="day_count" value="1" />dia<br /> <label><input class="dhx_repeat_radio" type="radio" name="day_type" checked value="w"/>Cada jornada de trabajo</label> </div> <div style="display:none;" id="dhx_repeat_week"> Repetir cada<input class="dhx_repeat_text" type="text" name="week_count" value="1" />semana:<br /> <table class="dhx_repeat_days"> <tr> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="1" />Lunes</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="4" />Jeuves</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="2" />Martes</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="5" />Viernes</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="3" />Miércoles</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="6" />Sabado</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="0" />Domingo</label><br /><br /> </td> </tr> </table> </div> <div id="dhx_repeat_month"> <label><input class="dhx_repeat_radio" type="radio" name="month_type" value="d"/>Repita</label><input class="dhx_repeat_text" type="text" name="month_day" value="1" />dia cada <input class="dhx_repeat_text" type="text" name="month_count" value="1" />mes<br /> <label><input class="dhx_repeat_radio" type="radio" name="month_type" checked value="w"/>El</label><input class="dhx_repeat_text" type="text" name="month_week2" value="1" /><select name="month_day2"><option value="1" selected >Lunes<option value="2">Martes<option value="3">Miércoles<option value="4">Jeuves<option value="5">Viernes<option value="6">Sabado<option value="0">Domingo</select>cada<input class="dhx_repeat_text" type="text" name="month_count2" value="1" />mes<br /> </div> <div style="display:none;" id="dhx_repeat_year"> <label><input class="dhx_repeat_radio" type="radio" name="year_type" value="d"/>Cada</label><input class="dhx_repeat_text" type="text" name="year_day" value="1" />dia<select name="year_month"><option value="0" selected >Enero<option value="1">Febrero<option value="2">Маrzo<option value="3">Аbril<option value="4">Mayo<option value="5">Junio<option value="6">Julio<option value="7">Аgosto<option value="8">Setiembre<option value="9">Octubre<option value="10">Noviembre<option value="11">Diciembre</select>mes<br /> <label><input class="dhx_repeat_radio" type="radio" name="year_type" checked value="w"/>El</label><input class="dhx_repeat_text" type="text" name="year_week2" value="1" /><select name="year_day2"><option value="1" selected >Lunes<option value="2">Martes<option value="3">Miércoles<option value="4">Jeuves<option value="5">Viernes<option value="6">Sabado<option value="0">Domingo</select>del<select name="year_month2"><option value="0" selected >Enero<option value="1">Febrero<option value="2">Маrzo<option value="3">Аbril<option value="4">Mayo<option value="5">Junio<option value="6">Julio<option value="7">Аgosto<option value="8">Setiembre<option value="9">Octubre<option value="10">Noviembre<option value="11">Diciembre</select><br /> </div> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_right"> <label><input class="dhx_repeat_radio" type="radio" name="end" checked/>Sin fecha de finalización</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="end" />Después de</label><input class="dhx_repeat_text" type="text" name="occurences_count" value="1" />occurencias<br /> <label><input class="dhx_repeat_radio" type="radio" name="end" />Fin</label><input class="dhx_repeat_date" type="text" name="date_of_end" value="'+scheduler.config.repeat_date_of_end+'" /><br /> </div> </form> </div> <div style="clear:both"> </div>'; - diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_fi.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_fi.js deleted file mode 100644 index 02184e9b601..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_fi.js +++ /dev/null @@ -1,6 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.__recurring_template='<div class="dhx_form_repeat"> <form> <div class="dhx_repeat_left"> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="day" />Päivittäin</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="week"/>Viikoittain</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="month" checked />Kuukausittain</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="year" />Vuosittain</label> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_center"> <div style="display:none;" id="dhx_repeat_day"> <label><input class="dhx_repeat_radio" type="radio" name="day_type" value="d"/>Joka</label><input class="dhx_repeat_text" type="text" name="day_count" value="1" />päivä<br /> <label><input class="dhx_repeat_radio" type="radio" name="day_type" checked value="w"/>Joka arkipäivä</label> </div> <div style="display:none;" id="dhx_repeat_week">Toista joka<input class="dhx_repeat_text" type="text" name="week_count" value="1" />viikko näinä päivinä:<br /> <table class="dhx_repeat_days"> <tr> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="1" />Maanantai</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="4" />Torstai</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="2" />Tiistai</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="5" />Perjantai</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="3" />Keskiviikko</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="6" />Lauantai</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="0" />Sunnuntai</label><br /><br /> </td> </tr> </table> </div> <div id="dhx_repeat_month"> <label><input class="dhx_repeat_radio" type="radio" name="month_type" value="d"/>Toista</label><input class="dhx_repeat_text" type="text" name="month_day" value="1" />päivänä joka<input class="dhx_repeat_text" type="text" name="month_count" value="1" />kuukausi<br /> <label><input class="dhx_repeat_radio" type="radio" name="month_type" checked value="w"/></label><input class="dhx_repeat_text" type="text" name="month_week2" value="1" /><select name="month_day2"><option value="1" selected >Maanantai<option value="2">Tiistai<option value="3">Keskiviikko<option value="4">Torstai<option value="5">Perjantai<option value="6">Lauantai<option value="0">Sunnuntai</select>joka<input class="dhx_repeat_text" type="text" name="month_count2" value="1" />kuukausi<br /> </div> <div style="display:none;" id="dhx_repeat_year"> <label><input class="dhx_repeat_radio" type="radio" name="year_type" value="d"/>Joka</label><input class="dhx_repeat_text" type="text" name="year_day" value="1" />päivä<select name="year_month"><option value="0" selected >Tammikuu<option value="1">Helmikuu<option value="2">Maaliskuu<option value="3">Huhtikuu<option value="4">Toukokuu<option value="5">Kesäkuu<option value="6">Heinäkuu<option value="7">Elokuu<option value="8">Syyskuu<option value="9">Lokakuu<option value="10">Marraskuu<option value="11">Joulukuu</select>kuukausi<br /> <label><input class="dhx_repeat_radio" type="radio" name="year_type" checked value="w"/></label><input class="dhx_repeat_text" type="text" name="year_week2" value="1" /><select name="year_day2"><option value="1" selected >Maanantai<option value="2">Tiistai<option value="3">Keskiviikko<option value="4">Torstai<option value="5">Perjantai<option value="6">Lauantai<option value="0">Sunnuntai</select><select name="year_month2"><option value="0" selected >Tammikuu<option value="1">Helmikuu<option value="2">Maaliskuu<option value="3">Huhtikuu<option value="4">Toukokuu<option value="5">Kesäkuu<option value="6">Heinäkuu<option value="7">Elokuu<option value="8">Syyskuu<option value="9">Lokakuu<option value="10">Marraskuu<option value="11">Joulukuu</select><br /> </div> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_right"> <label><input class="dhx_repeat_radio" type="radio" name="end" checked/>Ei loppumisaikaa</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="end" /></label><input class="dhx_repeat_text" type="text" name="occurences_count" value="1" />Toiston jälkeen<br /> <label><input class="dhx_repeat_radio" type="radio" name="end" />Loppuu</label><input class="dhx_repeat_date" type="text" name="date_of_end" value="'+scheduler.config.repeat_date_of_end+'" /><br /> </div> </form> </div> <div style="clear:both"> </div>'; - diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_fr.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_fr.js deleted file mode 100644 index d11418acba3..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_fr.js +++ /dev/null @@ -1,6 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.__recurring_template='<div class="dhx_form_repeat"> <form> <div class="dhx_repeat_left"> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="day" />Quotidienne</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="week"/>Hebdomadaire</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="month" checked />Mensuelle</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="year" />Annuelle</label> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_center"> <div style="display:none;" id="dhx_repeat_day"> <label><input class="dhx_repeat_radio" type="radio" name="day_type" value="d"/>Chaque</label><input class="dhx_repeat_text" type="text" name="day_count" value="1" />jour<br /> <label><input class="dhx_repeat_radio" type="radio" name="day_type" checked value="w"/>Chaque journée de travail</label> </div> <div style="display:none;" id="dhx_repeat_week"> Répéter toutes les<input class="dhx_repeat_text" type="text" name="week_count" value="1" />semaine:<br /> <table class="dhx_repeat_days"> <tr> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="1" />Lundi</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="4" />Jeudi</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="2" />Mardi</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="5" />Vendredi</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="3" />Mercredi</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="6" />Samedi</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="0" />Dimanche</label><br /><br /> </td> </tr> </table> </div> <div id="dhx_repeat_month"> <label><input class="dhx_repeat_radio" type="radio" name="month_type" value="d"/>Répéter</label><input class="dhx_repeat_text" type="text" name="month_day" value="1" />jour chaque<input class="dhx_repeat_text" type="text" name="month_count" value="1" />mois<br /> <label><input class="dhx_repeat_radio" type="radio" name="month_type" checked value="w"/>Le</label><input class="dhx_repeat_text" type="text" name="month_week2" value="1" /><select name="month_day2"><option value="1" selected >Lundi<option value="2">Mardi<option value="3">Mercredi<option value="4">Jeudi<option value="5">Vendredi<option value="6">Samedi<option value="0">Dimanche</select>chaque<input class="dhx_repeat_text" type="text" name="month_count2" value="1" />mois<br /> </div> <div style="display:none;" id="dhx_repeat_year"> <label><input class="dhx_repeat_radio" type="radio" name="year_type" value="d"/>Chaque</label><input class="dhx_repeat_text" type="text" name="year_day" value="1" />jour<select name="year_month"><option value="0" selected >Janvier<option value="1">Février<option value="2">Mars<option value="3">Avril<option value="4">Mai<option value="5">Juin<option value="6">Juillet<option value="7">Août<option value="8">Septembre<option value="9">Octobre<option value="10">Novembre<option value="11">Décembre</select>mois<br /> <label><input class="dhx_repeat_radio" type="radio" name="year_type" checked value="w"/>Le</label><input class="dhx_repeat_text" type="text" name="year_week2" value="1" /><select name="year_day2"><option value="1" selected >Lundi<option value="2">Mardi<option value="3">Mercredi<option value="4">Jeudi<option value="5">Vendredi<option value="6">Samedi<option value="0">Dimanche</select>du<select name="year_month2"><option value="0" selected >Janvier<option value="1">Février<option value="2">Mars<option value="3">Avril<option value="4">Mai<option value="5">Juin<option value="6">Juillet<option value="7">Août<option value="8">Septembre<option value="9">Octobre<option value="10">Novembre<option value="11">Décembre</select><br /> </div> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_right"> <label><input class="dhx_repeat_radio" type="radio" name="end" checked/>Pas de date d"achèvement</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="end" />Après</label><input class="dhx_repeat_text" type="text" name="occurences_count" value="1" />occurrences<br /> <label><input class="dhx_repeat_radio" type="radio" name="end" />Fin</label><input class="dhx_repeat_date" type="text" name="date_of_end" value="'+scheduler.config.repeat_date_of_end+'" /><br /> </div> </form> </div> <div style="clear:both"> </div>'; - diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_it.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_it.js deleted file mode 100644 index a40b63939d3..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_it.js +++ /dev/null @@ -1,6 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.__recurring_template='<div class="dhx_form_repeat"> <form> <div class="dhx_repeat_left"> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="day" />Quotidiano</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="week"/>Settimanale</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="month" checked />Mensile</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="year" />Annuale</label> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_center"> <div style="display:none;" id="dhx_repeat_day"> <label><input class="dhx_repeat_radio" type="radio" name="day_type" value="d"/>Ogni</label><input class="dhx_repeat_text" type="text" name="day_count" value="1" />giorno<br /> <label><input class="dhx_repeat_radio" type="radio" name="day_type" checked value="w"/>Ogni giornata lavorativa</label> </div> <div style="display:none;" id="dhx_repeat_week"> Ripetere ogni<input class="dhx_repeat_text" type="text" name="week_count" value="1" />settimana:<br /> <table class="dhx_repeat_days"> <tr> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="1" />Lunedì</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="4" />Jovedì</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="2" />Martedì</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="5" />Venerdì</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="3" />Mercoledì</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="6" />Sabato</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="0" />Domenica</label><br /><br /> </td> </tr> </table> </div> <div id="dhx_repeat_month"> <label><input class="dhx_repeat_radio" type="radio" name="month_type" value="d"/>Ripetere</label><input class="dhx_repeat_text" type="text" name="month_day" value="1" />giorno ogni<input class="dhx_repeat_text" type="text" name="month_count" value="1" />mese<br /> <label><input class="dhx_repeat_radio" type="radio" name="month_type" checked value="w"/>Il</label><input class="dhx_repeat_text" type="text" name="month_week2" value="1" /><select name="month_day2"><option value="1" selected >Lunedì<option value="2">Martedì<option value="3">Mercoledì<option value="4">Jovedì<option value="5">Venerdì<option value="6">Sabato<option value="0">Domenica</select>ogni<input class="dhx_repeat_text" type="text" name="month_count2" value="1" />mese<br /> </div> <div style="display:none;" id="dhx_repeat_year"> <label><input class="dhx_repeat_radio" type="radio" name="year_type" value="d"/>Ogni</label><input class="dhx_repeat_text" type="text" name="year_day" value="1" />giorno<select name="year_month"><option value="0" selected >Gennaio<option value="1">Febbraio<option value="2">Marzo<option value="3">Aprile<option value="4">Maggio<option value="5">Jiugno<option value="6">Luglio<option value="7">Agosto<option value="8">Settembre<option value="9">Ottobre<option value="10">Novembre<option value="11">Dicembre</select>mese<br /> <label><input class="dhx_repeat_radio" type="radio" name="year_type" checked value="w"/>Il</label><input class="dhx_repeat_text" type="text" name="year_week2" value="1" /><select name="year_day2"><option value="1" selected >Lunedì<option value="2">Martedì<option value="3">Mercoledì<option value="4">Jovedì<option value="5">Venerdì<option value="6">Sabato<option value="0">Domenica</select>del<select name="year_month2"><option value="0" selected >Gennaio<option value="1">Febbraio<option value="2">Marzo<option value="3">Aprile<option value="4">Maggio<option value="5">Jiugno<option value="6">Luglio<option value="7">Agosto<option value="8">Settembre<option value="9">Ottobre<option value="10">Novembre<option value="11">Dicembre</select><br /> </div> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_right"> <label><input class="dhx_repeat_radio" type="radio" name="end" checked/>Senza data finale</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="end" />Dopo</label><input class="dhx_repeat_text" type="text" name="occurences_count" value="1" />occorenze<br /> <label><input class="dhx_repeat_radio" type="radio" name="end" />Fine</label><input class="dhx_repeat_date" type="text" name="date_of_end" value="'+scheduler.config.repeat_date_of_end+'" /><br /> </div> </form> </div> <div style="clear:both"> </div>'; - diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_nb.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_nb.js deleted file mode 100644 index 65078dbc0b7..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_nb.js +++ /dev/null @@ -1,5 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.__recurring_template='<div class="dhx_form_repeat"> <form> <div class="dhx_repeat_left"> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="day" />Daglig</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="week"/>Ukentlig</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="month" checked />Månedlig</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="year" />Årlig</label> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_center"> <div style="display:none;" id="dhx_repeat_day"> <label>Gjenta:<br/></label> <label><input class="dhx_repeat_radio" type="radio" name="day_type" value="d"/>Hver</label><input class="dhx_repeat_text" type="text" name="day_count" value="1" />dag<br /> <label><input class="dhx_repeat_radio" type="radio" name="day_type" checked value="w"/>Alle hverdager</label> </div> <div style="display:none;" id="dhx_repeat_week"> Gjentas hver<input class="dhx_repeat_text" type="text" name="week_count" value="1" />uke på:<br /> <table class="dhx_repeat_days"> <tr> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="1" />Mandag</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="4" />Torsdag</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="2" />Tirsdag</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="5" />Fredag</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="3" />Onsdag</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="6" />Lørdag</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="0" />Sondag</label><br /><br /> </td> </tr> </table> </div> <div id="dhx_repeat_month"> <label>Gjenta:<br/></label> <label><input class="dhx_repeat_radio" type="radio" name="month_type" value="d"/>På hver</label><input class="dhx_repeat_text" type="text" name="month_day" value="1" />dag hver<input class="dhx_repeat_text" type="text" name="month_count" value="1" />måned<br /> <label><input class="dhx_repeat_radio" type="radio" name="month_type" checked value="w"/>På</label><input class="dhx_repeat_text" type="text" name="month_week2" value="1" /><select name="month_day2"><option value="1" selected >Mandag<option value="2">Tirsdag<option value="3">Onsdag<option value="4">Torsdag<option value="5">Fredag<option value="6">Lørdag<option value="0">Søndag</select>hver<input class="dhx_repeat_text" type="text" name="month_count2" value="1" />måned<br /> </div> <div style="display:none;" id="dhx_repeat_year"> <label>Gjenta:</label> <label><input class="dhx_repeat_radio" type="radio" name="year_type" value="d"/>på hver</label><input class="dhx_repeat_text" type="text" name="year_day" value="1" />dag i<select name="year_month"><option value="0" selected >Januar<option value="1">Februar<option value="2">Mars<option value="3">April<option value="4">Mai<option value="5">Juni<option value="6">Juli<option value="7">August<option value="8">September<option value="9">Oktober<option value="10">November<option value="11">Desember</select><br /> <label><input class="dhx_repeat_radio" type="radio" name="year_type" checked value="w"/>på</label><input class="dhx_repeat_text" type="text" name="year_week2" value="1" /><select name="year_day2"><option value="1" selected >Mandag<option value="2">Tirsdag<option value="3">Onsdag<option value="4">Torsdag<option value="5">Fredag<option value="6">Lørdag<option value="0">Søndag</select>i<select name="year_month2"><option value="0" selected >Januar<option value="1">Februar<option value="2">Mars<option value="3">April<option value="4">Mai<option value="5">Juni<option value="6">Juli<option value="7">August<option value="8">September<option value="9">Oktober<option value="10">November<option value="11">Desember</select><br /> </div> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_right"> <label><input class="dhx_repeat_radio" type="radio" name="end" checked/>Ingen sluttdato</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="end" />Etter</label><input class="dhx_repeat_text" type="text" name="occurences_count" value="1" />forekomst<br /> <label><input class="dhx_repeat_radio" type="radio" name="end" />Stop den</label><input class="dhx_repeat_date" type="text" name="date_of_end" value="'+scheduler.config.repeat_date_of_end+'" /><br /> </div> </form> </div> <div style="clear:both"> </div>';
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_nl.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_nl.js deleted file mode 100644 index 314e1b083ad..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_nl.js +++ /dev/null @@ -1,6 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.__recurring_template='<div class="dhx_form_repeat"> <form> <div class="dhx_repeat_left"> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="day" />Dagelijks</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="week"/>Wekelijks</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="month" checked />Maandelijks</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="year" />Jaarlijks</label> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_center"> <div style="display:none;" id="dhx_repeat_day"> <label><input class="dhx_repeat_radio" type="radio" name="day_type" value="d"/>Elke</label><input class="dhx_repeat_text" type="text" name="day_count" value="1" />dag(en)<br /> <label><input class="dhx_repeat_radio" type="radio" name="day_type" checked value="w"/>Elke werkdag</label> </div> <div style="display:none;" id="dhx_repeat_week"> Herhaal elke<input class="dhx_repeat_text" type="text" name="week_count" value="1" />week op de volgende dagen:<br /> <table class="dhx_repeat_days"> <tr> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="1" />Maandag</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="4" />Donderdag</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="2" />Dinsdag</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="5" />Vrijdag</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="3" />Woensdag</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="6" />Zaterdag</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="0" />Zondag</label><br /><br /> </td> </tr> </table> </div> <div id="dhx_repeat_month"> <label><input class="dhx_repeat_radio" type="radio" name="month_type" value="d"/>Herhaal</label><input class="dhx_repeat_text" type="text" name="month_day" value="1" />dag iedere<input class="dhx_repeat_text" type="text" name="month_count" value="1" />maanden<br /> <label><input class="dhx_repeat_radio" type="radio" name="month_type" checked value="w"/>Op</label><input class="dhx_repeat_text" type="text" name="month_week2" value="1" /><select name="month_day2"> <option value="1">Maandag <option value="2">Dinsdag <option value="3">Woensdag <option value="4">Donderdag <option value="5">Vrijdag <option value="6">Zaterdag <option value="0">Zondag </select>iedere<input class="dhx_repeat_text" type="text" name="month_count2" value="1" />maanden<br /> </div> <div style="display:none;" id="dhx_repeat_year"> <label><input class="dhx_repeat_radio" type="radio" name="year_type" value="d"/>Iedere</label><input class="dhx_repeat_text" type="text" name="year_day" value="1" />dag<select name="year_month"><option value="0" selected >Januari<option value="1">Februari<option value="2">Maart<option value="3">April<option value="4">Mei<option value="5">Juni<option value="6">Juli<option value="7">Augustus<option value="8">September<option value="9">Oktober<option value="10">November<option value="11">December</select>maand<br /> <label><input class="dhx_repeat_radio" type="radio" name="year_type" checked value="w"/>Op</label><input class="dhx_repeat_text" type="text" name="year_week2" value="1" /><select name="year_day2"><option value="1" selected >Maandag<option value="2">Dinsdag<option value="3">Woensdag<option value="4">Donderdag<option value="5">Vrijdag<option value="6">Zaterdag<option value="7">Zondag</select>van<select name="year_month2"><option value="0" selected >Januari<option value="1">Februari<option value="2">Maart<option value="3">April<option value="4">Mei<option value="5">Juni<option value="6">Juli<option value="7">Augustus<option value="8">September<option value="9">Oktober<option value="10">November<option value="11">December</select><br /> </div> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_right"> <label><input class="dhx_repeat_radio" type="radio" name="end" checked/>Geen eind datum</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="end" />Na</label><input class="dhx_repeat_text" type="text" name="occurences_count" value="1" />keren<br /> <label><input class="dhx_repeat_radio" type="radio" name="end" />Eindigd per</label><input class="dhx_repeat_date" type="text" name="date_of_end" value="'+scheduler.config.repeat_date_of_end+'" /><br /> </div> </form> </div> <div style="clear:both"> </div>'; - diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_pl.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_pl.js deleted file mode 100644 index f3f27bf4eb1..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_pl.js +++ /dev/null @@ -1,6 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.__recurring_template='<div class="dhx_form_repeat"> <form> <div class="dhx_repeat_left"> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="day" />Codziennie</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="week"/>Co tydzie�</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="month" checked />Co miesi�c</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="year" />Co rok</label> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_center"> <div style="display:none;" id="dhx_repeat_day"> <label><input class="dhx_repeat_radio" type="radio" name="day_type" value="d"/>Ka�dego</label><input class="dhx_repeat_text" type="text" name="day_count" value="1" />dnia<br /> <label><input class="dhx_repeat_radio" type="radio" name="day_type" checked value="w"/>Ka�dego dnia roboczego</label> </div> <div style="display:none;" id="dhx_repeat_week"> Powtarzaj ka�dego<input class="dhx_repeat_text" type="text" name="week_count" value="1" />tygodnia w dni:<br /> <table class="dhx_repeat_days"> <tr> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="1" />Poniedzia�ek</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="4" />Czwartek</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="2" />Wtorek</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="5" />Pi�tek</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="3" />�roda</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="6" />Sobota</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="0" />Niedziela</label><br /><br /> </td> </tr> </table> </div> <div id="dhx_repeat_month"> <label><input class="dhx_repeat_radio" type="radio" name="month_type" value="d"/>Powt�rz</label><input class="dhx_repeat_text" type="text" name="month_day" value="1" />dnia ka�dego<input class="dhx_repeat_text" type="text" name="month_count" value="1" />miesi�ca<br /> <label><input class="dhx_repeat_radio" type="radio" name="month_type" checked value="w"/>W</label><input class="dhx_repeat_text" type="text" name="month_week2" value="1" /><select name="month_day2"><option value="1" selected >Poniedzia�ek<option value="2">Wtorek<option value="3">�roda<option value="4">Czwartek<option value="5">Pi�tek<option value="6">Sobota<option value="0">Niedziela</select>ka�dego<input class="dhx_repeat_text" type="text" name="month_count2" value="1" />miesi�ca<br /> </div> <div style="display:none;" id="dhx_repeat_year"> <label><input class="dhx_repeat_radio" type="radio" name="year_type" value="d"/>Ka�dego</label><input class="dhx_repeat_text" type="text" name="year_day" value="1" />dnia miesi�ca<select name="year_month"><option value="0" selected >Stycznia<option value="1">Lutego<option value="2">Marca<option value="3">Kwietnia<option value="4">Maja<option value="5">Czerwca<option value="6">Lipca<option value="7">Sierpnia<option value="8">Wrze�nia<option value="9">Pa�dziernka<option value="10">Listopada<option value="11">Grudnia</select><br /> <label><input class="dhx_repeat_radio" type="radio" name="year_type" checked value="w"/>W</label><input class="dhx_repeat_text" type="text" name="year_week2" value="1" /><select name="year_day2"><option value="1" selected >Poniedzia�ek<option value="2">Wtorek<option value="3">�rod�<option value="4">Czwartek<option value="5">Pi�tek<option value="6">Sobot�<option value="7">Niedziel�</select>miesi�ca<select name="year_month2"><option value="0" selected >Stycznia<option value="1">Lutego<option value="2">Marca<option value="3">Kwietnia<option value="4">Maja<option value="5">Czerwca<option value="6">Lipca<option value="7">Sierpnia<option value="8">Wrze�nia<option value="9">Pa�dziernka<option value="10">Listopada<option value="11">Grudnia</select><br /> </div> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_right"> <label><input class="dhx_repeat_radio" type="radio" name="end" checked/>Bez daty ko�cowej</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="end" />Po</label><input class="dhx_repeat_text" type="text" name="occurences_count" value="1" />wyst�pieniu/ach<br /> <label><input class="dhx_repeat_radio" type="radio" name="end" />Zako�cz w</label><input class="dhx_repeat_date" type="text" name="date_of_end" value="'+scheduler.config.repeat_date_of_end+'" /><br /> </div> </form> </div> <div style="clear:both"> </div>'; - diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_pt.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_pt.js deleted file mode 100644 index c15c10cbea4..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_pt.js +++ /dev/null @@ -1,5 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.__recurring_template='<div class="dhx_form_repeat"> <form> <div class="dhx_repeat_left"> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="day" />Diário</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="week"/>Semanal</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="month" checked />Mensal</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="year" />Anual</label> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_center"> <div style="display:none;" id="dhx_repeat_day"> <label><input class="dhx_repeat_radio" type="radio" name="day_type" value="d"/>Cada</label><input class="dhx_repeat_text" type="text" name="day_count" value="1" />day<br /> <label><input class="dhx_repeat_radio" type="radio" name="day_type" checked value="w"/>Cada trabalho diário</label> </div> <div style="display:none;" id="dhx_repeat_week"> Repita cada<input class="dhx_repeat_text" type="text" name="week_count" value="1" />semana:<br /> <table class="dhx_repeat_days"> <tr> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="1" />Segunda</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="4" />Quinta</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="2" />Terça</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="5" />Sexta</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="3" />Quarta</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="6" />Sábado</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="0" />Domingo</label><br /><br /> </td> </tr> </table> </div> <div id="dhx_repeat_month"> <label><input class="dhx_repeat_radio" type="radio" name="month_type" value="d"/>Repetir</label><input class="dhx_repeat_text" type="text" name="month_day" value="1" />todo dia<input class="dhx_repeat_text" type="text" name="month_count" value="1" />mês<br /> <label><input class="dhx_repeat_radio" type="radio" name="month_type" checked value="w"/>Em</label><input class="dhx_repeat_text" type="text" name="month_week2" value="1" /><select name="month_day2"><option value="1" selected >Segunda<option value="2">Terça<option value="3">Quarta<option value="4">Quinta<option value="5">Sexta<option value="6">Sabado<option value="0">Domingo</select>todo<input class="dhx_repeat_text" type="text" name="month_count2" value="1" />mês<br /> </div> <div style="display:none;" id="dhx_repeat_year"> <label><input class="dhx_repeat_radio" type="radio" name="year_type" value="d"/>Todo</label><input class="dhx_repeat_text" type="text" name="year_day" value="1" />dia<select name="year_month"><option value="0" selected >Janeiro<option value="1">Fevereiro<option value="2">Março<option value="3">Abril<option value="4">Maio<option value="5">Junho<option value="6">Julho<option value="7">Agosto<option value="8">Setembro<option value="9">Outubro<option value="10">Novembro<option value="11">Dezembro</select>mês<br /> <label><input class="dhx_repeat_radio" type="radio" name="year_type" checked value="w"/>Em</label><input class="dhx_repeat_text" type="text" name="year_week2" value="1" /><select name="year_day2"><option value="1" selected >Segunda<option value="2">Terça<option value="3">Quarta<option value="4">Quinta<option value="5">Sexta<option value="6">Sabado<option value="7">Domingo</select>of<select name="year_month2"><option value="0" selected >Janeiro<option value="1">Fevereiro<option value="2">Março<option value="3">Abril<option value="4">Maio<option value="5">Junho<option value="6">Julho<option value="7">Agosto<option value="8">Setembro<option value="9">Outubro<option value="10">Novembro<option value="11">Dezembro</select><br /> </div> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_right"> <label><input class="dhx_repeat_radio" type="radio" name="end" checked/>Sem data final</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="end" />Depois</label><input class="dhx_repeat_text" type="text" name="occurences_count" value="1" />ocorrências<br /> <label><input class="dhx_repeat_radio" type="radio" name="end" />Fim</label><input class="dhx_repeat_date" type="text" name="date_of_end" value="'+scheduler.config.repeat_date_of_end+'" /><br /> </div> </form> </div> <div style="clear:both"> </div>';
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_ru.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_ru.js deleted file mode 100644 index 0bff7bde13a..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_ru.js +++ /dev/null @@ -1,6 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.__recurring_template='<div class="dhx_form_repeat"> <form> <div class="dhx_repeat_left"> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="day" />День</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="week"/>Неделя</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="month" checked />Месяц</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="year" />Год</label> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_center"> <div style="display:none;" id="dhx_repeat_day"> <label><input class="dhx_repeat_radio" type="radio" name="day_type" value="d"/>Каждый</label><input class="dhx_repeat_text" type="text" name="day_count" value="1" />день<br /> <label><input class="dhx_repeat_radio" type="radio" name="day_type" checked value="w"/>Каждый рабочий день</label> </div> <div style="display:none;" id="dhx_repeat_week"> Повторять каждую<input class="dhx_repeat_text" type="text" name="week_count" value="1" />неделю , в:<br /> <table class="dhx_repeat_days"> <tr> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="1" />Понедельник</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="4" />Четверг</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="2" />Вторник</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="5" />Пятницу</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="3" />Среду </label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="6" />Субботу</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="0" />Воскресенье</label><br /><br /> </td> </tr> </table> </div> <div id="dhx_repeat_month"> <label><input class="dhx_repeat_radio" type="radio" name="month_type" value="d"/>Повторять</label><input class="dhx_repeat_text" type="text" name="month_day" value="1" /> числа каждый <input class="dhx_repeat_text" type="text" name="month_count" value="1" />месяц<br /> <label><input class="dhx_repeat_radio" type="radio" name="month_type" checked value="w"/></label><input class="dhx_repeat_text" type="text" name="month_week2" value="1" /><select name="month_day2"><option value="1" selected >Понедельник<option value="2">Вторник<option value="3">Среда<option value="4">Четверг<option value="5">Пятница<option value="6">Суббота<option value="0">Воскресенье</select>каждый <input class="dhx_repeat_text" type="text" name="month_count2" value="1" />месяц<br /> </div> <div style="display:none;" id="dhx_repeat_year"> <label><input class="dhx_repeat_radio" type="radio" name="year_type" value="d"/></label><input class="dhx_repeat_text" type="text" name="year_day" value="1" />день<select name="year_month"><option value="0" selected >Января<option value="1">Февраля<option value="2">Марта<option value="3">Апреля<option value="4">Мая<option value="5">Июня<option value="6">Июля<option value="7">Августа<option value="8">Сентября<option value="9">Октября<option value="10">Ноября<option value="11">Декабря</select><br /> <label><input class="dhx_repeat_radio" type="radio" name="year_type" checked value="w"/></label><input class="dhx_repeat_text" type="text" name="year_week2" value="1" /><select name="year_day2"><option value="1" selected >Понедельник<option value="2">Вторник<option value="3">Среда<option value="4">Четверг<option value="5">Пятница<option value="6">Суббота<option value="0">Воскресенье</select><select name="year_month2"><option value="0" selected >Января<option value="1">Февраля<option value="2">Марта<option value="3">Апреля<option value="4">Мая<option value="5">Июня<option value="6">Июля<option value="7">Августа<option value="8">Сентября<option value="9">Октября<option value="10">Ноября<option value="11">Декабря</select><br /> </div> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_right"> <label><input class="dhx_repeat_radio" type="radio" name="end" checked/>Без даты окончания</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="end" /></label><input class="dhx_repeat_text" type="text" name="occurences_count" value="1" />повторений<br /> <label><input class="dhx_repeat_radio" type="radio" name="end" />До </label><input class="dhx_repeat_date" type="text" name="date_of_end" value="'+scheduler.config.repeat_date_of_end+'" /><br /> </div> </form> </div> <div style="clear:both"> </div>'; - diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_sv.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_sv.js deleted file mode 100644 index bb16adafb12..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_sv.js +++ /dev/null @@ -1,5 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.__recurring_template='<div class="dhx_form_repeat"> <form> <div class="dhx_repeat_left"> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="day" />Dagligen</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="week"/>Veckovis</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="month" checked />Månadsvis</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="year" />Årligen</label> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_center"> <div style="display:none;" id="dhx_repeat_day"> <label><input class="dhx_repeat_radio" type="radio" name="day_type" value="d"/>Var</label><input class="dhx_repeat_text" type="text" name="day_count" value="1" />dag<br /> <label><input class="dhx_repeat_radio" type="radio" name="day_type" checked value="w"/>Varje arbetsdag</label> </div> <div style="display:none;" id="dhx_repeat_week"> Upprepa var<input class="dhx_repeat_text" type="text" name="week_count" value="1" />vecka dessa dagar:<br /> <table class="dhx_repeat_days"> <tr> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="1" />Måndag</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="4" />Tisdag</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="2" />Torsdag</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="5" />Fredag</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="3" />Onsdag</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="6" />Lördag</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="0" />Söndag</label><br /><br /> </td> </tr> </table> </div> <div id="dhx_repeat_month"> <label><input class="dhx_repeat_radio" type="radio" name="month_type" value="d"/>Upprepa</label><input class="dhx_repeat_text" type="text" name="month_day" value="1" />dagen var<input class="dhx_repeat_text" type="text" name="month_count" value="1" />månad<br /> <label><input class="dhx_repeat_radio" type="radio" name="month_type" checked value="w"/>Den</label><input class="dhx_repeat_text" type="text" name="month_week2" value="1" /><select name="month_day2"><option value="1" selected >måndagen<option value="2">tisdagen<option value="3">onsdagen<option value="4">torsdagen<option value="5">fredagen<option value="6">lördagen<option value="0">söndagen</select>var<input class="dhx_repeat_text" type="text" name="month_count2" value="1" />månad<br /> </div> <div style="display:none;" id="dhx_repeat_year"> <label><input class="dhx_repeat_radio" type="radio" name="year_type" value="d"/>Varje</label><input class="dhx_repeat_text" type="text" name="year_day" value="1" />dag i<select name="year_month"><option value="0" selected >Januari<option value="1">Februari<option value="2">Mars<option value="3">April<option value="4">Maj<option value="5">Juni<option value="6">Juli<option value="7">Augusti<option value="8">September<option value="9">Oktober<option value="10">November<option value="11">December</select>månad<br /> <label><input class="dhx_repeat_radio" type="radio" name="year_type" checked value="w"/>Den</label><input class="dhx_repeat_text" type="text" name="year_week2" value="1" /><select name="year_day2"><option value="1" selected >måndagen<option value="2">tisdagen<option value="3">onsdagen<option value="4">torsdagen<option value="5">fredagen<option value="6">lördagen<option value="7">söndagen</select>i<select name="year_month2"><option value="0" selected >Januari<option value="1">Februari<option value="2">Mars<option value="3">April<option value="4">Maj<option value="5">Juni<option value="6">Juli<option value="7">Augusti<option value="8">September<option value="9">Oktober<option value="10">November<option value="11">December</select><br /> </div> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_right"> <label><input class="dhx_repeat_radio" type="radio" name="end" checked/>Inget slutdatum</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="end" />Efter</label><input class="dhx_repeat_text" type="text" name="occurences_count" value="1" />upprepningar<br /> <label><input class="dhx_repeat_radio" type="radio" name="end" />Sluta efter</label><input class="dhx_repeat_date" type="text" name="date_of_end" value="'+scheduler.config.repeat_date_of_end+'" /><br /> </div> </form> </div> <div style="clear:both"> </div>';
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_ua.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_ua.js deleted file mode 100644 index fbe032f3e32..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_recurring_ua.js +++ /dev/null @@ -1,6 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.__recurring_template='<div class="dhx_form_repeat"> <form> <div class="dhx_repeat_left"> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="day" />День</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="week"/>Тиждень</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="month" checked />Місяць</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="year" />Рік</label> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_center"> <div style="display:none;" id="dhx_repeat_day"> <label><input class="dhx_repeat_radio" type="radio" name="day_type" value="d"/>Кожний</label><input class="dhx_repeat_text" type="text" name="day_count" value="1" />день<br /> <label><input class="dhx_repeat_radio" type="radio" name="day_type" checked value="w"/>Кожний робочий день</label> </div> <div style="display:none;" id="dhx_repeat_week"> Повторювати кожен<input class="dhx_repeat_text" type="text" name="week_count" value="1" />тиждень , по:<br /> <table class="dhx_repeat_days"> <tr> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="1" />Понеділкам</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="4" />Четвергам</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="2" />Вівторкам</label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="5" />П''ятницям</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="3" />Середам </label><br /> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="6" />Суботам</label> </td> <td> <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="0" />Неділям</label><br /><br /> </td> </tr> </table> </div> <div id="dhx_repeat_month"> <label><input class="dhx_repeat_radio" type="radio" name="month_type" value="d"/>Повторювати</label><input class="dhx_repeat_text" type="text" name="month_day" value="1" /> числа кожний <input class="dhx_repeat_text" type="text" name="month_count" value="1" />місяць<br /> <label><input class="dhx_repeat_radio" type="radio" name="month_type" checked value="w"/></label><input class="dhx_repeat_text" type="text" name="month_week2" value="1" /><select name="month_day2"><option value="1" selected >Понеділок<option value="2">Вівторок<option value="3">Середа<option value="4">Четвер<option value="5">П''ятниця<option value="6">Субота<option value="0">Неділя</select>кожен <input class="dhx_repeat_text" type="text" name="month_count2" value="1" />місяць<br /> </div> <div style="display:none;" id="dhx_repeat_year"> <label><input class="dhx_repeat_radio" type="radio" name="year_type" value="d"/></label><input class="dhx_repeat_text" type="text" name="year_day" value="1" />день<select name="year_month"><option value="0" selected >січня<option value="1">лютого<option value="2">березня<option value="3">квітня<option value="4">травня<option value="5">червня<option value="6">липня<option value="7">серпня<option value="8">вересня<option value="9">жовтня<option value="10">листопада<option value="11">грудня</select><br /> <label><input class="dhx_repeat_radio" type="radio" name="year_type" checked value="w"/></label><input class="dhx_repeat_text" type="text" name="year_week2" value="1" /><select name="year_day2"><option value="1" selected >понеділок<option value="2">вівторок<option value="3">середа<option value="4">четвер<option value="5">п''ятниця<option value="6">субота<option value="0">неділя</select><select name="year_month2"><option value="0" selected >січня<option value="1">лютого<option value="2">березня<option value="3">квітня<option value="4">березня<option value="5">червня<option value="6">липня<option value="7">серпня<option value="8">вересня<option value="9">жовтня<option value="10">листопада<option value="11">грудня</select><br /> </div> </div> <div class="dhx_repeat_divider"></div> <div class="dhx_repeat_right"> <label><input class="dhx_repeat_radio" type="radio" name="end" checked/>Без дати закінчення</label><br /> <label><input class="dhx_repeat_radio" type="radio" name="end" /></label><input class="dhx_repeat_text" type="text" name="occurences_count" value="1" />повторень<br /> <label><input class="dhx_repeat_radio" type="radio" name="end" />До </label><input class="dhx_repeat_date" type="text" name="date_of_end" value="'+scheduler.config.repeat_date_of_end+'" /><br /> </div> </form> </div> <div style="clear:both"> </div>';
-
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_ru.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_ru.js deleted file mode 100644 index f199ae683e4..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_ru.js +++ /dev/null @@ -1,45 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.locale={
- date:{
- month_full:["Январь", "Февраль", "Март", "Апрель", "Maй", "Июнь", "Июль", "Август", "Сентябрь", "Oктябрь", "Ноябрь", "Декабрь"],
- month_short:["Янв", "Фев", "Maр", "Aпр", "Maй", "Июн", "Июл", "Aвг", "Сен", "Окт", "Ноя", "Дек"],
- day_full:[ "Воскресенье", "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота"],
- day_short:["Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"]
- },
- labels:{
- dhx_cal_today_button: "Сегодня",
- day_tab:"День",
- week_tab:"Неделя",
- month_tab:"Месяц",
- new_event:"Новое событие",
- icon_save:"Сохранить",
- icon_cancel:"Отменить",
- icon_details:"Детали",
- icon_edit:"Изменить",
- icon_delete:"Удалить",
- confirm_closing:"",//Ваши изменения будут потеряны, продолжить?
- confirm_deleting:"Событие будет удалено безвозвратно, продолжить?",
- section_description:"Описание",
- section_time:"Период времени",
- full_day:"Весь день",
-
- confirm_recurring:"Вы хотите изменить всю серию повторяющихся событий?",
- section_recurring:"Повторение",
- button_recurring:"Отключено",
- button_recurring_open:"Включено",
-
- /*agenda view extension*/
- agenda_tab:"Список",
- date:"Дата",
- description:"Описание",
-
- /*year view extension*/
- year_tab:"Год",
-
- /*week agenda view extension*/
- week_agenda_tab: "Список"
- }
-}
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_si.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_si.js deleted file mode 100644 index 1225b6ece32..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_si.js +++ /dev/null @@ -1,47 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.locale={
- date:{
- month_full:["Januar", "Februar", "Marec", "April", "Maj", "Junij", "Julij", "Avgust", "September", "Oktober", "November", "December"],
- month_short:["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Avg", "Sep", "Okt", "Nov", "Dec"],
- day_full:["Nedelja", "Ponedeljek", "Torek", "Sreda", "Èetrtek", "Petek", "Sobota"],
- day_short:["Ne", "Po", "To", "Sre", "Èe", "Pe", "So"]
- },
- labels:{
- dhx_cal_today_button:"Danes",
- day_tab:"Dan",
- week_tab:"Teden",
- month_tab:"Mesec",
- new_event:"Nov dogodek",
- icon_save:"Shrani",
- icon_cancel:"Preklièi",
- icon_details:"Podrobnosti",
- icon_edit:"Uredi",
- icon_delete:"Zbriši",
- confirm_closing:"",//Vaše spremembe bodo izgubljene, želite nadaljevati ?
- confirm_deleting:"Dogodek bo izbrisan trajno, želite nadaljevati?",
- section_description:"Opis",
- section_time:"Èasovno obdobje",
- full_day:"Ves dan",
-
- /*recurring events*/
- confirm_recurring:"Ali želite urediti celoten nabor ponavljajoèih dogodkov?",
- section_recurring:"Ponovi dogodek",
- button_recurring:"Onemogoèi",
- button_recurring_open:"Omogoèi",
-
- /*agenda view extension*/
- agenda_tab:"Agenda",
- date:"Datum",
- description:"Opis",
-
- /*year view extension*/
- year_tab:"Leto",
-
- /*week agenda view extension*/
- week_agenda_tab: "Agenda"
- }
-}
-
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_sv.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_sv.js deleted file mode 100644 index bcb120831e9..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_sv.js +++ /dev/null @@ -1,52 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -/*
-Copyright DHTMLX LTD. http://www.dhtmlx.com
-You allowed to use this component or parts of it under GPL terms
-To use it on other terms please contact us at sales@dhtmlx.com
-*/
-
-scheduler.locale={
- date:{
- month_full:["Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December"],
- month_short:["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"],
- day_full:["Söndag", "Måndag", "Tisdag", "Onsdag", "Torsdag", "Fredag", "Lördag"],
- day_short:["Sön", "Mån", "Tis", "Ons", "Tor", "Fre", "Lör"]
- },
- labels:{
- dhx_cal_today_button:"Idag",
- day_tab:"Dag",
- week_tab:"Vecka",
- month_tab:"Månad",
- new_event:"Ny händelse",
- icon_save:"Spara",
- icon_cancel:"Ångra",
- icon_details:"Detajer",
- icon_edit:"Ändra",
- icon_delete:"Ta bort",
- confirm_closing:"",//Dina förändingar kommer gå förlorade, är du säker?
- confirm_deleting:"Är du säker på att du vill ta bort händelsen permanent?",
- section_description:"Beskrivning",
- section_time:"Tid",
- full_day:"Hela dagen",
-
- /*recurring events*/
- confirm_recurring:"Vill du redigera hela serien med repeterande händelser?",
- section_recurring:"Upprepa händelse",
- button_recurring:"Inaktiverat",
- button_recurring_open:"Aktiverat",
-
- /*agenda view extension*/
- agenda_tab:"Dagordning",
- date:"Datum",
- description:"Beskrivning",
-
- /*year view extension*/
- year_tab:"År",
-
- /*week agenda view extension*/
- week_agenda_tab: "Dagordning"
- }
-}
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_tr.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_tr.js deleted file mode 100644 index 5548a6f0dfc..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_tr.js +++ /dev/null @@ -1,47 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.locale={
- date:{
- month_full:["Ocak", "Þubat", "Mart", "Nisan", "Mayýs", "Haziran", "Temmuz", "Aðustos", "Eylül", "Ekim", "Kasým", "Aralýk"],
- month_short:["Oca", "Þub", "Mar", "Nis", "May", "Haz", "Tem", "Aðu", "Eyl", "Eki", "Kas", "Ara"],
- day_full:["Pazar", "Pazartes,", "Salý", "Çarþamba", "Perþembe", "Cuma", "Cumartesi"],
- day_short:["Paz", "Pts", "Sal", "Çar", "Per", "Cum", "Cts"]
- },
- labels:{
- dhx_cal_today_button:"Bugün",
- day_tab:"Gün",
- week_tab:"Hafta",
- month_tab:"Ay",
- new_event:"Uygun",
- icon_save:"Kaydet",
- icon_cancel:"Ýptal",
- icon_details:"Detaylar",
- icon_edit:"Düzenle",
- icon_delete:"Sil",
- confirm_closing:"",//Your changes will be lost, are your sure ?
- confirm_deleting:"Etkinlik silinecek, devam?",
- section_description:"Açýklama",
- section_time:"Zaman aralýðý",
- full_day:"Tam gün",
-
- /*recurring events*/
- confirm_recurring:"Tüm tekrar eden etkinlikler silinecek, devam?",
- section_recurring:"Etkinliði tekrarla",
- button_recurring:"Pasif",
- button_recurring_open:"Aktif",
-
- /*agenda view extension*/
- agenda_tab:"Ajanda",
- date:"Tarih",
- description:"Açýklama",
-
- /*year view extension*/
- year_tab:"Yýl",
-
- /*week agenda view extension*/
- week_agenda_tab: "Ajanda"
- }
-}
-
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_ua.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_ua.js deleted file mode 100644 index 4009969d298..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/locale_ua.js +++ /dev/null @@ -1,47 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.locale={
- date:{
- month_full:["Січень", "Лютий", "Березень", "Квітень", "Травень", "Червень", "Липень", "Серпень", "Вересень", "Жовтень", "Листопад", "Грудень"],
- month_short:["Січ", "Лют", "Бер", "Кві", "Тра", "Чер", "Лип", "Сер", "Вер", "Жов", "Лис", "Гру"],
- day_full:["Неділя", "Понеділок", "Вівторок", "Середа", "Четвер", "П'ятниця", "Субота"],
- day_short:["Нед", "Пон", "Вів", "Сер", "Чет", "Птн", "Суб"]
- },
- labels:{
- dhx_cal_today_button:"Сьогодні",
- day_tab:"День",
- week_tab:"Тиждень",
- month_tab:"Місяць",
- new_event:"Нова подія",
- icon_save:"Зберегти",
- icon_cancel:"Відміна",
- icon_details:"Деталі",
- icon_edit:"Редагувати",
- icon_delete:"Вилучити",
- confirm_closing:"",//Ваші зміни втратяться. Ви впевнені ?
- confirm_deleting:"Подія вилучиться назавжди. Ви впевнені?",
- section_description:"Опис",
- section_time:"Часовий проміжок",
- full_day:"Весь день",
-
- /*recurring events*/
- confirm_recurring:"Хочете редагувати весь перелік повторюваних подій?",
- section_recurring:"Повторювана подія",
- button_recurring:"Відключено",
- button_recurring_open:"Включено",
-
- /*agenda view extension*/
- agenda_tab:"Перелік",
- date:"Дата",
- description:"Опис",
-
- /*year view extension*/
- year_tab:"Рік",
-
- /*week agenda view extension*/
- week_agenda_tab: "Перелік"
- }
-}
-
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/mobile.css b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/mobile.css deleted file mode 100644 index 8f543f20fee..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/mobile.css +++ /dev/null @@ -1,380 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -/**Toolbar**/
-
-.dhx_schedulerbar{
- background: -webkit-gradient(linear, left top, left bottom,from(#d7d7d7), to(#b7b7b7));
- background: -moz-linear-gradient(top, #d7d7d7, #b7b7b7);
-}
-.dhx_el_button input {
- border-radius:4px;
- -moz-border-radius:4px;
- -webkit-border-radius:4px;
- background: -webkit-gradient(linear, left top, left bottom, from(#9dbcc7),color-stop(0.4,#80a9b8),color-stop(0.6,#6799aa),to(#4f899d));
- background: -moz-linear-gradient(top, #9dbcc7, #518a9e);
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.6);
- font-size: 14px;
- color: #ffffff;
- padding: 0px 10px;
- border:1px solid #636363;
- -moz-box-shadow: 0px 1px #ffffff;
- -webkit-box-shadow:0px 1px #ffffff;
- box-shadow: 0px 1px #ffffff;
-}
-.add .dhx_el_button input{
- background-image: url(./imgs_mobile/add.png),-webkit-gradient(linear, left top, left bottom, from(#9dbcc7),color-stop(0.4,#80a9b8),color-stop(0.6,#6799aa),to(#4f899d));
- background-image: url(./imgs_mobile/add.png),-moz-linear-gradient(top, #9dbcc7, #518a9e);
- background-position: center center;
- background-repeat:no-repeat;
- width:34px;
-}
-.dhx_schedulerbar .dhx_el_segmented{
- border-radius:4px;
- -moz-border-radius:4px;
- -webkit-border-radius:4px;
- float:none !important;
- border:1px solid #636363;
- -moz-box-shadow: 0px 1px #ffffff;
- -webkit-box-shadow:0px 1px #ffffff;
- height:32px;
-}
-
-
-.dhx_schedulerbar .dhx_el_segmented .segment_0,.dhx_schedulerbar .dhx_el_segmented .segment_1, .dhx_schedulerbar .dhx_el_segmented .segment_N {
- background: -webkit-gradient(linear, left top, left bottom, from(#f8f8f8),color-stop(0.3,#eeeeee),color-stop(0.6,#dcdcdc),to(#d5d5d5));
- background: -moz-linear-gradient(top, #f8f8f8, #d5d5d5);
-
-}
-.dhx_schedulerbar .dhx_el_segmented .selected.segment_0 ,.dhx_schedulerbar .dhx_el_segmented .selected.segment_1, .dhx_schedulerbar .dhx_el_segmented .selected.segment_N {
- background: -webkit-gradient(linear, left top, left bottom, from(#9dbcc7),color-stop(0.4,#80a9b8),color-stop(0.6,#6799aa),to(#4f899d));
- background: -moz-linear-gradient(top, #9dbcc7, #518a9e);
-}
-.dhx_el_segmented .segment_N, .dhx_el_segmented .selected.segment_N {
- border-left: 0;
-}
-.dhx_schedulerbar .dhx_el_segmented div {
- text-shadow: 0 1px 0 #ffffff;
- font-size: 14px;
- color: #757575;
- border:0px;
- height:30px;
-}
-.dhx_schedulerbar .dhx_el_segmented div.selected {
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.6);
- color: #ffffff;
- height:30px;
-}
-
-
-.dhx_schedulerbar .dhx_el_segmented .segment_0{
- -webkit-border-top-left-radius: 4px;
- -webkit-border-bottom-left-radius: 4px;
- -moz-border-radius-topleft: 4px;
- -moz-border-radius-bottomleft: 4px;
- border-top-left-radius: 4px;
- border-bottom-left-radius: 4px;
- padding:0 11px 0 14px;
-}
-.dhx_schedulerbar .dhx_el_segmented .segment_1{
- border-left:1px solid #ababab;
- border-right:1px solid #ababab;
- padding:0 11px;
-}
-.dhx_schedulerbar .dhx_el_segmented .segment_N{
- -webkit-border-top-right-radius: 4px;
- -webkit-border-bottom-right-radius: 4px;
- -moz-border-radius-topright: 4px;
- -moz-border-radius-bottomright: 4px;
- border-top-right-radius: 4px;
- border-bottom-right-radius: 4px;
- padding:0 14px 0 11px;
-}
-
-
-/**Day Events**/
-
-/*scale:*/
-/*scale item container*/
-.dhx_dayevents_scale_item {
- -moz-user-select:-moz-none;
- border-bottom:1px solid #D4D4D4;
- color:#303030;
- font-family:"Helvetica World","HelveticaNeue","Helvetica Neue","HelveticaNeueRoman","Helvetica","Tahoma","Geneva","Arial",sans-serif;
- white-space:nowrap;
-}
-/*hour container*/
-.dhx_dayevents_scale_hour{
- float: left;
- text-align: center;
- font-size: 16px;
- vertical-align:middle;
- font-weight: bold;
- /*background-color:#E1E6FF;*/
- /*background-color: #EEE;*/
-}
-/*scale items*/
-.dhx_dayevents_scale_top, .dhx_dayevents_scale_bottom {
- font-size: 10px;
- float: left;
- text-align:center;
-}
-.dhx_dayevents_scale_top{
- border-bottom:1px dotted #D4D4D4;
-}
-/*minutes container*/
-.dhx_dayevents_scale_minute{
- /*background-color:#E1E6FF;*/
- background-color: #EEE;
- border-right:1px dotted #D4D4D4;
- float:left;
-}
-/*event container*/
-.dhx_dayevents_scale_event {
- float:left;
-}
-/*event:*/
-.dhx_dayevents_event_item{
- position:absolute;
- border-radius: 4px;
- -moz-border-radius: 4px;
- -webkit-border-radius:4px;
- font-size: 12px;
- background-color: #e6f8ff;
- border:1px solid #78a5b4;
- font-family:"Helvetica World","HelveticaNeue","Helvetica Neue","HelveticaNeueRoman","Helvetica","Tahoma","Geneva","Arial",sans-serif;
- /*-moz-box-shadow: 1px 1px 1px #888;
- -webkit-box-shadow: 1px 1px 1px #888;
- box-shadow: 1px 1px 1px #888;*/
-}
-/*toolbar*/
-.dhx_topbar{
- font-size:18px;
- background: -webkit-gradient(linear, left top, left bottom, from(#fdfdfd),color-stop(0.5, #ededed), to(#c8c8c8)) !important;
- background: -moz-linear-gradient(top, #fdfdfd, #c8c8c8) !important;
-}
-
-
-/**List view**/
-.dhx_list_events_item{
- position:relative;
- background-color:#ffffff;
-}
-.dhx_list_events_item .dhx_day_title{
- height:16px;
- line-height:16px;
- width:75px;
- position:absolute;
- left:1px;
- top:0px;
- /*background-color: #d23530;*/
- background: #518A9E;
- border-radius: 2px;
- text-align:center;
- -moz-border-radius: 2px;
- -moz-box-shadow: 1px 1px 1px #1c2329;
- -webkit-box-shadow: 1px 1px 1px #1c2329;
- box-shadow: 1px 1px 1px #1c2329;
- -webkit-border-radius:2px;
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.6);
- font-size: 14px;
- color: #ffffff;
-}
-.dhx_list_events_item .dhx_event_marker{
- display:inline-block;
- margin-left:5px;
- margin-top:5px;
- height:10px;
- /*line-height:22px;*/
- width:10px;
- border-radius: 6px;
- -moz-border-radius: 6px;
- -webkit-border-radius:6px;
- background-color: #e6f8ff;
- border:1px solid #78a5b4;
- vertical-align:top;
-}
-
-.dhx_list_events_item .dhx_event_time{
- display:inline-block;
- width:70px;
- font-size:16px;
- padding-top:8px;
-}
-
-.dhx_list_events_item .dhx_event_text{
- display:inline-block;
- padding-left:4px;
- overflow:hidden;
- height:22px;
- vertical-align:top;
- /*width:208px;*/
- white-space:nowrap;
-}
-
-
-/**Month events**/
-
-/*calendar*/
-.dhx_cal_day_num.dhx_cal_selected_day, .dhx_cal_day_num.dhx_cal_current_day.dhx_cal_selected_day{
- background: -webkit-gradient(linear, left top, left bottom, from(#a0bfc9), to(#4f899d)) !important;
- background: -moz-linear-gradient(top, #a0bfc9, #4f899d);
- text-shadow:0 1px 0 rgba(0, 0, 0, 0.6);
-}
-.dhx_cal_day_num.dhx_cal_current_day {
- background: -webkit-gradient(linear, left top, left bottom, from(#bababa), to(#eeeeee)) !important;
- background: -moz-linear-gradient(top, #bababa, #eeeeee);
- border-color:#636363;
- text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
-}
-.dhx_cal_day_num.dhx_cal_selected_day span{
- color:#ffffff;
-}
-.dhx_cal_day_num{
- position:relative;
-}
-.dhx_cal_day_num .day_with_events{
- position:absolute;
- bottom:0px;
- right:0px;
- background-image:url(./imgs_mobile/event.png);
- background-repeat:no-repeat;
- width:12px;
- height:12px;
-}
-.dhx_cal_day_num.dhx_cal_selected_day .day_with_events{
- background-image:url(./imgs_mobile/event_focus.png);
-}
-.dhx_cal_prev_button div {
- background-image:url("./imgs_mobile/arrow_left.png");
- background-position:0;
- width:28px;
- height:29px;
- top:6px;
-}
-.dhx_cal_next_button div {
- background-image:url("./imgs_mobile/arrow_right.png");
- background-position:0;
- width:28px;
- height:29px;
- top:6px;
-}
-/*events list*/
-.dhx_list_day_events_item{
- background-color:#ffffff;
-}
-.dhx_list_day_events_item .dhx_event_marker{
- display:inline-block;
- margin-top:16px;
- margin-left:5px;
- height:10px;
- width:10px;
- border-radius: 6px;
- -moz-border-radius: 6px;
- -webkit-border-radius:6px;
- background-color: #e6f8ff;
- border:1px solid #78a5b4;
-}
-.dhx_list_day_events_item .dhx_event_time{
- display:inline-block;
- width:auto;
- height:42px;
- line-height:42px;
- padding-left:5px;
-}
-
-.dhx_list_day_events_item .dhx_event_text{
- display:inline-block;
- padding-left:10px;
- line-height:42px;
-}
-
-/*No events BG*/
-.no_events{
- background-image:url(./imgs_mobile/noevents.png);
- background-repeat:no-repeat;
-}
-
-
-/**Selected event view**/
-.selected_event{
- width: 290px;
- margin:5px;
- background-color: #e6f8ff;
- border:1px solid #78a5b4;
- border-radius: 5px;
- -moz-border-radius: 5px;
- -webkit-border-radius:5px;
- padding:3px 6px;
-}
-.selected_event .event_title{
- font-weight:bold
-}
-.selected_event .event_text{
- font-size:12px;
-}
-/*toolbar*/
-/*
-.dhx_topbar.single_event{
- background: -webkit-gradient(linear, left top, left bottom,from(#d6d6d6), to(#b8b8b8)) !important;
- background: -moz-linear-gradient(top, #d6d6d6, #b8b8b8) !important;
-}
-*/
-
-
-/**Editing form**/
-.dhx_el_formbutton.delete .dhx_inp_form_button{
- background: -webkit-gradient(linear, left top, left bottom, from(#f8f8f8), to(#d4d4d4));
- background: -moz-linear-gradient(top, #f8f8f8, #d4d4d4);
- border-top:1px solid #888;
- font-size:18px;
- -webkit-border-radius: 5px;
- -moz-border-radius: 5px;
- border-radius: 5px;
- border:1px solid #8f8f8f;
- color:#606060;
- text-shadow: 0 1px 0 #ffffff;
- height:40px;
-
-}
-.dhx_el_button.cancel input{
- background: -webkit-gradient(linear, left top, left bottom, from(#f8f8f8),color-stop(0.3,#eeeeee),color-stop(0.6,#dcdcdc),to(#d5d5d5));
- background: -moz-linear-gradient(top, #f8f8f8, #d5d5d5);
- color:#6E6E6E;
- text-shadow:0 1px 0 #FFFFFF
-}
-.invalid .dhx_inp_text_border{
- border-color:#cc0000;
-}
-.invalid .dhx_inp_list {
- color:#cc0000;
-}
-
-/*confirm*/
-
-
-
-
-.dhx_win_body{
- font-weight:bold;
- color:#3f2317;
- text-shadow: 0px 1px #e2d3b6;
- background:url(../images/confirm_main_bgr.png);
-}
-.dhx_win_body .dhx_view{
- background:transparent;
-}
-.dhx_el_bigbutton input, .dhx_el_bigroundbutton input{
- height:40px;
- line-height:40px;
-}
-.dhx_el_bigroundbutton input, .alert .dhx_el_bigbutton input{
- background: #83a41f;
- background: -webkit-gradient(linear, left top, left bottom, from(#9dbcc7),color-stop(0.4,#80a9b8),color-stop(0.6,#6799aa),to(#4f899d));
- background: -moz-linear-gradient(top, #9dbcc7, #518a9e);
-}
-.dhx_el_bigroundbutton{
- padding-top:0px;
-}
-
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/mobile.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/mobile.js deleted file mode 100644 index 4455ef939be..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/mobile.js +++ /dev/null @@ -1,626 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -if (!window.scheduler){
- window.scheduler = {
- config:{
- },
- templates:{
- },
- xy:{
- },
- locale:{
- }
- };
-}
-/*Locale*/
-if(!scheduler.locale)
- scheduler.locale = {};
-scheduler.locale.labels = {
- list_tab : "List",
- day_tab : "Day",
- month_tab : "Month",
- icon_today : "Today",
- icon_save : "Save",
- icon_delete : "Delete event",
- icon_cancel : "Cancel",
- icon_edit : "Edit",
- icon_back : "Back",
- icon_close : "Close form",
- icon_yes : "Yes",
- icon_no : "No",
- confirm_closing : "Your changes will be lost, are your sure ?",
- confirm_deleting : "Event will be deleted permanently, are you sure?",
- label_event:"Event",
- label_start:"Start",
- label_end:"End",
- label_details:"Notes",
- label_from: "from",
- label_to: "to"
-};
-
-/*Config*/
-
-/*date*/
-
-scheduler.config = {
- init_date : new Date(),
- form_date : "%d-%m-%Y %H:%i",
- xml_date : "%Y-%m-%d %H:%i",
- item_date : "%d.%m.%Y",
- header_date : "%d.%m.%Y",
- hour_date : "%H:%i",
- scale_hour : "%H",
- calendar_date : "%F %Y"
-};
-
-scheduler.config.form_rules = {
- end_date:function(value,obj){
- return (obj.start_date.valueOf() < value.valueOf());
- }
-};
-
-/*Dimentions*/
-scheduler.xy = {
- confirm_height : 231,
- confirm_width : 250,
- scale_width : 45,
- scale_height : 15,
- list_tab:54,
- day_tab:54,
- month_tab:68,
- icon_today : 72,
- icon_save : 100,
- icon_cancel : 100,
- icon_edit : 100,
- icon_back : 100,
- list_height: 42,
- month_list_height: 42
-}
-
-/*Templates*/
-scheduler.templates = {
- selected_event : function(obj){
- var html = "";
- if(!obj.start_date) return html;
- html += "<div class='selected_event'>";
- html += "<div class='event_title'>"+obj.text+"</div>";
- if(dhx.Date.datePart(obj.start_date).valueOf()==dhx.Date.datePart(obj.end_date).valueOf()){
- var fd = dhx.i18n.dateFormatStr(obj.start_date);
- var fts = dhx.i18n.timeFormatStr(obj.start_date);
- var fte = dhx.i18n.timeFormatStr(obj.end_date);
- html += "<div class='event_text'>"+fd+"</div>";
- html += "<div class='event_text'>"+scheduler.locale.labels.label_from+" "+fts+" "+scheduler.locale.labels.label_to+" "+fte+"</div>";
- }
- else{
- var fds = dhx.i18n.longDateFormatStr(obj.start_date);
- var fde = dhx.i18n.longDateFormatStr(obj.end_date);
- var fts = dhx.i18n.timeFormatStr(obj.start_date);
- var fte = dhx.i18n.timeFormatStr(obj.end_date);
- html += "<div class='event_text'>"+scheduler.locale.labels.label_from+" "+fts+" "+fds+"</div>";
- html += "<div class='event_text'>"+scheduler.locale.labels.label_to+" "+fte+" "+fde+"</div>";
- }
- if(obj.details&&obj.details!==""){
- html += "<div class='event_title'>"+scheduler.locale.labels.label_details+"</div>";
- html += "<div class='event_text'>"+obj.details+"</div>";
- }
- html += "</div>";
- return html;
- },
- calendar_event : function(date){
- return date+"<div class='day_with_events'></div>";
- },
- event_date: function(date){
- return dhx.i18n.dateFormatStr(date);
- },
- event_long_date: function(date){
- return dhx.i18n.longDateFormatStr(date);
- },
- event_time : function(date){
- return dhx.i18n.timeFormatStr(date);
- },
- event_color : function(obj,type){
- return (obj.color?"background-color:"+obj.color:"");
- },
- event_marker : function(obj,type){
- return "<div class='dhx_event_marker' style='"+type.color(obj)+"'></div>";
- },
- event_title: function(obj,type){
- return "<div class='dhx_day_title'>"+type.dateStart(obj.start_date)+"</div><div style='margin:10px'><div class='dhx_event_time'>"+type.timeStart(obj.start_date)+"</div>"+type.marker(obj,type)+"<div class='dhx_event_text'>"+obj.text+"</div></div>";
- },
- month_event_title : function(obj,type){
- return type.marker(obj,type)+"<div class='dhx_event_time'>"+type.timeStart(obj.start_date)+"</div><div class='dhx_event_text'>"+obj.text+"</div>"
- },
- day_event: function(obj,type){
- return obj.text
- }
-};
-
-/*Views of scheduler multiview*/
-scheduler.config.views = [];
-
-
-dhx.ready(function(){
- if (scheduler.locale&&scheduler.locale.date)
- dhx.Date.Locale = scheduler.locale.date;
-
- if(!scheduler.config.form){
- scheduler.config.form = [
- {view:"text", label:scheduler.locale.labels.label_event, name:'text'},
- {view:"datepicker", label:scheduler.locale.labels.label_start, name:'start_date', timeSelect:1, dateFormat:scheduler.config.form_date},
- {view:"datepicker", label:scheduler.locale.labels.label_end, name:'end_date', timeSelect:1, dateFormat:scheduler.config.form_date},
- {view:"textarea", label:scheduler.locale.labels.label_details, name:'details', width:300, height:150},
- {view:"button", label:scheduler.locale.labels.icon_delete, id:'delete',type:"form" ,css:"delete"}
- ];
- }
- if(!scheduler.config.bottom_toolbar){
- scheduler.config.bottom_toolbar = [
- { view:"button",id:"today",label:scheduler.locale.labels.icon_today,inputWidth:scheduler.xy.icon_today, align:"left",width:scheduler.xy.icon_today+6},
- { view:"segmented", id:"buttons",selected:"list",align:"center",multiview:true, options:[
- {value:"list", label:scheduler.locale.labels.list_tab,width:scheduler.xy.list_tab},
- {value:"day", label:scheduler.locale.labels.day_tab,width:scheduler.xy.day_tab},
- {value:"month", label:scheduler.locale.labels.month_tab,width:scheduler.xy.month_tab}
- ]},
- { view:"button",css:"add",id:"add", align:"right",label:"",inputWidth:42,width:50},
- { view:"label", label:"",inputWidth:42,width:50, batch:"readonly"}
- ];
- }
- if(!scheduler.config.day_toolbar){
- scheduler.config.day_toolbar = [
- {view:'label',id:"prev",align:"left",label:"<div class='dhx_cal_prev_button'><div></div></div>"},
- {view:'label',id:"date",align:"center",width:200},
- {view:'label',id:"next",align:"right",label:"<div class='dhx_cal_next_button'><div></div></div>"}
- ];
- }
- if(!scheduler.config.selected_toolbar){
- scheduler.config.selected_toolbar = [
- {view:'button', inputWidth:scheduler.xy.icon_back, type:"prev", id:"back",align:"left",label:scheduler.locale.labels.icon_back},
- {view:'button', inputWidth:scheduler.xy.icon_edit, id:"edit",align:"right",label:scheduler.locale.labels.icon_edit}
- ];
- }
- if(!scheduler.config.form_toolbar){
- scheduler.config.form_toolbar = [
- {view:'button', inputWidth:scheduler.xy.icon_cancel, id:"cancel",css:"cancel",align:"left",label:scheduler.locale.labels.icon_cancel},
- {view:'button', inputWidth:scheduler.xy.icon_save, id:"save",align:"right",label:scheduler.locale.labels.icon_save}
- ];
- }
-
- /*List types*/
- scheduler.types = {
- event_list:{
- name:"EventsList",
- css:"events",
- cssNoEvents:"no_events",
- padding:0,
- height:scheduler.xy.list_height,
- width:"auto",
- dateStart:scheduler.templates.event_date,
- timeStart:scheduler.templates.event_time,
- color:scheduler.templates.event_color,
- marker:scheduler.templates.event_marker,
- template:scheduler.templates.event_title
- },
- day_event_list:{
- name:"DayEventsList",
- css:"day_events",
- cssNoEvents:"no_events",
- padding:0,
- height:scheduler.xy.month_list_height,
- width:"auto",
- timeStart:scheduler.templates.event_time,
- color:scheduler.templates.event_color,
- marker:scheduler.templates.event_marker,
- template:scheduler.templates.month_event_title
- }
- };
-
- dhx.Type(dhx.ui.list, scheduler.types.event_list);
- dhx.Type(dhx.ui.list, scheduler.types.day_event_list);
-
- dhx.DataDriver.scheduler = {
- records:"/*/event"
- };
- dhx.extend(dhx.DataDriver.scheduler,dhx.DataDriver.xml);
-
- /*the views of scheduler multiview*/
- var views = [
- {
- id:"list",
- view:"list",
- type:"EventsList",
- startDate:new Date()
- },
- {
- id:"day",
- rows:[
- {
- id:"dayBar",
- view:"toolbar",
- css:"dhx_topbar",
- elements: scheduler.config.day_toolbar
- },
- {
- id:"dayList",
- view:"dayevents"
- }
- ]
- },
- {
- id:"month",
- rows:[
- {
- id:"calendar",
- view:"calendar",
- dayWithEvents: scheduler.templates.calendar_event,
- calendarHeader:scheduler.config.calendar_date
- },
- {
- id:"calendarDayEvents",
- view:"list",
- type:"DayEventsList"
- }
- ]
-
- },
- {
- id:"event",
- animate:{
- type:"slide",
- subtype:"in",
- direction:"top"
- },
- rows:[
- {
- id:"eventBar",
- view:"toolbar",
- type:"TopBar",
- css:"single_event",
- elements: scheduler.config.selected_toolbar
- },
- {
- id:"eventTemplate",
- view:"template",
- template:scheduler.templates.selected_event
- }
-
- ]
- },
- {
- id:"form",
- rows:[
- {
- id:"editBar",
- view:"toolbar",
- type:"TopBar",
- elements:scheduler.config.form_toolbar
- },
- {
- id:"editForm",
- view:"form",
- elements: scheduler.config.form,
- rules: scheduler.config.form_rules
- }
- ]
- }
- ].concat(scheduler.config.views);
-
- dhx.protoUI({
- name:"scheduler",
- defaults:{
- rows:[
- {
- view:"multiview",
- id:"views",
- cells: views
- },
- {
- view:"toolbar",
- id:"bottomBar",
- type:"SchedulerBar",
- visibleBatch:"default",
- elements: scheduler.config.bottom_toolbar
- }
- ],
- color:"#color#",
- textColor:"#textColor#"
- },
- $init: function() {
- this.name = "Scheduler";
- this._viewobj.className += " dhx_scheduler";
- /*date format functions*/
- dhx.i18n.dateFormat = scheduler.config.item_date;
- dhx.i18n.timeFormat = scheduler.config.hour_date;
- dhx.i18n.fullDateFormat = scheduler.config.xml_date;
- dhx.i18n.headerFormatStr = dhx.Date.dateToStr( scheduler.config.header_date);
- dhx.i18n.setLocale();
- this.data.provideApi(this);
- this.data.extraParser = dhx.bind(function(data){
- data.start_date = dhx.i18n.fullDateFormatDate(data.start_date);
- data.end_date = dhx.i18n.fullDateFormatDate(data.end_date);
- },this);
- this.$ready.push(this._initStructure);
- this.data.attachEvent("onStoreUpdated", dhx.bind(this._sortDates,this));
- },
- _initStructure:function(){
- this._initToolbars();
- this._initmonth();
-
- //store current date
- this.coreData = new dhx.DataValue();
- this.coreData.setValue(scheduler.config.init_date);
-
- this.$$("dayList").define("date",this.coreData);
-
- this.selectedEvent = new dhx.DataRecord();
-
- if(this.config.readonly){
- this.define("readonly",this.config.readonly);
- }
- else if(scheduler.config.readonly)
- this.define("readonly",true);
- /*saving data*/
- if(this.config.save){
- var dp = new dhx.DataProcessor({
- master:this,
- url:this.config.save
- });
- dp.attachEvent("onBeforeDataSend",this._onSchedulerUpdate);
- }
-
- if(this.$$("date"))
- this.$$("date").bind(this.coreData, null, dhx.i18n.headerFormatStr);
-
-
- this.$$("list").sync(this);
- this.$$("list").bind(this.coreData, function(target, source){
- return source < target.end_date;
- });
-
- this.$$("dayList").sync(this, true);
- this.$$("dayList").bind(this.coreData, function(target, source){
- var d = dhx.Date.datePart(source);
- return d < target.end_date && dhx.Date.add(d,1,"day") > target.start_date;
- });
-
- this.$$("calendar").bind(this.coreData);
-
- this.$$("calendarDayEvents").sync(this, true);
- this.$$("calendarDayEvents").bind(this.coreData, function(target, source){
- var d = dhx.Date.datePart(source);
- return d < target.end_date && dhx.Date.add(d,1,"day") > target.start_date;
- });
-
- this.$$("eventTemplate").bind(this);
- this.$$("editForm").bind(this);
-
- this.$$("list").attachEvent("onItemClick", dhx.bind(this._on_event_clicked, this));
- this.$$("dayList").attachEvent("onItemClick", dhx.bind(this._on_event_clicked, this));
- this.$$("calendarDayEvents").attachEvent("onItemClick", dhx.bind(this._on_event_clicked, this));
- },
- _on_event_clicked:function(id){
- this.setCursor(id);
- this.$$('event').show();
- },
- /*Sorts dates asc, gets hash of dates with event*/
- _sortDates:function(){
- this.data.blockEvent();
- this.data.sort(function(a,b){
- return a.start_date < b.start_date?1:-1;
- });
- this.data.unblockEvent();
- this._eventsByDate = {};
- var evs = this.data.getRange();
- for(var i = 0; i < evs.length;i++)
- this._setDateEvents(evs[i]);
- },
- /*Month Events view: gets dates of a certain event*/
- _setDateEvents:function(ev){
- var start = dhx.Date.datePart(ev.start_date);
- var end = dhx.Date.datePart(ev.end_date);
- if(ev.end_date.valueOf()!=end.valueOf())
- end = dhx.Date.add(end,1,"day");
- while(start<end){
- this._eventsByDate[start.valueOf()]=true;
- start = dhx.Date.add(start,1,"day");
- }
- },
- /* Month Events view: sets event handlers */
- _initmonth:function(){
- this.$$("calendar").attachEvent("onDateSelect",dhx.bind(function(date){
- this.setDate(date);
- },this));
-
- this.$$("calendar").attachEvent("onAfterMonthChange",dhx.bind(function(date){
- var today = new Date();
- if(date.getMonth()===today.getMonth()&&date.getYear()===today.getYear())
- date = today;
- else
- date.setDate(1);
- this.setDate(date);
- },this));
-
- var dayFormat = this.$$("calendar").config.calendarDay;
- this.$$("calendar").config.calendarDay=dhx.bind(function(date){
- var html = dayFormat(date);
- if(this._eventsByDate&&this._eventsByDate[date.valueOf()])
- return this.$$("calendar").config.dayWithEvents(html);
- return html;
- },this);
- },
-
- /*applies selected date to all lists*/
- setDate:function(date, inc, mode){
- if (!date)
- date = this.coreData.getValue();
- if (inc)
- date = dhx.Date.add(date, inc, mode);
- this.coreData.setValue(date);
- },
- _initToolbars:function(){
- this.attachEvent("onItemClick", function(id){
- var view_id = this.innerId(id);
- switch(view_id){
- case "today":
- this.setDate(new Date());
- break;
- case "add":
- if(this.innerId(this.$$("views").getActive()) == "form"){
- var self = this;
- dhx.confirm({
- height:scheduler.xy.confirm_height,
- width:scheduler.xy.confirm_width,
- title: scheduler.locale.labels.icon_close,
- message: scheduler.locale.labels.confirm_closing,
- callback: function(result) {
- if (result){
- self._addEvent();
- }
- },
- labelOk:scheduler.locale.labels.icon_yes,
- labelCancel:scheduler.locale.labels.icon_no,
- css:"confirm"
-
- });
- }else{
- this._addEvent();
- }
- break;
- case "prev":
- this.setDate(null, -1, "day");
- break;
- case "next":
- this.setDate(null, 1, "day");
- break;
- case "edit":
- if(this.$$("delete"))
- this.$$("delete").show();
- this.define("editEvent",true);
- this.$$("form").show();
- break;
- case "back":
- this.$$("views").back();
- break;
- case "cancel":
- /*if(!this._settings.editEvent)
- this.remove(this.getCursor());*/
- this.callEvent("onAfterCursorChange",[this.getCursor()]);
- this.$$("views").back();
- break;
- case "save":
- if(this.$$("editForm").validate()){
- if(!this._settings.editEvent){
- var data = this.$$("editForm").getValues();
- data.id = dhx.uid();
- this.add(data);
- this.setCursor(data.id);
- } else {
- this.$$("editForm").save();
- }
- dhx.dp(this).save();
- this.setDate();
- this.$$("views").back();
- }
- break;
- case "delete":
- this._deleteEvent();
- break;
- default:
- //do nothing
- break;
- }
- });
- this.attachEvent("onAfterTabClick", function(id, button){
- this.$$(button).show();
- });
- this.attachEvent("onBeforeTabClick", function(id, button){
- return this._confirmViewChange(button);
- });
- },
- readonly_setter:function(val){
- if(this.$$("add")){
- if (val){
- this.$$("bottomBar").showBatch("readonly");
- this.$$("add").hide();
- this.$$("edit").hide();
- }
- else{
- this.$$("bottomBar").showBatch("default");
- this.$$("add").show();
- this.$$("edit").show();
- }
- }
- return val;
- },
- /*removes "No events" background*/
- _clearNoEventsStyle:function(){
- if(this.dataCount())
- this._viewobj.className = this._viewobj.className.replace(RegExp(this.type.cssNoEvents, "g"),"");
- else
- this._viewobj.className += " "+this.type.cssNoEvents;
- },
- /*deletes the cursored event*/
- _deleteEvent: function(){
- var self = this;
- dhx.confirm({
- height:scheduler.xy.confirm_height,
- width:scheduler.xy.confirm_width,
- title: scheduler.locale.labels.icon_delete,
- message: scheduler.locale.labels.confirm_deleting,
- callback: function(result) {
- if (result){
- self.remove(self.getCursor());
- self.$$("views").back(2);
- }
- },
- labelOk:scheduler.locale.labels.icon_yes,
- labelCancel:scheduler.locale.labels.icon_no,
- css:"confirm",
- header:false
- });
- },
- /*adds the new event*/
- _addEvent:function(){
- if(this.$$("delete"))
- this.$$("delete").hide();
- this.define("editEvent",false);
- this.$$("form").show();
-
- var d = dhx.Date.add(new Date(),1,"hour");
- var start = new Date(d.setMinutes(0));
- var end = dhx.Date.add(start,1,"hour");
- this.$$("editForm").clear();
- this.$$("editForm").setValues({start_date:start,end_date:end});
- },
- /*cofirm the view changing (necessary for edit form)*/
- _confirmViewChange:function(button){
- if(this.innerId(this.$$("views").getActive()) == "form"){
- var self = this;
- if(button!= "today")
- dhx.confirm({
- height:scheduler.xy.confirm_height,
- width:scheduler.xy.confirm_width,
- title: scheduler.locale.labels.icon_close,
- message: scheduler.locale.labels.confirm_closing,
- callback: function(result) {
- if (result){
- self.$$(button).show();
- self.$$("buttons").setValue(button);
- }
- },
- labelOk:scheduler.locale.labels.icon_yes,
- labelCancel:scheduler.locale.labels.icon_no,
- css:"confirm"
- });
- return false;
- }
- return true;
- },
- _onSchedulerUpdate:function(data){
- var obj = data[0].data = dhx.copy(data[0].data);
- obj.start_date = dhx.i18n.fullDateFormatStr(obj.start_date);
- obj.end_date = dhx.i18n.fullDateFormatStr(obj.end_date);
- }
- }, dhx.IdSpace, dhx.DataLoader, dhx.ui.layout, dhx.EventSystem, dhx.Settings);
-
-});
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/note.css b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/note.css deleted file mode 100644 index 83118ff5ab4..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/note.css +++ /dev/null @@ -1,134 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -.dhx_cal_event div{
- background-color:#FFE763;
- border:1px solid #B7A543;
- color:#887A2E;
- overflow:hidden;
- width:100%;
-
- font-family:Tahoma;
- font-size:8pt;
-}
-.dhx_move_denied .dhx_cal_event .dhx_header, .dhx_move_denied .dhx_cal_event .dhx_title{
- cursor:default;
-}
-.dhx_cal_event .dhx_header{
- height:1px;
- margin-left:1px;
- border-width:1px 1px 0px 1px;
- cursor:pointer;
-}
-.dhx_cal_event .dhx_title{
- height:12px;
- border-width:0px 1px 1px 1px;
- border-bottom-style:dotted;
-
- font-size:7pt;
- font-weight:bold;
- text-align:center;
-
- background-position:right;
- background-repeat:no-repeat;
- cursor:pointer;
-}
-.dhx_cal_event .dhx_body{
- border-width:0px 1px 1px 1px;
- padding:5px;
-}
-.dhx_resize_denied .dhx_cal_event .dhx_footer{
- cursor:default;
-}
-.dhx_cal_event .dhx_footer{
- height:1px;
- margin-left:2px;
- border-width:0px 1px 1px 1px;
- cursor:s-resize;
-}
-.dhx_cal_event_line{
- background-color:#FFE763;
- border:1px solid #B7A543;
- border-radius:3px;
- font-family:Tahoma;
- font-size:8pt;
- height:13px;
- padding-left:10px;
- color:#887A2E;
- cursor:pointer;
- overflow:hidden;
-}
-.dhx_cal_event_clear{
- font-family:Tahoma;
- font-size:8pt;
- height:13px;
- padding-left:2px;
- color:#887A2E;
- white-space:nowrap;
- overflow:hidden;
- cursor:pointer;
-}
-.dhx_in_move{
- background-color:#FFFF80;
-}
-div.dhx_cal_editor{
- background-color:#FFE763;
- border:1px solid #B7A543;
- border-top-style:dotted;
- z-index:999;
- position:absolute;
- overflow:hidden;
-}
-textarea.dhx_cal_editor{
- width:100%;
- height:100%;
- border:0px solid black;
- margin:none;
- padding:none;
- overflow:auto;
-}
-div.dhx_menu_head{
- background-image:url(imgs/controls.gif);
- background-position: 0px -43px;
- width:10px; height:10px;
- margin-left:5px; margin-top:1px;
- border:none;
- cursor:default;
-}
-div.dhx_menu_icon{
- background-image:url(imgs/controls.gif);
- width:20px; height:20px;
- margin-left:-5px; margin-top:0px;
- border:none;
- cursor:pointer;
-}
-div.icon_details{
- background-position: 0px 0px;
-}
-div.icon_edit{
- background-position: -22px 0px;
-}
-div.icon_save{
- background-position: -84px -1px;
-}
-div.icon_cancel{
- background-position: -62px 0px;
-}
-div.icon_delete{
- background-position: -42px 0px;
-}
-div.dhx_now_time{
- position:absolute;
- width:100%;
- border-bottom:2px dotted red;
- z-index:1;
-}
-div.dhx_time_block{
- position:absolute;
- width:100%;
- background:silver;
- opacity:0.4;
- filter:alpha(opacity=40);
- z-index:1;
-}
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/recurring.css b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/recurring.css deleted file mode 100644 index 6e4d4f98395..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/recurring.css +++ /dev/null @@ -1,130 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -/*IE*/
-div.dhx_form_repeat input.radio { margin:-4px 0 0 -4px !ie; }
-div.dhx_form_repeat input.checkbox { margin:0 0 0 -4px !ie; }
-
-/*All*/
-.dhx_form_repeat, .dhx_form_repeat input {
- padding:0;
- margin:0;
- padding-left:5px;
- font-family:Tahoma, Verdana;
- font-size:11px;
- line-height:24px;
-}
-
-.dhx_form_repeat {
- overflow:hidden;
- /*height:115px;*/
- height:0px;
- background-color: #FFF4B5;
- /*border: 1px solid #DCC43E;*/
-}
-
-.dhx_cal_light_wide .dhx_form_repeat {
- background-color: transparent;
-}
-
-
-.dhx_repeat_center, .dhx_repeat_left{
- height:115px;
- padding:10px 0 10px 10px;
- float:left;
-}
-
-.dhx_repeat_left{
- width:95px;
-}
-
-.dhx_repeat_center{
- width:335px;
- margin-top:12px;
-}
-
-.dhx_repeat_divider{
- float:left;
- height:115px;
- border-left:1px dotted #DCC43E;
- /*background-color: #DCC43E;*/
- width:1px;
-}
-
-.dhx_repeat_right {
- float:right;
- height:115px;
- width:160px;
- padding:10px 3px 10px 10px;
- margin-top:7px;
-}
-
-input.dhx_repeat_text {
- height:16px;
- width: 27px;
- margin: 0 4px 0 4px;
- line-height:18px;
- padding: 0 0 0 2px;
-}
-
-.dhx_form_repeat select {
- height: 20px;
- width: 87px;
- padding:0 0 0 2px;
- margin: 0 4px 0 4px;
-}
-
-input.dhx_repeat_date{
- height: 18px;
- width: 80px;
- padding:0 0 0 2px;
- margin: 0 4px 0 4px;
- background-repeat:no-repeat;
- background-position:64px 0;
- border:1px #7f9db9 solid;
- line-height:18px;
-}
-
-input.dhx_repeat_radio {
- margin-right:4px;
-}
-
-input.dhx_repeat_checkbox {
- margin:4px 4px 0 0;
-}
-
-.dhx_repeat_days td {
- padding-right:5px;
-}
-.dhx_repeat_days label {
- font-size:10px;
-}
-.dhx_custom_button{
- width:90px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- -ms-border-radius: 4px;
- -o-border-radius: 4px;
- border-radius: 4px;
-}
-.dhx_custom_button_recurring{
- background-image:url(./imgs/but_repeat.gif);
- background-position:-5px 20px;
- width:20px;
- margin-right:10px;
-}
-
-/* increase width of lightbox */
-.dhx_cal_light_rec{
- width:640px;
-}
-.dhx_cal_light_rec .dhx_cal_larea{
- width:632px;
-}
-.dhx_cal_light_rec.dhx_cal_light_wide{
- width:816px;
-}
-.dhx_cal_light_rec.dhx_cal_light_wide .dhx_cal_larea{
- width:808px;
-}
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/recurring.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/recurring.js deleted file mode 100644 index e360d7d1d43..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/recurring.js +++ /dev/null @@ -1,639 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -scheduler.form_blocks["recurring"]={
- render:function(sns){
- return scheduler.__recurring_template;
- },
- _ds: {},
- _init_set_value:function(node, value, ev){
- scheduler.form_blocks["recurring"]._ds = {start:ev.start_date, end:ev._end_date};
- var str_date=scheduler.date.str_to_date(scheduler.config.repeat_date);
- var date_str=scheduler.date.date_to_str(scheduler.config.repeat_date);
-
- var top = node.getElementsByTagName("FORM")[0];
- var els = [];
- function register_els(inps){
- for (var i=0; i<inps.length; i++){
- var inp = inps[i];
- if (inp.type=="checkbox" || inp.type=="radio"){
- if (!els[inp.name])
- els[inp.name]=[];
- els[inp.name].push(inp);
- } else
- els[inp.name]=inp;
- }
- }
- register_els(top.getElementsByTagName("INPUT"));
- register_els(top.getElementsByTagName("SELECT"));
-
- var $ = function(a){ return document.getElementById(a); };
- function get_radio_value(name){
- var col = els[name];
- for (var i=0; i<col.length; i++)
- if (col[i].checked) return col[i].value;
- }
- function change_current_view(){
- $("dhx_repeat_day").style.display="none";
- $("dhx_repeat_week").style.display="none";
- $("dhx_repeat_month").style.display="none";
- $("dhx_repeat_year").style.display="none";
- $("dhx_repeat_"+this.value).style.display="block";
- }
-
- function get_repeat_code(dates){
- var code = [get_radio_value("repeat")];
- get_rcode[code[0]](code,dates);
-
- while (code.length < 5) code.push("");
- var repeat = "";
- if (els["end"][0].checked){
- dates.end = new Date(9999,1,1);
- repeat = "no";
- }
- else if (els["end"][2].checked){
- dates.end = str_date(els["date_of_end"].value);
- }
- else {
- scheduler.transpose_type(code.join("_"));
- repeat=Math.max(1,els["occurences_count"].value);
- var transp = ((code[0]=="week" && code[4] && code[4].toString().indexOf(scheduler.config.start_on_monday?1:0)==-1)?1:0);
- dates.end = scheduler.date.add(new Date(dates.start),repeat+transp,code.join("_"));
- }
-
- return code.join("_")+"#"+repeat;
- }
- scheduler.form_blocks["recurring"]._get_repeat_code = get_repeat_code;
- var get_rcode={
- month:function(code,dates){
- if (get_radio_value("month_type")=="d"){
- code.push(Math.max(1,els["month_count"].value));
- dates.start.setDate(els["month_day"].value);
- } else {
- code.push(Math.max(1,els["month_count2"].value));
- code.push(els["month_day2"].value);
- code.push(Math.max(1,els["month_week2"].value));
- dates.start.setDate(1);
- }
- dates._start = true;
- },
- week:function(code,dates){
- code.push(Math.max(1,els["week_count"].value));
- code.push("");code.push("");
- var t = [];
- var col = els["week_day"];
- for (var i=0; i < col.length; i++) {
- if (col[i].checked) t.push(col[i].value);
- }
- if (!t.length)
- t.push(dates.start.getDay());
-
- dates.start=scheduler.date.week_start(dates.start);
- dates._start = true;
-
- code.push(t.sort().join(","));
- },
- day:function(code){
- if (get_radio_value("day_type")=="d"){
- code.push(Math.max(1,els["day_count"].value));
- }
- else {
- code.push("week");code.push(1);code.push("");code.push("");code.push("1,2,3,4,5");
- code.splice(0,1);
- }
- },
- year:function(code,dates){
- if (get_radio_value("year_type")=="d"){
- code.push("1");
- dates.start.setMonth(0);
- dates.start.setDate(els["year_day"].value);
- dates.start.setMonth(els["year_month"].value);
-
- } else {
- code.push("1");
- code.push(els["year_day2"].value);
- code.push(els["year_week2"].value);
- dates.start.setDate(1);
- dates.start.setMonth(els["year_month2"].value);
- }
- dates._start = true;
- }
- };
- var set_rcode={
- week:function(code,dates){
- els["week_count"].value=code[1];
- var col = els["week_day"];
- var t = code[4].split(","); var d ={};
- for (var i=0; i < t.length; i++) d[t[i]]=true;
- for (var i=0; i < col.length; i++)
- col[i].checked = (!!d[col[i].value]);
- },
- month:function(code,dates){
- if (code[2]==""){
- els["month_type"][0].checked=true;
- els["month_count"].value=code[1];
- els["month_day"].value=dates.start.getDate();
- } else {
- els["month_type"][1].checked=true;
- els["month_count2"].value=code[1];
- els["month_week2"].value=code[3];
- els["month_day2"].value=code[2];
- }
- },
- day:function(code,dates){
- els["day_type"][0].checked=true;
- els["day_count"].value=code[1];
- },
- year:function(code,dates){
- if (code[2]==""){
- els["year_type"][0].checked=true;
- els["year_day"].value=dates.start.getDate();
- els["year_month"].value=dates.start.getMonth();
- } else {
- els["year_type"][1].checked=true;
- els["year_week2"].value=code[3];
- els["year_day2"].value=code[2];
- els["year_month2"].value=dates.start.getMonth();
- }
- }
- };
- function set_repeat_code(code,dates){
- var data = code.split("#");
- code = data[0].split("_");
- set_rcode[code[0]](code,dates);
- var e = els["repeat"][({day:0, week:1, month:2, year:3})[code[0]]];
- switch(data[1]){
- case "no":
- els["end"][0].checked=true;
- break;
- case "":
- els["end"][2].checked=true;
- els["date_of_end"].value=date_str(dates.end);
- break;
- default:
- els["end"][1].checked=true;
- els["occurences_count"].value=data[1];
- break;
- }
-
- e.checked=true;
- e.onclick();
- }
- scheduler.form_blocks["recurring"]._set_repeat_code = set_repeat_code;
-
- for (var i=0; i<top.elements.length; i++){
- var el = top.elements[i];
- switch(el.name){
- case "repeat":
- el.onclick = change_current_view;
- break;
- }
- }
- scheduler._lightbox._rec_init_done = true;
- },
- set_value:function(node,value,ev){
- var rf = scheduler.form_blocks["recurring"];
- if(!scheduler._lightbox._rec_init_done)
- rf._init_set_value(node, value, ev);
- node.open=!ev.rec_type;
- if(ev.event_pid && ev.event_pid!="0")
- node.blocked=true;
- else node.blocked=false;
-
- var ds = rf._ds;
- ds.start = ev.start_date;
- ds.end = ev._end_date;
-
- rf.button_click(0,node.previousSibling.firstChild.firstChild,node,node);
- if (value)
- rf._set_repeat_code(value, ds);
- },
- get_value:function(node,ev){
- if (node.open){
- var ds = scheduler.form_blocks["recurring"]._ds;
- ev.rec_type=scheduler.form_blocks["recurring"]._get_repeat_code(ds);
- if (ds._start){
- ev.start_date = new Date(ds.start);
- ev._start_date = new Date(ds.start);
- ds._start=false;
- } else
- ev._start_date = null;
-
- ev._end_date = ev.end_date = ds.end;
- ev.rec_pattern = ev.rec_type.split("#")[0];
- } else {
- ev.rec_type= ev.rec_pattern = "";
- ev._end_date = ev.end_date;
- }
- return ev.rec_type;
- },
- focus:function(node){
- },
- button_click:function(index,el, section, cont){
- if (!cont.open && !cont.blocked){
- cont.style.height="115px";
- el.style.backgroundPosition="-5px 0px";
- el.nextSibling.innerHTML = scheduler.locale.labels.button_recurring_open;
- } else {
- cont.style.height="0px";
- el.style.backgroundPosition="-5px 20px";
- el.nextSibling.innerHTML = scheduler.locale.labels.button_recurring;
- }
- cont.open=!cont.open;
-
- scheduler.setLightboxSize();
- }
-};
-
-
-//problem may occur if we will have two repeating events in the same moment of time
-scheduler._rec_markers = {};
-scheduler._rec_markers_pull = {};
-scheduler._add_rec_marker = function(ev,time){
- ev._pid_time = time;
- this._rec_markers[ev.id] = ev;
- if (!this._rec_markers_pull[ev.event_pid]) this._rec_markers_pull[ev.event_pid] = {};
- this._rec_markers_pull[ev.event_pid][time]=ev;
-};
-scheduler._get_rec_marker = function(time, id){
- var ch = this._rec_markers_pull[id];
- if (ch) return ch[time];
- return null;
-};
-scheduler._get_rec_markers = function(id){
- return (this._rec_markers_pull[id]||[]);
-};
-scheduler._rec_temp = [];
-scheduler.attachEvent("onEventLoading",function(ev){
- if (ev.event_pid!=0)
- scheduler._add_rec_marker(ev,ev.event_length*1000);
- if (ev.rec_type)
- ev.rec_pattern = ev.rec_type.split("#")[0];
- return true;
-});
-scheduler.attachEvent("onEventIdChange",function(id,new_id){
- if (this._ignore_call) return;
- this._ignore_call = true;
-
- for (var i=0; i<this._rec_temp.length; i++){
- var tev = this._rec_temp[i];
- if (tev.event_pid == id){
- tev.event_pid = new_id;
- this.changeEventId(tev.id,new_id+"#"+tev.id.split("#")[1]);
- }
- }
-
- delete this._ignore_call;
-});
-scheduler.attachEvent("onBeforeEventDelete",function(id){
- var ev = this.getEvent(id);
- if (id.toString().indexOf("#")!=-1 || (ev.event_pid && ev.event_pid != "0" && ev.rec_type != 'none')) {
- id = id.split("#");
- var nid = this.uid();
- var tid = (id[1])?id[1]:(ev._pid_time/1000);
-
- var nev = this._copy_event(ev);
- nev.id = nid;
- nev.event_pid = ev.event_pid||id[0];
- nev.event_length = tid;
- nev.rec_type = nev.rec_pattern = "none";
- this.addEvent(nev);
-
- this._add_rec_marker(nev, tid*1000);
- } else {
- if (ev.rec_type)
- this._roll_back_dates(ev);
- var sub = this._get_rec_markers(id);
- for (var i in sub) {
- if(sub.hasOwnProperty(i)){
- id = sub[i].id;
- if(this.getEvent(id))
- this.deleteEvent(id,true);
- }
- }
- }
- return true;
-});
-
-scheduler.attachEvent("onEventChanged",function(id){
- if (this._loading) return true;
-
- var ev = this.getEvent(id);
- if (id.toString().indexOf("#")!=-1) {
- var id = id.split("#");
- var nid = this.uid();
- this._not_render=true;
-
- var nev = this._copy_event(ev);
- nev.id = nid;
- nev.event_pid = id[0];
- nev.event_length = id[1];
- nev.rec_type = nev.rec_pattern = "";
- this.addEvent(nev);
-
- this._not_render=false;
- this._add_rec_marker(nev,id[1]*1000);
- } else{
- if (ev.rec_type)
- this._roll_back_dates(ev);
- var sub = this._get_rec_markers(id);
- for (var i in sub) {
- if(sub.hasOwnProperty(i)){
- delete this._rec_markers[sub[i].id];
- this.deleteEvent(sub[i].id,true);
- }
- }
- delete this._rec_markers_pull[id];
-
- // it's possible that after editing event is no longer exists, in such case we need to remove _select_id flag
- var isEventFound = false;
- for(var k=0; k<this._rendered.length; k++) {
- if(this._rendered[k].getAttribute('event_id') == id)
- isEventFound = true;
- }
- if(!isEventFound)
- this._select_id = null;
- }
- return true;
-});
-scheduler.attachEvent("onEventAdded",function(id){
- if (!this._loading){
- var ev = this.getEvent(id);
- if (ev.rec_type && !ev.event_length )
- this._roll_back_dates(ev);
- }
- return true;
-});
-scheduler.attachEvent("onEventSave",function(id,data,is_new_event){
- var ev = this.getEvent(id);
- if(!ev.rec_type && data.rec_type && (id+'').indexOf('#')==-1)
- this._select_id = null;
- return true;
-});
-scheduler.attachEvent("onEventCreated",function(id){
- var ev = this.getEvent(id);
- if (!ev.rec_type)
- ev.rec_type = ev.rec_pattern = ev.event_length = ev.event_pid = "";
- return true;
-});
-scheduler.attachEvent("onEventCancel",function(id){
- var ev = this.getEvent(id);
- if (ev.rec_type){
- this._roll_back_dates(ev);
- // a bit expensive, but we need to be sure that event re-rendered, because view can be corrupted by resize , during edit process
- this.render_view_data();
- }
-});
-scheduler._roll_back_dates=function(ev){
- ev.event_length = (ev.end_date.valueOf() - ev.start_date.valueOf())/1000;
- ev.end_date = ev._end_date;
- if (ev._start_date){
- ev.start_date.setMonth(0);
- ev.start_date.setDate(ev._start_date.getDate());
- ev.start_date.setMonth(ev._start_date.getMonth());
- ev.start_date.setFullYear(ev._start_date.getFullYear());
-
- }
-};
-
-scheduler.validId=function(id){
- return id.toString().indexOf("#")==-1;
-};
-
-scheduler.showLightbox_rec=scheduler.showLightbox;
-scheduler.showLightbox=function(id){
- var pid=this.getEvent(id).event_pid;
- if (id.toString().indexOf("#")!=-1)
- pid = id.split("#")[0];
- if (!pid || pid == 0 || (!this.locale.labels.confirm_recurring || !confirm(this.locale.labels.confirm_recurring))) return this.showLightbox_rec(id);
- pid = this.getEvent(pid);
- pid._end_date = pid.end_date;
- pid.end_date = new Date(pid.start_date.valueOf()+pid.event_length*1000);
- return this.showLightbox_rec(pid.id);
-};
-scheduler.get_visible_events_rec = scheduler.get_visible_events;
-scheduler.get_visible_events=function(){
- for (var i=0; i<this._rec_temp.length; i++)
- delete this._events[this._rec_temp[i].id];
- this._rec_temp = [];
-
- var stack = this.get_visible_events_rec();
- var out=[];
- for (var i=0; i<stack.length; i++){
- if (stack[i].rec_type){
- //deleted element of serie
- if (stack[i].rec_pattern != "none")
- this.repeat_date(stack[i],out);
- }
- else out.push(stack[i]);
- }
- return out;
-};
-
-
-(function(){
-var old = scheduler.is_one_day_event;
-scheduler.is_one_day_event=function(ev){
- if (ev.rec_type) return true;
- return old.call(this,ev);
-};
-})();
-
-scheduler.transponse_size={
- day:1, week:7, month:1, year:12
-};
-scheduler.date.day_week=function(sd,day,week){
- sd.setDate(1);
- week = (week-1)*7;
- var cday = sd.getDay();
- var nday=day*1+week-cday+1;
- sd.setDate(nday<=week?(nday+7):nday);
-};
-scheduler.transpose_day_week=function(sd,list,cor,size,cor2){
- var cday = (sd.getDay()||(scheduler.config.start_on_monday?7:0))-cor;
- for (var i=0; i < list.length; i++) {
- if (list[i]>cday)
- return sd.setDate(sd.getDate()+list[i]*1-cday-(size?cor:cor2));
- }
- this.transpose_day_week(sd,list,cor+size,null,cor);
-};
-scheduler.transpose_type = function(type){
- var f = "transpose_"+type;
- if (!this.date[f]) {
- var str = type.split("_");
- var day = 60*60*24*1000;
- var gf = "add_"+type;
- var step = this.transponse_size[str[0]]*str[1];
-
- if (str[0]=="day" || str[0]=="week"){
- var days = null;
- if (str[4]){
- days=str[4].split(",");
- if (scheduler.config.start_on_monday){
- for (var i=0; i < days.length; i++)
- days[i]=(days[i]*1)||7;
- days.sort();
- }
- }
-
-
- this.date[f] = function(nd,td){
- var delta = Math.floor((td.valueOf()-nd.valueOf())/(day*step));
- if (delta>0)
- nd.setDate(nd.getDate()+delta*step);
- if (days)
- scheduler.transpose_day_week(nd,days,1,step);
- };
- this.date[gf] = function(sd,inc){
- var nd = new Date(sd.valueOf());
- if (days){
- for (var count=0; count < inc; count++)
- scheduler.transpose_day_week(nd,days,0,step);
- } else
- nd.setDate(nd.getDate()+inc*step);
-
- return nd;
- };
- }
- else if (str[0]=="month" || str[0]=="year"){
- this.date[f] = function(nd,td){
- var delta = Math.ceil(((td.getFullYear()*12+td.getMonth()*1)-(nd.getFullYear()*12+nd.getMonth()*1))/(step));
- if (delta>=0)
- nd.setMonth(nd.getMonth()+delta*step);
- if (str[3])
- scheduler.date.day_week(nd,str[2],str[3]);
- };
- this.date[gf] = function(sd,inc){
- var nd = new Date(sd.valueOf());
- nd.setMonth(nd.getMonth()+inc*step);
- if (str[3])
- scheduler.date.day_week(nd,str[2],str[3]);
- return nd;
- };
- }
- }
-};
-scheduler.repeat_date=function(ev,stack,non_render,from,to){
- from = from||this._min_date;
- to = to||this._max_date;
-
- var td = new Date(ev.start_date.valueOf());
- if (!ev.rec_pattern && ev.rec_type)
- ev.rec_pattern = ev.rec_type.split("#")[0];
-
- this.transpose_type(ev.rec_pattern);
- scheduler.date["transpose_"+ev.rec_pattern](td, from);
- while (td<ev.start_date || (td.valueOf()+ev.event_length*1000)<=from.valueOf())
- td = this.date.add(td,1,ev.rec_pattern);
- while (td < to && td < ev.end_date){
- var ch = this._get_rec_marker(td.valueOf(),ev.id);
- if (!ch) { //not changed element of serie
- var ted = new Date(td.valueOf()+ev.event_length*1000);
- var copy=this._copy_event(ev);
- //copy._timed = ev._timed;
- copy.text = ev.text;
- copy.start_date = td;
- copy.event_pid = ev.id;
- copy.id = ev.id+"#"+Math.ceil(td.valueOf()/1000);
- copy.end_date = ted;
-
- var shift = copy.start_date.getTimezoneOffset() - copy.end_date.getTimezoneOffset();
- if (shift){
- if (shift>0)
- copy.end_date = new Date(td.valueOf()+ev.event_length*1000-shift*60*1000);
- else {
- copy.end_date = new Date(copy.end_date.valueOf() + shift*60*1000);
- }
- }
-
- copy._timed=this.is_one_day_event(copy);
-
- if (!copy._timed && !this._table_view && !this.config.multi_day) return;
- stack.push(copy);
-
- if(!non_render){
- this._events[copy.id] = copy;
- this._rec_temp.push(copy);
- }
-
- } else
- if (non_render) stack.push(ch);
-
- td = this.date.add(td,1,ev.rec_pattern);
- }
-};
-
-scheduler.getRecDates = function(id, max){
- var ev = typeof id == "object" ? id : scheduler.getEvent(id);
- var count = 0;
- var result = [];
- max = max || 1000;
-
- var td = new Date(ev.start_date.valueOf());
- var from = new Date(td.valueOf());
-
- if(!ev.rec_type) {
- return [ { start_date: ev.start_date, end_date: ev.end_date } ];
- }
- this.transpose_type(ev.rec_pattern);
- scheduler.date["transpose_"+ev.rec_pattern](td, from);
-
- while (td<ev.start_date || (td.valueOf()+ev.event_length*1000)<=from.valueOf())
- td = this.date.add(td,1,ev.rec_pattern);
- while (td < ev.end_date){
- var ch = this._get_rec_marker(td.valueOf(),ev.id);
- var res = true;
- if (!ch){ //not changed element of serie
- var ted = new Date(td.valueOf()+ev.event_length*1000);
- var sed = new Date(td);
- result.push({start_date:sed, end_date:ted});
- } else {
- (ch.rec_type == "none")?
- (res=false):
- result.push({ start_date: ch.start_date, end_date: ch.end_date });
- }
- td = this.date.add(td,1,ev.rec_pattern);
- if(res){
- count++;
- if (count == max)
- break;
- }
- }
- return result;
-};
-scheduler.getEvents = function(from,to){
- var result = [];
- for (var a in this._events){
- var ev = this._events[a];
- if (ev && ev.start_date<to && ev.end_date>from){
- if (ev.rec_pattern){
- if (ev.rec_pattern=="none") continue;
- var sev = [];
- this.repeat_date(ev,sev,true,from,to);
- for (var i=0; i < sev.length; i++) {
- // if event is in rec_markers then it will be checked by himself, here need to skip it
- if (!sev[i].rec_pattern && sev[i].start_date<to && sev[i].end_date>from && !this._rec_markers[sev[i].id]) {
- result.push(sev[i]);
- }
- }
- } else if (ev.id.toString().indexOf("#")==-1){ // if it's virtual event we can skip it
- result.push(ev);
- }
- }
- }
- return result;
-};
-
-scheduler.config.repeat_date="%m.%d.%Y";
-scheduler.config.lightbox.sections=[
- {name:"description", height:130, map_to:"text", type:"textarea" , focus:true},
- {name:"recurring", type:"recurring", map_to:"rec_type", button:"recurring"},
- {name:"time", height:72, type:"time", map_to:"auto"}
-];
-//drop secondary attributes
-scheduler._copy_dummy=function(ev){
- this.start_date=new Date(this.start_date);
- this.end_date=new Date(this.end_date);
- this.event_length=this.event_pid=this.rec_pattern=this.rec_type=this._timed=null;
-};
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/repeat_template.html b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/repeat_template.html deleted file mode 100644 index 078f4415777..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/repeat_template.html +++ /dev/null @@ -1,57 +0,0 @@ -<div class="dhx_form_repeat">
- <form>
- <div class="dhx_repeat_left">
- <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="day" />Daily</label><br />
- <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="week"/>Weekly</label><br />
- <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="month" checked />Monthly</label><br />
- <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="year" />Yearly</label>
- </div>
- <div class="dhx_repeat_divider"></div>
- <div class="dhx_repeat_center">
- <div style="display:none;" id="dhx_repeat_day">
- <label><input class="dhx_repeat_radio" type="radio" name="day_type" value="d"/>Every</label><input class="dhx_repeat_text" type="text" name="day_count" value="1" />day<br />
- <label><input class="dhx_repeat_radio" type="radio" name="day_type" checked value="w"/>Every workday</label>
- </div>
- <div style="display:none;" id="dhx_repeat_week">
- Repeat every<input class="dhx_repeat_text" type="text" name="week_count" value="1" />week next days:<br />
-
- <table class="dhx_repeat_days">
- <tr>
- <td>
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="1" />Monday</label><br />
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="4" />Thursday</label>
- </td>
- <td>
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="2" />Tuesday</label><br />
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="5" />Friday</label>
- </td>
- <td>
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="3" />Wednesday</label><br />
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="6" />Saturday</label>
- </td>
- <td>
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="0" />Sunday</label><br /><br />
- </td>
- </tr>
- </table>
-
- </div>
- <div id="dhx_repeat_month">
- <label><input class="dhx_repeat_radio" type="radio" name="month_type" value="d"/>Repeat</label><input class="dhx_repeat_text" type="text" name="month_day" value="1" />day every<input class="dhx_repeat_text" type="text" name="month_count" value="1" />month<br />
- <label><input class="dhx_repeat_radio" type="radio" name="month_type" checked value="w"/>On</label><input class="dhx_repeat_text" type="text" name="month_week2" value="1" /><select name="month_day2"><option value="1" selected >Monday<option value="2">Tuesday<option value="3">Wednesday<option value="4">Thursday<option value="5">Friday<option value="6">Saturday<option value="0">Sunday</select>every<input class="dhx_repeat_text" type="text" name="month_count2" value="1" />month<br />
- </div>
- <div style="display:none;" id="dhx_repeat_year">
- <label><input class="dhx_repeat_radio" type="radio" name="year_type" value="d"/>Every</label><input class="dhx_repeat_text" type="text" name="year_day" value="1" />day<select name="year_month"><option value="0" selected >January<option value="1">February<option value="2">March<option value="3">April<option value="4">May<option value="5">June<option value="6">July<option value="7">August<option value="8">September<option value="9">October<option value="10">November<option value="11">December</select>month<br />
- <label><input class="dhx_repeat_radio" type="radio" name="year_type" checked value="w"/>On</label><input class="dhx_repeat_text" type="text" name="year_week2" value="1" /><select name="year_day2"><option value="1" selected >Monday<option value="2">Tuesday<option value="3">Wednesday<option value="4">Thursday<option value="5">Friday<option value="6">Saturday<option value="7">Sunday</select>of<select name="year_month2"><option value="0" selected >January<option value="1">February<option value="2">March<option value="3">April<option value="4">May<option value="5">June<option value="6">July<option value="7">August<option value="8">September<option value="9">October<option value="10">November<option value="11">December</select><br />
- </div>
- </div>
- <div class="dhx_repeat_divider"></div>
- <div class="dhx_repeat_right">
- <label><input class="dhx_repeat_radio" type="radio" name="end" checked/>No end date</label><br />
- <label><input class="dhx_repeat_radio" type="radio" name="end" />After</label><input class="dhx_repeat_text" type="text" name="occurences_count" value="1" />occurrences<br />
- <label><input class="dhx_repeat_radio" type="radio" name="end" />End by</label><input class="dhx_repeat_date" type="text" name="date_of_end" value="'+scheduler.config.repeat_date_of_end+'" /><br />
- </div>
- </form>
- </div>
- <div style="clear:both">
- </div>
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/repeat_template_cn.html b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/repeat_template_cn.html deleted file mode 100644 index c47f485b80f..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/repeat_template_cn.html +++ /dev/null @@ -1,57 +0,0 @@ -<div class="dhx_form_repeat">
- <form>
- <div class="dhx_repeat_left">
- <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="day" />按天</label><br />
- <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="week"/>按周</label><br />
- <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="month" checked />按月</label><br />
- <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="year" />按年</label>
- </div>
- <div class="dhx_repeat_divider"></div>
- <div class="dhx_repeat_center">
- <div style="display:none;" id="dhx_repeat_day">
- <label><input class="dhx_repeat_radio" type="radio" name="day_type" value="d"/>每</label><input class="dhx_repeat_text" type="text" name="day_count" value="1" />天<br />
- <label><input class="dhx_repeat_radio" type="radio" name="day_type" checked value="w"/>每个工作日</label>
- </div>
- <div style="display:none;" id="dhx_repeat_week">
- 重复 每<input class="dhx_repeat_text" type="text" name="week_count" value="1" />星期的:<br />
-
- <table class="dhx_repeat_days">
- <tr>
- <td>
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="1" />星期一</label><br />
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="4" />星期四</label>
- </td>
- <td>
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="2" />星期二</label><br />
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="5" />星期五</label>
- </td>
- <td>
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="3" />星期三</label><br />
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="6" />星期六</label>
- </td>
- <td>
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="0" />星期日</label><br /><br />
- </td>
- </tr>
- </table>
-
- </div>
- <div id="dhx_repeat_month">
- <label><input class="dhx_repeat_radio" type="radio" name="month_type" value="d"/>重复</label><input class="dhx_repeat_text" type="text" name="month_day" value="1" />日 每<input class="dhx_repeat_text" type="text" name="month_count" value="1" />月<br />
- <label><input class="dhx_repeat_radio" type="radio" name="month_type" checked value="w"/>在</label><input class="dhx_repeat_text" type="text" name="month_week2" value="1" /><select name="month_day2"><option value="1" selected >星期一<option value="2">星期二<option value="3">星期三<option value="4">星期四<option value="5">星期五<option value="6">星期六<option value="0">星期日</select>每<input class="dhx_repeat_text" type="text" name="month_count2" value="1" />月<br />
- </div>
- <div style="display:none;" id="dhx_repeat_year">
- <label><input class="dhx_repeat_radio" type="radio" name="year_type" value="d"/>每</label><input class="dhx_repeat_text" type="text" name="year_day" value="1" />日<select name="year_month"><option value="0" selected >一月<option value="1">二月<option value="2">三月<option value="3">四月<option value="4">五月<option value="5">六月<option value="6">七月<option value="7">八月<option value="8">九月<option value="9">十月<option value="10">十一月<option value="11">十二月</select>月<br />
- <label><input class="dhx_repeat_radio" type="radio" name="year_type" checked value="w"/>在</label><input class="dhx_repeat_text" type="text" name="year_week2" value="1" /><select name="year_day2"><option value="1" selected >星期一<option value="2">星期二<option value="3">星期三<option value="4">星期四<option value="5">星期五<option value="6">星期六<option value="7">星期日</select>的<select name="year_month2"><option value="0" selected >一月<option value="1">二月<option value="2">三月<option value="3">四月<option value="4">五月<option value="5">六月<option value="6">七月<option value="7">八月<option value="8">九月<option value="9">十月<option value="10">十一月<option value="11">十二月</select><br />
- </div>
- </div>
- <div class="dhx_repeat_divider"></div>
- <div class="dhx_repeat_right">
- <label><input class="dhx_repeat_radio" type="radio" name="end" checked/>无结束日期</label><br />
- <label><input class="dhx_repeat_radio" type="radio" name="end" />重复</label><input class="dhx_repeat_text" type="text" name="occurences_count" value="1" />次结束<br />
- <label><input class="dhx_repeat_radio" type="radio" name="end" />结束于</label><input class="dhx_repeat_date" type="text" name="date_of_end" value="'+scheduler.config.repeat_date_of_end+'" /><br />
- </div>
- </form>
- </div>
- <div style="clear:both">
- </div>
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/repeat_template_de.html b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/repeat_template_de.html deleted file mode 100644 index bb70c5aac79..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/repeat_template_de.html +++ /dev/null @@ -1,60 +0,0 @@ -<div class="dhx_form_repeat">
- <form>
- <div class="dhx_repeat_left">
- <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="day" />Täglich</label><br />
- <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="week"/>Wöchentlich</label><br />
- <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="month" checked />Monatlich</label><br />
- <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="year" />Jährlich</label>
- </div>
- <div class="dhx_repeat_divider"></div>
- <div class="dhx_repeat_center">
- <div style="display:none;" id="dhx_repeat_day">
- <label>Wiederholt sich:<br/></label>
- <label><input class="dhx_repeat_radio" type="radio" name="day_type" value="d"/>jeden</label><input class="dhx_repeat_text" type="text" name="day_count" value="1" />Tag<br />
- <label><input class="dhx_repeat_radio" type="radio" name="day_type" checked value="w"/>an jedem Arbeitstag</label>
- </div>
- <div style="display:none;" id="dhx_repeat_week">
- Wiederholt sich jede<input class="dhx_repeat_text" type="text" name="week_count" value="1" />Woche am:<br />
-
- <table class="dhx_repeat_days">
- <tr>
- <td>
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="1" />Montag</label><br />
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="4" />Donnerstag</label>
- </td>
- <td>
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="2" />Dienstag</label><br />
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="5" />Freitag</label>
- </td>
- <td>
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="3" />Mittwoch</label><br />
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="6" />Samstag</label>
- </td>
- <td>
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="0" />Sonntag</label><br /><br />
- </td>
- </tr>
- </table>
-
- </div>
- <div id="dhx_repeat_month">
- <label>Wiederholt sich:<br/></label>
- <label><input class="dhx_repeat_radio" type="radio" name="month_type" value="d"/>an jedem</label><input class="dhx_repeat_text" type="text" name="month_day" value="1" />Tag eines jeden<input class="dhx_repeat_text" type="text" name="month_count" value="1" />Monats<br />
- <label><input class="dhx_repeat_radio" type="radio" name="month_type" checked value="w"/>am</label><input class="dhx_repeat_text" type="text" name="month_week2" value="1" /><select name="month_day2"><option value="1" selected >Montag<option value="2">Dienstag<option value="3">Mittwoch<option value="4">Donnerstag<option value="5">Freitag<option value="6">Samstag<option value="0">Sonntag</select>jeden<input class="dhx_repeat_text" type="text" name="month_count2" value="1" />Monats<br />
- </div>
- <div style="display:none;" id="dhx_repeat_year">
- <label>Wiederholt sich:</label>
- <label><input class="dhx_repeat_radio" type="radio" name="year_type" value="d"/>an jedem</label><input class="dhx_repeat_text" type="text" name="year_day" value="1" />Tag im<select name="year_month"><option value="0" selected >Januar<option value="1">Februar<option value="2">März<option value="3">April<option value="4">Mai<option value="5">Juni<option value="6">Juli<option value="7">August<option value="8">September<option value="9">Oktober<option value="10">November<option value="11">Dezember</select><br />
- <label><input class="dhx_repeat_radio" type="radio" name="year_type" checked value="w"/>am</label><input class="dhx_repeat_text" type="text" name="year_week2" value="1" /><select name="year_day2"><option value="1" selected >Montag<option value="2">Dienstag<option value="3">Mittwoch<option value="4">Donnerstag<option value="5">Freitag<option value="6">Samstag<option value="0">Sonntag</select>im<select name="year_month2"><option value="0" selected >Januar<option value="1">Februar<option value="2">März<option value="3">April<option value="4">Mai<option value="5">Juni<option value="6">Juli<option value="7">August<option value="8">September<option value="9">Oktober<option value="10">November<option value="11">Dezember</select><br />
- </div>
- </div>
- <div class="dhx_repeat_divider"></div>
- <div class="dhx_repeat_right">
- <label><input class="dhx_repeat_radio" type="radio" name="end" checked/>kein Enddatum</label><br />
- <label><input class="dhx_repeat_radio" type="radio" name="end" />nach</label><input class="dhx_repeat_text" type="text" name="occurences_count" value="1" />Ereignissen<br />
- <label><input class="dhx_repeat_radio" type="radio" name="end" />Schluß</label><input class="dhx_repeat_date" type="text" name="date_of_end" value="'+scheduler.config.repeat_date_of_end+'" /><br />
- </div>
- </form>
- </div>
- <div style="clear:both">
- </div>
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/repeat_template_el.html b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/repeat_template_el.html deleted file mode 100644 index eddddee99aa..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/repeat_template_el.html +++ /dev/null @@ -1,57 +0,0 @@ -<div class="dhx_form_repeat">
- <form>
- <div class="dhx_repeat_left">
- <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="day" />Ημερησίως</label><br />
- <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="week"/>Εβδομαδιαίως</label><br />
- <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="month" checked />Μηνιαίως</label><br />
- <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="year" />Ετησίως</label>
- </div>
- <div class="dhx_repeat_divider"></div>
- <div class="dhx_repeat_center">
- <div style="display:none;" id="dhx_repeat_day">
- <label><input class="dhx_repeat_radio" type="radio" name="day_type" value="d"/>Κάθε</label><input class="dhx_repeat_text" type="text" name="day_count" value="1" />ημέρα<br />
- <label><input class="dhx_repeat_radio" type="radio" name="day_type" checked value="w"/>Κάθε εργάσιμη</label>
- </div>
- <div style="display:none;" id="dhx_repeat_week">
- Επανάληψη κάθε<input class="dhx_repeat_text" type="text" name="week_count" value="1" />εβδομάδα τις επόμενες ημέρες:<br />
-
- <table class="dhx_repeat_days">
- <tr>
- <td>
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="1" />Δευτέρα</label><br />
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="4" />Πέμπτη</label>
- </td>
- <td>
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="2" />Τρίτη</label><br />
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="5" />Παρασκευή</label>
- </td>
- <td>
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="3" />Τετάρτη</label><br />
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="6" />Σάββατο</label>
- </td>
- <td>
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="0" />Κυριακή</label><br /><br />
- </td>
- </tr>
- </table>
-
- </div>
- <div id="dhx_repeat_month">
- <label><input class="dhx_repeat_radio" type="radio" name="month_type" value="d"/>Επανάληψη</label><input class="dhx_repeat_text" type="text" name="month_day" value="1" />ημέρα κάθε<input class="dhx_repeat_text" type="text" name="month_count" value="1" />μήνα<br />
- <label><input class="dhx_repeat_radio" type="radio" name="month_type" checked value="w"/>Την</label><input class="dhx_repeat_text" type="text" name="month_week2" value="1" /><select name="month_day2"><option value="1" selected >Δευτέρα<option value="2">Τρίτη<option value="3">Τετάρτη<option value="4">Πέμπτη<option value="5">Παρασκευή<option value="6">Σάββατο<option value="0">Κυριακή</select>κάθε<input class="dhx_repeat_text" type="text" name="month_count2" value="1" />μήνα<br />
- </div>
- <div style="display:none;" id="dhx_repeat_year">
- <label><input class="dhx_repeat_radio" type="radio" name="year_type" value="d"/>Κάθε</label><input class="dhx_repeat_text" type="text" name="year_day" value="1" />ημέρα<select name="year_month"><option value="0" selected >Ιανουάριος<option value="1">Φεβρουάριος<option value="2">Μάρτιος<option value="3">Απρίλιος<option value="4">Μάϊος<option value="5">Ιούνιος<option value="6">Ιούλιος<option value="7">Αύγουστος<option value="8">Σεπτέμβριος<option value="9">Οκτώβριος<option value="10">Νοέμβριος<option value="11">Δεκέμβριος</select>μήνα<br />
- <label><input class="dhx_repeat_radio" type="radio" name="year_type" checked value="w"/>Την</label><input class="dhx_repeat_text" type="text" name="year_week2" value="1" /><select name="year_day2"><option value="1" selected >Δευτέρα<option value="2">Τρίτη<option value="3">Τετάρτη<option value="4">Πέμπτη<option value="5">Παρασκευή<option value="6">Σάββατο<option value="7">Κυριακή</select>του<select name="year_month2"><option value="0" selected >Ιανουάριος<option value="1">Φεβρουάριος<option value="2">Μάρτιος<option value="3">Απρίλιος<option value="4">Μάϊος<option value="5">Ιούνιος<option value="6">Ιούλιος<option value="7">Αύγουστος<option value="8">Σεπτέμβριος<option value="9">Οκτώβριος<option value="10">Νοέμβριος<option value="11">Δεκέμβριος</select><br />
- </div>
- </div>
- <div class="dhx_repeat_divider"></div>
- <div class="dhx_repeat_right">
- <label><input class="dhx_repeat_radio" type="radio" name="end" checked/>Χωρίς ημερομηνία λήξεως</label><br />
- <label><input class="dhx_repeat_radio" type="radio" name="end" />Μετά από</label><input class="dhx_repeat_text" type="text" name="occurences_count" value="1" />επαναλήψεις<br />
- <label><input class="dhx_repeat_radio" type="radio" name="end" />Λήγει την</label><input class="dhx_repeat_date" type="text" name="date_of_end" value="'+scheduler.config.repeat_date_of_end+'" /><br />
- </div>
- </form>
- </div>
- <div style="clear:both">
- </div>
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/repeat_template_es.html b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/repeat_template_es.html deleted file mode 100644 index 94549432bc8..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/repeat_template_es.html +++ /dev/null @@ -1,57 +0,0 @@ -<div class="dhx_form_repeat">
- <form>
- <div class="dhx_repeat_left">
- <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="day" />Diariamente</label><br />
- <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="week"/>Semanalment</label><br />
- <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="month" checked />Mensualmente</label><br />
- <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="year" />Anualmente</label>
- </div>
- <div class="dhx_repeat_divider"></div>
- <div class="dhx_repeat_center">
- <div style="display:none;" id="dhx_repeat_day">
- <label><input class="dhx_repeat_radio" type="radio" name="day_type" value="d"/>Cada</label><input class="dhx_repeat_text" type="text" name="day_count" value="1" />dia<br />
- <label><input class="dhx_repeat_radio" type="radio" name="day_type" checked value="w"/>Cada jornada de trabajo</label>
- </div>
- <div style="display:none;" id="dhx_repeat_week">
- Repetir cada<input class="dhx_repeat_text" type="text" name="week_count" value="1" />semana:<br />
-
- <table class="dhx_repeat_days">
- <tr>
- <td>
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="1" />Lunes</label><br />
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="4" />Jeuves</label>
- </td>
- <td>
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="2" />Martes</label><br />
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="5" />Viernes</label>
- </td>
- <td>
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="3" />Miércoles</label><br />
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="6" />Sabado</label>
- </td>
- <td>
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="0" />Domingo</label><br /><br />
- </td>
- </tr>
- </table>
-
- </div>
- <div id="dhx_repeat_month">
- <label><input class="dhx_repeat_radio" type="radio" name="month_type" value="d"/>Repita</label><input class="dhx_repeat_text" type="text" name="month_day" value="1" />dia cada <input class="dhx_repeat_text" type="text" name="month_count" value="1" />mes<br />
- <label><input class="dhx_repeat_radio" type="radio" name="month_type" checked value="w"/>El</label><input class="dhx_repeat_text" type="text" name="month_week2" value="1" /><select name="month_day2"><option value="1" selected >Lunes<option value="2">Martes<option value="3">Miércoles<option value="4">Jeuves<option value="5">Viernes<option value="6">Sabado<option value="0">Domingo</select>cada<input class="dhx_repeat_text" type="text" name="month_count2" value="1" />mes<br />
- </div>
- <div style="display:none;" id="dhx_repeat_year">
- <label><input class="dhx_repeat_radio" type="radio" name="year_type" value="d"/>Cada</label><input class="dhx_repeat_text" type="text" name="year_day" value="1" />dia<select name="year_month"><option value="0" selected >Enero<option value="1">Febrero<option value="2">Маrzo<option value="3">Аbril<option value="4">Mayo<option value="5">Junio<option value="6">Julio<option value="7">Аgosto<option value="8">Setiembre<option value="9">Octubre<option value="10">Noviembre<option value="11">Diciembre</select>mes<br />
- <label><input class="dhx_repeat_radio" type="radio" name="year_type" checked value="w"/>El</label><input class="dhx_repeat_text" type="text" name="year_week2" value="1" /><select name="year_day2"><option value="1" selected >Lunes<option value="2">Martes<option value="3">Miércoles<option value="4">Jeuves<option value="5">Viernes<option value="6">Sabado<option value="0">Domingo</select>del<select name="year_month2"><option value="0" selected >Enero<option value="1">Febrero<option value="2">Маrzo<option value="3">Аbril<option value="4">Mayo<option value="5">Junio<option value="6">Julio<option value="7">Аgosto<option value="8">Setiembre<option value="9">Octubre<option value="10">Noviembre<option value="11">Diciembre</select><br />
- </div>
- </div>
- <div class="dhx_repeat_divider"></div>
- <div class="dhx_repeat_right">
- <label><input class="dhx_repeat_radio" type="radio" name="end" checked/>Sin fecha de finalización</label><br />
- <label><input class="dhx_repeat_radio" type="radio" name="end" />Después de</label><input class="dhx_repeat_text" type="text" name="occurences_count" value="1" />occurencias<br />
- <label><input class="dhx_repeat_radio" type="radio" name="end" />Fin</label><input class="dhx_repeat_date" type="text" name="date_of_end" value="'+scheduler.config.repeat_date_of_end+'" /><br />
- </div>
- </form>
- </div>
- <div style="clear:both">
- </div>
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/repeat_template_fr.html b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/repeat_template_fr.html deleted file mode 100644 index 281dbe7afc4..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/repeat_template_fr.html +++ /dev/null @@ -1,57 +0,0 @@ -<div class="dhx_form_repeat">
- <form>
- <div class="dhx_repeat_left">
- <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="day" />Quotidienne</label><br />
- <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="week"/>Hebdomadaire</label><br />
- <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="month" checked />Mensuelle</label><br />
- <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="year" />Annuelle</label>
- </div>
- <div class="dhx_repeat_divider"></div>
- <div class="dhx_repeat_center">
- <div style="display:none;" id="dhx_repeat_day">
- <label><input class="dhx_repeat_radio" type="radio" name="day_type" value="d"/>Chaque</label><input class="dhx_repeat_text" type="text" name="day_count" value="1" />jour<br />
- <label><input class="dhx_repeat_radio" type="radio" name="day_type" checked value="w"/>Chaque journée de travail</label>
- </div>
- <div style="display:none;" id="dhx_repeat_week">
- Répéter toutes les<input class="dhx_repeat_text" type="text" name="week_count" value="1" />semaine:<br />
-
- <table class="dhx_repeat_days">
- <tr>
- <td>
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="1" />Lundi</label><br />
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="4" />Jeudi</label>
- </td>
- <td>
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="2" />Mardi</label><br />
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="5" />Vendredi</label>
- </td>
- <td>
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="3" />Mercredi</label><br />
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="6" />Samedi</label>
- </td>
- <td>
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="0" />Dimanche</label><br /><br />
- </td>
- </tr>
- </table>
-
- </div>
- <div id="dhx_repeat_month">
- <label><input class="dhx_repeat_radio" type="radio" name="month_type" value="d"/>Répéter</label><input class="dhx_repeat_text" type="text" name="month_day" value="1" />jour chaque<input class="dhx_repeat_text" type="text" name="month_count" value="1" />mois<br />
- <label><input class="dhx_repeat_radio" type="radio" name="month_type" checked value="w"/>Le</label><input class="dhx_repeat_text" type="text" name="month_week2" value="1" /><select name="month_day2"><option value="1" selected >Lundi<option value="2">Mardi<option value="3">Mercredi<option value="4">Jeudi<option value="5">Vendredi<option value="6">Samedi<option value="0">Dimanche</select>chaque<input class="dhx_repeat_text" type="text" name="month_count2" value="1" />mois<br />
- </div>
- <div style="display:none;" id="dhx_repeat_year">
- <label><input class="dhx_repeat_radio" type="radio" name="year_type" value="d"/>Chaque</label><input class="dhx_repeat_text" type="text" name="year_day" value="1" />jour<select name="year_month"><option value="0" selected >Janvier<option value="1">Février<option value="2">Mars<option value="3">Avril<option value="4">Mai<option value="5">Juin<option value="6">Juillet<option value="7">Août<option value="8">Septembre<option value="9">Octobre<option value="10">Novembre<option value="11">Décembre</select>mois<br />
- <label><input class="dhx_repeat_radio" type="radio" name="year_type" checked value="w"/>Le</label><input class="dhx_repeat_text" type="text" name="year_week2" value="1" /><select name="year_day2"><option value="1" selected >Lundi<option value="2">Mardi<option value="3">Mercredi<option value="4">Jeudi<option value="5">Vendredi<option value="6">Samedi<option value="0">Dimanche</select>du<select name="year_month2"><option value="0" selected >Janvier<option value="1">Février<option value="2">Mars<option value="3">Avril<option value="4">Mai<option value="5">Juin<option value="6">Juillet<option value="7">Août<option value="8">Septembre<option value="9">Octobre<option value="10">Novembre<option value="11">Décembre</select><br />
- </div>
- </div>
- <div class="dhx_repeat_divider"></div>
- <div class="dhx_repeat_right">
- <label><input class="dhx_repeat_radio" type="radio" name="end" checked/>Pas de date d"achèvement</label><br />
- <label><input class="dhx_repeat_radio" type="radio" name="end" />Après</label><input class="dhx_repeat_text" type="text" name="occurences_count" value="1" />occurrences<br />
- <label><input class="dhx_repeat_radio" type="radio" name="end" />Fin</label><input class="dhx_repeat_date" type="text" name="date_of_end" value="'+scheduler.config.repeat_date_of_end+'" /><br />
- </div>
- </form>
- </div>
- <div style="clear:both">
- </div>
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/repeat_template_it.html b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/repeat_template_it.html deleted file mode 100644 index 1d92cb4d420..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/repeat_template_it.html +++ /dev/null @@ -1,57 +0,0 @@ -<div class="dhx_form_repeat">
- <form>
- <div class="dhx_repeat_left">
- <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="day" />Quotidiano</label><br />
- <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="week"/>Settimanale</label><br />
- <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="month" checked />Mensile</label><br />
- <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="year" />Annuale</label>
- </div>
- <div class="dhx_repeat_divider"></div>
- <div class="dhx_repeat_center">
- <div style="display:none;" id="dhx_repeat_day">
- <label><input class="dhx_repeat_radio" type="radio" name="day_type" value="d"/>Ogni</label><input class="dhx_repeat_text" type="text" name="day_count" value="1" />giorno<br />
- <label><input class="dhx_repeat_radio" type="radio" name="day_type" checked value="w"/>Ogni giornata lavorativa</label>
- </div>
- <div style="display:none;" id="dhx_repeat_week">
- Ripetere ogni<input class="dhx_repeat_text" type="text" name="week_count" value="1" />settimana:<br />
-
- <table class="dhx_repeat_days">
- <tr>
- <td>
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="1" />Lunedì</label><br />
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="4" />Jovedì</label>
- </td>
- <td>
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="2" />Martedì</label><br />
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="5" />Venerdì</label>
- </td>
- <td>
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="3" />Mercoledì</label><br />
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="6" />Sabato</label>
- </td>
- <td>
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="0" />Domenica</label><br /><br />
- </td>
- </tr>
- </table>
-
- </div>
- <div id="dhx_repeat_month">
- <label><input class="dhx_repeat_radio" type="radio" name="month_type" value="d"/>Ripetere</label><input class="dhx_repeat_text" type="text" name="month_day" value="1" />giorno ogni<input class="dhx_repeat_text" type="text" name="month_count" value="1" />mese<br />
- <label><input class="dhx_repeat_radio" type="radio" name="month_type" checked value="w"/>Il</label><input class="dhx_repeat_text" type="text" name="month_week2" value="1" /><select name="month_day2"><option value="1" selected >Lunedì<option value="2">Martedì<option value="3">Mercoledì<option value="4">Jovedì<option value="5">Venerdì<option value="6">Sabato<option value="0">Domenica</select>ogni<input class="dhx_repeat_text" type="text" name="month_count2" value="1" />mese<br />
- </div>
- <div style="display:none;" id="dhx_repeat_year">
- <label><input class="dhx_repeat_radio" type="radio" name="year_type" value="d"/>Ogni</label><input class="dhx_repeat_text" type="text" name="year_day" value="1" />giorno<select name="year_month"><option value="0" selected >Gennaio<option value="1">Febbraio<option value="2">Marzo<option value="3">Aprile<option value="4">Maggio<option value="5">Jiugno<option value="6">Luglio<option value="7">Agosto<option value="8">Settembre<option value="9">Ottobre<option value="10">Novembre<option value="11">Dicembre</select>mese<br />
- <label><input class="dhx_repeat_radio" type="radio" name="year_type" checked value="w"/>Il</label><input class="dhx_repeat_text" type="text" name="year_week2" value="1" /><select name="year_day2"><option value="1" selected >Lunedì<option value="2">Martedì<option value="3">Mercoledì<option value="4">Jovedì<option value="5">Venerdì<option value="6">Sabato<option value="0">Domenica</select>del<select name="year_month2"><option value="0" selected >Gennaio<option value="1">Febbraio<option value="2">Marzo<option value="3">Aprile<option value="4">Maggio<option value="5">Jiugno<option value="6">Luglio<option value="7">Agosto<option value="8">Settembre<option value="9">Ottobre<option value="10">Novembre<option value="11">Dicembre</select><br />
- </div>
- </div>
- <div class="dhx_repeat_divider"></div>
- <div class="dhx_repeat_right">
- <label><input class="dhx_repeat_radio" type="radio" name="end" checked/>Senza data finale</label><br />
- <label><input class="dhx_repeat_radio" type="radio" name="end" />Dopo</label><input class="dhx_repeat_text" type="text" name="occurences_count" value="1" />occorenze<br />
- <label><input class="dhx_repeat_radio" type="radio" name="end" />Fine</label><input class="dhx_repeat_date" type="text" name="date_of_end" value="'+scheduler.config.repeat_date_of_end+'" /><br />
- </div>
- </form>
- </div>
- <div style="clear:both">
- </div>
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/repeat_template_nl.html b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/repeat_template_nl.html deleted file mode 100644 index d9e563191f6..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/repeat_template_nl.html +++ /dev/null @@ -1,65 +0,0 @@ -<div class="dhx_form_repeat">
- <form>
- <div class="dhx_repeat_left">
- <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="day" />Dagelijks</label><br />
- <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="week"/>Wekelijks</label><br />
- <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="month" checked />Maandelijks</label><br />
- <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="year" />Jaarlijks</label>
- </div>
- <div class="dhx_repeat_divider"></div>
- <div class="dhx_repeat_center">
- <div style="display:none;" id="dhx_repeat_day">
- <label><input class="dhx_repeat_radio" type="radio" name="day_type" value="d"/>Elke</label><input class="dhx_repeat_text" type="text" name="day_count" value="1" />dag(en)<br />
- <label><input class="dhx_repeat_radio" type="radio" name="day_type" checked value="w"/>Elke werkdag</label>
- </div>
- <div style="display:none;" id="dhx_repeat_week">
- Herhaal elke<input class="dhx_repeat_text" type="text" name="week_count" value="1" />week op de volgende dagen:<br />
-
- <table class="dhx_repeat_days">
- <tr>
- <td>
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="1" />Maandag</label><br />
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="4" />Donderdag</label>
- </td>
- <td>
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="2" />Dinsdag</label><br />
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="5" />Vrijdag</label>
- </td>
- <td>
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="3" />Woensdag</label><br />
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="6" />Zaterdag</label>
- </td>
- <td>
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="0" />Zondag</label><br /><br />
- </td>
- </tr>
- </table>
-
- </div>
- <div id="dhx_repeat_month">
- <label><input class="dhx_repeat_radio" type="radio" name="month_type" value="d"/>Herhaal</label><input class="dhx_repeat_text" type="text" name="month_day" value="1" />dag iedere<input class="dhx_repeat_text" type="text" name="month_count" value="1" />maanden<br />
- <label><input class="dhx_repeat_radio" type="radio" name="month_type" checked value="w"/>Op</label><input class="dhx_repeat_text" type="text" name="month_week2" value="1" /><select name="month_day2">
- <option value="1">Maandag
- <option value="2">Dinsdag
- <option value="3">Woensdag
- <option value="4">Donderdag
- <option value="5">Vrijdag
- <option value="6">Zaterdag
- <option value="0">Zondag
- </select>iedere<input class="dhx_repeat_text" type="text" name="month_count2" value="1" />maanden<br />
- </div>
- <div style="display:none;" id="dhx_repeat_year">
- <label><input class="dhx_repeat_radio" type="radio" name="year_type" value="d"/>Iedere</label><input class="dhx_repeat_text" type="text" name="year_day" value="1" />dag<select name="year_month"><option value="0" selected >Januari<option value="1">Februari<option value="2">Maart<option value="3">April<option value="4">Mei<option value="5">Juni<option value="6">Juli<option value="7">Augustus<option value="8">September<option value="9">Oktober<option value="10">November<option value="11">December</select>maand<br />
- <label><input class="dhx_repeat_radio" type="radio" name="year_type" checked value="w"/>Op</label><input class="dhx_repeat_text" type="text" name="year_week2" value="1" /><select name="year_day2"><option value="1" selected >Maandag<option value="2">Dinsdag<option value="3">Woensdag<option value="4">Donderdag<option value="5">Vrijdag<option value="6">Zaterdag<option value="7">Zondag</select>van<select name="year_month2"><option value="0" selected >Januari<option value="1">Februari<option value="2">Maart<option value="3">April<option value="4">Mei<option value="5">Juni<option value="6">Juli<option value="7">Augustus<option value="8">September<option value="9">Oktober<option value="10">November<option value="11">December</select><br />
- </div>
- </div>
- <div class="dhx_repeat_divider"></div>
- <div class="dhx_repeat_right">
- <label><input class="dhx_repeat_radio" type="radio" name="end" checked/>Geen eind datum</label><br />
- <label><input class="dhx_repeat_radio" type="radio" name="end" />Na</label><input class="dhx_repeat_text" type="text" name="occurences_count" value="1" />keren<br />
- <label><input class="dhx_repeat_radio" type="radio" name="end" />Eindigd per</label><input class="dhx_repeat_date" type="text" name="date_of_end" value="'+scheduler.config.repeat_date_of_end+'" /><br />
- </div>
- </form>
- </div>
- <div style="clear:both">
- </div>
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/repeat_template_ru.html b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/repeat_template_ru.html deleted file mode 100644 index becab2809c7..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/repeat_template_ru.html +++ /dev/null @@ -1,57 +0,0 @@ -<div class="dhx_form_repeat">
- <form>
- <div class="dhx_repeat_left">
- <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="day" />День</label><br />
- <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="week"/>Неделя</label><br />
- <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="month" checked />Месяц</label><br />
- <label><input class="dhx_repeat_radio" type="radio" name="repeat" value="year" />Год</label>
- </div>
- <div class="dhx_repeat_divider"></div>
- <div class="dhx_repeat_center">
- <div style="display:none;" id="dhx_repeat_day">
- <label><input class="dhx_repeat_radio" type="radio" name="day_type" value="d"/>Каждый</label><input class="dhx_repeat_text" type="text" name="day_count" value="1" />день<br />
- <label><input class="dhx_repeat_radio" type="radio" name="day_type" checked value="w"/>Каждый рабочий день</label>
- </div>
- <div style="display:none;" id="dhx_repeat_week">
- Повторять каждую<input class="dhx_repeat_text" type="text" name="week_count" value="1" />неделю , в:<br />
-
- <table class="dhx_repeat_days">
- <tr>
- <td>
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="1" />Понедельник</label><br />
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="4" />Четверг</label>
- </td>
- <td>
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="2" />Вторник</label><br />
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="5" />Пятницу</label>
- </td>
- <td>
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="3" />Среду </label><br />
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="6" />Субботу</label>
- </td>
- <td>
- <label><input class="dhx_repeat_checkbox" type="checkbox" name="week_day" value="0" />Воскресенье</label><br /><br />
- </td>
- </tr>
- </table>
-
- </div>
- <div id="dhx_repeat_month">
- <label><input class="dhx_repeat_radio" type="radio" name="month_type" value="d"/>Повторять</label><input class="dhx_repeat_text" type="text" name="month_day" value="1" /> числа каждый <input class="dhx_repeat_text" type="text" name="month_count" value="1" />месяц<br />
- <label><input class="dhx_repeat_radio" type="radio" name="month_type" checked value="w"/></label><input class="dhx_repeat_text" type="text" name="month_week2" value="1" /><select name="month_day2"><option value="1" selected >Понедельник<option value="2">Вторник<option value="3">Среда<option value="4">Четверг<option value="5">Пятница<option value="6">Суббота<option value="0">Воскресенье</select>каждый <input class="dhx_repeat_text" type="text" name="month_count2" value="1" />месяц<br />
- </div>
- <div style="display:none;" id="dhx_repeat_year">
- <label><input class="dhx_repeat_radio" type="radio" name="year_type" value="d"/></label><input class="dhx_repeat_text" type="text" name="year_day" value="1" />день<select name="year_month"><option value="0" selected >Января<option value="1">Февраля<option value="2">Марта<option value="3">Апреля<option value="4">Мая<option value="5">Июня<option value="6">Июля<option value="7">Августа<option value="8">Сентября<option value="9">Октября<option value="10">Ноября<option value="11">Декабря</select><br />
- <label><input class="dhx_repeat_radio" type="radio" name="year_type" checked value="w"/></label><input class="dhx_repeat_text" type="text" name="year_week2" value="1" /><select name="year_day2"><option value="1" selected >Понедельник<option value="2">Вторник<option value="3">Среда<option value="4">Четверг<option value="5">Пятница<option value="6">Суббота<option value="0">Воскресенье</select><select name="year_month2"><option value="0" selected >Января<option value="1">Февраля<option value="2">Марта<option value="3">Апреля<option value="4">Мая<option value="5">Июня<option value="6">Июля<option value="7">Августа<option value="8">Сентября<option value="9">Октября<option value="10">Ноября<option value="11">Декабря</select><br />
- </div>
- </div>
- <div class="dhx_repeat_divider"></div>
- <div class="dhx_repeat_right">
- <label><input class="dhx_repeat_radio" type="radio" name="end" checked/>Без даты окончания</label><br />
- <label><input class="dhx_repeat_radio" type="radio" name="end" /></label><input class="dhx_repeat_text" type="text" name="occurences_count" value="1" />повторений<br />
- <label><input class="dhx_repeat_radio" type="radio" name="end" />До </label><input class="dhx_repeat_date" type="text" name="date_of_end" value="'+scheduler.config.repeat_date_of_end+'" /><br />
- </div>
- </form>
- </div>
- <div style="clear:both">
- </div>
\ No newline at end of file diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/scheduler.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/scheduler.js deleted file mode 100644 index 80018266f24..00000000000 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/scheduler.js +++ /dev/null @@ -1,714 +0,0 @@ -/* -This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
-to use it in not GPL project. Please contact sales@dhtmlx.com for details -*/ -window.dhtmlXScheduler=window.scheduler={version:3.0};
-dhtmlxEventable(scheduler);
-scheduler.init=function(id,date,mode){
- date=date||(new Date());
- mode=mode||"week";
-
- scheduler.date.init();
-
- this._obj=(typeof id == "string")?document.getElementById(id):id;
- this._els=[];
- this._scroll=true;
- this._quirks=(_isIE && document.compatMode == "BackCompat");
- this._quirks7=(_isIE && navigator.appVersion.indexOf("MSIE 8")==-1);
-
- this.get_elements();
- this.init_templates();
- this.set_actions();
- dhtmlxEvent(window,"resize",function(){
- window.clearTimeout(scheduler._resize_timer);
- scheduler._resize_timer=window.setTimeout(function(){
- if (scheduler.callEvent("onSchedulerResize",[]))
- scheduler.update_view();
- }, 100);
- });
- this.set_sizes();
- scheduler.callEvent('onSchedulerReady', []);
- this.setCurrentView(date,mode);
-};
-scheduler.xy={
- nav_height:22,
- min_event_height:40,
- scale_width:50,
- bar_height:20,
- scroll_width:18,
- scale_height:20,
- month_scale_height:20,
- menu_width:25,
- margin_top:0,
- margin_left:0,
- editor_width:140
-};
-scheduler.keys={
- edit_save:13,
- edit_cancel:27
-};
-scheduler.set_sizes=function(){
- var w = this._x = this._obj.clientWidth-this.xy.margin_left;
- var h = this._y = this._obj.clientHeight-this.xy.margin_top;
-
- //not-table mode always has scroll - need to be fixed in future
- var scale_x=this._table_view?0:(this.xy.scale_width+this.xy.scroll_width);
- var scale_s=this._table_view?-1:this.xy.scale_width;
-
- this.set_xy(this._els["dhx_cal_navline"][0],w,this.xy.nav_height,0,0);
- this.set_xy(this._els["dhx_cal_header"][0],w-scale_x,this.xy.scale_height,scale_s,this.xy.nav_height+(this._quirks?-1:1));
- //to support alter-skin, we need a way to alter height directly from css
- var actual_height = this._els["dhx_cal_navline"][0].offsetHeight;
- if (actual_height > 0) this.xy.nav_height = actual_height;
-
- var data_y=this.xy.scale_height+this.xy.nav_height+(this._quirks?-2:0);
- this.set_xy(this._els["dhx_cal_data"][0],w,h-(data_y+2),0,data_y+2);
-};
-scheduler.set_xy=function(node,w,h,x,y){
- node.style.width=Math.max(0,w)+"px";
- node.style.height=Math.max(0,h)+"px";
- if (arguments.length>3){
- node.style.left=x+"px";
- node.style.top=y+"px";
- }
-};
-scheduler.get_elements=function(){
- //get all child elements as named hash
- var els=this._obj.getElementsByTagName("DIV");
- for (var i=0; i < els.length; i++){
- var name=els[i].className;
- if (!this._els[name]) this._els[name]=[];
- this._els[name].push(els[i]);
-
- //check if name need to be changed
- var t=scheduler.locale.labels[els[i].getAttribute("name")||name];
- if (t) els[i].innerHTML=t;
- }
-};
-scheduler.set_actions=function(){
- for (var a in this._els)
- if (this._click[a])
- for (var i=0; i < this._els[a].length; i++)
- this._els[a][i].onclick=scheduler._click[a];
- this._obj.onselectstart=function(e){ return false; };
- this._obj.onmousemove=function(e){
- scheduler._on_mouse_move(e||event);
- };
- this._obj.onmousedown=function(e){
- scheduler._on_mouse_down(e||event);
- };
- this._obj.onmouseup=function(e){
- scheduler._on_mouse_up(e||event);
- };
- this._obj.ondblclick=function(e){
- scheduler._on_dbl_click(e||event);
- }
-};
-scheduler.select=function(id){
- if (this._table_view || !this.getEvent(id)._timed) return; //temporary block
- if (this._select_id==id) return;
- this.editStop(false);
- this.unselect();
- this._select_id = id;
- this.updateEvent(id);
-};
-scheduler.unselect=function(id){
- if (id && id!=this._select_id) return;
- var t=this._select_id;
- this._select_id = null;
- if (t) this.updateEvent(t);
-};
-scheduler.getState=function(){
- return {
- mode: this._mode,
- date: this._date,
- min_date: this._min_date,
- max_date: this._max_date,
- editor_id: this._edit_id,
- lightbox_id: this._lightbox_id,
- new_event: this._new_event
- };
-};
-scheduler._click={
- dhx_cal_data:function(e){
- //debugger;
- var trg = e?e.target:event.srcElement;
- var id = scheduler._locate_event(trg);
-
- e = e || event;
- if ((id && !scheduler.callEvent("onClick",[id,e])) ||scheduler.config.readonly) return;
-
- if (id) {
- scheduler.select(id);
- var mask = trg.className;
- if (mask.indexOf("_icon")!=-1)
- scheduler._click.buttons[mask.split(" ")[1].replace("icon_","")](id);
- } else
- scheduler._close_not_saved();
- },
- dhx_cal_prev_button:function(){
- scheduler._click.dhx_cal_next_button(0,-1);
- },
- dhx_cal_next_button:function(dummy,step){
- scheduler.setCurrentView(scheduler.date.add( //next line changes scheduler._date , but seems it has not side-effects
- scheduler.date[scheduler._mode+"_start"](scheduler._date),(step||1),scheduler._mode));
- },
- dhx_cal_today_button:function(){
- scheduler.setCurrentView(new Date());
- },
- dhx_cal_tab:function(){
- var name = this.getAttribute("name");
- var mode = name.substring(0, name.search("_tab"));
- scheduler.setCurrentView(scheduler._date,mode);
- },
- buttons:{
- "delete":function(id){ var c=scheduler.locale.labels.confirm_deleting; if (!c||confirm(c)) scheduler.deleteEvent(id); },
- edit:function(id){ scheduler.edit(id); },
- save:function(id){ scheduler.editStop(true); },
- details:function(id){ scheduler.showLightbox(id); },
- cancel:function(id){ scheduler.editStop(false); }
- }
-};
-scheduler.addEventNow=function(start,end,e){
- var base = {};
- if (start && start.constructor.toString().match(/object/i) !== null){
- base = start;
- start = null;
- }
-
- var d = (this.config.event_duration||this.config.time_step)*60000;
- if (!start) start = Math.round((new Date()).valueOf()/d)*d;
- var start_date = new Date(start);
- if (!end){
- var start_hour = this.config.first_hour;
- if (start_hour > start_date.getHours()){
- start_date.setHours(start_hour);
- start = start_date.valueOf();
- }
- end = start+d;
- }
- var end_date = new Date(end);
-
- // scheduler.addEventNow(new Date(), new Date()) + collision though get_visible events defect (such event was not retrieved)
- if(start_date.valueOf() == end_date.valueOf())
- end_date.setTime(end_date.valueOf()+d);
-
- base.start_date = base.start_date||start_date;
- base.end_date = base.end_date||end_date;
- base.text = base.text||this.locale.labels.new_event;
- base.id = this._drag_id = this.uid();
- this._drag_mode="new-size";
-
- this._loading=true;
- this.addEvent(base);
- this.callEvent("onEventCreated",[this._drag_id,e]);
- this._loading=false;
-
- this._drag_event={}; //dummy , to trigger correct event updating logic
- this._on_mouse_up(e);
-};
-scheduler._on_dbl_click=function(e,src){
- src = src||(e.target||e.srcElement);
- if (this.config.readonly) return;
- var name = src.className.split(" ")[0];
- switch(name){
- case "dhx_scale_holder":
- case "dhx_scale_holder_now":
- case "dhx_month_body":
- case "dhx_wa_day_data":
- if (!scheduler.config.dblclick_create) break;
- var pos=this._mouse_coords(e);
- var start=this._min_date.valueOf()+(pos.y*this.config.time_step+(this._table_view?0:pos.x)*24*60)*60000;
- start = this._correct_shift(start);
- this.addEventNow(start,null,e);
- break;
- case "dhx_body":
- case "dhx_wa_ev_body":
- case "dhx_cal_event_line":
- case "dhx_cal_event_clear":
- var id = this._locate_event(src);
- if (!this.callEvent("onDblClick",[id,e])) return;
- if (this.config.details_on_dblclick || this._table_view || !this.getEvent(id)._timed)
- this.showLightbox(id);
- else
- this.edit(id);
- break;
- case "":
- if (src.parentNode)
- return scheduler._on_dbl_click(e,src.parentNode);
- default:
- var t = this["dblclick_"+name];
- if (t) t.call(this,e);
- break;
- }
-};
-
-scheduler._mouse_coords=function(ev){
- var pos;
- var b=document.body;
- var d = document.documentElement;
- if(ev.pageX || ev.pageY)
- pos={x:ev.pageX, y:ev.pageY};
- else pos={
- x:ev.clientX + (b.scrollLeft||d.scrollLeft||0) - b.clientLeft,
- y:ev.clientY + (b.scrollTop||d.scrollTop||0) - b.clientTop
- };
-
- //apply layout
- pos.x-=getAbsoluteLeft(this._obj)+(this._table_view?0:this.xy.scale_width);
- pos.y-=getAbsoluteTop(this._obj)+this.xy.nav_height+(this._dy_shift||0)+this.xy.scale_height-this._els["dhx_cal_data"][0].scrollTop;
- pos.ev = ev;
-
- var handler = this["mouse_"+this._mode];
- if (handler)
- return handler.call(this,pos);
-
- //transform to date
- if (!this._table_view){
- pos.x=Math.max(0,Math.ceil(pos.x/this._cols[0])-1);
- pos.y=Math.max(0,Math.ceil(pos.y*60/(this.config.time_step*this.config.hour_size_px))-1)+this.config.first_hour*(60/this.config.time_step);
- } else {
- var dy=0;
- for (dy=1; dy < this._colsS.heights.length; dy++)
- if (this._colsS.heights[dy]>pos.y) break;
-
- pos.y=(Math.max(0,Math.ceil(pos.x/this._cols[0])-1)+Math.max(0,dy-1)*7)*24*60/this.config.time_step;
- pos.x=0;
- }
-
- return pos;
-}
-scheduler._close_not_saved=function(){
- if (new Date().valueOf()-(scheduler._new_event||0) > 500 && scheduler._edit_id){
- var c=scheduler.locale.labels.confirm_closing;
- if (!c || confirm(c))
- scheduler.editStop(scheduler.config.positive_closing);
- }
-};
-scheduler._correct_shift=function(start, back){
- return start-=((new Date(scheduler._min_date)).getTimezoneOffset()-(new Date(start)).getTimezoneOffset())*60000*(back?-1:1);
-};
-scheduler._on_mouse_move=function(e){
- if (this._drag_mode){
- var pos=this._mouse_coords(e);
- if (!this._drag_pos || pos.custom || this._drag_pos.x!=pos.x || this._drag_pos.y!=pos.y){
-
- if (this._edit_id!=this._drag_id)
- this._close_not_saved();
-
- this._drag_pos=pos;
-
- if (this._drag_mode=="create"){
- this._close_not_saved();
- this._loading=true; //will be ignored by dataprocessor
-
- var start=this._min_date.valueOf()+(pos.y*this.config.time_step+(this._table_view?0:pos.x)*24*60)*60000;
- //if (this._mode != "week" && this._mode != "day")
- start = this._correct_shift(start);
-
- if (!this._drag_start){
- this._drag_start=start; return;
- }
- var end = start;
- if (end==this._drag_start) return;
-
- this._drag_id=this.uid();
- this.addEvent(new Date(this._drag_start), new Date(end),this.locale.labels.new_event,this._drag_id, pos.fields);
-
- this.callEvent("onEventCreated",[this._drag_id,e]);
- this._loading=false;
- this._drag_mode="new-size";
-
- }
-
- var ev=this.getEvent(this._drag_id);
- var start,end;
- if (this._drag_mode=="move"){
- start = this._min_date.valueOf()+(pos.y*this.config.time_step+pos.x*24*60)*60000;
- if (!pos.custom && this._table_view) start+=this.date.time_part(ev.start_date)*1000;
- start = this._correct_shift(start);
- end = ev.end_date.valueOf()-(ev.start_date.valueOf()-start);
- } else {
- start = ev.start_date.valueOf();
- if (this._table_view) {
- end = this._min_date.valueOf()+pos.y*this.config.time_step*60000 + (pos.custom?0:24*60*60000);
- if (this._mode == "month")
- end = this._correct_shift(end, false);
- }
- else{
- end = this.date.date_part(new Date(ev.end_date)).valueOf()+pos.y*this.config.time_step*60000;
- this._els["dhx_cal_data"][0].style.cursor="s-resize";
- if (this._mode == "week" || this._mode == "day")
- end = this._correct_shift(end);
- }
- if (this._drag_mode == "new-size"){
- if (end <= this._drag_start){
- var shift = pos.shift||((this._table_view && !pos.custom)?24*60*60000:0);
- start = end-(pos.shift?0:shift);
- end = this._drag_start+(shift||(this.config.time_step*60000));
- } else {
- start = this._drag_start;
- }
-
- } else if (end<=start)
- end=start+this.config.time_step*60000;
- }
- var new_end = new Date(end-1);
- var new_start = new Date(start);
- //prevent out-of-borders situation for day|week view
- if ( this._table_view || (new_end.getDate()==new_start.getDate() && new_end.getHours()<this.config.last_hour) || (scheduler._wa && scheduler._wa._dnd) ){
- ev.start_date=new_start;
- ev.end_date=new Date(end);
- if (this.config.update_render)
- this.update_view();
- else
- this.updateEvent(this._drag_id);
- }
- if (this._table_view)
- this.for_rendered(this._drag_id,function(r){
- r.className+=" dhx_in_move";
- })
- }
- } else {
- if (scheduler.checkEvent("onMouseMove")){
-
- var id = this._locate_event(e.target||e.srcElement);
- this.callEvent("onMouseMove",[id,e]);
- }
- }
-};
-scheduler._on_mouse_context=function(e,src){
- return this.callEvent("onContextMenu",[this._locate_event(src),e]);
-};
-scheduler._on_mouse_down=function(e,src){
- if (this.config.readonly || this._drag_mode) return;
- src = src||(e.target||e.srcElement);
- if (e.button==2||e.ctrlKey) return this._on_mouse_context(e,src);
- switch(src.className.split(" ")[0]){
- case "dhx_cal_event_line":
- case "dhx_cal_event_clear":
- if (this._table_view)
- this._drag_mode="move"; //item in table mode
- break;
- case "dhx_header":
- case "dhx_title":
- case "dhx_wa_ev_body":
- this._drag_mode="move"; //item in table mode
- break;
- case "dhx_footer":
- this._drag_mode="resize"; //item in table mode
- break;
- case "dhx_scale_holder":
- case "dhx_scale_holder_now":
- case "dhx_month_body":
- case "dhx_matrix_cell":
- this._drag_mode="create";
- break;
- case "":
- if (src.parentNode)
- return scheduler._on_mouse_down(e,src.parentNode);
- default:
- this._drag_mode=null;
- this._drag_id=null;
- }
- if (this._drag_mode){
- var id = this._locate_event(src);
- if (!this.config["drag_"+this._drag_mode] || !this.callEvent("onBeforeDrag",[id, this._drag_mode, e]))
- this._drag_mode=this._drag_id=0;
- else {
- this._drag_id= id;
- this._drag_event=scheduler._lame_copy({},this._copy_event(this.getEvent(this._drag_id)||{}));
- }
- }
- this._drag_start=null;
-};
-scheduler._on_mouse_up=function(e){
- if (this._drag_mode && this._drag_id){
- this._els["dhx_cal_data"][0].style.cursor="default";
- //drop
- var ev=this.getEvent(this._drag_id);
- if (this._drag_event._dhx_changed || !this._drag_event.start_date || ev.start_date.valueOf()!=this._drag_event.start_date.valueOf() || ev.end_date.valueOf()!=this._drag_event.end_date.valueOf()){
- var is_new=(this._drag_mode=="new-size");
- if (!this.callEvent("onBeforeEventChanged",[ev,e,is_new])){
- if (is_new)
- this.deleteEvent(ev.id, true);
- else {
- this._drag_event._dhx_changed = false;
- scheduler._lame_copy(ev, this._drag_event);
- this.updateEvent(ev.id);
- }
- } else {
- if (is_new && this.config.edit_on_create){
- this.unselect();
- this._new_event=new Date();//timestamp of creation
- if (this._table_view || this.config.details_on_create) {
- this._drag_mode=null;
- return this.showLightbox(this._drag_id);
- }
- this._drag_pos=true; //set flag to trigger full redraw
- this._select_id=this._edit_id=this._drag_id;
- } else if (!this._new_event)
- this.callEvent(is_new?"onEventAdded":"onEventChanged",[this._drag_id,this.getEvent(this._drag_id)]);
- }
- }
- if (this._drag_pos) this.render_view_data(); //redraw even if there is no real changes - necessary for correct positioning item after drag
- }
- this._drag_mode=null;
- this._drag_pos=null;
-};
-scheduler.update_view=function(){
- this._reset_scale();
- if (this._load_mode && this._load()) return this._render_wait = true;
- this.render_view_data();
-};
-scheduler.setCurrentView=function(date,mode){
- date = date || this._date;
- mode = mode || this._mode;
-
- if (!this.callEvent("onBeforeViewChange",[this._mode,this._date,mode,date])) return;
-
- var dhx_cal_data = 'dhx_cal_data';
- var prev_scroll = (this._mode == mode && this.config.preserve_scroll)?this._els[dhx_cal_data][0].scrollTop:false; // saving current scroll
-
- //hide old custom view
- if (this[this._mode+"_view"] && mode && this._mode!=mode)
- this[this._mode+"_view"](false);
-
- this._close_not_saved();
-
- var dhx_multi_day = 'dhx_multi_day';
- if(this._els[dhx_multi_day]) {
- this._els[dhx_multi_day][0].parentNode.removeChild(this._els[dhx_multi_day][0]);
- this._els[dhx_multi_day] = null;
- }
-
- this._mode=mode;
- this._date=date;
- this._table_view=(this._mode=="month");
-
- var tabs=this._els["dhx_cal_tab"];
- for (var i=0; i < tabs.length; i++) {
- tabs[i].className="dhx_cal_tab"+((tabs[i].getAttribute("name")==this._mode+"_tab")?" active":"");
- }
-
- //show new view
- var view=this[this._mode+"_view"];
- view?view(true):this.update_view();
-
- if(typeof prev_scroll == "number") // if we are updating or working with the same view scrollTop should be saved
- this._els[dhx_cal_data][0].scrollTop = prev_scroll; // restoring original scroll
-
- this.callEvent("onViewChange",[this._mode,this._date]);
-};
-scheduler._render_x_header = function(i,left,d,h){
- //header scale
- var head=document.createElement("DIV"); head.className="dhx_scale_bar";
- this.set_xy(head,this._cols[i]-1,this.xy.scale_height-2,left,0);//-1 for border
- head.innerHTML=this.templates[this._mode+"_scale_date"](d,this._mode); //TODO - move in separate method
- h.appendChild(head);
-};
-scheduler._reset_scale=function(){
- //current mode doesn't support scales
- //we mustn't call reset_scale for such modes, so it just to be sure
- if (!this.templates[this._mode+"_date"]) return;
-
- var h=this._els["dhx_cal_header"][0];
- var b=this._els["dhx_cal_data"][0];
- var c = this.config;
-
- h.innerHTML="";
- b.scrollTop=0; //fix flickering in FF
- b.innerHTML="";
-
-
- var str=((c.readonly||(!c.drag_resize))?" dhx_resize_denied":"")+((c.readonly||(!c.drag_move))?" dhx_move_denied":"");
- if (str) b.className = "dhx_cal_data"+str;
-
-
- this._cols=[]; //store for data section
- this._colsS={height:0};
- this._dy_shift=0;
-
- this.set_sizes();
- var summ=parseInt(h.style.width); //border delta
- var left=0;
-
- var d,dd,sd,today;
- dd=this.date[this._mode+"_start"](new Date(this._date.valueOf()));
- d=sd=this._table_view?scheduler.date.week_start(dd):dd;
- today=this.date.date_part(new Date());
-
- //reset date in header
- var ed=scheduler.date.add(dd,1,this._mode);
- var count = 7;
-
- if (!this._table_view){
- var count_n = this.date["get_"+this._mode+"_end"];
- if (count_n) ed = count_n(dd);
- count = Math.round((ed.valueOf()-dd.valueOf())/(1000*60*60*24));
- }
-
- this._min_date=d;
- this._els["dhx_cal_date"][0].innerHTML=this.templates[this._mode+"_date"](dd,ed,this._mode);
-
- for (var i=0; i<count; i++){
- this._cols[i]=Math.floor(summ/(count-i));
-
- this._render_x_header(i,left,d,h);
- if (!this._table_view){
- var scales=document.createElement("DIV");
- var cls = "dhx_scale_holder"
- if (d.valueOf()==today.valueOf()) cls = "dhx_scale_holder_now";
- scales.className=cls+" "+this.templates.week_date_class(d,today);
- this.set_xy(scales,this._cols[i]-1,c.hour_size_px*(c.last_hour-c.first_hour),left+this.xy.scale_width+1,0);//-1 for border
- b.appendChild(scales);
- this.callEvent("onScaleAdd",[scales, d]);
- }
-
- d=this.date.add(d,1,"day");
- summ-=this._cols[i];
- left+=this._cols[i];
- this._colsS[i]=(this._cols[i-1]||0)+(this._colsS[i-1]||(this._table_view?0:this.xy.scale_width+2));
- this._colsS['col_length'] = count+1;
- }
- this._max_date=d;
- this._colsS[count]=this._cols[count-1]+this._colsS[count-1];
-
- if (this._table_view) // month view
- this._reset_month_scale(b,dd,sd);
- else{
- this._reset_hours_scale(b,dd,sd);
- if (c.multi_day){
- var dhx_multi_day = 'dhx_multi_day';
-
- if(this._els[dhx_multi_day]) {
- this._els[dhx_multi_day][0].parentNode.removeChild(this._els[dhx_multi_day][0]);
- this._els[dhx_multi_day] = null;
- }
-
- var navline = this._els["dhx_cal_navline"][0];
- var top = navline.offsetHeight + this._els["dhx_cal_header"][0].offsetHeight+1;
-
- var c1 = document.createElement("DIV");
- c1.className = dhx_multi_day;
- c1.style.visibility="hidden";
- this.set_xy(c1, this._colsS[this._colsS.col_length-1]+this.xy.scroll_width, 0, 0, top); // 2 extra borders, dhx_header has -1 bottom margin
- b.parentNode.insertBefore(c1,b);
-
- var c2 = c1.cloneNode(true);
- c2.className = dhx_multi_day+"_icon";
- c2.style.visibility="hidden";
- this.set_xy(c2, this.xy.scale_width, 0, 0, top); // dhx_header has -1 bottom margin
-
- c1.appendChild(c2);
- this._els[dhx_multi_day]=[c1,c2];
- this._els[dhx_multi_day][0].onclick = this._click.dhx_cal_data;
- }
-
- if (this.config.mark_now){
- var now = new Date();
- if (now < this._max_date && now > this._min_date && now.getHours() >= this.config.first_hour && now.getHours()<this.config.last_hour){
- var day = this.locate_holder_day(now);
- var sm = now.getHours()*60+now.getMinutes();
- var now_time = document.createElement("DIV");
- now_time.className = "dhx_now_time";
- now_time.style.top = (Math.round((sm*60*1000-this.config.first_hour*60*60*1000)*this.config.hour_size_px/(60*60*1000)))%(this.config.hour_size_px*24)+1+"px";
- b.childNodes[day].appendChild(now_time);
- }
- }
- }
-};
-scheduler._reset_hours_scale=function(b,dd,sd){
- var c=document.createElement("DIV");
- c.className="dhx_scale_holder";
-
- var date = new Date(1980,1,1,this.config.first_hour,0,0);
- for (var i=this.config.first_hour*1; i < this.config.last_hour; i++) {
- var cc=document.createElement("DIV");
- cc.className="dhx_scale_hour";
- cc.style.height=this.config.hour_size_px-(this._quirks?0:1)+"px";
- cc.style.width=this.xy.scale_width+"px";
- cc.innerHTML=scheduler.templates.hour_scale(date);
-
- c.appendChild(cc);
- date=this.date.add(date,1,"hour");
- };
- b.appendChild(c);
- if (this.config.scroll_hour)
- b.scrollTop = this.config.hour_size_px*(this.config.scroll_hour-this.config.first_hour);
-};
-scheduler._reset_month_scale=function(b,dd,sd){
- var ed=scheduler.date.add(dd,1,"month");
-
- //trim time part for comparation reasons
- var cd=new Date();
- this.date.date_part(cd);
- this.date.date_part(sd);
-
- var rows=Math.ceil(Math.round((ed.valueOf()-sd.valueOf()) / (60*60*24*1000) ) / 7);
- var tdcss=[];
- var height=(Math.floor(b.clientHeight/rows)-22);
-
- this._colsS.height=height+22;
- var h = this._colsS.heights = [];
- for (var i=0; i<=7; i++)
- tdcss[i]=" style='height:"+height+"px; width:"+((this._cols[i]||0)-1)+"px;' "
-
-
-
- var cellheight = 0;
- this._min_date=sd;
- var html="<table cellpadding='0' cellspacing='0'>";
- for (var i=0; i<rows; i++){
- html+="<tr>";
- for (var j=0; j<7; j++){
- html+="<td";
- var cls = "";
- if (sd<dd)
- cls='dhx_before';
- else if (sd>=ed)
- cls='dhx_after';
- else if (sd.valueOf()==cd.valueOf())
- cls='dhx_now';
- html+=" class='"+cls+" "+this.templates.month_date_class(sd,cd)+"' ";
- html+="><div class='dhx_month_head'>"+this.templates.month_day(sd)+"</div><div class='dhx_month_body' "+tdcss[j]+"></div></td>";
- sd=this.date.add(sd,1,"day");
- }
- html+="</tr>";
- h[i] = cellheight;
- cellheight+=this._colsS.height;
- }
- html+="</table>";
- this._max_date=sd;
-
- b.innerHTML=html;
- return sd;
-};
-scheduler.getLabel = function(property, key) {
- var sections = this.config.lightbox.sections;
- for (var i=0; i<sections.length; i++) {
- if(sections[i].map_to == property) {
- var options = sections[i].options;
- for (var j=0; j<options.length; j++) {
- if(options[j].key == key) {
- return options[j].label;
- }
- }
- }
- }
- return "";
-};
-scheduler.updateCollection = function(list_name, collection){
- var list = scheduler.serverList(list_name);
- if(!list) return false;
- list.splice(0,list.length);
- list.push.apply(list, collection||[]);
- scheduler.callEvent("onOptionsLoad", []);
- scheduler.resetLightbox();
- return true;
-};
-scheduler._lame_copy=function(target, source){
- for(var key in source)
- target[key] = source[key];
- return target;
-};
diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/whatsnew.txt b/addons/web_calendar/static/lib/dhtmlxScheduler/whatsnew.txt index 66d304363ea..32b22f42fc9 100644 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/whatsnew.txt +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/whatsnew.txt @@ -1,3 +1,20 @@ +3.5
+ Ability to show multiple scheduler's per page (PRO version only)
+ Supports loading JSON directly from Connectors
+ Custom events rendering
+ Timeline view improved (support for drag, resize, event height control)
+ New 'dhx_terrace' skin
+ New options for blocking dates
+ Marking time intervals
+ Highlighting time intervals
+ New API methods: updateView, showEvent, getRenderedEvent, getActionData
+ JSMessage included
+ Grid view
+ New configuration options
+ Simplified access to lightbox section objects
+
+
+
3.0
Version of scheduler for touch phones
WeekAgenda view
@@ -10,6 +27,10 @@ Multiline header for timeline view
Configurable work-time bounds
API to access lightbox values
+
+ build 120111:
+ - updated dhtmlxscheduker_mobile.js
+
2.3
diff --git a/addons/web_calendar/static/src/css/web_calendar.css b/addons/web_calendar/static/src/css/web_calendar.css index 6a82b6cea42..e477a88a3e1 100644 --- a/addons/web_calendar/static/src/css/web_calendar.css +++ b/addons/web_calendar/static/src/css/web_calendar.css @@ -1,1064 +1,35 @@ -.oe_view_manager_view_calendar { - position: relative; +@charset "utf-8"; +.openerp .oe_view_manager_view_calendar { + position: relative; } -.oe_calendar_table { - position: absolute; - left: 0px; - right: 0px; - top: 0px; - border-top: 3px solid #eee; - width:100%; - overflow: hidden; -} -.oe_calendar { - background-color:#eee; - height: 600px; - border-right: 1px solid #eee; -} -.oe_calendar_sidebar { - width: 200px; -} -.oe_calendar_mini { - background-color: #eee; - padding: 5px; -} -.oe_calendar_filter { - padding: 0 10px; -} -.openerp .dhx_mini_calendar { - -moz-box-shadow: none; - -khtml-box-shadow: none; - -webkit-box-shadow: none; - box-shadow: none; -} -.openerp .dhx_cal_container, .openerp .dhx_cal_event { - background-position:0 24px; - background-repeat:repeat-x; - font-family: Ubuntu, Helvetica, sans-serif; - position:relative; - overflow:hidden; -} -.openerp .dhx_cal_container.dhx_mini_calendar { - background-color:#eee; -} -.openerp .dhx_cal_container div{ - -moz-user-select:none; - -moz-user-select:-moz-none; -} - -.openerp .dhx_cal_navline div{ - top:2px; - white-space:nowrap; -} - -.openerp .dhx_cal_navline .dhx_cal_date{ - font-weight:bold; - float:left; - font-size:1em; - color:#444; - margin:2px 0px 0px 10px; -} - -.openerp .dhx_cal_button .dhx_left_bg{width:1px;overflow:hidden;height:1px;z-index:20;top:0;} - -.openerp .dhx_cal_today_button, .openerp .dhx_cal_prev_button, .openerp .dhx_cal_next_button { - display: inline-block; - vertical-align:0px; - float: left; - height:14px; - line-height:14px; - font-size:90%; - border: 1px solid #ababab; - color: #404040; - padding: 3px 10px; - margin:0px 3px; - text-align: center; - cursor:pointer; - -o-background-size: 100% 100%; - -moz-background-size: 100% 100%; - -webkit-background-size: auto auto !important; - background-size: 100% 100%; - background: #d8d8d8 none; - background: none, -webkit-gradient(linear, left top, left bottom, from(#efefef), to(#d8d8d8)); - background: none, -webkit-linear-gradient(#efefef, #d8d8d8); - background: none, -moz-linear-gradient(#efefef, #d8d8d8); - background: none, -o-linear-gradient(top, #efefef, #d8d8d8); - background: none, -khtml-gradient(linear, left top, left bottom, from(#efefef), to(#d8d8d8)); - -moz-border-radius: 3px; - -webkit-border-radius: 3px; - -o-border-radius: 3px; - -ms-border-radius: 3px; - border-radius: 3px; - -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(255, 255, 255, 0.8) inset; - -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(255, 255, 255, 0.8) inset; - -o-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(255, 255, 255, 0.8) inset; - box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(255, 255, 255, 0.8) inset; - text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5); - -webkit-font-smoothing: antialiased; - outline: none; - font-weight:normal; -} -.openerp .dhx_cal_prev_button { - background: url("/web_calendar/static/src/img/minical_left.png") no-repeat 8px 7px, -webkit-gradient(linear, left top, left bottom, from(#efefef), to(#d8d8d8)); - background: url("/web_calendar/static/src/img/minical_left.png") no-repeat 8px 7px, -webkit-linear-gradient(#efefef, #d8d8d8); - background: url("/web_calendar/static/src/img/minical_left.png") no-repeat 8px 7px, -moz-linear-gradient(#efefef, #d8d8d8); - background: url("/web_calendar/static/src/img/minical_left.png") no-repeat 8px 7px, -o-linear-gradient(top, #efefef, #d8d8d8); - background: url("/web_calendar/static/src/img/minical_left.png") no-repeat 8px 7px, -khtml-gradient(linear, left top, left bottom, from(#efefef), to(#d8d8d8)); -} -.openerp .dhx_cal_next_button { - background: url("/web_calendar/static/src/img/minical_right.png") no-repeat 8px 7px, -webkit-gradient(linear, left top, left bottom, from(#efefef), to(#d8d8d8)); - background: url("/web_calendar/static/src/img/minical_right.png") no-repeat 8px 7px, -webkit-linear-gradient(#efefef, #d8d8d8); - background: url("/web_calendar/static/src/img/minical_right.png") no-repeat 8px 7px, -moz-linear-gradient(#efefef, #d8d8d8); - background: url("/web_calendar/static/src/img/minical_right.png") no-repeat 8px 7px, -o-linear-gradient(top, #efefef, #d8d8d8); - background: url("/web_calendar/static/src/img/minical_right.png") no-repeat 8px 7px, -khtml-gradient(linear, left top, left bottom, from(#efefef), to(#d8d8d8)); -} -.openerp .dhx_mini_calendar .dhx_cal_prev_button, .openerp .dhx_mini_calendar .dhx_cal_next_button { - width:16px; - height:18px; - margin-bottom:1px; -} -.openerp .dhx_mini_calendar .dhx_cal_next_button { - padding:3px 1px 3px 0px; - float:right; -} -.openerp .dhx_cal_prev_button:hover, .openerp .dhx_cal_prev_button:active, .openerp .dhx_cal_today_button:hover, .openerp .dhx_cal_today_button:active, .openerp .dhx_cal_next_button:hover, .openerp .dhx_cal_next_button:active { -} - -.openerp .dhx_mini_calendar .dhx_cal_prev_button, .openerp .dhx_mini_calendar .dhx_cal_next_button, .openerp .dhx_mini_calendar .dhx_cal_today_button { - background:none; - border:none; - box-shadow: none; - -webkit-box-shadow: none; - -o-box-shadow: none; -} - -.openerp .dhx_mini_calendar .dhx_cal_prev_button { - background:url("/web_calendar/static/src/img/minical_left.png") no-repeat 5px 6px; -} - -.openerp .dhx_mini_calendar .dhx_cal_next_button { - background:url("/web_calendar/static/src/img/minical_right.png") no-repeat 8px 6px; -} - -.openerp .dhx_mini_calendar .dhx_month_head { - font-size:0.9em; - color:#888 -} -.openerp .dhx_mini_calendar .dhx_month_head:hover { - background-color:#bbb; - color:white; - text-shadow:none; -} -.openerp .dhx_mini_calendar .dhx_scale_bar { - border-width:0px; - padding:1px 0 2px 0; -} - -.openerp .dhx_cal_tab { - width:59px; - height:16px; - line-height:16px; - text-align:center; - text-transform:uppercase; - text-decoration:none; - font-weight:bold; - font-size:80%; - color:#555; - margin:6px 1px 0px 1px; - padding-top:2px; - cursor:pointer; - float:right; - background-color:#bbb; - -webkit-border-top-left-radius:4px; - -webkit-border-top-right-radius:4px; - -moz-border-radius-topleft:4px; - -moz-border-radius-topright:4px; - border-top-left-radius:4px; - border-top-right-radius:4px; -} -.openerp .dhx_cal_tab[name="month_tab"] { right:16px; } -.openerp .dhx_cal_tab[name="week_tab"] { right:78px; } -.openerp .dhx_cal_tab[name="day_tab"] { right:123px; } - -.openerp .dhx_cal_tab:hover { - background-color:#ddd; -} - -.openerp .dhx_cal_tab.active{ - height:17px; - line-height:17px; - text-decoration:none; - cursor:default; - /*border:1px dotted #8894A3;*/ - border-bottom:0px; - background-color:white /*#F4F4F4;*/ -} - -.openerp .dhx_cal_tab[name="day_tab"] { - margin-right:18px; -} - -.openerp .dhx_cal_header{ - position:absolute; - left:10px; - top:23px; - width:750px; - text-transform:uppercase; - font-size:0.8em; - font-weight:bold; - color:#3F3F3F; - /*border-bottom:1px dotted #8894A3; - border-top:1px dotted #8894A3; - border-right:1px dotted #8894A3;z-index:2;*/ - overflow:hidden; - background-color: white; - text-shadow: 0 1px 0 white; - -webkit-border-top-left-radius:4px; - -webkit-border-top-right-radius:4px; - -moz-border-radius-topleft:4px; - -moz-border-radius-topright:4px; - border-top-left-radius:4px; - border-top-right-radius:4px; -} - -.openerp .dhx_cal_data{ - position:absolute; - top:44px; - width:600px; - overflow-y:auto; - overflow-x:hidden; - background-color:white; -} -.openerp .oe_cal_month .dhx_cal_data { - overflow-y: auto; -} - - -.openerp .dhx_cal_data tr td { - border-width:0px; -} - -.openerp .dhx_scale_bar{ - position:absolute; - text-align:center; - text-shadow: 0 1px 0 white; - padding-top:2px; -} - -.openerp .dhx_scale_holder{ - position:absolute; - border-right:1px solid #ccc; - background-image:url("/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/databg.png"); -} -.openerp .dhx_scale_holder_now{ - position:absolute; - border-right:1px solid #ccc; - background-image:url("/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/databg_now.png"); -} - -.openerp .dhx_scale_hour{ - height:41px; - width:50px; - border-bottom:1px dotted #8894A3; - border-right:1px dotted #8894A3; - background-color:#ddd; - text-align:center; - line-height:40px; - color:#586A7E; - overflow:hidden; -} - -.openerp .dhx_month_head{ - background-color:#F4F4F4; - color:#2F3A48; - text-shadow: 0 1px 0 white; - font-weight:bold; - text-align:center; - border-left:1px solid #E9E9E9; - height:18px; - text-align:right; - font-size:0.9em; -} -.openerp .dhx_mini_calendar .dhx_month_head{ - padding-right:6px; -} - -.openerp .dhx_cal_data table tbody tr td:nth-child(7) { - color:red; -} - - -.openerp .dhx_now .openerp .dhx_month_body{ - background-color:white; -} - -.openerp .dhx_after .dhx_month_body,.openerp .dhx_before .dhx_month_body{ -background-color:#ECECEC; -} - -.openerp .dhx_after .dhx_month_head,.openerp .dhx_before .dhx_month_head{background-color:#F4F4F4;color:#94A6BB;} - -.openerp .dhx_now .dhx_month_head{ - background-color:#ddd; -} - -.openerp .dhx_cal_drag{position:absolute;z-index:9999;background-color:#FFE763;border:1px solid #B7A543;opacity:.5;filter:alpha(opacity=50);} - -.openerp .dhx_loading{position:absolute;width:128px;height:15px;background-image:url(/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/loading.gif);z-index:9999;} - -.openerp .dhx_multi_day_icon, .openerp .dhx_multi_day{ - background-color:#A8B4C3; - background-repeat:no-repeat; - -webkit-border-top-left-radius:4px; - -webkit-border-top-right-radius:4px; - -moz-border-radius-topleft:4px; - -moz-border-radius-topright:4px; - border-top-left-radius:4px; - border-top-right-radius:4px; -} -.openerp .dhx_multi_day{ - position:absolute; -} - -.openerp .dhx_multi_day_icon{ - background-image:url(/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/clock_big.gif); -} - -.openerp .dhx_multi_day_icon_small { - background-image:url(/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/clock_small.gif); -} - -.openerp .dhx_multi_day_icon, .openerp .dhx_multi_day_icon_small{ - background-position:center center; - background-repeat:no-repeat; - border-left:0px; -} - -.openerp .dhtmlxLayoutPolyContainer_dhx_skyblue .dhx_cal_container{background-color:none;} - -.openerp .dhx_cal_event div{ - font-family: Ubuntu, Helvetica, sans-serif; - background-color:#FFE763; - border:1px solid #a73636; - color:#887A2E; - overflow:hidden; - font-size:100%; -} - -.openerp .dhx_move_denied .dhx_cal_event .dhx_header, .openerp .dhx_move_denied .dhx_cal_event .dhx_title{cursor:default;} - -.openerp .dhx_cal_event .dhx_header{ - height:0px; - margin-left:1px; - /*border-width:1px 1px 0 1px;*/ - cursor:pointer; -} - -.openerp .dhx_cal_event .dhx_title { - height:18px; - border-bottom-style:solid; - border-top-style:solid; - font-weight:bold; - text-align:center; - background-position:right; - background-repeat:no-repeat; - cursor:pointer; - vertical-align:middle; - padding-top:2px; - font-size: 90%; - -moz-border-radius-topleft: 3px; -webkit-border-top-left-radius: 3px; border-top-left-radius: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 3px; border-top-right-radius: 3px; -} - -.openerp .dhx_cal_event .dhx_body{ - border-width:0 1px 1px 1px; - padding:0px 5px; - -moz-border-radius-bottomleft: 3px; -webkit-border-bottom-left-radius: 3px; border-bottom-left-radius: 3px; -moz-border-radius-bottomright: 3px; -webkit-border-bottom-right-radius: 3px; border-bottom-right-radius: 3px; - font-size:90%; - line-height:9px; -} -.openerp .dhx_cal_event .dhx_body { - /* fp request: hide the title in weekly/daily views */ - -moz-border-radius-topleft: 3px; -webkit-border-top-left-radius: 3px; border-top-left-radius: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 3px; border-top-right-radius: 3px; - padding-top: 4px; -} - -.openerp .dhx_resize_denied .dhx_cal_event .dhx_footer{ - cursor:default; -} - -.openerp .dhx_cal_event .dhx_footer{ - height:2px; - margin-left:2px; - border-width:0 1px 1px 1px; - cursor:s-resize; - overflow:auto; -} - -/* -The old one - -.openerp .dhx_cal_event_line{ - background-image:url(/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/event-bg.png); - background-color:#FFE763; - border:1px solid #FFBD51; - border-radius:3px; - height:13px; - padding-left:10px; - color:#000; - cursor:pointer; - overflow:hidden; -}*/ - -.openerp .dhx_cal_event_clear, .openerp .dhx_cal_event_line{ - font-family:Ubuntu, Helvetica, sans-serif; - font-size:95%; - height:15px; - line-height:15px; - padding:0px 2px; - color:white; - white-space:nowrap; - overflow:hidden; - cursor:pointer; - vertical-align:middle; -} -.openerp .dhx_cal_event_clear:hover, .openerp .dhx_cal_event_line:hover{ - background-color:#ccc; -} - -.openerp .dhx_in_move{background-color:#FFFF80;} - -.openerp div .dhx_cal_editor{ - background-color:white; - border:1px solid #B7A543; - width:100%; - /*min-height:40px;*/ - height:100%; - z-index:999; - position:absolute; - overflow:hidden; -} - -.openerp textarea .dhx_cal_editor{ - background-color:white; - width:100%; -/*min-height:40px;*/ - height:100%; - border:0 solid black; - margin:none; - padding:none; - overflow:auto; -} - -.openerp div .dhx_menu_head{background-image:url(/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/controls.gif);background-position:0 -43px;width:10px;height:10px;margin-left:5px;margin-top:1px;border:none;cursor:default;} - -.openerp div .dhx_menu_icon{background-image:url(/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/controls.gif);width:20px;height:20px;margin-left:-5px;margin-top:0;border:none;cursor:pointer;} -.openerp div .icon_details{background-position:0 0;} - -.openerp div .icon_edit{background-position:-22px 0;} -.openerp div .icon_save{background-position:-84px -1px;} -.openerp div .icon_cancel{background-position:-62px 0;}div.icon_delete{background-position:-42px 0;} -.openerp div .dhx_now_time{position:absolute;width:100%;border-bottom:2px dotted red;z-index:1;} -.openerp div .dhx_time_block{position:absolute;width:100%;background:silver;opacity:.4;filter:alpha(opacity=40);z-index:1;} - -.openerp .dhx_unselectable, .dhx_unselectable div{-webkit-user-select:none;-moz-user-select:none;-moz-user-select:-moz-none;} - -.openerp .dhx_cal_light{background-color:#FFE763;border-radius:5px; - font-size:8pt;border:1px solid #B7A64B;color:#887A2E;position:absolute;z-index:10001;width:580px;height:300px;box-shadow:5px 5px 5px #888;} - -.openerp .dhx_cal_light_wide{width:650px;} -.openerp .dhx_mark{position:relative;top:3px;background-image:url('/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/controls.gif');background-position:0 -43px;padding-left:10px;} - -.openerp .dhx_ie6 .dhx_mark{background-position:6px -41px;} - -.openerp .dhx_cal_light select{font-size:8pt;color:#887A2E;padding:2px;margin:0;}.openerp .dhx_cal_ltitle{padding:2px 0 2px 5px;overflow:hidden;white-space:nowrap;} - -.openerp .dhx_cal_ltitle span{white-space:nowrap;} - -.openerp .dhx_cal_lsection{background-color:#DBCF8C;color:#FFF4B5;font-weight:bold;padding:5px 0 3px 10px;}.openerp .dhx_section_time{background-color:#DBCF8C;} - -.openerp .dhx_cal_lsection .dhx_fullday{float:right;margin-right:5px;color:#887A2E;font-size:12px;font-weight:normal;line-height:20px;vertical-align:top;cursor:pointer;} - -.openerp .dhx_cal_lsection{font-size:18px;} - -.openerp .dhx_cal_ltext{padding:2px 0 2px 10px;overflow:hidden;} -.openerp .dhx_cal_ltext textarea{background-color:#FFF4B5;overflow:auto;border:none;color:#887A2E;height:100%;width:100%;outline:none!important;} -.openerp .dhx_time{font-weight:bold;} - -.openerp .dhx_cal_light .openerp .dhx_title{padding-left:10px;} - -.openerp .dhx_cal_larea{border:1px solid #DCC43E;background-color:#FFF4B5;overflow:hidden;margin-left:3px;width:572px;height:1px;} -.openerp .dhx_btn_set{padding:5px 10px 0 10px;float:left;}.openerp .dhx_btn_set div{float:left;height:21px;line-height:21px;vertical-align:middle;cursor:pointer;} -.openerp .dhx_save_btn{background-image:url('/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/controls.gif');background-position:-84px 0;width:21px;} -.openerp .dhx_cancel_btn{background-image:url('/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/controls.gif');background-position:-63px 0;width:20px;} -.openerp .dhx_delete_btn{background-image:url('/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/controls.gif');background-position:-42px 0;width:20px;} -.openerp .dhx_cal_cover{width:100%;height:100%;position:absolute;z-index:10000;top:0;left:0;background-color:black;opacity:.1;filter:alpha(opacity=10);} -.openerp .dhx_custom_button{padding:0 3px 0 3px;color:#887A2E;font-size:8pt;background-color:#FFE763;font-weight:normal;margin-right:5px;margin-top:0;cursor:pointer;} -.openerp .dhx_custom_button div{cursor:pointer;float:left;height:21px;line-height:21px;vertical-align:middle;} - -.openerp .dhx_cal_light_wide .dhx_cal_larea{border-top-width:0;} -.openerp .dhx_cal_light_wide .dhx_cal_lsection{border:0;float:left;text-align:right;width:100px;height:20px;font-size:16px;padding:5px 0 0 10px;} -.openerp .dhx_cal_light_wide .dhx_wrap_section{border-top:1px solid #DBCF8C;position:relative;background-color:#DBCF8C;overflow:hidden;} -.openerp .dhx_cal_light_wide .dhx_section_time{padding-top:2px!important;height:20px!important;} -.openerp .dhx_section_time{text-align:center;} -.openerp .dhx_cal_light_wide .dhx_cal_larea{width:730px;} -.openerp .dhx_cal_light_wide{width:738px;} -.openerp .dhx_cal_light_wide .dhx_section_time{background:transparent;} -.openerp .dhx_cal_light_wide .dhx_cal_checkbox label{padding-left:0;} -.openerp .dhx_cal_wide_checkbox input{margin-top:8px;margin-left:14px;} -.openerp .dhx_cal_light input{;font-size:8pt;color:#887A2E;} - -.openerp .dhx_cal_light_wide .dhx_cal_lsection .dhx_fullday{float:none;margin-right:0;color:#FFF4B5;font-weight:bold;font-size:16px;cursor:pointer;} - -.openerp .dhx_custom_button{float:right;height:21px;width:90px;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;} -.openerp .dhx_cal_light_wide .dhx_custom_button{position:absolute;top:0;right:0;margin-top:2px;} -.openerp .dhx_cal_light_wide .dhx_repeat_right{margin-right:55px;} -.openerp .dhx_cal_light_wide .dhx_repeat_divider{border-color:#FFE763;} - -.openerp .dhx_expand_icon{position:absolute;top:0;right:0;background-image:url(/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/colapce-expand-icon.gif);width:18px;height:18px;cursor:pointer;background-position:0 18px;z-index:16;} -.openerp .dhx_agenda_area{width:100%;height:100%;overflow-y:auto;background-image:url(/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/databg.png);} -.openerp .dhx_agenda_line{height:21px;clear:both;overflow:hidden;} -.openerp .dhx_agenda_line div{float:left;width:188px;border-right:1px dotted #8894A3;text-align:center;line-height:21px;overflow:hidden;} -.openerp .dhx_agenda_area .dhx_agenda_line div{border-right:0 dotted #8894A3;} -.openerp .dhx_v_border{position:absolute;left:186px;top:0;border-right:1px dotted #8894A3;width:1px;height:100%;} -.openerp .dhx_agenda_line .dhx_event_icon{width:20px;border-width:0;background:url(/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/icon.png) no-repeat;background-position:5px 4px;cursor:pointer;} -.openerp .dhx_agenda_line span{padding-left:5px;line-height:21px;} - - -.openerp .dhx_year_week{ - position:relative; - font-weight:bold; - font-size:1em; - color:#aaa; - vertical-align:middle; - border-top:1px solid #ccc; - border-bottom:1px solid #ccc; -} - -.openerp .dhx_year_month{ - height:18px; - line-height:18px; - padding-top:2px; - text-align:center; - vertical-align:middle; - text-transform:uppercase; - font-weight:bold; - font-size:0.9em; - text-shadow: 0 1px 0 white; - border:0px; - color:#444; -} -/*.openerp .dhx_mini_calendar .openerp .dhx_year_month{ - padding-top:0px; -} */ - -.openerp .dhx_mini_calendar - .dhx_year_body { - border:0px; -} - -.openerp .dhx_year_body .dhx_before .dhx_month_head,.openerp .dhx_year_body .dhx_after .dhx_month_head, .openerp .dhx_year_body .dhx_before .dhx_month_head a,.openerp .dhx_year_body .dhx_after .dhx_month_head a {color:#bbb;} - -.openerp .dhx_year_body .dhx_month_body{height:0;overflow:hidden;} - -.openerp .dhx_year_body .dhx_before .dhx_month_head, .dhx_year_body .dhx_after .dhx_month_head{cursor:default;} - -.openerp .dhx_tooltip{border:1px solid #BBB;background-image:url(/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/databg.png);position:absolute;z-index:9998;width:300px;height:auto; -font-size:8pt;overflow:hidden;} -.openerp .dhx_tooltip_line{line-height:20px;height:20px;overflow:hidden;} -.openerp .dhx_tooltip_line .dhx_event_icon{width:20px;height:20px;padding-right:10px;float:left;border-width:0;position:relative;background:url(/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/icon.png) no-repeat;background-position:5px 4px;cursor:pointer;} -.openerp .dhx_tooltip_date{float:left;width:auto;padding-left:5px;text-align:center;} - -.openerp .dhx_text_disabled{color:#887A2E;font-size:8pt;} - -.openerp .dhx_cal_navline div .dhx_minical_icon{width:18px;height:18px;left:190px;top:1px;cursor:pointer;background-image:url(/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/calendar.gif);} - -.openerp .dhx_matrix_scell{height:100%;} -.openerp .dhx_matrix_cell, -.openerp .dhx_matrix_scell{overflow:hidden;text-align:center;vertical-align:middle;border-bottom:1px dotted #8894A3;border-right:1px dotted #8894A3;} -.openerp .dhx_matrix_cell{background-color:white;} -.openerp .dhx_matrix_line{overflow:hidden;} -.openerp .dhx_matrix_cell div, .openerp .dhx_matrix_scell div{overflow:hidden;text-align:center;height:auto;} -.openerp .dhx_cal_lsection .dhx_readonly{font-size:9pt;font-size:8pt;padding:2px;color:#887A2E;} - -.openerp .dhx_matrix_scell.folder,.openerp .dhx_data_table.folder .dhx_matrix_cell{background-color:#969394;cursor:pointer;} -.openerp .dhx_matrix_scell .dhx_scell_level0{padding-left:5px;} -.openerp .dhx_matrix_scell .dhx_scell_level1{padding-left:20px;} -.openerp .dhx_matrix_scell .dhx_scell_level2{padding-left:35px;} -.openerp .dhx_matrix_scell .dhx_scell_level3{padding-left:50px;} -.openerp .dhx_matrix_scell .dhx_scell_level4{padding-left:65px;} -.openerp .dhx_matrix_scell.folder{font-weight:bold;text-align:left;} -.openerp .dhx_matrix_scell.folder .dhx_scell_expand{float:left;width:10px;padding-right:3px;} -.openerp .dhx_matrix_scell.folder .dhx_scell_name{float:left;width:auto;} -.openerp .dhx_matrix_scell.item .dhx_scell_name{padding-left:15px;text-align:left;} - -.openerp .dhx_data_table.folder .dhx_matrix_cell{border-right:0;} -.openerp .dhx_section_timeline{overflow:hidden;padding:4px 0 2px 10px;} -.openerp .dhx_section_timeline select{width:552px;} -.openerp .dhx_map_area{width:100%;height:100%;overflow-y:auto;overflow-x:hidden;background-image:url(/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/databg.png);} -.openerp .dhx_map_line .dhx_event_icon{width:20px;border-width:0;background:url(/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/icon.png) no-repeat;background-position:5px 4px;cursor:pointer;} -.openerp .dhx_map_line{height:21px;clear:both;overflow:hidden;} -.openerp .dhx_map{position:absolute;} -.openerp .dhx_map_line div{float:left;border-right:1px dotted #8894A3;text-align:center;line-height:21px;overflow:hidden;} -.openerp .dhx_map_line .headline_description{float:left;border-right:1px dotted #8894A3;text-align:center;line-height:21px;overflow:hidden;} -.openerp .dhx_map_line .dhx_map_description{float:left;border-right:0 dotted #8894A3;text-align:center;line-height:21px;overflow:hidden;} - -.openerp .dhx_map_line .line_description{float:left;border-right:1px dotted #8894A3;text-align:left;padding-left:5px;line-height:21px;overflow:hidden;} -.openerp .dhx_map_line.highlight{background-color:#C4C5CC;} -.openerp .dhx_map_area .dhx_map_line div{border-right:0 dotted #8894A3;}.dhtmlXTooltip.tooltip{-moz-box-shadow:3px 3px 3px #888;-webkit-box-shadow:3px 3px 3px #888;-o-box-shadow:3px 3px 3px #888;box-shadow:3px 3px 3px #888;filter:progid:DXImageTransform.Microsoft.Shadow(color='#888888',Direction=135,Strength=5);background-color:white;border-left:1px dotted #887A2E;border-top:1px dotted #887A2E;color:#887A2E;cursor:default;padding:10px;position:absolute;z-index:500;} -.openerp .dhx_cal_checkbox label{padding-left:5px;} -.openerp .dhx_cal_light .radio{padding:2px 0 2px 10px;} -.openerp .dhx_cal_light .radio input,.openerp .dhx_cal_light .radio label{line-height:15px;} -.openerp .dhx_cal_light .radio input{vertical-align:middle;margin:0;padding:0;} -.openerp .dhx_cal_light .radio label{vertical-align:middle;padding-right:10px;} -.openerp .dhx_cal_light .combo{padding:4px;} -.openerp .dhx_wa_column{float:left;} -.openerp .dhx_wa_column_last .dhx_wa_day_cont{border-left:1px dotted #8894A3;} - -.openerp .dhx_wa_scale_bar{padding-left:10px;font-size:11px;border-top:1px dotted #8894A3;border-bottom:1px dotted #8894A3;} -.openerp .dhx_wa_day_data{background-color:#FCFEFC;overflow-y:auto;} -.openerp .dhx_wa_ev_body{border-bottom:1px dotted #789;font-size:12px;padding:5px 0 5px 7px;} - -.openerp .dhx_wa_dnd{position:absolute;padding-right:7px;color:#887AE2!important;background-color:#FFE763!important;border:1px solid #B7A543;} -.openerp .dhx_cal_event_selected{background-color:#9cc1db;color:white;} -.openerp .dhx_second_scale_bar{border-bottom:1px dotted #586A7E;padding-top:2px;} -.openerp div .dhx_form_repeat input.radio{margin:-4px 0 0 -4px!ie;} -.openerp div .dhx_form_repeat input.checkbox{margin:0 0 0 -4px!ie;} - -.openerp .dhx_form_repeat,.openerp .dhx_form_repeat input{padding:0;margin:0;padding-left:5px; -font-size:11px;line-height:24px;} -.openerp .dhx_form_repeat{overflow:hidden;height:0;background-color:#FFF4B5;} -.openerp .dhx_cal_light_wide .dhx_form_repeat{background-color:transparent;} -.openerp .dhx_repeat_center,.openerp .dhx_repeat_left{height:115px;padding:10px 0 10px 10px;float:left;} -.openerp .dhx_repeat_left{width:95px;} -.openerp .dhx_repeat_center{width:335px;margin-top:12px;} -.openerp .dhx_repeat_divider{float:left;height:115px;border-left:1px dotted #DCC43E;width:1px;} -.openerp .dhx_repeat_right{float:right;height:115px;width:160px;padding:10px 3px 10px 10px;margin-top:7px;} -.openerp input .dhx_repeat_text{height:16px;width:27px;margin:0 4px 0 4px;line-height:18px;padding:0 0 0 2px;} -.openerp .dhx_form_repeat select{height:20px;width:87px;padding:0 0 0 2px;margin:0 4px 0 4px;} -.openerp input .dhx_repeat_date{height:18px;width:80px;padding:0 0 0 2px;margin:0 4px 0 4px;background-repeat:no-repeat;background-position:64px 0;border:1px #7f9db9 solid;line-height:18px;}input.openerp .dhx_repeat_radio{margin-right:4px;} -.openerp input .dhx_repeat_checkbox{margin:4px 4px 0 0;} -.openerp .dhx_repeat_days td{padding-right:5px;} -.openerp .dhx_repeat_days label{font-size:10px;} -.openerp .dhx_custom_button{width:90px;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;} -.openerp .dhx_custom_button_recurring{background-image:url(/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/but_repeat.gif);background-position:-5px 20px;width:20px;margin-right:10px;} -.openerp .dhx_cal_light_rec{width:640px;} -.openerp .dhx_cal_light_rec .dhx_cal_larea{width:632px;} -.openerp .dhx_cal_light_rec .dhx_cal_light_wide{width:816px;} -.openerp .dhx_cal_light_rec .dhx_cal_light_wide .dhx_cal_larea{width:808px;} - -.openerp .dhx_cal_navline{background-color:none;height:23px!important;} - -.openerp .dhx_month_head{background-color:#F4F4F4;} - -.openerp .dhx_after .dhx_month_head,.openerp .dhx_before .dhx_month_head{background-color:#F4F4F4;} - -.openerp .dhx_after .dhx_month_body,.openerp .dhx_before .dhx_month_body{background-color:#EFEDE2;} - -.openerp .dhx_cal_event div{border:1px solid #FFBD51;background-color:#FFE4AB;color:#000;} -.openerp .dhx_in_move{background-image:url(/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/move.png);} - -.openerp .dhx_cal_event .dhx_title{background-color:#FFE4AB;} - -.openerp .dhx_cal_light{-moz-box-shadow:5px 5px 5px #888;-khtml-box-shadow:5px 5px 5px #888;background-color:#EBEBEB;border:2px solid #A4BED4;color:#000;} -.openerp .dhx_cal_larea{border:1px solid #A4BED4;border-width:0 1px 1px;background-color:#FFF;} - -.openerp .dhx_cal_lsection{background-image:url(/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/lightbox.png);font-size:14px;padding:5px 0 5px 10px;color:#000;} - -.openerp .dhx_cal_light_wide .dhx_cal_lsection{background-image:url(/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/multi-days-bg.png);}.openerp .dhx_cal_ltext textarea{background-color:#fff;color:#000;} - -.openerp .dhx_cal_light select,.openerp .dhx_cal_light input{color:#000;} -.openerp .dhx_save_btn{background-image:url(/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/controlls5.png);} - -.openerp .dhx_cancel_btn{background-image:url(/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/controlls5.png);} -.openerp .dhx_delete_btn{background-image:url(/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/controlls5.png);} - -.openerp .div .dhx_menu_head{background-image:url(/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/controlls5.png);border:1px solid #FFE4AB;} - -.openerp .div .dhx_menu_icon{background-image:url(/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/controlls5.png);border:medium none;} - -.openerp .dhx_section_time{height:20px!important;padding:7px 0!important;text-align:center;background:white;} - -.openerp .div .dhx_cal_editor{background-color:#FFE4AB;} - -.openerp .dhx_month_body{ - border-left:1px solid #E9E9E9; - border-bottom:1px solid #E9E9E9; -} - -.openerp .dhx_scale_bar_last{border-right:none;} - -.openerp .dhx_month_head .dhx_year_event{background-color:#ddd;} - -.openerp .dhx_year_body .dhx_before .dhx_month_head,.openerp .dhx_year_body .dhx_after .dhx_month_head, .dhx_year_body .dhx_before .dhx_month_head a,.openerp .dhx_year_body .dhx_after .dhx_month_head a{color:#EFEDE2 ;} - -.openerp .dhx_cal_lsection .dhx_readonly{color:#000;} -.openerp .dhx_tooltip{-moz-box-shadow:2px 2px 2px #888;-khtml-box-shadow:2px 2px 2px #888;} -.openerp .dhx_custom_button{margin-top:-2px;} -.openerp .dhx_cal_lsection .dhx_fullday{color:#000;} -.openerp .dhx_cal_lsection .dhx_cal_checkbox{height:16px;line-height:18px;} -.openerp .dhx_cal_light_wide -.openerp .dhx_cal_lsection .dhx_cal_checkbox{height:20px;} -.openerp .dhx_cal_checkbox label{vertical-align:top;} -.openerp .dhx_cal_light_wide .dhx_cal_lsection{color:black;} -.openerp .dhx_cal_light_wide .dhx_wrap_section{border-top:1px solid #A4BED4;background-image:url(/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/multi-days-bg.png);} -.openerp .dhx_cal_light_wide .dhx_cal_ltext{border-left:1px solid #A4BED4;} -.openerp .dhx_cal_light_wide .dhx_cal_ltext{background-color:white;} -.openerp .dhx_custom_button{background:white;color:black;} -.openerp .dhx_form_repeat{background:white;} -.openerp .dhx_repeat_divider{border-left:1px solid #A4BED4;} -.openerp .dhx_cal_header .dhx_second_cal_header{background-image:url("/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/second-top-days-bg.png");padding-right:20px;} - -.openerp .dhx_second_scale_bar{border-bottom:0;padding-top:4px;} -.openerp .dhx_cal_light_wide .dhx_cal_lsection .dhx_fullday,.openerp .dhx_cal_lsection .dhx_fullday{color:#000;font-size:14px;} -.openerp .dhx_cal_light_wide .dhx_cal_lsection{font-size:14px;padding-right:10px;} - - -.openerp .dhx_scale_bar { -/*background-color:#bac6cf; - border-left:1px dotted #7e7e7e; */ - } - - -.openerp .dhx_cal_drag { - background-color:#ff8d8d; - border:1px solid #a73636; -} - - - -.openerp .dhx_in_move{ - background-color:#f7ffb1; -} - - -.openerp .dhx_cal_event div .dhx_menu_icon { - border: medium none; -} - -.openerp .dhx_after .dhx_month_body, .openerp .dhx_before .dhx_month_body { - background-color:#e9e9e9; -} - - -.openerp .dhx_cal_light { - background-color:#ff8d8d; - color: #000102; - border:1px solid #b7a543; -} - -.openerp .dhx_cal_light select { - color: #000102; -} - -.openerp .dhx_cal_lsection { - background-color:#dbcf8c; - color: #fff4b5; -} - -.openerp .dhx_cal_larea { - background-color:#fff4b5; - border:1px solid #b7a543; -} - - -.openerp .dhx_agenda_area{ - background-image:url("/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/databg.png"); -} - -.openerp .dhx_agenda_line div { - border-right:1px dotted #7e7e7e; -} - -.openerp .dhx_agenda_area .dhx_agenda_line div { - border-right:0px dotted #7e7e7e; -} - - -.openerp .dhx_scale_bar_last { - border-right: none; -} - -.openerp .dhx_year_body .dhx_before .dhx_month_head, .openerp .dhx_year_body .dhx_after .dhx_month_head, .openerp .dhx_year_body .dhx_before .dhx_month_head a, .openerp .dhx_year_body .dhx_after .dhx_month_head a { - color:#bbb; -} -.openerp .dhx_year_body .dhx_before .dhx_month_head:hover, .openerp .dhx_year_body .dhx_after .dhx_month_head:hover, .openerp .dhx_year_body .dhx_before .dhx_month_head a:hover, .openerp .dhx_year_body .dhx_after .dhx_month_head a:hover { - color:white; - text-shadow:none; -} - -.openerp .dhx_tooltip { - background-image:url("/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/databg.png"); -} - -.openerp .dhx_cal_event div .dhx_menu_head { - border:none; -} - -div.openerp .dhx_menu_head{ - border:1px solid #ff8d8d; -} - -.openerp .dhx_after .dhx_month_head, .openerp .dhx_before .dhx_month_head { - color:#8c9299; -} - -.openerp .dhx_cal_data .dhx_agenda_line { - color:#000102; -} - -.openerp .dhx_cal_header .dhx_agenda_line { - color: #020202; -} - -.openerp .dhx_tooltip_line { - color:#000102; -} - -.openerp .dhx_cal_light select { - background-color: #ffffff; -} - -.openerp .dhx_custom_button { - color: #000102; - background-color: #bac6cf; -} - -div.openerp .dhx_form_repeat { - background-color: #ffffff; -} - -div.openerp .dhx_repeat_divider { - border-left:1px dotted #dbcf8c; -} - - -.openerp .dhx_v_border { - border-right:1px dotted #8c9299; -} - - -.openerp .dhx_scale_bar_last { - border-right: none; -} - -.openerp .dhx_tooltip { - background-image:url("/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/databg.png"); -} - -.openerp .dhx_text_disabled { - color:#000102; -} - -.openerp .dhx_mini_calendar .dhx_calendar_click { - background-color:#bac6cf; -} - -.openerp .dhx_matrix_cell, .openerp .dhx_matrix_scell { - border-bottom:1px dotted #757575; - border-right:1px dotted #757575; -} - -.openerp .dhx_matrix_cell { - background-color: #ffffff; -} - - -/*=================================================================*/ -/* pro */ -/*=================================================================*/ - - - -.openerp .dhx_in_move{ - background-image:url("/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/move.png"); -} -.openerp .dhx_cal_light{ - background-color:#bac6cf; - border:2px solid #757575; - color:#000102; -} - -.openerp .dhx_cal_larea{ - border:1px solid #757575; - background-color:#FFFFFF; -} - -.openerp .dhx_cal_lsection{ - background-image:url("/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/lightbox.png"); - color:#000102; -} - -.openerp .dhx_cal_ltext{ - background-color:#ffffff; -} - -.openerp .dhx_cal_ltext textarea{ - color:#000102; - background-color:#ffffff; -} - -.openerp .dhx_form_repeat input, .openerp .dhx_form_repeat select{ - background-color:white; - color:black; -} - -.openerp .dhx_cal_light select{ - color:#000102; - background-color:#ffffff; -} - -.openerp .dhx_section_time{ - background-image:none; - background-color:#ffffff; -} - -div.openerp .dhx_cal_editor{ - background-color:#ff8d8d; -} - -div.openerp .dhx_cal_editor textarea { - color: #000102; -} - - -/* .openerp .dhx_year_week{ - background-image:url("./imgs/top-days-bg.png"); -} - -.openerp .dhx_month_head.openerp .dhx_year_event{ - background-color:#ff8d8d; -} */ - -.openerp .dhx_cal_lsection .dhx_readonly{ - color:#000102; -} - -.openerp .dhx_after .dhx_month_head, .openerp .dhx_before .dhx_month_head { - background-color:#F4F4F4; -} - -/* Tree view */ -.openerp .dhx_matrix_scell.folder, .dhx_data_table.folder .dhx_matrix_cell{ - background-color: #7e7e7e; -} -.dhtmlXTooltip.tooltip{ - border-left:1px dotted #7e7e7e; - border-top:1px dotted #7e7e7e; -} -.openerp .dhx_map_area{ - background-image:url("/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/databg_now.png"); -} -.openerp .dhx_map_line div{ - border-right:1px dotted #7e7e7e; -} -.openerp .dhx_map_line .headline_description{ - border-right:1px dotted #7e7e7e; -} -.openerp .dhx_map_line .dhx_map_description{ - border-right: 0px dotted #7e7e7e; -} -.openerp .dhx_map_line .line_description{ - border-right:1px dotted #7e7e7e; -} -.openerp .dhx_map_line.highlight{ - background-color: #bac6cf; -} -.openerp .dhx_map_area .dhx_map_line div{ - border-right:0px dotted #7e7e7e; -} -/* Map view */ -.openerp .dhx_map_area{ - background-image:url("/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/databg.png"); -} -/* Map view end */ - - -/* Agenda week start */ -.openerp .dhx_wa_column_last .dhx_wa_day_cont{ - border-left: 1px dotted #757575; -} -.openerp .dhx_wa_scale_bar { - border-top: 1px dotted #757575; - border-bottom: 1px dotted #757575; - color: #020202; -} -.openerp .dhx_wa_day_data { - background-color: #ffffff; -} -.openerp .dhx_wa_ev_body { - border-bottom: 1px dotted #757575; - color: #000102; -} -.openerp .dhx_wa_dnd { - color: #525253 !important; - background-color: #f7ffb1 !important; - border: 1px solid #757575; -} -.openerp .dhx_cal_event_selected{ - background-color: #757575; -} -/* Agenda week end */ -.openerp .dhx_scale_bar_header { - border-bottom: 1px dotted #8894A3; -} - -/*All*/ -/* increase width of lightbox */ -.openerp .dhx_cal_light_wide .dhx_cal_lsection{ - background-image:url(/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/multi-days-bg.png); -} -/*2.3*/ -.openerp .dhx_cal_lsection .dhx_fullday{ - color:#000000; -} -.openerp .dhx_cal_light_wide .dhx_cal_lsection{ - color:#000000; -} -.openerp .dhx_cal_light_wide .dhx_wrap_section{ - border-top:1px solid #757575; - background-image:url(/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/multi-days-bg.png); -} -.openerp .dhx_cal_light_wide .dhx_cal_ltext{ - border-left:1px solid #757575; -} -.openerp .dhx_cal_light_wide .dhx_cal_ltext { - background-color:#ffffff; -} -.openerp .dhx_custom_button{ - background:#ffffff; - color:#000000; -} -/* timeline second scale start */ -.openerp .dhx_cal_header.openerp .dhx_second_cal_header { - background-image: url("/web_calendar/static/lib/dhtmlxScheduler/codebase/imgs/second-top-days-bg.png"); +.openerp .oe_calendar_sidebar { + width: 200px; + padding: 5px; } -/* timeline second scale end */ -.openerp .dhx_cal_light_wide .dhx_cal_lsection .dhx_fullday, .openerp .dhx_cal_lsection .dhx_fullday{ - color:#000000; - font-size: 14px; +.openerp .oe_calendar { + background-color: white; + height: 600px; + border-right: 1px solid #eeeeee; } -.openerp .dhx_cal_light_wide .dhx_cal_lsection { - font-size: 14px; +.openerp .oe_calendar .oe_calendar_table { + position: absolute; + left: 0px; + right: 0px; + top: 0px; + border-top: 3px solid #eeeeee; + width: 100%; + overflow: hidden; } -.dhtmlxLayoutPolyContainer_dhx_skyblue .dhx_cal_container { - background-color: #d0e5ff; +.openerp .oe_calendar .oe_calendar_filter { + padding: 0 10px; } -.openerp div .dhx_cal_editor{ - border:1px solid #B7A543; +.openerp .oe_calendar .dhx_cal_select_menu .dhx_menu_icon.icon_edit { + display: none; } -.openerp .dhx_cal_light_wide .dhx_repeat_divider { - border-color: #757575; +.openerp .oe_calendar.oe_cal_month .dhx_cal_data { + overflow-y: hidden; } -.openerp .dhx_cal_event .dhx_header, .openerp .dhx_cal_event .dhx_header { - display:none; +.openerp .oe_calendar.oe_cal_month .dhx_cal_data table tr td:last-child div.dhx_month_body { + padding-right: 5px; } -@media print { - div.dhx_cal_navline .dhx_cal_tab, div.dhx_cal_navline .dhx_cal_prev_button, div.dhx_cal_navline .dhx_cal_next_button, div.dhx_cal_navline .dhx_cal_today_button{ - display: none; - } - .openerp .dhx_cal_data { - overflow-y: hidden !important; - position: relative; - } -}
\ No newline at end of file diff --git a/addons/web_calendar/static/src/css/web_calendar.sass b/addons/web_calendar/static/src/css/web_calendar.sass new file mode 100644 index 00000000000..0dc3bfb43bd --- /dev/null +++ b/addons/web_calendar/static/src/css/web_calendar.sass @@ -0,0 +1,40 @@ +@charset "utf-8" + +.openerp + .oe_view_manager_view_calendar + position: relative + +.openerp + .oe_calendar_sidebar + width: 200px + padding: 5px + + .oe_calendar + background-color: white + height: 600px + border-right: 1px solid #eee + + .oe_calendar_table + position: absolute + left: 0px + right: 0px + top: 0px + border-top: 3px solid #eee + width: 100% + overflow: hidden + + .oe_calendar_filter + padding: 0 10px + + // Dhtmlx Scheduler css overrides + .dhx_cal_select_menu .dhx_menu_icon.icon_edit + display: none + + &.oe_cal_month .dhx_cal_data + overflow-y: hidden + + table tr td:last-child div.dhx_month_body + padding-right: 5px + +// au BufWritePost,FileWritePost *.sass :!sass --style expanded --line-numbers <afile> > "%:p:r.css" +// vim:tabstop=4:shiftwidth=4:softtabstop=4:fdm=marker: diff --git a/addons/web_calendar/static/src/js/calendar.js b/addons/web_calendar/static/src/js/calendar.js index 9c87f57626b..51bce57f7cd 100644 --- a/addons/web_calendar/static/src/js/calendar.js +++ b/addons/web_calendar/static/src/js/calendar.js @@ -22,13 +22,7 @@ instance.web_calendar.CalendarView = instance.web.View.extend({ this.view_id = view_id; this.view_type = 'calendar'; this.has_been_loaded = $.Deferred(); - this.creating_event_id = null; this.dataset_events = []; - this.form_dialog = new instance.web_calendar.CalendarFormDialog(this, { - destroy_on_close: false, - width: '80%', - min_width: 850 - }, this.options.action_views_ids.form, dataset); this.COLOR_PALETTE = ['#f57900', '#cc0000', '#d400a8', '#75507b', '#3465a4', '#73d216', '#c17d11', '#edd400', '#fcaf3e', '#ef2929', '#ff00c9', '#ad7fa8', '#729fcf', '#8ae234', '#e9b96e', '#fce94f', '#ff8e00', '#ff0000', '#b0008c', '#9000ff', '#0078ff', '#00ff00', '#e6ff00', '#ffff00', @@ -41,10 +35,6 @@ instance.web_calendar.CalendarView = instance.web.View.extend({ this.selected_filters = []; this.on('view_loaded', self, self.load_calendar); }, - start: function() { - this._super(); - return this.rpc("/web/view/load", {"model": this.model, "view_id": this.view_id, "view_type":"calendar", 'toolbar': false}).then(this.on_loaded); - }, destroy: function() { scheduler.clearAll(); this._super(); @@ -75,7 +65,7 @@ instance.web_calendar.CalendarView = instance.web.View.extend({ if (this.color_field && this.selected_filters.length === 0) { var default_filter; - if (default_filter = this.dataset.context['calendar_default_' + this.color_field]) { + if ((default_filter = this.dataset.context['calendar_default_' + this.color_field])) { this.selected_filters.push(default_filter + ''); } } @@ -106,7 +96,7 @@ instance.web_calendar.CalendarView = instance.web.View.extend({ if (!this.sidebar && this.options.$sidebar) { 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); return this.has_been_loaded.resolve(); @@ -128,6 +118,7 @@ instance.web_calendar.CalendarView = instance.web.View.extend({ scheduler.config.drag_create = true; scheduler.config.mark_now = true; scheduler.config.day_date = '%l %j'; + scheduler.config.details_on_create = false; scheduler.locale = { date:{ @@ -173,17 +164,48 @@ instance.web_calendar.CalendarView = instance.web.View.extend({ }; scheduler.init(this.$el.find('.oe_calendar')[0], null, this.mode || 'month'); - - - scheduler.detachAllEvents(); - scheduler.attachEvent('onEventAdded', this.do_create_event); - scheduler.attachEvent('onEventDeleted', this.do_delete_event); - scheduler.attachEvent('onEventChanged', this.do_save_event); - scheduler.attachEvent('onClick', this.do_edit_event); - scheduler.attachEvent('onLightbox', this.do_edit_event); + scheduler.attachEvent('onViewChange', this.proxy('view_changed')); + scheduler.attachEvent('onEventChanged', this.proxy('quick_save')); + scheduler.attachEvent('onEventDeleted', this.proxy('delete_event')); + scheduler.attachEvent('onEventAdded', function(event_id, event_obj) { + var fn = event_obj._force_slow_create ? 'slow_create' : 'quick_create'; + self[fn].apply(self, arguments); + }); + scheduler.attachEvent('onClick', function(event_id, mouse_event) { + if (!self.$el.find('.dhx_cal_editor').length && self.current_mode() === 'month') { + self.open_event(event_id); + } else { + return true; + } + }); + scheduler.attachEvent('onDblClick', function(event_id, mouse_event) { + if (!self.$el.find('.dhx_cal_editor').length) { + self.open_event(event_id); + } + }); + scheduler.attachEvent('onEmptyClick', function(start_date, mouse_event) { + scheduler._loading = false; // Dirty workaround for a dhtmleditor bug I couln't track + if (!self.$el.find('.dhx_cal_editor').length) { + var end_date = new Date(start_date); + end_date.addHours(1); + scheduler.addEvent({ + start_date: start_date, + end_date: end_date, + _force_slow_create: true, + }); + } + }); + scheduler.attachEvent("onBeforeLightbox", function (event_id) { + var index = self.dataset.get_id_index(event_id); + if (index !== null) { + self.open_event(self.dataset.ids[index]); + } else { + self.slow_create(event_id, scheduler.getEvent(event_id)); + } + return false; + }); - scheduler.attachEvent('onViewChange', this.on_view_changed); this.refresh_scheduler(); // Remove hard coded style attributes from dhtmlx scheduler @@ -192,11 +214,11 @@ instance.web_calendar.CalendarView = instance.web.View.extend({ self.$el.find(".dhx_cal_navline").removeAttr('style'); }); }, - on_view_changed: function(mode, date) { + view_changed: function(mode, date) { this.$el.find('.oe_calendar').removeClass('oe_cal_day oe_cal_week oe_cal_month').addClass('oe_cal_' + mode); if (!date.between(this.range_start, this.range_stop)) { this.update_range_dates(date); - this.do_ranged_search(); + this.ranged_search(); this.$el.find(".dhx_cal_navline div").removeAttr('style'); } this.ready.resolve(); @@ -214,7 +236,7 @@ instance.web_calendar.CalendarView = instance.web.View.extend({ } }, reload_event: function(id) { - this.dataset.read_ids([id], _.keys(this.fields)).then(this.on_events_loaded); + this.dataset.read_ids([id], _.keys(this.fields)).done(this.proxy('events_loaded')); }, get_color: function(key) { if (this.color_map[key]) { @@ -225,7 +247,7 @@ instance.web_calendar.CalendarView = instance.web.View.extend({ this.color_map[key] = color; return color; }, - on_events_loaded: function(events, fn_filter, no_filter_reload) { + events_loaded: function(events, fn_filter, no_filter_reload) { var self = this; //To parse Events we have to convert date Format @@ -271,7 +293,7 @@ instance.web_calendar.CalendarView = instance.web.View.extend({ this.refresh_scheduler(); this.refresh_minical(); if (!no_filter_reload && this.sidebar) { - this.sidebar.filter.on_events_loaded(sidebar_items); + this.sidebar.filter.events_loaded(sidebar_items); } }, convert_event: function(evt) { @@ -304,98 +326,10 @@ instance.web_calendar.CalendarView = instance.web.View.extend({ } return r; }, - do_create_event: function(event_id, event_obj) { - var self = this, - data = this.get_event_data(event_obj); - this.dataset.create(data).then(function(r) { - var id = r; - self.dataset.ids.push(id); - scheduler.changeEventId(event_id, id); - self.refresh_minical(); - self.reload_event(id); - }, function(r, event) { - event.preventDefault(); - self.do_create_event_with_formdialog(event_id, event_obj); - }); - }, - do_create_event_with_formdialog: function(event_id, event_obj) { - var self = this; - $.when(! self.form_dialog.dialog_inited ? self.form_dialog.init_dialog() : true).then(function() { - if (!event_obj) { - event_obj = scheduler.getEvent(event_id); - } - var data = self.get_event_data(event_obj), - fields_to_fetch = _(self.form_dialog.form.fields_view.fields).keys(); - self.dataset.index = null; - self.creating_event_id = event_id; - self.form_dialog.form.do_show().then(function() { - _.each(['date_start', 'date_delay', 'date_stop'], function(field) { - var field_name = self[field]; - if (field_name && self.form_dialog.form.fields[field_name]) { - var ffield = self.form_dialog.form.fields[field_name]; - ffield._dirty_flag = false; - $.when(ffield.set_value(data[field_name])).then(function() { - ffield._dirty_flag = true; - self.form_dialog.form.do_onchange(ffield); - }); - } - }); - self.form_dialog.open(); - }); - }); - }, - do_save_event: function(event_id, event_obj) { - var self = this, - data = this.get_event_data(event_obj), - index = this.dataset.get_id_index(event_id); - if (index != null) { - event_id = this.dataset.ids[index]; - this.dataset.write(event_id, data, {}).then(function() { - self.refresh_minical(); - }); - } - }, - do_delete_event: function(event_id, event_obj) { - // dhtmlx sends this event even when it does not exist in openerp. - // Eg: use cancel in dhtmlx new event dialog - var self = this, - index = this.dataset.get_id_index(event_id); - if (index !== null) { - this.dataset.unlink(event_id).then(function() { - self.refresh_minical(); - }); - } - }, - do_edit_event: function(event_id, evt) { - var self = this; - var index = this.dataset.get_id_index(event_id); - if (index !== null) { - this.dataset.index = index; - this.do_switch_view('form'); - } else if (scheduler.getState().mode === 'month') { - var event_obj = scheduler.getEvent(event_id); - if (event_obj._length === 1) { - event_obj['start_date'].addHours(8); - event_obj['end_date'] = new Date(event_obj['start_date']); - event_obj['end_date'].addHours(1); - } else { - event_obj['start_date'].addHours(8); - event_obj['end_date'].addHours(-4); - } - this.do_create_event_with_formdialog(event_id, event_obj); - // return false; - // Theorically, returning false should prevent the lightbox to open. - // It works, but then the scheduler is in a buggy state where drag'n drop - // related internal Event won't be fired anymore. - // I tried scheduler.editStop(event_id); but doesn't work either - // After losing one hour on this, here's a quick and very dirty fix : - $(".dhx_cancel_btn").click(); - } else { - scheduler.editStop($(evt.target).hasClass('icon_save')); - } - }, get_event_data: function(event_obj) { - var data = {}; + var data = { + name: event_obj.text + }; data[this.date_start] = instance.web.datetime_to_str(event_obj.start_date); if (this.date_stop) { data[this.date_stop] = instance.web.datetime_to_str(event_obj.end_date); @@ -408,19 +342,19 @@ instance.web_calendar.CalendarView = instance.web.View.extend({ }, do_search: function(domain, context, group_by) { this.last_search = arguments; - this.do_ranged_search(); + this.ranged_search(); }, - do_ranged_search: function() { + ranged_search: function() { var self = this; 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), { offset: 0, domain: self.get_range_domain(), context: self.last_search[1] - }).then(function(events) { + }).done(function(events) { self.dataset_events = events; - self.on_events_loaded(events); + self.events_loaded(events); }); }); }, @@ -433,7 +367,7 @@ instance.web_calendar.CalendarView = instance.web.View.extend({ }, do_show: function () { var self = this; - $.when(this.has_been_loaded).then(function() { + $.when(this.has_been_loaded).done(function() { self.$el.show(); self.do_push_state({}); }); @@ -441,45 +375,107 @@ instance.web_calendar.CalendarView = instance.web.View.extend({ get_selected_ids: function() { // no way to select a record anyway return []; - } -}); + }, + current_mode: function() { + return scheduler.getState().mode; + }, -instance.web_calendar.CalendarFormDialog = instance.web.Dialog.extend({ - init: function(view, options, view_id, dataset) { - this._super(view, options); - this.dataset = dataset; - this.view_id = view_id; - this.view = view; - this.on("closing", this, function() { - if (this.view.creating_event_id) { - scheduler.deleteEvent(this.view.creating_event_id); - this.view.creating_event_id = null; - } + quick_save: function(event_id, event_obj) { + var self = this; + var data = this.get_event_data(event_obj); + delete(data.name); + var index = this.dataset.get_id_index(event_id); + if (index !== null) { + event_id = this.dataset.ids[index]; + this.dataset.write(event_id, data, {}).done(function() { + self.refresh_minical(); + }); + } + }, + quick_create: function(event_id, event_obj) { + var self = this; + var data = this.get_event_data(event_obj); + this.dataset.create(data).done(function(r) { + var id = r; + self.dataset.ids.push(id); + scheduler.changeEventId(event_id, id); + self.refresh_minical(); + self.reload_event(id); + }).fail(function(r, event) { + event.preventDefault(); + self.slow_create(event_id, event_obj); }); }, - start: function() { + slow_create: function(event_id, event_obj) { var self = this; - this._super(); - this.form = new instance.web.FormView(this, this.dataset, this.view_id, { - pager: false, - $buttons: this.$buttons, + if (this.current_mode() === 'month') { + event_obj['start_date'].addHours(8); + if (event_obj._length === 1) { + event_obj['end_date'] = new Date(event_obj['start_date']); + event_obj['end_date'].addHours(1); + } else { + event_obj['end_date'].addHours(-4); + } + } + var defaults = {}; + _.each(this.get_event_data(event_obj), function(val, field_name) { + defaults['default_' + field_name] = val; + }); + var something_saved = false; + var pop = new instance.web.form.FormOpenPopup(this); + pop.show_element(this.dataset.model, null, this.dataset.get_context(defaults), { + title: _t("Create: ") + ' ' + this.name, + disable_multiple_selection: true, }); - var def = this.form.appendTo(this.$el); - this.form.on('record_created', self, this.on_form_dialog_saved); - this.form.on('record_saved', self, this.on_form_dialog_saved); - this.form.on_button_cancel = function() { - self.close(); + pop.on('closed', self, function() { + if (!something_saved) { + scheduler.deleteEvent(event_id); + } + }); + pop.on('create_completed', self, function(id) { + something_saved = true; + self.dataset.ids.push(id); + scheduler.changeEventId(event_id, id); + self.reload_event(id); + }); + }, + open_event: function(event_id) { + var self = this; + var index = this.dataset.get_id_index(event_id); + if (index === null) { + // Some weird behaviour in dhtmlx scheduler could lead to this case + // eg: making multiple days event in week view, dhtmlx doesn't trigger eventAdded !!?? + // so the user clicks back on the orphan event and we land here. We have to duplicate + // the dhtmlx internal event because it will delete it on next sheduler refresh. + var event_obj = scheduler.getEvent(event_id); + scheduler.deleteEvent(event_id); + scheduler.addEvent({ + start_date: event_obj.start_date, + end_date: event_obj.end_date, + text: event_obj.text, + _force_slow_create: true, + }); + } else { + var pop = new instance.web.form.FormOpenPopup(this); + var id_for_buggy_addons = this.dataset.ids[index]; // ids could be non numeric + pop.show_element(this.dataset.model, id_for_buggy_addons, this.dataset.get_context(), { + title: _t("Edit: ") + this.name + }); + pop.on('write_completed', self, function(){ + self.reload_event(event_id); + }); } - return def; }, - on_form_dialog_saved: function() { - var id = this.dataset.ids[this.dataset.index]; - if (this.view.creating_event_id) { - scheduler.changeEventId(this.view.creating_event_id, id); - this.view.creating_event_id = null; + delete_event: function(event_id, event_obj) { + // dhtmlx sends this event even when it does not exist in openerp. + // Eg: use cancel in dhtmlx new event dialog + var self = this; + var index = this.dataset.get_id_index(event_id); + if (index !== null) { + this.dataset.unlink(event_id).done(function() { + self.refresh_minical(); + }); } - this.view.reload_event(id); - this.close(); }, }); @@ -501,13 +497,13 @@ instance.web_calendar.Sidebar = instance.web.Widget.extend({ }); instance.web_calendar.SidebarFilter = instance.web.Widget.extend({ events: { - 'change input:checkbox': 'on_filter_click' + 'change input:checkbox': 'filter_click' }, init: function(parent, view) { this._super(parent); this.view = view; }, - on_events_loaded: function(filters) { + events_loaded: function(filters) { var selected_filters = this.view.selected_filters.slice(0); this.$el.html(QWeb.render('CalendarView.sidebar.responsible', { filters: filters })); this.$('div.oe_calendar_responsible input').each(function() { @@ -516,7 +512,7 @@ instance.web_calendar.SidebarFilter = instance.web.Widget.extend({ } }); }, - on_filter_click: function(e) { + filter_click: function(e) { var self = this, responsibles = [], $e = $(e.target); @@ -527,16 +523,15 @@ instance.web_calendar.SidebarFilter = instance.web.Widget.extend({ }); scheduler.clearAll(); if (responsibles.length) { - this.view.on_events_loaded(this.view.dataset_events, function(filter_value) { + this.view.events_loaded(this.view.dataset_events, function(filter_value) { return _.indexOf(responsibles, filter_value.toString()) > -1; }, true); } else { - this.view.on_events_loaded(this.view.dataset_events, false, true); + this.view.events_loaded(this.view.dataset_events, false, true); } } }); }; -// DEBUG_RPC:rpc.request:('execute', 'addons-dsh-l10n_us', 1, '*', ('ir.filters', 'get_filters', u'res.partner')) // vim:et fdc=0 fdl=0 foldnestmax=3 fdm=syntax: diff --git a/addons/web_diagram/static/src/js/diagram.js b/addons/web_diagram/static/src/js/diagram.js index d5a6e78f862..7b914922205 100644 --- a/addons/web_diagram/static/src/js/diagram.js +++ b/addons/web_diagram/static/src/js/diagram.js @@ -22,10 +22,11 @@ instance.web.DiagramView = instance.web.View.extend({ this.context = {}; this.ids = this.dataset.ids; this.on('view_loaded', self, self.load_diagram); + this.on('pager_action_executed', self, self.pager_action_trigger); }, start: function() { 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); }); }, @@ -59,12 +60,7 @@ instance.web.DiagramView = instance.web.View.extend({ self.$el.find('.oe_diagram_header').append(html_label); }) - this.$el.find('div.oe_diagram_pager button[data-pager-action]').click(function() { - var action = $(this).data('pager-action'); - self.execute_pager_action(action); - }); - - this.do_update_pager(); + this.init_pager(); // New Node,Edge this.$el.find('#new_node.oe_diagram_button_new').click(function(){self.add_node();}); @@ -109,7 +105,7 @@ instance.web.DiagramView = instance.web.View.extend({ }); 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); } ); @@ -260,7 +256,7 @@ instance.web.DiagramView = instance.web.View.extend({ ); 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]; @@ -294,7 +290,7 @@ instance.web.DiagramView = instance.web.View.extend({ self.context || self.dataset.context ); 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; @@ -324,7 +320,7 @@ instance.web.DiagramView = instance.web.View.extend({ } ); 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); }); }, @@ -346,7 +342,7 @@ instance.web.DiagramView = instance.web.View.extend({ this.context || this.dataset.context ); 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. // This is not a problem since the diagram is completely redrawn on saved changes. @@ -366,36 +362,65 @@ instance.web.DiagramView = instance.web.View.extend({ form_controller.fields[self.connectors.attrs.destination].dirty = true; }); }, - - execute_pager_action: function(action) { - switch (action) { - case 'first': - this.dataset.index = 0; - break; - case 'previous': - this.dataset.previous(); - break; - case 'next': - this.dataset.next(); - break; - case 'last': - this.dataset.index = this.dataset.ids.length - 1; - break; + + do_hide: function () { + if (this.$pager) { + this.$pager.hide(); } + this._super(); + }, + + init_pager: function() { + var self = this; + if (this.$pager) + this.$pager.remove(); + + this.$pager = $(QWeb.render("DiagramView.pager", {'widget':self})).hide(); + if (this.options.$pager) { + this.$pager.appendTo(this.options.$pager); + } else { + this.$el.find('.oe_diagram_pager').replaceWith(this.$pager); + } + this.$pager.on('click','a[data-pager-action]',function() { + var action = $(this).data('pager-action'); + self.execute_pager_action(action); + }); + this.do_update_pager(); + }, + + pager_action_trigger: function(){ 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(); return loaded; }, + + execute_pager_action: function(action) { + switch (action) { + case 'first': + this.dataset.index = 0; + break; + case 'previous': + this.dataset.previous(); + break; + case 'next': + this.dataset.next(); + break; + case 'last': + this.dataset.index = this.dataset.ids.length - 1; + break; + } + this.trigger('pager_action_executed'); + + }, do_update_pager: function(hide_index) { - var $pager = this.$el.find('div.oe_diagram_pager'); - var index = hide_index ? '-' : this.dataset.index + 1; - if(!this.dataset.count) { - this.dataset.count = this.dataset.ids.length; + this.$pager.toggle(this.dataset.ids.length > 1); + if (hide_index) { + $(".oe_diagram_pager_state", this.$pager).html(""); + } else { + $(".oe_diagram_pager_state", this.$pager).html(_.str.sprintf(_t("%d / %d"), this.dataset.index + 1, this.dataset.ids.length)); } - $pager.find('span.oe_pager_index').html(index); - $pager.find('span.oe_pager_count').html(this.dataset.count); }, do_show: function() { diff --git a/addons/web_diagram/static/src/js/graph.js b/addons/web_diagram/static/src/js/graph.js index bfe5796c0f0..6e3b018d85a 100644 --- a/addons/web_diagram/static/src/js/graph.js +++ b/addons/web_diagram/static/src/js/graph.js @@ -87,12 +87,12 @@ dummy_circle.animate({'r': close_button_radius }, 400, 'linear'); if(entity_type == "node"){ - $.when(GraphNode.destruction_callback(entity)).then(function () { + $.when(GraphNode.destruction_callback(entity)).done(function () { //console.log("remove node",entity); entity.remove(); }); }else if(entity_type == "edge"){ - $.when(GraphEdge.destruction_callback(entity)).then(function () { + $.when(GraphEdge.destruction_callback(entity)).done(function () { //console.log("remove edge",entity); entity.remove(); }); diff --git a/addons/web_diagram/static/src/xml/base_diagram.xml b/addons/web_diagram/static/src/xml/base_diagram.xml index 388092b3d23..54b06aafb27 100644 --- a/addons/web_diagram/static/src/xml/base_diagram.xml +++ b/addons/web_diagram/static/src/xml/base_diagram.xml @@ -1,18 +1,19 @@ <template> +<t t-name="DiagramView.pager"> + <div class="oe_diagram_pager"> + <t t-if="widget.options.pager !== false" t-call="ViewPager"> + <span class="oe_diagram_pager_state"></span> + </t> + </div> +</t> <t t-name="DiagramView"> <div class="oe_diagram_header" t-att-id="widget.element_id + '_header'"> <h3 class="oe_diagram_title"/> <div t-if="widget.is_action_enabled('create')" class="oe_diagram_buttons"> <button type="button" id="new_node" class="oe_button oe_diagram_button_new">New Node</button> </div> - <div class="oe_diagram_pager"> - <t t-call="ViewPager"> - <span class="oe_pager_index">0</span> / <span class="oe_pager_count">0</span> - </t> - </div> <div class="clear"></div> </div> - <div class="diagram-container"> <div class="oe_diagram_diagram"/> </div> diff --git a/addons/web_gantt/static/src/js/gantt.js b/addons/web_gantt/static/src/js/gantt.js index 040f53568ae..627942d0dbc 100644 --- a/addons/web_gantt/static/src/js/gantt.js +++ b/addons/web_gantt/static/src/js/gantt.js @@ -22,7 +22,7 @@ instance.web_gantt.GanttView = instance.web.View.extend({ var self = this; this.fields_view = fields_view_get; 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.has_been_loaded.resolve(); }); @@ -46,11 +46,11 @@ instance.web_gantt.GanttView = instance.web.View.extend({ })); 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, { domain: domains, context: contexts - }).pipe(function(data) { + }).then(function(data) { 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) { var self = this; 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) { return _.extend({__name: _.detect(names, function(name) { return name[0] == task.id; })[1]}, task); }); diff --git a/addons/web_graph/static/src/js/graph.js b/addons/web_graph/static/src/js/graph.js index b0106bc8f01..3b73201b154 100644 --- a/addons/web_graph/static/src/js/graph.js +++ b/addons/web_graph/static/src/js/graph.js @@ -94,7 +94,7 @@ instance.web_graph.GraphView = instance.web.View.extend({ if (self.legend == "top") { self.legend = "inside"; } 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'); }).always(function () { self.forcehtml = false; @@ -243,7 +243,7 @@ instance.web_graph.GraphView = instance.web.View.extend({ var result = []; 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; fields = view_get['fields']; var toload = _.select(group_by, function(x) { return fields[x] === undefined }); @@ -251,22 +251,22 @@ instance.web_graph.GraphView = instance.web.View.extend({ return obj.call("fields_get", [toload, context]); else return $.when([]); - }).pipe(function (fields_to_add) { + }).then(function (fields_to_add) { _.extend(fields, fields_to_add); var tree = $($.parseXML(view_get['arch'])); var pos = 0; - var xaxis = group_by || []; + var xaxis = _.clone(group_by || []); var yaxis = []; tree.find("field").each(function() { var field = $(this); if (! field.attr("name")) return; - if ((group_by.length == 0) && ((! pos) || field.attr('group'))) { + if ((group_by.length == 0) && ((! pos) || instance.web.py_eval(field.attr('group') || "false"))) { xaxis.push(field.attr('name')); } - if (pos && ! field.attr('group')) { + if (pos && ! instance.web.py_eval(field.attr('group') || "false")) { yaxis.push(field.attr('name')); } pos += 1; @@ -307,7 +307,7 @@ instance.web_graph.GraphView = instance.web.View.extend({ } 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) { result.push({ '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)) { var defs = []; _.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 $.when.apply($, defs).pipe(function() { + return $.when.apply($, defs).then(function() { _.each(_.toArray(arguments), function(res) { var x = res[0]; res = res[1]; @@ -336,16 +336,15 @@ instance.web_graph.GraphView = instance.web.View.extend({ }); } else { 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 = []; _.each(axis, function(x) { var key = x[xaxis[0]] - defs.push(obj.call("read_group", [new instance.web.CompoundDomain(domain, [[xaxis[0], '=' ,_convert_key(xaxis[0], key)]]), - 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 $.when.apply($, defs).pipe(function() { + return $.when.apply($, defs).then(function() { _.each(_.toArray(arguments), function(res) { var x = res[0]; var key = res[1]; @@ -360,7 +359,7 @@ instance.web_graph.GraphView = instance.web.View.extend({ }); }); } - }).pipe(function() { + }).then(function() { var res = { 'data': result, 'ticks': _.map(ticks, function(el, key) { return [el, key] }) @@ -375,7 +374,7 @@ instance.web_graph.GraphView = instance.web.View.extend({ _.extend(this, options.data); return this.graph_get_data() - .then(this.proxy('graph_render_all')); + .done(this.proxy('graph_render_all')); }, graph_render_all: function (data) { diff --git a/addons/web_kanban/i18n/ru.po b/addons/web_kanban/i18n/ru.po index f8e2f6454d6..a30f7c53997 100644 --- a/addons/web_kanban/i18n/ru.po +++ b/addons/web_kanban/i18n/ru.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: openerp-web\n" "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" "POT-Creation-Date: 2012-07-02 09:06+0200\n" -"PO-Revision-Date: 2012-02-17 07:42+0000\n" -"Last-Translator: Aleksei Motsik <Unknown>\n" +"PO-Revision-Date: 2012-10-26 09:02+0000\n" +"Last-Translator: Chertykov Denis <chertykov@gmail.com>\n" "Language-Team: Russian <ru@li.org>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-10-21 05:03+0000\n" -"X-Generator: Launchpad (build 16165)\n" +"X-Launchpad-Export-Date: 2012-10-27 05:15+0000\n" +"X-Generator: Launchpad (build 16194)\n" #. openerp-web #: addons/web_kanban/static/src/js/kanban.js:10 @@ -35,7 +35,7 @@ msgstr "Вы действительно хотите удалить эту заÐ #. openerp-web #: addons/web_kanban/static/src/js/kanban.js:839 msgid "Create: " -msgstr "" +msgstr "Создать: " #. openerp-web #: addons/web_kanban/static/src/xml/web_kanban.xml:41 @@ -50,17 +50,17 @@ msgstr "осталось)" #. openerp-web #: addons/web_kanban/static/src/xml/web_kanban.xml:71 msgid "Add" -msgstr "" +msgstr "Добавить" #. openerp-web #: addons/web_kanban/static/src/xml/web_kanban.xml:71 msgid "or" -msgstr "" +msgstr "или" #. openerp-web #: addons/web_kanban/static/src/xml/web_kanban.xml:72 msgid "Cancel" -msgstr "" +msgstr "Отмена" #~ msgid "Create" #~ msgstr "Создать" diff --git a/addons/web_kanban/static/src/css/kanban.css b/addons/web_kanban/static/src/css/kanban.css index 837d11949bc..f968364c987 100644 --- a/addons/web_kanban/static/src/css/kanban.css +++ b/addons/web_kanban/static/src/css/kanban.css @@ -144,8 +144,13 @@ margin-left: 4px; cursor: pointer; position: relative; +} +.openerp .oe_kanban_view .oe_kanban_add { top: -8px; } +.openerp .oe_kanban_view .oe_kanban_header .oe_dropdown_toggle { + top: -2px; +} .openerp .oe_kanban_view .oe_kanban_card, .openerp .oe_kanban_view .oe_dropdown_toggle { cursor: pointer; display: inline-block; @@ -481,7 +486,6 @@ } .openerp .oe_kanban_view .oe_dropdown_kanban { float: right; - clear: both; cursor: pointer; margin-top: -6px; } diff --git a/addons/web_kanban/static/src/css/kanban.sass b/addons/web_kanban/static/src/css/kanban.sass index aea5d6bc8c0..459fc56092d 100644 --- a/addons/web_kanban/static/src/css/kanban.sass +++ b/addons/web_kanban/static/src/css/kanban.sass @@ -168,7 +168,10 @@ margin-left: 4px cursor: pointer position: relative + .oe_kanban_add top: -8px + .oe_kanban_header .oe_dropdown_toggle + top: -2px .oe_kanban_card, .oe_dropdown_toggle cursor: pointer display: inline-block @@ -414,7 +417,6 @@ // KanbanDropDown {{{ .oe_dropdown_kanban float: right - clear: both cursor: pointer margin-top: -6px &:hover diff --git a/addons/web_kanban/static/src/js/kanban.js b/addons/web_kanban/static/src/js/kanban.js index 39df8123aed..4e3cba3c44c 100644 --- a/addons/web_kanban/static/src/js/kanban.js +++ b/addons/web_kanban/static/src/js/kanban.js @@ -198,7 +198,7 @@ instance.web_kanban.KanbanView = instance.web.View.extend({ var form = am.dialog_widget.views.form.controller; form.on("on_button_cancel", am.dialog, am.dialog.close); 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(); var domain = self.dataset.domain.slice(0); domain.push([self.group_by, '=', new_record[0][0]]); @@ -212,7 +212,7 @@ instance.web_kanban.KanbanView = instance.web.View.extend({ aggregates: {}, }; 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' }); }); }); @@ -224,14 +224,14 @@ instance.web_kanban.KanbanView = instance.web.View.extend({ this.search_domain = domain; this.search_context = context; 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_field = self.fields_view.fields[self.group_by] || {}; self.grouped_by_m2o = (self.group_by_field.type === 'many2one'); self.$buttons.find('.oe_alternative').toggle(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); - $.when(grouping).then(function(groups) { + $.when(grouping).done(function(groups) { if (groups) { self.do_process_groups(groups); } else { @@ -252,7 +252,7 @@ instance.web_kanban.KanbanView = instance.web.View.extend({ var dataset = new instance.web.DataSetSearch(self, self.dataset.model, 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 }) - .pipe(function(records) { + .then(function(records) { self.dataset.ids.push.apply(self.dataset.ids, dataset.ids); groups_array[index] = new instance.web_kanban.KanbanGroup(self, records, group, dataset); 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.add_group_mutex.exec(function() { 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(); 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)) { self.no_result(); } def.resolve(); }); - }).then(null, function() { + }).done(null, function() { def.reject(); }); return def; @@ -306,7 +306,7 @@ instance.web_kanban.KanbanView = instance.web.View.extend({ 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.$el.appendTo($parent); _.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]; self.groups.splice(stop_index, 0, tmp_group); 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) { 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; var data = {}; 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(); new_group.do_save_sequences(); }).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){ var block = self.$el.find(".oe_form_field.oe_tags[model='" + model + "']"); 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) { for(var t=0;t<result.length;t++){ 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 = []; - this.$has_been_started.then(function() { + this.$has_been_started.done(function() { self.do_add_records(records); }); }, @@ -641,7 +641,7 @@ instance.web_kanban.KanbanGroup = instance.web.Widget.extend({ this.dataset.read_slice(this.view.fields_keys.concat(['__last_update']), { 'limit': self.view.limit, 'offset': self.dataset_offset += self.view.limit - }).then(this.do_add_records); + }).done(this.do_add_records); }, do_add_records: function(records, prepend) { var self = this; @@ -704,7 +704,7 @@ instance.web_kanban.KanbanGroup = instance.web.Widget.extend({ do_action_delete: function() { var self = this; 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(); }); } @@ -724,7 +724,7 @@ instance.web_kanban.KanbanGroup = instance.web.Widget.extend({ quick_created: function (record) { var id = record, self = this; this.dataset.read_ids([id], this.view.fields_keys) - .then(function (records) { + .done(function (records) { self.view.dataset.ids.push(id); self.do_add_records(records, true); }); @@ -838,13 +838,13 @@ instance.web_kanban.KanbanRecord = instance.web.Widget.extend({ if (this.$el.find('.oe_kanban_global_click,.oe_kanban_global_click_edit').length) { this.$el.on('click', function(ev) { - if (!ev.isTrigger && !$(ev.target).data('events')) { + if (!ev.isTrigger && !$._data(ev.target, 'events')) { var trigger = true; var elem = ev.target; var ischild = true; var children = []; while (elem) { - var events = $(elem).data('events'); + var events = $._data(elem, 'events'); if (elem == ev.currentTarget) { ischild = false; } @@ -899,7 +899,7 @@ instance.web_kanban.KanbanRecord = instance.web.Widget.extend({ var color_field = $(this).parents('.oe_kanban_colorpicker').first().data('field') || 'color'; var data = {}; 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.do_reload(); }); @@ -909,7 +909,7 @@ instance.web_kanban.KanbanRecord = instance.web.Widget.extend({ do_action_delete: function($action) { var self = this; 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.destroy(); }); @@ -933,7 +933,7 @@ instance.web_kanban.KanbanRecord = instance.web.Widget.extend({ }, do_reload: function() { 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) { self.set_record(records[0]); self.renderElement(); @@ -1040,6 +1040,7 @@ instance.web_kanban.QuickCreate = instance.web.Widget.extend({ }); $(".oe_kanban_quick_create_add", this.$el).click(function () { self.quick_add(); + self.focus(); }); $(".oe_kanban_quick_create_close", this.$el).click(function (ev) { ev.preventDefault(); @@ -1062,7 +1063,7 @@ instance.web_kanban.QuickCreate = instance.web.Widget.extend({ this._dataset.call( 'name_create', [self.$input.val() || false, new instance.web.CompoundContext( this._dataset.get_context(), this._context)]) - .pipe(function(record) { + .then(function(record) { self.$input.val(""); self.trigger('added', record[0]); }, function(error, event) { diff --git a/addons/web_tests/static/src/js/web_tests.js b/addons/web_tests/static/src/js/web_tests.js index bc7d16913fb..281e360c872 100644 --- a/addons/web_tests/static/src/js/web_tests.js +++ b/addons/web_tests/static/src/js/web_tests.js @@ -18,7 +18,7 @@ openerp.web_tests = function (instance) { start: function () { $.when( 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) { var records = slice[0].records; diff --git a/addons/web_view_editor/static/src/css/view_editor.css b/addons/web_view_editor/static/src/css/view_editor.css index e80e15a4c17..e48bf344629 100644 --- a/addons/web_view_editor/static/src/css/view_editor.css +++ b/addons/web_view_editor/static/src/css/view_editor.css @@ -1,20 +1,14 @@ .openerp .oe_view_editor { width: 100%; - border-collapse: collapse; margin-left: -12px; - width: 100%; - background-color: white; - border-spacing: 0; } .openerp .oe_view_editor td { - text-align: center; - white-space: nowrap; border: 1px solid #d8d8d8; cursor: pointer; - font-size: 90%; } -.openerp .oe_view_editor_field td { +.openerp .oe_view_editor td *{ border: 0px !important; + color : #404040; } .openerp .oe_view_editor tr:hover { background-color: #ecebf2; diff --git a/addons/web_view_editor/static/src/js/view_editor.js b/addons/web_view_editor/static/src/js/view_editor.js index 0750a5fe0b8..a844c0f3be8 100644 --- a/addons/web_view_editor/static/src/js/view_editor.js +++ b/addons/web_view_editor/static/src/js/view_editor.js @@ -18,11 +18,10 @@ instance.web.ViewManagerAction.include({ return this._super.apply(this,arguments); } } -}) +}); instance.web_view_editor.ViewEditor = instance.web.Widget.extend({ init: function(parent, element_id, dataset, view, options) { this._super(parent); - this.element_id = element_id; this.parent = parent; this.dataset = new instance.web.DataSetSearch(this, 'ir.ui.view', null, null), this.model = dataset.model; @@ -71,15 +70,15 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({ this.main_view_id = this.parent.fields_view.view_id; this.action_manager = new instance.web.ActionManager(this); 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 controller = viewmanager.views[viewmanager.active_view].controller; - controller.on('view_loaded', function(){ + controller.on('view_loaded', self, function(){ $(controller.groups).bind({ 'selected': function(e, ids, records) { self.main_view_id = ids[0]; } - }) + }); }); }); }, @@ -103,7 +102,7 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({ if (warn) { self.on_valid_create_view(self.create_view_widget); } else { - $.when(self.do_save_view(view_values)).then(function() { + $.when(self.do_save_view(view_values)).done(function() { self.create_view_dialog.close(); var controller = self.action_manager.inner_widget.views[self.action_manager.inner_widget.active_view].controller; controller.reload_content(); @@ -136,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 model_dataset = new instance.web.DataSetSearch(this, 'ir.model', null, null); 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) { if (_.include(_.keys(fields), value)) { field_name = value; @@ -144,7 +143,7 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({ } }); 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;} 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}; @@ -183,7 +182,7 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({ var self = this; 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; - this.dataset.unlink([this.main_view_id]).then(function() { + this.dataset.unlink([this.main_view_id]).done(function() { controller.reload_content(); self.main_view_id = self.parent.fields_view.view_id; }); @@ -246,12 +245,12 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({ get_arch: function() { var self = this; 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) { 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; 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) { view_arch_list.push({"view_id": res.id, "arch": res.arch,"priority":res.priority}); self.inherit_view(arch_object, res); @@ -456,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 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}; - this.dataset.create(vals).then(function(id) { + this.dataset.create(vals).done(function(id) { var arch_to_obj = self.parse_xml(arch,id); obj.child_id.push(arch_to_obj[0]); self.one_object['parent_child_id'] = self.parent_child_list(self.one_object['main_object'],[]); @@ -539,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; 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); fields.push(" "),fields.sort(); self.on_add_node(property_to_check, fields); @@ -891,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'], []); this.edit_node_dialog.$el.append('<table id="rec_table" style="width:400px" class="oe_form"></table>'); 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; var values = _.keys( instance.web.form.widgets.map); values.push(''); @@ -994,7 +993,7 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({ table_selector.find("td[id^=]").attr("width","100px"); self.add_node_dialog.$el.find('#new_field').click(function() { 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]); }); }); @@ -1012,7 +1011,7 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({ } }; 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; controller.on("on_button_cancel", self, function(){ action_manager.destroy(); |
