diff --git a/doc/custom-widget.html b/doc/custom-widget.html new file mode 100644 index 00000000..de354bcc --- /dev/null +++ b/doc/custom-widget.html @@ -0,0 +1,163 @@ + + + + + + + Create a Custom Widget - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

Create a Custom Widget

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+
+

Creating a PhotonUI widget is not difficult, but you will need to learn a few things about how PhotonUI is built and works behind the scene, especially the Class system, the widgets hierarchy and the automagical functionality of the Base PhotonUI class (photonui.Base).

+

Also, I recommend you take a look at the class reference documentation and the existing widgets to have a better understanding of how widgets work.

+

Abitbol: The Heart of The PhotonUI Class System

Abitbol is a tiny javascript library that provides an handful (es5) class système.

+

Dealing With Classes

Declaring a class using Abitbol is very simple:

+
1
2
3
4
5
6
7
8
9
10
var MyClass = photonui.lib.Class.$extend({

__init__: function(param1, param2) {
// Constructor code here...
},

myMethod: function(param1, param2) {
// Code of myMethod here...
}
});
+

… and using it is straightforward:

+
1
2
var foo = new MyClass(param1, param2);
foo.myMethod(param1, param2);
+

Extending an existing class is also simple:

+
1
2
3
4
5
6
7
8
9
10
11
var MySecondClass = MyClass.$extend({

myMethod: function(param1, param2) {
this.$super(param1, param2); // Call the myMethod of the parent class
// Some more stuff...
},

mySecondMethod: function() {
// Code for mySecondMethod...
}
});
+

Automagical Properties

Abitbol automatically creates properties from available getters and setters. To understand the principle, let’s study a simple example:

+
1
2
3
4
5
6
7
8
9
10
11
12
13
var Person = photonui.lib.Class.$extend({

_firstName: "", // !!!!!! NOTE¹

getFirstName: function() {
return this._firstName;
},

setFirstName: function(firstName) {
this._firstName = firstName.toLocaleLowerCase();
}

});
+

There are many ways to get and set the firstName of the Person class:

+
1
2
3
4
5
6
7
8
9
10
// When instantiating the class
var p = new Person({firstName: "Anakin"});

// Using getter and setter
p.setFirstName("Leia");
var name = p.getFirstName();

// Using the automagically created property
p.firstName = "Han";
var name = p.firstName;
+

NOTE¹: Pay attention to the underscore when we defined the _firstName attribute. Since the firstName property will be automatically created by the abitbol class, you will create an infinite loop if you name your private property the same way.

+

Going Deeper With Abitbol

Abitbol provides a lot of other interesting functionalities like annotations, “mixin” and class vars… For more information read the Abitbol documentation.

+

The “photonui.Base” Class

In PhotonUI, no widget directly extends the Abitbol’s Class. All widgets extend at least the photonui.Base class, and most often, the photonui.Widget class.

+

About The Constructor Method

The constructor method of all PhotonUI widgets always calls the constructor method of the photonui.Base class, generally using the this.$super(params). The constructor method of each widgets also always takes one argument: a parameter object that should be passed to the photonui.Base class constructor.

+

A simple example to understand:

+
1
2
3
4
5
6
7
8
var MyWidget = photonui.Widget.$extend({

__init__: function(params) {
this.$super(params);
// Your constructor code here...
}

});
+

Choosing The Right Base Class

When you create a PhotonUI widget, you will extend different classes depending on what kind of widget you want to create.

+

There are 5 main types of widgets in PhotonUI:

+ +

Of course, if you want to build a more specific widget, you can extend more specialized classes.

+

Minimal Widget Templates

Depending on what kind of widget you want to create, you will inherit from different classes, and you will have to define different methods to make things work.

+

Template for “Non-Visual” Widgets

Non-visual widgets have no specific method to override to make things work:

+
1
2
3
4
5
var MyWidget = photonui.Base.$extend({

// Your methods and attributes here

});
+

You can however override the destroy method if it is relevant:

+
1
2
3
4
destroy: function() {
// Clean things here...
this.$super();
}
+

Template for “Interactive” and “Visual-Only” Widgets

For interactive and visual widgets, you should at least implement the getHtml and the _buildHtml methods:

+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
var MyWidget = photonui.Widget.$extend({

__init__: function(params) {
this.$super(params);
// Widget constructor...
},

getHtml: function() {
// Return the outer HTML element of the widget
return this.__html.div;
},

_buildHtml: function() {
// We build the widget's HTML in this method.

// All the HTML nodes go in the "this.__html" object
this.__html.div = document.createElement("div");

// All PhotonUI Widget have the "photonui-wiget" class on their
// outer HTML elements
this.__html.div.className = "photonui-widget photonui-mywidget";
}

});
+

Template for “Container” Widgets

The container widgets have the same methods as the interactive and visual widgets plus getContainerNode:

+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
var MyWidget = photonui.Container.$extend({

__init__: function(params) {
this.$super(params);
// Widget constructor
},

getHtml: function() {
return null; // Return the outer HTML element of the widget
},

getContainerNode: function() {
return null; // Return the HTML node that will contain the child
},

_buildHtml: function() {
// Build the HTML here
}

});
+

Template for “Layout” Widgets

The layout widgets are the most difficult to build: in addition to getHtml and _buildHtml methods, you have to implement the _updateLayout method which will have to build the HTML that glues children widgets together in the layout.

+

You can look at the photonui.BoxLayout code if you want a simple example of a layout widget.

+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
var MyWidget = photonui.Layout.$extend({

__init__: function(params) {
this.$super(params);
// Widget constructor...
},

getHtml: function() {
return null; // Return the outer HTML element of the widget
},

_buildHtml: function() {
// Build the base HTML here
},

_updateLayout: function() {
// Build / Update the HTML layout with the widgets listed in
// this.children
},

});
+

Example: Creating a Simple Button Widget

No more theory, let’s build a real widget: a simple button with a text property to define… the button’s text, a click wEvent, and even the internationalisation support.

+

HTML and Basic Code

Here we just apply everything we saw before to create the visual part of the button. You can also add a bit of CSS to make it look better, but that’s not the topic.

+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
var SimpleButton = photonui.Widget.$extend({

__init__: function(params) {
this.$super(params);
},

getHtml: function() {
return this.__html.button;
},

_buildHtml: function() {
this.__html.button = document.createElement("button");
this.__html.button.className = "photonui-widget photonui-simplebutton";
}

});
+

The “text” Property

Then we add our text property that allows to set the button’s text:

+
1
2
3
4
5
6
7
8
9
10
11
_text: "Button",

getText: function() {
return this._text;
},

setText: function(text) {
this._text = text;
photonui.Helpers.cleanNode(this.__html.button);
this.__html.button.appendChild(document.createTextNode(text));
}
+

NOTE: The code as we wrote it here works, but if the user never sets the text property, the widget will not display the default text defined in the class (in the _text attribute) since the setter is never called. To force properties to be refreshed even when not set, you must use the @photonui-update annotation:

+
1
2
3
4
getText: function() {
"@photonui-update";
return this._text;
},
+

This abitbol’s annotation can go either in the getter function or in the setter function. It must be at the top of the function code.

+

Adding Interactivity (wEvent)

There are two kinds of events to deal with when you build a PhotonUI widget:

+
    +
  • The native javascript events, that will be used only behind the scene by the widget,

    +
  • +
  • and the wEvents, that are exposed through the widget API

    +
  • +
+

So the widget binds native js event to its DOM elements and can expose a corresponding wEvent if required.

+

First, we have to declare the available wEvents of the widget. This can be done with the _registerWEvents:

+
1
2
3
4
__init__: function(params) {
...
this._registerWEvents(["click"]);
}
+

Then, we have to bind the native javascript click event to the button. To bind native js events, PhotonUI provides an event manager that will automatically unbind the events when the widget is destroyed; you can use it through two methods: _bindEvent and _unbindEvent.

+
1
2
3
4
5
6
7
8
9
__init__: function(params) {
...
this._bindEvent(
"button-click", // id (any string you want, unique in the widget)
this.__html.button, // HTML element
"click", // Native event name
this.__onButtonClicked.bind(this) // Internal (private) callback
);
}
+

Finally we create our internal callback that will be in charge of calling the callbacks of our wEvent using the _callCallbacks method:

+
1
2
3
4
5
6
__onButtonClicked: function(event) {
this._callCallbacks(
"click", // wEvent name
[event] // List of additionnal params passed to the callbacks
);
}
+

NOTE: The first argument of all the wEvent callbacks is always the widget that called it:

+
1
2
3
function myWEventCallback( widget [, additionalParam1 [, additionalParam2 [, ...]]] ) {
// Callback code here
}
+

The Final Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
var SimpleButton = photonui.Widget.$extend({

__init__: function(params) {
// /!\ WARNING: we have to register wEvents BEFORE calling
// the parent constructor, otherwise the declarative syntax will
// fail to register the callbacks...
this._registerWEvents(["click"]);

this.$super(params);

this._bindEvent(
"button-click",
this.__html.button,
"click",
this.__onButtonClicked.bind(this)
);
},

_text: "Button",

getText: function() {
"@photonui-update";
return this._text;
},

setText: function(text) {
this._text = text;
photonui.Helpers.cleanNode(this.__html.button);
this.__html.button.appendChild(document.createTextNode(text));
},

getHtml: function() {
return this.__html.button;
},

_buildHtml: function() {
this.__html.button = document.createElement("button");
this.__html.button.className = "photonui-widget photonui-simplebutton";
},

__onButtonClicked: function(event) {
this._callCallbacks("click", [event]);
}

});


// A bit of code to test our widget
var btn = new SimpleButton({
text: "My First Widget",
callbacks: {
click: function(widget, event) {
alert("Button clicked!");
}
}
});

photonui.domInsert(btn, "demo");
+

Here We Are

Voilà, you created your first PhotonUI widget. Not too difficult right ? ;)

+ +
+
+ + +
+ + + + + + + + diff --git a/doc/data-views.html b/doc/data-views.html new file mode 100644 index 00000000..0d59cebd --- /dev/null +++ b/doc/data-views.html @@ -0,0 +1,160 @@ + + + + + + + Data views - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

Data views

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+
+

Data views are PhotoUI Widgets that can display a list of data items and provide basic events on those.

+

There are five classes:

+ +

DataView

The base class of data view is photonui.DataView

+

It takes a parameter items as an array of key-value object.

+

By default, the photonui.DataView renders as below:

+
    +
  • The list is a <ul> HTML element.
  • +
  • Each item is a <li> element
  • +
  • Each property of an item can be defined as a “column”, rendered with a <span>
  • +
+
1
2
3
4
5
6
7
8
var dataview = new photonui.DataView({
items: [
{ name: "John", count: 2, color: "red" },
{ name: "Jane", count: 4, color: "blue" },
{ name: "Janeth", count: 12, color: "green" }
],
});
photonui.domInsert(dataview, "demo");
+

Those HTML elements can be override with parameters

+
1
2
3
4
5
6
7
8
9
10
11
var dataview = new photonui.DataView({
containerElement: "table",
itemElement: "tr",
columnElement: "td",
items: [
{ name: "John", count: 2, color: "red" },
{ name: "Jane", count: 4, color: "blue" },
{ name: "Janeth", count: 12, color: "green" }
],
});
photonui.domInsert(dataview, "demo");
+

Columns

Columns can be manually defined as DataView parameter, in different ways:

+
    +
  • by property name
  • +
  • with an id and a function returning a value
  • +
  • with an id and a function returning a photonui.Widget
  • +
+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
var dataview = new photonui.DataView({
items: [
{ name: "John", count: 2, color: "red" },
{ name: "Jane", count: 4, color: "blue" },
{ name: "Janeth", count: 12, color: "green" }
],
columns: [
"count",
{
id: "name",
label: "Name",
value: function(item) {
return `My name is ${item.name}`
}
},
{
id: "color",
label: "Color",
value: function(item) { // define value to display
return new photonui.ColorButton({ value: item.color })
}
}

]
});
photonui.domInsert(dataview, "demo");
+

Custom Widget Formater

To override this item column rendering, we can define a customWidgetFormater to build a photonui.Widget for each row.

+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
var dataview = new photonui.DataView({
containerElement: "div",
itemElement: "div",
items: [
{ name: "John", count: 2 },
{ name: "Jane", count: 4 },
{ name: "Janeth", count: 12 }
],
customWidgetFormater: function(item) {
return new photonui.BoxLayout({
orientation: "horizontal",
children: [
new photonui.Label(item.name),
new photonui.NumericField({ value: item.count })
]
});
}
});

photonui.domInsert(dataview, "demo");
+

Drag and drop

Drag and drop behaviour can be enabled to change items order.

+

A callback on event item-sort can be defined.

+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
var dataview = new photonui.DataView({
dragAndDroppable: true,
items: [
{ name: "John", count: 2 },
{ name: "Jane", count: 4 },
{ name: "Janeth", count: 12 }
],
columns: [ "name", "count"],
callbacks: {
"item-sort": function(event, item) {
item.value.count++;
}
},
});

photonui.domInsert(dataview, "demo");
+

Click event

A callback item-click can be defined

+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
var dataview = new photonui.DataView({
items: [
{ name: "John", count: 2 },
{ name: "Jane", count: 4 },
{ name: "Janeth", count: 12 }
],
columns: [
{
id: "name",
value: function(item) { return `${item.name}: ` }
},
"count"
],
callbacks: {
"item-click": function(event, item) {
item.value.count++;
item.node.querySelector(".photonui-dataview-column-count")
.innerText = item.value.count;
},
}
});

photonui.domInsert(dataview, "demo");
+

Selection

photonui.DataView handles selection and multiselection of items. Default parameters are:

+
    +
  • selectable: true
  • +
  • multiSelectable: false
  • +
+

There are callbacks for item-select and item-unselect. When an item is selected, its HTML node get the CSS class selected.

+

Multi-selection is handled by Ctrl+Click.

+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
var dataview = new photonui.DataView({
selectable: true, // default: true
multiSelectable: true, // default: false
items: [
{ name: "John", count: 2 },
{ name: "Jane", count: 4 },
{ name: "Janeth", count: 12 }
],
columns: [
{
id: "name",
value: function(item) { return `${item.name}: ` }
},
"count"
],
callbacks: {
"item-select": function(event, item) {
item.node.style.fontWeight = "bold"
},
"item-unselect": function(event, item) {
item.node.style.fontWeight = ""
},
}
});
photonui.domInsert(dataview, "demo");
+

ListView

ListView is just a stylized DataView with <ul>, <li> and <span> HTML elements.

+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
var listview = new photonui.ListView({
items: [
{ name: "John", count: 2 },
{ name: "Jane", count: 4 },
{ name: "Janeth", count: 12 }
],
columns: [
{
id: "name",
value: function(item) { return `${item.name}: ` }
},
"count"
],
});

photonui.domInsert(listview, "demo");
+

TableView

photonui.TableView is a DataView that renders as a <table> HTML element.

+
    +
  • There is a header for column labels
      +
    • the header can be hidden with parameter showHeader: false
    • +
    +
  • +
  • Rows are <tr> HTML Elements
  • +
  • Columns are <td> HTML Elements
  • +
+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
var tableview = new photonui.TableView({
items: [
{ name: "John", count: 2, color: "red" },
{ name: "Jane", count: 4, color: "blue" },
{ name: "Janeth", count: 12, color: "green" }
],
columns: [
"name",
"count",
{
id: "color",
label: "Color",
value: function(item) {
return new photonui.ColorButton({ value: item.color })
}
}
],
multiSelectable: true,
dragAndDroppable: true,
});

photonui.domInsert(tableview, "demo");
+

FluidView

photonui.TableView is a DataView that can render elements with fixed dimensions and spacing.
Items are displayed inline, until there is no space and goes to a new line.

+

Parameters are :

+
    +
  • itemsWidth
  • +
  • itemsHeight
  • +
  • verticalPadding
  • +
  • horizontalPadding
  • +
  • verticalSpacing
  • +
  • horizontalSpacing
  • +
+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
var fluidview = new photonui.FluidView({
containerElement: "div",
itemElement: "div",
columnElement: "div",
itemsWidth: 70,
itemsHeight: 30,
verticalPadding: 10,
horizontalPadding: 20,
verticalSpacing: 20,
horizontalSpacing: 10,
items: [
{ name: "Bicycle", icon: "fa-bicycle", color: "green" },
{ name: "Subway", icon: "fa-subway", color: "blue" },
{ name: "Train", icon: "fa-train", color: "red" },
{ name: "Car", icon: "fa-car", color: "yellow" },
{ name: "Ship", icon: "fa-ship", color: "cyan" },
{ name: "Plane", icon: "fa-plane", color: "magenta" },
],
columns: [
{
id: "icon",
label: "Icon",
value: function(item) {
return new photonui.FAIcon({
iconName: item.icon,
color: item.color,
})
}
},
"name",
],
});

photonui.domInsert(fluidview, "demo");
+

IconView

photonui.IconView is a DataView to display FAIcons or Images

+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
var iconview = new photonui.IconView({
iconWidth: 32,
iconHeight: 32,
items: [
{ faIcon: { iconName: "fa-bicycle" } },
{ faIcon: { iconName: "fa-subway" } },
{ faIcon: { iconName: "fa-train" } },
{ faIcon: { iconName: "fa-car" } },
{ faIcon: { iconName: "fa-ship" } },
{ faIcon: { iconName: "fa-plane" } },
],
});

photonui.domInsert(iconview, "demo");
+ +
+
+ + +
+ + + + + + + + diff --git a/doc/empty-demo.js b/doc/empty-demo.js new file mode 100644 index 00000000..217b2d60 --- /dev/null +++ b/doc/empty-demo.js @@ -0,0 +1 @@ +// Feel free to test some code here :) diff --git a/doc/index.html b/doc/index.html new file mode 100644 index 00000000..b4f402af --- /dev/null +++ b/doc/index.html @@ -0,0 +1,526 @@ + + + + + + + Documentation - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + + +
+
+

Documentation

+

Class reference

The full class reference documentation is built using Yuidoc and is available here:

+ +

Widgets

+ + + + +
+
+ +
+ + + + + + + + diff --git a/doc/quick-start.html b/doc/quick-start.html new file mode 100644 index 00000000..02689480 --- /dev/null +++ b/doc/quick-start.html @@ -0,0 +1,147 @@ + + + + + + + Quick Start - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

Quick Start

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+
+

Welcome to the PhotonUI quick start guide. If you want to learn how to build a UI using PhotonUI, you are in the right place.

+

Get PhotonUI

Standalone Version

To start using the standalone version of PhotonUI in your projects, you first need to download it:

+ +

All the files you need are in the dist folder. You just have to import

+
    +
  • photonui-base.css (must be imported first),

    +
  • +
  • photonui-theme-particle.css,

    +
  • +
  • andphotonui.js (or photonui.min.js)

    +
  • +
+

in your page:

+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Boilerplate</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<link type="text/css" rel="stylesheet" href="photonui/photonui-base.css" />
<link type="text/css" rel="stylesheet" href="photonui/photonui-theme-particle.css" />
<script src="photonui/photonui.js"></script>

</head>
<body>
</body>
</html>
+

NPM and Browserify

If you are using Browserify in your project, a NPM package is available. To install it, juste type:

+
1
npm install --save photonui
+

then, to use it in your project you just have to import PhotonUI:

+
1
var photonui = require("photonui");
+

NOTE: do not forget to import CSS files in your HTML page:

+
1
2
<link rel="stylesheet" href="./node_modules/photonui/dist/photonui-base.css" />
<link rel="stylesheet" href="./node_modules/photonui/dist/photonui-theme-particle.css" />
+

Using Your First Widgets

Some widgets, like photonui.Window are “root widgets” ; that means they don’t need a parent to be displayed on the page. To use a root widget, you just have to instantiate its class with the desired parameters:

+
1
2
3
4
5
6
var win = new photonui.Window({
title: "Hello World",
height: 100,
x: 100, y: 400,
visible: true
});
+

The majority of the widgets are not “root widgets”, they need a parent to be displayed.

+

You can give them any DOM element as parent:

+
1
2
3
4
5
// Create a button
var btn = new photonui.Button();

// and insert it in the HTML element whose id is "demo"
photonui.domInsert(btn, "demo");
+

… or any PhotonUI widget that can contain other widgets (“container” and “layout” widgets):

+
1
2
3
4
5
6
7
8
9
10
11
12
13
// Create a window
var win = new photonui.Window({
title: "Hello World",
padding: 10,
x: 100, y: 400,
visible: true
});

// Create a button
var btn = new photonui.Button();

// Add the button in the window
win.child = btn;
+

Binding Events

Each PhotonUI Widget comes with a set of defined events (called wEvent) to which you can attach one or more callbacks.

+

For example, the photonui.Button widget has a click wEvent that is fired each time the user clicks on the button:

+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Create a button
var btn = new photonui.Button();

// define a callback for the "click" WEvent
function onBtnClicked(widget, event) {
alert("Button clicked!");
}
btn.registerCallback(
"clic-clac", // id (any string you want, must be unique for the widget)
"click", // wEvent (the name of the event)
onBtnClicked // callback (called when the wEvent is fired)
);

// and insert it in the HTML element whose id is "demo"
photonui.domInsert(btn, "demo");
+

Building More Complex UI Using Layouts

There are 5 main types of widgets in PhotonUI:

+ +

So if we want to create a window with two buttons inside, we will need to use a layout. The most basic and simple layout widget is photonui.BoxLayout. Let’s use it to build our UI:

+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Create each widget of the UI
var win = new photonui.Window({
title: "Layout Example",
x: 100, y: 400,
visible: true
});

var box = new photonui.BoxLayout({
orientation: "vertical"
});

var btn1 = new photonui.Button({
text: "Button 1"
});

var btn2 = new photonui.Button({
text: "Button 2"
});

// Build the UI using the layout
box.addChild(btn1); // Alternative syntax:
box.addChild(btn2); // box.children = [btn1, btn2];

win.child = box;

// Add a callback to the first button
btn1.registerCallback("foobar", "click", function(widget, event) {
alert("Button clicked!");
});
+

One more thing

In the examples above, we “manually” built the UI by declaring several variables to store widgets and then assembling everything. There is a more efficient way to build your UI (called “declarative way”) that is used in most of the example of the PhotonUI documentation.

+

Let’s rewrite our last example (the window with two buttons) in the declarative way:

+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
new photonui.Window({
title: "Layout Example",
x: 100, y: 400,
visible: true,
child: new photonui.BoxLayout({
orientation: "vertical",
children: [
new photonui.Button({
text: "Button 1",
callbacks: {
click: function(widget, event) {
alert("Button clicked!");
}
}
}),
new photonui.Button({
text: "Button 2"
})
]
})
});
+

Here We Are

You are now ready to start using PhotonUI on your own project. :)

+ +
+
+ + +
+ + + + + + + + diff --git a/doc/widgets/accelmanager.html b/doc/widgets/accelmanager.html new file mode 100644 index 00000000..1f1710a6 --- /dev/null +++ b/doc/widgets/accelmanager.html @@ -0,0 +1,132 @@ + + + + + + + AccelManager - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

AccelManager

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+
+

This component allows you to easily implement keyboard accelerators (aka shortcuts) in your application. It is based on KeyboardJS.

+

Please read the KeyboardJS documentation for more information about the keyboard combo composition and syntax:

+ +

NOTE: By default, accelerators are disabled if a field is focused (this behavior can be changed, as shown in the Ctrl + R example above).

+

Class Reference

+ +
+
+ + +
+ + + + + + + + diff --git a/doc/widgets/accelmanager.js b/doc/widgets/accelmanager.js new file mode 100644 index 00000000..da84f45c --- /dev/null +++ b/doc/widgets/accelmanager.js @@ -0,0 +1,31 @@ +// We add a field to test accels +var field = new photonui.TextField({ + value: "Text Field" +}); +photonui.domInsert(field, "demo"); + +// ... And a label to display things +var label = new photonui.Label({text: ""}); +photonui.domInsert(label, "demo"); + +// We create the accel +var accel = new photonui.AccelManager(); + +// "Ctrl+A" / "Command+A" accelerator that is disabled if +// a field is focused +accel.addAccel("accel1", "ctrl + a", function() { + label.text += "'Ctrl + A' accelerator\n"; +}); +accel.addAccel("accel1-mac", "command + a", function() { + label.text += "'Command + A' accelerator\n"; +}); + +// "Ctrl+R" accelerator that works even if the field is focused +accel.addAccel("accel3", "ctrl + r", function() { + label.text += "'Ctrl + R' accelerator\n"; +}, false); + +// A more complexe sequence (hold "Ctrl+X", and then press "C") +accel.addAccel("accel4", "ctrl + x > c", function() { + label.text += "'Ctrl + X > C' accelerator\n"; +}); diff --git a/doc/widgets/accelmanager.png b/doc/widgets/accelmanager.png new file mode 100644 index 00000000..98af33b5 Binary files /dev/null and b/doc/widgets/accelmanager.png differ diff --git a/doc/widgets/accelmanager.svg b/doc/widgets/accelmanager.svg new file mode 100644 index 00000000..a590f667 --- /dev/null +++ b/doc/widgets/accelmanager.svg @@ -0,0 +1,112 @@ + + + + + + + + + + image/svg+xml + + + + + + + Ctrl + + C + + + + + diff --git a/doc/widgets/boxlayout-horizontalpadding.png b/doc/widgets/boxlayout-horizontalpadding.png new file mode 100644 index 00000000..6ef33dc1 Binary files /dev/null and b/doc/widgets/boxlayout-horizontalpadding.png differ diff --git a/doc/widgets/boxlayout-horizontalpadding.svg b/doc/widgets/boxlayout-horizontalpadding.svg new file mode 100644 index 00000000..1ab71b73 --- /dev/null +++ b/doc/widgets/boxlayout-horizontalpadding.svg @@ -0,0 +1,554 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + Widget 1 + + + + Widget 2 + + + + Widget 3 + + + + Widget 4 + + + + orientation: vertical + orientation: horizontal + + + + + W1 + + + + W2 + + + + W3 + + + + W4 + + horizontalPadding + + + horizontalPadding + + + + diff --git a/doc/widgets/boxlayout-lo-align.png b/doc/widgets/boxlayout-lo-align.png new file mode 100644 index 00000000..b5735ce9 Binary files /dev/null and b/doc/widgets/boxlayout-lo-align.png differ diff --git a/doc/widgets/boxlayout-lo-align.svg b/doc/widgets/boxlayout-lo-align.svg new file mode 100644 index 00000000..0c8b9234 --- /dev/null +++ b/doc/widgets/boxlayout-lo-align.svg @@ -0,0 +1,346 @@ + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + orientation: vertical + orientation: horizontal + + + + + + stretch + + + + start + + + + center + + + + end + + + + stretch + + + + start + + + + center + + + + end + + + diff --git a/doc/widgets/boxlayout-orientation.png b/doc/widgets/boxlayout-orientation.png new file mode 100644 index 00000000..a7970475 Binary files /dev/null and b/doc/widgets/boxlayout-orientation.png differ diff --git a/doc/widgets/boxlayout-orientation.svg b/doc/widgets/boxlayout-orientation.svg new file mode 100644 index 00000000..72841714 --- /dev/null +++ b/doc/widgets/boxlayout-orientation.svg @@ -0,0 +1,349 @@ + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + orientation: vertical + orientation: horizontal + + + + + + + Widget 1 + + + + Widget 2 + + + + Widget 3 + + + + Widget 4 + + + + + W1 + + + + W2 + + + + W3 + + + + W4 + + + diff --git a/doc/widgets/boxlayout-spacing.png b/doc/widgets/boxlayout-spacing.png new file mode 100644 index 00000000..029bba5a Binary files /dev/null and b/doc/widgets/boxlayout-spacing.png differ diff --git a/doc/widgets/boxlayout-spacing.svg b/doc/widgets/boxlayout-spacing.svg new file mode 100644 index 00000000..c5863b12 --- /dev/null +++ b/doc/widgets/boxlayout-spacing.svg @@ -0,0 +1,582 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + Widget 1 + + + + Widget 2 + + + + Widget 3 + + + + Widget 4 + + + orientation: vertical + orientation: horizontal + + + + + W1 + + + + W2 + + + + W3 + + + + W4 + + spacing + + + + spacing + + + + diff --git a/doc/widgets/boxlayout-verticalpadding.png b/doc/widgets/boxlayout-verticalpadding.png new file mode 100644 index 00000000..436b4ef6 Binary files /dev/null and b/doc/widgets/boxlayout-verticalpadding.png differ diff --git a/doc/widgets/boxlayout-verticalpadding.svg b/doc/widgets/boxlayout-verticalpadding.svg new file mode 100644 index 00000000..997f4d33 --- /dev/null +++ b/doc/widgets/boxlayout-verticalpadding.svg @@ -0,0 +1,539 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + Widget 1 + + + + Widget 2 + + + + Widget 3 + + + + Widget 4 + + + orientation: vertical + orientation: horizontal + + + + + W1 + + + + W2 + + + + W3 + + + + W4 + + verticalPadding + + + verticalPadding + + + + diff --git a/doc/widgets/boxlayout.html b/doc/widgets/boxlayout.html new file mode 100644 index 00000000..3d88a901 --- /dev/null +++ b/doc/widgets/boxlayout.html @@ -0,0 +1,154 @@ + + + + + + + BoxLayout - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

BoxLayout

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+
+

photonui.BoxLayout is a layout widget that allows you to align widgets on vertical or horizontal boxes (1D grid).

+

Global Options

photonui.BoxLayout provides options to define its look and feel. Global options are applied to the layout itself.

+

orientation

Defines if the widgets must be displayed vertically or horizontally.

+

Possible values:

+
    +
  • vertical (default)
  • +
  • horizontal
  • +
+

BoxLayout Orientation Schema

+ + +

spacing

Defines the spacing between the widgets (5px by default).

+

BoxLayout Spacing Schema

+ + +

verticalPadding

Defines the spacing between the widgets and the left and right edges of the layout (0px by default).

+

BoxLayout Vertical Padding Schema

+ + +

horizontalPadding

Defines the spacing between the widgets and the top and bottom edges of the layout (0px by default).

+

BoxLayout Horizontal Padding Schema

+ + +

Layout Options

photonui.BoxLayout allows widgets to set plenty of options to customize the way they are displayed in the layout. Layout options are associated with only one widget of the layout.

+

align

Defines how the widget must be aligned in the layout.

+

Possible values:

+
    +
  • stretch (default, alias: expand): the widget is stretched to use all the available space in its box,

    +
  • +
  • start (alias: top, left): the widget is placed at the top or on the left of its box depending on the layout orientation,

    +
  • +
  • center (alias: middle): the widget is centered in its box,

    +
  • +
  • end (alias: bottom, right): the widget is placed at the bottom or on the right of its box depending on the layout orientation.

    +
  • +
+

BoxLayout Align Layout Option Schema

+ + +

order

Defines the order of the widgets (0 by default).

+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
var box = new photonui.BoxLayout({
children: [
new photonui.Button({
text: "Third",
layoutOptions: {
order: 42
}
}),
new photonui.Button({
text: "First",
layoutOptions: {
order: 1
}
}),
new photonui.Button({
text: "Second",
layoutOptions: {
order: 2
}
})
]
});

photonui.domInsert(box, "demo");
+

width

Defines the fixed width of the widget (default = null, null means “auto”).

+

minWidth

Defines the minimum width of the widget (default = null, null means no limitation).

+

maxWidth

Defines the maximum width of the widget (default = null, null means no limitation).

+

height

Defines the fixed height of the widget (default = null, null means “auto”).

+

minHeight

Defines the minimum height of the widget (default = null, null means no limitation).

+

maxHeight

Defines the maximum height of the widget (default = null, null means no limitation).

+

Class Reference

+

More examples

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
var box = new photonui.BoxLayout({
orientation: "vertical", // "vertical" or "horizontal"
spacing: 10, // spacing between widgets
children: [

// "align" layout option
new photonui.Button({
text: "align: stretch",
layoutOptions: {
align: "stretch" // default, alias: expand
}
}),
new photonui.Button({
text: "align: start",
layoutOptions: {
align: "start" // alias: left, top
}
}),
new photonui.Button({
text: "align: center",
layoutOptions: {
align: "center" // alias: middle
}
}),
new photonui.Button({
text: "align: end",
layoutOptions: {
align: "end" // alias: right, bottom
}
}),

// "order" layout option (if not defined, order = 0)
new photonui.Button({
text: "order: -1",
layoutOptions: {
order: -1,
}
}),
new photonui.Button({
text: "order: 2",
layoutOptions: {
order: 2,
}
}),
new photonui.Button({
text: "order: 1",
layoutOptions: {
order: 1,
}
}),

// widget sizing layout options
new photonui.Button({
text: "width: 100px",
layoutOptions: {
width: 100
}
}),
new photonui.Button({
text: "maxWidth: 200px",
layoutOptions: {
maxWidth: 200
}
}),
new photonui.Button({
text: "minWidth: 300px",
layoutOptions: {
minWidth: 300
}
}),
new photonui.Button({
text: "height: 100px",
layoutOptions: {
height: 100
}
}),
// ... and so on with minHeight and maxHeight

// Of course you can mix options
new photonui.Button({
text: "MIX",
layoutOptions: {
align: "center",
order: 42,
width: 100,
height: 100
}
}),
]
});

photonui.domInsert(box, "demo");
+ +
+
+ + +
+ + + + + + + + diff --git a/doc/widgets/boxlayout.js b/doc/widgets/boxlayout.js new file mode 100644 index 00000000..ede28ce7 --- /dev/null +++ b/doc/widgets/boxlayout.js @@ -0,0 +1,11 @@ +var box = new photonui.BoxLayout({ + orientation: "vertical", // "vertical" or "horizontal" + spacing: 5, // spacing between widgets + children: [ + new photonui.Button(), + new photonui.Button(), + new photonui.Button() + ] +}); + +photonui.domInsert(box, "demo"); diff --git a/doc/widgets/boxlayout.png b/doc/widgets/boxlayout.png new file mode 100644 index 00000000..3f1c5c03 Binary files /dev/null and b/doc/widgets/boxlayout.png differ diff --git a/doc/widgets/boxlayout.svg b/doc/widgets/boxlayout.svg new file mode 100644 index 00000000..d515b04f --- /dev/null +++ b/doc/widgets/boxlayout.svg @@ -0,0 +1,80 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/doc/widgets/button.html b/doc/widgets/button.html new file mode 100644 index 00000000..0bacee45 --- /dev/null +++ b/doc/widgets/button.html @@ -0,0 +1,108 @@ + + + + + + + Button - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

Button

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+
+

Class Reference

+

More examples

Icons

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
var grid = new photonui.GridLayout({
children: [
new photonui.Button({
text: "Options",
leftIcon: new photonui.FAIcon("fa-cog"),
layoutOptions: {
gridX: 0,
gridY: 0
}
}),
new photonui.Button({
textVisible: false,
leftIcon: new photonui.FAIcon("fa-cog"),
layoutOptions: {
gridX: 1,
gridY: 0
}
}),
new photonui.Button({
text: "Next",
rightIcon: new photonui.FAIcon("fa-arrow-right"),
layoutOptions: {
gridX: 0,
gridY: 1,
gridWidth: 2
}
})
]

});

photonui.domInsert(grid, "demo");
+

Alternative appearances and colors

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
var grid = new photonui.GridLayout({
children: [
new photonui.Button({
text: "default, normal",
layoutOptions: {
gridX: 0,
gridY: 0
}
}),
new photonui.Button({
text: "default, flat",
appearance: "flat",
layoutOptions: {
gridX: 1,
gridY: 0
}
}),

new photonui.Button({
text: "blue, normal",
buttonColor: "blue",
layoutOptions: {
gridX: 0,
gridY: 1
}
}),
new photonui.Button({
text: "blue, flat",
buttonColor: "blue",
appearance: "flat",
layoutOptions: {
gridX: 1,
gridY: 1
}
}),

new photonui.Button({
text: "red, normal",
buttonColor: "red",
layoutOptions: {
gridX: 0,
gridY: 2
}
}),
new photonui.Button({
text: "red, flat",
buttonColor: "red",
appearance: "flat",
layoutOptions: {
gridX: 1,
gridY: 2
}
}),

new photonui.Button({
text: "yellow, normal",
buttonColor: "yellow",
layoutOptions: {
gridX: 0,
gridY: 3
}
}),
new photonui.Button({
text: "yellow, flat",
buttonColor: "yellow",
appearance: "flat",
layoutOptions: {
gridX: 1,
gridY: 3
}
}),

new photonui.Button({
text: "green, normal",
buttonColor: "green",
layoutOptions: {
gridX: 0,
gridY: 4
}
}),
new photonui.Button({
text: "green, flat",
buttonColor: "green",
appearance: "flat",
layoutOptions: {
gridX: 1,
gridY: 4
}
})
]

});

photonui.domInsert(grid, "demo");
+ +
+
+ + +
+ + + + + + + + diff --git a/doc/widgets/button.js b/doc/widgets/button.js new file mode 100644 index 00000000..9401f4e3 --- /dev/null +++ b/doc/widgets/button.js @@ -0,0 +1,11 @@ +var btn = new photonui.Button({ + text: "My Button", + leftIcon: new photonui.FAIcon("fa-send"), + callbacks: { + click: function(widget, event) { + alert("Someone clicked on " + widget.text); + } + } +}); + +photonui.domInsert(btn, "demo"); diff --git a/doc/widgets/button.png b/doc/widgets/button.png new file mode 100644 index 00000000..5e3a414a Binary files /dev/null and b/doc/widgets/button.png differ diff --git a/doc/widgets/button.svg b/doc/widgets/button.svg new file mode 100644 index 00000000..14e0582d --- /dev/null +++ b/doc/widgets/button.svg @@ -0,0 +1,90 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + Button + + diff --git a/doc/widgets/canvas.html b/doc/widgets/canvas.html new file mode 100644 index 00000000..d6ff6b8a --- /dev/null +++ b/doc/widgets/canvas.html @@ -0,0 +1,117 @@ + + + + + + + Canvas - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

Canvas

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+ +
+ + +
+ + + + + + + + diff --git a/doc/widgets/canvas.js b/doc/widgets/canvas.js new file mode 100644 index 00000000..f42f6f8a --- /dev/null +++ b/doc/widgets/canvas.js @@ -0,0 +1,18 @@ +var canvas = new photonui.Canvas({ + width: 200, + height: 150 +}); + +photonui.domInsert(canvas, "demo"); + +var ctx = canvas.getContext("2d"); + +ctx.lineWidth = 3; +ctx.strokeStyle = "#DB624F"; + +ctx.beginPath(); +ctx.moveTo(10, 10); +ctx.lineTo(40, 140); +ctx.lineTo(50, 30); +ctx.lineTo(190, 100); +ctx.stroke(); diff --git a/doc/widgets/canvas.png b/doc/widgets/canvas.png new file mode 100644 index 00000000..a96e868d Binary files /dev/null and b/doc/widgets/canvas.png differ diff --git a/doc/widgets/canvas.svg b/doc/widgets/canvas.svg new file mode 100644 index 00000000..ebeebd36 --- /dev/null +++ b/doc/widgets/canvas.svg @@ -0,0 +1,81 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/doc/widgets/checkbox.html b/doc/widgets/checkbox.html new file mode 100644 index 00000000..0ab57536 --- /dev/null +++ b/doc/widgets/checkbox.html @@ -0,0 +1,101 @@ + + + + + + + CheckBox - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

CheckBox

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+
+

Class Reference

+

More examples

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
var grid = new photonui.GridLayout({
children: [
new photonui.CheckBox({
name: "checkbox1",
value: true,
layoutOptions: {
gridX: 0,
gridY: 0
},
callbacks: {
"value-changed": function(widget, value) {
alert(widget.name + " = " + value);
}
}
}),
new photonui.Label({
text: "CheckBox 1",
forInputName: "checkbox1",
layoutOptions: {
gridX: 1,
gridY: 0
}
})
]
});

photonui.domInsert(grid, "demo");
+ +
+
+ + +
+ + + + + + + + diff --git a/doc/widgets/checkbox.js b/doc/widgets/checkbox.js new file mode 100644 index 00000000..56f8c98d --- /dev/null +++ b/doc/widgets/checkbox.js @@ -0,0 +1,5 @@ +var check = new photonui.CheckBox({ + value: true +}); + +photonui.domInsert(check, "demo"); diff --git a/doc/widgets/checkbox.png b/doc/widgets/checkbox.png new file mode 100644 index 00000000..52cdcfa9 Binary files /dev/null and b/doc/widgets/checkbox.png differ diff --git a/doc/widgets/checkbox.svg b/doc/widgets/checkbox.svg new file mode 100644 index 00000000..47c71dfc --- /dev/null +++ b/doc/widgets/checkbox.svg @@ -0,0 +1,81 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/doc/widgets/color.html b/doc/widgets/color.html new file mode 100644 index 00000000..cbf939a7 --- /dev/null +++ b/doc/widgets/color.html @@ -0,0 +1,102 @@ + + + + + + + Color - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

Color

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+
+

photonui.Color is a class that abstracts colors. It supports two colorimetric spaces (RGB and HSL) and multiple representations (hexadecimal, CSS rgb()/rgba(),…).

+

To see it in action, please look at the photonui.ColorPickerDiaog documentation.

+

Class Reference

+

More examples

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
var color = new photonui.Color("red");

console.log(color.rgbHexString);
// "#FF0000"

console.log(color.rgbaHexString);
// "#FF0000FF"

console.log(color.cssRgbString);
// "rgb(255, 0, 0)"

console.log(color.cssRgbaString);
// "rgb(255, 0, 0, 1.00)"

console.log(color.getRGB());
// Array [ 255, 0, 0 ]

console.log(color.getRGBA());
// Array [ 255, 0, 0, 255 ]

console.log(color.red, color.green, color.blue);
// 255 0 0

console.log(color.hue, color.saturation, color.brightness);
// 0 100 100

color.brightness = 50;
console.log(color.rgbHexString);
// "#7F0000"

color.hue = 204;
console.log(color.rgbHexString);
// #004C7F
+ +
+
+ + +
+ + + + + + + + diff --git a/doc/widgets/color.js b/doc/widgets/color.js new file mode 100644 index 00000000..cd48dc82 --- /dev/null +++ b/doc/widgets/color.js @@ -0,0 +1,4 @@ +var color = new photonui.Color("red"); + +console.log(color.rgbHexString); +// "#FF0000" diff --git a/doc/widgets/color.png b/doc/widgets/color.png new file mode 100644 index 00000000..c1db4e3b Binary files /dev/null and b/doc/widgets/color.png differ diff --git a/doc/widgets/color.svg b/doc/widgets/color.svg new file mode 100644 index 00000000..83e4e392 --- /dev/null +++ b/doc/widgets/color.svg @@ -0,0 +1,66 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/doc/widgets/colorbutton.html b/doc/widgets/colorbutton.html new file mode 100644 index 00000000..d9a92be9 --- /dev/null +++ b/doc/widgets/colorbutton.html @@ -0,0 +1,106 @@ + + + + + + + ColorButton - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

ColorButton

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+ +
+ + +
+ + + + + + + + diff --git a/doc/widgets/colorbutton.js b/doc/widgets/colorbutton.js new file mode 100644 index 00000000..7c9aed28 --- /dev/null +++ b/doc/widgets/colorbutton.js @@ -0,0 +1,11 @@ +var btn = new photonui.ColorButton({ + value: "#4EC8DB", + callbacks: { + "value-changed": function(widget, value) { + var header = document.getElementsByTagName("header")[0]; + header.style.backgroundColor = value; + } + } +}); + +photonui.domInsert(btn, "demo"); diff --git a/doc/widgets/colorbutton.png b/doc/widgets/colorbutton.png new file mode 100644 index 00000000..dc0af438 Binary files /dev/null and b/doc/widgets/colorbutton.png differ diff --git a/doc/widgets/colorbutton.svg b/doc/widgets/colorbutton.svg new file mode 100644 index 00000000..7b7de00e --- /dev/null +++ b/doc/widgets/colorbutton.svg @@ -0,0 +1,86 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/doc/widgets/colorpalette.html b/doc/widgets/colorpalette.html new file mode 100644 index 00000000..80f3c96c --- /dev/null +++ b/doc/widgets/colorpalette.html @@ -0,0 +1,106 @@ + + + + + + + ColorPalette - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

ColorPalette

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+
+

Class Reference

+

More examples

Custom palette

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
var palette = new photonui.ColorPalette({
palette: [
["#D32F2F", "#F44336", "#E91E63", "#9C27B0", "#673AB7"],
["#3F51B5", "#2196F3", "#03A9F4", "#00BCD4", "#009688"],
["#4CAF50", "#8BC34A", "#CDDC39", "#FFEB3B", "#FFC107"],
["#FF9800", "#FF5722", "#795548", "#9E9E9E", "#607D8B"]
],
callbacks: {
"value-changed": function(widget, value) {
var header = document.getElementsByTagName("header")[0];
header.style.backgroundColor = value;
}
}
});

photonui.domInsert(palette, "demo");
+ +
+
+ + +
+ + + + + + + + diff --git a/doc/widgets/colorpalette.js b/doc/widgets/colorpalette.js new file mode 100644 index 00000000..9d70bc12 --- /dev/null +++ b/doc/widgets/colorpalette.js @@ -0,0 +1,10 @@ +var palette = new photonui.ColorPalette({ + callbacks: { + "value-changed": function(widget, value) { + var header = document.getElementsByTagName("header")[0]; + header.style.backgroundColor = value; + } + } +}); + +photonui.domInsert(palette, "demo"); diff --git a/doc/widgets/colorpalette.png b/doc/widgets/colorpalette.png new file mode 100644 index 00000000..e9da810c Binary files /dev/null and b/doc/widgets/colorpalette.png differ diff --git a/doc/widgets/colorpalette.svg b/doc/widgets/colorpalette.svg new file mode 100644 index 00000000..42cb532e --- /dev/null +++ b/doc/widgets/colorpalette.svg @@ -0,0 +1,157 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/widgets/colorpicker.html b/doc/widgets/colorpicker.html new file mode 100644 index 00000000..74184854 --- /dev/null +++ b/doc/widgets/colorpicker.html @@ -0,0 +1,106 @@ + + + + + + + ColorPicker - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

ColorPicker

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+ +
+ + +
+ + + + + + + + diff --git a/doc/widgets/colorpicker.js b/doc/widgets/colorpicker.js new file mode 100644 index 00000000..afdbe356 --- /dev/null +++ b/doc/widgets/colorpicker.js @@ -0,0 +1,11 @@ +var colorPicker = new photonui.ColorPicker({ + value: "#4EC8DB", + callbacks: { + "value-changed": function(widget, value) { + var header = document.getElementsByTagName("header")[0]; + header.style.backgroundColor = value; + } + } +}); + +photonui.domInsert(colorPicker, "demo"); diff --git a/doc/widgets/colorpicker.png b/doc/widgets/colorpicker.png new file mode 100644 index 00000000..0d8e18ae Binary files /dev/null and b/doc/widgets/colorpicker.png differ diff --git a/doc/widgets/colorpicker.svg b/doc/widgets/colorpicker.svg new file mode 100644 index 00000000..a273375f --- /dev/null +++ b/doc/widgets/colorpicker.svg @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/doc/widgets/colorpickerdialog.html b/doc/widgets/colorpickerdialog.html new file mode 100644 index 00000000..e360fe7c --- /dev/null +++ b/doc/widgets/colorpickerdialog.html @@ -0,0 +1,114 @@ + + + + + + + ColorPickerDialog - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

ColorPickerDialog

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+ +
+ + +
+ + + + + + + + diff --git a/doc/widgets/colorpickerdialog.js b/doc/widgets/colorpickerdialog.js new file mode 100644 index 00000000..ea8252de --- /dev/null +++ b/doc/widgets/colorpickerdialog.js @@ -0,0 +1,19 @@ +var dlg = new photonui.ColorPickerDialog({ + value: "#4EC8DB", + callbacks: { + "value-changed": function(widget, value) { + var header = document.getElementsByTagName("header")[0]; + header.style.backgroundColor = value; + } + } +}); + +// Add a button to show up the dialog +var btn = new photonui.Button({ + text: "Display the dialog", + callbacks: { + click: dlg.show.bind(dlg) + } +}); + +photonui.domInsert(btn, "demo"); diff --git a/doc/widgets/colorpickerdialog.png b/doc/widgets/colorpickerdialog.png new file mode 100644 index 00000000..0db410c4 Binary files /dev/null and b/doc/widgets/colorpickerdialog.png differ diff --git a/doc/widgets/colorpickerdialog.svg b/doc/widgets/colorpickerdialog.svg new file mode 100644 index 00000000..68d30c72 --- /dev/null +++ b/doc/widgets/colorpickerdialog.svg @@ -0,0 +1,89 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/doc/widgets/dataview.html b/doc/widgets/dataview.html new file mode 100644 index 00000000..e51d2f24 --- /dev/null +++ b/doc/widgets/dataview.html @@ -0,0 +1,129 @@ + + + + + + + DataView - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

DataView

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+
+

Documentation

+

Class Reference

+

More examples

Define html elements

1
2
3
4
5
6
7
8
9
10
11
12
13
var dataview = new photonui.DataView({
containerElement: "table",
itemElement: "tr",
columnElement: "td",
items: [
{ name: "John", count: 2 },
{ name: "Jane", count: 4 },
{ name: "Janeth", count: 12 }
],
columns: [ "name", "count"],
});

photonui.domInsert(dataview, "demo");
+

Custom Widget formater

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
var dataview = new photonui.DataView({
containerElement: "div",
itemElement: "div",
items: [
{ name: "John", count: 2 },
{ name: "Jane", count: 4 },
{ name: "Janeth", count: 12 }
],
customWidgetFormater: function(item) {
return new photonui.BoxLayout({
orientation: "horizontal",
children: [
new photonui.Label(item.name),
new photonui.NumericField({ value: item.count })
]
});
}
});

photonui.domInsert(dataview, "demo");
+

Drag and drop

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
var dataview = new photonui.DataView({
dragAndDroppable: true,
items: [
{ name: "John", count: 2 },
{ name: "Jane", count: 4 },
{ name: "Janeth", count: 12 }
],
columns: [ "name", "count"],
callbacks: {
"item-sort": function(event, item) {
item.value.count++;
}
},
});

photonui.domInsert(dataview, "demo");
+ +
+
+ + +
+ + + + + + + + diff --git a/doc/widgets/dataview.js b/doc/widgets/dataview.js new file mode 100644 index 00000000..e4ce5111 --- /dev/null +++ b/doc/widgets/dataview.js @@ -0,0 +1,29 @@ +var dataview = new photonui.DataView({ + items: [ + { name: "John", count: 2 }, + { name: "Jane", count: 4 }, + { name: "Janeth", count: 12 } + ], + columns: [ + { + id: "name", + value: function(item) { return `${item.name}: ` } + }, + "count" + ], + callbacks: { + "item-click": function(event, item) { + item.value.count++; + item.node.querySelector(".photonui-dataview-column-count") + .innerText = item.value.count; + }, + "item-select": function(event, item) { + item.node.style.fontWeight = "bold" + }, + "item-unselect": function(event, item) { + item.node.style.fontWeight = "" + }, + } +}); + +photonui.domInsert(dataview, "demo"); \ No newline at end of file diff --git a/doc/widgets/default.png b/doc/widgets/default.png new file mode 100644 index 00000000..d1604ce4 Binary files /dev/null and b/doc/widgets/default.png differ diff --git a/doc/widgets/default.svg b/doc/widgets/default.svg new file mode 100644 index 00000000..85b757b7 --- /dev/null +++ b/doc/widgets/default.svg @@ -0,0 +1,71 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/doc/widgets/dialog.html b/doc/widgets/dialog.html new file mode 100644 index 00000000..2601e467 --- /dev/null +++ b/doc/widgets/dialog.html @@ -0,0 +1,113 @@ + + + + + + + Dialog - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

Dialog

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+
+

Class Reference

+

More examples

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Get the position of the #demo area to display windows
// in the right place
var pos = photonui.Helpers.getAbsolutePosition("demo");

new photonui.Dialog({
title: "My Modal Dialog",
visible: true,
x: pos.x, y: pos.y,
child: new photonui.Label("Do you want to close this dialog?"),
modal: true,
padding: 10,
buttons: [
new photonui.Button({
leftIcon: new photonui.FAIcon("fa-check"),
text: "Yes",
buttonColor: "green",
callbacks: {
click: function(widget, event) {
widget.parent.destroy();
}
}
}),
new photonui.Button({
leftIcon: new photonui.FAIcon("fa-times"),
text: "Nope",
buttonColor: "red"
})
],
callbacks: {
"close-button-clicked": function(widget) {
widget.destroy();
}
}
});
+ +
+
+ + +
+ + + + + + + + diff --git a/doc/widgets/dialog.js b/doc/widgets/dialog.js new file mode 100644 index 00000000..421f473a --- /dev/null +++ b/doc/widgets/dialog.js @@ -0,0 +1,17 @@ +var pos = photonui.Helpers.getAbsolutePosition("demo"); + +new photonui.Dialog({ + title: "My Dialog", + visible: true, + x: pos.x, y: pos.y, + child: new photonui.Label("Hello, I'm a dialog"), + padding: 10, + buttons: [ + new photonui.Button() + ], + callbacks: { + "close-button-clicked": function(widget) { + widget.destroy(); + } + } +}); diff --git a/doc/widgets/dialog.png b/doc/widgets/dialog.png new file mode 100644 index 00000000..7c3e6025 Binary files /dev/null and b/doc/widgets/dialog.png differ diff --git a/doc/widgets/dialog.svg b/doc/widgets/dialog.svg new file mode 100644 index 00000000..ba89e50d --- /dev/null +++ b/doc/widgets/dialog.svg @@ -0,0 +1,112 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + ok + + + + diff --git a/doc/widgets/expander.html b/doc/widgets/expander.html new file mode 100644 index 00000000..3d9e2273 --- /dev/null +++ b/doc/widgets/expander.html @@ -0,0 +1,127 @@ + + + + + + + Expander - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

Expander

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+ +
+ + +
+ + + + + + + + diff --git a/doc/widgets/expander.js b/doc/widgets/expander.js new file mode 100644 index 00000000..71bbfe4a --- /dev/null +++ b/doc/widgets/expander.js @@ -0,0 +1,31 @@ +var box = new photonui.BoxLayout({ + horizontalPadding: 10, + verticalPadding: 10, + spacing: 10, + + children: [ + new photonui.Expander({ + title: "Expander 1", + child: new photonui.Label({ + text: "Never gonna..." + }) + }), + new photonui.Expander({ + title: "Expander 2", + folded: true, + child: new photonui.Label({ + text: "... give you..." + }) + + }), + new photonui.Expander({ + title: "Expander 3", + folded: true, + child: new photonui.Label({ + text: "... up!" + }) + }) + ] +}); + +photonui.domInsert(box, "demo"); diff --git a/doc/widgets/expander.png b/doc/widgets/expander.png new file mode 100644 index 00000000..c61af042 Binary files /dev/null and b/doc/widgets/expander.png differ diff --git a/doc/widgets/expander.svg b/doc/widgets/expander.svg new file mode 100644 index 00000000..0c745a3f --- /dev/null +++ b/doc/widgets/expander.svg @@ -0,0 +1,75 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/doc/widgets/faicon.html b/doc/widgets/faicon.html new file mode 100644 index 00000000..0c3e23c9 --- /dev/null +++ b/doc/widgets/faicon.html @@ -0,0 +1,113 @@ + + + + + + + FAIcon - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

FAIcon

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+ +
+ + +
+ + + + + + + + diff --git a/doc/widgets/faicon.js b/doc/widgets/faicon.js new file mode 100644 index 00000000..2222e67f --- /dev/null +++ b/doc/widgets/faicon.js @@ -0,0 +1,7 @@ +var icon = new photonui.FAIcon({ + iconName: "fa-camera", + size: "fa-3x", // "", "fa-lg", "fa-2x", "fa-3x", "fa-4x", "fa5x" + color: "#DB624F" +}); + +photonui.domInsert(icon, "demo"); diff --git a/doc/widgets/faicon.png b/doc/widgets/faicon.png new file mode 100644 index 00000000..cef87c06 Binary files /dev/null and b/doc/widgets/faicon.png differ diff --git a/doc/widgets/faicon.svg b/doc/widgets/faicon.svg new file mode 100644 index 00000000..ce77e098 --- /dev/null +++ b/doc/widgets/faicon.svg @@ -0,0 +1,66 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/doc/widgets/filemanager.html b/doc/widgets/filemanager.html new file mode 100644 index 00000000..5e3fcb50 --- /dev/null +++ b/doc/widgets/filemanager.html @@ -0,0 +1,133 @@ + + + + + + + FileManager - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

FileManager

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+
+

The file manager provides two ways to open files stored on the user’s hard disk:

+
    +
  • by using a “file open” dialog

    +
  • +
  • by allowing files to be dragged & dropped on your web app

    +
  • +
+

NOTE: You cannot open the “file open” dialog as you want. The photonui.FileManager.open method must be called in response to a user event (click,…), otherwise the browser will not allow you to open the dialog.

+

Class Reference

+ +
+
+ + +
+ + + + + + + + diff --git a/doc/widgets/filemanager.js b/doc/widgets/filemanager.js new file mode 100644 index 00000000..51204fd0 --- /dev/null +++ b/doc/widgets/filemanager.js @@ -0,0 +1,30 @@ +// File manager that accepts PNG, JPEG, BMP and SVG files +var fm = new photonui.FileManager({ + acceptedMimes: ["image/png", "image/jpeg"], + acceptedExts: ["bmp", "svg"], + dropZone: document, // Enable file d&d + multiselect: true, // Allow to select more than one file + callbacks: { + "file-open": function(widget, file, x, y) { + // x and y are defined only with d&d + if (x !== undefined) { + alert(file.name + " dropped at ("+x+", "+y+")"); + } + else { + alert(file.name + " opened"); + } + } + } +}); + +// Button to show the "file open" dialog +var btn = new photonui.Button({ + text: "Open", + callbacks: { + click: function(widget, event) { + fm.open(); + } + } +}); + +photonui.domInsert(btn, "demo"); diff --git a/doc/widgets/filemanager.png b/doc/widgets/filemanager.png new file mode 100644 index 00000000..2b1ec711 Binary files /dev/null and b/doc/widgets/filemanager.png differ diff --git a/doc/widgets/filemanager.svg b/doc/widgets/filemanager.svg new file mode 100644 index 00000000..b10adc92 --- /dev/null +++ b/doc/widgets/filemanager.svg @@ -0,0 +1,67 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/doc/widgets/fluidlayout.html b/doc/widgets/fluidlayout.html new file mode 100644 index 00000000..537ac4e2 --- /dev/null +++ b/doc/widgets/fluidlayout.html @@ -0,0 +1,109 @@ + + + + + + + FluidLayout - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

FluidLayout

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+
+

photonui.FluidLayout is a simple layout that displays widgets inline and wraps the line if necessary.

+

Class Reference

+ +
+
+ + +
+ + + + + + + + diff --git a/doc/widgets/fluidlayout.js b/doc/widgets/fluidlayout.js new file mode 100644 index 00000000..b73f46ad --- /dev/null +++ b/doc/widgets/fluidlayout.js @@ -0,0 +1,13 @@ +var fl = new photonui.FluidLayout({ + children: [ + new photonui.Button(), + new photonui.Button(), + new photonui.Button(), + new photonui.Button(), + new photonui.Button(), + new photonui.Button(), + new photonui.Button() + ] +}); + +photonui.domInsert(fl, "demo"); diff --git a/doc/widgets/fluidlayout.png b/doc/widgets/fluidlayout.png new file mode 100644 index 00000000..835c464d Binary files /dev/null and b/doc/widgets/fluidlayout.png differ diff --git a/doc/widgets/fluidlayout.svg b/doc/widgets/fluidlayout.svg new file mode 100644 index 00000000..8af1d229 --- /dev/null +++ b/doc/widgets/fluidlayout.svg @@ -0,0 +1,102 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/doc/widgets/fluidview.html b/doc/widgets/fluidview.html new file mode 100644 index 00000000..e72cfe95 --- /dev/null +++ b/doc/widgets/fluidview.html @@ -0,0 +1,131 @@ + + + + + + + FluidView - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

FluidView

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+ +
+ + +
+ + + + + + + + diff --git a/doc/widgets/fluidview.js b/doc/widgets/fluidview.js new file mode 100644 index 00000000..c93b48f1 --- /dev/null +++ b/doc/widgets/fluidview.js @@ -0,0 +1,34 @@ +var fluidview = new photonui.FluidView({ + containerElement: "div", + itemElement: "div", + columnElement: "div", + itemsWidth: 70, + itemsHeight: 30, + verticalPadding: 10, + horizontalPadding: 20, + verticalSpacing: 20, + horizontalSpacing: 10, + items: [ + { name: "Bicycle", icon: "fa-bicycle", color: "green" }, + { name: "Subway", icon: "fa-subway", color: "blue" }, + { name: "Train", icon: "fa-train", color: "red" }, + { name: "Car", icon: "fa-car", color: "yellow" }, + { name: "Ship", icon: "fa-ship", color: "cyan" }, + { name: "Plane", icon: "fa-plane", color: "magenta" }, + ], + columns: [ + { + id: "icon", + label: "Icon", + value: function(item) { + return new photonui.FAIcon({ + iconName: item.icon, + color: item.color, + }) + } + }, + "name", + ], +}); + +photonui.domInsert(fluidview, "demo"); \ No newline at end of file diff --git a/doc/widgets/fontselect.html b/doc/widgets/fontselect.html new file mode 100644 index 00000000..a41de300 --- /dev/null +++ b/doc/widgets/fontselect.html @@ -0,0 +1,115 @@ + + + + + + + FontSelect - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

FontSelect

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+ +
+ + +
+ + + + + + + + diff --git a/doc/widgets/fontselect.js b/doc/widgets/fontselect.js new file mode 100644 index 00000000..a9de5ace --- /dev/null +++ b/doc/widgets/fontselect.js @@ -0,0 +1,20 @@ +var select = new photonui.FontSelect({ + value: "item1", + fonts: [ + "Arial", + "Arial Black", + "Cantarell", + "Courier New", + "Impact", + "Time New Roman", + "Titillium Web", + "Verdana" + ], + callbacks: { + "value-changed": function(widget, value) { + alert("Value changed: " + value); + } + } +}); + +photonui.domInsert(select, "demo"); diff --git a/doc/widgets/fontselect.png b/doc/widgets/fontselect.png new file mode 100644 index 00000000..c4960027 Binary files /dev/null and b/doc/widgets/fontselect.png differ diff --git a/doc/widgets/fontselect.svg b/doc/widgets/fontselect.svg new file mode 100644 index 00000000..e48fe2f0 --- /dev/null +++ b/doc/widgets/fontselect.svg @@ -0,0 +1,166 @@ + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + Arial + + + Impact + Cantarell + + + diff --git a/doc/widgets/gridlayout-horizontalpadding.png b/doc/widgets/gridlayout-horizontalpadding.png new file mode 100644 index 00000000..fe42fdbb Binary files /dev/null and b/doc/widgets/gridlayout-horizontalpadding.png differ diff --git a/doc/widgets/gridlayout-horizontalpadding.svg b/doc/widgets/gridlayout-horizontalpadding.svg new file mode 100644 index 00000000..5efedbcc --- /dev/null +++ b/doc/widgets/gridlayout-horizontalpadding.svg @@ -0,0 +1,573 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + Widget + horizontalPadding + + Widget + + Widget + + Widget + + Widget + + Widget + + Widget + + Widget + + Widget + + Widget + + Widget + + Widget + + Widget + + Widget + + Widget + + Widget + + + + diff --git a/doc/widgets/gridlayout-horizontalspacing.png b/doc/widgets/gridlayout-horizontalspacing.png new file mode 100644 index 00000000..fe54a468 Binary files /dev/null and b/doc/widgets/gridlayout-horizontalspacing.png differ diff --git a/doc/widgets/gridlayout-horizontalspacing.svg b/doc/widgets/gridlayout-horizontalspacing.svg new file mode 100644 index 00000000..b30bca9f --- /dev/null +++ b/doc/widgets/gridlayout-horizontalspacing.svg @@ -0,0 +1,619 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + Widget + horizontalSpacing + + Widget + + Widget + + Widget + + Widget + + Widget + + Widget + + Widget + + Widget + + Widget + + Widget + + Widget + + Widget + + Widget + + Widget + + Widget + + + + + diff --git a/doc/widgets/gridlayout-lo-cols.png b/doc/widgets/gridlayout-lo-cols.png new file mode 100644 index 00000000..c76bf322 Binary files /dev/null and b/doc/widgets/gridlayout-lo-cols.png differ diff --git a/doc/widgets/gridlayout-lo-cols.svg b/doc/widgets/gridlayout-lo-cols.svg new file mode 100644 index 00000000..d563d211 --- /dev/null +++ b/doc/widgets/gridlayout-lo-cols.svg @@ -0,0 +1,322 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + {cols: 2} + + + {cols: 1} + + {cols: 1} + + {cols: 1} + {cols: 1} + + {cols: 3} + + diff --git a/doc/widgets/gridlayout-lo-horizontalalign.png b/doc/widgets/gridlayout-lo-horizontalalign.png new file mode 100644 index 00000000..d87c536e Binary files /dev/null and b/doc/widgets/gridlayout-lo-horizontalalign.png differ diff --git a/doc/widgets/gridlayout-lo-horizontalalign.svg b/doc/widgets/gridlayout-lo-horizontalalign.svg new file mode 100644 index 00000000..00e861e1 --- /dev/null +++ b/doc/widgets/gridlayout-lo-horizontalalign.svg @@ -0,0 +1,546 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + stretch + + + end |right + + + stretch + + stretch + + stretch + + + center |middle + + + stretch + + stretch + + stretch + + + begin |left + + + stretch + + stretch + + stretch + + stretch |expand + + stretch + + stretch + + diff --git a/doc/widgets/gridlayout-lo-rows.png b/doc/widgets/gridlayout-lo-rows.png new file mode 100644 index 00000000..2726704c Binary files /dev/null and b/doc/widgets/gridlayout-lo-rows.png differ diff --git a/doc/widgets/gridlayout-lo-rows.svg b/doc/widgets/gridlayout-lo-rows.svg new file mode 100644 index 00000000..7971db59 --- /dev/null +++ b/doc/widgets/gridlayout-lo-rows.svg @@ -0,0 +1,322 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + {rows: 1} + + {rows: 1} + + + {rows: 1} + + + + {rows: 1} + + {rows: 2} + + {rows: 3} + + diff --git a/doc/widgets/gridlayout-lo-verticalalign.png b/doc/widgets/gridlayout-lo-verticalalign.png new file mode 100644 index 00000000..6caf8427 Binary files /dev/null and b/doc/widgets/gridlayout-lo-verticalalign.png differ diff --git a/doc/widgets/gridlayout-lo-verticalalign.svg b/doc/widgets/gridlayout-lo-verticalalign.svg new file mode 100644 index 00000000..c6744891 --- /dev/null +++ b/doc/widgets/gridlayout-lo-verticalalign.svg @@ -0,0 +1,515 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + stretch + + stretch + + stretch + + stretch + + stretch + + stretch + + stretch + + stretch + + stretch | expand + + start | top + + center | middle + + end | bottom + + stretch + + stretch + + stretch + + stretch + + diff --git a/doc/widgets/gridlayout-lo-xy.png b/doc/widgets/gridlayout-lo-xy.png new file mode 100644 index 00000000..2fa84da1 Binary files /dev/null and b/doc/widgets/gridlayout-lo-xy.png differ diff --git a/doc/widgets/gridlayout-lo-xy.svg b/doc/widgets/gridlayout-lo-xy.svg new file mode 100644 index 00000000..9322599c --- /dev/null +++ b/doc/widgets/gridlayout-lo-xy.svg @@ -0,0 +1,295 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + {x: 0, y: 1} + + {x: 1, y: 1} + + {x: 2, y: 1} + + {x: 0, y: 0} + + {x: 1, y: 0} + + {x: 2, y: 0} + + diff --git a/doc/widgets/gridlayout-verticalpadding.png b/doc/widgets/gridlayout-verticalpadding.png new file mode 100644 index 00000000..f0931fed Binary files /dev/null and b/doc/widgets/gridlayout-verticalpadding.png differ diff --git a/doc/widgets/gridlayout-verticalpadding.svg b/doc/widgets/gridlayout-verticalpadding.svg new file mode 100644 index 00000000..574858c6 --- /dev/null +++ b/doc/widgets/gridlayout-verticalpadding.svg @@ -0,0 +1,582 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + Widget + verticalPadding + + Widget + + Widget + + Widget + + Widget + + Widget + + Widget + + Widget + + Widget + + Widget + + Widget + + Widget + + Widget + + Widget + + Widget + + Widget + + + + + diff --git a/doc/widgets/gridlayout-verticalspacing.png b/doc/widgets/gridlayout-verticalspacing.png new file mode 100644 index 00000000..2937723e Binary files /dev/null and b/doc/widgets/gridlayout-verticalspacing.png differ diff --git a/doc/widgets/gridlayout-verticalspacing.svg b/doc/widgets/gridlayout-verticalspacing.svg new file mode 100644 index 00000000..aac98b67 --- /dev/null +++ b/doc/widgets/gridlayout-verticalspacing.svg @@ -0,0 +1,622 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + Widget + verticalSpacing + + Widget + + Widget + + Widget + + Widget + + Widget + + Widget + + Widget + + Widget + + Widget + + Widget + + Widget + + Widget + + Widget + + Widget + + Widget + + + + + diff --git a/doc/widgets/gridlayout.html b/doc/widgets/gridlayout.html new file mode 100644 index 00000000..8ccebb12 --- /dev/null +++ b/doc/widgets/gridlayout.html @@ -0,0 +1,201 @@ + + + + + + + GridLayout - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

GridLayout

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+
+

photonui.GridLayout is a layout widget that allows you to align widgets on a 2D grid.

+

Global Options

photonui.GridLayout provides options to define its look and feel. Global options are applied to the layout itself.

+

verticalSpacing

Defines the vertical spacing between the widgets (5px by default).

+

GridLayout verticalSpacing Schema

+ + +

horizontalSpacing

Defines the horizontal spacing between the widgets (5px by default).

+

GridLayout horizontalSpacing Schema

+ + +

verticalPadding

Defines the spacing between the widgets and the left and right edges of the layout (0px by default).

+

GridLayout verticalPadding Schema

+ + +

horizontalPadding

Defines the spacing between the widgets and the top and bottom edges of the layout (0px by default).

+

GridLayout horizontalPadding Schema

+ + +

Layout Options

photonui.GridLayout allows widgets to set plenty of options to customize the way they are displayed in the layout. Layout options are associated with only one widget of the layout.

+

x, y

Defines the widget’s position on the grid.

+

GridLayout x and y layout options Schema

+ + + +

rows

Defines the number of rows the widget will fill (default = 1).

+

GridLayout rows layout option Schema

+ + +

cols

Defines the number of columns the widget will fill (default = 1).

+

GridLayout cols layout option Schema

+ + +

verticalAlign

Defines how the widget must be vertically aligned in the layout.

+

Possible values:

+
    +
  • stretch (default, alias: expand): the widget is stretched to use all the available vertical space in its box,

    +
  • +
  • start (alias: top): the widget is placed at the top of its box,

    +
  • +
  • center (alias: middle): the widget is vertically centered in its box,

    +
  • +
  • end (alias: bottom): the widget is placed at the bottom of its box.

    +
  • +
+

GridLayout verticalAlign layout option Schema

+ + +

horizontalAlign

Defines how the widget must be vertically aligned in the layout.

+

Possible values:

+
    +
  • stretch (default, alias: expand): the widget is stretched to use all the available horizontal space in its box,

    +
  • +
  • start (alias: left): the widget is placed at the left of its box,

    +
  • +
  • center (alias: middle): the widget is horizontally centered in its box,

    +
  • +
  • end (alias: right): the widget is placed at the right of its box.

    +
  • +
+

GridLayout horizontalAlign layout option Schema

+ + +

width

Defines the fixed width of the widget (default = null, null means “auto”).

+

minWidth

Defines the minimum width of the widget (default = null, null means no limitation).

+

maxWidth

Defines the maximum width of the widget (default = null, null means no limitation).

+

height

Defines the fixed height of the widget (default = null, null means “auto”).

+

minHeight

Defines the minimum height of the widget (default = null, null means no limitation).

+

maxHeight

Defines the maximum height of the widget (default = null, null means no limitation).

+

Class Reference

+ +
+
+ + +
+ + + + + + + + diff --git a/doc/widgets/gridlayout.js b/doc/widgets/gridlayout.js new file mode 100644 index 00000000..ab305b39 --- /dev/null +++ b/doc/widgets/gridlayout.js @@ -0,0 +1,38 @@ +var grid = new photonui.GridLayout({ + horizontalPadding: 0, + verticalPadding: 0, + horizontalSpacing: 5, + verticalSpacing: 5, + children: [ + new photonui.Button({ + text: "Widget 1", + layoutOptions: { + x: 0, y: 0, + cols: 1, rows: 1 + } + }), + new photonui.Button({ + text: "Widget 2", + layoutOptions: { + x: 1, y: 0, + cols: 1, rows: 1 + } + }), + new photonui.Button({ + text: "Widget 3", + layoutOptions: { + x: 2, y: 0, + cols: 1, rows: 2 + } + }), + new photonui.Button({ + text: "Widget 4", + layoutOptions: { + x: 0, y: 1, + cols: 2, rows: 1 + } + }) + ] +}); + +photonui.domInsert(grid, "demo"); diff --git a/doc/widgets/gridlayout.png b/doc/widgets/gridlayout.png new file mode 100644 index 00000000..9ed13d6c Binary files /dev/null and b/doc/widgets/gridlayout.png differ diff --git a/doc/widgets/gridlayout.svg b/doc/widgets/gridlayout.svg new file mode 100644 index 00000000..3bc57aad --- /dev/null +++ b/doc/widgets/gridlayout.svg @@ -0,0 +1,90 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/doc/widgets/iconbutton.html b/doc/widgets/iconbutton.html new file mode 100644 index 00000000..8d9b16c5 --- /dev/null +++ b/doc/widgets/iconbutton.html @@ -0,0 +1,107 @@ + + + + + + + IconButton - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

IconButton

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+ +
+ + +
+ + + + + + + + diff --git a/doc/widgets/iconbutton.js b/doc/widgets/iconbutton.js new file mode 100644 index 00000000..2432f17c --- /dev/null +++ b/doc/widgets/iconbutton.js @@ -0,0 +1,12 @@ +var btn = new photonui.IconButton({ + icon: new photonui.FAIcon("fa-send"), + width: 32, + height: 32, + callbacks: { + click: function(widget, event) { + alert("clicked!"); + } + } +}); + +photonui.domInsert(btn, "demo"); diff --git a/doc/widgets/iconview.html b/doc/widgets/iconview.html new file mode 100644 index 00000000..99425f7a --- /dev/null +++ b/doc/widgets/iconview.html @@ -0,0 +1,112 @@ + + + + + + + IconView - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

IconView

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+
+

Documentation

+

Class Reference

+

More examples

Images

1
2
3
4
5
6
7
8
9
10
11
12
13
14
var iconview = new photonui.IconView({
iconWidth: 32,
iconHeight: 32,
items: [
{ image: "../../images/favicon.png" },
{ image: "../../images/favicon.png" },
{ image: "../../images/favicon.png" },
{ image: "../../images/favicon.png" },
{ image: "../../images/favicon.png" },
{ image: "../../images/favicon.png" },
],
});

photonui.domInsert(iconview, "demo");
+ +
+
+ + +
+ + + + + + + + diff --git a/doc/widgets/iconview.js b/doc/widgets/iconview.js new file mode 100644 index 00000000..e80e75bf --- /dev/null +++ b/doc/widgets/iconview.js @@ -0,0 +1,14 @@ +var iconview = new photonui.IconView({ + iconWidth: 32, + iconHeight: 32, + items: [ + { faIcon: { iconName: "fa-bicycle" } }, + { faIcon: { iconName: "fa-subway" } }, + { faIcon: { iconName: "fa-train" } }, + { faIcon: { iconName: "fa-car" } }, + { faIcon: { iconName: "fa-ship" } }, + { faIcon: { iconName: "fa-plane" } }, + ], +}); + +photonui.domInsert(iconview, "demo"); \ No newline at end of file diff --git a/doc/widgets/image-demo.png b/doc/widgets/image-demo.png new file mode 100644 index 00000000..b783c931 Binary files /dev/null and b/doc/widgets/image-demo.png differ diff --git a/doc/widgets/image.html b/doc/widgets/image.html new file mode 100644 index 00000000..994cb5f1 --- /dev/null +++ b/doc/widgets/image.html @@ -0,0 +1,101 @@ + + + + + + + Image - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

Image

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+
+

Class Reference

+

More examples

1
2
3
4
5
6
var img = new photonui.Image({
url: "image-demo.png",
width: 50
});

photonui.domInsert(img, "demo");
+ +
+
+ + +
+ + + + + + + + diff --git a/doc/widgets/image.js b/doc/widgets/image.js new file mode 100644 index 00000000..d723f925 --- /dev/null +++ b/doc/widgets/image.js @@ -0,0 +1,5 @@ +var img = new photonui.Image({ + url: "../../images/favicon.png" +}); + +photonui.domInsert(img, "demo"); diff --git a/doc/widgets/image.png b/doc/widgets/image.png new file mode 100644 index 00000000..f5bbdc58 Binary files /dev/null and b/doc/widgets/image.png differ diff --git a/doc/widgets/image.svg b/doc/widgets/image.svg new file mode 100644 index 00000000..7d887e3f --- /dev/null +++ b/doc/widgets/image.svg @@ -0,0 +1,91 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/doc/widgets/keyboardmanager.html b/doc/widgets/keyboardmanager.html new file mode 100644 index 00000000..85c4ae97 --- /dev/null +++ b/doc/widgets/keyboardmanager.html @@ -0,0 +1,123 @@ + + + + + + + KeyboardManager - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

KeyboardManager

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+
+

This component allows you to track keyboard state in an intuitive way.

+

Class Reference

+

Callbacks

One can register to keyboard callbacks:

+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Add a field to display things
var field = new photonui.TextAreaField({
placeholder: "Start writing here!",
rows: 20
});
photonui.domInsert(field, "demo");

// Create our keyboard manager
var kb = new photonui.KeyboardManager(field, {safe: false});

// What to write to our label
var keys = [];
var printKeys = function() {
field.value = "";
for (var key in keys)
field.value += key + " " + keys[key] + "\n";
};

// Register to basic callbacks
kb.registerCallback("kb1", "key-down", function(manager, kstate) {
keys[kstate.key] = "down";
printKeys();
});

kb.registerCallback("kb2", "key-hold", function(manager, kstate) {
keys[kstate.key] = "hold";
printKeys();
});

kb.registerCallback("kb3", "key-up", function(manager, kstate) {
keys[kstate.key] = "up";
printKeys();
});
+ +
+
+ + +
+ + + + + + + + diff --git a/doc/widgets/keyboardmanager.js b/doc/widgets/keyboardmanager.js new file mode 100644 index 00000000..0d8405eb --- /dev/null +++ b/doc/widgets/keyboardmanager.js @@ -0,0 +1,26 @@ +// Create our keyboard manager +var kb = new photonui.KeyboardManager(document); + +// Create a dialog to be moved +var pos = photonui.Helpers.getAbsolutePosition("demo"); +var dialog = new photonui.Dialog({ + title: "I want to move!", + visible: true, + padding: 10, + x: pos.x, y: pos.y, + child: new photonui.Label("Use your keyboard arrows!") +}); + +// Update loop +var update = function update() { + // Check the keyboard current state + if (kb.isKeyPressed("right")) dialog.x += 5; + if (kb.isKeyPressed("left")) dialog.x -= 5; + if (kb.isKeyPressed("down")) dialog.y += 5; + if (kb.isKeyPressed("up")) dialog.y -= 5; + + setTimeout(update, 1000 / 60); +}; + +// Start the loop +update(); \ No newline at end of file diff --git a/doc/widgets/keyboardmanager.png b/doc/widgets/keyboardmanager.png new file mode 100644 index 00000000..dee86621 Binary files /dev/null and b/doc/widgets/keyboardmanager.png differ diff --git a/doc/widgets/keyboardmanager.svg b/doc/widgets/keyboardmanager.svg new file mode 100644 index 00000000..671bf7cc --- /dev/null +++ b/doc/widgets/keyboardmanager.svg @@ -0,0 +1,336 @@ + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/widgets/label.html b/doc/widgets/label.html new file mode 100644 index 00000000..ba94131f --- /dev/null +++ b/doc/widgets/label.html @@ -0,0 +1,106 @@ + + + + + + + Label - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

Label

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+
+

Class Reference

+

Short declaration

photonui.Label can be instantiated in a shorter way:

+
1
2
var label = new photonui.Label("My Label");
photonui.domInsert(label, "demo");
+

With more params:

+
1
2
3
4
5
var label = new photonui.Label("My Label", {
textAlign: "right"
});

photonui.domInsert(label, "demo");
+

More examples

1
2
3
4
5
6
7
8
9
10
11
12
13
14
var grid = new photonui.BoxLayout({
orientation: "horizontal",
children: [
new photonui.Label({
text: "My Label:",
forInputName: "my-text-field"
}),
new photonui.TextField({
name: "my-text-field"
})
]
});

photonui.domInsert(grid, "demo");
+ +
+
+ + +
+ + + + + + + + diff --git a/doc/widgets/label.js b/doc/widgets/label.js new file mode 100644 index 00000000..c5ab47ee --- /dev/null +++ b/doc/widgets/label.js @@ -0,0 +1,6 @@ +var label = new photonui.Label({ + text: "My Label", + textAlign: "left" +}); + +photonui.domInsert(label, "demo"); diff --git a/doc/widgets/label.png b/doc/widgets/label.png new file mode 100644 index 00000000..5efd60ac Binary files /dev/null and b/doc/widgets/label.png differ diff --git a/doc/widgets/label.svg b/doc/widgets/label.svg new file mode 100644 index 00000000..9920ff3b --- /dev/null +++ b/doc/widgets/label.svg @@ -0,0 +1,76 @@ + + + + + + + + + + image/svg+xml + + + + + + + + Label + + + diff --git a/doc/widgets/listview.html b/doc/widgets/listview.html new file mode 100644 index 00000000..b3239de0 --- /dev/null +++ b/doc/widgets/listview.html @@ -0,0 +1,127 @@ + + + + + + + ListView - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

ListView

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+
+

Documentation

+

Class Reference

+

More examples

Drag and drop

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
var listview = new photonui.ListView({
dragAndDroppable: true,
items: [
{ name: "John", count: 2 },
{ name: "Jane", count: 4 },
{ name: "Janeth", count: 12 }
],
columns: [ "name", "count"],
callbacks: {
"item-sort": function(event, item) {
item.value.count++;
}
},
});

photonui.domInsert(listview, "demo");
+ +
+
+ + +
+ + + + + + + + diff --git a/doc/widgets/listview.js b/doc/widgets/listview.js new file mode 100644 index 00000000..8cf9e8fc --- /dev/null +++ b/doc/widgets/listview.js @@ -0,0 +1,29 @@ +var listview = new photonui.ListView({ + items: [ + { name: "John", count: 2 }, + { name: "Jane", count: 4 }, + { name: "Janeth", count: 12 } + ], + columns: [ + { + id: "name", + value: function(item) { return `${item.name}: ` } + }, + "count" + ], + callbacks: { + "item-click": function(event, item) { + item.value.count++; + item.node.querySelector(".photonui-dataview-column-count") + .innerText = item.value.count; + }, + "item-select": function(event, item) { + item.node.style.fontWeight = "bold" + }, + "item-unselect": function(event, item) { + item.node.style.fontWeight = "" + }, + } +}); + +photonui.domInsert(listview, "demo"); \ No newline at end of file diff --git a/doc/widgets/menu.html b/doc/widgets/menu.html new file mode 100644 index 00000000..2bdf8c55 --- /dev/null +++ b/doc/widgets/menu.html @@ -0,0 +1,117 @@ + + + + + + + Menu - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

Menu

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+
+

photonui.Menu is a basic layout that is only meant to contain photonui.MenuItem, photonui.SubMenuItem and other photonui.Menu widgets.

+

Class Reference

+

More examples

With a submenu

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
var menu = new photonui.Menu({
iconVisible: true,
children: [
new photonui.MenuItem({
text: "Menu Item 1",
icon: new photonui.FAIcon("fa-paper-plane"),
callbacks: {
click: function(widget, event) {
alert("You clicked on me!");
}
}
}),
new photonui.MenuItem({
text: "Menu Item 2",
icon: new photonui.FAIcon("fa-gears")
}),
new photonui.SubMenuItem({
text: "Menu Item 3",
menuName: "submenu1",
icon: new photonui.FAIcon("fa-paw")
}),
new photonui.Menu({
visible: true, // false to hide it by default
name: "submenu1",
iconVisible: true,
children: [
new photonui.MenuItem({
text: "Submenu Item 1",
icon: new photonui.FAIcon("fa-gamepad")
}),
new photonui.MenuItem({
text: "Sumbenu Item 2",
icon: new photonui.FAIcon("fa-flask")
})
]
}),
new photonui.MenuItem({
text: "Menu Item 2",
icon: new photonui.FAIcon("fa-eye")
}),
]
});

photonui.domInsert(menu, "demo");
+ +
+
+ + +
+ + + + + + + + diff --git a/doc/widgets/menu.js b/doc/widgets/menu.js new file mode 100644 index 00000000..aa01f6e6 --- /dev/null +++ b/doc/widgets/menu.js @@ -0,0 +1,20 @@ +var menu = new photonui.Menu({ + iconVisible: true, + children: [ + new photonui.MenuItem({ + text: "Menu Item 1", + icon: new photonui.FAIcon("fa-paper-plane") + }), + new photonui.MenuItem({ + text: "Menu Item 2", + icon: new photonui.FAIcon("fa-gears") + }), + new photonui.MenuItem({ + text: "Menu Item 3", + icon: new photonui.FAIcon("fa-paw") + }) + ] +}); + + +photonui.domInsert(menu, "demo"); diff --git a/doc/widgets/menu.png b/doc/widgets/menu.png new file mode 100644 index 00000000..43de79ed Binary files /dev/null and b/doc/widgets/menu.png differ diff --git a/doc/widgets/menu.svg b/doc/widgets/menu.svg new file mode 100644 index 00000000..543be13e --- /dev/null +++ b/doc/widgets/menu.svg @@ -0,0 +1,109 @@ + + + + + + + + + + image/svg+xml + + + + + + + + Item 1 + + Item 2 + + Item 3 + + diff --git a/doc/widgets/menuitem.html b/doc/widgets/menuitem.html new file mode 100644 index 00000000..a1e1c0a5 --- /dev/null +++ b/doc/widgets/menuitem.html @@ -0,0 +1,122 @@ + + + + + + + MenuItem - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

MenuItem

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+
+

photonui.MenuItem is a widget that can be used inside any photonui.Menu, photonui.Select or photonui.Popupmenu widgets.

+

Class Reference

+

More examples

Inside a photonui.Select

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
var select = new photonui.Select({
value: "item1",
children: [
new photonui.MenuItem({value: "item1", text: "Item 1"}),
new photonui.MenuItem({value: "item2", text: "Item 2"}),
new photonui.MenuItem({value: "item3", text: "Item 3"})
],
callbacks: {
"value-changed": function(widget, value) {
alert("Value changed: " + value);
}
}
});

photonui.domInsert(select, "demo");
+ +
+
+ + +
+ + + + + + + + diff --git a/doc/widgets/menuitem.js b/doc/widgets/menuitem.js new file mode 100644 index 00000000..1abb50ac --- /dev/null +++ b/doc/widgets/menuitem.js @@ -0,0 +1,25 @@ +var menu = new photonui.Menu({ + iconVisible: true, + children: [ + new photonui.MenuItem({ + text: "Menu Item 1", + icon: new photonui.FAIcon("fa-paper-plane"), + callbacks: { + click: function(widget, event) { + alert("You clicked on me!"); + } + } + }), + new photonui.MenuItem({ + text: "Menu Item 2", + icon: new photonui.FAIcon("fa-gears") + }), + new photonui.MenuItem({ + text: "Menu Item 3", + icon: new photonui.FAIcon("fa-paw") + }) + ] +}); + + +photonui.domInsert(menu, "demo"); diff --git a/doc/widgets/menuitem.png b/doc/widgets/menuitem.png new file mode 100644 index 00000000..ee734593 Binary files /dev/null and b/doc/widgets/menuitem.png differ diff --git a/doc/widgets/menuitem.svg b/doc/widgets/menuitem.svg new file mode 100644 index 00000000..63df9e5b --- /dev/null +++ b/doc/widgets/menuitem.svg @@ -0,0 +1,81 @@ + + + + + + + + + + image/svg+xml + + + + + + + + Menu Item + + diff --git a/doc/widgets/mousemanager.html b/doc/widgets/mousemanager.html new file mode 100644 index 00000000..8c5f3212 --- /dev/null +++ b/doc/widgets/mousemanager.html @@ -0,0 +1,112 @@ + + + + + + + MouseManager - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

MouseManager

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+
+

photonui.MouseManager allows you to add interactivity to a visual widget (like photonui.Canvas).

+

Class Reference

+

More examples

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// --- UI ---

var grid = new photonui.GridLayout();
var eventLabel = new photonui.Label({text: "Event: -"});
var positionLabel = new photonui.Label({text: "Position: (0, 0)", textAlign: "right"});
var canvas = new photonui.Canvas({width: 300, height: 200});

grid.addChild(eventLabel, {gridX: 0, gridY: 0});
grid.addChild(positionLabel, {gridX: 1, gridY: 0});
grid.addChild(canvas, {gridX: 0, gridY: 1, gridWidth: 2});

canvas.html.style.border = "silver solid 1px";
photonui.domInsert(grid, "demo");

// --- Mouse Manager ---

var mouse = new photonui.MouseManager(canvas);
var x = 0;
var y = 0;

// Update the event name and mouse position for each event
mouse.registerCallback("any-event", "mouse-event", function(manager, mstate) {
mstate.action == "mouse-move" || (eventLabel.text = "Event: " + mstate.action);
positionLabel.text = "Position: (" + mstate.x + ", " + mstate.y + ")";

// Uncomment to display the complete log on the console
// mstate.action == "mouse-move" || console.log(mstate.action);
});

// Click
mouse.registerCallback("click", "click", function(manager, mstate) {
var ctx = canvas.getContext("2d");
ctx.clearRect(0, 0, canvas.width, canvas.height);
ctx.lineWidth = 2;
ctx.strokeStyle = "#07656D";

ctx.beginPath();
ctx.arc(mstate.x, mstate.y, 10, 0, 2*Math.PI);
ctx.stroke();
});

// Double Click
mouse.registerCallback("double-click", "double-click", function(manager, mstate) {
var ctx = canvas.getContext("2d");
ctx.clearRect(0, 0, canvas.width, canvas.height);
ctx.lineWidth = 2;
ctx.strokeStyle = "#DB624F";

ctx.beginPath();
ctx.arc(mstate.x, mstate.y, 10, 0, 2*Math.PI);
ctx.stroke();

ctx.beginPath();
ctx.arc(mstate.x, mstate.y, 15, 0, 2*Math.PI);
ctx.stroke();
});

// Drag Start
mouse.registerCallback("drag-start", "drag-start", function(manager, mstate) {
x = mstate.x;
y = mstate.y;
});

// Dragging
mouse.registerCallback("dragging", "dragging", function(manager, mstate) {
var ctx = canvas.getContext("2d");
ctx.clearRect(0, 0, canvas.width, canvas.height);
ctx.lineWidth = 2;
ctx.strokeStyle = "#07656D";

ctx.strokeRect(x, y, mstate.x-x, mstate.y-y);
});

// Drag End
mouse.registerCallback("drag-end", "drag-end", function(manager, mstate) {
var ctx = canvas.getContext("2d");
ctx.clearRect(0, 0, canvas.width, canvas.height);
ctx.lineWidth = 2;
ctx.strokeStyle = "#07656D";
ctx.fillStyle = "rgba(7, 101, 109, 0.2)";

ctx.fillRect(x, y, mstate.x-x, mstate.y-y);
ctx.strokeRect(x, y, mstate.x-x, mstate.y-y);
});
+ +
+
+ + +
+ + + + + + + + diff --git a/doc/widgets/mousemanager.js b/doc/widgets/mousemanager.js new file mode 100644 index 00000000..99854aba --- /dev/null +++ b/doc/widgets/mousemanager.js @@ -0,0 +1,15 @@ +var img = new photonui.Image({ + url: "../../images/favicon.png" +}); + +var mouse = new photonui.MouseManager({ + element: img, + callbacks: { + "click": function(manager, mstate) { + alert("You clicked on the image at " + + mstate.x + ", " + mstate.y); + } + } +}); + +photonui.domInsert(img, "demo"); diff --git a/doc/widgets/mousemanager.png b/doc/widgets/mousemanager.png new file mode 100644 index 00000000..72887de6 Binary files /dev/null and b/doc/widgets/mousemanager.png differ diff --git a/doc/widgets/mousemanager.svg b/doc/widgets/mousemanager.svg new file mode 100644 index 00000000..8b21f7d4 --- /dev/null +++ b/doc/widgets/mousemanager.svg @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/doc/widgets/numericfield.html b/doc/widgets/numericfield.html new file mode 100644 index 00000000..91b65bcf --- /dev/null +++ b/doc/widgets/numericfield.html @@ -0,0 +1,105 @@ + + + + + + + NumericField - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

NumericField

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+ +
+ + +
+ + + + + + + + diff --git a/doc/widgets/numericfield.js b/doc/widgets/numericfield.js new file mode 100644 index 00000000..56d5f814 --- /dev/null +++ b/doc/widgets/numericfield.js @@ -0,0 +1,10 @@ +var field = new photonui.NumericField({ + placeholder: "placeholder", + decimalDigits: 2, + min: -10, max: 10, + step: 0.5, // When scrolling over the field + decimalSymbol: ".", // "." or "," + value: 5.5 +}); + +photonui.domInsert(field, "demo"); diff --git a/doc/widgets/numericfield.png b/doc/widgets/numericfield.png new file mode 100644 index 00000000..ded80cdb Binary files /dev/null and b/doc/widgets/numericfield.png differ diff --git a/doc/widgets/numericfield.svg b/doc/widgets/numericfield.svg new file mode 100644 index 00000000..a0df9e76 --- /dev/null +++ b/doc/widgets/numericfield.svg @@ -0,0 +1,86 @@ + + + + + + + + + + image/svg+xml + + + + + + + 13.37 + + + + diff --git a/doc/widgets/popupmenu.html b/doc/widgets/popupmenu.html new file mode 100644 index 00000000..43f35404 --- /dev/null +++ b/doc/widgets/popupmenu.html @@ -0,0 +1,122 @@ + + + + + + + PopupMenu - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

PopupMenu

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+
+

Class Reference

+

More examples

Contextual menu

Contextual menus on PhotonUI widgets are automatically managed:

+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
var popup = new photonui.PopupMenu({
children: [
new photonui.MenuItem({
text: "Menu Item 1",
icon: new photonui.FAIcon("fa-paper-plane"),
callbacks: {
click: function(widget, event) {
alert("You clicked on me!");
}
}
}),
new photonui.MenuItem({
text: "Menu Item 2",
icon: new photonui.FAIcon("fa-gears")
}),
new photonui.MenuItem({
text: "Menu Item 3",
icon: new photonui.FAIcon("fa-paw")
})
]
});

var button = new photonui.Button({
text: "Right click on me!",
buttonColor: "blue",
contextMenu: popup // Defines the context menu
// displayed on right click
});

photonui.domInsert(button, "demo");
+ +
+
+ + +
+ + + + + + + + diff --git a/doc/widgets/popupmenu.js b/doc/widgets/popupmenu.js new file mode 100644 index 00000000..f6e861f8 --- /dev/null +++ b/doc/widgets/popupmenu.js @@ -0,0 +1,25 @@ +var pos = photonui.Helpers.getAbsolutePosition("demo"); + +var popup = new photonui.PopupMenu({ + children: [ + new photonui.MenuItem({ + text: "Menu Item 1", + icon: new photonui.FAIcon("fa-paper-plane"), + callbacks: { + click: function(widget, event) { + alert("You clicked on me!"); + } + } + }), + new photonui.MenuItem({ + text: "Menu Item 2", + icon: new photonui.FAIcon("fa-gears") + }), + new photonui.MenuItem({ + text: "Menu Item 3", + icon: new photonui.FAIcon("fa-paw") + }) + ] +}); + +popup.popupXY(pos.x, pos.y); diff --git a/doc/widgets/popupmenu.png b/doc/widgets/popupmenu.png new file mode 100644 index 00000000..8f15b0f6 Binary files /dev/null and b/doc/widgets/popupmenu.png differ diff --git a/doc/widgets/popupmenu.svg b/doc/widgets/popupmenu.svg new file mode 100644 index 00000000..e8775120 --- /dev/null +++ b/doc/widgets/popupmenu.svg @@ -0,0 +1,181 @@ + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/widgets/popupwindow.html b/doc/widgets/popupwindow.html new file mode 100644 index 00000000..c9cec6c3 --- /dev/null +++ b/doc/widgets/popupwindow.html @@ -0,0 +1,108 @@ + + + + + + + PopupWindow - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

PopupWindow

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+
+

Class Reference

+

More examples

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
var popup = new photonui.PopupWindow({
width: 200,
height: 200
});

var button = new photonui.Button({
text: "Click me to display the popup",
buttonColor: "blue",
callbacks: {
click: function(widget, event) {
popup.popupWidget(widget);
}
}
});

photonui.domInsert(button, "demo");
+ +
+
+ + +
+ + + + + + + + diff --git a/doc/widgets/popupwindow.js b/doc/widgets/popupwindow.js new file mode 100644 index 00000000..f019328f --- /dev/null +++ b/doc/widgets/popupwindow.js @@ -0,0 +1,12 @@ +var pos = photonui.Helpers.getAbsolutePosition("demo"); + +var popup = new photonui.PopupWindow({ + padding: 10, + width: 200, + height: 200, + child: new photonui.Label({ + text: "Click anywhere to close" + }) +}); + +popup.popupXY(pos.x, pos.y); diff --git a/doc/widgets/popupwindow.png b/doc/widgets/popupwindow.png new file mode 100644 index 00000000..7744de14 Binary files /dev/null and b/doc/widgets/popupwindow.png differ diff --git a/doc/widgets/popupwindow.svg b/doc/widgets/popupwindow.svg new file mode 100644 index 00000000..e1f2da01 --- /dev/null +++ b/doc/widgets/popupwindow.svg @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/doc/widgets/progressbar.html b/doc/widgets/progressbar.html new file mode 100644 index 00000000..160bb263 --- /dev/null +++ b/doc/widgets/progressbar.html @@ -0,0 +1,102 @@ + + + + + + + ProgressBar - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

ProgressBar

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+
+

Class Reference

+

More examples

1
2
3
4
5
6
// Pulsating Progress Bar
var pb = new photonui.ProgressBar({
pulsate: true
});

photonui.domInsert(pb, "demo");
+ +
+
+ + +
+ + + + + + + + diff --git a/doc/widgets/progressbar.js b/doc/widgets/progressbar.js new file mode 100644 index 00000000..e37f0325 --- /dev/null +++ b/doc/widgets/progressbar.js @@ -0,0 +1,6 @@ +var pb = new photonui.ProgressBar({ + textVisible: true, + value: 0.42 +}); + +photonui.domInsert(pb, "demo"); diff --git a/doc/widgets/progressbar.png b/doc/widgets/progressbar.png new file mode 100644 index 00000000..36ec9666 Binary files /dev/null and b/doc/widgets/progressbar.png differ diff --git a/doc/widgets/progressbar.svg b/doc/widgets/progressbar.svg new file mode 100644 index 00000000..e9f6bed5 --- /dev/null +++ b/doc/widgets/progressbar.svg @@ -0,0 +1,85 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/doc/widgets/select.html b/doc/widgets/select.html new file mode 100644 index 00000000..051e64bd --- /dev/null +++ b/doc/widgets/select.html @@ -0,0 +1,111 @@ + + + + + + + Select - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

Select

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+
+

Class Reference

+

More examples

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
var select = new photonui.Select({
iconVisible: true,
children: [
new photonui.MenuItem({
value: "text-file",
text: "Text",
icon: new photonui.FAIcon("fa-file-text-o")
}),
new photonui.MenuItem({
value: "image-file",
text: "Image",
icon: new photonui.FAIcon("fa-file-image-o")
}),
new photonui.MenuItem({
value: "pdf-file",
text: "PDF",
icon: new photonui.FAIcon("fa-file-pdf-o")
})
]
});

photonui.domInsert(select, "demo");
+ +
+
+ + +
+ + + + + + + + diff --git a/doc/widgets/select.js b/doc/widgets/select.js new file mode 100644 index 00000000..671df0ed --- /dev/null +++ b/doc/widgets/select.js @@ -0,0 +1,15 @@ +var select = new photonui.Select({ + value: "item1", + children: [ + new photonui.MenuItem({value: "item1", text: "Item 1"}), + new photonui.MenuItem({value: "item2", text: "Item 2"}), + new photonui.MenuItem({value: "item3", text: "Item 3"}) + ], + callbacks: { + "value-changed": function(widget, value) { + alert("Value changed: " + value); + } + } +}); + +photonui.domInsert(select, "demo"); diff --git a/doc/widgets/select.png b/doc/widgets/select.png new file mode 100644 index 00000000..03a1ed38 Binary files /dev/null and b/doc/widgets/select.png differ diff --git a/doc/widgets/select.svg b/doc/widgets/select.svg new file mode 100644 index 00000000..588c0171 --- /dev/null +++ b/doc/widgets/select.svg @@ -0,0 +1,164 @@ + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + Select + + + Item 1 + Item 2 + + + diff --git a/doc/widgets/separator.html b/doc/widgets/separator.html new file mode 100644 index 00000000..66599a4f --- /dev/null +++ b/doc/widgets/separator.html @@ -0,0 +1,98 @@ + + + + + + + Separator - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

Separator

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+ +
+ + +
+ + + + + + + + diff --git a/doc/widgets/separator.js b/doc/widgets/separator.js new file mode 100644 index 00000000..7e8b6916 --- /dev/null +++ b/doc/widgets/separator.js @@ -0,0 +1,3 @@ +var separator = new photonui.Separator(); + +photonui.domInsert(separator, "demo"); diff --git a/doc/widgets/separator.png b/doc/widgets/separator.png new file mode 100644 index 00000000..91d559b0 Binary files /dev/null and b/doc/widgets/separator.png differ diff --git a/doc/widgets/separator.svg b/doc/widgets/separator.svg new file mode 100644 index 00000000..feef426a --- /dev/null +++ b/doc/widgets/separator.svg @@ -0,0 +1,70 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/doc/widgets/slider.html b/doc/widgets/slider.html new file mode 100644 index 00000000..ec7a4ed7 --- /dev/null +++ b/doc/widgets/slider.html @@ -0,0 +1,104 @@ + + + + + + + Slider - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

Slider

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+
+

Class Reference

+

More examples

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
var box = new photonui.BoxLayout({
children: [
new photonui.Slider({
fieldVisible: false,
min: 0, max: 100,
step: 5,
value: 50
}),
new photonui.Slider({
fieldVisible: true,
min: -100, max: 100,
step: 10,
value: -50
}),
new photonui.Slider({
fieldVisible: true,
min: 0, max: 1,
decimalDigits: 2,
decimalSymbol: ".",
step: 0.05,
value: 0.5
})
]
});

photonui.domInsert(box, "demo");
+ +
+
+ + +
+ + + + + + + + diff --git a/doc/widgets/slider.js b/doc/widgets/slider.js new file mode 100644 index 00000000..70fd305a --- /dev/null +++ b/doc/widgets/slider.js @@ -0,0 +1,8 @@ +var slider = new photonui.Slider({ + fieldVisible: true, + min: 0, max: 100, + step: 10, + value: 50 +}); + +photonui.domInsert(slider, "demo"); diff --git a/doc/widgets/slider.png b/doc/widgets/slider.png new file mode 100644 index 00000000..33716519 Binary files /dev/null and b/doc/widgets/slider.png differ diff --git a/doc/widgets/slider.svg b/doc/widgets/slider.svg new file mode 100644 index 00000000..c875fe3c --- /dev/null +++ b/doc/widgets/slider.svg @@ -0,0 +1,76 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/doc/widgets/spriteicon.html b/doc/widgets/spriteicon.html new file mode 100644 index 00000000..6ba44430 --- /dev/null +++ b/doc/widgets/spriteicon.html @@ -0,0 +1,117 @@ + + + + + + + SpriteIcon - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

SpriteIcon

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+
+

Class Reference

+

More examples

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Create the sprite sheet
var spriteSheet = new photonui.SpriteSheet({
name: "default",
imageUrl: "./spritesheet.png",
size: 16,
icons: {
"remove": [ 0, 0],
"add": [16, 0],
"grayHeart": [32, 0],
"redHeart": [48, 0],
"battery1": [ 0, 16],
"battery2": [16, 16],
"battery3": [32, 16],
"battery4": [48, 16]
}
});

// Use a SpriteIcon in a Button
var btn = new photonui.Button({
text: "Sprite Icon",
leftIcon: new photonui.SpriteIcon("default/grayHeart"),
callbacks: {
click: function(widget, event) {
if (widget.leftIcon.iconName == "grayHeart") {
widget.leftIcon.iconName = "redHeart";
}
else {
widget.leftIcon.iconName = "grayHeart";
}
}
}
});

photonui.domInsert(btn, "demo");
+ +
+
+ + +
+ + + + + + + + diff --git a/doc/widgets/spriteicon.js b/doc/widgets/spriteicon.js new file mode 100644 index 00000000..50061fa9 --- /dev/null +++ b/doc/widgets/spriteicon.js @@ -0,0 +1,21 @@ +// Create the spritesheet +var spriteSheet = new photonui.SpriteSheet({ + name: "default", + imageUrl: "./spritesheet.png", + size: 16, + icons: { + "remove": [ 0, 0], + "add": [16, 0], + "grayHeart": [32, 0], + "redHeart": [48, 0], + "battery1": [ 0, 16], + "battery2": [16, 16], + "battery3": [32, 16], + "battery4": [48, 16] + } +}); + +// Create an icon from the spritesheet +var icon = new photonui.SpriteIcon("default/redHeart"); + +photonui.domInsert(icon, "demo"); diff --git a/doc/widgets/spriteicon.png b/doc/widgets/spriteicon.png new file mode 100644 index 00000000..b1eac6ae Binary files /dev/null and b/doc/widgets/spriteicon.png differ diff --git a/doc/widgets/spriteicon.svg b/doc/widgets/spriteicon.svg new file mode 100644 index 00000000..14c04715 --- /dev/null +++ b/doc/widgets/spriteicon.svg @@ -0,0 +1,124 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/widgets/spritesheet.png b/doc/widgets/spritesheet.png new file mode 100644 index 00000000..04edb681 Binary files /dev/null and b/doc/widgets/spritesheet.png differ diff --git a/doc/widgets/submenuitem.html b/doc/widgets/submenuitem.html new file mode 100644 index 00000000..5da49acc --- /dev/null +++ b/doc/widgets/submenuitem.html @@ -0,0 +1,123 @@ + + + + + + + SubMenuItem - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

SubMenuItem

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+ +
+ + +
+ + + + + + + + diff --git a/doc/widgets/submenuitem.js b/doc/widgets/submenuitem.js new file mode 100644 index 00000000..37553df2 --- /dev/null +++ b/doc/widgets/submenuitem.js @@ -0,0 +1,27 @@ +var menu = new photonui.Menu({ + iconVisible: true, + children: [ + new photonui.SubMenuItem({ + text: "Submenu Item", + menuName: "submenu1", + icon: new photonui.FAIcon("fa-paw") + }), + new photonui.Menu({ + visible: true, // false to hide it by default + name: "submenu1", + iconVisible: true, + children: [ + new photonui.MenuItem({ + text: "Submenu Item 1", + icon: new photonui.FAIcon("fa-gamepad") + }), + new photonui.MenuItem({ + text: "Sumbenu Item 2", + icon: new photonui.FAIcon("fa-flask") + }) + ] + }) + ] +}); + +photonui.domInsert(menu, "demo"); diff --git a/doc/widgets/submenuitem.png b/doc/widgets/submenuitem.png new file mode 100644 index 00000000..6de7504f Binary files /dev/null and b/doc/widgets/submenuitem.png differ diff --git a/doc/widgets/submenuitem.svg b/doc/widgets/submenuitem.svg new file mode 100644 index 00000000..7df4c551 --- /dev/null +++ b/doc/widgets/submenuitem.svg @@ -0,0 +1,86 @@ + + + + + + + + + + image/svg+xml + + + + + + + + Submenu Item + + + diff --git a/doc/widgets/switch.html b/doc/widgets/switch.html new file mode 100644 index 00000000..8c5a7040 --- /dev/null +++ b/doc/widgets/switch.html @@ -0,0 +1,101 @@ + + + + + + + Switch - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

Switch

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+
+

Class Reference

+

More examples

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
var grid = new photonui.GridLayout({
children: [
new photonui.Switch({
name: "switch1",
value: true,
layoutOptions: {
gridX: 1,
gridY: 0
},
callbacks: {
"value-changed": function(widget, value) {
alert(widget.name + " = " + value);
}
}
}),
new photonui.Label({
text: "Switch:",
forInputName: "switch1",
layoutOptions: {
gridX: 0,
gridY: 0
}
})
]
});

photonui.domInsert(grid, "demo");
+ +
+
+ + +
+ + + + + + + + diff --git a/doc/widgets/switch.js b/doc/widgets/switch.js new file mode 100644 index 00000000..35649c84 --- /dev/null +++ b/doc/widgets/switch.js @@ -0,0 +1,5 @@ +var sw = new photonui.Switch({ + value: true +}); + +photonui.domInsert(sw, "demo"); diff --git a/doc/widgets/switch.png b/doc/widgets/switch.png new file mode 100644 index 00000000..3613afd9 Binary files /dev/null and b/doc/widgets/switch.png differ diff --git a/doc/widgets/switch.svg b/doc/widgets/switch.svg new file mode 100644 index 00000000..c200dd49 --- /dev/null +++ b/doc/widgets/switch.svg @@ -0,0 +1,75 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/doc/widgets/tabitem.html b/doc/widgets/tabitem.html new file mode 100644 index 00000000..3fe9238c --- /dev/null +++ b/doc/widgets/tabitem.html @@ -0,0 +1,116 @@ + + + + + + + TabItem - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

TabItem

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+ +
+ + +
+ + + + + + + + diff --git a/doc/widgets/tabitem.png b/doc/widgets/tabitem.png new file mode 100644 index 00000000..67ce6f31 Binary files /dev/null and b/doc/widgets/tabitem.png differ diff --git a/doc/widgets/tabitem.svg b/doc/widgets/tabitem.svg new file mode 100644 index 00000000..5054065c --- /dev/null +++ b/doc/widgets/tabitem.svg @@ -0,0 +1,87 @@ + + + + + + + + + + image/svg+xml + + + + + + + + Tab + + + diff --git a/doc/widgets/tablayout.html b/doc/widgets/tablayout.html new file mode 100644 index 00000000..45561cc9 --- /dev/null +++ b/doc/widgets/tablayout.html @@ -0,0 +1,116 @@ + + + + + + + TabLayout - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

TabLayout

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+ +
+ + +
+ + + + + + + + diff --git a/doc/widgets/tablayout.js b/doc/widgets/tablayout.js new file mode 100644 index 00000000..a9792a8f --- /dev/null +++ b/doc/widgets/tablayout.js @@ -0,0 +1,20 @@ +var tabs = new photonui.TabLayout({ + tabsPosition: "top", // "top", "bottom", "left" or "right" + children: [ + new photonui.TabItem({ + title: "Tab 1", + child: new photonui.Label("Widget inside the first tab") + }), + new photonui.TabItem({ + title: "Tab 2", + child: new photonui.Button() + }), + new photonui.TabItem({ + title: "Tab 3" + }) + ] +}); + +photonui.domInsert(tabs, "demo"); +document.getElementById("demo") + .className += " photonui-container-expand-child"; diff --git a/doc/widgets/tablayout.png b/doc/widgets/tablayout.png new file mode 100644 index 00000000..f41403b8 Binary files /dev/null and b/doc/widgets/tablayout.png differ diff --git a/doc/widgets/tablayout.svg b/doc/widgets/tablayout.svg new file mode 100644 index 00000000..aef9c933 --- /dev/null +++ b/doc/widgets/tablayout.svg @@ -0,0 +1,127 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + Tab1 + + + Tab2 + Tab3 + + diff --git a/doc/widgets/tableview.html b/doc/widgets/tableview.html new file mode 100644 index 00000000..8a58d7a6 --- /dev/null +++ b/doc/widgets/tableview.html @@ -0,0 +1,119 @@ + + + + + + + TableView - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

TableView

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+ +
+ + +
+ + + + + + + + diff --git a/doc/widgets/tableview.js b/doc/widgets/tableview.js new file mode 100644 index 00000000..fe056382 --- /dev/null +++ b/doc/widgets/tableview.js @@ -0,0 +1,22 @@ +var tableview = new photonui.TableView({ + items: [ + { name: "John", count: 2, color: "red" }, + { name: "Jane", count: 4, color: "blue" }, + { name: "Janeth", count: 12, color: "green" } + ], + columns: [ + "name", + "count", + { + id: "color", + label: "Color", + value: function(item) { + return new photonui.ColorButton({ value: item.color }) + } + } + ], + multiSelectable: true, + dragAndDroppable: true, +}); + +photonui.domInsert(tableview, "demo"); \ No newline at end of file diff --git a/doc/widgets/template.html b/doc/widgets/template.html new file mode 100644 index 00000000..c6d710ae --- /dev/null +++ b/doc/widgets/template.html @@ -0,0 +1,117 @@ + + + + + + + Template - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

Template

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+
+

Class Reference

+

Templating Syntax

The photonui.Template widget use lodash to generates template. Please read the lodash documentation for mode informations:

+ +

More examples

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
var TEMPLATE = "";
TEMPLATE += "<ul>";
TEMPLATE += "<% for (var i = 0 ; i < list.length ; i++) { %>";
TEMPLATE += "<li><%- list[i] %></li>";
TEMPLATE += "<% } %>";
TEMPLATE += "</ul>";

var tpl = new photonui.Template({
template: TEMPLATE,
data: {
list: ["Item 1", "Item 2", "Item 3"]
}
});

var field = new photonui.TextField({
value: "Item"
});

var btn = new photonui.Button({
text: "Add",
callbacks: {
click: function (widget) {
tpl.data.list.push(field.value);
}
}
})

var box = new photonui.BoxLayout({
children: [
new photonui.BoxLayout({
orientation: "horizontal",
children: [field, btn]
}),
tpl
]
});

photonui.domInsert(box, "demo");;
+ +
+
+ + +
+ + + + + + + + diff --git a/doc/widgets/template.js b/doc/widgets/template.js new file mode 100644 index 00000000..43e284bd --- /dev/null +++ b/doc/widgets/template.js @@ -0,0 +1,17 @@ +var TEMPLATE = ""; +TEMPLATE += "<%- title="" %="">"; +TEMPLATE += ""; + +var tpl = new photonui.Template({ + template: TEMPLATE, + data: { + animals: ["cat", "dog", "parrot", "fish"], + title: "Animals:" + } +}); + +photonui.domInsert(tpl, "demo"); diff --git a/doc/widgets/template.png b/doc/widgets/template.png new file mode 100644 index 00000000..d8f19951 Binary files /dev/null and b/doc/widgets/template.png differ diff --git a/doc/widgets/template.svg b/doc/widgets/template.svg new file mode 100644 index 00000000..bd717dca --- /dev/null +++ b/doc/widgets/template.svg @@ -0,0 +1,88 @@ + + + + + + + + + + image/svg+xml + + + + + + + <%- value%> + + + diff --git a/doc/widgets/text.html b/doc/widgets/text.html new file mode 100644 index 00000000..3d53b2ba --- /dev/null +++ b/doc/widgets/text.html @@ -0,0 +1,100 @@ + + + + + + + Text - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

Text

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+ +
+ + +
+ + + + + + + + diff --git a/doc/widgets/text.js b/doc/widgets/text.js new file mode 100644 index 00000000..a46bc4b9 --- /dev/null +++ b/doc/widgets/text.js @@ -0,0 +1,5 @@ +var text = new photonui.Text({ + rawHtml: "Lorem ipsum dolor sit amet..." +}); + +photonui.domInsert(text, "demo"); diff --git a/doc/widgets/text.png b/doc/widgets/text.png new file mode 100644 index 00000000..00258943 Binary files /dev/null and b/doc/widgets/text.png differ diff --git a/doc/widgets/text.svg b/doc/widgets/text.svg new file mode 100644 index 00000000..5ef0f52d --- /dev/null +++ b/doc/widgets/text.svg @@ -0,0 +1,218 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/widgets/textareafield.html b/doc/widgets/textareafield.html new file mode 100644 index 00000000..8f67c8e2 --- /dev/null +++ b/doc/widgets/textareafield.html @@ -0,0 +1,101 @@ + + + + + + + TextAreaField - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

TextAreaField

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+ +
+ + +
+ + + + + + + + diff --git a/doc/widgets/textareafield.js b/doc/widgets/textareafield.js new file mode 100644 index 00000000..8f780f57 --- /dev/null +++ b/doc/widgets/textareafield.js @@ -0,0 +1,6 @@ +var field = new photonui.TextAreaField({ + placeholder: "placeholder", + value: "This is a\nTextArea" +}); + +photonui.domInsert(field, "demo"); diff --git a/doc/widgets/textareafield.png b/doc/widgets/textareafield.png new file mode 100644 index 00000000..5659c803 Binary files /dev/null and b/doc/widgets/textareafield.png differ diff --git a/doc/widgets/textareafield.svg b/doc/widgets/textareafield.svg new file mode 100644 index 00000000..46b66201 --- /dev/null +++ b/doc/widgets/textareafield.svg @@ -0,0 +1,90 @@ + + + + + + + + + + image/svg+xml + + + + + + + This is aTextArea + + + + diff --git a/doc/widgets/textfield.html b/doc/widgets/textfield.html new file mode 100644 index 00000000..1487b41c --- /dev/null +++ b/doc/widgets/textfield.html @@ -0,0 +1,102 @@ + + + + + + + TextField - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

TextField

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+
+

Class Reference

+

More examples

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
var grid = new photonui.GridLayout({
verticalSpacing: 5,
horizontalSpacing: 5,
children: [
new photonui.Label({
text: "Username:",
forInputName: "username-field",
layoutOptions: {
gridX: 0,
gridY: 0
}
}),
new photonui.TextField({
name: "username-field",
placeholder: "Username",
value: "Anakin",
layoutOptions: {
gridX: 1,
gridY: 0
}
}),
new photonui.Label({
text: "Password:",
forInputName: "password-field",
layoutOptions: {
gridX: 0,
gridY: 1
}
}),
new photonui.TextField({
name: "password-field",
type: "password",
placeholder: "password",
value: "D4RK51D3",
layoutOptions: {
gridX: 1,
gridY: 1
}
}),
new photonui.Button({
text: "Login",
leftIcon: new photonui.FAIcon("fa-sign-in"),
callbacks: {
click: function(widget, event) {
var usernameField = photonui.getWidget("username-field");
var passwordField = photonui.getWidget("password-field");
alert(
"Username: " + usernameField.value +
", Password: " + passwordField.value
);
}
},
layoutOptions: {
gridX: 0,
gridY: 2,
gridWidth: 2
}
})
]
});

photonui.domInsert(grid, "demo");
+ +
+
+ + +
+ + + + + + + + diff --git a/doc/widgets/textfield.js b/doc/widgets/textfield.js new file mode 100644 index 00000000..48dad95e --- /dev/null +++ b/doc/widgets/textfield.js @@ -0,0 +1,6 @@ +var field = new photonui.TextField({ + placeholder: "placeholder", + value: "Text" +}); + +photonui.domInsert(field, "demo"); diff --git a/doc/widgets/textfield.png b/doc/widgets/textfield.png new file mode 100644 index 00000000..e2e2373c Binary files /dev/null and b/doc/widgets/textfield.png differ diff --git a/doc/widgets/textfield.svg b/doc/widgets/textfield.svg new file mode 100644 index 00000000..89303744 --- /dev/null +++ b/doc/widgets/textfield.svg @@ -0,0 +1,86 @@ + + + + + + + + + + image/svg+xml + + + + + + + Text + + + + diff --git a/doc/widgets/togglebutton.html b/doc/widgets/togglebutton.html new file mode 100644 index 00000000..d0c2ca69 --- /dev/null +++ b/doc/widgets/togglebutton.html @@ -0,0 +1,102 @@ + + + + + + + ToggleButton - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

ToggleButton

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+
+

Class Reference

+

More examples

1
2
3
4
5
6
7
8
9
10
11
12
13
var toggle = new photonui.ToggleButton({
value: false,
text: "Value: off",
buttonColor: "red",
callbacks: {
"value-changed": function(widget, value) {
widget.text = "Value: " + ((value) ? "on" : "off");
widget.buttonColor = (value) ? "green" : "red";
}
}
});

photonui.domInsert(toggle, "demo");
+ +
+
+ + +
+ + + + + + + + diff --git a/doc/widgets/togglebutton.js b/doc/widgets/togglebutton.js new file mode 100644 index 00000000..ad333fee --- /dev/null +++ b/doc/widgets/togglebutton.js @@ -0,0 +1,6 @@ +var toggle = new photonui.ToggleButton({ + value: false, + text: "Toggle Button" +}); + +photonui.domInsert(toggle, "demo"); diff --git a/doc/widgets/togglebutton.png b/doc/widgets/togglebutton.png new file mode 100644 index 00000000..e314ea79 Binary files /dev/null and b/doc/widgets/togglebutton.png differ diff --git a/doc/widgets/togglebutton.svg b/doc/widgets/togglebutton.svg new file mode 100644 index 00000000..72e98695 --- /dev/null +++ b/doc/widgets/togglebutton.svg @@ -0,0 +1,99 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + off + + + + + + diff --git a/doc/widgets/translation.html b/doc/widgets/translation.html new file mode 100644 index 00000000..b255ad5f --- /dev/null +++ b/doc/widgets/translation.html @@ -0,0 +1,119 @@ + + + + + + + Translation - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

Translation

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+
+

photonui.Translation adds internationalization functionalities to your application.

+

NOTE: When you instantiate the translation widget, you can pass the noGlobal option to avoid the creation of the global window._ function. If you do so, you will have to use the lazyGettext() method of photonui.Translation instead of the _() global function.

+

Class Reference

+

Extracting strings and generating catalogs

photonui.Translation is based on stone.js. You can find its documentation on GitHub:

+ +

More examples

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// Translation
var tr = new photonui.Translation();
tr.addCatalogs({
"fr": {
"plural-forms": "nplurals=2; plural=(n > 1);",
"messages": {
"Hello World": ["Bonjour le monde"],
'Browser language is "{lang}".': ["La langue du navigateur est « {lang} »."],
"Close": ["Fermer"]
}
},
"it": {
"plural-forms": "nplurals=2; plural=(n != 1);",
"messages": {
"Hello World": ["Buongiorno il mondo"],
'Browser language is "{lang}".': ['La lingua del browser è "{lang}".'],
"Close": ["Chiudere"]
}
}
});
tr.locale = tr.guessUserLanguage(); // Browser language

// Language selector
var layout = new photonui.BoxLayout({
orientation: "vertical",
children: [
new photonui.Label({
text: _('Browser language is "{lang}".', {
lang: tr.guessUserLanguage()
})
}),
new photonui.Select({
name: "lang",
placeholder: "Choose a language...",
value: tr.locale,
children: [
new photonui.MenuItem({value: "en", text: "English"}),
new photonui.MenuItem({value: "fr", text: "Français"}),
new photonui.MenuItem({value: "it", text: "Italiano"}),
],
callbacks: {
"value-changed": function(widget, value) {
tr.locale = value;
}
}
})
]
});
photonui.domInsert(layout, "demo");

// A window
var pos = photonui.Helpers.getAbsolutePosition("demo");
var win = new photonui.Window({
visible: true,
title: _("Hello World"),
x: pos.x, y: pos.y + 100,
width: 250,
padding: 20,
child: new photonui.Button({
text: _("Close"),
callbacks: {
"click": function() { win.hide(); }
}
}),
callbacks: {
"close-button-clicked": function(widget) { widget.hide(); }
}
});
+ +
+
+ + +
+ + + + + + + + diff --git a/doc/widgets/translation.js b/doc/widgets/translation.js new file mode 100644 index 00000000..c71f9f16 --- /dev/null +++ b/doc/widgets/translation.js @@ -0,0 +1,17 @@ +var translation = new photonui.Translation(); + +translation.addCatalogs({ + "fr": { + "messages": { + "Hello World": ["Bonjour le monde"] + } + } +}); + +translation.locale = "fr"; // Change the locale to test + +var label = new photonui.Label({ + text: _("Hello World") +}); + +photonui.domInsert(label, "demo"); diff --git a/doc/widgets/translation.png b/doc/widgets/translation.png new file mode 100644 index 00000000..f5da803a Binary files /dev/null and b/doc/widgets/translation.png differ diff --git a/doc/widgets/translation.svg b/doc/widgets/translation.svg new file mode 100644 index 00000000..ed68ccd2 --- /dev/null +++ b/doc/widgets/translation.svg @@ -0,0 +1,101 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/doc/widgets/viewport.html b/doc/widgets/viewport.html new file mode 100644 index 00000000..3e795841 --- /dev/null +++ b/doc/widgets/viewport.html @@ -0,0 +1,119 @@ + + + + + + + Viewport - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

Viewport

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+
+

photonui.Viewport allows you to define scrollable zones in your UI.

+

Class Reference

+ +
+
+ + +
+ + + + + + + + diff --git a/doc/widgets/viewport.js b/doc/widgets/viewport.js new file mode 100644 index 00000000..c6fe2309 --- /dev/null +++ b/doc/widgets/viewport.js @@ -0,0 +1,23 @@ +var viewport = new photonui.Viewport({ + width: 300, + height: 200, + padding: 5, + horizontalScrollbar: false, // true, false or null (= auto) + verticalScrollbar: null, // true, false or null (= auto) + child: new photonui.BoxLayout({ + children: [ + new photonui.Button(), + new photonui.Button(), + new photonui.Button(), + new photonui.Button(), + new photonui.Button(), + new photonui.Button(), + new photonui.Button(), + new photonui.Button(), + new photonui.Button(), + new photonui.Button() + ] + }) +}); + +photonui.domInsert(viewport, "demo"); diff --git a/doc/widgets/viewport.png b/doc/widgets/viewport.png new file mode 100644 index 00000000..f99aa6ae Binary files /dev/null and b/doc/widgets/viewport.png differ diff --git a/doc/widgets/viewport.svg b/doc/widgets/viewport.svg new file mode 100644 index 00000000..231ed8fd --- /dev/null +++ b/doc/widgets/viewport.svg @@ -0,0 +1,89 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/doc/widgets/window.html b/doc/widgets/window.html new file mode 100644 index 00000000..c4c33ca9 --- /dev/null +++ b/doc/widgets/window.html @@ -0,0 +1,112 @@ + + + + + + + Window - PhotonUI + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +

Window

+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + +
+
+

Class Reference

+

More examples

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Get the position of the #demo area to display windows
// in the right place
var pos = photonui.Helpers.getAbsolutePosition("demo");

// Create a window with a button to center it (x axis) on the page
var win1 = new photonui.Window({
title: "Window 1",
visible: true,
padding: 10,
x: pos.x + 20, y: pos.y + 50,
child: new photonui.Button({
text: "Center Me",
callbacks: {
click: function(widget, event) {
win1.center();
win1.y = pos.y;
}
}
}),
callbacks: {
"close-button-clicked": function(widget) {
widget.destroy();
}
}
});

// Create a second window without "close" button
var win2 = new photonui.Window({
title: "Window 2",
visible: true,
height: 100,
closeButtonVisible: false,
x: pos.x, y: pos.y
});

// Focus the first window
win1.show();
+ +
+
+ + +
+ + + + + + + + diff --git a/doc/widgets/window.js b/doc/widgets/window.js new file mode 100644 index 00000000..a87f5da9 --- /dev/null +++ b/doc/widgets/window.js @@ -0,0 +1,16 @@ +var pos = photonui.Helpers.getAbsolutePosition("demo"); + +new photonui.Window({ + title: "My Window", + visible: true, + x: pos.x, y: pos.y, + width: 300, height: 100, + callbacks: { + "close-button-clicked": function(widget) { + widget.destroy(); + }, + "position-changed": function(widget, x, y) { + widget.title = "My Window (x: " + x + ", y: " + y + ")"; + } + } +}); diff --git a/doc/widgets/window.png b/doc/widgets/window.png new file mode 100644 index 00000000..7da13f61 Binary files /dev/null and b/doc/widgets/window.png differ diff --git a/doc/widgets/window.svg b/doc/widgets/window.svg new file mode 100644 index 00000000..b29572d4 --- /dev/null +++ b/doc/widgets/window.svg @@ -0,0 +1,75 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/fonts/fontawesome/FontAwesome.otf b/fonts/fontawesome/FontAwesome.otf new file mode 100644 index 00000000..f7936cc1 Binary files /dev/null and b/fonts/fontawesome/FontAwesome.otf differ diff --git a/fonts/fontawesome/fontawesome-webfont.eot b/fonts/fontawesome/fontawesome-webfont.eot new file mode 100644 index 00000000..33b2bb80 Binary files /dev/null and b/fonts/fontawesome/fontawesome-webfont.eot differ diff --git a/fonts/fontawesome/fontawesome-webfont.svg b/fonts/fontawesome/fontawesome-webfont.svg new file mode 100644 index 00000000..1ee89d43 --- /dev/null +++ b/fonts/fontawesome/fontawesome-webfont.svg @@ -0,0 +1,565 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/fonts/fontawesome/fontawesome-webfont.ttf b/fonts/fontawesome/fontawesome-webfont.ttf new file mode 100644 index 00000000..ed9372f8 Binary files /dev/null and b/fonts/fontawesome/fontawesome-webfont.ttf differ diff --git a/fonts/fontawesome/fontawesome-webfont.woff b/fonts/fontawesome/fontawesome-webfont.woff new file mode 100644 index 00000000..8b280b98 Binary files /dev/null and b/fonts/fontawesome/fontawesome-webfont.woff differ diff --git a/fonts/fontawesome/fontawesome-webfont.woff2 b/fonts/fontawesome/fontawesome-webfont.woff2 new file mode 100644 index 00000000..3311d585 Binary files /dev/null and b/fonts/fontawesome/fontawesome-webfont.woff2 differ diff --git a/fonts/sourcesanspro/LICENSE.txt b/fonts/sourcesanspro/LICENSE.txt new file mode 100644 index 00000000..11773304 --- /dev/null +++ b/fonts/sourcesanspro/LICENSE.txt @@ -0,0 +1,93 @@ +Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries. + +This Font Software is licensed under the SIL Open Font License, Version 1.1. + +This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/fonts/sourcesanspro/SourceSansPro-It.woff b/fonts/sourcesanspro/SourceSansPro-It.woff new file mode 100644 index 00000000..0f7212ff Binary files /dev/null and b/fonts/sourcesanspro/SourceSansPro-It.woff differ diff --git a/fonts/sourcesanspro/SourceSansPro-Regular.woff b/fonts/sourcesanspro/SourceSansPro-Regular.woff new file mode 100644 index 00000000..46ad53a8 Binary files /dev/null and b/fonts/sourcesanspro/SourceSansPro-Regular.woff differ diff --git a/fonts/sourcesanspro/SourceSansPro-Semibold.woff b/fonts/sourcesanspro/SourceSansPro-Semibold.woff new file mode 100644 index 00000000..ba6e6258 Binary files /dev/null and b/fonts/sourcesanspro/SourceSansPro-Semibold.woff differ diff --git a/fonts/sourcesanspro/SourceSansPro-SemiboldIt.woff b/fonts/sourcesanspro/SourceSansPro-SemiboldIt.woff new file mode 100644 index 00000000..25eb4a75 Binary files /dev/null and b/fonts/sourcesanspro/SourceSansPro-SemiboldIt.woff differ diff --git a/homepage-demo.js b/homepage-demo.js new file mode 100644 index 00000000..49feea02 --- /dev/null +++ b/homepage-demo.js @@ -0,0 +1,17 @@ +var pos = photonui.Helpers.getAbsolutePosition("demo"); + +var win = new photonui.Window({ + title: "Hello Photon", + x: pos.x, y: pos.y, + width: 300, + visible: true, + padding: 10, + child: new photonui.Label({ + text: "Edit the code -->" + }), + callbacks: { + "close-button-clicked": function(widget) { + widget.destroy(); + } + } +}); diff --git a/images/favicon.png b/images/favicon.png new file mode 100644 index 00000000..1391fcca Binary files /dev/null and b/images/favicon.png differ diff --git a/images/photonui-logo_white_300x300.png b/images/photonui-logo_white_300x300.png new file mode 100644 index 00000000..93b135b8 Binary files /dev/null and b/images/photonui-logo_white_300x300.png differ diff --git a/index.html b/index.html new file mode 100644 index 00000000..3019c796 --- /dev/null +++ b/index.html @@ -0,0 +1,558 @@ + + + + + + + PhotonUI: A javascript framework to create user interfaces + + + + + + + + + + +
+
+ +
+ PhotonUI logo +
+ +
+

PhotonUI

+

A javascript framework to create user interfaces

+ +
+ +
+
+ + +
+ + +
+
+
+ +
+
+
+
+ +
+ +
+
+
+
+ + + + + + +
+
+

PhotonUI is a javascript framework to create rich web user interfaces without having to manipulate any HTML nor CSS. PhotonUI can be easily customized and extended to fit your needs.

+

Quick Start Download

+ +

Screenshot

+

Widgets

+ + + + +
+
+ +
+ + + + + + + + diff --git a/js/codemirror-mode-javascript.js b/js/codemirror-mode-javascript.js new file mode 100644 index 00000000..ca875411 --- /dev/null +++ b/js/codemirror-mode-javascript.js @@ -0,0 +1,748 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +// TODO actually recognize syntax of TypeScript constructs + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +function expressionAllowed(stream, state, backUp) { + return /^(?:operator|sof|keyword c|case|new|[\[{}\(,;:]|=>)$/.test(state.lastType) || + (state.lastType == "quasi" && /\{\s*$/.test(stream.string.slice(0, stream.pos - (backUp || 0)))) +} + +CodeMirror.defineMode("javascript", function(config, parserConfig) { + var indentUnit = config.indentUnit; + var statementIndent = parserConfig.statementIndent; + var jsonldMode = parserConfig.jsonld; + var jsonMode = parserConfig.json || jsonldMode; + var isTS = parserConfig.typescript; + var wordRE = parserConfig.wordCharacters || /[\w$\xa1-\uffff]/; + + // Tokenizer + + var keywords = function(){ + function kw(type) {return {type: type, style: "keyword"};} + var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c"); + var operator = kw("operator"), atom = {type: "atom", style: "atom"}; + + var jsKeywords = { + "if": kw("if"), "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B, + "return": C, "break": C, "continue": C, "new": kw("new"), "delete": C, "throw": C, "debugger": C, + "var": kw("var"), "const": kw("var"), "let": kw("var"), + "function": kw("function"), "catch": kw("catch"), + "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"), + "in": operator, "typeof": operator, "instanceof": operator, + "true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom, + "this": kw("this"), "class": kw("class"), "super": kw("atom"), + "yield": C, "export": kw("export"), "import": kw("import"), "extends": C, + "await": C, "async": kw("async") + }; + + // Extend the 'normal' keywords with the TypeScript language extensions + if (isTS) { + var type = {type: "variable", style: "variable-3"}; + var tsKeywords = { + // object-like things + "interface": kw("class"), + "implements": C, + "namespace": C, + "module": kw("module"), + "enum": kw("module"), + + // scope modifiers + "public": kw("modifier"), + "private": kw("modifier"), + "protected": kw("modifier"), + "abstract": kw("modifier"), + + // operators + "as": operator, + + // types + "string": type, "number": type, "boolean": type, "any": type + }; + + for (var attr in tsKeywords) { + jsKeywords[attr] = tsKeywords[attr]; + } + } + + return jsKeywords; + }(); + + var isOperatorChar = /[+\-*&%=<>!?|~^]/; + var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/; + + function readRegexp(stream) { + var escaped = false, next, inSet = false; + while ((next = stream.next()) != null) { + if (!escaped) { + if (next == "/" && !inSet) return; + if (next == "[") inSet = true; + else if (inSet && next == "]") inSet = false; + } + escaped = !escaped && next == "\\"; + } + } + + // Used as scratch variables to communicate multiple values without + // consing up tons of objects. + var type, content; + function ret(tp, style, cont) { + type = tp; content = cont; + return style; + } + function tokenBase(stream, state) { + var ch = stream.next(); + if (ch == '"' || ch == "'") { + state.tokenize = tokenString(ch); + return state.tokenize(stream, state); + } else if (ch == "." && stream.match(/^\d+(?:[eE][+\-]?\d+)?/)) { + return ret("number", "number"); + } else if (ch == "." && stream.match("..")) { + return ret("spread", "meta"); + } else if (/[\[\]{}\(\),;\:\.]/.test(ch)) { + return ret(ch); + } else if (ch == "=" && stream.eat(">")) { + return ret("=>", "operator"); + } else if (ch == "0" && stream.eat(/x/i)) { + stream.eatWhile(/[\da-f]/i); + return ret("number", "number"); + } else if (ch == "0" && stream.eat(/o/i)) { + stream.eatWhile(/[0-7]/i); + return ret("number", "number"); + } else if (ch == "0" && stream.eat(/b/i)) { + stream.eatWhile(/[01]/i); + return ret("number", "number"); + } else if (/\d/.test(ch)) { + stream.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/); + return ret("number", "number"); + } else if (ch == "/") { + if (stream.eat("*")) { + state.tokenize = tokenComment; + return tokenComment(stream, state); + } else if (stream.eat("/")) { + stream.skipToEnd(); + return ret("comment", "comment"); + } else if (expressionAllowed(stream, state, 1)) { + readRegexp(stream); + stream.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/); + return ret("regexp", "string-2"); + } else { + stream.eatWhile(isOperatorChar); + return ret("operator", "operator", stream.current()); + } + } else if (ch == "`") { + state.tokenize = tokenQuasi; + return tokenQuasi(stream, state); + } else if (ch == "#") { + stream.skipToEnd(); + return ret("error", "error"); + } else if (isOperatorChar.test(ch)) { + stream.eatWhile(isOperatorChar); + return ret("operator", "operator", stream.current()); + } else if (wordRE.test(ch)) { + stream.eatWhile(wordRE); + var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word]; + return (known && state.lastType != ".") ? ret(known.type, known.style, word) : + ret("variable", "variable", word); + } + } + + function tokenString(quote) { + return function(stream, state) { + var escaped = false, next; + if (jsonldMode && stream.peek() == "@" && stream.match(isJsonldKeyword)){ + state.tokenize = tokenBase; + return ret("jsonld-keyword", "meta"); + } + while ((next = stream.next()) != null) { + if (next == quote && !escaped) break; + escaped = !escaped && next == "\\"; + } + if (!escaped) state.tokenize = tokenBase; + return ret("string", "string"); + }; + } + + function tokenComment(stream, state) { + var maybeEnd = false, ch; + while (ch = stream.next()) { + if (ch == "/" && maybeEnd) { + state.tokenize = tokenBase; + break; + } + maybeEnd = (ch == "*"); + } + return ret("comment", "comment"); + } + + function tokenQuasi(stream, state) { + var escaped = false, next; + while ((next = stream.next()) != null) { + if (!escaped && (next == "`" || next == "$" && stream.eat("{"))) { + state.tokenize = tokenBase; + break; + } + escaped = !escaped && next == "\\"; + } + return ret("quasi", "string-2", stream.current()); + } + + var brackets = "([{}])"; + // This is a crude lookahead trick to try and notice that we're + // parsing the argument patterns for a fat-arrow function before we + // actually hit the arrow token. It only works if the arrow is on + // the same line as the arguments and there's no strange noise + // (comments) in between. Fallback is to only notice when we hit the + // arrow, and not declare the arguments as locals for the arrow + // body. + function findFatArrow(stream, state) { + if (state.fatArrowAt) state.fatArrowAt = null; + var arrow = stream.string.indexOf("=>", stream.start); + if (arrow < 0) return; + + var depth = 0, sawSomething = false; + for (var pos = arrow - 1; pos >= 0; --pos) { + var ch = stream.string.charAt(pos); + var bracket = brackets.indexOf(ch); + if (bracket >= 0 && bracket < 3) { + if (!depth) { ++pos; break; } + if (--depth == 0) break; + } else if (bracket >= 3 && bracket < 6) { + ++depth; + } else if (wordRE.test(ch)) { + sawSomething = true; + } else if (/["'\/]/.test(ch)) { + return; + } else if (sawSomething && !depth) { + ++pos; + break; + } + } + if (sawSomething && !depth) state.fatArrowAt = pos; + } + + // Parser + + var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true, "this": true, "jsonld-keyword": true}; + + function JSLexical(indented, column, type, align, prev, info) { + this.indented = indented; + this.column = column; + this.type = type; + this.prev = prev; + this.info = info; + if (align != null) this.align = align; + } + + function inScope(state, varname) { + for (var v = state.localVars; v; v = v.next) + if (v.name == varname) return true; + for (var cx = state.context; cx; cx = cx.prev) { + for (var v = cx.vars; v; v = v.next) + if (v.name == varname) return true; + } + } + + function parseJS(state, style, type, content, stream) { + var cc = state.cc; + // Communicate our context to the combinators. + // (Less wasteful than consing up a hundred closures on every call.) + cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; cx.style = style; + + if (!state.lexical.hasOwnProperty("align")) + state.lexical.align = true; + + while(true) { + var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement; + if (combinator(type, content)) { + while(cc.length && cc[cc.length - 1].lex) + cc.pop()(); + if (cx.marked) return cx.marked; + if (type == "variable" && inScope(state, content)) return "variable-2"; + return style; + } + } + } + + // Combinator utils + + var cx = {state: null, column: null, marked: null, cc: null}; + function pass() { + for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]); + } + function cont() { + pass.apply(null, arguments); + return true; + } + function register(varname) { + function inList(list) { + for (var v = list; v; v = v.next) + if (v.name == varname) return true; + return false; + } + var state = cx.state; + cx.marked = "def"; + if (state.context) { + if (inList(state.localVars)) return; + state.localVars = {name: varname, next: state.localVars}; + } else { + if (inList(state.globalVars)) return; + if (parserConfig.globalVars) + state.globalVars = {name: varname, next: state.globalVars}; + } + } + + // Combinators + + var defaultVars = {name: "this", next: {name: "arguments"}}; + function pushcontext() { + cx.state.context = {prev: cx.state.context, vars: cx.state.localVars}; + cx.state.localVars = defaultVars; + } + function popcontext() { + cx.state.localVars = cx.state.context.vars; + cx.state.context = cx.state.context.prev; + } + function pushlex(type, info) { + var result = function() { + var state = cx.state, indent = state.indented; + if (state.lexical.type == "stat") indent = state.lexical.indented; + else for (var outer = state.lexical; outer && outer.type == ")" && outer.align; outer = outer.prev) + indent = outer.indented; + state.lexical = new JSLexical(indent, cx.stream.column(), type, null, state.lexical, info); + }; + result.lex = true; + return result; + } + function poplex() { + var state = cx.state; + if (state.lexical.prev) { + if (state.lexical.type == ")") + state.indented = state.lexical.indented; + state.lexical = state.lexical.prev; + } + } + poplex.lex = true; + + function expect(wanted) { + function exp(type) { + if (type == wanted) return cont(); + else if (wanted == ";") return pass(); + else return cont(exp); + }; + return exp; + } + + function statement(type, value) { + if (type == "var") return cont(pushlex("vardef", value.length), vardef, expect(";"), poplex); + if (type == "keyword a") return cont(pushlex("form"), expression, statement, poplex); + if (type == "keyword b") return cont(pushlex("form"), statement, poplex); + if (type == "{") return cont(pushlex("}"), block, poplex); + if (type == ";") return cont(); + if (type == "if") { + if (cx.state.lexical.info == "else" && cx.state.cc[cx.state.cc.length - 1] == poplex) + cx.state.cc.pop()(); + return cont(pushlex("form"), expression, statement, poplex, maybeelse); + } + if (type == "function") return cont(functiondef); + if (type == "for") return cont(pushlex("form"), forspec, statement, poplex); + if (type == "variable") return cont(pushlex("stat"), maybelabel); + if (type == "switch") return cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"), + block, poplex, poplex); + if (type == "case") return cont(expression, expect(":")); + if (type == "default") return cont(expect(":")); + if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"), + statement, poplex, popcontext); + if (type == "class") return cont(pushlex("form"), className, poplex); + if (type == "export") return cont(pushlex("stat"), afterExport, poplex); + if (type == "import") return cont(pushlex("stat"), afterImport, poplex); + if (type == "module") return cont(pushlex("form"), pattern, pushlex("}"), expect("{"), block, poplex, poplex) + if (type == "async") return cont(statement) + return pass(pushlex("stat"), expression, expect(";"), poplex); + } + function expression(type) { + return expressionInner(type, false); + } + function expressionNoComma(type) { + return expressionInner(type, true); + } + function expressionInner(type, noComma) { + if (cx.state.fatArrowAt == cx.stream.start) { + var body = noComma ? arrowBodyNoComma : arrowBody; + if (type == "(") return cont(pushcontext, pushlex(")"), commasep(pattern, ")"), poplex, expect("=>"), body, popcontext); + else if (type == "variable") return pass(pushcontext, pattern, expect("=>"), body, popcontext); + } + + var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma; + if (atomicTypes.hasOwnProperty(type)) return cont(maybeop); + if (type == "function") return cont(functiondef, maybeop); + if (type == "keyword c") return cont(noComma ? maybeexpressionNoComma : maybeexpression); + if (type == "(") return cont(pushlex(")"), maybeexpression, comprehension, expect(")"), poplex, maybeop); + if (type == "operator" || type == "spread") return cont(noComma ? expressionNoComma : expression); + if (type == "[") return cont(pushlex("]"), arrayLiteral, poplex, maybeop); + if (type == "{") return contCommasep(objprop, "}", null, maybeop); + if (type == "quasi") return pass(quasi, maybeop); + if (type == "new") return cont(maybeTarget(noComma)); + return cont(); + } + function maybeexpression(type) { + if (type.match(/[;\}\)\],]/)) return pass(); + return pass(expression); + } + function maybeexpressionNoComma(type) { + if (type.match(/[;\}\)\],]/)) return pass(); + return pass(expressionNoComma); + } + + function maybeoperatorComma(type, value) { + if (type == ",") return cont(expression); + return maybeoperatorNoComma(type, value, false); + } + function maybeoperatorNoComma(type, value, noComma) { + var me = noComma == false ? maybeoperatorComma : maybeoperatorNoComma; + var expr = noComma == false ? expression : expressionNoComma; + if (type == "=>") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext); + if (type == "operator") { + if (/\+\+|--/.test(value)) return cont(me); + if (value == "?") return cont(expression, expect(":"), expr); + return cont(expr); + } + if (type == "quasi") { return pass(quasi, me); } + if (type == ";") return; + if (type == "(") return contCommasep(expressionNoComma, ")", "call", me); + if (type == ".") return cont(property, me); + if (type == "[") return cont(pushlex("]"), maybeexpression, expect("]"), poplex, me); + } + function quasi(type, value) { + if (type != "quasi") return pass(); + if (value.slice(value.length - 2) != "${") return cont(quasi); + return cont(expression, continueQuasi); + } + function continueQuasi(type) { + if (type == "}") { + cx.marked = "string-2"; + cx.state.tokenize = tokenQuasi; + return cont(quasi); + } + } + function arrowBody(type) { + findFatArrow(cx.stream, cx.state); + return pass(type == "{" ? statement : expression); + } + function arrowBodyNoComma(type) { + findFatArrow(cx.stream, cx.state); + return pass(type == "{" ? statement : expressionNoComma); + } + function maybeTarget(noComma) { + return function(type) { + if (type == ".") return cont(noComma ? targetNoComma : target); + else return pass(noComma ? expressionNoComma : expression); + }; + } + function target(_, value) { + if (value == "target") { cx.marked = "keyword"; return cont(maybeoperatorComma); } + } + function targetNoComma(_, value) { + if (value == "target") { cx.marked = "keyword"; return cont(maybeoperatorNoComma); } + } + function maybelabel(type) { + if (type == ":") return cont(poplex, statement); + return pass(maybeoperatorComma, expect(";"), poplex); + } + function property(type) { + if (type == "variable") {cx.marked = "property"; return cont();} + } + function objprop(type, value) { + if (type == "variable" || cx.style == "keyword") { + cx.marked = "property"; + if (value == "get" || value == "set") return cont(getterSetter); + return cont(afterprop); + } else if (type == "number" || type == "string") { + cx.marked = jsonldMode ? "property" : (cx.style + " property"); + return cont(afterprop); + } else if (type == "jsonld-keyword") { + return cont(afterprop); + } else if (type == "modifier") { + return cont(objprop) + } else if (type == "[") { + return cont(expression, expect("]"), afterprop); + } else if (type == "spread") { + return cont(expression); + } + } + function getterSetter(type) { + if (type != "variable") return pass(afterprop); + cx.marked = "property"; + return cont(functiondef); + } + function afterprop(type) { + if (type == ":") return cont(expressionNoComma); + if (type == "(") return pass(functiondef); + } + function commasep(what, end) { + function proceed(type, value) { + if (type == ",") { + var lex = cx.state.lexical; + if (lex.info == "call") lex.pos = (lex.pos || 0) + 1; + return cont(what, proceed); + } + if (type == end || value == end) return cont(); + return cont(expect(end)); + } + return function(type, value) { + if (type == end || value == end) return cont(); + return pass(what, proceed); + }; + } + function contCommasep(what, end, info) { + for (var i = 3; i < arguments.length; i++) + cx.cc.push(arguments[i]); + return cont(pushlex(end, info), commasep(what, end), poplex); + } + function block(type) { + if (type == "}") return cont(); + return pass(statement, block); + } + function maybetype(type) { + if (isTS && type == ":") return cont(typeexpr); + } + function maybedefault(_, value) { + if (value == "=") return cont(expressionNoComma); + } + function typeexpr(type) { + if (type == "variable") {cx.marked = "variable-3"; return cont(afterType);} + } + function afterType(type, value) { + if (value == "<") return cont(commasep(typeexpr, ">"), afterType) + if (type == "[") return cont(expect("]"), afterType) + } + function vardef() { + return pass(pattern, maybetype, maybeAssign, vardefCont); + } + function pattern(type, value) { + if (type == "modifier") return cont(pattern) + if (type == "variable") { register(value); return cont(); } + if (type == "spread") return cont(pattern); + if (type == "[") return contCommasep(pattern, "]"); + if (type == "{") return contCommasep(proppattern, "}"); + } + function proppattern(type, value) { + if (type == "variable" && !cx.stream.match(/^\s*:/, false)) { + register(value); + return cont(maybeAssign); + } + if (type == "variable") cx.marked = "property"; + if (type == "spread") return cont(pattern); + if (type == "}") return pass(); + return cont(expect(":"), pattern, maybeAssign); + } + function maybeAssign(_type, value) { + if (value == "=") return cont(expressionNoComma); + } + function vardefCont(type) { + if (type == ",") return cont(vardef); + } + function maybeelse(type, value) { + if (type == "keyword b" && value == "else") return cont(pushlex("form", "else"), statement, poplex); + } + function forspec(type) { + if (type == "(") return cont(pushlex(")"), forspec1, expect(")"), poplex); + } + function forspec1(type) { + if (type == "var") return cont(vardef, expect(";"), forspec2); + if (type == ";") return cont(forspec2); + if (type == "variable") return cont(formaybeinof); + return pass(expression, expect(";"), forspec2); + } + function formaybeinof(_type, value) { + if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression); } + return cont(maybeoperatorComma, forspec2); + } + function forspec2(type, value) { + if (type == ";") return cont(forspec3); + if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression); } + return pass(expression, expect(";"), forspec3); + } + function forspec3(type) { + if (type != ")") cont(expression); + } + function functiondef(type, value) { + if (value == "*") {cx.marked = "keyword"; return cont(functiondef);} + if (type == "variable") {register(value); return cont(functiondef);} + if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, maybetype, statement, popcontext); + } + function funarg(type) { + if (type == "spread") return cont(funarg); + return pass(pattern, maybetype, maybedefault); + } + function className(type, value) { + if (type == "variable") {register(value); return cont(classNameAfter);} + } + function classNameAfter(type, value) { + if (value == "extends") return cont(expression, classNameAfter); + if (type == "{") return cont(pushlex("}"), classBody, poplex); + } + function classBody(type, value) { + if (type == "variable" || cx.style == "keyword") { + if (value == "static") { + cx.marked = "keyword"; + return cont(classBody); + } + cx.marked = "property"; + if (value == "get" || value == "set") return cont(classGetterSetter, functiondef, classBody); + return cont(functiondef, classBody); + } + if (value == "*") { + cx.marked = "keyword"; + return cont(classBody); + } + if (type == ";") return cont(classBody); + if (type == "}") return cont(); + } + function classGetterSetter(type) { + if (type != "variable") return pass(); + cx.marked = "property"; + return cont(); + } + function afterExport(_type, value) { + if (value == "*") { cx.marked = "keyword"; return cont(maybeFrom, expect(";")); } + if (value == "default") { cx.marked = "keyword"; return cont(expression, expect(";")); } + return pass(statement); + } + function afterImport(type) { + if (type == "string") return cont(); + return pass(importSpec, maybeFrom); + } + function importSpec(type, value) { + if (type == "{") return contCommasep(importSpec, "}"); + if (type == "variable") register(value); + if (value == "*") cx.marked = "keyword"; + return cont(maybeAs); + } + function maybeAs(_type, value) { + if (value == "as") { cx.marked = "keyword"; return cont(importSpec); } + } + function maybeFrom(_type, value) { + if (value == "from") { cx.marked = "keyword"; return cont(expression); } + } + function arrayLiteral(type) { + if (type == "]") return cont(); + return pass(expressionNoComma, maybeArrayComprehension); + } + function maybeArrayComprehension(type) { + if (type == "for") return pass(comprehension, expect("]")); + if (type == ",") return cont(commasep(maybeexpressionNoComma, "]")); + return pass(commasep(expressionNoComma, "]")); + } + function comprehension(type) { + if (type == "for") return cont(forspec, comprehension); + if (type == "if") return cont(expression, comprehension); + } + + function isContinuedStatement(state, textAfter) { + return state.lastType == "operator" || state.lastType == "," || + isOperatorChar.test(textAfter.charAt(0)) || + /[,.]/.test(textAfter.charAt(0)); + } + + // Interface + + return { + startState: function(basecolumn) { + var state = { + tokenize: tokenBase, + lastType: "sof", + cc: [], + lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false), + localVars: parserConfig.localVars, + context: parserConfig.localVars && {vars: parserConfig.localVars}, + indented: basecolumn || 0 + }; + if (parserConfig.globalVars && typeof parserConfig.globalVars == "object") + state.globalVars = parserConfig.globalVars; + return state; + }, + + token: function(stream, state) { + if (stream.sol()) { + if (!state.lexical.hasOwnProperty("align")) + state.lexical.align = false; + state.indented = stream.indentation(); + findFatArrow(stream, state); + } + if (state.tokenize != tokenComment && stream.eatSpace()) return null; + var style = state.tokenize(stream, state); + if (type == "comment") return style; + state.lastType = type == "operator" && (content == "++" || content == "--") ? "incdec" : type; + return parseJS(state, style, type, content, stream); + }, + + indent: function(state, textAfter) { + if (state.tokenize == tokenComment) return CodeMirror.Pass; + if (state.tokenize != tokenBase) return 0; + var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical; + // Kludge to prevent 'maybelse' from blocking lexical scope pops + if (!/^\s*else\b/.test(textAfter)) for (var i = state.cc.length - 1; i >= 0; --i) { + var c = state.cc[i]; + if (c == poplex) lexical = lexical.prev; + else if (c != maybeelse) break; + } + if (lexical.type == "stat" && firstChar == "}") lexical = lexical.prev; + if (statementIndent && lexical.type == ")" && lexical.prev.type == "stat") + lexical = lexical.prev; + var type = lexical.type, closing = firstChar == type; + + if (type == "vardef") return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? lexical.info + 1 : 0); + else if (type == "form" && firstChar == "{") return lexical.indented; + else if (type == "form") return lexical.indented + indentUnit; + else if (type == "stat") + return lexical.indented + (isContinuedStatement(state, textAfter) ? statementIndent || indentUnit : 0); + else if (lexical.info == "switch" && !closing && parserConfig.doubleIndentSwitch != false) + return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit); + else if (lexical.align) return lexical.column + (closing ? 0 : 1); + else return lexical.indented + (closing ? 0 : indentUnit); + }, + + electricInput: /^\s*(?:case .*?:|default:|\{|\})$/, + blockCommentStart: jsonMode ? null : "/*", + blockCommentEnd: jsonMode ? null : "*/", + lineComment: jsonMode ? null : "//", + fold: "brace", + closeBrackets: "()[]{}''\"\"``", + + helperType: jsonMode ? "json" : "javascript", + jsonldMode: jsonldMode, + jsonMode: jsonMode, + + expressionAllowed: expressionAllowed, + skipExpression: function(state) { + var top = state.cc[state.cc.length - 1] + if (top == expression || top == expressionNoComma) state.cc.pop() + } + }; +}); + +CodeMirror.registerHelper("wordChars", "javascript", /[\w$]/); + +CodeMirror.defineMIME("text/javascript", "javascript"); +CodeMirror.defineMIME("text/ecmascript", "javascript"); +CodeMirror.defineMIME("application/javascript", "javascript"); +CodeMirror.defineMIME("application/x-javascript", "javascript"); +CodeMirror.defineMIME("application/ecmascript", "javascript"); +CodeMirror.defineMIME("application/json", {name: "javascript", json: true}); +CodeMirror.defineMIME("application/x-json", {name: "javascript", json: true}); +CodeMirror.defineMIME("application/ld+json", {name: "javascript", jsonld: true}); +CodeMirror.defineMIME("text/typescript", { name: "javascript", typescript: true }); +CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript: true }); + +}); diff --git a/js/codemirror.js b/js/codemirror.js new file mode 100644 index 00000000..7dc842d3 --- /dev/null +++ b/js/codemirror.js @@ -0,0 +1,8922 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +// This is CodeMirror (http://codemirror.net), a code editor +// implemented in JavaScript on top of the browser's DOM. +// +// You can find some technical background for some of the code below +// at http://marijnhaverbeke.nl/blog/#cm-internals . + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + module.exports = mod(); + else if (typeof define == "function" && define.amd) // AMD + return define([], mod); + else // Plain browser env + (this || window).CodeMirror = mod(); +})(function() { + "use strict"; + + // BROWSER SNIFFING + + // Kludges for bugs and behavior differences that can't be feature + // detected are enabled based on userAgent etc sniffing. + var userAgent = navigator.userAgent; + var platform = navigator.platform; + + var gecko = /gecko\/\d/i.test(userAgent); + var ie_upto10 = /MSIE \d/.test(userAgent); + var ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(userAgent); + var ie = ie_upto10 || ie_11up; + var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : ie_11up[1]); + var webkit = /WebKit\//.test(userAgent); + var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(userAgent); + var chrome = /Chrome\//.test(userAgent); + var presto = /Opera\//.test(userAgent); + var safari = /Apple Computer/.test(navigator.vendor); + var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(userAgent); + var phantom = /PhantomJS/.test(userAgent); + + var ios = /AppleWebKit/.test(userAgent) && /Mobile\/\w+/.test(userAgent); + // This is woefully incomplete. Suggestions for alternative methods welcome. + var mobile = ios || /Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent); + var mac = ios || /Mac/.test(platform); + var chromeOS = /\bCrOS\b/.test(userAgent); + var windows = /win/i.test(platform); + + var presto_version = presto && userAgent.match(/Version\/(\d*\.\d*)/); + if (presto_version) presto_version = Number(presto_version[1]); + if (presto_version && presto_version >= 15) { presto = false; webkit = true; } + // Some browsers use the wrong event properties to signal cmd/ctrl on OS X + var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11)); + var captureRightClick = gecko || (ie && ie_version >= 9); + + // Optimize some code when these features are not used. + var sawReadOnlySpans = false, sawCollapsedSpans = false; + + // EDITOR CONSTRUCTOR + + // A CodeMirror instance represents an editor. This is the object + // that user code is usually dealing with. + + function CodeMirror(place, options) { + if (!(this instanceof CodeMirror)) return new CodeMirror(place, options); + + this.options = options = options ? copyObj(options) : {}; + // Determine effective options based on given values and defaults. + copyObj(defaults, options, false); + setGuttersForLineNumbers(options); + + var doc = options.value; + if (typeof doc == "string") doc = new Doc(doc, options.mode, null, options.lineSeparator); + this.doc = doc; + + var input = new CodeMirror.inputStyles[options.inputStyle](this); + var display = this.display = new Display(place, doc, input); + display.wrapper.CodeMirror = this; + updateGutters(this); + themeChanged(this); + if (options.lineWrapping) + this.display.wrapper.className += " CodeMirror-wrap"; + if (options.autofocus && !mobile) display.input.focus(); + initScrollbars(this); + + this.state = { + keyMaps: [], // stores maps added by addKeyMap + overlays: [], // highlighting overlays, as added by addOverlay + modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info + overwrite: false, + delayingBlurEvent: false, + focused: false, + suppressEdits: false, // used to disable editing during key handlers when in readOnly mode + pasteIncoming: false, cutIncoming: false, // help recognize paste/cut edits in input.poll + selectingText: false, + draggingText: false, + highlight: new Delayed(), // stores highlight worker timeout + keySeq: null, // Unfinished key sequence + specialChars: null + }; + + var cm = this; + + // Override magic textarea content restore that IE sometimes does + // on our hidden textarea on reload + if (ie && ie_version < 11) setTimeout(function() { cm.display.input.reset(true); }, 20); + + registerEventHandlers(this); + ensureGlobalHandlers(); + + startOperation(this); + this.curOp.forceUpdate = true; + attachDoc(this, doc); + + if ((options.autofocus && !mobile) || cm.hasFocus()) + setTimeout(bind(onFocus, this), 20); + else + onBlur(this); + + for (var opt in optionHandlers) if (optionHandlers.hasOwnProperty(opt)) + optionHandlers[opt](this, options[opt], Init); + maybeUpdateLineNumberWidth(this); + if (options.finishInit) options.finishInit(this); + for (var i = 0; i < initHooks.length; ++i) initHooks[i](this); + endOperation(this); + // Suppress optimizelegibility in Webkit, since it breaks text + // measuring on line wrapping boundaries. + if (webkit && options.lineWrapping && + getComputedStyle(display.lineDiv).textRendering == "optimizelegibility") + display.lineDiv.style.textRendering = "auto"; + } + + // DISPLAY CONSTRUCTOR + + // The display handles the DOM integration, both for input reading + // and content drawing. It holds references to DOM nodes and + // display-related state. + + function Display(place, doc, input) { + var d = this; + this.input = input; + + // Covers bottom-right square when both scrollbars are present. + d.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler"); + d.scrollbarFiller.setAttribute("cm-not-content", "true"); + // Covers bottom of gutter when coverGutterNextToScrollbar is on + // and h scrollbar is present. + d.gutterFiller = elt("div", null, "CodeMirror-gutter-filler"); + d.gutterFiller.setAttribute("cm-not-content", "true"); + // Will contain the actual code, positioned to cover the viewport. + d.lineDiv = elt("div", null, "CodeMirror-code"); + // Elements are added to these to represent selection and cursors. + d.selectionDiv = elt("div", null, null, "position: relative; z-index: 1"); + d.cursorDiv = elt("div", null, "CodeMirror-cursors"); + // A visibility: hidden element used to find the size of things. + d.measure = elt("div", null, "CodeMirror-measure"); + // When lines outside of the viewport are measured, they are drawn in this. + d.lineMeasure = elt("div", null, "CodeMirror-measure"); + // Wraps everything that needs to exist inside the vertically-padded coordinate system + d.lineSpace = elt("div", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv], + null, "position: relative; outline: none"); + // Moved around its parent to cover visible view. + d.mover = elt("div", [elt("div", [d.lineSpace], "CodeMirror-lines")], null, "position: relative"); + // Set to the height of the document, allowing scrolling. + d.sizer = elt("div", [d.mover], "CodeMirror-sizer"); + d.sizerWidth = null; + // Behavior of elts with overflow: auto and padding is + // inconsistent across browsers. This is used to ensure the + // scrollable area is big enough. + d.heightForcer = elt("div", null, null, "position: absolute; height: " + scrollerGap + "px; width: 1px;"); + // Will contain the gutters, if any. + d.gutters = elt("div", null, "CodeMirror-gutters"); + d.lineGutter = null; + // Actual scrollable element. + d.scroller = elt("div", [d.sizer, d.heightForcer, d.gutters], "CodeMirror-scroll"); + d.scroller.setAttribute("tabIndex", "-1"); + // The element in which the editor lives. + d.wrapper = elt("div", [d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror"); + + // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported) + if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; } + if (!webkit && !(gecko && mobile)) d.scroller.draggable = true; + + if (place) { + if (place.appendChild) place.appendChild(d.wrapper); + else place(d.wrapper); + } + + // Current rendered range (may be bigger than the view window). + d.viewFrom = d.viewTo = doc.first; + d.reportedViewFrom = d.reportedViewTo = doc.first; + // Information about the rendered lines. + d.view = []; + d.renderedView = null; + // Holds info about a single rendered line when it was rendered + // for measurement, while not in view. + d.externalMeasured = null; + // Empty space (in pixels) above the view + d.viewOffset = 0; + d.lastWrapHeight = d.lastWrapWidth = 0; + d.updateLineNumbers = null; + + d.nativeBarWidth = d.barHeight = d.barWidth = 0; + d.scrollbarsClipped = false; + + // Used to only resize the line number gutter when necessary (when + // the amount of lines crosses a boundary that makes its width change) + d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null; + // Set to true when a non-horizontal-scrolling line widget is + // added. As an optimization, line widget aligning is skipped when + // this is false. + d.alignWidgets = false; + + d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null; + + // Tracks the maximum line length so that the horizontal scrollbar + // can be kept static when scrolling. + d.maxLine = null; + d.maxLineLength = 0; + d.maxLineChanged = false; + + // Used for measuring wheel scrolling granularity + d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null; + + // True when shift is held down. + d.shift = false; + + // Used to track whether anything happened since the context menu + // was opened. + d.selForContextMenu = null; + + d.activeTouch = null; + + input.init(d); + } + + // STATE UPDATES + + // Used to get the editor into a consistent state again when options change. + + function loadMode(cm) { + cm.doc.mode = CodeMirror.getMode(cm.options, cm.doc.modeOption); + resetModeState(cm); + } + + function resetModeState(cm) { + cm.doc.iter(function(line) { + if (line.stateAfter) line.stateAfter = null; + if (line.styles) line.styles = null; + }); + cm.doc.frontier = cm.doc.first; + startWorker(cm, 100); + cm.state.modeGen++; + if (cm.curOp) regChange(cm); + } + + function wrappingChanged(cm) { + if (cm.options.lineWrapping) { + addClass(cm.display.wrapper, "CodeMirror-wrap"); + cm.display.sizer.style.minWidth = ""; + cm.display.sizerWidth = null; + } else { + rmClass(cm.display.wrapper, "CodeMirror-wrap"); + findMaxLine(cm); + } + estimateLineHeights(cm); + regChange(cm); + clearCaches(cm); + setTimeout(function(){updateScrollbars(cm);}, 100); + } + + // Returns a function that estimates the height of a line, to use as + // first approximation until the line becomes visible (and is thus + // properly measurable). + function estimateHeight(cm) { + var th = textHeight(cm.display), wrapping = cm.options.lineWrapping; + var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3); + return function(line) { + if (lineIsHidden(cm.doc, line)) return 0; + + var widgetsHeight = 0; + if (line.widgets) for (var i = 0; i < line.widgets.length; i++) { + if (line.widgets[i].height) widgetsHeight += line.widgets[i].height; + } + + if (wrapping) + return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th; + else + return widgetsHeight + th; + }; + } + + function estimateLineHeights(cm) { + var doc = cm.doc, est = estimateHeight(cm); + doc.iter(function(line) { + var estHeight = est(line); + if (estHeight != line.height) updateLineHeight(line, estHeight); + }); + } + + function themeChanged(cm) { + cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-s-\S+/g, "") + + cm.options.theme.replace(/(^|\s)\s*/g, " cm-s-"); + clearCaches(cm); + } + + function guttersChanged(cm) { + updateGutters(cm); + regChange(cm); + setTimeout(function(){alignHorizontally(cm);}, 20); + } + + // Rebuild the gutter elements, ensure the margin to the left of the + // code matches their width. + function updateGutters(cm) { + var gutters = cm.display.gutters, specs = cm.options.gutters; + removeChildren(gutters); + for (var i = 0; i < specs.length; ++i) { + var gutterClass = specs[i]; + var gElt = gutters.appendChild(elt("div", null, "CodeMirror-gutter " + gutterClass)); + if (gutterClass == "CodeMirror-linenumbers") { + cm.display.lineGutter = gElt; + gElt.style.width = (cm.display.lineNumWidth || 1) + "px"; + } + } + gutters.style.display = i ? "" : "none"; + updateGutterSpace(cm); + } + + function updateGutterSpace(cm) { + var width = cm.display.gutters.offsetWidth; + cm.display.sizer.style.marginLeft = width + "px"; + } + + // Compute the character length of a line, taking into account + // collapsed ranges (see markText) that might hide parts, and join + // other lines onto it. + function lineLength(line) { + if (line.height == 0) return 0; + var len = line.text.length, merged, cur = line; + while (merged = collapsedSpanAtStart(cur)) { + var found = merged.find(0, true); + cur = found.from.line; + len += found.from.ch - found.to.ch; + } + cur = line; + while (merged = collapsedSpanAtEnd(cur)) { + var found = merged.find(0, true); + len -= cur.text.length - found.from.ch; + cur = found.to.line; + len += cur.text.length - found.to.ch; + } + return len; + } + + // Find the longest line in the document. + function findMaxLine(cm) { + var d = cm.display, doc = cm.doc; + d.maxLine = getLine(doc, doc.first); + d.maxLineLength = lineLength(d.maxLine); + d.maxLineChanged = true; + doc.iter(function(line) { + var len = lineLength(line); + if (len > d.maxLineLength) { + d.maxLineLength = len; + d.maxLine = line; + } + }); + } + + // Make sure the gutters options contains the element + // "CodeMirror-linenumbers" when the lineNumbers option is true. + function setGuttersForLineNumbers(options) { + var found = indexOf(options.gutters, "CodeMirror-linenumbers"); + if (found == -1 && options.lineNumbers) { + options.gutters = options.gutters.concat(["CodeMirror-linenumbers"]); + } else if (found > -1 && !options.lineNumbers) { + options.gutters = options.gutters.slice(0); + options.gutters.splice(found, 1); + } + } + + // SCROLLBARS + + // Prepare DOM reads needed to update the scrollbars. Done in one + // shot to minimize update/measure roundtrips. + function measureForScrollbars(cm) { + var d = cm.display, gutterW = d.gutters.offsetWidth; + var docH = Math.round(cm.doc.height + paddingVert(cm.display)); + return { + clientHeight: d.scroller.clientHeight, + viewHeight: d.wrapper.clientHeight, + scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth, + viewWidth: d.wrapper.clientWidth, + barLeft: cm.options.fixedGutter ? gutterW : 0, + docHeight: docH, + scrollHeight: docH + scrollGap(cm) + d.barHeight, + nativeBarWidth: d.nativeBarWidth, + gutterWidth: gutterW + }; + } + + function NativeScrollbars(place, scroll, cm) { + this.cm = cm; + var vert = this.vert = elt("div", [elt("div", null, null, "min-width: 1px")], "CodeMirror-vscrollbar"); + var horiz = this.horiz = elt("div", [elt("div", null, null, "height: 100%; min-height: 1px")], "CodeMirror-hscrollbar"); + place(vert); place(horiz); + + on(vert, "scroll", function() { + if (vert.clientHeight) scroll(vert.scrollTop, "vertical"); + }); + on(horiz, "scroll", function() { + if (horiz.clientWidth) scroll(horiz.scrollLeft, "horizontal"); + }); + + this.checkedZeroWidth = false; + // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8). + if (ie && ie_version < 8) this.horiz.style.minHeight = this.vert.style.minWidth = "18px"; + } + + NativeScrollbars.prototype = copyObj({ + update: function(measure) { + var needsH = measure.scrollWidth > measure.clientWidth + 1; + var needsV = measure.scrollHeight > measure.clientHeight + 1; + var sWidth = measure.nativeBarWidth; + + if (needsV) { + this.vert.style.display = "block"; + this.vert.style.bottom = needsH ? sWidth + "px" : "0"; + var totalHeight = measure.viewHeight - (needsH ? sWidth : 0); + // A bug in IE8 can cause this value to be negative, so guard it. + this.vert.firstChild.style.height = + Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + "px"; + } else { + this.vert.style.display = ""; + this.vert.firstChild.style.height = "0"; + } + + if (needsH) { + this.horiz.style.display = "block"; + this.horiz.style.right = needsV ? sWidth + "px" : "0"; + this.horiz.style.left = measure.barLeft + "px"; + var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0); + this.horiz.firstChild.style.width = + (measure.scrollWidth - measure.clientWidth + totalWidth) + "px"; + } else { + this.horiz.style.display = ""; + this.horiz.firstChild.style.width = "0"; + } + + if (!this.checkedZeroWidth && measure.clientHeight > 0) { + if (sWidth == 0) this.zeroWidthHack(); + this.checkedZeroWidth = true; + } + + return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0}; + }, + setScrollLeft: function(pos) { + if (this.horiz.scrollLeft != pos) this.horiz.scrollLeft = pos; + if (this.disableHoriz) this.enableZeroWidthBar(this.horiz, this.disableHoriz); + }, + setScrollTop: function(pos) { + if (this.vert.scrollTop != pos) this.vert.scrollTop = pos; + if (this.disableVert) this.enableZeroWidthBar(this.vert, this.disableVert); + }, + zeroWidthHack: function() { + var w = mac && !mac_geMountainLion ? "12px" : "18px"; + this.horiz.style.height = this.vert.style.width = w; + this.horiz.style.pointerEvents = this.vert.style.pointerEvents = "none"; + this.disableHoriz = new Delayed; + this.disableVert = new Delayed; + }, + enableZeroWidthBar: function(bar, delay) { + bar.style.pointerEvents = "auto"; + function maybeDisable() { + // To find out whether the scrollbar is still visible, we + // check whether the element under the pixel in the bottom + // left corner of the scrollbar box is the scrollbar box + // itself (when the bar is still visible) or its filler child + // (when the bar is hidden). If it is still visible, we keep + // it enabled, if it's hidden, we disable pointer events. + var box = bar.getBoundingClientRect(); + var elt = document.elementFromPoint(box.left + 1, box.bottom - 1); + if (elt != bar) bar.style.pointerEvents = "none"; + else delay.set(1000, maybeDisable); + } + delay.set(1000, maybeDisable); + }, + clear: function() { + var parent = this.horiz.parentNode; + parent.removeChild(this.horiz); + parent.removeChild(this.vert); + } + }, NativeScrollbars.prototype); + + function NullScrollbars() {} + + NullScrollbars.prototype = copyObj({ + update: function() { return {bottom: 0, right: 0}; }, + setScrollLeft: function() {}, + setScrollTop: function() {}, + clear: function() {} + }, NullScrollbars.prototype); + + CodeMirror.scrollbarModel = {"native": NativeScrollbars, "null": NullScrollbars}; + + function initScrollbars(cm) { + if (cm.display.scrollbars) { + cm.display.scrollbars.clear(); + if (cm.display.scrollbars.addClass) + rmClass(cm.display.wrapper, cm.display.scrollbars.addClass); + } + + cm.display.scrollbars = new CodeMirror.scrollbarModel[cm.options.scrollbarStyle](function(node) { + cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller); + // Prevent clicks in the scrollbars from killing focus + on(node, "mousedown", function() { + if (cm.state.focused) setTimeout(function() { cm.display.input.focus(); }, 0); + }); + node.setAttribute("cm-not-content", "true"); + }, function(pos, axis) { + if (axis == "horizontal") setScrollLeft(cm, pos); + else setScrollTop(cm, pos); + }, cm); + if (cm.display.scrollbars.addClass) + addClass(cm.display.wrapper, cm.display.scrollbars.addClass); + } + + function updateScrollbars(cm, measure) { + if (!measure) measure = measureForScrollbars(cm); + var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight; + updateScrollbarsInner(cm, measure); + for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) { + if (startWidth != cm.display.barWidth && cm.options.lineWrapping) + updateHeightsInViewport(cm); + updateScrollbarsInner(cm, measureForScrollbars(cm)); + startWidth = cm.display.barWidth; startHeight = cm.display.barHeight; + } + } + + // Re-synchronize the fake scrollbars with the actual size of the + // content. + function updateScrollbarsInner(cm, measure) { + var d = cm.display; + var sizes = d.scrollbars.update(measure); + + d.sizer.style.paddingRight = (d.barWidth = sizes.right) + "px"; + d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + "px"; + d.heightForcer.style.borderBottom = sizes.bottom + "px solid transparent" + + if (sizes.right && sizes.bottom) { + d.scrollbarFiller.style.display = "block"; + d.scrollbarFiller.style.height = sizes.bottom + "px"; + d.scrollbarFiller.style.width = sizes.right + "px"; + } else d.scrollbarFiller.style.display = ""; + if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) { + d.gutterFiller.style.display = "block"; + d.gutterFiller.style.height = sizes.bottom + "px"; + d.gutterFiller.style.width = measure.gutterWidth + "px"; + } else d.gutterFiller.style.display = ""; + } + + // Compute the lines that are visible in a given viewport (defaults + // the the current scroll position). viewport may contain top, + // height, and ensure (see op.scrollToPos) properties. + function visibleLines(display, doc, viewport) { + var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop; + top = Math.floor(top - paddingTop(display)); + var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight; + + var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom); + // Ensure is a {from: {line, ch}, to: {line, ch}} object, and + // forces those lines into the viewport (if possible). + if (viewport && viewport.ensure) { + var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line; + if (ensureFrom < from) { + from = ensureFrom; + to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight); + } else if (Math.min(ensureTo, doc.lastLine()) >= to) { + from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight); + to = ensureTo; + } + } + return {from: from, to: Math.max(to, from + 1)}; + } + + // LINE NUMBERS + + // Re-align line numbers and gutter marks to compensate for + // horizontal scrolling. + function alignHorizontally(cm) { + var display = cm.display, view = display.view; + if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return; + var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft; + var gutterW = display.gutters.offsetWidth, left = comp + "px"; + for (var i = 0; i < view.length; i++) if (!view[i].hidden) { + if (cm.options.fixedGutter && view[i].gutter) + view[i].gutter.style.left = left; + var align = view[i].alignable; + if (align) for (var j = 0; j < align.length; j++) + align[j].style.left = left; + } + if (cm.options.fixedGutter) + display.gutters.style.left = (comp + gutterW) + "px"; + } + + // Used to ensure that the line number gutter is still the right + // size for the current document size. Returns true when an update + // is needed. + function maybeUpdateLineNumberWidth(cm) { + if (!cm.options.lineNumbers) return false; + var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display; + if (last.length != display.lineNumChars) { + var test = display.measure.appendChild(elt("div", [elt("div", last)], + "CodeMirror-linenumber CodeMirror-gutter-elt")); + var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW; + display.lineGutter.style.width = ""; + display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1; + display.lineNumWidth = display.lineNumInnerWidth + padding; + display.lineNumChars = display.lineNumInnerWidth ? last.length : -1; + display.lineGutter.style.width = display.lineNumWidth + "px"; + updateGutterSpace(cm); + return true; + } + return false; + } + + function lineNumberFor(options, i) { + return String(options.lineNumberFormatter(i + options.firstLineNumber)); + } + + // Computes display.scroller.scrollLeft + display.gutters.offsetWidth, + // but using getBoundingClientRect to get a sub-pixel-accurate + // result. + function compensateForHScroll(display) { + return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left; + } + + // DISPLAY DRAWING + + function DisplayUpdate(cm, viewport, force) { + var display = cm.display; + + this.viewport = viewport; + // Store some values that we'll need later (but don't want to force a relayout for) + this.visible = visibleLines(display, cm.doc, viewport); + this.editorIsHidden = !display.wrapper.offsetWidth; + this.wrapperHeight = display.wrapper.clientHeight; + this.wrapperWidth = display.wrapper.clientWidth; + this.oldDisplayWidth = displayWidth(cm); + this.force = force; + this.dims = getDimensions(cm); + this.events = []; + } + + DisplayUpdate.prototype.signal = function(emitter, type) { + if (hasHandler(emitter, type)) + this.events.push(arguments); + }; + DisplayUpdate.prototype.finish = function() { + for (var i = 0; i < this.events.length; i++) + signal.apply(null, this.events[i]); + }; + + function maybeClipScrollbars(cm) { + var display = cm.display; + if (!display.scrollbarsClipped && display.scroller.offsetWidth) { + display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth; + display.heightForcer.style.height = scrollGap(cm) + "px"; + display.sizer.style.marginBottom = -display.nativeBarWidth + "px"; + display.sizer.style.borderRightWidth = scrollGap(cm) + "px"; + display.scrollbarsClipped = true; + } + } + + // Does the actual updating of the line display. Bails out + // (returning false) when there is nothing to be done and forced is + // false. + function updateDisplayIfNeeded(cm, update) { + var display = cm.display, doc = cm.doc; + + if (update.editorIsHidden) { + resetView(cm); + return false; + } + + // Bail out if the visible area is already rendered and nothing changed. + if (!update.force && + update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo && + (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) && + display.renderedView == display.view && countDirtyView(cm) == 0) + return false; + + if (maybeUpdateLineNumberWidth(cm)) { + resetView(cm); + update.dims = getDimensions(cm); + } + + // Compute a suitable new viewport (from & to) + var end = doc.first + doc.size; + var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first); + var to = Math.min(end, update.visible.to + cm.options.viewportMargin); + if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom); + if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo); + if (sawCollapsedSpans) { + from = visualLineNo(cm.doc, from); + to = visualLineEndNo(cm.doc, to); + } + + var different = from != display.viewFrom || to != display.viewTo || + display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth; + adjustView(cm, from, to); + + display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom)); + // Position the mover div to align with the current scroll position + cm.display.mover.style.top = display.viewOffset + "px"; + + var toUpdate = countDirtyView(cm); + if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view && + (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo)) + return false; + + // For big changes, we hide the enclosing element during the + // update, since that speeds up the operations on most browsers. + var focused = activeElt(); + if (toUpdate > 4) display.lineDiv.style.display = "none"; + patchDisplay(cm, display.updateLineNumbers, update.dims); + if (toUpdate > 4) display.lineDiv.style.display = ""; + display.renderedView = display.view; + // There might have been a widget with a focused element that got + // hidden or updated, if so re-focus it. + if (focused && activeElt() != focused && focused.offsetHeight) focused.focus(); + + // Prevent selection and cursors from interfering with the scroll + // width and height. + removeChildren(display.cursorDiv); + removeChildren(display.selectionDiv); + display.gutters.style.height = display.sizer.style.minHeight = 0; + + if (different) { + display.lastWrapHeight = update.wrapperHeight; + display.lastWrapWidth = update.wrapperWidth; + startWorker(cm, 400); + } + + display.updateLineNumbers = null; + + return true; + } + + function postUpdateDisplay(cm, update) { + var viewport = update.viewport; + + for (var first = true;; first = false) { + if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) { + // Clip forced viewport to actual scrollable area. + if (viewport && viewport.top != null) + viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)}; + // Updated line heights might result in the drawn area not + // actually covering the viewport. Keep looping until it does. + update.visible = visibleLines(cm.display, cm.doc, viewport); + if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo) + break; + } + if (!updateDisplayIfNeeded(cm, update)) break; + updateHeightsInViewport(cm); + var barMeasure = measureForScrollbars(cm); + updateSelection(cm); + updateScrollbars(cm, barMeasure); + setDocumentHeight(cm, barMeasure); + } + + update.signal(cm, "update", cm); + if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) { + update.signal(cm, "viewportChange", cm, cm.display.viewFrom, cm.display.viewTo); + cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo; + } + } + + function updateDisplaySimple(cm, viewport) { + var update = new DisplayUpdate(cm, viewport); + if (updateDisplayIfNeeded(cm, update)) { + updateHeightsInViewport(cm); + postUpdateDisplay(cm, update); + var barMeasure = measureForScrollbars(cm); + updateSelection(cm); + updateScrollbars(cm, barMeasure); + setDocumentHeight(cm, barMeasure); + update.finish(); + } + } + + function setDocumentHeight(cm, measure) { + cm.display.sizer.style.minHeight = measure.docHeight + "px"; + cm.display.heightForcer.style.top = measure.docHeight + "px"; + cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + "px"; + } + + // Read the actual heights of the rendered lines, and update their + // stored heights to match. + function updateHeightsInViewport(cm) { + var display = cm.display; + var prevBottom = display.lineDiv.offsetTop; + for (var i = 0; i < display.view.length; i++) { + var cur = display.view[i], height; + if (cur.hidden) continue; + if (ie && ie_version < 8) { + var bot = cur.node.offsetTop + cur.node.offsetHeight; + height = bot - prevBottom; + prevBottom = bot; + } else { + var box = cur.node.getBoundingClientRect(); + height = box.bottom - box.top; + } + var diff = cur.line.height - height; + if (height < 2) height = textHeight(display); + if (diff > .001 || diff < -.001) { + updateLineHeight(cur.line, height); + updateWidgetHeight(cur.line); + if (cur.rest) for (var j = 0; j < cur.rest.length; j++) + updateWidgetHeight(cur.rest[j]); + } + } + } + + // Read and store the height of line widgets associated with the + // given line. + function updateWidgetHeight(line) { + if (line.widgets) for (var i = 0; i < line.widgets.length; ++i) + line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight; + } + + // Do a bulk-read of the DOM positions and sizes needed to draw the + // view, so that we don't interleave reading and writing to the DOM. + function getDimensions(cm) { + var d = cm.display, left = {}, width = {}; + var gutterLeft = d.gutters.clientLeft; + for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) { + left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft; + width[cm.options.gutters[i]] = n.clientWidth; + } + return {fixedPos: compensateForHScroll(d), + gutterTotalWidth: d.gutters.offsetWidth, + gutterLeft: left, + gutterWidth: width, + wrapperWidth: d.wrapper.clientWidth}; + } + + // Sync the actual display DOM structure with display.view, removing + // nodes for lines that are no longer in view, and creating the ones + // that are not there yet, and updating the ones that are out of + // date. + function patchDisplay(cm, updateNumbersFrom, dims) { + var display = cm.display, lineNumbers = cm.options.lineNumbers; + var container = display.lineDiv, cur = container.firstChild; + + function rm(node) { + var next = node.nextSibling; + // Works around a throw-scroll bug in OS X Webkit + if (webkit && mac && cm.display.currentWheelTarget == node) + node.style.display = "none"; + else + node.parentNode.removeChild(node); + return next; + } + + var view = display.view, lineN = display.viewFrom; + // Loop over the elements in the view, syncing cur (the DOM nodes + // in display.lineDiv) with the view as we go. + for (var i = 0; i < view.length; i++) { + var lineView = view[i]; + if (lineView.hidden) { + } else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet + var node = buildLineElement(cm, lineView, lineN, dims); + container.insertBefore(node, cur); + } else { // Already drawn + while (cur != lineView.node) cur = rm(cur); + var updateNumber = lineNumbers && updateNumbersFrom != null && + updateNumbersFrom <= lineN && lineView.lineNumber; + if (lineView.changes) { + if (indexOf(lineView.changes, "gutter") > -1) updateNumber = false; + updateLineForChanges(cm, lineView, lineN, dims); + } + if (updateNumber) { + removeChildren(lineView.lineNumber); + lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN))); + } + cur = lineView.node.nextSibling; + } + lineN += lineView.size; + } + while (cur) cur = rm(cur); + } + + // When an aspect of a line changes, a string is added to + // lineView.changes. This updates the relevant part of the line's + // DOM structure. + function updateLineForChanges(cm, lineView, lineN, dims) { + for (var j = 0; j < lineView.changes.length; j++) { + var type = lineView.changes[j]; + if (type == "text") updateLineText(cm, lineView); + else if (type == "gutter") updateLineGutter(cm, lineView, lineN, dims); + else if (type == "class") updateLineClasses(lineView); + else if (type == "widget") updateLineWidgets(cm, lineView, dims); + } + lineView.changes = null; + } + + // Lines with gutter elements, widgets or a background class need to + // be wrapped, and have the extra elements added to the wrapper div + function ensureLineWrapped(lineView) { + if (lineView.node == lineView.text) { + lineView.node = elt("div", null, null, "position: relative"); + if (lineView.text.parentNode) + lineView.text.parentNode.replaceChild(lineView.node, lineView.text); + lineView.node.appendChild(lineView.text); + if (ie && ie_version < 8) lineView.node.style.zIndex = 2; + } + return lineView.node; + } + + function updateLineBackground(lineView) { + var cls = lineView.bgClass ? lineView.bgClass + " " + (lineView.line.bgClass || "") : lineView.line.bgClass; + if (cls) cls += " CodeMirror-linebackground"; + if (lineView.background) { + if (cls) lineView.background.className = cls; + else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; } + } else if (cls) { + var wrap = ensureLineWrapped(lineView); + lineView.background = wrap.insertBefore(elt("div", null, cls), wrap.firstChild); + } + } + + // Wrapper around buildLineContent which will reuse the structure + // in display.externalMeasured when possible. + function getLineContent(cm, lineView) { + var ext = cm.display.externalMeasured; + if (ext && ext.line == lineView.line) { + cm.display.externalMeasured = null; + lineView.measure = ext.measure; + return ext.built; + } + return buildLineContent(cm, lineView); + } + + // Redraw the line's text. Interacts with the background and text + // classes because the mode may output tokens that influence these + // classes. + function updateLineText(cm, lineView) { + var cls = lineView.text.className; + var built = getLineContent(cm, lineView); + if (lineView.text == lineView.node) lineView.node = built.pre; + lineView.text.parentNode.replaceChild(built.pre, lineView.text); + lineView.text = built.pre; + if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) { + lineView.bgClass = built.bgClass; + lineView.textClass = built.textClass; + updateLineClasses(lineView); + } else if (cls) { + lineView.text.className = cls; + } + } + + function updateLineClasses(lineView) { + updateLineBackground(lineView); + if (lineView.line.wrapClass) + ensureLineWrapped(lineView).className = lineView.line.wrapClass; + else if (lineView.node != lineView.text) + lineView.node.className = ""; + var textClass = lineView.textClass ? lineView.textClass + " " + (lineView.line.textClass || "") : lineView.line.textClass; + lineView.text.className = textClass || ""; + } + + function updateLineGutter(cm, lineView, lineN, dims) { + if (lineView.gutter) { + lineView.node.removeChild(lineView.gutter); + lineView.gutter = null; + } + if (lineView.gutterBackground) { + lineView.node.removeChild(lineView.gutterBackground); + lineView.gutterBackground = null; + } + if (lineView.line.gutterClass) { + var wrap = ensureLineWrapped(lineView); + lineView.gutterBackground = elt("div", null, "CodeMirror-gutter-background " + lineView.line.gutterClass, + "left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + + "px; width: " + dims.gutterTotalWidth + "px"); + wrap.insertBefore(lineView.gutterBackground, lineView.text); + } + var markers = lineView.line.gutterMarkers; + if (cm.options.lineNumbers || markers) { + var wrap = ensureLineWrapped(lineView); + var gutterWrap = lineView.gutter = elt("div", null, "CodeMirror-gutter-wrapper", "left: " + + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px"); + cm.display.input.setUneditable(gutterWrap); + wrap.insertBefore(gutterWrap, lineView.text); + if (lineView.line.gutterClass) + gutterWrap.className += " " + lineView.line.gutterClass; + if (cm.options.lineNumbers && (!markers || !markers["CodeMirror-linenumbers"])) + lineView.lineNumber = gutterWrap.appendChild( + elt("div", lineNumberFor(cm.options, lineN), + "CodeMirror-linenumber CodeMirror-gutter-elt", + "left: " + dims.gutterLeft["CodeMirror-linenumbers"] + "px; width: " + + cm.display.lineNumInnerWidth + "px")); + if (markers) for (var k = 0; k < cm.options.gutters.length; ++k) { + var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id]; + if (found) + gutterWrap.appendChild(elt("div", [found], "CodeMirror-gutter-elt", "left: " + + dims.gutterLeft[id] + "px; width: " + dims.gutterWidth[id] + "px")); + } + } + } + + function updateLineWidgets(cm, lineView, dims) { + if (lineView.alignable) lineView.alignable = null; + for (var node = lineView.node.firstChild, next; node; node = next) { + var next = node.nextSibling; + if (node.className == "CodeMirror-linewidget") + lineView.node.removeChild(node); + } + insertLineWidgets(cm, lineView, dims); + } + + // Build a line's DOM representation from scratch + function buildLineElement(cm, lineView, lineN, dims) { + var built = getLineContent(cm, lineView); + lineView.text = lineView.node = built.pre; + if (built.bgClass) lineView.bgClass = built.bgClass; + if (built.textClass) lineView.textClass = built.textClass; + + updateLineClasses(lineView); + updateLineGutter(cm, lineView, lineN, dims); + insertLineWidgets(cm, lineView, dims); + return lineView.node; + } + + // A lineView may contain multiple logical lines (when merged by + // collapsed spans). The widgets for all of them need to be drawn. + function insertLineWidgets(cm, lineView, dims) { + insertLineWidgetsFor(cm, lineView.line, lineView, dims, true); + if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++) + insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); + } + + function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) { + if (!line.widgets) return; + var wrap = ensureLineWrapped(lineView); + for (var i = 0, ws = line.widgets; i < ws.length; ++i) { + var widget = ws[i], node = elt("div", [widget.node], "CodeMirror-linewidget"); + if (!widget.handleMouseEvents) node.setAttribute("cm-ignore-events", "true"); + positionLineWidget(widget, node, lineView, dims); + cm.display.input.setUneditable(node); + if (allowAbove && widget.above) + wrap.insertBefore(node, lineView.gutter || lineView.text); + else + wrap.appendChild(node); + signalLater(widget, "redraw"); + } + } + + function positionLineWidget(widget, node, lineView, dims) { + if (widget.noHScroll) { + (lineView.alignable || (lineView.alignable = [])).push(node); + var width = dims.wrapperWidth; + node.style.left = dims.fixedPos + "px"; + if (!widget.coverGutter) { + width -= dims.gutterTotalWidth; + node.style.paddingLeft = dims.gutterTotalWidth + "px"; + } + node.style.width = width + "px"; + } + if (widget.coverGutter) { + node.style.zIndex = 5; + node.style.position = "relative"; + if (!widget.noHScroll) node.style.marginLeft = -dims.gutterTotalWidth + "px"; + } + } + + // POSITION OBJECT + + // A Pos instance represents a position within the text. + var Pos = CodeMirror.Pos = function(line, ch) { + if (!(this instanceof Pos)) return new Pos(line, ch); + this.line = line; this.ch = ch; + }; + + // Compare two positions, return 0 if they are the same, a negative + // number when a is less, and a positive number otherwise. + var cmp = CodeMirror.cmpPos = function(a, b) { return a.line - b.line || a.ch - b.ch; }; + + function copyPos(x) {return Pos(x.line, x.ch);} + function maxPos(a, b) { return cmp(a, b) < 0 ? b : a; } + function minPos(a, b) { return cmp(a, b) < 0 ? a : b; } + + // INPUT HANDLING + + function ensureFocus(cm) { + if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm); } + } + + // This will be set to a {lineWise: bool, text: [string]} object, so + // that, when pasting, we know what kind of selections the copied + // text was made out of. + var lastCopied = null; + + function applyTextInput(cm, inserted, deleted, sel, origin) { + var doc = cm.doc; + cm.display.shift = false; + if (!sel) sel = doc.sel; + + var paste = cm.state.pasteIncoming || origin == "paste"; + var textLines = doc.splitLines(inserted), multiPaste = null + // When pasing N lines into N selections, insert one line per selection + if (paste && sel.ranges.length > 1) { + if (lastCopied && lastCopied.text.join("\n") == inserted) { + if (sel.ranges.length % lastCopied.text.length == 0) { + multiPaste = []; + for (var i = 0; i < lastCopied.text.length; i++) + multiPaste.push(doc.splitLines(lastCopied.text[i])); + } + } else if (textLines.length == sel.ranges.length) { + multiPaste = map(textLines, function(l) { return [l]; }); + } + } + + // Normal behavior is to insert the new text into every selection + for (var i = sel.ranges.length - 1; i >= 0; i--) { + var range = sel.ranges[i]; + var from = range.from(), to = range.to(); + if (range.empty()) { + if (deleted && deleted > 0) // Handle deletion + from = Pos(from.line, from.ch - deleted); + else if (cm.state.overwrite && !paste) // Handle overwrite + to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); + else if (lastCopied && lastCopied.lineWise && lastCopied.text.join("\n") == inserted) + from = to = Pos(from.line, 0) + } + var updateInput = cm.curOp.updateInput; + var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i % multiPaste.length] : textLines, + origin: origin || (paste ? "paste" : cm.state.cutIncoming ? "cut" : "+input")}; + makeChange(cm.doc, changeEvent); + signalLater(cm, "inputRead", cm, changeEvent); + } + if (inserted && !paste) + triggerElectric(cm, inserted); + + ensureCursorVisible(cm); + cm.curOp.updateInput = updateInput; + cm.curOp.typing = true; + cm.state.pasteIncoming = cm.state.cutIncoming = false; + } + + function handlePaste(e, cm) { + var pasted = e.clipboardData && e.clipboardData.getData("text/plain"); + if (pasted) { + e.preventDefault(); + if (!cm.isReadOnly() && !cm.options.disableInput) + runInOp(cm, function() { applyTextInput(cm, pasted, 0, null, "paste"); }); + return true; + } + } + + function triggerElectric(cm, inserted) { + // When an 'electric' character is inserted, immediately trigger a reindent + if (!cm.options.electricChars || !cm.options.smartIndent) return; + var sel = cm.doc.sel; + + for (var i = sel.ranges.length - 1; i >= 0; i--) { + var range = sel.ranges[i]; + if (range.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range.head.line)) continue; + var mode = cm.getModeAt(range.head); + var indented = false; + if (mode.electricChars) { + for (var j = 0; j < mode.electricChars.length; j++) + if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) { + indented = indentLine(cm, range.head.line, "smart"); + break; + } + } else if (mode.electricInput) { + if (mode.electricInput.test(getLine(cm.doc, range.head.line).text.slice(0, range.head.ch))) + indented = indentLine(cm, range.head.line, "smart"); + } + if (indented) signalLater(cm, "electricInput", cm, range.head.line); + } + } + + function copyableRanges(cm) { + var text = [], ranges = []; + for (var i = 0; i < cm.doc.sel.ranges.length; i++) { + var line = cm.doc.sel.ranges[i].head.line; + var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)}; + ranges.push(lineRange); + text.push(cm.getRange(lineRange.anchor, lineRange.head)); + } + return {text: text, ranges: ranges}; + } + + function disableBrowserMagic(field) { + field.setAttribute("autocorrect", "off"); + field.setAttribute("autocapitalize", "off"); + field.setAttribute("spellcheck", "false"); + } + + // TEXTAREA INPUT STYLE + + function TextareaInput(cm) { + this.cm = cm; + // See input.poll and input.reset + this.prevInput = ""; + + // Flag that indicates whether we expect input to appear real soon + // now (after some event like 'keypress' or 'input') and are + // polling intensively. + this.pollingFast = false; + // Self-resetting timeout for the poller + this.polling = new Delayed(); + // Tracks when input.reset has punted to just putting a short + // string into the textarea instead of the full selection. + this.inaccurateSelection = false; + // Used to work around IE issue with selection being forgotten when focus moves away from textarea + this.hasSelection = false; + this.composing = null; + }; + + function hiddenTextarea() { + var te = elt("textarea", null, null, "position: absolute; padding: 0; width: 1px; height: 1em; outline: none"); + var div = elt("div", [te], null, "overflow: hidden; position: relative; width: 3px; height: 0px;"); + // The textarea is kept positioned near the cursor to prevent the + // fact that it'll be scrolled into view on input from scrolling + // our fake cursor out of view. On webkit, when wrap=off, paste is + // very slow. So make the area wide instead. + if (webkit) te.style.width = "1000px"; + else te.setAttribute("wrap", "off"); + // If border: 0; -- iOS fails to open keyboard (issue #1287) + if (ios) te.style.border = "1px solid black"; + disableBrowserMagic(te); + return div; + } + + TextareaInput.prototype = copyObj({ + init: function(display) { + var input = this, cm = this.cm; + + // Wraps and hides input textarea + var div = this.wrapper = hiddenTextarea(); + // The semihidden textarea that is focused when the editor is + // focused, and receives input. + var te = this.textarea = div.firstChild; + display.wrapper.insertBefore(div, display.wrapper.firstChild); + + // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore) + if (ios) te.style.width = "0px"; + + on(te, "input", function() { + if (ie && ie_version >= 9 && input.hasSelection) input.hasSelection = null; + input.poll(); + }); + + on(te, "paste", function(e) { + if (signalDOMEvent(cm, e) || handlePaste(e, cm)) return + + cm.state.pasteIncoming = true; + input.fastPoll(); + }); + + function prepareCopyCut(e) { + if (signalDOMEvent(cm, e)) return + if (cm.somethingSelected()) { + lastCopied = {lineWise: false, text: cm.getSelections()}; + if (input.inaccurateSelection) { + input.prevInput = ""; + input.inaccurateSelection = false; + te.value = lastCopied.text.join("\n"); + selectInput(te); + } + } else if (!cm.options.lineWiseCopyCut) { + return; + } else { + var ranges = copyableRanges(cm); + lastCopied = {lineWise: true, text: ranges.text}; + if (e.type == "cut") { + cm.setSelections(ranges.ranges, null, sel_dontScroll); + } else { + input.prevInput = ""; + te.value = ranges.text.join("\n"); + selectInput(te); + } + } + if (e.type == "cut") cm.state.cutIncoming = true; + } + on(te, "cut", prepareCopyCut); + on(te, "copy", prepareCopyCut); + + on(display.scroller, "paste", function(e) { + if (eventInWidget(display, e) || signalDOMEvent(cm, e)) return; + cm.state.pasteIncoming = true; + input.focus(); + }); + + // Prevent normal selection in the editor (we handle our own) + on(display.lineSpace, "selectstart", function(e) { + if (!eventInWidget(display, e)) e_preventDefault(e); + }); + + on(te, "compositionstart", function() { + var start = cm.getCursor("from"); + if (input.composing) input.composing.range.clear() + input.composing = { + start: start, + range: cm.markText(start, cm.getCursor("to"), {className: "CodeMirror-composing"}) + }; + }); + on(te, "compositionend", function() { + if (input.composing) { + input.poll(); + input.composing.range.clear(); + input.composing = null; + } + }); + }, + + prepareSelection: function() { + // Redraw the selection and/or cursor + var cm = this.cm, display = cm.display, doc = cm.doc; + var result = prepareSelection(cm); + + // Move the hidden textarea near the cursor to prevent scrolling artifacts + if (cm.options.moveInputWithCursor) { + var headPos = cursorCoords(cm, doc.sel.primary().head, "div"); + var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect(); + result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10, + headPos.top + lineOff.top - wrapOff.top)); + result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10, + headPos.left + lineOff.left - wrapOff.left)); + } + + return result; + }, + + showSelection: function(drawn) { + var cm = this.cm, display = cm.display; + removeChildrenAndAdd(display.cursorDiv, drawn.cursors); + removeChildrenAndAdd(display.selectionDiv, drawn.selection); + if (drawn.teTop != null) { + this.wrapper.style.top = drawn.teTop + "px"; + this.wrapper.style.left = drawn.teLeft + "px"; + } + }, + + // Reset the input to correspond to the selection (or to be empty, + // when not typing and nothing is selected) + reset: function(typing) { + if (this.contextMenuPending) return; + var minimal, selected, cm = this.cm, doc = cm.doc; + if (cm.somethingSelected()) { + this.prevInput = ""; + var range = doc.sel.primary(); + minimal = hasCopyEvent && + (range.to().line - range.from().line > 100 || (selected = cm.getSelection()).length > 1000); + var content = minimal ? "-" : selected || cm.getSelection(); + this.textarea.value = content; + if (cm.state.focused) selectInput(this.textarea); + if (ie && ie_version >= 9) this.hasSelection = content; + } else if (!typing) { + this.prevInput = this.textarea.value = ""; + if (ie && ie_version >= 9) this.hasSelection = null; + } + this.inaccurateSelection = minimal; + }, + + getField: function() { return this.textarea; }, + + supportsTouch: function() { return false; }, + + focus: function() { + if (this.cm.options.readOnly != "nocursor" && (!mobile || activeElt() != this.textarea)) { + try { this.textarea.focus(); } + catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM + } + }, + + blur: function() { this.textarea.blur(); }, + + resetPosition: function() { + this.wrapper.style.top = this.wrapper.style.left = 0; + }, + + receivedFocus: function() { this.slowPoll(); }, + + // Poll for input changes, using the normal rate of polling. This + // runs as long as the editor is focused. + slowPoll: function() { + var input = this; + if (input.pollingFast) return; + input.polling.set(this.cm.options.pollInterval, function() { + input.poll(); + if (input.cm.state.focused) input.slowPoll(); + }); + }, + + // When an event has just come in that is likely to add or change + // something in the input textarea, we poll faster, to ensure that + // the change appears on the screen quickly. + fastPoll: function() { + var missed = false, input = this; + input.pollingFast = true; + function p() { + var changed = input.poll(); + if (!changed && !missed) {missed = true; input.polling.set(60, p);} + else {input.pollingFast = false; input.slowPoll();} + } + input.polling.set(20, p); + }, + + // Read input from the textarea, and update the document to match. + // When something is selected, it is present in the textarea, and + // selected (unless it is huge, in which case a placeholder is + // used). When nothing is selected, the cursor sits after previously + // seen text (can be empty), which is stored in prevInput (we must + // not reset the textarea when typing, because that breaks IME). + poll: function() { + var cm = this.cm, input = this.textarea, prevInput = this.prevInput; + // Since this is called a *lot*, try to bail out as cheaply as + // possible when it is clear that nothing happened. hasSelection + // will be the case when there is a lot of text in the textarea, + // in which case reading its value would be expensive. + if (this.contextMenuPending || !cm.state.focused || + (hasSelection(input) && !prevInput && !this.composing) || + cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq) + return false; + + var text = input.value; + // If nothing changed, bail. + if (text == prevInput && !cm.somethingSelected()) return false; + // Work around nonsensical selection resetting in IE9/10, and + // inexplicable appearance of private area unicode characters on + // some key combos in Mac (#2689). + if (ie && ie_version >= 9 && this.hasSelection === text || + mac && /[\uf700-\uf7ff]/.test(text)) { + cm.display.input.reset(); + return false; + } + + if (cm.doc.sel == cm.display.selForContextMenu) { + var first = text.charCodeAt(0); + if (first == 0x200b && !prevInput) prevInput = "\u200b"; + if (first == 0x21da) { this.reset(); return this.cm.execCommand("undo"); } + } + // Find the part of the input that is actually new + var same = 0, l = Math.min(prevInput.length, text.length); + while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) ++same; + + var self = this; + runInOp(cm, function() { + applyTextInput(cm, text.slice(same), prevInput.length - same, + null, self.composing ? "*compose" : null); + + // Don't leave long text in the textarea, since it makes further polling slow + if (text.length > 1000 || text.indexOf("\n") > -1) input.value = self.prevInput = ""; + else self.prevInput = text; + + if (self.composing) { + self.composing.range.clear(); + self.composing.range = cm.markText(self.composing.start, cm.getCursor("to"), + {className: "CodeMirror-composing"}); + } + }); + return true; + }, + + ensurePolled: function() { + if (this.pollingFast && this.poll()) this.pollingFast = false; + }, + + onKeyPress: function() { + if (ie && ie_version >= 9) this.hasSelection = null; + this.fastPoll(); + }, + + onContextMenu: function(e) { + var input = this, cm = input.cm, display = cm.display, te = input.textarea; + var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop; + if (!pos || presto) return; // Opera is difficult. + + // Reset the current text selection only if the click is done outside of the selection + // and 'resetSelectionOnContextMenu' option is true. + var reset = cm.options.resetSelectionOnContextMenu; + if (reset && cm.doc.sel.contains(pos) == -1) + operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); + + var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText; + input.wrapper.style.cssText = "position: absolute" + var wrapperBox = input.wrapper.getBoundingClientRect() + te.style.cssText = "position: absolute; width: 30px; height: 30px; top: " + (e.clientY - wrapperBox.top - 5) + + "px; left: " + (e.clientX - wrapperBox.left - 5) + "px; z-index: 1000; background: " + + (ie ? "rgba(255, 255, 255, .05)" : "transparent") + + "; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);"; + if (webkit) var oldScrollY = window.scrollY; // Work around Chrome issue (#2712) + display.input.focus(); + if (webkit) window.scrollTo(null, oldScrollY); + display.input.reset(); + // Adds "Select all" to context menu in FF + if (!cm.somethingSelected()) te.value = input.prevInput = " "; + input.contextMenuPending = true; + display.selForContextMenu = cm.doc.sel; + clearTimeout(display.detectingSelectAll); + + // Select-all will be greyed out if there's nothing to select, so + // this adds a zero-width space so that we can later check whether + // it got selected. + function prepareSelectAllHack() { + if (te.selectionStart != null) { + var selected = cm.somethingSelected(); + var extval = "\u200b" + (selected ? te.value : ""); + te.value = "\u21da"; // Used to catch context-menu undo + te.value = extval; + input.prevInput = selected ? "" : "\u200b"; + te.selectionStart = 1; te.selectionEnd = extval.length; + // Re-set this, in case some other handler touched the + // selection in the meantime. + display.selForContextMenu = cm.doc.sel; + } + } + function rehide() { + input.contextMenuPending = false; + input.wrapper.style.cssText = oldWrapperCSS + te.style.cssText = oldCSS; + if (ie && ie_version < 9) display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); + + // Try to detect the user choosing select-all + if (te.selectionStart != null) { + if (!ie || (ie && ie_version < 9)) prepareSelectAllHack(); + var i = 0, poll = function() { + if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 && + te.selectionEnd > 0 && input.prevInput == "\u200b") + operation(cm, commands.selectAll)(cm); + else if (i++ < 10) display.detectingSelectAll = setTimeout(poll, 500); + else display.input.reset(); + }; + display.detectingSelectAll = setTimeout(poll, 200); + } + } + + if (ie && ie_version >= 9) prepareSelectAllHack(); + if (captureRightClick) { + e_stop(e); + var mouseup = function() { + off(window, "mouseup", mouseup); + setTimeout(rehide, 20); + }; + on(window, "mouseup", mouseup); + } else { + setTimeout(rehide, 50); + } + }, + + readOnlyChanged: function(val) { + if (!val) this.reset(); + }, + + setUneditable: nothing, + + needsContentAttribute: false + }, TextareaInput.prototype); + + // CONTENTEDITABLE INPUT STYLE + + function ContentEditableInput(cm) { + this.cm = cm; + this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null; + this.polling = new Delayed(); + this.gracePeriod = false; + } + + ContentEditableInput.prototype = copyObj({ + init: function(display) { + var input = this, cm = input.cm; + var div = input.div = display.lineDiv; + disableBrowserMagic(div); + + on(div, "paste", function(e) { + if (!signalDOMEvent(cm, e)) handlePaste(e, cm); + }) + + on(div, "compositionstart", function(e) { + var data = e.data; + input.composing = {sel: cm.doc.sel, data: data, startData: data}; + if (!data) return; + var prim = cm.doc.sel.primary(); + var line = cm.getLine(prim.head.line); + var found = line.indexOf(data, Math.max(0, prim.head.ch - data.length)); + if (found > -1 && found <= prim.head.ch) + input.composing.sel = simpleSelection(Pos(prim.head.line, found), + Pos(prim.head.line, found + data.length)); + }); + on(div, "compositionupdate", function(e) { + input.composing.data = e.data; + }); + on(div, "compositionend", function(e) { + var ours = input.composing; + if (!ours) return; + if (e.data != ours.startData && !/\u200b/.test(e.data)) + ours.data = e.data; + // Need a small delay to prevent other code (input event, + // selection polling) from doing damage when fired right after + // compositionend. + setTimeout(function() { + if (!ours.handled) + input.applyComposition(ours); + if (input.composing == ours) + input.composing = null; + }, 50); + }); + + on(div, "touchstart", function() { + input.forceCompositionEnd(); + }); + + on(div, "input", function() { + if (input.composing) return; + if (cm.isReadOnly() || !input.pollContent()) + runInOp(input.cm, function() {regChange(cm);}); + }); + + function onCopyCut(e) { + if (signalDOMEvent(cm, e)) return + if (cm.somethingSelected()) { + lastCopied = {lineWise: false, text: cm.getSelections()}; + if (e.type == "cut") cm.replaceSelection("", null, "cut"); + } else if (!cm.options.lineWiseCopyCut) { + return; + } else { + var ranges = copyableRanges(cm); + lastCopied = {lineWise: true, text: ranges.text}; + if (e.type == "cut") { + cm.operation(function() { + cm.setSelections(ranges.ranges, 0, sel_dontScroll); + cm.replaceSelection("", null, "cut"); + }); + } + } + // iOS exposes the clipboard API, but seems to discard content inserted into it + if (e.clipboardData && !ios) { + e.preventDefault(); + e.clipboardData.clearData(); + e.clipboardData.setData("text/plain", lastCopied.text.join("\n")); + } else { + // Old-fashioned briefly-focus-a-textarea hack + var kludge = hiddenTextarea(), te = kludge.firstChild; + cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild); + te.value = lastCopied.text.join("\n"); + var hadFocus = document.activeElement; + selectInput(te); + setTimeout(function() { + cm.display.lineSpace.removeChild(kludge); + hadFocus.focus(); + }, 50); + } + } + on(div, "copy", onCopyCut); + on(div, "cut", onCopyCut); + }, + + prepareSelection: function() { + var result = prepareSelection(this.cm, false); + result.focus = this.cm.state.focused; + return result; + }, + + showSelection: function(info, takeFocus) { + if (!info || !this.cm.display.view.length) return; + if (info.focus || takeFocus) this.showPrimarySelection(); + this.showMultipleSelections(info); + }, + + showPrimarySelection: function() { + var sel = window.getSelection(), prim = this.cm.doc.sel.primary(); + var curAnchor = domToPos(this.cm, sel.anchorNode, sel.anchorOffset); + var curFocus = domToPos(this.cm, sel.focusNode, sel.focusOffset); + if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad && + cmp(minPos(curAnchor, curFocus), prim.from()) == 0 && + cmp(maxPos(curAnchor, curFocus), prim.to()) == 0) + return; + + var start = posToDOM(this.cm, prim.from()); + var end = posToDOM(this.cm, prim.to()); + if (!start && !end) return; + + var view = this.cm.display.view; + var old = sel.rangeCount && sel.getRangeAt(0); + if (!start) { + start = {node: view[0].measure.map[2], offset: 0}; + } else if (!end) { // FIXME dangerously hacky + var measure = view[view.length - 1].measure; + var map = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map; + end = {node: map[map.length - 1], offset: map[map.length - 2] - map[map.length - 3]}; + } + + try { var rng = range(start.node, start.offset, end.offset, end.node); } + catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible + if (rng) { + if (!gecko && this.cm.state.focused) { + sel.collapse(start.node, start.offset); + if (!rng.collapsed) sel.addRange(rng); + } else { + sel.removeAllRanges(); + sel.addRange(rng); + } + if (old && sel.anchorNode == null) sel.addRange(old); + else if (gecko) this.startGracePeriod(); + } + this.rememberSelection(); + }, + + startGracePeriod: function() { + var input = this; + clearTimeout(this.gracePeriod); + this.gracePeriod = setTimeout(function() { + input.gracePeriod = false; + if (input.selectionChanged()) + input.cm.operation(function() { input.cm.curOp.selectionChanged = true; }); + }, 20); + }, + + showMultipleSelections: function(info) { + removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors); + removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection); + }, + + rememberSelection: function() { + var sel = window.getSelection(); + this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset; + this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset; + }, + + selectionInEditor: function() { + var sel = window.getSelection(); + if (!sel.rangeCount) return false; + var node = sel.getRangeAt(0).commonAncestorContainer; + return contains(this.div, node); + }, + + focus: function() { + if (this.cm.options.readOnly != "nocursor") this.div.focus(); + }, + blur: function() { this.div.blur(); }, + getField: function() { return this.div; }, + + supportsTouch: function() { return true; }, + + receivedFocus: function() { + var input = this; + if (this.selectionInEditor()) + this.pollSelection(); + else + runInOp(this.cm, function() { input.cm.curOp.selectionChanged = true; }); + + function poll() { + if (input.cm.state.focused) { + input.pollSelection(); + input.polling.set(input.cm.options.pollInterval, poll); + } + } + this.polling.set(this.cm.options.pollInterval, poll); + }, + + selectionChanged: function() { + var sel = window.getSelection(); + return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset || + sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset; + }, + + pollSelection: function() { + if (!this.composing && !this.gracePeriod && this.selectionChanged()) { + var sel = window.getSelection(), cm = this.cm; + this.rememberSelection(); + var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset); + var head = domToPos(cm, sel.focusNode, sel.focusOffset); + if (anchor && head) runInOp(cm, function() { + setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll); + if (anchor.bad || head.bad) cm.curOp.selectionChanged = true; + }); + } + }, + + pollContent: function() { + var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary(); + var from = sel.from(), to = sel.to(); + if (from.line < display.viewFrom || to.line > display.viewTo - 1) return false; + + var fromIndex; + if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) { + var fromLine = lineNo(display.view[0].line); + var fromNode = display.view[0].node; + } else { + var fromLine = lineNo(display.view[fromIndex].line); + var fromNode = display.view[fromIndex - 1].node.nextSibling; + } + var toIndex = findViewIndex(cm, to.line); + if (toIndex == display.view.length - 1) { + var toLine = display.viewTo - 1; + var toNode = display.lineDiv.lastChild; + } else { + var toLine = lineNo(display.view[toIndex + 1].line) - 1; + var toNode = display.view[toIndex + 1].node.previousSibling; + } + + var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine)); + var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length)); + while (newText.length > 1 && oldText.length > 1) { + if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine--; } + else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++; } + else break; + } + + var cutFront = 0, cutEnd = 0; + var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length); + while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront)) + ++cutFront; + var newBot = lst(newText), oldBot = lst(oldText); + var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0), + oldBot.length - (oldText.length == 1 ? cutFront : 0)); + while (cutEnd < maxCutEnd && + newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) + ++cutEnd; + + newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd); + newText[0] = newText[0].slice(cutFront); + + var chFrom = Pos(fromLine, cutFront); + var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0); + if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) { + replaceRange(cm.doc, newText, chFrom, chTo, "+input"); + return true; + } + }, + + ensurePolled: function() { + this.forceCompositionEnd(); + }, + reset: function() { + this.forceCompositionEnd(); + }, + forceCompositionEnd: function() { + if (!this.composing || this.composing.handled) return; + this.applyComposition(this.composing); + this.composing.handled = true; + this.div.blur(); + this.div.focus(); + }, + applyComposition: function(composing) { + if (this.cm.isReadOnly()) + operation(this.cm, regChange)(this.cm) + else if (composing.data && composing.data != composing.startData) + operation(this.cm, applyTextInput)(this.cm, composing.data, 0, composing.sel); + }, + + setUneditable: function(node) { + node.contentEditable = "false" + }, + + onKeyPress: function(e) { + e.preventDefault(); + if (!this.cm.isReadOnly()) + operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0); + }, + + readOnlyChanged: function(val) { + this.div.contentEditable = String(val != "nocursor") + }, + + onContextMenu: nothing, + resetPosition: nothing, + + needsContentAttribute: true + }, ContentEditableInput.prototype); + + function posToDOM(cm, pos) { + var view = findViewForLine(cm, pos.line); + if (!view || view.hidden) return null; + var line = getLine(cm.doc, pos.line); + var info = mapFromLineView(view, line, pos.line); + + var order = getOrder(line), side = "left"; + if (order) { + var partPos = getBidiPartAt(order, pos.ch); + side = partPos % 2 ? "right" : "left"; + } + var result = nodeAndOffsetInLineMap(info.map, pos.ch, side); + result.offset = result.collapse == "right" ? result.end : result.start; + return result; + } + + function badPos(pos, bad) { if (bad) pos.bad = true; return pos; } + + function domToPos(cm, node, offset) { + var lineNode; + if (node == cm.display.lineDiv) { + lineNode = cm.display.lineDiv.childNodes[offset]; + if (!lineNode) return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true); + node = null; offset = 0; + } else { + for (lineNode = node;; lineNode = lineNode.parentNode) { + if (!lineNode || lineNode == cm.display.lineDiv) return null; + if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) break; + } + } + for (var i = 0; i < cm.display.view.length; i++) { + var lineView = cm.display.view[i]; + if (lineView.node == lineNode) + return locateNodeInLineView(lineView, node, offset); + } + } + + function locateNodeInLineView(lineView, node, offset) { + var wrapper = lineView.text.firstChild, bad = false; + if (!node || !contains(wrapper, node)) return badPos(Pos(lineNo(lineView.line), 0), true); + if (node == wrapper) { + bad = true; + node = wrapper.childNodes[offset]; + offset = 0; + if (!node) { + var line = lineView.rest ? lst(lineView.rest) : lineView.line; + return badPos(Pos(lineNo(line), line.text.length), bad); + } + } + + var textNode = node.nodeType == 3 ? node : null, topNode = node; + if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) { + textNode = node.firstChild; + if (offset) offset = textNode.nodeValue.length; + } + while (topNode.parentNode != wrapper) topNode = topNode.parentNode; + var measure = lineView.measure, maps = measure.maps; + + function find(textNode, topNode, offset) { + for (var i = -1; i < (maps ? maps.length : 0); i++) { + var map = i < 0 ? measure.map : maps[i]; + for (var j = 0; j < map.length; j += 3) { + var curNode = map[j + 2]; + if (curNode == textNode || curNode == topNode) { + var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]); + var ch = map[j] + offset; + if (offset < 0 || curNode != textNode) ch = map[j + (offset ? 1 : 0)]; + return Pos(line, ch); + } + } + } + } + var found = find(textNode, topNode, offset); + if (found) return badPos(found, bad); + + // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems + for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) { + found = find(after, after.firstChild, 0); + if (found) + return badPos(Pos(found.line, found.ch - dist), bad); + else + dist += after.textContent.length; + } + for (var before = topNode.previousSibling, dist = offset; before; before = before.previousSibling) { + found = find(before, before.firstChild, -1); + if (found) + return badPos(Pos(found.line, found.ch + dist), bad); + else + dist += after.textContent.length; + } + } + + function domTextBetween(cm, from, to, fromLine, toLine) { + var text = "", closing = false, lineSep = cm.doc.lineSeparator(); + function recognizeMarker(id) { return function(marker) { return marker.id == id; }; } + function walk(node) { + if (node.nodeType == 1) { + var cmText = node.getAttribute("cm-text"); + if (cmText != null) { + if (cmText == "") cmText = node.textContent.replace(/\u200b/g, ""); + text += cmText; + return; + } + var markerID = node.getAttribute("cm-marker"), range; + if (markerID) { + var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID)); + if (found.length && (range = found[0].find())) + text += getBetween(cm.doc, range.from, range.to).join(lineSep); + return; + } + if (node.getAttribute("contenteditable") == "false") return; + for (var i = 0; i < node.childNodes.length; i++) + walk(node.childNodes[i]); + if (/^(pre|div|p)$/i.test(node.nodeName)) + closing = true; + } else if (node.nodeType == 3) { + var val = node.nodeValue; + if (!val) return; + if (closing) { + text += lineSep; + closing = false; + } + text += val; + } + } + for (;;) { + walk(from); + if (from == to) break; + from = from.nextSibling; + } + return text; + } + + CodeMirror.inputStyles = {"textarea": TextareaInput, "contenteditable": ContentEditableInput}; + + // SELECTION / CURSOR + + // Selection objects are immutable. A new one is created every time + // the selection changes. A selection is one or more non-overlapping + // (and non-touching) ranges, sorted, and an integer that indicates + // which one is the primary selection (the one that's scrolled into + // view, that getCursor returns, etc). + function Selection(ranges, primIndex) { + this.ranges = ranges; + this.primIndex = primIndex; + } + + Selection.prototype = { + primary: function() { return this.ranges[this.primIndex]; }, + equals: function(other) { + if (other == this) return true; + if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) return false; + for (var i = 0; i < this.ranges.length; i++) { + var here = this.ranges[i], there = other.ranges[i]; + if (cmp(here.anchor, there.anchor) != 0 || cmp(here.head, there.head) != 0) return false; + } + return true; + }, + deepCopy: function() { + for (var out = [], i = 0; i < this.ranges.length; i++) + out[i] = new Range(copyPos(this.ranges[i].anchor), copyPos(this.ranges[i].head)); + return new Selection(out, this.primIndex); + }, + somethingSelected: function() { + for (var i = 0; i < this.ranges.length; i++) + if (!this.ranges[i].empty()) return true; + return false; + }, + contains: function(pos, end) { + if (!end) end = pos; + for (var i = 0; i < this.ranges.length; i++) { + var range = this.ranges[i]; + if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0) + return i; + } + return -1; + } + }; + + function Range(anchor, head) { + this.anchor = anchor; this.head = head; + } + + Range.prototype = { + from: function() { return minPos(this.anchor, this.head); }, + to: function() { return maxPos(this.anchor, this.head); }, + empty: function() { + return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch; + } + }; + + // Take an unsorted, potentially overlapping set of ranges, and + // build a selection out of it. 'Consumes' ranges array (modifying + // it). + function normalizeSelection(ranges, primIndex) { + var prim = ranges[primIndex]; + ranges.sort(function(a, b) { return cmp(a.from(), b.from()); }); + primIndex = indexOf(ranges, prim); + for (var i = 1; i < ranges.length; i++) { + var cur = ranges[i], prev = ranges[i - 1]; + if (cmp(prev.to(), cur.from()) >= 0) { + var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to()); + var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head; + if (i <= primIndex) --primIndex; + ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to)); + } + } + return new Selection(ranges, primIndex); + } + + function simpleSelection(anchor, head) { + return new Selection([new Range(anchor, head || anchor)], 0); + } + + // Most of the external API clips given positions to make sure they + // actually exist within the document. + function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1));} + function clipPos(doc, pos) { + if (pos.line < doc.first) return Pos(doc.first, 0); + var last = doc.first + doc.size - 1; + if (pos.line > last) return Pos(last, getLine(doc, last).text.length); + return clipToLen(pos, getLine(doc, pos.line).text.length); + } + function clipToLen(pos, linelen) { + var ch = pos.ch; + if (ch == null || ch > linelen) return Pos(pos.line, linelen); + else if (ch < 0) return Pos(pos.line, 0); + else return pos; + } + function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size;} + function clipPosArray(doc, array) { + for (var out = [], i = 0; i < array.length; i++) out[i] = clipPos(doc, array[i]); + return out; + } + + // SELECTION UPDATES + + // The 'scroll' parameter given to many of these indicated whether + // the new cursor position should be scrolled into view after + // modifying the selection. + + // If shift is held or the extend flag is set, extends a range to + // include a given position (and optionally a second position). + // Otherwise, simply returns the range between the given positions. + // Used for cursor motion and such. + function extendRange(doc, range, head, other) { + if (doc.cm && doc.cm.display.shift || doc.extend) { + var anchor = range.anchor; + if (other) { + var posBefore = cmp(head, anchor) < 0; + if (posBefore != (cmp(other, anchor) < 0)) { + anchor = head; + head = other; + } else if (posBefore != (cmp(head, other) < 0)) { + head = other; + } + } + return new Range(anchor, head); + } else { + return new Range(other || head, head); + } + } + + // Extend the primary selection range, discard the rest. + function extendSelection(doc, head, other, options) { + setSelection(doc, new Selection([extendRange(doc, doc.sel.primary(), head, other)], 0), options); + } + + // Extend all selections (pos is an array of selections with length + // equal the number of selections) + function extendSelections(doc, heads, options) { + for (var out = [], i = 0; i < doc.sel.ranges.length; i++) + out[i] = extendRange(doc, doc.sel.ranges[i], heads[i], null); + var newSel = normalizeSelection(out, doc.sel.primIndex); + setSelection(doc, newSel, options); + } + + // Updates a single range in the selection. + function replaceOneSelection(doc, i, range, options) { + var ranges = doc.sel.ranges.slice(0); + ranges[i] = range; + setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options); + } + + // Reset the selection to a single range. + function setSimpleSelection(doc, anchor, head, options) { + setSelection(doc, simpleSelection(anchor, head), options); + } + + // Give beforeSelectionChange handlers a change to influence a + // selection update. + function filterSelectionChange(doc, sel, options) { + var obj = { + ranges: sel.ranges, + update: function(ranges) { + this.ranges = []; + for (var i = 0; i < ranges.length; i++) + this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor), + clipPos(doc, ranges[i].head)); + }, + origin: options && options.origin + }; + signal(doc, "beforeSelectionChange", doc, obj); + if (doc.cm) signal(doc.cm, "beforeSelectionChange", doc.cm, obj); + if (obj.ranges != sel.ranges) return normalizeSelection(obj.ranges, obj.ranges.length - 1); + else return sel; + } + + function setSelectionReplaceHistory(doc, sel, options) { + var done = doc.history.done, last = lst(done); + if (last && last.ranges) { + done[done.length - 1] = sel; + setSelectionNoUndo(doc, sel, options); + } else { + setSelection(doc, sel, options); + } + } + + // Set a new selection. + function setSelection(doc, sel, options) { + setSelectionNoUndo(doc, sel, options); + addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options); + } + + function setSelectionNoUndo(doc, sel, options) { + if (hasHandler(doc, "beforeSelectionChange") || doc.cm && hasHandler(doc.cm, "beforeSelectionChange")) + sel = filterSelectionChange(doc, sel, options); + + var bias = options && options.bias || + (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1); + setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true)); + + if (!(options && options.scroll === false) && doc.cm) + ensureCursorVisible(doc.cm); + } + + function setSelectionInner(doc, sel) { + if (sel.equals(doc.sel)) return; + + doc.sel = sel; + + if (doc.cm) { + doc.cm.curOp.updateInput = doc.cm.curOp.selectionChanged = true; + signalCursorActivity(doc.cm); + } + signalLater(doc, "cursorActivity", doc); + } + + // Verify that the selection does not partially select any atomic + // marked ranges. + function reCheckSelection(doc) { + setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false), sel_dontScroll); + } + + // Return a selection that does not partially select any atomic + // ranges. + function skipAtomicInSelection(doc, sel, bias, mayClear) { + var out; + for (var i = 0; i < sel.ranges.length; i++) { + var range = sel.ranges[i]; + var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i]; + var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear); + var newHead = skipAtomic(doc, range.head, old && old.head, bias, mayClear); + if (out || newAnchor != range.anchor || newHead != range.head) { + if (!out) out = sel.ranges.slice(0, i); + out[i] = new Range(newAnchor, newHead); + } + } + return out ? normalizeSelection(out, sel.primIndex) : sel; + } + + function skipAtomicInner(doc, pos, oldPos, dir, mayClear) { + var line = getLine(doc, pos.line); + if (line.markedSpans) for (var i = 0; i < line.markedSpans.length; ++i) { + var sp = line.markedSpans[i], m = sp.marker; + if ((sp.from == null || (m.inclusiveLeft ? sp.from <= pos.ch : sp.from < pos.ch)) && + (sp.to == null || (m.inclusiveRight ? sp.to >= pos.ch : sp.to > pos.ch))) { + if (mayClear) { + signal(m, "beforeCursorEnter"); + if (m.explicitlyCleared) { + if (!line.markedSpans) break; + else {--i; continue;} + } + } + if (!m.atomic) continue; + + if (oldPos) { + var near = m.find(dir < 0 ? 1 : -1), diff; + if (dir < 0 ? m.inclusiveRight : m.inclusiveLeft) + near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null); + if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0)) + return skipAtomicInner(doc, near, pos, dir, mayClear); + } + + var far = m.find(dir < 0 ? -1 : 1); + if (dir < 0 ? m.inclusiveLeft : m.inclusiveRight) + far = movePos(doc, far, dir, far.line == pos.line ? line : null); + return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null; + } + } + return pos; + } + + // Ensure a given position is not inside an atomic range. + function skipAtomic(doc, pos, oldPos, bias, mayClear) { + var dir = bias || 1; + var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) || + (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) || + skipAtomicInner(doc, pos, oldPos, -dir, mayClear) || + (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true)); + if (!found) { + doc.cantEdit = true; + return Pos(doc.first, 0); + } + return found; + } + + function movePos(doc, pos, dir, line) { + if (dir < 0 && pos.ch == 0) { + if (pos.line > doc.first) return clipPos(doc, Pos(pos.line - 1)); + else return null; + } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) { + if (pos.line < doc.first + doc.size - 1) return Pos(pos.line + 1, 0); + else return null; + } else { + return new Pos(pos.line, pos.ch + dir); + } + } + + // SELECTION DRAWING + + function updateSelection(cm) { + cm.display.input.showSelection(cm.display.input.prepareSelection()); + } + + function prepareSelection(cm, primary) { + var doc = cm.doc, result = {}; + var curFragment = result.cursors = document.createDocumentFragment(); + var selFragment = result.selection = document.createDocumentFragment(); + + for (var i = 0; i < doc.sel.ranges.length; i++) { + if (primary === false && i == doc.sel.primIndex) continue; + var range = doc.sel.ranges[i]; + if (range.from().line >= cm.display.viewTo || range.to().line < cm.display.viewFrom) continue; + var collapsed = range.empty(); + if (collapsed || cm.options.showCursorWhenSelecting) + drawSelectionCursor(cm, range.head, curFragment); + if (!collapsed) + drawSelectionRange(cm, range, selFragment); + } + return result; + } + + // Draws a cursor for the given range + function drawSelectionCursor(cm, head, output) { + var pos = cursorCoords(cm, head, "div", null, null, !cm.options.singleCursorHeightPerLine); + + var cursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor")); + cursor.style.left = pos.left + "px"; + cursor.style.top = pos.top + "px"; + cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px"; + + if (pos.other) { + // Secondary cursor, shown when on a 'jump' in bi-directional text + var otherCursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor")); + otherCursor.style.display = ""; + otherCursor.style.left = pos.other.left + "px"; + otherCursor.style.top = pos.other.top + "px"; + otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px"; + } + } + + // Draws the given range as a highlighted selection + function drawSelectionRange(cm, range, output) { + var display = cm.display, doc = cm.doc; + var fragment = document.createDocumentFragment(); + var padding = paddingH(cm.display), leftSide = padding.left; + var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right; + + function add(left, top, width, bottom) { + if (top < 0) top = 0; + top = Math.round(top); + bottom = Math.round(bottom); + fragment.appendChild(elt("div", null, "CodeMirror-selected", "position: absolute; left: " + left + + "px; top: " + top + "px; width: " + (width == null ? rightSide - left : width) + + "px; height: " + (bottom - top) + "px")); + } + + function drawForLine(line, fromArg, toArg) { + var lineObj = getLine(doc, line); + var lineLen = lineObj.text.length; + var start, end; + function coords(ch, bias) { + return charCoords(cm, Pos(line, ch), "div", lineObj, bias); + } + + iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) { + var leftPos = coords(from, "left"), rightPos, left, right; + if (from == to) { + rightPos = leftPos; + left = right = leftPos.left; + } else { + rightPos = coords(to - 1, "right"); + if (dir == "rtl") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; } + left = leftPos.left; + right = rightPos.right; + } + if (fromArg == null && from == 0) left = leftSide; + if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part + add(left, leftPos.top, null, leftPos.bottom); + left = leftSide; + if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top); + } + if (toArg == null && to == lineLen) right = rightSide; + if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left) + start = leftPos; + if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right) + end = rightPos; + if (left < leftSide + 1) left = leftSide; + add(left, rightPos.top, right - left, rightPos.bottom); + }); + return {start: start, end: end}; + } + + var sFrom = range.from(), sTo = range.to(); + if (sFrom.line == sTo.line) { + drawForLine(sFrom.line, sFrom.ch, sTo.ch); + } else { + var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line); + var singleVLine = visualLine(fromLine) == visualLine(toLine); + var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end; + var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start; + if (singleVLine) { + if (leftEnd.top < rightStart.top - 2) { + add(leftEnd.right, leftEnd.top, null, leftEnd.bottom); + add(leftSide, rightStart.top, rightStart.left, rightStart.bottom); + } else { + add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom); + } + } + if (leftEnd.bottom < rightStart.top) + add(leftSide, leftEnd.bottom, null, rightStart.top); + } + + output.appendChild(fragment); + } + + // Cursor-blinking + function restartBlink(cm) { + if (!cm.state.focused) return; + var display = cm.display; + clearInterval(display.blinker); + var on = true; + display.cursorDiv.style.visibility = ""; + if (cm.options.cursorBlinkRate > 0) + display.blinker = setInterval(function() { + display.cursorDiv.style.visibility = (on = !on) ? "" : "hidden"; + }, cm.options.cursorBlinkRate); + else if (cm.options.cursorBlinkRate < 0) + display.cursorDiv.style.visibility = "hidden"; + } + + // HIGHLIGHT WORKER + + function startWorker(cm, time) { + if (cm.doc.mode.startState && cm.doc.frontier < cm.display.viewTo) + cm.state.highlight.set(time, bind(highlightWorker, cm)); + } + + function highlightWorker(cm) { + var doc = cm.doc; + if (doc.frontier < doc.first) doc.frontier = doc.first; + if (doc.frontier >= cm.display.viewTo) return; + var end = +new Date + cm.options.workTime; + var state = copyState(doc.mode, getStateBefore(cm, doc.frontier)); + var changedLines = []; + + doc.iter(doc.frontier, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function(line) { + if (doc.frontier >= cm.display.viewFrom) { // Visible + var oldStyles = line.styles, tooLong = line.text.length > cm.options.maxHighlightLength; + var highlighted = highlightLine(cm, line, tooLong ? copyState(doc.mode, state) : state, true); + line.styles = highlighted.styles; + var oldCls = line.styleClasses, newCls = highlighted.classes; + if (newCls) line.styleClasses = newCls; + else if (oldCls) line.styleClasses = null; + var ischange = !oldStyles || oldStyles.length != line.styles.length || + oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass); + for (var i = 0; !ischange && i < oldStyles.length; ++i) ischange = oldStyles[i] != line.styles[i]; + if (ischange) changedLines.push(doc.frontier); + line.stateAfter = tooLong ? state : copyState(doc.mode, state); + } else { + if (line.text.length <= cm.options.maxHighlightLength) + processLine(cm, line.text, state); + line.stateAfter = doc.frontier % 5 == 0 ? copyState(doc.mode, state) : null; + } + ++doc.frontier; + if (+new Date > end) { + startWorker(cm, cm.options.workDelay); + return true; + } + }); + if (changedLines.length) runInOp(cm, function() { + for (var i = 0; i < changedLines.length; i++) + regLineChange(cm, changedLines[i], "text"); + }); + } + + // Finds the line to start with when starting a parse. Tries to + // find a line with a stateAfter, so that it can start with a + // valid state. If that fails, it returns the line with the + // smallest indentation, which tends to need the least context to + // parse correctly. + function findStartLine(cm, n, precise) { + var minindent, minline, doc = cm.doc; + var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100); + for (var search = n; search > lim; --search) { + if (search <= doc.first) return doc.first; + var line = getLine(doc, search - 1); + if (line.stateAfter && (!precise || search <= doc.frontier)) return search; + var indented = countColumn(line.text, null, cm.options.tabSize); + if (minline == null || minindent > indented) { + minline = search - 1; + minindent = indented; + } + } + return minline; + } + + function getStateBefore(cm, n, precise) { + var doc = cm.doc, display = cm.display; + if (!doc.mode.startState) return true; + var pos = findStartLine(cm, n, precise), state = pos > doc.first && getLine(doc, pos-1).stateAfter; + if (!state) state = startState(doc.mode); + else state = copyState(doc.mode, state); + doc.iter(pos, n, function(line) { + processLine(cm, line.text, state); + var save = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo; + line.stateAfter = save ? copyState(doc.mode, state) : null; + ++pos; + }); + if (precise) doc.frontier = pos; + return state; + } + + // POSITION MEASUREMENT + + function paddingTop(display) {return display.lineSpace.offsetTop;} + function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight;} + function paddingH(display) { + if (display.cachedPaddingH) return display.cachedPaddingH; + var e = removeChildrenAndAdd(display.measure, elt("pre", "x")); + var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle; + var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)}; + if (!isNaN(data.left) && !isNaN(data.right)) display.cachedPaddingH = data; + return data; + } + + function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth; } + function displayWidth(cm) { + return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth; + } + function displayHeight(cm) { + return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight; + } + + // Ensure the lineView.wrapping.heights array is populated. This is + // an array of bottom offsets for the lines that make up a drawn + // line. When lineWrapping is on, there might be more than one + // height. + function ensureLineHeights(cm, lineView, rect) { + var wrapping = cm.options.lineWrapping; + var curWidth = wrapping && displayWidth(cm); + if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) { + var heights = lineView.measure.heights = []; + if (wrapping) { + lineView.measure.width = curWidth; + var rects = lineView.text.firstChild.getClientRects(); + for (var i = 0; i < rects.length - 1; i++) { + var cur = rects[i], next = rects[i + 1]; + if (Math.abs(cur.bottom - next.bottom) > 2) + heights.push((cur.bottom + next.top) / 2 - rect.top); + } + } + heights.push(rect.bottom - rect.top); + } + } + + // Find a line map (mapping character offsets to text nodes) and a + // measurement cache for the given line number. (A line view might + // contain multiple lines when collapsed ranges are present.) + function mapFromLineView(lineView, line, lineN) { + if (lineView.line == line) + return {map: lineView.measure.map, cache: lineView.measure.cache}; + for (var i = 0; i < lineView.rest.length; i++) + if (lineView.rest[i] == line) + return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]}; + for (var i = 0; i < lineView.rest.length; i++) + if (lineNo(lineView.rest[i]) > lineN) + return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i], before: true}; + } + + // Render a line into the hidden node display.externalMeasured. Used + // when measurement is needed for a line that's not in the viewport. + function updateExternalMeasurement(cm, line) { + line = visualLine(line); + var lineN = lineNo(line); + var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN); + view.lineN = lineN; + var built = view.built = buildLineContent(cm, view); + view.text = built.pre; + removeChildrenAndAdd(cm.display.lineMeasure, built.pre); + return view; + } + + // Get a {top, bottom, left, right} box (in line-local coordinates) + // for a given character. + function measureChar(cm, line, ch, bias) { + return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias); + } + + // Find a line view that corresponds to the given line number. + function findViewForLine(cm, lineN) { + if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo) + return cm.display.view[findViewIndex(cm, lineN)]; + var ext = cm.display.externalMeasured; + if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size) + return ext; + } + + // Measurement can be split in two steps, the set-up work that + // applies to the whole line, and the measurement of the actual + // character. Functions like coordsChar, that need to do a lot of + // measurements in a row, can thus ensure that the set-up work is + // only done once. + function prepareMeasureForLine(cm, line) { + var lineN = lineNo(line); + var view = findViewForLine(cm, lineN); + if (view && !view.text) { + view = null; + } else if (view && view.changes) { + updateLineForChanges(cm, view, lineN, getDimensions(cm)); + cm.curOp.forceUpdate = true; + } + if (!view) + view = updateExternalMeasurement(cm, line); + + var info = mapFromLineView(view, line, lineN); + return { + line: line, view: view, rect: null, + map: info.map, cache: info.cache, before: info.before, + hasHeights: false + }; + } + + // Given a prepared measurement object, measures the position of an + // actual character (or fetches it from the cache). + function measureCharPrepared(cm, prepared, ch, bias, varHeight) { + if (prepared.before) ch = -1; + var key = ch + (bias || ""), found; + if (prepared.cache.hasOwnProperty(key)) { + found = prepared.cache[key]; + } else { + if (!prepared.rect) + prepared.rect = prepared.view.text.getBoundingClientRect(); + if (!prepared.hasHeights) { + ensureLineHeights(cm, prepared.view, prepared.rect); + prepared.hasHeights = true; + } + found = measureCharInner(cm, prepared, ch, bias); + if (!found.bogus) prepared.cache[key] = found; + } + return {left: found.left, right: found.right, + top: varHeight ? found.rtop : found.top, + bottom: varHeight ? found.rbottom : found.bottom}; + } + + var nullRect = {left: 0, right: 0, top: 0, bottom: 0}; + + function nodeAndOffsetInLineMap(map, ch, bias) { + var node, start, end, collapse; + // First, search the line map for the text node corresponding to, + // or closest to, the target character. + for (var i = 0; i < map.length; i += 3) { + var mStart = map[i], mEnd = map[i + 1]; + if (ch < mStart) { + start = 0; end = 1; + collapse = "left"; + } else if (ch < mEnd) { + start = ch - mStart; + end = start + 1; + } else if (i == map.length - 3 || ch == mEnd && map[i + 3] > ch) { + end = mEnd - mStart; + start = end - 1; + if (ch >= mEnd) collapse = "right"; + } + if (start != null) { + node = map[i + 2]; + if (mStart == mEnd && bias == (node.insertLeft ? "left" : "right")) + collapse = bias; + if (bias == "left" && start == 0) + while (i && map[i - 2] == map[i - 3] && map[i - 1].insertLeft) { + node = map[(i -= 3) + 2]; + collapse = "left"; + } + if (bias == "right" && start == mEnd - mStart) + while (i < map.length - 3 && map[i + 3] == map[i + 4] && !map[i + 5].insertLeft) { + node = map[(i += 3) + 2]; + collapse = "right"; + } + break; + } + } + return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd}; + } + + function measureCharInner(cm, prepared, ch, bias) { + var place = nodeAndOffsetInLineMap(prepared.map, ch, bias); + var node = place.node, start = place.start, end = place.end, collapse = place.collapse; + + var rect; + if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates. + for (var i = 0; i < 4; i++) { // Retry a maximum of 4 times when nonsense rectangles are returned + while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) --start; + while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) ++end; + if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart) { + rect = node.parentNode.getBoundingClientRect(); + } else if (ie && cm.options.lineWrapping) { + var rects = range(node, start, end).getClientRects(); + if (rects.length) + rect = rects[bias == "right" ? rects.length - 1 : 0]; + else + rect = nullRect; + } else { + rect = range(node, start, end).getBoundingClientRect() || nullRect; + } + if (rect.left || rect.right || start == 0) break; + end = start; + start = start - 1; + collapse = "right"; + } + if (ie && ie_version < 11) rect = maybeUpdateRectForZooming(cm.display.measure, rect); + } else { // If it is a widget, simply get the box for the whole widget. + if (start > 0) collapse = bias = "right"; + var rects; + if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1) + rect = rects[bias == "right" ? rects.length - 1 : 0]; + else + rect = node.getBoundingClientRect(); + } + if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) { + var rSpan = node.parentNode.getClientRects()[0]; + if (rSpan) + rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom}; + else + rect = nullRect; + } + + var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top; + var mid = (rtop + rbot) / 2; + var heights = prepared.view.measure.heights; + for (var i = 0; i < heights.length - 1; i++) + if (mid < heights[i]) break; + var top = i ? heights[i - 1] : 0, bot = heights[i]; + var result = {left: (collapse == "right" ? rect.right : rect.left) - prepared.rect.left, + right: (collapse == "left" ? rect.left : rect.right) - prepared.rect.left, + top: top, bottom: bot}; + if (!rect.left && !rect.right) result.bogus = true; + if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot; } + + return result; + } + + // Work around problem with bounding client rects on ranges being + // returned incorrectly when zoomed on IE10 and below. + function maybeUpdateRectForZooming(measure, rect) { + if (!window.screen || screen.logicalXDPI == null || + screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure)) + return rect; + var scaleX = screen.logicalXDPI / screen.deviceXDPI; + var scaleY = screen.logicalYDPI / screen.deviceYDPI; + return {left: rect.left * scaleX, right: rect.right * scaleX, + top: rect.top * scaleY, bottom: rect.bottom * scaleY}; + } + + function clearLineMeasurementCacheFor(lineView) { + if (lineView.measure) { + lineView.measure.cache = {}; + lineView.measure.heights = null; + if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++) + lineView.measure.caches[i] = {}; + } + } + + function clearLineMeasurementCache(cm) { + cm.display.externalMeasure = null; + removeChildren(cm.display.lineMeasure); + for (var i = 0; i < cm.display.view.length; i++) + clearLineMeasurementCacheFor(cm.display.view[i]); + } + + function clearCaches(cm) { + clearLineMeasurementCache(cm); + cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null; + if (!cm.options.lineWrapping) cm.display.maxLineChanged = true; + cm.display.lineNumChars = null; + } + + function pageScrollX() { return window.pageXOffset || (document.documentElement || document.body).scrollLeft; } + function pageScrollY() { return window.pageYOffset || (document.documentElement || document.body).scrollTop; } + + // Converts a {top, bottom, left, right} box from line-local + // coordinates into another coordinate system. Context may be one of + // "line", "div" (display.lineDiv), "local"/null (editor), "window", + // or "page". + function intoCoordSystem(cm, lineObj, rect, context) { + if (lineObj.widgets) for (var i = 0; i < lineObj.widgets.length; ++i) if (lineObj.widgets[i].above) { + var size = widgetHeight(lineObj.widgets[i]); + rect.top += size; rect.bottom += size; + } + if (context == "line") return rect; + if (!context) context = "local"; + var yOff = heightAtLine(lineObj); + if (context == "local") yOff += paddingTop(cm.display); + else yOff -= cm.display.viewOffset; + if (context == "page" || context == "window") { + var lOff = cm.display.lineSpace.getBoundingClientRect(); + yOff += lOff.top + (context == "window" ? 0 : pageScrollY()); + var xOff = lOff.left + (context == "window" ? 0 : pageScrollX()); + rect.left += xOff; rect.right += xOff; + } + rect.top += yOff; rect.bottom += yOff; + return rect; + } + + // Coverts a box from "div" coords to another coordinate system. + // Context may be "window", "page", "div", or "local"/null. + function fromCoordSystem(cm, coords, context) { + if (context == "div") return coords; + var left = coords.left, top = coords.top; + // First move into "page" coordinate system + if (context == "page") { + left -= pageScrollX(); + top -= pageScrollY(); + } else if (context == "local" || !context) { + var localBox = cm.display.sizer.getBoundingClientRect(); + left += localBox.left; + top += localBox.top; + } + + var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect(); + return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}; + } + + function charCoords(cm, pos, context, lineObj, bias) { + if (!lineObj) lineObj = getLine(cm.doc, pos.line); + return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context); + } + + // Returns a box for a given cursor position, which may have an + // 'other' property containing the position of the secondary cursor + // on a bidi boundary. + function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) { + lineObj = lineObj || getLine(cm.doc, pos.line); + if (!preparedMeasure) preparedMeasure = prepareMeasureForLine(cm, lineObj); + function get(ch, right) { + var m = measureCharPrepared(cm, preparedMeasure, ch, right ? "right" : "left", varHeight); + if (right) m.left = m.right; else m.right = m.left; + return intoCoordSystem(cm, lineObj, m, context); + } + function getBidi(ch, partPos) { + var part = order[partPos], right = part.level % 2; + if (ch == bidiLeft(part) && partPos && part.level < order[partPos - 1].level) { + part = order[--partPos]; + ch = bidiRight(part) - (part.level % 2 ? 0 : 1); + right = true; + } else if (ch == bidiRight(part) && partPos < order.length - 1 && part.level < order[partPos + 1].level) { + part = order[++partPos]; + ch = bidiLeft(part) - part.level % 2; + right = false; + } + if (right && ch == part.to && ch > part.from) return get(ch - 1); + return get(ch, right); + } + var order = getOrder(lineObj), ch = pos.ch; + if (!order) return get(ch); + var partPos = getBidiPartAt(order, ch); + var val = getBidi(ch, partPos); + if (bidiOther != null) val.other = getBidi(ch, bidiOther); + return val; + } + + // Used to cheaply estimate the coordinates for a position. Used for + // intermediate scroll updates. + function estimateCoords(cm, pos) { + var left = 0, pos = clipPos(cm.doc, pos); + if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch; + var lineObj = getLine(cm.doc, pos.line); + var top = heightAtLine(lineObj) + paddingTop(cm.display); + return {left: left, right: left, top: top, bottom: top + lineObj.height}; + } + + // Positions returned by coordsChar contain some extra information. + // xRel is the relative x position of the input coordinates compared + // to the found position (so xRel > 0 means the coordinates are to + // the right of the character position, for example). When outside + // is true, that means the coordinates lie outside the line's + // vertical range. + function PosWithInfo(line, ch, outside, xRel) { + var pos = Pos(line, ch); + pos.xRel = xRel; + if (outside) pos.outside = true; + return pos; + } + + // Compute the character position closest to the given coordinates. + // Input must be lineSpace-local ("div" coordinate system). + function coordsChar(cm, x, y) { + var doc = cm.doc; + y += cm.display.viewOffset; + if (y < 0) return PosWithInfo(doc.first, 0, true, -1); + var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1; + if (lineN > last) + return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1); + if (x < 0) x = 0; + + var lineObj = getLine(doc, lineN); + for (;;) { + var found = coordsCharInner(cm, lineObj, lineN, x, y); + var merged = collapsedSpanAtEnd(lineObj); + var mergedPos = merged && merged.find(0, true); + if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0)) + lineN = lineNo(lineObj = mergedPos.to.line); + else + return found; + } + } + + function coordsCharInner(cm, lineObj, lineNo, x, y) { + var innerOff = y - heightAtLine(lineObj); + var wrongLine = false, adjust = 2 * cm.display.wrapper.clientWidth; + var preparedMeasure = prepareMeasureForLine(cm, lineObj); + + function getX(ch) { + var sp = cursorCoords(cm, Pos(lineNo, ch), "line", lineObj, preparedMeasure); + wrongLine = true; + if (innerOff > sp.bottom) return sp.left - adjust; + else if (innerOff < sp.top) return sp.left + adjust; + else wrongLine = false; + return sp.left; + } + + var bidi = getOrder(lineObj), dist = lineObj.text.length; + var from = lineLeft(lineObj), to = lineRight(lineObj); + var fromX = getX(from), fromOutside = wrongLine, toX = getX(to), toOutside = wrongLine; + + if (x > toX) return PosWithInfo(lineNo, to, toOutside, 1); + // Do a binary search between these bounds. + for (;;) { + if (bidi ? to == from || to == moveVisually(lineObj, from, 1) : to - from <= 1) { + var ch = x < fromX || x - fromX <= toX - x ? from : to; + var outside = ch == from ? fromOutside : toOutside + var xDiff = x - (ch == from ? fromX : toX); + // This is a kludge to handle the case where the coordinates + // are after a line-wrapped line. We should replace it with a + // more general handling of cursor positions around line + // breaks. (Issue #4078) + if (toOutside && !bidi && !/\s/.test(lineObj.text.charAt(ch)) && xDiff > 0 && + ch < lineObj.text.length && preparedMeasure.view.measure.heights.length > 1) { + var charSize = measureCharPrepared(cm, preparedMeasure, ch, "right"); + if (innerOff <= charSize.bottom && innerOff >= charSize.top && Math.abs(x - charSize.right) < xDiff) { + outside = false + ch++ + xDiff = x - charSize.right + } + } + while (isExtendingChar(lineObj.text.charAt(ch))) ++ch; + var pos = PosWithInfo(lineNo, ch, outside, xDiff < -1 ? -1 : xDiff > 1 ? 1 : 0); + return pos; + } + var step = Math.ceil(dist / 2), middle = from + step; + if (bidi) { + middle = from; + for (var i = 0; i < step; ++i) middle = moveVisually(lineObj, middle, 1); + } + var middleX = getX(middle); + if (middleX > x) {to = middle; toX = middleX; if (toOutside = wrongLine) toX += 1000; dist = step;} + else {from = middle; fromX = middleX; fromOutside = wrongLine; dist -= step;} + } + } + + var measureText; + // Compute the default text height. + function textHeight(display) { + if (display.cachedTextHeight != null) return display.cachedTextHeight; + if (measureText == null) { + measureText = elt("pre"); + // Measure a bunch of lines, for browsers that compute + // fractional heights. + for (var i = 0; i < 49; ++i) { + measureText.appendChild(document.createTextNode("x")); + measureText.appendChild(elt("br")); + } + measureText.appendChild(document.createTextNode("x")); + } + removeChildrenAndAdd(display.measure, measureText); + var height = measureText.offsetHeight / 50; + if (height > 3) display.cachedTextHeight = height; + removeChildren(display.measure); + return height || 1; + } + + // Compute the default character width. + function charWidth(display) { + if (display.cachedCharWidth != null) return display.cachedCharWidth; + var anchor = elt("span", "xxxxxxxxxx"); + var pre = elt("pre", [anchor]); + removeChildrenAndAdd(display.measure, pre); + var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10; + if (width > 2) display.cachedCharWidth = width; + return width || 10; + } + + // OPERATIONS + + // Operations are used to wrap a series of changes to the editor + // state in such a way that each change won't have to update the + // cursor and display (which would be awkward, slow, and + // error-prone). Instead, display updates are batched and then all + // combined and executed at once. + + var operationGroup = null; + + var nextOpId = 0; + // Start a new operation. + function startOperation(cm) { + cm.curOp = { + cm: cm, + viewChanged: false, // Flag that indicates that lines might need to be redrawn + startHeight: cm.doc.height, // Used to detect need to update scrollbar + forceUpdate: false, // Used to force a redraw + updateInput: null, // Whether to reset the input textarea + typing: false, // Whether this reset should be careful to leave existing text (for compositing) + changeObjs: null, // Accumulated changes, for firing change events + cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on + cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already + selectionChanged: false, // Whether the selection needs to be redrawn + updateMaxLine: false, // Set when the widest line needs to be determined anew + scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet + scrollToPos: null, // Used to scroll to a specific position + focus: false, + id: ++nextOpId // Unique ID + }; + if (operationGroup) { + operationGroup.ops.push(cm.curOp); + } else { + cm.curOp.ownsGroup = operationGroup = { + ops: [cm.curOp], + delayedCallbacks: [] + }; + } + } + + function fireCallbacksForOps(group) { + // Calls delayed callbacks and cursorActivity handlers until no + // new ones appear + var callbacks = group.delayedCallbacks, i = 0; + do { + for (; i < callbacks.length; i++) + callbacks[i].call(null); + for (var j = 0; j < group.ops.length; j++) { + var op = group.ops[j]; + if (op.cursorActivityHandlers) + while (op.cursorActivityCalled < op.cursorActivityHandlers.length) + op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm); + } + } while (i < callbacks.length); + } + + // Finish an operation, updating the display and signalling delayed events + function endOperation(cm) { + var op = cm.curOp, group = op.ownsGroup; + if (!group) return; + + try { fireCallbacksForOps(group); } + finally { + operationGroup = null; + for (var i = 0; i < group.ops.length; i++) + group.ops[i].cm.curOp = null; + endOperations(group); + } + } + + // The DOM updates done when an operation finishes are batched so + // that the minimum number of relayouts are required. + function endOperations(group) { + var ops = group.ops; + for (var i = 0; i < ops.length; i++) // Read DOM + endOperation_R1(ops[i]); + for (var i = 0; i < ops.length; i++) // Write DOM (maybe) + endOperation_W1(ops[i]); + for (var i = 0; i < ops.length; i++) // Read DOM + endOperation_R2(ops[i]); + for (var i = 0; i < ops.length; i++) // Write DOM (maybe) + endOperation_W2(ops[i]); + for (var i = 0; i < ops.length; i++) // Read DOM + endOperation_finish(ops[i]); + } + + function endOperation_R1(op) { + var cm = op.cm, display = cm.display; + maybeClipScrollbars(cm); + if (op.updateMaxLine) findMaxLine(cm); + + op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null || + op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom || + op.scrollToPos.to.line >= display.viewTo) || + display.maxLineChanged && cm.options.lineWrapping; + op.update = op.mustUpdate && + new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate); + } + + function endOperation_W1(op) { + op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update); + } + + function endOperation_R2(op) { + var cm = op.cm, display = cm.display; + if (op.updatedDisplay) updateHeightsInViewport(cm); + + op.barMeasure = measureForScrollbars(cm); + + // If the max line changed since it was last measured, measure it, + // and ensure the document's width matches it. + // updateDisplay_W2 will use these properties to do the actual resizing + if (display.maxLineChanged && !cm.options.lineWrapping) { + op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3; + cm.display.sizerWidth = op.adjustWidthTo; + op.barMeasure.scrollWidth = + Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth); + op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm)); + } + + if (op.updatedDisplay || op.selectionChanged) + op.preparedSelection = display.input.prepareSelection(op.focus); + } + + function endOperation_W2(op) { + var cm = op.cm; + + if (op.adjustWidthTo != null) { + cm.display.sizer.style.minWidth = op.adjustWidthTo + "px"; + if (op.maxScrollLeft < cm.doc.scrollLeft) + setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true); + cm.display.maxLineChanged = false; + } + + var takeFocus = op.focus && op.focus == activeElt() && (!document.hasFocus || document.hasFocus()) + if (op.preparedSelection) + cm.display.input.showSelection(op.preparedSelection, takeFocus); + if (op.updatedDisplay || op.startHeight != cm.doc.height) + updateScrollbars(cm, op.barMeasure); + if (op.updatedDisplay) + setDocumentHeight(cm, op.barMeasure); + + if (op.selectionChanged) restartBlink(cm); + + if (cm.state.focused && op.updateInput) + cm.display.input.reset(op.typing); + if (takeFocus) ensureFocus(op.cm); + } + + function endOperation_finish(op) { + var cm = op.cm, display = cm.display, doc = cm.doc; + + if (op.updatedDisplay) postUpdateDisplay(cm, op.update); + + // Abort mouse wheel delta measurement, when scrolling explicitly + if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos)) + display.wheelStartX = display.wheelStartY = null; + + // Propagate the scroll position to the actual DOM scroller + if (op.scrollTop != null && (display.scroller.scrollTop != op.scrollTop || op.forceScroll)) { + doc.scrollTop = Math.max(0, Math.min(display.scroller.scrollHeight - display.scroller.clientHeight, op.scrollTop)); + display.scrollbars.setScrollTop(doc.scrollTop); + display.scroller.scrollTop = doc.scrollTop; + } + if (op.scrollLeft != null && (display.scroller.scrollLeft != op.scrollLeft || op.forceScroll)) { + doc.scrollLeft = Math.max(0, Math.min(display.scroller.scrollWidth - display.scroller.clientWidth, op.scrollLeft)); + display.scrollbars.setScrollLeft(doc.scrollLeft); + display.scroller.scrollLeft = doc.scrollLeft; + alignHorizontally(cm); + } + // If we need to scroll a specific position into view, do so. + if (op.scrollToPos) { + var coords = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from), + clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin); + if (op.scrollToPos.isCursor && cm.state.focused) maybeScrollWindow(cm, coords); + } + + // Fire events for markers that are hidden/unidden by editing or + // undoing + var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers; + if (hidden) for (var i = 0; i < hidden.length; ++i) + if (!hidden[i].lines.length) signal(hidden[i], "hide"); + if (unhidden) for (var i = 0; i < unhidden.length; ++i) + if (unhidden[i].lines.length) signal(unhidden[i], "unhide"); + + if (display.wrapper.offsetHeight) + doc.scrollTop = cm.display.scroller.scrollTop; + + // Fire change events, and delayed event handlers + if (op.changeObjs) + signal(cm, "changes", cm, op.changeObjs); + if (op.update) + op.update.finish(); + } + + // Run the given function in an operation + function runInOp(cm, f) { + if (cm.curOp) return f(); + startOperation(cm); + try { return f(); } + finally { endOperation(cm); } + } + // Wraps a function in an operation. Returns the wrapped function. + function operation(cm, f) { + return function() { + if (cm.curOp) return f.apply(cm, arguments); + startOperation(cm); + try { return f.apply(cm, arguments); } + finally { endOperation(cm); } + }; + } + // Used to add methods to editor and doc instances, wrapping them in + // operations. + function methodOp(f) { + return function() { + if (this.curOp) return f.apply(this, arguments); + startOperation(this); + try { return f.apply(this, arguments); } + finally { endOperation(this); } + }; + } + function docMethodOp(f) { + return function() { + var cm = this.cm; + if (!cm || cm.curOp) return f.apply(this, arguments); + startOperation(cm); + try { return f.apply(this, arguments); } + finally { endOperation(cm); } + }; + } + + // VIEW TRACKING + + // These objects are used to represent the visible (currently drawn) + // part of the document. A LineView may correspond to multiple + // logical lines, if those are connected by collapsed ranges. + function LineView(doc, line, lineN) { + // The starting line + this.line = line; + // Continuing lines, if any + this.rest = visualLineContinued(line); + // Number of logical lines in this visual line + this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1; + this.node = this.text = null; + this.hidden = lineIsHidden(doc, line); + } + + // Create a range of LineView objects for the given lines. + function buildViewArray(cm, from, to) { + var array = [], nextPos; + for (var pos = from; pos < to; pos = nextPos) { + var view = new LineView(cm.doc, getLine(cm.doc, pos), pos); + nextPos = pos + view.size; + array.push(view); + } + return array; + } + + // Updates the display.view data structure for a given change to the + // document. From and to are in pre-change coordinates. Lendiff is + // the amount of lines added or subtracted by the change. This is + // used for changes that span multiple lines, or change the way + // lines are divided into visual lines. regLineChange (below) + // registers single-line changes. + function regChange(cm, from, to, lendiff) { + if (from == null) from = cm.doc.first; + if (to == null) to = cm.doc.first + cm.doc.size; + if (!lendiff) lendiff = 0; + + var display = cm.display; + if (lendiff && to < display.viewTo && + (display.updateLineNumbers == null || display.updateLineNumbers > from)) + display.updateLineNumbers = from; + + cm.curOp.viewChanged = true; + + if (from >= display.viewTo) { // Change after + if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo) + resetView(cm); + } else if (to <= display.viewFrom) { // Change before + if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) { + resetView(cm); + } else { + display.viewFrom += lendiff; + display.viewTo += lendiff; + } + } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap + resetView(cm); + } else if (from <= display.viewFrom) { // Top overlap + var cut = viewCuttingPoint(cm, to, to + lendiff, 1); + if (cut) { + display.view = display.view.slice(cut.index); + display.viewFrom = cut.lineN; + display.viewTo += lendiff; + } else { + resetView(cm); + } + } else if (to >= display.viewTo) { // Bottom overlap + var cut = viewCuttingPoint(cm, from, from, -1); + if (cut) { + display.view = display.view.slice(0, cut.index); + display.viewTo = cut.lineN; + } else { + resetView(cm); + } + } else { // Gap in the middle + var cutTop = viewCuttingPoint(cm, from, from, -1); + var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1); + if (cutTop && cutBot) { + display.view = display.view.slice(0, cutTop.index) + .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN)) + .concat(display.view.slice(cutBot.index)); + display.viewTo += lendiff; + } else { + resetView(cm); + } + } + + var ext = display.externalMeasured; + if (ext) { + if (to < ext.lineN) + ext.lineN += lendiff; + else if (from < ext.lineN + ext.size) + display.externalMeasured = null; + } + } + + // Register a change to a single line. Type must be one of "text", + // "gutter", "class", "widget" + function regLineChange(cm, line, type) { + cm.curOp.viewChanged = true; + var display = cm.display, ext = cm.display.externalMeasured; + if (ext && line >= ext.lineN && line < ext.lineN + ext.size) + display.externalMeasured = null; + + if (line < display.viewFrom || line >= display.viewTo) return; + var lineView = display.view[findViewIndex(cm, line)]; + if (lineView.node == null) return; + var arr = lineView.changes || (lineView.changes = []); + if (indexOf(arr, type) == -1) arr.push(type); + } + + // Clear the view. + function resetView(cm) { + cm.display.viewFrom = cm.display.viewTo = cm.doc.first; + cm.display.view = []; + cm.display.viewOffset = 0; + } + + // Find the view element corresponding to a given line. Return null + // when the line isn't visible. + function findViewIndex(cm, n) { + if (n >= cm.display.viewTo) return null; + n -= cm.display.viewFrom; + if (n < 0) return null; + var view = cm.display.view; + for (var i = 0; i < view.length; i++) { + n -= view[i].size; + if (n < 0) return i; + } + } + + function viewCuttingPoint(cm, oldN, newN, dir) { + var index = findViewIndex(cm, oldN), diff, view = cm.display.view; + if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size) + return {index: index, lineN: newN}; + for (var i = 0, n = cm.display.viewFrom; i < index; i++) + n += view[i].size; + if (n != oldN) { + if (dir > 0) { + if (index == view.length - 1) return null; + diff = (n + view[index].size) - oldN; + index++; + } else { + diff = n - oldN; + } + oldN += diff; newN += diff; + } + while (visualLineNo(cm.doc, newN) != newN) { + if (index == (dir < 0 ? 0 : view.length - 1)) return null; + newN += dir * view[index - (dir < 0 ? 1 : 0)].size; + index += dir; + } + return {index: index, lineN: newN}; + } + + // Force the view to cover a given range, adding empty view element + // or clipping off existing ones as needed. + function adjustView(cm, from, to) { + var display = cm.display, view = display.view; + if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) { + display.view = buildViewArray(cm, from, to); + display.viewFrom = from; + } else { + if (display.viewFrom > from) + display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); + else if (display.viewFrom < from) + display.view = display.view.slice(findViewIndex(cm, from)); + display.viewFrom = from; + if (display.viewTo < to) + display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); + else if (display.viewTo > to) + display.view = display.view.slice(0, findViewIndex(cm, to)); + } + display.viewTo = to; + } + + // Count the number of lines in the view whose DOM representation is + // out of date (or nonexistent). + function countDirtyView(cm) { + var view = cm.display.view, dirty = 0; + for (var i = 0; i < view.length; i++) { + var lineView = view[i]; + if (!lineView.hidden && (!lineView.node || lineView.changes)) ++dirty; + } + return dirty; + } + + // EVENT HANDLERS + + // Attach the necessary event handlers when initializing the editor + function registerEventHandlers(cm) { + var d = cm.display; + on(d.scroller, "mousedown", operation(cm, onMouseDown)); + // Older IE's will not fire a second mousedown for a double click + if (ie && ie_version < 11) + on(d.scroller, "dblclick", operation(cm, function(e) { + if (signalDOMEvent(cm, e)) return; + var pos = posFromMouse(cm, e); + if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) return; + e_preventDefault(e); + var word = cm.findWordAt(pos); + extendSelection(cm.doc, word.anchor, word.head); + })); + else + on(d.scroller, "dblclick", function(e) { signalDOMEvent(cm, e) || e_preventDefault(e); }); + // Some browsers fire contextmenu *after* opening the menu, at + // which point we can't mess with it anymore. Context menu is + // handled in onMouseDown for these browsers. + if (!captureRightClick) on(d.scroller, "contextmenu", function(e) {onContextMenu(cm, e);}); + + // Used to suppress mouse event handling when a touch happens + var touchFinished, prevTouch = {end: 0}; + function finishTouch() { + if (d.activeTouch) { + touchFinished = setTimeout(function() {d.activeTouch = null;}, 1000); + prevTouch = d.activeTouch; + prevTouch.end = +new Date; + } + }; + function isMouseLikeTouchEvent(e) { + if (e.touches.length != 1) return false; + var touch = e.touches[0]; + return touch.radiusX <= 1 && touch.radiusY <= 1; + } + function farAway(touch, other) { + if (other.left == null) return true; + var dx = other.left - touch.left, dy = other.top - touch.top; + return dx * dx + dy * dy > 20 * 20; + } + on(d.scroller, "touchstart", function(e) { + if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e)) { + clearTimeout(touchFinished); + var now = +new Date; + d.activeTouch = {start: now, moved: false, + prev: now - prevTouch.end <= 300 ? prevTouch : null}; + if (e.touches.length == 1) { + d.activeTouch.left = e.touches[0].pageX; + d.activeTouch.top = e.touches[0].pageY; + } + } + }); + on(d.scroller, "touchmove", function() { + if (d.activeTouch) d.activeTouch.moved = true; + }); + on(d.scroller, "touchend", function(e) { + var touch = d.activeTouch; + if (touch && !eventInWidget(d, e) && touch.left != null && + !touch.moved && new Date - touch.start < 300) { + var pos = cm.coordsChar(d.activeTouch, "page"), range; + if (!touch.prev || farAway(touch, touch.prev)) // Single tap + range = new Range(pos, pos); + else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap + range = cm.findWordAt(pos); + else // Triple tap + range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); + cm.setSelection(range.anchor, range.head); + cm.focus(); + e_preventDefault(e); + } + finishTouch(); + }); + on(d.scroller, "touchcancel", finishTouch); + + // Sync scrolling between fake scrollbars and real scrollable + // area, ensure viewport is updated when scrolling. + on(d.scroller, "scroll", function() { + if (d.scroller.clientHeight) { + setScrollTop(cm, d.scroller.scrollTop); + setScrollLeft(cm, d.scroller.scrollLeft, true); + signal(cm, "scroll", cm); + } + }); + + // Listen to wheel events in order to try and update the viewport on time. + on(d.scroller, "mousewheel", function(e){onScrollWheel(cm, e);}); + on(d.scroller, "DOMMouseScroll", function(e){onScrollWheel(cm, e);}); + + // Prevent wrapper from ever scrolling + on(d.wrapper, "scroll", function() { d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; }); + + d.dragFunctions = { + enter: function(e) {if (!signalDOMEvent(cm, e)) e_stop(e);}, + over: function(e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }}, + start: function(e){onDragStart(cm, e);}, + drop: operation(cm, onDrop), + leave: function(e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }} + }; + + var inp = d.input.getField(); + on(inp, "keyup", function(e) { onKeyUp.call(cm, e); }); + on(inp, "keydown", operation(cm, onKeyDown)); + on(inp, "keypress", operation(cm, onKeyPress)); + on(inp, "focus", bind(onFocus, cm)); + on(inp, "blur", bind(onBlur, cm)); + } + + function dragDropChanged(cm, value, old) { + var wasOn = old && old != CodeMirror.Init; + if (!value != !wasOn) { + var funcs = cm.display.dragFunctions; + var toggle = value ? on : off; + toggle(cm.display.scroller, "dragstart", funcs.start); + toggle(cm.display.scroller, "dragenter", funcs.enter); + toggle(cm.display.scroller, "dragover", funcs.over); + toggle(cm.display.scroller, "dragleave", funcs.leave); + toggle(cm.display.scroller, "drop", funcs.drop); + } + } + + // Called when the window resizes + function onResize(cm) { + var d = cm.display; + if (d.lastWrapHeight == d.wrapper.clientHeight && d.lastWrapWidth == d.wrapper.clientWidth) + return; + // Might be a text scaling operation, clear size caches. + d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null; + d.scrollbarsClipped = false; + cm.setSize(); + } + + // MOUSE EVENTS + + // Return true when the given mouse event happened in a widget + function eventInWidget(display, e) { + for (var n = e_target(e); n != display.wrapper; n = n.parentNode) { + if (!n || (n.nodeType == 1 && n.getAttribute("cm-ignore-events") == "true") || + (n.parentNode == display.sizer && n != display.mover)) + return true; + } + } + + // Given a mouse event, find the corresponding position. If liberal + // is false, it checks whether a gutter or scrollbar was clicked, + // and returns null if it was. forRect is used by rectangular + // selections, and tries to estimate a character position even for + // coordinates beyond the right of the text. + function posFromMouse(cm, e, liberal, forRect) { + var display = cm.display; + if (!liberal && e_target(e).getAttribute("cm-not-content") == "true") return null; + + var x, y, space = display.lineSpace.getBoundingClientRect(); + // Fails unpredictably on IE[67] when mouse is dragged around quickly. + try { x = e.clientX - space.left; y = e.clientY - space.top; } + catch (e) { return null; } + var coords = coordsChar(cm, x, y), line; + if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) { + var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length; + coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff)); + } + return coords; + } + + // A mouse down can be a single click, double click, triple click, + // start of selection drag, start of text drag, new cursor + // (ctrl-click), rectangle drag (alt-drag), or xwin + // middle-click-paste. Or it might be a click on something we should + // not interfere with, such as a scrollbar or widget. + function onMouseDown(e) { + var cm = this, display = cm.display; + if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) return; + display.shift = e.shiftKey; + + if (eventInWidget(display, e)) { + if (!webkit) { + // Briefly turn off draggability, to allow widgets to do + // normal dragging things. + display.scroller.draggable = false; + setTimeout(function(){display.scroller.draggable = true;}, 100); + } + return; + } + if (clickInGutter(cm, e)) return; + var start = posFromMouse(cm, e); + window.focus(); + + switch (e_button(e)) { + case 1: + // #3261: make sure, that we're not starting a second selection + if (cm.state.selectingText) + cm.state.selectingText(e); + else if (start) + leftButtonDown(cm, e, start); + else if (e_target(e) == display.scroller) + e_preventDefault(e); + break; + case 2: + if (webkit) cm.state.lastMiddleDown = +new Date; + if (start) extendSelection(cm.doc, start); + setTimeout(function() {display.input.focus();}, 20); + e_preventDefault(e); + break; + case 3: + if (captureRightClick) onContextMenu(cm, e); + else delayBlurEvent(cm); + break; + } + } + + var lastClick, lastDoubleClick; + function leftButtonDown(cm, e, start) { + if (ie) setTimeout(bind(ensureFocus, cm), 0); + else cm.curOp.focus = activeElt(); + + var now = +new Date, type; + if (lastDoubleClick && lastDoubleClick.time > now - 400 && cmp(lastDoubleClick.pos, start) == 0) { + type = "triple"; + } else if (lastClick && lastClick.time > now - 400 && cmp(lastClick.pos, start) == 0) { + type = "double"; + lastDoubleClick = {time: now, pos: start}; + } else { + type = "single"; + lastClick = {time: now, pos: start}; + } + + var sel = cm.doc.sel, modifier = mac ? e.metaKey : e.ctrlKey, contained; + if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() && + type == "single" && (contained = sel.contains(start)) > -1 && + (cmp((contained = sel.ranges[contained]).from(), start) < 0 || start.xRel > 0) && + (cmp(contained.to(), start) > 0 || start.xRel < 0)) + leftButtonStartDrag(cm, e, start, modifier); + else + leftButtonSelect(cm, e, start, type, modifier); + } + + // Start a text drag. When it ends, see if any dragging actually + // happen, and treat as a click if it didn't. + function leftButtonStartDrag(cm, e, start, modifier) { + var display = cm.display, startTime = +new Date; + var dragEnd = operation(cm, function(e2) { + if (webkit) display.scroller.draggable = false; + cm.state.draggingText = false; + off(document, "mouseup", dragEnd); + off(display.scroller, "drop", dragEnd); + if (Math.abs(e.clientX - e2.clientX) + Math.abs(e.clientY - e2.clientY) < 10) { + e_preventDefault(e2); + if (!modifier && +new Date - 200 < startTime) + extendSelection(cm.doc, start); + // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081) + if (webkit || ie && ie_version == 9) + setTimeout(function() {document.body.focus(); display.input.focus();}, 20); + else + display.input.focus(); + } + }); + // Let the drag handler handle this. + if (webkit) display.scroller.draggable = true; + cm.state.draggingText = dragEnd; + dragEnd.copy = mac ? e.altKey : e.ctrlKey + // IE's approach to draggable + if (display.scroller.dragDrop) display.scroller.dragDrop(); + on(document, "mouseup", dragEnd); + on(display.scroller, "drop", dragEnd); + } + + // Normal selection, as opposed to text dragging. + function leftButtonSelect(cm, e, start, type, addNew) { + var display = cm.display, doc = cm.doc; + e_preventDefault(e); + + var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges; + if (addNew && !e.shiftKey) { + ourIndex = doc.sel.contains(start); + if (ourIndex > -1) + ourRange = ranges[ourIndex]; + else + ourRange = new Range(start, start); + } else { + ourRange = doc.sel.primary(); + ourIndex = doc.sel.primIndex; + } + + if (chromeOS ? e.shiftKey && e.metaKey : e.altKey) { + type = "rect"; + if (!addNew) ourRange = new Range(start, start); + start = posFromMouse(cm, e, true, true); + ourIndex = -1; + } else if (type == "double") { + var word = cm.findWordAt(start); + if (cm.display.shift || doc.extend) + ourRange = extendRange(doc, ourRange, word.anchor, word.head); + else + ourRange = word; + } else if (type == "triple") { + var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0))); + if (cm.display.shift || doc.extend) + ourRange = extendRange(doc, ourRange, line.anchor, line.head); + else + ourRange = line; + } else { + ourRange = extendRange(doc, ourRange, start); + } + + if (!addNew) { + ourIndex = 0; + setSelection(doc, new Selection([ourRange], 0), sel_mouse); + startSel = doc.sel; + } else if (ourIndex == -1) { + ourIndex = ranges.length; + setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex), + {scroll: false, origin: "*mouse"}); + } else if (ranges.length > 1 && ranges[ourIndex].empty() && type == "single" && !e.shiftKey) { + setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0), + {scroll: false, origin: "*mouse"}); + startSel = doc.sel; + } else { + replaceOneSelection(doc, ourIndex, ourRange, sel_mouse); + } + + var lastPos = start; + function extendTo(pos) { + if (cmp(lastPos, pos) == 0) return; + lastPos = pos; + + if (type == "rect") { + var ranges = [], tabSize = cm.options.tabSize; + var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize); + var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize); + var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol); + for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line)); + line <= end; line++) { + var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize); + if (left == right) + ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); + else if (text.length > leftPos) + ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); + } + if (!ranges.length) ranges.push(new Range(start, start)); + setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex), + {origin: "*mouse", scroll: false}); + cm.scrollIntoView(pos); + } else { + var oldRange = ourRange; + var anchor = oldRange.anchor, head = pos; + if (type != "single") { + if (type == "double") + var range = cm.findWordAt(pos); + else + var range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0))); + if (cmp(range.anchor, anchor) > 0) { + head = range.head; + anchor = minPos(oldRange.from(), range.anchor); + } else { + head = range.anchor; + anchor = maxPos(oldRange.to(), range.head); + } + } + var ranges = startSel.ranges.slice(0); + ranges[ourIndex] = new Range(clipPos(doc, anchor), head); + setSelection(doc, normalizeSelection(ranges, ourIndex), sel_mouse); + } + } + + var editorSize = display.wrapper.getBoundingClientRect(); + // Used to ensure timeout re-tries don't fire when another extend + // happened in the meantime (clearTimeout isn't reliable -- at + // least on Chrome, the timeouts still happen even when cleared, + // if the clear happens after their scheduled firing time). + var counter = 0; + + function extend(e) { + var curCount = ++counter; + var cur = posFromMouse(cm, e, true, type == "rect"); + if (!cur) return; + if (cmp(cur, lastPos) != 0) { + cm.curOp.focus = activeElt(); + extendTo(cur); + var visible = visibleLines(display, doc); + if (cur.line >= visible.to || cur.line < visible.from) + setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150); + } else { + var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0; + if (outside) setTimeout(operation(cm, function() { + if (counter != curCount) return; + display.scroller.scrollTop += outside; + extend(e); + }), 50); + } + } + + function done(e) { + cm.state.selectingText = false; + counter = Infinity; + e_preventDefault(e); + display.input.focus(); + off(document, "mousemove", move); + off(document, "mouseup", up); + doc.history.lastSelOrigin = null; + } + + var move = operation(cm, function(e) { + if (!e_button(e)) done(e); + else extend(e); + }); + var up = operation(cm, done); + cm.state.selectingText = up; + on(document, "mousemove", move); + on(document, "mouseup", up); + } + + // Determines whether an event happened in the gutter, and fires the + // handlers for the corresponding event. + function gutterEvent(cm, e, type, prevent) { + try { var mX = e.clientX, mY = e.clientY; } + catch(e) { return false; } + if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) return false; + if (prevent) e_preventDefault(e); + + var display = cm.display; + var lineBox = display.lineDiv.getBoundingClientRect(); + + if (mY > lineBox.bottom || !hasHandler(cm, type)) return e_defaultPrevented(e); + mY -= lineBox.top - display.viewOffset; + + for (var i = 0; i < cm.options.gutters.length; ++i) { + var g = display.gutters.childNodes[i]; + if (g && g.getBoundingClientRect().right >= mX) { + var line = lineAtHeight(cm.doc, mY); + var gutter = cm.options.gutters[i]; + signal(cm, type, cm, line, gutter, e); + return e_defaultPrevented(e); + } + } + } + + function clickInGutter(cm, e) { + return gutterEvent(cm, e, "gutterClick", true); + } + + // Kludge to work around strange IE behavior where it'll sometimes + // re-fire a series of drag-related events right after the drop (#1551) + var lastDrop = 0; + + function onDrop(e) { + var cm = this; + clearDragCursor(cm); + if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) + return; + e_preventDefault(e); + if (ie) lastDrop = +new Date; + var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files; + if (!pos || cm.isReadOnly()) return; + // Might be a file drop, in which case we simply extract the text + // and insert it. + if (files && files.length && window.FileReader && window.File) { + var n = files.length, text = Array(n), read = 0; + var loadFile = function(file, i) { + if (cm.options.allowDropFileTypes && + indexOf(cm.options.allowDropFileTypes, file.type) == -1) + return; + + var reader = new FileReader; + reader.onload = operation(cm, function() { + var content = reader.result; + if (/[\x00-\x08\x0e-\x1f]{2}/.test(content)) content = ""; + text[i] = content; + if (++read == n) { + pos = clipPos(cm.doc, pos); + var change = {from: pos, to: pos, + text: cm.doc.splitLines(text.join(cm.doc.lineSeparator())), + origin: "paste"}; + makeChange(cm.doc, change); + setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change))); + } + }); + reader.readAsText(file); + }; + for (var i = 0; i < n; ++i) loadFile(files[i], i); + } else { // Normal drop + // Don't do a replace if the drop happened inside of the selected text. + if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) { + cm.state.draggingText(e); + // Ensure the editor is re-focused + setTimeout(function() {cm.display.input.focus();}, 20); + return; + } + try { + var text = e.dataTransfer.getData("Text"); + if (text) { + if (cm.state.draggingText && !cm.state.draggingText.copy) + var selected = cm.listSelections(); + setSelectionNoUndo(cm.doc, simpleSelection(pos, pos)); + if (selected) for (var i = 0; i < selected.length; ++i) + replaceRange(cm.doc, "", selected[i].anchor, selected[i].head, "drag"); + cm.replaceSelection(text, "around", "paste"); + cm.display.input.focus(); + } + } + catch(e){} + } + } + + function onDragStart(cm, e) { + if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return; } + if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) return; + + e.dataTransfer.setData("Text", cm.getSelection()); + e.dataTransfer.effectAllowed = "copyMove" + + // Use dummy image instead of default browsers image. + // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there. + if (e.dataTransfer.setDragImage && !safari) { + var img = elt("img", null, null, "position: fixed; left: 0; top: 0;"); + img.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="; + if (presto) { + img.width = img.height = 1; + cm.display.wrapper.appendChild(img); + // Force a relayout, or Opera won't use our image for some obscure reason + img._top = img.offsetTop; + } + e.dataTransfer.setDragImage(img, 0, 0); + if (presto) img.parentNode.removeChild(img); + } + } + + function onDragOver(cm, e) { + var pos = posFromMouse(cm, e); + if (!pos) return; + var frag = document.createDocumentFragment(); + drawSelectionCursor(cm, pos, frag); + if (!cm.display.dragCursor) { + cm.display.dragCursor = elt("div", null, "CodeMirror-cursors CodeMirror-dragcursors"); + cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv); + } + removeChildrenAndAdd(cm.display.dragCursor, frag); + } + + function clearDragCursor(cm) { + if (cm.display.dragCursor) { + cm.display.lineSpace.removeChild(cm.display.dragCursor); + cm.display.dragCursor = null; + } + } + + // SCROLL EVENTS + + // Sync the scrollable area and scrollbars, ensure the viewport + // covers the visible area. + function setScrollTop(cm, val) { + if (Math.abs(cm.doc.scrollTop - val) < 2) return; + cm.doc.scrollTop = val; + if (!gecko) updateDisplaySimple(cm, {top: val}); + if (cm.display.scroller.scrollTop != val) cm.display.scroller.scrollTop = val; + cm.display.scrollbars.setScrollTop(val); + if (gecko) updateDisplaySimple(cm); + startWorker(cm, 100); + } + // Sync scroller and scrollbar, ensure the gutter elements are + // aligned. + function setScrollLeft(cm, val, isScroller) { + if (isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) return; + val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth); + cm.doc.scrollLeft = val; + alignHorizontally(cm); + if (cm.display.scroller.scrollLeft != val) cm.display.scroller.scrollLeft = val; + cm.display.scrollbars.setScrollLeft(val); + } + + // Since the delta values reported on mouse wheel events are + // unstandardized between browsers and even browser versions, and + // generally horribly unpredictable, this code starts by measuring + // the scroll effect that the first few mouse wheel events have, + // and, from that, detects the way it can convert deltas to pixel + // offsets afterwards. + // + // The reason we want to know the amount a wheel event will scroll + // is that it gives us a chance to update the display before the + // actual scrolling happens, reducing flickering. + + var wheelSamples = 0, wheelPixelsPerUnit = null; + // Fill in a browser-detected starting value on browsers where we + // know one. These don't have to be accurate -- the result of them + // being wrong would just be a slight flicker on the first wheel + // scroll (if it is large enough). + if (ie) wheelPixelsPerUnit = -.53; + else if (gecko) wheelPixelsPerUnit = 15; + else if (chrome) wheelPixelsPerUnit = -.7; + else if (safari) wheelPixelsPerUnit = -1/3; + + var wheelEventDelta = function(e) { + var dx = e.wheelDeltaX, dy = e.wheelDeltaY; + if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) dx = e.detail; + if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) dy = e.detail; + else if (dy == null) dy = e.wheelDelta; + return {x: dx, y: dy}; + }; + CodeMirror.wheelEventPixels = function(e) { + var delta = wheelEventDelta(e); + delta.x *= wheelPixelsPerUnit; + delta.y *= wheelPixelsPerUnit; + return delta; + }; + + function onScrollWheel(cm, e) { + var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y; + + var display = cm.display, scroll = display.scroller; + // Quit if there's nothing to scroll here + var canScrollX = scroll.scrollWidth > scroll.clientWidth; + var canScrollY = scroll.scrollHeight > scroll.clientHeight; + if (!(dx && canScrollX || dy && canScrollY)) return; + + // Webkit browsers on OS X abort momentum scrolls when the target + // of the scroll event is removed from the scrollable element. + // This hack (see related code in patchDisplay) makes sure the + // element is kept around. + if (dy && mac && webkit) { + outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) { + for (var i = 0; i < view.length; i++) { + if (view[i].node == cur) { + cm.display.currentWheelTarget = cur; + break outer; + } + } + } + } + + // On some browsers, horizontal scrolling will cause redraws to + // happen before the gutter has been realigned, causing it to + // wriggle around in a most unseemly way. When we have an + // estimated pixels/delta value, we just handle horizontal + // scrolling entirely here. It'll be slightly off from native, but + // better than glitching out. + if (dx && !gecko && !presto && wheelPixelsPerUnit != null) { + if (dy && canScrollY) + setScrollTop(cm, Math.max(0, Math.min(scroll.scrollTop + dy * wheelPixelsPerUnit, scroll.scrollHeight - scroll.clientHeight))); + setScrollLeft(cm, Math.max(0, Math.min(scroll.scrollLeft + dx * wheelPixelsPerUnit, scroll.scrollWidth - scroll.clientWidth))); + // Only prevent default scrolling if vertical scrolling is + // actually possible. Otherwise, it causes vertical scroll + // jitter on OSX trackpads when deltaX is small and deltaY + // is large (issue #3579) + if (!dy || (dy && canScrollY)) + e_preventDefault(e); + display.wheelStartX = null; // Abort measurement, if in progress + return; + } + + // 'Project' the visible viewport to cover the area that is being + // scrolled into view (if we know enough to estimate it). + if (dy && wheelPixelsPerUnit != null) { + var pixels = dy * wheelPixelsPerUnit; + var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight; + if (pixels < 0) top = Math.max(0, top + pixels - 50); + else bot = Math.min(cm.doc.height, bot + pixels + 50); + updateDisplaySimple(cm, {top: top, bottom: bot}); + } + + if (wheelSamples < 20) { + if (display.wheelStartX == null) { + display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop; + display.wheelDX = dx; display.wheelDY = dy; + setTimeout(function() { + if (display.wheelStartX == null) return; + var movedX = scroll.scrollLeft - display.wheelStartX; + var movedY = scroll.scrollTop - display.wheelStartY; + var sample = (movedY && display.wheelDY && movedY / display.wheelDY) || + (movedX && display.wheelDX && movedX / display.wheelDX); + display.wheelStartX = display.wheelStartY = null; + if (!sample) return; + wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1); + ++wheelSamples; + }, 200); + } else { + display.wheelDX += dx; display.wheelDY += dy; + } + } + } + + // KEY EVENTS + + // Run a handler that was bound to a key. + function doHandleBinding(cm, bound, dropShift) { + if (typeof bound == "string") { + bound = commands[bound]; + if (!bound) return false; + } + // Ensure previous input has been read, so that the handler sees a + // consistent view of the document + cm.display.input.ensurePolled(); + var prevShift = cm.display.shift, done = false; + try { + if (cm.isReadOnly()) cm.state.suppressEdits = true; + if (dropShift) cm.display.shift = false; + done = bound(cm) != Pass; + } finally { + cm.display.shift = prevShift; + cm.state.suppressEdits = false; + } + return done; + } + + function lookupKeyForEditor(cm, name, handle) { + for (var i = 0; i < cm.state.keyMaps.length; i++) { + var result = lookupKey(name, cm.state.keyMaps[i], handle, cm); + if (result) return result; + } + return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm)) + || lookupKey(name, cm.options.keyMap, handle, cm); + } + + var stopSeq = new Delayed; + function dispatchKey(cm, name, e, handle) { + var seq = cm.state.keySeq; + if (seq) { + if (isModifierKey(name)) return "handled"; + stopSeq.set(50, function() { + if (cm.state.keySeq == seq) { + cm.state.keySeq = null; + cm.display.input.reset(); + } + }); + name = seq + " " + name; + } + var result = lookupKeyForEditor(cm, name, handle); + + if (result == "multi") + cm.state.keySeq = name; + if (result == "handled") + signalLater(cm, "keyHandled", cm, name, e); + + if (result == "handled" || result == "multi") { + e_preventDefault(e); + restartBlink(cm); + } + + if (seq && !result && /\'$/.test(name)) { + e_preventDefault(e); + return true; + } + return !!result; + } + + // Handle a key from the keydown event. + function handleKeyBinding(cm, e) { + var name = keyName(e, true); + if (!name) return false; + + if (e.shiftKey && !cm.state.keySeq) { + // First try to resolve full name (including 'Shift-'). Failing + // that, see if there is a cursor-motion command (starting with + // 'go') bound to the keyname without 'Shift-'. + return dispatchKey(cm, "Shift-" + name, e, function(b) {return doHandleBinding(cm, b, true);}) + || dispatchKey(cm, name, e, function(b) { + if (typeof b == "string" ? /^go[A-Z]/.test(b) : b.motion) + return doHandleBinding(cm, b); + }); + } else { + return dispatchKey(cm, name, e, function(b) { return doHandleBinding(cm, b); }); + } + } + + // Handle a key from the keypress event + function handleCharBinding(cm, e, ch) { + return dispatchKey(cm, "'" + ch + "'", e, + function(b) { return doHandleBinding(cm, b, true); }); + } + + var lastStoppedKey = null; + function onKeyDown(e) { + var cm = this; + cm.curOp.focus = activeElt(); + if (signalDOMEvent(cm, e)) return; + // IE does strange things with escape. + if (ie && ie_version < 11 && e.keyCode == 27) e.returnValue = false; + var code = e.keyCode; + cm.display.shift = code == 16 || e.shiftKey; + var handled = handleKeyBinding(cm, e); + if (presto) { + lastStoppedKey = handled ? code : null; + // Opera has no cut event... we try to at least catch the key combo + if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey)) + cm.replaceSelection("", null, "cut"); + } + + // Turn mouse into crosshair when Alt is held on Mac. + if (code == 18 && !/\bCodeMirror-crosshair\b/.test(cm.display.lineDiv.className)) + showCrossHair(cm); + } + + function showCrossHair(cm) { + var lineDiv = cm.display.lineDiv; + addClass(lineDiv, "CodeMirror-crosshair"); + + function up(e) { + if (e.keyCode == 18 || !e.altKey) { + rmClass(lineDiv, "CodeMirror-crosshair"); + off(document, "keyup", up); + off(document, "mouseover", up); + } + } + on(document, "keyup", up); + on(document, "mouseover", up); + } + + function onKeyUp(e) { + if (e.keyCode == 16) this.doc.sel.shift = false; + signalDOMEvent(this, e); + } + + function onKeyPress(e) { + var cm = this; + if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) return; + var keyCode = e.keyCode, charCode = e.charCode; + if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return;} + if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) return; + var ch = String.fromCharCode(charCode == null ? keyCode : charCode); + if (handleCharBinding(cm, e, ch)) return; + cm.display.input.onKeyPress(e); + } + + // FOCUS/BLUR EVENTS + + function delayBlurEvent(cm) { + cm.state.delayingBlurEvent = true; + setTimeout(function() { + if (cm.state.delayingBlurEvent) { + cm.state.delayingBlurEvent = false; + onBlur(cm); + } + }, 100); + } + + function onFocus(cm) { + if (cm.state.delayingBlurEvent) cm.state.delayingBlurEvent = false; + + if (cm.options.readOnly == "nocursor") return; + if (!cm.state.focused) { + signal(cm, "focus", cm); + cm.state.focused = true; + addClass(cm.display.wrapper, "CodeMirror-focused"); + // This test prevents this from firing when a context + // menu is closed (since the input reset would kill the + // select-all detection hack) + if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) { + cm.display.input.reset(); + if (webkit) setTimeout(function() { cm.display.input.reset(true); }, 20); // Issue #1730 + } + cm.display.input.receivedFocus(); + } + restartBlink(cm); + } + function onBlur(cm) { + if (cm.state.delayingBlurEvent) return; + + if (cm.state.focused) { + signal(cm, "blur", cm); + cm.state.focused = false; + rmClass(cm.display.wrapper, "CodeMirror-focused"); + } + clearInterval(cm.display.blinker); + setTimeout(function() {if (!cm.state.focused) cm.display.shift = false;}, 150); + } + + // CONTEXT MENU HANDLING + + // To make the context menu work, we need to briefly unhide the + // textarea (making it as unobtrusive as possible) to let the + // right-click take effect on it. + function onContextMenu(cm, e) { + if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) return; + if (signalDOMEvent(cm, e, "contextmenu")) return; + cm.display.input.onContextMenu(e); + } + + function contextMenuInGutter(cm, e) { + if (!hasHandler(cm, "gutterContextMenu")) return false; + return gutterEvent(cm, e, "gutterContextMenu", false); + } + + // UPDATING + + // Compute the position of the end of a change (its 'to' property + // refers to the pre-change end). + var changeEnd = CodeMirror.changeEnd = function(change) { + if (!change.text) return change.to; + return Pos(change.from.line + change.text.length - 1, + lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0)); + }; + + // Adjust a position to refer to the post-change position of the + // same text, or the end of the change if the change covers it. + function adjustForChange(pos, change) { + if (cmp(pos, change.from) < 0) return pos; + if (cmp(pos, change.to) <= 0) return changeEnd(change); + + var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch; + if (pos.line == change.to.line) ch += changeEnd(change).ch - change.to.ch; + return Pos(line, ch); + } + + function computeSelAfterChange(doc, change) { + var out = []; + for (var i = 0; i < doc.sel.ranges.length; i++) { + var range = doc.sel.ranges[i]; + out.push(new Range(adjustForChange(range.anchor, change), + adjustForChange(range.head, change))); + } + return normalizeSelection(out, doc.sel.primIndex); + } + + function offsetPos(pos, old, nw) { + if (pos.line == old.line) + return Pos(nw.line, pos.ch - old.ch + nw.ch); + else + return Pos(nw.line + (pos.line - old.line), pos.ch); + } + + // Used by replaceSelections to allow moving the selection to the + // start or around the replaced test. Hint may be "start" or "around". + function computeReplacedSel(doc, changes, hint) { + var out = []; + var oldPrev = Pos(doc.first, 0), newPrev = oldPrev; + for (var i = 0; i < changes.length; i++) { + var change = changes[i]; + var from = offsetPos(change.from, oldPrev, newPrev); + var to = offsetPos(changeEnd(change), oldPrev, newPrev); + oldPrev = change.to; + newPrev = to; + if (hint == "around") { + var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0; + out[i] = new Range(inv ? to : from, inv ? from : to); + } else { + out[i] = new Range(from, from); + } + } + return new Selection(out, doc.sel.primIndex); + } + + // Allow "beforeChange" event handlers to influence a change + function filterChange(doc, change, update) { + var obj = { + canceled: false, + from: change.from, + to: change.to, + text: change.text, + origin: change.origin, + cancel: function() { this.canceled = true; } + }; + if (update) obj.update = function(from, to, text, origin) { + if (from) this.from = clipPos(doc, from); + if (to) this.to = clipPos(doc, to); + if (text) this.text = text; + if (origin !== undefined) this.origin = origin; + }; + signal(doc, "beforeChange", doc, obj); + if (doc.cm) signal(doc.cm, "beforeChange", doc.cm, obj); + + if (obj.canceled) return null; + return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin}; + } + + // Apply a change to a document, and add it to the document's + // history, and propagating it to all linked documents. + function makeChange(doc, change, ignoreReadOnly) { + if (doc.cm) { + if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly); + if (doc.cm.state.suppressEdits) return; + } + + if (hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange")) { + change = filterChange(doc, change, true); + if (!change) return; + } + + // Possibly split or suppress the update based on the presence + // of read-only spans in its range. + var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to); + if (split) { + for (var i = split.length - 1; i >= 0; --i) + makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [""] : change.text}); + } else { + makeChangeInner(doc, change); + } + } + + function makeChangeInner(doc, change) { + if (change.text.length == 1 && change.text[0] == "" && cmp(change.from, change.to) == 0) return; + var selAfter = computeSelAfterChange(doc, change); + addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN); + + makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change)); + var rebased = []; + + linkedDocs(doc, function(doc, sharedHist) { + if (!sharedHist && indexOf(rebased, doc.history) == -1) { + rebaseHist(doc.history, change); + rebased.push(doc.history); + } + makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change)); + }); + } + + // Revert a change stored in a document's history. + function makeChangeFromHistory(doc, type, allowSelectionOnly) { + if (doc.cm && doc.cm.state.suppressEdits) return; + + var hist = doc.history, event, selAfter = doc.sel; + var source = type == "undo" ? hist.done : hist.undone, dest = type == "undo" ? hist.undone : hist.done; + + // Verify that there is a useable event (so that ctrl-z won't + // needlessly clear selection events) + for (var i = 0; i < source.length; i++) { + event = source[i]; + if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges) + break; + } + if (i == source.length) return; + hist.lastOrigin = hist.lastSelOrigin = null; + + for (;;) { + event = source.pop(); + if (event.ranges) { + pushSelectionToHistory(event, dest); + if (allowSelectionOnly && !event.equals(doc.sel)) { + setSelection(doc, event, {clearRedo: false}); + return; + } + selAfter = event; + } + else break; + } + + // Build up a reverse change object to add to the opposite history + // stack (redo when undoing, and vice versa). + var antiChanges = []; + pushSelectionToHistory(selAfter, dest); + dest.push({changes: antiChanges, generation: hist.generation}); + hist.generation = event.generation || ++hist.maxGeneration; + + var filter = hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange"); + + for (var i = event.changes.length - 1; i >= 0; --i) { + var change = event.changes[i]; + change.origin = type; + if (filter && !filterChange(doc, change, false)) { + source.length = 0; + return; + } + + antiChanges.push(historyChangeFromChange(doc, change)); + + var after = i ? computeSelAfterChange(doc, change) : lst(source); + makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change)); + if (!i && doc.cm) doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); + var rebased = []; + + // Propagate to the linked documents + linkedDocs(doc, function(doc, sharedHist) { + if (!sharedHist && indexOf(rebased, doc.history) == -1) { + rebaseHist(doc.history, change); + rebased.push(doc.history); + } + makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change)); + }); + } + } + + // Sub-views need their line numbers shifted when text is added + // above or below them in the parent document. + function shiftDoc(doc, distance) { + if (distance == 0) return; + doc.first += distance; + doc.sel = new Selection(map(doc.sel.ranges, function(range) { + return new Range(Pos(range.anchor.line + distance, range.anchor.ch), + Pos(range.head.line + distance, range.head.ch)); + }), doc.sel.primIndex); + if (doc.cm) { + regChange(doc.cm, doc.first, doc.first - distance, distance); + for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++) + regLineChange(doc.cm, l, "gutter"); + } + } + + // More lower-level change function, handling only a single document + // (not linked ones). + function makeChangeSingleDoc(doc, change, selAfter, spans) { + if (doc.cm && !doc.cm.curOp) + return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans); + + if (change.to.line < doc.first) { + shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line)); + return; + } + if (change.from.line > doc.lastLine()) return; + + // Clip the change to the size of this doc + if (change.from.line < doc.first) { + var shift = change.text.length - 1 - (doc.first - change.from.line); + shiftDoc(doc, shift); + change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch), + text: [lst(change.text)], origin: change.origin}; + } + var last = doc.lastLine(); + if (change.to.line > last) { + change = {from: change.from, to: Pos(last, getLine(doc, last).text.length), + text: [change.text[0]], origin: change.origin}; + } + + change.removed = getBetween(doc, change.from, change.to); + + if (!selAfter) selAfter = computeSelAfterChange(doc, change); + if (doc.cm) makeChangeSingleDocInEditor(doc.cm, change, spans); + else updateDoc(doc, change, spans); + setSelectionNoUndo(doc, selAfter, sel_dontScroll); + } + + // Handle the interaction of a change to a document with the editor + // that this document is part of. + function makeChangeSingleDocInEditor(cm, change, spans) { + var doc = cm.doc, display = cm.display, from = change.from, to = change.to; + + var recomputeMaxLength = false, checkWidthStart = from.line; + if (!cm.options.lineWrapping) { + checkWidthStart = lineNo(visualLine(getLine(doc, from.line))); + doc.iter(checkWidthStart, to.line + 1, function(line) { + if (line == display.maxLine) { + recomputeMaxLength = true; + return true; + } + }); + } + + if (doc.sel.contains(change.from, change.to) > -1) + signalCursorActivity(cm); + + updateDoc(doc, change, spans, estimateHeight(cm)); + + if (!cm.options.lineWrapping) { + doc.iter(checkWidthStart, from.line + change.text.length, function(line) { + var len = lineLength(line); + if (len > display.maxLineLength) { + display.maxLine = line; + display.maxLineLength = len; + display.maxLineChanged = true; + recomputeMaxLength = false; + } + }); + if (recomputeMaxLength) cm.curOp.updateMaxLine = true; + } + + // Adjust frontier, schedule worker + doc.frontier = Math.min(doc.frontier, from.line); + startWorker(cm, 400); + + var lendiff = change.text.length - (to.line - from.line) - 1; + // Remember that these lines changed, for updating the display + if (change.full) + regChange(cm); + else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change)) + regLineChange(cm, from.line, "text"); + else + regChange(cm, from.line, to.line + 1, lendiff); + + var changesHandler = hasHandler(cm, "changes"), changeHandler = hasHandler(cm, "change"); + if (changeHandler || changesHandler) { + var obj = { + from: from, to: to, + text: change.text, + removed: change.removed, + origin: change.origin + }; + if (changeHandler) signalLater(cm, "change", cm, obj); + if (changesHandler) (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); + } + cm.display.selForContextMenu = null; + } + + function replaceRange(doc, code, from, to, origin) { + if (!to) to = from; + if (cmp(to, from) < 0) { var tmp = to; to = from; from = tmp; } + if (typeof code == "string") code = doc.splitLines(code); + makeChange(doc, {from: from, to: to, text: code, origin: origin}); + } + + // SCROLLING THINGS INTO VIEW + + // If an editor sits on the top or bottom of the window, partially + // scrolled out of view, this ensures that the cursor is visible. + function maybeScrollWindow(cm, coords) { + if (signalDOMEvent(cm, "scrollCursorIntoView")) return; + + var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null; + if (coords.top + box.top < 0) doScroll = true; + else if (coords.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) doScroll = false; + if (doScroll != null && !phantom) { + var scrollNode = elt("div", "\u200b", null, "position: absolute; top: " + + (coords.top - display.viewOffset - paddingTop(cm.display)) + "px; height: " + + (coords.bottom - coords.top + scrollGap(cm) + display.barHeight) + "px; left: " + + coords.left + "px; width: 2px;"); + cm.display.lineSpace.appendChild(scrollNode); + scrollNode.scrollIntoView(doScroll); + cm.display.lineSpace.removeChild(scrollNode); + } + } + + // Scroll a given position into view (immediately), verifying that + // it actually became visible (as line heights are accurately + // measured, the position of something may 'drift' during drawing). + function scrollPosIntoView(cm, pos, end, margin) { + if (margin == null) margin = 0; + for (var limit = 0; limit < 5; limit++) { + var changed = false, coords = cursorCoords(cm, pos); + var endCoords = !end || end == pos ? coords : cursorCoords(cm, end); + var scrollPos = calculateScrollPos(cm, Math.min(coords.left, endCoords.left), + Math.min(coords.top, endCoords.top) - margin, + Math.max(coords.left, endCoords.left), + Math.max(coords.bottom, endCoords.bottom) + margin); + var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft; + if (scrollPos.scrollTop != null) { + setScrollTop(cm, scrollPos.scrollTop); + if (Math.abs(cm.doc.scrollTop - startTop) > 1) changed = true; + } + if (scrollPos.scrollLeft != null) { + setScrollLeft(cm, scrollPos.scrollLeft); + if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) changed = true; + } + if (!changed) break; + } + return coords; + } + + // Scroll a given set of coordinates into view (immediately). + function scrollIntoView(cm, x1, y1, x2, y2) { + var scrollPos = calculateScrollPos(cm, x1, y1, x2, y2); + if (scrollPos.scrollTop != null) setScrollTop(cm, scrollPos.scrollTop); + if (scrollPos.scrollLeft != null) setScrollLeft(cm, scrollPos.scrollLeft); + } + + // Calculate a new scroll position needed to scroll the given + // rectangle into view. Returns an object with scrollTop and + // scrollLeft properties. When these are undefined, the + // vertical/horizontal position does not need to be adjusted. + function calculateScrollPos(cm, x1, y1, x2, y2) { + var display = cm.display, snapMargin = textHeight(cm.display); + if (y1 < 0) y1 = 0; + var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop; + var screen = displayHeight(cm), result = {}; + if (y2 - y1 > screen) y2 = y1 + screen; + var docBottom = cm.doc.height + paddingVert(display); + var atTop = y1 < snapMargin, atBottom = y2 > docBottom - snapMargin; + if (y1 < screentop) { + result.scrollTop = atTop ? 0 : y1; + } else if (y2 > screentop + screen) { + var newTop = Math.min(y1, (atBottom ? docBottom : y2) - screen); + if (newTop != screentop) result.scrollTop = newTop; + } + + var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft; + var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0); + var tooWide = x2 - x1 > screenw; + if (tooWide) x2 = x1 + screenw; + if (x1 < 10) + result.scrollLeft = 0; + else if (x1 < screenleft) + result.scrollLeft = Math.max(0, x1 - (tooWide ? 0 : 10)); + else if (x2 > screenw + screenleft - 3) + result.scrollLeft = x2 + (tooWide ? 0 : 10) - screenw; + return result; + } + + // Store a relative adjustment to the scroll position in the current + // operation (to be applied when the operation finishes). + function addToScrollPos(cm, left, top) { + if (left != null || top != null) resolveScrollToPos(cm); + if (left != null) + cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left; + if (top != null) + cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top; + } + + // Make sure that at the end of the operation the current cursor is + // shown. + function ensureCursorVisible(cm) { + resolveScrollToPos(cm); + var cur = cm.getCursor(), from = cur, to = cur; + if (!cm.options.lineWrapping) { + from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur; + to = Pos(cur.line, cur.ch + 1); + } + cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true}; + } + + // When an operation has its scrollToPos property set, and another + // scroll action is applied before the end of the operation, this + // 'simulates' scrolling that position into view in a cheap way, so + // that the effect of intermediate scroll commands is not ignored. + function resolveScrollToPos(cm) { + var range = cm.curOp.scrollToPos; + if (range) { + cm.curOp.scrollToPos = null; + var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to); + var sPos = calculateScrollPos(cm, Math.min(from.left, to.left), + Math.min(from.top, to.top) - range.margin, + Math.max(from.right, to.right), + Math.max(from.bottom, to.bottom) + range.margin); + cm.scrollTo(sPos.scrollLeft, sPos.scrollTop); + } + } + + // API UTILITIES + + // Indent the given line. The how parameter can be "smart", + // "add"/null, "subtract", or "prev". When aggressive is false + // (typically set to true for forced single-line indents), empty + // lines are not indented, and places where the mode returns Pass + // are left alone. + function indentLine(cm, n, how, aggressive) { + var doc = cm.doc, state; + if (how == null) how = "add"; + if (how == "smart") { + // Fall back to "prev" when the mode doesn't have an indentation + // method. + if (!doc.mode.indent) how = "prev"; + else state = getStateBefore(cm, n); + } + + var tabSize = cm.options.tabSize; + var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize); + if (line.stateAfter) line.stateAfter = null; + var curSpaceString = line.text.match(/^\s*/)[0], indentation; + if (!aggressive && !/\S/.test(line.text)) { + indentation = 0; + how = "not"; + } else if (how == "smart") { + indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text); + if (indentation == Pass || indentation > 150) { + if (!aggressive) return; + how = "prev"; + } + } + if (how == "prev") { + if (n > doc.first) indentation = countColumn(getLine(doc, n-1).text, null, tabSize); + else indentation = 0; + } else if (how == "add") { + indentation = curSpace + cm.options.indentUnit; + } else if (how == "subtract") { + indentation = curSpace - cm.options.indentUnit; + } else if (typeof how == "number") { + indentation = curSpace + how; + } + indentation = Math.max(0, indentation); + + var indentString = "", pos = 0; + if (cm.options.indentWithTabs) + for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += "\t";} + if (pos < indentation) indentString += spaceStr(indentation - pos); + + if (indentString != curSpaceString) { + replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), "+input"); + line.stateAfter = null; + return true; + } else { + // Ensure that, if the cursor was in the whitespace at the start + // of the line, it is moved to the end of that space. + for (var i = 0; i < doc.sel.ranges.length; i++) { + var range = doc.sel.ranges[i]; + if (range.head.line == n && range.head.ch < curSpaceString.length) { + var pos = Pos(n, curSpaceString.length); + replaceOneSelection(doc, i, new Range(pos, pos)); + break; + } + } + } + } + + // Utility for applying a change to a line by handle or number, + // returning the number and optionally registering the line as + // changed. + function changeLine(doc, handle, changeType, op) { + var no = handle, line = handle; + if (typeof handle == "number") line = getLine(doc, clipLine(doc, handle)); + else no = lineNo(handle); + if (no == null) return null; + if (op(line, no) && doc.cm) regLineChange(doc.cm, no, changeType); + return line; + } + + // Helper for deleting text near the selection(s), used to implement + // backspace, delete, and similar functionality. + function deleteNearSelection(cm, compute) { + var ranges = cm.doc.sel.ranges, kill = []; + // Build up a set of ranges to kill first, merging overlapping + // ranges. + for (var i = 0; i < ranges.length; i++) { + var toKill = compute(ranges[i]); + while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) { + var replaced = kill.pop(); + if (cmp(replaced.from, toKill.from) < 0) { + toKill.from = replaced.from; + break; + } + } + kill.push(toKill); + } + // Next, remove those actual ranges. + runInOp(cm, function() { + for (var i = kill.length - 1; i >= 0; i--) + replaceRange(cm.doc, "", kill[i].from, kill[i].to, "+delete"); + ensureCursorVisible(cm); + }); + } + + // Used for horizontal relative motion. Dir is -1 or 1 (left or + // right), unit can be "char", "column" (like char, but doesn't + // cross line boundaries), "word" (across next word), or "group" (to + // the start of next group of word or non-word-non-whitespace + // chars). The visually param controls whether, in right-to-left + // text, direction 1 means to move towards the next index in the + // string, or towards the character to the right of the current + // position. The resulting position will have a hitSide=true + // property if it reached the end of the document. + function findPosH(doc, pos, dir, unit, visually) { + var line = pos.line, ch = pos.ch, origDir = dir; + var lineObj = getLine(doc, line); + function findNextLine() { + var l = line + dir; + if (l < doc.first || l >= doc.first + doc.size) return false + line = l; + return lineObj = getLine(doc, l); + } + function moveOnce(boundToLine) { + var next = (visually ? moveVisually : moveLogically)(lineObj, ch, dir, true); + if (next == null) { + if (!boundToLine && findNextLine()) { + if (visually) ch = (dir < 0 ? lineRight : lineLeft)(lineObj); + else ch = dir < 0 ? lineObj.text.length : 0; + } else return false + } else ch = next; + return true; + } + + if (unit == "char") { + moveOnce() + } else if (unit == "column") { + moveOnce(true) + } else if (unit == "word" || unit == "group") { + var sawType = null, group = unit == "group"; + var helper = doc.cm && doc.cm.getHelper(pos, "wordChars"); + for (var first = true;; first = false) { + if (dir < 0 && !moveOnce(!first)) break; + var cur = lineObj.text.charAt(ch) || "\n"; + var type = isWordChar(cur, helper) ? "w" + : group && cur == "\n" ? "n" + : !group || /\s/.test(cur) ? null + : "p"; + if (group && !first && !type) type = "s"; + if (sawType && sawType != type) { + if (dir < 0) {dir = 1; moveOnce();} + break; + } + + if (type) sawType = type; + if (dir > 0 && !moveOnce(!first)) break; + } + } + var result = skipAtomic(doc, Pos(line, ch), pos, origDir, true); + if (!cmp(pos, result)) result.hitSide = true; + return result; + } + + // For relative vertical movement. Dir may be -1 or 1. Unit can be + // "page" or "line". The resulting position will have a hitSide=true + // property if it reached the end of the document. + function findPosV(cm, pos, dir, unit) { + var doc = cm.doc, x = pos.left, y; + if (unit == "page") { + var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight); + y = pos.top + dir * (pageSize - (dir < 0 ? 1.5 : .5) * textHeight(cm.display)); + } else if (unit == "line") { + y = dir > 0 ? pos.bottom + 3 : pos.top - 3; + } + for (;;) { + var target = coordsChar(cm, x, y); + if (!target.outside) break; + if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break; } + y += dir * 5; + } + return target; + } + + // EDITOR METHODS + + // The publicly visible API. Note that methodOp(f) means + // 'wrap f in an operation, performed on its `this` parameter'. + + // This is not the complete set of editor methods. Most of the + // methods defined on the Doc type are also injected into + // CodeMirror.prototype, for backwards compatibility and + // convenience. + + CodeMirror.prototype = { + constructor: CodeMirror, + focus: function(){window.focus(); this.display.input.focus();}, + + setOption: function(option, value) { + var options = this.options, old = options[option]; + if (options[option] == value && option != "mode") return; + options[option] = value; + if (optionHandlers.hasOwnProperty(option)) + operation(this, optionHandlers[option])(this, value, old); + }, + + getOption: function(option) {return this.options[option];}, + getDoc: function() {return this.doc;}, + + addKeyMap: function(map, bottom) { + this.state.keyMaps[bottom ? "push" : "unshift"](getKeyMap(map)); + }, + removeKeyMap: function(map) { + var maps = this.state.keyMaps; + for (var i = 0; i < maps.length; ++i) + if (maps[i] == map || maps[i].name == map) { + maps.splice(i, 1); + return true; + } + }, + + addOverlay: methodOp(function(spec, options) { + var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec); + if (mode.startState) throw new Error("Overlays may not be stateful."); + this.state.overlays.push({mode: mode, modeSpec: spec, opaque: options && options.opaque}); + this.state.modeGen++; + regChange(this); + }), + removeOverlay: methodOp(function(spec) { + var overlays = this.state.overlays; + for (var i = 0; i < overlays.length; ++i) { + var cur = overlays[i].modeSpec; + if (cur == spec || typeof spec == "string" && cur.name == spec) { + overlays.splice(i, 1); + this.state.modeGen++; + regChange(this); + return; + } + } + }), + + indentLine: methodOp(function(n, dir, aggressive) { + if (typeof dir != "string" && typeof dir != "number") { + if (dir == null) dir = this.options.smartIndent ? "smart" : "prev"; + else dir = dir ? "add" : "subtract"; + } + if (isLine(this.doc, n)) indentLine(this, n, dir, aggressive); + }), + indentSelection: methodOp(function(how) { + var ranges = this.doc.sel.ranges, end = -1; + for (var i = 0; i < ranges.length; i++) { + var range = ranges[i]; + if (!range.empty()) { + var from = range.from(), to = range.to(); + var start = Math.max(end, from.line); + end = Math.min(this.lastLine(), to.line - (to.ch ? 0 : 1)) + 1; + for (var j = start; j < end; ++j) + indentLine(this, j, how); + var newRanges = this.doc.sel.ranges; + if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0) + replaceOneSelection(this.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); + } else if (range.head.line > end) { + indentLine(this, range.head.line, how, true); + end = range.head.line; + if (i == this.doc.sel.primIndex) ensureCursorVisible(this); + } + } + }), + + // Fetch the parser token for a given character. Useful for hacks + // that want to inspect the mode state (say, for completion). + getTokenAt: function(pos, precise) { + return takeToken(this, pos, precise); + }, + + getLineTokens: function(line, precise) { + return takeToken(this, Pos(line), precise, true); + }, + + getTokenTypeAt: function(pos) { + pos = clipPos(this.doc, pos); + var styles = getLineStyles(this, getLine(this.doc, pos.line)); + var before = 0, after = (styles.length - 1) / 2, ch = pos.ch; + var type; + if (ch == 0) type = styles[2]; + else for (;;) { + var mid = (before + after) >> 1; + if ((mid ? styles[mid * 2 - 1] : 0) >= ch) after = mid; + else if (styles[mid * 2 + 1] < ch) before = mid + 1; + else { type = styles[mid * 2 + 2]; break; } + } + var cut = type ? type.indexOf("cm-overlay ") : -1; + return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1); + }, + + getModeAt: function(pos) { + var mode = this.doc.mode; + if (!mode.innerMode) return mode; + return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode; + }, + + getHelper: function(pos, type) { + return this.getHelpers(pos, type)[0]; + }, + + getHelpers: function(pos, type) { + var found = []; + if (!helpers.hasOwnProperty(type)) return found; + var help = helpers[type], mode = this.getModeAt(pos); + if (typeof mode[type] == "string") { + if (help[mode[type]]) found.push(help[mode[type]]); + } else if (mode[type]) { + for (var i = 0; i < mode[type].length; i++) { + var val = help[mode[type][i]]; + if (val) found.push(val); + } + } else if (mode.helperType && help[mode.helperType]) { + found.push(help[mode.helperType]); + } else if (help[mode.name]) { + found.push(help[mode.name]); + } + for (var i = 0; i < help._global.length; i++) { + var cur = help._global[i]; + if (cur.pred(mode, this) && indexOf(found, cur.val) == -1) + found.push(cur.val); + } + return found; + }, + + getStateAfter: function(line, precise) { + var doc = this.doc; + line = clipLine(doc, line == null ? doc.first + doc.size - 1: line); + return getStateBefore(this, line + 1, precise); + }, + + cursorCoords: function(start, mode) { + var pos, range = this.doc.sel.primary(); + if (start == null) pos = range.head; + else if (typeof start == "object") pos = clipPos(this.doc, start); + else pos = start ? range.from() : range.to(); + return cursorCoords(this, pos, mode || "page"); + }, + + charCoords: function(pos, mode) { + return charCoords(this, clipPos(this.doc, pos), mode || "page"); + }, + + coordsChar: function(coords, mode) { + coords = fromCoordSystem(this, coords, mode || "page"); + return coordsChar(this, coords.left, coords.top); + }, + + lineAtHeight: function(height, mode) { + height = fromCoordSystem(this, {top: height, left: 0}, mode || "page").top; + return lineAtHeight(this.doc, height + this.display.viewOffset); + }, + heightAtLine: function(line, mode) { + var end = false, lineObj; + if (typeof line == "number") { + var last = this.doc.first + this.doc.size - 1; + if (line < this.doc.first) line = this.doc.first; + else if (line > last) { line = last; end = true; } + lineObj = getLine(this.doc, line); + } else { + lineObj = line; + } + return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || "page").top + + (end ? this.doc.height - heightAtLine(lineObj) : 0); + }, + + defaultTextHeight: function() { return textHeight(this.display); }, + defaultCharWidth: function() { return charWidth(this.display); }, + + setGutterMarker: methodOp(function(line, gutterID, value) { + return changeLine(this.doc, line, "gutter", function(line) { + var markers = line.gutterMarkers || (line.gutterMarkers = {}); + markers[gutterID] = value; + if (!value && isEmpty(markers)) line.gutterMarkers = null; + return true; + }); + }), + + clearGutter: methodOp(function(gutterID) { + var cm = this, doc = cm.doc, i = doc.first; + doc.iter(function(line) { + if (line.gutterMarkers && line.gutterMarkers[gutterID]) { + line.gutterMarkers[gutterID] = null; + regLineChange(cm, i, "gutter"); + if (isEmpty(line.gutterMarkers)) line.gutterMarkers = null; + } + ++i; + }); + }), + + lineInfo: function(line) { + if (typeof line == "number") { + if (!isLine(this.doc, line)) return null; + var n = line; + line = getLine(this.doc, line); + if (!line) return null; + } else { + var n = lineNo(line); + if (n == null) return null; + } + return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers, + textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass, + widgets: line.widgets}; + }, + + getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo};}, + + addWidget: function(pos, node, scroll, vert, horiz) { + var display = this.display; + pos = cursorCoords(this, clipPos(this.doc, pos)); + var top = pos.bottom, left = pos.left; + node.style.position = "absolute"; + node.setAttribute("cm-ignore-events", "true"); + this.display.input.setUneditable(node); + display.sizer.appendChild(node); + if (vert == "over") { + top = pos.top; + } else if (vert == "above" || vert == "near") { + var vspace = Math.max(display.wrapper.clientHeight, this.doc.height), + hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth); + // Default to positioning above (if specified and possible); otherwise default to positioning below + if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight) + top = pos.top - node.offsetHeight; + else if (pos.bottom + node.offsetHeight <= vspace) + top = pos.bottom; + if (left + node.offsetWidth > hspace) + left = hspace - node.offsetWidth; + } + node.style.top = top + "px"; + node.style.left = node.style.right = ""; + if (horiz == "right") { + left = display.sizer.clientWidth - node.offsetWidth; + node.style.right = "0px"; + } else { + if (horiz == "left") left = 0; + else if (horiz == "middle") left = (display.sizer.clientWidth - node.offsetWidth) / 2; + node.style.left = left + "px"; + } + if (scroll) + scrollIntoView(this, left, top, left + node.offsetWidth, top + node.offsetHeight); + }, + + triggerOnKeyDown: methodOp(onKeyDown), + triggerOnKeyPress: methodOp(onKeyPress), + triggerOnKeyUp: onKeyUp, + + execCommand: function(cmd) { + if (commands.hasOwnProperty(cmd)) + return commands[cmd].call(null, this); + }, + + triggerElectric: methodOp(function(text) { triggerElectric(this, text); }), + + findPosH: function(from, amount, unit, visually) { + var dir = 1; + if (amount < 0) { dir = -1; amount = -amount; } + for (var i = 0, cur = clipPos(this.doc, from); i < amount; ++i) { + cur = findPosH(this.doc, cur, dir, unit, visually); + if (cur.hitSide) break; + } + return cur; + }, + + moveH: methodOp(function(dir, unit) { + var cm = this; + cm.extendSelectionsBy(function(range) { + if (cm.display.shift || cm.doc.extend || range.empty()) + return findPosH(cm.doc, range.head, dir, unit, cm.options.rtlMoveVisually); + else + return dir < 0 ? range.from() : range.to(); + }, sel_move); + }), + + deleteH: methodOp(function(dir, unit) { + var sel = this.doc.sel, doc = this.doc; + if (sel.somethingSelected()) + doc.replaceSelection("", null, "+delete"); + else + deleteNearSelection(this, function(range) { + var other = findPosH(doc, range.head, dir, unit, false); + return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other}; + }); + }), + + findPosV: function(from, amount, unit, goalColumn) { + var dir = 1, x = goalColumn; + if (amount < 0) { dir = -1; amount = -amount; } + for (var i = 0, cur = clipPos(this.doc, from); i < amount; ++i) { + var coords = cursorCoords(this, cur, "div"); + if (x == null) x = coords.left; + else coords.left = x; + cur = findPosV(this, coords, dir, unit); + if (cur.hitSide) break; + } + return cur; + }, + + moveV: methodOp(function(dir, unit) { + var cm = this, doc = this.doc, goals = []; + var collapse = !cm.display.shift && !doc.extend && doc.sel.somethingSelected(); + doc.extendSelectionsBy(function(range) { + if (collapse) + return dir < 0 ? range.from() : range.to(); + var headPos = cursorCoords(cm, range.head, "div"); + if (range.goalColumn != null) headPos.left = range.goalColumn; + goals.push(headPos.left); + var pos = findPosV(cm, headPos, dir, unit); + if (unit == "page" && range == doc.sel.primary()) + addToScrollPos(cm, null, charCoords(cm, pos, "div").top - headPos.top); + return pos; + }, sel_move); + if (goals.length) for (var i = 0; i < doc.sel.ranges.length; i++) + doc.sel.ranges[i].goalColumn = goals[i]; + }), + + // Find the word at the given position (as returned by coordsChar). + findWordAt: function(pos) { + var doc = this.doc, line = getLine(doc, pos.line).text; + var start = pos.ch, end = pos.ch; + if (line) { + var helper = this.getHelper(pos, "wordChars"); + if ((pos.xRel < 0 || end == line.length) && start) --start; else ++end; + var startChar = line.charAt(start); + var check = isWordChar(startChar, helper) + ? function(ch) { return isWordChar(ch, helper); } + : /\s/.test(startChar) ? function(ch) {return /\s/.test(ch);} + : function(ch) {return !/\s/.test(ch) && !isWordChar(ch);}; + while (start > 0 && check(line.charAt(start - 1))) --start; + while (end < line.length && check(line.charAt(end))) ++end; + } + return new Range(Pos(pos.line, start), Pos(pos.line, end)); + }, + + toggleOverwrite: function(value) { + if (value != null && value == this.state.overwrite) return; + if (this.state.overwrite = !this.state.overwrite) + addClass(this.display.cursorDiv, "CodeMirror-overwrite"); + else + rmClass(this.display.cursorDiv, "CodeMirror-overwrite"); + + signal(this, "overwriteToggle", this, this.state.overwrite); + }, + hasFocus: function() { return this.display.input.getField() == activeElt(); }, + isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit); }, + + scrollTo: methodOp(function(x, y) { + if (x != null || y != null) resolveScrollToPos(this); + if (x != null) this.curOp.scrollLeft = x; + if (y != null) this.curOp.scrollTop = y; + }), + getScrollInfo: function() { + var scroller = this.display.scroller; + return {left: scroller.scrollLeft, top: scroller.scrollTop, + height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight, + width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth, + clientHeight: displayHeight(this), clientWidth: displayWidth(this)}; + }, + + scrollIntoView: methodOp(function(range, margin) { + if (range == null) { + range = {from: this.doc.sel.primary().head, to: null}; + if (margin == null) margin = this.options.cursorScrollMargin; + } else if (typeof range == "number") { + range = {from: Pos(range, 0), to: null}; + } else if (range.from == null) { + range = {from: range, to: null}; + } + if (!range.to) range.to = range.from; + range.margin = margin || 0; + + if (range.from.line != null) { + resolveScrollToPos(this); + this.curOp.scrollToPos = range; + } else { + var sPos = calculateScrollPos(this, Math.min(range.from.left, range.to.left), + Math.min(range.from.top, range.to.top) - range.margin, + Math.max(range.from.right, range.to.right), + Math.max(range.from.bottom, range.to.bottom) + range.margin); + this.scrollTo(sPos.scrollLeft, sPos.scrollTop); + } + }), + + setSize: methodOp(function(width, height) { + var cm = this; + function interpret(val) { + return typeof val == "number" || /^\d+$/.test(String(val)) ? val + "px" : val; + } + if (width != null) cm.display.wrapper.style.width = interpret(width); + if (height != null) cm.display.wrapper.style.height = interpret(height); + if (cm.options.lineWrapping) clearLineMeasurementCache(this); + var lineNo = cm.display.viewFrom; + cm.doc.iter(lineNo, cm.display.viewTo, function(line) { + if (line.widgets) for (var i = 0; i < line.widgets.length; i++) + if (line.widgets[i].noHScroll) { regLineChange(cm, lineNo, "widget"); break; } + ++lineNo; + }); + cm.curOp.forceUpdate = true; + signal(cm, "refresh", this); + }), + + operation: function(f){return runInOp(this, f);}, + + refresh: methodOp(function() { + var oldHeight = this.display.cachedTextHeight; + regChange(this); + this.curOp.forceUpdate = true; + clearCaches(this); + this.scrollTo(this.doc.scrollLeft, this.doc.scrollTop); + updateGutterSpace(this); + if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5) + estimateLineHeights(this); + signal(this, "refresh", this); + }), + + swapDoc: methodOp(function(doc) { + var old = this.doc; + old.cm = null; + attachDoc(this, doc); + clearCaches(this); + this.display.input.reset(); + this.scrollTo(doc.scrollLeft, doc.scrollTop); + this.curOp.forceScroll = true; + signalLater(this, "swapDoc", this, old); + return old; + }), + + getInputField: function(){return this.display.input.getField();}, + getWrapperElement: function(){return this.display.wrapper;}, + getScrollerElement: function(){return this.display.scroller;}, + getGutterElement: function(){return this.display.gutters;} + }; + eventMixin(CodeMirror); + + // OPTION DEFAULTS + + // The default configuration options. + var defaults = CodeMirror.defaults = {}; + // Functions to run when options are changed. + var optionHandlers = CodeMirror.optionHandlers = {}; + + function option(name, deflt, handle, notOnInit) { + CodeMirror.defaults[name] = deflt; + if (handle) optionHandlers[name] = + notOnInit ? function(cm, val, old) {if (old != Init) handle(cm, val, old);} : handle; + } + + // Passed to option handlers when there is no old value. + var Init = CodeMirror.Init = {toString: function(){return "CodeMirror.Init";}}; + + // These two are, on init, called from the constructor because they + // have to be initialized before the editor can start at all. + option("value", "", function(cm, val) { + cm.setValue(val); + }, true); + option("mode", null, function(cm, val) { + cm.doc.modeOption = val; + loadMode(cm); + }, true); + + option("indentUnit", 2, loadMode, true); + option("indentWithTabs", false); + option("smartIndent", true); + option("tabSize", 4, function(cm) { + resetModeState(cm); + clearCaches(cm); + regChange(cm); + }, true); + option("lineSeparator", null, function(cm, val) { + cm.doc.lineSep = val; + if (!val) return; + var newBreaks = [], lineNo = cm.doc.first; + cm.doc.iter(function(line) { + for (var pos = 0;;) { + var found = line.text.indexOf(val, pos); + if (found == -1) break; + pos = found + val.length; + newBreaks.push(Pos(lineNo, found)); + } + lineNo++; + }); + for (var i = newBreaks.length - 1; i >= 0; i--) + replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)) + }); + option("specialChars", /[\u0000-\u001f\u007f\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g, function(cm, val, old) { + cm.state.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g"); + if (old != CodeMirror.Init) cm.refresh(); + }); + option("specialCharPlaceholder", defaultSpecialCharPlaceholder, function(cm) {cm.refresh();}, true); + option("electricChars", true); + option("inputStyle", mobile ? "contenteditable" : "textarea", function() { + throw new Error("inputStyle can not (yet) be changed in a running editor"); // FIXME + }, true); + option("rtlMoveVisually", !windows); + option("wholeLineUpdateBefore", true); + + option("theme", "default", function(cm) { + themeChanged(cm); + guttersChanged(cm); + }, true); + option("keyMap", "default", function(cm, val, old) { + var next = getKeyMap(val); + var prev = old != CodeMirror.Init && getKeyMap(old); + if (prev && prev.detach) prev.detach(cm, next); + if (next.attach) next.attach(cm, prev || null); + }); + option("extraKeys", null); + + option("lineWrapping", false, wrappingChanged, true); + option("gutters", [], function(cm) { + setGuttersForLineNumbers(cm.options); + guttersChanged(cm); + }, true); + option("fixedGutter", true, function(cm, val) { + cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + "px" : "0"; + cm.refresh(); + }, true); + option("coverGutterNextToScrollbar", false, function(cm) {updateScrollbars(cm);}, true); + option("scrollbarStyle", "native", function(cm) { + initScrollbars(cm); + updateScrollbars(cm); + cm.display.scrollbars.setScrollTop(cm.doc.scrollTop); + cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft); + }, true); + option("lineNumbers", false, function(cm) { + setGuttersForLineNumbers(cm.options); + guttersChanged(cm); + }, true); + option("firstLineNumber", 1, guttersChanged, true); + option("lineNumberFormatter", function(integer) {return integer;}, guttersChanged, true); + option("showCursorWhenSelecting", false, updateSelection, true); + + option("resetSelectionOnContextMenu", true); + option("lineWiseCopyCut", true); + + option("readOnly", false, function(cm, val) { + if (val == "nocursor") { + onBlur(cm); + cm.display.input.blur(); + cm.display.disabled = true; + } else { + cm.display.disabled = false; + } + cm.display.input.readOnlyChanged(val) + }); + option("disableInput", false, function(cm, val) {if (!val) cm.display.input.reset();}, true); + option("dragDrop", true, dragDropChanged); + option("allowDropFileTypes", null); + + option("cursorBlinkRate", 530); + option("cursorScrollMargin", 0); + option("cursorHeight", 1, updateSelection, true); + option("singleCursorHeightPerLine", true, updateSelection, true); + option("workTime", 100); + option("workDelay", 100); + option("flattenSpans", true, resetModeState, true); + option("addModeClass", false, resetModeState, true); + option("pollInterval", 100); + option("undoDepth", 200, function(cm, val){cm.doc.history.undoDepth = val;}); + option("historyEventDelay", 1250); + option("viewportMargin", 10, function(cm){cm.refresh();}, true); + option("maxHighlightLength", 10000, resetModeState, true); + option("moveInputWithCursor", true, function(cm, val) { + if (!val) cm.display.input.resetPosition(); + }); + + option("tabindex", null, function(cm, val) { + cm.display.input.getField().tabIndex = val || ""; + }); + option("autofocus", null); + + // MODE DEFINITION AND QUERYING + + // Known modes, by name and by MIME + var modes = CodeMirror.modes = {}, mimeModes = CodeMirror.mimeModes = {}; + + // Extra arguments are stored as the mode's dependencies, which is + // used by (legacy) mechanisms like loadmode.js to automatically + // load a mode. (Preferred mechanism is the require/define calls.) + CodeMirror.defineMode = function(name, mode) { + if (!CodeMirror.defaults.mode && name != "null") CodeMirror.defaults.mode = name; + if (arguments.length > 2) + mode.dependencies = Array.prototype.slice.call(arguments, 2); + modes[name] = mode; + }; + + CodeMirror.defineMIME = function(mime, spec) { + mimeModes[mime] = spec; + }; + + // Given a MIME type, a {name, ...options} config object, or a name + // string, return a mode config object. + CodeMirror.resolveMode = function(spec) { + if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) { + spec = mimeModes[spec]; + } else if (spec && typeof spec.name == "string" && mimeModes.hasOwnProperty(spec.name)) { + var found = mimeModes[spec.name]; + if (typeof found == "string") found = {name: found}; + spec = createObj(found, spec); + spec.name = found.name; + } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+xml$/.test(spec)) { + return CodeMirror.resolveMode("application/xml"); + } + if (typeof spec == "string") return {name: spec}; + else return spec || {name: "null"}; + }; + + // Given a mode spec (anything that resolveMode accepts), find and + // initialize an actual mode object. + CodeMirror.getMode = function(options, spec) { + var spec = CodeMirror.resolveMode(spec); + var mfactory = modes[spec.name]; + if (!mfactory) return CodeMirror.getMode(options, "text/plain"); + var modeObj = mfactory(options, spec); + if (modeExtensions.hasOwnProperty(spec.name)) { + var exts = modeExtensions[spec.name]; + for (var prop in exts) { + if (!exts.hasOwnProperty(prop)) continue; + if (modeObj.hasOwnProperty(prop)) modeObj["_" + prop] = modeObj[prop]; + modeObj[prop] = exts[prop]; + } + } + modeObj.name = spec.name; + if (spec.helperType) modeObj.helperType = spec.helperType; + if (spec.modeProps) for (var prop in spec.modeProps) + modeObj[prop] = spec.modeProps[prop]; + + return modeObj; + }; + + // Minimal default mode. + CodeMirror.defineMode("null", function() { + return {token: function(stream) {stream.skipToEnd();}}; + }); + CodeMirror.defineMIME("text/plain", "null"); + + // This can be used to attach properties to mode objects from + // outside the actual mode definition. + var modeExtensions = CodeMirror.modeExtensions = {}; + CodeMirror.extendMode = function(mode, properties) { + var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {}); + copyObj(properties, exts); + }; + + // EXTENSIONS + + CodeMirror.defineExtension = function(name, func) { + CodeMirror.prototype[name] = func; + }; + CodeMirror.defineDocExtension = function(name, func) { + Doc.prototype[name] = func; + }; + CodeMirror.defineOption = option; + + var initHooks = []; + CodeMirror.defineInitHook = function(f) {initHooks.push(f);}; + + var helpers = CodeMirror.helpers = {}; + CodeMirror.registerHelper = function(type, name, value) { + if (!helpers.hasOwnProperty(type)) helpers[type] = CodeMirror[type] = {_global: []}; + helpers[type][name] = value; + }; + CodeMirror.registerGlobalHelper = function(type, name, predicate, value) { + CodeMirror.registerHelper(type, name, value); + helpers[type]._global.push({pred: predicate, val: value}); + }; + + // MODE STATE HANDLING + + // Utility functions for working with state. Exported because nested + // modes need to do this for their inner modes. + + var copyState = CodeMirror.copyState = function(mode, state) { + if (state === true) return state; + if (mode.copyState) return mode.copyState(state); + var nstate = {}; + for (var n in state) { + var val = state[n]; + if (val instanceof Array) val = val.concat([]); + nstate[n] = val; + } + return nstate; + }; + + var startState = CodeMirror.startState = function(mode, a1, a2) { + return mode.startState ? mode.startState(a1, a2) : true; + }; + + // Given a mode and a state (for that mode), find the inner mode and + // state at the position that the state refers to. + CodeMirror.innerMode = function(mode, state) { + while (mode.innerMode) { + var info = mode.innerMode(state); + if (!info || info.mode == mode) break; + state = info.state; + mode = info.mode; + } + return info || {mode: mode, state: state}; + }; + + // STANDARD COMMANDS + + // Commands are parameter-less actions that can be performed on an + // editor, mostly used for keybindings. + var commands = CodeMirror.commands = { + selectAll: function(cm) {cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll);}, + singleSelection: function(cm) { + cm.setSelection(cm.getCursor("anchor"), cm.getCursor("head"), sel_dontScroll); + }, + killLine: function(cm) { + deleteNearSelection(cm, function(range) { + if (range.empty()) { + var len = getLine(cm.doc, range.head.line).text.length; + if (range.head.ch == len && range.head.line < cm.lastLine()) + return {from: range.head, to: Pos(range.head.line + 1, 0)}; + else + return {from: range.head, to: Pos(range.head.line, len)}; + } else { + return {from: range.from(), to: range.to()}; + } + }); + }, + deleteLine: function(cm) { + deleteNearSelection(cm, function(range) { + return {from: Pos(range.from().line, 0), + to: clipPos(cm.doc, Pos(range.to().line + 1, 0))}; + }); + }, + delLineLeft: function(cm) { + deleteNearSelection(cm, function(range) { + return {from: Pos(range.from().line, 0), to: range.from()}; + }); + }, + delWrappedLineLeft: function(cm) { + deleteNearSelection(cm, function(range) { + var top = cm.charCoords(range.head, "div").top + 5; + var leftPos = cm.coordsChar({left: 0, top: top}, "div"); + return {from: leftPos, to: range.from()}; + }); + }, + delWrappedLineRight: function(cm) { + deleteNearSelection(cm, function(range) { + var top = cm.charCoords(range.head, "div").top + 5; + var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div"); + return {from: range.from(), to: rightPos }; + }); + }, + undo: function(cm) {cm.undo();}, + redo: function(cm) {cm.redo();}, + undoSelection: function(cm) {cm.undoSelection();}, + redoSelection: function(cm) {cm.redoSelection();}, + goDocStart: function(cm) {cm.extendSelection(Pos(cm.firstLine(), 0));}, + goDocEnd: function(cm) {cm.extendSelection(Pos(cm.lastLine()));}, + goLineStart: function(cm) { + cm.extendSelectionsBy(function(range) { return lineStart(cm, range.head.line); }, + {origin: "+move", bias: 1}); + }, + goLineStartSmart: function(cm) { + cm.extendSelectionsBy(function(range) { + return lineStartSmart(cm, range.head); + }, {origin: "+move", bias: 1}); + }, + goLineEnd: function(cm) { + cm.extendSelectionsBy(function(range) { return lineEnd(cm, range.head.line); }, + {origin: "+move", bias: -1}); + }, + goLineRight: function(cm) { + cm.extendSelectionsBy(function(range) { + var top = cm.charCoords(range.head, "div").top + 5; + return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div"); + }, sel_move); + }, + goLineLeft: function(cm) { + cm.extendSelectionsBy(function(range) { + var top = cm.charCoords(range.head, "div").top + 5; + return cm.coordsChar({left: 0, top: top}, "div"); + }, sel_move); + }, + goLineLeftSmart: function(cm) { + cm.extendSelectionsBy(function(range) { + var top = cm.charCoords(range.head, "div").top + 5; + var pos = cm.coordsChar({left: 0, top: top}, "div"); + if (pos.ch < cm.getLine(pos.line).search(/\S/)) return lineStartSmart(cm, range.head); + return pos; + }, sel_move); + }, + goLineUp: function(cm) {cm.moveV(-1, "line");}, + goLineDown: function(cm) {cm.moveV(1, "line");}, + goPageUp: function(cm) {cm.moveV(-1, "page");}, + goPageDown: function(cm) {cm.moveV(1, "page");}, + goCharLeft: function(cm) {cm.moveH(-1, "char");}, + goCharRight: function(cm) {cm.moveH(1, "char");}, + goColumnLeft: function(cm) {cm.moveH(-1, "column");}, + goColumnRight: function(cm) {cm.moveH(1, "column");}, + goWordLeft: function(cm) {cm.moveH(-1, "word");}, + goGroupRight: function(cm) {cm.moveH(1, "group");}, + goGroupLeft: function(cm) {cm.moveH(-1, "group");}, + goWordRight: function(cm) {cm.moveH(1, "word");}, + delCharBefore: function(cm) {cm.deleteH(-1, "char");}, + delCharAfter: function(cm) {cm.deleteH(1, "char");}, + delWordBefore: function(cm) {cm.deleteH(-1, "word");}, + delWordAfter: function(cm) {cm.deleteH(1, "word");}, + delGroupBefore: function(cm) {cm.deleteH(-1, "group");}, + delGroupAfter: function(cm) {cm.deleteH(1, "group");}, + indentAuto: function(cm) {cm.indentSelection("smart");}, + indentMore: function(cm) {cm.indentSelection("add");}, + indentLess: function(cm) {cm.indentSelection("subtract");}, + insertTab: function(cm) {cm.replaceSelection("\t");}, + insertSoftTab: function(cm) { + var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize; + for (var i = 0; i < ranges.length; i++) { + var pos = ranges[i].from(); + var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize); + spaces.push(spaceStr(tabSize - col % tabSize)); + } + cm.replaceSelections(spaces); + }, + defaultTab: function(cm) { + if (cm.somethingSelected()) cm.indentSelection("add"); + else cm.execCommand("insertTab"); + }, + transposeChars: function(cm) { + runInOp(cm, function() { + var ranges = cm.listSelections(), newSel = []; + for (var i = 0; i < ranges.length; i++) { + var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text; + if (line) { + if (cur.ch == line.length) cur = new Pos(cur.line, cur.ch - 1); + if (cur.ch > 0) { + cur = new Pos(cur.line, cur.ch + 1); + cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2), + Pos(cur.line, cur.ch - 2), cur, "+transpose"); + } else if (cur.line > cm.doc.first) { + var prev = getLine(cm.doc, cur.line - 1).text; + if (prev) + cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() + + prev.charAt(prev.length - 1), + Pos(cur.line - 1, prev.length - 1), Pos(cur.line, 1), "+transpose"); + } + } + newSel.push(new Range(cur, cur)); + } + cm.setSelections(newSel); + }); + }, + newlineAndIndent: function(cm) { + runInOp(cm, function() { + var len = cm.listSelections().length; + for (var i = 0; i < len; i++) { + var range = cm.listSelections()[i]; + cm.replaceRange(cm.doc.lineSeparator(), range.anchor, range.head, "+input"); + cm.indentLine(range.from().line + 1, null, true); + } + ensureCursorVisible(cm); + }); + }, + openLine: function(cm) {cm.replaceSelection("\n", "start")}, + toggleOverwrite: function(cm) {cm.toggleOverwrite();} + }; + + + // STANDARD KEYMAPS + + var keyMap = CodeMirror.keyMap = {}; + + keyMap.basic = { + "Left": "goCharLeft", "Right": "goCharRight", "Up": "goLineUp", "Down": "goLineDown", + "End": "goLineEnd", "Home": "goLineStartSmart", "PageUp": "goPageUp", "PageDown": "goPageDown", + "Delete": "delCharAfter", "Backspace": "delCharBefore", "Shift-Backspace": "delCharBefore", + "Tab": "defaultTab", "Shift-Tab": "indentAuto", + "Enter": "newlineAndIndent", "Insert": "toggleOverwrite", + "Esc": "singleSelection" + }; + // Note that the save and find-related commands aren't defined by + // default. User code or addons can define them. Unknown commands + // are simply ignored. + keyMap.pcDefault = { + "Ctrl-A": "selectAll", "Ctrl-D": "deleteLine", "Ctrl-Z": "undo", "Shift-Ctrl-Z": "redo", "Ctrl-Y": "redo", + "Ctrl-Home": "goDocStart", "Ctrl-End": "goDocEnd", "Ctrl-Up": "goLineUp", "Ctrl-Down": "goLineDown", + "Ctrl-Left": "goGroupLeft", "Ctrl-Right": "goGroupRight", "Alt-Left": "goLineStart", "Alt-Right": "goLineEnd", + "Ctrl-Backspace": "delGroupBefore", "Ctrl-Delete": "delGroupAfter", "Ctrl-S": "save", "Ctrl-F": "find", + "Ctrl-G": "findNext", "Shift-Ctrl-G": "findPrev", "Shift-Ctrl-F": "replace", "Shift-Ctrl-R": "replaceAll", + "Ctrl-[": "indentLess", "Ctrl-]": "indentMore", + "Ctrl-U": "undoSelection", "Shift-Ctrl-U": "redoSelection", "Alt-U": "redoSelection", + fallthrough: "basic" + }; + // Very basic readline/emacs-style bindings, which are standard on Mac. + keyMap.emacsy = { + "Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown", + "Alt-F": "goWordRight", "Alt-B": "goWordLeft", "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd", + "Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp", "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore", + "Alt-D": "delWordAfter", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine", "Ctrl-T": "transposeChars", + "Ctrl-O": "openLine" + }; + keyMap.macDefault = { + "Cmd-A": "selectAll", "Cmd-D": "deleteLine", "Cmd-Z": "undo", "Shift-Cmd-Z": "redo", "Cmd-Y": "redo", + "Cmd-Home": "goDocStart", "Cmd-Up": "goDocStart", "Cmd-End": "goDocEnd", "Cmd-Down": "goDocEnd", "Alt-Left": "goGroupLeft", + "Alt-Right": "goGroupRight", "Cmd-Left": "goLineLeft", "Cmd-Right": "goLineRight", "Alt-Backspace": "delGroupBefore", + "Ctrl-Alt-Backspace": "delGroupAfter", "Alt-Delete": "delGroupAfter", "Cmd-S": "save", "Cmd-F": "find", + "Cmd-G": "findNext", "Shift-Cmd-G": "findPrev", "Cmd-Alt-F": "replace", "Shift-Cmd-Alt-F": "replaceAll", + "Cmd-[": "indentLess", "Cmd-]": "indentMore", "Cmd-Backspace": "delWrappedLineLeft", "Cmd-Delete": "delWrappedLineRight", + "Cmd-U": "undoSelection", "Shift-Cmd-U": "redoSelection", "Ctrl-Up": "goDocStart", "Ctrl-Down": "goDocEnd", + fallthrough: ["basic", "emacsy"] + }; + keyMap["default"] = mac ? keyMap.macDefault : keyMap.pcDefault; + + // KEYMAP DISPATCH + + function normalizeKeyName(name) { + var parts = name.split(/-(?!$)/), name = parts[parts.length - 1]; + var alt, ctrl, shift, cmd; + for (var i = 0; i < parts.length - 1; i++) { + var mod = parts[i]; + if (/^(cmd|meta|m)$/i.test(mod)) cmd = true; + else if (/^a(lt)?$/i.test(mod)) alt = true; + else if (/^(c|ctrl|control)$/i.test(mod)) ctrl = true; + else if (/^s(hift)$/i.test(mod)) shift = true; + else throw new Error("Unrecognized modifier name: " + mod); + } + if (alt) name = "Alt-" + name; + if (ctrl) name = "Ctrl-" + name; + if (cmd) name = "Cmd-" + name; + if (shift) name = "Shift-" + name; + return name; + } + + // This is a kludge to keep keymaps mostly working as raw objects + // (backwards compatibility) while at the same time support features + // like normalization and multi-stroke key bindings. It compiles a + // new normalized keymap, and then updates the old object to reflect + // this. + CodeMirror.normalizeKeyMap = function(keymap) { + var copy = {}; + for (var keyname in keymap) if (keymap.hasOwnProperty(keyname)) { + var value = keymap[keyname]; + if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) continue; + if (value == "...") { delete keymap[keyname]; continue; } + + var keys = map(keyname.split(" "), normalizeKeyName); + for (var i = 0; i < keys.length; i++) { + var val, name; + if (i == keys.length - 1) { + name = keys.join(" "); + val = value; + } else { + name = keys.slice(0, i + 1).join(" "); + val = "..."; + } + var prev = copy[name]; + if (!prev) copy[name] = val; + else if (prev != val) throw new Error("Inconsistent bindings for " + name); + } + delete keymap[keyname]; + } + for (var prop in copy) keymap[prop] = copy[prop]; + return keymap; + }; + + var lookupKey = CodeMirror.lookupKey = function(key, map, handle, context) { + map = getKeyMap(map); + var found = map.call ? map.call(key, context) : map[key]; + if (found === false) return "nothing"; + if (found === "...") return "multi"; + if (found != null && handle(found)) return "handled"; + + if (map.fallthrough) { + if (Object.prototype.toString.call(map.fallthrough) != "[object Array]") + return lookupKey(key, map.fallthrough, handle, context); + for (var i = 0; i < map.fallthrough.length; i++) { + var result = lookupKey(key, map.fallthrough[i], handle, context); + if (result) return result; + } + } + }; + + // Modifier key presses don't count as 'real' key presses for the + // purpose of keymap fallthrough. + var isModifierKey = CodeMirror.isModifierKey = function(value) { + var name = typeof value == "string" ? value : keyNames[value.keyCode]; + return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod"; + }; + + // Look up the name of a key as indicated by an event object. + var keyName = CodeMirror.keyName = function(event, noShift) { + if (presto && event.keyCode == 34 && event["char"]) return false; + var base = keyNames[event.keyCode], name = base; + if (name == null || event.altGraphKey) return false; + if (event.altKey && base != "Alt") name = "Alt-" + name; + if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != "Ctrl") name = "Ctrl-" + name; + if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != "Cmd") name = "Cmd-" + name; + if (!noShift && event.shiftKey && base != "Shift") name = "Shift-" + name; + return name; + }; + + function getKeyMap(val) { + return typeof val == "string" ? keyMap[val] : val; + } + + // FROMTEXTAREA + + CodeMirror.fromTextArea = function(textarea, options) { + options = options ? copyObj(options) : {}; + options.value = textarea.value; + if (!options.tabindex && textarea.tabIndex) + options.tabindex = textarea.tabIndex; + if (!options.placeholder && textarea.placeholder) + options.placeholder = textarea.placeholder; + // Set autofocus to true if this textarea is focused, or if it has + // autofocus and no other element is focused. + if (options.autofocus == null) { + var hasFocus = activeElt(); + options.autofocus = hasFocus == textarea || + textarea.getAttribute("autofocus") != null && hasFocus == document.body; + } + + function save() {textarea.value = cm.getValue();} + if (textarea.form) { + on(textarea.form, "submit", save); + // Deplorable hack to make the submit method do the right thing. + if (!options.leaveSubmitMethodAlone) { + var form = textarea.form, realSubmit = form.submit; + try { + var wrappedSubmit = form.submit = function() { + save(); + form.submit = realSubmit; + form.submit(); + form.submit = wrappedSubmit; + }; + } catch(e) {} + } + } + + options.finishInit = function(cm) { + cm.save = save; + cm.getTextArea = function() { return textarea; }; + cm.toTextArea = function() { + cm.toTextArea = isNaN; // Prevent this from being ran twice + save(); + textarea.parentNode.removeChild(cm.getWrapperElement()); + textarea.style.display = ""; + if (textarea.form) { + off(textarea.form, "submit", save); + if (typeof textarea.form.submit == "function") + textarea.form.submit = realSubmit; + } + }; + }; + + textarea.style.display = "none"; + var cm = CodeMirror(function(node) { + textarea.parentNode.insertBefore(node, textarea.nextSibling); + }, options); + return cm; + }; + + // STRING STREAM + + // Fed to the mode parsers, provides helper functions to make + // parsers more succinct. + + var StringStream = CodeMirror.StringStream = function(string, tabSize) { + this.pos = this.start = 0; + this.string = string; + this.tabSize = tabSize || 8; + this.lastColumnPos = this.lastColumnValue = 0; + this.lineStart = 0; + }; + + StringStream.prototype = { + eol: function() {return this.pos >= this.string.length;}, + sol: function() {return this.pos == this.lineStart;}, + peek: function() {return this.string.charAt(this.pos) || undefined;}, + next: function() { + if (this.pos < this.string.length) + return this.string.charAt(this.pos++); + }, + eat: function(match) { + var ch = this.string.charAt(this.pos); + if (typeof match == "string") var ok = ch == match; + else var ok = ch && (match.test ? match.test(ch) : match(ch)); + if (ok) {++this.pos; return ch;} + }, + eatWhile: function(match) { + var start = this.pos; + while (this.eat(match)){} + return this.pos > start; + }, + eatSpace: function() { + var start = this.pos; + while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos; + return this.pos > start; + }, + skipToEnd: function() {this.pos = this.string.length;}, + skipTo: function(ch) { + var found = this.string.indexOf(ch, this.pos); + if (found > -1) {this.pos = found; return true;} + }, + backUp: function(n) {this.pos -= n;}, + column: function() { + if (this.lastColumnPos < this.start) { + this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue); + this.lastColumnPos = this.start; + } + return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0); + }, + indentation: function() { + return countColumn(this.string, null, this.tabSize) - + (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0); + }, + match: function(pattern, consume, caseInsensitive) { + if (typeof pattern == "string") { + var cased = function(str) {return caseInsensitive ? str.toLowerCase() : str;}; + var substr = this.string.substr(this.pos, pattern.length); + if (cased(substr) == cased(pattern)) { + if (consume !== false) this.pos += pattern.length; + return true; + } + } else { + var match = this.string.slice(this.pos).match(pattern); + if (match && match.index > 0) return null; + if (match && consume !== false) this.pos += match[0].length; + return match; + } + }, + current: function(){return this.string.slice(this.start, this.pos);}, + hideFirstChars: function(n, inner) { + this.lineStart += n; + try { return inner(); } + finally { this.lineStart -= n; } + } + }; + + // TEXTMARKERS + + // Created with markText and setBookmark methods. A TextMarker is a + // handle that can be used to clear or find a marked position in the + // document. Line objects hold arrays (markedSpans) containing + // {from, to, marker} object pointing to such marker objects, and + // indicating that such a marker is present on that line. Multiple + // lines may point to the same marker when it spans across lines. + // The spans will have null for their from/to properties when the + // marker continues beyond the start/end of the line. Markers have + // links back to the lines they currently touch. + + var nextMarkerId = 0; + + var TextMarker = CodeMirror.TextMarker = function(doc, type) { + this.lines = []; + this.type = type; + this.doc = doc; + this.id = ++nextMarkerId; + }; + eventMixin(TextMarker); + + // Clear the marker. + TextMarker.prototype.clear = function() { + if (this.explicitlyCleared) return; + var cm = this.doc.cm, withOp = cm && !cm.curOp; + if (withOp) startOperation(cm); + if (hasHandler(this, "clear")) { + var found = this.find(); + if (found) signalLater(this, "clear", found.from, found.to); + } + var min = null, max = null; + for (var i = 0; i < this.lines.length; ++i) { + var line = this.lines[i]; + var span = getMarkedSpanFor(line.markedSpans, this); + if (cm && !this.collapsed) regLineChange(cm, lineNo(line), "text"); + else if (cm) { + if (span.to != null) max = lineNo(line); + if (span.from != null) min = lineNo(line); + } + line.markedSpans = removeMarkedSpan(line.markedSpans, span); + if (span.from == null && this.collapsed && !lineIsHidden(this.doc, line) && cm) + updateLineHeight(line, textHeight(cm.display)); + } + if (cm && this.collapsed && !cm.options.lineWrapping) for (var i = 0; i < this.lines.length; ++i) { + var visual = visualLine(this.lines[i]), len = lineLength(visual); + if (len > cm.display.maxLineLength) { + cm.display.maxLine = visual; + cm.display.maxLineLength = len; + cm.display.maxLineChanged = true; + } + } + + if (min != null && cm && this.collapsed) regChange(cm, min, max + 1); + this.lines.length = 0; + this.explicitlyCleared = true; + if (this.atomic && this.doc.cantEdit) { + this.doc.cantEdit = false; + if (cm) reCheckSelection(cm.doc); + } + if (cm) signalLater(cm, "markerCleared", cm, this); + if (withOp) endOperation(cm); + if (this.parent) this.parent.clear(); + }; + + // Find the position of the marker in the document. Returns a {from, + // to} object by default. Side can be passed to get a specific side + // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the + // Pos objects returned contain a line object, rather than a line + // number (used to prevent looking up the same line twice). + TextMarker.prototype.find = function(side, lineObj) { + if (side == null && this.type == "bookmark") side = 1; + var from, to; + for (var i = 0; i < this.lines.length; ++i) { + var line = this.lines[i]; + var span = getMarkedSpanFor(line.markedSpans, this); + if (span.from != null) { + from = Pos(lineObj ? line : lineNo(line), span.from); + if (side == -1) return from; + } + if (span.to != null) { + to = Pos(lineObj ? line : lineNo(line), span.to); + if (side == 1) return to; + } + } + return from && {from: from, to: to}; + }; + + // Signals that the marker's widget changed, and surrounding layout + // should be recomputed. + TextMarker.prototype.changed = function() { + var pos = this.find(-1, true), widget = this, cm = this.doc.cm; + if (!pos || !cm) return; + runInOp(cm, function() { + var line = pos.line, lineN = lineNo(pos.line); + var view = findViewForLine(cm, lineN); + if (view) { + clearLineMeasurementCacheFor(view); + cm.curOp.selectionChanged = cm.curOp.forceUpdate = true; + } + cm.curOp.updateMaxLine = true; + if (!lineIsHidden(widget.doc, line) && widget.height != null) { + var oldHeight = widget.height; + widget.height = null; + var dHeight = widgetHeight(widget) - oldHeight; + if (dHeight) + updateLineHeight(line, line.height + dHeight); + } + }); + }; + + TextMarker.prototype.attachLine = function(line) { + if (!this.lines.length && this.doc.cm) { + var op = this.doc.cm.curOp; + if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1) + (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this); + } + this.lines.push(line); + }; + TextMarker.prototype.detachLine = function(line) { + this.lines.splice(indexOf(this.lines, line), 1); + if (!this.lines.length && this.doc.cm) { + var op = this.doc.cm.curOp; + (op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this); + } + }; + + // Collapsed markers have unique ids, in order to be able to order + // them, which is needed for uniquely determining an outer marker + // when they overlap (they may nest, but not partially overlap). + var nextMarkerId = 0; + + // Create a marker, wire it up to the right lines, and + function markText(doc, from, to, options, type) { + // Shared markers (across linked documents) are handled separately + // (markTextShared will call out to this again, once per + // document). + if (options && options.shared) return markTextShared(doc, from, to, options, type); + // Ensure we are in an operation. + if (doc.cm && !doc.cm.curOp) return operation(doc.cm, markText)(doc, from, to, options, type); + + var marker = new TextMarker(doc, type), diff = cmp(from, to); + if (options) copyObj(options, marker, false); + // Don't connect empty markers unless clearWhenEmpty is false + if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false) + return marker; + if (marker.replacedWith) { + // Showing up as a widget implies collapsed (widget replaces text) + marker.collapsed = true; + marker.widgetNode = elt("span", [marker.replacedWith], "CodeMirror-widget"); + if (!options.handleMouseEvents) marker.widgetNode.setAttribute("cm-ignore-events", "true"); + if (options.insertLeft) marker.widgetNode.insertLeft = true; + } + if (marker.collapsed) { + if (conflictingCollapsedRange(doc, from.line, from, to, marker) || + from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker)) + throw new Error("Inserting collapsed marker partially overlapping an existing one"); + sawCollapsedSpans = true; + } + + if (marker.addToHistory) + addChangeToHistory(doc, {from: from, to: to, origin: "markText"}, doc.sel, NaN); + + var curLine = from.line, cm = doc.cm, updateMaxLine; + doc.iter(curLine, to.line + 1, function(line) { + if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine) + updateMaxLine = true; + if (marker.collapsed && curLine != from.line) updateLineHeight(line, 0); + addMarkedSpan(line, new MarkedSpan(marker, + curLine == from.line ? from.ch : null, + curLine == to.line ? to.ch : null)); + ++curLine; + }); + // lineIsHidden depends on the presence of the spans, so needs a second pass + if (marker.collapsed) doc.iter(from.line, to.line + 1, function(line) { + if (lineIsHidden(doc, line)) updateLineHeight(line, 0); + }); + + if (marker.clearOnEnter) on(marker, "beforeCursorEnter", function() { marker.clear(); }); + + if (marker.readOnly) { + sawReadOnlySpans = true; + if (doc.history.done.length || doc.history.undone.length) + doc.clearHistory(); + } + if (marker.collapsed) { + marker.id = ++nextMarkerId; + marker.atomic = true; + } + if (cm) { + // Sync editor state + if (updateMaxLine) cm.curOp.updateMaxLine = true; + if (marker.collapsed) + regChange(cm, from.line, to.line + 1); + else if (marker.className || marker.title || marker.startStyle || marker.endStyle || marker.css) + for (var i = from.line; i <= to.line; i++) regLineChange(cm, i, "text"); + if (marker.atomic) reCheckSelection(cm.doc); + signalLater(cm, "markerAdded", cm, marker); + } + return marker; + } + + // SHARED TEXTMARKERS + + // A shared marker spans multiple linked documents. It is + // implemented as a meta-marker-object controlling multiple normal + // markers. + var SharedTextMarker = CodeMirror.SharedTextMarker = function(markers, primary) { + this.markers = markers; + this.primary = primary; + for (var i = 0; i < markers.length; ++i) + markers[i].parent = this; + }; + eventMixin(SharedTextMarker); + + SharedTextMarker.prototype.clear = function() { + if (this.explicitlyCleared) return; + this.explicitlyCleared = true; + for (var i = 0; i < this.markers.length; ++i) + this.markers[i].clear(); + signalLater(this, "clear"); + }; + SharedTextMarker.prototype.find = function(side, lineObj) { + return this.primary.find(side, lineObj); + }; + + function markTextShared(doc, from, to, options, type) { + options = copyObj(options); + options.shared = false; + var markers = [markText(doc, from, to, options, type)], primary = markers[0]; + var widget = options.widgetNode; + linkedDocs(doc, function(doc) { + if (widget) options.widgetNode = widget.cloneNode(true); + markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type)); + for (var i = 0; i < doc.linked.length; ++i) + if (doc.linked[i].isParent) return; + primary = lst(markers); + }); + return new SharedTextMarker(markers, primary); + } + + function findSharedMarkers(doc) { + return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), + function(m) { return m.parent; }); + } + + function copySharedMarkers(doc, markers) { + for (var i = 0; i < markers.length; i++) { + var marker = markers[i], pos = marker.find(); + var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to); + if (cmp(mFrom, mTo)) { + var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type); + marker.markers.push(subMark); + subMark.parent = marker; + } + } + } + + function detachSharedMarkers(markers) { + for (var i = 0; i < markers.length; i++) { + var marker = markers[i], linked = [marker.primary.doc];; + linkedDocs(marker.primary.doc, function(d) { linked.push(d); }); + for (var j = 0; j < marker.markers.length; j++) { + var subMarker = marker.markers[j]; + if (indexOf(linked, subMarker.doc) == -1) { + subMarker.parent = null; + marker.markers.splice(j--, 1); + } + } + } + } + + // TEXTMARKER SPANS + + function MarkedSpan(marker, from, to) { + this.marker = marker; + this.from = from; this.to = to; + } + + // Search an array of spans for a span matching the given marker. + function getMarkedSpanFor(spans, marker) { + if (spans) for (var i = 0; i < spans.length; ++i) { + var span = spans[i]; + if (span.marker == marker) return span; + } + } + // Remove a span from an array, returning undefined if no spans are + // left (we don't store arrays for lines without spans). + function removeMarkedSpan(spans, span) { + for (var r, i = 0; i < spans.length; ++i) + if (spans[i] != span) (r || (r = [])).push(spans[i]); + return r; + } + // Add a span to a line. + function addMarkedSpan(line, span) { + line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]; + span.marker.attachLine(line); + } + + // Used for the algorithm that adjusts markers for a change in the + // document. These functions cut an array of spans at a given + // character position, returning an array of remaining chunks (or + // undefined if nothing remains). + function markedSpansBefore(old, startCh, isInsert) { + if (old) for (var i = 0, nw; i < old.length; ++i) { + var span = old[i], marker = span.marker; + var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh); + if (startsBefore || span.from == startCh && marker.type == "bookmark" && (!isInsert || !span.marker.insertLeft)) { + var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh); + (nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to)); + } + } + return nw; + } + function markedSpansAfter(old, endCh, isInsert) { + if (old) for (var i = 0, nw; i < old.length; ++i) { + var span = old[i], marker = span.marker; + var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh); + if (endsAfter || span.from == endCh && marker.type == "bookmark" && (!isInsert || span.marker.insertLeft)) { + var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh); + (nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh, + span.to == null ? null : span.to - endCh)); + } + } + return nw; + } + + // Given a change object, compute the new set of marker spans that + // cover the line in which the change took place. Removes spans + // entirely within the change, reconnects spans belonging to the + // same marker that appear on both sides of the change, and cuts off + // spans partially within the change. Returns an array of span + // arrays with one element for each line in (after) the change. + function stretchSpansOverChange(doc, change) { + if (change.full) return null; + var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans; + var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans; + if (!oldFirst && !oldLast) return null; + + var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0; + // Get the spans that 'stick out' on both sides + var first = markedSpansBefore(oldFirst, startCh, isInsert); + var last = markedSpansAfter(oldLast, endCh, isInsert); + + // Next, merge those two ends + var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0); + if (first) { + // Fix up .to properties of first + for (var i = 0; i < first.length; ++i) { + var span = first[i]; + if (span.to == null) { + var found = getMarkedSpanFor(last, span.marker); + if (!found) span.to = startCh; + else if (sameLine) span.to = found.to == null ? null : found.to + offset; + } + } + } + if (last) { + // Fix up .from in last (or move them into first in case of sameLine) + for (var i = 0; i < last.length; ++i) { + var span = last[i]; + if (span.to != null) span.to += offset; + if (span.from == null) { + var found = getMarkedSpanFor(first, span.marker); + if (!found) { + span.from = offset; + if (sameLine) (first || (first = [])).push(span); + } + } else { + span.from += offset; + if (sameLine) (first || (first = [])).push(span); + } + } + } + // Make sure we didn't create any zero-length spans + if (first) first = clearEmptySpans(first); + if (last && last != first) last = clearEmptySpans(last); + + var newMarkers = [first]; + if (!sameLine) { + // Fill gap with whole-line-spans + var gap = change.text.length - 2, gapMarkers; + if (gap > 0 && first) + for (var i = 0; i < first.length; ++i) + if (first[i].to == null) + (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i].marker, null, null)); + for (var i = 0; i < gap; ++i) + newMarkers.push(gapMarkers); + newMarkers.push(last); + } + return newMarkers; + } + + // Remove spans that are empty and don't have a clearWhenEmpty + // option of false. + function clearEmptySpans(spans) { + for (var i = 0; i < spans.length; ++i) { + var span = spans[i]; + if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false) + spans.splice(i--, 1); + } + if (!spans.length) return null; + return spans; + } + + // Used for un/re-doing changes from the history. Combines the + // result of computing the existing spans with the set of spans that + // existed in the history (so that deleting around a span and then + // undoing brings back the span). + function mergeOldSpans(doc, change) { + var old = getOldSpans(doc, change); + var stretched = stretchSpansOverChange(doc, change); + if (!old) return stretched; + if (!stretched) return old; + + for (var i = 0; i < old.length; ++i) { + var oldCur = old[i], stretchCur = stretched[i]; + if (oldCur && stretchCur) { + spans: for (var j = 0; j < stretchCur.length; ++j) { + var span = stretchCur[j]; + for (var k = 0; k < oldCur.length; ++k) + if (oldCur[k].marker == span.marker) continue spans; + oldCur.push(span); + } + } else if (stretchCur) { + old[i] = stretchCur; + } + } + return old; + } + + // Used to 'clip' out readOnly ranges when making a change. + function removeReadOnlyRanges(doc, from, to) { + var markers = null; + doc.iter(from.line, to.line + 1, function(line) { + if (line.markedSpans) for (var i = 0; i < line.markedSpans.length; ++i) { + var mark = line.markedSpans[i].marker; + if (mark.readOnly && (!markers || indexOf(markers, mark) == -1)) + (markers || (markers = [])).push(mark); + } + }); + if (!markers) return null; + var parts = [{from: from, to: to}]; + for (var i = 0; i < markers.length; ++i) { + var mk = markers[i], m = mk.find(0); + for (var j = 0; j < parts.length; ++j) { + var p = parts[j]; + if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) continue; + var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to); + if (dfrom < 0 || !mk.inclusiveLeft && !dfrom) + newParts.push({from: p.from, to: m.from}); + if (dto > 0 || !mk.inclusiveRight && !dto) + newParts.push({from: m.to, to: p.to}); + parts.splice.apply(parts, newParts); + j += newParts.length - 1; + } + } + return parts; + } + + // Connect or disconnect spans from a line. + function detachMarkedSpans(line) { + var spans = line.markedSpans; + if (!spans) return; + for (var i = 0; i < spans.length; ++i) + spans[i].marker.detachLine(line); + line.markedSpans = null; + } + function attachMarkedSpans(line, spans) { + if (!spans) return; + for (var i = 0; i < spans.length; ++i) + spans[i].marker.attachLine(line); + line.markedSpans = spans; + } + + // Helpers used when computing which overlapping collapsed span + // counts as the larger one. + function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0; } + function extraRight(marker) { return marker.inclusiveRight ? 1 : 0; } + + // Returns a number indicating which of two overlapping collapsed + // spans is larger (and thus includes the other). Falls back to + // comparing ids when the spans cover exactly the same range. + function compareCollapsedMarkers(a, b) { + var lenDiff = a.lines.length - b.lines.length; + if (lenDiff != 0) return lenDiff; + var aPos = a.find(), bPos = b.find(); + var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b); + if (fromCmp) return -fromCmp; + var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b); + if (toCmp) return toCmp; + return b.id - a.id; + } + + // Find out whether a line ends or starts in a collapsed span. If + // so, return the marker for that span. + function collapsedSpanAtSide(line, start) { + var sps = sawCollapsedSpans && line.markedSpans, found; + if (sps) for (var sp, i = 0; i < sps.length; ++i) { + sp = sps[i]; + if (sp.marker.collapsed && (start ? sp.from : sp.to) == null && + (!found || compareCollapsedMarkers(found, sp.marker) < 0)) + found = sp.marker; + } + return found; + } + function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true); } + function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false); } + + // Test whether there exists a collapsed span that partially + // overlaps (covers the start or end, but not both) of a new span. + // Such overlap is not allowed. + function conflictingCollapsedRange(doc, lineNo, from, to, marker) { + var line = getLine(doc, lineNo); + var sps = sawCollapsedSpans && line.markedSpans; + if (sps) for (var i = 0; i < sps.length; ++i) { + var sp = sps[i]; + if (!sp.marker.collapsed) continue; + var found = sp.marker.find(0); + var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker); + var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker); + if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue; + if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) || + fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0)) + return true; + } + } + + // A visual line is a line as drawn on the screen. Folding, for + // example, can cause multiple logical lines to appear on the same + // visual line. This finds the start of the visual line that the + // given line is part of (usually that is the line itself). + function visualLine(line) { + var merged; + while (merged = collapsedSpanAtStart(line)) + line = merged.find(-1, true).line; + return line; + } + + // Returns an array of logical lines that continue the visual line + // started by the argument, or undefined if there are no such lines. + function visualLineContinued(line) { + var merged, lines; + while (merged = collapsedSpanAtEnd(line)) { + line = merged.find(1, true).line; + (lines || (lines = [])).push(line); + } + return lines; + } + + // Get the line number of the start of the visual line that the + // given line number is part of. + function visualLineNo(doc, lineN) { + var line = getLine(doc, lineN), vis = visualLine(line); + if (line == vis) return lineN; + return lineNo(vis); + } + // Get the line number of the start of the next visual line after + // the given line. + function visualLineEndNo(doc, lineN) { + if (lineN > doc.lastLine()) return lineN; + var line = getLine(doc, lineN), merged; + if (!lineIsHidden(doc, line)) return lineN; + while (merged = collapsedSpanAtEnd(line)) + line = merged.find(1, true).line; + return lineNo(line) + 1; + } + + // Compute whether a line is hidden. Lines count as hidden when they + // are part of a visual line that starts with another line, or when + // they are entirely covered by collapsed, non-widget span. + function lineIsHidden(doc, line) { + var sps = sawCollapsedSpans && line.markedSpans; + if (sps) for (var sp, i = 0; i < sps.length; ++i) { + sp = sps[i]; + if (!sp.marker.collapsed) continue; + if (sp.from == null) return true; + if (sp.marker.widgetNode) continue; + if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp)) + return true; + } + } + function lineIsHiddenInner(doc, line, span) { + if (span.to == null) { + var end = span.marker.find(1, true); + return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker)); + } + if (span.marker.inclusiveRight && span.to == line.text.length) + return true; + for (var sp, i = 0; i < line.markedSpans.length; ++i) { + sp = line.markedSpans[i]; + if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to && + (sp.to == null || sp.to != span.from) && + (sp.marker.inclusiveLeft || span.marker.inclusiveRight) && + lineIsHiddenInner(doc, line, sp)) return true; + } + } + + // LINE WIDGETS + + // Line widgets are block elements displayed above or below a line. + + var LineWidget = CodeMirror.LineWidget = function(doc, node, options) { + if (options) for (var opt in options) if (options.hasOwnProperty(opt)) + this[opt] = options[opt]; + this.doc = doc; + this.node = node; + }; + eventMixin(LineWidget); + + function adjustScrollWhenAboveVisible(cm, line, diff) { + if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop)) + addToScrollPos(cm, null, diff); + } + + LineWidget.prototype.clear = function() { + var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line); + if (no == null || !ws) return; + for (var i = 0; i < ws.length; ++i) if (ws[i] == this) ws.splice(i--, 1); + if (!ws.length) line.widgets = null; + var height = widgetHeight(this); + updateLineHeight(line, Math.max(0, line.height - height)); + if (cm) runInOp(cm, function() { + adjustScrollWhenAboveVisible(cm, line, -height); + regLineChange(cm, no, "widget"); + }); + }; + LineWidget.prototype.changed = function() { + var oldH = this.height, cm = this.doc.cm, line = this.line; + this.height = null; + var diff = widgetHeight(this) - oldH; + if (!diff) return; + updateLineHeight(line, line.height + diff); + if (cm) runInOp(cm, function() { + cm.curOp.forceUpdate = true; + adjustScrollWhenAboveVisible(cm, line, diff); + }); + }; + + function widgetHeight(widget) { + if (widget.height != null) return widget.height; + var cm = widget.doc.cm; + if (!cm) return 0; + if (!contains(document.body, widget.node)) { + var parentStyle = "position: relative;"; + if (widget.coverGutter) + parentStyle += "margin-left: -" + cm.display.gutters.offsetWidth + "px;"; + if (widget.noHScroll) + parentStyle += "width: " + cm.display.wrapper.clientWidth + "px;"; + removeChildrenAndAdd(cm.display.measure, elt("div", [widget.node], null, parentStyle)); + } + return widget.height = widget.node.parentNode.offsetHeight; + } + + function addLineWidget(doc, handle, node, options) { + var widget = new LineWidget(doc, node, options); + var cm = doc.cm; + if (cm && widget.noHScroll) cm.display.alignWidgets = true; + changeLine(doc, handle, "widget", function(line) { + var widgets = line.widgets || (line.widgets = []); + if (widget.insertAt == null) widgets.push(widget); + else widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget); + widget.line = line; + if (cm && !lineIsHidden(doc, line)) { + var aboveVisible = heightAtLine(line) < doc.scrollTop; + updateLineHeight(line, line.height + widgetHeight(widget)); + if (aboveVisible) addToScrollPos(cm, null, widget.height); + cm.curOp.forceUpdate = true; + } + return true; + }); + return widget; + } + + // LINE DATA STRUCTURE + + // Line objects. These hold state related to a line, including + // highlighting info (the styles array). + var Line = CodeMirror.Line = function(text, markedSpans, estimateHeight) { + this.text = text; + attachMarkedSpans(this, markedSpans); + this.height = estimateHeight ? estimateHeight(this) : 1; + }; + eventMixin(Line); + Line.prototype.lineNo = function() { return lineNo(this); }; + + // Change the content (text, markers) of a line. Automatically + // invalidates cached information and tries to re-estimate the + // line's height. + function updateLine(line, text, markedSpans, estimateHeight) { + line.text = text; + if (line.stateAfter) line.stateAfter = null; + if (line.styles) line.styles = null; + if (line.order != null) line.order = null; + detachMarkedSpans(line); + attachMarkedSpans(line, markedSpans); + var estHeight = estimateHeight ? estimateHeight(line) : 1; + if (estHeight != line.height) updateLineHeight(line, estHeight); + } + + // Detach a line from the document tree and its markers. + function cleanUpLine(line) { + line.parent = null; + detachMarkedSpans(line); + } + + function extractLineClasses(type, output) { + if (type) for (;;) { + var lineClass = type.match(/(?:^|\s+)line-(background-)?(\S+)/); + if (!lineClass) break; + type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length); + var prop = lineClass[1] ? "bgClass" : "textClass"; + if (output[prop] == null) + output[prop] = lineClass[2]; + else if (!(new RegExp("(?:^|\s)" + lineClass[2] + "(?:$|\s)")).test(output[prop])) + output[prop] += " " + lineClass[2]; + } + return type; + } + + function callBlankLine(mode, state) { + if (mode.blankLine) return mode.blankLine(state); + if (!mode.innerMode) return; + var inner = CodeMirror.innerMode(mode, state); + if (inner.mode.blankLine) return inner.mode.blankLine(inner.state); + } + + function readToken(mode, stream, state, inner) { + for (var i = 0; i < 10; i++) { + if (inner) inner[0] = CodeMirror.innerMode(mode, state).mode; + var style = mode.token(stream, state); + if (stream.pos > stream.start) return style; + } + throw new Error("Mode " + mode.name + " failed to advance stream."); + } + + // Utility for getTokenAt and getLineTokens + function takeToken(cm, pos, precise, asArray) { + function getObj(copy) { + return {start: stream.start, end: stream.pos, + string: stream.current(), + type: style || null, + state: copy ? copyState(doc.mode, state) : state}; + } + + var doc = cm.doc, mode = doc.mode, style; + pos = clipPos(doc, pos); + var line = getLine(doc, pos.line), state = getStateBefore(cm, pos.line, precise); + var stream = new StringStream(line.text, cm.options.tabSize), tokens; + if (asArray) tokens = []; + while ((asArray || stream.pos < pos.ch) && !stream.eol()) { + stream.start = stream.pos; + style = readToken(mode, stream, state); + if (asArray) tokens.push(getObj(true)); + } + return asArray ? tokens : getObj(); + } + + // Run the given mode's parser over a line, calling f for each token. + function runMode(cm, text, mode, state, f, lineClasses, forceToEnd) { + var flattenSpans = mode.flattenSpans; + if (flattenSpans == null) flattenSpans = cm.options.flattenSpans; + var curStart = 0, curStyle = null; + var stream = new StringStream(text, cm.options.tabSize), style; + var inner = cm.options.addModeClass && [null]; + if (text == "") extractLineClasses(callBlankLine(mode, state), lineClasses); + while (!stream.eol()) { + if (stream.pos > cm.options.maxHighlightLength) { + flattenSpans = false; + if (forceToEnd) processLine(cm, text, state, stream.pos); + stream.pos = text.length; + style = null; + } else { + style = extractLineClasses(readToken(mode, stream, state, inner), lineClasses); + } + if (inner) { + var mName = inner[0].name; + if (mName) style = "m-" + (style ? mName + " " + style : mName); + } + if (!flattenSpans || curStyle != style) { + while (curStart < stream.start) { + curStart = Math.min(stream.start, curStart + 50000); + f(curStart, curStyle); + } + curStyle = style; + } + stream.start = stream.pos; + } + while (curStart < stream.pos) { + // Webkit seems to refuse to render text nodes longer than 57444 characters + var pos = Math.min(stream.pos, curStart + 50000); + f(pos, curStyle); + curStart = pos; + } + } + + // Compute a style array (an array starting with a mode generation + // -- for invalidation -- followed by pairs of end positions and + // style strings), which is used to highlight the tokens on the + // line. + function highlightLine(cm, line, state, forceToEnd) { + // A styles array always starts with a number identifying the + // mode/overlays that it is based on (for easy invalidation). + var st = [cm.state.modeGen], lineClasses = {}; + // Compute the base array of styles + runMode(cm, line.text, cm.doc.mode, state, function(end, style) { + st.push(end, style); + }, lineClasses, forceToEnd); + + // Run overlays, adjust style array. + for (var o = 0; o < cm.state.overlays.length; ++o) { + var overlay = cm.state.overlays[o], i = 1, at = 0; + runMode(cm, line.text, overlay.mode, true, function(end, style) { + var start = i; + // Ensure there's a token end at the current position, and that i points at it + while (at < end) { + var i_end = st[i]; + if (i_end > end) + st.splice(i, 1, end, st[i+1], i_end); + i += 2; + at = Math.min(end, i_end); + } + if (!style) return; + if (overlay.opaque) { + st.splice(start, i - start, end, "cm-overlay " + style); + i = start + 2; + } else { + for (; start < i; start += 2) { + var cur = st[start+1]; + st[start+1] = (cur ? cur + " " : "") + "cm-overlay " + style; + } + } + }, lineClasses); + } + + return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}; + } + + function getLineStyles(cm, line, updateFrontier) { + if (!line.styles || line.styles[0] != cm.state.modeGen) { + var state = getStateBefore(cm, lineNo(line)); + var result = highlightLine(cm, line, line.text.length > cm.options.maxHighlightLength ? copyState(cm.doc.mode, state) : state); + line.stateAfter = state; + line.styles = result.styles; + if (result.classes) line.styleClasses = result.classes; + else if (line.styleClasses) line.styleClasses = null; + if (updateFrontier === cm.doc.frontier) cm.doc.frontier++; + } + return line.styles; + } + + // Lightweight form of highlight -- proceed over this line and + // update state, but don't save a style array. Used for lines that + // aren't currently visible. + function processLine(cm, text, state, startAt) { + var mode = cm.doc.mode; + var stream = new StringStream(text, cm.options.tabSize); + stream.start = stream.pos = startAt || 0; + if (text == "") callBlankLine(mode, state); + while (!stream.eol()) { + readToken(mode, stream, state); + stream.start = stream.pos; + } + } + + // Convert a style as returned by a mode (either null, or a string + // containing one or more styles) to a CSS style. This is cached, + // and also looks for line-wide styles. + var styleToClassCache = {}, styleToClassCacheWithMode = {}; + function interpretTokenStyle(style, options) { + if (!style || /^\s*$/.test(style)) return null; + var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache; + return cache[style] || + (cache[style] = style.replace(/\S+/g, "cm-$&")); + } + + // Render the DOM representation of the text of a line. Also builds + // up a 'line map', which points at the DOM nodes that represent + // specific stretches of text, and is used by the measuring code. + // The returned object contains the DOM node, this map, and + // information about line-wide styles that were set by the mode. + function buildLineContent(cm, lineView) { + // The padding-right forces the element to have a 'border', which + // is needed on Webkit to be able to get line-level bounding + // rectangles for it (in measureChar). + var content = elt("span", null, null, webkit ? "padding-right: .1px" : null); + var builder = {pre: elt("pre", [content], "CodeMirror-line"), content: content, + col: 0, pos: 0, cm: cm, + splitSpaces: (ie || webkit) && cm.getOption("lineWrapping")}; + lineView.measure = {}; + + // Iterate over the logical lines that make up this visual line. + for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) { + var line = i ? lineView.rest[i - 1] : lineView.line, order; + builder.pos = 0; + builder.addToken = buildToken; + // Optionally wire in some hacks into the token-rendering + // algorithm, to deal with browser quirks. + if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line))) + builder.addToken = buildTokenBadBidi(builder.addToken, order); + builder.map = []; + var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line); + insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate)); + if (line.styleClasses) { + if (line.styleClasses.bgClass) + builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || ""); + if (line.styleClasses.textClass) + builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || ""); + } + + // Ensure at least a single node is present, for measuring. + if (builder.map.length == 0) + builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); + + // Store the map and a cache object for the current logical line + if (i == 0) { + lineView.measure.map = builder.map; + lineView.measure.cache = {}; + } else { + (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map); + (lineView.measure.caches || (lineView.measure.caches = [])).push({}); + } + } + + // See issue #2901 + if (webkit) { + var last = builder.content.lastChild + if (/\bcm-tab\b/.test(last.className) || (last.querySelector && last.querySelector(".cm-tab"))) + builder.content.className = "cm-tab-wrap-hack"; + } + + signal(cm, "renderLine", cm, lineView.line, builder.pre); + if (builder.pre.className) + builder.textClass = joinClasses(builder.pre.className, builder.textClass || ""); + + return builder; + } + + function defaultSpecialCharPlaceholder(ch) { + var token = elt("span", "\u2022", "cm-invalidchar"); + token.title = "\\u" + ch.charCodeAt(0).toString(16); + token.setAttribute("aria-label", token.title); + return token; + } + + // Build up the DOM representation for a single token, and add it to + // the line map. Takes care to render special characters separately. + function buildToken(builder, text, style, startStyle, endStyle, title, css) { + if (!text) return; + var displayText = builder.splitSpaces ? text.replace(/ {3,}/g, splitSpaces) : text; + var special = builder.cm.state.specialChars, mustWrap = false; + if (!special.test(text)) { + builder.col += text.length; + var content = document.createTextNode(displayText); + builder.map.push(builder.pos, builder.pos + text.length, content); + if (ie && ie_version < 9) mustWrap = true; + builder.pos += text.length; + } else { + var content = document.createDocumentFragment(), pos = 0; + while (true) { + special.lastIndex = pos; + var m = special.exec(text); + var skipped = m ? m.index - pos : text.length - pos; + if (skipped) { + var txt = document.createTextNode(displayText.slice(pos, pos + skipped)); + if (ie && ie_version < 9) content.appendChild(elt("span", [txt])); + else content.appendChild(txt); + builder.map.push(builder.pos, builder.pos + skipped, txt); + builder.col += skipped; + builder.pos += skipped; + } + if (!m) break; + pos += skipped + 1; + if (m[0] == "\t") { + var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize; + var txt = content.appendChild(elt("span", spaceStr(tabWidth), "cm-tab")); + txt.setAttribute("role", "presentation"); + txt.setAttribute("cm-text", "\t"); + builder.col += tabWidth; + } else if (m[0] == "\r" || m[0] == "\n") { + var txt = content.appendChild(elt("span", m[0] == "\r" ? "\u240d" : "\u2424", "cm-invalidchar")); + txt.setAttribute("cm-text", m[0]); + builder.col += 1; + } else { + var txt = builder.cm.options.specialCharPlaceholder(m[0]); + txt.setAttribute("cm-text", m[0]); + if (ie && ie_version < 9) content.appendChild(elt("span", [txt])); + else content.appendChild(txt); + builder.col += 1; + } + builder.map.push(builder.pos, builder.pos + 1, txt); + builder.pos++; + } + } + if (style || startStyle || endStyle || mustWrap || css) { + var fullStyle = style || ""; + if (startStyle) fullStyle += startStyle; + if (endStyle) fullStyle += endStyle; + var token = elt("span", [content], fullStyle, css); + if (title) token.title = title; + return builder.content.appendChild(token); + } + builder.content.appendChild(content); + } + + function splitSpaces(old) { + var out = " "; + for (var i = 0; i < old.length - 2; ++i) out += i % 2 ? " " : "\u00a0"; + out += " "; + return out; + } + + // Work around nonsense dimensions being reported for stretches of + // right-to-left text. + function buildTokenBadBidi(inner, order) { + return function(builder, text, style, startStyle, endStyle, title, css) { + style = style ? style + " cm-force-border" : "cm-force-border"; + var start = builder.pos, end = start + text.length; + for (;;) { + // Find the part that overlaps with the start of this text + for (var i = 0; i < order.length; i++) { + var part = order[i]; + if (part.to > start && part.from <= start) break; + } + if (part.to >= end) return inner(builder, text, style, startStyle, endStyle, title, css); + inner(builder, text.slice(0, part.to - start), style, startStyle, null, title, css); + startStyle = null; + text = text.slice(part.to - start); + start = part.to; + } + }; + } + + function buildCollapsedSpan(builder, size, marker, ignoreWidget) { + var widget = !ignoreWidget && marker.widgetNode; + if (widget) builder.map.push(builder.pos, builder.pos + size, widget); + if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) { + if (!widget) + widget = builder.content.appendChild(document.createElement("span")); + widget.setAttribute("cm-marker", marker.id); + } + if (widget) { + builder.cm.display.input.setUneditable(widget); + builder.content.appendChild(widget); + } + builder.pos += size; + } + + // Outputs a number of spans to make up a line, taking highlighting + // and marked text into account. + function insertLineContent(line, builder, styles) { + var spans = line.markedSpans, allText = line.text, at = 0; + if (!spans) { + for (var i = 1; i < styles.length; i+=2) + builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options)); + return; + } + + var len = allText.length, pos = 0, i = 1, text = "", style, css; + var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed; + for (;;) { + if (nextChange == pos) { // Update current marker set + spanStyle = spanEndStyle = spanStartStyle = title = css = ""; + collapsed = null; nextChange = Infinity; + var foundBookmarks = [], endStyles + for (var j = 0; j < spans.length; ++j) { + var sp = spans[j], m = sp.marker; + if (m.type == "bookmark" && sp.from == pos && m.widgetNode) { + foundBookmarks.push(m); + } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) { + if (sp.to != null && sp.to != pos && nextChange > sp.to) { + nextChange = sp.to; + spanEndStyle = ""; + } + if (m.className) spanStyle += " " + m.className; + if (m.css) css = (css ? css + ";" : "") + m.css; + if (m.startStyle && sp.from == pos) spanStartStyle += " " + m.startStyle; + if (m.endStyle && sp.to == nextChange) (endStyles || (endStyles = [])).push(m.endStyle, sp.to) + if (m.title && !title) title = m.title; + if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0)) + collapsed = sp; + } else if (sp.from > pos && nextChange > sp.from) { + nextChange = sp.from; + } + } + if (endStyles) for (var j = 0; j < endStyles.length; j += 2) + if (endStyles[j + 1] == nextChange) spanEndStyle += " " + endStyles[j] + + if (!collapsed || collapsed.from == pos) for (var j = 0; j < foundBookmarks.length; ++j) + buildCollapsedSpan(builder, 0, foundBookmarks[j]); + if (collapsed && (collapsed.from || 0) == pos) { + buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos, + collapsed.marker, collapsed.from == null); + if (collapsed.to == null) return; + if (collapsed.to == pos) collapsed = false; + } + } + if (pos >= len) break; + + var upto = Math.min(len, nextChange); + while (true) { + if (text) { + var end = pos + text.length; + if (!collapsed) { + var tokenText = end > upto ? text.slice(0, upto - pos) : text; + builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle, + spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : "", title, css); + } + if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;} + pos = end; + spanStartStyle = ""; + } + text = allText.slice(at, at = styles[i++]); + style = interpretTokenStyle(styles[i++], builder.cm.options); + } + } + } + + // DOCUMENT DATA STRUCTURE + + // By default, updates that start and end at the beginning of a line + // are treated specially, in order to make the association of line + // widgets and marker elements with the text behave more intuitive. + function isWholeLineUpdate(doc, change) { + return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == "" && + (!doc.cm || doc.cm.options.wholeLineUpdateBefore); + } + + // Perform a change on the document data structure. + function updateDoc(doc, change, markedSpans, estimateHeight) { + function spansFor(n) {return markedSpans ? markedSpans[n] : null;} + function update(line, text, spans) { + updateLine(line, text, spans, estimateHeight); + signalLater(line, "change", line, change); + } + function linesFor(start, end) { + for (var i = start, result = []; i < end; ++i) + result.push(new Line(text[i], spansFor(i), estimateHeight)); + return result; + } + + var from = change.from, to = change.to, text = change.text; + var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line); + var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line; + + // Adjust the line structure + if (change.full) { + doc.insert(0, linesFor(0, text.length)); + doc.remove(text.length, doc.size - text.length); + } else if (isWholeLineUpdate(doc, change)) { + // This is a whole-line replace. Treated specially to make + // sure line objects move the way they are supposed to. + var added = linesFor(0, text.length - 1); + update(lastLine, lastLine.text, lastSpans); + if (nlines) doc.remove(from.line, nlines); + if (added.length) doc.insert(from.line, added); + } else if (firstLine == lastLine) { + if (text.length == 1) { + update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans); + } else { + var added = linesFor(1, text.length - 1); + added.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight)); + update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)); + doc.insert(from.line + 1, added); + } + } else if (text.length == 1) { + update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0)); + doc.remove(from.line + 1, nlines); + } else { + update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)); + update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans); + var added = linesFor(1, text.length - 1); + if (nlines > 1) doc.remove(from.line + 1, nlines - 1); + doc.insert(from.line + 1, added); + } + + signalLater(doc, "change", doc, change); + } + + // The document is represented as a BTree consisting of leaves, with + // chunk of lines in them, and branches, with up to ten leaves or + // other branch nodes below them. The top node is always a branch + // node, and is the document object itself (meaning it has + // additional methods and properties). + // + // All nodes have parent links. The tree is used both to go from + // line numbers to line objects, and to go from objects to numbers. + // It also indexes by height, and is used to convert between height + // and line object, and to find the total height of the document. + // + // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html + + function LeafChunk(lines) { + this.lines = lines; + this.parent = null; + for (var i = 0, height = 0; i < lines.length; ++i) { + lines[i].parent = this; + height += lines[i].height; + } + this.height = height; + } + + LeafChunk.prototype = { + chunkSize: function() { return this.lines.length; }, + // Remove the n lines at offset 'at'. + removeInner: function(at, n) { + for (var i = at, e = at + n; i < e; ++i) { + var line = this.lines[i]; + this.height -= line.height; + cleanUpLine(line); + signalLater(line, "delete"); + } + this.lines.splice(at, n); + }, + // Helper used to collapse a small branch into a single leaf. + collapse: function(lines) { + lines.push.apply(lines, this.lines); + }, + // Insert the given array of lines at offset 'at', count them as + // having the given height. + insertInner: function(at, lines, height) { + this.height += height; + this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at)); + for (var i = 0; i < lines.length; ++i) lines[i].parent = this; + }, + // Used to iterate over a part of the tree. + iterN: function(at, n, op) { + for (var e = at + n; at < e; ++at) + if (op(this.lines[at])) return true; + } + }; + + function BranchChunk(children) { + this.children = children; + var size = 0, height = 0; + for (var i = 0; i < children.length; ++i) { + var ch = children[i]; + size += ch.chunkSize(); height += ch.height; + ch.parent = this; + } + this.size = size; + this.height = height; + this.parent = null; + } + + BranchChunk.prototype = { + chunkSize: function() { return this.size; }, + removeInner: function(at, n) { + this.size -= n; + for (var i = 0; i < this.children.length; ++i) { + var child = this.children[i], sz = child.chunkSize(); + if (at < sz) { + var rm = Math.min(n, sz - at), oldHeight = child.height; + child.removeInner(at, rm); + this.height -= oldHeight - child.height; + if (sz == rm) { this.children.splice(i--, 1); child.parent = null; } + if ((n -= rm) == 0) break; + at = 0; + } else at -= sz; + } + // If the result is smaller than 25 lines, ensure that it is a + // single leaf node. + if (this.size - n < 25 && + (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) { + var lines = []; + this.collapse(lines); + this.children = [new LeafChunk(lines)]; + this.children[0].parent = this; + } + }, + collapse: function(lines) { + for (var i = 0; i < this.children.length; ++i) this.children[i].collapse(lines); + }, + insertInner: function(at, lines, height) { + this.size += lines.length; + this.height += height; + for (var i = 0; i < this.children.length; ++i) { + var child = this.children[i], sz = child.chunkSize(); + if (at <= sz) { + child.insertInner(at, lines, height); + if (child.lines && child.lines.length > 50) { + // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced. + // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest. + var remaining = child.lines.length % 25 + 25 + for (var pos = remaining; pos < child.lines.length;) { + var leaf = new LeafChunk(child.lines.slice(pos, pos += 25)); + child.height -= leaf.height; + this.children.splice(++i, 0, leaf); + leaf.parent = this; + } + child.lines = child.lines.slice(0, remaining); + this.maybeSpill(); + } + break; + } + at -= sz; + } + }, + // When a node has grown, check whether it should be split. + maybeSpill: function() { + if (this.children.length <= 10) return; + var me = this; + do { + var spilled = me.children.splice(me.children.length - 5, 5); + var sibling = new BranchChunk(spilled); + if (!me.parent) { // Become the parent node + var copy = new BranchChunk(me.children); + copy.parent = me; + me.children = [copy, sibling]; + me = copy; + } else { + me.size -= sibling.size; + me.height -= sibling.height; + var myIndex = indexOf(me.parent.children, me); + me.parent.children.splice(myIndex + 1, 0, sibling); + } + sibling.parent = me.parent; + } while (me.children.length > 10); + me.parent.maybeSpill(); + }, + iterN: function(at, n, op) { + for (var i = 0; i < this.children.length; ++i) { + var child = this.children[i], sz = child.chunkSize(); + if (at < sz) { + var used = Math.min(n, sz - at); + if (child.iterN(at, used, op)) return true; + if ((n -= used) == 0) break; + at = 0; + } else at -= sz; + } + } + }; + + var nextDocId = 0; + var Doc = CodeMirror.Doc = function(text, mode, firstLine, lineSep) { + if (!(this instanceof Doc)) return new Doc(text, mode, firstLine, lineSep); + if (firstLine == null) firstLine = 0; + + BranchChunk.call(this, [new LeafChunk([new Line("", null)])]); + this.first = firstLine; + this.scrollTop = this.scrollLeft = 0; + this.cantEdit = false; + this.cleanGeneration = 1; + this.frontier = firstLine; + var start = Pos(firstLine, 0); + this.sel = simpleSelection(start); + this.history = new History(null); + this.id = ++nextDocId; + this.modeOption = mode; + this.lineSep = lineSep; + this.extend = false; + + if (typeof text == "string") text = this.splitLines(text); + updateDoc(this, {from: start, to: start, text: text}); + setSelection(this, simpleSelection(start), sel_dontScroll); + }; + + Doc.prototype = createObj(BranchChunk.prototype, { + constructor: Doc, + // Iterate over the document. Supports two forms -- with only one + // argument, it calls that for each line in the document. With + // three, it iterates over the range given by the first two (with + // the second being non-inclusive). + iter: function(from, to, op) { + if (op) this.iterN(from - this.first, to - from, op); + else this.iterN(this.first, this.first + this.size, from); + }, + + // Non-public interface for adding and removing lines. + insert: function(at, lines) { + var height = 0; + for (var i = 0; i < lines.length; ++i) height += lines[i].height; + this.insertInner(at - this.first, lines, height); + }, + remove: function(at, n) { this.removeInner(at - this.first, n); }, + + // From here, the methods are part of the public interface. Most + // are also available from CodeMirror (editor) instances. + + getValue: function(lineSep) { + var lines = getLines(this, this.first, this.first + this.size); + if (lineSep === false) return lines; + return lines.join(lineSep || this.lineSeparator()); + }, + setValue: docMethodOp(function(code) { + var top = Pos(this.first, 0), last = this.first + this.size - 1; + makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length), + text: this.splitLines(code), origin: "setValue", full: true}, true); + setSelection(this, simpleSelection(top)); + }), + replaceRange: function(code, from, to, origin) { + from = clipPos(this, from); + to = to ? clipPos(this, to) : from; + replaceRange(this, code, from, to, origin); + }, + getRange: function(from, to, lineSep) { + var lines = getBetween(this, clipPos(this, from), clipPos(this, to)); + if (lineSep === false) return lines; + return lines.join(lineSep || this.lineSeparator()); + }, + + getLine: function(line) {var l = this.getLineHandle(line); return l && l.text;}, + + getLineHandle: function(line) {if (isLine(this, line)) return getLine(this, line);}, + getLineNumber: function(line) {return lineNo(line);}, + + getLineHandleVisualStart: function(line) { + if (typeof line == "number") line = getLine(this, line); + return visualLine(line); + }, + + lineCount: function() {return this.size;}, + firstLine: function() {return this.first;}, + lastLine: function() {return this.first + this.size - 1;}, + + clipPos: function(pos) {return clipPos(this, pos);}, + + getCursor: function(start) { + var range = this.sel.primary(), pos; + if (start == null || start == "head") pos = range.head; + else if (start == "anchor") pos = range.anchor; + else if (start == "end" || start == "to" || start === false) pos = range.to(); + else pos = range.from(); + return pos; + }, + listSelections: function() { return this.sel.ranges; }, + somethingSelected: function() {return this.sel.somethingSelected();}, + + setCursor: docMethodOp(function(line, ch, options) { + setSimpleSelection(this, clipPos(this, typeof line == "number" ? Pos(line, ch || 0) : line), null, options); + }), + setSelection: docMethodOp(function(anchor, head, options) { + setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options); + }), + extendSelection: docMethodOp(function(head, other, options) { + extendSelection(this, clipPos(this, head), other && clipPos(this, other), options); + }), + extendSelections: docMethodOp(function(heads, options) { + extendSelections(this, clipPosArray(this, heads), options); + }), + extendSelectionsBy: docMethodOp(function(f, options) { + var heads = map(this.sel.ranges, f); + extendSelections(this, clipPosArray(this, heads), options); + }), + setSelections: docMethodOp(function(ranges, primary, options) { + if (!ranges.length) return; + for (var i = 0, out = []; i < ranges.length; i++) + out[i] = new Range(clipPos(this, ranges[i].anchor), + clipPos(this, ranges[i].head)); + if (primary == null) primary = Math.min(ranges.length - 1, this.sel.primIndex); + setSelection(this, normalizeSelection(out, primary), options); + }), + addSelection: docMethodOp(function(anchor, head, options) { + var ranges = this.sel.ranges.slice(0); + ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor))); + setSelection(this, normalizeSelection(ranges, ranges.length - 1), options); + }), + + getSelection: function(lineSep) { + var ranges = this.sel.ranges, lines; + for (var i = 0; i < ranges.length; i++) { + var sel = getBetween(this, ranges[i].from(), ranges[i].to()); + lines = lines ? lines.concat(sel) : sel; + } + if (lineSep === false) return lines; + else return lines.join(lineSep || this.lineSeparator()); + }, + getSelections: function(lineSep) { + var parts = [], ranges = this.sel.ranges; + for (var i = 0; i < ranges.length; i++) { + var sel = getBetween(this, ranges[i].from(), ranges[i].to()); + if (lineSep !== false) sel = sel.join(lineSep || this.lineSeparator()); + parts[i] = sel; + } + return parts; + }, + replaceSelection: function(code, collapse, origin) { + var dup = []; + for (var i = 0; i < this.sel.ranges.length; i++) + dup[i] = code; + this.replaceSelections(dup, collapse, origin || "+input"); + }, + replaceSelections: docMethodOp(function(code, collapse, origin) { + var changes = [], sel = this.sel; + for (var i = 0; i < sel.ranges.length; i++) { + var range = sel.ranges[i]; + changes[i] = {from: range.from(), to: range.to(), text: this.splitLines(code[i]), origin: origin}; + } + var newSel = collapse && collapse != "end" && computeReplacedSel(this, changes, collapse); + for (var i = changes.length - 1; i >= 0; i--) + makeChange(this, changes[i]); + if (newSel) setSelectionReplaceHistory(this, newSel); + else if (this.cm) ensureCursorVisible(this.cm); + }), + undo: docMethodOp(function() {makeChangeFromHistory(this, "undo");}), + redo: docMethodOp(function() {makeChangeFromHistory(this, "redo");}), + undoSelection: docMethodOp(function() {makeChangeFromHistory(this, "undo", true);}), + redoSelection: docMethodOp(function() {makeChangeFromHistory(this, "redo", true);}), + + setExtending: function(val) {this.extend = val;}, + getExtending: function() {return this.extend;}, + + historySize: function() { + var hist = this.history, done = 0, undone = 0; + for (var i = 0; i < hist.done.length; i++) if (!hist.done[i].ranges) ++done; + for (var i = 0; i < hist.undone.length; i++) if (!hist.undone[i].ranges) ++undone; + return {undo: done, redo: undone}; + }, + clearHistory: function() {this.history = new History(this.history.maxGeneration);}, + + markClean: function() { + this.cleanGeneration = this.changeGeneration(true); + }, + changeGeneration: function(forceSplit) { + if (forceSplit) + this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null; + return this.history.generation; + }, + isClean: function (gen) { + return this.history.generation == (gen || this.cleanGeneration); + }, + + getHistory: function() { + return {done: copyHistoryArray(this.history.done), + undone: copyHistoryArray(this.history.undone)}; + }, + setHistory: function(histData) { + var hist = this.history = new History(this.history.maxGeneration); + hist.done = copyHistoryArray(histData.done.slice(0), null, true); + hist.undone = copyHistoryArray(histData.undone.slice(0), null, true); + }, + + addLineClass: docMethodOp(function(handle, where, cls) { + return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function(line) { + var prop = where == "text" ? "textClass" + : where == "background" ? "bgClass" + : where == "gutter" ? "gutterClass" : "wrapClass"; + if (!line[prop]) line[prop] = cls; + else if (classTest(cls).test(line[prop])) return false; + else line[prop] += " " + cls; + return true; + }); + }), + removeLineClass: docMethodOp(function(handle, where, cls) { + return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function(line) { + var prop = where == "text" ? "textClass" + : where == "background" ? "bgClass" + : where == "gutter" ? "gutterClass" : "wrapClass"; + var cur = line[prop]; + if (!cur) return false; + else if (cls == null) line[prop] = null; + else { + var found = cur.match(classTest(cls)); + if (!found) return false; + var end = found.index + found[0].length; + line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? "" : " ") + cur.slice(end) || null; + } + return true; + }); + }), + + addLineWidget: docMethodOp(function(handle, node, options) { + return addLineWidget(this, handle, node, options); + }), + removeLineWidget: function(widget) { widget.clear(); }, + + markText: function(from, to, options) { + return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || "range"); + }, + setBookmark: function(pos, options) { + var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options), + insertLeft: options && options.insertLeft, + clearWhenEmpty: false, shared: options && options.shared, + handleMouseEvents: options && options.handleMouseEvents}; + pos = clipPos(this, pos); + return markText(this, pos, pos, realOpts, "bookmark"); + }, + findMarksAt: function(pos) { + pos = clipPos(this, pos); + var markers = [], spans = getLine(this, pos.line).markedSpans; + if (spans) for (var i = 0; i < spans.length; ++i) { + var span = spans[i]; + if ((span.from == null || span.from <= pos.ch) && + (span.to == null || span.to >= pos.ch)) + markers.push(span.marker.parent || span.marker); + } + return markers; + }, + findMarks: function(from, to, filter) { + from = clipPos(this, from); to = clipPos(this, to); + var found = [], lineNo = from.line; + this.iter(from.line, to.line + 1, function(line) { + var spans = line.markedSpans; + if (spans) for (var i = 0; i < spans.length; i++) { + var span = spans[i]; + if (!(span.to != null && lineNo == from.line && from.ch >= span.to || + span.from == null && lineNo != from.line || + span.from != null && lineNo == to.line && span.from >= to.ch) && + (!filter || filter(span.marker))) + found.push(span.marker.parent || span.marker); + } + ++lineNo; + }); + return found; + }, + getAllMarks: function() { + var markers = []; + this.iter(function(line) { + var sps = line.markedSpans; + if (sps) for (var i = 0; i < sps.length; ++i) + if (sps[i].from != null) markers.push(sps[i].marker); + }); + return markers; + }, + + posFromIndex: function(off) { + var ch, lineNo = this.first, sepSize = this.lineSeparator().length; + this.iter(function(line) { + var sz = line.text.length + sepSize; + if (sz > off) { ch = off; return true; } + off -= sz; + ++lineNo; + }); + return clipPos(this, Pos(lineNo, ch)); + }, + indexFromPos: function (coords) { + coords = clipPos(this, coords); + var index = coords.ch; + if (coords.line < this.first || coords.ch < 0) return 0; + var sepSize = this.lineSeparator().length; + this.iter(this.first, coords.line, function (line) { + index += line.text.length + sepSize; + }); + return index; + }, + + copy: function(copyHistory) { + var doc = new Doc(getLines(this, this.first, this.first + this.size), + this.modeOption, this.first, this.lineSep); + doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft; + doc.sel = this.sel; + doc.extend = false; + if (copyHistory) { + doc.history.undoDepth = this.history.undoDepth; + doc.setHistory(this.getHistory()); + } + return doc; + }, + + linkedDoc: function(options) { + if (!options) options = {}; + var from = this.first, to = this.first + this.size; + if (options.from != null && options.from > from) from = options.from; + if (options.to != null && options.to < to) to = options.to; + var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep); + if (options.sharedHist) copy.history = this.history; + (this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist}); + copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}]; + copySharedMarkers(copy, findSharedMarkers(this)); + return copy; + }, + unlinkDoc: function(other) { + if (other instanceof CodeMirror) other = other.doc; + if (this.linked) for (var i = 0; i < this.linked.length; ++i) { + var link = this.linked[i]; + if (link.doc != other) continue; + this.linked.splice(i, 1); + other.unlinkDoc(this); + detachSharedMarkers(findSharedMarkers(this)); + break; + } + // If the histories were shared, split them again + if (other.history == this.history) { + var splitIds = [other.id]; + linkedDocs(other, function(doc) {splitIds.push(doc.id);}, true); + other.history = new History(null); + other.history.done = copyHistoryArray(this.history.done, splitIds); + other.history.undone = copyHistoryArray(this.history.undone, splitIds); + } + }, + iterLinkedDocs: function(f) {linkedDocs(this, f);}, + + getMode: function() {return this.mode;}, + getEditor: function() {return this.cm;}, + + splitLines: function(str) { + if (this.lineSep) return str.split(this.lineSep); + return splitLinesAuto(str); + }, + lineSeparator: function() { return this.lineSep || "\n"; } + }); + + // Public alias. + Doc.prototype.eachLine = Doc.prototype.iter; + + // Set up methods on CodeMirror's prototype to redirect to the editor's document. + var dontDelegate = "iter insert remove copy getEditor constructor".split(" "); + for (var prop in Doc.prototype) if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0) + CodeMirror.prototype[prop] = (function(method) { + return function() {return method.apply(this.doc, arguments);}; + })(Doc.prototype[prop]); + + eventMixin(Doc); + + // Call f for all linked documents. + function linkedDocs(doc, f, sharedHistOnly) { + function propagate(doc, skip, sharedHist) { + if (doc.linked) for (var i = 0; i < doc.linked.length; ++i) { + var rel = doc.linked[i]; + if (rel.doc == skip) continue; + var shared = sharedHist && rel.sharedHist; + if (sharedHistOnly && !shared) continue; + f(rel.doc, shared); + propagate(rel.doc, doc, shared); + } + } + propagate(doc, null, true); + } + + // Attach a document to an editor. + function attachDoc(cm, doc) { + if (doc.cm) throw new Error("This document is already in use."); + cm.doc = doc; + doc.cm = cm; + estimateLineHeights(cm); + loadMode(cm); + if (!cm.options.lineWrapping) findMaxLine(cm); + cm.options.mode = doc.modeOption; + regChange(cm); + } + + // LINE UTILITIES + + // Find the line object corresponding to the given line number. + function getLine(doc, n) { + n -= doc.first; + if (n < 0 || n >= doc.size) throw new Error("There is no line " + (n + doc.first) + " in the document."); + for (var chunk = doc; !chunk.lines;) { + for (var i = 0;; ++i) { + var child = chunk.children[i], sz = child.chunkSize(); + if (n < sz) { chunk = child; break; } + n -= sz; + } + } + return chunk.lines[n]; + } + + // Get the part of a document between two positions, as an array of + // strings. + function getBetween(doc, start, end) { + var out = [], n = start.line; + doc.iter(start.line, end.line + 1, function(line) { + var text = line.text; + if (n == end.line) text = text.slice(0, end.ch); + if (n == start.line) text = text.slice(start.ch); + out.push(text); + ++n; + }); + return out; + } + // Get the lines between from and to, as array of strings. + function getLines(doc, from, to) { + var out = []; + doc.iter(from, to, function(line) { out.push(line.text); }); + return out; + } + + // Update the height of a line, propagating the height change + // upwards to parent nodes. + function updateLineHeight(line, height) { + var diff = height - line.height; + if (diff) for (var n = line; n; n = n.parent) n.height += diff; + } + + // Given a line object, find its line number by walking up through + // its parent links. + function lineNo(line) { + if (line.parent == null) return null; + var cur = line.parent, no = indexOf(cur.lines, line); + for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) { + for (var i = 0;; ++i) { + if (chunk.children[i] == cur) break; + no += chunk.children[i].chunkSize(); + } + } + return no + cur.first; + } + + // Find the line at the given vertical position, using the height + // information in the document tree. + function lineAtHeight(chunk, h) { + var n = chunk.first; + outer: do { + for (var i = 0; i < chunk.children.length; ++i) { + var child = chunk.children[i], ch = child.height; + if (h < ch) { chunk = child; continue outer; } + h -= ch; + n += child.chunkSize(); + } + return n; + } while (!chunk.lines); + for (var i = 0; i < chunk.lines.length; ++i) { + var line = chunk.lines[i], lh = line.height; + if (h < lh) break; + h -= lh; + } + return n + i; + } + + + // Find the height above the given line. + function heightAtLine(lineObj) { + lineObj = visualLine(lineObj); + + var h = 0, chunk = lineObj.parent; + for (var i = 0; i < chunk.lines.length; ++i) { + var line = chunk.lines[i]; + if (line == lineObj) break; + else h += line.height; + } + for (var p = chunk.parent; p; chunk = p, p = chunk.parent) { + for (var i = 0; i < p.children.length; ++i) { + var cur = p.children[i]; + if (cur == chunk) break; + else h += cur.height; + } + } + return h; + } + + // Get the bidi ordering for the given line (and cache it). Returns + // false for lines that are fully left-to-right, and an array of + // BidiSpan objects otherwise. + function getOrder(line) { + var order = line.order; + if (order == null) order = line.order = bidiOrdering(line.text); + return order; + } + + // HISTORY + + function History(startGen) { + // Arrays of change events and selections. Doing something adds an + // event to done and clears undo. Undoing moves events from done + // to undone, redoing moves them in the other direction. + this.done = []; this.undone = []; + this.undoDepth = Infinity; + // Used to track when changes can be merged into a single undo + // event + this.lastModTime = this.lastSelTime = 0; + this.lastOp = this.lastSelOp = null; + this.lastOrigin = this.lastSelOrigin = null; + // Used by the isClean() method + this.generation = this.maxGeneration = startGen || 1; + } + + // Create a history change event from an updateDoc-style change + // object. + function historyChangeFromChange(doc, change) { + var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)}; + attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); + linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true); + return histChange; + } + + // Pop all selection events off the end of a history array. Stop at + // a change event. + function clearSelectionEvents(array) { + while (array.length) { + var last = lst(array); + if (last.ranges) array.pop(); + else break; + } + } + + // Find the top change event in the history. Pop off selection + // events that are in the way. + function lastChangeEvent(hist, force) { + if (force) { + clearSelectionEvents(hist.done); + return lst(hist.done); + } else if (hist.done.length && !lst(hist.done).ranges) { + return lst(hist.done); + } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) { + hist.done.pop(); + return lst(hist.done); + } + } + + // Register a change in the history. Merges changes that are within + // a single operation, ore are close together with an origin that + // allows merging (starting with "+") into a single event. + function addChangeToHistory(doc, change, selAfter, opId) { + var hist = doc.history; + hist.undone.length = 0; + var time = +new Date, cur; + + if ((hist.lastOp == opId || + hist.lastOrigin == change.origin && change.origin && + ((change.origin.charAt(0) == "+" && doc.cm && hist.lastModTime > time - doc.cm.options.historyEventDelay) || + change.origin.charAt(0) == "*")) && + (cur = lastChangeEvent(hist, hist.lastOp == opId))) { + // Merge this change into the last event + var last = lst(cur.changes); + if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) { + // Optimized case for simple insertion -- don't want to add + // new changesets for every character typed + last.to = changeEnd(change); + } else { + // Add new sub-event + cur.changes.push(historyChangeFromChange(doc, change)); + } + } else { + // Can not be merged, start a new event. + var before = lst(hist.done); + if (!before || !before.ranges) + pushSelectionToHistory(doc.sel, hist.done); + cur = {changes: [historyChangeFromChange(doc, change)], + generation: hist.generation}; + hist.done.push(cur); + while (hist.done.length > hist.undoDepth) { + hist.done.shift(); + if (!hist.done[0].ranges) hist.done.shift(); + } + } + hist.done.push(selAfter); + hist.generation = ++hist.maxGeneration; + hist.lastModTime = hist.lastSelTime = time; + hist.lastOp = hist.lastSelOp = opId; + hist.lastOrigin = hist.lastSelOrigin = change.origin; + + if (!last) signal(doc, "historyAdded"); + } + + function selectionEventCanBeMerged(doc, origin, prev, sel) { + var ch = origin.charAt(0); + return ch == "*" || + ch == "+" && + prev.ranges.length == sel.ranges.length && + prev.somethingSelected() == sel.somethingSelected() && + new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500); + } + + // Called whenever the selection changes, sets the new selection as + // the pending selection in the history, and pushes the old pending + // selection into the 'done' array when it was significantly + // different (in number of selected ranges, emptiness, or time). + function addSelectionToHistory(doc, sel, opId, options) { + var hist = doc.history, origin = options && options.origin; + + // A new event is started when the previous origin does not match + // the current, or the origins don't allow matching. Origins + // starting with * are always merged, those starting with + are + // merged when similar and close together in time. + if (opId == hist.lastSelOp || + (origin && hist.lastSelOrigin == origin && + (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin || + selectionEventCanBeMerged(doc, origin, lst(hist.done), sel)))) + hist.done[hist.done.length - 1] = sel; + else + pushSelectionToHistory(sel, hist.done); + + hist.lastSelTime = +new Date; + hist.lastSelOrigin = origin; + hist.lastSelOp = opId; + if (options && options.clearRedo !== false) + clearSelectionEvents(hist.undone); + } + + function pushSelectionToHistory(sel, dest) { + var top = lst(dest); + if (!(top && top.ranges && top.equals(sel))) + dest.push(sel); + } + + // Used to store marked span information in the history. + function attachLocalSpans(doc, change, from, to) { + var existing = change["spans_" + doc.id], n = 0; + doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function(line) { + if (line.markedSpans) + (existing || (existing = change["spans_" + doc.id] = {}))[n] = line.markedSpans; + ++n; + }); + } + + // When un/re-doing restores text containing marked spans, those + // that have been explicitly cleared should not be restored. + function removeClearedSpans(spans) { + if (!spans) return null; + for (var i = 0, out; i < spans.length; ++i) { + if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); } + else if (out) out.push(spans[i]); + } + return !out ? spans : out.length ? out : null; + } + + // Retrieve and filter the old marked spans stored in a change event. + function getOldSpans(doc, change) { + var found = change["spans_" + doc.id]; + if (!found) return null; + for (var i = 0, nw = []; i < change.text.length; ++i) + nw.push(removeClearedSpans(found[i])); + return nw; + } + + // Used both to provide a JSON-safe object in .getHistory, and, when + // detaching a document, to split the history in two + function copyHistoryArray(events, newGroup, instantiateSel) { + for (var i = 0, copy = []; i < events.length; ++i) { + var event = events[i]; + if (event.ranges) { + copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event); + continue; + } + var changes = event.changes, newChanges = []; + copy.push({changes: newChanges}); + for (var j = 0; j < changes.length; ++j) { + var change = changes[j], m; + newChanges.push({from: change.from, to: change.to, text: change.text}); + if (newGroup) for (var prop in change) if (m = prop.match(/^spans_(\d+)$/)) { + if (indexOf(newGroup, Number(m[1])) > -1) { + lst(newChanges)[prop] = change[prop]; + delete change[prop]; + } + } + } + } + return copy; + } + + // Rebasing/resetting history to deal with externally-sourced changes + + function rebaseHistSelSingle(pos, from, to, diff) { + if (to < pos.line) { + pos.line += diff; + } else if (from < pos.line) { + pos.line = from; + pos.ch = 0; + } + } + + // Tries to rebase an array of history events given a change in the + // document. If the change touches the same lines as the event, the + // event, and everything 'behind' it, is discarded. If the change is + // before the event, the event's positions are updated. Uses a + // copy-on-write scheme for the positions, to avoid having to + // reallocate them all on every rebase, but also avoid problems with + // shared position objects being unsafely updated. + function rebaseHistArray(array, from, to, diff) { + for (var i = 0; i < array.length; ++i) { + var sub = array[i], ok = true; + if (sub.ranges) { + if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true; } + for (var j = 0; j < sub.ranges.length; j++) { + rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff); + rebaseHistSelSingle(sub.ranges[j].head, from, to, diff); + } + continue; + } + for (var j = 0; j < sub.changes.length; ++j) { + var cur = sub.changes[j]; + if (to < cur.from.line) { + cur.from = Pos(cur.from.line + diff, cur.from.ch); + cur.to = Pos(cur.to.line + diff, cur.to.ch); + } else if (from <= cur.to.line) { + ok = false; + break; + } + } + if (!ok) { + array.splice(0, i + 1); + i = 0; + } + } + } + + function rebaseHist(hist, change) { + var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1; + rebaseHistArray(hist.done, from, to, diff); + rebaseHistArray(hist.undone, from, to, diff); + } + + // EVENT UTILITIES + + // Due to the fact that we still support jurassic IE versions, some + // compatibility wrappers are needed. + + var e_preventDefault = CodeMirror.e_preventDefault = function(e) { + if (e.preventDefault) e.preventDefault(); + else e.returnValue = false; + }; + var e_stopPropagation = CodeMirror.e_stopPropagation = function(e) { + if (e.stopPropagation) e.stopPropagation(); + else e.cancelBubble = true; + }; + function e_defaultPrevented(e) { + return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false; + } + var e_stop = CodeMirror.e_stop = function(e) {e_preventDefault(e); e_stopPropagation(e);}; + + function e_target(e) {return e.target || e.srcElement;} + function e_button(e) { + var b = e.which; + if (b == null) { + if (e.button & 1) b = 1; + else if (e.button & 2) b = 3; + else if (e.button & 4) b = 2; + } + if (mac && e.ctrlKey && b == 1) b = 3; + return b; + } + + // EVENT HANDLING + + // Lightweight event framework. on/off also work on DOM nodes, + // registering native DOM handlers. + + var on = CodeMirror.on = function(emitter, type, f) { + if (emitter.addEventListener) + emitter.addEventListener(type, f, false); + else if (emitter.attachEvent) + emitter.attachEvent("on" + type, f); + else { + var map = emitter._handlers || (emitter._handlers = {}); + var arr = map[type] || (map[type] = []); + arr.push(f); + } + }; + + var noHandlers = [] + function getHandlers(emitter, type, copy) { + var arr = emitter._handlers && emitter._handlers[type] + if (copy) return arr && arr.length > 0 ? arr.slice() : noHandlers + else return arr || noHandlers + } + + var off = CodeMirror.off = function(emitter, type, f) { + if (emitter.removeEventListener) + emitter.removeEventListener(type, f, false); + else if (emitter.detachEvent) + emitter.detachEvent("on" + type, f); + else { + var handlers = getHandlers(emitter, type, false) + for (var i = 0; i < handlers.length; ++i) + if (handlers[i] == f) { handlers.splice(i, 1); break; } + } + }; + + var signal = CodeMirror.signal = function(emitter, type /*, values...*/) { + var handlers = getHandlers(emitter, type, true) + if (!handlers.length) return; + var args = Array.prototype.slice.call(arguments, 2); + for (var i = 0; i < handlers.length; ++i) handlers[i].apply(null, args); + }; + + var orphanDelayedCallbacks = null; + + // Often, we want to signal events at a point where we are in the + // middle of some work, but don't want the handler to start calling + // other methods on the editor, which might be in an inconsistent + // state or simply not expect any other events to happen. + // signalLater looks whether there are any handlers, and schedules + // them to be executed when the last operation ends, or, if no + // operation is active, when a timeout fires. + function signalLater(emitter, type /*, values...*/) { + var arr = getHandlers(emitter, type, false) + if (!arr.length) return; + var args = Array.prototype.slice.call(arguments, 2), list; + if (operationGroup) { + list = operationGroup.delayedCallbacks; + } else if (orphanDelayedCallbacks) { + list = orphanDelayedCallbacks; + } else { + list = orphanDelayedCallbacks = []; + setTimeout(fireOrphanDelayed, 0); + } + function bnd(f) {return function(){f.apply(null, args);};}; + for (var i = 0; i < arr.length; ++i) + list.push(bnd(arr[i])); + } + + function fireOrphanDelayed() { + var delayed = orphanDelayedCallbacks; + orphanDelayedCallbacks = null; + for (var i = 0; i < delayed.length; ++i) delayed[i](); + } + + // The DOM events that CodeMirror handles can be overridden by + // registering a (non-DOM) handler on the editor for the event name, + // and preventDefault-ing the event in that handler. + function signalDOMEvent(cm, e, override) { + if (typeof e == "string") + e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; + signal(cm, override || e.type, cm, e); + return e_defaultPrevented(e) || e.codemirrorIgnore; + } + + function signalCursorActivity(cm) { + var arr = cm._handlers && cm._handlers.cursorActivity; + if (!arr) return; + var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []); + for (var i = 0; i < arr.length; ++i) if (indexOf(set, arr[i]) == -1) + set.push(arr[i]); + } + + function hasHandler(emitter, type) { + return getHandlers(emitter, type).length > 0 + } + + // Add on and off methods to a constructor's prototype, to make + // registering events on such objects more convenient. + function eventMixin(ctor) { + ctor.prototype.on = function(type, f) {on(this, type, f);}; + ctor.prototype.off = function(type, f) {off(this, type, f);}; + } + + // MISC UTILITIES + + // Number of pixels added to scroller and sizer to hide scrollbar + var scrollerGap = 30; + + // Returned or thrown by various protocols to signal 'I'm not + // handling this'. + var Pass = CodeMirror.Pass = {toString: function(){return "CodeMirror.Pass";}}; + + // Reused option objects for setSelection & friends + var sel_dontScroll = {scroll: false}, sel_mouse = {origin: "*mouse"}, sel_move = {origin: "+move"}; + + function Delayed() {this.id = null;} + Delayed.prototype.set = function(ms, f) { + clearTimeout(this.id); + this.id = setTimeout(f, ms); + }; + + // Counts the column offset in a string, taking tabs into account. + // Used mostly to find indentation. + var countColumn = CodeMirror.countColumn = function(string, end, tabSize, startIndex, startValue) { + if (end == null) { + end = string.search(/[^\s\u00a0]/); + if (end == -1) end = string.length; + } + for (var i = startIndex || 0, n = startValue || 0;;) { + var nextTab = string.indexOf("\t", i); + if (nextTab < 0 || nextTab >= end) + return n + (end - i); + n += nextTab - i; + n += tabSize - (n % tabSize); + i = nextTab + 1; + } + }; + + // The inverse of countColumn -- find the offset that corresponds to + // a particular column. + var findColumn = CodeMirror.findColumn = function(string, goal, tabSize) { + for (var pos = 0, col = 0;;) { + var nextTab = string.indexOf("\t", pos); + if (nextTab == -1) nextTab = string.length; + var skipped = nextTab - pos; + if (nextTab == string.length || col + skipped >= goal) + return pos + Math.min(skipped, goal - col); + col += nextTab - pos; + col += tabSize - (col % tabSize); + pos = nextTab + 1; + if (col >= goal) return pos; + } + } + + var spaceStrs = [""]; + function spaceStr(n) { + while (spaceStrs.length <= n) + spaceStrs.push(lst(spaceStrs) + " "); + return spaceStrs[n]; + } + + function lst(arr) { return arr[arr.length-1]; } + + var selectInput = function(node) { node.select(); }; + if (ios) // Mobile Safari apparently has a bug where select() is broken. + selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length; }; + else if (ie) // Suppress mysterious IE10 errors + selectInput = function(node) { try { node.select(); } catch(_e) {} }; + + function indexOf(array, elt) { + for (var i = 0; i < array.length; ++i) + if (array[i] == elt) return i; + return -1; + } + function map(array, f) { + var out = []; + for (var i = 0; i < array.length; i++) out[i] = f(array[i], i); + return out; + } + + function nothing() {} + + function createObj(base, props) { + var inst; + if (Object.create) { + inst = Object.create(base); + } else { + nothing.prototype = base; + inst = new nothing(); + } + if (props) copyObj(props, inst); + return inst; + }; + + function copyObj(obj, target, overwrite) { + if (!target) target = {}; + for (var prop in obj) + if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop))) + target[prop] = obj[prop]; + return target; + } + + function bind(f) { + var args = Array.prototype.slice.call(arguments, 1); + return function(){return f.apply(null, args);}; + } + + var nonASCIISingleCaseWordChar = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/; + var isWordCharBasic = CodeMirror.isWordChar = function(ch) { + return /\w/.test(ch) || ch > "\x80" && + (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch)); + }; + function isWordChar(ch, helper) { + if (!helper) return isWordCharBasic(ch); + if (helper.source.indexOf("\\w") > -1 && isWordCharBasic(ch)) return true; + return helper.test(ch); + } + + function isEmpty(obj) { + for (var n in obj) if (obj.hasOwnProperty(n) && obj[n]) return false; + return true; + } + + // Extending unicode characters. A series of a non-extending char + + // any number of extending chars is treated as a single unit as far + // as editing and measuring is concerned. This is not fully correct, + // since some scripts/fonts/browsers also treat other configurations + // of code points as a group. + var extendingChars = /[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/; + function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch); } + + // DOM UTILITIES + + function elt(tag, content, className, style) { + var e = document.createElement(tag); + if (className) e.className = className; + if (style) e.style.cssText = style; + if (typeof content == "string") e.appendChild(document.createTextNode(content)); + else if (content) for (var i = 0; i < content.length; ++i) e.appendChild(content[i]); + return e; + } + + var range; + if (document.createRange) range = function(node, start, end, endNode) { + var r = document.createRange(); + r.setEnd(endNode || node, end); + r.setStart(node, start); + return r; + }; + else range = function(node, start, end) { + var r = document.body.createTextRange(); + try { r.moveToElementText(node.parentNode); } + catch(e) { return r; } + r.collapse(true); + r.moveEnd("character", end); + r.moveStart("character", start); + return r; + }; + + function removeChildren(e) { + for (var count = e.childNodes.length; count > 0; --count) + e.removeChild(e.firstChild); + return e; + } + + function removeChildrenAndAdd(parent, e) { + return removeChildren(parent).appendChild(e); + } + + var contains = CodeMirror.contains = function(parent, child) { + if (child.nodeType == 3) // Android browser always returns false when child is a textnode + child = child.parentNode; + if (parent.contains) + return parent.contains(child); + do { + if (child.nodeType == 11) child = child.host; + if (child == parent) return true; + } while (child = child.parentNode); + }; + + function activeElt() { + var activeElement = document.activeElement; + while (activeElement && activeElement.root && activeElement.root.activeElement) + activeElement = activeElement.root.activeElement; + return activeElement; + } + // Older versions of IE throws unspecified error when touching + // document.activeElement in some cases (during loading, in iframe) + if (ie && ie_version < 11) activeElt = function() { + try { return document.activeElement; } + catch(e) { return document.body; } + }; + + function classTest(cls) { return new RegExp("(^|\\s)" + cls + "(?:$|\\s)\\s*"); } + var rmClass = CodeMirror.rmClass = function(node, cls) { + var current = node.className; + var match = classTest(cls).exec(current); + if (match) { + var after = current.slice(match.index + match[0].length); + node.className = current.slice(0, match.index) + (after ? match[1] + after : ""); + } + }; + var addClass = CodeMirror.addClass = function(node, cls) { + var current = node.className; + if (!classTest(cls).test(current)) node.className += (current ? " " : "") + cls; + }; + function joinClasses(a, b) { + var as = a.split(" "); + for (var i = 0; i < as.length; i++) + if (as[i] && !classTest(as[i]).test(b)) b += " " + as[i]; + return b; + } + + // WINDOW-WIDE EVENTS + + // These must be handled carefully, because naively registering a + // handler for each editor will cause the editors to never be + // garbage collected. + + function forEachCodeMirror(f) { + if (!document.body.getElementsByClassName) return; + var byClass = document.body.getElementsByClassName("CodeMirror"); + for (var i = 0; i < byClass.length; i++) { + var cm = byClass[i].CodeMirror; + if (cm) f(cm); + } + } + + var globalsRegistered = false; + function ensureGlobalHandlers() { + if (globalsRegistered) return; + registerGlobalHandlers(); + globalsRegistered = true; + } + function registerGlobalHandlers() { + // When the window resizes, we need to refresh active editors. + var resizeTimer; + on(window, "resize", function() { + if (resizeTimer == null) resizeTimer = setTimeout(function() { + resizeTimer = null; + forEachCodeMirror(onResize); + }, 100); + }); + // When the window loses focus, we want to show the editor as blurred + on(window, "blur", function() { + forEachCodeMirror(onBlur); + }); + } + + // FEATURE DETECTION + + // Detect drag-and-drop + var dragAndDrop = function() { + // There is *some* kind of drag-and-drop support in IE6-8, but I + // couldn't get it to work yet. + if (ie && ie_version < 9) return false; + var div = elt('div'); + return "draggable" in div || "dragDrop" in div; + }(); + + var zwspSupported; + function zeroWidthElement(measure) { + if (zwspSupported == null) { + var test = elt("span", "\u200b"); + removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")])); + if (measure.firstChild.offsetHeight != 0) + zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); + } + var node = zwspSupported ? elt("span", "\u200b") : + elt("span", "\u00a0", null, "display: inline-block; width: 1px; margin-right: -1px"); + node.setAttribute("cm-text", ""); + return node; + } + + // Feature-detect IE's crummy client rect reporting for bidi text + var badBidiRects; + function hasBadBidiRects(measure) { + if (badBidiRects != null) return badBidiRects; + var txt = removeChildrenAndAdd(measure, document.createTextNode("A\u062eA")); + var r0 = range(txt, 0, 1).getBoundingClientRect(); + if (!r0 || r0.left == r0.right) return false; // Safari returns null in some cases (#2780) + var r1 = range(txt, 1, 2).getBoundingClientRect(); + return badBidiRects = (r1.right - r0.right < 3); + } + + // See if "".split is the broken IE version, if so, provide an + // alternative way to split lines. + var splitLinesAuto = CodeMirror.splitLines = "\n\nb".split(/\n/).length != 3 ? function(string) { + var pos = 0, result = [], l = string.length; + while (pos <= l) { + var nl = string.indexOf("\n", pos); + if (nl == -1) nl = string.length; + var line = string.slice(pos, string.charAt(nl - 1) == "\r" ? nl - 1 : nl); + var rt = line.indexOf("\r"); + if (rt != -1) { + result.push(line.slice(0, rt)); + pos += rt + 1; + } else { + result.push(line); + pos = nl + 1; + } + } + return result; + } : function(string){return string.split(/\r\n?|\n/);}; + + var hasSelection = window.getSelection ? function(te) { + try { return te.selectionStart != te.selectionEnd; } + catch(e) { return false; } + } : function(te) { + try {var range = te.ownerDocument.selection.createRange();} + catch(e) {} + if (!range || range.parentElement() != te) return false; + return range.compareEndPoints("StartToEnd", range) != 0; + }; + + var hasCopyEvent = (function() { + var e = elt("div"); + if ("oncopy" in e) return true; + e.setAttribute("oncopy", "return;"); + return typeof e.oncopy == "function"; + })(); + + var badZoomedRects = null; + function hasBadZoomedRects(measure) { + if (badZoomedRects != null) return badZoomedRects; + var node = removeChildrenAndAdd(measure, elt("span", "x")); + var normal = node.getBoundingClientRect(); + var fromRange = range(node, 0, 1).getBoundingClientRect(); + return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1; + } + + // KEY NAMES + + var keyNames = CodeMirror.keyNames = { + 3: "Enter", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt", + 19: "Pause", 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End", + 36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "PrintScrn", 45: "Insert", + 46: "Delete", 59: ";", 61: "=", 91: "Mod", 92: "Mod", 93: "Mod", + 106: "*", 107: "=", 109: "-", 110: ".", 111: "/", 127: "Delete", + 173: "-", 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\", + 221: "]", 222: "'", 63232: "Up", 63233: "Down", 63234: "Left", 63235: "Right", 63272: "Delete", + 63273: "Home", 63275: "End", 63276: "PageUp", 63277: "PageDown", 63302: "Insert" + }; + (function() { + // Number keys + for (var i = 0; i < 10; i++) keyNames[i + 48] = keyNames[i + 96] = String(i); + // Alphabetic keys + for (var i = 65; i <= 90; i++) keyNames[i] = String.fromCharCode(i); + // Function keys + for (var i = 1; i <= 12; i++) keyNames[i + 111] = keyNames[i + 63235] = "F" + i; + })(); + + // BIDI HELPERS + + function iterateBidiSections(order, from, to, f) { + if (!order) return f(from, to, "ltr"); + var found = false; + for (var i = 0; i < order.length; ++i) { + var part = order[i]; + if (part.from < to && part.to > from || from == to && part.to == from) { + f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? "rtl" : "ltr"); + found = true; + } + } + if (!found) f(from, to, "ltr"); + } + + function bidiLeft(part) { return part.level % 2 ? part.to : part.from; } + function bidiRight(part) { return part.level % 2 ? part.from : part.to; } + + function lineLeft(line) { var order = getOrder(line); return order ? bidiLeft(order[0]) : 0; } + function lineRight(line) { + var order = getOrder(line); + if (!order) return line.text.length; + return bidiRight(lst(order)); + } + + function lineStart(cm, lineN) { + var line = getLine(cm.doc, lineN); + var visual = visualLine(line); + if (visual != line) lineN = lineNo(visual); + var order = getOrder(visual); + var ch = !order ? 0 : order[0].level % 2 ? lineRight(visual) : lineLeft(visual); + return Pos(lineN, ch); + } + function lineEnd(cm, lineN) { + var merged, line = getLine(cm.doc, lineN); + while (merged = collapsedSpanAtEnd(line)) { + line = merged.find(1, true).line; + lineN = null; + } + var order = getOrder(line); + var ch = !order ? line.text.length : order[0].level % 2 ? lineLeft(line) : lineRight(line); + return Pos(lineN == null ? lineNo(line) : lineN, ch); + } + function lineStartSmart(cm, pos) { + var start = lineStart(cm, pos.line); + var line = getLine(cm.doc, start.line); + var order = getOrder(line); + if (!order || order[0].level == 0) { + var firstNonWS = Math.max(0, line.text.search(/\S/)); + var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch; + return Pos(start.line, inWS ? 0 : firstNonWS); + } + return start; + } + + function compareBidiLevel(order, a, b) { + var linedir = order[0].level; + if (a == linedir) return true; + if (b == linedir) return false; + return a < b; + } + var bidiOther; + function getBidiPartAt(order, pos) { + bidiOther = null; + for (var i = 0, found; i < order.length; ++i) { + var cur = order[i]; + if (cur.from < pos && cur.to > pos) return i; + if ((cur.from == pos || cur.to == pos)) { + if (found == null) { + found = i; + } else if (compareBidiLevel(order, cur.level, order[found].level)) { + if (cur.from != cur.to) bidiOther = found; + return i; + } else { + if (cur.from != cur.to) bidiOther = i; + return found; + } + } + } + return found; + } + + function moveInLine(line, pos, dir, byUnit) { + if (!byUnit) return pos + dir; + do pos += dir; + while (pos > 0 && isExtendingChar(line.text.charAt(pos))); + return pos; + } + + // This is needed in order to move 'visually' through bi-directional + // text -- i.e., pressing left should make the cursor go left, even + // when in RTL text. The tricky part is the 'jumps', where RTL and + // LTR text touch each other. This often requires the cursor offset + // to move more than one unit, in order to visually move one unit. + function moveVisually(line, start, dir, byUnit) { + var bidi = getOrder(line); + if (!bidi) return moveLogically(line, start, dir, byUnit); + var pos = getBidiPartAt(bidi, start), part = bidi[pos]; + var target = moveInLine(line, start, part.level % 2 ? -dir : dir, byUnit); + + for (;;) { + if (target > part.from && target < part.to) return target; + if (target == part.from || target == part.to) { + if (getBidiPartAt(bidi, target) == pos) return target; + part = bidi[pos += dir]; + return (dir > 0) == part.level % 2 ? part.to : part.from; + } else { + part = bidi[pos += dir]; + if (!part) return null; + if ((dir > 0) == part.level % 2) + target = moveInLine(line, part.to, -1, byUnit); + else + target = moveInLine(line, part.from, 1, byUnit); + } + } + } + + function moveLogically(line, start, dir, byUnit) { + var target = start + dir; + if (byUnit) while (target > 0 && isExtendingChar(line.text.charAt(target))) target += dir; + return target < 0 || target > line.text.length ? null : target; + } + + // Bidirectional ordering algorithm + // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm + // that this (partially) implements. + + // One-char codes used for character types: + // L (L): Left-to-Right + // R (R): Right-to-Left + // r (AL): Right-to-Left Arabic + // 1 (EN): European Number + // + (ES): European Number Separator + // % (ET): European Number Terminator + // n (AN): Arabic Number + // , (CS): Common Number Separator + // m (NSM): Non-Spacing Mark + // b (BN): Boundary Neutral + // s (B): Paragraph Separator + // t (S): Segment Separator + // w (WS): Whitespace + // N (ON): Other Neutrals + + // Returns null if characters are ordered as they appear + // (left-to-right), or an array of sections ({from, to, level} + // objects) in the order in which they occur visually. + var bidiOrdering = (function() { + // Character types for codepoints 0 to 0xff + var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN"; + // Character types for codepoints 0x600 to 0x6ff + var arabicTypes = "rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm"; + function charType(code) { + if (code <= 0xf7) return lowTypes.charAt(code); + else if (0x590 <= code && code <= 0x5f4) return "R"; + else if (0x600 <= code && code <= 0x6ed) return arabicTypes.charAt(code - 0x600); + else if (0x6ee <= code && code <= 0x8ac) return "r"; + else if (0x2000 <= code && code <= 0x200b) return "w"; + else if (code == 0x200c) return "b"; + else return "L"; + } + + var bidiRE = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/; + var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/; + // Browsers seem to always treat the boundaries of block elements as being L. + var outerType = "L"; + + function BidiSpan(level, from, to) { + this.level = level; + this.from = from; this.to = to; + } + + return function(str) { + if (!bidiRE.test(str)) return false; + var len = str.length, types = []; + for (var i = 0, type; i < len; ++i) + types.push(type = charType(str.charCodeAt(i))); + + // W1. Examine each non-spacing mark (NSM) in the level run, and + // change the type of the NSM to the type of the previous + // character. If the NSM is at the start of the level run, it will + // get the type of sor. + for (var i = 0, prev = outerType; i < len; ++i) { + var type = types[i]; + if (type == "m") types[i] = prev; + else prev = type; + } + + // W2. Search backwards from each instance of a European number + // until the first strong type (R, L, AL, or sor) is found. If an + // AL is found, change the type of the European number to Arabic + // number. + // W3. Change all ALs to R. + for (var i = 0, cur = outerType; i < len; ++i) { + var type = types[i]; + if (type == "1" && cur == "r") types[i] = "n"; + else if (isStrong.test(type)) { cur = type; if (type == "r") types[i] = "R"; } + } + + // W4. A single European separator between two European numbers + // changes to a European number. A single common separator between + // two numbers of the same type changes to that type. + for (var i = 1, prev = types[0]; i < len - 1; ++i) { + var type = types[i]; + if (type == "+" && prev == "1" && types[i+1] == "1") types[i] = "1"; + else if (type == "," && prev == types[i+1] && + (prev == "1" || prev == "n")) types[i] = prev; + prev = type; + } + + // W5. A sequence of European terminators adjacent to European + // numbers changes to all European numbers. + // W6. Otherwise, separators and terminators change to Other + // Neutral. + for (var i = 0; i < len; ++i) { + var type = types[i]; + if (type == ",") types[i] = "N"; + else if (type == "%") { + for (var end = i + 1; end < len && types[end] == "%"; ++end) {} + var replace = (i && types[i-1] == "!") || (end < len && types[end] == "1") ? "1" : "N"; + for (var j = i; j < end; ++j) types[j] = replace; + i = end - 1; + } + } + + // W7. Search backwards from each instance of a European number + // until the first strong type (R, L, or sor) is found. If an L is + // found, then change the type of the European number to L. + for (var i = 0, cur = outerType; i < len; ++i) { + var type = types[i]; + if (cur == "L" && type == "1") types[i] = "L"; + else if (isStrong.test(type)) cur = type; + } + + // N1. A sequence of neutrals takes the direction of the + // surrounding strong text if the text on both sides has the same + // direction. European and Arabic numbers act as if they were R in + // terms of their influence on neutrals. Start-of-level-run (sor) + // and end-of-level-run (eor) are used at level run boundaries. + // N2. Any remaining neutrals take the embedding direction. + for (var i = 0; i < len; ++i) { + if (isNeutral.test(types[i])) { + for (var end = i + 1; end < len && isNeutral.test(types[end]); ++end) {} + var before = (i ? types[i-1] : outerType) == "L"; + var after = (end < len ? types[end] : outerType) == "L"; + var replace = before || after ? "L" : "R"; + for (var j = i; j < end; ++j) types[j] = replace; + i = end - 1; + } + } + + // Here we depart from the documented algorithm, in order to avoid + // building up an actual levels array. Since there are only three + // levels (0, 1, 2) in an implementation that doesn't take + // explicit embedding into account, we can build up the order on + // the fly, without following the level-based algorithm. + var order = [], m; + for (var i = 0; i < len;) { + if (countsAsLeft.test(types[i])) { + var start = i; + for (++i; i < len && countsAsLeft.test(types[i]); ++i) {} + order.push(new BidiSpan(0, start, i)); + } else { + var pos = i, at = order.length; + for (++i; i < len && types[i] != "L"; ++i) {} + for (var j = pos; j < i;) { + if (countsAsNum.test(types[j])) { + if (pos < j) order.splice(at, 0, new BidiSpan(1, pos, j)); + var nstart = j; + for (++j; j < i && countsAsNum.test(types[j]); ++j) {} + order.splice(at, 0, new BidiSpan(2, nstart, j)); + pos = j; + } else ++j; + } + if (pos < i) order.splice(at, 0, new BidiSpan(1, pos, i)); + } + } + if (order[0].level == 1 && (m = str.match(/^\s+/))) { + order[0].from = m[0].length; + order.unshift(new BidiSpan(0, 0, m[0].length)); + } + if (lst(order).level == 1 && (m = str.match(/\s+$/))) { + lst(order).to -= m[0].length; + order.push(new BidiSpan(0, len - m[0].length, len)); + } + if (order[0].level == 2) + order.unshift(new BidiSpan(1, order[0].to, order[0].to)); + if (order[0].level != lst(order).level) + order.push(new BidiSpan(order[0].level, len, len)); + + return order; + }; + })(); + + // THE END + + CodeMirror.version = "5.16.0"; + + return CodeMirror; +}); diff --git a/js/highlight.pack.js b/js/highlight.pack.js new file mode 100644 index 00000000..bd9e0264 --- /dev/null +++ b/js/highlight.pack.js @@ -0,0 +1 @@ +!function(e){"undefined"!=typeof exports?e(exports):(window.hljs=e({}),"function"==typeof define&&define.amd&&define("hljs",[],function(){return window.hljs}))}(function(e){function n(e){return e.replace(/&/gm,"&").replace(//gm,">")}function t(e){return e.nodeName.toLowerCase()}function r(e,n){var t=e&&e.exec(n);return t&&0==t.index}function a(e){return/no-?highlight|plain|text/.test(e)}function i(e){var n,t,r,i=e.className+" ";if(i+=e.parentNode?e.parentNode.className:"",t=/\blang(?:uage)?-([\w-]+)\b/.exec(i))return E(t[1])?t[1]:"no-highlight";for(i=i.split(/\s+/),n=0,r=i.length;r>n;n++)if(E(i[n])||a(i[n]))return i[n]}function o(e,n){var t,r={};for(t in e)r[t]=e[t];if(n)for(t in n)r[t]=n[t];return r}function u(e){var n=[];return function r(e,a){for(var i=e.firstChild;i;i=i.nextSibling)3==i.nodeType?a+=i.nodeValue.length:1==i.nodeType&&(n.push({event:"start",offset:a,node:i}),a=r(i,a),t(i).match(/br|hr|img|input/)||n.push({event:"stop",offset:a,node:i}));return a}(e,0),n}function c(e,r,a){function i(){return e.length&&r.length?e[0].offset!=r[0].offset?e[0].offset"}function u(e){f+=""}function c(e){("start"==e.event?o:u)(e.node)}for(var s=0,f="",l=[];e.length||r.length;){var g=i();if(f+=n(a.substr(s,g[0].offset-s)),s=g[0].offset,g==e){l.reverse().forEach(u);do c(g.splice(0,1)[0]),g=i();while(g==e&&g.length&&g[0].offset==s);l.reverse().forEach(o)}else"start"==g[0].event?l.push(g[0].node):l.pop(),c(g.splice(0,1)[0])}return f+n(a.substr(s))}function s(e){function n(e){return e&&e.source||e}function t(t,r){return new RegExp(n(t),"m"+(e.cI?"i":"")+(r?"g":""))}function r(a,i){if(!a.compiled){if(a.compiled=!0,a.k=a.k||a.bK,a.k){var u={},c=function(n,t){e.cI&&(t=t.toLowerCase()),t.split(" ").forEach(function(e){var t=e.split("|");u[t[0]]=[n,t[1]?Number(t[1]):1]})};"string"==typeof a.k?c("keyword",a.k):Object.keys(a.k).forEach(function(e){c(e,a.k[e])}),a.k=u}a.lR=t(a.l||/\b\w+\b/,!0),i&&(a.bK&&(a.b="\\b("+a.bK.split(" ").join("|")+")\\b"),a.b||(a.b=/\B|\b/),a.bR=t(a.b),a.e||a.eW||(a.e=/\B|\b/),a.e&&(a.eR=t(a.e)),a.tE=n(a.e)||"",a.eW&&i.tE&&(a.tE+=(a.e?"|":"")+i.tE)),a.i&&(a.iR=t(a.i)),void 0===a.r&&(a.r=1),a.c||(a.c=[]);var s=[];a.c.forEach(function(e){e.v?e.v.forEach(function(n){s.push(o(e,n))}):s.push("self"==e?a:e)}),a.c=s,a.c.forEach(function(e){r(e,a)}),a.starts&&r(a.starts,i);var f=a.c.map(function(e){return e.bK?"\\.?("+e.b+")\\.?":e.b}).concat([a.tE,a.i]).map(n).filter(Boolean);a.t=f.length?t(f.join("|"),!0):{exec:function(){return null}}}}r(e)}function f(e,t,a,i){function o(e,n){for(var t=0;t";return i+=e+'">',i+n+o}function p(){if(!L.k)return n(B);var e="",t=0;L.lR.lastIndex=0;for(var r=L.lR.exec(B);r;){e+=n(B.substr(t,r.index-t));var a=g(L,r);a?(y+=a[1],e+=h(a[0],n(r[0]))):e+=n(r[0]),t=L.lR.lastIndex,r=L.lR.exec(B)}return e+n(B.substr(t))}function d(){if(L.sL&&!x[L.sL])return n(B);var e=L.sL?f(L.sL,B,!0,M[L.sL]):l(B);return L.r>0&&(y+=e.r),"continuous"==L.subLanguageMode&&(M[L.sL]=e.top),h(e.language,e.value,!1,!0)}function b(){return void 0!==L.sL?d():p()}function v(e,t){var r=e.cN?h(e.cN,"",!0):"";e.rB?(k+=r,B=""):e.eB?(k+=n(t)+r,B=""):(k+=r,B=t),L=Object.create(e,{parent:{value:L}})}function m(e,t){if(B+=e,void 0===t)return k+=b(),0;var r=o(t,L);if(r)return k+=b(),v(r,t),r.rB?0:t.length;var a=u(L,t);if(a){var i=L;i.rE||i.eE||(B+=t),k+=b();do L.cN&&(k+=""),y+=L.r,L=L.parent;while(L!=a.parent);return i.eE&&(k+=n(t)),B="",a.starts&&v(a.starts,""),i.rE?0:t.length}if(c(t,L))throw new Error('Illegal lexeme "'+t+'" for mode "'+(L.cN||"")+'"');return B+=t,t.length||1}var N=E(e);if(!N)throw new Error('Unknown language: "'+e+'"');s(N);var R,L=i||N,M={},k="";for(R=L;R!=N;R=R.parent)R.cN&&(k=h(R.cN,"",!0)+k);var B="",y=0;try{for(var C,j,I=0;;){if(L.t.lastIndex=I,C=L.t.exec(t),!C)break;j=m(t.substr(I,C.index-I),C[0]),I=C.index+j}for(m(t.substr(I)),R=L;R.parent;R=R.parent)R.cN&&(k+="");return{r:y,value:k,language:e,top:L}}catch(O){if(-1!=O.message.indexOf("Illegal"))return{r:0,value:n(t)};throw O}}function l(e,t){t=t||w.languages||Object.keys(x);var r={r:0,value:n(e)},a=r;return t.forEach(function(n){if(E(n)){var t=f(n,e,!1);t.language=n,t.r>a.r&&(a=t),t.r>r.r&&(a=r,r=t)}}),a.language&&(r.second_best=a),r}function g(e){return w.tabReplace&&(e=e.replace(/^((<[^>]+>|\t)+)/gm,function(e,n){return n.replace(/\t/g,w.tabReplace)})),w.useBR&&(e=e.replace(/\n/g,"
")),e}function h(e,n,t){var r=n?R[n]:t,a=[e.trim()];return e.match(/\bhljs\b/)||a.push("hljs"),-1===e.indexOf(r)&&a.push(r),a.join(" ").trim()}function p(e){var n=i(e);if(!a(n)){var t;w.useBR?(t=document.createElementNS("http://www.w3.org/1999/xhtml","div"),t.innerHTML=e.innerHTML.replace(/\n/g,"").replace(//g,"\n")):t=e;var r=t.textContent,o=n?f(n,r,!0):l(r),s=u(t);if(s.length){var p=document.createElementNS("http://www.w3.org/1999/xhtml","div");p.innerHTML=o.value,o.value=c(s,u(p),r)}o.value=g(o.value),e.innerHTML=o.value,e.className=h(e.className,n,o.language),e.result={language:o.language,re:o.r},o.second_best&&(e.second_best={language:o.second_best.language,re:o.second_best.r})}}function d(e){w=o(w,e)}function b(){if(!b.called){b.called=!0;var e=document.querySelectorAll("pre code");Array.prototype.forEach.call(e,p)}}function v(){addEventListener("DOMContentLoaded",b,!1),addEventListener("load",b,!1)}function m(n,t){var r=x[n]=t(e);r.aliases&&r.aliases.forEach(function(e){R[e]=n})}function N(){return Object.keys(x)}function E(e){return x[e]||x[R[e]]}var w={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0},x={},R={};return e.highlight=f,e.highlightAuto=l,e.fixMarkup=g,e.highlightBlock=p,e.configure=d,e.initHighlighting=b,e.initHighlightingOnLoad=v,e.registerLanguage=m,e.listLanguages=N,e.getLanguage=E,e.inherit=o,e.IR="[a-zA-Z]\\w*",e.UIR="[a-zA-Z_]\\w*",e.NR="\\b\\d+(\\.\\d+)?",e.CNR="\\b(0[xX][a-fA-F0-9]+|(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",e.BNR="\\b(0b[01]+)",e.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",e.BE={b:"\\\\[\\s\\S]",r:0},e.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[e.BE]},e.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[e.BE]},e.PWM={b:/\b(a|an|the|are|I|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such)\b/},e.C=function(n,t,r){var a=e.inherit({cN:"comment",b:n,e:t,c:[]},r||{});return a.c.push(e.PWM),a.c.push({cN:"doctag",bK:"TODO FIXME NOTE BUG XXX",r:0}),a},e.CLCM=e.C("//","$"),e.CBCM=e.C("/\\*","\\*/"),e.HCM=e.C("#","$"),e.NM={cN:"number",b:e.NR,r:0},e.CNM={cN:"number",b:e.CNR,r:0},e.BNM={cN:"number",b:e.BNR,r:0},e.CSSNM={cN:"number",b:e.NR+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",r:0},e.RM={cN:"regexp",b:/\//,e:/\/[gimuy]*/,i:/\n/,c:[e.BE,{b:/\[/,e:/\]/,r:0,c:[e.BE]}]},e.TM={cN:"title",b:e.IR,r:0},e.UTM={cN:"title",b:e.UIR,r:0},e});hljs.registerLanguage("javascript",function(e){return{aliases:["js"],k:{keyword:"in of if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const export super debugger as async await",literal:"true false null undefined NaN Infinity",built_in:"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document Symbol Set Map WeakSet WeakMap Proxy Reflect Promise"},c:[{cN:"pi",r:10,b:/^\s*['"]use (strict|asm)['"]/},e.ASM,e.QSM,{cN:"string",b:"`",e:"`",c:[e.BE,{cN:"subst",b:"\\$\\{",e:"\\}"}]},e.CLCM,e.CBCM,{cN:"number",v:[{b:"\\b(0[bB][01]+)"},{b:"\\b(0[oO][0-7]+)"},{b:e.CNR}],r:0},{b:"("+e.RSR+"|\\b(case|return|throw)\\b)\\s*",k:"return throw case",c:[e.CLCM,e.CBCM,e.RM,{b:/\s*[);\]]/,r:0,sL:"xml"}],r:0},{cN:"function",bK:"function",e:/\{/,eE:!0,c:[e.inherit(e.TM,{b:/[A-Za-z$_][0-9A-Za-z$_]*/}),{cN:"params",b:/\(/,e:/\)/,eB:!0,eE:!0,c:[e.CLCM,e.CBCM],i:/["'\(]/}],i:/\[|%/},{b:/\$[(.]/},{b:"\\."+e.IR,r:0},{bK:"import",e:"[;$]",k:"import from as",c:[e.ASM,e.QSM]},{cN:"class",bK:"class",e:/[{;=]/,eE:!0,i:/[:"\[\]]/,c:[{bK:"extends"},e.UTM]}]}}); \ No newline at end of file diff --git a/js/photonui.js b/js/photonui.js new file mode 100644 index 00000000..1e679b4b --- /dev/null +++ b/js/photonui.js @@ -0,0 +1,36193 @@ +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.photonui = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i= 0 ; i--) { + mixin = properties.__include__[i]; + for (property in mixin) { + if (property == "__classvars__") { + continue; + } else if (properties[property] === undefined) { + properties[property] = mixin[property]; + } + } + + // Merging mixin's static properties + if (mixin.__classvars__) { + if (!properties.__classvars__) { + properties.__classvars__ = {}; + } + for (property in mixin.__classvars__) { + if (properties.__classvars__[property] === undefined) { + properties.__classvars__[property] = mixin.__classvars__[property]; + } + } + } + } + } + + // Add properties + for (property in properties || {}) { + if (property == "__include__" || property == "__classvars__") { + continue; + } + if (typeof properties[property] == "function") { + computedPropertyName = undefined; + _classMap.methods[property] = {annotations: {}}; + // Accessors / Mutators + if (property.indexOf("get") === 0) { + computedPropertyName = property.slice(3, 4).toLowerCase() + property.slice(4, property.length); + if (!_classMap.computedProperties[computedPropertyName]) { + _classMap.computedProperties[computedPropertyName] = {annotations: {}}; + } + _classMap.computedProperties[computedPropertyName].get = property; + } else if (property.indexOf("set") === 0) { + computedPropertyName = property.slice(3, 4).toLowerCase() + property.slice(4, property.length); + if (!_classMap.computedProperties[computedPropertyName]) { + _classMap.computedProperties[computedPropertyName] = {annotations: {}}; + } + _classMap.computedProperties[computedPropertyName].set = property; + } else if (property.indexOf("has") === 0) { + computedPropertyName = property.slice(3, 4).toLowerCase() + property.slice(4, property.length); + if (!_classMap.computedProperties[computedPropertyName]) { + _classMap.computedProperties[computedPropertyName] = {annotations: {}}; + } + _classMap.computedProperties[computedPropertyName].get = property; + } else if (property.indexOf("is") === 0) { + computedPropertyName = property.slice(2, 3).toLowerCase() + property.slice(3, property.length); + if (!_classMap.computedProperties[computedPropertyName]) { + _classMap.computedProperties[computedPropertyName] = {annotations: {}}; + } + _classMap.computedProperties[computedPropertyName].get = property; + } + // Annotations + annotations = extractAnnotations(properties[property]); + for (var annotation in annotations) { + _classMap.methods[property].annotations[annotation] = annotations[annotation]; + if (computedPropertyName) { + _classMap.computedProperties[computedPropertyName] + .annotations[annotation] = annotations[annotation]; + } + } + // Wrapped method + if (usesSpecialProperty(properties[property])) { + __class__.prototype[property] = (function (method, propertyName, computedPropertyName) { + return function () { + var _oldSuper = this.$super; + var _oldName = this.$name; + var _oldComputedPropertyName = this.$computedPropertyName; + + this.$super = _superClass.prototype[propertyName]; + this.$name = propertyName; + this.$computedPropertyName = computedPropertyName; + + try { + return method.apply(this, arguments); + } finally { + if (_oldSuper) { + this.$super = _oldSuper; + } else { + delete this.$super; + } + if (_oldName) { + this.$name = _oldName; + } else { + delete this.$name; + } + if (_oldComputedPropertyName) { + this.$computedPropertyName = _oldComputedPropertyName; + } else { + delete this.$computedPropertyName; + } + } + }; + })(properties[property], property, computedPropertyName); // jshint ignore:line + + // Simple methods + } else { + __class__.prototype[property] = properties[property]; + } + } else { + _classMap.attributes[property] = true; + __class__.prototype[property] = properties[property]; + } + } + + // Copy super class static properties + var scStaticProps = Object.getOwnPropertyNames(_superClass); + // Removes caller, callee and arguments from the list (strict mode) + // Removes non enumerable Abitbol properties too + scStaticProps = scStaticProps.filter(function (value) { + return (["caller", "callee", "arguments", "$class", "$extend", "$map"].indexOf(value) == -1); + }); + for (i = 0 ; i < scStaticProps.length ; i++) { + if (__class__[scStaticProps[i]] === undefined) { + __class__[scStaticProps[i]] = _superClass[scStaticProps[i]]; + } + } + + // Add static properties + if (properties.__classvars__) { + for (property in properties.__classvars__) { + __class__[property] = properties.__classvars__[property]; + } + } + + // Add abitbol static properties + Object.defineProperty(__class__, "$class", { + enumerable: false, + value: __class__ + }); + Object.defineProperty(__class__, "$extend", { + enumerable: false, + value: Class.$extend + }); + Object.defineProperty(__class__, "$map", { + enumerable: false, + value: _classMap + }); + + var _postBuildHook = properties.__postBuild__ || _superClass.prototype.__postBuild__; + if (_postBuildHook) { + _postBuildHook(properties, __class__, _superClass); + } + + return __class__; + } +}); + +module.exports = Class; + +},{"./annotation.js":2}],2:[function(require,module,exports){ +"use strict"; + +function cleanJs(js) { + // remove function fn(param) { + // or fn(param) { + // or (param) => { + var c; + var p = 0; + for (var i = 0 ; i < js.length ; i++) { + c = js[i]; + if (c == "(") { + ++p; + } else if (c == ")") { + --p; + } else if (c == "{" && p === 0) { + js = js.slice(i + 1); + break; + } + } + + // remove comments (not super safe but should work in most cases) + js = js.replace(/\/\*(.|\r|\n)*?\*\//g, ""); + js = js.replace(/\/\/.*?\r?\n/g, "\n"); + + // remove indentation and CR/LF + js = js.replace(/\s*\r?\n\s*/g, ""); + + return js; +} + +function extractStrings(js) { + var strings = []; + + var instr = false; + var inesc = false; + var quote; + var buff; + var c; + + for (var i = 0 ; i < js.length ; i++) { + c = js[i]; + + if (!instr) { + // New string + if (c == "\"" || c == "'") { + instr = true; + inesc = false; + quote = c; + buff = ""; + // Char we don't care about + } else if ([" ", " ", "\n", "\r", ";"].indexOf(c) > -1) { // jshint ignore:line + continue; + // Other expression -> job finished! + } else { + break; + } + } else { + if (!inesc) { + // Escaped char + if (c == "\\") { + inesc = true; + // End of string + } else if (c == quote) { + strings.push(buff); + instr = false; + // Any char + } else { + buff += c; + } + } else { + if (c == "\\") { + buff += "\\"; + } else if (c == "n") { + buff += "\n"; + } else if (c == "r") { + buff += "\r"; + } else if (c == "t") { + buff += "\t"; + } else if (c == quote) { + buff += quote; + // We don't care... + } else { + buff += "\\" + c; + } + inesc = false; + } + } + } + + return strings; +} + +function autoCast(value) { + if (value == "true") { + return true; + } else if (value == "false") { + return false; + } else if (value == "null") { + return null; + } else if (value == "undefined") { + return undefined; + } else if (value.match(/^([0-9]+\.?|[0-9]*\.[0-9]+)$/)) { + return parseFloat(value); + } else { + return value; + } +} + +function extractAnnotations(func) { + var js = cleanJs(func.toString()); + var strings = extractStrings(js); + + var annotations = {}; + var string; + var key; + var value; + + for (var i = 0 ; i < strings.length ; i++) { + string = strings[i].trim(); + + if (string.indexOf("@") !== 0) { + continue; + } + + key = string.slice(1, (string.indexOf(" ") > -1) ? string.indexOf(" ") : string.length); + value = true; + if (string.indexOf(" ") > -1) { + value = string.slice(string.indexOf(" ") + 1, string.length); + value = value.trim(); + value = autoCast(value); + } + + annotations[key] = value; + } + + return annotations; +} + +module.exports = extractAnnotations; + +},{}],3:[function(require,module,exports){ + +var Keyboard = require('./lib/keyboard'); +var Locale = require('./lib/locale'); +var KeyCombo = require('./lib/key-combo'); + +var keyboard = new Keyboard(); + +keyboard.setLocale('us', require('./locales/us')); + +exports = module.exports = keyboard; +exports.Keyboard = Keyboard; +exports.Locale = Locale; +exports.KeyCombo = KeyCombo; + +},{"./lib/key-combo":4,"./lib/keyboard":5,"./lib/locale":6,"./locales/us":7}],4:[function(require,module,exports){ + +function KeyCombo(keyComboStr) { + this.sourceStr = keyComboStr; + this.subCombos = KeyCombo.parseComboStr(keyComboStr); + this.keyNames = this.subCombos.reduce(function(memo, nextSubCombo) { + return memo.concat(nextSubCombo); + }, []); +} + +// TODO: Add support for key combo sequences +KeyCombo.sequenceDeliminator = '>>'; +KeyCombo.comboDeliminator = '>'; +KeyCombo.keyDeliminator = '+'; + +KeyCombo.parseComboStr = function(keyComboStr) { + var subComboStrs = KeyCombo._splitStr(keyComboStr, KeyCombo.comboDeliminator); + var combo = []; + + for (var i = 0 ; i < subComboStrs.length; i += 1) { + combo.push(KeyCombo._splitStr(subComboStrs[i], KeyCombo.keyDeliminator)); + } + return combo; +}; + +KeyCombo.prototype.check = function(pressedKeyNames) { + var startingKeyNameIndex = 0; + for (var i = 0; i < this.subCombos.length; i += 1) { + startingKeyNameIndex = this._checkSubCombo( + this.subCombos[i], + startingKeyNameIndex, + pressedKeyNames + ); + if (startingKeyNameIndex === -1) { return false; } + } + return true; +}; + +KeyCombo.prototype.isEqual = function(otherKeyCombo) { + if ( + !otherKeyCombo || + typeof otherKeyCombo !== 'string' && + typeof otherKeyCombo !== 'object' + ) { return false; } + + if (typeof otherKeyCombo === 'string') { + otherKeyCombo = new KeyCombo(otherKeyCombo); + } + + if (this.subCombos.length !== otherKeyCombo.subCombos.length) { + return false; + } + for (var i = 0; i < this.subCombos.length; i += 1) { + if (this.subCombos[i].length !== otherKeyCombo.subCombos[i].length) { + return false; + } + } + + for (var i = 0; i < this.subCombos.length; i += 1) { + var subCombo = this.subCombos[i]; + var otherSubCombo = otherKeyCombo.subCombos[i].slice(0); + + for (var j = 0; j < subCombo.length; j += 1) { + var keyName = subCombo[j]; + var index = otherSubCombo.indexOf(keyName); + + if (index > -1) { + otherSubCombo.splice(index, 1); + } + } + if (otherSubCombo.length !== 0) { + return false; + } + } + + return true; +}; + +KeyCombo._splitStr = function(str, deliminator) { + var s = str; + var d = deliminator; + var c = ''; + var ca = []; + + for (var ci = 0; ci < s.length; ci += 1) { + if (ci > 0 && s[ci] === d && s[ci - 1] !== '\\') { + ca.push(c.trim()); + c = ''; + ci += 1; + } + c += s[ci]; + } + if (c) { ca.push(c.trim()); } + + return ca; +}; + +KeyCombo.prototype._checkSubCombo = function(subCombo, startingKeyNameIndex, pressedKeyNames) { + subCombo = subCombo.slice(0); + pressedKeyNames = pressedKeyNames.slice(startingKeyNameIndex); + + var endIndex = startingKeyNameIndex; + for (var i = 0; i < subCombo.length; i += 1) { + + var keyName = subCombo[i]; + if (keyName[0] === '\\') { + var escapedKeyName = keyName.slice(1); + if ( + escapedKeyName === KeyCombo.comboDeliminator || + escapedKeyName === KeyCombo.keyDeliminator + ) { + keyName = escapedKeyName; + } + } + + var index = pressedKeyNames.indexOf(keyName); + if (index > -1) { + subCombo.splice(i, 1); + i -= 1; + if (index > endIndex) { + endIndex = index; + } + if (subCombo.length === 0) { + return endIndex; + } + } + } + return -1; +}; + + +module.exports = KeyCombo; + +},{}],5:[function(require,module,exports){ +(function (global){ + +var Locale = require('./locale'); +var KeyCombo = require('./key-combo'); + + +function Keyboard(targetWindow, targetElement, platform, userAgent) { + this._locale = null; + this._currentContext = null; + this._contexts = {}; + this._listeners = []; + this._appliedListeners = []; + this._locales = {}; + this._targetElement = null; + this._targetWindow = null; + this._targetPlatform = ''; + this._targetUserAgent = ''; + this._isModernBrowser = false; + this._targetKeyDownBinding = null; + this._targetKeyUpBinding = null; + this._targetResetBinding = null; + this._paused = false; + this._callerHandler = null; + + this.setContext('global'); + this.watch(targetWindow, targetElement, platform, userAgent); +} + +Keyboard.prototype.setLocale = function(localeName, localeBuilder) { + var locale = null; + if (typeof localeName === 'string') { + + if (localeBuilder) { + locale = new Locale(localeName); + localeBuilder(locale, this._targetPlatform, this._targetUserAgent); + } else { + locale = this._locales[localeName] || null; + } + } else { + locale = localeName; + localeName = locale._localeName; + } + + this._locale = locale; + this._locales[localeName] = locale; + if (locale) { + this._locale.pressedKeys = locale.pressedKeys; + } +}; + +Keyboard.prototype.getLocale = function(localName) { + localName || (localName = this._locale.localeName); + return this._locales[localName] || null; +}; + +Keyboard.prototype.bind = function(keyComboStr, pressHandler, releaseHandler, preventRepeatByDefault) { + if (keyComboStr === null || typeof keyComboStr === 'function') { + preventRepeatByDefault = releaseHandler; + releaseHandler = pressHandler; + pressHandler = keyComboStr; + keyComboStr = null; + } + + if ( + keyComboStr && + typeof keyComboStr === 'object' && + typeof keyComboStr.length === 'number' + ) { + for (var i = 0; i < keyComboStr.length; i += 1) { + this.bind(keyComboStr[i], pressHandler, releaseHandler); + } + return; + } + + this._listeners.push({ + keyCombo : keyComboStr ? new KeyCombo(keyComboStr) : null, + pressHandler : pressHandler || null, + releaseHandler : releaseHandler || null, + preventRepeat : preventRepeatByDefault || false, + preventRepeatByDefault : preventRepeatByDefault || false + }); +}; +Keyboard.prototype.addListener = Keyboard.prototype.bind; +Keyboard.prototype.on = Keyboard.prototype.bind; + +Keyboard.prototype.unbind = function(keyComboStr, pressHandler, releaseHandler) { + if (keyComboStr === null || typeof keyComboStr === 'function') { + releaseHandler = pressHandler; + pressHandler = keyComboStr; + keyComboStr = null; + } + + if ( + keyComboStr && + typeof keyComboStr === 'object' && + typeof keyComboStr.length === 'number' + ) { + for (var i = 0; i < keyComboStr.length; i += 1) { + this.unbind(keyComboStr[i], pressHandler, releaseHandler); + } + return; + } + + for (var i = 0; i < this._listeners.length; i += 1) { + var listener = this._listeners[i]; + + var comboMatches = !keyComboStr && !listener.keyCombo || + listener.keyCombo && listener.keyCombo.isEqual(keyComboStr); + var pressHandlerMatches = !pressHandler && !releaseHandler || + !pressHandler && !listener.pressHandler || + pressHandler === listener.pressHandler; + var releaseHandlerMatches = !pressHandler && !releaseHandler || + !releaseHandler && !listener.releaseHandler || + releaseHandler === listener.releaseHandler; + + if (comboMatches && pressHandlerMatches && releaseHandlerMatches) { + this._listeners.splice(i, 1); + i -= 1; + } + } +}; +Keyboard.prototype.removeListener = Keyboard.prototype.unbind; +Keyboard.prototype.off = Keyboard.prototype.unbind; + +Keyboard.prototype.setContext = function(contextName) { + if(this._locale) { this.releaseAllKeys(); } + + if (!this._contexts[contextName]) { + this._contexts[contextName] = []; + } + this._listeners = this._contexts[contextName]; + this._currentContext = contextName; +}; + +Keyboard.prototype.getContext = function() { + return this._currentContext; +}; + +Keyboard.prototype.withContext = function(contextName, callback) { + var previousContextName = this.getContext(); + this.setContext(contextName); + + callback(); + + this.setContext(previousContextName); +}; + +Keyboard.prototype.watch = function(targetWindow, targetElement, targetPlatform, targetUserAgent) { + var _this = this; + + this.stop(); + + if (!targetWindow) { + if (!global.addEventListener && !global.attachEvent) { + throw new Error('Cannot find global functions addEventListener or attachEvent.'); + } + targetWindow = global; + } + + if (typeof targetWindow.nodeType === 'number') { + targetUserAgent = targetPlatform; + targetPlatform = targetElement; + targetElement = targetWindow; + targetWindow = global; + } + + if (!targetWindow.addEventListener && !targetWindow.attachEvent) { + throw new Error('Cannot find addEventListener or attachEvent methods on targetWindow.'); + } + + this._isModernBrowser = !!targetWindow.addEventListener; + + var userAgent = targetWindow.navigator && targetWindow.navigator.userAgent || ''; + var platform = targetWindow.navigator && targetWindow.navigator.platform || ''; + + targetElement && targetElement !== null || (targetElement = targetWindow.document); + targetPlatform && targetPlatform !== null || (targetPlatform = platform); + targetUserAgent && targetUserAgent !== null || (targetUserAgent = userAgent); + + this._targetKeyDownBinding = function(event) { + _this.pressKey(event.keyCode, event); + _this._handleCommandBug(event, platform); + }; + this._targetKeyUpBinding = function(event) { + _this.releaseKey(event.keyCode, event); + }; + this._targetResetBinding = function(event) { + _this.releaseAllKeys(event) + }; + + this._bindEvent(targetElement, 'keydown', this._targetKeyDownBinding); + this._bindEvent(targetElement, 'keyup', this._targetKeyUpBinding); + this._bindEvent(targetWindow, 'focus', this._targetResetBinding); + this._bindEvent(targetWindow, 'blur', this._targetResetBinding); + + this._targetElement = targetElement; + this._targetWindow = targetWindow; + this._targetPlatform = targetPlatform; + this._targetUserAgent = targetUserAgent; +}; + +Keyboard.prototype.stop = function() { + var _this = this; + + if (!this._targetElement || !this._targetWindow) { return; } + + this._unbindEvent(this._targetElement, 'keydown', this._targetKeyDownBinding); + this._unbindEvent(this._targetElement, 'keyup', this._targetKeyUpBinding); + this._unbindEvent(this._targetWindow, 'focus', this._targetResetBinding); + this._unbindEvent(this._targetWindow, 'blur', this._targetResetBinding); + + this._targetWindow = null; + this._targetElement = null; +}; + +Keyboard.prototype.pressKey = function(keyCode, event) { + if (this._paused) { return; } + if (!this._locale) { throw new Error('Locale not set'); } + + this._locale.pressKey(keyCode); + this._applyBindings(event); +}; + +Keyboard.prototype.releaseKey = function(keyCode, event) { + if (this._paused) { return; } + if (!this._locale) { throw new Error('Locale not set'); } + + this._locale.releaseKey(keyCode); + this._clearBindings(event); +}; + +Keyboard.prototype.releaseAllKeys = function(event) { + if (this._paused) { return; } + if (!this._locale) { throw new Error('Locale not set'); } + + this._locale.pressedKeys.length = 0; + this._clearBindings(event); +}; + +Keyboard.prototype.pause = function() { + if (this._paused) { return; } + if (this._locale) { this.releaseAllKeys(); } + this._paused = true; +}; + +Keyboard.prototype.resume = function() { + this._paused = false; +}; + +Keyboard.prototype.reset = function() { + this.releaseAllKeys(); + this._listeners.length = 0; +}; + +Keyboard.prototype._bindEvent = function(targetElement, eventName, handler) { + return this._isModernBrowser ? + targetElement.addEventListener(eventName, handler, false) : + targetElement.attachEvent('on' + eventName, handler); +}; + +Keyboard.prototype._unbindEvent = function(targetElement, eventName, handler) { + return this._isModernBrowser ? + targetElement.removeEventListener(eventName, handler, false) : + targetElement.detachEvent('on' + eventName, handler); +}; + +Keyboard.prototype._getGroupedListeners = function() { + var listenerGroups = []; + var listenerGroupMap = []; + + var listeners = this._listeners; + if (this._currentContext !== 'global') { + listeners = [].concat(listeners, this._contexts.global); + } + + listeners.sort(function(a, b) { + return (b.keyCombo ? b.keyCombo.keyNames.length : 0) - (a.keyCombo ? a.keyCombo.keyNames.length : 0); + }).forEach(function(l) { + var mapIndex = -1; + for (var i = 0; i < listenerGroupMap.length; i += 1) { + if (listenerGroupMap[i] === null && l.keyCombo === null || + listenerGroupMap[i] !== null && listenerGroupMap[i].isEqual(l.keyCombo)) { + mapIndex = i; + } + } + if (mapIndex === -1) { + mapIndex = listenerGroupMap.length; + listenerGroupMap.push(l.keyCombo); + } + if (!listenerGroups[mapIndex]) { + listenerGroups[mapIndex] = []; + } + listenerGroups[mapIndex].push(l); + }); + return listenerGroups; +}; + +Keyboard.prototype._applyBindings = function(event) { + var preventRepeat = false; + + event || (event = {}); + event.preventRepeat = function() { preventRepeat = true; }; + event.pressedKeys = this._locale.pressedKeys.slice(0); + + var pressedKeys = this._locale.pressedKeys.slice(0); + var listenerGroups = this._getGroupedListeners(); + + + for (var i = 0; i < listenerGroups.length; i += 1) { + var listeners = listenerGroups[i]; + var keyCombo = listeners[0].keyCombo; + + if (keyCombo === null || keyCombo.check(pressedKeys)) { + for (var j = 0; j < listeners.length; j += 1) { + var listener = listeners[j]; + + if (keyCombo === null) { + listener = { + keyCombo : new KeyCombo(pressedKeys.join('+')), + pressHandler : listener.pressHandler, + releaseHandler : listener.releaseHandler, + preventRepeat : listener.preventRepeat, + preventRepeatByDefault : listener.preventRepeatByDefault + }; + } + + if (listener.pressHandler && !listener.preventRepeat) { + listener.pressHandler.call(this, event); + if (preventRepeat) { + listener.preventRepeat = preventRepeat; + preventRepeat = false; + } + } + + if (listener.releaseHandler && this._appliedListeners.indexOf(listener) === -1) { + this._appliedListeners.push(listener); + } + } + + if (keyCombo) { + for (var j = 0; j < keyCombo.keyNames.length; j += 1) { + var index = pressedKeys.indexOf(keyCombo.keyNames[j]); + if (index !== -1) { + pressedKeys.splice(index, 1); + j -= 1; + } + } + } + } + } +}; + +Keyboard.prototype._clearBindings = function(event) { + event || (event = {}); + + for (var i = 0; i < this._appliedListeners.length; i += 1) { + var listener = this._appliedListeners[i]; + var keyCombo = listener.keyCombo; + if (keyCombo === null || !keyCombo.check(this._locale.pressedKeys)) { + if (this._callerHandler !== listener.releaseHandler) { + var oldCaller = this._callerHandler; + this._callerHandler = listener.releaseHandler; + listener.preventRepeat = listener.preventRepeatByDefault; + listener.releaseHandler.call(this, event); + this._callerHandler = oldCaller; + } + this._appliedListeners.splice(i, 1); + i -= 1; + } + } +}; + +Keyboard.prototype._handleCommandBug = function(event, platform) { + // On Mac when the command key is kept pressed, keyup is not triggered for any other key. + // In this case force a keyup for non-modifier keys directly after the keypress. + var modifierKeys = ["shift", "ctrl", "alt", "capslock", "tab", "command"]; + if (platform.match("Mac") && this._locale.pressedKeys.includes("command") && + !modifierKeys.includes(this._locale.getKeyNames(event.keyCode)[0])) { + this._targetKeyUpBinding(event); + } +}; + +module.exports = Keyboard; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"./key-combo":4,"./locale":6}],6:[function(require,module,exports){ + +var KeyCombo = require('./key-combo'); + + +function Locale(name) { + this.localeName = name; + this.pressedKeys = []; + this._appliedMacros = []; + this._keyMap = {}; + this._killKeyCodes = []; + this._macros = []; +} + +Locale.prototype.bindKeyCode = function(keyCode, keyNames) { + if (typeof keyNames === 'string') { + keyNames = [keyNames]; + } + + this._keyMap[keyCode] = keyNames; +}; + +Locale.prototype.bindMacro = function(keyComboStr, keyNames) { + if (typeof keyNames === 'string') { + keyNames = [ keyNames ]; + } + + var handler = null; + if (typeof keyNames === 'function') { + handler = keyNames; + keyNames = null; + } + + var macro = { + keyCombo : new KeyCombo(keyComboStr), + keyNames : keyNames, + handler : handler + }; + + this._macros.push(macro); +}; + +Locale.prototype.getKeyCodes = function(keyName) { + var keyCodes = []; + for (var keyCode in this._keyMap) { + var index = this._keyMap[keyCode].indexOf(keyName); + if (index > -1) { keyCodes.push(keyCode|0); } + } + return keyCodes; +}; + +Locale.prototype.getKeyNames = function(keyCode) { + return this._keyMap[keyCode] || []; +}; + +Locale.prototype.setKillKey = function(keyCode) { + if (typeof keyCode === 'string') { + var keyCodes = this.getKeyCodes(keyCode); + for (var i = 0; i < keyCodes.length; i += 1) { + this.setKillKey(keyCodes[i]); + } + return; + } + + this._killKeyCodes.push(keyCode); +}; + +Locale.prototype.pressKey = function(keyCode) { + if (typeof keyCode === 'string') { + var keyCodes = this.getKeyCodes(keyCode); + for (var i = 0; i < keyCodes.length; i += 1) { + this.pressKey(keyCodes[i]); + } + return; + } + + var keyNames = this.getKeyNames(keyCode); + for (var i = 0; i < keyNames.length; i += 1) { + if (this.pressedKeys.indexOf(keyNames[i]) === -1) { + this.pressedKeys.push(keyNames[i]); + } + } + + this._applyMacros(); +}; + +Locale.prototype.releaseKey = function(keyCode) { + if (typeof keyCode === 'string') { + var keyCodes = this.getKeyCodes(keyCode); + for (var i = 0; i < keyCodes.length; i += 1) { + this.releaseKey(keyCodes[i]); + } + } + + else { + var keyNames = this.getKeyNames(keyCode); + var killKeyCodeIndex = this._killKeyCodes.indexOf(keyCode); + + if (killKeyCodeIndex > -1) { + this.pressedKeys.length = 0; + } else { + for (var i = 0; i < keyNames.length; i += 1) { + var index = this.pressedKeys.indexOf(keyNames[i]); + if (index > -1) { + this.pressedKeys.splice(index, 1); + } + } + } + + this._clearMacros(); + } +}; + +Locale.prototype._applyMacros = function() { + var macros = this._macros.slice(0); + for (var i = 0; i < macros.length; i += 1) { + var macro = macros[i]; + if (macro.keyCombo.check(this.pressedKeys)) { + if (macro.handler) { + macro.keyNames = macro.handler(this.pressedKeys); + } + for (var j = 0; j < macro.keyNames.length; j += 1) { + if (this.pressedKeys.indexOf(macro.keyNames[j]) === -1) { + this.pressedKeys.push(macro.keyNames[j]); + } + } + this._appliedMacros.push(macro); + } + } +}; + +Locale.prototype._clearMacros = function() { + for (var i = 0; i < this._appliedMacros.length; i += 1) { + var macro = this._appliedMacros[i]; + if (!macro.keyCombo.check(this.pressedKeys)) { + for (var j = 0; j < macro.keyNames.length; j += 1) { + var index = this.pressedKeys.indexOf(macro.keyNames[j]); + if (index > -1) { + this.pressedKeys.splice(index, 1); + } + } + if (macro.handler) { + macro.keyNames = null; + } + this._appliedMacros.splice(i, 1); + i -= 1; + } + } +}; + + +module.exports = Locale; + +},{"./key-combo":4}],7:[function(require,module,exports){ + +module.exports = function(locale, platform, userAgent) { + + // general + locale.bindKeyCode(3, ['cancel']); + locale.bindKeyCode(8, ['backspace']); + locale.bindKeyCode(9, ['tab']); + locale.bindKeyCode(12, ['clear']); + locale.bindKeyCode(13, ['enter']); + locale.bindKeyCode(16, ['shift']); + locale.bindKeyCode(17, ['ctrl']); + locale.bindKeyCode(18, ['alt', 'menu']); + locale.bindKeyCode(19, ['pause', 'break']); + locale.bindKeyCode(20, ['capslock']); + locale.bindKeyCode(27, ['escape', 'esc']); + locale.bindKeyCode(32, ['space', 'spacebar']); + locale.bindKeyCode(33, ['pageup']); + locale.bindKeyCode(34, ['pagedown']); + locale.bindKeyCode(35, ['end']); + locale.bindKeyCode(36, ['home']); + locale.bindKeyCode(37, ['left']); + locale.bindKeyCode(38, ['up']); + locale.bindKeyCode(39, ['right']); + locale.bindKeyCode(40, ['down']); + locale.bindKeyCode(41, ['select']); + locale.bindKeyCode(42, ['printscreen']); + locale.bindKeyCode(43, ['execute']); + locale.bindKeyCode(44, ['snapshot']); + locale.bindKeyCode(45, ['insert', 'ins']); + locale.bindKeyCode(46, ['delete', 'del']); + locale.bindKeyCode(47, ['help']); + locale.bindKeyCode(145, ['scrolllock', 'scroll']); + locale.bindKeyCode(187, ['equal', 'equalsign', '=']); + locale.bindKeyCode(188, ['comma', ',']); + locale.bindKeyCode(190, ['period', '.']); + locale.bindKeyCode(191, ['slash', 'forwardslash', '/']); + locale.bindKeyCode(192, ['graveaccent', '`']); + locale.bindKeyCode(219, ['openbracket', '[']); + locale.bindKeyCode(220, ['backslash', '\\']); + locale.bindKeyCode(221, ['closebracket', ']']); + locale.bindKeyCode(222, ['apostrophe', '\'']); + + // 0-9 + locale.bindKeyCode(48, ['zero', '0']); + locale.bindKeyCode(49, ['one', '1']); + locale.bindKeyCode(50, ['two', '2']); + locale.bindKeyCode(51, ['three', '3']); + locale.bindKeyCode(52, ['four', '4']); + locale.bindKeyCode(53, ['five', '5']); + locale.bindKeyCode(54, ['six', '6']); + locale.bindKeyCode(55, ['seven', '7']); + locale.bindKeyCode(56, ['eight', '8']); + locale.bindKeyCode(57, ['nine', '9']); + + // numpad + locale.bindKeyCode(96, ['numzero', 'num0']); + locale.bindKeyCode(97, ['numone', 'num1']); + locale.bindKeyCode(98, ['numtwo', 'num2']); + locale.bindKeyCode(99, ['numthree', 'num3']); + locale.bindKeyCode(100, ['numfour', 'num4']); + locale.bindKeyCode(101, ['numfive', 'num5']); + locale.bindKeyCode(102, ['numsix', 'num6']); + locale.bindKeyCode(103, ['numseven', 'num7']); + locale.bindKeyCode(104, ['numeight', 'num8']); + locale.bindKeyCode(105, ['numnine', 'num9']); + locale.bindKeyCode(106, ['nummultiply', 'num*']); + locale.bindKeyCode(107, ['numadd', 'num+']); + locale.bindKeyCode(108, ['numenter']); + locale.bindKeyCode(109, ['numsubtract', 'num-']); + locale.bindKeyCode(110, ['numdecimal', 'num.']); + locale.bindKeyCode(111, ['numdivide', 'num/']); + locale.bindKeyCode(144, ['numlock', 'num']); + + // function keys + locale.bindKeyCode(112, ['f1']); + locale.bindKeyCode(113, ['f2']); + locale.bindKeyCode(114, ['f3']); + locale.bindKeyCode(115, ['f4']); + locale.bindKeyCode(116, ['f5']); + locale.bindKeyCode(117, ['f6']); + locale.bindKeyCode(118, ['f7']); + locale.bindKeyCode(119, ['f8']); + locale.bindKeyCode(120, ['f9']); + locale.bindKeyCode(121, ['f10']); + locale.bindKeyCode(122, ['f11']); + locale.bindKeyCode(123, ['f12']); + + // secondary key symbols + locale.bindMacro('shift + `', ['tilde', '~']); + locale.bindMacro('shift + 1', ['exclamation', 'exclamationpoint', '!']); + locale.bindMacro('shift + 2', ['at', '@']); + locale.bindMacro('shift + 3', ['number', '#']); + locale.bindMacro('shift + 4', ['dollar', 'dollars', 'dollarsign', '$']); + locale.bindMacro('shift + 5', ['percent', '%']); + locale.bindMacro('shift + 6', ['caret', '^']); + locale.bindMacro('shift + 7', ['ampersand', 'and', '&']); + locale.bindMacro('shift + 8', ['asterisk', '*']); + locale.bindMacro('shift + 9', ['openparen', '(']); + locale.bindMacro('shift + 0', ['closeparen', ')']); + locale.bindMacro('shift + -', ['underscore', '_']); + locale.bindMacro('shift + =', ['plus', '+']); + locale.bindMacro('shift + [', ['opencurlybrace', 'opencurlybracket', '{']); + locale.bindMacro('shift + ]', ['closecurlybrace', 'closecurlybracket', '}']); + locale.bindMacro('shift + \\', ['verticalbar', '|']); + locale.bindMacro('shift + ;', ['colon', ':']); + locale.bindMacro('shift + \'', ['quotationmark', '\'']); + locale.bindMacro('shift + !,', ['openanglebracket', '<']); + locale.bindMacro('shift + .', ['closeanglebracket', '>']); + locale.bindMacro('shift + /', ['questionmark', '?']); + + if (platform.match('Mac')) { + locale.bindMacro('command', ['mod', 'modifier']); + } else { + locale.bindMacro('ctrl', ['mod', 'modifier']); + } + + //a-z and A-Z + for (var keyCode = 65; keyCode <= 90; keyCode += 1) { + var keyName = String.fromCharCode(keyCode + 32); + var capitalKeyName = String.fromCharCode(keyCode); + locale.bindKeyCode(keyCode, keyName); + locale.bindMacro('shift + ' + keyName, capitalKeyName); + locale.bindMacro('capslock + ' + keyName, capitalKeyName); + } + + // browser caveats + var semicolonKeyCode = userAgent.match('Firefox') ? 59 : 186; + var dashKeyCode = userAgent.match('Firefox') ? 173 : 189; + var leftCommandKeyCode; + var rightCommandKeyCode; + if (platform.match('Mac') && (userAgent.match('Safari') || userAgent.match('Chrome'))) { + leftCommandKeyCode = 91; + rightCommandKeyCode = 93; + } else if(platform.match('Mac') && userAgent.match('Opera')) { + leftCommandKeyCode = 17; + rightCommandKeyCode = 17; + } else if(platform.match('Mac') && userAgent.match('Firefox')) { + leftCommandKeyCode = 224; + rightCommandKeyCode = 224; + } + locale.bindKeyCode(semicolonKeyCode, ['semicolon', ';']); + locale.bindKeyCode(dashKeyCode, ['dash', '-']); + locale.bindKeyCode(leftCommandKeyCode, ['command', 'windows', 'win', 'super', 'leftcommand', 'leftwindows', 'leftwin', 'leftsuper']); + locale.bindKeyCode(rightCommandKeyCode, ['command', 'windows', 'win', 'super', 'rightcommand', 'rightwindows', 'rightwin', 'rightsuper']); + + // kill keys + locale.setKillKey('command'); +}; + +},{}],8:[function(require,module,exports){ +(function (global){ +/** + * @license + * Lodash + * Copyright JS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ +;(function() { + + /** Used as a safe reference for `undefined` in pre-ES5 environments. */ + var undefined; + + /** Used as the semantic version number. */ + var VERSION = '4.17.5'; + + /** Used as the size to enable large array optimizations. */ + var LARGE_ARRAY_SIZE = 200; + + /** Error message constants. */ + var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.', + FUNC_ERROR_TEXT = 'Expected a function'; + + /** Used to stand-in for `undefined` hash values. */ + var HASH_UNDEFINED = '__lodash_hash_undefined__'; + + /** Used as the maximum memoize cache size. */ + var MAX_MEMOIZE_SIZE = 500; + + /** Used as the internal argument placeholder. */ + var PLACEHOLDER = '__lodash_placeholder__'; + + /** Used to compose bitmasks for cloning. */ + var CLONE_DEEP_FLAG = 1, + CLONE_FLAT_FLAG = 2, + CLONE_SYMBOLS_FLAG = 4; + + /** Used to compose bitmasks for value comparisons. */ + var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + + /** Used to compose bitmasks for function metadata. */ + var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_CURRY_BOUND_FLAG = 4, + WRAP_CURRY_FLAG = 8, + WRAP_CURRY_RIGHT_FLAG = 16, + WRAP_PARTIAL_FLAG = 32, + WRAP_PARTIAL_RIGHT_FLAG = 64, + WRAP_ARY_FLAG = 128, + WRAP_REARG_FLAG = 256, + WRAP_FLIP_FLAG = 512; + + /** Used as default options for `_.truncate`. */ + var DEFAULT_TRUNC_LENGTH = 30, + DEFAULT_TRUNC_OMISSION = '...'; + + /** Used to detect hot functions by number of calls within a span of milliseconds. */ + var HOT_COUNT = 800, + HOT_SPAN = 16; + + /** Used to indicate the type of lazy iteratees. */ + var LAZY_FILTER_FLAG = 1, + LAZY_MAP_FLAG = 2, + LAZY_WHILE_FLAG = 3; + + /** Used as references for various `Number` constants. */ + var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991, + MAX_INTEGER = 1.7976931348623157e+308, + NAN = 0 / 0; + + /** Used as references for the maximum length and index of an array. */ + var MAX_ARRAY_LENGTH = 4294967295, + MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, + HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; + + /** Used to associate wrap methods with their bit flags. */ + var wrapFlags = [ + ['ary', WRAP_ARY_FLAG], + ['bind', WRAP_BIND_FLAG], + ['bindKey', WRAP_BIND_KEY_FLAG], + ['curry', WRAP_CURRY_FLAG], + ['curryRight', WRAP_CURRY_RIGHT_FLAG], + ['flip', WRAP_FLIP_FLAG], + ['partial', WRAP_PARTIAL_FLAG], + ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], + ['rearg', WRAP_REARG_FLAG] + ]; + + /** `Object#toString` result references. */ + var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + asyncTag = '[object AsyncFunction]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + domExcTag = '[object DOMException]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + nullTag = '[object Null]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + proxyTag = '[object Proxy]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + undefinedTag = '[object Undefined]', + weakMapTag = '[object WeakMap]', + weakSetTag = '[object WeakSet]'; + + var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + + /** Used to match empty string literals in compiled template source. */ + var reEmptyStringLeading = /\b__p \+= '';/g, + reEmptyStringMiddle = /\b(__p \+=) '' \+/g, + reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; + + /** Used to match HTML entities and HTML characters. */ + var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, + reUnescapedHtml = /[&<>"']/g, + reHasEscapedHtml = RegExp(reEscapedHtml.source), + reHasUnescapedHtml = RegExp(reUnescapedHtml.source); + + /** Used to match template delimiters. */ + var reEscape = /<%-([\s\S]+?)%>/g, + reEvaluate = /<%([\s\S]+?)%>/g, + reInterpolate = /<%=([\s\S]+?)%>/g; + + /** Used to match property names within property paths. */ + var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/, + rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + + /** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ + var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, + reHasRegExpChar = RegExp(reRegExpChar.source); + + /** Used to match leading and trailing whitespace. */ + var reTrim = /^\s+|\s+$/g, + reTrimStart = /^\s+/, + reTrimEnd = /\s+$/; + + /** Used to match wrap detail comments. */ + var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, + reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, + reSplitDetails = /,? & /; + + /** Used to match words composed of alphanumeric characters. */ + var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; + + /** Used to match backslashes in property paths. */ + var reEscapeChar = /\\(\\)?/g; + + /** + * Used to match + * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components). + */ + var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; + + /** Used to match `RegExp` flags from their coerced string values. */ + var reFlags = /\w*$/; + + /** Used to detect bad signed hexadecimal string values. */ + var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + + /** Used to detect binary string values. */ + var reIsBinary = /^0b[01]+$/i; + + /** Used to detect host constructors (Safari). */ + var reIsHostCtor = /^\[object .+?Constructor\]$/; + + /** Used to detect octal string values. */ + var reIsOctal = /^0o[0-7]+$/i; + + /** Used to detect unsigned integer values. */ + var reIsUint = /^(?:0|[1-9]\d*)$/; + + /** Used to match Latin Unicode letters (excluding mathematical operators). */ + var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; + + /** Used to ensure capturing order of template delimiters. */ + var reNoMatch = /($^)/; + + /** Used to match unescaped characters in compiled string literals. */ + var reUnescapedString = /['\n\r\u2028\u2029\\]/g; + + /** Used to compose unicode character classes. */ + var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f', + reComboHalfMarksRange = '\\ufe20-\\ufe2f', + rsComboSymbolsRange = '\\u20d0-\\u20ff', + rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, + rsDingbatRange = '\\u2700-\\u27bf', + rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', + rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', + rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', + rsPunctuationRange = '\\u2000-\\u206f', + rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000', + rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', + rsVarRange = '\\ufe0e\\ufe0f', + rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; + + /** Used to compose unicode capture groups. */ + var rsApos = "['\u2019]", + rsAstral = '[' + rsAstralRange + ']', + rsBreak = '[' + rsBreakRange + ']', + rsCombo = '[' + rsComboRange + ']', + rsDigits = '\\d+', + rsDingbat = '[' + rsDingbatRange + ']', + rsLower = '[' + rsLowerRange + ']', + rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', + rsFitz = '\\ud83c[\\udffb-\\udfff]', + rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', + rsNonAstral = '[^' + rsAstralRange + ']', + rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', + rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', + rsUpper = '[' + rsUpperRange + ']', + rsZWJ = '\\u200d'; + + /** Used to compose unicode regexes. */ + var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')', + rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')', + rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', + rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', + reOptMod = rsModifier + '?', + rsOptVar = '[' + rsVarRange + ']?', + rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])', + rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])', + rsSeq = rsOptVar + reOptMod + rsOptJoin, + rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, + rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; + + /** Used to match apostrophes. */ + var reApos = RegExp(rsApos, 'g'); + + /** + * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and + * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). + */ + var reComboMark = RegExp(rsCombo, 'g'); + + /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ + var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + + /** Used to match complex or compound words. */ + var reUnicodeWord = RegExp([ + rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', + rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')', + rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower, + rsUpper + '+' + rsOptContrUpper, + rsOrdUpper, + rsOrdLower, + rsDigits, + rsEmoji + ].join('|'), 'g'); + + /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ + var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); + + /** Used to detect strings that need a more robust regexp to match words. */ + var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; + + /** Used to assign default `context` object properties. */ + var contextProps = [ + 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array', + 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object', + 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array', + 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', + '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout' + ]; + + /** Used to make template sourceURLs easier to identify. */ + var templateCounter = -1; + + /** Used to identify `toStringTag` values of typed arrays. */ + var typedArrayTags = {}; + typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = + typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = + typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = + typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = + typedArrayTags[uint32Tag] = true; + typedArrayTags[argsTag] = typedArrayTags[arrayTag] = + typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = + typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = + typedArrayTags[errorTag] = typedArrayTags[funcTag] = + typedArrayTags[mapTag] = typedArrayTags[numberTag] = + typedArrayTags[objectTag] = typedArrayTags[regexpTag] = + typedArrayTags[setTag] = typedArrayTags[stringTag] = + typedArrayTags[weakMapTag] = false; + + /** Used to identify `toStringTag` values supported by `_.clone`. */ + var cloneableTags = {}; + cloneableTags[argsTag] = cloneableTags[arrayTag] = + cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = + cloneableTags[boolTag] = cloneableTags[dateTag] = + cloneableTags[float32Tag] = cloneableTags[float64Tag] = + cloneableTags[int8Tag] = cloneableTags[int16Tag] = + cloneableTags[int32Tag] = cloneableTags[mapTag] = + cloneableTags[numberTag] = cloneableTags[objectTag] = + cloneableTags[regexpTag] = cloneableTags[setTag] = + cloneableTags[stringTag] = cloneableTags[symbolTag] = + cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = + cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; + cloneableTags[errorTag] = cloneableTags[funcTag] = + cloneableTags[weakMapTag] = false; + + /** Used to map Latin Unicode letters to basic Latin letters. */ + var deburredLetters = { + // Latin-1 Supplement block. + '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', + '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', + '\xc7': 'C', '\xe7': 'c', + '\xd0': 'D', '\xf0': 'd', + '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', + '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', + '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', + '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', + '\xd1': 'N', '\xf1': 'n', + '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', + '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', + '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', + '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', + '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', + '\xc6': 'Ae', '\xe6': 'ae', + '\xde': 'Th', '\xfe': 'th', + '\xdf': 'ss', + // Latin Extended-A block. + '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', + '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', + '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', + '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', + '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', + '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', + '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', + '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', + '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', + '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', + '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', + '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', + '\u0134': 'J', '\u0135': 'j', + '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', + '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', + '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', + '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', + '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', + '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', + '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', + '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', + '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', + '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', + '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', + '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', + '\u0163': 't', '\u0165': 't', '\u0167': 't', + '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', + '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', + '\u0174': 'W', '\u0175': 'w', + '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', + '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', + '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', + '\u0132': 'IJ', '\u0133': 'ij', + '\u0152': 'Oe', '\u0153': 'oe', + '\u0149': "'n", '\u017f': 's' + }; + + /** Used to map characters to HTML entities. */ + var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }; + + /** Used to map HTML entities to characters. */ + var htmlUnescapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'" + }; + + /** Used to escape characters for inclusion in compiled string literals. */ + var stringEscapes = { + '\\': '\\', + "'": "'", + '\n': 'n', + '\r': 'r', + '\u2028': 'u2028', + '\u2029': 'u2029' + }; + + /** Built-in method references without a dependency on `root`. */ + var freeParseFloat = parseFloat, + freeParseInt = parseInt; + + /** Detect free variable `global` from Node.js. */ + var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + + /** Detect free variable `self`. */ + var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + + /** Used as a reference to the global object. */ + var root = freeGlobal || freeSelf || Function('return this')(); + + /** Detect free variable `exports`. */ + var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + + /** Detect free variable `module`. */ + var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + + /** Detect the popular CommonJS extension `module.exports`. */ + var moduleExports = freeModule && freeModule.exports === freeExports; + + /** Detect free variable `process` from Node.js. */ + var freeProcess = moduleExports && freeGlobal.process; + + /** Used to access faster Node.js helpers. */ + var nodeUtil = (function() { + try { + return freeProcess && freeProcess.binding && freeProcess.binding('util'); + } catch (e) {} + }()); + + /* Node.js helper references. */ + var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, + nodeIsDate = nodeUtil && nodeUtil.isDate, + nodeIsMap = nodeUtil && nodeUtil.isMap, + nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, + nodeIsSet = nodeUtil && nodeUtil.isSet, + nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + + /*--------------------------------------------------------------------------*/ + + /** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ + function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); + } + + /** + * A specialized version of `baseAggregator` for arrays. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ + function arrayAggregator(array, setter, iteratee, accumulator) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + var value = array[index]; + setter(accumulator, value, iteratee(value), array); + } + return accumulator; + } + + /** + * A specialized version of `_.forEach` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ + function arrayEach(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } + } + return array; + } + + /** + * A specialized version of `_.forEachRight` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ + function arrayEachRight(array, iteratee) { + var length = array == null ? 0 : array.length; + + while (length--) { + if (iteratee(array[length], length, array) === false) { + break; + } + } + return array; + } + + /** + * A specialized version of `_.every` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + */ + function arrayEvery(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (!predicate(array[index], index, array)) { + return false; + } + } + return true; + } + + /** + * A specialized version of `_.filter` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ + function arrayFilter(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; + } + } + return result; + } + + /** + * A specialized version of `_.includes` for arrays without support for + * specifying an index to search from. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ + function arrayIncludes(array, value) { + var length = array == null ? 0 : array.length; + return !!length && baseIndexOf(array, value, 0) > -1; + } + + /** + * This function is like `arrayIncludes` except that it accepts a comparator. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @param {Function} comparator The comparator invoked per element. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ + function arrayIncludesWith(array, value, comparator) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (comparator(value, array[index])) { + return true; + } + } + return false; + } + + /** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function arrayMap(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; + } + + /** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ + function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; + } + + /** + * A specialized version of `_.reduce` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the first element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ + function arrayReduce(array, iteratee, accumulator, initAccum) { + var index = -1, + length = array == null ? 0 : array.length; + + if (initAccum && length) { + accumulator = array[++index]; + } + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); + } + return accumulator; + } + + /** + * A specialized version of `_.reduceRight` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the last element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ + function arrayReduceRight(array, iteratee, accumulator, initAccum) { + var length = array == null ? 0 : array.length; + if (initAccum && length) { + accumulator = array[--length]; + } + while (length--) { + accumulator = iteratee(accumulator, array[length], length, array); + } + return accumulator; + } + + /** + * A specialized version of `_.some` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ + function arraySome(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; + } + + /** + * Gets the size of an ASCII `string`. + * + * @private + * @param {string} string The string inspect. + * @returns {number} Returns the string size. + */ + var asciiSize = baseProperty('length'); + + /** + * Converts an ASCII `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function asciiToArray(string) { + return string.split(''); + } + + /** + * Splits an ASCII `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ + function asciiWords(string) { + return string.match(reAsciiWord) || []; + } + + /** + * The base implementation of methods like `_.findKey` and `_.findLastKey`, + * without support for iteratee shorthands, which iterates over `collection` + * using `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the found element or its key, else `undefined`. + */ + function baseFindKey(collection, predicate, eachFunc) { + var result; + eachFunc(collection, function(value, key, collection) { + if (predicate(value, key, collection)) { + result = key; + return false; + } + }); + return result; + } + + /** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; + } + + /** + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseIndexOf(array, value, fromIndex) { + return value === value + ? strictIndexOf(array, value, fromIndex) + : baseFindIndex(array, baseIsNaN, fromIndex); + } + + /** + * This function is like `baseIndexOf` except that it accepts a comparator. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @param {Function} comparator The comparator invoked per element. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseIndexOfWith(array, value, fromIndex, comparator) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (comparator(array[index], value)) { + return index; + } + } + return -1; + } + + /** + * The base implementation of `_.isNaN` without support for number objects. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + */ + function baseIsNaN(value) { + return value !== value; + } + + /** + * The base implementation of `_.mean` and `_.meanBy` without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the mean. + */ + function baseMean(array, iteratee) { + var length = array == null ? 0 : array.length; + return length ? (baseSum(array, iteratee) / length) : NAN; + } + + /** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. + */ + function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; + } + + /** + * The base implementation of `_.propertyOf` without support for deep paths. + * + * @private + * @param {Object} object The object to query. + * @returns {Function} Returns the new accessor function. + */ + function basePropertyOf(object) { + return function(key) { + return object == null ? undefined : object[key]; + }; + } + + /** + * The base implementation of `_.reduce` and `_.reduceRight`, without support + * for iteratee shorthands, which iterates over `collection` using `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} accumulator The initial value. + * @param {boolean} initAccum Specify using the first or last element of + * `collection` as the initial value. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the accumulated value. + */ + function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { + eachFunc(collection, function(value, index, collection) { + accumulator = initAccum + ? (initAccum = false, value) + : iteratee(accumulator, value, index, collection); + }); + return accumulator; + } + + /** + * The base implementation of `_.sortBy` which uses `comparer` to define the + * sort order of `array` and replaces criteria objects with their corresponding + * values. + * + * @private + * @param {Array} array The array to sort. + * @param {Function} comparer The function to define sort order. + * @returns {Array} Returns `array`. + */ + function baseSortBy(array, comparer) { + var length = array.length; + + array.sort(comparer); + while (length--) { + array[length] = array[length].value; + } + return array; + } + + /** + * The base implementation of `_.sum` and `_.sumBy` without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the sum. + */ + function baseSum(array, iteratee) { + var result, + index = -1, + length = array.length; + + while (++index < length) { + var current = iteratee(array[index]); + if (current !== undefined) { + result = result === undefined ? current : (result + current); + } + } + return result; + } + + /** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ + function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; + } + + /** + * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array + * of key-value pairs for `object` corresponding to the property names of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the key-value pairs. + */ + function baseToPairs(object, props) { + return arrayMap(props, function(key) { + return [key, object[key]]; + }); + } + + /** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ + function baseUnary(func) { + return function(value) { + return func(value); + }; + } + + /** + * The base implementation of `_.values` and `_.valuesIn` which creates an + * array of `object` property values corresponding to the property names + * of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the array of property values. + */ + function baseValues(object, props) { + return arrayMap(props, function(key) { + return object[key]; + }); + } + + /** + * Checks if a `cache` value for `key` exists. + * + * @private + * @param {Object} cache The cache to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function cacheHas(cache, key) { + return cache.has(key); + } + + /** + * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the first unmatched string symbol. + */ + function charsStartIndex(strSymbols, chrSymbols) { + var index = -1, + length = strSymbols.length; + + while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; + } + + /** + * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the last unmatched string symbol. + */ + function charsEndIndex(strSymbols, chrSymbols) { + var index = strSymbols.length; + + while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; + } + + /** + * Gets the number of `placeholder` occurrences in `array`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} placeholder The placeholder to search for. + * @returns {number} Returns the placeholder count. + */ + function countHolders(array, placeholder) { + var length = array.length, + result = 0; + + while (length--) { + if (array[length] === placeholder) { + ++result; + } + } + return result; + } + + /** + * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A + * letters to basic Latin letters. + * + * @private + * @param {string} letter The matched letter to deburr. + * @returns {string} Returns the deburred letter. + */ + var deburrLetter = basePropertyOf(deburredLetters); + + /** + * Used by `_.escape` to convert characters to HTML entities. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ + var escapeHtmlChar = basePropertyOf(htmlEscapes); + + /** + * Used by `_.template` to escape characters for inclusion in compiled string literals. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ + function escapeStringChar(chr) { + return '\\' + stringEscapes[chr]; + } + + /** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ + function getValue(object, key) { + return object == null ? undefined : object[key]; + } + + /** + * Checks if `string` contains Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a symbol is found, else `false`. + */ + function hasUnicode(string) { + return reHasUnicode.test(string); + } + + /** + * Checks if `string` contains a word composed of Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a word is found, else `false`. + */ + function hasUnicodeWord(string) { + return reHasUnicodeWord.test(string); + } + + /** + * Converts `iterator` to an array. + * + * @private + * @param {Object} iterator The iterator to convert. + * @returns {Array} Returns the converted array. + */ + function iteratorToArray(iterator) { + var data, + result = []; + + while (!(data = iterator.next()).done) { + result.push(data.value); + } + return result; + } + + /** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ + function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; + } + + /** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ + function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; + } + + /** + * Replaces all `placeholder` elements in `array` with an internal placeholder + * and returns an array of their indexes. + * + * @private + * @param {Array} array The array to modify. + * @param {*} placeholder The placeholder to replace. + * @returns {Array} Returns the new array of placeholder indexes. + */ + function replaceHolders(array, placeholder) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value === placeholder || value === PLACEHOLDER) { + array[index] = PLACEHOLDER; + result[resIndex++] = index; + } + } + return result; + } + + /** + * Gets the value at `key`, unless `key` is "__proto__". + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ + function safeGet(object, key) { + return key == '__proto__' + ? undefined + : object[key]; + } + + /** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ + function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; + } + + /** + * Converts `set` to its value-value pairs. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the value-value pairs. + */ + function setToPairs(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = [value, value]; + }); + return result; + } + + /** + * A specialized version of `_.indexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function strictIndexOf(array, value, fromIndex) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; + } + + /** + * A specialized version of `_.lastIndexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function strictLastIndexOf(array, value, fromIndex) { + var index = fromIndex + 1; + while (index--) { + if (array[index] === value) { + return index; + } + } + return index; + } + + /** + * Gets the number of symbols in `string`. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the string size. + */ + function stringSize(string) { + return hasUnicode(string) + ? unicodeSize(string) + : asciiSize(string); + } + + /** + * Converts `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function stringToArray(string) { + return hasUnicode(string) + ? unicodeToArray(string) + : asciiToArray(string); + } + + /** + * Used by `_.unescape` to convert HTML entities to characters. + * + * @private + * @param {string} chr The matched character to unescape. + * @returns {string} Returns the unescaped character. + */ + var unescapeHtmlChar = basePropertyOf(htmlUnescapes); + + /** + * Gets the size of a Unicode `string`. + * + * @private + * @param {string} string The string inspect. + * @returns {number} Returns the string size. + */ + function unicodeSize(string) { + var result = reUnicode.lastIndex = 0; + while (reUnicode.test(string)) { + ++result; + } + return result; + } + + /** + * Converts a Unicode `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function unicodeToArray(string) { + return string.match(reUnicode) || []; + } + + /** + * Splits a Unicode `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ + function unicodeWords(string) { + return string.match(reUnicodeWord) || []; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Create a new pristine `lodash` function using the `context` object. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Util + * @param {Object} [context=root] The context object. + * @returns {Function} Returns a new `lodash` function. + * @example + * + * _.mixin({ 'foo': _.constant('foo') }); + * + * var lodash = _.runInContext(); + * lodash.mixin({ 'bar': lodash.constant('bar') }); + * + * _.isFunction(_.foo); + * // => true + * _.isFunction(_.bar); + * // => false + * + * lodash.isFunction(lodash.foo); + * // => false + * lodash.isFunction(lodash.bar); + * // => true + * + * // Create a suped-up `defer` in Node.js. + * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; + */ + var runInContext = (function runInContext(context) { + context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps)); + + /** Built-in constructor references. */ + var Array = context.Array, + Date = context.Date, + Error = context.Error, + Function = context.Function, + Math = context.Math, + Object = context.Object, + RegExp = context.RegExp, + String = context.String, + TypeError = context.TypeError; + + /** Used for built-in method references. */ + var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + + /** Used to detect overreaching core-js shims. */ + var coreJsData = context['__core-js_shared__']; + + /** Used to resolve the decompiled source of functions. */ + var funcToString = funcProto.toString; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** Used to generate unique IDs. */ + var idCounter = 0; + + /** Used to detect methods masquerading as native. */ + var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; + }()); + + /** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ + var nativeObjectToString = objectProto.toString; + + /** Used to infer the `Object` constructor. */ + var objectCtorString = funcToString.call(Object); + + /** Used to restore the original `_` reference in `_.noConflict`. */ + var oldDash = root._; + + /** Used to detect if a method is native. */ + var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' + ); + + /** Built-in value references. */ + var Buffer = moduleExports ? context.Buffer : undefined, + Symbol = context.Symbol, + Uint8Array = context.Uint8Array, + allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, + getPrototype = overArg(Object.getPrototypeOf, Object), + objectCreate = Object.create, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice, + spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined, + symIterator = Symbol ? Symbol.iterator : undefined, + symToStringTag = Symbol ? Symbol.toStringTag : undefined; + + var defineProperty = (function() { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} + }()); + + /** Mocked built-ins. */ + var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, + ctxNow = Date && Date.now !== root.Date.now && Date.now, + ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout; + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeCeil = Math.ceil, + nativeFloor = Math.floor, + nativeGetSymbols = Object.getOwnPropertySymbols, + nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, + nativeIsFinite = context.isFinite, + nativeJoin = arrayProto.join, + nativeKeys = overArg(Object.keys, Object), + nativeMax = Math.max, + nativeMin = Math.min, + nativeNow = Date.now, + nativeParseInt = context.parseInt, + nativeRandom = Math.random, + nativeReverse = arrayProto.reverse; + + /* Built-in method references that are verified to be native. */ + var DataView = getNative(context, 'DataView'), + Map = getNative(context, 'Map'), + Promise = getNative(context, 'Promise'), + Set = getNative(context, 'Set'), + WeakMap = getNative(context, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); + + /** Used to store function metadata. */ + var metaMap = WeakMap && new WeakMap; + + /** Used to lookup unminified function names. */ + var realNames = {}; + + /** Used to detect maps, sets, and weakmaps. */ + var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + + /** Used to convert symbols to primitives and strings. */ + var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` object which wraps `value` to enable implicit method + * chain sequences. Methods that operate on and return arrays, collections, + * and functions can be chained together. Methods that retrieve a single value + * or may return a primitive value will automatically end the chain sequence + * and return the unwrapped value. Otherwise, the value must be unwrapped + * with `_#value`. + * + * Explicit chain sequences, which must be unwrapped with `_#value`, may be + * enabled using `_.chain`. + * + * The execution of chained methods is lazy, that is, it's deferred until + * `_#value` is implicitly or explicitly called. + * + * Lazy evaluation allows several methods to support shortcut fusion. + * Shortcut fusion is an optimization to merge iteratee calls; this avoids + * the creation of intermediate arrays and can greatly reduce the number of + * iteratee executions. Sections of a chain sequence qualify for shortcut + * fusion if the section is applied to an array and iteratees accept only + * one argument. The heuristic for whether a section qualifies for shortcut + * fusion is subject to change. + * + * Chaining is supported in custom builds as long as the `_#value` method is + * directly or indirectly included in the build. + * + * In addition to lodash methods, wrappers have `Array` and `String` methods. + * + * The wrapper `Array` methods are: + * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` + * + * The wrapper `String` methods are: + * `replace` and `split` + * + * The wrapper methods that support shortcut fusion are: + * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, + * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, + * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` + * + * The chainable wrapper methods are: + * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, + * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, + * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, + * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, + * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, + * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, + * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, + * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, + * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, + * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, + * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, + * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, + * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, + * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, + * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, + * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, + * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, + * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, + * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, + * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, + * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, + * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, + * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, + * `zipObject`, `zipObjectDeep`, and `zipWith` + * + * The wrapper methods that are **not** chainable by default are: + * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, + * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, + * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, + * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, + * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, + * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, + * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, + * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, + * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, + * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, + * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, + * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, + * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, + * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, + * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, + * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, + * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, + * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, + * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, + * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, + * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, + * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, + * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, + * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, + * `upperFirst`, `value`, and `words` + * + * @name _ + * @constructor + * @category Seq + * @param {*} value The value to wrap in a `lodash` instance. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * function square(n) { + * return n * n; + * } + * + * var wrapped = _([1, 2, 3]); + * + * // Returns an unwrapped value. + * wrapped.reduce(_.add); + * // => 6 + * + * // Returns a wrapped value. + * var squares = wrapped.map(square); + * + * _.isArray(squares); + * // => false + * + * _.isArray(squares.value()); + * // => true + */ + function lodash(value) { + if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { + if (value instanceof LodashWrapper) { + return value; + } + if (hasOwnProperty.call(value, '__wrapped__')) { + return wrapperClone(value); + } + } + return new LodashWrapper(value); + } + + /** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} proto The object to inherit from. + * @returns {Object} Returns the new object. + */ + var baseCreate = (function() { + function object() {} + return function(proto) { + if (!isObject(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = proto; + var result = new object; + object.prototype = undefined; + return result; + }; + }()); + + /** + * The function whose prototype chain sequence wrappers inherit from. + * + * @private + */ + function baseLodash() { + // No operation performed. + } + + /** + * The base constructor for creating `lodash` wrapper objects. + * + * @private + * @param {*} value The value to wrap. + * @param {boolean} [chainAll] Enable explicit method chain sequences. + */ + function LodashWrapper(value, chainAll) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__chain__ = !!chainAll; + this.__index__ = 0; + this.__values__ = undefined; + } + + /** + * By default, the template delimiters used by lodash are like those in + * embedded Ruby (ERB) as well as ES2015 template strings. Change the + * following template settings to use alternative delimiters. + * + * @static + * @memberOf _ + * @type {Object} + */ + lodash.templateSettings = { + + /** + * Used to detect `data` property values to be HTML-escaped. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'escape': reEscape, + + /** + * Used to detect code to be evaluated. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'evaluate': reEvaluate, + + /** + * Used to detect `data` property values to inject. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'interpolate': reInterpolate, + + /** + * Used to reference the data object in the template text. + * + * @memberOf _.templateSettings + * @type {string} + */ + 'variable': '', + + /** + * Used to import variables into the compiled template. + * + * @memberOf _.templateSettings + * @type {Object} + */ + 'imports': { + + /** + * A reference to the `lodash` function. + * + * @memberOf _.templateSettings.imports + * @type {Function} + */ + '_': lodash + } + }; + + // Ensure wrappers are instances of `baseLodash`. + lodash.prototype = baseLodash.prototype; + lodash.prototype.constructor = lodash; + + LodashWrapper.prototype = baseCreate(baseLodash.prototype); + LodashWrapper.prototype.constructor = LodashWrapper; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. + * + * @private + * @constructor + * @param {*} value The value to wrap. + */ + function LazyWrapper(value) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__dir__ = 1; + this.__filtered__ = false; + this.__iteratees__ = []; + this.__takeCount__ = MAX_ARRAY_LENGTH; + this.__views__ = []; + } + + /** + * Creates a clone of the lazy wrapper object. + * + * @private + * @name clone + * @memberOf LazyWrapper + * @returns {Object} Returns the cloned `LazyWrapper` object. + */ + function lazyClone() { + var result = new LazyWrapper(this.__wrapped__); + result.__actions__ = copyArray(this.__actions__); + result.__dir__ = this.__dir__; + result.__filtered__ = this.__filtered__; + result.__iteratees__ = copyArray(this.__iteratees__); + result.__takeCount__ = this.__takeCount__; + result.__views__ = copyArray(this.__views__); + return result; + } + + /** + * Reverses the direction of lazy iteration. + * + * @private + * @name reverse + * @memberOf LazyWrapper + * @returns {Object} Returns the new reversed `LazyWrapper` object. + */ + function lazyReverse() { + if (this.__filtered__) { + var result = new LazyWrapper(this); + result.__dir__ = -1; + result.__filtered__ = true; + } else { + result = this.clone(); + result.__dir__ *= -1; + } + return result; + } + + /** + * Extracts the unwrapped value from its lazy wrapper. + * + * @private + * @name value + * @memberOf LazyWrapper + * @returns {*} Returns the unwrapped value. + */ + function lazyValue() { + var array = this.__wrapped__.value(), + dir = this.__dir__, + isArr = isArray(array), + isRight = dir < 0, + arrLength = isArr ? array.length : 0, + view = getView(0, arrLength, this.__views__), + start = view.start, + end = view.end, + length = end - start, + index = isRight ? end : (start - 1), + iteratees = this.__iteratees__, + iterLength = iteratees.length, + resIndex = 0, + takeCount = nativeMin(length, this.__takeCount__); + + if (!isArr || (!isRight && arrLength == length && takeCount == length)) { + return baseWrapperValue(array, this.__actions__); + } + var result = []; + + outer: + while (length-- && resIndex < takeCount) { + index += dir; + + var iterIndex = -1, + value = array[index]; + + while (++iterIndex < iterLength) { + var data = iteratees[iterIndex], + iteratee = data.iteratee, + type = data.type, + computed = iteratee(value); + + if (type == LAZY_MAP_FLAG) { + value = computed; + } else if (!computed) { + if (type == LAZY_FILTER_FLAG) { + continue outer; + } else { + break outer; + } + } + } + result[resIndex++] = value; + } + return result; + } + + // Ensure `LazyWrapper` is an instance of `baseLodash`. + LazyWrapper.prototype = baseCreate(baseLodash.prototype); + LazyWrapper.prototype.constructor = LazyWrapper; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function Hash(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ + function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; + } + + /** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; + } + + /** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; + } + + /** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function hashHas(key) { + var data = this.__data__; + return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); + } + + /** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ + function hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; + } + + // Add methods to `Hash`. + Hash.prototype.clear = hashClear; + Hash.prototype['delete'] = hashDelete; + Hash.prototype.get = hashGet; + Hash.prototype.has = hashHas; + Hash.prototype.set = hashSet; + + /*------------------------------------------------------------------------*/ + + /** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function ListCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ + function listCacheClear() { + this.__data__ = []; + this.size = 0; + } + + /** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + --this.size; + return true; + } + + /** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; + } + + /** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; + } + + /** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ + function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; + } + + // Add methods to `ListCache`. + ListCache.prototype.clear = listCacheClear; + ListCache.prototype['delete'] = listCacheDelete; + ListCache.prototype.get = listCacheGet; + ListCache.prototype.has = listCacheHas; + ListCache.prototype.set = listCacheSet; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function MapCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ + function mapCacheClear() { + this.size = 0; + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; + } + + /** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function mapCacheDelete(key) { + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; + } + + /** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function mapCacheGet(key) { + return getMapData(this, key).get(key); + } + + /** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function mapCacheHas(key) { + return getMapData(this, key).has(key); + } + + /** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ + function mapCacheSet(key, value) { + var data = getMapData(this, key), + size = data.size; + + data.set(key, value); + this.size += data.size == size ? 0 : 1; + return this; + } + + // Add methods to `MapCache`. + MapCache.prototype.clear = mapCacheClear; + MapCache.prototype['delete'] = mapCacheDelete; + MapCache.prototype.get = mapCacheGet; + MapCache.prototype.has = mapCacheHas; + MapCache.prototype.set = mapCacheSet; + + /*------------------------------------------------------------------------*/ + + /** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ + function SetCache(values) { + var index = -1, + length = values == null ? 0 : values.length; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } + } + + /** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ + function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; + } + + /** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ + function setCacheHas(value) { + return this.__data__.has(value); + } + + // Add methods to `SetCache`. + SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; + SetCache.prototype.has = setCacheHas; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function Stack(entries) { + var data = this.__data__ = new ListCache(entries); + this.size = data.size; + } + + /** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ + function stackClear() { + this.__data__ = new ListCache; + this.size = 0; + } + + /** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function stackDelete(key) { + var data = this.__data__, + result = data['delete'](key); + + this.size = data.size; + return result; + } + + /** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function stackGet(key) { + return this.__data__.get(key); + } + + /** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function stackHas(key) { + return this.__data__.has(key); + } + + /** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ + function stackSet(key, value) { + var data = this.__data__; + if (data instanceof ListCache) { + var pairs = data.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + this.size = ++data.size; + return this; + } + data = this.__data__ = new MapCache(pairs); + } + data.set(key, value); + this.size = data.size; + return this; + } + + // Add methods to `Stack`. + Stack.prototype.clear = stackClear; + Stack.prototype['delete'] = stackDelete; + Stack.prototype.get = stackGet; + Stack.prototype.has = stackHas; + Stack.prototype.set = stackSet; + + /*------------------------------------------------------------------------*/ + + /** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ + function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { + result.push(key); + } + } + return result; + } + + /** + * A specialized version of `_.sample` for arrays. + * + * @private + * @param {Array} array The array to sample. + * @returns {*} Returns the random element. + */ + function arraySample(array) { + var length = array.length; + return length ? array[baseRandom(0, length - 1)] : undefined; + } + + /** + * A specialized version of `_.sampleSize` for arrays. + * + * @private + * @param {Array} array The array to sample. + * @param {number} n The number of elements to sample. + * @returns {Array} Returns the random elements. + */ + function arraySampleSize(array, n) { + return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); + } + + /** + * A specialized version of `_.shuffle` for arrays. + * + * @private + * @param {Array} array The array to shuffle. + * @returns {Array} Returns the new shuffled array. + */ + function arrayShuffle(array) { + return shuffleSelf(copyArray(array)); + } + + /** + * This function is like `assignValue` except that it doesn't assign + * `undefined` values. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function assignMergeValue(object, key, value) { + if ((value !== undefined && !eq(object[key], value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } + } + + /** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } + } + + /** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; + } + + /** + * Aggregates elements of `collection` on `accumulator` with keys transformed + * by `iteratee` and values set by `setter`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ + function baseAggregator(collection, setter, iteratee, accumulator) { + baseEach(collection, function(value, key, collection) { + setter(accumulator, value, iteratee(value), collection); + }); + return accumulator; + } + + /** + * The base implementation of `_.assign` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ + function baseAssign(object, source) { + return object && copyObject(source, keys(source), object); + } + + /** + * The base implementation of `_.assignIn` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ + function baseAssignIn(object, source) { + return object && copyObject(source, keysIn(source), object); + } + + /** + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function baseAssignValue(object, key, value) { + if (key == '__proto__' && defineProperty) { + defineProperty(object, key, { + 'configurable': true, + 'enumerable': true, + 'value': value, + 'writable': true + }); + } else { + object[key] = value; + } + } + + /** + * The base implementation of `_.at` without support for individual paths. + * + * @private + * @param {Object} object The object to iterate over. + * @param {string[]} paths The property paths to pick. + * @returns {Array} Returns the picked elements. + */ + function baseAt(object, paths) { + var index = -1, + length = paths.length, + result = Array(length), + skip = object == null; + + while (++index < length) { + result[index] = skip ? undefined : get(object, paths[index]); + } + return result; + } + + /** + * The base implementation of `_.clamp` which doesn't coerce arguments. + * + * @private + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + */ + function baseClamp(number, lower, upper) { + if (number === number) { + if (upper !== undefined) { + number = number <= upper ? number : upper; + } + if (lower !== undefined) { + number = number >= lower ? number : lower; + } + } + return number; + } + + /** + * The base implementation of `_.clone` and `_.cloneDeep` which tracks + * traversed objects. + * + * @private + * @param {*} value The value to clone. + * @param {boolean} bitmask The bitmask flags. + * 1 - Deep clone + * 2 - Flatten inherited properties + * 4 - Clone symbols + * @param {Function} [customizer] The function to customize cloning. + * @param {string} [key] The key of `value`. + * @param {Object} [object] The parent object of `value`. + * @param {Object} [stack] Tracks traversed objects and their clone counterparts. + * @returns {*} Returns the cloned value. + */ + function baseClone(value, bitmask, customizer, key, object, stack) { + var result, + isDeep = bitmask & CLONE_DEEP_FLAG, + isFlat = bitmask & CLONE_FLAT_FLAG, + isFull = bitmask & CLONE_SYMBOLS_FLAG; + + if (customizer) { + result = object ? customizer(value, key, object, stack) : customizer(value); + } + if (result !== undefined) { + return result; + } + if (!isObject(value)) { + return value; + } + var isArr = isArray(value); + if (isArr) { + result = initCloneArray(value); + if (!isDeep) { + return copyArray(value, result); + } + } else { + var tag = getTag(value), + isFunc = tag == funcTag || tag == genTag; + + if (isBuffer(value)) { + return cloneBuffer(value, isDeep); + } + if (tag == objectTag || tag == argsTag || (isFunc && !object)) { + result = (isFlat || isFunc) ? {} : initCloneObject(value); + if (!isDeep) { + return isFlat + ? copySymbolsIn(value, baseAssignIn(result, value)) + : copySymbols(value, baseAssign(result, value)); + } + } else { + if (!cloneableTags[tag]) { + return object ? value : {}; + } + result = initCloneByTag(value, tag, isDeep); + } + } + // Check for circular references and return its corresponding clone. + stack || (stack = new Stack); + var stacked = stack.get(value); + if (stacked) { + return stacked; + } + stack.set(value, result); + + if (isSet(value)) { + value.forEach(function(subValue) { + result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); + }); + + return result; + } + + if (isMap(value)) { + value.forEach(function(subValue, key) { + result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + + return result; + } + + var keysFunc = isFull + ? (isFlat ? getAllKeysIn : getAllKeys) + : (isFlat ? keysIn : keys); + + var props = isArr ? undefined : keysFunc(value); + arrayEach(props || value, function(subValue, key) { + if (props) { + key = subValue; + subValue = value[key]; + } + // Recursively populate clone (susceptible to call stack limits). + assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + return result; + } + + /** + * The base implementation of `_.conforms` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property predicates to conform to. + * @returns {Function} Returns the new spec function. + */ + function baseConforms(source) { + var props = keys(source); + return function(object) { + return baseConformsTo(object, source, props); + }; + } + + /** + * The base implementation of `_.conformsTo` which accepts `props` to check. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property predicates to conform to. + * @returns {boolean} Returns `true` if `object` conforms, else `false`. + */ + function baseConformsTo(object, source, props) { + var length = props.length; + if (object == null) { + return !length; + } + object = Object(object); + while (length--) { + var key = props[length], + predicate = source[key], + value = object[key]; + + if ((value === undefined && !(key in object)) || !predicate(value)) { + return false; + } + } + return true; + } + + /** + * The base implementation of `_.delay` and `_.defer` which accepts `args` + * to provide to `func`. + * + * @private + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {Array} args The arguments to provide to `func`. + * @returns {number|Object} Returns the timer id or timeout object. + */ + function baseDelay(func, wait, args) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return setTimeout(function() { func.apply(undefined, args); }, wait); + } + + /** + * The base implementation of methods like `_.difference` without support + * for excluding multiple arrays or iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Array} values The values to exclude. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + */ + function baseDifference(array, values, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + isCommon = true, + length = array.length, + result = [], + valuesLength = values.length; + + if (!length) { + return result; + } + if (iteratee) { + values = arrayMap(values, baseUnary(iteratee)); + } + if (comparator) { + includes = arrayIncludesWith; + isCommon = false; + } + else if (values.length >= LARGE_ARRAY_SIZE) { + includes = cacheHas; + isCommon = false; + values = new SetCache(values); + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee == null ? value : iteratee(value); + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var valuesIndex = valuesLength; + while (valuesIndex--) { + if (values[valuesIndex] === computed) { + continue outer; + } + } + result.push(value); + } + else if (!includes(values, computed, comparator)) { + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.forEach` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ + var baseEach = createBaseEach(baseForOwn); + + /** + * The base implementation of `_.forEachRight` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ + var baseEachRight = createBaseEach(baseForOwnRight, true); + + /** + * The base implementation of `_.every` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false` + */ + function baseEvery(collection, predicate) { + var result = true; + baseEach(collection, function(value, index, collection) { + result = !!predicate(value, index, collection); + return result; + }); + return result; + } + + /** + * The base implementation of methods like `_.max` and `_.min` which accepts a + * `comparator` to determine the extremum value. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The iteratee invoked per iteration. + * @param {Function} comparator The comparator used to compare values. + * @returns {*} Returns the extremum value. + */ + function baseExtremum(array, iteratee, comparator) { + var index = -1, + length = array.length; + + while (++index < length) { + var value = array[index], + current = iteratee(value); + + if (current != null && (computed === undefined + ? (current === current && !isSymbol(current)) + : comparator(current, computed) + )) { + var computed = current, + result = value; + } + } + return result; + } + + /** + * The base implementation of `_.fill` without an iteratee call guard. + * + * @private + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. + */ + function baseFill(array, value, start, end) { + var length = array.length; + + start = toInteger(start); + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = (end === undefined || end > length) ? length : toInteger(end); + if (end < 0) { + end += length; + } + end = start > end ? 0 : toLength(end); + while (start < end) { + array[start++] = value; + } + return array; + } + + /** + * The base implementation of `_.filter` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ + function baseFilter(collection, predicate) { + var result = []; + baseEach(collection, function(value, index, collection) { + if (predicate(value, index, collection)) { + result.push(value); + } + }); + return result; + } + + /** + * The base implementation of `_.flatten` with support for restricting flattening. + * + * @private + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ + function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; + + predicate || (predicate = isFlattenable); + result || (result = []); + + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; + } + + /** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ + var baseFor = createBaseFor(); + + /** + * This function is like `baseFor` except that it iterates over properties + * in the opposite order. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ + var baseForRight = createBaseFor(true); + + /** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ + function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); + } + + /** + * The base implementation of `_.forOwnRight` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ + function baseForOwnRight(object, iteratee) { + return object && baseForRight(object, iteratee, keys); + } + + /** + * The base implementation of `_.functions` which creates an array of + * `object` function property names filtered from `props`. + * + * @private + * @param {Object} object The object to inspect. + * @param {Array} props The property names to filter. + * @returns {Array} Returns the function names. + */ + function baseFunctions(object, props) { + return arrayFilter(props, function(key) { + return isFunction(object[key]); + }); + } + + /** + * The base implementation of `_.get` without support for default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. + */ + function baseGet(object, path) { + path = castPath(path, object); + + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[toKey(path[index++])]; + } + return (index && index == length) ? object : undefined; + } + + /** + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. + */ + function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); + } + + /** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); + } + + /** + * The base implementation of `_.gt` which doesn't coerce arguments. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + */ + function baseGt(value, other) { + return value > other; + } + + /** + * The base implementation of `_.has` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ + function baseHas(object, key) { + return object != null && hasOwnProperty.call(object, key); + } + + /** + * The base implementation of `_.hasIn` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ + function baseHasIn(object, key) { + return object != null && key in Object(object); + } + + /** + * The base implementation of `_.inRange` which doesn't coerce arguments. + * + * @private + * @param {number} number The number to check. + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @returns {boolean} Returns `true` if `number` is in the range, else `false`. + */ + function baseInRange(number, start, end) { + return number >= nativeMin(start, end) && number < nativeMax(start, end); + } + + /** + * The base implementation of methods like `_.intersection`, without support + * for iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of shared values. + */ + function baseIntersection(arrays, iteratee, comparator) { + var includes = comparator ? arrayIncludesWith : arrayIncludes, + length = arrays[0].length, + othLength = arrays.length, + othIndex = othLength, + caches = Array(othLength), + maxLength = Infinity, + result = []; + + while (othIndex--) { + var array = arrays[othIndex]; + if (othIndex && iteratee) { + array = arrayMap(array, baseUnary(iteratee)); + } + maxLength = nativeMin(array.length, maxLength); + caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) + ? new SetCache(othIndex && array) + : undefined; + } + array = arrays[0]; + + var index = -1, + seen = caches[0]; + + outer: + while (++index < length && result.length < maxLength) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (!(seen + ? cacheHas(seen, computed) + : includes(result, computed, comparator) + )) { + othIndex = othLength; + while (--othIndex) { + var cache = caches[othIndex]; + if (!(cache + ? cacheHas(cache, computed) + : includes(arrays[othIndex], computed, comparator)) + ) { + continue outer; + } + } + if (seen) { + seen.push(computed); + } + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.invert` and `_.invertBy` which inverts + * `object` with values transformed by `iteratee` and set by `setter`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform values. + * @param {Object} accumulator The initial inverted object. + * @returns {Function} Returns `accumulator`. + */ + function baseInverter(object, setter, iteratee, accumulator) { + baseForOwn(object, function(value, key, object) { + setter(accumulator, iteratee(value), key, object); + }); + return accumulator; + } + + /** + * The base implementation of `_.invoke` without support for individual + * method arguments. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the method to invoke. + * @param {Array} args The arguments to invoke the method with. + * @returns {*} Returns the result of the invoked method. + */ + function baseInvoke(object, path, args) { + path = castPath(path, object); + object = parent(object, path); + var func = object == null ? object : object[toKey(last(path))]; + return func == null ? undefined : apply(func, object, args); + } + + /** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ + function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; + } + + /** + * The base implementation of `_.isArrayBuffer` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. + */ + function baseIsArrayBuffer(value) { + return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; + } + + /** + * The base implementation of `_.isDate` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + */ + function baseIsDate(value) { + return isObjectLike(value) && baseGetTag(value) == dateTag; + } + + /** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {boolean} bitmask The bitmask flags. + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Function} [customizer] The function to customize comparisons. + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ + function baseIsEqual(value, other, bitmask, customizer, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); + } + + /** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = objIsArr ? arrayTag : getTag(object), + othTag = othIsArr ? arrayTag : getTag(other); + + objTag = objTag == argsTag ? objectTag : objTag; + othTag = othTag == argsTag ? objectTag : othTag; + + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; + + if (isSameTag && isBuffer(object)) { + if (!isBuffer(other)) { + return false; + } + objIsArr = true; + objIsObj = false; + } + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) + : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); + } + if (!(bitmask & COMPARE_PARTIAL_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack); + return equalObjects(object, other, bitmask, customizer, equalFunc, stack); + } + + /** + * The base implementation of `_.isMap` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + */ + function baseIsMap(value) { + return isObjectLike(value) && getTag(value) == mapTag; + } + + /** + * The base implementation of `_.isMatch` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Array} matchData The property names, values, and compare flags to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + */ + function baseIsMatch(object, source, matchData, customizer) { + var index = matchData.length, + length = index, + noCustomizer = !customizer; + + if (object == null) { + return !length; + } + object = Object(object); + while (index--) { + var data = matchData[index]; + if ((noCustomizer && data[2]) + ? data[1] !== object[data[0]] + : !(data[0] in object) + ) { + return false; + } + } + while (++index < length) { + data = matchData[index]; + var key = data[0], + objValue = object[key], + srcValue = data[1]; + + if (noCustomizer && data[2]) { + if (objValue === undefined && !(key in object)) { + return false; + } + } else { + var stack = new Stack; + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } + if (!(result === undefined + ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) + : result + )) { + return false; + } + } + } + return true; + } + + /** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ + function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); + } + + /** + * The base implementation of `_.isRegExp` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + */ + function baseIsRegExp(value) { + return isObjectLike(value) && baseGetTag(value) == regexpTag; + } + + /** + * The base implementation of `_.isSet` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + */ + function baseIsSet(value) { + return isObjectLike(value) && getTag(value) == setTag; + } + + /** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ + function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; + } + + /** + * The base implementation of `_.iteratee`. + * + * @private + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. + */ + function baseIteratee(value) { + // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. + // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. + if (typeof value == 'function') { + return value; + } + if (value == null) { + return identity; + } + if (typeof value == 'object') { + return isArray(value) + ? baseMatchesProperty(value[0], value[1]) + : baseMatches(value); + } + return property(value); + } + + /** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; + } + + /** + * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function baseKeysIn(object) { + if (!isObject(object)) { + return nativeKeysIn(object); + } + var isProto = isPrototype(object), + result = []; + + for (var key in object) { + if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; + } + + /** + * The base implementation of `_.lt` which doesn't coerce arguments. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than `other`, + * else `false`. + */ + function baseLt(value, other) { + return value < other; + } + + /** + * The base implementation of `_.map` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function baseMap(collection, iteratee) { + var index = -1, + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value, key, collection) { + result[++index] = iteratee(value, key, collection); + }); + return result; + } + + /** + * The base implementation of `_.matches` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. + */ + function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + return matchesStrictComparable(matchData[0][0], matchData[0][1]); + } + return function(object) { + return object === source || baseIsMatch(object, source, matchData); + }; + } + + /** + * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. + * + * @private + * @param {string} path The path of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ + function baseMatchesProperty(path, srcValue) { + if (isKey(path) && isStrictComparable(srcValue)) { + return matchesStrictComparable(toKey(path), srcValue); + } + return function(object) { + var objValue = get(object, path); + return (objValue === undefined && objValue === srcValue) + ? hasIn(object, path) + : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); + }; + } + + /** + * The base implementation of `_.merge` without support for multiple sources. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {number} srcIndex The index of `source`. + * @param {Function} [customizer] The function to customize merged values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ + function baseMerge(object, source, srcIndex, customizer, stack) { + if (object === source) { + return; + } + baseFor(source, function(srcValue, key) { + if (isObject(srcValue)) { + stack || (stack = new Stack); + baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); + } + else { + var newValue = customizer + ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) + : undefined; + + if (newValue === undefined) { + newValue = srcValue; + } + assignMergeValue(object, key, newValue); + } + }, keysIn); + } + + /** + * A specialized version of `baseMerge` for arrays and objects which performs + * deep merges and tracks traversed objects enabling objects with circular + * references to be merged. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {string} key The key of the value to merge. + * @param {number} srcIndex The index of `source`. + * @param {Function} mergeFunc The function to merge values. + * @param {Function} [customizer] The function to customize assigned values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ + function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { + var objValue = safeGet(object, key), + srcValue = safeGet(source, key), + stacked = stack.get(srcValue); + + if (stacked) { + assignMergeValue(object, key, stacked); + return; + } + var newValue = customizer + ? customizer(objValue, srcValue, (key + ''), object, source, stack) + : undefined; + + var isCommon = newValue === undefined; + + if (isCommon) { + var isArr = isArray(srcValue), + isBuff = !isArr && isBuffer(srcValue), + isTyped = !isArr && !isBuff && isTypedArray(srcValue); + + newValue = srcValue; + if (isArr || isBuff || isTyped) { + if (isArray(objValue)) { + newValue = objValue; + } + else if (isArrayLikeObject(objValue)) { + newValue = copyArray(objValue); + } + else if (isBuff) { + isCommon = false; + newValue = cloneBuffer(srcValue, true); + } + else if (isTyped) { + isCommon = false; + newValue = cloneTypedArray(srcValue, true); + } + else { + newValue = []; + } + } + else if (isPlainObject(srcValue) || isArguments(srcValue)) { + newValue = objValue; + if (isArguments(objValue)) { + newValue = toPlainObject(objValue); + } + else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) { + newValue = initCloneObject(srcValue); + } + } + else { + isCommon = false; + } + } + if (isCommon) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, newValue); + mergeFunc(newValue, srcValue, srcIndex, customizer, stack); + stack['delete'](srcValue); + } + assignMergeValue(object, key, newValue); + } + + /** + * The base implementation of `_.nth` which doesn't coerce arguments. + * + * @private + * @param {Array} array The array to query. + * @param {number} n The index of the element to return. + * @returns {*} Returns the nth element of `array`. + */ + function baseNth(array, n) { + var length = array.length; + if (!length) { + return; + } + n += n < 0 ? length : 0; + return isIndex(n, length) ? array[n] : undefined; + } + + /** + * The base implementation of `_.orderBy` without param guards. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. + * @param {string[]} orders The sort orders of `iteratees`. + * @returns {Array} Returns the new sorted array. + */ + function baseOrderBy(collection, iteratees, orders) { + var index = -1; + iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(getIteratee())); + + var result = baseMap(collection, function(value, key, collection) { + var criteria = arrayMap(iteratees, function(iteratee) { + return iteratee(value); + }); + return { 'criteria': criteria, 'index': ++index, 'value': value }; + }); + + return baseSortBy(result, function(object, other) { + return compareMultiple(object, other, orders); + }); + } + + /** + * The base implementation of `_.pick` without support for individual + * property identifiers. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @returns {Object} Returns the new object. + */ + function basePick(object, paths) { + return basePickBy(object, paths, function(value, path) { + return hasIn(object, path); + }); + } + + /** + * The base implementation of `_.pickBy` without support for iteratee shorthands. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @param {Function} predicate The function invoked per property. + * @returns {Object} Returns the new object. + */ + function basePickBy(object, paths, predicate) { + var index = -1, + length = paths.length, + result = {}; + + while (++index < length) { + var path = paths[index], + value = baseGet(object, path); + + if (predicate(value, path)) { + baseSet(result, castPath(path, object), value); + } + } + return result; + } + + /** + * A specialized version of `baseProperty` which supports deep paths. + * + * @private + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + */ + function basePropertyDeep(path) { + return function(object) { + return baseGet(object, path); + }; + } + + /** + * The base implementation of `_.pullAllBy` without support for iteratee + * shorthands. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns `array`. + */ + function basePullAll(array, values, iteratee, comparator) { + var indexOf = comparator ? baseIndexOfWith : baseIndexOf, + index = -1, + length = values.length, + seen = array; + + if (array === values) { + values = copyArray(values); + } + if (iteratee) { + seen = arrayMap(array, baseUnary(iteratee)); + } + while (++index < length) { + var fromIndex = 0, + value = values[index], + computed = iteratee ? iteratee(value) : value; + + while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { + if (seen !== array) { + splice.call(seen, fromIndex, 1); + } + splice.call(array, fromIndex, 1); + } + } + return array; + } + + /** + * The base implementation of `_.pullAt` without support for individual + * indexes or capturing the removed elements. + * + * @private + * @param {Array} array The array to modify. + * @param {number[]} indexes The indexes of elements to remove. + * @returns {Array} Returns `array`. + */ + function basePullAt(array, indexes) { + var length = array ? indexes.length : 0, + lastIndex = length - 1; + + while (length--) { + var index = indexes[length]; + if (length == lastIndex || index !== previous) { + var previous = index; + if (isIndex(index)) { + splice.call(array, index, 1); + } else { + baseUnset(array, index); + } + } + } + return array; + } + + /** + * The base implementation of `_.random` without support for returning + * floating-point numbers. + * + * @private + * @param {number} lower The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the random number. + */ + function baseRandom(lower, upper) { + return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); + } + + /** + * The base implementation of `_.range` and `_.rangeRight` which doesn't + * coerce arguments. + * + * @private + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @param {number} step The value to increment or decrement by. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the range of numbers. + */ + function baseRange(start, end, step, fromRight) { + var index = -1, + length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), + result = Array(length); + + while (length--) { + result[fromRight ? length : ++index] = start; + start += step; + } + return result; + } + + /** + * The base implementation of `_.repeat` which doesn't coerce arguments. + * + * @private + * @param {string} string The string to repeat. + * @param {number} n The number of times to repeat the string. + * @returns {string} Returns the repeated string. + */ + function baseRepeat(string, n) { + var result = ''; + if (!string || n < 1 || n > MAX_SAFE_INTEGER) { + return result; + } + // Leverage the exponentiation by squaring algorithm for a faster repeat. + // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. + do { + if (n % 2) { + result += string; + } + n = nativeFloor(n / 2); + if (n) { + string += string; + } + } while (n); + + return result; + } + + /** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ + function baseRest(func, start) { + return setToString(overRest(func, start, identity), func + ''); + } + + /** + * The base implementation of `_.sample`. + * + * @private + * @param {Array|Object} collection The collection to sample. + * @returns {*} Returns the random element. + */ + function baseSample(collection) { + return arraySample(values(collection)); + } + + /** + * The base implementation of `_.sampleSize` without param guards. + * + * @private + * @param {Array|Object} collection The collection to sample. + * @param {number} n The number of elements to sample. + * @returns {Array} Returns the random elements. + */ + function baseSampleSize(collection, n) { + var array = values(collection); + return shuffleSelf(array, baseClamp(n, 0, array.length)); + } + + /** + * The base implementation of `_.set`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ + function baseSet(object, path, value, customizer) { + if (!isObject(object)) { + return object; + } + path = castPath(path, object); + + var index = -1, + length = path.length, + lastIndex = length - 1, + nested = object; + + while (nested != null && ++index < length) { + var key = toKey(path[index]), + newValue = value; + + if (index != lastIndex) { + var objValue = nested[key]; + newValue = customizer ? customizer(objValue, key, nested) : undefined; + if (newValue === undefined) { + newValue = isObject(objValue) + ? objValue + : (isIndex(path[index + 1]) ? [] : {}); + } + } + assignValue(nested, key, newValue); + nested = nested[key]; + } + return object; + } + + /** + * The base implementation of `setData` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. + */ + var baseSetData = !metaMap ? identity : function(func, data) { + metaMap.set(func, data); + return func; + }; + + /** + * The base implementation of `setToString` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ + var baseSetToString = !defineProperty ? identity : function(func, string) { + return defineProperty(func, 'toString', { + 'configurable': true, + 'enumerable': false, + 'value': constant(string), + 'writable': true + }); + }; + + /** + * The base implementation of `_.shuffle`. + * + * @private + * @param {Array|Object} collection The collection to shuffle. + * @returns {Array} Returns the new shuffled array. + */ + function baseShuffle(collection) { + return shuffleSelf(values(collection)); + } + + /** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; + } + + /** + * The base implementation of `_.some` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ + function baseSome(collection, predicate) { + var result; + + baseEach(collection, function(value, index, collection) { + result = predicate(value, index, collection); + return !result; + }); + return !!result; + } + + /** + * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which + * performs a binary search of `array` to determine the index at which `value` + * should be inserted into `array` in order to maintain its sort order. + * + * @private + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + */ + function baseSortedIndex(array, value, retHighest) { + var low = 0, + high = array == null ? low : array.length; + + if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { + while (low < high) { + var mid = (low + high) >>> 1, + computed = array[mid]; + + if (computed !== null && !isSymbol(computed) && + (retHighest ? (computed <= value) : (computed < value))) { + low = mid + 1; + } else { + high = mid; + } + } + return high; + } + return baseSortedIndexBy(array, value, identity, retHighest); + } + + /** + * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` + * which invokes `iteratee` for `value` and each element of `array` to compute + * their sort ranking. The iteratee is invoked with one argument; (value). + * + * @private + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} iteratee The iteratee invoked per element. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + */ + function baseSortedIndexBy(array, value, iteratee, retHighest) { + value = iteratee(value); + + var low = 0, + high = array == null ? 0 : array.length, + valIsNaN = value !== value, + valIsNull = value === null, + valIsSymbol = isSymbol(value), + valIsUndefined = value === undefined; + + while (low < high) { + var mid = nativeFloor((low + high) / 2), + computed = iteratee(array[mid]), + othIsDefined = computed !== undefined, + othIsNull = computed === null, + othIsReflexive = computed === computed, + othIsSymbol = isSymbol(computed); + + if (valIsNaN) { + var setLow = retHighest || othIsReflexive; + } else if (valIsUndefined) { + setLow = othIsReflexive && (retHighest || othIsDefined); + } else if (valIsNull) { + setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); + } else if (valIsSymbol) { + setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); + } else if (othIsNull || othIsSymbol) { + setLow = false; + } else { + setLow = retHighest ? (computed <= value) : (computed < value); + } + if (setLow) { + low = mid + 1; + } else { + high = mid; + } + } + return nativeMin(high, MAX_ARRAY_INDEX); + } + + /** + * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ + function baseSortedUniq(array, iteratee) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + if (!index || !eq(computed, seen)) { + var seen = computed; + result[resIndex++] = value === 0 ? 0 : value; + } + } + return result; + } + + /** + * The base implementation of `_.toNumber` which doesn't ensure correct + * conversions of binary, hexadecimal, or octal string values. + * + * @private + * @param {*} value The value to process. + * @returns {number} Returns the number. + */ + function baseToNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + return +value; + } + + /** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ + function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isArray(value)) { + // Recursively convert values (susceptible to call stack limits). + return arrayMap(value, baseToString) + ''; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; + } + + /** + * The base implementation of `_.uniqBy` without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ + function baseUniq(array, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + length = array.length, + isCommon = true, + result = [], + seen = result; + + if (comparator) { + isCommon = false; + includes = arrayIncludesWith; + } + else if (length >= LARGE_ARRAY_SIZE) { + var set = iteratee ? null : createSet(array); + if (set) { + return setToArray(set); + } + isCommon = false; + includes = cacheHas; + seen = new SetCache; + } + else { + seen = iteratee ? [] : result; + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var seenIndex = seen.length; + while (seenIndex--) { + if (seen[seenIndex] === computed) { + continue outer; + } + } + if (iteratee) { + seen.push(computed); + } + result.push(value); + } + else if (!includes(seen, computed, comparator)) { + if (seen !== result) { + seen.push(computed); + } + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.unset`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The property path to unset. + * @returns {boolean} Returns `true` if the property is deleted, else `false`. + */ + function baseUnset(object, path) { + path = castPath(path, object); + object = parent(object, path); + return object == null || delete object[toKey(last(path))]; + } + + /** + * The base implementation of `_.update`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to update. + * @param {Function} updater The function to produce the updated value. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ + function baseUpdate(object, path, updater, customizer) { + return baseSet(object, path, updater(baseGet(object, path)), customizer); + } + + /** + * The base implementation of methods like `_.dropWhile` and `_.takeWhile` + * without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to query. + * @param {Function} predicate The function invoked per iteration. + * @param {boolean} [isDrop] Specify dropping elements instead of taking them. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the slice of `array`. + */ + function baseWhile(array, predicate, isDrop, fromRight) { + var length = array.length, + index = fromRight ? length : -1; + + while ((fromRight ? index-- : ++index < length) && + predicate(array[index], index, array)) {} + + return isDrop + ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) + : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); + } + + /** + * The base implementation of `wrapperValue` which returns the result of + * performing a sequence of actions on the unwrapped `value`, where each + * successive action is supplied the return value of the previous. + * + * @private + * @param {*} value The unwrapped value. + * @param {Array} actions Actions to perform to resolve the unwrapped value. + * @returns {*} Returns the resolved value. + */ + function baseWrapperValue(value, actions) { + var result = value; + if (result instanceof LazyWrapper) { + result = result.value(); + } + return arrayReduce(actions, function(result, action) { + return action.func.apply(action.thisArg, arrayPush([result], action.args)); + }, result); + } + + /** + * The base implementation of methods like `_.xor`, without support for + * iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of values. + */ + function baseXor(arrays, iteratee, comparator) { + var length = arrays.length; + if (length < 2) { + return length ? baseUniq(arrays[0]) : []; + } + var index = -1, + result = Array(length); + + while (++index < length) { + var array = arrays[index], + othIndex = -1; + + while (++othIndex < length) { + if (othIndex != index) { + result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator); + } + } + } + return baseUniq(baseFlatten(result, 1), iteratee, comparator); + } + + /** + * This base implementation of `_.zipObject` which assigns values using `assignFunc`. + * + * @private + * @param {Array} props The property identifiers. + * @param {Array} values The property values. + * @param {Function} assignFunc The function to assign values. + * @returns {Object} Returns the new object. + */ + function baseZipObject(props, values, assignFunc) { + var index = -1, + length = props.length, + valsLength = values.length, + result = {}; + + while (++index < length) { + var value = index < valsLength ? values[index] : undefined; + assignFunc(result, props[index], value); + } + return result; + } + + /** + * Casts `value` to an empty array if it's not an array like object. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array|Object} Returns the cast array-like object. + */ + function castArrayLikeObject(value) { + return isArrayLikeObject(value) ? value : []; + } + + /** + * Casts `value` to `identity` if it's not a function. + * + * @private + * @param {*} value The value to inspect. + * @returns {Function} Returns cast function. + */ + function castFunction(value) { + return typeof value == 'function' ? value : identity; + } + + /** + * Casts `value` to a path array if it's not one. + * + * @private + * @param {*} value The value to inspect. + * @param {Object} [object] The object to query keys on. + * @returns {Array} Returns the cast property path array. + */ + function castPath(value, object) { + if (isArray(value)) { + return value; + } + return isKey(value, object) ? [value] : stringToPath(toString(value)); + } + + /** + * A `baseRest` alias which can be replaced with `identity` by module + * replacement plugins. + * + * @private + * @type {Function} + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ + var castRest = baseRest; + + /** + * Casts `array` to a slice if it's needed. + * + * @private + * @param {Array} array The array to inspect. + * @param {number} start The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the cast slice. + */ + function castSlice(array, start, end) { + var length = array.length; + end = end === undefined ? length : end; + return (!start && end >= length) ? array : baseSlice(array, start, end); + } + + /** + * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout). + * + * @private + * @param {number|Object} id The timer id or timeout object of the timer to clear. + */ + var clearTimeout = ctxClearTimeout || function(id) { + return root.clearTimeout(id); + }; + + /** + * Creates a clone of `buffer`. + * + * @private + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. + */ + function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var length = buffer.length, + result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); + + buffer.copy(result); + return result; + } + + /** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ + function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; + } + + /** + * Creates a clone of `dataView`. + * + * @private + * @param {Object} dataView The data view to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned data view. + */ + function cloneDataView(dataView, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; + return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); + } + + /** + * Creates a clone of `regexp`. + * + * @private + * @param {Object} regexp The regexp to clone. + * @returns {Object} Returns the cloned regexp. + */ + function cloneRegExp(regexp) { + var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); + result.lastIndex = regexp.lastIndex; + return result; + } + + /** + * Creates a clone of the `symbol` object. + * + * @private + * @param {Object} symbol The symbol object to clone. + * @returns {Object} Returns the cloned symbol object. + */ + function cloneSymbol(symbol) { + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; + } + + /** + * Creates a clone of `typedArray`. + * + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. + */ + function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); + } + + /** + * Compares values to sort them in ascending order. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {number} Returns the sort order indicator for `value`. + */ + function compareAscending(value, other) { + if (value !== other) { + var valIsDefined = value !== undefined, + valIsNull = value === null, + valIsReflexive = value === value, + valIsSymbol = isSymbol(value); + + var othIsDefined = other !== undefined, + othIsNull = other === null, + othIsReflexive = other === other, + othIsSymbol = isSymbol(other); + + if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || + (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || + (valIsNull && othIsDefined && othIsReflexive) || + (!valIsDefined && othIsReflexive) || + !valIsReflexive) { + return 1; + } + if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || + (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || + (othIsNull && valIsDefined && valIsReflexive) || + (!othIsDefined && valIsReflexive) || + !othIsReflexive) { + return -1; + } + } + return 0; + } + + /** + * Used by `_.orderBy` to compare multiple properties of a value to another + * and stable sort them. + * + * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, + * specify an order of "desc" for descending or "asc" for ascending sort order + * of corresponding values. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {boolean[]|string[]} orders The order to sort by for each property. + * @returns {number} Returns the sort order indicator for `object`. + */ + function compareMultiple(object, other, orders) { + var index = -1, + objCriteria = object.criteria, + othCriteria = other.criteria, + length = objCriteria.length, + ordersLength = orders.length; + + while (++index < length) { + var result = compareAscending(objCriteria[index], othCriteria[index]); + if (result) { + if (index >= ordersLength) { + return result; + } + var order = orders[index]; + return result * (order == 'desc' ? -1 : 1); + } + } + // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications + // that causes it, under certain circumstances, to provide the same value for + // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 + // for more details. + // + // This also ensures a stable sort in V8 and other engines. + // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. + return object.index - other.index; + } + + /** + * Creates an array that is the composition of partially applied arguments, + * placeholders, and provided arguments into a single array of arguments. + * + * @private + * @param {Array} args The provided arguments. + * @param {Array} partials The arguments to prepend to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. + * @returns {Array} Returns the new array of composed arguments. + */ + function composeArgs(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersLength = holders.length, + leftIndex = -1, + leftLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(leftLength + rangeLength), + isUncurried = !isCurried; + + while (++leftIndex < leftLength) { + result[leftIndex] = partials[leftIndex]; + } + while (++argsIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[holders[argsIndex]] = args[argsIndex]; + } + } + while (rangeLength--) { + result[leftIndex++] = args[argsIndex++]; + } + return result; + } + + /** + * This function is like `composeArgs` except that the arguments composition + * is tailored for `_.partialRight`. + * + * @private + * @param {Array} args The provided arguments. + * @param {Array} partials The arguments to append to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. + * @returns {Array} Returns the new array of composed arguments. + */ + function composeArgsRight(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersIndex = -1, + holdersLength = holders.length, + rightIndex = -1, + rightLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(rangeLength + rightLength), + isUncurried = !isCurried; + + while (++argsIndex < rangeLength) { + result[argsIndex] = args[argsIndex]; + } + var offset = argsIndex; + while (++rightIndex < rightLength) { + result[offset + rightIndex] = partials[rightIndex]; + } + while (++holdersIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[offset + holders[holdersIndex]] = args[argsIndex++]; + } + } + return result; + } + + /** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ + function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; + } + + /** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ + function copyObject(source, props, object, customizer) { + var isNew = !object; + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + if (newValue === undefined) { + newValue = source[key]; + } + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } + } + return object; + } + + /** + * Copies own symbols of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ + function copySymbols(source, object) { + return copyObject(source, getSymbols(source), object); + } + + /** + * Copies own and inherited symbols of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ + function copySymbolsIn(source, object) { + return copyObject(source, getSymbolsIn(source), object); + } + + /** + * Creates a function like `_.groupBy`. + * + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} [initializer] The accumulator object initializer. + * @returns {Function} Returns the new aggregator function. + */ + function createAggregator(setter, initializer) { + return function(collection, iteratee) { + var func = isArray(collection) ? arrayAggregator : baseAggregator, + accumulator = initializer ? initializer() : {}; + + return func(collection, setter, getIteratee(iteratee, 2), accumulator); + }; + } + + /** + * Creates a function like `_.assign`. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ + function createAssigner(assigner) { + return baseRest(function(object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined, + guard = length > 2 ? sources[2] : undefined; + + customizer = (assigner.length > 3 && typeof customizer == 'function') + ? (length--, customizer) + : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; + } + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); + } + + /** + * Creates a `baseEach` or `baseEachRight` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + if (collection == null) { + return collection; + } + if (!isArrayLike(collection)) { + return eachFunc(collection, iteratee); + } + var length = collection.length, + index = fromRight ? length : -1, + iterable = Object(collection); + + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; + } + + /** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; + } + + /** + * Creates a function that wraps `func` to invoke it with the optional `this` + * binding of `thisArg`. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createBind(func, bitmask, thisArg) { + var isBind = bitmask & WRAP_BIND_FLAG, + Ctor = createCtor(func); + + function wrapper() { + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return fn.apply(isBind ? thisArg : this, arguments); + } + return wrapper; + } + + /** + * Creates a function like `_.lowerFirst`. + * + * @private + * @param {string} methodName The name of the `String` case method to use. + * @returns {Function} Returns the new case function. + */ + function createCaseFirst(methodName) { + return function(string) { + string = toString(string); + + var strSymbols = hasUnicode(string) + ? stringToArray(string) + : undefined; + + var chr = strSymbols + ? strSymbols[0] + : string.charAt(0); + + var trailing = strSymbols + ? castSlice(strSymbols, 1).join('') + : string.slice(1); + + return chr[methodName]() + trailing; + }; + } + + /** + * Creates a function like `_.camelCase`. + * + * @private + * @param {Function} callback The function to combine each word. + * @returns {Function} Returns the new compounder function. + */ + function createCompounder(callback) { + return function(string) { + return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); + }; + } + + /** + * Creates a function that produces an instance of `Ctor` regardless of + * whether it was invoked as part of a `new` expression or by `call` or `apply`. + * + * @private + * @param {Function} Ctor The constructor to wrap. + * @returns {Function} Returns the new wrapped function. + */ + function createCtor(Ctor) { + return function() { + // Use a `switch` statement to work with class constructors. See + // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist + // for more details. + var args = arguments; + switch (args.length) { + case 0: return new Ctor; + case 1: return new Ctor(args[0]); + case 2: return new Ctor(args[0], args[1]); + case 3: return new Ctor(args[0], args[1], args[2]); + case 4: return new Ctor(args[0], args[1], args[2], args[3]); + case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); + case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); + case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); + } + var thisBinding = baseCreate(Ctor.prototype), + result = Ctor.apply(thisBinding, args); + + // Mimic the constructor's `return` behavior. + // See https://es5.github.io/#x13.2.2 for more details. + return isObject(result) ? result : thisBinding; + }; + } + + /** + * Creates a function that wraps `func` to enable currying. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {number} arity The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createCurry(func, bitmask, arity) { + var Ctor = createCtor(func); + + function wrapper() { + var length = arguments.length, + args = Array(length), + index = length, + placeholder = getHolder(wrapper); + + while (index--) { + args[index] = arguments[index]; + } + var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) + ? [] + : replaceHolders(args, placeholder); + + length -= holders.length; + if (length < arity) { + return createRecurry( + func, bitmask, createHybrid, wrapper.placeholder, undefined, + args, holders, undefined, undefined, arity - length); + } + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return apply(fn, this, args); + } + return wrapper; + } + + /** + * Creates a `_.find` or `_.findLast` function. + * + * @private + * @param {Function} findIndexFunc The function to find the collection index. + * @returns {Function} Returns the new find function. + */ + function createFind(findIndexFunc) { + return function(collection, predicate, fromIndex) { + var iterable = Object(collection); + if (!isArrayLike(collection)) { + var iteratee = getIteratee(predicate, 3); + collection = keys(collection); + predicate = function(key) { return iteratee(iterable[key], key, iterable); }; + } + var index = findIndexFunc(collection, predicate, fromIndex); + return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; + }; + } + + /** + * Creates a `_.flow` or `_.flowRight` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new flow function. + */ + function createFlow(fromRight) { + return flatRest(function(funcs) { + var length = funcs.length, + index = length, + prereq = LodashWrapper.prototype.thru; + + if (fromRight) { + funcs.reverse(); + } + while (index--) { + var func = funcs[index]; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + if (prereq && !wrapper && getFuncName(func) == 'wrapper') { + var wrapper = new LodashWrapper([], true); + } + } + index = wrapper ? index : length; + while (++index < length) { + func = funcs[index]; + + var funcName = getFuncName(func), + data = funcName == 'wrapper' ? getData(func) : undefined; + + if (data && isLaziable(data[0]) && + data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && + !data[4].length && data[9] == 1 + ) { + wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); + } else { + wrapper = (func.length == 1 && isLaziable(func)) + ? wrapper[funcName]() + : wrapper.thru(func); + } + } + return function() { + var args = arguments, + value = args[0]; + + if (wrapper && args.length == 1 && isArray(value)) { + return wrapper.plant(value).value(); + } + var index = 0, + result = length ? funcs[index].apply(this, args) : value; + + while (++index < length) { + result = funcs[index].call(this, result); + } + return result; + }; + }); + } + + /** + * Creates a function that wraps `func` to invoke it with optional `this` + * binding of `thisArg`, partial application, and currying. + * + * @private + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [partialsRight] The arguments to append to those provided + * to the new function. + * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { + var isAry = bitmask & WRAP_ARY_FLAG, + isBind = bitmask & WRAP_BIND_FLAG, + isBindKey = bitmask & WRAP_BIND_KEY_FLAG, + isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), + isFlip = bitmask & WRAP_FLIP_FLAG, + Ctor = isBindKey ? undefined : createCtor(func); + + function wrapper() { + var length = arguments.length, + args = Array(length), + index = length; + + while (index--) { + args[index] = arguments[index]; + } + if (isCurried) { + var placeholder = getHolder(wrapper), + holdersCount = countHolders(args, placeholder); + } + if (partials) { + args = composeArgs(args, partials, holders, isCurried); + } + if (partialsRight) { + args = composeArgsRight(args, partialsRight, holdersRight, isCurried); + } + length -= holdersCount; + if (isCurried && length < arity) { + var newHolders = replaceHolders(args, placeholder); + return createRecurry( + func, bitmask, createHybrid, wrapper.placeholder, thisArg, + args, newHolders, argPos, ary, arity - length + ); + } + var thisBinding = isBind ? thisArg : this, + fn = isBindKey ? thisBinding[func] : func; + + length = args.length; + if (argPos) { + args = reorder(args, argPos); + } else if (isFlip && length > 1) { + args.reverse(); + } + if (isAry && ary < length) { + args.length = ary; + } + if (this && this !== root && this instanceof wrapper) { + fn = Ctor || createCtor(fn); + } + return fn.apply(thisBinding, args); + } + return wrapper; + } + + /** + * Creates a function like `_.invertBy`. + * + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} toIteratee The function to resolve iteratees. + * @returns {Function} Returns the new inverter function. + */ + function createInverter(setter, toIteratee) { + return function(object, iteratee) { + return baseInverter(object, setter, toIteratee(iteratee), {}); + }; + } + + /** + * Creates a function that performs a mathematical operation on two values. + * + * @private + * @param {Function} operator The function to perform the operation. + * @param {number} [defaultValue] The value used for `undefined` arguments. + * @returns {Function} Returns the new mathematical operation function. + */ + function createMathOperation(operator, defaultValue) { + return function(value, other) { + var result; + if (value === undefined && other === undefined) { + return defaultValue; + } + if (value !== undefined) { + result = value; + } + if (other !== undefined) { + if (result === undefined) { + return other; + } + if (typeof value == 'string' || typeof other == 'string') { + value = baseToString(value); + other = baseToString(other); + } else { + value = baseToNumber(value); + other = baseToNumber(other); + } + result = operator(value, other); + } + return result; + }; + } + + /** + * Creates a function like `_.over`. + * + * @private + * @param {Function} arrayFunc The function to iterate over iteratees. + * @returns {Function} Returns the new over function. + */ + function createOver(arrayFunc) { + return flatRest(function(iteratees) { + iteratees = arrayMap(iteratees, baseUnary(getIteratee())); + return baseRest(function(args) { + var thisArg = this; + return arrayFunc(iteratees, function(iteratee) { + return apply(iteratee, thisArg, args); + }); + }); + }); + } + + /** + * Creates the padding for `string` based on `length`. The `chars` string + * is truncated if the number of characters exceeds `length`. + * + * @private + * @param {number} length The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padding for `string`. + */ + function createPadding(length, chars) { + chars = chars === undefined ? ' ' : baseToString(chars); + + var charsLength = chars.length; + if (charsLength < 2) { + return charsLength ? baseRepeat(chars, length) : chars; + } + var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); + return hasUnicode(chars) + ? castSlice(stringToArray(result), 0, length).join('') + : result.slice(0, length); + } + + /** + * Creates a function that wraps `func` to invoke it with the `this` binding + * of `thisArg` and `partials` prepended to the arguments it receives. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} partials The arguments to prepend to those provided to + * the new function. + * @returns {Function} Returns the new wrapped function. + */ + function createPartial(func, bitmask, thisArg, partials) { + var isBind = bitmask & WRAP_BIND_FLAG, + Ctor = createCtor(func); + + function wrapper() { + var argsIndex = -1, + argsLength = arguments.length, + leftIndex = -1, + leftLength = partials.length, + args = Array(leftLength + argsLength), + fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + + while (++leftIndex < leftLength) { + args[leftIndex] = partials[leftIndex]; + } + while (argsLength--) { + args[leftIndex++] = arguments[++argsIndex]; + } + return apply(fn, isBind ? thisArg : this, args); + } + return wrapper; + } + + /** + * Creates a `_.range` or `_.rangeRight` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new range function. + */ + function createRange(fromRight) { + return function(start, end, step) { + if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { + end = step = undefined; + } + // Ensure the sign of `-0` is preserved. + start = toFinite(start); + if (end === undefined) { + end = start; + start = 0; + } else { + end = toFinite(end); + } + step = step === undefined ? (start < end ? 1 : -1) : toFinite(step); + return baseRange(start, end, step, fromRight); + }; + } + + /** + * Creates a function that performs a relational operation on two values. + * + * @private + * @param {Function} operator The function to perform the operation. + * @returns {Function} Returns the new relational operation function. + */ + function createRelationalOperation(operator) { + return function(value, other) { + if (!(typeof value == 'string' && typeof other == 'string')) { + value = toNumber(value); + other = toNumber(other); + } + return operator(value, other); + }; + } + + /** + * Creates a function that wraps `func` to continue currying. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {Function} wrapFunc The function to create the `func` wrapper. + * @param {*} placeholder The placeholder value. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { + var isCurry = bitmask & WRAP_CURRY_FLAG, + newHolders = isCurry ? holders : undefined, + newHoldersRight = isCurry ? undefined : holders, + newPartials = isCurry ? partials : undefined, + newPartialsRight = isCurry ? undefined : partials; + + bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG); + bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); + + if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { + bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); + } + var newData = [ + func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, + newHoldersRight, argPos, ary, arity + ]; + + var result = wrapFunc.apply(undefined, newData); + if (isLaziable(func)) { + setData(result, newData); + } + result.placeholder = placeholder; + return setWrapToString(result, func, bitmask); + } + + /** + * Creates a function like `_.round`. + * + * @private + * @param {string} methodName The name of the `Math` method to use when rounding. + * @returns {Function} Returns the new round function. + */ + function createRound(methodName) { + var func = Math[methodName]; + return function(number, precision) { + number = toNumber(number); + precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); + if (precision) { + // Shift with exponential notation to avoid floating-point issues. + // See [MDN](https://mdn.io/round#Examples) for more details. + var pair = (toString(number) + 'e').split('e'), + value = func(pair[0] + 'e' + (+pair[1] + precision)); + + pair = (toString(value) + 'e').split('e'); + return +(pair[0] + 'e' + (+pair[1] - precision)); + } + return func(number); + }; + } + + /** + * Creates a set object of `values`. + * + * @private + * @param {Array} values The values to add to the set. + * @returns {Object} Returns the new set. + */ + var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { + return new Set(values); + }; + + /** + * Creates a `_.toPairs` or `_.toPairsIn` function. + * + * @private + * @param {Function} keysFunc The function to get the keys of a given object. + * @returns {Function} Returns the new pairs function. + */ + function createToPairs(keysFunc) { + return function(object) { + var tag = getTag(object); + if (tag == mapTag) { + return mapToArray(object); + } + if (tag == setTag) { + return setToPairs(object); + } + return baseToPairs(object, keysFunc(object)); + }; + } + + /** + * Creates a function that either curries or invokes `func` with optional + * `this` binding and partially applied arguments. + * + * @private + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask flags. + * 1 - `_.bind` + * 2 - `_.bindKey` + * 4 - `_.curry` or `_.curryRight` of a bound function + * 8 - `_.curry` + * 16 - `_.curryRight` + * 32 - `_.partial` + * 64 - `_.partialRight` + * 128 - `_.rearg` + * 256 - `_.ary` + * 512 - `_.flip` + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to be partially applied. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { + var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; + if (!isBindKey && typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + var length = partials ? partials.length : 0; + if (!length) { + bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); + partials = holders = undefined; + } + ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); + arity = arity === undefined ? arity : toInteger(arity); + length -= holders ? holders.length : 0; + + if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { + var partialsRight = partials, + holdersRight = holders; + + partials = holders = undefined; + } + var data = isBindKey ? undefined : getData(func); + + var newData = [ + func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, + argPos, ary, arity + ]; + + if (data) { + mergeData(newData, data); + } + func = newData[0]; + bitmask = newData[1]; + thisArg = newData[2]; + partials = newData[3]; + holders = newData[4]; + arity = newData[9] = newData[9] === undefined + ? (isBindKey ? 0 : func.length) + : nativeMax(newData[9] - length, 0); + + if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { + bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); + } + if (!bitmask || bitmask == WRAP_BIND_FLAG) { + var result = createBind(func, bitmask, thisArg); + } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { + result = createCurry(func, bitmask, arity); + } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { + result = createPartial(func, bitmask, thisArg, partials); + } else { + result = createHybrid.apply(undefined, newData); + } + var setter = data ? baseSetData : setData; + return setWrapToString(setter(result, newData), func, bitmask); + } + + /** + * Used by `_.defaults` to customize its `_.assignIn` use to assign properties + * of source objects to the destination object for all destination properties + * that resolve to `undefined`. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to assign. + * @param {Object} object The parent object of `objValue`. + * @returns {*} Returns the value to assign. + */ + function customDefaultsAssignIn(objValue, srcValue, key, object) { + if (objValue === undefined || + (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { + return srcValue; + } + return objValue; + } + + /** + * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source + * objects into destination objects that are passed thru. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to merge. + * @param {Object} object The parent object of `objValue`. + * @param {Object} source The parent object of `srcValue`. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + * @returns {*} Returns the value to assign. + */ + function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { + if (isObject(objValue) && isObject(srcValue)) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, objValue); + baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack); + stack['delete'](srcValue); + } + return objValue; + } + + /** + * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain + * objects. + * + * @private + * @param {*} value The value to inspect. + * @param {string} key The key of the property to inspect. + * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. + */ + function customOmitClone(value) { + return isPlainObject(value) ? undefined : value; + } + + /** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ + function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(array); + if (stacked && stack.get(other)) { + return stacked == other; + } + var index = -1, + result = true, + seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; + + stack.set(array, other); + stack.set(other, array); + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!arraySome(other, function(othValue, othIndex) { + if (!cacheHas(seen, othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + return seen.push(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, bitmask, customizer, stack) + )) { + result = false; + break; + } + } + stack['delete'](array); + stack['delete'](other); + return result; + } + + /** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { + switch (tag) { + case dataViewTag: + if ((object.byteLength != other.byteLength) || + (object.byteOffset != other.byteOffset)) { + return false; + } + object = object.buffer; + other = other.buffer; + + case arrayBufferTag: + if ((object.byteLength != other.byteLength) || + !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + return true; + + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); + + case errorTag: + return object.name == other.name && object.message == other.message; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + case mapTag: + var convert = mapToArray; + + case setTag: + var isPartial = bitmask & COMPARE_PARTIAL_FLAG; + convert || (convert = setToArray); + + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= COMPARE_UNORDERED_FLAG; + + // Recursively compare objects (susceptible to call stack limits). + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); + stack['delete'](object); + return result; + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; + } + + /** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + objProps = getAllKeys(object), + objLength = objProps.length, + othProps = getAllKeys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked && stack.get(other)) { + return stacked == other; + } + var result = true; + stack.set(object, other); + stack.set(other, object); + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, objValue, key, other, object, stack) + : customizer(objValue, othValue, key, object, other, stack); + } + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + stack['delete'](object); + stack['delete'](other); + return result; + } + + /** + * A specialized version of `baseRest` which flattens the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ + function flatRest(func) { + return setToString(overRest(func, undefined, flatten), func + ''); + } + + /** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ + function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); + } + + /** + * Creates an array of own and inherited enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ + function getAllKeysIn(object) { + return baseGetAllKeys(object, keysIn, getSymbolsIn); + } + + /** + * Gets metadata for `func`. + * + * @private + * @param {Function} func The function to query. + * @returns {*} Returns the metadata for `func`. + */ + var getData = !metaMap ? noop : function(func) { + return metaMap.get(func); + }; + + /** + * Gets the name of `func`. + * + * @private + * @param {Function} func The function to query. + * @returns {string} Returns the function name. + */ + function getFuncName(func) { + var result = (func.name + ''), + array = realNames[result], + length = hasOwnProperty.call(realNames, result) ? array.length : 0; + + while (length--) { + var data = array[length], + otherFunc = data.func; + if (otherFunc == null || otherFunc == func) { + return data.name; + } + } + return result; + } + + /** + * Gets the argument placeholder value for `func`. + * + * @private + * @param {Function} func The function to inspect. + * @returns {*} Returns the placeholder value. + */ + function getHolder(func) { + var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func; + return object.placeholder; + } + + /** + * Gets the appropriate "iteratee" function. If `_.iteratee` is customized, + * this function returns the custom method, otherwise it returns `baseIteratee`. + * If arguments are provided, the chosen function is invoked with them and + * its result is returned. + * + * @private + * @param {*} [value] The value to convert to an iteratee. + * @param {number} [arity] The arity of the created iteratee. + * @returns {Function} Returns the chosen function or its result. + */ + function getIteratee() { + var result = lodash.iteratee || iteratee; + result = result === iteratee ? baseIteratee : result; + return arguments.length ? result(arguments[0], arguments[1]) : result; + } + + /** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ + function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; + } + + /** + * Gets the property names, values, and compare flags of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the match data of `object`. + */ + function getMatchData(object) { + var result = keys(object), + length = result.length; + + while (length--) { + var key = result[length], + value = object[key]; + + result[length] = [key, value, isStrictComparable(value)]; + } + return result; + } + + /** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ + function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; + } + + /** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ + function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; + + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; + } + + /** + * Creates an array of the own enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ + var getSymbols = !nativeGetSymbols ? stubArray : function(object) { + if (object == null) { + return []; + } + object = Object(object); + return arrayFilter(nativeGetSymbols(object), function(symbol) { + return propertyIsEnumerable.call(object, symbol); + }); + }; + + /** + * Creates an array of the own and inherited enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ + var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { + var result = []; + while (object) { + arrayPush(result, getSymbols(object)); + object = getPrototype(object); + } + return result; + }; + + /** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + var getTag = baseGetTag; + + // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. + if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = baseGetTag(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : ''; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; + } + + /** + * Gets the view, applying any `transforms` to the `start` and `end` positions. + * + * @private + * @param {number} start The start of the view. + * @param {number} end The end of the view. + * @param {Array} transforms The transformations to apply to the view. + * @returns {Object} Returns an object containing the `start` and `end` + * positions of the view. + */ + function getView(start, end, transforms) { + var index = -1, + length = transforms.length; + + while (++index < length) { + var data = transforms[index], + size = data.size; + + switch (data.type) { + case 'drop': start += size; break; + case 'dropRight': end -= size; break; + case 'take': end = nativeMin(end, start + size); break; + case 'takeRight': start = nativeMax(start, end - size); break; + } + } + return { 'start': start, 'end': end }; + } + + /** + * Extracts wrapper details from the `source` body comment. + * + * @private + * @param {string} source The source to inspect. + * @returns {Array} Returns the wrapper details. + */ + function getWrapDetails(source) { + var match = source.match(reWrapDetails); + return match ? match[1].split(reSplitDetails) : []; + } + + /** + * Checks if `path` exists on `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @param {Function} hasFunc The function to check properties. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + */ + function hasPath(object, path, hasFunc) { + path = castPath(path, object); + + var index = -1, + length = path.length, + result = false; + + while (++index < length) { + var key = toKey(path[index]); + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result || ++index != length) { + return result; + } + length = object == null ? 0 : object.length; + return !!length && isLength(length) && isIndex(key, length) && + (isArray(object) || isArguments(object)); + } + + /** + * Initializes an array clone. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the initialized clone. + */ + function initCloneArray(array) { + var length = array.length, + result = new array.constructor(length); + + // Add properties assigned by `RegExp#exec`. + if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { + result.index = array.index; + result.input = array.input; + } + return result; + } + + /** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ + function initCloneObject(object) { + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototype(object)) + : {}; + } + + /** + * Initializes an object clone based on its `toStringTag`. + * + * **Note:** This function only supports cloning values with tags of + * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. + * + * @private + * @param {Object} object The object to clone. + * @param {string} tag The `toStringTag` of the object to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the initialized clone. + */ + function initCloneByTag(object, tag, isDeep) { + var Ctor = object.constructor; + switch (tag) { + case arrayBufferTag: + return cloneArrayBuffer(object); + + case boolTag: + case dateTag: + return new Ctor(+object); + + case dataViewTag: + return cloneDataView(object, isDeep); + + case float32Tag: case float64Tag: + case int8Tag: case int16Tag: case int32Tag: + case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: + return cloneTypedArray(object, isDeep); + + case mapTag: + return new Ctor; + + case numberTag: + case stringTag: + return new Ctor(object); + + case regexpTag: + return cloneRegExp(object); + + case setTag: + return new Ctor; + + case symbolTag: + return cloneSymbol(object); + } + } + + /** + * Inserts wrapper `details` in a comment at the top of the `source` body. + * + * @private + * @param {string} source The source to modify. + * @returns {Array} details The details to insert. + * @returns {string} Returns the modified source. + */ + function insertWrapDetails(source, details) { + var length = details.length; + if (!length) { + return source; + } + var lastIndex = length - 1; + details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; + details = details.join(length > 2 ? ', ' : ' '); + return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); + } + + /** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ + function isFlattenable(value) { + return isArray(value) || isArguments(value) || + !!(spreadableSymbol && value && value[spreadableSymbol]); + } + + /** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ + function isIndex(value, length) { + var type = typeof value; + length = length == null ? MAX_SAFE_INTEGER : length; + + return !!length && + (type == 'number' || + (type != 'symbol' && reIsUint.test(value))) && + (value > -1 && value % 1 == 0 && value < length); + } + + /** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ + function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; + } + + /** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ + function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == 'number' || type == 'symbol' || type == 'boolean' || + value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(object)); + } + + /** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ + function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); + } + + /** + * Checks if `func` has a lazy counterpart. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` has a lazy counterpart, + * else `false`. + */ + function isLaziable(func) { + var funcName = getFuncName(func), + other = lodash[funcName]; + + if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { + return false; + } + if (func === other) { + return true; + } + var data = getData(other); + return !!data && func === data[0]; + } + + /** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ + function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); + } + + /** + * Checks if `func` is capable of being masked. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `func` is maskable, else `false`. + */ + var isMaskable = coreJsData ? isFunction : stubFalse; + + /** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ + function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; + } + + /** + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. + */ + function isStrictComparable(value) { + return value === value && !isObject(value); + } + + /** + * A specialized version of `matchesProperty` for source values suitable + * for strict equality comparisons, i.e. `===`. + * + * @private + * @param {string} key The key of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ + function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; + } + return object[key] === srcValue && + (srcValue !== undefined || (key in Object(object))); + }; + } + + /** + * A specialized version of `_.memoize` which clears the memoized function's + * cache when it exceeds `MAX_MEMOIZE_SIZE`. + * + * @private + * @param {Function} func The function to have its output memoized. + * @returns {Function} Returns the new memoized function. + */ + function memoizeCapped(func) { + var result = memoize(func, function(key) { + if (cache.size === MAX_MEMOIZE_SIZE) { + cache.clear(); + } + return key; + }); + + var cache = result.cache; + return result; + } + + /** + * Merges the function metadata of `source` into `data`. + * + * Merging metadata reduces the number of wrappers used to invoke a function. + * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` + * may be applied regardless of execution order. Methods like `_.ary` and + * `_.rearg` modify function arguments, making the order in which they are + * executed important, preventing the merging of metadata. However, we make + * an exception for a safe combined case where curried functions have `_.ary` + * and or `_.rearg` applied. + * + * @private + * @param {Array} data The destination metadata. + * @param {Array} source The source metadata. + * @returns {Array} Returns `data`. + */ + function mergeData(data, source) { + var bitmask = data[1], + srcBitmask = source[1], + newBitmask = bitmask | srcBitmask, + isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); + + var isCombo = + ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || + ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) || + ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)); + + // Exit early if metadata can't be merged. + if (!(isCommon || isCombo)) { + return data; + } + // Use source `thisArg` if available. + if (srcBitmask & WRAP_BIND_FLAG) { + data[2] = source[2]; + // Set when currying a bound function. + newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; + } + // Compose partial arguments. + var value = source[3]; + if (value) { + var partials = data[3]; + data[3] = partials ? composeArgs(partials, value, source[4]) : value; + data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; + } + // Compose partial right arguments. + value = source[5]; + if (value) { + partials = data[5]; + data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; + data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; + } + // Use source `argPos` if available. + value = source[7]; + if (value) { + data[7] = value; + } + // Use source `ary` if it's smaller. + if (srcBitmask & WRAP_ARY_FLAG) { + data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); + } + // Use source `arity` if one is not provided. + if (data[9] == null) { + data[9] = source[9]; + } + // Use source `func` and merge bitmasks. + data[0] = source[0]; + data[1] = newBitmask; + + return data; + } + + /** + * This function is like + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * except that it includes inherited enumerable properties. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); + } + } + return result; + } + + /** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ + function objectToString(value) { + return nativeObjectToString.call(value); + } + + /** + * A specialized version of `baseRest` which transforms the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @param {Function} transform The rest array transform. + * @returns {Function} Returns the new function. + */ + function overRest(func, start, transform) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = transform(array); + return apply(func, this, otherArgs); + }; + } + + /** + * Gets the parent value at `path` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} path The path to get the parent value of. + * @returns {*} Returns the parent value. + */ + function parent(object, path) { + return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); + } + + /** + * Reorder `array` according to the specified indexes where the element at + * the first index is assigned as the first element, the element at + * the second index is assigned as the second element, and so on. + * + * @private + * @param {Array} array The array to reorder. + * @param {Array} indexes The arranged array indexes. + * @returns {Array} Returns `array`. + */ + function reorder(array, indexes) { + var arrLength = array.length, + length = nativeMin(indexes.length, arrLength), + oldArray = copyArray(array); + + while (length--) { + var index = indexes[length]; + array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; + } + return array; + } + + /** + * Sets metadata for `func`. + * + * **Note:** If this function becomes hot, i.e. is invoked a lot in a short + * period of time, it will trip its breaker and transition to an identity + * function to avoid garbage collection pauses in V8. See + * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) + * for more details. + * + * @private + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. + */ + var setData = shortOut(baseSetData); + + /** + * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout). + * + * @private + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @returns {number|Object} Returns the timer id or timeout object. + */ + var setTimeout = ctxSetTimeout || function(func, wait) { + return root.setTimeout(func, wait); + }; + + /** + * Sets the `toString` method of `func` to return `string`. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ + var setToString = shortOut(baseSetToString); + + /** + * Sets the `toString` method of `wrapper` to mimic the source of `reference` + * with wrapper details in a comment at the top of the source body. + * + * @private + * @param {Function} wrapper The function to modify. + * @param {Function} reference The reference function. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @returns {Function} Returns `wrapper`. + */ + function setWrapToString(wrapper, reference, bitmask) { + var source = (reference + ''); + return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); + } + + /** + * Creates a function that'll short out and invoke `identity` instead + * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` + * milliseconds. + * + * @private + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new shortable function. + */ + function shortOut(func) { + var count = 0, + lastCalled = 0; + + return function() { + var stamp = nativeNow(), + remaining = HOT_SPAN - (stamp - lastCalled); + + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return arguments[0]; + } + } else { + count = 0; + } + return func.apply(undefined, arguments); + }; + } + + /** + * A specialized version of `_.shuffle` which mutates and sets the size of `array`. + * + * @private + * @param {Array} array The array to shuffle. + * @param {number} [size=array.length] The size of `array`. + * @returns {Array} Returns `array`. + */ + function shuffleSelf(array, size) { + var index = -1, + length = array.length, + lastIndex = length - 1; + + size = size === undefined ? length : size; + while (++index < size) { + var rand = baseRandom(index, lastIndex), + value = array[rand]; + + array[rand] = array[index]; + array[index] = value; + } + array.length = size; + return array; + } + + /** + * Converts `string` to a property path array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the property path array. + */ + var stringToPath = memoizeCapped(function(string) { + var result = []; + if (string.charCodeAt(0) === 46 /* . */) { + result.push(''); + } + string.replace(rePropName, function(match, number, quote, subString) { + result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; + }); + + /** + * Converts `value` to a string key if it's not a string or symbol. + * + * @private + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. + */ + function toKey(value) { + if (typeof value == 'string' || isSymbol(value)) { + return value; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; + } + + /** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to convert. + * @returns {string} Returns the source code. + */ + function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; + } + + /** + * Updates wrapper `details` based on `bitmask` flags. + * + * @private + * @returns {Array} details The details to modify. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @returns {Array} Returns `details`. + */ + function updateWrapDetails(details, bitmask) { + arrayEach(wrapFlags, function(pair) { + var value = '_.' + pair[0]; + if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { + details.push(value); + } + }); + return details.sort(); + } + + /** + * Creates a clone of `wrapper`. + * + * @private + * @param {Object} wrapper The wrapper to clone. + * @returns {Object} Returns the cloned wrapper. + */ + function wrapperClone(wrapper) { + if (wrapper instanceof LazyWrapper) { + return wrapper.clone(); + } + var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); + result.__actions__ = copyArray(wrapper.__actions__); + result.__index__ = wrapper.__index__; + result.__values__ = wrapper.__values__; + return result; + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates an array of elements split into groups the length of `size`. + * If `array` can't be split evenly, the final chunk will be the remaining + * elements. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to process. + * @param {number} [size=1] The length of each chunk + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the new array of chunks. + * @example + * + * _.chunk(['a', 'b', 'c', 'd'], 2); + * // => [['a', 'b'], ['c', 'd']] + * + * _.chunk(['a', 'b', 'c', 'd'], 3); + * // => [['a', 'b', 'c'], ['d']] + */ + function chunk(array, size, guard) { + if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { + size = 1; + } else { + size = nativeMax(toInteger(size), 0); + } + var length = array == null ? 0 : array.length; + if (!length || size < 1) { + return []; + } + var index = 0, + resIndex = 0, + result = Array(nativeCeil(length / size)); + + while (index < length) { + result[resIndex++] = baseSlice(array, index, (index += size)); + } + return result; + } + + /** + * Creates an array with all falsey values removed. The values `false`, `null`, + * `0`, `""`, `undefined`, and `NaN` are falsey. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to compact. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.compact([0, 1, false, 2, '', 3]); + * // => [1, 2, 3] + */ + function compact(array) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value) { + result[resIndex++] = value; + } + } + return result; + } + + /** + * Creates a new array concatenating `array` with any additional arrays + * and/or values. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to concatenate. + * @param {...*} [values] The values to concatenate. + * @returns {Array} Returns the new concatenated array. + * @example + * + * var array = [1]; + * var other = _.concat(array, 2, [3], [[4]]); + * + * console.log(other); + * // => [1, 2, 3, [4]] + * + * console.log(array); + * // => [1] + */ + function concat() { + var length = arguments.length; + if (!length) { + return []; + } + var args = Array(length - 1), + array = arguments[0], + index = length; + + while (index--) { + args[index - 1] = arguments[index]; + } + return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); + } + + /** + * Creates an array of `array` values not included in the other given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. + * + * **Note:** Unlike `_.pullAll`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @see _.without, _.xor + * @example + * + * _.difference([2, 1], [2, 3]); + * // => [1] + */ + var difference = baseRest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) + : []; + }); + + /** + * This method is like `_.difference` except that it accepts `iteratee` which + * is invoked for each element of `array` and `values` to generate the criterion + * by which they're compared. The order and references of result values are + * determined by the first array. The iteratee is invoked with one argument: + * (value). + * + * **Note:** Unlike `_.pullAllBy`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [1.2] + * + * // The `_.property` iteratee shorthand. + * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); + * // => [{ 'x': 2 }] + */ + var differenceBy = baseRest(function(array, values) { + var iteratee = last(values); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)) + : []; + }); + + /** + * This method is like `_.difference` except that it accepts `comparator` + * which is invoked to compare elements of `array` to `values`. The order and + * references of result values are determined by the first array. The comparator + * is invoked with two arguments: (arrVal, othVal). + * + * **Note:** Unlike `_.pullAllWith`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * + * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); + * // => [{ 'x': 2, 'y': 1 }] + */ + var differenceWith = baseRest(function(array, values) { + var comparator = last(values); + if (isArrayLikeObject(comparator)) { + comparator = undefined; + } + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) + : []; + }); + + /** + * Creates a slice of `array` with `n` elements dropped from the beginning. + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.drop([1, 2, 3]); + * // => [2, 3] + * + * _.drop([1, 2, 3], 2); + * // => [3] + * + * _.drop([1, 2, 3], 5); + * // => [] + * + * _.drop([1, 2, 3], 0); + * // => [1, 2, 3] + */ + function drop(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + return baseSlice(array, n < 0 ? 0 : n, length); + } + + /** + * Creates a slice of `array` with `n` elements dropped from the end. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.dropRight([1, 2, 3]); + * // => [1, 2] + * + * _.dropRight([1, 2, 3], 2); + * // => [1] + * + * _.dropRight([1, 2, 3], 5); + * // => [] + * + * _.dropRight([1, 2, 3], 0); + * // => [1, 2, 3] + */ + function dropRight(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + n = length - n; + return baseSlice(array, 0, n < 0 ? 0 : n); + } + + /** + * Creates a slice of `array` excluding elements dropped from the end. + * Elements are dropped until `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.dropRightWhile(users, function(o) { return !o.active; }); + * // => objects for ['barney'] + * + * // The `_.matches` iteratee shorthand. + * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); + * // => objects for ['barney', 'fred'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.dropRightWhile(users, ['active', false]); + * // => objects for ['barney'] + * + * // The `_.property` iteratee shorthand. + * _.dropRightWhile(users, 'active'); + * // => objects for ['barney', 'fred', 'pebbles'] + */ + function dropRightWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), true, true) + : []; + } + + /** + * Creates a slice of `array` excluding elements dropped from the beginning. + * Elements are dropped until `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.dropWhile(users, function(o) { return !o.active; }); + * // => objects for ['pebbles'] + * + * // The `_.matches` iteratee shorthand. + * _.dropWhile(users, { 'user': 'barney', 'active': false }); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.dropWhile(users, ['active', false]); + * // => objects for ['pebbles'] + * + * // The `_.property` iteratee shorthand. + * _.dropWhile(users, 'active'); + * // => objects for ['barney', 'fred', 'pebbles'] + */ + function dropWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), true) + : []; + } + + /** + * Fills elements of `array` with `value` from `start` up to, but not + * including, `end`. + * + * **Note:** This method mutates `array`. + * + * @static + * @memberOf _ + * @since 3.2.0 + * @category Array + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3]; + * + * _.fill(array, 'a'); + * console.log(array); + * // => ['a', 'a', 'a'] + * + * _.fill(Array(3), 2); + * // => [2, 2, 2] + * + * _.fill([4, 6, 8, 10], '*', 1, 3); + * // => [4, '*', '*', 10] + */ + function fill(array, value, start, end) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { + start = 0; + end = length; + } + return baseFill(array, value, start, end); + } + + /** + * This method is like `_.find` except that it returns the index of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.findIndex(users, function(o) { return o.user == 'barney'; }); + * // => 0 + * + * // The `_.matches` iteratee shorthand. + * _.findIndex(users, { 'user': 'fred', 'active': false }); + * // => 1 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findIndex(users, ['active', false]); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.findIndex(users, 'active'); + * // => 2 + */ + function findIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseFindIndex(array, getIteratee(predicate, 3), index); + } + + /** + * This method is like `_.findIndex` except that it iterates over elements + * of `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); + * // => 2 + * + * // The `_.matches` iteratee shorthand. + * _.findLastIndex(users, { 'user': 'barney', 'active': true }); + * // => 0 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findLastIndex(users, ['active', false]); + * // => 2 + * + * // The `_.property` iteratee shorthand. + * _.findLastIndex(users, 'active'); + * // => 0 + */ + function findLastIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = length - 1; + if (fromIndex !== undefined) { + index = toInteger(fromIndex); + index = fromIndex < 0 + ? nativeMax(length + index, 0) + : nativeMin(index, length - 1); + } + return baseFindIndex(array, getIteratee(predicate, 3), index, true); + } + + /** + * Flattens `array` a single level deep. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flatten([1, [2, [3, [4]], 5]]); + * // => [1, 2, [3, [4]], 5] + */ + function flatten(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, 1) : []; + } + + /** + * Recursively flattens `array`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flattenDeep([1, [2, [3, [4]], 5]]); + * // => [1, 2, 3, 4, 5] + */ + function flattenDeep(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, INFINITY) : []; + } + + /** + * Recursively flatten `array` up to `depth` times. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Array + * @param {Array} array The array to flatten. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * var array = [1, [2, [3, [4]], 5]]; + * + * _.flattenDepth(array, 1); + * // => [1, 2, [3, [4]], 5] + * + * _.flattenDepth(array, 2); + * // => [1, 2, 3, [4], 5] + */ + function flattenDepth(array, depth) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(array, depth); + } + + /** + * The inverse of `_.toPairs`; this method returns an object composed + * from key-value `pairs`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} pairs The key-value pairs. + * @returns {Object} Returns the new object. + * @example + * + * _.fromPairs([['a', 1], ['b', 2]]); + * // => { 'a': 1, 'b': 2 } + */ + function fromPairs(pairs) { + var index = -1, + length = pairs == null ? 0 : pairs.length, + result = {}; + + while (++index < length) { + var pair = pairs[index]; + result[pair[0]] = pair[1]; + } + return result; + } + + /** + * Gets the first element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias first + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the first element of `array`. + * @example + * + * _.head([1, 2, 3]); + * // => 1 + * + * _.head([]); + * // => undefined + */ + function head(array) { + return (array && array.length) ? array[0] : undefined; + } + + /** + * Gets the index at which the first occurrence of `value` is found in `array` + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. If `fromIndex` is negative, it's used as the + * offset from the end of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.indexOf([1, 2, 1, 2], 2); + * // => 1 + * + * // Search from the `fromIndex`. + * _.indexOf([1, 2, 1, 2], 2, 2); + * // => 3 + */ + function indexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseIndexOf(array, value, index); + } + + /** + * Gets all but the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.initial([1, 2, 3]); + * // => [1, 2] + */ + function initial(array) { + var length = array == null ? 0 : array.length; + return length ? baseSlice(array, 0, -1) : []; + } + + /** + * Creates an array of unique values that are included in all given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersection([2, 1], [2, 3]); + * // => [2] + */ + var intersection = baseRest(function(arrays) { + var mapped = arrayMap(arrays, castArrayLikeObject); + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped) + : []; + }); + + /** + * This method is like `_.intersection` except that it accepts `iteratee` + * which is invoked for each element of each `arrays` to generate the criterion + * by which they're compared. The order and references of result values are + * determined by the first array. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [2.1] + * + * // The `_.property` iteratee shorthand. + * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }] + */ + var intersectionBy = baseRest(function(arrays) { + var iteratee = last(arrays), + mapped = arrayMap(arrays, castArrayLikeObject); + + if (iteratee === last(mapped)) { + iteratee = undefined; + } else { + mapped.pop(); + } + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped, getIteratee(iteratee, 2)) + : []; + }); + + /** + * This method is like `_.intersection` except that it accepts `comparator` + * which is invoked to compare elements of `arrays`. The order and references + * of result values are determined by the first array. The comparator is + * invoked with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.intersectionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }] + */ + var intersectionWith = baseRest(function(arrays) { + var comparator = last(arrays), + mapped = arrayMap(arrays, castArrayLikeObject); + + comparator = typeof comparator == 'function' ? comparator : undefined; + if (comparator) { + mapped.pop(); + } + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped, undefined, comparator) + : []; + }); + + /** + * Converts all elements in `array` into a string separated by `separator`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to convert. + * @param {string} [separator=','] The element separator. + * @returns {string} Returns the joined string. + * @example + * + * _.join(['a', 'b', 'c'], '~'); + * // => 'a~b~c' + */ + function join(array, separator) { + return array == null ? '' : nativeJoin.call(array, separator); + } + + /** + * Gets the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + */ + function last(array) { + var length = array == null ? 0 : array.length; + return length ? array[length - 1] : undefined; + } + + /** + * This method is like `_.indexOf` except that it iterates over elements of + * `array` from right to left. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.lastIndexOf([1, 2, 1, 2], 2); + * // => 3 + * + * // Search from the `fromIndex`. + * _.lastIndexOf([1, 2, 1, 2], 2, 2); + * // => 1 + */ + function lastIndexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = length; + if (fromIndex !== undefined) { + index = toInteger(fromIndex); + index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); + } + return value === value + ? strictLastIndexOf(array, value, index) + : baseFindIndex(array, baseIsNaN, index, true); + } + + /** + * Gets the element at index `n` of `array`. If `n` is negative, the nth + * element from the end is returned. + * + * @static + * @memberOf _ + * @since 4.11.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=0] The index of the element to return. + * @returns {*} Returns the nth element of `array`. + * @example + * + * var array = ['a', 'b', 'c', 'd']; + * + * _.nth(array, 1); + * // => 'b' + * + * _.nth(array, -2); + * // => 'c'; + */ + function nth(array, n) { + return (array && array.length) ? baseNth(array, toInteger(n)) : undefined; + } + + /** + * Removes all given values from `array` using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` + * to remove elements from an array by predicate. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {...*} [values] The values to remove. + * @returns {Array} Returns `array`. + * @example + * + * var array = ['a', 'b', 'c', 'a', 'b', 'c']; + * + * _.pull(array, 'a', 'c'); + * console.log(array); + * // => ['b', 'b'] + */ + var pull = baseRest(pullAll); + + /** + * This method is like `_.pull` except that it accepts an array of values to remove. + * + * **Note:** Unlike `_.difference`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @returns {Array} Returns `array`. + * @example + * + * var array = ['a', 'b', 'c', 'a', 'b', 'c']; + * + * _.pullAll(array, ['a', 'c']); + * console.log(array); + * // => ['b', 'b'] + */ + function pullAll(array, values) { + return (array && array.length && values && values.length) + ? basePullAll(array, values) + : array; + } + + /** + * This method is like `_.pullAll` except that it accepts `iteratee` which is + * invoked for each element of `array` and `values` to generate the criterion + * by which they're compared. The iteratee is invoked with one argument: (value). + * + * **Note:** Unlike `_.differenceBy`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns `array`. + * @example + * + * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; + * + * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); + * console.log(array); + * // => [{ 'x': 2 }] + */ + function pullAllBy(array, values, iteratee) { + return (array && array.length && values && values.length) + ? basePullAll(array, values, getIteratee(iteratee, 2)) + : array; + } + + /** + * This method is like `_.pullAll` except that it accepts `comparator` which + * is invoked to compare elements of `array` to `values`. The comparator is + * invoked with two arguments: (arrVal, othVal). + * + * **Note:** Unlike `_.differenceWith`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns `array`. + * @example + * + * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; + * + * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); + * console.log(array); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] + */ + function pullAllWith(array, values, comparator) { + return (array && array.length && values && values.length) + ? basePullAll(array, values, undefined, comparator) + : array; + } + + /** + * Removes elements from `array` corresponding to `indexes` and returns an + * array of removed elements. + * + * **Note:** Unlike `_.at`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {...(number|number[])} [indexes] The indexes of elements to remove. + * @returns {Array} Returns the new array of removed elements. + * @example + * + * var array = ['a', 'b', 'c', 'd']; + * var pulled = _.pullAt(array, [1, 3]); + * + * console.log(array); + * // => ['a', 'c'] + * + * console.log(pulled); + * // => ['b', 'd'] + */ + var pullAt = flatRest(function(array, indexes) { + var length = array == null ? 0 : array.length, + result = baseAt(array, indexes); + + basePullAt(array, arrayMap(indexes, function(index) { + return isIndex(index, length) ? +index : index; + }).sort(compareAscending)); + + return result; + }); + + /** + * Removes all elements from `array` that `predicate` returns truthy for + * and returns an array of the removed elements. The predicate is invoked + * with three arguments: (value, index, array). + * + * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull` + * to pull elements from an array by value. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new array of removed elements. + * @example + * + * var array = [1, 2, 3, 4]; + * var evens = _.remove(array, function(n) { + * return n % 2 == 0; + * }); + * + * console.log(array); + * // => [1, 3] + * + * console.log(evens); + * // => [2, 4] + */ + function remove(array, predicate) { + var result = []; + if (!(array && array.length)) { + return result; + } + var index = -1, + indexes = [], + length = array.length; + + predicate = getIteratee(predicate, 3); + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result.push(value); + indexes.push(index); + } + } + basePullAt(array, indexes); + return result; + } + + /** + * Reverses `array` so that the first element becomes the last, the second + * element becomes the second to last, and so on. + * + * **Note:** This method mutates `array` and is based on + * [`Array#reverse`](https://mdn.io/Array/reverse). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3]; + * + * _.reverse(array); + * // => [3, 2, 1] + * + * console.log(array); + * // => [3, 2, 1] + */ + function reverse(array) { + return array == null ? array : nativeReverse.call(array); + } + + /** + * Creates a slice of `array` from `start` up to, but not including, `end`. + * + * **Note:** This method is used instead of + * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are + * returned. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function slice(array, start, end) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { + start = 0; + end = length; + } + else { + start = start == null ? 0 : toInteger(start); + end = end === undefined ? length : toInteger(end); + } + return baseSlice(array, start, end); + } + + /** + * Uses a binary search to determine the lowest index at which `value` + * should be inserted into `array` in order to maintain its sort order. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * _.sortedIndex([30, 50], 40); + * // => 1 + */ + function sortedIndex(array, value) { + return baseSortedIndex(array, value); + } + + /** + * This method is like `_.sortedIndex` except that it accepts `iteratee` + * which is invoked for `value` and each element of `array` to compute their + * sort ranking. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * var objects = [{ 'x': 4 }, { 'x': 5 }]; + * + * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.sortedIndexBy(objects, { 'x': 4 }, 'x'); + * // => 0 + */ + function sortedIndexBy(array, value, iteratee) { + return baseSortedIndexBy(array, value, getIteratee(iteratee, 2)); + } + + /** + * This method is like `_.indexOf` except that it performs a binary + * search on a sorted `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.sortedIndexOf([4, 5, 5, 5, 6], 5); + * // => 1 + */ + function sortedIndexOf(array, value) { + var length = array == null ? 0 : array.length; + if (length) { + var index = baseSortedIndex(array, value); + if (index < length && eq(array[index], value)) { + return index; + } + } + return -1; + } + + /** + * This method is like `_.sortedIndex` except that it returns the highest + * index at which `value` should be inserted into `array` in order to + * maintain its sort order. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * _.sortedLastIndex([4, 5, 5, 5, 6], 5); + * // => 4 + */ + function sortedLastIndex(array, value) { + return baseSortedIndex(array, value, true); + } + + /** + * This method is like `_.sortedLastIndex` except that it accepts `iteratee` + * which is invoked for `value` and each element of `array` to compute their + * sort ranking. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * var objects = [{ 'x': 4 }, { 'x': 5 }]; + * + * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); + * // => 1 + * + * // The `_.property` iteratee shorthand. + * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x'); + * // => 1 + */ + function sortedLastIndexBy(array, value, iteratee) { + return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true); + } + + /** + * This method is like `_.lastIndexOf` except that it performs a binary + * search on a sorted `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5); + * // => 3 + */ + function sortedLastIndexOf(array, value) { + var length = array == null ? 0 : array.length; + if (length) { + var index = baseSortedIndex(array, value, true) - 1; + if (eq(array[index], value)) { + return index; + } + } + return -1; + } + + /** + * This method is like `_.uniq` except that it's designed and optimized + * for sorted arrays. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.sortedUniq([1, 1, 2]); + * // => [1, 2] + */ + function sortedUniq(array) { + return (array && array.length) + ? baseSortedUniq(array) + : []; + } + + /** + * This method is like `_.uniqBy` except that it's designed and optimized + * for sorted arrays. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); + * // => [1.1, 2.3] + */ + function sortedUniqBy(array, iteratee) { + return (array && array.length) + ? baseSortedUniq(array, getIteratee(iteratee, 2)) + : []; + } + + /** + * Gets all but the first element of `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to query. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.tail([1, 2, 3]); + * // => [2, 3] + */ + function tail(array) { + var length = array == null ? 0 : array.length; + return length ? baseSlice(array, 1, length) : []; + } + + /** + * Creates a slice of `array` with `n` elements taken from the beginning. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to take. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.take([1, 2, 3]); + * // => [1] + * + * _.take([1, 2, 3], 2); + * // => [1, 2] + * + * _.take([1, 2, 3], 5); + * // => [1, 2, 3] + * + * _.take([1, 2, 3], 0); + * // => [] + */ + function take(array, n, guard) { + if (!(array && array.length)) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + return baseSlice(array, 0, n < 0 ? 0 : n); + } + + /** + * Creates a slice of `array` with `n` elements taken from the end. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to take. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.takeRight([1, 2, 3]); + * // => [3] + * + * _.takeRight([1, 2, 3], 2); + * // => [2, 3] + * + * _.takeRight([1, 2, 3], 5); + * // => [1, 2, 3] + * + * _.takeRight([1, 2, 3], 0); + * // => [] + */ + function takeRight(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + n = length - n; + return baseSlice(array, n < 0 ? 0 : n, length); + } + + /** + * Creates a slice of `array` with elements taken from the end. Elements are + * taken until `predicate` returns falsey. The predicate is invoked with + * three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.takeRightWhile(users, function(o) { return !o.active; }); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.matches` iteratee shorthand. + * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false }); + * // => objects for ['pebbles'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.takeRightWhile(users, ['active', false]); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.property` iteratee shorthand. + * _.takeRightWhile(users, 'active'); + * // => [] + */ + function takeRightWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), false, true) + : []; + } + + /** + * Creates a slice of `array` with elements taken from the beginning. Elements + * are taken until `predicate` returns falsey. The predicate is invoked with + * three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.takeWhile(users, function(o) { return !o.active; }); + * // => objects for ['barney', 'fred'] + * + * // The `_.matches` iteratee shorthand. + * _.takeWhile(users, { 'user': 'barney', 'active': false }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.takeWhile(users, ['active', false]); + * // => objects for ['barney', 'fred'] + * + * // The `_.property` iteratee shorthand. + * _.takeWhile(users, 'active'); + * // => [] + */ + function takeWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3)) + : []; + } + + /** + * Creates an array of unique values, in order, from all given arrays using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of combined values. + * @example + * + * _.union([2], [1, 2]); + * // => [2, 1] + */ + var union = baseRest(function(arrays) { + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); + }); + + /** + * This method is like `_.union` except that it accepts `iteratee` which is + * invoked for each element of each `arrays` to generate the criterion by + * which uniqueness is computed. Result values are chosen from the first + * array in which the value occurs. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of combined values. + * @example + * + * _.unionBy([2.1], [1.2, 2.3], Math.floor); + * // => [2.1, 1.2] + * + * // The `_.property` iteratee shorthand. + * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */ + var unionBy = baseRest(function(arrays) { + var iteratee = last(arrays); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)); + }); + + /** + * This method is like `_.union` except that it accepts `comparator` which + * is invoked to compare elements of `arrays`. Result values are chosen from + * the first array in which the value occurs. The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of combined values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.unionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] + */ + var unionWith = baseRest(function(arrays) { + var comparator = last(arrays); + comparator = typeof comparator == 'function' ? comparator : undefined; + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator); + }); + + /** + * Creates a duplicate-free version of an array, using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons, in which only the first occurrence of each element + * is kept. The order of result values is determined by the order they occur + * in the array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.uniq([2, 1, 2]); + * // => [2, 1] + */ + function uniq(array) { + return (array && array.length) ? baseUniq(array) : []; + } + + /** + * This method is like `_.uniq` except that it accepts `iteratee` which is + * invoked for each element in `array` to generate the criterion by which + * uniqueness is computed. The order of result values is determined by the + * order they occur in the array. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.uniqBy([2.1, 1.2, 2.3], Math.floor); + * // => [2.1, 1.2] + * + * // The `_.property` iteratee shorthand. + * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */ + function uniqBy(array, iteratee) { + return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : []; + } + + /** + * This method is like `_.uniq` except that it accepts `comparator` which + * is invoked to compare elements of `array`. The order of result values is + * determined by the order they occur in the array.The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.uniqWith(objects, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] + */ + function uniqWith(array, comparator) { + comparator = typeof comparator == 'function' ? comparator : undefined; + return (array && array.length) ? baseUniq(array, undefined, comparator) : []; + } + + /** + * This method is like `_.zip` except that it accepts an array of grouped + * elements and creates an array regrouping the elements to their pre-zip + * configuration. + * + * @static + * @memberOf _ + * @since 1.2.0 + * @category Array + * @param {Array} array The array of grouped elements to process. + * @returns {Array} Returns the new array of regrouped elements. + * @example + * + * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]); + * // => [['a', 1, true], ['b', 2, false]] + * + * _.unzip(zipped); + * // => [['a', 'b'], [1, 2], [true, false]] + */ + function unzip(array) { + if (!(array && array.length)) { + return []; + } + var length = 0; + array = arrayFilter(array, function(group) { + if (isArrayLikeObject(group)) { + length = nativeMax(group.length, length); + return true; + } + }); + return baseTimes(length, function(index) { + return arrayMap(array, baseProperty(index)); + }); + } + + /** + * This method is like `_.unzip` except that it accepts `iteratee` to specify + * how regrouped values should be combined. The iteratee is invoked with the + * elements of each group: (...group). + * + * @static + * @memberOf _ + * @since 3.8.0 + * @category Array + * @param {Array} array The array of grouped elements to process. + * @param {Function} [iteratee=_.identity] The function to combine + * regrouped values. + * @returns {Array} Returns the new array of regrouped elements. + * @example + * + * var zipped = _.zip([1, 2], [10, 20], [100, 200]); + * // => [[1, 10, 100], [2, 20, 200]] + * + * _.unzipWith(zipped, _.add); + * // => [3, 30, 300] + */ + function unzipWith(array, iteratee) { + if (!(array && array.length)) { + return []; + } + var result = unzip(array); + if (iteratee == null) { + return result; + } + return arrayMap(result, function(group) { + return apply(iteratee, undefined, group); + }); + } + + /** + * Creates an array excluding all given values using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * **Note:** Unlike `_.pull`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...*} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @see _.difference, _.xor + * @example + * + * _.without([2, 1, 2, 3], 1, 2); + * // => [3] + */ + var without = baseRest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, values) + : []; + }); + + /** + * Creates an array of unique values that is the + * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) + * of the given arrays. The order of result values is determined by the order + * they occur in the arrays. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of filtered values. + * @see _.difference, _.without + * @example + * + * _.xor([2, 1], [2, 3]); + * // => [1, 3] + */ + var xor = baseRest(function(arrays) { + return baseXor(arrayFilter(arrays, isArrayLikeObject)); + }); + + /** + * This method is like `_.xor` except that it accepts `iteratee` which is + * invoked for each element of each `arrays` to generate the criterion by + * which by which they're compared. The order of result values is determined + * by the order they occur in the arrays. The iteratee is invoked with one + * argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [1.2, 3.4] + * + * // The `_.property` iteratee shorthand. + * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 2 }] + */ + var xorBy = baseRest(function(arrays) { + var iteratee = last(arrays); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2)); + }); + + /** + * This method is like `_.xor` except that it accepts `comparator` which is + * invoked to compare elements of `arrays`. The order of result values is + * determined by the order they occur in the arrays. The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.xorWith(objects, others, _.isEqual); + * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] + */ + var xorWith = baseRest(function(arrays) { + var comparator = last(arrays); + comparator = typeof comparator == 'function' ? comparator : undefined; + return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator); + }); + + /** + * Creates an array of grouped elements, the first of which contains the + * first elements of the given arrays, the second of which contains the + * second elements of the given arrays, and so on. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to process. + * @returns {Array} Returns the new array of grouped elements. + * @example + * + * _.zip(['a', 'b'], [1, 2], [true, false]); + * // => [['a', 1, true], ['b', 2, false]] + */ + var zip = baseRest(unzip); + + /** + * This method is like `_.fromPairs` except that it accepts two arrays, + * one of property identifiers and one of corresponding values. + * + * @static + * @memberOf _ + * @since 0.4.0 + * @category Array + * @param {Array} [props=[]] The property identifiers. + * @param {Array} [values=[]] The property values. + * @returns {Object} Returns the new object. + * @example + * + * _.zipObject(['a', 'b'], [1, 2]); + * // => { 'a': 1, 'b': 2 } + */ + function zipObject(props, values) { + return baseZipObject(props || [], values || [], assignValue); + } + + /** + * This method is like `_.zipObject` except that it supports property paths. + * + * @static + * @memberOf _ + * @since 4.1.0 + * @category Array + * @param {Array} [props=[]] The property identifiers. + * @param {Array} [values=[]] The property values. + * @returns {Object} Returns the new object. + * @example + * + * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); + * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } } + */ + function zipObjectDeep(props, values) { + return baseZipObject(props || [], values || [], baseSet); + } + + /** + * This method is like `_.zip` except that it accepts `iteratee` to specify + * how grouped values should be combined. The iteratee is invoked with the + * elements of each group: (...group). + * + * @static + * @memberOf _ + * @since 3.8.0 + * @category Array + * @param {...Array} [arrays] The arrays to process. + * @param {Function} [iteratee=_.identity] The function to combine + * grouped values. + * @returns {Array} Returns the new array of grouped elements. + * @example + * + * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) { + * return a + b + c; + * }); + * // => [111, 222] + */ + var zipWith = baseRest(function(arrays) { + var length = arrays.length, + iteratee = length > 1 ? arrays[length - 1] : undefined; + + iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined; + return unzipWith(arrays, iteratee); + }); + + /*------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` wrapper instance that wraps `value` with explicit method + * chain sequences enabled. The result of such sequences must be unwrapped + * with `_#value`. + * + * @static + * @memberOf _ + * @since 1.3.0 + * @category Seq + * @param {*} value The value to wrap. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'pebbles', 'age': 1 } + * ]; + * + * var youngest = _ + * .chain(users) + * .sortBy('age') + * .map(function(o) { + * return o.user + ' is ' + o.age; + * }) + * .head() + * .value(); + * // => 'pebbles is 1' + */ + function chain(value) { + var result = lodash(value); + result.__chain__ = true; + return result; + } + + /** + * This method invokes `interceptor` and returns `value`. The interceptor + * is invoked with one argument; (value). The purpose of this method is to + * "tap into" a method chain sequence in order to modify intermediate results. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @returns {*} Returns `value`. + * @example + * + * _([1, 2, 3]) + * .tap(function(array) { + * // Mutate input array. + * array.pop(); + * }) + * .reverse() + * .value(); + * // => [2, 1] + */ + function tap(value, interceptor) { + interceptor(value); + return value; + } + + /** + * This method is like `_.tap` except that it returns the result of `interceptor`. + * The purpose of this method is to "pass thru" values replacing intermediate + * results in a method chain sequence. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Seq + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @returns {*} Returns the result of `interceptor`. + * @example + * + * _(' abc ') + * .chain() + * .trim() + * .thru(function(value) { + * return [value]; + * }) + * .value(); + * // => ['abc'] + */ + function thru(value, interceptor) { + return interceptor(value); + } + + /** + * This method is the wrapper version of `_.at`. + * + * @name at + * @memberOf _ + * @since 1.0.0 + * @category Seq + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; + * + * _(object).at(['a[0].b.c', 'a[1]']).value(); + * // => [3, 4] + */ + var wrapperAt = flatRest(function(paths) { + var length = paths.length, + start = length ? paths[0] : 0, + value = this.__wrapped__, + interceptor = function(object) { return baseAt(object, paths); }; + + if (length > 1 || this.__actions__.length || + !(value instanceof LazyWrapper) || !isIndex(start)) { + return this.thru(interceptor); + } + value = value.slice(start, +start + (length ? 1 : 0)); + value.__actions__.push({ + 'func': thru, + 'args': [interceptor], + 'thisArg': undefined + }); + return new LodashWrapper(value, this.__chain__).thru(function(array) { + if (length && !array.length) { + array.push(undefined); + } + return array; + }); + }); + + /** + * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. + * + * @name chain + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 } + * ]; + * + * // A sequence without explicit chaining. + * _(users).head(); + * // => { 'user': 'barney', 'age': 36 } + * + * // A sequence with explicit chaining. + * _(users) + * .chain() + * .head() + * .pick('user') + * .value(); + * // => { 'user': 'barney' } + */ + function wrapperChain() { + return chain(this); + } + + /** + * Executes the chain sequence and returns the wrapped result. + * + * @name commit + * @memberOf _ + * @since 3.2.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var array = [1, 2]; + * var wrapped = _(array).push(3); + * + * console.log(array); + * // => [1, 2] + * + * wrapped = wrapped.commit(); + * console.log(array); + * // => [1, 2, 3] + * + * wrapped.last(); + * // => 3 + * + * console.log(array); + * // => [1, 2, 3] + */ + function wrapperCommit() { + return new LodashWrapper(this.value(), this.__chain__); + } + + /** + * Gets the next value on a wrapped object following the + * [iterator protocol](https://mdn.io/iteration_protocols#iterator). + * + * @name next + * @memberOf _ + * @since 4.0.0 + * @category Seq + * @returns {Object} Returns the next iterator value. + * @example + * + * var wrapped = _([1, 2]); + * + * wrapped.next(); + * // => { 'done': false, 'value': 1 } + * + * wrapped.next(); + * // => { 'done': false, 'value': 2 } + * + * wrapped.next(); + * // => { 'done': true, 'value': undefined } + */ + function wrapperNext() { + if (this.__values__ === undefined) { + this.__values__ = toArray(this.value()); + } + var done = this.__index__ >= this.__values__.length, + value = done ? undefined : this.__values__[this.__index__++]; + + return { 'done': done, 'value': value }; + } + + /** + * Enables the wrapper to be iterable. + * + * @name Symbol.iterator + * @memberOf _ + * @since 4.0.0 + * @category Seq + * @returns {Object} Returns the wrapper object. + * @example + * + * var wrapped = _([1, 2]); + * + * wrapped[Symbol.iterator]() === wrapped; + * // => true + * + * Array.from(wrapped); + * // => [1, 2] + */ + function wrapperToIterator() { + return this; + } + + /** + * Creates a clone of the chain sequence planting `value` as the wrapped value. + * + * @name plant + * @memberOf _ + * @since 3.2.0 + * @category Seq + * @param {*} value The value to plant. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * function square(n) { + * return n * n; + * } + * + * var wrapped = _([1, 2]).map(square); + * var other = wrapped.plant([3, 4]); + * + * other.value(); + * // => [9, 16] + * + * wrapped.value(); + * // => [1, 4] + */ + function wrapperPlant(value) { + var result, + parent = this; + + while (parent instanceof baseLodash) { + var clone = wrapperClone(parent); + clone.__index__ = 0; + clone.__values__ = undefined; + if (result) { + previous.__wrapped__ = clone; + } else { + result = clone; + } + var previous = clone; + parent = parent.__wrapped__; + } + previous.__wrapped__ = value; + return result; + } + + /** + * This method is the wrapper version of `_.reverse`. + * + * **Note:** This method mutates the wrapped array. + * + * @name reverse + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var array = [1, 2, 3]; + * + * _(array).reverse().value() + * // => [3, 2, 1] + * + * console.log(array); + * // => [3, 2, 1] + */ + function wrapperReverse() { + var value = this.__wrapped__; + if (value instanceof LazyWrapper) { + var wrapped = value; + if (this.__actions__.length) { + wrapped = new LazyWrapper(this); + } + wrapped = wrapped.reverse(); + wrapped.__actions__.push({ + 'func': thru, + 'args': [reverse], + 'thisArg': undefined + }); + return new LodashWrapper(wrapped, this.__chain__); + } + return this.thru(reverse); + } + + /** + * Executes the chain sequence to resolve the unwrapped value. + * + * @name value + * @memberOf _ + * @since 0.1.0 + * @alias toJSON, valueOf + * @category Seq + * @returns {*} Returns the resolved unwrapped value. + * @example + * + * _([1, 2, 3]).value(); + * // => [1, 2, 3] + */ + function wrapperValue() { + return baseWrapperValue(this.__wrapped__, this.__actions__); + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The corresponding value of + * each key is the number of times the key was returned by `iteratee`. The + * iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.countBy([6.1, 4.2, 6.3], Math.floor); + * // => { '4': 1, '6': 2 } + * + * // The `_.property` iteratee shorthand. + * _.countBy(['one', 'two', 'three'], 'length'); + * // => { '3': 2, '5': 1 } + */ + var countBy = createAggregator(function(result, value, key) { + if (hasOwnProperty.call(result, key)) { + ++result[key]; + } else { + baseAssignValue(result, key, 1); + } + }); + + /** + * Checks if `predicate` returns truthy for **all** elements of `collection`. + * Iteration is stopped once `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * **Note:** This method returns `true` for + * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because + * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of + * elements of empty collections. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + * @example + * + * _.every([true, 1, null, 'yes'], Boolean); + * // => false + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.every(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.every(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.every(users, 'active'); + * // => false + */ + function every(collection, predicate, guard) { + var func = isArray(collection) ? arrayEvery : baseEvery; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; + } + return func(collection, getIteratee(predicate, 3)); + } + + /** + * Iterates over elements of `collection`, returning an array of all elements + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * **Note:** Unlike `_.remove`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.reject + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * _.filter(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.filter(users, { 'age': 36, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.filter(users, 'active'); + * // => objects for ['barney'] + */ + function filter(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, getIteratee(predicate, 3)); + } + + /** + * Iterates over elements of `collection`, returning the first element + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false }, + * { 'user': 'pebbles', 'age': 1, 'active': true } + * ]; + * + * _.find(users, function(o) { return o.age < 40; }); + * // => object for 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.find(users, { 'age': 1, 'active': true }); + * // => object for 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.find(users, ['active', false]); + * // => object for 'fred' + * + * // The `_.property` iteratee shorthand. + * _.find(users, 'active'); + * // => object for 'barney' + */ + var find = createFind(findIndex); + + /** + * This method is like `_.find` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=collection.length-1] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * _.findLast([1, 2, 3, 4], function(n) { + * return n % 2 == 1; + * }); + * // => 3 + */ + var findLast = createFind(findLastIndex); + + /** + * Creates a flattened array of values by running each element in `collection` + * thru `iteratee` and flattening the mapped results. The iteratee is invoked + * with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [n, n]; + * } + * + * _.flatMap([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ + function flatMap(collection, iteratee) { + return baseFlatten(map(collection, iteratee), 1); + } + + /** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDeep([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ + function flatMapDeep(collection, iteratee) { + return baseFlatten(map(collection, iteratee), INFINITY); + } + + /** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results up to `depth` times. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDepth([1, 2], duplicate, 2); + * // => [[1, 1], [2, 2]] + */ + function flatMapDepth(collection, iteratee, depth) { + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(map(collection, iteratee), depth); + } + + /** + * Iterates over elements of `collection` and invokes `iteratee` for each element. + * The iteratee is invoked with three arguments: (value, index|key, collection). + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * **Note:** As with other "Collections" methods, objects with a "length" + * property are iterated like arrays. To avoid this behavior use `_.forIn` + * or `_.forOwn` for object iteration. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias each + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEachRight + * @example + * + * _.forEach([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `1` then `2`. + * + * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ + function forEach(collection, iteratee) { + var func = isArray(collection) ? arrayEach : baseEach; + return func(collection, getIteratee(iteratee, 3)); + } + + /** + * This method is like `_.forEach` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @alias eachRight + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEach + * @example + * + * _.forEachRight([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `2` then `1`. + */ + function forEachRight(collection, iteratee) { + var func = isArray(collection) ? arrayEachRight : baseEachRight; + return func(collection, getIteratee(iteratee, 3)); + } + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The order of grouped values + * is determined by the order they occur in `collection`. The corresponding + * value of each key is an array of elements responsible for generating the + * key. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.groupBy([6.1, 4.2, 6.3], Math.floor); + * // => { '4': [4.2], '6': [6.1, 6.3] } + * + * // The `_.property` iteratee shorthand. + * _.groupBy(['one', 'two', 'three'], 'length'); + * // => { '3': ['one', 'two'], '5': ['three'] } + */ + var groupBy = createAggregator(function(result, value, key) { + if (hasOwnProperty.call(result, key)) { + result[key].push(value); + } else { + baseAssignValue(result, key, [value]); + } + }); + + /** + * Checks if `value` is in `collection`. If `collection` is a string, it's + * checked for a substring of `value`, otherwise + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * is used for equality comparisons. If `fromIndex` is negative, it's used as + * the offset from the end of `collection`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {boolean} Returns `true` if `value` is found, else `false`. + * @example + * + * _.includes([1, 2, 3], 1); + * // => true + * + * _.includes([1, 2, 3], 1, 2); + * // => false + * + * _.includes({ 'a': 1, 'b': 2 }, 1); + * // => true + * + * _.includes('abcd', 'bc'); + * // => true + */ + function includes(collection, value, fromIndex, guard) { + collection = isArrayLike(collection) ? collection : values(collection); + fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; + + var length = collection.length; + if (fromIndex < 0) { + fromIndex = nativeMax(length + fromIndex, 0); + } + return isString(collection) + ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) + : (!!length && baseIndexOf(collection, value, fromIndex) > -1); + } + + /** + * Invokes the method at `path` of each element in `collection`, returning + * an array of the results of each invoked method. Any additional arguments + * are provided to each invoked method. If `path` is a function, it's invoked + * for, and `this` bound to, each element in `collection`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|string} path The path of the method to invoke or + * the function invoked per iteration. + * @param {...*} [args] The arguments to invoke each method with. + * @returns {Array} Returns the array of results. + * @example + * + * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); + * // => [[1, 5, 7], [1, 2, 3]] + * + * _.invokeMap([123, 456], String.prototype.split, ''); + * // => [['1', '2', '3'], ['4', '5', '6']] + */ + var invokeMap = baseRest(function(collection, path, args) { + var index = -1, + isFunc = typeof path == 'function', + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value) { + result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args); + }); + return result; + }); + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The corresponding value of + * each key is the last element responsible for generating the key. The + * iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * var array = [ + * { 'dir': 'left', 'code': 97 }, + * { 'dir': 'right', 'code': 100 } + * ]; + * + * _.keyBy(array, function(o) { + * return String.fromCharCode(o.code); + * }); + * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } + * + * _.keyBy(array, 'dir'); + * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } + */ + var keyBy = createAggregator(function(result, value, key) { + baseAssignValue(result, key, value); + }); + + /** + * Creates an array of values by running each element in `collection` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. + * + * The guarded methods are: + * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, + * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, + * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, + * `template`, `trim`, `trimEnd`, `trimStart`, and `words` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + * @example + * + * function square(n) { + * return n * n; + * } + * + * _.map([4, 8], square); + * // => [16, 64] + * + * _.map({ 'a': 4, 'b': 8 }, square); + * // => [16, 64] (iteration order is not guaranteed) + * + * var users = [ + * { 'user': 'barney' }, + * { 'user': 'fred' } + * ]; + * + * // The `_.property` iteratee shorthand. + * _.map(users, 'user'); + * // => ['barney', 'fred'] + */ + function map(collection, iteratee) { + var func = isArray(collection) ? arrayMap : baseMap; + return func(collection, getIteratee(iteratee, 3)); + } + + /** + * This method is like `_.sortBy` except that it allows specifying the sort + * orders of the iteratees to sort by. If `orders` is unspecified, all values + * are sorted in ascending order. Otherwise, specify an order of "desc" for + * descending or "asc" for ascending sort order of corresponding values. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]] + * The iteratees to sort by. + * @param {string[]} [orders] The sort orders of `iteratees`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 34 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'barney', 'age': 36 } + * ]; + * + * // Sort by `user` in ascending order and by `age` in descending order. + * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + */ + function orderBy(collection, iteratees, orders, guard) { + if (collection == null) { + return []; + } + if (!isArray(iteratees)) { + iteratees = iteratees == null ? [] : [iteratees]; + } + orders = guard ? undefined : orders; + if (!isArray(orders)) { + orders = orders == null ? [] : [orders]; + } + return baseOrderBy(collection, iteratees, orders); + } + + /** + * Creates an array of elements split into two groups, the first of which + * contains elements `predicate` returns truthy for, the second of which + * contains elements `predicate` returns falsey for. The predicate is + * invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the array of grouped elements. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': true }, + * { 'user': 'pebbles', 'age': 1, 'active': false } + * ]; + * + * _.partition(users, function(o) { return o.active; }); + * // => objects for [['fred'], ['barney', 'pebbles']] + * + * // The `_.matches` iteratee shorthand. + * _.partition(users, { 'age': 1, 'active': false }); + * // => objects for [['pebbles'], ['barney', 'fred']] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.partition(users, ['active', false]); + * // => objects for [['barney', 'pebbles'], ['fred']] + * + * // The `_.property` iteratee shorthand. + * _.partition(users, 'active'); + * // => objects for [['fred'], ['barney', 'pebbles']] + */ + var partition = createAggregator(function(result, value, key) { + result[key ? 0 : 1].push(value); + }, function() { return [[], []]; }); + + /** + * Reduces `collection` to a value which is the accumulated result of running + * each element in `collection` thru `iteratee`, where each successive + * invocation is supplied the return value of the previous. If `accumulator` + * is not given, the first element of `collection` is used as the initial + * value. The iteratee is invoked with four arguments: + * (accumulator, value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.reduce`, `_.reduceRight`, and `_.transform`. + * + * The guarded methods are: + * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, + * and `sortBy` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @returns {*} Returns the accumulated value. + * @see _.reduceRight + * @example + * + * _.reduce([1, 2], function(sum, n) { + * return sum + n; + * }, 0); + * // => 3 + * + * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { + * (result[value] || (result[value] = [])).push(key); + * return result; + * }, {}); + * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) + */ + function reduce(collection, iteratee, accumulator) { + var func = isArray(collection) ? arrayReduce : baseReduce, + initAccum = arguments.length < 3; + + return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach); + } + + /** + * This method is like `_.reduce` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @returns {*} Returns the accumulated value. + * @see _.reduce + * @example + * + * var array = [[0, 1], [2, 3], [4, 5]]; + * + * _.reduceRight(array, function(flattened, other) { + * return flattened.concat(other); + * }, []); + * // => [4, 5, 2, 3, 0, 1] + */ + function reduceRight(collection, iteratee, accumulator) { + var func = isArray(collection) ? arrayReduceRight : baseReduce, + initAccum = arguments.length < 3; + + return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight); + } + + /** + * The opposite of `_.filter`; this method returns the elements of `collection` + * that `predicate` does **not** return truthy for. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.filter + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': true } + * ]; + * + * _.reject(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.reject(users, { 'age': 40, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.reject(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.reject(users, 'active'); + * // => objects for ['barney'] + */ + function reject(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, negate(getIteratee(predicate, 3))); + } + + /** + * Gets a random element from `collection`. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Collection + * @param {Array|Object} collection The collection to sample. + * @returns {*} Returns the random element. + * @example + * + * _.sample([1, 2, 3, 4]); + * // => 2 + */ + function sample(collection) { + var func = isArray(collection) ? arraySample : baseSample; + return func(collection); + } + + /** + * Gets `n` random elements at unique keys from `collection` up to the + * size of `collection`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to sample. + * @param {number} [n=1] The number of elements to sample. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the random elements. + * @example + * + * _.sampleSize([1, 2, 3], 2); + * // => [3, 1] + * + * _.sampleSize([1, 2, 3], 4); + * // => [2, 3, 1] + */ + function sampleSize(collection, n, guard) { + if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) { + n = 1; + } else { + n = toInteger(n); + } + var func = isArray(collection) ? arraySampleSize : baseSampleSize; + return func(collection, n); + } + + /** + * Creates an array of shuffled values, using a version of the + * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to shuffle. + * @returns {Array} Returns the new shuffled array. + * @example + * + * _.shuffle([1, 2, 3, 4]); + * // => [4, 1, 3, 2] + */ + function shuffle(collection) { + var func = isArray(collection) ? arrayShuffle : baseShuffle; + return func(collection); + } + + /** + * Gets the size of `collection` by returning its length for array-like + * values or the number of own enumerable string keyed properties for objects. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @returns {number} Returns the collection size. + * @example + * + * _.size([1, 2, 3]); + * // => 3 + * + * _.size({ 'a': 1, 'b': 2 }); + * // => 2 + * + * _.size('pebbles'); + * // => 7 + */ + function size(collection) { + if (collection == null) { + return 0; + } + if (isArrayLike(collection)) { + return isString(collection) ? stringSize(collection) : collection.length; + } + var tag = getTag(collection); + if (tag == mapTag || tag == setTag) { + return collection.size; + } + return baseKeys(collection).length; + } + + /** + * Checks if `predicate` returns truthy for **any** element of `collection`. + * Iteration is stopped once `predicate` returns truthy. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + * @example + * + * _.some([null, 0, 'yes', false], Boolean); + * // => true + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.some(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.some(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.some(users, 'active'); + * // => true + */ + function some(collection, predicate, guard) { + var func = isArray(collection) ? arraySome : baseSome; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; + } + return func(collection, getIteratee(predicate, 3)); + } + + /** + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection thru each iteratee. This method + * performs a stable sort, that is, it preserves the original sort order of + * equal elements. The iteratees are invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {...(Function|Function[])} [iteratees=[_.identity]] + * The iteratees to sort by. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'barney', 'age': 34 } + * ]; + * + * _.sortBy(users, [function(o) { return o.user; }]); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + * + * _.sortBy(users, ['user', 'age']); + * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] + */ + var sortBy = baseRest(function(collection, iteratees) { + if (collection == null) { + return []; + } + var length = iteratees.length; + if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { + iteratees = []; + } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { + iteratees = [iteratees[0]]; + } + return baseOrderBy(collection, baseFlatten(iteratees, 1), []); + }); + + /*------------------------------------------------------------------------*/ + + /** + * Gets the timestamp of the number of milliseconds that have elapsed since + * the Unix epoch (1 January 1970 00:00:00 UTC). + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Date + * @returns {number} Returns the timestamp. + * @example + * + * _.defer(function(stamp) { + * console.log(_.now() - stamp); + * }, _.now()); + * // => Logs the number of milliseconds it took for the deferred invocation. + */ + var now = ctxNow || function() { + return root.Date.now(); + }; + + /*------------------------------------------------------------------------*/ + + /** + * The opposite of `_.before`; this method creates a function that invokes + * `func` once it's called `n` or more times. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {number} n The number of calls before `func` is invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var saves = ['profile', 'settings']; + * + * var done = _.after(saves.length, function() { + * console.log('done saving!'); + * }); + * + * _.forEach(saves, function(type) { + * asyncSave({ 'type': type, 'complete': done }); + * }); + * // => Logs 'done saving!' after the two async saves have completed. + */ + function after(n, func) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n < 1) { + return func.apply(this, arguments); + } + }; + } + + /** + * Creates a function that invokes `func`, with up to `n` arguments, + * ignoring any additional arguments. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to cap arguments for. + * @param {number} [n=func.length] The arity cap. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new capped function. + * @example + * + * _.map(['6', '8', '10'], _.ary(parseInt, 1)); + * // => [6, 8, 10] + */ + function ary(func, n, guard) { + n = guard ? undefined : n; + n = (func && n == null) ? func.length : n; + return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n); + } + + /** + * Creates a function that invokes `func`, with the `this` binding and arguments + * of the created function, while it's called less than `n` times. Subsequent + * calls to the created function return the result of the last `func` invocation. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {number} n The number of calls at which `func` is no longer invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * jQuery(element).on('click', _.before(5, addContactToList)); + * // => Allows adding up to 4 contacts to the list. + */ + function before(n, func) { + var result; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n > 0) { + result = func.apply(this, arguments); + } + if (n <= 1) { + func = undefined; + } + return result; + }; + } + + /** + * Creates a function that invokes `func` with the `this` binding of `thisArg` + * and `partials` prepended to the arguments it receives. + * + * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for partially applied arguments. + * + * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" + * property of bound functions. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to bind. + * @param {*} thisArg The `this` binding of `func`. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * function greet(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * } + * + * var object = { 'user': 'fred' }; + * + * var bound = _.bind(greet, object, 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * // Bound with placeholders. + * var bound = _.bind(greet, object, _, '!'); + * bound('hi'); + * // => 'hi fred!' + */ + var bind = baseRest(function(func, thisArg, partials) { + var bitmask = WRAP_BIND_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, getHolder(bind)); + bitmask |= WRAP_PARTIAL_FLAG; + } + return createWrap(func, bitmask, thisArg, partials, holders); + }); + + /** + * Creates a function that invokes the method at `object[key]` with `partials` + * prepended to the arguments it receives. + * + * This method differs from `_.bind` by allowing bound functions to reference + * methods that may be redefined or don't yet exist. See + * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) + * for more details. + * + * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Function + * @param {Object} object The object to invoke the method on. + * @param {string} key The key of the method. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * var object = { + * 'user': 'fred', + * 'greet': function(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * } + * }; + * + * var bound = _.bindKey(object, 'greet', 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * object.greet = function(greeting, punctuation) { + * return greeting + 'ya ' + this.user + punctuation; + * }; + * + * bound('!'); + * // => 'hiya fred!' + * + * // Bound with placeholders. + * var bound = _.bindKey(object, 'greet', _, '!'); + * bound('hi'); + * // => 'hiya fred!' + */ + var bindKey = baseRest(function(object, key, partials) { + var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, getHolder(bindKey)); + bitmask |= WRAP_PARTIAL_FLAG; + } + return createWrap(key, bitmask, object, partials, holders); + }); + + /** + * Creates a function that accepts arguments of `func` and either invokes + * `func` returning its result, if at least `arity` number of arguments have + * been provided, or returns a function that accepts the remaining `func` + * arguments, and so on. The arity of `func` may be specified if `func.length` + * is not sufficient. + * + * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for provided arguments. + * + * **Note:** This method doesn't set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curry(abc); + * + * curried(1)(2)(3); + * // => [1, 2, 3] + * + * curried(1, 2)(3); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // Curried with placeholders. + * curried(1)(_, 3)(2); + * // => [1, 2, 3] + */ + function curry(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curry.placeholder; + return result; + } + + /** + * This method is like `_.curry` except that arguments are applied to `func` + * in the manner of `_.partialRight` instead of `_.partial`. + * + * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for provided arguments. + * + * **Note:** This method doesn't set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curryRight(abc); + * + * curried(3)(2)(1); + * // => [1, 2, 3] + * + * curried(2, 3)(1); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // Curried with placeholders. + * curried(3)(1, _)(2); + * // => [1, 2, 3] + */ + function curryRight(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curryRight.placeholder; + return result; + } + + /** + * Creates a debounced function that delays invoking `func` until after `wait` + * milliseconds have elapsed since the last time the debounced function was + * invoked. The debounced function comes with a `cancel` method to cancel + * delayed `func` invocations and a `flush` method to immediately invoke them. + * Provide `options` to indicate whether `func` should be invoked on the + * leading and/or trailing edge of the `wait` timeout. The `func` is invoked + * with the last arguments provided to the debounced function. Subsequent + * calls to the debounced function return the result of the last `func` + * invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the debounced function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.debounce` and `_.throttle`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to debounce. + * @param {number} [wait=0] The number of milliseconds to delay. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=false] + * Specify invoking on the leading edge of the timeout. + * @param {number} [options.maxWait] + * The maximum time `func` is allowed to be delayed before it's invoked. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new debounced function. + * @example + * + * // Avoid costly calculations while the window size is in flux. + * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); + * + * // Invoke `sendMail` when clicked, debouncing subsequent calls. + * jQuery(element).on('click', _.debounce(sendMail, 300, { + * 'leading': true, + * 'trailing': false + * })); + * + * // Ensure `batchLog` is invoked once after 1 second of debounced calls. + * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); + * var source = new EventSource('/stream'); + * jQuery(source).on('message', debounced); + * + * // Cancel the trailing debounced invocation. + * jQuery(window).on('popstate', debounced.cancel); + */ + function debounce(func, wait, options) { + var lastArgs, + lastThis, + maxWait, + result, + timerId, + lastCallTime, + lastInvokeTime = 0, + leading = false, + maxing = false, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + wait = toNumber(wait) || 0; + if (isObject(options)) { + leading = !!options.leading; + maxing = 'maxWait' in options; + maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + + function invokeFunc(time) { + var args = lastArgs, + thisArg = lastThis; + + lastArgs = lastThis = undefined; + lastInvokeTime = time; + result = func.apply(thisArg, args); + return result; + } + + function leadingEdge(time) { + // Reset any `maxWait` timer. + lastInvokeTime = time; + // Start the timer for the trailing edge. + timerId = setTimeout(timerExpired, wait); + // Invoke the leading edge. + return leading ? invokeFunc(time) : result; + } + + function remainingWait(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime, + timeWaiting = wait - timeSinceLastCall; + + return maxing + ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) + : timeWaiting; + } + + function shouldInvoke(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime; + + // Either this is the first call, activity has stopped and we're at the + // trailing edge, the system time has gone backwards and we're treating + // it as the trailing edge, or we've hit the `maxWait` limit. + return (lastCallTime === undefined || (timeSinceLastCall >= wait) || + (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); + } + + function timerExpired() { + var time = now(); + if (shouldInvoke(time)) { + return trailingEdge(time); + } + // Restart the timer. + timerId = setTimeout(timerExpired, remainingWait(time)); + } + + function trailingEdge(time) { + timerId = undefined; + + // Only invoke if we have `lastArgs` which means `func` has been + // debounced at least once. + if (trailing && lastArgs) { + return invokeFunc(time); + } + lastArgs = lastThis = undefined; + return result; + } + + function cancel() { + if (timerId !== undefined) { + clearTimeout(timerId); + } + lastInvokeTime = 0; + lastArgs = lastCallTime = lastThis = timerId = undefined; + } + + function flush() { + return timerId === undefined ? result : trailingEdge(now()); + } + + function debounced() { + var time = now(), + isInvoking = shouldInvoke(time); + + lastArgs = arguments; + lastThis = this; + lastCallTime = time; + + if (isInvoking) { + if (timerId === undefined) { + return leadingEdge(lastCallTime); + } + if (maxing) { + // Handle invocations in a tight loop. + timerId = setTimeout(timerExpired, wait); + return invokeFunc(lastCallTime); + } + } + if (timerId === undefined) { + timerId = setTimeout(timerExpired, wait); + } + return result; + } + debounced.cancel = cancel; + debounced.flush = flush; + return debounced; + } + + /** + * Defers invoking the `func` until the current call stack has cleared. Any + * additional arguments are provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to defer. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.defer(function(text) { + * console.log(text); + * }, 'deferred'); + * // => Logs 'deferred' after one millisecond. + */ + var defer = baseRest(function(func, args) { + return baseDelay(func, 1, args); + }); + + /** + * Invokes `func` after `wait` milliseconds. Any additional arguments are + * provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.delay(function(text) { + * console.log(text); + * }, 1000, 'later'); + * // => Logs 'later' after one second. + */ + var delay = baseRest(function(func, wait, args) { + return baseDelay(func, toNumber(wait) || 0, args); + }); + + /** + * Creates a function that invokes `func` with arguments reversed. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to flip arguments for. + * @returns {Function} Returns the new flipped function. + * @example + * + * var flipped = _.flip(function() { + * return _.toArray(arguments); + * }); + * + * flipped('a', 'b', 'c', 'd'); + * // => ['d', 'c', 'b', 'a'] + */ + function flip(func) { + return createWrap(func, WRAP_FLIP_FLAG); + } + + /** + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided, it determines the cache key for storing the result based on the + * arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is used as the map cache key. The `func` + * is invoked with the `this` binding of the memoized function. + * + * **Note:** The cache is exposed as the `cache` property on the memoized + * function. Its creation may be customized by replacing the `_.memoize.Cache` + * constructor with one whose instances implement the + * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) + * method interface of `clear`, `delete`, `get`, `has`, and `set`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] The function to resolve the cache key. + * @returns {Function} Returns the new memoized function. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * var other = { 'c': 3, 'd': 4 }; + * + * var values = _.memoize(_.values); + * values(object); + * // => [1, 2] + * + * values(other); + * // => [3, 4] + * + * object.a = 2; + * values(object); + * // => [1, 2] + * + * // Modify the result cache. + * values.cache.set(object, ['a', 'b']); + * values(object); + * // => ['a', 'b'] + * + * // Replace `_.memoize.Cache`. + * _.memoize.Cache = WeakMap; + */ + function memoize(func, resolver) { + if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { + throw new TypeError(FUNC_ERROR_TEXT); + } + var memoized = function() { + var args = arguments, + key = resolver ? resolver.apply(this, args) : args[0], + cache = memoized.cache; + + if (cache.has(key)) { + return cache.get(key); + } + var result = func.apply(this, args); + memoized.cache = cache.set(key, result) || cache; + return result; + }; + memoized.cache = new (memoize.Cache || MapCache); + return memoized; + } + + // Expose `MapCache`. + memoize.Cache = MapCache; + + /** + * Creates a function that negates the result of the predicate `func`. The + * `func` predicate is invoked with the `this` binding and arguments of the + * created function. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} predicate The predicate to negate. + * @returns {Function} Returns the new negated function. + * @example + * + * function isEven(n) { + * return n % 2 == 0; + * } + * + * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); + * // => [1, 3, 5] + */ + function negate(predicate) { + if (typeof predicate != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return function() { + var args = arguments; + switch (args.length) { + case 0: return !predicate.call(this); + case 1: return !predicate.call(this, args[0]); + case 2: return !predicate.call(this, args[0], args[1]); + case 3: return !predicate.call(this, args[0], args[1], args[2]); + } + return !predicate.apply(this, args); + }; + } + + /** + * Creates a function that is restricted to invoking `func` once. Repeat calls + * to the function return the value of the first invocation. The `func` is + * invoked with the `this` binding and arguments of the created function. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var initialize = _.once(createApplication); + * initialize(); + * initialize(); + * // => `createApplication` is invoked once + */ + function once(func) { + return before(2, func); + } + + /** + * Creates a function that invokes `func` with its arguments transformed. + * + * @static + * @since 4.0.0 + * @memberOf _ + * @category Function + * @param {Function} func The function to wrap. + * @param {...(Function|Function[])} [transforms=[_.identity]] + * The argument transforms. + * @returns {Function} Returns the new function. + * @example + * + * function doubled(n) { + * return n * 2; + * } + * + * function square(n) { + * return n * n; + * } + * + * var func = _.overArgs(function(x, y) { + * return [x, y]; + * }, [square, doubled]); + * + * func(9, 3); + * // => [81, 6] + * + * func(10, 5); + * // => [100, 10] + */ + var overArgs = castRest(function(func, transforms) { + transforms = (transforms.length == 1 && isArray(transforms[0])) + ? arrayMap(transforms[0], baseUnary(getIteratee())) + : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee())); + + var funcsLength = transforms.length; + return baseRest(function(args) { + var index = -1, + length = nativeMin(args.length, funcsLength); + + while (++index < length) { + args[index] = transforms[index].call(this, args[index]); + } + return apply(func, this, args); + }); + }); + + /** + * Creates a function that invokes `func` with `partials` prepended to the + * arguments it receives. This method is like `_.bind` except it does **not** + * alter the `this` binding. + * + * The `_.partial.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * **Note:** This method doesn't set the "length" property of partially + * applied functions. + * + * @static + * @memberOf _ + * @since 0.2.0 + * @category Function + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * function greet(greeting, name) { + * return greeting + ' ' + name; + * } + * + * var sayHelloTo = _.partial(greet, 'hello'); + * sayHelloTo('fred'); + * // => 'hello fred' + * + * // Partially applied with placeholders. + * var greetFred = _.partial(greet, _, 'fred'); + * greetFred('hi'); + * // => 'hi fred' + */ + var partial = baseRest(function(func, partials) { + var holders = replaceHolders(partials, getHolder(partial)); + return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders); + }); + + /** + * This method is like `_.partial` except that partially applied arguments + * are appended to the arguments it receives. + * + * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * **Note:** This method doesn't set the "length" property of partially + * applied functions. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Function + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * function greet(greeting, name) { + * return greeting + ' ' + name; + * } + * + * var greetFred = _.partialRight(greet, 'fred'); + * greetFred('hi'); + * // => 'hi fred' + * + * // Partially applied with placeholders. + * var sayHelloTo = _.partialRight(greet, 'hello', _); + * sayHelloTo('fred'); + * // => 'hello fred' + */ + var partialRight = baseRest(function(func, partials) { + var holders = replaceHolders(partials, getHolder(partialRight)); + return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders); + }); + + /** + * Creates a function that invokes `func` with arguments arranged according + * to the specified `indexes` where the argument value at the first index is + * provided as the first argument, the argument value at the second index is + * provided as the second argument, and so on. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to rearrange arguments for. + * @param {...(number|number[])} indexes The arranged argument indexes. + * @returns {Function} Returns the new function. + * @example + * + * var rearged = _.rearg(function(a, b, c) { + * return [a, b, c]; + * }, [2, 0, 1]); + * + * rearged('b', 'c', 'a') + * // => ['a', 'b', 'c'] + */ + var rearg = flatRest(function(func, indexes) { + return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes); + }); + + /** + * Creates a function that invokes `func` with the `this` binding of the + * created function and arguments from `start` and beyond provided as + * an array. + * + * **Note:** This method is based on the + * [rest parameter](https://mdn.io/rest_parameters). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + * @example + * + * var say = _.rest(function(what, names) { + * return what + ' ' + _.initial(names).join(', ') + + * (_.size(names) > 1 ? ', & ' : '') + _.last(names); + * }); + * + * say('hello', 'fred', 'barney', 'pebbles'); + * // => 'hello fred, barney, & pebbles' + */ + function rest(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + start = start === undefined ? start : toInteger(start); + return baseRest(func, start); + } + + /** + * Creates a function that invokes `func` with the `this` binding of the + * create function and an array of arguments much like + * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply). + * + * **Note:** This method is based on the + * [spread operator](https://mdn.io/spread_operator). + * + * @static + * @memberOf _ + * @since 3.2.0 + * @category Function + * @param {Function} func The function to spread arguments over. + * @param {number} [start=0] The start position of the spread. + * @returns {Function} Returns the new function. + * @example + * + * var say = _.spread(function(who, what) { + * return who + ' says ' + what; + * }); + * + * say(['fred', 'hello']); + * // => 'fred says hello' + * + * var numbers = Promise.all([ + * Promise.resolve(40), + * Promise.resolve(36) + * ]); + * + * numbers.then(_.spread(function(x, y) { + * return x + y; + * })); + * // => a Promise of 76 + */ + function spread(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + start = start == null ? 0 : nativeMax(toInteger(start), 0); + return baseRest(function(args) { + var array = args[start], + otherArgs = castSlice(args, 0, start); + + if (array) { + arrayPush(otherArgs, array); + } + return apply(func, this, otherArgs); + }); + } + + /** + * Creates a throttled function that only invokes `func` at most once per + * every `wait` milliseconds. The throttled function comes with a `cancel` + * method to cancel delayed `func` invocations and a `flush` method to + * immediately invoke them. Provide `options` to indicate whether `func` + * should be invoked on the leading and/or trailing edge of the `wait` + * timeout. The `func` is invoked with the last arguments provided to the + * throttled function. Subsequent calls to the throttled function return the + * result of the last `func` invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the throttled function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.throttle` and `_.debounce`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to throttle. + * @param {number} [wait=0] The number of milliseconds to throttle invocations to. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=true] + * Specify invoking on the leading edge of the timeout. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new throttled function. + * @example + * + * // Avoid excessively updating the position while scrolling. + * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); + * + * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. + * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); + * jQuery(element).on('click', throttled); + * + * // Cancel the trailing throttled invocation. + * jQuery(window).on('popstate', throttled.cancel); + */ + function throttle(func, wait, options) { + var leading = true, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + if (isObject(options)) { + leading = 'leading' in options ? !!options.leading : leading; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + return debounce(func, wait, { + 'leading': leading, + 'maxWait': wait, + 'trailing': trailing + }); + } + + /** + * Creates a function that accepts up to one argument, ignoring any + * additional arguments. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + * @example + * + * _.map(['6', '8', '10'], _.unary(parseInt)); + * // => [6, 8, 10] + */ + function unary(func) { + return ary(func, 1); + } + + /** + * Creates a function that provides `value` to `wrapper` as its first + * argument. Any additional arguments provided to the function are appended + * to those provided to the `wrapper`. The wrapper is invoked with the `this` + * binding of the created function. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {*} value The value to wrap. + * @param {Function} [wrapper=identity] The wrapper function. + * @returns {Function} Returns the new function. + * @example + * + * var p = _.wrap(_.escape, function(func, text) { + * return '

' + func(text) + '

'; + * }); + * + * p('fred, barney, & pebbles'); + * // => '

fred, barney, & pebbles

' + */ + function wrap(value, wrapper) { + return partial(castFunction(wrapper), value); + } + + /*------------------------------------------------------------------------*/ + + /** + * Casts `value` as an array if it's not one. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Lang + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast array. + * @example + * + * _.castArray(1); + * // => [1] + * + * _.castArray({ 'a': 1 }); + * // => [{ 'a': 1 }] + * + * _.castArray('abc'); + * // => ['abc'] + * + * _.castArray(null); + * // => [null] + * + * _.castArray(undefined); + * // => [undefined] + * + * _.castArray(); + * // => [] + * + * var array = [1, 2, 3]; + * console.log(_.castArray(array) === array); + * // => true + */ + function castArray() { + if (!arguments.length) { + return []; + } + var value = arguments[0]; + return isArray(value) ? value : [value]; + } + + /** + * Creates a shallow clone of `value`. + * + * **Note:** This method is loosely based on the + * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) + * and supports cloning arrays, array buffers, booleans, date objects, maps, + * numbers, `Object` objects, regexes, sets, strings, symbols, and typed + * arrays. The own enumerable properties of `arguments` objects are cloned + * as plain objects. An empty object is returned for uncloneable values such + * as error objects, functions, DOM nodes, and WeakMaps. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to clone. + * @returns {*} Returns the cloned value. + * @see _.cloneDeep + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var shallow = _.clone(objects); + * console.log(shallow[0] === objects[0]); + * // => true + */ + function clone(value) { + return baseClone(value, CLONE_SYMBOLS_FLAG); + } + + /** + * This method is like `_.clone` except that it accepts `customizer` which + * is invoked to produce the cloned value. If `customizer` returns `undefined`, + * cloning is handled by the method instead. The `customizer` is invoked with + * up to four arguments; (value [, index|key, object, stack]). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to clone. + * @param {Function} [customizer] The function to customize cloning. + * @returns {*} Returns the cloned value. + * @see _.cloneDeepWith + * @example + * + * function customizer(value) { + * if (_.isElement(value)) { + * return value.cloneNode(false); + * } + * } + * + * var el = _.cloneWith(document.body, customizer); + * + * console.log(el === document.body); + * // => false + * console.log(el.nodeName); + * // => 'BODY' + * console.log(el.childNodes.length); + * // => 0 + */ + function cloneWith(value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); + } + + /** + * This method is like `_.clone` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @returns {*} Returns the deep cloned value. + * @see _.clone + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var deep = _.cloneDeep(objects); + * console.log(deep[0] === objects[0]); + * // => false + */ + function cloneDeep(value) { + return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); + } + + /** + * This method is like `_.cloneWith` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @param {Function} [customizer] The function to customize cloning. + * @returns {*} Returns the deep cloned value. + * @see _.cloneWith + * @example + * + * function customizer(value) { + * if (_.isElement(value)) { + * return value.cloneNode(true); + * } + * } + * + * var el = _.cloneDeepWith(document.body, customizer); + * + * console.log(el === document.body); + * // => false + * console.log(el.nodeName); + * // => 'BODY' + * console.log(el.childNodes.length); + * // => 20 + */ + function cloneDeepWith(value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); + } + + /** + * Checks if `object` conforms to `source` by invoking the predicate + * properties of `source` with the corresponding property values of `object`. + * + * **Note:** This method is equivalent to `_.conforms` when `source` is + * partially applied. + * + * @static + * @memberOf _ + * @since 4.14.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property predicates to conform to. + * @returns {boolean} Returns `true` if `object` conforms, else `false`. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * + * _.conformsTo(object, { 'b': function(n) { return n > 1; } }); + * // => true + * + * _.conformsTo(object, { 'b': function(n) { return n > 2; } }); + * // => false + */ + function conformsTo(object, source) { + return source == null || baseConformsTo(object, source, keys(source)); + } + + /** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ + function eq(value, other) { + return value === other || (value !== value && other !== other); + } + + /** + * Checks if `value` is greater than `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + * @see _.lt + * @example + * + * _.gt(3, 1); + * // => true + * + * _.gt(3, 3); + * // => false + * + * _.gt(1, 3); + * // => false + */ + var gt = createRelationalOperation(baseGt); + + /** + * Checks if `value` is greater than or equal to `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than or equal to + * `other`, else `false`. + * @see _.lte + * @example + * + * _.gte(3, 1); + * // => true + * + * _.gte(3, 3); + * // => true + * + * _.gte(1, 3); + * // => false + */ + var gte = createRelationalOperation(function(value, other) { + return value >= other; + }); + + /** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); + }; + + /** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ + var isArray = Array.isArray; + + /** + * Checks if `value` is classified as an `ArrayBuffer` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. + * @example + * + * _.isArrayBuffer(new ArrayBuffer(2)); + * // => true + * + * _.isArrayBuffer(new Array(2)); + * // => false + */ + var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; + + /** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ + function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); + } + + /** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ + function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); + } + + /** + * Checks if `value` is classified as a boolean primitive or object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. + * @example + * + * _.isBoolean(false); + * // => true + * + * _.isBoolean(null); + * // => false + */ + function isBoolean(value) { + return value === true || value === false || + (isObjectLike(value) && baseGetTag(value) == boolTag); + } + + /** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ + var isBuffer = nativeIsBuffer || stubFalse; + + /** + * Checks if `value` is classified as a `Date` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + * @example + * + * _.isDate(new Date); + * // => true + * + * _.isDate('Mon April 23 2012'); + * // => false + */ + var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; + + /** + * Checks if `value` is likely a DOM element. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. + * @example + * + * _.isElement(document.body); + * // => true + * + * _.isElement(''); + * // => false + */ + function isElement(value) { + return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value); + } + + /** + * Checks if `value` is an empty object, collection, map, or set. + * + * Objects are considered empty if they have no own enumerable string keyed + * properties. + * + * Array-like values such as `arguments` objects, arrays, buffers, strings, or + * jQuery-like collections are considered empty if they have a `length` of `0`. + * Similarly, maps and sets are considered empty if they have a `size` of `0`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is empty, else `false`. + * @example + * + * _.isEmpty(null); + * // => true + * + * _.isEmpty(true); + * // => true + * + * _.isEmpty(1); + * // => true + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({ 'a': 1 }); + * // => false + */ + function isEmpty(value) { + if (value == null) { + return true; + } + if (isArrayLike(value) && + (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || + isBuffer(value) || isTypedArray(value) || isArguments(value))) { + return !value.length; + } + var tag = getTag(value); + if (tag == mapTag || tag == setTag) { + return !value.size; + } + if (isPrototype(value)) { + return !baseKeys(value).length; + } + for (var key in value) { + if (hasOwnProperty.call(value, key)) { + return false; + } + } + return true; + } + + /** + * Performs a deep comparison between two values to determine if they are + * equivalent. + * + * **Note:** This method supports comparing arrays, array buffers, booleans, + * date objects, error objects, maps, numbers, `Object` objects, regexes, + * sets, strings, symbols, and typed arrays. `Object` objects are compared + * by their own, not inherited, enumerable properties. Functions and DOM + * nodes are compared by strict equality, i.e. `===`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.isEqual(object, other); + * // => true + * + * object === other; + * // => false + */ + function isEqual(value, other) { + return baseIsEqual(value, other); + } + + /** + * This method is like `_.isEqual` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined`, comparisons + * are handled by the method instead. The `customizer` is invoked with up to + * six arguments: (objValue, othValue [, index|key, object, other, stack]). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, othValue) { + * if (isGreeting(objValue) && isGreeting(othValue)) { + * return true; + * } + * } + * + * var array = ['hello', 'goodbye']; + * var other = ['hi', 'goodbye']; + * + * _.isEqualWith(array, other, customizer); + * // => true + */ + function isEqualWith(value, other, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + var result = customizer ? customizer(value, other) : undefined; + return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result; + } + + /** + * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, + * `SyntaxError`, `TypeError`, or `URIError` object. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an error object, else `false`. + * @example + * + * _.isError(new Error); + * // => true + * + * _.isError(Error); + * // => false + */ + function isError(value) { + if (!isObjectLike(value)) { + return false; + } + var tag = baseGetTag(value); + return tag == errorTag || tag == domExcTag || + (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value)); + } + + /** + * Checks if `value` is a finite primitive number. + * + * **Note:** This method is based on + * [`Number.isFinite`](https://mdn.io/Number/isFinite). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. + * @example + * + * _.isFinite(3); + * // => true + * + * _.isFinite(Number.MIN_VALUE); + * // => true + * + * _.isFinite(Infinity); + * // => false + * + * _.isFinite('3'); + * // => false + */ + function isFinite(value) { + return typeof value == 'number' && nativeIsFinite(value); + } + + /** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ + function isFunction(value) { + if (!isObject(value)) { + return false; + } + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; + } + + /** + * Checks if `value` is an integer. + * + * **Note:** This method is based on + * [`Number.isInteger`](https://mdn.io/Number/isInteger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an integer, else `false`. + * @example + * + * _.isInteger(3); + * // => true + * + * _.isInteger(Number.MIN_VALUE); + * // => false + * + * _.isInteger(Infinity); + * // => false + * + * _.isInteger('3'); + * // => false + */ + function isInteger(value) { + return typeof value == 'number' && value == toInteger(value); + } + + /** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ + function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + + /** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ + function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); + } + + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + function isObjectLike(value) { + return value != null && typeof value == 'object'; + } + + /** + * Checks if `value` is classified as a `Map` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + * @example + * + * _.isMap(new Map); + * // => true + * + * _.isMap(new WeakMap); + * // => false + */ + var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; + + /** + * Performs a partial deep comparison between `object` and `source` to + * determine if `object` contains equivalent property values. + * + * **Note:** This method is equivalent to `_.matches` when `source` is + * partially applied. + * + * Partial comparisons will match empty array and empty object `source` + * values against any array or object value, respectively. See `_.isEqual` + * for a list of supported value comparisons. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * + * _.isMatch(object, { 'b': 2 }); + * // => true + * + * _.isMatch(object, { 'b': 1 }); + * // => false + */ + function isMatch(object, source) { + return object === source || baseIsMatch(object, source, getMatchData(source)); + } + + /** + * This method is like `_.isMatch` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined`, comparisons + * are handled by the method instead. The `customizer` is invoked with five + * arguments: (objValue, srcValue, index|key, object, source). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, srcValue) { + * if (isGreeting(objValue) && isGreeting(srcValue)) { + * return true; + * } + * } + * + * var object = { 'greeting': 'hello' }; + * var source = { 'greeting': 'hi' }; + * + * _.isMatchWith(object, source, customizer); + * // => true + */ + function isMatchWith(object, source, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseIsMatch(object, source, getMatchData(source), customizer); + } + + /** + * Checks if `value` is `NaN`. + * + * **Note:** This method is based on + * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as + * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for + * `undefined` and other non-number values. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + * @example + * + * _.isNaN(NaN); + * // => true + * + * _.isNaN(new Number(NaN)); + * // => true + * + * isNaN(undefined); + * // => true + * + * _.isNaN(undefined); + * // => false + */ + function isNaN(value) { + // An `NaN` primitive is the only value that is not equal to itself. + // Perform the `toStringTag` check first to avoid errors with some + // ActiveX objects in IE. + return isNumber(value) && value != +value; + } + + /** + * Checks if `value` is a pristine native function. + * + * **Note:** This method can't reliably detect native functions in the presence + * of the core-js package because core-js circumvents this kind of detection. + * Despite multiple requests, the core-js maintainer has made it clear: any + * attempt to fix the detection will be obstructed. As a result, we're left + * with little choice but to throw an error. Unfortunately, this also affects + * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), + * which rely on core-js. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + * @example + * + * _.isNative(Array.prototype.push); + * // => true + * + * _.isNative(_); + * // => false + */ + function isNative(value) { + if (isMaskable(value)) { + throw new Error(CORE_ERROR_TEXT); + } + return baseIsNative(value); + } + + /** + * Checks if `value` is `null`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `null`, else `false`. + * @example + * + * _.isNull(null); + * // => true + * + * _.isNull(void 0); + * // => false + */ + function isNull(value) { + return value === null; + } + + /** + * Checks if `value` is `null` or `undefined`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is nullish, else `false`. + * @example + * + * _.isNil(null); + * // => true + * + * _.isNil(void 0); + * // => true + * + * _.isNil(NaN); + * // => false + */ + function isNil(value) { + return value == null; + } + + /** + * Checks if `value` is classified as a `Number` primitive or object. + * + * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are + * classified as numbers, use the `_.isFinite` method. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a number, else `false`. + * @example + * + * _.isNumber(3); + * // => true + * + * _.isNumber(Number.MIN_VALUE); + * // => true + * + * _.isNumber(Infinity); + * // => true + * + * _.isNumber('3'); + * // => false + */ + function isNumber(value) { + return typeof value == 'number' || + (isObjectLike(value) && baseGetTag(value) == numberTag); + } + + /** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ + function isPlainObject(value) { + if (!isObjectLike(value) || baseGetTag(value) != objectTag) { + return false; + } + var proto = getPrototype(value); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; + return typeof Ctor == 'function' && Ctor instanceof Ctor && + funcToString.call(Ctor) == objectCtorString; + } + + /** + * Checks if `value` is classified as a `RegExp` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + * @example + * + * _.isRegExp(/abc/); + * // => true + * + * _.isRegExp('/abc/'); + * // => false + */ + var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; + + /** + * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 + * double precision number which isn't the result of a rounded unsafe integer. + * + * **Note:** This method is based on + * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. + * @example + * + * _.isSafeInteger(3); + * // => true + * + * _.isSafeInteger(Number.MIN_VALUE); + * // => false + * + * _.isSafeInteger(Infinity); + * // => false + * + * _.isSafeInteger('3'); + * // => false + */ + function isSafeInteger(value) { + return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; + } + + /** + * Checks if `value` is classified as a `Set` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + * @example + * + * _.isSet(new Set); + * // => true + * + * _.isSet(new WeakSet); + * // => false + */ + var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; + + /** + * Checks if `value` is classified as a `String` primitive or object. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a string, else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false + */ + function isString(value) { + return typeof value == 'string' || + (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); + } + + /** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ + function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && baseGetTag(value) == symbolTag); + } + + /** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ + var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + + /** + * Checks if `value` is `undefined`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. + * @example + * + * _.isUndefined(void 0); + * // => true + * + * _.isUndefined(null); + * // => false + */ + function isUndefined(value) { + return value === undefined; + } + + /** + * Checks if `value` is classified as a `WeakMap` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a weak map, else `false`. + * @example + * + * _.isWeakMap(new WeakMap); + * // => true + * + * _.isWeakMap(new Map); + * // => false + */ + function isWeakMap(value) { + return isObjectLike(value) && getTag(value) == weakMapTag; + } + + /** + * Checks if `value` is classified as a `WeakSet` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a weak set, else `false`. + * @example + * + * _.isWeakSet(new WeakSet); + * // => true + * + * _.isWeakSet(new Set); + * // => false + */ + function isWeakSet(value) { + return isObjectLike(value) && baseGetTag(value) == weakSetTag; + } + + /** + * Checks if `value` is less than `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than `other`, + * else `false`. + * @see _.gt + * @example + * + * _.lt(1, 3); + * // => true + * + * _.lt(3, 3); + * // => false + * + * _.lt(3, 1); + * // => false + */ + var lt = createRelationalOperation(baseLt); + + /** + * Checks if `value` is less than or equal to `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than or equal to + * `other`, else `false`. + * @see _.gte + * @example + * + * _.lte(1, 3); + * // => true + * + * _.lte(3, 3); + * // => true + * + * _.lte(3, 1); + * // => false + */ + var lte = createRelationalOperation(function(value, other) { + return value <= other; + }); + + /** + * Converts `value` to an array. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to convert. + * @returns {Array} Returns the converted array. + * @example + * + * _.toArray({ 'a': 1, 'b': 2 }); + * // => [1, 2] + * + * _.toArray('abc'); + * // => ['a', 'b', 'c'] + * + * _.toArray(1); + * // => [] + * + * _.toArray(null); + * // => [] + */ + function toArray(value) { + if (!value) { + return []; + } + if (isArrayLike(value)) { + return isString(value) ? stringToArray(value) : copyArray(value); + } + if (symIterator && value[symIterator]) { + return iteratorToArray(value[symIterator]()); + } + var tag = getTag(value), + func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values); + + return func(value); + } + + /** + * Converts `value` to a finite number. + * + * @static + * @memberOf _ + * @since 4.12.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted number. + * @example + * + * _.toFinite(3.2); + * // => 3.2 + * + * _.toFinite(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toFinite(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toFinite('3.2'); + * // => 3.2 + */ + function toFinite(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = (value < 0 ? -1 : 1); + return sign * MAX_INTEGER; + } + return value === value ? value : 0; + } + + /** + * Converts `value` to an integer. + * + * **Note:** This method is loosely based on + * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3.2); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3.2'); + * // => 3 + */ + function toInteger(value) { + var result = toFinite(value), + remainder = result % 1; + + return result === result ? (remainder ? result - remainder : result) : 0; + } + + /** + * Converts `value` to an integer suitable for use as the length of an + * array-like object. + * + * **Note:** This method is based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toLength(3.2); + * // => 3 + * + * _.toLength(Number.MIN_VALUE); + * // => 0 + * + * _.toLength(Infinity); + * // => 4294967295 + * + * _.toLength('3.2'); + * // => 3 + */ + function toLength(value) { + return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0; + } + + /** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3.2); + * // => 3.2 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3.2'); + * // => 3.2 + */ + function toNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + if (isObject(value)) { + var other = typeof value.valueOf == 'function' ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ''); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); + } + + /** + * Converts `value` to a plain object flattening inherited enumerable string + * keyed properties of `value` to own properties of the plain object. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {Object} Returns the converted plain object. + * @example + * + * function Foo() { + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.assign({ 'a': 1 }, new Foo); + * // => { 'a': 1, 'b': 2 } + * + * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); + * // => { 'a': 1, 'b': 2, 'c': 3 } + */ + function toPlainObject(value) { + return copyObject(value, keysIn(value)); + } + + /** + * Converts `value` to a safe integer. A safe integer can be compared and + * represented correctly. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toSafeInteger(3.2); + * // => 3 + * + * _.toSafeInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toSafeInteger(Infinity); + * // => 9007199254740991 + * + * _.toSafeInteger('3.2'); + * // => 3 + */ + function toSafeInteger(value) { + return value + ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) + : (value === 0 ? value : 0); + } + + /** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ + function toString(value) { + return value == null ? '' : baseToString(value); + } + + /*------------------------------------------------------------------------*/ + + /** + * Assigns own enumerable string keyed properties of source objects to the + * destination object. Source objects are applied from left to right. + * Subsequent sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object` and is loosely based on + * [`Object.assign`](https://mdn.io/Object/assign). + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assignIn + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assign({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3 } + */ + var assign = createAssigner(function(object, source) { + if (isPrototype(source) || isArrayLike(source)) { + copyObject(source, keys(source), object); + return; + } + for (var key in source) { + if (hasOwnProperty.call(source, key)) { + assignValue(object, key, source[key]); + } + } + }); + + /** + * This method is like `_.assign` except that it iterates over own and + * inherited source properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extend + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assign + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assignIn({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } + */ + var assignIn = createAssigner(function(object, source) { + copyObject(source, keysIn(source), object); + }); + + /** + * This method is like `_.assignIn` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extendWith + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @see _.assignWith + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignInWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObject(source, keysIn(source), object, customizer); + }); + + /** + * This method is like `_.assign` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @see _.assignInWith + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + var assignWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObject(source, keys(source), object, customizer); + }); + + /** + * Creates an array of values corresponding to `paths` of `object`. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Array} Returns the picked values. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; + * + * _.at(object, ['a[0].b.c', 'a[1]']); + * // => [3, 4] + */ + var at = flatRest(baseAt); + + /** + * Creates an object that inherits from the `prototype` object. If a + * `properties` object is given, its own enumerable string keyed properties + * are assigned to the created object. + * + * @static + * @memberOf _ + * @since 2.3.0 + * @category Object + * @param {Object} prototype The object to inherit from. + * @param {Object} [properties] The properties to assign to the object. + * @returns {Object} Returns the new object. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * function Circle() { + * Shape.call(this); + * } + * + * Circle.prototype = _.create(Shape.prototype, { + * 'constructor': Circle + * }); + * + * var circle = new Circle; + * circle instanceof Circle; + * // => true + * + * circle instanceof Shape; + * // => true + */ + function create(prototype, properties) { + var result = baseCreate(prototype); + return properties == null ? result : baseAssign(result, properties); + } + + /** + * Assigns own and inherited enumerable string keyed properties of source + * objects to the destination object for all destination properties that + * resolve to `undefined`. Source objects are applied from left to right. + * Once a property is set, additional values of the same property are ignored. + * + * **Note:** This method mutates `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaultsDeep + * @example + * + * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + var defaults = baseRest(function(object, sources) { + object = Object(object); + + var index = -1; + var length = sources.length; + var guard = length > 2 ? sources[2] : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + length = 1; + } + + while (++index < length) { + var source = sources[index]; + var props = keysIn(source); + var propsIndex = -1; + var propsLength = props.length; + + while (++propsIndex < propsLength) { + var key = props[propsIndex]; + var value = object[key]; + + if (value === undefined || + (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { + object[key] = source[key]; + } + } + } + + return object; + }); + + /** + * This method is like `_.defaults` except that it recursively assigns + * default properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 3.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaults + * @example + * + * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); + * // => { 'a': { 'b': 2, 'c': 3 } } + */ + var defaultsDeep = baseRest(function(args) { + args.push(undefined, customDefaultsMerge); + return apply(mergeWith, undefined, args); + }); + + /** + * This method is like `_.find` except that it returns the key of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Object + * @param {Object} object The object to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {string|undefined} Returns the key of the matched element, + * else `undefined`. + * @example + * + * var users = { + * 'barney': { 'age': 36, 'active': true }, + * 'fred': { 'age': 40, 'active': false }, + * 'pebbles': { 'age': 1, 'active': true } + * }; + * + * _.findKey(users, function(o) { return o.age < 40; }); + * // => 'barney' (iteration order is not guaranteed) + * + * // The `_.matches` iteratee shorthand. + * _.findKey(users, { 'age': 1, 'active': true }); + * // => 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findKey(users, ['active', false]); + * // => 'fred' + * + * // The `_.property` iteratee shorthand. + * _.findKey(users, 'active'); + * // => 'barney' + */ + function findKey(object, predicate) { + return baseFindKey(object, getIteratee(predicate, 3), baseForOwn); + } + + /** + * This method is like `_.findKey` except that it iterates over elements of + * a collection in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {string|undefined} Returns the key of the matched element, + * else `undefined`. + * @example + * + * var users = { + * 'barney': { 'age': 36, 'active': true }, + * 'fred': { 'age': 40, 'active': false }, + * 'pebbles': { 'age': 1, 'active': true } + * }; + * + * _.findLastKey(users, function(o) { return o.age < 40; }); + * // => returns 'pebbles' assuming `_.findKey` returns 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.findLastKey(users, { 'age': 36, 'active': true }); + * // => 'barney' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findLastKey(users, ['active', false]); + * // => 'fred' + * + * // The `_.property` iteratee shorthand. + * _.findLastKey(users, 'active'); + * // => 'pebbles' + */ + function findLastKey(object, predicate) { + return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight); + } + + /** + * Iterates over own and inherited enumerable string keyed properties of an + * object and invokes `iteratee` for each property. The iteratee is invoked + * with three arguments: (value, key, object). Iteratee functions may exit + * iteration early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 0.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forInRight + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forIn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). + */ + function forIn(object, iteratee) { + return object == null + ? object + : baseFor(object, getIteratee(iteratee, 3), keysIn); + } + + /** + * This method is like `_.forIn` except that it iterates over properties of + * `object` in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forIn + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forInRight(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. + */ + function forInRight(object, iteratee) { + return object == null + ? object + : baseForRight(object, getIteratee(iteratee, 3), keysIn); + } + + /** + * Iterates over own enumerable string keyed properties of an object and + * invokes `iteratee` for each property. The iteratee is invoked with three + * arguments: (value, key, object). Iteratee functions may exit iteration + * early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 0.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forOwnRight + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ + function forOwn(object, iteratee) { + return object && baseForOwn(object, getIteratee(iteratee, 3)); + } + + /** + * This method is like `_.forOwn` except that it iterates over properties of + * `object` in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forOwn + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwnRight(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. + */ + function forOwnRight(object, iteratee) { + return object && baseForOwnRight(object, getIteratee(iteratee, 3)); + } + + /** + * Creates an array of function property names from own enumerable properties + * of `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the function names. + * @see _.functionsIn + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functions(new Foo); + * // => ['a', 'b'] + */ + function functions(object) { + return object == null ? [] : baseFunctions(object, keys(object)); + } + + /** + * Creates an array of function property names from own and inherited + * enumerable properties of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the function names. + * @see _.functions + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functionsIn(new Foo); + * // => ['a', 'b', 'c'] + */ + function functionsIn(object) { + return object == null ? [] : baseFunctions(object, keysIn(object)); + } + + /** + * Gets the value at `path` of `object`. If the resolved value is + * `undefined`, the `defaultValue` is returned in its place. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.get(object, 'a[0].b.c'); + * // => 3 + * + * _.get(object, ['a', '0', 'b', 'c']); + * // => 3 + * + * _.get(object, 'a.b.c', 'default'); + * // => 'default' + */ + function get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, path); + return result === undefined ? defaultValue : result; + } + + /** + * Checks if `path` is a direct property of `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = { 'a': { 'b': 2 } }; + * var other = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.has(object, 'a'); + * // => true + * + * _.has(object, 'a.b'); + * // => true + * + * _.has(object, ['a', 'b']); + * // => true + * + * _.has(other, 'a'); + * // => false + */ + function has(object, path) { + return object != null && hasPath(object, path, baseHas); + } + + /** + * Checks if `path` is a direct or inherited property of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.hasIn(object, 'a'); + * // => true + * + * _.hasIn(object, 'a.b'); + * // => true + * + * _.hasIn(object, ['a', 'b']); + * // => true + * + * _.hasIn(object, 'b'); + * // => false + */ + function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); + } + + /** + * Creates an object composed of the inverted keys and values of `object`. + * If `object` contains duplicate values, subsequent values overwrite + * property assignments of previous values. + * + * @static + * @memberOf _ + * @since 0.7.0 + * @category Object + * @param {Object} object The object to invert. + * @returns {Object} Returns the new inverted object. + * @example + * + * var object = { 'a': 1, 'b': 2, 'c': 1 }; + * + * _.invert(object); + * // => { '1': 'c', '2': 'b' } + */ + var invert = createInverter(function(result, value, key) { + if (value != null && + typeof value.toString != 'function') { + value = nativeObjectToString.call(value); + } + + result[value] = key; + }, constant(identity)); + + /** + * This method is like `_.invert` except that the inverted object is generated + * from the results of running each element of `object` thru `iteratee`. The + * corresponding inverted value of each inverted key is an array of keys + * responsible for generating the inverted value. The iteratee is invoked + * with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.1.0 + * @category Object + * @param {Object} object The object to invert. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Object} Returns the new inverted object. + * @example + * + * var object = { 'a': 1, 'b': 2, 'c': 1 }; + * + * _.invertBy(object); + * // => { '1': ['a', 'c'], '2': ['b'] } + * + * _.invertBy(object, function(value) { + * return 'group' + value; + * }); + * // => { 'group1': ['a', 'c'], 'group2': ['b'] } + */ + var invertBy = createInverter(function(result, value, key) { + if (value != null && + typeof value.toString != 'function') { + value = nativeObjectToString.call(value); + } + + if (hasOwnProperty.call(result, value)) { + result[value].push(key); + } else { + result[value] = [key]; + } + }, getIteratee); + + /** + * Invokes the method at `path` of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the method to invoke. + * @param {...*} [args] The arguments to invoke the method with. + * @returns {*} Returns the result of the invoked method. + * @example + * + * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; + * + * _.invoke(object, 'a[0].b.c.slice', 1, 3); + * // => [2, 3] + */ + var invoke = baseRest(baseInvoke); + + /** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ + function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); + } + + /** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ + function keysIn(object) { + return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); + } + + /** + * The opposite of `_.mapValues`; this method creates an object with the + * same values as `object` and keys generated by running each own enumerable + * string keyed property of `object` thru `iteratee`. The iteratee is invoked + * with three arguments: (value, key, object). + * + * @static + * @memberOf _ + * @since 3.8.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns the new mapped object. + * @see _.mapValues + * @example + * + * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { + * return key + value; + * }); + * // => { 'a1': 1, 'b2': 2 } + */ + function mapKeys(object, iteratee) { + var result = {}; + iteratee = getIteratee(iteratee, 3); + + baseForOwn(object, function(value, key, object) { + baseAssignValue(result, iteratee(value, key, object), value); + }); + return result; + } + + /** + * Creates an object with the same keys as `object` and values generated + * by running each own enumerable string keyed property of `object` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, key, object). + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns the new mapped object. + * @see _.mapKeys + * @example + * + * var users = { + * 'fred': { 'user': 'fred', 'age': 40 }, + * 'pebbles': { 'user': 'pebbles', 'age': 1 } + * }; + * + * _.mapValues(users, function(o) { return o.age; }); + * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) + * + * // The `_.property` iteratee shorthand. + * _.mapValues(users, 'age'); + * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) + */ + function mapValues(object, iteratee) { + var result = {}; + iteratee = getIteratee(iteratee, 3); + + baseForOwn(object, function(value, key, object) { + baseAssignValue(result, key, iteratee(value, key, object)); + }); + return result; + } + + /** + * This method is like `_.assign` except that it recursively merges own and + * inherited enumerable string keyed properties of source objects into the + * destination object. Source properties that resolve to `undefined` are + * skipped if a destination value exists. Array and plain object properties + * are merged recursively. Other objects and value types are overridden by + * assignment. Source objects are applied from left to right. Subsequent + * sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * var object = { + * 'a': [{ 'b': 2 }, { 'd': 4 }] + * }; + * + * var other = { + * 'a': [{ 'c': 3 }, { 'e': 5 }] + * }; + * + * _.merge(object, other); + * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } + */ + var merge = createAssigner(function(object, source, srcIndex) { + baseMerge(object, source, srcIndex); + }); + + /** + * This method is like `_.merge` except that it accepts `customizer` which + * is invoked to produce the merged values of the destination and source + * properties. If `customizer` returns `undefined`, merging is handled by the + * method instead. The `customizer` is invoked with six arguments: + * (objValue, srcValue, key, object, source, stack). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} customizer The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * function customizer(objValue, srcValue) { + * if (_.isArray(objValue)) { + * return objValue.concat(srcValue); + * } + * } + * + * var object = { 'a': [1], 'b': [2] }; + * var other = { 'a': [3], 'b': [4] }; + * + * _.mergeWith(object, other, customizer); + * // => { 'a': [1, 3], 'b': [2, 4] } + */ + var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { + baseMerge(object, source, srcIndex, customizer); + }); + + /** + * The opposite of `_.pick`; this method creates an object composed of the + * own and inherited enumerable property paths of `object` that are not omitted. + * + * **Note:** This method is considerably slower than `_.pick`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [paths] The property paths to omit. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.omit(object, ['a', 'c']); + * // => { 'b': '2' } + */ + var omit = flatRest(function(object, paths) { + var result = {}; + if (object == null) { + return result; + } + var isDeep = false; + paths = arrayMap(paths, function(path) { + path = castPath(path, object); + isDeep || (isDeep = path.length > 1); + return path; + }); + copyObject(object, getAllKeysIn(object), result); + if (isDeep) { + result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); + } + var length = paths.length; + while (length--) { + baseUnset(result, paths[length]); + } + return result; + }); + + /** + * The opposite of `_.pickBy`; this method creates an object composed of + * the own and inherited enumerable string keyed properties of `object` that + * `predicate` doesn't return truthy for. The predicate is invoked with two + * arguments: (value, key). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The source object. + * @param {Function} [predicate=_.identity] The function invoked per property. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.omitBy(object, _.isNumber); + * // => { 'b': '2' } + */ + function omitBy(object, predicate) { + return pickBy(object, negate(getIteratee(predicate))); + } + + /** + * Creates an object composed of the picked `object` properties. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pick(object, ['a', 'c']); + * // => { 'a': 1, 'c': 3 } + */ + var pick = flatRest(function(object, paths) { + return object == null ? {} : basePick(object, paths); + }); + + /** + * Creates an object composed of the `object` properties `predicate` returns + * truthy for. The predicate is invoked with two arguments: (value, key). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The source object. + * @param {Function} [predicate=_.identity] The function invoked per property. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pickBy(object, _.isNumber); + * // => { 'a': 1, 'c': 3 } + */ + function pickBy(object, predicate) { + if (object == null) { + return {}; + } + var props = arrayMap(getAllKeysIn(object), function(prop) { + return [prop]; + }); + predicate = getIteratee(predicate); + return basePickBy(object, props, function(value, path) { + return predicate(value, path[0]); + }); + } + + /** + * This method is like `_.get` except that if the resolved value is a + * function it's invoked with the `this` binding of its parent object and + * its result is returned. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to resolve. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; + * + * _.result(object, 'a[0].b.c1'); + * // => 3 + * + * _.result(object, 'a[0].b.c2'); + * // => 4 + * + * _.result(object, 'a[0].b.c3', 'default'); + * // => 'default' + * + * _.result(object, 'a[0].b.c3', _.constant('default')); + * // => 'default' + */ + function result(object, path, defaultValue) { + path = castPath(path, object); + + var index = -1, + length = path.length; + + // Ensure the loop is entered when path is empty. + if (!length) { + length = 1; + object = undefined; + } + while (++index < length) { + var value = object == null ? undefined : object[toKey(path[index])]; + if (value === undefined) { + index = length; + value = defaultValue; + } + object = isFunction(value) ? value.call(object) : value; + } + return object; + } + + /** + * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, + * it's created. Arrays are created for missing index properties while objects + * are created for all other missing properties. Use `_.setWith` to customize + * `path` creation. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @returns {Object} Returns `object`. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.set(object, 'a[0].b.c', 4); + * console.log(object.a[0].b.c); + * // => 4 + * + * _.set(object, ['x', '0', 'y', 'z'], 5); + * console.log(object.x[0].y.z); + * // => 5 + */ + function set(object, path, value) { + return object == null ? object : baseSet(object, path, value); + } + + /** + * This method is like `_.set` except that it accepts `customizer` which is + * invoked to produce the objects of `path`. If `customizer` returns `undefined` + * path creation is handled by the method instead. The `customizer` is invoked + * with three arguments: (nsValue, key, nsObject). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * var object = {}; + * + * _.setWith(object, '[0][1]', 'a', Object); + * // => { '0': { '1': 'a' } } + */ + function setWith(object, path, value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return object == null ? object : baseSet(object, path, value, customizer); + } + + /** + * Creates an array of own enumerable string keyed-value pairs for `object` + * which can be consumed by `_.fromPairs`. If `object` is a map or set, its + * entries are returned. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias entries + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the key-value pairs. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.toPairs(new Foo); + * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) + */ + var toPairs = createToPairs(keys); + + /** + * Creates an array of own and inherited enumerable string keyed-value pairs + * for `object` which can be consumed by `_.fromPairs`. If `object` is a map + * or set, its entries are returned. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias entriesIn + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the key-value pairs. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.toPairsIn(new Foo); + * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed) + */ + var toPairsIn = createToPairs(keysIn); + + /** + * An alternative to `_.reduce`; this method transforms `object` to a new + * `accumulator` object which is the result of running each of its own + * enumerable string keyed properties thru `iteratee`, with each invocation + * potentially mutating the `accumulator` object. If `accumulator` is not + * provided, a new object with the same `[[Prototype]]` will be used. The + * iteratee is invoked with four arguments: (accumulator, value, key, object). + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 1.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The custom accumulator value. + * @returns {*} Returns the accumulated value. + * @example + * + * _.transform([2, 3, 4], function(result, n) { + * result.push(n *= n); + * return n % 2 == 0; + * }, []); + * // => [4, 9] + * + * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { + * (result[value] || (result[value] = [])).push(key); + * }, {}); + * // => { '1': ['a', 'c'], '2': ['b'] } + */ + function transform(object, iteratee, accumulator) { + var isArr = isArray(object), + isArrLike = isArr || isBuffer(object) || isTypedArray(object); + + iteratee = getIteratee(iteratee, 4); + if (accumulator == null) { + var Ctor = object && object.constructor; + if (isArrLike) { + accumulator = isArr ? new Ctor : []; + } + else if (isObject(object)) { + accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; + } + else { + accumulator = {}; + } + } + (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) { + return iteratee(accumulator, value, index, object); + }); + return accumulator; + } + + /** + * Removes the property at `path` of `object`. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to unset. + * @returns {boolean} Returns `true` if the property is deleted, else `false`. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 7 } }] }; + * _.unset(object, 'a[0].b.c'); + * // => true + * + * console.log(object); + * // => { 'a': [{ 'b': {} }] }; + * + * _.unset(object, ['a', '0', 'b', 'c']); + * // => true + * + * console.log(object); + * // => { 'a': [{ 'b': {} }] }; + */ + function unset(object, path) { + return object == null ? true : baseUnset(object, path); + } + + /** + * This method is like `_.set` except that accepts `updater` to produce the + * value to set. Use `_.updateWith` to customize `path` creation. The `updater` + * is invoked with one argument: (value). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {Function} updater The function to produce the updated value. + * @returns {Object} Returns `object`. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.update(object, 'a[0].b.c', function(n) { return n * n; }); + * console.log(object.a[0].b.c); + * // => 9 + * + * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; }); + * console.log(object.x[0].y.z); + * // => 0 + */ + function update(object, path, updater) { + return object == null ? object : baseUpdate(object, path, castFunction(updater)); + } + + /** + * This method is like `_.update` except that it accepts `customizer` which is + * invoked to produce the objects of `path`. If `customizer` returns `undefined` + * path creation is handled by the method instead. The `customizer` is invoked + * with three arguments: (nsValue, key, nsObject). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {Function} updater The function to produce the updated value. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * var object = {}; + * + * _.updateWith(object, '[0][1]', _.constant('a'), Object); + * // => { '0': { '1': 'a' } } + */ + function updateWith(object, path, updater, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer); + } + + /** + * Creates an array of the own enumerable string keyed property values of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.values(new Foo); + * // => [1, 2] (iteration order is not guaranteed) + * + * _.values('hi'); + * // => ['h', 'i'] + */ + function values(object) { + return object == null ? [] : baseValues(object, keys(object)); + } + + /** + * Creates an array of the own and inherited enumerable string keyed property + * values of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.valuesIn(new Foo); + * // => [1, 2, 3] (iteration order is not guaranteed) + */ + function valuesIn(object) { + return object == null ? [] : baseValues(object, keysIn(object)); + } + + /*------------------------------------------------------------------------*/ + + /** + * Clamps `number` within the inclusive `lower` and `upper` bounds. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Number + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + * @example + * + * _.clamp(-10, -5, 5); + * // => -5 + * + * _.clamp(10, -5, 5); + * // => 5 + */ + function clamp(number, lower, upper) { + if (upper === undefined) { + upper = lower; + lower = undefined; + } + if (upper !== undefined) { + upper = toNumber(upper); + upper = upper === upper ? upper : 0; + } + if (lower !== undefined) { + lower = toNumber(lower); + lower = lower === lower ? lower : 0; + } + return baseClamp(toNumber(number), lower, upper); + } + + /** + * Checks if `n` is between `start` and up to, but not including, `end`. If + * `end` is not specified, it's set to `start` with `start` then set to `0`. + * If `start` is greater than `end` the params are swapped to support + * negative ranges. + * + * @static + * @memberOf _ + * @since 3.3.0 + * @category Number + * @param {number} number The number to check. + * @param {number} [start=0] The start of the range. + * @param {number} end The end of the range. + * @returns {boolean} Returns `true` if `number` is in the range, else `false`. + * @see _.range, _.rangeRight + * @example + * + * _.inRange(3, 2, 4); + * // => true + * + * _.inRange(4, 8); + * // => true + * + * _.inRange(4, 2); + * // => false + * + * _.inRange(2, 2); + * // => false + * + * _.inRange(1.2, 2); + * // => true + * + * _.inRange(5.2, 4); + * // => false + * + * _.inRange(-3, -2, -6); + * // => true + */ + function inRange(number, start, end) { + start = toFinite(start); + if (end === undefined) { + end = start; + start = 0; + } else { + end = toFinite(end); + } + number = toNumber(number); + return baseInRange(number, start, end); + } + + /** + * Produces a random number between the inclusive `lower` and `upper` bounds. + * If only one argument is provided a number between `0` and the given number + * is returned. If `floating` is `true`, or either `lower` or `upper` are + * floats, a floating-point number is returned instead of an integer. + * + * **Note:** JavaScript follows the IEEE-754 standard for resolving + * floating-point values which can produce unexpected results. + * + * @static + * @memberOf _ + * @since 0.7.0 + * @category Number + * @param {number} [lower=0] The lower bound. + * @param {number} [upper=1] The upper bound. + * @param {boolean} [floating] Specify returning a floating-point number. + * @returns {number} Returns the random number. + * @example + * + * _.random(0, 5); + * // => an integer between 0 and 5 + * + * _.random(5); + * // => also an integer between 0 and 5 + * + * _.random(5, true); + * // => a floating-point number between 0 and 5 + * + * _.random(1.2, 5.2); + * // => a floating-point number between 1.2 and 5.2 + */ + function random(lower, upper, floating) { + if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) { + upper = floating = undefined; + } + if (floating === undefined) { + if (typeof upper == 'boolean') { + floating = upper; + upper = undefined; + } + else if (typeof lower == 'boolean') { + floating = lower; + lower = undefined; + } + } + if (lower === undefined && upper === undefined) { + lower = 0; + upper = 1; + } + else { + lower = toFinite(lower); + if (upper === undefined) { + upper = lower; + lower = 0; + } else { + upper = toFinite(upper); + } + } + if (lower > upper) { + var temp = lower; + lower = upper; + upper = temp; + } + if (floating || lower % 1 || upper % 1) { + var rand = nativeRandom(); + return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper); + } + return baseRandom(lower, upper); + } + + /*------------------------------------------------------------------------*/ + + /** + * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the camel cased string. + * @example + * + * _.camelCase('Foo Bar'); + * // => 'fooBar' + * + * _.camelCase('--foo-bar--'); + * // => 'fooBar' + * + * _.camelCase('__FOO_BAR__'); + * // => 'fooBar' + */ + var camelCase = createCompounder(function(result, word, index) { + word = word.toLowerCase(); + return result + (index ? capitalize(word) : word); + }); + + /** + * Converts the first character of `string` to upper case and the remaining + * to lower case. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to capitalize. + * @returns {string} Returns the capitalized string. + * @example + * + * _.capitalize('FRED'); + * // => 'Fred' + */ + function capitalize(string) { + return upperFirst(toString(string).toLowerCase()); + } + + /** + * Deburrs `string` by converting + * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) + * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) + * letters to basic Latin letters and removing + * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to deburr. + * @returns {string} Returns the deburred string. + * @example + * + * _.deburr('déjà vu'); + * // => 'deja vu' + */ + function deburr(string) { + string = toString(string); + return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); + } + + /** + * Checks if `string` ends with the given target string. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to inspect. + * @param {string} [target] The string to search for. + * @param {number} [position=string.length] The position to search up to. + * @returns {boolean} Returns `true` if `string` ends with `target`, + * else `false`. + * @example + * + * _.endsWith('abc', 'c'); + * // => true + * + * _.endsWith('abc', 'b'); + * // => false + * + * _.endsWith('abc', 'b', 2); + * // => true + */ + function endsWith(string, target, position) { + string = toString(string); + target = baseToString(target); + + var length = string.length; + position = position === undefined + ? length + : baseClamp(toInteger(position), 0, length); + + var end = position; + position -= target.length; + return position >= 0 && string.slice(position, end) == target; + } + + /** + * Converts the characters "&", "<", ">", '"', and "'" in `string` to their + * corresponding HTML entities. + * + * **Note:** No other characters are escaped. To escape additional + * characters use a third-party library like [_he_](https://mths.be/he). + * + * Though the ">" character is escaped for symmetry, characters like + * ">" and "/" don't need escaping in HTML and have no special meaning + * unless they're part of a tag or unquoted attribute value. See + * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) + * (under "semi-related fun fact") for more details. + * + * When working with HTML you should always + * [quote attribute values](http://wonko.com/post/html-escaping) to reduce + * XSS vectors. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escape('fred, barney, & pebbles'); + * // => 'fred, barney, & pebbles' + */ + function escape(string) { + string = toString(string); + return (string && reHasUnescapedHtml.test(string)) + ? string.replace(reUnescapedHtml, escapeHtmlChar) + : string; + } + + /** + * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", + * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escapeRegExp('[lodash](https://lodash.com/)'); + * // => '\[lodash\]\(https://lodash\.com/\)' + */ + function escapeRegExp(string) { + string = toString(string); + return (string && reHasRegExpChar.test(string)) + ? string.replace(reRegExpChar, '\\$&') + : string; + } + + /** + * Converts `string` to + * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the kebab cased string. + * @example + * + * _.kebabCase('Foo Bar'); + * // => 'foo-bar' + * + * _.kebabCase('fooBar'); + * // => 'foo-bar' + * + * _.kebabCase('__FOO_BAR__'); + * // => 'foo-bar' + */ + var kebabCase = createCompounder(function(result, word, index) { + return result + (index ? '-' : '') + word.toLowerCase(); + }); + + /** + * Converts `string`, as space separated words, to lower case. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the lower cased string. + * @example + * + * _.lowerCase('--Foo-Bar--'); + * // => 'foo bar' + * + * _.lowerCase('fooBar'); + * // => 'foo bar' + * + * _.lowerCase('__FOO_BAR__'); + * // => 'foo bar' + */ + var lowerCase = createCompounder(function(result, word, index) { + return result + (index ? ' ' : '') + word.toLowerCase(); + }); + + /** + * Converts the first character of `string` to lower case. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.lowerFirst('Fred'); + * // => 'fred' + * + * _.lowerFirst('FRED'); + * // => 'fRED' + */ + var lowerFirst = createCaseFirst('toLowerCase'); + + /** + * Pads `string` on the left and right sides if it's shorter than `length`. + * Padding characters are truncated if they can't be evenly divided by `length`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.pad('abc', 8); + * // => ' abc ' + * + * _.pad('abc', 8, '_-'); + * // => '_-abc_-_' + * + * _.pad('abc', 3); + * // => 'abc' + */ + function pad(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + if (!length || strLength >= length) { + return string; + } + var mid = (length - strLength) / 2; + return ( + createPadding(nativeFloor(mid), chars) + + string + + createPadding(nativeCeil(mid), chars) + ); + } + + /** + * Pads `string` on the right side if it's shorter than `length`. Padding + * characters are truncated if they exceed `length`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.padEnd('abc', 6); + * // => 'abc ' + * + * _.padEnd('abc', 6, '_-'); + * // => 'abc_-_' + * + * _.padEnd('abc', 3); + * // => 'abc' + */ + function padEnd(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + return (length && strLength < length) + ? (string + createPadding(length - strLength, chars)) + : string; + } + + /** + * Pads `string` on the left side if it's shorter than `length`. Padding + * characters are truncated if they exceed `length`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.padStart('abc', 6); + * // => ' abc' + * + * _.padStart('abc', 6, '_-'); + * // => '_-_abc' + * + * _.padStart('abc', 3); + * // => 'abc' + */ + function padStart(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + return (length && strLength < length) + ? (createPadding(length - strLength, chars) + string) + : string; + } + + /** + * Converts `string` to an integer of the specified radix. If `radix` is + * `undefined` or `0`, a `radix` of `10` is used unless `value` is a + * hexadecimal, in which case a `radix` of `16` is used. + * + * **Note:** This method aligns with the + * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category String + * @param {string} string The string to convert. + * @param {number} [radix=10] The radix to interpret `value` by. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {number} Returns the converted integer. + * @example + * + * _.parseInt('08'); + * // => 8 + * + * _.map(['6', '08', '10'], _.parseInt); + * // => [6, 8, 10] + */ + function parseInt(string, radix, guard) { + if (guard || radix == null) { + radix = 0; + } else if (radix) { + radix = +radix; + } + return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0); + } + + /** + * Repeats the given string `n` times. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to repeat. + * @param {number} [n=1] The number of times to repeat the string. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {string} Returns the repeated string. + * @example + * + * _.repeat('*', 3); + * // => '***' + * + * _.repeat('abc', 2); + * // => 'abcabc' + * + * _.repeat('abc', 0); + * // => '' + */ + function repeat(string, n, guard) { + if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) { + n = 1; + } else { + n = toInteger(n); + } + return baseRepeat(toString(string), n); + } + + /** + * Replaces matches for `pattern` in `string` with `replacement`. + * + * **Note:** This method is based on + * [`String#replace`](https://mdn.io/String/replace). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to modify. + * @param {RegExp|string} pattern The pattern to replace. + * @param {Function|string} replacement The match replacement. + * @returns {string} Returns the modified string. + * @example + * + * _.replace('Hi Fred', 'Fred', 'Barney'); + * // => 'Hi Barney' + */ + function replace() { + var args = arguments, + string = toString(args[0]); + + return args.length < 3 ? string : string.replace(args[1], args[2]); + } + + /** + * Converts `string` to + * [snake case](https://en.wikipedia.org/wiki/Snake_case). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the snake cased string. + * @example + * + * _.snakeCase('Foo Bar'); + * // => 'foo_bar' + * + * _.snakeCase('fooBar'); + * // => 'foo_bar' + * + * _.snakeCase('--FOO-BAR--'); + * // => 'foo_bar' + */ + var snakeCase = createCompounder(function(result, word, index) { + return result + (index ? '_' : '') + word.toLowerCase(); + }); + + /** + * Splits `string` by `separator`. + * + * **Note:** This method is based on + * [`String#split`](https://mdn.io/String/split). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to split. + * @param {RegExp|string} separator The separator pattern to split by. + * @param {number} [limit] The length to truncate results to. + * @returns {Array} Returns the string segments. + * @example + * + * _.split('a-b-c', '-', 2); + * // => ['a', 'b'] + */ + function split(string, separator, limit) { + if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) { + separator = limit = undefined; + } + limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0; + if (!limit) { + return []; + } + string = toString(string); + if (string && ( + typeof separator == 'string' || + (separator != null && !isRegExp(separator)) + )) { + separator = baseToString(separator); + if (!separator && hasUnicode(string)) { + return castSlice(stringToArray(string), 0, limit); + } + } + return string.split(separator, limit); + } + + /** + * Converts `string` to + * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). + * + * @static + * @memberOf _ + * @since 3.1.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the start cased string. + * @example + * + * _.startCase('--foo-bar--'); + * // => 'Foo Bar' + * + * _.startCase('fooBar'); + * // => 'Foo Bar' + * + * _.startCase('__FOO_BAR__'); + * // => 'FOO BAR' + */ + var startCase = createCompounder(function(result, word, index) { + return result + (index ? ' ' : '') + upperFirst(word); + }); + + /** + * Checks if `string` starts with the given target string. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to inspect. + * @param {string} [target] The string to search for. + * @param {number} [position=0] The position to search from. + * @returns {boolean} Returns `true` if `string` starts with `target`, + * else `false`. + * @example + * + * _.startsWith('abc', 'a'); + * // => true + * + * _.startsWith('abc', 'b'); + * // => false + * + * _.startsWith('abc', 'b', 1); + * // => true + */ + function startsWith(string, target, position) { + string = toString(string); + position = position == null + ? 0 + : baseClamp(toInteger(position), 0, string.length); + + target = baseToString(target); + return string.slice(position, position + target.length) == target; + } + + /** + * Creates a compiled template function that can interpolate data properties + * in "interpolate" delimiters, HTML-escape interpolated data properties in + * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data + * properties may be accessed as free variables in the template. If a setting + * object is given, it takes precedence over `_.templateSettings` values. + * + * **Note:** In the development build `_.template` utilizes + * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) + * for easier debugging. + * + * For more information on precompiling templates see + * [lodash's custom builds documentation](https://lodash.com/custom-builds). + * + * For more information on Chrome extension sandboxes see + * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category String + * @param {string} [string=''] The template string. + * @param {Object} [options={}] The options object. + * @param {RegExp} [options.escape=_.templateSettings.escape] + * The HTML "escape" delimiter. + * @param {RegExp} [options.evaluate=_.templateSettings.evaluate] + * The "evaluate" delimiter. + * @param {Object} [options.imports=_.templateSettings.imports] + * An object to import into the template as free variables. + * @param {RegExp} [options.interpolate=_.templateSettings.interpolate] + * The "interpolate" delimiter. + * @param {string} [options.sourceURL='lodash.templateSources[n]'] + * The sourceURL of the compiled template. + * @param {string} [options.variable='obj'] + * The data object variable name. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the compiled template function. + * @example + * + * // Use the "interpolate" delimiter to create a compiled template. + * var compiled = _.template('hello <%= user %>!'); + * compiled({ 'user': 'fred' }); + * // => 'hello fred!' + * + * // Use the HTML "escape" delimiter to escape data property values. + * var compiled = _.template('<%- value %>'); + * compiled({ 'value': ' + + + + + + Languages : CH +

Javascript code prettifier

+ +

Setup

+
    +
  1. Download a distribution +
  2. Include the script and stylesheets in your document + (you will need to make sure the css and js file are on your server, and + adjust the paths in the script and link tag) +
    +<link href="prettify.css" type="text/css" rel="stylesheet" />
    +<script type="text/javascript" src="prettify.js"></script>
    +
  3. Add onload="prettyPrint()" to your + document's body tag. +
  4. Modify the stylesheet to get the coloring you prefer
  5. +
+ +

Usage

+

Put code snippets in + <pre class="prettyprint">...</pre> + or <code class="prettyprint">...</code> + and it will automatically be pretty printed. + + + + +
The original + Prettier +
class Voila {
+public:
+  // Voila
+  static const string VOILA = "Voila";
+
+  // will not interfere with embedded tags.
+}
+ +
class Voila {
+public:
+  // Voila
+  static const string VOILA = "Voila";
+
+  // will not interfere with embedded tags.
+}
+
+ +

FAQ

+

Which languages does it work for?

+

The comments in prettify.js are authoritative but the lexer + should work on a number of languages including C and friends, + Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl + and Ruby, but, because of commenting conventions, doesn't work on + Smalltalk, or CAML-like languages.

+ +

LISPy languages are supported via an extension: + lang-lisp.js.

+

And similarly for + CSS, + Haskell, + Lua, + OCAML, SML, F#, + Visual Basic, + SQL, + Protocol Buffers, and + WikiText.. + +

If you'd like to add an extension for your favorite language, please + look at src/lang-lisp.js and file an + issue including your language extension, and a testcase.

+ +

How do I specify which language my code is in?

+

You don't need to specify the language since prettyprint() + will guess. You can specify a language by specifying the language extension + along with the prettyprint class like so:

+
<pre class="prettyprint lang-html">
+  The lang-* class specifies the language file extensions.
+  File extensions supported by default include
+    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
+    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
+    "xhtml", "xml", "xsl".
+</pre>
+ +

It doesn't work on <obfuscated code sample>?

+

Yes. Prettifying obfuscated code is like putting lipstick on a pig + — i.e. outside the scope of this tool.

+ +

Which browsers does it work with?

+

It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. + Look at the test page to see if it + works in your browser.

+ +

What's changed?

+

See the change log

+ +

Why doesn't Prettyprinting of strings work on WordPress?

+

Apparently wordpress does "smart quoting" which changes close quotes. + This causes end quotes to not match up with open quotes. +

This breaks prettifying as well as copying and pasting of code samples. + See + WordPress's help center for info on how to stop smart quoting of code + snippets.

+ +

How do I put line numbers in my code?

+

You can use the linenums class to turn on line + numbering. If your code doesn't start at line number 1, you can + add a colon and a line number to the end of that class as in + linenums:52. + +

For example +

<pre class="prettyprint linenums:4"
+>// This is line 4.
+foo();
+bar();
+baz();
+boo();
+far();
+faz();
+<pre>
+ produces +
// This is line 4.
+foo();
+bar();
+baz();
+boo();
+far();
+faz();
+
+ +

How do I prevent a portion of markup from being marked as code?

+

You can use the nocode class to identify a span of markup + that is not code. +

<pre class=prettyprint>
+int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
+  Continuation of comment */
+int y = bar();
+</pre>
+produces +
+int x = foo();  /* This is a comment  This is not code
+  Continuation of comment */
+int y = bar();
+
+ +

For a more complete example see the issue22 + testcase.

+ +

I get an error message "a is not a function" or "opt_whenDone is not a function"

+

If you are calling prettyPrint via an event handler, wrap it in a function. + Instead of doing +

+ addEventListener('load', prettyPrint, false); +
+ wrap it in a closure like +
+ addEventListener('load', function (event) { prettyPrint() }, false); +
+ so that the browser does not pass an event object to prettyPrint which + will confuse it. + +


+ + + + diff --git a/ref/assets/vendor/prettify/prettify-min.css b/ref/assets/vendor/prettify/prettify-min.css new file mode 100644 index 00000000..d44b3a22 --- /dev/null +++ b/ref/assets/vendor/prettify/prettify-min.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} \ No newline at end of file diff --git a/ref/assets/vendor/prettify/prettify-min.js b/ref/assets/vendor/prettify/prettify-min.js new file mode 100644 index 00000000..4845d05d --- /dev/null +++ b/ref/assets/vendor/prettify/prettify-min.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/ref/classes/index.html b/ref/classes/index.html new file mode 100644 index 00000000..487fe15b --- /dev/null +++ b/ref/classes/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/ref/classes/photonui.AccelManager.html b/ref/classes/photonui.AccelManager.html new file mode 100644 index 00000000..4adab018 --- /dev/null +++ b/ref/classes/photonui.AccelManager.html @@ -0,0 +1,1193 @@ + + + + + photonui.AccelManager - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.AccelManager Class

+
+ +
+ Extends photonui.Base +
+ + + + Module: NonVisual
+ Parent Module: PhotonUI + +
+ + +
+

Manage keyboard accelerators.

+ +
+ +
+

Constructor

+
+

photonui.AccelManager

+ + () + + + + + + + + +
+

+ Defined in + src/nonvisual/accelmanager.js:42 +

+ + + +
+ +
+ +
+ + + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onAccel

+ +
+ (
    +
  • + keys +
  • +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/nonvisual/accelmanager.js:160 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + keys + String + + +
    + +
    + +
  • +
  • + event + Event + + +
    + +
    + +
  • +
+
+ + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

addAccel

+ +
+ (
    +
  • + id +
  • +
  • + keys +
  • +
  • + callback +
  • +
  • + safe +
  • +
) +
+ + + + + + + + +
+

+ Defined in + src/nonvisual/accelmanager.js:103 +

+ + + +
+ +
+

Add an accelerator.

+ +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    +

    An unique id for the accelerator.

    + +
    + +
  • +
  • + keys + String + + +
    +

    The keys of the accelerator (see the keyCombo section of http://robertwhurst.github.io/KeyboardJS/ ).

    + +
    + +
  • +
  • + callback + Function + + +
    + +
    + +
  • +
  • + safe + Boolean + + +
    +

    If true, the accelerator is disable if a field/textArea is focused (optional, default=true)

    + +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:157 +

+ + + +
+ +
+ Destroy the class. +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeAccel

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

+ Defined in + src/nonvisual/accelmanager.js:128 +

+ + + +
+ +
+

Remove an accelerator.

+ +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    +

    the accelerator id.

    + +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__kbd

+ Object + + + private + + + +
+

+ Defined in + src/nonvisual/accelmanager.js:79 +

+ + +
+ +
+

Keyboard bindings.

+
{
+    "id": {
+        safe: Boolean,
+        callback: Function,
+        binding: Object
+    },
+    ...
+}
+ +
+ + + +
+
+

__keys

+ Object + + + private + + + +
+

+ Defined in + src/nonvisual/accelmanager.js:65 +

+ + +
+ +
+

Registered keys.

+
{
+    "key": [ "id", "id", ... ]
+    ...
+}
+ +
+ + + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.Base.html b/ref/classes/photonui.Base.html new file mode 100644 index 00000000..7dab9968 --- /dev/null +++ b/ref/classes/photonui.Base.html @@ -0,0 +1,943 @@ + + + + + photonui.Base - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.Base Class

+
+ + +
+ Defined in: src/base.js:43 +
+ + Module: PhotonUI + +
+ + +
+

Base class for all PhotonUI Classes.

+

wEvents:

+
    +
  • destroy: +
      +
    • description: called before the widget was destroyed.
    • +
    • callback: function (widget)
    • +
    +
  • +
+ +
+ +
+

Constructor

+
+

photonui.Base

+ +
+ (
    +
  • + params +
  • +
) +
+ + + + + + + + +
+

+ Defined in + src/base.js:43 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + params + Object + + +
    +

    An object that can contain any property that will be set to the class (optional).

    + +
    + +
  • +
+
+ + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/base.js:229 +

+ + + +
+ +
+

Javascript event binding (for internal use).

+ +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    +

    An unique id for the event.

    + +
    + +
  • +
  • + element + DOMElement + + +
    +

    The element on which the event will be bind.

    + +
    + +
  • +
  • + evName + String + + +
    +

    The event name (e.g. "mousemove", "click",...).

    + +
    + +
  • +
  • + callback + Function + + +
    +

    The function that will be called when the event occured.

    + +
    + +
  • +
  • + [options] + Object + optional + + +
    +

    options for addEventListener

    + +
    + +
  • +
+
+ + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/base.js:292 +

+ + + +
+ +
+

Call all callbacks for the given wEvent.

+

NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget.

+ +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    +

    The widget event.

    + +
    + +
  • +
  • + params + Array + + +
    +

    Parametters that will be sent to the callbacks.

    + +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/base.js:276 +

+ + + +
+ +
+

Register available wEvent.

+ +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/base.js:257 +

+ + + +
+ +
+

Unbind javascript event.

+ +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    +

    The id of the event.

    + +
    + +
  • +
+
+ + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

+ Defined in + src/base.js:209 +

+ + + +
+ +
+

Force the update of the given properties.

+

This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties.

+ +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    +

    The properties to update.

    + +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

+ Defined in + src/base.js:157 +

+ + + +
+ +
+

Destroy the class.

+ +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

+ Defined in + src/base.js:169 +

+ + + +
+ +
+

Register a callback for any PhotonUI/Widget event (called wEvent).

+

Callback signature:

+
function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]])
+ +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    +

    An unique id for the callback.

    + +
    + +
  • +
  • + wEvent + String + + +
    +

    the PhotonUI/Widget event name.

    + +
    + +
  • +
  • + callback + Function + + +
    +

    The callback function.

    + +
    + +
  • +
  • + thisArg + Object + + +
    +

    The value of this (optionnal, default = current widget).

    + +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

+ Defined in + src/base.js:193 +

+ + + +
+ +
+

Remove a registered callback.

+ +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    +

    The id of the callback.

    + +
    + +
  • +
+
+ + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

+ Defined in + src/base.js:142 +

+ + +
+ +
+

Object containing references to registered callbacks.

+ +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

+ Defined in + src/base.js:132 +

+ + +
+ +
+

Object containing references javascript events binding (for widget +internal use).

+ +
+ + + +
+
+

data

+ Object + + + + + +
+

+ Defined in + src/base.js:113 +

+ + +
+ +
+

Arbitrary data

+ +
+ +

Default: {}

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.BaseIcon.html b/ref/classes/photonui.BaseIcon.html new file mode 100644 index 00000000..7d8561f8 --- /dev/null +++ b/ref/classes/photonui.BaseIcon.html @@ -0,0 +1,1676 @@ + + + + + photonui.BaseIcon - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.BaseIcon Class

+
+ +
+ Extends photonui.Widget +
+ +
+ Defined in: src/visual/baseicon.js:41 +
+ + Module: Visual
+ Parent Module: PhotonUI + +
+ + +
+

Base class for icons.

+ +
+ +
+

Constructor

+
+

photonui.BaseIcon

+ + () + + + + + + + + +
+

+ Defined in + src/visual/baseicon.js:41 +

+ + + +
+ +
+ +
+ + + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:445 +

+ + + +
+ +
+ Called when the context menu should be displayed. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/visual/baseicon.js:54 +

+ + + +
+ +
+

Called when the locale is changed.

+ +
+ + + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:415 +

+ + + +
+ +
+ Build the widget HTML. +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:425 +

+ + + +
+ +
+ Called when the visibility changes. +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    +

    Current visibility state (otptional, defaut=this.visible)

    + +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/widget.js:367 +

+ + + +
+ +
+ Destroy the widget. +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:262 +

+ + +
+ +
+ Html outer element of the widget (if any). +
+ +

Default: null

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.BaseWindow.html b/ref/classes/photonui.BaseWindow.html new file mode 100644 index 00000000..e95f082b --- /dev/null +++ b/ref/classes/photonui.BaseWindow.html @@ -0,0 +1,2233 @@ + + + + + photonui.BaseWindow - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.BaseWindow Class

+
+ +
+ Extends photonui.Container +
+ + + + Module: Container
+ Parent Module: PhotonUI + +
+ + +
+

Windows base class.

+

wEvents:

+
    +
  • position-changed: +
      +
    • description: called when the widows is moved.
    • +
    • callback: function(widget, x, y)
    • +
    +
  • +
+ +
+ +
+

Constructor

+
+

photonui.BaseWindow

+ + () + + + + + + + + +
+

+ Defined in + src/container/basewindow.js:42 +

+ + + +
+ +
+ +
+ + + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:445 +

+ + + +
+ +
+ Called when the context menu should be displayed. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:460 +

+ + + +
+ +
+ Called when the locale is changed. +
+ + + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/container/basewindow.js:358 +

+ + + +
+ +
+

Build the widget HTML.

+ +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/container/container.js:208 +

+ + + +
+ +
+ Called when the visibility changes. +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    +

    Current visibility state (otptional, defaut=this.visible)

    + +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

center

+ + () + + + + + + + + +
+

+ Defined in + src/container/basewindow.js:340 +

+ + + +
+ +
+

Center the window.

+ +
+ + + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/container/container.js:194 +

+ + + +
+ +
+ Destroy the widget. +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeChild

+ +
+ (
    +
  • + widget +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:182 +

+ + + +
+ +
+ Remove the given child. +
+ +
+

Parameters:

+ + +
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

child

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:146 +

+ + +
+ +
+ The child widget. +
+ +

Default: null (no child)

+ + +
+
+

childName

+ String + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:118 +

+ + +
+ +
+ The child widget name. +
+ +

Default: null (no child)

+ + +
+
+

containerNode

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Container + + but overwritten in + src/container/basewindow.js:323 +

+ + +
+ +
+

HTML Element that contain the child widget HTML.

+ +
+ + + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

height

+ Number + + + + + +
+

+ Defined in + src/container/basewindow.js:174 +

+ + +
+ +
+

Height of the container node.

+ +
+ +

Default: : null (auto)

+ + +
+
+

horizontalChildExpansion

+ Boolean + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:66 +

+ + +
+ +
+ Horizontaly expand the container's child widget. +
+ +

Default: true

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/container/basewindow.js:311 +

+ + +
+ +
+

Html outer element of the widget (if any).

+ +
+ +

Default: null

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

maxHeight

+ Number + + + + + +
+

+ Defined in + src/container/basewindow.js:269 +

+ + +
+ +
+

Maximum height of the container node.

+ +
+ +

Default: : null (no maximum)

+ + +
+
+

maxWidth

+ Number + + + + + +
+

+ Defined in + src/container/basewindow.js:246 +

+ + +
+ +
+

Maximum width of the container node.

+ +
+ +

Default: : null (no maximum)

+ + +
+
+

minHeight

+ Number + + + + + +
+

+ Defined in + src/container/basewindow.js:223 +

+ + +
+ +
+

Minimum height of the container node.

+ +
+ +

Default: : null (no minimum)

+ + +
+
+

minWidth

+ Number + + + + + +
+

+ Defined in + src/container/basewindow.js:200 +

+ + +
+ +
+

Minimum width of the container node.

+ +
+ +

Default: : null (no minimum)

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

padding

+ Number + + + + + +
+

+ Defined in + src/container/basewindow.js:292 +

+ + +
+ +
+

Window container node padding.

+ +
+ +

Default: 0

+ + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

position

+ Object + + + + + +
+

+ Defined in + src/container/basewindow.js:78 +

+ + +
+ +
+

Window position.

+
{x: Number, y: Number}
+ +
+ +

Default: {x: 0, y: 0}

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

verticalChildExpansion

+ Boolean + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:92 +

+ + +
+ +
+ Verticaly expand the container's child widget. +
+ +

Default: false

+ + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+

width

+ Number + + + + + +
+

+ Defined in + src/container/basewindow.js:148 +

+ + +
+ +
+

Width of the container node.

+ +
+ +

Default: : null (auto)

+ + +
+
+

x

+ Number + + + + + +
+

+ Defined in + src/container/basewindow.js:114 +

+ + +
+ +
+

The X position of the Window.

+ +
+ +

Default: 0

+ + +
+
+

y

+ Number + + + + + +
+

+ Defined in + src/container/basewindow.js:131 +

+ + +
+ +
+

The Y position of the Window.

+ +
+ +

Default: 0

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.BoxLayout.html b/ref/classes/photonui.BoxLayout.html new file mode 100644 index 00000000..b9dedad1 --- /dev/null +++ b/ref/classes/photonui.BoxLayout.html @@ -0,0 +1,2362 @@ + + + + + photonui.BoxLayout - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.BoxLayout Class

+
+ +
+ Extends photonui.Layout +
+ +
+ Defined in: src/layout/boxlayout.js:42 +
+ + Module: Layout
+ Parent Module: PhotonUI + +
+ + +
+

Vertical and horizontal box layout.

+

Layout Options:

+
{
+    align: <String (stretch|expand, start|left|top, center|middle, end|right|bottom), default=stretch>,
+
+    order: <Number default=null (auto)>
+
+    minWidth: <Number (null=auto), default=null>,
+    maxWidth: <Number (null=auto), default=null>,
+    width: <Number (null=auto), default=null>,
+
+    minHeight: <Number (null=auto), default=null>,
+    maxHeight: <Number (null=auto), default=null>,
+    height: <Number (null=auto), default=null>
+}
+ +
+ +
+

Constructor

+
+

photonui.BoxLayout

+ + () + + + + + + + + +
+

+ Defined in + src/layout/boxlayout.js:42 +

+ + + +
+ +
+ +
+ + + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:445 +

+ + + +
+ +
+ Called when the context menu should be displayed. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/layout/layout.js:273 +

+ + + +
+ +
+ Called when the locale is changed. +
+ + + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/layout/boxlayout.js:233 +

+ + + +
+ +
+

Build the widget HTML.

+ +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_computeLayoutOptions

+ +
+ (
    +
  • + widget +
  • +
) +
+ + + Object + + + + private + + + + + +
+

+ Defined in + src/layout/boxlayout.js:301 +

+ + + +
+ +
+

Returns a normalized layoutOption for a given widget.

+ +
+ +
+

Parameters:

+ + +
+ +
+

Returns:

+ +
+ Object: +

the layout options

+ +
+
+ + +
+
+

_lockUpdate

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Layout: + src/layout/layout.js:223 +

+ + + +
+ +
+ Lock the update of the layout. +
+ + + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateLayout

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Layout + + but overwritten in + src/layout/boxlayout.js:244 +

+ + + +
+ +
+

Update the layout.

+ +
+ + + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/layout/layout.js:250 +

+ + + +
+ +
+ Called when the visibility changes. +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    + Current visibility state (otptional, defaut=this.visible) +
    + +
  • +
+
+ + + +
+
+

addChild

+ +
+ (
    +
  • + widget +
  • +
  • + layoutOption +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Layout: + src/layout/layout.js:159 +

+ + + +
+ +
+ Add a widget to the layout. +
+ +
+

Parameters:

+ +
    +
  • + widget + photonui.Widget + + +
    + The widget to add. +
    + +
  • +
  • + layoutOption + Object + + +
    + Specific option for the layout (optional). +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/layout/layout.js:211 +

+ + + +
+ +
+ Destroy the widget. +
+ + + + +
+
+

empty

+ + () + + + + + + + + +
+

Inherited from + photonui.Layout: + src/layout/layout.js:193 +

+ + + +
+ +
+ Destroy all children of the layout +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeChild

+ +
+ (
    +
  • + widget +
  • +
) +
+ + + + + + + + +
+

Inherited from + + photonui.Container + + but overwritten in + src/layout/layout.js:178 +

+ + + +
+ +
+ Remove a widget from the layout. +
+ +
+

Parameters:

+ + +
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

child

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:146 +

+ + +
+ +
+

The child widget.

+ +
+ +

Default: null (no child)

+ + +
+
+

childName

+ String + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:118 +

+ + +
+ +
+

The child widget name.

+ +
+ +

Default: null (no child)

+ + +
+
+

children

+ Array + + + + + +
+

Inherited from + photonui.Layout: + src/layout/layout.js:106 +

+ + +
+ +
+ Layout children widgets. +
+ +

Default: []

+ + +
+
+

childrenNames

+ Array + + + + + +
+

Inherited from + photonui.Layout: + src/layout/layout.js:69 +

+ + +
+ +
+ Layout children widgets name. +
+ +

Default: []

+ + +
+
+

containerNode

+ HTMLElement + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:165 +

+ + +
+ +
+

HTML Element that contain the child widget HTML.

+ +
+ + + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

horizontalChildExpansion

+ Boolean + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:66 +

+ + +
+ +
+

Horizontaly expand the container's child widget.

+ +
+ +

Default: true

+ + +
+
+

horizontalPadding

+ Number + + + + + +
+

+ Defined in + src/layout/boxlayout.js:122 +

+ + +
+ +
+

Horizontal padding (px).

+ +
+ +

Default: 0

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/layout/boxlayout.js:215 +

+ + +
+ +
+

Html outer element of the widget (if any).

+ +
+ +

Default: null

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

orientation

+ String + + + + + +
+

+ Defined in + src/layout/boxlayout.js:78 +

+ + +
+ +
+

The layout orientation ("vertical" or "horizontal").

+ +
+ +

Default: "vertical"

+ + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

spacing

+ Number + + + + + +
+

+ Defined in + src/layout/boxlayout.js:141 +

+ + +
+ +
+

Spacing between children widgets.

+ +
+ +

Default: 5

+ + +
+
+

stretchToParentHeight

+ Boolean + + + + + +
+

+ Defined in + src/layout/boxlayout.js:191 +

+ + +
+ +
+

Whether to stretch the box to its parent height or not.

+ +
+ +

Default: true

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

verticalChildExpansion

+ Boolean + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:92 +

+ + +
+ +
+

Verticaly expand the container's child widget.

+ +
+ +

Default: false

+ + +
+
+

verticalPadding

+ Number + + + + + +
+

+ Defined in + src/layout/boxlayout.js:103 +

+ + +
+ +
+

Vertical padding (px).

+ +
+ +

Default: 0

+ + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.Button.html b/ref/classes/photonui.Button.html new file mode 100644 index 00000000..c5c06e8b --- /dev/null +++ b/ref/classes/photonui.Button.html @@ -0,0 +1,2097 @@ + + + + + photonui.Button - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.Button Class

+
+ +
+ Extends photonui.Widget +
+ + + + Module: Interactive
+ Parent Module: PhotonUI + +
+ + +
+

Button.

+

wEvents:

+
    +
  • click: +
      +
    • description: called when the button was clicked.
    • +
    • callback: function(widget, event)
    • +
    +
  • +
+ +
+ +
+

Constructor

+
+

photonui.Button

+ + () + + + + + + + + +
+

+ Defined in + src/interactive/button.js:44 +

+ + + +
+ +
+ +
+ + + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onButtonClicked

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/interactive/button.js:389 +

+ + + +
+ +
+

Called when the button is clicked.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:445 +

+ + + +
+ +
+ Called when the context menu should be displayed. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:460 +

+ + + +
+ +
+ Called when the locale is changed. +
+ + + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/interactive/button.js:362 +

+ + + +
+ +
+

Build the widget HTML.

+ +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_update

+ + () + + + + private + + + + + +
+

+ Defined in + src/interactive/button.js:332 +

+ + + +
+ +
+

Update the button content

+ +
+ + + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:425 +

+ + + +
+ +
+ Called when the visibility changes. +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    +

    Current visibility state (otptional, defaut=this.visible)

    + +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/interactive/button.js:311 +

+ + + +
+ +
+

Destroy the widget.

+ +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

appearance

+ String + + + + + +
+

+ Defined in + src/interactive/button.js:235 +

+ + +
+ +
+

Define the button appearance.

+
    +
  • normal
  • +
  • flat
  • +
+ +
+ +

Default: "normal"

+ + +
+
+

buttonColor

+ String + + + + + +
+

+ Defined in + src/interactive/button.js:261 +

+ + +
+ +
+

Button's color.

+

The available colors depends on the theme. Particle, the +default PhotonUI theme provides the following colors:

+
    +
  • blue
  • +
  • red
  • +
  • yellow
  • +
  • green
  • +
  • null (default)
  • +
+ +
+ +

Default: null

+ + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/interactive/button.js:293 +

+ + +
+ +
+

Html outer element of the widget (if any).

+ +
+ +

Default: null

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

leftIcon

+ BaseIcon + + + + + +
+

+ Defined in + src/interactive/button.js:138 +

+ + +
+ +
+

Left icon widget.

+ +
+ +

Default: : null

+ + +
+
+

leftIconName

+ String + + + + + +
+

+ Defined in + src/interactive/button.js:115 +

+ + +
+ +
+

Left icon widget name.

+ +
+ +

Default: : null

+ + +
+
+

leftIconVisible

+ Boolean + + + + + +
+

+ Defined in + src/interactive/button.js:157 +

+ + +
+ +
+

Define if the left icon is displayed or hidden.

+ +
+ +

Default: true

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

rightIcon

+ BaseIcon + + + + + +
+

+ Defined in + src/interactive/button.js:198 +

+ + +
+ +
+

Right icon widget.

+ +
+ +

Default: : null

+ + +
+
+

rightIconName

+ String + + + + + +
+

+ Defined in + src/interactive/button.js:175 +

+ + +
+ +
+

Right icon widget name.

+ +
+ +

Default: : null

+ + +
+
+

rightIconVisible

+ Boolean + + + + + +
+

+ Defined in + src/interactive/button.js:217 +

+ + +
+ +
+

Define if the right icon is displayed or hidden.

+ +
+ +

Default: true

+ + +
+
+

text

+ String + + + + + +
+

+ Defined in + src/interactive/button.js:77 +

+ + +
+ +
+

The button text.

+ +
+ +

Default: "Button"

+ + +
+
+

textVisible

+ Boolean + + + + + +
+

+ Defined in + src/interactive/button.js:97 +

+ + +
+ +
+

Define if the button text is displayed or hidden.

+ +
+ +

Default: true

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.Canvas.html b/ref/classes/photonui.Canvas.html new file mode 100644 index 00000000..9dd680c8 --- /dev/null +++ b/ref/classes/photonui.Canvas.html @@ -0,0 +1,2361 @@ + + + + + photonui.Canvas - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.Canvas Class

+
+ +
+ Extends photonui.Widget +
+ +
+ Defined in: src/visual/canvas.js:41 +
+ + Module: Visual
+ Parent Module: PhotonUI + +
+ + +
+

Canvas.

+ +
+ +
+

Constructor

+
+

photonui.Canvas

+ +
+ (
    +
  • + params +
  • +
) +
+ + + + + + + + +
+

+ Defined in + src/visual/canvas.js:41 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + params + Object + + +
    +

    An object that can contain any property of the widget (optional).

    + +
    + +
  • +
+
+ + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:445 +

+ + + +
+ +
+ Called when the context menu should be displayed. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/visual/canvas.js:268 +

+ + + +
+ +
+

Called when the locale is changed.

+ +
+ + + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/visual/canvas.js:250 +

+ + + +
+ +
+

Build the widget HTML.

+ +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:425 +

+ + + +
+ +
+ Called when the visibility changes. +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    +

    Current visibility state (otptional, defaut=this.visible)

    + +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/widget.js:367 +

+ + + +
+ +
+ Destroy the widget. +
+ + + + +
+
+

getContext

+ +
+ (
    +
  • + contextId +
  • +
) +
+ + + + + + + + + + + +
+

+ Defined in + src/visual/canvas.js:57 +

+ + + +
+ +
+

Returns a drawing context on the canvas.

+

Proxy of the native canvas method. For more informations see:

+ + +
+ +
+

Parameters:

+ +
    +
  • + contextId + String + + +
    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+

The drawing context.

+ +
+
+ + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

setContext

+ +
+ (
    +
  • + contextId +
  • +
) +
+ + + + + + + + +
+

+ Defined in + src/visual/canvas.js:85 +

+ + + +
+ +
+

Changes the context the element is related to to the given one.

+

Proxy of the native canvas method if exists. For more informations see:

+ + +
+ +
+

Parameters:

+ +
    +
  • + contextId + String + + +
    + +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

supportsContext

+ +
+ (
    +
  • + contextId +
  • +
) +
+ + + Boolean + + + + + + + + +
+

+ Defined in + src/visual/canvas.js:70 +

+ + + +
+ +
+

Indicate if the given context is supported by this canvas.

+

Proxy of the native canvas method if exists. For more informations see:

+ + +
+ +
+

Parameters:

+ +
    +
  • + contextId + String + + +
    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Boolean: +
+
+ + +
+
+

toBlob

+ +
+ (
    +
  • + type +
  • +
) +
+ + + Blob + + + + + + + + +
+

+ Defined in + src/visual/canvas.js:140 +

+ + + +
+ +
+

Returns a Blob object representing the image contained in the canvas (at 96dpi).

+

Proxy of the native canvas method if exists. For more informations see:

+ + +
+ +
+

Parameters:

+ +
    +
  • + type + String + + +
    +

    The image format (optional, e.g: "image/png", "image/jpeg",..., default="image/png")

    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Blob: +
+
+ + +
+
+

toBlobHD

+ +
+ (
    +
  • + type +
  • +
) +
+ + + Blob + + + + + + + + +
+

+ Defined in + src/visual/canvas.js:155 +

+ + + +
+ +
+

Returns a Blob object representing the image contained in the canvas (at the native +resolution of the canvas).

+

Proxy of the native canvas method if exists. For more informations see:

+ + +
+ +
+

Parameters:

+ +
    +
  • + type + String + + +
    +

    The image format (optional, e.g: "image/png", "image/jpeg",..., default="image/png")

    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Blob: +
+
+ + +
+
+

toDataURL

+ +
+ (
    +
  • + type +
  • +
) +
+ + + String + + + + + + + + +
+

+ Defined in + src/visual/canvas.js:112 +

+ + + +
+ +
+

Returns a "data:" URL containing a representation of the image (at 96dpi).

+

Proxy of the native canvas method. For more informations see:

+ + +
+ +
+

Parameters:

+ +
    +
  • + type + String + + +
    +

    The image format (optional, e.g: "image/png", "image/jpeg",..., default="image/png")

    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ String: +

The data URL

+ +
+
+ + +
+
+

toDataURLHD

+ +
+ (
    +
  • + type +
  • +
) +
+ + + String + + + + + + + + +
+

+ Defined in + src/visual/canvas.js:125 +

+ + + +
+ +
+

Returns a "data:" URL containing a representation of the image (at the native resolution of the canvas).

+

Proxy of the native canvas method if exists. For more informations see:

+ + +
+ +
+

Parameters:

+ +
    +
  • + type + String + + +
    +

    The image format (optional, e.g: "image/png", "image/jpeg",..., default="image/png")

    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ String: +

The data URL

+ +
+
+ + +
+
+

transferControlToProxy

+ + () + + + + + + + + +
+

+ Defined in + src/visual/canvas.js:99 +

+ + + +
+ +
+

Gives back a proxy to allow the canvas to be used in another Worker.

+

Proxy of the native canvas method if exists. For more informations see:

+ + +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

canvas

+ HTMLElement + + + + + +
+

+ Defined in + src/visual/canvas.js:210 +

+ + +
+ +
+

The Canvas HTML Element.

+ +
+ + + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

height

+ Number +default 150 + + + + + +
+

+ Defined in + src/visual/canvas.js:194 +

+ + +
+ +
+

Canvas height.

+ +
+ + + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/visual/canvas.js:221 +

+ + +
+ +
+

Html outer element of the widget (if any).

+ +
+ +

Default: null

+ + +
+
+

interactiveNode

+ HTMLElement + + + + + +
+

+ Defined in + src/visual/canvas.js:233 +

+ + +
+ +
+

The interactive HTML element (for event managers).

+ +
+ + + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+

width

+ Number +default 300 + + + + + +
+

+ Defined in + src/visual/canvas.js:178 +

+ + +
+ +
+

Canvas width.

+ +
+ + + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.CheckBox.html b/ref/classes/photonui.CheckBox.html new file mode 100644 index 00000000..b7842f4e --- /dev/null +++ b/ref/classes/photonui.CheckBox.html @@ -0,0 +1,1947 @@ + + + + + photonui.CheckBox - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.CheckBox Class

+
+ +
+ Extends photonui.Widget +
+ + + + Module: Interactive
+ Parent Module: PhotonUI + +
+ + +
+

Checkbox.

+

wEvents:

+
    +
  • value-changed: +
      +
    • description: called when the value was modified.
    • +
    • callback: function(widget, value)
    • +
    +
  • +
+ +
+ +
+

Constructor

+
+

photonui.CheckBox

+ + () + + + + + + + + +
+

+ Defined in + src/interactive/checkbox.js:41 +

+ + + +
+ +
+ +
+ + + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onChange

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/interactive/checkbox.js:134 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onCheckboxClick

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/interactive/checkbox.js:158 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:445 +

+ + + +
+ +
+ Called when the context menu should be displayed. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:460 +

+ + + +
+ +
+ Called when the locale is changed. +
+ + + + +
+
+

__onSpanClick

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/interactive/checkbox.js:147 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onSpanKeyPress

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/interactive/checkbox.js:167 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/interactive/checkbox.js:108 +

+ + + +
+ +
+

Build the widget HTML.

+ +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:425 +

+ + + +
+ +
+ Called when the visibility changes. +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    +

    Current visibility state (otptional, defaut=this.visible)

    + +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/widget.js:367 +

+ + + +
+ +
+ Destroy the widget. +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/interactive/checkbox.js:90 +

+ + +
+ +
+

Html outer element of the widget (if any).

+ +
+ +

Default: null

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

value

+ Boolean + + + + + +
+

+ Defined in + src/interactive/checkbox.js:75 +

+ + +
+ +
+

The input value.

+ +
+ +

Default: false

+ + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.Color.html b/ref/classes/photonui.Color.html new file mode 100644 index 00000000..9c62442e --- /dev/null +++ b/ref/classes/photonui.Color.html @@ -0,0 +1,2941 @@ + + + + + photonui.Color - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.Color Class

+
+ +
+ Extends photonui.Base +
+ +
+ Defined in: src/nonvisual/color.js:194 +
+ + Module: NonVisual
+ Parent Module: PhotonUI + +
+ + +
+

Handle colors.

+

wEvents:

+
    +
  • value-changed: +
      +
    • description: the selected color changed.
    • +
    • callback: function(photonui.Color)
    • +
    +
  • +
+ +
+ +
+

Constructor

+
+

photonui.Color

+ +
+ (
    +
  • + +
  • +
) +
+ + + + + + + + +
+

+ Defined in + src/nonvisual/color.js:194 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + + Object + + multiple + +
    +

    An object that can contain any property of the Color class (optional).

    + +
    + +
  • +
+
+ + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateHSB

+ + () + + + + private + + + + + +
+

+ Defined in + src/nonvisual/color.js:937 +

+ + + +
+ +
+

Update HSB from RGB.

+ +
+ + + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_updateRGB

+ + () + + + + private + + + + + +
+

+ Defined in + src/nonvisual/color.js:978 +

+ + + +
+ +
+

Update RGB from HSB.

+ +
+ + + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:157 +

+ + + +
+ +
+ Destroy the class. +
+ + + + +
+
+

FormatToCssRgbaString

+ +
+ (
    +
  • + red +
  • +
  • + green +
  • +
  • + blue +
  • +
  • + alpha +
  • +
) +
+ + + String + + + + + + static + + + +
+

+ Defined in + src/nonvisual/color.js:501 +

+ + + +
+ +
+

Format an RGBA color to CSS RGBA string (e.g. rgba(255, 0, 0, 1.00)).

+ +
+ +
+

Parameters:

+ +
    +
  • + red + Number + + +
    +

    The red component

    + +
    + +
  • +
  • + green + Number + + +
    +

    The green component

    + +
    + +
  • +
  • + blue + Number + + +
    +

    The blue component

    + +
    + +
  • +
  • + alpha + Number + + +
    +

    The opacity of the color

    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ String: +

The formatted color string.

+ +
+
+ + +
+
+

FormatToCssRgbString

+ +
+ (
    +
  • + red +
  • +
  • + green +
  • +
  • + blue +
  • +
) +
+ + + String + + + + + + static + + + +
+

+ Defined in + src/nonvisual/color.js:487 +

+ + + +
+ +
+

Format an RGB color to CSS RGB string (e.g. rgb(255, 0, 0)).

+ +
+ +
+

Parameters:

+ +
    +
  • + red + Number + + +
    +

    The red component

    + +
    + +
  • +
  • + green + Number + + +
    +

    The green component

    + +
    + +
  • +
  • + blue + Number + + +
    +

    The blue component

    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ String: +

The formatted color string.

+ +
+
+ + +
+
+

FormatToRgbaHexString

+ +
+ (
    +
  • + red +
  • +
  • + green +
  • +
  • + blue +
  • +
  • + alpha +
  • +
) +
+ + + String + + + + + + static + + + +
+

+ Defined in + src/nonvisual/color.js:468 +

+ + + +
+ +
+

Format an RGBA color to hexadecimal RGBA string (e.g. #FF0000FF).

+ +
+ +
+

Parameters:

+ +
    +
  • + red + Number + + +
    +

    The red component

    + +
    + +
  • +
  • + green + Number + + +
    +

    The green component

    + +
    + +
  • +
  • + blue + Number + + +
    +

    The blue component

    + +
    + +
  • +
  • + alpha + Number + + +
    +

    The opacity of the color

    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ String: +

The formatted color string.

+ +
+
+ + +
+
+

FormatToRgbHexString

+ +
+ (
    +
  • + red +
  • +
  • + green +
  • +
  • + blue +
  • +
) +
+ + + String + + + + + + static + + + +
+

+ Defined in + src/nonvisual/color.js:442 +

+ + + +
+ +
+

Format an RGB color to hexadecimal RGB string (e.g. #FF0000).

+ +
+ +
+

Parameters:

+ +
    +
  • + red + Number + + +
    +

    The red component

    + +
    + +
  • +
  • + green + Number + + +
    +

    The green component

    + +
    + +
  • +
  • + blue + Number + + +
    +

    The blue component

    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ String: +

The formatted color string.

+ +
+
+ + +
+
+

fromString

+ +
+ (
    +
  • + color +
  • +
) +
+ + + + + + + + +
+

+ Defined in + src/nonvisual/color.js:827 +

+ + + +
+ +
+

Defines the color from any supported string format.

+ +
+ +
+

Parameters:

+ +
    +
  • + color + String + + +
    + +
    + +
  • +
+
+ + + +
+
+

getRGB

+ + () + + + Array + + + + + + + + +
+

+ Defined in + src/nonvisual/color.js:885 +

+ + + +
+ +
+

Get RGB.

+ +
+ + +
+

Returns:

+ +
+ Array: +

[red(0-255), green(0-255), blue(0-255)]

+ +
+
+ + +
+
+

getRGBA

+ + () + + + Array + + + + + + + + +
+

+ Defined in + src/nonvisual/color.js:895 +

+ + + +
+ +
+

Get RGBA.

+ +
+ + +
+

Returns:

+ +
+ Array: +

[red(0-255), green(0-255), blue(0-255), alpha(0-255)]

+ +
+
+ + +
+
+

NormalizeRgbaColor

+ +
+ (
    +
  • + red +
  • +
  • + green +
  • +
  • + blue +
  • +
  • + alpha +
  • +
) +
+ + + Array + + + + + + static + + + +
+

+ Defined in + src/nonvisual/color.js:535 +

+ + + +
+ +
+

Normalize an RGBA color.

+ +
+ +
+

Parameters:

+ +
    +
  • + red + Number + + +
    +

    The red component

    + +
    + +
  • +
  • + green + Number + + +
    +

    The green component

    + +
    + +
  • +
  • + blue + Number + + +
    +

    The blue component

    + +
    + +
  • +
  • + alpha + Number + + +
    +

    The opacity of the color

    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Array: +

The normalized array [r, g, b, a] where each component is an integer between 0-255.

+ +
+
+ + +
+
+

NormalizeRgbColor

+ +
+ (
    +
  • + red +
  • +
  • + green +
  • +
  • + blue +
  • +
) +
+ + + Array + + + + + + static + + + +
+

+ Defined in + src/nonvisual/color.js:517 +

+ + + +
+ +
+

Normalize an RGB color.

+ +
+ +
+

Parameters:

+ +
    +
  • + red + Number + + +
    +

    The red component

    + +
    + +
  • +
  • + green + Number + + +
    +

    The green component

    + +
    + +
  • +
  • + blue + Number + + +
    +

    The blue component

    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Array: +

The normalized array [r, g, b] where each component is an integer between 0-255.

+ +
+
+ + +
+
+

ParseCssRgbaString

+ +
+ (
    +
  • + color +
  • +
) +
+ + + Array + + + + + + static + + + +
+

+ Defined in + src/nonvisual/color.js:404 +

+ + + +
+ +
+

Converts a CSS RGBA color (e.g. rgba(255, 0, 0, 0.3)) to an [r, g, b, a] array.

+ +
+ +
+

Parameters:

+ +
    +
  • + color + String + + +
    +

    The CSS RGBA color

    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Array: +

[r, g, b, a] where each component is an integer between 0-255

+ +
+
+ + +
+
+

ParseCssRgbString

+ +
+ (
    +
  • + color +
  • +
) +
+ + + Array + + + + + + static + + + +
+

+ Defined in + src/nonvisual/color.js:372 +

+ + + +
+ +
+

Converts a CSS RGB color (e.g. rgb(255, 0, 0)) to an [r, g, b] array.

+ +
+ +
+

Parameters:

+ +
    +
  • + color + String + + +
    +

    The CSS RGB color

    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Array: +

[r, g, b] where each component is an integer between 0-255

+ +
+
+ + +
+
+

ParseNamedColor

+ +
+ (
    +
  • + color +
  • +
) +
+ + + Array + + + + + + static + + + +
+

+ Defined in + src/nonvisual/color.js:288 +

+ + + +
+ +
+

Converts a named color (e.g. "red") to an [r, g, b] array.

+ +
+ +
+

Parameters:

+ +
    +
  • + color + String + + +
    +

    The named color

    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Array: +

[r, g, b] where each component is an integer between 0-255

+ +
+
+ + +
+
+

ParseRgbaHexString

+ +
+ (
    +
  • + color +
  • +
) +
+ + + Array + + + + + + static + + + +
+

+ Defined in + src/nonvisual/color.js:337 +

+ + + +
+ +
+

Converts an hexadecimal RGBA color (e.g. #FF0000FF, #F00F) to an [r, g, b, a] array.

+ +
+ +
+

Parameters:

+ +
    +
  • + color + String + + +
    +

    The hexadecimal RGBA color

    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Array: +

[r, g, b, a] where each component is an integer between 0-255

+ +
+
+ + +
+
+

ParseRgbHexString

+ +
+ (
    +
  • + color +
  • +
) +
+ + + Array + + + + + + static + + + +
+

+ Defined in + src/nonvisual/color.js:304 +

+ + + +
+ +
+

Converts an hexadecimal RGB color (e.g. #FF0000, #F00) to an [r, g, b] array.

+ +
+ +
+

Parameters:

+ +
    +
  • + color + String + + +
    +

    The hexadecimal RGB color

    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Array: +

[r, g, b] where each component is an integer between 0-255

+ +
+
+ + +
+
+

ParseString

+ +
+ (
    +
  • + color +
  • +
) +
+ + + Array + + + + + + static + + + +
+

+ Defined in + src/nonvisual/color.js:242 +

+ + + +
+ +
+

Converts any supported color format to an [r, g, b, a] array.

+ +
+ +
+

Parameters:

+ +
    +
  • + color + String + + +
    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Array: +

[r, g, b, a] where each components is an integer between 0-255

+ +
+
+ + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

setHSB

+ +
+ (
    +
  • + hue +
  • +
  • + saturation +
  • +
  • + brightness +
  • +
) +
+ + + + + + + + +
+

+ Defined in + src/nonvisual/color.js:905 +

+ + + +
+ +
+

Set HSB color

+

The params can also be replaced by an array.

+ +
+ +
+

Parameters:

+ +
    +
  • + hue + Number + + +
    +

    (0-360)

    + +
    + +
  • +
  • + saturation + Number + + +
    +

    (0-100)

    + +
    + +
  • +
  • + brightness + Number + + +
    +

    (0-100)

    + +
    + +
  • +
+
+ + + +
+
+

setRGB

+ +
+ (
    +
  • + red +
  • +
  • + green +
  • +
  • + blue +
  • +
) +
+ + + + + + + + +
+

+ Defined in + src/nonvisual/color.js:841 +

+ + + +
+ +
+

Set RGB(A) color (alias for setRGBA).

+

The params can also be replaced by an array.

+ +
+ +
+

Parameters:

+ +
    +
  • + red + Number + + +
    +

    (0-255)

    + +
    + +
  • +
  • + green + Number + + +
    +

    (0-255)

    + +
    + +
  • +
  • + blue + Number + + +
    +

    (0-255)

    + +
    + +
  • +
+
+ + + +
+
+

setRGBA

+ +
+ (
    +
  • + red +
  • +
  • + green +
  • +
  • + blue +
  • +
  • + alpha +
  • +
) +
+ + + + + + + + +
+

+ Defined in + src/nonvisual/color.js:855 +

+ + + +
+ +
+

Set RGBA color.

+

The params can also be replaced by an array.

+ +
+ +
+

Parameters:

+ +
    +
  • + red + Number + + +
    +

    (0-255)

    + +
    + +
  • +
  • + green + Number + + +
    +

    (0-255)

    + +
    + +
  • +
  • + blue + Number + + +
    +

    (0-255)

    + +
    + +
  • +
  • + alpha + Number + + +
    +

    (optional, 0-255)

    + +
    + +
  • +
+
+ + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

alpha

+ Number + + + + + +
+

+ Defined in + src/nonvisual/color.js:753 +

+ + +
+ +
+

Alpha channel (0-255)

+ +
+ + + +
+
+

blue

+ Number + + + + + +
+

+ Defined in + src/nonvisual/color.js:736 +

+ + +
+ +
+

Blue (0-255).

+ +
+ + + +
+
+

brightness

+ Number + + + + + +
+

+ Defined in + src/nonvisual/color.js:804 +

+ + +
+ +
+

Brightness (0-100).

+ +
+ + + +
+
+

cssRgbaString

+ String + + + + + +
+

+ Defined in + src/nonvisual/color.js:684 +

+ + +
+ +
+

The color in CSS RGBA format (e.g. "rgb(255, 0, 0, 1.0)").

+ +
+ + + +
+
+

cssRgbString

+ String + + + + + +
+

+ Defined in + src/nonvisual/color.js:666 +

+ + +
+ +
+

The color in CSS RGB format (e.g. "rgb(255, 0, 0)").

+ +
+ + + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

green

+ Number + + + + + +
+

+ Defined in + src/nonvisual/color.js:719 +

+ + +
+ +
+

Green (0-255).

+ +
+ + + +
+
+

hexString

+ String + + deprecated + + + + +
+

+ Defined in + src/nonvisual/color.js:566 +

+ + +
+ +
+

The color in RGB hexadecimal format (e.g. "#FF0000").

+ +
+ + + +
+
+

hue

+ Number + + + + + +
+

+ Defined in + src/nonvisual/color.js:770 +

+ + +
+ +
+

Hue (0-360).

+ +
+ + + +
+
+

NAMED_COLORS

+ Object + + + + + static + +
+

+ Defined in + src/nonvisual/color.js:233 +

+ + +
+ +
+

Object containing all known named colors (colorName: [r, g, b]).

+ +
+ + + +
+
+

red

+ Number + + + + + +
+

+ Defined in + src/nonvisual/color.js:702 +

+ + +
+ +
+

Red (0-255).

+ +
+ + + +
+
+

rgbaHexString

+ String + + + + + +
+

+ Defined in + src/nonvisual/color.js:648 +

+ + +
+ +
+

The color in RGBA hexadecimal format (e.g. "#FF0000FF").

+ +
+ + + +
+
+

rgbaString

+ String + + deprecated + + + + +
+

+ Defined in + src/nonvisual/color.js:617 +

+ + +
+ +
+

The color in CSS RGBA format (e.g. "rgba(255, 0, 0, 1.0)").

+ +
+ + + +
+
+

rgbHexString

+ String + + + + + +
+

+ Defined in + src/nonvisual/color.js:630 +

+ + +
+ +
+

The color in RGB hexadecimal format (e.g. "#FF0000").

+ +
+ + + +
+
+

rgbString

+ String + + deprecated + + + + +
+

+ Defined in + src/nonvisual/color.js:604 +

+ + +
+ +
+

The color in CSS RGB format (e.g. "rgb(255, 0, 0)").

+ +
+ + + +
+
+

saturation

+ Number + + + + + +
+

+ Defined in + src/nonvisual/color.js:787 +

+ + +
+ +
+

Saturation (0-100).

+ +
+ + + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.ColorButton.html b/ref/classes/photonui.ColorButton.html new file mode 100644 index 00000000..359a6bbc --- /dev/null +++ b/ref/classes/photonui.ColorButton.html @@ -0,0 +1,2043 @@ + + + + + photonui.ColorButton - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.ColorButton Class

+
+ +
+ Extends photonui.Widget +
+ + + + Module: Composite
+ Parent Module: PhotonUI + +
+ + +
+

Color Button.

+

wEvents:

+
    +
  • value-changed: +
      +
    • description: the selected color changed.
    • +
    • callback: function(widget, color)
    • +
    +
  • +
+ +
+ +
+

Constructor

+
+

photonui.ColorButton

+ + () + + + + + + + + +
+

+ Defined in + src/composite/colorbutton.js:47 +

+ + + +
+ +
+ +
+ + + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onButtonClicked

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/composite/colorbutton.js:212 +

+ + + +
+ +
+

Called when the button is clicked.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onColorChanged

+ + () + + + + private + + + + + +
+

+ Defined in + src/composite/colorbutton.js:241 +

+ + + +
+ +
+ +
+ + + + +
+
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:445 +

+ + + +
+ +
+ Called when the context menu should be displayed. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onCustomButtonClicked

+ + () + + + + private + + + + + +
+

+ Defined in + src/composite/colorbutton.js:250 +

+ + + +
+ +
+ +
+ + + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:460 +

+ + + +
+ +
+ Called when the locale is changed. +
+ + + + +
+
+

__onPaletteValueChanged

+ +
+ (
    +
  • + widget +
  • +
  • + color +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/composite/colorbutton.js:229 +

+ + + +
+ +
+

Called when the palette color change.

+ +
+ +
+

Parameters:

+ + +
+ + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/composite/colorbutton.js:159 +

+ + + +
+ +
+

Build the widget HTML.

+ +
+ + + + +
+
+

_buildUi

+ + () + + + + private + + + + + +
+

+ Defined in + src/composite/colorbutton.js:176 +

+ + + +
+ +
+

Make the UI.

+ +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_update

+ + () + + + + private + + + + + +
+

+ Defined in + src/composite/colorbutton.js:149 +

+ + + +
+ +
+

Update the button content

+ +
+ + + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:425 +

+ + + +
+ +
+ Called when the visibility changes. +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    + Current visibility state (otptional, defaut=this.visible) +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/widget.js:367 +

+ + + +
+ +
+ Destroy the widget. +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

color

+ photonui.Color + + + + + +
+

+ Defined in + src/composite/colorbutton.js:91 +

+ + +
+ +
+

The color.

+ +
+ + + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

dialogOnly

+ Boolean + + + + + +
+

+ Defined in + src/composite/colorbutton.js:119 +

+ + +
+ +
+

Display only the color picker dialog instead of showing the palette first.

+ +
+ +

Default: false

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:262 +

+ + +
+ +
+ Html outer element of the widget (if any). +
+ +

Default: null

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

value

+ String + + + + + +
+

+ Defined in + src/composite/colorbutton.js:77 +

+ + +
+ +
+

The value (color in rgb hexadecimal format (e.g. "#ff0000")).

+ +
+ + + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.ColorPalette.html b/ref/classes/photonui.ColorPalette.html new file mode 100644 index 00000000..632c9391 --- /dev/null +++ b/ref/classes/photonui.ColorPalette.html @@ -0,0 +1,1800 @@ + + + + + photonui.ColorPalette - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.ColorPalette Class

+
+ +
+ Extends photonui.Widget +
+ + + + Module: Interactive
+ Parent Module: PhotonUI + +
+ + +
+

A Color Palette.

+

wEvents:

+
    +
  • value-changed: +
      +
    • description: the selected color changed.
    • +
    • callback: function(widget, color)
    • +
    +
  • +
+ +
+ +
+

Constructor

+
+

photonui.ColorPalette

+ +
+ (
    +
  • + params +
  • +
) +
+ + + + + + + + +
+

+ Defined in + src/interactive/colorpalette.js:43 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + params + Object + + +
    +

    An object that can contain any property of the widget (optional).

    + +
    + +
  • +
+
+ + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:445 +

+ + + +
+ +
+ Called when the context menu should be displayed. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:460 +

+ + + +
+ +
+ Called when the locale is changed. +
+ + + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/interactive/colorpalette.js:166 +

+ + + +
+ +
+

Build the widget HTML.

+ +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:425 +

+ + + +
+ +
+ Called when the visibility changes. +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    +

    Current visibility state (otptional, defaut=this.visible)

    + +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/widget.js:367 +

+ + + +
+ +
+ Destroy the widget. +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

color

+ photonui.Color + + + + + +
+

+ Defined in + src/interactive/colorpalette.js:87 +

+ + +
+ +
+

The color.

+ +
+ + + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/interactive/colorpalette.js:148 +

+ + +
+ +
+

Html outer element of the widget (if any).

+ +
+ +

Default: null

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

palette

+ Array + + + + + +
+

+ Defined in + src/interactive/colorpalette.js:105 +

+ + +
+ +
+

The color palette.

+ +
+ +

Default: null (= `Color.palette`)

+ + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

value

+ String + + + + + +
+

+ Defined in + src/interactive/colorpalette.js:72 +

+ + +
+ +
+

The value (color in rgb hexadecimal format (e.g. "#ff0000")).

+ +
+ + + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.ColorPicker.html b/ref/classes/photonui.ColorPicker.html new file mode 100644 index 00000000..ea6bf361 --- /dev/null +++ b/ref/classes/photonui.ColorPicker.html @@ -0,0 +1,2769 @@ + + + + + photonui.ColorPicker - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.ColorPicker Class

+
+ +
+ Extends photonui.Widget +
+ + + + Module: Interactive
+ Parent Module: PhotonUI + +
+ + +
+

A Color Picker.

+

wEvents:

+
    +
  • value-changed: +
      +
    • description: the selected color changed.
    • +
    • callback: function (widget, color)
    • +
    +
  • +
+

value-changed-final: +- description: called when the value is no more modified after continuous changes +- callback: function (widget, color)

+ +
+ +
+

Constructor

+
+

photonui.ColorPicker

+ +
+ (
    +
  • + params +
  • +
) +
+ + + + + + + + +
+

+ Defined in + src/interactive/colorpicker.js:44 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + params + Object + + +
    +

    An object that can contain any property of the widget (optional).

    + +
    + +
  • +
+
+ + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:445 +

+ + + +
+ +
+ Called when the context menu should be displayed. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onDragEnd

+ +
+ (
    +
  • + manager +
  • +
  • + mstate +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/interactive/colorpicker.js:509 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ + +
+ + + +
+
+

__onDraggingCircle

+ +
+ (
    +
  • + manager +
  • +
  • + mstate +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/interactive/colorpicker.js:498 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ + +
+ + + +
+
+

__onDraggingSquare

+ +
+ (
    +
  • + manager +
  • +
  • + mstate +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/interactive/colorpicker.js:486 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ + +
+ + + +
+
+

__onDragStart

+ +
+ (
    +
  • + manager +
  • +
  • + mstate +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/interactive/colorpicker.js:469 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ + +
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:460 +

+ + + +
+ +
+ Called when the locale is changed. +
+ + + + +
+
+

__onMouseDown

+ +
+ (
    +
  • + manager +
  • +
  • + mstate +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/interactive/colorpicker.js:440 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ + +
+ + + +
+
+

__onMouseMove

+ +
+ (
    +
  • + manager +
  • +
  • + mstate +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/interactive/colorpicker.js:426 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ + +
+ + + +
+
+

__onMouseUp

+ +
+ (
    +
  • + manager +
  • +
  • + mstate +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/interactive/colorpicker.js:459 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ + +
+ + + +
+
+

__onValueChanged

+ + () + + + + private + + + + + +
+

+ Defined in + src/interactive/colorpicker.js:521 +

+ + + +
+ +
+ +
+ + + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/interactive/colorpicker.js:207 +

+ + + +
+ +
+

Build the widget HTML.

+ +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_pointerAngle

+ +
+ (
    +
  • + mstate +
  • +
) +
+ + + Number + + + + private + + + + + +
+

+ Defined in + src/interactive/colorpicker.js:398 +

+ + + +
+ +
+

the angle of the pointer with the horizontal line that pass by the center of the hue circle.

+ +
+ +
+

Parameters:

+ +
    +
  • + mstate + Object + + +
    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Number: +

the angle in degree.

+ +
+
+ + +
+
+

_pointerOnCircle

+ +
+ (
    +
  • + mstate +
  • +
) +
+ + + Boolean + + + + private + + + + + +
+

+ Defined in + src/interactive/colorpicker.js:383 +

+ + + +
+ +
+

Is the pointer on the hue circle?

+ +
+ +
+

Parameters:

+ +
    +
  • + mstate + Object + + +
    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Boolean: +
+
+ + +
+
+

_pointerOnSquare

+ +
+ (
    +
  • + mstate +
  • +
) +
+ + + Boolean + + + + private + + + + + +
+

+ Defined in + src/interactive/colorpicker.js:371 +

+ + + +
+ +
+

Is the pointer on the SB Square?

+ +
+ +
+

Parameters:

+ +
    +
  • + mstate + Object + + +
    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Boolean: +
+
+ + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateCanvas

+ + () + + + + private + + + + + +
+

+ Defined in + src/interactive/colorpicker.js:331 +

+ + + +
+ +
+

Update the canvas

+ +
+ + + + +
+
+

_updateH

+ + () + + + + private + + + + + +
+

+ Defined in + src/interactive/colorpicker.js:233 +

+ + + +
+ +
+

Update hue circle

+ +
+ + + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_updateSB

+ + () + + + + private + + + + + +
+

+ Defined in + src/interactive/colorpicker.js:296 +

+ + + +
+ +
+

Update saturation/brightness square

+ +
+ + + + +
+
+

_updateSBmask

+ + () + + + + private + + + + + +
+

+ Defined in + src/interactive/colorpicker.js:262 +

+ + + +
+ +
+

Update saturation/brightness square mask

+ +
+ + + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:425 +

+ + + +
+ +
+ Called when the visibility changes. +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    +

    Current visibility state (otptional, defaut=this.visible)

    + +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/widget.js:367 +

+ + + +
+ +
+ Destroy the widget. +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+ +
+

Properties

+ +
+

__buffH

+ HTMLCanvasElement + + + private + + + +
+

+ Defined in + src/interactive/colorpicker.js:160 +

+ + +
+ +
+

Buffer canvas for hue circle.

+ +
+ + + +
+
+

__buffSB

+ HTMLCanvasElement + + + private + + + +
+

+ Defined in + src/interactive/colorpicker.js:169 +

+ + +
+ +
+

Buffer canvas for saturation/brightness square.

+ +
+ + + +
+
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__disableSBUpdate

+ Boolean + + + private + + + +
+

+ Defined in + src/interactive/colorpicker.js:187 +

+ + +
+ +
+

FLAG: Disable SB square update.

+ +
+ +

Default: false

+ + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

__mouseManager

+ photonui.MouseManager + + + private + + + +
+

+ Defined in + src/interactive/colorpicker.js:178 +

+ + +
+ +
+

Mouse manager.

+ +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

color

+ photonui.Color + + + + + +
+

+ Defined in + src/interactive/colorpicker.js:116 +

+ + +
+ +
+

The color.

+ +
+ + + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/interactive/colorpicker.js:146 +

+ + +
+ +
+

Html outer element of the widget (if any).

+ +
+ +

Default: null

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

value

+ String + + + + + +
+

+ Defined in + src/interactive/colorpicker.js:100 +

+ + +
+ +
+

The value (color in rgb hexadecimal format (e.g. "#ff0000")).

+ +
+ + + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.ColorPickerDialog.html b/ref/classes/photonui.ColorPickerDialog.html new file mode 100644 index 00000000..587c212e --- /dev/null +++ b/ref/classes/photonui.ColorPickerDialog.html @@ -0,0 +1,3459 @@ + + + + + photonui.ColorPickerDialog - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.ColorPickerDialog Class

+
+ +
+ Extends photonui.Dialog +
+ + + + Module: Composite
+ Parent Module: PhotonUI + +
+ + +
+

Color Picker Dialog.

+

wEvents:

+
    +
  • value-changed: +
      +
    • description: the selected color changed.
    • +
    • callback: function(widget, color)
    • +
    +
  • +
+ +
+ +
+

Constructor

+
+

photonui.ColorPickerDialog

+ + () + + + + + + + + +
+

+ Defined in + src/composite/colorpickerdialog.js:52 +

+ + + +
+ +
+ +
+ + + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__internalDragging

+ +
+ (
    +
  • + offsetX +
  • +
  • + offsetY +
  • +
  • + pageX +
  • +
  • + pageY +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Window: + src/container/window.js:372 +

+ + + +
+ +
+ Move the window. +
+ +
+

Parameters:

+ +
    +
  • + offsetX + Number + + +
    + +
    + +
  • +
  • + offsetY + Number + + +
    + +
    + +
  • +
  • + pageX + Number + + +
    + +
    + +
  • +
  • + pageY + Number + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onCancel

+ + () + + + + private + + + + + +
+

+ Defined in + src/composite/colorpickerdialog.js:369 +

+ + + +
+ +
+ +
+ + + + +
+
+

__onColorChanged

+ + () + + + + private + + + + + +
+

+ Defined in + src/composite/colorpickerdialog.js:396 +

+ + + +
+ +
+ +
+ + + + +
+
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:445 +

+ + + +
+ +
+ Called when the context menu should be displayed. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/container/window.js:477 +

+ + + +
+ +
+ Called when the locale is changed. +
+ + + + +
+
+

__onValidate

+ + () + + + + private + + + + + +
+

+ Defined in + src/composite/colorpickerdialog.js:382 +

+ + + +
+ +
+ +
+ + + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/container/dialog.js:214 +

+ + + +
+ +
+ Build the widget HTML. +
+ + + + +
+
+

_buildUi

+ + () + + + + private + + + + + +
+

+ Defined in + src/composite/colorpickerdialog.js:151 +

+ + + +
+ +
+

Make the UI.

+ +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_closeButtonClicked

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Window: + src/container/window.js:466 +

+ + + +
+ +
+ Close button clicked. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

_moveDragEnd

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Window: + src/container/window.js:359 +

+ + + +
+ +
+ Stop moving the window. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

_moveDragging

+ +
+ (
    +
  • + offsetX +
  • +
  • + offsetY +
  • +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Window: + src/container/window.js:346 +

+ + + +
+ +
+ Move the window. +
+ +
+

Parameters:

+ +
    +
  • + offsetX + Number + + +
    + +
    + +
  • +
  • + offsetY + Number + + +
    + +
    + +
  • +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

_moveDragStart

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Window: + src/container/window.js:328 +

+ + + +
+ +
+ Start moving the window. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

_moveTouchEnd

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + + photonui.Window + + but overwritten in + src/container/window.js:429 +

+ + + +
+ +
+ Stop moving the window. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

_moveTouchMove

+ +
+ (
    +
  • + offsetX +
  • +
  • + offsetY +
  • +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Window: + src/container/window.js:415 +

+ + + +
+ +
+ Move the window. +
+ +
+

Parameters:

+ +
    +
  • + offsetX + Number + + +
    + +
    + +
  • +
  • + offsetY + Number + + +
    + +
    + +
  • +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

_moveTouchStart

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Window: + src/container/window.js:392 +

+ + + +
+ +
+ Start moving the window. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateButtons

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Dialog: + src/container/dialog.js:200 +

+ + + +
+ +
+ Update dialog buttons. +
+ + + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_updateUi

+ + () + + + + private + + + + + +
+

+ Defined in + src/composite/colorpickerdialog.js:349 +

+ + + +
+ +
+

Update the fields of the UI.

+ +
+ + + + +
+
+

_updateWindowList

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Window: + src/container/window.js:303 +

+ + + +
+ +
+ Update all the windows. +
+ + + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/container/dialog.js:229 +

+ + + +
+ +
+ Called when the visibility changes. +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    + Current visibility state (otptional, defaut=this.visible) +
    + +
  • +
+
+ + + +
+
+

addButton

+ +
+ (
    +
  • + widget +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Dialog: + src/container/dialog.js:144 +

+ + + +
+ +
+ Add a button to the dialog. +
+ +
+

Parameters:

+ + +
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

center

+ + () + + + + + + + + +
+

Inherited from + photonui.BaseWindow: + src/container/basewindow.js:340 +

+ + + +
+ +
+ Center the window. +
+ + + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/container/dialog.js:183 +

+ + + +
+ +
+ Destroy the widget. +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

moveToBack

+ + () + + + + + + + + +
+

Inherited from + photonui.Window: + src/container/window.js:243 +

+ + + +
+ +
+ Bring the window to the back. +
+ + + + +
+
+

moveToFront

+ + () + + + + + + + + +
+

Inherited from + photonui.Window: + src/container/window.js:229 +

+ + + +
+ +
+ Bring the window to front. +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeButton

+ +
+ (
    +
  • + widget +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Dialog: + src/container/dialog.js:162 +

+ + + +
+ +
+ Remove a button from the dialog. +
+ +
+

Parameters:

+ + +
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeChild

+ +
+ (
    +
  • + widget +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:182 +

+ + + +
+ +
+ Remove the given child. +
+ +
+

Parameters:

+ + +
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

buttons

+ Array + + + + + +
+

Inherited from + photonui.Dialog: + src/container/dialog.js:109 +

+ + +
+ +
+ Dialog buttons widgets. +
+ +

Default: []

+ + +
+
+

buttonsNames

+ Array + + + + + +
+

Inherited from + photonui.Dialog: + src/container/dialog.js:72 +

+ + +
+ +
+ Dialog button widgets name. +
+ +

Default: []

+ + +
+
+

child

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:146 +

+ + +
+ +
+ The child widget. +
+ +

Default: null (no child)

+ + +
+
+

childName

+ String + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:118 +

+ + +
+ +
+ The child widget name. +
+ +

Default: null (no child)

+ + +
+
+

closeButtonVisible

+ Boolean +default: true + + + + + +
+

Inherited from + photonui.Window: + src/container/window.js:144 +

+ + +
+ +
+ Determine if the close button in the title bar is displayed or not. +
+ + + +
+
+

color

+ photonui.Color + + + + + +
+

+ Defined in + src/composite/colorpickerdialog.js:92 +

+ + +
+ +
+

The color.

+ +
+ + + +
+
+

containerNode

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Container + + but overwritten in + src/container/window.js:197 +

+ + +
+ +
+ HTML Element that contain the child widget HTML. +
+ + + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

fullscreen

+ Boolean + + + + + +
+

Inherited from + photonui.Window: + src/container/window.js:122 +

+ + +
+ +
+ Fullscreen Window +
+ +

Default: false

+ + +
+
+

height

+ Number + + + + + + + +
+ Height of the container node. +
+ +

Default: : null (auto)

+ + +
+
+

horizontalChildExpansion

+ Boolean + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:66 +

+ + +
+ +
+ Horizontaly expand the container's child widget. +
+ +

Default: true

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/container/basewindow.js:311 +

+ + +
+ +
+ Html outer element of the widget (if any). +
+ +

Default: null

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

maxHeight

+ Number + + + + + + + +
+ Maximum height of the container node. +
+ +

Default: : null (no maximum)

+ + +
+
+

maxWidth

+ Number + + + + + + + +
+ Maximum width of the container node. +
+ +

Default: : null (no maximum)

+ + +
+
+

minHeight

+ Number + + + + + + + +
+ Minimum height of the container node. +
+ +

Default: : null (no minimum)

+ + +
+
+

minWidth

+ Number + + + + + + + +
+ Minimum width of the container node. +
+ +

Default: : null (no minimum)

+ + +
+
+

modal

+ Boolean + + + + + +
+

Inherited from + photonui.Window: + src/container/window.js:170 +

+ + +
+ +
+ Modal window? +
+ +

Default: false

+ + +
+
+

movable

+ Boolean + + + + + +
+

Inherited from + photonui.Window: + src/container/window.js:105 +

+ + +
+ +
+ Determine if the window can be moved (drag & drop) by the user. +
+ +

Default: true

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

padding

+ Number + + + + + + + +
+ Window container node padding. +
+ +

Default: 0

+ + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

position

+ Object + + + + + +
+

Inherited from + photonui.BaseWindow: + src/container/basewindow.js:78 +

+ + +
+ +
+ Window position. + + {x: Number, y: Number} +
+ +

Default: {x: 0, y: 0}

+ + +
+
+

title

+ String + + + + + +
+

Inherited from + photonui.Window: + src/container/window.js:85 +

+ + +
+ +
+ The window title. +
+ +

Default: "Window"

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

value

+ String + + + + + +
+

+ Defined in + src/composite/colorpickerdialog.js:117 +

+ + +
+ +
+

The color as hex string (shorthand to ColorPickerDialog.color.rgbHexString).

+ +
+ + + +
+
+

verticalChildExpansion

+ Boolean + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:92 +

+ + +
+ +
+ Verticaly expand the container's child widget. +
+ +

Default: false

+ + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+

width

+ Number + + + + + + + +
+ Width of the container node. +
+ +

Default: : null (auto)

+ + +
+
+

x

+ Number + + + + + + + +
+ The X position of the Window. +
+ +

Default: 0

+ + +
+
+

y

+ Number + + + + + + + +
+ The Y position of the Window. +
+ +

Default: 0

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.Container.html b/ref/classes/photonui.Container.html new file mode 100644 index 00000000..2e3f02be --- /dev/null +++ b/ref/classes/photonui.Container.html @@ -0,0 +1,1884 @@ + + + + + photonui.Container - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.Container Class

+
+ +
+ Extends photonui.Widget +
+ + + + Module: Container
+ Parent Module: PhotonUI + +
+ + +
+

Base class for container widgets.

+ +
+ +
+

Constructor

+
+

photonui.Container

+ + () + + + + + + + + +
+

+ Defined in + src/container/container.js:41 +

+ + + +
+ +
+ +
+ + + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:445 +

+ + + +
+ +
+ Called when the context menu should be displayed. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:460 +

+ + + +
+ +
+ Called when the locale is changed. +
+ + + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:415 +

+ + + +
+ +
+ Build the widget HTML. +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/container/container.js:208 +

+ + + +
+ +
+

Called when the visibility changes.

+ +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    +

    Current visibility state (otptional, defaut=this.visible)

    + +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/container/container.js:194 +

+ + + +
+ +
+

Destroy the widget.

+ +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeChild

+ +
+ (
    +
  • + widget +
  • +
) +
+ + + + + + + + +
+

+ Defined in + src/container/container.js:182 +

+ + + +
+ +
+

Remove the given child.

+ +
+ +
+

Parameters:

+ + +
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

child

+ photonui.Widget + + + + + +
+

+ Defined in + src/container/container.js:146 +

+ + +
+ +
+

The child widget.

+ +
+ +

Default: null (no child)

+ + +
+
+

childName

+ String + + + + + +
+

+ Defined in + src/container/container.js:118 +

+ + +
+ +
+

The child widget name.

+ +
+ +

Default: null (no child)

+ + +
+
+

containerNode

+ HTMLElement + + + + + +
+

+ Defined in + src/container/container.js:165 +

+ + +
+ +
+

HTML Element that contain the child widget HTML.

+ +
+ + + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

horizontalChildExpansion

+ Boolean + + + + + +
+

+ Defined in + src/container/container.js:66 +

+ + +
+ +
+

Horizontaly expand the container's child widget.

+ +
+ +

Default: true

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:262 +

+ + +
+ +
+ Html outer element of the widget (if any). +
+ +

Default: null

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

verticalChildExpansion

+ Boolean + + + + + +
+

+ Defined in + src/container/container.js:92 +

+ + +
+ +
+

Verticaly expand the container's child widget.

+ +
+ +

Default: false

+ + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.DataView.html b/ref/classes/photonui.DataView.html new file mode 100644 index 00000000..211bc389 --- /dev/null +++ b/ref/classes/photonui.DataView.html @@ -0,0 +1,3760 @@ + + + + + photonui.DataView - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.DataView Class

+
+ +
+ Extends photonui.Widget +
+ +
+ Defined in: src/dataview/dataview.js:44 +
+ + Module: DataView
+ Parent Module: PhotonUI + +
+ + +
+

DataView container.

+

wEvents:

+
    +
  • +

    item-click:

    +
      +
    • description: called when an item is clicked.
    • +
    • callback: function (event, item)
    • +
    +
  • +
  • +

    item-select:

    +
      +
    • description: called when an item is selected.
    • +
    • callback: function (item)
    • +
    +
  • +
  • +

    item-unselect:

    +
      +
    • description: called when an item is unselected.
    • +
    • callback: function (item)
    • +
    +
  • +
  • +

    item-sort:

    +
      +
    • description: called when an item is moved to a new position.
    • +
    • callback: function (item, position)
    • +
    +
  • +
+ +
+ +
+

Constructor

+
+

photonui.DataView

+ + () + + + + + + + + +
+

+ Defined in + src/dataview/dataview.js:44 +

+ + + +
+ +
+ +
+ + + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onClick

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/dataview/dataview.js:861 +

+ + + +
+ +
+

Called when an element is clicked.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    +

    the click event

    + +
    + +
  • +
+
+ + + +
+
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:445 +

+ + + +
+ +
+ Called when the context menu should be displayed. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onDragEnd

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/dataview/dataview.js:970 +

+ + + +
+ +
+

Called when a item drag has ended.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onDragEnter

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/dataview/dataview.js:935 +

+ + + +
+ +
+

Called when a dragged item enters into another element.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onDragOver

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/dataview/dataview.js:1000 +

+ + + +
+ +
+

Called when a item is dragged (fix for firefox).

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onDragStart

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/dataview/dataview.js:903 +

+ + + +
+ +
+

Called when an item is dragged.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onDrop

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/dataview/dataview.js:1016 +

+ + + +
+ +
+

Called when a item is dropped (fix for firefox).

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onItemClick

+ +
+ (
    +
  • + event +
  • +
  • + item +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/dataview/dataview.js:885 +

+ + + +
+ +
+

Called when an item is clicked.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    +

    the click event

    + +
    + +
  • +
  • + item + Item + + +
    +

    the clicked item

    + +
    + +
  • +
+
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/dataview/dataview.js:1032 +

+ + + +
+ +
+

Called when the locale is changed.

+ +
+ + + + +
+
+

_addIdentifiersClasses

+ +
+ (
    +
  • + node +
  • +
  • + suffix +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/dataview/dataview.js:662 +

+ + + +
+ +
+

Adds classes defined by the identifiers property to a given element, with +a given suffix.

+ +
+ +
+

Parameters:

+ +
    +
  • + node + Element + + +
    +

    the node

    + +
    + +
  • +
  • + suffix + String + + +
    +

    the suffix of the classes

    + +
    + +
  • +
+
+ + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_buildContainerHtml

+ + () + + + + private + + + + + +
+

+ Defined in + src/dataview/dataview.js:505 +

+ + + +
+ +
+

Build the widget container HTML.

+ +
+ + + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/dataview/dataview.js:495 +

+ + + +
+ +
+

Build the widget HTML.

+ +
+ + + + +
+
+

_buildItemsHtml

+ + () + + + + private + + + + + +
+

+ Defined in + src/dataview/dataview.js:519 +

+ + + +
+ +
+

Build the items list HTML.

+ +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_empty

+ + () + + + + private + + + + + +
+

+ Defined in + src/dataview/dataview.js:446 +

+ + + +
+ +
+

Destroy all children of the layout

+ +
+ + + + +
+
+

_generateColumns

+ + () + + + + private + + + + + +
+

+ Defined in + src/dataview/dataview.js:632 +

+ + + +
+ +
+

Generate the list of columns.

+ +
+ + + + +
+
+

_generatePlaceholderElement

+ + () + + + Element + + + + private + + + + + +
+

+ Defined in + src/dataview/dataview.js:833 +

+ + + +
+ +
+

Generates a placeholder item element.

+ +
+ + +
+

Returns:

+ +
+ Element: +

the placeholder item element

+ +
+
+ + +
+
+

_getChildren

+ + () + + + Array + + + + private + + + + + +
+

+ Defined in + src/dataview/dataview.js:462 +

+ + + +
+ +
+

Layout children widgets.

+ +
+ + +
+

Returns:

+ +
+ Array: +

the childen widget

+ +
+
+ + +
+
+

_getItemByIndex

+ +
+ (
    +
  • + index +
  • +
) +
+ + + Object + + + + private + + + + + +
+

+ Defined in + src/dataview/dataview.js:481 +

+ + + +
+ +
+

Returns the item at a given index.

+ +
+ +
+

Parameters:

+ +
    +
  • + index + Number + + +
    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Object: +

the item

+ +
+
+ + +
+
+

_getItemFromNode

+ +
+ (
    +
  • + itemNode +
  • +
) +
+ + + Object + + + + private + + + + + +
+

+ Defined in + src/dataview/dataview.js:751 +

+ + + +
+ +
+

Gets an item of the collection from a given item DOM element.

+ +
+ +
+

Parameters:

+ +
    +
  • + itemNode + Element + + +
    +

    the item DOM element

    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Object: +

the item

+ +
+
+ + +
+
+

_handleClick

+ +
+ (
    +
  • + item +
  • +
  • + modifiers +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/dataview/dataview.js:782 +

+ + + +
+ +
+

Handle item click events.

+ +
+ +
+

Parameters:

+ +
    +
  • + item + Object + + +
    +

    the item

    + +
    + +
  • +
  • + modifiers + Object + + +
    +

    the modifiers states

    + +
    + +
      +
    • + ctrl + Object + +
      + +
      + +
    • +
    • + shift + Object + +
      + +
      + +
    • +
    +
  • +
+
+ + + +
+
+

_moveItem

+ +
+ (
    +
  • + itemIndex +
  • +
  • + destinationIndex +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/dataview/dataview.js:764 +

+ + + +
+ +
+

Moves the item at a givent index to another given index. Rebuilds the +dataview.

+ +
+ +
+

Parameters:

+ +
    +
  • + itemIndex + Number + + +
    +

    the index of the item to move

    + +
    + +
  • +
  • + destinationIndex + Number + + +
    +

    the destination index

    + +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_renderColumn

+ +
+ (
    +
  • + content +
  • +
  • + columnId +
  • +
) +
+ + + Element + + + + private + + + + + +
+

+ Defined in + src/dataview/dataview.js:602 +

+ + + +
+ +
+

Renders a given column.

+ +
+ +
+

Parameters:

+ +
    +
  • + content + photonui.Widget | String + + +
    +

    the content of the column

    + +
    + +
  • +
  • + columnId + String + + +
    +

    the identifier of the column

    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Element: +

the rendered column

+ +
+
+ + +
+
+

_renderItem

+ +
+ (
    +
  • + item +
  • +
) +
+ + + Element + + + + private + + + + + +
+

+ Defined in + src/dataview/dataview.js:551 +

+ + + +
+ +
+

Renders a given item.

+ +
+ +
+

Parameters:

+ +
    +
  • + item + Object + + +
    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Element: +

the rendered item

+ +
+
+ + +
+
+

_renderItemInner

+ +
+ (
    +
  • + itemNode +
  • +
  • + item +
  • +
) +
+ + + Element + + + + private + + + + + +
+

+ Defined in + src/dataview/dataview.js:579 +

+ + + +
+ +
+

Renders all the columns of a given item.

+ +
+ +
+

Parameters:

+ +
    +
  • + itemNode + Element + + +
    +

    the container element of the item

    + +
    + +
  • +
  • + item + Object + + +
    +

    the rendered item

    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Element: +

the rendered item

+ +
+
+ + +
+
+

_selectItem

+ +
+ (
    +
  • + item +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/dataview/dataview.js:686 +

+ + + +
+ +
+

Selects an item.

+ +
+ +
+

Parameters:

+ +
    +
  • + item + Object + + +
    +

    the item

    + +
    + +
  • +
+
+ + + +
+
+

_selectItemsTo

+ +
+ (
    +
  • + item +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/dataview/dataview.js:718 +

+ + + +
+ +
+

Selects all items from the current selection to a given item.

+ +
+ +
+

Parameters:

+ +
    +
  • + item + Object + + +
    +

    the item

    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_unselectItem

+ +
+ (
    +
  • + item +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/dataview/dataview.js:702 +

+ + + +
+ +
+

Unselects an item.

+ +
+ +
+

Parameters:

+ +
    +
  • + item + Object + + +
    +

    the item

    + +
    + +
  • +
+
+ + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:425 +

+ + + +
+ +
+ Called when the visibility changes. +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    +

    Current visibility state (otptional, defaut=this.visible)

    + +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/dataview/dataview.js:388 +

+ + + +
+ +
+

Destroy the widget.

+ +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

selectItems

+ +
+ (
    +
  • + indexes +
  • +
) +
+ + + + + + + + +
+

+ Defined in + src/dataview/dataview.js:398 +

+ + + +
+ +
+

Selects the item(s) at given indexes.

+ +
+ +
+

Parameters:

+ +
    +
  • + indexes + ...Number | Number[] + + +
    + +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+

unselectAllItems

+ + () + + + + private + + + + + +
+

+ Defined in + src/dataview/dataview.js:739 +

+ + + +
+ +
+

Unselects all items.

+ +
+ + + + +
+
+

unselectItems

+ +
+ (
    +
  • + indexes +
  • +
) +
+ + + + + + + + +
+

+ Defined in + src/dataview/dataview.js:421 +

+ + + +
+ +
+

Unselects the item(s) at given indexes.

+ +
+ +
+

Parameters:

+ +
    +
  • + indexes + ...Number | Number[] + + +
    + +
    + +
  • +
+
+ + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

allowShiftSelect

+ Boolean + + + + + +
+

+ Defined in + src/dataview/dataview.js:215 +

+ + +
+ +
+

If true, allow selecting multiple items with one click when pressing +"shift" key. +Only used when "multiSelectable" option is set to "true".

+ +
+ +

Default: true

+ + +
+
+

columnElement

+ String + + + + + +
+

+ Defined in + src/dataview/dataview.js:346 +

+ + +
+ +
+

The type of the columns DOM elements which will be created during the +render process.

+ +
+ +

Default: "span"

+ + +
+
+

columns

+ Array + + + + + +
+

+ Defined in + src/dataview/dataview.js:277 +

+ + +
+ +
+

The list of columns which defines the structure of the items (if not +setted manually, the columns are automatically generated).

+ +
+ +

Default: null

+ + +
+
+

containerElement

+ String + + + + + +
+

+ Defined in + src/dataview/dataview.js:314 +

+ + +
+ +
+

The type of the container DOM element which will be created during the +render process.

+ +
+ +

Default: "ul"

+ + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

customWidgetFormater

+ Function + + + + + +
+

+ Defined in + src/dataview/dataview.js:247 +

+ + +
+ +
+

A custom formater function which overrides the default rendering process +of the widget.

+ +
+ +

Default: null

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

dragAndDroppable

+ Boolean + + + + + +
+

+ Defined in + src/dataview/dataview.js:232 +

+ + +
+ +
+

Defines if the data items can be drag & dropped.

+ +
+ +

Default: false

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/dataview/dataview.js:302 +

+ + +
+ +
+

Html outer element of the widget (if any).

+ +
+ +

Default: null

+ + +
+
+

identifiers

+ Array + + + private + + + +
+

+ Defined in + src/dataview/dataview.js:362 +

+ + +
+ +
+

The list of identifiers wich will be added to every generated elements +of the widget as classnames.

+ +
+ +

Default: []

+ + +
+
+

itemElement

+ String + + + + + +
+

+ Defined in + src/dataview/dataview.js:330 +

+ + +
+ +
+

The type of the items DOM elements which will be created during the +render process.

+ +
+ +

Default: "li"

+ + +
+
+

items

+ Array + + + + + +
+

+ Defined in + src/dataview/dataview.js:115 +

+ + +
+ +
+

The collection of items displayed by the data view widget.

+ +
+ +

Default: null

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

multiSelectable

+ Boolean + + + + + +
+

+ Defined in + src/dataview/dataview.js:183 +

+ + +
+ +
+

Defines if the data items can be multi-selected. +Only used when "selectable" option is set to "true".

+ +
+ +

Default: false

+ + +
+
+

multiSelectWithCtrl

+ Boolean + + + + + +
+

+ Defined in + src/dataview/dataview.js:199 +

+ + +
+ +
+

Defines wether or not "ctrl" key has to be pressed to multi-select items. +Only used when "multiSelectable" option is set to "true".

+ +
+ +

Default: true

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

selectable

+ Boolean + + + + + +
+

+ Defined in + src/dataview/dataview.js:151 +

+ + +
+ +
+

Defines if the data items can be selected.

+ +
+ +

Default: false

+ + +
+
+

selectedItems

+ Array + + + + + +
+

+ Defined in + src/dataview/dataview.js:263 +

+ + +
+ +
+

The currently selected items.

+ +
+ +

Default: []

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

unselectOnOutsideClick

+ Boolean + + + + + +
+

+ Defined in + src/dataview/dataview.js:166 +

+ + +
+ +
+

If true, clicking outside of the items (in the container) will unselect +currently selected items. +Only used when "selectable" option is set to "true".

+ +
+ +

Default: false

+ + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.Dialog.html b/ref/classes/photonui.Dialog.html new file mode 100644 index 00000000..a072e0f4 --- /dev/null +++ b/ref/classes/photonui.Dialog.html @@ -0,0 +1,3243 @@ + + + + + photonui.Dialog - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.Dialog Class

+
+ +
+ Extends photonui.Window +
+ +
+ Defined in: src/container/dialog.js:45 +
+ + Module: Container
+ Parent Module: PhotonUI + +
+ + +
+

Dialog Window.

+ +
+ +
+

Constructor

+
+

photonui.Dialog

+ + () + + + + + + + + +
+

+ Defined in + src/container/dialog.js:45 +

+ + + +
+ +
+ +
+ + + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__internalDragging

+ +
+ (
    +
  • + offsetX +
  • +
  • + offsetY +
  • +
  • + pageX +
  • +
  • + pageY +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Window: + src/container/window.js:372 +

+ + + +
+ +
+ Move the window. +
+ +
+

Parameters:

+ +
    +
  • + offsetX + Number + + +
    + +
    + +
  • +
  • + offsetY + Number + + +
    + +
    + +
  • +
  • + pageX + Number + + +
    + +
    + +
  • +
  • + pageY + Number + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:445 +

+ + + +
+ +
+ Called when the context menu should be displayed. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/container/window.js:477 +

+ + + +
+ +
+ Called when the locale is changed. +
+ + + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/container/dialog.js:214 +

+ + + +
+ +
+

Build the widget HTML.

+ +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_closeButtonClicked

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Window: + src/container/window.js:466 +

+ + + +
+ +
+ Close button clicked. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

_moveDragEnd

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Window: + src/container/window.js:359 +

+ + + +
+ +
+ Stop moving the window. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

_moveDragging

+ +
+ (
    +
  • + offsetX +
  • +
  • + offsetY +
  • +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Window: + src/container/window.js:346 +

+ + + +
+ +
+ Move the window. +
+ +
+

Parameters:

+ +
    +
  • + offsetX + Number + + +
    + +
    + +
  • +
  • + offsetY + Number + + +
    + +
    + +
  • +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

_moveDragStart

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Window: + src/container/window.js:328 +

+ + + +
+ +
+ Start moving the window. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

_moveTouchEnd

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + + photonui.Window + + but overwritten in + src/container/window.js:429 +

+ + + +
+ +
+ Stop moving the window. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

_moveTouchMove

+ +
+ (
    +
  • + offsetX +
  • +
  • + offsetY +
  • +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Window: + src/container/window.js:415 +

+ + + +
+ +
+ Move the window. +
+ +
+

Parameters:

+ +
    +
  • + offsetX + Number + + +
    + +
    + +
  • +
  • + offsetY + Number + + +
    + +
    + +
  • +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

_moveTouchStart

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Window: + src/container/window.js:392 +

+ + + +
+ +
+ Start moving the window. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateButtons

+ + () + + + + private + + + + + +
+

+ Defined in + src/container/dialog.js:200 +

+ + + +
+ +
+

Update dialog buttons.

+ +
+ + + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_updateWindowList

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Window: + src/container/window.js:303 +

+ + + +
+ +
+ Update all the windows. +
+ + + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/container/dialog.js:229 +

+ + + +
+ +
+

Called when the visibility changes.

+ +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    +

    Current visibility state (otptional, defaut=this.visible)

    + +
    + +
  • +
+
+ + + +
+
+

addButton

+ +
+ (
    +
  • + widget +
  • +
) +
+ + + + + + + + +
+

+ Defined in + src/container/dialog.js:144 +

+ + + +
+ +
+

Add a button to the dialog.

+ +
+ +
+

Parameters:

+ + +
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

center

+ + () + + + + + + + + +
+

Inherited from + photonui.BaseWindow: + src/container/basewindow.js:340 +

+ + + +
+ +
+

Center the window.

+ +
+ + + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/container/dialog.js:183 +

+ + + +
+ +
+

Destroy the widget.

+ +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

moveToBack

+ + () + + + + + + + + +
+

Inherited from + photonui.Window: + src/container/window.js:243 +

+ + + +
+ +
+ Bring the window to the back. +
+ + + + +
+
+

moveToFront

+ + () + + + + + + + + +
+

Inherited from + photonui.Window: + src/container/window.js:229 +

+ + + +
+ +
+ Bring the window to front. +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeButton

+ +
+ (
    +
  • + widget +
  • +
) +
+ + + + + + + + +
+

+ Defined in + src/container/dialog.js:162 +

+ + + +
+ +
+

Remove a button from the dialog.

+ +
+ +
+

Parameters:

+ + +
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeChild

+ +
+ (
    +
  • + widget +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:182 +

+ + + +
+ +
+

Remove the given child.

+ +
+ +
+

Parameters:

+ + +
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

buttons

+ Array + + + + + +
+

+ Defined in + src/container/dialog.js:109 +

+ + +
+ +
+

Dialog buttons widgets.

+ +
+ +

Default: []

+ + +
+
+

buttonsNames

+ Array + + + + + +
+

+ Defined in + src/container/dialog.js:72 +

+ + +
+ +
+

Dialog button widgets name.

+ +
+ +

Default: []

+ + +
+
+

child

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:146 +

+ + +
+ +
+

The child widget.

+ +
+ +

Default: null (no child)

+ + +
+
+

childName

+ String + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:118 +

+ + +
+ +
+

The child widget name.

+ +
+ +

Default: null (no child)

+ + +
+
+

closeButtonVisible

+ Boolean +default: true + + + + + +
+

Inherited from + photonui.Window: + src/container/window.js:144 +

+ + +
+ +
+ Determine if the close button in the title bar is displayed or not. +
+ + + +
+
+

containerNode

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Container + + but overwritten in + src/container/window.js:197 +

+ + +
+ +
+ HTML Element that contain the child widget HTML. +
+ + + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

fullscreen

+ Boolean + + + + + +
+

Inherited from + photonui.Window: + src/container/window.js:122 +

+ + +
+ +
+ Fullscreen Window +
+ +

Default: false

+ + +
+
+

height

+ Number + + + + + + + +
+

Height of the container node.

+ +
+ +

Default: : null (auto)

+ + +
+
+

horizontalChildExpansion

+ Boolean + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:66 +

+ + +
+ +
+

Horizontaly expand the container's child widget.

+ +
+ +

Default: true

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/container/basewindow.js:311 +

+ + +
+ +
+

Html outer element of the widget (if any).

+ +
+ +

Default: null

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

maxHeight

+ Number + + + + + + + +
+

Maximum height of the container node.

+ +
+ +

Default: : null (no maximum)

+ + +
+
+

maxWidth

+ Number + + + + + + + +
+

Maximum width of the container node.

+ +
+ +

Default: : null (no maximum)

+ + +
+
+

minHeight

+ Number + + + + + + + +
+

Minimum height of the container node.

+ +
+ +

Default: : null (no minimum)

+ + +
+
+

minWidth

+ Number + + + + + + + +
+

Minimum width of the container node.

+ +
+ +

Default: : null (no minimum)

+ + +
+
+

modal

+ Boolean + + + + + +
+

Inherited from + photonui.Window: + src/container/window.js:170 +

+ + +
+ +
+ Modal window? +
+ +

Default: false

+ + +
+
+

movable

+ Boolean + + + + + +
+

Inherited from + photonui.Window: + src/container/window.js:105 +

+ + +
+ +
+ Determine if the window can be moved (drag & drop) by the user. +
+ +

Default: true

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

padding

+ Number + + + + + + + +
+

Window container node padding.

+ +
+ +

Default: 0

+ + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

position

+ Object + + + + + +
+

Inherited from + photonui.BaseWindow: + src/container/basewindow.js:78 +

+ + +
+ +
+

Window position.

+
{x: Number, y: Number}
+ +
+ +

Default: {x: 0, y: 0}

+ + +
+
+

title

+ String + + + + + +
+

Inherited from + photonui.Window: + src/container/window.js:85 +

+ + +
+ +
+ The window title. +
+ +

Default: "Window"

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

verticalChildExpansion

+ Boolean + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:92 +

+ + +
+ +
+

Verticaly expand the container's child widget.

+ +
+ +

Default: false

+ + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+

width

+ Number + + + + + + + +
+

Width of the container node.

+ +
+ +

Default: : null (auto)

+ + +
+
+

x

+ Number + + + + + + + +
+

The X position of the Window.

+ +
+ +

Default: 0

+ + +
+
+

y

+ Number + + + + + + + +
+

The Y position of the Window.

+ +
+ +

Default: 0

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.Expander.html b/ref/classes/photonui.Expander.html new file mode 100644 index 00000000..804c5eac --- /dev/null +++ b/ref/classes/photonui.Expander.html @@ -0,0 +1,2127 @@ + + + + + photonui.Expander - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.Expander Class

+
+ +
+ Extends photonui.Container +
+ + + + Module: Container
+ Parent Module: PhotonUI + +
+ + +
+

Expander container.

+

wEvents:

+
    +
  • folded: +
      +
    • description: called when the expander is folded by user.
    • +
    • callback: function(widget)
    • +
    +
  • +
  • unfolded: +
      +
    • description: called when the expander is unfolded by user.
    • +
    • callback: function(widget)
    • +
    +
  • +
+ +
+ +
+

Constructor

+
+

photonui.Expander

+ + () + + + + + + + + +
+

+ Defined in + src/container/expander.js:43 +

+ + + +
+ +
+ +
+ + + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:445 +

+ + + +
+ +
+ Called when the context menu should be displayed. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:460 +

+ + + +
+ +
+ Called when the locale is changed. +
+ + + + +
+
+

__onTitleClicked

+ + () + + + + private + + + + + +
+

+ Defined in + src/container/expander.js:208 +

+ + + +
+ +
+ +
+ + + + +
+
+

__onTitleKeyPress

+ + () + + + + private + + + + + +
+

+ Defined in + src/container/expander.js:216 +

+ + + +
+ +
+ +
+ + + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/container/expander.js:188 +

+ + + +
+ +
+

Build the widget HTML.

+ +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/container/container.js:208 +

+ + + +
+ +
+

Called when the visibility changes.

+ +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    +

    Current visibility state (otptional, defaut=this.visible)

    + +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/container/container.js:194 +

+ + + +
+ +
+

Destroy the widget.

+ +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeChild

+ +
+ (
    +
  • + widget +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:182 +

+ + + +
+ +
+

Remove the given child.

+ +
+ +
+

Parameters:

+ + +
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

toggleFolded

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + + + + + +
+

+ Defined in + src/container/expander.js:170 +

+ + + +
+ +
+

Toggle current folded state and sends and event.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Event + + +
    + +
    + +
  • +
+
+ + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

child

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:146 +

+ + +
+ +
+

The child widget.

+ +
+ +

Default: null (no child)

+ + +
+
+

childName

+ String + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:118 +

+ + +
+ +
+

The child widget name.

+ +
+ +

Default: null (no child)

+ + +
+
+

containerNode

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Container + + but overwritten in + src/container/expander.js:153 +

+ + +
+ +
+

HTML Element that contain the child widget HTML.

+ +
+ + + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

folded

+ Boolean + + + + + +
+

+ Defined in + src/container/expander.js:96 +

+ + +
+ +
+

Whether the expander is folded.

+ +
+ +

Default: false

+ + +
+
+

horizontalChildExpansion

+ Boolean + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:66 +

+ + +
+ +
+

Horizontaly expand the container's child widget.

+ +
+ +

Default: true

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/container/expander.js:141 +

+ + +
+ +
+

Html outer element of the widget (if any).

+ +
+ +

Default: null

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

padding

+ Number + + + + + +
+

+ Defined in + src/container/expander.js:122 +

+ + +
+ +
+

Container node padding.

+ +
+ +

Default: 0

+ + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

title

+ String + + + + + +
+

+ Defined in + src/container/expander.js:76 +

+ + +
+ +
+

The title.

+ +
+ +

Default: "Expander"

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

verticalChildExpansion

+ Boolean + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:92 +

+ + +
+ +
+

Verticaly expand the container's child widget.

+ +
+ +

Default: false

+ + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.FAIcon.html b/ref/classes/photonui.FAIcon.html new file mode 100644 index 00000000..74638f52 --- /dev/null +++ b/ref/classes/photonui.FAIcon.html @@ -0,0 +1,1779 @@ + + + + + photonui.FAIcon - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.FAIcon Class

+
+ +
+ Extends photonui.BaseIcon +
+ +
+ Defined in: src/visual/faicon.js:41 +
+ + Module: Visual
+ Parent Module: PhotonUI + +
+ + +
+

Font Awesome Icon.

+

Special contructor params:

+
 new photonui.FAIcon( {optional params...} )
+ new photonui.FAIcon( "iconName", {optional params...} )
+ +
+ +
+

Constructor

+
+

photonui.FAIcon

+ + () + + + + + + + + +
+

+ Defined in + src/visual/faicon.js:41 +

+ + + +
+ +
+ +
+ + + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:445 +

+ + + +
+ +
+ Called when the context menu should be displayed. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/visual/baseicon.js:54 +

+ + + +
+ +
+

Called when the locale is changed.

+ +
+ + + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/visual/faicon.js:156 +

+ + + +
+ +
+

Build the widget HTML.

+ +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:425 +

+ + + +
+ +
+ Called when the visibility changes. +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    +

    Current visibility state (otptional, defaut=this.visible)

    + +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/widget.js:367 +

+ + + +
+ +
+ Destroy the widget. +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

color

+ String +default: "inherit" + + + + + +
+

+ Defined in + src/visual/faicon.js:119 +

+ + +
+ +
+

The icon color.

+ +
+ + + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/visual/faicon.js:138 +

+ + +
+ +
+

Html outer element of the widget (if any).

+ +
+ +

Default: null

+ + +
+
+

iconName

+ String + + + + + +
+

+ Defined in + src/visual/faicon.js:77 +

+ + +
+ +
+

The Font Awesome icon name (e.g. "fa-cog").

+

Icon list: http://fontawesome.io/icons/

+ +
+ +

Default: ""

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

size

+ String + + + + + +
+

+ Defined in + src/visual/faicon.js:98 +

+ + +
+ +
+

Font Awesome icon size (e.g. "fa-2x").

+

Icon sizes list: http://fontawesome.io/examples/#larger

+ +
+ +

Default: ""

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.Field.html b/ref/classes/photonui.Field.html new file mode 100644 index 00000000..85dbc417 --- /dev/null +++ b/ref/classes/photonui.Field.html @@ -0,0 +1,1893 @@ + + + + + photonui.Field - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.Field Class

+
+ +
+ Extends photonui.Widget +
+ +
+ Defined in: src/interactive/field.js:43 +
+ + Module: Interactive
+ Parent Module: PhotonUI + +
+ + +
+

Base class for fields.

+

wEvents:

+
    +
  • +

    value-changed:

    +
      +
    • description: called when the value was modified.
    • +
    • callback: function(widget, value)
    • +
    +
  • +
  • +

    value-changed-final:

    +
      +
    • description: called when the value is no more modified after continuous changes
    • +
    • callback: function(widget, value)
    • +
    +
  • +
  • +

    keydown:

    +
      +
    • description: called when a key is pressed.
    • +
    • callback: function(widget, event)
    • +
    +
  • +
  • +

    keyup:

    +
      +
    • description: called when a key is released.
    • +
    • callback: function(widget, event)
    • +
    +
  • +
  • +

    keypress:

    +
      +
    • description: called just before the insertion of a char.
    • +
    • callback: function(widget, event)
    • +
    +
  • +
  • +

    selection-changed:

    +
      +
    • description: called when the selection was changed.
    • +
    • callback: function(widget, selectionStart, selectionEnd, selectedText, event)
    • +
    +
  • +
+ +
+ +
+

Constructor

+
+

photonui.Field

+ + () + + + + + + + + +
+

+ Defined in + src/interactive/field.js:43 +

+ + + +
+ +
+ +
+ + + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__debValueChangedFinal

+ + () + + + + private + + + + + +
+

+ Defined in + src/interactive/field.js:207 +

+ + + +
+ +
+

Debounced version of __forValueChangedFinal.

+ +
+ + + + +
+
+

__forValueChangedFinal

+ + () + + + + private + + + + + +
+

+ Defined in + src/interactive/field.js:197 +

+ + + +
+ +
+

To be called indirectly through __debValueChangedFinal().

+ +
+ + + + +
+
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/interactive/field.js:186 +

+ + + +
+ +
+

Called when the context menu should be displayed.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:460 +

+ + + +
+ +
+ Called when the locale is changed. +
+ + + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_bindFieldEvents

+ + () + + + + private + + + + + +
+

+ Defined in + src/interactive/field.js:149 +

+ + + +
+ +
+

Bind Field events.

+ +
+ + + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:415 +

+ + + +
+ +
+ Build the widget HTML. +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:425 +

+ + + +
+ +
+ Called when the visibility changes. +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    +

    Current visibility state (otptional, defaut=this.visible)

    + +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/widget.js:367 +

+ + + +
+ +
+ Destroy the widget. +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/interactive/field.js:131 +

+ + +
+ +
+

Html outer element of the widget (if any).

+ +
+ +

Default: null

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

Placeholder

+ String + + + + + +
+

+ Defined in + src/interactive/field.js:112 +

+ + +
+ +
+

The placeholder displayed if the field is empty.

+ +
+ +

Default: ""

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

value

+ String (maybe) + + + + + +
+

+ Defined in + src/interactive/field.js:96 +

+ + +
+ +
+

The field value.

+ +
+ +

Default: ""

+ + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.FileManager.html b/ref/classes/photonui.FileManager.html new file mode 100644 index 00000000..cea11156 --- /dev/null +++ b/ref/classes/photonui.FileManager.html @@ -0,0 +1,1387 @@ + + + + + photonui.FileManager - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.FileManager Class

+
+ +
+ Extends photonui.Base +
+ + + + Module: NonVisual
+ Parent Module: PhotonUI + +
+ + +
+

Open files from the standard "FileOpen" dialog and drag & drop.

+

wEvents:

+
    +
  • file-open: +
      +
    • description: File selected or dropped.
    • +
    • callback: function(widget, fileBlob, x, y) //(x=y=undefined if using a dialog)
    • +
    +
  • +
+ +
+ +
+

Constructor

+
+

photonui.FileManager

+ +
+ (
    +
  • + params +
  • +
) +
+ + + + + + + + +
+

+ Defined in + src/nonvisual/filemanager.js:41 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + params + Object + + +
    +

    An object that can contain any property of the widget (optional).

    + +
    + +
  • +
+
+ + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onFileDropped

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/nonvisual/filemanager.js:276 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onFileSelected

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/nonvisual/filemanager.js:290 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

+ Defined in + src/nonvisual/filemanager.js:304 +

+ + + +
+ +
+

Called when the locale is changed.

+ +
+ + + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_openFile

+ +
+ (
    +
  • + file +
  • +
  • + x +
  • +
  • + y +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/nonvisual/filemanager.js:236 +

+ + + +
+ +
+

Check file and call callbacks.

+ +
+ +
+

Parameters:

+ +
    +
  • + file + File + + +
    + +
    + +
  • +
  • + x + Number + + +
    +

    The x postition of the mouse (d&d only).

    + +
    + +
  • +
  • + y + Number + + +
    +

    The y postition of the mouse (d&d only).

    + +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateAccepted

+ + () + + + + private + + + + + +
+

+ Defined in + src/nonvisual/filemanager.js:218 +

+ + + +
+ +
+

Update accepted mimes/extentions.

+ +
+ + + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/nonvisual/filemanager.js:206 +

+ + + +
+ +
+

Destroy the class.

+ +
+ + + + +
+
+

open

+ + () + + + + + + + + +
+

+ Defined in + src/nonvisual/filemanager.js:193 +

+ + + +
+ +
+

Open the FileOpen dialog to allow user to browse its HDD for a file.

+ +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__fileField

+ HTMLElement + + + private + + + +
+

+ Defined in + src/nonvisual/filemanager.js:178 +

+ + +
+ +
+

The file field for opening the file dialog.

+ +
+ + + +
+
+

acceptedExts

+ Array + + + + + +
+

+ Defined in + src/nonvisual/filemanager.js:98 +

+ + +
+ +
+

List of the accepted file extentions.

+ +
+ +

Default: []

+ + +
+
+

acceptedMimes

+ Array + + + + + +
+

+ Defined in + src/nonvisual/filemanager.js:80 +

+ + +
+ +
+

List of the accepted mime types.

+ +
+ +

Default: []

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

dropZone

+ HTMLElement + + + + + +
+

+ Defined in + src/nonvisual/filemanager.js:116 +

+ + +
+ +
+

Element that accepts file drop (null disable d&d support).

+ +
+ +

Default: null

+ + +
+
+

multiselect

+ Boolean + + + + + +
+

+ Defined in + src/nonvisual/filemanager.js:153 +

+ + +
+ +
+

Allow multiselect in FileOpen dialog.

+ +
+ +

Default: false

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.FluidLayout.html b/ref/classes/photonui.FluidLayout.html new file mode 100644 index 00000000..cbe644dc --- /dev/null +++ b/ref/classes/photonui.FluidLayout.html @@ -0,0 +1,2400 @@ + + + + + photonui.FluidLayout - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.FluidLayout Class

+
+ +
+ Extends photonui.Layout +
+ + + + Module: Layout
+ Parent Module: PhotonUI + +
+ + +
+

Fluid Layout.

+

Layout Options:

+
{
+    align: <String (stretch|expand, start|left|top, center|middle, end|right|bottom), default=center>,
+
+    order: <Number default=null (auto)>
+
+    minWidth: <Number (null=auto), default=null>,
+    maxWidth: <Number (null=auto), default=null>,
+    width: <Number (null=auto), default=null>,
+
+    minHeight: <Number (null=auto), default=null>,
+    maxHeight: <Number (null=auto), default=null>,
+    height: <Number (null=auto), default=null>
+}
+ +
+ +
+

Constructor

+
+

photonui.FluidLayout

+ + () + + + + + + + + +
+

+ Defined in + src/layout/fluidlayout.js:42 +

+ + + +
+ +
+ +
+ + + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:445 +

+ + + +
+ +
+ Called when the context menu should be displayed. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/layout/layout.js:273 +

+ + + +
+ +
+ Called when the locale is changed. +
+ + + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/layout/fluidlayout.js:229 +

+ + + +
+ +
+

Build the widget HTML.

+ +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_computeLayoutOptions

+ +
+ (
    +
  • + widget +
  • +
) +
+ + + Object + + + + private + + + + + +
+

+ Defined in + src/layout/fluidlayout.js:309 +

+ + + +
+ +
+

Returns a normalized layoutOption for a given widget.

+ +
+ +
+

Parameters:

+ + +
+ +
+

Returns:

+ +
+ Object: +

the layout options

+ +
+
+ + +
+
+

_lockUpdate

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Layout: + src/layout/layout.js:223 +

+ + + +
+ +
+ Lock the update of the layout. +
+ + + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateLayout

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Layout + + but overwritten in + src/layout/fluidlayout.js:243 +

+ + + +
+ +
+

Update the layout.

+ +
+ + + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/layout/layout.js:250 +

+ + + +
+ +
+ Called when the visibility changes. +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    + Current visibility state (otptional, defaut=this.visible) +
    + +
  • +
+
+ + + +
+
+

addChild

+ +
+ (
    +
  • + widget +
  • +
  • + layoutOption +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Layout: + src/layout/layout.js:159 +

+ + + +
+ +
+ Add a widget to the layout. +
+ +
+

Parameters:

+ +
    +
  • + widget + photonui.Widget + + +
    + The widget to add. +
    + +
  • +
  • + layoutOption + Object + + +
    + Specific option for the layout (optional). +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/layout/layout.js:211 +

+ + + +
+ +
+ Destroy the widget. +
+ + + + +
+
+

empty

+ + () + + + + + + + + +
+

Inherited from + photonui.Layout: + src/layout/layout.js:193 +

+ + + +
+ +
+ Destroy all children of the layout +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeChild

+ +
+ (
    +
  • + widget +
  • +
) +
+ + + + + + + + +
+

Inherited from + + photonui.Container + + but overwritten in + src/layout/layout.js:178 +

+ + + +
+ +
+ Remove a widget from the layout. +
+ +
+

Parameters:

+ + +
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

child

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:146 +

+ + +
+ +
+

The child widget.

+ +
+ +

Default: null (no child)

+ + +
+
+

childName

+ String + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:118 +

+ + +
+ +
+

The child widget name.

+ +
+ +

Default: null (no child)

+ + +
+
+

children

+ Array + + + + + +
+

Inherited from + photonui.Layout: + src/layout/layout.js:106 +

+ + +
+ +
+ Layout children widgets. +
+ +

Default: []

+ + +
+
+

childrenNames

+ Array + + + + + +
+

Inherited from + photonui.Layout: + src/layout/layout.js:69 +

+ + +
+ +
+ Layout children widgets name. +
+ +

Default: []

+ + +
+
+

containerNode

+ HTMLElement + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:165 +

+ + +
+ +
+

HTML Element that contain the child widget HTML.

+ +
+ + + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

horizontalAlign

+ String + + + + + +
+

+ Defined in + src/layout/fluidlayout.js:179 +

+ + +
+ +
+

Horizontal alignment of children widgets.

+

Values:

+
* start|left|begin (default)
+* center|middle
+* end|right
+ +
+ +

Default: "start"

+ + +
+
+

horizontalChildExpansion

+ Boolean + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:66 +

+ + +
+ +
+

Horizontaly expand the container's child widget.

+ +
+ +

Default: true

+ + +
+
+

horizontalPadding

+ Number + + + + + +
+

+ Defined in + src/layout/fluidlayout.js:128 +

+ + +
+ +
+

Horizontal padding (px).

+ +
+ +

Default: 0

+ + +
+
+

horizontalSpacing

+ Number + + + + + +
+

+ Defined in + src/layout/fluidlayout.js:91 +

+ + +
+ +
+

The horizontal spacing between children widgets.

+ +
+ +

Default: 0

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/layout/fluidlayout.js:211 +

+ + +
+ +
+

Html outer element of the widget (if any).

+ +
+ +

Default: null

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

verticalAlign

+ String + + + + + +
+

+ Defined in + src/layout/fluidlayout.js:147 +

+ + +
+ +
+

Vertical alignment of children widgets.

+

Values:

+
* start|top|begin (default)
+* center|middle
+* end|bottom
+ +
+ +

Default: "start"

+ + +
+
+

verticalChildExpansion

+ Boolean + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:92 +

+ + +
+ +
+

Verticaly expand the container's child widget.

+ +
+ +

Default: false

+ + +
+
+

verticalPadding

+ Number + + + + + +
+

+ Defined in + src/layout/fluidlayout.js:109 +

+ + +
+ +
+

Vertical padding (px).

+ +
+ +

Default: 0

+ + +
+
+

verticalSpacing

+ Number + + + + + +
+

+ Defined in + src/layout/fluidlayout.js:73 +

+ + +
+ +
+

The vertical spacing between children widgets.

+ +
+ +

Default: 0

+ + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.FluidView.html b/ref/classes/photonui.FluidView.html new file mode 100644 index 00000000..89429633 --- /dev/null +++ b/ref/classes/photonui.FluidView.html @@ -0,0 +1,3912 @@ + + + + + photonui.FluidView - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.FluidView Class

+
+ +
+ Extends photonui.DataView +
+ + + + Module: DataView
+ Parent Module: PhotonUI + +
+ + +
+

FluidView container.

+ +
+ +
+

Constructor

+
+

photonui.FluidView

+ + () + + + + + + + + +
+

+ Defined in + src/dataview/fluidview.js:43 +

+ + + +
+ +
+ +
+ + + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onClick

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:861 +

+ + + +
+ +
+

Called when an element is clicked.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    +

    the click event

    + +
    + +
  • +
+
+ + + +
+
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:445 +

+ + + +
+ +
+ Called when the context menu should be displayed. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onDragEnd

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:970 +

+ + + +
+ +
+

Called when a item drag has ended.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onDragEnter

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:935 +

+ + + +
+ +
+

Called when a dragged item enters into another element.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onDragOver

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:1000 +

+ + + +
+ +
+

Called when a item is dragged (fix for firefox).

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onDragStart

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:903 +

+ + + +
+ +
+

Called when an item is dragged.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onDrop

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:1016 +

+ + + +
+ +
+

Called when a item is dropped (fix for firefox).

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onItemClick

+ +
+ (
    +
  • + event +
  • +
  • + item +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:885 +

+ + + +
+ +
+

Called when an item is clicked.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    +

    the click event

    + +
    + +
  • +
  • + item + Item + + +
    +

    the clicked item

    + +
    + +
  • +
+
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/dataview/dataview.js:1032 +

+ + + +
+ +
+

Called when the locale is changed.

+ +
+ + + + +
+
+

_addIdentifiersClasses

+ +
+ (
    +
  • + node +
  • +
  • + suffix +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:662 +

+ + + +
+ +
+

Adds classes defined by the identifiers property to a given element, with +a given suffix.

+ +
+ +
+

Parameters:

+ +
    +
  • + node + Element + + +
    +

    the node

    + +
    + +
  • +
  • + suffix + String + + +
    +

    the suffix of the classes

    + +
    + +
  • +
+
+ + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_buildContainerHtml

+ + () + + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:505 +

+ + + +
+ +
+

Build the widget container HTML.

+ +
+ + + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/dataview/dataview.js:495 +

+ + + +
+ +
+

Build the widget HTML.

+ +
+ + + + +
+
+

_buildItemsHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.DataView + + but overwritten in + src/dataview/fluidview.js:161 +

+ + + +
+ +
+

Build the items list HTML.

+ +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_empty

+ + () + + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:446 +

+ + + +
+ +
+

Destroy all children of the layout

+ +
+ + + + +
+
+

_generateColumns

+ + () + + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:632 +

+ + + +
+ +
+

Generate the list of columns.

+ +
+ + + + +
+
+

_generatePlaceholderElement

+ + () + + + Element + + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:833 +

+ + + +
+ +
+

Generates a placeholder item element.

+ +
+ + +
+

Returns:

+ +
+ Element: +

the placeholder item element

+ +
+
+ + +
+
+

_getChildren

+ + () + + + Array + + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:462 +

+ + + +
+ +
+

Layout children widgets.

+ +
+ + +
+

Returns:

+ +
+ Array: +

the childen widget

+ +
+
+ + +
+
+

_getItemByIndex

+ +
+ (
    +
  • + index +
  • +
) +
+ + + Object + + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:481 +

+ + + +
+ +
+

Returns the item at a given index.

+ +
+ +
+

Parameters:

+ +
    +
  • + index + Number + + +
    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Object: +

the item

+ +
+
+ + +
+
+

_getItemFromNode

+ +
+ (
    +
  • + itemNode +
  • +
) +
+ + + Object + + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:751 +

+ + + +
+ +
+

Gets an item of the collection from a given item DOM element.

+ +
+ +
+

Parameters:

+ +
    +
  • + itemNode + Element + + +
    +

    the item DOM element

    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Object: +

the item

+ +
+
+ + +
+
+

_handleClick

+ +
+ (
    +
  • + item +
  • +
  • + modifiers +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:782 +

+ + + +
+ +
+

Handle item click events.

+ +
+ +
+

Parameters:

+ +
    +
  • + item + Object + + +
    +

    the item

    + +
    + +
  • +
  • + modifiers + Object + + +
    +

    the modifiers states

    + +
    + +
      +
    • + ctrl + Object + +
      + +
      + +
    • +
    • + shift + Object + +
      + +
      + +
    • +
    +
  • +
+
+ + + +
+
+

_moveItem

+ +
+ (
    +
  • + itemIndex +
  • +
  • + destinationIndex +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:764 +

+ + + +
+ +
+

Moves the item at a givent index to another given index. Rebuilds the +dataview.

+ +
+ +
+

Parameters:

+ +
    +
  • + itemIndex + Number + + +
    +

    the index of the item to move

    + +
    + +
  • +
  • + destinationIndex + Number + + +
    +

    the destination index

    + +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_renderColumn

+ +
+ (
    +
  • + content +
  • +
  • + columnId +
  • +
) +
+ + + Element + + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:602 +

+ + + +
+ +
+

Renders a given column.

+ +
+ +
+

Parameters:

+ +
    +
  • + content + photonui.Widget | String + + +
    +

    the content of the column

    + +
    + +
  • +
  • + columnId + String + + +
    +

    the identifier of the column

    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Element: +

the rendered column

+ +
+
+ + +
+
+

_renderItem

+ +
+ (
    +
  • + item +
  • +
) +
+ + + Element + + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:551 +

+ + + +
+ +
+

Renders a given item.

+ +
+ +
+

Parameters:

+ +
    +
  • + item + Object + + +
    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Element: +

the rendered item

+ +
+
+ + +
+
+

_renderItemInner

+ +
+ (
    +
  • + itemNode +
  • +
  • + item +
  • +
) +
+ + + Element + + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:579 +

+ + + +
+ +
+

Renders all the columns of a given item.

+ +
+ +
+

Parameters:

+ +
    +
  • + itemNode + Element + + +
    +

    the container element of the item

    + +
    + +
  • +
  • + item + Object + + +
    +

    the rendered item

    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Element: +

the rendered item

+ +
+
+ + +
+
+

_selectItem

+ +
+ (
    +
  • + item +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:686 +

+ + + +
+ +
+

Selects an item.

+ +
+ +
+

Parameters:

+ +
    +
  • + item + Object + + +
    +

    the item

    + +
    + +
  • +
+
+ + + +
+
+

_selectItemsTo

+ +
+ (
    +
  • + item +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:718 +

+ + + +
+ +
+

Selects all items from the current selection to a given item.

+ +
+ +
+

Parameters:

+ +
    +
  • + item + Object + + +
    +

    the item

    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_unselectItem

+ +
+ (
    +
  • + item +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:702 +

+ + + +
+ +
+

Unselects an item.

+ +
+ +
+

Parameters:

+ +
    +
  • + item + Object + + +
    +

    the item

    + +
    + +
  • +
+
+ + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:425 +

+ + + +
+ +
+ Called when the visibility changes. +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    +

    Current visibility state (otptional, defaut=this.visible)

    + +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/dataview/dataview.js:388 +

+ + + +
+ +
+

Destroy the widget.

+ +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

selectItems

+ +
+ (
    +
  • + indexes +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:398 +

+ + + +
+ +
+

Selects the item(s) at given indexes.

+ +
+ +
+

Parameters:

+ +
    +
  • + indexes + ...Number | Number[] + + +
    + +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+

unselectAllItems

+ + () + + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:739 +

+ + + +
+ +
+

Unselects all items.

+ +
+ + + + +
+
+

unselectItems

+ +
+ (
    +
  • + indexes +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:421 +

+ + + +
+ +
+

Unselects the item(s) at given indexes.

+ +
+ +
+

Parameters:

+ +
    +
  • + indexes + ...Number | Number[] + + +
    + +
    + +
  • +
+
+ + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

allowShiftSelect

+ Boolean + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:215 +

+ + +
+ +
+

If true, allow selecting multiple items with one click when pressing +"shift" key. +Only used when "multiSelectable" option is set to "true".

+ +
+ +

Default: true

+ + +
+
+

columnElement

+ String + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:346 +

+ + +
+ +
+

The type of the columns DOM elements which will be created during the +render process.

+ +
+ +

Default: "span"

+ + +
+
+

columns

+ Array + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:277 +

+ + +
+ +
+

The list of columns which defines the structure of the items (if not +setted manually, the columns are automatically generated).

+ +
+ +

Default: null

+ + +
+
+

containerElement

+ String + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:314 +

+ + +
+ +
+

The type of the container DOM element which will be created during the +render process.

+ +
+ +

Default: "ul"

+ + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

customWidgetFormater

+ Function + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:247 +

+ + +
+ +
+

A custom formater function which overrides the default rendering process +of the widget.

+ +
+ +

Default: null

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

dragAndDroppable

+ Boolean + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:232 +

+ + +
+ +
+

Defines if the data items can be drag & dropped.

+ +
+ +

Default: false

+ + +
+
+

horizontalPadding

+ Number + + + + + +
+

+ Defined in + src/dataview/fluidview.js:113 +

+ + +
+ +
+

The horizontal padding of the container element.

+ +
+ +

Default: 0

+ + +
+
+

horizontalSpacing

+ Number + + + + + +
+

+ Defined in + src/dataview/fluidview.js:145 +

+ + +
+ +
+

The horizontal spacing between the elements.

+ +
+ +

Default: 0

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/dataview/dataview.js:302 +

+ + +
+ +
+

Html outer element of the widget (if any).

+ +
+ +

Default: null

+ + +
+
+

identifiers

+ Array + + + private + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:362 +

+ + +
+ +
+

The list of identifiers wich will be added to every generated elements +of the widget as classnames.

+ +
+ +

Default: []

+ + +
+
+

itemElement

+ String + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:330 +

+ + +
+ +
+

The type of the items DOM elements which will be created during the +render process.

+ +
+ +

Default: "li"

+ + +
+
+

items

+ Array + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:115 +

+ + +
+ +
+

The collection of items displayed by the data view widget.

+ +
+ +

Default: null

+ + +
+
+

itemsHeight

+ Number + + + + + +
+

+ Defined in + src/dataview/fluidview.js:81 +

+ + +
+ +
+

The height of the items.

+ +
+ +

Default: 0

+ + +
+
+

itemsWidth

+ Number + + + + + +
+

+ Defined in + src/dataview/fluidview.js:65 +

+ + +
+ +
+

The width of the items.

+ +
+ +

Default: 0

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

multiSelectable

+ Boolean + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:183 +

+ + +
+ +
+

Defines if the data items can be multi-selected. +Only used when "selectable" option is set to "true".

+ +
+ +

Default: false

+ + +
+
+

multiSelectWithCtrl

+ Boolean + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:199 +

+ + +
+ +
+

Defines wether or not "ctrl" key has to be pressed to multi-select items. +Only used when "multiSelectable" option is set to "true".

+ +
+ +

Default: true

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

selectable

+ Boolean + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:151 +

+ + +
+ +
+

Defines if the data items can be selected.

+ +
+ +

Default: false

+ + +
+
+

selectedItems

+ Array + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:263 +

+ + +
+ +
+

The currently selected items.

+ +
+ +

Default: []

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

unselectOnOutsideClick

+ Boolean + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:166 +

+ + +
+ +
+

If true, clicking outside of the items (in the container) will unselect +currently selected items. +Only used when "selectable" option is set to "true".

+ +
+ +

Default: false

+ + +
+
+

verticalPadding

+ Number + + + + + +
+

+ Defined in + src/dataview/fluidview.js:97 +

+ + +
+ +
+

The vertical padding of the container element.

+ +
+ +

Default: 0

+ + +
+
+

verticalSpacing

+ Number + + + + + +
+

+ Defined in + src/dataview/fluidview.js:129 +

+ + +
+ +
+

The vertical spacing between the elements.

+ +
+ +

Default: 0

+ + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.FontSelect.html b/ref/classes/photonui.FontSelect.html new file mode 100644 index 00000000..9174cc97 --- /dev/null +++ b/ref/classes/photonui.FontSelect.html @@ -0,0 +1,2416 @@ + + + + + photonui.FontSelect - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.FontSelect Class

+
+ +
+ Extends photonui.Select +
+ + + + Module: Composite
+ Parent Module: PhotonUI + +
+ + +
+

Font Selector.

+

wEvents:

+ +
+ +
+

Constructor

+
+

photonui.FontSelect

+ + () + + + + + + + + +
+

+ Defined in + src/composite/fontselect.js:43 +

+ + + +
+ +
+ +
+ + + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onClick

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Select: + src/composite/select.js:375 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:445 +

+ + + +
+ +
+ Called when the context menu should be displayed. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onItemClicked

+ +
+ (
    +
  • + widget +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Select: + src/composite/select.js:402 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ + +
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/composite/select.js:412 +

+ + + +
+ +
+ +
+ + + + +
+
+

__onMouseDown

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Select: + src/composite/select.js:391 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/composite/fontselect.js:121 +

+ + + +
+ +
+

Build the widget HTML.

+ +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateItemsBinding

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Select: + src/composite/select.js:354 +

+ + + +
+ +
+ Update the popup items binding. +
+ + + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:425 +

+ + + +
+ +
+ Called when the visibility changes. +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    +

    Current visibility state (otptional, defaut=this.visible)

    + +
    + +
  • +
+
+ + + +
+
+

addChild

+ +
+ (
    +
  • + fontName +
  • +
) +
+ + + + + + + + +
+

Inherited from + + photonui.Select + + but overwritten in + src/composite/fontselect.js:106 +

+ + + +
+ +
+

Add a widget to the layout.

+ +
+ +
+

Parameters:

+ +
    +
  • + fontName + String + + +
    + +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/composite/select.js:325 +

+ + + +
+ +
+ Destroy the widget. +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

__popupMenu

+ photonui.PopupMenu + + + private + + + +
+

Inherited from + photonui.Select: + src/composite/select.js:298 +

+ + +
+ +
+ The popupMenu. +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

children

+ Array + + + + + +
+

Inherited from + photonui.Select: + src/composite/select.js:142 +

+ + +
+ +
+ Layout children widgets. +
+ +

Default: []

+ + +
+
+

childrenNames

+ Array + + + + + +
+

Inherited from + photonui.Select: + src/composite/select.js:155 +

+ + +
+ +
+ Layout children widgets name. +
+ +

Default: []

+ + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

fonts

+ Array + + + + + +
+

+ Defined in + src/composite/fontselect.js:71 +

+ + +
+ +
+

The font list

+ +
+ +

Default: ["sans-serif", "serif", "monospace"]

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/composite/select.js:284 +

+ + +
+ +
+ Html outer element of the widget (if any). +
+ +

Default: null

+ + +
+
+

iconVisible

+ Boolean + + + + + +
+

Inherited from + photonui.Select: + src/composite/select.js:257 +

+ + +
+ +
+ Define if icon on menu items are visible. +
+ +

Default: : false

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

placeholder

+ String + + + + + +
+

Inherited from + + photonui.Select + + but overwritten in + src/composite/fontselect.js:91 +

+ + +
+ +
+

The placeholder displayed if nothing is selected.

+ +
+ +

Default: "Select a font..."

+ + +
+
+

popupHeight

+ Number + + + + + +
+

Inherited from + photonui.Select: + src/composite/select.js:178 +

+ + +
+ +
+ Height of the popup container node. +
+ +

Default: : null (auto)

+ + +
+
+

popupMaxHeight

+ Number + + + + + +
+

Inherited from + photonui.Select: + src/composite/select.js:209 +

+ + +
+ +
+ Maximum height of the popup container node. +
+ +

Default: : 300

+ + +
+
+

popupMaxWidth

+ Number + + + + + +
+

Inherited from + photonui.Select: + src/composite/select.js:188 +

+ + +
+ +
+ Maximum width of the popup container node. +
+ +

Default: : null (no maximum)

+ + +
+
+

popupMinHeight

+ Number + + + + + +
+

Inherited from + photonui.Select: + src/composite/select.js:219 +

+ + +
+ +
+ Minimum height of the popup container node. +
+ +

Default: : null (no minimum)

+ + +
+
+

popupMinWidth

+ Number + + + + + +
+

Inherited from + photonui.Select: + src/composite/select.js:198 +

+ + +
+ +
+ Minimum width of the popup container node. +
+ +

Default: : null (no minimum)

+ + +
+
+

popupOffsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Select: + src/composite/select.js:238 +

+ + +
+ +
+ Popup height (outer HTML element). +
+ + + +
+
+

popupOffsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Select: + src/composite/select.js:229 +

+ + +
+ +
+ Popup width (outer HTML element). +
+ + + +
+
+

popupPadding

+ Number + + + + + +
+

Inherited from + photonui.Select: + src/composite/select.js:247 +

+ + +
+ +
+ Window container node padding. +
+ +

Default: 0

+ + +
+
+

popupWidth

+ Number + + + + + +
+

Inherited from + photonui.Select: + src/composite/select.js:168 +

+ + +
+ +
+ Width of the container node. +
+ +

Default: : null (auto)

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

value

+ String (maybe) + + + + + +
+

Inherited from + photonui.Select: + src/composite/select.js:86 +

+ + +
+ +
+ The field value. +
+ +

Default: ""

+ + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.GridLayout.html b/ref/classes/photonui.GridLayout.html new file mode 100644 index 00000000..b256f7d0 --- /dev/null +++ b/ref/classes/photonui.GridLayout.html @@ -0,0 +1,2454 @@ + + + + + photonui.GridLayout - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.GridLayout Class

+
+ +
+ Extends photonui.Layout +
+ +
+ Defined in: src/layout/gridlayout.js:44 +
+ + Module: Layout
+ Parent Module: PhotonUI + +
+ + +
+

Grid layout.

+

Layout Options:

+
{
+     x: <Number, default: 0>,
+     y: <Number, default: 0>,
+     cols: <Number, default: 1>,
+     rows: <Number, default: 1>,
+
+     horizontalAlign: <String (stretch|expand, start|left, center, end|right), default: stretch>,
+     verticalAlign: <String (stretch|expand, start|top, center|middle, end|bottom), default: stretch>,
+
+     minWidth: <Number, default: null>,
+     maxWidth: <Number, default: null>,
+     width: <Number, default: null>,
+
+     minHeight: <Number, default: null>,
+     maxHeight: <Number, default: null>,
+     height: <Number, default: null>,
+}
+ +
+ +
+

Constructor

+
+

photonui.GridLayout

+ + () + + + + + + + + +
+

+ Defined in + src/layout/gridlayout.js:44 +

+ + + +
+ +
+ +
+ + + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:445 +

+ + + +
+ +
+ Called when the context menu should be displayed. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/layout/layout.js:273 +

+ + + +
+ +
+ Called when the locale is changed. +
+ + + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/layout/gridlayout.js:218 +

+ + + +
+ +
+

Build the widget HTML.

+ +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_computeLayoutOptions

+ +
+ (
    +
  • + widget +
  • +
) +
+ + + Object + + + + private + + + + + +
+

+ Defined in + src/layout/gridlayout.js:389 +

+ + + +
+ +
+

Returns a normalized layoutOption for a given widget.

+ +
+ +
+

Parameters:

+ + +
+ +
+

Returns:

+ +
+ Object: +

the layout options

+ +
+
+ + +
+
+

_lockUpdate

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Layout: + src/layout/layout.js:223 +

+ + + +
+ +
+ Lock the update of the layout. +
+ + + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_sizingHack

+ + () + + + + private + + + + + +
+

+ Defined in + src/layout/gridlayout.js:533 +

+ + + +
+ +
+

Hack to get thing working with Gecko and Trident.

+

MSIE 11:

+
    +
  • The hack fixes all the issues,
  • +
+

MSIE 10:

+
    +
  • There is issues with rowspan
  • +
  • The dynamic resizing does not works
  • +
+

Firefox:

+
    +
  • There is some minor issues with rowspan
  • +
+ +
+ + + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateLayout

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Layout + + but overwritten in + src/layout/gridlayout.js:235 +

+ + + +
+ +
+

Update the layout.

+ +
+ + + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_updateSpacing

+ + () + + + + private + + + + + +
+

+ Defined in + src/layout/gridlayout.js:519 +

+ + + +
+ +
+

Update the spacing between widgets

+ +
+ + + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/layout/gridlayout.js:203 +

+ + + +
+ +
+

Called when the visibility changes.

+ +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    +

    Current visibility state (otptional, defaut=this.visible)

    + +
    + +
  • +
+
+ + + +
+
+

addChild

+ +
+ (
    +
  • + widget +
  • +
  • + layoutOption +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Layout: + src/layout/layout.js:159 +

+ + + +
+ +
+ Add a widget to the layout. +
+ +
+

Parameters:

+ +
    +
  • + widget + photonui.Widget + + +
    + The widget to add. +
    + +
  • +
  • + layoutOption + Object + + +
    + Specific option for the layout (optional). +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/layout/layout.js:211 +

+ + + +
+ +
+ Destroy the widget. +
+ + + + +
+
+

empty

+ + () + + + + + + + + +
+

Inherited from + photonui.Layout: + src/layout/layout.js:193 +

+ + + +
+ +
+ Destroy all children of the layout +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeChild

+ +
+ (
    +
  • + widget +
  • +
) +
+ + + + + + + + +
+

Inherited from + + photonui.Container + + but overwritten in + src/layout/layout.js:178 +

+ + + +
+ +
+ Remove a widget from the layout. +
+ +
+

Parameters:

+ + +
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

_updatingLayout

+ Boolean + + + private + + + +
+

+ Defined in + src/layout/gridlayout.js:187 +

+ + +
+ +
+

Flag to indicate that the layout is actually been updated.

+ +
+ +

Default: false

+ + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

child

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:146 +

+ + +
+ +
+

The child widget.

+ +
+ +

Default: null (no child)

+ + +
+
+

childName

+ String + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:118 +

+ + +
+ +
+

The child widget name.

+ +
+ +

Default: null (no child)

+ + +
+
+

children

+ Array + + + + + +
+

Inherited from + photonui.Layout: + src/layout/layout.js:106 +

+ + +
+ +
+ Layout children widgets. +
+ +

Default: []

+ + +
+
+

childrenNames

+ Array + + + + + +
+

Inherited from + photonui.Layout: + src/layout/layout.js:69 +

+ + +
+ +
+ Layout children widgets name. +
+ +

Default: []

+ + +
+
+

containerNode

+ HTMLElement + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:165 +

+ + +
+ +
+

HTML Element that contain the child widget HTML.

+ +
+ + + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

horizontalChildExpansion

+ Boolean + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:66 +

+ + +
+ +
+

Horizontaly expand the container's child widget.

+ +
+ +

Default: true

+ + +
+
+

horizontalPadding

+ Number + + + + + +
+

+ Defined in + src/layout/gridlayout.js:114 +

+ + +
+ +
+

Horizontal padding (px).

+ +
+ +

Default: 0

+ + +
+
+

horizontalSpacing

+ Number + + + + + +
+

+ Defined in + src/layout/gridlayout.js:155 +

+ + +
+ +
+

The horizontal spacing between children widgets.

+ +
+ +

Default: 5

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/layout/gridlayout.js:173 +

+ + +
+ +
+

Html outer element of the widget (if any).

+ +
+ +

Default: null

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

verticalChildExpansion

+ Boolean + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:92 +

+ + +
+ +
+

Verticaly expand the container's child widget.

+ +
+ +

Default: false

+ + +
+
+

verticalPadding

+ Number + + + + + +
+

+ Defined in + src/layout/gridlayout.js:92 +

+ + +
+ +
+

Vertical padding (px).

+ +
+ +

Default: 0

+ + +
+
+

verticalSpacing

+ Number + + + + + +
+

+ Defined in + src/layout/gridlayout.js:136 +

+ + +
+ +
+

The vertical spacing between children widgets.

+ +
+ +

Default: 5

+ + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.Helpers.html b/ref/classes/photonui.Helpers.html new file mode 100644 index 00000000..80a48c25 --- /dev/null +++ b/ref/classes/photonui.Helpers.html @@ -0,0 +1,759 @@ + + + + + photonui.Helpers - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.Helpers Class

+
+ + +
+ Defined in: src/helpers.js:42 +
+ + Module: Helpers
+ Parent Module: PhotonUI + +
+ + +
+

Helpers.

+ +
+ +
+

Constructor

+
+

photonui.Helpers

+ + () + + + + + + + + +
+

+ Defined in + src/helpers.js:42 +

+ + + +
+ +
+ +
+ + + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ + + +
+ +
+

Methods

+ +
+

cleanNode

+ +
+ (
    +
  • + node +
  • +
) +
+ + + + + + static + + + +
+

+ Defined in + src/helpers.js:81 +

+ + + +
+ +
+

Clean node (remove all children of the node).

+ +
+ +
+

Parameters:

+ + +
+ + + +
+
+

escapeHtml

+ +
+ (
    +
  • + string +
  • +
) +
+ + + String + + + + + + static + + + +
+

+ Defined in + src/helpers.js:51 +

+ + + +
+ +
+

Escape HTML.

+ +
+ +
+

Parameters:

+ +
    +
  • + string + String + + +
    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ String: +
+
+ + +
+
+

getAbsolutePosition

+ +
+ (
    +
  • + element +
  • +
) +
+ + + Object + + + + + + static + + + +
+

+ Defined in + src/helpers.js:94 +

+ + + +
+ +
+

Get the absolute position of an HTML Element.

+ +
+ +
+

Parameters:

+ +
    +
  • + element + HTMLElement + + +
    +

    The HTML element (or its id)

    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Object: +

`{x: , y: }

+ +
+
+ + +
+
+

getClosest

+ +
+ (
    +
  • + elem +
  • +
  • + selector +
  • +
) +
+ + + Boolean | Element + + + + + + + + +
+

+ Defined in + src/helpers.js:205 +

+ + + +
+ +
+

Get the closest matching element up the DOM tree. +https://gomakethings.com/climbing-up-and-down-the-dom-tree-with-vanilla-javascript/

+ +
+ +
+

Parameters:

+ +
    +
  • + elem + Element + + +
    +

    Starting element

    + +
    + +
  • +
  • + selector + String + + +
    +

    Selector to match against

    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Boolean | Element: +

Returns null if not match found

+ +
+
+ + +
+
+

log

+ +
+ (
    +
  • + level +
  • +
  • + message +
  • +
) +
+ + + + + + static + + + +
+

+ Defined in + src/helpers.js:181 +

+ + + +
+ +
+

Write log into the terminal.

+ +
+ +
+

Parameters:

+ +
    +
  • + level + String + + +
    +

    The log level ("info", "warn", "error", ...)

    + +
    + +
  • +
  • + message + String + + +
    +

    The message to log

    + +
    + +
  • +
+
+ + + +
+
+

numberToCssSize

+ +
+ (
    +
  • + value +
  • +
  • + defaultValue +
  • +
  • + nullValue +
  • +
) +
+ + + String + + + + + + static + + + +
+

+ Defined in + src/helpers.js:149 +

+ + + +
+ +
+

Check and compute size to valid CSS size

+

Valid values and transformations: +undefined -> defaultValue +null -> "auto" (if "auto" is alowed, "0px" else) ++Infinity -> "100%" +Number -> "px"

+ +
+ +
+

Parameters:

+ +
    +
  • + value + Number + + +
    + +
    + +
  • +
  • + defaultValue + Number + + +
    +

    (opt, default=nullValue)

    + +
    + +
  • +
  • + nullValue + String + + +
    +

    (opt, default="auto")

    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ String: +

sanitized version of the size.

+ +
+
+ + +
+
+

uuid4

+ + () + + + String + + + deprecated + + + + static + + + +
+

+ Defined in + src/helpers.js:66 +

+ + + +
+ +
+

Generate an UUID version 4 (RFC 4122).

+

This method is deprecated, please use photonui.lib.uuid.v4() instead.

+ +
+ + +
+

Returns:

+ +
+ String: +

The generated UUID

+ +
+
+ + +
+
+ + + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.IconButton.html b/ref/classes/photonui.IconButton.html new file mode 100644 index 00000000..884de566 --- /dev/null +++ b/ref/classes/photonui.IconButton.html @@ -0,0 +1,1891 @@ + + + + + photonui.IconButton - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.IconButton Class

+
+ +
+ Extends photonui.Widget +
+ + + + Module: Interactive
+ Parent Module: PhotonUI + +
+ + +
+

A simple flat button that only contains an icon

+

wEvents:

+
    +
  • click: +
      +
    • description: called when the button was clicked.
    • +
    • callback: function(widget, event)
    • +
    +
  • +
+ +
+ +
+

Constructor

+
+

photonui.IconButton

+ +
+ (
    +
  • + params +
  • +
) +
+ + + + + + + + +
+

+ Defined in + src/interactive/iconbutton.js:44 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + params + Object + + +
    +

    An object that can contain any property of the widget (optional).

    + +
    + +
  • +
+
+ + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onButtonClicked

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/interactive/iconbutton.js:208 +

+ + + +
+ +
+

Called when the button is clicked.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:445 +

+ + + +
+ +
+ Called when the context menu should be displayed. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:460 +

+ + + +
+ +
+ Called when the locale is changed. +
+ + + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/interactive/iconbutton.js:191 +

+ + + +
+ +
+

Build the widget HTML.

+ +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:425 +

+ + + +
+ +
+ Called when the visibility changes. +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    +

    Current visibility state (otptional, defaut=this.visible)

    + +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/interactive/iconbutton.js:176 +

+ + + +
+ +
+

Destroy the widget.

+ +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

height

+ Number + + + + + +
+

+ Defined in + src/interactive/iconbutton.js:95 +

+ + +
+ +
+

Button height

+ +
+ +

Default: 16

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/interactive/iconbutton.js:158 +

+ + +
+ +
+

Html outer element of the widget (if any).

+ +
+ +

Default: null

+ + +
+
+

icon

+ BaseIcon + + + + + +
+

+ Defined in + src/interactive/iconbutton.js:139 +

+ + +
+ +
+

Icon widget.

+ +
+ +

Default: : null

+ + +
+
+

iconName

+ String + + + + + +
+

+ Defined in + src/interactive/iconbutton.js:117 +

+ + +
+ +
+

Icon widget name.

+ +
+ +

Default: : null

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+

width

+ Number + + + + + +
+

+ Defined in + src/interactive/iconbutton.js:74 +

+ + +
+ +
+

Button width

+ +
+ +

Default: 16

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.IconView.html b/ref/classes/photonui.IconView.html new file mode 100644 index 00000000..b209c0af --- /dev/null +++ b/ref/classes/photonui.IconView.html @@ -0,0 +1,3975 @@ + + + + + photonui.IconView - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.IconView Class

+
+ +
+ Extends photonui.FluidView +
+ +
+ Defined in: src/dataview/iconview.js:47 +
+ + Module: DataView
+ Parent Module: PhotonUI + +
+ + +
+

IconView container.

+ +
+ +
+

Constructor

+
+

photonui.IconView

+ + () + + + + + + + + +
+

+ Defined in + src/dataview/iconview.js:47 +

+ + + +
+ +
+ +
+ + + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onClick

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:861 +

+ + + +
+ +
+

Called when an element is clicked.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    +

    the click event

    + +
    + +
  • +
+
+ + + +
+
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:445 +

+ + + +
+ +
+ Called when the context menu should be displayed. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onDragEnd

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:970 +

+ + + +
+ +
+

Called when a item drag has ended.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onDragEnter

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:935 +

+ + + +
+ +
+

Called when a dragged item enters into another element.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onDragOver

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:1000 +

+ + + +
+ +
+

Called when a item is dragged (fix for firefox).

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onDragStart

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:903 +

+ + + +
+ +
+

Called when an item is dragged.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onDrop

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:1016 +

+ + + +
+ +
+

Called when a item is dropped (fix for firefox).

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onItemClick

+ +
+ (
    +
  • + event +
  • +
  • + item +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:885 +

+ + + +
+ +
+

Called when an item is clicked.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    +

    the click event

    + +
    + +
  • +
  • + item + Item + + +
    +

    the clicked item

    + +
    + +
  • +
+
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/dataview/dataview.js:1032 +

+ + + +
+ +
+

Called when the locale is changed.

+ +
+ + + + +
+
+

_addIdentifiersClasses

+ +
+ (
    +
  • + node +
  • +
  • + suffix +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:662 +

+ + + +
+ +
+

Adds classes defined by the identifiers property to a given element, with +a given suffix.

+ +
+ +
+

Parameters:

+ +
    +
  • + node + Element + + +
    +

    the node

    + +
    + +
  • +
  • + suffix + String + + +
    +

    the suffix of the classes

    + +
    + +
  • +
+
+ + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_buildContainerHtml

+ + () + + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:505 +

+ + + +
+ +
+

Build the widget container HTML.

+ +
+ + + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/dataview/dataview.js:495 +

+ + + +
+ +
+

Build the widget HTML.

+ +
+ + + + +
+
+

_buildItemsHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.DataView + + but overwritten in + src/dataview/fluidview.js:161 +

+ + + +
+ +
+

Build the items list HTML.

+ +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_empty

+ + () + + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:446 +

+ + + +
+ +
+

Destroy all children of the layout

+ +
+ + + + +
+
+

_generateColumns

+ + () + + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:632 +

+ + + +
+ +
+

Generate the list of columns.

+ +
+ + + + +
+
+

_generatePlaceholderElement

+ + () + + + Element + + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:833 +

+ + + +
+ +
+

Generates a placeholder item element.

+ +
+ + +
+

Returns:

+ +
+ Element: +

the placeholder item element

+ +
+
+ + +
+
+

_getChildren

+ + () + + + Array + + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:462 +

+ + + +
+ +
+

Layout children widgets.

+ +
+ + +
+

Returns:

+ +
+ Array: +

the childen widget

+ +
+
+ + +
+
+

_getItemByIndex

+ +
+ (
    +
  • + index +
  • +
) +
+ + + Object + + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:481 +

+ + + +
+ +
+

Returns the item at a given index.

+ +
+ +
+

Parameters:

+ +
    +
  • + index + Number + + +
    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Object: +

the item

+ +
+
+ + +
+
+

_getItemFromNode

+ +
+ (
    +
  • + itemNode +
  • +
) +
+ + + Object + + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:751 +

+ + + +
+ +
+

Gets an item of the collection from a given item DOM element.

+ +
+ +
+

Parameters:

+ +
    +
  • + itemNode + Element + + +
    +

    the item DOM element

    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Object: +

the item

+ +
+
+ + +
+
+

_handleClick

+ +
+ (
    +
  • + item +
  • +
  • + modifiers +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:782 +

+ + + +
+ +
+

Handle item click events.

+ +
+ +
+

Parameters:

+ +
    +
  • + item + Object + + +
    +

    the item

    + +
    + +
  • +
  • + modifiers + Object + + +
    +

    the modifiers states

    + +
    + +
      +
    • + ctrl + Object + +
      + +
      + +
    • +
    • + shift + Object + +
      + +
      + +
    • +
    +
  • +
+
+ + + +
+
+

_moveItem

+ +
+ (
    +
  • + itemIndex +
  • +
  • + destinationIndex +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:764 +

+ + + +
+ +
+

Moves the item at a givent index to another given index. Rebuilds the +dataview.

+ +
+ +
+

Parameters:

+ +
    +
  • + itemIndex + Number + + +
    +

    the index of the item to move

    + +
    + +
  • +
  • + destinationIndex + Number + + +
    +

    the destination index

    + +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_renderColumn

+ +
+ (
    +
  • + content +
  • +
  • + columnId +
  • +
) +
+ + + Element + + + + private + + + + + +
+

Inherited from + + photonui.DataView + + but overwritten in + src/dataview/iconview.js:120 +

+ + + +
+ +
+

Renders a given column.

+ +
+ +
+

Parameters:

+ +
    +
  • + content + photonui.Widget | String + + +
    +

    the content of the column

    + +
    + +
  • +
  • + columnId + String + + +
    +

    the identifier of the column

    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Element: +

the rendered column

+ +
+
+ + +
+
+

_renderItem

+ +
+ (
    +
  • + item +
  • +
) +
+ + + Element + + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:551 +

+ + + +
+ +
+

Renders a given item.

+ +
+ +
+

Parameters:

+ +
    +
  • + item + Object + + +
    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Element: +

the rendered item

+ +
+
+ + +
+
+

_renderItemInner

+ +
+ (
    +
  • + itemNode +
  • +
  • + item +
  • +
) +
+ + + Element + + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:579 +

+ + + +
+ +
+

Renders all the columns of a given item.

+ +
+ +
+

Parameters:

+ +
    +
  • + itemNode + Element + + +
    +

    the container element of the item

    + +
    + +
  • +
  • + item + Object + + +
    +

    the rendered item

    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Element: +

the rendered item

+ +
+
+ + +
+
+

_selectItem

+ +
+ (
    +
  • + item +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:686 +

+ + + +
+ +
+

Selects an item.

+ +
+ +
+

Parameters:

+ +
    +
  • + item + Object + + +
    +

    the item

    + +
    + +
  • +
+
+ + + +
+
+

_selectItemsTo

+ +
+ (
    +
  • + item +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:718 +

+ + + +
+ +
+

Selects all items from the current selection to a given item.

+ +
+ +
+

Parameters:

+ +
    +
  • + item + Object + + +
    +

    the item

    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_unselectItem

+ +
+ (
    +
  • + item +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:702 +

+ + + +
+ +
+

Unselects an item.

+ +
+ +
+

Parameters:

+ +
    +
  • + item + Object + + +
    +

    the item

    + +
    + +
  • +
+
+ + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:425 +

+ + + +
+ +
+ Called when the visibility changes. +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    +

    Current visibility state (otptional, defaut=this.visible)

    + +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/dataview/dataview.js:388 +

+ + + +
+ +
+

Destroy the widget.

+ +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

selectItems

+ +
+ (
    +
  • + indexes +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:398 +

+ + + +
+ +
+

Selects the item(s) at given indexes.

+ +
+ +
+

Parameters:

+ +
    +
  • + indexes + ...Number | Number[] + + +
    + +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+

unselectAllItems

+ + () + + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:739 +

+ + + +
+ +
+

Unselects all items.

+ +
+ + + + +
+
+

unselectItems

+ +
+ (
    +
  • + indexes +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:421 +

+ + + +
+ +
+

Unselects the item(s) at given indexes.

+ +
+ +
+

Parameters:

+ +
    +
  • + indexes + ...Number | Number[] + + +
    + +
    + +
  • +
+
+ + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

allowShiftSelect

+ Boolean + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:215 +

+ + +
+ +
+

If true, allow selecting multiple items with one click when pressing +"shift" key. +Only used when "multiSelectable" option is set to "true".

+ +
+ +

Default: true

+ + +
+
+

columnElement

+ String + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:346 +

+ + +
+ +
+

The type of the columns DOM elements which will be created during the +render process.

+ +
+ +

Default: "span"

+ + +
+
+

columns

+ Array + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:277 +

+ + +
+ +
+

The list of columns which defines the structure of the items (if not +setted manually, the columns are automatically generated).

+ +
+ +

Default: null

+ + +
+
+

containerElement

+ String + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:314 +

+ + +
+ +
+

The type of the container DOM element which will be created during the +render process.

+ +
+ +

Default: "ul"

+ + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

customWidgetFormater

+ Function + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:247 +

+ + +
+ +
+

A custom formater function which overrides the default rendering process +of the widget.

+ +
+ +

Default: null

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

dragAndDroppable

+ Boolean + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:232 +

+ + +
+ +
+

Defines if the data items can be drag & dropped.

+ +
+ +

Default: false

+ + +
+
+

horizontalPadding

+ Number + + + + + +
+

Inherited from + photonui.FluidView: + src/dataview/fluidview.js:113 +

+ + +
+ +
+

The horizontal padding of the container element.

+ +
+ +

Default: 0

+ + +
+
+

horizontalSpacing

+ Number + + + + + +
+

Inherited from + photonui.FluidView: + src/dataview/fluidview.js:145 +

+ + +
+ +
+

The horizontal spacing between the elements.

+ +
+ +

Default: 0

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/dataview/dataview.js:302 +

+ + +
+ +
+

Html outer element of the widget (if any).

+ +
+ +

Default: null

+ + +
+
+

iconHeight

+ Number + + + + + +
+

+ Defined in + src/dataview/iconview.js:104 +

+ + +
+ +
+

The width of the items.

+ +
+ +

Default: 0

+ + +
+
+

iconWidth

+ Number + + + + + +
+

+ Defined in + src/dataview/iconview.js:88 +

+ + +
+ +
+

The width of the icons.

+ +
+ +

Default: 0

+ + +
+
+

identifiers

+ Array + + + private + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:362 +

+ + +
+ +
+

The list of identifiers wich will be added to every generated elements +of the widget as classnames.

+ +
+ +

Default: []

+ + +
+
+

itemElement

+ String + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:330 +

+ + +
+ +
+

The type of the items DOM elements which will be created during the +render process.

+ +
+ +

Default: "li"

+ + +
+
+

items

+ Array + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:115 +

+ + +
+ +
+

The collection of items displayed by the data view widget.

+ +
+ +

Default: null

+ + +
+
+

itemsHeight

+ Number + + + + + +
+

Inherited from + photonui.FluidView: + src/dataview/fluidview.js:81 +

+ + +
+ +
+

The height of the items.

+ +
+ +

Default: 0

+ + +
+
+

itemsWidth

+ Number + + + + + +
+

Inherited from + photonui.FluidView: + src/dataview/fluidview.js:65 +

+ + +
+ +
+

The width of the items.

+ +
+ +

Default: 0

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

multiSelectable

+ Boolean + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:183 +

+ + +
+ +
+

Defines if the data items can be multi-selected. +Only used when "selectable" option is set to "true".

+ +
+ +

Default: false

+ + +
+
+

multiSelectWithCtrl

+ Boolean + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:199 +

+ + +
+ +
+

Defines wether or not "ctrl" key has to be pressed to multi-select items. +Only used when "multiSelectable" option is set to "true".

+ +
+ +

Default: true

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

selectable

+ Boolean + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:151 +

+ + +
+ +
+

Defines if the data items can be selected.

+ +
+ +

Default: false

+ + +
+
+

selectedItems

+ Array + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:263 +

+ + +
+ +
+

The currently selected items.

+ +
+ +

Default: []

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

unselectOnOutsideClick

+ Boolean + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:166 +

+ + +
+ +
+

If true, clicking outside of the items (in the container) will unselect +currently selected items. +Only used when "selectable" option is set to "true".

+ +
+ +

Default: false

+ + +
+
+

verticalPadding

+ Number + + + + + +
+

Inherited from + photonui.FluidView: + src/dataview/fluidview.js:97 +

+ + +
+ +
+

The vertical padding of the container element.

+ +
+ +

Default: 0

+ + +
+
+

verticalSpacing

+ Number + + + + + +
+

Inherited from + photonui.FluidView: + src/dataview/fluidview.js:129 +

+ + +
+ +
+

The vertical spacing between the elements.

+ +
+ +

Default: 0

+ + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.Image.html b/ref/classes/photonui.Image.html new file mode 100644 index 00000000..0ddb5a6c --- /dev/null +++ b/ref/classes/photonui.Image.html @@ -0,0 +1,1793 @@ + + + + + photonui.Image - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.Image Class

+
+ +
+ Extends photonui.Widget +
+ +
+ Defined in: src/visual/image.js:41 +
+ + Module: Visual
+ Parent Module: PhotonUI + +
+ + +
+

Image.

+ +
+ +
+

Constructor

+
+

photonui.Image

+ +
+ (
    +
  • + params +
  • +
) +
+ + + + + + + + +
+

+ Defined in + src/visual/image.js:41 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + params + Object + + +
    +

    An object that can contain any property of the widget (optional).

    + +
    + +
  • +
+
+ + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:445 +

+ + + +
+ +
+ Called when the context menu should be displayed. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:460 +

+ + + +
+ +
+ Called when the locale is changed. +
+ + + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/visual/image.js:137 +

+ + + +
+ +
+

Build the widget HTML.

+ +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:425 +

+ + + +
+ +
+ Called when the visibility changes. +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    +

    Current visibility state (otptional, defaut=this.visible)

    + +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/widget.js:367 +

+ + + +
+ +
+ Destroy the widget. +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

height

+ Number + + + + + +
+

+ Defined in + src/visual/image.js:97 +

+ + +
+ +
+

The image height (null = auto).

+ +
+ +

Default: null

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/visual/image.js:119 +

+ + +
+ +
+

Html outer element of the widget (if any).

+ +
+ +

Default: null

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

url

+ String + + + + + +
+

+ Defined in + src/visual/image.js:57 +

+ + +
+ +
+

The image URL.

+ +
+ +

Default: ""

+ + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+

width

+ Number + + + + + +
+

+ Defined in + src/visual/image.js:75 +

+ + +
+ +
+

The image width (null = auto).

+ +
+ +

Default: null

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.KeyboardManager.html b/ref/classes/photonui.KeyboardManager.html new file mode 100644 index 00000000..6a633aba --- /dev/null +++ b/ref/classes/photonui.KeyboardManager.html @@ -0,0 +1,1846 @@ + + + + + photonui.KeyboardManager - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.KeyboardManager Class

+
+ +
+ Extends photonui.Base +
+ + + + Module: NonVisual
+ Parent Module: PhotonUI + +
+ + +
+

Manage document-wide keyboard events.

+

wEvents:

+
    +
  • +

    key-down:

    +
      +
    • description: When a key is pushed (event launched just once until key is released).
    • +
    • callback: function(manager, kstate)
    • +
    +
  • +
  • +

    key-up:

    +
      +
    • description: When a key is released.
    • +
    • callback: function(manager, kstate)
    • +
    +
  • +
  • +

    key-hold:

    +
      +
    • description: When the last key pressed is held down.
    • +
    • callback: function(manager, kstate)
    • +
    +
  • +
+

kstate:

+

A snapshot of the keyboard state when the event occured.

+
{
+    event: <Object>,       // The original js event
+    action: <String>,      // The event name (key-down/up, key-hold)
+    keys: <String>,        // The object of active keys
+    key: <String>,         // User-friendly key name
+}
+ +
+ +
+

Constructor

+
+

photonui.KeyboardManager

+ +
+ (
    +
  • + element +
  • +
  • + element +
  • +
  • + params +
  • +
) +
+ + + + + + + + +
+

+ Defined in + src/nonvisual/keyboardmanager.js:43 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + element + photonui.Widget + + +
    +

    Any PhotonUI Widget (optional).

    + +
    + +
  • +
  • + element + HTMLElement + + +
    +

    Any HTML element (optional).

    + +
    + +
  • +
  • + params + Object + + +
    +

    An object that can contain any property of the widget (optional).

    + +
    + +
  • +
+
+ + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onDocumentKeyDown

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/nonvisual/keyboardmanager.js:452 +

+ + + +
+ +
+

Used to grab all keyboard events

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onDocumentKeyUp

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/nonvisual/keyboardmanager.js:474 +

+ + + +
+ +
+

Used to grab all keyboard events

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onWindowBlur

+ + () + + + + private + + + + + +
+

+ Defined in + src/nonvisual/keyboardmanager.js:496 +

+ + + +
+ +
+

Called when the window loose focus

+ +
+ + + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_checkEvent

+ +
+ (
    +
  • + event +
  • +
) +
+ + + Boolean + + + + private + + + + + +
+

+ Defined in + src/nonvisual/keyboardmanager.js:322 +

+ + + +
+ +
+

Check the validity of the keyboard event

+ +
+ +
+

Parameters:

+ + +
+ +
+

Returns:

+ +
+ Boolean: +
+
+ + +
+
+

_checkFocus

+ + () + + + Boolean + + + + private + + + + + +
+

+ Defined in + src/nonvisual/keyboardmanager.js:309 +

+ + + +
+ +
+

Check if the user has not focused an input element

+ +
+ + +
+

Returns:

+ +
+ Boolean: +
+
+ + +
+
+

_dump

+ + () + + + Object + + + + private + + + + + +
+

+ Defined in + src/nonvisual/keyboardmanager.js:294 +

+ + + +
+ +
+

Take a snapshot of the KeyboardManager

+ +
+ + +
+

Returns:

+ +
+ Object: +
+
+ + +
+
+

_initKeyCache

+ + () + + + + private + + + + + +
+

+ Defined in + src/nonvisual/keyboardmanager.js:343 +

+ + + +
+ +
+

Create the key correspondance cache for basic touches

+ +
+ + + + +
+
+

_keyFromEvent

+ +
+ (
    +
  • + event +
  • +
) +
+ + + String + + + + private + + + + + +
+

+ Defined in + src/nonvisual/keyboardmanager.js:431 +

+ + + +
+ +
+

Get the key name from a native keyboard event

+ +
+ +
+

Parameters:

+ + +
+ +
+

Returns:

+ +
+ String: +
+
+ + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateEvents

+ + () + + + + private + + + + + +
+

+ Defined in + src/nonvisual/keyboardmanager.js:244 +

+ + + +
+ +
+

Bind events on the HTML Element.

+ +
+ + + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:157 +

+ + + +
+ +
+ Destroy the class. +
+ + + + +
+
+

isKeyPressed

+ +
+ (
    +
  • + key +
  • +
) +
+ + + Boolean + + + + + + + + +
+

+ Defined in + src/nonvisual/keyboardmanager.js:268 +

+ + + +
+ +
+

Check if a specific key is currently pressed.

+ +
+ +
+

Parameters:

+ +
    +
  • + key + String + + +
    +

    The key name

    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Boolean: +
+
+ + +
+
+

isKeyReleased

+ +
+ (
    +
  • + key +
  • +
) +
+ + + Boolean + + + + + + + + +
+

+ Defined in + src/nonvisual/keyboardmanager.js:280 +

+ + + +
+ +
+

Check if a specific key is currently released.

+ +
+ +
+

Parameters:

+ +
    +
  • + key + String + + +
    +

    The key name

    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Boolean: +
+
+ + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__event

+ Object + + + private + + + +
+

+ Defined in + src/nonvisual/keyboardmanager.js:190 +

+ + +
+ +
+

Last event object.

+ +
+ +

Default: null

+ + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__key

+ String + + + private + + + +
+

+ Defined in + src/nonvisual/keyboardmanager.js:210 +

+ + +
+ +
+

Last key concerned.

+ +
+ +

Default: null

+ + +
+
+

__keyCache

+ Array + + + private + + + +
+

+ Defined in + src/nonvisual/keyboardmanager.js:220 +

+ + +
+ +
+

KeyCode correspondance to key name.

+ +
+ + + +
+
+

__keyCodeCache

+ Array + + + private + + + +
+

+ Defined in + src/nonvisual/keyboardmanager.js:229 +

+ + +
+ +
+

Key name correspondance to key code.

+ +
+ + + +
+
+

action

+ String + + + + + +
+

+ Defined in + src/nonvisual/keyboardmanager.js:171 +

+ + +
+ +
+

The action:

+
    +
  • "key-down"
  • +
  • "key-up"
  • +
  • "key-hold"
  • +
+ +
+ + + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

element

+ HTMLElement + + + + + +
+

+ Defined in + src/nonvisual/keyboardmanager.js:144 +

+ + +
+ +
+

The HTML Element on which the events are binded.

+

NOTE: If a photonui.Widget object is assigned to this property, +its HTML Element will be automatically assigned to the property instead.

+ +
+ +

Default: null

+ + +
+
+

keys

+ Object + + + private + + + +
+

+ Defined in + src/nonvisual/keyboardmanager.js:200 +

+ + +
+ +
+

The currently active keys.

+ +
+ +

Default: {}

+ + +
+
+

noPreventDefault

+ Boolean + + + + + +
+

+ Defined in + src/nonvisual/keyboardmanager.js:126 +

+ + +
+ +
+

Disable concerned events default actions.

+ +
+ +

Default: false

+ + +
+
+

safe

+ Boolean + + + + + +
+

+ Defined in + src/nonvisual/keyboardmanager.js:108 +

+ + +
+ +
+

Disable the keyboard manager callbacks when focusing a input field-like element.

+ +
+ +

Default: true

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.Label.html b/ref/classes/photonui.Label.html new file mode 100644 index 00000000..df00b4fe --- /dev/null +++ b/ref/classes/photonui.Label.html @@ -0,0 +1,1805 @@ + + + + + photonui.Label - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.Label Class

+
+ +
+ Extends photonui.Widget +
+ +
+ Defined in: src/visual/label.js:42 +
+ + Module: Visual
+ Parent Module: PhotonUI + +
+ + +
+

Label.

+ +
+ +
+

Constructor

+
+

photonui.Label

+ + () + + + + + + + + +
+

+ Defined in + src/visual/label.js:42 +

+ + + +
+ +
+ +
+ + + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:445 +

+ + + +
+ +
+ Called when the context menu should be displayed. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:460 +

+ + + +
+ +
+ Called when the locale is changed. +
+ + + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/visual/label.js:196 +

+ + + +
+ +
+

Build the widget HTML.

+ +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:425 +

+ + + +
+ +
+ Called when the visibility changes. +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    +

    Current visibility state (otptional, defaut=this.visible)

    + +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/widget.js:367 +

+ + + +
+ +
+ Destroy the widget. +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

forInput

+ photonui.Field, photonui.CheckBox + + + + + +
+

+ Defined in + src/visual/label.js:163 +

+ + +
+ +
+

Link the label with the given input (Field, CheckBox,...) widget.

+ +
+ +

Default: null

+ + +
+
+

forInputName

+ String + + + + + +
+

+ Defined in + src/visual/label.js:132 +

+ + +
+ +
+

Link the label with the given input (Field, CheckBox,...) widget.

+ +
+ +

Default: null

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/visual/label.js:178 +

+ + +
+ +
+

Html outer element of the widget (if any).

+ +
+ +

Default: null

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

text

+ String + + + + + +
+

+ Defined in + src/visual/label.js:77 +

+ + +
+ +
+

The label text.

+ +
+ +

Default: "Label"

+ + +
+
+

textAlign

+ String + + + + + +
+

+ Defined in + src/visual/label.js:106 +

+ + +
+ +
+

The text horizontal alignement.

+
    +
  • "left",
  • +
  • "center",
  • +
  • "right".
  • +
+ +
+ +

Default: "left"

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.Layout.html b/ref/classes/photonui.Layout.html new file mode 100644 index 00000000..e759b1fe --- /dev/null +++ b/ref/classes/photonui.Layout.html @@ -0,0 +1,2130 @@ + + + + + photonui.Layout - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.Layout Class

+
+ +
+ Extends photonui.Container +
+ +
+ Defined in: src/layout/layout.js:42 +
+ + Module: Layout
+ Parent Module: PhotonUI + +
+ + +
+

Base class for layout.

+ +
+ +
+

Constructor

+
+

photonui.Layout

+ + () + + + + + + + + +
+

+ Defined in + src/layout/layout.js:42 +

+ + + +
+ +
+ +
+ + + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:445 +

+ + + +
+ +
+ Called when the context menu should be displayed. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/layout/layout.js:273 +

+ + + +
+ +
+

Called when the locale is changed.

+ +
+ + + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:415 +

+ + + +
+ +
+ Build the widget HTML. +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_lockUpdate

+ + () + + + + private + + + + + +
+

+ Defined in + src/layout/layout.js:223 +

+ + + +
+ +
+

Lock the update of the layout.

+ +
+ + + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateLayout

+ + () + + + + private + + + + + +
+

+ Defined in + src/layout/layout.js:240 +

+ + + +
+ +
+

Update the layout.

+ +
+ + + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/layout/layout.js:250 +

+ + + +
+ +
+

Called when the visibility changes.

+ +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    +

    Current visibility state (otptional, defaut=this.visible)

    + +
    + +
  • +
+
+ + + +
+
+

addChild

+ +
+ (
    +
  • + widget +
  • +
  • + layoutOption +
  • +
) +
+ + + + + + + + +
+

+ Defined in + src/layout/layout.js:159 +

+ + + +
+ +
+

Add a widget to the layout.

+ +
+ +
+

Parameters:

+ +
    +
  • + widget + photonui.Widget + + +
    +

    The widget to add.

    + +
    + +
  • +
  • + layoutOption + Object + + +
    +

    Specific option for the layout (optional).

    + +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/layout/layout.js:211 +

+ + + +
+ +
+

Destroy the widget.

+ +
+ + + + +
+
+

empty

+ + () + + + + + + + + +
+

+ Defined in + src/layout/layout.js:193 +

+ + + +
+ +
+

Destroy all children of the layout

+ +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeChild

+ +
+ (
    +
  • + widget +
  • +
) +
+ + + + + + + + +
+

Inherited from + + photonui.Container + + but overwritten in + src/layout/layout.js:178 +

+ + + +
+ +
+

Remove a widget from the layout.

+ +
+ +
+

Parameters:

+ + +
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

child

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:146 +

+ + +
+ +
+

The child widget.

+ +
+ +

Default: null (no child)

+ + +
+
+

childName

+ String + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:118 +

+ + +
+ +
+

The child widget name.

+ +
+ +

Default: null (no child)

+ + +
+
+

children

+ Array + + + + + +
+

+ Defined in + src/layout/layout.js:106 +

+ + +
+ +
+

Layout children widgets.

+ +
+ +

Default: []

+ + +
+
+

childrenNames

+ Array + + + + + +
+

+ Defined in + src/layout/layout.js:69 +

+ + +
+ +
+

Layout children widgets name.

+ +
+ +

Default: []

+ + +
+
+

containerNode

+ HTMLElement + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:165 +

+ + +
+ +
+

HTML Element that contain the child widget HTML.

+ +
+ + + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

horizontalChildExpansion

+ Boolean + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:66 +

+ + +
+ +
+

Horizontaly expand the container's child widget.

+ +
+ +

Default: true

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:262 +

+ + +
+ +
+ Html outer element of the widget (if any). +
+ +

Default: null

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

verticalChildExpansion

+ Boolean + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:92 +

+ + +
+ +
+

Verticaly expand the container's child widget.

+ +
+ +

Default: false

+ + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.ListView.html b/ref/classes/photonui.ListView.html new file mode 100644 index 00000000..643b7368 --- /dev/null +++ b/ref/classes/photonui.ListView.html @@ -0,0 +1,3729 @@ + + + + + photonui.ListView - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.ListView Class

+
+ +
+ Extends photonui.DataView +
+ +
+ Defined in: src/dataview/listview.js:44 +
+ + Module: DataView
+ Parent Module: PhotonUI + +
+ + +
+

ListView container.

+ +
+ +
+

Constructor

+
+

photonui.ListView

+ + () + + + + + + + + +
+

+ Defined in + src/dataview/listview.js:44 +

+ + + +
+ +
+ +
+ + + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onClick

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:861 +

+ + + +
+ +
+

Called when an element is clicked.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    +

    the click event

    + +
    + +
  • +
+
+ + + +
+
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:445 +

+ + + +
+ +
+ Called when the context menu should be displayed. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onDragEnd

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:970 +

+ + + +
+ +
+

Called when a item drag has ended.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onDragEnter

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:935 +

+ + + +
+ +
+

Called when a dragged item enters into another element.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onDragOver

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:1000 +

+ + + +
+ +
+

Called when a item is dragged (fix for firefox).

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onDragStart

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:903 +

+ + + +
+ +
+

Called when an item is dragged.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onDrop

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:1016 +

+ + + +
+ +
+

Called when a item is dropped (fix for firefox).

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onItemClick

+ +
+ (
    +
  • + event +
  • +
  • + item +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:885 +

+ + + +
+ +
+

Called when an item is clicked.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    +

    the click event

    + +
    + +
  • +
  • + item + Item + + +
    +

    the clicked item

    + +
    + +
  • +
+
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/dataview/dataview.js:1032 +

+ + + +
+ +
+

Called when the locale is changed.

+ +
+ + + + +
+
+

_addIdentifiersClasses

+ +
+ (
    +
  • + node +
  • +
  • + suffix +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:662 +

+ + + +
+ +
+

Adds classes defined by the identifiers property to a given element, with +a given suffix.

+ +
+ +
+

Parameters:

+ +
    +
  • + node + Element + + +
    +

    the node

    + +
    + +
  • +
  • + suffix + String + + +
    +

    the suffix of the classes

    + +
    + +
  • +
+
+ + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_buildContainerHtml

+ + () + + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:505 +

+ + + +
+ +
+

Build the widget container HTML.

+ +
+ + + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/dataview/dataview.js:495 +

+ + + +
+ +
+

Build the widget HTML.

+ +
+ + + + +
+
+

_buildItemsHtml

+ + () + + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:519 +

+ + + +
+ +
+

Build the items list HTML.

+ +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_empty

+ + () + + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:446 +

+ + + +
+ +
+

Destroy all children of the layout

+ +
+ + + + +
+
+

_generateColumns

+ + () + + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:632 +

+ + + +
+ +
+

Generate the list of columns.

+ +
+ + + + +
+
+

_generatePlaceholderElement

+ + () + + + Element + + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:833 +

+ + + +
+ +
+

Generates a placeholder item element.

+ +
+ + +
+

Returns:

+ +
+ Element: +

the placeholder item element

+ +
+
+ + +
+
+

_getChildren

+ + () + + + Array + + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:462 +

+ + + +
+ +
+

Layout children widgets.

+ +
+ + +
+

Returns:

+ +
+ Array: +

the childen widget

+ +
+
+ + +
+
+

_getItemByIndex

+ +
+ (
    +
  • + index +
  • +
) +
+ + + Object + + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:481 +

+ + + +
+ +
+

Returns the item at a given index.

+ +
+ +
+

Parameters:

+ +
    +
  • + index + Number + + +
    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Object: +

the item

+ +
+
+ + +
+
+

_getItemFromNode

+ +
+ (
    +
  • + itemNode +
  • +
) +
+ + + Object + + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:751 +

+ + + +
+ +
+

Gets an item of the collection from a given item DOM element.

+ +
+ +
+

Parameters:

+ +
    +
  • + itemNode + Element + + +
    +

    the item DOM element

    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Object: +

the item

+ +
+
+ + +
+
+

_handleClick

+ +
+ (
    +
  • + item +
  • +
  • + modifiers +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:782 +

+ + + +
+ +
+

Handle item click events.

+ +
+ +
+

Parameters:

+ +
    +
  • + item + Object + + +
    +

    the item

    + +
    + +
  • +
  • + modifiers + Object + + +
    +

    the modifiers states

    + +
    + +
      +
    • + ctrl + Object + +
      + +
      + +
    • +
    • + shift + Object + +
      + +
      + +
    • +
    +
  • +
+
+ + + +
+
+

_moveItem

+ +
+ (
    +
  • + itemIndex +
  • +
  • + destinationIndex +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:764 +

+ + + +
+ +
+

Moves the item at a givent index to another given index. Rebuilds the +dataview.

+ +
+ +
+

Parameters:

+ +
    +
  • + itemIndex + Number + + +
    +

    the index of the item to move

    + +
    + +
  • +
  • + destinationIndex + Number + + +
    +

    the destination index

    + +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_renderColumn

+ +
+ (
    +
  • + content +
  • +
  • + columnId +
  • +
) +
+ + + Element + + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:602 +

+ + + +
+ +
+

Renders a given column.

+ +
+ +
+

Parameters:

+ +
    +
  • + content + photonui.Widget | String + + +
    +

    the content of the column

    + +
    + +
  • +
  • + columnId + String + + +
    +

    the identifier of the column

    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Element: +

the rendered column

+ +
+
+ + +
+
+

_renderItem

+ +
+ (
    +
  • + item +
  • +
) +
+ + + Element + + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:551 +

+ + + +
+ +
+

Renders a given item.

+ +
+ +
+

Parameters:

+ +
    +
  • + item + Object + + +
    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Element: +

the rendered item

+ +
+
+ + +
+
+

_renderItemInner

+ +
+ (
    +
  • + itemNode +
  • +
  • + item +
  • +
) +
+ + + Element + + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:579 +

+ + + +
+ +
+

Renders all the columns of a given item.

+ +
+ +
+

Parameters:

+ +
    +
  • + itemNode + Element + + +
    +

    the container element of the item

    + +
    + +
  • +
  • + item + Object + + +
    +

    the rendered item

    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Element: +

the rendered item

+ +
+
+ + +
+
+

_selectItem

+ +
+ (
    +
  • + item +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:686 +

+ + + +
+ +
+

Selects an item.

+ +
+ +
+

Parameters:

+ +
    +
  • + item + Object + + +
    +

    the item

    + +
    + +
  • +
+
+ + + +
+
+

_selectItemsTo

+ +
+ (
    +
  • + item +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:718 +

+ + + +
+ +
+

Selects all items from the current selection to a given item.

+ +
+ +
+

Parameters:

+ +
    +
  • + item + Object + + +
    +

    the item

    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_unselectItem

+ +
+ (
    +
  • + item +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:702 +

+ + + +
+ +
+

Unselects an item.

+ +
+ +
+

Parameters:

+ +
    +
  • + item + Object + + +
    +

    the item

    + +
    + +
  • +
+
+ + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:425 +

+ + + +
+ +
+ Called when the visibility changes. +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    +

    Current visibility state (otptional, defaut=this.visible)

    + +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/dataview/dataview.js:388 +

+ + + +
+ +
+

Destroy the widget.

+ +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

selectItems

+ +
+ (
    +
  • + indexes +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:398 +

+ + + +
+ +
+

Selects the item(s) at given indexes.

+ +
+ +
+

Parameters:

+ +
    +
  • + indexes + ...Number | Number[] + + +
    + +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+

unselectAllItems

+ + () + + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:739 +

+ + + +
+ +
+

Unselects all items.

+ +
+ + + + +
+
+

unselectItems

+ +
+ (
    +
  • + indexes +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:421 +

+ + + +
+ +
+

Unselects the item(s) at given indexes.

+ +
+ +
+

Parameters:

+ +
    +
  • + indexes + ...Number | Number[] + + +
    + +
    + +
  • +
+
+ + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

allowShiftSelect

+ Boolean + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:215 +

+ + +
+ +
+

If true, allow selecting multiple items with one click when pressing +"shift" key. +Only used when "multiSelectable" option is set to "true".

+ +
+ +

Default: true

+ + +
+
+

columnElement

+ String + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:346 +

+ + +
+ +
+

The type of the columns DOM elements which will be created during the +render process.

+ +
+ +

Default: "span"

+ + +
+
+

columns

+ Array + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:277 +

+ + +
+ +
+

The list of columns which defines the structure of the items (if not +setted manually, the columns are automatically generated).

+ +
+ +

Default: null

+ + +
+
+

containerElement

+ String + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:314 +

+ + +
+ +
+

The type of the container DOM element which will be created during the +render process.

+ +
+ +

Default: "ul"

+ + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

customWidgetFormater

+ Function + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:247 +

+ + +
+ +
+

A custom formater function which overrides the default rendering process +of the widget.

+ +
+ +

Default: null

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

dragAndDroppable

+ Boolean + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:232 +

+ + +
+ +
+

Defines if the data items can be drag & dropped.

+ +
+ +

Default: false

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/dataview/dataview.js:302 +

+ + +
+ +
+

Html outer element of the widget (if any).

+ +
+ +

Default: null

+ + +
+
+

identifiers

+ Array + + + private + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:362 +

+ + +
+ +
+

The list of identifiers wich will be added to every generated elements +of the widget as classnames.

+ +
+ +

Default: []

+ + +
+
+

itemElement

+ String + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:330 +

+ + +
+ +
+

The type of the items DOM elements which will be created during the +render process.

+ +
+ +

Default: "li"

+ + +
+
+

items

+ Array + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:115 +

+ + +
+ +
+

The collection of items displayed by the data view widget.

+ +
+ +

Default: null

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

multiSelectable

+ Boolean + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:183 +

+ + +
+ +
+

Defines if the data items can be multi-selected. +Only used when "selectable" option is set to "true".

+ +
+ +

Default: false

+ + +
+
+

multiSelectWithCtrl

+ Boolean + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:199 +

+ + +
+ +
+

Defines wether or not "ctrl" key has to be pressed to multi-select items. +Only used when "multiSelectable" option is set to "true".

+ +
+ +

Default: true

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

selectable

+ Boolean + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:151 +

+ + +
+ +
+

Defines if the data items can be selected.

+ +
+ +

Default: false

+ + +
+
+

selectedItems

+ Array + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:263 +

+ + +
+ +
+

The currently selected items.

+ +
+ +

Default: []

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

unselectOnOutsideClick

+ Boolean + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:166 +

+ + +
+ +
+

If true, clicking outside of the items (in the container) will unselect +currently selected items. +Only used when "selectable" option is set to "true".

+ +
+ +

Default: false

+ + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.Menu.html b/ref/classes/photonui.Menu.html new file mode 100644 index 00000000..4e5f1380 --- /dev/null +++ b/ref/classes/photonui.Menu.html @@ -0,0 +1,2171 @@ + + + + + photonui.Menu - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.Menu Class

+
+ +
+ Extends photonui.Layout +
+ +
+ Defined in: src/layout/menu.js:42 +
+ + Module: Layout
+ Parent Module: PhotonUI + +
+ + +
+

Menu.

+ +
+ +
+

Constructor

+
+

photonui.Menu

+ + () + + + + + + + + +
+

+ Defined in + src/layout/menu.js:42 +

+ + + +
+ +
+ +
+ + + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:445 +

+ + + +
+ +
+ Called when the context menu should be displayed. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/layout/layout.js:273 +

+ + + +
+ +
+

Called when the locale is changed.

+ +
+ + + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/layout/menu.js:103 +

+ + + +
+ +
+

Build the widget HTML.

+ +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_lockUpdate

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Layout: + src/layout/layout.js:223 +

+ + + +
+ +
+

Lock the update of the layout.

+ +
+ + + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateLayout

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Layout + + but overwritten in + src/layout/menu.js:114 +

+ + + +
+ +
+

Update the layout.

+ +
+ + + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/layout/layout.js:250 +

+ + + +
+ +
+

Called when the visibility changes.

+ +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    +

    Current visibility state (otptional, defaut=this.visible)

    + +
    + +
  • +
+
+ + + +
+
+

addChild

+ +
+ (
    +
  • + widget +
  • +
  • + layoutOption +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Layout: + src/layout/layout.js:159 +

+ + + +
+ +
+

Add a widget to the layout.

+ +
+ +
+

Parameters:

+ +
    +
  • + widget + photonui.Widget + + +
    +

    The widget to add.

    + +
    + +
  • +
  • + layoutOption + Object + + +
    +

    Specific option for the layout (optional).

    + +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/layout/layout.js:211 +

+ + + +
+ +
+

Destroy the widget.

+ +
+ + + + +
+
+

empty

+ + () + + + + + + + + +
+

Inherited from + photonui.Layout: + src/layout/layout.js:193 +

+ + + +
+ +
+

Destroy all children of the layout

+ +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeChild

+ +
+ (
    +
  • + widget +
  • +
) +
+ + + + + + + + +
+

Inherited from + + photonui.Container + + but overwritten in + src/layout/layout.js:178 +

+ + + +
+ +
+

Remove a widget from the layout.

+ +
+ +
+

Parameters:

+ + +
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

child

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:146 +

+ + +
+ +
+

The child widget.

+ +
+ +

Default: null (no child)

+ + +
+
+

childName

+ String + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:118 +

+ + +
+ +
+

The child widget name.

+ +
+ +

Default: null (no child)

+ + +
+
+

children

+ Array + + + + + +
+

Inherited from + photonui.Layout: + src/layout/layout.js:106 +

+ + +
+ +
+

Layout children widgets.

+ +
+ +

Default: []

+ + +
+
+

childrenNames

+ Array + + + + + +
+

Inherited from + photonui.Layout: + src/layout/layout.js:69 +

+ + +
+ +
+

Layout children widgets name.

+ +
+ +

Default: []

+ + +
+
+

containerNode

+ HTMLElement + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:165 +

+ + +
+ +
+

HTML Element that contain the child widget HTML.

+ +
+ + + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

horizontalChildExpansion

+ Boolean + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:66 +

+ + +
+ +
+

Horizontaly expand the container's child widget.

+ +
+ +

Default: true

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/layout/menu.js:85 +

+ + +
+ +
+

Html outer element of the widget (if any).

+ +
+ +

Default: null

+ + +
+
+

iconVisible

+ Boolean + + + + + +
+

+ Defined in + src/layout/menu.js:62 +

+ + +
+ +
+

Define if icon on menu items are visible.

+ +
+ +

Default: : true

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

verticalChildExpansion

+ Boolean + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:92 +

+ + +
+ +
+

Verticaly expand the container's child widget.

+ +
+ +

Default: false

+ + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.MenuItem.html b/ref/classes/photonui.MenuItem.html new file mode 100644 index 00000000..6fb8a0d0 --- /dev/null +++ b/ref/classes/photonui.MenuItem.html @@ -0,0 +1,2045 @@ + + + + + photonui.MenuItem - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.MenuItem Class

+
+ +
+ Extends photonui.Container +
+ + + + Module: Container
+ Parent Module: PhotonUI + +
+ + +
+

Menu item.

+ +
+ +
+

Constructor

+
+

photonui.MenuItem

+ + () + + + + + + + + +
+

+ Defined in + src/container/menuitem.js:45 +

+ + + +
+ +
+ +
+ + + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:445 +

+ + + +
+ +
+ Called when the context menu should be displayed. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:460 +

+ + + +
+ +
+ Called when the locale is changed. +
+ + + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/container/menuitem.js:216 +

+ + + +
+ +
+

Build the widget HTML.

+ +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/container/container.js:208 +

+ + + +
+ +
+

Called when the visibility changes.

+ +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    +

    Current visibility state (otptional, defaut=this.visible)

    + +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/container/menuitem.js:201 +

+ + + +
+ +
+

Destroy the widget.

+ +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeChild

+ +
+ (
    +
  • + widget +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:182 +

+ + + +
+ +
+

Remove the given child.

+ +
+ +
+

Parameters:

+ + +
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

active

+ Boolean + + + + + +
+

+ Defined in + src/container/menuitem.js:148 +

+ + +
+ +
+

Determine if the item is active (highlighted).

+ +
+ +

Default: false

+ + +
+
+

child

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:146 +

+ + +
+ +
+

The child widget.

+ +
+ +

Default: null (no child)

+ + +
+
+

childName

+ String + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:118 +

+ + +
+ +
+

The child widget name.

+ +
+ +

Default: null (no child)

+ + +
+
+

containerNode

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Container + + but overwritten in + src/container/menuitem.js:184 +

+ + +
+ +
+

HTML Element that contain the child widget HTML.

+ +
+ + + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

horizontalChildExpansion

+ Boolean + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:66 +

+ + +
+ +
+

Horizontaly expand the container's child widget.

+ +
+ +

Default: true

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/container/menuitem.js:172 +

+ + +
+ +
+

Html outer element of the widget (if any).

+ +
+ +

Default: null

+ + +
+
+

icon

+ photonui.BaseIcon + + + + + +
+

+ Defined in + src/container/menuitem.js:128 +

+ + +
+ +
+

Left icon widget.

+ +
+ +

Default: : null

+ + +
+
+

iconName

+ String + + + + + +
+

+ Defined in + src/container/menuitem.js:107 +

+ + +
+ +
+

Left icon widget name.

+ +
+ +

Default: : null

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

text

+ String + + + + + +
+

+ Defined in + src/container/menuitem.js:87 +

+ + +
+ +
+

The item text.

+ +
+ +

Default: "Menu Item"

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

value

+ String (maybe) + + + + + +
+

+ Defined in + src/container/menuitem.js:70 +

+ + +
+ +
+

An optional value for the item (can be used in select).

+ +
+ +

Default: ""

+ + +
+
+

verticalChildExpansion

+ Boolean + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:92 +

+ + +
+ +
+

Verticaly expand the container's child widget.

+ +
+ +

Default: false

+ + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.MouseManager.html b/ref/classes/photonui.MouseManager.html new file mode 100644 index 00000000..b0f714cb --- /dev/null +++ b/ref/classes/photonui.MouseManager.html @@ -0,0 +1,2248 @@ + + + + + photonui.MouseManager - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.MouseManager Class

+
+ +
+ Extends photonui.Base +
+ + + + Module: NonVisual
+ Parent Module: PhotonUI + +
+ + +
+

Manage advanced mouse events on Widgets or HTMLElements.

+

wEvents:

+
    +
  • +

    mouse-event:

    +
      +
    • description: Called for ALL mouse events.
    • +
    • callback: function(manager, mstate)
    • +
    +
  • +
  • +

    mouse-down:

    +
      +
    • description: Mouse button pressed.
    • +
    • callback: function(manager, mstate)
    • +
    +
  • +
  • +

    mouse-up:

    +
      +
    • description: Mouse button released.
    • +
    • callback: function(manager, mstate)
    • +
    +
  • +
  • +

    click:

    +
      +
    • description: Click...
    • +
    • callback: function(manager, mstate)
    • +
    +
  • +
  • +

    double-click:

    +
      +
    • description: Double click...
    • +
    • callback: function(manager, mstate)
    • +
    +
  • +
  • +

    drag-start:

    +
      +
    • description: Start dragging.
    • +
    • callback: function(manager, mstate)
    • +
    +
  • +
  • +

    dragging:

    +
      +
    • description: dragging.
    • +
    • callback: function(manager, mstate)
    • +
    +
  • +
  • +

    drag-end:

    +
      +
    • description: Stop dragging.
    • +
    • callback: function(manager, mstate)
    • +
    +
  • +
  • +

    mouse-move:

    +
      +
    • description: Mouse move on the element.
    • +
    • callback: function(manager, mstate)
    • +
    +
  • +
  • +

    scroll-up:

    +
      +
    • description: Scroll up.
    • +
    • callback: function(manager, mstate)
    • +
    +
  • +
  • +

    scroll-down:

    +
      +
    • description: Scroll down.
    • +
    • callback: function(manager, mstate)
    • +
    +
  • +
+

mstate:

+

A snapshot of the mouse state ath the moment when the event occured.

+
{
+    event: <Object>,       // The original js event
+    action: <String>,      // The event name (mouse-down/up/move, click, double-click,
+                           //    drag-start/end, dragging, scroll-up/down)
+    pageX: <Number>,       // X position, relative to page top-left corner.
+    pageY: <Number>,       // Y position, relative to page top-left corner.
+    x: <Number>,           // X position, relative to the HTML element.
+    y: <Number>,           // Y position, relative to the HTML element.
+    deltaX: <Number>,      // Delta X (current_x - previous_x)
+    deltaY: <Number>,      // Delta Y (current_y - previous_y)
+    btnLeft: <Boolean>,    // Current state of the mouse left button.
+    btnMiddle: <Boolean>,  // Current state of the mouse middle button.
+    btnRight: <Boolean>,   // Current state of the mouse right button.
+    button: <String>       // The button that triggered the last event (none, "left", "middle", "right").
+}
+ +
+ +
+

Constructor

+
+

photonui.MouseManager

+ +
+ (
    +
  • + element +
  • +
  • + element +
  • +
  • + params +
  • +
) +
+ + + + + + + + +
+

+ Defined in + src/nonvisual/mousemanager.js:43 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + element + photonui.Widget + + +
    +

    Any PhotonUI Widget (optional).

    + +
    + +
  • +
  • + element + HTMLElement + + +
    +

    Any HTML element (optional).

    + +
    + +
  • +
  • + params + Object + + +
    +

    additional params (optional).

    + +
    + +
  • +
+
+ + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onDocumentMouseMove

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/nonvisual/mousemanager.js:701 +

+ + + +
+ +
+

Used to detect dragging outside the element.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onDocumentMouseUp

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/nonvisual/mousemanager.js:680 +

+ + + +
+ +
+

Used to detect drag-end outside the element.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onDoubleClick

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/nonvisual/mousemanager.js:662 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onMouseDown

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/nonvisual/mousemanager.js:644 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onMouseMove

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/nonvisual/mousemanager.js:671 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onMouseUp

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/nonvisual/mousemanager.js:653 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onWheel

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/nonvisual/mousemanager.js:717 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_dump

+ + () + + + Object + + + + private + + + + + +
+

+ Defined in + src/nonvisual/mousemanager.js:484 +

+ + + +
+ +
+

Take a snapshot of the MouseManager

+ +
+ + +
+

Returns:

+ +
+ Object: +
+
+ + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_stateMachine

+ +
+ (
    +
  • + action +
  • +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/nonvisual/mousemanager.js:508 +

+ + + +
+ +
+

Analyze and dispatche wEvents.

+ +
+ +
+

Parameters:

+ +
    +
  • + action + String + + +
    +

    The action name (e.g. "mouse-up").

    + +
    + +
  • +
  • + event + Object + + +
    +

    The js event.

    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateEvents

+ + () + + + + private + + + + + +
+

+ Defined in + src/nonvisual/mousemanager.js:458 +

+ + + +
+ +
+

Bind events on the HTML Element.

+ +
+ + + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:157 +

+ + + +
+ +
+ Destroy the class. +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__dragStartButton

+ String + + + private + + + +
+

+ Defined in + src/nonvisual/mousemanager.js:439 +

+ + +
+ +
+

The button that triggered the drag start event

+
    +
  • null
  • +
  • "left"
  • +
  • "middle"
  • +
  • "right"
  • +
+ +
+ +

Default: null

+ + +
+
+

__event

+ Object + + + private + + + +
+

+ Defined in + src/nonvisual/mousemanager.js:429 +

+ + +
+ +
+

Last event object.

+ +
+ +

Default: {}

+ + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__mouseDownEvent

+ Object + + + private + + + +
+

+ Defined in + src/nonvisual/mousemanager.js:420 +

+ + +
+ +
+

Js event on mouse down.

+ +
+ + + +
+
+

__prevState

+ Object + + + private + + + +
+

+ Defined in + src/nonvisual/mousemanager.js:411 +

+ + +
+ +
+

Previous state.

+ +
+ + + +
+
+

action

+ String + + + + + +
+

+ Defined in + src/nonvisual/mousemanager.js:328 +

+ + +
+ +
+

The action:

+
    +
  • "mouse-down"
  • +
  • "moues-up"
  • +
  • "click"
  • +
  • "double-click"
  • +
  • "drag-start"
  • +
  • "dragging"
  • +
  • "drag-end"
  • +
  • "scroll-down"
  • +
  • "scroll-up"
  • +
  • "mouse-move"
  • +
+ +
+ + + +
+
+

btnLeft

+ Boolean + + + + + +
+

+ Defined in + src/nonvisual/mousemanager.js:352 +

+ + +
+ +
+

Current state of the mouse left button.

+ +
+ + + +
+
+

btnMiddle

+ Boolean + + + + + +
+

+ Defined in + src/nonvisual/mousemanager.js:365 +

+ + +
+ +
+

Current state of the mouse middle button.

+ +
+ + + +
+
+

btnRight

+ Boolean + + + + + +
+

+ Defined in + src/nonvisual/mousemanager.js:378 +

+ + +
+ +
+

Current state of the mouse right button.

+ +
+ + + +
+
+

button

+ String + + + + + +
+

+ Defined in + src/nonvisual/mousemanager.js:391 +

+ + +
+ +
+

The button that triggered the last event.

+
    +
  • none
  • +
  • "left"
  • +
  • "middle"
  • +
  • "right"
  • +
+ +
+ + + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

deltaX

+ Number + + + + + +
+

+ Defined in + src/nonvisual/mousemanager.js:304 +

+ + +
+ +
+

Delta X (current_x - previous_x).

+ +
+ + + +
+
+

deltaY

+ Number + + + + + +
+

+ Defined in + src/nonvisual/mousemanager.js:316 +

+ + +
+ +
+

Delta Y (current_y - previous_y).

+ +
+ + + +
+
+

element

+ HTMLElement + + + + + +
+

+ Defined in + src/nonvisual/mousemanager.js:143 +

+ + +
+ +
+

The HTML Element on which the events are binded.

+

NOTE: If a photonui.Widget object is assigned to this property, +its HTML Element will be automatically assigned to the property instead.

+ +
+ +

Default: null

+ + +
+
+

pageX

+ Number + + + + + +
+

+ Defined in + src/nonvisual/mousemanager.js:256 +

+ + +
+ +
+

X position, relative to page top-left corner.

+ +
+ +

Default: 0

+ + +
+
+

pageY

+ Number + + + + + +
+

+ Defined in + src/nonvisual/mousemanager.js:268 +

+ + +
+ +
+

Y position, relative to page top-left corner.

+ +
+ +

Default: 0

+ + +
+
+

scaleX

+ Number + + + + + +
+

+ Defined in + src/nonvisual/mousemanager.js:188 +

+ + +
+ +
+

Scale all position events by a factor. Use it when the canvas is scaled.

+ +
+ +

Default: 1

+ + +
+
+

scaleY

+ Number + + + + + +
+

+ Defined in + src/nonvisual/mousemanager.js:205 +

+ + +
+ +
+

Scale all position events by a factor. Use it when the canvas is scaled.

+ +
+ +

Default: 1

+ + +
+
+

threshold

+ Number + + + + + +
+

+ Defined in + src/nonvisual/mousemanager.js:170 +

+ + +
+ +
+

Minimum distance for triggering a drag-start, and maximum distance +to consider a mouse down/up as a click.

+ +
+ +

Default: 5

+ + +
+
+

translateX

+ Number + + + + + +
+

+ Defined in + src/nonvisual/mousemanager.js:222 +

+ + +
+ +
+

Translate all position events by a scalar. Use it when the canvas is translated.

+ +
+ +

Default: 0

+ + +
+
+

translateY

+ Number + + + + + +
+

+ Defined in + src/nonvisual/mousemanager.js:239 +

+ + +
+ +
+

Translate all position events by a scalar. Use it when the canvas is translated.

+ +
+ +

Default: 0

+ + +
+
+

x

+ Number + + + + + +
+

+ Defined in + src/nonvisual/mousemanager.js:280 +

+ + +
+ +
+

X position, relative to the HTML element.

+ +
+ + + +
+
+

y

+ Number + + + + + +
+

+ Defined in + src/nonvisual/mousemanager.js:292 +

+ + +
+ +
+

Y position, relative to the HTML element.

+ +
+ + + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.NumericField.html b/ref/classes/photonui.NumericField.html new file mode 100644 index 00000000..0cef3c99 --- /dev/null +++ b/ref/classes/photonui.NumericField.html @@ -0,0 +1,2453 @@ + + + + + photonui.NumericField - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.NumericField Class

+
+ +
+ Extends photonui.Field +
+ + + + Module: Interactive
+ Parent Module: PhotonUI + +
+ + +
+

Numeric field.

+ +
+ +
+

Constructor

+
+

photonui.NumericField

+ + () + + + + + + + + +
+

+ Defined in + src/interactive/numericfield.js:41 +

+ + + +
+ +
+ +
+ + + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__debValueChangedFinal

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Field: + src/interactive/field.js:207 +

+ + + +
+ +
+

Debounced version of __forValueChangedFinal.

+ +
+ + + + +
+
+

__forValueChangedFinal

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Field: + src/interactive/field.js:197 +

+ + + +
+ +
+

To be called indirectly through __debValueChangedFinal().

+ +
+ + + + +
+
+

__onChange

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/interactive/numericfield.js:311 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/interactive/field.js:186 +

+ + + +
+ +
+

Called when the context menu should be displayed.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onKeydown

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/interactive/numericfield.js:362 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onKeypress

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/interactive/numericfield.js:270 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onKeyup

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/interactive/numericfield.js:298 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:460 +

+ + + +
+ +
+ Called when the locale is changed. +
+ + + + +
+
+

__onMouseWheel

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/interactive/numericfield.js:322 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_bindFieldEvents

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Field: + src/interactive/field.js:149 +

+ + + +
+ +
+

Bind Field events.

+ +
+ + + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/interactive/numericfield.js:254 +

+ + + +
+ +
+

Build the widget HTML.

+ +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateFieldValue

+ + () + + + + private + + + + + +
+

+ Defined in + src/interactive/numericfield.js:221 +

+ + + +
+ +
+

Update the value in the html field.

+ +
+ + + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_updateValue

+ +
+ (
    +
  • + value +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/interactive/numericfield.js:191 +

+ + + +
+ +
+

Update the value (in the widget).

+ +
+ +
+

Parameters:

+ +
    +
  • + value + String | Number + + +
    +

    The raw value.

    + +
    + +
  • +
+
+ + + +
+
+

_validateInput

+ +
+ (
    +
  • + value +
  • +
) +
+ + + Boolean + + + + private + + + + + +
+

+ Defined in + src/interactive/numericfield.js:231 +

+ + + +
+ +
+

Validate the user inputs.

+ +
+ +
+

Parameters:

+ +
    +
  • + value + String + + +
    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Boolean: +
+
+ + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:425 +

+ + + +
+ +
+ Called when the visibility changes. +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    +

    Current visibility state (otptional, defaut=this.visible)

    + +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/widget.js:367 +

+ + + +
+ +
+ Destroy the widget. +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

decimalDigits

+ Number + + + + + +
+

+ Defined in + src/interactive/numericfield.js:126 +

+ + +
+ +
+

The number of digit after the decimal dot.

+ +
+ +

Default: null (no limite)

+ + +
+
+

decimalSymbol

+ String + + + + + +
+

+ Defined in + src/interactive/numericfield.js:146 +

+ + +
+ +
+

The decimal symbol ("." or ",").

+ +
+ +

Default: : "."

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/interactive/field.js:131 +

+ + +
+ +
+

Html outer element of the widget (if any).

+ +
+ +

Default: null

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

max

+ Number +default null (no maximum); + + + + + +
+

+ Defined in + src/interactive/numericfield.js:89 +

+ + +
+ +
+

The maximum value of the field.

+ +
+ + + +
+
+

min

+ Number +default null (no minimum); + + + + + +
+

+ Defined in + src/interactive/numericfield.js:69 +

+ + +
+ +
+

The minimum value of the field.

+ +
+ + + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

Placeholder

+ String + + + + + +
+

Inherited from + photonui.Field: + src/interactive/field.js:112 +

+ + +
+ +
+

The placeholder displayed if the field is empty.

+ +
+ +

Default: ""

+ + +
+
+

step

+ Number +default 1 + + + + + +
+

+ Defined in + src/interactive/numericfield.js:109 +

+ + +
+ +
+

The incrementation step of the field.

+ +
+ + + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

value

+ Number + + + + + +
+

Inherited from + + photonui.Field + + but overwritten in + src/interactive/numericfield.js:166 +

+ + +
+ +
+

The field value.

+ +
+ +

Default: 0

+ + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.PopupMenu.html b/ref/classes/photonui.PopupMenu.html new file mode 100644 index 00000000..02074b00 --- /dev/null +++ b/ref/classes/photonui.PopupMenu.html @@ -0,0 +1,2612 @@ + + + + + photonui.PopupMenu - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.PopupMenu Class

+
+
+ Uses + +
+ +
+ Extends photonui.PopupWindow +
+ + + + Module: Composite
+ Parent Module: PhotonUI + +
+ + +
+

Popup Menu.

+ +
+ +
+

Constructor

+
+

photonui.PopupMenu

+ + () + + + + + + + + +
+

+ Defined in + src/composite/popupmenu.js:42 +

+ + + +
+ +
+ +
+ + + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:445 +

+ + + +
+ +
+ Called when the context menu should be displayed. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/composite/popupmenu.js:105 +

+ + + +
+ +
+

Called when the locale is changed.

+ +
+ + + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/composite/popupmenu.js:86 +

+ + + +
+ +
+

Build the widget HTML.

+ +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_lockUpdate

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Layout: + src/layout/layout.js:223 +

+ + + +
+ +
+ Lock the update of the layout. +
+ + + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateLayout

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Menu + + but overwritten in + src/layout/layout.js:240 +

+ + + +
+ +
+ Update the layout. +
+ + + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/layout/layout.js:250 +

+ + + +
+ +
+ Called when the visibility changes. +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    + Current visibility state (otptional, defaut=this.visible) +
    + +
  • +
+
+ + + +
+
+

addChild

+ +
+ (
    +
  • + widget +
  • +
  • + layoutOption +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Layout: + src/layout/layout.js:159 +

+ + + +
+ +
+ Add a widget to the layout. +
+ +
+

Parameters:

+ +
    +
  • + widget + photonui.Widget + + +
    + The widget to add. +
    + +
  • +
  • + layoutOption + Object + + +
    + Specific option for the layout (optional). +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

center

+ + () + + + + + + + + +
+

Inherited from + photonui.BaseWindow: + src/container/basewindow.js:340 +

+ + + +
+ +
+ Center the window. +
+ + + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/layout/layout.js:211 +

+ + + +
+ +
+ Destroy the widget. +
+ + + + +
+
+

empty

+ + () + + + + + + + + +
+

Inherited from + photonui.Layout: + src/layout/layout.js:193 +

+ + + +
+ +
+ Destroy all children of the layout +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

popupWidget

+ +
+ (
    +
  • + widget +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.PopupWindow: + src/container/popupwindow.js:111 +

+ + + +
+ +
+ Pop the window at the best position for the given widget. +
+ +
+

Parameters:

+ + +
+ + + +
+
+

popupXY

+ +
+ (
    +
  • + x +
  • +
  • + y +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.PopupWindow: + src/container/popupwindow.js:77 +

+ + + +
+ +
+ Pop the window at the given position. +
+ +
+

Parameters:

+ +
    +
  • + x + Number + + +
    + +
    + +
  • +
  • + y + Number + + +
    + +
    + +
  • +
+
+ + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeChild

+ +
+ (
    +
  • + widget +
  • +
) +
+ + + + + + + + +
+

Inherited from + + photonui.Container + + but overwritten in + src/layout/layout.js:178 +

+ + + +
+ +
+ Remove a widget from the layout. +
+ +
+

Parameters:

+ + +
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

child

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:146 +

+ + +
+ +
+ The child widget. +
+ +

Default: null (no child)

+ + +
+
+

childName

+ String + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:118 +

+ + +
+ +
+ The child widget name. +
+ +

Default: null (no child)

+ + +
+
+

children

+ Array + + + + + +
+

Inherited from + photonui.Layout: + src/layout/layout.js:106 +

+ + +
+ +
+ Layout children widgets. +
+ +

Default: []

+ + +
+
+

childrenNames

+ Array + + + + + +
+

Inherited from + photonui.Layout: + src/layout/layout.js:69 +

+ + +
+ +
+ Layout children widgets name. +
+ +

Default: []

+ + +
+
+

containerNode

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Container + + but overwritten in + src/container/popupwindow.js:60 +

+ + +
+ +
+ HTML Element that contain the child widget HTML. +
+ + + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

height

+ Number + + + + + + + +
+ Height of the container node. +
+ +

Default: : null (auto)

+ + +
+
+

horizontalChildExpansion

+ Boolean + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:66 +

+ + +
+ +
+ Horizontaly expand the container's child widget. +
+ +

Default: true

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/layout/menu.js:85 +

+ + +
+ +
+ Html outer element of the widget (if any). +
+ +

Default: null

+ + +
+
+

iconVisible

+ Boolean + + + + + +
+

Inherited from + photonui.Menu: + src/layout/menu.js:62 +

+ + +
+ +
+ Define if icon on menu items are visible. +
+ +

Default: : true

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

maxHeight

+ Number + + + + + + + +
+ Maximum height of the container node. +
+ +

Default: : null (no maximum)

+ + +
+
+

maxWidth

+ Number + + + + + + + +
+ Maximum width of the container node. +
+ +

Default: : null (no maximum)

+ + +
+
+

minHeight

+ Number + + + + + + + +
+ Minimum height of the container node. +
+ +

Default: : null (no minimum)

+ + +
+
+

minWidth

+ Number + + + + + + + +
+ Minimum width of the container node. +
+ +

Default: : null (no minimum)

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

padding

+ Number + + + + + + + +
+ Window container node padding. +
+ +

Default: 0

+ + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

position

+ Object + + + + + +
+

Inherited from + photonui.BaseWindow: + src/container/basewindow.js:78 +

+ + +
+ +
+ Window position. + + {x: Number, y: Number} +
+ +

Default: {x: 0, y: 0}

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

verticalChildExpansion

+ Boolean + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:92 +

+ + +
+ +
+ Verticaly expand the container's child widget. +
+ +

Default: false

+ + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+

width

+ Number + + + + + + + +
+ Width of the container node. +
+ +

Default: : null (auto)

+ + +
+
+

x

+ Number + + + + + + + +
+ The X position of the Window. +
+ +

Default: 0

+ + +
+
+

y

+ Number + + + + + + + +
+ The Y position of the Window. +
+ +

Default: 0

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.PopupWindow.html b/ref/classes/photonui.PopupWindow.html new file mode 100644 index 00000000..afd5e0b7 --- /dev/null +++ b/ref/classes/photonui.PopupWindow.html @@ -0,0 +1,2358 @@ + + + + + photonui.PopupWindow - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.PopupWindow Class

+
+ +
+ Extends photonui.BaseWindow +
+ + + + Module: Container
+ Parent Module: PhotonUI + +
+ + +
+

Popup Window.

+ +
+ +
+

Constructor

+
+

photonui.PopupWindow

+ + () + + + + + + + + +
+

+ Defined in + src/container/popupwindow.js:41 +

+ + + +
+ +
+ +
+ + + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:445 +

+ + + +
+ +
+ Called when the context menu should be displayed. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:460 +

+ + + +
+ +
+ Called when the locale is changed. +
+ + + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/container/popupwindow.js:156 +

+ + + +
+ +
+

Build the widget HTML.

+ +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/container/container.js:208 +

+ + + +
+ +
+

Called when the visibility changes.

+ +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    +

    Current visibility state (otptional, defaut=this.visible)

    + +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

center

+ + () + + + + + + + + +
+

Inherited from + photonui.BaseWindow: + src/container/basewindow.js:340 +

+ + + +
+ +
+

Center the window.

+ +
+ + + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/container/container.js:194 +

+ + + +
+ +
+

Destroy the widget.

+ +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

popupWidget

+ +
+ (
    +
  • + widget +
  • +
) +
+ + + + + + + + +
+

+ Defined in + src/container/popupwindow.js:111 +

+ + + +
+ +
+

Pop the window at the best position for the given widget.

+ +
+ +
+

Parameters:

+ + +
+ + + +
+
+

popupXY

+ +
+ (
    +
  • + x +
  • +
  • + y +
  • +
) +
+ + + + + + + + +
+

+ Defined in + src/container/popupwindow.js:77 +

+ + + +
+ +
+

Pop the window at the given position.

+ +
+ +
+

Parameters:

+ +
    +
  • + x + Number + + +
    + +
    + +
  • +
  • + y + Number + + +
    + +
    + +
  • +
+
+ + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeChild

+ +
+ (
    +
  • + widget +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:182 +

+ + + +
+ +
+

Remove the given child.

+ +
+ +
+

Parameters:

+ + +
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

child

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:146 +

+ + +
+ +
+

The child widget.

+ +
+ +

Default: null (no child)

+ + +
+
+

childName

+ String + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:118 +

+ + +
+ +
+

The child widget name.

+ +
+ +

Default: null (no child)

+ + +
+
+

containerNode

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Container + + but overwritten in + src/container/popupwindow.js:60 +

+ + +
+ +
+

HTML Element that contain the child widget HTML.

+ +
+ + + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

height

+ Number + + + + + + + +
+

Height of the container node.

+ +
+ +

Default: : null (auto)

+ + +
+
+

horizontalChildExpansion

+ Boolean + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:66 +

+ + +
+ +
+

Horizontaly expand the container's child widget.

+ +
+ +

Default: true

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/container/basewindow.js:311 +

+ + +
+ +
+

Html outer element of the widget (if any).

+ +
+ +

Default: null

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

maxHeight

+ Number + + + + + + + +
+

Maximum height of the container node.

+ +
+ +

Default: : null (no maximum)

+ + +
+
+

maxWidth

+ Number + + + + + + + +
+

Maximum width of the container node.

+ +
+ +

Default: : null (no maximum)

+ + +
+
+

minHeight

+ Number + + + + + + + +
+

Minimum height of the container node.

+ +
+ +

Default: : null (no minimum)

+ + +
+
+

minWidth

+ Number + + + + + + + +
+

Minimum width of the container node.

+ +
+ +

Default: : null (no minimum)

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

padding

+ Number + + + + + + + +
+

Window container node padding.

+ +
+ +

Default: 0

+ + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

position

+ Object + + + + + +
+

Inherited from + photonui.BaseWindow: + src/container/basewindow.js:78 +

+ + +
+ +
+

Window position.

+
{x: Number, y: Number}
+ +
+ +

Default: {x: 0, y: 0}

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

verticalChildExpansion

+ Boolean + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:92 +

+ + +
+ +
+

Verticaly expand the container's child widget.

+ +
+ +

Default: false

+ + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+

width

+ Number + + + + + + + +
+

Width of the container node.

+ +
+ +

Default: : null (auto)

+ + +
+
+

x

+ Number + + + + + + + +
+

The X position of the Window.

+ +
+ +

Default: 0

+ + +
+
+

y

+ Number + + + + + + + +
+

The Y position of the Window.

+ +
+ +

Default: 0

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.ProgressBar.html b/ref/classes/photonui.ProgressBar.html new file mode 100644 index 00000000..cc2ab833 --- /dev/null +++ b/ref/classes/photonui.ProgressBar.html @@ -0,0 +1,1804 @@ + + + + + photonui.ProgressBar - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.ProgressBar Class

+
+ +
+ Extends photonui.Widget +
+ + + + Module: Visual
+ Parent Module: PhotonUI + +
+ + +
+

ProgressBar.

+ +
+ +
+

Constructor

+
+

photonui.ProgressBar

+ + () + + + + + + + + +
+

+ Defined in + src/visual/progressbar.js:41 +

+ + + +
+ +
+ +
+ + + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:445 +

+ + + +
+ +
+ Called when the context menu should be displayed. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/visual/progressbar.js:217 +

+ + + +
+ +
+

Called when the locale is changed.

+ +
+ + + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/visual/progressbar.js:183 +

+ + + +
+ +
+

Build the widget HTML.

+ +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:425 +

+ + + +
+ +
+ Called when the visibility changes. +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    +

    Current visibility state (otptional, defaut=this.visible)

    + +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/widget.js:367 +

+ + + +
+ +
+ Destroy the widget. +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/visual/progressbar.js:61 +

+ + +
+ +
+

Html outer element of the widget (if any).

+ +
+ +

Default: null

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

orientation

+ String + + + + + +
+

+ Defined in + src/visual/progressbar.js:105 +

+ + +
+ +
+

The progressbar orientation ("vertical" or "horizontal").

+ +
+ +

Default: "horizontal"

+ + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

pulsate

+ Boolean + + + + + +
+

+ Defined in + src/visual/progressbar.js:132 +

+ + +
+ +
+

Enable or disable the progressbar pulsate mode.

+ +
+ +

Default: false

+ + +
+
+

textVisible

+ Boolean + + + + + +
+

+ Defined in + src/visual/progressbar.js:161 +

+ + +
+ +
+

Display/hide the progression text.

+ +
+ +

Default: true

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

value

+ Number + + + + + +
+

+ Defined in + src/visual/progressbar.js:79 +

+ + +
+ +
+

The progression (form 0.00 to 1.00).

+ +
+ +

Default: 0

+ + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.Select.html b/ref/classes/photonui.Select.html new file mode 100644 index 00000000..3a400296 --- /dev/null +++ b/ref/classes/photonui.Select.html @@ -0,0 +1,2420 @@ + + + + + photonui.Select - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.Select Class

+
+ +
+ Extends photonui.Widget +
+ +
+ Defined in: src/composite/select.js:45 +
+ + Module: Composite
+ Parent Module: PhotonUI + +
+ + +
+

Select input.

+

wEvents:

+
    +
  • value-changed: +
      +
    • description: called when the value was modified.
    • +
    • callback: function(widget, value)
    • +
    +
  • +
+ +
+ +
+

Constructor

+
+

photonui.Select

+ + () + + + + + + + + +
+

+ Defined in + src/composite/select.js:45 +

+ + + +
+ +
+ +
+ + + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onClick

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/composite/select.js:375 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:445 +

+ + + +
+ +
+ Called when the context menu should be displayed. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onItemClicked

+ +
+ (
    +
  • + widget +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/composite/select.js:402 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ + +
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/composite/select.js:412 +

+ + + +
+ +
+ +
+ + + + +
+
+

__onMouseDown

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/composite/select.js:391 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/composite/select.js:342 +

+ + + +
+ +
+

Build the widget HTML.

+ +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateItemsBinding

+ + () + + + + private + + + + + +
+

+ Defined in + src/composite/select.js:354 +

+ + + +
+ +
+

Update the popup items binding.

+ +
+ + + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:425 +

+ + + +
+ +
+ Called when the visibility changes. +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    +

    Current visibility state (otptional, defaut=this.visible)

    + +
    + +
  • +
+
+ + + +
+
+

addChild

+ +
+ (
    +
  • + widget +
  • +
  • + layoutOption +
  • +
) +
+ + + + + + + + +
+

+ Defined in + src/composite/select.js:313 +

+ + + +
+ +
+

Add a widget to the layout.

+ +
+ +
+

Parameters:

+ +
    +
  • + widget + photonui.Widget + + +
    +

    The widget to add.

    + +
    + +
  • +
  • + layoutOption + Object + + +
    +

    Specific option for the layout (optional).

    + +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/composite/select.js:325 +

+ + + +
+ +
+

Destroy the widget.

+ +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

__popupMenu

+ photonui.PopupMenu + + + private + + + +
+

+ Defined in + src/composite/select.js:298 +

+ + +
+ +
+

The popupMenu.

+ +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

children

+ Array + + + + + +
+

+ Defined in + src/composite/select.js:142 +

+ + +
+ +
+

Layout children widgets.

+ +
+ +

Default: []

+ + +
+
+

childrenNames

+ Array + + + + + +
+

+ Defined in + src/composite/select.js:155 +

+ + +
+ +
+

Layout children widgets name.

+ +
+ +

Default: []

+ + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/composite/select.js:284 +

+ + +
+ +
+

Html outer element of the widget (if any).

+ +
+ +

Default: null

+ + +
+
+

iconVisible

+ Boolean + + + + + +
+

+ Defined in + src/composite/select.js:257 +

+ + +
+ +
+

Define if icon on menu items are visible.

+ +
+ +

Default: : false

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

placeholder

+ String + + + + + +
+

+ Defined in + src/composite/select.js:125 +

+ + +
+ +
+

The placeholder displayed if nothing is selected.

+ +
+ +

Default: "Select..."

+ + +
+
+

popupHeight

+ Number + + + + + +
+

+ Defined in + src/composite/select.js:178 +

+ + +
+ +
+

Height of the popup container node.

+ +
+ +

Default: : null (auto)

+ + +
+
+

popupMaxHeight

+ Number + + + + + +
+

+ Defined in + src/composite/select.js:209 +

+ + +
+ +
+

Maximum height of the popup container node.

+ +
+ +

Default: : 300

+ + +
+
+

popupMaxWidth

+ Number + + + + + +
+

+ Defined in + src/composite/select.js:188 +

+ + +
+ +
+

Maximum width of the popup container node.

+ +
+ +

Default: : null (no maximum)

+ + +
+
+

popupMinHeight

+ Number + + + + + +
+

+ Defined in + src/composite/select.js:219 +

+ + +
+ +
+

Minimum height of the popup container node.

+ +
+ +

Default: : null (no minimum)

+ + +
+
+

popupMinWidth

+ Number + + + + + +
+

+ Defined in + src/composite/select.js:198 +

+ + +
+ +
+

Minimum width of the popup container node.

+ +
+ +

Default: : null (no minimum)

+ + +
+
+

popupOffsetHeight

+ Number + + + + + +
+

+ Defined in + src/composite/select.js:238 +

+ + +
+ +
+

Popup height (outer HTML element).

+ +
+ + + +
+
+

popupOffsetWidth

+ Number + + + + + +
+

+ Defined in + src/composite/select.js:229 +

+ + +
+ +
+

Popup width (outer HTML element).

+ +
+ + + +
+
+

popupPadding

+ Number + + + + + +
+

+ Defined in + src/composite/select.js:247 +

+ + +
+ +
+

Window container node padding.

+ +
+ +

Default: 0

+ + +
+
+

popupWidth

+ Number + + + + + +
+

+ Defined in + src/composite/select.js:168 +

+ + +
+ +
+

Width of the container node.

+ +
+ +

Default: : null (auto)

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

value

+ String (maybe) + + + + + +
+

+ Defined in + src/composite/select.js:86 +

+ + +
+ +
+

The field value.

+ +
+ +

Default: ""

+ + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.Separator.html b/ref/classes/photonui.Separator.html new file mode 100644 index 00000000..57f8c992 --- /dev/null +++ b/ref/classes/photonui.Separator.html @@ -0,0 +1,1714 @@ + + + + + photonui.Separator - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.Separator Class

+
+ +
+ Extends photonui.Widget +
+ +
+ Defined in: src/visual/separator.js:41 +
+ + Module: Visual
+ Parent Module: PhotonUI + +
+ + +
+

Separator.

+ +
+ +
+

Constructor

+
+

photonui.Separator

+ + () + + + + + + + + +
+

+ Defined in + src/visual/separator.js:41 +

+ + + +
+ +
+ +
+ + + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:445 +

+ + + +
+ +
+ Called when the context menu should be displayed. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/visual/separator.js:128 +

+ + + +
+ +
+

Called when the locale is changed.

+ +
+ + + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/visual/separator.js:111 +

+ + + +
+ +
+

Build the widget HTML.

+ +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:425 +

+ + + +
+ +
+ Called when the visibility changes. +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    +

    Current visibility state (otptional, defaut=this.visible)

    + +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/widget.js:367 +

+ + + +
+ +
+ Destroy the widget. +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/visual/separator.js:93 +

+ + +
+ +
+

Html outer element of the widget (if any).

+ +
+ +

Default: null

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

orientation

+ String + + + + + +
+

+ Defined in + src/visual/separator.js:61 +

+ + +
+ +
+

The separator orientation ("vertical" or "horizontal").

+ +
+ +

Default: "horizontal"

+ + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.Slider.html b/ref/classes/photonui.Slider.html new file mode 100644 index 00000000..79602a2f --- /dev/null +++ b/ref/classes/photonui.Slider.html @@ -0,0 +1,3081 @@ + + + + + photonui.Slider - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.Slider Class

+
+ +
+ Extends photonui.NumericField +
+ + + + Module: Interactive
+ Parent Module: PhotonUI + +
+ + +
+

Slider

+ +
+ +
+

Constructor

+
+

photonui.Slider

+ +
+ (
    +
  • + params +
  • +
) +
+ + + + + + + + +
+

+ Defined in + src/interactive/slider.js:42 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + params + Object + + +
    +

    An object that can contain any property of the widget (optional).

    + +
    + +
  • +
+
+ + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__debValueChangedFinal

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Field: + src/interactive/field.js:207 +

+ + + +
+ +
+

Debounced version of __forValueChangedFinal.

+ +
+ + + + +
+
+

__forValueChangedFinal

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Field: + src/interactive/field.js:197 +

+ + + +
+ +
+

To be called indirectly through __debValueChangedFinal().

+ +
+ + + + +
+
+

__onChange

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + + + +
+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/interactive/slider.js:342 +

+ + + +
+ +
+

Called when the context menu should be displayed.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onFieldContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/interactive/slider.js:357 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onKeydown

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + + + +
+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onKeypress

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + + + +
+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onKeyup

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + + + +
+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:460 +

+ + + +
+ +
+ Called when the locale is changed. +
+ + + + +
+
+

__onMouseWheel

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + + + +
+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onSliderMouseDown

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/interactive/slider.js:196 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onSliderMouseMove

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/interactive/slider.js:207 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onSliderMouseUp

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/interactive/slider.js:216 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onSliderMouseWheel

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/interactive/slider.js:305 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onSliderTouchEnd

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/interactive/slider.js:249 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onSliderTouchMove

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/interactive/slider.js:240 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onSliderTouchStart

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/interactive/slider.js:228 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_bindFieldEvents

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Field: + src/interactive/field.js:149 +

+ + + +
+ +
+

Bind Field events.

+ +
+ + + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/interactive/slider.js:146 +

+ + + +
+ +
+

Build the widget HTML.

+ +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_moveTouchEnd

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/interactive/slider.js:261 +

+ + + +
+ +
+

Gets the first touch event and normalizes pageX/Y and offsetX/Y properties.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateFieldValue

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.NumericField + + but overwritten in + src/interactive/slider.js:131 +

+ + + +
+ +
+

Update the value in the html field.

+ +
+ + + + +
+
+

_updateFromMouseEvent

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/interactive/slider.js:170 +

+ + + +
+ +
+

Update the value form a mouse event occured on the slider.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_updateValue

+ +
+ (
    +
  • + value +
  • +
) +
+ + + + private + + + + + + + +
+

Update the value (in the widget).

+ +
+ +
+

Parameters:

+ +
    +
  • + value + String | Number + + +
    +

    The raw value.

    + +
    + +
  • +
+
+ + + +
+
+

_validateInput

+ +
+ (
    +
  • + value +
  • +
) +
+ + + Boolean + + + + private + + + + + + + +
+

Validate the user inputs.

+ +
+ +
+

Parameters:

+ +
    +
  • + value + String + + +
    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Boolean: +
+
+ + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:425 +

+ + + +
+ +
+ Called when the visibility changes. +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    +

    Current visibility state (otptional, defaut=this.visible)

    + +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/widget.js:367 +

+ + + +
+ +
+ Destroy the widget. +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

decimalDigits

+ Number + + + + + + + +
+

The number of digit after the decimal dot.

+ +
+ +

Default: null (no limite)

+ + +
+
+

decimalSymbol

+ String + + + + + + + +
+

The decimal symbol ("." or ",").

+ +
+ +

Default: : "."

+ + +
+
+

fieldVisible

+ Boolean + + + + + +
+

+ Defined in + src/interactive/slider.js:87 +

+ + +
+ +
+

Define if the numeric field should be displayed.

+ +
+ +

Default: : true

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/interactive/slider.js:113 +

+ + +
+ +
+

Html outer element of the widget (if any).

+ +
+ +

Default: null

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

max

+ Number +default null (no maximum); + + + + + + + +
+

The maximum value of the field.

+ +
+ + + +
+
+

min

+ Number +default null (no minimum); + + + + + + + +
+

The minimum value of the field.

+ +
+ + + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

Placeholder

+ String + + + + + +
+

Inherited from + photonui.Field: + src/interactive/field.js:112 +

+ + +
+ +
+

The placeholder displayed if the field is empty.

+ +
+ +

Default: ""

+ + +
+
+

step

+ Number +default 1 + + + + + + + +
+

The incrementation step of the field.

+ +
+ + + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

value

+ Number + + + + + +
+

Inherited from + + photonui.Field + + but overwritten in + src/interactive/numericfield.js:166 +

+ + +
+ +
+

The field value.

+ +
+ +

Default: 0

+ + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.SpriteIcon.html b/ref/classes/photonui.SpriteIcon.html new file mode 100644 index 00000000..579e2f5a --- /dev/null +++ b/ref/classes/photonui.SpriteIcon.html @@ -0,0 +1,1814 @@ + + + + + photonui.SpriteIcon - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.SpriteIcon Class

+
+ +
+ Extends photonui.BaseIcon +
+ +
+ Defined in: src/visual/spriteicon.js:42 +
+ + Module: Visual
+ Parent Module: PhotonUI + +
+ + +
+

Sprite sheet based icons.

+

Special contructor params:

+
 new photonui.SpriteIcon( {optional params...} )
+ new photonui.SpriteIcon( "spriteSheetName/iconName", {optional params...} )
+ +
+ +
+

Constructor

+
+

photonui.SpriteIcon

+ + () + + + + + + + + +
+

+ Defined in + src/visual/spriteicon.js:42 +

+ + + +
+ +
+ +
+ + + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:445 +

+ + + +
+ +
+ Called when the context menu should be displayed. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/visual/baseicon.js:54 +

+ + + +
+ +
+

Called when the locale is changed.

+ +
+ + + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/visual/spriteicon.js:165 +

+ + + +
+ +
+

Build the widget HTML.

+ +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_update

+ + () + + + + private + + + + + +
+

+ Defined in + src/visual/spriteicon.js:151 +

+ + + +
+ +
+

Update the icon.

+ +
+ + + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:425 +

+ + + +
+ +
+ Called when the visibility changes. +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    +

    Current visibility state (otptional, defaut=this.visible)

    + +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/widget.js:367 +

+ + + +
+ +
+ Destroy the widget. +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/visual/spriteicon.js:133 +

+ + +
+ +
+

Html outer element of the widget (if any).

+ +
+ +

Default: null

+ + +
+
+

icon

+ String + + + + + +
+

+ Defined in + src/visual/spriteicon.js:114 +

+ + +
+ +
+

The icon id.

+
"spriteSheetName/iconName"
+ +
+ +

Default: "/"

+ + +
+
+

iconName

+ String + + + + + +
+

+ Defined in + src/visual/spriteicon.js:96 +

+ + +
+ +
+

The icon name.

+ +
+ +

Default: ""

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

spriteSheetName

+ String + + + + + +
+

+ Defined in + src/visual/spriteicon.js:78 +

+ + +
+ +
+

The sprite sheet name.

+ +
+ +

Default: ""

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.SpriteSheet.html b/ref/classes/photonui.SpriteSheet.html new file mode 100644 index 00000000..43567afd --- /dev/null +++ b/ref/classes/photonui.SpriteSheet.html @@ -0,0 +1,1297 @@ + + + + + photonui.SpriteSheet - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.SpriteSheet Class

+
+ +
+ Extends photonui.Base +
+ + + + Module: NonVisual
+ Parent Module: PhotonUI + +
+ + +
+

Sprite sheet (to use with SpriteIcon).

+ +
+ +
+

Constructor

+
+

photonui.SpriteSheet

+ + () + + + + + + + + +
+

+ Defined in + src/nonvisual/spritesheet.js:43 +

+ + + +
+ +
+ +
+ + + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

addIcon

+ +
+ (
    +
  • + iconName +
  • +
  • + x +
  • +
  • + y +
  • +
) +
+ + + + + + + + +
+

+ Defined in + src/nonvisual/spritesheet.js:186 +

+ + + +
+ +
+

Add an icon (set its position).

+ +
+ +
+

Parameters:

+ +
    +
  • + iconName + String + + +
    + +
    + +
  • +
  • + x + Number + + +
    + +
    + +
  • +
  • + y + Number + + +
    + +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:157 +

+ + + +
+ +
+ Destroy the class. +
+ + + + +
+
+

getIconCss

+ +
+ (
    +
  • + iconName +
  • +
) +
+ + + String + + + + + + + + +
+

+ Defined in + src/nonvisual/spritesheet.js:171 +

+ + + +
+ +
+

Get the right CSS for the given icon.

+ +
+ +
+

Parameters:

+ +
    +
  • + iconName + String + + +
    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ String: +

the CSS.

+ +
+
+ + +
+
+

getIconPosition

+ +
+ (
    +
  • + iconName +
  • +
) +
+ + + Object + + + + + + + + +
+

+ Defined in + src/nonvisual/spritesheet.js:160 +

+ + + +
+ +
+

Get icon position.

+ +
+ +
+

Parameters:

+ +
    +
  • + iconName + String + + +
    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Object: +

{x: Number, y: Number}

+ +
+
+ + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeIcon

+ +
+ (
    +
  • + iconName +
  • +
) +
+ + + + + + + + +
+

+ Defined in + src/nonvisual/spritesheet.js:198 +

+ + + +
+ +
+

Remove an icon.

+ +
+ +
+

Parameters:

+ +
    +
  • + iconName + String + + +
    + +
    + +
  • +
+
+ + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

icons

+ Object + + + + + +
+

+ Defined in + src/nonvisual/spritesheet.js:129 +

+ + +
+ +
+

Icons.

+
{
+     "iconName": [x, y],
+     "icon2": [x2, y2],
+     ...
+}
+ +
+ +

Default: : {}

+ + +
+
+

imageUrl

+ String + + + + + +
+

+ Defined in + src/nonvisual/spritesheet.js:86 +

+ + +
+ +
+

The spritesheet image URL.

+ +
+ +

Default: null

+ + +
+
+

name

+ String + + + + + +
+

+ Defined in + src/nonvisual/spritesheet.js:64 +

+ + +
+ +
+

The spritesheet name.

+ +
+ +

Default: "default"

+ + +
+
+

size

+ Number + + + + + +
+

+ Defined in + src/nonvisual/spritesheet.js:112 +

+ + +
+ +
+

Icon size (width = height).

+ +
+ +

Default: 16

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.SubMenuItem.html b/ref/classes/photonui.SubMenuItem.html new file mode 100644 index 00000000..4dd66c31 --- /dev/null +++ b/ref/classes/photonui.SubMenuItem.html @@ -0,0 +1,2175 @@ + + + + + photonui.SubMenuItem - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.SubMenuItem Class

+
+ +
+ Extends photonui.MenuItem +
+ + + + Module: Container
+ Parent Module: PhotonUI + +
+ + +
+

Submenu Menu item (fold/unfold a submenu).

+ +
+ +
+

Constructor

+
+

photonui.SubMenuItem

+ + () + + + + + + + + +
+

+ Defined in + src/container/submenuitem.js:43 +

+ + + +
+ +
+ +
+ + + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:445 +

+ + + +
+ +
+ Called when the context menu should be displayed. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onItemClicked

+ + () + + + + private + + + + + +
+

+ Defined in + src/container/submenuitem.js:138 +

+ + + +
+ +
+ +
+ + + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:460 +

+ + + +
+ +
+ Called when the locale is changed. +
+ + + + +
+
+

__onToggleFold

+ + () + + + + private + + + + + +
+

+ Defined in + src/container/submenuitem.js:130 +

+ + + +
+ +
+ +
+ + + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/container/menuitem.js:216 +

+ + + +
+ +
+

Build the widget HTML.

+ +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/container/container.js:208 +

+ + + +
+ +
+

Called when the visibility changes.

+ +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    +

    Current visibility state (otptional, defaut=this.visible)

    + +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/container/menuitem.js:201 +

+ + + +
+ +
+

Destroy the widget.

+ +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeChild

+ +
+ (
    +
  • + widget +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:182 +

+ + + +
+ +
+

Remove the given child.

+ +
+ +
+

Parameters:

+ + +
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

active

+ Boolean + + + + + +
+

Inherited from + photonui.MenuItem: + src/container/menuitem.js:148 +

+ + +
+ +
+

Determine if the item is active (highlighted).

+ +
+ +

Default: false

+ + +
+
+

child

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:146 +

+ + +
+ +
+

The child widget.

+ +
+ +

Default: null (no child)

+ + +
+
+

childName

+ String + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:118 +

+ + +
+ +
+

The child widget name.

+ +
+ +

Default: null (no child)

+ + +
+
+

containerNode

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Container + + but overwritten in + src/container/menuitem.js:184 +

+ + +
+ +
+

HTML Element that contain the child widget HTML.

+ +
+ + + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

horizontalChildExpansion

+ Boolean + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:66 +

+ + +
+ +
+

Horizontaly expand the container's child widget.

+ +
+ +

Default: true

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/container/menuitem.js:172 +

+ + +
+ +
+

Html outer element of the widget (if any).

+ +
+ +

Default: null

+ + +
+
+

icon

+ photonui.BaseIcon + + + + + +
+

Inherited from + photonui.MenuItem: + src/container/menuitem.js:128 +

+ + +
+ +
+

Left icon widget.

+ +
+ +

Default: : null

+ + +
+
+

iconName

+ String + + + + + +
+

Inherited from + photonui.MenuItem: + src/container/menuitem.js:107 +

+ + +
+ +
+

Left icon widget name.

+ +
+ +

Default: : null

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

menu

+ photonui.Menu + + + + + +
+

+ Defined in + src/container/submenuitem.js:107 +

+ + +
+ +
+

The submenu widget.

+ +
+ +

Default: null

+ + +
+
+

menuName

+ String + + + + + +
+

+ Defined in + src/container/submenuitem.js:65 +

+ + +
+ +
+

The submenu widget name.

+ +
+ +

Default: null

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

text

+ String + + + + + +
+

Inherited from + photonui.MenuItem: + src/container/menuitem.js:87 +

+ + +
+ +
+

The item text.

+ +
+ +

Default: "Menu Item"

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

value

+ String (maybe) + + + + + +
+

Inherited from + photonui.MenuItem: + src/container/menuitem.js:70 +

+ + +
+ +
+

An optional value for the item (can be used in select).

+ +
+ +

Default: ""

+ + +
+
+

verticalChildExpansion

+ Boolean + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:92 +

+ + +
+ +
+

Verticaly expand the container's child widget.

+ +
+ +

Default: false

+ + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.Switch.html b/ref/classes/photonui.Switch.html new file mode 100644 index 00000000..a30d0701 --- /dev/null +++ b/ref/classes/photonui.Switch.html @@ -0,0 +1,1938 @@ + + + + + photonui.Switch - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.Switch Class

+
+ +
+ Extends photonui.CheckBox +
+ + + + Module: Interactive
+ Parent Module: PhotonUI + +
+ + +
+

Switch.

+ +
+ +
+

Constructor

+
+

photonui.Switch

+ + () + + + + + + + + +
+

+ Defined in + src/interactive/switch.js:41 +

+ + + +
+ +
+ +
+ + + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onChange

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.CheckBox: + src/interactive/checkbox.js:134 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onCheckboxClick

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.CheckBox: + src/interactive/checkbox.js:158 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:445 +

+ + + +
+ +
+ Called when the context menu should be displayed. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:460 +

+ + + +
+ +
+ Called when the locale is changed. +
+ + + + +
+
+

__onSpanClick

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.CheckBox: + src/interactive/checkbox.js:147 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onSpanKeyPress

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.CheckBox: + src/interactive/checkbox.js:167 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/interactive/checkbox.js:108 +

+ + + +
+ +
+

Build the widget HTML.

+ +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:425 +

+ + + +
+ +
+ Called when the visibility changes. +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    +

    Current visibility state (otptional, defaut=this.visible)

    + +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/widget.js:367 +

+ + + +
+ +
+ Destroy the widget. +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/interactive/checkbox.js:90 +

+ + +
+ +
+

Html outer element of the widget (if any).

+ +
+ +

Default: null

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

value

+ Boolean + + + + + +
+

Inherited from + photonui.CheckBox: + src/interactive/checkbox.js:75 +

+ + +
+ +
+

The input value.

+ +
+ +

Default: false

+ + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.TabItem.html b/ref/classes/photonui.TabItem.html new file mode 100644 index 00000000..5078b442 --- /dev/null +++ b/ref/classes/photonui.TabItem.html @@ -0,0 +1,2259 @@ + + + + + photonui.TabItem - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.TabItem Class

+
+ +
+ Extends photonui.Container +
+ +
+ Defined in: src/container/tabitem.js:46 +
+ + Module: Container
+ Parent Module: PhotonUI + +
+ + +
+

Tab Item.

+

wEvents:

+
    +
  • click: +
      +
    • description: called when the tab was clicked.
    • +
    • callback: function(widget, event)
    • +
    +
  • +
+ +
+ +
+

Constructor

+
+

photonui.TabItem

+ +
+ (
    +
  • + params +
  • +
) +
+ + + + + + + + +
+

+ Defined in + src/container/tabitem.js:46 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + params + Object + + +
    +

    An object that can contain any property of the widget (optional).

    + +
    + +
  • +
+
+ + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onClick

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/container/tabitem.js:391 +

+ + + +
+ +
+

Called when the tab is clicked.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:445 +

+ + + +
+ +
+ Called when the context menu should be displayed. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:460 +

+ + + +
+ +
+ Called when the locale is changed. +
+ + + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/container/tabitem.js:360 +

+ + + +
+ +
+

Build the widget HTML.

+ +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/container/container.js:208 +

+ + + +
+ +
+

Called when the visibility changes.

+ +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    +

    Current visibility state (otptional, defaut=this.visible)

    + +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/container/tabitem.js:317 +

+ + + +
+ +
+

Destroy the widget.

+ +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeChild

+ +
+ (
    +
  • + widget +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:182 +

+ + + +
+ +
+

Remove the given child.

+ +
+ +
+

Parameters:

+ + +
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

child

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:146 +

+ + +
+ +
+

The child widget.

+ +
+ +

Default: null (no child)

+ + +
+
+

childName

+ String + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:118 +

+ + +
+ +
+

The child widget name.

+ +
+ +

Default: null (no child)

+ + +
+
+

containerNode

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Container + + but overwritten in + src/container/tabitem.js:139 +

+ + +
+ +
+

HTML Element that contain the child widget HTML.

+ +
+ + + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

horizontalChildExpansion

+ Boolean + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:66 +

+ + +
+ +
+

Horizontaly expand the container's child widget.

+ +
+ +

Default: true

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/container/tabitem.js:115 +

+ + +
+ +
+

Html outer element of the widget (if any).

+ +
+ +

Default: null

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

leftIcon

+ photonui.Icon + + + + + +
+

+ Defined in + src/container/tabitem.js:213 +

+ + +
+ +
+

Left icon widget

+ +
+ +

Default: null

+ + +
+
+

leftIconName

+ String + + + + + +
+

+ Defined in + src/container/tabitem.js:190 +

+ + +
+ +
+

Left icon widget name

+ +
+ +

Default: null

+ + +
+
+

leftIconVisible

+ Boolean + + + + + +
+

+ Defined in + src/container/tabitem.js:232 +

+ + +
+ +
+

Define if the left icon is displayed or hidden.

+ +
+ +

Default: true

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

rightIcon

+ photonui.Icon + + + + + +
+

+ Defined in + src/container/tabitem.js:274 +

+ + +
+ +
+

Right icon widget

+ +
+ +

Default: null

+ + +
+
+

rightIconVisible

+ Boolean + + + + + +
+

+ Defined in + src/container/tabitem.js:293 +

+ + +
+ +
+

Define if the right icon is displayed or hidden.

+ +
+ +

Default: true

+ + +
+
+

rigthIconName

+ String + + + + + +
+

+ Defined in + src/container/tabitem.js:250 +

+ + +
+ +
+

Right icon widget name

+ +
+ +

Default: null

+ + +
+
+

tabHtml

+ HTMLElement + + + + + +
+

+ Defined in + src/container/tabitem.js:127 +

+ + +
+ +
+

Tab Html element.

+ +
+ +

Default: null

+ + +
+
+

title

+ String + + + + + +
+

+ Defined in + src/container/tabitem.js:77 +

+ + +
+ +
+

Tab title.

+ +
+ +

Default: "Tab"

+ + +
+
+

titleVisible

+ Boolean + + + + + +
+

+ Defined in + src/container/tabitem.js:97 +

+ + +
+ +
+

Definie if the tabItem title is displayed or hidden.

+ +
+ +

Default: true

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

verticalChildExpansion

+ Boolean + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:92 +

+ + +
+ +
+

Verticaly expand the container's child widget.

+ +
+ +

Default: false

+ + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/container/tabitem.js:150 +

+ + +
+ +
+

Is the widget visible or hidden.

+ +
+ +

Default: false

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.TabLayout.html b/ref/classes/photonui.TabLayout.html new file mode 100644 index 00000000..3d2b8a86 --- /dev/null +++ b/ref/classes/photonui.TabLayout.html @@ -0,0 +1,2360 @@ + + + + + photonui.TabLayout - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.TabLayout Class

+
+ +
+ Extends photonui.Layout +
+ +
+ Defined in: src/layout/tablayout.js:44 +
+ + Module: Layout
+ Parent Module: PhotonUI + +
+ + +
+

Tab Layout

+ +
+ +
+

Constructor

+
+

photonui.TabLayout

+ +
+ (
    +
  • + params +
  • +
) +
+ + + + + + + + +
+

+ Defined in + src/layout/tablayout.js:44 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + params + Object + + +
    +

    An object that can contain any property of the widget (optional).

    + +
    + +
  • +
+
+ + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:445 +

+ + + +
+ +
+ Called when the context menu should be displayed. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/layout/layout.js:273 +

+ + + +
+ +
+

Called when the locale is changed.

+ +
+ + + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/layout/tablayout.js:214 +

+ + + +
+ +
+

Build the widget HTML.

+ +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_computeLayoutOptions

+ +
+ (
    +
  • + widget +
  • +
) +
+ + + Object + + + + private + + + + + +
+

+ Defined in + src/layout/tablayout.js:273 +

+ + + +
+ +
+

Returns a normalized layoutOption for a given widget.

+ +
+ +
+

Parameters:

+ + +
+ +
+

Returns:

+ +
+ Object: +

the layout options

+ +
+
+ + +
+
+

_lockUpdate

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Layout: + src/layout/layout.js:223 +

+ + + +
+ +
+

Lock the update of the layout.

+ +
+ + + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateLayout

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Layout + + but overwritten in + src/layout/tablayout.js:237 +

+ + + +
+ +
+

Update the layout.

+ +
+ + + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/layout/layout.js:250 +

+ + + +
+ +
+

Called when the visibility changes.

+ +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    +

    Current visibility state (otptional, defaut=this.visible)

    + +
    + +
  • +
+
+ + + +
+
+

addChild

+ +
+ (
    +
  • + widget +
  • +
  • + layoutOption +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Layout: + src/layout/layout.js:159 +

+ + + +
+ +
+

Add a widget to the layout.

+ +
+ +
+

Parameters:

+ +
    +
  • + widget + photonui.Widget + + +
    +

    The widget to add.

    + +
    + +
  • +
  • + layoutOption + Object + + +
    +

    Specific option for the layout (optional).

    + +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/layout/layout.js:211 +

+ + + +
+ +
+

Destroy the widget.

+ +
+ + + + +
+
+

empty

+ + () + + + + + + + + +
+

Inherited from + photonui.Layout: + src/layout/layout.js:193 +

+ + + +
+ +
+

Destroy all children of the layout

+ +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeChild

+ +
+ (
    +
  • + widget +
  • +
) +
+ + + + + + + + +
+

Inherited from + + photonui.Container + + but overwritten in + src/layout/tablayout.js:199 +

+ + + +
+ +
+

Remove a widget from the layout.

+ +
+ +
+

Parameters:

+ + +
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

activeTab

+ photonui.Widget + + + + + +
+

+ Defined in + src/layout/tablayout.js:160 +

+ + +
+ +
+

Define the active tab.

+ +
+ +

Default: null

+ + +
+
+

activeTabName

+ String + + + + + +
+

+ Defined in + src/layout/tablayout.js:109 +

+ + +
+ +
+

Define the active tab name.

+ +
+ +

Default: null

+ + +
+
+

child

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:146 +

+ + +
+ +
+

The child widget.

+ +
+ +

Default: null (no child)

+ + +
+
+

childName

+ String + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:118 +

+ + +
+ +
+

The child widget name.

+ +
+ +

Default: null (no child)

+ + +
+
+

children

+ Array + + + + + +
+

Inherited from + photonui.Layout: + src/layout/layout.js:106 +

+ + +
+ +
+

Layout children widgets.

+ +
+ +

Default: []

+ + +
+
+

childrenNames

+ Array + + + + + +
+

Inherited from + photonui.Layout: + src/layout/layout.js:69 +

+ + +
+ +
+

Layout children widgets name.

+ +
+ +

Default: []

+ + +
+
+

containerNode

+ HTMLElement + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:165 +

+ + +
+ +
+

HTML Element that contain the child widget HTML.

+ +
+ + + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

horizontalChildExpansion

+ Boolean + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:66 +

+ + +
+ +
+

Horizontaly expand the container's child widget.

+ +
+ +

Default: true

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/layout/tablayout.js:97 +

+ + +
+ +
+

Html outer element of the widget (if any).

+ +
+ +

Default: null

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

padding

+ Number + + + + + +
+

+ Defined in + src/layout/tablayout.js:141 +

+ + +
+ +
+

Container node padding.

+ +
+ +

Default: 10

+ + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

tabsPosition

+ String + + + + + +
+

+ Defined in + src/layout/tablayout.js:66 +

+ + +
+ +
+

Define the tabs position.

+
    +
  • top
  • +
  • bottom
  • +
  • left
  • +
  • right
  • +
+ +
+ +

Default: "top"

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

verticalChildExpansion

+ Boolean + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:92 +

+ + +
+ +
+

Verticaly expand the container's child widget.

+ +
+ +

Default: false

+ + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.TableView.html b/ref/classes/photonui.TableView.html new file mode 100644 index 00000000..3dac2a1e --- /dev/null +++ b/ref/classes/photonui.TableView.html @@ -0,0 +1,3810 @@ + + + + + photonui.TableView - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.TableView Class

+
+ +
+ Extends photonui.DataView +
+ + + + Module: DataView
+ Parent Module: PhotonUI + +
+ + +
+

TableView container.

+ +
+ +
+

Constructor

+
+

photonui.TableView

+ + () + + + + + + + + +
+

+ Defined in + src/dataview/tableview.js:46 +

+ + + +
+ +
+ +
+ + + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onClick

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:861 +

+ + + +
+ +
+

Called when an element is clicked.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    +

    the click event

    + +
    + +
  • +
+
+ + + +
+
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:445 +

+ + + +
+ +
+ Called when the context menu should be displayed. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onDragEnd

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:970 +

+ + + +
+ +
+

Called when a item drag has ended.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onDragEnter

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:935 +

+ + + +
+ +
+

Called when a dragged item enters into another element.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onDragOver

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:1000 +

+ + + +
+ +
+

Called when a item is dragged (fix for firefox).

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onDragStart

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:903 +

+ + + +
+ +
+

Called when an item is dragged.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onDrop

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:1016 +

+ + + +
+ +
+

Called when a item is dropped (fix for firefox).

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onItemClick

+ +
+ (
    +
  • + event +
  • +
  • + item +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:885 +

+ + + +
+ +
+

Called when an item is clicked.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    +

    the click event

    + +
    + +
  • +
  • + item + Item + + +
    +

    the clicked item

    + +
    + +
  • +
+
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/dataview/dataview.js:1032 +

+ + + +
+ +
+

Called when the locale is changed.

+ +
+ + + + +
+
+

_addIdentifiersClasses

+ +
+ (
    +
  • + node +
  • +
  • + suffix +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:662 +

+ + + +
+ +
+

Adds classes defined by the identifiers property to a given element, with +a given suffix.

+ +
+ +
+

Parameters:

+ +
    +
  • + node + Element + + +
    +

    the node

    + +
    + +
  • +
  • + suffix + String + + +
    +

    the suffix of the classes

    + +
    + +
  • +
+
+ + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_buildContainerHtml

+ + () + + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:505 +

+ + + +
+ +
+

Build the widget container HTML.

+ +
+ + + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/dataview/dataview.js:495 +

+ + + +
+ +
+

Build the widget HTML.

+ +
+ + + + +
+
+

_buildItemsHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.DataView + + but overwritten in + src/dataview/tableview.js:85 +

+ + + +
+ +
+

Build the items list HTML.

+ +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_empty

+ + () + + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:446 +

+ + + +
+ +
+

Destroy all children of the layout

+ +
+ + + + +
+
+

_generateColumns

+ + () + + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:632 +

+ + + +
+ +
+

Generate the list of columns.

+ +
+ + + + +
+
+

_generatePlaceholderElement

+ + () + + + Element + + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:833 +

+ + + +
+ +
+

Generates a placeholder item element.

+ +
+ + +
+

Returns:

+ +
+ Element: +

the placeholder item element

+ +
+
+ + +
+
+

_getChildren

+ + () + + + Array + + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:462 +

+ + + +
+ +
+

Layout children widgets.

+ +
+ + +
+

Returns:

+ +
+ Array: +

the childen widget

+ +
+
+ + +
+
+

_getItemByIndex

+ +
+ (
    +
  • + index +
  • +
) +
+ + + Object + + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:481 +

+ + + +
+ +
+

Returns the item at a given index.

+ +
+ +
+

Parameters:

+ +
    +
  • + index + Number + + +
    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Object: +

the item

+ +
+
+ + +
+
+

_getItemFromNode

+ +
+ (
    +
  • + itemNode +
  • +
) +
+ + + Object + + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:751 +

+ + + +
+ +
+

Gets an item of the collection from a given item DOM element.

+ +
+ +
+

Parameters:

+ +
    +
  • + itemNode + Element + + +
    +

    the item DOM element

    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Object: +

the item

+ +
+
+ + +
+
+

_handleClick

+ +
+ (
    +
  • + item +
  • +
  • + modifiers +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:782 +

+ + + +
+ +
+

Handle item click events.

+ +
+ +
+

Parameters:

+ +
    +
  • + item + Object + + +
    +

    the item

    + +
    + +
  • +
  • + modifiers + Object + + +
    +

    the modifiers states

    + +
    + +
      +
    • + ctrl + Object + +
      + +
      + +
    • +
    • + shift + Object + +
      + +
      + +
    • +
    +
  • +
+
+ + + +
+
+

_moveItem

+ +
+ (
    +
  • + itemIndex +
  • +
  • + destinationIndex +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:764 +

+ + + +
+ +
+

Moves the item at a givent index to another given index. Rebuilds the +dataview.

+ +
+ +
+

Parameters:

+ +
    +
  • + itemIndex + Number + + +
    +

    the index of the item to move

    + +
    + +
  • +
  • + destinationIndex + Number + + +
    +

    the destination index

    + +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_renderColumn

+ +
+ (
    +
  • + content +
  • +
  • + columnId +
  • +
) +
+ + + Element + + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:602 +

+ + + +
+ +
+

Renders a given column.

+ +
+ +
+

Parameters:

+ +
    +
  • + content + photonui.Widget | String + + +
    +

    the content of the column

    + +
    + +
  • +
  • + columnId + String + + +
    +

    the identifier of the column

    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Element: +

the rendered column

+ +
+
+ + +
+
+

_renderHeader

+ + () + + + Element + + + + private + + + + + +
+

+ Defined in + src/dataview/tableview.js:98 +

+ + + +
+ +
+

Renders the table header.

+ +
+ + +
+

Returns:

+ +
+ Element: +

the rendered header

+ +
+
+ + +
+
+

_renderItem

+ +
+ (
    +
  • + item +
  • +
) +
+ + + Element + + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:551 +

+ + + +
+ +
+

Renders a given item.

+ +
+ +
+

Parameters:

+ +
    +
  • + item + Object + + +
    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Element: +

the rendered item

+ +
+
+ + +
+
+

_renderItemInner

+ +
+ (
    +
  • + itemNode +
  • +
  • + item +
  • +
) +
+ + + Element + + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:579 +

+ + + +
+ +
+

Renders all the columns of a given item.

+ +
+ +
+

Parameters:

+ +
    +
  • + itemNode + Element + + +
    +

    the container element of the item

    + +
    + +
  • +
  • + item + Object + + +
    +

    the rendered item

    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Element: +

the rendered item

+ +
+
+ + +
+
+

_selectItem

+ +
+ (
    +
  • + item +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:686 +

+ + + +
+ +
+

Selects an item.

+ +
+ +
+

Parameters:

+ +
    +
  • + item + Object + + +
    +

    the item

    + +
    + +
  • +
+
+ + + +
+
+

_selectItemsTo

+ +
+ (
    +
  • + item +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:718 +

+ + + +
+ +
+

Selects all items from the current selection to a given item.

+ +
+ +
+

Parameters:

+ +
    +
  • + item + Object + + +
    +

    the item

    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_unselectItem

+ +
+ (
    +
  • + item +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:702 +

+ + + +
+ +
+

Unselects an item.

+ +
+ +
+

Parameters:

+ +
    +
  • + item + Object + + +
    +

    the item

    + +
    + +
  • +
+
+ + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:425 +

+ + + +
+ +
+ Called when the visibility changes. +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    +

    Current visibility state (otptional, defaut=this.visible)

    + +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/dataview/dataview.js:388 +

+ + + +
+ +
+

Destroy the widget.

+ +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

selectItems

+ +
+ (
    +
  • + indexes +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:398 +

+ + + +
+ +
+

Selects the item(s) at given indexes.

+ +
+ +
+

Parameters:

+ +
    +
  • + indexes + ...Number | Number[] + + +
    + +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+

unselectAllItems

+ + () + + + + private + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:739 +

+ + + +
+ +
+

Unselects all items.

+ +
+ + + + +
+
+

unselectItems

+ +
+ (
    +
  • + indexes +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:421 +

+ + + +
+ +
+

Unselects the item(s) at given indexes.

+ +
+ +
+

Parameters:

+ +
    +
  • + indexes + ...Number | Number[] + + +
    + +
    + +
  • +
+
+ + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

allowShiftSelect

+ Boolean + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:215 +

+ + +
+ +
+

If true, allow selecting multiple items with one click when pressing +"shift" key. +Only used when "multiSelectable" option is set to "true".

+ +
+ +

Default: true

+ + +
+
+

columnElement

+ String + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:346 +

+ + +
+ +
+

The type of the columns DOM elements which will be created during the +render process.

+ +
+ +

Default: "span"

+ + +
+
+

columns

+ Array + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:277 +

+ + +
+ +
+

The list of columns which defines the structure of the items (if not +setted manually, the columns are automatically generated).

+ +
+ +

Default: null

+ + +
+
+

containerElement

+ String + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:314 +

+ + +
+ +
+

The type of the container DOM element which will be created during the +render process.

+ +
+ +

Default: "ul"

+ + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

customWidgetFormater

+ Function + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:247 +

+ + +
+ +
+

A custom formater function which overrides the default rendering process +of the widget.

+ +
+ +

Default: null

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

dragAndDroppable

+ Boolean + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:232 +

+ + +
+ +
+

Defines if the data items can be drag & dropped.

+ +
+ +

Default: false

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/dataview/dataview.js:302 +

+ + +
+ +
+

Html outer element of the widget (if any).

+ +
+ +

Default: null

+ + +
+
+

identifiers

+ Array + + + private + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:362 +

+ + +
+ +
+

The list of identifiers wich will be added to every generated elements +of the widget as classnames.

+ +
+ +

Default: []

+ + +
+
+

itemElement

+ String + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:330 +

+ + +
+ +
+

The type of the items DOM elements which will be created during the +render process.

+ +
+ +

Default: "li"

+ + +
+
+

items

+ Array + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:115 +

+ + +
+ +
+

The collection of items displayed by the data view widget.

+ +
+ +

Default: null

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

multiSelectable

+ Boolean + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:183 +

+ + +
+ +
+

Defines if the data items can be multi-selected. +Only used when "selectable" option is set to "true".

+ +
+ +

Default: false

+ + +
+
+

multiSelectWithCtrl

+ Boolean + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:199 +

+ + +
+ +
+

Defines wether or not "ctrl" key has to be pressed to multi-select items. +Only used when "multiSelectable" option is set to "true".

+ +
+ +

Default: true

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

selectable

+ Boolean + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:151 +

+ + +
+ +
+

Defines if the data items can be selected.

+ +
+ +

Default: false

+ + +
+
+

selectedItems

+ Array + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:263 +

+ + +
+ +
+

The currently selected items.

+ +
+ +

Default: []

+ + +
+
+

showHeader

+ Boolean + + + + + +
+

+ Defined in + src/dataview/tableview.js:70 +

+ + +
+ +
+

Defines if the header is displayed.

+ +
+ +

Default: true

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

unselectOnOutsideClick

+ Boolean + + + + + +
+

Inherited from + photonui.DataView: + src/dataview/dataview.js:166 +

+ + +
+ +
+

If true, clicking outside of the items (in the container) will unselect +currently selected items. +Only used when "selectable" option is set to "true".

+ +
+ +

Default: false

+ + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.Template.html b/ref/classes/photonui.Template.html new file mode 100644 index 00000000..b81a9de5 --- /dev/null +++ b/ref/classes/photonui.Template.html @@ -0,0 +1,1768 @@ + + + + + photonui.Template - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.Template Class

+
+ +
+ Extends photonui.Widget +
+ +
+ Defined in: src/visual/template.js:43 +
+ + Module: Visual
+ Parent Module: PhotonUI + +
+ + +
+

Widget that displays template-generated HTML (uses lodash.template).

+ +
+ +
+

Constructor

+
+

photonui.Template

+ +
+ (
    +
  • + params +
  • +
) +
+ + + + + + + + +
+

+ Defined in + src/visual/template.js:43 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + params + Object + + +
    +

    An object that can contain any property of the widget (optional).

    + +
    + +
  • +
+
+ + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:445 +

+ + + +
+ +
+ Called when the context menu should be displayed. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:460 +

+ + + +
+ +
+ Called when the locale is changed. +
+ + + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/visual/template.js:134 +

+ + + +
+ +
+

Build the widget HTML.

+ +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:425 +

+ + + +
+ +
+ Called when the visibility changes. +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    +

    Current visibility state (otptional, defaut=this.visible)

    + +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/widget.js:367 +

+ + + +
+ +
+ Destroy the widget. +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+

update

+ + () + + + + + + + + +
+

+ Defined in + src/visual/template.js:115 +

+ + + +
+ +
+

Update the template (NOTE: the template is automatically updated when you change data)

+ +
+ + + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/visual/template.js:97 +

+ + +
+ +
+

Html outer element of the widget (if any).

+ +
+ +

Default: null

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

template

+ String + + + + + +
+

+ Defined in + src/visual/template.js:68 +

+ + +
+ +
+

The template.

+ +
+ +

Default: ""

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.Text.html b/ref/classes/photonui.Text.html new file mode 100644 index 00000000..8a93ac5f --- /dev/null +++ b/ref/classes/photonui.Text.html @@ -0,0 +1,1744 @@ + + + + + photonui.Text - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.Text Class

+
+ +
+ Extends photonui.Widget +
+ +
+ Defined in: src/visual/text.js:43 +
+ + Module: Visual
+ Parent Module: PhotonUI + +
+ + +
+

Text / Raw HTML widget

+ +
+ +
+

Constructor

+
+

photonui.Text

+ + () + + + + + + + + +
+

+ Defined in + src/visual/text.js:43 +

+ + + +
+ +
+ +
+ + + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:445 +

+ + + +
+ +
+ Called when the context menu should be displayed. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/visual/text.js:130 +

+ + + +
+ +
+

Called when the locale is changed.

+ +
+ + + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/visual/text.js:115 +

+ + + +
+ +
+

Build the widget HTML.

+ +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:425 +

+ + + +
+ +
+ Called when the visibility changes. +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    +

    Current visibility state (otptional, defaut=this.visible)

    + +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/widget.js:367 +

+ + + +
+ +
+ Destroy the widget. +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/visual/text.js:97 +

+ + +
+ +
+

Html outer element of the widget (if any).

+ +
+ +

Default: null

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

rawHtml

+ String + + + + + +
+

+ Defined in + src/visual/text.js:80 +

+ + +
+ +
+

Raw HTML.

+ +
+ +

Default: ""

+ + +
+
+

text

+ String + + + + + +
+

+ Defined in + src/visual/text.js:62 +

+ + +
+ +
+

Text

+ +
+ +

Default: ""

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.TextAreaField.html b/ref/classes/photonui.TextAreaField.html new file mode 100644 index 00000000..a3fac29d --- /dev/null +++ b/ref/classes/photonui.TextAreaField.html @@ -0,0 +1,1912 @@ + + + + + photonui.TextAreaField - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.TextAreaField Class

+
+ +
+ Extends photonui.Field +
+ + + + Module: Interactive
+ Parent Module: PhotonUI + +
+ + +
+

Multiline text field.

+ +
+ +
+

Constructor

+
+

photonui.TextAreaField

+ + () + + + + + + + + +
+

+ Defined in + src/interactive/textareafield.js:41 +

+ + + +
+ +
+ +
+ + + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__debValueChangedFinal

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Field: + src/interactive/field.js:207 +

+ + + +
+ +
+

Debounced version of __forValueChangedFinal.

+ +
+ + + + +
+
+

__forValueChangedFinal

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Field: + src/interactive/field.js:197 +

+ + + +
+ +
+

To be called indirectly through __debValueChangedFinal().

+ +
+ + + + +
+
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/interactive/field.js:186 +

+ + + +
+ +
+

Called when the context menu should be displayed.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:460 +

+ + + +
+ +
+ Called when the locale is changed. +
+ + + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_bindFieldEvents

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Field: + src/interactive/field.js:149 +

+ + + +
+ +
+

Bind Field events.

+ +
+ + + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/interactive/textareafield.js:98 +

+ + + +
+ +
+

Build the widget HTML.

+ +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:425 +

+ + + +
+ +
+ Called when the visibility changes. +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    +

    Current visibility state (otptional, defaut=this.visible)

    + +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/widget.js:367 +

+ + + +
+ +
+ Destroy the widget. +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

cols

+ Number + + + + + +
+

+ Defined in + src/interactive/textareafield.js:62 +

+ + +
+ +
+

Number of columns.

+ +
+ +

Default: 20

+ + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/interactive/field.js:131 +

+ + +
+ +
+

Html outer element of the widget (if any).

+ +
+ +

Default: null

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

Placeholder

+ String + + + + + +
+

Inherited from + photonui.Field: + src/interactive/field.js:112 +

+ + +
+ +
+

The placeholder displayed if the field is empty.

+ +
+ +

Default: ""

+ + +
+
+

rows

+ Number + + + + + +
+

+ Defined in + src/interactive/textareafield.js:77 +

+ + +
+ +
+

Number of rows.

+ +
+ +

Default: 3

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

value

+ String (maybe) + + + + + +
+

Inherited from + photonui.Field: + src/interactive/field.js:96 +

+ + +
+ +
+

The field value.

+ +
+ +

Default: ""

+ + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.TextField.html b/ref/classes/photonui.TextField.html new file mode 100644 index 00000000..4ee9b22b --- /dev/null +++ b/ref/classes/photonui.TextField.html @@ -0,0 +1,1890 @@ + + + + + photonui.TextField - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.TextField Class

+
+ +
+ Extends photonui.Field +
+ + + + Module: Interactive
+ Parent Module: PhotonUI + +
+ + +
+

Text, Password, Email, Search, Tel, URL Fields.

+ +
+ +
+

Constructor

+
+

photonui.TextField

+ + () + + + + + + + + +
+

+ Defined in + src/interactive/textfield.js:41 +

+ + + +
+ +
+ +
+ + + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__debValueChangedFinal

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Field: + src/interactive/field.js:207 +

+ + + +
+ +
+

Debounced version of __forValueChangedFinal.

+ +
+ + + + +
+
+

__forValueChangedFinal

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Field: + src/interactive/field.js:197 +

+ + + +
+ +
+

To be called indirectly through __debValueChangedFinal().

+ +
+ + + + +
+
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/interactive/field.js:186 +

+ + + +
+ +
+

Called when the context menu should be displayed.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:460 +

+ + + +
+ +
+ Called when the locale is changed. +
+ + + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_bindFieldEvents

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Field: + src/interactive/field.js:149 +

+ + + +
+ +
+

Bind Field events.

+ +
+ + + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/interactive/textfield.js:99 +

+ + + +
+ +
+

Build the widget HTML.

+ +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:425 +

+ + + +
+ +
+ Called when the visibility changes. +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    +

    Current visibility state (otptional, defaut=this.visible)

    + +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/widget.js:367 +

+ + + +
+ +
+ Destroy the widget. +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/interactive/field.js:131 +

+ + +
+ +
+

Html outer element of the widget (if any).

+ +
+ +

Default: null

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

Placeholder

+ String + + + + + +
+

Inherited from + photonui.Field: + src/interactive/field.js:112 +

+ + +
+ +
+

The placeholder displayed if the field is empty.

+ +
+ +

Default: ""

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

type

+ String + + + + + +
+

+ Defined in + src/interactive/textfield.js:62 +

+ + +
+ +
+

Type of the field.

+
    +
  • text
  • +
  • password
  • +
  • email
  • +
  • search
  • +
  • tel
  • +
  • url
  • +
+ +
+ +

Default: text

+ + +
+
+

value

+ String (maybe) + + + + + +
+

Inherited from + photonui.Field: + src/interactive/field.js:96 +

+ + +
+ +
+

The field value.

+ +
+ +

Default: ""

+ + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.ToggleButton.html b/ref/classes/photonui.ToggleButton.html new file mode 100644 index 00000000..b1825eb8 --- /dev/null +++ b/ref/classes/photonui.ToggleButton.html @@ -0,0 +1,2352 @@ + + + + + photonui.ToggleButton - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.ToggleButton Class

+
+
+ Uses + +
+ +
+ Extends photonui.CheckBox +
+ + + + Module: Interactive
+ Parent Module: PhotonUI + +
+ + +
+

Toogle Button.

+ +
+ +
+

Constructor

+
+

photonui.ToggleButton

+ + () + + + + + + + + +
+

+ Defined in + src/interactive/togglebutton.js:42 +

+ + + +
+ +
+ +
+ + + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onButtonClicked

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Button: + src/interactive/button.js:389 +

+ + + +
+ +
+

Called when the button is clicked.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onChange

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.CheckBox: + src/interactive/checkbox.js:134 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onCheckboxClick

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.CheckBox: + src/interactive/checkbox.js:158 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:445 +

+ + + +
+ +
+ Called when the context menu should be displayed. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:460 +

+ + + +
+ +
+ Called when the locale is changed. +
+ + + + +
+
+

__onSpanClick

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.CheckBox: + src/interactive/checkbox.js:147 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onSpanKeyPress

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.CheckBox: + src/interactive/checkbox.js:167 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/interactive/togglebutton.js:76 +

+ + + +
+ +
+

Build the widget HTML.

+ +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_update

+ + () + + + + private + + + + + +
+

Inherited from + photonui.Button: + src/interactive/button.js:332 +

+ + + +
+ +
+

Update the button content

+ +
+ + + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:425 +

+ + + +
+ +
+ Called when the visibility changes. +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    +

    Current visibility state (otptional, defaut=this.visible)

    + +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/interactive/button.js:311 +

+ + + +
+ +
+

Destroy the widget.

+ +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

appearance

+ String + + + + + +
+

Inherited from + photonui.Button: + src/interactive/button.js:235 +

+ + +
+ +
+

Define the button appearance.

+
    +
  • normal
  • +
  • flat
  • +
+ +
+ +

Default: "normal"

+ + +
+
+

buttonColor

+ String + + + + + +
+

Inherited from + photonui.Button: + src/interactive/button.js:261 +

+ + +
+ +
+

Button's color.

+

The available colors depends on the theme. Particle, the +default PhotonUI theme provides the following colors:

+
    +
  • blue
  • +
  • red
  • +
  • yellow
  • +
  • green
  • +
  • null (default)
  • +
+ +
+ +

Default: null

+ + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/interactive/button.js:293 +

+ + +
+ +
+

Html outer element of the widget (if any).

+ +
+ +

Default: null

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

leftIcon

+ BaseIcon + + + + + +
+

Inherited from + photonui.Button: + src/interactive/button.js:138 +

+ + +
+ +
+

Left icon widget.

+ +
+ +

Default: : null

+ + +
+
+

leftIconName

+ String + + + + + +
+

Inherited from + photonui.Button: + src/interactive/button.js:115 +

+ + +
+ +
+

Left icon widget name.

+ +
+ +

Default: : null

+ + +
+
+

leftIconVisible

+ Boolean + + + + + +
+

Inherited from + photonui.Button: + src/interactive/button.js:157 +

+ + +
+ +
+

Define if the left icon is displayed or hidden.

+ +
+ +

Default: true

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

rightIcon

+ BaseIcon + + + + + +
+

Inherited from + photonui.Button: + src/interactive/button.js:198 +

+ + +
+ +
+

Right icon widget.

+ +
+ +

Default: : null

+ + +
+
+

rightIconName

+ String + + + + + +
+

Inherited from + photonui.Button: + src/interactive/button.js:175 +

+ + +
+ +
+

Right icon widget name.

+ +
+ +

Default: : null

+ + +
+
+

rightIconVisible

+ Boolean + + + + + +
+

Inherited from + photonui.Button: + src/interactive/button.js:217 +

+ + +
+ +
+

Define if the right icon is displayed or hidden.

+ +
+ +

Default: true

+ + +
+
+

text

+ String + + + + + +
+

Inherited from + photonui.Button: + src/interactive/button.js:77 +

+ + +
+ +
+

The button text.

+ +
+ +

Default: "Button"

+ + +
+
+

textVisible

+ Boolean + + + + + +
+

Inherited from + photonui.Button: + src/interactive/button.js:97 +

+ + +
+ +
+

Define if the button text is displayed or hidden.

+ +
+ +

Default: true

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

value

+ Boolean + + + + + +
+

Inherited from + photonui.CheckBox: + src/interactive/checkbox.js:75 +

+ + +
+ +
+

The input value.

+ +
+ +

Default: false

+ + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.Translation.html b/ref/classes/photonui.Translation.html new file mode 100644 index 00000000..419d3b8d --- /dev/null +++ b/ref/classes/photonui.Translation.html @@ -0,0 +1,1417 @@ + + + + + photonui.Translation - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.Translation Class

+
+ +
+ Extends photonui.Base +
+ + + + Module: NonVisual
+ Parent Module: PhotonUI + +
+ + +
+

A wrapper around Stone.js to fire locale events to widgets.

+

Documentation: https://github.com/flozz/stone.js/blob/master/README.md

+

NOTE: When you instantiate the translation widget, you can pass to it +the noGlobal option to avoid the creation of the global window._ function.

+

wEvents:

+
    +
  • locale-changed: +
      +
    • description: The locale changed.
    • +
    • callback: function(widget, locale)
    • +
    +
  • +
+ +
+ +
+

Constructor

+
+

photonui.Translation

+ +
+ (
    +
  • + params +
  • +
) +
+ + + + + + + + +
+

+ Defined in + src/nonvisual/translation.js:42 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + params + Object + + +
    +

    An object that can contain any property of the widget (optional).

    + +
    + +
  • +
+
+ + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onStonejsLocaleChanged

+ + () + + + + private + + + + + +
+

+ Defined in + src/nonvisual/translation.js:164 +

+ + + +
+ +
+ +
+ + + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

addCatalogs

+ +
+ (
    +
  • + catalogs +
  • +
) +
+ + + + + + + + +
+

+ Defined in + src/nonvisual/translation.js:104 +

+ + + +
+ +
+

Add one or more Stone.js catalog (a catalog contain all translated strings for a specific locale).

+ +
+ +
+

Parameters:

+ +
    +
  • + catalogs + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:157 +

+ + + +
+ +
+ Destroy the class. +
+ + + + +
+
+

enableDomScan

+ +
+ (
    +
  • + boolean +
  • +
) +
+ + + + + + + + +
+

+ Defined in + src/nonvisual/translation.js:145 +

+ + + +
+ +
+

Enable/disable Stone.js translating elements with the "stonejs" attribute in the DOM.

+ +
+ +
+

Parameters:

+ +
    +
  • + boolean + Boolean + + +
    +

    Enable or disable DOM scanning.

    + +
    + +
  • +
+
+ + + +
+
+

gettext

+ +
+ (
    +
  • + string +
  • +
  • + replacements +
  • +
) +
+ + + String + + + + + + + + +
+

+ Defined in + src/nonvisual/translation.js:120 +

+ + + +
+ +
+

Make a string translatable.

+ +
+ +
+

Parameters:

+ +
    +
  • + string + String + + +
    +

    the Translatable string

    + +
    + +
  • +
  • + replacements + Object + + +
    +

    An object that contain replacements for the string.

    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ String: +
+
+ + +
+
+

guessUserLanguage

+ + () + + + String + + + + + + + + +
+

+ Defined in + src/nonvisual/translation.js:112 +

+ + + +
+ +
+

Guess the user language.

+ +
+ + +
+

Returns:

+ +
+ String: +

The language code (e.g. "en", "fr", "it",...)

+ +
+
+ + +
+
+

lazyGettext

+ +
+ (
    +
  • + string +
  • +
  • + replacements +
  • +
) +
+ + + LazyString + + + + + + + + +
+

+ Defined in + src/nonvisual/translation.js:130 +

+ + + +
+ +
+

Make a string translatable.

+

The main difference between this method and the gettext method is +that this method does not return a translated sting but an object that +will translate the sting when it will be displayed (.toString() method +called).

+ +
+ +
+

Parameters:

+ +
    +
  • + string + String + + +
    +

    the Translatable string

    + +
    + +
  • +
  • + replacements + Object + + +
    +

    An object that contain replacements for the string.

    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ LazyString: +
+
+ + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

setBestMatchingLocale

+ +
+ (
    +
  • + locales +
  • +
) +
+ + + + + + + + +
+

+ Defined in + src/nonvisual/translation.js:96 +

+ + + +
+ +
+

Find and set the best language for the user (depending on available catalogs and given language list).

+ +
+ +
+

Parameters:

+ +
    +
  • + locales + Array | String + + +
    +

    Language list (optional, e.g. "fr", ["fr", "fr_FR", "en_US"]).

    + +
    + +
  • +
+
+ + + +
+
+

updateDomTranslation

+ + () + + + + + + + + +
+

+ Defined in + src/nonvisual/translation.js:153 +

+ + + +
+ +
+

Re-translate elements with the "stonejs" attribute in the DOM.

+ +
+ + + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

locale

+ String + + + + + +
+

+ Defined in + src/nonvisual/translation.js:80 +

+ + +
+ +
+

The current locale (e.g. "fr", "en", "it",...).

+ +
+ +

Default: null

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.Viewport.html b/ref/classes/photonui.Viewport.html new file mode 100644 index 00000000..c416864c --- /dev/null +++ b/ref/classes/photonui.Viewport.html @@ -0,0 +1,2233 @@ + + + + + photonui.Viewport - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.Viewport Class

+
+ +
+ Extends photonui.Container +
+ + + + Module: Container
+ Parent Module: PhotonUI + +
+ + +
+

Viewport.

+ +
+ +
+

Constructor

+
+

photonui.Viewport

+ + () + + + + + + + + +
+

+ Defined in + src/container/viewport.js:42 +

+ + + +
+ +
+ +
+ + + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:445 +

+ + + +
+ +
+ Called when the context menu should be displayed. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/container/viewport.js:379 +

+ + + +
+ +
+

Called when the locale is changed.

+ +
+ + + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/container/viewport.js:307 +

+ + + +
+ +
+

Build the widget HTML.

+ +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_sizingHack

+ + () + + + + private + + + + + +
+

+ Defined in + src/container/viewport.js:333 +

+ + + +
+ +
+

HACK: set the right height.

+ +
+ + + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/container/viewport.js:318 +

+ + + +
+ +
+

Called when the visibility changes.

+ +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    +

    Current visibility state (otptional, defaut=this.visible)

    + +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/container/container.js:194 +

+ + + +
+ +
+

Destroy the widget.

+ +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeChild

+ +
+ (
    +
  • + widget +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:182 +

+ + + +
+ +
+

Remove the given child.

+ +
+ +
+

Parameters:

+ + +
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

child

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:146 +

+ + +
+ +
+

The child widget.

+ +
+ +

Default: null (no child)

+ + +
+
+

childName

+ String + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:118 +

+ + +
+ +
+

The child widget name.

+ +
+ +

Default: null (no child)

+ + +
+
+

containerNode

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Container + + but overwritten in + src/container/viewport.js:290 +

+ + +
+ +
+

HTML Element that contain the child widget HTML.

+ +
+ + + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

height

+ Number + + + + + +
+

+ Defined in + src/container/viewport.js:254 +

+ + +
+ +
+

Height.

+
* Number: the size in px
+* Infinity: 100% of the parent height
+* null: auto
+ +
+ +

Default: Infinity

+ + +
+
+

horizontalChildExpansion

+ Boolean + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:66 +

+ + +
+ +
+

Horizontaly expand the container's child widget.

+ +
+ +

Default: true

+ + +
+
+

horizontalScrollbar

+ Boolean + + + + + +
+

+ Defined in + src/container/viewport.js:110 +

+ + +
+ +
+

Visibility of the horizontal scrollbar.

+
    +
  • true: displayed,
  • +
  • false: hidden,
  • +
  • null: auto.
  • +
+ +
+ +

Default: null

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/container/viewport.js:277 +

+ + +
+ +
+

Html outer element of the widget (if any).

+ +
+ +

Default: null

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

maxHeight

+ Number + + + + + +
+

+ Defined in + src/container/viewport.js:231 +

+ + +
+ +
+

Maximum height.

+
* Number: the size in px
+* Infinity: 100% of the parent height
+* null: no maximum height
+ +
+ +

Default: null

+ + +
+
+

maxWidth

+ Number + + + + + +
+

+ Defined in + src/container/viewport.js:162 +

+ + +
+ +
+

Maximum width.

+
* Number: the size in px
+* Infinity: 100% of the parent width
+* null: no maximum width
+ +
+ +

Default: null

+ + +
+
+

minHeight

+ Number + + + + + +
+

+ Defined in + src/container/viewport.js:208 +

+ + +
+ +
+

Minimum height.

+
* Number: the size in px
+* Infinity: 100% of the parent height
+* null: no minimum height
+ +
+ +

Default: null

+ + +
+
+

minWidth

+ Number + + + + + +
+

+ Defined in + src/container/viewport.js:139 +

+ + +
+ +
+

Minimum width.

+
* Number: the size in px
+* Infinity: 100% of the parent width
+* null: no minimum width
+ +
+ +

Default: null

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

padding

+ Number + + + + + +
+

+ Defined in + src/container/viewport.js:62 +

+ + +
+ +
+

Window container node padding.

+ +
+ +

Default: 0

+ + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

verticalChildExpansion

+ Boolean + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:92 +

+ + +
+ +
+

Verticaly expand the container's child widget.

+ +
+ +

Default: false

+ + +
+
+

verticalScrollbar

+ Boolean + + + + + +
+

+ Defined in + src/container/viewport.js:81 +

+ + +
+ +
+

Visibility of the vertical scrollbar.

+
    +
  • true: displayed,
  • +
  • false: hidden,
  • +
  • null: auto.
  • +
+ +
+ +

Default: null

+ + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+

width

+ Number + + + + + +
+

+ Defined in + src/container/viewport.js:185 +

+ + +
+ +
+

Width.

+
* Number: the size in px
+* Infinity: 100% of the parent width
+* null: auto
+ +
+ +

Default: Infinity

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.Widget.html b/ref/classes/photonui.Widget.html new file mode 100644 index 00000000..681f905e --- /dev/null +++ b/ref/classes/photonui.Widget.html @@ -0,0 +1,1983 @@ + + + + + photonui.Widget - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.Widget Class

+
+ +
+ Extends photonui.Base +
+ +
+ Defined in: src/widget.js:46 +
+ + Module: PhotonUI + +
+ + +
+

Base class for all PhotonUI widgets.

+

wEvents:

+
    +
  • +

    show:

    +
      +
    • description: called when the widget is displayed (a change in the parent's +visibility can also trigger this event).
    • +
    • callback: function(widget)
    • +
    +
  • +
  • +

    hide:

    +
      +
    • description: called when the widget is hidden (a change in the parent's visibility +can also trigger this event).
    • +
    • callback: function(widget)
    • +
    +
  • +
+ +
+ +
+

Constructor

+
+

photonui.Widget

+ +
+ (
    +
  • + params +
  • +
) +
+ + + + + + + + +
+

+ Defined in + src/widget.js:46 +

+ + + +
+ +
+ +
+ +
+

Parameters:

+ +
    +
  • + params + Object + + +
    +

    An object that can contain any property of the widget (optional).

    + +
    + +
  • +
+
+ + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/widget.js:445 +

+ + + +
+ +
+

Called when the context menu should be displayed.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

+ Defined in + src/widget.js:460 +

+ + + +
+ +
+

Called when the locale is changed.

+ +
+ + + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+

Javascript event binding (for internal use).

+ +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    +

    An unique id for the event.

    + +
    + +
  • +
  • + element + DOMElement + + +
    +

    The element on which the event will be bind.

    + +
    + +
  • +
  • + evName + String + + +
    +

    The event name (e.g. "mousemove", "click",...).

    + +
    + +
  • +
  • + callback + Function + + +
    +

    The function that will be called when the event occured.

    + +
    + +
  • +
  • + [options] + Object + optional + + +
    +

    options for addEventListener

    + +
    + +
  • +
+
+ + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

+ Defined in + src/widget.js:415 +

+ + + +
+ +
+

Build the widget HTML.

+ +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+

Call all callbacks for the given wEvent.

+

NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget.

+ +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    +

    The widget event.

    + +
    + +
  • +
  • + params + Array + + +
    +

    Parametters that will be sent to the callbacks.

    + +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+

Register available wEvent.

+ +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+

Unbind javascript event.

+ +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    +

    The id of the event.

    + +
    + +
  • +
+
+ + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+

Force the update of the given properties.

+

This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties.

+ +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    +

    The properties to update.

    + +
    + +
  • +
+
+ + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/widget.js:425 +

+ + + +
+ +
+

Called when the visibility changes.

+ +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    +

    Current visibility state (otptional, defaut=this.visible)

    + +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

+ Defined in + src/widget.js:378 +

+ + + +
+ +
+

Add a class to the outer HTML element of the widget.

+ +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    +

    The class to add.

    + +
    + +
  • +
+
+ + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/widget.js:367 +

+ + + +
+ +
+

Destroy the widget.

+ +
+ + + + +
+
+

domInsert

+ +
+ (
    +
  • + widget +
  • +
  • + element +
  • +
) +
+ + + + + + static + + + +
+

+ Defined in + src/widget.js:511 +

+ + + +
+ +
+

Insert a widget in the DOM.

+ +
+ +
+

Parameters:

+ +
    +
  • + widget + photonui.Widget + + +
    +

    The widget to insert.

    + +
    + +
  • +
  • + element + HTMLElement + + +
    +

    The DOM node or its id (optional, default=Widget.e_parent)

    + +
    + +
  • +
+
+ + + +
+
+

getAllWidgets

+ + () + + + Object + + + + + + static + + + +
+

+ Defined in + src/widget.js:500 +

+ + + +
+ +
+

Get all instanciated PhotonUI widgets.

+ +
+ + +
+

Returns:

+ +
+ Object: +

An object containing all widgets {"widgetName": Widget, ...}

+ +
+
+ + +
+
+

getWidget

+ +
+ (
    +
  • + name +
  • +
) +
+ + + Widget + + + + + + static + + + +
+

+ Defined in + src/widget.js:485 +

+ + + +
+ +
+

Get a widget.

+ +
+ +
+

Parameters:

+ +
    +
  • + name + String + + +
    +

    The widget name.

    + +
    + +
  • +
+
+ +
+

Returns:

+ +
+ Widget: +

The widget or null.

+ +
+
+ + +
+
+

hide

+ + () + + + + + + + + +
+

+ Defined in + src/widget.js:345 +

+ + + +
+ +
+

Hide the widget (equivalent to widget.visible = false).

+ +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+

Register a callback for any PhotonUI/Widget event (called wEvent).

+

Callback signature:

+
function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]])
+ +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    +

    An unique id for the callback.

    + +
    + +
  • +
  • + wEvent + String + + +
    +

    the PhotonUI/Widget event name.

    + +
    + +
  • +
  • + callback + Function + + +
    +

    The callback function.

    + +
    + +
  • +
  • + thisArg + Object + + +
    +

    The value of this (optionnal, default = current widget).

    + +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+

Remove a registered callback.

+ +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    +

    The id of the callback.

    + +
    + +
  • +
+
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

+ Defined in + src/widget.js:395 +

+ + + +
+ +
+

Remove a class from the outer HTML element of the widget.

+ +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    +

    The class to remove.

    + +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

+ Defined in + src/widget.js:336 +

+ + + +
+ +
+

Display the widget (equivalent to widget.visible = true).

+ +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

+ Defined in + src/widget.js:354 +

+ + + +
+ +
+

Detache the widget from its parent.

+ +
+ + + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+

Object containing references to registered callbacks.

+ +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+

Object containing references javascript events binding (for widget +internal use).

+ +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

+ Defined in + src/widget.js:321 +

+ + +
+ +
+

Object containing references to the widget HTML elements

+ +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

+ Defined in + src/widget.js:275 +

+ + +
+ +
+

Absolute position of the widget on the page.

+

{x: Number, y: Number}

+ +
+ + + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

+ Defined in + src/widget.js:223 +

+ + +
+ +
+

The managed contextual menu.

+ +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

+ Defined in + src/widget.js:206 +

+ + +
+ +
+

The name of the managed contextual menu (photonui.PopupWindow().name).

+ +
+ +

Default: null (= no context menu)

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+

Arbitrary data

+ +
+ +

Default: {}

+ + +
+
+

e_parent

+ HTMLElement + + + + + static + +
+

+ Defined in + src/widget.js:477 +

+ + +
+ +
+ +
+ +

Default: null

+ + +
+
+

html

+ HTMLElement + + + + + +
+

+ Defined in + src/widget.js:262 +

+ + +
+ +
+

Html outer element of the widget (if any).

+ +
+ +

Default: null

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

+ Defined in + src/widget.js:243 +

+ + +
+ +
+

Layout options.

+ +
+ +

Default: {}

+ + +
+
+

name

+ String + + + + + +
+

+ Defined in + src/widget.js:109 +

+ + +
+ +
+

The unique name of the widget.

+ +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

+ Defined in + src/widget.js:305 +

+ + +
+ +
+

Widget height (outer HTML element).

+ +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

+ Defined in + src/widget.js:291 +

+ + +
+ +
+

Widget width (outer HTML element).

+ +
+ + + +
+
+

parent

+ photonui.Widget + + + + + +
+

+ Defined in + src/widget.js:145 +

+ + +
+ +
+

The parent widget.

+ +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

+ Defined in + src/widget.js:131 +

+ + +
+ +
+

The parent widget name.

+ +
+ +

Default: null (no parent)

+ + +
+
+

tooltip

+ String + + + + + +
+

+ Defined in + src/widget.js:184 +

+ + +
+ +
+

Tooltip.

+ +
+ +

Default: null

+ + +
+
+

visible

+ Boolean + + + + + +
+

+ Defined in + src/widget.js:157 +

+ + +
+ +
+

Is the widget visible or hidden.

+ +
+ +

Default: true

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/classes/photonui.Window.html b/ref/classes/photonui.Window.html new file mode 100644 index 00000000..eb852585 --- /dev/null +++ b/ref/classes/photonui.Window.html @@ -0,0 +1,3113 @@ + + + + + photonui.Window - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

photonui.Window Class

+
+ +
+ Extends photonui.BaseWindow +
+ +
+ Defined in: src/container/window.js:46 +
+ + Module: Container
+ Parent Module: PhotonUI + +
+ + +
+

Window.

+

wEvents:

+
    +
  • close-button-clicked: +
      +
    • description: called when the close button was clicked.
    • +
    • callback: function(widget)
    • +
    +
  • +
+ +
+ +
+

Constructor

+
+

photonui.Window

+ + () + + + + + + + + +
+

+ Defined in + src/container/window.js:46 +

+ + + +
+ +
+ +
+ + + + +
+
+ +
+ + +
+
+

Item Index

+ +
+

Methods

+ + +
+ +
+

Properties

+ + +
+ + +
+ +
+

Methods

+ +
+

__internalDragging

+ +
+ (
    +
  • + offsetX +
  • +
  • + offsetY +
  • +
  • + pageX +
  • +
  • + pageY +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/container/window.js:372 +

+ + + +
+ +
+

Move the window.

+ +
+ +
+

Parameters:

+ +
    +
  • + offsetX + Number + + +
    + +
    + +
  • +
  • + offsetY + Number + + +
    + +
    + +
  • +
  • + pageX + Number + + +
    + +
    + +
  • +
  • + pageY + Number + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onContextMenu

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:445 +

+ + + +
+ +
+ Called when the context menu should be displayed. +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

__onLocaleChanged

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/container/window.js:477 +

+ + + +
+ +
+

Called when the locale is changed.

+ +
+ + + + +
+
+

_bindEvent

+ +
+ (
    +
  • + id +
  • +
  • + element +
  • +
  • + evName +
  • +
  • + callback +
  • +
  • + [options] +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:229 +

+ + + +
+ +
+ Javascript event binding (for internal use). +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the event. +
    + +
  • +
  • + element + DOMElement + + +
    + The element on which the event will be bind. +
    + +
  • +
  • + evName + String + + +
    + The event name (e.g. "mousemove", "click",...). +
    + +
  • +
  • + callback + Function + + +
    + The function that will be called when the event occured. +
    + +
  • +
  • + [options] + Object + optional + + +
    + options for addEventListener +
    + +
  • +
+
+ + + +
+
+

_buildHtml

+ + () + + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/container/window.js:273 +

+ + + +
+ +
+

Build the widget HTML.

+ +
+ + + + +
+
+

_callCallbacks

+ +
+ (
    +
  • + wEvent +
  • +
  • + params +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:292 +

+ + + +
+ +
+ Call all callbacks for the given wEvent. + +NOTE: the first argument passed to the callback is the current widget. +NOTE²: if the thisArg of the callback is null, this will be binded to the current widget. +
+ +
+

Parameters:

+ +
    +
  • + wEvent + String + + +
    + The widget event. +
    + +
  • +
  • + params + Array + + +
    + Parametters that will be sent to the callbacks. +
    + +
  • +
+
+ + + +
+
+

_closeButtonClicked

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/container/window.js:466 +

+ + + +
+ +
+

Close button clicked.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

_moveDragEnd

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/container/window.js:359 +

+ + + +
+ +
+

Stop moving the window.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

_moveDragging

+ +
+ (
    +
  • + offsetX +
  • +
  • + offsetY +
  • +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/container/window.js:346 +

+ + + +
+ +
+

Move the window.

+ +
+ +
+

Parameters:

+ +
    +
  • + offsetX + Number + + +
    + +
    + +
  • +
  • + offsetY + Number + + +
    + +
    + +
  • +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

_moveDragStart

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/container/window.js:328 +

+ + + +
+ +
+

Start moving the window.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

_moveTouchEnd

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/container/window.js:429 +

+ + + +
+ +
+

Stop moving the window.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

_moveTouchEnd

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/container/window.js:443 +

+ + + +
+ +
+

Gets the first touch event and normalizes pageX/Y and offsetX/Y properties.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

_moveTouchMove

+ +
+ (
    +
  • + offsetX +
  • +
  • + offsetY +
  • +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/container/window.js:415 +

+ + + +
+ +
+

Move the window.

+ +
+ +
+

Parameters:

+ +
    +
  • + offsetX + Number + + +
    + +
    + +
  • +
  • + offsetY + Number + + +
    + +
    + +
  • +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

_moveTouchStart

+ +
+ (
    +
  • + event +
  • +
) +
+ + + + private + + + + + +
+

+ Defined in + src/container/window.js:392 +

+ + + +
+ +
+

Start moving the window.

+ +
+ +
+

Parameters:

+ +
    +
  • + event + Object + + +
    + +
    + +
  • +
+
+ + + +
+
+

_registerWEvents

+ +
+ (
    +
  • + wEvents +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:276 +

+ + + +
+ +
+ Register available wEvent. +
+ +
+

Parameters:

+ +
    +
  • + wEvents + Array + + +
    + +
    + +
  • +
+
+ + + +
+
+

_unbindEvent

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:257 +

+ + + +
+ +
+ Unbind javascript event. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the event. +
    + +
  • +
+
+ + + +
+
+

_updateProperties

+ +
+ (
    +
  • + properties +
  • +
) +
+ + + deprecated + + private + + + + + +
+

Inherited from + photonui.Base: + src/base.js:209 +

+ + + +
+ +
+ Force the update of the given properties. + +This method is deprecated. +One should use '@photonui-update' abitbol's annotation on concerned properties. +
+ +
+

Parameters:

+ +
    +
  • + properties + Array + + +
    + The properties to update. +
    + +
  • +
+
+ + + +
+
+

_updateWindowList

+ + () + + + + private + + + + + +
+

+ Defined in + src/container/window.js:303 +

+ + + +
+ +
+

Update all the windows.

+ +
+ + + + +
+
+

_visibilityChanged

+ +
+ (
    +
  • + visibility +
  • +
) +
+ + + + private + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/container/container.js:208 +

+ + + +
+ +
+

Called when the visibility changes.

+ +
+ +
+

Parameters:

+ +
    +
  • + visibility + Boolean + + +
    +

    Current visibility state (otptional, defaut=this.visible)

    + +
    + +
  • +
+
+ + + +
+
+

addClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:378 +

+ + + +
+ +
+ Add a class to the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to add. +
    + +
  • +
+
+ + + +
+
+

center

+ + () + + + + + + + + +
+

Inherited from + photonui.BaseWindow: + src/container/basewindow.js:340 +

+ + + +
+ +
+

Center the window.

+ +
+ + + + +
+
+

destroy

+ + () + + + + + + + + +
+

Inherited from + + photonui.Base + + but overwritten in + src/container/window.js:257 +

+ + + +
+ +
+

Destroy the widget.

+ +
+ + + + +
+
+

hide

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:345 +

+ + + +
+ +
+ Hide the widget (equivalent to widget.visible = false). +
+ + + + +
+
+

moveToBack

+ + () + + + + + + + + +
+

+ Defined in + src/container/window.js:243 +

+ + + +
+ +
+

Bring the window to the back.

+ +
+ + + + +
+
+

moveToFront

+ + () + + + + + + + + +
+

+ Defined in + src/container/window.js:229 +

+ + + +
+ +
+

Bring the window to front.

+ +
+ + + + +
+
+

registerCallback

+ +
+ (
    +
  • + id +
  • +
  • + wEvent +
  • +
  • + callback +
  • +
  • + thisArg +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:169 +

+ + + +
+ +
+ Register a callback for any PhotonUI/Widget event (called wEvent). + +Callback signature: + + function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]]) +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + An unique id for the callback. +
    + +
  • +
  • + wEvent + String + + +
    + the PhotonUI/Widget event name. +
    + +
  • +
  • + callback + Function + + +
    + The callback function. +
    + +
  • +
  • + thisArg + Object + + +
    + The value of this (optionnal, default = current widget). +
    + +
  • +
+
+ + + +
+
+

removeCallback

+ +
+ (
    +
  • + id +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Base: + src/base.js:193 +

+ + + +
+ +
+ Remove a registered callback. +
+ +
+

Parameters:

+ +
    +
  • + id + String + + +
    + The id of the callback. +
    + +
  • +
+
+ + + +
+
+

removeChild

+ +
+ (
    +
  • + widget +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:182 +

+ + + +
+ +
+

Remove the given child.

+ +
+ +
+

Parameters:

+ + +
+ + + +
+
+

removeClass

+ +
+ (
    +
  • + className +
  • +
) +
+ + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:395 +

+ + + +
+ +
+ Remove a class from the outer HTML element of the widget. +
+ +
+

Parameters:

+ +
    +
  • + className + String + + +
    + The class to remove. +
    + +
  • +
+
+ + + +
+
+

show

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:336 +

+ + + +
+ +
+ Display the widget (equivalent to widget.visible = true). +
+ + + + +
+
+

unparent

+ + () + + + + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:354 +

+ + + +
+ +
+ Detache the widget from its parent. +
+ + + + +
+
+ +
+

Properties

+ +
+

__callbacks

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:142 +

+ + +
+ +
+ Object containing references to registered callbacks. +
+ + + +
+
+

__events

+ Object + + + private + + + +
+

Inherited from + photonui.Base: + src/base.js:132 +

+ + +
+ +
+ Object containing references javascript events binding (for widget +internal use). +
+ + + +
+
+

__html

+ Object + + + private + + + +
+

Inherited from + photonui.Widget: + src/widget.js:321 +

+ + +
+ +
+ Object containing references to the widget HTML elements +
+ + + +
+
+

absolutePosition

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:275 +

+ + +
+ +
+ Absolute position of the widget on the page. + +{x: Number, y: Number} +
+ + + +
+
+

child

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:146 +

+ + +
+ +
+

The child widget.

+ +
+ +

Default: null (no child)

+ + +
+
+

childName

+ String + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:118 +

+ + +
+ +
+

The child widget name.

+ +
+ +

Default: null (no child)

+ + +
+
+

closeButtonVisible

+ Boolean +default: true + + + + + +
+

+ Defined in + src/container/window.js:144 +

+ + +
+ +
+

Determine if the close button in the title bar is displayed or not.

+ +
+ + + +
+
+

containerNode

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Container + + but overwritten in + src/container/window.js:197 +

+ + +
+ +
+

HTML Element that contain the child widget HTML.

+ +
+ + + +
+
+

contextMenu

+ photonui.PopupWindow + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:223 +

+ + +
+ +
+ The managed contextual menu. +
+ +

Default: null (= no context menu)

+ + +
+
+

contextMenuName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:206 +

+ + +
+ +
+ The name of the managed contextual menu (photonui.PopupWindow().name). +
+ +

Default: null (= no context menu)

+ + +
+
+

data

+ Object + + + + + +
+

Inherited from + photonui.Base: + src/base.js:113 +

+ + +
+ +
+ Arbitrary data +
+ +

Default: {}

+ + +
+
+

fullscreen

+ Boolean + + + + + +
+

+ Defined in + src/container/window.js:122 +

+ + +
+ +
+

Fullscreen Window

+ +
+ +

Default: false

+ + +
+
+

height

+ Number + + + + + + + +
+

Height of the container node.

+ +
+ +

Default: : null (auto)

+ + +
+
+

horizontalChildExpansion

+ Boolean + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:66 +

+ + +
+ +
+

Horizontaly expand the container's child widget.

+ +
+ +

Default: true

+ + +
+
+

html

+ HTMLElement + + + + + +
+

Inherited from + + photonui.Widget + + but overwritten in + src/container/basewindow.js:311 +

+ + +
+ +
+

Html outer element of the widget (if any).

+ +
+ +

Default: null

+ + +
+
+

layoutOptions

+ Object + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:243 +

+ + +
+ +
+ Layout options. +
+ +

Default: {}

+ + +
+
+

maxHeight

+ Number + + + + + + + +
+

Maximum height of the container node.

+ +
+ +

Default: : null (no maximum)

+ + +
+
+

maxWidth

+ Number + + + + + + + +
+

Maximum width of the container node.

+ +
+ +

Default: : null (no maximum)

+ + +
+
+

minHeight

+ Number + + + + + + + +
+

Minimum height of the container node.

+ +
+ +

Default: : null (no minimum)

+ + +
+
+

minWidth

+ Number + + + + + + + +
+

Minimum width of the container node.

+ +
+ +

Default: : null (no minimum)

+ + +
+
+

modal

+ Boolean + + + + + +
+

+ Defined in + src/container/window.js:170 +

+ + +
+ +
+

Modal window?

+ +
+ +

Default: false

+ + +
+
+

movable

+ Boolean + + + + + +
+

+ Defined in + src/container/window.js:105 +

+ + +
+ +
+

Determine if the window can be moved (drag & drop) by the user.

+ +
+ +

Default: true

+ + +
+
+

name

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:109 +

+ + +
+ +
+ The unique name of the widget. +
+ +

Default: "widget-" + uuid.v4()

+ + +
+
+

offsetHeight

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:305 +

+ + +
+ +
+ Widget height (outer HTML element). +
+ + + +
+
+

offsetWidth

+ Number + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:291 +

+ + +
+ +
+ Widget width (outer HTML element). +
+ + + +
+
+

padding

+ Number + + + + + + + +
+

Window container node padding.

+ +
+ +

Default: 0

+ + +
+
+

parent

+ photonui.Widget + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:145 +

+ + +
+ +
+ The parent widget. +
+ +

Default: null (no parent)

+ + +
+
+

parentName

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:131 +

+ + +
+ +
+ The parent widget name. +
+ +

Default: null (no parent)

+ + +
+
+

position

+ Object + + + + + +
+

Inherited from + photonui.BaseWindow: + src/container/basewindow.js:78 +

+ + +
+ +
+

Window position.

+
{x: Number, y: Number}
+ +
+ +

Default: {x: 0, y: 0}

+ + +
+
+

title

+ String + + + + + +
+

+ Defined in + src/container/window.js:85 +

+ + +
+ +
+

The window title.

+ +
+ +

Default: "Window"

+ + +
+
+

tooltip

+ String + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:184 +

+ + +
+ +
+ Tooltip. +
+ +

Default: null

+ + +
+
+

verticalChildExpansion

+ Boolean + + + + + +
+

Inherited from + photonui.Container: + src/container/container.js:92 +

+ + +
+ +
+

Verticaly expand the container's child widget.

+ +
+ +

Default: false

+ + +
+
+

visible

+ Boolean + + + + + +
+

Inherited from + photonui.Widget: + src/widget.js:157 +

+ + +
+ +
+ Is the widget visible or hidden. +
+ +

Default: true

+ + +
+
+

width

+ Number + + + + + + + +
+

Width of the container node.

+ +
+ +

Default: : null (auto)

+ + +
+
+

x

+ Number + + + + + + + +
+

The X position of the Window.

+ +
+ +

Default: 0

+ + +
+
+

y

+ Number + + + + + + + +
+

The Y position of the Window.

+ +
+ +

Default: 0

+ + +
+
+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/data.json b/ref/data.json new file mode 100644 index 00000000..07307260 --- /dev/null +++ b/ref/data.json @@ -0,0 +1,11240 @@ +{ + "project": { + "name": "photonui", + "description": "A javascript framework to create user interfaces", + "version": "1.8.0", + "url": "http://wanadev.github.io/PhotonUI/" + }, + "files": { + "src/composite/colorbutton.js": { + "name": "src/composite/colorbutton.js", + "modules": { + "Composite": 1 + }, + "classes": { + "photonui.ColorButton": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/composite/colorpickerdialog.js": { + "name": "src/composite/colorpickerdialog.js", + "modules": {}, + "classes": { + "photonui.ColorPickerDialog": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/composite/fontselect.js": { + "name": "src/composite/fontselect.js", + "modules": {}, + "classes": { + "photonui.FontSelect": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/composite/popupmenu.js": { + "name": "src/composite/popupmenu.js", + "modules": {}, + "classes": { + "photonui.PopupMenu": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/composite/select.js": { + "name": "src/composite/select.js", + "modules": {}, + "classes": { + "photonui.Select": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/container/basewindow.js": { + "name": "src/container/basewindow.js", + "modules": { + "Container": 1 + }, + "classes": { + "photonui.BaseWindow": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/container/container.js": { + "name": "src/container/container.js", + "modules": {}, + "classes": { + "photonui.Container": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/container/dialog.js": { + "name": "src/container/dialog.js", + "modules": {}, + "classes": { + "photonui.Dialog": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/container/expander.js": { + "name": "src/container/expander.js", + "modules": {}, + "classes": { + "photonui.Expander": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/container/menuitem.js": { + "name": "src/container/menuitem.js", + "modules": {}, + "classes": { + "photonui.MenuItem": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/container/popupwindow.js": { + "name": "src/container/popupwindow.js", + "modules": {}, + "classes": { + "photonui.PopupWindow": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/container/submenuitem.js": { + "name": "src/container/submenuitem.js", + "modules": {}, + "classes": { + "photonui.SubMenuItem": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/container/tabitem.js": { + "name": "src/container/tabitem.js", + "modules": {}, + "classes": { + "photonui.TabItem": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/container/viewport.js": { + "name": "src/container/viewport.js", + "modules": {}, + "classes": { + "photonui.Viewport": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/container/window.js": { + "name": "src/container/window.js", + "modules": {}, + "classes": { + "photonui.Window": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/dataview/dataview.js": { + "name": "src/dataview/dataview.js", + "modules": { + "DataView": 1 + }, + "classes": { + "photonui.DataView": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/dataview/fluidview.js": { + "name": "src/dataview/fluidview.js", + "modules": {}, + "classes": { + "photonui.FluidView": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/dataview/iconview.js": { + "name": "src/dataview/iconview.js", + "modules": {}, + "classes": { + "photonui.IconView": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/dataview/listview.js": { + "name": "src/dataview/listview.js", + "modules": {}, + "classes": { + "photonui.ListView": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/dataview/tableview.js": { + "name": "src/dataview/tableview.js", + "modules": {}, + "classes": { + "photonui.TableView": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/interactive/button.js": { + "name": "src/interactive/button.js", + "modules": { + "Interactive": 1 + }, + "classes": { + "photonui.Button": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/interactive/checkbox.js": { + "name": "src/interactive/checkbox.js", + "modules": {}, + "classes": { + "photonui.CheckBox": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/interactive/colorpalette.js": { + "name": "src/interactive/colorpalette.js", + "modules": {}, + "classes": { + "photonui.ColorPalette": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/interactive/colorpicker.js": { + "name": "src/interactive/colorpicker.js", + "modules": {}, + "classes": { + "photonui.ColorPicker": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/interactive/field.js": { + "name": "src/interactive/field.js", + "modules": {}, + "classes": { + "photonui.Field": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/interactive/iconbutton.js": { + "name": "src/interactive/iconbutton.js", + "modules": {}, + "classes": { + "photonui.IconButton": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/interactive/numericfield.js": { + "name": "src/interactive/numericfield.js", + "modules": {}, + "classes": { + "photonui.NumericField": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/interactive/slider.js": { + "name": "src/interactive/slider.js", + "modules": {}, + "classes": { + "photonui.Slider": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/interactive/switch.js": { + "name": "src/interactive/switch.js", + "modules": {}, + "classes": { + "photonui.Switch": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/interactive/textareafield.js": { + "name": "src/interactive/textareafield.js", + "modules": {}, + "classes": { + "photonui.TextAreaField": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/interactive/textfield.js": { + "name": "src/interactive/textfield.js", + "modules": {}, + "classes": { + "photonui.TextField": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/interactive/togglebutton.js": { + "name": "src/interactive/togglebutton.js", + "modules": {}, + "classes": { + "photonui.ToggleButton": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/layout/boxlayout.js": { + "name": "src/layout/boxlayout.js", + "modules": { + "Layout": 1 + }, + "classes": { + "photonui.BoxLayout": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/layout/fluidlayout.js": { + "name": "src/layout/fluidlayout.js", + "modules": {}, + "classes": { + "photonui.FluidLayout": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/layout/gridlayout.js": { + "name": "src/layout/gridlayout.js", + "modules": {}, + "classes": { + "photonui.GridLayout": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/layout/layout.js": { + "name": "src/layout/layout.js", + "modules": {}, + "classes": { + "photonui.Layout": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/layout/menu.js": { + "name": "src/layout/menu.js", + "modules": {}, + "classes": { + "photonui.Menu": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/layout/tablayout.js": { + "name": "src/layout/tablayout.js", + "modules": {}, + "classes": { + "photonui.TabLayout": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/nonvisual/accelmanager.js": { + "name": "src/nonvisual/accelmanager.js", + "modules": { + "NonVisual": 1 + }, + "classes": { + "photonui.AccelManager": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/nonvisual/color.js": { + "name": "src/nonvisual/color.js", + "modules": {}, + "classes": { + "photonui.Color": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/nonvisual/filemanager.js": { + "name": "src/nonvisual/filemanager.js", + "modules": {}, + "classes": { + "photonui.FileManager": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/nonvisual/keyboardmanager.js": { + "name": "src/nonvisual/keyboardmanager.js", + "modules": {}, + "classes": { + "photonui.KeyboardManager": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/nonvisual/mousemanager.js": { + "name": "src/nonvisual/mousemanager.js", + "modules": {}, + "classes": { + "photonui.MouseManager": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/nonvisual/spritesheet.js": { + "name": "src/nonvisual/spritesheet.js", + "modules": {}, + "classes": { + "photonui.SpriteSheet": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/nonvisual/translation.js": { + "name": "src/nonvisual/translation.js", + "modules": {}, + "classes": { + "photonui.Translation": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/visual/baseicon.js": { + "name": "src/visual/baseicon.js", + "modules": { + "Visual": 1 + }, + "classes": { + "photonui.BaseIcon": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/visual/canvas.js": { + "name": "src/visual/canvas.js", + "modules": {}, + "classes": { + "photonui.Canvas": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/visual/faicon.js": { + "name": "src/visual/faicon.js", + "modules": {}, + "classes": { + "photonui.FAIcon": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/visual/image.js": { + "name": "src/visual/image.js", + "modules": {}, + "classes": { + "photonui.Image": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/visual/label.js": { + "name": "src/visual/label.js", + "modules": {}, + "classes": { + "photonui.Label": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/visual/progressbar.js": { + "name": "src/visual/progressbar.js", + "modules": {}, + "classes": { + "photonui.ProgressBar": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/visual/separator.js": { + "name": "src/visual/separator.js", + "modules": {}, + "classes": { + "photonui.Separator": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/visual/spriteicon.js": { + "name": "src/visual/spriteicon.js", + "modules": {}, + "classes": { + "photonui.SpriteIcon": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/visual/template.js": { + "name": "src/visual/template.js", + "modules": {}, + "classes": { + "photonui.Template": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/visual/text.js": { + "name": "src/visual/text.js", + "modules": {}, + "classes": { + "photonui.Text": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/base.js": { + "name": "src/base.js", + "modules": {}, + "classes": { + "photonui.Base": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/helpers.js": { + "name": "src/helpers.js", + "modules": { + "Helpers": 1 + }, + "classes": { + "photonui.Helpers": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/photonui.js": { + "name": "src/photonui.js", + "modules": { + "PhotonUI": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": { + "photonui": 1 + } + }, + "src/widget.js": { + "name": "src/widget.js", + "modules": {}, + "classes": { + "photonui.Widget": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + } + } + }, + "modules": { + "PhotonUI": { + "name": "PhotonUI", + "submodules": { + "Composite": 1, + "Container": 1, + "DataView": 1, + "Interactive": 1, + "Layout": 1, + "NonVisual": 1, + "Visual": 1, + "Helpers": 1 + }, + "elements": {}, + "classes": { + "photonui.ColorButton": 1, + "photonui.ColorPickerDialog": 1, + "photonui.FontSelect": 1, + "photonui.PopupMenu": 1, + "photonui.Select": 1, + "photonui.BaseWindow": 1, + "photonui.Container": 1, + "photonui.Dialog": 1, + "photonui.Expander": 1, + "photonui.MenuItem": 1, + "photonui.PopupWindow": 1, + "photonui.SubMenuItem": 1, + "photonui.TabItem": 1, + "photonui.Viewport": 1, + "photonui.Window": 1, + "photonui.DataView": 1, + "photonui.FluidView": 1, + "photonui.IconView": 1, + "photonui.ListView": 1, + "photonui.TableView": 1, + "photonui.Button": 1, + "photonui.CheckBox": 1, + "photonui.ColorPalette": 1, + "photonui.ColorPicker": 1, + "photonui.Field": 1, + "photonui.IconButton": 1, + "photonui.NumericField": 1, + "photonui.Slider": 1, + "photonui.Switch": 1, + "photonui.TextAreaField": 1, + "photonui.TextField": 1, + "photonui.ToggleButton": 1, + "photonui.BoxLayout": 1, + "photonui.FluidLayout": 1, + "photonui.GridLayout": 1, + "photonui.Layout": 1, + "photonui.Menu": 1, + "photonui.TabLayout": 1, + "photonui.AccelManager": 1, + "photonui.Color": 1, + "photonui.FileManager": 1, + "photonui.KeyboardManager": 1, + "photonui.MouseManager": 1, + "photonui.SpriteSheet": 1, + "photonui.Translation": 1, + "photonui.BaseIcon": 1, + "photonui.Canvas": 1, + "photonui.FAIcon": 1, + "photonui.Image": 1, + "photonui.Label": 1, + "photonui.ProgressBar": 1, + "photonui.Separator": 1, + "photonui.SpriteIcon": 1, + "photonui.Template": 1, + "photonui.Text": 1, + "photonui.Base": 1, + "photonui.Helpers": 1, + "photonui.Widget": 1 + }, + "fors": {}, + "namespaces": { + "photonui": 1 + }, + "tag": "main", + "file": "src/widget.js", + "line": 46, + "description": "PhotonUI - Javascript Web User Interface.", + "itemtype": "main" + }, + "Composite": { + "name": "Composite", + "submodules": {}, + "elements": {}, + "classes": { + "photonui.ColorButton": 1, + "photonui.ColorPickerDialog": 1, + "photonui.FontSelect": 1, + "photonui.PopupMenu": 1, + "photonui.Select": 1 + }, + "fors": {}, + "is_submodule": 1, + "namespaces": { + "photonui": 1 + }, + "module": "PhotonUI", + "namespace": "", + "file": "src/composite/select.js", + "line": 45, + "description": "PhotonUI - Javascript Web User Interface." + }, + "Container": { + "name": "Container", + "submodules": {}, + "elements": {}, + "classes": { + "photonui.BaseWindow": 1, + "photonui.Container": 1, + "photonui.Dialog": 1, + "photonui.Expander": 1, + "photonui.MenuItem": 1, + "photonui.PopupWindow": 1, + "photonui.SubMenuItem": 1, + "photonui.TabItem": 1, + "photonui.Viewport": 1, + "photonui.Window": 1 + }, + "fors": {}, + "is_submodule": 1, + "namespaces": { + "photonui": 1 + }, + "module": "PhotonUI", + "namespace": "", + "file": "src/container/window.js", + "line": 46, + "description": "PhotonUI - Javascript Web User Interface." + }, + "DataView": { + "name": "DataView", + "submodules": {}, + "elements": {}, + "classes": { + "photonui.DataView": 1, + "photonui.FluidView": 1, + "photonui.IconView": 1, + "photonui.ListView": 1, + "photonui.TableView": 1 + }, + "fors": {}, + "is_submodule": 1, + "namespaces": { + "photonui": 1 + }, + "module": "PhotonUI", + "namespace": "", + "file": "src/dataview/tableview.js", + "line": 46, + "description": "PhotonUI - Javascript Web User Interface." + }, + "Interactive": { + "name": "Interactive", + "submodules": {}, + "elements": {}, + "classes": { + "photonui.Button": 1, + "photonui.CheckBox": 1, + "photonui.ColorPalette": 1, + "photonui.ColorPicker": 1, + "photonui.Field": 1, + "photonui.IconButton": 1, + "photonui.NumericField": 1, + "photonui.Slider": 1, + "photonui.Switch": 1, + "photonui.TextAreaField": 1, + "photonui.TextField": 1, + "photonui.ToggleButton": 1 + }, + "fors": {}, + "is_submodule": 1, + "namespaces": { + "photonui": 1 + }, + "module": "PhotonUI", + "namespace": "", + "file": "src/interactive/togglebutton.js", + "line": 42, + "description": "PhotonUI - Javascript Web User Interface." + }, + "Layout": { + "name": "Layout", + "submodules": {}, + "elements": {}, + "classes": { + "photonui.BoxLayout": 1, + "photonui.FluidLayout": 1, + "photonui.GridLayout": 1, + "photonui.Layout": 1, + "photonui.Menu": 1, + "photonui.TabLayout": 1 + }, + "fors": {}, + "is_submodule": 1, + "namespaces": { + "photonui": 1 + }, + "module": "PhotonUI", + "namespace": "", + "file": "src/layout/tablayout.js", + "line": 44, + "description": "PhotonUI - Javascript Web User Interface." + }, + "NonVisual": { + "name": "NonVisual", + "submodules": {}, + "elements": {}, + "classes": { + "photonui.AccelManager": 1, + "photonui.Color": 1, + "photonui.FileManager": 1, + "photonui.KeyboardManager": 1, + "photonui.MouseManager": 1, + "photonui.SpriteSheet": 1, + "photonui.Translation": 1 + }, + "fors": {}, + "is_submodule": 1, + "namespaces": { + "photonui": 1 + }, + "module": "PhotonUI", + "namespace": "", + "file": "src/nonvisual/translation.js", + "line": 42, + "description": "PhotonUI - Javascript Web User Interface." + }, + "Visual": { + "name": "Visual", + "submodules": {}, + "elements": {}, + "classes": { + "photonui.BaseIcon": 1, + "photonui.Canvas": 1, + "photonui.FAIcon": 1, + "photonui.Image": 1, + "photonui.Label": 1, + "photonui.ProgressBar": 1, + "photonui.Separator": 1, + "photonui.SpriteIcon": 1, + "photonui.Template": 1, + "photonui.Text": 1 + }, + "fors": {}, + "is_submodule": 1, + "namespaces": { + "photonui": 1 + }, + "module": "PhotonUI", + "namespace": "", + "file": "src/visual/text.js", + "line": 43, + "description": "PhotonUI - Javascript Web User Interface." + }, + "Helpers": { + "name": "Helpers", + "submodules": {}, + "elements": {}, + "classes": { + "photonui.Helpers": 1 + }, + "fors": {}, + "is_submodule": 1, + "namespaces": { + "photonui": 1 + }, + "module": "PhotonUI", + "namespace": "", + "file": "src/helpers.js", + "line": 42, + "description": "PhotonUI - Javascript Web User Interface.", + "tag": "main", + "itemtype": "main" + } + }, + "classes": { + "photonui.ColorButton": { + "name": "photonui.ColorButton", + "shortname": "ColorButton", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui", + "file": "src/composite/colorbutton.js", + "line": 47, + "description": "Color Button.\n\nwEvents:\n\n * value-changed:\n - description: the selected color changed.\n - callback: function(widget, color)", + "is_constructor": 1, + "extends": "photonui.Widget" + }, + "photonui.ColorPickerDialog": { + "name": "photonui.ColorPickerDialog", + "shortname": "ColorPickerDialog", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui", + "file": "src/composite/colorpickerdialog.js", + "line": 52, + "description": "Color Picker Dialog.\n\nwEvents:\n\n * value-changed:\n - description: the selected color changed.\n - callback: function(widget, color)", + "is_constructor": 1, + "extends": "photonui.Dialog" + }, + "photonui.FontSelect": { + "name": "photonui.FontSelect", + "shortname": "FontSelect", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui", + "file": "src/composite/fontselect.js", + "line": 43, + "description": "Font Selector.\n\nwEvents:", + "is_constructor": 1, + "extends": "photonui.Select" + }, + "photonui.PopupMenu": { + "name": "photonui.PopupMenu", + "shortname": "PopupMenu", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui", + "file": "src/composite/popupmenu.js", + "line": 42, + "description": "Popup Menu.", + "is_constructor": 1, + "extends": "photonui.PopupWindow", + "uses": [ + "photonui.Layout", + "photonui.Menu" + ] + }, + "photonui.Select": { + "name": "photonui.Select", + "shortname": "Select", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui", + "file": "src/composite/select.js", + "line": 45, + "description": "Select input.\n\nwEvents:\n\n * value-changed:\n - description: called when the value was modified.\n - callback: function(widget, value)", + "is_constructor": 1, + "extends": "photonui.Widget" + }, + "photonui.BaseWindow": { + "name": "photonui.BaseWindow", + "shortname": "BaseWindow", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui", + "file": "src/container/basewindow.js", + "line": 42, + "description": "Windows base class.\n\nwEvents:\n\n * position-changed:\n - description: called when the widows is moved.\n - callback: function(widget, x, y)", + "is_constructor": 1, + "extends": "photonui.Container" + }, + "photonui.Container": { + "name": "photonui.Container", + "shortname": "Container", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui", + "file": "src/container/container.js", + "line": 41, + "description": "Base class for container widgets.", + "is_constructor": 1, + "extends": "photonui.Widget" + }, + "photonui.Dialog": { + "name": "photonui.Dialog", + "shortname": "Dialog", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui", + "file": "src/container/dialog.js", + "line": 45, + "description": "Dialog Window.", + "is_constructor": 1, + "extends": "photonui.Window" + }, + "photonui.Expander": { + "name": "photonui.Expander", + "shortname": "Expander", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui", + "file": "src/container/expander.js", + "line": 43, + "description": "Expander container.\n\nwEvents:\n\n * folded:\n - description: called when the expander is folded by user.\n - callback: function(widget)\n * unfolded:\n - description: called when the expander is unfolded by user.\n - callback: function(widget)", + "is_constructor": 1, + "extends": "photonui.Container" + }, + "photonui.MenuItem": { + "name": "photonui.MenuItem", + "shortname": "MenuItem", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui", + "file": "src/container/menuitem.js", + "line": 45, + "description": "Menu item.", + "is_constructor": 1, + "extends": "photonui.Container" + }, + "photonui.PopupWindow": { + "name": "photonui.PopupWindow", + "shortname": "PopupWindow", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui", + "file": "src/container/popupwindow.js", + "line": 41, + "description": "Popup Window.", + "is_constructor": 1, + "extends": "photonui.BaseWindow" + }, + "photonui.SubMenuItem": { + "name": "photonui.SubMenuItem", + "shortname": "SubMenuItem", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui", + "file": "src/container/submenuitem.js", + "line": 43, + "description": "Submenu Menu item (fold/unfold a submenu).", + "is_constructor": 1, + "extends": "photonui.MenuItem" + }, + "photonui.TabItem": { + "name": "photonui.TabItem", + "shortname": "TabItem", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui", + "file": "src/container/tabitem.js", + "line": 46, + "description": "Tab Item.\n\n wEvents:\n\n * click:\n - description: called when the tab was clicked.\n - callback: function(widget, event)", + "is_constructor": 1, + "extends": "photonui.Container", + "params": [ + { + "name": "params", + "description": "An object that can contain any property of the widget (optional).", + "type": "Object" + } + ] + }, + "photonui.Viewport": { + "name": "photonui.Viewport", + "shortname": "Viewport", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui", + "file": "src/container/viewport.js", + "line": 42, + "description": "Viewport.", + "is_constructor": 1, + "extends": "photonui.Container" + }, + "photonui.Window": { + "name": "photonui.Window", + "shortname": "Window", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui", + "file": "src/container/window.js", + "line": 46, + "description": "Window.\n\nwEvents:\n\n * close-button-clicked:\n - description: called when the close button was clicked.\n - callback: function(widget)", + "is_constructor": 1, + "extends": "photonui.BaseWindow" + }, + "photonui.DataView": { + "name": "photonui.DataView", + "shortname": "DataView", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui", + "file": "src/dataview/dataview.js", + "line": 44, + "description": "DataView container.\n\nwEvents:\n\n * item-click:\n - description: called when an item is clicked.\n - callback: function (event, item)\n\n * item-select:\n - description: called when an item is selected.\n - callback: function (item)\n\n * item-unselect:\n - description: called when an item is unselected.\n - callback: function (item)\n\n * item-sort:\n - description: called when an item is moved to a new position.\n - callback: function (item, position)", + "is_constructor": 1, + "extends": "photonui.Widget" + }, + "photonui.FluidView": { + "name": "photonui.FluidView", + "shortname": "FluidView", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui", + "file": "src/dataview/fluidview.js", + "line": 43, + "description": "FluidView container.", + "is_constructor": 1, + "extends": "photonui.DataView" + }, + "photonui.IconView": { + "name": "photonui.IconView", + "shortname": "IconView", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui", + "file": "src/dataview/iconview.js", + "line": 47, + "description": "IconView container.", + "is_constructor": 1, + "extends": "photonui.FluidView" + }, + "photonui.ListView": { + "name": "photonui.ListView", + "shortname": "ListView", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui", + "file": "src/dataview/listview.js", + "line": 44, + "description": "ListView container.", + "is_constructor": 1, + "extends": "photonui.DataView" + }, + "photonui.TableView": { + "name": "photonui.TableView", + "shortname": "TableView", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui", + "file": "src/dataview/tableview.js", + "line": 46, + "description": "TableView container.", + "is_constructor": 1, + "extends": "photonui.DataView" + }, + "photonui.Button": { + "name": "photonui.Button", + "shortname": "Button", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "photonui.ToggleButton" + ], + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui", + "file": "src/interactive/button.js", + "line": 44, + "description": "Button.\n\nwEvents:\n\n * click:\n - description: called when the button was clicked.\n - callback: function(widget, event)", + "is_constructor": 1, + "extends": "photonui.Widget" + }, + "photonui.CheckBox": { + "name": "photonui.CheckBox", + "shortname": "CheckBox", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui", + "file": "src/interactive/checkbox.js", + "line": 41, + "description": "Checkbox.\n\nwEvents:\n\n * value-changed:\n - description: called when the value was modified.\n - callback: function(widget, value)", + "is_constructor": 1, + "extends": "photonui.Widget" + }, + "photonui.ColorPalette": { + "name": "photonui.ColorPalette", + "shortname": "ColorPalette", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui", + "file": "src/interactive/colorpalette.js", + "line": 43, + "description": "A Color Palette.\n\nwEvents:\n\n * value-changed:\n - description: the selected color changed.\n - callback: function(widget, color)", + "is_constructor": 1, + "extends": "photonui.Widget", + "params": [ + { + "name": "params", + "description": "An object that can contain any property of the widget (optional).", + "type": "Object" + } + ] + }, + "photonui.ColorPicker": { + "name": "photonui.ColorPicker", + "shortname": "ColorPicker", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui", + "file": "src/interactive/colorpicker.js", + "line": 44, + "description": "A Color Picker.\n\nwEvents:\n\n * value-changed:\n - description: the selected color changed.\n - callback: function (widget, color)\n\nvalue-changed-final:\n - description: called when the value is no more modified after continuous changes\n - callback: function (widget, color)", + "is_constructor": 1, + "extends": "photonui.Widget", + "params": [ + { + "name": "params", + "description": "An object that can contain any property of the widget (optional).", + "type": "Object" + } + ] + }, + "photonui.Field": { + "name": "photonui.Field", + "shortname": "Field", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui", + "file": "src/interactive/field.js", + "line": 43, + "description": "Base class for fields.\n\nwEvents:\n\n * value-changed:\n - description: called when the value was modified.\n - callback: function(widget, value)\n\n * value-changed-final:\n - description: called when the value is no more modified after continuous changes\n - callback: function(widget, value)\n\n * keydown:\n - description: called when a key is pressed.\n - callback: function(widget, event)\n\n * keyup:\n - description: called when a key is released.\n - callback: function(widget, event)\n\n * keypress:\n - description: called just before the insertion of a char.\n - callback: function(widget, event)\n\n * selection-changed:\n - description: called when the selection was changed.\n - callback: function(widget, selectionStart, selectionEnd, selectedText, event)", + "is_constructor": 1, + "extends": "photonui.Widget" + }, + "photonui.IconButton": { + "name": "photonui.IconButton", + "shortname": "IconButton", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui", + "file": "src/interactive/iconbutton.js", + "line": 44, + "description": "A simple flat button that only contains an icon\n\nwEvents:\n\n * click:\n - description: called when the button was clicked.\n - callback: function(widget, event)", + "is_constructor": 1, + "extends": "photonui.Widget", + "params": [ + { + "name": "params", + "description": "An object that can contain any property of the widget (optional).", + "type": "Object" + } + ] + }, + "photonui.NumericField": { + "name": "photonui.NumericField", + "shortname": "NumericField", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui", + "file": "src/interactive/numericfield.js", + "line": 41, + "description": "Numeric field.", + "is_constructor": 1, + "extends": "photonui.Field" + }, + "photonui.Slider": { + "name": "photonui.Slider", + "shortname": "Slider", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui", + "file": "src/interactive/slider.js", + "line": 42, + "description": "Slider", + "is_constructor": 1, + "extends": "photonui.NumericField", + "params": [ + { + "name": "params", + "description": "An object that can contain any property of the widget (optional).", + "type": "Object" + } + ] + }, + "photonui.Switch": { + "name": "photonui.Switch", + "shortname": "Switch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui", + "file": "src/interactive/switch.js", + "line": 41, + "description": "Switch.", + "is_constructor": 1, + "extends": "photonui.CheckBox" + }, + "photonui.TextAreaField": { + "name": "photonui.TextAreaField", + "shortname": "TextAreaField", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui", + "file": "src/interactive/textareafield.js", + "line": 41, + "description": "Multiline text field.", + "is_constructor": 1, + "extends": "photonui.Field" + }, + "photonui.TextField": { + "name": "photonui.TextField", + "shortname": "TextField", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui", + "file": "src/interactive/textfield.js", + "line": 41, + "description": "Text, Password, Email, Search, Tel, URL Fields.", + "is_constructor": 1, + "extends": "photonui.Field" + }, + "photonui.ToggleButton": { + "name": "photonui.ToggleButton", + "shortname": "ToggleButton", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui", + "file": "src/interactive/togglebutton.js", + "line": 42, + "description": "Toogle Button.", + "is_constructor": 1, + "extends": "photonui.CheckBox", + "uses": [ + "photonui.Button" + ] + }, + "photonui.BoxLayout": { + "name": "photonui.BoxLayout", + "shortname": "BoxLayout", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui", + "file": "src/layout/boxlayout.js", + "line": 42, + "description": "Vertical and horizontal box layout.\n\nLayout Options:\n\n {\n align: ,\n\n order: \n\n minWidth: ,\n maxWidth: ,\n width: ,\n\n minHeight: ,\n maxHeight: ,\n height: \n }", + "is_constructor": 1, + "extends": "photonui.Layout" + }, + "photonui.FluidLayout": { + "name": "photonui.FluidLayout", + "shortname": "FluidLayout", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui", + "file": "src/layout/fluidlayout.js", + "line": 42, + "description": "Fluid Layout.\n\nLayout Options:\n\n {\n align: ,\n\n order: \n\n minWidth: ,\n maxWidth: ,\n width: ,\n\n minHeight: ,\n maxHeight: ,\n height: \n }", + "is_constructor": 1, + "extends": "photonui.Layout" + }, + "photonui.GridLayout": { + "name": "photonui.GridLayout", + "shortname": "GridLayout", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui", + "file": "src/layout/gridlayout.js", + "line": 44, + "description": "Grid layout.\n\nLayout Options:\n\n {\n x: ,\n y: ,\n cols: ,\n rows: ,\n\n horizontalAlign: ,\n verticalAlign: ,\n\n minWidth: ,\n maxWidth: ,\n width: ,\n\n minHeight: ,\n maxHeight: ,\n height: ,\n }", + "is_constructor": 1, + "extends": "photonui.Layout" + }, + "photonui.Layout": { + "name": "photonui.Layout", + "shortname": "Layout", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "photonui.PopupMenu" + ], + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui", + "file": "src/layout/layout.js", + "line": 42, + "description": "Base class for layout.", + "is_constructor": 1, + "extends": "photonui.Container" + }, + "photonui.Menu": { + "name": "photonui.Menu", + "shortname": "Menu", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "photonui.PopupMenu" + ], + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui", + "file": "src/layout/menu.js", + "line": 42, + "description": "Menu.", + "is_constructor": 1, + "extends": "photonui.Layout" + }, + "photonui.TabLayout": { + "name": "photonui.TabLayout", + "shortname": "TabLayout", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui", + "file": "src/layout/tablayout.js", + "line": 44, + "description": "Tab Layout", + "is_constructor": 1, + "extends": "photonui.Layout", + "params": [ + { + "name": "params", + "description": "An object that can contain any property of the widget (optional).", + "type": "Object" + } + ] + }, + "photonui.AccelManager": { + "name": "photonui.AccelManager", + "shortname": "AccelManager", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui", + "file": "src/nonvisual/accelmanager.js", + "line": 42, + "description": "Manage keyboard accelerators.", + "is_constructor": 1, + "extends": "photonui.Base" + }, + "photonui.Color": { + "name": "photonui.Color", + "shortname": "Color", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui", + "file": "src/nonvisual/color.js", + "line": 194, + "description": "Handle colors.\n\nwEvents:\n\n * value-changed:\n - description: the selected color changed.\n - callback: function(photonui.Color)", + "is_constructor": 1, + "extends": "photonui.Base", + "params": [ + { + "name": "", + "description": "An object that can contain any property of the Color class (optional).", + "type": "Object", + "multiple": true + } + ] + }, + "photonui.FileManager": { + "name": "photonui.FileManager", + "shortname": "FileManager", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui", + "file": "src/nonvisual/filemanager.js", + "line": 41, + "description": "Open files from the standard \"FileOpen\" dialog and drag & drop.\n\nwEvents:\n\n * file-open:\n - description: File selected or dropped.\n - callback: function(widget, fileBlob, x, y) //(x=y=undefined if using a dialog)", + "is_constructor": 1, + "extends": "photonui.Base", + "params": [ + { + "name": "params", + "description": "An object that can contain any property of the widget (optional).", + "type": "Object" + } + ] + }, + "photonui.KeyboardManager": { + "name": "photonui.KeyboardManager", + "shortname": "KeyboardManager", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui", + "file": "src/nonvisual/keyboardmanager.js", + "line": 43, + "description": "Manage document-wide keyboard events.\n\nwEvents:\n\n * key-down:\n - description: When a key is pushed (event launched just once until key is released).\n - callback: function(manager, kstate)\n\n * key-up:\n - description: When a key is released.\n - callback: function(manager, kstate)\n\n * key-hold:\n - description: When the last key pressed is held down.\n - callback: function(manager, kstate)\n\n\nkstate:\n\n A snapshot of the keyboard state when the event occured.\n\n {\n event: , // The original js event\n action: , // The event name (key-down/up, key-hold)\n keys: , // The object of active keys\n key: , // User-friendly key name\n }", + "is_constructor": 1, + "extends": "photonui.Base", + "params": [ + { + "name": "element", + "description": "Any PhotonUI Widget (optional).", + "type": "photonui.Widget" + }, + { + "name": "element", + "description": "Any HTML element (optional).", + "type": "HTMLElement" + }, + { + "name": "params", + "description": "An object that can contain any property of the widget (optional).", + "type": "Object" + } + ] + }, + "photonui.MouseManager": { + "name": "photonui.MouseManager", + "shortname": "MouseManager", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui", + "file": "src/nonvisual/mousemanager.js", + "line": 43, + "description": "Manage advanced mouse events on Widgets or HTMLElements.\n\nwEvents:\n\n * mouse-event:\n - description: Called for *ALL* mouse events.\n - callback: function(manager, mstate)\n\n * mouse-down:\n - description: Mouse button pressed.\n - callback: function(manager, mstate)\n\n * mouse-up:\n - description: Mouse button released.\n - callback: function(manager, mstate)\n\n * click:\n - description: Click...\n - callback: function(manager, mstate)\n\n * double-click:\n - description: Double click...\n - callback: function(manager, mstate)\n\n * drag-start:\n - description: Start dragging.\n - callback: function(manager, mstate)\n\n * dragging:\n - description: dragging.\n - callback: function(manager, mstate)\n\n * drag-end:\n - description: Stop dragging.\n - callback: function(manager, mstate)\n\n * mouse-move:\n - description: Mouse move on the element.\n - callback: function(manager, mstate)\n\n * scroll-up:\n - description: Scroll up.\n - callback: function(manager, mstate)\n\n * scroll-down:\n - description: Scroll down.\n - callback: function(manager, mstate)\n\n\nmstate:\n\n A snapshot of the mouse state ath the moment when the event occured.\n\n {\n event: , // The original js event\n action: , // The event name (mouse-down/up/move, click, double-click,\n // drag-start/end, dragging, scroll-up/down)\n pageX: , // X position, relative to page top-left corner.\n pageY: , // Y position, relative to page top-left corner.\n x: , // X position, relative to the HTML element.\n y: , // Y position, relative to the HTML element.\n deltaX: , // Delta X (current_x - previous_x)\n deltaY: , // Delta Y (current_y - previous_y)\n btnLeft: , // Current state of the mouse left button.\n btnMiddle: , // Current state of the mouse middle button.\n btnRight: , // Current state of the mouse right button.\n button: // The button that triggered the last event (none, \"left\", \"middle\", \"right\").\n }", + "is_constructor": 1, + "extends": "photonui.Base", + "params": [ + { + "name": "element", + "description": "Any PhotonUI Widget (optional).", + "type": "photonui.Widget" + }, + { + "name": "element", + "description": "Any HTML element (optional).", + "type": "HTMLElement" + }, + { + "name": "params", + "description": "additional params (optional).", + "type": "Object" + } + ] + }, + "photonui.SpriteSheet": { + "name": "photonui.SpriteSheet", + "shortname": "SpriteSheet", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui", + "file": "src/nonvisual/spritesheet.js", + "line": 43, + "description": "Sprite sheet (to use with SpriteIcon).", + "is_constructor": 1, + "extends": "photonui.Base" + }, + "photonui.Translation": { + "name": "photonui.Translation", + "shortname": "Translation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui", + "file": "src/nonvisual/translation.js", + "line": 42, + "description": "A wrapper around Stone.js to fire locale events to widgets.\n\nDocumentation: https://github.com/flozz/stone.js/blob/master/README.md\n\nNOTE: When you instantiate the translation widget, you can pass to it\nthe `noGlobal` option to avoid the creation of the global `window._` function.\n\nwEvents:\n\n * locale-changed:\n - description: The locale changed.\n - callback: function(widget, locale)", + "is_constructor": 1, + "extends": "photonui.Base", + "params": [ + { + "name": "params", + "description": "An object that can contain any property of the widget (optional).", + "type": "Object" + } + ] + }, + "photonui.BaseIcon": { + "name": "photonui.BaseIcon", + "shortname": "BaseIcon", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui", + "file": "src/visual/baseicon.js", + "line": 41, + "description": "Base class for icons.", + "is_constructor": 1, + "extends": "photonui.Widget" + }, + "photonui.Canvas": { + "name": "photonui.Canvas", + "shortname": "Canvas", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui", + "file": "src/visual/canvas.js", + "line": 41, + "description": "Canvas.", + "is_constructor": 1, + "extends": "photonui.Widget", + "params": [ + { + "name": "params", + "description": "An object that can contain any property of the widget (optional).", + "type": "Object" + } + ] + }, + "photonui.FAIcon": { + "name": "photonui.FAIcon", + "shortname": "FAIcon", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui", + "file": "src/visual/faicon.js", + "line": 41, + "description": "Font Awesome Icon.\n\nSpecial contructor params:\n\n new photonui.FAIcon( {optional params...} )\n new photonui.FAIcon( \"iconName\", {optional params...} )", + "is_constructor": 1, + "extends": "photonui.BaseIcon" + }, + "photonui.Image": { + "name": "photonui.Image", + "shortname": "Image", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui", + "file": "src/visual/image.js", + "line": 41, + "description": "Image.", + "is_constructor": 1, + "extends": "photonui.Widget", + "params": [ + { + "name": "params", + "description": "An object that can contain any property of the widget (optional).", + "type": "Object" + } + ] + }, + "photonui.Label": { + "name": "photonui.Label", + "shortname": "Label", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui", + "file": "src/visual/label.js", + "line": 42, + "description": "Label.", + "is_constructor": 1, + "extends": "photonui.Widget" + }, + "photonui.ProgressBar": { + "name": "photonui.ProgressBar", + "shortname": "ProgressBar", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui", + "file": "src/visual/progressbar.js", + "line": 41, + "description": "ProgressBar.", + "is_constructor": 1, + "extends": "photonui.Widget" + }, + "photonui.Separator": { + "name": "photonui.Separator", + "shortname": "Separator", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui", + "file": "src/visual/separator.js", + "line": 41, + "description": "Separator.", + "is_constructor": 1, + "extends": "photonui.Widget" + }, + "photonui.SpriteIcon": { + "name": "photonui.SpriteIcon", + "shortname": "SpriteIcon", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui", + "file": "src/visual/spriteicon.js", + "line": 42, + "description": "Sprite sheet based icons.\n\nSpecial contructor params:\n\n new photonui.SpriteIcon( {optional params...} )\n new photonui.SpriteIcon( \"spriteSheetName/iconName\", {optional params...} )", + "is_constructor": 1, + "extends": "photonui.BaseIcon" + }, + "photonui.Template": { + "name": "photonui.Template", + "shortname": "Template", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui", + "file": "src/visual/template.js", + "line": 43, + "description": "Widget that displays template-generated HTML (uses lodash.template).", + "is_constructor": 1, + "extends": "photonui.Widget", + "params": [ + { + "name": "params", + "description": "An object that can contain any property of the widget (optional).", + "type": "Object" + } + ] + }, + "photonui.Text": { + "name": "photonui.Text", + "shortname": "Text", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui", + "file": "src/visual/text.js", + "line": 43, + "description": "Text / Raw HTML widget", + "is_constructor": 1, + "extends": "photonui.Widget" + }, + "photonui.Base": { + "name": "photonui.Base", + "shortname": "Base", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "namespace": "photonui", + "file": "src/base.js", + "line": 43, + "description": "Base class for all PhotonUI Classes.\n\nwEvents:\n\n * destroy:\n - description: called before the widget was destroyed.\n - callback: function (widget)", + "is_constructor": 1, + "params": [ + { + "name": "params", + "description": "An object that can contain any property that will be set to the class (optional).", + "type": "Object" + } + ] + }, + "photonui.Helpers": { + "name": "photonui.Helpers", + "shortname": "Helpers", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "submodule": "Helpers", + "namespace": "photonui", + "file": "src/helpers.js", + "line": 42, + "description": "Helpers.", + "is_constructor": 1 + }, + "photonui.Widget": { + "name": "photonui.Widget", + "shortname": "Widget", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "PhotonUI", + "namespace": "photonui", + "file": "src/widget.js", + "line": 46, + "description": "Base class for all PhotonUI widgets.\n\nwEvents:\n\n * show:\n - description: called when the widget is displayed (a change in the parent's\n visibility can also trigger this event).\n - callback: function(widget)\n\n * hide:\n - description: called when the widget is hidden (a change in the parent's visibility\n can also trigger this event).\n - callback: function(widget)", + "is_constructor": 1, + "extends": "photonui.Base", + "params": [ + { + "name": "params", + "description": "An object that can contain any property of the widget (optional).", + "type": "Object" + } + ] + } + }, + "elements": {}, + "classitems": [ + { + "file": "src/composite/colorbutton.js", + "line": 77, + "description": "The value (color in rgb hexadecimal format (e.g. \"#ff0000\")).", + "itemtype": "property", + "name": "value", + "type": "String", + "class": "photonui.ColorButton", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/colorbutton.js", + "line": 91, + "description": "The color.", + "itemtype": "property", + "name": "color", + "type": "photonui.Color", + "class": "photonui.ColorButton", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/colorbutton.js", + "line": 119, + "description": "Display only the color picker dialog instead of showing the palette first.", + "itemtype": "property", + "name": "dialogOnly", + "type": "Boolean", + "default": "false", + "class": "photonui.ColorButton", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/colorbutton.js", + "line": 149, + "description": "Update the button content", + "itemtype": "method", + "name": "_update", + "access": "private", + "tagname": "", + "class": "photonui.ColorButton", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/colorbutton.js", + "line": 159, + "description": "Build the widget HTML.", + "itemtype": "method", + "name": "_buildHtml", + "access": "private", + "tagname": "", + "class": "photonui.ColorButton", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/colorbutton.js", + "line": 176, + "description": "Make the UI.", + "itemtype": "method", + "name": "_buildUi", + "access": "private", + "tagname": "", + "class": "photonui.ColorButton", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/colorbutton.js", + "line": 212, + "description": "Called when the button is clicked.", + "itemtype": "method", + "name": "__onButtonClicked", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "" + } + ], + "class": "photonui.ColorButton", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/colorbutton.js", + "line": 229, + "description": "Called when the palette color change.", + "itemtype": "method", + "name": "__onPaletteValueChanged", + "access": "private", + "tagname": "", + "params": [ + { + "name": "widget", + "description": "", + "type": "photonui.Widget" + }, + { + "name": "color", + "description": "", + "type": "String" + } + ], + "class": "photonui.ColorButton", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/colorbutton.js", + "line": 241, + "itemtype": "method", + "name": "__onColorChanged", + "access": "private", + "tagname": "", + "class": "photonui.ColorButton", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/colorbutton.js", + "line": 250, + "itemtype": "method", + "name": "__onCustomButtonClicked", + "access": "private", + "tagname": "", + "class": "photonui.ColorButton", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/colorpickerdialog.js", + "line": 92, + "description": "The color.", + "itemtype": "property", + "name": "color", + "type": "photonui.Color", + "class": "photonui.ColorPickerDialog", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/colorpickerdialog.js", + "line": 117, + "description": "The color as hex string (shorthand to ColorPickerDialog.color.rgbHexString).", + "itemtype": "property", + "name": "value", + "type": "String", + "class": "photonui.ColorPickerDialog", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/colorpickerdialog.js", + "line": 151, + "description": "Make the UI.", + "itemtype": "method", + "name": "_buildUi", + "access": "private", + "tagname": "", + "class": "photonui.ColorPickerDialog", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/colorpickerdialog.js", + "line": 349, + "description": "Update the fields of the UI.", + "itemtype": "method", + "name": "_updateUi", + "access": "private", + "tagname": "", + "class": "photonui.ColorPickerDialog", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/colorpickerdialog.js", + "line": 369, + "itemtype": "method", + "name": "__onCancel", + "access": "private", + "tagname": "", + "class": "photonui.ColorPickerDialog", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/colorpickerdialog.js", + "line": 382, + "itemtype": "method", + "name": "__onValidate", + "access": "private", + "tagname": "", + "class": "photonui.ColorPickerDialog", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/colorpickerdialog.js", + "line": 396, + "itemtype": "method", + "name": "__onColorChanged", + "access": "private", + "tagname": "", + "class": "photonui.ColorPickerDialog", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/fontselect.js", + "line": 71, + "description": "The font list", + "itemtype": "property", + "name": "fonts", + "type": "Array", + "default": "[\"sans-serif\", \"serif\", \"monospace\"]", + "class": "photonui.FontSelect", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/fontselect.js", + "line": 91, + "description": "The placeholder displayed if nothing is selected.", + "itemtype": "property", + "name": "placeholder", + "type": "String", + "default": "\"Select a font...\"", + "class": "photonui.FontSelect", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/fontselect.js", + "line": 106, + "description": "Add a widget to the layout.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "fontName", + "description": "", + "type": "String" + } + ], + "class": "photonui.FontSelect", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/fontselect.js", + "line": 121, + "description": "Build the widget HTML.", + "itemtype": "method", + "name": "_buildHtml", + "access": "private", + "tagname": "", + "class": "photonui.FontSelect", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/popupmenu.js", + "line": 86, + "description": "Build the widget HTML.", + "itemtype": "method", + "name": "_buildHtml", + "access": "private", + "tagname": "", + "class": "photonui.PopupMenu", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/popupmenu.js", + "line": 105, + "description": "Called when the locale is changed.", + "itemtype": "method", + "name": "__onLocaleChanged", + "access": "private", + "tagname": "", + "class": "photonui.PopupMenu", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/select.js", + "line": 86, + "description": "The field value.", + "itemtype": "property", + "name": "value", + "type": "String (maybe)", + "default": "\"\"", + "class": "photonui.Select", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/select.js", + "line": 125, + "description": "The placeholder displayed if nothing is selected.", + "itemtype": "property", + "name": "placeholder", + "type": "String", + "default": "\"Select...\"", + "class": "photonui.Select", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/select.js", + "line": 142, + "description": "Layout children widgets.", + "itemtype": "property", + "name": "children", + "type": "Array", + "default": "[]", + "class": "photonui.Select", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/select.js", + "line": 155, + "description": "Layout children widgets name.", + "itemtype": "property", + "name": "childrenNames", + "type": "Array", + "default": "[]", + "class": "photonui.Select", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/select.js", + "line": 168, + "description": "Width of the container node.", + "itemtype": "property", + "name": "popupWidth", + "type": "Number", + "default": ": null (auto)", + "class": "photonui.Select", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/select.js", + "line": 178, + "description": "Height of the popup container node.", + "itemtype": "property", + "name": "popupHeight", + "type": "Number", + "default": ": null (auto)", + "class": "photonui.Select", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/select.js", + "line": 188, + "description": "Maximum width of the popup container node.", + "itemtype": "property", + "name": "popupMaxWidth", + "type": "Number", + "default": ": null (no maximum)", + "class": "photonui.Select", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/select.js", + "line": 198, + "description": "Minimum width of the popup container node.", + "itemtype": "property", + "name": "popupMinWidth", + "type": "Number", + "default": ": null (no minimum)", + "class": "photonui.Select", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/select.js", + "line": 209, + "description": "Maximum height of the popup container node.", + "itemtype": "property", + "name": "popupMaxHeight", + "type": "Number", + "default": ": 300", + "class": "photonui.Select", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/select.js", + "line": 219, + "description": "Minimum height of the popup container node.", + "itemtype": "property", + "name": "popupMinHeight", + "type": "Number", + "default": ": null (no minimum)", + "class": "photonui.Select", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/select.js", + "line": 229, + "description": "Popup width (outer HTML element).", + "itemtype": "property", + "name": "popupOffsetWidth", + "type": "Number", + "readonly": "", + "class": "photonui.Select", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/select.js", + "line": 238, + "description": "Popup height (outer HTML element).", + "itemtype": "property", + "name": "popupOffsetHeight", + "type": "Number", + "readonly": "", + "class": "photonui.Select", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/select.js", + "line": 247, + "description": "Window container node padding.", + "itemtype": "property", + "name": "popupPadding", + "type": "Number", + "default": "0", + "class": "photonui.Select", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/select.js", + "line": 257, + "description": "Define if icon on menu items are visible.", + "itemtype": "property", + "name": "iconVisible", + "type": "Boolean", + "default": ": false", + "class": "photonui.Select", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/select.js", + "line": 284, + "description": "Html outer element of the widget (if any).", + "itemtype": "property", + "name": "html", + "type": "HTMLElement", + "default": "null", + "readonly": "", + "class": "photonui.Select", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/select.js", + "line": 298, + "description": "The popupMenu.", + "itemtype": "property", + "name": "__popupMenu", + "access": "private", + "tagname": "", + "type": "photonui.PopupMenu", + "class": "photonui.Select", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/select.js", + "line": 313, + "description": "Add a widget to the layout.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "widget", + "description": "The widget to add.", + "type": "photonui.Widget" + }, + { + "name": "layoutOption", + "description": "Specific option for the layout (optional).", + "type": "Object" + } + ], + "class": "photonui.Select", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/select.js", + "line": 325, + "description": "Destroy the widget.", + "itemtype": "method", + "name": "destroy", + "class": "photonui.Select", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/select.js", + "line": 342, + "description": "Build the widget HTML.", + "itemtype": "method", + "name": "_buildHtml", + "access": "private", + "tagname": "", + "class": "photonui.Select", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/select.js", + "line": 354, + "description": "Update the popup items binding.", + "itemtype": "method", + "name": "_updateItemsBinding", + "access": "private", + "tagname": "", + "class": "photonui.Select", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/select.js", + "line": 375, + "itemtype": "method", + "name": "__onClick", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "" + } + ], + "class": "photonui.Select", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/select.js", + "line": 391, + "itemtype": "method", + "name": "__onMouseDown", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "" + } + ], + "class": "photonui.Select", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/select.js", + "line": 402, + "itemtype": "method", + "name": "__onItemClicked", + "access": "private", + "tagname": "", + "params": [ + { + "name": "widget", + "description": "", + "type": "photonui.MenuItem" + } + ], + "class": "photonui.Select", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/composite/select.js", + "line": 412, + "itemtype": "method", + "name": "__onLocaleChanged", + "access": "private", + "tagname": "", + "class": "photonui.Select", + "module": "PhotonUI", + "submodule": "Composite", + "namespace": "photonui" + }, + { + "file": "src/container/basewindow.js", + "line": 78, + "description": "Window position.\n\n {x: Number, y: Number}", + "itemtype": "property", + "name": "position", + "type": "Object", + "default": "{x: 0, y: 0}", + "class": "photonui.BaseWindow", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/basewindow.js", + "line": 114, + "description": "The X position of the Window.", + "itemtype": "property", + "name": "x", + "type": "Number", + "default": "0", + "class": "photonui.BaseWindow", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/basewindow.js", + "line": 131, + "description": "The Y position of the Window.", + "itemtype": "property", + "name": "y", + "type": "Number", + "default": "0", + "class": "photonui.BaseWindow", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/basewindow.js", + "line": 148, + "description": "Width of the container node.", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": ": null (auto)", + "class": "photonui.BaseWindow", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/basewindow.js", + "line": 174, + "description": "Height of the container node.", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": ": null (auto)", + "class": "photonui.BaseWindow", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/basewindow.js", + "line": 200, + "description": "Minimum width of the container node.", + "itemtype": "property", + "name": "minWidth", + "type": "Number", + "default": ": null (no minimum)", + "class": "photonui.BaseWindow", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/basewindow.js", + "line": 223, + "description": "Minimum height of the container node.", + "itemtype": "property", + "name": "minHeight", + "type": "Number", + "default": ": null (no minimum)", + "class": "photonui.BaseWindow", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/basewindow.js", + "line": 246, + "description": "Maximum width of the container node.", + "itemtype": "property", + "name": "maxWidth", + "type": "Number", + "default": ": null (no maximum)", + "class": "photonui.BaseWindow", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/basewindow.js", + "line": 269, + "description": "Maximum height of the container node.", + "itemtype": "property", + "name": "maxHeight", + "type": "Number", + "default": ": null (no maximum)", + "class": "photonui.BaseWindow", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/basewindow.js", + "line": 292, + "description": "Window container node padding.", + "itemtype": "property", + "name": "padding", + "type": "Number", + "default": "0", + "class": "photonui.BaseWindow", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/basewindow.js", + "line": 311, + "description": "Html outer element of the widget (if any).", + "itemtype": "property", + "name": "html", + "type": "HTMLElement", + "default": "null", + "readonly": "", + "class": "photonui.BaseWindow", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/basewindow.js", + "line": 323, + "description": "HTML Element that contain the child widget HTML.", + "itemtype": "property", + "name": "containerNode", + "type": "HTMLElement", + "readonly": "", + "class": "photonui.BaseWindow", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/basewindow.js", + "line": 340, + "description": "Center the window.", + "itemtype": "method", + "name": "center", + "class": "photonui.BaseWindow", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/basewindow.js", + "line": 358, + "description": "Build the widget HTML.", + "itemtype": "method", + "name": "_buildHtml", + "access": "private", + "tagname": "", + "class": "photonui.BaseWindow", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/container.js", + "line": 66, + "description": "Horizontaly expand the container's child widget.", + "itemtype": "property", + "name": "horizontalChildExpansion", + "type": "Boolean", + "default": "true", + "class": "photonui.Container", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/container.js", + "line": 92, + "description": "Verticaly expand the container's child widget.", + "itemtype": "property", + "name": "verticalChildExpansion", + "type": "Boolean", + "default": "false", + "class": "photonui.Container", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/container.js", + "line": 118, + "description": "The child widget name.", + "itemtype": "property", + "name": "childName", + "type": "String", + "default": "null (no child)", + "class": "photonui.Container", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/container.js", + "line": 146, + "description": "The child widget.", + "itemtype": "property", + "name": "child", + "type": "photonui.Widget", + "default": "null (no child)", + "class": "photonui.Container", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/container.js", + "line": 165, + "description": "HTML Element that contain the child widget HTML.", + "itemtype": "property", + "name": "containerNode", + "type": "HTMLElement", + "readonly": "", + "class": "photonui.Container", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/container.js", + "line": 182, + "description": "Remove the given child.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "widget", + "description": "The widget to remove/", + "type": "photonui.Widget" + } + ], + "class": "photonui.Container", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/container.js", + "line": 194, + "description": "Destroy the widget.", + "itemtype": "method", + "name": "destroy", + "class": "photonui.Container", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/container.js", + "line": 208, + "description": "Called when the visibility changes.", + "itemtype": "method", + "name": "_visibilityChanged", + "access": "private", + "tagname": "", + "params": [ + { + "name": "visibility", + "description": "Current visibility state (otptional, defaut=this.visible)", + "type": "Boolean" + } + ], + "class": "photonui.Container", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/dialog.js", + "line": 72, + "description": "Dialog button widgets name.", + "itemtype": "property", + "name": "buttonsNames", + "type": "Array", + "default": "[]", + "class": "photonui.Dialog", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/dialog.js", + "line": 109, + "description": "Dialog buttons widgets.", + "itemtype": "property", + "name": "buttons", + "type": "Array", + "default": "[]", + "class": "photonui.Dialog", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/dialog.js", + "line": 144, + "description": "Add a button to the dialog.", + "itemtype": "method", + "name": "addButton", + "params": [ + { + "name": "widget", + "description": "The button to add.", + "type": "photonui.Widget" + } + ], + "class": "photonui.Dialog", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/dialog.js", + "line": 162, + "description": "Remove a button from the dialog.", + "itemtype": "method", + "name": "removeButton", + "params": [ + { + "name": "widget", + "description": "The button to remove.", + "type": "photonui.Widget" + } + ], + "class": "photonui.Dialog", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/dialog.js", + "line": 183, + "description": "Destroy the widget.", + "itemtype": "method", + "name": "destroy", + "class": "photonui.Dialog", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/dialog.js", + "line": 200, + "description": "Update dialog buttons.", + "itemtype": "method", + "name": "_updateButtons", + "access": "private", + "tagname": "", + "class": "photonui.Dialog", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/dialog.js", + "line": 214, + "description": "Build the widget HTML.", + "itemtype": "method", + "name": "_buildHtml", + "access": "private", + "tagname": "", + "class": "photonui.Dialog", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/dialog.js", + "line": 229, + "description": "Called when the visibility changes.", + "itemtype": "method", + "name": "_visibilityChanged", + "access": "private", + "tagname": "", + "params": [ + { + "name": "visibility", + "description": "Current visibility state (otptional, defaut=this.visible)", + "type": "Boolean" + } + ], + "class": "photonui.Dialog", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/expander.js", + "line": 76, + "description": "The title.", + "itemtype": "property", + "name": "title", + "type": "String", + "default": "\"Expander\"", + "class": "photonui.Expander", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/expander.js", + "line": 96, + "description": "Whether the expander is folded.", + "itemtype": "property", + "name": "folded", + "type": "Boolean", + "default": "false", + "class": "photonui.Expander", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/expander.js", + "line": 122, + "description": "Container node padding.", + "itemtype": "property", + "name": "padding", + "type": "Number", + "default": "0", + "class": "photonui.Expander", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/expander.js", + "line": 141, + "description": "Html outer element of the widget (if any).", + "itemtype": "property", + "name": "html", + "type": "HTMLElement", + "default": "null", + "readonly": "", + "class": "photonui.Expander", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/expander.js", + "line": 153, + "description": "HTML Element that contain the child widget HTML.", + "itemtype": "property", + "name": "containerNode", + "type": "HTMLElement", + "readonly": "", + "class": "photonui.Expander", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/expander.js", + "line": 170, + "description": "Toggle current folded state and sends and event.", + "itemtype": "method", + "name": "toggleFolded", + "params": [ + { + "name": "event", + "description": "", + "type": "Event" + } + ], + "class": "photonui.Expander", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/expander.js", + "line": 188, + "description": "Build the widget HTML.", + "itemtype": "method", + "name": "_buildHtml", + "access": "private", + "tagname": "", + "class": "photonui.Expander", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/expander.js", + "line": 208, + "itemtype": "method", + "name": "__onTitleClicked", + "access": "private", + "tagname": "", + "class": "photonui.Expander", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/expander.js", + "line": 216, + "itemtype": "method", + "name": "__onTitleKeyPress", + "access": "private", + "tagname": "", + "class": "photonui.Expander", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/menuitem.js", + "line": 70, + "description": "An optional value for the item (can be used in select).", + "itemtype": "property", + "name": "value", + "type": "String (maybe)", + "default": "\"\"", + "class": "photonui.MenuItem", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/menuitem.js", + "line": 87, + "description": "The item text.", + "itemtype": "property", + "name": "text", + "type": "String", + "default": "\"Menu Item\"", + "class": "photonui.MenuItem", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/menuitem.js", + "line": 107, + "description": "Left icon widget name.", + "itemtype": "property", + "name": "iconName", + "type": "String", + "default": ": null", + "class": "photonui.MenuItem", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/menuitem.js", + "line": 128, + "description": "Left icon widget.", + "itemtype": "property", + "name": "icon", + "type": "photonui.BaseIcon", + "default": ": null", + "class": "photonui.MenuItem", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/menuitem.js", + "line": 148, + "description": "Determine if the item is active (highlighted).", + "itemtype": "property", + "name": "active", + "type": "Boolean", + "default": "false", + "class": "photonui.MenuItem", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/menuitem.js", + "line": 172, + "description": "Html outer element of the widget (if any).", + "itemtype": "property", + "name": "html", + "type": "HTMLElement", + "default": "null", + "readonly": "", + "class": "photonui.MenuItem", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/menuitem.js", + "line": 184, + "description": "HTML Element that contain the child widget HTML.", + "itemtype": "property", + "name": "containerNode", + "type": "HTMLElement", + "readonly": "", + "class": "photonui.MenuItem", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/menuitem.js", + "line": 201, + "description": "Destroy the widget.", + "itemtype": "method", + "name": "destroy", + "class": "photonui.MenuItem", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/menuitem.js", + "line": 216, + "description": "Build the widget HTML.", + "itemtype": "method", + "name": "_buildHtml", + "access": "private", + "tagname": "", + "class": "photonui.MenuItem", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/popupwindow.js", + "line": 60, + "description": "HTML Element that contain the child widget HTML.", + "itemtype": "property", + "name": "containerNode", + "type": "HTMLElement", + "readonly": "", + "class": "photonui.PopupWindow", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/popupwindow.js", + "line": 77, + "description": "Pop the window at the given position.", + "itemtype": "method", + "name": "popupXY", + "params": [ + { + "name": "x", + "description": "", + "type": "Number" + }, + { + "name": "y", + "description": "", + "type": "Number" + } + ], + "class": "photonui.PopupWindow", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/popupwindow.js", + "line": 111, + "description": "Pop the window at the best position for the given widget.", + "itemtype": "method", + "name": "popupWidget", + "params": [ + { + "name": "widget", + "description": "", + "type": "photonui.Widget" + } + ], + "class": "photonui.PopupWindow", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/popupwindow.js", + "line": 156, + "description": "Build the widget HTML.", + "itemtype": "method", + "name": "_buildHtml", + "access": "private", + "tagname": "", + "class": "photonui.PopupWindow", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/submenuitem.js", + "line": 65, + "description": "The submenu widget name.", + "itemtype": "property", + "name": "menuName", + "type": "String", + "default": "null", + "class": "photonui.SubMenuItem", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/submenuitem.js", + "line": 107, + "description": "The submenu widget.", + "itemtype": "property", + "name": "menu", + "type": "photonui.Menu", + "default": "null", + "class": "photonui.SubMenuItem", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/submenuitem.js", + "line": 130, + "itemtype": "method", + "name": "__onToggleFold", + "access": "private", + "tagname": "", + "class": "photonui.SubMenuItem", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/submenuitem.js", + "line": 138, + "itemtype": "method", + "name": "__onItemClicked", + "access": "private", + "tagname": "", + "class": "photonui.SubMenuItem", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/tabitem.js", + "line": 77, + "description": "Tab title.", + "itemtype": "property", + "name": "title", + "type": "String", + "default": "\"Tab\"", + "class": "photonui.TabItem", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/tabitem.js", + "line": 97, + "description": "Definie if the tabItem title is displayed or hidden.", + "itemtype": "property", + "name": "titleVisible", + "type": "Boolean", + "default": "true", + "class": "photonui.TabItem", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/tabitem.js", + "line": 115, + "description": "Html outer element of the widget (if any).", + "itemtype": "property", + "name": "html", + "type": "HTMLElement", + "default": "null", + "readonly": "", + "class": "photonui.TabItem", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/tabitem.js", + "line": 127, + "description": "Tab Html element.", + "itemtype": "property", + "name": "tabHtml", + "type": "HTMLElement", + "default": "null", + "readonly": "", + "class": "photonui.TabItem", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/tabitem.js", + "line": 139, + "description": "HTML Element that contain the child widget HTML.", + "itemtype": "property", + "name": "containerNode", + "type": "HTMLElement", + "readonly": "", + "class": "photonui.TabItem", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/tabitem.js", + "line": 150, + "description": "Is the widget visible or hidden.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "default": "false", + "class": "photonui.TabItem", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/tabitem.js", + "line": 190, + "description": "Left icon widget name", + "itemtype": "property", + "name": "leftIconName", + "type": "String", + "default": "null", + "class": "photonui.TabItem", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/tabitem.js", + "line": 213, + "description": "Left icon widget", + "itemtype": "property", + "name": "leftIcon", + "type": "photonui.Icon", + "default": "null", + "class": "photonui.TabItem", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/tabitem.js", + "line": 232, + "description": "Define if the left icon is displayed or hidden.", + "itemtype": "property", + "name": "leftIconVisible", + "type": "Boolean", + "default": "true", + "class": "photonui.TabItem", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/tabitem.js", + "line": 250, + "description": "Right icon widget name", + "itemtype": "property", + "name": "rigthIconName", + "type": "String", + "default": "null", + "class": "photonui.TabItem", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/tabitem.js", + "line": 274, + "description": "Right icon widget", + "itemtype": "property", + "name": "rightIcon", + "type": "photonui.Icon", + "default": "null", + "class": "photonui.TabItem", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/tabitem.js", + "line": 293, + "description": "Define if the right icon is displayed or hidden.", + "itemtype": "property", + "name": "rightIconVisible", + "type": "Boolean", + "default": "true", + "class": "photonui.TabItem", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/tabitem.js", + "line": 317, + "description": "Destroy the widget.", + "itemtype": "method", + "name": "destroy", + "class": "photonui.TabItem", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/tabitem.js", + "line": 360, + "description": "Build the widget HTML.", + "itemtype": "method", + "name": "_buildHtml", + "access": "private", + "tagname": "", + "class": "photonui.TabItem", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/tabitem.js", + "line": 391, + "description": "Called when the tab is clicked.", + "itemtype": "method", + "name": "__onClick", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "" + } + ], + "class": "photonui.TabItem", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/viewport.js", + "line": 62, + "description": "Window container node padding.", + "itemtype": "property", + "name": "padding", + "type": "Number", + "default": "0", + "class": "photonui.Viewport", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/viewport.js", + "line": 81, + "description": "Visibility of the vertical scrollbar.\n\n * `true`: displayed,\n * `false`: hidden,\n * `null`: auto.", + "itemtype": "property", + "name": "verticalScrollbar", + "type": "Boolean", + "default": "null", + "class": "photonui.Viewport", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/viewport.js", + "line": 110, + "description": "Visibility of the horizontal scrollbar.\n\n * `true`: displayed,\n * `false`: hidden,\n * `null`: auto.", + "itemtype": "property", + "name": "horizontalScrollbar", + "type": "Boolean", + "default": "null", + "class": "photonui.Viewport", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/viewport.js", + "line": 139, + "description": "Minimum width.\n\n * Number: the size in px\n * Infinity: 100% of the parent width\n * null: no minimum width", + "itemtype": "property", + "name": "minWidth", + "type": "Number", + "default": "null", + "class": "photonui.Viewport", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/viewport.js", + "line": 162, + "description": "Maximum width.\n\n * Number: the size in px\n * Infinity: 100% of the parent width\n * null: no maximum width", + "itemtype": "property", + "name": "maxWidth", + "type": "Number", + "default": "null", + "class": "photonui.Viewport", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/viewport.js", + "line": 185, + "description": "Width.\n\n * Number: the size in px\n * Infinity: 100% of the parent width\n * null: auto", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "Infinity", + "class": "photonui.Viewport", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/viewport.js", + "line": 208, + "description": "Minimum height.\n\n * Number: the size in px\n * Infinity: 100% of the parent height\n * null: no minimum height", + "itemtype": "property", + "name": "minHeight", + "type": "Number", + "default": "null", + "class": "photonui.Viewport", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/viewport.js", + "line": 231, + "description": "Maximum height.\n\n * Number: the size in px\n * Infinity: 100% of the parent height\n * null: no maximum height", + "itemtype": "property", + "name": "maxHeight", + "type": "Number", + "default": "null", + "class": "photonui.Viewport", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/viewport.js", + "line": 254, + "description": "Height.\n\n * Number: the size in px\n * Infinity: 100% of the parent height\n * null: auto", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "Infinity", + "class": "photonui.Viewport", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/viewport.js", + "line": 277, + "description": "Html outer element of the widget (if any).", + "itemtype": "property", + "name": "html", + "type": "HTMLElement", + "default": "null", + "readonly": "", + "class": "photonui.Viewport", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/viewport.js", + "line": 290, + "description": "HTML Element that contain the child widget HTML.", + "itemtype": "property", + "name": "containerNode", + "type": "HTMLElement", + "readonly": "", + "class": "photonui.Viewport", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/viewport.js", + "line": 307, + "description": "Build the widget HTML.", + "itemtype": "method", + "name": "_buildHtml", + "access": "private", + "tagname": "", + "class": "photonui.Viewport", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/viewport.js", + "line": 318, + "description": "Called when the visibility changes.", + "itemtype": "method", + "name": "_visibilityChanged", + "access": "private", + "tagname": "", + "params": [ + { + "name": "visibility", + "description": "Current visibility state (otptional, defaut=this.visible)", + "type": "Boolean" + } + ], + "class": "photonui.Viewport", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/viewport.js", + "line": 333, + "description": "HACK: set the right height.", + "itemtype": "method", + "name": "_sizingHack", + "access": "private", + "tagname": "", + "class": "photonui.Viewport", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/viewport.js", + "line": 379, + "description": "Called when the locale is changed.", + "itemtype": "method", + "name": "__onLocaleChanged", + "access": "private", + "tagname": "", + "class": "photonui.Viewport", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/window.js", + "line": 85, + "description": "The window title.", + "itemtype": "property", + "name": "title", + "type": "String", + "default": "\"Window\"", + "class": "photonui.Window", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/window.js", + "line": 105, + "description": "Determine if the window can be moved (drag & drop) by the user.", + "itemtype": "property", + "name": "movable", + "type": "Boolean", + "default": "true", + "class": "photonui.Window", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/window.js", + "line": 122, + "description": "Fullscreen Window", + "itemtype": "property", + "name": "fullscreen", + "type": "Boolean", + "default": "false", + "class": "photonui.Window", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/window.js", + "line": 144, + "description": "Determine if the close button in the title bar is displayed or not.", + "itemtype": "property", + "name": "closeButtonVisible", + "type": "Boolean\ndefault: true", + "class": "photonui.Window", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/window.js", + "line": 170, + "description": "Modal window?", + "itemtype": "property", + "name": "modal", + "type": "Boolean", + "default": "false", + "class": "photonui.Window", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/window.js", + "line": 197, + "description": "HTML Element that contain the child widget HTML.", + "itemtype": "property", + "name": "containerNode", + "type": "HTMLElement", + "readonly": "", + "class": "photonui.Window", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/window.js", + "line": 229, + "description": "Bring the window to front.", + "itemtype": "method", + "name": "moveToFront", + "class": "photonui.Window", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/window.js", + "line": 243, + "description": "Bring the window to the back.", + "itemtype": "method", + "name": "moveToBack", + "class": "photonui.Window", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/window.js", + "line": 257, + "description": "Destroy the widget.", + "itemtype": "method", + "name": "destroy", + "class": "photonui.Window", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/window.js", + "line": 273, + "description": "Build the widget HTML.", + "itemtype": "method", + "name": "_buildHtml", + "access": "private", + "tagname": "", + "class": "photonui.Window", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/window.js", + "line": 303, + "description": "Update all the windows.", + "itemtype": "method", + "name": "_updateWindowList", + "access": "private", + "tagname": "", + "class": "photonui.Window", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/window.js", + "line": 328, + "description": "Start moving the window.", + "itemtype": "method", + "name": "_moveDragStart", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "", + "type": "Object" + } + ], + "class": "photonui.Window", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/window.js", + "line": 346, + "description": "Move the window.", + "itemtype": "method", + "name": "_moveDragging", + "access": "private", + "tagname": "", + "params": [ + { + "name": "offsetX", + "description": "", + "type": "Number" + }, + { + "name": "offsetY", + "description": "", + "type": "Number" + }, + { + "name": "event", + "description": "", + "type": "Object" + } + ], + "class": "photonui.Window", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/window.js", + "line": 359, + "description": "Stop moving the window.", + "itemtype": "method", + "name": "_moveDragEnd", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "", + "type": "Object" + } + ], + "class": "photonui.Window", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/window.js", + "line": 372, + "description": "Move the window.", + "itemtype": "method", + "name": "__internalDragging", + "access": "private", + "tagname": "", + "params": [ + { + "name": "offsetX", + "description": "", + "type": "Number" + }, + { + "name": "offsetY", + "description": "", + "type": "Number" + }, + { + "name": "pageX", + "description": "", + "type": "Number" + }, + { + "name": "pageY", + "description": "", + "type": "Number" + } + ], + "class": "photonui.Window", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/window.js", + "line": 392, + "description": "Start moving the window.", + "itemtype": "method", + "name": "_moveTouchStart", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "", + "type": "Object" + } + ], + "class": "photonui.Window", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/window.js", + "line": 415, + "description": "Move the window.", + "itemtype": "method", + "name": "_moveTouchMove", + "access": "private", + "tagname": "", + "params": [ + { + "name": "offsetX", + "description": "", + "type": "Number" + }, + { + "name": "offsetY", + "description": "", + "type": "Number" + }, + { + "name": "event", + "description": "", + "type": "Object" + } + ], + "class": "photonui.Window", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/window.js", + "line": 429, + "description": "Stop moving the window.", + "itemtype": "method", + "name": "_moveTouchEnd", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "", + "type": "Object" + } + ], + "class": "photonui.Window", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/window.js", + "line": 443, + "description": "Gets the first touch event and normalizes pageX/Y and offsetX/Y properties.", + "itemtype": "method", + "name": "_moveTouchEnd", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "", + "type": "Object" + } + ], + "class": "photonui.Window", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/window.js", + "line": 466, + "description": "Close button clicked.", + "itemtype": "method", + "name": "_closeButtonClicked", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "", + "type": "Object" + } + ], + "class": "photonui.Window", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/container/window.js", + "line": 477, + "description": "Called when the locale is changed.", + "itemtype": "method", + "name": "__onLocaleChanged", + "access": "private", + "tagname": "", + "class": "photonui.Window", + "module": "PhotonUI", + "submodule": "Container", + "namespace": "photonui" + }, + { + "file": "src/dataview/dataview.js", + "line": 115, + "description": "The collection of items displayed by the data view widget.", + "itemtype": "property", + "name": "items", + "type": "Array", + "default": "null", + "class": "photonui.DataView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/dataview.js", + "line": 151, + "description": "Defines if the data items can be selected.", + "itemtype": "property", + "name": "selectable", + "type": "Boolean", + "default": "false", + "class": "photonui.DataView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/dataview.js", + "line": 166, + "description": "If true, clicking outside of the items (in the container) will unselect\ncurrently selected items.\nOnly used when \"selectable\" option is set to \"true\".", + "itemtype": "property", + "name": "unselectOnOutsideClick", + "type": "Boolean", + "default": "false", + "class": "photonui.DataView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/dataview.js", + "line": 183, + "description": "Defines if the data items can be multi-selected.\nOnly used when \"selectable\" option is set to \"true\".", + "itemtype": "property", + "name": "multiSelectable", + "type": "Boolean", + "default": "false", + "class": "photonui.DataView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/dataview.js", + "line": 199, + "description": "Defines wether or not \"ctrl\" key has to be pressed to multi-select items.\nOnly used when \"multiSelectable\" option is set to \"true\".", + "itemtype": "property", + "name": "multiSelectWithCtrl", + "type": "Boolean", + "default": "true", + "class": "photonui.DataView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/dataview.js", + "line": 215, + "description": "If true, allow selecting multiple items with one click when pressing\n\"shift\" key.\nOnly used when \"multiSelectable\" option is set to \"true\".", + "itemtype": "property", + "name": "allowShiftSelect", + "type": "Boolean", + "default": "true", + "class": "photonui.DataView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/dataview.js", + "line": 232, + "description": "Defines if the data items can be drag & dropped.", + "itemtype": "property", + "name": "dragAndDroppable", + "type": "Boolean", + "default": "false", + "class": "photonui.DataView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/dataview.js", + "line": 247, + "description": "A custom formater function which overrides the default rendering process\nof the widget.", + "itemtype": "property", + "name": "customWidgetFormater", + "type": "Function", + "default": "null", + "class": "photonui.DataView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/dataview.js", + "line": 263, + "description": "The currently selected items.", + "itemtype": "property", + "name": "selectedItems", + "type": "Array", + "default": "[]", + "class": "photonui.DataView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/dataview.js", + "line": 277, + "description": "The list of columns which defines the structure of the items (if not\nsetted manually, the columns are automatically generated).", + "itemtype": "property", + "name": "columns", + "type": "Array", + "default": "null", + "class": "photonui.DataView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/dataview.js", + "line": 302, + "description": "Html outer element of the widget (if any).", + "itemtype": "property", + "name": "html", + "type": "HTMLElement", + "default": "null", + "readonly": "", + "class": "photonui.DataView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/dataview.js", + "line": 314, + "description": "The type of the container DOM element which will be created during the\nrender process.", + "itemtype": "property", + "name": "containerElement", + "type": "String", + "default": "\"ul\"", + "class": "photonui.DataView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/dataview.js", + "line": 330, + "description": "The type of the items DOM elements which will be created during the\nrender process.", + "itemtype": "property", + "name": "itemElement", + "type": "String", + "default": "\"li\"", + "class": "photonui.DataView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/dataview.js", + "line": 346, + "description": "The type of the columns DOM elements which will be created during the\nrender process.", + "itemtype": "property", + "name": "columnElement", + "type": "String", + "default": "\"span\"", + "class": "photonui.DataView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/dataview.js", + "line": 362, + "description": "The list of identifiers wich will be added to every generated elements\nof the widget as classnames.", + "itemtype": "property", + "name": "identifiers", + "type": "Array", + "default": "[]", + "access": "private", + "tagname": "", + "class": "photonui.DataView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/dataview.js", + "line": 388, + "description": "Destroy the widget.", + "itemtype": "method", + "name": "destroy", + "class": "photonui.DataView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/dataview.js", + "line": 398, + "description": "Selects the item(s) at given indexes.", + "itemtype": "method", + "name": "selectItems", + "params": [ + { + "name": "indexes", + "description": "", + "type": "...Number|Number[]" + } + ], + "class": "photonui.DataView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/dataview.js", + "line": 421, + "description": "Unselects the item(s) at given indexes.", + "itemtype": "method", + "name": "unselectItems", + "params": [ + { + "name": "indexes", + "description": "", + "type": "...Number|Number[]" + } + ], + "class": "photonui.DataView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/dataview.js", + "line": 446, + "description": "Destroy all children of the layout", + "itemtype": "method", + "name": "_empty", + "access": "private", + "tagname": "", + "class": "photonui.DataView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/dataview.js", + "line": 462, + "description": "Layout children widgets.", + "itemtype": "method", + "name": "_getChildren", + "access": "private", + "tagname": "", + "return": { + "description": "the childen widget", + "type": "Array" + }, + "class": "photonui.DataView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/dataview.js", + "line": 481, + "description": "Returns the item at a given index.", + "itemtype": "method", + "name": "_getItemByIndex", + "access": "private", + "tagname": "", + "params": [ + { + "name": "index", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "the item", + "type": "Object" + }, + "class": "photonui.DataView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/dataview.js", + "line": 495, + "description": "Build the widget HTML.", + "itemtype": "method", + "name": "_buildHtml", + "access": "private", + "tagname": "", + "class": "photonui.DataView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/dataview.js", + "line": 505, + "description": "Build the widget container HTML.", + "itemtype": "method", + "name": "_buildContainerHtml", + "access": "private", + "tagname": "", + "class": "photonui.DataView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/dataview.js", + "line": 519, + "description": "Build the items list HTML.", + "itemtype": "method", + "name": "_buildItemsHtml", + "access": "private", + "tagname": "", + "class": "photonui.DataView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/dataview.js", + "line": 551, + "description": "Renders a given item.", + "itemtype": "method", + "name": "_renderItem", + "access": "private", + "tagname": "", + "params": [ + { + "name": "item", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "the rendered item", + "type": "Element" + }, + "class": "photonui.DataView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/dataview.js", + "line": 579, + "description": "Renders all the columns of a given item.", + "itemtype": "method", + "name": "_renderItemInner", + "access": "private", + "tagname": "", + "params": [ + { + "name": "itemNode", + "description": "the container element of the item", + "type": "Element" + }, + { + "name": "item", + "description": "the rendered item", + "type": "Object" + } + ], + "return": { + "description": "the rendered item", + "type": "Element" + }, + "class": "photonui.DataView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/dataview.js", + "line": 602, + "description": "Renders a given column.", + "itemtype": "method", + "name": "_renderColumn", + "access": "private", + "tagname": "", + "params": [ + { + "name": "content", + "description": "the content of the column", + "type": "photonui.Widget|String" + }, + { + "name": "columnId", + "description": "the identifier of the column", + "type": "String" + } + ], + "return": { + "description": "the rendered column", + "type": "Element" + }, + "class": "photonui.DataView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/dataview.js", + "line": 632, + "description": "Generate the list of columns.", + "itemtype": "method", + "name": "_generateColumns", + "access": "private", + "tagname": "", + "class": "photonui.DataView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/dataview.js", + "line": 662, + "description": "Adds classes defined by the identifiers property to a given element, with\na given suffix.", + "itemtype": "method", + "name": "_addIdentifiersClasses", + "access": "private", + "tagname": "", + "params": [ + { + "name": "node", + "description": "the node", + "type": "Element" + }, + { + "name": "suffix", + "description": "the suffix of the classes", + "type": "String" + } + ], + "class": "photonui.DataView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/dataview.js", + "line": 686, + "description": "Selects an item.", + "itemtype": "method", + "name": "_selectItem", + "access": "private", + "tagname": "", + "params": [ + { + "name": "item", + "description": "the item", + "type": "Object" + } + ], + "class": "photonui.DataView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/dataview.js", + "line": 702, + "description": "Unselects an item.", + "itemtype": "method", + "name": "_unselectItem", + "access": "private", + "tagname": "", + "params": [ + { + "name": "item", + "description": "the item", + "type": "Object" + } + ], + "class": "photonui.DataView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/dataview.js", + "line": 718, + "description": "Selects all items from the current selection to a given item.", + "itemtype": "method", + "name": "_selectItemsTo", + "access": "private", + "tagname": "", + "params": [ + { + "name": "item", + "description": "the item", + "type": "Object" + } + ], + "class": "photonui.DataView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/dataview.js", + "line": 739, + "description": "Unselects all items.", + "itemtype": "method", + "name": "unselectAllItems", + "access": "private", + "tagname": "", + "class": "photonui.DataView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/dataview.js", + "line": 751, + "description": "Gets an item of the collection from a given item DOM element.", + "itemtype": "method", + "name": "_getItemFromNode", + "access": "private", + "tagname": "", + "params": [ + { + "name": "itemNode", + "description": "the item DOM element", + "type": "Element" + } + ], + "return": { + "description": "the item", + "type": "Object" + }, + "class": "photonui.DataView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/dataview.js", + "line": 764, + "description": "Moves the item at a givent index to another given index. Rebuilds the\ndataview.", + "itemtype": "method", + "name": "_moveItem", + "access": "private", + "tagname": "", + "params": [ + { + "name": "itemIndex", + "description": "the index of the item to move", + "type": "Number" + }, + { + "name": "destinationIndex", + "description": "the destination index", + "type": "Number" + } + ], + "class": "photonui.DataView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/dataview.js", + "line": 782, + "description": "Handle item click events.", + "itemtype": "method", + "name": "_handleClick", + "access": "private", + "tagname": "", + "params": [ + { + "name": "item", + "description": "the item", + "type": "Object" + }, + { + "name": "modifiers", + "description": "the modifiers states", + "type": "Object", + "props": [ + { + "name": "ctrl", + "description": "", + "type": "Object" + }, + { + "name": "shift", + "description": "", + "type": "Object" + } + ] + } + ], + "class": "photonui.DataView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/dataview.js", + "line": 833, + "description": "Generates a placeholder item element.", + "itemtype": "method", + "name": "_generatePlaceholderElement", + "access": "private", + "tagname": "", + "return": { + "description": "the placeholder item element", + "type": "Element" + }, + "class": "photonui.DataView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/dataview.js", + "line": 861, + "description": "Called when an element is clicked.", + "itemtype": "method", + "name": "__onClick", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "the click event", + "type": "Object" + } + ], + "class": "photonui.DataView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/dataview.js", + "line": 885, + "description": "Called when an item is clicked.", + "itemtype": "method", + "name": "__onItemClick", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "the click event", + "type": "Object" + }, + { + "name": "item", + "description": "the clicked item", + "type": "Item" + } + ], + "class": "photonui.DataView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/dataview.js", + "line": 903, + "description": "Called when an item is dragged.", + "itemtype": "method", + "name": "__onDragStart", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "", + "type": "Object" + } + ], + "class": "photonui.DataView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/dataview.js", + "line": 935, + "description": "Called when a dragged item enters into another element.", + "itemtype": "method", + "name": "__onDragEnter", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "", + "type": "Object" + } + ], + "class": "photonui.DataView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/dataview.js", + "line": 970, + "description": "Called when a item drag has ended.", + "itemtype": "method", + "name": "__onDragEnd", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "", + "type": "Object" + } + ], + "class": "photonui.DataView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/dataview.js", + "line": 1000, + "description": "Called when a item is dragged (fix for firefox).", + "itemtype": "method", + "name": "__onDragOver", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "", + "type": "Object" + } + ], + "class": "photonui.DataView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/dataview.js", + "line": 1016, + "description": "Called when a item is dropped (fix for firefox).", + "itemtype": "method", + "name": "__onDrop", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "", + "type": "Object" + } + ], + "class": "photonui.DataView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/dataview.js", + "line": 1032, + "description": "Called when the locale is changed.", + "itemtype": "method", + "name": "__onLocaleChanged", + "access": "private", + "tagname": "", + "class": "photonui.DataView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/fluidview.js", + "line": 65, + "description": "The width of the items.", + "itemtype": "property", + "name": "itemsWidth", + "type": "Number", + "default": "0", + "class": "photonui.FluidView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/fluidview.js", + "line": 81, + "description": "The height of the items.", + "itemtype": "property", + "name": "itemsHeight", + "type": "Number", + "default": "0", + "class": "photonui.FluidView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/fluidview.js", + "line": 97, + "description": "The vertical padding of the container element.", + "itemtype": "property", + "name": "verticalPadding", + "type": "Number", + "default": "0", + "class": "photonui.FluidView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/fluidview.js", + "line": 113, + "description": "The horizontal padding of the container element.", + "itemtype": "property", + "name": "horizontalPadding", + "type": "Number", + "default": "0", + "class": "photonui.FluidView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/fluidview.js", + "line": 129, + "description": "The vertical spacing between the elements.", + "itemtype": "property", + "name": "verticalSpacing", + "type": "Number", + "default": "0", + "class": "photonui.FluidView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/fluidview.js", + "line": 145, + "description": "The horizontal spacing between the elements.", + "itemtype": "property", + "name": "horizontalSpacing", + "type": "Number", + "default": "0", + "class": "photonui.FluidView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/fluidview.js", + "line": 161, + "description": "Build the items list HTML.", + "itemtype": "method", + "name": "_buildItemsHtml", + "access": "private", + "tagname": "", + "class": "photonui.FluidView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/iconview.js", + "line": 88, + "description": "The width of the icons.", + "itemtype": "property", + "name": "iconWidth", + "type": "Number", + "default": "0", + "class": "photonui.IconView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/iconview.js", + "line": 104, + "description": "The width of the items.", + "itemtype": "property", + "name": "iconHeight", + "type": "Number", + "default": "0", + "class": "photonui.IconView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/iconview.js", + "line": 120, + "description": "Renders a given column.", + "itemtype": "method", + "name": "_renderColumn", + "access": "private", + "tagname": "", + "params": [ + { + "name": "content", + "description": "the content of the column", + "type": "photonui.Widget|String" + }, + { + "name": "columnId", + "description": "the identifier of the column", + "type": "String" + } + ], + "return": { + "description": "the rendered column", + "type": "Element" + }, + "class": "photonui.IconView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/tableview.js", + "line": 70, + "description": "Defines if the header is displayed.", + "itemtype": "property", + "name": "showHeader", + "type": "Boolean", + "default": "true", + "class": "photonui.TableView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/tableview.js", + "line": 85, + "description": "Build the items list HTML.", + "itemtype": "method", + "name": "_buildItemsHtml", + "access": "private", + "tagname": "", + "class": "photonui.TableView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/dataview/tableview.js", + "line": 98, + "description": "Renders the table header.", + "itemtype": "method", + "name": "_renderHeader", + "access": "private", + "tagname": "", + "return": { + "description": "the rendered header", + "type": "Element" + }, + "class": "photonui.TableView", + "module": "PhotonUI", + "submodule": "DataView", + "namespace": "photonui" + }, + { + "file": "src/interactive/button.js", + "line": 77, + "description": "The button text.", + "itemtype": "property", + "name": "text", + "type": "String", + "default": "\"Button\"", + "class": "photonui.Button", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/button.js", + "line": 97, + "description": "Define if the button text is displayed or hidden.", + "itemtype": "property", + "name": "textVisible", + "type": "Boolean", + "default": "true", + "class": "photonui.Button", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/button.js", + "line": 115, + "description": "Left icon widget name.", + "itemtype": "property", + "name": "leftIconName", + "type": "String", + "default": ": null", + "class": "photonui.Button", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/button.js", + "line": 138, + "description": "Left icon widget.", + "itemtype": "property", + "name": "leftIcon", + "type": "BaseIcon", + "default": ": null", + "class": "photonui.Button", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/button.js", + "line": 157, + "description": "Define if the left icon is displayed or hidden.", + "itemtype": "property", + "name": "leftIconVisible", + "type": "Boolean", + "default": "true", + "class": "photonui.Button", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/button.js", + "line": 175, + "description": "Right icon widget name.", + "itemtype": "property", + "name": "rightIconName", + "type": "String", + "default": ": null", + "class": "photonui.Button", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/button.js", + "line": 198, + "description": "Right icon widget.", + "itemtype": "property", + "name": "rightIcon", + "type": "BaseIcon", + "default": ": null", + "class": "photonui.Button", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/button.js", + "line": 217, + "description": "Define if the right icon is displayed or hidden.", + "itemtype": "property", + "name": "rightIconVisible", + "type": "Boolean", + "default": "true", + "class": "photonui.Button", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/button.js", + "line": 235, + "description": "Define the button appearance.\n\n * `normal`\n * `flat`", + "itemtype": "property", + "name": "appearance", + "type": "String", + "default": "\"normal\"", + "class": "photonui.Button", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/button.js", + "line": 261, + "description": "Button's color.\n\nThe available colors depends on the theme. Particle, the\ndefault PhotonUI theme provides the following colors:\n\n * `blue`\n * `red`\n * `yellow`\n * `green`\n * null (default)", + "itemtype": "property", + "name": "buttonColor", + "type": "string", + "default": "null", + "class": "photonui.Button", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/button.js", + "line": 293, + "description": "Html outer element of the widget (if any).", + "itemtype": "property", + "name": "html", + "type": "HTMLElement", + "default": "null", + "readonly": "", + "class": "photonui.Button", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/button.js", + "line": 311, + "description": "Destroy the widget.", + "itemtype": "method", + "name": "destroy", + "class": "photonui.Button", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/button.js", + "line": 332, + "description": "Update the button content", + "itemtype": "method", + "name": "_update", + "access": "private", + "tagname": "", + "class": "photonui.Button", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/button.js", + "line": 362, + "description": "Build the widget HTML.", + "itemtype": "method", + "name": "_buildHtml", + "access": "private", + "tagname": "", + "class": "photonui.Button", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/button.js", + "line": 389, + "description": "Called when the button is clicked.", + "itemtype": "method", + "name": "__onButtonClicked", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "" + } + ], + "class": "photonui.Button", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/checkbox.js", + "line": 75, + "description": "The input value.", + "itemtype": "property", + "name": "value", + "type": "Boolean", + "default": "false", + "class": "photonui.CheckBox", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/checkbox.js", + "line": 90, + "description": "Html outer element of the widget (if any).", + "itemtype": "property", + "name": "html", + "type": "HTMLElement", + "default": "null", + "readonly": "", + "class": "photonui.CheckBox", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/checkbox.js", + "line": 108, + "description": "Build the widget HTML.", + "itemtype": "method", + "name": "_buildHtml", + "access": "private", + "tagname": "", + "class": "photonui.CheckBox", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/checkbox.js", + "line": 134, + "itemtype": "method", + "name": "__onChange", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "" + } + ], + "class": "photonui.CheckBox", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/checkbox.js", + "line": 147, + "itemtype": "method", + "name": "__onSpanClick", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "" + } + ], + "class": "photonui.CheckBox", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/checkbox.js", + "line": 158, + "itemtype": "method", + "name": "__onCheckboxClick", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "" + } + ], + "class": "photonui.CheckBox", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/checkbox.js", + "line": 167, + "itemtype": "method", + "name": "__onSpanKeyPress", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "" + } + ], + "class": "photonui.CheckBox", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/colorpalette.js", + "line": 72, + "description": "The value (color in rgb hexadecimal format (e.g. \"#ff0000\")).", + "itemtype": "property", + "name": "value", + "type": "String", + "class": "photonui.ColorPalette", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/colorpalette.js", + "line": 87, + "description": "The color.", + "itemtype": "property", + "name": "color", + "type": "photonui.Color", + "class": "photonui.ColorPalette", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/colorpalette.js", + "line": 105, + "description": "The color palette.", + "itemtype": "property", + "name": "palette", + "type": "Array", + "default": "null (= `Color.palette`)", + "class": "photonui.ColorPalette", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/colorpalette.js", + "line": 148, + "description": "Html outer element of the widget (if any).", + "itemtype": "property", + "name": "html", + "type": "HTMLElement", + "default": "null", + "readonly": "", + "class": "photonui.ColorPalette", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/colorpalette.js", + "line": 166, + "description": "Build the widget HTML.", + "itemtype": "method", + "name": "_buildHtml", + "access": "private", + "tagname": "", + "class": "photonui.ColorPalette", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/colorpicker.js", + "line": 100, + "description": "The value (color in rgb hexadecimal format (e.g. \"#ff0000\")).", + "itemtype": "property", + "name": "value", + "type": "String", + "class": "photonui.ColorPicker", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/colorpicker.js", + "line": 116, + "description": "The color.", + "itemtype": "property", + "name": "color", + "type": "photonui.Color", + "class": "photonui.ColorPicker", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/colorpicker.js", + "line": 146, + "description": "Html outer element of the widget (if any).", + "itemtype": "property", + "name": "html", + "type": "HTMLElement", + "default": "null", + "readonly": "", + "class": "photonui.ColorPicker", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/colorpicker.js", + "line": 160, + "description": "Buffer canvas for hue circle.", + "itemtype": "property", + "name": "__buffH", + "access": "private", + "tagname": "", + "type": "HTMLCanvasElement", + "class": "photonui.ColorPicker", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/colorpicker.js", + "line": 169, + "description": "Buffer canvas for saturation/brightness square.", + "itemtype": "property", + "name": "__buffSB", + "access": "private", + "tagname": "", + "type": "HTMLCanvasElement", + "class": "photonui.ColorPicker", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/colorpicker.js", + "line": 178, + "description": "Mouse manager.", + "itemtype": "property", + "name": "__mouseManager", + "access": "private", + "tagname": "", + "type": "photonui.MouseManager", + "class": "photonui.ColorPicker", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/colorpicker.js", + "line": 187, + "description": "FLAG: Disable SB square update.", + "itemtype": "property", + "name": "__disableSBUpdate", + "access": "private", + "tagname": "", + "type": "Boolean", + "default": "false", + "class": "photonui.ColorPicker", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/colorpicker.js", + "line": 207, + "description": "Build the widget HTML.", + "itemtype": "method", + "name": "_buildHtml", + "access": "private", + "tagname": "", + "class": "photonui.ColorPicker", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/colorpicker.js", + "line": 233, + "description": "Update hue circle", + "itemtype": "method", + "name": "_updateH", + "access": "private", + "tagname": "", + "class": "photonui.ColorPicker", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/colorpicker.js", + "line": 262, + "description": "Update saturation/brightness square mask", + "itemtype": "method", + "name": "_updateSBmask", + "access": "private", + "tagname": "", + "class": "photonui.ColorPicker", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/colorpicker.js", + "line": 296, + "description": "Update saturation/brightness square", + "itemtype": "method", + "name": "_updateSB", + "access": "private", + "tagname": "", + "class": "photonui.ColorPicker", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/colorpicker.js", + "line": 331, + "description": "Update the canvas", + "itemtype": "method", + "name": "_updateCanvas", + "access": "private", + "tagname": "", + "class": "photonui.ColorPicker", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/colorpicker.js", + "line": 371, + "description": "Is the pointer on the SB Square?", + "itemtype": "method", + "name": "_pointerOnSquare", + "access": "private", + "tagname": "", + "params": [ + { + "name": "mstate", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "photonui.ColorPicker", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/colorpicker.js", + "line": 383, + "description": "Is the pointer on the hue circle?", + "itemtype": "method", + "name": "_pointerOnCircle", + "access": "private", + "tagname": "", + "params": [ + { + "name": "mstate", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "photonui.ColorPicker", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/colorpicker.js", + "line": 398, + "description": "the angle of the pointer with the horizontal line that pass by the center of the hue circle.", + "itemtype": "method", + "name": "_pointerAngle", + "access": "private", + "tagname": "", + "params": [ + { + "name": "mstate", + "description": "" + } + ], + "return": { + "description": "the angle in degree.", + "type": "Number" + }, + "class": "photonui.ColorPicker", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/colorpicker.js", + "line": 426, + "itemtype": "method", + "name": "__onMouseMove", + "access": "private", + "tagname": "", + "params": [ + { + "name": "manager", + "description": "", + "type": "photonui.MouseManager" + }, + { + "name": "mstate", + "description": "", + "type": "Object" + } + ], + "class": "photonui.ColorPicker", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/colorpicker.js", + "line": 440, + "itemtype": "method", + "name": "__onMouseDown", + "access": "private", + "tagname": "", + "params": [ + { + "name": "manager", + "description": "", + "type": "photonui.MouseManager" + }, + { + "name": "mstate", + "description": "", + "type": "Object" + } + ], + "class": "photonui.ColorPicker", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/colorpicker.js", + "line": 459, + "itemtype": "method", + "name": "__onMouseUp", + "access": "private", + "tagname": "", + "params": [ + { + "name": "manager", + "description": "", + "type": "photonui.MouseManager" + }, + { + "name": "mstate", + "description": "", + "type": "Object" + } + ], + "class": "photonui.ColorPicker", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/colorpicker.js", + "line": 469, + "itemtype": "method", + "name": "__onDragStart", + "access": "private", + "tagname": "", + "params": [ + { + "name": "manager", + "description": "", + "type": "photonui.MouseManager" + }, + { + "name": "mstate", + "description": "", + "type": "Object" + } + ], + "class": "photonui.ColorPicker", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/colorpicker.js", + "line": 486, + "itemtype": "method", + "name": "__onDraggingSquare", + "access": "private", + "tagname": "", + "params": [ + { + "name": "manager", + "description": "", + "type": "photonui.MouseManager" + }, + { + "name": "mstate", + "description": "", + "type": "Object" + } + ], + "class": "photonui.ColorPicker", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/colorpicker.js", + "line": 498, + "itemtype": "method", + "name": "__onDraggingCircle", + "access": "private", + "tagname": "", + "params": [ + { + "name": "manager", + "description": "", + "type": "photonui.MouseManager" + }, + { + "name": "mstate", + "description": "", + "type": "Object" + } + ], + "class": "photonui.ColorPicker", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/colorpicker.js", + "line": 509, + "itemtype": "method", + "name": "__onDragEnd", + "access": "private", + "tagname": "", + "params": [ + { + "name": "manager", + "description": "", + "type": "photonui.MouseManager" + }, + { + "name": "mstate", + "description": "", + "type": "Object" + } + ], + "class": "photonui.ColorPicker", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/colorpicker.js", + "line": 521, + "itemtype": "method", + "name": "__onValueChanged", + "access": "private", + "tagname": "", + "class": "photonui.ColorPicker", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/field.js", + "line": 96, + "description": "The field value.", + "itemtype": "property", + "name": "value", + "type": "String (maybe)", + "default": "\"\"", + "class": "photonui.Field", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/field.js", + "line": 112, + "description": "The placeholder displayed if the field is empty.", + "itemtype": "property", + "name": "Placeholder", + "type": "String", + "default": "\"\"", + "class": "photonui.Field", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/field.js", + "line": 131, + "description": "Html outer element of the widget (if any).", + "itemtype": "property", + "name": "html", + "type": "HTMLElement", + "default": "null", + "readonly": "", + "class": "photonui.Field", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/field.js", + "line": 149, + "description": "Bind Field events.", + "itemtype": "method", + "name": "_bindFieldEvents", + "access": "private", + "tagname": "", + "class": "photonui.Field", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/field.js", + "line": 186, + "description": "Called when the context menu should be displayed.", + "itemtype": "method", + "name": "__onContextMenu", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "" + } + ], + "class": "photonui.Field", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/field.js", + "line": 197, + "description": "To be called indirectly through __debValueChangedFinal().", + "itemtype": "method", + "name": "__forValueChangedFinal", + "access": "private", + "tagname": "", + "class": "photonui.Field", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/field.js", + "line": 207, + "description": "Debounced version of __forValueChangedFinal.", + "itemtype": "method", + "name": "__debValueChangedFinal", + "access": "private", + "tagname": "", + "class": "photonui.Field", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/iconbutton.js", + "line": 74, + "description": "Button width", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "16", + "class": "photonui.IconButton", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/iconbutton.js", + "line": 95, + "description": "Button height", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "16", + "class": "photonui.IconButton", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/iconbutton.js", + "line": 117, + "description": "Icon widget name.", + "itemtype": "property", + "name": "iconName", + "type": "String", + "default": ": null", + "class": "photonui.IconButton", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/iconbutton.js", + "line": 139, + "description": "Icon widget.", + "itemtype": "property", + "name": "icon", + "type": "BaseIcon", + "default": ": null", + "class": "photonui.IconButton", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/iconbutton.js", + "line": 158, + "description": "Html outer element of the widget (if any).", + "itemtype": "property", + "name": "html", + "type": "HTMLElement", + "default": "null", + "readonly": "", + "class": "photonui.IconButton", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/iconbutton.js", + "line": 176, + "description": "Destroy the widget.", + "itemtype": "method", + "name": "destroy", + "class": "photonui.IconButton", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/iconbutton.js", + "line": 191, + "description": "Build the widget HTML.", + "itemtype": "method", + "name": "_buildHtml", + "access": "private", + "tagname": "", + "class": "photonui.IconButton", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/iconbutton.js", + "line": 208, + "description": "Called when the button is clicked.", + "itemtype": "method", + "name": "__onButtonClicked", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "" + } + ], + "class": "photonui.IconButton", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/numericfield.js", + "line": 69, + "description": "The minimum value of the field.", + "itemtype": "property", + "name": "min", + "type": "Number\ndefault null (no minimum);", + "class": "photonui.NumericField", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/numericfield.js", + "line": 89, + "description": "The maximum value of the field.", + "itemtype": "property", + "name": "max", + "type": "Number\ndefault null (no maximum);", + "class": "photonui.NumericField", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/numericfield.js", + "line": 109, + "description": "The incrementation step of the field.", + "itemtype": "property", + "name": "step", + "type": "Number\ndefault 1", + "class": "photonui.NumericField", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/numericfield.js", + "line": 126, + "description": "The number of digit after the decimal dot.", + "itemtype": "property", + "name": "decimalDigits", + "type": "Number", + "default": "null (no limite)", + "class": "photonui.NumericField", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/numericfield.js", + "line": 146, + "description": "The decimal symbol (\".\" or \",\").", + "itemtype": "property", + "name": "decimalSymbol", + "type": "String", + "default": ": \".\"", + "class": "photonui.NumericField", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/numericfield.js", + "line": 166, + "description": "The field value.", + "itemtype": "property", + "name": "value", + "type": "Number", + "default": "0", + "class": "photonui.NumericField", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/numericfield.js", + "line": 191, + "description": "Update the value (in the widget).", + "itemtype": "method", + "name": "_updateValue", + "access": "private", + "tagname": "", + "params": [ + { + "name": "value", + "description": "The raw value.", + "type": "String|Number" + } + ], + "class": "photonui.NumericField", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/numericfield.js", + "line": 221, + "description": "Update the value in the html field.", + "itemtype": "method", + "name": "_updateFieldValue", + "access": "private", + "tagname": "", + "class": "photonui.NumericField", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/numericfield.js", + "line": 231, + "description": "Validate the user inputs.", + "itemtype": "method", + "name": "_validateInput", + "access": "private", + "tagname": "", + "params": [ + { + "name": "value", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "photonui.NumericField", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/numericfield.js", + "line": 254, + "description": "Build the widget HTML.", + "itemtype": "method", + "name": "_buildHtml", + "access": "private", + "tagname": "", + "class": "photonui.NumericField", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/numericfield.js", + "line": 270, + "itemtype": "method", + "name": "__onKeypress", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "" + } + ], + "class": "photonui.NumericField", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/numericfield.js", + "line": 298, + "itemtype": "method", + "name": "__onKeyup", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "" + } + ], + "class": "photonui.NumericField", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/numericfield.js", + "line": 311, + "itemtype": "method", + "name": "__onChange", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "" + } + ], + "class": "photonui.NumericField", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/numericfield.js", + "line": 322, + "itemtype": "method", + "name": "__onMouseWheel", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "" + } + ], + "class": "photonui.NumericField", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/numericfield.js", + "line": 362, + "itemtype": "method", + "name": "__onKeydown", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "" + } + ], + "class": "photonui.NumericField", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/slider.js", + "line": 87, + "description": "Define if the numeric field should be displayed.", + "itemtype": "property", + "name": "fieldVisible", + "type": "Boolean", + "default": ": true", + "class": "photonui.Slider", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/slider.js", + "line": 113, + "description": "Html outer element of the widget (if any).", + "itemtype": "property", + "name": "html", + "type": "HTMLElement", + "default": "null", + "readonly": "", + "class": "photonui.Slider", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/slider.js", + "line": 131, + "description": "Update the value in the html field.", + "itemtype": "method", + "name": "_updateFieldValue", + "access": "private", + "tagname": "", + "class": "photonui.Slider", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/slider.js", + "line": 146, + "description": "Build the widget HTML.", + "itemtype": "method", + "name": "_buildHtml", + "access": "private", + "tagname": "", + "class": "photonui.Slider", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/slider.js", + "line": 170, + "description": "Update the value form a mouse event occured on the slider.", + "itemtype": "method", + "name": "_updateFromMouseEvent", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "" + } + ], + "class": "photonui.Slider", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/slider.js", + "line": 196, + "itemtype": "method", + "name": "__onSliderMouseDown", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "" + } + ], + "class": "photonui.Slider", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/slider.js", + "line": 207, + "itemtype": "method", + "name": "__onSliderMouseMove", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "" + } + ], + "class": "photonui.Slider", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/slider.js", + "line": 216, + "itemtype": "method", + "name": "__onSliderMouseUp", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "" + } + ], + "class": "photonui.Slider", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/slider.js", + "line": 228, + "itemtype": "method", + "name": "__onSliderTouchStart", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "" + } + ], + "class": "photonui.Slider", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/slider.js", + "line": 240, + "itemtype": "method", + "name": "__onSliderTouchMove", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "" + } + ], + "class": "photonui.Slider", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/slider.js", + "line": 249, + "itemtype": "method", + "name": "__onSliderTouchEnd", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "" + } + ], + "class": "photonui.Slider", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/slider.js", + "line": 261, + "description": "Gets the first touch event and normalizes pageX/Y and offsetX/Y properties.", + "itemtype": "method", + "name": "_moveTouchEnd", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "", + "type": "Object" + } + ], + "class": "photonui.Slider", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/slider.js", + "line": 305, + "itemtype": "method", + "name": "__onSliderMouseWheel", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "" + } + ], + "class": "photonui.Slider", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/slider.js", + "line": 342, + "description": "Called when the context menu should be displayed.", + "itemtype": "method", + "name": "__onContextMenu", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "" + } + ], + "class": "photonui.Slider", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/slider.js", + "line": 357, + "itemtype": "method", + "name": "__onFieldContextMenu", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "" + } + ], + "class": "photonui.Slider", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/textareafield.js", + "line": 62, + "description": "Number of columns.", + "itemtype": "property", + "name": "cols", + "type": "Number", + "default": "20", + "class": "photonui.TextAreaField", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/textareafield.js", + "line": 77, + "description": "Number of rows.", + "itemtype": "property", + "name": "rows", + "type": "Number", + "default": "3", + "class": "photonui.TextAreaField", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/textareafield.js", + "line": 98, + "description": "Build the widget HTML.", + "itemtype": "method", + "name": "_buildHtml", + "access": "private", + "tagname": "", + "class": "photonui.TextAreaField", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/textfield.js", + "line": 62, + "description": "Type of the field.\n\n * text\n * password\n * email\n * search\n * tel\n * url", + "itemtype": "property", + "name": "type", + "type": "String", + "default": "text", + "class": "photonui.TextField", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/textfield.js", + "line": 99, + "description": "Build the widget HTML.", + "itemtype": "method", + "name": "_buildHtml", + "access": "private", + "tagname": "", + "class": "photonui.TextField", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/interactive/togglebutton.js", + "line": 76, + "description": "Build the widget HTML.", + "itemtype": "method", + "name": "_buildHtml", + "access": "private", + "tagname": "", + "class": "photonui.ToggleButton", + "module": "PhotonUI", + "submodule": "Interactive", + "namespace": "photonui" + }, + { + "file": "src/layout/boxlayout.js", + "line": 78, + "description": "The layout orientation (\"vertical\" or \"horizontal\").", + "itemtype": "property", + "name": "orientation", + "type": "String", + "default": "\"vertical\"", + "class": "photonui.BoxLayout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/boxlayout.js", + "line": 103, + "description": "Vertical padding (px).", + "itemtype": "property", + "name": "verticalPadding", + "type": "Number", + "default": "0", + "class": "photonui.BoxLayout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/boxlayout.js", + "line": 122, + "description": "Horizontal padding (px).", + "itemtype": "property", + "name": "horizontalPadding", + "type": "Number", + "default": "0", + "class": "photonui.BoxLayout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/boxlayout.js", + "line": 141, + "description": "Spacing between children widgets.", + "itemtype": "property", + "name": "spacing", + "type": "Number", + "default": "5", + "class": "photonui.BoxLayout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/boxlayout.js", + "line": 191, + "description": "Whether to stretch the box to its parent height or not.", + "itemtype": "property", + "name": "stretchToParentHeight", + "type": "Boolean", + "default": "true", + "class": "photonui.BoxLayout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/boxlayout.js", + "line": 215, + "description": "Html outer element of the widget (if any).", + "itemtype": "property", + "name": "html", + "type": "HTMLElement", + "default": "null", + "readonly": "", + "class": "photonui.BoxLayout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/boxlayout.js", + "line": 233, + "description": "Build the widget HTML.", + "itemtype": "method", + "name": "_buildHtml", + "access": "private", + "tagname": "", + "class": "photonui.BoxLayout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/boxlayout.js", + "line": 244, + "description": "Update the layout.", + "itemtype": "method", + "name": "_updateLayout", + "access": "private", + "tagname": "", + "class": "photonui.BoxLayout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/boxlayout.js", + "line": 301, + "description": "Returns a normalized layoutOption for a given widget.", + "itemtype": "method", + "name": "_computeLayoutOptions", + "access": "private", + "tagname": "", + "params": [ + { + "name": "widget", + "description": "", + "type": "photonui.Widget" + } + ], + "return": { + "description": "the layout options", + "type": "Object" + }, + "class": "photonui.BoxLayout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/fluidlayout.js", + "line": 73, + "description": "The vertical spacing between children widgets.", + "itemtype": "property", + "name": "verticalSpacing", + "type": "Number", + "default": "0", + "class": "photonui.FluidLayout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/fluidlayout.js", + "line": 91, + "description": "The horizontal spacing between children widgets.", + "itemtype": "property", + "name": "horizontalSpacing", + "type": "Number", + "default": "0", + "class": "photonui.FluidLayout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/fluidlayout.js", + "line": 109, + "description": "Vertical padding (px).", + "itemtype": "property", + "name": "verticalPadding", + "type": "Number", + "default": "0", + "class": "photonui.FluidLayout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/fluidlayout.js", + "line": 128, + "description": "Horizontal padding (px).", + "itemtype": "property", + "name": "horizontalPadding", + "type": "Number", + "default": "0", + "class": "photonui.FluidLayout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/fluidlayout.js", + "line": 147, + "description": "Vertical alignment of children widgets.\n\nValues:\n\n * start|top|begin (default)\n * center|middle\n * end|bottom", + "itemtype": "property", + "name": "verticalAlign", + "type": "String", + "default": "\"start\"", + "class": "photonui.FluidLayout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/fluidlayout.js", + "line": 179, + "description": "Horizontal alignment of children widgets.\n\nValues:\n\n * start|left|begin (default)\n * center|middle\n * end|right", + "itemtype": "property", + "name": "horizontalAlign", + "type": "String", + "default": "\"start\"", + "class": "photonui.FluidLayout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/fluidlayout.js", + "line": 211, + "description": "Html outer element of the widget (if any).", + "itemtype": "property", + "name": "html", + "type": "HTMLElement", + "default": "null", + "readonly": "", + "class": "photonui.FluidLayout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/fluidlayout.js", + "line": 229, + "description": "Build the widget HTML.", + "itemtype": "method", + "name": "_buildHtml", + "access": "private", + "tagname": "", + "class": "photonui.FluidLayout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/fluidlayout.js", + "line": 243, + "description": "Update the layout.", + "itemtype": "method", + "name": "_updateLayout", + "access": "private", + "tagname": "", + "class": "photonui.FluidLayout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/fluidlayout.js", + "line": 309, + "description": "Returns a normalized layoutOption for a given widget.", + "itemtype": "method", + "name": "_computeLayoutOptions", + "access": "private", + "tagname": "", + "params": [ + { + "name": "widget", + "description": "", + "type": "photonui.Widget" + } + ], + "return": { + "description": "the layout options", + "type": "Object" + }, + "class": "photonui.FluidLayout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/gridlayout.js", + "line": 92, + "description": "Vertical padding (px).", + "itemtype": "property", + "name": "verticalPadding", + "type": "Number", + "default": "0", + "class": "photonui.GridLayout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/gridlayout.js", + "line": 114, + "description": "Horizontal padding (px).", + "itemtype": "property", + "name": "horizontalPadding", + "type": "Number", + "default": "0", + "class": "photonui.GridLayout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/gridlayout.js", + "line": 136, + "description": "The vertical spacing between children widgets.", + "itemtype": "property", + "name": "verticalSpacing", + "type": "Number", + "default": "5", + "class": "photonui.GridLayout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/gridlayout.js", + "line": 155, + "description": "The horizontal spacing between children widgets.", + "itemtype": "property", + "name": "horizontalSpacing", + "type": "Number", + "default": "5", + "class": "photonui.GridLayout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/gridlayout.js", + "line": 173, + "description": "Html outer element of the widget (if any).", + "itemtype": "property", + "name": "html", + "type": "HTMLElement", + "default": "null", + "readonly": "", + "class": "photonui.GridLayout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/gridlayout.js", + "line": 187, + "description": "Flag to indicate that the layout is actually been updated.", + "itemtype": "property", + "name": "_updatingLayout", + "access": "private", + "tagname": "", + "type": "Boolean", + "default": "false", + "class": "photonui.GridLayout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/gridlayout.js", + "line": 203, + "description": "Called when the visibility changes.", + "itemtype": "method", + "name": "_visibilityChanged", + "access": "private", + "tagname": "", + "params": [ + { + "name": "visibility", + "description": "Current visibility state (otptional, defaut=this.visible)", + "type": "Boolean" + } + ], + "class": "photonui.GridLayout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/gridlayout.js", + "line": 218, + "description": "Build the widget HTML.", + "itemtype": "method", + "name": "_buildHtml", + "access": "private", + "tagname": "", + "class": "photonui.GridLayout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/gridlayout.js", + "line": 235, + "description": "Update the layout.", + "itemtype": "method", + "name": "_updateLayout", + "access": "private", + "tagname": "", + "class": "photonui.GridLayout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/gridlayout.js", + "line": 389, + "description": "Returns a normalized layoutOption for a given widget.", + "itemtype": "method", + "name": "_computeLayoutOptions", + "access": "private", + "tagname": "", + "params": [ + { + "name": "widget", + "description": "", + "type": "photonui.Widget" + } + ], + "return": { + "description": "the layout options", + "type": "Object" + }, + "class": "photonui.GridLayout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/gridlayout.js", + "line": 519, + "description": "Update the spacing between widgets", + "itemtype": "method", + "name": "_updateSpacing", + "access": "private", + "tagname": "", + "class": "photonui.GridLayout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/gridlayout.js", + "line": 533, + "description": "Hack to get thing working with Gecko and Trident.\n\nMSIE 11:\n\n * The hack fixes all the issues,\n\nMSIE 10:\n\n * There is issues with rowspan\n * The dynamic resizing does not works\n\nFirefox:\n\n * There is some minor issues with rowspan", + "itemtype": "method", + "name": "_sizingHack", + "access": "private", + "tagname": "", + "class": "photonui.GridLayout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/layout.js", + "line": 69, + "description": "Layout children widgets name.", + "itemtype": "property", + "name": "childrenNames", + "type": "Array", + "default": "[]", + "class": "photonui.Layout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/layout.js", + "line": 106, + "description": "Layout children widgets.", + "itemtype": "property", + "name": "children", + "type": "Array", + "default": "[]", + "class": "photonui.Layout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/layout.js", + "line": 159, + "description": "Add a widget to the layout.", + "itemtype": "method", + "name": "addChild", + "params": [ + { + "name": "widget", + "description": "The widget to add.", + "type": "photonui.Widget" + }, + { + "name": "layoutOption", + "description": "Specific option for the layout (optional).", + "type": "Object" + } + ], + "class": "photonui.Layout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/layout.js", + "line": 178, + "description": "Remove a widget from the layout.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "widget", + "description": "The widget to remove.", + "type": "photonui.Widget" + } + ], + "class": "photonui.Layout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/layout.js", + "line": 193, + "description": "Destroy all children of the layout", + "itemtype": "method", + "name": "empty", + "class": "photonui.Layout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/layout.js", + "line": 211, + "description": "Destroy the widget.", + "itemtype": "method", + "name": "destroy", + "class": "photonui.Layout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/layout.js", + "line": 223, + "description": "Lock the update of the layout.", + "itemtype": "method", + "name": "_lockUpdate", + "access": "private", + "tagname": "", + "class": "photonui.Layout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/layout.js", + "line": 240, + "description": "Update the layout.", + "itemtype": "method", + "name": "_updateLayout", + "access": "private", + "tagname": "", + "class": "photonui.Layout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/layout.js", + "line": 250, + "description": "Called when the visibility changes.", + "itemtype": "method", + "name": "_visibilityChanged", + "access": "private", + "tagname": "", + "params": [ + { + "name": "visibility", + "description": "Current visibility state (otptional, defaut=this.visible)", + "type": "Boolean" + } + ], + "class": "photonui.Layout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/layout.js", + "line": 273, + "description": "Called when the locale is changed.", + "itemtype": "method", + "name": "__onLocaleChanged", + "access": "private", + "tagname": "", + "class": "photonui.Layout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/menu.js", + "line": 62, + "description": "Define if icon on menu items are visible.", + "itemtype": "property", + "name": "iconVisible", + "type": "Boolean", + "default": ": true", + "class": "photonui.Menu", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/menu.js", + "line": 85, + "description": "Html outer element of the widget (if any).", + "itemtype": "property", + "name": "html", + "type": "HTMLElement", + "default": "null", + "readonly": "", + "class": "photonui.Menu", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/menu.js", + "line": 103, + "description": "Build the widget HTML.", + "itemtype": "method", + "name": "_buildHtml", + "access": "private", + "tagname": "", + "class": "photonui.Menu", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/menu.js", + "line": 114, + "description": "Update the layout.", + "itemtype": "method", + "name": "_updateLayout", + "access": "private", + "tagname": "", + "class": "photonui.Menu", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/tablayout.js", + "line": 66, + "description": "Define the tabs position.\n\n * top\n * bottom\n * left\n * right", + "itemtype": "property", + "name": "tabsPosition", + "type": "String", + "default": "\"top\"", + "class": "photonui.TabLayout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/tablayout.js", + "line": 97, + "description": "Html outer element of the widget (if any).", + "itemtype": "property", + "name": "html", + "type": "HTMLElement", + "default": "null", + "readonly": "", + "class": "photonui.TabLayout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/tablayout.js", + "line": 109, + "description": "Define the active tab name.", + "itemtype": "property", + "name": "activeTabName", + "type": "String", + "default": "null", + "class": "photonui.TabLayout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/tablayout.js", + "line": 141, + "description": "Container node padding.", + "itemtype": "property", + "name": "padding", + "type": "Number", + "default": "10", + "class": "photonui.TabLayout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/tablayout.js", + "line": 160, + "description": "Define the active tab.", + "itemtype": "property", + "name": "activeTab", + "type": "photonui.Widget", + "default": "null", + "class": "photonui.TabLayout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/tablayout.js", + "line": 199, + "description": "Remove a widget from the layout.", + "itemtype": "method", + "name": "removeChild", + "params": [ + { + "name": "widget", + "description": "The widget to remove.", + "type": "photonui.Widget" + } + ], + "class": "photonui.TabLayout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/tablayout.js", + "line": 214, + "description": "Build the widget HTML.", + "itemtype": "method", + "name": "_buildHtml", + "access": "private", + "tagname": "", + "class": "photonui.TabLayout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/tablayout.js", + "line": 237, + "description": "Update the layout.", + "itemtype": "method", + "name": "_updateLayout", + "access": "private", + "tagname": "", + "class": "photonui.TabLayout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/layout/tablayout.js", + "line": 273, + "description": "Returns a normalized layoutOption for a given widget.", + "itemtype": "method", + "name": "_computeLayoutOptions", + "access": "private", + "tagname": "", + "params": [ + { + "name": "widget", + "description": "", + "type": "photonui.Widget" + } + ], + "return": { + "description": "the layout options", + "type": "Object" + }, + "class": "photonui.TabLayout", + "module": "PhotonUI", + "submodule": "Layout", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/accelmanager.js", + "line": 65, + "description": "Registered keys.\n\n {\n \"key\": [ \"id\", \"id\", ... ]\n ...\n }", + "itemtype": "property", + "name": "__keys", + "access": "private", + "tagname": "", + "type": "Object", + "class": "photonui.AccelManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/accelmanager.js", + "line": 79, + "description": "Keyboard bindings.\n\n {\n \"id\": {\n safe: Boolean,\n callback: Function,\n binding: Object\n },\n ...\n }", + "itemtype": "property", + "name": "__kbd", + "access": "private", + "tagname": "", + "type": "Object", + "class": "photonui.AccelManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/accelmanager.js", + "line": 103, + "description": "Add an accelerator.", + "itemtype": "method", + "name": "addAccel", + "params": [ + { + "name": "id", + "description": "An unique id for the accelerator.", + "type": "String" + }, + { + "name": "keys", + "description": "The keys of the accelerator (see the keyCombo section of http://robertwhurst.github.io/KeyboardJS/ ).", + "type": "String" + }, + { + "name": "callback", + "description": "", + "type": "Function" + }, + { + "name": "safe", + "description": "If true, the accelerator is disable if a field/textArea is focused (optional, default=true)", + "type": "Boolean" + } + ], + "class": "photonui.AccelManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/accelmanager.js", + "line": 128, + "description": "Remove an accelerator.", + "itemtype": "method", + "name": "removeAccel", + "params": [ + { + "name": "id", + "description": "the accelerator id.", + "type": "String" + } + ], + "class": "photonui.AccelManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/accelmanager.js", + "line": 160, + "itemtype": "method", + "name": "__onAccel", + "access": "private", + "tagname": "", + "params": [ + { + "name": "keys", + "description": "", + "type": "String" + }, + { + "name": "event", + "description": "", + "type": "Event" + } + ], + "class": "photonui.AccelManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/color.js", + "line": 233, + "description": "Object containing all known named colors (`colorName: [r, g, b]`).", + "itemtype": "property", + "name": "NAMED_COLORS", + "static": 1, + "type": "Object", + "class": "photonui.Color", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/color.js", + "line": 242, + "description": "Converts any supported color format to an `[r, g, b, a]` array.", + "itemtype": "method", + "name": "ParseString", + "static": 1, + "params": [ + { + "name": "color", + "description": "", + "type": "String" + } + ], + "return": { + "description": "`[r, g, b, a]` where each components is an integer between 0-255", + "type": "Array" + }, + "class": "photonui.Color", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/color.js", + "line": 288, + "description": "Converts a named color (e.g. \"red\") to an `[r, g, b]` array.", + "itemtype": "method", + "name": "ParseNamedColor", + "static": 1, + "params": [ + { + "name": "color", + "description": "The named color", + "type": "String" + } + ], + "return": { + "description": "`[r, g, b]` where each component is an integer between 0-255", + "type": "Array" + }, + "class": "photonui.Color", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/color.js", + "line": 304, + "description": "Converts an hexadecimal RGB color (e.g. `#FF0000`, `#F00`) to an `[r, g, b]` array.", + "itemtype": "method", + "name": "ParseRgbHexString", + "static": 1, + "params": [ + { + "name": "color", + "description": "The hexadecimal RGB color", + "type": "String" + } + ], + "return": { + "description": "`[r, g, b]` where each component is an integer between 0-255", + "type": "Array" + }, + "class": "photonui.Color", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/color.js", + "line": 337, + "description": "Converts an hexadecimal RGBA color (e.g. `#FF0000FF`, `#F00F`) to an `[r, g, b, a]` array.", + "itemtype": "method", + "name": "ParseRgbaHexString", + "static": 1, + "params": [ + { + "name": "color", + "description": "The hexadecimal RGBA color", + "type": "String" + } + ], + "return": { + "description": "`[r, g, b, a]` where each component is an integer between 0-255", + "type": "Array" + }, + "class": "photonui.Color", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/color.js", + "line": 372, + "description": "Converts a CSS RGB color (e.g. `rgb(255, 0, 0)`) to an `[r, g, b]` array.", + "itemtype": "method", + "name": "ParseCssRgbString", + "static": 1, + "params": [ + { + "name": "color", + "description": "The CSS RGB color", + "type": "String" + } + ], + "return": { + "description": "`[r, g, b]` where each component is an integer between 0-255", + "type": "Array" + }, + "class": "photonui.Color", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/color.js", + "line": 404, + "description": "Converts a CSS RGBA color (e.g. `rgba(255, 0, 0, 0.3)`) to an `[r, g, b, a]` array.", + "itemtype": "method", + "name": "ParseCssRgbaString", + "static": 1, + "params": [ + { + "name": "color", + "description": "The CSS RGBA color", + "type": "String" + } + ], + "return": { + "description": "`[r, g, b, a]` where each component is an integer between 0-255", + "type": "Array" + }, + "class": "photonui.Color", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/color.js", + "line": 442, + "description": "Format an RGB color to hexadecimal RGB string (e.g. `#FF0000`).", + "itemtype": "method", + "name": "FormatToRgbHexString", + "static": 1, + "params": [ + { + "name": "red", + "description": "The red component", + "type": "Number" + }, + { + "name": "green", + "description": "The green component", + "type": "Number" + }, + { + "name": "blue", + "description": "The blue component", + "type": "Number" + } + ], + "return": { + "description": "The formatted color string.", + "type": "String" + }, + "class": "photonui.Color", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/color.js", + "line": 468, + "description": "Format an RGBA color to hexadecimal RGBA string (e.g. `#FF0000FF`).", + "itemtype": "method", + "name": "FormatToRgbaHexString", + "static": 1, + "params": [ + { + "name": "red", + "description": "The red component", + "type": "Number" + }, + { + "name": "green", + "description": "The green component", + "type": "Number" + }, + { + "name": "blue", + "description": "The blue component", + "type": "Number" + }, + { + "name": "alpha", + "description": "The opacity of the color", + "type": "Number" + } + ], + "return": { + "description": "The formatted color string.", + "type": "String" + }, + "class": "photonui.Color", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/color.js", + "line": 487, + "description": "Format an RGB color to CSS RGB string (e.g. `rgb(255, 0, 0)`).", + "itemtype": "method", + "name": "FormatToCssRgbString", + "static": 1, + "params": [ + { + "name": "red", + "description": "The red component", + "type": "Number" + }, + { + "name": "green", + "description": "The green component", + "type": "Number" + }, + { + "name": "blue", + "description": "The blue component", + "type": "Number" + } + ], + "return": { + "description": "The formatted color string.", + "type": "String" + }, + "class": "photonui.Color", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/color.js", + "line": 501, + "description": "Format an RGBA color to CSS RGBA string (e.g. `rgba(255, 0, 0, 1.00)`).", + "itemtype": "method", + "name": "FormatToCssRgbaString", + "static": 1, + "params": [ + { + "name": "red", + "description": "The red component", + "type": "Number" + }, + { + "name": "green", + "description": "The green component", + "type": "Number" + }, + { + "name": "blue", + "description": "The blue component", + "type": "Number" + }, + { + "name": "alpha", + "description": "The opacity of the color", + "type": "Number" + } + ], + "return": { + "description": "The formatted color string.", + "type": "String" + }, + "class": "photonui.Color", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/color.js", + "line": 517, + "description": "Normalize an RGB color.", + "itemtype": "method", + "name": "NormalizeRgbColor", + "static": 1, + "params": [ + { + "name": "red", + "description": "The red component", + "type": "Number" + }, + { + "name": "green", + "description": "The green component", + "type": "Number" + }, + { + "name": "blue", + "description": "The blue component", + "type": "Number" + } + ], + "return": { + "description": "The normalized array `[r, g, b]` where each component is an integer between 0-255.", + "type": "Array" + }, + "class": "photonui.Color", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/color.js", + "line": 535, + "description": "Normalize an RGBA color.", + "itemtype": "method", + "name": "NormalizeRgbaColor", + "static": 1, + "params": [ + { + "name": "red", + "description": "The red component", + "type": "Number" + }, + { + "name": "green", + "description": "The green component", + "type": "Number" + }, + { + "name": "blue", + "description": "The blue component", + "type": "Number" + }, + { + "name": "alpha", + "description": "The opacity of the color", + "type": "Number" + } + ], + "return": { + "description": "The normalized array `[r, g, b, a]` where each component is an integer between 0-255.", + "type": "Array" + }, + "class": "photonui.Color", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/color.js", + "line": 566, + "description": "The color in RGB hexadecimal format (e.g. \"#FF0000\").", + "itemtype": "property", + "name": "hexString", + "deprecated": true, + "type": "String", + "class": "photonui.Color", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/color.js", + "line": 604, + "description": "The color in CSS RGB format (e.g. \"rgb(255, 0, 0)\").", + "itemtype": "property", + "name": "rgbString", + "type": "String", + "readonly": "", + "deprecated": true, + "class": "photonui.Color", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/color.js", + "line": 617, + "description": "The color in CSS RGBA format (e.g. \"rgba(255, 0, 0, 1.0)\").", + "itemtype": "property", + "name": "rgbaString", + "type": "String", + "readonly": "", + "deprecated": true, + "class": "photonui.Color", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/color.js", + "line": 630, + "description": "The color in RGB hexadecimal format (e.g. \"#FF0000\").", + "itemtype": "property", + "name": "rgbHexString", + "type": "String", + "class": "photonui.Color", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/color.js", + "line": 648, + "description": "The color in RGBA hexadecimal format (e.g. \"#FF0000FF\").", + "itemtype": "property", + "name": "rgbaHexString", + "type": "String", + "class": "photonui.Color", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/color.js", + "line": 666, + "description": "The color in CSS RGB format (e.g. \"rgb(255, 0, 0)\").", + "itemtype": "property", + "name": "cssRgbString", + "type": "String", + "class": "photonui.Color", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/color.js", + "line": 684, + "description": "The color in CSS RGBA format (e.g. \"rgb(255, 0, 0, 1.0)\").", + "itemtype": "property", + "name": "cssRgbaString", + "type": "String", + "class": "photonui.Color", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/color.js", + "line": 702, + "description": "Red (0-255).", + "itemtype": "property", + "name": "red", + "type": "Number", + "class": "photonui.Color", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/color.js", + "line": 719, + "description": "Green (0-255).", + "itemtype": "property", + "name": "green", + "type": "Number", + "class": "photonui.Color", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/color.js", + "line": 736, + "description": "Blue (0-255).", + "itemtype": "property", + "name": "blue", + "type": "Number", + "class": "photonui.Color", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/color.js", + "line": 753, + "description": "Alpha channel (0-255)", + "itemtype": "property", + "name": "alpha", + "type": "Number", + "class": "photonui.Color", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/color.js", + "line": 770, + "description": "Hue (0-360).", + "itemtype": "property", + "name": "hue", + "type": "Number", + "class": "photonui.Color", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/color.js", + "line": 787, + "description": "Saturation (0-100).", + "itemtype": "property", + "name": "saturation", + "type": "Number", + "class": "photonui.Color", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/color.js", + "line": 804, + "description": "Brightness (0-100).", + "itemtype": "property", + "name": "brightness", + "type": "Number", + "class": "photonui.Color", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/color.js", + "line": 827, + "description": "Defines the color from any supported string format.", + "itemtype": "method", + "name": "fromString", + "params": [ + { + "name": "color", + "description": "", + "type": "String" + } + ], + "class": "photonui.Color", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/color.js", + "line": 841, + "description": "Set RGB(A) color (alias for setRGBA).\n\nThe params can also be replaced by an array.", + "itemtype": "method", + "name": "setRGB", + "params": [ + { + "name": "red", + "description": "(0-255)", + "type": "Number" + }, + { + "name": "green", + "description": "(0-255)", + "type": "Number" + }, + { + "name": "blue", + "description": "(0-255)", + "type": "Number" + } + ], + "class": "photonui.Color", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/color.js", + "line": 855, + "description": "Set RGBA color.\n\nThe params can also be replaced by an array.", + "itemtype": "method", + "name": "setRGBA", + "params": [ + { + "name": "red", + "description": "(0-255)", + "type": "Number" + }, + { + "name": "green", + "description": "(0-255)", + "type": "Number" + }, + { + "name": "blue", + "description": "(0-255)", + "type": "Number" + }, + { + "name": "alpha", + "description": "(optional, 0-255)", + "type": "Number" + } + ], + "class": "photonui.Color", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/color.js", + "line": 885, + "description": "Get RGB.", + "itemtype": "method", + "name": "getRGB", + "return": { + "description": "[red(0-255), green(0-255), blue(0-255)]", + "type": "Array" + }, + "class": "photonui.Color", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/color.js", + "line": 895, + "description": "Get RGBA.", + "itemtype": "method", + "name": "getRGBA", + "return": { + "description": "[red(0-255), green(0-255), blue(0-255), alpha(0-255)]", + "type": "Array" + }, + "class": "photonui.Color", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/color.js", + "line": 905, + "description": "Set HSB color\n\nThe params can also be replaced by an array.", + "itemtype": "method", + "name": "setHSB", + "params": [ + { + "name": "hue", + "description": "(0-360)", + "type": "Number" + }, + { + "name": "saturation", + "description": "(0-100)", + "type": "Number" + }, + { + "name": "brightness", + "description": "(0-100)", + "type": "Number" + } + ], + "class": "photonui.Color", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/color.js", + "line": 937, + "description": "Update HSB from RGB.", + "itemtype": "method", + "name": "_updateHSB", + "access": "private", + "tagname": "", + "class": "photonui.Color", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/color.js", + "line": 978, + "description": "Update RGB from HSB.", + "itemtype": "method", + "name": "_updateRGB", + "access": "private", + "tagname": "", + "class": "photonui.Color", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/filemanager.js", + "line": 80, + "description": "List of the accepted mime types.", + "itemtype": "property", + "name": "acceptedMimes", + "type": "Array", + "default": "[]", + "class": "photonui.FileManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/filemanager.js", + "line": 98, + "description": "List of the accepted file extentions.", + "itemtype": "property", + "name": "acceptedExts", + "type": "Array", + "default": "[]", + "class": "photonui.FileManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/filemanager.js", + "line": 116, + "description": "Element that accepts file drop (`null` disable d&d support).", + "itemtype": "property", + "name": "dropZone", + "type": "HTMLElement", + "default": "null", + "class": "photonui.FileManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/filemanager.js", + "line": 153, + "description": "Allow multiselect in FileOpen dialog.", + "itemtype": "property", + "name": "multiselect", + "type": "Boolean", + "default": "false", + "class": "photonui.FileManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/filemanager.js", + "line": 178, + "description": "The file field for opening the file dialog.", + "itemtype": "property", + "name": "__fileField", + "access": "private", + "tagname": "", + "type": "HTMLElement", + "class": "photonui.FileManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/filemanager.js", + "line": 193, + "description": "Open the FileOpen dialog to allow user to browse its HDD for a file.", + "itemtype": "method", + "name": "open", + "class": "photonui.FileManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/filemanager.js", + "line": 206, + "description": "Destroy the class.", + "itemtype": "method", + "name": "destroy", + "class": "photonui.FileManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/filemanager.js", + "line": 218, + "description": "Update accepted mimes/extentions.", + "itemtype": "method", + "name": "_updateAccepted", + "access": "private", + "tagname": "", + "class": "photonui.FileManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/filemanager.js", + "line": 236, + "description": "Check file and call callbacks.", + "itemtype": "method", + "name": "_openFile", + "access": "private", + "tagname": "", + "params": [ + { + "name": "file", + "description": "", + "type": "File" + }, + { + "name": "x", + "description": "The x postition of the mouse (d&d only).", + "type": "Number" + }, + { + "name": "y", + "description": "The y postition of the mouse (d&d only).", + "type": "Number" + } + ], + "class": "photonui.FileManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/filemanager.js", + "line": 276, + "itemtype": "method", + "name": "__onFileDropped", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "" + } + ], + "class": "photonui.FileManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/filemanager.js", + "line": 290, + "itemtype": "method", + "name": "__onFileSelected", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "" + } + ], + "class": "photonui.FileManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/filemanager.js", + "line": 304, + "description": "Called when the locale is changed.", + "itemtype": "method", + "name": "__onLocaleChanged", + "access": "private", + "tagname": "", + "class": "photonui.FileManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/keyboardmanager.js", + "line": 108, + "description": "Disable the keyboard manager callbacks when focusing a input field-like element.", + "itemtype": "property", + "name": "safe", + "type": "Boolean", + "default": "true", + "class": "photonui.KeyboardManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/keyboardmanager.js", + "line": 126, + "description": "Disable concerned events default actions.", + "itemtype": "property", + "name": "noPreventDefault", + "type": "Boolean", + "default": "false", + "class": "photonui.KeyboardManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/keyboardmanager.js", + "line": 144, + "description": "The HTML Element on which the events are binded.\n\nNOTE: If a photonui.Widget object is assigned to this property,\n its HTML Element will be automatically assigned to the property instead.", + "itemtype": "property", + "name": "element", + "type": "HTMLElement", + "default": "null", + "class": "photonui.KeyboardManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/keyboardmanager.js", + "line": 171, + "description": "The action:\n\n * \"key-down\"\n * \"key-up\"\n * \"key-hold\"", + "itemtype": "property", + "name": "action", + "readonly": "", + "type": "String", + "class": "photonui.KeyboardManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/keyboardmanager.js", + "line": 190, + "description": "Last event object.", + "itemtype": "property", + "name": "__event", + "access": "private", + "tagname": "", + "type": "Object", + "default": "null", + "class": "photonui.KeyboardManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/keyboardmanager.js", + "line": 200, + "description": "The currently active keys.", + "itemtype": "property", + "name": "keys", + "access": "private", + "tagname": "", + "type": "Object", + "default": "{}", + "class": "photonui.KeyboardManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/keyboardmanager.js", + "line": 210, + "description": "Last key concerned.", + "itemtype": "property", + "name": "__key", + "access": "private", + "tagname": "", + "type": "String", + "default": "null", + "class": "photonui.KeyboardManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/keyboardmanager.js", + "line": 220, + "description": "KeyCode correspondance to key name.", + "itemtype": "property", + "name": "__keyCache", + "access": "private", + "tagname": "", + "type": "Array", + "class": "photonui.KeyboardManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/keyboardmanager.js", + "line": 229, + "description": "Key name correspondance to key code.", + "itemtype": "property", + "name": "__keyCodeCache", + "access": "private", + "tagname": "", + "type": "Array", + "class": "photonui.KeyboardManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/keyboardmanager.js", + "line": 244, + "description": "Bind events on the HTML Element.", + "itemtype": "method", + "name": "_updateEvents", + "access": "private", + "tagname": "", + "class": "photonui.KeyboardManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/keyboardmanager.js", + "line": 268, + "description": "Check if a specific key is currently pressed.", + "itemtype": "method", + "name": "isKeyPressed", + "params": [ + { + "name": "key", + "description": "The key name", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "photonui.KeyboardManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/keyboardmanager.js", + "line": 280, + "description": "Check if a specific key is currently released.", + "itemtype": "method", + "name": "isKeyReleased", + "params": [ + { + "name": "key", + "description": "The key name", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "photonui.KeyboardManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/keyboardmanager.js", + "line": 294, + "description": "Take a snapshot of the KeyboardManager", + "itemtype": "method", + "name": "_dump", + "access": "private", + "tagname": "", + "return": { + "description": "", + "type": "Object" + }, + "class": "photonui.KeyboardManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/keyboardmanager.js", + "line": 309, + "description": "Check if the user has not focused an input element", + "itemtype": "method", + "name": "_checkFocus", + "access": "private", + "tagname": "", + "return": { + "description": "", + "type": "Boolean" + }, + "class": "photonui.KeyboardManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/keyboardmanager.js", + "line": 322, + "description": "Check the validity of the keyboard event", + "itemtype": "method", + "name": "_checkEvent", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "The keyboard event", + "type": "KeyboardEvent" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "photonui.KeyboardManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/keyboardmanager.js", + "line": 343, + "description": "Create the key correspondance cache for basic touches", + "itemtype": "method", + "name": "_initKeyCache", + "access": "private", + "tagname": "", + "class": "photonui.KeyboardManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/keyboardmanager.js", + "line": 431, + "description": "Get the key name from a native keyboard event", + "itemtype": "method", + "name": "_keyFromEvent", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "The keyboard event", + "type": "KeyboardEvent" + } + ], + "return": { + "description": "", + "type": "String" + }, + "class": "photonui.KeyboardManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/keyboardmanager.js", + "line": 452, + "description": "Used to grab all keyboard events", + "itemtype": "method", + "name": "__onDocumentKeyDown", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "" + } + ], + "class": "photonui.KeyboardManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/keyboardmanager.js", + "line": 474, + "description": "Used to grab all keyboard events", + "itemtype": "method", + "name": "__onDocumentKeyUp", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "" + } + ], + "class": "photonui.KeyboardManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/keyboardmanager.js", + "line": 496, + "description": "Called when the window loose focus", + "itemtype": "method", + "name": "__onWindowBlur", + "access": "private", + "tagname": "", + "class": "photonui.KeyboardManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/mousemanager.js", + "line": 143, + "description": "The HTML Element on which the events are binded.\n\nNOTE: If a photonui.Widget object is assigned to this property,\n its HTML Element will be automatically assigned to the property instead.", + "itemtype": "property", + "name": "element", + "type": "HTMLElement", + "default": "null", + "class": "photonui.MouseManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/mousemanager.js", + "line": 170, + "description": "Minimum distance for triggering a drag-start, and maximum distance\nto consider a mouse down/up as a click.", + "itemtype": "property", + "name": "threshold", + "type": "Number", + "default": "5", + "class": "photonui.MouseManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/mousemanager.js", + "line": 188, + "description": "Scale all position events by a factor. Use it when the canvas is scaled.", + "itemtype": "property", + "name": "scaleX", + "type": "Number", + "default": "1", + "class": "photonui.MouseManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/mousemanager.js", + "line": 205, + "description": "Scale all position events by a factor. Use it when the canvas is scaled.", + "itemtype": "property", + "name": "scaleY", + "type": "Number", + "default": "1", + "class": "photonui.MouseManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/mousemanager.js", + "line": 222, + "description": "Translate all position events by a scalar. Use it when the canvas is translated.", + "itemtype": "property", + "name": "translateX", + "type": "Number", + "default": "0", + "class": "photonui.MouseManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/mousemanager.js", + "line": 239, + "description": "Translate all position events by a scalar. Use it when the canvas is translated.", + "itemtype": "property", + "name": "translateY", + "type": "Number", + "default": "0", + "class": "photonui.MouseManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/mousemanager.js", + "line": 256, + "description": "X position, relative to page top-left corner.", + "itemtype": "property", + "name": "pageX", + "readonly": "", + "type": "Number", + "default": "0", + "class": "photonui.MouseManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/mousemanager.js", + "line": 268, + "description": "Y position, relative to page top-left corner.", + "itemtype": "property", + "name": "pageY", + "readonly": "", + "type": "Number", + "default": "0", + "class": "photonui.MouseManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/mousemanager.js", + "line": 280, + "description": "X position, relative to the HTML element.", + "itemtype": "property", + "name": "x", + "readonly": "", + "type": "Number", + "class": "photonui.MouseManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/mousemanager.js", + "line": 292, + "description": "Y position, relative to the HTML element.", + "itemtype": "property", + "name": "y", + "readonly": "", + "type": "Number", + "class": "photonui.MouseManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/mousemanager.js", + "line": 304, + "description": "Delta X (current_x - previous_x).", + "itemtype": "property", + "name": "deltaX", + "readonly": "", + "type": "Number", + "class": "photonui.MouseManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/mousemanager.js", + "line": 316, + "description": "Delta Y (current_y - previous_y).", + "itemtype": "property", + "name": "deltaY", + "readonly": "", + "type": "Number", + "class": "photonui.MouseManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/mousemanager.js", + "line": 328, + "description": "The action:\n\n * \"mouse-down\"\n * \"moues-up\"\n * \"click\"\n * \"double-click\"\n * \"drag-start\"\n * \"dragging\"\n * \"drag-end\"\n * \"scroll-down\"\n * \"scroll-up\"\n * \"mouse-move\"", + "itemtype": "property", + "name": "action", + "readonly": "", + "type": "String", + "class": "photonui.MouseManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/mousemanager.js", + "line": 352, + "description": "Current state of the mouse left button.", + "itemtype": "property", + "name": "btnLeft", + "type": "Boolean", + "readonly": "", + "class": "photonui.MouseManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/mousemanager.js", + "line": 365, + "description": "Current state of the mouse middle button.", + "itemtype": "property", + "name": "btnMiddle", + "type": "Boolean", + "readonly": "", + "class": "photonui.MouseManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/mousemanager.js", + "line": 378, + "description": "Current state of the mouse right button.", + "itemtype": "property", + "name": "btnRight", + "type": "Boolean", + "readonly": "", + "class": "photonui.MouseManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/mousemanager.js", + "line": 391, + "description": "The button that triggered the last event.\n\n * none\n * \"left\"\n * \"middle\"\n * \"right\"", + "itemtype": "property", + "name": "button", + "readonly": "", + "type": "String", + "class": "photonui.MouseManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/mousemanager.js", + "line": 411, + "description": "Previous state.", + "itemtype": "property", + "name": "__prevState", + "access": "private", + "tagname": "", + "type": "Object", + "class": "photonui.MouseManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/mousemanager.js", + "line": 420, + "description": "Js event on mouse down.", + "itemtype": "property", + "name": "__mouseDownEvent", + "access": "private", + "tagname": "", + "type": "Object", + "class": "photonui.MouseManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/mousemanager.js", + "line": 429, + "description": "Last event object.", + "itemtype": "property", + "name": "__event", + "access": "private", + "tagname": "", + "type": "Object", + "default": "{}", + "class": "photonui.MouseManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/mousemanager.js", + "line": 439, + "description": "The button that triggered the drag start event\n\n * null\n * \"left\"\n * \"middle\"\n * \"right\"", + "itemtype": "property", + "name": "__dragStartButton", + "access": "private", + "tagname": "", + "type": "String", + "default": "null", + "class": "photonui.MouseManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/mousemanager.js", + "line": 458, + "description": "Bind events on the HTML Element.", + "itemtype": "method", + "name": "_updateEvents", + "access": "private", + "tagname": "", + "class": "photonui.MouseManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/mousemanager.js", + "line": 484, + "description": "Take a snapshot of the MouseManager", + "itemtype": "method", + "name": "_dump", + "access": "private", + "tagname": "", + "return": { + "description": "", + "type": "Object" + }, + "class": "photonui.MouseManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/mousemanager.js", + "line": 508, + "description": "Analyze and dispatche wEvents.", + "itemtype": "method", + "name": "_stateMachine", + "access": "private", + "tagname": "", + "params": [ + { + "name": "action", + "description": "The action name (e.g. \"mouse-up\").", + "type": "String" + }, + { + "name": "event", + "description": "The js event.", + "type": "Object" + } + ], + "class": "photonui.MouseManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/mousemanager.js", + "line": 644, + "itemtype": "method", + "name": "__onMouseDown", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "" + } + ], + "class": "photonui.MouseManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/mousemanager.js", + "line": 653, + "itemtype": "method", + "name": "__onMouseUp", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "" + } + ], + "class": "photonui.MouseManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/mousemanager.js", + "line": 662, + "itemtype": "method", + "name": "__onDoubleClick", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "" + } + ], + "class": "photonui.MouseManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/mousemanager.js", + "line": 671, + "itemtype": "method", + "name": "__onMouseMove", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "" + } + ], + "class": "photonui.MouseManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/mousemanager.js", + "line": 680, + "description": "Used to detect drag-end outside the element.", + "itemtype": "method", + "name": "__onDocumentMouseUp", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "" + } + ], + "class": "photonui.MouseManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/mousemanager.js", + "line": 701, + "description": "Used to detect dragging outside the element.", + "itemtype": "method", + "name": "__onDocumentMouseMove", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "" + } + ], + "class": "photonui.MouseManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/mousemanager.js", + "line": 717, + "itemtype": "method", + "name": "__onWheel", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "" + } + ], + "class": "photonui.MouseManager", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/spritesheet.js", + "line": 64, + "description": "The spritesheet name.", + "itemtype": "property", + "name": "name", + "type": "String", + "default": "\"default\"", + "class": "photonui.SpriteSheet", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/spritesheet.js", + "line": 86, + "description": "The spritesheet image URL.", + "itemtype": "property", + "name": "imageUrl", + "type": "String", + "default": "null", + "class": "photonui.SpriteSheet", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/spritesheet.js", + "line": 112, + "description": "Icon size (width = height).", + "itemtype": "property", + "name": "size", + "type": "Number", + "default": "16", + "class": "photonui.SpriteSheet", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/spritesheet.js", + "line": 129, + "description": "Icons.\n\n {\n \"iconName\": [x, y],\n \"icon2\": [x2, y2],\n ...\n }", + "itemtype": "property", + "name": "icons", + "type": "Object", + "default": ": {}", + "class": "photonui.SpriteSheet", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/spritesheet.js", + "line": 160, + "description": "Get icon position.", + "itemtype": "method", + "name": "getIconPosition", + "params": [ + { + "name": "iconName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "`{x: Number, y: Number}`", + "type": "Object" + }, + "class": "photonui.SpriteSheet", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/spritesheet.js", + "line": 171, + "description": "Get the right CSS for the given icon.", + "itemtype": "method", + "name": "getIconCss", + "params": [ + { + "name": "iconName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "the CSS.", + "type": "String" + }, + "class": "photonui.SpriteSheet", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/spritesheet.js", + "line": 186, + "description": "Add an icon (set its position).", + "itemtype": "method", + "name": "addIcon", + "params": [ + { + "name": "iconName", + "description": "", + "type": "String" + }, + { + "name": "x", + "description": "", + "type": "Number" + }, + { + "name": "y", + "description": "", + "type": "Number" + } + ], + "class": "photonui.SpriteSheet", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/spritesheet.js", + "line": 198, + "description": "Remove an icon.", + "itemtype": "method", + "name": "removeIcon", + "params": [ + { + "name": "iconName", + "description": "", + "type": "String" + } + ], + "class": "photonui.SpriteSheet", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/translation.js", + "line": 80, + "description": "The current locale (e.g. \"fr\", \"en\", \"it\",...).", + "itemtype": "property", + "name": "locale", + "type": "String", + "default": "null", + "class": "photonui.Translation", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/translation.js", + "line": 96, + "description": "Find and set the best language for the user (depending on available catalogs and given language list).", + "itemtype": "method", + "name": "setBestMatchingLocale", + "params": [ + { + "name": "locales", + "description": "Language list (optional, e.g. `\"fr\"`, `[\"fr\", \"fr_FR\", \"en_US\"]`).", + "type": "Array|String" + } + ], + "class": "photonui.Translation", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/translation.js", + "line": 104, + "description": "Add one or more Stone.js catalog (a catalog contain all translated strings for a specific locale).", + "itemtype": "method", + "name": "addCatalogs", + "params": [ + { + "name": "catalogs", + "description": "", + "type": "Object" + } + ], + "class": "photonui.Translation", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/translation.js", + "line": 112, + "description": "Guess the user language.", + "itemtype": "method", + "name": "guessUserLanguage", + "return": { + "description": "The language code (e.g. \"en\", \"fr\", \"it\",...)", + "type": "String" + }, + "class": "photonui.Translation", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/translation.js", + "line": 120, + "description": "Make a string translatable.", + "itemtype": "method", + "name": "gettext", + "params": [ + { + "name": "string", + "description": "the Translatable string", + "type": "String" + }, + { + "name": "replacements", + "description": "An object that contain replacements for the string.", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "String" + }, + "class": "photonui.Translation", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/translation.js", + "line": 130, + "description": "Make a string translatable.\n\nThe main difference between this method and the `gettext` method is\nthat this method does not return a translated sting but an object that\nwill translate the sting when it will be displayed (.toString() method\ncalled).", + "itemtype": "method", + "name": "lazyGettext", + "params": [ + { + "name": "string", + "description": "the Translatable string", + "type": "String" + }, + { + "name": "replacements", + "description": "An object that contain replacements for the string.", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "LazyString" + }, + "class": "photonui.Translation", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/translation.js", + "line": 145, + "description": "Enable/disable Stone.js translating elements with the \"stonejs\" attribute in the DOM.", + "itemtype": "method", + "name": "enableDomScan", + "params": [ + { + "name": "boolean", + "description": "Enable or disable DOM scanning.", + "type": "Boolean" + } + ], + "class": "photonui.Translation", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/translation.js", + "line": 153, + "description": "Re-translate elements with the \"stonejs\" attribute in the DOM.", + "itemtype": "method", + "name": "updateDomTranslation", + "class": "photonui.Translation", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/nonvisual/translation.js", + "line": 164, + "itemtype": "method", + "name": "__onStonejsLocaleChanged", + "access": "private", + "tagname": "", + "class": "photonui.Translation", + "module": "PhotonUI", + "submodule": "NonVisual", + "namespace": "photonui" + }, + { + "file": "src/visual/baseicon.js", + "line": 54, + "description": "Called when the locale is changed.", + "itemtype": "method", + "name": "__onLocaleChanged", + "access": "private", + "tagname": "", + "class": "photonui.BaseIcon", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/canvas.js", + "line": 57, + "description": "Returns a drawing context on the canvas.\n\nProxy of the native canvas method. For more informations see:\n\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement", + "itemtype": "method", + "name": "getContext", + "params": [ + { + "name": "contextId", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The drawing context." + }, + "class": "photonui.Canvas", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/canvas.js", + "line": 70, + "description": "Indicate if the given context is supported by this canvas.\n\nProxy of the native canvas method if exists. For more informations see:\n\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement", + "itemtype": "method", + "name": "supportsContext", + "params": [ + { + "name": "contextId", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "photonui.Canvas", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/canvas.js", + "line": 85, + "description": "Changes the context the element is related to to the given one.\n\nProxy of the native canvas method if exists. For more informations see:\n\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement", + "itemtype": "method", + "name": "setContext", + "params": [ + { + "name": "contextId", + "description": "", + "type": "String" + } + ], + "class": "photonui.Canvas", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/canvas.js", + "line": 99, + "description": "Gives back a proxy to allow the canvas to be used in another Worker.\n\nProxy of the native canvas method if exists. For more informations see:\n\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement", + "itemtype": "method", + "name": "transferControlToProxy", + "class": "photonui.Canvas", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/canvas.js", + "line": 112, + "description": "Returns a \"data:\" URL containing a representation of the image (at 96dpi).\n\nProxy of the native canvas method. For more informations see:\n\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement", + "itemtype": "method", + "name": "toDataURL", + "params": [ + { + "name": "type", + "description": "The image format (optional, e.g: \"image/png\", \"image/jpeg\",..., default=\"image/png\")", + "type": "String" + } + ], + "return": { + "description": "The data URL", + "type": "String" + }, + "class": "photonui.Canvas", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/canvas.js", + "line": 125, + "description": "Returns a \"data:\" URL containing a representation of the image (at the native resolution of the canvas).\n\nProxy of the native canvas method if exists. For more informations see:\n\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement", + "itemtype": "method", + "name": "toDataURLHD", + "params": [ + { + "name": "type", + "description": "The image format (optional, e.g: \"image/png\", \"image/jpeg\",..., default=\"image/png\")", + "type": "String" + } + ], + "return": { + "description": "The data URL", + "type": "String" + }, + "class": "photonui.Canvas", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/canvas.js", + "line": 140, + "description": "Returns a Blob object representing the image contained in the canvas (at 96dpi).\n\nProxy of the native canvas method if exists. For more informations see:\n\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement", + "itemtype": "method", + "name": "toBlob", + "params": [ + { + "name": "type", + "description": "The image format (optional, e.g: \"image/png\", \"image/jpeg\",..., default=\"image/png\")", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Blob" + }, + "class": "photonui.Canvas", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/canvas.js", + "line": 155, + "description": "Returns a Blob object representing the image contained in the canvas (at the native\nresolution of the canvas).\n\nProxy of the native canvas method if exists. For more informations see:\n\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement", + "itemtype": "method", + "name": "toBlobHD", + "params": [ + { + "name": "type", + "description": "The image format (optional, e.g: \"image/png\", \"image/jpeg\",..., default=\"image/png\")", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Blob" + }, + "class": "photonui.Canvas", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/canvas.js", + "line": 178, + "description": "Canvas width.", + "itemtype": "property", + "name": "width", + "type": "Number\ndefault 300", + "class": "photonui.Canvas", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/canvas.js", + "line": 194, + "description": "Canvas height.", + "itemtype": "property", + "name": "height", + "type": "Number\ndefault 150", + "class": "photonui.Canvas", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/canvas.js", + "line": 210, + "description": "The Canvas HTML Element.", + "itemtype": "property", + "name": "canvas", + "readonly": "", + "type": "HTMLElement", + "class": "photonui.Canvas", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/canvas.js", + "line": 221, + "description": "Html outer element of the widget (if any).", + "itemtype": "property", + "name": "html", + "type": "HTMLElement", + "default": "null", + "readonly": "", + "class": "photonui.Canvas", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/canvas.js", + "line": 233, + "description": "The interactive HTML element (for event managers).", + "itemtype": "property", + "name": "interactiveNode", + "type": "HTMLElement", + "readonly": "", + "class": "photonui.Canvas", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/canvas.js", + "line": 250, + "description": "Build the widget HTML.", + "itemtype": "method", + "name": "_buildHtml", + "access": "private", + "tagname": "", + "class": "photonui.Canvas", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/canvas.js", + "line": 268, + "description": "Called when the locale is changed.", + "itemtype": "method", + "name": "__onLocaleChanged", + "access": "private", + "tagname": "", + "class": "photonui.Canvas", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/faicon.js", + "line": 77, + "description": "The Font Awesome icon name (e.g. \"fa-cog\").\n\nIcon list: http://fontawesome.io/icons/", + "itemtype": "property", + "name": "iconName", + "type": "String", + "default": "\"\"", + "class": "photonui.FAIcon", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/faicon.js", + "line": 98, + "description": "Font Awesome icon size (e.g. \"fa-2x\").\n\nIcon sizes list: http://fontawesome.io/examples/#larger", + "itemtype": "property", + "name": "size", + "type": "String", + "default": "\"\"", + "class": "photonui.FAIcon", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/faicon.js", + "line": 119, + "description": "The icon color.", + "itemtype": "property", + "name": "color", + "type": "String\ndefault: \"inherit\"", + "class": "photonui.FAIcon", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/faicon.js", + "line": 138, + "description": "Html outer element of the widget (if any).", + "itemtype": "property", + "name": "html", + "type": "HTMLElement", + "default": "null", + "readonly": "", + "class": "photonui.FAIcon", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/faicon.js", + "line": 156, + "description": "Build the widget HTML.", + "itemtype": "method", + "name": "_buildHtml", + "access": "private", + "tagname": "", + "class": "photonui.FAIcon", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/image.js", + "line": 57, + "description": "The image URL.", + "itemtype": "property", + "name": "url", + "type": "String", + "default": "\"\"", + "class": "photonui.Image", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/image.js", + "line": 75, + "description": "The image width (null = auto).", + "itemtype": "property", + "name": "width", + "type": "Number", + "default": "null", + "class": "photonui.Image", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/image.js", + "line": 97, + "description": "The image height (null = auto).", + "itemtype": "property", + "name": "height", + "type": "Number", + "default": "null", + "class": "photonui.Image", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/image.js", + "line": 119, + "description": "Html outer element of the widget (if any).", + "itemtype": "property", + "name": "html", + "type": "HTMLElement", + "default": "null", + "readonly": "", + "class": "photonui.Image", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/image.js", + "line": 137, + "description": "Build the widget HTML.", + "itemtype": "method", + "name": "_buildHtml", + "access": "private", + "tagname": "", + "class": "photonui.Image", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/label.js", + "line": 77, + "description": "The label text.", + "itemtype": "property", + "name": "text", + "type": "String", + "default": "\"Label\"", + "class": "photonui.Label", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/label.js", + "line": 106, + "description": "The text horizontal alignement.\n\n * \"left\",\n * \"center\",\n * \"right\".", + "itemtype": "property", + "name": "textAlign", + "type": "String", + "default": "\"left\"", + "class": "photonui.Label", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/label.js", + "line": 132, + "description": "Link the label with the given input (Field, CheckBox,...) widget.", + "itemtype": "property", + "name": "forInputName", + "type": "String", + "default": "null", + "class": "photonui.Label", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/label.js", + "line": 163, + "description": "Link the label with the given input (Field, CheckBox,...) widget.", + "itemtype": "property", + "name": "forInput", + "type": "photonui.Field, photonui.CheckBox", + "default": "null", + "class": "photonui.Label", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/label.js", + "line": 178, + "description": "Html outer element of the widget (if any).", + "itemtype": "property", + "name": "html", + "type": "HTMLElement", + "default": "null", + "readonly": "", + "class": "photonui.Label", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/label.js", + "line": 196, + "description": "Build the widget HTML.", + "itemtype": "method", + "name": "_buildHtml", + "access": "private", + "tagname": "", + "class": "photonui.Label", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/progressbar.js", + "line": 61, + "description": "Html outer element of the widget (if any).", + "itemtype": "property", + "name": "html", + "type": "HTMLElement", + "default": "null", + "readonly": "", + "class": "photonui.ProgressBar", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/progressbar.js", + "line": 79, + "description": "The progression (form 0.00 to 1.00).", + "itemtype": "property", + "name": "value", + "type": "Number", + "default": "0", + "class": "photonui.ProgressBar", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/progressbar.js", + "line": 105, + "description": "The progressbar orientation (\"vertical\" or \"horizontal\").", + "itemtype": "property", + "name": "orientation", + "type": "String", + "default": "\"horizontal\"", + "class": "photonui.ProgressBar", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/progressbar.js", + "line": 132, + "description": "Enable or disable the progressbar pulsate mode.", + "itemtype": "property", + "name": "pulsate", + "type": "Boolean", + "default": "false", + "class": "photonui.ProgressBar", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/progressbar.js", + "line": 161, + "description": "Display/hide the progression text.", + "itemtype": "property", + "name": "textVisible", + "type": "Boolean", + "default": "true", + "class": "photonui.ProgressBar", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/progressbar.js", + "line": 183, + "description": "Build the widget HTML.", + "itemtype": "method", + "name": "_buildHtml", + "access": "private", + "tagname": "", + "class": "photonui.ProgressBar", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/progressbar.js", + "line": 217, + "description": "Called when the locale is changed.", + "itemtype": "method", + "name": "__onLocaleChanged", + "access": "private", + "tagname": "", + "class": "photonui.ProgressBar", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/separator.js", + "line": 61, + "description": "The separator orientation (\"vertical\" or \"horizontal\").", + "itemtype": "property", + "name": "orientation", + "type": "String", + "default": "\"horizontal\"", + "class": "photonui.Separator", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/separator.js", + "line": 93, + "description": "Html outer element of the widget (if any).", + "itemtype": "property", + "name": "html", + "type": "HTMLElement", + "default": "null", + "readonly": "", + "class": "photonui.Separator", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/separator.js", + "line": 111, + "description": "Build the widget HTML.", + "itemtype": "method", + "name": "_buildHtml", + "access": "private", + "tagname": "", + "class": "photonui.Separator", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/separator.js", + "line": 128, + "description": "Called when the locale is changed.", + "itemtype": "method", + "name": "__onLocaleChanged", + "access": "private", + "tagname": "", + "class": "photonui.Separator", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/spriteicon.js", + "line": 78, + "description": "The sprite sheet name.", + "itemtype": "property", + "name": "spriteSheetName", + "type": "String", + "default": "\"\"", + "class": "photonui.SpriteIcon", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/spriteicon.js", + "line": 96, + "description": "The icon name.", + "itemtype": "property", + "name": "iconName", + "type": "String", + "default": "\"\"", + "class": "photonui.SpriteIcon", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/spriteicon.js", + "line": 114, + "description": "The icon id.\n\n \"spriteSheetName/iconName\"", + "itemtype": "property", + "name": "icon", + "type": "String", + "default": "\"/\"", + "class": "photonui.SpriteIcon", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/spriteicon.js", + "line": 133, + "description": "Html outer element of the widget (if any).", + "itemtype": "property", + "name": "html", + "type": "HTMLElement", + "default": "null", + "readonly": "", + "class": "photonui.SpriteIcon", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/spriteicon.js", + "line": 151, + "description": "Update the icon.", + "itemtype": "method", + "name": "_update", + "access": "private", + "tagname": "", + "class": "photonui.SpriteIcon", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/spriteicon.js", + "line": 165, + "description": "Build the widget HTML.", + "itemtype": "method", + "name": "_buildHtml", + "access": "private", + "tagname": "", + "class": "photonui.SpriteIcon", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/template.js", + "line": 68, + "description": "The template.", + "itemtype": "property", + "name": "template", + "type": "String", + "default": "\"\"", + "class": "photonui.Template", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/template.js", + "line": 97, + "description": "Html outer element of the widget (if any).", + "itemtype": "property", + "name": "html", + "type": "HTMLElement", + "default": "null", + "readonly": "", + "class": "photonui.Template", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/template.js", + "line": 115, + "description": "Update the template (NOTE: the template is automatically updated when you change data)", + "itemtype": "method", + "name": "update", + "class": "photonui.Template", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/template.js", + "line": 134, + "description": "Build the widget HTML.", + "itemtype": "method", + "name": "_buildHtml", + "access": "private", + "tagname": "", + "class": "photonui.Template", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/text.js", + "line": 62, + "description": "Text", + "itemtype": "property", + "name": "text", + "type": "String", + "default": "\"\"", + "class": "photonui.Text", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/text.js", + "line": 80, + "description": "Raw HTML.", + "itemtype": "property", + "name": "rawHtml", + "type": "String", + "default": "\"\"", + "class": "photonui.Text", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/text.js", + "line": 97, + "description": "Html outer element of the widget (if any).", + "itemtype": "property", + "name": "html", + "type": "HTMLElement", + "default": "null", + "readonly": "", + "class": "photonui.Text", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/text.js", + "line": 115, + "description": "Build the widget HTML.", + "itemtype": "method", + "name": "_buildHtml", + "access": "private", + "tagname": "", + "class": "photonui.Text", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/visual/text.js", + "line": 130, + "description": "Called when the locale is changed.", + "itemtype": "method", + "name": "__onLocaleChanged", + "access": "private", + "tagname": "", + "class": "photonui.Text", + "module": "PhotonUI", + "submodule": "Visual", + "namespace": "photonui" + }, + { + "file": "src/base.js", + "line": 113, + "description": "Arbitrary data", + "itemtype": "property", + "name": "data", + "type": "object", + "default": "{}", + "class": "photonui.Base", + "module": "PhotonUI", + "namespace": "photonui" + }, + { + "file": "src/base.js", + "line": 132, + "description": "Object containing references javascript events binding (for widget\ninternal use).", + "itemtype": "property", + "name": "__events", + "type": "Object", + "access": "private", + "tagname": "", + "class": "photonui.Base", + "module": "PhotonUI", + "namespace": "photonui" + }, + { + "file": "src/base.js", + "line": 142, + "description": "Object containing references to registered callbacks.", + "itemtype": "property", + "name": "__callbacks", + "type": "Object", + "access": "private", + "tagname": "", + "class": "photonui.Base", + "module": "PhotonUI", + "namespace": "photonui" + }, + { + "file": "src/base.js", + "line": 157, + "description": "Destroy the class.", + "itemtype": "method", + "name": "destroy", + "class": "photonui.Base", + "module": "PhotonUI", + "namespace": "photonui" + }, + { + "file": "src/base.js", + "line": 169, + "description": "Register a callback for any PhotonUI/Widget event (called wEvent).\n\nCallback signature:\n\n function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]])", + "itemtype": "method", + "name": "registerCallback", + "params": [ + { + "name": "id", + "description": "An unique id for the callback.", + "type": "String" + }, + { + "name": "wEvent", + "description": "the PhotonUI/Widget event name.", + "type": "String" + }, + { + "name": "callback", + "description": "The callback function.", + "type": "Function" + }, + { + "name": "thisArg", + "description": "The value of this (optionnal, default = current widget).", + "type": "Object" + } + ], + "class": "photonui.Base", + "module": "PhotonUI", + "namespace": "photonui" + }, + { + "file": "src/base.js", + "line": 193, + "description": "Remove a registered callback.", + "itemtype": "method", + "name": "removeCallback", + "params": [ + { + "name": "id", + "description": "The id of the callback.", + "type": "String" + } + ], + "class": "photonui.Base", + "module": "PhotonUI", + "namespace": "photonui" + }, + { + "file": "src/base.js", + "line": 209, + "description": "Force the update of the given properties.\n\nThis method is deprecated.\nOne should use '@photonui-update' abitbol's annotation on concerned properties.", + "itemtype": "method", + "name": "_updateProperties", + "access": "private", + "tagname": "", + "deprecated": true, + "params": [ + { + "name": "properties", + "description": "The properties to update.", + "type": "Array" + } + ], + "class": "photonui.Base", + "module": "PhotonUI", + "namespace": "photonui" + }, + { + "file": "src/base.js", + "line": 229, + "description": "Javascript event binding (for internal use).", + "itemtype": "method", + "name": "_bindEvent", + "access": "private", + "tagname": "", + "params": [ + { + "name": "id", + "description": "An unique id for the event.", + "type": "String" + }, + { + "name": "element", + "description": "The element on which the event will be bind.", + "type": "DOMElement" + }, + { + "name": "evName", + "description": "The event name (e.g. \"mousemove\", \"click\",...).", + "type": "String" + }, + { + "name": "callback", + "description": "The function that will be called when the event occured.", + "type": "Function" + }, + { + "name": "options", + "description": "options for `addEventListener`", + "type": "Object", + "optional": true + } + ], + "class": "photonui.Base", + "module": "PhotonUI", + "namespace": "photonui" + }, + { + "file": "src/base.js", + "line": 257, + "description": "Unbind javascript event.", + "itemtype": "method", + "name": "_unbindEvent", + "access": "private", + "tagname": "", + "params": [ + { + "name": "id", + "description": "The id of the event.", + "type": "String" + } + ], + "class": "photonui.Base", + "module": "PhotonUI", + "namespace": "photonui" + }, + { + "file": "src/base.js", + "line": 276, + "description": "Register available wEvent.", + "itemtype": "method", + "name": "_registerWEvents", + "access": "private", + "tagname": "", + "params": [ + { + "name": "wEvents", + "description": "", + "type": "Array" + } + ], + "class": "photonui.Base", + "module": "PhotonUI", + "namespace": "photonui" + }, + { + "file": "src/base.js", + "line": 292, + "description": "Call all callbacks for the given wEvent.\n\nNOTE: the first argument passed to the callback is the current widget.\nNOTE²: if the thisArg of the callback is null, this will be binded to the current widget.", + "itemtype": "method", + "name": "_callCallbacks", + "access": "private", + "tagname": "", + "params": [ + { + "name": "wEvent", + "description": "The widget event.", + "type": "String" + }, + { + "name": "params", + "description": "Parametters that will be sent to the callbacks.", + "type": "Array" + } + ], + "class": "photonui.Base", + "module": "PhotonUI", + "namespace": "photonui" + }, + { + "file": "src/helpers.js", + "line": 51, + "description": "Escape HTML.", + "itemtype": "method", + "name": "escapeHtml", + "static": 1, + "params": [ + { + "name": "string", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "String" + }, + "class": "photonui.Helpers", + "module": "PhotonUI", + "submodule": "Helpers", + "namespace": "photonui" + }, + { + "file": "src/helpers.js", + "line": 66, + "description": "Generate an UUID version 4 (RFC 4122).\n\nThis method is deprecated, please use `photonui.lib.uuid.v4()` instead.", + "itemtype": "method", + "name": "uuid4", + "static": 1, + "deprecated": true, + "return": { + "description": "The generated UUID", + "type": "String" + }, + "class": "photonui.Helpers", + "module": "PhotonUI", + "submodule": "Helpers", + "namespace": "photonui" + }, + { + "file": "src/helpers.js", + "line": 81, + "description": "Clean node (remove all children of the node).", + "itemtype": "method", + "name": "cleanNode", + "static": 1, + "params": [ + { + "name": "node", + "description": "", + "type": "HTMLElement" + } + ], + "class": "photonui.Helpers", + "module": "PhotonUI", + "submodule": "Helpers", + "namespace": "photonui" + }, + { + "file": "src/helpers.js", + "line": 94, + "description": "Get the absolute position of an HTML Element.", + "itemtype": "method", + "name": "getAbsolutePosition", + "static": 1, + "params": [ + { + "name": "element", + "description": "The HTML element (or its id)", + "type": "HTMLElement" + } + ], + "return": { + "description": "`{x: , y: }", + "type": "Object" + }, + "class": "photonui.Helpers", + "module": "PhotonUI", + "submodule": "Helpers", + "namespace": "photonui" + }, + { + "file": "src/helpers.js", + "line": 149, + "description": "Check and compute size to valid CSS size\n\nValid values and transformations:\n undefined -> defaultValue\n null -> \"auto\" (if \"auto\" is alowed, \"0px\" else)\n +Infinity -> \"100%\"\n Number -> \"px\"", + "itemtype": "method", + "name": "numberToCssSize", + "static": 1, + "params": [ + { + "name": "value", + "description": "", + "type": "Number" + }, + { + "name": "defaultValue", + "description": "(opt, default=nullValue)", + "type": "Number" + }, + { + "name": "nullValue", + "description": "(opt, default=\"auto\")", + "type": "String" + } + ], + "return": { + "description": "sanitized version of the size.", + "type": "String" + }, + "class": "photonui.Helpers", + "module": "PhotonUI", + "submodule": "Helpers", + "namespace": "photonui" + }, + { + "file": "src/helpers.js", + "line": 181, + "description": "Write log into the terminal.", + "itemtype": "method", + "name": "log", + "static": 1, + "params": [ + { + "name": "level", + "description": "The log level (\"info\", \"warn\", \"error\", ...)", + "type": "String" + }, + { + "name": "message", + "description": "The message to log", + "type": "String" + } + ], + "class": "photonui.Helpers", + "module": "PhotonUI", + "submodule": "Helpers", + "namespace": "photonui" + }, + { + "file": "src/helpers.js", + "line": 205, + "description": "Get the closest matching element up the DOM tree.\nhttps://gomakethings.com/climbing-up-and-down-the-dom-tree-with-vanilla-javascript/", + "itemtype": "method", + "name": "getClosest", + "params": [ + { + "name": "elem", + "description": "Starting element", + "type": "Element" + }, + { + "name": "selector", + "description": "Selector to match against", + "type": "String" + } + ], + "return": { + "description": "Returns null if not match found", + "type": "Boolean|Element" + }, + "class": "photonui.Helpers", + "module": "PhotonUI", + "submodule": "Helpers", + "namespace": "photonui" + }, + { + "file": "src/widget.js", + "line": 109, + "description": "The unique name of the widget.", + "itemtype": "property", + "name": "name", + "type": "String", + "default": "\"widget-\" + uuid.v4()", + "class": "photonui.Widget", + "module": "PhotonUI", + "namespace": "photonui" + }, + { + "file": "src/widget.js", + "line": 131, + "description": "The parent widget name.", + "itemtype": "property", + "name": "parentName", + "type": "String", + "readonly": "", + "default": "null (no parent)", + "class": "photonui.Widget", + "module": "PhotonUI", + "namespace": "photonui" + }, + { + "file": "src/widget.js", + "line": 145, + "description": "The parent widget.", + "itemtype": "property", + "name": "parent", + "type": "photonui.Widget", + "readonly": "", + "default": "null (no parent)", + "class": "photonui.Widget", + "module": "PhotonUI", + "namespace": "photonui" + }, + { + "file": "src/widget.js", + "line": 157, + "description": "Is the widget visible or hidden.", + "itemtype": "property", + "name": "visible", + "type": "Boolean", + "default": "true", + "class": "photonui.Widget", + "module": "PhotonUI", + "namespace": "photonui" + }, + { + "file": "src/widget.js", + "line": 184, + "description": "Tooltip.", + "itemtype": "property", + "name": "tooltip", + "type": "String", + "default": "null", + "class": "photonui.Widget", + "module": "PhotonUI", + "namespace": "photonui" + }, + { + "file": "src/widget.js", + "line": 206, + "description": "The name of the managed contextual menu (`photonui.PopupWindow().name`).", + "itemtype": "property", + "name": "contextMenuName", + "type": "String", + "default": "null (= no context menu)", + "class": "photonui.Widget", + "module": "PhotonUI", + "namespace": "photonui" + }, + { + "file": "src/widget.js", + "line": 223, + "description": "The managed contextual menu.", + "itemtype": "property", + "name": "contextMenu", + "type": "photonui.PopupWindow", + "default": "null (= no context menu)", + "class": "photonui.Widget", + "module": "PhotonUI", + "namespace": "photonui" + }, + { + "file": "src/widget.js", + "line": 243, + "description": "Layout options.", + "itemtype": "property", + "name": "layoutOptions", + "type": "Object", + "default": "{}", + "class": "photonui.Widget", + "module": "PhotonUI", + "namespace": "photonui" + }, + { + "file": "src/widget.js", + "line": 262, + "description": "Html outer element of the widget (if any).", + "itemtype": "property", + "name": "html", + "type": "HTMLElement", + "default": "null", + "readonly": "", + "class": "photonui.Widget", + "module": "PhotonUI", + "namespace": "photonui" + }, + { + "file": "src/widget.js", + "line": 275, + "description": "Absolute position of the widget on the page.\n\n`{x: Number, y: Number}`", + "itemtype": "property", + "name": "absolutePosition", + "type": "Object", + "readonly": "", + "class": "photonui.Widget", + "module": "PhotonUI", + "namespace": "photonui" + }, + { + "file": "src/widget.js", + "line": 291, + "description": "Widget width (outer HTML element).", + "itemtype": "property", + "name": "offsetWidth", + "type": "Number", + "readonly": "", + "class": "photonui.Widget", + "module": "PhotonUI", + "namespace": "photonui" + }, + { + "file": "src/widget.js", + "line": 305, + "description": "Widget height (outer HTML element).", + "itemtype": "property", + "name": "offsetHeight", + "type": "Number", + "readonly": "", + "class": "photonui.Widget", + "module": "PhotonUI", + "namespace": "photonui" + }, + { + "file": "src/widget.js", + "line": 321, + "description": "Object containing references to the widget HTML elements", + "itemtype": "property", + "name": "__html", + "type": "Object", + "access": "private", + "tagname": "", + "class": "photonui.Widget", + "module": "PhotonUI", + "namespace": "photonui" + }, + { + "file": "src/widget.js", + "line": 336, + "description": "Display the widget (equivalent to widget.visible = true).", + "itemtype": "method", + "name": "show", + "class": "photonui.Widget", + "module": "PhotonUI", + "namespace": "photonui" + }, + { + "file": "src/widget.js", + "line": 345, + "description": "Hide the widget (equivalent to widget.visible = false).", + "itemtype": "method", + "name": "hide", + "class": "photonui.Widget", + "module": "PhotonUI", + "namespace": "photonui" + }, + { + "file": "src/widget.js", + "line": 354, + "description": "Detache the widget from its parent.", + "itemtype": "method", + "name": "unparent", + "class": "photonui.Widget", + "module": "PhotonUI", + "namespace": "photonui" + }, + { + "file": "src/widget.js", + "line": 367, + "description": "Destroy the widget.", + "itemtype": "method", + "name": "destroy", + "class": "photonui.Widget", + "module": "PhotonUI", + "namespace": "photonui" + }, + { + "file": "src/widget.js", + "line": 378, + "description": "Add a class to the outer HTML element of the widget.", + "itemtype": "method", + "name": "addClass", + "params": [ + { + "name": "className", + "description": "The class to add.", + "type": "String" + } + ], + "class": "photonui.Widget", + "module": "PhotonUI", + "namespace": "photonui" + }, + { + "file": "src/widget.js", + "line": 395, + "description": "Remove a class from the outer HTML element of the widget.", + "itemtype": "method", + "name": "removeClass", + "params": [ + { + "name": "className", + "description": "The class to remove.", + "type": "String" + } + ], + "class": "photonui.Widget", + "module": "PhotonUI", + "namespace": "photonui" + }, + { + "file": "src/widget.js", + "line": 415, + "description": "Build the widget HTML.", + "itemtype": "method", + "name": "_buildHtml", + "access": "private", + "tagname": "", + "class": "photonui.Widget", + "module": "PhotonUI", + "namespace": "photonui" + }, + { + "file": "src/widget.js", + "line": 425, + "description": "Called when the visibility changes.", + "itemtype": "method", + "name": "_visibilityChanged", + "access": "private", + "tagname": "", + "params": [ + { + "name": "visibility", + "description": "Current visibility state (otptional, defaut=this.visible)", + "type": "Boolean" + } + ], + "class": "photonui.Widget", + "module": "PhotonUI", + "namespace": "photonui" + }, + { + "file": "src/widget.js", + "line": 445, + "description": "Called when the context menu should be displayed.", + "itemtype": "method", + "name": "__onContextMenu", + "access": "private", + "tagname": "", + "params": [ + { + "name": "event", + "description": "" + } + ], + "class": "photonui.Widget", + "module": "PhotonUI", + "namespace": "photonui" + }, + { + "file": "src/widget.js", + "line": 460, + "description": "Called when the locale is changed.", + "itemtype": "method", + "name": "__onLocaleChanged", + "access": "private", + "tagname": "", + "class": "photonui.Widget", + "module": "PhotonUI", + "namespace": "photonui" + }, + { + "file": "src/widget.js", + "line": 477, + "itemtype": "property", + "name": "e_parent", + "static": 1, + "type": "HTMLElement", + "default": "null", + "class": "photonui.Widget", + "module": "PhotonUI", + "namespace": "photonui" + }, + { + "file": "src/widget.js", + "line": 485, + "description": "Get a widget.", + "itemtype": "method", + "name": "getWidget", + "static": 1, + "params": [ + { + "name": "name", + "description": "The widget name.", + "type": "String" + } + ], + "return": { + "description": "The widget or null.", + "type": "Widget" + }, + "class": "photonui.Widget", + "module": "PhotonUI", + "namespace": "photonui" + }, + { + "file": "src/widget.js", + "line": 500, + "description": "Get all instanciated PhotonUI widgets.", + "itemtype": "method", + "name": "getAllWidgets", + "static": 1, + "return": { + "description": "An object containing all widgets `{\"widgetName\": Widget, ...}`", + "type": "Object" + }, + "class": "photonui.Widget", + "module": "PhotonUI", + "namespace": "photonui" + }, + { + "file": "src/widget.js", + "line": 511, + "description": "Insert a widget in the DOM.", + "itemtype": "method", + "name": "domInsert", + "static": 1, + "params": [ + { + "name": "widget", + "description": "The widget to insert.", + "type": "photonui.Widget" + }, + { + "name": "element", + "description": "The DOM node or its id (optional, default=Widget.e_parent)", + "type": "HTMLElement" + } + ], + "class": "photonui.Widget", + "module": "PhotonUI", + "namespace": "photonui" + } + ], + "warnings": [] +} \ No newline at end of file diff --git a/ref/elements/index.html b/ref/elements/index.html new file mode 100644 index 00000000..487fe15b --- /dev/null +++ b/ref/elements/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/ref/files/index.html b/ref/files/index.html new file mode 100644 index 00000000..487fe15b --- /dev/null +++ b/ref/files/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/ref/files/src_base.js.html b/ref/files/src_base.js.html new file mode 100644 index 00000000..57808211 --- /dev/null +++ b/ref/files/src_base.js.html @@ -0,0 +1,481 @@ + + + + + src/base.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/base.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @namespace photonui
+ */
+
+var Class = require("abitbol");
+var uuid = require("uuid");
+
+var Helpers = require("./helpers.js");
+
+/**
+ * Base class for all PhotonUI Classes.
+ *
+ * wEvents:
+ *
+ *   * destroy:
+ *      - description: called before the widget was destroyed.
+ *      - callback:    function (widget)
+ *
+ * @class Base
+ * @constructor
+ * @param {Object} params An object that can contain any property that will be set to the class (optional).
+ */
+var Base = Class.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        // New instances for object properties
+        this.__events = {};
+        this._data = {};
+
+        // wEvents
+        this._registerWEvents(["destroy"]);
+
+        // Apply params
+        params = params || {};
+        for (var param in params) {
+            if (this.$map.computedProperties[param]) {
+                this[param] = params[param];
+            }
+        }
+
+        // Update properties
+        for (var propName in this.$map.computedProperties) {
+            var prop = this.$map.computedProperties[propName];
+            if (params[propName] === undefined &&
+                prop.annotations["photonui-update"] &&
+                prop.get && prop.set) {
+                this[propName] = this[propName];
+            }
+        }
+
+        // Register callbacks
+        var ev = null;
+        var i = 0;
+        var evId = "";
+        if (params.callbacks) {
+            for (var wEvent in params.callbacks) {
+                ev = params.callbacks[wEvent];
+                if (typeof(ev) == "function") {
+                    this.registerCallback(uuid.v4(), wEvent, ev);
+                } else if (ev instanceof Array) {
+                    for (i = 0 ; i < ev.length ; i++) {
+                        this.registerCallback(uuid.v4(), wEvent, ev[i]);
+                    }
+                } else {
+                    for (evId in ev) {
+                        this.registerCallback(evId, wEvent, ev[evId]);
+                    }
+                }
+            }
+        }
+    },
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    /**
+     * Arbitrary data
+     *
+     * @property data
+     * @type object
+     * @default {}
+     */
+    _data: null,
+
+    getData: function () {
+        return this._data;
+    },
+
+    setData: function (data) {
+        this._data = data;
+    },
+
+    // ====== Private properties ======
+
+    /**
+     * Object containing references javascript events binding (for widget
+     * internal use).
+     *
+     * @property __events
+     * @type Object
+     * @private
+     */
+    __events: null,    // Javascript internal event
+
+    /**
+     * Object containing references to registered callbacks.
+     *
+     * @property __callbacks
+     * @type Object
+     * @private
+     */
+    __callbacks: null,  // Registered callback
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Public methods ======
+
+    /**
+     * Destroy the class.
+     *
+     * @method destroy
+     */
+    destroy: function () {
+        this._callCallbacks("destroy");
+        for (var id in this.__events) {
+            this._unbindEvent(id);
+        }
+    },
+
+    /**
+     * Register a callback for any PhotonUI/Widget event (called wEvent).
+     *
+     * Callback signature:
+     *
+     *     function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]])
+     *
+     * @method registerCallback
+     * @param {String} id An unique id for the callback.
+     * @param {String} wEvent the PhotonUI/Widget event name.
+     * @param {Function} callback The callback function.
+     * @param {Object} thisArg The value of this (optionnal, default = current widget).
+     */
+    registerCallback: function (id, wEvent, callback, thisArg) {
+        if (!this.__callbacks[wEvent]) {
+            Helpers.log("error", "This widget has no '" + wEvent + "' wEvent.");
+            return;
+        }
+        this.__callbacks[wEvent][id] = {
+            callback: callback,
+            thisArg: thisArg || null
+        };
+    },
+
+    /**
+     * Remove a registered callback.
+     *
+     * @method removeCallback
+     * @param {String} id The id of the callback.
+     */
+    removeCallback: function (id) {
+        for (var wEvent in this.__callbacks) {
+            if (this.__callbacks[wEvent][id]) {
+                delete this.__callbacks[wEvent][id];
+            }
+        }
+    },
+
+    // ====== Private methods ======
+
+    /**
+     * Force the update of the given properties.
+     *
+     * This method is deprecated.
+     * One should use '@photonui-update' abitbol's annotation on concerned properties.
+     *
+     * @method _updateProperties
+     * @private
+     * @deprecated
+     * @param {Array} properties The properties to update.
+     */
+    _updateProperties: function (properties) {
+        Helpers.log("warn", "'photonui.Base._updateProperties()' is deprecated." +
+                            " One should use '@photonui-update' abitbol's annotation on concerned properties.");
+
+        for (var i = 0 ; i < properties.length ; i++) {
+            this[properties[i]] = this[properties[i]];
+        }
+    },
+
+    /**
+     * Javascript event binding (for internal use).
+     *
+     * @method _bindEvent
+     * @private
+     * @param {String} id An unique id for the event.
+     * @param {DOMElement} element The element on which the event will be bind.
+     * @param {String} evName The event name (e.g. "mousemove", "click",...).
+     * @param {Function} callback The function that will be called when the event occured.
+     * @param {Object} [options] options for `addEventListener`
+     */
+    _bindEvent: function (id, element, evName, callback, options) {
+        if (options === undefined) {
+            options = false;
+        }
+        this._unbindEvent(id);
+        this.__events[id] = {
+            evName: evName,
+            element: element,
+            callback: callback
+        };
+        this.__events[id].element.addEventListener(
+                this.__events[id].evName,
+                this.__events[id].callback,
+                options
+        );
+    },
+
+    /**
+     * Unbind javascript event.
+     *
+     * @method _unbindEvent
+     * @private
+     * @param {String} id The id of the event.
+     */
+    _unbindEvent: function (id) {
+        if (!this.__events[id]) {
+            return;
+        }
+        this.__events[id].element.removeEventListener(
+                this.__events[id].evName,
+                this.__events[id].callback,
+                false
+        );
+        delete this.__events[id];
+    },
+
+    /**
+     * Register available wEvent.
+     *
+     * @method _registerWEvents
+     * @private
+     * @param {Array} wEvents
+     */
+    _registerWEvents: function (wEvents) {
+        if (this.__callbacks === null) {
+            this.__callbacks = {};
+        }
+        for (var i in wEvents) {
+            this.__callbacks[wEvents[i]] = {};
+        }
+    },
+
+    /**
+     * Call all callbacks for the given wEvent.
+     *
+     * NOTE: the first argument passed to the callback is the current widget.
+     * NOTE²: if the thisArg of the callback is null, this will be binded to the current widget.
+     *
+     * @method _callCallbacks
+     * @private
+     * @param {String} wEvent The widget event.
+     * @param {Array} params Parametters that will be sent to the callbacks.
+     */
+    _callCallbacks: function (wEvent, params) {
+        params = params || [];
+        for (var id in this.__callbacks[wEvent]) {
+            this.__callbacks[wEvent][id].callback.apply(
+                    this.__callbacks[wEvent][id].thisArg || this,
+                    [this].concat(params)
+            );
+        }
+    }
+});
+
+module.exports = Base;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_composite_colorbutton.js.html b/ref/files/src_composite_colorbutton.js.html new file mode 100644 index 00000000..290cfea9 --- /dev/null +++ b/ref/files/src_composite_colorbutton.js.html @@ -0,0 +1,427 @@ + + + + + src/composite/colorbutton.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/composite/colorbutton.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule Composite
+ * @namespace photonui
+ */
+
+var _ = require("stonejs").gettext;
+var Button = require("../interactive/button.js");
+var Color = require("../nonvisual/color.js");
+var ColorPalette = require("../interactive/colorpalette.js");
+var PopupWindow = require("../container/popupwindow.js");
+var BoxLayout = require("../layout/boxlayout.js");
+var ColorPickerDialog = require("./colorpickerdialog.js");
+
+/**
+ * Color Button.
+ *
+ * wEvents:
+ *
+ *   * value-changed:
+ *      - description: the selected color changed.
+ *      - callback:    function(widget, color)
+ *
+ * @class ColorButton
+ * @constructor
+ * @extends photonui.Widget
+ */
+var ColorButton = Button.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        this.__widgets = {};
+        this._color = new Color();
+        this._registerWEvents(["value-changed"]);
+        this.$super(params);
+        this._buildUi();
+    },
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    /**
+     * The value (color in rgb hexadecimal format (e.g. "#ff0000")).
+     *
+     * @property value
+     * @type String
+     */
+    getValue: function () {
+        return this.color.rgbHexString;
+    },
+
+    setValue: function (value) {
+        this.color.fromString(value);
+    },
+
+    /**
+     * The color.
+     *
+     * @property color
+     * @type photonui.Color
+     */
+    _color: null,
+
+    getColor: function () {
+        "@photonui-update";
+        return this._color;
+    },
+
+    setColor: function (color) {
+        if (color instanceof Color) {
+            if (this._color) {
+                this._color.removeCallback("photonui.colorbutton.value-changed::" + this.name);
+            }
+            this._color = color;
+            this._color.registerCallback("photonui.colorbutton.value-changed::" +
+                                         this.name, "value-changed", this.__onColorChanged, this);
+        }
+        this.__onColorChanged();
+        if (color instanceof Color) {
+            this._color = color;
+        }
+    },
+
+    /**
+     * Display only the color picker dialog instead of showing the palette first.
+     *
+     * @property dialogOnly
+     * @type Boolean
+     * @default false
+     */
+    _dialogOnly: false,
+
+    isDialogOnly: function () {
+        return this._dialogOnly;
+    },
+
+    setDialogOnly: function (dialogOnly) {
+        this._dialogOnly = Boolean(dialogOnly);
+    },
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Public methods ======
+
+    destroy: function () {
+        this._color.removeCallback("photonui.colorbutton.value-changed::" + this.name);
+        this.$super();
+    },
+
+    // ====== Private methods ======
+
+    /**
+     * Update the button content
+     *
+     * @method _update
+     * @private
+     */
+    _update: function () {
+        // Do nothing
+    },
+
+    /**
+     * Build the widget HTML.
+     *
+     * @method _buildHtml
+     * @private
+     */
+    _buildHtml: function () {
+        this.$super();
+        this.__html.button = document.createElement("button");
+        this.__html.button.className = "photonui-widget photonui-button";
+
+        this.__html.button.className += " photonui-colorbutton";
+
+        this.__html.color = document.createElement("span");
+        this.__html.button.appendChild(this.__html.color);
+    },
+
+    /**
+     * Make the UI.
+     *
+     * @method _buildUi
+     * @private
+     */
+    //TODO: Build UI
+    _buildUi: function () {
+        this.__widgets.popup = new PopupWindow();
+        this.__widgets.vbox = new BoxLayout({verticalSpacing: 0, horizontalSpacing: 0});
+        this.__widgets.popup.child = this.__widgets.vbox;
+
+        this.__widgets.palette = new ColorPalette();
+        this.__widgets.vbox.addChild(this.__widgets.palette);
+
+        this.__widgets.custom = new Button({text: _("Custom color..."), appearance: "flat"});
+        this.__widgets.custom.addClass("photonui-colorbutton-custombutton");
+        this.__widgets.vbox.addChild(this.__widgets.custom);
+
+        this.__widgets.colorPickerDialog = new ColorPickerDialog();
+
+        // Callbacks
+        this.__widgets.palette.registerCallback("value-changed", "value-changed", this.__onValueChanged, this);
+        this.__widgets.colorPickerDialog.registerCallback("value-changed", "value-changed",
+                                                          this.__onValueChanged, this);
+        this.__widgets.custom.registerCallback("click", "click", this.__onCustomButtonClicked, this);
+
+        // Color
+        this.__widgets.palette.color = this.color;
+        this.__widgets.colorPickerDialog.color = this.color;
+    },
+
+    //////////////////////////////////////////
+    // Internal Events Callbacks            //
+    //////////////////////////////////////////
+
+    /**
+     * Called when the button is clicked.
+     *
+     * @method __onButtonClicked
+     * @private
+     * @param event
+     */
+    __onButtonClicked: function (event) {
+        this._callCallbacks("click", [event]);
+        if (this.dialogOnly) {
+            this.__widgets.colorPickerDialog.show();
+            this.__widgets.colorPickerDialog.center();
+        } else {
+            this.__widgets.popup.popupWidget(this);
+        }
+    },
+
+    /**
+     * Called when the palette color change.
+     *
+     * @method __onPaletteValueChanged
+     * @private
+     * @param {photonui.Widget} widget
+     * @param {String} color
+     */
+    __onValueChanged: function (widget, color) {
+        this._callCallbacks("value-changed", [this.color]);
+    },
+
+    /**
+     *
+     * @method __onColorChanged
+     * @private
+     */
+    __onColorChanged: function () {
+        this.__html.color.style.backgroundColor = this.color.rgbHexString;
+    },
+
+    /**
+     * @method __onCustomButtonClicked
+     * @private
+     */
+    __onCustomButtonClicked: function () {
+        this.__widgets.colorPickerDialog.show();
+        this.__widgets.colorPickerDialog.center();
+    }
+});
+
+module.exports = ColorButton;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_composite_colorpickerdialog.js.html b/ref/files/src_composite_colorpickerdialog.js.html new file mode 100644 index 00000000..e82acae3 --- /dev/null +++ b/ref/files/src_composite_colorpickerdialog.js.html @@ -0,0 +1,580 @@ + + + + + src/composite/colorpickerdialog.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/composite/colorpickerdialog.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule Composite
+ * @namespace photonui
+ */
+
+var _ = require("stonejs").gettext;
+var Dialog = require("../container/dialog.js");
+var BoxLayout = require("../layout/boxlayout.js");
+var GridLayout = require("../layout/gridlayout.js");
+var Color = require("../nonvisual/color.js");
+var ColorPalette = require("../interactive/colorpalette.js");
+var ColorPicker = require("../interactive/colorpicker.js");
+var Button = require("../interactive/button.js");
+var Slider = require("../interactive/slider.js");
+var Separator = require("../visual/separator.js");
+var Label = require("../visual/label.js");
+var FAIcon = require("../visual/faicon.js");
+
+/**
+ * Color Picker Dialog.
+ *
+ * wEvents:
+ *
+ *   * value-changed:
+ *      - description: the selected color changed.
+ *      - callback:    function(widget, color)
+ *
+ * @class ColorPickerDialog
+ * @constructor
+ * @extends photonui.Dialog
+ */
+var ColorPickerDialog = Dialog.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        this.__widgets = {};
+        this._color = new Color();
+
+        params = params || {};
+        if (params.title === undefined) {
+            params.title = _("Select a color...");
+        }
+
+        this._registerWEvents(["value-changed"]);
+
+        this.$super(params);
+
+        this._buildUi();
+    },
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    _padding: 10,
+
+    /**
+     * The color.
+     *
+     * @property color
+     * @type photonui.Color
+     */
+    _color: null,
+
+    getColor: function () {
+        "@photonui-update";
+        return this._color;
+    },
+
+    setColor: function (color) {
+        if (color instanceof Color) {
+            if (this._color) {
+                this._color.removeCallback("photonui.colorpickerdialog.value-changed::" + this.name);
+            }
+            this._color = color;
+            this._color.registerCallback("photonui.colorpickerdialog.value-changed::" + this.name, "value-changed",
+                                         this.__onColorChanged, this);
+            this.__onColorChanged();
+        }
+    },
+
+    /**
+     * The color as hex string (shorthand to ColorPickerDialog.color.rgbHexString).
+     *
+     * @property value
+     * @type String
+     */
+    getValue: function () {
+        return this._color.rgbHexString;
+    },
+
+    setValue: function (value) {
+        this._color.fromString(value);
+    },
+
+    setVisible: function (visible) {
+        this.$super(visible);
+        if (this._color && visible && this.__widgets.labelRed) {
+            this._updateUi();
+        }
+    },
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Public methods ======
+
+    destroy: function () {
+        this._color.removeCallback("photonui.colorpickerdialog.value-changed::" + this.name);
+        this.$super();
+    },
+
+    // ====== Private methods ======
+
+    /**
+     * Make the UI.
+     *
+     * @method _buildUi
+     * @private
+     */
+    _buildUi: function () {
+        this.html.className += " photonui-colorpickerdialog";
+
+        // == Main UI ==
+        this.__widgets.hbox = new BoxLayout({
+            orientation: "horizontal"
+        });
+        this.child = this.__widgets.hbox;
+
+        // Color Picker
+        this.__widgets.colorPicker = new ColorPicker();
+        if (this._color !== null) {
+            this.__widgets.colorPicker.color.setHSB(
+                    this._color.hue,
+                    this._color.saturation,
+                    this._color.brightness
+            );
+        }
+        this.__widgets.hbox.addChild(this.__widgets.colorPicker);
+
+        // Color Palette
+        this.__widgets.colorPalette = new ColorPalette();
+        this.__widgets.hbox.addChild(this.__widgets.colorPalette);
+
+        // Separator
+        this.__widgets.separator = new Separator({orientation: "vertical"});
+        this.__widgets.hbox.addChild(this.__widgets.separator);
+
+        this.__widgets.grid = new GridLayout();
+        this.__widgets.hbox.addChild(this.__widgets.grid);
+
+        // Red field + label
+        this.__widgets.fieldRed = new Slider({
+            value: (this._color) ? this._color.red : undefined,
+            min: 0,
+            max: 255,
+            decimalDigits: 0
+        });
+
+        this.__widgets.labelRed = new Label({
+            text: _("Red:"),
+            forInput: this.__widgets.fieldRed
+        });
+
+        this.__widgets.grid.addChild(this.__widgets.labelRed, {gridX: 0, gridY: 0, verticalExpansion: false});
+        this.__widgets.grid.addChild(this.__widgets.fieldRed, {gridX: 1, gridY: 0, verticalExpansion: false});
+
+        // Green field + label
+        this.__widgets.fieldGreen = new Slider({
+            value: (this._color) ? this._color.green : undefined,
+            min: 0,
+            max: 255,
+            decimalDigits: 0
+        });
+
+        this.__widgets.labelGreen = new Label({
+            text: _("Green:"),
+            forInput: this.__widgets.fieldGreen
+        });
+
+        this.__widgets.grid.addChild(this.__widgets.labelGreen, {gridX: 0, gridY: 1, verticalExpansion: false});
+        this.__widgets.grid.addChild(this.__widgets.fieldGreen, {gridX: 1, gridY: 1, verticalExpansion: false});
+
+        // Blue field + label
+        this.__widgets.fieldBlue = new Slider({
+            value: (this._color) ? this._color.blue : undefined,
+            min: 0,
+            max: 255,
+            decimalDigits: 0
+        });
+
+        this.__widgets.labelBlue = new Label({
+            text: _("Blue:"),
+            forInput: this.__widgets.fieldBlue
+        });
+
+        this.__widgets.grid.addChild(this.__widgets.labelBlue, {gridX: 0, gridY: 2, verticalExpansion: false});
+        this.__widgets.grid.addChild(this.__widgets.fieldBlue, {gridX: 1, gridY: 2, verticalExpansion: false});
+
+        // Separator
+        this.__widgets.separator2 = new Separator();
+        this.__widgets.grid.addChild(this.__widgets.separator2, {
+            gridX: 0,
+            gridY: 3,
+            verticalExpansion: false,
+            gridWidth: 2
+        });
+
+        // Hue field + label
+        this.__widgets.fieldHue = new Slider({
+            value: (this._color) ? this._color.hue : undefined,
+            min: 0,
+            max: 360,
+            decimalDigits: 0
+        });
+
+        this.__widgets.labelHue = new Label({
+            text: _("Hue:"),
+            forInput: this.__widgets.fieldHue
+        });
+
+        this.__widgets.grid.addChild(this.__widgets.labelHue, {gridX: 0, gridY: 4, verticalExpansion: false});
+        this.__widgets.grid.addChild(this.__widgets.fieldHue, {gridX: 1, gridY: 4, verticalExpansion: false});
+
+        // Saturation field + label
+        this.__widgets.fieldSaturation = new Slider({
+            value: (this._color) ? this._color.saturation : undefined,
+            min: 0,
+            max: 100,
+            decimalDigits: 0
+        });
+
+        this.__widgets.labelSaturation = new Label({
+            text: _("Saturation:"),
+            forInput: this.__widgets.fieldSaturation
+        });
+
+        this.__widgets.grid.addChild(this.__widgets.labelSaturation, {gridX: 0, gridY: 5, verticalExpansion: false});
+        this.__widgets.grid.addChild(this.__widgets.fieldSaturation, {gridX: 1, gridY: 5, verticalExpansion: false});
+
+        // Brightness field + label
+        this.__widgets.fieldBrightness = new Slider({
+            value: (this._color) ? this._color.brightness : undefined,
+            min: 0,
+            max: 100,
+            decimalDigits: 0
+        });
+
+        this.__widgets.labelBrightness = new Label({
+            text: _("Brightness:"),
+            forInput: this.__widgets.fieldBrightness
+        });
+
+        this.__widgets.grid.addChild(this.__widgets.labelBrightness, {gridX: 0, gridY: 6, verticalExpansion: false});
+        this.__widgets.grid.addChild(this.__widgets.fieldBrightness, {gridX: 1, gridY: 6, verticalExpansion: false});
+
+        // == Dialog Buttons ==
+        this.__widgets.buttonOk = new Button({text: _("Ok")});
+        if (FAIcon) {
+            this.__widgets.buttonOk.leftIcon = new FAIcon("fa-check");
+        }
+
+        this.__widgets.buttonCancel = new Button({text: _("Cancel")});
+        this.buttons = [this.__widgets.buttonOk, this.__widgets.buttonCancel];
+
+        if (FAIcon) {
+            this.__widgets.buttonCancel.leftIcon = new FAIcon("fa-times");
+        }
+
+        // == Bindings ==
+        this.__widgets.colorPalette.color = this.__widgets.colorPicker.color;
+
+        this.__widgets.colorPicker.color.registerCallback(
+            "colorpickerdialog.colorPicker.value-changed", "value-changed", this._updateUi, this);
+
+        this.__widgets.fieldRed.registerCallback(
+            "colorpickerdialog.fieldRed.value-changed", "value-changed", function (widget, value) {
+            this.__widgets.colorPicker.color.red = value;
+        }, this);
+
+        this.__widgets.fieldGreen.registerCallback(
+            "colorpickerdialog.fieldGreen.value-changed", "value-changed", function (widget, value) {
+            this.__widgets.colorPicker.color.green = value;
+        }, this);
+
+        this.__widgets.fieldBlue.registerCallback(
+            "colorpickerdialog.fieldBlue.value-changed", "value-changed", function (widget, value) {
+            this.__widgets.colorPicker.color.blue = value;
+        }, this);
+
+        this.__widgets.fieldHue.registerCallback(
+            "colorpickerdialog.fieldHue.value-changed", "value-changed", function (widget, value) {
+            this.__widgets.colorPicker.color.hue = value;
+        }, this);
+
+        this.__widgets.fieldSaturation.registerCallback(
+            "colorpickerdialog.fieldSaturation.value-changed", "value-changed", function (widget, value) {
+            this.__widgets.colorPicker.color.saturation = value;
+        }, this);
+
+        this.__widgets.fieldBrightness.registerCallback(
+            "colorpickerdialog.fieldBrightness.value-changed", "value-changed", function (widget, value) {
+            this.__widgets.colorPicker.color.brightness = value;
+        }, this);
+
+        this.__widgets.buttonOk.registerCallback(
+            "colorpickerdialog.buttonOk.click", "click", this.__onValidate, this);
+        this.__widgets.buttonCancel.registerCallback(
+            "colorpickerdialog.buttonCancel.click", "click", this.__onCancel, this);
+        this.registerCallback("colorpickerdialog.close", "close-button-clicked", this.__onCancel, this);
+    },
+
+    /**
+     * Update the fields of the UI.
+     *
+     * @method _updateUi
+     * @private
+     */
+    _updateUi: function (color) {
+        color = color || this.color;
+        this.__widgets.fieldRed.value = color.red;
+        this.__widgets.fieldGreen.value = color.green;
+        this.__widgets.fieldBlue.value = color.blue;
+        this.__widgets.fieldHue.value = color.hue;
+        this.__widgets.fieldSaturation.value = color.saturation;
+        this.__widgets.fieldBrightness.value = color.brightness;
+    },
+
+    //////////////////////////////////////////
+    // Internal Events Callbacks            //
+    //////////////////////////////////////////
+
+    /**
+     * @method __onCancel
+     * @private
+     */
+    __onCancel: function () {
+        this.__widgets.colorPicker.color.setHSB(
+                this._color.hue,
+                this._color.saturation,
+                this._color.brightness
+        );
+        this.hide();
+    },
+
+    /**
+     * @method __onValidate
+     * @private
+     */
+    __onValidate: function () {
+        this._color.setHSB(
+                this.__widgets.colorPicker.color.hue,
+                this.__widgets.colorPicker.color.saturation,
+                this.__widgets.colorPicker.color.brightness
+        );
+        this.hide();
+        this._callCallbacks("value-changed", [this.color]);
+    },
+
+    /**
+     * @method __onColorChanged
+     * @private
+     */
+    __onColorChanged: function () {
+        if (!this.__widgets.colorPicker) {
+            return;
+        }
+
+        this.__widgets.colorPicker.color.setHSB(
+                this._color.hue,
+                this._color.saturation,
+                this._color.brightness
+        );
+    }
+});
+
+module.exports = ColorPickerDialog;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_composite_fontselect.js.html b/ref/files/src_composite_fontselect.js.html new file mode 100644 index 00000000..dc088663 --- /dev/null +++ b/ref/files/src_composite_fontselect.js.html @@ -0,0 +1,300 @@ + + + + + src/composite/fontselect.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/composite/fontselect.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule Composite
+ * @namespace photonui
+ */
+
+var Stone = require("stonejs");
+var Select = require("./select.js");
+var MenuItem = require("../container/menuitem.js");
+
+/**
+ * Font Selector.
+ *
+ * wEvents:
+ *
+ * @class FontSelect
+ * @constructor
+ * @extends photonui.Select
+ */
+var FontSelect = Select.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        params = params || {};
+        this._fonts = [];
+        this.$super(params);
+        if (this.fonts.length === 0) {
+            this.fonts = ["sans-serif", "serif", "monospace"];
+        }
+        this.value = (params.value !== undefined) ? params.value : "sans-serif";
+    },
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    /**
+     * The font list
+     *
+     * @property fonts
+     * @type Array
+     * @default ["sans-serif", "serif", "monospace"]
+     */
+    _fonts: null,
+
+    getFonts: function () {
+        return this._fonts;
+    },
+
+    setFonts: function (fonts) {
+        this._fonts = [];
+        for (var i = 0 ; i < fonts.length ; i++) {
+            this.addFont(fonts[i]);
+        }
+    },
+
+    /**
+     * The placeholder displayed if nothing is selected.
+     *
+     * @property placeholder
+     * @type String
+     * @default "Select a font..."
+     */
+    _placeholder: Stone.lazyGettext("Select a font..."),
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Public methods ======
+
+    /**
+     * Add a widget to the layout.
+     *
+     * @method addChild
+     * @param {String} fontName
+     */
+    addFont: function (fontName) {
+        var item = new MenuItem({value: fontName, text: fontName});
+        item.html.style.fontFamily = fontName;
+        this.addChild(item);
+        this._fonts.push(fontName);
+    },
+
+    // ====== Private methods ======
+
+    /**
+     * Build the widget HTML.
+     *
+     * @method _buildHtml
+     * @private
+     */
+    _buildHtml: function () {
+        this.$super();
+        this.__html.select.className += " photonui-fontselect";
+    }
+});
+
+module.exports = FontSelect;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_composite_popupmenu.js.html b/ref/files/src_composite_popupmenu.js.html new file mode 100644 index 00000000..7977c6b3 --- /dev/null +++ b/ref/files/src_composite_popupmenu.js.html @@ -0,0 +1,283 @@ + + + + + src/composite/popupmenu.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/composite/popupmenu.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule Composite
+ * @namespace photonui
+ */
+
+var PopupWindow = require("../container/popupwindow.js");
+var Menu = require("../layout/menu.js");
+
+/**
+ * Popup Menu.
+ *
+ * @class PopupMenu
+ * @constructor
+ * @extends photonui.PopupWindow
+ * @uses photonui.Layout
+ * @uses photonui.Menu
+ */
+var PopupMenu = PopupWindow.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        this._childrenNames = [];  // new instance
+        this.$super(params);
+    },
+
+    // Mixin
+    __include__: [{
+        getChildrenNames: Menu.prototype.getChildrenNames,
+        setChildrenNames: Menu.prototype.setChildrenNames,
+        getChildren:      Menu.prototype.getChildren,
+        setChildren:      Menu.prototype.setChildren,
+        getChildName:     Menu.prototype.getChildName,
+        setChildName:     Menu.prototype.setChildName,
+        getChild:         Menu.prototype.getChild,
+        setChild:         Menu.prototype.setChild,
+        _iconVisible:     Menu.prototype._iconVisible,
+        isIconVisible:    Menu.prototype.isIconVisible,
+        setIconVisible:   Menu.prototype.setIconVisible,
+        addChild:         Menu.prototype.addChild,
+        removeChild:      Menu.prototype.removeChild,
+        empty:            Menu.prototype.empty,
+        destroy:          Menu.prototype.destroy,
+        _updateLayout:    Menu.prototype._updateLayout,
+        _lockUpdate:      Menu.prototype._lockUpdate
+    }],
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Private methods ======
+
+    /**
+     * Build the widget HTML.
+     *
+     * @method _buildHtml
+     * @private
+     */
+    _buildHtml: function () {
+        this.$super();
+        Menu.prototype._buildHtml.call(this);
+
+        this.__html.inner.appendChild(this.__html.outer);
+        this.__html.window.className += " photonui-popupmenu";
+        this.__html.outer.className = "photonui-widget photonui-menu photonui-menu-style-popupmenu";
+    },
+
+    //////////////////////////////////////////
+    // Internal Events Callbacks            //
+    //////////////////////////////////////////
+
+    /**
+     * Called when the locale is changed.
+     *
+     * @method __onLocaleChanged
+     * @private
+     */
+    __onLocaleChanged: function () {
+        // pass
+    }
+});
+
+module.exports = PopupMenu;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_composite_select.js.html b/ref/files/src_composite_select.js.html new file mode 100644 index 00000000..e233aeaa --- /dev/null +++ b/ref/files/src_composite_select.js.html @@ -0,0 +1,590 @@ + + + + + src/composite/select.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/composite/select.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule Composite
+ * @namespace photonui
+ */
+
+var Stone  = require("stonejs");
+var Helpers = require("../helpers.js");
+var Widget = require("../widget.js");
+var PopupMenu = require("./popupmenu.js");
+var MenuItem = require("../container/menuitem.js");
+
+/**
+ * Select input.
+ *
+ * wEvents:
+ *
+ *   * value-changed:
+ *     - description: called when the value was modified.
+ *     - callback:    function(widget, value)
+ *
+ * @class Select
+ * @constructor
+ * @extends photonui.Widget
+ */
+var Select = Widget.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        params = params || {};
+
+        // Attach popup & special mixin
+        this.__popupMenu = new PopupMenu({
+            maxHeight: 300,
+            className: "photonui-select-popup",
+            iconVisible: false
+        });
+
+        this._registerWEvents(["value-changed"]);
+        this.$super(params);
+
+        this._bindEvent("popup", this.html, "click", this.__onClick.bind(this));
+        this._bindEvent("mouse-down", this.html, "mousedown", this.__onMouseDown.bind(this));
+
+        this.setValue(params.value || this.value, true);
+    },
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    /**
+     * The field value.
+     *
+     * @property value
+     * @type String (maybe)
+     * @default ""
+     */
+    _value: "",
+
+    getValue: function () {
+        "@photonui-update";
+        return this._value;
+    },
+
+    setValue: function (value, force) {
+        if (this.value == value && !force) {
+            return;
+        }
+
+        var items = this.__popupMenu.children;
+
+        for (var i = 0 ; i < items.length ; i++) {
+            if (items[i] instanceof MenuItem && items[i].value == value) {
+                this._value = value;
+                Helpers.cleanNode(this.__html.select);
+                this.__html.select.appendChild(items[i].html.cloneNode(true));
+                return;
+            }
+        }
+
+        this._value = "";
+        if (this.__displayValue) {
+            this.__displayValue.destroy();
+        }
+        this.__displayValue = new MenuItem({text: this.placeholder, className: "photonui-select-placeholder"});
+        Helpers.cleanNode(this.__html.select);
+        this.__html.select.appendChild(this.__displayValue.html);
+    },
+
+    /**
+     * The placeholder displayed if nothing is selected.
+     *
+     * @property placeholder
+     * @type String
+     * @default "Select..."
+     */
+    _placeholder: Stone.lazyGettext("Select..."),
+
+    getPlaceholder: function () {
+        return this._placeholder;
+    },
+
+    setPlaceholder: function (placeholder) {
+        this._placeholder = placeholder;
+    },
+
+    /**
+     * Layout children widgets.
+     *
+     * @property children
+     * @type Array
+     * @default []
+     */
+    getChildren: function () { return this.__popupMenu.getChildren(); },
+    setChildren: function (p) {
+        this.__popupMenu.setChildren(p);
+        this._updateItemsBinding();
+    },
+
+    /**
+     * Layout children widgets name.
+     *
+     * @property childrenNames
+     * @type Array
+     * @default []
+     */
+    getChildrenNames: function () { return this.__popupMenu.getChildrenNames(); },
+    setChildrenNames: function (p) {
+        this.__popupMenu.setChildrenNames(p);
+        this._updateItemsBinding();
+    },
+
+    /**
+     * Width of the container node.
+     *
+     * @property popupWidth
+     * @type Number
+     * @default: null (auto)
+     */
+    getPopupWidth: function () { return this.__popupMenu.getWidth(); },
+    setPopupWidth: function (p) { this.__popupMenu.setWidth(p); },
+
+    /**
+     * Height of the popup container node.
+     *
+     * @property popupHeight
+     * @type Number
+     * @default: null (auto)
+     */
+    getPopupHeight: function () { return this.__popupMenu.getHeight(); },
+    setPopupHeight: function (p) { this.__popupMenu.setHeight(p); },
+
+    /**
+     * Maximum width of the popup container node.
+     *
+     * @property popupMaxWidth
+     * @type Number
+     * @default: null (no maximum)
+     */
+    getPopupMaxWidth: function () { return this.__popupMenu.getMaxWidth(); },
+    setPopupMaxWidth: function (p) { this.__popupMenu.setMaxWidth(p); },
+
+    /**
+     * Minimum width of the popup container node.
+     *
+     * @property popupMinWidth
+     * @type Number
+     * @default: null (no minimum)
+     */
+    _minWidthDefined: false,
+    getPopupMinWidth: function () { return this.__popupMenu.getMinWidth(); },
+    setPopupMinWidth: function (p) { this._minWidthDefined = true ; this.__popupMenu.setMinWidth(p); },
+
+    /**
+     * Maximum height of the popup container node.
+     *
+     * @property popupMaxHeight
+     * @type Number
+     * @default: 300
+     */
+    getPopupMaxHeight: function () { return this.__popupMenu.getMaxHeight(); },
+    setPopupMaxHeight: function (p) { this.__popupMenu.setMaxHeight(p); },
+
+    /**
+     * Minimum height of the popup container node.
+     *
+     * @property popupMinHeight
+     * @type Number
+     * @default: null (no minimum)
+     */
+    getPopupMinHeight: function () { return this.__popupMenu.getMinHeight(); },
+    setPopupMinHeight: function (p) { this.__popupMenu.setMinHeight(p); },
+
+    /**
+     * Popup width (outer HTML element).
+     *
+     * @property popupOffsetWidth
+     * @type Number
+     * @readOnly
+     */
+    getPopupOffsetWidth: function () { return this.__popupMenu.getOffsetWidth(); },
+
+    /**
+     * Popup height (outer HTML element).
+     *
+     * @property popupOffsetHeight
+     * @type Number
+     * @readOnly
+     */
+    getPopupOffsetHeight: function () { return this.__popupMenu.getOffsetHeight(); },
+
+    /**
+     * Window container node padding.
+     *
+     * @property popupPadding
+     * @type Number
+     * @default 0
+     */
+    getPopupPadding: function () { return this.__popupMenu.getPadding(); },
+    setPopupPadding: function (p) { this.__popupMenu.setPadding(p); },
+
+    /**
+     * Define if icon on menu items are visible.
+     *
+     * @property iconVisible
+     * @type Boolean
+     * @default: false
+     */
+    isIconVisible: function () {
+        "@photonui-update";
+        return this.__popupMenu.isIconVisible();
+    },
+    setIconVisible: function (p) {
+        if (!p) {
+            this.addClass("photonui-select-noicon");
+        } else {
+            this.removeClass("photonui-select-noicon");
+        }
+        this.__popupMenu.setIconVisible(p);
+    },
+
+    setVisible: function (visible) {
+        this.$super(visible);
+        if (!visible) {
+            this.__popupMenu.hide();
+        }
+    },
+
+    /**
+     * Html outer element of the widget (if any).
+     *
+     * @property html
+     * @type HTMLElement
+     * @default null
+     * @readOnly
+     */
+    getHtml: function () {
+        return this.__html.select;
+    },
+
+    // ====== Private properties ======
+
+    /**
+     * The popupMenu.
+     *
+     * @property __popupMenu
+     * @private
+     * @type photonui.PopupMenu
+     */
+    __popupMenu: null,
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Public methods ======
+
+    /**
+     * Add a widget to the layout.
+     *
+     * @method addChild
+     * @param {photonui.Widget} widget The widget to add.
+     * @param {Object} layoutOption Specific option for the layout (optional).
+     */
+    addChild: function (w, l) {
+        this.__popupMenu.addChild(w, l);
+        this._updateItemsBinding();
+    },
+
+    /**
+     * Destroy the widget.
+     *
+     * @method destroy
+     */
+    destroy: function () {
+        if (this.__displayValue) {
+            this.__displayValue.destroy();
+        }
+        if (this.__popupMenu) {
+            this.__popupMenu.destroy();
+        }
+        this.$super();
+    },
+
+    // ====== Private methods ======
+
+    /**
+     * Build the widget HTML.
+     *
+     * @method _buildHtml
+     * @private
+     */
+    _buildHtml: function () {
+        this.__html.select = document.createElement("div");
+        this.__html.select.className = "photonui-widget photonui-select";
+        this.__html.select.tabIndex = "0";
+    },
+
+    /**
+     * Update the popup items binding.
+     *
+     * @method _updateItemsBinding
+     * @private
+     */
+    _updateItemsBinding: function () {
+        var items = this.__popupMenu.children;
+
+        for (var i = 0 ; i < items.length ; i++) {
+            if (items[i] instanceof MenuItem) {
+                items[i].registerCallback(this.name + "-click",
+                        "click", this.__onItemClicked, this);
+            }
+        }
+    },
+
+    //////////////////////////////////////////
+    // Internal Events Callbacks            //
+    //////////////////////////////////////////
+
+    /**
+     * @method __onClick
+     * @private
+     * @param event
+     */
+    __onClick: function (event) {
+        if (!this._minWidthDefined) {
+            this.popupMinWidth = this.offsetWidth;
+        }
+        if (this.__popupMenu.visible) {
+            this.__popupMenu.hide();
+        } else {
+            this.__popupMenu.popupWidget(this);
+        }
+    },
+
+    /**
+     * @method __onMouseDown
+     * @private
+     * @param event
+     */
+    __onMouseDown: function (event) {
+        if (this.__popupMenu.visible) {
+            event.stopPropagation();
+        }
+    },
+
+    /**
+     * @method __onItemClicked
+     * @private
+     * @param {photonui.MenuItem} widget
+     */
+    __onItemClicked: function (widget) {
+        this.value = widget.value;
+        this._callCallbacks("value-changed", [this.value]);
+    },
+
+    /**
+     * @method __onLocaleChanged
+     * @private
+     */
+    __onLocaleChanged: function () {
+        this.$super();
+        this.setValue(this.value, true);
+    }
+
+});
+
+module.exports = Select;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_container_basewindow.js.html b/ref/files/src_container_basewindow.js.html new file mode 100644 index 00000000..19ee7032 --- /dev/null +++ b/ref/files/src_container_basewindow.js.html @@ -0,0 +1,537 @@ + + + + + src/container/basewindow.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/container/basewindow.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule Container
+ * @namespace photonui
+ */
+
+var Container = require("./container.js");
+var Widget = require("../widget.js");
+
+/**
+ * Windows base class.
+ *
+ * wEvents:
+ *
+ *   * position-changed:
+ *      - description: called when the widows is moved.
+ *      - callback:    function(widget, x, y)
+ *
+ * @class BaseWindow
+ * @constructor
+ * @extends photonui.Container
+ */
+var BaseWindow = Container.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        this._registerWEvents(["position-changed"]);
+        this.$super(params);
+
+        // Windows are hidden by default
+        params = params || {};
+        if (params.visible === undefined) {
+            this.visible = false;
+        }
+
+        // Insert the window in the DOM tree
+        Widget.domInsert(this);
+    },
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    /**
+     * Window position.
+     *
+     *     {x: Number, y: Number}
+     *
+     * @property position
+     * @type Object
+     * @default {x: 0, y: 0}
+     */
+    getPosition: function () {
+        "@photonui-update";
+        if (this.visible && this.html.parentNode) {
+            return this.absolutePosition;
+        }
+        return {x: this._x, y: this._y};
+    },
+
+    setPosition: function (x, y) {
+        if (typeof(x) == "object" && y === undefined) {
+            this.html.style.left = x.x + "px";
+            this.html.style.top = x.y + "px";
+            this._x = x.x;
+            this._y = x.y;
+        } else {
+            if (typeof(x) == "number") {
+                this.html.style.left = x + "px";
+                this._x = x;
+            }
+            if (typeof(y) == "number") {
+                this.html.style.top = y + "px";
+                this._y = y;
+            }
+        }
+        this._callCallbacks("position-changed", [this.x, this.y]);
+    },
+
+    /**
+     * The X position of the Window.
+     *
+     * @property x
+     * @type Number
+     * @default 0
+     */
+    _x: 0,
+
+    getX: function () {
+        return this.position.x;
+    },
+
+    setX: function (x) {
+        this.setPosition(x, null);
+    },
+
+    /**
+     * The Y position of the Window.
+     *
+     * @property y
+     * @type Number
+     * @default 0
+     */
+    _y: 0,
+
+    getY: function () {
+        return this.position.y;
+    },
+
+    setY: function (y) {
+        this.setPosition(null, y);
+    },
+
+    /**
+     * Width of the container node.
+     *
+     * @property width
+     * @type Number
+     * @default: null (auto)
+     */
+    _width: null,
+
+    getWidth: function () {
+        "@photonui-update";
+        if (this.visible && this.html.parenNode) {
+            return this.containerNode.offsetWidth;
+        }
+        return this._width || 0;
+    },
+
+    setWidth: function (width) {
+        this._width = width || null;
+        if (this._width) {
+            this.containerNode.style.width = width + "px";
+        } else {
+            this.containerNode.style.width = "auto";
+        }
+    },
+
+    /**
+     * Height of the container node.
+     *
+     * @property height
+     * @type Number
+     * @default: null (auto)
+     */
+    _height: null,
+
+    getHeight: function () {
+        "@photonui-update";
+        if (this.visible && this.html.parenNode) {
+            return this.containerNode.offsetHeight;
+        }
+        return this._height || 0;
+    },
+
+    setHeight: function (height) {
+        this._height = height || null;
+        if (this._height) {
+            this.containerNode.style.height = height + "px";
+        } else {
+            this.containerNode.style.height = "auto";
+        }
+    },
+
+    /**
+     * Minimum width of the container node.
+     *
+     * @property minWidth
+     * @type Number
+     * @default: null (no minimum)
+     */
+    _minWidth: null,
+
+    getMinWidth: function () {
+        "@photonui-update";
+        return this._minWidth;
+    },
+
+    setMinWidth: function (minWidth) {
+        this._minWidth = minWidth || null;
+        if (this._minWidth) {
+            this.containerNode.style.minWidth = minWidth + "px";
+        } else {
+            this.containerNode.style.minWidth = "0";
+        }
+    },
+
+    /**
+     * Minimum height of the container node.
+     *
+     * @property minHeight
+     * @type Number
+     * @default: null (no minimum)
+     */
+    _minHeight: null,
+
+    getMinHeight: function () {
+        "@photonui-update";
+        return this._minHeight;
+    },
+
+    setMinHeight: function (minHeight) {
+        this._minHeight = minHeight || null;
+        if (this._minHeight) {
+            this.containerNode.style.minHeight = minHeight + "px";
+        } else {
+            this.containerNode.style.minHeight = "0";
+        }
+    },
+
+    /**
+     * Maximum width of the container node.
+     *
+     * @property maxWidth
+     * @type Number
+     * @default: null (no maximum)
+     */
+    _maxWidth: null,
+
+    getMaxWidth: function () {
+        "@photonui-update";
+        return this._maxWidth;
+    },
+
+    setMaxWidth: function (maxWidth) {
+        this._maxWidth = maxWidth || null;
+        if (this._maxWidth) {
+            this.containerNode.style.maxWidth = maxWidth + "px";
+        } else {
+            this.containerNode.style.maxWidth = "auto";
+        }
+    },
+
+    /**
+     * Maximum height of the container node.
+     *
+     * @property maxHeight
+     * @type Number
+     * @default: null (no maximum)
+     */
+    _maxHeight: null,
+
+    getMaxHeight: function () {
+        "@photonui-update";
+        return this._maxHeight;
+    },
+
+    setMaxHeight: function (maxHeight) {
+        this._maxHeight = maxHeight || null;
+        if (this._maxHeight) {
+            this.containerNode.style.maxHeight = maxHeight + "px";
+        } else {
+            this.containerNode.style.maxHeight = "auto";
+        }
+    },
+
+    /**
+     * Window container node padding.
+     *
+     * @property padding
+     * @type Number
+     * @default 0
+     */
+    _padding: 0,
+
+    getPadding: function () {
+        "@photonui-update";
+        return this._padding;
+    },
+
+    setPadding: function (padding) {
+        this._padding = padding;
+        this.containerNode.style.padding = padding + "px";
+    },
+
+    /**
+     * Html outer element of the widget (if any).
+     *
+     * @property html
+     * @type HTMLElement
+     * @default null
+     * @readOnly
+     */
+    getHtml: function () {
+        return this.__html.window;
+    },
+
+    /**
+     * HTML Element that contain the child widget HTML.
+     *
+     * @property containerNode
+     * @type HTMLElement
+     * @readOnly
+     */
+    getContainerNode: function () {
+        return this.html;
+    },
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Public methods ======
+
+    /**
+     * Center the window.
+     *
+     * @method center
+     */
+    center: function () {
+        var node = Widget.e_parent || document.getElementsByTagName("body")[0];
+        if (!node) {
+            return;
+        }
+        this.setPosition(
+                Math.max((node.offsetWidth - this.offsetWidth) / 2, 0) | 0,
+                Math.max((node.offsetHeight - this.offsetHeight) / 2, 0) | 0
+        );
+    },
+
+    // ====== Private methods ======
+
+    /**
+     * Build the widget HTML.
+     *
+     * @method _buildHtml
+     * @private
+     */
+    _buildHtml: function () {
+        this.__html.window = document.createElement("div");
+        this.__html.window.className = "photonui-widget photonui-basewindow";
+    }
+});
+
+module.exports = BaseWindow;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_container_container.js.html b/ref/files/src_container_container.js.html new file mode 100644 index 00000000..d12295aa --- /dev/null +++ b/ref/files/src_container_container.js.html @@ -0,0 +1,392 @@ + + + + + src/container/container.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/container/container.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule Container
+ * @namespace photonui
+ */
+
+var Widget = require("../widget.js");
+
+/**
+ * Base class for container widgets.
+ *
+ * @class Container
+ * @constructor
+ * @extends photonui.Widget
+ */
+var Container = Widget.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        this.$super(params);
+
+        // Force to update the parent of the child
+        if (this._childName) {
+            this.child._parentName = this.name;
+        }
+    },
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    /**
+     * Horizontaly expand the container's child widget.
+     *
+     * @property horizontalChildExpansion
+     * @type Boolean
+     * @default true
+     */
+    _horizontalChildExpansion: true,
+
+    getHorizontalChildExpansion: function () {
+        "@photonui-update";
+        return this._horizontalChildExpansion;
+    },
+
+    setHorizontalChildExpansion: function (expansion) {
+        this._horizontalChildExpansion = Boolean(expansion);
+        if (!this.containerNode) {
+            return;
+        }
+        if (expansion) {
+            this.containerNode.classList.add("photonui-container-expand-child-horizontal");
+        } else {
+            this.containerNode.classList.remove("photonui-container-expand-child-horizontal");
+        }
+    },
+
+    /**
+     * Verticaly expand the container's child widget.
+     *
+     * @property verticalChildExpansion
+     * @type Boolean
+     * @default false
+     */
+    _verticalChildExpansion: false,
+
+    getVerticalChildExpansion: function () {
+        "@photonui-update";
+        return this._verticalChildExpansion;
+    },
+
+    setVerticalChildExpansion: function (expansion) {
+        this._verticalChildExpansion = Boolean(expansion);
+        if (!this.containerNode) {
+            return;
+        }
+        if (expansion) {
+            this.containerNode.classList.add("photonui-container-expand-child-vertical");
+        } else {
+            this.containerNode.classList.remove("photonui-container-expand-child-vertical");
+        }
+    },
+
+    /**
+     * The child widget name.
+     *
+     * @property childName
+     * @type String
+     * @default null (no child)
+     */
+    _childName: null,
+
+    getChildName: function () {
+        return this._childName;
+    },
+
+    setChildName: function (childName) {
+        if (this.childName && this.containerNode && this.child && this.child.html) {
+            this.containerNode.removeChild(this.child.html);
+            this.child._parentName = null;
+        }
+        this._childName = childName;
+        if (this.child && this.child._parentName) {
+            this.child.parent.removeChild(this.child);
+        }
+        if (this.childName && this.containerNode && this.child && this.child.html) {
+            this.containerNode.appendChild(this.child.html);
+            this.child._parentName = this.name;
+        }
+    },
+
+    /**
+     * The child widget.
+     *
+     * @property child
+     * @type photonui.Widget
+     * @default null (no child)
+     */
+    getChild: function () {
+        return Widget.getWidget(this.childName);
+    },
+
+    setChild: function (child) {
+        if ((!child) || (!(child instanceof Widget))) {
+            this.childName = null;
+            return;
+        }
+        this.childName = child.name;
+    },
+
+    /**
+     * HTML Element that contain the child widget HTML.
+     *
+     * @property containerNode
+     * @type HTMLElement
+     * @readOnly
+     */
+    getContainerNode: function () {
+        return null;
+    },
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Public methods ======
+
+    /**
+     * Remove the given child.
+     *
+     * @method removeChild
+     * @param {photonui.Widget} widget The widget to remove/
+     */
+    removeChild: function (widget) {
+        if (this.child === widget) {
+            this.child = null;
+        }
+    },
+
+    /**
+     * Destroy the widget.
+     *
+     * @method destroy
+     */
+    destroy: function () {
+        if (this.childName && this.child) {
+            this.child.destroy();
+        }
+        this.$super();
+    },
+
+    // ====== Private methods ======
+
+    /**
+     * Called when the visibility changes.
+     *
+     * @method _visibilityChanged
+     * @private
+     * @param {Boolean} visibility Current visibility state (otptional, defaut=this.visible)
+     */
+    _visibilityChanged: function (visibility) {
+        visibility = (visibility !== undefined) ? visibility : this.visible;
+        if (this.child instanceof Widget) {
+            this.child._visibilityChanged(visibility);
+        }
+        this.$super(visibility);
+    },
+
+});
+
+module.exports = Container;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_container_dialog.js.html b/ref/files/src_container_dialog.js.html new file mode 100644 index 00000000..65fc6c26 --- /dev/null +++ b/ref/files/src_container_dialog.js.html @@ -0,0 +1,416 @@ + + + + + src/container/dialog.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/container/dialog.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule Container
+ * @namespace photonui
+ */
+
+var Helpers = require("../helpers.js");
+var Widget = require("../widget.js");
+var Window = require("./window.js");  // jshint ignore:line
+
+var _windowList = [];
+
+/**
+ * Dialog Window.
+ *
+ * @class Dialog
+ * @constructor
+ * @extends photonui.Window
+ */
+var Dialog = Window.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        this._buttonsNames = [];
+        this.$super(params);
+
+        // Force to update the parent of the buttons
+        var buttons = this.buttons;
+        for (var i = 0 ; i < buttons.length ; i++) {
+            buttons[i]._parentName = this.name;
+        }
+    },
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    /**
+     * Dialog button widgets name.
+     *
+     * @property buttonsNames
+     * @type Array
+     * @default []
+     */
+    _buttonsNames: [],
+
+    getButtonsNames: function () {
+        return this._buttonsNames;
+    },
+
+    setButtonsNames: function (buttonsNames) {
+        var i;
+        var widget;
+        for (i = 0 ; i < this._buttonsNames.length ; i++) {
+            widget = Widget.getWidget(this._buttonsNames[i]);
+            var index = this._buttonsNames.indexOf(widget.name);
+            if (index >= 0) {
+                widget._parentName = null;
+            }
+        }
+        this._buttonsNames = [];
+        for (i = 0 ; i < buttonsNames.length ; i++) {
+            widget = Widget.getWidget(buttonsNames[i]);
+            if (widget) {
+                if (widget.parent) {
+                    widget.unparent();
+                }
+                this._buttonsNames.push(widget.name);
+                widget._parentName = this.name;
+            }
+        }
+        this._updateButtons();
+    },
+
+    /**
+     * Dialog buttons widgets.
+     *
+     * @property buttons
+     * @type Array
+     * @default []
+     */
+    getButtons: function () {
+        var buttons = [];
+        var widget;
+        for (var i = 0 ; i < this._buttonsNames.length ; i++) {
+            widget = Widget.getWidget(this._buttonsNames[i]);
+            if (widget instanceof Widget) {
+                buttons.push(widget);
+            }
+        }
+        return buttons;
+    },
+
+    setButtons: function (buttons) {
+        var buttonsNames = [];
+        for (var i = 0 ; i < buttons.length ; i++) {
+            if (buttons[i] instanceof Widget) {
+                buttonsNames.push(buttons[i].name);
+            }
+        }
+        this.buttonsNames = buttonsNames;
+    },
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Public methods ======
+
+    /**
+     * Add a button to the dialog.
+     *
+     * @method addButton
+     * @param {photonui.Widget} widget The button to add.
+     */
+    addButton: function (widget, layoutOptions) {
+        if (widget.parent) {
+            widget.unparent();
+        }
+        if (layoutOptions) {
+            widget.layoutOptions = layoutOptions;
+        }
+        this._buttonsNames.push(widget.name);
+        widget._parentName = this.name;
+        this._updateButtons();
+    },
+
+    /**
+     * Remove a button from the dialog.
+     *
+     * @method removeButton
+     * @param {photonui.Widget} widget The button to remove.
+     */
+    removeButton: function (widget) {
+        var index = this._buttonsNames.indexOf(widget.name);
+        if (index >= 0) {
+            this._buttonsNames.splice(index, 1);
+            widget._parentName = null;
+        }
+        this._updateButtons();
+    },
+
+    // Alias needed for photonui.Widget.unparent()
+    removeChild: function () {
+        this.$super.apply(this, arguments);
+        this.removeButton.apply(this, arguments);
+    },
+
+    /**
+     * Destroy the widget.
+     *
+     * @method destroy
+     */
+    destroy: function () {
+        var buttons = this.buttons;
+        for (var i = 0 ; i < buttons.length ; i++) {
+            if (buttons[i]) {
+                buttons[i].destroy();
+            }
+        }
+        this.$super();
+    },
+
+    // ====== Private methods ======
+
+    /**
+     * Update dialog buttons.
+     *
+     * @method _updateButtons
+     * @private
+     */
+    _updateButtons: function () {
+        Helpers.cleanNode(this.__html.buttons);
+        var buttons = this.buttons;
+        for (var i = buttons.length - 1 ; i >= 0 ; i--) {
+            this.__html.buttons.appendChild(buttons[i].html);
+        }
+    },
+
+    /**
+     * Build the widget HTML.
+     *
+     * @method _buildHtml
+     * @private
+     */
+    _buildHtml: function () {
+        this.$super();
+        this.__html.window.className += " photonui-dialog";
+
+        this.__html.buttons = document.createElement("div");
+        this.__html.buttons.className = "photonui-dialog-buttons";
+        this.__html.window.appendChild(this.__html.buttons);
+    },
+
+    /**
+     * Called when the visibility changes.
+     *
+     * @method _visibilityChanged
+     * @private
+     * @param {Boolean} visibility Current visibility state (otptional, defaut=this.visible)
+     */
+    _visibilityChanged: function (visibility) {
+        visibility = (visibility !== undefined) ? visibility : this.visible;
+        var buttons = this.buttons;
+        for (var i = 0 ; i < buttons.length ; i++) {
+            if (!(buttons[i] instanceof Widget)) {
+                continue;
+            }
+            buttons[i]._visibilityChanged(visibility);
+        }
+        this.$super(visibility);
+    },
+});
+
+module.exports = Dialog;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_container_expander.js.html b/ref/files/src_container_expander.js.html new file mode 100644 index 00000000..594dc870 --- /dev/null +++ b/ref/files/src_container_expander.js.html @@ -0,0 +1,395 @@ + + + + + src/container/expander.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/container/expander.js

+ +
+
+/*
+ * Copyright (c) 2014-2016, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Alexis BREUST
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule Container
+ * @namespace photonui
+ */
+
+var Helpers = require("../helpers.js");
+var Widget = require("../widget.js");
+var Container = require("./container.js");
+
+/**
+ * Expander container.
+ *
+ * wEvents:
+ *
+ *   * folded:
+ *     - description: called when the expander is folded by user.
+ *     - callback:    function(widget)
+ *   * unfolded:
+ *     - description: called when the expander is unfolded by user.
+ *     - callback:    function(widget)
+ *
+ * @class Expander
+ * @constructor
+ * @extends photonui.Container
+ */
+var Expander = Container.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        this._registerWEvents(["folded", "unfolded"]);
+        this.$super(params);
+
+        this._bindEvent("keypress", this.__html.title, "keypress", this.__onTitleKeyPress);
+        this._bindEvent("click", this.__html.title, "click", this.__onTitleClicked);
+    },
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    /**
+     * The title.
+     *
+     * @property title
+     * @type String
+     * @default "Expander"
+     */
+    _title: "Expander",
+
+    getTitle: function () {
+        "@photonui-update";
+        return this._title;
+    },
+
+    setTitle: function (title) {
+        this._title = title;
+        Helpers.cleanNode(this.__html.title);
+        this.__html.title.appendChild(document.createTextNode(title));
+    },
+
+    /**
+     * Whether the expander is folded.
+     *
+     * @property folded
+     * @type Boolean
+     * @default false
+     */
+    _folded: false,
+
+    getFolded: function () {
+        "@photonui-update";
+        return this._folded;
+    },
+
+    setFolded: function (folded) {
+        this._folded = folded;
+
+        if (this._folded) {
+            this.__html.content.style.display = "none";
+            this.addClass("photonui-expander-folded");
+        } else {
+            this.__html.content.style.display = "block";
+            this.removeClass("photonui-expander-folded");
+        }
+    },
+
+    /**
+     * Container node padding.
+     *
+     * @property padding
+     * @type Number
+     * @default 0
+     */
+    _padding: 0,
+
+    getPadding: function () {
+        "@photonui-update";
+        return this._padding;
+    },
+
+    setPadding: function (padding) {
+        this._padding = padding;
+        this.__html.content.style.padding = padding + "px";
+    },
+
+    /**
+     * Html outer element of the widget (if any).
+     *
+     * @property html
+     * @type HTMLElement
+     * @default null
+     * @readOnly
+     */
+    getHtml: function () {
+        return this.__html.outer;
+    },
+
+    /**
+     * HTML Element that contain the child widget HTML.
+     *
+     * @property containerNode
+     * @type HTMLElement
+     * @readOnly
+     */
+    getContainerNode: function () {
+        return this.__html.content;
+    },
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Public methods ======
+
+    /**
+     * Toggle current folded state and sends and event.
+     *
+     * @method toggleFolded
+     * @param {Event} event
+     */
+    toggleFolded: function () {
+        this.folded = !this._folded;
+
+        if (this._folded) {
+            this._callCallbacks("folded", []);
+        } else {
+            this._callCallbacks("unfolded", []);
+        }
+    },
+
+    // ====== Private methods ======
+
+    /**
+     * Build the widget HTML.
+     *
+     * @method _buildHtml
+     * @private
+     */
+    _buildHtml: function () {
+        this.__html.outer = document.createElement("div");
+        this.__html.outer.className = "photonui-widget photonui-expander";
+
+        this.__html.title = document.createElement("div");
+        this.__html.title.className = "photonui-expander-title";
+        this.__html.title.tabIndex = "0";
+        this.__html.outer.appendChild(this.__html.title);
+
+        this.__html.content = document.createElement("div");
+        this.__html.content.className = "photonui-container photonui-expander-content";
+        this.__html.outer.appendChild(this.__html.content);
+    },
+
+    /**
+     * @method __onTitleClicked
+     * @private
+     */
+    __onTitleClicked: function (widget, event) {
+        this.toggleFolded();
+    },
+
+    /**
+     * @method __onTitleKeyPress
+     * @private
+     */
+    __onTitleKeyPress: function (event) {
+        if (event.charCode == 32 || event.keyCode == 13) {
+            this.toggleFolded();
+        }
+    }
+
+});
+
+module.exports = Expander;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_container_menuitem.js.html b/ref/files/src_container_menuitem.js.html new file mode 100644 index 00000000..04ba2e38 --- /dev/null +++ b/ref/files/src_container_menuitem.js.html @@ -0,0 +1,413 @@ + + + + + src/container/menuitem.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/container/menuitem.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule Container
+ * @namespace photonui
+ */
+
+var Helpers = require("../helpers.js");
+var Widget = require("../widget.js");
+var Container = require("./container.js");
+var BaseIcon = require("../visual/baseicon.js");
+var PhotonImage = require("../visual/image.js");
+
+/**
+ * Menu item.
+ *
+ * @class MenuItem
+ * @constructor
+ * @extends photonui.Container
+ */
+var MenuItem = Container.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        this._registerWEvents(["click"]);
+        this.$super(params);
+
+        this._bindEvent("click", this.__html.outer, "click", function (event) {
+            this._callCallbacks("click", [event]);
+        }.bind(this));
+    },
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    /**
+     * An optional value for the item (can be used in select).
+     *
+     * @property value
+     * @type String (maybe)
+     * @default ""
+     */
+    _value: "",
+
+    getValue: function () {
+        return this._value;
+    },
+
+    setValue: function (value) {
+        this._value = value;
+    },
+
+    /**
+     * The item text.
+     *
+     * @property text
+     * @type String
+     * @default "Menu Item"
+     */
+    _text: "Menu Item",
+
+    getText: function () {
+        "@photonui-update";
+        return this._text;
+    },
+
+    setText: function (text) {
+        this._text = text;
+        Helpers.cleanNode(this.__html.text);
+        this.__html.text.appendChild(document.createTextNode(text));
+    },
+
+    /**
+     * Left icon widget name.
+     *
+     * @property iconName
+     * @type String
+     * @default: null
+     */
+    _iconName: null,
+
+    getIconName: function () {
+        return this._iconName;
+    },
+
+    setIconName: function (iconName) {
+        this._iconName = iconName;
+        Helpers.cleanNode(this.__html.icon);
+        if (this._iconName) {
+            this.__html.icon.appendChild(this.icon.html);
+        }
+    },
+
+    /**
+     * Left icon widget.
+     *
+     * @property icon
+     * @type photonui.BaseIcon
+     * @default: null
+     */
+    getIcon: function () {
+        "@photonui-update";
+        return Widget.getWidget(this._iconName);
+    },
+
+    setIcon: function (icon) {
+        if (icon instanceof BaseIcon || icon instanceof PhotonImage) {
+            this.iconName = icon.name;
+            return;
+        }
+        this.iconName = null;
+    },
+
+    /**
+     * Determine if the item is active (highlighted).
+     *
+     * @property active
+     * @type Boolean
+     * @default false
+     */
+    _active: false,
+
+    getActive: function () {
+        "@photonui-update";
+        return this._active;
+    },
+
+    setActive: function (active) {
+        this._active = active;
+
+        if (active) {
+            this.addClass("photonui-menuitem-active");
+        } else {
+            this.removeClass("photonui-menuitem-active");
+        }
+    },
+
+    /**
+     * Html outer element of the widget (if any).
+     *
+     * @property html
+     * @type HTMLElement
+     * @default null
+     * @readOnly
+     */
+    getHtml: function () {
+        return this.__html.outer;
+    },
+
+    /**
+     * HTML Element that contain the child widget HTML.
+     *
+     * @property containerNode
+     * @type HTMLElement
+     * @readOnly
+     */
+    getContainerNode: function () {
+        return this.__html.widget;
+    },
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Public methods ======
+
+    /**
+     * Destroy the widget.
+     *
+     * @method destroy
+     */
+    destroy: function () {
+        if (this.iconName && this.icon) {
+            this.icon.destroy();
+        }
+
+        this.$super();
+    },
+
+    // ====== Private methods ======
+
+    /**
+     * Build the widget HTML.
+     *
+     * @method _buildHtml
+     * @private
+     */
+    _buildHtml: function () {
+        this.__html.outer = document.createElement("div");
+        this.__html.outer.className = "photonui-widget photonui-menuitem";
+
+        this.__html.icon = document.createElement("span");
+        this.__html.icon.className = "photonui-menuitem-icon";
+        this.__html.outer.appendChild(this.__html.icon);
+
+        this.__html.text = document.createElement("span");
+        this.__html.text.className = "photonui-menuitem-text";
+        this.__html.outer.appendChild(this.__html.text);
+
+        this.__html.widget = document.createElement("span");
+        this.__html.widget.className = "photonui-container photonui-menuitem-widget";
+        this.__html.outer.appendChild(this.__html.widget);
+    },
+
+    //////////////////////////////////////////
+    // Internal Events Callbacks            //
+    //////////////////////////////////////////
+
+    // TODO Internal events callback here
+});
+
+module.exports = MenuItem;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_container_popupwindow.js.html b/ref/files/src_container_popupwindow.js.html new file mode 100644 index 00000000..a6798ec4 --- /dev/null +++ b/ref/files/src_container_popupwindow.js.html @@ -0,0 +1,338 @@ + + + + + src/container/popupwindow.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/container/popupwindow.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule Container
+ * @namespace photonui
+ */
+
+var BaseWindow = require("./basewindow.js");
+
+/**
+ * Popup Window.
+ *
+ * @class PopupWindow
+ * @constructor
+ * @extends photonui.BaseWindow
+ */
+var PopupWindow = BaseWindow.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        this.$super(params);
+        this._bindEvent("document-mousedown-close", document, "mousedown", this.hide.bind(this));
+        this._bindEvent("popup-click-close", this.html, "click", this.hide.bind(this));
+        this._bindEvent("mousedown-preventclose", this.html, "mousedown", function (event) {
+            event.stopPropagation();
+        }.bind(this));
+    },
+
+    /**
+     * HTML Element that contain the child widget HTML.
+     *
+     * @property containerNode
+     * @type HTMLElement
+     * @readOnly
+     */
+    getContainerNode: function () {
+        return this.__html.inner;
+    },
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Public methods ======
+
+    /**
+     * Pop the window at the given position.
+     *
+     * @method popupXY
+     * @param {Number} x
+     * @param {Number} y
+     */
+    popupXY: function (x, y) {
+        this.setPosition(-1337, -1337);
+        this.show();
+
+        var bw = document.getElementsByTagName("body")[0].offsetWidth;
+        var bh = document.getElementsByTagName("body")[0].offsetHeight;
+        var pw = this.offsetWidth;
+        var ph = this.offsetHeight;
+
+        if (x + pw > bw) {
+            x = bw - pw;
+        }
+
+        if (y + ph > bh) {
+            y -= ph;
+        }
+
+        if (x < 0) {
+            x = 0;
+        }
+        if (y < 0) {
+            y = 0;
+        }
+
+        this.setPosition(x, y);
+    },
+
+    /**
+     * Pop the window at the best position for the given widget.
+     *
+     * @method popupWidget
+     * @param {photonui.Widget} widget
+     */
+    popupWidget: function (widget) {
+        this.setPosition(-1337, -1337);
+        this.show();
+
+        var e_body = document.getElementsByTagName("body")[0];
+        var x = 0;
+        var y = 0;
+        var wpos = widget.absolutePosition;
+        var wh = widget.offsetHeight;
+        var ww = widget.offsetWidth;
+        var pw = this.offsetWidth;
+        var ph = this.offsetHeight;
+
+        if (wpos.x + pw < e_body.offsetWidth) {
+            x = wpos.x;
+        } else if (wpos.x + ww < e_body.offsetWidth) {
+            x = wpos.x + ww - pw;
+        } else {
+            x = e_body.offsetWidth - pw;
+        }
+
+        if (wpos.y + wh + ph < e_body.offsetHeight) {
+            y = wpos.y + wh + 1;
+        } else if (wpos.y - ph >= 0) {
+            y = wpos.y - ph - 1;
+        }
+
+        if (x < 0) {
+            x = 0;
+        }
+        if (y < 0) {
+            y = 0;
+        }
+
+        this.setPosition(x, y);
+    },
+
+    // ====== Private methods ======
+
+    /**
+     * Build the widget HTML.
+     *
+     * @method _buildHtml
+     * @private
+     */
+    _buildHtml: function () {
+        this.$super();
+        this.__html.window.className += " photonui-popupwindow";
+
+        this.__html.inner = document.createElement("div");
+        this.__html.window.appendChild(this.__html.inner);
+    }
+});
+
+module.exports = PopupWindow;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_container_submenuitem.js.html b/ref/files/src_container_submenuitem.js.html new file mode 100644 index 00000000..c633602b --- /dev/null +++ b/ref/files/src_container_submenuitem.js.html @@ -0,0 +1,314 @@ + + + + + src/container/submenuitem.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/container/submenuitem.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule Container
+ * @namespace photonui
+ */
+
+var Widget = require("../widget.js");
+var MenuItem = require("./menuitem.js");
+var Menu = require("../layout/menu.js");
+
+/**
+ * Submenu Menu item (fold/unfold a submenu).
+ *
+ * @class SubMenuItem
+ * @constructor
+ * @extends photonui.MenuItem
+ */
+var SubMenuItem = MenuItem.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        this.$super(params);
+        this.addClass("photonui-submenuitem");
+        this.registerCallback("toggle-folding", "click", this.__onItemClicked, this);
+    },
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    /**
+     * The submenu widget name.
+     *
+     * @property menuName
+     * @type String
+     * @default null
+     */
+    _menuName: null,
+
+    getMenuName: function () {
+        "@photonui-update";
+        return this._menuName;
+    },
+
+    setMenuName: function (menuName) {
+        var that = this;
+
+        function _init() {
+            if (!that.menu) {
+                return;
+            }
+            that.menu.registerCallback("fold", "hide", that.__onToggleFold, that);
+            that.menu.registerCallback("unfold", "show", that.__onToggleFold, that);
+            that.active = that.menu.visible;
+        }
+
+        if (this.menuName && this.menu) {
+            this.menu.removeCallback("fold");
+            this.menu.removeCallback("unfold");
+        }
+
+        this._menuName = menuName;
+
+        if (this.menuName) {
+            if (this.menu) {
+                _init();
+            } else {
+                setTimeout(_init, 10);
+            }
+        }
+    },
+
+    /**
+     * The submenu widget.
+     *
+     * @property menu
+     * @type photonui.Menu
+     * @default null
+     */
+    getMenu: function () {
+        return Widget.getWidget(this.menuName);
+    },
+
+    setMenu: function (menu) {
+        if (menu instanceof Menu) {
+            this.menuName = menu.name;
+        } else {
+            this.menuName = null;
+        }
+    },
+
+    //////////////////////////////////////////
+    // Internal Events Callbacks            //
+    //////////////////////////////////////////
+
+    /**
+     * @method __onToggleFold
+     * @private
+     */
+    __onToggleFold: function (widget) {
+        this.active = widget.visible;
+    },
+
+    /**
+     * @method __onItemClicked
+     * @private
+     */
+    __onItemClicked: function (widget) {
+        this.menu.visible = !this.menu.visible;
+    }
+});
+
+module.exports = SubMenuItem;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_container_tabitem.js.html b/ref/files/src_container_tabitem.js.html new file mode 100644 index 00000000..8c9b125b --- /dev/null +++ b/ref/files/src_container_tabitem.js.html @@ -0,0 +1,573 @@ + + + + + src/container/tabitem.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/container/tabitem.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <https://github.com/flozz>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule Container
+ * @namespace photonui
+ */
+
+var Helpers = require("../helpers.js");
+var Widget = require("../widget.js");
+var BaseIcon = require("../visual/baseicon.js");
+var Container = require("./container.js");
+var IconButton = require("../interactive/iconbutton.js");
+var PhotonImage = require("../visual/image.js");
+
+/**
+ * Tab Item.
+ *
+ *  wEvents:
+ *
+ *   * click:
+ *     - description: called when the tab was clicked.
+ *     - callback:    function(widget, event)
+ *
+ * @class TabItem
+ * @constructor
+ * @extends photonui.Container
+ * @param {Object} params An object that can contain any property of the widget (optional).
+ */
+var TabItem = Container.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        this._registerWEvents(["click"]);
+        this.$super(params);
+
+        this._bindEvent("tab-click", this.__html.tab, "click", this.__onClick.bind(this));
+        this._update();
+    },
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    /**
+     * Tab title.
+     *
+     * @property title
+     * @type String
+     * @default "Tab"
+     */
+    _title: "Tab",
+
+    getTitle: function () {
+        "@photonui-update";
+        return this._title;
+    },
+
+    setTitle: function (title) {
+        this._title = title;
+        Helpers.cleanNode(this.__html.title);
+        this.__html.title.appendChild(document.createTextNode(title));
+    },
+
+    /**
+     * Definie if the tabItem title is displayed or hidden.
+     *
+     * @property titleVisible
+     * @type Boolean
+     * @default true
+     */
+    _titleVisible: true,
+
+    isTitleVisible: function () {
+        return this._titleVisible;
+    },
+
+    setTitleVisible: function (titleVisible) {
+        this._titleVisible = titleVisible;
+        this._update();
+    },
+
+    /**
+     * Html outer element of the widget (if any).
+     *
+     * @property html
+     * @type HTMLElement
+     * @default null
+     * @readOnly
+     */
+    getHtml: function () {
+        return this.__html.div;
+    },
+
+    /**
+     * Tab Html element.
+     *
+     * @property tabHtml
+     * @type HTMLElement
+     * @default null
+     * @readOnly
+     */
+    getTabHtml: function () {
+        return this.__html.tab;
+    },
+
+    /**
+     * HTML Element that contain the child widget HTML.
+     *
+     * @property containerNode
+     * @type HTMLElement
+     * @readOnly
+     */
+    getContainerNode: function () {
+        return this.__html.div;
+    },
+
+    /**
+     * Is the widget visible or hidden.
+     *
+     * @property visible
+     * @type Boolean
+     * @default false
+     */
+    _visible: false,
+
+    setVisible: function (visible, noParent) {
+        this.$super(visible);
+
+        if (visible) {
+            if (this.parent) {
+                var children = this.parent.children;
+                for (var i = 0 ; i < children.length ; i++) {
+                    if (!(children[i] instanceof TabItem)) {
+                        continue;
+                    }
+                    if (children[i] === this) {
+                        continue;
+                    }
+                    if (children[i].visible) {
+                        children[i].setVisible(false, true);
+                    }
+                }
+                this.parent._activeTabName = this.name;
+            }
+
+            this.addClass("photonui-tabitem-active");
+            this.__html.tab.className = "photonui-tabitem-tab photonui-tabitem-active";
+        } else {
+            if (this.parent && !noParent) {
+                this.parent.activeTab = null;
+            }
+            this.removeClass("photonui-tabitem-active");
+            this.__html.tab.className = "photonui-tabitem-tab";
+        }
+    },
+
+    /**
+     * Left icon widget name
+     *
+     * @property leftIconName
+     * @type String
+     * @default null
+     */
+    _leftIconName: null,
+
+    getLeftIconName: function () {
+        "@photonui-update";
+        return this._leftIconName;
+    },
+
+    setLeftIconName: function (leftIconName) {
+        this._leftIconName = leftIconName;
+        Helpers.cleanNode(this.__html.leftIcon);
+        if (this._leftIconName) {
+            this.__html.leftIcon.appendChild(this.leftIcon.html);
+            this.leftIconVisible = true;
+        }
+    },
+
+    /**
+     * Left icon widget
+     *
+     * @property leftIcon
+     * @type photonui.Icon
+     * @default null
+     */
+    getLeftIcon: function () {
+        return Widget.getWidget(this._leftIconName);
+    },
+
+    setLeftIcon: function (leftIcon) {
+        if (leftIcon instanceof BaseIcon || leftIcon instanceof IconButton || leftIcon instanceof PhotonImage) {
+            this.leftIconName = leftIcon.name;
+        } else {
+            this.leftIconName = null;
+        }
+    },
+
+    /**
+     * Define if the left icon is displayed or hidden.
+     *
+     * @property leftIconVisible
+     * @type Boolean
+     * @default true
+     */
+    _leftIconVisible: true,
+
+    isLeftIconVisible: function () {
+        return this._leftIconVisible;
+    },
+
+    setLeftIconVisible: function (leftIconVisible) {
+        this._leftIconVisible = leftIconVisible;
+        this._update();
+    },
+
+    /**
+     * Right icon widget name
+     *
+     * @property rigthIconName
+     * @type String
+     * @default null
+     */
+
+    _rightIconName: null,
+
+    getRightIconName: function () {
+        "@photonui-update";
+        return this._rightIconName;
+    },
+
+    setRightIconName: function (rightIconName) {
+        this._rightIconName = rightIconName;
+        Helpers.cleanNode(this.__html.rightIcon);
+        if (this._rightIconName) {
+            this.__html.rightIcon.appendChild(this.rightIcon.html);
+            this.rightIconVisible = true;
+        }
+    },
+
+    /**
+     * Right icon widget
+     *
+     * @property rightIcon
+     * @type photonui.Icon
+     * @default null
+     */
+    getRightIcon: function () {
+        return Widget.getWidget(this._rightIconName);
+    },
+
+    setRightIcon: function (rightIcon) {
+        if (rightIcon instanceof BaseIcon || rightIcon instanceof IconButton || rightIcon instanceof PhotonImage) {
+            this.rightIconName = rightIcon.name;
+        } else {
+            this.rightIconName = null;
+        }
+    },
+
+    /**
+     * Define if the right icon is displayed or hidden.
+     *
+     * @property rightIconVisible
+     * @type Boolean
+     * @default true
+     */
+    _rightIconVisible: true,
+
+    isRightIconVisible: function () {
+        return this._rightIconVisible;
+    },
+
+    setRightIconVisible: function (rightIconVisible) {
+        this._rightIconVisible = rightIconVisible;
+        this._update();
+    },
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Public methods ======
+
+    /**
+     * Destroy the widget.
+     *
+     * @method destroy
+     */
+    destroy: function () {
+        if (this.leftIconName && this.leftIcon) {
+            this.leftIcon.destroy();
+        }
+
+        if (this.rightIconName && this.rightIcon) {
+            this.rightIcon.destroy();
+        }
+
+        this.$super();
+    },
+
+    // ====== Private methods ======
+
+    _update: function () {
+        if (this.__html.leftIcon.parentNode == this.__html.tab) {
+            this.__html.tab.removeChild(this.__html.leftIcon);
+        }
+        if (this.__html.title.parentNode == this.__html.tab) {
+            this.__html.tab.removeChild(this.__html.title);
+        }
+        if (this.__html.rightIcon.parentNode == this.__html.tab) {
+            this.__html.tab.removeChild(this.__html.rightIcon);
+        }
+
+        if (this.leftIconName && this.leftIconVisible) {
+            this.__html.tab.appendChild(this.__html.leftIcon);
+        }
+
+        if (this.title && this.titleVisible) {
+            this.__html.tab.appendChild(this.__html.title);
+        }
+
+        if (this.rightIconName && this.rightIconVisible) {
+            this.__html.tab.appendChild(this.__html.rightIcon);
+        }
+    },
+
+    /**
+     * Build the widget HTML.
+     *
+     * @method _buildHtml
+     * @private
+     */
+    _buildHtml: function () {
+        this.__html.div = document.createElement("div");
+        this.__html.div.className = "photonui-widget photonui-tabitem photonui-container";
+
+        this.__html.tab = document.createElement("div");
+        this.__html.tab.className = "photonui-tabitem-tab";
+
+        this.__html.leftIcon = document.createElement("span");
+        this.__html.leftIcon.className = "photonui-tabitem-lefticon";
+        this.__html.tab.appendChild(this.__html.leftIcon);
+
+        this.__html.title = document.createElement("span");
+        this.__html.title.className = "photonui-tabitem-title";
+        this.__html.tab.appendChild(this.__html.title);
+
+        this.__html.rightIcon = document.createElement("span");
+        this.__html.rightIcon.className = "photonui-tabitem-righticon";
+        this.__html.tab.appendChild(this.__html.rightIcon);
+
+    },
+
+    //////////////////////////////////////////
+    // Internal Events Callbacks            //
+    //////////////////////////////////////////
+
+    /**
+     * Called when the tab is clicked.
+     *
+     * @method __onClick
+     * @private
+     * @param event
+     */
+    __onClick: function (event) {
+        this.show();
+        this._callCallbacks("click", [event]);
+    }
+
+});
+
+module.exports = TabItem;
+
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_container_viewport.js.html b/ref/files/src_container_viewport.js.html new file mode 100644 index 00000000..6336d4bc --- /dev/null +++ b/ref/files/src_container_viewport.js.html @@ -0,0 +1,557 @@ + + + + + src/container/viewport.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/container/viewport.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule Container
+ * @namespace photonui
+ */
+
+var Container = require("./container.js");
+var numberToCssSize = require("../helpers.js").numberToCssSize;
+
+/**
+ * Viewport.
+ *
+ * @class Viewport
+ * @constructor
+ * @extends photonui.Container
+ */
+var Viewport = Container.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        this.$super(params);
+    },
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    /**
+     * Window container node padding.
+     *
+     * @property padding
+     * @type Number
+     * @default 0
+     */
+    _padding: 0,
+
+    getPadding: function () {
+        "@photonui-update";
+        return this._padding;
+    },
+
+    setPadding: function (padding) {
+        this._padding = padding;
+        this.containerNode.style.padding = padding + "px";
+    },
+
+    /**
+     * Visibility of the vertical scrollbar.
+     *
+     *   * `true`: displayed,
+     *   * `false`: hidden,
+     *   * `null`: auto.
+     *
+     * @property verticalScrollbar
+     * @type Boolean
+     * @default null
+     */
+    _verticalScrollbar: null,
+
+    getVerticalScrollbar: function () {
+        "@photonui-update";
+        return this._verticalScrollbar;
+    },
+
+    setVerticalScrollbar: function (visibility) {
+        this._verticalScrollbar = visibility;
+        if (visibility === true) {
+            this.__html.viewport.style.overflowY = "scroll";
+        } else if (visibility === false) {
+            this.__html.viewport.style.overflowY = "hidden";
+        } else {
+            this.__html.viewport.style.overflowY = "auto";
+        }
+    },
+
+    /**
+     * Visibility of the horizontal scrollbar.
+     *
+     *   * `true`: displayed,
+     *   * `false`: hidden,
+     *   * `null`: auto.
+     *
+     * @property horizontalScrollbar
+     * @type Boolean
+     * @default null
+     */
+    _horizontalScrollbar: null,
+
+    getHorizontalScrollbar: function () {
+        "@photonui-update";
+        return this._horizontalScrollbar;
+    },
+
+    setHorizontalScrollbar: function (visibility) {
+        this._horizontalScrollbar = visibility;
+        if (visibility === true) {
+            this.__html.viewport.style.overflowX = "scroll";
+        } else if (visibility === false) {
+            this.__html.viewport.style.overflowX = "hidden";
+        } else {
+            this.__html.viewport.style.overflowX = "auto";
+        }
+    },
+
+    /**
+     * Minimum width.
+     *
+     *     * Number: the size in px
+     *     * Infinity: 100% of the parent width
+     *     * null: no minimum width
+     *
+     * @property minWidth
+     * @type Number
+     * @default null
+     */
+    _minWidth: null,
+
+    getMinWidth: function () {
+        "@photonui-update";
+        return this._minWidth;
+    },
+
+    setMinWidth: function (minWidth) {
+        this._minWidth = minWidth;
+        this.__html.viewport.style.minWidth = numberToCssSize(minWidth, null, 0);
+    },
+
+    /**
+     * Maximum width.
+     *
+     *     * Number: the size in px
+     *     * Infinity: 100% of the parent width
+     *     * null: no maximum width
+     *
+     * @property maxWidth
+     * @type Number
+     * @default null
+     */
+    _maxWidth: null,
+
+    getMaxWidth: function () {
+        "@photonui-update";
+        return this._maxWidth;
+    },
+
+    setMaxWidth: function (maxWidth) {
+        this._maxWidth = maxWidth;
+        this.__html.viewport.style.maxWidth = numberToCssSize(maxWidth, null, Infinity);
+    },
+
+    /**
+     * Width.
+     *
+     *     * Number: the size in px
+     *     * Infinity: 100% of the parent width
+     *     * null: auto
+     *
+     * @property width
+     * @type Number
+     * @default Infinity
+     */
+    _width: Infinity,
+
+    getWidth: function () {
+        "@photonui-update";
+        return this._width;
+    },
+
+    setWidth: function (width) {
+        this._width = width;
+        this.__html.viewport.style.width = numberToCssSize(width, null);
+    },
+
+    /**
+     * Minimum height.
+     *
+     *     * Number: the size in px
+     *     * Infinity: 100% of the parent height
+     *     * null: no minimum height
+     *
+     * @property minHeight
+     * @type Number
+     * @default null
+     */
+    _minHeight: null,
+
+    getMinHeight: function () {
+        "@photonui-update";
+        return this._minHeight;
+    },
+
+    setMinHeight: function (minHeight) {
+        this._minHeight = minHeight;
+        this.__html.viewport.style.minHeight = numberToCssSize(minHeight, null, 0);
+    },
+
+    /**
+     * Maximum height.
+     *
+     *     * Number: the size in px
+     *     * Infinity: 100% of the parent height
+     *     * null: no maximum height
+     *
+     * @property maxHeight
+     * @type Number
+     * @default null
+     */
+    _maxHeight: null,
+
+    getMaxHeight: function () {
+        "@photonui-update";
+        return this._maxHeight;
+    },
+
+    setMaxHeight: function (maxHeight) {
+        this._maxHeight = maxHeight;
+        this.__html.viewport.style.maxHeight = numberToCssSize(maxHeight, null, Infinity);
+    },
+
+    /**
+     * Height.
+     *
+     *     * Number: the size in px
+     *     * Infinity: 100% of the parent height
+     *     * null: auto
+     *
+     * @property height
+     * @type Number
+     * @default Infinity
+     */
+    _height: Infinity,
+
+    getHeight: function () {
+        "@photonui-update";
+        return this._height;
+    },
+
+    setHeight: function (height) {
+        this._height = height;
+        this.__html.viewport.style.height = numberToCssSize(height, null);
+    },
+
+    /**
+     * Html outer element of the widget (if any).
+     *
+     * @property html
+     * @type HTMLElement
+     * @default null
+     * @readOnly
+     */
+    getHtml: function () {
+        setTimeout(this._sizingHack.bind(this), 10);
+        return this.__html.viewport;
+    },
+
+    /**
+     * HTML Element that contain the child widget HTML.
+     *
+     * @property containerNode
+     * @type HTMLElement
+     * @readOnly
+     */
+    getContainerNode: function () {
+        return this.__html.viewport;
+    },
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Private methods ======
+
+    /**
+     * Build the widget HTML.
+     *
+     * @method _buildHtml
+     * @private
+     */
+    _buildHtml: function () {
+        this.__html.viewport = document.createElement("div");
+        this.__html.viewport.className = "photonui-widget photonui-viewport photonui-container";
+    },
+
+    /**
+     * Called when the visibility changes.
+     *
+     * @method _visibilityChanged
+     * @private
+     * @param {Boolean} visibility Current visibility state (otptional, defaut=this.visible)
+     */
+    _visibilityChanged: function (visibility) {
+        visibility = (visibility !== undefined) ? visibility : this.visible;
+        if (visibility) {
+            this._sizingHack();
+        }
+        this.$super(visibility);
+    },
+
+    /**
+     * HACK: set the right height.
+     *
+     * @method _sizingHack
+     * @private
+     */
+    _sizingHack: function () {
+        if (this.height !== Infinity) {
+            return;
+        }
+        if (this.visible && this.__html.viewport.parentNode) {
+            var node = this.__html.viewport;
+            var height = 0;
+
+            this.__html.viewport.style.display = "none";
+
+            while (node = node.parentNode) {  // jshint ignore:line
+                if (!node) {
+                    break;
+                }
+                if (node.offsetHeight > 0) {
+                    height = node.offsetHeight;
+                    var style = getComputedStyle(node);
+                    height -= parseFloat(style.paddingTop);
+                    height -= parseFloat(style.paddingBottom);
+                    height -= parseFloat(style.borderTopWidth);
+                    height -= parseFloat(style.borderBottomWidth);
+                    break;
+                }
+            }
+
+            if (this.maxHeight !== null) {
+                height = Math.min(this.maxHeight, height);
+            }
+            if (this.minHeight !== null) {
+                height = Math.max(this.minHeight, height);
+            }
+            this.__html.viewport.style.height = height + "px";
+            this.__html.viewport.style.display = "";
+        }
+    },
+
+    //////////////////////////////////////////
+    // Internal Events Callbacks            //
+    //////////////////////////////////////////
+
+    /**
+     * Called when the locale is changed.
+     *
+     * @method __onLocaleChanged
+     * @private
+     */
+    __onLocaleChanged: function () {
+        // pass
+    }
+});
+
+module.exports = Viewport;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_container_window.js.html b/ref/files/src_container_window.js.html new file mode 100644 index 00000000..baadfeec --- /dev/null +++ b/ref/files/src_container_window.js.html @@ -0,0 +1,656 @@ + + + + + src/container/window.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/container/window.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule Container
+ * @namespace photonui
+ */
+
+var Stone = require("stonejs");
+var Helpers = require("../helpers.js");
+var Widget = require("../widget.js");
+var BaseWindow = require("./basewindow.js");
+
+var _windowList = [];
+
+/**
+ * Window.
+ *
+ * wEvents:
+ *
+ *   * close-button-clicked:
+ *      - description: called when the close button was clicked.
+ *      - callback:    function(widget)
+ *
+ * @class Window
+ * @constructor
+ * @extends photonui.BaseWindow
+ */
+var Window = BaseWindow.$extend({  // jshint ignore:line
+
+    // Constructor
+    __init__: function (params) {
+        this._registerWEvents(["close-button-clicked"]);
+        this.$super(params);
+
+        // Bind js events
+        this._bindEvent("move.dragstart", this.__html.windowTitle, "mousedown", this.__moveDragStart.bind(this));
+        this._bindEvent("move.touchstart", this.__html.windowTitle, "touchstart", this.__moveTouchStart.bind(this));
+
+        this._bindEvent("closeButton.click", this.__html.windowTitleCloseButton, "click",
+                        this.__closeButtonClicked.bind(this));
+        this._bindEvent("totop", this.__html.window, "mousedown", this.moveToFront.bind(this));
+        this._bindEvent("totop-touch", this.__html.window, "touchstart", this.moveToFront.bind(this));
+
+        // Update Properties
+        this.moveToFront();
+    },
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    /**
+     * The window title.
+     *
+     * @property title
+     * @type String
+     * @default "Window"
+     */
+    _title: "Window",
+
+    getTitle: function () {
+        "@photonui-update";
+        return this._title;
+    },
+
+    setTitle: function (title) {
+        this._title = title;
+        Helpers.cleanNode(this.__html.windowTitleText);
+        this.__html.windowTitleText.appendChild(document.createTextNode(title));
+    },
+
+    /**
+     * Determine if the window can be moved (drag & drop) by the user.
+     *
+     * @property movable
+     * @type Boolean
+     * @default true
+     */
+    _movable: true,
+
+    isMovable: function () {
+        return this._movable && (!this._fullscreen);
+    },
+
+    setMovable: function (movable) {
+        this._movable = movable;
+    },
+
+    /**
+     * Fullscreen Window
+     *
+     * @property fullscreen
+     * @type Boolean
+     * @default false
+     */
+    _fullscreen: false,
+
+    isFullscreen: function () {
+        return this._fullscreen;
+    },
+
+    setFullscreen: function (fullscreen) {
+        this._fullscreen = Boolean(fullscreen);
+        if (this._fullscreen) {
+            this.addClass("photonui-window-fullscreen");
+        } else {
+            this.removeClass("photonui-window-fullscreen");
+        }
+    },
+
+    /**
+     * Determine if the close button in the title bar is displayed or not.
+     *
+     * @property closeButtonVisible
+     * @type Boolean
+     * default: true
+     */
+    _closeButtonVisible: true,
+
+    getCloseButtonVisible: function () {
+        "@photonui-update";
+        return this._closeButtonVisible;
+    },
+
+    setCloseButtonVisible: function (closeButtonVisible) {
+        this._closeButtonVisible = closeButtonVisible;
+
+        if (closeButtonVisible) {
+            this.addClass("photonui-window-have-button");
+            this.__html.windowTitleCloseButton.style.display = "block";
+        } else {
+            this.removeClass("photonui-window-have-button");
+            this.__html.windowTitleCloseButton.style.display = "none";
+        }
+    },
+
+    /**
+     * Modal window?
+     *
+     * @property modal
+     * @type Boolean
+     * @default false
+     */
+    _modal: false,
+
+    isModal: function () {
+        return this._modal;
+    },
+
+    setModal: function (modal) {
+        this._modal = modal;
+        if (modal && !this.__html.modalBox) {
+            this.__html.modalBox = document.createElement("div");
+            this.__html.modalBox.className = "photonui-window-modalbox";
+            var parentNode = Widget.e_parent || document.getElementsByTagName("body")[0];
+            parentNode.appendChild(this.__html.modalBox);
+            this.visible = this.visible; // Force update
+        } else if (!modal && this.__html.modalBox) {
+            this.__html.modalBox.parentNode.removeChild(this.__html.modalBox);
+            delete this.__html.modalBox;
+        }
+    },
+
+    /**
+     * HTML Element that contain the child widget HTML.
+     *
+     * @property containerNode
+     * @type HTMLElement
+     * @readOnly
+     */
+    getContainerNode: function () {
+        return this.__html.windowContent;
+    },
+
+    setVisible: function (visible) {
+        this.$super(visible);
+        if (this.visible) {
+            this.moveToFront();
+            if (this.modal) {
+                this.__html.modalBox.style.display = "block";
+            }
+        } else {
+            this.moveToBack();
+            if (this.modal) {
+                this.__html.modalBox.style.display = "none";
+            }
+        }
+    },
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Public methods ======
+
+    /**
+     * Bring the window to front.
+     *
+     * @method moveToFront
+     */
+    moveToFront: function () {
+        var index = _windowList.indexOf(this);
+        if (index >= 0) {
+            _windowList.splice(index, 1);
+        }
+        _windowList.unshift(this);
+        this._updateWindowList();
+    },
+
+    /**
+     * Bring the window to the back.
+     *
+     * @method moveToBack
+     */
+    moveToBack: function () {
+        var index = _windowList.indexOf(this);
+        if (index >= 0) {
+            _windowList.splice(index, 1);
+        }
+        _windowList.push(this);
+        this._updateWindowList();
+    },
+
+    /**
+     * Destroy the widget.
+     *
+     * @method destroy
+     */
+    destroy: function () {
+        this.modal = false;
+        var index = _windowList.indexOf(this);
+        if (index >= 0) {
+            _windowList.splice(index, 1);
+        }
+        this.$super();
+    },
+
+    // ====== Private methods ======
+
+    /**
+     * Build the widget HTML.
+     *
+     * @method _buildHtml
+     * @private
+     */
+    _buildHtml: function () {
+        var _ = Stone.lazyGettext;
+
+        this.$super();
+        this.__html.window.className += " photonui-window";
+
+        this.__html.windowTitle = document.createElement("div");
+        this.__html.windowTitle.className = "photonui-window-title";
+        this.__html.window.appendChild(this.__html.windowTitle);
+
+        this.__html.windowTitleCloseButton = document.createElement("button");
+        this.__html.windowTitleCloseButton.className = "photonui-window-title-close-button fa fa-times";
+        this.__html.windowTitleCloseButton.title = _("Close");
+        this.__html.windowTitle.appendChild(this.__html.windowTitleCloseButton);
+
+        this.__html.windowTitleText = document.createElement("span");
+        this.__html.windowTitleText.className = "photonui-window-title-text";
+        this.__html.windowTitle.appendChild(this.__html.windowTitleText);
+
+        this.__html.windowContent = document.createElement("div");
+        this.__html.windowContent.className = "photonui-container photonui-window-content";
+        this.__html.window.appendChild(this.__html.windowContent);
+    },
+
+    /**
+     * Update all the windows.
+     *
+     * @method _updateWindowList
+     * @private
+     */
+    _updateWindowList: function () {
+        for (var i = _windowList.length - 1, z = 0 ; i >= 0 ; i--, z++) {   // jshint ignore:line
+            if (i === 0) {
+                _windowList[i].html.style.zIndex = 2001;
+                _windowList[i].addClass("photonui-active");
+            } else {
+                _windowList[i].html.style.zIndex = 1000 + z;
+                _windowList[i].removeClass("photonui-active");
+            }
+            if (_windowList[i].modal) {
+                _windowList[i].html.style.zIndex = 3001;
+            }
+        }
+    },
+
+    //////////////////////////////////////////
+    // Internal Events Callbacks            //
+    //////////////////////////////////////////
+
+    /**
+     * Start moving the window.
+     *
+     * @method _moveDragStart
+     * @private
+     * @param {Object} event
+     */
+    __moveDragStart: function (event) {
+        if (!this.movable || event.button > 0 || event.target === this.__html.windowTitleCloseButton) {
+            return;
+        }
+        var offsetX = (event.offsetX !== undefined) ? event.offsetX : event.layerX;
+        var offsetY = (event.offsetY !== undefined) ? event.offsetY : event.layerY;
+        this.__html.windowTitle.style.cursor = "move";
+        this._bindEvent("move.dragging", document, "mousemove", this.__moveDragging.bind(this, offsetX, offsetY));
+        this._bindEvent("move.dragend", document, "mouseup", this.__moveDragEnd.bind(this));
+    },
+
+    /**
+     * Move the window.
+     *
+     * @method _moveDragging
+     * @private
+     * @param {Number} offsetX
+     * @param {Number} offsetY
+     * @param {Object} event
+     */
+    __moveDragging: function (offsetX, offsetY, event) {
+        this.__internalDragging(offsetX, offsetY, event.pageX, event.pageY);
+    },
+
+    /**
+     * Stop moving the window.
+     *
+     * @method _moveDragEnd
+     * @private
+     * @param {Object} event
+     */
+    __moveDragEnd: function (event) {
+        this.__html.windowTitle.style.cursor = "default";
+        this._unbindEvent("move.dragging");
+        this._unbindEvent("move.dragend");
+    },
+
+    /**
+     * Move the window.
+     *
+     * @method __internalDragging
+     * @private
+     * @param {Number} offsetX
+     * @param {Number} offsetY
+     * @param {Number} pageX
+     * @param {Number} pageY
+     */
+    __internalDragging: function (offsetX, offsetY, pageX, pageY) {
+        var e_body = document.getElementsByTagName("body")[0];
+        var x = Math.min(Math.max(pageX - offsetX, 40 - this.offsetWidth), e_body.offsetWidth - 40);
+        var y = Math.max(pageY - offsetY, 0);
+        if (e_body.offsetHeight > 0) {
+            y = Math.min(y, e_body.offsetHeight - this.__html.windowTitle.offsetHeight);
+        }
+        this.setPosition(x, y);
+    },
+
+    /**
+     * Start moving the window.
+     *
+     * @method _moveTouchStart
+     * @private
+     * @param {Object} event
+     */
+    __moveTouchStart: function (event) {
+        if (!this.movable) {
+            return;
+        }
+        if (event.target !== this.__html.windowTitle) {
+            return;
+        }
+
+        var touchEvent = this.__getTouchEvent(event);
+        this.__html.windowTitle.style.cursor = "move";
+        this._bindEvent("move.touchmove", document, "touchmove",
+            this.__moveTouchMove.bind(this, touchEvent.offsetX, touchEvent.offsetY));
+        this._bindEvent("move.touchend", document, "touchend", this.__moveTouchEnd.bind(this));
+        this._bindEvent("move.touchcancel", document, "touchcancel", this.__moveTouchEnd.bind(this));
+    },
+
+    /**
+     * Move the window.
+     *
+     * @method _moveTouchMove
+     * @private
+     * @param {Number} offsetX
+     * @param {Number} offsetY
+     * @param {Object} event
+     */
+    __moveTouchMove: function (offsetX, offsetY, event) {
+        var touchEvent = this.__getTouchEvent(event);
+        this.__internalDragging(offsetX, offsetY, touchEvent.pageX, touchEvent.pageY);
+    },
+
+    /**
+     * Stop moving the window.
+     *
+     * @method _moveTouchEnd
+     * @private
+     * @param {Object} event
+     */
+    __moveTouchEnd: function (event) {
+        this.__html.windowTitle.style.cursor = "default";
+        this._unbindEvent("move.touchmove");
+        this._unbindEvent("move.touchend");
+        this._unbindEvent("move.touchcancel");
+    },
+
+    /**
+     * Gets the first touch event and normalizes pageX/Y and offsetX/Y properties.
+     *
+     * @method _moveTouchEnd
+     * @private
+     * @param {Object} event
+     */
+    __getTouchEvent: function (event) {
+        if (event.touches && event.touches.length) {
+            event.preventDefault();
+            var evt = event.touches[0];
+            evt.pageX = evt.pageX || evt.clientX;
+            evt.pageY = evt.pageX || evt.clientY;
+
+            var position = Helpers.getAbsolutePosition(event.target);
+            evt.offsetX = evt.offsetX || evt.pageX - position.x;
+            evt.offsetY = evt.offsetY || evt.pageY - position.y;
+            return evt;
+        }
+
+        return event;
+    },
+
+    /**
+     * Close button clicked.
+     *
+     * @method _closeButtonClicked
+     * @private
+     * @param {Object} event
+     */
+    __closeButtonClicked: function (event) {
+        this._callCallbacks("close-button-clicked");
+    },
+
+    /**
+     * Called when the locale is changed.
+     *
+     * @method __onLocaleChanged
+     * @private
+     */
+    __onLocaleChanged: function () {
+        this.$super();
+        this.__html.windowTitleCloseButton.title = Stone.lazyGettext("Close");
+    }
+});
+
+module.exports = Window;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_dataview_dataview.js.html b/ref/files/src_dataview_dataview.js.html new file mode 100644 index 00000000..158b6c47 --- /dev/null +++ b/ref/files/src_dataview_dataview.js.html @@ -0,0 +1,1211 @@ + + + + + src/dataview/dataview.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/dataview/dataview.js

+ +
+
+/*
+ * Copyright (c) 2014-2016, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Valentin Ledrapier
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule DataView
+ * @namespace photonui
+ */
+
+var lodash = require("lodash");
+
+var Helpers = require("../helpers.js");
+var Widget = require("../widget.js");
+
+/**
+ * DataView container.
+ *
+ * wEvents:
+ *
+ *   * item-click:
+ *     - description: called when an item is clicked.
+ *     - callback:    function (event, item)
+ *
+ *   * item-select:
+ *     - description: called when an item is selected.
+ *     - callback:    function (item)
+ *
+ *   * item-unselect:
+ *     - description: called when an item is unselected.
+ *     - callback:    function (item)
+ *
+ *   * item-sort:
+ *     - description: called when an item is moved to a new position.
+ *     - callback:    function (item, position)
+ *
+ * @class DataView
+ * @constructor
+ * @extends photonui.Widget
+ */
+var DataView = Widget.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        this._lockItemsUpdate = true;
+        this.$data._childrenNames = [];
+        this.$data.selectable = true;
+        this.$data.unselectOnOutsideClick = true;
+        this.$data.multiSelectable = false;
+        this.$data.multiSelectWithCtrl = true;
+        this.$data.allowShiftSelect = true;
+        this.$data.dragAndDroppable = false;
+        this.$data.containerElement = "ul";
+        this.$data.itemElement = "li";
+        this.$data.columnElement = "span";
+        this.$data._manuallySetColumns = (params && params.columns) ? true : false;
+
+        if (params && params.containerElement) {
+            this.$data.containerElement = params.containerElement;
+            params.containerElement = null;
+        }
+
+        this._addIdentifier("dataview");
+        this._addIdentifier(params && params.identifier);
+
+        this._initialSelectionItemIndex = null;
+
+        this._registerWEvents([
+            "item-select",
+            "item-unselect",
+            "item-click",
+            "item-sort",
+        ]);
+        this.$super(params);
+
+        this._lockItemsUpdate = false;
+        this._buildItemsHtml();
+
+        this._bindEvent("click", this.__html.container, "click", this.__onClick.bind(this));
+        this._bindEvent("dragstart", this.__html.container, "dragstart", this.__onDragStart.bind(this));
+        this._bindEvent("dragenter", this.__html.container, "dragenter", this.__onDragEnter.bind(this));
+        this._bindEvent("dragend", this.__html.container, "dragend", this.__onDragEnd.bind(this));
+        this._bindEvent("dragover", this.__html.container, "dragover", this.__onDragOver.bind(this));
+        this._bindEvent("drop", this.__html.container, "drop", this.__onDrop.bind(this));
+    },
+
+    /**
+     * The collection of items displayed by the data view widget.
+     *
+     * @property items
+     * @type Array
+     * @default null
+     */
+    getItems: function () {
+        return this.$data.items;
+    },
+
+    setItems: function (items) {
+        this._empty();
+
+        items = items || [];
+        this.$data.items = items.map(function (item, index) {
+            return typeof(item) === "object" ? {
+                index: index,
+                selected: false,
+                value: item,
+            } : {
+                index: index,
+                selected: false,
+                value: {
+                    __generated__: item.toString(),
+                },
+            };
+        });
+
+        if (!this.$data._manuallySetColumns) {
+            this._generateColumns();
+        }
+
+        this._buildItemsHtml();
+    },
+
+    /**
+     * Defines if the data items can be selected.
+     *
+     * @property selectable
+     * @type Boolean
+     * @default false
+     */
+    isSelectable: function () {
+        return this.$data.selectable;
+    },
+
+    setSelectable: function (selectable) {
+        this.$data.selectable = selectable;
+    },
+
+    /**
+     * If true, clicking outside of the items (in the container) will unselect
+     * currently selected items.
+     * Only used when "selectable" option is set to "true".
+     *
+     * @property unselectOnOutsideClick
+     * @type Boolean
+     * @default false
+     */
+    getUnselectOnOutsideClick: function () {
+        return this.$data.unselectOnOutsideClick;
+    },
+
+    setUnselectOnOutsideClick: function (unselectOnOutsideClick) {
+        this.$data.unselectOnOutsideClick = unselectOnOutsideClick;
+    },
+
+    /**
+     * Defines if the data items can be multi-selected.
+     * Only used when "selectable" option is set to "true".
+     *
+     * @property multiSelectable
+     * @type Boolean
+     * @default false
+     */
+    isMultiSelectable: function () {
+        return this.$data.multiSelectable;
+    },
+
+    setMultiSelectable: function (multiSelectable) {
+        this.$data.multiSelectable = multiSelectable;
+    },
+
+    /**
+     * Defines wether or not "ctrl" key has to be pressed to multi-select items.
+     * Only used when "multiSelectable" option is set to "true".
+     *
+     * @property multiSelectWithCtrl
+     * @type Boolean
+     * @default true
+     */
+    getMultiSelectWithCtrl: function () {
+        return this.$data.multiSelectWithCtrl;
+    },
+
+    setMultiSelectWithCtrl: function (multiSelectWithCtrl) {
+        this.$data.multiSelectWithCtrl = multiSelectWithCtrl;
+    },
+
+    /**
+     * If true, allow selecting multiple items with one click when pressing
+     * "shift" key.
+     * Only used when "multiSelectable" option is set to "true".
+     *
+     * @property allowShiftSelect
+     * @type Boolean
+     * @default true
+     */
+    getAllowShiftSelect: function () {
+        return this.$data.allowShiftSelect;
+    },
+
+    setAllowShiftSelect: function (allowShiftSelect) {
+        this.$data.allowShiftSelect = allowShiftSelect;
+    },
+
+    /**
+     * Defines if the data items can be drag & dropped.
+     *
+     * @property dragAndDroppable
+     * @type Boolean
+     * @default false
+     */
+    isDragAndDroppable: function () {
+        return this.$data.dragAndDroppable;
+    },
+
+    setDragAndDroppable: function (dragAndDroppable) {
+        this.$data.dragAndDroppable = dragAndDroppable;
+    },
+
+    /**
+     * A custom formater function which overrides the default rendering process
+     * of the widget.
+     *
+     * @property customWidgetFormater
+     * @type Function
+     * @default null
+     */
+    getCustomWidgetFormater: function () {
+        return this.$data.customWidgetFormater;
+    },
+
+    setCustomWidgetFormater: function (customWidgetFormater) {
+        this.$data.customWidgetFormater = customWidgetFormater;
+    },
+
+    /**
+     * The currently selected items.
+     *
+     * @property selectedItems
+     * @type Array
+     * @default []
+     */
+    getSelectedItems: function () {
+        return this.$data.items ?
+            this.$data.items.filter(function (item) {
+                return item.selected;
+            }) : [];
+    },
+
+    /**
+     * The list of columns which defines the structure of the items (if not
+     * setted manually, the columns are automatically generated).
+     *
+     * @property columns
+     * @type Array
+     * @default null
+     */
+    setColumns: function (columns) {
+        this.$data.columns = columns.map(function (column, index) {
+            return typeof(column) === "string" ? {
+                    id: column,
+                    value: column
+                } :
+                column.value ? lodash.merge({
+                    id: typeof(column.value) === "string" ? column.value : "column" + index,
+                }, column) :
+                null;
+        }).filter(function (col) {
+            return col !== null;
+        });
+
+        this._buildItemsHtml();
+    },
+
+    /**
+     * Html outer element of the widget (if any).
+     *
+     * @property html
+     * @type HTMLElement
+     * @default null
+     * @readOnly
+     */
+    getHtml: function () {
+        return this.__html.container;
+    },
+
+    /**
+     * The type of the container DOM element which will be created during the
+     * render process.
+     *
+     * @property containerElement
+     * @type String
+     * @default "ul"
+     */
+    getContainerElement: function () {
+        return this.$data.containerElement;
+    },
+
+    setContainerElement: function (containerElement) {
+        this.$data.containerElement =  containerElement;
+    },
+
+    /**
+     * The type of the items DOM elements which will be created during the
+     * render process.
+     *
+     * @property itemElement
+     * @type String
+     * @default "li"
+     */
+    getItemElement: function () {
+        return this.$data.itemElement;
+    },
+
+    setItemElement: function (itemElement) {
+        this.$data.itemElement = itemElement;
+    },
+
+    /**
+     * The type of the columns DOM elements which will be created during the
+     * render process.
+     *
+     * @property columnElement
+     * @type String
+     * @default "span"
+     */
+    getColumnElement: function () {
+        return this.$data.columnElement;
+    },
+
+    setColumnElement: function (columnElement) {
+        this.$data.columnElement = columnElement;
+    },
+
+    /**
+     * The list of identifiers wich will be added to every generated elements
+     * of the widget as classnames.
+     *
+     * @property identifiers
+     * @type Array
+     * @default []
+     * @private
+     */
+    _addIdentifier: function (identifier) {
+        if (!identifier) {
+            return;
+        }
+        if (!this.$data._identifiers) {
+            this.$data._identifiers = [identifier];
+        } else if (this.$data._identifiers.indexOf(identifier) === -1) {
+            this.$data._identifiers.push(identifier);
+        }
+    },
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Public methods ======
+
+    /**
+     * Destroy the widget.
+     *
+     * @method destroy
+     */
+    destroy: function () {
+        this._empty();
+        this.$super();
+    },
+
+    /**
+     * Selects the item(s) at given indexes.
+     *
+     * @method selectItems
+     * @param {...Number|Number[]} indexes
+     */
+    selectItems: function () {
+        lodash.chain(arguments)
+            .map()
+            .flatten()
+            .uniq()
+            .value()
+            .forEach(function (item) {
+                if (typeof(item) === "number") {
+                    item = this._getItemByIndex(item);
+                }
+
+                if (item) {
+                    this._selectItem(item, true);
+                }
+            }.bind(this));
+    },
+
+    /**
+     * Unselects the item(s) at given indexes.
+     *
+     * @method unselectItems
+     * @param {...Number|Number[]} indexes
+     */
+    unselectItems: function () {
+        lodash.chain(arguments)
+            .map()
+            .flatten()
+            .uniq()
+            .value()
+            .forEach(function (item) {
+                if (typeof(item) === "number") {
+                    item = this._getItemByIndex(item);
+                }
+
+                if (item) {
+                    this._unselectItem(item, true);
+                }
+            }.bind(this));
+    },
+
+    // ====== Private methods ======
+
+    /**
+     * Destroy all children of the layout
+     *
+     * @method _empty
+     * @private
+     */
+    _empty: function () {
+        var children = this._getChildren();
+        for (var i = 0 ; i < children.length ; i++) {
+            if (children[i]) {
+                children[i].destroy();
+            }
+        }
+        this.$data._childrenNames = [];
+    },
+
+    /**
+     * Layout children widgets.
+     *
+     * @method _getChildren
+     * @private
+     * @return {Array} the childen widget
+     */
+    _getChildren: function () {
+        var children = [];
+        var widget;
+        for (var i = 0 ; i < this.$data._childrenNames.length ; i++) {
+            widget = Widget.getWidget(this.$data._childrenNames[i]);
+            if (widget instanceof Widget) {
+                children.push(widget);
+            }
+        }
+        return children;
+    },
+
+    /**
+     * Returns the item at a given index.
+     *
+     * @method _getItemByIndex
+     * @private
+     * @param {Number} index
+     * @return {Object} the item
+     */
+    _getItemByIndex: function (index) {
+        return lodash.find(this.items, function (item) {
+            return item.index === index;
+        });
+    },
+
+    /**
+     * Build the widget HTML.
+     *
+     * @method _buildHtml
+     * @private
+     */
+    _buildHtml: function () {
+        this._buildContainerHtml();
+    },
+
+    /**
+     * Build the widget container HTML.
+     *
+     * @method _buildContainerHtml
+     * @private
+     */
+    _buildContainerHtml: function () {
+        this.__html.container = document.createElement(this.containerElement);
+        this.__html.container.className = "photonui-widget";
+
+        this._addIdentifiersClasses(this.__html.container);
+        this._addIdentifiersClasses(this.__html.container, "container");
+    },
+
+    /**
+     * Build the items list HTML.
+     *
+     * @method _buildItemsHtml
+     * @private
+     */
+    _buildItemsHtml: function () {
+        if (this._lockItemsUpdate) {
+            return;
+        }
+
+        Helpers.cleanNode(this.__html.container);
+        this.$data._childrenNames = [];
+
+        if (this.$data.items) {
+            var fragment = document.createDocumentFragment();
+
+            this.$data.items.forEach(function (item) {
+                var itemNode = this._renderItem(item);
+
+                if (this.$data.dragAndDroppable) {
+                    itemNode.setAttribute("draggable", true);
+                }
+
+                item.node = itemNode;
+                fragment.appendChild(itemNode);
+            }.bind(this));
+
+            this.__html.container.appendChild(fragment);
+        }
+    },
+
+    /**
+     * Renders a given item.
+     *
+     * @method _renderItem
+     * @private
+     * @param {Object} item
+     * @return {Element} the rendered item
+     */
+    _renderItem: function (item) {
+        var node = document.createElement(this.itemElement);
+        node.className = "photonui-dataview-item";
+        node.setAttribute("data-photonui-dataview-item-index", item.index);
+
+        this._addIdentifiersClasses(node, "item");
+
+        if (this.customWidgetFormater && typeof(this.customWidgetFormater) === "function") {
+            var widget = this.customWidgetFormater.call(this, item.value);
+
+            if (widget && widget instanceof Widget) {
+                this.$data._childrenNames.push(widget.name);
+                node.appendChild(widget.getHtml());
+                return node;
+            }
+        }
+
+        return this._renderItemInner(node, item);
+    },
+
+    /**
+     * Renders all the columns of a given item.
+     *
+     * @method _renderItemInner
+     * @private
+     * @param {Element} itemNode the container element of the item
+     * @param {Object} item the rendered item
+     * @return {Element} the rendered item
+     */
+    _renderItemInner: function (itemNode, item) {
+        if (this.$data.columns) {
+            this.$data.columns.forEach(function (column) {
+                var content = typeof(column.value) === "string" ? lodash.get(item.value, column.value) :
+                    typeof(column.value) === "function" ? column.value.call(this, item.value) :
+                    null;
+
+                itemNode.appendChild(this._renderColumn(content, column.id, column.rawHtml));
+            }.bind(this));
+        }
+
+        return itemNode;
+    },
+
+    /**
+     * Renders a given column.
+     *
+     * @method _renderColumn
+     * @private
+     * @param {photonui.Widget|String} content the content of the column
+     * @param {String} columnId the identifier of the column
+     * @return {Element} the rendered column
+     */
+    _renderColumn: function (content, columnId, rawHtml) {
+        var node = document.createElement(this.columnElement);
+
+        this._addIdentifiersClasses(node, "column");
+
+        if (columnId !== "__generated__") {
+            this._addIdentifiersClasses(node, "column-" + columnId);
+        }
+
+        if (content instanceof Widget) {
+            this.$data._childrenNames.push(content.name);
+            node.appendChild(content.getHtml());
+        } else if (rawHtml) {
+            node.innerHTML = content || "";
+        } else {
+            node.textContent = content || "";
+        }
+
+        return node;
+    },
+
+    /**
+     * Generate the list of columns.
+     *
+     * @method _generateColumns
+     * @private
+     */
+    _generateColumns: function () {
+        var keys = [];
+        if (this.$data.items) {
+            this.$data.items.forEach(function (item) {
+                if (typeof(item.value) === "object") {
+                    Object.keys(item.value).forEach(function (key) {
+                        if (keys.indexOf(key) === -1) {
+                            keys.push(key);
+                        }
+                    });
+                }
+            });
+
+            this.$data.columns = keys.map(function (key) {
+                return {
+                    value: key,
+                    id: key,
+                };
+            });
+
+            this._buildItemsHtml();
+        }
+    },
+
+    /**
+     * Adds classes defined by the identifiers property to a given element, with
+     * a given suffix.
+     *
+     * @method _addIdentifiersClasses
+     * @private
+     * @param {Element} node the node
+     * @param {String} suffix the suffix of the classes
+     */
+    _addIdentifiersClasses: function (node, suffix) {
+        if (this.$data._identifiers) {
+            this.$data._identifiers.forEach(function (identifier) {
+                node.classList.add(
+                    suffix ?
+                    "photonui-" + identifier + "-" + suffix
+                        .replace(/[^a-zA-Z0-9]+/gi, "-")
+                        .replace(/(^[^a-zA-Z0-9]|[^a-zA-Z0-9]$)/gi, "")
+                        .toLowerCase() :
+                    "photonui-" + identifier
+                );
+            });
+        }
+    },
+
+    /**
+     * Selects an item.
+     *
+     * @method _selectItem
+     * @private
+     * @param {Object} item the item
+     */
+    _selectItem: function (item, preventEvent) {
+        item.selected = true;
+        item.node.classList.add("selected");
+
+        if (!preventEvent) {
+            this._callCallbacks("item-select", [item]);
+        }
+    },
+
+    /**
+     * Unselects an item.
+     *
+     * @method _unselectItem
+     * @private
+     * @param {Object} item the item
+     */
+    _unselectItem: function (item, preventEvent) {
+        item.selected = false;
+        item.node.classList.remove("selected");
+
+        if (!preventEvent) {
+            this._callCallbacks("item-unselect", [item]);
+        }
+    },
+
+    /**
+     * Selects all items from the current selection to a given item.
+     *
+     * @method _selectItemsTo
+     * @private
+     * @param {Object} item the item
+     */
+    _selectItemsTo: function (item) {
+        this.unselectAllItems();
+
+        if (this._initialSelectionItemIndex < item.index) {
+            for (var i = this._initialSelectionItemIndex; i <= item.index; i++) {
+                this._selectItem(this.items[i]);
+            }
+        } else {
+            for (var j = this._initialSelectionItemIndex; j >= item.index; j--) {
+                this._selectItem(this.items[j]);
+            }
+        }
+    },
+
+    /**
+     * Unselects all items.
+     *
+     * @method unselectAllItems
+     * @private
+     */
+    unselectAllItems: function () {
+        this.getSelectedItems().forEach(function (item) {
+            this._unselectItem(item);
+        }.bind(this));
+    },
+
+    /**
+     * Gets an item of the collection from a given item DOM element.
+     *
+     * @method _getItemFromNode
+     * @private
+     * @param {Element} itemNode the item DOM element
+     * @return {Object} the item
+     */
+    _getItemFromNode: function (itemNode) {
+        var index = itemNode.getAttribute("data-photonui-dataview-item-index");
+        return index ? this.$data.items[parseInt(index, 10)] : null;
+    },
+
+    /**
+     * Moves the item at a givent index to another given index. Rebuilds the
+     * dataview.
+     *
+     * @method _moveItem
+     * @private
+     * @param {Number} itemIndex the index of the item to move
+     * @param {Number} destinationIndex the destination index
+     */
+    _moveItem: function (itemIndex, destinationIndex) {
+        this.items.splice(destinationIndex, 0, this.items.splice(itemIndex, 1)[0]);
+        this.setItems(
+            this.items.map(function (item) {
+                return item.value;
+            })
+        );
+    },
+
+    /**
+     * Handle item click events.
+     *
+     * @method _handleClick
+     * @private
+     * @param {Object} item the item
+     * @param {Object} modifiers the modifiers states
+     * @param {Object} modifiers.ctrl
+     * @param {Object} modifiers.shift
+     */
+    _handleClick: function (clickedItem, modifiers) {
+        if (this.selectable) {
+            if (this.multiSelectable) {
+                // No item is selected, select clicked item
+                if (this.selectedItems.length === 0) {
+                    this._selectItem(clickedItem);
+                    this._initialSelectionItemIndex = clickedItem.index;
+                } else {
+                    if (this.allowShiftSelect && modifiers.shift) {
+                        this._selectItemsTo(clickedItem);
+                    } else if (this.multiSelectWithCtrl) {
+                        if (modifiers.ctrl) {
+                            if (clickedItem.selected) {
+                                this._unselectItem(clickedItem);
+                            } else {
+                                this._selectItem(clickedItem);
+                            }
+                        } else {
+                            this.unselectAllItems();
+                            this._selectItem(clickedItem);
+                            this._initialSelectionItemIndex = clickedItem.index;
+                        }
+                    } else {
+                        if (clickedItem.selected) {
+                            this._unselectItem(clickedItem);
+                        } else {
+                            this._selectItem(clickedItem);
+                        }
+                    }
+                }
+            } else {
+                if (modifiers.ctrl && clickedItem.selected) {
+                    this._unselectItem(clickedItem);
+                } else {
+                    this.unselectAllItems();
+                    this._selectItem(clickedItem);
+                }
+            }
+        }
+    },
+
+    /**
+     * Generates a placeholder item element.
+     *
+     * @method _generatePlaceholderElement
+     * @private
+     * @return {Element} the placeholder item element
+     */
+    _generatePlaceholderElement: function (itemNode) {
+        var placeholderElement = document.createElement(this.$data.itemElement);
+
+        this.$data.columns.forEach(function () {
+            var column = document.createElement(this.$data.columnElement);
+            placeholderElement.appendChild(column);
+        }.bind(this));
+
+        placeholderElement.style.height = itemNode.offsetHeight + "px";
+        placeholderElement.style.width = itemNode.offsetWidth + "px";
+        placeholderElement.style.margin = itemNode.style.margin;
+
+        this._addIdentifiersClasses(placeholderElement, "item-placeholder");
+
+        return placeholderElement;
+    },
+
+    //////////////////////////////////////////
+    // Internal Events Callbacks            //
+    //////////////////////////////////////////
+
+    /**
+     * Called when an element is clicked.
+     *
+     * @method __onClick
+     * @private
+     * @param {Object} event the click event
+     */
+    __onClick: function (event) {
+        var clickedItemNode = Helpers.getClosest(event.target, ".photonui-dataview-item");
+        event.stopPropagation();
+
+        if (clickedItemNode) {
+            var item = this._getItemFromNode(clickedItemNode);
+
+            if (!item) {
+                return;
+            }
+
+            this.__onItemClick(event, this._getItemFromNode(clickedItemNode));
+        } else if (this.unselectOnOutsideClick){
+            this.unselectAllItems();
+        }
+    },
+
+    /**
+     * Called when an item is clicked.
+     *
+     * @method __onItemClick
+     * @private
+     * @param {Object} event the click event
+     * @param {item} item the clicked item
+     */
+    __onItemClick: function (event, item) {
+        this._handleClick(item, {
+            shift: event.shiftKey,
+            ctrl: event.ctrlKey,
+        });
+        this._callCallbacks("item-click", [item, event]);
+
+        event.stopPropagation();
+    },
+
+    /**
+     * Called when an item is dragged.
+     *
+     * @method __onDragStart
+     * @private
+     * @param {Object} event
+     */
+    __onDragStart: function (event) {
+        if (!this.$data.dragAndDroppable) {
+            return;
+        }
+
+        event.dataTransfer.setData("text", "");
+        var draggedItemNode = Helpers.getClosest(event.target, ".photonui-dataview-item");
+
+        if (draggedItemNode) {
+            this.$data._draggedItem = this._getItemFromNode(draggedItemNode);
+            this.unselectAllItems();
+
+            this.$data._placeholderElement = this._generatePlaceholderElement(draggedItemNode);
+
+            this.$data._lastPlaceholderIndex = this.$data._draggedItem.index;
+
+            lodash.defer(function () {
+                this.__html.container.insertBefore(this.$data._placeholderElement, draggedItemNode);
+                this.$data._draggedItem.node.style.display = "none";
+            }.bind(this));
+        }
+
+        event.stopPropagation();
+    },
+
+    /**
+     * Called when a dragged item enters into another element.
+     *
+     * @method __onDragEnter
+     * @private
+     * @param {Object} event
+     */
+    __onDragEnter: function (event) {
+        if (!this.$data.dragAndDroppable) {
+            return;
+        }
+
+        var enteredItemNode = Helpers.getClosest(event.target, ".photonui-dataview-item");
+
+        if (enteredItemNode) {
+            var enteredIndex = this._getItemFromNode(enteredItemNode).index;
+            var placeholderIndex =
+              enteredIndex + (this.$data._lastPlaceholderIndex <= enteredIndex ? 1 : 0);
+
+            var nextItem = this._getItemByIndex(placeholderIndex);
+
+            this.$data._lastPlaceholderIndex = placeholderIndex;
+
+            if (nextItem) {
+                this.__html.container.insertBefore(this.$data._placeholderElement, nextItem.node);
+            } else {
+                this.__html.container.appendChild(this.$data._placeholderElement);
+            }
+        }
+
+        event.stopPropagation();
+
+        return false;
+    },
+
+    /**
+     * Called when a item drag has ended.
+     *
+     * @method __onDragEnd
+     * @private
+     * @param {Object} event
+     */
+    __onDragEnd: function (event) {
+        if (!this.$data.dragAndDroppable) {
+            return;
+        }
+
+        this.$data._draggedItem.node.style.display = "";
+
+        if (this.$data._placeholderElement.parentNode === this.__html.container) {
+            var destIndex = this.$data._lastPlaceholderIndex > this.$data._draggedItem.index ?
+                this.$data._lastPlaceholderIndex - 1 :
+                this.$data._lastPlaceholderIndex;
+
+            this._moveItem(this.$data._draggedItem.index, destIndex);
+
+            this._callCallbacks("item-sort", [this.$data._draggedItem, destIndex, event]);
+        }
+
+        this.$data._placeholderElement = null;
+        this.$data._draggedItem = null;
+
+        event.stopPropagation();
+    },
+
+    /**
+     * Called when a item is dragged (fix for firefox).
+     *
+     * @method __onDragOver
+     * @private
+     * @param {Object} event
+     */
+    __onDragOver: function (event) {
+        if (!this.$data.dragAndDroppable) {
+            return;
+        }
+
+        event.preventDefault();
+        event.stopPropagation();
+    },
+
+    /**
+     * Called when a item is dropped (fix for firefox).
+     *
+     * @method __onDrop
+     * @private
+     * @param {Object} event
+     */
+    __onDrop: function (event) {
+        if (!this.$data.dragAndDroppable) {
+            return;
+        }
+
+        event.preventDefault();
+        event.stopPropagation();
+    },
+
+    /**
+     * Called when the locale is changed.
+     *
+     * @method __onLocaleChanged
+     * @private
+     */
+    __onLocaleChanged: function () {
+        this._buildItemsHtml();
+    },
+
+});
+
+module.exports = DataView;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_dataview_fluidview.js.html b/ref/files/src_dataview_fluidview.js.html new file mode 100644 index 00000000..23fc333b --- /dev/null +++ b/ref/files/src_dataview_fluidview.js.html @@ -0,0 +1,392 @@ + + + + + src/dataview/fluidview.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/dataview/fluidview.js

+ +
+
+/*
+ * Copyright (c) 2014-2016, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Valentin Ledrapier
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule DataView
+ * @namespace photonui
+ */
+
+var lodash = require("lodash");
+
+var DataView = require("./dataview");
+
+/**
+ * FluidView container.
+ *
+ * @class FluidView
+ * @constructor
+ * @extends photonui.DataView
+ */
+var FluidView = DataView.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        params = lodash.assign({
+            verticalPadding: 0,
+            horizontalPadding: 0,
+            verticalSpacing: 0,
+            horizontalSpacing: 0,
+        }, params);
+
+        this._addIdentifier("fluidview");
+        this.$super(params);
+    },
+
+    /**
+     * The width of the items.
+     *
+     * @property itemsWidth
+     * @type Number
+     * @default 0
+     */
+    getItemsWidth: function () {
+        return this.$data.itemsWidth;
+    },
+
+    setItemsWidth: function (itemsWidth) {
+        this.$data.itemsWidth = itemsWidth;
+        this._buildItemsHtml();
+    },
+
+    /**
+     * The height of the items.
+     *
+     * @property itemsHeight
+     * @type Number
+     * @default 0
+     */
+    getItemsHeight: function () {
+        return this.$data.itemsHeight;
+    },
+
+    setItemsHeight: function (itemsHeight) {
+        this.$data.itemsHeight = itemsHeight;
+        this._buildItemsHtml();
+    },
+
+    /**
+     * The vertical padding of the container element.
+     *
+     * @property verticalPadding
+     * @type Number
+     * @default 0
+     */
+    getVerticalPadding: function () {
+        return this.$data.verticalPadding;
+    },
+
+    setVerticalPadding: function (verticalPadding) {
+        this.$data.verticalPadding = verticalPadding;
+        this._buildItemsHtml();
+    },
+
+    /**
+     * The horizontal padding of the container element.
+     *
+     * @property horizontalPadding
+     * @type Number
+     * @default 0
+     */
+    getHorizontalPadding: function () {
+        return this.$data.horizontalPadding;
+    },
+
+    setHorizontalPadding: function (horizontalPadding) {
+        this.$data.horizontalPadding = horizontalPadding;
+        this._buildItemsHtml();
+    },
+
+    /**
+     * The vertical spacing between the elements.
+     *
+     * @property verticalSpacing
+     * @type Number
+     * @default 0
+     */
+    getVerticalSpacing: function () {
+        return this.$data.verticalSpacing;
+    },
+
+    setVerticalSpacing: function (verticalSpacing) {
+        this.$data.verticalSpacing = verticalSpacing;
+        this._buildItemsHtml();
+    },
+
+    /**
+     * The horizontal spacing between the elements.
+     *
+     * @property horizontalSpacing
+     * @type Number
+     * @default 0
+     */
+    getHorizontalSpacing: function () {
+        return this.$data.horizontalSpacing;
+    },
+
+    setHorizontalSpacing: function (horizontalSpacing) {
+        this.$data.horizontalSpacing = horizontalSpacing;
+        this._buildItemsHtml();
+    },
+
+    /**
+     * Build the items list HTML.
+     *
+     * @method _buildItemsHtml
+     * @private
+     */
+    _buildItemsHtml: function () {
+        this.$super.apply(this, arguments);
+
+        this.__html.container.style.marginTop = this.$data.verticalSpacing ?
+            -this.$data.verticalSpacing / 2 + "px" :
+            "";
+
+        this.__html.container.style.marginBottom = this.$data.verticalSpacing ?
+            -this.$data.verticalSpacing / 2 + "px" :
+            "";
+
+        this.__html.container.style.marginLeft = this.$data.horizontalSpacing ?
+            -this.$data.horizontalSpacing / 2 + "px" :
+            "";
+
+        this.__html.container.style.marginRight = this.$data.horizontalSpacing ?
+            -this.$data.horizontalSpacing / 2 + "px" :
+            "";
+
+        this.__html.container.style.paddingTop = this.$data.verticalPadding ?
+            this.$data.verticalPadding + "px" :
+            "";
+
+        this.__html.container.style.paddingBottom = this.$data.verticalPadding ?
+            this.$data.verticalPadding + "px" :
+            "";
+
+        this.__html.container.style.paddingLeft = this.$data.horizontalPadding ?
+            this.$data.horizontalPadding + "px" :
+            "";
+
+        this.__html.container.style.paddingRight = this.$data.horizontalPadding ?
+            this.$data.horizontalPadding + "px" :
+            "";
+    },
+
+    _renderItem: function (item) {
+        var node = this.$super.apply(this, arguments);
+
+        if (this.$data.itemsWidth) {
+            node.style.width = this.$data.itemsWidth + "px";
+        }
+        if (this.$data.itemsHeight) {
+            node.style.height = this.$data.itemsHeight + "px";
+        }
+        if (this.$data.horizontalSpacing) {
+            node.style.marginLeft = this.$data.horizontalSpacing / 2 + "px";
+            node.style.marginRight = this.$data.horizontalSpacing / 2 + "px";
+        }
+        if (this.$data.verticalSpacing) {
+            node.style.marginTop = this.$data.verticalSpacing / 2 + "px";
+            node.style.marginBottom = this.$data.verticalSpacing / 2 + "px";
+        }
+
+        return node;
+    },
+});
+
+module.exports = FluidView;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_dataview_iconview.js.html b/ref/files/src_dataview_iconview.js.html new file mode 100644 index 00000000..50a3bfe2 --- /dev/null +++ b/ref/files/src_dataview_iconview.js.html @@ -0,0 +1,318 @@ + + + + + src/dataview/iconview.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/dataview/iconview.js

+ +
+
+/*
+ * Copyright (c) 2014-2016, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Valentin Ledrapier
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule DataView
+ * @namespace photonui
+ */
+
+var lodash = require("lodash");
+
+var Helpers = require("../helpers");
+var Image = require("../visual/image");
+var FAIcon = require("../visual/faicon");
+
+var FluidView = require("./fluidview");
+
+/**
+ * IconView container.
+ *
+ * @class IconView
+ * @constructor
+ * @extends photonui.FluidView
+ */
+var IconView = FluidView.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        params = lodash.assign({
+            horizontalSpacing: 8,
+            horizontalPadding: 8,
+            verticalSpacing: 8,
+            verticalPadding: 8,
+            columnElement: "div",
+            columns: [{
+                id: "icon",
+                value: function (item) {
+                    return item.image ?
+                            new Image({
+                                url: item.image,
+                                height: this.iconHeight,
+                                width: this.iconWidth,
+                            }) :
+                        item.faIcon && item.faIcon.iconName ?
+                            new FAIcon(item.faIcon) :
+                        null;
+                },
+            },
+            "label",
+          ],
+        }, params);
+
+        this._addIdentifier("iconview");
+
+        this._registerWEvents([]);
+        this.$super(params);
+    },
+
+    /**
+     * The width of the icons.
+     *
+     * @property iconWidth
+     * @type Number
+     * @default 0
+     */
+    getIconWidth: function () {
+        return this.$data.iconWidth;
+    },
+
+    setIconWidth: function (iconWidth) {
+        this.$data.iconWidth = iconWidth;
+        this._buildItemsHtml();
+    },
+
+    /**
+     * The width of the items.
+     *
+     * @property iconHeight
+     * @type Number
+     * @default 0
+     */
+    getIconHeight: function () {
+        return this.$data.iconHeight;
+    },
+
+    setIconHeight: function (iconHeight) {
+        this.$data.iconHeight = iconHeight;
+        this._buildItemsHtml();
+    },
+
+    /**
+     * Renders a given column.
+     *
+     * @method _renderColumn
+     * @private
+     * @param {photonui.Widget|String} content the content of the column
+     * @param {String} columnId the identifier of the column
+     * @return {Element} the rendered column
+     */
+    _renderColumn: function (content, columnId, rawHtml) {
+        var node = this.$super.apply(this, arguments);
+
+        if (columnId === "icon") {
+            if (this.$data.iconWidth) {
+                node.style.width = this.$data.iconWidth + "px";
+            }
+            if (this.$data.iconHeight) {
+                node.style.height = this.$data.iconHeight + "px";
+
+                var faIconNode = node.getElementsByClassName("fa")[0];
+
+                if (faIconNode) {
+                    faIconNode.style.lineHeight = this.$data.iconHeight + "px";
+                }
+            }
+        }
+
+        return node;
+    },
+});
+
+module.exports = IconView;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_dataview_listview.js.html b/ref/files/src_dataview_listview.js.html new file mode 100644 index 00000000..4937dd4e --- /dev/null +++ b/ref/files/src_dataview_listview.js.html @@ -0,0 +1,235 @@ + + + + + src/dataview/listview.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/dataview/listview.js

+ +
+
+/*
+ * Copyright (c) 2014-2016, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Valentin Ledrapier
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule DataView
+ * @namespace photonui
+ */
+
+var lodash = require("lodash");
+
+var DataView = require("./dataview");
+var Helpers = require("../helpers.js");
+
+/**
+ * ListView container.
+ *
+ * @class ListView
+ * @constructor
+ * @extends photonui.DataView
+ */
+var ListView = DataView.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        params = lodash.assign({
+            containerElement: "ul",
+            itemElement: "li",
+            columnElement: "span",
+        }, params);
+
+        this._addIdentifier("listview");
+
+        this._registerWEvents([]);
+        this.$super(params);
+    },
+});
+
+module.exports = ListView;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_dataview_tableview.js.html b/ref/files/src_dataview_tableview.js.html new file mode 100644 index 00000000..f5d2395b --- /dev/null +++ b/ref/files/src_dataview_tableview.js.html @@ -0,0 +1,289 @@ + + + + + src/dataview/tableview.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/dataview/tableview.js

+ +
+
+/*
+ * Copyright (c) 2014-2016, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Valentin Ledrapier
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule DataView
+ * @namespace photonui
+ */
+
+var lodash = require("lodash");
+
+var Widget = require("../widget");
+var Helpers = require("../helpers.js");
+
+var DataView = require("./dataview");
+
+/**
+ * TableView container.
+ *
+ * @class TableView
+ * @constructor
+ * @extends photonui.DataView
+ */
+var TableView = DataView.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        params = lodash.assign({
+            containerElement: "table",
+            itemElement: "tr",
+            columnElement: "td",
+            showHeader: true,
+        }, params);
+
+        this._addIdentifier("tableview");
+
+        this._registerWEvents([]);
+        this.$super(params);
+    },
+
+    /**
+     * Defines if the header is displayed.
+     *
+     * @property showHeader
+     * @type Boolean
+     * @default true
+     */
+    getShowHeader: function () {
+        return this.$data.showHeader;
+    },
+
+    setShowHeader: function (showHeader) {
+        this.$data.showHeader = showHeader;
+    },
+
+    /**
+     * Build the items list HTML.
+     *
+     * @method _buildItemsHtml
+     * @private
+     */
+    _buildItemsHtml: function () {
+        this.$super.apply(this, arguments);
+        if (this.$data.showHeader) {
+            this.__html.container.insertBefore(this._renderHeader(), this.__html.container.firstChild);
+        }
+    },
+
+    /**
+     * Renders the table header.
+     *
+     * @method _renderHeader
+     * @private
+     * @return {Element} the rendered header
+     */
+    _renderHeader: function () {
+        var node = document.createElement("tr");
+        this._addIdentifiersClasses(node, "header");
+
+        if (this.$data.columns) {
+            this.$data.columns.forEach(function (column) {
+                var columnNode = document.createElement("th");
+                this._addIdentifiersClasses(columnNode, "column");
+                columnNode.textContent = column.label === undefined ? column.id : column.label;
+                node.appendChild(columnNode);
+            }.bind(this));
+        }
+
+        return node;
+    }
+});
+
+module.exports = TableView;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_helpers.js.html b/ref/files/src_helpers.js.html new file mode 100644 index 00000000..e2f5e72b --- /dev/null +++ b/ref/files/src_helpers.js.html @@ -0,0 +1,412 @@ + + + + + src/helpers.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/helpers.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule Helpers
+ * @main helpers
+ * @namespace photonui
+ */
+
+var uuid = require("uuid");
+
+/**
+ * Helpers.
+ *
+ * @class Helpers
+ * @constructor
+ */
+var Helpers = function () {
+};
+
+/**
+ * Escape HTML.
+ *
+ * @method escapeHtml
+ * @static
+ * @param {String} string
+ * @return {String}
+ */
+Helpers.escapeHtml = function (string) {
+    return string
+        .replace(/&/g, "&amp;")
+        .replace(/</g, "&lt;")
+        .replace(/>/g, "&gt;");
+};
+
+/**
+ * Generate an UUID version 4 (RFC 4122).
+ *
+ * This method is deprecated, please use `photonui.lib.uuid.v4()` instead.
+ *
+ * @method uuid4
+ * @static
+ * @deprecated
+ * @return {String} The generated UUID
+ */
+Helpers.uuid4 = function () {
+    Helpers.log("warn", "'photonui.Helpers.uuid4()' is deprecated. Use 'photonui.lib.uuid.v4()' instead.");
+    return uuid.v4();
+};
+
+/**
+ * Clean node (remove all children of the node).
+ *
+ * @method cleanNode
+ * @static
+ * @param {HTMLElement} node
+ */
+Helpers.cleanNode = function (node) {
+    while (node.hasChildNodes()) {
+        node.removeChild(node.lastChild);
+    }
+};
+
+/**
+ * Get the absolute position of an HTML Element.
+ *
+ * @method getAbsolutePosition
+ * @static
+ * @param {HTMLElement} element The HTML element (or its id)
+ * @return {Object} `{x: <Number>, y: <Number>}
+ */
+Helpers.getAbsolutePosition = function (element) {
+    if (typeof(element) == "string") {
+        element = document.getElementById(element);
+    }
+    if (!(element instanceof Element)) {
+        return {x: 0, y: 0};
+    }
+
+    var css;
+    var origElement = element;
+
+    try {
+        css = getComputedStyle(element);
+    } catch (e) {
+        return {x: 0, y: 0};
+    }
+
+    if (!css) {
+        return {x: 0, y: 0};
+    }
+
+    var x = -parseInt(css.borderLeftWidth);
+    var y = -parseInt(css.borderTopWidth);
+
+    while (element.offsetParent) {
+        css = getComputedStyle(element);
+
+        x += element.offsetLeft || 0;
+        x += parseInt(css.borderLeftWidth);
+
+        y += element.offsetTop || 0;
+        y += parseInt(css.borderTopWidth);
+
+        element = element.offsetParent;
+    }
+
+    element = origElement;
+
+    while (element.parentNode && !(element instanceof HTMLBodyElement)) {
+        x -= element.scrollLeft || 0;
+        y -= element.scrollTop || 0;
+        element = element.parentNode;
+    }
+
+    return {x: x, y: y};
+};
+
+/**
+ * Check and compute size to valid CSS size
+ *
+ * Valid values and transformations:
+ *     undefined  -> defaultValue
+ *     null       -> "auto" (if "auto" is alowed, "0px" else)
+ *     +Infinity  -> "100%"
+ *     Number     -> "<Number>px"
+ *
+ * @method numberToCssSize
+ * @static
+ * @param {Number} value
+ * @param {Number} defaultValue (opt, default=nullValue)
+ * @param {String} nullValue (opt, default="auto")
+ * @return {String} sanitized version of the size.
+ */
+Helpers.numberToCssSize = function (value, defaultValue, nullValue) {
+    nullValue = (nullValue === undefined) ? "auto" : nullValue;
+    defaultValue = (nullValue === undefined) ? null : defaultValue;
+    value = (value === undefined) ? defaultValue : value;
+
+    if (value === Infinity) {
+        return "100%";
+    } else if (!isNaN(parseFloat(value))) {
+        return Math.max(0, parseFloat(value) | 0) + "px";
+    } else if (value !== defaultValue) {
+        return Helpers.numberToCssSize(defaultValue, defaultValue, nullValue);
+    } else {
+        return nullValue;
+    }
+};
+
+/**
+ * Write log into the terminal.
+ *
+ * @method log
+ * @static
+ * @param {String} level The log level ("info", "warn", "error", ...)
+ * @param {String} message The message to log
+ */
+Helpers.log = function (level, message) {
+    try {
+        if (!window.console) {
+            return;
+        }
+        if (!window.console.log) {
+            return;
+        }
+        if (!window.console[level]) {
+            level = "log";
+        }
+        window.console[level]("PhotonUI: " + message);
+    } catch (e) {
+    }
+};
+
+/**
+ * Get the closest matching element up the DOM tree.
+ * https://gomakethings.com/climbing-up-and-down-the-dom-tree-with-vanilla-javascript/
+ *
+ * @method getClosest
+ * @param  {Element} elem     Starting element
+ * @param  {String}  selector Selector to match against
+ * @return {Boolean|Element}  Returns null if not match found
+ */
+Helpers.getClosest = function (elem, selector) {
+
+    // Element.matches() polyfill
+    if (!Element.prototype.matches) {
+        Element.prototype.matches =
+            Element.prototype.matchesSelector ||
+            Element.prototype.mozMatchesSelector ||
+            Element.prototype.msMatchesSelector ||
+            Element.prototype.oMatchesSelector ||
+            Element.prototype.webkitMatchesSelector ||
+            function (s) {
+                var matches = (this.document || this.ownerDocument).querySelectorAll(s);
+                var i = matches.length;
+                // jscs:disable
+                while (--i >= 0 && matches.item(i) !== this) {}
+                // jscs:enable
+                return i > -1;
+            };
+    }
+
+    // Get closest match
+    for (; elem && elem !== document; elem = elem.parentNode) {
+        if (elem.matches(selector)) {
+            return elem;
+        }
+    }
+
+    return null;
+
+};
+
+module.exports = Helpers;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_interactive_button.js.html b/ref/files/src_interactive_button.js.html new file mode 100644 index 00000000..99c0fb42 --- /dev/null +++ b/ref/files/src_interactive_button.js.html @@ -0,0 +1,606 @@ + + + + + src/interactive/button.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/interactive/button.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule Interactive
+ * @namespace photonui
+ */
+
+var Helpers = require("../helpers.js");
+var Widget = require("../widget.js");
+var BaseIcon = require("../visual/baseicon.js");
+var PhotonImage = require("../visual/image.js");
+
+/**
+ * Button.
+ *
+ * wEvents:
+ *
+ *   * click:
+ *     - description: called when the button was clicked.
+ *     - callback:    function(widget, event)
+ *
+ * @class Button
+ * @constructor
+ * @extends photonui.Widget
+ */
+var Button = Widget.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        this._registerWEvents(["click"]);
+        this.$super(params);
+
+        // Bind js events
+        this._bindEvent("click", this.__html.button, "click", this.__onButtonClicked.bind(this));
+
+        // Update properties
+        this._update();
+    },
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    /**
+     * The button text.
+     *
+     * @property text
+     * @type String
+     * @default "Button"
+     */
+    _text: "Button",
+
+    getText: function () {
+        "@photonui-update";
+        return this._text;
+    },
+
+    setText: function (text) {
+        this._text = text;
+        Helpers.cleanNode(this.__html.text);
+        this.__html.text.appendChild(document.createTextNode(text));
+    },
+
+    /**
+     * Define if the button text is displayed or hidden.
+     *
+     * @property textVisible
+     * @type Boolean
+     * @default true
+     */
+    _textVisible: true,
+
+    isTextVisible: function () {
+        return this._textVisible;
+    },
+
+    setTextVisible: function (textVisible) {
+        this._textVisible = textVisible;
+        this._update();
+    },
+
+    /**
+     * Left icon widget name.
+     *
+     * @property leftIconName
+     * @type String
+     * @default: null
+     */
+    _leftIconName: null,
+
+    getLeftIconName: function () {
+        "@photonui-update";
+        return this._leftIconName;
+    },
+
+    setLeftIconName: function (leftIconName) {
+        this._leftIconName = leftIconName;
+        Helpers.cleanNode(this.__html.leftIcon);
+        if (this._leftIconName) {
+            this.__html.leftIcon.appendChild(this.leftIcon.html);
+            this.leftIconVisible = true;
+        }
+    },
+
+    /**
+     * Left icon widget.
+     *
+     * @property leftIcon
+     * @type BaseIcon
+     * @default: null
+     */
+    getLeftIcon: function () {
+        return Widget.getWidget(this._leftIconName);
+    },
+
+    setLeftIcon: function (leftIcon) {
+        if (leftIcon instanceof BaseIcon || leftIcon instanceof PhotonImage) {
+            this.leftIconName = leftIcon.name;
+            return;
+        }
+        this.leftIconName = null;
+    },
+
+    /**
+     * Define if the left icon is displayed or hidden.
+     *
+     * @property leftIconVisible
+     * @type Boolean
+     * @default true
+     */
+    _leftIconVisible: true,
+
+    isLeftIconVisible: function () {
+        return this._leftIconVisible;
+    },
+
+    setLeftIconVisible: function (leftIconVisible) {
+        this._leftIconVisible = leftIconVisible;
+        this._update();
+    },
+
+    /**
+     * Right icon widget name.
+     *
+     * @property rightIconName
+     * @type String
+     * @default: null
+     */
+    _rightIconName: null,
+
+    getRightIconName: function () {
+        "@photonui-update";
+        return this._rightIconName;
+    },
+
+    setRightIconName: function (rightIconName) {
+        this._rightIconName = rightIconName;
+        Helpers.cleanNode(this.__html.rightIcon);
+        if (this._rightIconName) {
+            this.__html.rightIcon.appendChild(this.rightIcon.html);
+            this.rightIconVisible = true;
+        }
+    },
+
+    /**
+     * Right icon widget.
+     *
+     * @property rightIcon
+     * @type BaseIcon
+     * @default: null
+     */
+    getRightIcon: function () {
+        return Widget.getWidget(this._rightIconName);
+    },
+
+    setRightIcon: function (rightIcon) {
+        if (rightIcon instanceof BaseIcon || rightIcon instanceof PhotonImage) {
+            this.rightIconName = rightIcon.name;
+            return;
+        }
+        this.rightIconName = null;
+    },
+
+    /**
+     * Define if the right icon is displayed or hidden.
+     *
+     * @property rightIconVisible
+     * @type Boolean
+     * @default true
+     */
+    _rightIconVisible: true,
+
+    isRightIconVisible: function () {
+        return this._rightIconVisible;
+    },
+
+    setRightIconVisible: function (rightIconVisible) {
+        this._rightIconVisible = rightIconVisible;
+        this._update();
+    },
+
+    /**
+     * Define the button appearance.
+     *
+     *   * `normal`
+     *   * `flat`
+     *
+     * @property appearance
+     * @type String
+     * @default "normal"
+     */
+    _appearance: "normal",
+
+    getAppearance: function () {
+        return this._appearance;
+    },
+
+    setAppearance: function (appearance) {
+        this._appearance = appearance;
+
+        if (appearance == "flat") {
+            this.addClass("photonui-button-appearance-flat");
+        } else {
+            this.removeClass("photonui-button-appearance-flat");
+        }
+    },
+
+    /**
+     * Button's color.
+     *
+     * The available colors depends on the theme. Particle, the
+     * default PhotonUI theme provides the following colors:
+     *
+     *   * `blue`
+     *   * `red`
+     *   * `yellow`
+     *   * `green`
+     *   * null (default)
+     *
+     * @property buttonColor
+     * @type string
+     * @default null
+     */
+    _buttonColor: null,
+
+    getButtonColor: function () {
+        return this._buttonColor;
+    },
+
+    setButtonColor: function (buttonColor) {
+        if (this._buttonColor) {
+            this.__html.button.classList.remove("photonui-button-color-" + this._buttonColor);
+        }
+        this._buttonColor = buttonColor;
+        if (buttonColor) {
+            this.__html.button.classList.add("photonui-button-color-" + this._buttonColor);
+        }
+    },
+
+    /**
+     * Html outer element of the widget (if any).
+     *
+     * @property html
+     * @type HTMLElement
+     * @default null
+     * @readOnly
+     */
+    getHtml: function () {
+        return this.__html.button;
+    },
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Public methods ======
+
+    /**
+     * Destroy the widget.
+     *
+     * @method destroy
+     */
+    destroy: function () {
+        if (this.leftIconName && this.leftIcon) {
+            this.leftIcon.destroy();
+            this.leftIconName = null;
+        }
+
+        if (this.rightIconName && this.rightIcon) {
+            this.rightIcon.destroy();
+            this.rightIconName = null;
+        }
+
+        this.$super();
+    },
+
+    // ====== Private methods ======
+
+    /**
+     * Update the button content
+     *
+     * @method _update
+     * @private
+     */
+    _update: function () {
+        if (this.__html.leftIcon.parentNode == this.__html.button) {
+            this.__html.button.removeChild(this.__html.leftIcon);
+        }
+        if (this.__html.text.parentNode == this.__html.button) {
+            this.__html.button.removeChild(this.__html.text);
+        }
+        if (this.__html.rightIcon.parentNode == this.__html.button) {
+            this.__html.button.removeChild(this.__html.rightIcon);
+        }
+
+        if (this.leftIconName && this.leftIconVisible) {
+            this.__html.button.appendChild(this.__html.leftIcon);
+        }
+
+        if (this.text && this.textVisible) {
+            this.__html.button.appendChild(this.__html.text);
+        }
+
+        if (this.rightIconName && this.rightIconVisible) {
+            this.__html.button.appendChild(this.__html.rightIcon);
+        }
+    },
+
+    /**
+     * Build the widget HTML.
+     *
+     * @method _buildHtml
+     * @private
+     */
+    _buildHtml: function () {
+        this.__html.button = document.createElement("button");
+        this.__html.button.className = "photonui-widget photonui-button";
+
+        this.__html.leftIcon = document.createElement("span");
+        this.__html.leftIcon.className = "photonui-button-icon";
+        this.__html.button.appendChild(this.__html.leftIcon);
+
+        this.__html.text = document.createElement("span");
+        this.__html.text.className = "photonui-button-text";
+        this.__html.button.appendChild(this.__html.text);
+
+        this.__html.rightIcon = document.createElement("span");
+        this.__html.rightIcon.className = "photonui-button-icon";
+        this.__html.button.appendChild(this.__html.rightIcon);
+    },
+
+    //////////////////////////////////////////
+    // Internal Events Callbacks            //
+    //////////////////////////////////////////
+
+    /**
+     * Called when the button is clicked.
+     *
+     * @method __onButtonClicked
+     * @private
+     * @param event
+     */
+    __onButtonClicked: function (event) {
+        this._callCallbacks("click", [event]);
+    }
+});
+
+// Button mixin for ToggleButton
+Button._buttonMixin = {
+    // Properties
+    _text:               Button.prototype._text,
+    getText:             Button.prototype.getText,
+    setText:             Button.prototype.setText,
+    _textVisible:        Button.prototype._textVisible,
+    isTextVisible:       Button.prototype.isTextVisible,
+    setTextVisible:      Button.prototype.setTextVisible,
+    _leftIconName:       Button.prototype._leftIconName,
+    getLeftIconName:     Button.prototype.getLeftIconName,
+    setLeftIconName:     Button.prototype.setLeftIconName,
+    getLeftIcon:         Button.prototype.getLeftIcon,
+    setLeftIcon:         Button.prototype.setLeftIcon,
+    _leftIconVisible:    Button.prototype._leftIconVisible,
+    isLeftIconVisible:   Button.prototype.isLeftIconVisible,
+    setLeftIconVisible:  Button.prototype.setLeftIconVisible,
+    _rightIconName:      Button.prototype._rightIconName,
+    getRightIconName:    Button.prototype.getRightIconName,
+    setRightIconName:    Button.prototype.setRightIconName,
+    getRightIcon:        Button.prototype.getRightIcon,
+    setRightIcon:        Button.prototype.setRightIcon,
+    _rightIconVisible:   Button.prototype._rightIconVisible,
+    isRightIconVisible:  Button.prototype.isRightIconVisible,
+    setRightIconVisible: Button.prototype.setRightIconVisible,
+    _appearance:         Button.prototype._appearance,
+    getAppearance:       Button.prototype.getAppearance,
+    setAppearance:       Button.prototype.setAppearance,
+    _buttonColor:        Button.prototype._buttonColor,
+    getButtonColor:      Button.prototype.getButtonColor,
+    setButtonColor:      Button.prototype.setButtonColor,
+    // Private methods
+    _update:             Button.prototype._update,
+    _buildButtonHtml:    Button.prototype._buildHtml,
+    // Internal Events Callbacks
+    __onButtonClicked:   Button.prototype.__onButtonClicked
+};
+
+module.exports = Button;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_interactive_checkbox.js.html b/ref/files/src_interactive_checkbox.js.html new file mode 100644 index 00000000..b3324ee9 --- /dev/null +++ b/ref/files/src_interactive_checkbox.js.html @@ -0,0 +1,347 @@ + + + + + src/interactive/checkbox.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/interactive/checkbox.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule Interactive
+ * @namespace photonui
+ */
+
+var Widget = require("../widget.js");
+
+/**
+ * Checkbox.
+ *
+ * wEvents:
+ *
+ *   * value-changed:
+ *     - description: called when the value was modified.
+ *     - callback:    function(widget, value)
+ *
+ * @class CheckBox
+ * @constructor
+ * @extends photonui.Widget
+ */
+var CheckBox = Widget.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        this._registerWEvents(["value-changed", "click"]);
+        this.$super(params);
+        this.inputId = this.name + "-input";
+        this._bindEvent("value-changed", this.__html.checkbox, "change", this.__onChange.bind(this));
+        this._bindEvent("span-click", this.__html.span, "click", this.__onSpanClick.bind(this));
+        this._bindEvent("checkbox-click", this.__html.checkbox, "click", this.__onCheckboxClick.bind(this));
+        this._bindEvent("span-keypress", this.__html.span, "keypress", this.__onSpanKeypress.bind(this));
+        this.__html.checkbox.name = this.name;
+        this.__html.checkbox.id = this.inputId;
+    },
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    /**
+     * The input value.
+     *
+     * @property value
+     * @type Boolean
+     * @default false
+     */
+    getValue: function () {
+        return this.__html.checkbox.checked;
+    },
+
+    setValue: function (value) {
+        this.__html.checkbox.checked = value;
+    },
+
+    /**
+     * Html outer element of the widget (if any).
+     *
+     * @property html
+     * @type HTMLElement
+     * @default null
+     * @readOnly
+     */
+    getHtml: function () {
+        return this.__html.outer;
+    },
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Private methods ======
+
+    /**
+     * Build the widget HTML.
+     *
+     * @method _buildHtml
+     * @private
+     */
+    _buildHtml: function () {
+        this.__html.outer = document.createElement("div");
+        this.__html.outer.className = "photonui-widget";
+        this.__html.outer.className += " photonui-checkbox";
+        this.__html.outer.className += " photonui-widget-fixed-width";
+        this.__html.outer.className += " photonui-widget-fixed-height";
+
+        this.__html.checkbox = document.createElement("input");
+        this.__html.checkbox.type = "checkbox";
+        this.__html.outer.appendChild(this.__html.checkbox);
+
+        this.__html.span = document.createElement("span");
+        this.__html.span.tabIndex = "0";
+        this.__html.outer.appendChild(this.__html.span);
+    },
+
+    //////////////////////////////////////////
+    // Internal Events Callbacks            //
+    //////////////////////////////////////////
+
+    /**
+     * @method __onChange
+     * @private
+     * @param event
+     */
+    __onChange: function (event) {
+        this._callCallbacks("value-changed", [this.value]);
+        // Focus the span if the real checkbox is hidden (happen when a label is clicked).
+        if (window.getComputedStyle(this.__html.checkbox).display == "none") {
+            this.__html.span.focus();
+        }
+    },
+
+    /**
+     * @method __onSpanClick
+     * @private
+     * @param event
+     */
+    __onSpanClick: function (event) {
+        this.value = !this.value;
+        this._callCallbacks("value-changed", [this.value]);
+        this._callCallbacks("click", [event]);
+    },
+
+    /**
+     * @method __onCheckboxClick
+     * @private
+     * @param event
+     */
+    __onCheckboxClick: function (event) {
+        this._callCallbacks("click", [event]);
+    },
+
+    /**
+     * @method __onSpanKeyPress
+     * @private
+     * @param event
+     */
+    __onSpanKeypress: function (event) {
+        if (event.charCode == 32 || event.keyCode == 13) {
+            this.value = !this.value;
+            this._callCallbacks("value-changed", [this.value]);
+        }
+    }
+});
+
+module.exports = CheckBox;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_interactive_colorpalette.js.html b/ref/files/src_interactive_colorpalette.js.html new file mode 100644 index 00000000..69b9d0b6 --- /dev/null +++ b/ref/files/src_interactive_colorpalette.js.html @@ -0,0 +1,370 @@ + + + + + src/interactive/colorpalette.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/interactive/colorpalette.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule Interactive
+ * @namespace photonui
+ */
+
+var Helpers = require("../helpers.js");
+var Widget = require("../widget.js");
+var Color = require("../nonvisual/color.js");
+
+/**
+ * A Color Palette.
+ *
+ * wEvents:
+ *
+ *   * value-changed:
+ *      - description: the selected color changed.
+ *      - callback:    function(widget, color)
+ *
+ * @class ColorPalette
+ * @constructor
+ * @extends photonui.Widget
+ * @param {Object} params An object that can contain any property of the widget (optional).
+ */
+var ColorPalette = Widget.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        this._color = new Color(ColorPalette.palette[0][0]);
+        this._registerWEvents(["value-changed"]);
+        this.$super(params);
+    },
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    /**
+     * The value (color in rgb hexadecimal format (e.g. "#ff0000")).
+     *
+     * @property value
+     * @type String
+     */
+    getValue: function () {
+        "@photonui-update";
+        return this.color.rgbHexString;
+    },
+
+    setValue: function (value) {
+        this.color.fromString(value);
+    },
+
+    /**
+     * The color.
+     *
+     * @property color
+     * @type photonui.Color
+     */
+    _color: null,
+
+    getColor: function () {
+        return this._color;
+    },
+
+    setColor: function (color) {
+        if (color instanceof Color) {
+            this._color = color;
+        }
+    },
+
+    /**
+     * The color palette.
+     *
+     * @property palette
+     * @type Array
+     * @default null (= `Color.palette`)
+     */
+    _palette: null,
+
+    getPalette: function () {
+        "@photonui-update";
+        return this._palette || ColorPalette.palette;
+    },
+
+    setPalette: function (palette) {
+        this._palette = palette;
+
+        if (!palette) {
+            palette = ColorPalette.palette;
+        }
+
+        // Update
+        this.__html.palette.removeChild(this.__html.tbody);
+        Helpers.cleanNode(this.__html.tbody);
+
+        var e_tr;
+        var e_td;
+        var x;
+        var y;
+        for (y = 0 ; y < palette.length ; y++) {
+            e_tr = document.createElement("tr");
+            for (x = 0 ; x < palette[y].length ; x++) {
+                e_td = document.createElement("td");
+                e_td.style.backgroundColor = palette[y][x];
+                e_td.onclick = this.__onColorClicked.bind(this, palette[y][x]);
+                e_tr.appendChild(e_td);
+            }
+            this.__html.tbody.appendChild(e_tr);
+        }
+
+        this.__html.palette.appendChild(this.__html.tbody);
+    },
+
+    /**
+     * Html outer element of the widget (if any).
+     *
+     * @property html
+     * @type HTMLElement
+     * @default null
+     * @readOnly
+     */
+    getHtml: function () {
+        return this.__html.palette;
+    },
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Private methods ======
+
+    /**
+     * Build the widget HTML.
+     *
+     * @method _buildHtml
+     * @private
+     */
+    _buildHtml: function () {
+        this.__html.palette = document.createElement("table");
+        this.__html.palette.className = "photonui-widget photonui-colorpalette";
+        this.__html.tbody = document.createElement("tbody");
+        this.__html.palette.appendChild(this.__html.tbody);
+    },
+
+    //////////////////////////////////////////
+    // Internal Events Callbacks            //
+    //////////////////////////////////////////
+
+    __onColorClicked: function (color, event) {
+        this.value = color;
+        this._callCallbacks("value-changed", [this.color]);
+    }
+});
+
+// The default palette
+
+ColorPalette.palette = [
+    ["#000000", "#424242", "#676767", "#989898", "#C5C5C5", "#FFFFFF"],
+    ["#E52131", "#ED7130", "#F0902C", "#F0B922", "#EDE118", "#7DA638"],
+    ["#EA4852", "#F08D52", "#F3A752", "#F9D246", "#F0EC51", "#A7CF41"],
+    ["#F19096", "#F5BC93", "#F9CB94", "#F9E48A", "#F2F08E", "#C6DE84"],
+    ["#F8D1D6", "#F9E2D2", "#F9E8D3", "#FDF8D2", "#F9F9CF", "#E7F1CD"],
+    ["#1E9E85", "#2A7DB5", "#2751A1", "#6C3E98", "#A33E97", "#DF3795"],
+    ["#2FB8A3", "#40A1D7", "#4072B5", "#8963AB", "#B462A7", "#E262A5"],
+    ["#88CEC3", "#8CC9E9", "#87A8D3", "#D2A0C9", "#D2A0C9", "#EDA0C6"],
+    ["#CEEAE7", "#CDE9F8", "#CFDEEF", "#EED9E9", "#EED9E9", "#F8D7E7"]
+];
+
+module.exports = ColorPalette;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_interactive_colorpicker.js.html b/ref/files/src_interactive_colorpicker.js.html new file mode 100644 index 00000000..8d1dd275 --- /dev/null +++ b/ref/files/src_interactive_colorpicker.js.html @@ -0,0 +1,699 @@ + + + + + src/interactive/colorpicker.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/interactive/colorpicker.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule Interactive
+ * @namespace photonui
+ */
+
+var Helpers = require("../helpers.js");
+var Widget = require("../widget.js");
+var Color = require("../nonvisual/color.js");
+var MouseManager = require("../nonvisual/mousemanager.js");
+
+/**
+ * A Color Picker.
+ *
+ * wEvents:
+ *
+ *   * value-changed:
+ *      - description: the selected color changed.
+ *      - callback:    function (widget, color)
+ *
+* value-changed-final:
+ *      - description: called when the value is no more modified after continuous changes
+ *      - callback:    function (widget, color)
+ *
+ * @class ColorPicker
+ * @constructor
+ * @extends photonui.Widget
+ * @param {Object} params An object that can contain any property of the widget (optional).
+ */
+var ColorPicker = Widget.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        this._registerWEvents(["value-changed", "value-changed-final"]);
+        this._color = new Color();
+        this.__buffH = document.createElement("canvas");
+        this.__buffH.width = 200;
+        this.__buffH.height = 200;
+        this.__buffSB = document.createElement("canvas");
+        this.__buffSB.width = 100;
+        this.__buffSB.height = 100;
+        this.__buffSBmask = document.createElement("canvas");
+        this.__buffSBmask.width = 100;
+        this.__buffSBmask.height = 100;
+        this.$super(params);
+        this._updateH();
+        this._updateSBmask();
+        this._updateSB();
+        this._updateCanvas();
+
+        this.__mouseManager = new MouseManager(this.__html.canvas);
+
+        this.__mouseManager.registerCallback("click", "mouse-move", this.__onMouseMove.bind(this));
+        this.__mouseManager.registerCallback("mouse-down", "mouse-down", this.__onMouseDown.bind(this));
+        this.__mouseManager.registerCallback("mouse-up", "mouse-up", this.__onMouseUp.bind(this));
+        this.__mouseManager.registerCallback("drag-start", "drag-start", this.__onDragStart.bind(this));
+
+        // Bind js events
+        this._bindEvent("value-changed", this.__html.preview, "change", this.__onValueChanged.bind(this));
+    },
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    /**
+     * The value (color in rgb hexadecimal format (e.g. "#ff0000")).
+     *
+     * @property value
+     * @type String
+     */
+    getValue: function () {
+        return this.color.rgbHexString;
+    },
+
+    setValue: function (value) {
+        this.color.fromString(value);
+        this._updateSB();
+        this._updateCanvas();
+    },
+
+    /**
+     * The color.
+     *
+     * @property color
+     * @type photonui.Color
+     */
+    _color: null,
+
+    getColor: function () {
+        "@photonui-update";
+        return this._color;
+    },
+
+    setColor: function (color) {
+        if (color instanceof Color) {
+            if (this._color) {
+                this._color.removeCallback("photonui.colorpicker.value-changed::" + this.name);
+            }
+            this._color = color;
+            this._color.registerCallback("photonui.colorpicker.value-changed::" +
+                this.name, "value-changed",
+                function () {
+                    this._updateSB();
+                    this._updateCanvas();
+                }.bind(this));
+            this._updateSB();
+            this._updateCanvas();
+        }
+    },
+
+    /**
+     * Html outer element of the widget (if any).
+     *
+     * @property html
+     * @type HTMLElement
+     * @default null
+     * @readOnly
+     */
+    getHtml: function () {
+        return this.__html.outer;
+    },
+
+    // ====== Private properties ======
+
+    /**
+     * Buffer canvas for hue circle.
+     *
+     * @property __buffH
+     * @private
+     * @type HTMLCanvasElement
+     */
+    __buffH: null,
+
+    /**
+     * Buffer canvas for saturation/brightness square.
+     *
+     * @property __buffSB
+     * @private
+     * @type HTMLCanvasElement
+     */
+    __buffSB: null,
+
+    /**
+     * Mouse manager.
+     *
+     * @property __mouseManager
+     * @private
+     * @type photonui.MouseManager
+     */
+    __mouseManager: null,
+
+    /**
+     * FLAG: Disable SB square update.
+     *
+     * @property __disableSBUpdate
+     * @private
+     * @type Boolean
+     * @default false
+     */
+    __disableSBUpdate: false,
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    destroy: function () {
+        this.__mouseManager.destroy();
+        this._color.removeCallback("photonui.colorpicker.value-changed::" + this.name);
+        this.$super();
+    },
+
+    /**
+     * Build the widget HTML.
+     *
+     * @method _buildHtml
+     * @private
+     */
+    _buildHtml: function () {
+        this.__html.outer = document.createElement("div");
+        this.__html.outer.className = "photonui-widget photonui-colorpicker";
+        this.__html.canvas = document.createElement("canvas");
+        this.__html.canvas.width = 200;
+        this.__html.canvas.height = 200;
+        this.__html.outer.appendChild(this.__html.canvas);
+
+        this.__html.previewOuter = document.createElement("span");
+        this.__html.previewOuter.className = "photonui-colorpicker-previewouter";
+        this.__html.outer.appendChild(this.__html.previewOuter);
+
+        this.__html.preview = document.createElement("input");
+        this.__html.preview.type = "text";
+        this.__html.preview.autocomplete = "off";
+        this.__html.preview.spellcheck = false;
+        this.__html.preview.className = "photonui-colorpicker-preview";
+        this.__html.previewOuter.appendChild(this.__html.preview);
+    },
+
+    /**
+     * Update hue circle
+     *
+     * @method _updateH
+     * @private
+     */
+    _updateH: function () {
+        var canvas = this.__buffH;
+        var ctx = canvas.getContext("2d");
+        var color = new Color();
+
+        ctx.clearRect(0, 0, canvas.width, canvas.height);
+
+        for (var i = 0; i < 360; i++) {
+            color.hue = 360 - i;
+            ctx.beginPath();
+            ctx.fillStyle = color.rgbHexString;
+            ctx.arc(100, 100, 90, Math.PI * i / 180, Math.PI * ((i + 2) % 360) / 180, false);
+            ctx.lineTo(100, 100);
+            ctx.fill();
+        }
+
+        ctx.beginPath();
+        ctx.fillStyle = "#000";
+        ctx.arc(100, 100, 73, 2 * Math.PI, false);
+        ctx.globalCompositeOperation = "destination-out";
+        ctx.fill();
+    },
+
+    /**
+     * Update saturation/brightness square mask
+     *
+     * @method _updateSBmask
+     * @private
+     */
+    _updateSBmask: function () {
+        var canvas = this.__buffSBmask;
+        var ctx = canvas.getContext("2d");
+        var pix = ctx.getImageData(0, 0, canvas.width, canvas.height);
+
+        var i = 0;
+        var saturation = 0;
+        var b = 0;
+        var s = 0;
+        for (b = 0; b < 100; b++) {
+            for (s = 0; s < 100; s++) {
+                i = 400 * b + 4 * s;
+
+                // some magic here
+                saturation = ((0.5 * (1 - s / 100) + 0.5) * (1 - b / 100) * 255) << 0;
+
+                pix.data[i + 0] = saturation;
+                pix.data[i + 1] = saturation;
+                pix.data[i + 2] = saturation;
+
+                // more magic
+                pix.data[i + 3] = ((1 - (((s / 100)) * (1 - (b / 100)))) * 255) << 0;
+            }
+        }
+
+        ctx.putImageData(pix, 0, 0);
+    },
+
+    /**
+     * Update saturation/brightness square
+     *
+     * @method _updateSB
+     * @private
+     */
+    _updateSB: function () {
+        if (this.__disableSBUpdate) {
+            return;
+        }
+
+        var canvas = this.__buffSB;
+        var ctx = canvas.getContext("2d");
+
+        var color = new Color({
+            hue: this.color.hue,
+            saturation: 100,
+            brightness: 100
+        });
+
+        ctx.save();
+
+        ctx.clearRect(0, 0, canvas.width, canvas.height);
+
+        // fill the whole canvas with the current color
+        ctx.fillStyle = color.rgbHexString;
+        ctx.rect(0, 0, canvas.width, canvas.height);
+        ctx.fill();
+
+        // draw a mask on it, it will do the trick
+        ctx.drawImage(this.__buffSBmask, 0, 0);
+
+        ctx.restore();
+    },
+
+    /**
+     * Update the canvas
+     *
+     * @method _updateCanvas
+     * @private
+     */
+    _updateCanvas: function () {
+        var canvas = this.__html.canvas;
+        var ctx = canvas.getContext("2d");
+
+        ctx.save();
+        ctx.clearRect(0, 0, canvas.width, canvas.height);
+
+        ctx.drawImage(this.__buffH, 0, 0);
+        ctx.drawImage(this.__buffSB, 50, 50);
+
+        ctx.strokeStyle = "#fff";
+        ctx.shadowColor = "rgba(0, 0, 0, .7)";
+        ctx.shadowBlur = 3;
+        ctx.lineWidth = 2;
+
+        // Square cursor
+        ctx.beginPath();
+        ctx.arc(this.color.saturation + 50, 100 - this.color.brightness + 50, 6, 2 * Math.PI, false);
+        ctx.stroke();
+
+        // Square cursor
+        ctx.translate(100, 100);
+        ctx.rotate(-this.color.hue * Math.PI / 180);
+        ctx.beginPath();
+        ctx.arc(81, 0, 6, 2 * Math.PI, false);
+        ctx.stroke();
+
+        ctx.restore();
+
+        // Color preview
+        this.__html.preview.style.backgroundColor = this.color.cssRgbaString;
+        this.__html.preview.value = this.color.rgbHexString;
+    },
+
+    /**
+     * Is the pointer on the SB Square?
+     *
+     * @method _pointerOnSquare
+     * @private
+     * @param mstate
+     * @return {Boolean}
+     */
+    _pointerOnSquare: function (mstate) {
+        return (mstate.x >= 50 && mstate.x <= 150 && mstate.y >= 50 && mstate.y <= 150);
+    },
+
+    /**
+     * Is the pointer on the hue circle?
+     *
+     * @method _pointerOnCircle
+     * @private
+     * @param mstate
+     * @return {Boolean}
+     */
+    _pointerOnCircle: function (mstate) {
+        var dx = Math.abs(100 - mstate.x);
+        var dy = Math.abs(100 - mstate.y);
+        var h = Math.sqrt(dx * dx + dy * dy);
+        return (h >= 74 && h <= 90);
+    },
+
+    /**
+     * the angle of the pointer with the horizontal line that pass by the center of the hue circle.
+     *
+     * @method _pointerAngle
+     * @private
+     * @param mstate
+     * @return {Number} the angle in degree.
+     */
+    _pointerAngle: function (mstate) {
+        var dx = Math.abs(100 - mstate.x);
+        var dy = Math.abs(100 - mstate.y);
+        var angle = Math.atan(dy / dx) * 180 / Math.PI;
+
+        if (mstate.x < 100 && mstate.y < 100) {
+            angle = 180 - angle;
+        } else if (mstate.x < 100 && mstate.y >= 100) {
+            angle += 180;
+        } else if (mstate.x >= 100 && mstate.y > 100) {
+            angle = 360 - angle;
+        }
+
+        return angle | 0;
+    },
+
+    //////////////////////////////////////////
+    // Internal Events Callbacks            //
+    //////////////////////////////////////////
+
+    /**
+     * @method __onMouseMove
+     * @private
+     * @param {photonui.MouseManager} manager
+     * @param {Object} mstate
+     */
+    __onMouseMove: function (manager, mstate) {
+        if (this._pointerOnSquare(mstate) || this._pointerOnCircle(mstate)) {
+            this.__html.canvas.style.cursor = "crosshair";
+        } else {
+            this.__html.canvas.style.cursor = "default";
+        }
+    },
+
+    /**
+     * @method __onMouseDown
+     * @private
+     * @param {photonui.MouseManager} manager
+     * @param {Object} mstate
+     */
+    __onMouseDown: function (manager, mstate) {
+        if (this._pointerOnSquare(mstate)) {
+            this.__disableSBUpdate = true;
+            this.color.saturation = mstate.x - 50;
+            this.color.brightness = 150 - mstate.y;
+            this.__disableSBUpdate = false;
+            this._callCallbacks("value-changed", this.color);
+        } else if (this._pointerOnCircle(mstate)) {
+            this.color.hue = this._pointerAngle(mstate);
+            this._callCallbacks("value-changed", this.color);
+        }
+    },
+
+    /**
+     * @method __onMouseUp
+     * @private
+     * @param {photonui.MouseManager} manager
+     * @param {Object} mstate
+     */
+    __onMouseUp: function (manager, mstate) {
+        this._callCallbacks("value-changed-final", this.color);
+    },
+
+    /**
+     * @method __onDragStart
+     * @private
+     * @param {photonui.MouseManager} manager
+     * @param {Object} mstate
+     */
+    __onDragStart: function (manager, mstate) {
+        if (this._pointerOnSquare(mstate)) {
+            this.__disableSBUpdate = true;
+            this.__mouseManager.registerCallback("dragging", "dragging", this.__onDraggingSquare.bind(this));
+            this.__mouseManager.registerCallback("drag-end", "drag-end", this.__onDragEnd.bind(this));
+        } else if (this._pointerOnCircle(mstate)) {
+            this.__mouseManager.registerCallback("dragging", "dragging", this.__onDraggingCircle.bind(this));
+            this.__mouseManager.registerCallback("drag-end", "drag-end", this.__onDragEnd.bind(this));
+        }
+    },
+
+    /**
+     * @method __onDraggingSquare
+     * @private
+     * @param {photonui.MouseManager} manager
+     * @param {Object} mstate
+     */
+    __onDraggingSquare: function (manager, mstate) {
+        this.color.saturation = mstate.x - 50;
+        this.color.brightness = 150 - mstate.y;
+        this._callCallbacks("value-changed", this.color);
+    },
+
+    /**
+     * @method __onDraggingCircle
+     * @private
+     * @param {photonui.MouseManager} manager
+     * @param {Object} mstate
+     */
+    __onDraggingCircle: function (manager, mstate) {
+        this.color.hue = this._pointerAngle(mstate);
+        this._callCallbacks("value-changed", this.color);
+    },
+
+    /**
+     * @method __onDragEnd
+     * @private
+     * @param {photonui.MouseManager} manager
+     * @param {Object} mstate
+     */
+    __onDragEnd: function (manager, mstate) {
+        this.__mouseManager.removeCallback("dragging");
+        this.__mouseManager.removeCallback("drag-end");
+        this.__disableSBUpdate = false;
+    },
+
+    /**
+     * @method __onValueChanged
+     * @private
+     */
+    __onValueChanged: function () {
+        this.color.fromString(this.__html.preview.value);
+        this.__html.preview.value = this.color.rgbHexString;
+        this._callCallbacks("value-changed", this.color);
+    },
+});
+
+module.exports = ColorPicker;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_interactive_field.js.html b/ref/files/src_interactive_field.js.html new file mode 100644 index 00000000..85b954ba --- /dev/null +++ b/ref/files/src_interactive_field.js.html @@ -0,0 +1,383 @@ + + + + + src/interactive/field.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/interactive/field.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule Interactive
+ * @namespace photonui
+ */
+
+var lodash = require("lodash");
+
+var Widget = require("../widget.js");
+
+/**
+ * Base class for fields.
+ *
+ * wEvents:
+ *
+ *   * value-changed:
+ *     - description: called when the value was modified.
+ *     - callback:    function(widget, value)
+ *
+ *   * value-changed-final:
+ *     - description: called when the value is no more modified after continuous changes
+ *     - callback:    function(widget, value)
+ *
+ *   * keydown:
+ *     - description: called when a key is pressed.
+ *     - callback:    function(widget, event)
+ *
+ *   * keyup:
+ *     - description: called when a key is released.
+ *     - callback:    function(widget, event)
+ *
+ *   * keypress:
+ *     - description: called just before the insertion of a char.
+ *     - callback:    function(widget, event)
+ *
+ *   * selection-changed:
+ *     - description: called when the selection was changed.
+ *     - callback:    function(widget, selectionStart, selectionEnd, selectedText, event)
+ *
+ * @class Field
+ * @constructor
+ * @extends photonui.Widget
+ */
+var Field = Widget.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        this._registerWEvents([
+            "value-changed", "value-changed-final", "keydown", "keyup", "keypress",
+            "selection-changed"
+        ]);
+        this.$super(params);
+        this.__html.field.name = this.name;
+
+        this.__debValueChangedFinal = lodash.debounce(this.__forValueChangedFinal, 250);
+    },
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    /**
+     * The field value.
+     *
+     * @property value
+     * @type String (maybe)
+     * @default ""
+     */
+    getValue: function () {
+        "@photonui-update";
+        return this.__html.field.value;
+    },
+
+    setValue: function (value) {
+        this.__html.field.value = value;
+    },
+
+    /**
+     * The placeholder displayed if the field is empty.
+     *
+     * @property Placeholder
+     * @type String
+     * @default ""
+     */
+    _placeholder: "",
+
+    getPlaceholder: function () {
+        "@photonui-update";
+        return this._placeholder;
+    },
+
+    setPlaceholder: function (placeholder) {
+        this._placeholder = placeholder;
+        this.__html.field.placeholder = placeholder;
+    },
+
+    /**
+     * Html outer element of the widget (if any).
+     *
+     * @property html
+     * @type HTMLElement
+     * @default null
+     * @readOnly
+     */
+    getHtml: function () {
+        return this.__html.field;
+    },
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Private methods ======
+
+    /**
+     * Bind Field events.
+     *
+     * @method _bindFieldEvents
+     * @private
+     */
+    _bindFieldEvents: function () {
+        this._bindEvent("value-changed", this.__html.field, "change", function (event) {
+            this._callCallbacks("value-changed", [this.value]);
+            this.__debValueChangedFinal();
+        }.bind(this));
+
+        this._bindEvent("keydown", this.__html.field, "keydown", function (event) {
+            this._callCallbacks("keydown", [event]);
+        }.bind(this));
+
+        this._bindEvent("keyup", this.__html.field, "keyup", function (event) {
+            this._callCallbacks("keyup", [event]);
+        }.bind(this));
+
+        this._bindEvent("keypress", this.__html.field, "keypress", function (event) {
+            this._callCallbacks("keypress", [event]);
+        }.bind(this));
+
+        this._bindEvent("selection-changed", this.__html.field, "select", function (event) {
+            this._callCallbacks("selection-changed", [
+                this.__html.field.selectionStart,
+                this.__html.field.selectionEnd,
+                String(this.getValue()).substring(this.__html.field.selectionStart, this.__html.field.selectionEnd),
+                event]);
+        }.bind(this));
+    },
+
+    //////////////////////////////////////////
+    // Internal Events Callbacks            //
+    //////////////////////////////////////////
+
+    /**
+     * Called when the context menu should be displayed.
+     *
+     * @method __onContextMenu
+     * @private
+     * @param event
+     */
+    __onContextMenu: function (event) {
+        event.stopPropagation();  // Enable context menu on fields
+    },
+
+    /**
+     * To be called indirectly through __debValueChangedFinal().
+     *
+     * @method __forValueChangedFinal
+     * @private
+     */
+    __forValueChangedFinal: function () {
+        this._callCallbacks("value-changed-final", [this.value]);
+    },
+
+    /**
+     * Debounced version of __forValueChangedFinal.
+     *
+     * @method __debValueChangedFinal
+     * @private
+     */
+    __debValueChangedFinal: null
+});
+
+module.exports = Field;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_interactive_iconbutton.js.html b/ref/files/src_interactive_iconbutton.js.html new file mode 100644 index 00000000..0b50c5ef --- /dev/null +++ b/ref/files/src_interactive_iconbutton.js.html @@ -0,0 +1,388 @@ + + + + + src/interactive/iconbutton.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/interactive/iconbutton.js

+ +
+
+/*
+ * Copyright (c) 2014-2016, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <https://github.com/flozz>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule Interactive
+ * @namespace photonui
+ */
+
+var Widget = require("../widget.js");
+var BaseIcon = require("../visual/baseicon.js");
+var Helpers = require("../helpers.js");
+var PhotonImage = require("../visual/image.js");
+
+/**
+ * A simple flat button that only contains an icon
+ *
+ * wEvents:
+ *
+ *   * click:
+ *     - description: called when the button was clicked.
+ *     - callback:    function(widget, event)
+ *
+ * @class IconButton
+ * @constructor
+ * @extends photonui.Widget
+ * @param {Object} params An object that can contain any property of the widget (optional).
+ */
+var IconButton = Widget.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        this._registerWEvents(["click"]);
+        this.$super(params);
+
+        this._bindEvent("click", this.__html.div, "click", this.__onButtonClicked.bind(this));
+    },
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    /**
+     * Button width
+     *
+     * @property width
+     * @type Number
+     * @default 16
+     */
+    _width: 16,
+
+    getWidth: function () {
+        "@photonui-update";
+        return this._width;
+    },
+
+    setWidth: function (width) {
+        this._width = width;
+        this.html.style.width = width + "px";
+        this.html.style.minWidth = width + "px";
+        this.html.style.maxWidth = width + "px";
+    },
+
+    /**
+     * Button height
+     *
+     * @property height
+     * @type Number
+     * @default 16
+     */
+    _height: 16,
+
+    getHeight: function () {
+        "@photonui-update";
+        return this._height;
+    },
+
+    setHeight: function (height) {
+        this._height = height;
+        this.html.style.height = height + "px";
+        this.html.style.minHeight = height + "px";
+        this.html.style.maxHeight = height + "px";
+        this.html.style.lineHeight = height + "px";
+    },
+
+    /**
+     * Icon widget name.
+     *
+     * @property iconName
+     * @type String
+     * @default: null
+     */
+    _iconName: null,
+
+    getIconName: function () {
+        return this._iconName;
+    },
+
+    setIconName: function (iconName) {
+        this._iconName = iconName;
+        Helpers.cleanNode(this.__html.div);
+        if (this._iconName) {
+            this.__html.div.appendChild(this.icon.html);
+            this.iconVisible = true;
+        }
+    },
+
+    /**
+     * Icon widget.
+     *
+     * @property icon
+     * @type BaseIcon
+     * @default: null
+     */
+    getIcon: function () {
+        return Widget.getWidget(this._iconName);
+    },
+
+    setIcon: function (icon) {
+        if (icon instanceof BaseIcon || icon instanceof PhotonImage) {
+            this.iconName = icon.name;
+            return;
+        }
+        this.iconName = null;
+    },
+
+    /**
+     * Html outer element of the widget (if any).
+     *
+     * @property html
+     * @type HTMLElement
+     * @default null
+     * @readOnly
+     */
+    getHtml: function () {
+        return this.__html.div;
+    },
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Public methods ======
+
+    /**
+     * Destroy the widget.
+     *
+     * @method destroy
+     */
+    destroy: function () {
+        if (this.iconName && this.icon) {
+            this.icon.destroy();
+        }
+
+        this.$super();
+    },
+
+    // ====== Private methods ======
+
+    /**
+     * Build the widget HTML.
+     *
+     * @method _buildHtml
+     * @private
+     */
+    _buildHtml: function () {
+        this.__html.div = document.createElement("div");
+        this.__html.div.className = "photonui-widget photonui-iconbutton";
+        this.__html.div.className += " photonui-widget-fixed-width photonui-widget-fixed-height";
+        this.__html.div.tabIndex = "0";
+    },
+
+    //////////////////////////////////////////
+    // Internal Events Callbacks            //
+    //////////////////////////////////////////
+
+    /**
+     * Called when the button is clicked.
+     *
+     * @method __onButtonClicked
+     * @private
+     * @param event
+     */
+    __onButtonClicked: function (event) {
+        this._callCallbacks("click", [event]);
+    }
+
+});
+
+module.exports = IconButton;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_interactive_numericfield.js.html b/ref/files/src_interactive_numericfield.js.html new file mode 100644 index 00000000..445c18fa --- /dev/null +++ b/ref/files/src_interactive_numericfield.js.html @@ -0,0 +1,550 @@ + + + + + src/interactive/numericfield.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/interactive/numericfield.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule Interactive
+ * @namespace photonui
+ */
+
+var Field = require("./field.js");
+
+/**
+ * Numeric field.
+ *
+ * @class NumericField
+ * @constructor
+ * @extends photonui.Field
+ */
+var NumericField = Field.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        this.$super(params);
+        this._bindFieldEvents();
+        this._unbindEvent("value-changed");
+        this._bindEvent("keypress", this.__html.field, "keypress", this.__onKeypress.bind(this));
+        this._bindEvent("keyup", this.__html.field, "keyup", this.__onKeyup.bind(this));
+        this._bindEvent("keydown", this.__html.field, "keydown", this.__onKeydown.bind(this));
+        this._bindEvent("change", this.__html.field, "change", this.__onChange.bind(this));
+        this._bindEvent("mousewheel", this.__html.field, "mousewheel", this.__onMouseWheel.bind(this));
+        this._bindEvent("mousewheel-firefox", this.__html.field, "DOMMouseScroll", this.__onMouseWheel.bind(this));
+    },
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    /**
+     * The minimum value of the field.
+     *
+     * @property min
+     * @type Number
+     * default null (no minimum);
+     */
+    _min: null,
+
+    getMin: function () {
+        return this._min;
+    },
+
+    setMin: function (min) {
+        "@photonui-update";
+        this._min = min;
+        this._updateValue(this.value);
+        this._updateFieldValue();
+    },
+
+    /**
+     * The maximum value of the field.
+     *
+     * @property max
+     * @type Number
+     * default null (no maximum);
+     */
+    _max: null,
+
+    getMax: function () {
+        return this._max;
+    },
+
+    setMax: function (max) {
+        "@photonui-update";
+        this._max = max;
+        this._updateValue(this.value);
+        this._updateFieldValue();
+    },
+
+    /**
+     * The incrementation step of the field.
+     *
+     * @property step
+     * @type Number
+     * default 1
+     */
+    _step: 1,
+
+    getStep: function () {
+        return this._step;
+    },
+
+    setStep: function (step) {
+        this._step = Math.abs(step);
+    },
+
+    /**
+     * The number of digit after the decimal dot.
+     *
+     * @property decimalDigits
+     * @type Number
+     * @default null (no limite)
+     */
+    _decimalDigits: null,
+
+    getDecimalDigits: function () {
+        "@photonui-update";
+        return this._decimalDigits;
+    },
+
+    setDecimalDigits: function (decimalDigits) {
+        this._decimalDigits = decimalDigits;
+        this._updateValue(this.value);
+        this._updateFieldValue();
+    },
+
+    /**
+     * The decimal symbol ("." or ",").
+     *
+     * @property decimalSymbol
+     * @type String
+     * @default: "."
+     */
+    _decimalSymbol: ".",
+
+    getDecimalSymbol: function () {
+        "@photonui-update";
+        return this._decimalSymbol;
+    },
+
+    setDecimalSymbol: function (decimalSymbol) {
+        this._decimalSymbol = decimalSymbol;
+        this._updateValue(this.value);
+        this._updateFieldValue();
+    },
+
+    /**
+     * The field value.
+     *
+     * @property value
+     * @type Number
+     * @default 0
+     */
+    _value: 0,
+
+    getValue: function () {
+        "@photonui-update";
+        return parseFloat(this._value);
+    },
+
+    setValue: function (value) {
+        this._updateValue(value);
+        this._updateFieldValue();
+    },
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Private methods ======
+
+    /**
+     * Update the value (in the widget).
+     *
+     * @method _updateValue
+     * @private
+     * @param {String|Number} value The raw value.
+     */
+    _updateValue: function (value) {
+        value = String(value).replace(",", "."); // ","
+        value = value.replace(/ /g, "");  // remove spaces
+        value = parseFloat(value);
+        if (isNaN(value)) {
+            value = 0;
+        }
+
+        if (this.min !== null) {
+            value = Math.max(this.min, value);
+        }
+
+        if (this.max !== null) {
+            value = Math.min(this.max, value);
+        }
+
+        if (this.decimalDigits !== null) {
+            value = value.toFixed(this.decimalDigits);
+        }
+
+        this._value = value;
+    },
+
+    /**
+     * Update the value in the html field.
+     *
+     * @method _updateFieldValue
+     * @private
+     */
+    _updateFieldValue: function () {
+        this.__html.field.value = String(this._value).replace(".", this.decimalSymbol);
+    },
+
+    /**
+     * Validate the user inputs.
+     *
+     * @method _validateInput
+     * @private
+     * @param {String} value
+     * @return {Boolean}
+     */
+    _validateInput: function (value) {
+        value = String(value);
+        value = value.replace(/ /g, "");  // remove spaces
+        if (/^-?[0-9]*(\.|,)?[0-9]*$/.test(value)) {
+            if (this.decimalDigits === 0 && !/^-?[0-9]*$/.test(value)) {
+                return false;
+            }
+            if (this.min !== null && this.min >= 0 && value[0] == "-") {
+                return false;
+            }
+            return true;
+        }
+        return false;
+    },
+
+    /**
+     * Build the widget HTML.
+     *
+     * @method _buildHtml
+     * @private
+     */
+    _buildHtml: function () {
+        this.__html.field = document.createElement("input");
+        this.__html.field.className = "photonui-widget photonui-field photonui-numericfield";
+        this.__html.field.type = "text";
+    },
+
+    //////////////////////////////////////////
+    // Internal Events Callbacks            //
+    //////////////////////////////////////////
+
+    /**
+     * @method __onKeypress
+     * @private
+     * @param event
+     */
+    __onKeypress: function (event) {
+        if (event.ctrlKey ||
+            event.key == "ArrowLeft" ||
+            event.key == "ArrowRight" ||
+            event.key == "Backspace" ||
+            event.key == "Delete"
+        ) {
+            return;
+        } else if (event.keyCode == 13) {  // Enter
+            this._updateFieldValue();
+            this._callCallbacks("value-changed", [this.value]);
+            this.__debValueChangedFinal();
+        } else {
+            var field = this.__html.field;
+            var value = field.value.slice(0, field.selectionStart) +
+                        String.fromCharCode(event.charCode) +
+                        field.value.slice(field.selectionEnd);
+            if (!this._validateInput(value)) {
+                event.preventDefault();
+            }
+        }
+    },
+
+    /**
+     * @method __onKeyup
+     * @private
+     * @param event
+     */
+    __onKeyup: function (event) {
+        var value = this.__html.field.value.replace(/[^0-9.,-]*/g, "");
+        if (value != this.__html.field.value) {
+            this.__html.field.value = value;
+        }
+        this._updateValue(this.__html.field.value);
+    },
+
+    /**
+     * @method __onChange
+     * @private
+     * @param event
+     */
+    __onChange: function (event) {
+        this._updateFieldValue();
+        this._callCallbacks("value-changed", [this.value]);
+        this.__debValueChangedFinal();
+    },
+
+    /**
+     * @method __onMouseWheel
+     * @private
+     * @param event
+     */
+    __onMouseWheel: function (event) {
+        if (document.activeElement != this.__html.field) {
+            return;
+        }
+
+        var wheelDelta = null;
+
+        // Webkit
+        if (event.wheelDeltaY !== undefined) {
+            wheelDelta = event.wheelDeltaY;
+        }
+        // MSIE
+        if (event.wheelDelta !== undefined) {
+            wheelDelta = event.wheelDelta;
+        }
+        // Firefox
+        if (event.axis !== undefined && event.detail !== undefined) {
+            if (event.axis == 2) { // Y
+                wheelDelta = -event.detail;
+            }
+        }
+
+        if (wheelDelta !== null) {
+            if (wheelDelta >= 0) {
+                this.value += this.step;
+            } else {
+                this.value -= this.step;
+            }
+            event.preventDefault();
+        }
+
+        this._callCallbacks("value-changed", [this.value]);
+        this.__debValueChangedFinal();
+    },
+
+    /**
+     * @method __onKeydown
+     * @private
+     * @param event
+     */
+    __onKeydown: function (event) {
+        if (event.keyCode == 38) {
+            this.value += this.step;
+            event.preventDefault();
+            this._callCallbacks("value-changed", [this.value]);
+            this.__debValueChangedFinal();
+        } else if (event.keyCode == 40) {
+            this.value -= this.step;
+            event.preventDefault();
+            this._callCallbacks("value-changed", [this.value]);
+            this.__debValueChangedFinal();
+        }
+    }
+
+});
+
+module.exports = NumericField;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_interactive_slider.js.html b/ref/files/src_interactive_slider.js.html new file mode 100644 index 00000000..545ad435 --- /dev/null +++ b/ref/files/src_interactive_slider.js.html @@ -0,0 +1,534 @@ + + + + + src/interactive/slider.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/interactive/slider.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule Interactive
+ * @namespace photonui
+ */
+
+var Helpers = require("../helpers.js");
+var NumericField = require("./numericfield.js");
+
+/**
+ * Slider
+ *
+ * @class Slider
+ * @constructor
+ * @extends photonui.NumericField
+ * @param {Object} params An object that can contain any property of the widget (optional).
+ */
+var Slider = NumericField.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        this.$super(params);
+
+        if (params && params.decimalDigits === undefined) {
+            this.decimalDigits = 0;
+        }
+
+        if (params && params.min === undefined) {
+            this.min = 0;
+        }
+
+        if (params && params.max === undefined) {
+            this.max = 100;
+        }
+
+        this.inputId = this.name + "-field";
+        this.__html.field.id = this.inputId;
+
+        this._bindEvent("slider-mousedown", this.__html.slider, "mousedown", this.__onSliderMouseDown.bind(this));
+        this._bindEvent("slider-touchstart", this.__html.slider, "touchstart", this.__onSliderTouchStart.bind(this));
+
+        this._bindEvent("slider-keydown", this.__html.slider, "keydown", this.__onSliderKeyDown.bind(this));
+        this._bindEvent("slider-mousewheel", this.__html.slider, "mousewheel", this.__onSliderMouseWheel.bind(this));
+        this._bindEvent("slider-mousewheel-firefox", this.__html.slider,
+                        "DOMMouseScroll", this.__onSliderMouseWheel.bind(this));
+        this._bindEvent("field-contextmenu", this.__html.field, "contextmenu", this.__onFieldContextMenu.bind(this));
+    },
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    /**
+     * Define if the numeric field should be displayed.
+     *
+     * @property fieldVisible
+     * @type Boolean
+     * @default: true
+     */
+    _fieldVisible: true,
+
+    isFieldVisible: function () {
+        "@photonui-update";
+        return this._fieldVisible;
+    },
+
+    setFieldVisible: function (fieldVisible) {
+        this._fieldVisible = fieldVisible;
+
+        if (fieldVisible) {
+            this.__html.field.style.display = "";
+            this.removeClass("photonui-slider-nofield");
+        } else {
+            this.__html.field.style.display = "none";
+            this.addClass("photonui-slider-nofield");
+        }
+    },
+
+    /**
+     * Html outer element of the widget (if any).
+     *
+     * @property html
+     * @type HTMLElement
+     * @default null
+     * @readOnly
+     */
+    getHtml: function () {
+        return this.__html.outer;
+    },
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Private methods ======
+
+    /**
+     * Update the value in the html field.
+     *
+     * @method _updateFieldValue
+     * @private
+     */
+    _updateFieldValue: function () {
+        this.$super();
+        var v = this.value - this.min;
+        var m = this.max - this.min;
+        var p = Math.min(Math.max(v / m, 0), 1);
+        this.__html.grip.style.left = Math.floor(p * 100) + "%";
+        this.__html.grip.style.transform = "translateX(" + (-100 * p) + "%)";
+    },
+
+    /**
+     * Build the widget HTML.
+     *
+     * @method _buildHtml
+     * @private
+     */
+    _buildHtml: function () {
+        this.$super();
+
+        this.__html.outer = document.createElement("div");
+        this.__html.outer.className = "photonui-widget photonui-slider photonui-widget-fixed-height";
+
+        this.__html.slider = document.createElement("div");
+        this.__html.slider.className = "photonui-slider-slider";
+        this.__html.slider.tabIndex = 0;
+        this.__html.outer.appendChild(this.__html.slider);
+
+        this.__html.grip = document.createElement("div");
+        this.__html.grip.className = "photonui-slider-grip";
+        this.__html.slider.appendChild(this.__html.grip);
+
+        this.__html.outer.appendChild(this.__html.field);
+    },
+
+    /**
+     * Update the value form a mouse event occured on the slider.
+     *
+     * @method _updateFromMouseEvent
+     * @private
+     * @param event
+     */
+    _updateFromMouseEvent: function (event) {
+        // Prevent reset on touchend.
+        if (typeof(event.pageX) === "undefined") {
+            return;
+        }
+
+        var wx = Helpers.getAbsolutePosition(this.__html.slider).x;
+        var gw = this.__html.grip.offsetWidth;
+        var x = Math.round(event.pageX - wx - gw / 2);
+        var w = this.__html.slider.offsetWidth - gw - 3;
+        var v = (this.max - this.min) * x / w + this.min;
+        this.value = Math.round(v / this.step) * this.step;
+        this._callCallbacks("value-changed", [this.value]);
+    },
+
+    //////////////////////////////////////////
+    // Internal Events Callbacks            //
+    //////////////////////////////////////////
+
+    /**
+     * @method __onSliderMouseDown
+     * @private
+     * @param event
+     */
+    __onSliderMouseDown: function (event) {
+        this._updateFromMouseEvent(event);
+        this._bindEvent("slider-mousemove", document, "mousemove", this.__onSliderMouseMove.bind(this));
+        this._bindEvent("slider-mouseup", document, "mouseup", this.__onSliderMouseUp.bind(this));
+    },
+
+    /**
+     * @method __onSliderMouseMove
+     * @private
+     * @param event
+     */
+    __onSliderMouseMove: function (event) {
+        this._updateFromMouseEvent(event);
+    },
+
+    /**
+     * @method __onSliderMouseUp
+     * @private
+     * @param event
+     */
+    __onSliderMouseUp: function (event) {
+        this._unbindEvent("slider-mousemove");
+        this._unbindEvent("slider-mouseup");
+        this._updateFromMouseEvent(event);
+        this.__debValueChangedFinal();
+    },
+
+    /**
+     * @method __onSliderTouchStart
+     * @private
+     * @param event
+     */
+    __onSliderTouchStart: function (event) {
+        this._updateFromMouseEvent(this.__getTouchEvent(event));
+        this._bindEvent("slider-touchmove", document, "touchmove", this.__onSliderTouchMove.bind(this));
+        this._bindEvent("slider-touchend", document, "touchend", this.__onSliderTouchEnd.bind(this));
+        this._bindEvent("slider-touchcancel", document, "touchcancel", this.__onSliderTouchEnd.bind(this));
+    },
+
+    /**
+     * @method __onSliderTouchMove
+     * @private
+     * @param event
+     */
+    __onSliderTouchMove: function (event) {
+        this._updateFromMouseEvent(this.__getTouchEvent(event));
+    },
+
+    /**
+     * @method __onSliderTouchEnd
+     * @private
+     * @param event
+     */
+    __onSliderTouchEnd: function (event) {
+        this._unbindEvent("slider-touchmove");
+        this._unbindEvent("slider-touchend");
+        this._unbindEvent("slider-touchcancel");
+        this.__debValueChangedFinal();
+    },
+
+    /**
+     * Gets the first touch event and normalizes pageX/Y and offsetX/Y properties.
+     *
+     * @method _moveTouchEnd
+     * @private
+     * @param {Object} event
+     */
+    __getTouchEvent: function (event) {
+        if (event.touches && event.touches.length) {
+            event.preventDefault();
+            var evt = event.touches[0];
+            evt.pageX = evt.pageX || evt.clientX;
+            evt.pageY = evt.pageX || evt.clientY;
+
+            var position = Helpers.getAbsolutePosition(event.target);
+            evt.offsetX = evt.offsetX || evt.pageX - position.x;
+            evt.offsetY = evt.offsetY || evt.pageY - position.y;
+            return evt;
+        }
+
+        return event;
+    },
+
+    /*
+     * @method __onSliderKeyPress
+     * @private
+     * @param event
+     */
+    __onSliderKeyDown: function (event) {
+        if (event.keyCode == 38 || event.keyCode == 39) {  // Up, Right
+            event.preventDefault();
+            event.stopPropagation();
+            this.value += this.step;
+            this._callCallbacks("value-changed", [this.value]);
+            this.__debValueChangedFinal();
+        } else if (event.keyCode == 40 || event.keyCode == 37) {  // Down, Left
+            event.preventDefault();
+            event.stopPropagation();
+            this.value -= this.step;
+            this._callCallbacks("value-changed", [this.value]);
+            this.__debValueChangedFinal();
+        }
+    },
+
+    /**
+     * @method __onSliderMouseWheel
+     * @private
+     * @param event
+     */
+    __onSliderMouseWheel: function (event) {
+        var wheelDelta = null;
+
+        // Webkit
+        if (event.wheelDeltaY !== undefined) {
+            wheelDelta = event.wheelDeltaY;
+        }
+        // MSIE
+        if (event.wheelDelta !== undefined) {
+            wheelDelta = event.wheelDelta;
+        }
+        // Firefox
+        if (event.axis !== undefined && event.detail !== undefined) {
+            if (event.axis == 2) { // Y
+                wheelDelta = -event.detail;
+            }
+        }
+
+        if (wheelDelta !== null) {
+            if (wheelDelta >= 0) {
+                this.value += this.step;
+            } else {
+                this.value -= this.step;
+            }
+            event.preventDefault();
+            event.stopPropagation();
+        }
+
+        this._callCallbacks("value-changed", [this.value]);
+        this.__debValueChangedFinal();
+    },
+
+    /**
+     * Called when the context menu should be displayed.
+     *
+     * @method __onContextMenu
+     * @private
+     * @param event
+     */
+    __onContextMenu: function (event) {
+        event.stopPropagation();
+        event.preventDefault();
+        if (this.contextMenuName) {
+            this.contextMenu.popupXY(event.pageX, event.pageY);
+        }
+    },
+
+    /**
+     * @method __onFieldContextMenu
+     * @private
+     * @param event
+     */
+    __onFieldContextMenu: function (event) {
+        event.stopPropagation();
+    }
+});
+
+module.exports = Slider;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_interactive_switch.js.html b/ref/files/src_interactive_switch.js.html new file mode 100644 index 00000000..0b5e4421 --- /dev/null +++ b/ref/files/src_interactive_switch.js.html @@ -0,0 +1,225 @@ + + + + + src/interactive/switch.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/interactive/switch.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule Interactive
+ * @namespace photonui
+ */
+
+var CheckBox = require("./checkbox.js");
+
+/**
+ * Switch.
+ *
+ * @class Switch
+ * @constructor
+ * @extends photonui.CheckBox
+ */
+var Switch = CheckBox.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        this.$super(params);
+        this.removeClass("photonui-checkbox");
+        this.addClass("photonui-switch");
+    }
+});
+
+module.exports = Switch;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_interactive_textareafield.js.html b/ref/files/src_interactive_textareafield.js.html new file mode 100644 index 00000000..e188043b --- /dev/null +++ b/ref/files/src_interactive_textareafield.js.html @@ -0,0 +1,279 @@ + + + + + src/interactive/textareafield.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/interactive/textareafield.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule Interactive
+ * @namespace photonui
+ */
+
+var Field = require("./field.js");
+
+/**
+ * Multiline text field.
+ *
+ * @class TextAreaField
+ * @constructor
+ * @extends photonui.Field
+ */
+var TextAreaField = Field.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        this.$super(params);
+        this._bindFieldEvents();
+    },
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    /**
+     * Number of columns.
+     *
+     * @property cols
+     * @type Number
+     * @default 20
+     */
+    getCols: function () {
+        return parseInt(this.__html.field.cols);
+    },
+
+    setCols: function (cols) {
+        this.__html.field.cols = cols;
+    },
+
+    /**
+     * Number of rows.
+     *
+     * @property rows
+     * @type Number
+     * @default 3
+     */
+    getRows: function () {
+        return parseInt(this.__html.field.rows);
+    },
+
+    setRows: function (rows) {
+        this.__html.field.rows = rows;
+    },
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Private methods ======
+
+    /**
+     * Build the widget HTML.
+     *
+     * @method _buildHtml
+     * @private
+     */
+    _buildHtml: function () {
+        this.__html.field = document.createElement("textarea");
+        this.__html.field.className = "photonui-widget photonui-field photonui-textareafield";
+        this.__html.field.cols = 20;
+        this.__html.field.rows = 3;
+    }
+});
+
+module.exports = TextAreaField;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_interactive_textfield.js.html b/ref/files/src_interactive_textfield.js.html new file mode 100644 index 00000000..1f17a9fe --- /dev/null +++ b/ref/files/src_interactive_textfield.js.html @@ -0,0 +1,279 @@ + + + + + src/interactive/textfield.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/interactive/textfield.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule Interactive
+ * @namespace photonui
+ */
+
+var Field = require("./field.js");
+
+/**
+ * Text, Password, Email, Search, Tel, URL Fields.
+ *
+ * @class TextField
+ * @constructor
+ * @extends photonui.Field
+ */
+var TextField = Field.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        this.$super(params);
+        this._bindFieldEvents();
+    },
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    /**
+     * Type of the field.
+     *
+     *   * text
+     *   * password
+     *   * email
+     *   * search
+     *   * tel
+     *   * url
+     *
+     * @property type
+     * @type String
+     * @default text
+     */
+    getType: function () {
+        return this.__html.field.type;
+    },
+
+    setType: function (type) {
+        if (type != "text" &&
+            type != "password" &&
+            type != "email" &&
+            type != "search" &&
+            type != "tel" &&
+            type != "url"
+        ) {
+            throw new Error("The type should be \"text\", \"password\", \"email\", \"search\", \"tel\" or \"url\".");
+        }
+        this.__html.field.type = type;
+    },
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Private methods ======
+
+    /**
+     * Build the widget HTML.
+     *
+     * @method _buildHtml
+     * @private
+     */
+    _buildHtml: function () {
+        this.__html.field = document.createElement("input");
+        this.__html.field.className = "photonui-widget photonui-field photonui-textfield";
+        this.__html.field.type = "text";
+    }
+});
+
+module.exports = TextField;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_interactive_togglebutton.js.html b/ref/files/src_interactive_togglebutton.js.html new file mode 100644 index 00000000..a5e0c35f --- /dev/null +++ b/ref/files/src_interactive_togglebutton.js.html @@ -0,0 +1,258 @@ + + + + + src/interactive/togglebutton.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/interactive/togglebutton.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule Interactive
+ * @namespace photonui
+ */
+
+var CheckBox = require("./checkbox.js");
+var Button = require("./button.js");
+
+/**
+ * Toogle Button.
+ *
+ * @class ToggleButton
+ * @constructor
+ * @extends photonui.CheckBox
+ * @uses photonui.Button
+ */
+var ToggleButton = CheckBox.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        this.$super(params);
+        this.__buttonInit();
+        this.removeClass("photonui-checkbox");
+        this.addClass("photonui-togglebutton");
+        this.removeClass("photonui-widget-fixed-height");
+        this.removeClass("photonui-widget-fixed-width");
+    },
+
+    // photonui.Button constructor (without the call to $super)
+    __buttonInit: function () {
+        this._update();
+    },
+
+    // Mixin
+    __include__: [Button._buttonMixin],
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Private methods ======
+
+    /**
+     * Build the widget HTML.
+     *
+     * @method _buildHtml
+     * @private
+     */
+    _buildHtml: function () {
+        this.$super();
+        this._buildButtonHtml();
+        this.__html.outer.appendChild(this.__html.button);
+        this.__html.outer.removeChild(this.__html.span);
+        this.__html.span = this.__html.button;
+    }
+});
+
+module.exports = ToggleButton;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_layout_boxlayout.js.html b/ref/files/src_layout_boxlayout.js.html new file mode 100644 index 00000000..45d5eb49 --- /dev/null +++ b/ref/files/src_layout_boxlayout.js.html @@ -0,0 +1,536 @@ + + + + + src/layout/boxlayout.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/layout/boxlayout.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule Layout
+ * @namespace photonui
+ */
+
+var Helpers = require("../helpers.js");
+var Layout = require("./layout.js");
+
+/**
+ * Vertical and horizontal box layout.
+ *
+ * Layout Options:
+ *
+ *     {
+ *         align: <String (stretch|expand, start|left|top, center|middle, end|right|bottom), default=stretch>,
+ *
+ *         order: <Number default=null (auto)>
+ *
+ *         minWidth: <Number (null=auto), default=null>,
+ *         maxWidth: <Number (null=auto), default=null>,
+ *         width: <Number (null=auto), default=null>,
+ *
+ *         minHeight: <Number (null=auto), default=null>,
+ *         maxHeight: <Number (null=auto), default=null>,
+ *         height: <Number (null=auto), default=null>
+ *     }
+ *
+ * @class BoxLayout
+ * @constructor
+ * @extends photonui.Layout
+ */
+var BoxLayout = Layout.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        this.$super(params);
+    },
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    /**
+     * The layout orientation ("vertical" or "horizontal").
+     *
+     * @property orientation
+     * @type String
+     * @default "vertical"
+     */
+    _orientation: "vertical",
+
+    getOrientation: function () {
+        "@photonui-update";
+        return this._orientation;
+    },
+
+    setOrientation: function (orientation) {
+        if (orientation != "vertical" && orientation != "horizontal") {
+            throw new Error("The orientation should be \"vertical\" or \"horizontal\".");
+        }
+        this._orientation = orientation;
+        this.removeClass("photonui-layout-orientation-vertical");
+        this.removeClass("photonui-layout-orientation-horizontal");
+        this.addClass("photonui-layout-orientation-" + this.orientation);
+        this.spacing = this.spacing;
+    },
+
+    /**
+     * Vertical padding (px).
+     *
+     * @property verticalPadding
+     * @type Number
+     * @default 0
+     */
+    _verticalPadding: 0,
+
+    getVerticalPadding: function () {
+        return this._verticalPadding;
+    },
+
+    setVerticalPadding: function (padding) {
+        this._verticalPadding = padding | 0;
+        this.__html.outerbox.style.paddingLeft = this._verticalPadding + "px";
+        this.__html.outerbox.style.paddingRight = this._verticalPadding + "px";
+    },
+
+    /**
+     * Horizontal padding (px).
+     *
+     * @property horizontalPadding
+     * @type Number
+     * @default 0
+     */
+    _horizontalPadding: 0,
+
+    getHorizontalPadding: function () {
+        return this._horizontalPadding;
+    },
+
+    setHorizontalPadding: function (padding) {
+        this._horizontalPadding = padding | 0;
+        this.__html.outerbox.style.paddingTop = this._horizontalPadding + "px";
+        this.__html.outerbox.style.paddingBottom = this._horizontalPadding + "px";
+    },
+
+    /**
+     * Spacing between children widgets.
+     *
+     * @property spacing
+     * @type Number
+     * @default 5
+     */
+    _spacing: 5,
+
+    getSpacing: function () {
+        return this._spacing;
+    },
+
+    setSpacing: function (spacing) {
+        this._spacing = spacing | 0;
+
+        var children = this.children;
+        var nodes = this.__html.outerbox.childNodes;
+        var last = 0;
+        var lastOrder;
+        var currentOrder;
+        for (var i = 0 ; i < nodes.length ; i++) {
+            lastOrder = 0;
+            currentOrder = 0;
+            if (children[last] && children[last].layoutOptions && children[last].layoutOptions.order) {
+                lastOrder = children[last].layoutOptions.order | 0;
+            }
+            if (children[i] && children[i].layoutOptions && children[i].layoutOptions.order) {
+                currentOrder = children[i].layoutOptions.order | 0;
+            }
+
+            if (currentOrder >= lastOrder) {
+                last = i;
+            }
+
+            if (this.orientation == "horizontal") {
+                nodes[i].style.marginRight = this._spacing + "px";
+                nodes[i].style.marginBottom = "";
+            } else {
+                nodes[i].style.marginRight = "";
+                nodes[i].style.marginBottom = this._spacing + "px";
+            }
+        }
+
+        if (nodes.length > 0) {
+            nodes[last].style.marginRight = "";
+            nodes[last].style.marginBottom = "";
+        }
+    },
+
+    /**
+     * Whether to stretch the box to its parent height or not.
+     *
+     * @property stretchToParentHeight
+     * @type Boolean
+     * @default true
+     */
+    _stretchToParentHeight: true,
+
+    getStretchToParentHeight: function () {
+        "@photonui-update";
+        return this._stretchToParentHeight;
+    },
+
+    setStretchToParentHeight: function (stretch) {
+        this._stretchToParentHeight = stretch;
+
+        if (this._stretchToParentHeight) {
+            this.__html.outerbox.style.height = "100%";
+        } else {
+            this.__html.outerbox.style.height = "";
+        }
+    },
+
+    /**
+     * Html outer element of the widget (if any).
+     *
+     * @property html
+     * @type HTMLElement
+     * @default null
+     * @readOnly
+     */
+    getHtml: function () {
+        return this.__html.outerbox;
+    },
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Private methods ======
+
+    /**
+     * Build the widget HTML.
+     *
+     * @method _buildHtml
+     * @private
+     */
+    _buildHtml: function () {
+        this.__html.outerbox = document.createElement("div");
+        this.__html.outerbox.className = "photonui-widget photonui-boxlayout";
+    },
+
+    /**
+     * Update the layout.
+     *
+     * @method _updateLayout
+     * @private
+     */
+    _updateLayout: function () {
+        Helpers.cleanNode(this.__html.outerbox);
+
+        var fragment = document.createDocumentFragment();
+        var children = this.children;
+
+        var container = null;
+        for (var i = 0 ; i < children.length ; i++) {
+            var options = this._computeLayoutOptions(children[i]);
+
+            container = document.createElement("div");
+            container.className = "photonui-container photonui-boxlayout-item";
+
+            // layout option: align
+            container.className += " photonui-layout-align-" + options.align;
+
+            // layout options: order
+            if (options.order !== null) {
+                container.style.order = options.order;
+            }
+
+            // layout options: *width
+            if (options.minWidth !== null) {
+                container.style.minWidth = options.minWidth + "px";
+            }
+            if (options.maxWidth !== null) {
+                container.style.maxWidth = options.maxWidth + "px";
+            }
+            if (options.width !== null) {
+                container.style.width = options.width + "px";
+            }
+
+            // layout options: *height
+            if (options.minHeight !== null) {
+                container.style.minHeight = options.minHeight + "px";
+            }
+            if (options.maxHeight !== null) {
+                container.style.maxHeight = options.maxHeight + "px";
+            }
+            if (options.height !== null) {
+                container.style.height = options.height + "px";
+            }
+
+            container.appendChild(children[i].html);
+            fragment.appendChild(container);
+        }
+
+        this.__html.outerbox.appendChild(fragment);
+        this.spacing = this.spacing;
+    },
+
+    /**
+     * Returns a normalized layoutOption for a given widget.
+     *
+     * @method _computeLayoutOptions
+     * @private
+     * @param {photonui.Widget} widget
+     * @return {Object} the layout options
+     */
+    _computeLayoutOptions: function (widget) {
+        var woptions = widget.layoutOptions || {};
+
+        var options = {
+            align: "stretch",
+            minWidth: null,
+            maxWidth: null,
+            width: null,
+            minHeight: null,
+            maxHeight: null,
+            height: null,
+            order: null
+        };
+
+        // align
+        if (["stretch", "expand"].indexOf(woptions.align) > -1) {
+            options.align = "stretch";
+        } else if (["center", "middle"].indexOf(woptions.align) > -1) {
+            options.align = "center";
+        } else if (["start", "begin", "top", "left"].indexOf(woptions.align) > -1) {
+            options.align = "start";
+        } else if (["end", "bottom", "right"].indexOf(woptions.align) > -1) {
+            options.align = "end";
+        }
+
+        // order
+        if (woptions.order !== undefined && woptions.order !== null) {
+            options.order = woptions.order | 0;
+        }
+
+        // *width
+        if (woptions.minWidth !== undefined && woptions.minWidth !== null) {
+            options.minWidth = woptions.minWidth | 0;
+        }
+        if (woptions.maxWidth !== undefined && woptions.maxWidth !== null) {
+            options.maxWidth = woptions.maxWidth | 0;
+        }
+        if (woptions.width !== undefined && woptions.width !== null) {
+            options.width = woptions.width | 0;
+            options.minWidth = woptions.width | 0;
+            options.maxWidth = woptions.width | 0;
+        }
+
+        // *height
+        if (woptions.minHeight !== undefined && woptions.minHeight !== null) {
+            options.minHeight = woptions.minHeight | 0;
+        }
+        if (woptions.maxHeight !== undefined && woptions.maxHeight !== null) {
+            options.maxHeight = woptions.maxHeight | 0;
+        }
+        if (woptions.height !== undefined && woptions.height !== null) {
+            options.height = woptions.height | 0;
+            options.minHeight = woptions.height | 0;
+            options.maxHeight = woptions.height | 0;
+        }
+
+        return options;
+    }
+});
+
+module.exports = BoxLayout;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_layout_fluidlayout.js.html b/ref/files/src_layout_fluidlayout.js.html new file mode 100644 index 00000000..bde826a0 --- /dev/null +++ b/ref/files/src_layout_fluidlayout.js.html @@ -0,0 +1,547 @@ + + + + + src/layout/fluidlayout.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/layout/fluidlayout.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule Layout
+ * @namespace photonui
+ */
+
+var Helpers = require("../helpers.js");
+var Layout = require("./layout.js");
+
+/**
+ * Fluid Layout.
+ *
+ * Layout Options:
+ *
+ *     {
+ *         align: <String (stretch|expand, start|left|top, center|middle, end|right|bottom), default=center>,
+ *
+ *         order: <Number default=null (auto)>
+ *
+ *         minWidth: <Number (null=auto), default=null>,
+ *         maxWidth: <Number (null=auto), default=null>,
+ *         width: <Number (null=auto), default=null>,
+ *
+ *         minHeight: <Number (null=auto), default=null>,
+ *         maxHeight: <Number (null=auto), default=null>,
+ *         height: <Number (null=auto), default=null>
+ *     }
+ *
+ * @class FluidLayout
+ * @constructor
+ * @extends photonui.Layout
+ */
+var FluidLayout = Layout.$extend({
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    /**
+     * The vertical spacing between children widgets.
+     *
+     * @property verticalSpacing
+     * @type Number
+     * @default 0
+     */
+    _verticalSpacing: 0,
+
+    getVerticalSpacing: function () {
+        return this._verticalSpacing;
+    },
+
+    setVerticalSpacing: function (verticalSpacing) {
+        this._verticalSpacing = verticalSpacing;
+        this._updateLayout();
+    },
+
+    /**
+     * The horizontal spacing between children widgets.
+     *
+     * @property horizontalSpacing
+     * @type Number
+     * @default 0
+     */
+    _horizontalSpacing: 0,
+
+    getHorizontalSpacing: function () {
+        return this._horizontalSpacing;
+    },
+
+    setHorizontalSpacing: function (horizontalSpacing) {
+        this._horizontalSpacing = horizontalSpacing;
+        this._updateLayout();
+    },
+
+    /**
+     * Vertical padding (px).
+     *
+     * @property verticalPadding
+     * @type Number
+     * @default 0
+     */
+    _verticalPadding: 0,
+
+    getVerticalPadding: function () {
+        return this._verticalPadding;
+    },
+
+    setVerticalPadding: function (padding) {
+        this._verticalPadding = padding | 0;
+        this.__html.innerbox.style.paddingLeft = this._verticalPadding + "px";
+        this.__html.innerbox.style.paddingRight = this._verticalPadding + "px";
+    },
+
+    /**
+     * Horizontal padding (px).
+     *
+     * @property horizontalPadding
+     * @type Number
+     * @default 0
+     */
+    _horizontalPadding: 0,
+
+    getHorizontalPadding: function () {
+        return this._horizontalPadding;
+    },
+
+    setHorizontalPadding: function (padding) {
+        this._horizontalPadding = padding | 0;
+        this.__html.innerbox.style.paddingTop = this._horizontalPadding + "px";
+        this.__html.innerbox.style.paddingBottom = this._horizontalPadding + "px";
+    },
+
+    /**
+     * Vertical alignment of children widgets.
+     *
+     * Values:
+     *
+     *     * start|top|begin (default)
+     *     * center|middle
+     *     * end|bottom
+     *
+     * @property verticalAlign
+     * @type String
+     * @default "start"
+     */
+    _verticalAlign: "start",
+
+    getVerticalAlign: function () {
+        return this._verticalAlign;
+    },
+
+    setVerticalAlign: function (align) {
+        if (["start", "top", "begin"].indexOf(align) > -1) {
+            this._verticalAlign = "start";
+            this.__html.innerbox.style.alignContent = "flex-start";
+        } else if (["center", "middle"].indexOf(align) > -1) {
+            this._verticalAlign = "center";
+            this.__html.innerbox.style.alignContent = "center";
+        } else if (["end", "bottom"].indexOf(align) > -1) {
+            this._verticalAlign = "end";
+            this.__html.innerbox.style.alignContent = "flex-end";
+        }
+    },
+
+    /**
+     * Horizontal alignment of children widgets.
+     *
+     * Values:
+     *
+     *     * start|left|begin (default)
+     *     * center|middle
+     *     * end|right
+     *
+     * @property horizontalAlign
+     * @type String
+     * @default "start"
+     */
+    _horizontalAlign: "start",
+
+    getHorizontalAlign: function () {
+        return this._horizontalAlign;
+    },
+
+    setHorizontalAlign: function (align) {
+        if (["start", "left", "begin"].indexOf(align) > -1) {
+            this._horizontalAlign = "start";
+            this.__html.innerbox.style.justifyContent = "flex-start";
+        } else if (["center", "middle"].indexOf(align) > -1) {
+            this._horizontalAlign = "center";
+            this.__html.innerbox.style.justifyContent = "center";
+        } else if (["end", "right"].indexOf(align) > -1) {
+            this._horizontalAlign = "end";
+            this.__html.innerbox.style.justifyContent = "flex-end";
+        }
+    },
+
+    /**
+     * Html outer element of the widget (if any).
+     *
+     * @property html
+     * @type HTMLElement
+     * @default null
+     * @readOnly
+     */
+    getHtml: function () {
+        return this.__html.outerbox;
+    },
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Private methods ======
+
+    /**
+     * Build the widget HTML.
+     *
+     * @method _buildHtml
+     * @private
+     */
+    _buildHtml: function () {
+        this.__html.outerbox = document.createElement("div");
+        this.__html.outerbox.className = "photonui-widget photonui-fluidlayout";
+        this.__html.innerbox = document.createElement("div");
+        this.__html.innerbox.className = "photonui-fluidlayout-innerbox";
+        this.__html.outerbox.appendChild(this.__html.innerbox);
+    },
+
+    /**
+     * Update the layout.
+     *
+     * @method _updateLayout
+     * @private
+     */
+    _updateLayout: function () {
+        var children = this.children;
+        var fragment = document.createDocumentFragment();
+
+        this.__html.innerbox.style.marginTop = (this.verticalSpacing > 0) ? -this.verticalSpacing + "px" : "0px";
+        this.__html.innerbox.style.marginLeft = (this.horizontalSpacing > 0) ? -this.horizontalSpacing + "px" : "0px";
+
+        // Store in a var the calcWidth too auto cast in string
+        var calcWidth = (this.horizontalSpacing > 0) ? this.horizontalSpacing + "px" : "0px";
+        this.__html.innerbox.style.width = "calc(100% + " + calcWidth + ")";
+
+        var div = null;
+        for (var i = 0 ; i < children.length ; i++) {
+            var options = this._computeLayoutOptions(children[i]);
+
+            div = document.createElement("div");
+            div.className = "photonui-container";
+
+            // spacings
+            div.style.marginTop = this.verticalSpacing + "px";
+            div.style.marginLeft = this.horizontalSpacing + "px";
+
+            // layout option: align
+            div.className += " photonui-layout-align-" + options.align;
+
+            // layout options: *width
+            if (options.minWidth !== null) {
+                div.style.minWidth = options.minWidth + "px";
+            }
+            if (options.maxWidth !== null) {
+                div.style.maxWidth = options.maxWidth + "px";
+            }
+            if (options.width !== null) {
+                div.style.width = options.width + "px";
+            }
+
+            // layout options: *height
+            if (options.minHeight !== null) {
+                div.style.minHeight = options.minHeight + "px";
+            }
+            if (options.maxHeight !== null) {
+                div.style.maxHeight = options.maxHeight + "px";
+            }
+            if (options.height !== null) {
+                div.style.height = options.height + "px";
+            }
+
+            // layout options: order
+            if (options.order !== null) {
+                div.style.order = options.order;
+            }
+
+            div.appendChild(children[i].html);
+            fragment.appendChild(div);
+        }
+
+        Helpers.cleanNode(this.__html.innerbox);
+        this.__html.innerbox.appendChild(fragment);
+    },
+
+    /**
+     * Returns a normalized layoutOption for a given widget.
+     *
+     * @method _computeLayoutOptions
+     * @private
+     * @param {photonui.Widget} widget
+     * @return {Object} the layout options
+     */
+    _computeLayoutOptions: function (widget) {
+        var woptions = widget.layoutOptions || {};
+
+        var options = {
+            order: null,
+            align: "center",   // start|begin|top, center|middle, end|bottom, stretch|expand
+            minWidth: null,
+            maxWidth: null,
+            width: null,
+            minHeight: null,
+            maxHeight: null,
+            height: null
+        };
+
+        // order
+        if (woptions.order !== undefined) {
+            options.order = woptions.order | 0;
+        }
+
+        // align
+        if (woptions.align) {
+            if (["stretch", "expand"].indexOf(woptions.align) > -1) {
+                options.align = "stretch";
+            } else if (["center", "middle"].indexOf(woptions.align) > -1) {
+                options.align = "center";
+            } else if (["start", "begin", "top"].indexOf(woptions.align) > -1) {
+                options.align = "start";
+            } else if (["end", "bottom"].indexOf(woptions.align) > -1) {
+                options.align = "end";
+            }
+        }
+
+        // *width
+        if (woptions.minWidth !== undefined && woptions.minWidth !== null) {
+            options.minWidth = woptions.minWidth | 0;
+        }
+        if (woptions.maxWidth !== undefined && woptions.maxWidth !== null) {
+            options.maxWidth = woptions.maxWidth | 0;
+        }
+        if (woptions.width !== undefined && woptions.width !== null) {
+            options.width = woptions.width | 0;
+            options.minWidth = woptions.width | 0;
+            options.maxWidth = woptions.width | 0;
+        }
+
+        // *height
+        if (woptions.minHeight !== undefined && woptions.minHeight !== null) {
+            options.minHeight = woptions.minHeight | 0;
+        }
+        if (woptions.maxHeight !== undefined && woptions.maxHeight !== null) {
+            options.maxHeight = woptions.maxHeight | 0;
+        }
+        if (woptions.height !== undefined && woptions.height !== null) {
+            options.height = woptions.height | 0;
+            options.minHeight = woptions.height | 0;
+            options.maxHeight = woptions.height | 0;
+        }
+
+        return options;
+    }
+
+});
+
+module.exports = FluidLayout;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_layout_gridlayout.js.html b/ref/files/src_layout_gridlayout.js.html new file mode 100644 index 00000000..ce68a1b7 --- /dev/null +++ b/ref/files/src_layout_gridlayout.js.html @@ -0,0 +1,802 @@ + + + + + src/layout/gridlayout.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/layout/gridlayout.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule Layout
+ * @namespace photonui
+ */
+
+var Helpers = require("../helpers.js");
+var Layout = require("./layout.js");
+
+var _sizingHackEnabled = null;
+
+/**
+ * Grid layout.
+ *
+ * Layout Options:
+ *
+ *     {
+ *          x: <Number, default: 0>,
+ *          y: <Number, default: 0>,
+ *          cols: <Number, default: 1>,
+ *          rows: <Number, default: 1>,
+ *
+ *          horizontalAlign: <String (stretch|expand, start|left, center, end|right), default: stretch>,
+ *          verticalAlign: <String (stretch|expand, start|top, center|middle, end|bottom), default: stretch>,
+ *
+ *          minWidth: <Number, default: null>,
+ *          maxWidth: <Number, default: null>,
+ *          width: <Number, default: null>,
+ *
+ *          minHeight: <Number, default: null>,
+ *          maxHeight: <Number, default: null>,
+ *          height: <Number, default: null>,
+ *     }
+ *
+ * @class GridLayout
+ * @constructor
+ * @extends photonui.Layout
+ */
+var GridLayout = Layout.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        this.$super(params);
+
+        // XXX Sizing Hack
+        if (window.MutationObserver) {
+            this.__sizinghack_observer = new MutationObserver(this._sizingHack.bind(this));
+            this.__sizinghack_observer_params = {attributes: true, childList: true, characterData: true, subtree: true};
+            this.__sizinghack_observer.observe(this.__html.gridBody, this.__sizinghack_observer_params);
+            this._updateLayout();
+        }
+    },
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    /**
+     * Vertical padding (px).
+     *
+     * @property verticalPadding
+     * @type Number
+     * @default 0
+     */
+    _verticalPadding: 0,
+
+    getVerticalPadding: function () {
+        return this._verticalPadding;
+    },
+
+    setVerticalPadding: function (padding) {
+        this._verticalPadding = padding | 0;
+        this._updatingLayout = true;
+        this.__html.outerbox.style.paddingLeft = this._verticalPadding + "px";
+        this.__html.outerbox.style.paddingRight = this._verticalPadding + "px";
+        this._updatingLayout = false;
+        this._sizingHack();
+    },
+
+    /**
+     * Horizontal padding (px).
+     *
+     * @property horizontalPadding
+     * @type Number
+     * @default 0
+     */
+    _horizontalPadding: 0,
+
+    getHorizontalPadding: function () {
+        return this._horizontalPadding;
+    },
+
+    setHorizontalPadding: function (padding) {
+        this._horizontalPadding = padding | 0;
+        this._updatingLayout = true;
+        this.__html.outerbox.style.paddingTop = this._horizontalPadding + "px";
+        this.__html.outerbox.style.paddingBottom = this._horizontalPadding + "px";
+        this._updatingLayout = false;
+        this._sizingHack();
+    },
+
+    /**
+     * The vertical spacing between children widgets.
+     *
+     * @property verticalSpacing
+     * @type Number
+     * @default 5
+     */
+    _verticalSpacing: 5,
+
+    getVerticalSpacing: function () {
+        "@photonui-update";
+        return this._verticalSpacing;
+    },
+
+    setVerticalSpacing: function (verticalSpacing) {
+        this._verticalSpacing = verticalSpacing;
+        this._updateLayout();
+    },
+
+    /**
+     * The horizontal spacing between children widgets.
+     *
+     * @property horizontalSpacing
+     * @type Number
+     * @default 5
+     */
+    _horizontalSpacing: 5,
+
+    getHorizontalSpacing: function () {
+        return this._horizontalSpacing;
+    },
+
+    setHorizontalSpacing: function (horizontalSpacing) {
+        this._horizontalSpacing = horizontalSpacing;
+        this._updateLayout();
+    },
+
+    /**
+     * Html outer element of the widget (if any).
+     *
+     * @property html
+     * @type HTMLElement
+     * @default null
+     * @readOnly
+     */
+    getHtml: function () {
+        return this.__html.outerbox;
+    },
+
+    // ====== Public properties ======
+
+    /**
+     * Flag to indicate that the layout is actually been updated.
+     *
+     * @property _updatingLayout
+     * @private
+     * @type Boolean
+     * @default false
+     */
+    _updatingLayout: false,
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Private methods ======
+
+    /**
+     * Called when the visibility changes.
+     *
+     * @method _visibilityChanged
+     * @private
+     * @param {Boolean} visibility Current visibility state (otptional, defaut=this.visible)
+     */
+    _visibilityChanged: function (visibility) {
+        visibility = (visibility !== undefined) ? visibility : this.visible;
+        if (visibility) {
+            this._sizingHack();
+        }
+        this.$super(visibility);
+    },
+
+    /**
+     * Build the widget HTML.
+     *
+     * @method _buildHtml
+     * @private
+     */
+    _buildHtml: function () {
+        this.__html.outerbox = document.createElement("div");
+        this.__html.outerbox.className = "photonui-widget photonui-gridlayout";
+
+        this.__html.grid = document.createElement("table");
+        this.__html.outerbox.appendChild(this.__html.grid);
+
+        this.__html.gridBody = document.createElement("tbody");
+        this.__html.grid.appendChild(this.__html.gridBody);
+    },
+
+    /**
+     * Update the layout.
+     *
+     * @method _updateLayout
+     * @private
+     */
+    _updateLayout: function () {
+        this._updatingLayout = true;
+        if (this.__sizinghack_observer) {  // XXX
+            this.__sizinghack_observer.disconnect();
+        }
+
+        var children = this.children;
+
+        // Determine the grid geometry (min x, min y, max x, max y)
+        var minX = Infinity;
+        var minY = Infinity;
+        var maxX = -Infinity;
+        var maxY = -Infinity;
+
+        var options;
+        for (var i = 0 ; i < children.length ; i++) {
+            options = this._computeLayoutOptions(children[i]);
+            minX = Math.min(options.x, minX);
+            minY = Math.min(options.y, minY);
+            maxX = Math.max(options.x, maxX);
+            maxY = Math.max(options.y, maxY);
+            maxX = Math.max(options.x + options.cols - 1, maxX);
+            maxY = Math.max(options.y + options.rows - 1, maxY);
+        }
+
+        var gridWidth = maxX - minX + 1;
+        var gridHeight = maxY - minY + 1;
+
+        // Clean
+        this.__html.grid.removeChild(this.__html.gridBody);
+        Helpers.cleanNode(this.__html.gridBody);
+
+        // Build the layout
+        var that = this;
+        function _findWidgetAt(x, y) {
+            var options;
+            for (var i = 0 ; i < children.length ; i++) {
+                options = that._computeLayoutOptions(children[i]);
+                if (options.x == x && options.y == y) {
+                    return {w: children[i], o: options};
+                }
+            }
+            return null;
+        }
+
+        var map = [];
+        for (var y = 0 ; y < gridHeight ; y++) {
+            map[y] = [];
+            map[y].length = gridWidth;
+        }
+
+        var child;
+        var tr;
+        var td;
+        var div;
+        var cellX;
+        var cellY;
+        for (y = 0 ; y < gridHeight ; y++) {
+            tr = document.createElement("tr");
+            for (var x = 0 ; x < gridWidth ; x++) {
+                if (map[y][x]) {
+                    continue;
+                }
+
+                td = document.createElement("td");
+                td.className = "photonui-gridlayout-cell";
+                div = document.createElement("div");
+                div.className = "photonui-container photonui-gridlayout-wrapper";
+                td.appendChild(div);
+                tr.appendChild(td);
+
+                child = _findWidgetAt(x + minX, y + minY);
+                if (child) {
+                    div.appendChild(child.w.html);
+
+                    // Spacing exceptions
+                    var horizontalSpacing = this.horizontalSpacing;
+                    var verticalSpacing = this.verticalSpacing;
+                    if (x + child.o.cols >= gridWidth) {
+                        td.className += " photonui-gridlayout-lastcol";
+                        verticalSpacing = 0;
+                    }
+                    if (y + child.o.rows >= gridHeight) {
+                        td.className += " photonui-gridlayout-lastrow";
+                        horizontalSpacing = 0;
+                    }
+
+                    // layout options: vertical/horizontal Align
+                    td.className += " photonui-layout-verticalalign-" + child.o.verticalAlign;
+                    td.className += " photonui-layout-horizontalalign-" + child.o.horizontalAlign;
+
+                    // layout options: *width
+                    if (child.o.minWidth !== null) {
+                        div.style.minWidth = child.o.minWidth + "px";
+                        td.style.minWidth = (child.o.minWidth + verticalSpacing) + "px";
+                    }
+                    if (child.o.maxWidth !== null) {
+                        div.style.maxWidth = child.o.maxWidth + "px";
+                        td.style.maxWidth = (child.o.maxWidth + verticalSpacing) + "px";
+                    }
+                    if (child.o.width !== null) {
+                        div.style.width = child.o.width + "px";
+                        td.style.width = (child.o.width + verticalSpacing) + "px";
+                    }
+
+                    // layout options: *height
+                    if (child.o.minHeight !== null) {
+                        div.style.minHeight = child.o.minHeight + "px";
+                        td.style.minHeight = (child.o.minHeight + horizontalSpacing) + "px";
+                    }
+                    if (child.o.maxHeight !== null) {
+                        div.style.maxHeight = child.o.maxHeight + "px";
+                        td.style.maxHeight = (child.o.maxHeight + horizontalSpacing) + "px";
+                    }
+                    if (child.o.height !== null) {
+                        div.style.height = child.o.height + "px";
+                        td.style.height = (child.o.height + horizontalSpacing) + "px";
+                    }
+
+                    // rowspan / colspan
+                    if (child.o.cols > 1 || child.o.rows > 1) {
+                        td.colSpan = child.o.cols;
+                        td.rowSpan = child.o.rows;
+
+                        for (cellY = y ; cellY < y + child.o.rows ; cellY++) {
+                            for (cellX = x ; cellX < x + child.o.cols ; cellX++) {
+                                map[cellY][cellX] = true;
+                            }
+                        }
+                    }
+
+                }
+            }
+            this.__html.gridBody.appendChild(tr);
+        }
+
+        // Attach nodes to the DOM
+        this.__html.grid.appendChild(this.__html.gridBody);
+
+        //
+        this._updateSpacing();
+        this._updatingLayout = false;
+        if (this.__sizinghack_observer) {  // XXX
+            this.__sizinghack_observer.observe(this.__html.gridBody, this.__sizinghack_observer_params);
+        }
+        this._sizingHack();
+    },
+
+    /**
+     * Returns a normalized layoutOption for a given widget.
+     *
+     * @method _computeLayoutOptions
+     * @private
+     * @param {photonui.Widget} widget
+     * @return {Object} the layout options
+     */
+    _computeLayoutOptions: function (widget) {
+        var woptions = widget.layoutOptions || {};
+
+        var options = {
+            x: 0,
+            y: 0,
+            cols: 1,
+            rows: 1,
+            verticalAlign: "stretch",
+            horizontalAlign: "stretch",
+            minWidth: null,
+            maxWidth: null,
+            width: null,
+            minHeight: null,
+            maxHeight: null,
+            height: null
+        };
+
+        if (widget.html) {
+            if (widget.html.classList.contains("photonui-widget-fixed-height")) {
+                options.verticalAlign = "center";
+            }
+            if (widget.html.classList.contains("photonui-widget-fixed-width")) {
+                options.horizontalAlign = "center";
+            }
+        }
+
+        // [Compatibility with old GridLayout] position / place
+        if (woptions.gridX !== undefined && woptions.gridX !== null) {
+            options.x = woptions.gridX | 0;
+        }
+        if (woptions.gridY !== undefined && woptions.gridY !== null) {
+            options.y = woptions.gridY | 0;
+        }
+        if (woptions.gridWidth !== undefined && woptions.gridWidth !== null) {
+            options.cols = woptions.gridWidth | 0;
+        }
+        if (woptions.gridHeight !== undefined && woptions.gridHeight !== null) {
+            options.rows = woptions.gridHeight | 0;
+        }
+
+        // position / place
+        if (woptions.x !== undefined && woptions.x !== null) {
+            options.x = woptions.x | 0;
+        }
+        if (woptions.y !== undefined && woptions.y !== null) {
+            options.y = woptions.y | 0;
+        }
+        if (woptions.cols !== undefined && woptions.cols !== null) {
+            options.cols = woptions.cols | 0;
+        }
+        if (woptions.rows !== undefined && woptions.rows !== null) {
+            options.rows = woptions.rows | 0;
+        }
+
+        // verticalAlign
+        if (["stretch", "expand"].indexOf(woptions.verticalAlign) > -1) {
+            options.verticalAlign = "stretch";
+        } else if (["center", "middle"].indexOf(woptions.verticalAlign) > -1) {
+            options.verticalAlign = "center";
+        } else if (["start", "begin", "top"].indexOf(woptions.verticalAlign) > -1) {
+            options.verticalAlign = "start";
+        } else if (["end", "bottom"].indexOf(woptions.verticalAlign) > -1) {
+            options.verticalAlign = "end";
+        }
+
+        // horizontalAlign
+        if (["stretch", "expand"].indexOf(woptions.horizontalAlign) > -1) {
+            options.horizontalAlign = "stretch";
+        } else if (["center", "middle"].indexOf(woptions.horizontalAlign) > -1) {
+            options.horizontalAlign = "center";
+        } else if (["start", "begin", "left"].indexOf(woptions.horizontalAlign) > -1) {
+            options.horizontalAlign = "start";
+        } else if (["end", "right"].indexOf(woptions.horizontalAlign) > -1) {
+            options.horizontalAlign = "end";
+        }
+
+        // [Compatibility with old GridLayout] horizontalAlign / verticalAlign
+        if (woptions.verticalExpansion === true) {
+            options.verticalAlign = "stretch";
+        } else if (woptions.verticalExpansion === false) {
+            if (woptions.verticalAlign === undefined) {
+                options.verticalAlign = "center";
+            }
+        }
+        if (woptions.horizontalExpansion === true) {
+            options.horizontalAlign = "stretch";
+        } else if (woptions.horizontalExpansion === false) {
+            if (woptions.horizontalAlign === undefined) {
+                options.horizontalAlign = "center";
+            }
+        }
+
+        // *width
+        if (woptions.minWidth !== undefined && woptions.minWidth !== null) {
+            options.minWidth = woptions.minWidth | 0;
+        }
+        if (woptions.maxWidth !== undefined && woptions.maxWidth !== null) {
+            options.maxWidth = woptions.maxWidth | 0;
+        }
+        if (woptions.width !== undefined && woptions.width !== null) {
+            options.width = woptions.width | 0;
+            options.minWidth = woptions.width | 0;
+            options.maxWidth = woptions.width | 0;
+        }
+
+        // *height
+        if (woptions.minHeight !== undefined && woptions.minHeight !== null) {
+            options.minHeight = woptions.minHeight | 0;
+        }
+        if (woptions.maxHeight !== undefined && woptions.maxHeight !== null) {
+            options.maxHeight = woptions.maxHeight | 0;
+        }
+        if (woptions.height !== undefined && woptions.height !== null) {
+            options.height = woptions.height | 0;
+            options.minHeight = woptions.height | 0;
+            options.maxHeight = woptions.height | 0;
+        }
+
+        return options;
+    },
+
+    /**
+     * Update the spacing between widgets
+     *
+     * @method _updateSpacing
+     * @private
+     */
+    _updateSpacing: function () {
+        var nodes = this.__html.outerbox.querySelectorAll("#" + this.name + " > table > tbody > tr > td");
+        for (var i = 0 ; i < nodes.length ; i++) {
+            nodes[i].style.paddingRight = this._verticalSpacing + "px";
+            nodes[i].style.paddingBottom = this._horizontalSpacing + "px";
+        }
+    },
+
+    /**
+     * Hack to get thing working with Gecko and Trident.
+     *
+     * MSIE 11:
+     *
+     *   * The hack fixes all the issues,
+     *
+     * MSIE 10:
+     *
+     *   * There is issues with rowspan
+     *   * The dynamic resizing does not works
+     *
+     * Firefox:
+     *
+     *   * There is some minor issues with rowspan
+     *
+     * @method _sizingHack
+     * @private
+     */
+    _sizingHack: function () {
+        if (this._updatingLayout) {
+            return;
+        }
+
+        // Automatically disable the hack for webkit browsers
+        if (_sizingHackEnabled === false) {
+            return;
+        } else if (_sizingHackEnabled === null) {
+            var isWebkit = false;
+            if ("WebkitAppearance" in document.documentElement.style) {
+                isWebkit = true;
+            }
+            if ("WebKitCSSMatrix" in window) {
+                isWebkit = true;
+            }
+            if (isWebkit) {
+                _sizingHackEnabled = false;
+                return;
+            } else {
+                _sizingHackEnabled = true;
+            }
+        }
+
+        this._updatingLayout = true;
+        if (this.__sizinghack_observer) {
+            this.__sizinghack_observer.disconnect();
+        }
+
+        function _hack() {
+            function _size(node) {
+                var tdHeight;
+                if (node.style.minHeight && node.style.minHeight == node.style.maxHeight) {
+                    tdHeight = parseFloat(node.style.minHeight);
+                } else if (node.classList.contains("photonui-gridlayout-lastrow")) {
+                    tdHeight = node.offsetHeight;
+                } else {
+                    tdHeight = node.offsetHeight;
+                }
+                node.style.height = tdHeight + "px";
+            }
+
+            var nodes = this.__html.outerbox.querySelectorAll("#" + this.name + " > table > tbody > tr > td");
+
+            // 1st pass -> height: auto
+            for (var i = 0 ; i < nodes.length ; i++) {
+                //nodes[i].children[0].style.height = "auto";
+                nodes[i].style.height = "auto";
+            }
+
+            // 2nd pass -> fixed height for all td where rowspan = 1
+            for (i = 0 ; i < nodes.length ; i++) {
+                if (nodes[i].rowSpan && nodes[i].rowSpan > 1) {
+                    continue;
+                }
+                _size(nodes[i]);
+            }
+
+            // 3rd pass -> fixed height for all td where rowspan > 1
+            for (i = 0 ; i < nodes.length ; i++) {
+                if ((!nodes[i].rowSpan) || nodes[i].rowSpan <= 1) {
+                    continue;
+                }
+                _size(nodes[i]);
+            }
+
+            // 4th pass -> HACK to force reflow on Gecko... T_T
+            for (i = 0 ; i < nodes.length ; i++) {
+                nodes[i].style.borderBottom = "transparent solid 1px";
+                var foo = nodes[i].offsetHeight;
+                nodes[i].style.borderBottom = "transparent solid 0px";
+            }
+
+            this._updatingLayout = false;
+            if (this.__sizinghack_observer) {
+                this.__sizinghack_observer.observe(this.__html.gridBody, this.__sizinghack_observer_params);
+            }
+        }
+
+        setTimeout(_hack.bind(this), 1);
+    }
+});
+
+module.exports = GridLayout;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_layout_layout.js.html b/ref/files/src_layout_layout.js.html new file mode 100644 index 00000000..cb923f53 --- /dev/null +++ b/ref/files/src_layout_layout.js.html @@ -0,0 +1,451 @@ + + + + + src/layout/layout.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/layout/layout.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule Layout
+ * @namespace photonui
+ */
+
+var Widget = require("../widget.js");
+var Container = require("../container/container.js");
+
+/**
+ * Base class for layout.
+ *
+ * @class Layout
+ * @constructor
+ * @extends photonui.Container
+ */
+var Layout = Container.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        this._childrenNames = [];  // new instance
+        this.$super(params);
+
+        // Force to update the parent of the children
+        var children = this.children;
+        for (var i = 0 ; i < children.length ; i++) {
+            children[i]._parentName = this.name;
+        }
+    },
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    /**
+     * Layout children widgets name.
+     *
+     * @property childrenNames
+     * @type Array
+     * @default []
+     */
+    _childrenNames: [],
+
+    getChildrenNames: function () {
+        return this._childrenNames;
+    },
+
+    setChildrenNames: function (childrenNames) {
+        var i;
+        var widget;
+        for (i = 0 ; i < this._childrenNames.length ; i++) {
+            widget = Widget.getWidget(this._childrenNames[i]);
+            var index = this._childrenNames.indexOf(widget.name);
+            if (index >= 0) {
+                widget._parentName = null;
+            }
+        }
+        this._childrenNames = [];
+        for (i = 0 ; i < childrenNames.length ; i++) {
+            widget = Widget.getWidget(childrenNames[i]);
+            if (widget) {
+                if (widget.parent) {
+                    widget.unparent();
+                }
+                this._childrenNames.push(widget.name);
+                widget._parentName = this.name;
+            }
+        }
+        this._updateLayout();
+    },
+
+    /**
+     * Layout children widgets.
+     *
+     * @property children
+     * @type Array
+     * @default []
+     */
+    getChildren: function () {
+        var children = [];
+        var widget;
+        for (var i = 0 ; i < this._childrenNames.length ; i++) {
+            widget = Widget.getWidget(this._childrenNames[i]);
+            if (widget instanceof Widget) {
+                children.push(widget);
+            }
+        }
+        return children;
+    },
+
+    setChildren: function (children) {
+        var childrenNames = [];
+        for (var i = 0 ; i < children.length ; i++) {
+            if (children[i] instanceof Widget) {
+                childrenNames.push(children[i].name);
+            }
+        }
+        this.childrenNames = childrenNames;
+    },
+
+    // Override getChildName / setChildName / getChild / setChild
+
+    getChildName: function () {
+        return null;
+    },
+
+    setChildName: function (childName) {
+        this.childrenNames = [childName];
+    },
+
+    getChild: function () {
+        return null;
+    },
+
+    setChild: function (child) {
+        this.children = [child];
+    },
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Public methods ======
+
+    /**
+     * Add a widget to the layout.
+     *
+     * @method addChild
+     * @param {photonui.Widget} widget The widget to add.
+     * @param {Object} layoutOption Specific option for the layout (optional).
+     */
+    addChild: function (widget, layoutOptions) {
+        if (widget.parent) {
+            widget.unparent();
+        }
+        if (layoutOptions) {
+            widget.layoutOptions = layoutOptions;
+        }
+        this._childrenNames.push(widget.name);
+        widget._parentName = this.name;
+        this._updateLayout();
+    },
+
+    /**
+     * Remove a widget from the layout.
+     *
+     * @method removeChild
+     * @param {photonui.Widget} widget The widget to remove.
+     */
+    removeChild: function (widget) {
+        var index = this._childrenNames.indexOf(widget.name);
+        if (index >= 0) {
+            this._childrenNames.splice(index, 1);
+            widget._parentName = null;
+        }
+        this._updateLayout();
+    },
+
+    /**
+     * Destroy all children of the layout
+     *
+     * @method empty
+     */
+    empty: function () {
+        this._lockUpdate(true);
+
+        var children = this.children;
+        for (var i = 0 ; i < children.length ; i++) {
+            if (children[i]) {
+                children[i].destroy();
+            }
+        }
+
+        this._lockUpdate(false);
+    },
+
+    /**
+     * Destroy the widget.
+     *
+     * @method destroy
+     */
+    destroy: function () {
+        this.empty();
+        this.$super();
+    },
+
+    // ====== Private methods ======
+
+    /**
+     * Lock the update of the layout.
+     *
+     * @method _lockUpdate
+     * @private
+     */
+    _lockUpdate: function (lock) {
+        if (lock) {
+            this.__lockedUpdateLayout = this._updateLayout;
+            this._updateLayout = function () {};
+        } else {
+            this._updateLayout = this.__lockedUpdateLayout;
+            delete this.__lockedUpdateLayout;
+            this._updateLayout();
+        }
+    },
+
+    /**
+     * Update the layout.
+     *
+     * @method _updateLayout
+     * @private
+     */
+    _updateLayout: function () {
+        throw new Error("you should define the _updateLayout() method when you extend a layout widget.");
+    },
+
+    /**
+     * Called when the visibility changes.
+     *
+     * @method _visibilityChanged
+     * @private
+     * @param {Boolean} visibility Current visibility state (otptional, defaut=this.visible)
+     */
+    _visibilityChanged: function (visibility) {
+        visibility = (visibility !== undefined) ? visibility : this.visible;
+        var children = this.children;
+        for (var i = 0 ; i < children.length ; i++) {
+            if (!(children[i] instanceof Widget)) {
+                continue;
+            }
+            children[i]._visibilityChanged(visibility);
+        }
+        this.$super(visibility);
+    },
+
+    //////////////////////////////////////////
+    // Internal Events Callbacks            //
+    //////////////////////////////////////////
+
+    /**
+     * Called when the locale is changed.
+     *
+     * @method __onLocaleChanged
+     * @private
+     */
+    __onLocaleChanged: function () {
+        // pass
+    }
+});
+
+module.exports = Layout;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_layout_menu.js.html b/ref/files/src_layout_menu.js.html new file mode 100644 index 00000000..fe18ffef --- /dev/null +++ b/ref/files/src_layout_menu.js.html @@ -0,0 +1,305 @@ + + + + + src/layout/menu.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/layout/menu.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule Layout
+ * @namespace photonui
+ */
+
+var Helpers = require("../helpers.js");
+var Layout = require("./layout.js");
+
+/**
+ * Menu.
+ *
+ * @class Menu
+ * @constructor
+ * @extends photonui.Layout
+ */
+var Menu = Layout.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        this.$super(params);
+    },
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    /**
+     * Define if icon on menu items are visible.
+     *
+     * @property iconVisible
+     * @type Boolean
+     * @default: true
+     */
+    _iconVisible: true,
+
+    isIconVisible: function () {
+        "@photonui-update";
+        return this._iconVisible;
+    },
+
+    setIconVisible: function (iconVisible) {
+        this._iconVisible = iconVisible;
+        if (iconVisible) {
+            this.__html.outer.classList.remove("photonui-menu-noicon");
+        } else {
+            this.__html.outer.classList.add("photonui-menu-noicon");
+        }
+    },
+
+    /**
+     * Html outer element of the widget (if any).
+     *
+     * @property html
+     * @type HTMLElement
+     * @default null
+     * @readOnly
+     */
+    getHtml: function () {
+        return this.__html.outer;
+    },
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Private methods ======
+
+    /**
+     * Build the widget HTML.
+     *
+     * @method _buildHtml
+     * @private
+     */
+    _buildHtml: function () {
+        this.__html.outer = document.createElement("div");
+        this.__html.outer.className = "photonui-widget photonui-menu photonui-menu-style-default";
+    },
+
+    /**
+     * Update the layout.
+     *
+     * @method _updateLayout
+     * @private
+     */
+    _updateLayout: function () {
+        // Detache the outer element from the document tree
+        //TODO
+
+        // Clean
+        Helpers.cleanNode(this.__html.outer);
+
+        // Append children
+        var children = this.children;
+        for (var i = 0 ; i < children.length ; i++) {
+            this.__html.outer.appendChild(children[i].html);
+        }
+
+        // Attache the outer element into the document tree
+        // TODO
+    }
+});
+
+module.exports = Menu;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_layout_tablayout.js.html b/ref/files/src_layout_tablayout.js.html new file mode 100644 index 00000000..2fca1a92 --- /dev/null +++ b/ref/files/src_layout_tablayout.js.html @@ -0,0 +1,465 @@ + + + + + src/layout/tablayout.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/layout/tablayout.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <https://github.com/flozz>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule Layout
+ * @namespace photonui
+ */
+
+var Helpers = require("../helpers.js");
+var Layout = require("./layout.js");
+var TabItem = require("../container/tabitem.js");
+var Widget = require("../widget.js");
+
+/**
+ * Tab Layout
+ *
+ * @class TabLayout
+ * @constructor
+ * @extends photonui.Layout
+ * @param {Object} params An object that can contain any property of the widget (optional).
+ */
+var TabLayout = Layout.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        this._registerWEvents([]);
+        this.$super(params);
+    },
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    /**
+     * Define the tabs position.
+     *
+     *   * top
+     *   * bottom
+     *   * left
+     *   * right
+     *
+     * @property tabsPosition
+     * @type String
+     * @default "top"
+     */
+    _tabsPosition: "top",
+
+    getTabsPosition: function () {
+        "@photonui-update";
+        return this._tabsPosition;
+    },
+
+    setTabsPosition: function (position) {
+        if (["top", "bottom", "left", "right"].indexOf(position) < 0) {
+            throw new Error("The tabs position should be \"top\", \"bottom\", \"left\" or \"right\".");
+        }
+        this._tabsPosition = position;
+        this.removeClass("photonui-tablayout-tabposition-top");
+        this.removeClass("photonui-tablayout-tabposition-bottom");
+        this.removeClass("photonui-tablayout-tabposition-left");
+        this.removeClass("photonui-tablayout-tabposition-right");
+        this.addClass("photonui-tablayout-tabposition-" + position);
+    },
+
+    /**
+     * Html outer element of the widget (if any).
+     *
+     * @property html
+     * @type HTMLElement
+     * @default null
+     * @readOnly
+     */
+    getHtml: function () {
+        return this.__html.outer;
+    },
+
+    /**
+     * Define the active tab name.
+     *
+     * @property activeTabName
+     * @type String
+     * @default null
+     */
+    _activeTabName: null,
+
+    getActiveTabName: function () {
+        return this._activeTabName;
+    },
+
+    setActiveTabName: function (tabName) {
+        var activeTab = Widget.getWidget(tabName);
+        if (activeTab instanceof TabItem) {
+            activeTab.show();
+            return;
+        }
+
+        if (!this._activeTab) {
+            var children = this.children;
+            for (var i = 0 ; i < children.length ; i++) {
+                if (!(children[i] instanceof TabItem)) {
+                    continue;
+                }
+                children[i].show();
+                break;
+            }
+        }
+    },
+
+    /**
+     * Container node padding.
+     *
+     * @property padding
+     * @type Number
+     * @default 10
+     */
+    _padding: 10,
+
+    getPadding: function () {
+        "@photonui-update";
+        return this._padding;
+    },
+
+    setPadding: function (padding) {
+        this._padding = padding;
+        this.__html.content.style.padding = padding + "px";
+    },
+
+    /**
+     * Define the active tab.
+     *
+     * @property activeTab
+     * @type photonui.Widget
+     * @default null
+     */
+    getActiveTab: function () {
+        return Widget.getWidget(this.activeTabName);
+    },
+
+    setActiveTab: function (tab) {
+        if (tab instanceof Widget) {
+            this.activeTabName = tab.name;
+        } else {
+            this.activeTabName = null;
+        }
+    },
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Public methods ======
+
+    setVisible: function (visible) {
+        this.$super(visible);
+        if (!this._activeTabName) {
+            this.activeTabName = null;
+        }
+    },
+
+    addChild: function (widget, layoutOptions) {
+        this.$super(widget, layoutOptions);
+        if (!this.activeTabName && widget instanceof TabItem) {
+            this.activeTabName = widget.name;
+        }
+    },
+
+    /**
+     * Remove a widget from the layout.
+     *
+     * @method removeChild
+     * @param {photonui.Widget} widget The widget to remove.
+     */
+    removeChild: function (widget) {
+        this.$super(widget);
+        if (widget === this.activeTab) {
+            this.activeTabName = null;
+        }
+    },
+
+    // ====== Private methods ======
+
+    /**
+     * Build the widget HTML.
+     *
+     * @method _buildHtml
+     * @private
+     */
+    _buildHtml: function () {
+        this.__html.outer = document.createElement("div");
+        this.__html.outer.className = "photonui-widget photonui-tablayout";
+
+        this.__html.inner = document.createElement("div");
+        this.__html.inner.className = "photonui-tablayout-innerbox";
+        this.__html.outer.appendChild(this.__html.inner);
+
+        this.__html.tabs = document.createElement("div");
+        this.__html.tabs.className = "photonui-tablayout-tabs";
+        this.__html.inner.appendChild(this.__html.tabs);
+
+        this.__html.content = document.createElement("div");
+        this.__html.content.className = "photonui-tablayout-content";
+        this.__html.inner.appendChild(this.__html.content);
+    },
+
+    /**
+     * Update the layout.
+     *
+     * @method _updateLayout
+     * @private
+     */
+    _updateLayout: function () {
+        Helpers.cleanNode(this.__html.tabs);
+        Helpers.cleanNode(this.__html.content);
+
+        var children = this.children;  // Cache for perf
+        var tabsFragment = document.createDocumentFragment();
+        var contentFragment = document.createDocumentFragment();
+
+        var options;
+        for (var i = 0 ; i < children.length ; i++) {
+            if (!(children[i] instanceof TabItem)) {
+                continue;
+            }
+
+            options = this._computeLayoutOptions(children[i]);
+
+            if (options.order !== null) {
+                children[i].tabHtml.style.order = options.order;
+            } else {
+                children[i].tabHtml.style.order = 0;
+            }
+
+            tabsFragment.appendChild(children[i].tabHtml);
+            contentFragment.appendChild(children[i].html);
+        }
+
+        this.__html.tabs.appendChild(tabsFragment);
+        this.__html.content.appendChild(contentFragment);
+    },
+
+    /**
+     * Returns a normalized layoutOption for a given widget.
+     *
+     * @method _computeLayoutOptions
+     * @private
+     * @param {photonui.Widget} widget
+     * @return {Object} the layout options
+     */
+    _computeLayoutOptions: function (widget) {
+        var woptions = widget.layoutOptions || {};
+
+        var options = {
+            order: null
+        };
+
+        if (woptions.order !== undefined && woptions.order !== null) {
+            options.order = woptions.order | 0;
+        }
+
+        return options;
+    }
+
+});
+
+module.exports = TabLayout;
+
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_nonvisual_accelmanager.js.html b/ref/files/src_nonvisual_accelmanager.js.html new file mode 100644 index 00000000..aaa353ab --- /dev/null +++ b/ref/files/src_nonvisual_accelmanager.js.html @@ -0,0 +1,357 @@ + + + + + src/nonvisual/accelmanager.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/nonvisual/accelmanager.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule NonVisual
+ * @namespace photonui
+ */
+
+var Base = require("../base.js");
+var KeyboardJS = require("keyboardjs");
+
+/**
+ * Manage keyboard accelerators.
+ *
+ *
+ * @class AccelManager
+ * @constructor
+ * @extends photonui.Base
+ */
+var AccelManager = Base.$extend({
+
+    // Constructor
+    __init__: function () {
+        this.__keys = {};
+        this.__kbd = {};
+        this.$super();
+    },
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Private properties ======
+
+    /**
+     * Registered keys.
+     *
+     *     {
+     *         "key": [ "id", "id", ... ]
+     *         ...
+     *     }
+     *
+     * @property __keys
+     * @private
+     * @type Object
+     */
+    __keys: null,
+
+    /**
+     * Keyboard bindings.
+     *
+     *     {
+     *         "id": {
+     *             safe: Boolean,
+     *             callback: Function,
+     *             binding: Object
+     *         },
+     *         ...
+     *     }
+     *
+     * @property __kbd
+     * @private
+     * @type Object
+     */
+    __kbd: null,
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Public methods ======
+
+    /**
+     * Add an accelerator.
+     *
+     * @method addAccel
+     * @param {String} id An unique id for the accelerator.
+     * @param {String} keys The keys of the accelerator (see the keyCombo section of http://robertwhurst.github.io/KeyboardJS/ ).
+     * @param {Function} callback
+     * @param {Boolean} safe If true, the accelerator is disable if a field/textArea is focused (optional, default=true)
+     */
+    addAccel: function (id, keys, callback, safe) {
+        keys = keys.toLowerCase().replace(/ *\+ */, " + ").replace(/ *, */, ", ").replace(/ *> */, " > ");
+        this.removeAccel(id);
+        this.__kbd[id] = {
+            keys: keys,
+            safe: ((safe === undefined) ? true : safe),
+            callback: callback
+        };
+
+        if (!this.__keys[keys]) {
+            KeyboardJS.bind(keys, this.__onAccel.bind(this, keys));
+            this.__keys[keys] = [];
+        }
+        this.__keys[keys].push(id);
+    },
+
+    /**
+     * Remove an accelerator.
+     *
+     * @method removeAccel
+     * @param {String} id the accelerator id.
+     */
+    removeAccel: function (id) {
+        var bd = this.__kbd[id];
+        if (!bd) {
+            return;
+        }
+
+        var keys = this.__keys[bd.keys];
+        keys.splice(keys.indexOf(id), 1);
+        if (keys.length === 0) {
+            KeyboardJS.unbind(this.__kbd[id].keys);
+            delete this.__keys[bd.keys];
+        }
+        delete this.__kbd[id];
+    },
+
+    destroy: function () {
+        for (var id in this.__kbd) {
+            this.removeAccel(id);
+        }
+        this.$super();
+    },
+
+    //////////////////////////////////////////
+    // Internal Events Callbacks            //
+    //////////////////////////////////////////
+
+    /**
+     * @method __onAccel
+     * @private
+     * @param {String} keys
+     * @param {Event} event
+     */
+    __onAccel: function (keys, event) {
+        if (!this.__keys[keys]) {
+            return;
+        }
+
+        for (var i = 0; i < this.__keys[keys].length; ++i) {
+            var id = this.__keys[keys][i];
+
+            if (this.__kbd[id].safe) {
+                if (document.activeElement instanceof HTMLInputElement ||
+                    document.activeElement instanceof HTMLSelectElement ||
+                    document.activeElement instanceof HTMLTextAreaElement) {
+                    continue;
+                }
+            }
+
+            this.__kbd[id].callback();
+            event.stopPropagation();
+            event.preventDefault();
+        }
+    }
+
+});
+
+module.exports = AccelManager;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_nonvisual_color.js.html b/ref/files/src_nonvisual_color.js.html new file mode 100644 index 00000000..fe19e6d4 --- /dev/null +++ b/ref/files/src_nonvisual_color.js.html @@ -0,0 +1,1202 @@ + + + + + src/nonvisual/color.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/nonvisual/color.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule NonVisual
+ * @namespace photonui
+ */
+
+var lodash = require("lodash");
+
+var Base = require("../base.js");
+var helpers = require("../helpers.js");
+
+var NAMED_COLORS = {
+    aliceblue:             [0xF0, 0xF8, 0xFF],
+    antiquewhite:          [0xFA, 0xEB, 0xD7],
+    aqua:                  [0x00, 0xFF, 0xFF],
+    aquamarine:            [0x7F, 0xFF, 0xD4],
+    azure:                 [0xF0, 0xFF, 0xFF],
+    beige:                 [0xF5, 0xF5, 0xDC],
+    bisque:                [0xFF, 0xE4, 0xC4],
+    black:                 [0x00, 0x00, 0x00],
+    blanchedalmond:        [0xFF, 0xEB, 0xCD],
+    blue:                  [0x00, 0x00, 0xFF],
+    blueviolet:            [0x8A, 0x2B, 0xE2],
+    brown:                 [0xA5, 0x2A, 0x2A],
+    burlywood:             [0xDE, 0xB8, 0x87],
+    cadetblue:             [0x5F, 0x9E, 0xA0],
+    chartreuse:            [0x7F, 0xFF, 0x00],
+    chocolate:             [0xD2, 0x69, 0x1E],
+    coral:                 [0xFF, 0x7F, 0x50],
+    cornflowerblue:        [0x64, 0x95, 0xED],
+    cornsilk:              [0xFF, 0xF8, 0xDC],
+    crimson:               [0xDC, 0x14, 0x3C],
+    cyan:                  [0x00, 0xFF, 0xFF],
+    darkblue:              [0x00, 0x00, 0x8B],
+    darkcyan:              [0x00, 0x8B, 0x8B],
+    darkgoldenrod:         [0xB8, 0x86, 0x0B],
+    darkgray:              [0xA9, 0xA9, 0xA9],
+    darkgreen:             [0x00, 0x64, 0x00],
+    darkgrey:              [0xA9, 0xA9, 0xA9],
+    darkkhaki:             [0xBD, 0xB7, 0x6B],
+    darkmagenta:           [0x8B, 0x00, 0x8B],
+    darkolivegreen:        [0x55, 0x6B, 0x2F],
+    darkorange:            [0xFF, 0x8C, 0x00],
+    darkorchid:            [0x99, 0x32, 0xCC],
+    darkred:               [0x8B, 0x00, 0x00],
+    darksalmon:            [0xE9, 0x96, 0x7A],
+    darkseagreen:          [0x8F, 0xBC, 0x8F],
+    darkslateblue:         [0x48, 0x3D, 0x8B],
+    darkslategray:         [0x2F, 0x4F, 0x4F],
+    darkslategrey:         [0x2F, 0x4F, 0x4F],
+    darkturquoise:         [0x00, 0xCE, 0xD1],
+    darkviolet:            [0x94, 0x00, 0xD3],
+    deeppink:              [0xFF, 0x14, 0x93],
+    deepskyblue:           [0x00, 0xBF, 0xFF],
+    dimgray:               [0x69, 0x69, 0x69],
+    dimgrey:               [0x69, 0x69, 0x69],
+    dodgerblue:            [0x1E, 0x90, 0xFF],
+    firebrick:             [0xB2, 0x22, 0x22],
+    floralwhite:           [0xFF, 0xFA, 0xF0],
+    forestgreen:           [0x22, 0x8B, 0x22],
+    fuchsia:               [0xFF, 0x00, 0xFF],
+    gainsboro:             [0xDC, 0xDC, 0xDC],
+    ghostwhite:            [0xF8, 0xF8, 0xFF],
+    gold:                  [0xFF, 0xD7, 0x00],
+    goldenrod:             [0xDA, 0xA5, 0x20],
+    gray:                  [0x80, 0x80, 0x80],
+    green:                 [0x00, 0x80, 0x00],
+    greenyellow:           [0xAD, 0xFF, 0x2F],
+    grey:                  [0x80, 0x80, 0x80],
+    honeydew:              [0xF0, 0xFF, 0xF0],
+    hotpink:               [0xFF, 0x69, 0xB4],
+    indianred:             [0xCD, 0x5C, 0x5C],
+    indigo:                [0x4B, 0x00, 0x82],
+    ivory:                 [0xFF, 0xFF, 0xF0],
+    khaki:                 [0xF0, 0xE6, 0x8C],
+    lavender:              [0xE6, 0xE6, 0xFA],
+    lavenderblush:         [0xFF, 0xF0, 0xF5],
+    lawngreen:             [0x7C, 0xFC, 0x00],
+    lemonchiffon:          [0xFF, 0xFA, 0xCD],
+    lightblue:             [0xAD, 0xD8, 0xE6],
+    lightcoral:            [0xF0, 0x80, 0x80],
+    lightcyan:             [0xE0, 0xFF, 0xFF],
+    lightgoldenrodyellow:  [0xFA, 0xFA, 0xD2],
+    lightgray:             [0xD3, 0xD3, 0xD3],
+    lightgreen:            [0x90, 0xEE, 0x90],
+    lightgrey:             [0xD3, 0xD3, 0xD3],
+    lightpink:             [0xFF, 0xB6, 0xC1],
+    lightsalmon:           [0xFF, 0xA0, 0x7A],
+    lightseagreen:         [0x20, 0xB2, 0xAA],
+    lightskyblue:          [0x87, 0xCE, 0xFA],
+    lightslategray:        [0x77, 0x88, 0x99],
+    lightslategrey:        [0x77, 0x88, 0x99],
+    lightsteelblue:        [0xB0, 0xC4, 0xDE],
+    lightyellow:           [0xFF, 0xFF, 0xE0],
+    lime:                  [0x00, 0xFF, 0x00],
+    limegreen:             [0x32, 0xCD, 0x32],
+    linen:                 [0xFA, 0xF0, 0xE6],
+    magenta:               [0xFF, 0x00, 0xFF],
+    maroon:                [0x80, 0x00, 0x00],
+    mediumaquamarine:      [0x66, 0xCD, 0xAA],
+    mediumblue:            [0x00, 0x00, 0xCD],
+    mediumorchid:          [0xBA, 0x55, 0xD3],
+    mediumpurple:          [0x93, 0x70, 0xDB],
+    mediumseagreen:        [0x3C, 0xB3, 0x71],
+    mediumslateblue:       [0x7B, 0x68, 0xEE],
+    mediumspringgreen:     [0x00, 0xFA, 0x9A],
+    mediumturquoise:       [0x48, 0xD1, 0xCC],
+    mediumvioletred:       [0xC7, 0x15, 0x85],
+    midnightblue:          [0x19, 0x19, 0x70],
+    mintcream:             [0xF5, 0xFF, 0xFA],
+    mistyrose:             [0xFF, 0xE4, 0xE1],
+    moccasin:              [0xFF, 0xE4, 0xB5],
+    navajowhite:           [0xFF, 0xDE, 0xAD],
+    navy:                  [0x00, 0x00, 0x80],
+    oldlace:               [0xFD, 0xF5, 0xE6],
+    olive:                 [0x80, 0x80, 0x00],
+    olivedrab:             [0x6B, 0x8E, 0x23],
+    orange:                [0xFF, 0xA5, 0x00],
+    orangered:             [0xFF, 0x45, 0x00],
+    orchid:                [0xDA, 0x70, 0xD6],
+    palegoldenrod:         [0xEE, 0xE8, 0xAA],
+    palegreen:             [0x98, 0xFB, 0x98],
+    paleturquoise:         [0xAF, 0xEE, 0xEE],
+    palevioletred:         [0xDB, 0x70, 0x93],
+    papayawhip:            [0xFF, 0xEF, 0xD5],
+    peachpuff:             [0xFF, 0xDA, 0xB9],
+    peru:                  [0xCD, 0x85, 0x3F],
+    pink:                  [0xFF, 0xC0, 0xCB],
+    plum:                  [0xDD, 0xA0, 0xDD],
+    powderblue:            [0xB0, 0xE0, 0xE6],
+    purple:                [0x80, 0x00, 0x80],
+    red:                   [0xFF, 0x00, 0x00],
+    rosybrown:             [0xBC, 0x8F, 0x8F],
+    royalblue:             [0x41, 0x69, 0xE1],
+    saddlebrown:           [0x8B, 0x45, 0x13],
+    salmon:                [0xFA, 0x80, 0x72],
+    sandybrown:            [0xF4, 0xA4, 0x60],
+    seagreen:              [0x2E, 0x8B, 0x57],
+    seashell:              [0xFF, 0xF5, 0xEE],
+    sienna:                [0xA0, 0x52, 0x2D],
+    silver:                [0xC0, 0xC0, 0xC0],
+    skyblue:               [0x87, 0xCE, 0xEB],
+    slateblue:             [0x6A, 0x5A, 0xCD],
+    slategray:             [0x70, 0x80, 0x90],
+    slategrey:             [0x70, 0x80, 0x90],
+    snow:                  [0xFF, 0xFA, 0xFA],
+    springgreen:           [0x00, 0xFF, 0x7F],
+    steelblue:             [0x46, 0x82, 0xB4],
+    tan:                   [0xD2, 0xB4, 0x8C],
+    teal:                  [0x00, 0x80, 0x80],
+    thistle:               [0xD8, 0xBF, 0xD8],
+    tomato:                [0xFF, 0x63, 0x47],
+    turquoise:             [0x40, 0xE0, 0xD0],
+    violet:                [0xEE, 0x82, 0xEE],
+    wheat:                 [0xF5, 0xDE, 0xB3],
+    white:                 [0xFF, 0xFF, 0xFF],
+    whitesmoke:            [0xF5, 0xF5, 0xF5],
+    yellow:                [0xFF, 0xFF, 0x00],
+    yellowgreen:           [0x9A, 0xCD, 0x32]
+};
+
+/**
+ * Handle colors.
+ *
+ * wEvents:
+ *
+ *   * value-changed:
+ *      - description: the selected color changed.
+ *      - callback:    function(photonui.Color)
+ *
+ * @class Color
+ * @constructor
+ * @extends photonui.Base
+ * @param {Object} * An object that can contain any property of the Color class (optional).
+ */
+var Color = Base.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        this._registerWEvents(["value-changed"]);
+        if (typeof(params) == "object" && !Array.isArray(params)) {
+            this.$super(params);
+        } else {
+            this.$super();
+            if (typeof(params) == "string") {
+                this.fromString(params);
+            } else if (Array.isArray(params)) {
+                this.setRGBA(params);
+            } else if (arguments.length >= 3) {
+                this.setRGBA.apply(this, arguments);
+            }
+        }
+    },
+
+    //////////////////////////////////////////
+    // Static methods                       //
+    //////////////////////////////////////////
+
+    __classvars__: {
+
+        /**
+         * Object containing all known named colors (`colorName: [r, g, b]`).
+         *
+         * @property NAMED_COLORS
+         * @static
+         * @type Object
+         */
+        NAMED_COLORS: NAMED_COLORS,
+
+        /**
+         * Converts any supported color format to an `[r, g, b, a]` array.
+         *
+         * @method ParseString
+         * @static
+         * @param {String} color
+         * @return {Array} `[r, g, b, a]` where each components is an integer between 0-255
+         */
+        ParseString: function (color) {
+            // #FF4400 #F40
+            if (color.match(/^#([0-9a-f]{3}){1,2}$/i)) {
+                return Color.NormalizeRgbaColor.apply(undefined, Color.ParseRgbHexString(color));
+            }
+
+            // #FF4400FF #F40F
+            if (color.match(/^#([0-9a-f]{4}){1,2}$/i)) {
+                return Color.ParseRgbaHexString(color);
+            }
+
+            // rgb(255, 70, 0)
+            if (color.match(/^rgb\(.+\)$/)) {
+                try {
+                    return Color.NormalizeRgbaColor.apply(undefined, Color.ParseCssRgbString(color));
+                } catch (error) {
+                    // pass
+                }
+            }
+
+            // rgba(255, 70, 0, 1.0)
+            if (color.match(/^rgba\(.+\)$/)) {
+                try {
+                    return Color.ParseCssRgbaString(color);
+                } catch (error) {
+                    // pass
+                }
+            }
+
+            // Named color
+            if (lodash.includes(lodash.keys(NAMED_COLORS), color.toLowerCase())) {
+                return Color.NormalizeRgbaColor.apply(undefined, Color.ParseNamedColor(color));
+            }
+
+            // Invalid color... thow...
+            throw new Error("InvalidColorFormat: '" + color + "' is not in a supported format");
+        },
+
+        /**
+         * Converts a named color (e.g. "red") to an `[r, g, b]` array.
+         *
+         * @method ParseNamedColor
+         * @static
+         * @param {String} color The named color
+         * @return {Array} `[r, g, b]` where each component is an integer between 0-255
+         */
+        ParseNamedColor: function (color) {
+            color = color.toLowerCase();
+            if (!NAMED_COLORS[color]) {
+                throw new Error("InvalidColorFormat: '" + color + "' is not a supported named color");
+            }
+            return lodash.clone(NAMED_COLORS[color]);
+        },
+
+        /**
+         * Converts an hexadecimal RGB color (e.g. `#FF0000`, `#F00`) to an `[r, g, b]` array.
+         *
+         * @method ParseRgbHexString
+         * @static
+         * @param {String} color The hexadecimal RGB color
+         * @return {Array} `[r, g, b]` where each component is an integer between 0-255
+         */
+        ParseRgbHexString: function (color) {
+            if (color[0] != "#") {
+                color = "#" + color;
+            }
+
+            // #ff0000
+            if (color.match(/^#[a-z0-9]{6}$/i)) {
+                return Color.NormalizeRgbColor(
+                    parseInt(color[1] + color[2], 16),  // red
+                    parseInt(color[3] + color[4], 16),  // green
+                    parseInt(color[5] + color[6], 16)   // blue
+                );
+
+            // #f00
+            } else if (color.match(/^#[a-z0-9]{3}$/i)) {
+                return Color.NormalizeRgbColor(
+                    parseInt(color[1] + color[1], 16),  // red
+                    parseInt(color[2] + color[2], 16),  // green
+                    parseInt(color[3] + color[3], 16)   // blue
+                );
+            }
+
+            throw new Error("InvalidColorFormat: " + color + " is not a valid hexadecimal RGB color");
+        },
+
+        /**
+         * Converts an hexadecimal RGBA color (e.g. `#FF0000FF`, `#F00F`) to an `[r, g, b, a]` array.
+         *
+         * @method ParseRgbaHexString
+         * @static
+         * @param {String} color The hexadecimal RGBA color
+         * @return {Array} `[r, g, b, a]` where each component is an integer between 0-255
+         */
+        ParseRgbaHexString: function (color) {
+            if (color[0] != "#") {
+                color = "#" + color;
+            }
+
+            // #ff0000ff
+            if (color.match(/^#[a-z0-9]{8}$/i)) {
+                return Color.NormalizeRgbaColor(
+                    parseInt(color[1] + color[2], 16),  // red
+                    parseInt(color[3] + color[4], 16),  // green
+                    parseInt(color[5] + color[6], 16),  // blue
+                    parseInt(color[7] + color[8], 16)   // alpha
+                );
+
+            // #f00f
+            } else if (color.match(/^#[a-z0-9]{4}$/i)) {
+                return Color.NormalizeRgbaColor(
+                    parseInt(color[1] + color[1], 16),  // red
+                    parseInt(color[2] + color[2], 16),  // green
+                    parseInt(color[3] + color[3], 16),  // blue
+                    parseInt(color[4] + color[4], 16)   // alpha
+                );
+            }
+
+            throw new Error("InvalidColorFormat: " + color + " is not a valid hexadecimal RGBA color");
+        },
+
+        /**
+         * Converts a CSS RGB color (e.g. `rgb(255, 0, 0)`) to an `[r, g, b]` array.
+         *
+         * @method ParseCssRgbString
+         * @static
+         * @param {String} color The CSS RGB color
+         * @return {Array} `[r, g, b]` where each component is an integer between 0-255
+         */
+        ParseCssRgbString: function (color) {
+            // rgb(255, 0, 0)
+            var match = color.match(/^rgb\(\s*(-?[0-9]+)\s*,\s*(-?[0-9]+)\s*,\s*(-?[0-9]+)\s*\)$/);
+            if (match) {
+                return Color.NormalizeRgbColor(
+                    parseInt(match[1], 10),
+                    parseInt(match[2], 10),
+                    parseInt(match[3], 10)
+                );
+            }
+
+            // rgb(100%, 0%, 0%)
+            match = color.match(/^rgb\(\s*(-?[0-9]+)%\s*,\s*(-?[0-9]+)%\s*,\s*(-?[0-9]+)%\s*\)$/);
+            if (match) {
+                return Color.NormalizeRgbColor(
+                    parseInt(match[1], 10) / 100 * 255,
+                    parseInt(match[2], 10) / 100 * 255,
+                    parseInt(match[3], 10) / 100 * 255
+                );
+            }
+
+            throw new Error("InvalidColorFormat: " + color + " is not a valid CSS RGB color");
+        },
+
+        /**
+         * Converts a CSS RGBA color (e.g. `rgba(255, 0, 0, 0.3)`) to an `[r, g, b, a]` array.
+         *
+         * @method ParseCssRgbaString
+         * @static
+         * @param {String} color The CSS RGBA color
+         * @return {Array} `[r, g, b, a]` where each component is an integer between 0-255
+         */
+        ParseCssRgbaString: function (color) {
+            // rgba(255, 0, 0)
+            // jscs:disable
+            var match = color.match(/^rgba\(\s*(-?[0-9]+)\s*,\s*(-?[0-9]+)\s*,\s*(-?[0-9]+)\s*,\s*(-?[0-9]*\.?[0-9]+)\s*\)$/);
+            // jscs:enable
+            if (match) {
+                return Color.NormalizeRgbaColor(
+                    parseInt(match[1], 10),
+                    parseInt(match[2], 10),
+                    parseInt(match[3], 10),
+                    parseFloat(match[4], 10) * 255
+                );
+            }
+
+            // rgba(100%, 0%, 0%)
+            // jscs:disable
+            match = color.match(/^rgba\(\s*(-?[0-9]+)%\s*,\s*(-?[0-9]+)%\s*,\s*(-?[0-9]+)%\s*,\s*(-?[0-9]*\.?[0-9]+)\s*\)$/);
+            // jscs:enable
+            if (match) {
+                return Color.NormalizeRgbaColor(
+                    parseInt(match[1], 10) / 100 * 255,
+                    parseInt(match[2], 10) / 100 * 255,
+                    parseInt(match[3], 10) / 100 * 255,
+                    parseFloat(match[4], 10) * 255
+                );
+            }
+
+            throw new Error("InvalidColorFormat: " + color + " is not a valid CSS RGBA color");
+        },
+
+        /**
+         * Format an RGB color to hexadecimal RGB string (e.g. `#FF0000`).
+         *
+         * @method FormatToRgbHexString
+         * @static
+         * @param {Number} red The red component
+         * @param {Number} green The green component
+         * @param {Number} blue The blue component
+         * @return {String} The formatted color string.
+         */
+        FormatToRgbHexString: function (red, green, blue) {
+            var r = (red | 0).toString(16).toUpperCase();
+            if (r.length == 1) {
+                r = "0" + r;
+            }
+            var g = (green | 0).toString(16).toUpperCase();
+            if (g.length == 1) {
+                g = "0" + g;
+            }
+            var b = (blue | 0).toString(16).toUpperCase();
+            if (b.length == 1) {
+                b = "0" + b;
+            }
+            return "#" + r + g + b;
+        },
+
+        /**
+         * Format an RGBA color to hexadecimal RGBA string (e.g. `#FF0000FF`).
+         *
+         * @method FormatToRgbaHexString
+         * @static
+         * @param {Number} red The red component
+         * @param {Number} green The green component
+         * @param {Number} blue The blue component
+         * @param {Number} alpha The opacity of the color
+         * @return {String} The formatted color string.
+         */
+        FormatToRgbaHexString: function (red, green, blue, alpha) {
+            var a = (alpha | 0).toString(16).toUpperCase();
+            if (a.length == 1) {
+                a = "0" + a;
+            }
+            return Color.FormatToRgbHexString(red, green, blue) + a;
+        },
+
+        /**
+         * Format an RGB color to CSS RGB string (e.g. `rgb(255, 0, 0)`).
+         *
+         * @method FormatToCssRgbString
+         * @static
+         * @param {Number} red The red component
+         * @param {Number} green The green component
+         * @param {Number} blue The blue component
+         * @return {String} The formatted color string.
+         */
+        FormatToCssRgbString: function (red, green, blue) {
+            return "rgb(" + red + ", " + green + ", " + blue + ")";
+        },
+
+        /**
+         * Format an RGBA color to CSS RGBA string (e.g. `rgba(255, 0, 0, 1.00)`).
+         *
+         * @method FormatToCssRgbaString
+         * @static
+         * @param {Number} red The red component
+         * @param {Number} green The green component
+         * @param {Number} blue The blue component
+         * @param {Number} alpha The opacity of the color
+         * @return {String} The formatted color string.
+         */
+        FormatToCssRgbaString: function (red, green, blue, alpha) {
+            var a = (alpha / 255).toFixed(2);
+            return "rgba(" + red + ", " + green + ", " + blue + ", " + a + ")";
+        },
+
+        /**
+         * Normalize an RGB color.
+         *
+         * @method NormalizeRgbColor
+         * @static
+         * @param {Number} red The red component
+         * @param {Number} green The green component
+         * @param {Number} blue The blue component
+         * @return {Array} The normalized array `[r, g, b]` where each component is an integer between 0-255.
+         */
+        NormalizeRgbColor: function (red, green, blue) {
+            return [
+                lodash.clamp(red | 0, 0, 255),
+                lodash.clamp(green | 0, 0, 255),
+                lodash.clamp(blue | 0, 0, 255)
+            ];
+        },
+
+        /**
+         * Normalize an RGBA color.
+         *
+         * @method NormalizeRgbaColor
+         * @static
+         * @param {Number} red The red component
+         * @param {Number} green The green component
+         * @param {Number} blue The blue component
+         * @param {Number} alpha The opacity of the color
+         * @return {Array} The normalized array `[r, g, b, a]` where each component is an integer between 0-255.
+         */
+        NormalizeRgbaColor: function (red, green, blue, alpha) {
+            if (alpha === undefined) {
+                alpha = 255;
+            }
+            return [
+                lodash.clamp(red | 0, 0, 255),
+                lodash.clamp(green | 0, 0, 255),
+                lodash.clamp(blue | 0, 0, 255),
+                lodash.clamp(alpha | 0, 0, 255)
+            ];
+        }
+
+    },
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    /**
+     * The color in RGB hexadecimal format (e.g. "#FF0000").
+     *
+     * @property hexString
+     * @deprecated
+     * @type String
+     */
+    getHexString: function () {
+        helpers.log("warn", "'hexString' is deprecated, use 'rgbHexString' instead");
+        return this.rgbHexString;
+    },
+
+    setHexString: function (value) {
+        helpers.log("warn", "'hexString' is deprecated, use 'fromString()' method instead");
+
+        var color = null;
+
+        if (typeof value == "string") {
+            if (value.match(/^#([0-9a-f]{3}){1,2}$/i)) {
+                color = this.$class.ParseRgbHexString(value);
+            } else {
+                try {
+                    color = this.$class.ParseNamedColor(value);
+                } catch (e) {
+                    // pass
+                }
+            }
+        } else if (lodash.isArray(value)) {
+            color = value;
+        }
+
+        if (color) {
+            this.setRGB(color);
+        } else {
+            helpers.log("warn", "Unrecognized color format " + JSON.stringify(value));
+        }
+    },
+
+    /**
+     * The color in CSS RGB format (e.g. "rgb(255, 0, 0)").
+     *
+     * @property rgbString
+     * @type String
+     * @readOnly
+     * @deprecated
+     */
+    getRgbString: function () {
+        helpers.log("warn", "'rgbString' is deprecated, use 'cssRgbString' instead");
+        return this.$class.FormatToCssRgbString(this.red, this.green, this.blue);
+    },
+
+    /**
+     * The color in CSS RGBA format (e.g. "rgba(255, 0, 0, 1.0)").
+     *
+     * @property rgbaString
+     * @type String
+     * @readOnly
+     * @deprecated
+     */
+    getRgbaString: function () {
+        helpers.log("warn", "'rgbaString' is deprecated, use 'cssRgbaString' instead");
+        return this.$class.FormatToCssRgbaString(this.red, this.green, this.blue, this.alpha);
+    },
+
+    /**
+     * The color in RGB hexadecimal format (e.g. "#FF0000").
+     *
+     * @property rgbHexString
+     * @type String
+     */
+    getRgbHexString: function () {
+        return this.$class.FormatToRgbHexString(this.red, this.green, this.blue);
+    },
+
+    setRgbHexString: function (color) {
+        try {
+            this.setRGB(this.$class.ParseRgbHexString(color));
+        } catch (error) {
+            helpers.log("warn", error);
+        }
+    },
+
+    /**
+     * The color in RGBA hexadecimal format (e.g. "#FF0000FF").
+     *
+     * @property rgbaHexString
+     * @type String
+     */
+    getRgbaHexString: function () {
+        return this.$class.FormatToRgbaHexString(this.red, this.green, this.blue, this.alpha);
+    },
+
+    setRgbaHexString: function (color) {
+        try {
+            this.setRGBA(this.$class.ParseRgbaHexString(color));
+        } catch (error) {
+            helpers.log("warn", error);
+        }
+    },
+
+    /**
+     * The color in CSS RGB format (e.g. "rgb(255, 0, 0)").
+     *
+     * @property cssRgbString
+     * @type String
+     */
+    getCssRgbString: function () {
+        return this.$class.FormatToCssRgbString(this.red, this.green, this.blue);
+    },
+
+    setCssRgbString: function (color) {
+        try {
+            this.setRGB(this.$class.ParseCssRgbString(color));
+        } catch (error) {
+            helpers.log("warn", error);
+        }
+    },
+
+    /**
+     * The color in CSS RGBA format (e.g. "rgb(255, 0, 0, 1.0)").
+     *
+     * @property cssRgbaString
+     * @type String
+     */
+    getCssRgbaString: function () {
+        return this.$class.FormatToCssRgbaString(this.red, this.green, this.blue, this.alpha);
+    },
+
+    setCssRgbaString: function (color) {
+        try {
+            this.setRGBA(this.$class.ParseCssRgbaString(color));
+        } catch (error) {
+            helpers.log("warn", error);
+        }
+    },
+
+    /**
+     * Red (0-255).
+     *
+     * @property red
+     * @type Number
+     */
+    _red: 255,
+
+    getRed: function () {
+        return this._red;
+    },
+
+    setRed: function (red) {
+        this._red = lodash.clamp(red | 0, 0, 255);
+        this._updateHSB();
+    },
+
+    /**
+     * Green (0-255).
+     *
+     * @property green
+     * @type Number
+     */
+    _green: 0,
+
+    getGreen: function () {
+        return this._green;
+    },
+
+    setGreen: function (green) {
+        this._green = lodash.clamp(green | 0, 0, 255);
+        this._updateHSB();
+    },
+
+    /**
+     * Blue (0-255).
+     *
+     * @property blue
+     * @type Number
+     */
+    _blue: 0,
+
+    getBlue: function () {
+        return this._blue;
+    },
+
+    setBlue: function (blue) {
+        this._blue = lodash.clamp(blue | 0, 0, 255);
+        this._updateHSB();
+    },
+
+    /**
+     * Alpha channel (0-255)
+     *
+     * @property alpha
+     * @type Number
+     */
+    _alpha: 255,
+
+    getAlpha: function () {
+        return this._alpha;
+    },
+
+    setAlpha: function (alpha) {
+        this._alpha = lodash.clamp(alpha | 0, 0, 255);
+        this._callCallbacks("value-changed");
+    },
+
+    /**
+     * Hue (0-360).
+     *
+     * @property hue
+     * @type Number
+     */
+    _hue: 0,
+
+    getHue: function () {
+        return this._hue;
+    },
+
+    setHue: function (hue) {
+        this._hue = lodash.clamp(hue | 0, 0, 360);
+        this._updateRGB();
+    },
+
+    /**
+     * Saturation (0-100).
+     *
+     * @property saturation
+     * @type Number
+     */
+    _saturation: 100,
+
+    getSaturation: function () {
+        return this._saturation;
+    },
+
+    setSaturation: function (saturation) {
+        this._saturation = lodash.clamp(saturation | 0, 0, 100);
+        this._updateRGB();
+    },
+
+    /**
+     * Brightness (0-100).
+     *
+     * @property brightness
+     * @type Number
+     */
+    _brightness: 100,
+
+    getBrightness: function () {
+        return this._brightness;
+    },
+
+    setBrightness: function (brightness) {
+        this._brightness = lodash.clamp(brightness | 0, 0, 100);
+        this._updateRGB();
+    },
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Public methods ======
+
+    /**
+     * Defines the color from any supported string format.
+     *
+     * @method fromString
+     * @param {String} color
+     */
+    fromString: function (color) {
+        try {
+            this.setRGBA(this.$class.ParseString(color));
+        } catch (error) {
+            helpers.log("warn", error);
+        }
+    },
+
+    /**
+     * Set RGB(A) color (alias for setRGBA).
+     *
+     * The params can also be replaced by an array.
+     *
+     * @method setRGB
+     * @param {Number} red (0-255)
+     * @param {Number} green (0-255)
+     * @param {Number} blue (0-255)
+     */
+    setRGB: function () {
+        this.setRGBA.apply(this, arguments);
+    },
+
+    /**
+     * Set RGBA color.
+     *
+     * The params can also be replaced by an array.
+     *
+     * @method setRGBA
+     * @param {Number} red (0-255)
+     * @param {Number} green (0-255)
+     * @param {Number} blue (0-255)
+     * @param {Number} alpha (optional, 0-255)
+     */
+    setRGBA: function () {
+        var args = arguments;
+        if (arguments.length == 1 && Array.isArray(arguments[0])) {
+            args = arguments[0];
+        }
+        if (args.length < 3) {
+            return;
+        }
+
+        this._red = Math.max(0, Math.min(255, args[0] | 0));
+        this._green = Math.max(0, Math.min(255, args[1] | 0));
+        this._blue = Math.max(0, Math.min(255, args[2] | 0));
+        if (args[3] !== undefined) {
+            this._alpha = Math.max(0, Math.min(255, args[3] | 0));
+        }
+
+        this._updateHSB();
+    },
+
+    /**
+     * Get RGB.
+     *
+     * @method getRGB
+     * @return {Array} [red(0-255), green(0-255), blue(0-255)]
+     */
+    getRGB: function () {
+        return [this._red, this._green, this._blue];
+    },
+
+    /**
+     * Get RGBA.
+     *
+     * @method getRGBA
+     * @return {Array} [red(0-255), green(0-255), blue(0-255), alpha(0-255)]
+     */
+    getRGBA: function () {
+        return [this._red, this._green, this._blue, this._alpha];
+    },
+
+    /**
+     * Set HSB color
+     *
+     * The params can also be replaced by an array.
+     *
+     * @method setHSB
+     * @param {Number} hue (0-360)
+     * @param {Number} saturation (0-100)
+     * @param {Number} brightness (0-100)
+     */
+    setHSB: function () {
+        var args = arguments;
+        if (arguments.length == 1 && Array.isArray(arguments[0])) {
+            args = arguments[0];
+        }
+        if (args.length != 3) {
+            return;
+        }
+
+        this._hue = Math.max(0, Math.min(360, args[0] | 0));
+        this._saturation = Math.max(0, Math.min(100, args[1] | 0));
+        this._brightness = Math.max(0, Math.min(100, args[2] | 0));
+
+        this._updateRGB();
+    },
+
+    toString: function () {
+        return this.rgbHexString;
+    },
+
+    // ====== Private methods ======
+
+    /**
+     * Update HSB from RGB.
+     *
+     * @method _updateHSB
+     * @private
+     */
+    _updateHSB: function () {
+        // http://fr.wikipedia.org/wiki/Teinte_Saturation_Valeur#Conversion_de_RVB_vers_TSV
+
+        var r = this._red / 255;
+        var g = this._green / 255;
+        var b = this._blue / 255;
+
+        var min = Math.min(r, g, b);
+        var max = Math.max(r, g, b);
+
+        // Hue
+        if (max == min) {
+            this._hue = 0;
+        } else if (max == r) {
+            this._hue = Math.round((60 * (g - b) / (max - min) + 360) % 360);
+        } else if (max == g) {
+            this._hue = Math.round(60 * (b - r) / (max - min) + 120);
+        } else if (max == b) {
+            this._hue = Math.round(60 * (r - g) / (max - min) + 240);
+        }
+
+        // Saturation
+        if (max === 0) {
+            this._saturation = 0;
+        } else {
+            this._saturation = Math.round((1 - min / max) * 100);
+        }
+
+        // Brightness
+        this._brightness = Math.round(max * 100);
+
+        //
+        this._callCallbacks("value-changed");
+    },
+
+    /**
+     * Update RGB from HSB.
+     *
+     * @method _updateRGB
+     * @private
+     */
+    _updateRGB: function () {
+        // http://fr.wikipedia.org/wiki/Teinte_Saturation_Valeur#Conversion_de_TSV_vers_RVB
+
+        var h = this.hue % 360;
+        var s = this.saturation / 100;
+        var b = this.brightness / 100;
+
+        var ti = ((h / 60) | 0) % 6;
+        var f = h / 60 - ti;
+        var l = b * (1 - s);
+        var m = b * (1 - f * s);
+        var n = b * (1 - (1 - f) * s);
+
+        switch (ti) {
+            case 0:
+                this._red = (b * 255) | 0;
+                this._green = (n * 255) | 0;
+                this._blue = (l * 255) | 0;
+                break;
+            case 1:
+                this._red = (m * 255) | 0;
+                this._green = (b * 255) | 0;
+                this._blue = (l * 255) | 0;
+                break;
+            case 2:
+                this._red = (l * 255) | 0;
+                this._green = (b * 255) | 0;
+                this._blue = (n * 255) | 0;
+                break;
+            case 3:
+                this._red = (l * 255) | 0;
+                this._green = (m * 255) | 0;
+                this._blue = (b * 255) | 0;
+                break;
+            case 4:
+                this._red = (n * 255) | 0;
+                this._green = (l * 255) | 0;
+                this._blue = (b * 255) | 0;
+                break;
+            case 5:
+                this._red = (b * 255) | 0;
+                this._green = (l * 255) | 0;
+                this._blue = (m * 255) | 0;
+                break;
+        }
+
+        this._callCallbacks("value-changed");
+    }
+
+});
+
+module.exports = Color;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_nonvisual_filemanager.js.html b/ref/files/src_nonvisual_filemanager.js.html new file mode 100644 index 00000000..e6d3360a --- /dev/null +++ b/ref/files/src_nonvisual_filemanager.js.html @@ -0,0 +1,482 @@ + + + + + src/nonvisual/filemanager.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/nonvisual/filemanager.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule NonVisual
+ * @namespace photonui
+ */
+
+var Base = require("../base.js");
+
+/**
+ * Open files from the standard "FileOpen" dialog and drag & drop.
+ *
+ * wEvents:
+ *
+ *   * file-open:
+ *      - description: File selected or dropped.
+ *      - callback:    function(widget, fileBlob, x, y)  //(x=y=undefined if using a dialog)
+ *
+ * @class FileManager
+ * @constructor
+ * @extends photonui.Base
+ * @param {Object} params An object that can contain any property of the widget (optional).
+ */
+var FileManager = Base.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        this.__fileField = document.createElement("input");
+        this.__fileField.type = "file";
+        this.__fileField.addEventListener("change", this.__onFileSelected.bind(this), false);
+        this.__fileField.style.position = "fixed";
+        this.__fileField.style.top = 0;
+        this.__fileField.style.left = 0;
+        this.__fileField.style.opacity = 0;
+        this.__fileField.style.display = "none";
+        document.getElementsByTagName("body")[0].appendChild(this.__fileField);
+        this._acceptedMimes = [];
+        this._acceptedExts = [];
+        this._registerWEvents(["file-open"]);
+        this.$super(params);
+    },
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    /**
+     * List of the accepted mime types.
+     *
+     * @property acceptedMimes
+     * @type Array
+     * @default []
+     */
+    _acceptedMimes: [],
+
+    getAcceptedMimes: function () {
+        return this._acceptedMimes;
+    },
+
+    setAcceptedMimes: function (mimes) {
+        this._acceptedMimes = mimes;
+        this._updateAccepted();
+    },
+
+    /**
+     * List of the accepted file extentions.
+     *
+     * @property acceptedExts
+     * @type Array
+     * @default []
+     */
+    _acceptedExts: [],
+
+    getAcceptedExts: function () {
+        return this._acceptedExts;
+    },
+
+    setAcceptedExts: function (exts) {
+        this._acceptedExts = exts;
+        this._updateAccepted();
+    },
+
+    /**
+     * Element that accepts file drop (`null` disable d&d support).
+     *
+     * @property dropZone
+     * @type HTMLElement
+     * @default null
+     */
+    _dropZone: null,
+
+    getDropZone: function () {
+        return this._dropZone;
+    },
+
+    setDropZone: function (element) {
+        // Unbind
+        if (this._dropZone) {
+            this._unbindEvent("document-dragover");
+            this._unbindEvent("document-drop");
+            this._unbindEvent("element-dragover");
+            this._unbindEvent("element-drop");
+        }
+
+        this._dropZone = element;
+
+        // Bind
+        if (element) {
+            this._bindEvent("document-dragover", document, "dragover", function (event) {
+                event.preventDefault();
+            });
+            this._bindEvent("document-drop", document, "drop", function (event) {
+                event.preventDefault();
+            });
+            this._bindEvent("element-dragover", element, "dragover", function (event) {});
+            this._bindEvent("element-drop", element, "drop", this.__onFileDropped.bind(this));
+        }
+    },
+
+    /**
+     * Allow multiselect in FileOpen dialog.
+     *
+     * @property multiselect
+     * @type Boolean
+     * @default false
+     */
+    _multiselect: false,
+
+    getMultiselect: function () {
+        return this._multiselect;
+    },
+
+    setMultiselect: function (multiselect) {
+        this._multiselect = multiselect;
+
+        if (multiselect) {
+            this.__fileField.multiple = "true";
+        } else {
+            delete this.__fileField.multiple;
+        }
+    },
+
+    // ====== Private properties ======
+
+    /**
+     * The file field for opening the file dialog.
+     *
+     * @property __fileField
+     * @private
+     * @type HTMLElement
+     */
+    __fileField: null,
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Public methods ======
+
+    /**
+     * Open the FileOpen dialog to allow user to browse its HDD for a file.
+     *
+     * @method open
+     */
+    open: function () {
+        this.__fileField.style.display = "inline-block";
+        this.__fileField.value = null;
+        this.__fileField.focus();
+        this.__fileField.click();
+        this.__fileField.style.display = "none";
+    },
+
+    /**
+     * Destroy the class.
+     *
+     * @method destroy
+     */
+    destroy: function () {
+        document.getElementsByTagName("body")[0].removeChild(this.__fileField);
+        this.$super();
+    },
+
+    // ====== Private methods ======
+
+    /**
+     * Update accepted mimes/extentions.
+     *
+     * @method _updateAccepted
+     * @private
+     */
+    _updateAccepted: function () {
+        var result = [];
+
+        for (var i = 0 ; i < this.acceptedExts.length ; i++) {
+            result.push("." + this.acceptedExts[i].toLocaleLowerCase());
+        }
+
+        result = result.concat(this.acceptedMimes);
+
+        this.__fileField.accept = result.join(",");
+    },
+
+    /**
+     * Check file and call callbacks.
+     *
+     * @method _openFile
+     * @private
+     * @param {File} file
+     * @param {Number} x The x postition of the mouse (d&d only).
+     * @param {Number} y The y postition of the mouse (d&d only).
+     */
+    _openFile: function (file, x, y) {
+        var match = false;
+
+        // Validate mime
+        for (var m = 0 ; m < this.acceptedMimes.length ; m++) {
+            if (file.type == this.acceptedMimes[m]) {
+                match = true;
+                break;
+            }
+        }
+
+        // Validate ext
+        if (!match) {
+            var ext = file.name.split(".").splice(-1)[0].toLowerCase();
+            for (var e = 0 ; e < this.acceptedExts.length ; e++) {
+                if (ext == this.acceptedExts[e]) {
+                    match = true;
+                    break;
+                }
+            }
+        }
+
+        if (match || this.acceptedMimes.length === 0 && this.acceptedExts.length === 0) {
+            this._callCallbacks("file-open", [file, x, y]);
+        }
+    },
+
+    //////////////////////////////////////////
+    // Internal Events Callbacks            //
+    //////////////////////////////////////////
+
+    /**
+     * @method __onFileDropped
+     * @private
+     * @param event
+     */
+    __onFileDropped: function (event) {
+        for (var i in event.dataTransfer.files) {
+            var file = event.dataTransfer.files[i];
+            if (file instanceof File) {
+                this._openFile(file, event.pageX, event.pageY);
+            }
+        }
+    },
+
+    /**
+     * @method __onFileSelected
+     * @private
+     * @param event
+     */
+    __onFileSelected: function (event) {
+        for (var i in this.__fileField.files) {
+            var file = this.__fileField.files[i];
+            if (file instanceof File) {
+                this._openFile(file);
+            }
+        }
+    },
+
+    /**
+     * Called when the locale is changed.
+     *
+     * @method __onLocaleChanged
+     * @private
+     */
+    __onLocaleChanged: function () {
+        // pass
+    }
+});
+
+module.exports = FileManager;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_nonvisual_keyboardmanager.js.html b/ref/files/src_nonvisual_keyboardmanager.js.html new file mode 100644 index 00000000..46bcab34 --- /dev/null +++ b/ref/files/src_nonvisual_keyboardmanager.js.html @@ -0,0 +1,681 @@ + + + + + src/nonvisual/keyboardmanager.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/nonvisual/keyboardmanager.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: A. Breust <https://github.com/Breush>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule NonVisual
+ * @namespace photonui
+ */
+
+var Helpers = require("../helpers.js");
+var Base = require("../base.js");
+var Widget = require("../widget.js");
+
+/**
+ * Manage document-wide keyboard events.
+ *
+ * wEvents:
+ *
+ *   * key-down:
+ *      - description: When a key is pushed (event launched just once until key is released).
+ *      - callback:    function(manager, kstate)
+ *
+ *   * key-up:
+ *      - description: When a key is released.
+ *      - callback:    function(manager, kstate)
+ *
+ *   * key-hold:
+ *      - description: When the last key pressed is held down.
+ *      - callback:    function(manager, kstate)
+ *
+ *
+ * kstate:
+ *
+ *   A snapshot of the keyboard state when the event occured.
+ *
+ *     {
+ *         event: <Object>,       // The original js event
+ *         action: <String>,      // The event name (key-down/up, key-hold)
+ *         keys: <String>,        // The object of active keys
+ *         key: <String>,         // User-friendly key name
+ *     }
+ *
+ * @class KeyboardManager
+ * @constructor
+ * @extends photonui.Base
+ * @param {photonui.Widget} element Any PhotonUI Widget (optional).
+ * @param {HTMLElement} element Any HTML element (optional).
+ * @param {Object} params An object that can contain any property of the widget (optional).
+ */
+var KeyboardManager = Base.$extend({
+
+    // Constructor
+    __init__: function (element, params) {
+        this._registerWEvents(["key-down", "key-up", "key-hold"]);
+
+        this.__keys = {};
+
+        if (element && (element instanceof Widget || element instanceof HTMLElement || element === document)) {
+            this.$super(params);
+            this.element = element;
+        } else {
+            this.$super(element);
+        }
+
+        this._initKeyCache();
+
+        // NOTE Holding event might be broken on old versions of Ubuntu + GTK
+        // for an event "keyup" is fired before the "keydown" repeat.
+        // One work-around would be to send by ourself the events inside an animation loop,
+        // according to the last and the current states of active keys.
+    },
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    /**
+     * Disable the keyboard manager callbacks when focusing a input field-like element.
+     *
+     * @property safe
+     * @type Boolean
+     * @default true
+     */
+    _safe: true,
+
+    getSafe: function () {
+        "@photonui-update";
+        return this._safe;
+    },
+
+    setSafe: function (safe) {
+        this._safe = safe;
+    },
+
+    /**
+     * Disable concerned events default actions.
+     *
+     * @property noPreventDefault
+     * @type Boolean
+     * @default false
+     */
+    _noPreventDefault: false,
+
+    getNoPreventDefault: function () {
+        "@photonui-update";
+        return this._noPreventDefault;
+    },
+
+    setNoPreventDefault: function (noPreventDefault) {
+        this._noPreventDefault = noPreventDefault;
+    },
+
+    /**
+     * The HTML Element on which the events are binded.
+     *
+     * NOTE: If a photonui.Widget object is assigned to this property,
+     *       its HTML Element will be automatically assigned to the property instead.
+     *
+     * @property element
+     * @type HTMLElement
+     * @default null
+     */
+    _element: null,
+
+    getElement: function () {
+        return this._element || document;
+    },
+
+    setElement: function (element) {
+        if (element instanceof Widget) {
+            this._element = element.interactiveNode || element.html;
+        } else if (element instanceof HTMLElement || element === document) {
+            this._element = element;
+        } else {
+            this._element = null;
+        }
+        this._updateEvents();
+    },
+
+    /**
+     * The action:
+     *
+     *   * "key-down"
+     *   * "key-up"
+     *   * "key-hold"
+     *
+     * @property action
+     * @readOnly
+     * @type String
+     */
+    _action: "",
+
+    getAction: function () {
+        return this._action;
+    },
+
+    // ====== Private properties ======
+
+    /**
+     * Last event object.
+     *
+     * @property __event
+     * @private
+     * @type Object
+     * @default null
+     */
+    __event: null,
+
+    /**
+     * The currently active keys.
+     *
+     * @property keys
+     * @private
+     * @type Object
+     * @default {}
+     */
+    __keys: null,
+
+    /**
+     * Last key concerned.
+     *
+     * @property __key
+     * @private
+     * @type String
+     * @default null
+     */
+    __key: null,
+
+    /**
+     * KeyCode correspondance to key name.
+     *
+     * @property __keyCache
+     * @private
+     * @type Array
+     */
+    __keyCache: [],
+
+    /**
+     * Key name correspondance to key code.
+     *
+     * @property __keyCodeCache
+     * @private
+     * @type Array
+     */
+    __keyCodeCache: [],
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Public methods ======
+
+    /**
+     * Bind events on the HTML Element.
+     *
+     * @method _updateEvents
+     * @private
+     */
+    _updateEvents: function () {
+        // Unbind all existing events
+        for (var id in this.__events) {
+            this._unbindEvent(id);
+        }
+        // Check if we have an html element
+        if (!this.element) {
+            return;
+        }
+        // Bind new events
+        // We will simulate the standard "keypress" event because some browsers
+        // do not emit one for special keys (alt, ctrl, shift, escape).
+        this._bindEvent("key-down", this.getElement(), "keydown", this.__onDocumentKeyDown.bind(this));
+        this._bindEvent("key-up", this.getElement(), "keyup", this.__onDocumentKeyUp.bind(this));
+
+        this._bindEvent("lost-focus", window, "blur", this.__onWindowBlur.bind(this));
+    },
+
+    /**
+     * Check if a specific key is currently pressed.
+     *
+     * @method isKeyPressed
+     * @param {String} key The key name
+     * @return {Boolean}
+     */
+    isKeyPressed: function (key) {
+        var keyState = this.__keys[this.__keyCodeCache[key]];
+        return (keyState) ? true : false;
+    },
+
+    /**
+     * Check if a specific key is currently released.
+     *
+     * @method isKeyReleased
+     * @param {String} key The key name
+     * @return {Boolean}
+     */
+    isKeyReleased: function (key) {
+        var keyState = this.__keys[this.__keyCodeCache[key]];
+        return (keyState) ? false : true;
+    },
+
+    // ====== Private methods ======
+
+    /**
+     * Take a snapshot of the KeyboardManager
+     *
+     * @method _dump
+     * @private
+     * @return {Object}
+     */
+    _dump: function () {
+        return {
+            event: this.__event,
+            action: this._action,
+            key: this.__key
+        };
+    },
+
+    /**
+     * Check if the user has not focused an input element
+     *
+     * @method _checkFocus
+     * @private
+     * @return {Boolean}
+     */
+    _checkFocus: function () {
+        return !(this._safe && (document.activeElement instanceof HTMLInputElement ||
+               document.activeElement instanceof HTMLSelectElement ||
+               document.activeElement instanceof HTMLTextAreaElement));
+    },
+
+    /**
+     * Check the validity of the keyboard event
+     *
+     * @method _checkEvent
+     * @private
+     * @param {KeyboardEvent} event The keyboard event
+     * @return {Boolean}
+     */
+    _checkEvent: function (event) {
+        this.__event = event;
+        this.__key = this._keyFromEvent(event);
+
+        if (!this.__key || this.__key === "Dead") {
+            return false;
+        }
+
+        this.__keyCodeCache[this.__key] = event.keyCode;
+
+        return this._checkFocus();
+    },
+
+    /**
+     * Create the key correspondance cache for basic touches
+     *
+     * @method _initKeyCache
+     * @private
+     */
+    _initKeyCache: function () {
+        // General
+        this.__keyCache[3] = "cancel";
+        this.__keyCache[8] = "backspace";
+        this.__keyCache[9] = "tab";
+        this.__keyCache[12] = "clear";
+        this.__keyCache[13] = "enter";
+        this.__keyCache[16] = "shift";
+        this.__keyCache[17] = "ctrl";
+        this.__keyCache[18] = "alt";
+        this.__keyCache[19] = "pause";
+        this.__keyCache[20] = "capslock";
+        this.__keyCache[27] = "escape";
+        this.__keyCache[32] = "space";
+        this.__keyCache[33] = "pageup";
+        this.__keyCache[34] = "pagedown";
+        this.__keyCache[35] = "end";
+        this.__keyCache[36] = "home";
+        this.__keyCache[37] = "left";
+        this.__keyCache[38] = "up";
+        this.__keyCache[39] = "right";
+        this.__keyCache[40] = "down";
+        this.__keyCache[41] = "select";
+        this.__keyCache[42] = "printscreen";
+        this.__keyCache[43] = "execute";
+        this.__keyCache[44] = "snapshot";
+        this.__keyCache[45] = "insert";
+        this.__keyCache[46] = "delete";
+        this.__keyCache[47] = "help";
+
+        // 0-9
+        this.__keyCache[48] = "0";
+        this.__keyCache[49] = "1";
+        this.__keyCache[50] = "2";
+        this.__keyCache[51] = "3";
+        this.__keyCache[52] = "4";
+        this.__keyCache[53] = "5";
+        this.__keyCache[54] = "6";
+        this.__keyCache[55] = "7";
+        this.__keyCache[56] = "8";
+        this.__keyCache[57] = "9";
+
+        // A-Z
+        for (var keyCode = 65; keyCode <= 90; ++keyCode) {
+            this.__keyCache[keyCode] = String.fromCharCode(keyCode);
+        }
+
+        // numpad
+        this.__keyCache[96] = "num0";
+        this.__keyCache[97] = "num1";
+        this.__keyCache[98] = "num2";
+        this.__keyCache[99] = "num3";
+        this.__keyCache[100] = "num4";
+        this.__keyCache[101] = "num5";
+        this.__keyCache[102] = "num6";
+        this.__keyCache[103] = "num7";
+        this.__keyCache[104] = "num8";
+        this.__keyCache[105] = "num9";
+        this.__keyCache[106] = "num*";
+        this.__keyCache[107] = "num+";
+        this.__keyCache[108] = "numenter";
+        this.__keyCache[109] = "num-";
+        this.__keyCache[110] = "num.";
+        this.__keyCache[111] = "num/";
+        this.__keyCache[144] = "numlock";
+        this.__keyCache[145] = "scrolllock";
+
+        // function keys
+        this.__keyCache[112] = "f1";
+        this.__keyCache[113] = "f2";
+        this.__keyCache[114] = "f3";
+        this.__keyCache[115] = "f4";
+        this.__keyCache[116] = "f5";
+        this.__keyCache[117] = "f6";
+        this.__keyCache[118] = "f7";
+        this.__keyCache[119] = "f8";
+        this.__keyCache[120] = "f9";
+        this.__keyCache[121] = "f10";
+        this.__keyCache[122] = "f11";
+        this.__keyCache[123] = "f12";
+    },
+
+    /**
+     * Get the key name from a native keyboard event
+     *
+     * @method _keyFromEvent
+     * @private
+     * @param {KeyboardEvent} event The keyboard event
+     * @return {String}
+     */
+    _keyFromEvent: function (keyboardEvent) {
+        var key = this.__keyCache[keyboardEvent.keyCode];
+        if (!key) {
+            key = keyboardEvent.key;
+            this.__keyCache[keyboardEvent.keyCode] = key;
+        }
+        return key;
+    },
+
+    //////////////////////////////////////////
+    // Internal Events Callbacks            //
+    //////////////////////////////////////////
+
+    /**
+     * Used to grab all keyboard events
+     *
+     * @method __onDocumentKeyDown
+     * @private
+     * @param event
+     */
+    __onDocumentKeyDown: function (event) {
+        if (!this._checkEvent(event)) {
+            return;
+        }
+
+        this._action = (this.__keys[event.keyCode]) ? "key-hold" : "key-down";
+        this.__keys[event.keyCode] = true;
+        this._callCallbacks(this._action, [this._dump()]);
+
+        if (!this._noPreventDefault) {
+            event.stopPropagation();
+            event.preventDefault();
+        }
+    },
+
+    /**
+     * Used to grab all keyboard events
+     *
+     * @method __onDocumentKeyUp
+     * @private
+     * @param event
+     */
+    __onDocumentKeyUp: function (event) {
+        if (!this._checkEvent(event) || !this.__keys[event.keyCode]) {
+            return;
+        }
+
+        this._action = "key-up";
+        delete this.__keys[event.keyCode];
+        this._callCallbacks(this._action, [this._dump()]);
+
+        if (!this._noPreventDefault) {
+            event.stopPropagation();
+            event.preventDefault();
+        }
+    },
+
+    /**
+     * Called when the window loose focus
+     *
+     * @method __onWindowBlur
+     * @private
+     */
+    __onWindowBlur: function () {
+        this._action = "key-up";
+        this._event = undefined;
+
+        for (var keyCode in this.__keys) {
+            delete this.__keys[keyCode];
+            this.__key = this.__keyCache[keyCode];
+            this._callCallbacks(this._action, [this._dump()]);
+        }
+    }
+});
+
+module.exports = KeyboardManager;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_nonvisual_mousemanager.js.html b/ref/files/src_nonvisual_mousemanager.js.html new file mode 100644 index 00000000..7ee1abef --- /dev/null +++ b/ref/files/src_nonvisual_mousemanager.js.html @@ -0,0 +1,906 @@ + + + + + src/nonvisual/mousemanager.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/nonvisual/mousemanager.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule NonVisual
+ * @namespace photonui
+ */
+
+var Helpers = require("../helpers.js");
+var Base = require("../base.js");
+var Widget = require("../widget.js");
+
+/**
+ * Manage advanced mouse events on Widgets or HTMLElements.
+ *
+ * wEvents:
+ *
+ *   * mouse-event:
+ *      - description: Called for *ALL* mouse events.
+ *      - callback:    function(manager, mstate)
+ *
+ *   * mouse-down:
+ *      - description: Mouse button pressed.
+ *      - callback:    function(manager, mstate)
+ *
+ *   * mouse-up:
+ *      - description: Mouse button released.
+ *      - callback:    function(manager, mstate)
+ *
+ *   * click:
+ *      - description: Click...
+ *      - callback:    function(manager, mstate)
+ *
+ *   * double-click:
+ *      - description: Double click...
+ *      - callback:    function(manager, mstate)
+ *
+ *   * drag-start:
+ *      - description: Start dragging.
+ *      - callback:    function(manager, mstate)
+ *
+ *   * dragging:
+ *      - description: dragging.
+ *      - callback:    function(manager, mstate)
+ *
+ *   * drag-end:
+ *      - description: Stop dragging.
+ *      - callback:    function(manager, mstate)
+ *
+ *   * mouse-move:
+ *      - description: Mouse move on the element.
+ *      - callback:    function(manager, mstate)
+ *
+ *   * scroll-up:
+ *      - description: Scroll up.
+ *      - callback:    function(manager, mstate)
+ *
+ *   * scroll-down:
+ *      - description: Scroll down.
+ *      - callback:    function(manager, mstate)
+ *
+ *
+ * mstate:
+ *
+ *   A snapshot of the mouse state ath the moment when the event occured.
+ *
+ *     {
+ *         event: <Object>,       // The original js event
+ *         action: <String>,      // The event name (mouse-down/up/move, click, double-click,
+ *                                //    drag-start/end, dragging, scroll-up/down)
+ *         pageX: <Number>,       // X position, relative to page top-left corner.
+ *         pageY: <Number>,       // Y position, relative to page top-left corner.
+ *         x: <Number>,           // X position, relative to the HTML element.
+ *         y: <Number>,           // Y position, relative to the HTML element.
+ *         deltaX: <Number>,      // Delta X (current_x - previous_x)
+ *         deltaY: <Number>,      // Delta Y (current_y - previous_y)
+ *         btnLeft: <Boolean>,    // Current state of the mouse left button.
+ *         btnMiddle: <Boolean>,  // Current state of the mouse middle button.
+ *         btnRight: <Boolean>,   // Current state of the mouse right button.
+ *         button: <String>       // The button that triggered the last event (none, "left", "middle", "right").
+ *     }
+ *
+ * @class MouseManager
+ * @constructor
+ * @extends photonui.Base
+ * @param {photonui.Widget} element Any PhotonUI Widget (optional).
+ * @param {HTMLElement} element Any HTML element (optional).
+ * @param {Object} params additional params (optional).
+ */
+var MouseManager = Base.$extend({
+
+    // Constructor
+    __init__: function (element, params) {
+        this._registerWEvents([
+            "mouse-event", "mouse-down", "mouse-up", "click", "double-click",
+            "drag-start", "dragging", "drag-end", "mouse-move", "scroll-up",
+            "scroll-down"
+        ]);
+        if (element && (element instanceof Widget || element instanceof HTMLElement)) {
+            this.$super(params);
+            this.element = element;
+        } else {
+            this.$super(element);
+        }
+    },
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    /**
+     * The HTML Element on which the events are binded.
+     *
+     * NOTE: If a photonui.Widget object is assigned to this property,
+     *       its HTML Element will be automatically assigned to the property instead.
+     *
+     * @property element
+     * @type HTMLElement
+     * @default null
+     */
+    _element: null,
+
+    getElement: function () {
+        return this._element || document;
+    },
+
+    setElement: function (element) {
+        if (element instanceof Widget) {
+            this._element = element.interactiveNode || element.html;
+        } else if (element instanceof HTMLElement) {
+            this._element = element;
+        } else {
+            this._element = null;
+        }
+        this._updateEvents();
+    },
+
+    /**
+     * Minimum distance for triggering a drag-start, and maximum distance
+     * to consider a mouse down/up as a click.
+     *
+     * @property threshold
+     * @type Number
+     * @default 5
+     */
+    _threshold: 5,
+
+    getThreshold: function () {
+        return this._threshold;
+    },
+
+    setThreshold: function (threshold) {
+        this._threshold = threshold;
+    },
+
+    /**
+     * Scale all position events by a factor. Use it when the canvas is scaled.
+     *
+     * @property scaleX
+     * @type Number
+     * @default 1
+     */
+    _scaleX: 1,
+
+    getScaleX: function () {
+        return this._scaleX;
+    },
+
+    setScaleX: function (scaleX) {
+        this._scaleX = scaleX;
+    },
+
+    /**
+     * Scale all position events by a factor. Use it when the canvas is scaled.
+     *
+     * @property scaleY
+     * @type Number
+     * @default 1
+     */
+    _scaleY: 1,
+
+    getScaleY: function () {
+        return this._scaleY;
+    },
+
+    setScaleY: function (scaleY) {
+        this._scaleY = scaleY;
+    },
+
+    /**
+     * Translate all position events by a scalar. Use it when the canvas is translated.
+     *
+     * @property translateX
+     * @type Number
+     * @default 0
+     */
+    _translateX: 0,
+
+    getTranslateX: function () {
+        return this._translateX;
+    },
+
+    setTranslateX: function (translateX) {
+        this._translateX = translateX;
+    },
+
+    /**
+     * Translate all position events by a scalar. Use it when the canvas is translated.
+     *
+     * @property translateY
+     * @type Number
+     * @default 0
+     */
+    _translateY: 0,
+
+    getTranslateY: function () {
+        return this._translateY;
+    },
+
+    setTranslateY: function (translateY) {
+        this._translateY = translateY;
+    },
+
+    /**
+     * X position, relative to page top-left corner.
+     *
+     * @property pageX
+     * @readOnly
+     * @type Number
+     * @default 0
+     */
+    getPageX: function () {
+        return this.__event.pageX || 0;
+    },
+
+    /**
+     * Y position, relative to page top-left corner.
+     *
+     * @property pageY
+     * @readOnly
+     * @type Number
+     * @default 0
+     */
+    getPageY: function () {
+        return this.__event.pageY || 0;
+    },
+
+    /**
+     * X position, relative to the HTML element.
+     *
+     * @property x
+     * @readOnly
+     * @type Number
+     */
+    getX: function () {
+        var ex = Helpers.getAbsolutePosition(this.element).x;
+        return (this.pageX - ex) * this.scaleX + this.translateX;
+    },
+
+    /**
+     * Y position, relative to the HTML element.
+     *
+     * @property y
+     * @readOnly
+     * @type Number
+     */
+    getY: function () {
+        var ey = Helpers.getAbsolutePosition(this.element).y;
+        return (this.pageY - ey) * this.scaleY + this.translateY;
+    },
+
+    /**
+     * Delta X (current_x - previous_x).
+     *
+     * @property deltaX
+     * @readOnly
+     * @type Number
+     */
+    getDeltaX: function () {
+        return (this.pageX - ((this.__prevState.pageX !== undefined) ?
+            this.__prevState.pageX : this.pageX)) * this.scaleX;
+    },
+
+    /**
+     * Delta Y (current_y - previous_y).
+     *
+     * @property deltaY
+     * @readOnly
+     * @type Number
+     */
+    getDeltaY: function () {
+        return (this.pageY - ((this.__prevState.pageY !== undefined) ?
+            this.__prevState.pageY : this.pageY)) * this.scaleY;
+    },
+
+    /**
+     * The action:
+     *
+     *   * "mouse-down"
+     *   * "moues-up"
+     *   * "click"
+     *   * "double-click"
+     *   * "drag-start"
+     *   * "dragging"
+     *   * "drag-end"
+     *   * "scroll-down"
+     *   * "scroll-up"
+     *   * "mouse-move"
+     *
+     * @property action
+     * @readOnly
+     * @type String
+     */
+    _action: "",
+
+    getAction: function () {
+        return this._action;
+    },
+
+    /**
+     * Current state of the mouse left button.
+     *
+     * @property btnLeft
+     * @type Boolean
+     * @readOnly
+     */
+    _btnLeft: false,
+
+    getBtnLeft: function () {
+        return this._btnLeft;
+    },
+
+    /**
+     * Current state of the mouse middle button.
+     *
+     * @property btnMiddle
+     * @type Boolean
+     * @readOnly
+     */
+    _btnMiddle: false,
+
+    getBtnMiddle: function () {
+        return this._btnMiddle;
+    },
+
+    /**
+     * Current state of the mouse right button.
+     *
+     * @property btnRight
+     * @type Boolean
+     * @readOnly
+     */
+    _btnRight: false,
+
+    getBtnRight: function () {
+        return this._btnRight;
+    },
+
+    /**
+     * The button that triggered the last event.
+     *
+     *   * none
+     *   * "left"
+     *   * "middle"
+     *   * "right"
+     *
+     * @property button
+     * @readOnly
+     * @type String
+     */
+    _button: null,
+
+    getButton: function () {
+        return this._button;
+    },
+
+    // ====== Private properties ======
+
+    /**
+     * Previous state.
+     *
+     * @property __prevState
+     * @private
+     * @type Object
+     */
+    __prevState: {},
+
+    /**
+     * Js event on mouse down.
+     *
+     * @property __mouseDownEvent
+     * @private
+     * @type Object
+     */
+    __mouseDownEvent: {},
+
+    /**
+     * Last event object.
+     *
+     * @property __event
+     * @private
+     * @type Object
+     * @default {}
+     */
+    __event: {},
+
+    /**
+     * The button that triggered the drag start event
+     *
+     *   * null
+     *   * "left"
+     *   * "middle"
+     *   * "right"
+     *
+     * @property __dragStartButton
+     * @private
+     * @type String
+     * @default null
+     */
+    __dragStartButton: null,
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    /**
+     * Bind events on the HTML Element.
+     *
+     * @method _updateEvents
+     * @private
+     */
+    _updateEvents: function () {
+        // Unbind all existing events
+        for (var id in this.__events) {
+            this._unbindEvent(id);
+        }
+        // Check if we have an html element
+        if (!this.element) {
+            return;
+        }
+        // Bind new events
+        this._bindEvent("mouse-down", this.element, "mousedown", this.__onMouseDown.bind(this));
+        this._bindEvent("mouse-up", this.element, "mouseup", this.__onMouseUp.bind(this));
+        this._bindEvent("double-click", this.element, "dblclick", this.__onDoubleClick.bind(this));
+        this._bindEvent("mouse-move", this.element, "mousemove", this.__onMouseMove.bind(this));
+        this._bindEvent("wheel", this.element, "wheel", this.__onWheel.bind(this));
+
+        this._bindEvent("document-mouse-up", document, "mouseup", this.__onDocumentMouseUp.bind(this));
+        this._bindEvent("document-mouse-move", document, "mousemove", this.__onDocumentMouseMove.bind(this));
+    },
+
+    /**
+     * Take a snapshot of the MouseManager
+     *
+     * @method _dump
+     * @private
+     * @return {Object}
+     */
+    _dump: function () {
+        return {
+            event: this.__event,
+            action: this.action,
+            pageX: this.pageX,
+            pageY: this.pageY,
+            x: this.x,
+            y: this.y,
+            deltaX: this.deltaX,
+            deltaY: this.deltaY,
+            btnLeft: this.btnLeft,
+            btnMiddle: this.btnMiddle,
+            btnRight: this.btnRight,
+            button: this.button
+        };
+    },
+
+    /**
+     * Analyze and dispatche wEvents.
+     *
+     * @method _stateMachine
+     * @private
+     * @param {String} action The action name (e.g. "mouse-up").
+     * @param {Object} event The js event.
+     */
+    _stateMachine: function (action, event) {
+        // Save the previous state
+        this.__prevState = this._dump();
+
+        // Load the current state
+        this._action = action;
+        this.__event = event;
+        this._button = null;
+        if (this.__dragStartButton) {
+            this._button = this.__dragStartButton;
+        } else if (event.button === 0) {
+            this._button = "left";
+        } else if (event.button === 1) {
+            this._button = "middle";
+        } else if (event.button === 2) {
+            this._button = "right";
+        }
+
+        // Analyze the event
+
+        // Mouse Down / Mouse Up
+        if (action == "mouse-down") {
+            this.__mouseDownEvent = event;
+
+            if (event.button === 0) {
+                this._btnLeft = true;
+            }
+            if (event.button === 1) {
+                this._btnMiddle = true;
+            }
+            if (event.button === 2) {
+                this._btnRight = true;
+            }
+
+            this._callCallbacks("mouse-event", [this._dump()]);
+            this._callCallbacks(this.action, [this._dump()]);
+        } else if (action == "mouse-up") {
+            if (event.button === 0) {
+                this._btnLeft = false;
+            }
+            if (event.button === 1) {
+                this._btnMiddle = false;
+            }
+            if (event.button === 2) {
+                this._btnRight = false;
+            }
+
+            this._callCallbacks("mouse-event", [this._dump()]);
+            this._callCallbacks(this.action, [this._dump()]);
+        } else if (action == "drag-end") {
+            if (event.button === 0) {
+                this._btnLeft = false;
+            }
+            if (event.button === 1) {
+                this._btnMiddle = false;
+            }
+            if (event.button === 2) {
+                this._btnRight = false;
+            }
+        }
+
+        // Click
+        if (action == "mouse-up" && (Math.abs(this.pageX - this.__mouseDownEvent.pageX) <= this._threshold &&
+            Math.abs(this.pageY - this.__mouseDownEvent.pageY) <= this._threshold)) {
+            this._action = "click";
+            this._callCallbacks("mouse-event", [this._dump()]);
+            this._callCallbacks("click", [this._dump()]);
+        }
+
+        // Double Click
+        if (action == "double-click" && this.__prevState.action == "click") {
+            this._action = "double-click";
+            this._callCallbacks("mouse-event", [this._dump()]);
+            this._callCallbacks(this.action, [this._dump()]);
+        }
+
+        // Mouse move
+        if (action == "mouse-move") {
+            this._callCallbacks("mouse-event", [this._dump()]);
+            this._callCallbacks(this.action, [this._dump()]);
+        }
+
+        // Drag Start
+        if (action == "mouse-move" && this.__prevState.action != "drag-start" &&
+            this.__prevState.action != "dragging" && (this.btnLeft || this.btnMiddle || this.btnRight)) {
+            if (Math.abs(this.pageX - this.__mouseDownEvent.pageX) > this._threshold ||
+                Math.abs(this.pageY - this.__mouseDownEvent.pageY) > this._threshold) {
+                this.__dragStartButton = this._button;
+                // Drag Start
+                this._action = "drag-start";
+                this.__event = this.__mouseDownEvent;
+                this._callCallbacks("mouse-event", [this._dump()]);
+                this._callCallbacks(this.action, [this._dump()]);
+                // Dragging
+                this._action = "dragging";
+                this.__prevState.event = this.__mouseDownEvent;
+                this.__event = event;
+                this._callCallbacks("mouse-event", [this._dump()]);
+                this._callCallbacks(this.action, [this._dump()]);
+            }
+
+        // Dragging
+        } else if (action == "dragging" || (action == "mouse-move" && (this.__prevState.action == "drag-start" ||
+                 this.__prevState.action == "dragging") && (this.btnLeft || this.btnMiddle || this.btnRight))) {
+            this._action = "dragging";
+            this._callCallbacks("mouse-event", [this._dump()]);
+            this._callCallbacks(this.action, [this._dump()]);
+
+        // Drag End
+        } else if (action == "drag-end" || (action == "mouse-up" && (this.__prevState.action == "dragging" ||
+                 this.__prevState.action == "drag-start") && !(this.btnLeft || this.btnMiddle || this.btnRight))) {
+            this._action = "drag-end";
+            this.__dragStartButton = null;
+            this._callCallbacks("mouse-event", [this._dump()]);
+            this._callCallbacks(this.action, [this._dump()]);
+        }
+
+        // Scroll Up / Scroll Down
+        if (action == "scroll-up" || action == "scroll-down") {
+            this._callCallbacks("mouse-event", [this._dump()]);
+            this._callCallbacks(this.action, [this._dump()]);
+        }
+    },
+
+    //////////////////////////////////////////
+    // Internal Events Callbacks            //
+    //////////////////////////////////////////
+
+    /**
+     * @method __onMouseDown
+     * @private
+     * @param event
+     */
+    __onMouseDown: function (event) {
+        this._stateMachine("mouse-down", event);
+    },
+
+    /**
+     * @method __onMouseUp
+     * @private
+     * @param event
+     */
+    __onMouseUp: function (event) {
+        this._stateMachine("mouse-up", event);
+    },
+
+    /**
+     * @method __onDoubleClick
+     * @private
+     * @param event
+     */
+    __onDoubleClick: function (event) {
+        this._stateMachine("double-click", event);
+    },
+
+    /**
+     * @method __onMouseMove
+     * @private
+     * @param event
+     */
+    __onMouseMove: function (event) {
+        this._stateMachine("mouse-move", event);
+    },
+
+    /**
+     * Used to detect drag-end outside the element.
+     *
+     * @method __onDocumentMouseUp
+     * @private
+     * @param event
+     */
+    __onDocumentMouseUp: function (event) {
+        if (event.target === this._element) {
+            return;
+        }
+        if (this.action == "dragging" || this.action == "drag-start") {
+            this._stateMachine("drag-end", event);
+        } else if (event.button === 0 && this._btnLeft ||
+            event.button === 1 && this._btnMiddle ||
+            event.button === 2 && this._btnRight) {
+
+            this._stateMachine("mouse-up", event);
+        }
+    },
+
+    /**
+     * Used to detect dragging outside the element.
+     *
+     * @method __onDocumentMouseMove
+     * @private
+     * @param event
+     */
+    __onDocumentMouseMove: function (event) {
+        if (event.target === this._element) {
+            return;
+        }
+        if (this.action == "dragging" || this.action == "drag-start") {
+            this._stateMachine("dragging", event);
+        }
+    },
+
+    /**
+     * @method __onWheel
+     * @private
+     * @param event
+     */
+    __onWheel: function (event) {
+        var wheelDelta = null;
+
+        if (event.deltaY !== undefined) {
+            wheelDelta = -event.deltaY;
+        }
+
+        if (wheelDelta !== null) {
+            if (wheelDelta >= 0) {
+                this._stateMachine("scroll-up", event);
+            } else {
+                this._stateMachine("scroll-down", event);
+            }
+        }
+    }
+});
+
+module.exports = MouseManager;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_nonvisual_spritesheet.js.html b/ref/files/src_nonvisual_spritesheet.js.html new file mode 100644 index 00000000..f284ebbb --- /dev/null +++ b/ref/files/src_nonvisual_spritesheet.js.html @@ -0,0 +1,391 @@ + + + + + src/nonvisual/spritesheet.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/nonvisual/spritesheet.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule NonVisual
+ * @namespace photonui
+ */
+
+var Base = require("../base.js");
+
+var _spritesheets = {};
+
+/**
+ * Sprite sheet (to use with SpriteIcon).
+ *
+ * @class SpriteSheet
+ * @constructor
+ * @extends photonui.Base
+ */
+var SpriteSheet = Base.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        this._icons = {};
+        this.$super(params);
+    },
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    /**
+     * The spritesheet name.
+     *
+     * @property name
+     * @type String
+     * @default "default"
+     */
+    _name: "default",
+
+    getName: function () {
+        "@photonui-update";
+        return this._name;
+    },
+
+    setName: function (name) {
+        if (_spritesheets[this.name] == this) {
+            delete _spritesheets[this.name];
+        }
+        this._name = name;
+        _spritesheets[this.name] = this;
+    },
+
+    /**
+     * The spritesheet image URL.
+     *
+     * @property imageUrl
+     * @type String
+     * @default null
+     */
+    _imageUrl: null,
+
+    getImageUrl: function () {
+        return this._imageUrl;
+    },
+
+    setImageUrl: function (url) {
+        if (!url) {
+            this._imageUrl = null;
+            return;
+        }
+        if (this._imageUrl != url) {
+            this._imageUrl = url;
+            // Preload
+            var img = new Image();
+            img.src = url;
+        }
+    },
+
+    /**
+     * Icon size (width = height).
+     *
+     * @property size
+     * @type Number
+     * @default 16
+     */
+    _size: 16,
+
+    getSize: function () {
+        return this._size;
+    },
+
+    setSize: function (size) {
+        this._size = size;
+    },
+
+    /**
+     * Icons.
+     *
+     *     {
+     *          "iconName": [x, y],
+     *          "icon2": [x2, y2],
+     *          ...
+     *     }
+     *
+     * @property icons
+     * @type Object
+     * @default: {}
+     */
+    _icons: {},
+
+    getIcons: function () {
+        return this._icons;
+    },
+
+    setIcons: function (icons) {
+        for (var icon in icons) {
+            this._icons[icon] = icons[icon];
+        }
+    },
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Public methods ======
+
+    /**
+     * Get icon position.
+     *
+     * @method getIconPosition
+     * @param {String} iconName
+     * @return {Object} `{x: Number, y: Number}`
+     */
+    getIconPosition: function (iconName) {
+        return {x: this.icons[iconName][0], y: this.icons[iconName][1]};
+    },
+
+    /**
+     * Get the right CSS for the given icon.
+     *
+     * @method getIconCss
+     * @param {String} iconName
+     * @return {String} the CSS.
+     */
+    getIconCss: function (iconName) {
+        return "width: "      + this.size + "px; " +
+               "height: "     + this.size + "px; " +
+               "background: " + "url(" + this.imageUrl + ") " +
+                                "-" + this.getIconPosition(iconName).x + "px " +
+                                "-" + this.getIconPosition(iconName).y + "px;" ;
+    },
+
+    /**
+     * Add an icon (set its position).
+     *
+     * @method addIcon
+     * @param {String} iconName
+     * @param {Number} x
+     * @param {Number} y
+     */
+    addIcon: function (iconName, x, y) {
+        this.icons = {iconName: [x, y]};
+    },
+
+    /**
+     * Remove an icon.
+     *
+     * @method removeIcon
+     * @param {String} iconName
+     */
+    removeIcon: function (iconName) {
+        delete this._icons[iconName];
+    }
+});
+
+/*
+ * Get a sprite sheet.
+ *
+ * @method getSpriteSheet
+ * @param {String} name The sprite sheet name.
+ *
+ * @return {photonui.SpriteSheet} The sprite sheet or null.
+ */
+SpriteSheet.getSpriteSheet = function (name) {
+    if (_spritesheets[name] !== undefined) {
+        return _spritesheets[name];
+    }
+    return null;
+};
+
+module.exports = SpriteSheet;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_nonvisual_translation.js.html b/ref/files/src_nonvisual_translation.js.html new file mode 100644 index 00000000..ace88ff3 --- /dev/null +++ b/ref/files/src_nonvisual_translation.js.html @@ -0,0 +1,340 @@ + + + + + src/nonvisual/translation.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/nonvisual/translation.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule NonVisual
+ * @namespace photonui
+ */
+
+var Stone = require("stonejs");
+var Base = require("../base.js");
+
+/**
+ * A wrapper around Stone.js to fire locale events to widgets.
+ *
+ * Documentation: https://github.com/flozz/stone.js/blob/master/README.md
+ *
+ * NOTE: When you instantiate the translation widget, you can pass to it
+ * the `noGlobal` option to avoid the creation of the global `window._` function.
+ *
+ * wEvents:
+ *
+ *   * locale-changed:
+ *      - description: The locale changed.
+ *      - callback:    function(widget, locale)
+ *
+ * @class Translation
+ * @constructor
+ * @extends photonui.Base
+ * @param {Object} params An object that can contain any property of the widget (optional).
+ */
+var Translation = Base.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        params = params || {};
+        this._registerWEvents(["locale-changed"]);
+        this.$super(params);
+        this._bindEvent("locale-changed", document, "stonejs-locale-changed", this.__onStonejsLocaleChanged.bind(this));
+        if (!params.noGlobal) {
+            window._ = this.lazyGettext;
+        }
+    },
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    /**
+     * The current locale (e.g. "fr", "en", "it",...).
+     *
+     * @property locale
+     * @type String
+     * @default null
+     */
+    getLocale: Stone.getLocale,
+    setLocale: Stone.setLocale,
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Public methods ======
+
+    /**
+     * Find and set the best language for the user (depending on available catalogs and given language list).
+     *
+     * @method setBestMatchingLocale
+     * @param {Array|String} locales Language list (optional, e.g. `"fr"`, `["fr", "fr_FR", "en_US"]`).
+     */
+    setBestMatchingLocale: Stone.setBestMatchingLocale,
+
+    /**
+     * Add one or more Stone.js catalog (a catalog contain all translated strings for a specific locale).
+     *
+     * @method addCatalogs
+     * @param {Object} catalogs
+     */
+    addCatalogs: Stone.addCatalogs,
+
+    /**
+     * Guess the user language.
+     *
+     * @method guessUserLanguage
+     * @return {String} The language code (e.g. "en", "fr", "it",...)
+     */
+    guessUserLanguage: Stone.guessUserLanguage,
+
+    /**
+     * Make a string translatable.
+     *
+     * @method gettext
+     * @param {String} string the Translatable string
+     * @param {Object} replacements An object that contain replacements for the string.
+     * @return {String}
+     */
+    gettext: Stone.gettext,
+
+    /**
+     * Make a string translatable.
+     *
+     * The main difference between this method and the `gettext` method is
+     * that this method does not return a translated sting but an object that
+     * will translate the sting when it will be displayed (.toString() method
+     * called).
+     *
+     * @method lazyGettext
+     * @param {String} string the Translatable string
+     * @param {Object} replacements An object that contain replacements for the string.
+     * @return {LazyString}
+     */
+    lazyGettext: Stone.lazyGettext,
+
+    /**
+     * Enable/disable Stone.js translating elements with the "stonejs" attribute in the DOM.
+     *
+     * @method enableDomScan
+     * @param {Boolean} boolean Enable or disable DOM scanning.
+     */
+    enableDomScan: Stone.enableDomScan,
+
+    /**
+     * Re-translate elements with the "stonejs" attribute in the DOM.
+     *
+     * @method updateDomTranslation
+     */
+    updateDomTranslation: Stone.updateDomTranslation,
+
+    //////////////////////////////////////////
+    // Internal Events Callbacks            //
+    //////////////////////////////////////////
+
+    /**
+     * @method __onStonejsLocaleChanged
+     * @private
+     */
+    __onStonejsLocaleChanged: function () {
+        this._callCallbacks("locale-changed", [this.locale]);
+    }
+});
+
+module.exports = Translation;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_photonui.js.html b/ref/files/src_photonui.js.html new file mode 100644 index 00000000..374cbc07 --- /dev/null +++ b/ref/files/src_photonui.js.html @@ -0,0 +1,284 @@ + + + + + src/photonui.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/photonui.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @main PhotonUI
+ * @namespace photonui
+ */
+
+var photonui = {};
+
+// Include libraries in module.
+photonui.lib = {};
+photonui.lib.Class = require("abitbol");
+photonui.lib.KeyboardJS = require("keyboardjs");
+photonui.lib.Stone = require("stonejs");
+photonui.lib.uuid = require("uuid");
+photonui.lib.lodash = require("lodash");
+
+// Base
+photonui.Helpers = require("./helpers.js");
+photonui.Base = require("./base.js");
+photonui.Widget = require("./widget.js");
+
+// Methods
+photonui.domInsert = photonui.Widget.domInsert;
+photonui.getWidget = photonui.Widget.getWidget;
+
+// Widgets
+photonui.FileManager = require("./nonvisual/filemanager.js");
+photonui.Translation = require("./nonvisual/translation.js");
+photonui.AccelManager = require("./nonvisual/accelmanager.js");
+photonui.KeyboardManager = require("./nonvisual/keyboardmanager.js");
+photonui.MouseManager = require("./nonvisual/mousemanager.js");
+photonui.BaseIcon = require("./visual/baseicon.js");
+photonui.FAIcon = require("./visual/faicon.js");
+photonui.Image = require("./visual/image.js");
+photonui.SpriteSheet = require("./nonvisual/spritesheet.js");
+photonui.SpriteIcon = require("./visual/spriteicon.js");
+photonui.Canvas = require("./visual/canvas.js");
+photonui.Label = require("./visual/label.js");
+photonui.Text = require("./visual/text.js");
+photonui.ProgressBar = require("./visual/progressbar.js");
+photonui.Separator = require("./visual/separator.js");
+photonui.Button = require("./interactive/button.js");
+photonui.ColorButton = require("./composite/colorbutton.js");
+photonui.CheckBox = require("./interactive/checkbox.js");
+photonui.Switch = require("./interactive/switch.js");
+photonui.ToggleButton = require("./interactive/togglebutton.js");
+photonui.Color = require("./nonvisual/color.js");
+photonui.ColorPalette = require("./interactive/colorpalette.js");
+photonui.ColorPicker = require("./interactive/colorpicker.js");
+photonui.Field = require("./interactive/field.js");
+photonui.NumericField = require("./interactive/numericfield.js");
+photonui.TextAreaField = require("./interactive/textareafield.js");
+photonui.TextField = require("./interactive/textfield.js");
+photonui.Select = require("./composite/select.js");
+photonui.FontSelect = require("./composite/fontselect.js");
+photonui.Slider = require("./interactive/slider.js");
+photonui.Container = require("./container/container.js");
+photonui.Layout = require("./layout/layout.js");
+photonui.BoxLayout = require("./layout/boxlayout.js");
+photonui.FluidLayout = require("./layout/fluidlayout.js");
+photonui.GridLayout = require("./layout/gridlayout.js");
+photonui.Menu = require("./layout/menu.js");
+photonui.MenuItem = require("./container/menuitem.js");
+photonui.SubMenuItem = require("./container/submenuitem.js");
+photonui.Viewport = require("./container/viewport.js");
+photonui.BaseWindow = require("./container/basewindow.js");
+photonui.Window = require("./container/window.js");
+photonui.PopupWindow = require("./container/popupwindow.js");
+photonui.Dialog = require("./container/dialog.js");
+photonui.Expander = require("./container/expander.js");
+photonui.ColorPickerDialog = require("./composite/colorpickerdialog.js");
+photonui.PopupMenu = require("./composite/popupmenu.js");
+photonui.TabItem = require("./container/tabitem.js");
+photonui.TabLayout = require("./layout/tablayout.js");
+photonui.IconButton = require("./interactive/iconbutton.js");
+photonui.Template = require("./visual/template.js");
+photonui.DataView = require("./dataview/dataview.js");
+photonui.FluidView = require("./dataview/fluidview.js");
+photonui.ListView = require("./dataview/listview.js");
+photonui.TableView = require("./dataview/tableview.js");
+photonui.IconView = require("./dataview/iconview.js");
+// [generator]
+// DO NOT MODIFY/REMOVE THE PREVIOUS COMMENT, IT IS USED BY THE WIDGET GENERATOR!
+
+module.exports = photonui;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_visual_baseicon.js.html b/ref/files/src_visual_baseicon.js.html new file mode 100644 index 00000000..5bc19470 --- /dev/null +++ b/ref/files/src_visual_baseicon.js.html @@ -0,0 +1,233 @@ + + + + + src/visual/baseicon.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/visual/baseicon.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule Visual
+ * @namespace photonui
+ */
+
+var Widget = require("../widget.js");
+
+/**
+ * Base class for icons.
+ *
+ * @class BaseIcon
+ * @constructor
+ * @extends photonui.Widget
+ */
+var BaseIcon = Widget.$extend({
+
+    //////////////////////////////////////////
+    // Internal Events Callbacks            //
+    //////////////////////////////////////////
+
+    /**
+     * Called when the locale is changed.
+     *
+     * @method __onLocaleChanged
+     * @private
+     */
+    __onLocaleChanged: function () {
+        // pass
+    }
+
+});
+
+module.exports = BaseIcon;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_visual_canvas.js.html b/ref/files/src_visual_canvas.js.html new file mode 100644 index 00000000..a1184675 --- /dev/null +++ b/ref/files/src_visual_canvas.js.html @@ -0,0 +1,446 @@ + + + + + src/visual/canvas.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/visual/canvas.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule Visual
+ * @namespace photonui
+ */
+
+var Widget = require("../widget.js");
+
+/**
+ * Canvas.
+ *
+ * @class Canvas
+ * @constructor
+ * @extends photonui.Widget
+ * @param {Object} params An object that can contain any property of the widget (optional).
+ */
+var Canvas = Widget.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        this.$super(params);
+
+        // --- Canvas methods proxies ---
+
+        /**
+         * Returns a drawing context on the canvas.
+         *
+         * Proxy of the native canvas method. For more informations see:
+         *
+         *   * https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement
+         *
+         * @method getContext
+         * @param {String} contextId
+         * @return The drawing context.
+         */
+        this.getContext = this.__html.canvas.getContext.bind(this.__html.canvas);
+
+        /**
+         * Indicate if the given context is supported by this canvas.
+         *
+         * Proxy of the native canvas method if exists. For more informations see:
+         *
+         *   * https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement
+         *
+         * @method supportsContext
+         * @param {String} contextId
+         * @return {Boolean}
+         */
+        if (this.__html.canvas.supportsContext) {
+            this.supportsContext = this.__html.canvas.supportsContext.bind(this.__html.canvas);
+        }
+
+        /**
+         * Changes the context the element is related to to the given one.
+         *
+         * Proxy of the native canvas method if exists. For more informations see:
+         *
+         *   * https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement
+         *
+         * @method setContext
+         * @param {String} contextId
+         */
+        if (this.__html.canvas.setContext) {
+            this.setContext = this.__html.canvas.setContext.bind(this.__html.canvas);
+        }
+
+        /**
+         * Gives back a proxy to allow the canvas to be used in another Worker.
+         *
+         * Proxy of the native canvas method if exists. For more informations see:
+         *
+         *   * https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement
+         *
+         * @method transferControlToProxy
+         */
+        if (this.__html.canvas.transferControlToProxy) {
+            this.transferControlToProxy = this.__html.canvas.transferControlToProxy.bind(this.__html.canvas);
+        }
+
+        /**
+         * Returns a "data:" URL containing a representation of the image (at 96dpi).
+         *
+         * Proxy of the native canvas method. For more informations see:
+         *
+         *   * https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement
+         *
+         * @method toDataURL
+         * @param {String} type The image format (optional, e.g: "image/png", "image/jpeg",..., default="image/png")
+         * @return {String} The data URL
+         */
+        this.toDataURL = this.__html.canvas.toDataURL.bind(this.__html.canvas);
+
+        /**
+         * Returns a "data:" URL containing a representation of the image (at the native resolution of the canvas).
+         *
+         * Proxy of the native canvas method if exists. For more informations see:
+         *
+         *   * https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement
+         *
+         * @method toDataURLHD
+         * @param {String} type The image format (optional, e.g: "image/png", "image/jpeg",..., default="image/png")
+         * @return {String} The data URL
+         */
+        if (this.__html.canvas.toDataURLHD) {
+            this.toDataURLHD = this.__html.canvas.toDataURLHD.bind(this.__html.canvas);
+        }
+
+        /**
+         * Returns a Blob object representing the image contained in the canvas (at 96dpi).
+         *
+         * Proxy of the native canvas method if exists. For more informations see:
+         *
+         *   * https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement
+         *
+         * @method toBlob
+         * @param {String} type The image format (optional, e.g: "image/png", "image/jpeg",..., default="image/png")
+         * @return {Blob}
+         */
+        if (this.__html.canvas.toBlob) {
+            this.toBlob = this.__html.canvas.toBlob.bind(this.__html.canvas);
+        }
+
+        /**
+         * Returns a Blob object representing the image contained in the canvas (at the native
+         * resolution of the canvas).
+         *
+         * Proxy of the native canvas method if exists. For more informations see:
+         *
+         *   * https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement
+         *
+         * @method toBlobHD
+         * @param {String} type The image format (optional, e.g: "image/png", "image/jpeg",..., default="image/png")
+         * @return {Blob}
+         */
+        if (this.__html.canvas.toBlobHD) {
+            this.toBlobHD = this.__html.canvas.toBlobHD.bind(this.__html.canvas);
+        }
+    },
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    /**
+     * Canvas width.
+     *
+     * @property width
+     * @type Number
+     * default 300
+     */
+    getWidth: function () {
+        "@photonui-update";
+        return this.__html.canvas.width;
+    },
+
+    setWidth: function (width) {
+        this.__html.canvas.width = width || 300;
+    },
+
+    /**
+     * Canvas height.
+     *
+     * @property height
+     * @type Number
+     * default 150
+     */
+    getHeight: function () {
+        "@photonui-update";
+        return this.__html.canvas.height;
+    },
+
+    setHeight: function (height) {
+        this.__html.canvas.height = height || 150;
+    },
+
+    /**
+     * The Canvas HTML Element.
+     *
+     * @property canvas
+     * @readOnly
+     * @type HTMLElement
+     */
+    getCanvas: function () {
+        return this.__html.canvas;
+    },
+
+    /**
+     * Html outer element of the widget (if any).
+     *
+     * @property html
+     * @type HTMLElement
+     * @default null
+     * @readOnly
+     */
+    getHtml: function () {
+        return this.__html.outer;
+    },
+
+    /**
+     * The interactive HTML element (for event managers).
+     *
+     * @property interactiveNode
+     * @type HTMLElement
+     * @readOnly
+     */
+    getInteractiveNode: function () {
+        return this.__html.canvas;
+    },
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Private methods ======
+
+    /**
+     * Build the widget HTML.
+     *
+     * @method _buildHtml
+     * @private
+     */
+    _buildHtml: function () {
+        this.__html.outer = document.createElement("div");
+        this.__html.outer.className = "photonui-widget photonui-canvas";
+
+        this.__html.canvas = document.createElement("canvas");
+        this.__html.outer.appendChild(this.__html.canvas);
+    },
+
+    //////////////////////////////////////////
+    // Internal Events Callbacks            //
+    //////////////////////////////////////////
+
+    /**
+     * Called when the locale is changed.
+     *
+     * @method __onLocaleChanged
+     * @private
+     */
+    __onLocaleChanged: function () {
+        // pass
+    }
+});
+
+module.exports = Canvas;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_visual_faicon.js.html b/ref/files/src_visual_faicon.js.html new file mode 100644 index 00000000..48d56a33 --- /dev/null +++ b/ref/files/src_visual_faicon.js.html @@ -0,0 +1,338 @@ + + + + + src/visual/faicon.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/visual/faicon.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule Visual
+ * @namespace photonui
+ */
+
+var BaseIcon = require("./baseicon.js");
+
+/**
+ * Font Awesome Icon.
+ *
+ * Special contructor params:
+ *
+ *      new photonui.FAIcon( {optional params...} )
+ *      new photonui.FAIcon( "iconName", {optional params...} )
+ *
+ * @class FAIcon
+ * @constructor
+ * @extends photonui.BaseIcon
+ */
+var FAIcon = BaseIcon.$extend({
+
+    // Constructor
+    __init__: function (params1, params2) {
+        var params = {};
+        if (params1 && typeof(params1) == "string") {
+            params.iconName = params1;
+            if (params2 && typeof(params2) == "object") {
+                for (var i in params2) {
+                    params[i] = params2[i];
+                }
+            }
+        } else if (params1) {
+            params = params1;
+        }
+        this.$super(params);
+    },
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    /**
+     * The Font Awesome icon name (e.g. "fa-cog").
+     *
+     * Icon list: http://fontawesome.io/icons/
+     *
+     * @property iconName
+     * @type String
+     * @default ""
+     */
+    _iconName: "",
+
+    getIconName: function () {
+        "@photonui-update";
+        return this._iconName;
+    },
+
+    setIconName: function (iconName) {
+        this._iconName = iconName || "";
+        this.__html.icon.className = "fa " + this.iconName + " " + this.size;
+    },
+
+    /**
+     * Font Awesome icon size (e.g. "fa-2x").
+     *
+     * Icon sizes list: http://fontawesome.io/examples/#larger
+     *
+     * @property size
+     * @type String
+     * @default ""
+     */
+    _size: "",
+
+    getSize: function () {
+        "@photonui-update";
+        return this._size;
+    },
+
+    setSize: function (size) {
+        this._size = size || "";
+        this.__html.icon.className = "fa " + this.iconName + " " + this.size;
+    },
+
+    /**
+     * The icon color.
+     *
+     * @property color
+     * @type String
+     * default: "inherit"
+     */
+    _color: "inherit",
+
+    getColor: function () {
+        "@photonui-update";
+        return this._color;
+    },
+
+    setColor: function (color) {
+        this._color = color || "inherit";
+        this.__html.icon.style.color = this.color;
+    },
+
+    /**
+     * Html outer element of the widget (if any).
+     *
+     * @property html
+     * @type HTMLElement
+     * @default null
+     * @readOnly
+     */
+    getHtml: function () {
+        return this.__html.outer;
+    },
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Private methods ======
+
+    /**
+     * Build the widget HTML.
+     *
+     * @method _buildHtml
+     * @private
+     */
+    _buildHtml: function () {
+        this.__html.outer = document.createElement("span");
+        this.__html.outer.className = "photonui-widget photonui-icon photonui-faicon";
+
+        this.__html.icon = document.createElement("i");
+        this.__html.outer.appendChild(this.__html.icon);
+    }
+});
+
+module.exports = FAIcon;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_visual_image.js.html b/ref/files/src_visual_image.js.html new file mode 100644 index 00000000..e0477a4d --- /dev/null +++ b/ref/files/src_visual_image.js.html @@ -0,0 +1,320 @@ + + + + + src/visual/image.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/visual/image.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Clément LEVASSEUR <https://github.com/clementlevasseur>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule Visual
+ * @namespace photonui
+ */
+
+var Widget = require("../widget.js");
+
+/**
+ * Image.
+ *
+ * @class Image
+ * @constructor
+ * @extends photonui.Widget
+ * @param {Object} params An object that can contain any property of the widget (optional).
+ */
+var Image_ = Widget.$extend({
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    /**
+     * The image URL.
+     *
+     * @property url
+     * @type String
+     * @default ""
+     */
+    _url: "",
+
+    getUrl: function () {
+        return this._url;
+    },
+
+    setUrl: function (url) {
+        this._url = url;
+        this.__html.image.src = url;
+    },
+
+    /**
+     * The image width (null = auto).
+     *
+     * @property width
+     * @type Number
+     * @default null
+     */
+    _width: null,
+
+    getWidth: function () {
+        return this._width;
+    },
+
+    setWidth: function (width) {
+        if (width !== null) {
+            this._width = width;
+            this.__html.image.width = width;
+        } else {
+            this.__html.image.width = "";
+        }
+    },
+
+    /**
+     * The image height (null = auto).
+     *
+     * @property height
+     * @type Number
+     * @default null
+     */
+    _height: null,
+
+    getHeight: function () {
+        return this._height;
+    },
+
+    setHeight: function (height) {
+        if (height !== null) {
+            this._height = height;
+            this.__html.image.height = height;
+        } else {
+            this.__html.image.height = "";
+        }
+    },
+
+    /**
+     * Html outer element of the widget (if any).
+     *
+     * @property html
+     * @type HTMLElement
+     * @default null
+     * @readOnly
+     */
+    getHtml: function () {
+        return this.__html.div;
+    },
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Private methods ======
+
+    /**
+     * Build the widget HTML.
+     *
+     * @method _buildHtml
+     * @private
+     */
+    _buildHtml: function () {
+        this.__html.div = document.createElement("div");
+        this.__html.div.className = "photonui-widget photonui-image";
+
+        this.__html.image = document.createElement("img");
+        this.__html.div.appendChild(this.__html.image);
+    }
+
+});
+
+module.exports = Image_;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_visual_label.js.html b/ref/files/src_visual_label.js.html new file mode 100644 index 00000000..87ed3ec2 --- /dev/null +++ b/ref/files/src_visual_label.js.html @@ -0,0 +1,375 @@ + + + + + src/visual/label.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/visual/label.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule Visual
+ * @namespace photonui
+ */
+
+var Widget = require("../widget.js");
+var Helpers = require("../helpers.js");
+
+/**
+ * Label.
+ *
+ * @class Label
+ * @constructor
+ * @extends photonui.Widget
+ */
+var Label = Widget.$extend({
+
+    // Constructor
+    __init__: function (params1, params2) {
+        var params = {};
+        if (params1 && typeof(params1) == "string") {
+            params.text = params1;
+            if (params2 && typeof(params2) == "object") {
+                for (var i in params2) {
+                    params[i] = params2[i];
+                }
+            }
+        } else if (params1) {
+            params = params1;
+        }
+        params.layoutOptions = params.layoutOptions || {};
+        if (params.layoutOptions.verticalExpansion === undefined) {
+            params.layoutOptions.verticalExpansion = false;
+        }
+        this.$super(params);
+    },
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    /**
+     * The label text.
+     *
+     * @property text
+     * @type String
+     * @default "Label"
+     */
+    _text: "Label",
+
+    getText: function () {
+        "@photonui-update";
+        return this._text;
+    },
+
+    setText: function (text) {
+        this._text = text;
+        Helpers.cleanNode(this.__html.label);
+
+        var lines = text.split("\n");
+
+        for (var i = 0 ; i < lines.length ; i++) {
+            this.__html.label.appendChild(document.createTextNode(lines[i]));
+            if (i < lines.length - 1) {
+                this.__html.label.appendChild(document.createElement("br"));
+            }
+        }
+
+    },
+
+    /**
+     * The text horizontal alignement.
+     *
+     *   * "left",
+     *   * "center",
+     *   * "right".
+     *
+     * @property textAlign
+     * @type String
+     * @default "left"
+     */
+    _textAlign: "left",
+
+    getTextAlign: function () {
+        "@photonui-update";
+        return this._textAlign;
+    },
+
+    setTextAlign: function (textAlign) {
+        if (textAlign != "left" && textAlign != "center" && textAlign != "right") {
+            throw new Error("Text alignement sould be 'left', 'center' or 'right'.");
+        }
+        this._textAlign = textAlign;
+        this.__html.label.style.textAlign = textAlign;
+    },
+
+    /**
+     * Link the label with the given input (Field, CheckBox,...) widget.
+     *
+     * @property forInputName
+     * @type String
+     * @default null
+     */
+    _forInputName: null,
+
+    getForInputName: function () {
+        "@photonui-update";
+        return this._forInputName;
+    },
+
+    setForInputName: function (forInputName) {
+        this._forInputName = forInputName;
+        if (this._forInputName) {
+            if (this.forInput) {
+                this.__html.label.setAttribute("for",
+                        Helpers.escapeHtml(this.forInput.inputId || this.forInput.name)
+                );
+            } else {
+                this.__html.label.setAttribute("for",
+                        Helpers.escapeHtml(forInputName)
+                );
+            }
+        } else {
+            this.__html.label.removeAttribute("for");
+        }
+    },
+
+    /**
+     * Link the label with the given input (Field, CheckBox,...) widget.
+     *
+     * @property forInput
+     * @type photonui.Field, photonui.CheckBox
+     * @default null
+     */
+    getForInput: function () {
+        return Widget.getWidget(this.forInputName);
+    },
+
+    setForInput: function (forInput) {
+        this.forInputName = forInput.name;
+    },
+
+    /**
+     * Html outer element of the widget (if any).
+     *
+     * @property html
+     * @type HTMLElement
+     * @default null
+     * @readOnly
+     */
+    getHtml: function () {
+        return this.__html.label;
+    },
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Private methods ======
+
+    /**
+     * Build the widget HTML.
+     *
+     * @method _buildHtml
+     * @private
+     */
+    _buildHtml: function () {
+        this.__html.label = document.createElement("label");
+        this.__html.label.className = "photonui-widget photonui-label photonui-widget-fixed-height";
+    }
+});
+
+module.exports = Label;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_visual_progressbar.js.html b/ref/files/src_visual_progressbar.js.html new file mode 100644 index 00000000..627e92de --- /dev/null +++ b/ref/files/src_visual_progressbar.js.html @@ -0,0 +1,395 @@ + + + + + src/visual/progressbar.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/visual/progressbar.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule Visual
+ * @namespace photonui
+ */
+
+var Widget = require("../widget.js");
+
+/**
+ * ProgressBar.
+ *
+ * @class ProgressBar
+ * @constructor
+ * @extends photonui.Widget
+ */
+var ProgressBar = Widget.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        this.$super(params);
+    },
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    /**
+     * Html outer element of the widget (if any).
+     *
+     * @property html
+     * @type HTMLElement
+     * @default null
+     * @readOnly
+     */
+    getHtml: function () {
+        return this.__html.outer;
+    },
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Private methods ======
+
+    /**
+     * The progression (form 0.00 to 1.00).
+     *
+     * @property value
+     * @type Number
+     * @default 0
+     */
+    _value: 0,
+
+    getValue: function () {
+        "@photonui-update";
+        return this._value;
+    },
+
+    setValue: function (value) {
+        this._value = Math.min(Math.max(value, 0), 1);
+        if (this.orientation == "horizontal") {
+            this.__html.bar.style.width = Math.floor(this.value * 100) + "%";
+            this.__html.bar.style.height = "";
+        } else {
+            this.__html.bar.style.height = Math.floor(this.value * 100) + "%";
+            this.__html.bar.style.width = "";
+        }
+        this.__html.textContent.innerHTML = Math.floor(this.value * 100) + " %";
+    },
+
+    /**
+     * The progressbar orientation ("vertical" or "horizontal").
+     *
+     * @property orientation
+     * @type String
+     * @default "horizontal"
+     */
+    _orientation: "horizontal",
+
+    getOrientation: function () {
+        "@photonui-update";
+        return this._orientation;
+    },
+
+    setOrientation: function (orientation) {
+        if (orientation != "vertical" && orientation != "horizontal") {
+            throw new Error("The orientation should be \"vertical\" or \"horizontal\".");
+        }
+        this._orientation = orientation;
+        this.removeClass("photonui-progressbar-vertical");
+        this.removeClass("photonui-progressbar-horizontal");
+        this.addClass("photonui-progressbar-" + this.orientation);
+
+        // Refresh the value...
+        this.value = this.value;
+    },
+
+    /**
+     * Enable or disable the progressbar pulsate mode.
+     *
+     * @property pulsate
+     * @type Boolean
+     * @default false
+     */
+    _pulsate: false,
+
+    isPulsate: function () {
+        "@photonui-update";
+        return this._pulsate;
+    },
+
+    setPulsate: function (pulsate) {
+        this._pulsate = pulsate;
+        if (pulsate) {
+            this.addClass("photonui-progressbar-pulsate");
+            if (this.orientation == "horizontal") {
+                this.__html.bar.style.width = "";
+            } else {
+                this.__html.bar.style.height = "";
+            }
+        } else {
+            this.removeClass("photonui-progressbar-pulsate");
+            this.value = this.value;
+        }
+    },
+
+    /**
+     * Display/hide the progression text.
+     *
+     * @property textVisible
+     * @type Boolean
+     * @default true
+     */
+    _textVisible: true,
+
+    isTextVisible: function () {
+        return this._textVisible;
+    },
+
+    setTextVisible: function (textVisible) {
+        this._textVisible = textVisible;
+        if (this.textVisible) {
+            this.__html.text.style.display = "";
+        } else {
+            this.__html.text.style.display = "none";
+        }
+    },
+
+    /**
+     * Build the widget HTML.
+     *
+     * @method _buildHtml
+     * @private
+     */
+    _buildHtml: function () {
+        this.__html.outer = document.createElement("div");
+        this.__html.outer.className = "photonui-widget photonui-progressbar";
+
+        // Hack: needed to help grid layout (<table>) to size properly its cells...
+        this.__html.filldiv = document.createElement("div");
+        this.__html.filldiv.className = "photonui-progressbar-fill";
+        this.__html.filldiv.innerHTML = "xxxxxxxxxxx";
+        this.__html.filldiv.style.opacity = 0;
+        this.__html.filldiv.style.pointerEvents = "none";
+        this.__html.outer.appendChild(this.__html.filldiv);
+
+        this.__html.text = document.createElement("div");
+        this.__html.text.className = "photonui-progressbar-text";
+        this.__html.outer.appendChild(this.__html.text);
+
+        this.__html.textContent = document.createElement("span");
+        this.__html.text.appendChild(this.__html.textContent);
+
+        this.__html.bar = document.createElement("div");
+        this.__html.bar.className = "photonui-progressbar-bar";
+        this.__html.outer.appendChild(this.__html.bar);
+    },
+
+    //////////////////////////////////////////
+    // Internal Events Callbacks            //
+    //////////////////////////////////////////
+
+    /**
+     * Called when the locale is changed.
+     *
+     * @method __onLocaleChanged
+     * @private
+     */
+    __onLocaleChanged: function () {
+        // pass
+    }
+});
+
+module.exports = ProgressBar;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_visual_separator.js.html b/ref/files/src_visual_separator.js.html new file mode 100644 index 00000000..b3cc653d --- /dev/null +++ b/ref/files/src_visual_separator.js.html @@ -0,0 +1,306 @@ + + + + + src/visual/separator.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/visual/separator.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule Visual
+ * @namespace photonui
+ */
+
+var Widget = require("../widget.js");
+
+/**
+ * Separator.
+ *
+ * @class Separator
+ * @constructor
+ * @extends photonui.Widget
+ */
+var Separator = Widget.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        this.$super(params);
+    },
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    /**
+     * The separator orientation ("vertical" or "horizontal").
+     *
+     * @property orientation
+     * @type String
+     * @default "horizontal"
+     */
+    _orientation: "horizontal",
+
+    getOrientation: function () {
+        "@photonui-update";
+        return this._orientation;
+    },
+
+    setOrientation: function (orientation) {
+        if (orientation != "vertical" && orientation != "horizontal") {
+            throw new Error("The orientation should be \"vertical\" or \"horizontal\".");
+        }
+        this._orientation = orientation;
+        this.removeClass("photonui-separator-vertical");
+        this.removeClass("photonui-separator-horizontal");
+        this.addClass("photonui-separator-" + this._orientation);
+
+        this.removeClass("photonui-widget-fixed-height");
+        this.removeClass("photonui-widget-fixed-width");
+        if (this._orientation == "horizontal") {
+            this.addClass("photonui-widget-fixed-height");
+        } else {
+            this.addClass("photonui-widget-fixed-width");
+        }
+    },
+
+    /**
+     * Html outer element of the widget (if any).
+     *
+     * @property html
+     * @type HTMLElement
+     * @default null
+     * @readOnly
+     */
+    getHtml: function () {
+        return this.__html.outer;
+    },
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Private methods ======
+
+    /**
+     * Build the widget HTML.
+     *
+     * @method _buildHtml
+     * @private
+     */
+    _buildHtml: function () {
+        this.__html.outer = document.createElement("div");
+        this.__html.outer.className = "photonui-widget photonui-separator";
+        this.__html.hr = document.createElement("hr");
+        this.__html.outer.appendChild(this.__html.hr);
+    },
+
+    //////////////////////////////////////////
+    // Internal Events Callbacks            //
+    //////////////////////////////////////////
+
+    /**
+     * Called when the locale is changed.
+     *
+     * @method __onLocaleChanged
+     * @private
+     */
+    __onLocaleChanged: function () {
+        // pass
+    }
+});
+
+module.exports = Separator;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_visual_spriteicon.js.html b/ref/files/src_visual_spriteicon.js.html new file mode 100644 index 00000000..56012dc2 --- /dev/null +++ b/ref/files/src_visual_spriteicon.js.html @@ -0,0 +1,347 @@ + + + + + src/visual/spriteicon.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/visual/spriteicon.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule Visual
+ * @namespace photonui
+ */
+
+var BaseIcon = require("./baseicon.js");
+var SpriteSheet = require("../nonvisual/spritesheet.js");
+
+/**
+ * Sprite sheet based icons.
+ *
+ * Special contructor params:
+ *
+ *      new photonui.SpriteIcon( {optional params...} )
+ *      new photonui.SpriteIcon( "spriteSheetName/iconName", {optional params...} )
+ *
+ * @class SpriteIcon
+ * @constructor
+ * @extends photonui.BaseIcon
+ */
+var SpriteIcon = BaseIcon.$extend({
+
+    // Constructor
+    __init__: function (params1, params2) {
+        var params = {};
+        if (params1 && typeof(params1) == "string") {
+            params.icon = params1;
+            if (params2 && typeof(params2) == "object") {
+                for (var i in params2) {
+                    params[i] = params2[i];
+                }
+            }
+        } else if (params1) {
+            params = params1;
+        }
+        this.$super(params);
+    },
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    /**
+     * The sprite sheet name.
+     *
+     * @property spriteSheetName
+     * @type String
+     * @default ""
+     */
+    _spriteSheetName: "",
+
+    getSpriteSheetName: function () {
+        return this._spriteSheetName;
+    },
+
+    setSpriteSheetName: function (spriteSheetName) {
+        this._spriteSheetName = spriteSheetName || "";
+        this._update();
+    },
+
+    /**
+     * The icon name.
+     *
+     * @property iconName
+     * @type String
+     * @default ""
+     */
+    _iconName: "",
+
+    getIconName: function () {
+        return this._iconName;
+    },
+
+    setIconName: function (iconName) {
+        this._iconName = iconName || "";
+        this._update();
+    },
+
+    /**
+     * The icon id.
+     *
+     *     "spriteSheetName/iconName"
+     *
+     * @property icon
+     * @type String
+     * @default "/"
+     */
+    getIcon: function () {
+        return this.spriteSheetName + "/" + this.iconName;
+    },
+
+    setIcon: function (icon) {
+        var names = icon.split("/");
+        this.spriteSheetName = names[0];
+        this.iconName = names[1];
+    },
+
+    /**
+     * Html outer element of the widget (if any).
+     *
+     * @property html
+     * @type HTMLElement
+     * @default null
+     * @readOnly
+     */
+    getHtml: function () {
+        return this.__html.outer;
+    },
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Private methods ======
+
+    /**
+     * Update the icon.
+     *
+     * @method _update
+     * @private
+     */
+    _update: function () {
+        var style = "";
+        if (this.spriteSheetName && this.iconName) {
+            style = SpriteSheet.getSpriteSheet(this.spriteSheetName).getIconCss(this.iconName);
+        }
+        this.__html.icon.setAttribute("style", style);
+    },
+
+    /**
+     * Build the widget HTML.
+     *
+     * @method _buildHtml
+     * @private
+     */
+    _buildHtml: function () {
+        this.__html.outer = document.createElement("span");
+        this.__html.outer.className = "photonui-widget photonui-icon photonui-spriteicon";
+
+        this.__html.icon = document.createElement("span");
+        this.__html.outer.appendChild(this.__html.icon);
+    }
+});
+
+module.exports = SpriteIcon;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_visual_template.js.html b/ref/files/src_visual_template.js.html new file mode 100644 index 00000000..6baa1808 --- /dev/null +++ b/ref/files/src_visual_template.js.html @@ -0,0 +1,322 @@ + + + + + src/visual/template.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/visual/template.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <https://github.com/flozz>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule Visual
+ * @namespace photonui
+ */
+
+var lodash = require("lodash");
+var Widget = require("../widget.js");
+var Helpers = require("../helpers.js");
+
+/**
+ * Widget that displays template-generated HTML (uses lodash.template).
+ *
+ * @class Template
+ * @constructor
+ * @extends photonui.Widget
+ * @param {Object} params An object that can contain any property of the widget (optional).
+ */
+var Template = Widget.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        this.$data.compiledTemplate = function () {
+            return document.createElement("div");
+        };
+        this.$super(params);
+        this.update = lodash.debounce(this.update, 50);
+    },
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    /**
+     * The template.
+     *
+     * @property template
+     * @type String
+     * @default ""
+     */
+    _template: "",
+
+    getTemplate: function () {
+        return this._template;
+    },
+
+    setTemplate: function (tpl) {
+        this._template = tpl;
+        this.$data.compiledTemplate = lodash.template(this._template);
+        lodash.defer(this.update);
+    },
+
+    getData: function () {
+        lodash.defer(this.update);
+        return this.$super();
+    },
+
+    setData: function (data) {
+        this.$super(data);
+        this.update();
+    },
+
+    /**
+     * Html outer element of the widget (if any).
+     *
+     * @property html
+     * @type HTMLElement
+     * @default null
+     * @readOnly
+     */
+    getHtml: function () {
+        return this.__html.div;
+    },
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Public methods ======
+
+    /**
+     * Update the template (NOTE: the template is automatically updated when you change data)
+     *
+     * @method update
+     */
+    update: function () {
+        Helpers.cleanNode(this.html);
+        if (!this.$data.compiledTemplate) {
+            return;
+        }
+        try {
+            this.html.innerHTML = this.$data.compiledTemplate(this._data);
+        } catch (error) {
+            Helpers.log("error", "An error occured when rendering the template: " + error);
+        }
+    },
+
+    // ====== Private methods ======
+
+    /**
+     * Build the widget HTML.
+     *
+     * @method _buildHtml
+     * @private
+     */
+    _buildHtml: function () {
+        this.__html.div = document.createElement("div");
+        this.__html.div.className = "photonui-widget photonui-template";
+    },
+
+    //////////////////////////////////////////
+    // Internal Events Callbacks            //
+    //////////////////////////////////////////
+
+    __onLocaleChanged: function () {
+        this.update();
+    }
+
+});
+
+module.exports = Template;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_visual_text.js.html b/ref/files/src_visual_text.js.html new file mode 100644 index 00000000..07aa57a5 --- /dev/null +++ b/ref/files/src_visual_text.js.html @@ -0,0 +1,311 @@ + + + + + src/visual/text.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/visual/text.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @submodule Visual
+ * @namespace photonui
+ */
+
+var Stone = require("stonejs");
+var Widget = require("../widget.js");
+var Helpers = require("../helpers.js");
+
+/**
+ * Text / Raw HTML widget
+ *
+ * @class Text
+ * @constructor
+ * @extends photonui.Widget
+ */
+var Text_ = Widget.$extend({
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    // meta for i18n
+    _lastSet: "text",
+    _raw: "",
+
+    /**
+     * Text
+     *
+     * @property text
+     * @type String
+     * @default ""
+     */
+    getText: function () {
+        return this.__html.outer.textContent;
+    },
+
+    setText: function (text) {
+        this._lastSet = "text";
+        this._raw = text;
+        Helpers.cleanNode(this.__html.outer);
+        this.__html.outer.appendChild(document.createTextNode(text));
+    },
+
+    /**
+     * Raw HTML.
+     *
+     * @property rawHtml
+     * @type String
+     * @default ""
+     */
+    getRawHtml: function () {
+        return this.__html.outer.innerHTML;
+    },
+
+    setRawHtml: function (html) {
+        this._lastSet = "rawHtml";
+        this._raw = html;
+        this.__html.outer.innerHTML = html;
+    },
+
+    /**
+     * Html outer element of the widget (if any).
+     *
+     * @property html
+     * @type HTMLElement
+     * @default null
+     * @readOnly
+     */
+    getHtml: function () {
+        return this.__html.outer;
+    },
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Private methods ======
+
+    /**
+     * Build the widget HTML.
+     *
+     * @method _buildHtml
+     * @private
+     */
+    _buildHtml: function () {
+        this.__html.outer = document.createElement("div");
+        this.__html.outer.className = "photonui-widget photonui-text";
+    },
+
+    //////////////////////////////////////////
+    // Internal Events Callbacks            //
+    //////////////////////////////////////////
+
+    /**
+     * Called when the locale is changed.
+     *
+     * @method __onLocaleChanged
+     * @private
+     */
+    __onLocaleChanged: function () {
+        this.$super();
+        if (this._raw instanceof Stone.LazyString) {
+            this[this._lastSet] = this._raw;
+        }
+    }
+});
+
+module.exports = Text_;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/files/src_widget.js.html b/ref/files/src_widget.js.html new file mode 100644 index 00000000..34802a11 --- /dev/null +++ b/ref/files/src_widget.js.html @@ -0,0 +1,698 @@ + + + + + src/widget.js - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

File: src/widget.js

+ +
+
+/*
+ * Copyright (c) 2014-2015, Wanadev <http://www.wanadev.fr/>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   * Redistributions of source code must retain the above copyright notice, this
+ *     list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ *   * Neither the name of Wanadev nor the names of its contributors may be used
+ *     to endorse or promote products derived from this software without specific
+ *     prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authored by: Fabien LOISON <http://flozz.fr/>
+ */
+
+/**
+ * PhotonUI - Javascript Web User Interface.
+ *
+ * @module PhotonUI
+ * @namespace photonui
+ */
+
+var Stone = require("stonejs");
+var uuid = require("uuid");
+
+var Base = require("./base.js");
+var Helpers = require("./helpers.js");
+
+var _widgets = {};
+
+/**
+ * Base class for all PhotonUI widgets.
+ *
+ * wEvents:
+ *
+ *   * show:
+ *      - description: called when the widget is displayed (a change in the parent's
+ *                     visibility can also trigger this event).
+ *      - callback:    function(widget)
+ *
+ *   * hide:
+ *      - description: called when the widget is hidden (a change in the parent's visibility
+ *                     can also trigger this event).
+ *      - callback:    function(widget)
+ *
+ * @class Widget
+ * @constructor
+ * @extends photonui.Base
+ * @param {Object} params An object that can contain any property of the widget (optional).
+ */
+var Widget = Base.$extend({
+
+    // Constructor
+    __init__: function (params) {
+        // New instances for object properties
+        this.__html = {};
+        this._layoutOptions = {};
+
+        // Build the html
+        this._buildHtml();
+
+        // wEvents
+        this._registerWEvents(["show", "hide"]);
+
+        // Name must be set before other properties (e.g. needed when setting children)
+        if (!this._name) {
+            this.name = params && params.name ? params.name : "widget-" + uuid.v4();
+        }
+
+        // Parent constructor
+        this.$super(params);
+
+        // Additional className
+        if (params && params.className) {
+            this.addClass(params.className);
+        }
+
+        // Bind some events
+        if (this.html) {
+            this._bindEvent("pop-contextmenu", this.html, "contextmenu", this.__onContextMenu.bind(this));
+        }
+        this._bindEvent("locale-changed", document, "stonejs-locale-changed", this.__onLocaleChanged.bind(this));
+
+        // Register the widget
+        _widgets[this.name] = this;
+    },
+
+    //////////////////////////////////////////
+    // Properties and Accessors             //
+    //////////////////////////////////////////
+
+    // ====== Public properties ======
+
+    /**
+     * The unique name of the widget.
+     *
+     * @property name
+     * @type String
+     * @default "widget-" + uuid.v4()
+     */
+    _name: null,
+
+    getName: function () {
+        return this._name;
+    },
+
+    setName: function (name) {
+        delete _widgets[this.name];
+        this._name = name;
+        _widgets[name] = this;
+        if (this.html) {
+            this.html.id = this.name;
+        }
+    },
+
+    /**
+     * The parent widget name.
+     *
+     * @property parentName
+     * @type String
+     * @readOnly
+     * @default null (no parent)
+     */
+    _parentName: null,
+
+    getParentName: function () {
+        return this._parentName;
+    },
+
+    /**
+     * The parent widget.
+     *
+     * @property parent
+     * @type photonui.Widget
+     * @readOnly
+     * @default null (no parent)
+     */
+    getParent: function () {
+        return Widget.getWidget(this.parentName);
+    },
+
+    /**
+     * Is the widget visible or hidden.
+     *
+     * @property visible
+     * @type Boolean
+     * @default true
+     */
+    _visible: true,
+
+    isVisible: function () {
+        "@photonui-update";
+        return this._visible;
+    },
+
+    setVisible: function (visible) {
+        this._visible = Boolean(visible);
+        if (!this.html) {
+            return;
+        }
+        if (visible) {
+            this.html.style.display = "";
+        } else {
+            this.html.style.setProperty("display", "none", "important");
+        }
+        this._visibilityChanged();
+    },
+
+    /**
+     * Tooltip.
+     *
+     * @property tooltip
+     * @type String
+     * @default null
+     */
+    _tooltip: null,
+
+    getTooltip: function () {
+        return this._tooltip;
+    },
+
+    setTooltip: function (tooltip) {
+        this._tooltip = tooltip;
+        if (tooltip) {
+            this.html.title = tooltip;
+        } else {
+            this.html.removeAttribute("title");
+        }
+    },
+
+    /**
+     * The name of the managed contextual menu (`photonui.PopupWindow().name`).
+     *
+     * @property contextMenuName
+     * @type String
+     * @default null (= no context menu)
+     */
+    _contextMenuName: null,
+
+    getContextMenuName: function () {
+        return this._contextMenuName;
+    },
+
+    setContextMenuName: function (contextMenuName) {
+        this._contextMenuName = contextMenuName;
+    },
+
+    /**
+     * The managed contextual menu.
+     *
+     * @property contextMenu
+     * @type photonui.PopupWindow
+     * @default null (= no context menu)
+     */
+    getContextMenu: function () {
+        return Widget.getWidget(this.contextMenuName);
+    },
+
+    setContextMenu: function (contextMenu) {
+        var PopupWindow = require("./container/popupwindow.js");
+        if (contextMenu instanceof PopupWindow) {
+            this.contextMenuName = contextMenu.name;
+        } else {
+            this.contextMenuName = null;
+        }
+    },
+
+    /**
+     * Layout options.
+     *
+     * @property layoutOptions
+     * @type Object
+     * @default {}
+     */
+    _layoutOptions: {},
+
+    getLayoutOptions: function () {
+        return this._layoutOptions;
+    },
+
+    setLayoutOptions: function (layoutOptions) {
+        for (var option in layoutOptions) {
+            this._layoutOptions[option] = layoutOptions[option];
+        }
+    },
+
+    /**
+     * Html outer element of the widget (if any).
+     *
+     * @property html
+     * @type HTMLElement
+     * @default null
+     * @readOnly
+     */
+    getHtml: function () {
+        Helpers.log("debug", "getHtml() method is not implemented on this widget.");
+        return null;
+    },
+
+    /**
+     * Absolute position of the widget on the page.
+     *
+     * `{x: Number, y: Number}`
+     *
+     * @property absolutePosition
+     * @type Object
+     * @readOnly
+     */
+    getAbsolutePosition: function () {
+        if (!this.html) {
+            return {x: 0, y: 0};
+        }
+        return Helpers.getAbsolutePosition(this.html);
+    },
+
+    /**
+     * Widget width (outer HTML element).
+     *
+     * @property offsetWidth
+     * @type Number
+     * @readOnly
+     */
+    getOffsetWidth: function () {
+        if (!this.html) {
+            return 0;
+        }
+        return this.html.offsetWidth;
+    },
+
+    /**
+     * Widget height (outer HTML element).
+     *
+     * @property offsetHeight
+     * @type Number
+     * @readOnly
+     */
+    getOffsetHeight: function () {
+        if (!this.html) {
+            return 0;
+        }
+        return this.html.offsetHeight;
+    },
+
+    // ====== Private properties ======
+
+    /**
+     * Object containing references to the widget HTML elements
+     *
+     * @property __html
+     * @type Object
+     * @private
+     */
+    __html: {},      // HTML Elements
+
+    //////////////////////////////////////////
+    // Methods                              //
+    //////////////////////////////////////////
+
+    // ====== Public methods ======
+
+    /**
+     * Display the widget (equivalent to widget.visible = true).
+     *
+     * @method show
+     */
+    show: function () {
+        this.visible = true;
+    },
+
+    /**
+     * Hide the widget (equivalent to widget.visible = false).
+     *
+     * @method hide
+     */
+    hide: function () {
+        this.visible = false;
+    },
+
+    /**
+     * Detache the widget from its parent.
+     *
+     * @method unparent
+     */
+    unparent: function () {
+        if (this.parent) {
+            this.parent.removeChild(this);
+        } else if (this.html && this.html.parentNode) {
+            this.html.parentNode.removeChild(this.html);
+        }
+    },
+
+    /**
+     * Destroy the widget.
+     *
+     * @method destroy
+     */
+    destroy: function () {
+        this.$super();
+        this.unparent();
+        delete _widgets[this.name];
+    },
+
+    /**
+     * Add a class to the outer HTML element of the widget.
+     *
+     * @method addClass
+     * @param {String} className The class to add.
+     */
+    addClass: function (className) {
+        if (!this.html) {
+            return;
+        }
+        var classes = this.html.className.split(" ");
+        if (classes.indexOf(className) < 0) {
+            classes.push(className);
+        }
+        this.html.className = classes.join(" ");
+    },
+
+    /**
+     * Remove a class from the outer HTML element of the widget.
+     *
+     * @method removeClass
+     * @param {String} className The class to remove.
+     */
+    removeClass: function (className) {
+        if (!this.html) {
+            return;
+        }
+        var classes = this.html.className.split(" ");
+        var index = classes.indexOf(className);
+        if (index >= 0) {
+            classes.splice(index, 1);
+        }
+        this.html.className = classes.join(" ");
+    },
+
+    // ====== Private methods ======
+
+    /**
+     * Build the widget HTML.
+     *
+     * @method _buildHtml
+     * @private
+     */
+    _buildHtml: function () {
+        Helpers.log("debug", "_buildHtml() method not implemented on this widget.");
+    },
+
+    /**
+     * Called when the visibility changes.
+     *
+     * @method _visibilityChanged
+     * @private
+     * @param {Boolean} visibility Current visibility state (otptional, defaut=this.visible)
+     */
+    _visibilityChanged: function (visibility) {
+        visibility = (visibility !== undefined) ? visibility : this.visible;
+        if (visibility && this.visible) {
+            this._callCallbacks("show");
+        } else {
+            this._callCallbacks("hide");
+        }
+    },
+
+    //////////////////////////////////////////
+    // Internal Events Callbacks            //
+    //////////////////////////////////////////
+
+    /**
+     * Called when the context menu should be displayed.
+     *
+     * @method __onContextMenu
+     * @private
+     * @param event
+     */
+    __onContextMenu: function (event) {
+        event.stopPropagation();
+        event.preventDefault();
+        if (this.contextMenuName) {
+            this.contextMenu.popupXY(event.pageX, event.pageY);
+        }
+    },
+
+    /**
+     * Called when the locale is changed.
+     *
+     * @method __onLocaleChanged
+     * @private
+     */
+    __onLocaleChanged: function () {
+        // Update lazy strings...
+        for (var prop in this.$map.computedProperties) {
+            if (this[prop] instanceof Stone.LazyString) {
+                this[prop] = this[prop];
+            }
+        }
+    },
+
+    __classvars__: {
+
+        /**
+         * @property e_parent
+         * @static
+         * @type HTMLElement
+         * @default null
+         */
+        e_parent: null,
+
+        /**
+         * Get a widget.
+         *
+         * @method getWidget
+         * @static
+         * @param {String} name The widget name.
+         * @return {Widget} The widget or null.
+         */
+        getWidget: function (name) {
+            if (_widgets[name] !== undefined) {
+                return _widgets[name];
+            }
+            return null;
+        },
+
+        /**
+         * Get all instanciated PhotonUI widgets.
+         *
+         * @method getAllWidgets
+         * @static
+         * @return {Object} An object containing all widgets `{"widgetName": Widget, ...}`
+         */
+        getAllWidgets: function (name) {
+            return _widgets;
+        },
+
+        /**
+         * Insert a widget in the DOM.
+         *
+         * @method domInsert
+         * @static
+         * @param {photonui.Widget} widget The widget to insert.
+         * @param {HTMLElement} element The DOM node or its id (optional, default=Widget.e_parent)
+         */
+        domInsert: function (widget, element) {
+            element = element || Widget.e_parent || document.getElementsByTagName("body")[0];
+            if (typeof(element) == "string") {
+                element = document.getElementById(element);
+            }
+            element.appendChild(widget.html);
+        }
+
+    }
+
+});
+
+module.exports = Widget;
+
+    
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/index.html b/ref/index.html new file mode 100644 index 00000000..042552fd --- /dev/null +++ b/ref/index.html @@ -0,0 +1,181 @@ + + + + + photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+
+
+

+ Browse to a module or class using the sidebar to view its API documentation. +

+ +

Keyboard Shortcuts

+ +
    +
  • Press s to focus the API search box.

  • + +
  • Use Up and Down to select classes, modules, and search results.

  • + +
  • With the API search box or sidebar focused, use -Left or -Right to switch sidebar tabs.

  • + +
  • With the API search box or sidebar focused, use Ctrl+Left and Ctrl+Right to switch sidebar tabs.

  • +
+
+
+ + +
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/modules/Composite.html b/ref/modules/Composite.html new file mode 100644 index 00000000..08cf30ac --- /dev/null +++ b/ref/modules/Composite.html @@ -0,0 +1,214 @@ + + + + + Composite - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

Composite Module

+
+ + +
+ Defined in: src/composite/select.js:45 +
+ +
+ + +
+

PhotonUI - Javascript Web User Interface.

+ +
+ + +
+ + + +
+
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/modules/Container.html b/ref/modules/Container.html new file mode 100644 index 00000000..b5c1f8e1 --- /dev/null +++ b/ref/modules/Container.html @@ -0,0 +1,239 @@ + + + + + Container - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

Container Module

+
+ + +
+ Defined in: src/container/window.js:46 +
+ +
+ + +
+

PhotonUI - Javascript Web User Interface.

+ +
+ + + +
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/modules/DataView.html b/ref/modules/DataView.html new file mode 100644 index 00000000..7b84bd49 --- /dev/null +++ b/ref/modules/DataView.html @@ -0,0 +1,214 @@ + + + + + DataView - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

DataView Module

+
+ + + + +
+ + +
+

PhotonUI - Javascript Web User Interface.

+ +
+ + +
+
+

This module provides the following classes:

+ + +
+ + +
+
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/modules/Helpers.html b/ref/modules/Helpers.html new file mode 100644 index 00000000..9f2caecd --- /dev/null +++ b/ref/modules/Helpers.html @@ -0,0 +1,194 @@ + + + + + Helpers - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

Helpers Module

+
+ + +
+ Defined in: src/helpers.js:42 +
+ +
+ + +
+

PhotonUI - Javascript Web User Interface.

+ +
+ + +
+
+

This module provides the following classes:

+ + +
+ + +
+
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/modules/Interactive.html b/ref/modules/Interactive.html new file mode 100644 index 00000000..95411726 --- /dev/null +++ b/ref/modules/Interactive.html @@ -0,0 +1,249 @@ + + + + + Interactive - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

Interactive Module

+
+ + + + +
+ + +
+

PhotonUI - Javascript Web User Interface.

+ +
+ + + +
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/modules/Layout.html b/ref/modules/Layout.html new file mode 100644 index 00000000..e1735e03 --- /dev/null +++ b/ref/modules/Layout.html @@ -0,0 +1,219 @@ + + + + + Layout - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

Layout Module

+
+ + +
+ Defined in: src/layout/tablayout.js:44 +
+ +
+ + +
+

PhotonUI - Javascript Web User Interface.

+ +
+ + +
+ + + +
+
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/modules/NonVisual.html b/ref/modules/NonVisual.html new file mode 100644 index 00000000..4e8d7ce9 --- /dev/null +++ b/ref/modules/NonVisual.html @@ -0,0 +1,224 @@ + + + + + NonVisual - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

NonVisual Module

+
+ + + + +
+ + +
+

PhotonUI - Javascript Web User Interface.

+ +
+ + + +
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/modules/PhotonUI.html b/ref/modules/PhotonUI.html new file mode 100644 index 00000000..d9afb431 --- /dev/null +++ b/ref/modules/PhotonUI.html @@ -0,0 +1,555 @@ + + + + + PhotonUI - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

PhotonUI Module

+
+ + +
+ Defined in: src/widget.js:46 +
+ +
+ + +
+

PhotonUI - Javascript Web User Interface.

+ +
+ + +
+
+

This module provides the following classes:

+ + +
+ + +
+

This module is a rollup of the following modules:

+ + +
+
+
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/modules/Visual.html b/ref/modules/Visual.html new file mode 100644 index 00000000..79582f65 --- /dev/null +++ b/ref/modules/Visual.html @@ -0,0 +1,239 @@ + + + + + Visual - photonui + + + + + + + + +
+
+
+

+
+
+ API Docs for: 1.8.0 +
+
+
+ + +
+
+ Show: + + + + + + + +
+ +
+
+
+

Visual Module

+
+ + +
+ Defined in: src/visual/text.js:43 +
+ +
+ + +
+

PhotonUI - Javascript Web User Interface.

+ +
+ + + +
+
+
+
+
+
+ + + + + + + + + + diff --git a/ref/modules/index.html b/ref/modules/index.html new file mode 100644 index 00000000..487fe15b --- /dev/null +++ b/ref/modules/index.html @@ -0,0 +1,10 @@ + + + + Redirector + + + + Click here to redirect + + diff --git a/screenshot.png b/screenshot.png new file mode 100644 index 00000000..36d5cf2e Binary files /dev/null and b/screenshot.png differ diff --git a/style/assets/FontAwesome.otf b/style/assets/FontAwesome.otf new file mode 100644 index 00000000..401ec0f3 Binary files /dev/null and b/style/assets/FontAwesome.otf differ diff --git a/style/assets/fontawesome-webfont.eot b/style/assets/fontawesome-webfont.eot new file mode 100644 index 00000000..e9f60ca9 Binary files /dev/null and b/style/assets/fontawesome-webfont.eot differ diff --git a/style/assets/fontawesome-webfont.svg b/style/assets/fontawesome-webfont.svg new file mode 100644 index 00000000..855c845e --- /dev/null +++ b/style/assets/fontawesome-webfont.svg @@ -0,0 +1,2671 @@ + + + + +Created by FontForge 20120731 at Mon Oct 24 17:37:40 2016 + By ,,, +Copyright Dave Gandy 2016. All rights reserved. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/style/assets/fontawesome-webfont.ttf b/style/assets/fontawesome-webfont.ttf new file mode 100644 index 00000000..35acda2f Binary files /dev/null and b/style/assets/fontawesome-webfont.ttf differ diff --git a/style/assets/fontawesome-webfont.woff b/style/assets/fontawesome-webfont.woff new file mode 100644 index 00000000..400014a4 Binary files /dev/null and b/style/assets/fontawesome-webfont.woff differ diff --git a/style/assets/fontawesome-webfont.woff2 b/style/assets/fontawesome-webfont.woff2 new file mode 100644 index 00000000..4d13fc60 Binary files /dev/null and b/style/assets/fontawesome-webfont.woff2 differ diff --git a/style/style.css b/style/style.css new file mode 100644 index 00000000..c547d774 --- /dev/null +++ b/style/style.css @@ -0,0 +1,7441 @@ +/*! + * Font Awesome 4.3.0 by @davegandy - http://fontawesome.io - @fontawesome + * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) + */ +/* FONT PATH + * -------------------------- */ +@font-face { + font-family: 'FontAwesome'; + src: url('../fonts/fontawesome/fontawesome-webfont.eot?v=4.3.0'); + src: url('../fonts/fontawesome/fontawesome-webfont.eot?#iefix&v=4.3.0') format('embedded-opentype'), url('../fonts/fontawesome/fontawesome-webfont.woff2?v=4.3.0') format('woff2'), url('../fonts/fontawesome/fontawesome-webfont.woff?v=4.3.0') format('woff'), url('../fonts/fontawesome/fontawesome-webfont.ttf?v=4.3.0') format('truetype'), url('../fonts/fontawesome/fontawesome-webfont.svg?v=4.3.0#fontawesomeregular') format('svg'); + font-weight: normal; + font-style: normal; +} +.fa { + display: inline-block; + font: normal normal normal 14px/1 FontAwesome; + font-size: inherit; + text-rendering: auto; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + transform: translate(0, 0); +} +/* makes the font 33% larger relative to the icon container */ +.fa-lg { + font-size: 1.33333333em; + line-height: 0.75em; + vertical-align: -15%; +} +.fa-2x { + font-size: 2em; +} +.fa-3x { + font-size: 3em; +} +.fa-4x { + font-size: 4em; +} +.fa-5x { + font-size: 5em; +} +.fa-fw { + width: 1.28571429em; + text-align: center; +} +.fa-ul { + padding-left: 0; + margin-left: 2.14285714em; + list-style-type: none; +} +.fa-ul > li { + position: relative; +} +.fa-li { + position: absolute; + left: -2.14285714em; + width: 2.14285714em; + top: 0.14285714em; + text-align: center; +} +.fa-li.fa-lg { + left: -1.85714286em; +} +.fa-border { + padding: .2em .25em .15em; + border: solid 0.08em #eeeeee; + border-radius: .1em; +} +.pull-right { + float: right; +} +.pull-left { + float: left; +} +.fa.pull-left { + margin-right: .3em; +} +.fa.pull-right { + margin-left: .3em; +} +.fa-spin { + -webkit-animation: fa-spin 2s infinite linear; + animation: fa-spin 2s infinite linear; +} +.fa-pulse { + -webkit-animation: fa-spin 1s infinite steps(8); + animation: fa-spin 1s infinite steps(8); +} +@-webkit-keyframes fa-spin { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(359deg); + transform: rotate(359deg); + } +} +@keyframes fa-spin { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(359deg); + transform: rotate(359deg); + } +} +.fa-rotate-90 { + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1); + -webkit-transform: rotate(90deg); + -ms-transform: rotate(90deg); + transform: rotate(90deg); +} +.fa-rotate-180 { + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2); + -webkit-transform: rotate(180deg); + -ms-transform: rotate(180deg); + transform: rotate(180deg); +} +.fa-rotate-270 { + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); + -webkit-transform: rotate(270deg); + -ms-transform: rotate(270deg); + transform: rotate(270deg); +} +.fa-flip-horizontal { + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1); + -webkit-transform: scale(-1, 1); + -ms-transform: scale(-1, 1); + transform: scale(-1, 1); +} +.fa-flip-vertical { + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1); + -webkit-transform: scale(1, -1); + -ms-transform: scale(1, -1); + transform: scale(1, -1); +} +:root .fa-rotate-90, +:root .fa-rotate-180, +:root .fa-rotate-270, +:root .fa-flip-horizontal, +:root .fa-flip-vertical { + filter: none; +} +.fa-stack { + position: relative; + display: inline-block; + width: 2em; + height: 2em; + line-height: 2em; + vertical-align: middle; +} +.fa-stack-1x, +.fa-stack-2x { + position: absolute; + left: 0; + width: 100%; + text-align: center; +} +.fa-stack-1x { + line-height: inherit; +} +.fa-stack-2x { + font-size: 2em; +} +.fa-inverse { + color: #ffffff; +} +/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen + readers do not read off random characters that represent icons */ +.fa-glass:before { + content: "\f000"; +} +.fa-music:before { + content: "\f001"; +} +.fa-search:before { + content: "\f002"; +} +.fa-envelope-o:before { + content: "\f003"; +} +.fa-heart:before { + content: "\f004"; +} +.fa-star:before { + content: "\f005"; +} +.fa-star-o:before { + content: "\f006"; +} +.fa-user:before { + content: "\f007"; +} +.fa-film:before { + content: "\f008"; +} +.fa-th-large:before { + content: "\f009"; +} +.fa-th:before { + content: "\f00a"; +} +.fa-th-list:before { + content: "\f00b"; +} +.fa-check:before { + content: "\f00c"; +} +.fa-remove:before, +.fa-close:before, +.fa-times:before { + content: "\f00d"; +} +.fa-search-plus:before { + content: "\f00e"; +} +.fa-search-minus:before { + content: "\f010"; +} +.fa-power-off:before { + content: "\f011"; +} +.fa-signal:before { + content: "\f012"; +} +.fa-gear:before, +.fa-cog:before { + content: "\f013"; +} +.fa-trash-o:before { + content: "\f014"; +} +.fa-home:before { + content: "\f015"; +} +.fa-file-o:before { + content: "\f016"; +} +.fa-clock-o:before { + content: "\f017"; +} +.fa-road:before { + content: "\f018"; +} +.fa-download:before { + content: "\f019"; +} +.fa-arrow-circle-o-down:before { + content: "\f01a"; +} +.fa-arrow-circle-o-up:before { + content: "\f01b"; +} +.fa-inbox:before { + content: "\f01c"; +} +.fa-play-circle-o:before { + content: "\f01d"; +} +.fa-rotate-right:before, +.fa-repeat:before { + content: "\f01e"; +} +.fa-refresh:before { + content: "\f021"; +} +.fa-list-alt:before { + content: "\f022"; +} +.fa-lock:before { + content: "\f023"; +} +.fa-flag:before { + content: "\f024"; +} +.fa-headphones:before { + content: "\f025"; +} +.fa-volume-off:before { + content: "\f026"; +} +.fa-volume-down:before { + content: "\f027"; +} +.fa-volume-up:before { + content: "\f028"; +} +.fa-qrcode:before { + content: "\f029"; +} +.fa-barcode:before { + content: "\f02a"; +} +.fa-tag:before { + content: "\f02b"; +} +.fa-tags:before { + content: "\f02c"; +} +.fa-book:before { + content: "\f02d"; +} +.fa-bookmark:before { + content: "\f02e"; +} +.fa-print:before { + content: "\f02f"; +} +.fa-camera:before { + content: "\f030"; +} +.fa-font:before { + content: "\f031"; +} +.fa-bold:before { + content: "\f032"; +} +.fa-italic:before { + content: "\f033"; +} +.fa-text-height:before { + content: "\f034"; +} +.fa-text-width:before { + content: "\f035"; +} +.fa-align-left:before { + content: "\f036"; +} +.fa-align-center:before { + content: "\f037"; +} +.fa-align-right:before { + content: "\f038"; +} +.fa-align-justify:before { + content: "\f039"; +} +.fa-list:before { + content: "\f03a"; +} +.fa-dedent:before, +.fa-outdent:before { + content: "\f03b"; +} +.fa-indent:before { + content: "\f03c"; +} +.fa-video-camera:before { + content: "\f03d"; +} +.fa-photo:before, +.fa-image:before, +.fa-picture-o:before { + content: "\f03e"; +} +.fa-pencil:before { + content: "\f040"; +} +.fa-map-marker:before { + content: "\f041"; +} +.fa-adjust:before { + content: "\f042"; +} +.fa-tint:before { + content: "\f043"; +} +.fa-edit:before, +.fa-pencil-square-o:before { + content: "\f044"; +} +.fa-share-square-o:before { + content: "\f045"; +} +.fa-check-square-o:before { + content: "\f046"; +} +.fa-arrows:before { + content: "\f047"; +} +.fa-step-backward:before { + content: "\f048"; +} +.fa-fast-backward:before { + content: "\f049"; +} +.fa-backward:before { + content: "\f04a"; +} +.fa-play:before { + content: "\f04b"; +} +.fa-pause:before { + content: "\f04c"; +} +.fa-stop:before { + content: "\f04d"; +} +.fa-forward:before { + content: "\f04e"; +} +.fa-fast-forward:before { + content: "\f050"; +} +.fa-step-forward:before { + content: "\f051"; +} +.fa-eject:before { + content: "\f052"; +} +.fa-chevron-left:before { + content: "\f053"; +} +.fa-chevron-right:before { + content: "\f054"; +} +.fa-plus-circle:before { + content: "\f055"; +} +.fa-minus-circle:before { + content: "\f056"; +} +.fa-times-circle:before { + content: "\f057"; +} +.fa-check-circle:before { + content: "\f058"; +} +.fa-question-circle:before { + content: "\f059"; +} +.fa-info-circle:before { + content: "\f05a"; +} +.fa-crosshairs:before { + content: "\f05b"; +} +.fa-times-circle-o:before { + content: "\f05c"; +} +.fa-check-circle-o:before { + content: "\f05d"; +} +.fa-ban:before { + content: "\f05e"; +} +.fa-arrow-left:before { + content: "\f060"; +} +.fa-arrow-right:before { + content: "\f061"; +} +.fa-arrow-up:before { + content: "\f062"; +} +.fa-arrow-down:before { + content: "\f063"; +} +.fa-mail-forward:before, +.fa-share:before { + content: "\f064"; +} +.fa-expand:before { + content: "\f065"; +} +.fa-compress:before { + content: "\f066"; +} +.fa-plus:before { + content: "\f067"; +} +.fa-minus:before { + content: "\f068"; +} +.fa-asterisk:before { + content: "\f069"; +} +.fa-exclamation-circle:before { + content: "\f06a"; +} +.fa-gift:before { + content: "\f06b"; +} +.fa-leaf:before { + content: "\f06c"; +} +.fa-fire:before { + content: "\f06d"; +} +.fa-eye:before { + content: "\f06e"; +} +.fa-eye-slash:before { + content: "\f070"; +} +.fa-warning:before, +.fa-exclamation-triangle:before { + content: "\f071"; +} +.fa-plane:before { + content: "\f072"; +} +.fa-calendar:before { + content: "\f073"; +} +.fa-random:before { + content: "\f074"; +} +.fa-comment:before { + content: "\f075"; +} +.fa-magnet:before { + content: "\f076"; +} +.fa-chevron-up:before { + content: "\f077"; +} +.fa-chevron-down:before { + content: "\f078"; +} +.fa-retweet:before { + content: "\f079"; +} +.fa-shopping-cart:before { + content: "\f07a"; +} +.fa-folder:before { + content: "\f07b"; +} +.fa-folder-open:before { + content: "\f07c"; +} +.fa-arrows-v:before { + content: "\f07d"; +} +.fa-arrows-h:before { + content: "\f07e"; +} +.fa-bar-chart-o:before, +.fa-bar-chart:before { + content: "\f080"; +} +.fa-twitter-square:before { + content: "\f081"; +} +.fa-facebook-square:before { + content: "\f082"; +} +.fa-camera-retro:before { + content: "\f083"; +} +.fa-key:before { + content: "\f084"; +} +.fa-gears:before, +.fa-cogs:before { + content: "\f085"; +} +.fa-comments:before { + content: "\f086"; +} +.fa-thumbs-o-up:before { + content: "\f087"; +} +.fa-thumbs-o-down:before { + content: "\f088"; +} +.fa-star-half:before { + content: "\f089"; +} +.fa-heart-o:before { + content: "\f08a"; +} +.fa-sign-out:before { + content: "\f08b"; +} +.fa-linkedin-square:before { + content: "\f08c"; +} +.fa-thumb-tack:before { + content: "\f08d"; +} +.fa-external-link:before { + content: "\f08e"; +} +.fa-sign-in:before { + content: "\f090"; +} +.fa-trophy:before { + content: "\f091"; +} +.fa-github-square:before { + content: "\f092"; +} +.fa-upload:before { + content: "\f093"; +} +.fa-lemon-o:before { + content: "\f094"; +} +.fa-phone:before { + content: "\f095"; +} +.fa-square-o:before { + content: "\f096"; +} +.fa-bookmark-o:before { + content: "\f097"; +} +.fa-phone-square:before { + content: "\f098"; +} +.fa-twitter:before { + content: "\f099"; +} +.fa-facebook-f:before, +.fa-facebook:before { + content: "\f09a"; +} +.fa-github:before { + content: "\f09b"; +} +.fa-unlock:before { + content: "\f09c"; +} +.fa-credit-card:before { + content: "\f09d"; +} +.fa-rss:before { + content: "\f09e"; +} +.fa-hdd-o:before { + content: "\f0a0"; +} +.fa-bullhorn:before { + content: "\f0a1"; +} +.fa-bell:before { + content: "\f0f3"; +} +.fa-certificate:before { + content: "\f0a3"; +} +.fa-hand-o-right:before { + content: "\f0a4"; +} +.fa-hand-o-left:before { + content: "\f0a5"; +} +.fa-hand-o-up:before { + content: "\f0a6"; +} +.fa-hand-o-down:before { + content: "\f0a7"; +} +.fa-arrow-circle-left:before { + content: "\f0a8"; +} +.fa-arrow-circle-right:before { + content: "\f0a9"; +} +.fa-arrow-circle-up:before { + content: "\f0aa"; +} +.fa-arrow-circle-down:before { + content: "\f0ab"; +} +.fa-globe:before { + content: "\f0ac"; +} +.fa-wrench:before { + content: "\f0ad"; +} +.fa-tasks:before { + content: "\f0ae"; +} +.fa-filter:before { + content: "\f0b0"; +} +.fa-briefcase:before { + content: "\f0b1"; +} +.fa-arrows-alt:before { + content: "\f0b2"; +} +.fa-group:before, +.fa-users:before { + content: "\f0c0"; +} +.fa-chain:before, +.fa-link:before { + content: "\f0c1"; +} +.fa-cloud:before { + content: "\f0c2"; +} +.fa-flask:before { + content: "\f0c3"; +} +.fa-cut:before, +.fa-scissors:before { + content: "\f0c4"; +} +.fa-copy:before, +.fa-files-o:before { + content: "\f0c5"; +} +.fa-paperclip:before { + content: "\f0c6"; +} +.fa-save:before, +.fa-floppy-o:before { + content: "\f0c7"; +} +.fa-square:before { + content: "\f0c8"; +} +.fa-navicon:before, +.fa-reorder:before, +.fa-bars:before { + content: "\f0c9"; +} +.fa-list-ul:before { + content: "\f0ca"; +} +.fa-list-ol:before { + content: "\f0cb"; +} +.fa-strikethrough:before { + content: "\f0cc"; +} +.fa-underline:before { + content: "\f0cd"; +} +.fa-table:before { + content: "\f0ce"; +} +.fa-magic:before { + content: "\f0d0"; +} +.fa-truck:before { + content: "\f0d1"; +} +.fa-pinterest:before { + content: "\f0d2"; +} +.fa-pinterest-square:before { + content: "\f0d3"; +} +.fa-google-plus-square:before { + content: "\f0d4"; +} +.fa-google-plus:before { + content: "\f0d5"; +} +.fa-money:before { + content: "\f0d6"; +} +.fa-caret-down:before { + content: "\f0d7"; +} +.fa-caret-up:before { + content: "\f0d8"; +} +.fa-caret-left:before { + content: "\f0d9"; +} +.fa-caret-right:before { + content: "\f0da"; +} +.fa-columns:before { + content: "\f0db"; +} +.fa-unsorted:before, +.fa-sort:before { + content: "\f0dc"; +} +.fa-sort-down:before, +.fa-sort-desc:before { + content: "\f0dd"; +} +.fa-sort-up:before, +.fa-sort-asc:before { + content: "\f0de"; +} +.fa-envelope:before { + content: "\f0e0"; +} +.fa-linkedin:before { + content: "\f0e1"; +} +.fa-rotate-left:before, +.fa-undo:before { + content: "\f0e2"; +} +.fa-legal:before, +.fa-gavel:before { + content: "\f0e3"; +} +.fa-dashboard:before, +.fa-tachometer:before { + content: "\f0e4"; +} +.fa-comment-o:before { + content: "\f0e5"; +} +.fa-comments-o:before { + content: "\f0e6"; +} +.fa-flash:before, +.fa-bolt:before { + content: "\f0e7"; +} +.fa-sitemap:before { + content: "\f0e8"; +} +.fa-umbrella:before { + content: "\f0e9"; +} +.fa-paste:before, +.fa-clipboard:before { + content: "\f0ea"; +} +.fa-lightbulb-o:before { + content: "\f0eb"; +} +.fa-exchange:before { + content: "\f0ec"; +} +.fa-cloud-download:before { + content: "\f0ed"; +} +.fa-cloud-upload:before { + content: "\f0ee"; +} +.fa-user-md:before { + content: "\f0f0"; +} +.fa-stethoscope:before { + content: "\f0f1"; +} +.fa-suitcase:before { + content: "\f0f2"; +} +.fa-bell-o:before { + content: "\f0a2"; +} +.fa-coffee:before { + content: "\f0f4"; +} +.fa-cutlery:before { + content: "\f0f5"; +} +.fa-file-text-o:before { + content: "\f0f6"; +} +.fa-building-o:before { + content: "\f0f7"; +} +.fa-hospital-o:before { + content: "\f0f8"; +} +.fa-ambulance:before { + content: "\f0f9"; +} +.fa-medkit:before { + content: "\f0fa"; +} +.fa-fighter-jet:before { + content: "\f0fb"; +} +.fa-beer:before { + content: "\f0fc"; +} +.fa-h-square:before { + content: "\f0fd"; +} +.fa-plus-square:before { + content: "\f0fe"; +} +.fa-angle-double-left:before { + content: "\f100"; +} +.fa-angle-double-right:before { + content: "\f101"; +} +.fa-angle-double-up:before { + content: "\f102"; +} +.fa-angle-double-down:before { + content: "\f103"; +} +.fa-angle-left:before { + content: "\f104"; +} +.fa-angle-right:before { + content: "\f105"; +} +.fa-angle-up:before { + content: "\f106"; +} +.fa-angle-down:before { + content: "\f107"; +} +.fa-desktop:before { + content: "\f108"; +} +.fa-laptop:before { + content: "\f109"; +} +.fa-tablet:before { + content: "\f10a"; +} +.fa-mobile-phone:before, +.fa-mobile:before { + content: "\f10b"; +} +.fa-circle-o:before { + content: "\f10c"; +} +.fa-quote-left:before { + content: "\f10d"; +} +.fa-quote-right:before { + content: "\f10e"; +} +.fa-spinner:before { + content: "\f110"; +} +.fa-circle:before { + content: "\f111"; +} +.fa-mail-reply:before, +.fa-reply:before { + content: "\f112"; +} +.fa-github-alt:before { + content: "\f113"; +} +.fa-folder-o:before { + content: "\f114"; +} +.fa-folder-open-o:before { + content: "\f115"; +} +.fa-smile-o:before { + content: "\f118"; +} +.fa-frown-o:before { + content: "\f119"; +} +.fa-meh-o:before { + content: "\f11a"; +} +.fa-gamepad:before { + content: "\f11b"; +} +.fa-keyboard-o:before { + content: "\f11c"; +} +.fa-flag-o:before { + content: "\f11d"; +} +.fa-flag-checkered:before { + content: "\f11e"; +} +.fa-terminal:before { + content: "\f120"; +} +.fa-code:before { + content: "\f121"; +} +.fa-mail-reply-all:before, +.fa-reply-all:before { + content: "\f122"; +} +.fa-star-half-empty:before, +.fa-star-half-full:before, +.fa-star-half-o:before { + content: "\f123"; +} +.fa-location-arrow:before { + content: "\f124"; +} +.fa-crop:before { + content: "\f125"; +} +.fa-code-fork:before { + content: "\f126"; +} +.fa-unlink:before, +.fa-chain-broken:before { + content: "\f127"; +} +.fa-question:before { + content: "\f128"; +} +.fa-info:before { + content: "\f129"; +} +.fa-exclamation:before { + content: "\f12a"; +} +.fa-superscript:before { + content: "\f12b"; +} +.fa-subscript:before { + content: "\f12c"; +} +.fa-eraser:before { + content: "\f12d"; +} +.fa-puzzle-piece:before { + content: "\f12e"; +} +.fa-microphone:before { + content: "\f130"; +} +.fa-microphone-slash:before { + content: "\f131"; +} +.fa-shield:before { + content: "\f132"; +} +.fa-calendar-o:before { + content: "\f133"; +} +.fa-fire-extinguisher:before { + content: "\f134"; +} +.fa-rocket:before { + content: "\f135"; +} +.fa-maxcdn:before { + content: "\f136"; +} +.fa-chevron-circle-left:before { + content: "\f137"; +} +.fa-chevron-circle-right:before { + content: "\f138"; +} +.fa-chevron-circle-up:before { + content: "\f139"; +} +.fa-chevron-circle-down:before { + content: "\f13a"; +} +.fa-html5:before { + content: "\f13b"; +} +.fa-css3:before { + content: "\f13c"; +} +.fa-anchor:before { + content: "\f13d"; +} +.fa-unlock-alt:before { + content: "\f13e"; +} +.fa-bullseye:before { + content: "\f140"; +} +.fa-ellipsis-h:before { + content: "\f141"; +} +.fa-ellipsis-v:before { + content: "\f142"; +} +.fa-rss-square:before { + content: "\f143"; +} +.fa-play-circle:before { + content: "\f144"; +} +.fa-ticket:before { + content: "\f145"; +} +.fa-minus-square:before { + content: "\f146"; +} +.fa-minus-square-o:before { + content: "\f147"; +} +.fa-level-up:before { + content: "\f148"; +} +.fa-level-down:before { + content: "\f149"; +} +.fa-check-square:before { + content: "\f14a"; +} +.fa-pencil-square:before { + content: "\f14b"; +} +.fa-external-link-square:before { + content: "\f14c"; +} +.fa-share-square:before { + content: "\f14d"; +} +.fa-compass:before { + content: "\f14e"; +} +.fa-toggle-down:before, +.fa-caret-square-o-down:before { + content: "\f150"; +} +.fa-toggle-up:before, +.fa-caret-square-o-up:before { + content: "\f151"; +} +.fa-toggle-right:before, +.fa-caret-square-o-right:before { + content: "\f152"; +} +.fa-euro:before, +.fa-eur:before { + content: "\f153"; +} +.fa-gbp:before { + content: "\f154"; +} +.fa-dollar:before, +.fa-usd:before { + content: "\f155"; +} +.fa-rupee:before, +.fa-inr:before { + content: "\f156"; +} +.fa-cny:before, +.fa-rmb:before, +.fa-yen:before, +.fa-jpy:before { + content: "\f157"; +} +.fa-ruble:before, +.fa-rouble:before, +.fa-rub:before { + content: "\f158"; +} +.fa-won:before, +.fa-krw:before { + content: "\f159"; +} +.fa-bitcoin:before, +.fa-btc:before { + content: "\f15a"; +} +.fa-file:before { + content: "\f15b"; +} +.fa-file-text:before { + content: "\f15c"; +} +.fa-sort-alpha-asc:before { + content: "\f15d"; +} +.fa-sort-alpha-desc:before { + content: "\f15e"; +} +.fa-sort-amount-asc:before { + content: "\f160"; +} +.fa-sort-amount-desc:before { + content: "\f161"; +} +.fa-sort-numeric-asc:before { + content: "\f162"; +} +.fa-sort-numeric-desc:before { + content: "\f163"; +} +.fa-thumbs-up:before { + content: "\f164"; +} +.fa-thumbs-down:before { + content: "\f165"; +} +.fa-youtube-square:before { + content: "\f166"; +} +.fa-youtube:before { + content: "\f167"; +} +.fa-xing:before { + content: "\f168"; +} +.fa-xing-square:before { + content: "\f169"; +} +.fa-youtube-play:before { + content: "\f16a"; +} +.fa-dropbox:before { + content: "\f16b"; +} +.fa-stack-overflow:before { + content: "\f16c"; +} +.fa-instagram:before { + content: "\f16d"; +} +.fa-flickr:before { + content: "\f16e"; +} +.fa-adn:before { + content: "\f170"; +} +.fa-bitbucket:before { + content: "\f171"; +} +.fa-bitbucket-square:before { + content: "\f172"; +} +.fa-tumblr:before { + content: "\f173"; +} +.fa-tumblr-square:before { + content: "\f174"; +} +.fa-long-arrow-down:before { + content: "\f175"; +} +.fa-long-arrow-up:before { + content: "\f176"; +} +.fa-long-arrow-left:before { + content: "\f177"; +} +.fa-long-arrow-right:before { + content: "\f178"; +} +.fa-apple:before { + content: "\f179"; +} +.fa-windows:before { + content: "\f17a"; +} +.fa-android:before { + content: "\f17b"; +} +.fa-linux:before { + content: "\f17c"; +} +.fa-dribbble:before { + content: "\f17d"; +} +.fa-skype:before { + content: "\f17e"; +} +.fa-foursquare:before { + content: "\f180"; +} +.fa-trello:before { + content: "\f181"; +} +.fa-female:before { + content: "\f182"; +} +.fa-male:before { + content: "\f183"; +} +.fa-gittip:before, +.fa-gratipay:before { + content: "\f184"; +} +.fa-sun-o:before { + content: "\f185"; +} +.fa-moon-o:before { + content: "\f186"; +} +.fa-archive:before { + content: "\f187"; +} +.fa-bug:before { + content: "\f188"; +} +.fa-vk:before { + content: "\f189"; +} +.fa-weibo:before { + content: "\f18a"; +} +.fa-renren:before { + content: "\f18b"; +} +.fa-pagelines:before { + content: "\f18c"; +} +.fa-stack-exchange:before { + content: "\f18d"; +} +.fa-arrow-circle-o-right:before { + content: "\f18e"; +} +.fa-arrow-circle-o-left:before { + content: "\f190"; +} +.fa-toggle-left:before, +.fa-caret-square-o-left:before { + content: "\f191"; +} +.fa-dot-circle-o:before { + content: "\f192"; +} +.fa-wheelchair:before { + content: "\f193"; +} +.fa-vimeo-square:before { + content: "\f194"; +} +.fa-turkish-lira:before, +.fa-try:before { + content: "\f195"; +} +.fa-plus-square-o:before { + content: "\f196"; +} +.fa-space-shuttle:before { + content: "\f197"; +} +.fa-slack:before { + content: "\f198"; +} +.fa-envelope-square:before { + content: "\f199"; +} +.fa-wordpress:before { + content: "\f19a"; +} +.fa-openid:before { + content: "\f19b"; +} +.fa-institution:before, +.fa-bank:before, +.fa-university:before { + content: "\f19c"; +} +.fa-mortar-board:before, +.fa-graduation-cap:before { + content: "\f19d"; +} +.fa-yahoo:before { + content: "\f19e"; +} +.fa-google:before { + content: "\f1a0"; +} +.fa-reddit:before { + content: "\f1a1"; +} +.fa-reddit-square:before { + content: "\f1a2"; +} +.fa-stumbleupon-circle:before { + content: "\f1a3"; +} +.fa-stumbleupon:before { + content: "\f1a4"; +} +.fa-delicious:before { + content: "\f1a5"; +} +.fa-digg:before { + content: "\f1a6"; +} +.fa-pied-piper:before { + content: "\f1a7"; +} +.fa-pied-piper-alt:before { + content: "\f1a8"; +} +.fa-drupal:before { + content: "\f1a9"; +} +.fa-joomla:before { + content: "\f1aa"; +} +.fa-language:before { + content: "\f1ab"; +} +.fa-fax:before { + content: "\f1ac"; +} +.fa-building:before { + content: "\f1ad"; +} +.fa-child:before { + content: "\f1ae"; +} +.fa-paw:before { + content: "\f1b0"; +} +.fa-spoon:before { + content: "\f1b1"; +} +.fa-cube:before { + content: "\f1b2"; +} +.fa-cubes:before { + content: "\f1b3"; +} +.fa-behance:before { + content: "\f1b4"; +} +.fa-behance-square:before { + content: "\f1b5"; +} +.fa-steam:before { + content: "\f1b6"; +} +.fa-steam-square:before { + content: "\f1b7"; +} +.fa-recycle:before { + content: "\f1b8"; +} +.fa-automobile:before, +.fa-car:before { + content: "\f1b9"; +} +.fa-cab:before, +.fa-taxi:before { + content: "\f1ba"; +} +.fa-tree:before { + content: "\f1bb"; +} +.fa-spotify:before { + content: "\f1bc"; +} +.fa-deviantart:before { + content: "\f1bd"; +} +.fa-soundcloud:before { + content: "\f1be"; +} +.fa-database:before { + content: "\f1c0"; +} +.fa-file-pdf-o:before { + content: "\f1c1"; +} +.fa-file-word-o:before { + content: "\f1c2"; +} +.fa-file-excel-o:before { + content: "\f1c3"; +} +.fa-file-powerpoint-o:before { + content: "\f1c4"; +} +.fa-file-photo-o:before, +.fa-file-picture-o:before, +.fa-file-image-o:before { + content: "\f1c5"; +} +.fa-file-zip-o:before, +.fa-file-archive-o:before { + content: "\f1c6"; +} +.fa-file-sound-o:before, +.fa-file-audio-o:before { + content: "\f1c7"; +} +.fa-file-movie-o:before, +.fa-file-video-o:before { + content: "\f1c8"; +} +.fa-file-code-o:before { + content: "\f1c9"; +} +.fa-vine:before { + content: "\f1ca"; +} +.fa-codepen:before { + content: "\f1cb"; +} +.fa-jsfiddle:before { + content: "\f1cc"; +} +.fa-life-bouy:before, +.fa-life-buoy:before, +.fa-life-saver:before, +.fa-support:before, +.fa-life-ring:before { + content: "\f1cd"; +} +.fa-circle-o-notch:before { + content: "\f1ce"; +} +.fa-ra:before, +.fa-rebel:before { + content: "\f1d0"; +} +.fa-ge:before, +.fa-empire:before { + content: "\f1d1"; +} +.fa-git-square:before { + content: "\f1d2"; +} +.fa-git:before { + content: "\f1d3"; +} +.fa-hacker-news:before { + content: "\f1d4"; +} +.fa-tencent-weibo:before { + content: "\f1d5"; +} +.fa-qq:before { + content: "\f1d6"; +} +.fa-wechat:before, +.fa-weixin:before { + content: "\f1d7"; +} +.fa-send:before, +.fa-paper-plane:before { + content: "\f1d8"; +} +.fa-send-o:before, +.fa-paper-plane-o:before { + content: "\f1d9"; +} +.fa-history:before { + content: "\f1da"; +} +.fa-genderless:before, +.fa-circle-thin:before { + content: "\f1db"; +} +.fa-header:before { + content: "\f1dc"; +} +.fa-paragraph:before { + content: "\f1dd"; +} +.fa-sliders:before { + content: "\f1de"; +} +.fa-share-alt:before { + content: "\f1e0"; +} +.fa-share-alt-square:before { + content: "\f1e1"; +} +.fa-bomb:before { + content: "\f1e2"; +} +.fa-soccer-ball-o:before, +.fa-futbol-o:before { + content: "\f1e3"; +} +.fa-tty:before { + content: "\f1e4"; +} +.fa-binoculars:before { + content: "\f1e5"; +} +.fa-plug:before { + content: "\f1e6"; +} +.fa-slideshare:before { + content: "\f1e7"; +} +.fa-twitch:before { + content: "\f1e8"; +} +.fa-yelp:before { + content: "\f1e9"; +} +.fa-newspaper-o:before { + content: "\f1ea"; +} +.fa-wifi:before { + content: "\f1eb"; +} +.fa-calculator:before { + content: "\f1ec"; +} +.fa-paypal:before { + content: "\f1ed"; +} +.fa-google-wallet:before { + content: "\f1ee"; +} +.fa-cc-visa:before { + content: "\f1f0"; +} +.fa-cc-mastercard:before { + content: "\f1f1"; +} +.fa-cc-discover:before { + content: "\f1f2"; +} +.fa-cc-amex:before { + content: "\f1f3"; +} +.fa-cc-paypal:before { + content: "\f1f4"; +} +.fa-cc-stripe:before { + content: "\f1f5"; +} +.fa-bell-slash:before { + content: "\f1f6"; +} +.fa-bell-slash-o:before { + content: "\f1f7"; +} +.fa-trash:before { + content: "\f1f8"; +} +.fa-copyright:before { + content: "\f1f9"; +} +.fa-at:before { + content: "\f1fa"; +} +.fa-eyedropper:before { + content: "\f1fb"; +} +.fa-paint-brush:before { + content: "\f1fc"; +} +.fa-birthday-cake:before { + content: "\f1fd"; +} +.fa-area-chart:before { + content: "\f1fe"; +} +.fa-pie-chart:before { + content: "\f200"; +} +.fa-line-chart:before { + content: "\f201"; +} +.fa-lastfm:before { + content: "\f202"; +} +.fa-lastfm-square:before { + content: "\f203"; +} +.fa-toggle-off:before { + content: "\f204"; +} +.fa-toggle-on:before { + content: "\f205"; +} +.fa-bicycle:before { + content: "\f206"; +} +.fa-bus:before { + content: "\f207"; +} +.fa-ioxhost:before { + content: "\f208"; +} +.fa-angellist:before { + content: "\f209"; +} +.fa-cc:before { + content: "\f20a"; +} +.fa-shekel:before, +.fa-sheqel:before, +.fa-ils:before { + content: "\f20b"; +} +.fa-meanpath:before { + content: "\f20c"; +} +.fa-buysellads:before { + content: "\f20d"; +} +.fa-connectdevelop:before { + content: "\f20e"; +} +.fa-dashcube:before { + content: "\f210"; +} +.fa-forumbee:before { + content: "\f211"; +} +.fa-leanpub:before { + content: "\f212"; +} +.fa-sellsy:before { + content: "\f213"; +} +.fa-shirtsinbulk:before { + content: "\f214"; +} +.fa-simplybuilt:before { + content: "\f215"; +} +.fa-skyatlas:before { + content: "\f216"; +} +.fa-cart-plus:before { + content: "\f217"; +} +.fa-cart-arrow-down:before { + content: "\f218"; +} +.fa-diamond:before { + content: "\f219"; +} +.fa-ship:before { + content: "\f21a"; +} +.fa-user-secret:before { + content: "\f21b"; +} +.fa-motorcycle:before { + content: "\f21c"; +} +.fa-street-view:before { + content: "\f21d"; +} +.fa-heartbeat:before { + content: "\f21e"; +} +.fa-venus:before { + content: "\f221"; +} +.fa-mars:before { + content: "\f222"; +} +.fa-mercury:before { + content: "\f223"; +} +.fa-transgender:before { + content: "\f224"; +} +.fa-transgender-alt:before { + content: "\f225"; +} +.fa-venus-double:before { + content: "\f226"; +} +.fa-mars-double:before { + content: "\f227"; +} +.fa-venus-mars:before { + content: "\f228"; +} +.fa-mars-stroke:before { + content: "\f229"; +} +.fa-mars-stroke-v:before { + content: "\f22a"; +} +.fa-mars-stroke-h:before { + content: "\f22b"; +} +.fa-neuter:before { + content: "\f22c"; +} +.fa-facebook-official:before { + content: "\f230"; +} +.fa-pinterest-p:before { + content: "\f231"; +} +.fa-whatsapp:before { + content: "\f232"; +} +.fa-server:before { + content: "\f233"; +} +.fa-user-plus:before { + content: "\f234"; +} +.fa-user-times:before { + content: "\f235"; +} +.fa-hotel:before, +.fa-bed:before { + content: "\f236"; +} +.fa-viacoin:before { + content: "\f237"; +} +.fa-train:before { + content: "\f238"; +} +.fa-subway:before { + content: "\f239"; +} +.fa-medium:before { + content: "\f23a"; +} + +@font-face { + font-family: 'Source Sans Pro'; + font-style: normal; + font-weight: 400; + src: local('Source Sans Pro'), local('SourceSansPro-Regular'), url(../fonts/sourcesanspro/SourceSansPro-Regular.woff) format('woff'); +} + +@font-face { + font-family: 'Source Sans Pro'; + font-style: normal; + font-weight: bold; + src: local('Source Sans Pro Semibold'), local('SourceSansPro-Semibold'), url(../fonts/sourcesanspro/SourceSansPro-Semibold.woff) format('woff'); +} + +@font-face { + font-family: 'Source Sans Pro'; + font-style: italic; + font-weight: 400; + src: local('Source Sans Pro Italic'), local('SourceSansPro-It'), url(../fonts/sourcesanspro/SourceSansPro-It.woff) format('woff'); +} + +@font-face { + font-family: 'Source Sans Pro'; + font-style: italic; + font-weight: bold; + src: local('Source Sans Pro Semibold Italic'), local('SourceSansPro-SemiboldIt'), url(../fonts/sourcesanspro/SourceSansPro-SemiboldIt.woff) format('woff'); +} + +.article-entry pre, +.article-entry .highlight { + background: #2d2d2d; +/*margin: 0 article-padding * -1*/ + padding: 15px article-padding; + border-style: solid; + border-color: color-border; + border-width: 1px 0; + overflow: auto; + color: #ccc; +/*line-height: font-size * line-height*/ +} +.article-entry .highlight .gutter pre, +.article-entry .gist .gist-file .gist-data .line-numbers { + color: #666; + font-size: 0.85em; +} +.article-entry pre, +.article-entry code { + font-family: font-mono; +} +.article-entry code { + background: color-background; + text-shadow: 0 1px #fff; + padding: 0 0.3em; +} +.article-entry pre code { + background: none; + text-shadow: none; + padding: 0; +} +.article-entry .highlight pre { + border: none; + margin: 0; + padding: 0; +} +.article-entry .highlight table { + margin: 0; + width: auto; +} +.article-entry .highlight td { + border: none; + padding: 0; +} +.article-entry .highlight figcaption { + font-size: 0.85em; + color: #999; + line-height: 1em; + margin-bottom: 1em; +} +.article-entry .highlight figcaption a { + float: right; +} +.article-entry .highlight .gutter pre { + text-align: right; + padding-right: 20px; +} +.article-entry .gist { +/*margin: 0 article-padding * -1*/ + border-style: solid; + border-color: color-border; + border-width: 1px 0; + background: #2d2d2d; + padding: 15px article-padding 15px 0; +} +.article-entry .gist .gist-file { + border: none; + font-family: font-mono; + margin: 0; +} +.article-entry .gist .gist-file .gist-data { + background: none; + border: none; +} +.article-entry .gist .gist-file .gist-data .line-numbers { + background: none; + border: none; + padding: 0 20px 0 0; +} +.article-entry .gist .gist-file .gist-data .line-data { + padding: 0 !important; +} +.article-entry .gist .gist-file .highlight { + margin: 0; + padding: 0; + border: none; +} +.article-entry .gist .gist-file .gist-meta { + background: #2d2d2d; + color: #999; + font: 0.85em font-sans; + text-shadow: 0 0; + padding: 0; + margin-top: 1em; + margin-left: article-padding; +} +.article-entry .gist .gist-file .gist-meta a { + color: color-link; + font-weight: normal; +} +.article-entry .gist .gist-file .gist-meta a:hover { + text-decoration: underline; +} +pre .comment, +pre .title { + color: #999; +} +pre .variable, +pre .attribute, +pre .tag, +pre .regexp, +pre .ruby .constant, +pre .xml .tag .title, +pre .xml .pi, +pre .xml .doctype, +pre .html .doctype, +pre .css .id, +pre .css .class, +pre .css .pseudo { + color: #f2777a; +} +pre .number, +pre .preprocessor, +pre .built_in, +pre .literal, +pre .params, +pre .constant { + color: #f99157; +} +pre .class, +pre .ruby .class .title, +pre .css .rules .attribute { + color: #9c9; +} +pre .string, +pre .value, +pre .inheritance, +pre .header, +pre .ruby .symbol, +pre .xml .cdata { + color: #9c9; +} +pre .css .hexcolor { + color: #6cc; +} +pre .function, +pre .python .decorator, +pre .python .title, +pre .ruby .function .title, +pre .ruby .title .keyword, +pre .perl .sub, +pre .javascript .title, +pre .coffeescript .title { + color: #69c; +} +pre .keyword, +pre .javascript .function { + color: #c9c; +} +/* + * Copyright (c) 2014, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Fabien LOISON + */ +/** Variables for the PhotonUI Base style. **/ +/* + * Copyright (c) 2014, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Fabien LOISON + */ +/* + * Copyright (c) 2014, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Fabien LOISON + */ +.photonui-widget { + display: inline-block; + box-sizing: border-box; + margin: 0; + font-family: Arial, sans-serif; + font-size: 11pt; +} +.photonui-container-expand-child-horizontal > .photonui-widget:not(.photonui-widget-fixed-width), +.photonui-container-expand-child > .photonui-widget:not(.photonui-widget-fixed-width) { + width: 100% !important; +} +.photonui-container-expand-child-vertical > .photonui-widget:not(.photonui-widget-fixed-height), +.photonui-container-expand-child > .photonui-widget:not(.photonui-widget-fixed-height) { + height: 100% !important; +} +/** Reset some unwanted things **/ +.photonui-widget button::-moz-focus-inner, +.photonui-widget input[type="submit"]::-moz-focus-inner, +button.photonui-widget::-moz-focus-inner, +input[type="submit"].photonui-widget::-moz-focus-inner { + border: 0; + padding: 0; +} +/* + * Copyright (c) 2014, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Fabien LOISON + */ +.photonui-popupmenu { + overflow-y: auto !important; +} +.photonui-popupmenu > div > .photonui-menu { + min-width: 75px; +} +/* + * Copyright (c) 2014, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Fabien LOISON + */ +.photonui-colorbutton { + min-height: 30px; +} +.photonui-colorbutton span { + display: inline-block; + min-width: 50px; + min-height: 18px; +} +/* + * Copyright (c) 2014, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Fabien LOISON + */ +.photonui-select { + min-width: 75px; + min-height: 30px; + box-sizing: border-box; + outline: none; + display: -ms-flexbox; + display: flex; + -ms-flex-align: center; + align-items: center; + -ms-flex-direction: row; + flex-direction: row; +} +.photonui-select .photonui-menuitem { + -ms-flex-positive: 1; + flex-grow: 1; +} +.photonui-select .photonui-menuitem .photonui-menuitem-icon { + width: auto; + min-width: 0; + max-width: 30px; + margin: 0; +} +.photonui-select .photonui-menuitem .photonui-menuitem-icon > * { + margin-right: 5px !important; +} +.photonui-select.photonui-select-noicon .photonui-menuitem .photonui-menuitem-icon { + display: none; +} +/* + * Copyright (c) 2014, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Fabien LOISON + */ +.photonui-basewindow { + position: absolute; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + min-width: -webkit-max-content; + min-width: -moz-max-content; + min-width: -ms-max-content; + min-width: max-content; +} +/* + * Copyright (c) 2014, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Fabien LOISON + */ +.photonui-dialog-buttons { + white-space: nowrap; +} +/* + * Copyright (c) 2016, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Alexis BREUST + */ +.photonui-expander { + box-sizing: border-box; + display: block; +} +.photonui-expander-title { + display: block; + cursor: default; + text-align: left; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + width: 100%; +} +.photonui-expander-content { + display: block; + box-sizing: border-box; + width: 100%; +} +/* + * Copyright (c) 2014, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Fabien LOISON + */ +.photonui-menuitem { + box-sizing: border-box; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + display: -ms-flexbox; + display: flex; + -ms-flex-align: center; + align-items: center; + height: 30px; + padding: 0 5px; + text-align: left; +} +.photonui-menuitem .photonui-menuitem-icon { + box-sizing: border-box; + width: 16px; + min-width: 16px; + max-width: 16px; + overflow: hidden; + margin-right: 5px; + font-size: 16px; +} +.photonui-menuitem .photonui-menuitem-icon > * { + color: inherit; +} +.photonui-menuitem .photonui-menuitem-text { + -ms-flex-positive: 1; + flex-grow: 1; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} +.photonui-menuitem .photonui-menuitem-widget { + margin-left: 5px; +} +/* + * Copyright (c) 2014, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Fabien LOISON + */ +.photonui-popupwindow { + z-index: 4000; + box-sizing: border-box; +} +/* + * Copyright (c) 2014, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Fabien LOISON + */ +.photonui-window-title { + overflow: hidden; +} +.photonui-window-title-close-button { + float: right; +} +.photonui-window-title-text { + display: block; + width: 100%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + pointer-events: none; +} +.photonui-window-have-button .photonui-window-title-text { + width: calc(100% - 40px); +} +.photonui-window-content { + overflow: hidden; +} +.photonui-window-modalbox { + position: fixed; + top: 0; + left: 0; + bottom: 0; + right: 0; + z-index: 3000; +} +.photonui-window.photonui-window-fullscreen { + top: 0 !important; + left: 0 !important; + bottom: 0 !important; + right: 0 !important; +} +.photonui-window.photonui-window-fullscreen .photonui-window-content { + width: 100% !important; + min-width: 100% !important; + max-width: 100% !important; + height: 100% !important; + min-height: 100% !important; + max-height: 100% !important; +} +/* + * Copyright (c) 2014, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Fabien LOISON + */ +.photonui-viewport { + box-sizing: border-box; + vertical-align: middle; +} +.photonui-viewport > * { + height: auto !important; +} +/* + * Copyright (c) 2014, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Fabien LOISON + */ +.photonui-boxlayout { + display: -ms-flexbox !important; + display: flex !important; + box-sizing: border-box; +} +.photonui-boxlayout.photonui-layout-orientation-horizontal { + -ms-flex-direction: row; + flex-direction: row; +} +.photonui-boxlayout.photonui-layout-orientation-vertical { + -ms-flex-direction: column; + flex-direction: column; +} +.photonui-boxlayout > .photonui-boxlayout-item { + -webit-flex-grow: 1; + -ms-flex-positive: 1; + flex-grow: 1; + display: -ms-flexbox; + display: flex; + -ms-flex-direction: row; + flex-direction: row; +} +.photonui-boxlayout > .photonui-boxlayout-item > * { + display: block; + width: 100%; +} +.photonui-boxlayout > .photonui-layout-align-stretch { + -ms-flex-item-align: stretch; + -ms-grid-row-align: stretch; + align-self: stretch; +} +.photonui-boxlayout > .photonui-layout-align-start { + -ms-flex-item-align: start; + align-self: flex-start; +} +.photonui-boxlayout > .photonui-layout-align-center { + -ms-flex-item-align: center; + -ms-grid-row-align: center; + align-self: center; +} +.photonui-boxlayout > .photonui-layout-align-end { + -ms-flex-item-align: end; + align-self: flex-end; +} +/* + * Copyright (c) 2014, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Fabien LOISON + */ +.photonui-fluidlayout { + overflow: hidden; + display: -ms-flexbox; + display: flex; + -ms-flex-align: stretch; + align-items: stretch; +} +.photonui-fluidlayout > .photonui-fluidlayout-innerbox { + display: -ms-flexbox; + display: flex; + -ms-flex-wrap: wrap; + flex-wrap: wrap; + height: 100%; + width: 100%; + -ms-flex-line-pack: start; + align-content: flex-start; +} +.photonui-fluidlayout > .photonui-fluidlayout-innerbox > .photonui-container.photonui-layout-align-stretch { + -ms-flex-item-align: stretch; + -ms-grid-row-align: stretch; + align-self: stretch; + height: 100%; +} +.photonui-fluidlayout > .photonui-fluidlayout-innerbox > .photonui-container.photonui-layout-align-stretch > * { + height: 100% !important; +} +.photonui-fluidlayout > .photonui-fluidlayout-innerbox > .photonui-container.photonui-layout-align-start { + -ms-flex-item-align: start; + align-self: flex-start; +} +.photonui-fluidlayout > .photonui-fluidlayout-innerbox > .photonui-container.photonui-layout-align-center { + -ms-flex-item-align: center; + -ms-grid-row-align: center; + align-self: center; +} +.photonui-fluidlayout > .photonui-fluidlayout-innerbox > .photonui-container.photonui-layout-align-end { + -ms-flex-item-align: end; + align-self: flex-end; +} +/* + * Copyright (c) 2014, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Fabien LOISON + */ +.photonui-gridlayout { + display: inline-block; + box-sizing: border-box; +} +.photonui-gridlayout > table { + box-sizing: border-box; + border-collapse: collapse; + width: 100%; + height: 100%; +} +.photonui-gridlayout > table > tbody > tr > td.photonui-gridlayout-cell { + padding: 0; + box-sizing: border-box; +} +.photonui-gridlayout > table > tbody > tr > td.photonui-gridlayout-cell > .photonui-gridlayout-wrapper { + display: inline-block; + vertical-align: middle; + text-align: left; +} +.photonui-gridlayout > table > tbody > tr > td.photonui-gridlayout-cell > .photonui-gridlayout-wrapper > *:not(.photonui-widget-fixed-width) { + width: 100% !important; +} +.photonui-gridlayout > table > tbody > tr > td.photonui-gridlayout-cell > .photonui-gridlayout-wrapper > *:not(.photonui-widget-fixed-height) { + height: 100% !important; +} +.photonui-gridlayout > table > tbody > tr > td.photonui-gridlayout-cell.photonui-layout-verticalalign-stretch > .photonui-gridlayout-wrapper { + height: 100%; +} +.photonui-gridlayout > table > tbody > tr > td.photonui-gridlayout-cell.photonui-layout-verticalalign-start { + vertical-align: top; +} +.photonui-gridlayout > table > tbody > tr > td.photonui-gridlayout-cell.photonui-layout-verticalalign-center { + vertical-align: middle; +} +.photonui-gridlayout > table > tbody > tr > td.photonui-gridlayout-cell.photonui-layout-verticalalign-end { + vertical-align: bottom; +} +.photonui-gridlayout > table > tbody > tr > td.photonui-gridlayout-cell.photonui-layout-horizontalalign-stretch > .photonui-gridlayout-wrapper { + width: 100%; +} +.photonui-gridlayout > table > tbody > tr > td.photonui-gridlayout-cell.photonui-layout-horizontalalign-start { + text-align: left; +} +.photonui-gridlayout > table > tbody > tr > td.photonui-gridlayout-cell.photonui-layout-horizontalalign-center { + text-align: center; +} +.photonui-gridlayout > table > tbody > tr > td.photonui-gridlayout-cell.photonui-layout-horizontalalign-end { + text-align: right; +} +.photonui-gridlayout > table > tbody > tr > td.photonui-gridlayout-cell.photonui-gridlayout-lastcol { + padding-right: 0 !important; +} +.photonui-gridlayout > table > tbody > tr > td.photonui-gridlayout-cell.photonui-gridlayout-lastrow { + padding-bottom: 0 !important; +} +/* + * Copyright (c) 2014, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Fabien LOISON + */ +.photonui-menu { + box-sizing: border-box; + vertical-align: middle; +} +.photonui-menu > * { + width: 100%; +} +.photonui-menu.photonui-menu-noicon .photonui-menuitem .photonui-menuitem-icon { + display: none; +} +/* + * Copyright (c) 2014, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Fabien LOISON + */ +.photonui-button { + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + text-align: center; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +.photonui-button > span { + display: inline-block !important; +} +.photonui-button > span i { + margin-bottom: -1px; +} +.photonui-button span + span { + margin-left: 5px; +} +/* + * Copyright (c) 2014, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Fabien LOISON + */ +.photonui-colorpalette { + border-collapse: separate; + border-spacing: 4px; +} +/* + * Copyright (c) 2014, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Fabien LOISON + */ +.photonui-colorpicker { + text-align: center; +} +.photonui-colorpicker .photonui-colorpicker-previewouter { + box-sizing: border-box; + width: 100%; + display: block; + height: 35px; + padding: 0 10px 5px 10px; +} +.photonui-colorpicker .photonui-colorpicker-preview { + display: block; + height: 35px; + border: none; + width: 100%; + box-sizing: border-box; +} +/* + * Copyright (c) 2014, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Fabien LOISON + */ +.photonui-field { + box-sizing: border-box; + min-height: 30px; +} +/* + * Copyright (c) 2014, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Fabien LOISON + */ +.photonui-slider { + display: -ms-flexbox !important; + display: flex !important; + -ms-flex-direction: row; + flex-direction: row; + -ms-flex-wrap: nowrap; + flex-wrap: nowrap; + -ms-flex-align: center; + align-items: center; +} +.photonui-slider .photonui-slider-slider { + box-sizing: border-box; + -ms-flex-positive: 1; + flex-grow: 1; +} +.photonui-slider .photonui-slider-slider .photonui-slider-grip { + position: relative; + display: block; + box-sizing: border-box; +} +.photonui-slider .photonui-field { + width: 25%; + min-width: 50px; + max-width: 75px; +} +/* + * Copyright (c) 2014, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Fabien LOISON + */ +.photonui-switch { + display: inline-block; +} +.photonui-switch input { + display: none; +} +.photonui-switch span { + box-sizing: border-box; + display: block; +} +.photonui-switch span:after { + content: ""; + display: block; + width: 50%; + height: 100%; + box-sizing: border-box; +} +.photonui-switch input:checked + span:after { + margin-left: 50%; +} +/* + * Copyright (c) 2014, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Fabien LOISON + */ +.photonui-field-textarea { + resize: none; + min-height: 50px; +} +/* + * Copyright (c) 2014, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Fabien LOISON + */ +.photonui-togglebutton { + display: inline-block; +} +.photonui-togglebutton input { + display: none; +} +.photonui-togglebutton button { + width: 100%; + height: 100%; +} +/* + * Copyright (c) 2014, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Fabien LOISON + */ +/* + * Copyright (c) 2014, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Clément LEVASSEUR + */ +.photonui-image { + display: inline-block; + text-align: center; +} +.photonui-image img { + vertical-align: middle; +} +/* + * Copyright (c) 2014, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Fabien LOISON + */ +.photonui-canvas { + display: inline-block; + text-align: center; +} +.photonui-canvas > canvas { + vertical-align: middle; +} +/* + * Copyright (c) 2014, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Fabien LOISON + */ +.photonui-label { + white-space: nowrap; +} +/* + * Copyright (c) 2014, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Fabien LOISON + */ +.photonui-progressbar { + position: relative; + box-sizing: border-box; + min-height: 26px; + min-width: 26px; + cursor: default; + overflow: hidden; +} +.photonui-progressbar .photonui-progressbar-bar { + z-index: 1; + box-sizing: border-box; + position: absolute; + top: 0; + left: 0; +} +.photonui-progressbar .photonui-progressbar-text { + z-index: 2; + position: absolute; + box-sizing: border-box; + white-space: nowrap; + text-align: center; + width: 100%; + height: 26px; + line-height: 26px; + top: calc(50% - 13px); + left: 0; +} +.photonui-progressbar.photonui-progressbar-horizontal { + min-width: 75px; +} +.photonui-progressbar.photonui-progressbar-horizontal .photonui-progressbar-bar { + height: 100%; +} +.photonui-progressbar.photonui-progressbar-vertical { + min-height: 75px; +} +.photonui-progressbar.photonui-progressbar-vertical .photonui-progressbar-bar { + width: 100%; +} +/** Pulsate **/ +@keyframes photonui-progressbar-pulsate-horizontal { + 0% { + width: 0% ; + left: 0% ; + } + 25% { + width: 30% ; + left: 0% ; + } + 75% { + width: 30% ; + left: 70% ; + } + 100% { + width: 0% ; + left: 100% ; + } +} +@keyframes photonui-progressbar-pulsate-vertical { + 0% { + height: 0% ; + bottom: 0% ; + } + 25% { + height: 30% ; + bottom: 0% ; + } + 75% { + height: 30% ; + bottom: 70% ; + } + 100% { + height: 0% ; + bottom: 100% ; + } +} +.photonui-progressbar.photonui-progressbar-pulsate.photonui-progressbar-horizontal .photonui-progressbar-text { + display: none; +} +.photonui-progressbar.photonui-progressbar-pulsate.photonui-progressbar-horizontal .photonui-progressbar-bar { + width: 20%; + animation: photonui-progressbar-pulsate-horizontal linear 1.5s infinite; +} +.photonui-progressbar.photonui-progressbar-pulsate.photonui-progressbar-vertical .photonui-progressbar-text { + display: none; +} +.photonui-progressbar.photonui-progressbar-pulsate.photonui-progressbar-vertical .photonui-progressbar-bar { + height: 20%; + animation: photonui-progressbar-pulsate-vertical linear 1.5s infinite; +} +/* + * Copyright (c) 2014, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Fabien LOISON + */ +.photonui-separator { + padding: 0; + display: inline-block; +} +.photonui-separator hr { + vertical-align: middle; + width: 0; + height: 0; + margin: 0; +} +.photonui-separator.photonui-separator-horizontal { + width: 100%; +} +.photonui-separator.photonui-separator-horizontal hr { + width: 100%; + min-width: 20px; +} +.photonui-separator.photonui-separator-vertical { + /*height: 100%;*/ +} +.photonui-separator.photonui-separator-vertical hr { + height: 100%; + min-height: 20px; +} +/* + * Copyright (c) 2014, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Fabien LOISON + */ +.photonui-spriteicon > span { + font-size: 1px; + line-height: inherit; + display: inline-block; + width: 16px; + height: 16px; + vertical-align: text-bottom; + background: gray; +} +/* + * Copyright (c) 2014-2015, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Fabien LOISON + */ +/* All the style is in ../layout/tablayout.less */ +.photonui-tabitem-tab span + span { + margin-left: 5px; +} +/* + * Copyright (c) 2014-2015, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Fabien LOISON + */ +.photonui-tablayout { + display: inline-block; + height: 100%; + box-sizing: border-box; +} +.photonui-tablayout .photonui-tablayout-innerbox { + display: -ms-flexbox; + display: flex; + -ms-flex-wrap: nowrap; + flex-wrap: nowrap; + width: 100%; + height: 100%; +} +.photonui-tablayout .photonui-tablayout-innerbox .photonui-tablayout-tabs { + display: -ms-flexbox; + display: flex; + box-sizing: border-box; +} +.photonui-tablayout .photonui-tablayout-innerbox .photonui-tablayout-tabs .photonui-tabitem-tab { + display: -ms-flexbox; + display: flex; + box-sizing: border-box; + min-width: 10px; + max-width: 150px; + overflow: hidden; + white-space: nowrap; + -wibkit-user-select: none; + -moz-user-select: none; + -webkit-user-select: none; + -ms-user-select: none; + user-select: none; +} +.photonui-tablayout .photonui-tablayout-innerbox .photonui-tablayout-tabs .photonui-tabitem-tab .photonui-tabitem-title { + overflow: hidden; + text-overflow: ellipsis; +} +.photonui-tablayout .photonui-tablayout-innerbox .photonui-tablayout-tabs .photonui-tabitem-tab .photonui-tabitem-lefticon > .photonui-iconbutton > .photonui-faicon, +.photonui-tablayout .photonui-tablayout-innerbox .photonui-tablayout-tabs .photonui-tabitem-tab .photonui-tabitem-righticon > .photonui-iconbutton > .photonui-faicon { + vertical-align: baseline; +} +.photonui-tablayout .photonui-tablayout-innerbox .photonui-tablayout-content { + box-sizing: border-box; + min-height: 20px; + min-width: 20px; + -ms-flex-positive: 1; + flex-grow: 1; +} +.photonui-tablayout .photonui-tablayout-innerbox .photonui-tablayout-content > * { + height: 100%; + width: 100%; +} +.photonui-tablayout.photonui-tablayout-tabposition-top > .photonui-tablayout-innerbox { + -ms-flex-direction: column; + flex-direction: column; +} +.photonui-tablayout.photonui-tablayout-tabposition-top > .photonui-tablayout-innerbox > .photonui-tablayout-tabs { + -ms-flex-direction: row; + flex-direction: row; +} +.photonui-tablayout.photonui-tablayout-tabposition-bottom > .photonui-tablayout-innerbox { + -ms-flex-direction: column-reverse; + flex-direction: column-reverse; +} +.photonui-tablayout.photonui-tablayout-tabposition-bottom > .photonui-tablayout-innerbox > .photonui-tablayout-tabs { + -ms-flex-direction: row; + flex-direction: row; +} +.photonui-tablayout.photonui-tablayout-tabposition-left > .photonui-tablayout-innerbox { + -ms-flex-direction: row; + flex-direction: row; +} +.photonui-tablayout.photonui-tablayout-tabposition-left > .photonui-tablayout-innerbox > .photonui-tablayout-tabs { + -ms-flex-direction: column; + flex-direction: column; +} +.photonui-tablayout.photonui-tablayout-tabposition-right > .photonui-tablayout-innerbox { + -ms-flex-direction: row-reverse; + flex-direction: row-reverse; +} +.photonui-tablayout.photonui-tablayout-tabposition-right > .photonui-tablayout-innerbox > .photonui-tablayout-tabs { + -ms-flex-direction: column; + flex-direction: column; +} +/* + * Copyright (c) 2014-2015, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Fabien LOISON + */ +.photonui-fontselect { + /* ... */ +} +/* + * Copyright (c) 2014-2015, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Fabien LOISON + */ +.photonui-text { + /* ... */ +} +/* + * Copyright (c) 2014-2015, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Fabien LOISON + */ +@font-face { + font-family: 'FontAwesome'; + src: url('assets/fontawesome-webfont.eot?v=4.7.0'); + src: url('assets/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'), url('assets/fontawesome-webfont.woff2?v=4.7.0') format('woff2'), url('assets/fontawesome-webfont.woff?v=4.7.0') format('woff'), url('assets/fontawesome-webfont.ttf?v=4.7.0') format('truetype'), url('assets/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg'); + font-weight: normal; + font-style: normal; +} +.fa { + display: inline-block; + font: normal normal normal 14px/1 FontAwesome; + font-size: inherit; + text-rendering: auto; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +/* makes the font 33% larger relative to the icon container */ +.fa-lg { + font-size: 1.33333333em; + line-height: 0.75em; + vertical-align: -15%; +} +.fa-2x { + font-size: 2em; +} +.fa-3x { + font-size: 3em; +} +.fa-4x { + font-size: 4em; +} +.fa-5x { + font-size: 5em; +} +.fa-fw { + width: 1.28571429em; + text-align: center; +} +.fa-ul { + padding-left: 0; + margin-left: 2.14285714em; + list-style-type: none; +} +.fa-ul > li { + position: relative; +} +.fa-li { + position: absolute; + left: -2.14285714em; + width: 2.14285714em; + top: 0.14285714em; + text-align: center; +} +.fa-li.fa-lg { + left: -1.85714286em; +} +.fa-border { + padding: .2em .25em .15em; + border: solid 0.08em #eee; + border-radius: .1em; +} +.fa-pull-left { + float: left; +} +.fa-pull-right { + float: right; +} +.fa.fa-pull-left { + margin-right: .3em; +} +.fa.fa-pull-right { + margin-left: .3em; +} +/* Deprecated as of 4.4.0 */ +.pull-right { + float: right; +} +.pull-left { + float: left; +} +.fa.pull-left { + margin-right: .3em; +} +.fa.pull-right { + margin-left: .3em; +} +.fa-spin { + animation: fa-spin 2s infinite linear; +} +.fa-pulse { + animation: fa-spin 1s infinite steps(8); +} +@keyframes fa-spin { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(359deg); + } +} +.fa-rotate-90 { + -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=1)"; + transform: rotate(90deg); +} +.fa-rotate-180 { + -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2)"; + transform: rotate(180deg); +} +.fa-rotate-270 { + -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=3)"; + transform: rotate(270deg); +} +.fa-flip-horizontal { + -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)"; + transform: scale(-1, 1); +} +.fa-flip-vertical { + -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"; + transform: scale(1, -1); +} +:root .fa-rotate-90, +:root .fa-rotate-180, +:root .fa-rotate-270, +:root .fa-flip-horizontal, +:root .fa-flip-vertical { + filter: none; +} +.fa-stack { + position: relative; + display: inline-block; + width: 2em; + height: 2em; + line-height: 2em; + vertical-align: middle; +} +.fa-stack-1x, +.fa-stack-2x { + position: absolute; + left: 0; + width: 100%; + text-align: center; +} +.fa-stack-1x { + line-height: inherit; +} +.fa-stack-2x { + font-size: 2em; +} +.fa-inverse { + color: #fff; +} +/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen + readers do not read off random characters that represent icons */ +.fa-glass:before { + content: "\f000"; +} +.fa-music:before { + content: "\f001"; +} +.fa-search:before { + content: "\f002"; +} +.fa-envelope-o:before { + content: "\f003"; +} +.fa-heart:before { + content: "\f004"; +} +.fa-star:before { + content: "\f005"; +} +.fa-star-o:before { + content: "\f006"; +} +.fa-user:before { + content: "\f007"; +} +.fa-film:before { + content: "\f008"; +} +.fa-th-large:before { + content: "\f009"; +} +.fa-th:before { + content: "\f00a"; +} +.fa-th-list:before { + content: "\f00b"; +} +.fa-check:before { + content: "\f00c"; +} +.fa-remove:before, +.fa-close:before, +.fa-times:before { + content: "\f00d"; +} +.fa-search-plus:before { + content: "\f00e"; +} +.fa-search-minus:before { + content: "\f010"; +} +.fa-power-off:before { + content: "\f011"; +} +.fa-signal:before { + content: "\f012"; +} +.fa-gear:before, +.fa-cog:before { + content: "\f013"; +} +.fa-trash-o:before { + content: "\f014"; +} +.fa-home:before { + content: "\f015"; +} +.fa-file-o:before { + content: "\f016"; +} +.fa-clock-o:before { + content: "\f017"; +} +.fa-road:before { + content: "\f018"; +} +.fa-download:before { + content: "\f019"; +} +.fa-arrow-circle-o-down:before { + content: "\f01a"; +} +.fa-arrow-circle-o-up:before { + content: "\f01b"; +} +.fa-inbox:before { + content: "\f01c"; +} +.fa-play-circle-o:before { + content: "\f01d"; +} +.fa-rotate-right:before, +.fa-repeat:before { + content: "\f01e"; +} +.fa-refresh:before { + content: "\f021"; +} +.fa-list-alt:before { + content: "\f022"; +} +.fa-lock:before { + content: "\f023"; +} +.fa-flag:before { + content: "\f024"; +} +.fa-headphones:before { + content: "\f025"; +} +.fa-volume-off:before { + content: "\f026"; +} +.fa-volume-down:before { + content: "\f027"; +} +.fa-volume-up:before { + content: "\f028"; +} +.fa-qrcode:before { + content: "\f029"; +} +.fa-barcode:before { + content: "\f02a"; +} +.fa-tag:before { + content: "\f02b"; +} +.fa-tags:before { + content: "\f02c"; +} +.fa-book:before { + content: "\f02d"; +} +.fa-bookmark:before { + content: "\f02e"; +} +.fa-print:before { + content: "\f02f"; +} +.fa-camera:before { + content: "\f030"; +} +.fa-font:before { + content: "\f031"; +} +.fa-bold:before { + content: "\f032"; +} +.fa-italic:before { + content: "\f033"; +} +.fa-text-height:before { + content: "\f034"; +} +.fa-text-width:before { + content: "\f035"; +} +.fa-align-left:before { + content: "\f036"; +} +.fa-align-center:before { + content: "\f037"; +} +.fa-align-right:before { + content: "\f038"; +} +.fa-align-justify:before { + content: "\f039"; +} +.fa-list:before { + content: "\f03a"; +} +.fa-dedent:before, +.fa-outdent:before { + content: "\f03b"; +} +.fa-indent:before { + content: "\f03c"; +} +.fa-video-camera:before { + content: "\f03d"; +} +.fa-photo:before, +.fa-image:before, +.fa-picture-o:before { + content: "\f03e"; +} +.fa-pencil:before { + content: "\f040"; +} +.fa-map-marker:before { + content: "\f041"; +} +.fa-adjust:before { + content: "\f042"; +} +.fa-tint:before { + content: "\f043"; +} +.fa-edit:before, +.fa-pencil-square-o:before { + content: "\f044"; +} +.fa-share-square-o:before { + content: "\f045"; +} +.fa-check-square-o:before { + content: "\f046"; +} +.fa-arrows:before { + content: "\f047"; +} +.fa-step-backward:before { + content: "\f048"; +} +.fa-fast-backward:before { + content: "\f049"; +} +.fa-backward:before { + content: "\f04a"; +} +.fa-play:before { + content: "\f04b"; +} +.fa-pause:before { + content: "\f04c"; +} +.fa-stop:before { + content: "\f04d"; +} +.fa-forward:before { + content: "\f04e"; +} +.fa-fast-forward:before { + content: "\f050"; +} +.fa-step-forward:before { + content: "\f051"; +} +.fa-eject:before { + content: "\f052"; +} +.fa-chevron-left:before { + content: "\f053"; +} +.fa-chevron-right:before { + content: "\f054"; +} +.fa-plus-circle:before { + content: "\f055"; +} +.fa-minus-circle:before { + content: "\f056"; +} +.fa-times-circle:before { + content: "\f057"; +} +.fa-check-circle:before { + content: "\f058"; +} +.fa-question-circle:before { + content: "\f059"; +} +.fa-info-circle:before { + content: "\f05a"; +} +.fa-crosshairs:before { + content: "\f05b"; +} +.fa-times-circle-o:before { + content: "\f05c"; +} +.fa-check-circle-o:before { + content: "\f05d"; +} +.fa-ban:before { + content: "\f05e"; +} +.fa-arrow-left:before { + content: "\f060"; +} +.fa-arrow-right:before { + content: "\f061"; +} +.fa-arrow-up:before { + content: "\f062"; +} +.fa-arrow-down:before { + content: "\f063"; +} +.fa-mail-forward:before, +.fa-share:before { + content: "\f064"; +} +.fa-expand:before { + content: "\f065"; +} +.fa-compress:before { + content: "\f066"; +} +.fa-plus:before { + content: "\f067"; +} +.fa-minus:before { + content: "\f068"; +} +.fa-asterisk:before { + content: "\f069"; +} +.fa-exclamation-circle:before { + content: "\f06a"; +} +.fa-gift:before { + content: "\f06b"; +} +.fa-leaf:before { + content: "\f06c"; +} +.fa-fire:before { + content: "\f06d"; +} +.fa-eye:before { + content: "\f06e"; +} +.fa-eye-slash:before { + content: "\f070"; +} +.fa-warning:before, +.fa-exclamation-triangle:before { + content: "\f071"; +} +.fa-plane:before { + content: "\f072"; +} +.fa-calendar:before { + content: "\f073"; +} +.fa-random:before { + content: "\f074"; +} +.fa-comment:before { + content: "\f075"; +} +.fa-magnet:before { + content: "\f076"; +} +.fa-chevron-up:before { + content: "\f077"; +} +.fa-chevron-down:before { + content: "\f078"; +} +.fa-retweet:before { + content: "\f079"; +} +.fa-shopping-cart:before { + content: "\f07a"; +} +.fa-folder:before { + content: "\f07b"; +} +.fa-folder-open:before { + content: "\f07c"; +} +.fa-arrows-v:before { + content: "\f07d"; +} +.fa-arrows-h:before { + content: "\f07e"; +} +.fa-bar-chart-o:before, +.fa-bar-chart:before { + content: "\f080"; +} +.fa-twitter-square:before { + content: "\f081"; +} +.fa-facebook-square:before { + content: "\f082"; +} +.fa-camera-retro:before { + content: "\f083"; +} +.fa-key:before { + content: "\f084"; +} +.fa-gears:before, +.fa-cogs:before { + content: "\f085"; +} +.fa-comments:before { + content: "\f086"; +} +.fa-thumbs-o-up:before { + content: "\f087"; +} +.fa-thumbs-o-down:before { + content: "\f088"; +} +.fa-star-half:before { + content: "\f089"; +} +.fa-heart-o:before { + content: "\f08a"; +} +.fa-sign-out:before { + content: "\f08b"; +} +.fa-linkedin-square:before { + content: "\f08c"; +} +.fa-thumb-tack:before { + content: "\f08d"; +} +.fa-external-link:before { + content: "\f08e"; +} +.fa-sign-in:before { + content: "\f090"; +} +.fa-trophy:before { + content: "\f091"; +} +.fa-github-square:before { + content: "\f092"; +} +.fa-upload:before { + content: "\f093"; +} +.fa-lemon-o:before { + content: "\f094"; +} +.fa-phone:before { + content: "\f095"; +} +.fa-square-o:before { + content: "\f096"; +} +.fa-bookmark-o:before { + content: "\f097"; +} +.fa-phone-square:before { + content: "\f098"; +} +.fa-twitter:before { + content: "\f099"; +} +.fa-facebook-f:before, +.fa-facebook:before { + content: "\f09a"; +} +.fa-github:before { + content: "\f09b"; +} +.fa-unlock:before { + content: "\f09c"; +} +.fa-credit-card:before { + content: "\f09d"; +} +.fa-feed:before, +.fa-rss:before { + content: "\f09e"; +} +.fa-hdd-o:before { + content: "\f0a0"; +} +.fa-bullhorn:before { + content: "\f0a1"; +} +.fa-bell:before { + content: "\f0f3"; +} +.fa-certificate:before { + content: "\f0a3"; +} +.fa-hand-o-right:before { + content: "\f0a4"; +} +.fa-hand-o-left:before { + content: "\f0a5"; +} +.fa-hand-o-up:before { + content: "\f0a6"; +} +.fa-hand-o-down:before { + content: "\f0a7"; +} +.fa-arrow-circle-left:before { + content: "\f0a8"; +} +.fa-arrow-circle-right:before { + content: "\f0a9"; +} +.fa-arrow-circle-up:before { + content: "\f0aa"; +} +.fa-arrow-circle-down:before { + content: "\f0ab"; +} +.fa-globe:before { + content: "\f0ac"; +} +.fa-wrench:before { + content: "\f0ad"; +} +.fa-tasks:before { + content: "\f0ae"; +} +.fa-filter:before { + content: "\f0b0"; +} +.fa-briefcase:before { + content: "\f0b1"; +} +.fa-arrows-alt:before { + content: "\f0b2"; +} +.fa-group:before, +.fa-users:before { + content: "\f0c0"; +} +.fa-chain:before, +.fa-link:before { + content: "\f0c1"; +} +.fa-cloud:before { + content: "\f0c2"; +} +.fa-flask:before { + content: "\f0c3"; +} +.fa-cut:before, +.fa-scissors:before { + content: "\f0c4"; +} +.fa-copy:before, +.fa-files-o:before { + content: "\f0c5"; +} +.fa-paperclip:before { + content: "\f0c6"; +} +.fa-save:before, +.fa-floppy-o:before { + content: "\f0c7"; +} +.fa-square:before { + content: "\f0c8"; +} +.fa-navicon:before, +.fa-reorder:before, +.fa-bars:before { + content: "\f0c9"; +} +.fa-list-ul:before { + content: "\f0ca"; +} +.fa-list-ol:before { + content: "\f0cb"; +} +.fa-strikethrough:before { + content: "\f0cc"; +} +.fa-underline:before { + content: "\f0cd"; +} +.fa-table:before { + content: "\f0ce"; +} +.fa-magic:before { + content: "\f0d0"; +} +.fa-truck:before { + content: "\f0d1"; +} +.fa-pinterest:before { + content: "\f0d2"; +} +.fa-pinterest-square:before { + content: "\f0d3"; +} +.fa-google-plus-square:before { + content: "\f0d4"; +} +.fa-google-plus:before { + content: "\f0d5"; +} +.fa-money:before { + content: "\f0d6"; +} +.fa-caret-down:before { + content: "\f0d7"; +} +.fa-caret-up:before { + content: "\f0d8"; +} +.fa-caret-left:before { + content: "\f0d9"; +} +.fa-caret-right:before { + content: "\f0da"; +} +.fa-columns:before { + content: "\f0db"; +} +.fa-unsorted:before, +.fa-sort:before { + content: "\f0dc"; +} +.fa-sort-down:before, +.fa-sort-desc:before { + content: "\f0dd"; +} +.fa-sort-up:before, +.fa-sort-asc:before { + content: "\f0de"; +} +.fa-envelope:before { + content: "\f0e0"; +} +.fa-linkedin:before { + content: "\f0e1"; +} +.fa-rotate-left:before, +.fa-undo:before { + content: "\f0e2"; +} +.fa-legal:before, +.fa-gavel:before { + content: "\f0e3"; +} +.fa-dashboard:before, +.fa-tachometer:before { + content: "\f0e4"; +} +.fa-comment-o:before { + content: "\f0e5"; +} +.fa-comments-o:before { + content: "\f0e6"; +} +.fa-flash:before, +.fa-bolt:before { + content: "\f0e7"; +} +.fa-sitemap:before { + content: "\f0e8"; +} +.fa-umbrella:before { + content: "\f0e9"; +} +.fa-paste:before, +.fa-clipboard:before { + content: "\f0ea"; +} +.fa-lightbulb-o:before { + content: "\f0eb"; +} +.fa-exchange:before { + content: "\f0ec"; +} +.fa-cloud-download:before { + content: "\f0ed"; +} +.fa-cloud-upload:before { + content: "\f0ee"; +} +.fa-user-md:before { + content: "\f0f0"; +} +.fa-stethoscope:before { + content: "\f0f1"; +} +.fa-suitcase:before { + content: "\f0f2"; +} +.fa-bell-o:before { + content: "\f0a2"; +} +.fa-coffee:before { + content: "\f0f4"; +} +.fa-cutlery:before { + content: "\f0f5"; +} +.fa-file-text-o:before { + content: "\f0f6"; +} +.fa-building-o:before { + content: "\f0f7"; +} +.fa-hospital-o:before { + content: "\f0f8"; +} +.fa-ambulance:before { + content: "\f0f9"; +} +.fa-medkit:before { + content: "\f0fa"; +} +.fa-fighter-jet:before { + content: "\f0fb"; +} +.fa-beer:before { + content: "\f0fc"; +} +.fa-h-square:before { + content: "\f0fd"; +} +.fa-plus-square:before { + content: "\f0fe"; +} +.fa-angle-double-left:before { + content: "\f100"; +} +.fa-angle-double-right:before { + content: "\f101"; +} +.fa-angle-double-up:before { + content: "\f102"; +} +.fa-angle-double-down:before { + content: "\f103"; +} +.fa-angle-left:before { + content: "\f104"; +} +.fa-angle-right:before { + content: "\f105"; +} +.fa-angle-up:before { + content: "\f106"; +} +.fa-angle-down:before { + content: "\f107"; +} +.fa-desktop:before { + content: "\f108"; +} +.fa-laptop:before { + content: "\f109"; +} +.fa-tablet:before { + content: "\f10a"; +} +.fa-mobile-phone:before, +.fa-mobile:before { + content: "\f10b"; +} +.fa-circle-o:before { + content: "\f10c"; +} +.fa-quote-left:before { + content: "\f10d"; +} +.fa-quote-right:before { + content: "\f10e"; +} +.fa-spinner:before { + content: "\f110"; +} +.fa-circle:before { + content: "\f111"; +} +.fa-mail-reply:before, +.fa-reply:before { + content: "\f112"; +} +.fa-github-alt:before { + content: "\f113"; +} +.fa-folder-o:before { + content: "\f114"; +} +.fa-folder-open-o:before { + content: "\f115"; +} +.fa-smile-o:before { + content: "\f118"; +} +.fa-frown-o:before { + content: "\f119"; +} +.fa-meh-o:before { + content: "\f11a"; +} +.fa-gamepad:before { + content: "\f11b"; +} +.fa-keyboard-o:before { + content: "\f11c"; +} +.fa-flag-o:before { + content: "\f11d"; +} +.fa-flag-checkered:before { + content: "\f11e"; +} +.fa-terminal:before { + content: "\f120"; +} +.fa-code:before { + content: "\f121"; +} +.fa-mail-reply-all:before, +.fa-reply-all:before { + content: "\f122"; +} +.fa-star-half-empty:before, +.fa-star-half-full:before, +.fa-star-half-o:before { + content: "\f123"; +} +.fa-location-arrow:before { + content: "\f124"; +} +.fa-crop:before { + content: "\f125"; +} +.fa-code-fork:before { + content: "\f126"; +} +.fa-unlink:before, +.fa-chain-broken:before { + content: "\f127"; +} +.fa-question:before { + content: "\f128"; +} +.fa-info:before { + content: "\f129"; +} +.fa-exclamation:before { + content: "\f12a"; +} +.fa-superscript:before { + content: "\f12b"; +} +.fa-subscript:before { + content: "\f12c"; +} +.fa-eraser:before { + content: "\f12d"; +} +.fa-puzzle-piece:before { + content: "\f12e"; +} +.fa-microphone:before { + content: "\f130"; +} +.fa-microphone-slash:before { + content: "\f131"; +} +.fa-shield:before { + content: "\f132"; +} +.fa-calendar-o:before { + content: "\f133"; +} +.fa-fire-extinguisher:before { + content: "\f134"; +} +.fa-rocket:before { + content: "\f135"; +} +.fa-maxcdn:before { + content: "\f136"; +} +.fa-chevron-circle-left:before { + content: "\f137"; +} +.fa-chevron-circle-right:before { + content: "\f138"; +} +.fa-chevron-circle-up:before { + content: "\f139"; +} +.fa-chevron-circle-down:before { + content: "\f13a"; +} +.fa-html5:before { + content: "\f13b"; +} +.fa-css3:before { + content: "\f13c"; +} +.fa-anchor:before { + content: "\f13d"; +} +.fa-unlock-alt:before { + content: "\f13e"; +} +.fa-bullseye:before { + content: "\f140"; +} +.fa-ellipsis-h:before { + content: "\f141"; +} +.fa-ellipsis-v:before { + content: "\f142"; +} +.fa-rss-square:before { + content: "\f143"; +} +.fa-play-circle:before { + content: "\f144"; +} +.fa-ticket:before { + content: "\f145"; +} +.fa-minus-square:before { + content: "\f146"; +} +.fa-minus-square-o:before { + content: "\f147"; +} +.fa-level-up:before { + content: "\f148"; +} +.fa-level-down:before { + content: "\f149"; +} +.fa-check-square:before { + content: "\f14a"; +} +.fa-pencil-square:before { + content: "\f14b"; +} +.fa-external-link-square:before { + content: "\f14c"; +} +.fa-share-square:before { + content: "\f14d"; +} +.fa-compass:before { + content: "\f14e"; +} +.fa-toggle-down:before, +.fa-caret-square-o-down:before { + content: "\f150"; +} +.fa-toggle-up:before, +.fa-caret-square-o-up:before { + content: "\f151"; +} +.fa-toggle-right:before, +.fa-caret-square-o-right:before { + content: "\f152"; +} +.fa-euro:before, +.fa-eur:before { + content: "\f153"; +} +.fa-gbp:before { + content: "\f154"; +} +.fa-dollar:before, +.fa-usd:before { + content: "\f155"; +} +.fa-rupee:before, +.fa-inr:before { + content: "\f156"; +} +.fa-cny:before, +.fa-rmb:before, +.fa-yen:before, +.fa-jpy:before { + content: "\f157"; +} +.fa-ruble:before, +.fa-rouble:before, +.fa-rub:before { + content: "\f158"; +} +.fa-won:before, +.fa-krw:before { + content: "\f159"; +} +.fa-bitcoin:before, +.fa-btc:before { + content: "\f15a"; +} +.fa-file:before { + content: "\f15b"; +} +.fa-file-text:before { + content: "\f15c"; +} +.fa-sort-alpha-asc:before { + content: "\f15d"; +} +.fa-sort-alpha-desc:before { + content: "\f15e"; +} +.fa-sort-amount-asc:before { + content: "\f160"; +} +.fa-sort-amount-desc:before { + content: "\f161"; +} +.fa-sort-numeric-asc:before { + content: "\f162"; +} +.fa-sort-numeric-desc:before { + content: "\f163"; +} +.fa-thumbs-up:before { + content: "\f164"; +} +.fa-thumbs-down:before { + content: "\f165"; +} +.fa-youtube-square:before { + content: "\f166"; +} +.fa-youtube:before { + content: "\f167"; +} +.fa-xing:before { + content: "\f168"; +} +.fa-xing-square:before { + content: "\f169"; +} +.fa-youtube-play:before { + content: "\f16a"; +} +.fa-dropbox:before { + content: "\f16b"; +} +.fa-stack-overflow:before { + content: "\f16c"; +} +.fa-instagram:before { + content: "\f16d"; +} +.fa-flickr:before { + content: "\f16e"; +} +.fa-adn:before { + content: "\f170"; +} +.fa-bitbucket:before { + content: "\f171"; +} +.fa-bitbucket-square:before { + content: "\f172"; +} +.fa-tumblr:before { + content: "\f173"; +} +.fa-tumblr-square:before { + content: "\f174"; +} +.fa-long-arrow-down:before { + content: "\f175"; +} +.fa-long-arrow-up:before { + content: "\f176"; +} +.fa-long-arrow-left:before { + content: "\f177"; +} +.fa-long-arrow-right:before { + content: "\f178"; +} +.fa-apple:before { + content: "\f179"; +} +.fa-windows:before { + content: "\f17a"; +} +.fa-android:before { + content: "\f17b"; +} +.fa-linux:before { + content: "\f17c"; +} +.fa-dribbble:before { + content: "\f17d"; +} +.fa-skype:before { + content: "\f17e"; +} +.fa-foursquare:before { + content: "\f180"; +} +.fa-trello:before { + content: "\f181"; +} +.fa-female:before { + content: "\f182"; +} +.fa-male:before { + content: "\f183"; +} +.fa-gittip:before, +.fa-gratipay:before { + content: "\f184"; +} +.fa-sun-o:before { + content: "\f185"; +} +.fa-moon-o:before { + content: "\f186"; +} +.fa-archive:before { + content: "\f187"; +} +.fa-bug:before { + content: "\f188"; +} +.fa-vk:before { + content: "\f189"; +} +.fa-weibo:before { + content: "\f18a"; +} +.fa-renren:before { + content: "\f18b"; +} +.fa-pagelines:before { + content: "\f18c"; +} +.fa-stack-exchange:before { + content: "\f18d"; +} +.fa-arrow-circle-o-right:before { + content: "\f18e"; +} +.fa-arrow-circle-o-left:before { + content: "\f190"; +} +.fa-toggle-left:before, +.fa-caret-square-o-left:before { + content: "\f191"; +} +.fa-dot-circle-o:before { + content: "\f192"; +} +.fa-wheelchair:before { + content: "\f193"; +} +.fa-vimeo-square:before { + content: "\f194"; +} +.fa-turkish-lira:before, +.fa-try:before { + content: "\f195"; +} +.fa-plus-square-o:before { + content: "\f196"; +} +.fa-space-shuttle:before { + content: "\f197"; +} +.fa-slack:before { + content: "\f198"; +} +.fa-envelope-square:before { + content: "\f199"; +} +.fa-wordpress:before { + content: "\f19a"; +} +.fa-openid:before { + content: "\f19b"; +} +.fa-institution:before, +.fa-bank:before, +.fa-university:before { + content: "\f19c"; +} +.fa-mortar-board:before, +.fa-graduation-cap:before { + content: "\f19d"; +} +.fa-yahoo:before { + content: "\f19e"; +} +.fa-google:before { + content: "\f1a0"; +} +.fa-reddit:before { + content: "\f1a1"; +} +.fa-reddit-square:before { + content: "\f1a2"; +} +.fa-stumbleupon-circle:before { + content: "\f1a3"; +} +.fa-stumbleupon:before { + content: "\f1a4"; +} +.fa-delicious:before { + content: "\f1a5"; +} +.fa-digg:before { + content: "\f1a6"; +} +.fa-pied-piper-pp:before { + content: "\f1a7"; +} +.fa-pied-piper-alt:before { + content: "\f1a8"; +} +.fa-drupal:before { + content: "\f1a9"; +} +.fa-joomla:before { + content: "\f1aa"; +} +.fa-language:before { + content: "\f1ab"; +} +.fa-fax:before { + content: "\f1ac"; +} +.fa-building:before { + content: "\f1ad"; +} +.fa-child:before { + content: "\f1ae"; +} +.fa-paw:before { + content: "\f1b0"; +} +.fa-spoon:before { + content: "\f1b1"; +} +.fa-cube:before { + content: "\f1b2"; +} +.fa-cubes:before { + content: "\f1b3"; +} +.fa-behance:before { + content: "\f1b4"; +} +.fa-behance-square:before { + content: "\f1b5"; +} +.fa-steam:before { + content: "\f1b6"; +} +.fa-steam-square:before { + content: "\f1b7"; +} +.fa-recycle:before { + content: "\f1b8"; +} +.fa-automobile:before, +.fa-car:before { + content: "\f1b9"; +} +.fa-cab:before, +.fa-taxi:before { + content: "\f1ba"; +} +.fa-tree:before { + content: "\f1bb"; +} +.fa-spotify:before { + content: "\f1bc"; +} +.fa-deviantart:before { + content: "\f1bd"; +} +.fa-soundcloud:before { + content: "\f1be"; +} +.fa-database:before { + content: "\f1c0"; +} +.fa-file-pdf-o:before { + content: "\f1c1"; +} +.fa-file-word-o:before { + content: "\f1c2"; +} +.fa-file-excel-o:before { + content: "\f1c3"; +} +.fa-file-powerpoint-o:before { + content: "\f1c4"; +} +.fa-file-photo-o:before, +.fa-file-picture-o:before, +.fa-file-image-o:before { + content: "\f1c5"; +} +.fa-file-zip-o:before, +.fa-file-archive-o:before { + content: "\f1c6"; +} +.fa-file-sound-o:before, +.fa-file-audio-o:before { + content: "\f1c7"; +} +.fa-file-movie-o:before, +.fa-file-video-o:before { + content: "\f1c8"; +} +.fa-file-code-o:before { + content: "\f1c9"; +} +.fa-vine:before { + content: "\f1ca"; +} +.fa-codepen:before { + content: "\f1cb"; +} +.fa-jsfiddle:before { + content: "\f1cc"; +} +.fa-life-bouy:before, +.fa-life-buoy:before, +.fa-life-saver:before, +.fa-support:before, +.fa-life-ring:before { + content: "\f1cd"; +} +.fa-circle-o-notch:before { + content: "\f1ce"; +} +.fa-ra:before, +.fa-resistance:before, +.fa-rebel:before { + content: "\f1d0"; +} +.fa-ge:before, +.fa-empire:before { + content: "\f1d1"; +} +.fa-git-square:before { + content: "\f1d2"; +} +.fa-git:before { + content: "\f1d3"; +} +.fa-y-combinator-square:before, +.fa-yc-square:before, +.fa-hacker-news:before { + content: "\f1d4"; +} +.fa-tencent-weibo:before { + content: "\f1d5"; +} +.fa-qq:before { + content: "\f1d6"; +} +.fa-wechat:before, +.fa-weixin:before { + content: "\f1d7"; +} +.fa-send:before, +.fa-paper-plane:before { + content: "\f1d8"; +} +.fa-send-o:before, +.fa-paper-plane-o:before { + content: "\f1d9"; +} +.fa-history:before { + content: "\f1da"; +} +.fa-circle-thin:before { + content: "\f1db"; +} +.fa-header:before { + content: "\f1dc"; +} +.fa-paragraph:before { + content: "\f1dd"; +} +.fa-sliders:before { + content: "\f1de"; +} +.fa-share-alt:before { + content: "\f1e0"; +} +.fa-share-alt-square:before { + content: "\f1e1"; +} +.fa-bomb:before { + content: "\f1e2"; +} +.fa-soccer-ball-o:before, +.fa-futbol-o:before { + content: "\f1e3"; +} +.fa-tty:before { + content: "\f1e4"; +} +.fa-binoculars:before { + content: "\f1e5"; +} +.fa-plug:before { + content: "\f1e6"; +} +.fa-slideshare:before { + content: "\f1e7"; +} +.fa-twitch:before { + content: "\f1e8"; +} +.fa-yelp:before { + content: "\f1e9"; +} +.fa-newspaper-o:before { + content: "\f1ea"; +} +.fa-wifi:before { + content: "\f1eb"; +} +.fa-calculator:before { + content: "\f1ec"; +} +.fa-paypal:before { + content: "\f1ed"; +} +.fa-google-wallet:before { + content: "\f1ee"; +} +.fa-cc-visa:before { + content: "\f1f0"; +} +.fa-cc-mastercard:before { + content: "\f1f1"; +} +.fa-cc-discover:before { + content: "\f1f2"; +} +.fa-cc-amex:before { + content: "\f1f3"; +} +.fa-cc-paypal:before { + content: "\f1f4"; +} +.fa-cc-stripe:before { + content: "\f1f5"; +} +.fa-bell-slash:before { + content: "\f1f6"; +} +.fa-bell-slash-o:before { + content: "\f1f7"; +} +.fa-trash:before { + content: "\f1f8"; +} +.fa-copyright:before { + content: "\f1f9"; +} +.fa-at:before { + content: "\f1fa"; +} +.fa-eyedropper:before { + content: "\f1fb"; +} +.fa-paint-brush:before { + content: "\f1fc"; +} +.fa-birthday-cake:before { + content: "\f1fd"; +} +.fa-area-chart:before { + content: "\f1fe"; +} +.fa-pie-chart:before { + content: "\f200"; +} +.fa-line-chart:before { + content: "\f201"; +} +.fa-lastfm:before { + content: "\f202"; +} +.fa-lastfm-square:before { + content: "\f203"; +} +.fa-toggle-off:before { + content: "\f204"; +} +.fa-toggle-on:before { + content: "\f205"; +} +.fa-bicycle:before { + content: "\f206"; +} +.fa-bus:before { + content: "\f207"; +} +.fa-ioxhost:before { + content: "\f208"; +} +.fa-angellist:before { + content: "\f209"; +} +.fa-cc:before { + content: "\f20a"; +} +.fa-shekel:before, +.fa-sheqel:before, +.fa-ils:before { + content: "\f20b"; +} +.fa-meanpath:before { + content: "\f20c"; +} +.fa-buysellads:before { + content: "\f20d"; +} +.fa-connectdevelop:before { + content: "\f20e"; +} +.fa-dashcube:before { + content: "\f210"; +} +.fa-forumbee:before { + content: "\f211"; +} +.fa-leanpub:before { + content: "\f212"; +} +.fa-sellsy:before { + content: "\f213"; +} +.fa-shirtsinbulk:before { + content: "\f214"; +} +.fa-simplybuilt:before { + content: "\f215"; +} +.fa-skyatlas:before { + content: "\f216"; +} +.fa-cart-plus:before { + content: "\f217"; +} +.fa-cart-arrow-down:before { + content: "\f218"; +} +.fa-diamond:before { + content: "\f219"; +} +.fa-ship:before { + content: "\f21a"; +} +.fa-user-secret:before { + content: "\f21b"; +} +.fa-motorcycle:before { + content: "\f21c"; +} +.fa-street-view:before { + content: "\f21d"; +} +.fa-heartbeat:before { + content: "\f21e"; +} +.fa-venus:before { + content: "\f221"; +} +.fa-mars:before { + content: "\f222"; +} +.fa-mercury:before { + content: "\f223"; +} +.fa-intersex:before, +.fa-transgender:before { + content: "\f224"; +} +.fa-transgender-alt:before { + content: "\f225"; +} +.fa-venus-double:before { + content: "\f226"; +} +.fa-mars-double:before { + content: "\f227"; +} +.fa-venus-mars:before { + content: "\f228"; +} +.fa-mars-stroke:before { + content: "\f229"; +} +.fa-mars-stroke-v:before { + content: "\f22a"; +} +.fa-mars-stroke-h:before { + content: "\f22b"; +} +.fa-neuter:before { + content: "\f22c"; +} +.fa-genderless:before { + content: "\f22d"; +} +.fa-facebook-official:before { + content: "\f230"; +} +.fa-pinterest-p:before { + content: "\f231"; +} +.fa-whatsapp:before { + content: "\f232"; +} +.fa-server:before { + content: "\f233"; +} +.fa-user-plus:before { + content: "\f234"; +} +.fa-user-times:before { + content: "\f235"; +} +.fa-hotel:before, +.fa-bed:before { + content: "\f236"; +} +.fa-viacoin:before { + content: "\f237"; +} +.fa-train:before { + content: "\f238"; +} +.fa-subway:before { + content: "\f239"; +} +.fa-medium:before { + content: "\f23a"; +} +.fa-yc:before, +.fa-y-combinator:before { + content: "\f23b"; +} +.fa-optin-monster:before { + content: "\f23c"; +} +.fa-opencart:before { + content: "\f23d"; +} +.fa-expeditedssl:before { + content: "\f23e"; +} +.fa-battery-4:before, +.fa-battery:before, +.fa-battery-full:before { + content: "\f240"; +} +.fa-battery-3:before, +.fa-battery-three-quarters:before { + content: "\f241"; +} +.fa-battery-2:before, +.fa-battery-half:before { + content: "\f242"; +} +.fa-battery-1:before, +.fa-battery-quarter:before { + content: "\f243"; +} +.fa-battery-0:before, +.fa-battery-empty:before { + content: "\f244"; +} +.fa-mouse-pointer:before { + content: "\f245"; +} +.fa-i-cursor:before { + content: "\f246"; +} +.fa-object-group:before { + content: "\f247"; +} +.fa-object-ungroup:before { + content: "\f248"; +} +.fa-sticky-note:before { + content: "\f249"; +} +.fa-sticky-note-o:before { + content: "\f24a"; +} +.fa-cc-jcb:before { + content: "\f24b"; +} +.fa-cc-diners-club:before { + content: "\f24c"; +} +.fa-clone:before { + content: "\f24d"; +} +.fa-balance-scale:before { + content: "\f24e"; +} +.fa-hourglass-o:before { + content: "\f250"; +} +.fa-hourglass-1:before, +.fa-hourglass-start:before { + content: "\f251"; +} +.fa-hourglass-2:before, +.fa-hourglass-half:before { + content: "\f252"; +} +.fa-hourglass-3:before, +.fa-hourglass-end:before { + content: "\f253"; +} +.fa-hourglass:before { + content: "\f254"; +} +.fa-hand-grab-o:before, +.fa-hand-rock-o:before { + content: "\f255"; +} +.fa-hand-stop-o:before, +.fa-hand-paper-o:before { + content: "\f256"; +} +.fa-hand-scissors-o:before { + content: "\f257"; +} +.fa-hand-lizard-o:before { + content: "\f258"; +} +.fa-hand-spock-o:before { + content: "\f259"; +} +.fa-hand-pointer-o:before { + content: "\f25a"; +} +.fa-hand-peace-o:before { + content: "\f25b"; +} +.fa-trademark:before { + content: "\f25c"; +} +.fa-registered:before { + content: "\f25d"; +} +.fa-creative-commons:before { + content: "\f25e"; +} +.fa-gg:before { + content: "\f260"; +} +.fa-gg-circle:before { + content: "\f261"; +} +.fa-tripadvisor:before { + content: "\f262"; +} +.fa-odnoklassniki:before { + content: "\f263"; +} +.fa-odnoklassniki-square:before { + content: "\f264"; +} +.fa-get-pocket:before { + content: "\f265"; +} +.fa-wikipedia-w:before { + content: "\f266"; +} +.fa-safari:before { + content: "\f267"; +} +.fa-chrome:before { + content: "\f268"; +} +.fa-firefox:before { + content: "\f269"; +} +.fa-opera:before { + content: "\f26a"; +} +.fa-internet-explorer:before { + content: "\f26b"; +} +.fa-tv:before, +.fa-television:before { + content: "\f26c"; +} +.fa-contao:before { + content: "\f26d"; +} +.fa-500px:before { + content: "\f26e"; +} +.fa-amazon:before { + content: "\f270"; +} +.fa-calendar-plus-o:before { + content: "\f271"; +} +.fa-calendar-minus-o:before { + content: "\f272"; +} +.fa-calendar-times-o:before { + content: "\f273"; +} +.fa-calendar-check-o:before { + content: "\f274"; +} +.fa-industry:before { + content: "\f275"; +} +.fa-map-pin:before { + content: "\f276"; +} +.fa-map-signs:before { + content: "\f277"; +} +.fa-map-o:before { + content: "\f278"; +} +.fa-map:before { + content: "\f279"; +} +.fa-commenting:before { + content: "\f27a"; +} +.fa-commenting-o:before { + content: "\f27b"; +} +.fa-houzz:before { + content: "\f27c"; +} +.fa-vimeo:before { + content: "\f27d"; +} +.fa-black-tie:before { + content: "\f27e"; +} +.fa-fonticons:before { + content: "\f280"; +} +.fa-reddit-alien:before { + content: "\f281"; +} +.fa-edge:before { + content: "\f282"; +} +.fa-credit-card-alt:before { + content: "\f283"; +} +.fa-codiepie:before { + content: "\f284"; +} +.fa-modx:before { + content: "\f285"; +} +.fa-fort-awesome:before { + content: "\f286"; +} +.fa-usb:before { + content: "\f287"; +} +.fa-product-hunt:before { + content: "\f288"; +} +.fa-mixcloud:before { + content: "\f289"; +} +.fa-scribd:before { + content: "\f28a"; +} +.fa-pause-circle:before { + content: "\f28b"; +} +.fa-pause-circle-o:before { + content: "\f28c"; +} +.fa-stop-circle:before { + content: "\f28d"; +} +.fa-stop-circle-o:before { + content: "\f28e"; +} +.fa-shopping-bag:before { + content: "\f290"; +} +.fa-shopping-basket:before { + content: "\f291"; +} +.fa-hashtag:before { + content: "\f292"; +} +.fa-bluetooth:before { + content: "\f293"; +} +.fa-bluetooth-b:before { + content: "\f294"; +} +.fa-percent:before { + content: "\f295"; +} +.fa-gitlab:before { + content: "\f296"; +} +.fa-wpbeginner:before { + content: "\f297"; +} +.fa-wpforms:before { + content: "\f298"; +} +.fa-envira:before { + content: "\f299"; +} +.fa-universal-access:before { + content: "\f29a"; +} +.fa-wheelchair-alt:before { + content: "\f29b"; +} +.fa-question-circle-o:before { + content: "\f29c"; +} +.fa-blind:before { + content: "\f29d"; +} +.fa-audio-description:before { + content: "\f29e"; +} +.fa-volume-control-phone:before { + content: "\f2a0"; +} +.fa-braille:before { + content: "\f2a1"; +} +.fa-assistive-listening-systems:before { + content: "\f2a2"; +} +.fa-asl-interpreting:before, +.fa-american-sign-language-interpreting:before { + content: "\f2a3"; +} +.fa-deafness:before, +.fa-hard-of-hearing:before, +.fa-deaf:before { + content: "\f2a4"; +} +.fa-glide:before { + content: "\f2a5"; +} +.fa-glide-g:before { + content: "\f2a6"; +} +.fa-signing:before, +.fa-sign-language:before { + content: "\f2a7"; +} +.fa-low-vision:before { + content: "\f2a8"; +} +.fa-viadeo:before { + content: "\f2a9"; +} +.fa-viadeo-square:before { + content: "\f2aa"; +} +.fa-snapchat:before { + content: "\f2ab"; +} +.fa-snapchat-ghost:before { + content: "\f2ac"; +} +.fa-snapchat-square:before { + content: "\f2ad"; +} +.fa-pied-piper:before { + content: "\f2ae"; +} +.fa-first-order:before { + content: "\f2b0"; +} +.fa-yoast:before { + content: "\f2b1"; +} +.fa-themeisle:before { + content: "\f2b2"; +} +.fa-google-plus-circle:before, +.fa-google-plus-official:before { + content: "\f2b3"; +} +.fa-fa:before, +.fa-font-awesome:before { + content: "\f2b4"; +} +.fa-handshake-o:before { + content: "\f2b5"; +} +.fa-envelope-open:before { + content: "\f2b6"; +} +.fa-envelope-open-o:before { + content: "\f2b7"; +} +.fa-linode:before { + content: "\f2b8"; +} +.fa-address-book:before { + content: "\f2b9"; +} +.fa-address-book-o:before { + content: "\f2ba"; +} +.fa-vcard:before, +.fa-address-card:before { + content: "\f2bb"; +} +.fa-vcard-o:before, +.fa-address-card-o:before { + content: "\f2bc"; +} +.fa-user-circle:before { + content: "\f2bd"; +} +.fa-user-circle-o:before { + content: "\f2be"; +} +.fa-user-o:before { + content: "\f2c0"; +} +.fa-id-badge:before { + content: "\f2c1"; +} +.fa-drivers-license:before, +.fa-id-card:before { + content: "\f2c2"; +} +.fa-drivers-license-o:before, +.fa-id-card-o:before { + content: "\f2c3"; +} +.fa-quora:before { + content: "\f2c4"; +} +.fa-free-code-camp:before { + content: "\f2c5"; +} +.fa-telegram:before { + content: "\f2c6"; +} +.fa-thermometer-4:before, +.fa-thermometer:before, +.fa-thermometer-full:before { + content: "\f2c7"; +} +.fa-thermometer-3:before, +.fa-thermometer-three-quarters:before { + content: "\f2c8"; +} +.fa-thermometer-2:before, +.fa-thermometer-half:before { + content: "\f2c9"; +} +.fa-thermometer-1:before, +.fa-thermometer-quarter:before { + content: "\f2ca"; +} +.fa-thermometer-0:before, +.fa-thermometer-empty:before { + content: "\f2cb"; +} +.fa-shower:before { + content: "\f2cc"; +} +.fa-bathtub:before, +.fa-s15:before, +.fa-bath:before { + content: "\f2cd"; +} +.fa-podcast:before { + content: "\f2ce"; +} +.fa-window-maximize:before { + content: "\f2d0"; +} +.fa-window-minimize:before { + content: "\f2d1"; +} +.fa-window-restore:before { + content: "\f2d2"; +} +.fa-times-rectangle:before, +.fa-window-close:before { + content: "\f2d3"; +} +.fa-times-rectangle-o:before, +.fa-window-close-o:before { + content: "\f2d4"; +} +.fa-bandcamp:before { + content: "\f2d5"; +} +.fa-grav:before { + content: "\f2d6"; +} +.fa-etsy:before { + content: "\f2d7"; +} +.fa-imdb:before { + content: "\f2d8"; +} +.fa-ravelry:before { + content: "\f2d9"; +} +.fa-eercast:before { + content: "\f2da"; +} +.fa-microchip:before { + content: "\f2db"; +} +.fa-snowflake-o:before { + content: "\f2dc"; +} +.fa-superpowers:before { + content: "\f2dd"; +} +.fa-wpexplorer:before { + content: "\f2de"; +} +.fa-meetup:before { + content: "\f2e0"; +} +.sr-only { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + border: 0; +} +.sr-only-focusable:active, +.sr-only-focusable:focus { + position: static; + width: auto; + height: auto; + margin: 0; + overflow: visible; + clip: auto; +} +/* + * Copyright (c) 2014-2015, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Fabien LOISON + */ +.photonui-submenuitem { + /* ... */ +} +/* + * Copyright (c) 2014-2015, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Fabien LOISON + */ +.photonui-numericfield { + /* ... */ +} +/* + * Copyright (c) 2014-2015, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Fabien LOISON + */ +.photonui-textfield { + /* ... */ +} +/* + * Copyright (c) 2014-2015, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Fabien LOISON + */ +.photonui-checkbox { + /* ... */ +} +/* + * Copyright (c) 2014-2015, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Fabien LOISON + */ +.photonui-colorpickerdialog { + /* ... */ +} +/* + * Copyright (c) 2014-2015, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Fabien LOISON + */ +.photonui-iconbutton { + cursor: pointer; + vertical-align: middle; + text-align: center; +} +.photonui-iconbutton > * { + vertical-align: middle; +} +/* + * Copyright (c) 2014-2015, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Fabien LOISON + */ +.photonui-template { + height: 100%; + box-sizing: border-box; +} +.photonui-dataview-item[draggable] { + cursor: -webkit-grab; + cursor: grab; +} +.photonui-dataview-item[draggable]:active { + cursor: -webkit-grabbing; + cursor: grabbing; +} +.photonui-dataview-item-placeholder { + background-color: #ddd; +} +/* + * Copyright (c) 2014, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Valentin Ledrapier + */ +.photonui-fluidview { + list-style: none; + margin: 0; + padding: 0; + display: -ms-flexbox; + display: flex; + -ms-flex-wrap: wrap; + flex-wrap: wrap; +} +.photonui-fluidview .photonui-fluidview-item { + text-align: center; +} +.photonui-fluidview .photonui-fluidview-item-placeholder { + background-color: #ddd; +} +.photonui-fluidview .photonui-fluidview-item .photonui-fluidview-column { + margin: auto; +} +.photonui-container-expand-child-horizontal > .photonui-widget:not(.photonui-widget-fixed-width).photonui-fluidview { + width: auto !important; +} +/* + * Copyright (c) 2014, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Valentin Ledrapier + */ +.photonui-listview { + list-style: none; + padding: 0; + margin: 0; +} +.photonui-listview .photonui-listview-item { + padding: 6px 8px; + border-bottom: 1px solid #fff; + box-sizing: border-box; +} +.photonui-listview .photonui-listview-item.selected { + background-color: #aaa; +} +/* + * Copyright (c) 2014, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Valentin Ledrapier + */ +.photonui-tableview { + border-collapse: collapse; + padding: 0; + margin: 0; +} +.photonui-tableview .photonui-tableview-item { + border-bottom: 2px solid #fff; + width: 100%; +} +.photonui-tableview .photonui-tableview-item.selected { + background-color: #aaa; +} +.photonui-tableview .photonui-tableview-item .photonui-tableview-column { + padding: 6px; +} +.photonui-tableview .photonui-tableview-header { + border-bottom: 4px solid #fff; + width: 100%; +} +.photonui-tableview .photonui-tableview-header .photonui-tableview-column { + padding: 12px; +} +/* + * Copyright (c) 2014, Wanadev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of Wanadev nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authored by: Valentin Ledrapier + */ +.photonui-iconview { + background-color: #fff; +} +.photonui-iconview .photonui-iconview-item { + padding: 8px; +} +.photonui-iconview .photonui-iconview-item.selected { + background-color: #aaa; +} +.photonui-iconview .photonui-iconview-item .photonui-iconview-column-icon { + text-align: center; +} +.photonui-iconview .photonui-iconview-item .photonui-iconview-column-label { + margin-top: 4px; + text-align: center; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +/* [generator] */ +/* DO NOT MODIFY/REMOVE THE PREVIOUS COMMENT, IT IS USED BY THE WIDGET GENERATOR! */ + +.photonui-widget{color:#333}.photonui-widget::-moz-selection{background:#4ec8db;color:#fff}.photonui-widget::selection{background:#4ec8db;color:#fff}.photonui-widget::-moz-selection{background:#4ec8db;color:#fff}.photonui-widget::-o-selection{background:#4ec8db;color:#fff}.photonui-widget::-ms-selection{background:#4ec8db;color:#fff}.photonui-widget::-webkit-selection{background:#4ec8db;color:#fff}.photonui-menu.photonui-menu-style-popupmenu .photonui-menuitem{cursor:pointer}.photonui-window{min-width:100px;background:#f1f1f1;border-radius:2px;box-shadow:0 0 10px rgba(0,0,0,.3)}.photonui-window .photonui-window-title{height:40px;border-radius:2px 2px 0 0;background:#555;transition:all 150ms}.photonui-window .photonui-window-title-text{margin-top:2px;padding:8px 10px;font-size:120%;font-weight:700;color:#fff}.photonui-window .photonui-window-title-close-button{display:block;margin:6px 6px 0 0;padding:0;height:26px;width:22px;border:none;border-radius:3px;outline:0;background:0 0;color:rgba(255,255,255,.3);cursor:pointer;font-size:26px}.photonui-window .photonui-window-title-close-button:before{transition:color 150ms}.photonui-window .photonui-window-title-close-button:hover:before{color:rgba(255,255,255,.7)}.photonui-window.photonui-active .photonui-window-title{background:#333}.photonui-window.photonui-active .photonui-window-title-text{color:#fff}.photonui-window.photonui-active .photonui-window-title-close-button:before{color:rgba(255,255,255,.3)}.photonui-window.photonui-active .photonui-window-title-close-button:hover:before{color:rgba(255,255,255,.7)}.photonui-window.photonui-window-have-button .photonui-window-title-text{padding:8px 0 8px 10px;width:calc(100% - 42px)}.photonui-window.photonui-window-fullscreen .photonui-window-content{height:calc(100% - 40px)!important;min-height:calc(100% - 40px)!important;max-height:calc(100% - 40px)!important}.photonui-window-modalbox{background:rgba(255,255,255,.7)}.photonui-dialog-buttons{padding:6px 5px 5px 5px;text-align:right;box-sizing:border-box;box-shadow:inset 0 7px 3px -7px rgba(0,0,0,.4);background:#e4e4e4}.photonui-dialog-buttons>*{margin-left:5px}.photonui-dialog-buttons>:first-child{margin-left:0}.photonui-window.photonui-dialog.photonui-window-fullscreen .photonui-window-content{height:calc(100% - 55px - 40px)!important;min-height:calc(100% - 55px - 40px)!important;max-height:calc(100% - 55px - 40px)!important}.photonui-window.photonui-dialog.photonui-window-fullscreen .photonui-dialog-buttons{height:55px}.photonui-expander-title{box-sizing:border-box;padding:5px;padding-left:11px;font-weight:700;color:#333}.photonui-expander-title:before{box-sizing:border-box;content:"";display:inline-block;border:transparent solid 6px;border-top-color:#333;position:relative;left:-6px;transform:rotate(0) translate(0,5px);transition:transform 150ms}.photonui-expander-folded>.photonui-expander-title:before{transform:rotate(-90deg) translate(0,5px);transition:transform 150ms}.photonui-expander-title:active,.photonui-expander-title:focus{outline:0;box-shadow:inset 1px 1px 0 #25a4b7,inset -1px -1px 0 #25a4b7}.photonui-expander-title:hover{outline:0;background:#4ec8db;color:#fff}.photonui-expander-title:hover:before{border-top-color:#fff}.photonui-popupwindow{border:none;background:#FFF;border-radius:2px;box-shadow:0 0 5px rgba(0,0,0,.3)}.photonui-menu>.photonui-menu{margin-left:26px;width:calc(100% - 26px)}.photonui-menu .photonui-menuitem{color:#333;cursor:default;transition:all 150ms}.photonui-menu .photonui-menuitem.photonui-menuitem-active,.photonui-menu .photonui-menuitem:hover{background:#4ec8db;color:#fff}.photonui-menu .photonui-submenuitem .photonui-menuitem-widget:before{box-sizing:border-box;content:"";display:inline-block;border:transparent solid 6px;border-top-color:#333;transform:rotate(-90deg) translate(0,4px);transition:transform 150ms}.photonui-menu .photonui-submenuitem.photonui-menuitem-active{background:#bbb;color:#fff}.photonui-menu .photonui-submenuitem.photonui-menuitem-active .photonui-menuitem-widget:before{transform:rotate(0) translate(0,4px)}.photonui-menu .photonui-submenuitem.photonui-menuitem-active .photonui-menuitem-widget:before,.photonui-menu .photonui-submenuitem:hover .photonui-menuitem-widget:before{border-top-color:#fff}.photonui-menu .photonui-submenuitem:hover{background:#4ec8db}.photonui-particle-button-default{color:#333;border-bottom-color:#25a4b7;box-shadow:0 0 5px rgba(0,0,0,.2)}.photonui-particle-button-default .photonui-faicon{color:#333}.photonui-particle-button-alternative-colors.photonui-button-color-blue{background-color:#25A4B7;border-color:#25A4B7;border-bottom-color:#145862;color:#000;outline:0;color:#fff}.photonui-particle-button-alternative-colors.photonui-button-color-blue .photonui-faicon{color:#000}.photonui-particle-button-alternative-colors.photonui-button-color-blue .photonui-faicon{color:#fff}.photonui-particle-button-alternative-colors.photonui-button-color-blue:focus{box-shadow:0 0 3px rgba(0,0,0,.3),inset 2px 2px 0 #145862,inset -2px 0 0 #145862}.photonui-particle-button-alternative-colors.photonui-button-color-blue:active{border:none;box-shadow:inset 0 0 7px #030c0d;padding-top:2px;padding-bottom:1px}.photonui-particle-button-alternative-colors.photonui-button-color-blue:active:focus{box-shadow:0 0 3px rgba(0,0,0,.3),inset 2px 2px 0 #145862,inset -2px -2px 0 #145862,inset 0 0 7px #030c0d}.photonui-particle-button-alternative-colors.photonui-button-color-red{background-color:#DB624F;border-color:#DB624F;border-bottom-color:#a33321;color:#240b07;outline:0;color:#fff}.photonui-particle-button-alternative-colors.photonui-button-color-red .photonui-faicon{color:#240b07}.photonui-particle-button-alternative-colors.photonui-button-color-red .photonui-faicon{color:#fff}.photonui-particle-button-alternative-colors.photonui-button-color-red:focus{box-shadow:0 0 3px rgba(0,0,0,.3),inset 2px 2px 0 #a33321,inset -2px 0 0 #a33321}.photonui-particle-button-alternative-colors.photonui-button-color-red:active{border:none;box-shadow:inset 0 0 7px #4e1810;padding-top:2px;padding-bottom:1px}.photonui-particle-button-alternative-colors.photonui-button-color-red:active:focus{box-shadow:0 0 3px rgba(0,0,0,.3),inset 2px 2px 0 #a33321,inset -2px -2px 0 #a33321,inset 0 0 7px #4e1810}.photonui-particle-button-alternative-colors.photonui-button-color-yellow{background-color:#FDD835;border-color:#FDD835;border-bottom-color:#caa502;color:#322900;outline:0}.photonui-particle-button-alternative-colors.photonui-button-color-yellow .photonui-faicon{color:#322900}.photonui-particle-button-alternative-colors.photonui-button-color-yellow:focus{box-shadow:0 0 3px rgba(0,0,0,.3),inset 2px 2px 0 #caa502,inset -2px 0 0 #caa502}.photonui-particle-button-alternative-colors.photonui-button-color-yellow:active{border:none;box-shadow:inset 0 0 7px #655201;padding-top:2px;padding-bottom:1px}.photonui-particle-button-alternative-colors.photonui-button-color-yellow:active:focus{box-shadow:0 0 3px rgba(0,0,0,.3),inset 2px 2px 0 #caa502,inset -2px -2px 0 #caa502,inset 0 0 7px #655201}.photonui-particle-button-alternative-colors.photonui-button-color-green{background-color:#4CAF50;border-color:#4CAF50;border-bottom-color:#2d682f;color:#000;outline:0;color:#fff}.photonui-particle-button-alternative-colors.photonui-button-color-green .photonui-faicon{color:#000}.photonui-particle-button-alternative-colors.photonui-button-color-green .photonui-faicon{color:#fff}.photonui-particle-button-alternative-colors.photonui-button-color-green:focus{box-shadow:0 0 3px rgba(0,0,0,.3),inset 2px 2px 0 #2d682f,inset -2px 0 0 #2d682f}.photonui-particle-button-alternative-colors.photonui-button-color-green:active{border:none;box-shadow:inset 0 0 7px #0e210f;padding-top:2px;padding-bottom:1px}.photonui-particle-button-alternative-colors.photonui-button-color-green:active:focus{box-shadow:0 0 3px rgba(0,0,0,.3),inset 2px 2px 0 #2d682f,inset -2px -2px 0 #2d682f,inset 0 0 7px #0e210f}.photonui-particle-button-alternative-colors-active.photonui-button-color-blue{border:none;box-shadow:inset 0 0 7px #030c0d;padding-top:2px;padding-bottom:1px}.photonui-particle-button-alternative-colors-active.photonui-button-color-blue:focus{box-shadow:0 0 3px rgba(0,0,0,.3),inset 2px 2px 0 #145862,inset -2px -2px 0 #145862,inset 0 0 7px #030c0d}.photonui-particle-button-alternative-colors-active.photonui-button-color-red{border:none;box-shadow:inset 0 0 7px #4e1810;padding-top:2px;padding-bottom:1px}.photonui-particle-button-alternative-colors-active.photonui-button-color-red:focus{box-shadow:0 0 3px rgba(0,0,0,.3),inset 2px 2px 0 #a33321,inset -2px -2px 0 #a33321,inset 0 0 7px #4e1810}.photonui-particle-button-alternative-colors-active.photonui-button-color-yellow{border:none;box-shadow:inset 0 0 7px #655201;padding-top:2px;padding-bottom:1px}.photonui-particle-button-alternative-colors-active.photonui-button-color-yellow:focus{box-shadow:0 0 3px rgba(0,0,0,.3),inset 2px 2px 0 #caa502,inset -2px -2px 0 #caa502,inset 0 0 7px #655201}.photonui-particle-button-alternative-colors-active.photonui-button-color-green{border:none;box-shadow:inset 0 0 7px #0e210f;padding-top:2px;padding-bottom:1px}.photonui-particle-button-alternative-colors-active.photonui-button-color-green:focus{box-shadow:0 0 3px rgba(0,0,0,.3),inset 2px 2px 0 #2d682f,inset -2px -2px 0 #2d682f,inset 0 0 7px #0e210f}.photonui-button{background-color:#fff;border-color:#fff;border-bottom-color:#ccc;color:grey;outline:0;color:#333;border-bottom-color:#25a4b7;border-style:solid;border-width:0;border-bottom-width:3px;min-width:32px;line-height:2.5em;padding:0 10px;text-decoration:none!important;vertical-align:middle;cursor:pointer;border-radius:2px;box-shadow:0 0 5px rgba(0,0,0,.2)}.photonui-button .photonui-faicon{color:grey}.photonui-button:focus{box-shadow:0 0 3px rgba(0,0,0,.3),inset 2px 2px 0 #ccc,inset -2px 0 0 #ccc}.photonui-button:active{border:none;box-shadow:inset 0 0 7px #999;padding-top:2px;padding-bottom:1px}.photonui-button:active:focus{box-shadow:0 0 3px rgba(0,0,0,.3),inset 2px 2px 0 #ccc,inset -2px -2px 0 #ccc,inset 0 0 7px #999}.photonui-button .photonui-faicon{color:#333}.photonui-button.photonui-button-color-blue{background-color:#25A4B7;border-color:#25A4B7;border-bottom-color:#145862;color:#000;outline:0;color:#fff}.photonui-button.photonui-button-color-blue .photonui-faicon{color:#000}.photonui-button.photonui-button-color-blue .photonui-faicon{color:#fff}.photonui-button.photonui-button-color-blue:focus{box-shadow:0 0 3px rgba(0,0,0,.3),inset 2px 2px 0 #145862,inset -2px 0 0 #145862}.photonui-button.photonui-button-color-blue:active{border:none;box-shadow:inset 0 0 7px #030c0d;padding-top:2px;padding-bottom:1px}.photonui-button.photonui-button-color-blue:active:focus{box-shadow:0 0 3px rgba(0,0,0,.3),inset 2px 2px 0 #145862,inset -2px -2px 0 #145862,inset 0 0 7px #030c0d}.photonui-button.photonui-button-color-red{background-color:#DB624F;border-color:#DB624F;border-bottom-color:#a33321;color:#240b07;outline:0;color:#fff}.photonui-button.photonui-button-color-red .photonui-faicon{color:#240b07}.photonui-button.photonui-button-color-red .photonui-faicon{color:#fff}.photonui-button.photonui-button-color-red:focus{box-shadow:0 0 3px rgba(0,0,0,.3),inset 2px 2px 0 #a33321,inset -2px 0 0 #a33321}.photonui-button.photonui-button-color-red:active{border:none;box-shadow:inset 0 0 7px #4e1810;padding-top:2px;padding-bottom:1px}.photonui-button.photonui-button-color-red:active:focus{box-shadow:0 0 3px rgba(0,0,0,.3),inset 2px 2px 0 #a33321,inset -2px -2px 0 #a33321,inset 0 0 7px #4e1810}.photonui-button.photonui-button-color-yellow{background-color:#FDD835;border-color:#FDD835;border-bottom-color:#caa502;color:#322900;outline:0}.photonui-button.photonui-button-color-yellow .photonui-faicon{color:#322900}.photonui-button.photonui-button-color-yellow:focus{box-shadow:0 0 3px rgba(0,0,0,.3),inset 2px 2px 0 #caa502,inset -2px 0 0 #caa502}.photonui-button.photonui-button-color-yellow:active{border:none;box-shadow:inset 0 0 7px #655201;padding-top:2px;padding-bottom:1px}.photonui-button.photonui-button-color-yellow:active:focus{box-shadow:0 0 3px rgba(0,0,0,.3),inset 2px 2px 0 #caa502,inset -2px -2px 0 #caa502,inset 0 0 7px #655201}.photonui-button.photonui-button-color-green{background-color:#4CAF50;border-color:#4CAF50;border-bottom-color:#2d682f;color:#000;outline:0;color:#fff}.photonui-button.photonui-button-color-green .photonui-faicon{color:#000}.photonui-button.photonui-button-color-green .photonui-faicon{color:#fff}.photonui-button.photonui-button-color-green:focus{box-shadow:0 0 3px rgba(0,0,0,.3),inset 2px 2px 0 #2d682f,inset -2px 0 0 #2d682f}.photonui-button.photonui-button-color-green:active{border:none;box-shadow:inset 0 0 7px #0e210f;padding-top:2px;padding-bottom:1px}.photonui-button.photonui-button-color-green:active:focus{box-shadow:0 0 3px rgba(0,0,0,.3),inset 2px 2px 0 #2d682f,inset -2px -2px 0 #2d682f,inset 0 0 7px #0e210f}.photonui-button.photonui-button-appearance-flat,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button{box-shadow:none;border-color:transparent;background:0 0;color:#333}.photonui-button.photonui-button-appearance-flat .photonui-faicon,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button .photonui-faicon{color:#333}.photonui-button.photonui-button-appearance-flat:focus:not(:hover),.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:focus:not(:hover){box-shadow:inset 1px 1px 0 #63cfdf,inset -1px -1px 0 #63cfdf;border-bottom:none;padding-top:0;padding-bottom:3px;border-radius:0}.photonui-button.photonui-button-appearance-flat:focus:hover,.photonui-button.photonui-button-appearance-flat:hover,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:focus:hover,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:hover{background-color:#fff;border-color:#fff;border-bottom-color:#ccc;color:grey;outline:0;color:#333;border-bottom-color:#25a4b7;box-shadow:0 0 5px rgba(0,0,0,.2)}.photonui-button.photonui-button-appearance-flat:focus:hover .photonui-faicon,.photonui-button.photonui-button-appearance-flat:hover .photonui-faicon,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:focus:hover .photonui-faicon,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:hover .photonui-faicon{color:grey}.photonui-button.photonui-button-appearance-flat:focus:hover:focus,.photonui-button.photonui-button-appearance-flat:hover:focus,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:focus:hover:focus,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:hover:focus{box-shadow:0 0 3px rgba(0,0,0,.3),inset 2px 2px 0 #ccc,inset -2px 0 0 #ccc}.photonui-button.photonui-button-appearance-flat:focus:hover:active,.photonui-button.photonui-button-appearance-flat:hover:active,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:focus:hover:active,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:hover:active{border:none;box-shadow:inset 0 0 7px #999;padding-top:2px;padding-bottom:1px}.photonui-button.photonui-button-appearance-flat:focus:hover:active:focus,.photonui-button.photonui-button-appearance-flat:hover:active:focus,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:focus:hover:active:focus,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:hover:active:focus{box-shadow:0 0 3px rgba(0,0,0,.3),inset 2px 2px 0 #ccc,inset -2px -2px 0 #ccc,inset 0 0 7px #999}.photonui-button.photonui-button-appearance-flat:focus:hover .photonui-faicon,.photonui-button.photonui-button-appearance-flat:hover .photonui-faicon,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:focus:hover .photonui-faicon,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:hover .photonui-faicon{color:#333}.photonui-button.photonui-button-appearance-flat:focus:hover.photonui-button-color-blue,.photonui-button.photonui-button-appearance-flat:hover.photonui-button-color-blue,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:focus:hover.photonui-button-color-blue,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:hover.photonui-button-color-blue{background-color:#25A4B7;border-color:#25A4B7;border-bottom-color:#145862;color:#000;outline:0;color:#fff}.photonui-button.photonui-button-appearance-flat:focus:hover.photonui-button-color-blue .photonui-faicon,.photonui-button.photonui-button-appearance-flat:hover.photonui-button-color-blue .photonui-faicon,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:focus:hover.photonui-button-color-blue .photonui-faicon,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:hover.photonui-button-color-blue .photonui-faicon{color:#000}.photonui-button.photonui-button-appearance-flat:focus:hover.photonui-button-color-blue .photonui-faicon,.photonui-button.photonui-button-appearance-flat:hover.photonui-button-color-blue .photonui-faicon,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:focus:hover.photonui-button-color-blue .photonui-faicon,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:hover.photonui-button-color-blue .photonui-faicon{color:#fff}.photonui-button.photonui-button-appearance-flat:focus:hover.photonui-button-color-blue:focus,.photonui-button.photonui-button-appearance-flat:hover.photonui-button-color-blue:focus,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:focus:hover.photonui-button-color-blue:focus,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:hover.photonui-button-color-blue:focus{box-shadow:0 0 3px rgba(0,0,0,.3),inset 2px 2px 0 #145862,inset -2px 0 0 #145862}.photonui-button.photonui-button-appearance-flat:focus:hover.photonui-button-color-blue:active,.photonui-button.photonui-button-appearance-flat:hover.photonui-button-color-blue:active,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:focus:hover.photonui-button-color-blue:active,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:hover.photonui-button-color-blue:active{border:none;box-shadow:inset 0 0 7px #030c0d;padding-top:2px;padding-bottom:1px}.photonui-button.photonui-button-appearance-flat:focus:hover.photonui-button-color-blue:active:focus,.photonui-button.photonui-button-appearance-flat:hover.photonui-button-color-blue:active:focus,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:focus:hover.photonui-button-color-blue:active:focus,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:hover.photonui-button-color-blue:active:focus{box-shadow:0 0 3px rgba(0,0,0,.3),inset 2px 2px 0 #145862,inset -2px -2px 0 #145862,inset 0 0 7px #030c0d}.photonui-button.photonui-button-appearance-flat:focus:hover.photonui-button-color-red,.photonui-button.photonui-button-appearance-flat:hover.photonui-button-color-red,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:focus:hover.photonui-button-color-red,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:hover.photonui-button-color-red{background-color:#DB624F;border-color:#DB624F;border-bottom-color:#a33321;color:#240b07;outline:0;color:#fff}.photonui-button.photonui-button-appearance-flat:focus:hover.photonui-button-color-red .photonui-faicon,.photonui-button.photonui-button-appearance-flat:hover.photonui-button-color-red .photonui-faicon,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:focus:hover.photonui-button-color-red .photonui-faicon,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:hover.photonui-button-color-red .photonui-faicon{color:#240b07}.photonui-button.photonui-button-appearance-flat:focus:hover.photonui-button-color-red .photonui-faicon,.photonui-button.photonui-button-appearance-flat:hover.photonui-button-color-red .photonui-faicon,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:focus:hover.photonui-button-color-red .photonui-faicon,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:hover.photonui-button-color-red .photonui-faicon{color:#fff}.photonui-button.photonui-button-appearance-flat:focus:hover.photonui-button-color-red:focus,.photonui-button.photonui-button-appearance-flat:hover.photonui-button-color-red:focus,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:focus:hover.photonui-button-color-red:focus,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:hover.photonui-button-color-red:focus{box-shadow:0 0 3px rgba(0,0,0,.3),inset 2px 2px 0 #a33321,inset -2px 0 0 #a33321}.photonui-button.photonui-button-appearance-flat:focus:hover.photonui-button-color-red:active,.photonui-button.photonui-button-appearance-flat:hover.photonui-button-color-red:active,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:focus:hover.photonui-button-color-red:active,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:hover.photonui-button-color-red:active{border:none;box-shadow:inset 0 0 7px #4e1810;padding-top:2px;padding-bottom:1px}.photonui-button.photonui-button-appearance-flat:focus:hover.photonui-button-color-red:active:focus,.photonui-button.photonui-button-appearance-flat:hover.photonui-button-color-red:active:focus,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:focus:hover.photonui-button-color-red:active:focus,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:hover.photonui-button-color-red:active:focus{box-shadow:0 0 3px rgba(0,0,0,.3),inset 2px 2px 0 #a33321,inset -2px -2px 0 #a33321,inset 0 0 7px #4e1810}.photonui-button.photonui-button-appearance-flat:focus:hover.photonui-button-color-yellow,.photonui-button.photonui-button-appearance-flat:hover.photonui-button-color-yellow,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:focus:hover.photonui-button-color-yellow,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:hover.photonui-button-color-yellow{background-color:#FDD835;border-color:#FDD835;border-bottom-color:#caa502;color:#322900;outline:0}.photonui-button.photonui-button-appearance-flat:focus:hover.photonui-button-color-yellow .photonui-faicon,.photonui-button.photonui-button-appearance-flat:hover.photonui-button-color-yellow .photonui-faicon,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:focus:hover.photonui-button-color-yellow .photonui-faicon,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:hover.photonui-button-color-yellow .photonui-faicon{color:#322900}.photonui-button.photonui-button-appearance-flat:focus:hover.photonui-button-color-yellow:focus,.photonui-button.photonui-button-appearance-flat:hover.photonui-button-color-yellow:focus,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:focus:hover.photonui-button-color-yellow:focus,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:hover.photonui-button-color-yellow:focus{box-shadow:0 0 3px rgba(0,0,0,.3),inset 2px 2px 0 #caa502,inset -2px 0 0 #caa502}.photonui-button.photonui-button-appearance-flat:focus:hover.photonui-button-color-yellow:active,.photonui-button.photonui-button-appearance-flat:hover.photonui-button-color-yellow:active,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:focus:hover.photonui-button-color-yellow:active,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:hover.photonui-button-color-yellow:active{border:none;box-shadow:inset 0 0 7px #655201;padding-top:2px;padding-bottom:1px}.photonui-button.photonui-button-appearance-flat:focus:hover.photonui-button-color-yellow:active:focus,.photonui-button.photonui-button-appearance-flat:hover.photonui-button-color-yellow:active:focus,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:focus:hover.photonui-button-color-yellow:active:focus,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:hover.photonui-button-color-yellow:active:focus{box-shadow:0 0 3px rgba(0,0,0,.3),inset 2px 2px 0 #caa502,inset -2px -2px 0 #caa502,inset 0 0 7px #655201}.photonui-button.photonui-button-appearance-flat:focus:hover.photonui-button-color-green,.photonui-button.photonui-button-appearance-flat:hover.photonui-button-color-green,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:focus:hover.photonui-button-color-green,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:hover.photonui-button-color-green{background-color:#4CAF50;border-color:#4CAF50;border-bottom-color:#2d682f;color:#000;outline:0;color:#fff}.photonui-button.photonui-button-appearance-flat:focus:hover.photonui-button-color-green .photonui-faicon,.photonui-button.photonui-button-appearance-flat:hover.photonui-button-color-green .photonui-faicon,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:focus:hover.photonui-button-color-green .photonui-faicon,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:hover.photonui-button-color-green .photonui-faicon{color:#000}.photonui-button.photonui-button-appearance-flat:focus:hover.photonui-button-color-green .photonui-faicon,.photonui-button.photonui-button-appearance-flat:hover.photonui-button-color-green .photonui-faicon,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:focus:hover.photonui-button-color-green .photonui-faicon,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:hover.photonui-button-color-green .photonui-faicon{color:#fff}.photonui-button.photonui-button-appearance-flat:focus:hover.photonui-button-color-green:focus,.photonui-button.photonui-button-appearance-flat:hover.photonui-button-color-green:focus,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:focus:hover.photonui-button-color-green:focus,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:hover.photonui-button-color-green:focus{box-shadow:0 0 3px rgba(0,0,0,.3),inset 2px 2px 0 #2d682f,inset -2px 0 0 #2d682f}.photonui-button.photonui-button-appearance-flat:focus:hover.photonui-button-color-green:active,.photonui-button.photonui-button-appearance-flat:hover.photonui-button-color-green:active,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:focus:hover.photonui-button-color-green:active,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:hover.photonui-button-color-green:active{border:none;box-shadow:inset 0 0 7px #0e210f;padding-top:2px;padding-bottom:1px}.photonui-button.photonui-button-appearance-flat:focus:hover.photonui-button-color-green:active:focus,.photonui-button.photonui-button-appearance-flat:hover.photonui-button-color-green:active:focus,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:focus:hover.photonui-button-color-green:active:focus,.photonui-togglebutton.photonui-button-appearance-flat input:not(:checked)+button:hover.photonui-button-color-green:active:focus{box-shadow:0 0 3px rgba(0,0,0,.3),inset 2px 2px 0 #2d682f,inset -2px -2px 0 #2d682f,inset 0 0 7px #0e210f}.photonui-togglebutton input:checked+button{border:none;box-shadow:inset 0 0 7px #999;padding-top:2px;padding-bottom:1px}.photonui-togglebutton input:checked+button:focus{box-shadow:0 0 3px rgba(0,0,0,.3),inset 2px 2px 0 #ccc,inset -2px -2px 0 #ccc,inset 0 0 7px #999}.photonui-togglebutton input:checked+button.photonui-button-color-blue{border:none;box-shadow:inset 0 0 7px #030c0d;padding-top:2px;padding-bottom:1px}.photonui-togglebutton input:checked+button.photonui-button-color-blue:focus{box-shadow:0 0 3px rgba(0,0,0,.3),inset 2px 2px 0 #145862,inset -2px -2px 0 #145862,inset 0 0 7px #030c0d}.photonui-togglebutton input:checked+button.photonui-button-color-red{border:none;box-shadow:inset 0 0 7px #4e1810;padding-top:2px;padding-bottom:1px}.photonui-togglebutton input:checked+button.photonui-button-color-red:focus{box-shadow:0 0 3px rgba(0,0,0,.3),inset 2px 2px 0 #a33321,inset -2px -2px 0 #a33321,inset 0 0 7px #4e1810}.photonui-togglebutton input:checked+button.photonui-button-color-yellow{border:none;box-shadow:inset 0 0 7px #655201;padding-top:2px;padding-bottom:1px}.photonui-togglebutton input:checked+button.photonui-button-color-yellow:focus{box-shadow:0 0 3px rgba(0,0,0,.3),inset 2px 2px 0 #caa502,inset -2px -2px 0 #caa502,inset 0 0 7px #655201}.photonui-togglebutton input:checked+button.photonui-button-color-green{border:none;box-shadow:inset 0 0 7px #0e210f;padding-top:2px;padding-bottom:1px}.photonui-togglebutton input:checked+button.photonui-button-color-green:focus{box-shadow:0 0 3px rgba(0,0,0,.3),inset 2px 2px 0 #2d682f,inset -2px -2px 0 #2d682f,inset 0 0 7px #0e210f}.photonui-checkbox{display:inline-block}.photonui-checkbox input{display:none}.photonui-checkbox input+span{cursor:pointer;outline:0;display:block;box-sizing:border-box;width:20px;height:20px;border:#c1c1c1 solid 2px;border-radius:3px;transition:all 150ms;overflow:hidden}.photonui-checkbox input:checked+span{border-color:#4ec8db;background:#4ec8db}.photonui-checkbox input:checked+span:after{content:"";display:block;width:10px;height:6px;border:#fff solid 3px;border-top:none;border-right:none;transform:rotate(-50deg);margin:1px 0 0 2px}.photonui-checkbox input+span:focus,.photonui-checkbox input:checked+span:focus{border-color:#25a4b7;box-shadow:0 0 3px rgba(0,0,0,.3)}.photonui-checkbox input[disabled]+span{border-color:#e7e7e7;box-shadow:none}.photonui-checkbox input[disabled]:checked+span,.photonui-checkbox input[disabled]:checked+span:focus{border-color:#bbb;background-color:#bbb}.photonui-checkbox input[disabled]:checked+span:after,.photonui-checkbox input[disabled]:checked+span:focus:after{border-color:#959595}.photonui-colorbutton{padding-left:5px;padding-right:5px}.photonui-colorbutton span{box-sizing:border-box;border-radius:2px;text-shadow:none;vertical-align:middle;height:calc(76%);width:100%;box-shadow:inset 1px 1px 0 rgba(0,0,0,.3),inset -1px -1px 0 rgba(0,0,0,.3)}.photonui-colorbutton-custombutton{margin:0!important;width:100%!important;line-height:1.4em!important}.photonui-colorpalette{border-collapse:separate;border-spacing:4px}.photonui-colorpalette tr td{width:20px;min-width:20px;max-width:20px;height:20px;min-height:20px;max-height:20px;cursor:pointer}.photonui-colorpicker .photonui-colorpicker-preview{text-align:center;color:rgba(255,255,255,.8);font-size:14px;text-shadow:1px 1px 0 rgba(0,0,0,.1),1px 1px 1px rgba(0,0,0,.7);outline:0;box-shadow:inset 1px 1px 0 #fff,inset -1px -1px 0 #fff;border:1px solid #c1c1c1}.photonui-colorpicker .photonui-colorpicker-preview:focus{color:#fff;border-color:#25a4b7;box-shadow:inset 1px 1px 0 #fff,inset -1px -1px 0 #fff,0 0 3px rgba(0,0,0,.3)}.photonui-field{border:1px solid #c1c1c1;background:#fff;color:#333;outline:0;padding:5px;transition:all 150ms;box-sizing:border-box;width:100%}.photonui-field:focus{background:#fff;border-color:#25a4b7;color:#333;box-shadow:inset 0 0 7px rgba(0,0,0,.1),0 0 3px rgba(0,0,0,.3)}.photonui-field::-webkit-input-placeholder{color:#b3b3b3;opacity:1;font-style:italic}.photonui-field::-moz-placeholder{color:#b3b3b3;opacity:1;font-style:italic}.photonui-field:-moz-placeholder{color:#b3b3b3;opacity:1;font-style:italic}.photonui-field:-ms-input-placeholder{color:#b3b3b3;opacity:1;font-style:italic}.photonui-field[disabled]{background:#f2f2f2;color:#a6a6a6}.photonui-field[disabled]::-webkit-input-placeholder{color:#b3b3b3}.photonui-field[disabled]::-moz-placeholder{color:#b3b3b3}.photonui-field[disabled]:-moz-placeholder{color:#b3b3b3}.photonui-field[disabled]:-ms-input-placeholder{color:#b3b3b3}.photonui-slider .photonui-slider-slider{margin-right:8px;cursor:pointer;outline:0;min-width:50px}.photonui-slider .photonui-slider-slider:before{box-sizing:border-box;content:"";display:block;height:4px;margin-top:8px;background:#bbb;border-radius:4px}.photonui-slider .photonui-slider-slider .photonui-slider-grip{width:20px;height:20px;border-radius:50%;background:#25a4b7;margin-top:-12px;box-shadow:0 1px 3px rgba(0,0,0,.1)}.photonui-slider .photonui-slider-slider:focus .photonui-slider-grip{box-shadow:0 0 3px rgba(0,0,0,.3);border:#1d7e8d solid 2px}.photonui-slider.photonui-slider-nofield .photonui-slider-slider{margin-right:0}.photonui-switch{padding:5px;padding-bottom:0}.photonui-switch input+span{width:37px;cursor:pointer;outline:0}.photonui-switch input+span:before{box-sizing:border-box;content:"";display:block;height:16px;width:37px;border-radius:8px;outline:0;background:#bbb;transition:all 150ms}.photonui-switch input+span:after{content:"";display:block;margin-top:-21px;margin-left:-5px;width:26px;height:26px;background:#959595;outline:0;border-radius:50%;box-shadow:0 1px 3px rgba(0,0,0,.1);transition:all 150ms}.photonui-switch input+span:focus:after{box-shadow:0 0 3px rgba(0,0,0,.3);border:#7b7b7b solid 2px}.photonui-switch input:checked+span:before{background:#4ec8db}.photonui-switch input:checked+span:after{background:#25a4b7;margin-left:18.5px}.photonui-switch input:checked+span:focus:after{border:#1d7e8d solid 2px}.photonui-label{color:#333;padding:2px 0}.photonui-progressbar{border-radius:0;box-shadow:inset 1px 1px 0 #c1c1c1,inset -1px -1px 0 #c1c1c1,inset -1px 1px 0 #c1c1c1,inset 1px -1px 0 #c1c1c1;background:#fff}.photonui-progressbar .photonui-progressbar-bar{border-radius:0;box-shadow:inset 1px 1px 0 #25a4b7,inset -1px -1px 0 #25a4b7,inset -1px 1px 0 #25a4b7,inset 1px -1px 0 #25a4b7;background:#4ec8db}.photonui-progressbar.photonui-progressbar-vertical .photonui-progressbar-bar{top:auto;bottom:0}.photonui-progressbar.photonui-progressbar-vertical .photonui-progressbar-text{transform:rotate(-90deg)}.photonui-separator hr{border:none}.photonui-separator.photonui-separator-horizontal{padding:5px 0}.photonui-separator.photonui-separator-horizontal hr{border-bottom:1px solid #c1c1c1}.photonui-separator.photonui-separator-vertical{padding:0 5px;background:linear-gradient(to right,transparent 0,transparent 5px,#c1c1c1 5px,#c1c1c1 6px,transparent 6px,transparent 100%)}.photonui-separator.photonui-separator-vertical hr{border-right:1px solid transparent}.photonui-select{cursor:pointer;border:#c1c1c1 solid 1px;background:#fff}.photonui-select>*{color:#333}.photonui-select:focus{border-color:#25a4b7;background:#fff;box-shadow:inset 0 0 7px rgba(0,0,0,.1),0 0 3px rgba(0,0,0,.3)}.photonui-select:focus>*{color:#333}.photonui-select .photonui-menuitem.photonui-select-placeholder{color:#b3b3b3;font-style:italic}.photonui-select .photonui-menuitem .photonui-menuitem-icon>*{color:inherit}.photonui-select .photonui-menuitem .photonui-menuitem-widget:before{box-sizing:border-box;content:"";display:inline-block;border:transparent solid 6px;border-top-color:#333;transform:translate(0,4px);transition:transform 150ms}.photonui-select.photonui-widget-disabled{border-color:#c1c1c1;background:#f2f2f2}.photonui-select.photonui-widget-disabled>*{color:#a6a6a6}.photonui-select.photonui-widget-disabled .photonui-menuitem.photonui-select-placeholder{color:#b3b3b3}.photonui-select.photonui-widget-disabled .photonui-menuitem .photonui-menuitem-widget:before{border-top-color:#949494}.photonui-tablayout .photonui-tablayout-tabs .photonui-tabitem-tab{border:#c1c1c1 solid 1px;vertical-align:middle;padding:0 8px;cursor:pointer;background:#e1e1e1;transition:all 150ms}.photonui-tablayout .photonui-tablayout-tabs .photonui-tabitem-tab:hover{background:#fff}.photonui-tablayout .photonui-tablayout-tabs .photonui-tabitem-tab.photonui-tabitem-active{background:#fff;z-index:10}.photonui-tablayout .photonui-tablayout-content{background:#fff;border:#c1c1c1 solid 1px;box-shadow:0 0 2px rgba(0,0,0,.2)}.photonui-tablayout.photonui-tablayout-tabposition-bottom>.photonui-tablayout-innerbox>.photonui-tablayout-tabs,.photonui-tablayout.photonui-tablayout-tabposition-top>.photonui-tablayout-innerbox>.photonui-tablayout-tabs{height:36px;min-height:36px;max-height:36px}.photonui-tablayout.photonui-tablayout-tabposition-bottom>.photonui-tablayout-innerbox>.photonui-tablayout-tabs>.photonui-tabitem-tab,.photonui-tablayout.photonui-tablayout-tabposition-top>.photonui-tablayout-innerbox>.photonui-tablayout-tabs>.photonui-tabitem-tab{line-height:30px;height:30px;text-align:center;margin-right:-1px}.photonui-tablayout.photonui-tablayout-tabposition-bottom>.photonui-tablayout-innerbox>.photonui-tablayout-tabs>.photonui-tabitem-tab.photonui-tabitem-active,.photonui-tablayout.photonui-tablayout-tabposition-top>.photonui-tablayout-innerbox>.photonui-tablayout-tabs>.photonui-tabitem-tab.photonui-tabitem-active{height:36px;line-height:36px}.photonui-tablayout.photonui-tablayout-tabposition-left>.photonui-tablayout-innerbox>.photonui-tablayout-tabs,.photonui-tablayout.photonui-tablayout-tabposition-right>.photonui-tablayout-innerbox>.photonui-tablayout-tabs{width:120px;min-width:120px;max-width:120px;padding-top:1px}.photonui-tablayout.photonui-tablayout-tabposition-left>.photonui-tablayout-innerbox>.photonui-tablayout-tabs>.photonui-tabitem-tab,.photonui-tablayout.photonui-tablayout-tabposition-right>.photonui-tablayout-innerbox>.photonui-tablayout-tabs>.photonui-tabitem-tab{width:calc(94%);line-height:32px;height:32px;text-align:32px;text-align:left;margin-top:-1px}.photonui-tablayout.photonui-tablayout-tabposition-left>.photonui-tablayout-innerbox>.photonui-tablayout-tabs>.photonui-tabitem-tab.photonui-tabitem-active,.photonui-tablayout.photonui-tablayout-tabposition-right>.photonui-tablayout-innerbox>.photonui-tablayout-tabs>.photonui-tabitem-tab.photonui-tabitem-active{width:100%}.photonui-tablayout.photonui-tablayout-tabposition-left>.photonui-tablayout-innerbox .photonui-tablayout-content,.photonui-tablayout.photonui-tablayout-tabposition-right>.photonui-tablayout-innerbox .photonui-tablayout-content{width:100%}.photonui-tablayout.photonui-tablayout-tabposition-top>.photonui-tablayout-innerbox>.photonui-tablayout-tabs>.photonui-tabitem-tab{-ms-flex-item-align:end;align-self:flex-end;border-bottom:none}.photonui-tablayout.photonui-tablayout-tabposition-top>.photonui-tablayout-innerbox>.photonui-tablayout-tabs>.photonui-tabitem-tab.photonui-tabitem-active{margin-bottom:-1px;box-shadow:-1px 0 0 rgba(0,0,0,.05),1px 0 0 rgba(0,0,0,.05),0 -1px 0 rgba(0,0,0,.05),-2px -2px 0 rgba(0,0,0,.01),2px -2px 0 rgba(0,0,0,.01)}.photonui-tablayout.photonui-tablayout-tabposition-bottom>.photonui-tablayout-innerbox>.photonui-tablayout-tabs>.photonui-tabitem-tab{-ms-flex-item-align:start;align-self:flex-start;border-top:none}.photonui-tablayout.photonui-tablayout-tabposition-bottom>.photonui-tablayout-innerbox>.photonui-tablayout-tabs>.photonui-tabitem-tab.photonui-tabitem-active{margin-top:-1px;box-shadow:-1px 0 0 rgba(0,0,0,.05),1px 0 0 rgba(0,0,0,.05),0 1px 0 rgba(0,0,0,.05),-2px 2px 0 rgba(0,0,0,.01),2px 2px 0 rgba(0,0,0,.01)}.photonui-tablayout.photonui-tablayout-tabposition-left>.photonui-tablayout-innerbox>.photonui-tablayout-tabs>.photonui-tabitem-tab{-ms-flex-item-align:end;align-self:flex-end;border-right:none;text-align:right}.photonui-tablayout.photonui-tablayout-tabposition-left>.photonui-tablayout-innerbox>.photonui-tablayout-tabs>.photonui-tabitem-tab.photonui-tabitem-active{margin-right:-1px;padding-right:9px;box-shadow:0 -1px 0 rgba(0,0,0,.05),0 1px 0 rgba(0,0,0,.05),-1px 0 0 rgba(0,0,0,.05),-2px -2px 0 rgba(0,0,0,.01),-2px 2px 0 rgba(0,0,0,.01)}.photonui-tablayout.photonui-tablayout-tabposition-right>.photonui-tablayout-innerbox>.photonui-tablayout-tabs>.photonui-tabitem-tab{-ms-flex-item-align:start;align-self:flex-start;border-left:none}.photonui-tablayout.photonui-tablayout-tabposition-right>.photonui-tablayout-innerbox>.photonui-tablayout-tabs>.photonui-tabitem-tab.photonui-tabitem-active{margin-left:-1px;padding-left:9px;box-shadow:0 -1px 0 rgba(0,0,0,.05),0 1px 0 rgba(0,0,0,.05),1px 0 0 rgba(0,0,0,.05),2px -2px 0 rgba(0,0,0,.01),2px 2px 0 rgba(0,0,0,.01)}.photonui-iconbutton:focus{outline:0;box-shadow:inset 0 0 0 1px rgba(0,0,0,.1)}.photonui-listview .photonui-listview-item{background-color:#FFF;border-color:#ccc;transition:background-color .1s ease-in-out}.photonui-listview .photonui-listview-item:hover{background-color:#f7f7f7}.photonui-listview .photonui-listview-item.selected{color:#10454d;background-color:#a3e2ec;border-color:#78d5e4}.photonui-listview .photonui-listview-item.selected:hover{background-color:#96deea}.photonui-tableview .photonui-tableview-item{background-color:#FFF;border-color:#f0f0f0;transition:all .15s ease-in-out}.photonui-tableview .photonui-tableview-item:hover{background-color:#f7f7f7}.photonui-tableview .photonui-tableview-item.selected{color:#10454d;background-color:#a3e2ec;border-color:#78d5e4}.photonui-tableview .photonui-tableview-item.selected:hover{background-color:#96deea}.photonui-tableview .photonui-tableview-item.selected .photonui-tableview-column{border-color:#78d5e4}.photonui-tableview .photonui-tableview-header{background-color:#f7f7f7;border-color:#f0f0f0}.photonui-iconview .photonui-iconview-item{background-color:#FFF;border-color:#f0f0f0;transition:all .15s ease-in-out}.photonui-iconview .photonui-iconview-item:hover{background-color:#f7f7f7}.photonui-iconview .photonui-iconview-item.selected{background-color:#a3e2ec;border-color:#78d5e4}.photonui-iconview .photonui-iconview-item.selected:hover{background-color:#96deea}.photonui-iconview .photonui-iconview-item.selected .photonui-text{color:#10454d} +/* Tomorrow Night Theme */ +/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */ +/* Original theme - https://github.com/chriskempson/tomorrow-theme */ +/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */ + +/* Tomorrow Comment */ +.hljs-comment { + color: #969896; +} + +/* Tomorrow Red */ +.hljs-variable, +.hljs-attribute, +.hljs-tag, +.hljs-regexp, +.ruby .hljs-constant, +.xml .hljs-tag .hljs-title, +.xml .hljs-pi, +.xml .hljs-doctype, +.html .hljs-doctype, +.css .hljs-id, +.css .hljs-class, +.css .hljs-pseudo { + color: #cc6666; +} + +/* Tomorrow Orange */ +.hljs-number, +.hljs-preprocessor, +.hljs-pragma, +.hljs-built_in, +.hljs-literal, +.hljs-params, +.hljs-constant { + color: #de935f; +} + +/* Tomorrow Yellow */ +.ruby .hljs-class .hljs-title, +.css .hljs-rule .hljs-attribute { + color: #f0c674; +} + +/* Tomorrow Green */ +.hljs-string, +.hljs-value, +.hljs-inheritance, +.hljs-header, +.hljs-name, +.ruby .hljs-symbol, +.xml .hljs-cdata { + color: #b5bd68; +} + +/* Tomorrow Aqua */ +.hljs-title, +.css .hljs-hexcolor { + color: #8abeb7; +} + +/* Tomorrow Blue */ +.hljs-function, +.python .hljs-decorator, +.python .hljs-title, +.ruby .hljs-function .hljs-title, +.ruby .hljs-title .hljs-keyword, +.perl .hljs-sub, +.javascript .hljs-title, +.coffeescript .hljs-title { + color: #81a2be; +} + +/* Tomorrow Purple */ +.hljs-keyword, +.javascript .hljs-function { + color: #b294bb; +} + +.hljs { + display: block; + overflow-x: auto; + background: #1d1f21; + color: #c5c8c6; + padding: 0.5em; + -webkit-text-size-adjust: none; +} + +.coffeescript .javascript, +.javascript .xml, +.tex .hljs-formula, +.xml .javascript, +.xml .vbscript, +.xml .css, +.xml .hljs-cdata { + opacity: 0.5; +} + +/* BASICS */ + +.CodeMirror { + /* Set height, width, borders, and global font properties here */ + font-family: monospace; + height: 300px; + color: black; +} + +/* PADDING */ + +.CodeMirror-lines { + padding: 4px 0; /* Vertical padding around content */ +} +.CodeMirror pre { + padding: 0 4px; /* Horizontal padding of content */ +} + +.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { + background-color: white; /* The little square between H and V scrollbars */ +} + +/* GUTTER */ + +.CodeMirror-gutters { + border-right: 1px solid #ddd; + background-color: #f7f7f7; + white-space: nowrap; +} +.CodeMirror-linenumbers {} +.CodeMirror-linenumber { + padding: 0 3px 0 5px; + min-width: 20px; + text-align: right; + color: #999; + white-space: nowrap; +} + +.CodeMirror-guttermarker { color: black; } +.CodeMirror-guttermarker-subtle { color: #999; } + +/* CURSOR */ + +.CodeMirror-cursor { + border-left: 1px solid black; + border-right: none; + width: 0; +} +/* Shown when moving in bi-directional text */ +.CodeMirror div.CodeMirror-secondarycursor { + border-left: 1px solid silver; +} +.cm-fat-cursor .CodeMirror-cursor { + width: auto; + border: 0 !important; + background: #7e7; +} +.cm-fat-cursor div.CodeMirror-cursors { + z-index: 1; +} + +.cm-animate-fat-cursor { + width: auto; + border: 0; + -webkit-animation: blink 1.06s steps(1) infinite; + -moz-animation: blink 1.06s steps(1) infinite; + animation: blink 1.06s steps(1) infinite; + background-color: #7e7; +} +@-moz-keyframes blink { + 0% {} + 50% { background-color: transparent; } + 100% {} +} +@-webkit-keyframes blink { + 0% {} + 50% { background-color: transparent; } + 100% {} +} +@keyframes blink { + 0% {} + 50% { background-color: transparent; } + 100% {} +} + +/* Can style cursor different in overwrite (non-insert) mode */ +.CodeMirror-overwrite .CodeMirror-cursor {} + +.cm-tab { display: inline-block; text-decoration: inherit; } + +.CodeMirror-rulers { + position: absolute; + left: 0; right: 0; top: -50px; bottom: -20px; + overflow: hidden; +} +.CodeMirror-ruler { + border-left: 1px solid #ccc; + top: 0; bottom: 0; + position: absolute; +} + +/* DEFAULT THEME */ + +.cm-s-default .cm-header {color: blue;} +.cm-s-default .cm-quote {color: #090;} +.cm-negative {color: #d44;} +.cm-positive {color: #292;} +.cm-header, .cm-strong {font-weight: bold;} +.cm-em {font-style: italic;} +.cm-link {text-decoration: underline;} +.cm-strikethrough {text-decoration: line-through;} + +.cm-s-default .cm-keyword {color: #708;} +.cm-s-default .cm-atom {color: #219;} +.cm-s-default .cm-number {color: #164;} +.cm-s-default .cm-def {color: #00f;} +.cm-s-default .cm-variable, +.cm-s-default .cm-punctuation, +.cm-s-default .cm-property, +.cm-s-default .cm-operator {} +.cm-s-default .cm-variable-2 {color: #05a;} +.cm-s-default .cm-variable-3 {color: #085;} +.cm-s-default .cm-comment {color: #a50;} +.cm-s-default .cm-string {color: #a11;} +.cm-s-default .cm-string-2 {color: #f50;} +.cm-s-default .cm-meta {color: #555;} +.cm-s-default .cm-qualifier {color: #555;} +.cm-s-default .cm-builtin {color: #30a;} +.cm-s-default .cm-bracket {color: #997;} +.cm-s-default .cm-tag {color: #170;} +.cm-s-default .cm-attribute {color: #00c;} +.cm-s-default .cm-hr {color: #999;} +.cm-s-default .cm-link {color: #00c;} + +.cm-s-default .cm-error {color: #f00;} +.cm-invalidchar {color: #f00;} + +.CodeMirror-composing { border-bottom: 2px solid; } + +/* Default styles for common addons */ + +div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;} +div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;} +.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); } +.CodeMirror-activeline-background {background: #e8f2ff;} + +/* STOP */ + +/* The rest of this file contains styles related to the mechanics of + the editor. You probably shouldn't touch them. */ + +.CodeMirror { + position: relative; + overflow: hidden; + background: white; +} + +.CodeMirror-scroll { + overflow: scroll !important; /* Things will break if this is overridden */ + /* 30px is the magic margin used to hide the element's real scrollbars */ + /* See overflow: hidden in .CodeMirror */ + margin-bottom: -30px; margin-right: -30px; + padding-bottom: 30px; + height: 100%; + outline: none; /* Prevent dragging from highlighting the element */ + position: relative; +} +.CodeMirror-sizer { + position: relative; + border-right: 30px solid transparent; +} + +/* The fake, visible scrollbars. Used to force redraw during scrolling + before actual scrolling happens, thus preventing shaking and + flickering artifacts. */ +.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { + position: absolute; + z-index: 6; + display: none; +} +.CodeMirror-vscrollbar { + right: 0; top: 0; + overflow-x: hidden; + overflow-y: scroll; +} +.CodeMirror-hscrollbar { + bottom: 0; left: 0; + overflow-y: hidden; + overflow-x: scroll; +} +.CodeMirror-scrollbar-filler { + right: 0; bottom: 0; +} +.CodeMirror-gutter-filler { + left: 0; bottom: 0; +} + +.CodeMirror-gutters { + position: absolute; left: 0; top: 0; + min-height: 100%; + z-index: 3; +} +.CodeMirror-gutter { + white-space: normal; + height: 100%; + display: inline-block; + vertical-align: top; + margin-bottom: -30px; + /* Hack to make IE7 behave */ + *zoom:1; + *display:inline; +} +.CodeMirror-gutter-wrapper { + position: absolute; + z-index: 4; + background: none !important; + border: none !important; +} +.CodeMirror-gutter-background { + position: absolute; + top: 0; bottom: 0; + z-index: 4; +} +.CodeMirror-gutter-elt { + position: absolute; + cursor: default; + z-index: 4; +} +.CodeMirror-gutter-wrapper { + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; +} + +.CodeMirror-lines { + cursor: text; + min-height: 1px; /* prevents collapsing before first draw */ +} +.CodeMirror pre { + /* Reset some styles that the rest of the page might have set */ + -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; + border-width: 0; + background: transparent; + font-family: inherit; + font-size: inherit; + margin: 0; + white-space: pre; + word-wrap: normal; + line-height: inherit; + color: inherit; + z-index: 2; + position: relative; + overflow: visible; + -webkit-tap-highlight-color: transparent; + -webkit-font-variant-ligatures: none; + font-variant-ligatures: none; +} +.CodeMirror-wrap pre { + word-wrap: break-word; + white-space: pre-wrap; + word-break: normal; +} + +.CodeMirror-linebackground { + position: absolute; + left: 0; right: 0; top: 0; bottom: 0; + z-index: 0; +} + +.CodeMirror-linewidget { + position: relative; + z-index: 2; + overflow: auto; +} + +.CodeMirror-widget {} + +.CodeMirror-code { + outline: none; +} + +/* Force content-box sizing for the elements where we expect it */ +.CodeMirror-scroll, +.CodeMirror-sizer, +.CodeMirror-gutter, +.CodeMirror-gutters, +.CodeMirror-linenumber { + -moz-box-sizing: content-box; + box-sizing: content-box; +} + +.CodeMirror-measure { + position: absolute; + width: 100%; + height: 0; + overflow: hidden; + visibility: hidden; +} + +.CodeMirror-cursor { + position: absolute; + pointer-events: none; +} +.CodeMirror-measure pre { position: static; } + +div.CodeMirror-cursors { + visibility: hidden; + position: relative; + z-index: 3; +} +div.CodeMirror-dragcursors { + visibility: visible; +} + +.CodeMirror-focused div.CodeMirror-cursors { + visibility: visible; +} + +.CodeMirror-selected { background: #d9d9d9; } +.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; } +.CodeMirror-crosshair { cursor: crosshair; } +.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; } +.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; } + +.cm-searching { + background: #ffa; + background: rgba(255, 255, 0, .4); +} + +/* IE7 hack to prevent it from returning funny offsetTops on the spans */ +.CodeMirror span { *vertical-align: text-bottom; } + +/* Used to force a border model for a node */ +.cm-force-border { padding-right: .1px; } + +@media print { + /* Hide the cursor when printing */ + .CodeMirror div.CodeMirror-cursors { + visibility: hidden; + } +} + +/* See issue #2901 */ +.cm-tab-wrap-hack:after { content: ''; } + +/* Help users use markselection to safely style text background */ +span.CodeMirror-selectedtext { background: none; } + +/* + + Name: Tomorrow Night - Bright + Author: Chris Kempson + + Port done by Gerard Braad + +*/ + +/* EDITED */ + +.cm-s-tomorrow-night-bright.CodeMirror { background: transparent; color: #eaeaea; } +.cm-s-tomorrow-night-bright div.CodeMirror-selected { background: #424242; } +.cm-s-tomorrow-night-bright .CodeMirror-gutters { background: #000000; border-right: 0px; } +.cm-s-tomorrow-night-bright .CodeMirror-guttermarker { color: #e78c45; } +.cm-s-tomorrow-night-bright .CodeMirror-guttermarker-subtle { color: #777; } +.cm-s-tomorrow-night-bright .CodeMirror-linenumber { color: #424242; } +.cm-s-tomorrow-night-bright .CodeMirror-cursor { border-left: 1px solid #6A6A6A; } + +.cm-s-tomorrow-night-bright span.cm-comment { color: #999999; } +.cm-s-tomorrow-night-bright span.cm-atom { color: #de935f; } +.cm-s-tomorrow-night-bright span.cm-number { color: #de935f; } + +.cm-s-tomorrow-night-bright span.cm-property, .cm-s-tomorrow-night-bright span.cm-attribute { color: #fff; } +.cm-s-tomorrow-night-bright span.cm-keyword { color: #b294bb; } +.cm-s-tomorrow-night-bright span.cm-string { color: #b5bd68; } + +.cm-s-tomorrow-night-bright span.cm-variable { color: #fff; } +.cm-s-tomorrow-night-bright span.cm-variable-2 { color: #fff; } +.cm-s-tomorrow-night-bright span.cm-def { color: #de935f; } +.cm-s-tomorrow-night-bright span.cm-bracket { color: #eaeaea; } +.cm-s-tomorrow-night-bright span.cm-tag { color: #d54e53; } +.cm-s-tomorrow-night-bright span.cm-link { color: #a16a94; } +.cm-s-tomorrow-night-bright span.cm-error { background: #d54e53; color: #6A6A6A; } + +.cm-s-tomorrow-night-bright .CodeMirror-activeline-background { background: #2a2a2a; } +.cm-s-tomorrow-night-bright .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; } + +html, body { + margin: 0; + padding: 0; + font-family: sans-serif; + color: #222; + background-color: white; + font-size: 12pt; + line-height: 1.4em; +} + +.page { + max-width: 1000px; + margin: 0 auto; + box-sizing: border-box; +} + +a { + color: #247481; +} + +a:hover { + color: #3B95A4; +} + +a.button-big { + border: #4EC8DB solid 2px; + color: #3B95A4; + text-decoration: none; + display: inline-block; + padding: 15px 20px; + font-size: 140%; + border-radius: 3px; + margin: 5px; +} + +a.button-big:hover { + background: #4EC8DB; + color: #fff; +} + +header { + display: block; + background: #4EC8DB; + color: #fff; + padding: 10px 30px; + font-family: 'Titillium Web', sans-serif; + font-size: 200%; + line-height: 1.4em; +} + +header img { + max-width: 100%; +} + +header .header-left, +header .header-right { + vertical-align: middle; + display: inline-block; + box-sizing: border-box; +} + +header .header-left { + margin-right: 20px; + max-width: 300px; +} + +header .header-right { + max-width: 660px; + margin-top: 20px; +} + +header h1 { + margin: 0 0 20px 0; +} + +header p { + margin: 0; + font-style: italic; + margin-bottom: 50px; + line-height: 1.0em; + font-size: 70%; +} + +header a { + display: inline-block; + padding: 5px 10px; + line-height: 1.2em; + font-size: 70%; + text-decoration: none; + border: #fff solid 2px; + color: #fff; + border-radius: 3px; + transition: background-color .2s, color .2s; + margin-top: 7px; +} + +header a:hover { + background: #fff; + color: #4FAFBE; +} + +#content { + padding: 10px 30px; +} + +#content h2 { + font-family: 'Titillium Web', sans-serif; + font-size: 180%; + color: #1C8495; + line-height: 1.3em; +} + +#content h3 { + font-family: 'Titillium Web', sans-serif; + font-size: 150%; + color: #1C8495; + line-height: 1.3em; +} + +#content h4 { + color: #DB624F; +} + +#content img { + max-width: 100%; +} + + +ul.data-list-thumb { + list-style-type: none; + margin: 0; + padding: 0; + width: calc(100% + 15px); +} + +ul.data-list-thumb li { + background: #4EC8DB; + width: calc(20% - 15px); + margin: 0 15px 15px 0; + text-align: center; + font-size: 12pt; + float: left; +} + +ul.data-list-thumb li:hover { + background: #36A5B6; +} + +ul.data-list-thumb li a { + box-sizing: border-box; + display: block; + width: 100%; + height: 100%; + padding: 10px; + text-decoration: none; + font-weight: bold; +} + +ul.data-list-thumb li a span { + display: block; + width: 100%; + color: #fff; +} + +ul.data-list-thumb li a span img { + max-width: 100%; + max-height: 100%; + border-none; +} + + + +footer { + padding: 10px 30px; + text-align: center; + color: #666; + font-size: 70%; + clear: both; +} + + + +.demo-runner { + box-sizing: border-box; + background: #eee; + width: calc(100% + 60px); + margin: -10px 0 15px -30px; + padding: 30px; +} + +.demo-runner .page { + position: relative; +} + +.demo-runner h2 { + margin-top: 0; +} + +.demo-runner .left { + box-sizing: border-box; + width: calc(33% - 10px); + float: left; + min-height: 100%; +} + +.demo-runner .right { + box-sizing: border-box; + background: #333; + width: 66%; + float: right; + padding: 15px; + color: #ddd; +} + +.demo-runner .right #demo-code { + margin: 0; + min-height: 150px; + font-size: 11pt; + overflow: auto; +} + +.demo-runner .right #demo-code .CodeMirror { + height: auto; +} + +.demo-runner .right #demo-error { + box-sizing: border-box; + margin: -15px 0 15px -15px; + background: #db624f; + padding: 3px 5px; + font-size: 11pt; + font-family: monospace; + cursor: default; + width: calc(100% + 30px); + display: none; +} + +.demo-runner .right button#run-script { + border: none; + outline: none; + height: 40px; + line-height: 40px; + float: right; + padding: 0 15px; + margin: 0 -15px -15px 0; + cursor: pointer; + font-size: 12pt; + font-family: sans-serif; + color: #fff; + background: #db624f; + border-bottom: #9F4234 solid 3px; +} + +.demo-runner .right button#run-script:hover { + background: #D25440; +} + +code { + font-size: 10pt; + color: #1C8495; + border: #eee solid 1px; + background: #f8f8f8; + padding: 2px 5px; + border-radius: 2px; +} + +pre code { + color: inherit; + background: transparent; + border: none; + padding: 0; +} + + +figure { + box-sizing: border-box; + width: 100%; + overflow: auto; + background: #333; + color: #ddd; + margin: 0; + padding: 10px; + font-size: 10pt; +} + +figure table { + border-collapse: collapse; + margin: 0; + padding: 0; +} + +figure table tr td:first-child { + padding-right: 15px; + color: #999; + text-align: right; +} + +figure table tr td pre { + margin: 0; +} + +figure .run-script { + border: none; + outline: none; + height: 40px; + line-height: 40px; + float: right; + padding: 0 15px; + margin: -10px -10px 0 0; + cursor: pointer; + font-size: 12pt; + font-family: sans-serif; + color: #fff; + background: #db624f; + border-bottom: #9F4234 solid 3px; +} + +figure .run-script:hover { + background: #D25440; +} + +figure.highlight.javascript .code pre br { + display: none; +} + +article > pre { + box-sizing: border-box; + width: 100%; + overflow: auto; + background: #333; + color: #ddd; + margin: 0; + padding: 10px; + font-size: 10pt; +} + + + +@media +screen and (max-width: 1060px), +screen and (max-width: 1590px) and (min-resolution: 1.5dppx), +screen and (max-width: 2120px) and (min-resolution: 2dppx), +screen and (max-width: 3180px) and (min-resolution: 3dppx) { + header { + font-size: 160%; + } + + header p { + margin-bottom: 30px; + } + + header .header-left { + width: 200px; + } +} + + +@media +screen and (max-width: 850px), +screen and (max-width: 1275px) and (min-resolution: 1.5dppx), +screen and (max-width: 1700px) and (min-resolution: 2dppx), +screen and (max-width: 2550px) and (min-resolution: 3dppx) { + + header .header-left, + header .header-right { + display: block; + margin-left: 0; + margin-right: 0; + width: 100%; + max-width: 100%; + text-align: center; + } + + header img { + width: 200px; + } + + header, #content, footer { + padding: 20px 20px; + } + + ul.data-list-thumb li { + width: calc(25% - 15px); + } + + .demo-runner { + width: calc(100% + 40px); + margin: -20px 0 0 -20px; + padding: 20px 20px; + } + + .demo-runner .left, + .demo-runner .right { + float: none; + width: 100%; + } + + .demo-runner .left #demo { + min-height: 100px; + } + + .demo-runner .right { + margin-left: -20px; + width: calc(100% + 40px); + padding: 15px 20px 55px 20px; + } + + .demo-runner .right button#run-script { + float: none; + position: absolute; + bottom: 0; + right: 0; + margin: 0 -20px 0 0; + } + + .demo-runner .right #demo-error { + margin: -20px 0 15px -20px; + width: calc(100% + 40px); + } + +} + +@media +screen and (max-width: 600px), +screen and (max-width: 900px) and (min-resolution: 1.5dppx), +screen and (max-width: 1200px) and (min-resolution: 2dppx), +screen and (max-width: 1800px) and (min-resolution: 3dppx) { + + ul.data-list-thumb li { + width: calc(33.33% - 15px); + } + +} + +@media +screen and (max-width: 400px), +screen and (max-width: 600px) and (min-resolution: 1.5dppx), +screen and (max-width: 800px) and (min-resolution: 2dppx), +screen and (max-width: 1200px) and (min-resolution: 3dppx) { + + header a { + display: block; + } + + header, #content, footer { + padding: 10px 10px; + } + + ul.data-list-thumb { + width: calc(100% + 10px); + } + + ul.data-list-thumb li { + width: calc(50% - 10px); + margin: 0 10px 10px 0; + } + + .demo-runner { + width: calc(100% + 20px); + margin: -10px 0 0 -10px; + padding: 10px; + } + + .demo-runner .right { + margin-left: -10px; + width: calc(100% + 20px); + padding: 10px 20px 55px 10px; + } + + .demo-runner .right button#run-script { + float: none; + position: absolute; + margin: 0 -10px 0 0; + width: calc(100% + 20px); + } + + .demo-runner .right #demo-error { + margin: -10px 0 15px -10px; + width: calc(100% + 30px); + } +} +