Skip to content

Commit

Permalink
Merge pull request #139 from eea/develop
Browse files Browse the repository at this point in the history
91577 jquery migrate fixes
  • Loading branch information
avoinea authored Mar 14, 2018
2 parents 3e02d97 + 759aa30 commit f5ecc9c
Show file tree
Hide file tree
Showing 11 changed files with 90 additions and 32 deletions.
49 changes: 49 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
language: python
python: 2.7
sudo: required
services:
- docker

install:
- export GIT_OWNER=${TRAVIS_REPO_SLUG%/*}
- export GIT_NAME=${TRAVIS_REPO_SLUG#*/}
- export GIT_CHANGE_ID=${TRAVIS_PULL_REQUEST#false}
- export GIT_SRC=https://github.com/${TRAVIS_REPO_SLUG}.git

jobs:
include:
- stage: code
env:
- CHECK=jslint4java
script:
- docker run -i --rm -e GIT_BRANCH=$TRAVIS_BRANCH -e GIT_SRC=$GIT_SRC -e GIT_NAME=$GIT_NAME -e GIT_CHANGE_ID=$GIT_CHANGE_ID eeacms/$CHECK

- stage: code
env:
- CHECK=pyflakes
script:
- docker run -i --rm -e GIT_BRANCH=$TRAVIS_BRANCH -e GIT_SRC=$GIT_SRC -e GIT_NAME=$GIT_NAME -e GIT_CHANGE_ID=$GIT_CHANGE_ID eeacms/$CHECK

- stage: code
env:
- CHECK=i18ndude
script:
- docker run -i --rm -e GIT_BRANCH=$TRAVIS_BRANCH -e GIT_SRC=$GIT_SRC -e GIT_NAME=$GIT_NAME -e GIT_CHANGE_ID=$GIT_CHANGE_ID eeacms/$CHECK

- stage: code
env:
- CHECK=zptlint
script:
- docker run -i --rm -e GIT_BRANCH=$TRAVIS_BRANCH -e GIT_SRC=$GIT_SRC -e GIT_NAME=$GIT_NAME -e GIT_CHANGE_ID=$GIT_CHANGE_ID eeacms/$CHECK

- stage: test
env:
- PLONE=4
script:
- docker run -i --rm -e GIT_BRANCH="$TRAVIS_BRANCH" -e ADDONS="$GIT_NAME" -e DEVELOP="src/$GIT_NAME" -e GIT_CHANGE_ID="$GIT_CHANGE_ID" -e GIT_USER="$GIT_OWNER" eeacms/plone-test:$PLONE -s $GIT_NAME

- stage: test
env:
- PLONE=5
script:
- docker run -i --rm -e GIT_BRANCH="$TRAVIS_BRANCH" -e ADDONS="$GIT_NAME" -e DEVELOP="src/$GIT_NAME" -e GIT_CHANGE_ID="$GIT_CHANGE_ID" -e GIT_USER="$GIT_OWNER" eeacms/plone-test:$PLONE -s $GIT_NAME
7 changes: 7 additions & 0 deletions docs/HISTORY.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Changelog
=========

10.9 - (2018-03-14)
-------------------
* Encode the seach value to utf-8.
[thet]
* Change: cleaned jQuery migrate warnings
[ichim-david refs #91577]

10.8 - (2018-01-26)
-------------------
* Change: view.css css cleanup of empty selectors and removed
Expand Down
5 changes: 3 additions & 2 deletions eea/facetednavigation/browser/javascript/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,9 @@ FacetedEdit.FormPosition = {
FacetedEdit.FormWidgets = {
initialize: function(){
this.form = jQuery('#faceted-edit-widgets');
this.form.ajaxError(function(event, request, settings){
jQuery(this).html('<h3>This site encountered an error trying to fulfill your request</h3><p>If the error persists please contact the site maintainer. Thank you for your patience.</p>');
var form = this.form;
$(document).ajaxError(function(event, request, settings){
jQuery(form).html('<h3>This site encountered an error trying to fulfill your request</h3><p>If the error persists please contact the site maintainer. Thank you for your patience.</p>');
jQuery(FacetedEdit.Events).trigger(FacetedEdit.Events.AJAX_STOP, {msg: 'Error'});
});
jQuery('.faceted-edit-fieldset').hide();
Expand Down
5 changes: 3 additions & 2 deletions eea/facetednavigation/browser/javascript/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,9 @@ Faceted.Form = {
}

// Handle errors
this.area.ajaxError(function(event, request, settings){
jQuery(this).html('' +
var area = this.area;
$(document).ajaxError(function(event, request, settings){
jQuery(area).html('' +
'<h3>This site encountered an error trying to fulfill your request</h3>' +
'<p>' +
'If the error persists please contact the site maintainer. ' +
Expand Down
2 changes: 1 addition & 1 deletion eea/facetednavigation/browser/template/configure.pt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
FacetedEdit.Load(evt, '${context/absolute_url}/');
});"></script>
<script type="text/javascript"
tal:content="string:jQuery(window).unload(FacetedEdit.Unload);"></script>
tal:content="string:jQuery(window).on('unload', FacetedEdit.Unload);"></script>
</metal:jsslot>

<body>
Expand Down
2 changes: 1 addition & 1 deletion eea/facetednavigation/browser/template/view.pt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
Faceted.Load(evt, '${context/absolute_url}/');
});"></script>
<script type="text/javascript"
tal:content="string:jQuery(window).unload(function(){
tal:content="string:jQuery(window).on('unload', function(){
Faceted.Unload();
});"></script>
</metal:jsslot>
Expand Down
34 changes: 17 additions & 17 deletions eea/facetednavigation/locales/zh_TW/LC_MESSAGES/eea.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: eea\n"
"POT-Creation-Date: 2017-09-12 14:10+0000\n"
"PO-Revision-Date: 2016-08-03 12:22+0800\n"
"PO-Revision-Date: 2017-11-08 15:40+0800\n"
"Last-Translator: TsungWei Hu <[email protected]>\n"
"Language-Team: Plone I18N <[email protected]>\n"
"MIME-Version: 1.0\n"
Expand Down Expand Up @@ -102,19 +102,19 @@ msgstr "確定要刪除 ${widget} 嗎?"

#: ../../facetednavigation/widgets/autocomplete/interfaces.py:22
msgid "Autocomplete"
msgstr "自動輸入"
msgstr "自動完成器"

#: ../../facetednavigation/widgets/boolean/widget.py:19
msgid "Boolean"
msgstr "布林選項"

#: ../../facetednavigation/widgets/autocomplete/interfaces.py:36
msgid "Can select multiple values"
msgstr ""
msgstr "勾選的話,可選擇多個選項。"

#: ../../facetednavigation/widgets/autocomplete/interfaces.py:35
msgid "Can select several elements"
msgstr "可選擇數個元素"
msgstr "可複選"

#. Default: ""
#: ../../facetednavigation/widgets/checkbox/interfaces.py:51
Expand All @@ -132,7 +132,7 @@ msgstr "Catalog 索引"

#: ../../facetednavigation/widgets/interfaces.py:84
msgid "Catalog index to be used"
msgstr ""
msgstr "選用的 Catalog 索引"

#. Default: ""
#: ../../facetednavigation/widgets/alphabetic/interfaces.py:27
Expand Down Expand Up @@ -175,7 +175,7 @@ msgstr "設定值已匯入"

#: ../../facetednavigation/settings/menu.py:69
msgid "Configure"
msgstr ""
msgstr "設定"

#. Default: ""
#: ../../facetednavigation/browser/template/configure.pt:107
Expand Down Expand Up @@ -245,7 +245,7 @@ msgstr "預設的操作元"

#: ../../facetednavigation/widgets/interfaces.py:77
msgid "Default query"
msgstr ""
msgstr "預設的查詢值"

#. Default: ""
#: ../../facetednavigation/widgets/resultsperpage/interfaces.py:37
Expand Down Expand Up @@ -355,7 +355,7 @@ msgstr "啟用 Smart Facets Hiding"

#: ../../facetednavigation/widgets/etag/interfaces.py:15
msgid "Enabled (hidden)"
msgstr ""
msgstr "隱藏並啟用"

#. Default: ""
#: ../../facetednavigation/widgets/range/widget.pt:28
Expand Down Expand Up @@ -498,7 +498,7 @@ msgstr "隱藏數量為零的結果"

#: ../../facetednavigation/widgets/etag/interfaces.py:16
msgid "Hide this widget in order for e-tag to be used"
msgstr ""
msgstr "隱藏 Widget 並讓 E-Tag 生效"

#. Default: ""
#: ../../facetednavigation/widgets/interfaces.py:104
Expand All @@ -508,7 +508,7 @@ msgstr "隱藏方框"
#: ../../facetednavigation/widgets/radio/interfaces.py:33
#: ../../facetednavigation/widgets/tagscloud/interfaces.py:46
msgid "If this checkbox is checked, hides the \"All\" option"
msgstr ""
msgstr "勾選的話,會隱藏「所有項目」的選項。"

#: ../../facetednavigation/widgets/autocomplete/interfaces.py:29
#: ../../facetednavigation/widgets/text/interfaces.py:23
Expand All @@ -517,7 +517,7 @@ msgstr "勾選的話,會隱藏「所有項目」或「在現行結果裡」的

#: ../../facetednavigation/widgets/text/interfaces.py:30
msgid "If this checkbox is checked, the system will automatically do a wildcard search by appending a '*' to the search term so searching for 'budget' will also return elements containing 'budgetary'."
msgstr ""
msgstr "勾選的話,會自動在關鍵詞後方加上 '*' 符號,並啟用模糊比對。"

#: ../../facetednavigation/browser/template/configure.pt:83
msgid "Import"
Expand Down Expand Up @@ -563,7 +563,7 @@ msgstr "最大字元數"

#: ../../facetednavigation/widgets/tagscloud/interfaces.py:79
msgid "Maximum color"
msgstr ""
msgstr "最大值的顏色"

#. Default: ""
#: ../../facetednavigation/widgets/tagscloud/interfaces.py:101
Expand All @@ -584,7 +584,7 @@ msgstr "最大尺寸"

#: ../../facetednavigation/widgets/tagscloud/interfaces.py:71
msgid "Minimum color"
msgstr ""
msgstr "最小值的顏色"

#. Default: ""
#: ../../facetednavigation/widgets/tagscloud/interfaces.py:94
Expand Down Expand Up @@ -773,7 +773,7 @@ msgstr "搜尋結果每頁的間距"

#: ../../facetednavigation/widgets/daterange/interfaces.py:37
msgid "Reuse date format and language used by Plone"
msgstr ""
msgstr "沿用 Plone 的日期與語系設定值"

#: ../../facetednavigation/widgets/daterange/interfaces.py:38
msgid "Reuse the same date format and the the same language that Plone uses elsewhere. Otherwise, the format will be \"yy-mm-dd\" and the language \"English\". Note that this default format allows you to encode very old or big years (example : 0001 will not be converted to 1901). Other formats do not."
Expand Down Expand Up @@ -844,7 +844,7 @@ msgstr "全選"

#: ../../facetednavigation/widgets/autocomplete/interfaces.py:23
msgid "Select the source of the autocomplete suggestions"
msgstr ""
msgstr "指定自動完成器的選項"

#: ../../facetednavigation/widgets/criteria/widget.pt:22
msgid "Show filters"
Expand Down Expand Up @@ -1029,7 +1029,7 @@ msgstr "只有特定使用者看得到方框"

#: ../../facetednavigation/widgets/text/interfaces.py:29
msgid "Wildcard search"
msgstr ""
msgstr "萬用字元搜尋"

#: ../../facetednavigation/widgets/date/widget.py:24
msgid "Yesterday"
Expand Down Expand Up @@ -1067,4 +1067,4 @@ msgstr "符合 Any/All 過濾條件"

#: ../../facetednavigation/widgets/autocomplete/widget.py:106
msgid "solr"
msgstr ""
msgstr "Apache Solr"
2 changes: 1 addition & 1 deletion eea/facetednavigation/search/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def _apply_index(self, index, value):
if not apply_index:
return IIBucket(), (index_id,)

rset = apply_index({index_id: value})
rset = apply_index({index_id: value.encode('utf-8', 'replace')})

if not rset:
return IIBucket(), (index_id,)
Expand Down
2 changes: 1 addition & 1 deletion eea/facetednavigation/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10.8
10.9
10 changes: 5 additions & 5 deletions eea/facetednavigation/widgets/radio/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Faceted.RadioWidget.prototype = {
},

reset: function(){
jQuery(this.elements[0]).attr('checked', true);
jQuery(this.elements[0]).prop('checked', true);
this.selected = [];
},

Expand All @@ -102,7 +102,7 @@ Faceted.RadioWidget.prototype = {
context.reset();
}else{
context.selected = radio;
context.selected.attr('checked', true);
context.selected.prop('checked', true);
}
});
},
Expand Down Expand Up @@ -169,7 +169,7 @@ Faceted.RadioWidget.prototype = {

criteria_remove: function(){
var element = jQuery(this.elements[0]);
element.attr('checked', true);
element.prop('checked', true);
this.do_query();
},

Expand Down Expand Up @@ -221,9 +221,9 @@ Faceted.RadioWidget.prototype = {
if(context.widget.hasClass('faceted-zero-count-hidden')){
li.addClass('faceted-radio-item-zerocount');
}
input.attr('disabled', 'disabled');
input.prop('disabled', 'disabled');
}else{
input.attr('disabled', false);
input.prop('disabled', false);
input.click(function(evt){
context.radio_click(this, evt);
});
Expand Down
4 changes: 2 additions & 2 deletions eea/facetednavigation/widgets/sorting/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Faceted.SortingWidget = function(wid){
this.selected = this.widget.find('option:selected');
Faceted.Query[this.wid] = [value];

var reverse = this.reverse.attr('checked');
var reverse = this.reverse.prop('checked');
if(reverse){
Faceted.Query.reversed = 'on';
}
Expand Down Expand Up @@ -185,7 +185,7 @@ Faceted.SortingWidget.prototype = {
jQuery('<span>').text(label).appendTo(span);
html.append(span);

if(this.reverse.attr('checked')){
if(this.reverse.prop('checked')){
var rid = this.reverse.attr('id');
var rlabel = jQuery('label[for=' + rid + ']' ).html();
html.append('<span>(' + rlabel + ')</span>');
Expand Down

0 comments on commit f5ecc9c

Please sign in to comment.