Skip to content

Commit

Permalink
add Gruntfile with tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickheck committed Mar 23, 2014
1 parent 3b92746 commit fc8a15c
Show file tree
Hide file tree
Showing 4 changed files with 151 additions and 13 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
nohup.out
*.log
node_modules
build

# Windows image file caches
Thumbs.db
Expand Down Expand Up @@ -52,4 +54,4 @@ Icon

# Dreamweaver Files
_notes
dwsync.xml
dwsync.xml
88 changes: 88 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
module.exports = function(grunt) {

// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
files: ["./css/ssp_c5.css","js/socialshareprivacy/socialshareprivacy/socialshareprivacy.css"],
tasks: ["combine"]
},
clean: ["./build/"],
compress: {
main: {
options: {
archive: 'build/social_share_privacy_<%= pkg.version %>.zip'
},
files: [
{cwd: "build",
src: ['./**'],
dest: 'social_share_privacy/'}, // includes files in path and its subdirs
]
}
},
copy: {
build: {
files: [
{
src: [ 'blocks/**',"controllers/**", "controller.php","css/ssp_combined.css","elements/**","helpers/**", "icon.png", "languages/**", "libraries/**" , "LICENSE.TXT", "single_pages/**"],
dest: 'build',
expand: true
},
{
cwd: "js/socialshareprivacy",
src: [
"jquery.socialshareprivacy.min.js",
"jquery.socialshareprivacy.js",
"socialshareprivacy/*",
"socialshareprivacy/images/*.png"
],
dest: 'build/js/socialshareprivacy',
expand: true
}
]
},
},
concat: {
options: {
separator: ''
},
dist: {
src: ['css/ssp_c5.css', 'js/socialshareprivacy/socialshareprivacy/socialshareprivacy.css'],
dest: 'css/ssp_combined.css'
}
},
// adjust image paths
sed: {
imgpaths: {
path:"css/ssp_combined.css",
pattern: "(url\\s*(\\s*['\"]\?\)\\s*\([^/]))",
replacement: '$1../js/socialshareprivacy/socialshareprivacy/$2',
recursive: false
}
},
po2mo: {
files: {
src: 'languages/**/*.po',
expand: true,
},
},
});

// Load the plugin that provides the "uglify" task.
// grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-compress');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-sed');
grunt.loadNpmTasks('grunt-po2mo');

// Default task(s).
grunt.registerTask('default', ['watch']);
grunt.registerTask('combine', ['concat','sed']);
grunt.registerTask('zip', ['clean',"copy","compress"]);
grunt.registerTask('build', ['po2mo','combine']);
grunt.registerTask('deploy', ['build','zip']);

};
24 changes: 12 additions & 12 deletions css/ssp_combined.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
.social_share_privacy_area {
/* Concrete5 specific additions */

/* prevent "i" button from floating above everything when in edit mode */
.social-share-privacy.editmode .social_share_privacy_area li.settings_info .settings_info_menu {
z-index:0 !important;
}
/* adjust z-indexes for the "i" and popup help elements in order to not float above the top edit bar
it should be below 100 to not interface with c5 elements */
.social_share_privacy_area li.settings_info .settings_info_menu, .social_share_privacy_area li.help_info .info, .social_share_privacy_area li .help_info.icon .info {
z-index:3 !important;
}.social_share_privacy_area {
clear: both;
margin: 20px 0 !important;
list-style-type: none;
Expand Down Expand Up @@ -285,14 +295,4 @@
.social_share_privacy_area li.settings_info .settings_info_menu form fieldset label.checked {
color: #090;
}
/* Settings/Info end *//* Concrete5 specific additions */

/* prevent "i" button from floating above everything when in edit mode */
.social-share-privacy.editmode .social_share_privacy_area li.settings_info .settings_info_menu {
z-index:0 !important;
}
/* adjust z-indexes for the "i" and popup help elements in order to not float above the top edit bar
it should be below 100 to not interface with c5 elements */
.social_share_privacy_area li.settings_info .settings_info_menu, .social_share_privacy_area li.help_info .info, .social_share_privacy_area li .help_info.icon .info {
z-index:3 !important;
}
/* Settings/Info end */
48 changes: 48 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"name": "addon_socialshareprivacy",
"version": "1.3.0",
"description": "Concrete5 Addon Social Share Privacy",
"main": "controller.php",
"directories": {
"test": "tests"
},
"dependencies": {
"grunt-contrib-clean": "~0.5.0"
},
"devDependencies": {
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-copy": "~0.5.0",
"grunt-contrib-watch": "~0.6.1",
"grunt-contrib-compress": "~0.7.0",
"grunt-bump": "0.0.13",
"grunt": "~0.4.4",
"grunt-css-url-rewrite": "~0.3.3",
"grunt-sed": "~0.1.1",
"grunt-po2mo": "~0.1.0"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git://github.com/patrickheck/addon_socialshareprivacy.git"
},
"keywords": [
"social",
"sharing",
"privacy",
"twitter",
"google",
"g+",
"googleplus",
"plus",
"facebook",
"like",
"recommend",
"share"
],
"author": "Patrick Heck",
"license": "MIT",
"readmeFilename": "README.md"
}

0 comments on commit fc8a15c

Please sign in to comment.