Skip to content

Commit

Permalink
Grunt and bower works.
Browse files Browse the repository at this point in the history
The site run from dest.
Add config.js
  • Loading branch information
ArnonEilat committed Jun 7, 2014
1 parent 9ccb87d commit 2497fcf
Show file tree
Hide file tree
Showing 76 changed files with 3,496 additions and 317 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ update/repositories/
update/node_modules/
doc/
node_modules/
npm-debug.log

# ignore backups
*~
Expand Down
200 changes: 114 additions & 86 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,68 +1,57 @@
module.exports = function (grunt) {

// Project configuration.
module.exports = function(grunt) {
"use strict";
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
copy: {
main: {
files: [{
expand: true,
flatten: true,
src: ['src/css/Alef-Webfont/*'],
dest: 'dest/css/Alef-Webfont'
}, {
expand: true,
cwd: 'src',
src: ['css/font-awesome-4.0.3/**'],
dest: 'dest/'
}, {
expand: true,
cwd: 'src',
src: ['css/favicon.ico'],
dest: 'dest/'
},

{
expand: true,
cwd: 'src',
src: ['index.html'],
dest: 'dest/'
}, {
expand: true,
cwd: 'src',
src: ['all-issues/**'],
dest: 'dest/'
}, {
expand: true,
cwd: 'src',
src: ['main-page/**'],
dest: 'dest/'
}, {
expand: true,
cwd: 'src',
src: ['visualizations/**'],
dest: 'dest/'
}, {
expand: true,
cwd: 'src',
src: ['templates/**'],
dest: 'dest/'
}, {
expand: true,
cwd: 'src',
src: ['data/**'],
dest: 'dest/'
}
]
expand: true,
flatten: true,
src: ['src/css/Alef-Webfont/*'],
dest: 'dest/css/Alef-Webfont'
}, {
expand: true,
cwd: 'src',
src: ['css/font-awesome-4.0.3/**'],
dest: 'dest/'
}, {
expand: true,
cwd: 'src',
src: ['css/favicon.ico*'],
dest: 'dest/'
}, {
expand: true,
cwd: 'src',
src: ['all-issues/**'],
dest: 'dest/'
}, {
expand: true,
cwd: 'src',
src: ['main-page/**'],
dest: 'dest/'
}, {
expand: true,
cwd: 'src',
src: ['visualizations/**'],
dest: 'dest/'
}, {
expand: true,
cwd: 'src',
src: ['templates/**'],
dest: 'dest/'
}, {
expand: true,
cwd: 'src',
src: ['data/**'],
dest: 'dest/'
}]
}
},


uglify: {
uglify: { // uglify all the js - from src to dest
target: {
options: {
mangle: false,
dead_code: true,
dead_code: false,
compress: {
drop_console: true
}
Expand All @@ -75,63 +64,102 @@ module.exports = function (grunt) {
}]
}
},



cssmin: {
combine: {
files: {
'dest/css/style.css': [
"src/css/filesPiChart.css", "src/css/headerStyle.css", "src/css/index.css", "src/css/reset.css", "src/css/style.css"
]
'dest/css/style.css': ["src/css/filesPiChart.css", "src/css/headerStyle.css", "src/css/index.css", "src/css/reset.css", "src/css/style.css"]
},
keepSpecialComments: "0"
}

},
bowerInstall: {
dom_munger: { // Remove all script link tags from src/index.html and copy it to root folder.
removeScriptsAndLink: {
options: {
remove: 'script,link'
},
src: 'src/index.html',
dest: 'index.html'
},
addFavIcon: { // Add favIcon
options: {
append: {
selector: 'head',
html: '<link rel="shortcut icon" href="dest/css/favicon.ico">'
},
},
src: 'index.html',
dest: 'index.html'
}
},
bowerInstall: { // Add bower depts to index.html
target: {
src: 'src/index.html' // point to your HTML file.
src: 'index.html'
}
},

link_html: {
your_target: {
// Target-specific file lists and/or options go here.
jsFiles: [],
cssFiles: ['style.css'],
targetHtml: ['dest/index.html'],
tags: { // Inject the minifyed JavaScript and css to index.html
injectJavaScript: {
src: ['dest/eKnightsData.js', 'dest/small_repos.js', 'dest/config.js', 'dest/hebUtill.js', 'dest/commentsHandler.js', 'dest/filters.js', 'dest/arrayUtill.js', 'dest/issuesLoader.js', 'dest/main.js', 'dest/visualizations/piVisualization/pieChartService.js', 'dest/visualizations/piVisualization/ghPiVisualization.js', 'dest/visualizations/piVisualization/piChartCtrl.js', 'dest/all-issues/allIssuesCtrl.js', 'dest/eKnight.js', 'update/Repository.js', 'dest/main-page/index.js'],
options: {
scriptTemplate: '<script src="{{ path }}"></script>',
openTag: '<!-- start template js -->',
closeTag: '<!-- end template js -->'
},
dest: 'index.html'
},
injectCss: {
src: ['dest/css/style.css', 'dest/css/Alef-Webfont/stylesheet.css', 'dest/css/font-awesome-4.0.3/css/font-awesome.min.css'],
options: {
cwd: '.'
linkTemplate: '<link rel="stylesheet" type="text/css" href="{{ path }}"/>',
openTag: '<!-- start template css -->',
closeTag: '<!-- end template css -->'
},
dest: 'index.html'
}
},
'file-creator': { // Create config file
"basic": {
"dest/config.js": function(fs, fd, done) {
fs.writeSync(fd, 'var CONFIG = {PATH: "dest/",relativizePath: function(oldPath) {return CONFIG.PATH + oldPath;}};');
done();
}
}
},
lineremover: { // Remove empty lines
noOptions: {
files: {
'index.html': 'index.html'
}
}
},
prettify: { // Prettify index.html
one: {
src: 'index.html',
dest: 'index.html'
}
},
jsdoc: {
dist: {
src: ['src/*.js', 'test/*.js'],
recurse: true,
src: ['src/*', 'test/*.js'],
options: {
destination: 'doc'
destination: 'doc',
recurse: true
}
}
}
});

// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-uglify');

grunt.loadNpmTasks('grunt-jsdoc');

grunt.loadNpmTasks('grunt-bower-install');

grunt.loadNpmTasks('grunt-contrib-cssmin');

grunt.loadNpmTasks('grunt-link-html');

grunt.loadNpmTasks('grunt-contrib-copy');

grunt.loadNpmTasks('grunt-script-link-tags');
grunt.loadNpmTasks('grunt-dom-munger');
grunt.loadNpmTasks('grunt-file-creator');
grunt.loadNpmTasks('grunt-line-remover');
grunt.loadNpmTasks('grunt-prettify');
grunt.registerTask('init', 'Compiles all of the assets and copies the files to the build directory.\n' + 'Generating documentation in from the source code comments.', ['copy', 'uglify', 'jsdoc', 'dom_munger', 'bowerInstall', 'cssmin', 'tags', 'file-creator', 'lineremover', 'prettify']);
// Default task(s).
grunt.registerTask('default', ['copy','uglify', 'jsdoc', 'bowerInstall', 'cssmin', 'link_html']);


grunt.registerTask('default', 'Compiles all of the assets and copies the files to the build directory.', ['copy', 'uglify', 'dom_munger', 'bowerInstall', 'cssmin', 'tags', 'file-creator', 'lineremover', 'prettify']);
grunt.registerTask('doc', 'Generating documentation in from the source code comments.', ['jsdoc']);
};
1 change: 1 addition & 0 deletions dest/all-issues/allIssuesCtrl.js

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

11 changes: 11 additions & 0 deletions dest/all-issues/header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

<header class="app-header all-issues-header">
<div class="app-header-title">
<h1>הסדנא לידע ציבורי</h1>
<h2>רוצים לעזור קצת?</h2>
<p>
המשימות מחולקות לפי נושאים:</p>
<p>
אפשר לסנן משימות לפי תגיות. לדוגמה: לחיצה על&nbsp;Starter תראה רק משימות שמתאימות למתחילים.&nbsp;</p>
</div>
</header>
87 changes: 87 additions & 0 deletions dest/all-issues/list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@


<div ng-include="relativizePath('all-issues/header.html')"></div>

<div class="refinement-panel" data-ui-scrollfix="+297">

<input type="text" ng-model="search" class="search-input" placeholder="Search">

<label><input type="checkbox" checked ng-change="updateState()" ng-model="stateControls.showIssuesWithComments">Show issues with comments</label>
<label><input type="checkbox" checked ng-change="updateState()" ng-model="stateControls.showIssuesWithOutComments">Show issues without comments</label>

<h4 class="text-center">Labels</h4>
<ul>
<li class="tag-item"
ng-click="setSelectedLabels()"
ng-repeat="lbl in labels| orderBy:'name'"
style ="background-color: #{{lbl.color}};">
<i class="fa" ng-class="isChecked(lbl.name)"></i>
<span class="badge pull-right">{{lbl.amount}}</span>
{{lbl.name}}
</li>
</ul>
</div>



<div class="issue"
ng-repeat="issue in filtered = (issues| githubTagsFilter:selectedLabels| checkboxesFilter:stateControls | filter:search) | orderBy:'created_at':true
track by $index">

<div class="authorPlaceholder"
style="background-image: url({{issue.user.avatar_url}});"
title="Opened by {{issue.user.login}}">
</div>
<div class="assigneePlaceholder"
style="background-image: url({{issue.assignee.avatar_url}});"
title="Assigned to {{issue.assignee.login|| 'no one yet'}}">
</div>
<span class="issue-title">
{{issue.title}}
<span class="issue-title-comments" ng-if="issue.comments != 0" data-ng-click="loadComments($event, issue)">
<i class="fa fa-comments-o"></i> {{issue.comments}} comments
</span>

<a href="{{issue.html_url}}" class="issue-title-github-link" target="_blank" title="View on github"><i class="fa fa-github-alt"></i>
</a>

<a ng-if="issue.eKnightSlug != false" href="#/{{issue.eKnightSlug}}" title="הדף של {{issue.repoName}} " class="issue-title-repoName">{{issue.repoName}}</a>
<span ng-if="issue.eKnightSlug == false" class="issue-title-repoName">{{issue.repoName}}</span>
</span>
<span class="label-warp">
<span class="label"
style="background-color: #{{label.color}}"
ng-repeat="label in issue.labels">
{{label.name}}
</span>
</span>
<span class="like-a-pre issue-body"
ng-class="{issueBodyOpen:issue.textLimit != 30}"
ng-bind-html="issue.body|highlight:search | limitTo:issue.textLimit|trust"></span>
<span ng-if="issue.textLimit == 30 && issue.body.trim().length < 0">...</span>
<a class="read-more"
ng-if="issue.textLimit == 30 && issue.body.trim().length > 0"
ng-click="readMore($event, issue)">read more</a>


<span class="issue-title-time"
title="Created at {{issue.israelFormatCreated_at}}">about {{issue.timeSince}} ago</span>

<div class="clearfix"></div>

<div class="bubble-container" ng-repeat="comment in issue.comments_list|orderBy:'created_at'">
<div class="authorPlaceholder bubble-avatar"
style="background-image: url({{comment.user.avatar_url}});"
title="Commented by {{comment.user.login}}"></div>

<div class="bubble">
<span class="bubble-title">
<a class="author" href="{{comment.user.html_url}}">{{comment.user.login}}</a> commented {{comment.timeSince}} ago.

<a href="{{comment.html_url}}" class="bubble-title-github" target="_blank" title="View on github">
<i class="fa fa-github-alt"></i></a>
</span>
<span class="bubble-box like-a-pre">{{comment.body}}</span>
</div>
</div>
</div>
1 change: 1 addition & 0 deletions dest/appConfig.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var CONFIG={PATH:"dest/"};
1 change: 1 addition & 0 deletions dest/arrayUtill.js

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

1 change: 1 addition & 0 deletions dest/commentsHandler.js

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

1 change: 1 addition & 0 deletions dest/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var CONFIG = {PATH: "dest/",relativizePath: function(oldPath) {return CONFIG.PATH + oldPath;}};
Binary file added dest/css/Alef-Webfont/Alef-Bold.eot
Binary file not shown.
Loading

0 comments on commit 2497fcf

Please sign in to comment.