Commit c7e167db authored by Rafael Ostertag's avatar Rafael Ostertag
Browse files

Added namespace jsdoc. Added stubs jsdocs to objects.

parent 3b517707
......@@ -6,6 +6,11 @@
/* global EventEmitter */
/* @depend QfqEvents.js */
/**
* Qfq Namespace
*
* @namespace QfqNS
*/
var QfqNS = QfqNS || {};
(function (n) {
......
......@@ -8,6 +8,11 @@
/* @depend QfqEvents.js */
/**
* Qfq Namespace
*
* @namespace QfqNS
*/
var QfqNS = QfqNS || {};
......@@ -20,6 +25,8 @@ var QfqNS = QfqNS || {};
*
* @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;
......
......@@ -4,7 +4,17 @@
/* @depend FormGroup.js */
/**
* Qfq Namespace
*
* @namespace QfqNS
*/
var QfqNS = QfqNS || {};
/**
* Qfq.Element Namespace
*
* @namespace QfqNS.Element
*/
QfqNS.Element = QfqNS.Element || {};
(function (n) {
......@@ -15,6 +25,7 @@ QfqNS.Element = QfqNS.Element || {};
*
* @param $element
* @constructor
* @name QfqNS.Element.Checkbox
*/
function Checkbox($element) {
n.FormGroup.call(this, $element);
......
......@@ -2,7 +2,17 @@
* @author Rafael Ostertag <rafael.ostertag@math.uzh.ch>
*/
/**
* Qfq Namespace
*
* @namespace QfqNS
*/
var QfqNS = QfqNS || {};
/**
* Qfq.Element Namespace
*
* @namespace QfqNS.Element
*/
QfqNS.Element = QfqNS.Element || {};
(function (n) {
......@@ -18,6 +28,7 @@ QfqNS.Element = QfqNS.Element || {};
*
*
* @constructor
* @name QfqNS.Element.FormGroup
*/
n.FormGroup = function ($enclosedElement) {
if (!$enclosedElement || $enclosedElement.length === 0) {
......@@ -30,6 +41,13 @@ QfqNS.Element = QfqNS.Element || {};
this.$helpBlock = this.$formGroup.find(".help-block");
};
/**
* Test if the Form Group is of the given type
*
* @param {string} type type name
* @returns {boolean} true if the Form Group is of the given type. False otherwise
* @protected
*/
n.FormGroup.prototype.isType = function (type) {
var lowerCaseType = type.toLowerCase();
var isOfType = true;
......
......@@ -4,12 +4,28 @@
/* global $ */
/**
* Qfq Namespace
*
* @namespace QfqNS
*/
var QfqNS = QfqNS || {};
/**
* Qfq.Element Namespace
*
* @namespace QfqNS.Element
*/
QfqNS.Element = QfqNS.Element || {};
(function (n) {
'use strict';
/**
*
* @param name
* @returns {*}
* @function QfqNS.Element.getElement
*/
n.getElement = function (name) {
var $element = $('[name="' + name + '"]:not([type="hidden"])');
if ($element.length === 0) {
......
......@@ -2,7 +2,17 @@
* @author Rafael Ostertag <rafael.ostertag@math.uzh.ch>
*/
/**
* Qfq Namespace
*
* @namespace QfqNS
*/
var QfqNS = QfqNS || {};
/**
* Qfq.Element Namespace
*
* @namespace QfqNS.Element
*/
QfqNS.Element = QfqNS.Element || {};
(function (n) {
......@@ -13,6 +23,7 @@ QfqNS.Element = QfqNS.Element || {};
*
* @param $element
* @constructor
* @name QfqNS.Element.Radio
*/
function Radio($element) {
n.FormGroup.call(this, $element);
......
......@@ -3,7 +3,17 @@
*/
/* global $ */
/**
* Qfq Namespace
*
* @namespace QfqNS
*/
var QfqNS = QfqNS || {};
/**
* Qfq.Element Namespace
*
* @namespace QfqNS.Element
*/
QfqNS.Element = QfqNS.Element || {};
(function (n) {
......@@ -14,6 +24,7 @@ QfqNS.Element = QfqNS.Element || {};
*
* @param $element
* @constructor
* @name QfqNS.Element.Select
*/
function Select($element) {
n.FormGroup.call(this, $element);
......
......@@ -2,7 +2,17 @@
* @author Rafael Ostertag <rafael.ostertag@math.uzh.ch>
*/
/**
* Qfq Namespace
*
* @namespace QfqNS
*/
var QfqNS = QfqNS || {};
/**
* Qfq.Element Namespace
*
* @namespace QfqNS.Element
*/
QfqNS.Element = QfqNS.Element || {};
(function (n) {
......@@ -13,6 +23,7 @@ QfqNS.Element = QfqNS.Element || {};
*
* @param $element
* @constructor
* @name QfqNS.Element.Textual
*/
function Textual($element) {
n.FormGroup.call(this, $element);
......
......@@ -2,7 +2,17 @@
* @author Rafael Ostertag <rafael.ostertag@math.uzh.ch>
*/
/**
* Qfq Namespace
*
* @namespace QfqNS
*/
var QfqNS = QfqNS || {};
/**
* Qfq.Element Namespace
*
* @namespace QfqNS.Element
*/
QfqNS.Element = QfqNS.Element || {};
(function (n) {
......
......@@ -6,11 +6,24 @@
/* @depend QfqEvents.js */
/**
* Qfq Namespace
*
* @namespace QfqNS
*/
var QfqNS = QfqNS || {};
(function (n) {
'use strict';
/**
*
* @param formSelector
* @param targetUrl
* @constructor
*
* @name QfqNS.FileDelete
*/
n.FileDelete = function (formSelector, targetUrl) {
this.formSelector = formSelector;
this.targetUrl = targetUrl;
......
......@@ -7,12 +7,23 @@
/* @depend QfqEvents.js */
/**
* Qfq Namespace
*
* @namespace QfqNS
*/
var QfqNS = QfqNS || {};
(function (n) {
'use strict';
/**
*
* @param formSelector
* @param targetUrl
* @constructor
* @name QfqNS.FileUpload
*/
n.FileUpload = function (formSelector, targetUrl) {
this.formSelector = formSelector;
this.targetUrl = targetUrl;
......
......@@ -6,11 +6,22 @@
/* global EventEmitter */
/* @depend QfqEvents.js */
/**
* Qfq Namespace
*
* @namespace QfqNS
*/
var QfqNS = QfqNS || {};
(function (n) {
'use strict';
/**
*
* @param formId
* @constructor
* @name QfqNS.Form
*/
n.Form = function (formId) {
this.formId = formId;
this.eventEmitter = new EventEmitter();
......
......@@ -4,18 +4,43 @@
/* global $ */
/**
* Qfq Namespace
*
* @namespace QfqNS
*/
var QfqNS = QfqNS || {};
/**
* Qfq Helper Namespace
*
* @namespace QfqNS.Helper
*/
QfqNS.Helper = QfqNS.Helper || {};
(function (n) {
'use strict';
/**
*
* @param jqHXR
* @param textStatus
* @param errorThrown
*
* @function QfqNS.Helper.showAjaxError
*/
n.showAjaxError = function (jqHXR, textStatus, errorThrown) {
var alert = new QfqNS.Alert("Error:<br> " +
errorThrown, "error");
alert.show();
};
/**
*
* @param string
* @returns {*}
*
* @function QfqNS.Helper.stringBool
*/
n.stringToBool = function (string) {
if (typeof string !== "string") {
return string;
......
......@@ -21,6 +21,11 @@ QfqNS.Helper = QfqNS.Helper || {};
(function (n) {
'use strict';
/**
*
* @function
* @name QfqNS.Helper.jqxComboBox
*/
var jqxComboBox = function () {
var index;
var $containers = $("div.jqw-combobox");
......
......@@ -4,10 +4,22 @@
/* global console */
/**
* Qfq Namespace
*
* @namespace QfqNS
*/
var QfqNS = QfqNS || {};
(function (n) {
'use strict';
/**
*
* @type {{level: number, message: Function, debug: Function, warning: Function, error: Function}}
*
* @name QfqNS.Log
*/
n.Log = {
level: 3,
message: function (msg) {
......
......@@ -5,12 +5,22 @@
/* @depend QfqEvents.js */
/* global EventEmitter */
/**
* Qfq Namespace
*
* @namespace QfqNS
*/
var QfqNS = QfqNS || {};
(function (n) {
'use strict';
/**
*
* @constructor
* @name QfqNS.PageState
*/
n.PageState = function () {
this.pageState = location.hash.slice(1);
this.data = null;
......
......@@ -2,11 +2,22 @@
* @author Rafael Ostertag <rafael.ostertag@math.uzh.ch>
*/
/**
* Qfq Namespace
*
* @namespace QfqNS
*/
var QfqNS = QfqNS || {};
(function (n) {
'use strict';
/**
*
* @type {{set: Function, get: Function, setSubTitle: Function}}
*
* @name QfqNS.PageTitle
*/
n.PageTitle = {
set: function (title) {
document.title = title;
......
......@@ -5,11 +5,21 @@
/* global EventEmitter */
/* global $ */
/**
* Qfq Namespace
*
* @namespace QfqNS
*/
var QfqNS = QfqNS || {};
(function (n) {
'use strict';
/**
*
* @type {{makePayload: Function, onMixin: Function}}
*
*/
n.EventEmitter = {
makePayload: function (target, data, additionalArgs) {
return [$.extend({},
......
......@@ -6,6 +6,11 @@
/* global EventEmitter */
/* @depend QfqEvents.js */
/**
* Qfq Namespace
*
* @namespace QfqNS
*/
var QfqNS = QfqNS || {};
(function (n) {
......@@ -21,6 +26,8 @@ var QfqNS = QfqNS || {};
* @param dataRefreshUrl {string} url where to fetch new element values from
* @param fileUploadTo {string} url used for file uploads
* @constructor
*
* @name QfqNS.QfqForm
*/
n.QfqForm = function (formId, submitTo, deleteUrl, dataRefreshUrl, fileUploadTo, fileDeleteUrl) {
this.formId = formId;
......
......@@ -6,11 +6,23 @@
/* global console */
/* @depend QfqEvents.js */
/**
* Qfq Namespace
*
* @namespace QfqNS
*/
var QfqNS = QfqNS || {};
(function (n) {
'use strict';
/**
*
* @param settings
* @constructor
*
* @name QfqNS.QfqPage
*/
n.QfqPage = function (settings) {
this.settings = $.extend(
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment