Created
November 16, 2011 18:36
-
-
Save Quby/1370921 to your computer and use it in GitHub Desktop.
CoffeScript vs JavaScript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @getHref = (js = false)-> | |
| ret = "/"+(if section.length>0 then section else 'pubs') | |
| ret += ".json" if js | |
| pars = [] | |
| filters = @current_filters.join(',') | |
| pars.push("filter=#{filters)}" #if filters.length > 0 | |
| pars.push("sort=#{current_sort}") if current_sort? | |
| pars.push("page=#{current_page}") if current_page? | |
| ret+'?'+pars.join('&') | |
| this.getHref = function (js) { | |
| var ret = "/" + (section.length ? section : "pubs") + (js ? ".json" : ""); | |
| var pars = []; | |
| var filter = this.current_filters.join(); | |
| pars.push("filter=" + filters); | |
| if (current_sort) pars.push("sort=" + curret_sort); | |
| if (curret_page) pars.push("page=" + curret_page); | |
| return ret + pars.join("&"); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment