Вы находитесь на странице: 1из 5

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.or g/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.

org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>AUSUM DATA HOME</title> <link href="css/style.css" rel="stylesheet" type="text/css" /> <SCRIPT type="text/javascript" src="js/ajax.js"></SCRIPT> <SCRIPT type="text/javascript" src="js/jquery-1.3.2.min.js"></SCRIPT> <script type="text/javascript" src="js/rollovers.js"></script> <script type="text/javascript" src="js/poponload.js"></script> <style> TEXTAREA {width: 100%; height: 100%;} </style> <!---<cfinvoke component="CheckUser" method="updatePageContent" > <cfinvokeargument name="PageName" value="index.cfm"> <cfinvokeargument name="PageFieldName" value="Header1"> <cfinvokeargument name="PageFieldContent" value="Employees"> </cfinvoke> ---> <script> $(function(){ //global declaration var pageFieldName; var pageName; var fieldClass; var editing = false; var childPageFieldName; //var lastChildPageFieldName; $('input:radio[name=index.cfm]').click(function(){ //var val = $('input:radio[name=index]:checked').val() //alert(val); pageFieldName = $(this).attr('id'); pageName = $(this).attr('name'); //$(this).attr('disabled', 'disabled');//for disabling the radio button //document.getElementById(lastChildPageFieldName).setAttribute("class", "nonEditable"); childPageFieldName=pageFieldName; childPageFieldName=childPageFieldName.slice(3,pageFieldName.length); //fieldClass = $(this).attr('class'); alert(childPageFieldName); //fieldClass = document.getElementById(childPageFieldName).getAttribute ("class"); document.getElementById(childPageFieldName).setAttribute("class","editab le"); $("#"+childPageFieldName+"").click(function(){ fieldClass = $(this).attr('class'); //alert(fieldClass+"abc"+pageFieldName);

if(fieldClass=="editable"){ //alert("field name is:"+pageFieldName+" page name is:"+pageName); document.onclick = catchIt; //catchIt(this); } }); /* $("#"+childPageFieldName+"").click(function(){ fieldClass = $(this).attr('class'); //alert(fieldClass+"abc"+pageFieldName); if(fieldClass=="editable"){ //alert("field name is:"+pageFieldName+" page name is:"+pageName); document.onclick = catchIt; //catchIt(this); } else{ //fieldClass=NULL; //pageFieldName=null; //pageName=null; alert("This is not editable"); } });*/

if (document.getElementById && document.createElement) { var butt = document.createElement('BUTTON'); var buttext = document.createTextNode('Update!'); butt.setAttribute("class", "btnUpdator"); butt.appendChild(buttext); butt.onclick = saveEdit; }

function catchIt(e) { if(fieldClass=='editable'){ if (editing) return; if (!document.getElementById !document.createElement) return; if (!e) var obj = window.event.srcElement; else var obj = e.target; alert(obj.nodeType+"tag name"+obj.tagName+"tag parent"+obj.nodeName); while (obj.nodeType != 1) { obj = obj.parentNode; } if (obj.tagName == 'TEXTAREA' obj.tagName == 'A') return; while (obj.nodeName != 'P' && obj.nodeName != 'HTML') { obj = obj.parentNode; } if (obj.nodeName == 'HTML') return;

var x = obj.innerHTML; var y = document.createElement('TEXTAREA'); var z = obj.parentNode; z.insertBefore(y,obj); z.insertBefore(butt,obj); z.removeChild(obj); y.value = x; y.focus(); editing = true; } else{ //alert("Please click on the chosen field"); //fieldClass='nonEditable'; //pageFieldName=null; //pageName=null; return ; } } /* function catchIt(e) { if(fieldClass=='editable'){ if (editing) return; if (!document.getElementById !document.createElement) return; if (!e) var obj = window.event.srcElement; else var obj = e.target; while (obj.nodeType != 1) { obj = obj.parentNode; } if (obj.tagName == 'TEXTAREA' obj.tagName == 'A') return; while (obj.nodeName != 'P' && obj.nodeName != 'HTML') { obj = obj.parentNode; } if (obj.nodeName == 'HTML') return; var x = obj.innerHTML; var y = document.createElement('TEXTAREA'); var z = obj.parentNode; z.insertBefore(y,obj); z.insertBefore(butt,obj); z.removeChild(obj); y.value = x; y.focus(); editing = true; } else{ //alert("Please click on the chosen field"); //fieldClass='nonEditable'; //pageFieldName=null; //pageName=null; return ; } }*/ function saveEdit() { var postFields; var pageFieldContent = document.getElementsByTagName('TEXTAREA')[0]; var y = document.createElement('P');

y.setAttribute("id", childPageFieldName); y.setAttribute("name", pageName); y.setAttribute("class", "nonEditable"); var z = pageFieldContent.parentNode; y.innerHTML = pageFieldContent.value; z.insertBefore(y,pageFieldContent); z.removeChild(pageFieldContent); z.removeChild(document.getElementsByTagName('button')[0]); editing = false; alert(pageFieldContent.value+" pageName:"+pageName+" pageFieldName:"+pag eFieldName); fieldClass=""; } }); }); //alert(pageFieldContent.value); //postFields = "PageName="+pageName+"&PageFieldName="+pageFieldName+"&Pa geFieldContent="+pageFieldContent; //AjaxCall("editor.cfm",postFields,maincontainer,maincontainer); //postFields = "PageName="+pageName+"&PageFieldName="+pageFieldName+"&Pa geFieldContent="+pageFieldContent; //AjaxCall("test.cfm",postFields,"maincontent","pageFieldName"); // update t_dynamicPageContent set PageFieldContent='hi' where PageFieldName='He ader1' and PageName='index.cfm' </script> </head> <body onload="MM_preloadImages('images/nav-pricing-h.png','images/nav-benefits-n .png','images/nav-contact-h.png','images/nav-faq-h.png','images/nav-signup-h.png ','images/nav-benefits-h.png')"> <input type="hidden" id="lastChildPageFieldName"> <div id="maincontainer"> <cfinclude template="header.cfm"> <div id="maingraphic"> <div id="navcontainer"> <a href="pricing.cfm" onmouseout="MM_swapImgRestore()" onmouseover=" MM_swapImage('Pricing','','images/nav-pricing-h.png',1)"><img src="images/nav-pr icing-n.png" alt="Pricing" name="Pricing" width="63" height="21" border="0" id=" Pricing" /></a> <img src="images/nav-divider.png" width="50" height="21" /> <a href="benefits.cfm" onmouseout="MM_swapImgRestore()" onmouseover= "MM_swapImage('Benefits','','images/nav-benefits-h.png',1)"><img src="images/nav -benefits-n.png" alt="Benefits" name="Benefits" width="71" height="21" border="0 " id="Benefits" /></a> <img src="images/nav-divider.png" width="50" height="21" /> <a href="contact.cfm" onmouseout="MM_swapImgRestore()" onmouseover=" MM_swapImage('Contact','','images/nav-contact-h.png',1)"><img src="images/nav-co ntact-n.png" alt="Contact" name="Contact" width="63" height="21" border="0" id=" Contact" /></a> <img src="images/nav-divider.png" width="50" height="21" /> <a href="faq.cfm" onmouseout="MM_swapImgRestore()" onmouseover="MM_s wapImage('FAQ','','images/nav-faq-h.png',1)"><img src="images/nav-faq-n.png" alt ="FAQ" name="FAQ" width="27" height="21" border="0" id="FAQ" /></a> <img src="images/nav-divider.png" width="50" height="21" /> <a href="javascript: poponload()" onmouseout="MM_swapImgRestore()" o

nmouseover="MM_swapImage('Signup','','images/nav-signup-h.png',1)"><img src="ima ges/nav-signup-n.png" alt="Sign Up" name="Signup" width="62" height="21" border= "0" id="Signup" /></a> </div>

</div> <div id="maincontent"> <span class="bodytitle"><p id="Header1" name="index.cfm" class=" nonEditable">Let AUSUM DATA elevate your business to a new level.</p><span style ="padding-left:10px"><input id="radHeader1" name="index.cfm" type="radio" /></ span></span> <p id="Content1" class="nonEditable">Quisque commodo tempus nequ e. Fusce interdum volutpat commodo. Fusce eget ligula sapien. Suspendisse eleife nd dictum orci. Donec cursus, sem sed sagittis luctus, arcu sapien aliquam magna , eu vehicula enim enim in nibh. Donec ac magna justo. Ut scelerisque, nisl cons ectetur imperdiet hendrerit, purus quam viverra leo, ut malesuada lorem tortor a t mi.</p> <span style="padding-left:10px"><input id="radContent1" name="index.cfm" type="radio" value="" /></span> <span class="bodytitle"><p id="Header2" name="index.cfm" class="nonEdita ble">Introducing PAIGE.</p></span> <span style="padding-left:10px"><input id="radHeader2" name="ind ex.cfm" type="radio" value="" /></span> <p id="Content2" class="nonEditable">Sed interdum maur is nibh. Etiam a tortor nisi, ut cursus dui. Ut porttitor purus sit amet tellus ornare vel suscipit massa volutpat. Sed non neque ligula, nec scelerisque mauris . Praesent ut imperdiet odio. Aenean aliquam lectus eget velit blandit a dictum odio laoreet. Duis felis nisl, semper ut tincidunt nec, ultrices eu mi. Donec no n lacus eget orci adipiscing venenatis. Nulla facilisi. Sed lacinia augue sed el it mattis at cursus enim lacinia. Aenean aliquam lectus eget velit blandit a dic tum odio laoreet. Duis felis nisl, semper ut tincidunt nec, ultrices eu mi. Sed interdum mauris nibh.</p><span style="padding-left:10px"><input id="radContent2" name="index.cfm" type="radio" value="" /></span> <div id="trynow"><a href="trial.cfm"><img src="images/img-TryNow1.gif" a lt="try now" width="237" height="184" border="0" /></a></div> <div id="trynowtext"> <p>If you've never used AUSUM DATA before, we want you to give i t a try, completely free of charge. Click the balloon above to run a single repo rt, and see just how much we can help your business run more efficiently and eff ectively.</p> </div> </div> </div> <cfinclude template="footer.cfm"> </body> </html>

Вам также может понравиться