jamiepollock / Umbraco-KonamiCode

Adding in a service to pick up the Konami Code in the backoffice

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Umbraco Konami Code

A simple Angular JS service which allows an Umbraco Angular JS to listen for the Konami Code key input and then produce a given callback.

Up, Up, Down, Down, Left, Right, Left, Right, A, B

Usage

To use the Konami Code, simply use the konamiCode service in a controller. Currently the intent is for it to be registered once per controller view.

'use strict';
angular.module("umbraco").controller("MyWebsite.BackofficeApp.Controller",
    function ($scope, konamiCode, notificationsService) {
        konamiCode.register(function() {
            notificationsService.add({
                type: "success",
                headline: "Success",
                message: "Konami Code activated!",
                url: "https://en.wikipedia.org/wiki/Konami_Code"
            });
        });

        // The rest of your controller code
    });

Adding this code to say multiple dashboard controllers will cause the event listener to register multiple times.

About

Adding in a service to pick up the Konami Code in the backoffice

License:MIT License


Languages

Language:C# 33.8%Language:JavaScript 32.3%Language:Batchfile 19.7%Language:PowerShell 14.2%