/** * Created by Pegaasus on 2015-03-21. */ // ==UserScript== // @name Panoramio - Easy and Enhanced Photo Viewer - linked with Google and Wikimapia maps. // @description A faster and easier way to explore 80 million images, handy EXIF image data/information, the place where it was taken and latitude/longitude. - Travel around the world, without leaving you secure home. // @namespace GCMP-EEPW-20150306-SDF-MOFM // @version 0.50 // @include https://maps.google.*/maps* // @match https://maps.google.se/maps* // @match http://static.panoramio.com/photos/*.jpg // @match http://www.panoramio.com/map* // @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js // @require https://greasyfork.org/scripts/17293-alert/code/$alert.js?version=109035 // @grant GM_getValue // @grant GM_setValue // @grant GM_deleteValue // @grant GM_xmlhttpRequest // @created 2015-03-06 // @released 2015-00-00 // @updated 2015-00-00 // @history @version 0.25 - Alpha version: @released - 2015-03-12 // @history @version 0.45 - Beta version: @released - 2015-03-17 // @history @version 0.5 - RC version: @released - 2016-02-21 // @compatible Greasemonkey, Tampermonkey // @license GNU GPL v3 (http://www.gnu.org/copyleft/gpl.html) // @copyright 2015+, Magnus Fohlström // @downloadURL https://update.greasyfork.icu/scripts/8637/Panoramio%20-%20Easy%20and%20Enhanced%20Photo%20Viewer%20-%20linked%20with%20Google%20and%20Wikimapia%20maps.user.js // @updateURL https://update.greasyfork.icu/scripts/8637/Panoramio%20-%20Easy%20and%20Enhanced%20Photo%20Viewer%20-%20linked%20with%20Google%20and%20Wikimapia%20maps.meta.js // ==/UserScript== /*jshint -W014, -W030, -W082*/ // -W014, laxbreak, Bad line breaking before '+' // -W030, Expected assignment or function call instead saw an expression (function($){ GM_getValue('startState') === undefined && GM_setValue('startState','Large'); $.fn.waitUntilExists = function (handler, shouldRunHandlerOnce, isChild){ var found = 'found', $this = $(this.selector), $elements = $this.not(function () { return $(this).data(found); }).each(handler).data(found, true); if( !isChild ) { (window.waitUntilExists_Intervals = window.waitUntilExists_Intervals || {})[this.selector] = window.setInterval(function () { $this.waitUntilExists( handler, shouldRunHandlerOnce, true); }, 500); } else if (shouldRunHandlerOnce && $elements.length){ window.clearInterval(window.waitUntilExists_Intervals[this.selector]); } return $this; }; String.prototype.formatString = function(){ return this.toString() .split(/\s+/g).join(' ') .split('{').join('{\n\t') .split('; ').join(';') .split(';').join(';\n\t') .split('*/').join('*/\n') .split('}').join('}\n'); }; var glob = { img: '000.000', startState: function(){ n = GM_getValue('startState'); return n }, locDoc: window.location.href }, f = { logState: 9, l: function( name, fn, showthis ){ ( this.logState !== 0 && this.logState == (showthis || this.logState) || this.logState == 'all' ) && console.log( name, fn !== undefined ? fn : '' ); }, i: function( name, fn, showthis ){ ( this.logState !== 0 && this.logState == (showthis || this.logState) || this.logState == 'all' ) && console.info( name, fn !== undefined ? fn : '' ); }, ms: 0, timer: function (ms){ this.ms = ms; setTimeout(function(){ f.ms = 0; }, ms); }, getRotate: function(){ var n; n = parseInt( $( '.largePanorama').attr('data-rotate') ); return n; }, calcFlipRotate: function(){ var flip = $( '#flip'), theImg = $('.theImg'), HFlipped, VFlipped, tw, th; HFlipped = flip.find('.flipHorizontal').hasClass('flipped') ? '-1' : '1'; VFlipped = flip.find('.flipVertical').hasClass('flipped') ? '-1' : '1'; var Newr, corr, r = f.getRotate(); f.l('r', r, 8); Newr = r == 90 || r == 270; f.l('r',Newr, 8); tw = r == 90 || r == 270 ? theImg.height() : theImg.width(); th = r == 90 || r == 270 ? theImg.width() : theImg.height(); // corr = r == 90 || r == 270 ? 'translate(12.4%,16.75%' : ''; f.l('WWWW',tw, 8); f.l('HHHH',th, 8); // $( '#middle').css('cssText','width:'+( tw )+'px; height:'+( th )+'px;'); setTimeout(function(){ theImg.css('cssText','transform: scale('+HFlipped+','+VFlipped+') rotateZ('+( r )+'deg);'); },256); setTimeout(function(){ // $( '#middle').css('cssText','width:'+( tw )+'px; height:'+( th )+'px;') },1); }, closeLargePanorama: function(){ $( '.largePanorama').hide( 256 ).delay( 256 ).queue(function(){ $( this ).remove(); }); } }, css = { firstPointerCss: function(){ return 'img[src*="/photos/small/"] {' + 'cursor: pointer !important;' + '}' + '#Thumbholder > * {' + 'width: 311px !important;' + '}' + '#firstThumbholder > .gm-style-iw {' + 'position: absolute;' + 'width: 100% !important;' + 'left: 3px !important;' + '}' + '.gm-style-iw > div {' + 'overflow: hidden;' + 'width: 110%;' + 'max-width: 100% !important;' + '}' + '#firstThumbholder {' + 'width: 307px !important;' + 'position: relative !important;' + '}' + '.map-info-window {' + 'width: 306px;' + '}' + '.map-info-window-title {' + 'width: 290px;' + '}' + '.map-info-window-img-outer {' + 'width: 306px;' + '}' + '.gm-style .map-info-window-img-inner img {' + 'width: 282px;' + '}' + '.map-info-window-img-footer {' + 'width: 281px;' + '}' + '.map-info-window-img-footer-name {' + 'max-width: calc( 100% - 68px );' + '}' + '.map-info-window-img-footer-name a {' + 'height: 16px;' + 'display: block;' + 'overflow: hidden;' + '}'; }, fontsCss : function(){ return '@import url(https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.css);'; }, navBarInner : function(){ return '.linkTo {' + 'float: left;' + 'line-height: 52px;' + 'height: 52px;' + 'display: inline-block;' + 'width: 152px;' + 'overflow: hidden;' + 'color: wheat;' + '}' + '.linkTo a {' + 'color: rgba(255, 255, 255, 0.75);' + 'font-size: 18px;' + '}'; }, details : function(){ return '.largePanorama #imageDetails {' + 'position: absolute;' + 'display: none;' + 'top: 50%;' + 'left: 50%;' + 'transform: translate(-50%,-50%);' + 'z-index: 30000;' + '}' + '.largePanorama .interim-info-card {' + 'padding: 15px;' + 'margin: 0 0 13px;' + 'background-color: rgba(255, 255, 255, 0.85);' + 'border-radius: 15px;' + 'border-color: rgba(123, 123, 123, 0.85);' + 'border-width: 3px;' + 'border-style: outset;' + 'box-shadow: 2px 2px 8px 4px rgba(0, 0, 0, 0.4);' + '}' + '.largePanorama .justImg {' + 'display: inline-block;' + 'width: 100%;' + 'margin-left: 0px;' + '}' + '.largePanorama .justImg span {' + 'margin-right: 25px;' + '}' + '.largePanorama .interim-info-card>h2 {' + 'margin: 0 0 5px;' + 'font-size: 16px;' + 'font-weight: normal;' + 'text-align: center;' + 'line-height: 40px;' + '}' + '.largePanorama .interim-info-card a {' + 'color: rgb(0, 0, 222) !important;' + '}' + '.largePanorama #details {' + 'margin: 0;' + 'padding: 0;' + 'list-style: none;' + '}' + '.largePanorama #details li {' + 'margin-bottom: 6px;' + 'padding-top: 0;' + 'font-size: 13px;' + 'color: #999;' + 'clear: both;' + '}' + '.largePanorama #map_info_breadcrumbs {' + 'margin-top: 15px;' + 'text-align: center;' + '}' + '.largePanorama #place {' + 'color: #999;' + '}' + '.largePanorama h2, .largePanorama #place, .largePanorama #details * {' + 'color: rgb(66, 66, 66) !important;' + '}' + '.largePanorama .geo {' + 'margin-top: 5px;' + '}'; }, mainCss : function(){ return '.largePanorama {' + 'position: absolute;' + 'top: 50%;' + 'left: 50%;' + 'transform: translate(-50%,-50%);' + 'z-index: 10000;' + 'border-radius: 15px;' + 'padding: 0px 6px 20px;' + 'border-width: 3px;' + 'border-style: outset;' + 'border-color: rgba(127, 127, 127, 0.31);' + 'background-color: rgba(236, 236, 236, 0.85);' + 'box-shadow: 5px 5px 20px 10px rgba(0, 33, 32, 0.31);' + '}' + '.largePanorama > img.theImg {' + 'border-width: 3px;' + 'border-style: inset;' + 'border-color: rgba(255, 255, 255, 0.6);' + 'background-color: rgba(144, 144, 144, 0.65);' + 'box-shadow: 4px 2px 20px 1px rgba(170, 170, 170, 0.85);' + 'transform: rotate(0deg);' + '}' + '.largePanorama a {' + 'color: #15c;' + '}' + '.largePanorama .zoom, .largePanorama .close, .largePanorama .Size, ' + '.largePanorama #top, .largePanorama #bottom, ' + '.largePanorama .pano, .largePanorama .more, .largePanorama #rotate span {' + 'cursor: pointer;' + '}' + '.largePanorama .TheTitle {' + 'line-height: 35px;' + 'float: left;' + 'height: 35px;' + 'z-index: 15000;' + 'width: calc(100% - 150px) !important' + '}' + '.largePanorama .TheTitle b {' + 'float: left;' + 'cursor: initial;' + 'max-width: calc(100% - 0px) !important;' + '}' + '.mainSub {' + 'position: relative;' + '}' + '.largePanorama #top {' + 'height: 35px;' + 'line-height: 35px;' + '}' + '.largePanorama .mainClick {' + 'position: absolute;' + 'z-index: 11000;' + 'cursor: pointer;' + '}' + '.largePanorama #middle {' + 'height: calc(100% + 9px) !important;' + '}' + '.largePanorama #middle #over {' // + 'background-color: rgba(76, 131, 180, 0.28);' + 'width: 100%;' + 'height: 50%;' + 'top: 0;' + '}' + '.largePanorama #middle #under {' // + 'background-color: rgba(65, 65, 7, 0.34);' + 'width: 100%;' + 'height: 50%;' + 'bottom: 1px;' + '}' + '.largePanorama #middle .mainSub {' + 'position: relative;' + '}' + '.largePanorama #middle img {' + 'position: relative;' + 'z-index: 10500;' + '}' + '.largePanorama #bottom {' + 'position: absolute;' + 'width: calc(100% - 12px);' + 'height: 20px;' + '}' + '.largePanorama .map-info-window-img-footer{' + 'width: calc(100% - 18px);' + '}' + '.largePanorama .pano {' + 'position: absolute;' + 'bottom: 3px;' + 'width: calc(100% - 2px);' + 'margin-left: 1px;' + '}'; }, moreCss : function(){ return '.largePanorama .more {' + 'float: right;' + 'z-index: 20000;' + '}' + '.largePanorama .more ul {' + 'display: none;' + 'position: absolute;' + 'padding: 4px 4px 4px 3px;' + 'margin-top: -14px;' + 'margin-left: -24px;' + 'border-style: outset;' + 'border-width: 2px;' + 'border-radius: 8px;' + 'border-color: rgb(209, 209, 209);' + 'background-color: rgba(215, 215, 215, 0.85);' + 'box-shadow: 1px 2px 8px 3px rgba(0, 60, 62, 0.27);' + 'z-index: 20000;' + '}' + '.largePanorama .more ul li {' + 'border-radius: 4px;' + 'line-height: 35px;' + 'padding: 0 10px;' + '}' + '.largePanorama .more ul li:hover {' + 'background-color: rgb(104, 122, 138);' + '}' + '.largePanorama .more ul li a {' + 'color: rgb(0, 36, 47);' + 'text-decoration: none;' + 'white-space: nowrap;' + '}' + '.largePanorama .more ul li:hover a {' + 'color: aliceblue;' + '}' + '.largePanorama .moreArrow.skiptranslate {' + 'font-size: 20px;' + 'height: 35px;' + 'right: 0;' + 'padding: 0 5px;' + 'position: absolute;' + 'float: right;' + '}' + '.largePanorama .moreArrow.skiptranslate:hover {' + 'color: blue !important;' + '}'; }, toolBoxCss : function(){ return '#toolBox {' + 'float: right;' + 'margin-right: 12px;' + 'width: 118px;' + 'padding: 0 10px;' + 'z-index: 50000;' + 'display: none;' + '}' + '#toolBox>div>span {' + 'padding: 0 6px;' + 'display: inline-block;' + '}' + '#rotate {' + 'float: right;' + '}' + '#flip {' + 'float: left;' + '}' + '#toolBox span:hover, .more:hover, .moreArrow:hover {' + 'box-shadow: 0px -1px 18px 6px rgba(229, 229, 229, 1);' + 'background-color: rgba(227, 228, 228, 1);' + 'height: 35px;' + 'color: rgb(40, 38, 211);' + '}'; }, sizeCss : function(){ return '.largePanorama .Size {' + 'position: absolute;' + 'z-index: 1000;' + 'bottom: 0px;' + 'left: 50%;' + 'transform: translate(-50%);' + 'white-space: nowrap;' + '}' + '.largePanorama .Size span {' + 'padding: 0 8px;' + 'display: inline-block;' + 'height: 18px;' + '}' + '.largePanorama .Size span:hover {' + 'box-shadow: 0px -5px 20px 9px rgba(229, 229, 229, 1);' + 'background-color: rgba(229, 229, 229, 1);' + '}' + '.largePanorama .Size a {' + 'color: black;' + 'position: relative;' + 'text-decoration: none;' + '}'; }, naturalWidth : function( naturalWidth ){ return '.largePanorama #top, .largePanorama #middle { width: '+ naturalWidth +'px !important; }'; }, style : function( id, var1, var2 ){ var $id = $( 'head #' + id ), cssID = css[ id ]( var1, var2 ).formatString(); $id.length ? $id.html( cssID ) : $( $( '').appendTo( 'head' ); }, 424); setInterval(function(){ var link = $('a.widget-titlecard-attribution-link').attr('data-attribution-url'), arrays = link.split('/'), locDoc = window.location.href; link.search('ssl.panoramio.com') > 0 && locDoc.search( arrays[4] ) == -1 && ( console.log('chk', locDoc.search( arrays[4] ) ), $('.panoramio_switcher').remove(), setTimeout(function(){ switcher(); },512) ); }, 2500); }, 1524); }); //----------------------------------------------------------------------------------------------------------// // The END // //----------------------------------------------------------------------------------------------------------// $( document ).on('click','*',function(e){ this == e.target && console.log('target',e.target); }); f.l('google maps'); $( document ).ready(function() { html.headLinks(); }); }(jQuery));