Panoramio - Easy and Enhanced Photo Viewer - linked with Google and Wikimapia maps.

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.

  1. /**
  2. * Created by Pegaasus on 2015-03-21.
  3. */
  4.  
  5. // ==UserScript==
  6. // @name Panoramio - Easy and Enhanced Photo Viewer - linked with Google and Wikimapia maps.
  7. // @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.
  8. // @namespace GCMP-EEPW-20150306-SDF-MOFM
  9. // @version 0.50
  10.  
  11. // @include https://maps.google.*/maps*
  12. // @match https://maps.google.se/maps*
  13. // @match http://static.panoramio.com/photos/*.jpg
  14. // @match http://www.panoramio.com/map*
  15.  
  16. // @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
  17. // @require https://greatest.deepsurf.us/scripts/17293-alert/code/$alert.js?version=109035
  18.  
  19. // @grant GM_getValue
  20. // @grant GM_setValue
  21. // @grant GM_deleteValue
  22. // @grant GM_xmlhttpRequest
  23.  
  24. // @created 2015-03-06
  25. // @released 2015-00-00
  26. // @updated 2015-00-00
  27.  
  28. // @history @version 0.25 - Alpha version: @released - 2015-03-12
  29. // @history @version 0.45 - Beta version: @released - 2015-03-17
  30. // @history @version 0.5 - RC version: @released - 2016-02-21
  31.  
  32. // @compatible Greasemonkey, Tampermonkey
  33. // @license GNU GPL v3 (http://www.gnu.org/copyleft/gpl.html)
  34. // @copyright 2015+, Magnus Fohlström
  35. // ==/UserScript==
  36.  
  37. /*jshint -W014, -W030, -W082*/
  38. // -W014, laxbreak, Bad line breaking before '+'
  39. // -W030, Expected assignment or function call instead saw an expression
  40.  
  41.  
  42. (function($){
  43.  
  44. GM_getValue('startState') === undefined && GM_setValue('startState','Large');
  45.  
  46. $.fn.waitUntilExists = function (handler, shouldRunHandlerOnce, isChild){
  47. var found = 'found',
  48. $this = $(this.selector),
  49. $elements = $this.not(function () { return $(this).data(found); }).each(handler).data(found, true);
  50. if( !isChild ) {
  51. (window.waitUntilExists_Intervals = window.waitUntilExists_Intervals || {})[this.selector] =
  52. window.setInterval(function () {
  53. $this.waitUntilExists(
  54. handler, shouldRunHandlerOnce, true);
  55. }, 500);
  56. }
  57. else if (shouldRunHandlerOnce && $elements.length){
  58. window.clearInterval(window.waitUntilExists_Intervals[this.selector]);
  59. }
  60. return $this;
  61. };
  62. String.prototype.formatString = function(){
  63. return this.toString()
  64. .split(/\s+/g).join(' ')
  65. .split('{').join('{\n\t')
  66. .split('; ').join(';')
  67. .split(';').join(';\n\t')
  68. .split('*/').join('*/\n')
  69. .split('}').join('}\n');
  70. };
  71.  
  72. var glob = {
  73. img: '000.000',
  74. startState: function(){ n = GM_getValue('startState'); return n },
  75. locDoc: window.location.href
  76. },
  77. f = {
  78. logState: 9,
  79. l: function( name, fn, showthis ){
  80. ( this.logState !== 0 && this.logState == (showthis || this.logState) || this.logState == 'all' ) &&
  81. console.log( name, fn !== undefined ? fn : '' );
  82. },
  83. i: function( name, fn, showthis ){
  84. ( this.logState !== 0 && this.logState == (showthis || this.logState) || this.logState == 'all' ) &&
  85. console.info( name, fn !== undefined ? fn : '' );
  86. },
  87. ms: 0,
  88. timer: function (ms){
  89. this.ms = ms;
  90. setTimeout(function(){ f.ms = 0; }, ms);
  91. },
  92. getRotate: function(){ var n; n = parseInt( $( '.largePanorama').attr('data-rotate') ); return n; },
  93. calcFlipRotate: function(){
  94. var flip = $( '#flip'), theImg = $('.theImg'), HFlipped, VFlipped, tw, th;
  95.  
  96. HFlipped = flip.find('.flipHorizontal').hasClass('flipped') ? '-1' : '1';
  97. VFlipped = flip.find('.flipVertical').hasClass('flipped') ? '-1' : '1';
  98. var Newr, corr, r = f.getRotate();
  99. f.l('r', r, 8);
  100. Newr = r == 90 || r == 270;
  101. f.l('r',Newr, 8);
  102. tw = r == 90 || r == 270 ? theImg.height() : theImg.width();
  103. th = r == 90 || r == 270 ? theImg.width() : theImg.height();
  104. // corr = r == 90 || r == 270 ? 'translate(12.4%,16.75%' : '';
  105. f.l('WWWW',tw, 8);
  106. f.l('HHHH',th, 8);
  107. // $( '#middle').css('cssText','width:'+( tw )+'px; height:'+( th )+'px;');
  108. setTimeout(function(){
  109. theImg.css('cssText','transform: scale('+HFlipped+','+VFlipped+') rotateZ('+( r )+'deg);');
  110. },256);
  111. setTimeout(function(){
  112. // $( '#middle').css('cssText','width:'+( tw )+'px; height:'+( th )+'px;')
  113. },1);
  114. },
  115. closeLargePanorama: function(){
  116. $( '.largePanorama').hide( 256 ).delay( 256 ).queue(function(){
  117. $( this ).remove();
  118. });
  119. }
  120. },
  121. css = {
  122. firstPointerCss: function(){
  123. return 'img[src*="/photos/small/"] {'
  124. + 'cursor: pointer !important;'
  125. + '}'
  126. + '#Thumbholder > * {'
  127. + 'width: 311px !important;'
  128. + '}'
  129. + '#firstThumbholder > .gm-style-iw {'
  130. + 'position: absolute;'
  131. + 'width: 100% !important;'
  132. + 'left: 3px !important;'
  133. + '}'
  134. + '.gm-style-iw > div {'
  135. + 'overflow: hidden;'
  136. + 'width: 110%;'
  137. + 'max-width: 100% !important;'
  138. + '}'
  139. + '#firstThumbholder {'
  140. + 'width: 307px !important;'
  141. + 'position: relative !important;'
  142. + '}'
  143. + '.map-info-window {'
  144. + 'width: 306px;'
  145. + '}'
  146. + '.map-info-window-title {'
  147. + 'width: 290px;'
  148. + '}'
  149. + '.map-info-window-img-outer {'
  150. + 'width: 306px;'
  151. + '}'
  152. + '.gm-style .map-info-window-img-inner img {'
  153. + 'width: 282px;'
  154. + '}'
  155. + '.map-info-window-img-footer {'
  156. + 'width: 281px;'
  157. + '}'
  158. + '.map-info-window-img-footer-name {'
  159. + 'max-width: calc( 100% - 68px );'
  160. + '}'
  161. + '.map-info-window-img-footer-name a {'
  162. + 'height: 16px;'
  163. + 'display: block;'
  164. + 'overflow: hidden;'
  165. + '}';
  166. },
  167. fontsCss : function(){
  168. return '@import url(https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.css);';
  169. },
  170. navBarInner : function(){
  171. return '.linkTo {'
  172. + 'float: left;'
  173. + 'line-height: 52px;'
  174. + 'height: 52px;'
  175. + 'display: inline-block;'
  176. + 'width: 152px;'
  177. + 'overflow: hidden;'
  178. + 'color: wheat;'
  179. + '}'
  180. + '.linkTo a {'
  181. + 'color: rgba(255, 255, 255, 0.75);'
  182. + 'font-size: 18px;'
  183. + '}';
  184. },
  185. details : function(){
  186. return '.largePanorama #imageDetails {'
  187. + 'position: absolute;'
  188. + 'display: none;'
  189. + 'top: 50%;'
  190. + 'left: 50%;'
  191. + 'transform: translate(-50%,-50%);'
  192. + 'z-index: 30000;'
  193. + '}'
  194.  
  195. + '.largePanorama .interim-info-card {'
  196. + 'padding: 15px;'
  197. + 'margin: 0 0 13px;'
  198. + 'background-color: rgba(255, 255, 255, 0.85);'
  199. + 'border-radius: 15px;'
  200. + 'border-color: rgba(123, 123, 123, 0.85);'
  201. + 'border-width: 3px;'
  202. + 'border-style: outset;'
  203. + 'box-shadow: 2px 2px 8px 4px rgba(0, 0, 0, 0.4);'
  204. + '}'
  205. + '.largePanorama .justImg {'
  206. + 'display: inline-block;'
  207. + 'width: 100%;'
  208. + 'margin-left: 0px;'
  209. + '}'
  210. + '.largePanorama .justImg span {'
  211. + 'margin-right: 25px;'
  212. + '}'
  213. + '.largePanorama .interim-info-card>h2 {'
  214. + 'margin: 0 0 5px;'
  215. + 'font-size: 16px;'
  216. + 'font-weight: normal;'
  217. + 'text-align: center;'
  218. + 'line-height: 40px;'
  219. + '}'
  220. + '.largePanorama .interim-info-card a {'
  221. + 'color: rgb(0, 0, 222) !important;'
  222. + '}'
  223. + '.largePanorama #details {'
  224. + 'margin: 0;'
  225. + 'padding: 0;'
  226. + 'list-style: none;'
  227. + '}'
  228. + '.largePanorama #details li {'
  229. + 'margin-bottom: 6px;'
  230. + 'padding-top: 0;'
  231. + 'font-size: 13px;'
  232. + 'color: #999;'
  233. + 'clear: both;'
  234. + '}'
  235. + '.largePanorama #map_info_breadcrumbs {'
  236. + 'margin-top: 15px;'
  237. + 'text-align: center;'
  238. + '}'
  239. + '.largePanorama #place {'
  240. + 'color: #999;'
  241. + '}'
  242. + '.largePanorama h2, .largePanorama #place, .largePanorama #details * {'
  243. + 'color: rgb(66, 66, 66) !important;'
  244. + '}'
  245. + '.largePanorama .geo {'
  246. + 'margin-top: 5px;'
  247. + '}';
  248. },
  249. mainCss : function(){
  250. return '.largePanorama {'
  251. + 'position: absolute;'
  252. + 'top: 50%;'
  253. + 'left: 50%;'
  254. + 'transform: translate(-50%,-50%);'
  255. + 'z-index: 10000;'
  256. + 'border-radius: 15px;'
  257. + 'padding: 0px 6px 20px;'
  258. + 'border-width: 3px;'
  259. + 'border-style: outset;'
  260. + 'border-color: rgba(127, 127, 127, 0.31);'
  261. + 'background-color: rgba(236, 236, 236, 0.85);'
  262. + 'box-shadow: 5px 5px 20px 10px rgba(0, 33, 32, 0.31);'
  263. + '}'
  264.  
  265. + '.largePanorama > img.theImg {'
  266. + 'border-width: 3px;'
  267. + 'border-style: inset;'
  268. + 'border-color: rgba(255, 255, 255, 0.6);'
  269. + 'background-color: rgba(144, 144, 144, 0.65);'
  270. + 'box-shadow: 4px 2px 20px 1px rgba(170, 170, 170, 0.85);'
  271. + 'transform: rotate(0deg);'
  272. + '}'
  273. + '.largePanorama a {'
  274. + 'color: #15c;'
  275. + '}'
  276.  
  277. + '.largePanorama .zoom, .largePanorama .close, .largePanorama .Size, '
  278. + '.largePanorama #top, .largePanorama #bottom, '
  279. + '.largePanorama .pano, .largePanorama .more, .largePanorama #rotate span {'
  280. + 'cursor: pointer;'
  281. + '}'
  282.  
  283. + '.largePanorama .TheTitle {'
  284. + 'line-height: 35px;'
  285. + 'float: left;'
  286. + 'height: 35px;'
  287. + 'z-index: 15000;'
  288. + 'width: calc(100% - 150px) !important'
  289. + '}'
  290. + '.largePanorama .TheTitle b {'
  291. + 'float: left;'
  292. + 'cursor: initial;'
  293. + 'max-width: calc(100% - 0px) !important;'
  294. + '}'
  295.  
  296. + '.mainSub {'
  297. + 'position: relative;'
  298. + '}'
  299.  
  300. + '.largePanorama #top {'
  301. + 'height: 35px;'
  302. + 'line-height: 35px;'
  303. + '}'
  304.  
  305. + '.largePanorama .mainClick {'
  306. + 'position: absolute;'
  307. + 'z-index: 11000;'
  308. + 'cursor: pointer;'
  309. + '}'
  310. + '.largePanorama #middle {'
  311. + 'height: calc(100% + 9px) !important;'
  312. + '}'
  313. + '.largePanorama #middle #over {'
  314. // + 'background-color: rgba(76, 131, 180, 0.28);'
  315. + 'width: 100%;'
  316. + 'height: 50%;'
  317. + 'top: 0;'
  318. + '}'
  319. + '.largePanorama #middle #under {'
  320. // + 'background-color: rgba(65, 65, 7, 0.34);'
  321. + 'width: 100%;'
  322. + 'height: 50%;'
  323. + 'bottom: 1px;'
  324. + '}'
  325. + '.largePanorama #middle .mainSub {'
  326. + 'position: relative;'
  327. + '}'
  328. + '.largePanorama #middle img {'
  329. + 'position: relative;'
  330. + 'z-index: 10500;'
  331. + '}'
  332.  
  333. + '.largePanorama #bottom {'
  334. + 'position: absolute;'
  335. + 'width: calc(100% - 12px);'
  336. + 'height: 20px;'
  337. + '}'
  338.  
  339. + '.largePanorama .map-info-window-img-footer{'
  340. + 'width: calc(100% - 18px);'
  341. + '}'
  342.  
  343. + '.largePanorama .pano {'
  344. + 'position: absolute;'
  345. + 'bottom: 3px;'
  346. + 'width: calc(100% - 2px);'
  347. + 'margin-left: 1px;'
  348. + '}';
  349. },
  350. moreCss : function(){
  351. return '.largePanorama .more {'
  352. + 'float: right;'
  353. + 'z-index: 20000;'
  354. + '}'
  355. + '.largePanorama .more ul {'
  356. + 'display: none;'
  357. + 'position: absolute;'
  358. + 'padding: 4px 4px 4px 3px;'
  359. + 'margin-top: -14px;'
  360. + 'margin-left: -24px;'
  361. + 'border-style: outset;'
  362. + 'border-width: 2px;'
  363. + 'border-radius: 8px;'
  364. + 'border-color: rgb(209, 209, 209);'
  365. + 'background-color: rgba(215, 215, 215, 0.85);'
  366. + 'box-shadow: 1px 2px 8px 3px rgba(0, 60, 62, 0.27);'
  367. + 'z-index: 20000;'
  368. + '}'
  369. + '.largePanorama .more ul li {'
  370. + 'border-radius: 4px;'
  371. + 'line-height: 35px;'
  372. + 'padding: 0 10px;'
  373. + '}'
  374. + '.largePanorama .more ul li:hover {'
  375. + 'background-color: rgb(104, 122, 138);'
  376. + '}'
  377. + '.largePanorama .more ul li a {'
  378. + 'color: rgb(0, 36, 47);'
  379. + 'text-decoration: none;'
  380. + 'white-space: nowrap;'
  381. + '}'
  382. + '.largePanorama .more ul li:hover a {'
  383. + 'color: aliceblue;'
  384. + '}'
  385. + '.largePanorama .moreArrow.skiptranslate {'
  386. + 'font-size: 20px;'
  387. + 'height: 35px;'
  388. + 'right: 0;'
  389. + 'padding: 0 5px;'
  390. + 'position: absolute;'
  391. + 'float: right;'
  392. + '}'
  393. + '.largePanorama .moreArrow.skiptranslate:hover {'
  394. + 'color: blue !important;'
  395. + '}';
  396. },
  397. toolBoxCss : function(){
  398. return '#toolBox {'
  399. + 'float: right;'
  400. + 'margin-right: 12px;'
  401. + 'width: 118px;'
  402. + 'padding: 0 10px;'
  403. + 'z-index: 50000;'
  404. + 'display: none;'
  405. + '}'
  406. + '#toolBox>div>span {'
  407. + 'padding: 0 6px;'
  408. + 'display: inline-block;'
  409. + '}'
  410. + '#rotate {'
  411. + 'float: right;'
  412. + '}'
  413. + '#flip {'
  414. + 'float: left;'
  415. + '}'
  416. + '#toolBox span:hover, .more:hover, .moreArrow:hover {'
  417. + 'box-shadow: 0px -1px 18px 6px rgba(229, 229, 229, 1);'
  418. + 'background-color: rgba(227, 228, 228, 1);'
  419. + 'height: 35px;'
  420. + 'color: rgb(40, 38, 211);'
  421. + '}';
  422. },
  423. sizeCss : function(){
  424. return '.largePanorama .Size {'
  425. + 'position: absolute;'
  426. + 'z-index: 1000;'
  427. + 'bottom: 0px;'
  428. + 'left: 50%;'
  429. + 'transform: translate(-50%);'
  430. + 'white-space: nowrap;'
  431. + '}'
  432. + '.largePanorama .Size span {'
  433. + 'padding: 0 8px;'
  434. + 'display: inline-block;'
  435. + 'height: 18px;'
  436. + '}'
  437. + '.largePanorama .Size span:hover {'
  438. + 'box-shadow: 0px -5px 20px 9px rgba(229, 229, 229, 1);'
  439. + 'background-color: rgba(229, 229, 229, 1);'
  440. + '}'
  441. + '.largePanorama .Size a {'
  442. + 'color: black;'
  443. + 'position: relative;'
  444. + 'text-decoration: none;'
  445. + '}';
  446. },
  447. naturalWidth : function( naturalWidth ){
  448. return '.largePanorama #top, .largePanorama #middle { width: '+ naturalWidth +'px !important; }';
  449. },
  450. style : function( id, var1, var2 ){
  451. var $id = $( 'head #' + id ), cssID = css[ id ]( var1, var2 ).formatString();
  452. $id.length ? $id.html( cssID ) : $( $( '<style/>',{ id: id, class:'mySuperStyles', html: cssID } ) ).appendTo('head');
  453. }
  454. },
  455. // domSel = { main: $('.largePanorama')},
  456. // htmlSel = { main: '.largePanorama' },
  457. html = {
  458. title: null,
  459. bottomLink: null,
  460. imgNr: function(globImg){
  461. globImg = globImg || '000.000';
  462. var n; n = globImg.split('.').shift(); return n; },
  463. wrong: function(globImg){
  464. globImg = globImg || '0' ;
  465. var n; n = 'http://www.panoramio.com/map_photo/?id=' + globImg; return n; },
  466. reload: function(){
  467. var n;
  468. n = glob.locDoc.search('maps.google') > 0 ?
  469. $(document).find('#link').attr('href') : glob.locDoc.search('www.panoramio.com/map') > 0 && window.location.href;
  470. return n;
  471. },
  472. panoPhoto: function(globImg){
  473. globImg = globImg || html.imgNr(glob.img);
  474. var n; n = 'http://www.panoramio.com/photo/' + globImg; return n;
  475. },
  476. panoramioHtmlLink : function( link ){
  477. return $('<a/>', { id: 'panoramioHtmlLink', href: link, text: 'Orginal page' } );
  478. },
  479. UrlConverter: function( domain, inputUrl ){
  480. var url = inputUrl !== undefined ? inputUrl : location.href;
  481. url = domain === 'Google' ?
  482. 'http://maps.google.com/maps/@' + url.split('lt=').pop().split('&ln=').join(',').split('&z').shift() + ',300m/data=!3m1!1e3' :
  483. 'http://wikimapia.org/#lang=en&lat=' + url.split('lt=').pop().split('&ln=').join('&lon=').split('&z').shift() + '&z=16&m=b';
  484. return url;
  485. },
  486. aLink: function( domain, inputUrl ){
  487. return $('<a/>', { id: 'convert' + domain, class:'link', href: this.UrlConverter( domain, inputUrl ), text: domain + ' Maps', target:'_blank' });
  488. },
  489. linkTo: function( domain ){
  490. return $( $('<div/>',{ class:'linkTo', 'data-domain': domain }).html( this.aLink( domain ) ) ).insertAfter( '#explore-wrapper' );
  491. },
  492. headLinks: function(){
  493. css.style('navBarInner');
  494. html.linkTo('Google');
  495. html.linkTo('Wikimapia');
  496. listenerOn.navBarInner();
  497. },
  498. DetailsResults: null,
  499. Details: function(){
  500. //noinspection JSUnusedGlobalSymbols
  501. GM_xmlhttpRequest({
  502. method: "GET",
  503. url: html.panoPhoto(),
  504. crossDomain: true,
  505. //onerror:
  506. onprogress: function(res) {
  507. var msg = "\n\r\t "
  508. + "On progress Report."
  509. // + "\nresponseText: " + res.responseText
  510. + "\nreadyState: " + res.readyState
  511. + "\nresponseHeaders: " + res.responseHeaders
  512. + "\nstatus: " + res.status
  513. + "\nstatusText: " + res.statusText
  514. + "\nfinalUrl: " + res.finalUrl;
  515. // + "\n\nContent-length: " + res.responseHeaders.match('Content-Length: \\d+').toString().split(': ').pop()
  516.  
  517. res.readyState == 4 && console.log(msg);
  518. },
  519. onload: function(res) {
  520. var domain = 'http://www.panoramio.com/map/', href, newVal,
  521. $res = $( res.responseText), bred = $( '<div/>', { id:"map_info_breadcrumbs" }), tmp = $( '<span/>'),
  522. geoLink = 'https://ssl.panoramio.com' + $res.find('#location .geo').find('a').attr('href');
  523.  
  524. bred
  525. .append(
  526. $res.find('#map_info_breadcrumbs').html(),
  527. $( '<span> • </span>' ),
  528. $res.find('#map_info_name a').addClass('local'),
  529. $('<br/>' ),$('<br/>' ),
  530. $res.find('#location .geo').find('a').addClass('point').parent(),
  531. $('<br/>' ),
  532. html.aLink('Wikimapia', geoLink ),
  533. $('<br/>' ),
  534. html.aLink('Google', geoLink ) )
  535. .find('a').each(function( id, el ){
  536. var $el = $( el ), orgHref = $el.attr('href');
  537. newVal = id === 1 ? '9' : id === 2 ? '4' : $el.hasClass('local') ? '0' : $el.hasClass('point') ? '-1' : '';
  538. href = orgHref.split('/map/').pop().split('&z=');
  539. $el.hasClass('link') ||
  540. $el.addClass( 'nr' + id ).attr('href',
  541. orgHref.search('&z=') !== -1 ? href.length > 1 ? href.shift() + '&z=' + newVal + '&k=2' : domain : orgHref );
  542. });
  543.  
  544. tmp.append(
  545. $res.find('#details').parent() ).find('.interim-info-card')
  546. .append( bred )
  547. .prepend( html.bottomLink.clone().addClass('justImg')
  548. .append( html.panoramioHtmlLink( html.panoPhoto() ) )).end()
  549. .find('.pano').removeClass('pano');
  550.  
  551. $( '<div/>', { id:"imageDetails", html: tmp.html() }).appendTo( '.largePanorama' );
  552. }
  553. });
  554. },
  555. insertMore: [
  556. '<div class="more"><span class="moreArrow skiptranslate">?</span>',
  557. '<ul>',
  558. '<li><a class="reLoad" target="_self" href="">Reload Map this Location</a></li>',
  559. '<li><a class="linkOrginal" target="_blank" href="">Orginal in new TAB</a></li>',
  560. '<li><a class="wrongLink" target=" _blank" href="">Suggest new Location</a></li>',
  561. '<li><a class="imageFlipRotate">Image Flip-Rotate</a></li>',
  562. '<li><a class="imageDetails">Image Details</a></li>',
  563. '<li><a class="configStartState">Default Size</a></li>',
  564. '</ul>',
  565. '</div>'].join(''),
  566. main: [
  567. '<div class="largePanorama" data-rotate="0" data-state="" style="">',
  568. '<div id="top" class="mainSub"></div>',
  569. '<div id="middle" class="mainSub">',
  570. '<div id="over" class="mainClick zoomPano"></div>',
  571. '<div id="under" class="mainClick closePano"></div>',
  572. '</div>',
  573. '<div id="bottom" class="mainSub"></div>',
  574. '</div>'].join(''),
  575. size: [
  576. '<div class="Size">',
  577. '<span class="LargeBottomLink"><a target=" _blank" href="">Normal: </a></span>',
  578. '<span class="HugeBottomLink"><a target=" _blank" href="">Large: </a></span>',
  579. '<span class="OrginalBottomLink"><a target=" _blank" href="">Orginal: </a></span>',
  580. '</div>'].join(''),
  581. insertToolBox: [
  582. '<div id="toolBox">',
  583. '<div id="rotate">',
  584. '<span class="rotates rotateLeft skiptranslate">RL</span>',
  585. '<span class="rotates rotateRight skiptranslate">RR</span>',
  586. '</div>',
  587. '<div id="flip">',
  588. '<span class="flip flipVertical skiptranslate"><span id="up" class="fp">VF</span></span>',
  589. '<span class="flip flipHorizontal skiptranslate"><span id="left" class="fp">HF</span></span>',
  590. '</div>',
  591. '</div>'].join('')
  592. },
  593. // listenerOff = {zoomClose: function(){}},
  594. listenerOn = {
  595. ZoomState: null,
  596. zoomClose: function(){
  597. var state,waitOnLoad,
  598. img = $( '.theImg'),
  599. main = $('.largePanorama'),
  600. newImg = new Image();
  601. $( '.zoomPano' ).on('mousedown', function(e){
  602. e.which == 1 && this == e.target && (
  603. waitOnLoad = setInterval(function(){
  604. state = main.attr('data-state') == 'Huge' ? 'Large':'Huge';
  605. $( '.' + state + 'BottomLink.loaded' ).length && (
  606. clearInterval( waitOnLoad ),
  607. newImg.src = loadImg[ state ](),
  608. img.attr('src', loadImg[ state ]() ),
  609. f.calcFlipRotate(),
  610. main.attr('data-state', state ),
  611. newImg.onload = function(){
  612. css.style('naturalWidth', newImg.naturalWidth );
  613. } );
  614. }, 5 ) ); });
  615. $( '.closePano' ).on('mouseup', function(e){
  616. e.which == 1 && this == e.target && f.closeLargePanorama(); });
  617. },
  618. moreMenu: function(){
  619. $( '.moreArrow, .moreArrow font, .more' ).on('mousedown', function(e) {
  620. e.which == 1 && this == e.target && (
  621. $( '.more ul' ).show(), f.timer( 512 ),
  622. $( '.reLoad' ).attr('href', $(document).find('#link').attr('href') ) ); });
  623. $( '.more ul' ).on('mouseleave', function(e) {
  624. f.ms === 0 && this == e.target && $( this ).hide(); });
  625. $( '.more li a' ).on('click', function(e) {
  626. f.ms === 0 && e.which == 1 && this == e.target && $( '.more ul' ).hide(); });
  627. $( '.configStartState' ).on('click', function(e) {
  628. e.which == 1 && this == e.target && (
  629. GM_setValue('startState', $('.largePanorama').attr('data-state') ) )
  630. });
  631. $( '.imageFlipRotate' ).on('mouseup', function(e) {
  632. var LPano = $( '.largePanorama'), toolbox = $('#toolBox');
  633. e.which == 1 && this == e.target && (
  634. toolbox.is(':visible') ? toolbox.hide() : toolbox.show(),
  635. $( '.rotates' ).on('click', function(e) {
  636. var rotate = f.getRotate();
  637. e.which == 1 && this == e.target && (
  638. rotate = $( this ).hasClass('rotateRight') ? ( rotate == 270 ? 0 : rotate + 90 ):( rotate === 0 ? 270 : rotate - 90 ),
  639. LPano.attr('data-rotate', rotate ).delay(2).queue(function(n){
  640. f.calcFlipRotate(); n(); }) );
  641. }),
  642. $('.fp').on('click', function(e) {
  643. e.which == 1 && this == e.target && (
  644. $(this).parent().toggleClass('flipped').delay(2).queue(function(n){
  645. f.calcFlipRotate(); n(); }) );
  646. }))});
  647. },
  648. navBarInner: function(){
  649. $( document ).on('mouseenter', '.linkTo', function(){
  650. var domain = $( this ).data('domain');
  651. $( '#convert' + domain ).attr( 'href', html.UrlConverter( domain ) ); });
  652. },
  653. closeLargePanorama: function(){
  654. $( document ).on('mousedown', '#map > .gm-style > div > div', function(){
  655. f.closeLargePanorama();
  656. });
  657. },
  658. detailsPhoto: function(){
  659. $( '.imageDetails, #top, #bottom, .pano, .TheTitle' ).on('mouseup', function(e) {
  660. var elemLoc = $( '#imageDetails' );
  661. f.ms === 0 && e.which == 1 && this == e.target && ( f.timer(64), elemLoc[ elemLoc.is(':hidden') ? 'show' : 'hide' ](128) ); });
  662. $( document ).on('mouseleave', '#imageDetails', function() {
  663. $( this ).hide(256); });
  664. }//,
  665. //flipRotate: function(){ }
  666. },
  667. render = {
  668. mainHtml: function(){
  669.  
  670. var htmlImgNr = html.imgNr( glob.img ),
  671. main = $( html.main ),
  672. newImg = new Image();
  673.  
  674. newImg.src = loadImg[ glob.startState() == 'Large' ? 'Large' : 'Huge' ]();
  675. newImg.onload = function(){
  676. css.style('naturalWidth', newImg.naturalWidth );
  677. };
  678.  
  679. css.style('fontsCss');
  680. css.style('navBarInner');
  681. css.style('mainCss');
  682. css.style('moreCss');
  683. css.style('toolBoxCss');
  684.  
  685. main.addClass( htmlImgNr )
  686. .find( '#middle' ).append( loadImg.startImg ).end()
  687. .find( '#top' ).append( html.title ).end()
  688. .find( '#bottom' ).append(
  689. html.bottomLink.find('.map-info-window-img-footer-logo a').attr('href', html.panoPhoto() ) ).end()
  690. .find( '#top' ).append( html.insertMore ).end()
  691. .find( '#middle img' ).addClass('theImg');
  692.  
  693. $('body').append( main ).delay(1).queue(function(){
  694. $('.largePanorama')
  695. .find( '.reLoad').attr('href', html.reload() ).end()
  696. .find( '.linkOrginal').attr('href', loadImg.Orginal() ).end()
  697. .find( '.wrongLink').attr('href', html.wrong( htmlImgNr ) ).end()
  698. .find( '#bottom img').closest('div').addClass('pano');
  699. });
  700.  
  701. css.style('details');
  702. html.Details();
  703. render.sizePre();
  704.  
  705. setTimeout(function(){
  706. $('.largePanorama').attr('data-state', GM_getValue('startState') );
  707. listenerOn.zoomClose();
  708. render.size();
  709. listenerOn.moreMenu();
  710. listenerOn.detailsPhoto();
  711. listenerOn.closeLargePanorama();
  712. $( html.insertToolBox ).appendTo('#top');
  713. },24);
  714. },
  715. sizePre: function(){
  716. var Size = $( html.size );
  717. css.style('sizeCss');
  718. Size.find('span').append('<i class="fa fa-spinner fa-pulse fa-1x fa-fw" style="width: 20px"></i>');
  719. $('#bottom').append( Size );
  720. },
  721. size: function() {
  722. var chk = {
  723. Loaded : setInterval(function(){
  724. var Huge = $('.HugeBottomLink'), Orginal = $('.OrginalBottomLink'), Large = $('.LargeBottomLink');
  725. $('.Size .loaded').length === 3 && (
  726. clearInterval( chk.Loaded ),
  727. Huge.data('size') === Orginal.data('size') && Orginal.hide(),
  728. Large.data('size') === Huge.data('size') && Huge.hide(),
  729. $('.Size span').each(function(id, el) {
  730. $(el).text().search('0x0') > 0 && $(el).hide(); }) );
  731. }, 10),
  732. tSize : function( size ){
  733. var sizes = loadImg[ size + 'Size' ],
  734. link = $('.' + size + 'BottomLink');
  735. link.length !== 0 && sizes.length > 2 && (
  736. clearInterval( chk[ size ] ),
  737. link.find('i').hide( 512 ).end()
  738. .not('.loaded').addClass('loaded').attr('data-size', sizes )
  739. .find('a')
  740. .attr('href', loadImg[ size ]() )
  741. .attr('title', loadImg[ size+'fileSize' ] )
  742. .append( sizes ) );
  743. },
  744. Large : setInterval(function(){
  745. chk.tSize('Large');
  746. }, 1),
  747. Huge : setInterval(function(){
  748. chk.tSize('Huge');
  749. }, 1),
  750. Orginal : setInterval(function(){
  751. chk.tSize('Orginal');
  752. }, 1)
  753. };
  754. }
  755. },
  756. loadImg = {
  757. domainPhotoPath : 'http://static.panoramio.com/photos',
  758. /**
  759. * @return {string}
  760. */
  761. Large: function(){
  762. var n; n = loadImg.domainPhotoPath + '/large/' + glob.img; return n },
  763. /**
  764. * @return {string}
  765. */
  766. Huge: function(){
  767. var n; n = loadImg.domainPhotoPath + '/1920x1280/' + glob.img; return n },
  768. /**
  769. * @return {string}
  770. */
  771. Orginal: function(){
  772. var n; n = loadImg.domainPhotoPath + '/original/' + glob.img; return n },
  773. LargeLoaded: null,
  774. HugeLoaded: null,
  775. OrginalLoaded: null,
  776. LargeSize: '0',
  777. LargeWidth: '0',
  778. HugeSize: '0',
  779. HugeWidth: '0',
  780. OrginalSize: '0',
  781. OrginalWidth: '0',
  782. startImg: null,
  783. setLoadedSize: function( newImg, state ){ f.l('state',state,9);
  784. var sizeText = newImg.naturalWidth + 'x' + newImg.naturalHeight; f.l(state,sizeText,3);
  785. this[state+'Loaded'] = true, f.l(state+'Loaded',this[state+'Loaded'],9),
  786. this[state+'Size'] = sizeText, f.l(state+'Size',this[state+'Size'],9);
  787. this[state+'Width'] = newImg.naturalWidth;
  788. loadImg[state+'fileSize'] = this[state].size / 1024;
  789. f.l(state+'fileSize',this[state+'fileSize']);
  790. f.l('newImg',newImg.target);
  791. },
  792. bootstrapCss: function(){
  793. $('#bootstrapCss').length || $('<link/>',{ id:'bootstrapCss', rel:"stylesheet", href:"//netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" }).appendTo('head');
  794. },
  795. img_onWaitLoad: function(){
  796. this.bootstrapCss();
  797. $.alert('Wait on image to load',{
  798. //http://www.jqueryscript.net/other/Create-Simple-Alert-Messages-with-jQuery-Bootstrap-alert-js.html
  799. autoClose: true,
  800. // Auto close delay time in ms (>1000)
  801. closeTime: 8000,
  802. // Display a countdown timer
  803. withTime: true,
  804. // danger, success, warning or info
  805. type: 'info',
  806. // position+offeset
  807. // top-left,top-right,bottom-left,bottom-right,center
  808. position: ['top-left', [ 128, ( $('div#map').width() / 2 ) - ( 284 / 2 ) ]],
  809. // <a href="http://www.jqueryscript.net/animation/">
  810. // Animation speed
  811. speed: 'normal',
  812. // onShow callback
  813. onClose: function () {
  814. $('#firstThumbholder').css('visibility','hidden');
  815. },
  816. title:'Loading info'
  817. });
  818. },
  819. img_onError: function( state ){
  820. this.bootstrapCss();
  821. $.alert('The size of ' + state + " can't be loaded",{
  822. //http://www.jqueryscript.net/other/Create-Simple-Alert-Messages-with-jQuery-Bootstrap-alert-js.html
  823. autoClose: true,
  824. // Auto close delay time in ms (>1000)
  825. closeTime: 8000,
  826. // Display a countdown timer
  827. withTime: true,
  828. // danger, success, warning or info
  829. type: 'info',
  830. // position+offeset
  831. // top-left,top-right,bottom-left,bottom-right,center
  832. position: ['top-left', [ 128, ( $('div#map').width() / 2 ) - ( 284 / 2 ) ]],
  833. // <a href="http://www.jqueryscript.net/animation/">
  834. // Animation speed
  835. speed: 'normal',
  836. // onShow callback
  837. onClose: function () {
  838. $('#firstThumbholder').css('visibility','hidden');
  839. },
  840. title:'OnError'
  841. });
  842. },
  843. run_img1: function(){
  844. var startState = glob.startState() == 'Large' ,newImg = new Image(),
  845. startString = startState ? 'Large' : 'Huge';
  846. newImg.src = this[ startString ](); f.l('src1', startState ? this.Large(): this.Huge(),9);
  847.  
  848. newImg.onerror = function(){
  849. loadImg.img_onError( startString );
  850. $('.' + startString + 'BottomLink').hide();
  851. };
  852. newImg.onload = function(){ f.l('run_img1',newImg,9);
  853. loadImg.setLoadedSize( newImg, startString );
  854. loadImg.startImg = newImg;
  855. };
  856. },
  857. run_img2: function(){
  858. var startState = glob.startState() == 'Large', newImg = new Image(),
  859. startString = startState ? 'Huge' : 'Large',
  860. chk = setInterval(function(){
  861. loadImg.startImg !== null && (
  862. clearInterval(chk), render.mainHtml() ); },1);
  863. newImg.src = this[ startString ]();
  864. newImg.onerror = function(){
  865. loadImg.img_onError( startString );
  866. $('.' + startString + 'BottomLink').hide();
  867. };
  868. newImg.onload = function(){ f.l('run_img2',newImg,9);
  869. loadImg.setLoadedSize( newImg, startString ); };
  870. },
  871. run_img3: function(){
  872. var newImg = new Image();
  873. newImg.src = this.Orginal();
  874. newImg.onerror = function(){
  875. loadImg.img_onError( 'Orginal' );
  876. $('.OrginalBottomLink').hide();
  877. };
  878. newImg.onload = function(){ f.l('run_img3',newImg,9);
  879. loadImg.setLoadedSize( newImg, 'Orginal' ); };
  880. }
  881. },
  882. reset = {
  883. Objects: function(){
  884. loadImg.startImg = null;
  885. loadImg.LargeLoaded = false;
  886. loadImg.HugeLoaded = false;
  887. loadImg.OrginalLoaded = false;
  888. loadImg.LargeSize = '0';
  889. loadImg.HugeSize = '0';
  890. loadImg.OrginalSize = '0';
  891. html.DetailsResults = null;
  892. }
  893. },
  894. observer = new MutationObserver( function( mutations /*, observer */) {
  895. mutations.forEach( function( mutation ) {
  896. var newNodes = mutation.addedNodes;
  897. newNodes !== null &&
  898. $( newNodes ).each( function( i, e ){
  899. var $e = $(e);
  900. $e.hasClass('gm-style-iw') && ( $e.parent().attr('id','firstThumbholder'), $e.prev().attr('id','Thumbholder' ) );
  901. //$e.hasClass('widget-titlecard-attribution') && switcher('123');
  902. });
  903. });
  904. });
  905.  
  906. observer.observe( document, { subtree: true, childList: true });
  907.  
  908. function fn_googleMaps(){
  909. var css = {
  910. panoramioButton: function(){
  911. return 'a.PanoramioUrl img {'
  912. + 'width: 40px;'
  913. + 'height: 40px;'
  914. + '}'
  915. + '.PanoramioWrapper {'
  916. + 'top: -5px;'
  917. + 'left: -35px;'
  918. + 'position: absolute;'
  919. + '}'
  920. + 'a.WikimapiaUrl img {'
  921. + 'width: 20px;'
  922. + 'height: 20px;'
  923. + '}'
  924. + '.WikimapiaWrapper {'
  925. + 'top: 4px;'
  926. + 'left: -52px;'
  927. + 'position: absolute;'
  928. + '}'
  929. ;
  930. },
  931. style : function( id, var1, var2 ){
  932. var $id = $( 'head #' + id ), cssID = css[ id ]( var1, var2 ).formatString();
  933. $id.length ? $id.html( cssID ) : $( $( '<style/>',{ id: id, class:'mySuperStyles', html: cssID } ) ).appendTo('head');
  934. }
  935. },
  936. html = {
  937. getPanoramioUrl : function(){
  938. var cord = location.href.split('@').pop().split(',');
  939. return 'https://ssl.panoramio.com/map/#lt=' + cord[0] + '&ln=' + cord[1] + '&z=2&k=2&a=1&tab=1&pl=all';
  940. },
  941. getWikimapiaUrl : function(){
  942. var cord = location.href.split('@').pop().split(',');
  943. return 'http://wikimapia.org/#lang=en&lat=' + cord[0] + '&lon=' + cord[1] + '&z=16&m=b';
  944. },
  945. panoramioButton : function(){
  946. return '<button aria-label="Go to Panoramio" oncontextmenu="return false;" class="widget-expand-button-pegman-background grab-cursor"> '
  947. + '<div class="PanoramioWrapper" > '
  948. + '<a target="_blank" href="'+ html.getPanoramioUrl() + '" class="PanoramioUrl" title="Go to Panoramio"> <img src="https://lh5.ggpht.com/iX6z62XBBt1b2T0fWnt9EupX1e6yFoUnYwO60z702xIp3-VlJquqYBOSay7aKhd5wbQ=w300-rw"></a>'
  949. + '</div></button>';
  950. },
  951. /**
  952. * @return {string}
  953. */
  954. WikimapiaButton : function(){
  955. return '<button aria-label="Go to Wikimapia" oncontextmenu="return false;" class="widget-expand-button-pegman-background grab-cursor"> <div class="WikimapiaWrapper" > '
  956. + '<a target="_blank" href="' + html.getWikimapiaUrl() + '" class="WikimapiaUrl" title="Go to Wikimapia"> <img src="http://a1.mzstatic.com/us/r30/Purple3/v4/c1/7a/ea/c17aea4b-2f3d-dbc3-3fa9-92ece451ae3c/icon175x175.png"></a>'
  957. + '</div></button>';
  958. }
  959. },
  960. listener = {
  961. panoramioButton: function(){
  962. $( document ).on('mouseenter', 'a.PanoramioUrl img, a.PanoramioUrl', function(e){
  963. this == e.target && (
  964. $( 'a.PanoramioUrl' ).attr('href', html.getPanoramioUrl() )
  965. );
  966. });
  967.  
  968. },
  969. WikimapiaButton: function(){
  970. $( document ).on('mouseenter', '.WikimapiaUrl img, .WikimapiaUrl', function(e){
  971. this == e.target && (
  972. $( '.WikimapiaUrl' ).attr('href', html.getWikimapiaUrl() )
  973. );
  974. });
  975.  
  976. }
  977. },
  978. render = function(){
  979. var insert = $('.app-horizontal-widget-holder'); //$('.widget-expand-button-pegman')
  980. css.style('panoramioButton');
  981. $('.PanoramioWrapper').length || $( html.panoramioButton() ).prependTo( insert );
  982. listener.panoramioButton();
  983.  
  984. // css.style('WikimapiaButton');
  985. $('.WikimapiaWrapper').length || $( html.WikimapiaButton() ).prependTo( insert );
  986. listener.WikimapiaButton();
  987. },
  988. googleMaps_observer = new MutationObserver( function( mutations /*, observer */) {
  989. mutations.forEach( function( mutation ) {
  990. var newNodes = mutation.addedNodes;
  991. newNodes !== null &&
  992. $( newNodes ).each( function( i, e ){
  993. var $e = $(e);
  994. ( $e.hasClass('widget-expand-button-pegman') || $e.hasClass('.app-horizontal-widget-holder') ) && render();
  995. });
  996. });
  997. });
  998.  
  999. googleMaps_observer.observe( document, { subtree: true, childList: true });
  1000. setInterval(function() {
  1001. $('.PanoramioWrapper').length || render();
  1002. }, 1024);
  1003.  
  1004. $(window).load(function() {
  1005. render();
  1006.  
  1007. });
  1008.  
  1009.  
  1010. }
  1011.  
  1012. function fn_panoramio(){
  1013. css.style('firstPointerCss');
  1014.  
  1015. var search = '/photos/small/';
  1016.  
  1017. $( document ).on('hover mouseenter', '.map-info-window-img-inner img', function(){
  1018. var mainParent = $( this ).parents('.map-info-window-img-outer'),
  1019. mainImgParent = mainParent.find('.map-info-window-img-inner'),
  1020. mainLink = mainImgParent.find('a'),
  1021. src = $( this ).attr('src');
  1022.  
  1023. src.search('logo-tos.png') > 0 && $( this ).addClass('panoLinkClick').closest('a').attr('href', mainLink.attr('href') );
  1024. $('.map-info-window-img-footer-logo a').attr('href', mainLink.attr('href') );
  1025. mainParent.hasClass( 'Donne' ) || ( mainParent.addClass( 'Donne' ), mainLink.find('img').unwrap() );
  1026.  
  1027. src.search(search) !== -1 && (
  1028. reset.Objects(),
  1029. glob.img = src.split(search).pop(),
  1030. loadImg.run_img1(),
  1031. html.bottomLink = $( this ).parent().next().clone(),
  1032. html.title = $( this ).parent().parent().prev().clone().addClass('TheTitle')
  1033. );
  1034.  
  1035. });
  1036. $( document ).on('click', 'img', function(){
  1037. var removePano = $('.largePanorama'),
  1038. src = $( this ).attr('src');
  1039. removePano.length && removePano.remove();
  1040. src.search(search) !== -1 && (
  1041. loadImg.run_img2(),
  1042. loadImg.run_img3()
  1043. );
  1044. });
  1045.  
  1046. f.l('fn_googleMaps');
  1047. }
  1048.  
  1049. glob.locDoc.search('panoramio.com') != -1 && fn_panoramio();
  1050. glob.locDoc.search('/maps/') != -1 && fn_googleMaps();
  1051.  
  1052.  
  1053. f.l('fn_googleMaps',location.href.search('/maps/'));
  1054.  
  1055. function infoCol(){
  1056. var zoomURL = $('#info-col').find('#location .geo a'),
  1057. href = zoomURL.attr('href').split('=');
  1058. href[3] = '-1&' + href[3].split('&').pop();
  1059. zoomURL.attr('href', href.join('=') );
  1060. }
  1061.  
  1062. glob.locDoc.search('panoramio.com/photo/') != -1 && $('#info-col').length && infoCol();
  1063.  
  1064. function switcher(code) {
  1065. var url = $('a.widget-titlecard-attribution-link').attr('data-attribution-url');
  1066. f.l( 'switcher',code + ': ' + url );
  1067.  
  1068. GM_xmlhttpRequest({
  1069. method : "GET",
  1070. url : url,
  1071. crossDomain: true,
  1072. onprogress : function(res){
  1073. var msg = "\n\r\t "
  1074. + "On progress Report."
  1075. + "\nresponseText: " + res.responseText
  1076. + "\nreadyState: " + res.readyState
  1077. + "\nresponseHeaders: " + res.responseHeaders
  1078. + "\nstatus: " + res.status
  1079. + "\nstatusText: " + res.statusText
  1080. + "\nfinalUrl: " + res.finalUrl;
  1081. // + "\n\nContent-length: " + res.responseHeaders.match('Content-Length: \\d+').toString().split(': ').pop()
  1082.  
  1083. res.readyState == 4 && console.log(msg);
  1084. },
  1085. onload : function(res){
  1086. //f.l( 'res.responseText', res.responseText );
  1087. var $res = function(){
  1088. return $( res.responseText );
  1089. },
  1090. href = $res().find('#location .geo a').attr('href').split('='),
  1091. img = $('<img/>',{src:'http://www.galis.org/_/rsrc/1315550090403/Home/panoramio.png'}),
  1092. a = $('<a/>',{ class:'panoramio_switcher', html:img });
  1093.  
  1094. href[3] = '-1&' + href[3].split('&').pop();
  1095.  
  1096. f.l('link', 'https://ssl.panoramio.com' + href.join('=') );
  1097.  
  1098. $('.panoramio_switcher').length || $('.widget-titlecard-header .widget-titlecard-attribution').append( a.attr('href', 'https://ssl.panoramio.com' + href.join('=') ) );
  1099.  
  1100. }
  1101. });
  1102. }
  1103. $('.widget-titlecard-attribution-text').waitUntilExists(function(){
  1104. var panaramioCss = 'a.panoramio_switcher img {'
  1105. + 'width: 26px;'
  1106. + 'top: 9px;'
  1107. + 'position: relative;'
  1108. + '}'
  1109. + '.widget-titlecard-header .widget-titlecard-attribution {'
  1110. + 'top: -10px;'
  1111. + 'position: relative;'
  1112. + '}';
  1113.  
  1114. setTimeout(function(){
  1115. switcher('789');
  1116. setTimeout(function(){
  1117. $('<style id="panaramio">' + panaramioCss + '</style>').appendTo( 'head' );
  1118. }, 424);
  1119. setInterval(function(){
  1120. var link = $('a.widget-titlecard-attribution-link').attr('data-attribution-url'),
  1121. arrays = link.split('/'),
  1122. locDoc = window.location.href;
  1123.  
  1124. link.search('ssl.panoramio.com') > 0 && locDoc.search( arrays[4] ) == -1 && (
  1125. console.log('chk', locDoc.search( arrays[4] ) ),
  1126. $('.panoramio_switcher').remove(),
  1127. setTimeout(function(){
  1128. switcher();
  1129. },512)
  1130. );
  1131. }, 2500);
  1132. }, 1524);
  1133. });
  1134.  
  1135. //----------------------------------------------------------------------------------------------------------//
  1136. // The END //
  1137. //----------------------------------------------------------------------------------------------------------//
  1138.  
  1139. $( document ).on('click','*',function(e){ this == e.target && console.log('target',e.target); });
  1140.  
  1141. f.l('google maps');
  1142.  
  1143. $( document ).ready(function() {
  1144. html.headLinks();
  1145. });
  1146.  
  1147. }(jQuery));
  1148.