[Libreoffice-commits] online.git: 2 commits - kit/ChildSession.cpp loleaflet/src
kit/ChildSession.cpp |2 +- loleaflet/src/control/Control.Toolbar.js |6 +++--- loleaflet/src/core/Socket.js | 30 +++--- 3 files changed, 27 insertions(+), 11 deletions(-) New commits: commit 16be50d7579a4a6c73b20a31938ba1750e8352de Author: Szymon Kłos AuthorDate: Tue Jul 28 12:45:01 2020 +0200 Commit: Szymon Kłos CommitDate: Tue Jul 28 14:51:10 2020 +0200 Send Action_Save_Resp when notification was requested on save as Change-Id: Iafe06873fcd8c25e93eb9daa2eea187827e3ac47 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/99593 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp index 38a5b699f..dc0e9ec3d 100644 --- a/kit/ChildSession.cpp +++ b/kit/ChildSession.cpp @@ -2113,7 +2113,7 @@ bool ChildSession::saveAs(const char* /*buffer*/, int /*length*/, const StringVe if (success) sendTextFrame("saveas: url=" + encodedURL + " filename=" + encodedWopiFilename); else -sendTextFrameAndLogError("error: cmd=storage kind=savefailed"); +sendTextFrameAndLogError("error: cmd=saveas kind=savefailed"); return true; } diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js index 7955429e7..9f382a020 100644 --- a/loleaflet/src/core/Socket.js +++ b/loleaflet/src/core/Socket.js @@ -522,7 +522,19 @@ L.Socket = L.Class.extend({ return; } - else if (textMsg.startsWith('error:') && command.errorCmd === 'storage') { + else if (textMsg.startsWith('error:') + && (command.errorCmd === 'storage' || command.errorCmd === 'saveas')) { + + if (command.errorCmd === 'saveas') { + this._map.fire('postMessage', { + msgId: 'Action_Save_Resp', + args: { + success: false, + result: command.errorKind + } + }); + } + this._map.hideBusy(); var storageError; if (command.errorKind === 'savediskfull') { @@ -596,16 +608,16 @@ L.Socket = L.Class.extend({ } // Skip empty errors (and allow for suppressing errors by making them blank). - if (storageError != '') { + if (storageError && storageError != '') { // Parse the storage url as link var tmpLink = document.createElement('a'); tmpLink.href = this._map.options.doc; // Insert the storage server address to be more friendly storageError = storageError.replace('%storageserver', tmpLink.host); this._map.fire('warn', {msg: storageError}); - } - return; + return; + } } else if (textMsg.startsWith('error:') && command.errorCmd === 'internal') { this._map.hideBusy(); @@ -625,9 +637,6 @@ L.Socket = L.Class.extend({ return; } - else if (textMsg.startsWith('error:') && command.errorCmd === 'saveas') { - this._map.hideBusy(); - } else if (textMsg.startsWith('error:') && command.errorCmd === 'load') { this._map.hideBusy(); this.close(); @@ -768,6 +777,13 @@ L.Socket = L.Class.extend({ NewName: command.filename } }); + } else if (textMsg.startsWith('saveas:')) { + this._map.fire('postMessage', { + msgId: 'Action_Save_Resp', + args: { + success: true + } + }); } } // var name = command.name; - ignored, we get the new name via the wopi's BaseFileName commit e9384302d1ca4758580c4c68f57fedf802989f15 Author: Szymon Kłos AuthorDate: Tue Jul 28 10:08:37 2020 +0200 Commit: Szymon Kłos CommitDate: Tue Jul 28 14:50:58 2020 +0200 Use more reliable approach to show close button
[Libreoffice-commits] online.git: 2 commits - kit/ChildSession.cpp loleaflet/src
kit/ChildSession.cpp |3 ++- loleaflet/src/control/Control.ContextMenu.js |1 + loleaflet/src/control/Control.JSDialogBuilder.js |4 loleaflet/src/control/Control.MobileWizard.js|3 +++ 4 files changed, 10 insertions(+), 1 deletion(-) New commits: commit 2e9dfc2851a50063ffa4f202e62a34ccd3cf09fd Author: Tamás Zolnai AuthorDate: Tue Dec 3 13:31:15 2019 +0100 Commit: Tamás Zolnai CommitDate: Tue Dec 3 14:44:17 2019 +0100 Context menu wizard: always close by clicking on an item. Change-Id: Ie51b5266e41d488d93f74e5dcc547aa0f5f41aa5 Reviewed-on: https://gerrit.libreoffice.org/84342 Reviewed-by: Tamás Zolnai Tested-by: Tamás Zolnai diff --git a/loleaflet/src/control/Control.ContextMenu.js b/loleaflet/src/control/Control.ContextMenu.js index 87f2ad02a..30f539493 100644 --- a/loleaflet/src/control/Control.ContextMenu.js +++ b/loleaflet/src/control/Control.ContextMenu.js @@ -103,6 +103,7 @@ L.Control.ContextMenu = L.Control.extend({ } var contextMenu = this._createContextMenuStructure(obj); if (window.mode.isMobile()) { + window.contextMenuWizard = true; var menuData = this.getMenuStructureForMobileWizard(contextMenu, true, ''); map.fire('mobilewizard', menuData); } else { diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index b7e1ebec9..7de526461 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -1404,6 +1404,10 @@ L.Control.JSDialogBuilder = L.Control.extend({ window.onClick(null, 'insertion_mobile_wizard'); else if (window.mobileMenuWizard) $('#main-menu-state').click() + else if (window.contextMenuWizard) { + window.contextMenuWizard = false; + builder.map.fire('closemobilewizard'); + } }); } else { console.debug('Builder used outside of mobile wizard: please implement the click handler'); diff --git a/loleaflet/src/control/Control.MobileWizard.js b/loleaflet/src/control/Control.MobileWizard.js index 2af4f2cf9..c02e6d5fc 100644 --- a/loleaflet/src/control/Control.MobileWizard.js +++ b/loleaflet/src/control/Control.MobileWizard.js @@ -127,6 +127,9 @@ L.Control.MobileWizard = L.Control.extend({ w2ui['actionbar'].click('insertion_mobile_wizard') } else if (window.mobileMenuWizard === true) { $('#main-menu-state').click() + } else if (window.contextMenuWizard) { + window.contextMenuWizard = false; + this.map.fire('closemobilewizard'); } } else { this._currentDepth--; commit 1e6ff5587847b8df1bf4fadf5ffb8cded038750a Author: Tamás Zolnai AuthorDate: Tue Dec 3 13:21:45 2019 +0100 Commit: Tamás Zolnai CommitDate: Tue Dec 3 14:44:09 2019 +0100 Spelling context menu: Fix execution of LanguageStatus Change-Id: Ia309246ee37c6c598e518e66f96fc80e1320ce55 Reviewed-on: https://gerrit.libreoffice.org/84341 Reviewed-by: Tamás Zolnai Tested-by: Tamás Zolnai diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp index 7e8c1f70c..45ee614e4 100644 --- a/kit/ChildSession.cpp +++ b/kit/ChildSession.cpp @@ -366,7 +366,8 @@ bool ChildSession::_handleInput(const char *buffer, int length) else if (tokens[0] == "uno") { // SpellCheckApplySuggestion might contain non separator spaces -if (tokens[1].find(".uno:SpellCheckApplySuggestion") != std::string::npos) +if (tokens[1].find(".uno:SpellCheckApplySuggestion") != std::string::npos || +tokens[1].find(".uno:LanguageStatus") != std::string::npos) { std::vector newTokens; newTokens.push_back(tokens[0]); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - kit/ChildSession.cpp loleaflet/src scripts/unocommands.py
kit/ChildSession.cpp |8 ++ loleaflet/src/control/Control.ContextMenu.js | 31 ++- loleaflet/src/unocommands.js |8 ++ scripts/unocommands.py |6 + 4 files changed, 48 insertions(+), 5 deletions(-) New commits: commit 19e576772aceb4fab4178677b6774055a8e0cdfc Author: Tamás Zolnai AuthorDate: Tue Nov 19 17:13:10 2019 +0100 Commit: Tamás Zolnai CommitDate: Sun Nov 24 14:12:42 2019 +0100 SpellingPopup: Handle sapces in suggestion. Change-Id: I09db2cd1db67797a50bc2943200f97aabb004fc6 Reviewed-on: https://gerrit.libreoffice.org/83607 Reviewed-by: Tamás Zolnai Tested-by: Tamás Zolnai diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp index 98101b6b1..677505ad9 100644 --- a/kit/ChildSession.cpp +++ b/kit/ChildSession.cpp @@ -364,6 +364,14 @@ bool ChildSession::_handleInput(const char *buffer, int length) } else if (tokens[0] == "uno") { +// SpellCheckApplySuggestion might contain non separator spaces +if (tokens[1].find(".uno:SpellCheckApplySuggestion") != std::string::npos) +{ +std::vector newTokens; +newTokens.push_back(tokens[0]); +newTokens.push_back(firstLine.substr(4)); // Copy the remaining part. +return unoCommand(buffer, length, newTokens); +} return unoCommand(buffer, length, tokens); } else if (tokens[0] == "selecttext") diff --git a/loleaflet/src/control/Control.ContextMenu.js b/loleaflet/src/control/Control.ContextMenu.js index 00f5f959d..6a28637bc 100644 --- a/loleaflet/src/control/Control.ContextMenu.js +++ b/loleaflet/src/control/Control.ContextMenu.js @@ -164,6 +164,7 @@ L.Control.ContextMenu = L.Control.extend({ if (hasParam || commandName === 'None' || commandName === 'FontDialogForParagraph') { itemName = window.removeAccessKey(item.text); + itemName = itemName.replace(' ', '\u00a0'); } else { // Get the translated text associated with the command itemName = _UNO(item.command, docType, true); commit 7041d5c5b035007f09f092d15b40aae4731803a6 Author: Tamás Zolnai AuthorDate: Sun Nov 17 15:38:05 2019 +0100 Commit: Tamás Zolnai CommitDate: Sun Nov 24 14:12:30 2019 +0100 Update conext menu code to handle Spelling Popup * Use unique IDs for sub menus. * Handle uno command's parameter. * When there is any parameter, we use the menu text. * Avoid to enable FontDialog on other conext menus * Introduce the command ".uno:None" to indicate that the menu item can't be executed. * Whitelisted spelling context menu's uno commands. * Add a black list in unocommands.py to list those uno commands which have no text in xcu file. In this case, we can use the text sent in the menu structure. Change-Id: Ie84fcb7d6c7a2f4cd50c666dbcd8c77cf42731de Reviewed-on: https://gerrit.libreoffice.org/83606 Reviewed-by: Tamás Zolnai Tested-by: Tamás Zolnai diff --git a/loleaflet/src/control/Control.ContextMenu.js b/loleaflet/src/control/Control.ContextMenu.js index bd5e3c400..00f5f959d 100644 --- a/loleaflet/src/control/Control.ContextMenu.js +++ b/loleaflet/src/control/Control.ContextMenu.js @@ -36,7 +36,9 @@ L.Control.ContextMenu = L.Control.extend({ 'DeleteRows', 'DeleteColumns', 'DeleteTable', 'MergeCells', 'SetOptimalColumnWidth', 'SetOptimalRowHeight', 'UpdateCurIndex','RemoveTableOf', - 'ReplyComment', 'DeleteComment', 'DeleteAuthor', 'DeleteAllNotes'], + 'ReplyComment', 'DeleteComment', 'DeleteAuthor', 'DeleteAllNotes', + 'SpellingAndGrammarDialog', 'LanguageStatus', 'FontDialog', 'FontDialogForParagraph', + 'SpellCheckIgnore', 'SpellCheckIgnoreAll', 'SpellCheckApplySuggestion'], spreadsheet: ['MergeCells', 'SplitCell', 'RecalcPivotTable', 'FormatCellDialog', 'ShowNote', 'DeleteNote'], @@ -116,6 +118,7 @@ L.Control.ContextMenu = L.Control.extend({ var docType = this._map.getDocType(); var contextMenu = {}; var sepIdx = 1, itemName; + var subMenuIdx = 1; var isLastItemText = false; for (var idx in obj.menu) { var item = obj.menu[idx]; @@ -133,7 +136,20 @@ L.Control.ContextMenu = L.Control.extend({ // Only show whitelisted items
[Libreoffice-commits] online.git: 2 commits - kit/ChildSession.cpp loleaflet/src
kit/ChildSession.cpp |7 +-- loleaflet/src/control/Control.Menubar.js | 19 --- 2 files changed, 21 insertions(+), 5 deletions(-) New commits: commit 078c9f2848033355b9f32eae72e86e4fbe7fc32f Author: Tor Lillqvist AuthorDate: Tue Oct 1 16:34:17 2019 +0300 Commit: Tor Lillqvist CommitDate: Tue Oct 1 22:33:18 2019 +0200 tdf#127669: Add more export formats for mobile apps The same formats are offered as for "Download as" in web-based Online. But in the apps, the menu entry is called "Export as", not "Download as", because the document is not being edited on some server from which it would be downloaded. Change-Id: I5b1bfc3300bae2c213812c2534ae6b583423662c Reviewed-on: https://gerrit.libreoffice.org/79964 Reviewed-by: Tor Lillqvist Tested-by: Tor Lillqvist (cherry picked from commit c7bfc05dcb1c475c1bf9a70d39732790793380d9) Reviewed-on: https://gerrit.libreoffice.org/8 diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js index dd2e92287..b1f08a722 100644 --- a/loleaflet/src/control/Control.Menubar.js +++ b/loleaflet/src/control/Control.Menubar.js @@ -27,7 +27,12 @@ L.Control.Menubar = L.Control.extend({ {name: _('Word 2003 Document (.doc)'), id: 'downloadas-doc', type: 'action'}, {name: _('Word Document (.docx)'), id: 'downloadas-docx', type: 'action'}, {name: _('Rich Text (.rtf)'), id: 'downloadas-rtf', type: 'action'}]}, - {name: _('Save as PDF'), id: 'downloadas-pdf', mobileapp: true, type: 'action'}, + {name: _('Export as'), id: 'downloadas', type: 'menu', mobileapp: true, menu: [ + {name: _('PDF Document (.pdf)'), id: 'downloadas-pdf', type: 'action'}, + {name: _('ODF text document (.odt)'), id: 'downloadas-odt', type: 'action'}, + {name: _('Word 2003 Document (.doc)'), id: 'downloadas-doc', type: 'action'}, + {name: _('Word Document (.docx)'), id: 'downloadas-docx', type: 'action'}, + {name: _('Rich Text (.rtf)'), id: 'downloadas-rtf', type: 'action'}]}, {name: _('Sign document'), id: 'signdocument', type: 'action'}, {type: 'separator'}, {name: _('Close document'), id: 'closedocument', type: 'action'} @@ -255,7 +260,11 @@ L.Control.Menubar = L.Control.extend({ {name: _('ODF presentation (.odp)'), id: 'downloadas-odp', type: 'action'}, {name: _('PowerPoint 2003 Presentation (.ppt)'), id: 'downloadas-ppt', type: 'action'}, {name: _('PowerPoint Presentation (.pptx)'), id: 'downloadas-pptx', type: 'action'}]}, - {name: _('Save as PDF'), id: 'downloadas-pdf', mobileapp: true, type: 'action'}, + {name: _('Export as'), id: 'downloadas', type: 'menu', mobileapp: true, menu: [ + {name: _('PDF Document (.pdf)'), id: 'downloadas-pdf', type: 'action'}, + {name: _('ODF presentation (.odp)'), id: 'downloadas-odp', type: 'action'}, + {name: _('PowerPoint 2003 Presentation (.ppt)'), id: 'downloadas-ppt', type: 'action'}, + {name: _('PowerPoint Presentation (.pptx)'), id: 'downloadas-pptx', type: 'action'}]}, {type: 'separator'}, {name: _('Close document'), id: 'closedocument', type: 'action'} ]}, @@ -346,7 +355,11 @@ L.Control.Menubar = L.Control.extend({ {name: _('ODF spreadsheet (.ods)'), id: 'downloadas-ods', type: 'action'}, {name: _('Excel 2003 Spreadsheet (.xls)'), id: 'downloadas-xls', type: 'action'}, {name: _('Excel Spreadsheet (.xlsx)'), id: 'downloadas-xlsx', type: 'action'}]}, - {name: _('Save as PDF'), id: 'downloadas-pdf', mobileapp: true, type: 'action'}, + {name: _('Export as'), id:'downloadas', type: 'menu', mobileapp: true, menu: [ + {name: _('PDF Document (.pdf)'), id: 'downloadas-pdf', type: 'action'}, + {name: _('ODF spreadsheet (.ods)'), id: 'downloadas-ods', type: 'action'}, + {name: _('Excel 2003 Spreadsheet (.xls)'), id: 'downloadas-xls', type: 'ac
[Libreoffice-commits] online.git: 2 commits - kit/ChildSession.cpp loleaflet/src
kit/ChildSession.cpp |2 ++ loleaflet/src/control/Signing.js | 17 + loleaflet/src/layer/tile/TileLayer.js |4 3 files changed, 19 insertions(+), 4 deletions(-) New commits: commit fe59a510fd9347de6e72444da943e1aa6824192b Author: Tomaž Vajngerl AuthorDate: Thu Jan 17 16:58:20 2019 +0100 Commit: Tomaž Vajngerl CommitDate: Thu Jan 17 16:58:20 2019 +0100 send a signal that the export, sign and upload was successful Change-Id: Ic55a2d5ea452c9153945d3bc9bcbb514a46e70e9 diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp index e4c899cca..2b8534c01 100644 --- a/kit/ChildSession.cpp +++ b/kit/ChildSession.cpp @@ -1562,6 +1562,8 @@ bool ChildSession::exportSignAndUploadDocument(const char* buffer, int length, c return false; } +sendTextFrame("signeddocumentuploadstatus: OK"); + return true; } diff --git a/loleaflet/src/control/Signing.js b/loleaflet/src/control/Signing.js index 17d605128..3f795686f 100644 --- a/loleaflet/src/control/Signing.js +++ b/loleaflet/src/control/Signing.js @@ -639,5 +639,14 @@ L.Map.include({ } awaitForDocumentStatusToUpload = false; currentDocumentType = null; + }, + onVereignUploadStatus: function(uploadStatus) { + if (uploadStatus == 'OK') { + _map.fire('infobar', { + msg: _('Document uploaded.'), + action: null, + actionLabel: null + }); + } } }); diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index 0134298d5..32e0951e1 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -491,6 +491,10 @@ L.TileLayer = L.GridLayer.extend({ var signstatus = textMsg.substring('signaturestatus:'.length + 1); this._map.onChangeSignStatus(signstatus); } + else if (textMsg.startsWith('signeddocumentuploadstatus:')) { + var status = textMsg.substring('signeddocumentuploadstatus:'.length + 1); + this._map.onVereignUploadStatus(status); + } else if (textMsg.startsWith('removesession')) { var viewId = parseInt(textMsg.substring('removesession'.length + 1)); if (this._map._docLayer._viewId === viewId) { commit a5ca9620922adaeb2bbe75cffc06ed7ec68f498c Author: Tomaž Vajngerl AuthorDate: Thu Jan 17 15:19:35 2019 +0100 Commit: Tomaž Vajngerl CommitDate: Thu Jan 17 15:19:35 2019 +0100 use export,sign,upload codepath for DOCX and ODT too Change-Id: Ic6c397e3936bfd659a6b4e8627ba45dbd4e6ae25 diff --git a/loleaflet/src/control/Signing.js b/loleaflet/src/control/Signing.js index 4195cb185..17d605128 100644 --- a/loleaflet/src/control/Signing.js +++ b/loleaflet/src/control/Signing.js @@ -368,7 +368,7 @@ function vereignUpload(documentType) { }); } -function vereignSignAndUploadPDF(documentType) { +function vereignExportSignAndUploadToVereign(documentType) { library.getOneTimeCertificateByPassport(currentPassport.uuid).then(function(result) { if (!isSuccess(result)) { return; @@ -417,10 +417,10 @@ function vereignSignAndUploadForType(uploadDocType) { if (documentType == null) return; - if (uploadDocType == 'PDF') { - vereignSignAndUploadPDF(documentType); + if (uploadDocType == 'PDF' || uploadDocType == 'DOCX' || uploadDocType == 'ODT') { + vereignExportSignAndUploadToVereign(documentType); } - else if (uploadDocType == 'DOCX' || uploadDocType == 'ODT') { + else { library.getOneTimeCertificateByPassport(currentPassport.uuid).then(function(result) { if (isSuccess(result)) { var otp = result.data; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: 2 commits - kit/ChildSession.cpp loleaflet/src
kit/ChildSession.cpp | 12 ++- loleaflet/src/control/Control.LokDialog.js | 93 +++-- loleaflet/src/layer/tile/TileLayer.js |5 + loleaflet/src/map/handler/Map.Keyboard.js | 33 +- 4 files changed, 107 insertions(+), 36 deletions(-) New commits: commit 199b582e06a3234a1803553bf5be88c4d462ffc6 Author: Pranav Kant Date: Wed Feb 14 18:11:31 2018 +0530 Use real input element for user input instead of canvas This allows moving the IME candidate window according to where the cursor in the lok dialog is. Change-Id: Icf17f1fc1d3f6af619c8e0037c32109d2b4721fc diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js index e6c92e77..20fe4b74 100644 --- a/loleaflet/src/control/Control.LokDialog.js +++ b/loleaflet/src/control/Control.LokDialog.js @@ -2,7 +2,7 @@ * L.Control.LokDialog used for displaying LOK dialogs */ -/* global $ map */ +/* global $ map L */ L.Control.LokDialog = L.Control.extend({ dialogIdPrefix: 'lokdialog-', @@ -145,12 +145,7 @@ L.Control.LokDialog = L.Control.extend({ var y = parseInt(rectangle[1]); height = parseInt(rectangle[3]); - var dialogCursor = L.DomUtil.get(strDlgId + '-cursor'); - L.DomUtil.setStyle(dialogCursor, 'height', height + 'px'); - L.DomUtil.setStyle(dialogCursor, 'display', this._dialogs[e.id].cursorVisible ? 'block' : 'none'); - // set the position of the cursor container element - L.DomUtil.setStyle(this._dialogs[e.id].cursor, 'left', x + 'px'); - L.DomUtil.setStyle(this._dialogs[e.id].cursor, 'top', y + 'px'); + this._updateDialogCursor(e.id, x, y, height); } } else if (e.action === 'title_changed') { if (e.title && this._dialogs[parseInt(e.id)]) { @@ -176,7 +171,20 @@ L.Control.LokDialog = L.Control.extend({ this._map.sendUnoCommand(e.uno); }, - _launchDialogCursor: function(dialogId) { + _updateDialogCursor: function(dlgId, x, y, height) { + var strDlgId = this._toDlgPrefix(dlgId); + var dialogCursor = L.DomUtil.get(strDlgId + '-cursor'); + L.DomUtil.setStyle(dialogCursor, 'height', height + 'px'); + L.DomUtil.setStyle(dialogCursor, 'display', this._dialogs[dlgId].cursorVisible ? 'block' : 'none'); + // set the position of the cursor container element + L.DomUtil.setStyle(this._dialogs[dlgId].cursor, 'left', x + 'px'); + L.DomUtil.setStyle(this._dialogs[dlgId].cursor, 'top', y + 'px'); + + // update the input as well + this._updateDialogInput(dlgId); + }, + + _createDialogCursor: function(dialogId) { var id = this._toRawDlgId(dialogId); this._dialogs[id].cursor = L.DomUtil.create('div', 'leaflet-cursor-container', L.DomUtil.get(dialogId)); var cursor = L.DomUtil.create('div', 'leaflet-cursor lokdialog-cursor', this._dialogs[id].cursor); @@ -184,6 +192,39 @@ L.Control.LokDialog = L.Control.extend({ L.DomUtil.addClass(cursor, 'blinking-cursor'); }, + _createDialogInput: function(dialogId) { + var id = this._toRawDlgId(dialogId); + var clipDlgContainer = L.DomUtil.create('div', 'clipboard-container', L.DomUtil.get(dialogId)); + clipDlgContainer.id = dialogId + '-clipboard-container'; + var dlgTextArea = L.DomUtil.create('input', 'clipboard', clipDlgContainer); + dlgTextArea.setAttribute('type', 'text'); + dlgTextArea.setAttribute('autocorrect', 'off'); + dlgTextArea.setAttribute('autocapitalize', 'off'); + dlgTextArea.setAttribute('autocomplete', 'off'); + dlgTextArea.setAttribute('spellcheck', 'false'); + this._dialogs[id].input = dlgTextArea; + + return dlgTextArea; + }, + + _updateDialogInput: function(dlgId) { + if (!this._dialogs[dlgId].input) + return; + + var strDlgId = this._toDlgPrefix(dlgId); + var left = parseInt(L.DomUtil.getStyle(this._dialogs[dlgId].cursor, 'left')); + var top = parseInt(L.DomUtil.getStyle(this._dialogs[dlgId].cursor, 'top')); + var dlgContainer = L.DomUtil.get(strDlgId + '-clipboard-container'); + L.DomUtil.setPosition(dlgContainer, new L.Point(left, top)); + }, + + focus: function(dlgId) { + if (!this._isOpen(dlgId) || !this._dialogs[dlgId].input) + return; + +