Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Singular Template
- *
- * This is the default singular template. It is used when a more specific template can't be found to display
- * singular views of posts (any post type).
- *
- * @package Oxygen
- * @subpackage Template
- */
- /*function print_filters_for( $hook = '' ) {
- global $wp_filter;
- print '<pre>';
- //print_r( $wp_filter );
- foreach ($wp_filter as $flt=>$val) {
- echo $flt."\r\n";
- }
- print '</pre>';
- }*/
- /*remove_all_filters('the_content');
- remove_all_filters('single_template');*/
- ?>
- <!doctype html>
- <html <?php language_attributes(); ?>>
- <head>
- <meta http-equiv="Content-Type" content="<?php bloginfo( 'html_type' ); ?>; charset=win-1251" />
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <!-- Mobile viewport optimized -->
- <meta name="viewport" content="width=device-width,initial-scale=1">
- <!-- Favicon -->
- <?php if ( hybrid_get_setting( 'oxygen_favicon_url' ) ) { ?>
- <!-- Favicon -->
- <link rel="shortcut icon" href="<?php echo hybrid_get_setting( 'oxygen_favicon_url' ); ?>" />
- <?php } ?>
- <!-- Title -->
- <title><?php hybrid_document_title(); ?></title>
- <script type='text/javascript' src='<?php echo get_template_directory_uri(); ?>/jquery.min.js'></script>
- <script type="text/javascript">
- var gl_trig = false;
- var gl_moved;
- function zz(s) {
- console.log(s);
- }
- $(document).ready (init);
- //----------------------------------
- function repl_fifpix() {
- var alt_container = $('<div/>', {'id':'feed-alt-container'}).css('display','none');
- $(document.body).append(alt_container);
- //zz(alt_container.get(0).id);
- $('.fifpx-container').appendTo(alt_container);
- $('#feed-alt-container>div>div img').each(
- function(i, el) {
- var src = el.src;
- el.src = 'http://freedomplace.ru/diff/php_dbg/loader.php?thumb='+src;
- $(el).attr('width', '300px');
- }
- );
- $('#feed-alt-container>div>div').each(
- function(i, el) {
- $(el).css('width', '300px').css('height','150px');
- }
- );
- $('#feed-alt-container>div').each (
- function(i, el) {
- var img_cnt = $('img',$(el)).length;
- var tabb = $('#bigtabbs').children().filter(filt($(el)));
- var intabs = $('<div/>',{'class':'intabbs'}).data('clicked',false);
- var bigintabs = $('<div/>',{'class':'bigintabbs'});
- tabb.prepend(intabs);
- intabs.after(bigintabs);
- for (j=0; j<Math.ceil(img_cnt/12); j++) {
- var intab = $('<div/>',{'class':'tabb'}).data('pg',j).text(j+1);
- var bigintab = $('<div/>',{'class':'bigtabb'}).data('pg',j);
- intabs.append(intab);
- bigintabs.append(bigintab);
- $('div',$(el)).slice(0,12).appendTo(bigintab);
- var waituu = mk_defer (bigintab);
- $.when(waituu).done(
- defCallback(intab)
- );
- intab.click(intabclick( bigintabs, bigintab));
- }
- //--------------
- act4($(el));
- $('#tabbs').children().filter(filt($(el))).addClass('loaded');
- })
- }
- //----------------------------------
- function defCallback(intab) {
- return function() {
- intab.addClass('loaded');
- if (intab.parent().data('clicked')===false) {
- intab.parent().data('clicked',true);
- intab.trigger('click');
- }
- }
- }
- //----------------------------------
- function intabclick( bigintabs, bigintab) {
- return function() {
- $('div.bigtabb', bigintabs).fadeOut('slow');
- bigintab.fadeIn('slow');
- zz('pg='+bigintab.data('pg'));
- }
- }
- //----------------------------------
- function init() {
- var tabs = $('<div/>',{'id':'tabbs'});
- var bigtabs = $('<div/>',{'id':'bigtabbs'});
- $(document.body).prepend(tabs);
- tabs.after(bigtabs);
- $(document.body).prepend($('<h3/>').html(document.title));
- $(document.body).append('<div id="lbox"><div id="shade"></div> <div id="inpic"><img /></div></div>');
- //------------------------
- $('#lbox').click(function() {
- showlb(false);
- });
- //------------------------
- $('#inpic').click( function(event) {
- event = event || window.event;
- if (event.stopPropagation) {
- event.stopPropagation();
- } else {
- event.cancelBubble=true;
- };})
- //------------------------
- $('#inpic').bind('mousedown',mouseDown);
- $.each ($('#feed-container>h3'), function (i, el) {
- var uu = el.innerHTML.split(' ');
- var uuu = uu.indexOf('for');
- var zzstr = uu.slice(0,uuu).join(' ');
- tabs.append($('<div/>',{'class':'tabb'}).data('inf',i).text(zzstr));
- bigtabs.append($('<div/>',{'class':'bigtabb'}).data('inf',i));
- $(el).next().data('inf',i);
- });
- repl_fifpix();
- var els = $('#feed-container>div').filter(
- function() {
- return !$(this).hasClass('clr');
- });
- $.each (els, function(i, el) {
- var waitzz = mk_defer($(el));
- act4($(el));
- $.when(waitzz).done (
- function() {
- act($(el));
- }
- )
- })
- }
- //----------------------------------
- function filt(inel) {
- return function()
- {
- return $(this).data('inf')===inel.data('inf')};
- }
- //----------------------------------
- function filt4(inel) {
- return function() {
- return $(this).data('pg')===inel.data('pg')};
- }
- //----------------------------------
- function act4(inel) {
- $('#bigtabbs').children().filter(filt(inel)).append(inel.find('div'));
- var uuu = $('#tabbs').children().filter(filt(inel));
- uuu.click (function() {
- $('#bigtabbs>div.bigtabb').fadeOut('slow');
- $('#bigtabbs>div.bigtabb').filter(filt(inel)).fadeIn('slow');
- });
- }
- //----------------------------------
- function act(inel) {
- var uuu = $('#tabbs').children().filter(filt(inel));
- uuu.addClass('loaded');
- if (!gl_trig) {
- gl_trig = true;
- uuu.trigger('click');
- }
- }
- //----------------------------------
- function showlb(on) {
- if (on) {
- $('#lbox').css('width',screen.width+'px');
- $('#lbox').css('height',screen.height+'px');
- $('#lbox').fadeIn('slow');
- }
- else {
- $('#lbox').fadeOut('slow');
- }
- }
- //----------------------------------
- function lb_go(el) {
- /*var imz = new Image();
- imz.src = el.src;
- $(imz).load (function () { */
- var uuu = $(el).clone().attr('width','');
- $('#inpic').empty().append(uuu);
- //zz($(el).data('wd'));
- $('#inpic').css('left', Math.floor(screen.width/2-$(el).data('wd')/2)+'px');
- $('#inpic').css('top', Math.floor(screen.height/2-$(el).data('ht')/2)+'px');
- showlb(true);
- //});
- }
- //----------------------------------
- function mk_defer(inel) {
- var els = $('>div img', inel);
- var cnt = els.length;
- var waitzz = $.Deferred (
- function(dfd) {
- var n_els=0;
- $.each(els, function(i, el) {
- $(el).load(function() {
- var _im = $(this);
- imz = new Image();
- $(imz).load( function() {
- _im.data('wd', this.width);
- _im.data('ht',this.height);
- });
- imz.src=this.src;
- $(this).click(function() {
- lb_go(this);
- return false;
- });
- n_els++;
- if (n_els>=cnt-5)
- dfd.resolve();
- });
- $(el).error(function() {
- n_els++;
- if (n_els>=cnt-5)
- dfd.resolve();
- })
- });
- }).promise();
- return waitzz;
- };
- //-------------------------------------------------
- function mouseDown(e) {
- e= e || event;
- prevX=e.clientX;
- prevY=e.clientY;
- $('#inpic').bind('mousemove',mouseMove);
- $('#inpic').bind('mouseup',mouseUp);
- gl_moved=false;
- return false;
- }
- //----------------------------------
- function mouseMove(e) {
- e = e || event;
- var diffX = e.clientX-prevX;
- var diffY = e.clientY-prevY;
- prevX=e.clientX;
- prevY=e.clientY;
- $(this).css('left', (this.offsetLeft+diffX)+'px');
- $(this).css('top', (this.offsetTop+diffY)+'px');
- gl_moved=true;
- }
- //----------------------------------
- function mouseUp(e) {
- $(this).unbind('mouseup',mouseUp);
- $(this).unbind('mousemove',mouseMove);
- if (!gl_moved) {
- showlb(false);
- }
- }
- //-------------------------------------------------
- </script>
- <!-- Style settings -->
- <style type="text/css" media="all">
- h3 {
- font-family: helvetica, sans-serif;
- font-weight: normal;
- font-size: 18px;
- color: #555;
- }
- #lbox {
- position:fixed;
- top:0;
- left:0;
- }
- #shade {
- position:absolute;
- background-color:black;
- opacity:0.8;
- filter:alpha(opacity=80);
- top:0;
- left:0;
- width:100%;
- height:100%;
- z-index:100;
- }
- #inpic {
- position:absolute;
- z-index:200;
- cursor:pointer;
- }
- #tabbs, .intabbs {
- font-family: verdana, sans-serif;
- font-weight: bold;
- font-size: 12px;
- color: #aaa;
- margin:10px 0 0 0;
- }
- #bigtabbs, .bigintabbs {
- clear: left;
- float: left;
- margin: 30px 0 0 0;
- position: relative;
- min-height: 200px;
- width: 100%;
- }
- .tabb {
- float: left;
- margin: 4px 4px 0 0;
- padding: 4px 8px;
- background: #eee;
- border-radius:5px;
- -moz-border-radius:5px;
- -webkit-border-radius:5px;
- cursor: pointer;
- }
- .loaded {
- color: #555;
- }
- .loaded:hover {
- color: white;
- background: #555;
- }
- .bigtabb {
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- display: none;
- }
- /*-----------------------------------*/
- #feed-container h3 {
- font-family: helvetica, sans-serif;
- font-weight: normal;
- font-size: 18px;
- color: #555;
- padding: 8px 0 4px 30px;
- background: #eee;
- margin: 10px 0 0 0;
- display: none;
- }
- #feed-container div {
- display: none;
- }
- div.devimg {
- float:left;
- width:100px;
- height:100px;
- padding: 5px;
- overflow:hidden;
- border-right: solid 1px #999;
- border-top: solid 1px #999;
- }
- div.bigpic, div.ellf, div.kult, div.demotiv, div.fifpx,
- div.afisha, div.concerts, div.yapl, div.acid, div.liart {
- float:left;
- width:100px;
- height:100px;
- padding: 5px;
- margin: 0 4px 4px 0;
- overflow:hidden;
- border: solid 1px #999;
- //border-top: solid 1px #999;
- }
- div.clr {
- clear:left;
- }
- </style>
- </head>
- <body>
- <?php //print_filters_for( 'the_content' ); ?>
- <div id="feed-container">
- <?php if ( have_posts() ) : ?>
- <?php while ( have_posts() ) : the_post(); ?>
- <?php the_content(); ?>
- <?php endwhile; ?>
- <?php endif; ?>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement