improve style a bit

This commit is contained in:
Stefan Breunig
2013-02-23 09:28:38 +01:00
parent f3d19d1085
commit dabf808e8e

View File

@ -5,7 +5,7 @@
// @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/plugins/show-address.user.js // @updateURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/show-address.user.js
// @downloadURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/show-address.user.js // @downloadURL https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/plugins/show-address.user.js
// @description Portal address will show in the sidebar. // @description Portal address will show in the sidebar.
// @include http://www.ingress.com/intel* // @include http://www.ingress.com/intel*
// @match http://www.ingress.com/intel* // @match http://www.ingress.com/intel*
// ==/UserScript== // ==/UserScript==
@ -21,19 +21,21 @@ if(typeof window.plugin !== 'function') window.plugin = function() {};
window.plugin.portalAddress = function() {}; window.plugin.portalAddress = function() {};
window.plugin.portalAddress.portalDetail = function(data) { window.plugin.portalAddress.portalDetail = function(data) {
//If there's 4 sets of comma delimieted info the last one is the country, so get rid of it. If the country // If there's 4 sets of comma delimieted info the last one is the
//is in the [2] then it doesn't matter because address is usually short enough to fit. // country, so get rid of it. If the country is in the [2] then it
var address = data.portalDetails.portalV2.descriptiveText.ADDRESS.split(',').splice(0,3).join(','); // doesn't matter because address is usually short enough to fit.
var d = data.portalDetails.portalV2;
var address = d.descriptiveText.ADDRESS.split(',').splice(0,3).join(',');
$('.imgpreview').append('<div id="address">'+address+'</div>'); $('.imgpreview').append('<div id="address">'+address+'</div>');
} }
var setup = function() { var setup = function() {
window.addHook('portalDetailsUpdated', window.plugin.portalAddress.portalDetail); window.addHook('portalDetailsUpdated', window.plugin.portalAddress.portalDetail);
$('head').append('<style>' + $('head').append('<style>' +
'.res #address { border: 1px solid #0076b6; }' + '.res #address { border: 1px solid #0076b6; }' +
'.enl #address { border: 1px solid #017f01; }' + '.enl #address { border: 1px solid #017f01; }' +
'#address{ margin:5px; padding:3px; margin-top:120px; margin-right:8px; font-size:11px; background-color:rgba(0, 0, 0, 0.7); text-align:center; white-space:nowrap; overflow:hidden;}' + '#address { margin:5px; padding:3px; margin-top:120px; margin-right:8px; font-size:11px; background-color:rgba(0, 0, 0, 0.7); text-align:center; white-space:nowrap; overflow:hidden; }' +
'</style>'); '</style>');
} }
// PLUGIN END ////////////////////////////////////////////////////////// // PLUGIN END //////////////////////////////////////////////////////////