updated bookmarks plugin, as submitted by the author with stylesheet fixes

(some non-standard indentation at the moment though)
This commit is contained in:
Jon Atkins 2013-06-07 17:49:10 +01:00
parent 508c2543f4
commit ffbf82a44e
2 changed files with 637 additions and 633 deletions

View File

@ -1,5 +1,8 @@
#bookmarksBox *{ #bookmarksBox *{
display:block; display:block;
padding:0;
margin:0;
width:auto; width:auto;
height:auto; height:auto;
font-family:Verdana, Geneva, sans-serif; font-family:Verdana, Geneva, sans-serif;
@ -7,10 +10,9 @@
line-height:22px; line-height:22px;
text-indent:0; text-indent:0;
text-decoration:none; text-decoration:none;
margin: 0;
padding: 0;
} }
#bookmarksBox{ #bookmarksBox{
margin-top:-100%; margin-top:-100%;
position:absolute !important; position:absolute !important;
@ -18,22 +20,24 @@
top:100px; top:100px;
left:100px; left:100px;
} }
#bookmarksBox .addForm,
#bookmarksBox .addForm,#bookmarksBox #bookmarksTypeBar,#bookmarksBox h5 { #bookmarksBox #bookmarksTypeBar,
#bookmarksBox h5{
height:28px; height:28px;
overflow:hidden; overflow:hidden;
color:#fff; color:#fff;
font-size:14px; font-size:14px;
} }
#bookmarksBox #topBar,#bookmarksBox #topBar * {
#bookmarksBox #topBar,
#bookmarksBox #topBar *{
height:15px !important; height:15px !important;
} }
#bookmarksBox #topBar *{ #bookmarksBox #topBar *{
float:left !important; float:left !important;
} }
#bookmarksBox .handle{ #bookmarksBox .handle{
text-indent:-20px; text-indent:-20px;
width:209px; width:209px;
@ -49,16 +53,14 @@
cursor:pointer; cursor:pointer;
color:#20a8b1; color:#20a8b1;
} }
#bookmarksBox #topBar #bookmarksMin{ #bookmarksBox #topBar #bookmarksMin{
font-weight: 700; font-weight:bold;
text-align:center; text-align:center;
line-height:14px; line-height:14px;
font-size:18px; font-size:18px;
} }
#bookmarksBox #topBar #bookmarksMin:hover{ #bookmarksBox #topBar #bookmarksMin:hover{
color: #FFD700; color:gold;
} }
#bookmarksBox #bookmarksTypeBar{ #bookmarksBox #bookmarksTypeBar{
@ -66,28 +68,35 @@
} }
#bookmarksBox h5{ #bookmarksBox h5{
padding:4px 0;
width:114px; width:114px;
text-align:center; text-align:center;
color:#788; color:#788;
padding: 4px 0;
} }
#bookmarksBox h5.current{ #bookmarksBox h5.current{
cursor:default; cursor:default;
background: 0; background:none;
color:#fff !important; color:#fff !important;
} }
#bookmarksBox h5:hover{ #bookmarksBox h5:hover{
color: #FFD700; color:gold;
background:rgba(0,0,0,0); background:rgba(0,0,0,0);
} }
#bookmarksBox #topBar .btn,#bookmarksBox .addForm,#bookmarksBox .handle,#bookmarksBox #bookmarksTypeBar,#bookmarksBox .bookmarkList li.bookmarksEmpty,#bookmarksBox .bookmarkList li.bkmrk a,#bookmarksBox .bookmarkList li.bkmrk: hover { #bookmarksBox #topBar .btn,
#bookmarksBox .addForm,
#bookmarksBox .handle,
#bookmarksBox #bookmarksTypeBar,
#bookmarksBox .bookmarkList li.bookmarksEmpty,
#bookmarksBox .bookmarkList li.bkmrk a,
#bookmarksBox .bookmarkList li.bkmrk:hover{
background-color:rgba(8,48,78,.85); background-color:rgba(8,48,78,.85);
} }
#bookmarksBox h5,#bookmarksBox .bookmarkList li.bkmrk: hover .bookmarksLink,#bookmarksBox .addForm * { #bookmarksBox h5,
#bookmarksBox .bookmarkList li.bkmrk:hover .bookmarksLink,
#bookmarksBox .addForm *{
background:rgba(0,0,0,.3); background:rgba(0,0,0,.3);
} }
@ -108,7 +117,7 @@
} }
#bookmarksBox .addForm a:hover{ #bookmarksBox .addForm a:hover{
background: #FFD700; background:gold;
color:#000; color:#000;
text-decoration:none; text-decoration:none;
} }
@ -118,6 +127,7 @@
color:#ffce00; color:#ffce00;
width:81px; width:81px;
line-height:11px; line-height:11px;
font-size:12px;
-webkit-box-sizing:content-box; -webkit-box-sizing:content-box;
-moz-box-sizing:content-box; -moz-box-sizing:content-box;
box-sizing:content-box; box-sizing:content-box;
@ -127,7 +137,8 @@
width:147px; width:147px;
} }
#bookmarksBox .addForm input: hover,#bookmarksBox .addForm input: focus { #bookmarksBox .addForm input:hover,
#bookmarksBox .addForm input:focus{
outline:0; outline:0;
background:rgba(0,0,0,.6); background:rgba(0,0,0,.6);
} }
@ -145,68 +156,71 @@
background:rgba(8,48,78,.55); background:rgba(8,48,78,.55);
box-shadow:inset 1px 0 0 #20a8b1; box-shadow:inset 1px 0 0 #20a8b1;
} }
#bookmarksBox .ui-sortable-helper{
#bookmarksBox .bookmarkList { border-top-width:1px;
display: none;
} }
#bookmarksBox h5,#bookmarksBox .addForm *,#bookmarksBox ul li.bkmrk,#bookmarksBox ul li.bkmrk a { #bookmarksBox .bookmarkList{ display:none; }
#bookmarksBox .bookmarkList.current{ display:block; }
#bookmarksBox h5,
#bookmarksBox .addForm *,
#bookmarksBox ul li.bkmrk,
#bookmarksBox ul li.bkmrk a{
height:22px; height:22px;
} }
#bookmarksBox h5,#bookmarksBox ul li.bkmrk a { #bookmarksBox h5,
#bookmarksBox ul li.bkmrk a{
overflow:hidden; overflow:hidden;
cursor:pointer; cursor:pointer;
float:left; float:left;
} }
#bookmarksBox ul .bookmarksEmpty{ text-indent:27px; color:#eee; }
#bookmarksBox ul .bookmarksRemoveFrom{ width:19px; text-align:center; color:#fff; }
#bookmarksBox ul .bookmarksLink{ width:171px; padding:0 10px 0 8px; color:gold; }
#bookmarksBox ul .bookmarksLink.selected{ color:#03fe03; }
#bookmarksBox ul .othersBookmarks .bookmarksLink{ width:190px; }
#bookmarksBox ul .bookmarksEmpty { #bookmarksBox ul .bookmarksLink:hover{ color:#03fe03; }
text-indent: 27px; #bookmarksBox ul .bookmarksRemoveFrom:hover{ color:#fff; background:#e22; }
color: #eee;
}
#bookmarksBox ul .bookmarksRemoveFrom { /************************************/
width: 19px;
text-align: center;
color: #fff;
}
#bookmarksBox ul .bookmarksLink { #bookmarksBox,
width: 171px; #bookmarksBox *
color: #FFD700; { border-color:#20a8b1; border-style:solid; border-width:0; }
padding: 0 10px 0 8px;
}
#bookmarksBox ul .othersBookmarks .bookmarksLink { #bookmarksBox #topBar
width: 190px; , #bookmarksBox ul .bookmarkFolder
} { border-top-width:1px; }
#bookmarksBox ul .bookmarksRemoveFrom: hover { #bookmarksBox #topBar
color: #fff; , #bookmarksBox #bookmarksTypeBar
background: #e22; , #bookmarksBox .addForm
} , #bookmarksBox ul .bookmarkFolder .folderLabel
, #bookmarksBox ul li.bkmrk
{ border-bottom-width:1px; }
#bookmarksBox,#bookmarksBox * { #bookmarksBox ul .bookmarkFolder
border-color: #20a8b1; , #bookmarksBox ul .bookmarksRemoveFrom
border-style: solid; { border-right-width:1px; border-left-width:1px; }
border-width: 0;
}
#bookmarksBox #topBar,#bookmarksBox #bookmarksTypeBar,#bookmarksBox .addForm,#bookmarksBox ul .bookmarkFolder .folderLabel,#bookmarksBox ul li.bkmrk { #bookmarksBox #topBar *
border-bottom-width: 1px; , #bookmarksBox #bookmarksTypeBar *
} , #bookmarksBox .addForm *
{ border-left-width:1px; }
#bookmarksBox #topBar *,#bookmarksBox #bookmarksTypeBar *,#bookmarksBox .addForm * { #bookmarksBox #topBar
border-left-width: 1px; , #bookmarksBox #bookmarksTypeBar
} , #bookmarksBox .addForm
{ border-right-width:1px; }
#bookmarksBox #topBar,#bookmarksBox #bookmarksTypeBar,#bookmarksBox .addForm { #bookmarksBox ul .othersBookmarks .bookmarksRemoveFrom
border-right-width: 1px; , #bookmarksBox ul .bookmarkFolder .folderLabel .bookmarksRemoveFrom
} { border-left-width:0px; }
#bookmarksBox ul .othersBookmarks .bookmarksRemoveFrom,#bookmarksBox ul .bookmarkFolder .folderLabel .bookmarksRemoveFrom { /************************************/
border-left-width: 0;
}
#bookmarksShow{ #bookmarksShow{
display:block; display:block;
@ -214,18 +228,18 @@
top:0; top:0;
left:250px; left:250px;
width:47px; width:47px;
margin-top: -100%; margin-top:-36px;
height:64px; height:64px;
cursor:pointer; cursor:pointer;
z-index:4005; z-index:4005;
background-position:center bottom; background-position:center bottom;
background-repeat:no-repeat; background-repeat:no-repeat;
transition:margin-top 100ms ease-in-out; transition:margin-top 100ms ease-in-out;
background-image:url(@@INCLUDEIMAGE:plugins/bookmarks-by-zaso-logo.png@@); background-image:url(@@INCLUDEIMAGE:plugins/bookmarks-by-zaso-logo.png@@);
} }
#bookmarksShow:hover{ #bookmarksShow:hover{
margin-top: 0!important; margin-top:0px !important;
} }
#bookmarkStar{ #bookmarkStar{
@ -240,8 +254,8 @@
background-position:left center; background-position:left center;
background-repeat:no-repeat; background-repeat:no-repeat;
} }
#bookmarkStar:hover,
#bookmarkStar: hover,#bookmarkStar.favorite { #bookmarkStar.favorite{
background-position:right center; background-position:right center;
} }
@ -249,10 +263,12 @@
cursor:s-resize; cursor:s-resize;
width:3px; width:3px;
right:3px; right:3px;
background: #FFD700; background:gold;
opacity:.7; opacity:.7;
} }
/************************************/
#bookmarksBox .bookmarkList .bookmarkFolder{ #bookmarksBox .bookmarkList .bookmarkFolder{
overflow:hidden; overflow:hidden;
margin-top:-1px; margin-top:-1px;
@ -265,73 +281,87 @@
background:rgba(8,58,78,.9); background:rgba(8,58,78,.9);
} }
#bookmarksBox .bookmarkList .bkmrk.ui-sortable-helper{
border-right-width:1px;
border-left-width:1px;
}
#bookmarksBox .bookmarkList ul li ul li.sortable-placeholder{ #bookmarksBox .bookmarkList ul li ul li.sortable-placeholder{
height:23px; height:23px;
box-shadow:inset 0 -1px 0 #20a8b1, inset 1px 0 0 #20a8b1; 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 { #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; box-shadow:inset 0 -1px 0 #20a8b1;
} }
#bookmarksBox .bookmarkList .bookmarkFolder .folderLabel .bookmarksAnchor span,#bookmarksBox .bookmarkList .bookmarkFolder .folderLabel>span,#bookmarksBox .bookmarkList .bookmarkFolder .folderLabel>span>span,#bookmarksBox .bookmarkList .triangle { #bookmarksBox .bookmarkList .bookmarkFolder .folderLabel .bookmarksAnchor span,
width: 0; #bookmarksBox .bookmarkList .bookmarkFolder .folderLabel > span,
height: 0; #bookmarksBox .bookmarkList .bookmarkFolder .folderLabel > span > span,
#bookmarksBox .bookmarkList .triangle{
width:0px;
height:0px;
} }
/************************************/
#bookmarksBox .bookmarkList .bookmarkFolder .folderLabel{ #bookmarksBox .bookmarkList .bookmarkFolder .folderLabel{
overflow:visible; overflow:visible;
height:25px; height:25px;
cursor:pointer; cursor:pointer;
background:#069; background:#069;
text-indent: 0; text-indent:0px;
} }
#bookmarksBox .bookmarkList .bookmarkFolder .folderLabel > *{ #bookmarksBox .bookmarkList .bookmarkFolder .folderLabel > *{
height:25px; height:25px;
float:left; float:left;
} }
#bookmarksBox .bookmarkList .bookmarkFolder .folderLabel .bookmarksAnchor{ #bookmarksBox .bookmarkList .bookmarkFolder .folderLabel .bookmarksAnchor{
line-height:25px; line-height:25px;
color:#fff; color:#fff;
width:209px; width:209px;
} }
#bookmarksBox .bookmarkList .bookmarkFolder .folderLabel .bookmarksAnchor span{ #bookmarksBox .bookmarkList .bookmarkFolder .folderLabel .bookmarksAnchor span{
float:left; float:left;
border-color: transparent transparent transparent #FFF;
border-width:5px 0 5px 7px; border-width:5px 0 5px 7px;
border-color:transparent transparent transparent white;
margin:7px 7px 0 6px; margin:7px 7px 0 6px;
} }
#bookmarksBox .bookmarkList .bookmarkFolder.active .folderLabel .bookmarksAnchor span{ #bookmarksBox .bookmarkList .bookmarkFolder.active .folderLabel .bookmarksAnchor span{
border-color: #FFF transparent transparent; margin:9px 5px 0 5px;
border-width: 7px 5px 0; border-width:7px 5px 0 5px;
margin: 9px 5px 0; border-color:white transparent transparent transparent;
} }
#bookmarksBox .bookmarkList .bookmarkFolder .folderLabel>span,#bookmarksBox .bookmarkList .bookmarkFolder .folderLabel>span>span { /************************************************************************************************************/
#bookmarksBox .bookmarkList .bookmarkFolder .folderLabel > span,
#bookmarksBox .bookmarkList .bookmarkFolder .folderLabel > span > span{
display:none; display:none;
border-width:0px 12px 10px 0;
border-color:transparent #20a8b1 transparent transparent;
margin:-20px 0 0;
position:relative; position:relative;
top:21px; top:21px;
left:219px; left:219px;
border-color: transparent #20a8b1 transparent transparent;
border-width: 0 12px 10px 0;
margin: -20px 0 0;
} }
#bookmarksBox .bookmarkList .bookmarkFolder .folderLabel > span > span{ #bookmarksBox .bookmarkList .bookmarkFolder .folderLabel > span > span{
top:18px; top:18px;
left: 0; left:0px;
border-width:0px 10px 9px 0;
border-color:transparent #069 transparent transparent; border-color:transparent #069 transparent transparent;
border-width: 0 10px 9px 0;
} }
#bookmarksBox .bookmarkList .bookmarkFolder.active .folderLabel > span,
#bookmarksBox .bookmarkList .bookmarkFolder.active .folderLabel > span > span{
display:block;
}
#bookmarksBox .bookmarkList .bookmarkFolder.active .folderLabel:hover > span > span{ #bookmarksBox .bookmarkList .bookmarkFolder.active .folderLabel:hover > span > span{
border-color:transparent #036 transparent transparent; border-color:transparent #036 transparent transparent;
} }
/************************************************************************************************************/
#bookmarksBox .bookmarkList .bookmarkFolder .folderLabel:hover .bookmarksAnchor{ #bookmarksBox .bookmarkList .bookmarkFolder .folderLabel:hover .bookmarksAnchor{
background:#036; background:#036;
} }
@ -340,7 +370,6 @@
display:none; display:none;
margin-left:19px; margin-left:19px;
} }
#bookmarksBox .bookmarkList .bookmarkFolder.active ul{ #bookmarksBox .bookmarkList .bookmarkFolder.active ul{
display:block; display:block;
min-height:22px; min-height:22px;
@ -349,20 +378,3 @@
#bookmarksBox .bookmarkFolder.othersBookmarks ul{ #bookmarksBox .bookmarkFolder.othersBookmarks ul{
margin-left:0; margin-left:0;
} }
#bookmarksBox .ui-sortable-helper,#bookmarksBox #topBar,#bookmarksBox ul .bookmarkFolder {
border-top-width: 1px;
}
#bookmarksBox .bookmarkList.current,#bookmarksBox .bookmarkList .bookmarkFolder.active .folderLabel>span,#bookmarksBox .bookmarkList .bookmarkFolder.active .folderLabel>span>span {
display: block;
}
#bookmarksBox ul .bookmarksLink.selected,#bookmarksBox ul .bookmarksLink: hover {
color: #03fe03;
}
#bookmarksBox ul .bookmarkFolder,#bookmarksBox ul .bookmarksRemoveFrom,#bookmarksBox .bookmarkList .bkmrk.ui-sortable-helper {
border-right-width: 1px;
border-left-width: 1px;
}

View File

@ -5,7 +5,7 @@
// @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@@
// @description [@@BUILDNAME@@-@@BUILDDATE@@] Save your favorite Maps and Portals. // @description [@@BUILDNAME@@-@@BUILDDATE@@] Save your favorite Maps and Portals and move the intelmap view in a second. The ingress world just a click.
// @include https://www.ingress.com/intel* // @include https://www.ingress.com/intel*
// @include http://www.ingress.com/intel* // @include http://www.ingress.com/intel*
// @match https://www.ingress.com/intel* // @match https://www.ingress.com/intel*
@ -16,10 +16,7 @@ function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded // ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function') window.plugin = function(){}; if(typeof window.plugin !== 'function') window.plugin = function(){};
// PLUGIN START //////////////////////////////////////////////////////// // PLUGIN START ////////////////////////////////////////////////////////
// use own namespace for plugin // use own namespace for plugin
window.plugin.bookmarks = function(){}; window.plugin.bookmarks = function(){};
@ -52,6 +49,8 @@ window.plugin.bookmarks.updateStarPortal = function() {
var list = plugin.bookmarks['bkmrk_portals']; var list = plugin.bookmarks['bkmrk_portals'];
$('#bookmarkStar').removeClass('favorite'); $('#bookmarkStar').removeClass('favorite');
$('.bkmrk a.bookmarksLink.selected').removeClass('selected'); $('.bkmrk a.bookmarksLink.selected').removeClass('selected');
//If current portal is into bookmarks: select bookmark portal from portals list and select the star in sideabar
for(var idFolders in list){ for(var idFolders in list){
for(var idBkmrk in list[idFolders]['bkmrk']){ for(var idBkmrk in list[idFolders]['bkmrk']){
var portalGuid = list[idFolders]['bkmrk'][idBkmrk]['guid']; var portalGuid = list[idFolders]['bkmrk'][idBkmrk]['guid'];
@ -65,6 +64,7 @@ window.plugin.bookmarks.updateStarPortal = function() {
window.plugin.bookmarks.switchStarPortal = function(){ window.plugin.bookmarks.switchStarPortal = function(){
var guid = window.selectedPortal; var guid = window.selectedPortal;
//Remove portal from bookmarks
if($('#bookmarkStar').hasClass('favorite')){ if($('#bookmarkStar').hasClass('favorite')){
var list = plugin.bookmarks['bkmrk_portals']; var list = plugin.bookmarks['bkmrk_portals'];
@ -78,6 +78,7 @@ window.plugin.bookmarks.switchStarPortal = function() {
} }
} }
} }
//Add portal into bookmarks
else{ else{
var linka = $('#portaldetails .linkdetails aside a:contains("Portal link")').attr('href'); var linka = $('#portaldetails .linkdetails aside a:contains("Portal link")').attr('href');
var namePortal = $('#portaldetails h3').text(); var namePortal = $('#portaldetails h3').text();
@ -87,7 +88,7 @@ window.plugin.bookmarks.switchStarPortal = function() {
var spac = linka.split('pll='); var spac = linka.split('pll=');
var latlng = spac[1] ; var latlng = spac[1] ;
plugin.bookmarks['bkmrk_portals'][plugin.bookmarks.KEY_OTHER_BKMRK]['bkmrk'][ID] = {"guid":guid,"latlng":latlng,"label":namePortal}; plugin.bookmarks['bkmrk_portals'][plugin.bookmarks.KEY_OTHER_BKMRK]['bkmrk'][ID] = {"guid":guid,"latlng":latlng,"label":namePortal};
$('#bkmrk_portals li.othersBookmarks ul').append('<li class="bkmrk" id="'+ID+'"><a class="bookmarksRemoveFrom" title="Remove from bookmarks">X</a><a class="bookmarksLink" onclick="window.zoomToAndShowPortal(\''+guid+'\', ['+latlng+']);return false;">'+namePortal+'</a></li>'); $('#bkmrk_portals li.othersBookmarks ul').append('<li class="bkmrk" id="'+ID+'"><a class="bookmarksRemoveFrom" title="Remove from bookmarks">X</a><a class="bookmarksLink selected" onclick="window.zoomToAndShowPortal(\''+guid+'\', ['+latlng+']);return false;">'+namePortal+'</a></li>');
} }
window.plugin.bookmarks.storeBookmarks('bkmrk_portals'); window.plugin.bookmarks.storeBookmarks('bkmrk_portals');
window.plugin.bookmarks.updateStarPortal(); window.plugin.bookmarks.updateStarPortal();
@ -255,13 +256,12 @@ window.plugin.bookmarks.loadList = function(typeList) {
/***************************************************************************************************************************************************************/ /***************************************************************************************************************************************************************/
window.plugin.bookmarks.setupJS = function() { window.plugin.bookmarks.setupJS = function(){$(document).ready(function(){
$(document).ready(function() {
//ENABLED THE DRAGGABLE PROPERTY OF THE BOX //ENABLED THE DRAGGABLE PROPERTY OF THE BOX
$('#bookmarksBox').draggable({ handle:'.handle', containment:'window' }); $('#bookmarksBox').draggable({ handle:'.handle', containment:'window' });
$("#bookmarksBox #bookmarksMin , #bookmarksBox ul li, #bookmarksBox ul li a, #bookmarksBox h5, #bookmarksBox .addForm a").disableSelection(); $("#bookmarksBox #bookmarksMin , #bookmarksBox ul li, #bookmarksBox ul li a, #bookmarksBox h5, #bookmarksBox .addForm a").disableSelection();
//SWICTH VISIBILITY OF THE BOX //SWICTH VISIBILITY PROPERTY OF THE BOX
$('#bookmarksMin').click(function(){ $('#bookmarksBox').animate({marginTop:'-100%'}, {duration:400, queue:false}); $('#bookmarksShow').animate({marginTop:-36}, {duration:400, queue:false}); localStorage[window.plugin.bookmarks['LOCAL_STORAGE_status_box']] = 0; }); $('#bookmarksMin').click(function(){ $('#bookmarksBox').animate({marginTop:'-100%'}, {duration:400, queue:false}); $('#bookmarksShow').animate({marginTop:-36}, {duration:400, queue:false}); localStorage[window.plugin.bookmarks['LOCAL_STORAGE_status_box']] = 0; });
$('#bookmarksShow').click(function(){ $('#bookmarksBox').animate({marginTop:0}, {duration:400, queue:false}); $('#bookmarksShow').animate({marginTop:-100}, {duration:400, queue:false}); localStorage[window.plugin.bookmarks['LOCAL_STORAGE_status_box']]= 1; }); $('#bookmarksShow').click(function(){ $('#bookmarksBox').animate({marginTop:0}, {duration:400, queue:false}); $('#bookmarksShow').animate({marginTop:-100}, {duration:400, queue:false}); localStorage[window.plugin.bookmarks['LOCAL_STORAGE_status_box']]= 1; });
if(localStorage[window.plugin.bookmarks['LOCAL_STORAGE_status_box']] == 1){ $('#bookmarksShow').trigger('click'); }else{ $('#bookmarksMin').trigger('click'); } if(localStorage[window.plugin.bookmarks['LOCAL_STORAGE_status_box']] == 1){ $('#bookmarksShow').trigger('click'); }else{ $('#bookmarksMin').trigger('click'); }
@ -273,13 +273,13 @@ window.plugin.bookmarks.setupJS = function() {
$('.bookmarkList > ul').enscroll({ showOnHover: true, verticalTrackClass: 'trackScroll', verticalHandleClass: 'handleScroll', minScrollbarLength:28 }); $('.bookmarkList > ul').enscroll({ showOnHover: true, verticalTrackClass: 'trackScroll', verticalHandleClass: 'handleScroll', minScrollbarLength:28 });
//ENABLED THE SORTABLE PROPERTY OF THE FOLDERS AND BOOKMARKS //ENABLED THE SORTABLE PROPERTY OF THE FOLDERS AND BOOKMARKS
$(".bookmarkList > ul").sortable({items:"li.bookmarkFolder:not(.othersBookmarks)",handle:".bookmarksAnchor",placeholder:"sortable-placeholder",forcePlaceholderSize:true, $(".bookmarkList > ul").sortable({items:"li.bookmarkFolder:not(.othersBookmarks)",handle:".bookmarksAnchor",distance:5,placeholder:"sortable-placeholder",forcePlaceholderSize:true,
update:function(event, ui){ update:function(event, ui){
var typeList = $('#'+ui.item.context.id).parent().parent('.bookmarkList').attr('id'); var typeList = $('#'+ui.item.context.id).parent().parent('.bookmarkList').attr('id');
window.plugin.bookmarks.sortBookmarksFolder(typeList); window.plugin.bookmarks.sortBookmarksFolder(typeList);
} }
}); });
$(".bookmarkList ul li ul").sortable({items:"li.bkmrk",connectWith:".bookmarkList ul ul",handle:".bookmarksLink",placeholder:"sortable-placeholder",forcePlaceholderSize:true, $(".bookmarkList ul li ul").sortable({items:"li.bkmrk",connectWith:".bookmarkList ul ul",handle:".bookmarksLink",distance:5,placeholder:"sortable-placeholder",forcePlaceholderSize:true,
update:function(event, ui){ update:function(event, ui){
var typeList = $('#'+ui.item.context.id).parent().parent().parent().parent('.bookmarkList').attr('id'); var typeList = $('#'+ui.item.context.id).parent().parent().parent().parent('.bookmarkList').attr('id');
window.plugin.bookmarks.sortBookmarks(typeList); window.plugin.bookmarks.sortBookmarks(typeList);
@ -314,7 +314,7 @@ window.plugin.bookmarks.setupJS = function() {
else{ window.plugin.bookmarks.addFolder(typeList); } else{ window.plugin.bookmarks.addFolder(typeList); }
//REFRESS SORTABLE EVENT FOR BKMRK //REFRESS SORTABLE EVENT FOR BKMRK
$(".bookmarkList ul li ul").sortable({items:"li.bkmrk",connectWith:".bookmarkList ul ul",handle:".bookmarksLink",placeholder:"sortable-placeholder",forcePlaceholderSize:true, $(".bookmarkList ul li ul").sortable({items:"li.bkmrk",connectWith:".bookmarkList ul ul",handle:".bookmarksLink",distance:5,placeholder:"sortable-placeholder",forcePlaceholderSize:true,
update:function(event, ui){ update:function(event, ui){
var typeList = $('#'+ui.item.context.id).parent().parent().parent().parent('.bookmarkList').attr('id'); var typeList = $('#'+ui.item.context.id).parent().parent().parent().parent('.bookmarkList').attr('id');
window.plugin.bookmarks.sortBookmarks(typeList); window.plugin.bookmarks.sortBookmarks(typeList);
@ -322,24 +322,22 @@ window.plugin.bookmarks.setupJS = function() {
}); });
e.preventDefault(); e.preventDefault();
}); });
}); });}
}
window.plugin.bookmarks.setupCSS = function(){ window.plugin.bookmarks.setupCSS = function(){
$("<style>").prop("type", "text/css") $('<style>').prop('type','text/css').html('@@INCLUDESTRING:plugins/bookmarks-by-zaso.css@@').appendTo('head');
.html("@@INCLUDESTRING:plugins/bookmarks-by-zaso.css@@").appendTo("head");
} }
window.plugin.bookmarks.setupContent = function(){ window.plugin.bookmarks.setupContent = function(){
plugin.bookmarks.contentStarHTML = '<a id="bookmarkStar" onclick="window.plugin.bookmarks.switchStarPortal();return false;" title="Save this portal in your bookmarks"><span></span></a>'; plugin.bookmarks.contentStarHTML = '<a id="bookmarkStar" onclick="window.plugin.bookmarks.switchStarPortal();return false;" title="Save this portal in your bookmarks"><span></span></a>';
plugin.bookmarks.disabledMessage = '<div class="notStorageSupport" title="Your browser do not support localStorage">Plugin Bookmarks disabled</div>'; plugin.bookmarks.disabledMessage = '<div class="notStorageSupport" title="Your browser do not support localStorage">Plugin Bookmarks disabled</div>';
plugin.bookmarks.bkmrkRibbon = '<a id="bookmarksShow"></a>';
plugin.bookmarks.bkmrkBox = '<div id="bookmarksBox">' plugin.bookmarks.bkmrkBox = '<div id="bookmarksBox">'
+'<div id="topBar"><a id="bookmarksMin" class="btn" title="Minimize">-</a><div class="handle">...</div></div>' +'<div id="topBar"><a id="bookmarksMin" class="btn" title="Minimize">-</a><div class="handle">...</div></div>'
+'<div id="bookmarksTypeBar"><h5 class="bkmrk_maps current">Maps</h5><h5 class="bkmrk_portals">Portals</h5></div>' +'<div id="bookmarksTypeBar"><h5 class="bkmrk_maps current">Maps</h5><h5 class="bkmrk_portals">Portals</h5></div>'
+'<div id="bkmrk_maps" class="bookmarkList current"><div class="addForm"><input placeholder="Insert label"><a class="newMap" onmouseover="setPermaLink(this);return false">+ Map</a><a class="newFolder">+ Folder</a></div><ul></ul></div>' +'<div id="bkmrk_maps" class="bookmarkList current"><div class="addForm"><input placeholder="Insert label"><a class="newMap" onmouseover="setPermaLink(this);return false">+ Map</a><a class="newFolder">+ Folder</a></div><ul></ul></div>'
+'<div id="bkmrk_portals" class="bookmarkList"><div class="addForm"><input placeholder="Insert label"><a class="newFolder">+ Folder</a></div><ul></ul></div>' +'<div id="bkmrk_portals" class="bookmarkList"><div class="addForm"><input placeholder="Insert label"><a class="newFolder">+ Folder</a></div><ul></ul></div>'
+'</div>'; +'</div>';
plugin.bookmarks.bkmrkRibbon = '<a id="bookmarksShow"></a>';
} }
/***************************************************************************************************************************************************************/ /***************************************************************************************************************************************************************/
@ -370,19 +368,13 @@ var setup = function() {
script2.appendChild(document.createTextNode('('+ wrapper +')();')); script2.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script2); (document.body || document.head || document.documentElement).appendChild(script2);
} }
// PLUGIN END ////////////////////////////////////////////////////////// // PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function'){ setup(); }
if(window.iitcLoaded && typeof setup === 'function') { else{ if(window.bootPlugins){ window.bootPlugins.push(setup); } else{ window.bootPlugins = [setup]; }}
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end } // wrapper end
// inject code into site context // inject code into site context
var script = document.createElement('script'); var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();')); script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script); (document.body || document.head || document.documentElement).appendChild(script);