| 1 |
// $Id: $ |
// $Id: chipin.js,v 1.2 2006/08/28 20:19:33 robroy Exp $ |
| 2 |
|
|
| 3 |
/** |
/** |
| 4 |
* Browser detection script originally created |
* Browser detection script originally created |
| 5 |
* by Peter Paul Koch at http://www.quirksmode.org/ |
* by Peter Paul Koch at http://www.quirksmode.org/ |
| 6 |
*/ |
*/ |
| 7 |
function getBrowserInfo() |
function getBrowserInfo() |
| 43 |
|
|
| 44 |
|
|
| 45 |
function addEvent(obj, evType, fn) |
function addEvent(obj, evType, fn) |
| 46 |
{ |
{ |
| 47 |
if (obj.addEventListener) { |
if (obj.addEventListener) { |
| 48 |
obj.addEventListener(evType, fn, true); |
obj.addEventListener(evType, fn, true); |
| 49 |
return true; |
return true; |
| 50 |
} else if (obj.attachEvent) { |
} else if (obj.attachEvent) { |
| 51 |
var r = obj.attachEvent("on" + evType, fn); |
var r = obj.attachEvent("on" + evType, fn); |
| 52 |
return r; |
return r; |
| 173 |
return false; |
return false; |
| 174 |
} |
} |
| 175 |
|
|
| 176 |
|
function isValidEventID(testeventid) |
| 177 |
|
{ |
| 178 |
|
validID = false; |
| 179 |
|
if (testeventid && testeventid.length >= 16) { |
| 180 |
|
matches = testeventid.match(/([a-zA-Z0-9]{16})/g); |
| 181 |
|
if (matches) |
| 182 |
|
validID = true; |
| 183 |
|
} |
| 184 |
|
return validID; |
| 185 |
|
} |
| 186 |
|
|
| 187 |
function setWidgetLayout(num) |
function setWidgetLayout(num) |
| 188 |
{ |
{ |
| 189 |
if (num == 1) { |
if (num == 1) { |
| 441 |
|
|
| 442 |
function insertWidgetCode() |
function insertWidgetCode() |
| 443 |
{ |
{ |
| 444 |
if (window.opener) { |
var formObj = document.forms[0]; |
| 445 |
|
var eventID = formObj['edit-event_id'].value; |
| 446 |
|
if (!isValidEventID(eventID)) { |
| 447 |
|
alert('Please enter a valid ChipIn event ID.'); |
| 448 |
|
return false; |
| 449 |
|
} else if (window.opener) { |
| 450 |
// Get variables from the fields on the properties frame |
// Get variables from the fields on the properties frame |
|
var formObj = document.forms[0]; |
|
| 451 |
var content = formObj['edit-widgettag'].value; |
var content = formObj['edit-widgettag'].value; |
| 452 |
insertToEditor(content); |
insertToEditor(content); |
| 453 |
return false; |
return false; |