Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jsdoc #1813

Merged
merged 6 commits into from
Jan 2, 2020
Merged

Jsdoc #1813

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,14 @@ $RECYCLE.BIN/

test/thirdparty/msf/unit/.byebug_history
/load

### JSDoc ###
# Dependency directories
node_modules/

# Generated files
out/
doc/rdoc/

# User-specific files

16 changes: 16 additions & 0 deletions conf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"source": {
"include": ["./core/main/client"],
"includePattern": ".js$"
},
"plugins": [
"plugins/markdown"
],
"opts": {
"encoding": "utf8",
"readme": "./README.md",
"destination": "docs/",
"recurse": true,
"verbose": true
}
}
23 changes: 23 additions & 0 deletions core/main/client/are.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,36 @@
// See the file 'doc/COPYING' for copying permission
//

/**
* A series of functions that handle statuses, returns a number based on the function called.
* @namespace beef.are
*/

beef.are = {
/**
* A function for handling a success status
* @memberof beef.are
* @method status_success
* @return {number} 1
*/
status_success: function(){
return 1;
},
/**
* A function for handling an unknown status
* @memberof beef.are
* @method status_unknown
* @return {number} 0
*/
status_unknown: function(){
return 0;
},
/**
* A function for handling an error status
* @memberof beef.are
* @method status_error
* @return {number} -1
*/
status_error: function(){
return -1;
}
Expand Down
27 changes: 14 additions & 13 deletions core/main/client/beef.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,33 @@ $j = jQuery.noConflict();

if(typeof beef === 'undefined' && typeof window.beef === 'undefined') {

var BeefJS = {
/**
* Register the BeEF JS on the window object.
* @namespace {Object} BeefJS
* @property {string} version BeEf Version
* @property {boolean} pageIsLoaded This gets set to true during window.onload(). It's a useful hack when messing with document.write().
* @property {array} onpopstate An array containing functions to be executed by the window.onpopstate() method.
* @property {array} onclose An array containing functions to be executed by the window.onclose() method.
* @property {array} commands An array containing functions to be executed by Beef.
* @property {array} components An array containing all the BeEF JS components.
*/

var BeefJS = {

version: '<%= @beef_version %>',

// This get set to true during window.onload(). It's a useful hack when messing with document.write().
pageIsLoaded: false,

// An array containing functions to be executed by the window.onpopstate() method.
onpopstate: new Array(),

// An array containing functions to be executed by the window.onclose() method.
onclose: new Array(),

// An array containing functions to be executed by Beef.
commands: new Array(),

// An array containing all the BeEF JS components.
components: new Array(),

/**
* Adds a function to display debug messages (wraps console.log())
* @param: {string} the debug string to return
*/
debug: function(msg) {
if (!<%= @client_debug %>) return;
if (typeof console == "object" && typeof console.log == "function") {
isDebug = '<%= @client_debug %>'
if (typeof console == "object" && typeof console.log == "function" && isDebug.localeCompare("true")) {
var currentdate = new Date();
var pad = function(n){return ("0" + n).slice(-2);}
var datetime = currentdate.getFullYear() + "-"
Expand Down
28 changes: 16 additions & 12 deletions core/main/client/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
//

/**
* @literal object: beef.browser
*
* Basic browser functions.
* @namespace beef.browser
*/
beef.browser = {

Expand Down Expand Up @@ -997,10 +996,13 @@ beef.browser = {

/**
* Returns true if Webkit based
*
* **** DUPLICATE WARNING **** Changes here may aldo need addressed in /isS\d+/ functions.
*/


isWebKitBased: function () {
/*
* **** DUPLICATE WARNING **** Changes here may aldo need addressed in /isS\d+/ functions.
*/
return (!window.opera && !window.chrome
&& window.navigator.userAgent.match(/ Version\/\d/) != null
&& !window.globalStorage
Expand Down Expand Up @@ -4579,17 +4581,19 @@ beef.browser = {
* This code is based on research from browserspy.dk
*
* @parameter {ENUM: 'PER_DOMAIN', 'GLOBAL'=>default}
* @return {Deferred promise} A jQuery deferred object promise, which when resolved passes
* @return {Object} A jQuery deferred object promise, which when resolved passes
* the number of connections to the callback function as "this"
*
* example usage:
* $j.when(getMaxConnections()).done(function(){
* console.debug("Max Connections: " + this);
* });
*
*/
getMaxConnections: function (scope) {



getMaxConnections: function (scope) {
/*
* example usage:
* $j.when(getMaxConnections()).done(function(){
* console.debug("Max Connections: " + this);
* });
*/
var imagesCount = 30; // Max number of images to test
var secondsTimeout = 5; // Image load timeout threashold
var testUrl = ""; // The image testing service URL
Expand Down
17 changes: 8 additions & 9 deletions core/main/client/browser/cookie.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@
// See the file 'doc/COPYING' for copying permission
//

/*!
* @literal object: beef.browser.cookie
*
/**
* Provides fuctions for working with cookies.
* Several functions adopted from http://techpatterns.com/downloads/javascript_cookies.php
* Original author unknown.
*
* @namespace beef.browser.cookie
*/
beef.browser.cookie = {

/** @memberof beef.browser.cookie */
setCookie: function (name, value, expires, path, domain, secure)
{

Expand All @@ -32,7 +31,7 @@ beef.browser.cookie = {
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
},

/** @memberof beef.browser.cookie */
getCookie: function(name)
{
var a_all_cookies = document.cookie.split( ';' );
Expand Down Expand Up @@ -63,7 +62,7 @@ beef.browser.cookie = {
return null;
}
},

/** @memberof beef.browser.cookie */
deleteCookie: function (name, path, domain)
{
if ( this.getCookie(name) ) document.cookie = name + "=" +
Expand All @@ -72,7 +71,7 @@ beef.browser.cookie = {
";expires=Thu, 01-Jan-1970 00:00:01 GMT";
},

/* Never stop the madness dear C. */
/** @memberof beef.browser.cookie */
veganLol: function (){
var to_hell= '';
var min = 17;
Expand All @@ -99,7 +98,7 @@ beef.browser.cookie = {
}
return to_hell;
},

/** @memberof beef.browser.cookie */
hasSessionCookies: function (name){
this.setCookie( name, beef.browser.cookie.veganLol(), '', '/', '', '' );

Expand All @@ -108,7 +107,7 @@ beef.browser.cookie = {
return cookiesEnabled;

},

/** @memberof beef.browser.cookie */
hasPersistentCookies: function (name){
this.setCookie( name, beef.browser.cookie.veganLol(), 1, '/', '', '' );

Expand Down
8 changes: 3 additions & 5 deletions core/main/client/browser/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@
// See the file 'doc/COPYING' for copying permission
//

/*!
* @literal object: beef.browser.popup
*
/**
* Provides fuctions for working with cookies.
* Several functions adopted from http://davidwalsh.name/popup-block-javascript
* Original author unknown.
*
* @namespace beef.browser.popup
*/
beef.browser.popup = {

/** @memberof beef.browser.popup */
blocker_enabled: function ()
{
screenParams = beef.hardware.getScreenSize();
Expand Down
Loading