Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
These installation instructions are not meant for novices. Improvements are welcome.

### Quick and Simple (Demo purposes) Installation

If you're looking to demo Avocadojs, your best bet is to go to
avocadojs.com and demo it from there.
Unless you want the most up-to-date version of the code for some
reason, or you're playing with Avocadojs and you want to quickly demo
what you've done. In which case, throw the public directory somewhere
where a webserver can see its contents. For example, on Mac OS X,
start up your webserver, and then copy the "public" folder to the "Sites" directory.

Remember, for the newer versions of OS X you'll have to start apache from the commandline, like so:

>sudo apachectl start
>sudo apachectl stop
>sudo apachectl restart

and you might have to do things like play with your user config file, ie:

>sudo vim /etc/apache2/users/USERNAME.conf

possibly writing something like this in there:

> \<Directory "/Users/alex/Sites/"\>
> Options Indexes Multiviews
> Options FollowSymLinks
> AllowOverride AuthConfig Limit
> Order deny,allow
> Deny from all
> Allow from 127.0.0.1
> \</Directory\>

### More complicated, development installation

I run Apache with WebDav, and serve the public
directory through there.

Don't do this alone, unless you're fairly confident you know what
you're doing. Enabling WebDav while Apache is running, without knowing
how to properly secure things, is probably a bad idea.

7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
A fork of [Adam](https://github.com/AdamSpitz)'s [Avocadojs](https://github.com/AdamSpitz/Avocado).

Why? Because [forks are easier than direct contributions](http://www.youtube.com/watch?feature=player_detailpage&v=0SARbwvhupQ#t=1697s).

This project doesn't (yet) have any documentation - contributions are welcome.

See [here](http://avocadojs.com/ "avocadojs.com") for more project information.
16 changes: 16 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="1;url=avocado.xhtml">
<script type="text/javascript">
window.location.href =
window.location.href.substring(0,"index.html".length()) + "avocado.xhtml"
</script>
<title>Page Redirection</title>
</head>
<body>
<!-- Note: don't tell people to `click` the link, just tell them that it is a link. -->
If you are not redirected automatically, follow the <a href='avocado.xhtml'>link to example</a>
</body>
</html>
5 changes: 1 addition & 4 deletions public/javascripts/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -1215,10 +1215,7 @@ thisModule.addSlots(avocado.transporter, function(add) {
var repoURL = baseURL + "javascripts/";

// aaa - hack because I want saving to keep working on my local machine
if (repoURL.indexOf("http://localhost") === 0) { avocado.kernelModuleSupportsWebDAV = true; }

// aaa - hack because I haven't managed to get WebDAV working on the real server yet
if (repoURL.indexOf("coolfridgesoftware.com") >= 0) { window.kernelModuleSavingScriptURL = "http://coolfridgesoftware.com/cgi-bin/savefile.cgi"; }
if (repoURL.indexOf("http://localhost") === 0 || repoURL.indexOf("http://127.0.0.1") === 0) { avocado.kernelModuleSupportsWebDAV = true; }

var kernelRepo;
if (window.kernelModuleSavingScriptURL) {
Expand Down
1 change: 0 additions & 1 deletion public/javascripts/bootstrap_lk.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ thisModule.addSlots(avocado.transporter.livelyKernelInitializer, function(add) {
// Loading LK modules dynamically, in the same order that they are loaded in the xhtml file.
avocado.transporter.loadExternal(
["prototype/prototype",
"lk/JSON",
"lk/defaultconfig",
"local-LK-config",
"lk/Base",
Expand Down
16 changes: 8 additions & 8 deletions public/javascripts/core/collections/hash_table.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,14 @@ thisModule.addSlots(avocado.hashTable, function(add) {
}, {category: ['accessing']});

add.method('_each', function (iterator) {
for (var h in this._buckets) {
if (this._buckets.hasOwnProperty(h)) {
var b = this._buckets[h];
if (b instanceof Array) {
for (var i = 0, n = b.length; i < n; ++i) {
var entry = b[i];
iterator(entry);
}
var keys = Object.native_keys(this._buckets);
var length = keys.length;
for (var i = 0; i < length; i++) {
var b = this._buckets[keys[i]];
if(b && b instanceof Array) {
for (var j = 0, n = b.length; j < n; ++j) {
var entry = b[j];
iterator(entry);
}
}
}
Expand Down
38 changes: 21 additions & 17 deletions public/javascripts/core/deep_copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,21 @@ thisModule.addSlots(avocado.deepCopier, function(add) {
var isArray = isObj && (o instanceof Array);
c = isObj ? (isArray ? [] : Object.create(o['__proto__'])) : eval("(" + o.toString() + ")");
var thisCopier = this;
for (var n in o) {
if (o.hasOwnProperty(n)) {
var contents = o[n];
if (n === '__annotation__') {
c[n] = contents.copy();
var keys = Object.native_keys(o);
var length = keys.length;
for (var j = 0; j < length; ++j){
var n = keys[j];
var contents = o[n];
if (n === '__annotation__') {
c[n] = contents.copy();
} else if (contents) {
var contentsType = typeof(contents);
var contentsCreatorSlot = (contentsType === 'object' || contentsType === 'function') && avocado.annotator.theCreatorSlotOf(contents);
if (contentsCreatorSlot && contentsCreatorSlot.name === n && contentsCreatorSlot.holder === o) {
c[n] = thisCopier.createCopyOf(contents);
avocado.annotator.annotationOf(c[n]).setCreatorSlot(n, c);
} else {
var contentsType = typeof(contents);
var contentsCreatorSlot = (contentsType === 'object' || contentsType === 'function') && avocado.annotator.theCreatorSlotOf(contents);
if (contentsCreatorSlot && contentsCreatorSlot.name === n && contentsCreatorSlot.holder === o) {
c[n] = thisCopier.createCopyOf(contents);
avocado.annotator.annotationOf(c[n]).setCreatorSlot(n, c);
} else {
c[n] = contents;
}
c[n] = contents;
}
}
}
Expand Down Expand Up @@ -87,12 +88,15 @@ thisModule.addSlots(avocado.deepCopier, function(add) {
var thisCopier = this;
var originalsAndCopies = this._originalsAndCopies;
var originalsAndCopiesCount = originalsAndCopies.length;
for (var n in c) {
if (c.hasOwnProperty(n)) {
var keys = Object.native_keys(c);
var length = keys.length;
for (var j = 0; j < length; ++j){
var n = keys[j];
var contents = c[n];
if (contents) {
if (n === '__annotation__') {
// just ignore it, no refs to fix up, I think - oh, actually, could do the creator slot, but we've already done it up above
} else {
var contents = c[n];
} else {
var contentsType = typeof(contents);
if (contentsType === 'object' || contentsType === 'function') {
var wasInternalRef = false;
Expand Down
4 changes: 2 additions & 2 deletions public/javascripts/general_ui/wheel_menus.js
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ thisModule.addSlots(avocado.morphMixins.WorldMorph, function(add) {
return commandMorph._cachedArgumentMorphLabels;
}, {category: ['commands', 'feedback']});

add.method('findArgumentMorphsAndShowLabels', function (argMorphLabels, partialCommand) {
add.method('findArgumentMorphsAndShowLabels', function (evt, argMorphLabels, partialCommand) {
var context = partialCommand.command().contextOrDefault();
argMorphLabels.each(function(m, i) {
var argHolder = partialCommand.argumentHolders()[i];
Expand All @@ -531,7 +531,7 @@ thisModule.addSlots(avocado.morphMixins.WorldMorph, function(add) {

add.method('showWhatWillHappenIfThisCommandRuns', function (evt, commandMorph) {
var pc = commandMorph._model.createPartialCommand();
this.findArgumentMorphsAndShowLabels(this.argumentMorphLabelsFor(commandMorph), pc);
this.findArgumentMorphsAndShowLabels(evt, this.argumentMorphLabelsFor(commandMorph), pc);
var world = avocado.ui.worldFor(evt);
world.removeAllPartialCommandMorphs();
world.showPartialCommandMorph(world.morphFor(pc).setFillOpacity(0.5));
Expand Down
18 changes: 11 additions & 7 deletions public/javascripts/lk/Base.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ Object.defineProperties = function(object, descriptorSet) {
}
return object;
}


Object.native_keys = Object.keys;
Object.defineProperties(Object, {
// I like mine better. -- Adam
/*
Expand All @@ -62,12 +63,15 @@ Object.defineProperties(Object, {
*/

keys: {
value: function(object, optFast) {
if (typeof object !== 'object') throw new TypeError('not an object');
var names = []; // check behavior wrt arrays
for (var name in object) {
if (object.hasOwnProperty(name))
names.push(name);
value: function(object, optFast) {
if (typeof object !== 'object' && typeof object !== 'function') throw new TypeError('not an object');
var names = []; // check behavior wrt arrays
var keys = Object.native_keys(object);
var length = keys.length;
for (var i = 0; i < length; ++i) {
var name = keys[i];
if (object[name])
names.push(name);
}
if (!optFast) names.sort();
return names;
Expand Down
Loading