This repository has been archived by the owner on Jan 25, 2021. It is now read-only.
forked from vufind-org/vufind
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1,483 changed files
with
147,892 additions
and
22,144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
module.exports = { | ||
extends: "eslint:recommended", | ||
env: { "browser": true }, | ||
globals: { | ||
"$": false, | ||
"jQuery": false | ||
}, | ||
rules: { | ||
// errors | ||
"block-scoped-var": "error", | ||
"func-names": "error", | ||
"no-loop-func": "error", | ||
"no-param-reassign": "error", | ||
"no-shadow": "error", | ||
"no-unused-expressions": "error", | ||
|
||
// warnings | ||
"dot-notation": "warn", | ||
"eqeqeq": ["warn", "smart"], | ||
"guard-for-in": "warn", | ||
"key-spacing": ["warn", { "beforeColon": false, "afterColon": true }], | ||
"no-lonely-if": "warn", | ||
"no-console": ["warn", { "allow": ["warn", "error"] }], | ||
"no-unneeded-ternary": "warn", | ||
|
||
// fixed automatically | ||
"block-spacing": ["warn", "always"], | ||
"comma-spacing": ["warn", { "before": false, "after": true }], | ||
"indent": ["error", 2], | ||
"keyword-spacing": ["warn", { "before": true, "after": true }], | ||
"linebreak-style": ["error", "unix"], | ||
"no-multi-spaces": "warn", | ||
"semi-spacing": ["warn", { "before": false, "after": true }], | ||
"space-infix-ops": "warn" | ||
} | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,6 @@ TAGS | |
*~ | ||
/vendor | ||
composer.lock | ||
composer.phar | ||
import/solrmarc.log | ||
export/nationalLicence | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,172 @@ | ||
module.exports = function(grunt) { | ||
require('jit-grunt')(grunt); // Just in time library loading | ||
|
||
var fs = require('fs'); | ||
|
||
function getLoadPaths(file) { | ||
var config; | ||
var parts = file.split('/'); | ||
parts.pop(); // eliminate filename | ||
|
||
// initialize search path with directory containing LESS file | ||
var retVal = []; | ||
retVal.push(parts.join('/')); | ||
|
||
// Iterate through theme.config.php files collecting parent themes in search path: | ||
while (config = fs.readFileSync("themes/" + parts[1] + "/theme.config.php", "UTF-8")) { | ||
var matches = config.match(/["']extends["']\s*=>\s*['"](\w+)['"]/); | ||
|
||
// "extends" set to "false" or missing entirely? We've hit the end of the line: | ||
if (matches === null || matches[1] === 'false') { | ||
break; | ||
} | ||
|
||
parts[1] = matches[1]; | ||
retVal.push(parts.join('/') + '/'); | ||
} | ||
return retVal; | ||
} | ||
|
||
var fontAwesomePath = '"../../bootstrap3/css/fonts"'; | ||
|
||
grunt.initConfig({ | ||
// LESS compilation | ||
less: { | ||
compile: { | ||
options: { | ||
paths: getLoadPaths, | ||
compress: true, | ||
modifyVars: { | ||
'fa-font-path': fontAwesomePath | ||
} | ||
}, | ||
files: [{ | ||
expand: true, | ||
src: "themes/*/less/compiled.less", | ||
rename: function (dest, src) { | ||
return src.replace('/less/', '/css/').replace('.less', '.css'); | ||
} | ||
}] | ||
} | ||
}, | ||
// SASS compilation | ||
scss: { | ||
sass: { | ||
options: { | ||
style: 'compress' | ||
} | ||
} | ||
}, | ||
// Convert LESS to SASS, mostly for development team use | ||
lessToSass: { | ||
convert: { | ||
files: [ | ||
{ | ||
expand: true, | ||
cwd: 'themes/bootstrap3/less', | ||
src: ['*.less', 'components/*.less'], | ||
ext: '.scss', | ||
dest: 'themes/bootstrap3/scss' | ||
}, | ||
{ | ||
expand: true, | ||
cwd: 'themes/bootprint3/less', | ||
src: ['*.less'], | ||
ext: '.scss', | ||
dest: 'themes/bootprint3/scss' | ||
} | ||
], | ||
options: { | ||
replacements: [ | ||
{ // Replace ; in include with , | ||
pattern: /(\s+)@include ([^\(]+)\(([^\)]+)\);/gi, | ||
replacement: function mixinCommas(match, space, $1, $2) { | ||
return space + '@include ' + $1 + '(' + $2.replace(/;/g, ',') + ');'; | ||
}, | ||
order: 3 | ||
}, | ||
{ // Inline &:extends converted | ||
pattern: /&:extend\(([^\)]+)\)/gi, | ||
replacement: '@extend $1', | ||
order: 3 | ||
}, | ||
{ // Inline variables not default | ||
pattern: / !default; }/gi, | ||
replacement: '; }', | ||
order: 3 | ||
}, | ||
{ // VuFind: Correct paths | ||
pattern: 'vendor/bootstrap/bootstrap', | ||
replacement: 'vendor/bootstrap', | ||
order: 4 | ||
}, | ||
{ | ||
pattern: '$fa-font-path: "../../../fonts" !default;\n', | ||
replacement: '', | ||
order: 4 | ||
}, | ||
{ | ||
pattern: '@import "vendor/font-awesome/font-awesome";', | ||
replacement: '$fa-font-path: ' + fontAwesomePath + ';\n@import "vendor/font-awesome/font-awesome";', | ||
order: 4 | ||
}, | ||
{ // VuFind: Bootprint fixes | ||
pattern: '@import "bootstrap";\n@import "variables";', | ||
replacement: '@import "variables", "bootstrap";', | ||
order: 4 | ||
}, | ||
{ | ||
pattern: '$brand-primary: #619144 !default;', | ||
replacement: '$brand-primary: #619144;', | ||
order: 4 | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
watch: { | ||
options: { | ||
atBegin: true | ||
}, | ||
less: { | ||
files: 'themes/*/less/**/*.less', | ||
tasks: ['less'] | ||
}, | ||
scss: { | ||
files: 'themes/*/scss/**/*.scss', | ||
tasks: ['scss'] | ||
} | ||
} | ||
}); | ||
grunt.registerMultiTask('scss', function sassScan() { | ||
var sassConfig = {}, | ||
path = require('path'), | ||
themeList = fs.readdirSync(path.resolve('themes')).filter(function (theme) { | ||
return fs.existsSync(path.resolve('themes/' + theme + '/scss/compiled.scss')); | ||
}); | ||
|
||
for (var i in themeList) { | ||
var config = { | ||
options: { | ||
outputStyle: 'compressed' | ||
}, | ||
files: [{ | ||
expand: true, | ||
cwd: path.join('themes', themeList[i], 'scss'), | ||
src: ['compiled.scss'], | ||
dest: path.join('themes', themeList[i], 'css'), | ||
ext: '.css' | ||
}] | ||
}; | ||
for (var key in this.data.options) { | ||
config.options[key] = this.data.options[key] + ''; | ||
} | ||
config.options.includePaths = getLoadPaths('themes/' + themeList[i] + '/scss/compiled.scss'); | ||
|
||
sassConfig[themeList[i]] = config; | ||
} | ||
|
||
grunt.config.set('sass', sassConfig); | ||
grunt.task.run('sass'); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.