Skip to content

Commit

Permalink
Reworked logic on landing page so that we're only toggling the
Browse files Browse the repository at this point in the history
Dahsboard/signup button. fixes #545

It appeared as if we were referencing map elements in the JS that
didn't exist. Removed reference. Also removed duplicate jQuery
inclusion and moved loading to bottom of page. fixes #544
  • Loading branch information
Matt Phillips committed May 23, 2014
1 parent 848fa81 commit c213c73
Showing 1 changed file with 85 additions and 174 deletions.
259 changes: 85 additions & 174 deletions perma_web/perma/templates/landing.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@

{% block styles %}
<link rel="stylesheet" href="{{ STATIC_URL }}css/carousel.css">
<script src='{{ STATIC_URL }}js/jquery.js'></script>
<script src='{{ STATIC_URL }}js/raphael.js'></script>
<script src='{{ STATIC_URL }}js/raphael.scale.js'></script>
<script src='{{ STATIC_URL }}js/g.raphael.js'></script>
<script src='{{ STATIC_URL }}js/usmap.js'></script>
<script src='{{ STATIC_URL }}js/rwdImageMaps.js'></script>

{% endblock %}

{% block content %}
Expand All @@ -26,13 +19,12 @@
<p><a href="{% url 'landing' %}"><span class="orange">Perma.cc</span></a> helps scholars, journals and courts create permanent links to the online sources cited in their work. <a href="http://perma.cc/4RH7-999Q" target="_blank">Here's an example.</a></p>

<br/>

<p><a href="{% url 'process_register' %}" class="btn btn-large btn-success">Create an account</a></p>

{% if request.user.is_authenticated %}

<p><a href="{% url 'created_links' %}" class="btn btn-large btn-success">Visit Your Dashboard</a></p>
{% else %}
{% if request.user.is_authenticated %}
<p><a href="{% url 'created_links' %}" class="btn btn-large btn-success">Visit Your Dashboard</a></p>
{% else %}
<p><a href="{% url 'process_register' %}" class="btn btn-large btn-success">Create an account</a></p>
{% endif %}

</div>

Expand Down Expand Up @@ -373,164 +365,12 @@ <h3 class="mega orange"><div id="archive">Archive</div></h3>
<img class="img-responsive" src="{{ STATIC_URL }}/img/shelf2.png"/>
</div>
</div>

{% comment %}
<!-- Begin MailChimp Signup Form -->
<link href="//cdn-images.mailchimp.com/embedcode/classic-081711.css" rel="stylesheet" type="text/css">
<style type="text/css">
#mc_embed_signup{
background:#fff;

font:14px;
color:#666;
}
#mc_embed_signup .mc-field-group {
padding:0px;
width:100%;
}

#mc_embed_signup input {
border:1px solid #4cae4c;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
margin:auto;
}

input#mc-embedded-subscribe.btn {
margin:auto;
text-align:center;
}

#mc_embed_signup .mc-field-group input {
width:400px;
margin:auto;
}

#mc-embedded-subscribe {
margin:10px auto;
}

#mc_embed_signup .mc-field-group.input-group label {
font-weight:normal; text-align:center;
}
#mc_embed_signup .mc-field-group.input-group ul {
padding:3px 0 0;
}
#mc_embed_signup .mc-field-group {
min-height:40px;
}
/* Add your own MailChimp form style overrides in your site stylesheet or in this style block.
We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
</style>
<div id="mc_embed_signup">
<form action="http://harvard.us7.list-manage.com/subscribe/post?u=d69d9fa13a9f7b51b8f939df4&amp;id=a262e9b81b" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
<div class="subscribe"><span class="orange">perma.cc</span> will be free and open to all soon</div>

<div class="mc-field-group">


<input type="email" placeholder="you@email.com" value="" name="EMAIL" class="required email" id="mce-EMAIL">
</div>
<div class="mc-field-group input-group center">

<ul><li><input type="checkbox" value="1" name="group[4441][1]" id="mce-group[4441]-4441-0"><label for="mce-group[4441]-4441-0">&nbsp;I'm a journal or library</label></li>
</ul>
</div>
<div id="mce-responses" class="clear">
<div class="response" id="mce-error-response" style="display:none"></div>
<div class="response" id="mce-success-response" style="display:none"></div>
</div> <div class="clear"><input type="submit" value="Request Beta Access" name="subscribe" id="mc-embedded-subscribe" class="btn btn-large btn-success center"></div>
</form>
</div>
<!--End mc_embed_signup-->
{% endcomment %}
{% endif %}
</div><!--/col-->
</div><!--/row-->
</div><!--/container-->

</section><!-- home-description -->

<script type="text/javascript" charset="utf-8">
// BIG

//var map, paper, pageWidth=3800;
var map, paper;
var pageWidth = $('#plot-map-container').parent().width();

var drawIt = function() {
paper = new ScaleRaphael('plot-map-container', 950, 590);
map = paper.USMap();
paper.scaleAll(pageWidth/map.width);
function resizePaper(){
var newWidth = $("#plot-map-container").parent().width();
paper.scaleAll(newWidth/map.width);
}
$(window).resize(resizePaper);

var points = [
[38.944794, -77.095004, "Pence Law Library, Washington College of Law, American University"],
[42.341822, -71.195736, "Law Library at Boston College, Boston College of Law"],
[38.944794, -77.095004, "Pence Law Library, Washington College of Law, American University"],
[42.350527, -71.109665, "Pappas Law Library, Boston University School of Law"],
[39.953772, -75.193314, "Biddle Law Library, University of Pennsylvania Law School"],
[32.790682, -79.938873, "Charleston School of Law Library"],
[40.000906, -105.262076, "William A. Wise Law Library, Colorado Law"],
[40.806948, -73.960331, "Arthur W. Diamond Law Library, Columbia Law School"],
[42.443868, -76.485849, "Cornell University Law School"],
[42.349480, -71.077708, "Digital Public Library of America"],
[35.999711, -78.944995, "J. Michael Goodson Law Library, Duke University School of Law"],
[30.439591, -84.286414, "Florida State Law Research Center, Florida State University College of Law"],
[29.650052, -82.359510, "University of Florida Levin College of Law"],
[40.771128, -73.984648, "The Leo T. Kissam Memorial Library, Fordham University School of Law"],
[38.898086, -77.012985, "Georgetown Law Library, Georgetown Law"],
[42.379400, -71.119587, "Harvard Law School Library"],
[39.772174, -86.167720, "Ruth Lilly Law Library, Robert H. McKinney School of Law, Indiana University"],
[41.877710, -87.628618, "Louis L. Biro Law Library, The John Marshall Law School"],
[41.699725, -86.238208, "Kresge Law Library, University of Notre Dame The Law School"],
[34.066263, -117.647682, "College of Law Library, University of La Verne"],
[45.452229, -122.677615, "Paul L. Boley Law Library, Lewis & Clark Law School"],
[30.414529, -91.175239, "Louisiana State University Law Library, LSU Law Center"],
[41.897352, -87.627156, "Loyola University Chicago School of Law"],
[39.289763, -76.622936, "Thurgood Marshall Law Library, Francis King Carey School of Law, University of Maryland"],
[-37.802327, 144.960055, "Melbourne Law School Law Library"],
[40.818056, -96.699848, "University of Nebraska College of Law"],
[41.896683, -87.619690, "Pritzker Legal Research Center, Northwestern Law"],
[39.996168, -83.008418, "Michael E. Moritz Law Library, Ohio State University"],
[51.757111, -1.247840, "Bodleian Law Library, Bodleian Libraries, University of Oxford"],
[34.037931, -118.707359, "Harnish Law Library, Pepperdine University School of Law"],
[37.574272, -77.541348, "William Taylor Muse Law Library, University of Richmond School of Law"],
[29.752922, -95.365044, "The Fred Parks Law Library, South Texas College of Law"],
[37.423975, -122.167550, "Robert Crown Law Library, Stanford Law School"],
[34.072966, -118.438463, "Hugh & Hazel Darling Law Library, UCLA School of Law"],
[25.720798, -80.279734, "University of Miami School of Law"],
[34.363963, -89.541439, "Grisham Law Library, University of Mississippi School of Law"],
[36.107131, -115.142426, "Wiener-Rogers Law Library, UNLV William S. Boyd School of Law"],
[32.771408, -117.188822, "Pardee Legal Research Center, University of San Diego"],
[30.289088, -97.731251, "Tarlton Law Library, Jamail Center of Legal Research, The University of Texas School of Law"],
[40.762004, -111.851903, "S.J. Quinney Law Library, University of Utah"],
[36.145869, -86.799537, "Vanderbilt Law School"],
[38.051897, -78.510371, "Arthur J. Morris Law Library, University of Virginia School of Law"],
[47.655295, -122.303745, "University of Washington School of Law"],
[38.649789, -90.312022, "Washington University Law"],
[37.264720, -76.705315, "William & Mary Law School"],
[43.074277, -89.401986, "University of Wisconsin Law Library"],
[41.311960, -72.927899, "Lillian Goldman Law Library, Yale Law School"]


]
for(var i = 0; i < points.length; i++){
//map.plot(points[i][0], points[i][1], points[i][2]);
map.plot(points[i][0], points[i][1]);
}
};

document.onload = drawIt();

</script><!--/raphael.js map points-->


{% endblock %}

{% block footer %}
Expand Down Expand Up @@ -569,14 +409,85 @@ <h3 class="mega orange"><div id="archive">Archive</div></h3>
{% endblock %}

{% block scripts %}
<script>
$(document).ready(function(e) {
$('img[usemap]').rwdImageMaps();

$('area').on('click', function() {

});
});
</script>
<script src='{{ STATIC_URL }}js/raphael.js'></script>
<script src='{{ STATIC_URL }}js/raphael.scale.js'></script>
<script src='{{ STATIC_URL }}js/g.raphael.js'></script>
<script src='{{ STATIC_URL }}js/usmap.js'></script>
<script src='{{ STATIC_URL }}js/rwdImageMaps.js'></script>
<script type="text/javascript" charset="utf-8">
// BIG

//var map, paper, pageWidth=3800;
var map, paper;
var pageWidth = $('#plot-map-container').parent().width();

var drawIt = function() {
paper = new ScaleRaphael('plot-map-container', 950, 590);
map = paper.USMap();
paper.scaleAll(pageWidth/map.width);
function resizePaper(){
var newWidth = $("#plot-map-container").parent().width();
paper.scaleAll(newWidth/map.width);
}
$(window).resize(resizePaper);

var points = [
[38.944794, -77.095004, "Pence Law Library, Washington College of Law, American University"],
[42.341822, -71.195736, "Law Library at Boston College, Boston College of Law"],
[38.944794, -77.095004, "Pence Law Library, Washington College of Law, American University"],
[42.350527, -71.109665, "Pappas Law Library, Boston University School of Law"],
[39.953772, -75.193314, "Biddle Law Library, University of Pennsylvania Law School"],
[32.790682, -79.938873, "Charleston School of Law Library"],
[40.000906, -105.262076, "William A. Wise Law Library, Colorado Law"],
[40.806948, -73.960331, "Arthur W. Diamond Law Library, Columbia Law School"],
[42.443868, -76.485849, "Cornell University Law School"],
[42.349480, -71.077708, "Digital Public Library of America"],
[35.999711, -78.944995, "J. Michael Goodson Law Library, Duke University School of Law"],
[30.439591, -84.286414, "Florida State Law Research Center, Florida State University College of Law"],
[29.650052, -82.359510, "University of Florida Levin College of Law"],
[40.771128, -73.984648, "The Leo T. Kissam Memorial Library, Fordham University School of Law"],
[38.898086, -77.012985, "Georgetown Law Library, Georgetown Law"],
[42.379400, -71.119587, "Harvard Law School Library"],
[39.772174, -86.167720, "Ruth Lilly Law Library, Robert H. McKinney School of Law, Indiana University"],
[41.877710, -87.628618, "Louis L. Biro Law Library, The John Marshall Law School"],
[41.699725, -86.238208, "Kresge Law Library, University of Notre Dame The Law School"],
[34.066263, -117.647682, "College of Law Library, University of La Verne"],
[45.452229, -122.677615, "Paul L. Boley Law Library, Lewis & Clark Law School"],
[30.414529, -91.175239, "Louisiana State University Law Library, LSU Law Center"],
[41.897352, -87.627156, "Loyola University Chicago School of Law"],
[39.289763, -76.622936, "Thurgood Marshall Law Library, Francis King Carey School of Law, University of Maryland"],
[-37.802327, 144.960055, "Melbourne Law School Law Library"],
[40.818056, -96.699848, "University of Nebraska College of Law"],
[41.896683, -87.619690, "Pritzker Legal Research Center, Northwestern Law"],
[39.996168, -83.008418, "Michael E. Moritz Law Library, Ohio State University"],
[51.757111, -1.247840, "Bodleian Law Library, Bodleian Libraries, University of Oxford"],
[34.037931, -118.707359, "Harnish Law Library, Pepperdine University School of Law"],
[37.574272, -77.541348, "William Taylor Muse Law Library, University of Richmond School of Law"],
[29.752922, -95.365044, "The Fred Parks Law Library, South Texas College of Law"],
[37.423975, -122.167550, "Robert Crown Law Library, Stanford Law School"],
[34.072966, -118.438463, "Hugh & Hazel Darling Law Library, UCLA School of Law"],
[25.720798, -80.279734, "University of Miami School of Law"],
[34.363963, -89.541439, "Grisham Law Library, University of Mississippi School of Law"],
[36.107131, -115.142426, "Wiener-Rogers Law Library, UNLV William S. Boyd School of Law"],
[32.771408, -117.188822, "Pardee Legal Research Center, University of San Diego"],
[30.289088, -97.731251, "Tarlton Law Library, Jamail Center of Legal Research, The University of Texas School of Law"],
[40.762004, -111.851903, "S.J. Quinney Law Library, University of Utah"],
[36.145869, -86.799537, "Vanderbilt Law School"],
[38.051897, -78.510371, "Arthur J. Morris Law Library, University of Virginia School of Law"],
[47.655295, -122.303745, "University of Washington School of Law"],
[38.649789, -90.312022, "Washington University Law"],
[37.264720, -76.705315, "William & Mary Law School"],
[43.074277, -89.401986, "University of Wisconsin Law Library"],
[41.311960, -72.927899, "Lillian Goldman Law Library, Yale Law School"]


]
for(var i = 0; i < points.length; i++){
//map.plot(points[i][0], points[i][1], points[i][2]);
map.plot(points[i][0], points[i][1]);
}
};

document.onload = drawIt();
</script><!--/raphael.js map points-->
{% endblock %}

0 comments on commit c213c73

Please sign in to comment.