Commit d7511b41 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Cleanup unwanted git tracked files: Documentation-develop/jsdoc|...

parent ab954387
Pipeline #2048 passed with stages
in 2 minutes and 33 seconds
......@@ -41,8 +41,8 @@ test.php
/Documentation-develop/jsdoc
/Documentation-develop/phpdoc
/Documentation-develop/plantuml
/extension/vendor
/extension/vendor
/extension/Resources/Public/Css
/extension/Resources/Public/fonts
/extension/Resources/Public/JavaScript
......
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Source: Alert.js</title>
<script src="scripts/prettify/prettify.js"></script>
<script src="scripts/prettify/lang-css.js"></script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Source: Alert.js</h1>
<section>
<article>
<pre class="prettyprint source linenums"><code>/**
* @author Rafael Ostertag &lt;rafael.ostertag@math.uzh.ch>
*/
/* global $ */
/* global EventEmitter */
/* @depend QfqEvents.js */
/**
* Qfq Namespace
*
* @namespace QfqNS
*/
var QfqNS = QfqNS || {};
(function (n) {
'use strict';
/**
* Display a message.
*
* Display one message on a page. Several instances can be used per page, which results in messages being
* stacked, with the latest message being at the bottom.
*
* The first instance displaying a message will append an `alert container` to the body. The last message
being
* dismissed will remove the `alert container`. A typical call sequence might look like:
*
* var alert = new QfqNS.Alert({
* message: "Text being displayed",
* type: "info"
* });
* alert.show();
*
* Messages may have different background colors (severity levels), controlled by the `type` property.
Possible
* values are
*
* * `"info"`
* * `"warning"`
* * `"error"`
*
* The values are translated into Bootstrap `alert-*` classes internally.
*
* If no buttons are configured, a click anywhere on the alert will close it.
*
* Buttons are configured by passing an array of objects in the `buttons` property. The properties of the
object
* are as follows
*
* {
* label: &lt;button label>,
* focus: true | false,
* eventName: &lt;eventname>
* }
*
* You can connect to the button events by using
*
* var alert = new QfqNS.Alert({
* message: "Text being displayed",
* type: "info",
* buttons: [
* { label: "OK", eventName: "ok" }
* ]
* });
* alert.on('alert.ok', function(...) { ... });
*
* Events are named according to `alert.&lt;eventname>`.
*
* If the property `modal` is set to `true`, a kind-of modal alert will be displayed, preventing clicks
* anywhere but the alert.
*
* For compatibility reasons, the old constructor signature is still supported but deprecated
*
* var alert = new QfqNS.Alert(message, type, buttons)
*
* @param {object} options option object having following properties
* @param {string} options.message message to be displayed
* @param {string} [options.type] type of message, can be `"info"`, `"warning"`, or `"error"`. Default is
`"info"`.
* @param {boolean} [options.modal] whether or not alert is modal, i.e. prevent clicks anywhere but the
dialog.
* Default is `false`.
* @param {object[]} options.buttons what buttons to display on alert. If empty array is provided, no
buttons are
* displayed and a click anywhere in the alert will dismiss it.
* @param {string} options.buttons.label label of the button
* @param {string} options.buttons.eventName name of the event when button is clicked.
* @param {boolean} [options.buttons.focus] whether or not button has focus by default. Default is
`false`.
*
* @constructor
*/
n.Alert = function (options) {
// Emulate old behavior of method signature
// function(message, messageType, buttons)
if (typeof options === "string") {
this.message = arguments[0];
this.messageType = arguments[1] || "info";
this.buttons = arguments[2] || [];
this.modal = false;
// this.timeout &lt; 1 means forever
this.timeout = 0;
} else {
// new style
this.message = options.message || "MESSAGE";
this.messageType = options.type || "info";
this.buttons = options.buttons || [];
this.modal = options.modal || false;
this.timeout = options.timeout || 0;
}
this.$alertDiv = null;
this.$modalDiv = null;
this.shown = false;
this.fadeInDuration = 400;
this.fadeOutDuration = 400;
this.timerId = null;
this.eventEmitter = new EventEmitter();
};
n.Alert.prototype.on = n.EventEmitter.onMixin;
/**
*
* @private
*/
n.Alert.prototype.makeAlertContainerSingleton = function () {
var alertContainer = $("#qfqAlertContainer");
if (alertContainer.length === 0) {
// No container so far, create one
alertContainer = $("&lt;div>").attr("id", "qfqAlertContainer");
$("body").append(alertContainer);
}
return alertContainer;
};
/**
*
* @returns {number|jQuery}
* @private
*/
n.Alert.prototype.countAlertsInAlertContainer = function () {
return $("#qfqAlertContainer > div").length;
};
/**
* @private
*/
n.Alert.prototype.removeAlertContainer = function () {
$("#qfqAlertContainer").remove();
};
/**
* @private
*/
n.Alert.prototype.getAlertClassBasedOnMessageType = function () {
switch (this.messageType) {
case "warning":
return "alert-warning";
case "error":
return "alert-danger";
/* jshint -W086 */
default:
n.Log.warning("Message type '" + this.messageType + "' unknown. Use default type.");
case "info":
return "alert-success";
/* jshint +W086 */
}
};
/**
* @private
*/
n.Alert.prototype.getButtons = function () {
var $buttons = null;
var numberOfButtons = this.buttons.length;
var index;
var buttonConfiguration;
for (index = 0; index &lt; numberOfButtons; index++) {
buttonConfiguration = this.buttons[index];
if (!$buttons) {
$buttons = $("&lt;div>").addClass("alert-buttons");
}
var focus = buttonConfiguration.focus ? buttonConfiguration.focus : false;
$buttons.append($("&lt;button>").append(buttonConfiguration.label)
.attr('type', 'button')
.addClass("btn btn-default" + (focus ? " wants-focus" : ""))
.click(buttonConfiguration, this.buttonHandler.bind(this)));
}
return $buttons;
};
n.Alert.prototype.show = function () {
if (this.shown) {
// We only allow showing once
return;
}
var $alertContainer = this.makeAlertContainerSingleton();
if (this.modal) {
this.$modalDiv = $("&lt;div>");
this.$modalDiv.css('width', Math.max(document.documentElement.clientWidth, window.innerWidth || 0));
this.$modalDiv.css('height', Math.max(document.documentElement.clientHeight, window.innerHeight || 0));
}
this.$alertDiv = $("&lt;div>")
.hide()
.addClass("alert")
.addClass(this.getAlertClassBasedOnMessageType())
.attr("role", "alert")
.append(this.message);
var buttons = this.getButtons();
if (buttons) {
// Buttons will take care of removing the message
this.$alertDiv.append(buttons);
} else {
// Click on the message anywhere will remove the message
this.$alertDiv.click(this.removeAlert.bind(this));
}
if (this.modal) {
this.$modalDiv.append(this.$alertDiv);
$alertContainer.append(this.$modalDiv);
} else {
$alertContainer.append(this.$alertDiv);
}
this.$alertDiv.slideDown(this.fadeInDuration, this.afterFadeIn.bind(this));
this.$alertDiv.find(".wants-focus").focus();
this.shown = true;
};
/**
* @private
*/
n.Alert.prototype.afterFadeIn = function () {
if (this.timeout > 0) {
this.timerId = window.setTimeout(this.removeAlert.bind(this), this.timeout);
}
};
/**
*
*
* @private
*/
n.Alert.prototype.removeAlert = function () {
// In case we have an armed timer (or expired timer, for that matter), disarm it.
if (this.timerId) {
window.clearTimeout(this.timerId);
this.timerId = null;
}
var that = this;
this.$alertDiv.slideUp(this.fadeOutDuration, function () {
that.$alertDiv.remove();
that.$alertDiv = null;
if (that.modal) {
that.$modalDiv.remove();
that.$modalDiv = null;
}
that.shown = false;
// TODO: removeAlert should not have knowledge on how to handle alert container
if (that.countAlertsInAlertContainer() === 0) {
that.removeAlertContainer();
}
});
};
/**
*
* @param handler
*
* @private
*/
n.Alert.prototype.buttonHandler = function (event) {
this.removeAlert();
this.eventEmitter.emitEvent('alert.' + event.data.eventName, n.EventEmitter.makePayload(this, null));
};
n.Alert.prototype.isShown = function () {
return this.shown;
};
})(QfqNS);</code></pre>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2>
<h3>Classes</h3>
<ul>
<li><a href="n.Alert.html">Alert</a></li>
<li><a href="QfqNS.BSTabs.html">BSTabs</a></li>
<li><a href="QfqNS.Element.Checkbox.html">Checkbox</a></li>
<li><a href="QfqNS.Element.FormGroup.html">FormGroup</a></li>
<li><a href="QfqNS.Element.Radio.html">Radio</a></li>
<li><a href="QfqNS.Element.Select.html">Select</a></li>
<li><a href="QfqNS.Element.Textual.html">Textual</a></li>
<li><a href="QfqNS.FileDelete.html">FileDelete</a></li>
<li><a href="QfqNS.FileUpload.html">FileUpload</a></li>
<li><a href="QfqNS.Form.html">Form</a></li>
<li><a href="QfqNS.PageState.html">PageState</a></li>
<li><a href="QfqNS.QfqForm.html">QfqForm</a></li>
<li><a href="QfqNS.QfqPage.html">QfqPage</a></li>
<li><a href="QfqNS.QfqRecordList.html">QfqRecordList</a></li>
</ul>
<h3>Namespaces</h3>
<ul>
<li><a href="global.html#QfqNS">QfqNS</a></li>
<li><a href="QfqNS.Element.html">Element</a></li>
<li><a href="QfqNS.Helper.html">Helper</a></li>
</ul>
<h3><a href="global.html">Global</a></h3>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Mon May 23 2016 12:28:24
GMT+0200 (CEST)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"></script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Source: BSTabs.js</title>
<script src="scripts/prettify/prettify.js"></script>
<script src="scripts/prettify/lang-css.js"></script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Source: BSTabs.js</h1>
<section>
<article>
<pre class="prettyprint source linenums"><code>/**
* @author Rafael Ostertag &lt;rafael.ostertag@math.uzh.ch>
*/
/* global $ */
/* global console */
/* global EventEmitter */
/* @depend QfqEvents.js */
/**
* Qfq Namespace
*
* @namespace QfqNS
*/
var QfqNS = QfqNS || {};
(function (n) {
'use strict';
/**
* Tab Constructor.
*
* Programatically access Bootstrap nav-tabs.
*
* @param {string} tabId HTML id of the element having `nav` and `nav-tabs` classes
* @constructor
*
* @name QfqNS.BSTabs
*/
n.BSTabs = function (tabId) {
this.tabId = tabId;
this._tabContainerLinkSelector = '#' + this.tabId + ' a[data-toggle="tab"]';
this._tabActiveSelector = '#' + this.tabId + ' .active a[data-toggle="tab"]';
this.tabs = {};
this.currentTab = this.getActiveTabFromDOM();
this.eventEmitter = new EventEmitter();
// Fill this.tabs
this.fillTabInformation();
// Enable update of current tab field
this.installTabHandlers();
};
n.BSTabs.prototype.on = n.EventEmitter.onMixin;
/**
* Get active tab from DOM.
*
* Used upon object creation to fill the currentTab. It gets the ID of the currently shown tab. It does
it, by
* targeting the element in the navigator having the `active` class set.
*
* @private
*/
n.BSTabs.prototype.getActiveTabFromDOM = function () {
var activeTabAnchors = $(this._tabActiveSelector);
if (activeTabAnchors.length &lt; 1) {
// This could be due to the DOM not fully loaded. If that's really the case, then the active tab
// attribute should be set by the show.bs.tab handler
return null;
}
return activeTabAnchors[0].hash.slice(1);
};
/**
* Fill tabs object.
*
* Fill the tabs object using the tab HTML id as attribute name
*
* @private
*/
n.BSTabs.prototype.fillTabInformation = function () {
var tabLinks = $(this._tabContainerLinkSelector);
if ($(tabLinks).length === 0) {
throw new Error("Unable to find a BootStrap container matching: " + this._tabContainerLinkSelector);
}
var that = this;
tabLinks.each(function (index, element) {
if (element.hash !== "") {
var tabId = element.hash.slice(1);
that.tabs[tabId] = {
index: index,
element: element
};
}
}
);
};
/**
* @private
*/
n.BSTabs.prototype.installTabHandlers = function () {
$(this._tabContainerLinkSelector)
.on('show.bs.tab', this.tabShowHandler.bind(this));
};
/**
* Tab Show handler.
*
* Sets this.currentTab to the clicked tab and calls all registered tab click handlers.
*
* @private
* @param event
*/
n.BSTabs.prototype.tabShowHandler = function (event) {
n.Log.debug('Enter: BSTabs.tabShowHandler()');
this.currentTab = event.target.hash.slice(1);
n.Log.debug("BSTabs.tabShowHandler(): invoke user handler(s)");
this.eventEmitter.emitEvent('bootstrap.tab.shown', n.EventEmitter.makePayload(this, null));
n.Log.debug('Exit: BSTabs.tabShowHandler()');
};
/**
* Get all tab IDs.
*
* @returns {Array}
*
* @public
*/
n.BSTabs.prototype.getTabIds = function () {
var tabIds = [];
for (var tabId in this.tabs) {
if (this.tabs.hasOwnProperty(tabId)) {
tabIds.push(tabId);
}
}
return tabIds;
};
/**
*
* @returns {Array}
*
* @public
*/
n.BSTabs.prototype.getTabAnchors = function () {
var tabLinks = [];
for (var tabId in this.tabs) {
if (this.tabs.hasOwnProperty(tabId)) {
tabLinks.push(this.tabs[tabId].element);
}
}
return tabLinks;
};
/**
* Activate a given tab.
*
* @param {string} tabId Id of the tab to activate
*
*/
n.BSTabs.prototype.activateTab = function (tabId) {
if (!this.tabs[tabId]) {
console.error("Unable to find tab with id: " + tabId);
return false;
}
$(this.tabs[tabId].element).tab('show');
return true;
};
n.BSTabs.prototype.getCurrentTab = function () {
return this.currentTab;
};
n.BSTabs.prototype.getTabName = function (tabId) {
if (!this.tabs[tabId]) {
console.error("Unable to find tab with id: " + tabId);
return null;
}
return $(this.tabs[tabId].element).text().trim();
};
n.BSTabs.prototype.getActiveTab = function () {
return this.currentTab;
};
n.BSTabs.prototype.getContainingTabIdForFormControl = function (formControlName) {
var $formControl = $("[name='" + formControlName + "']");
if ($formControl.length === 0) {
n.Log.debug("BSTabs.getContainingTabForFormControl(): unable to find form control with name '" +
formControlName + "'");
return null;
}
var iterator = $formControl[0];
while (iterator !== null) {
if (iterator.hasAttribute('role') &amp;&amp;
iterator.getAttribute('role') === 'tabpanel') {
return iterator.id || null;
}
iterator = iterator.parentElement;
}
return null;
};
})(QfqNS);</code></pre>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2>
<h3>Classes</h3>
<ul>
<li><a href="n.Alert.html">Alert</a></li>
<li><a href="QfqNS.BSTabs.html">BSTabs</a></li>
<li><a href="QfqNS.Element.Checkbox.html">Checkbox</a></li>
<li><a href="QfqNS.Element.FormGroup.html">FormGroup</a></li>
<li><a href="QfqNS.Element.Radio.html">Radio</a></li>
<li><a href="QfqNS.Element.Select.html">Select</a></li>