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
10 changes: 5 additions & 5 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* ***** BEGIN LICENSE BLOCK *****
*
*
* Copyright (c) <%= COPYRIGHT_YEAR %> Aptana, Inc.
*
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
Expand All @@ -10,10 +10,10 @@
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
Expand All @@ -22,5 +22,5 @@
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
*
* ***** END LICENSE BLOCK ***** */
20 changes: 10 additions & 10 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ require 'fileutils'

module ActiveJSHelper
ROOT_DIR = File.expand_path(File.dirname(__FILE__))

ASSETS_DIR = File.join(ROOT_DIR, 'assets')
SRC_DIR = File.join(ROOT_DIR, 'src')
DIST_DIR = File.join(ROOT_DIR, 'assets/downloads')
DOCS_DIR = File.join(ROOT_DIR, 'docs')
TEST_DIR = File.join(ROOT_DIR, 'test')
VENDOR_DIR = File.join(ROOT_DIR, 'vendor')

VERSION = YAML.load(IO.read(File.join(SRC_DIR, 'constants.yml')))['VERSION']

SOURCE_FILE_FOR_DOCS = File.join(DIST_DIR, 'source_for_docs.js')

INCLUDES = {
:swfaddress => [
File.join(VENDOR_DIR,'swfaddress/swfaddress.js')
Expand All @@ -33,7 +33,7 @@ module ActiveJSHelper
File.join(SRC_DIR,'active_support/initializer.js')
]
}

DISTRIBUTION_FOR_DOC_GENERATION = [
File.join(SRC_DIR,'active_support.js'),
File.join(SRC_DIR,'builder.js'),
Expand All @@ -43,7 +43,7 @@ module ActiveJSHelper
File.join(SRC_DIR,'active_record.js'),
File.join(SRC_DIR,'active_view.js')
]

DISTRIBUTIONS = {
'dom.js' => [
File.join(SRC_DIR,'dom.js')
Expand Down Expand Up @@ -86,7 +86,7 @@ module ActiveJSHelper
File.join(SRC_DIR,'active_view.js'),
File.join(SRC_DIR,'active_record.js'),
INCLUDES[:swfaddress]
],
],
#ActiveJS combined tests
File.join('..','..','test','test.js') => [
Dir[File.join(TEST_DIR,'**/setup.js')],
Expand All @@ -106,7 +106,7 @@ module ActiveJSHelper
Dir[File.join(TEST_DIR,group + '/*.js')].reject{|item| item.match(/setup\.js$/)}
].flatten.reject{|item| item.match(/\/test.js$/)}
end

def self.sprocketize
load_path = [SRC_DIR]
DISTRIBUTIONS.each_pair do |distribution_name,source_files|
Expand All @@ -121,7 +121,7 @@ module ActiveJSHelper
secretary.concatenation.save_to(File.join(DIST_DIR, distribution_name))
end
end

def self.sprocketize_for_docs
flattened_source_files = DISTRIBUTION_FOR_DOC_GENERATION.clone.flatten
secretary = Sprockets::Secretary.new(
Expand All @@ -140,7 +140,7 @@ task :dist, :copy_locations do |task,arguments|
ActiveJSHelper.sprocketize
ActiveJSHelper::DISTRIBUTIONS.each_pair do |target,payload|
puts "Built #{File.expand_path(File.join(ActiveJSHelper::DIST_DIR,target))}"
end
end
copy_locations = (arguments[:copy_locations] || '').split(',')
copy_locations.each do |location_pair|
source, target = location_pair.split(':')
Expand Down
6 changes: 3 additions & 3 deletions assets/samples/editable_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
this.listView.insertListItem('Sample Item');
return element;
});

ListView = ActiveView.create(function(builder,dom){
return builder.ul();
},{
Expand All @@ -35,7 +35,7 @@
}).getElement());
}
});

ListItemView = ActiveView.create(function(builder,dom){
var element = builder.li(
builder.span(this.get('content')),
Expand All @@ -48,7 +48,7 @@
},this);
return element;
});

ActiveSupport.Element.observe(document,'ready',function(){
var example_container = document.getElementById('example_container');
example_container.appendChild(LayoutView.getInstance().getElement());
Expand Down
14 changes: 7 additions & 7 deletions assets/samples/editable_list_with_database.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
<script src="javascripts/example_setup.js"></script>
<script id="source_code">
ActiveRecord.connect();

ListItem = ActiveRecord.create('list_items',{
content: ''
});

LayoutView = ActiveView.create(function(builder,dom){
//all views except ListItemView act as singletons in this example
return builder.div(
Expand All @@ -21,7 +21,7 @@
EditView.getInstance().getElement()
);
});

EditView = ActiveView.create(function(builder,dom){
var element = builder.div(
this.addListItemForm = builder.form(
Expand Down Expand Up @@ -60,7 +60,7 @@
this.reset();
}
});

ListView = ActiveView.create(function(builder,dom){
this.listItemsIndexedById = {};
return builder.ul();
Expand Down Expand Up @@ -90,7 +90,7 @@
ListItem.observe('afterDestroy',function(list_item){
ListView.getInstance().destroyListItemView(list_item);
});

ListItemView = ActiveView.create(function(builder,dom){
var element = builder.li(
this.contentContainer = builder.span(this.get('list_item').get('content')),
Expand All @@ -115,7 +115,7 @@
dom.update(this.contentContainer,this.get('list_item').get('content'));
}
});

ListItemCounterView = ActiveView.create(function(builder,dom){
this.count = 0;
var element = builder.p(
Expand Down Expand Up @@ -150,7 +150,7 @@
ListItem.observe('afterDestroy',function(list_item){
ListItemCounterView.getInstance().decrement();
});

ActiveSupport.Element.observe(document,'ready',function(){
var example_container = document.getElementById('example_container');
example_container.appendChild(LayoutView.getInstance().getElement());
Expand Down
Loading