13 from PyQt5.QtCore import Qt, QObject, QPoint |
13 from PyQt5.QtCore import Qt, QObject, QPoint |
14 from PyQt5.QtWidgets import QDialog, QMenu |
14 from PyQt5.QtWidgets import QDialog, QMenu |
15 |
15 |
16 import Preferences |
16 import Preferences |
17 import UI.PixmapCache |
17 import UI.PixmapCache |
|
18 |
|
19 from ..WebBrowserPage import WebBrowserPage |
18 |
20 |
19 |
21 |
20 class PersonalInformationManager(QObject): |
22 class PersonalInformationManager(QObject): |
21 """ |
23 """ |
22 Class implementing the personal information manager used to complete form |
24 Class implementing the personal information manager used to complete form |
181 if (e) {{ |
183 if (e) {{ |
182 var v = e.value.substring(0, e.selectionStart); |
184 var v = e.value.substring(0, e.selectionStart); |
183 v += "{2}" + e.value.substring(e.selectionEnd); |
185 v += "{2}" + e.value.substring(e.selectionEnd); |
184 e.value = v; |
186 e.value = v; |
185 }}""".format(self.__clickedPos.x(), self.__clickedPos.y(), info) |
187 }}""".format(self.__clickedPos.x(), self.__clickedPos.y(), info) |
186 self.__view.page().runJavaScript(source) |
188 self.__view.page().runJavaScript(source, WebBrowserPage.SafeJsWorld) |
187 |
189 |
188 def viewKeyPressEvent(self, view, evt): |
190 def viewKeyPressEvent(self, view, evt): |
189 """ |
191 """ |
190 Protected method to handle key press events we are interested in. |
192 Protected method to handle key press events we are interested in. |
191 |
193 |
262 'inset 0 0 2px 1px #000EEE'; |
264 'inset 0 0 2px 1px #000EEE'; |
263 break; |
265 break; |
264 }} |
266 }} |
265 }} |
267 }} |
266 }}""".format(self.__matchingJsTable()) |
268 }}""".format(self.__matchingJsTable()) |
267 page.runJavaScript(source) |
269 page.runJavaScript(source, WebBrowserPage.SafeJsWorld) |
268 |
270 |
269 def __matchingJsTable(self): |
271 def __matchingJsTable(self): |
270 """ |
272 """ |
271 Private method to create the common part of the JavaScript sources. |
273 Private method to create the common part of the JavaScript sources. |
272 |
274 |