*/
/**
- * create a new event source
- * @param string src
- * @param object data to be send as GET
+ * Create a new event source
+ * @param {string} src
+ * @param {object} [data] to be send as GET
*/
OC.EventSource=function(src,data){
var dataStr='';
this.close();
}
}.bind(this));
-}
+};
OC.EventSource.fallBackSources=[];
OC.EventSource.iframeCount=0;//number of fallback iframes
OC.EventSource.fallBackCallBack=function(id,type,data){
OC.EventSource.fallBackSources[id].fallBackCallBack(type,data);
-}
+};
OC.EventSource.prototype={
typelessListeners:[],
iframe:null,
this.source.close();
}
}
-}
+};
/**
* Sanitizes a HTML string by replacing all potential dangerous characters with HTML entities
-* @param {string} String to sanitize
+* @param {string} s String to sanitize
* @return {string} Sanitized string
*/
function escapeHTML(s) {
/**
* Generates the absolute url for the given relative url, which can contain parameters.
- * @param {string} URL
+ * @param {string} url
* @param params
* @return {string} Absolute URL for the given relative URL
*/
* Redirect to the target URL, can also be used for downloads.
* @param {string} targetURL URL to redirect to
*/
- redirect: function(targetUrl) {
- window.location = targetUrl;
+ redirect: function(targetURL) {
+ window.location = targetURL;
},
/**
* Load a script for the server and load it. If the script is already loaded,
* the event handeler will be called directly
* @param {string} app the app id to which the script belongs
- * @param {string} script the filename of the script
+ * @param {string} script the filename of the script
* @param ready event handeler to be called when the script is loaded
*/
addScript:function(app,script,ready){
/**
* Loads a CSS file
* @param {string} app the app id to which the css style belongs
- * @param {string} style the filename of the css file
+ * @param {string} style the filename of the css file
*/
addStyle:function(app,style){
var path=OC.filePath(app,'css',style+'.css');
/**
* Returns a human readable filesize
- * @param {number} Size in bytes
+ * @param {number} size Size in bytes
* @return {string}
*/
function humanFileSize(size) {
/**
* Takes an absolute timestamp and return a string with a human-friendly relative date
- * @param {number} A Unix timestamp
+ * @param {number} timestamp A Unix timestamp
*/
function relative_modified_date(timestamp) {
var timediff = Math.round((new Date()).getTime() / 1000) - timestamp;
/**
* Set a variable by name
* @param {string} name
- * @param mixed value
+ * @param {*} value
*/
OC.set=function(name, value) {
var namespaces = name.split(".");
-$(document).on('ajaxSend',function(elm, xhr, s) {
+$(document).on('ajaxSend',function(elm, xhr) {
xhr.setRequestHeader('requesttoken', oc_requesttoken);
-});
-
+});
\ No newline at end of file
});
},
/**
- * @param string type
+ * @param {string} type
+ * @param {string} tag
* @return jQuery.Promise which resolves with an array of ids
*/
getIdsForTag:function(type, tag) {
return defer.promise();
},
/**
- * @param string type
- * @return jQuery.Promise which resolves with an array of ids
+ * @param {string} type
+ * @return {*} jQuery.Promise which resolves with an array of ids
*/
getFavorites:function(type) {
if(!type && !this.type) {
return defer.promise();
},
/**
- * @param string type
- * @return jQuery.Promise which resolves with an array of id/name objects
+ * @param {string} type
+ * @return {*} jQuery.Promise which resolves with an array of id/name objects
*/
getTags:function(type) {
if(!type && !this.type) {
return defer.promise();
},
/**
- * @param int id
- * @param string type
- * @return jQuery.Promise
+ * @param {number} id
+ * @param {string} tag
+ * @param {string} type
+ * @return {*} jQuery.Promise
*/
tagAs:function(id, tag, type) {
if(!type && !this.type) {
return defer.promise();
},
/**
- * @param int id
- * @param string type
- * @return jQuery.Promise
+ * @param {number} id
+ * @param {string} tag
+ * @param {string} type
+ * @return {*} jQuery.Promise
*/
unTag:function(id, tag, type) {
if(!type && !this.type) {
return defer.promise();
},
/**
- * @param int id
- * @param string type
- * @return jQuery.Promise
+ * @param {number} id
+ * @param {string} type
+ * @return {*} jQuery.Promise
*/
addToFavorites:function(id, type) {
if(!type && !this.type) {
return defer.promise();
},
/**
- * @param int id
- * @param string type
- * @return jQuery.Promise
+ * @param {number} id
+ * @param {string} type
+ * @return {*} jQuery.Promise
*/
removeFromFavorites:function(id, type) {
if(!type && !this.type) {
return defer.promise();
},
/**
- * @param string tag
- * @param string type
- * @return jQuery.Promise which resolves with an object with the name and the new id
+ * @param {string} tag
+ * @param {string} type
+ * @return {*} jQuery.Promise which resolves with an object with the name and the new id
*/
addTag:function(tag, type) {
if(!type && !this.type) {
return defer.promise();
},
/**
- * @param array tags
- * @param string type
- * @return jQuery.Promise
+ * @param {array} tags
+ * @param {string} type
+ * @return {*} jQuery.Promise
*/
deleteTags:function(tags, type) {
if(!type && !this.type) {