Revert "Added toggle to collapse sidebar" due to old code in commit

This reverts commit 9440e432de.
This commit is contained in:
Cameron Moon
2013-02-10 22:56:53 +11:00
parent 9440e432de
commit 79b1f2b840
3 changed files with 38 additions and 49 deletions

View File

@ -154,27 +154,6 @@ window.setupPlayerStat = function() {
); );
} }
window.setupSidebarToggle = function() {
var toggle = $('#sidebartoggle');
var sidebar = $('#sidebar');
toggle.text('▶');
toggle.css('right', SIDEBAR_WIDTH+2+'px');
toggle.on('click', function() {
if(sidebar.is(':visible')) {
sidebar.hide();
$('#map').css('margin-right','0');
toggle.text('◀');
toggle.css('right', '0');
} else {
sidebar.show();
$('#map').css('margin-right', SIDEBAR_WIDTH+2+'px');
toggle.text('▶');
toggle.css('right', SIDEBAR_WIDTH+2+'px');
}
window.map.invalidateSize(false);
});
}
// BOOTING /////////////////////////////////////////////////////////// // BOOTING ///////////////////////////////////////////////////////////
@ -185,7 +164,6 @@ function boot() {
window.setupGeosearch(); window.setupGeosearch();
window.setupRedeem(); window.setupRedeem();
window.setupLargeImagePreview(); window.setupLargeImagePreview();
window.setupSidebarToggle();
window.updateGameScore(); window.updateGameScore();
window.setupPlayerStat(); window.setupPlayerStat();
window.chat.setup(); window.chat.setup();
@ -196,7 +174,13 @@ function boot() {
// load only once // load only once
var n = window.PLAYER['nickname']; var n = window.PLAYER['nickname'];
window.PLAYER['nickMatcher'] = new RegExp('\\b('+n+')\\b', 'ig'); window.PLAYER['nickMatcher'] = new RegExp('\\b('+n+')\\b', 'ig');
$('#sidebar').show(); $('#sidebar').show();
if(window.bootPlugins)
$.each(window.bootPlugins, function(ind, ref) { ref(); });
window.iitcLoaded = true;
} }
// this is the minified load.js script that allows us to easily load // this is the minified load.js script that allows us to easily load
@ -208,10 +192,12 @@ function asyncLoadScript(a){return function(b,c){var d=document.createElement("s
// modified version of https://github.com/shramov/leaflet-plugins. Also // modified version of https://github.com/shramov/leaflet-plugins. Also
// contains the default Ingress map style. // contains the default Ingress map style.
var LLGMAPS = 'http://breunigs.github.com/ingress-intel-total-conversion/leaflet_google.js'; var LLGMAPS = 'http://breunigs.github.com/ingress-intel-total-conversion/external/leaflet_google.js';
var JQUERY = 'https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js'; var JQUERY = 'https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js';
var LEAFLET = 'http://cdn.leafletjs.com/leaflet-0.5/leaflet.js'; var LEAFLET = 'http://cdn.leafletjs.com/leaflet-0.5/leaflet.js';
var AUTOLINK = 'http://raw.github.com/bryanwoods/autolink-js/master/autolink.js'; var AUTOLINK = 'http://breunigs.github.com/ingress-intel-total-conversion/external/autolink.js';
// after all scripts have loaded, boot the actual app // after all scripts have loaded, boot the actual app
load(JQUERY, LEAFLET, AUTOLINK).then(LLGMAPS).thenRun(boot); load(JQUERY, LEAFLET, AUTOLINK).then(LLGMAPS).onError(function (err) {
alert('Could not all resources, the script likely wont work.\n\nIf this happend the first time for you, its probably a temporary issue. Just wait a bit and try again.\n\nIf you installed the script for the first time and this happens:\n try disabling NoScript if you have it installed\n press CTRL+SHIFT+K in Firefox or CTRL+SHIFT+I in Chrome/Opera and reload the page. Additional info may be available in the console.\n Open an issue at https://github.com/breunigs/ingress-intel-total-conversion/issues');
}).thenRun(boot);

12
main.js
View File

@ -1,7 +1,7 @@
// ==UserScript== // ==UserScript==
// @id ingress-intel-total-conversion@breunigs // @id ingress-intel-total-conversion@breunigs
// @name intel map total conversion // @name intel map total conversion
// @version 0.3-@@BUILDDATE@@ // @version 0.4-@@BUILDDATE@@
// @namespace https://github.com/breunigs/ingress-intel-total-conversion // @namespace https://github.com/breunigs/ingress-intel-total-conversion
// @updateURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/total-conversion-build.user.js // @updateURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/total-conversion-build.user.js
// @downloadURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/total-conversion-build.user.js // @downloadURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/total-conversion-build.user.js
@ -58,7 +58,6 @@ document.getElementsByTagName('body')[0].innerHTML = ''
+ ' <div id="chatautomated"></div>' + ' <div id="chatautomated"></div>'
+ '</div>' + '</div>'
+ '<form id="chatinput" style="display:none"><time></time><span>tell faction:</span><input type="text"/></form>' + '<form id="chatinput" style="display:none"><time></time><span>tell faction:</span><input type="text"/></form>'
+ '<a id="sidebartoggle"></a>'
+ '<div id="scrollwrapper">' // enable scrolling for small screens + '<div id="scrollwrapper">' // enable scrolling for small screens
+ ' <div id="sidebar" style="display: none">' + ' <div id="sidebar" style="display: none">'
+ ' <div id="playerstat">t</div>' + ' <div id="playerstat">t</div>'
@ -66,6 +65,8 @@ document.getElementsByTagName('body')[0].innerHTML = ''
+ ' <input id="geosearch" placeholder="Search location…" type="text"/>' + ' <input id="geosearch" placeholder="Search location…" type="text"/>'
+ ' <div id="portaldetails"></div>' + ' <div id="portaldetails"></div>'
+ ' <input id="redeem" placeholder="Redeem code…" type="text"/>' + ' <input id="redeem" placeholder="Redeem code…" type="text"/>'
+ ' <div id="toolbox"></div>'
+ ' <div id="spacer"></div>'
+ ' <div id="updatestatus"></div>' + ' <div id="updatestatus"></div>'
+ ' </div>'; + ' </div>';
+ '</div>'; + '</div>';
@ -115,6 +116,9 @@ var MAX_DRAWN_FIELDS = 200;
var COLOR_SELECTED_PORTAL = '#f00'; var COLOR_SELECTED_PORTAL = '#f00';
var COLORS = ['#FFCE00', '#0088FF', '#03FE03']; // none, res, enl var COLORS = ['#FFCE00', '#0088FF', '#03FE03']; // none, res, enl
var COLORS_LVL = ['#000', '#FECE5A', '#FFA630', '#FF7315', '#E40000', '#FD2992', '#EB26CD', '#C124E0', '#9627F4']; var COLORS_LVL = ['#000', '#FECE5A', '#FFA630', '#FF7315', '#E40000', '#FD2992', '#EB26CD', '#C124E0', '#9627F4'];
var COLORS_MOD = {VERY_RARE: '#F78AF6', RARE: '#AD8AFF', COMMON: '#84FBBD'};
// circles around a selected portal that show from where you can hack // circles around a selected portal that show from where you can hack
// it and how far the portal reaches (i.e. how far links may be made // it and how far the portal reaches (i.e. how far links may be made
// from this portal) // from this portal)
@ -135,6 +139,7 @@ var NOMINATIM = 'http://nominatim.openstreetmap.org/search?format=json&limit=1&q
var DEG2RAD = Math.PI / 180; var DEG2RAD = Math.PI / 180;
var TEAM_NONE = 0, TEAM_RES = 1, TEAM_ENL = 2; var TEAM_NONE = 0, TEAM_RES = 1, TEAM_ENL = 2;
var TEAM_TO_CSS = ['none', 'res', 'enl']; var TEAM_TO_CSS = ['none', 'res', 'enl'];
var TYPE_UNKNOWN = 0, TYPE_PORTAL = 1, TYPE_LINK = 2, TYPE_FIELD = 3, TYPE_PLAYER = 4, TYPE_CHAT = 5;
// make PLAYER variable available in site context // make PLAYER variable available in site context
var PLAYER = window.PLAYER; var PLAYER = window.PLAYER;
var CHAT_SHRINKED = 60; var CHAT_SHRINKED = 60;
@ -160,6 +165,9 @@ window.portals = {};
window.links = {}; window.links = {};
window.fields = {}; window.fields = {};
// plugin framework. Plugins may load earlier than iitc, so dont
// overwrite data
if(typeof window.plugin !== 'function') window.plugin = function() {};
@@INJECTHERE@@ @@INJECTHERE@@

View File

@ -35,26 +35,6 @@ body {
overflow-x:hidden; overflow-x:hidden;
} }
#sidebartoggle {
display: block;
padding: 5px;
position: absolute;
top: 50%;
z-index: 3000;
background-color: rgba(8, 48, 78, 0.9);
color: #FFCE00;
border: 1px solid #20A8B1;
border-right: none;
border-radius: 5px 0 0 5px;
text-decoration: none;
}
#redeem {
/* cheap hack to prevent sidebar content being overlayed by the map
* status box */
margin-bottom: 55px;
}
.enl { .enl {
color: #03fe03 !important; color: #03fe03 !important;
@ -120,6 +100,11 @@ a:hover {
border: 1px solid #20A8B1; border: 1px solid #20A8B1;
} }
#chatcontrols a:first-child {
letter-spacing:-1px;
text-decoration: none !important;
}
#chatcontrols a.active { #chatcontrols a.active {
border-color: #FFCE00; border-color: #FFCE00;
border-bottom-width:0px; border-bottom-width:0px;
@ -197,7 +182,6 @@ mark {
overflow:hidden; overflow:hidden;
vertical-align: top; vertical-align: top;
background: transparent; background: transparent;
text-align: right;
} }
summary { summary {
@ -245,7 +229,7 @@ summary {
font-size: 12.6px; font-size: 12.6px;
font-family: Verdana,sans-serif; font-family: Verdana,sans-serif;
color: #EEEEEE; color: #EEEEEE;
width: 558px !important; width: 558px
} }
@ -504,6 +488,17 @@ aside:nth-child(odd) span {
width: 140px; width: 140px;
} }
#toolbox {
padding: 4px;
font-size:90%;
}
#spacer {
/* cheap hack to prevent sidebar content being overlayed by the map
* status box */
height: 55px;
}
/* a common portal display takes this much space (prevents moving /* a common portal display takes this much space (prevents moving
* content when first selecting a portal) */ * content when first selecting a portal) */