Skip to content

Commit 2c00f86

Browse files
committedJan 20, 2011
Merge branch 'master' of git://github.com/jupiterjs/jquerymx
2 parents 58e1faa + b1b6df7 commit 2c00f86

File tree

9 files changed

+6967
-12
lines changed

9 files changed

+6967
-12
lines changed
 

‎buildAll.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ steal.plugins('steal/build/pluginify','steal/build/apps','steal/build/scripts').
9090
} else {
9191
content = "("+s.build.pluginify.getFunction(content)+")(jQuery);";
9292
}
93-
var out = path.replace(/\/\w+\.js/,"").replace(/\//g,".")
93+
var out = path.replace(/\/\w+\.js/,"").replace(/\//g,".");
94+
content = steal.build.builders.scripts.clean(content);
9495
print(" "+out+"");
9596
content = steal.build.builders.scripts.clean(content);
9697
s.File("jquery/dist/standalone/"+out+".js").save(content);

‎controller/history/history.js

+21-6
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,27 @@ steal.plugins('jquery/controller/subscribe',
22
'jquery/event/hashchange').then(function($){
33

44
/**
5-
* @class
6-
* The controller history plugin adds browser hash (#) based history support.
7-
* This class itself helps break up parts of the hash of the url
8-
* @constructor
9-
* Takes a url and extracts information out of it.
10-
* @param {Object} path
5+
* @page jquery.controller.history History Events
6+
* @parent jQuery.Controller
7+
* @plugin jquery/controller/history
8+
* The jquery/controller/history plugin adds
9+
* browser hash (#) based history support.
10+
*
11+
* Typically you subscribe to a history event in your controllers:
12+
*
13+
* $.Controller("MyHistory",{
14+
* "history.pagename subscribe" : function(called, data){
15+
* //called when hash = #pagename
16+
* }
17+
* })
18+
*
19+
* The following shows hash values and
20+
* the corresponding published message and data.
21+
*
22+
* "#foo=bar" -> "history.index" {foo: bar}
23+
* "#foo/bar" -> "history.foo.bar" {}
24+
* "#foo&bar=baz" -> "history.foo" {bar: baz}
25+
*
1126
*/
1227

1328
var keyBreaker = /([^\[\]]+)|(\[\])/g;

‎download/download.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ body {
5252

5353
#plugins .plugin{
5454
float: right;
55-
padding: 0px 0px 18px 0px;
55+
padding: 0px;
5656
overflow: auto;
5757
width: 422px;
5858

‎download/download.html

+3-2
Original file line numberDiff line numberDiff line change
@@ -399,8 +399,9 @@ <h3>Tie</h3>
399399

400400

401401
</div>
402-
403-
<input class="dl_btn_container" type="submit" value="Download">
402+
<div class="download-builder">
403+
<input type="submit" class="dl_btn_container" value="Download">
404+
</div>
404405

405406
</form>
406407
<script type='text/javascript' src='../jquery.js'></script>

‎download/download.js

+24-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,29 @@
99
});
1010
$('#pluginForm').delegate("input[type=checkbox]", "change",
1111
$.proxy($.Downloader.changeHandler, $.Downloader));
12+
13+
// append css if necessary
14+
if(location.search && /csspath/.test(location.search)){
15+
var path = location.search.split("=")[1];
16+
var headID = document.getElementsByTagName("head")[0],
17+
cssNode = document.createElement('link');
18+
cssNode.type = 'text/css';
19+
cssNode.rel = 'stylesheet';
20+
cssNode.href = path;
21+
cssNode.media = 'screen';
22+
headID.appendChild(cssNode);
23+
}
24+
25+
$.Downloader.setupWordbreaks();
26+
},
27+
// inject <wbr> characters in labels
28+
setupWordbreaks: function(){
29+
var text, newText;
30+
$(".plugin label").each(function(i){
31+
text = $(this).text();
32+
newText = text.replace(/\//g, "<wbr>/")
33+
$(this).html(newText);
34+
})
1235
},
1336
changeHandler: function(ev){
1437
var $target = $(ev.target);
@@ -36,8 +59,7 @@
3659
var dep, i, index;
3760
for(i=0; i<dependencies.length; i++){
3861
dep = dependencies[i];
39-
index = this.dependencies.indexOf(dep);
40-
if(index != -1) {
62+
if(!$.inArray(dep, this.dependencies)) {
4163
this.dependencies.splice(index, 1);
4264
}
4365
this.dependencies.push(dep);

‎download/test/controllerpage.html

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<html>
2+
<head>
3+
<title>Test</title>
4+
</head>
5+
<body>
6+
<script type='text/javascript' src='jquery-1.4.3.js'></script>
7+
<script type='text/javascript' src='../../dist/standalone/jquery.lang.js'></script>
8+
<script type='text/javascript' src='../../dist/standalone/jquery.class.js'></script>
9+
<script type='text/javascript' src='../../dist/standalone/jquery.event.destroyed.js'></script>
10+
<script type='text/javascript' src='../../dist/standalone/jquery.controller.js'></script>
11+
<script type='text/javascript'>
12+
$.Controller.extend('MyController', {}, {});
13+
</script>
14+
</body>
15+
</html>

‎download/test/jquery-1.4.3.js

+6,883
Large diffs are not rendered by default.

‎download/test/run.js

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// load('steal/compress/test/run.js')
2+
/**
3+
* Tests compressing a very basic page and one that is using steal
4+
*/
5+
load('steal/rhino/steal.js')
6+
steal('//steal/test/test', function( s ) {
7+
STEALPRINT = false;
8+
s.test.module("jquery/download")
9+
10+
s.test.test("controller", function(){
11+
load('steal/rhino/steal.js')
12+
s.test.open('jquery/download/test/controllerpage.html')
13+
s.test.ok(MyController, "Controller was loaded")
14+
s.test.clear();
15+
});
16+
});

‎test/run.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// loads all of jquerymx's command line tests
22

3+
load("jquery/download/test/run.js");
4+
35
load('jquery/view/test/compression/run.js');
46

57
load("jquery/generate/test/run.js");

0 commit comments

Comments
 (0)
Please sign in to comment.