From 49bd113b2a3e92c5a7dd9afef4d7bdfc789753d1 Mon Sep 17 00:00:00 2001 From: Sanj Date: Thu, 7 Jul 2011 20:04:09 +0530 Subject: [PATCH] scroll dots on article_frontend fixed --- edgware/editor/views.py | 3 +- edgware/static/js/articleMockup.js | 4 ++- edgware/static/js/editor.js | 39 +++++++++++++------------ edgware/templates/article_frontend.html | 1 - 4 files changed, 25 insertions(+), 22 deletions(-) diff --git a/edgware/editor/views.py b/edgware/editor/views.py index 60c5c01..cad291c 100644 --- a/edgware/editor/views.py +++ b/edgware/editor/views.py @@ -10,7 +10,7 @@ try: import json except: import simplejson as json -from django.template import Template, Context +from django.template import Template, Context, RequestContext from django.template.loader import get_template from os.path import join from settings import MEDIA_ROOT, SITE_BASE, UPLOAD_ROOT, PROJECT_PATH @@ -585,6 +585,7 @@ def article_webalone(request, article_id): 'articles_before': [], 'articles_after': [] } + d = RequestContext(request, d) return render_to_response("article_frontend.html", d) def poll_changes(request): diff --git a/edgware/static/js/articleMockup.js b/edgware/static/js/articleMockup.js index b50a694..67cd93f 100644 --- a/edgware/static/js/articleMockup.js +++ b/edgware/static/js/articleMockup.js @@ -48,7 +48,9 @@ $(document).ready(function() { // $('.audioBtn').colorbox({width: '350px', height: '180px', inline: true, href: '#audioWrap'}); $('.videoBtn').colorbox({width: '445px', height: '550px', inline: true, href: '#videoWrap'}); // $('.audioBtn').colorbox({width: '445px', height: '550px', inline: true, href: '#audioWrap'}); + scrollPages(); + $('#languageBtn').toggle(function() { $('.arabicBtn').hide(); $('.englishBtn').show(); @@ -70,7 +72,7 @@ function scrollPages() { var DOT_DEFAULT = '/static/images/pageOff.png'; var DOT_HOVER = '/static/images/pagehover.png'; var DOT_CURRENT = '/static/images/pageOn.png'; - var PAGE_HEIGHT = 1270; + var PAGE_HEIGHT = $('.page').eq(0).height() + 20; var OFFSET_VAL = 80; var noOfPages = $('.page').length; var currentPage = -1; diff --git a/edgware/static/js/editor.js b/edgware/static/js/editor.js index a1620ed..7ac9730 100644 --- a/edgware/static/js/editor.js +++ b/edgware/static/js/editor.js @@ -1341,7 +1341,7 @@ $(".box").live("mouseout", function(){ function cropImage(c) { - url = '/edit/imagebox/crop/?x1=' + c.x + '&y1=' + c.y + '&x2=' + c.x2 + '&y2=' + c.y2 + '&width=' + c.w + '&height=' + c.h + '&id=' + this_imagebox_id + '&uuid=' + UUID; + crop_url = '/edit/imagebox/crop/?x1=' + c.x + '&y1=' + c.y + '&x2=' + c.x2 + '&y2=' + c.y2 + '&width=' + c.w + '&height=' + c.h + '&id=' + this_imagebox_id + '&uuid=' + UUID; crop_dimensions = c; }; @@ -1534,28 +1534,29 @@ $(".box").live("click", function(e){ $(".do_crop_imagebox").bind("click", function(e){ e.preventDefault(); - box.resizable( 'enable' ); + box.resizable( 'enable' ); // console.log(url); - $.getJSON(url, { - 'article_id': ARTICLE_ID - }, function(data) { -// console.log(data.path); - new_top = parseInt(box_top) + crop_dimensions.y; - new_left = parseInt(box_left) + crop_dimensions.x; - boxObj.setCSS({'width': crop_dimensions.w, 'height': crop_dimensions.h}, false); - boxObj.setCSS({'top': new_top, 'left': new_left}); - jcrop.destroy(); - box.find('.edgeImage').attr("width", crop_dimensions.w); - box.find('.edgeImage').attr("height", crop_dimensions.h); - box.find('.edgeImage').attr('src', data.path); - $('.imagebox_crop').remove(); - text_edit_mode = false; - REVISION_NO = data.rev_id; - }); - }); + $.getJSON(crop_url, { + 'article_id': ARTICLE_ID + }, function(data) { + // console.log(data.path); + new_top = parseInt(box_top) + crop_dimensions.y; + new_left = parseInt(box_left) + crop_dimensions.x; + boxObj.setCSS({'width': crop_dimensions.w, 'height': crop_dimensions.h}, false); + boxObj.setCSS({'top': new_top, 'left': new_left}); + jcrop.destroy(); + box.find('.edgeImage').attr("width", crop_dimensions.w); + box.find('.edgeImage').attr("height", crop_dimensions.h); + box.find('.edgeImage').attr('src', data.path); + $('.imagebox_crop').remove(); + text_edit_mode = false; + REVISION_NO = data.rev_id; + }); + }); $(".cancel_crop_imagebox").bind("click", function(e){ + e.preventDefault(); jcrop.destroy(); $('.imagebox_crop').remove(); box.resizable( 'enable' ); diff --git a/edgware/templates/article_frontend.html b/edgware/templates/article_frontend.html index afc228c..e39ddfc 100644 --- a/edgware/templates/article_frontend.html +++ b/edgware/templates/article_frontend.html @@ -170,7 +170,6 @@ p {
االقائمة العربية English Menu
- {% autoescape off %} {% for p in pages %}