and a few more changes

This commit is contained in:
Karen 2011-08-10 02:29:24 +05:30
commit 6c91759fb0
3 changed files with 35 additions and 1 deletions

View File

View File

@ -0,0 +1,29 @@
from django import template
register = template.Library()
'''
Used to format titles in the front slider boxes
>>>format_title("Script Bank")
>>>SCRIPT <b>BANK</b>
>>>format_title("Script-Bank")
>>>SCRIPT-<b>BANK</b>
'''
def format_title(value):
v = value.strip()
if v.find('-') != -1:
splitter = "-"
else:
splitter = " "
words = v.split(splitter)
l = len(words)
if l > 1:
boldWord = "<b>" + words[l - 1] + "</b>"
return (splitter.join(words[:l-1]) + splitter + boldWord).upper()
else:
return words[0].upper()
register.filter("format_title")

View File

@ -22,6 +22,7 @@ $(function() {
$('#arrowLeft').mouseout(function() { $('#arrowLeft').mouseout(function() {
clearInterval(slideInterval); clearInterval(slideInterval);
slider.stop();
}); });
$('#arrowRight').mouseover(function() { $('#arrowRight').mouseover(function() {
@ -33,6 +34,7 @@ $(function() {
$('#arrowRight').mouseout(function() { $('#arrowRight').mouseout(function() {
clearInterval(slideInterval); clearInterval(slideInterval);
slider.stop();
}); });
@ -67,7 +69,10 @@ var ItfSlider = function(o) {
var arrLeft = (0 - this.getLeft()) + (this.contentWidth - 10); var arrLeft = (0 - this.getLeft()) + (this.contentWidth - 10);
console.log(arrLeft); console.log(arrLeft);
this.rightArr.animate({'left': arrLeft + "px"}); this.rightArr.animate({'left': arrLeft + "px"});
} };
this.stop = function() {
this.ul.stop();
};
}; };
ItfSlider.prototype.moveLeft = function(distance, speed) { ItfSlider.prototype.moveLeft = function(distance, speed) {