Difference between revisions of "Ccil-ui-js"

From CCIL
Jump to: navigation, search
m (The CCIL obect)
m (The CCIL obect)
Line 13: Line 13:
 
===== The CCIL obect =====
 
===== The CCIL obect =====
  
This object is the root of all ''CCIL''-related functionalities. The different scripts attach various objects to it.
+
This object is the root of all ''CCIL''-related functionalities. The different scripts attach various objects to it:
 +
 
 +
<pre>
 +
CCIL.utils = new Object();
 +
 
 +
CCIL.utils.isFunction = function(functionToCheck) {
 +
var getType = {};
 +
return functionToCheck
 +
&& getType.toString.call(functionToCheck) === '[object Function]';
 +
}
 +
</pre>
 +
 
 +
The above sample is part of the ''ccil/js/ccil.js'' file.
  
 
===== CCIL.config =====
 
===== CCIL.config =====

Revision as of 09:42, 2 July 2016

Scripts

Location: /ui/js

The ccil-ui-js component brings the /ccil/js/ccil.js and /ccil/js/ccil-config.js scripts.

ccil.js

This is the root JavaScript file. It should be included prior all others.

Objects

The CCIL obect

This object is the root of all CCIL-related functionalities. The different scripts attach various objects to it:

CCIL.utils = new Object();

CCIL.utils.isFunction = function(functionToCheck) {
	var getType = {};
	return functionToCheck
			&& getType.toString.call(functionToCheck) === '[object Function]';
}

The above sample is part of the ccil/js/ccil.js file.

CCIL.config

TBA

CCIL.app

TBA

CCIL.log

TBA

CCIL.utils

TBA

Prototypes

String.endsWith

TBA

String.replaceAll

TBA

ccil-config.js

The ccil-config.js file defines default values for some of the fields of the CCIL.config object. It is intended to be easily replaced (updated) by the build process.

Objects

CCIL.config
/**
 * CCIL client setup. This file should be modified in the various distributions.
 */

CCIL.config = new Object();
CCIL.config.responseTime = 3000;
CCIL.config.inode = "services_0";
CCIL.config.srvacc = "services_0";

Maven

The CCIL UI artifacts are located in the /ccil/logo in the final distribution WAR file.

In order include it, you need a reference to the Maven project:

<dependency>
	<groupId>net.ccil</groupId>
	<artifactId>ccil-ui-js</artifactId>
	<version>3.2.4-SNAPSHOT</version>
	<scope>runtime</scope>
	<type>war</type>
</dependency>

Then, in the plugins section:

<plugin>
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-war-plugin</artifactId>
	<configuration>
		<overlays>
			<overlay>
				<groupId>net.ccil</groupId>
				<artifactId>ccil-ui-js</artifactId>
				<type>war</type>
       				<targetPath>/</targetPath>
			</overlay>
		</overlays>
	</configuration>
</plugin>