Skip to content

Commit

Permalink
Merge pull request #1 from SU-SOE/7.x-1.x-megamenu
Browse files Browse the repository at this point in the history
7.x 1.x megamenu
  • Loading branch information
boznik authored May 1, 2017
2 parents 91843f3 + aee5d59 commit 307979a
Show file tree
Hide file tree
Showing 17 changed files with 332 additions and 15 deletions.
134 changes: 134 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@

engines:
# https://docs.codeclimate.com/docs/eslint
# ES Linting requires an .eslintrc file to tweak checks.
eslint:
enabled: false
csslint:
enabled: true
checks:
overqualified-elements:
enabled: false
# We don't lint our coffee. Eew.
coffeelint:
enabled: false
# SCSS Lint requires a .scss-lint.yml file in the repo in order to tweak settings.
# Withouth the .scss-lint.yml file it will run with the defaults.
# Defaults file: https://github.com/brigade/scss-lint/blob/master/config/default.yml
scss-lint:
enabled: true
checks:
IdSelector:
enabled: false
ColorVariable:
enabled: false
PropertySortOrder:
enabled: false
SelectorDepth:
enabled: false
QualifyingElement:
enabled: false
VendorPrefix:
enabled: false
LeadingZero:
enabled: false
phpcodesniffer:
enabled: true
checks:
Drupal Commenting FunctionComment TypeHintMissing:
enabled: false
Drupal Commenting FunctionComment IncorrectTypeHint:
enabled: false
DrupalPractice Commenting CommentEmptyLine SpacingAfter:
enabled: false
Drupal NamingConventions ValidFunctionName ScopeNotCamelCaps:
enabled: false
Drupal NamingConventions ValidClassName StartWithCaptial:
enabled: false
Drupal NamingConventions ValidFunctionName NotCamelCaps:
enabled: false
DrupalPractice General ClassName ClassPrefix:
enabled: false
Drupal NamingConventions ValidClassName NoUnderscores:
enabled: false
config:
file_extensions: "php,inc,install,module,profile"
standard: "Drupal,DrupalPractice"
phpmd:
enabled: true
checks:
Design/WeightedMethodCount:
enabled: false
CleanCode/StaticAccess:
enabled: false
CleanCode/ElseExpression:
enabled: false
CleanCode/BooleanArgumentFlag:
enabled: false
UnusedFormalParameter:
enabled: false
config:
# https://phpmd.org/rules/index.html
# The following sets include everything except the controversial set.
# We can configure these further through .xml files. See docs.
rulesets: "cleancode,codesize,design,naming,unusedcode"
# Include special Drupal file extensions.
file_extensions: "inc,module,profile,php,install"
# https://docs.codeclimate.com/docs/phan
phan:
enabled: true
config:
file_extensions: "php,module,profile,inc"
# minimum-severity: 1
ignore-undeclared: true
# quick: true
# backward-compatiility-checks: true
# dead-code-detection: true
# https://docs.codeclimate.com/docs/duplication
duplication:
enabled: true
# exclude_paths:
# - examples/
config:
languages:
javascript:
mass_threshold: 50
# count_threshold: 3
php:
mass_threshold: 60
fixme:
enabled: true
config:
strings:
- FIXME
- BUG
- TODO
- todo
- dpm
- dsm
ratings:
paths:
- "**.inc"
- "**.module"
- "**.profile"
- "**.php"
- "**.install"
- "**.scss"
- "**.sass"
- "**.js"
# exclude these files/paths
exclude_paths:
- "**.features.**"
- "**.views_default.inc"
- "**.field_group.inc"
- "**.ds.inc"
- "**.bean.inc"
- "**.context.inc"
- "test/**/*"
- "**/vendor/**/*"
- "**.min.*"
- "tests/"
- "spec/"
- "**/vendor/"
- "**.api.php"
- "*.twig"
32 changes: 32 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Numerous always-ignore extensions
*.diff
*.err
*.orig
*.log
*.rej
*.swo
*.swp
*.vi
*~

# OS or Editor folders
.DS_Store
.cache
.idea
.sass-cache
.project
.settings
.tmproj
nbproject
Thumbs.db
config.rb
*.scssc
*.sassc
*.map

# Folders to ignore
.hg
.svn
.CVS
cgi-bin
node_modules
26 changes: 26 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
options: {
lineNumbers: false,
sourcemap: 'none',
},
dist: {
files: {
'css/soe_regions.css': 'scss/soe_regions.scss'
}
}
},
watch: {
css: {
files: '**/*.scss',
tasks: ['sass']
}
}
});
grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['watch']);
}
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ Install this module like any other module. [See Drupal Documentation](https://dr
Configuration
---

Developer
---

If you wish to develop on this module you will most likely need to compile some new css. Please use the sass structure provided and compile with the sass compiler packaged in this module. To install:

```
npm install
grunt watch
or
grunt devmode
```

Troubleshooting
---

Expand Down
16 changes: 16 additions & 0 deletions css/soe_regions.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#digital-magazine-megamenu {
z-index: 9999; }

#digital-magazine-megamenu .container {
position: absolute;
z-index: 9999;
display: flex;
align-items: center;
justify-content: center;
padding: 0;
margin-left: auto;
margin-right: auto;
background-color: #9ca4ab; }

.region-digital-magazine-megamenu {
width: 1170px; }
4 changes: 0 additions & 4 deletions css/stanford_soe_regions.css

This file was deleted.

Empty file removed css/stanford_soe_regions.scss
Empty file.
File renamed without changes.
14 changes: 14 additions & 0 deletions js/stanford_soe_regions_megamenu.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
(function ($) {
$(document).ready(function(){
//Do Stuff...
var megamenu = $('#digital-magazine-megamenu .container');
$(megamenu).css('display', 'none');
var topics = $('.menu-name-menu-magazine ul a').first();
$(topics).click(function(e) {
e.preventDefault();
$(megamenu).slideToggle( "slow", function() {
// Animation complete.
});
});
});
})(jQuery);
25 changes: 25 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "stanford_soe_regions",
"description": "SCSS for School of Engineering custom regions.",
"author": "",
"version": "1.0.0",
"homepage": "https://github.com/SU-SOE/stanford_soe_regions#readme",
"license": "MIT",
"keywords": [
"css",
"scss"
],
"repository": {
"type": "git",
"url": "git+https://github.com/SU-SOE/stanford_soe_regions.git"
},
"bugs": {
"url": "https://github.com/SU-SOE/stanford_soe_regions/issues"
},
"devDependencies": {
"grunt": "^1.0.1",
"grunt-contrib-sass": "^1.0.0",
"grunt-contrib-watch": "^1.0.0",
"grunt-sass": "^2.0.0"
}
}
8 changes: 8 additions & 0 deletions scss/components/_soe_components.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@charset "UTF-8";

////
/// ROLL UP
///

@import
'soe_dm_megamenu'
17 changes: 17 additions & 0 deletions scss/components/_soe_dm_megamenu.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#digital-magazine-megamenu {
z-index: 9999;
}
#digital-magazine-megamenu .container {
position: absolute;
z-index: 9999;
display: flex;
align-items: center;
justify-content: center;
padding: 0;
margin-left: auto;
margin-right: auto;
background-color: $mm-background;
}
.region-digital-magazine-megamenu {
width: 1170px;
}
5 changes: 5 additions & 0 deletions scss/soe_regions.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@charset "UTF-8";

@import
'variables/soe_regions_variables',
'components/soe_components'
3 changes: 3 additions & 0 deletions scss/variables/_soe_dm_megamenu_colors.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@charset "UTF-8";

$mm-background: #9ca4ab;
8 changes: 8 additions & 0 deletions scss/variables/_soe_regions_variables.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@charset "UTF-8";

////
/// ROLL UP
///

@import
'soe_dm_megamenu_colors'
Loading

0 comments on commit 307979a

Please sign in to comment.