Advertisement
pixedelic

delight.custom.php

Feb 9th, 2016
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 83.98 KB | None | 0 0
  1. <?php require_once( '../../../../wp-load.php' ); ?>
  2. /*! Copyright 2012, Ben Lin (http://dreamerslab.com/)
  3. * Licensed under the MIT License (LICENSE.txt).
  4. *
  5. * Version: 1.0.14
  6. *
  7. * Requires: jQuery 1.2.3 ~ 1.9.0
  8. */
  9. ;(function(e){e.fn.extend({actual:function(t,n){if(!this[t]){throw'$.actual => The jQuery method "'+t+'" you called does not exist'}var r={absolute:false,clone:false,includeMargin:false};var i=e.extend(r,n);var s=this.eq(0);var o,u;if(i.clone===true){o=function(){var e="position: absolute !important; top: -1000 !important; ";s=s.clone().attr("style",e).appendTo("body")};u=function(){s.remove()}}else{var a=[];var f="";var l;o=function(){if(e.fn.jquery>="1.8.0")l=s.parents().addBack().filter(":hidden");else l=s.parents().andSelf().filter(":hidden");f+="visibility: hidden !important; display: block !important; ";if(i.absolute===true)f+="position: absolute !important; ";l.each(function(){var t=e(this);a.push(t.attr("style"));t.attr("style",f)})};u=function(){l.each(function(t){var n=e(this);var r=a[t];if(r===undefined){n.removeAttr("style")}else{n.attr("style",r)}})}}o();var c=/(outer)/g.test(t)?s[t](i.includeMargin):s[t]();u();return c}})})(jQuery);
  10.  
  11.  
  12. jQuery.noConflict();
  13.  
  14. <?php if(get_pix_option('pix_google_prevent')!='show') { ?>
  15. google.load("webfont", "1");
  16.  
  17. <?php $fonts = array(
  18. get_pix_option('pix_typo_general'),
  19. get_pix_option('pix_typo_general_own'),
  20. get_pix_option('pix_typo_buttons'),
  21. get_pix_option('pix_typo_buttons_own'),
  22. get_pix_option('pix_typo_h1'),
  23. get_pix_option('pix_typo_h1_own'),
  24. get_pix_option('pix_typo_h2'),
  25. get_pix_option('pix_typo_h2_own'),
  26. get_pix_option('pix_typo_h3'),
  27. get_pix_option('pix_typo_h3_own'),
  28. get_pix_option('pix_typo_h4'),
  29. get_pix_option('pix_typo_h4_own'),
  30. get_pix_option('pix_typo_h5'),
  31. get_pix_option('pix_typo_h5_own'),
  32. get_pix_option('pix_typo_h6'),
  33. get_pix_option('pix_typo_h6_own'),
  34. get_pix_option('pix_typo_sitetitle'),
  35. get_pix_option('pix_typo_sitetitle_own'),
  36. get_pix_option('pix_typo_sitedescription'),
  37. get_pix_option('pix_typo_sitedescription_own'),
  38. get_pix_option('pix_typo_firstlevellink'),
  39. get_pix_option('pix_typo_firstlevellink_own'),
  40. get_pix_option('pix_typo_secondlevellink'),
  41. get_pix_option('pix_typo_secondlevellink_own'),
  42. get_pix_option('pix_typo_thirdlevellink'),
  43. get_pix_option('pix_typo_thirdlevellink_own'),
  44. get_pix_option('pix_typo_logobottom'),
  45. get_pix_option('pix_typo_logobottom_own'),
  46. );
  47. $fonts=array_unique($fonts);
  48. $web_safe = array(
  49. "Arial",
  50. "Verdana",
  51. "Georgia",
  52. "Courier New",
  53. "Tahoma",
  54. "Trebuchet MS",
  55. "Arial Black",
  56. "Times New Roman",
  57. "Palatino Linotype",
  58. "Lucida Sans Unicode",
  59. "Comic Sans MS"
  60. );
  61. $fonts=array_diff($fonts,$web_safe);
  62. $i=0;
  63. foreach ($fonts as $key => $value) {
  64. if($value!=''){
  65. if($i==0){
  66. $font .= '\''.$value.'\'';
  67. } else {
  68. $font .= ', \''.$value.'\'';
  69. }
  70. $i++;
  71. }
  72. }
  73.  
  74. if (count($font)>0) { ?>
  75.  
  76. WebFontConfig = {
  77. google: { families: [ <?php echo $font; ?> ] }
  78. };
  79.  
  80. <?php }
  81. } ?>
  82.  
  83. /******************************************************
  84. *
  85. * Article toggle effect
  86. *
  87. ******************************************************/
  88. var toggleNow = false;
  89.  
  90. function articleAsideOpen(hs, ha){ //################### Apre article e aside separatamente e ad altezze diverse
  91. var deviceAgent = navigator.userAgent.toLowerCase();
  92. var agentID = deviceAgent.match(/(iphone|ipod|ipad|android)/);
  93.  
  94. var fe;
  95. if (jQuery('.entry-title').length!=0) {
  96. fe = parseFloat(jQuery('.entry-title').css('line-height').replace('px',''))+parseFloat(jQuery('.entry-title').css('padding-bottom').replace('px',''))+parseFloat(jQuery('.entry-title').css('padding-top').replace('px','')); //altezza del gap
  97. }
  98. if (jQuery.browser.msie) {
  99. if(jQuery(window).height()>jQuery(document).height()){ //in questo modo anche con menu scrollabile ho l'altezza della section piena
  100. var h = jQuery(window).height();
  101. } else {
  102. var h = jQuery(document).height();
  103. }
  104. } else {
  105. if(window.innerHeight>jQuery(document).height()){ //in questo modo anche con menu scrollabile ho l'altezza della section piena
  106. var h = window.innerHeight;
  107. } else {
  108. var h = jQuery(document).height();
  109. }
  110. }
  111. var off;
  112. off = jQuery('footer').offset();
  113. var offs = jQuery('article').offset();
  114. var offa;
  115. offa = jQuery('aside').offset();
  116. var he = parseFloat(jQuery('section').css('margin-top').replace('px',''));
  117. var foo = jQuery('footer').height();
  118. var hh2 = jQuery('article').not('.always_open').find('.entry-title:first').css({'cursor':'pointer','position':'relative'}).append('<span class="toggle_arrow icons">^</span>').height()+15+15;
  119. var lhh2 = jQuery('article .entry-title:first').css('line-height'); //mi serve per settare le altezze dei due titoli
  120. var hh3 = jQuery('aside').not('.always_open').find('h3:first').css({'cursor':'pointer','position':'relative'}).append('<span class="toggle_arrow icons">^</span>').height()+15+15;
  121. jQuery('aside').find('h3:first').addClass('first');
  122. var ph3 = jQuery('aside').find('h3:first').css('padding-top');
  123. jQuery('aside .toggle_arrow').css('padding-top',ph3);
  124. var secMarg = parseFloat(jQuery('section').css('margin-top'));
  125.  
  126.  
  127. var h2ln = Math.round(parseFloat(jQuery('article .entry-title:first').height()) / parseFloat(jQuery('article .entry-title:first').css('line-height'))); //numero di righe del titolo della article
  128. var h3ln = Math.round(parseFloat(jQuery('aside h3:first').height()) / parseFloat(jQuery('aside h3:first').css('line-height'))); //numero di righe del titolo della aside
  129.  
  130. if(h2ln == h3ln && (fe==0 || !jQuery('aside').hasClass('open_toggle') ) ) { //se i numeri di righe sono uguali etc.
  131. jQuery('aside h3:first').css({'line-height':lhh2}); //setto le altezze uguali
  132. hh3 = hh2; //setto le altezze uguali
  133. }
  134. if(jQuery('article').length!=0){
  135. jQuery('article').not('.open_toggle').height(hh2).addClass('article_fixed').addClass('aside_fixed').css({'left':offs.left,'top':off.top-(hh2),'position':'fixed'});
  136. }
  137. if(jQuery('aside').length!=0){
  138. jQuery('aside').not('.open_toggle').height(hh3).addClass('aside_fixed').css({'left':offa.left,'top':off.top-(hh3),'position':'fixed'});
  139. }
  140. jQuery('.open_toggle').find('.toggle_arrow').text('_');
  141. Cufon.refresh();
  142. if(hs>h-(he+foo)) {
  143. var hs2 = hs;
  144. } else {
  145. var hs2 = h-(he+foo);
  146. }
  147. if(ha>h-(he+foo+fe)) {
  148. var ha2 = ha;
  149. } else {
  150. var ha2 = h-(he+foo+fe);
  151. }
  152. if(ha+fe>hs) {
  153. jQuery('article.open_toggle').css({'height':ha2+fe,'visibility':'visible'});
  154. jQuery('aside.open_toggle').css({'margin-top':fe,'height':ha2,'visibility':'visible'});
  155. } else {
  156. jQuery('article.open_toggle').css({'height':hs2,'visibility':'visible'});
  157. jQuery('aside.open_toggle').css({'margin-top':fe,'height':hs2-fe,'visibility':'visible'});
  158. }
  159.  
  160.  
  161. function layoutAfterResize(){
  162. //var agentID = deviceAgent.match(/(iphone|ipod|ipad|android)/);
  163. //if (!agentID) {
  164. var off;
  165. off = jQuery('footer').offset();
  166. var offs = jQuery('article').offset();
  167. var offa = jQuery('aside').offset();
  168. if (jQuery.browser.msie) {
  169. h = jQuery(window).height();
  170. } else {
  171. h = window.innerHeight;
  172. }
  173. var scrolled = jQuery(window).scrollTop();
  174. if(ha+fe<hs){
  175. if(hs>h-(he+foo)){
  176. jQuery('article.open_toggle').css({'height':hs});
  177. if(jQuery('article').hasClass('open_toggle')){
  178. jQuery('aside.open_toggle').css({'height':hs-fe});
  179. } else {
  180. if(ha+fe<h-(he+foo)){
  181. jQuery('aside.open_toggle').css({'height':h-(he+foo+fe)});
  182. }
  183. }
  184. } else {
  185. jQuery('article.open_toggle').css({'height':h-(he+foo)});
  186. jQuery('aside.open_toggle').css({'height':h-(he+foo+fe)});
  187. }
  188. } else {
  189. if(ha+fe>h-(he+foo)){
  190. if(jQuery('aside').hasClass('open_toggle')){
  191. jQuery('article.open_toggle').css({'height':ha+fe});
  192. } else {
  193. if(hs<h-(he+foo)){
  194. jQuery('article.open_toggle').css({'height':h-(he+foo)});
  195. }
  196. }
  197. jQuery('aside.open_toggle').css({'height':ha});
  198. } else {
  199. jQuery('article.open_toggle').css({'height':h-(he+foo)});
  200. jQuery('aside.open_toggle').css({'height':h-(he+foo+fe)});
  201. }
  202. }
  203. if(jQuery('article').length!=0) {
  204. jQuery('article').not('.open_toggle').css({'left':offs.left,'top':(off.top-scrolled)-(hh2)});
  205. }
  206. if(jQuery('aside').length!=0) {
  207. jQuery('aside').not('.open_toggle').css({'left':offa.left,'top':(off.top-scrolled)-(hh3)});
  208. }
  209. if(hs>h-(he+foo)) {
  210. hs2 = hs;
  211. } else {
  212. hs2 = h-(he+foo);
  213. }
  214. if(ha>h-(he+foo)) {
  215. ha2 = ha;
  216. } else {
  217. ha2 = h-(he+foo+fe);
  218. }
  219. //}
  220. }
  221.  
  222. jQuery(window).resize(function(){
  223. layoutAfterResize();
  224. });
  225.  
  226. var agentID = deviceAgent.match(/(iphone|ipod|ipad|android)/);
  227.  
  228. jQuery('article .entry-title:first').die('click');
  229.  
  230. if( !jQuery('article').hasClass('always_open')){
  231. jQuery('article .entry-title:first').live('click',function(){
  232.  
  233. toggleNow = true;
  234.  
  235. var t = jQuery(this).parents('article');
  236. if (jQuery.browser.msie) {
  237. var h = jQuery(window).height();
  238. } else {
  239. var h = window.innerHeight;
  240. }
  241. var ha = jQuery('aside').height();
  242. var off;
  243. off = jQuery('footer').offset();
  244. var scrolled = jQuery(window).scrollTop();
  245. if(t.hasClass('open_toggle')){
  246. /*if (agentID) {
  247. return false;
  248. }*/
  249. t.animate({'margin-top':(off.top-scrolled)-(hh2+secMarg),'height':hh2},300,function(){
  250. toggleNow = false;
  251. t.removeClass('open_toggle');
  252. t.find('.toggle_arrow').text('^');
  253. Cufon.refresh();
  254. t.addClass('article_fixed').css({'left':offs.left,'top':(off.top-scrolled)-(hh2),'margin':'0','position':'fixed'});
  255. });
  256. if(!jQuery('aside').hasClass('open_toggle')) {
  257. jQuery('html,body').animate({scrollTop: 0}, 300 );
  258. } else {
  259. jQuery('aside.open_toggle').animate({'height':ha2}, 300 );
  260. jQuery('html,body').animate({scrollTop: 0}, 300 );
  261. }
  262. /*if (agentID) {
  263. jQuery('footer').css({'position':'fixed','margin-top':'0'});
  264. }*/
  265. } else {
  266. t.removeClass('article_fixed').css({'margin-top':off.top-(hh2+secMarg),'position':'static','top':'0','left':'0'});
  267. t.find('.toggle_arrow').text('_');
  268. Cufon.refresh();
  269. if(hs<ha+fe&&jQuery('aside').hasClass('open_toggle')){
  270. t.animate({'margin-top':'0','height':ha+fe},300,function(){t.addClass('open_toggle'); toggleNow = false;});
  271. } else if(hs>h-(he+foo)) {
  272. jQuery('aside.open_toggle').animate({'height':hs-fe},300);
  273. t.animate({'margin-top':'0','height':hs},300,function(){t.addClass('open_toggle'); toggleNow = false;});
  274. } else {
  275. //jQuery('aside.open_toggle').animate({'height':hs},300);
  276. t.animate({'margin-top':'0','height':h-(he+foo)},300,function(){t.addClass('open_toggle'); toggleNow = false;});
  277. }
  278. /*if (agentID) {
  279. jQuery('footer').css({'position':'relative'});
  280. }*/
  281. }
  282. }),layoutAfterResize();
  283. }
  284.  
  285.  
  286. var orPadB = jQuery('aside h3:first').css('padding-bottom');
  287. var orPadT = jQuery('aside h3:first').css('padding-top');
  288. var orPadAr = jQuery('aside h3:first .toggle_arrow').css('padding-top');
  289. var orLh = jQuery('aside h3:first').css('line-height');
  290.  
  291.  
  292. jQuery('aside').not('.open_toggle').find('h3:first').each(function(){
  293. var dif = jQuery('.entry-title').height()-jQuery(this).height();
  294. var marg = parseFloat(jQuery(this).css('padding-bottom').replace('px',''));
  295. jQuery(this).css({'padding-bottom':(marg+dif),'padding-top':'20px'});
  296. jQuery('.toggle_arrow',this).css({'padding-top':'20px'});
  297. });
  298.  
  299.  
  300. jQuery('aside h3:first').die('click');
  301.  
  302. if( !jQuery('aside').hasClass('always_open')){
  303. jQuery('aside h3:first').live('click',function(){
  304. toggleNow = true;
  305. var t = jQuery(this).parents('aside');
  306. if (jQuery.browser.msie) {
  307. var h = jQuery(window).height();
  308. } else {
  309. var h = window.innerHeight;
  310. }
  311. var hs = jQuery('article').height();
  312. var off;
  313. off = jQuery('footer').offset();
  314. var scrolled = jQuery(window).scrollTop();
  315. if(t.hasClass('open_toggle')){
  316. /*if (agentID) {
  317. return false;
  318. }*/
  319. var dif = jQuery('.entry-title').height()-jQuery(this).height();
  320. var marg = parseFloat(jQuery(this).css('padding-bottom').replace('px',''));
  321. jQuery(this).animate({'padding-bottom':(marg+dif),'padding-top':'20px'});
  322. jQuery('.toggle_arrow',this).animate({'padding-top':'20px'});
  323. if(h2ln == h3ln) { //se i numeri di righe sono uguali etc.
  324. jQuery('aside h3:first').css({'line-height':lhh2}); //setto le altezze uguali
  325. hh3 = hh2; //setto le altezze uguali
  326. }
  327. t.animate({'margin-top':(off.top-scrolled)-(hh3+secMarg),'height':hh3},300,function(){
  328. t.removeClass('open_toggle');
  329. toggleNow = false;
  330. t.find('.toggle_arrow').text('^');
  331. Cufon.refresh();
  332. t.addClass('aside_fixed').css({'left':offa.left,'top':(off.top-scrolled)-(hh3),'margin':'0','position':'fixed'});
  333. });
  334. if(!jQuery('article').hasClass('open_toggle')) {
  335. jQuery('html,body').animate({scrollTop: 0}, 300 );
  336. } else {
  337. jQuery('article.open_toggle').animate({'height':hs2}, 300 );
  338. jQuery('html,body').animate({scrollTop: 0}, 300 );
  339. }
  340. } else {
  341. jQuery(this).removeClass('aside_fixed').animate({'padding-bottom':orPadB,'padding-top':orPadT});
  342. jQuery('.toggle_arrow',this).animate({'padding-top':orPadAr});
  343. jQuery('aside h3:first').css({'line-height':orLh});
  344. t.css({'margin-top':off.top-(hh2+secMarg),'position':'static','top':'0','left':'0'});
  345. t.find('.toggle_arrow').text('_');
  346. Cufon.refresh();
  347. if(ha<hs-fe&&jQuery('article').hasClass('open_toggle')){
  348. t.animate({'margin-top':fe,'height':hs-fe},300,function(){t.addClass('open_toggle'); toggleNow = false;});
  349. } else if(ha>h-(he+foo)) {
  350. jQuery('article.open_toggle').animate({'height':ha+fe},300);
  351. t.animate({'margin-top':fe,'height':ha},300,function(){t.addClass('open_toggle'); toggleNow = false;});
  352. } else {
  353. //jQuery('article.open_toggle').animate({'height':ha+fe},300);
  354. t.animate({'margin-top':fe,'height':h-(he+foo)},300,function(){t.addClass('open_toggle'); toggleNow = false;});
  355. }
  356. }
  357. }),layoutAfterResize();
  358. }
  359. }
  360.  
  361. /*
  362. * jQuery resize event - v1.1 - 3/14/2010
  363. * http://benalman.com/projects/jquery-resize-plugin/
  364. *
  365. * Copyright (c) 2010 "Cowboy" Ben Alman
  366. * Dual licensed under the MIT and GPL licenses.
  367. * http://benalman.com/about/license/
  368. */
  369. (function($,h,c){var a=$([]),e=$.resize=$.extend($.resize,{}),i,k="setTimeout",j="resize",d=j+"-special-event",b="delay",f="throttleWindow";e[b]=250;e[f]=true;$.event.special[j]={setup:function(){if(!e[f]&&this[k]){return false}var l=$(this);a=a.add(l);$.data(this,d,{w:l.width(),h:l.height()});if(a.length===1){g()}},teardown:function(){if(!e[f]&&this[k]){return false}var l=$(this);a=a.not(l);l.removeData(d);if(!a.length){clearTimeout(i)}},add:function(l){if(!e[f]&&this[k]){return false}var n;function m(s,o,p){var q=$(this),r=$.data(this,d);r.w=o!==c?o:q.width();r.h=p!==c?p:q.height();n.apply(this,arguments)}if($.isFunction(l)){n=l;return m}else{n=l.handler;l.handler=m}}};function g(){i=h[k](function(){a.each(function(){var n=$(this),m=n.width(),l=n.height(),o=$.data(this,d);if(m!==o.w||l!==o.h){n.trigger(j,[o.w=m,o.h=l])}});g()},e[b])}})(jQuery,this);
  370.  
  371. jQuery(window).one('load',function(){
  372. jQuery('article .entry-title:first, aside h3:first').unbind('click');
  373. var hs = 0;
  374. if(jQuery('article').length!=0){
  375. hs = jQuery('article').height();
  376. }
  377. var ha = 0;
  378. if(jQuery('aside').length!=0){
  379. ha = jQuery('aside').height();
  380. }
  381. articleAsideOpen(hs, ha);
  382. Cufon.refresh();
  383.  
  384. jQuery('article > div').resize(function() {
  385. if ( toggleNow == false ) {
  386. jQuery('article,aside').css({height:'auto'});
  387. var hs = 0;
  388. if(jQuery('article').length!=0){
  389. hs = jQuery('article').height();
  390. }
  391. var ha = 0;
  392. if(jQuery('aside').length!=0){
  393. ha = jQuery('aside').height();
  394. }
  395. articleAsideOpen(hs, ha);
  396. }
  397. });
  398.  
  399. });
  400. jQuery(window).one('load',function(){
  401. var deviceAgent = navigator.userAgent.toLowerCase();
  402. var agentID = deviceAgent.match(/(iphone|ipod|ipad|android)/);
  403. /*if (agentID) {
  404. jQuery('aside h3:first').click();
  405. jQuery('article .entry-title:first').click();
  406. jQuery('footer').css({'position':'relative'});
  407. jQuery('#body').css({'height':'auto'});
  408. }*/
  409. });
  410.  
  411.  
  412.  
  413. /******************************************************
  414. *
  415. * Full page slideshow
  416. *
  417. ******************************************************/
  418. jQuery(function() {
  419. if(jQuery('.pix_slide').length){
  420. jQuery('.pix_slide').pixwall_delight({
  421. pauseOnClick: false,
  422. prevNav: '#pixwall_delight_prev', //true, false. It enables the previous and the next buttons, their IDs are #pixwall_delight_prev and #pixwall_delight_next
  423. nextNav: '#pixwall_delight_next', //true, false. It enables the previous and the next buttons, their IDs are #pixwall_delight_prev and #pixwall_delight_next
  424. commands: '#pixwall_delight_commands', //true, false. It enables stop and play buttons
  425. prevNav: '#pix_prev_slide',
  426. nextNav: '#pix_next_slide',
  427. fx: 'simpleFade',
  428. thumbs: '#navgallery_wrapper',
  429. portrait: <?php if(get_pix_option('pix_slideshow_adapt')!='' && get_pix_option('pix_slideshow_adapt')!='0') { echo get_pix_option('pix_slideshow_adapt'); } else { echo 'false'; } ?>,
  430. time: <?php echo get_pix_option('pix_slideshow_speed'); ?>,
  431. transPeriod: <?php echo get_pix_option('pix_slideshow_fade'); ?>,
  432. beforeChange: function() {
  433. jQuery('a.pix_clue_credits').qtip("hide");
  434. }
  435. });
  436. }
  437. });
  438.  
  439.  
  440. /******************************************************
  441. *
  442. * Social_bar position and toggle
  443. *
  444. ******************************************************/
  445. jQuery(window).one('load',function() {
  446. var wF = jQuery("#social_bar form").width();
  447. var wI = jQuery("#social_bar div.icon").width();
  448. if (jQuery.browser.msie && jQuery.browser.version < 8) {
  449. jQuery("#social_bar .wrapIn").css({'width':wF+wI+5});
  450. }
  451. var wS = jQuery("#social_bar").width();
  452. jQuery("#social_bar").css({'left':1050-(wS+35),'visibility':'visible'});
  453. });
  454. jQuery(function() {
  455. jQuery("#social_bar").each(function(){
  456. var t = jQuery(this);
  457. var c = jQuery('.click.icons');
  458. c.click(function(){
  459. if(t.hasClass('open')){
  460. c.html('_');
  461. Cufon.refresh();
  462. t.animate({'margin-top':'0'},300,function(){
  463. t.removeClass('open');
  464. });
  465. } else {
  466. c.html('^');
  467. Cufon.refresh();
  468. t.animate({'margin-top':'50px'},300,function(){
  469. t.addClass('open');
  470. });
  471. }
  472. });
  473. });
  474. });
  475.  
  476. /******************************************************
  477. *
  478. * Colorbox
  479. *
  480. ******************************************************/
  481. jQuery(window).one("load", function(){
  482. jQuery("a[data-rel='iframe']").colorbox({iframe:true, innerWidth:650, innerHeight:488, rel:'nofollow' });
  483. <?php if (get_pix_option('pix_checkcolorbox')=='show') { ?>
  484. jQuery("a[href$='.jpg'], a[href$='.jpeg'], a[href$='.gif'], a[href$='.png'], a[href*='.jpg?'], a[href*='.jpeg?'], a[href*='.gif?'], a[href*='.png?']").not('.noColorBox').each(function(){
  485. var dataRel = jQuery(this).attr('data-rel');
  486. var dataTitle = jQuery(this).attr('data-description')!='' ? jQuery(this).attr('data-description') : jQuery(this).attr('data-title');
  487. jQuery(this).colorbox({maxWidth:"98%", maxHeight:"98%", scrolling:false, rel:dataRel, current:"{current} / {total}", onComplete: function(){ jQuery('#cboxLoadedContent').prepend('<div class="cboxPrevent" />'); jQuery('#cboxTitle').html(dataTitle); if(!jQuery('.pix_slide').hasClass('stopped') && jQuery('.pix_slide').length ){ jQuery('.pix_slide').pixwall_delightStop(); } else { jQuery('.pix_slide').addClass('alreadyStopped'); } }, onClosed: function(){ jQuery('.cboxPrevent').remove(); jQuery('#cboxTitle').text(''); if(!jQuery('.pix_slide').hasClass('alreadyStopped') && jQuery('.pix_slide').length ){ jQuery('.pix_slide').pixwall_delightPlay(); } else { jQuery('.pix_slide').removeClass('alreadyStopped'); }} });
  488. });
  489. jQuery("a.play-icon").not('.noColorBox').each(function(){
  490. var dataRel = jQuery(this).attr('data-rel');
  491. var dataTitle = jQuery(this).attr('data-description')!='' ? jQuery(this).attr('data-description') : jQuery(this).attr('data-title');
  492. jQuery(this).colorbox({iframe:true, innerWidth:800, innerHeight:450, scrolling:false, rel:dataRel, current:"{current} / {total}", onComplete: function(){ jQuery('#cboxTitle').html(dataTitle); if(!jQuery('.pix_slide').hasClass('stopped') && jQuery('.pix_slide').length ){ jQuery('.pix_slide').pixwall_delightStop(); } else { jQuery('.pix_slide').addClass('alreadyStopped'); } }, onClosed: function(){ jQuery('#cboxTitle').text(''); if(!jQuery('.pix_slide').hasClass('alreadyStopped') && jQuery('.pix_slide').length ){ jQuery('.pix_slide').pixwall_delightPlay(); } else { jQuery('.pix_slide').removeClass('alreadyStopped'); }} });
  493. });
  494. jQuery("a.play-icon[href*='selfid']").not('.noColorBox').each(function(){
  495. var dataRel = jQuery(this).attr('data-rel');
  496. var dataTitle = jQuery(this).attr('data-description')!='' ? jQuery(this).attr('data-description') : jQuery(this).attr('data-title');
  497. jQuery(this).colorbox({iframe:true, innerWidth:800, innerHeight:450, scrolling:false, inline:true, rel:dataRel, current:"{current} / {total}", onComplete: function(){ jQuery('#cboxTitle').html(dataTitle); if(!jQuery('.pix_slide').hasClass('stopped') && jQuery('.pix_slide').length ){ jQuery('.pix_slide').pixwall_delightStop(); } else { jQuery('.pix_slide').addClass('alreadyStopped'); } }, onClosed: function(){ jQuery('#cboxTitle').text(''); if(!jQuery('.pix_slide').hasClass('alreadyStopped') && jQuery('.pix_slide').length ){ jQuery('.pix_slide').pixwall_delightPlay(); } else { jQuery('.pix_slide').removeClass('alreadyStopped'); } } });
  498. });
  499. <?php } ?>
  500. jQuery("a.colorbox").each(function(){
  501. var dataRel = jQuery(this).attr('data-rel');
  502. var dataTitle = jQuery(this).attr('data-description')!='' ? jQuery(this).attr('data-description') : jQuery(this).attr('data-title');
  503. jQuery(this).colorbox({maxWidth:"98%", maxHeight:"98%", rel:dataRel, current:"{current} / {total}", onComplete: function(){ jQuery('#cboxLoadedContent').prepend('<div class="cboxPrevent" />'); jQuery('#cboxTitle').html(dataTitle); if(!jQuery('.pix_slide').hasClass('stopped') && jQuery('.pix_slide').length ){ jQuery('.pix_slide').pixwall_delightStop(); } else { jQuery('.pix_slide').addClass('alreadyStopped'); } }, onClosed: function(){ jQuery('.cboxPrevent').remove(); jQuery('#cboxTitle').text(''); if(!jQuery('.pix_slide').hasClass('alreadyStopped') && jQuery('.pix_slide').length ){ jQuery('.pix_slide').pixwall_delightPlay(); } else { jQuery('.pix_slide').removeClass('alreadyStopped'); } } });
  504. });
  505. jQuery("a.iframe").not('.noColorBox').each(function(){
  506. var dataRel = jQuery(this).attr('data-rel');
  507. var dataTitle = jQuery(this).attr('data-description')!='' ? jQuery(this).attr('data-description') : jQuery(this).attr('data-title');
  508. jQuery(this).colorbox({iframe:true, width:"85%", height:"95%", rel:dataRel, current:"{current} / {total}", onComplete: function(){ if(!jQuery('.pix_slide').hasClass('stopped') && jQuery('.pix_slide').length ){ jQuery('.pix_slide').pixwall_delightStop(); } else { jQuery('.pix_slide').addClass('alreadyStopped'); } }, onClosed: function(){ if(!jQuery('.pix_slide').hasClass('alreadyStopped') && jQuery('.pix_slide').length ){ jQuery('.pix_slide').pixwall_delightPlay(); } else { jQuery('.pix_slide').removeClass('alreadyStopped'); } } });
  509. });
  510. jQuery(".gallery-icon a[href$='.jpg'], .gallery-icon a[href$='.jpeg'], .gallery-icon a[href$='.gif'], .gallery-icon a[href$='.png'], .gallery-icon a[href*='.jpg?'], .gallery-icon a[href*='.jpeg?'], .gallery-icon a[href*='.gif?'], .gallery-icon a[href*='.png?']").not('.noColorBox').each(function(){
  511. var dataRel = 'slideshow';
  512. var dataTitle = jQuery(this).attr('data-description')!='' ? jQuery(this).attr('data-description') : jQuery(this).attr('data-title');
  513. jQuery(this).colorbox({maxWidth:"98%", maxHeight:"98%", rel:dataRel, current:"{current} / {total}", onComplete: function(){ jQuery('#cboxLoadedContent').prepend('<div class="cboxPrevent" />'); jQuery('#cboxTitle').html(dataTitle); if(!jQuery('.pix_slide').hasClass('stopped') && jQuery('.pix_slide').length ){ jQuery('.pix_slide').pixwall_delightStop(); } else { jQuery('.pix_slide').addClass('alreadyStopped'); } }, onClosed: function(){ jQuery('.cboxPrevent').remove(); jQuery('#cboxTitle').text(''); if(!jQuery('.pix_slide').hasClass('alreadyStopped') && jQuery('.pix_slide').length ){ jQuery('.pix_slide').pixwall_delightPlay(); } else { jQuery('.pix_slide').removeClass('alreadyStopped'); } } });
  514. });
  515. });
  516.  
  517. /******************************************************
  518. *
  519. * Slideshow shortcodes
  520. *
  521. ******************************************************/
  522. jQuery(function(){
  523. jQuery('.pix_cycle').each(function(){
  524. var t = jQuery(this);
  525. var h = jQuery('.pix_slide_caption', t).height()+40;
  526. var time = t.attr('data-time');
  527. var p = t.next('.pix_slider_prevnext').next('.pix_slider_nav');
  528. var prevB = t.next('.pix_slider_prevnext').find('.pix_slider_prev');
  529. var nextB = t.next('.pix_slider_prevnext').find('.pix_slider_next');
  530. jQuery('.pix_slide_caption',t).css({'bottom':'-'+h+'px'});
  531. jQuery(this).cycle({
  532. after: onAfter,
  533. before: onBefore,
  534. cleartype: true,
  535. cleartypeNoBg: false,
  536. pager: p,
  537. pause: true,
  538. timeout: time,
  539. prev: prevB,
  540. next: nextB
  541. });
  542. jQuery('.pix_slide_caption:first', t).animate({'bottom':'0'},250);
  543.  
  544. function onBefore(currSlideElement, nextSlideElement, options, forwardFlag) {
  545. var h = jQuery('.pix_slide_caption', currSlideElement).height()+80;
  546. jQuery('.pix_slide_caption', currSlideElement).animate({'bottom':'-'+h+'px'},250);
  547. }
  548. function onAfter(currSlideElement, nextSlideElement, options, forwardFlag) {
  549. jQuery('.pix_slide_caption', nextSlideElement).animate({'bottom':'0'},250);
  550. }
  551. var wT = t.width();
  552. var hT = t.height();
  553. jQuery('.pix_slider',t).width(wT).height(hT);
  554. });
  555.  
  556. });
  557.  
  558. /******************************************************
  559. *
  560. * Image overlay
  561. *
  562. ******************************************************/
  563. jQuery(function(){
  564. jQuery(".hentry a[href$='.jpg'], .hentry a[href$='.jpeg'], .hentry a[href$='.gif'], .hentry a[href$='.png'], .hentry a[href*='.jpg?'], .hentry a[href*='.jpeg?'], .hentry a[href*='.gif?'], .hentry a[href*='.png?']").each(function(){
  565. var w = jQuery('img',this).width(),
  566. h = jQuery('img',this).height();
  567.  
  568. if(!jQuery('body').hasClass('tax-gallery') && !jQuery(this).parent().hasClass('linkIcon') && jQuery('img',this).length){
  569. jQuery(this).append('<div class="linkIcon enlarge-icon" style="width:'+w+'px; height:'+h+'px">').wrapInner('<div class="imgHentry" />');
  570. }
  571. var theClass = jQuery('img',this).attr('class');
  572. jQuery('img',this).removeClass(theClass);
  573. jQuery('.imgHentry',this).addClass(theClass);
  574.  
  575. var a = jQuery('.linkIcon',this);
  576. var i = jQuery('img',this).css('display','block');
  577.  
  578. if (jQuery('.imgHentry',this).hasClass('aligncenter')){
  579. var wI = i.outerWidth();
  580. jQuery('.imgHentry',this).css({width:wI});
  581. }
  582.  
  583. a.show().animate({'opacity':0},0);
  584.  
  585. jQuery(this).hover(function(){
  586. i.stop(true,false).animate({'opacity':0.2},300);
  587. a.stop(true,false).animate({'opacity':1},300);
  588. },function(){
  589. i.stop(true,false).animate({'opacity':1},300);
  590. a.stop(true,false).animate({'opacity':0},300);
  591. });
  592.  
  593. });
  594. });
  595.  
  596. /******************************************************
  597. *
  598. * Ajax form
  599. *
  600. ******************************************************/
  601. jQuery(document).ready(function() {
  602.  
  603.  
  604. jQuery('.contactForm').each(function () {
  605. var t = jQuery(this);
  606. var hT = t.height();
  607. var wT = t.width();
  608. jQuery('.success, .unsuccess', t).height(hT).width(wT);
  609.  
  610.  
  611. jQuery('input[type=checkbox]',t).after('<div class="off-on"><div class="switcher"></div></div>').hide();
  612. jQuery('.off-on').each(function(){
  613. if(!jQuery(this).prev('input[type=checkbox]').is(':checked')){
  614. jQuery('.switcher',this).addClass('off');
  615. }
  616. jQuery('.off-on').live('click',function(){
  617. if(jQuery('.switcher',this).hasClass('off')){
  618. jQuery(this).prev('input[type=checkbox]').attr('checked', true);
  619. jQuery('.switcher',this).fadeIn(200,function(){
  620. jQuery(this).removeClass('off');
  621. });
  622. } else {
  623. jQuery(this).prev('input[type=checkbox]').attr('checked', false);
  624. jQuery('.switcher',this).fadeOut(200,function(){
  625. jQuery(this).addClass('off');
  626. });
  627. }
  628. });
  629. });
  630.  
  631. jQuery('input[type=radio]',t).after('<div class="radio-fake"><div class="radio-on"></div></div>').hide().click(function(){
  632. jQuery('input[type=radio]',t).each(function(){
  633. if(jQuery(this).is(':checked')){
  634. jQuery(this).next('.radio-fake').find('.radio-on').fadeIn(200,function(){
  635. jQuery(this).removeClass('off');
  636. });
  637. } else {
  638. jQuery(this).next('.radio-fake').find('.radio-on').fadeOut(200,function(){
  639. jQuery(this).addClass('off');
  640. });
  641. }
  642. });
  643. });
  644. jQuery('.radio-fake').each(function(){
  645. if(!jQuery(this).prev('input[type=radio]').is(':checked')){
  646. jQuery('.radio-on',this).addClass('off');
  647. }
  648. jQuery('.radio-fake').live('click',function(){
  649. jQuery(this).prev('input[type=radio]').click();
  650. });
  651. });
  652.  
  653.  
  654. jQuery('input[type=submit]',t).click(function () {
  655.  
  656. var data = 'captcha='+jQuery('input[name="captcha"]',t).val()+'&form='+t.attr('id');
  657. var allRequired = [];
  658. var allFields = [];
  659. var allValues = [];
  660. jQuery('input[type="checkbox"]').each(function(){
  661. if(!jQuery(this).is(':checked')){
  662. jQuery(this).val('');
  663. } else {
  664. jQuery(this).val('on');
  665. }
  666. })
  667. jQuery('input[type="radio"]').each(function(){
  668. var pV = jQuery(this).attr('data-value');
  669. if(!jQuery(this).is(':checked')){
  670. jQuery(this).val('');
  671. } else {
  672. jQuery(this).val(pV);
  673. }
  674. })
  675. jQuery('.required', t).each(function() {
  676. allRequired.push(jQuery(this).val());
  677. });
  678. var req = 0;
  679. var tag;
  680. var name;
  681. jQuery.each(allRequired, function(key, value) {
  682. tag = jQuery('.required:eq('+key+')', t).attr('type');
  683. if(tag!='radio'){
  684. if(allRequired[key]==''){
  685. jQuery('.required:eq('+key+')', t).css({'border-color':'#f00'});
  686. req = 1;
  687. } else {
  688. jQuery('.required:eq('+key+')', t).css({'border-color':'#eee'});
  689. }
  690. } else {
  691. name = jQuery('.required:eq('+key+')', t).attr('name');
  692. var radioVal;
  693. jQuery('input[type=radio][name="'+name+'"]', t).each(function(){
  694. radioVal = jQuery('input[type=radio][name="'+name+'"]:checked', t).val();
  695. jQuery(this).val(radioVal);
  696. });
  697. }
  698. });
  699. jQuery('.off-on').each(function(){
  700. if(jQuery(this).prev('input[type="checkbox"]').hasClass('required')){
  701. if(!jQuery(this).prev('input[type="checkbox"]').is(':checked')){
  702. jQuery(this).css({'border-color':'#f00'});
  703. } else {
  704. jQuery(this).css({'border-color':'#ccc'});
  705. }
  706. }
  707. });
  708. jQuery('.radio-fake').each(function(){
  709. name = jQuery('input[type=radio].required', t).attr('name');
  710. if(jQuery('input[type=radio].required', t).val()==''){
  711. jQuery('input[type=radio][name="'+name+'"]',t).next('.radio-fake').css({'border-color':'#f00'});
  712. } else {
  713. jQuery('input[type=radio][name="'+name+'"]',t).next('.radio-fake').css({'border-color':'#ccc'});
  714. }
  715. });
  716. var emailReq = jQuery('.required.email',t).val();
  717. var emailCheck = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
  718. if(!emailCheck.test(emailReq)) {
  719. jQuery('.required.email',t).css({'border-color':'#f00'});
  720. req = 1;
  721. }
  722. jQuery('input').not('.email').bind('change keyup blur',function(){
  723. if(jQuery(this).val()!=''){
  724. jQuery(this).css({'border-color':'#eee'});
  725. }
  726. })
  727. jQuery('select').bind('change',function(){
  728. if(jQuery(this).val()!=''){
  729. jQuery(this).css({'border-color':'#eee'});
  730. }
  731. })
  732. jQuery('input.email').bind('keyup blur',function(){
  733. if(!emailCheck.test(jQuery(this).val())) {
  734. jQuery(this).css({'border-color':'#eee'});
  735. }
  736. })
  737. jQuery('textarea').bind('keyup blur',function(){
  738. if(jQuery(this).val()!=''){
  739. jQuery(this).css({'border-color':'#eee'});
  740. }
  741. })
  742. if(req == 1){
  743. return false;
  744. }
  745.  
  746. jQuery('input, textarea, select', t).each(function() {
  747. allFields.push(jQuery(this).attr('data-name'));
  748. });
  749. jQuery('input, textarea, select', t).each(function() {
  750. allValues.push(jQuery(this).val());
  751. });
  752. jQuery.each(allFields, function(key, value) {
  753. if(allFields[key]){
  754. data = data+'&'+allFields[key] + '=value_'+key;
  755. }
  756. });
  757. jQuery.each(allValues, function(key, value) {
  758. data = data.replace('value_'+key, allValues[key]);
  759. });
  760. jQuery('.loading').show();
  761.  
  762. jQuery.ajax({
  763. url: "<?php echo get_template_directory_uri(); ?>/scripts/mailer/mailer.php",
  764. type: "GET",
  765. data: data,
  766. cache: false,
  767. success: function (html) {
  768. if (html==1) {
  769. jQuery('form',t).animate({'opacity':'0'},500);
  770. jQuery('.success',t).fadeIn('500');
  771. _gaq.push(['_trackPageview', '/sent-email-from-'+ t.attr('id')]);
  772. pageTracker = _gat._getTracker('/sent-email-from-'+ t.attr('id'));
  773. pageTracker._trackPageview();
  774. } else if (html=='noCaptcha') {
  775. jQuery('input[name="captcha"]',t).css({'border-color':'#f00'});
  776. jQuery('.recaptcha',t).click();
  777. } else {
  778. jQuery('form',t).animate({'opacity':'0'},500);
  779. jQuery('.unsuccess',t).fadeIn('500');
  780. }
  781. }
  782. });
  783.  
  784. return false;
  785. });
  786.  
  787. if(jQuery('#to',t).length!=0 && jQuery('#from',t).length!=0) {
  788. jQuery('#from',t).css({'width':'75%'}).after('<div class="wrapPeriod" style="float:left; width:49%; clear: left" />');
  789. jQuery('#to',t).css({'width':'75%'}).after('<div class="wrapPeriod" style="float:right; width:49%;" />');
  790. jQuery('#to',t).prev('label').prependTo(jQuery('#to',t).next(".wrapPeriod"));
  791. jQuery('#to',t).appendTo(jQuery('#to',t).next(".wrapPeriod"));
  792. jQuery('#from',t).prev('label').prependTo(jQuery('#from',t).next(".wrapPeriod"));
  793. jQuery('#from',t).appendTo(jQuery('#from',t).next(".wrapPeriod"));
  794. }
  795. });
  796. });
  797.  
  798. jQuery(window).one('load',function(){
  799. jQuery('aside .contactForm').each(function () {
  800. if(jQuery('.captchaCont', this).length!=0){
  801. var cS = jQuery('.captchaCont img#cryptogram', this).width();
  802. var rCs = jQuery('.recaptcha', this).width();
  803. var dS = jQuery('.captchaCont', this).width();
  804. jQuery('input[name="captcha"]', this).css('width',dS-(cS+rCs+12));
  805. }
  806. });
  807. jQuery('article .contactForm').each(function () {
  808. if(jQuery('.captchaCont', this).length!=0){
  809. var cS = jQuery('.captchaCont img#cryptogram', this).width();
  810. jQuery('input[name="captcha"]', this).css({'width':cS,'float':'left','margin':'3px 0 0 10px'});
  811. }
  812. });
  813. });
  814.  
  815.  
  816.  
  817. /******************************************************
  818. *
  819. * Date picker
  820. *
  821. ******************************************************/
  822. jQuery(function() {
  823. jQuery('.contactForm').each(function () {
  824. var t = jQuery(this);
  825. if(jQuery.isFunction(jQuery.fn.datepicker)){
  826. var dates = jQuery( "#from, #to", t ).datepicker({
  827. defaultDate: "+1w",
  828. changeMonth: false,
  829. numberOfMonths: 1,
  830. showOn: "both",
  831. buttonImage: "<?php echo get_template_directory_uri(); ?>/images/calendar.png",
  832. buttonImageOnly: true,
  833. onSelect: function( selectedDate ) {
  834. var option = this.id == "from" ? "minDate" : "maxDate",
  835. instance = jQuery( this ).data( "datepicker" ),
  836. date = jQuery.datepicker.parseDate(
  837. instance.settings.dateFormat ||
  838. jQuery.datepicker._defaults.dateFormat,
  839. selectedDate, instance.settings );
  840. dates.not( this ).datepicker( "option", option, date );
  841. }
  842. });
  843. }
  844. });
  845. });
  846.  
  847.  
  848. <?php
  849. $file = TEMPLATEPATH.'/language/datePicker/jquery.ui.datepicker-'.WPLANG.'.php';
  850. $file2 = get_template_directory_uri().'/language/datePicker/jquery.ui.datepicker-'.WPLANG.'.php';
  851. if (file_exists($file)) { ?>
  852. jQuery(function() {
  853. if(jQuery.isFunction(jQuery.fn.datepicker)){
  854. jQuery.getScript( ['<?php echo $file2; ?>'] );
  855. }
  856. });
  857. <?php }
  858. ?>
  859.  
  860.  
  861.  
  862. /******************************************************
  863. *
  864. * Tooltip
  865. *
  866. ******************************************************/
  867. jQuery(window).one('load',function(){
  868. jQuery('a.pix_clue_credits').each(function(){
  869. var t = jQuery(this);
  870. var api = jQuery(this).qtip('api');
  871. t.qtip({
  872. style: {
  873. tip: {
  874. corner: "bottomRight"
  875. },
  876. classes: "ui-tooltip-<?php echo get_pix_option('pix_tooltip_theme'); ?>",
  877. height: 'auto'
  878. },
  879. position: {
  880. target: "mouse",
  881. adjust: {
  882. mouse: false,
  883. y: -10
  884. },
  885. my: "bottom right",
  886. at: "bottom right"
  887. },
  888. show: {
  889. delay: 500,
  890. solo: true
  891. },
  892. content: jQuery('#pix_credits_pictures').html(),
  893. hide: {
  894. event: 'unfocus'
  895. },
  896. events: {
  897. show: function(event, api) {
  898. if ( jQuery('#pix_credits_pictures').text()!='' ) {
  899. jQuery('.ui-tooltip, .qtip').css({'width':150});
  900. api.set('content.text', jQuery('#pix_credits_pictures').html());
  901. } else {
  902. return false;
  903. }
  904. }
  905. }
  906. });
  907. });
  908. });
  909. jQuery(document).ready(function() {
  910. jQuery('.pix_after_tips').each(function(){
  911. var t = jQuery(this);
  912. var i = jQuery('body .pix_after_tips').index(t);
  913. t.attr('id','pix_after_tips'+i);
  914. t.prevAll('a').attr('data-rel','#pix_after_tips'+i).attr('href','#pix_after_tips'+i);
  915. });
  916.  
  917. jQuery('a.pix_tips, .pix_share a').each(function(){
  918. var t = jQuery(this);
  919. var w = t.attr('data-width');
  920. if(w==''){
  921. w = 280;
  922. }
  923. var h = t.attr('data-height');
  924. if(h==''){
  925. h = 'auto';
  926. }
  927. t.qtip({
  928. style: {
  929. tip: {
  930. corner: "bottomLeft"
  931. },
  932. classes: "ui-tooltip-<?php echo get_pix_option('pix_tooltip_theme'); ?>",
  933. height: h
  934. },
  935. position: {
  936. target: "mouse",
  937. adjust: {
  938. mouse: false,
  939. x: 10,
  940. y: -10
  941. },
  942. my: "bottom left",
  943. at: "bottom left"
  944. },
  945. show: {
  946. delay: 500,
  947. solo: true
  948. },
  949. content: t.attr('title'),
  950. events: {
  951. show: function(event, api) {
  952. jQuery('.ui-tooltip, .qtip').css({'width':w});
  953. }
  954. }
  955. });
  956. });
  957. jQuery('a.pix_tips_TR').each(function(){
  958. var t = jQuery(this);
  959. t.qtip({
  960. style: {
  961. tip: {
  962. corner: "topRight"
  963. },
  964. classes: "ui-tooltip-<?php echo get_pix_option('pix_tooltip_theme'); ?>"
  965. },
  966. position: {
  967. target: "mouse",
  968. adjust: {
  969. mouse: false,
  970. x: 10,
  971. y: 10
  972. },
  973. my: "top right",
  974. at: "top right"
  975. },
  976. show: {
  977. delay: 500,
  978. solo: true
  979. },
  980. content: t.attr('title')
  981. });
  982. });
  983. jQuery('a.pix_tips_ajax').each(function(){
  984. var t = jQuery(this);
  985. var w = t.attr('data-width');
  986. if(w==''){
  987. w = 280;
  988. }
  989. var h = t.attr('data-height');
  990. if(h==''){
  991. h = 'auto';
  992. }
  993. t.qtip({
  994. content: {
  995. text: '<img class="throbber" src="<?php echo get_template_directory_uri(); ?>/images/ajax-loader.gif" alt="<?php _e('Loading...','delight'); ?>">',
  996. ajax: {
  997. url: t.attr('data-rel')
  998. }
  999. },
  1000. style: {
  1001. tip: {
  1002. corner: "bottomLeft"
  1003. },
  1004. classes: "ui-tooltip-<?php echo get_pix_option('pix_tooltip_theme'); ?>",
  1005. height: h
  1006. },
  1007. position: {
  1008. target: "mouse",
  1009. adjust: {
  1010. mouse: false,
  1011. x: 10,
  1012. y: -10
  1013. },
  1014. my: "bottom left",
  1015. at: "bottom left"
  1016. },
  1017. show: {
  1018. delay: 500,
  1019. solo: true
  1020. },
  1021. hide: {
  1022. event: 'unfocus'
  1023. },
  1024. events: {
  1025. show: function(event, api) {
  1026. jQuery('.ui-tooltip, .qtip').css({'width':w});
  1027. }
  1028. }
  1029. });
  1030. });
  1031. });
  1032.  
  1033.  
  1034.  
  1035. /******************************************************
  1036. *
  1037. * Wide Google map
  1038. *
  1039. ******************************************************/
  1040. jQuery(window).one('load',function(){
  1041. if(jQuery('#pix_map_canvas').length !=0) {
  1042. var map,
  1043. mapEl = jQuery('#pix_map_canvas'),
  1044. lat = jQuery('#pix_map_canvas').attr('data-coord1'),
  1045. lng = jQuery('#pix_map_canvas').attr('data-coord2'),
  1046. pix_zoom = parseFloat(jQuery('#pix_map_canvas').attr('data-zoom')),
  1047. pix_type = jQuery('#pix_map_canvas').attr('data-type'),
  1048. pix_indications = jQuery('#pix_map_canvas').attr('data-indications'),
  1049. the_type;
  1050.  
  1051. if (pix_type=='HYBRID'){
  1052. the_type = google.maps.MapTypeId.HYBRID;
  1053. } else if (pix_type=='TERRAIN'){
  1054. the_type = google.maps.MapTypeId.TERRAIN;
  1055. } else if (pix_type=='SATELLITE'){
  1056. the_type = google.maps.MapTypeId.SATELLITE;
  1057. } else if (pix_type=='ROADMAP'){
  1058. the_type = google.maps.MapTypeId.ROADMAP;
  1059. }
  1060.  
  1061.  
  1062.  
  1063.  
  1064. var point = new google.maps.LatLng(lat,lng),
  1065. mapOptions = {
  1066. zoom : pix_zoom,
  1067. center : point,
  1068. mapTypeId : the_type,
  1069. mapTypeControl : false,
  1070. panControl : true,
  1071. panControlOptions : {
  1072. position : google.maps.ControlPosition.TOP_RIGHT
  1073. },
  1074. zoomControl : true,
  1075. zoomControlOptions : {
  1076. style : google.maps.ZoomControlStyle.SMALL,
  1077. position : google.maps.ControlPosition.TOP_RIGHT
  1078. },
  1079. streetViewControl : true,
  1080. streetViewControlOptions : {
  1081. position : google.maps.ControlPosition.TOP_RIGHT
  1082. }
  1083. };
  1084.  
  1085. map = new google.maps.Map(document.getElementById("pix_map_canvas"), mapOptions);
  1086. map.setTilt(45);
  1087.  
  1088.  
  1089. var coordInfoWindow = new google.maps.InfoWindow({maxWidth : 1024}),
  1090. latlngStr = pix_indications;
  1091.  
  1092. if(latlngStr!=''){
  1093. coordInfoWindow.setContent('<div class="iwstyle">'+latlngStr+'<div>');
  1094. coordInfoWindow.setPosition(point);
  1095. coordInfoWindow.open(map);
  1096. }
  1097. }
  1098.  
  1099. });
  1100. jQuery(window).bind('resize load',function(){
  1101. if (jQuery.browser.msie) {
  1102. var h = jQuery(window).height();
  1103. } else {
  1104. var h = window.innerHeight;
  1105. }
  1106. var w = jQuery(window).width();
  1107. jQuery('#outer_canvas').width(w+14).height(h);
  1108. jQuery('#pix_map_canvas').width(w+14).height(h);
  1109. });
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115. /******************************************************
  1116. *
  1117. * Refresh Cufon
  1118. *
  1119. ******************************************************/
  1120. jQuery(window).one('load',function() {
  1121. Cufon.refresh();
  1122. });
  1123.  
  1124.  
  1125.  
  1126.  
  1127. /******************************************************
  1128. *
  1129. * Wide flash
  1130. *
  1131. ******************************************************/
  1132. function thisMovie(movieName) {
  1133. if (navigator.appName.indexOf("Microsoft") != -1) {
  1134. return window[movieName]
  1135. }
  1136. else {
  1137. return document[movieName]
  1138. }
  1139. }
  1140.  
  1141. function playVideo() {
  1142. thisMovie("wide_flash").playVideo();
  1143. }
  1144. function pauseVideo() {
  1145. thisMovie("wide_flash").pauseVideo();
  1146. }
  1147. function resumeVideo() {
  1148. thisMovie("wide_flash").resumeVideo();
  1149. }
  1150. function muteVideo() {
  1151. thisMovie("wide_flash").muteVideo();
  1152. }
  1153. function unMuteVideo() {
  1154. thisMovie("wide_flash").unMuteVideo();
  1155. }
  1156. function rePlayVideo() {
  1157. if(jQuery('#pix_pause_slide').is(':visible')){
  1158. jQuery('#pix_pause_slide').hide();
  1159. }
  1160. if(jQuery('#pix_resume_slide').is(':visible')){
  1161. jQuery('#pix_resume_slide').hide();
  1162. }
  1163. if(!jQuery('#pix_play_slide').is(':visible')){
  1164. jQuery('#pix_play_slide').fadeIn(200);
  1165. }
  1166. }
  1167. function showPause() {
  1168. jQuery('#pix_pause_slide').show();
  1169. jQuery('#pix_resume_slide').hide();
  1170. jQuery('#pix_play_slide').hide();
  1171. }
  1172. function showPlay() {
  1173. jQuery('#pix_play_slide').show();
  1174. jQuery('#pix_pause_slide').hide();
  1175. jQuery('#pix_resume_slide').hide();
  1176. }
  1177.  
  1178. jQuery(window).one('load',function(){
  1179. jQuery('#pix_play_slide').live('click',function(){
  1180. playVideo();
  1181. jQuery(this).fadeOut(100,function(){
  1182. jQuery('#pix_pause_slide').fadeIn(200);
  1183. });
  1184. });
  1185.  
  1186. jQuery('#pix_pause_slide').live('click',function(){
  1187. pauseVideo();
  1188. jQuery(this).fadeOut(100,function(){
  1189. jQuery('#pix_resume_slide').fadeIn(200);
  1190. });
  1191. });
  1192.  
  1193. jQuery('#pix_resume_slide').live('click',function(){
  1194. resumeVideo();
  1195. jQuery(this).fadeOut(100,function(){
  1196. jQuery('#pix_pause_slide').fadeIn(200);
  1197. });
  1198. });
  1199.  
  1200. jQuery('#pix_mute_slide').live('click',function(){
  1201. muteVideo();
  1202. jQuery(this).fadeOut(100,function(){
  1203. jQuery('#pix_unmute_slide').fadeIn(200);
  1204. });
  1205. });
  1206.  
  1207. jQuery('#pix_unmute_slide').live('click',function(){
  1208. unMuteVideo();
  1209. jQuery(this).fadeOut(100,function(){
  1210. jQuery('#pix_mute_slide').fadeIn(200);
  1211. });
  1212. });
  1213. });
  1214.  
  1215.  
  1216.  
  1217. /******************************************************
  1218. *
  1219. * Portfolio images
  1220. *
  1221. ******************************************************/
  1222. function portfolioImages(){
  1223. jQuery('.imgHentry').each(function(){
  1224. var t = jQuery(this);
  1225. var i = jQuery('img',t);
  1226. var a = jQuery('.linkIcon',t);
  1227. a.show().find('a').animate({'opacity':0},0);
  1228.  
  1229. jQuery('a',t).each(function(){
  1230. var ti;
  1231. var ex;
  1232. var ac;
  1233. if(jQuery(this).attr('data-title')){
  1234. ti = '<strong style="font-size:1.2em">'+jQuery(this).attr('data-title')+'</strong><br>';
  1235. } else {
  1236. ti = '';
  1237. }
  1238. if(jQuery(this).attr('data-excerpt')){
  1239. ex = jQuery(this).attr('data-excerpt')+'<br>';
  1240. } else {
  1241. ex = '';
  1242. }
  1243. if(jQuery(this).attr('data-action')){
  1244. ac = '<strong>'+jQuery(this).attr('data-action')+'</strong><br>';
  1245. } else {
  1246. ac = '';
  1247. }
  1248. <?php if(!detectMobile()){ ?>
  1249. if(jQuery(this).attr('data-hide')!='hide'){
  1250. jQuery(this).qtip({
  1251. style: {
  1252. tip: {
  1253. corner: "bottomLeft"
  1254. },
  1255. classes: "ui-tooltip-<?php echo get_pix_option('pix_tooltip_theme'); ?>"
  1256. },
  1257. position: {
  1258. target: "mouse",
  1259. adjust: {
  1260. mouse: false,
  1261. x: 10,
  1262. y: -10
  1263. },
  1264. my: "bottom left",
  1265. at: "bottom left"
  1266. },
  1267. show: {
  1268. delay: 500,
  1269. solo: true
  1270. },
  1271. content: ti+ex+ac
  1272. });
  1273. }
  1274. <?php } ?>
  1275. });
  1276. t.hover(function(){
  1277. i.stop(true,false).animate({'opacity':0.2},300);
  1278. a.find('a').stop(true,false).animate({'opacity':1},300);
  1279. },function(){
  1280. i.stop(true,false).animate({'opacity':1},300);
  1281. a.find('a').stop(true,false).animate({'opacity':0},300);
  1282. });
  1283. });
  1284.  
  1285. }
  1286. jQuery(function(){
  1287. portfolioImages();
  1288. });
  1289.  
  1290.  
  1291.  
  1292.  
  1293. /******************************************************
  1294. *
  1295. * Filter tag
  1296. *
  1297. ******************************************************/
  1298. function filterTag() {
  1299. if(jQuery('#filtering-nav').length!=0){
  1300. jQuery('#filtering-nav a').each(function(){
  1301. var t = jQuery(this);
  1302. var dF = t.attr('data-filter');
  1303. var l = jQuery(dF).length;
  1304. if(dF!='*'&&l==0){
  1305. t.hide();
  1306. } else {
  1307. t.show();
  1308. }
  1309. });
  1310. }
  1311.  
  1312. }
  1313. jQuery(function(){
  1314. filterTag();
  1315. });
  1316.  
  1317.  
  1318. /******************************************************
  1319. *
  1320. * Portfolio layout
  1321. *
  1322. ******************************************************/
  1323. jQuery(function(){
  1324.  
  1325.  
  1326. var ha = 0;
  1327. if(jQuery('aside').length!=0){
  1328. ha = jQuery('aside').height();
  1329. }
  1330.  
  1331. if(jQuery('section.widepagePortfolio').length!=0){
  1332. var w = jQuery(window).width();
  1333. if(w > 1050){
  1334. w = jQuery(window).width()-300;
  1335. } else {
  1336. w = 1050 - 300;
  1337. }
  1338. jQuery('section.widepagePortfolio').css({'width':w,'float':'left','margin-left':'270px'})
  1339.  
  1340. jQuery(window).resize(function(){
  1341. w = jQuery(window).width();
  1342. if(w > 1050){
  1343. w = jQuery(window).width()-300;
  1344. } else {
  1345. w = 1050 - 300;
  1346. }
  1347. jQuery('section.widepagePortfolio').css({'width':w,'float':'left','margin-left':'270px'})
  1348. });
  1349. }
  1350.  
  1351.  
  1352. if(jQuery('div.isoFilter').length!=0){
  1353. var
  1354. speed = 400,
  1355. the_mode,
  1356. the_difference,
  1357. wall;
  1358. if(jQuery('section.widepagePortfolio').length!=0){
  1359. wall = jQuery('section div.isoFilter');
  1360. the_mode = 'masonry';
  1361. } else if(jQuery('section.pagePortfolio').length!=0) {
  1362. wall = jQuery('article div.isoFilter');
  1363. the_mode = 'fitRows';
  1364. jQuery(window).one('load',function(){
  1365. the_difference = 100+(jQuery('article > div').height() - (jQuery('.isoFilter').height() + jQuery('#filtering-nav').height()));
  1366. });
  1367. }
  1368.  
  1369.  
  1370.  
  1371. wall.imagesLoaded( function(){
  1372. wall.isotope({
  1373. masonry : {
  1374. columnWidth : '1'
  1375. },
  1376. itemSelector : '.hentry',
  1377. layoutMode : the_mode,
  1378. animationEngine : 'jquery',
  1379. animationOptions: {
  1380. duration: 400,
  1381. easing: 'linear',
  1382. queue: false
  1383. }
  1384. });
  1385. });
  1386.  
  1387. var colorClass = '.all';
  1388.  
  1389. jQuery('#filtering-nav a').click(function(){
  1390. colorClass = '.' + jQuery(this).attr('data-filter');
  1391. var selector = jQuery(this).attr('data-filter');
  1392. wall.isotope({ filter: selector });
  1393. setTimeout(function(){
  1394. var newH = jQuery('.isoFilter').height();
  1395. if(jQuery('#filtering-nav').length!=0){
  1396. var fH = jQuery('#filtering-nav').height();
  1397. } else {
  1398. var fH = 0;
  1399. }
  1400. if(jQuery('.pix_pagenavi').length!=0){
  1401. var bC = jQuery('.pix_pagenavi > ul').height();
  1402. } else {
  1403. var bC = 0;
  1404. }
  1405. jQuery('article').css({'height':(newH+the_difference+fH)});
  1406. var hs = 0;
  1407. if(jQuery('article').length!=0){
  1408. hs = jQuery('article').height()+(fH+bC);
  1409. }
  1410. articleAsideOpen(hs, ha);
  1411. jQuery(window).resize();
  1412. }, speed);
  1413. if ( !jQuery(this).hasClass('selected') ) {
  1414. jQuery(this).parents('#filtering-nav').find('.selected').removeClass('selected');
  1415. jQuery(this).addClass('selected');
  1416. }
  1417. return false;
  1418. });
  1419.  
  1420. if(jQuery.isFunction(jQuery.fn.infinitescroll)) {
  1421. wall.infinitescroll({
  1422. navSelector : 'a#page_nav:last',
  1423. nextSelector : 'a#page_nav:last',
  1424. itemSelector : '.hentry:not(.invis)',
  1425. loadingImg : pix_theme_dir+'/images/loader.gif',
  1426. loadingText : pix_loadingText,
  1427. donetext : pix_donetext,
  1428. debug: false,
  1429. errorCallback: function() {
  1430. jQuery('#infscr-loading').animate({opacity: .8},2000).fadeOut('normal');
  1431. }
  1432. },
  1433. function( newElements ) {
  1434. wall.isotope( 'appended', jQuery( newElements ),
  1435. function(){
  1436. setTimeout(function(){
  1437. var thisClass = jQuery('#filtering-nav a.selected').attr('data-filter');
  1438. if(thisClass!='*') {
  1439. jQuery('#filtering-nav a[data-filter="'+thisClass+'"]').click();
  1440. }
  1441. var newH = jQuery('.isoFilter').height();
  1442. filterTag();
  1443. if(jQuery('#filtering-nav').length!=0){
  1444. var fH = jQuery('#filtering-nav').height();
  1445. } else {
  1446. var fH = 0;
  1447. }
  1448. jQuery('article').css({'height':(newH+the_difference+fH+50)});
  1449. var hs = 0;
  1450. if(jQuery('article').length!=0){
  1451. hs = jQuery('article').height();
  1452. }
  1453. articleAsideOpen(hs, ha);
  1454. jQuery(window).resize();
  1455. portfolioImages();
  1456.  
  1457. }, speed+speed);
  1458.  
  1459. jQuery("a[href$='.jpg'], a[href$='.jpeg'], a[href$='.gif'], a[href$='.png'], a[href*='.jpg?'], a[href*='.jpeg?'], a[href*='.gif?'], a[href*='.png?']", newElements).not('.noColorBox').each(function(){
  1460. var dataRel = jQuery(this).attr('data-rel');
  1461. var dataTitle = jQuery(this).attr('data-description')!='' ? jQuery(this).attr('data-description') : jQuery(this).attr('data-title');
  1462. jQuery(this).colorbox({maxWidth:"98%", maxHeight:"98%", scrolling:false, rel:dataRel, current:"{current} / {total}", onComplete: function(){ jQuery('#cboxLoadedContent').prepend('<div class="cboxPrevent" />'); jQuery('#cboxTitle').html(dataTitle); if(!jQuery('.pix_slide').hasClass('stopped') && jQuery('.pix_slide').length ){ jQuery('.pix_slide').pixwall_delightStop(); } else { jQuery('.pix_slide').addClass('alreadyStopped'); } }, onClosed: function(){ jQuery('.cboxPrevent').remove(); jQuery('#cboxTitle').text(''); if(!jQuery('.pix_slide').hasClass('alreadyStopped') && jQuery('.pix_slide').length ){ jQuery('.pix_slide').pixwall_delightPlay(); } else { jQuery('.pix_slide').removeClass('alreadyStopped'); } } });
  1463. });
  1464. jQuery("a.play-icon", newElements).not('.noColorBox').each(function(){
  1465. var dataRel = jQuery(this).attr('data-rel');
  1466. var dataTitle = jQuery(this).attr('data-description')!='' ? jQuery(this).attr('data-description') : jQuery(this).attr('data-title');
  1467. jQuery(this).colorbox({iframe:true, innerWidth:800, innerHeight:450, scrolling:false, rel:dataRel, current:"{current} / {total}", onComplete: function(){ jQuery('#cboxTitle').html(dataTitle); if(!jQuery('.pix_slide').hasClass('stopped') && jQuery('.pix_slide').length ){ jQuery('.pix_slide').pixwall_delightStop(); } else { jQuery('.pix_slide').addClass('alreadyStopped'); } }, onClosed: function(){ jQuery('#cboxTitle').text(''); if(!jQuery('.pix_slide').hasClass('alreadyStopped') && jQuery('.pix_slide').length ){ jQuery('.pix_slide').pixwall_delightPlay(); } else { jQuery('.pix_slide').removeClass('alreadyStopped'); } } });
  1468. });
  1469. jQuery("a.iframe").not('.noColorBox').each(function(){
  1470. var dataRel = jQuery(this).attr('data-rel');
  1471. var dataTitle = jQuery(this).attr('data-description')!='' ? jQuery(this).attr('data-description') : jQuery(this).attr('data-title');
  1472. jQuery(this).colorbox({iframe:true, width:"85%", height:"95%", rel:dataRel, current:"{current} / {total}", onComplete: function(){ if(!jQuery('.pix_slide').hasClass('stopped') && jQuery('.pix_slide').length ){ jQuery('.pix_slide').pixwall_delightStop(); } else { jQuery('.pix_slide').addClass('alreadyStopped'); } jQuery('#cboxTitle').html(dataTitle); }, onClosed: function(){ if(!jQuery('.pix_slide').hasClass('alreadyStopped') && jQuery('.pix_slide').length ){ jQuery('.pix_slide').pixwall_delightPlay(); } else { jQuery('.pix_slide').removeClass('alreadyStopped'); } } });
  1473. });
  1474. }
  1475. );
  1476. }
  1477. );
  1478. }
  1479.  
  1480.  
  1481. jQuery(window).unbind('.infscr');
  1482.  
  1483. jQuery('a#page_nav').click(function(){
  1484.  
  1485. jQuery(document).trigger('retrieve.infscr');
  1486.  
  1487. return false;
  1488.  
  1489. });
  1490. jQuery(document).ajaxError(function(e,xhr,opt){
  1491. if (xhr.status == 404) {
  1492. jQuery('a#page_nav').remove();
  1493. }
  1494. });
  1495.  
  1496. }
  1497. });
  1498.  
  1499. /******************************************************
  1500. *
  1501. * Accordions
  1502. *
  1503. ******************************************************/
  1504. jQuery(function() {
  1505. if(jQuery('.pix_accordion').length!=0){
  1506. jQuery( '.pix_accordion' ).each(function(){
  1507. var aA = parseFloat(jQuery(this).attr('data-active'));
  1508. if(aA==0){
  1509. aA = 100000;
  1510. }
  1511. jQuery( this ).accordion({
  1512. heightStyle: 'content',
  1513. navigation: false,
  1514. collapsible: true,
  1515. icons: false,
  1516. header: 'a.header_accordion',
  1517. activate: function(event, ui) {
  1518. jQuery('.ui-state-active .icons',this).html('_');
  1519. jQuery('.ui-state-default .icons',this).html('&gt;');
  1520. jQuery('article, aside').css({'height':'auto'});
  1521. jQuery('article .entry-title:first, aside h3:first').unbind('click');
  1522. var hs = jQuery('article').height();
  1523. var ha = jQuery('aside').height();
  1524. articleAsideOpen(hs, ha);
  1525. jQuery(window).resize();
  1526. Cufon.refresh();
  1527.  
  1528. },
  1529. change: function(event, ui) {
  1530. jQuery('.ui-state-active .icons',this).html('_');
  1531. jQuery('.ui-state-default .icons',this).html('&gt;');
  1532. jQuery('article, aside').css({'height':'auto'});
  1533. jQuery('article .entry-title:first, aside h3:first').unbind('click');
  1534. var hs = jQuery('article').height();
  1535. var ha = jQuery('aside').height();
  1536. articleAsideOpen(hs, ha);
  1537. jQuery(window).resize();
  1538. Cufon.refresh();
  1539. },
  1540. create: function(event, ui) {
  1541. jQuery('.ui-state-default .icons',this).html('&gt;');
  1542. jQuery('.ui-state-active .icons',this).html('_');
  1543. jQuery(window).resize();
  1544. Cufon.refresh();
  1545. },
  1546. active: aA-1
  1547. });
  1548. });
  1549. }
  1550. });
  1551.  
  1552. /******************************************************
  1553. *
  1554. * Tabs
  1555. *
  1556. ******************************************************/
  1557. jQuery(window).one('load',function() {
  1558. if(jQuery('.pix_tabs').length!=0){
  1559. jQuery( '.pix_tabs' ).each(function(){
  1560. var aA = parseFloat(jQuery(this).attr('data-active'));
  1561. jQuery( this ).tabs({
  1562. icons: false,
  1563. show: function(event, ui) {
  1564. jQuery('article, aside').css({'height':'auto'});
  1565. jQuery('article .entry-title:first, aside h3:first').unbind('click');
  1566. var hs = jQuery('article').height();
  1567. var ha = jQuery('aside').height();
  1568. articleAsideOpen(hs, ha);
  1569. jQuery(window).resize();
  1570. Cufon.refresh();
  1571. },
  1572. fx: { opacity: 'toggle' },
  1573. selected: aA-1
  1574. });
  1575. });
  1576. }
  1577.  
  1578. });
  1579.  
  1580. /******************************************************
  1581. *
  1582. * Columns IE7 workaround
  1583. *
  1584. ******************************************************/
  1585. jQuery(function() {
  1586. if ((jQuery.browser.msie && jQuery.browser.version < 9) && jQuery('.pix_columns').length != 0) {
  1587.  
  1588. var w = jQuery('article > div').width();
  1589.  
  1590. jQuery('.pix_columns .col_two').css({'width':Math.floor(w*0.47)});
  1591. jQuery('.pix_columns .col_two').not('.last_column').css({'margin-right':Math.floor(w*0.06)});
  1592.  
  1593. jQuery('.pix_columns .col_three').css({'width':Math.floor(w*0.30)});
  1594. jQuery('.pix_columns .col_three').not('.last_column').css({'margin-right':Math.floor(w*0.05)});
  1595.  
  1596. jQuery('.pix_columns .col_two_three').css({'width':Math.floor(w*0.65)});
  1597. jQuery('.pix_columns .col_two_three').not('.last_column').css({'margin-right':Math.floor(w*0.05)});
  1598.  
  1599. jQuery('.pix_columns .col_four').css({'width':Math.floor(w*0.22)});
  1600. jQuery('.pix_columns .col_four').not('.last_column').css({'margin-right':Math.floor(w*0.04)});
  1601.  
  1602. jQuery('.pix_columns .col_two_four').css({'width':Math.floor(w*0.48)});
  1603. jQuery('.pix_columns .col_two_four').not('.last_column').css({'margin-right':Math.floor(w*0.04)});
  1604.  
  1605. jQuery('.pix_columns .col_three_four').css({'width':Math.floor(w*0.74)});
  1606. jQuery('.pix_columns .col_three_four').not('.last_column').css({'margin-right':Math.floor(w*0.04)});
  1607.  
  1608. jQuery('.pix_columns .col_five').css({'width':Math.floor(w*0.18)});
  1609. jQuery('.pix_columns .col_five').not('.last_column').css({'margin-right':Math.floor(w*0.025)});
  1610.  
  1611. jQuery('.pix_columns .col_two_five').css({'width':Math.floor(w*0.385)});
  1612. jQuery('.pix_columns .col_two_five').not('.last_column').css({'margin-right':Math.floor(w*0.025)});
  1613.  
  1614. jQuery('.pix_columns .col_three_five').css({'width':Math.floor(w*0.59)});
  1615. jQuery('.pix_columns .col_three_five').not('.last_column').css({'margin-right':Math.floor(w*0.025)});
  1616.  
  1617. }
  1618.  
  1619. });
  1620.  
  1621. /******************************************************
  1622. *
  1623. * Smoothscroll
  1624. *
  1625. ******************************************************/
  1626. jQuery(function(){
  1627. jQuery('a[href*=#]').click(function() {
  1628. if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
  1629. && location.hostname == this.hostname) {
  1630. var target = jQuery(this.hash);
  1631. target = target.length && target
  1632. || jQuery('[name="' + this.hash.slice(1) +'"]');
  1633. if (target.length) {
  1634. var targetOffset = target.offset().top;
  1635. jQuery('body')
  1636. .animate({scrollTop: targetOffset}, 1000);
  1637. jQuery('html')
  1638. .animate({scrollTop: targetOffset}, 1000);
  1639. return false;
  1640. }
  1641. }
  1642. });
  1643. });
  1644. /******************************************************
  1645. *
  1646. * Hover nav effect
  1647. *
  1648. ******************************************************/
  1649. jQuery(window).one('load',function(){
  1650. jQuery('nav > ul > li').has('ul').each(function(){
  1651. var w = parseFloat(jQuery(this).find('a:first').actual('width'));
  1652. var p = parseFloat(jQuery(this).find('a:first').css('padding-left').replace('px',''));
  1653. jQuery('a:first',this).after('&nbsp;<span class="submenu">&gt;</span>');
  1654. });
  1655. jQuery('nav > ul > li li').has('ul').each(function(){
  1656. var w = parseFloat(jQuery(this).find('a:first').actual('width'));
  1657. var p = parseFloat(jQuery(this).find('a:first').css('padding-left').replace('px',''));
  1658. jQuery('a:first',this).after('&nbsp;<span class="submenu">_</span>');
  1659. });
  1660. jQuery('nav li li ul').addClass('third_level_menu');
  1661.  
  1662. var le = jQuery('nav > ul > li').length;
  1663. jQuery('nav > ul > li').each(function(){
  1664. var Mw = jQuery(this).actual('width');
  1665. jQuery(this).css({'margin-left':'-'+(Mw+100)+'px'})
  1666. });
  1667. var i = 0;
  1668. <?php if(get_pix_option('pix_layout_animated')=='0') { ?>
  1669. jQuery('nav > ul > li').css({'margin-left':0});
  1670. <?php } else { ?>
  1671. while(i < le){
  1672. jQuery('nav > ul > li').eq(i).delay((i*100)+500).animate({'margin-left':0},1000,'easeOutQuint');
  1673. i++;
  1674. }
  1675. <?php } ?>
  1676. var hH = jQuery('header').height();
  1677. <?php if(get_pix_option('pix_layout_animated')=='0') { ?>
  1678. jQuery('header').css({'top':'-'+hH+'px'}).css({'visibility':'visible','top':0});
  1679. <?php } else { ?>
  1680. jQuery('header').css({'top':'-'+hH+'px'}).css({'visibility':'visible'}).animate({'top':0},1000);
  1681. <?php } ?>
  1682. <?php if(get_pix_option('pix_social_bar')!='hidden') { ?>
  1683. <?php if(get_pix_option('pix_social_bar')!='closed') { ?>
  1684. var sH = jQuery('#social_bar').height();
  1685. <?php if(get_pix_option('pix_layout_animated')=='0') { ?>
  1686. jQuery('#social_bar').not('.open').css({'margin-top':'-'+sH+'px'}).css({'visibility':'visible','margin-top':0});
  1687. jQuery('#social_bar.open').css({'visibility':'visible','margin-top':50});
  1688. <?php } else { ?>
  1689. jQuery('#social_bar').not('.open').css({'margin-top':'-'+sH+'px'}).css({'visibility':'visible'}).animate({'margin-top':0},1000);
  1690. jQuery('#social_bar.open').css({'margin-top':'-'+sH+'px'}).css({'visibility':'visible'}).animate({'margin-top':50},1000);
  1691. <?php } ?>
  1692. <?php } ?>
  1693. var cI = jQuery('.click.icons').height();
  1694. <?php if(get_pix_option('pix_layout_animated')=='0') { ?>
  1695. jQuery('.click.icons').css({'top':'-'+cI+'px'}).css({'visibility':'visible','top':0});
  1696. <?php } else { ?>
  1697. jQuery('.click.icons').css({'top':'-'+cI+'px'}).css({'visibility':'visible'}).animate({'top':0},1000);
  1698. <?php } ?>
  1699. <?php } ?>
  1700. var hF = 0;
  1701. if(jQuery('footer').length!=0){
  1702. hF = jQuery('footer').height();
  1703. <?php if(get_pix_option('pix_layout_animated')=='0') { ?>
  1704. jQuery('footer').css({'bottom':'-'+hH+'px'}).css({'visibility':'visible','bottom':0});
  1705. <?php } else { ?>
  1706. jQuery('footer').css({'bottom':'-'+hH+'px'}).css({'visibility':'visible'}).animate({'bottom':0},500);
  1707. <?php } ?>
  1708. }
  1709. if(jQuery('article').length!=0){
  1710. var aT = parseFloat(jQuery('article').css('top').replace('px',''));
  1711. var aH = jQuery('article').height();
  1712. <?php if(get_pix_option('pix_layout_animated')=='0') { ?>
  1713. jQuery('article').not('.open_toggle').css({'top':aT+aH+hF,'visibility':'visible','top':aT});
  1714. <?php } else { ?>
  1715. jQuery('article').not('.open_toggle').css({'top':aT+aH+hF,'visibility':'visible'}).delay(250).animate({'top':aT},1000);
  1716. <?php } ?>
  1717. }
  1718. if(jQuery('aside').length!=0){
  1719. var sT = parseFloat(jQuery('aside').css('top').replace('px',''));
  1720. var sH = jQuery('aside').height();
  1721. <?php if(get_pix_option('pix_layout_animated')=='0') { ?>
  1722. jQuery('aside').not('.open_toggle').css({'top':sT+sH+hF,'visibility':'visible','top':aT});
  1723. <?php } else { ?>
  1724. jQuery('aside').not('.open_toggle').css({'top':sT+sH+hF,'visibility':'visible'}).delay(250).animate({'top':aT},1000);
  1725. <?php } ?>
  1726. }
  1727. });
  1728. jQuery(window).one('load',function(){
  1729. jQuery('nav > ul > li').not(':has(ul)').each(function(){
  1730. var a = jQuery(this).find('a:first');
  1731. a.hoverIntent({
  1732. over: function(){jQuery(this).stop(true,false).animate({'border-right-width':'5px','padding-right':'15px'},100);},
  1733. out: function(){jQuery(this).stop(true,false).animate({'border-right-width':'0','padding-right':'20px'},100);},
  1734. timeout: 250
  1735. });
  1736. });
  1737. jQuery('nav > ul > li').has('ul').each(function(){
  1738. var a = jQuery(this).find('a:first');
  1739. var sub = jQuery(this).find('.submenu:first');
  1740. var w = 30+(a.actual('width'));
  1741. var u = jQuery(this).find('ul:first');
  1742. var sto;
  1743. u.find('li').not(':first').before('<li class="slash_li">/</li>');
  1744. jQuery('.third_level_menu .slash_li:first-child').remove();
  1745. var uW = u.actual('width');
  1746. u.each(function(){
  1747. jQuery(this).css({'left':'-'+(30+(uW-w))+'px','width':uW+'px'});
  1748. });
  1749. jQuery('nav ul.third_level_menu').hide();
  1750. uW = 2;
  1751. jQuery('> ul > li',this).each(function(){
  1752. var allLi = [];
  1753. allLi.push(jQuery(this).actual('width'));
  1754. jQuery.each(allLi, function(key, value) {
  1755. uW = uW + (allLi[key]);
  1756. });
  1757. });
  1758. jQuery('> ul',this).css({'left':'-'+(30+uW)+'px','width':uW});
  1759. jQuery('nav ul.third_level_menu').show();
  1760.  
  1761. function seThide(){
  1762. a.stop(true,false).animate({'padding-right':'20px'},100);
  1763. sub.stop(true,false).animate({'opacity':1,'right':'12px'},100);
  1764. u.stop(true,false).animate({'left':'-'+(uW+30)+'px'},200);
  1765. }
  1766. function seTout(){
  1767. sto = setTimeout(seThide,250);
  1768. }
  1769. <?php if (detectMobile()) { ?>
  1770. var t = jQuery(this);
  1771. a.bind('click',function(){
  1772. if(!t.hasClass('mobileOpen')){
  1773. w = 30+(a.actual('width'));
  1774. clearTimeout(sto);
  1775. a.stop(true,false).animate({'padding-right':'15px'},100);
  1776. sub.stop(true,false).animate({'opacity':0,'right':0},100);
  1777. u.stop(true,false).animate({'left':w-5},200);
  1778. t.toggleClass('mobileOpen');
  1779. return false;
  1780. a.unbind('click');
  1781. e.preventDefault();
  1782. } else {
  1783. seTout();
  1784. }
  1785. t.toggleClass('mobileOpen');
  1786. });
  1787. <?php } else { ?>
  1788. jQuery(this).hoverIntent({
  1789. over: function(){
  1790. w = 30+(a.actual('width'));
  1791. clearTimeout(sto);
  1792. a.stop(true,false).animate({'padding-right':'15px'},100);
  1793. sub.stop(true,false).animate({'opacity':0,'right':0},100);
  1794. u.stop(true,false).animate({'left':w-5},200);
  1795. },
  1796. out: seTout,
  1797. timeout: 250
  1798. });
  1799. <?php } ?>
  1800. });
  1801. jQuery('nav li').hover(function(){
  1802. jQuery(this).addClass('nav_li_hover');
  1803. },function(){
  1804. jQuery(this).removeClass('nav_li_hover');
  1805. });
  1806. jQuery('nav li li').has('ul').each(function(){
  1807. var ul = jQuery(this).find('ul:first');
  1808. var sub = jQuery(this).find('.submenu:first');
  1809. var ulW = 2;
  1810. var sto;
  1811. ul.find('> li').each(function(){
  1812. var allLi = [];
  1813. allLi.push(jQuery(this).actual('width'));
  1814. jQuery.each(allLi, function(key, value) {
  1815. ulW = ulW + (allLi[key]);
  1816. });
  1817. });
  1818. var thisH = jQuery(this).height();
  1819. ul.width(0).height(thisH-7);
  1820.  
  1821. function seThide(){
  1822. ul.css({'width':0,'margin-left':0}).hide();
  1823. sub.stop(true,false).animate({'top':'-2px','opacity':1},100);
  1824. jQuery('nav li').removeClass('nav_hover');
  1825. jQuery('nav li').css({'z-index':'1'});
  1826. }
  1827. function seTout(){
  1828. sto = setTimeout(seThide,250);
  1829. }
  1830. <?php if (detectMobile()) { ?>
  1831. var a = jQuery(this).find('a:first');
  1832. var t = jQuery(this);
  1833. a.bind('click',function(){
  1834. if(!t.hasClass('mobileOpen')){
  1835. clearTimeout(sto);
  1836. jQuery('nav li li ul').hide();
  1837. var offset = jQuery(this).offset();
  1838. if(offset.left+ulW>1050){
  1839. ul.css({'left':0,'top':thisH}).show().stop(true,false).animate({'width':ulW,'margin-left':(1050-offset.left)-ulW},200);
  1840. } else {
  1841. ul.css({'left':10,'top':thisH}).show().stop(true,false).animate({'width':ulW},200);
  1842. }
  1843. ul.parent().parent().parent().addClass('nav_hover');
  1844. jQuery('nav li').not('.nav_hover').css({'z-index':'-1'});
  1845. sub.stop(true,false).animate({'top':'15px','opacity':0},100);
  1846. t.toggleClass('mobileOpen');
  1847. return false;
  1848. a.unbind('click');
  1849. e.preventDefault();
  1850. } else {
  1851. seTout();
  1852. }
  1853. t.toggleClass('mobileOpen');
  1854. });
  1855. jQuery('html').click(function(){
  1856. seTout();
  1857. });
  1858. <?php } else { ?>
  1859. jQuery(this).hoverIntent({
  1860. over: function(){
  1861. clearTimeout(sto);
  1862. jQuery('nav li li ul').hide();
  1863. var offset = jQuery(this).offset();
  1864. if(offset.left+ulW>1050){
  1865. ul.css({'left':0,'top':thisH}).show().stop(true,false).animate({'width':ulW,'margin-left':(1050-offset.left)-ulW},200);
  1866. } else {
  1867. ul.css({'left':10,'top':thisH}).show().stop(true,false).animate({'width':ulW},200);
  1868. }
  1869. ul.parent().parent().parent().addClass('nav_hover');
  1870. jQuery('nav li').not('.nav_hover').css({'z-index':'-1'});
  1871. sub.stop(true,false).animate({'top':'15px','opacity':0},100);
  1872. },
  1873. out: seTout,
  1874. timeout: 250
  1875. });
  1876. <?php } ?>
  1877. });
  1878. Cufon.refresh();
  1879.  
  1880. });
  1881.  
  1882. /******************************************************
  1883. *
  1884. * Link with #
  1885. *
  1886. ******************************************************/
  1887. jQuery(function(){
  1888. jQuery('nav a').click(function(){
  1889. if(jQuery(this).attr('href')=='#'){
  1890. return false;
  1891. }
  1892. });
  1893. });
  1894.  
  1895. /******************************************************
  1896. *
  1897. * Show thumbs & thmb scroller
  1898. *
  1899. ******************************************************/
  1900. function navGhide(){
  1901. jQuery('#navgallery_wrap').fadeOut(200,function(){
  1902. jQuery('#credits_blog, #pix_controls').fadeIn(400);
  1903. });
  1904. }
  1905. var sto;
  1906. function seTout(){
  1907. sto = setTimeout(navGhide,1000);
  1908. }
  1909.  
  1910. function resizeThumbCont(){ //funzione per il resize del contenitore thumb
  1911. var w = jQuery(window).width();
  1912. jQuery('#navgallery_wrap, #scroll_wrapper').width(w-40); // 20+20 margine laterale
  1913. }
  1914.  
  1915. jQuery(window).bind('load resize',function(){
  1916. resizeThumbCont();
  1917. });
  1918.  
  1919.  
  1920. jQuery(window).one('load',function(){
  1921. jQuery('#navgallery_wrap').hide();
  1922. if(jQuery('#pix_show_thumbs').length!=0){
  1923. jQuery('#pix_show_thumbs').click(function(){
  1924. jQuery('#credits_blog, #pix_controls').fadeOut(200,function(){
  1925. jQuery('#navgallery_wrap').fadeIn(400);
  1926. });
  1927. });
  1928. jQuery('#navgallery_wrap').mouseout(function(){
  1929. seTout();
  1930. }).mouseover(function(){
  1931. clearTimeout(sto);
  1932. });
  1933. }
  1934.  
  1935.  
  1936. var wrapperW = (jQuery('.navgallery li').length)*(50+10+2);
  1937. jQuery('.navgallery').width(wrapperW);
  1938. var wrapW = jQuery('#navgallery_wrap').width();
  1939.  
  1940.  
  1941. if( wrapperW > wrapW ) {
  1942. jQuery("#navgallery_wrap").thumbnailScroller({
  1943. scrollerType:"hoverPrecise",
  1944. scrollerOrientation:"horizontal",
  1945. scrollSpeed:2,
  1946. scrollEasing:"easeOutCirc",
  1947. scrollEasingAmount:250,
  1948. acceleration:4,
  1949. scrollSpeed:300,
  1950. noScrollCenterSpace:10,
  1951. autoScrolling:0,
  1952. autoScrollingSpeed:2000,
  1953. autoScrollingEasing:"easeInOutQuad",
  1954. autoScrollingDelay:500
  1955. });
  1956. } else {
  1957. jQuery('.navgallery').css({'margin-left' : (wrapW - wrapperW) });
  1958. }
  1959. });
  1960.  
  1961.  
  1962. <?php /*if (detectMobile() && !detectIOS()) { ?>
  1963. jQuery(window).one('load',function(){
  1964. setTimeout(function(){
  1965. jQuery('*[data-height="100"]').each(function(){
  1966. var t = jQuery(this);
  1967. jQuery(window).bind('scroll load resize',function(){
  1968. var h = parseFloat(window.innerHeight);
  1969. t.css({'height':h+'px'});
  1970. });
  1971. });
  1972. jQuery('*[data-position="fixed"]').each(function(){
  1973. var t = jQuery(this);
  1974. t.css({'position':'absolute'});
  1975. var top = jQuery(this).attr('data-top');
  1976. var bottom = jQuery(this).attr('data-bottom');
  1977. var hT = parseFloat(t.height());
  1978. jQuery(window).bind('scroll load resize',function(){
  1979. var sumScroll = parseFloat(jQuery('html').scrollTop())+parseFloat(jQuery('body').scrollTop());
  1980. var h = parseFloat(window.innerHeight);
  1981. if(top!='not'){
  1982. t.css({'top':(sumScroll+parseFloat(top))+'px'});
  1983. } else {
  1984. t.css({'top':((sumScroll+h)-(parseFloat(bottom)+hT))+'px','bottom':''});
  1985. }
  1986. });
  1987. });
  1988. },2);
  1989. });
  1990. <?php }*/ ?>
  1991.  
  1992. jQuery(window).bind('load resize',function(){
  1993. var h = parseFloat(jQuery(window).height()),
  1994. off = parseFloat(jQuery('nav').offset().top),
  1995. hNav = parseFloat(jQuery('nav').outerHeight());
  1996. if ( (off+hNav)>h ) {
  1997. jQuery('header[data-position="fixed"], nav[data-position="fixed"]').css({position: 'absolute'});
  1998. } else {
  1999. jQuery('header[data-position="fixed"], nav[data-position="fixed"]').css({position: 'fixed'});
  2000. }
  2001. });
  2002.  
  2003. jQuery(window).one('load',function(){
  2004. jQuery('#plusone').hide();
  2005. });
  2006.  
  2007. jQuery(function(){
  2008. var hash = window.location.hash;
  2009. if(typeof hash !== 'undefined' && hash !== false && hash !== ''){
  2010. if(!jQuery('article').hasClass('open_toggle')){
  2011. window.location.hash = '';
  2012. }
  2013. }
  2014. });
  2015.  
  2016. jQuery(function() {
  2017. projekktor(".projekktor");
  2018. jQuery('audio').mediaelementplayer();
  2019. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement