From bce07b41a01fc8a8a2940e8375b4652f1c2bf1d0 Mon Sep 17 00:00:00 2001 From: Karen Date: Wed, 4 Jan 2012 20:22:29 +0530 Subject: [PATCH] changes emailer, bottom right, static pages --- itf/static/css/modules/emailer.css | 2 +- itf/static/css/noel/inner-details.css | 4 +- itf/static/js/insidepage.js | 1025 +++++++++-------- itf/static/js/jquery-1.7.1.min.js | 4 + .../modules/emailer/emailerissue.html | 26 +- .../modules/festival/documentsubject.html | 1 - itf/templates/noel/base.html | 2 +- itf/templates/noel/staticpage.html | 5 + 8 files changed, 540 insertions(+), 529 deletions(-) create mode 100644 itf/static/js/jquery-1.7.1.min.js diff --git a/itf/static/css/modules/emailer.css b/itf/static/css/modules/emailer.css index 8dad64b..7bdf87a 100755 --- a/itf/static/css/modules/emailer.css +++ b/itf/static/css/modules/emailer.css @@ -166,7 +166,7 @@ .articleText p { margin-bottom:8px; - padding:8px; + padding:0px 8px; } .contentLinks { diff --git a/itf/static/css/noel/inner-details.css b/itf/static/css/noel/inner-details.css index 6030708..e47292b 100755 --- a/itf/static/css/noel/inner-details.css +++ b/itf/static/css/noel/inner-details.css @@ -32,8 +32,8 @@ margin-bottom: 8px; {color:#f7bd00; font-weight:bold;} -.itfInfo p -{padding-bottom:8px;} +/*.itfInfo p +{padding-bottom:8px;}*/ .thumbsDetails {width:164px; diff --git a/itf/static/js/insidepage.js b/itf/static/js/insidepage.js index bcbdba0..b38425d 100755 --- a/itf/static/js/insidepage.js +++ b/itf/static/js/insidepage.js @@ -1,512 +1,513 @@ -$('#listLeft ul li a').live("click", function() { - if ($(this).hasClass("listLeftSelected")) { - return false; - } - $('.listLeftSelected').removeClass("listLeftSelected"); - $(this).addClass('listLeftSelected'); - var objId = $(this).attr("data-id"); - var tab = $('.innerSelected').attr("data-slug"); - var formData = getSearchFormJSON(); - $('#textRight').text("Loading..."); - $('#bottomRight').text("Loading..."); - formData.object_id = objId; - var urlString = JSONtoQueryString(formData); - var urlString = JSONtoQueryString({ - 'tab': tab, - 'object_id': objId - }); - History.pushState(formData, "", urlString); - $.getJSON("/m/get_details", { - 'tab': tab, - 'object_id': objId - }, function(data) { - $('#imageInside').css({'backgroundImage': 'url(' + data.main_image.thumb + ')'}); - $('#textRight').text(data.title).formatTitle(); - var urlComponent = "?tab=" + $('.innerSelected').attr("data-slug") + "&object_id=" + objId; - var baseUrl = location.protocol + "//" + location.hostname + location.pathname; - var url = baseUrl + urlComponent; - -// var fb_url = url.replace("&", "&"); -// $('#fb_like').attr("data-href", fb_url); - var twitter_url = "https://twitter.com/share?url=" + encodeURIComponent(url) + "&title=" + encodeURIComponent(data.title); - $('#twitterBtn').attr("href", twitter_url); - $('#permalinkBtn').attr("href", url); - var searchTerm = $('.searchListField').val(); - var html = data.html; - if (searchTerm != '') { - for (var i=0; i" + searchTerm + ""); - } - $('#bottomRight').html(html); -// console.log(data); - }); - return false; -}); - -$('.lightboxNext').live("click", function(e) { - var $i = $(this).data("image"); - $i.click(); -}); - -$('.lightboxPrev').live("click", function(e) { - var $i = $(this).data("image"); - $i.click(); -}); - -$('.thumbsDetails').live("click", function(e) { -// alert($(this).attr("data-bigimage")); - var $that = $(this); - var totalImages = $(this).parent().find(".thumbsDetails").length; - var thisIndex = $(this).index(); - - if (thisIndex < (totalImages - 1)) { - var hasNext = true; - var nextImage = $(this).parent().find(".thumbsDetails").eq(thisIndex + 1); - var preloadImage = new Image(); - preloadImage.src = nextImage.attr("data-bigimage"); - } - - if (thisIndex > 0 && totalImages > 1) { - var hasPrev = true; - var prevImage = $(this).parent().find(".thumbsDetails").eq(thisIndex - 1); - } - var $lbox = $('#lightboxPanel'); - var $cont = $('
').addClass("lightboxContainer"); - var bigImage = $(this).attr("data-bigimage"); - var $img = $('').attr("src", bigImage).addClass("lightboxImg"); - $img.appendTo($cont); - var imgWidth = parseInt($that.attr("data-width")); - var imgHeight = parseInt($that.attr("data-height")); - var lightboxWidth = imgWidth + 40; - var lightboxHeight = imgHeight + 60; - $lbox.width(lightboxWidth); - $lbox.height(lightboxHeight); - var viewportWidth = $(window).width(); - var viewportHeight = $(window).height(); - if (viewportHeight < lightboxHeight) { - $lbox.height(viewportHeight - 40); - } - var lightboxTop = parseInt((viewportHeight - $lbox.height()) / 2); - $lbox.css({'top': lightboxTop + "px"}); - - - -// showLightbox($img); - var title = $(this).hasAttr("title") ? $(this).attr("title") : ''; -// var $c = $('#lightboxContent'); - - - if (title != '') { - var $caption = $('
').addClass("lightboxCaption").text(title).appendTo($cont); - } - if (hasNext) { - var $next = $('
').addClass("lightboxNext").text("next").data("image", nextImage).appendTo($cont); - } - if (hasPrev) { - var $prev = $('
').addClass("lightboxPrev").text("prev").data("image", prevImage).appendTo($cont); - } - showLightbox($cont); -}); - -function hideLightbox() { - $('#lightbox, #lightboxPanel').fadeOut(400); -} - -function showLightbox($content) { - if (!$('#lightbox').is("visible")) { - $('#lightbox, #lightboxPanel').fadeIn(400); - } - $('#lightboxContent').empty().append($content); -} - - -$('.toggleNext').live("click", function(e) { - e.preventDefault(); - var $next = $(this).next(); - if (!$next.is(":visible")) { - $next.slideDown(); - } else { - $next.slideUp(); - } -}); - -function highlightWordsNoCase(data, word) -{ - var regex = new RegExp("(" + word + ")", "gi"); - return data.replace(regex, "$1"); -} - -/* Get a jquery