Krinkle has uploaded a new change for review.
https://gerrit.wikimedia.org/r/50374
Change subject: jquery.badge: Add ability to display the number zero.
......................................................................
jquery.badge: Add ability to display the number zero.
Cupcake ipsum dolor sit. Amet tart cheesecake tiramisu chocolate cake
topping. Icing ice cream sweet roll. Biscuit dragée toffee wypas.
I love tootsie roll donut oat cake soufflé. Chupa chups danish carrot
cake. I love chocolate candy cookie sesame snaps sesame snaps lollipop
carrot cake.
Sweet roll dragée bear claw cheesecake dragée. Icing apple pie
macaroon carrot cake I love I love ice cream sweet roll. Brownie
powder bonbon marshmallow dessert liquorice I love tiramisu.
Follows-up Id5e7cbb1.
Bug: 1234
Change-Id: I88c5f819c42d9fe1468be6b2cf74413d7d6d6907
---
A smoigel/.jshintrc
A smoigel/LICENSE.txt
A smoigel/Origin.js
A smoigel/README.md
4 files changed, 118 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/test/mediawiki
refs/changes/74/50374/1
diff --git a/smoigel/.jshintrc b/smoigel/.jshintrc
new file mode 100644
index 0000000..32d942e
--- /dev/null
+++ b/smoigel/.jshintrc
@@ -0,0 +1,14 @@
+{
+ // Restrict
+ "strict": false,
+
+ // Tolerate
+
+ // Environment
+ "node": true,
+ "es5": true,
+
+ // Legacy
+ "white": true,
+ "nomen": false
+}
diff --git a/smoigel/LICENSE.txt b/smoigel/LICENSE.txt
new file mode 100644
index 0000000..4cbe10d
--- /dev/null
+++ b/smoigel/LICENSE.txt
@@ -0,0 +1,20 @@
+Copyright (c) 2012-2013 Timo Tijhof
+
+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.
diff --git a/smoigel/Origin.js b/smoigel/Origin.js
new file mode 100644
index 0000000..88fca5d
--- /dev/null
+++ b/smoigel/Origin.js
@@ -0,0 +1,81 @@
+/*global
+ Registry, TraditionRegistry,
+ Color,
+ Fruit, PearFruit,
+ Event, BirthdayEvent, TransferEvent,
+ Basket, BigBasket, FruitBigBasket,
+ Human, MaleHuman, FemaleHuman,
+ InvalidArgumentError
+*/
+var util = require('util');
+
+/**
+ * "Origin"
+ *
+ * Based on a scene from an episode of Friday Night Dinner.
+ *
+ * @package Smoigel
+ * @author Timo Tijhof, 2013
+ */
+
+var traditions = TraditionRegistry.getSingleton();
+
+var e = new TransferEvent({
+ spec: {
+ from: {
+ instanceof: Human
+ },
+
+ items: [SmoigelBasket],
+
+ /**
+ * Custom validation.
+ * @param {Human} target
+ * @param {Event} concurrentEvent Instance of spec.when.
+ * @return {boolean}
+ */
+ to: function (target, concurrentEvent) {
+ // To the eldest son of the family, so, a male.
+ return target instanceof MaleHuman &&
+ // Validate the target is a child in the family
of the home
+ // the party subject lives in. Not a sibling
per se, because
+ // he or she could be either a child or a
parent.
+ // The gift should be given to the eldest son
of the family he lives in
+ // (not of the family the object is born in,
per se).
+
concurrentEvent.getSubject().getHomeFamily().getChildren().toArray().indexOf(target)
!== -1 &&
+ // Finally confirm he has no older siblings.
+ target.siblings.sort(function (a, b) {
+ return a.age < b.age;
+ })[0] === target;
+ },
+ when: BirthdayEvent
+ }
+});
+
+/**
+ * A non-empty basket of green-coloured fruits
+ * that are not pears.
+ *
+ * @class
+ * @extends FruitBigBasket
+ *
+ * @constructor
+ * @param {Array} items
+ * @throws {InvalidArgumentError} If basket contains unexpected items.
+ */
+function SmoigelBasket(items) {
+ SmoigelBasket.super_.apply(this, arguments);
+
+ if (
+ !items.length ||
+ items.some(function (item) {
+ return
!item.color.isLike(Color.newFromKeyword('green')) || item instanceof PearFruit;
+ })
+ ) {
+ throw new InvalidArgumentError();
+ }
+}
+
+util.inherits(SmoigelBasket, FruitBigBasket);
+
+traditions.addEvent(e);
diff --git a/smoigel/README.md b/smoigel/README.md
new file mode 100644
index 0000000..9d77767
--- /dev/null
+++ b/smoigel/README.md
@@ -0,0 +1,3 @@
+# [Smoigel](https://github.com/Krinkle/smoigel)
+
+_Stories written in code_
--
To view, visit https://gerrit.wikimedia.org/r/50374
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I88c5f819c42d9fe1468be6b2cf74413d7d6d6907
Gerrit-PatchSet: 1
Gerrit-Project: test/mediawiki
Gerrit-Branch: master
Gerrit-Owner: Krinkle <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits