Skip to content

Experimental datepicker example #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@ require('./main.css');
require('jquery-ui/themes/base/core.css');
require('jquery-ui/themes/base/menu.css');
require('jquery-ui/themes/base/autocomplete.css');
require('jquery-ui/themes/base/calendar.css');
require('jquery-ui/themes/base/datepicker.css');
require('jquery-ui/themes/base/theme.css');
var $ = require('jquery');
var autocomplete = require('jquery-ui/ui/widgets/autocomplete');
var Autocomplete = require('jquery-ui/ui/widgets/autocomplete');
var Datepicker = require('jquery-ui/ui/widgets/datepicker');

$('<h1>Welcome to the programming languages quiz</h1>').appendTo('body');
new autocomplete({
new Autocomplete({
source: ['javascript', 'css', 'c', 'objectivec']
}).element.appendTo('body').focus();

$('<h2>When do you want to start the quiz?</h2>').appendTo('body');
new Datepicker({}).element.appendTo('body');
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@
"author": "Jörn Zaefferer",
"license": "MIT",
"dependencies": {
"cldr-data": "^30.0.1",
"globalize": "^1.1.2",
"jquery": "^2.1.4",
"jquery-ui": "1.12.x"
"jquery-ui": "github:jquery/jquery-ui#datepicker"
},
"devDependencies": {
"clean-webpack-plugin": "^0.1.3",
"globalize-webpack-plugin": "^0.3.6",
"css-loader": "^0.16.0",
"extract-text-webpack-plugin": "^0.8.2",
"file-loader": "^0.8.4",
Expand Down
12 changes: 12 additions & 0 deletions webpack-config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
var Clean = require('clean-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var GlobalizePlugin = require('globalize-webpack-plugin');

module.exports = {
entry: {
Expand All @@ -10,6 +11,10 @@ module.exports = {
path: './dist',
filename: 'app.[hash].js'
},
externals: {
'globalize-locales': 'var {}',
'globalize/date': 'var {}'
},
module: {
loaders: [
{
Expand All @@ -25,6 +30,13 @@ module.exports = {
plugins: [
new Clean(['dist']),
new ExtractTextPlugin("app.[hash].css"),
new GlobalizePlugin({
// toggle this for actual production builds
production: false,
developmentLocale: "de",
supportedLocales: [ "de" ],
output: "globalize-compiled-data-[locale].[hash].js"
}),
new HtmlWebpackPlugin({
title: 'jQuery UI Autocomplete demo, built with webpack'
})
Expand Down