Skip to content
Closed
Show file tree
Hide file tree
Changes from 39 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
5d2a975
Core: Move version and creation of the ui namespace into its own module
arschmitz Jul 15, 2015
80014cc
Core: Move data selector from core into its own module
arschmitz Jul 15, 2015
eadd138
Core: Move disable-selection into its own module
arschmitz Jul 15, 2015
cb4b685
Core: Move focusable into its own module
arschmitz Jul 16, 2015
e0b0173
Core: Move escape selector into its own module
arschmitz Jul 16, 2015
31894df
Core: Move form method into its own module
arschmitz Jul 16, 2015
7f2b1fe
Core: Move $.ui.ie into its own module
arschmitz Jul 15, 2015
14362e7
Core: Move keyCode into its own module
arschmitz Jul 15, 2015
acc9d4f
Core: Move labels into its own module
arschmitz Jul 15, 2015
7944f56
Core: Move backcompat for core 1.7 into its own module
arschmitz Jul 15, 2015
ac53bb4
Core: Move plugin into its own module
arschmitz Jul 15, 2015
c878e93
Core: Move safeActiveElement into its own module
arschmitz Jul 15, 2015
53c688f
Core: Move safe blur into its own module
arschmitz Jul 16, 2015
c81e802
Core: Move tabbable into its own module
arschmitz Jul 16, 2015
d17cd0b
Core: Move scrollParent into its own module
arschmitz Jul 16, 2015
97a39d2
Core: Movie uniqueId into its own module
arschmitz Jul 16, 2015
b1bc229
Demos: bootstrap needs to account for widgets folder
arschmitz Jul 21, 2015
216ea1a
Accordion: Move accordion into widgets folder
arschmitz Jul 15, 2015
9979e53
Autocomplete: Move autocomplete into widgets folder
arschmitz Jul 15, 2015
326e599
Button: Move button into widgets folder
arschmitz Jul 15, 2015
000d560
Datepicker: Move datepicker into widgets folder
arschmitz Jul 15, 2015
8ddbdec
Dialog: Move dialog into widgets folder
arschmitz Jul 15, 2015
950d841
Draggable: Move draggable into widgets folder
arschmitz Jul 15, 2015
7a930da
Effects: Move individual effects into effects folder
arschmitz Jul 15, 2015
0283e1d
Droppable: Move droppable into widgets folder
arschmitz Jul 15, 2015
d24b67c
Menu: Move menu into widgets folder
arschmitz Jul 15, 2015
9899075
Progressbar: Move progressbar into widgets folder
arschmitz Jul 15, 2015
d4a8d5d
Mouse: Move mouse into widgets folder
arschmitz Jul 15, 2015
e97ac81
Resizable: Move resizable into widgets folder
arschmitz Jul 15, 2015
41224d6
Selectable: Move selectable into widgets folder
arschmitz Jul 15, 2015
8825220
Selectmenu: Move selectmenu into widgets folder
arschmitz Jul 15, 2015
1d1c568
Slider: Move slider into widgets folder
arschmitz Jul 15, 2015
b034c9b
Sortable: Move sortable into widgets folder
arschmitz Jul 15, 2015
93fe76a
Spinner: Move spinner into widgets folder
arschmitz Jul 15, 2015
7e47dc0
Tabs: Move tabs into widgets directory
arschmitz Jul 15, 2015
d2c23a0
Tooltip: Move tooltip into widgets directory
arschmitz Jul 15, 2015
4af1475
Tests: adjust jshint path for moving all widgets into folder
arschmitz Jul 15, 2015
b292e05
Datepicker: move to widgts fixup
arschmitz Jul 29, 2015
3cdae44
Build: Add requirejs build task
arschmitz Jul 29, 2015
7a13ee3
Build: Remove grunt concat task its no longer used
arschmitz Aug 3, 2015
7ac49fa
Core: fixup remove demos link
arschmitz Aug 3, 2015
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 24 additions & 13 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,16 +150,6 @@ grunt.initConfig({
},
compare_size: compareFiles,
concat: {
ui: {
options: {
banner: createBanner( uiFiles ),
stripBanners: {
block: true
}
},
src: uiFiles,
dest: "dist/jquery-ui.js"
},
i18n: {
options: {
banner: createBanner( allI18nFiles )
Expand All @@ -178,6 +168,27 @@ grunt.initConfig({
dest: "dist/jquery-ui.css"
}
},
requirejs: {
js: {
options: {
baseUrl: "./",
paths: {
jquery: "./external/jquery/jquery",
external: "./external/"
},
preserveLicenseComments: false,
optimize: "none",
findNestedDependencies: true,
skipModuleInsertion: true,
exclude: [ "jquery" ],
include: expandFiles( [ "ui/**/*.js", "!ui/i18n/*" ] ),
out: "dist/jquery-ui.js",
wrap: {
start: createBanner( uiFiles ),
}
}
}
},

// Remove the requireSpacesInsideParentheses override once everything is fixed
jscs: {
Expand Down Expand Up @@ -455,10 +466,10 @@ grunt.registerTask( "update-authors", function() {
});
});

grunt.registerTask( "default", [ "lint", "test" ]);
grunt.registerTask( "default", [ "lint", "requirejs", "test" ]);
grunt.registerTask( "lint", [ "asciilint", "jshint", "jscs", "csslint", "htmllint" ]);
grunt.registerTask( "test", [ "qunit" ]);
grunt.registerTask( "sizer", [ "concat:ui", "uglify:main", "compare_size:all" ]);
grunt.registerTask( "sizer_all", [ "concat:ui", "uglify", "compare_size" ]);
grunt.registerTask( "sizer", [ "requirejs:js", "uglify:main", "compare_size:all" ]);
grunt.registerTask( "sizer_all", [ "requirejs:js", "uglify", "compare_size" ]);

};
70 changes: 56 additions & 14 deletions demos/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,61 @@ var script = scripts[ scripts.length - 1 ];
var modules = script.getAttribute( "data-modules" );
var pathParts = window.location.pathname.split( "/" );
var effectsAll = [
"effect-blind",
"effect-bounce",
"effect-clip",
"effect-drop",
"effect-explode",
"effect-fade",
"effect-fold",
"effect-highlight",
"effect-puff",
"effect-pulsate",
"effect-scale",
"effect-shake",
"effect-size",
"effect-slide"
"effects/effect-blind",
"effects/effect-bounce",
"effects/effect-clip",
"effects/effect-drop",
"effects/effect-explode",
"effects/effect-fade",
"effects/effect-fold",
"effects/effect-highlight",
"effects/effect-puff",
"effects/effect-pulsate",
"effects/effect-scale",
"effects/effect-shake",
"effects/effect-size",
"effects/effect-slide"
];
var widgets = [
"accordion",
"autocomplete",
"button",
"datepicker",
"dialog",
"draggable",
"droppable",
"menu",
"mouse",
"progressbar",
"resizable",
"selectable",
"selectmenu",
"slider",
"sortable",
"spinner",
"tabs",
"tooltip"
];

function getPath( module ) {
for ( var i = 0; i < widgets.length; i++ ) {
if ( widgets[ i ] === module ) {
return "widgets/" + module;
}
}
for ( var j = 0; j < effectsAll.length; j++ ) {
if ( module !== "effect" && effectsAll[ j ].indexOf( module ) !== -1 ) {
return "effects/" + module;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks strange - the logic is the same as for the widgets list, but the "effects/" prefix is part of the list, don't you end up with "effects/effects/..."?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an error here it needs to check if it contains the string not === because this is processing when a demo requires a specific effect not all the effects.

}
}
return module;
}
function fixPaths( modules ) {
for ( var i = 0; i < modules.length; i++ ) {
modules[ i ] = getPath( modules[ i ] );
}
return modules;
}

// Hide the page while things are loading to prevent a FOUC
document.documentElement.className = "demo-loading";
Expand All @@ -40,13 +80,15 @@ require.config( {
}
} );


// Replace effects all shortcut modules with all the effects modules
if ( modules && modules.indexOf( "effects-all" ) !== -1 ) {
modules = modules.replace( /effects-all/, effectsAll.join( " " ) );
}

modules = modules ? modules.replace( /^\s+|\s+$/g, "" ).split( /\s+/ ) : [];
modules.push( pathParts[ pathParts.length - 2 ] );
modules = fixPaths( modules );

require( modules, function() {
var newScript = document.createElement( "script" );
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"grunt-contrib-csslint": "0.2.0",
"grunt-contrib-jshint": "0.7.1",
"grunt-contrib-qunit": "0.6.0",
"grunt-contrib-requirejs": "0.4.4",
"grunt-contrib-uglify": "0.1.1",
"grunt-esformatter": "0.2.0",
"grunt-git-authors": "2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function testBasicUsage( widget ) {
exports.testWidget = function( widget, settings ) {
module( widget + ": common widget" );

exports.testJshint( widget );
exports.testJshint( "/widgets/" + widget );
testWidgetDefaults( widget, settings.defaults );
testWidgetOverrides( widget );
testBasicUsage( widget );
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/accordion/common.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
define( [
"lib/common",
"ui/accordion"
"ui/widgets/accordion"
], function( common ) {

common.testWidget( "accordion", {
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/accordion/core.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
define( [
"jquery",
"./helper",
"ui/accordion"
"ui/widgets/accordion"
], function( $, testHelper ) {

var setupTeardown = testHelper.setupTeardown,
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/accordion/events.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
define( [
"jquery",
"./helper",
"ui/accordion"
"ui/widgets/accordion"
], function( $, testHelper ) {

var setupTeardown = testHelper.setupTeardown,
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/accordion/helper.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
define( [
"jquery",
"lib/helper",
"ui/accordion"
"ui/widgets/accordion"
], function( $, helper ) {

return $.extend( helper, {
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/accordion/methods.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
define( [
"jquery",
"./helper",
"ui/accordion"
"ui/widgets/accordion"
], function( $, testHelper ) {

var equalHeight = testHelper.equalHeight,
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/accordion/options.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
define( [
"jquery",
"./helper",
"ui/accordion"
"ui/widgets/accordion"
], function( $, testHelper ) {

var equalHeight = testHelper.equalHeight,
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/autocomplete/common.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
define( [
"lib/common",
"ui/autocomplete"
"ui/widgets/autocomplete"
], function( common ) {

common.testWidget( "autocomplete", {
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/autocomplete/core.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
define( [
"jquery",
"ui/autocomplete"
"ui/widgets/autocomplete"
], function( $ ) {

module( "autocomplete: core" );
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/autocomplete/events.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
define( [
"jquery",
"ui/autocomplete"
"ui/widgets/autocomplete"
], function( $ ) {

module( "autocomplete: events" );
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/autocomplete/methods.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
define( [
"jquery",
"ui/autocomplete"
"ui/widgets/autocomplete"
], function( $ ) {

module( "autocomplete: methods" );
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/autocomplete/options.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
define( [
"jquery",
"ui/autocomplete"
"ui/widgets/autocomplete"
], function( $ ) {

module( "autocomplete: options" );
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/button/common.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
define( [
"lib/common",
"ui/button"
"ui/widgets/button"
], function( common ) {

common.testWidget( "button", {
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/button/core.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
define( [
"jquery",
"ui/button"
"ui/widgets/button"
], function( $ ) {

module("button: core");
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/button/events.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
define( [
"jquery",
"ui/button"
"ui/widgets/button"
], function( $ ) {

module("button: events");
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/button/methods.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
define( [
"jquery",
"ui/button"
"ui/widgets/button"
], function( $ ) {

module("button: methods");
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/button/options.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
define( [
"jquery",
"ui/button"
"ui/widgets/button"
], function( $ ) {

module( "button: options" );
Expand Down
4 changes: 3 additions & 1 deletion tests/unit/core/core.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
define( [
"jquery",
"lib/common",
"ui/core"
"ui/form",
"ui/labels",
"ui/unique-id"
], function( $, common ) {

module( "core - jQuery extensions" );
Expand Down
5 changes: 4 additions & 1 deletion tests/unit/core/selector.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
define( [
"jquery",
"ui/core"
"ui/data",
"ui/escape-selector",
"ui/focusable",
"ui/tabbable"
], function( $ ) {

module( "core - selectors" );
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/datepicker/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ define( [
"jquery",
"lib/common",
"./helper",
"ui/datepicker",
"ui/widgets/datepicker",
"ui/i18n/datepicker-he"
], function( $, common, testHelper ) {

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/datepicker/events.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
define( [
"jquery",
"./helper",
"ui/datepicker"
"ui/widgets/datepicker"
], function( $, testHelper ) {

module("datepicker: events");
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/datepicker/helper.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
define( [
"jquery",
"lib/helper",
"ui/datepicker"
"ui/widgets/datepicker"
], function( $, helper ) {

return $.extend( helper, {
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/datepicker/methods.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
define( [
"jquery",
"./helper",
"ui/datepicker"
"ui/widgets/datepicker"
], function( $, testHelper ) {

module("datepicker: methods");
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/datepicker/options.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
define( [
"jquery",
"./helper",
"ui/datepicker",
"ui/widgets/datepicker",
"ui/i18n/datepicker-fr",
"ui/i18n/datepicker-he",
"ui/i18n/datepicker-zh-CN"
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/dialog/common-deprecated.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
define( [
"lib/common",
"ui/dialog"
"ui/widgets/dialog"
], function( common ) {

common.testWidget( "dialog", {
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/dialog/common.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
define( [
"lib/common",
"ui/dialog"
"ui/widgets/dialog"
], function( common ) {

common.testWidget( "dialog", {
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/dialog/core.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
define( [
"jquery",
"ui/dialog"
"ui/widgets/dialog"
], function( $ ) {

// TODO add teardown callback to remove dialogs
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/dialog/deprecated.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
define( [
"jquery",
"ui/dialog"
"ui/widgets/dialog"
], function( $ ) {

module( "dialog (deprecated): options" );
Expand Down
Loading