forked from expo/troggle
[svn] Fixed small semantics issues stopping base.js working with IE.
Made toggle eyecandy persistent (using a cookie) Made toggle eyecandy turn off footer menu images Only load footer menu images if the eyecandy is being used.
This commit is contained in:
parent
06f7bfa979
commit
b847bde6b7
@ -149,4 +149,7 @@ def downloadQMs(request):
|
|||||||
def ajax_test(request):
|
def ajax_test(request):
|
||||||
post_text = request.POST['post_data']
|
post_text = request.POST['post_data']
|
||||||
return HttpResponse("{'response_text': '"+post_text+" recieved.'}",
|
return HttpResponse("{'response_text': '"+post_text+" recieved.'}",
|
||||||
mimetype="application/json")
|
mimetype="application/json")
|
||||||
|
|
||||||
|
def eyecandy(request):
|
||||||
|
return render_response(request,'eyecandy.html', {})
|
||||||
|
@ -10,34 +10,40 @@ function setMaxHeight(group, target) {
|
|||||||
thisHeight = $(this).height();
|
thisHeight = $(this).height();
|
||||||
if(thisHeight > tallest) {
|
if(thisHeight > tallest) {
|
||||||
tallest = thisHeight;
|
tallest = thisHeight;
|
||||||
}
|
};
|
||||||
});
|
});
|
||||||
target.height(tallest);
|
target.height(tallest);
|
||||||
}
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*This is the jquery stuff */
|
/*This is the jquery stuff */
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
$('.searchable li').quicksearch({
|
$('.searchable li').quicksearch({
|
||||||
position: 'before',
|
position: 'before',
|
||||||
attached: 'ul.searchable',
|
attached: 'ul.searchable',
|
||||||
labelText: '',
|
labelText: '',
|
||||||
loaderText: '',
|
loaderText: '',
|
||||||
delay: 100
|
delay: 100});
|
||||||
})
|
|
||||||
|
|
||||||
$('table.searchable tr').quicksearch({
|
$('table.searchable tr').quicksearch({
|
||||||
position: 'before',
|
position: 'before',
|
||||||
attached: 'table.searchable:first',
|
attached: 'table.searchable:first'});
|
||||||
});
|
|
||||||
|
|
||||||
$(".toggleEyeCandy").click(function () {
|
$(".killEyeCandy").click(function () {
|
||||||
$(".leftMargin,.rightMargin").toggle("fade");
|
killEyeCandy();
|
||||||
$(".toggleEyeCandy").toggle();
|
setCookie("eyeCandy", "False", 100);
|
||||||
});
|
}
|
||||||
|
);
|
||||||
|
|
||||||
$(".toggleMenu").click(function () {
|
$(".showEyeCandy").click(function () {
|
||||||
|
showEyeCandy();
|
||||||
|
setCookie("eyeCandy", "True", 100);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
$(".toggleMenu").click(function () {
|
||||||
$("ul.dropdown li:not(.toggleMenu)").toggle();
|
$("ul.dropdown li:not(.toggleMenu)").toggle();
|
||||||
$(".toggleMenu").toggle();
|
$(".toggleMenu").toggle();
|
||||||
});
|
});
|
||||||
@ -52,30 +58,50 @@ $("a.closeDiv").click(function () {
|
|||||||
|
|
||||||
/*$("#footerLinks").hover(
|
/*$("#footerLinks").hover(
|
||||||
function() {$(".footer").fadeIn("slow")},
|
function() {$(".footer").fadeIn("slow")},
|
||||||
function() {$(".footer").fadeOut("slow")}
|
function() {$(".footer").fadeOut("slow")}
|
||||||
);*/
|
);*/
|
||||||
|
|
||||||
function linkHover(hoverLink,image){
|
function linkHover(hoverLink,image){
|
||||||
|
|
||||||
$(hoverLink).hover(
|
$(hoverLink).bind('mouseover',
|
||||||
function() {
|
function() {
|
||||||
$(image).fadeIn("slow");
|
$(image).stop().css("opacity", "1.0").fadeIn("slow");
|
||||||
/* $(hoverLink).css("background","gray");*/
|
/* $(hoverLink).css("background","gray");*/
|
||||||
},
|
});
|
||||||
|
$(hoverLink).bind('mouseout',
|
||||||
function() {
|
function() {
|
||||||
$(image).fadeOut("slow");
|
$(image).stop().fadeOut("slow");
|
||||||
/* $(hoverLink).css("background","black");*/
|
/* $(hoverLink).css("background","black");*/
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function showEyeCandy(){
|
||||||
|
$("#eyeCandyFooterPopUps").load("/eyecandy");
|
||||||
|
$(".leftMargin,.rightMargin").show();
|
||||||
|
$(".showEyeCandy").hide();
|
||||||
|
$(".killEyeCandy").show();
|
||||||
linkHover("#cavesLink","#richardBanner");
|
linkHover("#cavesLink","#richardBanner");
|
||||||
linkHover("#caversLink","#timeMachine");
|
linkHover("#caversLink","#timeMachine");
|
||||||
linkHover("#surveyBinderLink","#surveyHover");
|
linkHover("#surveyBinderLink","#surveyHover");
|
||||||
linkHover("#troggle","#timeMachine");
|
linkHover("#troggle","#timeMachine");};
|
||||||
|
|
||||||
|
function killEyeCandy(){
|
||||||
|
$(".leftMargin,.rightMargin").hide();
|
||||||
|
$(".showEyeCandy").show();
|
||||||
|
$(".killEyeCandy").hide();
|
||||||
|
$("#cavesLink").unbind('mouseover').unbind('mouseout');
|
||||||
|
$("#caversLink").unbind('mouseover').unbind('mouseout');
|
||||||
|
$("#surveyBinderLink").unbind('mouseover').unbind('mouseout');
|
||||||
|
$("#troggle").unbind('mouseover').unbind('mouseout');};
|
||||||
|
|
||||||
|
if (getCookie("eyeCandy") == "False")
|
||||||
|
{killEyeCandy();}
|
||||||
|
else
|
||||||
|
{showEyeCandy();}
|
||||||
|
|
||||||
/*dropdown (well, up actually) menu code from http://css-tricks.com/simple-jquery-dropdowns/*/
|
/*dropdown (well, up actually) menu code from http://css-tricks.com/simple-jquery-dropdowns/*/
|
||||||
$("ul.dropdown li").hover(
|
$("ul.dropdown li").hover(
|
||||||
@ -83,7 +109,7 @@ $("ul.dropdown li").hover(
|
|||||||
$(this).addClass("hover");
|
$(this).addClass("hover");
|
||||||
$('ul:first',this).css('visibility','visible')
|
$('ul:first',this).css('visibility','visible')
|
||||||
},
|
},
|
||||||
|
|
||||||
function(){
|
function(){
|
||||||
$(this).removeClass("hover");
|
$(this).removeClass("hover");
|
||||||
$('ul:first',this).css('visibility', 'hidden');
|
$('ul:first',this).css('visibility', 'hidden');
|
||||||
@ -94,3 +120,28 @@ $("ul.dropdown li").hover(
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/* Cookies */
|
||||||
|
function setCookie(c_name,value,expiredays)
|
||||||
|
{
|
||||||
|
var exdate=new Date();
|
||||||
|
exdate.setDate(exdate.getDate()+expiredays);
|
||||||
|
document.cookie=c_name + "=" +escape(value) +
|
||||||
|
((expiredays==null) ? "" : ";expires="+exdate.toGMTString()) + ";path=/";
|
||||||
|
}
|
||||||
|
|
||||||
|
function getCookie(c_name)
|
||||||
|
{
|
||||||
|
if (document.cookie.length>0)
|
||||||
|
{
|
||||||
|
c_start=document.cookie.indexOf(c_name + "=");
|
||||||
|
if (c_start!=-1)
|
||||||
|
{
|
||||||
|
c_start=c_start + c_name.length+1;
|
||||||
|
c_end=document.cookie.indexOf(";",c_start);
|
||||||
|
if (c_end==-1) c_end=document.cookie.length;
|
||||||
|
return unescape(document.cookie.substring(c_start,c_end));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
};
|
@ -27,9 +27,9 @@ window.onload = contentHeight;
|
|||||||
{% endif %}.
|
{% endif %}.
|
||||||
| <a href="{% url auth_logout %}">Log out</a> {% else %} <a href="{% url registration_register %}">Sign up</a> | <a href="{% url auth_login %}">Log in</a> {% endif %}
|
| <a href="{% url auth_logout %}">Log out</a> {% else %} <a href="{% url registration_register %}">Sign up</a> | <a href="{% url auth_login %}">Log in</a> {% endif %}
|
||||||
{% endblock%}
|
{% endblock%}
|
||||||
| <a href="{{ settings.URL_ROOT }}">Home</a> | <a class="toggleEyeCandy">Kill Eyecandy</a><a class="toggleEyeCandy" style="display: none;">Show Eyecandy</a>
|
| <a href="{{ settings.URL_ROOT }}">Home</a> | <a class="killEyeCandy">Kill Eyecandy</a><a class="showEyeCandy" style="display: none;">Show Eyecandy</a>
|
||||||
{% block editLink %}
|
{% block editLink %}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -42,19 +42,18 @@ window.onload = contentHeight;
|
|||||||
|
|
||||||
|
|
||||||
<div id="content" >
|
<div id="content" >
|
||||||
|
|
||||||
{% block contentheader %}
|
{% block contentheader %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
REPLACE : The content
|
REPLACE : The content
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<img id="richardBanner" class="footer eyeCandy" src="{{ settings.MEDIA_URL }}expoBanner.gif"/>
|
</div>
|
||||||
<img id="timeMachine" class="footer eyeCandy" src="{{ settings.MEDIA_URL }}timemachine.gif"/>
|
<div id="eyeCandyFooterPopUps" class = "eyeCandy">
|
||||||
<img id="surveyHover" class="footer eyeCandy" src="{{ settings.MEDIA_URL }}surveyHover.gif"/>
|
|
||||||
|
</div>
|
||||||
{% block margins %}
|
{% block margins %}
|
||||||
<img class="leftMargin eyeCandy" src="{{ settings.MEDIA_URL }}eieshole.jpg">
|
<img class="leftMargin eyeCandy" src="{{ settings.MEDIA_URL }}eieshole.jpg">
|
||||||
<img class="rightMargin eyeCandy" src="{{ settings.MEDIA_URL }}goesser.jpg">
|
<img class="rightMargin eyeCandy" src="{{ settings.MEDIA_URL }}goesser.jpg">
|
||||||
@ -90,9 +89,9 @@ window.onload = contentHeight;
|
|||||||
<li><a id="cuccLink" href="{% url controlpanel %}">Import / export data</a></li>
|
<li><a id="cuccLink" href="{% url controlpanel %}">Import / export data</a></li>
|
||||||
<li><a id="expoWebsiteLink" href="{{ settings.URL_ROOT }}admin">Troggle administration pages</a></li>
|
<li><a id="expoWebsiteLink" href="{{ settings.URL_ROOT }}admin">Troggle administration pages</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<li class="toggleMenu"><a href="#">hide menu</a></li>
|
<li class="toggleMenu"><a href="#">hide menu</a></li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
<div class="toggleMenu" style="display:none; position:fixed; bottom:0; right:130px"><a href="#">Show menu</a></li>
|
<div class="toggleMenu" style="display:none; position:fixed; bottom:0; right:130px"><a href="#">Show menu</a></li>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
3
templates/eyecandy.html
Normal file
3
templates/eyecandy.html
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
<img id="richardBanner" class="footer" src="{{ settings.MEDIA_URL }}expoBanner.gif" style="display: none;"/>
|
||||||
|
<img id="timeMachine" class="footer" src="{{ settings.MEDIA_URL }}timemachine.gif" style="display: none;"/>
|
||||||
|
<img id="surveyHover" class="footer" src="{{ settings.MEDIA_URL }}surveyHover.gif" style="display: none;"/>
|
7
urls.py
7
urls.py
@ -65,8 +65,9 @@ urlpatterns = patterns('',
|
|||||||
url(r'^logbook(?P<year>\d\d\d\d)\.(?P<extension>.*)/?$',views_other.downloadLogbook),
|
url(r'^logbook(?P<year>\d\d\d\d)\.(?P<extension>.*)/?$',views_other.downloadLogbook),
|
||||||
url(r'^logbook/?$',views_other.downloadLogbook, name="downloadlogbook"),
|
url(r'^logbook/?$',views_other.downloadLogbook, name="downloadlogbook"),
|
||||||
url(r'^cave/(?P<cave_id>[^/]+)/qm\.csv/?$', views_other.downloadQMs, name="downloadqms"),
|
url(r'^cave/(?P<cave_id>[^/]+)/qm\.csv/?$', views_other.downloadQMs, name="downloadqms"),
|
||||||
(r'^downloadqms$', views_other.downloadQMs),
|
(r'^downloadqms$', views_other.downloadQMs),
|
||||||
url(r'^cave/(?P<cave_id>[^/]+)(?P<subcave>/.*)/?$', subcave, name="subcave"),
|
url(r'^cave/(?P<cave_id>[^/]+)(?P<subcave>/.*)/?$', subcave, name="subcave"),
|
||||||
|
url(r'^eyecandy$', views_other.eyecandy),
|
||||||
|
|
||||||
(r'^admin/doc/?', include('django.contrib.admindocs.urls')),
|
(r'^admin/doc/?', include('django.contrib.admindocs.urls')),
|
||||||
(r'^admin/(.*)/?', admin.site.root),
|
(r'^admin/(.*)/?', admin.site.root),
|
||||||
@ -74,7 +75,7 @@ urlpatterns = patterns('',
|
|||||||
|
|
||||||
(r'^accounts/', include('registration.urls')),
|
(r'^accounts/', include('registration.urls')),
|
||||||
(r'^profiles/', include('profiles.urls')),
|
(r'^profiles/', include('profiles.urls')),
|
||||||
|
|
||||||
# (r'^personform/(.*)$', personForm),
|
# (r'^personform/(.*)$', personForm),
|
||||||
|
|
||||||
(r'^site_media/(?P<path>.*)$', 'django.views.static.serve',
|
(r'^site_media/(?P<path>.*)$', 'django.views.static.serve',
|
||||||
|
Loading…
Reference in New Issue
Block a user