'auto draw' support drawtools current color
This commit is contained in:
parent
fb09a53b07
commit
3f17320de9
@ -2,7 +2,7 @@
|
|||||||
// @id iitc-plugin-bookmarks@ZasoGD
|
// @id iitc-plugin-bookmarks@ZasoGD
|
||||||
// @name IITC plugin: Bookmarks for maps and portals
|
// @name IITC plugin: Bookmarks for maps and portals
|
||||||
// @category Controls
|
// @category Controls
|
||||||
// @version 0.2.8.@@DATETIMEVERSION@@
|
// @version 0.2.81.@@DATETIMEVERSION@@
|
||||||
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
|
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
|
||||||
// @updateURL @@UPDATEURL@@
|
// @updateURL @@UPDATEURL@@
|
||||||
// @downloadURL @@DOWNLOADURL@@
|
// @downloadURL @@DOWNLOADURL@@
|
||||||
@ -555,17 +555,22 @@
|
|||||||
window.plugin.bookmarks.optPaste = function() {
|
window.plugin.bookmarks.optPaste = function() {
|
||||||
var promptAction = prompt('Press CTRL+V to paste it.', '');
|
var promptAction = prompt('Press CTRL+V to paste it.', '');
|
||||||
if(promptAction !== null && promptAction !== '') {
|
if(promptAction !== null && promptAction !== '') {
|
||||||
|
try {
|
||||||
localStorage[window.plugin.bookmarks.KEY_STORAGE] = promptAction;
|
localStorage[window.plugin.bookmarks.KEY_STORAGE] = promptAction;
|
||||||
window.plugin.bookmarks.refreshBkmrks();
|
window.plugin.bookmarks.refreshBkmrks();
|
||||||
window.runHooks('pluginBkmrksEdit', {"target": "all", "action": "import"});
|
window.runHooks('pluginBkmrksEdit', {"target": "all", "action": "import"});
|
||||||
console.log('BOOKMARKS: reset and imported bookmarks');
|
console.log('BOOKMARKS: reset and imported bookmarks');
|
||||||
window.plugin.bookmarks.optAlert('Successful. ');
|
window.plugin.bookmarks.optAlert('Successful. ');
|
||||||
|
} catch(e) {
|
||||||
|
console.warn('BOOKMARKS: failed to import data: '+e);
|
||||||
|
window.plugin.bookmarks.optAlert('<span style="color: #f88">Import failed </span>');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
window.plugin.bookmarks.optReset = function() {
|
window.plugin.bookmarks.optReset = function() {
|
||||||
var promptAction = prompt('All bookmarks will be deleted. Are you sure? [Y/N]', '');
|
var promptAction = confirm('All bookmarks will be deleted. Are you sure?', '');
|
||||||
if(promptAction !== null && (promptAction === 'Y' || promptAction === 'y')) {
|
if(promptAction) {
|
||||||
delete localStorage[window.plugin.bookmarks.KEY_STORAGE];
|
delete localStorage[window.plugin.bookmarks.KEY_STORAGE];
|
||||||
window.plugin.bookmarks.createStorage();
|
window.plugin.bookmarks.createStorage();
|
||||||
window.plugin.bookmarks.loadStorage();
|
window.plugin.bookmarks.loadStorage();
|
||||||
@ -625,6 +630,8 @@
|
|||||||
if(latlngs.length >= 2 && latlngs.length <= 3) {
|
if(latlngs.length >= 2 && latlngs.length <= 3) {
|
||||||
// TODO: add an API to draw-tools rather than assuming things about it's internals
|
// TODO: add an API to draw-tools rather than assuming things about it's internals
|
||||||
var newItem;
|
var newItem;
|
||||||
|
window.plugin.drawTools.setOptions();
|
||||||
|
|
||||||
if(latlngs.length == 2) {
|
if(latlngs.length == 2) {
|
||||||
newItem = L.geodesicPolyline(latlngs, window.plugin.drawTools.lineOptions);
|
newItem = L.geodesicPolyline(latlngs, window.plugin.drawTools.lineOptions);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user