This file contains 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
handlebars: { | |
compile: { | |
options: { | |
namespace: "JST", | |
processName: function(filePath){ | |
return filePath.replace('assets/coffee/backbone/apps/', '').replace('.hbs', ''); | |
} | |
}, | |
files: { | |
"assets/js/templates.js": "assets/coffee/**/*.hbs", |
This file contains 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
NSP.SportSelectionView = Marionette.ItemView.extend | |
events: | |
'click #select': 'foo' | |
tagName: 'select' | |
id: 'select' | |
template: '#sport-select-view' | |
foo: -> | |
console.log 'bar' |
This file contains 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
NSP.SportItemView = Backbone.Marionette.ItemView.extend | |
template: '#sport-item-view' | |
tagName: 'option' | |
attributes: | |
value: -> | |
console.log this |
This file contains 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
{preload_replace:c='agenda'} | |
{exp:channel:entries | |
channel='{c}' | |
limit='5' | |
dynamic='no' | |
} | |
<article> | |
<h2>{title}</h2> | |
<img src="{{c}_image_main}" alt="{title}"> | |
{{c}_text_body} |
This file contains 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
$(function(){ | |
$('.ajax_link').on('click', function(e){ // catch the click, and bind that click-event to the variable "e" | |
e.preventDefault(); // stop the event from firing (so user doesn't get forwarded to the actual link) | |
var elem = $(this), | |
link = elem.attr('href'), | |
target = elem.attr('rel'); | |
$.get(link, function(data){ // do a GET-request |
This file contains 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
$(document).ready(function(){ | |
$('#myForm').validationEngine('attach', { | |
onValidationComplete: function(form, status){ | |
if(status){ // als ie validate | |
var url = form.attr('action'), | |
data = form.serialize(), | |
message = '<p>Hier het bedankt bericht</p>'; |
This file contains 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
<!doctype html> | |
<html> | |
<head> | |
<style type="text/css"> | |
html, body { | |
height: 100%; | |
} | |
#content { | |
min-height: 100%; | |
padding-bottom: 40px; // Gelijk aan de hoogte van de footer |
This file contains 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
function updateResults(data){ | |
var results = $(data); | |
var finalResults = results.filter('#preResults').html(); | |
var pagerResults = results.filter('#pager').html(); | |
$('#results').replaceWith(finalResults); | |
$('#pagerCatch').html(pagerResults); | |
} | |
$('.filterForm').submit(function(e){ | |
e.preventDefault(); |
This file contains 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
$('#pagerCatch').on('click', 'a', function(e){ | |
e.preventDefault(); | |
var $this = $(this); | |
var theUrl = $this.attr('href'); | |
$.get(theUrl, function(data){ | |
var results = $(data); | |
var finalResults = results.filter('#preResults').html(); | |
var pagerResults = results.filter('#pager').html(); |
This file contains 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
$(document).ready(function(){ | |
$('.search_form').submit(function(e){ | |
e.preventDefault(); | |
var $this = $(this); | |
var theData = $this.serialize(); |
NewerOlder