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
User = Backbone.Model.extend({ | |
login_attempts: 3, | |
login: function(){ | |
var that = this; | |
var res = null; | |
$.ajaxSetup({async:false}); | |
$.post(SITE_PATH + 'user/login', $('form#loginform').serialize(), function(data){ | |
try{ | |
res = $.parseJSON(data); |
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
this.views['groupTree'].bind('show_features', function(){ | |
that.navigate('show_features'); | |
}); |
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
Editor = Backbone.Router.extend({ | |
immo: {}, | |
lm: {}, | |
nav: [], | |
pages: [], | |
routes: { | |
'editor/basic': 'basic', | |
'editor/basic/:id': 'basic', | |
'editor/details': 'details', | |
'editor/details/:id': 'details', |
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
<?php | |
class Resource{ | |
private $_files = array(); | |
public $type; // either css or js | |
public $composed_file; // name of composed file | |
private static $_instances = array(); | |
public function get(){ | |
return $this->_files; | |
} |
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
$.fn.slider = function(config){ | |
var settings = { | |
next: $('.btn_next'), | |
prev: $('.btn_next'), | |
c_visible_items: null, | |
item_width: null, | |
}; | |
if (config) $.extend(settings,config); | |
var is_clickable = true; |
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
ajax_wrapper = { | |
override: { | |
success: function(data){ | |
if (data.wrapped){ | |
if (data.errors.length){ | |
$.each(data.errors, function(key, error){ | |
alert(error); | |
}); | |
return false; | |
} |
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
Editor = Backbone.Router.extend({ | |
immo: {}, | |
lm: {}, | |
nav: [], | |
pages: [], | |
routes: { | |
'editor/basic': 'basic_page', | |
'editor/basic/:id': 'basic_page', | |
'editor/details': 'details_page', | |
'editor/details/:id': 'details_page', |
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
<?php | |
Resource::instance('js')->add(array( | |
'frontend', | |
'chicken', | |
'slider', | |
'autocomplete', | |
)); | |
Resource::instance('css')->add(array( | |
'chicken', |
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
<?php | |
class Controller_Article extends Layout{ | |
public $secure_actions = array( | |
'delete' => array('moderator'), | |
'save' => array('moderator')); | |
public function action_save(){ | |
$id = $this->request->param('id'); | |
$article = ORM::factory('article', $id); | |
if (!$article->loaded()){ |
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
class User < ActiveRecord::Base | |
# Include default devise modules. Others available are: | |
# :token_authenticatable, :confirmable, | |
# :lockable, :timeoutable and :omniauthable | |
devise :database_authenticatable, :recoverable, :rememberable, :trackable | |
# :registerable, :validatable | |
# Setup accessible (or protected) attributes for your model | |
attr_accessible :first_name, :last_name, :country, :city, :address, :phone, :email, :password, :password_confirmation, :remember_me | |
# attr_accessible :title, :body |
OlderNewer