Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken demos - patch #18

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ gem "middleman", "~>2.0"
gem "bourbon"
gem 'builder'
gem 'progress_bar'
gem 'psych'
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ GEM
progress_bar (0.4.0)
highline (~> 1.6.1)
options (~> 2.3.0)
psych (1.3.4)
rack (1.3.6)
rack-protection (1.2.0)
rack
Expand Down Expand Up @@ -128,3 +129,4 @@ DEPENDENCIES
builder
middleman (~> 2.0)
progress_bar
psych
7 changes: 4 additions & 3 deletions source/demo_layout.haml
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,14 @@
/////////////////////////////////////////
= javascript_include_tag "vendor/jquery-1.7.2.min.js"
= javascript_include_tag "https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"
= javascript_include_tag "vendor/jquery.ui.touch-punch.min.js"

= javascript_include_tag "http://twitter.github.com/bootstrap/assets/js/bootstrap-dropdown.js"
= javascript_include_tag "http://twitter.github.com/bootstrap/assets/js/bootstrap-modal.js"
= javascript_include_tag "http://twitter.github.com/bootstrap/assets/js/bootstrap-typeahead.js"
= javascript_include_tag "http://ifish-prototype.herokuapp.com/assets/api/v1/fishpond.js"

= javascript_include_tag "vendor/jquery.ui.touch-punch.min.js"
= javascript_include_tag "http://www.ifish.invo.lv/assets/api/v1/fishpond.js"


= yield_content :javascript

- if api_hardcoded?
Expand Down
18 changes: 10 additions & 8 deletions source/demos/kitchen-sink/templates/_fish-details.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
%script{:id => "template-fish-details", :type => "text/html"}
%a{ :href => "#", :data => { :toggle => "modal" } }
%img{ :src => "{{ metadata.thumbnail_url }}", :alt => "{{ metadata.title }}", :class => "profile" }
{[ if (!_.isEmpty(shortlist)) { ]}
%a{ :href => "#", :class => "btn btn-mini {{ shortlist.shortlistClass }}", :data => { :id => "{{ metadata.id }}", :title => "{{ metadata.title }}", :thumbnail => "{{ metadata.thumbnail_url }}", :toggle => "shortlist" } }
%i.icon-star
%span
{{ shortlist.wording }}
{[ } ]}
%a{ :href => "#", :class => "btn btn-mini {{ upvote.upvoteClass }}", :data => { :id => "{{ metadata.id }}", :toggle => "upvote" } }
%i.icon-thumbs-up

-#
{[ if (!_.isEmpty(shortlist)) { ]}
%a{ :href => "#", :class => "btn btn-mini {{ shortlist.shortlistClass }}", :data => { :id => "{{ metadata.id }}", :title => "{{ metadata.title }}", :thumbnail => "{{ metadata.thumbnail_url }}", :toggle => "shortlist" } }
%i.icon-star
%span
{{ shortlist.wording }}
{[ } ]}
%a{ :href => "#", :class => "btn btn-mini {{ upvote.upvoteClass }}", :data => { :id => "{{ metadata.id }}", :toggle => "upvote" } }
%i.icon-thumbs-up
14 changes: 3 additions & 11 deletions source/demos/kitchen-sink/templates/_fish-result.haml
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
/ TEMPLATE - Fish Result
%script{:id => "template-fish-result", :type => "text/html"}
%li{ :data => { :id => "{{ fish.id }}", "pos-start" => "{{ position }}", "pos-end" => "na", :popularity => "{{ fish.popularity() }}" }, :class => "{{ status }} fish" }
%li{ :data => { :id => "{{ fish.id }}", "pos-start" => "{{ position }}", "pos-end" => "na", :popularity => "{{ fish.popularity() }}", :score => "{{ score }}" }, :class => "{{ status }} fish" }
.thumbnail
%strong.title {{ fish.title }}
.details
{[ if (!_.isEmpty(metadata)) { ]}
{{ fishDetailsData }}
{[ } ]}
{[ if (fish.popularity() >= 15) { ]}
.favourite
%a{ :href => "#", :class => "btn btn-mini btn-danger" }
%i.icon-heart.icon-white.disabled
{[ } ]}
%strong.title {{ fish.title }}

29 changes: 27 additions & 2 deletions source/demos/stand-alone/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
= javascript_include_tag "vendor/underscore.js"
= javascript_include_tag "vendor/jstorage.js"
= javascript_include_tag "vendor/jquery.easing.1.3.js"
= javascript_include_tag "vendor/jquery-animate-css-rotate-scale.js"
= javascript_include_tag "vendor/jquery-css-transform.js"
= #javascript_include_tag "vendor/jquery-animate-css-rotate-scale.js"
= #javascript_include_tag "vendor/jquery-css-transform.js"
= javascript_include_tag "vendor/jquery.quicksand.js"
= javascript_include_tag "vendor/showdown.js"
= javascript_include_tag "demos/kitchen-sink/application.js"
Expand Down Expand Up @@ -70,6 +70,31 @@
html{
overflow-y: scroll;
#query{
form{
.tags{
margin-top: 10px;
.control-group{
margin-bottom: 15px;
.row-fluid [class*="span"]{
min-height: 20px;
}
.sliders{
.checkbox input[type="checkbox"]{
margin-left: -10px;
}
}
.tag-labels{
position: relative;
top: -8px;
font-size: 13px;
font-weight: bold;
.tag2{
text-align: right;
}
}
}
}
}
#results{
.thumbnails{
.fish{
Expand Down
25 changes: 25 additions & 0 deletions source/demos/zig-zag/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,31 @@
html{
overflow-y: scroll;
#query{
form{
.tags{
margin-top: 10px;
.control-group{
margin-bottom: 15px;
.row-fluid [class*="span"]{
min-height: 20px;
}
.sliders{
.checkbox input[type="checkbox"]{
margin-left: -10px;
}
}
.tag-labels{
position: relative;
top: -8px;
font-size: 13px;
font-weight: bold;
.tag2{
text-align: right;
}
}
}
}
}
#results{
.thumbnails{
.fish{
Expand Down
1 change: 1 addition & 0 deletions source/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
= link_to "issue #14", "https://github.com/involved/fishpond-examples/issues/14", :target => "_blank"
(JP - Fish stop swimming).
%li Renamed 'Science-Majors' demo to 'Stand-Alone'
%li Added 'Score' to debug mode [KS]
%li Updated demos homepage
%li Added Demo 'Getting Started' documentation
%li Added Flotr demo back to 'Labs'
Expand Down
33 changes: 14 additions & 19 deletions source/javascripts/demos/kitchen-sink/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ var setupFishpond = function(fishpond){ // you must define this function in your
if (debugMode === true) { $("body").addClass("debug"); }

// Clear LocalStorage of fish data. This is optional but is in here for Development purposes
$.jStorage.flush();
//$.jStorage.flush();
});


Expand Down Expand Up @@ -327,6 +327,7 @@ var setupFishpond = function(fishpond){ // you must define this function in your
var metadata = currentFish.getMetadata();
var resultData = {
fish : result.fish,
score : result.score,
fishDetailsData : currentFish.fishDetails(), // Pass 'details' template into this template
metadata : metadata,
status : metadata ? "loaded" : "loading",
Expand Down Expand Up @@ -443,7 +444,7 @@ var setupFishpond = function(fishpond){ // you must define this function in your
// Upvote Listener
/////////////////////////////////////////
function upvoteListener() {
var fishID;
/*var fishID;

// Upvote add/remove
$("body").on("click", "[data-toggle='upvote']", function(event){
Expand All @@ -466,7 +467,7 @@ var setupFishpond = function(fishpond){ // you must define this function in your

// Upvote Fish on iFish Server
pond.find_fish(fishID).up_vote();
});
});*/
}


Expand Down Expand Up @@ -506,7 +507,7 @@ var setupFishpond = function(fishpond){ // you must define this function in your
// Shortlist Listener
/////////////////////////////////////////
function shortlistListener() {
var fishID;
/*var fishID;

// Shortlist Options
shortlistPrint();
Expand Down Expand Up @@ -554,15 +555,15 @@ var setupFishpond = function(fishpond){ // you must define this function in your
console.log("No Shortlist children");
ui.shortlist.options.addClass("disabled");
}
});
});*/
}


/////////////////////////////////////////
// Shortlist Options: Print
/////////////////////////////////////////
function shortlistPrint() {
$("body").on("click", "#shortlist-print", function(event) {
/*$("body").on("click", "#shortlist-print", function(event) {
event.preventDefault();

$("#shortlist-export-print .modal-body").empty();
Expand Down Expand Up @@ -590,7 +591,7 @@ var setupFishpond = function(fishpond){ // you must define this function in your
$('#shortlist-export-print .modal-body').clone().appendTo( w.document.body );
w.print();
w.close();
});
});*/
}

/////////////////////////////////////////
Expand Down Expand Up @@ -658,7 +659,8 @@ var setupFishpond = function(fishpond){ // you must define this function in your
ui.results.list.quicksand(ui.query.list.find("li"), {
easing : animation.easingMethod,
duration : parseInt(animation.duration),
useScaling : false
useScaling : false,
adjustHeight: false
}, function() {
animation.inProgress = false;
// Update templates for Fish in Queue once animation has stopped
Expand All @@ -675,7 +677,7 @@ var setupFishpond = function(fishpond){ // you must define this function in your
// Comments Manager (Disqus)
/////////////////////////////////////////
function commentsManager(pond) {
$("body").on("click", "[data-toggle='comments']", function(event){
/*$("body").on("click", "[data-toggle='comments']", function(event){
event.preventDefault();

var id = $(this).data("id");
Expand All @@ -694,7 +696,7 @@ var setupFishpond = function(fishpond){ // you must define this function in your
});
}
comments.toggle('slow');
});
});*/
}

/////////////////////////////////////////
Expand All @@ -712,15 +714,8 @@ var setupFishpond = function(fishpond){ // you must define this function in your
}

function regexToken(txt){
var re1='.*?'; // Non-greedy match on filler
var re2='(?:[a-z][a-z0-9_]*)'; // Uninteresting: var
var re3='.*?'; // Non-greedy match on filler
var re4='(?:[a-z][a-z0-9_]*)'; // Uninteresting: var
var re5='.*?'; // Non-greedy match on filler
var re6='((?:[a-z][a-z0-9_]*))'; // Variable Name 1

var p = new RegExp(re1+re2+re3+re4+re5+re6,["i"]);
var m = p.exec(txt);
var re = new RegExp(/\w+\[\w+\]\[(\w+)\]/);
var m = re.exec(txt);
if (m != null) return m[1];
}

Expand Down
4 changes: 2 additions & 2 deletions source/layout.haml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
.container
%hr
%footer
© iFish 2012
© iFish 2013


= javascript_include_tag "http://ifish-prototype.herokuapp.com/assets/api/v1/fishpond.js"
= javascript_include_tag "http://www.ifish.invo.lv/assets/api/v1/fishpond.js"
= javascript_include_tag "https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"
= javascript_include_tag "https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"
= javascript_include_tag "http://twitter.github.com/bootstrap/assets/js/bootstrap-dropdown.js"
Expand Down
2 changes: 1 addition & 1 deletion source/stylesheets/screen.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ html{
border-top: orange 3px solid;
&:before { content: "Pos: " attr(data-pos-start); }
&:after {
content: "Pop: " attr(data-popularity);
content: "Score: " attr(data-score) ", Pop: " attr(data-popularity);
background: #ff3c3a;
color: white;
padding: 2px 5px;
Expand Down