Skip to content

Commit d14b90d

Browse files
committed
Build: Manage dependencies with bower
Fixes jquery-archivegh-6369
1 parent b989774 commit d14b90d

9 files changed

Lines changed: 144 additions & 22 deletions

File tree

Gruntfile.js

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,85 @@ module.exports = function( grunt ) {
736736
}
737737
},
738738

739+
bowercopy: {
740+
options: {
741+
742+
// Bower components folder will be removed afterwards
743+
clean: true
744+
},
745+
tests: {
746+
options: {
747+
destPrefix: "external"
748+
},
749+
files: {
750+
"qunit.js": "qunit/qunit/qunit.js",
751+
"qunit.css": "qunit/qunit/qunit.css",
752+
"jshint/jshint.js": "jshint/dist/jshint.js"
753+
}
754+
},
755+
requirejs: {
756+
options: {
757+
destPrefix: "external"
758+
},
759+
files: {
760+
"requirejs/require.js": "requirejs/require.js",
761+
"requirejs/plugins/text.js": "requirejs-text/text.js",
762+
"requirejs/plugins/json.js": "requirejs-plugins/src/json.js"
763+
}
764+
},
765+
jquery: {
766+
options: {
767+
destPrefix: "js"
768+
},
769+
files: {
770+
"jquery.js": "jquery/jquery.js"
771+
}
772+
},
773+
"jquery-ui": {
774+
options: {
775+
destPrefix: "js",
776+
copyOptions: {
777+
process: function( content ) {
778+
var version = grunt.file.readJSON( "bower.json" ).dependencies[ "jquery-ui" ];
779+
if ( /#/.test( version ) ) {
780+
version = version.split( "#" )[ 1 ];
781+
}
782+
return content.replace( /@VERSION/g, version );
783+
}
784+
}
785+
},
786+
files: {
787+
"jquery.ui.core.js": "jquery-ui/ui/jquery.ui.core.js",
788+
"jquery.ui.widget.js": "jquery-ui/ui/jquery.ui.widget.js"
789+
}
790+
},
791+
"jquery-ui-tabs": {
792+
options: {
793+
destPrefix: "js",
794+
copyOptions: {
795+
process: function( content ) {
796+
var version = grunt.file.readJSON( "bower.json" ).dependencies[ "jquery-ui-tabs" ];
797+
if ( /#/.test( version ) ) {
798+
version = version.split( "#" )[ 1 ];
799+
}
800+
return content.replace( /@VERSION/g, version );
801+
}
802+
}
803+
},
804+
files: {
805+
"widgets/jquery.ui.tabs.js": "jquery-ui-tabs/ui/jquery.ui.tabs.js"
806+
}
807+
},
808+
"jquery-plugins": {
809+
options: {
810+
destPrefix: "js"
811+
},
812+
files: {
813+
"jquery.hashchange.js": "jquery-hashchange/jquery.ba-hashchange.js"
814+
}
815+
}
816+
},
817+
739818
clean: {
740819
dist: [ dist ],
741820
git: [ path.join( dist, "git" ) ],
@@ -746,6 +825,7 @@ module.exports = function( grunt ) {
746825
});
747826

748827
// grunt plugins
828+
grunt.loadNpmTasks( "grunt-bowercopy" );
749829
grunt.loadNpmTasks( "grunt-contrib-jshint" );
750830
grunt.loadNpmTasks( "grunt-contrib-clean" );
751831
grunt.loadNpmTasks( "grunt-contrib-copy" );
@@ -807,6 +887,8 @@ module.exports = function( grunt ) {
807887
grunt.registerTask( "dist:release", [ "release:init", "dist", "cdn" ] );
808888
grunt.registerTask( "dist:git", [ "dist", "clean:git", "config:copy:git:-git", "copy:git" ] );
809889

890+
grunt.registerTask( "updateDependencies", [ "bowercopy" ] );
891+
810892
grunt.registerTask( "test", [ "jshint", "config:fetchHeadHash", "js:release", "connect", "qunit:http" ] );
811893
grunt.registerTask( "test:ci", [ "qunit_junit", "connect", "qunit:http" ] );
812894

bower.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "jquery-mobile",
3+
"version": "1.4.1pre",
4+
"main": [
5+
"js/jquery.mobile.js",
6+
"css/themes/default/jquery.mobile.css"
7+
],
8+
"ignore": [
9+
".jshintrc",
10+
"**/*.txt",
11+
"build",
12+
"demos",
13+
"tests",
14+
"tools"
15+
],
16+
"dependencies": {
17+
"jquery": "1.10.2",
18+
"jquery-ui": "jquery/jquery-ui#c0ab71056b936627e8a7821f03c044aec6280a40",
19+
"jquery-ui-tabs": "jquery/jquery-ui#fadf2b312a05040436451c64bbfaf4814bc62c56",
20+
"jquery-hashchange": "gseguin/jquery-hashchange#77c4b3551fc6bdc2ac6b22b2641cfd7ac6b212d2"
21+
},
22+
"devDependencies": {
23+
"requirejs": "2.1.2",
24+
"qunit": "1.9.0",
25+
"jshint": "2.4.0",
26+
"requirejs-text": "2.0.3",
27+
"requirejs-plugins": "millermedeiros/requirejs-plugins#34330a5d735474ac0b518eb1eb270c9e5505a537"
28+
}
29+
}

external/qunit.css

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,10 @@
3838
line-height: 1em;
3939
font-weight: normal;
4040

41-
-webkit-border-radius: 5px 5px 0 0;
4241
border-radius: 5px 5px 0 0;
42+
-moz-border-radius: 5px 5px 0 0;
43+
-webkit-border-top-right-radius: 5px;
44+
-webkit-border-top-left-radius: 5px;
4345
}
4446

4547
#qunit-header a {
@@ -111,8 +113,9 @@
111113

112114
background-color: #fff;
113115

114-
-webkit-border-radius: 5px;
115116
border-radius: 5px;
117+
-moz-border-radius: 5px;
118+
-webkit-border-radius: 5px;
116119
}
117120

118121
#qunit-tests table {
@@ -187,8 +190,10 @@
187190
}
188191

189192
#qunit-tests > li:last-child {
190-
-webkit-border-radius: 0 0 5px 5px;
191193
border-radius: 0 0 5px 5px;
194+
-moz-border-radius: 0 0 5px 5px;
195+
-webkit-border-bottom-right-radius: 5px;
196+
-webkit-border-bottom-left-radius: 5px;
192197
}
193198

194199
#qunit-tests .fail { color: #000000; background-color: #EE5757; }
@@ -224,8 +229,3 @@
224229
width: 1000px;
225230
height: 1000px;
226231
}
227-
228-
[data-nstest-role='page'], [data-nstest-role='dialog'] {
229-
position: absolute !important;
230-
top: -10000px !important;
231-
}

external/qunit.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1328,6 +1328,7 @@ function registerLoggingCallback( key ) {
13281328

13291329
// Supports deprecated method of completely overwriting logging callbacks
13301330
function runLoggingCallbacks( key, scope, args ) {
1331+
//debugger;
13311332
var i, callbacks;
13321333
if ( QUnit.hasOwnProperty( key ) ) {
13331334
QUnit[ key ].call(scope, args );

js/jquery.hashchange.js

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1+
/*!
2+
* jQuery hashchange event - v1.3 - 7/21/2010
3+
* http://benalman.com/projects/jquery-hashchange-plugin/
4+
*
5+
* Copyright (c) 2010 "Cowboy" Ben Alman
6+
* Dual licensed under the MIT and GPL licenses.
7+
* http://benalman.com/about/license/
8+
*/
9+
110
// Script: jQuery hashchange event
2-
//
11+
//
312
// *Version: 1.3, Last updated: 7/21/2010*
413
//
514
// Project Home - http://benalman.com/projects/jquery-hashchange-plugin/
@@ -76,7 +85,9 @@
7685
// extra awesomeness that BBQ provides. This plugin will be included as
7786
// part of jQuery BBQ, but also be available separately.
7887

79-
(function( $, window, undefined ) {
88+
(function($,window,undefined){
89+
'$:nomunge'; // Used by YUI compressor.
90+
8091
// Reused string.
8192
var str_hashchange = 'hashchange',
8293

@@ -242,14 +253,14 @@
242253
// event for browsers that don't natively support it, including creating a
243254
// polling loop to watch for hash changes and in IE 6/7 creating a hidden
244255
// Iframe to enable back and forward.
245-
fake_onhashchange = (function() {
256+
fake_onhashchange = (function(){
246257
var self = {},
247258
timeout_id,
248259

249260
// Remember the initial hash so it doesn't get triggered immediately.
250261
last_hash = get_fragment(),
251262

252-
fn_retval = function( val ) { return val; },
263+
fn_retval = function(val){ return val; },
253264
history_set = fn_retval,
254265
history_get = fn_retval;
255266

@@ -286,7 +297,7 @@
286297
// vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
287298
// vvvvvvvvvvvvvvvvvvv REMOVE IF NOT SUPPORTING IE6/7/8 vvvvvvvvvvvvvvvvvvv
288299
// vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
289-
window.attachEvent && !window.addEventListener && !supports_onhashchange && (function() {
300+
window.attachEvent && !window.addEventListener && !supports_onhashchange && (function(){
290301
// Not only do IE6/7 need the "magical" Iframe treatment, but so does IE8
291302
// when running in "IE7 compatibility" mode.
292303

@@ -295,7 +306,7 @@
295306

296307
// When the event is bound and polling starts in IE 6/7, create a hidden
297308
// Iframe for history handling.
298-
self.start = function() {
309+
self.start = function(){
299310
if ( !iframe ) {
300311
iframe_src = $.fn[ str_hashchange ].src;
301312
iframe_src = iframe_src && iframe_src + get_fragment();
@@ -306,7 +317,7 @@
306317

307318
// When Iframe has completely loaded, initialize the history and
308319
// start polling.
309-
.one( 'load', function() {
320+
.one( 'load', function(){
310321
iframe_src || history_set( get_fragment() );
311322
poll();
312323
})
@@ -322,7 +333,7 @@
322333
// prettify the back/next history menu entries. Since IE sometimes
323334
// errors with "Unspecified error" the very first time this is set
324335
// (yes, very useful) wrap this with a try/catch block.
325-
doc.onpropertychange = function() {
336+
doc.onpropertychange = function(){
326337
try {
327338
if ( event.propertyName === 'title' ) {
328339
iframe.document.title = doc.title;
@@ -359,7 +370,7 @@
359370
iframe_doc.open();
360371

361372
// Set document.domain for the Iframe document as well, if necessary.
362-
domain && iframe_doc.write( '<script>document.domain="' + domain + '"<\/script>' );
373+
domain && iframe_doc.write( '<script>document.domain="' + domain + '"</script>' );
363374

364375
iframe_doc.close();
365376

js/jquery.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,6 @@ jQuery.extend({
797797
}
798798
}
799799

800-
801800
// Flatten any nested arrays
802801
return core_concat.apply( [], ret );
803802
},
@@ -8200,7 +8199,6 @@ jQuery.extend({
82008199
}
82018200
}
82028201

8203-
82048202
// if no content
82058203
if ( status === 204 || s.type === "HEAD" ) {
82068204
statusText = "nocontent";

js/jquery.ui.core.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,4 +290,4 @@ $.ui.plugin = {
290290
}
291291
};
292292

293-
})( jQuery );
293+
})( jQuery );

js/jquery.ui.widget.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* jQuery UI Widget c0ab71056b936627e8a7821f03c044aec6280a40N
2+
* jQuery UI Widget c0ab71056b936627e8a7821f03c044aec6280a40
33
* http://jqueryui.com
44
*
55
* Copyright 2013 jQuery Foundation and other contributors

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@
4646
"xmlhttprequest": "1.6.0",
4747
"semver": "2.2.1",
4848
"cheerio": "0.12.4",
49-
"underscore": "1.5.2"
49+
"underscore": "1.5.2",
50+
"grunt-bowercopy": "0.5.0"
5051
},
5152
"main": "Gruntfile.js",
5253
"engines": {

0 commit comments

Comments
 (0)