OneBot: Leantime 改造版源码(BOM/Univer 表格/AI 接管/品牌替换等)

This commit is contained in:
wangruiguo
2026-09-03 18:49:20 +08:00
commit d647428529
3501 changed files with 1988906 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
/**
* Bootstrap.js by @mdo and @fat, extended by @ArnoldDaniels.
* plugins: bootstrap-fileupload.js
* Copyright 2012 Twitter, Inc.
* http://www.apache.org/licenses/LICENSE-2.0.txt
*/
!function(e){var t=function(t,n){this.$element=e(t),this.type=this.$element.data("uploadtype")||(this.$element.find(".thumbnail").length>0?"image":"file"),this.$input=this.$element.find(":file");if(this.$input.length===0)return;this.name=this.$input.attr("name")||n.name,this.$hidden=this.$element.find('input[type=hidden][name="'+this.name+'"]'),this.$hidden.length===0&&(this.$hidden=e('<input type="hidden" />'),this.$element.prepend(this.$hidden)),this.$preview=this.$element.find(".fileupload-preview");var r=this.$preview.css("height");this.$preview.css("display")!="inline"&&r!="0px"&&r!="none"&&this.$preview.css("line-height",r),this.original={exists:this.$element.hasClass("fileupload-exists"),preview:this.$preview.html(),hiddenVal:this.$hidden.val()},this.$remove=this.$element.find('[data-dismiss="fileupload"]'),this.$element.find('[data-trigger="fileupload"]').on("click.fileupload",e.proxy(this.trigger,this)),this.listen()};t.prototype={listen:function(){this.$input.on("change.fileupload",e.proxy(this.change,this)),e(this.$input[0].form).on("reset.fileupload",e.proxy(this.reset,this)),this.$remove&&this.$remove.on("click.fileupload",e.proxy(this.clear,this))},change:function(e,t){if(t==="clear")return;var n=e.target.files!==undefined?e.target.files[0]:e.target.value?{name:e.target.value.replace(/^.+\\/,"")}:null;if(!n){this.clear();return}this.$hidden.val(""),this.$hidden.attr("name",""),this.$input.attr("name",this.name);if(this.type==="image"&&this.$preview.length>0&&(typeof n.type!="undefined"?n.type.match("image.*"):n.name.match("\\.(gif|png|jpe?g)$"))&&typeof FileReader!="undefined"){var r=new FileReader,i=this.$preview,s=this.$element;r.onload=function(e){i.html('<img src="'+e.target.result+'" '+(i.css("max-height")!="none"?'style="max-height: '+i.css("max-height")+';"':"")+" />"),s.addClass("fileupload-exists").removeClass("fileupload-new")},r.readAsDataURL(n)}else this.$preview.text(n.name),this.$element.addClass("fileupload-exists").removeClass("fileupload-new")},clear:function(e){this.$hidden.val(""),this.$hidden.attr("name",this.name),this.$input.attr("name","");if(navigator.userAgent.match(/msie/i)){var t=this.$input.clone(!0);this.$input.after(t),this.$input.remove(),this.$input=t}else this.$input.val("");this.$preview.html(""),this.$element.addClass("fileupload-new").removeClass("fileupload-exists"),e&&(this.$input.trigger("change",["clear"]),e.preventDefault())},reset:function(e){this.clear(),this.$hidden.val(this.original.hiddenVal),this.$preview.html(this.original.preview),this.original.exists?this.$element.addClass("fileupload-exists").removeClass("fileupload-new"):this.$element.addClass("fileupload-new").removeClass("fileupload-exists")},trigger:function(e){this.$input.trigger("click"),e.preventDefault()}},e.fn.fileupload=function(n){return this.each(function(){var r=e(this),i=r.data("fileupload");i||r.data("fileupload",i=new t(this,n)),typeof n=="string"&&i[n]()})},e.fn.fileupload.Constructor=t,e(document).on("click.fileupload.data-api",'[data-provides="fileupload"]',function(t){var n=e(this);if(n.data("fileupload"))return;n.fileupload(n.data());var r=e(t.target).closest('[data-dismiss="fileupload"],[data-trigger="fileupload"]');r.length>0&&(r.trigger("click.fileupload"),t.preventDefault())})}(window.jQuery)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,12 @@
For more awesome web design code & scripts visit now:
https://www.codehim.com
I just need your one minute, please follow CodeHim.
Follow on Twitter: https://twitter.com/CodeHimOfficial
Follow on Pinterest: https://www.pinterest.com/codehim/
Regards
Asif Mughal.

View File

@@ -0,0 +1,169 @@
//-----------Var Inits--------------
var confetti = (function () {
let canvas = '';
let ctx = '';
let cx = '';
let cy = '';
let confetti = [];
const confettiCount = 50;
const gravity = 1.2;
const terminalVelocity = 5;
const drag = 0.075;
const colors = [
{front: 'red', back: 'darkred'},
{front: 'green', back: 'darkgreen'},
{front: 'blue', back: 'darkblue'},
{front: 'yellow', back: 'darkyellow'},
{front: 'orange', back: 'darkorange'},
{front: 'pink', back: 'darkpink'},
{front: 'purple', back: 'darkpurple'},
{front: 'turquoise', back: 'darkturquoise'}];
var start = function() {
canvas = document.createElement('canvas');
canvas.id = "confetti";
canvas.style.zIndex = 10000;
canvas.style.position = "fixed";
canvas.style.top = 0;
canvas.style.left = 0;
var body = document.getElementsByTagName("body")[0];
body.appendChild(canvas);
canvas = document.getElementById("confetti");
ctx = canvas.getContext("2d");
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
cx = ctx.canvas.width / 2;
cy = ctx.canvas.height / 2;
window.addEventListener('resize', function () {
resizeCanvas();
});
initConfetti();
render();
};
//-----------Functions--------------
var resizeCanvas = () => {
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
cx = ctx.canvas.width / 2;
cy = ctx.canvas.height / 2;
};
let randomRange = (min, max) => Math.random() * (max - min) + min;
let initConfetti = () => {
for (let i = 0; i < confettiCount; i++) {
confetti.push({
color: colors[Math.floor(randomRange(0, colors.length))],
dimensions: {
x: randomRange(10, 20),
y: randomRange(10, 30) },
position: {
x: randomRange(0, canvas.width),
y: canvas.height - 1 },
rotation: randomRange(0, 2 * Math.PI),
scale: {
x: 1,
y: 1 },
velocity: {
x: randomRange(-25, 25),
y: randomRange(0, -50) }
});
}
};
//---------Render-----------
let render = () => {
ctx.clearRect(0, 0, canvas.width, canvas.height);
confetti.forEach((confetto, index) => {
let width = confetto.dimensions.x * confetto.scale.x;
let height = confetto.dimensions.y * confetto.scale.y;
// Move canvas to position and rotate
ctx.translate(confetto.position.x, confetto.position.y);
ctx.rotate(confetto.rotation);
// Apply forces to velocity
confetto.velocity.x -= confetto.velocity.x * drag;
confetto.velocity.y = Math.min(confetto.velocity.y + gravity, terminalVelocity);
confetto.velocity.x += Math.random() > 0.5 ? Math.random() : -Math.random();
// Set position
confetto.position.x += confetto.velocity.x;
confetto.position.y += confetto.velocity.y;
// Delete confetti when out of frame
if (confetto.position.y >= canvas.height) confetti.splice(index, 1);
// Loop confetto x position
if (confetto.position.x > canvas.width) confetto.position.x = 0;
if (confetto.position.x < 0) confetto.position.x = canvas.width;
// Spin confetto by scaling y
confetto.scale.y = Math.cos(confetto.position.y * 0.1);
ctx.fillStyle = confetto.scale.y > 0 ? confetto.color.front : confetto.color.back;
// Draw confetto
ctx.fillRect(-width / 2, -height / 2, width, height);
// Reset transform matrix
ctx.setTransform(1, 0, 0, 1, 0, 0);
});
// Fire off another round of confetti
if (confetti.length <= 1) {
//initConfetti();
destroy();
return;
}
window.requestAnimationFrame(render);
};
//---------Execution--------
//initConfetti();
//render();
//----------Resize----------
let destroy = function () {
ctx.clearRect(0, 0, canvas.width, canvas.height);
canvas.remove();
window.cancelAnimationFrame(render);
confetti = [];
};
// Make public what you want to have public, everything else is private
return {
start:start,
initConfetti:initConfetti,
resizeCanvas:resizeCanvas,
render:render
};
})();
//confetti.start();

View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2022 woody180
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,310 @@
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
// Generated by CoffeeScript 2.1.0
(function () {
/*
jQuery Growl
Copyright 2015 Kevin Sylvestre
1.3.5
*/
"use strict";
var $, Animation, Growl;
$ = jQuery;
Animation = function () {
var Animation = function () {
function Animation() {
_classCallCheck(this, Animation);
}
_createClass(Animation, null, [{
key: "transition",
value: function transition($el) {
var el, ref, result, type;
el = $el[0];
ref = this.transitions;
for (type in ref) {
result = ref[type];
if (el.style[type] != null) {
return result;
}
}
}
}]);
return Animation;
}();
;
Animation.transitions = {
"webkitTransition": "webkitTransitionEnd",
"mozTransition": "mozTransitionEnd",
"oTransition": "oTransitionEnd",
"transition": "transitionend"
};
return Animation;
}();
Growl = function () {
var Growl = function () {
_createClass(Growl, null, [{
key: "growl",
value: function growl() {
var settings = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return new Growl(settings);
}
}]);
function Growl() {
var settings = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
_classCallCheck(this, Growl);
this.render = this.render.bind(this);
this.bind = this.bind.bind(this);
this.unbind = this.unbind.bind(this);
this.mouseEnter = this.mouseEnter.bind(this);
this.mouseLeave = this.mouseLeave.bind(this);
this.click = this.click.bind(this);
this.close = this.close.bind(this);
this.cycle = this.cycle.bind(this);
this.waitAndDismiss = this.waitAndDismiss.bind(this);
this.present = this.present.bind(this);
this.dismiss = this.dismiss.bind(this);
this.remove = this.remove.bind(this);
this.animate = this.animate.bind(this);
this.$growls = this.$growls.bind(this);
this.$growl = this.$growl.bind(this);
this.html = this.html.bind(this);
this.content = this.content.bind(this);
this.container = this.container.bind(this);
this.settings = $.extend({}, Growl.settings, settings);
this.initialize(this.settings.location);
this.render();
}
_createClass(Growl, [{
key: "initialize",
value: function initialize(location) {
var id;
id = 'growls-' + location;
return $('body:not(:has(#' + id + '))').append('<div id="' + id + '" />');
}
}, {
key: "render",
value: function render() {
var $growl;
$growl = this.$growl();
this.$growls(this.settings.location).append($growl);
if (this.settings.fixed) {
this.present();
} else {
this.cycle();
}
}
}, {
key: "bind",
value: function bind() {
var $growl = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.$growl();
$growl.on("click", this.click);
if (this.settings.delayOnHover) {
$growl.on("mouseenter", this.mouseEnter);
$growl.on("mouseleave", this.mouseLeave);
}
return $growl.on("contextmenu", this.close).find("." + this.settings.namespace + "-close").on("click", this.close);
}
}, {
key: "unbind",
value: function unbind() {
var $growl = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.$growl();
$growl.off("click", this.click);
if (this.settings.delayOnHover) {
$growl.off("mouseenter", this.mouseEnter);
$growl.off("mouseleave", this.mouseLeave);
}
return $growl.off("contextmenu", this.close).find("." + this.settings.namespace + "-close").off("click", this.close);
}
}, {
key: "mouseEnter",
value: function mouseEnter(event) {
var $growl;
$growl = this.$growl();
return $growl.stop(true, true);
}
}, {
key: "mouseLeave",
value: function mouseLeave(event) {
return this.waitAndDismiss();
}
}, {
key: "click",
value: function click(event) {
if (this.settings.url != null) {
event.preventDefault();
event.stopPropagation();
return window.open(this.settings.url);
}
}
}, {
key: "close",
value: function close(event) {
var $growl;
event.preventDefault();
event.stopPropagation();
$growl = this.$growl();
return $growl.stop().queue(this.dismiss).queue(this.remove);
}
}, {
key: "cycle",
value: function cycle() {
var $growl;
$growl = this.$growl();
return $growl.queue(this.present).queue(this.waitAndDismiss());
}
}, {
key: "waitAndDismiss",
value: function waitAndDismiss() {
var $growl;
$growl = this.$growl();
return $growl.delay(this.settings.duration).queue(this.dismiss).queue(this.remove);
}
}, {
key: "present",
value: function present(callback) {
var $growl;
$growl = this.$growl();
this.bind($growl);
return this.animate($growl, this.settings.namespace + "-incoming", 'out', callback);
}
}, {
key: "dismiss",
value: function dismiss(callback) {
var $growl;
$growl = this.$growl();
this.unbind($growl);
return this.animate($growl, this.settings.namespace + "-outgoing", 'in', callback);
}
}, {
key: "remove",
value: function remove(callback) {
this.$growl().remove();
return typeof callback === "function" ? callback() : void 0;
}
}, {
key: "animate",
value: function animate($element, name) {
var direction = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'in';
var callback = arguments[3];
var transition;
transition = Animation.transition($element);
$element[direction === 'in' ? 'removeClass' : 'addClass'](name);
$element.offset().position;
$element[direction === 'in' ? 'addClass' : 'removeClass'](name);
if (callback == null) {
return;
}
if (transition != null) {
$element.one(transition, callback);
} else {
callback();
}
}
}, {
key: "$growls",
value: function $growls(location) {
var base;
if (this.$_growls == null) {
this.$_growls = [];
}
return (base = this.$_growls)[location] != null ? base[location] : base[location] = $('#growls-' + location);
}
}, {
key: "$growl",
value: function $growl() {
return this.$_growl != null ? this.$_growl : this.$_growl = $(this.html());
}
}, {
key: "html",
value: function html() {
return this.container(this.content());
}
}, {
key: "content",
value: function content() {
return "<div class='" + this.settings.namespace + "-close'>" + this.settings.close + "</div>\n<div class='" + this.settings.namespace + "-title'>" + this.settings.title + "</div>\n<div class='" + this.settings.namespace + "-message'>" + this.settings.message + "</div>";
}
}, {
key: "container",
value: function container(content) {
return "<div class='" + this.settings.namespace + " " + this.settings.namespace + "-" + this.settings.style + " " + this.settings.namespace + "-" + this.settings.size + "'>\n " + content + "\n</div>";
}
}]);
return Growl;
}();
Growl.settings = {
namespace: 'growl',
duration: 3200,
close: "&#215;",
location: "default",
style: "success",
size: "medium",
delayOnHover: true
};
return Growl;
}();
this.Growl = Growl;
$.growl = function () {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return Growl.growl(options);
};
$.growl.error = function () {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var settings;
settings = {
title: "Error!",
style: "error"
};
return $.growl($.extend(settings, options));
};
$.growl.notice = function () {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var settings;
settings = {
title: "Notice!",
style: "notice"
};
return $.growl($.extend(settings, options));
};
$.growl.warning = function () {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var settings;
settings = {
title: "Warning!",
style: "warning"
};
return $.growl($.extend(settings, options));
};
}).call(this);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2016 Andy Roche
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,10 @@
# pomodoro
#### A simple pomodoro timer written in JavaScript. Find it at http://roche.io/pomodoro/
There are plenty of timers like this online ([Moosti](http://moosti.com/), [Tomato Timer](http://tomato-timer.com/)), but the best workflow tool is the one you use. This was a quick side project for me in September 2015 to brush up on my web development and build something I would use myself. It takes the best features from all of the similar timers, and drops the cruft.
#### Features:
- Minutes remaining shown in browser tab
- Favicon change and alarm on timer complete (alarms provided by [AndYouAreWho](http://soundcloud.com/andyouarewho))
- Keyboard shortcuts using Mousetrap.js (hit space to pause/resume)
- Custom time with adjustable units

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@@ -0,0 +1,104 @@
body {
margin: auto;
text-align: center;
}
header {
padding-bottom: 10px;
border-bottom: thin solid #777;
font-family: 'Indie Flower', cursive;
}
label {
padding: 0;
margin: 0;
}
h1 {
margin-top: 5px;
margin-bottom: 15px;
padding: 0;
font-family: 'Indie Flower', cursive;
font-size: 2em;
font-weight: bold;
}
footer {
padding: 10px 0px;
border-top: thin solid #777;
}
#title {
font-size: 4em;
font-weight: bold;
}
#subtitle {
font-size: 1.5em;
}
.content {
padding: 20px 0px 40px 0px;
}
#timer {
font-size: 6em;
font-weight: bold;
}
button.btn_default {
padding: 8px 12px;
margin: 2px 0px;
font-weight: bold;
border-radius: 4px;
-webkit-border-radius: 4px;
border: 1px solid;
}
#btn_start {
background-color: #9F9;
border: 1px solid #171;
}
#btn_pause {
background-color: #FF9;
border: 1px solid #771;
}
#btn_reset {
background-color: #F99;
border: 1px solid #711;
}
#ipt_custom {
padding: 8px 12px;
width: 75px;
border-radius: 4px;
-webkit-border-radius: 4px;
border: 1px solid;
text-align: center;
}
#custom_units {
padding: 8px 12px;
border-radius: 4px;
-webkit-border-radius: 4px;
border: 1px solid;
text-align: center;
}
div.footerbox {
max-width: 300px;
margin: 10px 5px;
display: inline-block;
vertical-align: top;
background-color: #EEE;
padding: 8px 12px;
border-radius: 8px;
-webkit-border-radius: 8px;
border: 1px solid;
}
div.footerbox ol {
display: inline-block;
text-align: left;
padding-left: 15px;
}
#options {
text-align: left;
}
#options label {
margin-bottom: 5px;
}
#options select {
width: 100%;
margin-bottom: 20px;
}
.credits {
margin: 2em 0;
color: #999;
}

View File

@@ -0,0 +1,99 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title id="tab_title">Pomodoro</title>
<link id="dynamic-favicon" rel="icon" type="image/ico"
href="images/red_tomato.ico">
<!-- Original favicon courtesy of http://icons8.com -->
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<link rel='stylesheet' type='text/css'
href='http://fonts.googleapis.com/css?family=Indie+Flower'>
<link rel="stylesheet" href="pomodoro.css">
</head>
<body>
<div class="container">
<header>
<div id="titlebox">
<div id="title">Pomodoro</div>
<div id="subtitle">A simple workflow tool</div>
</div>
</header>
<div class="content">
<p>
<div><span id="timer"></span></div>
<button id="btn_start" class="btn_default">start</button>
<button id="btn_pause" class="btn_default">pause</button>
<button id="btn_reset" class="btn_default">reset</button>
</p>
<p>
<button id="btn_pomodoro" class="btn_default">pomodoro (25m)</button>
<button id="btn_shortbreak" class="btn_default">short break (5m)</button>
<button id="btn_longbreak" class="btn_default">long break (15m)</button>
</p>
<p>
<button id="btn_custom" class="btn_default">
<label for="ipt_custom">custom:</label>
</button>
<input type="number" id="ipt_custom" value="45" min="0" max="100000000">
<select id="custom_units">
<option value="seconds">seconds</option>
<option value="minutes" selected>minutes</option>
<option value="hours">hours</option>
</select>
</p>
</div>
<footer>
<div class="footerbox">
<h1>How it works:</h1>
<ol>
<li>Choose a task to focus on</li>
<li>Work for 25 uninterrupted minutes</li>
<li>Break for 5 minutes</li>
<li>Every four cycles, take a 15-30 minute<br>
break instead, preferably outside</li>
</ol>
<br>
<a href="https://en.wikipedia.org/wiki/Pomodoro_Technique" target="_blank">
Read more at Wikipedia
</a>
</div>
<div class="footerbox">
<h1>Options:</h1>
<div id="options">
<label for="alarm_select" id="lbl_alarm">Alarm:</label><br>
<select id="alarm_select">
<option value="none">None</option>
<option value="alarm_chime">Chime</option>
<option value="alarm_bell" selected>Bell</option>
<option value="alarm_beeps">Beeps</option>
<option value="alarm_boops">Boops</option>
</select>
<br><br>
<label for="alarm_volume" id="lbl_volume">Volume:</label><br>
<input type="range" id="alarm_volume" min=0 max=100 value=50>
</div>
<br>
</div>
<div class="credits">
Created by
<a href="../index.html">Andy Roche</a> -
<a href="https://github.com/rocheio/rocheio.github.io/tree/master/pomodoro">Github</a>
</div>
</footer>
</div>
<audio id="alarm_chime">
<source src="audio/one_chime.mp3" type="audio/mpeg"></audio>
<audio id="alarm_bell">
<source src="audio/one_bell.mp3" type="audio/mpeg"></audio>
<audio id="alarm_beeps">
<source src="audio/three_beeps.mp3" type="audio/mpeg"></audio>
<audio id="alarm_boops">
<source src="audio/three_boops.mp3" type="audio/mpeg"></audio>
<!-- Audio courtesy of https://soundcloud.com/andyouarewho -->
<script type="text/javascript" src="../resources/mousetrap.js"></script>
<script type="text/javascript" src="pomodoro.js"></script>
</body>
</html>

View File

@@ -0,0 +1,222 @@
/** Represents a timer that can count down. */
function CountdownTimer(seconds, tickRate) {
this.seconds = seconds || (25*60);
this.tickRate = tickRate || 500; // Milliseconds
this.tickFunctions = [];
this.isRunning = false;
this.remaining = this.seconds;
/** CountdownTimer starts ticking down and executes all tick
functions once per tick. */
this.start = function() {
if (this.isRunning) {
return;
}
this.isRunning = true;
// Set variables related to when this timer started
var startTime = Date.now(),
thisTimer = this;
// Tick until complete or interrupted
(function tick() {
secondsSinceStart = ((Date.now() - startTime) / 1000) | 0;
var secondsRemaining = thisTimer.remaining - secondsSinceStart;
// Check if timer has been paused by user
if (thisTimer.isRunning === false) {
thisTimer.remaining = secondsRemaining;
} else {
if (secondsRemaining > 0) {
// Execute another tick in tickRate milliseconds
setTimeout(tick, thisTimer.tickRate);
} else {
// Stop this timer
thisTimer.remaining = 0;
thisTimer.isRunning = false;
// Alert user that time is up
playAlarm();
changeFavicon('green');
}
var timeRemaining = parseSeconds(secondsRemaining);
// Execute each tickFunction in the list with thisTimer
// as an argument
thisTimer.tickFunctions.forEach(
function(tickFunction) {
tickFunction.call(this,
timeRemaining.minutes,
timeRemaining.seconds);
},
thisTimer);
}
}());
};
/** Pause the timer. */
this.pause = function() {
this.isRunning = false;
};
/** Pause the timer and reset to its original time. */
this.reset = function(seconds) {
this.isRunning = false;
this.seconds = seconds
this.remaining = seconds
};
/** Add a function to the timer's tickFunctions. */
this.onTick = function(tickFunction) {
if (typeof tickFunction === 'function') {
this.tickFunctions.push(tickFunction);
}
};
}
/** Return minutes and seconds from seconds. */
function parseSeconds(seconds) {
return {
'minutes': (seconds / 60) | 0,
'seconds': (seconds % 60) | 0
}
}
/** Play the selected alarm at selected volume. */
function playAlarm() {
var alarmValue = document.getElementById('alarm_select').value;
if (alarmValue != 'none') {
var alarmAudio = document.getElementById(alarmValue);
var alarmVolume = document.getElementById('alarm_volume').value;
alarmAudio.volume = alarmVolume / 100;
alarmAudio.play();
}
}
/** Change the color of the favicon. */
function changeFavicon(color) {
document.head = document.head || document.getElementsByTagName('head')[0];
var color = color || 'green';
var newFavicon = document.createElement('link'),
oldFavicon = document.getElementById('dynamic-favicon');
newFavicon.id = 'dynamic-favicon'
newFavicon.type = 'image/ico';
newFavicon.rel = 'icon';
newFavicon.href = 'images/' + color + '_tomato.ico';
if (oldFavicon) {
document.head.removeChild(oldFavicon);
}
document.head.appendChild(newFavicon);
}
/** Window onload functions. */
window.onload = function () {
var timerDisplay = document.getElementById('timer'),
customTimeInput = document.getElementById('ipt_custom'),
timer = new CountdownTimer(),
timeObj = parseSeconds(25*60);
/** Set the time on the main clock display and
set the time remaining section in the title. */
function setTimeOnAllDisplays(minutes, seconds) {
if (minutes >= 60) {
// Add an hours section to all displays
hours = Math.floor(minutes / 60);
minutes = minutes % 60;
clockHours = hours + ':';
document.title = '(' + hours + 'h' + minutes + 'm) Pomodoro';
} else {
clockHours = '';
document.title = '(' + minutes + 'm) Pomodoro';
}
clockMinutes = minutes < 10 ? '0' + minutes : minutes;
clockMinutes += ':';
clockSeconds = seconds < 10 ? '0' + seconds : seconds;
timerDisplay.textContent = clockHours + clockMinutes + clockSeconds;
}
/** Revert the favicon to red, delete the old timer
object, and start a new one. */
function resetMainTimer(seconds) {
changeFavicon('red');
timer.pause();
timer = new CountdownTimer(seconds);
timer.onTick(setTimeOnAllDisplays);
}
// Set default page timer displays
setTimeOnAllDisplays(timeObj.minutes, timeObj.seconds);
timer.onTick(setTimeOnAllDisplays);
// Add listeners for start, pause, etc. buttons
document.getElementById('btn_start').addEventListener(
'click', function () {
timer.start();
});
document.getElementById('btn_pause').addEventListener(
'click', function () {
timer.pause();
});
document.getElementById('btn_reset').addEventListener(
'click', function () {
resetMainTimer(timer.seconds);
timer.start();
});
document.getElementById('btn_pomodoro').addEventListener(
'click', function () {
resetMainTimer(25*60);
timer.start();
});
document.getElementById('btn_shortbreak').addEventListener(
'click', function () {
resetMainTimer(5*60);
timer.start();
});
document.getElementById('btn_longbreak').addEventListener(
'click', function () {
resetMainTimer(15*60);
timer.start();
});
document.getElementById('btn_custom').addEventListener(
'click', function () {
customUnits = document.getElementById('custom_units').value
if (customUnits === 'minutes') {
resetMainTimer(customTimeInput.value*60);
} else if (customUnits === 'hours') {
resetMainTimer(customTimeInput.value*3600);
} else {
resetMainTimer(customTimeInput.value);
}
timer.start();
});
// Bind keyboard shortcut for starting/pausing timer
Mousetrap.bind('space', function(e) {
// Remove default behavior of buttons (page scrolling)
if (e.preventDefault()) {
e.preventDefault();
} else {
e.returnValue = false; //IE
}
// Pause or start the timer
if(timer.isRunning) {
timer.pause();
} else {
timer.start();
}
});
};

View File

@@ -0,0 +1,5 @@
/* PrismJS 1.29.0
https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript+bash+c+csharp+cpp+coffeescript+css-extras+docker+go+go-module+graphql+ini+java+javadoc+javadoclike+jsdoc+js-extras+jsstacktrace+js-templates+latex+less+markdown+markup-templating+matlab+mongodb+monkey+nginx+objectivec+php+phpdoc+php-extras+plsql+r+ruby+rust+sass+scss+shell-session+sql+swift+twig+typescript+typoscript+vim+xml-doc+yaml&plugins=line-highlight+line-numbers */
code[class*=language-],pre[class*=language-]{color:#000;background:0 0;text-shadow:0 1px #fff;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}code[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,pre[class*=language-]::-moz-selection{text-shadow:none;background:#b3d4fc}code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{text-shadow:none;background:#b3d4fc}@media print{code[class*=language-],pre[class*=language-]{text-shadow:none}}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#f5f2f0}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#708090}.token.punctuation{color:#999}.token.namespace{opacity:.7}.token.boolean,.token.constant,.token.deleted,.token.number,.token.property,.token.symbol,.token.tag{color:#905}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#690}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url{color:#9a6e3a;background:hsla(0,0%,100%,.5)}.token.atrule,.token.attr-value,.token.keyword{color:#07a}.token.class-name,.token.function{color:#dd4a68}.token.important,.token.regex,.token.variable{color:#e90}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}
pre[data-line]{position:relative;padding:1em 0 1em 3em}.line-highlight{position:absolute;left:0;right:0;padding:inherit 0;margin-top:1em;background:hsla(24,20%,50%,.08);background:linear-gradient(to right,hsla(24,20%,50%,.1) 70%,hsla(24,20%,50%,0));pointer-events:none;line-height:inherit;white-space:pre}@media print{.line-highlight{-webkit-print-color-adjust:exact;color-adjust:exact}}.line-highlight:before,.line-highlight[data-end]:after{content:attr(data-start);position:absolute;top:.4em;left:.6em;min-width:1em;padding:0 .5em;background-color:hsla(24,20%,50%,.4);color:#f4f1ef;font:bold 65%/1.5 sans-serif;text-align:center;vertical-align:.3em;border-radius:999px;text-shadow:none;box-shadow:0 1px #fff}.line-highlight[data-end]:after{content:attr(data-end);top:auto;bottom:.4em}.line-numbers .line-highlight:after,.line-numbers .line-highlight:before{content:none}pre[id].linkable-line-numbers span.line-numbers-rows{pointer-events:all}pre[id].linkable-line-numbers span.line-numbers-rows>span:before{cursor:pointer}pre[id].linkable-line-numbers span.line-numbers-rows>span:hover:before{background-color:rgba(128,128,128,.2)}
pre[class*=language-].line-numbers{position:relative;padding-left:3.8em;counter-reset:linenumber}pre[class*=language-].line-numbers>code{position:relative;white-space:inherit}.line-numbers .line-numbers-rows{position:absolute;pointer-events:none;top:0;font-size:100%;left:-3.8em;width:3em;letter-spacing:-1px;border-right:1px solid #999;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.line-numbers-rows>span{display:block;counter-increment:linenumber}.line-numbers-rows>span:before{content:counter(linenumber);color:#999;display:block;padding-right:.8em;text-align:right}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,19 @@
Copyright (c) 2010 Rachel Carvalho <rachel.carvalho@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@@ -0,0 +1,43 @@
# simpleColorPicker
A simple color picker jQuery plugin that appears as the user focuses the input.
Check out the latest version at http://github.com/rachel-carvalho/simple-color-picker.
## Usage
Just attach the simpleColorPicker to an input text and when it gains focus the color palette appears aligned to its bottom right corner.
### Samples
See them working live at http://rachel-carvalho.github.com/simple-color-picker.
#### Default options
$(document).ready(function() {
$('input#color').simpleColorPicker();
});
#### More colors per line
$(document).ready(function() {
$('input#color2').simpleColorPicker({ colorsPerLine: 16 });
});
#### Different colors
$(document).ready(function() {
var colors = ['#000000', '#444444', '#666666', '#999999', '#cccccc', '#eeeeee', '#f3f3f3', '#ffffff'];
$('input#color3').simpleColorPicker({ colors: colors });
});
#### Effects
$(document).ready(function() {
$('input#color4').simpleColorPicker({ showEffect: 'fade', hideEffect: 'slide' });
});
#### Non-input elements
$(document).ready(function() {
$('button#color5').simpleColorPicker({ onChangeColor: function(color) { $('label#color-result').text(color); } });
});

View File

@@ -0,0 +1,7 @@
- finish tests
- update jquery support
- stop supporting ie 6
- replace clear: both by .first-in-line
- remove as much css as possible from js
- generate hidden span for color codes (avoid empty lis)
- organize plugin code

View File

@@ -0,0 +1,104 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>simpleColorPicker jQuery plugin</title>
<link type="text/css" href="../../../css/libs/jquery.simple-color-picker.css" rel="stylesheet" />
<style type="text/css">
body { font-family: sans-serif; font-size: 12px; margin: 0px; }
h1 { font-size: 16px; margin: 0px; padding: 5px 5px; }
h2 { font-size: 14px; margin: 0px; padding: 5px 5px; }
h3 { font-size: 12px; margin: 0px; padding: 2px 0px; }
ul { list-style-type: none; padding: 0px; margin: 0px 10px; }
p { margin: 10px 0px; padding: 0px 5px; }
label { display: block; }
input#color { width: 150px; }
pre { font-family: monospace; display: block; margin: 5px; }
</style>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.3.min.js"></script>
<script type="text/javascript" src="jquery.simple-color-picker.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('input#color').simpleColorPicker();
$('input#color2').simpleColorPicker({ colorsPerLine: 16 });
var colors = ['#000000', '#444444', '#666666', '#999999', '#cccccc', '#eeeeee', '#f3f3f3', '#ffffff'];
$('input#color3').simpleColorPicker({ colors: colors });
$('input#color4').simpleColorPicker({ showEffect: 'fade', hideEffect: 'slide' });
$('button#color5').simpleColorPicker({ onChangeColor: function(color) { $('label#color-result').text(color); } });
});
</script>
</head>
<body>
<h1>simpleColorPicker jQuery plugin</h1>
<p>A simple color picker jQuery plugin that appears as the user focuses the input.</p>
<p>Just attach the simpleColorPicker to an input text and when it gains focus the color palette appears aligned to its bottom right corner.</p>
<p>Check out the latest version at <a href="http://github.com/rachel-carvalho/simple-color-picker">http://github.com/rachel-carvalho/simple-color-picker</a>.</p>
<h2>Live samples</h2>
<ul>
<li>
<h3>Default options</h3>
<label for="color">Choose a color:</label>
<input type="text" id="color" name="color" />
<pre>
$(document).ready(function() {
$('input#color').simpleColorPicker();
});
</pre>
</li>
<li>
<h3>More colors per line</h3>
<label for="color2">Choose a color:</label>
<input type="text" id="color2" name="color2" />
<pre>
$(document).ready(function() {
$('input#color2').simpleColorPicker({ colorsPerLine: 16 });
});
</pre>
</li>
<li>
<h3>Different colors</h3>
<label for="color3">Choose a color:</label>
<input type="text" id="color3" name="color3" />
<pre>
$(document).ready(function() {
var colors = ['#000000', '#444444', '#666666', '#999999', '#cccccc', '#eeeeee', '#f3f3f3', '#ffffff'];
$('input#color3').simpleColorPicker({ colors: colors });
});
</pre>
</li>
<li>
<h3>Effects</h3>
<label for="color4">Choose a color:</label>
<input type="text" id="color4" name="color4" />
<pre>
$(document).ready(function() {
$('input#color4').simpleColorPicker({ showEffect: 'fade', hideEffect: 'slide' });
});
</pre>
</li>
<li>
<h3>Non-input elements</h3>
<label id="color-result">No color chosen yet</label>
<button id="color5">Choose a color</button>
<pre>
$(document).ready(function() {
$('button#color5').simpleColorPicker({ onChangeColor: function(color) { $('label#color-result').text(color); } });
});
</pre>
</li>
</ul>
</body>
</html>

View File

@@ -0,0 +1,106 @@
jQuery(function($, undefined) {
$.fn.simpleColorPicker = function(options) {
var defaults = {
colorsPerLine: 8,
colors: ['#000000', '#444444', '#666666', '#999999', '#cccccc', '#eeeeee', '#f3f3f3', '#ffffff'
, '#ff0000', '#ff9900', '#ffff00', '#00ff00', '#00ffff', '#0000ff', '#9900ff', '#ff00ff'
, '#f4cccc', '#fce5cd', '#fff2cc', '#d9ead3', '#d0e0e3', '#cfe2f3', '#d9d2e9', '#ead1dc'
, '#ea9999', '#f9cb9c', '#ffe599', '#b6d7a8', '#a2c4c9', '#9fc5e8', '#b4a7d6', '#d5a6bd'
, '#e06666', '#f6b26b', '#ffd966', '#93c47d', '#76a5af', '#6fa8dc', '#8e7cc3', '#c27ba0'
, '#cc0000', '#e69138', '#f1c232', '#6aa84f', '#45818e', '#3d85c6', '#674ea7', '#a64d79'
, '#990000', '#b45f06', '#bf9000', '#38761d', '#134f5c', '#0b5394', '#351c75', '#741b47'
, '#660000', '#783f04', '#7f6000', '#274e13', '#0c343d', '#073763', '#20124d', '#4C1130'],
showEffect: '',
hideEffect: '',
onChangeColor: false,
includeMargins:false,
};
var opts = $.extend(defaults, options);
return this.each(function() {
var txt = $(this);
var colorsMarkup = '';
var prefix = txt.attr('class').replace(/-/g, '') + '_';
for(var i = 0; i < opts.colors.length; i++){
var item = opts.colors[i];
var breakLine = '';
if (i % opts.colorsPerLine == 0)
breakLine = 'clear: both; ';
if (i > 0 && breakLine && $.browser && $.browser.msie && $.browser.version <= 7) {
breakLine = '';
colorsMarkup += '<li style="float: none; clear: both; overflow: hidden; background-color: #fff; display: block; height: 1px; line-height: 1px; font-size: 1px; margin-bottom: -2px;"></li>';
}
colorsMarkup += '<li id="' + prefix + 'color-' + i + '" class="color-box" style="' + breakLine + 'background-color: ' + item + '" title="' + item + '"></li>';
}
var box = $('<div id="' + prefix + 'color-picker" class="color-picker" style="position: absolute; left: 0px; top: 0px;"><ul>' + colorsMarkup + '</ul><div style="clear: both;"></div></div>');
$('body').append(box);
box.hide();
box.find('li.color-box').click(function() {
if (txt.is('input')) {
txt.val(opts.colors[this.id.substr(this.id.indexOf('-') + 1)]);
txt.blur();
}
if ($.isFunction(defaults.onChangeColor)) {
defaults.onChangeColor.call(txt, opts.colors[this.id.substr(this.id.indexOf('-') + 1)]);
}
hideBox(box);
});
$('body').on('click', function() {
hideBox(box);
});
box.click(function(event) {
event.stopPropagation();
});
var positionAndShowBox = function(box) {
var pos = txt.offset();
var left = pos.left + txt.outerWidth(opts.includeMargins) - box.outerWidth(opts.includeMargins);
if (left < pos.left) left = pos.left;
box.css({ left: left, top: (pos.top + txt.outerHeight(opts.includeMargins)) });
showBox(box);
};
txt.click(function(event) {
event.stopPropagation();
if (!txt.is('input')) {
// element is not an input so probably a link or div which requires the color box to be shown
positionAndShowBox(box);
}
});
txt.focus(function() {
positionAndShowBox(box);
});
function hideBox(box) {
if (opts.hideEffect == 'fade')
box.fadeOut();
else if (opts.hideEffect == 'slide')
box.slideUp();
else
box.hide();
}
function showBox(box) {
if (opts.showEffect == 'fade')
box.fadeIn();
else if (opts.showEffect == 'slide')
box.slideDown();
else
box.show();
}
});
};
});

View File

@@ -0,0 +1,24 @@
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Jasmine Spec Runner v2.0.0-rc5</title>
<link rel="shortcut icon" type="image/png" href="vendor/jasmine-2.0.0-rc5/jasmine_favicon.png">
<link rel="stylesheet" type="text/css" href="vendor/jasmine-2.0.0-rc5/jasmine.css">
<script type="text/javascript" src="vendor/jasmine-2.0.0-rc5/jasmine.js"></script>
<script type="text/javascript" src="vendor/jasmine-2.0.0-rc5/jasmine-html.js"></script>
<script type="text/javascript" src="vendor/jasmine-2.0.0-rc5/boot.js"></script>
<!-- include source files here... -->
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.3.min.js"></script>
<script type="text/javascript" src="jquery.simple-color-picker.js"></script>
<!-- include spec files here... -->
<script type="text/javascript" src="spec/simple-color-picker.spec.js"></script>
</head>
<body>
</body>
</html>

View File

@@ -0,0 +1,207 @@
var txt = null;
describe('Simple color picker', function() {
var get_box = function() {
return $('div#' + txt.attr('id').replace(/-/g, '') + '_color-picker');
};
beforeEach(function() {
// add an input id="txt"
txt = $(document.createElement('input'));
txt.attr('id', 'txt');
$('body').append(txt);
});
afterEach(function() {
get_box().remove();
txt.remove();
});
describe('default markup', function() {
beforeEach(function() {
txt.simpleColorPicker();
});
it('appends div#txt_color-picker to the body', function() {
expect(get_box().length).toBe(1);
});
it('which is hidden', function() {
expect(get_box().is(':hidden')).toBeTruthy();
});
it('with a ul inside', function() {
expect(get_box().find('ul').length).toBe(1);
});
it('and 64 li.color-box', function() {
expect(get_box().find('li.color-box').length).toBe(64);
});
it('of which 8 have clear:both (according to colorsPerLine default value)', function() {
expect(get_box().find('li.color-box[style*="clear: both"]').length).toBe(8);
});
it('the first li.color-box has background-color #000000', function() {
expect(get_box().find('li.color-box:first').attr('style').indexOf('background-color: #000000')).toBeGreaterThan(-1);
});
it('and title #000000', function() {
expect(get_box().find('li.color-box:first').attr('title')).toBe('#000000');
});
});
describe('options', function() {
it('16 colors per line makes 4 clear:boths', function() {
txt.simpleColorPicker({ colorsPerLine: 16 });
expect(get_box().find('li.color-box[style*="clear: both"]').length).toBe(4);
});
describe('black and white only', function() {
beforeEach(function(){
txt.simpleColorPicker({ colors: ['#000000', '#ffffff'] });
});
it('makes 2 li.color-box', function() {
expect(get_box().find('li.color-box').length).toBe(2);
});
it('one has background-color: #000000', function() {
expect(get_box().find('li.color-box[style*="background-color: #000000"]').length).toBe(1);
});
it('another has background-color: #ffffff', function() {
expect(get_box().find('li.color-box[style*="background-color: #ffffff"]').length).toBe(1);
});
it('one of which has clear:both', function() {
expect(get_box().find('li.color-box[style*="clear: both"]').length).toBe(1);
});
});
});
var test_jq_method = function(spy, elem) {
expect(spy).toHaveBeenCalled();
expect(spy.calls.count()).toEqual(1);
var recent = spy.calls.mostRecent();
expect(recent).not.toBe(undefined);
var obj = recent ? recent.object[0] : undefined;
expect(obj).toBe(elem[0]);
};
describe('behavior', function() {
var box = null;
describe('default', function() {
beforeEach(function() {
txt.simpleColorPicker();
box = get_box();
});
describe('focusing input', function() {
it('positions color picker aligned to input right', function() {
txt.focus();
expect(box.offset().left + box.outerWidth()).toBe(txt.offset().left + txt.outerWidth());
});
it('or to left, if picker is wider than input', function() {
txt.width(10).focus();
expect(box.offset().left).toBe(txt.offset().left);
});
it('shows color picker', function() {
expect(box.is(':hidden')).toBeTruthy();
txt.focus();
expect(box.is(':hidden')).not.toBeTruthy();
});
});
describe('after picker is open', function() {
beforeEach(function() {
txt.focus();
});
it('clicking outside closes it', function() {
expect(box.is(':hidden')).not.toBeTruthy();
$('body').click();
expect(box.is(':hidden')).toBeTruthy();
});
it('clicking another element closes it', function() {
expect(box.is(':hidden')).not.toBeTruthy();
var btn = $(document.createElement('button'));
$('body').append(btn);
btn.click();
expect(box.is(':hidden')).toBeTruthy();
btn.remove();
});
describe('clicking a color', function() {
var color_li = null;
var jq_hide_spy = null;
beforeEach(function() {
jq_hide_spy = spyOn($.fn, 'hide').and.callThrough();
color_li = box.find('li.color-box:first');
color_li.click();
});
it('fills the input with the right color code', function() {
expect(txt.val()).toBe(color_li.attr('title'));
});
it('hides the picker', function() {
expect(box.is(':hidden')).toBeTruthy();
});
it('by calling $.fn.hide on it', function() {
test_jq_method(jq_hide_spy, box);
});
});
});
});
var trigger_txt = function(opts, just_show) {
txt.simpleColorPicker(opts);
txt.focus();
if (!just_show)
get_box().find('li.color-box:first').click();
};
it('should call onChangeColor when specified', function() {
var opts = { onChangeColor: function(txt, color) {} };
var color_spy = spyOn(opts, 'onChangeColor').and.callThrough();
trigger_txt(opts);
expect(color_spy).toHaveBeenCalled();
});
describe('effects', function() {
it('should show with fade', function() {
var spy = spyOn($.fn, 'fadeIn').and.callThrough();
trigger_txt({showEffect: 'fade'}, true);
test_jq_method(spy, get_box());
});
it('should hide with fade', function() {
var spy = spyOn($.fn, 'fadeOut').and.callThrough();
trigger_txt({hideEffect: 'fade'});
test_jq_method(spy, get_box());
});
it('should show with slide', function() {
var spy = spyOn($.fn, 'slideDown').and.callThrough();
trigger_txt({showEffect: 'slide'}, true);
test_jq_method(spy, get_box());
});
it('should hide with slide', function() {
var spy = spyOn($.fn, 'slideUp').and.callThrough();
trigger_txt({hideEffect: 'slide'});
test_jq_method(spy, get_box());
});
});
});
});

View File

@@ -0,0 +1,181 @@
/**
Starting with version 2.0, this file "boots" Jasmine, performing all of the necessary initialization before executing the loaded environment and all of a project's specs. This file should be loaded after `jasmine.js`, but before any project source files or spec files are loaded. Thus this file can also be used to customize Jasmine for a project.
If a project is using Jasmine via the standalone distribution, this file can be customized directly. If a project is using Jasmine via the [Ruby gem][jasmine-gem], this file can be copied into the support directory via `jasmine copy_boot_js`. Other environments (e.g., Python) will have different mechanisms.
The location of `boot.js` can be specified and/or overridden in `jasmine.yml`.
[jasmine-gem]: http://github.com/pivotal/jasmine-gem
*/
(function() {
/**
* ## Require &amp; Instantiate
*
* Require Jasmine's core files. Specifically, this requires and attaches all of Jasmine's code to the `jasmine` reference.
*/
window.jasmine = jasmineRequire.core(jasmineRequire);
/**
* Since this is being run in a browser and the results should populate to an HTML page, require the HTML-specific Jasmine code, injecting the same reference.
*/
jasmineRequire.html(jasmine);
/**
* Create the Jasmine environment. This is used to run all specs in a project.
*/
var env = jasmine.getEnv();
/**
* ## The Global Interface
*
* Build up the functions that will be exposed as the Jasmine public interface. A project can customize, rename or alias any of these functions as desired, provided the implementation remains unchanged.
*/
var jasmineInterface = {
describe: function(description, specDefinitions) {
return env.describe(description, specDefinitions);
},
xdescribe: function(description, specDefinitions) {
return env.xdescribe(description, specDefinitions);
},
it: function(desc, func) {
return env.it(desc, func);
},
xit: function(desc, func) {
return env.xit(desc, func);
},
beforeEach: function(beforeEachFunction) {
return env.beforeEach(beforeEachFunction);
},
afterEach: function(afterEachFunction) {
return env.afterEach(afterEachFunction);
},
expect: function(actual) {
return env.expect(actual);
},
pending: function() {
return env.pending();
},
spyOn: function(obj, methodName) {
return env.spyOn(obj, methodName);
},
jsApiReporter: new jasmine.JsApiReporter({
timer: new jasmine.Timer()
})
};
/**
* Add all of the Jasmine global/public interface to the proper global, so a project can use the public interface directly. For example, calling `describe` in specs instead of `jasmine.getEnv().describe`.
*/
if (typeof window == "undefined" && typeof exports == "object") {
extend(exports, jasmineInterface);
} else {
extend(window, jasmineInterface);
}
/**
* Expose the interface for adding custom equality testers.
*/
jasmine.addCustomEqualityTester = function(tester) {
env.addCustomEqualityTester(tester);
};
/**
* Expose the interface for adding custom expectation matchers
*/
jasmine.addMatchers = function(matchers) {
return env.addMatchers(matchers);
};
/**
* Expose the mock interface for the JavaScript timeout functions
*/
jasmine.clock = function() {
return env.clock;
};
/**
* ## Runner Parameters
*
* More browser specific code - wrap the query string in an object and to allow for getting/setting parameters from the runner user interface.
*/
var queryString = new jasmine.QueryString({
getWindowLocation: function() { return window.location; }
});
var catchingExceptions = queryString.getParam("catch");
env.catchExceptions(typeof catchingExceptions === "undefined" ? true : catchingExceptions);
/**
* ## Reporters
* The `HtmlReporter` builds all of the HTML UI for the runner page. This reporter paints the dots, stars, and x's for specs, as well as all spec names and all failures (if any).
*/
var htmlReporter = new jasmine.HtmlReporter({
env: env,
onRaiseExceptionsClick: function() { queryString.setParam("catch", !env.catchingExceptions()); },
getContainer: function() { return document.body; },
createElement: function() { return document.createElement.apply(document, arguments); },
createTextNode: function() { return document.createTextNode.apply(document, arguments); },
timer: new jasmine.Timer()
});
/**
* The `jsApiReporter` also receives spec results, and is used by any environment that needs to extract the results from JavaScript.
*/
env.addReporter(jasmineInterface.jsApiReporter);
env.addReporter(htmlReporter);
/**
* Filter which specs will be run by matching the start of the full name against the `spec` query param.
*/
var specFilter = new jasmine.HtmlSpecFilter({
filterString: function() { return queryString.getParam("spec"); }
});
env.specFilter = function(spec) {
return specFilter.matches(spec.getFullName());
};
/**
* Setting up timing functions to be able to be overridden. Certain browsers (Safari, IE 8, phantomjs) require this hack.
*/
window.setTimeout = window.setTimeout;
window.setInterval = window.setInterval;
window.clearTimeout = window.clearTimeout;
window.clearInterval = window.clearInterval;
/**
* ## Execution
*
* Replace the browser window's `onload`, ensure it's called, and then run all of the loaded specs. This includes initializing the `HtmlReporter` instance and then executing the loaded Jasmine environment. All of this will happen after all of the specs are loaded.
*/
var currentWindowOnload = window.onload;
window.onload = function() {
if (currentWindowOnload) {
currentWindowOnload();
}
htmlReporter.initialize();
env.execute();
};
/**
* Helper function for readability above.
*/
function extend(destination, source) {
for (var property in source) destination[property] = source[property];
return destination;
}
}());

View File

@@ -0,0 +1,160 @@
/*
Copyright (c) 2008-2013 Pivotal Labs
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
function getJasmineRequireObj() {
if (typeof module !== "undefined" && module.exports) {
return exports;
} else {
window.jasmineRequire = window.jasmineRequire || {};
return window.jasmineRequire;
}
}
getJasmineRequireObj().console = function(jRequire, j$) {
j$.ConsoleReporter = jRequire.ConsoleReporter();
};
getJasmineRequireObj().ConsoleReporter = function() {
var noopTimer = {
start: function(){},
elapsed: function(){ return 0; }
};
function ConsoleReporter(options) {
var print = options.print,
showColors = options.showColors || false,
onComplete = options.onComplete || function() {},
timer = options.timer || noopTimer,
specCount,
failureCount,
failedSpecs = [],
pendingCount,
ansi = {
green: '\033[32m',
red: '\033[31m',
yellow: '\033[33m',
none: '\033[0m'
};
this.jasmineStarted = function() {
specCount = 0;
failureCount = 0;
pendingCount = 0;
print("Started");
printNewline();
timer.start();
};
this.jasmineDone = function() {
printNewline();
for (var i = 0; i < failedSpecs.length; i++) {
specFailureDetails(failedSpecs[i]);
}
printNewline();
var specCounts = specCount + " " + plural("spec", specCount) + ", " +
failureCount + " " + plural("failure", failureCount);
if (pendingCount) {
specCounts += ", " + pendingCount + " pending " + plural("spec", pendingCount);
}
print(specCounts);
printNewline();
var seconds = timer.elapsed() / 1000;
print("Finished in " + seconds + " " + plural("second", seconds));
printNewline();
onComplete(failureCount === 0);
};
this.specDone = function(result) {
specCount++;
if (result.status == "pending") {
pendingCount++;
print(colored("yellow", "*"));
return;
}
if (result.status == "passed") {
print(colored("green", '.'));
return;
}
if (result.status == "failed") {
failureCount++;
failedSpecs.push(result);
print(colored("red", 'F'));
}
};
return this;
function printNewline() {
print("\n");
}
function colored(color, str) {
return showColors ? (ansi[color] + str + ansi.none) : str;
}
function plural(str, count) {
return count == 1 ? str : str + "s";
}
function repeat(thing, times) {
var arr = [];
for (var i = 0; i < times; i++) {
arr.push(thing);
}
return arr;
}
function indent(str, spaces) {
var lines = (str || '').split("\n");
var newArr = [];
for (var i = 0; i < lines.length; i++) {
newArr.push(repeat(" ", spaces).join("") + lines[i]);
}
return newArr.join("\n");
}
function specFailureDetails(result) {
printNewline();
print(result.fullName);
for (var i = 0; i < result.failedExpectations.length; i++) {
var failedExpectation = result.failedExpectations[i];
printNewline();
print(indent(failedExpectation.stack, 2));
}
printNewline();
}
}
return ConsoleReporter;
};

View File

@@ -0,0 +1,359 @@
/*
Copyright (c) 2008-2013 Pivotal Labs
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
jasmineRequire.html = function(j$) {
j$.ResultsNode = jasmineRequire.ResultsNode();
j$.HtmlReporter = jasmineRequire.HtmlReporter(j$);
j$.QueryString = jasmineRequire.QueryString();
j$.HtmlSpecFilter = jasmineRequire.HtmlSpecFilter();
};
jasmineRequire.HtmlReporter = function(j$) {
var noopTimer = {
start: function() {},
elapsed: function() { return 0; }
};
function HtmlReporter(options) {
var env = options.env || {},
getContainer = options.getContainer,
createElement = options.createElement,
createTextNode = options.createTextNode,
onRaiseExceptionsClick = options.onRaiseExceptionsClick || function() {},
timer = options.timer || noopTimer,
results = [],
specsExecuted = 0,
failureCount = 0,
pendingSpecCount = 0,
htmlReporterMain,
symbols;
this.initialize = function() {
htmlReporterMain = createDom("div", {className: "html-reporter"},
createDom("div", {className: "banner"},
createDom("span", {className: "title"}, "Jasmine"),
createDom("span", {className: "version"}, j$.version)
),
createDom("ul", {className: "symbol-summary"}),
createDom("div", {className: "alert"}),
createDom("div", {className: "results"},
createDom("div", {className: "failures"})
)
);
getContainer().appendChild(htmlReporterMain);
symbols = find(".symbol-summary");
};
var totalSpecsDefined;
this.jasmineStarted = function(options) {
totalSpecsDefined = options.totalSpecsDefined || 0;
timer.start();
};
var summary = createDom("div", {className: "summary"});
var topResults = new j$.ResultsNode({}, "", null),
currentParent = topResults;
this.suiteStarted = function(result) {
currentParent.addChild(result, "suite");
currentParent = currentParent.last();
};
this.suiteDone = function(result) {
if (currentParent == topResults) {
return;
}
currentParent = currentParent.parent;
};
this.specStarted = function(result) {
currentParent.addChild(result, "spec");
};
var failures = [];
this.specDone = function(result) {
if (result.status != "disabled") {
specsExecuted++;
}
symbols.appendChild(createDom("li", {
className: result.status,
id: "spec_" + result.id,
title: result.fullName
}
));
if (result.status == "failed") {
failureCount++;
var failure =
createDom("div", {className: "spec-detail failed"},
createDom("div", {className: "description"},
createDom("a", {title: result.fullName, href: specHref(result)}, result.fullName)
),
createDom("div", {className: "messages"})
);
var messages = failure.childNodes[1];
for (var i = 0; i < result.failedExpectations.length; i++) {
var expectation = result.failedExpectations[i];
messages.appendChild(createDom("div", {className: "result-message"}, expectation.message));
messages.appendChild(createDom("div", {className: "stack-trace"}, expectation.stack));
}
failures.push(failure);
}
if (result.status == "pending") {
pendingSpecCount++;
}
};
this.jasmineDone = function() {
var banner = find(".banner");
banner.appendChild(createDom("span", {className: "duration"}, "finished in " + timer.elapsed() / 1000 + "s"));
var alert = find(".alert");
alert.appendChild(createDom("span", { className: "exceptions" },
createDom("label", { className: "label", 'for': "raise-exceptions" }, "raise exceptions"),
createDom("input", {
className: "raise",
id: "raise-exceptions",
type: "checkbox"
})
));
var checkbox = find("input");
checkbox.checked = !env.catchingExceptions();
checkbox.onclick = onRaiseExceptionsClick;
if (specsExecuted < totalSpecsDefined) {
var skippedMessage = "Ran " + specsExecuted + " of " + totalSpecsDefined + " specs - run all";
alert.appendChild(
createDom("span", {className: "bar skipped"},
createDom("a", {href: "?", title: "Run all specs"}, skippedMessage)
)
);
}
var statusBarMessage = "" + pluralize("spec", specsExecuted) + ", " + pluralize("failure", failureCount);
if (pendingSpecCount) { statusBarMessage += ", " + pluralize("pending spec", pendingSpecCount); }
var statusBarClassName = "bar " + ((failureCount > 0) ? "failed" : "passed");
alert.appendChild(createDom("span", {className: statusBarClassName}, statusBarMessage));
var results = find(".results");
results.appendChild(summary);
summaryList(topResults, summary);
function summaryList(resultsTree, domParent) {
var specListNode;
for (var i = 0; i < resultsTree.children.length; i++) {
var resultNode = resultsTree.children[i];
if (resultNode.type == "suite") {
var suiteListNode = createDom("ul", {className: "suite", id: "suite-" + resultNode.result.id},
createDom("li", {className: "suite-detail"},
createDom("a", {href: specHref(resultNode.result)}, resultNode.result.description)
)
);
summaryList(resultNode, suiteListNode);
domParent.appendChild(suiteListNode);
}
if (resultNode.type == "spec") {
if (domParent.getAttribute("class") != "specs") {
specListNode = createDom("ul", {className: "specs"});
domParent.appendChild(specListNode);
}
specListNode.appendChild(
createDom("li", {
className: resultNode.result.status,
id: "spec-" + resultNode.result.id
},
createDom("a", {href: specHref(resultNode.result)}, resultNode.result.description)
)
);
}
}
}
if (failures.length) {
alert.appendChild(
createDom('span', {className: "menu bar spec-list"},
createDom("span", {}, "Spec List | "),
createDom('a', {className: "failures-menu", href: "#"}, "Failures")));
alert.appendChild(
createDom('span', {className: "menu bar failure-list"},
createDom('a', {className: "spec-list-menu", href: "#"}, "Spec List"),
createDom("span", {}, " | Failures ")));
find(".failures-menu").onclick = function() {
setMenuModeTo('failure-list');
};
find(".spec-list-menu").onclick = function() {
setMenuModeTo('spec-list');
};
setMenuModeTo('failure-list');
var failureNode = find(".failures");
for (var i = 0; i < failures.length; i++) {
failureNode.appendChild(failures[i]);
}
}
};
return this;
function find(selector) {
return getContainer().querySelector(selector);
}
function createDom(type, attrs, childrenVarArgs) {
var el = createElement(type);
for (var i = 2; i < arguments.length; i++) {
var child = arguments[i];
if (typeof child === 'string') {
el.appendChild(createTextNode(child));
} else {
if (child) {
el.appendChild(child);
}
}
}
for (var attr in attrs) {
if (attr == "className") {
el[attr] = attrs[attr];
} else {
el.setAttribute(attr, attrs[attr]);
}
}
return el;
}
function pluralize(singular, count) {
var word = (count == 1 ? singular : singular + "s");
return "" + count + " " + word;
}
function specHref(result) {
return "?spec=" + encodeURIComponent(result.fullName);
}
function setMenuModeTo(mode) {
htmlReporterMain.setAttribute("class", "html-reporter " + mode);
}
}
return HtmlReporter;
};
jasmineRequire.HtmlSpecFilter = function() {
function HtmlSpecFilter(options) {
var filterString = options && options.filterString() && options.filterString().replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
var filterPattern = new RegExp(filterString);
this.matches = function(specName) {
return filterPattern.test(specName);
};
}
return HtmlSpecFilter;
};
jasmineRequire.ResultsNode = function() {
function ResultsNode(result, type, parent) {
this.result = result;
this.type = type;
this.parent = parent;
this.children = [];
this.addChild = function(result, type) {
this.children.push(new ResultsNode(result, type, this));
};
this.last = function() {
return this.children[this.children.length - 1];
};
}
return ResultsNode;
};
jasmineRequire.QueryString = function() {
function QueryString(options) {
this.setParam = function(key, value) {
var paramMap = queryStringToParamMap();
paramMap[key] = value;
options.getWindowLocation().search = toQueryString(paramMap);
};
this.getParam = function(key) {
return queryStringToParamMap()[key];
};
return this;
function toQueryString(paramMap) {
var qStrPairs = [];
for (var prop in paramMap) {
qStrPairs.push(encodeURIComponent(prop) + "=" + encodeURIComponent(paramMap[prop]));
}
return "?" + qStrPairs.join('&');
}
function queryStringToParamMap() {
var paramStr = options.getWindowLocation().search.substring(1),
params = [],
paramMap = {};
if (paramStr.length > 0) {
params = paramStr.split('&');
for (var i = 0; i < params.length; i++) {
var p = params[i].split('=');
var value = decodeURIComponent(p[1]);
if (value === "true" || value === "false") {
value = JSON.parse(value);
}
paramMap[decodeURIComponent(p[0])] = value;
}
}
return paramMap;
}
}
return QueryString;
};

View File

@@ -0,0 +1,55 @@
body { background-color: #eeeeee; padding: 0; margin: 5px; overflow-y: scroll; }
.html-reporter { font-size: 11px; font-family: Monaco, "Lucida Console", monospace; line-height: 14px; color: #333333; }
.html-reporter a { text-decoration: none; }
.html-reporter a:hover { text-decoration: underline; }
.html-reporter p, .html-reporter h1, .html-reporter h2, .html-reporter h3, .html-reporter h4, .html-reporter h5, .html-reporter h6 { margin: 0; line-height: 14px; }
.html-reporter .banner, .html-reporter .symbol-summary, .html-reporter .summary, .html-reporter .result-message, .html-reporter .spec .description, .html-reporter .spec-detail .description, .html-reporter .alert .bar, .html-reporter .stack-trace { padding-left: 9px; padding-right: 9px; }
.html-reporter .banner .version { margin-left: 14px; }
.html-reporter #jasmine_content { position: fixed; right: 100%; }
.html-reporter .version { color: #aaaaaa; }
.html-reporter .banner { margin-top: 14px; }
.html-reporter .duration { color: #aaaaaa; float: right; }
.html-reporter .symbol-summary { overflow: hidden; *zoom: 1; margin: 14px 0; }
.html-reporter .symbol-summary li { display: inline-block; height: 8px; width: 14px; font-size: 16px; }
.html-reporter .symbol-summary li.passed { font-size: 14px; }
.html-reporter .symbol-summary li.passed:before { color: #5e7d00; content: "\02022"; }
.html-reporter .symbol-summary li.failed { line-height: 9px; }
.html-reporter .symbol-summary li.failed:before { color: #b03911; content: "x"; font-weight: bold; margin-left: -1px; }
.html-reporter .symbol-summary li.disabled { font-size: 14px; }
.html-reporter .symbol-summary li.disabled:before { color: #bababa; content: "\02022"; }
.html-reporter .symbol-summary li.pending { line-height: 17px; }
.html-reporter .symbol-summary li.pending:before { color: #ba9d37; content: "*"; }
.html-reporter .exceptions { color: #fff; float: right; margin-top: 5px; margin-right: 5px; }
.html-reporter .bar { line-height: 28px; font-size: 14px; display: block; color: #eee; }
.html-reporter .bar.failed { background-color: #b03911; }
.html-reporter .bar.passed { background-color: #a6b779; }
.html-reporter .bar.skipped { background-color: #bababa; }
.html-reporter .bar.menu { background-color: #fff; color: #aaaaaa; }
.html-reporter .bar.menu a { color: #333333; }
.html-reporter .bar a { color: white; }
.html-reporter.spec-list .bar.menu.failure-list, .html-reporter.spec-list .results .failures { display: none; }
.html-reporter.failure-list .bar.menu.spec-list, .html-reporter.failure-list .summary { display: none; }
.html-reporter .running-alert { background-color: #666666; }
.html-reporter .results { margin-top: 14px; }
.html-reporter.showDetails .summaryMenuItem { font-weight: normal; text-decoration: inherit; }
.html-reporter.showDetails .summaryMenuItem:hover { text-decoration: underline; }
.html-reporter.showDetails .detailsMenuItem { font-weight: bold; text-decoration: underline; }
.html-reporter.showDetails .summary { display: none; }
.html-reporter.showDetails #details { display: block; }
.html-reporter .summaryMenuItem { font-weight: bold; text-decoration: underline; }
.html-reporter .summary { margin-top: 14px; }
.html-reporter .summary ul { list-style-type: none; margin-left: 14px; padding-top: 0; padding-left: 0; }
.html-reporter .summary ul.suite { margin-top: 7px; margin-bottom: 7px; }
.html-reporter .summary li.passed a { color: #5e7d00; }
.html-reporter .summary li.failed a { color: #b03911; }
.html-reporter .summary li.pending a { color: #ba9d37; }
.html-reporter .description + .suite { margin-top: 0; }
.html-reporter .suite { margin-top: 14px; }
.html-reporter .suite a { color: #333333; }
.html-reporter .failures .spec-detail { margin-bottom: 28px; }
.html-reporter .failures .spec-detail .description { background-color: #b03911; }
.html-reporter .failures .spec-detail .description a { color: white; }
.html-reporter .result-message { padding-top: 14px; color: #333333; white-space: pre; }
.html-reporter .result-message span.result { display: block; }
.html-reporter .stack-trace { margin: 5px 0 0 0; max-height: 224px; overflow: auto; line-height: 18px; color: #666666; border: 1px solid #ddd; background: white; white-space: pre; }

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long