[Common UI] Initial commonUI bundles

Bring in work on general-purpose and over-arching
user interface bundles from the sandbox transition
branch. WTD-574.
This commit is contained in:
Victor Woeltjen
2014-11-23 15:41:20 -08:00
parent 0cd331e8a5
commit 1b0303e517
73 changed files with 6035 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
/*global define,screenfull,Promise*/
/**
* Module defining FullscreenAction. Created by vwoeltje on 11/18/14.
*/
define(
["../../lib/screenfull.min"],
function () {
"use strict";
var ENTER_FULLSCREEN = "Enter full screen mode.",
EXIT_FULLSCREEN = "Exit full screen mode.";
/**
*
* @constructor
*/
function FullscreenAction(context) {
return {
perform: function () {
screenfull.toggle();
},
getMetadata: function () {
// We override getMetadata, because the glyph and
// description need to be determined at run-time
// based on whether or not we are currently
// full screen.
var metadata = Object.create(FullscreenAction);
metadata.glyph = screenfull.isFullscreen ? "_" : "z";
metadata.description = screenfull.isFullscreen ?
EXIT_FULLSCREEN : ENTER_FULLSCREEN;
metadata.group = "windowing";
metadata.context = context;
return metadata;
}
};
}
return FullscreenAction;
}
);