Add macro code

This commit is contained in:
Peter Dietrich
2013-07-11 00:15:20 +02:00
95 changed files with 3089 additions and 2026 deletions

View File

@@ -1,6 +1,7 @@
// ==UserScript==
// @id iitc-plugin-ap-list@xelio
// @name IITC plugin: AP List
// @category Info
// @version 0.5.3.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
@@ -13,10 +14,7 @@
// @grant none
// ==/UserScript==
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function') window.plugin = function() {};
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
@@ -947,16 +945,4 @@ var setup = function() {
}
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
@@PLUGINEND@@

View File

@@ -1,6 +1,7 @@
// ==UserScript==
// @id iitc-plugin-basemap-blank@jonatkins
// @name IITC plugin: Blank map
// @category Map Tiles
// @version 0.1.0.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
@@ -13,10 +14,7 @@
// @grant none
// ==/UserScript==
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function') window.plugin = function() {};
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
@@ -36,16 +34,4 @@ var setup = window.plugin.mapTileBlank.addLayer;
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
@@PLUGINEND@@

View File

@@ -24,6 +24,7 @@
// ==UserScript==
// @id iitc-plugin-cloudmade-maps
// @name IITC plugin: CloudMade.com maps
// @category Map Tiles
// @version 0.0.1
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @description TEMPLATE PLUGIN - add back the CloudMade.com map layers. YOU WILL NEED TO EDIT THIS PLUGIN BEFORE IT WILL RUN
@@ -33,10 +34,7 @@
// @match http://www.ingress.com/intel*
// ==/UserScript==
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function') window.plugin = function() {};
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
@@ -87,16 +85,4 @@ var setup = window.plugin.mapTileCloudMade.setup;
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
@@PLUGINEND@@

View File

@@ -1,6 +1,7 @@
// ==UserScript==
// @id iitc-plugin-basemap-opencyclepam@jonatkins
// @name IITC plugin: OpenCycleMap.org map tiles
// @category Map Tiles
// @version 0.1.0.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
@@ -13,10 +14,7 @@
// @grant none
// ==/UserScript==
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function') window.plugin = function() {};
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
@@ -43,16 +41,4 @@ var setup = window.plugin.mapTileOpenCycleMap.addLayer;
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
@@PLUGINEND@@

View File

@@ -1,6 +1,7 @@
// ==UserScript==
// @id iitc-plugin-basemap-openstreetpam@jonatkins
// @name IITC plugin: OpenStreetMap.org map tiles
// @category Map Tiles
// @version 0.1.0.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
@@ -13,10 +14,7 @@
// @grant none
// ==/UserScript==
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function') window.plugin = function() {};
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
@@ -40,16 +38,4 @@ var setup = window.plugin.mapTileOpenStreetMap.addLayer;
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
@@PLUGINEND@@

View File

@@ -1,6 +1,7 @@
// ==UserScript==
// @id iitc-plugin-basemap-yandex@jonatkins
// @name IITC plugin: Yandex maps
// @category Map Tiles
// @version 0.1.0.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
@@ -13,10 +14,7 @@
// @grant none
// ==/UserScript==
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function') window.plugin = function() {};
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
@@ -61,16 +59,4 @@ var setup = window.plugin.mapTileYandex.setup;
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
@@PLUGINEND@@

View File

@@ -0,0 +1,324 @@
#bookmarksBox *{
display:block;
padding:0;
margin:0;
width:auto;
height:auto;
font-family:Verdana, Geneva, sans-serif;
font-size:13px;
line-height:22px;
text-indent:0;
text-decoration:none;
}
#bookmarksBox{
margin-top:-200%;
position:absolute !important;
z-index:4001;
top:100px;
left:100px;
}
#bookmarksBox .addForm, #bookmarksBox #bookmarksTypeBar, #bookmarksBox h5{
height:28px;
overflow:hidden;
color:#fff;
font-size:14px;
}
#bookmarksBox #topBar, #bookmarksBox #topBar *{
height:15px !important;
}
#bookmarksBox #topBar *{
float:left !important;
}
#bookmarksBox .handle{
text-indent:-20px;
width:209px;
text-align:center;
color:#fff;
line-height:8px;
cursor:move;
}
#bookmarksBox #topBar .btn{
display:block;
width:19px;
cursor:pointer;
color:#20a8b1;
}
#bookmarksBox #topBar #bookmarksMin{
font-weight:bold;
text-align:center;
line-height:14px;
font-size:18px;
}
#bookmarksBox #topBar #bookmarksMin:hover{
color:gold;
}
#bookmarksBox #bookmarksTypeBar{
clear:both;
}
#bookmarksBox h5{
padding:4px 0;
width:114px;
text-align:center;
color:#788;
}
#bookmarksBox h5.current{
cursor:default;
background:0;
color:#fff !important;
}
#bookmarksBox h5:hover{
color:gold;
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{
background-color:rgba(8,48,78,.85);
}
#bookmarksBox h5, #bookmarksBox .bookmarkList li.bkmrk:hover .bookmarksLink, #bookmarksBox .addForm *{
background:rgba(0,0,0,.3);
}
#bookmarksBox .addForm *{
display:block;
float:left;
padding:4px 8px 3px;
}
#bookmarksBox .addForm a{
cursor:pointer;
color:#20a8b1;
font-size:12px;
width:65px;
text-align:center;
line-height:20px;
padding:4px 0 3px;
}
#bookmarksBox .addForm a:hover{
background:gold;
color:#000;
text-decoration:none;
}
#bookmarksBox .addForm input{
font-size:11px !important;
color:#ffce00;
width:81px;
line-height:11px;
font-size:12px;
-webkit-box-sizing:content-box;
-moz-box-sizing:content-box;
box-sizing:content-box;
}
#bookmarksBox #bkmrk_portals .addForm input{
width:147px;
}
#bookmarksBox .addForm input:hover, #bookmarksBox .addForm input:focus{
outline:0;
background:rgba(0,0,0,.6);
}
#bookmarksBox .bookmarkList>ul{
width:231px;
clear:both;
list-style-type:none;
color:#fff;
overflow:hidden;
max-height:550px;
}
#bookmarksBox .sortable-placeholder{
background:rgba(8,48,78,.55);
box-shadow:inset 1px 0 0 #20a8b1;
}
#bookmarksBox .ui-sortable-helper{
border-top-width:1px;
}
#bookmarksBox .bookmarkList{
display:none;
}
#bookmarksBox .bookmarkList.current{
display:block;
}
#bookmarksBox h5, #bookmarksBox .addForm *, #bookmarksBox ul li.bkmrk, #bookmarksBox ul li.bkmrk a{
height:22px;
}
#bookmarksBox h5, #bookmarksBox ul li.bkmrk a{
overflow:hidden;
cursor:pointer;
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 .bookmarksLink:hover{
color:#03fe03;
}
#bookmarksBox ul .bookmarksRemoveFrom:hover{
color:#fff;
background:#e22;
}
#bookmarksBox, #bookmarksBox *{
border-color:#20a8b1;
border-style:solid;
border-width:0;
}
#bookmarksBox #topBar, #bookmarksBox ul .bookmarkFolder{
border-top-width:1px;
}
#bookmarksBox #topBar, #bookmarksBox #bookmarksTypeBar, #bookmarksBox .addForm, #bookmarksBox ul .bookmarkFolder .folderLabel, #bookmarksBox ul li.bkmrk{
border-bottom-width:1px;
}
#bookmarksBox ul .bookmarkFolder, #bookmarksBox ul .bookmarksRemoveFrom{
border-right-width:1px;
border-left-width:1px;
}
#bookmarksBox #topBar *, #bookmarksBox #bookmarksTypeBar *, #bookmarksBox .addForm *{
border-left-width:1px;
}
#bookmarksBox #topBar, #bookmarksBox #bookmarksTypeBar, #bookmarksBox .addForm{
border-right-width:1px;
}
#bookmarksBox ul .othersBookmarks .bookmarksRemoveFrom, #bookmarksBox ul .bookmarkFolder .folderLabel .bookmarksRemoveFrom{
border-left-width:0;
}
#bookmarksShow{
display:block;
position:absolute;
top:0;
left:250px;
width:47px;
margin-top:-36px;
height:64px;
cursor:pointer;
z-index:2999;
background-position:center bottom;
background-repeat:no-repeat;
transition:margin-top 100ms ease-in-out;
background-image:url(@@INCLUDEIMAGE:plugins/bookmarks-by-zaso-logo.png@@);
}
#bookmarksShow:hover{
margin-top:0 !important;
}
#sidebar #portaldetails h3.title{
width:auto;
}
#bookmarkStar{
display:inline-block;
float:left;
margin:3px 1px 0 4px;
width:16px;
height:15px;
overflow:hidden;
background-image:url(@@INCLUDEIMAGE:plugins/bookmarks-by-zaso-star.png@@);
background-position:left center;
background-repeat:no-repeat;
}
#bookmarkStar:hover, #bookmarkStar.favorite{
background-position:right center;
}
#bookmarksBox .handleScroll{
cursor:s-resize;
width:3px;
right:3px;
background:gold;
opacity:.7;
}
#bookmarksBox .bookmarkList .bookmarkFolder{
overflow:hidden;
margin-top:-1px;
height:auto;
background:rgba(8,58,78,.7);
}
#bookmarksBox .bookmarkList ul li.sortable-placeholder{
box-shadow:inset -1px 0 0 #20a8b1, inset 1px 0 0 #20a8b1, 0 -1px 0 #20a8b1;
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{
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 .bookmarkList .bookmarkFolder .folderLabel .bookmarksAnchor span, #bookmarksBox .bookmarkList .bookmarkFolder .folderLabel>span, #bookmarksBox .bookmarkList .bookmarkFolder .folderLabel>span>span, #bookmarksBox .bookmarkList .triangle{
width:0;
height:0;
}
#bookmarksBox .bookmarkList .bookmarkFolder .folderLabel{
overflow:visible;
height:25px;
cursor:pointer;
background:#069;
text-indent:0;
}
#bookmarksBox .bookmarkList .bookmarkFolder .folderLabel>*{
height:25px;
float:left;
}
#bookmarksBox .bookmarkList .bookmarkFolder .folderLabel .bookmarksAnchor{
line-height:25px;
color:#fff;
width:209px;
}
#bookmarksBox .bookmarkList .bookmarkFolder .folderLabel .bookmarksAnchor span{
float:left;
border-width:5px 0 5px 7px;
border-color:transparent transparent transparent white;
margin:7px 7px 0 6px;
}
#bookmarksBox .bookmarkList .bookmarkFolder.active .folderLabel .bookmarksAnchor span{
margin:9px 5px 0 5px;
border-width:7px 5px 0 5px;
border-color:white transparent transparent transparent;
}
#bookmarksBox .bookmarkList .bookmarkFolder .folderLabel>span, #bookmarksBox .bookmarkList .bookmarkFolder .folderLabel>span>span{
display:none;
border-width:0 12px 10px 0;
border-color:transparent #20a8b1 transparent transparent;
margin:-20px 0 0;
position:relative;
top:21px;
left:219px;
}
#bookmarksBox .bookmarkList .bookmarkFolder .folderLabel>span>span{
top:18px;
left:0;
border-width:0 10px 9px 0;
border-color:transparent #069 transparent transparent;
}
#bookmarksBox .bookmarkList .bookmarkFolder.active .folderLabel>span, #bookmarksBox .bookmarkList .bookmarkFolder.active .folderLabel>span>span{
display:block;
}
#bookmarksBox .bookmarkList .bookmarkFolder.active .folderLabel:hover>span>span{
border-color:transparent #036 transparent transparent;
}
#bookmarksBox .bookmarkList .bookmarkFolder .folderLabel:hover .bookmarksAnchor{
background:#036;
}
#bookmarksBox .bookmarkList .bookmarkFolder ul{
display:none;
margin-left:19px;
}
#bookmarksBox .bookmarkList .bookmarkFolder.active ul{
display:block;
min-height:22px;
}
#bookmarksBox .bookmarkFolder.othersBookmarks ul{
margin-left:0;
}
)

View File

@@ -0,0 +1,136 @@
#sidebar #bookmarksBox{
position:static !important;
width:auto !important;
margin:0 !important;
width:100%;
}
#sidebar #bookmarksBox .bookmarkList > ul > li, #sidebar #bookmarksBox .bookmarkList > ul > li > ul, #sidebar #bookmarksBox .bookmarkList > ul > li > ul > li{
width:100% !important;
}
#sidebar #bookmarksBox *{
box-shadow:none !important;
border-width:0 !important
}
#sidebar #bookmarksBox #topBar{
display:none !important;
}
#sidebar #bookmarksBox #bookmarksTypeBar h5{
cursor:pointer;
text-align:center;
float:left;
width:50%;
padding:7px 0;
}
#sidebar #bookmarksBox #bookmarksTypeBar h5.current{
cursor:default;
color:#fff;
}
#sidebar #bookmarksBox #bookmarksTypeBar, #sidebar #bookmarksBox .bookmarkList .addForm{
border-bottom:1px solid #20a8b1 !important;
}
#sidebar #bookmarksBox .bookmarkList ul li ul li.bkmrk{
height:36px !important;
clear:both;
}
#sidebar #bookmarksBox .bookmarkList li.bookmarkFolder .folderLabel{
height:36px;
}
#sidebar #bookmarksBox .bookmarkList li.bookmarkFolder .folderLabel a, #sidebar #bookmarksBox .bookmarkList ul li ul li.bkmrk a{
background:none;
padding:7px 0;
height:auto;
box-shadow:inset 0 1px 0 #20a8b1 !important;
}
#sidebar #bookmarksBox .bookmarkList li.bookmarkFolder a.bookmarksRemoveFrom, #sidebar #bookmarksBox .bookmarkList li.bkmrk a.bookmarksRemoveFrom{
box-shadow:inset 0 1px 0 #20a8b1, inset -1px 0 0 #20a8b1 !important;
width:15%;
}
#sidebar #bookmarksBox .bookmarkList li.bookmarkFolder a.bookmarksAnchor, #sidebar #bookmarksBox .bookmarkList li.bkmrk a.bookmarksLink{
text-indent:10px;
width:85%;
height:21px /*22*/;
overflow:hidden;
}
#sidebar #bookmarksBox .bookmarkList ul li.bookmarkFolder ul{
margin-left:0 !important;
}
#sidebar #bookmarksBox .bookmarkList ul, #bookmarksBox .bookmarkList ul li, #sidebar #bookmarksBox .bookmarkList ul li ul, #sidebar #bookmarksBox .bookmarkList ul li ul li{
display:block !important;
}
#sidebar #bookmarksBox .bookmarkList{
display:none !important;
}
#sidebar #bookmarksBox .bookmarkList > ul{
border-bottom:1px solid #20a8b1 !important;
border-right:1px solid #20a8b1 !important;
}
#sidebar #bookmarksBox .bookmarkList.current{
display:block !important;
}
#sidebar #bookmarksBox .bookmarkList .bookmarkFolder.othersBookmarks ul{
border-top:5px solid #20a8b1 !important;
}
#sidebar #bookmarksBox .bookmarkList li.bookmarkFolder, #sidebar #bookmarksBox .bookmarkList li.bkmrk{
box-shadow:inset 0 1px 0 #20a8b1, 1px 0 0 #20a8b1, -1px 1px 0 #20a8b1 !important;
}
#sidebar #bookmarksBox .bookmarkList li.bookmarkFolder .bkmrk.sortable-placeholder{
height:36px !important;
}
#sidebar #bookmarksBox .bookmarkList .sortable-placeholder{
box-shadow:inset 0 1px 0 #20a8b1 !important;
}
#sidebar #bookmarksBox .ui-sortable .ui-sortable-helper{
border-top:0;
width:85% !important;
}
#sidebar #bookmarksBox .bookmarkList > ul{
max-height:none;
width:85% !important;
}
#sidebar #bookmarksBox .bookmarkList li.bookmarkFolder .folderLabel{
box-shadow:0 1px 0 #20a8b1 !important;
}
#sidebar #bookmarksBox .bookmarkList ul li.bookmarkFolder ul{
width:85% !important;
margin-left:15% !important;
}
#sidebar #bookmarksBox .bookmarkList ul li.bookmarkFolder.othersBookmarks ul{
width:100% !important;
margin-left:0% !important;
}
#sidebar #bookmarksShowMobile{
text-decoration:none;
display:block !important;
padding:11px 0 9px;
text-align:center;
}
#sidebar #portaldetails{
margin-top:25px;
}
#sidebar #bookmarksBox #bookmarksTypeBar{
height:auto;
}
#sidebar #bookmarksBox .addForm, #sidebar #bookmarksBox .addForm *{
height:35px;
padding:0;
}
#sidebar #bookmarksBox .addForm a{
line-height:37px;
}
#sidebar #bookmarksBox .addForm a{
width:25% !important;
}
#sidebar #bookmarksBox .addForm input{
width:50% !important;
text-indent:10px;
}
#sidebar #bookmarksBox #bkmrk_portals .addForm input{
width:75% !important;
}
#sidebar #bookmarksBox #bookmarksTypeBar h5, #sidebar #bookmarksBox .bookmarkList .addForm a{
box-shadow:-1px 0 0 #20a8b1 !important;
}
#sidebar #bookmarksBox .bookmarkList li.bookmarkFolder ul{
display:block !important;
min-height:37px !important;
}

View File

@@ -1,368 +0,0 @@
#bookmarksBox * {
display: block;
width: auto;
height: auto;
font-family: Verdana,Geneva,sans-serif;
font-size: 13px;
line-height: 22px;
text-indent: 0;
text-decoration: none;
margin: 0;
padding: 0;
}
#bookmarksBox {
margin-top: -100%;
position: absolute!important;
z-index: 4001;
top: 100px;
left: 100px;
}
#bookmarksBox .addForm,#bookmarksBox #bookmarksTypeBar,#bookmarksBox h5 {
height: 28px;
overflow: hidden;
color: #fff;
font-size: 14px;
}
#bookmarksBox #topBar,#bookmarksBox #topBar * {
height: 15px!important;
}
#bookmarksBox #topBar * {
float: left!important;
}
#bookmarksBox .handle {
text-indent: -20px;
width: 209px;
text-align: center;
color: #fff;
line-height: 8px;
cursor: move;
}
#bookmarksBox #topBar .btn {
display: block;
width: 19px;
cursor: pointer;
color: #20a8b1;
}
#bookmarksBox #topBar #bookmarksMin {
font-weight: 700;
text-align: center;
line-height: 14px;
font-size: 18px;
}
#bookmarksBox #topBar #bookmarksMin: hover {
color: #FFD700;
}
#bookmarksBox #bookmarksTypeBar {
clear: both;
}
#bookmarksBox h5 {
width: 114px;
text-align: center;
color: #788;
padding: 4px 0;
}
#bookmarksBox h5.current {
cursor: default;
background: 0;
color: #fff!important;
}
#bookmarksBox h5: hover {
color: #FFD700;
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 {
background-color: rgba(8,48,78,.85);
}
#bookmarksBox h5,#bookmarksBox .bookmarkList li.bkmrk: hover .bookmarksLink,#bookmarksBox .addForm * {
background: rgba(0,0,0,.3);
}
#bookmarksBox .addForm * {
display: block;
float: left;
padding: 4px 8px 3px;
}
#bookmarksBox .addForm a {
cursor: pointer;
color: #20a8b1;
font-size: 12px;
width: 65px;
text-align: center;
line-height: 20px;
padding: 4px 0 3px;
}
#bookmarksBox .addForm a: hover {
background: #FFD700;
color: #000;
text-decoration: none;
}
#bookmarksBox .addForm input {
font-size: 11px!important;
color: #ffce00;
width: 81px;
line-height: 11px;
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
#bookmarksBox #bkmrk_portals .addForm input {
width: 147px;
}
#bookmarksBox .addForm input: hover,#bookmarksBox .addForm input: focus {
outline: 0;
background: rgba(0,0,0,.6);
}
#bookmarksBox .bookmarkList>ul {
width: 231px;
clear: both;
list-style-type: none;
color: #fff;
overflow: hidden;
max-height: 550px;
}
#bookmarksBox .sortable-placeholder {
background: rgba(8,48,78,.55);
box-shadow: inset 1px 0 0 #20a8b1;
}
#bookmarksBox .bookmarkList {
display: none;
}
#bookmarksBox h5,#bookmarksBox .addForm *,#bookmarksBox ul li.bkmrk,#bookmarksBox ul li.bkmrk a {
height: 22px;
}
#bookmarksBox h5,#bookmarksBox ul li.bkmrk a {
overflow: hidden;
cursor: pointer;
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;
color: #FFD700;
padding: 0 10px 0 8px;
}
#bookmarksBox ul .othersBookmarks .bookmarksLink {
width: 190px;
}
#bookmarksBox ul .bookmarksRemoveFrom: hover {
color: #fff;
background: #e22;
}
#bookmarksBox,#bookmarksBox * {
border-color: #20a8b1;
border-style: solid;
border-width: 0;
}
#bookmarksBox #topBar,#bookmarksBox #bookmarksTypeBar,#bookmarksBox .addForm,#bookmarksBox ul .bookmarkFolder .folderLabel,#bookmarksBox ul li.bkmrk {
border-bottom-width: 1px;
}
#bookmarksBox #topBar *,#bookmarksBox #bookmarksTypeBar *,#bookmarksBox .addForm * {
border-left-width: 1px;
}
#bookmarksBox #topBar,#bookmarksBox #bookmarksTypeBar,#bookmarksBox .addForm {
border-right-width: 1px;
}
#bookmarksBox ul .othersBookmarks .bookmarksRemoveFrom,#bookmarksBox ul .bookmarkFolder .folderLabel .bookmarksRemoveFrom {
border-left-width: 0;
}
#bookmarksShow {
display: block;
position: absolute;
top: 0;
left: 250px;
width: 47px;
margin-top: -100%;
height: 64px;
cursor: pointer;
z-index: 4005;
background-position: center bottom;
background-repeat: no-repeat;
transition: margin-top 100ms ease-in-out;
background-image: url(@@INCLUDEIMAGE:plugins/bookmarks-by-zaso-logo.png@@);
}
#bookmarksShow: hover {
margin-top: 0!important;
}
#bookmarkStar {
display: inline-block;
position: relative;
top: 1px;
margin-right: 3px;
width: 16px;
height: 15px;
overflow: hidden;
background-image: url(@@INCLUDEIMAGE:plugins/bookmarks-by-zaso-star.png@@);
background-position: left center;
background-repeat: no-repeat;
}
#bookmarkStar: hover,#bookmarkStar.favorite {
background-position: right center;
}
#bookmarksBox .handleScroll {
cursor: s-resize;
width: 3px;
right: 3px;
background: #FFD700;
opacity: .7;
}
#bookmarksBox .bookmarkList .bookmarkFolder {
overflow: hidden;
margin-top: -1px;
height: auto;
background: rgba(8,58,78,.7);
}
#bookmarksBox .bookmarkList ul li.sortable-placeholder {
box-shadow: inset -1px 0 0 #20a8b1,inset 1px 0 0 #20a8b1,0 -1px 0 #20a8b1;
background: rgba(8,58,78,.9);
}
#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 .bookmarkList .bookmarkFolder .folderLabel .bookmarksAnchor span,#bookmarksBox .bookmarkList .bookmarkFolder .folderLabel>span,#bookmarksBox .bookmarkList .bookmarkFolder .folderLabel>span>span,#bookmarksBox .bookmarkList .triangle {
width: 0;
height: 0;
}
#bookmarksBox .bookmarkList .bookmarkFolder .folderLabel {
overflow: visible;
height: 25px;
cursor: pointer;
background: #069;
text-indent: 0;
}
#bookmarksBox .bookmarkList .bookmarkFolder .folderLabel>* {
height: 25px;
float: left;
}
#bookmarksBox .bookmarkList .bookmarkFolder .folderLabel .bookmarksAnchor {
line-height: 25px;
color: #fff;
width: 209px;
}
#bookmarksBox .bookmarkList .bookmarkFolder .folderLabel .bookmarksAnchor span {
float: left;
border-color: transparent transparent transparent #FFF;
border-width: 5px 0 5px 7px;
margin: 7px 7px 0 6px;
}
#bookmarksBox .bookmarkList .bookmarkFolder.active .folderLabel .bookmarksAnchor span {
border-color: #FFF transparent transparent;
border-width: 7px 5px 0;
margin: 9px 5px 0;
}
#bookmarksBox .bookmarkList .bookmarkFolder .folderLabel>span,#bookmarksBox .bookmarkList .bookmarkFolder .folderLabel>span>span {
display: none;
position: relative;
top: 21px;
left: 219px;
border-color: transparent #20a8b1 transparent transparent;
border-width: 0 12px 10px 0;
margin: -20px 0 0;
}
#bookmarksBox .bookmarkList .bookmarkFolder .folderLabel>span>span {
top: 18px;
left: 0;
border-color: transparent #069 transparent transparent;
border-width: 0 10px 9px 0;
}
#bookmarksBox .bookmarkList .bookmarkFolder.active .folderLabel: hover>span>span {
border-color: transparent #036 transparent transparent;
}
#bookmarksBox .bookmarkList .bookmarkFolder .folderLabel: hover .bookmarksAnchor {
background: #036;
}
#bookmarksBox .bookmarkList .bookmarkFolder ul {
display: none;
margin-left: 19px;
}
#bookmarksBox .bookmarkList .bookmarkFolder.active ul {
display: block;
min-height: 22px;
}
#bookmarksBox .bookmarkFolder.othersBookmarks ul {
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

@@ -1,388 +1,534 @@
// ==UserScript==
// @id iitc-plugin-bookmarks@zaso
// @id iitc-plugin-bookmarks@ZasoGD
// @name IITC plugin: Bookmarks for maps and portals
// @version 0.1.3.@@DATETIMEVERSION@@
// @category Controls
// @version 0.1.55.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
// @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 http://www.ingress.com/intel*
// @match https://www.ingress.com/intel*
// @match http://www.ingress.com/intel*
// ==/UserScript==
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function') window.plugin = function() {};
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
// use own namespace for plugin
window.plugin.bookmarks = function() {};
window.plugin.bookmarks.bkmrk_portals = {};
window.plugin.bookmarks.bkmrk_maps = {};
// use own namespace for plugin
window.plugin.bookmarks = function() {};
window.plugin.bookmarks.disabledMessage;
window.plugin.bookmarks.contentStarHTML;
window.plugin.bookmarks.KEY_OTHER_BKMRK = 'idOthers';
window.plugin.bookmarks.LOCAL_STORAGE_status_box = 'plugin-bookmarks-status-box';
window.plugin.bookmarks.LOCAL_STORAGE_bkmrk_portals = 'plugin-bookmarks-portals-data';
window.plugin.bookmarks.LOCAL_STORAGE_bkmrk_maps = 'plugin-bookmarks-maps-data';
window.plugin.bookmarks.KEY_OTHER_BKMRK = 'idOthers';
window.plugin.bookmarks.LOCAL_STORAGE_status_box = 'plugin-bookmarks-status-box';
window.plugin.bookmarks.LOCAL_STORAGE_bkmrk_portals = 'plugin-bookmarks-portals-data';
window.plugin.bookmarks.LOCAL_STORAGE_bkmrk_maps = 'plugin-bookmarks-maps-data';
window.plugin.bookmarks.bkmrk_portals = {};
window.plugin.bookmarks.bkmrk_maps = {};
/*********************************************************************************************************************/
window.plugin.bookmarks.disabledMessage;
window.plugin.bookmarks.contentStarHTML;
window.plugin.bookmarks.bkmrkBox;
window.plugin.bookmarks.bkmrkRibbon;
window.plugin.bookmarks.loadList;
window.plugin.bookmarks.setupJS;
//---------------------------------------------------------------------------------------
// Append a 'star' flag in sidebar.
//---------------------------------------------------------------------------------------
window.plugin.bookmarks.addToSidebar = function(){
if(typeof(Storage) === "undefined"){ $('#portaldetails > .imgpreview').after(plugin.bookmarks.disabledMessage); return; }
$('#portaldetails > h3.title').before(plugin.bookmarks.contentStarHTML);
plugin.bookmarks.updateStarPortal();
}
//---------------------------------------------------------------------------------------
// Update the status of the star (when a portal is selected from the map/bookmarks-list)
//---------------------------------------------------------------------------------------
window.plugin.bookmarks.updateStarPortal = function(){
window.plugin.bookmarks.loadBookmarks('bkmrk_portals');
var guid = window.selectedPortal;
$('#bookmarkStar').removeClass('favorite');
$('.bkmrk a.bookmarksLink.selected').removeClass('selected');
//If current portal is into bookmarks: select bookmark portal from portals list and select the star
if(localStorage[window.plugin.bookmarks.LOCAL_STORAGE_bkmrk_portals].search(guid) != -1){
$('#bookmarkStar').addClass('favorite');
var list = plugin.bookmarks['bkmrk_portals'];
for(var idFolders in list){
for(var idBkmrk in list[idFolders]['bkmrk']){
var portalGuid = list[idFolders]['bkmrk'][idBkmrk]['guid'];
if(guid == portalGuid){
$('.bkmrk#'+idBkmrk+' a.bookmarksLink').addClass('selected');
}
}
}
}
}
//---------------------------------------------------------------------------------------
// Switch the status of the star
//---------------------------------------------------------------------------------------
window.plugin.bookmarks.switchStarPortal = function(){
var guid = window.selectedPortal;
//If portal is saved in bookmarks: Remove this bookmark
if($('#bookmarkStar').hasClass('favorite')){
var list = plugin.bookmarks['bkmrk_portals'];
for(var idFolders in list){
for(var idBkmrk in list[idFolders]['bkmrk']){
var portalGuid = list[idFolders]['bkmrk'][idBkmrk]['guid'];
if(guid == portalGuid){
delete list[idFolders]['bkmrk'][idBkmrk];
$('.bkmrk#'+idBkmrk+'').remove();
}
}
}
}
//If portal isn't saved in bookmarks: Add this bookmark
else{
// Get the bookmark data (name, coordinates, portal id) from the portal link
var linka = $('#portaldetails .linkdetails aside a:contains("Portal link")').attr('href');
var namePortal = $('#portaldetails h3').text();
var ID = window.plugin.bookmarks.generateID();
var spac = linka.split('pll=');
var latlng = spac[1] ;
// Add bookmark in the localStorage
plugin.bookmarks['bkmrk_portals'][plugin.bookmarks.KEY_OTHER_BKMRK]['bkmrk'][ID] = {"guid":guid,"latlng":latlng,"label":namePortal};
//Append the new bookmark to the map list
$('#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.updateStarPortal();
}
//---------------------------------------------------------------------------------------
// Save a bookmark map
//---------------------------------------------------------------------------------------
window.plugin.bookmarks.addBookmarkMap = function(elem){
// Get the coordinates and zoom level from the permalink
var mapLink = $(elem).attr('href');
var pars = new RegExp('[\\?&amp;]ll=([^&amp;#]*)[&amp;]z=([^&amp;#]*)').exec(mapLink);
var res = pars[1].split(',');
res[2] = pars[2];
var latlng = res[0]+','+res[1];
var zoom = res[2];
var ID = window.plugin.bookmarks.generateID();
//Get the label | Convert some characters | Set the input (empty)
var nameMap = $(elem).siblings('input').val();
nameMap = nameMap.replace(/\//g, '&#47;').replace(/\\/g, '&#92;').replace(/"/g, '&#34;').replace(/"/g, '&#39;');
$(elem).siblings('input').val('');
// Add bookmark in the localStorage
plugin.bookmarks['bkmrk_maps'][plugin.bookmarks.KEY_OTHER_BKMRK]['bkmrk'][ID] = {"label":nameMap,"latlng":latlng,"z":parseInt(zoom)};
plugin.bookmarks.storeBookmarks('bkmrk_maps');
//Append the new bookmark to the map list
if(nameMap==''){ nameMap = latlng+' ['+zoom+']'; }
$('#bkmrk_maps li.othersBookmarks ul').append('<li class="bkmrk" id="'+ID+'"><a class="bookmarksRemoveFrom" title="Remove from bookmarks">X</a><a class="bookmarksLink" onclick="map.setView(['+latlng+'], '+zoom+');return false;">'+nameMap+'</a></li>');
}
/*********************************************************************************************************************/
//---------------------------------------------------------------------------------------
// Generate an ID for the bookmark (date time + random number)
//---------------------------------------------------------------------------------------
window.plugin.bookmarks.generateID = function(){
var d = new Date();
var ID = d.getTime()+(Math.floor(Math.random()*99)+1);
var ID = 'id'+ID.toString();
return ID;
}
//---------------------------------------------------------------------------------------
// Switch the status folder to open/close (in the localStorage)
//---------------------------------------------------------------------------------------
window.plugin.bookmarks.openFolder = function(elem){
var typeList = $(elem).parent().parent().parent().parent('div').attr('id');
var ID = $(elem).parent().parent('li').attr('id');
var newFlag;
var flag = plugin.bookmarks[typeList][ID]['state'];
if(flag){ newFlag = 0; }
else if(!flag){ newFlag = 1; }
window.plugin.bookmarks[typeList][ID]['state'] = newFlag;
window.plugin.bookmarks.storeBookmarks(typeList);
}
//---------------------------------------------------------------------------------------
// Switch the status folder to open/close (in the localStorage)
//---------------------------------------------------------------------------------------
window.plugin.bookmarks.addFolder = function(typeList){
var ID = window.plugin.bookmarks.generateID();
var input = '#'+typeList+' .addForm input';
//Get the label | Convert some characters | Set the input (empty)
var nameFolder = $(input).val();
nameFolder = nameFolder.replace(/\//g, '&#47;').replace(/\\/g, '&#92;').replace(/"/g, '&#34;').replace(/"/g, '&#39;');
if(nameFolder == ''){ nameFolder = 'Folder'; }
$(input).val('');
// Add new folder in the localStorage
plugin.bookmarks[typeList][ID] = {"label":nameFolder,"state":1,"bkmrk":{}};
plugin.bookmarks.storeBookmarks(typeList);
//Append the new folder to the list
$('#'+typeList+' li.othersBookmarks').before('<li class="bookmarkFolder active" id="'+ID+'"><span class="folderLabel"><a class="bookmarksRemoveFrom">X</a><a class="bookmarksAnchor"><span></span>'+nameFolder+'</a><span><span></span></span></span><ul></ul></li>');
}
//---------------------------------------------------------------------------------------
// Remove the bookmark (from the localStorage)
//---------------------------------------------------------------------------------------
window.plugin.bookmarks.deletBookmark = function(elem){
var typeList = $(elem).parent().parent().parent().parent().parent('div').attr('id');
var ID = $(elem).parent('li').attr('id');
var IDfold = $(elem).parent().parent().parent('li').attr('id');
delete window.plugin.bookmarks[typeList][IDfold]['bkmrk'][ID];
window.plugin.bookmarks.storeBookmarks(typeList);
if(typeList == 'bkmrk_portals'){ window.plugin.bookmarks.updateStarPortal(); }
}
//---------------------------------------------------------------------------------------
// Remove the folder (from the localStorage)
//---------------------------------------------------------------------------------------
window.plugin.bookmarks.deletFolder = function(elem){
var typeList = $(elem).parent().parent().parent().parent('div').attr('id');
var ID = $(elem).parent().parent('li').attr('id');
delete plugin.bookmarks[typeList][ID];
window.plugin.bookmarks.storeBookmarks(typeList);
if(typeList == 'bkmrk_portals'){ window.plugin.bookmarks.updateStarPortal(); }
}
//---------------------------------------------------------------------------------------
// Saved the new sort of the folders (in the localStorage)
//---------------------------------------------------------------------------------------
window.plugin.bookmarks.sortBookmarksFolder = function(typeList){
window.plugin.bookmarks.loadBookmarks(typeList);
var newArr = {};
$('#'+typeList+' li.bookmarkFolder').each(function(){
var idFold = $(this).attr('id');
newArr[idFold] = window.plugin.bookmarks[typeList][idFold];
});
window.plugin.bookmarks[typeList] = newArr;
window.plugin.bookmarks.storeBookmarks(typeList);
}
//---------------------------------------------------------------------------------------
// Saved the new sort of the bookmarks (in the localStorage)
//---------------------------------------------------------------------------------------
window.plugin.bookmarks.sortBookmarks = function(typeList){
window.plugin.bookmarks.loadBookmarks(typeList);
var list = window.plugin.bookmarks[typeList];
var newArr = {};
$('#'+typeList+' li.bookmarkFolder').each(function(){
var idFold = $(this).attr('id');
newArr[idFold] = window.plugin.bookmarks[typeList][idFold];
newArr[idFold].bkmrk = {};
});
$('#'+typeList+' li.bkmrk').each(function(){
window.plugin.bookmarks.loadBookmarks(typeList);
var idFold = $(this).parent().parent('li').attr('id');
var id = $(this).attr('id');
var list = window.plugin.bookmarks[typeList];
for(var idFoldersOrigin in list){
for(var idBkmrk in list[idFoldersOrigin]['bkmrk']){
if(idBkmrk == id){
newArr[idFold].bkmrk[id] = window.plugin.bookmarks[typeList][idFoldersOrigin].bkmrk[id];
}
}
}
});
window.plugin.bookmarks[typeList] = newArr;
window.plugin.bookmarks.storeBookmarks(typeList);
}
//---------------------------------------------------------------------------------------
// Update the localStorage
//---------------------------------------------------------------------------------------
window.plugin.bookmarks.storeBookmarks = function(typeList){
var bookmarksObject = {};
bookmarksObject[typeList] = plugin.bookmarks[typeList];
var bookmarksObjectJSON = JSON.stringify(bookmarksObject);
localStorage[plugin.bookmarks['LOCAL_STORAGE_'+typeList]] = bookmarksObjectJSON;
}
//---------------------------------------------------------------------------------------
// Load the localStorage
//---------------------------------------------------------------------------------------
window.plugin.bookmarks.loadBookmarks = function(typeList){
var bookmarksObjectJSON = localStorage[plugin.bookmarks['LOCAL_STORAGE_'+typeList]];
if(!bookmarksObjectJSON) return;
var bookmarksObject = JSON.parse(bookmarksObjectJSON);
plugin.bookmarks[typeList] = bookmarksObject[typeList];
}
//---------------------------------------------------------------------------------------
// Load the bookmarks
//---------------------------------------------------------------------------------------
window.plugin.bookmarks.loadList = function(typeList){
window.plugin.bookmarks.loadBookmarks(typeList);
var element = '';
var elementTemp = '';
var elementExc = '';
// For each folder
var list = window.plugin.bookmarks[typeList];
for(var idFolders in list){
var folders = list[idFolders];
var active = '';
// Create a label and a anchor for the sortable
var folderLabel = '<span class="folderLabel"><a class="bookmarksRemoveFrom" title="Remove this folder">X</a>';
folderLabel += '<a class="bookmarksAnchor"><span></span>'+folders['label']+'</a><span><span></span></span></span>';
if(folders['state']){ active = ' active'; }
if(idFolders == window.plugin.bookmarks.KEY_OTHER_BKMRK){
folderLabel = ''; active= ' othersBookmarks active';
}
// Create a folder
elementTemp = '<li class="bookmarkFolder'+active+'" id="'+idFolders+'">'+folderLabel+'<ul>';
// For each bookmark
var fold = folders['bkmrk'];
for(var idBkmrk in fold){
var btn_link;
var btn_remove = '<a class="bookmarksRemoveFrom" title="Remove from bookmarks">X</a>';
var bkmrk = fold[idBkmrk];
var label = bkmrk['label'];
var latlng = bkmrk['latlng'];
// If it's a map
if(typeList == 'bkmrk_maps'){
if(bkmrk['label']==''){ label = bkmrk['latlng']+' ['+bkmrk['z']+']'; }
btn_link = '<a class="bookmarksLink" onclick="map.setView(['+latlng+'], '+bkmrk['z']+');return false;">'+label+'</a>';
}
// If it's a portal
else if(typeList == 'bkmrk_portals'){
var guid = bkmrk['guid'];
var btn_link = '<a class="bookmarksLink" onclick="window.zoomToAndShowPortal(\''+guid+'\', ['+latlng+']);return false;">'+label+'</a>';
}
// Create the bookmark
elementTemp += '<li class="bkmrk" id="'+idBkmrk+'">'+btn_remove+btn_link+'</li>';
}
elementTemp += '</li></ul>';
//Add folder 'Others' in last position
if(idFolders != window.plugin.bookmarks.KEY_OTHER_BKMRK){ element += elementTemp; }
else{ elementExc = elementTemp; }
}
element += elementExc;
// Append all folders and bookmarks
$('#'+typeList+' ul').html(element);
}
/*********************************************************************************************************************/
//---------------------------------------------------------------------------------------
// Append the stylesheet
//---------------------------------------------------------------------------------------
window.plugin.bookmarks.setupCSS = function(){
$('<style>').prop('type', 'text/css').html('@@INCLUDESTRING:plugins/bookmarks-by-zaso-css-desktop.css@@').appendTo('head');
}
//---------------------------------------------------------------------------------------
// Append the stylesheet for mobile app
//---------------------------------------------------------------------------------------
window.plugin.bookmarks.setupCSS_mobile = function(){
$('<style>').prop('type', 'text/css').html('@@INCLUDESTRING:plugins/bookmarks-by-zaso-css-mobile.css@@').appendTo('head');
}
//---------------------------------------------------------------------------------------
// Append the js script
//---------------------------------------------------------------------------------------
window.plugin.bookmarks.setupJS = function(){$(document).ready(function(){
//ENABLED THE DRAGGABLE PROPERTY OF THE BOX
$('#bookmarksBox').draggable({ handle:'.handle', containment:'window' });
$("#bookmarksBox #bookmarksMin , #bookmarksBox ul li, #bookmarksBox ul li a, #bookmarksBox h5, #bookmarksBox .addForm a").disableSelection();
//SWICTH VISIBILITY PROPERTY OF THE BOX
$('#bookmarksMin').click(function(){
$('#bookmarksBox').animate({marginTop:'-200%'}, {duration:600, 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:600, 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'); }
//SWITCH LIST (MAPS/PORTALS)
$('#bookmarksBox h5').click(function(){
$('h5').removeClass('current');
$(this).addClass('current');
var sectList = '#'+$(this).attr('class').replace(' current', '');
$('#bookmarksBox .bookmarkList').removeClass('current');
$(sectList).addClass('current');
});
if(!window.isSmartphone()){
//DESTOP: active vertical scroll-bar on the long lists
$('.bookmarkList > ul').enscroll({ showOnHover: true, verticalTrackClass: 'trackScroll', verticalHandleClass: 'handleScroll', minScrollbarLength:28 });
//OPEN/CLOSE FOLDER (to be corrected in mobile mode)---------------
$('#bookmarksBox').on('click', '.bookmarksAnchor', function(e){
window.plugin.bookmarks.openFolder(this);
$(this).parent().parent('li').toggleClass('active');
e.preventDefault();
});
}
//ENABLED THE SORTABLE PROPERTY OF THE FOLDERS AND BOOKMARKS
$(".bookmarkList > ul").sortable({
items:"li.bookmarkFolder:not(.othersBookmarks)",
handle:".bookmarksAnchor",
placeholder:"sortable-placeholder",
forcePlaceholderSize:true,
helper:'clone',
distance:5,
update:function(event, ui){
var typeList = $('#'+ui.item.context.id).parent().parent('.bookmarkList').attr('id');
window.plugin.bookmarks.sortBookmarksFolder(typeList);
}
});
$(".bookmarkList ul li ul").sortable({
items:"li.bkmrk",
connectWith:".bookmarkList ul ul",
handle:".bookmarksLink",
placeholder:"sortable-placeholder",
forcePlaceholderSize:true,
helper:'clone',
distance:5,
update:function(event, ui){
var typeList = $('#'+ui.item.context.id).parent().parent().parent().parent('.bookmarkList').attr('id');
window.plugin.bookmarks.sortBookmarks(typeList);
}
});
//ADD BOOKMARK/FOLDER
$('#bookmarksBox .addForm a').click(function(e){
var typeList = $(this).parent().parent('div').attr('id');
if($(this).hasClass('newMap')){ window.plugin.bookmarks.addBookmarkMap(this); }
else{ window.plugin.bookmarks.addFolder(typeList); }
//REFRESS SORTABLE EVENT FOR BKMRK
$(".bookmarkList ul li ul").sortable({
items:"li.bkmrk",
connectWith:".bookmarkList ul ul",
handle:".bookmarksLink",
placeholder:"sortable-placeholder",
forcePlaceholderSize:true,
helper:'clone',
distance:5,
update:function(event, ui){
var typeList = $('#'+ui.item.context.id).parent().parent().parent().parent('.bookmarkList').attr('id');
window.plugin.bookmarks.sortBookmarks(typeList);
}
});
if(window.isSmartphone()){
// The clone not working in mobile mode (to be corrected)---------------
$(".bookmarkList ul li ul").sortable("option", "helper", "original");
};
e.preventDefault();
});
//REMOVE FOLDER
$('.bookmarkList').on('click', '.folderLabel .bookmarksRemoveFrom', function(e){
window.plugin.bookmarks.deletFolder(this);
$(this).parent().parent('li').remove();
e.preventDefault();
});
//REMOVE BOOKMARK
$('.bookmarkList').on('click', '.bkmrk .bookmarksRemoveFrom', function(e){
window.plugin.bookmarks.deletBookmark(this);
$(this).parent('li').remove();
e.preventDefault();
});
if(window.isSmartphone()){
//FOR MOBILE
// The clone not working in mobile mode (to be corrected)---------------
$(".bookmarkList > ul").sortable("option", "helper", "original");
$(".bookmarkList ul li ul").sortable("option", "helper", "original");
//Show/Hide the box
$('#bookmarksBox').hide();
$('#bookmarksShowMobile').click(function(){
$(this).toggleClass('open');
$('#bookmarksBox').toggle();
if($(this).hasClass('open')){ $(this).text('[-] Bookmarks'); }
else{ $(this).text('[+] Bookmarks'); }
});
//Return to map when a bookmark is clicked
$('.bookmarkList').on('click', '.bkmrk .bookmarksLink', function(){
window.show("map");
});
}
});}
//---------------------------------------------------------------------------------------
// HTML element
//---------------------------------------------------------------------------------------
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.disabledMessage = '<div title="Your browser do not support localStorage">Plugin Bookmarks disabled</div>';
plugin.bookmarks.bkmrkRibbon = '<a id="bookmarksShow"></a>';
plugin.bookmarks.bkmrkBox = '<div id="bookmarksBox">'
+'<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 style="clear:both !important;"></div></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>';
plugin.bookmarks.bkmrkTriggerMobile= '<a id="bookmarksShowMobile">[+] Bookmarks</a>';
}
/***************************************************************************************************************************************************************/
window.plugin.bookmarks.addStarToSidebar = function() {
if(typeof(Storage) === "undefined") { $('#portaldetails > .imgpreview').after(plugin.bookmarks.disabledMessage); return; }
var title = $('#portaldetails > h3').text();
$('#portaldetails > h3').html(plugin.bookmarks.contentStarHTML+title);
plugin.bookmarks.updateStarPortal();
}
window.plugin.bookmarks.updateStarPortal = function() {
window.plugin.bookmarks.loadBookmarks('bkmrk_portals');
var guid = window.selectedPortal;
var list = plugin.bookmarks['bkmrk_portals'];
$('#bookmarkStar').removeClass('favorite');
$('.bkmrk a.bookmarksLink.selected').removeClass('selected');
for(var idFolders in list) {
for(var idBkmrk in list[idFolders]['bkmrk']) {
var portalGuid = list[idFolders]['bkmrk'][idBkmrk]['guid'];
if(guid == portalGuid) {
$('#bookmarkStar').addClass('favorite');
$('.bkmrk#'+idBkmrk+' a.bookmarksLink').addClass('selected');
}
}
}
}
window.plugin.bookmarks.switchStarPortal = function() {
var guid = window.selectedPortal;
var setup = function(){
//Set the localStorage (if not exist)
if(!localStorage[window.plugin.bookmarks['LOCAL_STORAGE_bkmrk_portals']]){localStorage[plugin.bookmarks['LOCAL_STORAGE_bkmrk_portals']] = '{"bkmrk_portals":{"'+window.plugin.bookmarks.KEY_OTHER_BKMRK+'":{"label":"Others","state":1,"bkmrk":{}}}}'; }
if(!localStorage[window.plugin.bookmarks['LOCAL_STORAGE_bkmrk_maps']]){localStorage[plugin.bookmarks['LOCAL_STORAGE_bkmrk_maps']] = '{"bkmrk_maps":{"'+window.plugin.bookmarks.KEY_OTHER_BKMRK+'":{"label":"Others","state":1,"bkmrk":{}}}}'; }
if(!localStorage[window.plugin.bookmarks['LOCAL_STORAGE_status_box']]){localStorage[plugin.bookmarks['LOCAL_STORAGE_status_box']] = 1;}
if($('#bookmarkStar').hasClass('favorite')) {
var list = plugin.bookmarks['bkmrk_portals'];
//Load data from localStorage
window.plugin.bookmarks.loadBookmarks('bkmrk_portals');
window.plugin.bookmarks.loadBookmarks('bkmrk_maps');
for(var idFolders in list) {
for(var idBkmrk in list[idFolders]['bkmrk']) {
var portalGuid = list[idFolders]['bkmrk'][idBkmrk]['guid'];
if(guid == portalGuid) {
delete list[idFolders]['bkmrk'][idBkmrk];
$('.bkmrk#'+idBkmrk+'').remove();
}
}
}
}
else {
var linka = $('#portaldetails .linkdetails aside a:contains("Portal link")').attr('href');
var namePortal = $('#portaldetails h3').text();
if(window.isSmartphone()){
//FOR MOBILE: load the script for the touch events
var script2 = document.createElement('script');
script2.type = 'text/javascript';
script2.src = 'https://raw.github.com/furf/jquery-ui-touch-punch/master/jquery.ui.touch-punch.min.js';
script2.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script2);
}else{
//FOR DESKTOP: load the script to active the vertical scrollbar (in the bookmarks box)
var script3 = document.createElement('script');
script3.type = 'text/javascript';
script3.src = 'http://enscrollplugin.com/releases/enscroll-0.4.0.min.js';
script3.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script3);
}
var ID = window.plugin.bookmarks.generateID();
if($.inArray('pluginBookmarksUpdate', window.VALID_HOOKS) < 0){ window.VALID_HOOKS.push('pluginBookmarksUpdate'); }
var spac = linka.split('pll=');
var latlng = spac[1] ;
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>');
}
window.plugin.bookmarks.storeBookmarks('bkmrk_portals');
window.plugin.bookmarks.updateStarPortal();
}
window.plugin.bookmarks.addBookmarkMap = function(elem) {
var mapLink = $(elem).attr('href');
var pars = new RegExp('[\\?&amp;]ll=([^&amp;#]*)[&amp;]z=([^&amp;#]*)').exec(mapLink);
var res = pars[1].split(',');
res[2] = pars[2];
var latlng = res[0]+','+res[1];
var zoom = res[2];
window.plugin.bookmarks.setupCSS();
if(window.isSmartphone()){window.plugin.bookmarks.setupCSS_mobile();}
window.plugin.bookmarks.setupContent();
var ID = window.plugin.bookmarks.generateID();
//Append the bookmarks box
if(!window.isSmartphone()){ $('body').append(plugin.bookmarks.bkmrkRibbon+plugin.bookmarks.bkmrkBox); }
else{ $('#portaldetails').before(plugin.bookmarks.bkmrkTriggerMobile+plugin.bookmarks.bkmrkBox); }
var nameMap = $(elem).siblings('input').val();
nameMap = nameMap.replace(/\//g, '&#47;').replace(/\\/g, '&#92;').replace(/"/g, '&#34;').replace(/"/g, '&#39;');
//Load bookmarks and folders in the box
window.plugin.bookmarks.loadList('bkmrk_maps');
window.plugin.bookmarks.loadList('bkmrk_portals');
if(nameMap == '') { nameMap = ''; }
$(elem).siblings('input').val('');
plugin.bookmarks['bkmrk_maps'][plugin.bookmarks.KEY_OTHER_BKMRK]['bkmrk'][ID] = {"label":nameMap,"latlng":latlng,"z":parseInt(zoom)};
plugin.bookmarks.storeBookmarks('bkmrk_maps');
if(nameMap=='') { nameMap = latlng+' ['+zoom+']'; }
$('#bkmrk_maps li.othersBookmarks ul').append('<li class="bkmrk" id="'+ID+'"><a class="bookmarksRemoveFrom" title="Remove from bookmarks">X</a><a class="bookmarksLink" onclick="map.setView(['+latlng+'], '+zoom+');return false;">'+nameMap+'</a></li>');
}
/***************************************************************************************************************************************************************/
window.plugin.bookmarks.generateID = function() {
var d = new Date();
var ID = d.getTime()+(Math.floor(Math.random()*99)+1);
var ID = 'id'+ID.toString();
return ID;
}
window.plugin.bookmarks.openFolder = function(elem) {
var typeList = $(elem).parent().parent().parent().parent('div').attr('id');
var ID = $(elem).parent().parent('li').attr('id');
var newFlag;
var flag = plugin.bookmarks[typeList][ID]['state'];
if(flag) { newFlag = 0; }
else if(!flag) { newFlag = 1; }
window.plugin.bookmarks[typeList][ID]['state'] = newFlag;
window.plugin.bookmarks.storeBookmarks(typeList);
}
window.plugin.bookmarks.addFolder = function(typeList) {
var ID = window.plugin.bookmarks.generateID();
var input = '#'+typeList+' .addForm input';
var nameFolder = $(input).val();
nameFolder = nameFolder.replace(/\//g, '&#47;').replace(/\\/g, '&#92;').replace(/"/g, '&#34;').replace(/"/g, '&#39;');
if(nameFolder == '') { nameFolder = 'Folder'; }
$(input).val('');
plugin.bookmarks[typeList][ID] = {"label":nameFolder,"state":0,"bkmrk":{}};
plugin.bookmarks.storeBookmarks(typeList);
$('#'+typeList+' li.othersBookmarks').before('<li class="bookmarkFolder" id="'+ID+'"><span class="folderLabel"><a class="bookmarksRemoveFrom">X</a><a class="bookmarksAnchor"><span></span>'+nameFolder+'</a><span><span></span></span></span><ul></ul></li>');
}
window.plugin.bookmarks.deletBookmark = function(elem) {
var typeList = $(elem).parent().parent().parent().parent().parent('div').attr('id');
var ID = $(elem).parent('li').attr('id');
var IDfold = $(elem).parent().parent().parent('li').attr('id');
delete window.plugin.bookmarks[typeList][IDfold]['bkmrk'][ID];
window.plugin.bookmarks.storeBookmarks(typeList);
if(typeList == 'bkmrk_portals') { window.plugin.bookmarks.updateStarPortal(); }
}
window.plugin.bookmarks.deletFolder = function(elem) {
var typeList = $(elem).parent().parent().parent().parent('div').attr('id');
var ID = $(elem).parent().parent('li').attr('id');
delete plugin.bookmarks[typeList][ID];
window.plugin.bookmarks.storeBookmarks(typeList);
if(typeList == 'bkmrk_portals') { window.plugin.bookmarks.updateStarPortal(); }
}
window.plugin.bookmarks.sortBookmarksFolder = function(typeList) {
window.plugin.bookmarks.loadBookmarks(typeList);
var newArr = {};
$('#'+typeList+' li.bookmarkFolder').each(function() {
var idFold = $(this).attr('id');
newArr[idFold] = window.plugin.bookmarks[typeList][idFold];
});
window.plugin.bookmarks[typeList] = newArr;
window.plugin.bookmarks.storeBookmarks(typeList);
}
window.plugin.bookmarks.sortBookmarks = function(typeList) {
window.plugin.bookmarks.loadBookmarks(typeList);
var list = window.plugin.bookmarks[typeList];
var newArr = {};
$('#'+typeList+' li.bookmarkFolder').each(function() {
var idFold = $(this).attr('id');
newArr[idFold] = window.plugin.bookmarks[typeList][idFold];
newArr[idFold].bkmrk = {};
});
$('#'+typeList+' li.bkmrk').each(function() {
window.plugin.bookmarks.loadBookmarks(typeList);
var idFold = $(this).parent().parent('li').attr('id');
var id = $(this).attr('id');
var list = window.plugin.bookmarks[typeList];
for(var idFoldersOrigin in list) {
for(var idBkmrk in list[idFoldersOrigin]['bkmrk']) {
if(idBkmrk == id) {
newArr[idFold].bkmrk[id] = window.plugin.bookmarks[typeList][idFoldersOrigin].bkmrk[id];
}
}
}
});
window.plugin.bookmarks[typeList] = newArr;
window.plugin.bookmarks.storeBookmarks(typeList);
}
window.plugin.bookmarks.storeBookmarks = function(typeList) {
var bookmarksObject = {};
bookmarksObject[typeList] = plugin.bookmarks[typeList];
var bookmarksObjectJSON = JSON.stringify(bookmarksObject);
localStorage[plugin.bookmarks['LOCAL_STORAGE_'+typeList]] = bookmarksObjectJSON;
}
window.plugin.bookmarks.loadBookmarks = function(typeList) {
var bookmarksObjectJSON = localStorage[plugin.bookmarks['LOCAL_STORAGE_'+typeList]];
if(!bookmarksObjectJSON) return;
var bookmarksObject = JSON.parse(bookmarksObjectJSON);
plugin.bookmarks[typeList] = bookmarksObject[typeList];
}
window.plugin.bookmarks.loadList = function(typeList) {
window.plugin.bookmarks.loadBookmarks(typeList);
var element = '';
var list = window.plugin.bookmarks[typeList];
for(var idFolders in list) {
var folders = list[idFolders];
var active = '';
var folderLabel = '<span class="folderLabel"><a class="bookmarksRemoveFrom" title="Remove this folder">X</a>';
folderLabel += '<a class="bookmarksAnchor"><span></span>'+folders['label']+'</a><span><span></span></span></span>';
if(folders['state']) { active = ' active'; }
if(idFolders == window.plugin.bookmarks.KEY_OTHER_BKMRK) { folderLabel = ''; active= ' othersBookmarks active' }
element += '<li class="bookmarkFolder'+active+'" id="'+idFolders+'">'+folderLabel+'<ul>';
var fold = folders['bkmrk'];
for(var idBkmrk in fold) {
var btn_link;
var btn_remove = '<a class="bookmarksRemoveFrom" title="Remove from bookmarks">X</a>';
var bkmrk = fold[idBkmrk];
var label = bkmrk['label'];
var latlng = bkmrk['latlng'];
if(typeList == 'bkmrk_maps') {
if(bkmrk['label']=='') { label = bkmrk['latlng']+' ['+bkmrk['z']+']'; }
btn_link = '<a class="bookmarksLink" onclick="map.setView(['+latlng+'], '+bkmrk['z']+');return false;">'+label+'</a>';
}
else if(typeList == 'bkmrk_portals') {
var guid = bkmrk['guid'];
var btn_link = '<a class="bookmarksLink" onclick="window.zoomToAndShowPortal(\''+guid+'\', ['+latlng+']);return false;">'+label+'</a>';
}
element += '<li class="bkmrk" id="'+idBkmrk+'">'+btn_remove+btn_link+'</li>';
}
element += '</li></ul>';
}
$('#'+typeList+' ul').html(element);
}
/***************************************************************************************************************************************************************/
window.plugin.bookmarks.setupJS = function() {
$(document).ready(function() {
//ENABLED THE DRAGGABLE PROPERTY OF THE BOX
$('#bookmarksBox').draggable({ handle:'.handle', containment:'window' });
$("#bookmarksBox #bookmarksMin , #bookmarksBox ul li, #bookmarksBox ul li a, #bookmarksBox h5, #bookmarksBox .addForm a").disableSelection();
//SWICTH VISIBILITY 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; });
$('#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'); }
//SWITCH LIST (MAPS/PORTALS)
$('#bookmarksBox h5').click(function() {$('h5').removeClass('current');$(this).addClass('current');var sectList = '#'+$(this).attr('class').replace(' current', '');$('#bookmarksBox .bookmarkList').removeClass('current');$(sectList).addClass('current');});
//ACTIVE VERTICAL SCROLL-BAR ON THE LONG LISTS
$('.bookmarkList > ul').enscroll({ showOnHover: true, verticalTrackClass: 'trackScroll', verticalHandleClass: 'handleScroll', minScrollbarLength:28 });
//ENABLED THE SORTABLE PROPERTY OF THE FOLDERS AND BOOKMARKS
$(".bookmarkList > ul").sortable({items:"li.bookmarkFolder:not(.othersBookmarks)",handle:".bookmarksAnchor",placeholder:"sortable-placeholder",forcePlaceholderSize:true,
update:function(event, ui) {
var typeList = $('#'+ui.item.context.id).parent().parent('.bookmarkList').attr('id');
window.plugin.bookmarks.sortBookmarksFolder(typeList);
}
});
$(".bookmarkList ul li ul").sortable({items:"li.bkmrk",connectWith:".bookmarkList ul ul",handle:".bookmarksLink",placeholder:"sortable-placeholder",forcePlaceholderSize:true,
update:function(event, ui) {
var typeList = $('#'+ui.item.context.id).parent().parent().parent().parent('.bookmarkList').attr('id');
window.plugin.bookmarks.sortBookmarks(typeList);
}
});
//REMOVE FOLDER
$('.bookmarkList').on('click', '.folderLabel .bookmarksRemoveFrom', function(e) {
window.plugin.bookmarks.deletFolder(this);
$(this).parent().parent('li').remove();
e.preventDefault();
});
//REMOVE BOOKMARK
$('.bookmarkList').on('click', '.bkmrk .bookmarksRemoveFrom', function(e) {
window.plugin.bookmarks.deletBookmark(this);
$(this).parent('li').remove();
e.preventDefault();
});
//OPEN/CLOSE FOLDER
$('#bookmarksBox').on('click', '.bookmarksAnchor', function(e) {
window.plugin.bookmarks.openFolder(this);
$(this).parent().parent('li').toggleClass('active');
e.preventDefault();
});
//ADD BOOKMARK/FOLDER
$('#bookmarksBox .addForm a').click(function(e) {
var typeList = $(this).parent().parent('div').attr('id');
if($(this).hasClass('newMap')) { window.plugin.bookmarks.addBookmarkMap(this); }
else { window.plugin.bookmarks.addFolder(typeList); }
//REFRESS SORTABLE EVENT FOR BKMRK
$(".bookmarkList ul li ul").sortable({items:"li.bkmrk",connectWith:".bookmarkList ul ul",handle:".bookmarksLink",placeholder:"sortable-placeholder",forcePlaceholderSize:true,
update:function(event, ui) {
var typeList = $('#'+ui.item.context.id).parent().parent().parent().parent('.bookmarkList').attr('id');
window.plugin.bookmarks.sortBookmarks(typeList);
}
});
e.preventDefault();
});
});
}
window.plugin.bookmarks.setupCSS = function() {
$("<style>").prop("type", "text/css")
.html("@@INCLUDESTRING:plugins/bookmarks-by-zaso.css@@").appendTo("head");
}
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.disabledMessage = '<div class="notStorageSupport" title="Your browser do not support localStorage">Plugin Bookmarks disabled</div>';
plugin.bookmarks.bkmrkBox = '<div id="bookmarksBox">'
+'<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="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>';
plugin.bookmarks.bkmrkRibbon = '<a id="bookmarksShow"></a>';
}
/***************************************************************************************************************************************************************/
var setup = function() {
if(!localStorage[window.plugin.bookmarks['LOCAL_STORAGE_bkmrk_portals']]) {localStorage[plugin.bookmarks['LOCAL_STORAGE_bkmrk_portals']] = '{"bkmrk_portals":{"'+window.plugin.bookmarks.KEY_OTHER_BKMRK+'":{"label":"Others","state":1,"bkmrk":{}}}}'; }
if(!localStorage[window.plugin.bookmarks['LOCAL_STORAGE_bkmrk_maps']]) {localStorage[plugin.bookmarks['LOCAL_STORAGE_bkmrk_maps']] = '{"bkmrk_maps":{"'+window.plugin.bookmarks.KEY_OTHER_BKMRK+'":{"label":"Others","state":1,"bkmrk":{}}}}'; }
if(!localStorage[window.plugin.bookmarks['LOCAL_STORAGE_status_box']]) {localStorage[plugin.bookmarks['LOCAL_STORAGE_status_box']] = 0;}
if($.inArray('pluginBookmarksUpdate', window.VALID_HOOKS) < 0) { window.VALID_HOOKS.push('pluginBookmarksUpdate'); }
window.plugin.bookmarks.setupCSS();
window.plugin.bookmarks.setupJS();
window.plugin.bookmarks.setupContent();
window.plugin.bookmarks.loadBookmarks('bkmrk_portals');
window.plugin.bookmarks.loadBookmarks('bkmrk_maps');
window.addHook('portalDetailsUpdated', window.plugin.bookmarks.addStarToSidebar);
//Add to DOM the element of the plugin and load data from localStorage
$('body').append(plugin.bookmarks.bkmrkRibbon);
$('body').append(plugin.bookmarks.bkmrkBox);
window.plugin.bookmarks.loadList('bkmrk_maps');
window.plugin.bookmarks.loadList('bkmrk_portals');
//Load the js page for the scrollbar
var script2 = document.createElement('script');
script2.type = 'text/javascript';
script2.src = 'http://enscrollplugin.com/releases/enscroll-0.4.0.min.js';
script2.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script2);
}
window.plugin.bookmarks.setupJS();
window.addHook('portalDetailsUpdated', window.plugin.bookmarks.addToSidebar);
}
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
@@PLUGINEND@@

View File

@@ -1,6 +1,7 @@
// ==UserScript==
// @id iitc-plugin-compute-ap-stats@Hollow011
// @name IITC plugin: Compute AP statistics
// @category Info
// @version 0.3.0.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
@@ -13,10 +14,7 @@
// @grant none
// ==/UserScript==
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function') window.plugin = function() {};
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
@@ -143,16 +141,4 @@ var setup = function() {
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
@@PLUGINEND@@

View File

@@ -1,6 +1,7 @@
// ==UserScript==
// @id iitc-plugin-draw-tools@breunigs
// @name IITC plugin: draw tools
// @category Layer
// @version 0.4.1.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
@@ -13,10 +14,7 @@
// @grant none
// ==/UserScript==
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function') window.plugin = function() {};
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
@@ -158,16 +156,4 @@ var setup = window.plugin.drawTools.loadExternals;
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
@@PLUGINEND@@

View File

@@ -12,11 +12,11 @@
// @match http://www.ingress.com/intel*
// @grant none
// ==/UserScript==
function wrapper() {
if(typeof window.plugin !== 'function') window.plugin = function() {};
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
window.plugin.favoritePortals = function() {};
window.plugin.favoritePortals.portalList = {};
@@ -169,17 +169,4 @@ var setup = window.plugin.favoritePortals.setup;
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
@@PLUGINEND@@

View File

@@ -1,6 +1,7 @@
// ==UserScript==
// @id force-https@jonatkins
// @name IITC plugin: force https access for ingress.com/intel
// @category Tweaks
// @version 0.1.0.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@

View File

@@ -1,7 +1,8 @@
// ==UserScript==
// @id iitc-plugin-guess-player-levels@breunigs
// @name IITC plugin: guess player level
// @version 0.4.5.@@DATETIMEVERSION@@
// @category Info
// @version 0.4.6.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@
@@ -13,10 +14,7 @@
// @grant none
// ==/UserScript==
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function') window.plugin = function() {};
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
@@ -156,6 +154,23 @@ window.plugin.guessPlayerLevels.guess = function() {
title: 'Player levels: R' + averageR.toFixed(2) + ', E' + averageE.toFixed(2),
id: 'guess-player-levels',
width: 350,
buttons: {
'RESET GUESSES': function() {
// clear all guessed levels from local storage
$.each(Object.keys(localStorage), function(ind,key) {
if(key.lastIndexOf("level-",0)===0) {
localStorage.removeItem(key);
}
});
// now force all portals through the callback manually
$.each(window.portals, function(guid,p) {
window.plugin.guessPlayerLevels.extractPortalData({portal: p});
});
// and re-open the dialog (on a minimal timeout - so it's not closed while processing this callback)
setTimeout(window.plugin.guessPlayerLevels.guess,1);
},
},
});
//run the name resolving process
@@ -181,16 +196,4 @@ var setup = function() {
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
@@PLUGINEND@@

View File

@@ -1,6 +1,7 @@
// ==UserScript==
// @id iitc-plugin-ipas-link@graphracer
// @name IITC Plugin: simulate an attack on portal
// @category Portal Info
// @version 0.2.0.@@DATETIMEVERSION@@
// @namespace https://github.com/xosofox/IPAS
// @updateURL @@UPDATEURL@@
@@ -13,10 +14,7 @@
// @grant none
// ==/UserScript==
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function') window.plugin = function() {};
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
@@ -110,16 +108,4 @@ var setup = function () {
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
@@PLUGINEND@@

View File

@@ -1,6 +1,7 @@
// ==UserScript==
// @id iitc-plugin-keys-on-map@xelio
// @name IITC plugin: Keys on map
// @category Keys
// @version 0.2.1.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
@@ -13,10 +14,7 @@
// @grant none
// ==/UserScript==
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function') window.plugin = function() {};
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
@@ -135,16 +133,4 @@ var setup = function() {
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
@@PLUGINEND@@

View File

@@ -1,6 +1,7 @@
// ==UserScript==
// @id iitc-plugin-keys@xelio
// @name IITC plugin: Keys
// @category Keys
// @version 0.2.0.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
@@ -13,10 +14,7 @@
// @grant none
// ==/UserScript==
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function') window.plugin = function() {};
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
@@ -209,16 +207,4 @@ var setup = function() {
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
@@PLUGINEND@@

View File

@@ -1,10 +1,11 @@
// ==UserScript==
// @id max-links@boombuler
// @name IITC plugin: Max Links
// @version 0.3.1.@@DATETIMEVERSION@@
// @category Layer
// @version 0.4.0.@@DATETIMEVERSION@@
// @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@
// @description [@@BUILDNAME@@-@@BUILDDATE@@] Calculates how to link the portals to create the maximum number of fields.
// @description [@@BUILDNAME@@-@@BUILDDATE@@] Calculates how to link the portals to create the maximum number of fields. Enable from the layer chooser.
// @include https://www.ingress.com/intel*
// @include http://www.ingress.com/intel*
// @match https://www.ingress.com/intel*
@@ -12,11 +13,7 @@
// @grant none
// ==/UserScript==
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function')
window.plugin = function() {};
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
@@ -29,15 +26,24 @@ window.plugin.maxLinks.MAX_DRAWN_LINKS_INCREASED_LIMIT = 1000;
window.plugin.maxLinks.STROKE_STYLE = {
color: '#FF0000',
opacity: 1,
weight:2,
weight: 2,
clickable: false,
smoothFactor: 10
dashArray: [8,6],
smoothFactor: 10,
};
window.plugin.maxLinks.layer = null;
window.plugin.maxLinks._updating = false;
window.plugin.maxLinks._renderLimitReached = false;
window.plugin.maxLinks.Point = function(x,y) {
this.x=x;
this.y=y;
}
window.plugin.maxLinks.Point.prototype.toString = function() {
return this.x+","+this.y;
}
window.plugin.maxLinks.updateLayer = function() {
if (window.plugin.maxLinks._updating ||
window.plugin.maxLinks.layer === null ||
@@ -47,36 +53,62 @@ window.plugin.maxLinks.updateLayer = function() {
window.plugin.maxLinks.layer.clearLayers();
var locations = [];
var minX = 0;
var minY = 0;
$.each(window.portals, function(guid, portal) {
var loc = portal.options.details.locationE6;
var nloc = { x: loc.lngE6, y: loc.latE6 };
if (nloc.x < minX)
minX = nloc.x;
if (nloc.y < minY)
minY = nloc.y;
var nloc = new window.plugin.maxLinks.Point(loc.latE6/1E6, loc.lngE6/1E6);
locations.push(nloc);
});
$.each(locations, function(idx, nloc) {
nloc.x += Math.abs(minX);
nloc.y += Math.abs(minY);
});
var triangles = window.delaunay.triangulate(locations);
var drawnLinks = 0;
var drawnLinkCount = 0;
window.plugin.maxLinks._renderLimitReached = false;
var renderlimit = window.USE_INCREASED_RENDER_LIMIT ?
var renderLimit = window.USE_INCREASED_RENDER_LIMIT ?
window.plugin.maxLinks.MAX_DRAWN_LINKS_INCREASED_LIMIT :
window.plugin.maxLinks.MAX_DRAWN_LINKS;
var orderedPoints = function(a,b) {
if(a.x<b.x) return [a,b];
if(a.x==b.x && a.y<b.y) return [a,b];
return [b,a];
}
var drawnLinks = {};
//draw a link, but only if it hasn't already been drawn
var drawLink = function(a,b) {
//order the points, so a pair of coordinates in any order is handled in one direction only
var points = orderedPoints(a,b);
a=points[0];
b=points[1];
//do we have a line already drawn from a to b?
if(!(a in drawnLinks)) {
//no lines from a to anywhere yet - create an empty target array
drawnLinks[a] = {};
}
if (!(b in drawnLinks[a])) {
//no line from a to b yet
//using drawnLinks[a] as a set - so the stored value is of no importance
drawnLinks[a][b] = null;
var poly = L.polyline([[a.x,a.y],[b.x,b.y]], window.plugin.maxLinks.STROKE_STYLE);
poly.addTo(window.plugin.maxLinks.layer);
drawnLinkCount++;
}
}
$.each(triangles, function(idx, triangle) {
if (drawnLinks <= renderlimit) {
triangle.draw(window.plugin.maxLinks.layer, minX, minY)
drawnLinks += 3;
} else {
drawLink(triangle.a,triangle.b);
drawLink(triangle.b,triangle.c);
drawLink(triangle.c,triangle.a);
// we only check the render limit after drawing all three edges of a triangle, for efficency
if (drawnLinkCount > renderLimit ) {
window.plugin.maxLinks._renderLimitReached = true;
return false; //$.each break
}
});
window.plugin.maxLinks._updating = false;
@@ -88,17 +120,6 @@ window.plugin.maxLinks.setup = function() {
@@INCLUDERAW:external/delaunay.js@@
try { console.log('done loading delaunay JS'); } catch(e) {}
window.delaunay.Triangle.prototype.draw = function(layer, divX, divY) {
var drawLine = function(src, dest) {
var poly = L.polyline([[(src.y + divY)/1E6, (src.x + divX)/1E6], [(dest.y + divY)/1E6, (dest.x + divX)/1E6]], window.plugin.maxLinks.STROKE_STYLE);
poly.addTo(layer);
};
drawLine(this.a, this.b);
drawLine(this.b, this.c);
drawLine(this.c, this.a);
}
window.plugin.maxLinks.layer = L.layerGroup([]);
window.addHook('checkRenderLimit', function(e) {
@@ -107,9 +128,8 @@ window.plugin.maxLinks.setup = function() {
e.reached = true;
});
window.addHook('portalDataLoaded', function(e) {
if (window.map.hasLayer(window.plugin.maxLinks.layer))
window.plugin.maxLinks.updateLayer();
window.addHook('requestFinished', function(e) {
window.plugin.maxLinks.updateLayer();
});
window.map.on('layeradd', function(e) {
@@ -122,18 +142,5 @@ window.plugin.maxLinks.setup = function() {
var setup = window.plugin.maxLinks.setup;
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
@@PLUGINEND@@

61
plugins/minimap.user.js Normal file
View File

@@ -0,0 +1,61 @@
// ==UserScript==
// @id iitc-plugin-minimap@breunigs
// @name IITC plugin: Mini map
// @category Controls
// @version 0.1.0.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@
// @description [@@BUILDNAME@@-@@BUILDDATE@@] Shows a mini map on the corner of the map
// @include https://www.ingress.com/intel*
// @include http://www.ingress.com/intel*
// @match https://www.ingress.com/intel*
// @match http://www.ingress.com/intel*
// @grant none
// ==/UserScript==
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
// use own namespace for plugin
window.plugin.miniMap = function() {};
window.plugin.miniMap.setup = function() {
try { console.log('Loading leaflet.draw JS now'); } catch(e) {}
@@INCLUDERAW:external/Control.MiniMap.js@@
try { console.log('done loading leaflet.draw JS'); } catch(e) {}
// we can't use the same TileLayer as the main map uses - it causes issues.
// stick with the MapQuest tiles for now
//OpenStreetMap attribution - required by several of the layers
osmAttribution = 'Map data © OpenStreetMap contributors';
//MapQuest offer tiles - http://developer.mapquest.com/web/products/open/map
//their usage policy has no limits (except required notification above 4000 tiles/sec - we're perhaps at 50 tiles/sec based on CloudMade stats)
var mqSubdomains = [ 'otile1','otile2', 'otile3', 'otile4' ];
var mqTileUrlPrefix = window.location.protocol !== 'https:' ? 'http://{s}.mqcdn.com' : 'https://{s}-s.mqcdn.com';
var mqMapOpt = {attribution: osmAttribution+', Tiles Courtesy of MapQuest', maxZoom: 18, subdomains: mqSubdomains};
var mqMap = new L.TileLayer(mqTileUrlPrefix+'/tiles/1.0.0/map/{z}/{x}/{y}.jpg',mqMapOpt);
if(!isSmartphone()) {
// desktop mode - bottom-left, so it doesn't clash with the sidebar
new L.Control.MiniMap(mqMap, {toggleDisplay: true, position: 'bottomleft'}).addTo(window.map);
} else {
// mobile mode - bottom-right - so it floats above the map copyright text
new L.Control.MiniMap(mqMap, {toggleDisplay: true, position: 'bottomright'}).addTo(window.map);
}
$('head').append('<style>@@INCLUDESTRING:external/Control.MiniMap.css@@</style>');
};
var setup = window.plugin.miniMap.setup;
// PLUGIN END //////////////////////////////////////////////////////////
@@PLUGINEND@@

View File

@@ -1,6 +1,7 @@
// ==UserScript==
// @id iitc-plugin-pan-control@fragger
// @name IITC plugin: pan control
// @category Controls
// @version 0.1.1.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
@@ -13,10 +14,7 @@
// @grant none
// ==/UserScript==
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function') window.plugin = function() {};
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
@@ -45,16 +43,4 @@ var setup = window.plugin.panControl.setup;
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
@@PLUGINEND@@

View File

@@ -1,6 +1,7 @@
// ==UserScript==
// @id iitc-plugin-player-tracker@breunigs
// @name IITC Plugin: Player tracker
// @category Layer
// @version 0.9.4.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
@@ -13,10 +14,7 @@
// @grant none
// ==/UserScript==
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function') window.plugin = function() {};
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
window.PLAYER_TRACKER_MAX_TIME = 3*60*60*1000; // in milliseconds
@@ -411,16 +409,4 @@ var setup = plugin.playerTracker.setup;
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
@@PLUGINEND@@

View File

@@ -13,6 +13,10 @@
// @grant none
// ==/UserScript==
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
/*********************************************************************************************************
* Changelog:
*
@@ -24,13 +28,6 @@
* 0.1.0 First public release
*********************************************************************************************************/
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function') window.plugin = function() {};
// PLUGIN START ////////////////////////////////////////////////////////
// use own namespace for plugin
window.plugin.playersResonators = function() {};
@@ -107,16 +104,4 @@ var setup = function() {
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
@@PLUGINEND@@

View File

@@ -1,6 +1,7 @@
// ==UserScript==
// @id iitc-plugin-portals-count@yenky
// @name IITC plugin: Show total counts of portals
// @category Info
// @version 0.0.8.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
@@ -13,6 +14,10 @@
// @grant none
// ==/UserScript==
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
/* whatsnew
* 0.0.8 : use dialog() instead of alert()
* 0.0.6 : ignoring outside bounds portals (even if close to)
@@ -24,12 +29,6 @@
* todo :
*/
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function') window.plugin = function() {};
// PLUGIN START ////////////////////////////////////////////////////////
// use own namespace for plugin
window.plugin.portalcounts = function() {};
@@ -131,16 +130,4 @@ var setup = function() {
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
@@PLUGINEND@@

View File

@@ -1,6 +1,7 @@
// ==UserScript==
// @id iitc-plugin-highlight-portals-upgrade@vita10gy
// @name IITC plugin: highlight portals you can upgrade to a specific level
// @category Highlighter
// @version 0.1.0.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
@@ -13,10 +14,7 @@
// @grant none
// ==/UserScript==
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function') window.plugin = function() {};
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
@@ -78,16 +76,4 @@ var setup = function() {
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
@@PLUGINEND@@

View File

@@ -1,6 +1,7 @@
// ==UserScript==
// @id iitc-plugin-highlight-portals-level-color@vita10gy
// @name IITC plugin: highlight portals by level color
// @category Highlighter
// @version 0.1.0.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
@@ -13,14 +14,11 @@
// @grant none
// ==/UserScript==
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function') window.plugin = function() {};
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
// use own namespace for plugin
// use own namespace for plugin
window.plugin.portalHighligherPortalsLevelColor = function() {};
window.plugin.portalHighligherPortalsLevelColor.colorLevel = function(data) {
@@ -37,16 +35,4 @@ var setup = function() {
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
@@PLUGINEND@@

View File

@@ -1,6 +1,7 @@
// ==UserScript==
// @id iitc-plugin-highlight-portals-missing-resonators@vita10gy
// @name IITC plugin: highlight portals missing resonators
// @category Highlighter
// @version 0.1.0.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
@@ -13,10 +14,7 @@
// @grant none
// ==/UserScript==
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function') window.plugin = function() {};
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
@@ -63,16 +61,4 @@ var setup = function() {
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
@@PLUGINEND@@

View File

@@ -0,0 +1,70 @@
// ==UserScript==
// @id iitc-plugin-highlight-portals-mods@vita10gy
// @name IITC plugin: highlight portal mods
// @category Highlighter
// @version 0.1.0.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@
// @description [@@BUILDNAME@@-@@BUILDDATE@@] Uses the fill color of the portals to denote if the portal has the selected mod.
// @include https://www.ingress.com/intel*
// @include http://www.ingress.com/intel*
// @match https://www.ingress.com/intel*
// @match http://www.ingress.com/intel*
// @grant none
// ==/UserScript==
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
// use own namespace for plugin
window.plugin.portalHighligherMods = function() {};
window.plugin.portalHighligherMods.highlight = function(data, mod_type) {
var d = data.portal.options.details;
var mod_effect = 0;
$.each(d.portalV2.linkedModArray, function(ind, mod) {
if(mod !== null && mod.type == mod_type) {
switch(mod.rarity){
case 'COMMON':
mod_effect++;
break;
case 'RARE':
mod_effect+=2;
break;
case 'VERY_RARE':
mod_effect+=3;
break;
}
}
});
if(mod_effect > 0) {
var fill_opacity = mod_effect/12*.85 + .15;
var color = 'red';
fill_opacity = Math.round(fill_opacity*100)/100;
var params = {fillColor: color, fillOpacity: fill_opacity};
data.portal.setStyle(params);
}
window.COLOR_SELECTED_PORTAL = '#f0f';
}
window.plugin.portalHighligherMods.getHighlighter = function(type) {
return(function(data){
window.plugin.portalHighligherMods.highlight(data,type);
});
}
var setup = function() {
$.each(MOD_TYPE, function(ind, name){
window.addPortalHighlighter('Mod: '+name, window.plugin.portalHighligherMods.getHighlighter(ind));
});
}
// PLUGIN END //////////////////////////////////////////////////////////
@@PLUGINEND@@

View File

@@ -1,6 +1,7 @@
// ==UserScript==
// @id iitc-plugin-highlight-portals-my-8-portals@vita10gy
// @name IITC plugin: highlight my level 8's on portals
// @category Highlighter
// @version 0.1.0.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
@@ -13,10 +14,7 @@
// @grant none
// ==/UserScript==
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function') window.plugin = function() {};
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
@@ -53,16 +51,4 @@ var setup = function() {
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
@@PLUGINEND@@

View File

@@ -1,6 +1,7 @@
// ==UserScript==
// @id iitc-plugin-highlight-portals-my-portals@vita10gy
// @name IITC plugin: highlight my portals
// @category Highlighter
// @version 0.1.0.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
@@ -13,10 +14,7 @@
// @grant none
// ==/UserScript==
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function') window.plugin = function() {};
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
@@ -73,16 +71,4 @@ var setup = function() {
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
@@PLUGINEND@@

View File

@@ -1,6 +1,7 @@
// ==UserScript==
// @id iitc-plugin-highlight-needs-recharge@vita10gy
// @name IITC plugin: hightlight portals that need recharging
// @category Highlighter
// @version 0.1.0.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
@@ -13,10 +14,7 @@
// @grant none
// ==/UserScript==
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function') window.plugin = function() {};
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
@@ -46,16 +44,4 @@ var setup = function() {
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
@@PLUGINEND@@

View File

@@ -1,6 +1,7 @@
// ==UserScript==
// @id iitc-plugin-highlight-portals-by-ap-by-energy-relative@vita10gy
// @name IITC plugin: highlight portals by ap/energy (relative)
// @category Highlighter
// @version 0.1.1.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
@@ -13,10 +14,7 @@
// @grant none
// ==/UserScript==
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function') window.plugin = function() {};
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
@@ -104,16 +102,4 @@ var setup = function() {
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
@@PLUGINEND@@

View File

@@ -1,6 +1,7 @@
// ==UserScript==
// @id iitc-plugin-highlight-portals-by-ap-relative@vita10gy
// @name IITC plugin: highlight portals by ap relative
// @category Highlighter
// @version 0.1.1.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
@@ -13,10 +14,7 @@
// @grant none
// ==/UserScript==
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function') window.plugin = function() {};
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
@@ -99,16 +97,4 @@ var setup = function() {
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
@@PLUGINEND@@

View File

@@ -1,6 +1,7 @@
// ==UserScript==
// @id iitc-plugin-highlight-portals-by-ap@vita10gy
// @name IITC plugin: highlight portals by ap
// @category Highlighter
// @version 0.1.1.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
@@ -13,10 +14,7 @@
// @grant none
// ==/UserScript==
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function') window.plugin = function() {};
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
@@ -60,16 +58,4 @@ var setup = function() {
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
@@PLUGINEND@@

View File

@@ -1,6 +1,7 @@
// ==UserScript==
// @id iitc-plugin-highlight-portals-my-level@vita10gy
// @name IITC plugin: highlight portals by my level
// @category Highlighter
// @version 0.1.0.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
@@ -13,10 +14,7 @@
// @grant none
// ==/UserScript==
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function') window.plugin = function() {};
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
@@ -54,16 +52,4 @@ var setup = function() {
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
@@PLUGINEND@@

View File

@@ -1,6 +1,7 @@
// ==UserScript==
// @id iitc-plugin-highlight-portals-upgrade@vita10gy
// @name IITC plugin: highlight portals you can upgrade
// @category Highlighter
// @version 0.1.0.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
@@ -13,10 +14,7 @@
// @grant none
// ==/UserScript==
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function') window.plugin = function() {};
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
@@ -57,16 +55,4 @@ var setup = function() {
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
@@PLUGINEND@@

View File

@@ -1,6 +1,7 @@
// ==UserScript==
// @id iitc-plugin-highlight-portals-with-L8-resonators@superd
// @name IITC plugin: highlight portals with L8 resonators
// @category Highlighter
// @version 0.1.0.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
@@ -13,10 +14,7 @@
// @grant none
// ==/UserScript==
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function') window.plugin = function() {};
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
@@ -54,16 +52,4 @@ var setup = function() {
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
@@PLUGINEND@@

View File

@@ -1,6 +1,7 @@
// ==UserScript==
// @id iitc-plugin-portal-level-numbers@rongou
// @name IITC plugin: Portal Level Numbers
// @category Layer
// @version 0.1.0.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
@@ -13,10 +14,7 @@
// @grant none
// ==/UserScript==
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function') window.plugin = function() {};
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
@@ -85,16 +83,4 @@ var setup = function() {
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
@@PLUGINEND@@

View File

@@ -1,7 +1,8 @@
// ==UserScript==
// @id iitc-plugin-portals-list@teo96
// @name IITC plugin: show list of portals
// @version 0.0.13.@@DATETIMEVERSION@@
// @category Info
// @version 0.0.14.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@
@@ -13,7 +14,12 @@
// @grant none
// ==/UserScript==
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
/* whatsnew
* 0.0.14: Add support to new mods (S:Shield - T:Turret - LA:Link Amp - H:Heat-sink - M:Multi-hack - FA:Force Amp)
* 0.0.12: Use dialog() instead of alert so the user can drag the box around
* 0.0.11: Add nominal energy column and # links, fix sort bug when opened even amounts of times, nits
* 0.0.10: Fixed persistent css problem with alert
@@ -33,12 +39,6 @@
* todo : export as GPX, Open in Google Maps, more statistics in the header, what else ?
*/
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function') window.plugin = function() {};
// PLUGIN START ////////////////////////////////////////////////////////
// use own namespace for plugin
window.plugin.portalslist = function() {};
@@ -94,19 +94,44 @@ window.plugin.portalslist.getPortals = function() {
// Sort resonators array by resonator level
resonators.sort(function (a, b) {return b[0] - a[0]});
//get shield informations
var shields = [];
//get mods informations
var mods = [];
$.each(d.portalV2.linkedModArray, function(ind, mod) {
if (mod) {
//shields[ind] = mod.rarity.capitalize().replace('_', ' ');
shields[ind] = [mod.rarity.substr(0,1).capitalize(), getPlayerName(mod.installingUser)] ;
} else {
shields[ind] = ['', ''];
}
var modShortName='';
if (mod) {
switch (mod.displayName) {
case 'Portal Shield':
modShortName = 'S';
break;
case 'Force Amp':
modShortName = 'FA';
break;
case 'Link Amp':
modShortName = 'LA';
break;
case 'Heat Sink':
modShortName = 'H';
break;
case 'Multi-hack':
modShortName = 'M';
break;
case 'Turret':
modShortName = 'T';
break;
default:
modShortName = '';
break;
}
if (modShortName === '') {
mods[ind] = ['', '', ''];
} else {
mods[ind] = [mod.rarity, getPlayerName(mod.installingUser), modShortName, mod.displayName];
}
}else { mods[ind] = ['', '', '']; }
});
console.log(mods);
var APgain= getAttackApGain(d).enemyAp;
var thisPortal = {'portal': d, 'name': name, 'team': team, 'level': level, 'guid': guid, 'resonators': resonators, 'energyratio': maxenergy ? Math.floor(energy/maxenergy*100) : 0, 'shields': shields, 'APgain': APgain, 'EAP': (energy/APgain).toFixed(2), 'energy': energy, 'maxenergy': maxenergy, 'links': d.portalV2.linkedEdges.length, 'lat': portal._latlng.lat, 'lng': portal._latlng.lng, 'address': address, 'img': img};
var thisPortal = {'portal': d, 'name': name, 'team': team, 'level': level, 'guid': guid, 'resonators': resonators, 'energyratio': maxenergy ? Math.floor(energy/maxenergy*100) : 0, 'mods': mods, 'APgain': APgain, 'EAP': (energy/APgain).toFixed(2), 'energy': energy, 'maxenergy': maxenergy, 'links': d.portalV2.linkedEdges.length, 'lat': portal._latlng.lat, 'lng': portal._latlng.lng, 'address': address, 'img': img};
window.plugin.portalslist.listPortals.push(thisPortal);
});
@@ -199,16 +224,16 @@ window.plugin.portalslist.portalTable = function(sortBy, sortOrder, filter) {
retVal = b.resonators[7][0] - a.resonators[7][0];
break;
case 's1':
retVal = a.shields[0].toLowerCase() > b.shields[0].toLowerCase() ? -1 : 1;
retVal = a.mods[0][2] > b.mods[0][2] ? -1 : 1;
break;
case 's2':
retVal = a.shields[1].toLowerCase() > b.shields[1].toLowerCase() ? -1 : 1;
retVal = a.mods[1][2] > b.mods[1][2] ? -1 : 1;
break;
case 's3':
retVal = a.shields[2].toLowerCase() > b.shields[2].toLowerCase() ? -1 : 1;
retVal = a.mods[2][2] > b.mods[2][2] ? -1 : 1;
break;
case 's4':
retVal = a.shields[3].toLowerCase() > b.shields[3].toLowerCase() ? -1 : 1;
retVal = a.mods[3][2] > b.mods[3][2] ? -1 : 1;
break;
default:
retVal = b[sortBy] - a[sortBy];
@@ -235,10 +260,10 @@ window.plugin.portalslist.portalTable = function(sortBy, sortOrder, filter) {
+ '<th ' + sort('energy', sortBy, -1) + '>Energy</th>'
+ '<th ' + sort('energyratio', sortBy, -1) + '>%</th>'
+ '<th ' + sort('links', sortBy, -1) + '>Links</th>'
+ '<th ' + sort('s1', sortBy, -1) + '>S1</th>'
+ '<th ' + sort('s2', sortBy, -1) + '>S2</th>'
+ '<th ' + sort('s3', sortBy, -1) + '>S3</th>'
+ '<th ' + sort('s4', sortBy, -1) + '>S4</th>'
+ '<th ' + sort('s1', sortBy, -1) + '>M1</th>'
+ '<th ' + sort('s2', sortBy, -1) + '>M2</th>'
+ '<th ' + sort('s3', sortBy, -1) + '>M3</th>'
+ '<th ' + sort('s4', sortBy, -1) + '>M4</th>'
+ '<th ' + sort('APgain', sortBy, -1) + '>AP Gain</th>'
+ '<th title="Energy / AP Gain ratio" ' + sort('EAP', sortBy, -1) + '>E/AP</th></tr>';
@@ -263,13 +288,13 @@ window.plugin.portalslist.portalTable = function(sortBy, sortOrder, filter) {
});
html += '<td style="cursor:help" title="'+ portal.energy +'">' + prettyEnergy(portal.energy) + '</td>'
html += '<td style="cursor:help" title="'+ portal.energy +'">' + prettyEnergy(portal.energy) + '</td>'
+ '<td style="cursor:help" title="' + portal.energy + ' / ' + portal.maxenergy +'">' + portal.energyratio + '%</td>'
+ '<td style="cursor:help" title="' + portal.links + '">' + portal.links + '</td>'
+ '<td style="cursor:help" title="'+ portal.shields[0][1] +'">' + portal.shields[0][0] + '</td>'
+ '<td style="cursor:help" title="'+ portal.shields[1][1] +'">' + portal.shields[1][0] + '</td>'
+ '<td style="cursor:help" title="'+ portal.shields[2][1] +'">' + portal.shields[2][0] + '</td>'
+ '<td style="cursor:help" title="'+ portal.shields[3][1] +'">' + portal.shields[3][0] + '</td>'
+ '<td style="cursor:help; background-color: '+COLORS_MOD[portal.mods[0][0]]+';" title="Mod : ' + portal.mods[0][3] + '\nInstalled by : ' + portal.mods[0][1] + '\nRarity : ' + portal.mods[0][0] + '">' + portal.mods[0][2] + '</td>'
+ '<td style="cursor:help; background-color: '+COLORS_MOD[portal.mods[1][0]]+';" title="Mod : ' + portal.mods[1][3] + '\nInstalled by : ' + portal.mods[1][1] + '\nRarity : ' + portal.mods[1][0] + '">' + portal.mods[1][2] + '</td>'
+ '<td style="cursor:help; background-color: '+COLORS_MOD[portal.mods[2][0]]+';" title="Mod : ' + portal.mods[2][3] + '\nInstalled by : ' + portal.mods[2][1] + '\nRarity : ' + portal.mods[2][0] + '">' + portal.mods[2][2] + '</td>'
+ '<td style="cursor:help; background-color: '+COLORS_MOD[portal.mods[3][0]]+';" title="Mod : ' + portal.mods[3][3] + '\nInstalled by : ' + portal.mods[3][1] + '\nRarity : ' + portal.mods[3][0] + '">' + portal.mods[3][2] + '</td>'
+ '<td>' + portal.APgain + '</td>'
+ '<td>' + portal.EAP + '</td>';
@@ -363,16 +388,4 @@ var setup = function() {
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
@@PLUGINEND@@

View File

@@ -13,11 +13,7 @@
// @grant none
// ==/UserScript==
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function')
window.plugin = function() {};
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
@@ -114,18 +110,4 @@ var setup = window.plugin.privacyView.setup;
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
@@PLUGINEND@@

View File

@@ -1,6 +1,7 @@
// ==UserScript==
// @id iitc-plugin-render-limit-increase@jonatkins
// @name IITC plugin: render limit increase
// @category Tweaks
// @version 0.3.0.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
@@ -13,10 +14,8 @@
// @grant none
// ==/UserScript==
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function') window.plugin = function() {};
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
@@ -49,16 +48,4 @@ var setup = window.plugin.renderLimitIncrease.setHigherLimits;
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
@@PLUGINEND@@

View File

@@ -1,6 +1,7 @@
// ==UserScript==
// @id iitc-plugin-reso-energy-pct-in-portal-detail@xelio
// @name IITC plugin: reso energy pct in portal detail
// @category Portal Info
// @version 0.1.2.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
@@ -13,10 +14,7 @@
// @grant none
// ==/UserScript==
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function') window.plugin = function() {};
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
@@ -46,16 +44,4 @@ var setup = function() {
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
@@PLUGINEND@@

View File

@@ -1,6 +1,7 @@
// ==UserScript==
// @id iitc-plugin-resonator-display-zoom-level-decrease@xelio
// @name IITC plugin: resonator display zoom level decrease
// @category Tweaks
// @version 1.0.2.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
@@ -13,10 +14,7 @@
// @grant none
// ==/UserScript==
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function') window.plugin = function() {};
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
@@ -34,16 +32,4 @@ var setup = window.plugin.resonatorDisplayZoomLevelDecrease.changeConstant;
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
@@PLUGINEND@@

View File

@@ -1,6 +1,7 @@
// ==UserScript==
// @id iitc-plugin-scale-bar@breunigs
// @name IITC plugin: scale bar
// @category Controls
// @version 0.1.0.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
@@ -13,10 +14,7 @@
// @grant none
// ==/UserScript==
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function') window.plugin = function() {};
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
@@ -41,16 +39,4 @@ var setup = window.plugin.scaleBar.setup;
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
@@PLUGINEND@@

View File

@@ -1,6 +1,7 @@
// ==UserScript==
// @id iitc-plugin-scoreboard@vita10gy
// @name IITC plugin: show a localized scoreboard.
// @category Info
// @version 0.1.8.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
@@ -13,10 +14,7 @@
// @grant none
// ==/UserScript==
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function') window.plugin = function() {};
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
@@ -426,16 +424,4 @@ var setup = function() {
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
@@PLUGINEND@@

View File

@@ -0,0 +1,36 @@
// ==UserScript==
// @id iitc-plugin-scroll-wheel-zoom-disable@jonatkins
// @name IITC plugin: disable mouse wheel zoom
// @category Tweaks
// @version 0.1.0.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@
// @description [@@BUILDNAME@@-@@BUILDDATE@@] Disable the use of mouse wheel to zoom. The map zoom controls or keyboard are still available.
// @include https://www.ingress.com/intel*
// @include http://www.ingress.com/intel*
// @match https://www.ingress.com/intel*
// @match http://www.ingress.com/intel*
// @grant none
// ==/UserScript==
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
// use own namespace for plugin
window.plugin.scrollWheelZoomDisable = function() {};
window.plugin.scrollWheelZoomDisable.setup = function() {
window.map.scrollWheelZoom.disable();
};
var setup = window.plugin.scrollWheelZoomDisable.setup;
// PLUGIN END //////////////////////////////////////////////////////////
@@PLUGINEND@@

View File

@@ -1,6 +1,7 @@
// ==UserScript==
// @id iitc-plugin-show-address@vita10gy
// @name IITC plugin: show portal address in sidebar
// @category Portal Info
// @version 0.2.2.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
@@ -13,10 +14,7 @@
// @grant none
// ==/UserScript==
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function') window.plugin = function() {};
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
@@ -43,16 +41,4 @@ var setup = function() {
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
@@PLUGINEND@@

View File

@@ -1,6 +1,7 @@
// ==UserScript==
// @id iitc-plugin-show-linked-portals@fstopienski
// @name IITC plugin: Show linked portals
// @category Portal Info
// @version 0.0.4.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
@@ -13,21 +14,16 @@
// @grant none
// ==/UserScript==
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
/*
* 0.0.1 initial release, show images, names and addresses of linked portal in portal detailview
* - mouse click of the linked portal image selected the portal and adjust map
* - click of "Linked Portal is out of range" zoom a step out
*/
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if (typeof window.plugin !== 'function') {
window.plugin = function () {
};
}
// PLUGIN START ////////////////////////////////////////////////////////
// use own namespace for plugin
window.plugin.showLinkedPortal = function () {
};
@@ -120,16 +116,4 @@ var setup = function () {
}
// PLUGIN END //////////////////////////////////////////////////////////
if (window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if (window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
@@PLUGINEND@@

View File

@@ -0,0 +1,61 @@
// ==UserScript==
// @id iitc-plugin-show-more-portals@jonatkins
// @name IITC plugin: Show more portals
// @category Tweaks
// @version 0.1.0.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@
// @description [@@BUILDNAME@@-@@BUILDDATE@@] Boost the detail level of portals shown on the map by one zoom level. Good for small screens. Likely to increase request failed errors on larger screens.
// @include https://www.ingress.com/intel*
// @include http://www.ingress.com/intel*
// @match https://www.ingress.com/intel*
// @match http://www.ingress.com/intel*
// @grant none
// ==/UserScript==
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
// use own namespace for plugin
window.plugin.showMorePortals = function() {};
window.plugin.showMorePortals.setup = function() {
// replace the window.getPortalDataZoom function
window.getPortalDataZoom = function() {
var mapZoom = map.getZoom();
// yes, it is possible to increase this beyond "+1" - however, that will end up producing a rediculous number
// of requests to the Niantic servers, giving many request failed errors/tile timeouts
// (every increase by one requests four times as many data tiles)
var z = mapZoom + 1;
// limiting the mazimum zoom level for data retrieval reduces the number of requests at high zoom levels
// (as all portal data is retrieved at z=17, why retrieve multiple z=18 tiles when fewer z=17 would do?)
// very effective along with the new cache code
if (z > 17) z=17;
// if the data zoom is above the map zoom we can step back if the detail level is the same
// with the new cache code this works rather well
while (z > mapZoom && getMinPortalLevelForZoom(z) == getMinPortalLevelForZoom(z-1)) {
z = z-1;
}
//sanity check - should never happen
if (z < 0) z=0;
return z;
}
};
var setup = window.plugin.showMorePortals.setup;
// PLUGIN END //////////////////////////////////////////////////////////
@@PLUGINEND@@

View File

@@ -1,11 +1,12 @@
// ==UserScript==
// @id iitc-plugin-show-portal-weakness@vita10gy
// @name IITC plugin: show portal weakness
// @version 0.7.0.@@DATETIMEVERSION@@
// @category Highlighter
// @version 0.7.1.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@
// @description [@@BUILDNAME@@-@@BUILDDATE@@] Uses the fill color of the portals to denote if the portal is weak (Needs recharging, missing a resonator, needs shields) Red, needs energy and shields. Orange, only needs energy (either recharge or resonators). Yellow, only needs shields.
// @description [@@BUILDNAME@@-@@BUILDDATE@@] Uses the fill color of the portals to denote if the portal is weak (Needs recharging, missing a resonator, needs mods) Red, needs energy and mods. Orange, only needs energy (either recharge or resonators). Yellow, only needs mods.
// @include https://www.ingress.com/intel*
// @include http://www.ingress.com/intel*
// @match https://www.ingress.com/intel*
@@ -13,10 +14,7 @@
// @grant none
// ==/UserScript==
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function') window.plugin = function() {};
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
@@ -27,17 +25,19 @@ window.plugin.portalWeakness.highlightWeakness = function(data) {
var d = data.portal.options.details;
var portal_weakness = 0;
if(getTeam(d) !== 0) {
var only_shields = true;
var missing_shields = 0;
var only_mods = true;
var missing_mods = 0;
if(window.getTotalPortalEnergy(d) > 0 && window.getCurrentPortalEnergy(d) < window.getTotalPortalEnergy(d)) {
portal_weakness = 1 - (window.getCurrentPortalEnergy(d)/window.getTotalPortalEnergy(d));
only_shields = false;
only_mods = false;
}
//Ding the portal for every missing sheild.
//Ding the portal for every unapplicable mod.
$.each(d.portalV2.linkedModArray, function(ind, mod) {
if(mod === null) {
missing_shields++;
portal_weakness += .03;
if(mod === null || mod.type == 'MULTIHACK' || mod.type == 'HEATSINK' || mod.type == 'LINK_AMPLIFIER') {
if(mod === null) {
missing_mods++;
}
portal_weakness += .08;
}
});
//Ding the portal for every missing resonator.
@@ -45,7 +45,7 @@ window.plugin.portalWeakness.highlightWeakness = function(data) {
$.each(d.resonatorArray.resonators, function(ind, reso) {
if(reso === null) {
portal_weakness += .125;
only_shields = false;
only_mods = false;
} else {
resCount++;
}
@@ -60,12 +60,12 @@ window.plugin.portalWeakness.highlightWeakness = function(data) {
if(portal_weakness > 0) {
var fill_opacity = portal_weakness*.85 + .15;
var color = 'orange';
if(only_shields) {
if(only_mods) {
color = 'yellow';
//If only shields are missing, make portal yellow
//If only mods are missing, make portal yellow
// but fill more than usual since pale yellow is basically invisible
fill_opacity = missing_shields*.15 + .1;
} else if(missing_shields > 0) {
fill_opacity = missing_mods*.15 + .1;
} else if(missing_mods > 0) {
color = 'red';
}
fill_opacity = Math.round(fill_opacity*100)/100;
@@ -91,16 +91,4 @@ var setup = function() {
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
@@PLUGINEND@@

View File

@@ -13,10 +13,7 @@
// @grant none
// ==/UserScript==
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if (typeof window.plugin !== 'function') window.plugin = function() {};
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
@@ -36,16 +33,4 @@ var setup = window.plugin.speechSearch.setup;
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
@@PLUGINEND@@

View File

@@ -1,6 +1,7 @@
// ==UserScript==
// @id iitc-plugin-sync@xelio
// @name IITC plugin: Sync
// @category Keys
// @version 0.2.1.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
@@ -13,10 +14,7 @@
// @grant none
// ==/UserScript==
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function') window.plugin = function() {};
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
@@ -753,16 +751,4 @@ var setup = function() {
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
@@PLUGINEND@@

View File

@@ -1,6 +1,7 @@
// ==UserScript==
// @id iitc-plugin-zoom-slider@fragger
// @name IITC plugin: zoom slider
// @category Controls
// @version 0.1.1.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
@@ -13,10 +14,7 @@
// @grant none
// ==/UserScript==
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function') window.plugin = function() {};
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
@@ -41,16 +39,4 @@ var setup = window.plugin.zoomSlider.setup;
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
@@PLUGINEND@@