Skip to content

Instantly share code, notes, and snippets.

View schmidsi's full-sized avatar
🦩

Simon Emanuel Schmid schmidsi

🦩
View GitHub Profile
@schmidsi
schmidsi / feincms_ajax.js
Created September 7, 2011 14:10
FeinCMS ajax client side
var ajax_links_selector = 'a.ajax';
var content_selector = '#content';
var first_call = true;
var navilevel_substring = 3; // how many chars from pathname are static (3 for languagecode like /de/)
/* needs jquery address loaded: http://www.asual.com/jquery/address/
*
* needs feincms to be ajax-enabled:
*
* feincms/views/base.py:
from django import template
import re
register = template.Library()
class_matcher = re.compile('(class="[^"]+)(")')
tag_matcher = re.compile(r'<([a-z0-9]+)([ >])')
def mark_current(navigation, current):
current_tokens = current.split('/')