mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 979470 - When a phone number is highlighted, offer to call it from the context menu or action bar r=mfinkle
This commit is contained in:
parent
32415966ea
commit
3b1c716069
BIN
mobile/android/base/resources/drawable-hdpi/phone.png
Normal file
BIN
mobile/android/base/resources/drawable-hdpi/phone.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 528 B |
BIN
mobile/android/base/resources/drawable-xhdpi/phone.png
Normal file
BIN
mobile/android/base/resources/drawable-xhdpi/phone.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 689 B |
BIN
mobile/android/base/resources/drawable/phone.png
Normal file
BIN
mobile/android/base/resources/drawable/phone.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 380 B |
1
mobile/android/base/resources/layout/.#tabs_item_row.xml
Symbolic link
1
mobile/android/base/resources/layout/.#tabs_item_row.xml
Symbolic link
@ -0,0 +1 @@
|
||||
blassey@flyingfox.local.319
|
@ -1,3 +1,4 @@
|
||||
// -*- Mode: js2; tab-width: 2; indent-tabs-mode: nil; js2-basic-offset: 2; js2-skip-preprocessor-directives: t; -*-
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
@ -494,6 +495,20 @@ var SelectionHandler = {
|
||||
selector: ClipboardHelper.searchWithContext,
|
||||
},
|
||||
|
||||
CALL: {
|
||||
label: Strings.browser.GetStringFromName("contextmenu.call"),
|
||||
id: "call_action",
|
||||
icon: "drawable://phone",
|
||||
action: function() {
|
||||
SelectionHandler.callSelection();
|
||||
},
|
||||
order: 1,
|
||||
selector: {
|
||||
matches: function isPhoneNumber(aElement, aX, aY) {
|
||||
return null != SelectionHandler._getSelectedPhoneNumber();
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
/*
|
||||
@ -744,6 +759,22 @@ var SelectionHandler = {
|
||||
this._closeSelection();
|
||||
},
|
||||
|
||||
_phoneRegex: /(?:\s|^)[\+]?(\(?\d{1,8}\)?)?([- \.]+\(?\d{1,8}\)?)+( ?(x|ext) ?\d{1,3})?(?:\s|$)/,
|
||||
|
||||
_getSelectedPhoneNumber: function sh_isPhoneNumber() {
|
||||
let selectedText = this._getSelectedText();
|
||||
return (selectedText.length && this._phoneRegex.test(selectedText) ?
|
||||
selectedText : null);
|
||||
},
|
||||
|
||||
callSelection: function sh_callSelection() {
|
||||
let selectedText = this._getSelectedPhoneNumber();
|
||||
if (selectedText) {
|
||||
BrowserApp.loadURI("tel:" + selectedText);
|
||||
}
|
||||
this._closeSelection();
|
||||
},
|
||||
|
||||
/*
|
||||
* Shuts SelectionHandler down.
|
||||
*/
|
||||
@ -904,6 +935,7 @@ var SelectionHandler = {
|
||||
positions: positions,
|
||||
rtl: this._isRTL
|
||||
});
|
||||
this._updateMenu();
|
||||
},
|
||||
|
||||
subdocumentScrolled: function sh_subdocumentScrolled(aElement) {
|
||||
|
@ -201,6 +201,8 @@ contextmenu.cut=Cut
|
||||
contextmenu.selectAll=Select All
|
||||
contextmenu.paste=Paste
|
||||
|
||||
contextmenu.call=Call
|
||||
|
||||
# Select UI
|
||||
selectHelper.closeMultipleSelectDialog=Done
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user