Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var app = {
- sbСontainer: null,
- content: null,
- preloader: new Image(),
- messageContainer: null,
- footer: null,
- currentState: null,// 1 - featured, 2 - popular, 3 - collective
- currentImgIndex: null,
- imagesViews: {},
- imagesIds: [],
- excludedIds: [],
- imagesUrls: [],
- serverGetImagesProccessing: false,
- firstPageCid: null,
- isPreloaderShow: false,
- isDebug: true,
- init: function (state, imageId, isDebug) {
- this.currentState = state;
- this.isDebug = isDebug;
- this.sbСontainer = $('.gallery-social div.widgets');
- this.content = $('#content-container');
- this.footer = $('.footer');
- this.messageContainer = $('#message-container');
- this.preloader.src = '/public/img/desktop/preloader_min.gif';
- //Голосование
- this.content.on('click', 'a.vote', function (e) {
- e.preventDefault();
- var isLike = 1, unVote = 0, isReverce = 0;
- var cid = app.content.find('.content-table').attr('data-cid');
- if ($(this).hasClass('dislike')) {
- isLike = 0;
- }
- if ($(this).hasClass('active')) {
- unVote = 1;
- } else {
- if (isLike) {
- if (app.content.find('.gallery-left a.vote.dislike').hasClass('active')) {
- isReverce = 1;
- }
- } else {
- if (app.content.find('.gallery-right a.vote.like').hasClass('active')) {
- isReverce = 1;
- }
- }
- }
- $(this).toggleClass('active');
- if (isLike) {
- app.content.find('.gallery-left a.vote.dislike').removeClass('active');
- app.msg.console((unVote?'un':'')+'like '+cid);
- } else {
- app.content.find('.gallery-right a.vote.like').removeClass('active');
- app.msg.console((unVote?'un':'')+'dislike '+cid);
- }
- app.server.vote(cid, isLike, unVote, isReverce);
- });
- // ссылки влево и вправо
- this.content.on('click', '.gallery-left a.arrow, .gallery-right a.arrow', function (e) {
- app.pushHistory(e, $(this));
- $(this).toggleClass('active');
- if ($(this).closest('.gallery-left').length != 0) {
- app.showPrev();
- } else {
- app.showNext();
- }
- });
- this.content.on('click', '.image-margin', function (e) {
- app.pushHistory(e, $(this).find('a.arrow'));
- $(this).toggleClass('active');
- app.showNext();
- });
- // ссылки потоков
- this.content.on('click', '.feeds .links a', function (e) {
- app.pushHistory(e, $(this));
- app.changeFeed($(this).attr('data-feed'));
- });
- // вешаем событие на popstate которое срабатывает при нажатии back/forward в браузере
- $(window).bind("popstate", function (e) {
- app.msg.console('popstate ');
- var index = 0;
- if (e.originalEvent.state != null) {
- app.msg.console(e.originalEvent.state);
- var historyCid = app.utils.getCidFromUrl(e.originalEvent.state.url);
- app.firstPageCid = e.originalEvent.state.cid;
- if (historyCid != null) {
- if (app.imagesViews[historyCid] != undefined) {
- app.showView(historyCid);
- } else {
- app.server.getImage(app.currentState, historyCid, true);
- }
- }
- } else {
- if (app.firstPageCid != null) {
- if (app.imagesViews[app.firstPageCid] != undefined) {
- app.showView(app.firstPageCid);
- } else {
- app.server.getImage(app.currentState, app.firstPageCid, true);
- }
- }
- }
- });
- //переход по стрелкам влево/вправо
- $(document).keyup(app.onKeyUp);
- //сдвигание боковых элементов на больших картинках
- $(window).scroll(function () {
- app.utils.checkButtonsFloating.call(this);
- });
- //Загрузка первого контента
- app.server.getImages(this.currentState, app.constants.NUM_LOAD_IMAGES_FIRST, [], imageId);
- var footerTop = app.footer.offset().top;
- app.utils.calcImageMarginTop(app.content.find('.gallery-center'), footerTop);
- }, //init
- onKeyUp: function(e) {
- var keyCode = e.keyCode ? e.keyCode : e.which;
- var view = app.utils.getViewByIndex(app.currentImgIndex);
- if (keyCode == 37 && view != null && !view.find('.gallery-left a.arrow').hasClass('visibility_hidden')) {
- app.showPrev();
- } else if (keyCode == 39) {
- app.showNext();
- }
- },
- pushHistory: function(e, link) {
- e.preventDefault();
- var state = {
- url: link.attr("href"),
- title: null,
- cid: this.content.find('.content-table').attr('data-cid')
- };
- //app.msg.console('pushHistory ' + JSON.stringify(state));
- state.url = state.url.replace(new RegExp(".*//[a-z0-9\.]+/",'g'), document.location.origin + "/");
- // заносим ссылку в историю
- history.pushState(state, state.title, state.url);
- },
- showNext: function() {
- this.showImage(app.currentImgIndex + 1);
- },
- showPrev: function() {
- this.showImage(app.currentImgIndex - 1);
- },
- /**
- * @param state
- */
- changeFeed: function(state) {
- this.currentState = state;
- //Перерисовка кнопок потоков до загрузки контента ленты
- var feedLinks = this.content.find(".feeds .links a");
- $.each(feedLinks, function(index, link) {
- var lnk = $(link);
- if (lnk.attr('data-feed') != state) {
- lnk.removeClass('active');
- } else {
- if (!lnk.hasClass('active')) {
- lnk.addClass('active');
- }
- }
- });
- app.utils.clearCache();
- app.server.getImages(this.currentState, app.constants.NUM_LOAD_IMAGES_FIRST, this.excludedIds, null);
- },
- showImage: function(showIndex) {
- app.msg.console('showImage fired: '+showIndex);
- if (this.imagesIds.length == 0) {
- return;
- }
- if (showIndex < 0) {
- showIndex = this.imagesIds.length - 1;
- } else if (showIndex >= this.imagesIds.length) {
- if (this.serverGetImagesProccessing) {
- if (this.currentImgIndex < this.imagesIds.length) {
- this.currentImgIndex = showIndex;
- }
- return;
- }
- showIndex = 0;
- }
- this.currentImgIndex = showIndex;
- this._mainImgShowPicture(this.currentImgIndex);
- if ((this.currentImgIndex >= (this.imagesIds.length - 3)) && !this.serverGetImagesProccessing) {
- app.server.getImages(this.currentState, app.constants.NUM_LOAD_IMAGES_AFTER, this.excludedIds, null);
- }
- },
- _mainImgShowPicture: function(index) {
- var view = app.utils.getViewByIndex(index);
- if (view) {
- if (index == 0) {
- view.find('.gallery-left a.arrow').addClass('visibility_hidden');
- } else {
- view.find('.gallery-left a.arrow').removeClass('visibility_hidden');
- }
- view.find('.gallery-left a.arrow, .gallery-right a.arrow').removeClass('active');
- //установка ссылок на следующий и предыдущий контенты на границе стыковки разных пачек, полученных от сервера
- if (this.imagesUrls[index+1] != undefined) {
- view.find('.gallery-right a.arrow').attr('href', this.imagesUrls[index+1]);
- view.find('.gallery-center a.arrow').attr('href', this.imagesUrls[index+1]);
- var viewNext = app.utils.getViewByIndex(index+1);
- if (viewNext) {
- viewNext.find('.gallery-left a.arrow').attr('href', this.imagesUrls[index]);
- }
- }
- if (this.imagesUrls[index-1] != undefined) {
- view.find('.gallery-left a.arrow').attr('href', this.imagesUrls[index-1]);
- var viewPrev = app.utils.getViewByIndex(index-1);
- if (viewPrev) {
- viewPrev.find('.gallery-right a.arrow').attr('href', this.imagesUrls[index]);
- viewPrev.find('.gallery-center a.arrow').attr('href', this.imagesUrls[index]);
- }
- }
- app.content.empty();
- $.when(
- app.content.append(view)
- ).then(
- app._afterAppendActions(view)
- );
- app.isPreloaderShow = false;
- }
- },
- showView: function(cid) {
- if (this.imagesViews[cid] != undefined) {
- var view = this.imagesViews[cid];
- app.content.empty();
- var footerTop = app.footer.offset().top;
- $.when(
- app.content.append(view)
- ).then(
- app._afterAppendActions(view, footerTop)
- );
- this.currentImgIndex = app.utils.getCidIndex(cid);
- } else {
- app.msg.console('showView - nothing to show with cid: ' + cid);
- }
- },
- _afterAppendActions: function(view, footerTop) {
- var gc = view.find('.gallery-center');
- if (gc.find('a').length) {
- app.utils.setPageMetaInformation(gc);
- } else {
- app.utils.setPageMetaInformation(gc);
- }
- var img = gc.find('img');
- if (img.attr('data-margin') == 1) {
- img.css({'margin': app.utils.calcImageMarginBottom(img.attr('src'))});
- }
- if (gc.attr('data-abused') != 1) {
- app.utils.calcImageMarginTop(gc, footerTop);
- } else {
- gc.css('margin-top', 0);
- }
- app.socialButtons.redraw();
- app.utils.checkButtonsFloating();
- }
- };
- app.socialButtons = {
- init: function() {
- //Facebook
- app.sbСontainer.find('div.sb.display_none').each(function(index, elem) {
- var el = $(elem);
- if (!el.hasClass('rendered')) {
- FB.XFBML.parse(elem);
- $(el).addClass('rendered');
- }
- });
- //Twitter
- twttr.widgets.load();
- },
- vkCounter: 1,
- add: function(cid, url, meta, image) {
- var description = meta.tizer;
- var title = meta.title;
- var sbContent = $(app.constants.sbElem);
- sbContent.append("<div id='vk_" + app.socialButtons.vkCounter + "' class='vk'></div>");
- var vkButton = app.socialButtons.addVK(url, app.socialButtons.vkCounter++, title, description, image);
- var twButton = app.socialButtons.addTwitter(url, title);
- var fbButton = app.socialButtons.addFacebook(url);
- sbContent.append(vkButton).append(fbButton).append(twButton);
- sbContent.attr('data-cid', cid);
- app.sbСontainer.append(sbContent);
- },
- addVK: function(url, id, title, description, image){
- if(PROJECT_LANG == "ru") {
- VK.Widgets.Like("vk_"+id, {
- type: "mini",
- pageUrl: url,
- pageTitle: title,
- //pageDescription: description,
- pageDescription: 'Нажмите, чтобы посмотреть прикол',
- pageImage: image.attr('src')
- });
- }
- },
- addTwitter: function(url, text){
- return '<div class="tw"><a href="https://twitter.com/share" class="twitter-share-button" data-lang="'+PROJECT_LANG+'" data-url="'+url+'" data-count="horizontal" data-text="'+text+'" data-counturl="'+url+'">Tweet</a></div></div>';
- },
- addFacebook: function(url){
- return '<div class="fb-like" data-href="'+url+'" data-send="false" data-layout="button_count" data-show-faces="false"></div>';
- },
- remove: function(cid) {
- app.sbСontainer.find('div.sb').each(function(index, elem){
- if ($(elem).attr('data-cid') == cid) {
- $(elem).remove();
- }
- });
- },
- redraw: function() {
- app.sbСontainer.find('div.sb').each(function(index, elem){
- var el = $(elem);
- if (el.hasClass('display_block')) {
- el.toggleClass('display_block display_none');
- }
- });
- var fbCss = {width: '101px', height: '20px'};
- var cid = app.utils.getCidByIndex(app.currentImgIndex);
- if (cid) {
- var sbCurrent = app.sbСontainer.find('.sb[data-cid='+cid+']');
- sbCurrent.toggleClass('display_none display_block');
- sbCurrent.find('div.fb-like > span').css(fbCss);
- sbCurrent.find('div.fb-like > span > iframe').css(fbCss);
- }
- },
- clearContainer: function(){
- app.sbСontainer.empty();
- }
- };
- app.utils = {
- clearCache: function() {
- this.showPreloder();
- app.imagesIds = [];
- app.imagesUrls = [];
- app.excludedIds = [];
- app.imagesViews = {};
- app.currentImgIndex = null;
- app.socialButtons.clearContainer();
- },
- showPreloder: function() {
- var gc = app.content.find('.gallery-center');
- gc.attr('data-height', 60)
- .css('margin-top', 0)
- .find('img').attr('src', app.preloader.src)
- .css('margin', '0 auto');
- app.content.find('.gallery-right', '.gallery-left').empty();
- app.isPreloaderShow = true;
- app.utils.calcImageMarginTop(gc);
- },
- getCidFromUrl: function(url) {
- var list = url.split('/');
- var cid = list.pop();
- if (cid != 'f' && cid != 'p' && cid != 'c' && cid != '') {
- return cid;
- } else {
- return null;
- }
- },
- pushAndTrim: function(data) {
- app.msg.console('pushAndTrim');
- for (var i = 0; i < data.cids.length; i++) {
- var cid = data.cids[i];
- app.imagesIds.push(cid);
- app.imagesViews[cid] = $(data.views[i]);
- app.imagesUrls.push(data.urls[i]);
- var gc = app.imagesViews[cid].find('.gallery-center');
- var image = gc.find('img').eq(0);
- var tt = app.utils.getPageTitleTizer(gc);
- app.socialButtons.add(cid, gc.attr('data-link'), tt, image);
- if (app.imagesIds.length > app.constants.CACHE_LIMIT) {
- var shiftedCid = app.imagesIds.shift();
- app.imagesUrls.shift();
- app.socialButtons.remove(shiftedCid);
- app.currentImgIndex--;
- }
- }
- app.socialButtons.init();
- this.rebuildViews();
- },
- unshiftAndTrim: function(data) {
- app.msg.console('unshiftAndTrim');
- for (var i = 0; i < data.cids.length; i++) {
- var cid = data.cids[i];
- app.imagesIds.unshift(cid);
- app.imagesViews[cid] = $(data.views[i]);
- app.imagesUrls.unshift(data.urls[i]);
- app.currentImgIndex--;
- var gc = app.imagesViews[cid].find('.gallery-center');
- var image = gc.find('img').eq(0);
- var tt = app.utils.getPageTitleTizer(gc);
- app.socialButtons.add(cid, gc.attr('data-link'), tt, image);
- if (app.imagesIds.length > app.constants.CACHE_LIMIT) {
- var popedCid = app.imagesIds.pop();
- app.imagesUrls.pop();
- app.socialButtons.remove(popedCid);
- }
- }
- app.socialButtons.init();
- this.rebuildViews();
- },
- rebuildViews: function() {
- for (var cid in app.imagesViews) {
- var isOrphan = true;
- for (var i = 0; i < app.imagesIds.length; i++) {
- if (cid == app.imagesIds[i]) {
- isOrphan = false;
- break;
- }
- }
- //удаляем сироту
- if (isOrphan) {
- delete app.imagesViews[cid];
- }
- }
- },
- getCidIndex: function(cid) {
- var index = 0;
- for(var i = 0; i < app.imagesIds.length; i++) {
- if (app.imagesIds[i] == cid) {
- index = i;
- break;
- }
- }
- return index;
- },
- getUrlIndex: function(url) {
- var index = 0;
- for(var i = 0; i < app.imagesUrls.length; i++) {
- if (app.imagesUrls[i] == url) {
- index = i;
- break;
- }
- }
- return index;
- },
- getViewByIndex: function(index){
- var cid = this.getCidByIndex(index);
- if (cid != null) {
- if (app.imagesViews[cid] != undefined) {
- return app.imagesViews[cid];
- }
- }
- return null;
- },
- getCidByIndex: function(index){
- if (app.imagesIds[index] != undefined) {
- return app.imagesIds[index];
- }
- return null;
- },
- checkButtonsFloating: function() {
- var gs = app.sbСontainer.offset().top;
- var top = $(window).scrollTop();
- var offset = (top + 650);
- var windowHeight = $(window).height();
- var docHeight = $(document).height();
- if ((top + windowHeight) <= docHeight) {
- if (offset > gs && top > 0) {
- app.content.find('.gallery-right a.arrow, .gallery-left a.arrow').css('top', (415 - (offset - gs))+'px');
- app.content.find('.gallery-right a.vote, .gallery-left a.vote').css('top', (500 - (offset - gs)));
- app.content.find('.gallery-right div.likes-tooltip').css('top', (588 - (offset - gs)));
- } else {
- app.content.find('.gallery-right a.arrow, .gallery-left a.arrow').css('top', 415);
- app.content.find('.gallery-right a.vote, .gallery-left a.vote').css('top', 500);
- app.content.find('.gallery-right div.likes-tooltip').css('top', 588);
- }
- }
- },
- setPageMetaInformation: function(gc){
- var isImage = false, isAbused = false;
- if (gc.find('a').length) {
- isImage = true;
- }
- if (gc.attr('data-abused') == 1) {
- isAbused = true;
- }
- var tt = app.utils.getPageTitleTizer(gc);
- var title = tt.title;
- var tizer = tt.tizer;
- //Удаление старой мета инфы
- $('head meta[property^="og:"]')
- .add('head meta[name^="og:"]')
- .add('head meta[property^="twitter:"]')
- .add('head meta[name^="twitter:"]')
- .add('head link[rel="image_src"]')
- .remove();
- //общая мета инфа
- $('head title').text(title);
- $('head meta[name="description"]').attr('content', tizer);
- $('head').append('<meta property="og:title" content="'+title+'"/>')
- .append('<meta name="og:description" content="'+tizer+'"/>')
- .append('<meta name="og:site_name" content="'+app.utils.getProjectName()+'"/>')
- .append('<meta name="og:url" content="'+gc.attr('data-link')+'"/>');
- if (!isAbused) {
- $('head').append('<meta name="twitter:card" content="'+(!isImage?'player':'photo')+'" rr="'+isAbused+'"/>')
- .append('<meta name="twitter:site" content="@ifunny"/>')
- .append('<meta name="twitter:title" content="'+tizer+'"/>')
- .append('<meta name="twitter:description" content="'+(!isImage?'Click to see the video...':'Click to see the pic...')+'"/>');
- if (isImage) {
- var src = gc.find('img').attr('src');
- $('head').append('<meta name="twitter:image" content="'+src+'"/>')
- .append('<meta name="twitter:image:width" content="'+gc.attr('data-width')+'"/>')
- .append('<meta name="twitter:" content="'+gc.attr('data-height')+'"/>')
- .append('<meta name="og:type" content="article"/>')
- .append('<meta name="og:image" content="'+src+'"/>')
- .append('<link rel="image_src" href="'+src+'"/>');
- } else {
- $('head').append('<meta name="twitter:player" content="'+gc.find('iframe').attr('src')+'"/>')
- .append('<meta name="twitter:player:width" content="600"/>')
- .append('<meta name="twitter:player:height" content="480"/>');
- $('head').append('<meta name="og:video" content="http://www.youtube.com/v/'+gc.find('iframe').attr('data-vid')+'?version=3&autohide=1"/>')
- .append('<meta name="og:video:type" content="application/x-shockwave-flash"/>')
- .append('<meta name="og:video:width" content="600"/>')
- .append('<meta name="og:video:height" content="480"/>')
- .append('<meta name="og:type" content="video"/>')
- .append('<meta name="og:image" content="'+gc.find('iframe').attr('data-src')+'"/>')
- .append('<link rel="image_src" href="'+gc.find('iframe').attr('data-src')+'"/>');
- }
- }
- },
- getPageTitleTizer: function(gc) {
- var tizer = '';
- var title = '';
- if (gc.find('a').length) {
- tizer = gc.find('a').attr('title');
- } else {
- tizer = gc.find('iframe').attr('title');
- }
- if (tizer) {
- title = tizer + ' / ' + app.utils.getProjectName();
- } else {
- title = app.utils.getProjectName();
- }
- return {'title': title, 'tizer': tizer};
- },
- getProjectName: function() {
- return (PROJECT_LANG == 'ru') ? 'АйДаПрикол :)' : 'iFunny :)';
- },
- calcImageMarginBottom: function(src) {
- var margin = '0 auto';
- var img = new Image();
- img.src = src;
- var w = img.width;
- var h = img.height;
- var watermarkHeight = 20;
- var m = watermarkHeight;
- if (w > 600) {
- var rate = w / 600;
- var imgHeight = Math.ceil(h / rate);
- m = Math.round(imgHeight / h * watermarkHeight);
- }
- return margin += ' -'+m+'px';
- },
- calcImageMarginTop: function(gc, footerTop) {
- footerTop = footerTop || app.footer.offset().top;
- var contentHeight = (!gc.find('iframe').length) ? parseInt(gc.attr('data-height')) : 480;
- var feedOffset = 90 + 80;
- var contentTop = app.content.find('.feeds').offset().top + 55;
- var contentAreaHeight = footerTop - contentTop;
- app.msg.console('contentTop: '+contentTop);
- app.msg.console('footerTop: '+footerTop);
- app.msg.console('contentAreaHeight: '+contentAreaHeight+', contentHeight: '+contentHeight);
- var marginTop = 0;
- if (contentHeight < contentAreaHeight) {
- var marginTop = Math.round((contentAreaHeight - contentHeight) / 2);
- marginTop = (marginTop > feedOffset) ? marginTop-feedOffset : 0;
- app.msg.console('margin-top: '+marginTop);
- }
- gc.css('margin-top', marginTop);
- }
- }; //utils
- app.server = {
- /**
- * @param type
- * @param count
- * @param excludeIds
- * @param firstImg
- */
- getImages: function(type, count, excludeIds, firstImg) {
- app.msg.console('########## serverGetImages fired');
- var reqData = {'type': type, 'count': count, 'excludeIds': excludeIds.join(',')};
- if (firstImg) {
- reqData.firstImg = firstImg;
- }
- app.serverGetImagesProccessing = true;
- var lengthBefore = app.imagesIds.length;
- $.ajax({
- url: '/server/get-content/',
- type: "POST",
- data: reqData,
- success: function (data) {
- var isNeedShow = (app.currentImgIndex >= app.imagesIds.length);
- app.serverGetImagesProccessing = false;
- if (data.error) {
- app.msg.showError(data.error.text);
- return;
- }
- for (var i = 0; i < data.cids.length; i++) {
- app.excludedIds.push(data.cids[i]);
- }
- app.utils.pushAndTrim(data);
- if (app.imagesIds.length == 0) {
- return;
- }
- if (app.currentImgIndex == null) {
- app.currentImgIndex = 0;
- app.showImage(app.currentImgIndex);
- }
- app.msg.console('########## imagesIds.len: ' +app.imagesIds.length);
- },
- error: function(jqXHR, textStatus, errorThrown) {
- app.msg.showError(errorThrown);
- },
- dataType: 'json'
- });
- },
- /**
- * @param type
- * @param firstImg
- * @param isShowNewAfterAdd
- */
- getImage: function(type, firstImg, isShowNewAfterAdd) {
- app.msg.console('******* serverGetImage fired: ' + firstImg);
- // debugger;
- isShowNewAfterAdd = isShowNewAfterAdd || false;
- var reqData = {'type': type, 'count': 0, 'excludeIds': [], firstImg: firstImg};
- app.serverGetImagesProccessing = true;
- var lengthBefore = app.imagesIds.length;
- $.ajax({
- url: '/server/get-content/',
- type: "POST",
- data: reqData,
- success: function (data) {
- app.serverGetImagesProccessing = false;
- if (data.error) {
- app.msg.showError(data.error.text);
- return;
- }
- app.utils.unshiftAndTrim(data);
- if (isShowNewAfterAdd) {
- app.currentImgIndex = null;
- app.showImage(0);
- }
- app.msg.console('******* imagesIds.len: ' +app.imagesIds.length);
- },
- error: function(jqXHR, textStatus, errorThrown) {
- app.msg.showError(errorThrown);
- },
- dataType: 'json'
- });
- },
- /**
- * @param cid
- * @param isLike
- * @param unVote
- * @param isReverce
- */
- vote: function(cid, isLike, unVote, isReverce) {
- $.ajax({
- url: '/server/vote/',
- type: "POST",
- data: {cid: cid, isLike: isLike, unVote: unVote, isReverce: isReverce},
- success: function (data) {
- //app.content.find('div.likes-tooltip div.vc').html(data);
- },
- error: function(jqXHR, textStatus, errorThrown) {
- app.msg.showError(errorThrown);
- },
- cache: false,
- async: false
- });
- var inc = unVote ? -1 : 1;
- var vc = app.content.find('div.likes-tooltip div.vc');
- vc.html(parseInt(vc.text()) + inc);
- }
- };
- app.msg = {
- showError: function(text){
- if (app.messageContainer.is(':visible').length > 0) {
- hideMessageContainer(0);
- }
- app.messageContainer.html('<strong>Error!</strong> ' + text).fadeIn(400);
- setTimeout(app.msg.hideError, 3000);
- if (app.isPreloaderShow || true) {
- app.content.find('.gallery-center .image-margin').empty().append(
- $('<a href="#">Refresh page</a>').click(function(e){
- e.preventDefault();
- document.location = document.location;
- })
- ).toggleClass('image-margin refresh-page');
- }
- },
- hideError: function(duration) {
- duration = duration || 400;
- app.messageContainer.fadeOut(duration);
- },
- console: function(text) {
- if (app.isDebug) {
- console.log(text);
- }
- }
- };
- app.constants = {
- CACHE_LIMIT: 9,
- NUM_LOAD_IMAGES_FIRST: 6,
- NUM_LOAD_IMAGES_AFTER: 3,
- sbElem: '<div class="sb display_none" data-cid=""></div>'
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement