Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XWIKI-20183: Prototype.js breaks the standard Array.from method #1932

Merged
merged 3 commits into from
Oct 5, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
<script src="$escapetool.xml($services.webjars.url('requirejs', "require$jsExtension"))" data-wysiwyg="true"></script>
## Load the JavaScript module used to determine when the page is ready (no pending HTTP requests or promises).
<script src="$escapetool.xml($xwiki.getSkinFile('uicomponents/tools/pageReady.js'))" data-wysiwyg="true"></script>
## Fix some Prototype.js breaking changes.
<script src="$escapetool.xml($xwiki.getSkinFile('js/xwiki/prototypeJSPatches.js'))"></script>
## FIXME: We still have code depending on Prototype.js without declaring it (i.e. without using RequireJS). Short term
## goal is to stop loading Prototype.js by default and change the existing code to load it when needed. Long term goal is
## to stop relying on Prototype.js . Note that we load Prototype.js before the following inline script because we have to
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
(function () {
// Code executed before Prototype.js is loaded.
oanalavinia marked this conversation as resolved.
Show resolved Hide resolved
const originalArrayFrom = Array.from;
setTimeout(() => {
// Code executed after Prototype.js is loaded.
Array.from = originalArrayFrom;
}, 0);
})();