From a87097a6d75559d3e923259694555c92892a6977 Mon Sep 17 00:00:00 2001 From: Matthew Sumner Date: Mon, 6 Apr 2015 11:54:10 -0400 Subject: [PATCH] Create a 'none' theme. Why: * I would like to forgo the jquery-ui css and instead style the components myself. This PR: * Allows the user to set the theme to none. --- README.md | 5 ++++- index.js | 26 ++++++++++++++------------ package.json | 2 +- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 85a44b2..3e8698c 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ you may do so by editing your Brocfile.js like this: 'theme': 'ui-darkness' } }); - + The list of available standard themes (with JQuery UI 1.11.1): * base @@ -56,6 +56,9 @@ The list of available standard themes (with JQuery UI 1.11.1): * ui-lightness * vader +If you'd prefer not to include any of the above jquery-ui themes, you can set +the theme to 'none'. + ## Included Components At the moment, ember-cli-jquery-ui includes nine of the eleven jquery ui widgets wrapped in components: diff --git a/index.js b/index.js index bd3f2f7..a6f0eac 100644 --- a/index.js +++ b/index.js @@ -19,21 +19,23 @@ module.exports = { app.import(path.join(app.bowerDirectory, 'jquery-ui', 'jquery-ui.js')); - var cssFileDir = path.join(app.bowerDirectory, 'jquery-ui', 'themes', theme); - var cssFiles = fs.readdirSync(cssFileDir); + if (theme != 'none') { + var cssFileDir = path.join(app.bowerDirectory, 'jquery-ui', 'themes', theme); + var cssFiles = fs.readdirSync(cssFileDir); - cssFiles.forEach(function(file) { - if (/^.*\.css$/.test(file) && !/^.*\.min\.css$/.test(file)) - app.import(path.join(cssFileDir, file)); - }); + cssFiles.forEach(function(file) { + if (/^.*\.css$/.test(file) && !/^.*\.min\.css$/.test(file)) + app.import(path.join(cssFileDir, file)); + }); - var imgFileDir = path.join(app.bowerDirectory, 'jquery-ui', 'themes', theme, 'images'); - var imgFiles = fs.readdirSync(imgFileDir); + var imgFileDir = path.join(app.bowerDirectory, 'jquery-ui', 'themes', theme, 'images'); + var imgFiles = fs.readdirSync(imgFileDir); - imgFiles.forEach(function(file) { - app.import(path.join(imgFileDir, file), { - destDir: "/assets/images" + imgFiles.forEach(function(file) { + app.import(path.join(imgFileDir, file), { + destDir: "/assets/images" + }); }); - }); + } } }; diff --git a/package.json b/package.json index 1878976..ecc81a7 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ember-cli-jquery-ui", "description": "A simple addon to add jquery-ui as a dependency to your app. Also includes a small library of components wrapping JQuery UI widgets.", - "version": "0.0.14", + "version": "0.0.15", "exampleAppUrl": "http://ember-cli-jquery-ui-example.herokuapp.com/", "directories": { "doc": "doc",