Skip to content

Commit

Permalink
Markup for sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
roboshoes committed Feb 11, 2011
1 parent ba149db commit bb7f8f4
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 15 deletions.
14 changes: 14 additions & 0 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,20 @@

<div id="overviewControls" class="toggleElement">

<span>OVERVIEW SORT BY</span>

<ul>
<li id="dateSortButton" class="active">DATE</li>
<li id="likesSortButton" class="inactive">LIKES</li>

<li>
<form id="searchForm">
<input id="searchField" type="text" tabindex="1" />
<input id="searchSubmit" type="submit" />
</form>
</li>
</ul>

<a id="overviewPreviousButton" class="editorButton">Previous Page</a>
<a id="overviewNextButton" class="editorButton">Next Page</a>

Expand Down
Binary file modified public/images/editor-text-background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 36 additions & 13 deletions public/javascripts/marblerun/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,6 @@ var setBuildTweetButton = function() {
Element.writeAttribute($('twitterButton'), {href: 'http://twitter.com/share?' + Object.toQueryString(parameters)});
};

// var loadTrack = function(trackID) {
// if (localTracks[trackID]) {
// contentLoader.parseResponse({
// responseJSON: {
// mode: 'show',
// track: localTracks[trackID]
// }
// }, true);
// } else {
// contentLoader.loadContent('/tracks/' + trackID, true);
// }
// };

var initializeHTMLInterface = (function() {

var myScope = this;
Expand Down Expand Up @@ -200,6 +187,42 @@ var initializeHTMLInterface = (function() {
}
});

$('dateSortButton').observe('click', function(event) {
$('dateSortButton').addClassName("active");
$('dateSortButton').removeClassName("inactive");

$('likesSortButton').removeClassName("active");
$('likesSortButton').addClassName("inactive");

document.getElementById('searchField').value = "";
});

$('likesSortButton').observe('click', function(event) {
$('dateSortButton').removeClassName("active");
$('dateSortButton').addClassName("inactive");

$('likesSortButton').addClassName("active");
$('likesSortButton').removeClassName("inactive");

document.getElementById('searchField').value = "";
});

document.getElementById('searchForm').onsubmit = function() {
$('dateSortButton').removeClassName("active");
$('likesSortButton').removeClassName("active");

$('dateSortButton').addClassName("inactive");
$('likesSortButton').addClassName("inactive");

var url = 'tracks/?search=';
url += document.getElementById('searchField').value;
url += '&page=1';

contentLoader(url, true);

return false;
}

}());

var setSwitchMode = function(mode) {
Expand Down
42 changes: 40 additions & 2 deletions public/stylesheets/master.css
Original file line number Diff line number Diff line change
Expand Up @@ -558,20 +558,58 @@ a.editorButton {
}

#overviewControls {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 9px;
position: absolute;
left: 338px;
top: 140px;
top: 40px;
padding-left: 35px;
}

#overviewControls span {
font-weight: bold;
}

#overviewControls ul {
margin: 10px 10px 40px 10px;
}

#overviewControls li {
margin: 7px;
list-style: square;
}

#overviewControls li.active {
color: #800000;
}

#overviewControls li.inactive {
cursor: pointer;
}

#searchSubmit {
display: none;
}

#searchField {
width: 89px;
height: 19px;
font-size: 9px;
font-family: Helvetica, Arial, sans-serif;
font-weight: bold;
color: #333;
background: url(../images/editor-text-background.png) no-repeat transparent;
border: none;
padding: 0 3px;
}

#overviewControls div {
float: left;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 11px;
font-weight: bold;
margin: 8px 0 0 10px;
color: #363535;

}

#overviewGrid {
Expand Down

0 comments on commit bb7f8f4

Please sign in to comment.