Redirecting to mobile website using opencms - opencms

I have a website developed using OPENCMS. Now we have developed a mobile website. How do i add code or module to opencms so that when user visits from mobile, it will be redirected to mobile website.

Insert at the beginning of one of the pages in the editor.
<?php
function detect_mobile()
{
if(preg_match('/(alcatel|amoi|android|avantgo|blackberry|benq|cell|cricket|docomo|elaine|htc|iemobile|iphone|ipad|ipaq|ipod|j2me|java|midp|mini|mmp|mobi|motorola|nec-|nokia|palm|panasonic|philips|phone|sagem|sharp|sie-|smartphone|sony|symbian|t-mobile|telus|up\.browser|up\.link|vodafone|wap|webos|wireless|xda|xoom|zte)/i', $_SERVER['HTTP_USER_AGENT']))
return true;
else
return false;
}
$mobile = detect_mobile();
if($mobile === true)
header('Location: /mobile');
?>

<script type="text/javascript">
var url=***'http://yourmobilesite.com/***';
var host_name=document.location.hostname;
var request_uri=document.location.pathname;
var no_mobile=location.search;
var cookie=document.cookie;
function detect()
{
var ua=navigator.userAgent.toLowerCase();
var devices=['vnd.wap.xhtml+xml','sony','symbian','nokia','samsung','mobile',
'windows ce','epoc','opera mini','nitro','j2me','midp-','cldc-',
'netfront','mot','up.browser','up.link','audiovox','blackberry',
'ericsson','panasonic','philips','sanyo','sharp','sie-',
'portalmmm','blazer','avantgo','danger','palm','series60',
'palmsource','pocketpc','smartphone','rover','ipaq','au-mic',
'alcatel','ericy','vodafone','wap1','wap2','teleca',
'playstation','lge','lg-','iphone','android','htc','dream',
'webos','bolt','nintendo'];
for (var i in devices)
{
if (ua.indexOf(devices[i]) != -1)
{
return true
}
}
}
if (no_mobile!='?nomobile=1' && cookie.indexOf('no_mobile')==-1)
{
is_mobile=detect();
if (is_mobile)
{
window.location = url
}
}
else
{
if (cookie.indexOf('no_mobile') != -1)
{}
else
{
cookie_expires = new Date();
cookie_expires.setTime(cookie_expires.getTime()+60*60*24);
document.cookie = "no_mobile=1; expires="
+ cookie_expires.toGMTString()
+ "; path=/;"
}
}
</script>

Related

using express node.js, call a function in a function and exports and require in router and hand in to ejs when rendering in router

can a function be recognized inside a function when both would be exported?
this is my code
exports.generateUrlWithParam = function(idpUrl,subUrl,param){
var url = generateUrl(idpUrl, subUrl);
if(url == null) {
return null;
}
var paramStr = generateParam(param);
return url + "?" + paramStr;
}
and this function is to be used inside generateUrlWithParam
exports.generateUrl = function(idpUrl, subUrl) {
if((idpUrl == null || ""==idpUrl.trim()) && (subUrl == null || ""==subUrl.trim())) {
return null;
}
let url = idpUrl
if(!idpUrl.endsWith("/")) {
url += "/";
}
url += subUrl;
url = url.replace(/\/+/g, "/");
if(url.startsWith("http:/") && !url.startsWith("http://")) {
url = url.replace(/^http:\//, "http://");
} else if(url.startsWith("https:/") && !url.startsWith("https://")) {
url = url.replace(/^https:\//, "https://");
}
return url;
}
and they will be used in ejs file.
apparently generateUrl is not recognized
i'm using this js file by 'require' in my router file and hand to the ejs file
any ideas would be appreciated in advance thank you.
You can refer this function as var url = exports.generateUrl(idpUrl, subUrl);

How can I get female voice by Web Speech API in Google Chrome

In a webpage, I want a female voice to speak my texts. I tried to do this by following code. But still now male voice is talking. How can I arrange a female voice to talk my texts? Can anybody share me a correct code that works in Google Chrome.
var voices = speechSynthesis.getVoices();
var msg = new SpeechSynthesisUtterance("Hello World!");
msg.default=false;
msg.localservice=true;
msg.lang = "en-GB";
msg.voice = voices[3].name;
speechSynthesis.speak(msg);
The below code worked for me. I hope it works for you.
var msg = new SpeechSynthesisUtterance();
var voices = window.speechSynthesis.getVoices();
msg.voice = voices[3];
msg.text = "Hello World";
speechSynthesis.speak(msg);
On the 1st try it might give out male's voice. But on the 2nd attempt (without refreshing) it will give out the female's voice and try deploying it on a dummy server, there it will work like a charm in the first go.
This happens to me that the voice doesn't change at the first time the page is loaded.
I found a solution that works for me.
getVoices() should be triggered when the document is ready.
So I add at the top of my js like this.
$(document).ready(function() {
var voices = window.speechSynthesis.getVoices();
})
On Chrome, I do something like this:
<html>
<head>
<script>
function speak(language, country, preferredNames, text) {
var resolvePromise;
var promise = new Promise(r => resolvePromise = r);
var voices = window.speechSynthesis.getVoices();
if (voices.length == 0) {
new Promise(r => {
window.speechSynthesis.onvoiceschanged = () => {
window.speechSynthesis.onvoiceschanged = null;
r();
};
})
.then(() => speak(language, country, preferredNames, text))
.then(resolvePromise);
} else {
var msg = new SpeechSynthesisUtterance(text);
voices.sort((a, b) => {
if (language != null) {
var matchA = a.lang.indexOf(language + "-") == 0;
var matchB = b.lang.indexOf(language + "-") == 0;
if (! matchA && ! matchB) return 0;
if (! matchA && matchB) return 1;
if (! matchB && matchA) return -1;
}
if (country != null) {
var matchA = a.lang.indexOf("-" + country) == a.lang.length - ("-" + country).length;
var matchB = b.lang.indexOf("-" + country) == b.lang.length - ("-" + country).length;
if (! matchA && ! matchB) return 0;
if (! matchA && matchB) return 1;
if (! matchB && matchA) return -1;
}
if (preferredNames != null) {
var indexA = voices.length;
var indexB = voices.length;
preferredNames.forEach((e, i) => {
if (indexA == voices.length && a.name.match(e) != null) indexA = i;
if (indexB == voices.length && b.name.match(e) != null) indexB = i;
});
return indexA - indexB;
}
return 0;
});
if (voices.length > 0) msg.voice = voices[0];
if (language != null) {
msg.lang = language;
if (country != null) msg.lang += "-" + country;
}
msg.onend = resolvePromise;
window.speechSynthesis.speak(msg);
// msg.onend not triggered without call to console.log(msg)?
console.log(msg);
}
return promise;
}
speak("en", null, [ /Google US English/, /Samantha/, /Fiona/, /Victoria/, /female/i ], "Hello, world.")
.then(() => speak("en", null, [ /female/i ], "Hello, world."))
.then(() => speak("en", "US", [ /female/i ], "Hello, world."))
.then(() => speak("en", "US", null, "Hello, world."))
.then(() => speak("en", "GB", [ /\Wmale/i ], "Hello, world."));
</script>
</head>
<body>
</body>
</html>
This code worked for me.
var speakObj = new SpeechSynthesisUtterance();
speakObj.text = text;
speakObj.voice = speechSynthesis.getVoices().filter(function(voice) {
return voice.name == "Google UK English Female"
})[0];
window.speechSynthesis.speak(speakObj);
After a long time of troubleshooting, I could figure out the solution.
4 persons already suggested me some solutions. But these did not work for me. But helped me to figure out the solution. Thanks to all of them.
To solve the problem, I did two things.
I had to load voices during onvoiceschanged event as follows:
var voices;
window.speechSynthesis.onvoiceschanged = function() {
voices=window.speechSynthesis.getVoices();
};
I found this tip from this link.
'Google UK English Female' does not work for me. So I used 'Microsoft Zira Desktop - English (United States)' as follows:
speech.voice = voices.filter(function(voice) { return voice.name == 'Microsoft Zira Desktop - English (United States)'; })[0];

node js giving "RangeError: Maximum call stack size exceeded" on VPS machine

I am using Phantom JS to load a third party URL. Then there is an node+express server with "phantom" module, which is returning back the htmls from Phantom JS.
The code works perfect in my mac, but when I try to run it in VPS, node is giving
RangeError: Maximum call stack size exceeded
function scrape(url, func){
var phantom = require('phantom');
phantom.create('--load-images=no', function(ph){
return ph.createPage(function(page){
page.set('settings.loadImages', false) ;
return page.open(url, function(status){
//page.injectJs('http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js', function() {
return page.evaluate((function(){
var scripts = document.getElementsByTagName('script'),
links = document.getElementsByTagName('link'),
images = document.getElementsByTagName('img'),
objects = document.getElementsByTagName('object');
for(i in objects){
if((obj = objects[i]) && obj.data){
if(obj.getAttribute('data') != obj.data){
obj.setAttribute('data', obj.data);
var params = obj.getElementsByTagName('param');
for(var j in params){
if((par = params[j]) && par.value){
console.log(par.name);
if(par.getAttribute('value') != par.value){
par.setAttribute('value', par.value);
}
if(par.name == "allowscriptaccess" ){
par.setAttribute('value', "always");
par.value = "always";
}
}
}
}
}
}
for(i in scripts){
if((script = scripts[i]) && script.src){
if(script.getAttribute('src') != script.src){
script.setAttribute('src', script.src);
}
}
}
for(i in links){
if((link = links[i]) && link.href ){
if(link.getAttribute('href') != link.href){
link.setAttribute('href', link.href);
}
}
}
for(i in images){
if((image = images[i]) && image.src){
if(image.getAttribute('src') != image.src){
image.setAttribute('src', image.src);
}
}
}
var baseTag = document.getElementsByTagName('base');
if(baseTag.length == 0){
var baseTag = '<base id="test" href="'+ document.domain +'" />';
var head = document.getElementsByTagName('head');
head[0].innerHTML = baseTag + head[0].innerHTML;
}
return document.getElementsByTagName('html')[0].outerHTML;
}), function(result){
ph.exit(); (func)(result);
});
//});
});
});
});
}
exports.scrape = scrape;

Opening tabs in Chrome news reader extension

I'm trying to create a simple chrome extension using the following google RSS reader sample,
http://code.google.com/chrome/extensions/samples.html#597015d3bcce3da693b02314afd607bec4f55291
I can add links in the pop-up window that open tabs, but not from the feeds themselves.
Looping through the items in the feed, grabbing title tags and link tags, I want the title to link the the appropriate sites
var entries = doc.getElementsByTagName('item');
var count = Math.min(entries.length, maxFeedItems);
for (var i = 0; i < count; i++) {
item = entries.item(i);
// Grab the title for the feed item.
var itemTitle = item.getElementsByTagName('title')[0];
if (itemTitle) {
itemTitle = itemTitle.textContent;
} else {
itemTitle = "Unknown title";
}
// Grab the link for this feed item
var itemLink = item.getElementsByTagName('link')[0];
if (itemLink) {
itemLink = itemLink.textContent;
} else {
itemLink = "Unknown link";
}
var title = document.createElement("a");
title.className = "item_title";
title.innerText = itemTitle; //display title in iframe
title.addEventListener("click", titleLink); // should open link when clicking on title, but does not.
}
// -------------------------------------------------------------------
// Show |url| in a new tab.
function showUrl(url) {
// Only allow http and https URLs.
if (url.indexOf("http:") != 0 && url.indexOf("https:") != 0) {
return;
}
chrome.tabs.create({url: url});
}
function moreStories(event) {
showUrl(moreStoriesUrl);
}
function titleLink(event) {
showUrl(itemLink);
}
Any thoughts on why this is not working.
If I replace title.addEventListener("click", titleLink); with title.addEventListener("click", moreStories); each title will link to moreStories, I cannot get each title to link to itemLink.
Thanks
Its a bit hard to answer your question without the whole code, but Ill give it a shot ;)
First up, titleLink() isnt going to work because itemLink isnt known. When you create title (the link) you should of attached it to that...say title.href=itemLink then in tiltleLinks you could access that href with showUrl(event.currentTarget.href)
Also did you fix the error in that example?...if not then change frameLoaded to....
function frameLoaded() {
var links = document.getElementsByTagName("A");
for (i = 0; i < links.length; i++) {
var clssName = links[i].className;
if (clssName != "item_title" && clssName != "open_box") {
links[i].addEventListener("click", showStory);
}
}
window.addEventListener("message", messageHandler);
}
If you still have probs could you attach the whole code so I can see what your doing and Ill give you a hand.
Thank you very much for your help.
code title.href=itemLink and code showUrl(event.currentTarget.href) was exactly what I needed.
For completeness, here is the full code,
<script id="iframe_script">
function reportHeight() {
var msg = JSON.stringify({type:"size", size:document.body.offsetHeight});
parent.postMessage(msg, "*");
}
function frameLoaded() {
var links = document.getElementsByTagName("A");
for (i = 0; i < links.length; i++) {
var class = links[i].className;
if (class != "item_title" && class != "open_box") {
links[i].addEventListener("click", showStory);
}
}
window.addEventListener("message", messageHandler);
}
function showStory(event) {
var href = event.currentTarget.href;
parent.postMessage(JSON.stringify({type:"show", url:href}), "*");
event.preventDefault();
}
function messageHandler(event) {
reportHeight();
}
</script>
<script>
// Feed URL.
var feedUrl = 'http://localhost/newsfeed.xml';
// The XMLHttpRequest object that tries to load and parse the feed.
var req;
function main() {
req = new XMLHttpRequest();
req.onload = handleResponse;
req.onerror = handleError;
req.open("GET", feedUrl, true);
req.send(null);
}
// Handles feed parsing errors.
function handleFeedParsingFailed(error) {
var feed = document.getElementById("feed");
feed.className = "error";
feed.innerText = "Error: " + error;
}
// Handles errors during the XMLHttpRequest.
function handleError() {
handleFeedParsingFailed('Failed to fetch RSS feed.');
}
// Handles parsing the feed data we got back from XMLHttpRequest.
function handleResponse() {
var doc = req.responseXML;
if (!doc) {
handleFeedParsingFailed("Not a valid feed.");
return;
}
buildPreview(doc);
}
// The maximum number of feed items to show in the preview.
var maxFeedItems = 10;
// Where the more stories link should navigate to.
var moreStoriesUrl;
function buildPreview(doc) {
// Get the link to the feed source.
var link = doc.getElementsByTagName("link");
var parentTag = link[0].parentNode.tagName;
if (parentTag != "item" && parentTag != "entry") {
moreStoriesUrl = link[0].textContent;
}
// Setup the title image.
var images = doc.getElementsByTagName("image");
var titleImg;
if (images.length != 0) {
var urls = images[0].getElementsByTagName("url");
if (urls.length != 0) {
titleImg = urls[0].textContent;
}
}
var img = document.getElementById("title");
// Listen for mouse and key events
if (titleImg) {
img.src = titleImg;
if (moreStoriesUrl) {
document.getElementById("title_a").addEventListener("click",moreStories);
document.getElementById("title_a").addEventListener("keydown",
function(event) {
if (event.keyCode == 13) {
moreStories(event);
}});
}
} else {
img.style.display = "none";
}
// Construct the iframe's HTML.
var iframe_src = "<!doctype html><html><head><script>" +
document.getElementById("iframe_script").textContent + "<" +
"/script></head><body onload='frameLoaded();' " +
"style='padding:0px;margin:0px;'>";
var feed = document.getElementById("feed");
// Set ARIA role indicating the feed element has a tree structure
feed.setAttribute("role", "tree");
var entries = doc.getElementsByTagName('item');
var count = Math.min(entries.length, maxFeedItems);
for (var i = 0; i < count; i++) {
item = entries.item(i);
// Grab the title for the feed item.
var itemTitle = item.getElementsByTagName('title')[0];
if (itemTitle) {
itemTitle = itemTitle.textContent;
} else {
itemTitle = "Unknown title";
}
// Grab the link for the feed item.
var itemLink = item.getElementsByTagName('link')[0];
if (itemLink) {
itemLink = itemLink.textContent;
} else {
itemLink = "Unknown link";
}
var item = document.createElement("div");
var title = document.createElement("a");
title.innerText = itemTitle; //display title in iframe
title.href=itemLink;
title.addEventListener("click", titleLink);
item.appendChild(title);
feed.appendChild(item);
}
if (moreStoriesUrl) {
var more = document.createElement("a");
more.className = "more";
more.innerText = "***Site Main Page*** \u00BB";
more.tabIndex = 0;
more.addEventListener("click", moreStories);
more.addEventListener("keydown", function(event) {
if (event.keyCode == 13) {
moreStories(event);
}});
feed.appendChild(more);
}
}
// -------------------------------------------------------------------
// Show |url| in a new tab.
function showUrl(url) {
// Only allow http and https URLs.
if (url.indexOf("http:") != 0 && url.indexOf("https:") != 0) {
return;
}
chrome.tabs.create({url: url});
}
// -------------------------------------------------------------------
function moreStories(event) {
showUrl(moreStoriesUrl);
}
function titleLink(event) {
showUrl(event.currentTarget.href);
}
function keyHandlerShowDesc(event) {
// Display content under heading when spacebar or right-arrow pressed
// Hide content when spacebar pressed again or left-arrow pressed
// Move to next heading when down-arrow pressed
// Move to previous heading when up-arrow pressed
if (event.keyCode == 32) {
showDesc(event);
} else if ((this.parentNode.className == "item opened") &&
(event.keyCode == 37)) {
showDesc(event);
} else if ((this.parentNode.className == "item") && (event.keyCode == 39)) {
showDesc(event);
} else if (event.keyCode == 40) {
if (this.parentNode.nextSibling) {
this.parentNode.nextSibling.children[1].focus();
}
} else if (event.keyCode == 38) {
if (this.parentNode.previousSibling) {
this.parentNode.previousSibling.children[1].focus();
}
}
}
function showDesc(event) {
var item = event.currentTarget.parentNode;
var items = document.getElementsByClassName("item");
for (var i = 0; i < items.length; i++) {
var iframe = items[i].getElementsByClassName("item_desc")[0];
if (items[i] == item && items[i].className == "item") {
items[i].className = "item opened";
iframe.contentWindow.postMessage("reportHeight", "*");
// Set the ARIA state indicating the tree item is currently expanded.
items[i].getElementsByClassName("item_title")[0].
setAttribute("aria-expanded", "true");
iframe.tabIndex = 0;
} else {
items[i].className = "item";
iframe.style.height = "0px";
// Set the ARIA state indicating the tree item is currently collapsed.
items[i].getElementsByClassName("item_title")[0].
setAttribute("aria-expanded", "false");
iframe.tabIndex = -1;
}
}
}
function iframeMessageHandler(e) {
// Only listen to messages from one of our own iframes.
var iframes = document.getElementsByTagName("IFRAME");
for (var i = 0; i < iframes.length; i++) {
if (iframes[i].contentWindow == e.source) {
var msg = JSON.parse(e.data);
if (msg) {
if (msg.type == "size") {
iframes[i].style.height = msg.size + "px";
}
else if (msg.type == "show") {
var url = msg.url;
if (url.indexOf("http://localhost/index.html") == 0) {
// If the URL is a redirect URL, strip of the destination and go to
// that directly. This is necessary because the Google news
// redirector blocks use of the redirects in this case.
var index = url.indexOf("&url=");
if (index >= 0) {
url = url.substring(index + 5);
index = url.indexOf("&");
if (index >= 0)
url = url.substring(0, index);
}
}
showUrl(url);
}
}
return;
}
}
}
window.addEventListener("message", iframeMessageHandler);
</script>
Thanks again for the help.
-Mike

How to make a Sharepoint Survey window open on page load

I've been working on looking for an answer to this issue for several days. I've created a survey on a Sharepoint 2010 site, and the person who I made it for wants it to open in a modal window on page load, instead of having to click "Respond to Survey" for this to happen.
I've tried multiple javascript based solutions, and so far I've gotten nothing. Is there any way to do this? And, if there is, is it possible that this solution could be ported to other pages, so that I can make other surveys or other sharepoint pages open in a modal window (on page load) instead of on a separate page?
Use .../yoursite/lists/yoursurvey/NewForm.aspx - It seems the Advanced setting "use open forms in dialog" doesn't work.
I have made this for a policy window. I made the whole thing inside of a content editor webpart which basically in invisible because the code has no appearence and I set the chrome type to none.
The other option is a feature which would replace the masterpage which is also not hard but requires a developement system for VS2010.
For the first method mentioned. You may have to strip the cookie stuff if you want it to load every time.
Create a new Content Editor Web Part with this:
<script type="text/javascript" src="http://code.jquery.com/jquery-1.5.2.min.js"></script>
<script type="text/javascript" src="disclaimer.js"></script>
Then create disclaimer.js:
_spBodyOnLoadFunctionNames.push("initialDisclaimerSetup");
var dialogTitle = "";
var dialogBody = "";
var dialogReturn = "";
var userID = _spUserId;
function initialDisclaimerSetup() {
if(getCookie("DisclaimerShown" + userID) == "Yes") {
return;
} else {
setCookie("DisclaimerShown" + userID, "No", 365);
}
getDisclaimerListItems();
}
function setCookie(cookieName, cookieValue, numExpireDays) {
var expirationDate = new Date();
expirationDate.setDate(expirationDate.getDate() + numExpireDays);
document.cookie = cookieName + "=" + cookieValue + ";" +
"expires=" + ((numExpireDays == null) ? "" : expirationDate.toUTCString());
}
function getCookie(cookieName) {
if(document.cookie.length > 0) {
return document.cookie.split(";")[0].split("=")[1];
} else {
return "";
}
}
function getDisclaimerListItems() {
var listName = "Disclaimer";
var soapEnv = "<?xml version=\"1.0\" encoding=\"utf-8\"?>"
+ "<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
+ "xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" "
+ "xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope\/\">"
+ "<soap:Body>"
+ "<GetListItems xmlns=\"http://schemas.microsoft.com/sharepoint/soap/\">"
+ "<listName>" + listName + "</listName>"
+ "<query><Query><Where><IsNotNull><FieldRef Name=\"Title\" /></IsNotNull></Where></Query></query>"
+ "<ViewFields><ViewFields>"
+ "<FieldRef Name=\"Title\"/><FieldRef Name=\"Disclaimer\"/>"
+ "</ViewFields></ViewFields>"
+ "</GetListItems>"
+ "</soap:Body>"
+ "</soap:Envelope>";
$.ajax({
url: "_vti_bin/Lists.asmx",
type: "POST",
dataType: "xml",
data: soapEnv,
contentType: "text/xml; charset=\"utf-8\"",
complete: processResult
});
}
function processResult(xData, status) {
$(xData.responseXML).find("z\\:row").each(function() {
dialogTitle = $(this).attr("ows_Title");
dialogBody = $(this).attr("ows_Disclaimer");
launchModelessDialog();
if(dialogReturn == 0) {
return false;
} else if(dialogReturn == 1) {
} else if(dialogReturn == 2) {
return false;
}
});
if(dialogReturn == 0) {
getDisclaimerListItems();
} else if(dialogReturn == 1) {
setCookie("DisclaimerShown" + userID, "Yes", 365);
} else if(dialogReturn == 2) {
window.close();
}
}
function GetRootUrl() {
var urlParts = document.location.pathname.split("/");
urlParts[urlParts.length - 1] = "";
return "https://" + document.location.hostname + urlParts.join("/");
}
function launchModelessDialog(){
if (window.showModalDialog) {
window.showModalDialog("./disclaimer.htm", window, "dialogWidth:700px;dialogHeight:700px");
} else {
objPopup = window.open("./disclaimer.htm", "popup1", "left=100,top=100,width=800,height=800,location=no,status=yes,scrollbars=yes,resizable=yes, modal=yes");
objPopup.focus();
}
}
Then create disclaimer.htm:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<script type="text/javascript">
function initialRun() {
//var allArgs = dialogArguments;
var dialogTitle = dialogArguments.dialogTitle;
var dialogBody = dialogArguments.dialogBody;
dialogArguments.dialogReturn = "0";
document.getElementById('mainWrapper').innerHTML = "<h1>" + dialogTitle + "</h1>"
+ "<br/>" + dialogBody + "<br/><br/>";
}
function returnYes() {
dialogArguments.dialogReturn = 1;
window.close();
}
function returnNo() {
dialogArguments.dialogReturn = 0;
window.close();
}
function returnClose() {
dialogArguments.dialogReturn = 2;
window.close();
}
</script>
</head>
<body onload="initialRun()">
<div id="mainWrapper">
</div>
<div align="center">
<input name="acceptTOS" type="button" value="I Accept" onClick="returnYes();" />
<input name="acceptTOS" type="button" value="I Do NOT Accept" onClick="returnNo();" />
<input name="acceptTOS" type="button" value="Close" onClick="returnClose();" />
</div>
</body>
</html>
Then create a new Custom List called 'Disclaimer' and add a new column called 'Disclaimer' which allows for free text.

Resources