Sample Code of API’s Controls in Written Javascript

1847 words (7 pages) Essay

12th Mar 2018 Computer Science Reference this

Tags:

Disclaimer: This work has been submitted by a university student. This is not an example of the work produced by our Essay Writing Service. You can view samples of our professional work here.

Any opinions, findings, conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of UKEssays.com.

"use strict"

//function to load Facebook JavaScript.

var loadFacebookJS = function () {

blockUI();

if (!$("#modalWindowDivControl #FacebookDivision").contents().find(".fb-share-button").attr("data-href")) {

unBlockUI();

(function () {

var e = document.createElement('script');

e.type = 'text/javascript';

e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js#xfbml=1&appId=297301533752770';

e.async = true;

document.getElementById('fb-root').appendChild(e);

} ());

}

else {

setTimeout(loadFacebookJS, 200);

}

}

// freez the screen until the whole page loads

function blockUI(controllerId, message) {

controllerId = controllerId || "ctl00_gridDiv";

message = message || "Processing Please Wait...";

message = "

" + message + "

";

if ($('#blockMessage').length == 0) {

$("#" + controllerId).append($('

').attr('id', 'blockMessage').css('display', 'none').html(message));

} else {

$('#blockMessage').html(message);

var controller = $("#" + controllerId).data();

if (controller != undefined && controller != null && controller["blockUI.isBlocked"] != undefined && controller["blockUI.isBlocked"] != null && controller["blockUI.isBlocked"] == 1)

return;

}

$("#" + controllerId).block({

message: $('#blockMessage'),

css: {

border: 'none',

padding: '15px',

backgroundColor: '#eee',

'-webkit-border-radius': '10px',

'border-radius': '10px',

opacity: .9,

color: '#444',

display: 'inline',

width: '35%'

}

});

}

function unBlockUI(controllerId) {

controllerId = controllerId || "ctl00_gridDiv";

$("#" + controllerId).unblock();

}

LinedIn Js file

"use strict"

// funtion to check and load linkedin JS.

var LoadLinkedinJS = function () {

blockUI();

if (!$("#modalWindowDivControl #LinkedinFrame").contents().find("#LinkedinButton").attr("data-url")) {

unBlockUI();

$.getScript('http://platform.linkedin.com/in.js');

}

else {

setTimeout(LoadLinkedinJS, 200);

}

}

// freez the screen until the whole page loads

function blockUI(controllerId, message) {

controllerId = controllerId || "ctl00_gridDiv";

message = message || "Processing Please Wait...";

message = "

" + message + "

";

if ($('#blockMessage').length == 0) {

$("#" + controllerId).append($('

').attr('id', 'blockMessage').css('display', 'none').html(message));

} else {

$('#blockMessage').html(message);

var controller = $("#" + controllerId).data();

if (controller != undefined && controller != null && controller["blockUI.isBlocked"] != undefined && controller["blockUI.isBlocked"] != null && controller["blockUI.isBlocked"] == 1)

return;

}

$("#" + controllerId).block({

message: $('#blockMessage'),

css: {

border: 'none',

padding: '15px',

backgroundColor: '#eee',

'-webkit-border-radius': '10px',

'border-radius': '10px',

opacity: .9,

color: '#444',

display: 'inline',

width: '35%'

}

});

}

function unBlockUI(controllerId) {

controllerId = controllerId || "ctl00_gridDiv";

$("#" + controllerId).unblock();

}

Job Share Modal window

"use strict"

//This JavaScript is Main script for all Social Networks Connections and Communication.

//Created on 03/04/2014

//Created by Devank Agarwal

var SocialNetworkingJavaScript = function () {

var jobApplicationUrl = "";

//function return the JobApplicationUrl

this.CreateJobApplicationURl = function (JobId) {

jobApplicationUrl = jobURL(JobId);

// Alert to check the shared url.

//alert(jobApplicationUrl);

return jobApplicationUrl;

}

//function that creates dynamic url including tenant,source,user and job id.

function jobURL(JobId) {

var host = location.host;

var URL = "";

// Just a dummy url to make the it run on localhost.

if (host.indexOf('ams.hirepro.in') != -1||host.indexOf("db1.hirepro.in")!=-1) {

URL = getLiveUrl();

}

else {

URL = "http://d.ams.hirepro.in/amserdemo/public/JobApplication/Default.aspx/?";

URL += getTenantUserAndJobIDEncryption();

}

//alert(URL);

return URL;

}

//function to get all the values for queryString.

var escapedURL = function () {

var alias = getTenantAdamInfo().TenantAlias;

var SourceId = getSourceId();

var UserId = readCookie("userId");

var EncrpytedJobId = $("#control_Use_It_For_Setting_Attributes").attr('RecentlyEncryptedJobId');

//alert to check the values

//return ("alias%3D" + alias + "%25userid%3D" + UserId + "%25sourceid%3D" + SourceId + "%25jobid%3D" + JobId);

return ("alias=" + alias + "&userid=" + UserId + "&sourceid=" + SourceId + "&jobid=" + EncrpytedJobId);

}

// function to fect virtual path of that hosting dynamically.

var fetchVirtualDirectoryName = function () {

var arrayOfPathName = location.pathname.split("/");

return arrayOfPathName[1];

}

// function to get encrypted source id from the hidden field.

var getSourceId = function () {

return $("#" + GetClientId("hfEncryptedSourceId")).val();

}

// function to escape the url but presently not used.

var getTenantUserAndJobIDEncryption = function () {

var URL = escapedURL();

//return escape(URL);

return URL;

}

// function to get the live url dynamically.

var getLiveUrl = function () {

var protocol = location.protocol;

var hostName = location.hostname;

var host = location.host;

var liveURL = "";

liveURL += protocol + "//" + host + "/";

liveURL += (host.indexOf(':') == -1) ? fetchVirtualDirectoryName() : "";

liveURL += "/public/JobApplication/?";

liveURL += getTenantUserAndJobIDEncryption();

return liveURL;

}

}

HTML code for Share job Modal window

<%--

Email

Job opening Url

This is the job opening link:

Social Media<%--

--%><%--

--%>

Email

DirectHi,

I would like to announce a new job opening in our organization. A complete job description

is available on the link provided below. Eligible individuals interested in applying

for this position may submit an application on the link below

Social Media

Cite This Work

To export a reference to this article please select a referencing stye below:

Reference Copied to Clipboard.
Reference Copied to Clipboard.
Reference Copied to Clipboard.
Reference Copied to Clipboard.
Reference Copied to Clipboard.
Reference Copied to Clipboard.
Reference Copied to Clipboard.

Related Services

View all

DMCA / Removal Request

If you are the original writer of this essay and no longer wish to have your work published on the UKDiss.com website then please:

Related Lectures

Study for free with our range of university lectures!