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

Polyfill for String.prototype.normalize() #5416

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions inc/html.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -5865,6 +5865,7 @@ static private function loadJavascript() {
}

// Some Javascript-Functions which we may need later
echo Html::script('lib/unorm/unorm.js');
echo Html::script('js/common.js');
self::redefineAlert();
self::redefineConfirm();
Expand Down
1 change: 1 addition & 0 deletions install/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ function header_html($etape) {
echo Html::script("lib/jquery/js/jquery.js");
echo Html::script('lib/jquery/js/jquery-ui-1.10.4.custom.js');
echo Html::script("lib/jqueryplugins/select2/js/select2.js");
echo Html::script('lib/unorm/unorm.js');
echo Html::script("js/common.js");

// CSS
Expand Down
2 changes: 1 addition & 1 deletion js/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,7 @@ var templateSelection = function (selection) {
*/
var getTextWithoutDiacriticalMarks = function (text) {
if (typeof(text.normalize) !== 'function') {
return text; // normalize method is not supported by old browsers (actually only IE)
return UNorm.normalize('NFD', text); // normalize method is not supported by old browsers (actually only IE)
}

// Normalizing to NFD Unicode normal form decomposes combined graphemes
Expand Down
Loading