From fb09a53b075848579b1c486b9720595e9dfd11b9 Mon Sep 17 00:00:00 2001 From: Giacinto Garcea Date: Sun, 2 Feb 2014 22:28:07 +0100 Subject: [PATCH 1/5] Bookmarks 2.8 - vertical scrollbar; - button to hide/show "x" buttons; - bookmarks full-width in mobile (no margin-right); - minor UI and UX fix; --- plugins/bookmarks-by-zaso.user.js | 10 +- plugins/bookmarks-css.css | 165 +++++++++++++++++++++--------- 2 files changed, 124 insertions(+), 51 deletions(-) diff --git a/plugins/bookmarks-by-zaso.user.js b/plugins/bookmarks-by-zaso.user.js index e15075f9..5363e5b2 100644 --- a/plugins/bookmarks-by-zaso.user.js +++ b/plugins/bookmarks-by-zaso.user.js @@ -2,7 +2,7 @@ // @id iitc-plugin-bookmarks@ZasoGD // @name IITC plugin: Bookmarks for maps and portals // @category Controls -// @version 0.2.7.@@DATETIMEVERSION@@ +// @version 0.2.8.@@DATETIMEVERSION@@ // @namespace https://github.com/jonatkins/ingress-intel-total-conversion // @updateURL @@UPDATEURL@@ // @downloadURL @@DOWNLOADURL@@ @@ -433,6 +433,11 @@ } } + window.plugin.bookmarks.deleteMode = function() { + $('#bookmarksBox').toggleClass('deleteMode'); + } + + /***************************************************************************************************************************************************************/ // Saved the new sort of the folders (in the localStorage) @@ -489,6 +494,7 @@ items:"li.bookmarkFolder:not(.othersBookmarks)", handle:".bookmarksAnchor", placeholder:"sortable-placeholder", + helper:'clone', // fix accidental click in firefox forcePlaceholderSize:true, update:function(event, ui) { var typeList = $('#'+ui.item.context.id).parent().parent('.bookmarkList').attr('id'); @@ -501,6 +507,7 @@ connectWith:".bookmarkList ul ul", handle:".bookmarksLink", placeholder:"sortable-placeholder", + helper:'clone', // fix accidental click in firefox forcePlaceholderSize:true, update:function(event, ui) { var typeList = $('#'+ui.item.context.id).parent().parent().parent().parent('.bookmarkList').attr('id'); @@ -885,6 +892,7 @@ +'
' +'-' +'
...
' + +'Show/Hide "X" button' +'
' +'
' +'
Maps
' diff --git a/plugins/bookmarks-css.css b/plugins/bookmarks-css.css index 9c160667..30334150 100644 --- a/plugins/bookmarks-css.css +++ b/plugins/bookmarks-css.css @@ -9,13 +9,18 @@ line-height:22px; text-indent:0; text-decoration:none; + -webkit-box-sizing:border-box; + -moz-box-sizing:border-box; + box-sizing:border-box; } + #bookmarksBox{ display:block; position:absolute !important; z-index:4001; top:100px; left:100px; + width:231px; } #bookmarksBox .addForm, #bookmarksBox #bookmarksTypeBar, @@ -25,33 +30,41 @@ color:#fff; font-size:14px; } -#bookmarksBox #topBar, -#bookmarksBox #topBar *{ +#bookmarksBox #topBar{ height:15px !important; } +#bookmarksBox #topBar *{ + height: 14px !important; +} #bookmarksBox #topBar *{ float:left !important; } #bookmarksBox .handle{ - text-indent:-20px; - width:209px; +/* text-indent:-20px;*/ + width:80%; text-align:center; color:#fff; - line-height:8px; + line-height:6px; cursor:move; } #bookmarksBox #topBar .btn{ display:block; - width:19px; + width:10%; cursor:pointer; color:#20a8b1; -} -#bookmarksBox #topBar #bookmarksMin{ + font-weight:bold; text-align:center; - line-height:14px; + line-height:13px; font-size:18px; } + +#bookmarksBox #topBar #bookmarksDel{ + overflow:hidden; + text-indent:-999px; + background:#B42E2E; +} + #bookmarksBox #topBar #bookmarksMin:hover{ color:#ffce00; } @@ -59,8 +72,9 @@ clear:both; } #bookmarksBox h5{ - padding:4px 0; - width:114px; + padding:4px 0 23px; + width:50%; + height:93px !important; text-align:center; color:#788; } @@ -73,9 +87,8 @@ color:#ffce00; background:rgba(0,0,0,0); } -#bookmarksBox #topBar .btn, +#bookmarksBox #topBar, #bookmarksBox .addForm, -#bookmarksBox .handle, #bookmarksBox #bookmarksTypeBar, #bookmarksBox .bookmarkList li.bookmarksEmpty, #bookmarksBox .bookmarkList li.bkmrk a, @@ -90,16 +103,16 @@ #bookmarksBox .addForm *{ display:block; float:left; - padding:4px 8px 3px; + height:28px !important; } #bookmarksBox .addForm a{ cursor:pointer; color:#20a8b1; font-size:12px; - width:65px; + width:35%; text-align:center; line-height:20px; - padding:4px 0 3px; + padding:4px 0 23px; } #bookmarksBox .addForm a:hover{ background:#ffce00; @@ -109,15 +122,19 @@ #bookmarksBox .addForm input{ font-size:11px !important; color:#ffce00; - width:81px; - line-height:11px; + height:28px; + padding:4px 8px 1px; + line-height:12px; font-size:12px; - -webkit-box-sizing:content-box; - -moz-box-sizing:content-box; - box-sizing:content-box; } #bookmarksBox #bkmrk_portals .addForm input{ - width:147px; + width:65%; +} +#bookmarksBox #bkmrk_maps .addForm input{ + width:42%; +} +#bookmarksBox #bkmrk_maps .addForm a{ + width:29%; } #bookmarksBox .addForm input:hover, #bookmarksBox .addForm input:focus{ @@ -125,11 +142,12 @@ background:rgba(0,0,0,.6); } #bookmarksBox .bookmarkList > ul{ - width:231px; clear:both; list-style-type:none; color:#fff; overflow:hidden; + overflow-y:auto; + max-height:580px; } #bookmarksBox .sortable-placeholder{ background:rgba(8,48,78,.55); @@ -161,12 +179,12 @@ color:#eee; } #bookmarksBox ul .bookmarksRemoveFrom{ - width:19px; + width:10%; text-align:center; color:#fff; } #bookmarksBox ul .bookmarksLink{ - width:171px; + width:90%; padding:0 10px 0 8px; color:#ffce00; } @@ -174,7 +192,7 @@ color:#03fe03; } #bookmarksBox ul .othersBookmarks .bookmarksLink{ - width:190px; + width:90%; } #bookmarksBox ul .bookmarksLink:hover{ color:#03fe03; @@ -183,6 +201,8 @@ color:#fff; background:#e22 !important; } + +/*---- UI border -----*/ #bookmarksBox, #bookmarksBox *{ border-color:#20a8b1; @@ -193,29 +213,31 @@ #bookmarksBox ul .bookmarkFolder{ border-top-width:1px; } +#bookmarksBox, #bookmarksBox #topBar, #bookmarksBox #bookmarksTypeBar, #bookmarksBox .addForm, #bookmarksBox ul .bookmarkFolder .folderLabel, -#bookmarksBox ul li.bkmrk{ +#bookmarksBox ul li.bkmrk a { border-bottom-width:1px; } -#bookmarksBox ul .bookmarkFolder, -#bookmarksBox ul .bookmarksRemoveFrom{ +#bookmarksBox ul .bookmarkFolder{ border-right-width:1px; border-left-width:1px; } #bookmarksBox #topBar *, #bookmarksBox #bookmarksTypeBar *, -#bookmarksBox .addForm *{ +#bookmarksBox .addForm *, +#bookmarksBox ul li.bkmrk{ border-left-width:1px; } #bookmarksBox #topBar, #bookmarksBox #bookmarksTypeBar, -#bookmarksBox .addForm{ +#bookmarksBox .addForm, +#bookmarksBox ul .bookmarksRemoveFrom{ border-right-width:1px; } -#bookmarksBox ul .othersBookmarks .bookmarksRemoveFrom, +#bookmarksBox ul .bookmarkFolder.othersBookmarks li.bkmrk, #bookmarksBox ul .bookmarkFolder .folderLabel .bookmarksRemoveFrom{ border-left-width:0; } @@ -272,17 +294,25 @@ } #bookmarksBox .bookmarkList .bkmrk.ui-sortable-helper{ border-right-width:1px; - border-left-width:1px; + border-left-width:1px !important; } #bookmarksBox .bookmarkList ul li ul li.sortable-placeholder{ height:23px; box-shadow:inset 0 -1px 0 #20a8b1,inset 1px 0 0 #20a8b1; } + #bookmarksBox .bookmarkList ul li.bookmarkFolder.ui-sortable-helper, -#bookmarksBox .bookmarkList ul li.othersBookmarks ul, #bookmarksBox .bookmarkList ul li.othersBookmarks ul li.sortable-placeholder{ box-shadow:inset 0 -1px 0 #20a8b1; } + +#bookmarksBox #topBar #bookmarksDel, +#bookmarksBox .bookmarkList .bookmarkFolder .folderLabel:hover .bookmarksRemoveFrom, +#bookmarksBox .bookmarkList .bookmarkFolder .folderLabel:hover .bookmarksAnchor{ + border-bottom-width:1px; +} + +/*---------*/ #bookmarksBox .bookmarkList .bookmarkFolder .folderLabel .bookmarksAnchor span, #bookmarksBox .bookmarkList .bookmarkFolder .folderLabel > span, #bookmarksBox .bookmarkList .bookmarkFolder .folderLabel > span > span, @@ -304,7 +334,7 @@ #bookmarksBox .bookmarkList .bookmarkFolder .folderLabel .bookmarksAnchor{ line-height:25px; color:#fff; - width:209px; + width:90%; } #bookmarksBox .bookmarkList .bookmarkFolder .folderLabel .bookmarksAnchor span{ float:left; @@ -336,6 +366,7 @@ #bookmarksBox .bookmarkList .bookmarkFolder.open .folderLabel > span, #bookmarksBox .bookmarkList .bookmarkFolder.open .folderLabel > span > span{ display:block; + display:none; } #bookmarksBox .bookmarkList .bookmarkFolder.open .folderLabel:hover > span > span{ border-color:transparent #036 transparent transparent; @@ -345,7 +376,7 @@ } #bookmarksBox .bookmarkList .bookmarkFolder ul{ display:none; - margin-left:19px; + margin-left:10%; } #bookmarksBox .bookmarkList .bookmarkFolder.open ul{ display:block; @@ -355,6 +386,26 @@ margin-left:0; } +/*---- Width for deleteMode -----*/ +#bookmarksBox .bookmarksRemoveFrom{ + display:none !important; +} +#bookmarksBox.deleteMode .bookmarksRemoveFrom{ + display:block !important; +} + +#bookmarksBox .bookmarkList .bookmarkFolder .folderLabel .bookmarksAnchor, +#bookmarksBox ul .bookmarksLink, +#bookmarksBox ul .othersBookmarks .bookmarksLink{ + width:100% !important; +} + +#bookmarksBox.deleteMode .bookmarkList .bookmarkFolder .folderLabel .bookmarksAnchor, +#bookmarksBox.deleteMode ul .bookmarksLink, +#bookmarksBox.deleteMode ul .othersBookmarks .bookmarksLink{ + width:90% !important; +} + /********************************************** MOBILE **********************************************/ @@ -380,14 +431,27 @@ box-shadow:none !important; border-width:0 !important; } -#bookmarksBox.mobile #topBar{ +#bookmarksBox.mobile #topBar #bookmarksMin, +#bookmarksBox.mobile #topBar .handle{ display:none !important; } + +#bookmarksBox.mobile #topBar #bookmarksDel{ + width:100%; + height:34px !important; + font-size:13px; + color:#fff; + font-weight:normal; + padding-top:11px; + text-indent:0; +} + #bookmarksBox.mobile #bookmarksTypeBar h5{ cursor:pointer; text-align:center; float:left; width:50%; + height:auto !important; padding:7px 0; } #bookmarksBox.mobile #bookmarksTypeBar h5.current{ @@ -413,14 +477,15 @@ #bookmarksBox.mobile .bookmarkList li.bookmarkFolder a.bookmarksRemoveFrom, #bookmarksBox.mobile .bookmarkList li.bkmrk a.bookmarksRemoveFrom{ box-shadow:inset 0 1px 0 #20a8b1,inset -1px 0 0 #20a8b1 !important; - width:15%; + width:10%; background:none !important; } #bookmarksBox.mobile .bookmarkList li.bookmarkFolder a.bookmarksAnchor, #bookmarksBox.mobile .bookmarkList li.bkmrk a.bookmarksLink{ text-indent:10px; - width:85%; - height:21px; +/* width:85%;*/ + height:36px; + line-height:24px; overflow:hidden; } #bookmarksBox.mobile .bookmarkList ul li.bookmarkFolder ul{ @@ -428,7 +493,7 @@ } #bookmarksBox.mobile .bookmarkList > ul{ border-bottom:1px solid #20a8b1 !important; - border-right:1px solid #20a8b1 !important; +/* border-right:1px solid #20a8b1 !important;*/ } #bookmarksBox.mobile .bookmarkList .bookmarkFolder.othersBookmarks ul{ @@ -440,14 +505,14 @@ } #bookmarksBox.mobile .bookmarkList > ul{ max-height:none; - width:85% !important; +/* width:85% !important;*/ } #bookmarksBox.mobile .bookmarkList li.bookmarkFolder .folderLabel{ box-shadow:0 1px 0 #20a8b1 !important; } #bookmarksBox.mobile .bookmarkList ul li.bookmarkFolder ul{ - width:85% !important; - margin-left:15% !important; + width:90% !important; + margin-left:10% !important; } #bookmarksBox.mobile .bookmarkList ul li.bookmarkFolder.othersBookmarks ul{ width:100% !important; @@ -461,7 +526,7 @@ } #bookmarksBox.mobile .addForm, #bookmarksBox.mobile .addForm *{ - height:35px; + height:35px !important; padding:0; } #bookmarksBox.mobile .addForm a{ @@ -469,14 +534,14 @@ } #bookmarksBox.mobile .addForm a{ - width:25% !important; +/* width:25% !important;*/ } #bookmarksBox.mobile .addForm input{ - width:50% !important; +/* width:50% !important;*/ text-indent:10px; } #bookmarksBox.mobile #bkmrk_portals .addForm input{ - width:75% !important; +/* width:75% !important;*/ } #bookmarksBox.mobile #bookmarksTypeBar h5, #bookmarksBox.mobile .bookmarkList .addForm a{ @@ -530,10 +595,10 @@ #bookmarksBox.mobile .bookmarkList .bookmarkFolder.open .folderLabel > span > span{ display:block !important; } + /********************************************** DIALOG BOX **********************************************/ - /*---- Auto Drawer -----*/ #bkmrksAutoDrawer, #bkmrksAutoDrawer p, @@ -597,4 +662,4 @@ width:96%; height:120px; resize:vertical; -} +} \ No newline at end of file From 3f17320de9b035282cc548663af4f4ac92bc1b9e Mon Sep 17 00:00:00 2001 From: Giacinto Garcea Date: Mon, 3 Feb 2014 12:00:47 +0100 Subject: [PATCH 2/5] 'auto draw' support drawtools current color --- plugins/bookmarks-by-zaso.user.js | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/plugins/bookmarks-by-zaso.user.js b/plugins/bookmarks-by-zaso.user.js index 5363e5b2..a4997013 100644 --- a/plugins/bookmarks-by-zaso.user.js +++ b/plugins/bookmarks-by-zaso.user.js @@ -2,7 +2,7 @@ // @id iitc-plugin-bookmarks@ZasoGD // @name IITC plugin: Bookmarks for maps and portals // @category Controls -// @version 0.2.8.@@DATETIMEVERSION@@ +// @version 0.2.81.@@DATETIMEVERSION@@ // @namespace https://github.com/jonatkins/ingress-intel-total-conversion // @updateURL @@UPDATEURL@@ // @downloadURL @@DOWNLOADURL@@ @@ -555,17 +555,22 @@ window.plugin.bookmarks.optPaste = function() { var promptAction = prompt('Press CTRL+V to paste it.', ''); if(promptAction !== null && promptAction !== '') { - localStorage[window.plugin.bookmarks.KEY_STORAGE] = promptAction; - window.plugin.bookmarks.refreshBkmrks(); - window.runHooks('pluginBkmrksEdit', {"target": "all", "action": "import"}); - console.log('BOOKMARKS: reset and imported bookmarks'); - window.plugin.bookmarks.optAlert('Successful. '); + try { + localStorage[window.plugin.bookmarks.KEY_STORAGE] = promptAction; + window.plugin.bookmarks.refreshBkmrks(); + window.runHooks('pluginBkmrksEdit', {"target": "all", "action": "import"}); + console.log('BOOKMARKS: reset and imported bookmarks'); + window.plugin.bookmarks.optAlert('Successful. '); + } catch(e) { + console.warn('BOOKMARKS: failed to import data: '+e); + window.plugin.bookmarks.optAlert('Import failed '); + } } } window.plugin.bookmarks.optReset = function() { - var promptAction = prompt('All bookmarks will be deleted. Are you sure? [Y/N]', ''); - if(promptAction !== null && (promptAction === 'Y' || promptAction === 'y')) { + var promptAction = confirm('All bookmarks will be deleted. Are you sure?', ''); + if(promptAction) { delete localStorage[window.plugin.bookmarks.KEY_STORAGE]; window.plugin.bookmarks.createStorage(); window.plugin.bookmarks.loadStorage(); @@ -625,6 +630,8 @@ if(latlngs.length >= 2 && latlngs.length <= 3) { // TODO: add an API to draw-tools rather than assuming things about it's internals var newItem; + window.plugin.drawTools.setOptions(); + if(latlngs.length == 2) { newItem = L.geodesicPolyline(latlngs, window.plugin.drawTools.lineOptions); } else { From 53d04c70a59e20b85d107892266915b08dbb41d3 Mon Sep 17 00:00:00 2001 From: Giacinto Garcea Date: Thu, 6 Feb 2014 10:08:16 +0100 Subject: [PATCH 3/5] Fixed number version --- plugins/bookmarks-by-zaso.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/bookmarks-by-zaso.user.js b/plugins/bookmarks-by-zaso.user.js index a4997013..cbdd7a2a 100644 --- a/plugins/bookmarks-by-zaso.user.js +++ b/plugins/bookmarks-by-zaso.user.js @@ -2,7 +2,7 @@ // @id iitc-plugin-bookmarks@ZasoGD // @name IITC plugin: Bookmarks for maps and portals // @category Controls -// @version 0.2.81.@@DATETIMEVERSION@@ +// @version 0.2.8.@@DATETIMEVERSION@@ // @namespace https://github.com/jonatkins/ingress-intel-total-conversion // @updateURL @@UPDATEURL@@ // @downloadURL @@DOWNLOADURL@@ From 24dbeaca9aa84ab4ac887b5fdb208f88816e6c3b Mon Sep 17 00:00:00 2001 From: Giacinto Garcea Date: Thu, 6 Feb 2014 19:56:56 +0100 Subject: [PATCH 4/5] Fixed problem with jQuery UI sortable - jQuery UI sortable drag initiation is slow when container has hidden items; - removed old code to open/close BookmarksBox in IITCm; --- plugins/bookmarks-by-zaso.user.js | 16 +++++----------- plugins/bookmarks-css.css | 13 +++++++------ 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/plugins/bookmarks-by-zaso.user.js b/plugins/bookmarks-by-zaso.user.js index cbdd7a2a..f880efba 100644 --- a/plugins/bookmarks-by-zaso.user.js +++ b/plugins/bookmarks-by-zaso.user.js @@ -151,18 +151,11 @@ } if(newStatus === 1) { - $('#bookmarksBox').show(); - $('#bkmrksTrigger').hide(); + $('#bookmarksBox').css('height', 'auto'); + $('#bkmrksTrigger').css('height', '0'); } else { - $('#bookmarksBox').hide(); - $('#bkmrksTrigger').show(); - } - - if(window.plugin.bookmarks.isSmart) { - var button = $('#bkmrksTrigger'); - button.toggleClass('open'); - if(button.hasClass('open')) { button.text('[-] Bookmarks'); } - else{ button.text('[+] Bookmarks'); } + $('#bkmrksTrigger').css('height', '64px'); + $('#bookmarksBox').css('height', '0'); } window.plugin.bookmarks.statusBox['show'] = newStatus; @@ -919,6 +912,7 @@ +'+ Folder' +'
' +'' + +'
' +''; plugin.bookmarks.htmlDisabledMessage = '
Plugin Bookmarks disabled*.
'; diff --git a/plugins/bookmarks-css.css b/plugins/bookmarks-css.css index 30334150..2ad998d7 100644 --- a/plugins/bookmarks-css.css +++ b/plugins/bookmarks-css.css @@ -15,12 +15,14 @@ } #bookmarksBox{ - display:block; + display:block !important; position:absolute !important; z-index:4001; top:100px; left:100px; width:231px; + height:auto; + overflow:hidden; } #bookmarksBox .addForm, #bookmarksBox #bookmarksTypeBar, @@ -40,7 +42,6 @@ float:left !important; } #bookmarksBox .handle{ -/* text-indent:-20px;*/ width:80%; text-align:center; color:#fff; @@ -213,7 +214,7 @@ #bookmarksBox ul .bookmarkFolder{ border-top-width:1px; } -#bookmarksBox, + #bookmarksBox #topBar, #bookmarksBox #bookmarksTypeBar, #bookmarksBox .addForm, @@ -242,13 +243,15 @@ border-left-width:0; } #bkmrksTrigger{ - display:none; + display:block !important; position:absolute; + overflow:hidden; top:0; left:277px; width:47px; margin-top:-36px; height:64px; + height:0; cursor:pointer; z-index:2999; background-position:center bottom; @@ -483,7 +486,6 @@ #bookmarksBox.mobile .bookmarkList li.bookmarkFolder a.bookmarksAnchor, #bookmarksBox.mobile .bookmarkList li.bkmrk a.bookmarksLink{ text-indent:10px; -/* width:85%;*/ height:36px; line-height:24px; overflow:hidden; @@ -493,7 +495,6 @@ } #bookmarksBox.mobile .bookmarkList > ul{ border-bottom:1px solid #20a8b1 !important; -/* border-right:1px solid #20a8b1 !important;*/ } #bookmarksBox.mobile .bookmarkList .bookmarkFolder.othersBookmarks ul{ From daf75dbf7210a80cdc5aecdbf3fb9e6ac020d69b Mon Sep 17 00:00:00 2001 From: Giacinto Garcea Date: Thu, 6 Feb 2014 20:21:16 +0100 Subject: [PATCH 5/5] Fixed css for mobile version The Bookmarks Panel not closed. Now work. --- plugins/bookmarks-css.css | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/bookmarks-css.css b/plugins/bookmarks-css.css index 2ad998d7..a8630974 100644 --- a/plugins/bookmarks-css.css +++ b/plugins/bookmarks-css.css @@ -15,7 +15,7 @@ } #bookmarksBox{ - display:block !important; + display:block; position:absolute !important; z-index:4001; top:100px; @@ -421,7 +421,8 @@ margin: 0 !important; padding: 0 !important; border: 0 !important; - background: transparent !important;; + background: transparent !important; + overflow:auto !important; } #bookmarksBox.mobile .bookmarkList ul, #bookmarksBox.mobile .bookmarkList ul li,