Skip to content

Commit e4624ba

Browse files
committed
Add tel: prefix
* origin/pr/33: Added tel: prefix
2 parents 9b06659 + 89a5719 commit e4624ba

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

assets/components/tinymcerte/js/vendor/tinymce/plugins/modxlink/plugin.min.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,24 @@ tinymce.PluginManager.add('modxlink', function(editor) {
358358
return;
359359
}
360360

361+
// Is phonenumber
362+
var phoneno = /^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$/im;
363+
var hrefCheck = href.replace(' ', '');
364+
if (hrefCheck.match(phoneno)) {
365+
delayedConfirm(
366+
'The URL you entered seems to be an phonenumber. Do you want to add the required tel: prefix?',
367+
function(state) {
368+
if (state) {
369+
href = 'tel:' + hrefCheck;
370+
}
371+
372+
insertLink();
373+
}
374+
);
375+
376+
return;
377+
}
378+
361379
// Is not protocol prefixed
362380
if ((editor.settings.link_assume_external_targets && !/^\w+:/i.test(href)) ||
363381
(!editor.settings.link_assume_external_targets && /^\s*www\./i.test(href))) {

core/components/tinymcerte/docs/changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Changelog for TinyMCE Rich Text Editor.
22

3+
- Add tel: prefix
34
- Add modximage - left/right image positioning
45
- Sync tinymce and textarea
56
- Add modx skin (Credits goes to fourroses666)

0 commit comments

Comments
 (0)