Skip to content

Commit

Permalink
Merge pull request #56 from Daemonite/js-update
Browse files Browse the repository at this point in the history
javascript update
  • Loading branch information
sesemaya committed Jul 28, 2015
2 parents 2c9cef7 + 40aac59 commit c12c57b
Show file tree
Hide file tree
Showing 141 changed files with 8,577 additions and 8,969 deletions.
96 changes: 66 additions & 30 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,24 @@ module.exports = function(grunt) {
pkg: grunt.file.readJSON('package.json'),

concat: {
all: {
files: {
'js/base.js': ['assets/js/*.js'],
'js/project.js': ['assets/js-project/*.js']
}
},
base: {
src: ['js/src/*.js'],
dest: 'js/base.js',
src: ['assets/js/*.js']
},
project: {
src: ['js/src-project/*.js'],
dest: 'js/project.js'
dest: 'js/project.js',
src: ['assets/js-project/*.js']
}
},

connect: {
html: {
base: {
options: {
base: '',
keepalive: 'true',
Expand All @@ -29,6 +35,15 @@ module.exports = function(grunt) {
},

cssmin: {
all: {
files: [{
cwd: 'css/',
dest: 'css/',
expand: true,
ext: '.min.css',
src: ['*.css', '!*.min.css']
}]
},
base: {
src: ['css/base.css'],
dest: 'css/base.min.css'
Expand All @@ -40,6 +55,18 @@ module.exports = function(grunt) {
},

postcss: {
all: {
files: [{
cwd: 'css/',
dest: 'css/',
expand: true,
ext: '.css',
src: ['*.css', '!*.min.css']
}]
},
base: {
src: 'css/base.css'
},
options: {
map: false,
processors: [
Expand All @@ -48,32 +75,43 @@ module.exports = function(grunt) {
})
]
},
base: {
src: 'css/base.css'
},
project: {
src: 'css/project.css'
}
},

sass: {
all: {
files: [{
'css/base.css': 'assets/sass/base.scss',
'css/project.css': 'assets/sass-project/project.scss'
}],
options: {
sourcemap: 'none',
style: 'expanded'
}
},
base: {
files: [{
cwd: 'sass/',
cwd: 'assets/sass/',
dest: 'css/',
expand: true,
ext: '.css',
src: ['*.scss', '!project.scss']
src: ['*.scss']
}],
options: {
sourcemap: 'none',
style: 'expanded'
}
},
project: {
files: {
'css/project.css': 'sass/project.scss',
},
files: [{
cwd: 'assets/sass-project/',
dest: 'css/',
expand: true,
ext: '.css',
src: ['*.scss']
}],
options: {
sourcemap: 'none',
style: 'expanded'
Expand All @@ -82,6 +120,15 @@ module.exports = function(grunt) {
},

uglify: {
all: {
files: [{
cwd: 'js/',
dest: 'js/',
expand: true,
ext: '.min.js',
src: ['*.js', '!*.min.js']
}]
},
base: {
files: {
'js/base.min.js': ['js/base.js']
Expand All @@ -92,32 +139,21 @@ module.exports = function(grunt) {
'js/project.min.js': ['js/project.js']
}
}

},

watch: {
all: {
files: ['assets/js/**/*.js', 'assets/js-project/**/*.js', 'assets/sass/**/*.scss', 'assets/sass-project/**/*.scss'],
tasks: ['concat:all', 'uglify:all', 'sass:all', 'postcss:all', 'cssmin:all']
},
base: {
files: ['js/src/*.js', 'sass/**/*.scss', '!sass/project.scss'],
files: ['assets/js/**/*.js', 'assets/sass/**/*.scss'],
tasks: ['concat:base', 'uglify:base', 'sass:base', 'postcss:base', 'cssmin:base']
},
basecss: {
files: ['sass/**/*.scss', '!sass/project.scss'],
tasks: ['sass:base', 'postcss:base', 'cssmin:base']
},
basejs: {
files: ['js/src/*.js'],
tasks: ['concat:base', 'uglify:base']
},
project: {
files: ['js/src-project/*.js', 'sass/project.scss'],
files: ['assets/js-project/**/*.js', 'assets/sass-project/**/*.scss'],
tasks: ['concat:project', 'uglify:project', 'sass:project', 'postcss:project', 'cssmin:project']
},
projectcss: {
files: ['sass/project.scss'],
tasks: ['sass:project', 'postcss:project', 'cssmin:project']
},
projectjs: {
files: ['js/src-project/*.js'],
tasks: ['concat:project', 'uglify:project']
}
},

Expand Down
46 changes: 46 additions & 0 deletions assets/js-project/project.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// project
// ui-form-adv.html
$('.datepicker-adv-doc-1').datepicker();

$('.datepicker-adv-doc-2').datepicker({
format: "dd-mmm-yyyy",
selectMonths: true,
selectYears: 30
});

// ui-modal.html
$('#toast-1').on('click', function () {
$('body').toast({
content: 'Simple toast with some text'
});
});

$('#toast-2').on('click', function () {
$('body').toast({
content: '<a data-dismiss="toast">Dismiss</a><div class="toast-text">Simple toast with some text and a simple <a href="javascript:void(0)">link</a>.</div>'
});
});

// ui-progress.html
$('.finish-loading').on('click', function(e) {
e.stopPropagation();
$($(this).attr('data-target')).addClass('el-loading-done');
});

$('#el-loading-tile-wrap .tile-active-show').each(function (index) {
var $this = $(this),
timer;

$this.on('hide.bs.tile', function(e) {
clearTimeout(timer);
});

$this.on('show.bs.tile', function(e) {
if (!$('.el-loading', $this).hasClass('el-loading-done')) {
timer = setTimeout(function() {
$('.el-loading', $this).addClass('el-loading-done');
$this.prepend('<div class="tile-sub"><p>Additional information<br><small>Aliquam in pharetra leo. In congue, massa sed elementum dictum, justo quam efficitur risus, in posuere mi orci ultrices diam.</small></p></div>');
}, 6000);
};
});
});
4 changes: 2 additions & 2 deletions js/src/_.js → assets/js/_.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions assets/js/bootstrap.js

Large diffs are not rendered by default.

Loading

0 comments on commit c12c57b

Please sign in to comment.