Skip to content

Instantly share code, notes, and snippets.

collectionViewDragViewFor: function(view, dragContent) {
// TODO [JH2] Make this an imageView
var content = view.getPath('selection.firstObject');
var size = content.get('naturalSize');
var dragLayer = view.get('layer').cloneNode(false);
return SC.View.design({
parentView: view,
layer: dragLayer,
layout: { top: 0, left: 0, height: size.height, width: size.width },
childViews: [
/*globals Twitapp*/
Twitapp.String = {
stripTags: function() {
return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi, '');
},
unescapeHTML: function () {
return this.stripTags().replace(/&lt;/g,'<').replace(/&gt;/g,'>').replace(/&amp;/g,'&').replace(/&quot;/g,'\"');
rowHeight: 21,
customRowHeight: 32,
useCustomRowHeight: YES,
customRowHeightIndexes: function(){
if(!this.get('useCustomRowHeight')) return null;
var ret = SC.IndexSet.create(), idx, len, nextHeaderIdx = 0;
var content = this.getPath('content.treeItemChildren');
if (content) {
len = content.get('length');
/*#!/usr/bin/env node*/
// ..........................................................
// REQUIRES
//
var Seed = require('seed');
var Co = Seed.require('seed:co');
// ..........................................................
// FUNCTIONS
var sys = require('sys');
// starts a new TestCase with the given description.
//
// var assert = require('assert')
// describe("An array")
// it("tracks length", function() {
// var a = [1]
// assert.equal(1, a.length)
// })
// ..........................................................
// TEST SETUP
//
NRDEBUG = true;
process.mixin(GLOBAL, require('ntest'));
var sys = require('sys'),
redisclient = require('./lib/redisclient'),
queue = require('./node_resque').create(0,"resque"),
assert = require('assert'),
redis = new redisclient.Client();
task 'build', 'build all of the source files', ->
sourceFiles: ['test.coffee']
fs: require('fs'); sys: require('sys');
seed: require('seed'); coffee: seed.require('coffee-script');
for src in sourceFiles
fs.readFile src, (err, code) ->
compiled: coffee.compile code
fs.writeFile src.replace(/\.coffee/,'.js'), compiled, "utf8", (err) ->
throw err if err
puts "Compiled $src -> ${src.replace(/\.coffee/,'.js')}."
objectA = SC.Object.create({
calledLocalObserver: false,
calledGlobalObserver: false,
calledMixedObserver: false,
locallyObservedProperty: 'beingWatched',
testLocalObserver: function() {
this.calledLocalObserver = true;
}.observes('locallyObservedProperty'),
/*globals global*/
global.DEBUG = false;
var smartdown = require("smartdown"), fs = require("core_support:fs"),
spawn = require("spawn"), sys = require("sys"),
Path = require("core_support:path");
var fixPath = function(opts) {
if (global.DEBUG) sys.puts("Entered fixPath:");
var outputDirectory = opts.output;
if (outputDirectory[outputDirectory.length - 1] !== "/") outputDirectory += "/";
task :add_other_combined do
if MANIFEST.target[:target_name] =~ /\/myapp/i
tmp_entries = []
tmp_entries.push MANIFEST.entry_for('someframework:javascript.js')
tmp_entries.push MANIFEST.entry_for('anotherframework:javascript.js')
tmp_entries.each { |e|
e.clean!
}
MANIFEST.add_composite 'all_the_stuffs.js',
:source_entries => tmp_entries,