cleanup of css and js imports, also mapping

pull/1/head
eric 2013-03-08 14:16:24 -05:00
parent 62627a80cf
commit 800d0ffdeb
31 changed files with 184 additions and 329 deletions

View File

@ -0,0 +1,95 @@
base.html extra_css(empty) extra_js(empty) extra_head(empty)
404.html
500.html
503.html
about_active.html
about_active_empty.html
about_main.html
about_unglued.html
about_unglued_empty.html
about_wishlist.html
about_wishlist_empty.html
bypub_list.html extra_css extra_head
campaign_list.html extra_css extra_head
comments.html extra_css extra_head
download.html extra_js
goodreads_display.html extra_head
home.html extra_css extra_js
librarything.html
lockss.html
lockss_manifest.html
profiles/create_profile.html
profiles/edit_profile.html
profiles/profile_detail.html
profiles/profile_list.html
registration/registration_base.html extra_js extra_head extra_extra_head
basedocumentation.html extra_js extra_extra_head(empty)
api_help.html
about.html
about_smashwords.html
admins_only.html
campaign_admin.html extra_extra_head
claim.html
comments/base.html
comments/preview.html extra_css
donation.html extra_extra_head
emailshare.html extra_css
faq.html
feedback.html
front_matter.html extra_extra_head
languages.html
libraries.html extra_css extra_js
manage_account.html extra_extra_head
manage_campaign.html extra_extra_head
merge.html extra_extra_head
metrics.html
new_edition.html extra_extra_head
notification/base.html
notification/notice_settings.html extra_css extra_js
notification/notices.html extra_css
press.html
privacy.html
rh_tools.html extra_extra_head
rights_holders.html extra_extra_head
terms.html extra_css
thanks.html
basepledge.html extra_css extra_js extra_extra_head(empty)
donation_credit.html
donation_user_error.html
fund_the_pledge.html extra_extra_head
donation_credit.html extra_extra_head
pledge.html extra_extra_head
pledge_cancel.html extra_css
pledge_card_error.html
pledge_complete.html extra_extra_head
pledge_nevermind.html extra_css
pledge_recharge.html extra_css
pledge_user_error.html extra_extra_head
stripe.html extra_extra_head
registration/activation_complete.html
registration/activate.html
registration/login.html
registration/logout.html
registration/password_change_done.html
registration/password_change_form.html
registration/password_reset_complete.html
registration/password_reset_confirm.html
registration/password_reset_done.html
registration/password_reset_form.html
registration/registration_complete.html
registration/registration_form.html
registration/user_change_form.html
registration/welcome.html
search.html extra_css extra_head
stub.html
subjects.html
supporter.html extra_css extra_js extra_head
textpages.html extra_head
unglued_list.html extra_css extra_head
work.html extra_css extra_js
work_list.html extra_css extra_head
nonprofit_base.html extra_extra_head
nonprofit.html extra_extra_head

View File

@ -21,14 +21,13 @@
<link type="text/css" rel="stylesheet" href="/static/css/sitewide2.css" />
<link REL="SHORTCUT ICON" HREF="/static/images/favicon.ico">
{% block extra_css %}{% endblock %}
{% block base_js %}
<script type="text/javascript" src="{{ jquery_home }}"></script>
{% endblock %}
<script type="text/javascript" src="/static/js/hijax.js?v=3a"></script>
{% block extra_js %}
{% endblock %}
<script type="text/javascript" src="/static/js/jquery.cookie.js"></script>
<script type="text/javascript" src="/static/js/sitewide.js"></script>
<script type="text/javascript" src="/static/js/watermark_init.js"></script>
<script type="text/javascript" src="/static/js/watermark_change.js"></script>
{% block extra_js %}
{% endblock %}
{% if show_langs %}
<script>
var $j = jQuery.noConflict();
@ -39,20 +38,6 @@
});
</script>
{% endif %}
<script>
var $j = jQuery.noConflict();
$j(document).ready(function(){
// make drop-down menu happen when they click on their name
$j('#authenticated').click(function(){
$j('#user_menu').toggle();
$j(this).toggleClass('highlight');
});
// but suppress it if they're clicking on the badge link to the notifications page
$j('#i_haz_notifications_badge').click(function() {
event.stopPropagation();
});
});
</script>
{% block extra_head %}
{% endblock %}
</head>

View File

@ -1,4 +1,10 @@
{% extends "registration/registration_base.html" %}
{% block extra_css %}
<link type="text/css" rel="stylesheet" href="/static/css/campaign.css" />
<link type="text/css" rel="stylesheet" href="/static/css/pledge.css" />
{% endblock %}
{% block extra_js %}
<script type="text/javascript" src="/static/js/definitions.js"></script>

View File

@ -11,8 +11,6 @@
{% endblock %}
{% block extra_head %}
<script type="text/javascript" src="/static/js/wishlist.js"></script>
<script type="text/javascript" src="{{ jquery_home }}"></script>
<script type="text/javascript" src="/static/js/jquery.cookie.js"></script>
<script type="text/javascript" src="{{ jquery_ui_home }}"></script>
<script type="text/javascript" src="/static/js/greenpanel.js"></script>
<script type="text/javascript" src="/static/js/toggle.js"></script>

View File

@ -3,7 +3,6 @@
{% block extra_extra_head %}
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/themes/ui-lightness/jquery-ui.css" type="text/css" media="screen">
{{ form.media.css }}
<script type="text/javascript" src="{{ jquery_home }}"></script>
<script type="text/javascript" src="{{ jquery_ui_home }}"></script>
{{ form.media.js }}
{% endblock %}

View File

@ -13,7 +13,6 @@
<script>
location.hash = "#2";
</script>
<script type="text/javascript" src="/static/js/jquery.cookie.js"></script>
<script type="text/javascript" src="/static/js/wishlist.js"></script>
<script type="text/javascript" src="{{ jquery_ui_home }}"></script>
<script type="text/javascript" src="/static/js/greenpanel.js"></script>

View File

@ -7,7 +7,6 @@
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/themes/ui-lightness/jquery-ui.css" type="text/css" media="screen">
<link type="text/css" rel="stylesheet" href="/static/css/pledge.css" />
{{ transfer_form.media.css }}
<script type="text/javascript" src="{{ jquery_home }}"></script>
<script type="text/javascript" src="{{ jquery_ui_home }}" ></script>
{{ transfer_form.media.js }}
{% endblock %}

View File

@ -3,12 +3,6 @@
{% block title %}You Have Donation Credits{% endblock %}
{% block extra_extra_head %}
<link type="text/css" rel="stylesheet" href="/static/css/campaign.css" />
<link type="text/css" rel="stylesheet" href="/static/css/pledge.css" />
{% endblock %}
{% block doccontent %}
<div style="height:15px"></div>

View File

@ -3,12 +3,6 @@
{% block title %}Please Log in as...{% endblock %}
{% block extra_extra_head %}
<link type="text/css" rel="stylesheet" href="/static/css/campaign.css" />
<link type="text/css" rel="stylesheet" href="/static/css/pledge.css" />
{% endblock %}
{% block doccontent %}
<div style="height:15px"></div>

View File

@ -4,8 +4,6 @@
{% block title %}Fund Your Pledge{% endblock %}
{% block extra_extra_head %}
<link type="text/css" rel="stylesheet" href="/static/css/campaign.css" />
<link type="text/css" rel="stylesheet" href="/static/css/pledge.css" />
{% include "stripe_stuff.html" %}
<script type="text/javascript" src="/static/js/loader-gif.js"></script>
<script type="application/x-javascript">

View File

@ -11,10 +11,7 @@
<link type="text/css" rel="stylesheet" href="/static/css/book_panel.css" />
<link type="text/css" rel="stylesheet" href="/static/css/learnmore.css" />
{% endblock %}
{% block base_js %}
<script src="{{ jquery_home }}"></script>
{% block extra_js %}
<!-- toggle to panelview state instead of listview default -->
<script type="text/javascript">

View File

@ -3,7 +3,6 @@
{% block extra_extra_head %}
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/themes/ui-lightness/jquery-ui.css" type="text/css" media="screen">
{{ form.media.css }}
<script type="text/javascript" src="{{ jquery_home }}"></script>
<script type="text/javascript" src="{{ jquery_ui_home }}" ></script>
{{ form.media.js }}
{% endblock %}

View File

@ -3,7 +3,6 @@
{% block extra_extra_head %}
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/themes/ui-lightness/jquery-ui.css" type="text/css" media="screen">
{{ form.media.css }}
<script type="text/javascript" src="{{ jquery_home }}"></script>
<script type="text/javascript" src="{{ jquery_ui_home }}" ></script>
{{ form.media.js }}
{% endblock %}

View File

@ -10,7 +10,7 @@
{% block extra_js %}
<script type="text/javascript" src="/static/js/definitions.js"></script>
{% block.super %}
<script>
$j(document).ready(function() {
jQuery.post("/ml/status/", function(data){

View File

@ -4,9 +4,6 @@
{% block title %}Pledge{% endblock %}
{% block extra_extra_head %}
<link type="text/css" rel="stylesheet" href="/static/css/campaign.css" />
<link type="text/css" rel="stylesheet" href="/static/css/pledge.css" />
<script type="text/javascript" src="/static/js/reconcile_pledge.js"></script>
<script type="text/javascript" src="/static/js/loader-gif.js"></script>
{% endblock %}

View File

@ -3,7 +3,7 @@
{% block title %}Pledge Cancelled{% endblock %}
{% block extra_extra_head %}
{% block extra_css %}
<link type="text/css" rel="stylesheet" href="/static/css/campaign.css" />
{% endblock %}

View File

@ -3,12 +3,6 @@
{% block title %}Credit card processing Error{% endblock %}
{% block extra_extra_head %}
<link type="text/css" rel="stylesheet" href="/static/css/campaign.css" />
<link type="text/css" rel="stylesheet" href="/static/css/pledge.css" />
{% endblock %}
{% block doccontent %}
<div style="height:15px"></div>

View File

@ -4,10 +4,8 @@
{% block title %}Pledge Completed{% endblock %}
{% block extra_extra_head %}
<link type="text/css" rel="stylesheet" href="/static/css/campaign.css" />
<link type="text/css" rel="stylesheet" href="/static/css/searchandbrowse.css" />
<link type="text/css" rel="stylesheet" href="/static/css/book_panel.css" />
<link type="text/css" rel="stylesheet" href="/static/css/pledge.css" />
<script src="/static/js/slides.min.jquery.js"></script>

View File

@ -3,7 +3,7 @@
{% block title %}Pledge Cancelled{% endblock %}
{% block extra_extra_head %}
{% block extra_css %}
<link type="text/css" rel="stylesheet" href="/static/css/campaign.css" />
{% endblock %}

View File

@ -3,7 +3,7 @@
{% block title %}Pledge Recharge{% endblock %}
{% block extra_extra_head %}
{% block extra_css %}
<link type="text/css" rel="stylesheet" href="/static/css/campaign.css" />
{% endblock %}

View File

@ -3,12 +3,6 @@
{% block title %}Please Log in as...{% endblock %}
{% block extra_extra_head %}
<link type="text/css" rel="stylesheet" href="/static/css/campaign.css" />
<link type="text/css" rel="stylesheet" href="/static/css/pledge.css" />
{% endblock %}
{% block doccontent %}
<div style="height:15px"></div>

View File

@ -1,6 +1,5 @@
{% extends "base.html" %}
{% block extra_js %}
<script type="text/javascript" src="/static/js/jquery.cookie.js"></script>
<script type="text/javascript">
var $j = jQuery.noConflict();
function getQueryVariable(variable) {

View File

@ -3,7 +3,6 @@
{% block extra_extra_head %}
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/themes/ui-lightness/jquery-ui.css" type="text/css" media="screen">
<link href="/static/selectable/css/dj.selectable.css" type="text/css" media="all" rel="stylesheet" />
<script type="text/javascript" src="{{ jquery_home }}"></script>
<script type="text/javascript" src="{{ jquery_ui_home }}"></script>
<script type="text/javascript" src="/static/selectable/js/jquery.dj.selectable.js"></script>

View File

@ -3,7 +3,6 @@
{% block extra_extra_head %}
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/themes/ui-lightness/jquery-ui.css" type="text/css" media="screen">
{{ form.media.css }}
<script type="text/javascript" src="{{ jquery_home }}"></script>
<script type="text/javascript" src="{{ jquery_ui_home }}" ></script>
{{ form.media.js }}
{% endblock %}

View File

@ -5,7 +5,6 @@
<link rel="stylesheet" href="/static/css/search.css">
{% endblock %}
{% block extra_head %}
<script type="text/javascript" src="/static/js/jquery.cookie.js"></script>
<script type="text/javascript" src="/static/js/wishlist.js"></script>
<script type="text/javascript" src="/static/js/greenpanel.js"></script>
<script type="text/javascript" src="/static/js/toggle.js"></script>

View File

@ -9,7 +9,6 @@
<link type="text/css" rel="stylesheet" href="/static/css/book_panel.css" />
{% endblock %}
{% block extra_js %}
<script type="text/javascript" src="/static/js/jquery.cookie.js"></script>
<script type="text/javascript" src="/static/js/wishlist.js"></script>
<script type="text/javascript" src="{{ jquery_ui_home }}"></script>
<script type="text/javascript" src="/static/js/greenpanel.js"></script>

View File

@ -10,7 +10,6 @@
<link type="text/css" rel="stylesheet" href="/static/css/lists.css" />
{% endblock %}
{% block extra_head %}
<script type="text/javascript" src="/static/js/jquery.cookie.js"></script>
<script type="text/javascript" src="/static/js/wishlist.js"></script>
<script type="text/javascript" src="{{ jquery_ui_home }}"></script>
<script type="text/javascript" src="/static/js/greenpanel.js"></script>

View File

@ -11,8 +11,6 @@
{% endblock %}
{% block extra_head %}
<script type="text/javascript" src="/static/js/wishlist.js"></script>
<script type="text/javascript" src="{{ jquery_home }}"></script>
<script type="text/javascript" src="/static/js/jquery.cookie.js"></script>
<script type="text/javascript" src="{{ jquery_ui_home }}"></script>
<script type="text/javascript" src="/static/js/greenpanel.js"></script>
<script type="text/javascript" src="/static/js/toggle.js"></script>

View File

@ -4,8 +4,6 @@
{% block title %}Stripe{% endblock %}
{% block extra_extra_head %}
<link type="text/css" rel="stylesheet" href="/static/css/campaign.css" />
<link type="text/css" rel="stylesheet" href="/static/css/pledge.css" />
<link href="/static/stripe/tag.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="https://js.stripe.com/v1/"></script>

View File

@ -1,254 +1 @@
/* variables and mixins used in multiple less files go here */
.header-text {
height: 36px;
line-height: 36px;
display: block;
text-decoration: none;
font-weight: bold;
letter-spacing: -0.05em;
}
.panelborders {
border-width: 1px 0px;
border-style: solid none;
border-color: #FFFFFF;
}
.roundedspan {
border: 1px solid #d4d4d4;
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
border-radius: 7px;
padding: 1px;
color: #fff;
margin: 0 8px 0 0;
display: inline-block;
}
.roundedspan > span {
padding: 7px 7px;
min-width: 15px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
text-align: center;
display: inline-block;
}
.roundedspan > span .hovertext {
display: none;
}
.roundedspan > span:hover .hovertext {
display: inline;
}
.mediaborder {
padding: 5px;
border: solid 5px #EDF3F4;
}
.actionbuttons {
width: auto;
height: 36px;
line-height: 36px;
background: #8dc63f;
-moz-border-radius: 32px;
-webkit-border-radius: 32px;
border-radius: 32px;
color: white;
cursor: pointer;
font-size: 13px;
font-weight: bold;
padding: 0 15px;
border: none;
margin: 5px 0;
}
.errors {
-moz-border-radius: 16px 16px 16px 16px;
-webkit-border-radius: 16px 16px 16px 16px;
border-radius: 16px 16px 16px 16px;
border: solid #e35351 3px;
clear: both;
width: 90%;
height: auto;
line-height: 16px;
padding: 7px 0;
font-weight: bold;
font-size: 13px;
text-align: center;
}
.errors li {
list-style: none;
border: none;
}
ul.social a:hover {
text-decoration: none;
}
ul.social li {
padding: 5px 0 5px 30px !important;
height: 28px;
line-height: 28px !important;
margin: 0 !important;
-moz-border-radius: 0px;
-webkit-border-radius: 0px;
border-radius: 0px;
}
ul.social li.facebook {
background: url("/static/images/icons/facebook.png") 10px center no-repeat;
cursor: pointer;
}
ul.social li.facebook span {
padding-left: 10px;
}
ul.social li.facebook:hover {
background: #8dc63f url("/static/images/icons/facebook-hover.png") 10px center no-repeat;
}
ul.social li.facebook:hover span {
color: #fff;
}
ul.social li.twitter {
background: url("/static/images/icons/twitter.png") 10px center no-repeat;
cursor: pointer;
}
ul.social li.twitter span {
padding-left: 10px;
}
ul.social li.twitter:hover {
background: #8dc63f url("/static/images/icons/twitter-hover.png") 10px center no-repeat;
}
ul.social li.twitter:hover span {
color: #fff;
}
ul.social li.email {
background: url("/static/images/icons/email.png") 10px center no-repeat;
cursor: pointer;
}
ul.social li.email span {
padding-left: 10px;
}
ul.social li.email:hover {
background: #8dc63f url("/static/images/icons/email-hover.png") 10px center no-repeat;
}
ul.social li.email:hover span {
color: #fff;
}
ul.social li.embed {
background: url("/static/images/icons/embed.png") 10px center no-repeat;
cursor: pointer;
}
ul.social li.embed span {
padding-left: 10px;
}
ul.social li.embed:hover {
background: #8dc63f url("/static/images/icons/embed-hover.png") 10px center no-repeat;
}
ul.social li.embed:hover span {
color: #fff;
}
.download_container {
width: 75%;
margin: auto;
}
#lightbox_content a {
color: #6994a3;
}
#lightbox_content .signuptoday a {
color: white;
}
#lightbox_content h2,
#lightbox_content h3,
#lightbox_content h4 {
margin-top: 15px;
}
#lightbox_content h2 a {
font-size: 18.75px;
}
#lightbox_content .ebook_download a {
margin: auto 5px auto 0;
font-size: 15px;
}
#lightbox_content .ebook_download img {
vertical-align: middle;
}
#lightbox_content .logo {
font-size: 15px;
}
#lightbox_content .logo img {
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
border-radius: 7px;
height: 50px;
width: 50px;
margin-right: 5px;
}
#lightbox_content .unglued,
#lightbox_content .not_unglued {
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
margin-left: -0.25%;
padding: 0.5%;
padding-bottom: 15px;
margin-bottom: 5px;
width: 74%;
}
#lightbox_content .unglued h3,
#lightbox_content .not_unglued h3 {
margin-top: 5px;
}
#lightbox_content .unglued {
border: solid 2px #8dc63f;
}
#lightbox_content .not_unglued {
border: solid 2px #d6dde0;
}
#lightbox_content a.add-wishlist .on-wishlist,
#lightbox_content a.success,
a.success:hover {
text-decoration: none;
color: #3d4e53;
}
#lightbox_content a.success,
a.success:hover {
cursor: default;
}
#lightbox_content ul {
padding-left: 50px;
}
#lightbox_content ul li {
margin-bottom: 4px;
}
.border {
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
border: solid 2px #d6dde0;
margin: 5px auto;
padding-right: 5px;
padding-left: 5px;
}
.sharing {
float: right;
padding: 0.5% !important;
width: 23% !important;
min-width: 105px;
}
.sharing ul {
padding: 0.5% !important;
}
.sharing .jsmod-title {
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
height: auto;
}
.sharing .jsmod-title span {
padding: 5% !important;
color: white !important;
font-style: normal;
}
#widgetcode2 {
display: none;
border: 1px solid #d6dde0;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
padding: 10px;
}
#widgetcode2 textarea {
max-width: 90%;
}
.header-text{height:36px;line-height:36px;display:block;text-decoration:none;font-weight:bold;letter-spacing:-0.05em}.panelborders{border-width:1px 0;border-style:solid none;border-color:#fff}.roundedspan{border:1px solid #d4d4d4;-moz-border-radius:7px;-webkit-border-radius:7px;border-radius:7px;padding:1px;color:#fff;margin:0 8px 0 0;display:inline-block}.roundedspan>span{padding:7px 7px;min-width:15px;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;text-align:center;display:inline-block}.roundedspan>span .hovertext{display:none}.roundedspan>span:hover .hovertext{display:inline}.mediaborder{padding:5px;border:solid 5px #edf3f4}.actionbuttons{width:auto;height:36px;line-height:36px;background:#8dc63f;-moz-border-radius:32px;-webkit-border-radius:32px;border-radius:32px;color:white;cursor:pointer;font-size:13px;font-weight:bold;padding:0 15px;border:0;margin:5px 0}.errors{-moz-border-radius:16px 16px 16px 16px;-webkit-border-radius:16px 16px 16px 16px;border-radius:16px 16px 16px 16px;border:solid #e35351 3px;clear:both;width:90%;height:auto;line-height:16px;padding:7px 0;font-weight:bold;font-size:13px;text-align:center}.errors li{list-style:none;border:0}ul.social a:hover{text-decoration:none}ul.social li{padding:5px 0 5px 30px!important;height:28px;line-height:28px!important;margin:0!important;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}ul.social li.facebook{background:url("/static/images/icons/facebook.png") 10px center no-repeat;cursor:pointer}ul.social li.facebook span{padding-left:10px}ul.social li.facebook:hover{background:#8dc63f url("/static/images/icons/facebook-hover.png") 10px center no-repeat}ul.social li.facebook:hover span{color:#fff}ul.social li.twitter{background:url("/static/images/icons/twitter.png") 10px center no-repeat;cursor:pointer}ul.social li.twitter span{padding-left:10px}ul.social li.twitter:hover{background:#8dc63f url("/static/images/icons/twitter-hover.png") 10px center no-repeat}ul.social li.twitter:hover span{color:#fff}ul.social li.email{background:url("/static/images/icons/email.png") 10px center no-repeat;cursor:pointer}ul.social li.email span{padding-left:10px}ul.social li.email:hover{background:#8dc63f url("/static/images/icons/email-hover.png") 10px center no-repeat}ul.social li.email:hover span{color:#fff}ul.social li.embed{background:url("/static/images/icons/embed.png") 10px center no-repeat;cursor:pointer}ul.social li.embed span{padding-left:10px}ul.social li.embed:hover{background:#8dc63f url("/static/images/icons/embed-hover.png") 10px center no-repeat}ul.social li.embed:hover span{color:#fff}.download_container{width:75%;margin:auto}#lightbox_content a{color:#6994a3}#lightbox_content .signuptoday a{color:white}#lightbox_content h2,#lightbox_content h3,#lightbox_content h4{margin-top:15px}#lightbox_content h2 a{font-size:18.75px}#lightbox_content .ebook_download a{margin:auto 5px auto 0;font-size:15px}#lightbox_content .ebook_download img{vertical-align:middle}#lightbox_content .logo{font-size:15px}#lightbox_content .logo img{-moz-border-radius:7px;-webkit-border-radius:7px;border-radius:7px;height:50px;width:50px;margin-right:5px}#lightbox_content .unglued,#lightbox_content .not_unglued{-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;margin-left:-0.25%;padding:.5%;padding-bottom:15px;margin-bottom:5px;width:74%}#lightbox_content .unglued h3,#lightbox_content .not_unglued h3{margin-top:5px}#lightbox_content .unglued{border:solid 2px #8dc63f}#lightbox_content .not_unglued{border:solid 2px #d6dde0}#lightbox_content a.add-wishlist .on-wishlist,#lightbox_content a.success,a.success:hover{text-decoration:none;color:#3d4e53}#lightbox_content a.success,a.success:hover{cursor:default}#lightbox_content ul{padding-left:50px}#lightbox_content ul li{margin-bottom:4px}.border{-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;border:solid 2px #d6dde0;margin:5px auto;padding-right:5px;padding-left:5px}.sharing{float:right;padding:.5%!important;width:23%!important;min-width:105px}.sharing ul{padding:.5%!important}.sharing .jsmod-title{-moz-border-radius:10px;-webkit-border-radius:10px;border-radius:10px;height:auto}.sharing .jsmod-title span{padding:5%!important;color:white!important;font-style:normal}#widgetcode2{display:none;border:1px solid #d6dde0;-moz-border-radius:10px;-webkit-border-radius:10px;border-radius:10px;padding:10px}#widgetcode2 textarea{max-width:90%}

73
static/js/sitewide.js Normal file
View File

@ -0,0 +1,73 @@
var $j = jQuery.noConflict();
$j(document).ready(function() {
// hijack a link with class "hijax" to show its content in a lightbox instead
// allows for ajaxy presentation of things like download links in a way that
// degrades gracefully for non-js users
$j("#js-page-wrap, #footer").on("click", "a.hijax", function(event) {
event.preventDefault();
$j("#lightbox").load($j(this).attr("href") + " #lightbox_content", function() {
// centering divs of dynamic width: shockingly hard. make sure lightbox is centered on load.
var hijaxWidth = $j('#about_expandable').width() + 28;
var windowWidth = $j(document).width();
var marginWidth = (windowWidth - hijaxWidth)/2;
$j('#about_expandable').css({'margin-left': marginWidth});
// position div vertically relative to top of viewport, to ensure visibility
// regardless of where on the page the user clicked to activate it
var marginTop = window.pageYOffset;
$j('#about_expandable').css({'margin-top': marginTop});
});
if ($j(this).attr("href").substr(-9,8) == "download") {
jQuery.getScript('https://platform.readmill.com/send.js');
}
//need to push next cookie for sign-in links
var vars = $j(this).attr("href").split("next=");
if (vars.length>1){
next=vars[1];
if(next!='') {
next = next.replace(/[\x22\x27\x3c\x3e]/g,'');
$j.cookie('next', next, {path: '/'});
}
}
// fade-out rest of page elements on expand
$j('#feedback, #js-page-wrap, #footer').css({"opacity": "0.07"});
$j('#about_expandable').css({'position': 'absolute'});
$j('#about_expandable').fadeTo("slow", 1);
// if we're on a supporter page, personalize our about box
// by writing the supporter's name in
if ($j(location).attr('pathname').slice(0,11) == '/supporter/') {
var ungluer = $j(location).attr('pathname').slice(11, -1);
if (ungluer != null) {
// span.ungluer doesn't exist until the ajax call so we
// can't bind to the DOM on document ready; need to use
// the ajaxComplete event
$j('#lightbox').ajaxComplete(function() {
$j('#lightbox span.ungluer').replaceWith(ungluer);
});
}
}
});
// fade-in normal page elements on collapse
$j('#about_collapser').on("click", function(){
$j('#js-topsection, .launch_top, .preview, #main-container, #js-rightcol, #js-header, #js-page-wrap, #footer, #feedback').fadeTo("slow", 1);
$j('#js-header a').css({"cursor": "pointer"});
$j('#about_expandable').css({"display": "none"});
});
// make drop-down menu happen when they click on their name
$j('#authenticated').click(function(){
$j('#user_menu').toggle();
$j(this).toggleClass('highlight');
});
// but suppress it if they're clicking on the badge link to the notifications page
$j('#i_haz_notifications_badge').click(function() {
event.stopPropagation();
});
});