Post by Eton Bones on May 11, 2008 19:33:58 GMT -5
The following greasemonkey(firefox)/turnabout(internet explorer) script can be used as an alternative to directly editing the code in the headers/footers. It places a link in the admin panel that when clicked takes you to a page where all the editable items in the AViP code is presented in an easy fill-in form format. The code then applies the changes made directly to the headers/footers.
To use the code copy it and paste into a plain text editor (do not use a word processor that automatically corrects spelling and grammar). Save the file as AViP_Admin.user.js then open the file in your browser (Firefox: file>>open, Internet Explorer:Reify[on toolbar]>>options>>Install feature)
To use the code copy it and paste into a plain text editor (do not use a word processor that automatically corrects spelling and grammar). Save the file as AViP_Admin.user.js then open the file in your browser (Firefox: file>>open, Internet Explorer:Reify[on toolbar]>>options>>Install feature)
// ==UserScript==
// @name Proboards AViP Admin
// @author Eton Bones
// @namespace http://support.proboards.com/index.cgi?action=viewprofile&user=horace
// @description Allows editing of Proboards' any video in post (AViP) from the Admin Panel
// @include http://*.proboards*.com/*
// ==/UserScript==
//last updated: 5/14/2008 2:30 PM -5.00
var board="*" //board the code is installed (use * if installed in global)
function editAvip(){
location.assign("/?action=headersfooters2&id="+board+"&NOHEADERS=1&code=avip")
}
if("undefined"==typeof unsafeWindow)unsafeWindow=window
if(unsafeWindow["vidType"] && unsafeWindow["vidType"]["_Globals"])GM_registerMenuCommand('Configure Video Code',editAvip)
if(location.href.match(/\baction=headersfooters2/) && location.href.match(/\bcode=avip/)){
var g="_Globals:\\{[\\w\\W]+?"
var header= document.getElementsByName('header');
var defaultType = [new RegExp(g+'defaultType\\s*:[\'"](.+?)[\'"]','m')];
var params = [new RegExp(g+'params\\s*:\\{(.+?)\\}','m')];
var maxVidsPerPost = [new RegExp(g+'maxVidsPerPost\\s*:(\\d+)','m')];
var maxVidsPerPage = [new RegExp(g+'maxVidsPerPage\\s*:(\\d+)','m')];
var defaultWidth = [new RegExp(g+'defaultWidth\\s*:[\'"]?(.+?)[\'"]?[,\\n}]','m')];
var defaultHeight = [new RegExp(g+'defaultHeight\\s*:[\'"]?(.+?)[\'"]?[,\\n}]','m')];
var canPost = [new RegExp(g+'canPost\\s*:[\'"](.+?)[\'"]','m')];
var canView = [new RegExp(g+'canView\\s*:[\'"](.+?)[\'"]','m')];
var boards = [new RegExp(g+'boards\\s*:[\'"](.+?)[\'"]','m')];
var autoLink = [new RegExp(g+'autoLink\\s*:[\'"](.+?)[\'"]','m')];
if( header.length && header[0].value.match(/_Globals:/)){
header=header[0];
defaultType[1] = ((header.value.match(defaultType[0]))?RegExp.$1:null);
params[1] = ((header.value.match(params[0]))?RegExp.$1:null)
maxVidsPerPost[1] = ((header.value.match(maxVidsPerPost[0]))?RegExp.$1:null)
maxVidsPerPage[1] = ((header.value.match(maxVidsPerPage[0]))?RegExp.$1:null)
defaultWidth[1] = ((header.value.match(defaultWidth[0]))?RegExp.$1:null)
defaultHeight[1] = ((header.value.match(defaultHeight[0]))?RegExp.$1:null)
canPost[1] = ((header.value.match(canPost[0]))?RegExp.$1:null)
canView[1] = ((header.value.match(canView[0]))?RegExp.$1:null)
boards[1] = ((header.value.match(boards[0]))?RegExp.$1:null)
autoLink[1] = ((header.value.match(autoLink[0]))?RegExp.$1:null)
document.title= document.title.split('- ')[0]+"- Modify Video Settings"
var lnk=document.links
var tcontent=" <table width='650' cellspacing='2' cellpadding='2' border='0'><tbody><tr><td width='160' valign='top'></td><td width='245' valign='top'></td><td width='245' valign='top'></td></tr></tbody></table>"
var vaddons=[]
for(i=0;i<lnk.length;i++){
if(lnk[i].className=="nav"){
lnk=lnk[i];
while(lnk.nextSibling.nodeName!="BR")lnk=lnk.nextSibling;
lnk.data="Video Settings"
lnk=lnk.parentNode.getElementsByTagName('table')[1]; var parentTable=lnk
lnk.rows[0].cells[0].getElementsByTagName('b')[0].innerHTML="Modify Video Settings"
lnk.rows[1].style.display="none"; var o=lnk.rows[1]
lnk=lnk.insertRow(-1)
var td=lnk.insertCell(-1);
td.className="windowbg"; td.bgColor=lnk.previousSibling.cells[0].bgColor
td.innerHTML="<font size='2'><b>Video Fallback Defaults<b></font><hr size='1'>"+tcontent
var tbl=td.getElementsByTagName('table')
//add new table row
tbl[tbl.length-1].firstChild.appendChild(tbl[tbl.length-1].rows[0].cloneNode(-1))
tbl[tbl.length-1].rows[0].cells[0].innerHTML="<font size='-1'>Default Type:</font>"
tbl[tbl.length-1].rows[0].cells[2].innerHTML="<font size='-2'>If no type is given in the UBBC tag then the default type is used. Set this to whatever type you want to be the default.</font>"
var select=document.createElement('select'); select.id="vidTypes"
//get intrinsic types
vtypes=[]
header.value.match( /<script.+?>[\w\W]+?_Globals\s*:([\w\W]+?)<\/script>/im)[0].replace(/[\r\n]+?[\t\s]+?([A-Z]\w+?)\s*:\s*\{/gm, function(m,p1){
vtypes.push(p1)
})
//get addons
vaddons=[]
header.value.replace(/vidType\[['"](\w+)['"]\]\s*=\s*\{\}/g,function(m,p1){
vaddons.push(p1)
})
vtypes=vtypes.concat(vaddons)
for(i=0;i<vtypes.length;i++){
select.options[select.options.length]= new Option(vtypes[i],vtypes[i])
if(defaultType[1] && defaultType[1]==vtypes[i]){select.options[select.options.length-1].setAttribute('selected',true); select.setAttribute('defaultValue',vtypes[i])}
}
select.id="gdefaultType"
tbl[tbl.length-1].rows[0].cells[1].appendChild(select)
//params
tbl[tbl.length-1].rows[1].cells[0].innerHTML="<font size='-1'>Default Parameters:</font>"
tbl[tbl.length-1].rows[1].cells[2].innerHTML="<font size='-2'>This is a list (one per line) of parameters applied to all video types unless overridden in the definition of a particular video type (best to leave this as is unless you know what you're doing)</font>"
tbl[tbl.length-1].rows[1].cells[1].innerHTML="<textarea id='gparams' rows='6' cols='35' wrap='nowrap' >"+params[1].split(',').join('\n').replace(/\n\s/g,"\n")+"</textarea>"
td.innerHTML+="<br><font size='2'><b>Video Resctrictions<b></font><hr size='1'>"+tcontent
tbl[tbl.length-1].firstChild.appendChild(tbl[tbl.length-1].rows[0].cloneNode(-1))
tbl[tbl.length-1].firstChild.appendChild(tbl[tbl.length-1].rows[0].cloneNode(-1))
tbl[tbl.length-1].firstChild.appendChild(tbl[tbl.length-1].rows[0].cloneNode(-1))
tbl[tbl.length-1].firstChild.appendChild(tbl[tbl.length-1].rows[0].cloneNode(-1))
tbl[tbl.length-1].firstChild.appendChild(tbl[tbl.length-1].rows[0].cloneNode(-1))
tbl[tbl.length-1].firstChild.appendChild(tbl[tbl.length-1].rows[0].cloneNode(-1))
tbl[tbl.length-1].firstChild.appendChild(tbl[tbl.length-1].rows[0].cloneNode(-1))
tbl[tbl.length-1].firstChild.appendChild(tbl[tbl.length-1].rows[0].cloneNode(-1))
//maxVidsPerPost
tbl[tbl.length-1].rows[0].cells[0].innerHTML="<font size='-1'>Max Videos per Post:</font>"
tbl[tbl.length-1].rows[0].cells[2].innerHTML="<font size='-2'>This controls the number of videos that can be inserted in a single post. Any videos above this number will be disabled and the user will need to click on it to enable and view it. To have all videos disabled so that user has to click on it set this number to 0.</font>"
tbl[tbl.length-1].rows[0].cells[1].innerHTML="<input id='gmaxVidsPerPost' value='"+((maxVidsPerPost[1])?maxVidsPerPost[1]:"1")+"' defaultValue='" + ((maxVidsPerPost[1])?maxVidsPerPost[1]:"1") + "'/>"
//maxVidsPerPage
tbl[tbl.length-1].rows[1].cells[0].innerHTML="<font size='-1'>Max Videos per Page:</font>"
tbl[tbl.length-1].rows[1].cells[2].innerHTML="<font size='-2'>This controls the number of videos that can be viewed on a single page. Any videos above this number will be disabled and the user will need to click on it to enable and view it. </font>"
tbl[tbl.length-1].rows[1].cells[1].innerHTML="<input id='gmaxVidsPerPage' value='"+((maxVidsPerPage[1])?maxVidsPerPage[1]:"3")+"' defaultValue='" + ((maxVidsPerPage[1])?maxVidsPerPage[1]:"3") + "'/>"
//defaultWidth
tbl[tbl.length-1].rows[2].cells[0].innerHTML="<font size='-1'>Max Video Width:</font>"
tbl[tbl.length-1].rows[2].cells[2].innerHTML="<font size='-2'>This is the maximum width any video that is posted can reach. If the definition of a certain video type specifies a maximum width then that width will be used provided it is less than the defaultWidth. If a user specifies a width in the UBBC tag then that width will be used provided it is less than the defaultWidth and/or the max width of that particular video type. This setting is to prevent page stretching.</font>"
tbl[tbl.length-1].rows[2].cells[1].innerHTML="<input id='gdefaultWidth' value='"+((defaultWidth[1])?defaultWidth[1]:"600")+"' defaultValue='" + ((defaultWidth[1])?defaultWidth[1]:"600") + "'/>"
//defaultHeight
tbl[tbl.length-1].rows[3].cells[0].innerHTML="<font size='-1'>Max Video Height:</font>"
tbl[tbl.length-1].rows[3].cells[2].innerHTML="<font size='-2'>This is the maximum height any video that is posted can reach. If the definition of a certain video type specifies a maximum height then that height will be used provided it is less than the defaultHeight. If a user specifies a height in the UBBC tag then that height will be used provided it is less than the defaultHeight and/or the max height of that particular video type.</font>"
tbl[tbl.length-1].rows[3].cells[1].innerHTML="<input id='gdefaultHeight' value='"+((defaultHeight[1])?defaultHeight[1]:"450")+"' defaultValue='" + ((defaultHeight[1])?defaultHeight[1]:"450") + "'/>"
//canPost
tbl[tbl.length-1].rows[4].cells[0].innerHTML="<font size='-1'>Can Post Videos:</font>"
tbl[tbl.length-1].rows[4].cells[2].innerHTML="<font size='-2'>If this is present and contains a list of comma separated user names then only those listed names can post videos. If a name has a minus sign in front of it (e.g. -Guest) then that name can not post videos.</font>"
tbl[tbl.length-1].rows[4].cells[1].innerHTML="<input id='gcanPost' value='"+((canPost[1])?canPost[1]:"")+"' defaultValue='" + ((canPost[1])?canPost[1]:"") + "'/>"
//canView
tbl[tbl.length-1].rows[5].cells[0].innerHTML="<font size='-1'>Can View Videos:</font>"
tbl[tbl.length-1].rows[5].cells[2].innerHTML="<font size='-2'>If this is present and contains a list of comma separated user names then only those listed names can view videos. If a name has a minus sign in front of it (e.g. -Guest) then that name can not view videos.</font>"
tbl[tbl.length-1].rows[5].cells[1].innerHTML="<input id='gcanView' value='"+((canView[1])?canView[1]:"")+"' defaultValue='" + ((canView[1])?canView[1]:"") + "'/>"
//boards
tbl[tbl.length-1].rows[6].cells[0].innerHTML="<font size='-1'>Video Boards:</font>"
tbl[tbl.length-1].rows[6].cells[2].innerHTML="<font size='-2'>If this is present and contains a list of comma separated board names then only those listed names can contain videos. If a board has a minus sign in front of it (e.g. -general) then that board can not contain videos.</font>"
tbl[tbl.length-1].rows[6].cells[1].innerHTML="<input id='gboards' value='"+((boards[1])?boards[1]:"")+"' defaultValue='" + ((boards[1])?boards[1]:"") + "'/>"
//autoLink
tbl[tbl.length-1].rows[7].cells[0].innerHTML="<font size='-1'>Automatic Links:</font>"
tbl[tbl.length-1].rows[7].cells[2].innerHTML="<font size='-2'>If present this should contain a list of comma separated installed addons that have the ability to convert video hyperlinks into links that will play the video directly inside the post instead of opening a new window or tab.</font>"
tbl[tbl.length-1].rows[7].cells[1].innerHTML="<input id='gautoLink' value='"+((autoLink[1])?autoLink[1]:"")+"' defaultValue='" + ((autoLink[1])?autoLink[1]:"") + "'/>"
if(vaddons.length){
td.innerHTML+="<br><font size='2'><b>Addons (Advanced)<b> </font><hr size='1'>"+tcontent
select=td.getElementsByTagName('font')[td.getElementsByTagName('font').length-1].appendChild(document.createElement('select'))
select.id="addons"
tbl[tbl.length-1].firstChild.appendChild(tbl[tbl.length-1].rows[0].cloneNode(-1))
tbl[tbl.length-1].firstChild.appendChild(tbl[tbl.length-1].rows[0].cloneNode(-1))
tbl[tbl.length-1].firstChild.appendChild(tbl[tbl.length-1].rows[0].cloneNode(-1))
tbl[tbl.length-1].firstChild.appendChild(tbl[tbl.length-1].rows[0].cloneNode(-1))
tbl[tbl.length-1].firstChild.appendChild(tbl[tbl.length-1].rows[0].cloneNode(-1))
tbl[tbl.length-1].firstChild.appendChild(tbl[tbl.length-1].rows[0].cloneNode(-1))
tbl[tbl.length-1].firstChild.appendChild(tbl[tbl.length-1].rows[0].cloneNode(-1))
tbl[tbl.length-1].firstChild.appendChild(tbl[tbl.length-1].rows[0].cloneNode(-1))
tbl[tbl.length-1].firstChild.appendChild(tbl[tbl.length-1].rows[0].cloneNode(-1))
tbl[tbl.length-1].firstChild.appendChild(tbl[tbl.length-1].rows[0].cloneNode(-1))
tbl[tbl.length-1].firstChild.appendChild(tbl[tbl.length-1].rows[0].cloneNode(-1))
//prefix
tbl[tbl.length-1].rows[0].cells[0].innerHTML="<font size='-1'>Direct URL:</font>"
tbl[tbl.length-1].rows[0].cells[2].innerHTML="<font size='-2'>The direct url to fetch the video. The part of the url that uniquely identifies the video should have a placeholder of %video%.</font>"
tbl[tbl.length-1].rows[0].cells[1].innerHTML="<input value='' size='50' id='prefix' delimiter=\"''\" />"
//maxwidth
tbl[tbl.length-1].rows[1].cells[0].innerHTML="<font size='-1'>Max Video Width:</font>"
tbl[tbl.length-1].rows[1].cells[2].innerHTML="<font size='-2'>The maximum width in pixels this video type can attain. This value will be ignored if it exceeds the maximum width defined in video restrictions. </font>"
tbl[tbl.length-1].rows[1].cells[1].innerHTML="<input value='' id='maxwidth' delimiter=\"''\" />"
//maxheight
tbl[tbl.length-1].rows[2].cells[0].innerHTML="<font size='-1'>Max Video Height:</font>"
tbl[tbl.length-1].rows[2].cells[2].innerHTML="<font size='-2'>The maximum height in pixels this video type can attain. This value will be ignored if it exceeds the maximum width defined in video restrictions.</font>"
tbl[tbl.length-1].rows[2].cells[1].innerHTML="<input value='' id='maxheight' delimiter=\"''\" />"
//custom
tbl[tbl.length-1].rows[3].cells[0].innerHTML="<font size='-1'>Skin Customizations:</font>"
tbl[tbl.length-1].rows[3].cells[2].innerHTML="<font size='-2'>Customize colors depending on current skin. If the video player supports a selectable color scheme this is where you would define the colors.</font>"
tbl[tbl.length-1].rows[3].cells[1].innerHTML="<textarea cols='35' rows='6' id='custom' delimiter='{}' ></textarea>"
//preprocess
tbl[tbl.length-1].rows[4].cells[0].innerHTML="<font size='-1'>Preprocess:</font>"
tbl[tbl.length-1].rows[4].cells[2].innerHTML="<font size='-2'>A function used to process data before the embed code is constructed. A common use of this property is to define a function that processes the video identifier entered by the person posting the video to strip away unnecessary data. For instance if a person posts an entire youtube url instead of just the identifier the function would extract just the part it needs. Another use can be seen by examining the Yahoo entry in vidType. Since yahoo requires two numeric identifiers to uniquely identify a video a function is created to process the second identifier.</font>"
tbl[tbl.length-1].rows[4].cells[1].innerHTML="<textarea cols='35' rows='12' id='preprocess' delimiter=' ' ></textarea>"
//postprocess
tbl[tbl.length-1].rows[5].cells[0].innerHTML="<font size='-1'>Postprocess:</font>"
tbl[tbl.length-1].rows[5].cells[2].innerHTML="<font size='-2'>A function used to process data after the embed code has been constructed. The real player type uses this to define a function that creates a second embed since realplayer requires separate embeds for the controls and video display.</font>"
tbl[tbl.length-1].rows[5].cells[1].innerHTML="<textarea cols='35' rows='12' id='postprocess' delimiter=' ' ></textarea>"
//checkid
tbl[tbl.length-1].rows[6].cells[0].innerHTML="<font size='-1'>Input Checker:</font>"
tbl[tbl.length-1].rows[6].cells[2].innerHTML="<font size='-2'>A function that validates the video identifier. If the function returns false then all other processing is abandoned and no embed will be created for that particular video tag.</font>"
tbl[tbl.length-1].rows[6].cells[1].innerHTML="<textarea cols='35' rows='12' id='checkid' delimiter=' ' ></textarea>"
//params
tbl[tbl.length-1].rows[7].cells[0].innerHTML="<font size='-1'>Parameters:</font>"
tbl[tbl.length-1].rows[7].cells[2].innerHTML="<font size='-2'>A list of parameters that will be applied to the video type. If parameters defined in fallback defaults have the same name as a parameter defined here then the parameter here takes precedence.</font>"
tbl[tbl.length-1].rows[7].cells[1].innerHTML="<textarea cols='35' rows='6' id='params' delimiter='{}' ></textarea>"
//description
tbl[tbl.length-1].rows[8].cells[0].innerHTML="<font size='-1'>Alternate Name:</font>"
tbl[tbl.length-1].rows[8].cells[2].innerHTML="<font size='-2'>A short name that will be used instead of the typename in the video selection dropdown.<br>(eg. typename=WMP description=Window Media Player)</font>"
tbl[tbl.length-1].rows[8].cells[1].innerHTML="<input value='' id='description' delimiter=\"''\" />"
//example
tbl[tbl.length-1].rows[9].cells[0].innerHTML="<font size='-1'>Video Example:</font>"
tbl[tbl.length-1].rows[9].cells[2].innerHTML="<font size='-2'>An url showing an example of how to insert a video of this type into a post.</font>"
tbl[tbl.length-1].rows[9].cells[1].innerHTML="<input value='' id='example' size='50' delimiter=\"''\"/>"
//autoLink
tbl[tbl.length-1].rows[10].cells[0].innerHTML="<font size='-1'>Automatic Linking:</font>"
tbl[tbl.length-1].rows[10].cells[2].innerHTML="<font size='-2'>A function that is passed the cell containing the contents of a post so it can search for video links of the type it can handle in that post and convert them to videos that play inside the post. There should be a return value of true or false depending on success or failure. This function will only be called if the typename is listed under vidtype._Globals.autoLink giving the admin control over which links get auto-converted</font>"
tbl[tbl.length-1].rows[10].cells[1].innerHTML="<textarea cols='35' rows='12' id='autolink' delimiter=' '></textarea>"
select.options[0]= new Option('select','')
for(t=0;t<vaddons.length;t++){
select.options[select.options.length]= new Option(vaddons[t],vaddons[t])
}
var addonAttribs={'custom':0,'preprocess':1,'postprocess':2,'checkid':3,'params':4,'description':5,'example':6,'maxwidth':7,'prefix':8,'autolink':9,'maxheight':10}
}
td.innerHTML+="<br/><input type='button' value='Save Settings' id='vidsave'/><br><br>";
function addfunc2(){
//
var thiss=(window["event"])?event.srcElement:this
if(document.getElementById('addons'))addfunc1.call(document.getElementById('addons'))
for(var t in {'defaultType':0,'params':1,'maxVidsPerPost':2,'maxVidsPerPage':3,'defaultWidth':4,'defaultHeight':5,'canPost':6,'canView':7,'boards':8,'autoLink':9}){
try{
var dv = document.getElementById('g'+t).getAttribute('defaultValue')
var v = document.getElementById('g'+t).value
if(t == "params"){
v=v.split('\n').join(',')
dv=params[1].split(',').join('\n').replace(/\n\s/g,"\n")
}
if(document.getElementById('g'+t).value != dv){
dv=eval(t+"[0].toString()")
eval('header.value=header.value.replace('+dv+',function(m,p1){return m.replace(p1,"'+v+'")})')
o.style.display=""
}
}catch(r){alert(r)}
}
for(t=0;t<document.forms.length;t++){
if(document.forms[t].getAttribute('action').match(/headersfooters3/))document.forms[t].submit()
break;
}
}
if(document.attachEvent){
document.getElementById('vidsave').attachEvent('onclick',addfunc2)
}else{
document.getElementById('vidsave').addEventListener('click',addfunc2,false)
}
if(document.getElementById('addons')){
function addfunc(){
var thiss=(window["event"])?event.srcElement:this
if(thiss.selectedIndex>0){
for(t in addonAttribs){
try{
var val=header.value.match(RegExp('vidType\\[[\'"]'+thiss.value+'[\'"]\]\.'+t+'\\s*=\\s*([\\w\\W]+?);?$','m'))[1].replace(/(^['"]|['"][\s;]*$)/g,'')
if(/function\s*\(/.test(val)){
document.getElementById(t).setAttribute('delimiter'," ")
}else if(/^\{/.test(val)){
val=val.replace(/(^\s*\{|}\s*$)/g,'')
document.getElementById(t).setAttribute('delimiter',"{}")
}else{
document.getElementById(t).setAttribute('delimiter',"''")
}
val=val.split(',').join('\n')
document.getElementById(t).value=val;document.getElementById(t).setAttribute('defaultValue',val)
}catch(e){if(document.getElementById(t)){document.getElementById(t).value=''; document.getElementById(t).setAttribute('defaultValue','')}}
}
}else{
for(t in addonAttribs){
if(document.getElementById(t)){document.getElementById(t).value=''; document.getElementById(t).setAttribute('defaultValue','')}
}
}
}
var addonsave=[]
function addfunc1(){
//
var thiss=(window["event"])?event.srcElement:this
for(t in addonAttribs){
try{
if(thiss.selectedIndex>0 && document.getElementById(t).value != document.getElementById(t).getAttribute('defaultValue'))addonsave.push(t)
}catch(e){}
}
if(addonsave.length){
for(t=0;t<addonsave.length;t++){
if(confirm('The '+addonsave[t]+ ' property for '+thiss.value+ ' addon has changed from "'+ document.getElementById(addonsave[t]).getAttribute('defaultValue')+'" to "' + document.getElementById(addonsave[t]).value + '". \nDo you want to apply the change?')){
var p=document.getElementById(addonsave[t])
if(RegExp('vidType\\[[\'"]'+thiss.value+'[\'"]\]\.'+t).test(header.value))
header.value = header.value.replace(RegExp('vidType\\[[\'"]'+thiss.value+'[\'"]\]\.'+t+'\\s*=\\s*([\\w\\W]+?);?$','m'),"vidType['"+thiss.value+"']."+ addonsave[t]+ "="+ p.getAttribute('delimiter').substr(0,1) + ((/^function/i.test(p.value)?p.value:p.value.replace(/\n/g,',')))+ p.getAttribute('delimiter').substr(1,1) +";\n")
else
header.value=header.value.replace(RegExp('((\\t+)?vidType\\[[\'"]'+thiss.value+'[\'"]\\]\\s*=\\s*\\{\\};?)'),"$1\n"+"$2vidType['"+thiss.value+"']."+ addonsave[t]+ "="+ p.getAttribute('delimiter').substr(0,1) + ((/^function/i.test(p.value)?p.value:p.value.replace(/\n/g,',')))+ p.getAttribute('delimiter').substr(1,1) +";\n")
document.getElementById(addonsave[t]).setAttribute('defaultValue',document.getElementById(addonsave[t]).value)
}
}
}
addonsave=[]
}
if(document.attachEvent){
document.getElementById('addons').attachEvent('onchange',addfunc)
document.getElementById('addons').attachEvent('onclick',addfunc1)
}else{
document.getElementById('addons').addEventListener('change',addfunc,false)
document.getElementById('addons').addEventListener('click',addfunc1,false)
}
}
break;
}
}
}
}
//