Skip to content

Commit

Permalink
Merge pull request #131 from mrgrain/alix7
Browse files Browse the repository at this point in the history
Alix7
  • Loading branch information
mrgrain committed Feb 10, 2015
2 parents 088d482 + 6286362 commit d5d5899
Show file tree
Hide file tree
Showing 470 changed files with 31,975 additions and 17,802 deletions.
3 changes: 3 additions & 0 deletions .bowerrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"directory" : "vendor"
}
11 changes: 9 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# local config files
/www/config/main.cfg.php
/www/config/env.cfg.php

# OS-related/generic files
Thumbs.db
/update-database.bat
/dump-database.bat

/vendor/
/node_modules
/.sass-cache
/dist
210 changes: 210 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
/*global module:false*/
module.exports = function(grunt) {

// Project configuration.
grunt.initConfig({
// Metadata.
pkg: grunt.file.readJSON('package.json'),
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n',

// Task configuration.
bower: {
options: {
copy: false
},
install: {
options: {
copy: false,
verbose: true
}
}
},

copy: {
admin: {
files: [
{
'www/admin/js/admin.js' : 'dist/js/admin.js',
'www/admin/js/codemirror.js' : 'dist/js/codemirror.js'
},
{
expand: true,
flatten: true,
src: ['dist/css/admin/*.css'],
dest: 'www/admin/css/'
}
]
}
},

sass: {
options: {
unixNewlines: true
},

dev: {
files: [
{
expand: true,
cwd: 'assets/sass',
src: '**/[!_]*.scss',
dest: 'dist/css',
ext: '.css'
}
]
},
dist: {
options: {
style: 'compressed',
},
files: [
{
expand: true,
cwd: 'assets/sass',
src: '**/[!_]*.scss',
dest: 'dist/css',
ext: '.css'
}
]
}
},

cssjoin: {
options: {
paths : ["assets/", "vendor/"]
},
admin: {
files: {
'dist/css/admin/admin.css': ['dist/css/admin/admin.css'],
'dist/css/admin/codemirror.css': ['dist/css/admin/codemirror.css']
}
}
},

concat: {
options: {
banner: '<%= banner %>',
stripBanners: true
},
dev: {
files: [
{
'dist/js/admin.js' : [
'vendor/jquery/dist/jquery.js',
'vendor/colpick-jQuery-Color-Picker/js/colpick.js',
'assets/js/_frontend.js',
'assets/js/admin/**/_*.js'
],
'dist/js/codemirror.js' : [
'vendor/codemirror/lib/codemirror.js',

'vendor/codemirror/mode/css/css.js',
'vendor/codemirror/mode/javascript/javascript.js',
'vendor/codemirror/mode/xml/xml.js',
'vendor/codemirror/mode/htmlmixed/htmlmixed.js',

'vendor/codemirror/addon/display/fullscreen.js'
]
}
]
}
},

uglify: {
options: {
banner: '<%= banner %>',
compress: true,
mangle: true,
sourceMap: false
},

dist: {
files: [
{
expand: true,
cwd: 'dist/js',
src: '**/[!_]*.js',
dest: 'dist/js',
ext: '.js'
}
]
}
},

jshint: {
options: {
curly: true,
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
undef: true,
unused: true,
boss: true,
eqnull: true,
globals: {
jQuery: true
}
},
gruntfile: {
src: 'Gruntfile.js'
},
lib_test: {
//~ JS won't pass at the moment
//~ src: ['assets/js/**/[!_]*.js', 'test/**/*.js']
}
},
nodeunit: {
//~ No tests at the moment
//~ files: ['test/**/*_test.js']
},

watch: {
sass: {
files: ['assets/sass/**/*.scss'],
tasks: ['sass:dev', 'cssjoin']
},
js: {
files: ['assets/js/**/_*.js'],
tasks: ['concat']
},
gruntfile: {
files: '<%= jshint.gruntfile.src %>',
tasks: ['jshint:gruntfile']
},
//~ lib_test: {
//~ files: '<%= jshint.lib_test.src %>',
//~ tasks: ['jshint:lib_test', 'nodeunit']
//~ },
copy: {
options: {
livereload: true
},
files: ['dist/**/*'],
tasks: ['newer:copy']
}
}
});

// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-nodeunit');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-newer');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-bower-task');
grunt.loadNpmTasks('grunt-cssjoin');

// Default task.
grunt.registerTask('default', ['sass:dev', 'cssjoin', 'jshint', 'concat', 'copy']);
grunt.registerTask('build', ['bower:install', 'sass:dist', 'jshint', 'concat', 'uglify:dist', 'copy']);
};
File renamed without changes.
119 changes: 119 additions & 0 deletions assets/js/admin/_admin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
//--------------------------------
// START - Document Ready Functions
//--------------------------------
$().ready(function(){

//~ Remove No Script CSS
$("head > link#noscriptcss").remove();

//~ Image Checkboxes
$("input[type='checkbox']:enabled").prev("img.checkbox").each(function(){
colorcb($(this), false, "checkbox");
;});
$("input[type='checkbox']:enabled").prev("img.checkbox").hover(function(){
colorcb($(this), true, "checkbox");
}, function(){
colorcb($(this), false, "checkbox");
});
$("input[type='checkbox']:enabled").prev("img.checkbox").click(function(){
var checkbox = $(this).next("input[type='checkbox']:enabled");
checkbox.trigger('click');
$(this).trigger('mouseenter');
});
$("img.checkbox+input[type='checkbox']:enabled").change(function(){
colorcb($(this).prev("img.checkbox"), false, "checkbox");
;});

//~ Image Radios
$("input[type='radio']:enabled").prev("img.checkbox").each(function(){
colorcb($(this), false, "radio");
;});
$("input[type='radio']:enabled").prev("img.checkbox").hover(function(){
colorcb ($(this), true, "radio");
}, function(){
colorcb($(this), false, "radio");
});
$("input[type='radio']:enabled").prev("img.checkbox").click(function(){
var checkbox = $(this).next("input[type='radio']:enabled");
checkbox.trigger('click');
$(this).trigger('mouseenter');
});
$("img.checkbox+input[type='radio']:enabled").change(function(){
$("input[type='radio'][name='"+$(this).attr("name")+"']:enabled").prev("img.checkbox").each(function(index, img){
colorcb($(img), false, "radio");
;});
;});
});
//--------------------------------
// END - Document Ready Functions
//--------------------------------


//--------------------------------
// START - Functions
//--------------------------------

//~ Image Checkboxes
function colorcb (cb, hover, type) {
var checkbox = cb.next("input[type='"+type+"']:enabled");

if (checkbox.hasClass("cb-red")) {
var color = "red";
} else {
var color = "green";
}

if (checkbox.is(":checked")) {
if (hover) {
cb.attr("src", "?images="+type+"-"+color+"-active-hover.png");
} else {
cb.attr("src", "?images="+type+"-"+color+"-active.png");
}

if (type == "radio") {
cb.attr("alt", "(x)");
} else {
cb.attr("alt", "[x]");
}
} else {
if (hover) {
cb.attr("src", "?images="+type+"-"+color+"-hover.png");
} else {
cb.attr("src", "?images="+type+".png");
}

if (type == "radio") {
cb.attr("alt", "(_)");
} else {
cb.attr("alt", "[_]");
}
}
}

//~ (De-)Select Checkboxes of paragraph
function permselect (obj, checked) {
obj.parents("p:first").find("input[type=checkbox]:enabled").each(function (index, ele) {
$(ele).prop("checked", checked);
$(ele).change();
});
}

//~ (De-)Select Checkboxes of generic parent
function groupselect (parentstr, checked) {
var par = $(parentstr).find("input[type=checkbox]:enabled");
if (checked == "invert") {
par.each(function (index, ele) {
$(ele).prop("checked", !$(ele).prop("checked"));
$(ele).change();
});
} else {
par.each(function (index, ele) {
$(ele).prop("checked", checked);
$(ele).change();
});
}
}

//--------------------------------
// END - Functions
//--------------------------------
Loading

0 comments on commit d5d5899

Please sign in to comment.