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
sc_require('models/record'); | |
App.Customer = App.Record.extend({ | |
/** | |
Walk like a duck | |
@property {Boolean} | |
@default YES | |
@isReadOnly |
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
components: SC.ScrollView.design({ | |
layout: { top: 20, bottom: 10, left: 10, right: 10 }, | |
contentView: SC.ListView.design({ | |
content: [ | |
{ name: 'test' }, | |
{ name: 'test2' }, | |
{ name: 'test3' }, |
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
// ========================================================================== | |
// Project: SproutCore - JavaScript Application Framework | |
// Copyright: ©2006-2009 Sprout Systems, Inc. and contributors. | |
// Portions ©2008-2009 Apple Inc. All rights reserved. | |
// License: Licened under MIT license (see license.js) | |
// ========================================================================== | |
/** @class | |
@extends SC.Renderer | |
@since SproutCore 1.1 |
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
// ========================================================================== | |
// Project: SproutCore - JavaScript Application Framework | |
// Copyright: ©2006-2009 Sprout Systems, Inc. and contributors. | |
// Portions ©2008-2009 Apple Inc. All rights reserved. | |
// License: Licened under MIT license (see license.js) | |
// ========================================================================== | |
/** @class | |
@extends SC.Renderer | |
@since SproutCore 1.1 |
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
/* in views */ | |
sc_require('renderers/custom_list_item_renderer'); | |
MyApp.CustomListItem = SC.ListItemView.extend({ | |
createRenderer: function(theme) { | |
var ret = theme.customListItem(); | |
this.updateRenderer(ret); | |
return ret; |
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
collectionViewShouldSelectIndexes: function(view, indexes) { | |
return indexes.filter(function(index) { | |
return view.get('content').objectAt(index).get('isFoo'); | |
} | |
} |
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
deleteVersion: function () { | |
var version = this.get('version'), | |
arrangedObjects = ContentManager.versionsController.get('arrangedObjects'), | |
idx = arrangedObjects.indexOf(version); | |
version.destroy(); | |
version.commitRecord(); | |
this.invokeLater(function () { | |
var object, test; | |
// start from the previous item |
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
lessed.each_line {|line| | |
final += line.gsub(/url\('data:image\/(gif|png);base64,(.*?)'\)/) do |match| | |
"url('data:image/" + $1 + ";base64," + $2.gsub(" ", "+") + "')" | |
end | |
} |
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
extend: function(ext) { | |
var ret = SC.mixin(SC.beget(this), ext), | |
key, value, cur; | |
for(key in ret) { | |
value = ret[key]; | |
if (value instanceof Function && !value.superclass && (value !== (cur=this[key]))) { | |
value.superclass = value.base = cur; | |
} | |
} |
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
MyApp.MyObject = SC.Object.extend({ | |
property: value; | |
computedProperty: function(){ | |
return this.get('property') === "foo"; | |
}.property('property'), | |
setProperty: function(value){ | |
this.set('property',value); |
OlderNewer