Skip to content

Instantly share code, notes, and snippets.

View hafriedlander's full-sized avatar

Hamish Friedlander hafriedlander

  • RUSH
  • Auckland, New Zealand
View GitHub Profile
@hafriedlander
hafriedlander / gist:217337
Created October 24, 2009 03:05
Potential private function syntax for concrete
$.concrete('namespace', function($){
$('.selector').concrete({
foo: $.concrete.internal(function(){
}),
bar: function(){
this.foo(); // Allowed
}
})
});
@hafriedlander
hafriedlander / gist:1478799
Created December 14, 2011 22:11
Example of possible by-host configuration in SS3
---
Only:
Host: localnet
---
OurWebServiceClass:
base_url: 'http://sandbox.example-webservice.com/'
---
Except:
Host: localnet
---
@hafriedlander
hafriedlander / gist:1478812
Created December 14, 2011 22:14
Example of possible by-host with dynamic matching configuration in SS3
OurWebServiceClass:
base_url:
'localnet': 'http://sandbox.example-webservice.com/'
'*': 'http://live.example-webservice.com/'
@hafriedlander
hafriedlander / cms_config.php
Created December 14, 2011 22:32
SS3 configuration system blog post example 1 - existing configuration
<?php
Director::addRules(50, array(
'admin/cms//$Action/$ID/$OtherID' => 'CMSMain'
));
Director::addRules(1, array(
'$URLSegment//$Action/$ID/$OtherID' => 'ModelAsController',
));
@hafriedlander
hafriedlander / cms_config_routes.yml
Created December 14, 2011 22:33
SS3 configuration system blog post example 2 - new configuration
---
Name: cms_routes
Before: 'framework/routes#security_route'
---
Director:
Routes:
'admin/cms//$Action/$ID/$OtherID': CMSMain
---
Name: catchall_route
After: '*'
@hafriedlander
hafriedlander / framework_config_routes.yml
Created December 14, 2011 23:03
SS3 configuration system blog post example 3 - conditionals in new system
---
Name: core_routes
---
Director:
Routes:
'$Controller//$Action/$ID/$OtherID': '*'
---
Name: security_route
Except:
moduleexists: 'cms'
@hafriedlander
hafriedlander / gist:2728933
Created May 19, 2012 03:42
Entwine create property on first access pattern
$('selector').entwine({
Editor: null,
createEditor: function(){
return createTheEditorSomehow();
},
getEditor: function(){
var val = this._super();
if (!val) this.setEditor(val = this.createEditor());
@hafriedlander
hafriedlander / gist:2879478
Created June 6, 2012 02:30
Example of possible nesting system in Entwine.js
$('.holder').entwine({
MyProperty: 123,
myMethod: function() { ... },
onmatch: function() { ... },
'ul': $.entwine.nesting({
onmatch: function() { ... },
@hafriedlander
hafriedlander / gist:2879591
Created June 6, 2012 03:02
Possible remote event binding for Entwine.js
/*
Old style. Problems: onmatch is slow. Leaks memory, because there's a reference from window to this node, and window exists forever, so that reference holds this DOM node out of the garbage once it's removed from the document.
*/
$('.node').entwine({
onmatch: function(){
var self = this;
$(window).bind('load', function(){ self.initialise(); });
},
diff --git a/javascript/CMSMain.EditForm.js b/javascript/CMSMain.EditForm.js
index 35d8e44..58b49eb 100644
--- a/javascript/CMSMain.EditForm.js
+++ b/javascript/CMSMain.EditForm.js
@@ -24,6 +24,8 @@
+
+ Title: null,
+
// Constructor: onmatch
onmatch : function() {