Skip to content
This repository was archived by the owner on Apr 23, 2026. It is now read-only.

Commit f5ecc9c

Browse files
authored
Merge pull request #139 from eea/develop
91577 jquery migrate fixes
2 parents 3e02d97 + 759aa30 commit f5ecc9c

11 files changed

Lines changed: 90 additions & 32 deletions

File tree

.travis.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
language: python
2+
python: 2.7
3+
sudo: required
4+
services:
5+
- docker
6+
7+
install:
8+
- export GIT_OWNER=${TRAVIS_REPO_SLUG%/*}
9+
- export GIT_NAME=${TRAVIS_REPO_SLUG#*/}
10+
- export GIT_CHANGE_ID=${TRAVIS_PULL_REQUEST#false}
11+
- export GIT_SRC=https://github.com/${TRAVIS_REPO_SLUG}.git
12+
13+
jobs:
14+
include:
15+
- stage: code
16+
env:
17+
- CHECK=jslint4java
18+
script:
19+
- 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
20+
21+
- stage: code
22+
env:
23+
- CHECK=pyflakes
24+
script:
25+
- 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
26+
27+
- stage: code
28+
env:
29+
- CHECK=i18ndude
30+
script:
31+
- 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
32+
33+
- stage: code
34+
env:
35+
- CHECK=zptlint
36+
script:
37+
- 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
38+
39+
- stage: test
40+
env:
41+
- PLONE=4
42+
script:
43+
- 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
44+
45+
- stage: test
46+
env:
47+
- PLONE=5
48+
script:
49+
- 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

docs/HISTORY.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
Changelog
22
=========
33

4+
10.9 - (2018-03-14)
5+
-------------------
6+
* Encode the seach value to utf-8.
7+
[thet]
8+
* Change: cleaned jQuery migrate warnings
9+
[ichim-david refs #91577]
10+
411
10.8 - (2018-01-26)
512
-------------------
613
* Change: view.css css cleanup of empty selectors and removed

eea/facetednavigation/browser/javascript/edit.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,9 @@ FacetedEdit.FormPosition = {
205205
FacetedEdit.FormWidgets = {
206206
initialize: function(){
207207
this.form = jQuery('#faceted-edit-widgets');
208-
this.form.ajaxError(function(event, request, settings){
209-
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>');
208+
var form = this.form;
209+
$(document).ajaxError(function(event, request, settings){
210+
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>');
210211
jQuery(FacetedEdit.Events).trigger(FacetedEdit.Events.AJAX_STOP, {msg: 'Error'});
211212
});
212213
jQuery('.faceted-edit-fieldset').hide();

eea/facetednavigation/browser/javascript/view.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,9 @@ Faceted.Form = {
147147
}
148148

149149
// Handle errors
150-
this.area.ajaxError(function(event, request, settings){
151-
jQuery(this).html('' +
150+
var area = this.area;
151+
$(document).ajaxError(function(event, request, settings){
152+
jQuery(area).html('' +
152153
'<h3>This site encountered an error trying to fulfill your request</h3>' +
153154
'<p>' +
154155
'If the error persists please contact the site maintainer. ' +

eea/facetednavigation/browser/template/configure.pt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
FacetedEdit.Load(evt, '${context/absolute_url}/');
1313
});"></script>
1414
<script type="text/javascript"
15-
tal:content="string:jQuery(window).unload(FacetedEdit.Unload);"></script>
15+
tal:content="string:jQuery(window).on('unload', FacetedEdit.Unload);"></script>
1616
</metal:jsslot>
1717

1818
<body>

eea/facetednavigation/browser/template/view.pt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
Faceted.Load(evt, '${context/absolute_url}/');
1313
});"></script>
1414
<script type="text/javascript"
15-
tal:content="string:jQuery(window).unload(function(){
15+
tal:content="string:jQuery(window).on('unload', function(){
1616
Faceted.Unload();
1717
});"></script>
1818
</metal:jsslot>

eea/facetednavigation/locales/zh_TW/LC_MESSAGES/eea.po

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ msgid ""
22
msgstr ""
33
"Project-Id-Version: eea\n"
44
"POT-Creation-Date: 2017-09-12 14:10+0000\n"
5-
"PO-Revision-Date: 2016-08-03 12:22+0800\n"
5+
"PO-Revision-Date: 2017-11-08 15:40+0800\n"
66
"Last-Translator: TsungWei Hu <marr.tw@gmail.com>\n"
77
"Language-Team: Plone I18N <plone-i18n@lists.sourceforge.net>\n"
88
"MIME-Version: 1.0\n"
@@ -102,19 +102,19 @@ msgstr "確定要刪除 ${widget} 嗎?"
102102

103103
#: ../../facetednavigation/widgets/autocomplete/interfaces.py:22
104104
msgid "Autocomplete"
105-
msgstr "自動輸入"
105+
msgstr "自動完成器"
106106

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

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

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

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

133133
#: ../../facetednavigation/widgets/interfaces.py:84
134134
msgid "Catalog index to be used"
135-
msgstr ""
135+
msgstr "選用的 Catalog 索引"
136136

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

176176
#: ../../facetednavigation/settings/menu.py:69
177177
msgid "Configure"
178-
msgstr ""
178+
msgstr "設定"
179179

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

246246
#: ../../facetednavigation/widgets/interfaces.py:77
247247
msgid "Default query"
248-
msgstr ""
248+
msgstr "預設的查詢值"
249249

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

356356
#: ../../facetednavigation/widgets/etag/interfaces.py:15
357357
msgid "Enabled (hidden)"
358-
msgstr ""
358+
msgstr "隱藏並啟用"
359359

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

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

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

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

518518
#: ../../facetednavigation/widgets/text/interfaces.py:30
519519
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'."
520-
msgstr ""
520+
msgstr "勾選的話,會自動在關鍵詞後方加上 '*' 符號,並啟用模糊比對。"
521521

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

564564
#: ../../facetednavigation/widgets/tagscloud/interfaces.py:79
565565
msgid "Maximum color"
566-
msgstr ""
566+
msgstr "最大值的顏色"
567567

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

585585
#: ../../facetednavigation/widgets/tagscloud/interfaces.py:71
586586
msgid "Minimum color"
587-
msgstr ""
587+
msgstr "最小值的顏色"
588588

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

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

778778
#: ../../facetednavigation/widgets/daterange/interfaces.py:38
779779
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."
@@ -844,7 +844,7 @@ msgstr "全選"
844844

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

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

10301030
#: ../../facetednavigation/widgets/text/interfaces.py:29
10311031
msgid "Wildcard search"
1032-
msgstr ""
1032+
msgstr "萬用字元搜尋"
10331033

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

10681068
#: ../../facetednavigation/widgets/autocomplete/widget.py:106
10691069
msgid "solr"
1070-
msgstr ""
1070+
msgstr "Apache Solr"

eea/facetednavigation/search/catalog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def _apply_index(self, index, value):
4040
if not apply_index:
4141
return IIBucket(), (index_id,)
4242

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

4545
if not rset:
4646
return IIBucket(), (index_id,)

eea/facetednavigation/version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
10.8
1+
10.9

eea/facetednavigation/widgets/radio/view.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Faceted.RadioWidget.prototype = {
8181
},
8282

8383
reset: function(){
84-
jQuery(this.elements[0]).attr('checked', true);
84+
jQuery(this.elements[0]).prop('checked', true);
8585
this.selected = [];
8686
},
8787

@@ -102,7 +102,7 @@ Faceted.RadioWidget.prototype = {
102102
context.reset();
103103
}else{
104104
context.selected = radio;
105-
context.selected.attr('checked', true);
105+
context.selected.prop('checked', true);
106106
}
107107
});
108108
},
@@ -169,7 +169,7 @@ Faceted.RadioWidget.prototype = {
169169

170170
criteria_remove: function(){
171171
var element = jQuery(this.elements[0]);
172-
element.attr('checked', true);
172+
element.prop('checked', true);
173173
this.do_query();
174174
},
175175

@@ -221,9 +221,9 @@ Faceted.RadioWidget.prototype = {
221221
if(context.widget.hasClass('faceted-zero-count-hidden')){
222222
li.addClass('faceted-radio-item-zerocount');
223223
}
224-
input.attr('disabled', 'disabled');
224+
input.prop('disabled', 'disabled');
225225
}else{
226-
input.attr('disabled', false);
226+
input.prop('disabled', false);
227227
input.click(function(evt){
228228
context.radio_click(this, evt);
229229
});

0 commit comments

Comments
 (0)