-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Work in progress * Work in progress part 2 - refactoring names, adding snowfall lib * changes in styling - fixing issue with accept suite button being too high * Simplifying markup for status icons * Changed Christmas date - left wrong one after debugging * Updated changelog file * Moved winterEdition to new themes folder * Changed data-checking function name * Added jquery snowfall asset - no licence header yet * Added info about jQuery Snowfall licence
- Loading branch information
1 parent
48445b3
commit cc933bc
Showing
16 changed files
with
114 additions
and
53 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
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
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
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
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
61 changes: 61 additions & 0 deletions
61
report/src/main/webapp/app/themes/winterEdition.directive.js
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,61 @@ | ||
/* | ||
* AET | ||
* | ||
* Copyright (C) 2013 Cognifide Limited | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
define(['angularAMD'], function (angularAMD) { | ||
'use strict'; | ||
// custom prefix for custom directive 'aet' see: http://bit.ly/29U2YFf | ||
angularAMD.directive('aetWinterEdition', WinterEdition); | ||
|
||
function WinterEdition() { | ||
return { | ||
restrict: 'AE', | ||
link: linkFunc | ||
}; | ||
|
||
function linkFunc($scope) { | ||
var WINTER_THEME = { | ||
name: 'winter', | ||
statusClasses: { | ||
passed: 'fa-tree', | ||
failed: 'fa-gift', | ||
warning: 'fa-bell', | ||
rebased: 'fa-snowflake', | ||
unrebased: 'fa-eraser' | ||
} | ||
}; | ||
var TODAY = new Date(); | ||
var CHRISTMAS_DATE = new Date(TODAY.getFullYear(), 11, 25); | ||
var DAY_MARGIN = 14; | ||
var isChristmas = isDateWithinMargin(TODAY, CHRISTMAS_DATE, DAY_MARGIN); | ||
|
||
if (isChristmas) { | ||
_.merge($scope.theme, WINTER_THEME); | ||
snowFall.snow(document.body, {flakeCount: 200, maxSpeed: 20}); | ||
} | ||
} | ||
|
||
function isDateWithinMargin(today, eventDate, dayMargin) { | ||
var eventStartDate = new Date(eventDate); | ||
var eventEndDate = new Date(eventDate); | ||
|
||
eventStartDate.setDate(eventStartDate.getDate()-dayMargin); | ||
eventEndDate.setDate(eventEndDate.getDate()+dayMargin); | ||
|
||
return today >= eventStartDate && today <= eventEndDate; | ||
} | ||
} | ||
}); |
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
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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