Index: trunk/extensions/Collection/collection/collection.js |
— | — | @@ -36,7 +36,7 @@ |
37 | 37 | * @return String text of elment with ID id |
38 | 38 | */ |
39 | 39 | function gettext(sel, param/*=null*/) { |
40 | | - var txt = $(sel).html(); |
| 40 | + var txt = jQuery(sel).html(); |
41 | 41 | if (param) { |
42 | 42 | txt = txt.replace(/%PARAM%/g, param); |
43 | 43 | } |
— | — | @@ -49,13 +49,13 @@ |
50 | 50 | /******************************************************************************/ |
51 | 51 | |
52 | 52 | function getMWServeStatus() { |
53 | | - $.getJSON(script_url, { |
| 53 | + jQuery.getJSON(script_url, { |
54 | 54 | 'action': 'ajax', |
55 | 55 | 'rs': 'wfAjaxGetMWServeStatus', |
56 | 56 | 'rsargs[]': [collection_id, writer] |
57 | 57 | }, function(result) { |
58 | 58 | if (result.state == 'progress' ) { |
59 | | - $('#renderingProgress').html('' + result.status.progress); |
| 59 | + jQuery('#renderingProgress').html('' + result.status.progress); |
60 | 60 | if (result.status.status) { |
61 | 61 | var status = result.status.status; |
62 | 62 | if (result.status.article) { |
— | — | @@ -63,7 +63,7 @@ |
64 | 64 | } else if (result.status.page) { |
65 | 65 | status += gettext('#renderingPage', result.status.page); |
66 | 66 | } |
67 | | - $('#renderingStatus').html(gettext('#renderingStatusText', status)); |
| 67 | + jQuery('#renderingStatus').html(gettext('#renderingStatusText', status)); |
68 | 68 | } |
69 | 69 | setTimeout(getMWServeStatus, 500); |
70 | 70 | } else { |
— | — | @@ -117,7 +117,7 @@ |
118 | 118 | function set_titles() { |
119 | 119 | sajax_request_type = "POST"; |
120 | 120 | sajax_do_call('wfAjaxCollectionSetTitles', |
121 | | - [$('#titleInput').val(), $('#subtitleInput').val()], function() {}); |
| 121 | + [jQuery('#titleInput').val(), jQuery('#subtitleInput').val()], function() {}); |
122 | 122 | return false; |
123 | 123 | } |
124 | 124 | |
— | — | @@ -128,76 +128,76 @@ |
129 | 129 | } |
130 | 130 | |
131 | 131 | function update_save_button() { |
132 | | - if (!$('#saveButton').get(0)) { |
| 132 | + if (!jQuery('#saveButton').get(0)) { |
133 | 133 | return; |
134 | 134 | } |
135 | | - if ($('#emptyCollection').get(0)) { |
136 | | - $('#saveButton').attr('disabled', 'disabled'); |
| 135 | + if (jQuery('#emptyCollection').get(0)) { |
| 136 | + jQuery('#saveButton').attr('disabled', 'disabled'); |
137 | 137 | return; |
138 | 138 | } |
139 | | - if ($('#personalCollType:checked').val()) { |
140 | | - $('#personalCollTitle').attr('disabled', ''); |
141 | | - $('#communityCollTitle').attr('disabled', 'disabled'); |
142 | | - if (!$.trim($('#personalCollTitle').val())) { |
143 | | - $('#saveButton').attr('disabled', 'disabled'); |
| 139 | + if (jQuery('#personalCollType:checked').val()) { |
| 140 | + jQuery('#personalCollTitle').attr('disabled', ''); |
| 141 | + jQuery('#communityCollTitle').attr('disabled', 'disabled'); |
| 142 | + if (!jQuery.trim(jQuery('#personalCollTitle').val())) { |
| 143 | + jQuery('#saveButton').attr('disabled', 'disabled'); |
144 | 144 | return; |
145 | 145 | } |
146 | | - } else if ($('#communityCollType:checked').val()) { |
147 | | - $('#communityCollTitle').attr('disabled', ''); |
148 | | - $('#personalCollTitle').attr('disabled', 'disabled'); |
149 | | - if (!$.trim($('#communityCollTitle').val())) { |
150 | | - $('#saveButton').attr('disabled', 'disabled'); |
| 146 | + } else if (jQuery('#communityCollType:checked').val()) { |
| 147 | + jQuery('#communityCollTitle').attr('disabled', ''); |
| 148 | + jQuery('#personalCollTitle').attr('disabled', 'disabled'); |
| 149 | + if (!jQuery.trim(jQuery('#communityCollTitle').val())) { |
| 150 | + jQuery('#saveButton').attr('disabled', 'disabled'); |
151 | 151 | return; |
152 | 152 | } |
153 | 153 | } |
154 | | - $('#saveButton').attr('disabled', ''); |
| 154 | + jQuery('#saveButton').attr('disabled', ''); |
155 | 155 | } |
156 | 156 | |
157 | 157 | function make_sortable() { |
158 | | - $('#collectionList').sortable({ |
| 158 | + jQuery('#collectionList').sortable({ |
159 | 159 | axis: 'y', |
160 | 160 | update: function(evt, ui) { |
161 | | - set_sorting($('#collectionList').sortable('serialize')); |
| 161 | + set_sorting(jQuery('#collectionList').sortable('serialize')); |
162 | 162 | } |
163 | 163 | }); |
164 | | - $('#collectionList .sortableitem').css('cursor', 'move'); |
| 164 | + jQuery('#collectionList .sortableitem').css('cursor', 'move'); |
165 | 165 | } |
166 | 166 | |
167 | 167 | function refresh_list(xhr) { |
168 | | - $('#collectionListContainer').html(xhr.responseText); |
169 | | - $('.makeVisible').css('display', 'inline'); |
| 168 | + jQuery('#collectionListContainer').html(xhr.responseText); |
| 169 | + jQuery('.makeVisible').css('display', 'inline'); |
170 | 170 | make_sortable(); |
171 | | - if ($('#emptyCollection').get(0)) { |
172 | | - $('#downloadButton').attr('disabled', 'disabled'); |
173 | | - $('input.order').attr('disabled', 'disabled'); |
| 171 | + if (jQuery('#emptyCollection').get(0)) { |
| 172 | + jQuery('#downloadButton').attr('disabled', 'disabled'); |
| 173 | + jQuery('input.order').attr('disabled', 'disabled'); |
174 | 174 | } else { |
175 | | - $('#downloadButton').attr('disabled', ''); |
176 | | - $('input.order').attr('disabled', ''); |
| 175 | + jQuery('#downloadButton').attr('disabled', ''); |
| 176 | + jQuery('input.order').attr('disabled', ''); |
177 | 177 | } |
178 | 178 | update_save_button(); |
179 | 179 | } |
180 | 180 | |
181 | | -$(function() { |
| 181 | +jQuery(function() { |
182 | 182 | if (requiredVersion != wgCollectionVersion) { |
183 | 183 | alert('ERROR: Version mismatch between Javascript and PHP code. Contact admin to fix the installation of Collection extension for MediaWiki.'); |
184 | 184 | return; |
185 | 185 | } |
186 | | - if ($('#collectionList').get(0)) { |
187 | | - $('.makeVisible').css('display', 'inline'); |
| 186 | + if (jQuery('#collectionList').get(0)) { |
| 187 | + jQuery('.makeVisible').css('display', 'inline'); |
188 | 188 | window.coll_create_chapter = create_chapter; |
189 | 189 | window.coll_remove_item = remove_item; |
190 | 190 | window.coll_rename_chapter = rename_chapter; |
191 | 191 | window.coll_clear_collection = clear_collection; |
192 | 192 | update_save_button(); |
193 | 193 | make_sortable(); |
194 | | - $('#personalCollTitle').keyup(update_save_button); |
195 | | - $('#personalCollTitle').change(update_save_button); |
196 | | - $('#communityCollTitle').keyup(update_save_button); |
197 | | - $('#communityCollTitle').change(update_save_button); |
198 | | - $('#personalCollType').change(update_save_button); |
199 | | - $('#communityCollType').change(update_save_button); |
200 | | - $('#titleInput').change(set_titles); |
201 | | - $('#subtitleInput').change(set_titles); |
| 194 | + jQuery('#personalCollTitle').keyup(update_save_button); |
| 195 | + jQuery('#personalCollTitle').change(update_save_button); |
| 196 | + jQuery('#communityCollTitle').keyup(update_save_button); |
| 197 | + jQuery('#communityCollTitle').change(update_save_button); |
| 198 | + jQuery('#personalCollType').change(update_save_button); |
| 199 | + jQuery('#communityCollType').change(update_save_button); |
| 200 | + jQuery('#titleInput').change(set_titles); |
| 201 | + jQuery('#subtitleInput').change(set_titles); |
202 | 202 | } |
203 | 203 | if (typeof collection_rendering != 'undefined') { |
204 | 204 | getMWServeStatus(); |
Index: trunk/extensions/Collection/Collection.body.php |
— | — | @@ -218,6 +218,7 @@ |
219 | 219 | $wgOut->addInlineScript( "var wgCollectionVersion = \"$wgCollectionVersion\";" ); |
220 | 220 | $wgOut->addScript( "<script type=\"$wgJsMimeType\" src=\"$wgScriptPath/extensions/Collection/collection/jquery.js?$wgCollectionStyleVersion\"></script>" ); |
221 | 221 | $wgOut->addScript( "<script type=\"$wgJsMimeType\" src=\"$wgScriptPath/extensions/Collection/collection/jquery.ui.js?$wgCollectionStyleVersion\"></script>" ); |
| 222 | + $wgOut->addInlineScript( "jQuery.noConflict();" ); |
222 | 223 | $wgOut->addScript( "<script type=\"$wgJsMimeType\" src=\"$wgScriptPath/extensions/Collection/collection/collection.js?$wgCollectionStyleVersion\"></script>" ); |
223 | 224 | |
224 | 225 | $template = new CollectionPageTemplate(); |