示例#1
0
    require $sControlsFolder . $sFile;
}
$brk = new clsBr();
$clear = new clsBr(array("attributes" => array("style" => "clear:both;")));
$space = new clsLiteral(' ');
$objTitle = new clsTitle(array('children' => array(new clsLiteral('xajax Test Suite'))));
ob_start();
?>

<?php 
$objStyle = new clsStyle(array('attributes' => array('type' => 'text/css'), 'child' => new clsLiteral(ob_get_clean())));
$objHead = new clsHead(array('xajax' => $xajax, 'children' => array($objTitle, $objStyle, new clsMeta(array('attributes' => array('http-equiv' => 'Content-Type', 'content' => 'text/html; charset=utf-8'))), new clsLink(array('attributes' => array('rel' => 'stylesheet', 'href' => 'xajax.css', 'type' => 'text/css'))))));
$objForm = new clsForm(array('attributes' => array('id' => 'settings'), 'child' => new clsDiv(array('children' => array(new clsSpan(array('attributes' => array('id' => 'testSelection'))), new clsInput(array('attributes' => array('type' => 'checkbox', 'name' => 'control_panel_visible', 'id' => 'control_panel_visible', 'style' => 'visibility: hidden; position: absolute;', 'value' => 1, 'checked' => 'checked'))), new clsAnchor(array('child' => new clsLiteral('Next Test'), 'event' => array('onclick', $aRequests['nexttest'], array(array(0, XAJAX_FORM_VALUES, 'settings'))))), $space, new clsAnchor(array('child' => new clsLiteral('Show/Hide Control Panel'), 'event' => array('onclick', $aRequests['togglecontrolpanel'], array(array(0, XAJAX_CHECKED_VALUE, 'control_panel_visible'))))), $space, new clsAnchor(array('child' => new clsLiteral('Compress Javascript Files'), 'event' => array('onclick', $aRequests['recompressjavascript']))), $space, new clsAnchor(array('child' => new clsLiteral('Compile Core Files'), 'event' => array('onclick', $aRequests['recompilecore']))), $space, new clsAnchor(array('child' => new clsLiteral('Refresh Test Page'), 'event' => array('onclick', $aRequests['gototest']))), new clsDiv(array('attributes' => array('id' => 'control_panel'), 'children' => array(new clsDiv(array("attributes" => array("id" => "options"), "children" => array(new clsInputWithLabel('Enable Debugging', 'right', array('attributes' => array('type' => 'checkbox', 'name' => 'debug', 'id' => 'debug', 'value' => '1'), 'event' => array('onclick', $aRequests['gototest'], array(), '', '; return true;'))), $brk, new clsInputWithLabel('Enable Verbose Debugging', 'right', array('attributes' => array('type' => 'checkbox', 'name' => 'verbose', 'id' => 'verbose', 'value' => '1'), 'event' => array('onclick', $aRequests['gototest'], array(), '', '; return true;'))), $brk, new clsInputWithLabel('Enable Status Messages', 'right', array('attributes' => array('type' => 'checkbox', 'name' => 'status', 'id' => 'status', 'value' => '1'), 'event' => array('onclick', $aRequests['gototest'], array(), '', '; return true;'))), $brk, new clsInputWithLabel('Set default mode to Synchronous', 'right', array('attributes' => array('type' => 'checkbox', 'name' => 'synchronous', 'id' => 'synchronous', 'value' => '1'), 'event' => array('onclick', $aRequests['gototest'], array(), '', '; return true;'))), $brk, new clsInputWithLabel('Inline javascript', 'right', array('attributes' => array('type' => 'checkbox', 'name' => 'inlineJS', 'id' => 'inlineJS', 'value' => '1', 'checked' => 'checked'), 'event' => array('onclick', $aRequests['gototest'], array(), '', '; return true;'))), $brk, new clsInputWithLabel('Use compiled core', 'right', array('attributes' => array('type' => 'checkbox', 'name' => 'AIO', 'id' => 'AIO', 'value' => '1'), 'event' => array('onclick', $aRequests['gototest'], array(), '', '; return true;'))), $brk))), new clsDiv(array('attributes' => array('id' => 'encoding'), 'children' => array(new clsInputWithLabel('Encoding: ', 'left', array('attributes' => array('type' => 'text', 'name' => 'useEncoding', 'id' => 'useEncoding', 'value' => 'UTF-8'))), $brk, new clsLiteral('Output HTML Entities? '), new clsInputWithLabel('Yes', 'right', array('attributes' => array('type' => 'radio', 'name' => 'htmlEntities', 'id' => 'htmlEntitiesYes', 'value' => 1))), new clsInputWithLabel('No', 'right', array('attributes' => array('type' => 'radio', 'name' => 'htmlEntities', 'id' => 'htmlEntitiesNo', 'value' => 0, 'checked' => 'checked'))), $brk, new clsLiteral('Decode UTF-8 Input? '), new clsInputWithLabel('Yes', 'right', array('attributes' => array('type' => 'radio', 'name' => 'decodeUTF8Input', 'id' => 'decodeUTF8InputYes', 'value' => 1))), new clsInputWithLabel('No', 'right', array('attributes' => array('type' => 'radio', 'name' => 'decodeUTF8Input', 'id' => 'decodeUTF8InputNo', 'value' => 0, 'checked' => 'checked'))), $brk, new clsInput(array('attributes' => array('type' => 'submit', 'name' => 'set_options', 'value' => 'Set Options'), 'event' => array('onclick', $aRequests['gototest'])))))), new clsDiv(array('attributes' => array('id' => 'languages'), 'children' => array(new clsInputWithLabel('Load language module (en)', 'right', array('attributes' => array('type' => 'radio', 'name' => 'lang', 'id' => 'lang_en', 'value' => 'en', 'checked' => 'checked'), 'event' => array('onclick', $aRequests['gototest'], array(), '', '; return true;'))), $brk, new clsInputWithLabel('Load language module (de)', 'right', array('attributes' => array('type' => 'radio', 'name' => 'lang', 'id' => 'lang_de', 'value' => 'de'), 'event' => array('onclick', $aRequests['gototest'], array(), '', '; return true;'))), $brk, new clsInputWithLabel('Load language module (es)', 'right', array('attributes' => array('type' => 'radio', 'name' => 'lang', 'id' => 'lang_es', 'value' => 'es'), 'event' => array('onclick', $aRequests['gototest'], array(), '', '; return true;'))), $brk, new clsInputWithLabel('Load language module (fr)', 'right', array('attributes' => array('type' => 'radio', 'name' => 'lang', 'id' => 'lang_fr', 'value' => 'fr'), 'event' => array('onclick', $aRequests['gototest'], array(), '', '; return true;'))), $brk, new clsInputWithLabel('Load language module (nl)', 'right', array('attributes' => array('type' => 'radio', 'name' => 'lang', 'id' => 'lang_nl', 'value' => 'nl'), 'event' => array('onclick', $aRequests['gototest'], array(), '', '; return true;'))), $brk, new clsInputWithLabel('Load language module (tr)', 'right', array('attributes' => array('type' => 'radio', 'name' => 'lang', 'id' => 'lang_tr', 'value' => 'tr'), 'event' => array('onclick', $aRequests['gototest'], array(), '', '; return true;'))), $brk, new clsInputWithLabel('Load language module (bg)', 'right', array('attributes' => array('type' => 'radio', 'name' => 'lang', 'id' => 'lang_bg', 'value' => 'bg'), 'event' => array('onclick', $aRequests['gototest'], array(), '', '; return true;'))), $brk))), $clear, new clsDiv(array('attributes' => array('id' => 'statusMessage')))))))))));
$objIframe = new clsIframe(array('attributes' => array('id' => 'testFrame', 'src' => './none.php')));
$objBody = new clsBody(array('children' => array($objForm, $objIframe), 'event' => array('onload', $aRequests['loadtests'])));
$document = new clsDocument(array('children' => array(new clsDoctype(), new clsHtml(array('children' => array($objHead, $objBody))))));
$document->printHTML();
class clsRequests
{
    var $tests = array();
    function clsRequests()
    {
        $this->tests['./none.php'] = '--- Select Test ---';
        $this->tests['./alert_confirm.php'] = 'Alert and Confirm Commands';
        $this->tests['./assign_append.php'] = 'Assign and Append';
        $this->tests['./tables.php'] = 'Tables';
        $this->tests['./transport.php'] = 'Transport';
        $this->tests['./delayEvents.php'] = 'Callbacks';
        $this->tests['./events.php'] = 'Client-side Events';
        $this->tests['./iframe.php'] = 'iFrame';
        $this->tests['./css.php'] = 'CSS';
*/
define('XAJAX_HTML_CONTROL_DOCTYPE_FORMAT', 'HTML');
define('XAJAX_HTML_CONTROL_DOCTYPE_VERSION', '4.01');
define('XAJAX_HTML_CONTROL_DOCTYPE_VALIDATION', 'TRANSITIONAL');
$sBaseFolder = dirname(dirname(dirname(__FILE__)));
$sCoreFolder = '/xajax_core';
$sCtrlFolder = '/xajax_controls';
include $sBaseFolder . $sCoreFolder . '/xajax.inc.php';
$xajax = new xajax();
$xajax->configure('javascript URI', '../../');
include $sBaseFolder . $sCtrlFolder . '/validate_HTML401TRANSITIONAL.inc.php';
include $sBaseFolder . $sCoreFolder . '/xajaxControl.inc.php';
foreach (array('/document.inc.php', '/structure.inc.php', '/content.inc.php', '/form.inc.php', '/group.inc.php', '/misc.inc.php') as $sFile) {
    include $sBaseFolder . $sCtrlFolder . $sFile;
}
$objDocument = new clsDocument(array('children' => array(new clsDoctype(), new clsHtml(array('children' => array(new clsHead(array('xajax' => $xajax, 'children' => array(generateTitle(), generateStyle(), generateScript(), generateMeta(), generateLink(), generateBase()))), new clsBody(array('children' => array(generateOrderedList(), generateUnorderedList(), generateDefinitionList(), generateTable(), generateForm(), generateContent(), generateValidation(), generateIframe())))))))));
function generateTitle()
{
    return new clsTitle(array('child' => new clsLiteral('Title')));
}
function generateStyle()
{
    return new clsStyle(array('attributes' => array('type' => 'text/css'), 'child' => new clsLiteral('styleOne { background: #ffdddd; }')));
}
function generateScript()
{
    return new clsScript(array('attributes' => array('type' => 'text/javascript'), 'child' => new clsLiteral('javascriptFunction = function(a, b) { alert(a*b); };')));
}
function generateMeta()
{
    return new clsMeta(array('attributes' => array('name' => 'keywords', 'lang' => 'en-us', 'content' => 'xajax, javascript, php, ajax')));
示例#3
0
$aSAOH = new clsAnchor();
$aSAOH->setEvent('onclick', $aRequests['sendassignouterhtml']);
$aSAOH->addChild(new clsLiteral('Test an update using the outerHTML property.'));
$divPage->addChild($aSAOH);
$divPage->addChild($litLineBreak);
$aSPIH = new clsAnchor();
$aSPIH->setEvent('onclick', $aRequests['sendappendinnerhtml']);
$aSPIH->addChild(new clsLiteral('Test an append using the innerHTML property.'));
$divPage->addChild($aSPIH);
$divPage->addChild($litLineBreak);
$divPage->addChild($litLineBreak);
$divContent = new clsDiv(array('attributes' => array('id' => 'content'), 'children' => array(new clsLiteral('This content has not been modified, click an option above to execute a test.'))));
$divPage->addChild($divContent);
$title = new clsTitle();
$title->addChild(new clsLiteral('xajax Test Suite - Assign / Append'));
$style = new clsStyle();
$style->setAttribute('type', 'text/css');
$style->addChild(new clsLiteral('#content { border: 1px solid #555555; }'));
$head = new clsHead();
$head->addChild($title);
$head->setXajax($xajax);
$head->addChild($style);
$body = new clsBody();
$body->addChild($divPage);
$html = new clsHtml();
$html->addChild($head);
$html->addChild($body);
$document = new clsDocument();
$document->addChild(new clsDocType('HTML', '4.01', 'STRICT'));
$document->addChild($html);
$document->printHTML();