Skip to content

Commit

Permalink
merging
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@92557 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information
chillu committed Nov 21, 2009
1 parent 46b0f0c commit dca8c0c
Show file tree
Hide file tree
Showing 94 changed files with 18,732 additions and 370 deletions.
8 changes: 1 addition & 7 deletions forms/CalendarDateField.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,7 @@ function Field() {
}


// javascript: concrete
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-selector/src/jquery.class.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-selector/src/jquery.selector.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-selector/src/jquery.selector.specifity.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-selector/src/jquery.selector.matches.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-concrete/src/jquery.dat.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-concrete/src/jquery.concrete.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-concrete/dist/jquery.concrete-latest.js');

// javascript: custom
Requirements::javascript(SAPPHIRE_DIR . '/javascript/CalendarDateField.js');
Expand Down
2 changes: 1 addition & 1 deletion forms/ComplexTableField.php
Original file line number Diff line number Diff line change
Expand Up @@ -1073,7 +1073,7 @@ function forTemplate() {
Requirements::css(CMS_DIR . '/css/typography.css');
Requirements::css(CMS_DIR . '/css/cms_right.css');
Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/prototype/prototype.js");
Requirements::javascript(SAPPHIRE_dir . "/thirdparty/behaviour/behaviour.js");
Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/behaviour/behaviour.js");
Requirements::javascript(SAPPHIRE_DIR . "/javascript/prototype_improvements.js");
Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/scriptaculous/scriptaculous.js");
Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/scriptaculous/scriptaculous/controls.js");
Expand Down
8 changes: 1 addition & 7 deletions forms/TabSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,7 @@ public function FieldHolder() {
Requirements::css(SAPPHIRE_DIR . '/thirdparty/jquery-ui-themes/smoothness/ui.all.css');
Requirements::css(SAPPHIRE_DIR . '/thirdparty/jquery-ui-themes/smoothness/ui.tabs.css');

// concrete
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-selector/src/jquery.class.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-selector/src/jquery.selector.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-selector/src/jquery.selector.specifity.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-selector/src/jquery.selector.matches.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-concrete/src/jquery.dat.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-concrete/src/jquery.concrete.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-concrete/dist/jquery.concrete-latest.js');

Requirements::javascript(SAPPHIRE_DIR . '/javascript/TabSet.js');

Expand Down
23 changes: 11 additions & 12 deletions javascript/CalendarDateField.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
(function($) {
/**
* Formats a <input type="text"> field with a jQuery UI datepicker.
*
* Requires: concrete, ui.datepicker, jquery.metadata
*
* @author Ingo Schommer, SilverStripe Ltd.
*/
$('.calendardate').concrete('ss', function($){
return {
$.concrete('ss', function($){
/**
* Formats a <input type="text"> field with a jQuery UI datepicker.
*
* Requires: concrete, ui.datepicker, jquery.metadata
*
* @author Ingo Schommer, SilverStripe Ltd.
*/
$('.calendardate').concrete({
onmatch: function() {
this.find('input').each(function() {
var conf = $(this).metadata();
if(conf.minDate) conf.minDate = new Date(Date.parse(conf.minDate));

//

$(this).datepicker(conf);
});
}
};
});
});
}(jQuery));
24 changes: 13 additions & 11 deletions javascript/TabSet.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
(function($){
/**
* Lightweight wrapper around jQuery UI tabs.
* Ensures that anchor links are set properly,
* and any nested tabs are scrolled if they have
* their height explicitly set. This is important
* for forms inside the CMS layout.
*/
$('.ss-tabset').concrete('ss', function($){
return {
$.concrete('ss', function($){
/**
* Lightweight wrapper around jQuery UI tabs.
* Ensures that anchor links are set properly,
* and any nested tabs are scrolled if they have
* their height explicitly set. This is important
* for forms inside the CMS layout.
*/
$('.ss-tabset').concrete({
onmatch: function() {
this.rewriteHashlinks();

// Initialize jQuery UI tabs
this.tabs({
cookie: $.cookie ? { expires: 30, path: '/', name: 'ui-tabs-' + this.attr('id') } : false
});

this._super();
},

/**
* Replace prefixes for all hashlinks in tabs.
* SSViewer rewrites them from "#Root_MyTab" to
Expand All @@ -29,6 +31,6 @@
if(href) $(this).attr('href', href);
});
}
};
});
});
})(jQuery);
8 changes: 1 addition & 7 deletions security/Security.php
Original file line number Diff line number Diff line change
Expand Up @@ -342,13 +342,7 @@ public function login() {
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-ui/ui.core.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-ui/ui.tabs.js');

// concrete
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-selector/src/jquery.class.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-selector/src/jquery.selector.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-selector/src/jquery.selector.specifity.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-selector/src/jquery.selector.matches.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-concrete/src/jquery.dat.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-concrete/src/jquery.concrete.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-concrete/dist/jquery.concrete-latest.js');

Requirements::css(THIRDPARTY_DIR . '/jquery/themes/smoothness/ui.all.css');
Requirements::css(THIRDPARTY_DIR . '/jquery/themes/smoothness/ui.tabs.css');
Expand Down
Binary file added thirdparty/jquery-concrete/.DS_Store
Binary file not shown.
4 changes: 2 additions & 2 deletions thirdparty/jquery-concrete/.piston.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
format: 1
handler:
commit: c857ed5d684031115a2bb369f601c7147a2c69bc
commit: 488376e8aa3c046cbf60adf43c42c76b5031fe20
branch: master
lock: false
repository_url: git://github.com/hafriedlander/jquery.concrete.git
repository_class: Piston::Git::Repository
repository_url: git://github.com/hafriedlander/jquery.concrete.git
64 changes: 56 additions & 8 deletions thirdparty/jquery-concrete/README.textile
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
h1. Concrete - Support for ConcreteUI programming in jQuery

A basic desire for jQuery programming is some sort of OO or other organisational method for code. For your consideration,
we provide a library for ConcreteUI style programming. In ConcreteUI you attach behavioral code to DOM objects. Concrete extends this
concept beyond what is provided by other libraries to provide a very easy to use system with class like, ploymorphic, namespaced properties
By Hamish Friedlander, with thanks to "SilverStripe":http://www.silverstripe.com/

Concrete tries to provide a new model of code organisation - a replacement for Object Oriented programming that is focused on adding functions to groups of DOM elements based on the structure and contents of those DOM elements. It's a merging of the model and view layer that initially seems weird, but can give very powerful results.

We're standing on the shoulders of giants here - combining ideas from Prototype's behaviour & lowpro and jQuery's effen & livequery (who themselves stole ideals from Self's Morphic UI and others), but extending & combining the concepts presented in those tools to provide a complete alternative to traditional OO concepts - self-aware methods, inheritance, polymorphisim and namespacing without a single class definition.

h2. Getting Started

* Walk through the "Tutorial":http://hafriedlander.github.com/jquery.concrete/tutorial/
* Watch the "Screencast":http://www.vimeo.com/6353390 (shot during a introductory developer meeting at SilverStripe)
* Join the "Google Group":http://groups.google.com/group/jquery-concrete and let us know what you think, or what other features you'd like to see

h2. Basic use

Expand Down Expand Up @@ -226,17 +234,46 @@ And the concrete definitions

Then doing $('div').bar(); will _not_ display b. Even though the span rule could never match a div, because baz is defined for some rule in the foo namespace, the base namespace will never be checked

h4. Forcing base
h4. Cleaner namespace blocks

In some situations (such as the last example) you may want to force using the base namespace. In this case you can call concrete without any arguments. For example, if the first definition in the previous example was
When declaring a lot of namespaces, you can declare the namespace seperately from the concrete definitions, like so

<pre><code>
$.concrete('foo', function($){
$('div').concrete({
bar: function() { .. }
})
})
</code></pre>

You can also nest declarations. In this next example, we're defining the functions $().concrete('zap').bar() and $().concrete('zap.pow').baz()

<pre><code>
$.concrete('zap', function($){
$('div').concrete({
bar: function() { .. }
})
$.concrete('pow', function($){
$('div').concrete({
baz: function() { .. }
})
})
})
</code></pre>

h4. Calling to another namespace (and forcing base)

Inside a namespace, namespace lookups are by default relative to the current namespace.

In some situations (such as the last example) you may want to force using the base namespace. In this case you can call concrete with the first argument being the base namespace code '.'. For example, if the first definition in the previous example was

<pre><code>
$('div').concrete('foo', {
bar: function() { this.concrete().baz(); }
bar: function() { this.concrete('.').baz(); }
})
</code></pre>

Then b _would_ be output to the console. It is up to the developer to decide when they need to be explicit about using the base namespace
Then b _would_ be output to the console.

h4. Using

Expand All @@ -252,8 +289,19 @@ Sometimes a block outside of a namespace will need to refer to that namespace re
});
</code></pre>

This equivilent to /with/ in javascript, and just like /with/, care should be taken to only use this construct in situations that merit it.
This equivalent to /with/ in javascript, and just like /with/, care should be taken to only use this construct in situations that merit it.

h2. License

Copyright (C) 2009 Hamish Friedlander (hamish@silverstripe.com) and SilverStripe Limited (www.silverstripe.com). All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of Hamish Friedlander nor SilverStripe nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.



Expand Down
54 changes: 54 additions & 0 deletions thirdparty/jquery-concrete/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/bin/sh

VER=$1

# Get the version - a tag if possible, otherwise a short ref (not well tested code)
if [ "$VER " = " " ] ; then \
VER=`git rev-parse --abbrev-ref=strict HEAD`
fi
if [ "$VER" = "master" ] ; then \
VER=`git show --pretty=format:"%h" --quiet`
fi

# Specify the output file's name
FILE="dist/jquery.concrete-$VER.js"

mkdir -p dist
rm dist/*.js

echo "/* jQuery.Concrete - Copyright 2009 Hamish Friedlander and SilverStripe. Version $VER. */" > $FILE

for x in \
vendor/jquery.selector/jquery.class.js \
vendor/jquery.selector/jquery.selector.js \
vendor/jquery.selector/jquery.selector.specifity.js \
vendor/jquery.selector/jquery.selector.matches.js \
src/jquery.focusinout.js \
src/jquery.concrete.js \
src/jquery.concrete.dommaybechanged.js \
src/jquery.concrete.events.js \
src/jquery.concrete.ctors.js \
src/jquery.concrete.properties.js
do \
echo >> $FILE
echo "/* $x */" >> $FILE
echo >> $FILE
cat $x >> $FILE
echo ';' >> $FILE
echo >> $FILE
done

ln -s `basename "$FILE"` dist/jquery.concrete-latest.js

# cp LICENSE /tmp/
# cp $FILE /tmp/

# git checkout dist
# mv /tmp/$FILE .
# mv /tmp/LICENSE .

# git add $FILE
# git add LICENSE
# git commit -m "Update dist to master version $VER"

# git checkout master
Loading

0 comments on commit dca8c0c

Please sign in to comment.