rem
stringlengths
0
126k
add
stringlengths
0
441k
context
stringlengths
15
136k
count++; var context = testcase.setup ? testcase.setup() : {};
var test = testcase.tests[idx];
run: function (stop_on_error) { var count = 0, failed = 0, errors = 0; testcases.reverse(); try { testcases.forEach( function (testcase) { sys.puts('\n[Testcase: ' + testcase.name + ']'); testcase.tests.forEach( function (test) { count++; var context = testcase.setup ? testcase.setup() : {}; try { test.body(context); sys.puts(' [OK] ' + test.name + ': passed'); } catch (e) { if (e instanceof AssertFailedException) { sys.puts(' [--] ' + test.name + ': failed. ' + e.message); failed++; } else { sys.print(' [!!] ' + test.name + ': error. '); if (e.stack && e.type) { sys.puts(e.type + '\n' + e.stack); } else { sys.puts(JSON.stringify(e, 0, 2)); } errors++; } if (stop_on_error) { throw 'stopping on first error'; } } if (testcase.teardown) { testcase.teardown(context); } }); sys.puts('----'); }); } catch (e) { if (e === 'stopping on first error') { sys.puts(e); } else { throw e; } } sys.puts('\nTotal: ' + count + ', Failures: ' + failed + ', Errors: ' + errors + ''); },
try { test.body(context); sys.puts(' [OK] ' + test.name + ': passed'); } catch (e) { if (e instanceof AssertFailedException) { sys.puts(' [--] ' + test.name + ': failed. ' + e.message); failed++; } else { sys.print(' [!!] ' + test.name + ': error. '); if (e.stack && e.type) { sys.puts(e.type + '\n' + e.stack);
if (test) { idx = idx + 1; count = count + 1; var context = testcase.setup ? testcase.setup() : {}; function handle_result(error) { if (error) { if (error instanceof AssertFailedException) { sys.puts(' [--] ' + test.name + ': failed. ' + error.message); failed_cnt++; } else { sys.print(' [!!] ' + test.name + ': error. '); if (error.stack && error.type) { sys.puts(error.type + '\n' + error.stack); } else { sys.puts(JSON.stringify(error, 0, 2)); } error_cnt++; } if (stop_on_error) { sys.puts('stopping on first error'); testcase_idx = -1; idx = testcase.tests.length; }
run: function (stop_on_error) { var count = 0, failed = 0, errors = 0; testcases.reverse(); try { testcases.forEach( function (testcase) { sys.puts('\n[Testcase: ' + testcase.name + ']'); testcase.tests.forEach( function (test) { count++; var context = testcase.setup ? testcase.setup() : {}; try { test.body(context); sys.puts(' [OK] ' + test.name + ': passed'); } catch (e) { if (e instanceof AssertFailedException) { sys.puts(' [--] ' + test.name + ': failed. ' + e.message); failed++; } else { sys.print(' [!!] ' + test.name + ': error. '); if (e.stack && e.type) { sys.puts(e.type + '\n' + e.stack); } else { sys.puts(JSON.stringify(e, 0, 2)); } errors++; } if (stop_on_error) { throw 'stopping on first error'; } } if (testcase.teardown) { testcase.teardown(context); } }); sys.puts('----'); }); } catch (e) { if (e === 'stopping on first error') { sys.puts(e); } else { throw e; } } sys.puts('\nTotal: ' + count + ', Failures: ' + failed + ', Errors: ' + errors + ''); },
sys.puts(JSON.stringify(e, 0, 2));
sys.puts(' [OK] ' + test.name + ': passed');
run: function (stop_on_error) { var count = 0, failed = 0, errors = 0; testcases.reverse(); try { testcases.forEach( function (testcase) { sys.puts('\n[Testcase: ' + testcase.name + ']'); testcase.tests.forEach( function (test) { count++; var context = testcase.setup ? testcase.setup() : {}; try { test.body(context); sys.puts(' [OK] ' + test.name + ': passed'); } catch (e) { if (e instanceof AssertFailedException) { sys.puts(' [--] ' + test.name + ': failed. ' + e.message); failed++; } else { sys.print(' [!!] ' + test.name + ': error. '); if (e.stack && e.type) { sys.puts(e.type + '\n' + e.stack); } else { sys.puts(JSON.stringify(e, 0, 2)); } errors++; } if (stop_on_error) { throw 'stopping on first error'; } } if (testcase.teardown) { testcase.teardown(context); } }); sys.puts('----'); }); } catch (e) { if (e === 'stopping on first error') { sys.puts(e); } else { throw e; } } sys.puts('\nTotal: ' + count + ', Failures: ' + failed + ', Errors: ' + errors + ''); },
errors++;
if (testcase.teardown) { testcase.teardown(context); } process.nextTick(run_tests);
run: function (stop_on_error) { var count = 0, failed = 0, errors = 0; testcases.reverse(); try { testcases.forEach( function (testcase) { sys.puts('\n[Testcase: ' + testcase.name + ']'); testcase.tests.forEach( function (test) { count++; var context = testcase.setup ? testcase.setup() : {}; try { test.body(context); sys.puts(' [OK] ' + test.name + ': passed'); } catch (e) { if (e instanceof AssertFailedException) { sys.puts(' [--] ' + test.name + ': failed. ' + e.message); failed++; } else { sys.print(' [!!] ' + test.name + ': error. '); if (e.stack && e.type) { sys.puts(e.type + '\n' + e.stack); } else { sys.puts(JSON.stringify(e, 0, 2)); } errors++; } if (stop_on_error) { throw 'stopping on first error'; } } if (testcase.teardown) { testcase.teardown(context); } }); sys.puts('----'); }); } catch (e) { if (e === 'stopping on first error') { sys.puts(e); } else { throw e; } } sys.puts('\nTotal: ' + count + ', Failures: ' + failed + ', Errors: ' + errors + ''); },
if (stop_on_error) { throw 'stopping on first error'; }
try { test.body(context, handle_result); } catch (e) { handle_result(e); } } else { sys.puts('----'); process.nextTick(run_testcases);
run: function (stop_on_error) { var count = 0, failed = 0, errors = 0; testcases.reverse(); try { testcases.forEach( function (testcase) { sys.puts('\n[Testcase: ' + testcase.name + ']'); testcase.tests.forEach( function (test) { count++; var context = testcase.setup ? testcase.setup() : {}; try { test.body(context); sys.puts(' [OK] ' + test.name + ': passed'); } catch (e) { if (e instanceof AssertFailedException) { sys.puts(' [--] ' + test.name + ': failed. ' + e.message); failed++; } else { sys.print(' [!!] ' + test.name + ': error. '); if (e.stack && e.type) { sys.puts(e.type + '\n' + e.stack); } else { sys.puts(JSON.stringify(e, 0, 2)); } errors++; } if (stop_on_error) { throw 'stopping on first error'; } } if (testcase.teardown) { testcase.teardown(context); } }); sys.puts('----'); }); } catch (e) { if (e === 'stopping on first error') { sys.puts(e); } else { throw e; } } sys.puts('\nTotal: ' + count + ', Failures: ' + failed + ', Errors: ' + errors + ''); },
if (testcase.teardown) { testcase.teardown(context); } }); sys.puts('----'); }); } catch (e) { if (e === 'stopping on first error') { sys.puts(e); } else { throw e; } } sys.puts('\nTotal: ' + count + ', Failures: ' + failed + ', Errors: ' + errors + '');
})();
run: function (stop_on_error) { var count = 0, failed = 0, errors = 0; testcases.reverse(); try { testcases.forEach( function (testcase) { sys.puts('\n[Testcase: ' + testcase.name + ']'); testcase.tests.forEach( function (test) { count++; var context = testcase.setup ? testcase.setup() : {}; try { test.body(context); sys.puts(' [OK] ' + test.name + ': passed'); } catch (e) { if (e instanceof AssertFailedException) { sys.puts(' [--] ' + test.name + ': failed. ' + e.message); failed++; } else { sys.print(' [!!] ' + test.name + ': error. '); if (e.stack && e.type) { sys.puts(e.type + '\n' + e.stack); } else { sys.puts(JSON.stringify(e, 0, 2)); } errors++; } if (stop_on_error) { throw 'stopping on first error'; } } if (testcase.teardown) { testcase.teardown(context); } }); sys.puts('----'); }); } catch (e) { if (e === 'stopping on first error') { sys.puts(e); } else { throw e; } } sys.puts('\nTotal: ' + count + ', Failures: ' + failed + ', Errors: ' + errors + ''); },
this.runMaterialTestSuite = function () { if (!player.ship.docked)
debugConsole.script.runMaterialTestSuite = function ()
this.runMaterialTestSuite = function () { if (!player.ship.docked) { debugConsole.consoleMessage("command-error", "You must be docked to run the material test suite."); return; } // Show instruction/confirmation screen. var substitutions = { shady_count :this.shadyTestCount, non_shady_count: this.nonShadyTestCount }; substitutions.count_string = expandMissionText("oolite_material_test_count_" + debugConsole.maximumShaderMode, substitutions); var introText = expandMissionText("oolite_material_test_confirmation", substitutions); if (substitutions.count_string === null) { log("materialTest.error.unknownMode", "Shader test suite cannot run because maximum shader mode \"" + debugConsole.maximumShaderMode + "\" is not recognised."); return; } if (!Mission.runScreen({ title: "Shader test suite", message: introText, choicesKey: "oolite_material_test_confirmation_choices" }, this.startTest, this)) { log("materialTest.error.missionScreenFailed", "The material test suite failed to run a mission screen."); return; } }
debugConsole.consoleMessage("command-error", "You must be docked to run the material test suite."); return;
worldScripts[scriptName].runMaterialTestSuite();
this.runMaterialTestSuite = function () { if (!player.ship.docked) { debugConsole.consoleMessage("command-error", "You must be docked to run the material test suite."); return; } // Show instruction/confirmation screen. var substitutions = { shady_count :this.shadyTestCount, non_shady_count: this.nonShadyTestCount }; substitutions.count_string = expandMissionText("oolite_material_test_count_" + debugConsole.maximumShaderMode, substitutions); var introText = expandMissionText("oolite_material_test_confirmation", substitutions); if (substitutions.count_string === null) { log("materialTest.error.unknownMode", "Shader test suite cannot run because maximum shader mode \"" + debugConsole.maximumShaderMode + "\" is not recognised."); return; } if (!Mission.runScreen({ title: "Shader test suite", message: introText, choicesKey: "oolite_material_test_confirmation_choices" }, this.startTest, this)) { log("materialTest.error.missionScreenFailed", "The material test suite failed to run a mission screen."); return; } }
var substitutions = { shady_count :this.shadyTestCount, non_shady_count: this.nonShadyTestCount }; substitutions.count_string = expandMissionText("oolite_material_test_count_" + debugConsole.maximumShaderMode, substitutions); var introText = expandMissionText("oolite_material_test_confirmation", substitutions); if (substitutions.count_string === null) { log("materialTest.error.unknownMode", "Shader test suite cannot run because maximum shader mode \"" + debugConsole.maximumShaderMode + "\" is not recognised."); return; } if (!Mission.runScreen({ title: "Shader test suite", message: introText, choicesKey: "oolite_material_test_confirmation_choices" }, this.startTest, this)) { log("materialTest.error.missionScreenFailed", "The material test suite failed to run a mission screen."); return; } }
this.runMaterialTestSuite = function () { if (!player.ship.docked) { debugConsole.consoleMessage("command-error", "You must be docked to run the material test suite."); return; } // Show instruction/confirmation screen. var substitutions = { shady_count :this.shadyTestCount, non_shady_count: this.nonShadyTestCount }; substitutions.count_string = expandMissionText("oolite_material_test_count_" + debugConsole.maximumShaderMode, substitutions); var introText = expandMissionText("oolite_material_test_confirmation", substitutions); if (substitutions.count_string === null) { log("materialTest.error.unknownMode", "Shader test suite cannot run because maximum shader mode \"" + debugConsole.maximumShaderMode + "\" is not recognised."); return; } if (!Mission.runScreen({ title: "Shader test suite", message: introText, choicesKey: "oolite_material_test_confirmation_choices" }, this.startTest, this)) { log("materialTest.error.missionScreenFailed", "The material test suite failed to run a mission screen."); return; } }
substitutions.count_string = expandMissionText(this.shadersSupported ? "oolite_material_test_count_full_shaders" : "oolite_material_test_count_no_shaders", substitutions);
substitutions.count_string = expandMissionText("oolite_material_test_count_" + debugConsole.maximumShaderMode, substitutions);
this.runMaterialTestSuite = function () { if (!player.ship.docked) { debugConsole.consoleMessage("command-error", "You must be docked to run the material test suite."); return; } // Show instruction/confirmation screen. var substitutions = { shady_count :this.shadyTestCount, non_shady_count: this.nonShadyTestCount }; substitutions.count_string = expandMissionText(this.shadersSupported ? "oolite_material_test_count_full_shaders" : "oolite_material_test_count_no_shaders", substitutions); var introText = expandMissionText("oolite_material_test_confirmation", substitutions); if (!Mission.runScreen({ title: "Shader test suite", message: introText, choicesKey: "oolite_material_test_confirmation_choices" }, this.startTest, this)) { log("materialTest.error.missionScreenFailed", "The material test suite failed to run a mission screen."); return; } }
if (substitutions.count_string === null) { log("materialTest.error.unknownMode", "Shader test suite cannot run because maximum shader mode \"" + debugConsole.maximumShaderMode + "\" is not recognised."); return; }
this.runMaterialTestSuite = function () { if (!player.ship.docked) { debugConsole.consoleMessage("command-error", "You must be docked to run the material test suite."); return; } // Show instruction/confirmation screen. var substitutions = { shady_count :this.shadyTestCount, non_shady_count: this.nonShadyTestCount }; substitutions.count_string = expandMissionText(this.shadersSupported ? "oolite_material_test_count_full_shaders" : "oolite_material_test_count_no_shaders", substitutions); var introText = expandMissionText("oolite_material_test_confirmation", substitutions); if (!Mission.runScreen({ title: "Shader test suite", message: introText, choicesKey: "oolite_material_test_confirmation_choices" }, this.startTest, this)) { log("materialTest.error.missionScreenFailed", "The material test suite failed to run a mission screen."); return; } }
if (testIndex > this.testCount)
if (testIndex > this.settingsByPass[this.passID].maxIndex)
this.runNextTest = function () { var testIndex = this.nextTestIndex++; if (testIndex > this.testCount) { if (this.passID == 1) { // Switch to next pass (full shader mode). this.passID = 2; this.nextTestIndex = 2; testIndex = 1; } else { // Both passes have run, we're done. this.performCleanUp(); var config = { title: "Shader test suite", message: "The test suite is complete.\n\n\n" + "Your OpenGL renderer information is:\n" + "Vendor: β€œ" + debugConsole.glVendorString + "”\n" + "Renderer: β€œ" + debugConsole.glRendererString + "”\n\n" + "This information can also be found in the Oolite log." }; log("shaderTest.complete", "Shader test suite complete."); debugConsole.writeLogMarker(); Mission.runScreen(config, function () {}); return; } } // Create a dummy ship to extract its script_info. var modelName = "oolite_shader_test_suite_" + testIndex; var ship = system.addShips(modelName, 1, system.sun.position, 10000)[0]; var testDesc = ship.scriptInfo["oolite_shader_test_suite_label"]; ship.remove(); // Ensure environment is what we need - each time in case user tries to be clever. debugConsole.shaderMode = this.passID == 1 ? "SHADERS_SIMPLE" : "SHADERS_FULL"; debugConsole.displayFPS = true; debugConsole.debugFlags |= debugConsole.DEBUG_NO_SHADER_FALLBACK | debugConsole.DEBUG_SHADER_VALIDATION; // Actually run the test. var testLabel = (this.passID == 1 ? "simple" : "full") + "-" + testIndex; log("shaderTest.runTest", "Running test " + testLabel + " (" + testDesc + ")."); var config = { model: modelName, title: "", message: "\n\n\n" + testLabel + "\n" + testDesc }; if (!Mission.runScreen(config, this.runNextTest, this)) { log("shaderTest.error.missionScreenFailed", "The shader test suite failed to run a mission screen."); this.performCleanUp(); return; } }
if (this.passID == 1)
var maxPass = this.shadersSupported ? 3 : 1; if (this.passID < maxPass)
this.runNextTest = function () { var testIndex = this.nextTestIndex++; if (testIndex > this.testCount) { if (this.passID == 1) { // Switch to next pass (full shader mode). this.passID = 2; this.nextTestIndex = 2; testIndex = 1; } else { // Both passes have run, we're done. this.performCleanUp(); var config = { title: "Shader test suite", message: "The test suite is complete.\n\n\n" + "Your OpenGL renderer information is:\n" + "Vendor: β€œ" + debugConsole.glVendorString + "”\n" + "Renderer: β€œ" + debugConsole.glRendererString + "”\n\n" + "This information can also be found in the Oolite log." }; log("shaderTest.complete", "Shader test suite complete."); debugConsole.writeLogMarker(); Mission.runScreen(config, function () {}); return; } } // Create a dummy ship to extract its script_info. var modelName = "oolite_shader_test_suite_" + testIndex; var ship = system.addShips(modelName, 1, system.sun.position, 10000)[0]; var testDesc = ship.scriptInfo["oolite_shader_test_suite_label"]; ship.remove(); // Ensure environment is what we need - each time in case user tries to be clever. debugConsole.shaderMode = this.passID == 1 ? "SHADERS_SIMPLE" : "SHADERS_FULL"; debugConsole.displayFPS = true; debugConsole.debugFlags |= debugConsole.DEBUG_NO_SHADER_FALLBACK | debugConsole.DEBUG_SHADER_VALIDATION; // Actually run the test. var testLabel = (this.passID == 1 ? "simple" : "full") + "-" + testIndex; log("shaderTest.runTest", "Running test " + testLabel + " (" + testDesc + ")."); var config = { model: modelName, title: "", message: "\n\n\n" + testLabel + "\n" + testDesc }; if (!Mission.runScreen(config, this.runNextTest, this)) { log("shaderTest.error.missionScreenFailed", "The shader test suite failed to run a mission screen."); this.performCleanUp(); return; } }
this.passID = 2;
this.passID++;
this.runNextTest = function () { var testIndex = this.nextTestIndex++; if (testIndex > this.testCount) { if (this.passID == 1) { // Switch to next pass (full shader mode). this.passID = 2; this.nextTestIndex = 2; testIndex = 1; } else { // Both passes have run, we're done. this.performCleanUp(); var config = { title: "Shader test suite", message: "The test suite is complete.\n\n\n" + "Your OpenGL renderer information is:\n" + "Vendor: β€œ" + debugConsole.glVendorString + "”\n" + "Renderer: β€œ" + debugConsole.glRendererString + "”\n\n" + "This information can also be found in the Oolite log." }; log("shaderTest.complete", "Shader test suite complete."); debugConsole.writeLogMarker(); Mission.runScreen(config, function () {}); return; } } // Create a dummy ship to extract its script_info. var modelName = "oolite_shader_test_suite_" + testIndex; var ship = system.addShips(modelName, 1, system.sun.position, 10000)[0]; var testDesc = ship.scriptInfo["oolite_shader_test_suite_label"]; ship.remove(); // Ensure environment is what we need - each time in case user tries to be clever. debugConsole.shaderMode = this.passID == 1 ? "SHADERS_SIMPLE" : "SHADERS_FULL"; debugConsole.displayFPS = true; debugConsole.debugFlags |= debugConsole.DEBUG_NO_SHADER_FALLBACK | debugConsole.DEBUG_SHADER_VALIDATION; // Actually run the test. var testLabel = (this.passID == 1 ? "simple" : "full") + "-" + testIndex; log("shaderTest.runTest", "Running test " + testLabel + " (" + testDesc + ")."); var config = { model: modelName, title: "", message: "\n\n\n" + testLabel + "\n" + testDesc }; if (!Mission.runScreen(config, this.runNextTest, this)) { log("shaderTest.error.missionScreenFailed", "The shader test suite failed to run a mission screen."); this.performCleanUp(); return; } }
log("shaderTest.complete", "Shader test suite complete.");
log("materialTest.complete", "Shader test suite complete.");
this.runNextTest = function () { var testIndex = this.nextTestIndex++; if (testIndex > this.testCount) { if (this.passID == 1) { // Switch to next pass (full shader mode). this.passID = 2; this.nextTestIndex = 2; testIndex = 1; } else { // Both passes have run, we're done. this.performCleanUp(); var config = { title: "Shader test suite", message: "The test suite is complete.\n\n\n" + "Your OpenGL renderer information is:\n" + "Vendor: β€œ" + debugConsole.glVendorString + "”\n" + "Renderer: β€œ" + debugConsole.glRendererString + "”\n\n" + "This information can also be found in the Oolite log." }; log("shaderTest.complete", "Shader test suite complete."); debugConsole.writeLogMarker(); Mission.runScreen(config, function () {}); return; } } // Create a dummy ship to extract its script_info. var modelName = "oolite_shader_test_suite_" + testIndex; var ship = system.addShips(modelName, 1, system.sun.position, 10000)[0]; var testDesc = ship.scriptInfo["oolite_shader_test_suite_label"]; ship.remove(); // Ensure environment is what we need - each time in case user tries to be clever. debugConsole.shaderMode = this.passID == 1 ? "SHADERS_SIMPLE" : "SHADERS_FULL"; debugConsole.displayFPS = true; debugConsole.debugFlags |= debugConsole.DEBUG_NO_SHADER_FALLBACK | debugConsole.DEBUG_SHADER_VALIDATION; // Actually run the test. var testLabel = (this.passID == 1 ? "simple" : "full") + "-" + testIndex; log("shaderTest.runTest", "Running test " + testLabel + " (" + testDesc + ")."); var config = { model: modelName, title: "", message: "\n\n\n" + testLabel + "\n" + testDesc }; if (!Mission.runScreen(config, this.runNextTest, this)) { log("shaderTest.error.missionScreenFailed", "The shader test suite failed to run a mission screen."); this.performCleanUp(); return; } }
var modelName = "oolite_shader_test_suite_" + testIndex;
var modelName = passData.rolePrefix + testIndex;
this.runNextTest = function () { var testIndex = this.nextTestIndex++; if (testIndex > this.testCount) { if (this.passID == 1) { // Switch to next pass (full shader mode). this.passID = 2; this.nextTestIndex = 2; testIndex = 1; } else { // Both passes have run, we're done. this.performCleanUp(); var config = { title: "Shader test suite", message: "The test suite is complete.\n\n\n" + "Your OpenGL renderer information is:\n" + "Vendor: β€œ" + debugConsole.glVendorString + "”\n" + "Renderer: β€œ" + debugConsole.glRendererString + "”\n\n" + "This information can also be found in the Oolite log." }; log("shaderTest.complete", "Shader test suite complete."); debugConsole.writeLogMarker(); Mission.runScreen(config, function () {}); return; } } // Create a dummy ship to extract its script_info. var modelName = "oolite_shader_test_suite_" + testIndex; var ship = system.addShips(modelName, 1, system.sun.position, 10000)[0]; var testDesc = ship.scriptInfo["oolite_shader_test_suite_label"]; ship.remove(); // Ensure environment is what we need - each time in case user tries to be clever. debugConsole.shaderMode = this.passID == 1 ? "SHADERS_SIMPLE" : "SHADERS_FULL"; debugConsole.displayFPS = true; debugConsole.debugFlags |= debugConsole.DEBUG_NO_SHADER_FALLBACK | debugConsole.DEBUG_SHADER_VALIDATION; // Actually run the test. var testLabel = (this.passID == 1 ? "simple" : "full") + "-" + testIndex; log("shaderTest.runTest", "Running test " + testLabel + " (" + testDesc + ")."); var config = { model: modelName, title: "", message: "\n\n\n" + testLabel + "\n" + testDesc }; if (!Mission.runScreen(config, this.runNextTest, this)) { log("shaderTest.error.missionScreenFailed", "The shader test suite failed to run a mission screen."); this.performCleanUp(); return; } }
var testDesc = ship.scriptInfo["oolite_shader_test_suite_label"];
var testDesc = ship.scriptInfo["oolite_material_test_suite_label"];
this.runNextTest = function () { var testIndex = this.nextTestIndex++; if (testIndex > this.testCount) { if (this.passID == 1) { // Switch to next pass (full shader mode). this.passID = 2; this.nextTestIndex = 2; testIndex = 1; } else { // Both passes have run, we're done. this.performCleanUp(); var config = { title: "Shader test suite", message: "The test suite is complete.\n\n\n" + "Your OpenGL renderer information is:\n" + "Vendor: β€œ" + debugConsole.glVendorString + "”\n" + "Renderer: β€œ" + debugConsole.glRendererString + "”\n\n" + "This information can also be found in the Oolite log." }; log("shaderTest.complete", "Shader test suite complete."); debugConsole.writeLogMarker(); Mission.runScreen(config, function () {}); return; } } // Create a dummy ship to extract its script_info. var modelName = "oolite_shader_test_suite_" + testIndex; var ship = system.addShips(modelName, 1, system.sun.position, 10000)[0]; var testDesc = ship.scriptInfo["oolite_shader_test_suite_label"]; ship.remove(); // Ensure environment is what we need - each time in case user tries to be clever. debugConsole.shaderMode = this.passID == 1 ? "SHADERS_SIMPLE" : "SHADERS_FULL"; debugConsole.displayFPS = true; debugConsole.debugFlags |= debugConsole.DEBUG_NO_SHADER_FALLBACK | debugConsole.DEBUG_SHADER_VALIDATION; // Actually run the test. var testLabel = (this.passID == 1 ? "simple" : "full") + "-" + testIndex; log("shaderTest.runTest", "Running test " + testLabel + " (" + testDesc + ")."); var config = { model: modelName, title: "", message: "\n\n\n" + testLabel + "\n" + testDesc }; if (!Mission.runScreen(config, this.runNextTest, this)) { log("shaderTest.error.missionScreenFailed", "The shader test suite failed to run a mission screen."); this.performCleanUp(); return; } }
debugConsole.shaderMode = this.passID == 1 ? "SHADERS_SIMPLE" : "SHADERS_FULL";
debugConsole.shaderMode = passData.shaderMode;
this.runNextTest = function () { var testIndex = this.nextTestIndex++; if (testIndex > this.testCount) { if (this.passID == 1) { // Switch to next pass (full shader mode). this.passID = 2; this.nextTestIndex = 2; testIndex = 1; } else { // Both passes have run, we're done. this.performCleanUp(); var config = { title: "Shader test suite", message: "The test suite is complete.\n\n\n" + "Your OpenGL renderer information is:\n" + "Vendor: β€œ" + debugConsole.glVendorString + "”\n" + "Renderer: β€œ" + debugConsole.glRendererString + "”\n\n" + "This information can also be found in the Oolite log." }; log("shaderTest.complete", "Shader test suite complete."); debugConsole.writeLogMarker(); Mission.runScreen(config, function () {}); return; } } // Create a dummy ship to extract its script_info. var modelName = "oolite_shader_test_suite_" + testIndex; var ship = system.addShips(modelName, 1, system.sun.position, 10000)[0]; var testDesc = ship.scriptInfo["oolite_shader_test_suite_label"]; ship.remove(); // Ensure environment is what we need - each time in case user tries to be clever. debugConsole.shaderMode = this.passID == 1 ? "SHADERS_SIMPLE" : "SHADERS_FULL"; debugConsole.displayFPS = true; debugConsole.debugFlags |= debugConsole.DEBUG_NO_SHADER_FALLBACK | debugConsole.DEBUG_SHADER_VALIDATION; // Actually run the test. var testLabel = (this.passID == 1 ? "simple" : "full") + "-" + testIndex; log("shaderTest.runTest", "Running test " + testLabel + " (" + testDesc + ")."); var config = { model: modelName, title: "", message: "\n\n\n" + testLabel + "\n" + testDesc }; if (!Mission.runScreen(config, this.runNextTest, this)) { log("shaderTest.error.missionScreenFailed", "The shader test suite failed to run a mission screen."); this.performCleanUp(); return; } }
var testLabel = (this.passID == 1 ? "simple" : "full") + "-" + testIndex; log("shaderTest.runTest", "Running test " + testLabel + " (" + testDesc + ").");
var passNames = ["", "fixed-function", "simple", "full"]; var testLabel = passData.passName + ":" + testIndex; log("materialTest.runTest", "Running test " + testLabel + " (" + testDesc + ").");
this.runNextTest = function () { var testIndex = this.nextTestIndex++; if (testIndex > this.testCount) { if (this.passID == 1) { // Switch to next pass (full shader mode). this.passID = 2; this.nextTestIndex = 2; testIndex = 1; } else { // Both passes have run, we're done. this.performCleanUp(); var config = { title: "Shader test suite", message: "The test suite is complete.\n\n\n" + "Your OpenGL renderer information is:\n" + "Vendor: β€œ" + debugConsole.glVendorString + "”\n" + "Renderer: β€œ" + debugConsole.glRendererString + "”\n\n" + "This information can also be found in the Oolite log." }; log("shaderTest.complete", "Shader test suite complete."); debugConsole.writeLogMarker(); Mission.runScreen(config, function () {}); return; } } // Create a dummy ship to extract its script_info. var modelName = "oolite_shader_test_suite_" + testIndex; var ship = system.addShips(modelName, 1, system.sun.position, 10000)[0]; var testDesc = ship.scriptInfo["oolite_shader_test_suite_label"]; ship.remove(); // Ensure environment is what we need - each time in case user tries to be clever. debugConsole.shaderMode = this.passID == 1 ? "SHADERS_SIMPLE" : "SHADERS_FULL"; debugConsole.displayFPS = true; debugConsole.debugFlags |= debugConsole.DEBUG_NO_SHADER_FALLBACK | debugConsole.DEBUG_SHADER_VALIDATION; // Actually run the test. var testLabel = (this.passID == 1 ? "simple" : "full") + "-" + testIndex; log("shaderTest.runTest", "Running test " + testLabel + " (" + testDesc + ")."); var config = { model: modelName, title: "", message: "\n\n\n" + testLabel + "\n" + testDesc }; if (!Mission.runScreen(config, this.runNextTest, this)) { log("shaderTest.error.missionScreenFailed", "The shader test suite failed to run a mission screen."); this.performCleanUp(); return; } }
log("shaderTest.error.missionScreenFailed", "The shader test suite failed to run a mission screen.");
log("materialTest.error.missionScreenFailed", "The material test suite failed to run a mission screen.");
this.runNextTest = function () { var testIndex = this.nextTestIndex++; if (testIndex > this.testCount) { if (this.passID == 1) { // Switch to next pass (full shader mode). this.passID = 2; this.nextTestIndex = 2; testIndex = 1; } else { // Both passes have run, we're done. this.performCleanUp(); var config = { title: "Shader test suite", message: "The test suite is complete.\n\n\n" + "Your OpenGL renderer information is:\n" + "Vendor: β€œ" + debugConsole.glVendorString + "”\n" + "Renderer: β€œ" + debugConsole.glRendererString + "”\n\n" + "This information can also be found in the Oolite log." }; log("shaderTest.complete", "Shader test suite complete."); debugConsole.writeLogMarker(); Mission.runScreen(config, function () {}); return; } } // Create a dummy ship to extract its script_info. var modelName = "oolite_shader_test_suite_" + testIndex; var ship = system.addShips(modelName, 1, system.sun.position, 10000)[0]; var testDesc = ship.scriptInfo["oolite_shader_test_suite_label"]; ship.remove(); // Ensure environment is what we need - each time in case user tries to be clever. debugConsole.shaderMode = this.passID == 1 ? "SHADERS_SIMPLE" : "SHADERS_FULL"; debugConsole.displayFPS = true; debugConsole.debugFlags |= debugConsole.DEBUG_NO_SHADER_FALLBACK | debugConsole.DEBUG_SHADER_VALIDATION; // Actually run the test. var testLabel = (this.passID == 1 ? "simple" : "full") + "-" + testIndex; log("shaderTest.runTest", "Running test " + testLabel + " (" + testDesc + ")."); var config = { model: modelName, title: "", message: "\n\n\n" + testLabel + "\n" + testDesc }; if (!Mission.runScreen(config, this.runNextTest, this)) { log("shaderTest.error.missionScreenFailed", "The shader test suite failed to run a mission screen."); this.performCleanUp(); return; } }
var message = expandMissionText((this.maxPassID == 1) ? "oolite_material_test_completion_no_shaders" : "oolite_material_test_completion_shaders", substitutions);
var message = expandMissionText(shady ? "oolite_material_test_completion_no_shaders" : "oolite_material_test_completion_shaders", substitutions);
this.runNextTest = function () { var testIndex = this.nextTestIndex++; if (testIndex > this.settingsByPass[this.passID].maxIndex) { if (this.passID < this.maxPassID) { // Switch to next pass. this.passID++; this.nextTestIndex = 2; testIndex = 1; } else { // All passes have run, we're done. this.performCleanUp(); var substitutions = { gl_vendor_string: debugConsole.glVendorString, gl_renderer_string: debugConsole.glRendererString, gl_tex_image_unit_count: debugConsole.glFragmentShaderTextureUnitCount }; var message = expandMissionText((this.maxPassID == 1) ? "oolite_material_test_completion_no_shaders" : "oolite_material_test_completion_shaders", substitutions); log("materialTest.complete", "Shader test suite complete."); debugConsole.writeLogMarker(); mission.runScreen({ titleKey: "oolite_material_test_title", message: message }, function () {}); return; } } var passData = this.settingsByPass[this.passID]; // Create a dummy ship to extract its script_info. var modelName = passData.rolePrefix + testIndex; var ship = system.addShips(modelName, 1, system.sun.position, 10000)[0]; var testDesc = ship.scriptInfo["oolite_material_test_suite_label"]; ship.remove(); // Ensure environment is what we need - each time in case user tries to be clever. debugConsole.shaderMode = passData.shaderMode; debugConsole.debugFlags |= debugConsole.DEBUG_NO_SHADER_FALLBACK | debugConsole.DEBUG_SHADER_VALIDATION; // Actually run the test. var passNames = ["", "fixed-function", "simple", "full"]; var testLabel = passData.passName + ":" + testIndex; log("materialTest.runTest", "Running test " + testLabel + " (" + testDesc + ")."); var config = { model: modelName, title: "", message: "\n\n\n" + testLabel + "\n" + testDesc, background: "oolite_material_test_suite_backdrop.png" }; if (!mission.runScreen(config, this.runNextTest, this)) { log("materialTest.error.missionScreenFailed", "The material test suite failed to run a mission screen."); this.performCleanUp(); return; } }
var config =
var substitutions =
this.runNextTest = function () { var testIndex = this.nextTestIndex++; if (testIndex > this.settingsByPass[this.passID].maxIndex) { if (this.passID < this.maxPassID) { // Switch to next pass. this.passID++; this.nextTestIndex = 2; testIndex = 1; } else { // All passes have run, we're done. this.performCleanUp(); var config = { title: "Shader test suite", message: "The test suite is complete.\n\n\n" + "Your OpenGL renderer information is:\n" + "Vendor: β€œ" + debugConsole.glVendorString + "”\n" + "Renderer: β€œ" + debugConsole.glRendererString + "”\n\n" + "This information can also be found in the Oolite log." }; log("materialTest.complete", "Shader test suite complete."); debugConsole.writeLogMarker(); Mission.runScreen(config, function () {}); return; } } var passData = this.settingsByPass[this.passID]; // Create a dummy ship to extract its script_info. var modelName = passData.rolePrefix + testIndex; var ship = system.addShips(modelName, 1, system.sun.position, 10000)[0]; var testDesc = ship.scriptInfo["oolite_material_test_suite_label"]; ship.remove(); // Ensure environment is what we need - each time in case user tries to be clever. debugConsole.shaderMode = passData.shaderMode; debugConsole.debugFlags |= debugConsole.DEBUG_NO_SHADER_FALLBACK | debugConsole.DEBUG_SHADER_VALIDATION; // Actually run the test. var passNames = ["", "fixed-function", "simple", "full"]; var testLabel = passData.passName + ":" + testIndex; log("materialTest.runTest", "Running test " + testLabel + " (" + testDesc + ")."); var config = { model: modelName, title: "", message: "\n\n\n" + testLabel + "\n" + testDesc, background: "oolite_material_test_suite_backdrop.png" }; if (!Mission.runScreen(config, this.runNextTest, this)) { log("materialTest.error.missionScreenFailed", "The material test suite failed to run a mission screen."); this.performCleanUp(); return; } }
title: "Shader test suite", message: "The test suite is complete.\n\n\n" + "Your OpenGL renderer information is:\n" + "Vendor: β€œ" + debugConsole.glVendorString + "”\n" + "Renderer: β€œ" + debugConsole.glRendererString + "”\n\n" + "This information can also be found in the Oolite log."
gl_vendor_string: debugConsole.glVendorString, gl_renderer_string: debugConsole.glRendererString, gl_tex_image_unit_count: debugConsole.glFragmentShaderTextureUnitCount
this.runNextTest = function () { var testIndex = this.nextTestIndex++; if (testIndex > this.settingsByPass[this.passID].maxIndex) { if (this.passID < this.maxPassID) { // Switch to next pass. this.passID++; this.nextTestIndex = 2; testIndex = 1; } else { // All passes have run, we're done. this.performCleanUp(); var config = { title: "Shader test suite", message: "The test suite is complete.\n\n\n" + "Your OpenGL renderer information is:\n" + "Vendor: β€œ" + debugConsole.glVendorString + "”\n" + "Renderer: β€œ" + debugConsole.glRendererString + "”\n\n" + "This information can also be found in the Oolite log." }; log("materialTest.complete", "Shader test suite complete."); debugConsole.writeLogMarker(); Mission.runScreen(config, function () {}); return; } } var passData = this.settingsByPass[this.passID]; // Create a dummy ship to extract its script_info. var modelName = passData.rolePrefix + testIndex; var ship = system.addShips(modelName, 1, system.sun.position, 10000)[0]; var testDesc = ship.scriptInfo["oolite_material_test_suite_label"]; ship.remove(); // Ensure environment is what we need - each time in case user tries to be clever. debugConsole.shaderMode = passData.shaderMode; debugConsole.debugFlags |= debugConsole.DEBUG_NO_SHADER_FALLBACK | debugConsole.DEBUG_SHADER_VALIDATION; // Actually run the test. var passNames = ["", "fixed-function", "simple", "full"]; var testLabel = passData.passName + ":" + testIndex; log("materialTest.runTest", "Running test " + testLabel + " (" + testDesc + ")."); var config = { model: modelName, title: "", message: "\n\n\n" + testLabel + "\n" + testDesc, background: "oolite_material_test_suite_backdrop.png" }; if (!Mission.runScreen(config, this.runNextTest, this)) { log("materialTest.error.missionScreenFailed", "The material test suite failed to run a mission screen."); this.performCleanUp(); return; } }
Mission.runScreen(config, function () {});
mission.runScreen({ titleKey: "oolite_material_test_title", message: message }, function () {});
this.runNextTest = function () { var testIndex = this.nextTestIndex++; if (testIndex > this.settingsByPass[this.passID].maxIndex) { if (this.passID < this.maxPassID) { // Switch to next pass. this.passID++; this.nextTestIndex = 2; testIndex = 1; } else { // All passes have run, we're done. this.performCleanUp(); var config = { title: "Shader test suite", message: "The test suite is complete.\n\n\n" + "Your OpenGL renderer information is:\n" + "Vendor: β€œ" + debugConsole.glVendorString + "”\n" + "Renderer: β€œ" + debugConsole.glRendererString + "”\n\n" + "This information can also be found in the Oolite log." }; log("materialTest.complete", "Shader test suite complete."); debugConsole.writeLogMarker(); Mission.runScreen(config, function () {}); return; } } var passData = this.settingsByPass[this.passID]; // Create a dummy ship to extract its script_info. var modelName = passData.rolePrefix + testIndex; var ship = system.addShips(modelName, 1, system.sun.position, 10000)[0]; var testDesc = ship.scriptInfo["oolite_material_test_suite_label"]; ship.remove(); // Ensure environment is what we need - each time in case user tries to be clever. debugConsole.shaderMode = passData.shaderMode; debugConsole.debugFlags |= debugConsole.DEBUG_NO_SHADER_FALLBACK | debugConsole.DEBUG_SHADER_VALIDATION; // Actually run the test. var passNames = ["", "fixed-function", "simple", "full"]; var testLabel = passData.passName + ":" + testIndex; log("materialTest.runTest", "Running test " + testLabel + " (" + testDesc + ")."); var config = { model: modelName, title: "", message: "\n\n\n" + testLabel + "\n" + testDesc, background: "oolite_material_test_suite_backdrop.png" }; if (!Mission.runScreen(config, this.runNextTest, this)) { log("materialTest.error.missionScreenFailed", "The material test suite failed to run a mission screen."); this.performCleanUp(); return; } }
if (!Mission.runScreen(config, this.runNextTest, this))
if (!mission.runScreen(config, this.runNextTest, this))
this.runNextTest = function () { var testIndex = this.nextTestIndex++; if (testIndex > this.settingsByPass[this.passID].maxIndex) { if (this.passID < this.maxPassID) { // Switch to next pass. this.passID++; this.nextTestIndex = 2; testIndex = 1; } else { // All passes have run, we're done. this.performCleanUp(); var config = { title: "Shader test suite", message: "The test suite is complete.\n\n\n" + "Your OpenGL renderer information is:\n" + "Vendor: β€œ" + debugConsole.glVendorString + "”\n" + "Renderer: β€œ" + debugConsole.glRendererString + "”\n\n" + "This information can also be found in the Oolite log." }; log("materialTest.complete", "Shader test suite complete."); debugConsole.writeLogMarker(); Mission.runScreen(config, function () {}); return; } } var passData = this.settingsByPass[this.passID]; // Create a dummy ship to extract its script_info. var modelName = passData.rolePrefix + testIndex; var ship = system.addShips(modelName, 1, system.sun.position, 10000)[0]; var testDesc = ship.scriptInfo["oolite_material_test_suite_label"]; ship.remove(); // Ensure environment is what we need - each time in case user tries to be clever. debugConsole.shaderMode = passData.shaderMode; debugConsole.debugFlags |= debugConsole.DEBUG_NO_SHADER_FALLBACK | debugConsole.DEBUG_SHADER_VALIDATION; // Actually run the test. var passNames = ["", "fixed-function", "simple", "full"]; var testLabel = passData.passName + ":" + testIndex; log("materialTest.runTest", "Running test " + testLabel + " (" + testDesc + ")."); var config = { model: modelName, title: "", message: "\n\n\n" + testLabel + "\n" + testDesc, background: "oolite_material_test_suite_backdrop.png" }; if (!Mission.runScreen(config, this.runNextTest, this)) { log("materialTest.error.missionScreenFailed", "The material test suite failed to run a mission screen."); this.performCleanUp(); return; } }
debugConsole.debugFlags |= debugConsole.DEBUG_NO_SHADER_FALLBACK;
debugConsole.debugFlags |= debugConsole.DEBUG_NO_SHADER_FALLBACK | debugConsole.DEBUG_SHADER_VALIDATION;
this.runNextTest = function () { var testIndex = this.nextTestIndex++; if (testIndex > this.testCount) { if (this.passID == 1) { // Switch to next pass (full shader mode). this.passID = 2; this.nextTestIndex = 2; testIndex = 1; } else { // Both passes have run, we're done. this.performCleanUp(); var config = { title: "Shader test suite", message: "The test suite is complete.\n\n\n" + "Your OpenGL renderer information is:\n" + "Vendor: β€œ" + debugConsole.glVendorString + "”\n" + "Renderer: β€œ" + debugConsole.glRendererString + "”\n\n" + "This information can also be found in the Oolite log." }; log("shaderTest.complete", "Shader test suite complete."); debugConsole.writeLogMarker(); Mission.runScreen(config, function () {}); return; } } // Create a dummy ship to extract its script_info. var modelName = "oolite_shader_test_suite_" + testIndex; var ship = system.addShips(modelName, 1, system.sun.position, 10000)[0]; var testDesc = ship.scriptInfo["oolite_shader_test_suite_label"]; ship.remove(); // Ensure environment is what we need - each time in case user tries to be clever. debugConsole.shaderMode = this.passID == 1 ? "SHADERS_SIMPLE" : "SHADERS_FULL"; debugConsole.displayFPS = true; debugConsole.debugFlags |= debugConsole.DEBUG_NO_SHADER_FALLBACK; // Actually run the test. var testLabel = (this.passID == 1 ? "simple" : "full") + "-" + testIndex; log("shaderTest.runTest", "Running test " + testLabel + " (" + testDesc + ")."); var config = { model: modelName, title: "", message: "\n\n\n" + testLabel + "\n" + testDesc }; if (!Mission.runScreen(config, this.runNextTest, this)) { log("shaderTest.error.missionScreenFailed", "The shader test suite failed to run a mission screen."); this.performCleanUp(); return; } }
debugConsole.displayFPS = true;
this.runNextTest = function () { var testIndex = this.nextTestIndex++; if (testIndex > this.settingsByPass[this.passID].maxIndex) { if (this.passID < this.maxPassID) { // Switch to next pass. this.passID++; this.nextTestIndex = 2; testIndex = 1; } else { // All passes have run, we're done. this.performCleanUp(); var config = { title: "Shader test suite", message: "The test suite is complete.\n\n\n" + "Your OpenGL renderer information is:\n" + "Vendor: β€œ" + debugConsole.glVendorString + "”\n" + "Renderer: β€œ" + debugConsole.glRendererString + "”\n\n" + "This information can also be found in the Oolite log." }; log("materialTest.complete", "Shader test suite complete."); debugConsole.writeLogMarker(); Mission.runScreen(config, function () {}); return; } } var passData = this.settingsByPass[this.passID]; // Create a dummy ship to extract its script_info. var modelName = passData.rolePrefix + testIndex; var ship = system.addShips(modelName, 1, system.sun.position, 10000)[0]; var testDesc = ship.scriptInfo["oolite_material_test_suite_label"]; ship.remove(); // Ensure environment is what we need - each time in case user tries to be clever. debugConsole.shaderMode = passData.shaderMode; debugConsole.displayFPS = true; debugConsole.debugFlags |= debugConsole.DEBUG_NO_SHADER_FALLBACK | debugConsole.DEBUG_SHADER_VALIDATION; // Actually run the test. var passNames = ["", "fixed-function", "simple", "full"]; var testLabel = passData.passName + ":" + testIndex; log("materialTest.runTest", "Running test " + testLabel + " (" + testDesc + ")."); var config = { model: modelName, title: "", message: "\n\n\n" + testLabel + "\n" + testDesc }; if (!Mission.runScreen(config, this.runNextTest, this)) { log("materialTest.error.missionScreenFailed", "The material test suite failed to run a mission screen."); this.performCleanUp(); return; } }
message: "\n\n\n" + testLabel + "\n" + testDesc
message: "\n\n\n" + testLabel + "\n" + testDesc, background: "oolite_material_test_suite_backdrop.png"
this.runNextTest = function () { var testIndex = this.nextTestIndex++; if (testIndex > this.settingsByPass[this.passID].maxIndex) { if (this.passID < this.maxPassID) { // Switch to next pass. this.passID++; this.nextTestIndex = 2; testIndex = 1; } else { // All passes have run, we're done. this.performCleanUp(); var config = { title: "Shader test suite", message: "The test suite is complete.\n\n\n" + "Your OpenGL renderer information is:\n" + "Vendor: β€œ" + debugConsole.glVendorString + "”\n" + "Renderer: β€œ" + debugConsole.glRendererString + "”\n\n" + "This information can also be found in the Oolite log." }; log("materialTest.complete", "Shader test suite complete."); debugConsole.writeLogMarker(); Mission.runScreen(config, function () {}); return; } } var passData = this.settingsByPass[this.passID]; // Create a dummy ship to extract its script_info. var modelName = passData.rolePrefix + testIndex; var ship = system.addShips(modelName, 1, system.sun.position, 10000)[0]; var testDesc = ship.scriptInfo["oolite_material_test_suite_label"]; ship.remove(); // Ensure environment is what we need - each time in case user tries to be clever. debugConsole.shaderMode = passData.shaderMode; debugConsole.displayFPS = true; debugConsole.debugFlags |= debugConsole.DEBUG_NO_SHADER_FALLBACK | debugConsole.DEBUG_SHADER_VALIDATION; // Actually run the test. var passNames = ["", "fixed-function", "simple", "full"]; var testLabel = passData.passName + ":" + testIndex; log("materialTest.runTest", "Running test " + testLabel + " (" + testDesc + ")."); var config = { model: modelName, title: "", message: "\n\n\n" + testLabel + "\n" + testDesc }; if (!Mission.runScreen(config, this.runNextTest, this)) { log("materialTest.error.missionScreenFailed", "The material test suite failed to run a mission screen."); this.performCleanUp(); return; } }
message: "\n\n\n" + testLabel + "\n" + testDesc,
message: "\n\n" + testLabel + "\n" + testDesc,
this.runNextTest = function () { var testIndex = this.nextTestIndex++; if (testIndex > this.settingsByPass[this.passID].maxIndex) { if (this.passID < this.maxPassID) { // Switch to next pass. this.passID++; this.nextTestIndex = 2; testIndex = 1; } else { // All passes have run, we're done. var shady = this.maxPassID == 1; this.performCleanUp(); var substitutions = { gl_vendor_string: debugConsole.glVendorString, gl_renderer_string: debugConsole.glRendererString, gl_tex_image_unit_count: debugConsole.glFragmentShaderTextureUnitCount }; var message = expandMissionText(shady ? "oolite_material_test_completion_no_shaders" : "oolite_material_test_completion_shaders", substitutions); log("materialTest.complete", "Shader test suite complete."); debugConsole.writeLogMarker(); mission.runScreen({ titleKey: "oolite_material_test_title", message: message }, function () {}); return; } } var passData = this.settingsByPass[this.passID]; // Create a dummy ship to extract its script_info. var modelName = passData.rolePrefix + testIndex; var ship = system.addShips(modelName, 1, system.sun.position, 10000)[0]; var testDesc = ship.scriptInfo["oolite_material_test_suite_label"]; ship.remove(); // Ensure environment is what we need - each time in case user tries to be clever. debugConsole.shaderMode = passData.shaderMode; debugConsole.debugFlags |= debugConsole.DEBUG_NO_SHADER_FALLBACK | debugConsole.DEBUG_SHADER_VALIDATION; // Actually run the test. var passNames = ["", "fixed-function", "simple", "full"]; var testLabel = passData.passName + ":" + testIndex; log("materialTest.runTest", "Running test " + testLabel + " (" + testDesc + ")."); var config = { model: modelName, title: "", message: "\n\n\n" + testLabel + "\n" + testDesc, background: "oolite_material_test_suite_backdrop.png" }; if (!mission.runScreen(config, this.runNextTest, this)) { log("materialTest.error.missionScreenFailed", "The material test suite failed to run a mission screen."); this.performCleanUp(); return; } }
var testIndex = this.nextTestIndex++; if (testIndex > this.testCount)
if (this.passID == 1)
this.runNextTest = function () { var testIndex = this.nextTestIndex++; if (testIndex > this.testCount) { if (this.passID == 1) { // Switch to next pass (full shader mode). this.passID = 2; this.nextTestIndex = 2; testIndex = 1; } else { // Both passes have run, we're done. this.performCleanUp(); var config = { title: "Shader test suite", message: "The test suite is complete.\n\n\n" + "Your OpenGL renderer information is:\n" + "Vendor: β€œ" + debugConsole.glVendorString + "”\n" + "Renderer: β€œ" + debugConsole.glRendererString + "”\n\n" + "This information can also be found in the Oolite log." }; log("shaderTest.complete", "Shader test suite complete."); debugConsole.writeLogMarker(); Mission.runScreen(config, function () {}); return; } } // Create a dummy ship to extract its script_info. var modelName = "oolite_shader_test_suite_" + testIndex; var ship = system.addShips(modelName, 1, system.sun.position, 10000)[0]; var testDesc = ship.scriptInfo["oolite_shader_test_suite_label"]; ship.remove(); // Ensure environment is what we need - each time in case user tries to be clever. debugConsole.shaderMode = this.passID == 1 ? "SHADERS_SIMPLE" : "SHADERS_FULL"; debugConsole.displayFPS = true; debugConsole.debugFlags |= debugConsole.DEBUG_NO_SHADER_FALLBACK; // Actually run the test. var testLabel = (this.passID == 1 ? "simple" : "full") + "-" + testIndex; log("shaderTest.runTest", "Running test " + testLabel + " (" + testDesc + ")."); var config = { model: modelName, title: "", message: "\n\n\n" + testLabel + "\n" + testDesc }; if (!Mission.runScreen(config, this.runNextTest, this)) { log("shaderTest.error.missionScreenFailed", "The shader test suite failed to run a mission screen."); this.performCleanUp(); return; } }
if (this.passID == 1)
this.passID = 2; this.nextTestIndex = 2; testIndex = 1; } else { this.performCleanUp(); var config =
this.runNextTest = function () { var testIndex = this.nextTestIndex++; if (testIndex > this.testCount) { if (this.passID == 1) { // Switch to next pass (full shader mode). this.passID = 2; this.nextTestIndex = 2; testIndex = 1; } else { // Both passes have run, we're done. this.performCleanUp(); var config = { title: "Shader test suite", message: "The test suite is complete.\n\n\n" + "Your OpenGL renderer information is:\n" + "Vendor: β€œ" + debugConsole.glVendorString + "”\n" + "Renderer: β€œ" + debugConsole.glRendererString + "”\n\n" + "This information can also be found in the Oolite log." }; log("shaderTest.complete", "Shader test suite complete."); debugConsole.writeLogMarker(); Mission.runScreen(config, function () {}); return; } } // Create a dummy ship to extract its script_info. var modelName = "oolite_shader_test_suite_" + testIndex; var ship = system.addShips(modelName, 1, system.sun.position, 10000)[0]; var testDesc = ship.scriptInfo["oolite_shader_test_suite_label"]; ship.remove(); // Ensure environment is what we need - each time in case user tries to be clever. debugConsole.shaderMode = this.passID == 1 ? "SHADERS_SIMPLE" : "SHADERS_FULL"; debugConsole.displayFPS = true; debugConsole.debugFlags |= debugConsole.DEBUG_NO_SHADER_FALLBACK; // Actually run the test. var testLabel = (this.passID == 1 ? "simple" : "full") + "-" + testIndex; log("shaderTest.runTest", "Running test " + testLabel + " (" + testDesc + ")."); var config = { model: modelName, title: "", message: "\n\n\n" + testLabel + "\n" + testDesc }; if (!Mission.runScreen(config, this.runNextTest, this)) { log("shaderTest.error.missionScreenFailed", "The shader test suite failed to run a mission screen."); this.performCleanUp(); return; } }
this.passID = 2; this.nextTestIndex = 2; testIndex = 1; } else { this.performCleanUp(); var config = { title: "Shader test suite", message: "The test suite is complete.\n\n\n" + "Your OpenGL renderer information is:\n" + "Vendor: β€œ" + debugConsole.glVendorString + "”\n" + "Renderer: β€œ" + debugConsole.glRendererString + "”\n\n" + "This information can also be found in the Oolite log." }; log("shaderTest.complete", "Shader test suite complete."); debugConsole.writeLogMarker(); Mission.runScreen(config, function () {}); return; } } var modelName = "oolite_shader_test_suite_" + testIndex; var ship = system.addShips(modelName, 1, system.sun.position, 10000)[0]; var testDesc = ship.scriptInfo["oolite_shader_test_suite_label"]; ship.remove(); debugConsole.shaderMode = this.passID == 1 ? "SHADERS_SIMPLE" : "SHADERS_FULL"; debugConsole.displayFPS = true; debugConsole.debugFlags |= debugConsole.DEBUG_NO_SHADER_FALLBACK; var testLabel = (this.passID == 1 ? "simple" : "full") + "-" + testIndex; log("shaderTest.runTest", "Running test " + testLabel + " (" + testDesc + ")."); var config = { model: modelName, title: "", message: "\n\n\n" + testLabel + "\n" + testDesc }; if (!Mission.runScreen(config, this.runNextTest, this)) { log("shaderTest.error.missionScreenFailed", "The shader test suite failed to run a mission screen."); this.performCleanUp();
title: "Shader test suite", message: "The test suite is complete.\n\n\n" + "Your OpenGL renderer information is:\n" + "Vendor: β€œ" + debugConsole.glVendorString + "”\n" + "Renderer: β€œ" + debugConsole.glRendererString + "”\n\n" + "This information can also be found in the Oolite log." }; log("shaderTest.complete", "Shader test suite complete."); debugConsole.writeLogMarker(); Mission.runScreen(config, function () {});
this.runNextTest = function () { var testIndex = this.nextTestIndex++; if (testIndex > this.testCount) { if (this.passID == 1) { // Switch to next pass (full shader mode). this.passID = 2; this.nextTestIndex = 2; testIndex = 1; } else { // Both passes have run, we're done. this.performCleanUp(); var config = { title: "Shader test suite", message: "The test suite is complete.\n\n\n" + "Your OpenGL renderer information is:\n" + "Vendor: β€œ" + debugConsole.glVendorString + "”\n" + "Renderer: β€œ" + debugConsole.glRendererString + "”\n\n" + "This information can also be found in the Oolite log." }; log("shaderTest.complete", "Shader test suite complete."); debugConsole.writeLogMarker(); Mission.runScreen(config, function () {}); return; } } // Create a dummy ship to extract its script_info. var modelName = "oolite_shader_test_suite_" + testIndex; var ship = system.addShips(modelName, 1, system.sun.position, 10000)[0]; var testDesc = ship.scriptInfo["oolite_shader_test_suite_label"]; ship.remove(); // Ensure environment is what we need - each time in case user tries to be clever. debugConsole.shaderMode = this.passID == 1 ? "SHADERS_SIMPLE" : "SHADERS_FULL"; debugConsole.displayFPS = true; debugConsole.debugFlags |= debugConsole.DEBUG_NO_SHADER_FALLBACK; // Actually run the test. var testLabel = (this.passID == 1 ? "simple" : "full") + "-" + testIndex; log("shaderTest.runTest", "Running test " + testLabel + " (" + testDesc + ")."); var config = { model: modelName, title: "", message: "\n\n\n" + testLabel + "\n" + testDesc }; if (!Mission.runScreen(config, this.runNextTest, this)) { log("shaderTest.error.missionScreenFailed", "The shader test suite failed to run a mission screen."); this.performCleanUp(); return; } }
var modelName = "oolite_shader_test_suite_" + testIndex; var ship = system.addShips(modelName, 1, system.sun.position, 10000)[0]; var testDesc = ship.scriptInfo["oolite_shader_test_suite_label"]; ship.remove(); debugConsole.shaderMode = this.passID == 1 ? "SHADERS_SIMPLE" : "SHADERS_FULL"; debugConsole.displayFPS = true; debugConsole.debugFlags |= debugConsole.DEBUG_NO_SHADER_FALLBACK; var testLabel = (this.passID == 1 ? "simple" : "full") + "-" + testIndex; log("shaderTest.runTest", "Running test " + testLabel + " (" + testDesc + ")."); var config = { model: modelName, title: "", message: "\n\n\n" + testLabel + "\n" + testDesc }; if (!Mission.runScreen(config, this.runNextTest, this)) { log("shaderTest.error.missionScreenFailed", "The shader test suite failed to run a mission screen."); this.performCleanUp(); return; } }
this.runNextTest = function () { var testIndex = this.nextTestIndex++; if (testIndex > this.testCount) { if (this.passID == 1) { // Switch to next pass (full shader mode). this.passID = 2; this.nextTestIndex = 2; testIndex = 1; } else { // Both passes have run, we're done. this.performCleanUp(); var config = { title: "Shader test suite", message: "The test suite is complete.\n\n\n" + "Your OpenGL renderer information is:\n" + "Vendor: β€œ" + debugConsole.glVendorString + "”\n" + "Renderer: β€œ" + debugConsole.glRendererString + "”\n\n" + "This information can also be found in the Oolite log." }; log("shaderTest.complete", "Shader test suite complete."); debugConsole.writeLogMarker(); Mission.runScreen(config, function () {}); return; } } // Create a dummy ship to extract its script_info. var modelName = "oolite_shader_test_suite_" + testIndex; var ship = system.addShips(modelName, 1, system.sun.position, 10000)[0]; var testDesc = ship.scriptInfo["oolite_shader_test_suite_label"]; ship.remove(); // Ensure environment is what we need - each time in case user tries to be clever. debugConsole.shaderMode = this.passID == 1 ? "SHADERS_SIMPLE" : "SHADERS_FULL"; debugConsole.displayFPS = true; debugConsole.debugFlags |= debugConsole.DEBUG_NO_SHADER_FALLBACK; // Actually run the test. var testLabel = (this.passID == 1 ? "simple" : "full") + "-" + testIndex; log("shaderTest.runTest", "Running test " + testLabel + " (" + testDesc + ")."); var config = { model: modelName, title: "", message: "\n\n\n" + testLabel + "\n" + testDesc }; if (!Mission.runScreen(config, this.runNextTest, this)) { log("shaderTest.error.missionScreenFailed", "The shader test suite failed to run a mission screen."); this.performCleanUp(); return; } }
var maxPass = this.shadersSupported ? 3 : 1; if (this.passID < maxPass)
if (this.passID < this.maxPassID)
this.runNextTest = function () { var testIndex = this.nextTestIndex++; if (testIndex > this.settingsByPass[this.passID].maxIndex) { var maxPass = this.shadersSupported ? 3 : 1; if (this.passID < maxPass) { // Switch to next pass. this.passID++; this.nextTestIndex = 2; testIndex = 1; } else { // All passes have run, we're done. this.performCleanUp(); var config = { title: "Shader test suite", message: "The test suite is complete.\n\n\n" + "Your OpenGL renderer information is:\n" + "Vendor: β€œ" + debugConsole.glVendorString + "”\n" + "Renderer: β€œ" + debugConsole.glRendererString + "”\n\n" + "This information can also be found in the Oolite log." }; log("materialTest.complete", "Shader test suite complete."); debugConsole.writeLogMarker(); Mission.runScreen(config, function () {}); return; } } var passData = this.settingsByPass[this.passID]; // Create a dummy ship to extract its script_info. var modelName = passData.rolePrefix + testIndex; var ship = system.addShips(modelName, 1, system.sun.position, 10000)[0]; var testDesc = ship.scriptInfo["oolite_material_test_suite_label"]; ship.remove(); // Ensure environment is what we need - each time in case user tries to be clever. debugConsole.shaderMode = passData.shaderMode; debugConsole.displayFPS = true; debugConsole.debugFlags |= debugConsole.DEBUG_NO_SHADER_FALLBACK | debugConsole.DEBUG_SHADER_VALIDATION; // Actually run the test. var passNames = ["", "fixed-function", "simple", "full"]; var testLabel = passData.passName + ":" + testIndex; log("materialTest.runTest", "Running test " + testLabel + " (" + testDesc + ")."); var config = { model: modelName, title: "", message: "\n\n\n" + testLabel + "\n" + testDesc }; if (!Mission.runScreen(config, this.runNextTest, this)) { log("materialTest.error.missionScreenFailed", "The material test suite failed to run a mission screen."); this.performCleanUp(); return; } }
debugConsole.debugFlags |= debugConsole.DEBUG_NO_SHADER_FALLBACK;
this.runNextTest = function () { var testIndex = this.nextTestIndex++; if (testIndex > this.testCount) { if (this.passID == 1) { // Switch to next pass (full shader mode). this.passID = 2; this.nextTestIndex = 2; testIndex = 1; } else { // Both passes have run, we're done. this.performCleanUp(); var config = { title: "Shader test suite", message: "The test suite is complete.\n\n\n" + "Your OpenGL renderer information is:\n" + "Vendor: β€œ" + debugConsole.glVendorString + "”\n" + "Renderer: β€œ" + debugConsole.glRendererString + "”\n\n" + "This information can also be found in the Oolite log." }; debugConsole.writeLogMarker(); Mission.runScreen(config, function () {}); return; } } // Create a dummy ship to extract its script_info. var modelName = "oolite_shader_test_suite_" + testIndex; var ship = system.addShips(modelName, 1, system.sun.position, 10000)[0]; var testDesc = ship.scriptInfo["oolite_shader_test_suite_label"]; ship.remove(); // Actually run the test. debugConsole.shaderMode = this.passID == 1 ? "SHADERS_SIMPLE" : "SHADERS_FULL"; debugConsole.displayFPS = true; var testLabel = (this.passID == 1 ? "simple" : "full") + "-" + testIndex; log("shaderTest.runTest", "Running test " + testLabel + " (" + testDesc + ")."); var config = { model: modelName, title: "", message: "\n\n\n" + testLabel + "\n" + testDesc }; if (!Mission.runScreen(config, this.runNextTest, this)) { log("shaderTest.error.missionScreenFailed", "The shader test suite failed to run a mission screen."); this.performCleanUp(); return; } }
var autocomplete = YAHOO.util.Dom.get(staticDynamic + "-autocomplete"); var lis = autocomplete.getElementsByTagName("li");
var autocompleteDiv = YAHOO.util.Dom.get(staticDynamic + "-autocomplete"); var autocompleteSuggestions = YAHOO.util.Dom.getElementsByClassName("fr-autocomplete-yui-div", null, autocompleteDiv)[0]; var lis = autocompleteSuggestions.getElementsByTagName("li");
runOnLis: function(staticDynamic, f) { var autocomplete = YAHOO.util.Dom.get(staticDynamic + "-autocomplete"); var lis = autocomplete.getElementsByTagName("li"); for (liIndex = 0; liIndex < lis.length; liIndex++) { var li = lis[liIndex]; if (li.style.display != "none") f.call(this, li); } },
if (!player.ship.docked) { debugConsole.consoleMessage("command-error", "You must be docked to run the shader test suite."); return; } if (!Mission.runScreen({ title: "Shader test suite", messageKey: "oolite_shader_test_confirmation", choicesKey: "oolite_shader_test_confirmation_choices" }, this.startTest, this)) { log("shaderTest.error.missionScreenFailed", "The shader test suite failed to run a mission screen."); return; }
debugConsole.consoleMessage("command-error", "You must be docked to run the shader test suite."); return;
this.runShaderTestSuite = function () { if (!player.ship.docked) { debugConsole.consoleMessage("command-error", "You must be docked to run the shader test suite."); return; } // Show instruction/confirmation screen. if (!Mission.runScreen({ title: "Shader test suite", messageKey: "oolite_shader_test_confirmation", choicesKey: "oolite_shader_test_confirmation_choices" }, this.startTest, this)) { log("shaderTest.error.missionScreenFailed", "The shader test suite failed to run a mission screen."); return; } }
if (!Mission.runScreen({ title: "Shader test suite", messageKey: "oolite_shader_test_confirmation", choicesKey: "oolite_shader_test_confirmation_choices" }, this.startTest, this)) { log("shaderTest.error.missionScreenFailed", "The shader test suite failed to run a mission screen."); return; } }
this.runShaderTestSuite = function () { if (!player.ship.docked) { debugConsole.consoleMessage("command-error", "You must be docked to run the shader test suite."); return; } // Show instruction/confirmation screen. if (!Mission.runScreen({ title: "Shader test suite", messageKey: "oolite_shader_test_confirmation", choicesKey: "oolite_shader_test_confirmation_choices" }, this.startTest, this)) { log("shaderTest.error.missionScreenFailed", "The shader test suite failed to run a mission screen."); return; } }
FBTest.loadScript("FBTestFireformat.js", this);
function runTest() { FBTest.loadScript("FBTestFireformat.js", this); var prefs = new FBTestFireformat.PrefHandler([ "fireformatHtmlFormatter.wrapSize" ]); var formatter = Format.Formatters.getFormatter("com.incaseofstairs.fireformatHTMLFormatter"), xmlDoc = document.implementation.createDocument(null, "", null), content = "test\nValue"; function getText(el) { var fragment = xmlDoc.createDocumentFragment(); fragment.appendChild(xmlDoc.createTextNode("offset")); fragment.appendChild(el); return formatter.format(fragment).replace(/^offset/, ""); } // Test text node output with a few sample entities prefs.setPrefs(80); FBTest.compare(content, getText(document.createTextNode(content)), "TextNode nowrap"); prefs.setPrefs(1); FBTest.compare(content, getText(document.createTextNode(content)), "TextNode wrap"); // Test comment node output with a few sample entities prefs.setPrefs(80); FBTest.compare("<!--" + content + "-->", getText(document.createComment(content)), "Comment nowrap"); prefs.setPrefs(1); FBTest.compare("<!--" + content + "-->", getText(document.createComment(content)), "Comment wrap"); // Test CDATA output with a few sample entities prefs.setPrefs(80); FBTest.compare("<![CDATA[" + content + "]]>", getText(xmlDoc.createCDATASection(content)), "CDATA entities nowrap"); prefs.setPrefs(1); FBTest.compare("<![CDATA[" + content + "]]>", getText(xmlDoc.createCDATASection(content)), "CDATA entities wrap"); FBTest.testDone();}
FBTest.loadScript("FBTestFireformat.js", this);
function runTest() { FBTest.loadScript("FBTestFireformat.js", this); var prefs = new FBTestFireformat.PrefHandler([ "fireformatCssFormatter.wrapSize", "fireformatCssFormatter.selectorText.selectorsPerLine", "fireformatCssFormatter.selectorText.spaceCount", "fireformatCssFormatter.selectorText.indentLevel" ]); var formatter = Format.Formatters.getFormatter("com.incaseofstairs.fireformatCSSFormatter"); function getStyle(selectorText) { var style = { type: CSSRule.STYLE_RULE, selectorText: selectorText, style: { cssText: "" } }; return formatter.format(style).replace(/\s*\{[\S\s]*?\}[\S\s]*/, ""); } function getMultipleStyle() { var style = { cssRules: [ { type: CSSRule.STYLE_RULE, selectorText: ".single", style: { cssText: "" } }, { type: CSSRule.STYLE_RULE, selectorText: ".single[name] > DIV.test + *, .double:focus, .triple#myid", style: { cssText: "" } } ] }; return formatter.format(style).replace(/\s*\{[\S\s]*?\}\s*/g, "|"); } // Formatting with a single token FBTest.compare(".single", getStyle(".single"), "Single Token"); // Formatting with multiple tokens, no wrap prefs.setPrefs(80, 3, 1, 0); FBTest.compare(".single, .double, .triple", getStyle(".single, .double, .triple"), "Formatting with multiple tokens, no wrap"); // Formatting with multiple tokens, token wrap, no indent prefs.setPrefs(80, 2, 1, 0); FBTest.compare(".single, .double,\n.triple", getStyle(".single, .double, .triple"), "Formatting with multiple tokens, token wrap, no indent"); // Formatting with multiple tokens, token wrap, indent prefs.setPrefs(80, 2, 2, 1); FBTest.compare(".single, .double,\n .triple", getStyle(".single, .double, .triple"), "Formatting with multiple tokens, token wrap, indent"); // Formatting with multiple tokens, char wrap, no indent prefs.setPrefs(10, 3, 1, 0); FBTest.compare(".single, .double,\n.triple", getStyle(".single, .double, .triple"), "Formatting with multiple tokens, char wrap, no indent"); // Formatting with multiple tokens, char wrap, indent prefs.setPrefs(11, 3, 2, 1); FBTest.compare(".single, .double,\n .triple", getStyle(".single, .double, .triple"), "Formatting with multiple tokens, char wrap, indent"); // Formatting with advanced selectors, token wrap, indent prefs.setPrefs(80, 2, 1, 1); FBTest.compare(".single[name] > DIV.test + *, .double:focus,\n .triple#myid", getStyle(".single[name] > DIV.test + *, .double:focus, .triple#myid"), "Formatting with advanced selectors, token wrap, indent"); // Formatting with advanced selectors, char wrap, indent prefs.setPrefs(10, 3, 2, 1); FBTest.compare(".single[name] > DIV.test + *,\n .double:focus,\n .triple#myid", getStyle(".single[name] > DIV.test + *, .double:focus, .triple#myid"), "Formatting with advanced selectors, char wrap, indent"); // Formatting with multiple rules, token wrap prefs.setPrefs(80, 2, 1, 1); FBTest.compare(".single|.single[name] > DIV.test + *, .double:focus,\n .triple#myid|", getMultipleStyle(), "Formatting with multiple rules, token wrap"); // Formatting with comma strings in the selector prefs.setPrefs(10, 1, 1, 1); FBTest.compare(".single[test=\"fail, fail\"] > DIV.test + *,\n .double:focus,\n .triple#myid", getStyle(".single[test=\"fail, fail\"] > DIV.test + *, .double:focus, .triple#myid"), "Comma selector string 1"); FBTest.compare(".single[test=\'fail, fail\'] > DIV.test + *,\n .double:focus,\n .triple#myid", getStyle(".single[test=\'fail, fail\'] > DIV.test + *, .double:focus, .triple#myid"), "Comma selector string 2"); prefs.reset(); FBTest.testDone();}
FBTest.compare(" attr1 = \"attr1 value\"", getAttr(htmlElement), "HTML Attr Default, Wrap");
FBTest.compare("\n attr1 = \"attr1 value\"", getAttr(htmlElement), "HTML Attr Default, Wrap");
function runTest() { FBTest.loadScript("FBTestFireformat.js", this); var prefs = new FBTestFireformat.PrefHandler([ "fireformatHtmlFormatter.attribute.attrsPerLine", "fireformatHtmlFormatter.attribute.indentLevel", "fireformatHtmlFormatter.attribute.listSeparator", "fireformatHtmlFormatter.attribute.separatorBeforeEquals", "fireformatHtmlFormatter.attribute.separatorBeforeValue", "fireformatHtmlFormatter.wrapSize" ]); var formatter = Format.Formatters.getFormatter("com.incaseofstairs.fireformatHTMLFormatter"); function getAttr(el) { var text = formatter.format(el); return text.replace(/<\S+\s([\s\S]*?)(?: \/)?>.*/, "$1"); } // One attribute var htmlElement = document.createElement("div"); htmlElement.setAttribute("attr1", "attr1 value"); prefs.setPrefs(5, 1, " ", "", ""); FBTest.compare("attr1=\"attr1 value\"", getAttr(htmlElement), "HTML Attr Default"); prefs.setPrefs(5, 1, " ", " ", " "); FBTest.compare("attr1 = \"attr1 value\"", getAttr(htmlElement), "HTML Attr Default, Space Sep"); prefs.setPrefs(5, 1, " ", "\n", "\n"); FBTest.compare("attr1\n =\n \"attr1 value\"", getAttr(htmlElement), "HTML Attr Default, Newline Sep"); prefs.setPrefs(5, 0, " ", "\n", "\n"); FBTest.compare("attr1\n=\n\"attr1 value\"", getAttr(htmlElement), "HTML Attr Default, Newline Sep No indent"); prefs.setPrefs(5, 2, " ", "\n", "\n"); FBTest.compare("attr1\n =\n \"attr1 value\"", getAttr(htmlElement), "HTML Attr Default, Newline Sep Extra indent"); prefs.setPrefs(5, 1, " ", " ", " ", 1); FBTest.compare(" attr1 = \"attr1 value\"", getAttr(htmlElement), "HTML Attr Default, Wrap"); // Multiple attributes htmlElement.setAttribute("attr2", "attr2 value"); prefs.setPrefs(5, 1, " ", "", ""); FBTest.compare("attr1=\"attr1 value\" attr2=\"attr2 value\"", getAttr(htmlElement), "HTML Multiple Attr"); prefs.setPrefs(5, 1, "\n", "", ""); FBTest.compare(" attr1=\"attr1 value\"\n attr2=\"attr2 value\"", getAttr(htmlElement), "HTML Multiple Attr Newline"); prefs.setPrefs(5, 0, "\n", "", ""); FBTest.compare("attr1=\"attr1 value\"\nattr2=\"attr2 value\"", getAttr(htmlElement), "HTML Multiple Attr No Indent"); prefs.setPrefs(5, 2, "\n", "", ""); FBTest.compare(" attr1=\"attr1 value\"\n attr2=\"attr2 value\"", getAttr(htmlElement), "HTML Multiple Attr, Multiple Indent"); prefs.setPrefs(1, 1, " ", "", ""); FBTest.compare("attr1=\"attr1 value\"\n attr2=\"attr2 value\"", getAttr(htmlElement), "HTML Multiple Attr, Token Wrap"); prefs.setPrefs(5, 1, " ", " ", " ", 1); FBTest.compare(" attr1 = \"attr1 value\"\n attr2 = \"attr2 value\"", getAttr(htmlElement), "HTML Multiple Default, Char Wrap"); // Attr with newline embedded htmlElement.setAttribute("newLine", "new\nline"); prefs.setPrefs(5, 1, " ", "", ""); FBTest.compare("attr1=\"attr1 value\" attr2=\"attr2 value\" newline=\"new\nline\"", getAttr(htmlElement), "HTML New Line Attr"); // XHTML Case test var xmlDoc = document.implementation.createDocument(null, "", null); htmlElement = xmlDoc.createElementNS("http://www.w3.org/1999/xhtml", "input"); htmlElement.setAttribute("newLine", "test"); prefs.setPrefs(5, 1, " ", "", ""); FBTest.compare("newLine=\"test\"", getAttr(htmlElement), "XHTML Attr"); prefs.reset(); FBTest.testDone();}
FBTest.compare(" attr1 = \"attr1 value\"\n attr2 = \"attr2 value\"", getAttr(htmlElement), "HTML Multiple Default, Char Wrap");
FBTest.compare("\n attr1 = \"attr1 value\"\n attr2 = \"attr2 value\"", getAttr(htmlElement), "HTML Multiple Default, Char Wrap");
function runTest() { FBTest.loadScript("FBTestFireformat.js", this); var prefs = new FBTestFireformat.PrefHandler([ "fireformatHtmlFormatter.attribute.attrsPerLine", "fireformatHtmlFormatter.attribute.indentLevel", "fireformatHtmlFormatter.attribute.listSeparator", "fireformatHtmlFormatter.attribute.separatorBeforeEquals", "fireformatHtmlFormatter.attribute.separatorBeforeValue", "fireformatHtmlFormatter.wrapSize" ]); var formatter = Format.Formatters.getFormatter("com.incaseofstairs.fireformatHTMLFormatter"); function getAttr(el) { var text = formatter.format(el); return text.replace(/<\S+\s([\s\S]*?)(?: \/)?>.*/, "$1"); } // One attribute var htmlElement = document.createElement("div"); htmlElement.setAttribute("attr1", "attr1 value"); prefs.setPrefs(5, 1, " ", "", ""); FBTest.compare("attr1=\"attr1 value\"", getAttr(htmlElement), "HTML Attr Default"); prefs.setPrefs(5, 1, " ", " ", " "); FBTest.compare("attr1 = \"attr1 value\"", getAttr(htmlElement), "HTML Attr Default, Space Sep"); prefs.setPrefs(5, 1, " ", "\n", "\n"); FBTest.compare("attr1\n =\n \"attr1 value\"", getAttr(htmlElement), "HTML Attr Default, Newline Sep"); prefs.setPrefs(5, 0, " ", "\n", "\n"); FBTest.compare("attr1\n=\n\"attr1 value\"", getAttr(htmlElement), "HTML Attr Default, Newline Sep No indent"); prefs.setPrefs(5, 2, " ", "\n", "\n"); FBTest.compare("attr1\n =\n \"attr1 value\"", getAttr(htmlElement), "HTML Attr Default, Newline Sep Extra indent"); prefs.setPrefs(5, 1, " ", " ", " ", 1); FBTest.compare(" attr1 = \"attr1 value\"", getAttr(htmlElement), "HTML Attr Default, Wrap"); // Multiple attributes htmlElement.setAttribute("attr2", "attr2 value"); prefs.setPrefs(5, 1, " ", "", ""); FBTest.compare("attr1=\"attr1 value\" attr2=\"attr2 value\"", getAttr(htmlElement), "HTML Multiple Attr"); prefs.setPrefs(5, 1, "\n", "", ""); FBTest.compare(" attr1=\"attr1 value\"\n attr2=\"attr2 value\"", getAttr(htmlElement), "HTML Multiple Attr Newline"); prefs.setPrefs(5, 0, "\n", "", ""); FBTest.compare("attr1=\"attr1 value\"\nattr2=\"attr2 value\"", getAttr(htmlElement), "HTML Multiple Attr No Indent"); prefs.setPrefs(5, 2, "\n", "", ""); FBTest.compare(" attr1=\"attr1 value\"\n attr2=\"attr2 value\"", getAttr(htmlElement), "HTML Multiple Attr, Multiple Indent"); prefs.setPrefs(1, 1, " ", "", ""); FBTest.compare("attr1=\"attr1 value\"\n attr2=\"attr2 value\"", getAttr(htmlElement), "HTML Multiple Attr, Token Wrap"); prefs.setPrefs(5, 1, " ", " ", " ", 1); FBTest.compare(" attr1 = \"attr1 value\"\n attr2 = \"attr2 value\"", getAttr(htmlElement), "HTML Multiple Default, Char Wrap"); // Attr with newline embedded htmlElement.setAttribute("newLine", "new\nline"); prefs.setPrefs(5, 1, " ", "", ""); FBTest.compare("attr1=\"attr1 value\" attr2=\"attr2 value\" newline=\"new\nline\"", getAttr(htmlElement), "HTML New Line Attr"); // XHTML Case test var xmlDoc = document.implementation.createDocument(null, "", null); htmlElement = xmlDoc.createElementNS("http://www.w3.org/1999/xhtml", "input"); htmlElement.setAttribute("newLine", "test"); prefs.setPrefs(5, 1, " ", "", ""); FBTest.compare("newLine=\"test\"", getAttr(htmlElement), "XHTML Attr"); prefs.reset(); FBTest.testDone();}
FBTest.loadScript("FBTestFireformat.js", this);
function runTest() { FBTest.loadScript("FBTestFireformat.js", this); var prefs = new FBTestFireformat.PrefHandler([ "fireformatHtmlFormatter.attribute.attrsPerLine", "fireformatHtmlFormatter.attribute.indentLevel", "fireformatHtmlFormatter.attribute.listSeparator", "fireformatHtmlFormatter.attribute.separatorBeforeEquals", "fireformatHtmlFormatter.attribute.separatorBeforeValue", "fireformatHtmlFormatter.wrapSize" ]); var formatter = Format.Formatters.getFormatter("com.incaseofstairs.fireformatHTMLFormatter"); function getAttr(el) { var text = formatter.format(el); return text.replace(/<\S+\s([\s\S]*?)(?: \/)?>.*/, "$1"); } // One attribute var htmlElement = document.createElement("div"); htmlElement.setAttribute("attr1", "attr1 value"); prefs.setPrefs(5, 1, " ", "", ""); FBTest.compare("attr1=\"attr1 value\"", getAttr(htmlElement), "HTML Attr Default"); prefs.setPrefs(5, 1, " ", " ", " "); FBTest.compare("attr1 = \"attr1 value\"", getAttr(htmlElement), "HTML Attr Default, Space Sep"); prefs.setPrefs(5, 1, " ", "\n", "\n"); FBTest.compare("attr1\n =\n \"attr1 value\"", getAttr(htmlElement), "HTML Attr Default, Newline Sep"); prefs.setPrefs(5, 0, " ", "\n", "\n"); FBTest.compare("attr1\n=\n\"attr1 value\"", getAttr(htmlElement), "HTML Attr Default, Newline Sep No indent"); prefs.setPrefs(5, 2, " ", "\n", "\n"); FBTest.compare("attr1\n =\n \"attr1 value\"", getAttr(htmlElement), "HTML Attr Default, Newline Sep Extra indent"); prefs.setPrefs(5, 1, " ", " ", " ", 1); FBTest.compare("\n attr1 = \"attr1 value\"", getAttr(htmlElement), "HTML Attr Default, Wrap"); // Multiple attributes htmlElement.setAttribute("attr2", "attr2 value"); prefs.setPrefs(5, 1, " ", "", ""); FBTest.compare("attr1=\"attr1 value\" attr2=\"attr2 value\"", getAttr(htmlElement), "HTML Multiple Attr"); prefs.setPrefs(5, 1, "\n", "", ""); FBTest.compare("attr1=\"attr1 value\"\n attr2=\"attr2 value\"", getAttr(htmlElement), "HTML Multiple Attr Newline"); prefs.setPrefs(5, 0, "\n", "", ""); FBTest.compare("attr1=\"attr1 value\"\nattr2=\"attr2 value\"", getAttr(htmlElement), "HTML Multiple Attr No Indent"); prefs.setPrefs(5, 2, "\n", "", ""); FBTest.compare("attr1=\"attr1 value\"\n attr2=\"attr2 value\"", getAttr(htmlElement), "HTML Multiple Attr, Multiple Indent"); prefs.setPrefs(1, 1, " ", "", ""); FBTest.compare("attr1=\"attr1 value\"\n attr2=\"attr2 value\"", getAttr(htmlElement), "HTML Multiple Attr, Token Wrap"); prefs.setPrefs(5, 1, " ", " ", " ", 1); FBTest.compare("\n attr1 = \"attr1 value\"\n attr2 = \"attr2 value\"", getAttr(htmlElement), "HTML Multiple Default, Char Wrap"); // Attr with newline embedded htmlElement.setAttribute("newLine", "new\nline"); prefs.setPrefs(5, 1, " ", "", ""); FBTest.compare("attr1=\"attr1 value\" attr2=\"attr2 value\" newline=\"new\nline\"", getAttr(htmlElement), "HTML New Line Attr"); // XHTML Case test var xmlDoc = document.implementation.createDocument(null, "", null); htmlElement = xmlDoc.createElementNS("http://www.w3.org/1999/xhtml", "input"); htmlElement.setAttribute("newLine", "test"); prefs.setPrefs(5, 1, " ", "", ""); FBTest.compare("newLine=\"test\"", getAttr(htmlElement), "XHTML Attr"); prefs.reset(); FBTest.testDone();}
FBTest.loadScript("FBTestFireformat.js", this);
function runTest() { FBTest.loadScript("FBTestFireformat.js", this); var prefs = new FBTestFireformat.PrefHandler([ "fireformatHtmlFormatter.element.htmlNameToLower", "fireformatHtmlFormatter.element.separatorBeforeAttributes", "fireformatHtmlFormatter.element.separatorBeforeClose", "fireformatHtmlFormatter.element.separatorBeforeSelfClose", "fireformatHtmlFormatter.wrapSize" ]); var formatter = Format.Formatters.getFormatter("com.incaseofstairs.fireformatHTMLFormatter"); // HTML Element Tests var htmlElement = document.createElement("div"); prefs.setPrefs(true, " ", "", " "); FBTest.compare("<div></div>", formatter.format(htmlElement), "HTML Element no attr, Spaces"); prefs.setPrefs(true, "\n", "", " "); FBTest.compare("<div></div>", formatter.format(htmlElement), "HTML Element no attr, Spaces"); prefs.setPrefs(true, "\n", " ", " "); FBTest.compare("<div ></div>", formatter.format(htmlElement), "HTML Element no attr, Newline Spaces"); prefs.setPrefs(true, " ", "", " ", 1); FBTest.compare("<div></div>", formatter.format(htmlElement), "HTML Element no attr, Spaces, wrap"); prefs.setPrefs(true, "\n", "", " ", 1); FBTest.compare("<div></div>", formatter.format(htmlElement), "HTML Element no attr, Spaces, wrap"); prefs.setPrefs(true, "\n", " ", " ", 1); FBTest.compare("<div ></div>", formatter.format(htmlElement), "HTML Element no attr, Newline Spaces, wrap"); htmlElement.setAttribute("class", "test value"); prefs.setPrefs(true, " ", "", " "); FBTest.compare("<div class=\"test value\"></div>", formatter.format(htmlElement), "HTML Element, Spaces"); prefs.setPrefs(true, "", "", " "); FBTest.compare("<divclass=\"test value\"></div>", formatter.format(htmlElement), "HTML Element, Spaces"); prefs.setPrefs(true, "\n", "", " "); FBTest.compare("<div\n class=\"test value\"></div>", formatter.format(htmlElement), "HTML Element, Spaces"); prefs.setPrefs(true, "\n", " ", " "); FBTest.compare("<div\n class=\"test value\" ></div>", formatter.format(htmlElement), "HTML Element, Newline Spaces"); prefs.setPrefs(true, " ", "", " ", 1); FBTest.compare("<div \n class=\"test value\"></div>", formatter.format(htmlElement), "HTML Element, Spaces wrap"); prefs.setPrefs(true, "\n", "", " ", 1); FBTest.compare("<div\n class=\"test value\"></div>", formatter.format(htmlElement), "HTML Element, Spaces wrap"); prefs.setPrefs(true, "\n", " ", " ", 1); FBTest.compare("<div\n class=\"test value\" ></div>", formatter.format(htmlElement), "HTML Element, Newline Spaces wrap"); htmlElement.appendChild(document.createTextNode("\n ")); var childElement = document.createElement("br"); htmlElement.appendChild(childElement); prefs.setPrefs(false, "", "", ""); FBTest.compare("<DIVclass=\"test value\">\n <BR></DIV>", formatter.format(htmlElement), "Child HTML Element, Spaces Upper"); prefs.setPrefs(true, "", "", ""); FBTest.compare("<divclass=\"test value\">\n <br></div>", formatter.format(htmlElement), "Child HTML Element, Spaces"); prefs.setPrefs(true, "\n", "", " "); FBTest.compare("<div\n class=\"test value\">\n <br></div>", formatter.format(htmlElement), "Child HTML Element, Spaces"); prefs.setPrefs(true, "\n", " ", " "); FBTest.compare("<div\n class=\"test value\" >\n <br ></div>", formatter.format(htmlElement), "Child HTML Element, Newline Spaces"); prefs.setPrefs(true, "\n", "\n", "\n"); FBTest.compare("<div\n class=\"test value\"\n>\n <br\n ></div>", formatter.format(htmlElement), "Child HTML Element, Newline"); prefs.setPrefs(true, "", "", "", 1); FBTest.compare("<div\n class=\"test value\">\n <br></div>", formatter.format(htmlElement), "Child HTML Element, Spaces, wrap"); prefs.setPrefs(true, "\n", "", " ", 1); FBTest.compare("<div\n class=\"test value\">\n <br></div>", formatter.format(htmlElement), "Child HTML Element, Spaces, wrap"); prefs.setPrefs(true, "\n", " ", " ", 1); FBTest.compare("<div\n class=\"test value\" >\n <br ></div>", formatter.format(htmlElement), "Child HTML Element, Newline Spaces, wrap"); // Void HTML Element htmlElement = document.createElement("input"); htmlElement.setAttribute("class", "test"); prefs.setPrefs(true, "", "", ""); FBTest.compare("<inputclass=\"test\">", formatter.format(htmlElement), "Void HTML Element, Spaces"); prefs.setPrefs(true, "\n", "", ""); FBTest.compare("<input\n class=\"test\">", formatter.format(htmlElement), "Void HTML Element, Spaces"); prefs.setPrefs(true, "\n", " ", " "); FBTest.compare("<input\n class=\"test\" >", formatter.format(htmlElement), "Void HTML Element, Newline Spaces"); prefs.setPrefs(false, "", "", ""); FBTest.compare("<INPUTclass=\"test\">", formatter.format(htmlElement), "Void HTML Element, Spaces"); prefs.setPrefs(false, "\n", "", ""); FBTest.compare("<INPUT\n class=\"test\">", formatter.format(htmlElement), "Void HTML Element, Spaces"); prefs.setPrefs(false, "\n", " ", " "); FBTest.compare("<INPUT\n class=\"test\" >", formatter.format(htmlElement), "Void HTML Element, Newline Spaces"); // TODO : No attribute test, for non-void // XHTML Element Tests var xmlDoc = document.implementation.createDocument(null, "", null); var htmlElement = xmlDoc.createElementNS("http://www.w3.org/1999/xhtml", "div"); prefs.setPrefs(true, " ", "", " "); FBTest.compare("<div />", formatter.format(htmlElement), "XHTML Element no attr, Spaces"); prefs.setPrefs(true, "\n", "", ""); FBTest.compare("<div/>", formatter.format(htmlElement), "XHTML Element no attr, No Space"); prefs.setPrefs(true, "\n", "", "\n"); FBTest.compare("<div\n/>", formatter.format(htmlElement), "XHTML Element no attr, Newline"); htmlElement.setAttribute("class", "test value"); prefs.setPrefs(true, "", "", " "); FBTest.compare("<divclass=\"test value\" />", formatter.format(htmlElement), "XHTML Element, Spaces"); prefs.setPrefs(true, " ", "", " "); FBTest.compare("<div class=\"test value\" />", formatter.format(htmlElement), "XHTML Element, Spaces"); prefs.setPrefs(true, "\n", "", ""); FBTest.compare("<div\n class=\"test value\"/>", formatter.format(htmlElement), "XHTML Element, Spaces"); prefs.setPrefs(true, "\n", " ", "\n"); FBTest.compare("<div\n class=\"test value\"\n/>", formatter.format(htmlElement), "XHTML Element, Newline Spaces"); prefs.setPrefs(true, " ", "", " ", 1); FBTest.compare("<div \n class=\"test value\" />", formatter.format(htmlElement), "XHTML Element, Spaces, Wrap"); prefs.setPrefs(true, "\n", "", "", 1); FBTest.compare("<div\n class=\"test value\"/>", formatter.format(htmlElement), "XHTML Element, Spaces, Wrap"); prefs.setPrefs(true, "\n", " ", "\n", 1); FBTest.compare("<div\n class=\"test value\"\n/>", formatter.format(htmlElement), "XHTML Element, Newline Spaces, Wrap"); htmlElement.appendChild(document.createTextNode("\n ")); var childElement = xmlDoc.createElementNS("http://www.w3.org/1999/xhtml", "br"); childElement.setAttribute("class", "something"); htmlElement.appendChild(childElement); prefs.setPrefs(true, "", "", ""); FBTest.compare("<divclass=\"test value\">\n <brclass=\"something\"/></div>", formatter.format(htmlElement), "Child XHTML Element, Spaces Upper"); prefs.setPrefs(true, " ", "", ""); FBTest.compare("<div class=\"test value\">\n <br class=\"something\"/></div>", formatter.format(htmlElement), "Child XHTML Element, Spaces"); prefs.setPrefs(true, "\n", "", " "); FBTest.compare("<div\n class=\"test value\">\n <br\n class=\"something\" /></div>", formatter.format(htmlElement), "Child XHTML Element, Spaces"); prefs.setPrefs(true, "\n", " ", " "); FBTest.compare("<div\n class=\"test value\" >\n <br\n class=\"something\" /></div>", formatter.format(htmlElement), "Child XHTML Element, Newline Spaces"); // TODO : How should indent be handled for the child close? prefs.setPrefs(true, "\n", "\n", "\n"); FBTest.compare("<div\n class=\"test value\"\n>\n <br\n class=\"something\"\n /></div>", formatter.format(htmlElement), "Child XHTML Element, Newline"); // Void HTML Element htmlElement = xmlDoc.createElementNS("http://www.w3.org/1999/xhtml", "input"); htmlElement.setAttribute("class", "test"); prefs.setPrefs(true, " ", "", ""); FBTest.compare("<input class=\"test\"/>", formatter.format(htmlElement), "Void XHTML Element, Spaces"); prefs.setPrefs(true, "\n", "", " "); FBTest.compare("<input\n class=\"test\" />", formatter.format(htmlElement), "Void XHTML Element, Spaces"); prefs.setPrefs(true, "\n", "", "\n"); FBTest.compare("<input\n class=\"test\"\n/>", formatter.format(htmlElement), "Void XHTML Element, Newline Spaces"); prefs.setPrefs(false, " ", "", ""); FBTest.compare("<input class=\"test\"/>", formatter.format(htmlElement), "Void XHTML Element, Spaces"); // TODO : Test for XHTML element prefix? prefs.reset(); FBTest.testDone();}
prefs.setPrefs(true, " ", "", " "); FBTest.compare("<div class=\"test value\" />", formatter.format(htmlElement), "XHTML Element, Spaces");
function runTest() { FBTest.loadScript("FBTestFireformat.js", this); var prefs = new FBTestFireformat.PrefHandler([ "fireformatHtmlFormatter.element.htmlNameToLower", "fireformatHtmlFormatter.element.separatorBeforeAttributes", "fireformatHtmlFormatter.element.separatorBeforeClose", "fireformatHtmlFormatter.element.separatorBeforeSelfClose", "fireformatHtmlFormatter.wrapSize" ]); var formatter = Format.Formatters.getFormatter("com.incaseofstairs.fireformatHTMLFormatter"); // HTML Element Tests var htmlElement = document.createElement("div"); prefs.setPrefs(true, " ", "", " "); FBTest.compare("<div></div>", formatter.format(htmlElement), "HTML Element no attr, Spaces"); prefs.setPrefs(true, "\n", "", " "); FBTest.compare("<div></div>", formatter.format(htmlElement), "HTML Element no attr, Spaces"); prefs.setPrefs(true, "\n", " ", " "); FBTest.compare("<div ></div>", formatter.format(htmlElement), "HTML Element no attr, Newline Spaces"); prefs.setPrefs(true, " ", "", " ", 1); FBTest.compare("<div></div>", formatter.format(htmlElement), "HTML Element no attr, Spaces, wrap"); prefs.setPrefs(true, "\n", "", " ", 1); FBTest.compare("<div></div>", formatter.format(htmlElement), "HTML Element no attr, Spaces, wrap"); prefs.setPrefs(true, "\n", " ", " ", 1); FBTest.compare("<div ></div>", formatter.format(htmlElement), "HTML Element no attr, Newline Spaces, wrap"); htmlElement.setAttribute("class", "test value"); prefs.setPrefs(true, " ", "", " "); FBTest.compare("<div class=\"test value\"></div>", formatter.format(htmlElement), "HTML Element, Spaces"); prefs.setPrefs(true, "", "", " "); FBTest.compare("<div class=\"test value\"></div>", formatter.format(htmlElement), "HTML Element, Spaces"); prefs.setPrefs(true, "\n", "", " "); FBTest.compare("<div\n class=\"test value\"></div>", formatter.format(htmlElement), "HTML Element, Spaces"); prefs.setPrefs(true, "\n", " ", " "); FBTest.compare("<div\n class=\"test value\" ></div>", formatter.format(htmlElement), "HTML Element, Newline Spaces"); prefs.setPrefs(true, " ", "", " ", 1); FBTest.compare("<div \n class=\"test value\"></div>", formatter.format(htmlElement), "HTML Element, Spaces wrap"); prefs.setPrefs(true, "\n", "", " ", 1); FBTest.compare("<div\n class=\"test value\"></div>", formatter.format(htmlElement), "HTML Element, Spaces wrap"); prefs.setPrefs(true, "\n", " ", " ", 1); FBTest.compare("<div\n class=\"test value\" ></div>", formatter.format(htmlElement), "HTML Element, Newline Spaces wrap"); htmlElement.appendChild(document.createTextNode("\n ")); var childElement = document.createElement("br"); htmlElement.appendChild(childElement); prefs.setPrefs(false, "", "", ""); FBTest.compare("<DIV class=\"test value\">\n <BR></DIV>", formatter.format(htmlElement), "Child HTML Element, Spaces Upper"); prefs.setPrefs(true, "", "", ""); FBTest.compare("<div class=\"test value\">\n <br></div>", formatter.format(htmlElement), "Child HTML Element, Spaces"); prefs.setPrefs(true, "\n", "", " "); FBTest.compare("<div\n class=\"test value\">\n <br></div>", formatter.format(htmlElement), "Child HTML Element, Spaces"); prefs.setPrefs(true, "\n", " ", " "); FBTest.compare("<div\n class=\"test value\" >\n <br ></div>", formatter.format(htmlElement), "Child HTML Element, Newline Spaces"); prefs.setPrefs(true, "\n", "\n", "\n"); FBTest.compare("<div\n class=\"test value\"\n>\n <br\n ></div>", formatter.format(htmlElement), "Child HTML Element, Newline"); prefs.setPrefs(true, "", "", "", 1); FBTest.compare("<div\n class=\"test value\">\n <br></div>", formatter.format(htmlElement), "Child HTML Element, Spaces, wrap"); prefs.setPrefs(true, "\n", "", " ", 1); FBTest.compare("<div\n class=\"test value\">\n <br></div>", formatter.format(htmlElement), "Child HTML Element, Spaces, wrap"); prefs.setPrefs(true, "\n", " ", " ", 1); FBTest.compare("<div\n class=\"test value\" >\n <br ></div>", formatter.format(htmlElement), "Child HTML Element, Newline Spaces, wrap"); // Void HTML Element htmlElement = document.createElement("input"); htmlElement.setAttribute("class", "test"); prefs.setPrefs(true, "", "", ""); FBTest.compare("<input class=\"test\">", formatter.format(htmlElement), "Void HTML Element, Spaces"); prefs.setPrefs(true, "\n", "", ""); FBTest.compare("<input\n class=\"test\">", formatter.format(htmlElement), "Void HTML Element, Spaces"); prefs.setPrefs(true, "\n", " ", " "); FBTest.compare("<input\n class=\"test\" >", formatter.format(htmlElement), "Void HTML Element, Newline Spaces"); prefs.setPrefs(false, "", "", ""); FBTest.compare("<INPUT class=\"test\">", formatter.format(htmlElement), "Void HTML Element, Spaces"); prefs.setPrefs(false, "\n", "", ""); FBTest.compare("<INPUT\n class=\"test\">", formatter.format(htmlElement), "Void HTML Element, Spaces"); prefs.setPrefs(false, "\n", " ", " "); FBTest.compare("<INPUT\n class=\"test\" >", formatter.format(htmlElement), "Void HTML Element, Newline Spaces"); // TODO : No attribute test, for non-void // XHTML Element Tests var xmlDoc = document.implementation.createDocument(null, "", null); var htmlElement = xmlDoc.createElementNS("http://www.w3.org/1999/xhtml", "div"); prefs.setPrefs(true, " ", "", " "); FBTest.compare("<div />", formatter.format(htmlElement), "XHTML Element no attr, Spaces"); prefs.setPrefs(true, "\n", "", ""); FBTest.compare("<div/>", formatter.format(htmlElement), "XHTML Element no attr, No Space"); prefs.setPrefs(true, "\n", "", "\n"); FBTest.compare("<div\n/>", formatter.format(htmlElement), "XHTML Element no attr, Newline"); htmlElement.setAttribute("class", "test value"); prefs.setPrefs(true, "", "", " "); FBTest.compare("<div class=\"test value\" />", formatter.format(htmlElement), "XHTML Element, Spaces"); prefs.setPrefs(true, " ", "", " "); FBTest.compare("<div class=\"test value\" />", formatter.format(htmlElement), "XHTML Element, Spaces"); prefs.setPrefs(true, "\n", "", ""); FBTest.compare("<div\n class=\"test value\"/>", formatter.format(htmlElement), "XHTML Element, Spaces"); prefs.setPrefs(true, "\n", " ", "\n"); FBTest.compare("<div\n class=\"test value\"\n/>", formatter.format(htmlElement), "XHTML Element, Newline Spaces"); prefs.setPrefs(true, " ", "", " ", 1); FBTest.compare("<div \n class=\"test value\" />", formatter.format(htmlElement), "XHTML Element, Spaces, Wrap"); prefs.setPrefs(true, "\n", "", "", 1); FBTest.compare("<div\n class=\"test value\"/>", formatter.format(htmlElement), "XHTML Element, Spaces, Wrap"); prefs.setPrefs(true, "\n", " ", "\n", 1); FBTest.compare("<div\n class=\"test value\"\n/>", formatter.format(htmlElement), "XHTML Element, Newline Spaces, Wrap"); htmlElement.appendChild(document.createTextNode("\n ")); var childElement = xmlDoc.createElementNS("http://www.w3.org/1999/xhtml", "br"); childElement.setAttribute("class", "something"); htmlElement.appendChild(childElement); prefs.setPrefs(true, "", "", ""); FBTest.compare("<div class=\"test value\">\n <br class=\"something\"/></div>", formatter.format(htmlElement), "Child XHTML Element, Spaces Upper"); prefs.setPrefs(true, "", "", ""); FBTest.compare("<div class=\"test value\">\n <br class=\"something\"/></div>", formatter.format(htmlElement), "Child XHTML Element, Spaces"); prefs.setPrefs(true, "\n", "", " "); FBTest.compare("<div\n class=\"test value\">\n <br\n class=\"something\" /></div>", formatter.format(htmlElement), "Child XHTML Element, Spaces"); prefs.setPrefs(true, "\n", " ", " "); FBTest.compare("<div\n class=\"test value\" >\n <br\n class=\"something\" /></div>", formatter.format(htmlElement), "Child XHTML Element, Newline Spaces"); // TODO : How should indent be handled for the child close? prefs.setPrefs(true, "\n", "\n", "\n"); FBTest.compare("<div\n class=\"test value\"\n>\n <br\n class=\"something\"\n /></div>", formatter.format(htmlElement), "Child XHTML Element, Newline"); // Void HTML Element htmlElement = xmlDoc.createElementNS("http://www.w3.org/1999/xhtml", "input"); htmlElement.setAttribute("class", "test"); prefs.setPrefs(true, "", "", ""); FBTest.compare("<input class=\"test\"/>", formatter.format(htmlElement), "Void XHTML Element, Spaces"); prefs.setPrefs(true, "\n", "", " "); FBTest.compare("<input\n class=\"test\" />", formatter.format(htmlElement), "Void XHTML Element, Spaces"); prefs.setPrefs(true, "\n", "", "\n"); FBTest.compare("<input\n class=\"test\"\n/>", formatter.format(htmlElement), "Void XHTML Element, Newline Spaces"); prefs.setPrefs(false, "", "", ""); FBTest.compare("<input class=\"test\"/>", formatter.format(htmlElement), "Void XHTML Element, Spaces"); // TODO : Test for XHTML element prefix? prefs.reset(); FBTest.testDone();}
+ " div:after {\n" + " content: \"test\";\n" + " }\n"
function runTest() { var urlBase = FBTest.getHTTPURLBase(); var Formatter = FBTest.FirebugWindow.FireDiff.formatter, FBTrace = FBTest.FirebugWindow.FBTrace; //FBTest.loadScript("FBTestFireDiff.js", this); FBTestFirebug.openNewTab(urlBase + "formatter/htmlFormatter/html_index.html", function(win) { var Format = {}; Components.utils.import("resource://fireformat/formatters.jsm", Format); var doc = win.document; var expected = "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n" // This is an issue with the firefox parser. Not much that we can do about this right now // Expected: // + "<html>\n" // + "<head>\n" + "<html><head>\n\n\n" + " <meta content=\"application/html; charset=utf-8\" http-equiv=\"Content-type\">\n" + " <title>Firediff: HTML Formatter Test</title>\n" + " <link href=\"cssSource.css\" rel=\"stylesheet\" type=\"text/css\">\n" + " <style type=\"text/css\">\n" + " p {\n" + " background-color: green;\n" + " }\n" + " div {\n" + " background-color: red;\n" + " }\n" + " p {\n" + " margin: 100;\n" + " }\n" + " </style>\n" // This is an issue with the firefox parser. Not much that we can do about this right now // Expected: //+ "</head>\n" //+ "<body>\n" + "</head><body>\n" + " <!-- \n" + " Comments!\n" + " -->\n" + "\n" + " <div id=\"elementValue\" class=\"Value1\" align=\"left\" dir=\"ltr\">\n" + " <p>Nested Element</p>\n" + " Escaping &amp; entities.\n" + " <br>\n" + " <input type=\"submit\">\n" + " </div>\n" // This is an issue with the firefox parser. Not much that we can do about this right now // Expected: //+ "</body>\n" //+ "</html>"; + "</body></html>"; var formatter = Format.Formatters.getFormatter("com.incaseofstairs.fireformatHTMLFormatter"), text = formatter.format(doc); FBTest.compare(expected, text, "Formatter value"); FBTestFirebug.testDone(); });}
FBTest.loadScript("FBTestFireformat.js", this);
function runTest() { FBTest.loadScript("FBTestFireformat.js", this); var formatter = Format.Formatters.getFormatter("com.incaseofstairs.fireformatHTMLFormatter"), input = "\u0022\u0026\u0027\u003E\u00FF\u0152\u0153\u0160", output = "&quot;&amp;&apos;&gt;&yuml;&OElig;&oelig;&Scaron;" // Test text node output with a few sample entities FBTest.compare(output, formatter.format(document.createTextNode(input)), "TextNode entities"); // Test attribute node output with a few sample entities var attr = document.createAttribute("class"); attr.nodeValue = input; FBTest.compare(output, formatter.format(attr).replace(/.*"(.*)"/, "$1"), "Attr entities"); // Test comment node output with a few sample entities FBTest.compare("<!--" + output + "-->", formatter.format(document.createComment(input)), "Comment entities"); // Test CDATA output with a few sample entities var xmlDoc = document.implementation.createDocument(null, "", null); FBTest.compare("<![CDATA[" + input + "]]>", formatter.format(xmlDoc.createCDATASection(input)), "CDATA entities"); FBTest.testDone();}
FBTest.loadScript("FBTestFireformat.js", this);
function runTest() { FBTest.loadScript("FBTestFireformat.js", this); var prefs = new FBTestFireformat.PrefHandler([ "fireformatCssFormatter.wrapSize", "fireformatCssFormatter.atRule.tokensPerLine", "fireformatCssFormatter.atRule.indentLevel", "fireformatCssFormatter.atRule.spaceBeforeValue", "fireformatCssFormatter.atRule.spaceBeforeSemicolon", "fireformatCssFormatter.atRule.valueSpaceCount", "fireformatCssFormatter.atRule.typeSeparator" ]); var formatter = Format.Formatters.getFormatter("com.incaseofstairs.fireformatCSSFormatter"); function getImportStyle(mediaText) { return formatter.format({ type: CSSRule.IMPORT_RULE, href: "href href", media: { mediaText: mediaText } }); } function getCharsetStyle() { return formatter.format({ type: CSSRule.CHARSET_RULE, encoding: "encoding" }); } function getMultipleStyle() { return formatter.format({ cssRules: [ { type: CSSRule.CHARSET_RULE, encoding: "encoding" }, { type: CSSRule.CHARSET_RULE, encoding: "encoding" }, { type: CSSRule.IMPORT_RULE, href: "href href", media: { mediaText: "media text" } }, { type: CSSRule.IMPORT_RULE, href: "href href", media: { mediaText: "media text" } }, { type: CSSRule.STYLE_RULE, selectorText: "selector", style: { cssText: "" } } ] }); } // Import prefs.setPrefs(80, 10, 1, 1 , 0, 1, "\n"); FBTest.compare("@import url(\"href href\") media text;", getImportStyle("media text"), "Import rule, no wrap"); prefs.setPrefs(80, 10, 1, 2, 1, 2, "\n"); FBTest.compare("@import url(\"href href\") media text ;", getImportStyle("media text"), "Import rule, no wrap, space"); prefs.setPrefs(80, 1, 1, 1, 0, 2, "\n"); FBTest.compare("@import\n url(\"href href\")\n media text;", getImportStyle("media text"), "Import rule, token wrap"); prefs.setPrefs(10, 10, 1, 1, 0, 2, "\n"); FBTest.compare("@import url(\"href href\")\n media text;", getImportStyle("media text"), "Import rule, char wrap"); prefs.setPrefs(80, 10, 1, 1 , 0, 1, "\n"); FBTest.compare("@import url(\"href href\");", getImportStyle(""), "Import rule no media, no wrap"); prefs.setPrefs(80, 10, 1, 2, 1, 2, "\n"); FBTest.compare("@import url(\"href href\") ;", getImportStyle(""), "Import rule no media, no wrap, space"); prefs.setPrefs(80, 1, 1, 1, 0, 2, "\n"); FBTest.compare("@import\n url(\"href href\");", getImportStyle(""), "Import rule no media, token wrap"); prefs.setPrefs(10, 10, 1, 1, 0, 2, "\n"); FBTest.compare("@import url(\"href href\");", getImportStyle(""), "Import rule no media, char wrap"); prefs.setPrefs(80, 10, 1, 1 , 0, 1, "\n"); FBTest.compare("@import url(\"href href\") media text, text for media;", getImportStyle("media text, text for media"), "Import rule multiple media, no wrap"); prefs.setPrefs(80, 10, 1, 2, 1, 2, "\n"); FBTest.compare("@import url(\"href href\") media text, text for media ;", getImportStyle("media text, text for media"), "Import rule multiple media, no wrap, space"); prefs.setPrefs(80, 1, 1, 1, 0, 2, "\n"); FBTest.compare("@import\n url(\"href href\")\n media text,\n text for media;", getImportStyle("media text, text for media"), "Import rule multiple media, token wrap"); prefs.setPrefs(10, 10, 1, 1, 0, 2, "\n"); FBTest.compare("@import url(\"href href\")\n media text,\n text for media;", getImportStyle("media text, text for media"), "Import rule multiple media, char wrap"); // Charset prefs.setPrefs(80, 10, 1, 1, 0, 1, "\n"); FBTest.compare("@charset \"encoding\";", getCharsetStyle(), "Charset rule, no wrap"); prefs.setPrefs(80, 10, 1, 2, 1, 2, "\n"); FBTest.compare("@charset \"encoding\" ;", getCharsetStyle(), "Charset rule, no wrap, space"); prefs.setPrefs(80, 1, 1, 1, 0, 2, "\n"); FBTest.compare("@charset\n \"encoding\";", getCharsetStyle(), "Charset rule, token wrap"); prefs.setPrefs(8, 10, 1, 1, 0, 2, "\n"); FBTest.compare("@charset\n \"encoding\";", getCharsetStyle(), "Charset rule, char wrap"); // TODO : Test the type separator paramter prefs.setPrefs(80, 10, 1, 1, 0, 1, "\n"); FBTest.compare( "@charset \"encoding\";\n@charset \"encoding\";\n\n" + "@import url(\"href href\") media text;\n@import url(\"href href\") media text;\n\n" + "selector {\n\n}\n", getMultipleStyle(), "Multiple rule, no wrap"); prefs.setPrefs(80, 10, 1, 1, 0, 1, ""); FBTest.compare( "@charset \"encoding\";\n@charset \"encoding\";\n" + "@import url(\"href href\") media text;\n@import url(\"href href\") media text;\n" + "selector {\n\n}\n", getMultipleStyle(), "Multiple rule, no wrap"); prefs.reset(); FBTest.testDone();}
FBTest.loadScript("FBTestFireformat.js", this);
function runTest() { FBTest.loadScript("FBTestFireformat.js", this); var prefs = new FBTestFireformat.PrefHandler([ "fireformatCssFormatter.block.indentLevel", "fireformatCssFormatter.block.separatorBeforeOpen", "fireformatCssFormatter.block.separatorAfterOpen", "fireformatCssFormatter.block.separatorBeforeClose", "fireformatCssFormatter.block.separatorAfterClose", "fireformatCssFormatter.block.componentSeparator" ]); var formatter = Format.Formatters.getFormatter("com.incaseofstairs.fireformatCSSFormatter"); function getSingleProperty() { return formatter.format({ type: CSSRule.STYLE_RULE, selectorText: "selector", style: { cssText: "property: value;" } }); } function getMultipleProperty() { return formatter.format({ type: CSSRule.STYLE_RULE, selectorText: "selector", style: { cssText: "property: value; property2: value2;" } }); } function getMultipleBlocks() { return formatter.format({ cssRules:[ { type: CSSRule.STYLE_RULE, selectorText: "selector", style: { cssText: "" } }, { type: CSSRule.STYLE_RULE, selectorText: "selector2", style: { cssText: "property: value;" } } ] }); } function getNestedBlock() { return formatter.format({ type: CSSRule.MEDIA_RULE, media: { mediaText: "media" }, cssRules: [ { type: CSSRule.STYLE_RULE, selectorText: "selector", style: { cssText: "property: value;" } }, { type: CSSRule.STYLE_RULE, selectorText: "selector2", style: { cssText: "" } } ] }); } prefs.setGlobal("fireformatCssFormatter.property.tokensPerLine", 0); // Single block, single property prefs.setPrefs(1, " ", "\n", "\n", "\n", "\n"); FBTest.compare("selector {\n property: value;\n}", getSingleProperty(), "Single prop, Indent, newlines"); prefs.setPrefs(0, " ", "\n", "\n", "\n", "\n"); FBTest.compare("selector {\nproperty: value;\n}", getSingleProperty(), "Single prop, No indent, newlines"); prefs.setPrefs(2, " ", "\n", "\n", "\n", "\n"); FBTest.compare("selector {\n property: value;\n}", getSingleProperty(), "Single prop, Double indent, newlines"); prefs.setPrefs(1, "\n", "\n", "\n", "\n", "\n"); FBTest.compare("selector\n{\n property: value;\n}", getSingleProperty(), "Single prop, All newlines"); prefs.setPrefs(1, " ", " ", " ", "", " "); FBTest.compare("selector { property: value; }", getSingleProperty(), "Single prop, No newlines"); // Single block, multiple property prefs.setPrefs(1, " ", "\n", "\n", "\n", "\n"); FBTest.compare("selector {\n property: value;\n property2: value2;\n}", getMultipleProperty(), "Multiple prop, Indent, newlines"); prefs.setPrefs(0, " ", "\n", "\n", "\n", "\n"); FBTest.compare("selector {\nproperty: value;\nproperty2: value2;\n}", getMultipleProperty(), "Multiple prop, No indent, newlines"); prefs.setPrefs(2, " ", "\n", "\n", "\n", "\n"); FBTest.compare("selector {\n property: value;\n property2: value2;\n}", getMultipleProperty(), "Multiple prop, Double indent, newlines"); prefs.setPrefs(1, "\n", "\n", "\n", "\n", "\n"); FBTest.compare("selector\n{\n property: value;\n property2: value2;\n}", getMultipleProperty(), "Multiple prop, All newlines"); prefs.setPrefs(1, " ", " ", " ", "", " "); FBTest.compare("selector { property: value; property2: value2; }", getMultipleProperty(), "Multiple prop, No newlines"); // Multiple blocks prefs.setPrefs(1, " ", "\n", "\n", "\n", "\n"); FBTest.compare("selector {\n\n}\n\nselector2 {\n property: value;\n}\n", getMultipleBlocks(), "Multiple block, Same line brace"); prefs.setPrefs(0, " ", "\n", "\n", "\n", "\n"); FBTest.compare("selector {\n\n}\n\nselector2 {\nproperty: value;\n}\n", getMultipleBlocks(), "Multiple block, No indent, newlines"); prefs.setPrefs(2, " ", "\n", "\n", "\n", "\n"); FBTest.compare("selector {\n\n}\n\nselector2 {\n property: value;\n}\n", getMultipleBlocks(), "Multiple block, Double indent, newlines"); prefs.setPrefs(1, "\n", "\n", "\n", "\n", "\n"); FBTest.compare("selector\n{\n\n}\n\nselector2\n{\n property: value;\n}\n", getMultipleBlocks(), "Multiple prop, All newlines"); prefs.setPrefs(1, " ", " ", " ", "", " "); FBTest.compare("selector { } selector2 { property: value; }", getMultipleBlocks(), "Multiple block, No newlines"); // Nested block prefs.setPrefs(1, " ", "\n", "\n", "\n", "\n"); FBTest.compare("@media media {\n selector {\n property: value;\n }\n \n selector2 {\n \n }\n}", getNestedBlock(), "Nested block, Indent, newlines"); prefs.setPrefs(0, " ", "\n", "\n", "\n", "\n"); FBTest.compare("@media media {\nselector {\nproperty: value;\n}\n\nselector2 {\n\n}\n}", getNestedBlock(), "Nested block, No indent, newlines"); prefs.setPrefs(2, " ", "\n", "\n", "\n", "\n"); FBTest.compare("@media media {\n selector {\n property: value;\n }\n \n selector2 {\n \n }\n}", getNestedBlock(), "Nested block, Double indent, newlines"); prefs.setPrefs(1, "\n", "\n", "\n", "\n", "\n"); FBTest.compare("@media media\n{\n selector\n {\n property: value;\n }\n \n selector2\n {\n \n }\n}", getNestedBlock(), "Nested block, All newlines"); prefs.setPrefs(1, " ", " ", " ", "", " "); FBTest.compare("@media media { selector { property: value; } selector2 { } }", getNestedBlock(), "Nested block, No newlines"); prefs.reset(); FBTest.testDone();}
+ " div:after {\n" + " content: &quot;test&quot;;\n" + " }\n" + " </HTML:style>\n" + " <HTML:style type=\"text/css\">\n" + " <![CDATA[\n" + " div:after {\n" + " content: \"test\";\n" + " }\n" + " ]]>\n"
function runTest() { var urlBase = FBTest.getHTTPURLBase(); var Formatter = FBTest.FirebugWindow.FireDiff.formatter, FBTrace = FBTest.FirebugWindow.FBTrace; FBTestFirebug.openNewTab(urlBase + "formatter/htmlFormatter/xhtml_index.xhtml", function(win) { var Format = {}; Components.utils.import("resource://fireformat/formatters.jsm", Format); var doc = win.document; var expected = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\n" + "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\" [\n" + " <!ENTITY foo \"food\">\n" + " <!ENTITY bar \"bar\">\n" + " <!ENTITY bar \"bar2\">\n" + " <!ENTITY % baz \"baz\">\n" + "]>\n" + "<?xslt-param?>\n" + "<?xslt-param name=\"color\"\n" + " value=\"blue\"\n" + "?>\n" + "<HTML:html xmlns:HTML=\"http://www.w3.org/1999/xhtml\">\n" + "<HTML:head>\n" + " <HTML:meta content=\"text/xml; charset=utf-8\" http-equiv=\"Content-Type\" />\n" + " <HTML:title>Firediff: HTML Formatter Test</HTML:title>\n" + " <HTML:link href=\"cssSource.css\" rel=\"stylesheet\" type=\"text/css\" />\n" + " <HTML:style type=\"text/css\">\n" + " p {\n" + " background-color: green;\n" + " }\n" + " div {\n" + " background-color: red;\n" + " }\n" + " p {\n" + " margin: 100;\n" + " }\n" + " </HTML:style>\n" + "</HTML:head>\n" + "<HTML:body>\n" + " <!-- \n" + " Comments!\n" + " -->\n" + "\n" + " <![CDATA[CDATA=\"GOOD & STUFF <>\"]]>\n" + "\n" + " <HTML:div id=\"elementValue\" class=\"Value1 &amp; &lt;\" align=\"left\" dir=\"ltr\">\n" + " <HTML:p>Nested Element</HTML:p>\n" + " Escaping &amp; entities.\n" + " <HTML:br />\n" + " <HTML:input type=\"submit\" />\n" + " </HTML:div>\n" + "</HTML:body>\n" + "</HTML:html>"; var formatter = Format.Formatters.getFormatter("com.incaseofstairs.fireformatHTMLFormatter"), text = formatter.format(doc); FBTest.compare(expected, text, "Formatter value"); FBTestFirebug.testDone(); });}
f.effects.animateClass.apply(this,[{remove:c},a,b,d]):this._removeClass(c)},_toggleClass:f.fn.toggleClass,toggleClass:function(c,a,b,d,e){return typeof a=="boolean"||a===j?b?f.effects.animateClass.apply(this,[a?{add:c}:{remove:c},b,d,e]):this._toggleClass(c,a):f.effects.animateClass.apply(this,[{toggle:c},a,b,d])},switchClass:function(c,a,b,d,e){return f.effects.animateClass.apply(this,[{add:a,remove:c},b,d,e])}});f.extend(f.effects,{version:"1.8.4",save:function(c,a){for(var b=0;b<a.length;b++)a[b]!== null&&c.data("ec.storage."+a[b],c[0].style[a[b]])},restore:function(c,a){for(var b=0;b<a.length;b++)a[b]!==null&&c.css(a[b],c.data("ec.storage."+a[b]))},setMode:function(c,a){if(a=="toggle")a=c.is(":hidden")?"show":"hide";return a},getBaseline:function(c,a){var b;switch(c[0]){case "top":b=0;break;case "middle":b=0.5;break;case "bottom":b=1;break;default:b=c[0]/a.height}switch(c[1]){case "left":c=0;break;case "center":c=0.5;break;case "right":c=1;break;default:c=c[1]/a.width}return{x:c,y:b}},createWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent();
[{add:a,remove:c},b,d,e])}});f.extend(f.effects,{version:"1.8.6",save:function(c,a){for(var b=0;b<a.length;b++)a[b]!==null&&c.data("ec.storage."+a[b],c[0].style[a[b]])},restore:function(c,a){for(var b=0;b<a.length;b++)a[b]!==null&&c.css(a[b],c.data("ec.storage."+a[b]))},setMode:function(c,a){if(a=="toggle")a=c.is(":hidden")?"show":"hide";return a},getBaseline:function(c,a){var b;switch(c[0]){case "top":b=0;break;case "middle":b=0.5;break;case "bottom":b=1;break;default:b=c[0]/a.height}switch(c[1]){case "left":c=
f.effects.animateClass.apply(this,[{remove:c},a,b,d]):this._removeClass(c)},_toggleClass:f.fn.toggleClass,toggleClass:function(c,a,b,d,e){return typeof a=="boolean"||a===j?b?f.effects.animateClass.apply(this,[a?{add:c}:{remove:c},b,d,e]):this._toggleClass(c,a):f.effects.animateClass.apply(this,[{toggle:c},a,b,d])},switchClass:function(c,a,b,d,e){return f.effects.animateClass.apply(this,[{add:a,remove:c},b,d,e])}});f.extend(f.effects,{version:"1.8.4",save:function(c,a){for(var b=0;b<a.length;b++)a[b]!==null&&c.data("ec.storage."+a[b],c[0].style[a[b]])},restore:function(c,a){for(var b=0;b<a.length;b++)a[b]!==null&&c.css(a[b],c.data("ec.storage."+a[b]))},setMode:function(c,a){if(a=="toggle")a=c.is(":hidden")?"show":"hide";return a},getBaseline:function(c,a){var b;switch(c[0]){case "top":b=0;break;case "middle":b=0.5;break;case "bottom":b=1;break;default:b=c[0]/a.height}switch(c[1]){case "left":c=0;break;case "center":c=0.5;break;case "right":c=1;break;default:c=c[1]/a.width}return{x:c,y:b}},createWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent();
var gl_Slide=new Class({options:{active:'',fx:{wait:false,duration:350},scrollFX:{wait:false,transition:Fx.Transitions.Sine.easeInOut},dimensions:{width:722,height:200}},initialize:function(contents,options){this.setOptions(options);this.content=$(contents);this.sections=this.content.getElements('.tab-pane');if(!this.sections.length)return;this.filmstrip=new Element('div',{id:'gl_slide_hr'}).injectAfter(this.content);this.buildToolbar();this.buildFrame();if(window.ie)this.fixIE();this.scroller=$('scroller');this.startposition=$(this.sections[0].id.replace('-tab','-pane')).getPosition().x;this.scroller.scrollFX=new Fx.Scroll(this.scroller,this.options.scrollFX);if(this.options.active)this.scrollSection(this.options.active.test(/-tab|-pane/)?this.options.active:this.options.active+'-tab');else this.scrollSection(this.sectionptr[0])},buildToolbar:function(){var lis=[];var that=this;this.sectionptr=[];var h1,title;this.sections.each(function(el){el.setStyles({width:this.options.dimensions.width-102,height:this.options.dimensions.height});this.sectionptr.push(el.id.replace('-pane','-tab'));h1=el.getElement('.tab-title');title=h1.innerHTML;h1.empty().remove();lis.push(new Element('li',{id:el.id.replace('-pane','-tab'),events:{'click':function(){this.addClass('active');that.scrollSection(this)},'mouseover':function(){this.addClass('hover');this.addClass('active')},'mouseout':function(){this.removeClass('hover');this.removeClass('active')}}}).setHTML(title))},this);this.filmstrip.adopt(new Element('ul',{id:'gl_slide-tabs',styles:{width:this.options.dimensions.width}}).adopt(lis),new Element('hr'))},buildFrame:function(){var that=this,events={'click':function(){that.scrollArrow(this)},'mouseover':function(){this.addClass('hover')},'mouseout':function(){this.removeClass('hover')}};this.filmstrip.adopt(new Element('div',{id:'frame',styles:this.options.dimensions}).adopt(new Element('div',{'class':'button','id':'left','events':events}),new Element('div',{id:'scroller',styles:{width:this.options.dimensions.width-102,height:this.options.dimensions.height}}).adopt(this.content.setStyle('width',this.sections.length*1600)),new Element('div',{'class':'button','id':'right','events':events})))},fixIE:function(){this.filmstrip.getElement('hr').setStyle('display','none')},scrollSection:function(element){element=$($(element||this.sections[0]).id.replace('-pane','-tab'));var oldactive=element.getParent().getElement('.current');if(oldactive)oldactive.removeClass('current');element.addClass('current');var offset=$(element.id.replace('-tab','-pane')).getPosition().x-this.startposition;this.scroller.scrollFX.scrollTo(offset,false)},scrollArrow:function(element){var direction=Math.pow(-1,['left','right'].indexOf(element.id)+1);var current=this.sectionptr.indexOf(this.filmstrip.getElement('.current').id);var to=current+direction;this.scrollSection(this.sectionptr[to<0?this.sectionptr.length-1:to%this.sectionptr.length])}});gl_Slide.implement(new Options);
scrollArrow:function(element){ var direction=Math.pow(-1,['left','right'].indexOf(element.id)+1); var current=this.sectionptr.indexOf(this.filmstrip.getElement('.current').id); var to=current+direction; this.scrollSection(this.sectionptr[to<0?this.sectionptr.length-1:to%this.sectionptr.length]) },
var gl_Slide=new Class({options:{active:'',fx:{wait:false,duration:350},scrollFX:{wait:false,transition:Fx.Transitions.Sine.easeInOut},dimensions:{width:722,height:200}},initialize:function(contents,options){this.setOptions(options);this.content=$(contents);this.sections=this.content.getElements('.tab-pane');if(!this.sections.length)return;this.filmstrip=new Element('div',{id:'gl_slide_hr'}).injectAfter(this.content);this.buildToolbar();this.buildFrame();if(window.ie)this.fixIE();this.scroller=$('scroller');this.startposition=$(this.sections[0].id.replace('-tab','-pane')).getPosition().x;this.scroller.scrollFX=new Fx.Scroll(this.scroller,this.options.scrollFX);if(this.options.active)this.scrollSection(this.options.active.test(/-tab|-pane/)?this.options.active:this.options.active+'-tab');else this.scrollSection(this.sectionptr[0])},buildToolbar:function(){var lis=[];var that=this;this.sectionptr=[];var h1,title;this.sections.each(function(el){el.setStyles({width:this.options.dimensions.width-102,height:this.options.dimensions.height});this.sectionptr.push(el.id.replace('-pane','-tab'));h1=el.getElement('.tab-title');title=h1.innerHTML;h1.empty().remove();lis.push(new Element('li',{id:el.id.replace('-pane','-tab'),events:{'click':function(){this.addClass('active');that.scrollSection(this)},'mouseover':function(){this.addClass('hover');this.addClass('active')},'mouseout':function(){this.removeClass('hover');this.removeClass('active')}}}).setHTML(title))},this);this.filmstrip.adopt(new Element('ul',{id:'gl_slide-tabs',styles:{width:this.options.dimensions.width}}).adopt(lis),new Element('hr'))},buildFrame:function(){var that=this,events={'click':function(){that.scrollArrow(this)},'mouseover':function(){this.addClass('hover')},'mouseout':function(){this.removeClass('hover')}};this.filmstrip.adopt(new Element('div',{id:'frame',styles:this.options.dimensions}).adopt(new Element('div',{'class':'button','id':'left','events':events}),new Element('div',{id:'scroller',styles:{width:this.options.dimensions.width-102,height:this.options.dimensions.height}}).adopt(this.content.setStyle('width',this.sections.length*1600)),new Element('div',{'class':'button','id':'right','events':events})))},fixIE:function(){this.filmstrip.getElement('hr').setStyle('display','none')},scrollSection:function(element){element=$($(element||this.sections[0]).id.replace('-pane','-tab'));var oldactive=element.getParent().getElement('.current');if(oldactive)oldactive.removeClass('current');element.addClass('current');var offset=$(element.id.replace('-tab','-pane')).getPosition().x-this.startposition;this.scroller.scrollFX.scrollTo(offset,false)},scrollArrow:function(element){var direction=Math.pow(-1,['left','right'].indexOf(element.id)+1);var current=this.sectionptr.indexOf(this.filmstrip.getElement('.current').id);var to=current+direction;this.scrollSection(this.sectionptr[to<0?this.sectionptr.length-1:to%this.sectionptr.length])}});gl_Slide.implement(new Options);
var gl_Slide=new Class({options:{active:'',fx:{wait:false,duration:350},scrollFX:{wait:false,transition:Fx.Transitions.Sine.easeInOut},dimensions:{width:722,height:200}},initialize:function(contents,options){this.setOptions(options);this.content=$(contents);this.sections=this.content.getElements('.tab-pane');if(!this.sections.length)return;this.filmstrip=new Element('div',{id:'gl_slide_hr'}).injectAfter(this.content);this.buildToolbar();this.buildFrame();if(window.ie)this.fixIE();this.scroller=$('scroller');this.startposition=$(this.sections[0].id.replace('-tab','-pane')).getPosition().x;this.scroller.scrollFX=new Fx.Scroll(this.scroller,this.options.scrollFX);if(this.options.active)this.scrollSection(this.options.active.test(/-tab|-pane/)?this.options.active:this.options.active+'-tab');else this.scrollSection(this.sectionptr[0])},buildToolbar:function(){var lis=[];var that=this;this.sectionptr=[];var h1,title;this.sections.each(function(el){el.setStyles({width:this.options.dimensions.width-102,height:this.options.dimensions.height});this.sectionptr.push(el.id.replace('-pane','-tab'));h1=el.getElement('.tab-title');title=h1.innerHTML;h1.empty().remove();lis.push(new Element('li',{id:el.id.replace('-pane','-tab'),events:{'click':function(){this.addClass('active');that.scrollSection(this)},'mouseover':function(){this.addClass('hover');this.addClass('active')},'mouseout':function(){this.removeClass('hover');this.removeClass('active')}}}).setHTML(title))},this);this.filmstrip.adopt(new Element('ul',{id:'gl_slide-tabs',styles:{width:this.options.dimensions.width}}).adopt(lis),new Element('hr'))},buildFrame:function(){var that=this,events={'click':function(){that.scrollArrow(this)},'mouseover':function(){this.addClass('hover')},'mouseout':function(){this.removeClass('hover')}};this.filmstrip.adopt(new Element('div',{id:'frame',styles:this.options.dimensions}).adopt(new Element('div',{'class':'button','id':'left','events':events}),new Element('div',{id:'scroller',styles:{width:this.options.dimensions.width-102,height:this.options.dimensions.height}}).adopt(this.content.setStyle('width',this.sections.length*1600)),new Element('div',{'class':'button','id':'right','events':events})))},fixIE:function(){this.filmstrip.getElement('hr').setStyle('display','none')},scrollSection:function(element){element=$($(element||this.sections[0]).id.replace('-pane','-tab'));var oldactive=element.getParent().getElement('.current');if(oldactive)oldactive.removeClass('current');element.addClass('current');var offset=$(element.id.replace('-tab','-pane')).getPosition().x-this.startposition;this.scroller.scrollFX.scrollTo(offset,false)},scrollArrow:function(element){var direction=Math.pow(-1,['left','right'].indexOf(element.id)+1);var current=this.sectionptr.indexOf(this.filmstrip.getElement('.current').id);var to=current+direction;this.scrollSection(this.sectionptr[to<0?this.sectionptr.length-1:to%this.sectionptr.length])}});gl_Slide.implement(new Options);
scrollSection:function(element){ element=$($(element||this.sections[0]).id.replace('-pane','-tab')); var oldactive=element.getParent().getElement('.current'); if(oldactive)oldactive.removeClass('current'); element.addClass('current'); $(element.id.replace('-tab','-pane')); var offset = this.sectionptr.indexOf(this.filmstrip.getElement('.current').id); if (offset > 0) {offset = (offset * (this.options.dimensions.width-102));} this.scroller.scrollFX.scrollTo(offset,false) },
var gl_Slide=new Class({options:{active:'',fx:{wait:false,duration:350},scrollFX:{wait:false,transition:Fx.Transitions.Sine.easeInOut},dimensions:{width:722,height:200}},initialize:function(contents,options){this.setOptions(options);this.content=$(contents);this.sections=this.content.getElements('.tab-pane');if(!this.sections.length)return;this.filmstrip=new Element('div',{id:'gl_slide_hr'}).injectAfter(this.content);this.buildToolbar();this.buildFrame();if(window.ie)this.fixIE();this.scroller=$('scroller');this.startposition=$(this.sections[0].id.replace('-tab','-pane')).getPosition().x;this.scroller.scrollFX=new Fx.Scroll(this.scroller,this.options.scrollFX);if(this.options.active)this.scrollSection(this.options.active.test(/-tab|-pane/)?this.options.active:this.options.active+'-tab');else this.scrollSection(this.sectionptr[0])},buildToolbar:function(){var lis=[];var that=this;this.sectionptr=[];var h1,title;this.sections.each(function(el){el.setStyles({width:this.options.dimensions.width-102,height:this.options.dimensions.height});this.sectionptr.push(el.id.replace('-pane','-tab'));h1=el.getElement('.tab-title');title=h1.innerHTML;h1.empty().remove();lis.push(new Element('li',{id:el.id.replace('-pane','-tab'),events:{'click':function(){this.addClass('active');that.scrollSection(this)},'mouseover':function(){this.addClass('hover');this.addClass('active')},'mouseout':function(){this.removeClass('hover');this.removeClass('active')}}}).setHTML(title))},this);this.filmstrip.adopt(new Element('ul',{id:'gl_slide-tabs',styles:{width:this.options.dimensions.width}}).adopt(lis),new Element('hr'))},buildFrame:function(){var that=this,events={'click':function(){that.scrollArrow(this)},'mouseover':function(){this.addClass('hover')},'mouseout':function(){this.removeClass('hover')}};this.filmstrip.adopt(new Element('div',{id:'frame',styles:this.options.dimensions}).adopt(new Element('div',{'class':'button','id':'left','events':events}),new Element('div',{id:'scroller',styles:{width:this.options.dimensions.width-102,height:this.options.dimensions.height}}).adopt(this.content.setStyle('width',this.sections.length*1600)),new Element('div',{'class':'button','id':'right','events':events})))},fixIE:function(){this.filmstrip.getElement('hr').setStyle('display','none')},scrollSection:function(element){element=$($(element||this.sections[0]).id.replace('-pane','-tab'));var oldactive=element.getParent().getElement('.current');if(oldactive)oldactive.removeClass('current');element.addClass('current');var offset=$(element.id.replace('-tab','-pane')).getPosition().x-this.startposition;this.scroller.scrollFX.scrollTo(offset,false)},scrollArrow:function(element){var direction=Math.pow(-1,['left','right'].indexOf(element.id)+1);var current=this.sectionptr.indexOf(this.filmstrip.getElement('.current').id);var to=current+direction;this.scrollSection(this.sectionptr[to<0?this.sectionptr.length-1:to%this.sectionptr.length])}});gl_Slide.implement(new Options);
function searchRequest() { var queryString = jQuery("#searchInputField").attr("value"); log('start searching for ' + queryString);
function searchRequest(query) { if (typeof query == "undefined") var queryString= jQuery("#searchInputField").attr("value"); else queryString = query; if(debug) log('start searching for ' + queryString);
function searchRequest() { var queryString = jQuery("#searchInputField").attr("value"); log('start searching for ' + queryString); queryString = urlencode(queryString); var anotherUrl = HIDDEN_SERVICE_URL + 'searchGeoObjects.php?query=' + queryString + '&topicmapId=' + topicId + '&workspaceId=' + workspaceId; showProgressInSideBar("Suchanfrage"); jQuery.ajax({ type: "GET", url: anotherUrl, dataType: 'json', async: true, success: function(obj){ // log('got respoonse ' + obj.result.toString()); initResultList(obj.result); if (debug) log('search delivered ' + obj.result.length + ' results'); }, error: function(x, s, e){ hideProgressFromSideBar(); jQuery("#sideBarCategories").empty(); jQuery("#sideBarCategories").append('&nbsp;&nbsp;<b class="redTitle">Ihre Anfrage lieferte keine Ergebnisse</b><p/>'); jQuery("#sideBarCategories").append('<table width="100%" cellpadding="2" cellspacing="0"' + ' id="#sideBarCategoriesTable"></table>'); if (debug) log('Fehler beim Suchen aufgetreten' + x.statusText); } }); }
var anotherUrl = HIDDEN_SERVICE_URL + 'searchGeoObjects.php?query=' + queryString + '&topicmapId=' + topicId + '&workspaceId=' + workspaceId;
var body = '{"method": "searchGeoObjects", "params": ["'+queryString+'", "'+topicId+'", "'+workspaceId+'"]}';
function searchRequest(query) { if (typeof query == "undefined") var queryString= jQuery("#searchInputField").attr("value"); else queryString = query; if(debug) log('start searching for ' + queryString); queryString = urlencode(queryString); var anotherUrl = HIDDEN_SERVICE_URL + 'searchGeoObjects.php?query=' + queryString + '&topicmapId=' + topicId + '&workspaceId=' + workspaceId; showProgressInSideBar("Suchanfrage"); jQuery.ajax({ type: "GET", url: anotherUrl, dataType: 'json', async: true, success: function(obj){ // log('got respoonse ' + obj.result.toString()); initResultList(obj.result); if (debug) log('search delivered ' + obj.result.length + ' results'); }, error: function(x, s, e){ hideProgressFromSideBar(); jQuery("#sideBarCategories").empty(); jQuery("#sideBarCategories").append('&nbsp;&nbsp;<b class="redTitle">Ihre Anfrage lieferte keine Ergebnisse</b><p/>'); jQuery("#sideBarCategories").append('<table width="100%" cellpadding="2" cellspacing="0"' + ' id="#sideBarCategoriesTable"></table>'); if (debug) log('Fehler beim Suchen aufgetreten' + x.statusText); } }); }
type: "GET", url: anotherUrl,
type: "POST", url: SERVICE_URL, data: body, beforeSend: function(xhr) {xhr.setRequestHeader("Content-Type", "application/json")},
function searchRequest(query) { if (typeof query == "undefined") var queryString= jQuery("#searchInputField").attr("value"); else queryString = query; if(debug) log('start searching for ' + queryString); queryString = urlencode(queryString); var anotherUrl = HIDDEN_SERVICE_URL + 'searchGeoObjects.php?query=' + queryString + '&topicmapId=' + topicId + '&workspaceId=' + workspaceId; showProgressInSideBar("Suchanfrage"); jQuery.ajax({ type: "GET", url: anotherUrl, dataType: 'json', async: true, success: function(obj){ // log('got respoonse ' + obj.result.toString()); initResultList(obj.result); if (debug) log('search delivered ' + obj.result.length + ' results'); }, error: function(x, s, e){ hideProgressFromSideBar(); jQuery("#sideBarCategories").empty(); jQuery("#sideBarCategories").append('&nbsp;&nbsp;<b class="redTitle">Ihre Anfrage lieferte keine Ergebnisse</b><p/>'); jQuery("#sideBarCategories").append('<table width="100%" cellpadding="2" cellspacing="0"' + ' id="#sideBarCategoriesTable"></table>'); if (debug) log('Fehler beim Suchen aufgetreten' + x.statusText); } }); }
function selectAndShowInMap(originId) { var feature = checkFeatureByOriginId(originId);
function selectAndShowInMap(originId, isTopicId) { var feature = null; if (isTopicId) { feature = checkFeatureByTopicId(originId); } else { feature = checkFeatureByOriginId(originId); }
function selectAndShowInMap(originId) { var feature = checkFeatureByOriginId(originId); if (feature == null) { // project could not be assoiciated with a correct address, though is not published // ### TODO: showInfo in SideBar var helpHtmlOne = '<br/><b class="redTitle">Entschuldigen sie bitte, die Projektadresse ist unbekannt.</b><p/> ' + 'F&uuml;r diese <i>Einsatzm&ouml;glichkeit</i> ist die Adresse des Einsatzortes nicht bekannt bzw. ' + 'fehlerhaft und daher k&ouml;nnen wir ihnen an dieser Stelle keine zus&auml;tzlichen Informationen anzeigen. <p/>' + ' Die Kontaktinformationen zu dieser <i>Einsatzm&ouml;glichkeit</i> erhalten sie auf der ' + ' <a href="http://www.berlin.de/buergeraktiv/ehrenamtsnetz/angebote/' + 'index.cfm?dateiname=ea_projekt_beschreibung.cfm&cfide=0.304475484697&&anwender_id=5&id=0&ehrenamt_id=0&projekt_id=' + originId +'&seite=1&organisation_id=0">vorherigen Seite.</a><br/>'; helpHtmlOne += '<br/> Sie k&ouml;nnen nat&uuml;rlich auch in dieser Ansicht weiter nach <a href="javascript:updateCategoryList(1);">Einsatzm&ouml;glichkeiten</a> in ihrer Umgebung navigieren.'; jQuery("#sideBarCategories").html(helpHtmlOne); } else { // log("linking in and showing " + feature.data.topicName); var catId = getTopicById(feature.data.topicId).criterias[1].categories[0]; // NOTE: just works for the herewith fixed default 2 TODO: createSlimGeoObject(has to assemble the crtierias with the help of CityMpa.getSeachCriteria() to mach always to the first criteria);criteria (zielgruppe) toggleMarkerGroups(catId); // showTopicInMap(feature.data.topicId); } }
E.innerHTML="";},_makeColorButton:function(E){if(!this._colorPicker){this._createColorPicker(this.get("id"));}E.type="color";E.menu=new YAHOO.widget.Overlay(this.get("id")+"_"+E.value+"_menu",{visible:false,position:"absolute",iframe:true});E.menu.setBody("");E.menu.render(this.get("cont"));C.addClass(E.menu.element,"yui-button-menu");C.addClass(E.menu.element,"yui-color-button-menu");E.menu.beforeShowEvent.subscribe(function(){E.menu.cfg.setProperty("zindex",5);E.menu.cfg.setProperty("context",[this.getButtonById(E.id).get("element"),"tl","bl"]);this._resetColorPicker();var F=this._colorPicker;if(F.parentNode){F.parentNode.removeChild(F);}E.menu.setBody("");E.menu.appendToBody(F);this._colorPicker.style.display="block";},this,true);return E;},_makeSpinButton:function(R,L){R.addClass(this.CLASS_PREFIX+"-spinbutton");var S=this,N=R._button.parentNode.parentNode,I=L.range,H=document.createElement("a"),G=document.createElement("a");H.href="#";G.href="#";H.tabIndex="-1";G.tabIndex="-1";H.className="up";H.title=this.STR_SPIN_UP;H.innerHTML=this.STR_SPIN_UP;G.className="down";G.title=this.STR_SPIN_DOWN;G.innerHTML=this.STR_SPIN_DOWN;N.appendChild(H);N.appendChild(G);var M=YAHOO.lang.substitute(this.STR_SPIN_LABEL,{VALUE:R.get("label")});R.set("title",M);var Q=function(T){T=((T<I[0])?I[0]:T);T=((T>I[1])?I[1]:T);return T;};var P=this.browser;var F=false;var K=this.STR_SPIN_LABEL;if(this._titlebar&&this._titlebar.firstChild){F=this._titlebar.firstChild;}var E=function(U){YAHOO.util.Event.stopEvent(U);if(!R.get("disabled")&&(U.keyCode!=9)){var V=parseInt(R.get("label"),10);V++;V=Q(V);R.set("label",""+V);var T=YAHOO.lang.substitute(K,{VALUE:R.get("label")});R.set("title",T);if(!P.webkit&&F){}S._buttonClick(U,L);}};var O=function(U){YAHOO.util.Event.stopEvent(U);if(!R.get("disabled")&&(U.keyCode!=9)){var V=parseInt(R.get("label"),10);V--;V=Q(V);R.set("label",""+V);var T=YAHOO.lang.substitute(K,{VALUE:R.get("label")});R.set("title",T);if(!P.webkit&&F){}S._buttonClick(U,L);}};var J=function(T){if(T.keyCode==38){E(T);}else{if(T.keyCode==40){O(T);}else{if(T.keyCode==107&&T.shiftKey){E(T);}else{if(T.keyCode==109&&T.shiftKey){O(T);}}}}};R.on("keydown",J,this,true);A.on(H,"mousedown",function(T){A.stopEvent(T);},this,true);A.on(G,"mousedown",function(T){A.stopEvent(T);},this,true);A.on(H,"click",E,this,true);A.on(G,"click",O,this,true);},_buttonClick:function(L,F){var E=true;if(L&&L.type=="keypress"){if(L.keyCode==9){E=false;}else{if((L.keyCode===13)||(L.keyCode===0)||(L.keyCode===32)){}else{E=false;}}}if(E){var N=true,H=false;F.isSelected=this.isSelected(F.id);if(F.value){H=this.fireEvent(F.value+"Click",{type:F.value+"Click",target:this.get("element"),button:F});if(H===false){N=false;}}if(F.menucmd&&N){H=this.fireEvent(F.menucmd+"Click",{type:F.menucmd+"Click",target:this.get("element"),button:F});if(H===false){N=false;}}if(N){this.fireEvent("buttonClick",{type:"buttonClick",target:this.get("element"),button:F});}if(F.type=="select"){var K=this.getButtonById(F.id);if(K.buttonType=="rich"){var J=F.value;for(var I=0;I<F.menu.length;I++){if(F.menu[I].value==F.value){J=F.menu[I].text;break;}}K.set("label",'<span class="yui-toolbar-'+F.menucmd+"-"+(F.value).replace(/ /g,"-").toLowerCase()+'">'+J+"</span>");var M=K.getMenu().getItems();for(var G=0;G<M.length;G++){if(M[G].value.toLowerCase()==F.value.toLowerCase()){M[G].cfg.setProperty("checked",true);}else{M[G].cfg.setProperty("checked",false);}}}}if(L){A.stopEvent(L);}}},_keyNav:null,_navCounter:null,_navigateButtons:function(F){switch(F.keyCode){case 37:case 39:if(F.keyCode==37){this._navCounter--;}else{this._navCounter++;}if(this._navCounter>(this._buttonList.length-1)){this._navCounter=0;}if(this._navCounter<0){this._navCounter=(this._buttonList.length-1);}if(this._buttonList[this._navCounter]){var E=this._buttonList[this._navCounter].get("element");if(this.browser.ie){E=this._buttonList[this._navCounter].get("element").getElementsByTagName("a")[0];}if(this._buttonList[this._navCounter].get("disabled")){this._navigateButtons(F);}else{E.focus();}}break;}},_handleFocus:function(){if(!this._keyNav){var E="keypress";if(this.browser.ie){E="keydown";}A.on(this.get("element"),E,this._navigateButtons,this,true);this._keyNav=true;this._navCounter=-1;}},getButtonById:function(G){var E=this._buttonList.length;for(var F=0;F<E;F++){if(this._buttonList[F]&&this._buttonList[F].get("id")==G){return this._buttonList[F];}}return false;},getButtonByValue:function(K){var H=this.get("buttons");var F=H.length;for(var I=0;I<F;I++){if(H[I].group!==undefined){for(var E=0;E<H[I].buttons.length;E++){if((H[I].buttons[E].value==K)||(H[I].buttons[E].menucmd==K)){return this.getButtonById(H[I].buttons[E].id);}if(H[I].buttons[E].menu){for(var J=0;J<H[I].buttons[E].menu.length;J++){if(H[I].buttons[E].menu[J].value==K){return this.getButtonById(H[I].buttons[E].id);}}}}}else{if((H[I].value==K)||(H[I].menucmd==K)){return this.getButtonById(H[I].id);}if(H[I].menu){for(var G=0;G<H[I].menu.length;G++){if(H[I].menu[G].value==K){return this.getButtonById(H[I].id);}}}}}return false;},getButtonByIndex:function(E){if(this._buttonList[E]){return this._buttonList[E];}else{return false;}},getButtons:function(){return this._buttonList;},disableButton:function(F){var E=B.call(this,F);if(E){E.set("disabled",true);}else{return false;}},enableButton:function(F){if(this.get("disabled")){return false;}var E=B.call(this,F);if(E){if(E.get("disabled")){E.set("disabled",false);}}else{return false;}},isSelected:function(F){var E=B.call(this,F);if(E){return E._selected;}return false;},selectButton:function(I,G){var F=B.call(this,I);if(F){F.addClass("yui-button-selected");F.addClass("yui-button-"+F.get("value")+"-selected");F._selected=true;if(G){if(F.buttonType=="rich"){var H=F.getMenu().getItems();for(var E=0;E<H.length;E++){if(H[E].value==G){H[E].cfg.setProperty("checked",true);F.set("label",'<span class="yui-toolbar-'+F.get("value")+"-"+(G).replace(/ /g,"-").toLowerCase()+'">'+H[E]._oText.nodeValue+"</span>");}else{H[E].cfg.setProperty("checked",false); }}}}}else{return false;}},deselectButton:function(F){var E=B.call(this,F);if(E){E.removeClass("yui-button-selected");E.removeClass("yui-button-"+E.get("value")+"-selected");E.removeClass("yui-button-hover");E._selected=false;}else{return false;}},deselectAllButtons:function(){var E=this._buttonList.length;for(var F=0;F<E;F++){this.deselectButton(this._buttonList[F]);}},disableAllButtons:function(){if(this.get("disabled")){return false;}var E=this._buttonList.length;for(var F=0;F<E;F++){this.disableButton(this._buttonList[F]);}},enableAllButtons:function(){if(this.get("disabled")){return false;}var E=this._buttonList.length;for(var F=0;F<E;F++){this.enableButton(this._buttonList[F]);}},resetAllButtons:function(I){if(!D.isObject(I)){I={};}if(this.get("disabled")){return false;}var E=this._buttonList.length;for(var F=0;F<E;F++){var H=this._buttonList[F];if(H){var G=H._configs.disabled._initialConfig.value;if(I[H.get("id")]){this.enableButton(H);this.selectButton(H);}else{if(G){this.disableButton(H);}else{this.enableButton(H);}this.deselectButton(H);}}}},destroyButton:function(I){var G=B.call(this,I);if(G){var H=G.get("id");G.destroy();var E=this._buttonList.length;for(var F=0;F<E;F++){if(this._buttonList[F]&&this._buttonList[F].get("id")==H){this._buttonList[F]=null;}}}else{return false;}},destroy:function(){this.get("element").innerHTML="";this.get("element").className="";for(var E in this){if(D.hasOwnProperty(this,E)){this[E]=null;}}return true;},collapse:function(F){var E=C.getElementsByClassName("collapse","span",this._titlebar);if(F===false){C.removeClass(this.get("cont").parentNode,"yui-toolbar-container-collapsed");if(E[0]){C.removeClass(E[0],"collapsed");}this.fireEvent("toolbarExpanded",{type:"toolbarExpanded",target:this});}else{if(E[0]){C.addClass(E[0],"collapsed");}C.addClass(this.get("cont").parentNode,"yui-toolbar-container-collapsed");this.fireEvent("toolbarCollapsed",{type:"toolbarCollapsed",target:this});}},toString:function(){return"Toolbar (#"+this.get("element").id+") with "+this._buttonList.length+" buttons.";}});})();(function(){var C=YAHOO.util.Dom,A=YAHOO.util.Event,D=YAHOO.lang,B=YAHOO.widget.Toolbar;YAHOO.widget.SimpleEditor=function(H,M){var G={};if(D.isObject(H)&&(!H.tagName)&&!M){D.augmentObject(G,H);H=document.createElement("textarea");this.DOMReady=true;if(G.container){var K=C.get(G.container);K.appendChild(H);}else{document.body.appendChild(H);}}else{if(M){D.augmentObject(G,M);}}var I={element:null,attributes:G},F=null;if(D.isString(H)){F=H;}else{if(I.attributes.id){F=I.attributes.id;}else{this.DOMReady=true;F=C.generateId(H);}}I.element=H;var J=document.createElement("DIV");I.attributes.element_cont=new YAHOO.util.Element(J,{id:F+"_container"});var E=document.createElement("div");C.addClass(E,"first-child");I.attributes.element_cont.appendChild(E);if(!I.attributes.toolbar_cont){I.attributes.toolbar_cont=document.createElement("DIV");I.attributes.toolbar_cont.id=F+"_toolbar";E.appendChild(I.attributes.toolbar_cont);}var L=document.createElement("DIV");E.appendChild(L);I.attributes.editor_wrapper=L;YAHOO.widget.SimpleEditor.superclass.constructor.call(this,I.element,I.attributes);};YAHOO.extend(YAHOO.widget.SimpleEditor,YAHOO.util.Element,{_resizeConfig:{handles:["br"],autoRatio:true,status:true,proxy:true,useShim:true,setSize:false},_setupResize:function(){if(!YAHOO.util.DD||!YAHOO.util.Resize){return false;}if(this.get("resize")){var E={};D.augmentObject(E,this._resizeConfig);this.resize=new YAHOO.util.Resize(this.get("element_cont").get("element"),E);this.resize.on("resize",function(G){var K=this.get("animate");this.set("animate",false);this.set("width",G.width+"px");var H=G.height,I=(this.toolbar.get("element").clientHeight+2),J=0;if(this.dompath){J=(this.dompath.clientHeight+1);}var F=(H-I-J);this.set("height",F+"px");this.get("element_cont").setStyle("height","");this.set("animate",K);},this,true);}},resize:null,_setupDD:function(){if(!YAHOO.util.DD){return false;}if(this.get("drag")){var F=this.get("drag"),E=YAHOO.util.DD;if(F==="proxy"){E=YAHOO.util.DDProxy;}this.dd=new E(this.get("element_cont").get("element"));this.toolbar.addClass("draggable");this.dd.setHandleElId(this.toolbar._titlebar);}},dd:null,_lastCommand:null,_undoNodeChange:function(){},_storeUndo:function(){},_checkKey:function(E,H){var F=false;if((H.keyCode===E.key)){if(E.mods&&(E.mods.length>0)){var I=0;for(var G=0;G<E.mods.length;G++){if(this.browser.mac){if(E.mods[G]=="ctrl"){E.mods[G]="meta";}}if(H[E.mods[G]+"Key"]===true){I++;}}if(I===E.mods.length){F=true;}}else{F=true;}}return F;},_keyMap:{SELECT_ALL:{key:65,mods:["ctrl"]},CLOSE_WINDOW:{key:87,mods:["shift","ctrl"]},FOCUS_TOOLBAR:{key:27,mods:["shift"]},FOCUS_AFTER:{key:27},CREATE_LINK:{key:76,mods:["shift","ctrl"]},BOLD:{key:66,mods:["shift","ctrl"]},ITALIC:{key:73,mods:["shift","ctrl"]},UNDERLINE:{key:85,mods:["shift","ctrl"]},UNDO:{key:90,mods:["ctrl"]},REDO:{key:90,mods:["shift","ctrl"]},JUSTIFY_LEFT:{key:219,mods:["shift","ctrl"]},JUSTIFY_CENTER:{key:220,mods:["shift","ctrl"]},JUSTIFY_RIGHT:{key:221,mods:["shift","ctrl"]}},_cleanClassName:function(E){return E.replace(/ /g,"-").toLowerCase();},_textarea:null,_docType:'<!DOCTYPE HTML PUBLIC "-/'+"/W3C/"+"/DTD HTML 4.01/"+'/EN" "http:/'+'/www.w3.org/TR/html4/strict.dtd">',editorDirty:null,_defaultCSS:"html { height: 95%; } body { padding: 7px; background-color: #fff; font:13px/1.22 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small; } a, a:visited, a:hover { color: blue !important; text-decoration: underline !important; cursor: text !important; } .warning-localfile { border-bottom: 1px dashed red !important; } .yui-busy { cursor: wait !important; } img.selected { border: 2px dotted #808080; } img { cursor: pointer !important; border: none; } body.ptags.webkit div { margin: 11px 0; }",_defaultToolbar:null,_lastButton:null,_baseHREF:function(){var E=document.location.href;if(E.indexOf("?")!==-1){E=E.substring(0,E.indexOf("?"));}E=E.substring(0,E.lastIndexOf("/"))+"/";return E;
(function(){var b=YAHOO.util.Dom,a=YAHOO.util.Event,c=YAHOO.lang;if(YAHOO.widget.Button){YAHOO.widget.ToolbarButtonAdvanced=YAHOO.widget.Button;YAHOO.widget.ToolbarButtonAdvanced.prototype.buttonType="rich";YAHOO.widget.ToolbarButtonAdvanced.prototype.checkValue=function(f){var e=this.getMenu().getItems();if(e.length===0){this.getMenu()._onBeforeShow();e=this.getMenu().getItems()}for(var d=0;d<e.length;d++){e[d].cfg.setProperty("checked",false);if(e[d].value==f){e[d].cfg.setProperty("checked",true)}}}}else{YAHOO.widget.ToolbarButtonAdvanced=function(){}}YAHOO.widget.ToolbarButton=function(e,d){if(c.isObject(arguments[0])&&!b.get(e).nodeType){d=e}var g=(d||{});var f={element:null,attributes:g};if(!f.attributes.type){f.attributes.type="push"}f.element=document.createElement("span");f.element.setAttribute("unselectable","on");f.element.className="yui-button yui-"+f.attributes.type+"-button";f.element.innerHTML='<span class="first-child"><a href="#">LABEL</a></span>';f.element.firstChild.firstChild.tabIndex="-1";f.attributes.id=b.generateId();YAHOO.widget.ToolbarButton.superclass.constructor.call(this,f.element,f.attributes)};YAHOO.extend(YAHOO.widget.ToolbarButton,YAHOO.util.Element,{buttonType:"normal",_handleMouseOver:function(){if(!this.get("disabled")){this.addClass("yui-button-hover");this.addClass("yui-"+this.get("type")+"-button-hover")}},_handleMouseOut:function(){this.removeClass("yui-button-hover");this.removeClass("yui-"+this.get("type")+"-button-hover")},checkValue:function(f){if(this.get("type")=="menu"){var e=this._button.options;for(var d=0;d<e.length;d++){if(e[d].value==f){e.selectedIndex=d}}}},init:function(e,d){YAHOO.widget.ToolbarButton.superclass.init.call(this,e,d);this.on("mouseover",this._handleMouseOver,this,true);this.on("mouseout",this._handleMouseOut,this,true)},initAttributes:function(d){YAHOO.widget.ToolbarButton.superclass.initAttributes.call(this,d);this.setAttributeConfig("value",{value:d.value});this.setAttributeConfig("menu",{value:d.menu||false});this.setAttributeConfig("type",{value:d.type,writeOnce:true,method:function(h){var g,f;if(!this._button){this._button=this.get("element").getElementsByTagName("a")[0]}switch(h){case"select":case"menu":g=document.createElement("select");var j=this.get("menu");for(var e=0;e<j.length;e++){f=document.createElement("option");f.innerHTML=j[e].text;f.value=j[e].value;if(j[e].checked){f.selected=true}g.appendChild(f)}this._button.parentNode.replaceChild(g,this._button);a.on(g,"change",this._handleSelect,this,true);this._button=g;break}}});this.setAttributeConfig("disabled",{value:d.disabled||false,method:function(e){if(e){this.addClass("yui-button-disabled");this.addClass("yui-"+this.get("type")+"-button-disabled")}else{this.removeClass("yui-button-disabled");this.removeClass("yui-"+this.get("type")+"-button-disabled")}if(this.get("type")=="menu"){this._button.disabled=e}}});this.setAttributeConfig("label",{value:d.label,method:function(e){if(!this._button){this._button=this.get("element").getElementsByTagName("a")[0]}if(this.get("type")=="push"){this._button.innerHTML=e}}});this.setAttributeConfig("title",{value:d.title});this.setAttributeConfig("container",{value:null,writeOnce:true,method:function(e){this.appendTo(e)}})},_handleSelect:function(e){var d=a.getTarget(e);var f=d.options[d.selectedIndex].value;this.fireEvent("change",{type:"change",value:f})},getMenu:function(){return this.get("menu")},destroy:function(){a.purgeElement(this.get("element"),true);this.get("element").parentNode.removeChild(this.get("element"));for(var d in this){if(c.hasOwnProperty(this,d)){this[d]=null}}},fireEvent:function(e,d){if(this.DOM_EVENTS[e]&&this.get("disabled")){return}YAHOO.widget.ToolbarButton.superclass.fireEvent.call(this,e,d)},toString:function(){return"ToolbarButton ("+this.get("id")+")"}})})();(function(){var c=YAHOO.util.Dom,a=YAHOO.util.Event,d=YAHOO.lang;var b=function(f){var e=f;if(d.isString(f)){e=this.getButtonById(f)}if(d.isNumber(f)){e=this.getButtonByIndex(f)}if((!(e instanceof YAHOO.widget.ToolbarButton))&&(!(e instanceof YAHOO.widget.ToolbarButtonAdvanced))){e=this.getButtonByValue(f)}if((e instanceof YAHOO.widget.ToolbarButton)||(e instanceof YAHOO.widget.ToolbarButtonAdvanced)){return e}return false};YAHOO.widget.Toolbar=function(i,h){if(d.isObject(arguments[0])&&!c.get(i).nodeType){h=i}var k={};if(h){d.augmentObject(k,h)}var j={element:null,attributes:k};if(d.isString(i)&&c.get(i)){j.element=c.get(i)}else{if(d.isObject(i)&&c.get(i)&&c.get(i).nodeType){j.element=c.get(i)}}if(!j.element){j.element=document.createElement("DIV");j.element.id=c.generateId();if(k.container&&c.get(k.container)){c.get(k.container).appendChild(j.element)}}if(!j.element.id){j.element.id=((d.isString(i))?i:c.generateId())}var f=document.createElement("fieldset");var g=document.createElement("legend");g.innerHTML="Toolbar";f.appendChild(g);var e=document.createElement("DIV");j.attributes.cont=e;c.addClass(e,"yui-toolbar-subcont");f.appendChild(e);j.element.appendChild(f);j.element.tabIndex=-1;j.attributes.element=j.element;j.attributes.id=j.element.id;YAHOO.widget.Toolbar.superclass.constructor.call(this,j.element,j.attributes)};YAHOO.extend(YAHOO.widget.Toolbar,YAHOO.util.Element,{_addMenuClasses:function(h,e,j){c.addClass(this.element,"yui-toolbar-"+j.get("value")+"-menu");if(c.hasClass(j._button.parentNode.parentNode,"yui-toolbar-select")){c.addClass(this.element,"yui-toolbar-select-menu")}var f=this.getItems();for(var g=0;g<f.length;g++){c.addClass(f[g].element,"yui-toolbar-"+j.get("value")+"-"+((f[g].value)?f[g].value.replace(/ /g,"-").toLowerCase():f[g]._oText.nodeValue.replace(/ /g,"-").toLowerCase()));c.addClass(f[g].element,"yui-toolbar-"+j.get("value")+"-"+((f[g].value)?f[g].value.replace(/ /g,"-"):f[g]._oText.nodeValue.replace(/ /g,"-")))}},buttonType:YAHOO.widget.ToolbarButton,dd:null,_colorData:{"#111111":"Obsidian","#2D2D2D":"Dark Gray","#434343":"Shale","#5B5B5B":"Flint","#737373":"Gray","#8B8B8B":"Concrete","#A2A2A2":"Gray","#B9B9B9":"Titanium","#000000":"Black","#D0D0D0":"Light Gray","#E6E6E6":"Silver","#FFFFFF":"White","#BFBF00":"Pumpkin","#FFFF00":"Yellow","#FFFF40":"Banana","#FFFF80":"Pale Yellow","#FFFFBF":"Butter","#525330":"Raw Siena","#898A49":"Mildew","#AEA945":"Olive","#7F7F00":"Paprika","#C3BE71":"Earth","#E0DCAA":"Khaki","#FCFAE1":"Cream","#60BF00":"Cactus","#80FF00":"Chartreuse","#A0FF40":"Green","#C0FF80":"Pale Lime","#DFFFBF":"Light Mint","#3B5738":"Green","#668F5A":"Lime Gray","#7F9757":"Yellow","#407F00":"Clover","#8A9B55":"Pistachio","#B7C296":"Light Jade","#E6EBD5":"Breakwater","#00BF00":"Spring Frost","#00FF80":"Pastel Green","#40FFA0":"Light Emerald","#80FFC0":"Sea Foam","#BFFFDF":"Sea Mist","#033D21":"Dark Forrest","#438059":"Moss","#7FA37C":"Medium Green","#007F40":"Pine","#8DAE94":"Yellow Gray Green","#ACC6B5":"Aqua Lung","#DDEBE2":"Sea Vapor","#00BFBF":"Fog","#00FFFF":"Cyan","#40FFFF":"Turquoise Blue","#80FFFF":"Light Aqua","#BFFFFF":"Pale Cyan","#033D3D":"Dark Teal","#347D7E":"Gray Turquoise","#609A9F":"Green Blue","#007F7F":"Seaweed","#96BDC4":"Green Gray","#B5D1D7":"Soapstone","#E2F1F4":"Light Turquoise","#0060BF":"Summer Sky","#0080FF":"Sky Blue","#40A0FF":"Electric Blue","#80C0FF":"Light Azure","#BFDFFF":"Ice Blue","#1B2C48":"Navy","#385376":"Biscay","#57708F":"Dusty Blue","#00407F":"Sea Blue","#7792AC":"Sky Blue Gray","#A8BED1":"Morning Sky","#DEEBF6":"Vapor","#0000BF":"Deep Blue","#0000FF":"Blue","#4040FF":"Cerulean Blue","#8080FF":"Evening Blue","#BFBFFF":"Light Blue","#212143":"Deep Indigo","#373E68":"Sea Blue","#444F75":"Night Blue","#00007F":"Indigo Blue","#585E82":"Dockside","#8687A4":"Blue Gray","#D2D1E1":"Light Blue Gray","#6000BF":"Neon Violet","#8000FF":"Blue Violet","#A040FF":"Violet Purple","#C080FF":"Violet Dusk","#DFBFFF":"Pale Lavender","#302449":"Cool Shale","#54466F":"Dark Indigo","#655A7F":"Dark Violet","#40007F":"Violet","#726284":"Smoky Violet","#9E8FA9":"Slate Gray","#DCD1DF":"Violet White","#BF00BF":"Royal Violet","#FF00FF":"Fuchsia","#FF40FF":"Magenta","#FF80FF":"Orchid","#FFBFFF":"Pale Magenta","#4A234A":"Dark Purple","#794A72":"Medium Purple","#936386":"Cool Granite","#7F007F":"Purple","#9D7292":"Purple Moon","#C0A0B6":"Pale Purple","#ECDAE5":"Pink Cloud","#BF005F":"Hot Pink","#FF007F":"Deep Pink","#FF409F":"Grape","#FF80BF":"Electric Pink","#FFBFDF":"Pink","#451528":"Purple Red","#823857":"Purple Dino","#A94A76":"Purple Gray","#7F003F":"Rose","#BC6F95":"Antique Mauve","#D8A5BB":"Cool Marble","#F7DDE9":"Pink Granite","#C00000":"Apple","#FF0000":"Fire Truck","#FF4040":"Pale Red","#FF8080":"Salmon","#FFC0C0":"Warm Pink","#441415":"Sepia","#82393C":"Rust","#AA4D4E":"Brick","#800000":"Brick Red","#BC6E6E":"Mauve","#D8A3A4":"Shrimp Pink","#F8DDDD":"Shell Pink","#BF5F00":"Dark Orange","#FF7F00":"Orange","#FF9F40":"Grapefruit","#FFBF80":"Canteloupe","#FFDFBF":"Wax","#482C1B":"Dark Brick","#855A40":"Dirt","#B27C51":"Tan","#7F3F00":"Nutmeg","#C49B71":"Mustard","#E1C4A8":"Pale Tan","#FDEEE0":"Marble"},_colorPicker:null,STR_COLLAPSE:"Collapse Toolbar",STR_SPIN_LABEL:"Spin Button with value {VALUE}. Use Control Shift Up Arrow and Control Shift Down arrow keys to increase or decrease the value.",STR_SPIN_UP:"Click to increase the value of this input",STR_SPIN_DOWN:"Click to decrease the value of this input",_titlebar:null,browser:YAHOO.env.ua,_buttonList:null,_buttonGroupList:null,_sep:null,_sepCount:null,_dragHandle:null,_toolbarConfigs:{renderer:true},CLASS_CONTAINER:"yui-toolbar-container",CLASS_DRAGHANDLE:"yui-toolbar-draghandle",CLASS_SEPARATOR:"yui-toolbar-separator",CLASS_DISABLED:"yui-toolbar-disabled",CLASS_PREFIX:"yui-toolbar",init:function(f,e){YAHOO.widget.Toolbar.superclass.init.call(this,f,e)},initAttributes:function(e){YAHOO.widget.Toolbar.superclass.initAttributes.call(this,e);this.addClass(this.CLASS_CONTAINER);this.setAttributeConfig("buttonType",{value:e.buttonType||"basic",writeOnce:true,validator:function(f){switch(f){case"advanced":case"basic":return true}return false},method:function(f){if(f=="advanced"){if(YAHOO.widget.Button){this.buttonType=YAHOO.widget.ToolbarButtonAdvanced}else{this.buttonType=YAHOO.widget.ToolbarButton}}else{this.buttonType=YAHOO.widget.ToolbarButton}}});this.setAttributeConfig("buttons",{value:[],writeOnce:true,method:function(g){for(var f in g){if(d.hasOwnProperty(g,f)){if(g[f].type=="separator"){this.addSeparator()}else{if(g[f].group!==undefined){this.addButtonGroup(g[f])}else{this.addButton(g[f])}}}}}});this.setAttributeConfig("disabled",{value:false,method:function(f){if(this.get("disabled")===f){return false}if(f){this.addClass(this.CLASS_DISABLED);this.set("draggable",false);this.disableAllButtons()}else{this.removeClass(this.CLASS_DISABLED);if(this._configs.draggable._initialConfig.value){this.set("draggable",true)}this.resetAllButtons()}}});this.setAttributeConfig("cont",{value:e.cont,readOnly:true});this.setAttributeConfig("grouplabels",{value:((e.grouplabels===false)?false:true),method:function(f){if(f){c.removeClass(this.get("cont"),(this.CLASS_PREFIX+"-nogrouplabels"))}else{c.addClass(this.get("cont"),(this.CLASS_PREFIX+"-nogrouplabels"))}}});this.setAttributeConfig("titlebar",{value:false,method:function(g){if(g){if(this._titlebar&&this._titlebar.parentNode){this._titlebar.parentNode.removeChild(this._titlebar)}this._titlebar=document.createElement("DIV");this._titlebar.tabIndex="-1";a.on(this._titlebar,"focus",function(){this._handleFocus()},this,true);c.addClass(this._titlebar,this.CLASS_PREFIX+"-titlebar");if(d.isString(g)){var f=document.createElement("h2");f.tabIndex="-1";f.innerHTML='<a href="#" tabIndex="0">'+g+"</a>";this._titlebar.appendChild(f);a.on(f.firstChild,"click",function(h){a.stopEvent(h)});a.on([f,f.firstChild],"focus",function(){this._handleFocus()},this,true)}if(this.get("firstChild")){this.insertBefore(this._titlebar,this.get("firstChild"))}else{this.appendChild(this._titlebar)}if(this.get("collapse")){this.set("collapse",true)}}else{if(this._titlebar){if(this._titlebar&&this._titlebar.parentNode){this._titlebar.parentNode.removeChild(this._titlebar)}}}}});this.setAttributeConfig("collapse",{value:false,method:function(h){if(this._titlebar){var g=null;var f=c.getElementsByClassName("collapse","span",this._titlebar);if(h){if(f.length>0){return true}g=document.createElement("SPAN");g.innerHTML="X";g.title=this.STR_COLLAPSE;c.addClass(g,"collapse");this._titlebar.appendChild(g);a.addListener(g,"click",function(){if(c.hasClass(this.get("cont").parentNode,"yui-toolbar-container-collapsed")){this.collapse(false)}else{this.collapse()}},this,true)}else{g=c.getElementsByClassName("collapse","span",this._titlebar);if(g[0]){if(c.hasClass(this.get("cont").parentNode,"yui-toolbar-container-collapsed")){this.collapse(false)}g[0].parentNode.removeChild(g[0])}}}}});this.setAttributeConfig("draggable",{value:(e.draggable||false),method:function(f){if(f&&!this.get("titlebar")){if(!this._dragHandle){this._dragHandle=document.createElement("SPAN");this._dragHandle.innerHTML="|";this._dragHandle.setAttribute("title","Click to drag the toolbar");this._dragHandle.id=this.get("id")+"_draghandle";c.addClass(this._dragHandle,this.CLASS_DRAGHANDLE);if(this.get("cont").hasChildNodes()){this.get("cont").insertBefore(this._dragHandle,this.get("cont").firstChild)}else{this.get("cont").appendChild(this._dragHandle)}this.dd=new YAHOO.util.DD(this.get("id"));this.dd.setHandleElId(this._dragHandle.id)}}else{if(this._dragHandle){this._dragHandle.parentNode.removeChild(this._dragHandle);this._dragHandle=null;this.dd=null}}if(this._titlebar){if(f){this.dd=new YAHOO.util.DD(this.get("id"));this.dd.setHandleElId(this._titlebar);c.addClass(this._titlebar,"draggable")}else{c.removeClass(this._titlebar,"draggable");if(this.dd){this.dd.unreg();this.dd=null}}}},validator:function(g){var f=true;if(!YAHOO.util.DD){f=false}return f}})},addButtonGroup:function(j){if(!this.get("element")){this._queue[this._queue.length]=["addButtonGroup",arguments];return false}if(!this.hasClass(this.CLASS_PREFIX+"-grouped")){this.addClass(this.CLASS_PREFIX+"-grouped")}var k=document.createElement("DIV");c.addClass(k,this.CLASS_PREFIX+"-group");c.addClass(k,this.CLASS_PREFIX+"-group-"+j.group);if(j.label){var f=document.createElement("h3");f.innerHTML=j.label;k.appendChild(f)}if(!this.get("grouplabels")){c.addClass(this.get("cont"),this.CLASS_PREFIX,"-nogrouplabels")}this.get("cont").appendChild(k);var h=document.createElement("ul");k.appendChild(h);if(!this._buttonGroupList){this._buttonGroupList={}}this._buttonGroupList[j.group]=h;for(var g=0;g<j.buttons.length;g++){var e=document.createElement("li");e.className=this.CLASS_PREFIX+"-groupitem";h.appendChild(e);if((j.buttons[g].type!==undefined)&&j.buttons[g].type=="separator"){this.addSeparator(e)}else{j.buttons[g].container=e;this.addButton(j.buttons[g])}}},addButtonToGroup:function(g,h,i){var f=this._buttonGroupList[h];var e=document.createElement("li");e.className=this.CLASS_PREFIX+"-groupitem";g.container=e;this.addButton(g,i);f.appendChild(e)},addButton:function(k,j){if(!this.get("element")){this._queue[this._queue.length]=["addButton",arguments];return false}if(!this._buttonList){this._buttonList=[]}if(!k.container){k.container=this.get("cont")}if((k.type=="menu")||(k.type=="split")||(k.type=="select")){if(d.isArray(k.menu)){for(var s in k.menu){if(d.hasOwnProperty(k.menu,s)){var y={fn:function(o,i,m){if(!k.menucmd){k.menucmd=k.value}k.value=((m.value)?m.value:m._oText.nodeValue)},scope:this};k.menu[s].onclick=y}}}}var t={},q=false;for(var n in k){if(d.hasOwnProperty(k,n)){if(!this._toolbarConfigs[n]){t[n]=k[n]}}}if(k.type=="select"){t.type="menu"}if(k.type=="spin"){t.type="push"}if(t.type=="color"){if(YAHOO.widget.Overlay){t=this._makeColorButton(t)}else{q=true}}if(t.menu){if((YAHOO.widget.Overlay)&&(k.menu instanceof YAHOO.widget.Overlay)){k.menu.showEvent.subscribe(function(){this._button=t})}else{for(var r=0;r<t.menu.length;r++){if(!t.menu[r].value){t.menu[r].value=t.menu[r].text}}if(this.browser.webkit){t.focusmenu=false}}}if(q){k=false}else{this._configs.buttons.value[this._configs.buttons.value.length]=k;var w=new this.buttonType(t);w.get("element").tabIndex="-1";w.get("element").setAttribute("role","button");w._selected=true;if(this.get("disabled")){w.set("disabled",true)}if(!k.id){k.id=w.get("id")}if(j){var f=w.get("element");var p=null;if(j.get){p=j.get("element").nextSibling}else{if(j.nextSibling){p=j.nextSibling}}if(p){p.parentNode.insertBefore(f,p)}}w.addClass(this.CLASS_PREFIX+"-"+w.get("value"));var v=document.createElement("span");v.className=this.CLASS_PREFIX+"-icon";w.get("element").insertBefore(v,w.get("firstChild"));if(w._button.tagName.toLowerCase()=="button"){w.get("element").setAttribute("unselectable","on");var x=document.createElement("a");x.innerHTML=w._button.innerHTML;x.href="#";x.tabIndex="-1";a.on(x,"click",function(i){a.stopEvent(i)});w._button.parentNode.replaceChild(x,w._button);w._button=x}if(k.type=="select"){if(w._button.tagName.toLowerCase()=="select"){v.parentNode.removeChild(v);var g=w._button;var u=w.get("element");u.parentNode.replaceChild(g,u)}else{w.addClass(this.CLASS_PREFIX+"-select")}}if(k.type=="spin"){if(!d.isArray(k.range)){k.range=[10,100]}this._makeSpinButton(w,k)}w.get("element").setAttribute("title",w.get("label"));if(k.type!="spin"){if((YAHOO.widget.Overlay)&&(t.menu instanceof YAHOO.widget.Overlay)){var h=function(o){var i=true;if(o.keyCode&&(o.keyCode==9)){i=false}if(i){if(this._colorPicker){this._colorPicker._button=k.value}var m=w.getMenu().element;if(c.getStyle(m,"visibility")=="hidden"){w.getMenu().show()}else{w.getMenu().hide()}}YAHOO.util.Event.stopEvent(o)};w.on("mousedown",h,k,this);w.on("keydown",h,k,this)}else{if((k.type!="menu")&&(k.type!="select")){w.on("keypress",this._buttonClick,k,this);w.on("mousedown",function(i){YAHOO.util.Event.stopEvent(i);this._buttonClick(i,k)},k,this);w.on("click",function(i){YAHOO.util.Event.stopEvent(i)})}else{w.on("mousedown",function(i){YAHOO.util.Event.stopEvent(i)});w.on("click",function(i){YAHOO.util.Event.stopEvent(i)});w.on("change",function(i){if(!k.menucmd){k.menucmd=k.value}k.value=i.value;this._buttonClick(i,k)},this,true);var l=this;w.on("appendTo",function(){var i=this;if(i.getMenu()&&i.getMenu().mouseDownEvent){i.getMenu().mouseDownEvent.subscribe(function(z,o){var m=o[1];YAHOO.util.Event.stopEvent(o[0]);i._onMenuClick(o[0],i);if(!k.menucmd){k.menucmd=k.value}k.value=((m.value)?m.value:m._oText.nodeValue);l._buttonClick.call(l,o[1],k);i._hideMenu();return false});i.getMenu().clickEvent.subscribe(function(o,m){YAHOO.util.Event.stopEvent(m[0])});i.getMenu().mouseUpEvent.subscribe(function(o,m){YAHOO.util.Event.stopEvent(m[0])})}})}}}else{w.on("mousedown",function(i){YAHOO.util.Event.stopEvent(i)});w.on("click",function(i){YAHOO.util.Event.stopEvent(i)})}if(this.browser.ie){}if(this.browser.webkit){w.hasFocus=function(){return true}}this._buttonList[this._buttonList.length]=w;if((k.type=="menu")||(k.type=="split")||(k.type=="select")){if(d.isArray(k.menu)){var e=w.getMenu();if(e&&e.renderEvent){e.renderEvent.subscribe(this._addMenuClasses,w);if(k.renderer){e.renderEvent.subscribe(k.renderer,w)}}}}}return k},addSeparator:function(e,h){if(!this.get("element")){this._queue[this._queue.length]=["addSeparator",arguments];return false}var f=((e)?e:this.get("cont"));if(!this.get("element")){this._queue[this._queue.length]=["addSeparator",arguments];return false}if(this._sepCount===null){this._sepCount=0}if(!this._sep){this._sep=document.createElement("SPAN");c.addClass(this._sep,this.CLASS_SEPARATOR);this._sep.innerHTML="|"}var g=this._sep.cloneNode(true);this._sepCount++;c.addClass(g,this.CLASS_SEPARATOR+"-"+this._sepCount);if(h){var i=null;if(h.get){i=h.get("element").nextSibling}else{if(h.nextSibling){i=h.nextSibling}else{i=h}}if(i){if(i==h){i.parentNode.appendChild(g)}else{i.parentNode.insertBefore(g,i)}}}else{f.appendChild(g)}return g},_createColorPicker:function(h){if(c.get(h+"_colors")){c.get(h+"_colors").parentNode.removeChild(c.get(h+"_colors"))}var e=document.createElement("div");e.className="yui-toolbar-colors";e.id=h+"_colors";e.style.display="none";a.on(window,"load",function(){document.body.appendChild(e)},this,true);this._colorPicker=e;var g="";for(var f in this._colorData){if(d.hasOwnProperty(this._colorData,f)){g+='<a style="background-color: '+f+'" href="#">'+f.replace("#","")+"</a>"}}g+="<span><em>X</em><strong></strong></span>";window.setTimeout(function(){e.innerHTML=g},0);a.on(e,"mouseover",function(m){var k=this._colorPicker;var l=k.getElementsByTagName("em")[0];var j=k.getElementsByTagName("strong")[0];var i=a.getTarget(m);if(i.tagName.toLowerCase()=="a"){l.style.backgroundColor=i.style.backgroundColor;j.innerHTML=this._colorData["#"+i.innerHTML]+"<br>"+i.innerHTML}},this,true);a.on(e,"focus",function(i){a.stopEvent(i)});a.on(e,"click",function(i){a.stopEvent(i)});a.on(e,"mousedown",function(j){a.stopEvent(j);var i=a.getTarget(j);if(i.tagName.toLowerCase()=="a"){var l=this.fireEvent("colorPickerClicked",{type:"colorPickerClicked",target:this,button:this._colorPicker._button,color:i.innerHTML,colorName:this._colorData["#"+i.innerHTML]});if(l!==false){var k={color:i.innerHTML,colorName:this._colorData["#"+i.innerHTML],value:this._colorPicker._button};this.fireEvent("buttonClick",{type:"buttonClick",target:this.get("element"),button:k})}this.getButtonByValue(this._colorPicker._button).getMenu().hide()}},this,true)},_resetColorPicker:function(){var f=this._colorPicker.getElementsByTagName("em")[0];var e=this._colorPicker.getElementsByTagName("strong")[0];f.style.backgroundColor="transparent";e.innerHTML=""},_makeColorButton:function(e){if(!this._colorPicker){this._createColorPicker(this.get("id"))}e.type="color";e.menu=new YAHOO.widget.Overlay(this.get("id")+"_"+e.value+"_menu",{visible:false,position:"absolute",iframe:true});e.menu.setBody("");e.menu.render(this.get("cont"));c.addClass(e.menu.element,"yui-button-menu");c.addClass(e.menu.element,"yui-color-button-menu");e.menu.beforeShowEvent.subscribe(function(){e.menu.cfg.setProperty("zindex",5);e.menu.cfg.setProperty("context",[this.getButtonById(e.id).get("element"),"tl","bl"]);this._resetColorPicker();var f=this._colorPicker;if(f.parentNode){f.parentNode.removeChild(f)}e.menu.setBody("");e.menu.appendToBody(f);this._colorPicker.style.display="block"},this,true);return e},_makeSpinButton:function(r,l){r.addClass(this.CLASS_PREFIX+"-spinbutton");var s=this,n=r._button.parentNode.parentNode,i=l.range,h=document.createElement("a"),g=document.createElement("a");h.href="#";g.href="#";h.tabIndex="-1";g.tabIndex="-1";h.className="up";h.title=this.STR_SPIN_UP;h.innerHTML=this.STR_SPIN_UP;g.className="down";g.title=this.STR_SPIN_DOWN;g.innerHTML=this.STR_SPIN_DOWN;n.appendChild(h);n.appendChild(g);var m=YAHOO.lang.substitute(this.STR_SPIN_LABEL,{VALUE:r.get("label")});r.set("title",m);var q=function(t){t=((t<i[0])?i[0]:t);t=((t>i[1])?i[1]:t);return t};var p=this.browser;var f=false;var k=this.STR_SPIN_LABEL;if(this._titlebar&&this._titlebar.firstChild){f=this._titlebar.firstChild}var e=function(u){YAHOO.util.Event.stopEvent(u);if(!r.get("disabled")&&(u.keyCode!=9)){var v=parseInt(r.get("label"),10);v++;v=q(v);r.set("label",""+v);var t=YAHOO.lang.substitute(k,{VALUE:r.get("label")});r.set("title",t);if(!p.webkit&&f){}s._buttonClick(u,l)}};var o=function(u){YAHOO.util.Event.stopEvent(u);if(!r.get("disabled")&&(u.keyCode!=9)){var v=parseInt(r.get("label"),10);v--;v=q(v);r.set("label",""+v);var t=YAHOO.lang.substitute(k,{VALUE:r.get("label")});r.set("title",t);if(!p.webkit&&f){}s._buttonClick(u,l)}};var j=function(t){if(t.keyCode==38){e(t)}else{if(t.keyCode==40){o(t)}else{if(t.keyCode==107&&t.shiftKey){e(t)}else{if(t.keyCode==109&&t.shiftKey){o(t)}}}}};r.on("keydown",j,this,true);a.on(h,"mousedown",function(t){a.stopEvent(t)},this,true);a.on(g,"mousedown",function(t){a.stopEvent(t)},this,true);a.on(h,"click",e,this,true);a.on(g,"click",o,this,true)},_buttonClick:function(n,f){var e=true;if(n&&n.type=="keypress"){if(n.keyCode==9){e=false}else{if((n.keyCode===13)||(n.keyCode===0)||(n.keyCode===32)){}else{e=false}}}if(e){var p=true,h=false;f.isSelected=this.isSelected(f.id);if(f.value){h=this.fireEvent(f.value+"Click",{type:f.value+"Click",target:this.get("element"),button:f});if(h===false){p=false}}if(f.menucmd&&p){h=this.fireEvent(f.menucmd+"Click",{type:f.menucmd+"Click",target:this.get("element"),button:f});if(h===false){p=false}}if(p){this.fireEvent("buttonClick",{type:"buttonClick",target:this.get("element"),button:f})}if(f.type=="select"){var l=this.getButtonById(f.id);if(l.buttonType=="rich"){var k=f.value;for(var j=0;j<f.menu.length;j++){if(f.menu[j].value==f.value){k=f.menu[j].text;break}}l.set("label",'<span class="yui-toolbar-'+f.menucmd+"-"+(f.value).replace(/ /g,"-").toLowerCase()+'">'+k+"</span>");var o=l.getMenu().getItems();for(var g=0;g<o.length;g++){if(o[g].value.toLowerCase()==f.value.toLowerCase()){o[g].cfg.setProperty("checked",true)}else{o[g].cfg.setProperty("checked",false)}}}}if(n){a.stopEvent(n)}}},_keyNav:null,_navCounter:null,_navigateButtons:function(f){switch(f.keyCode){case 37:case 39:if(f.keyCode==37){this._navCounter--}else{this._navCounter++}if(this._navCounter>(this._buttonList.length-1)){this._navCounter=0}if(this._navCounter<0){this._navCounter=(this._buttonList.length-1)}if(this._buttonList[this._navCounter]){var e=this._buttonList[this._navCounter].get("element");if(this.browser.ie){e=this._buttonList[this._navCounter].get("element").getElementsByTagName("a")[0]}if(this._buttonList[this._navCounter].get("disabled")){this._navigateButtons(f)}else{e.focus()}}break}},_handleFocus:function(){if(!this._keyNav){var e="keypress";if(this.browser.ie){e="keydown"}a.on(this.get("element"),e,this._navigateButtons,this,true);this._keyNav=true;this._navCounter=-1}},getButtonById:function(g){var e=this._buttonList.length;for(var f=0;f<e;f++){if(this._buttonList[f]&&this._buttonList[f].get("id")==g){return this._buttonList[f]}}return false},getButtonByValue:function(n){var h=this.get("buttons");var f=h.length;for(var k=0;k<f;k++){if(h[k].group!==undefined){for(var e=0;e<h[k].buttons.length;e++){if((h[k].buttons[e].value==n)||(h[k].buttons[e].menucmd==n)){return this.getButtonById(h[k].buttons[e].id)}if(h[k].buttons[e].menu){for(var l=0;l<h[k].buttons[e].menu.length;l++){if(h[k].buttons[e].menu[l].value==n){return this.getButtonById(h[k].buttons[e].id)}}}}}else{if((h[k].value==n)||(h[k].menucmd==n)){return this.getButtonById(h[k].id)}if(h[k].menu){for(var g=0;g<h[k].menu.length;g++){if(h[k].menu[g].value==n){return this.getButtonById(h[k].id)}}}}}return false},getButtonByIndex:function(e){if(this._buttonList[e]){return this._buttonList[e]}else{return false}},getButtons:function(){return this._buttonList},disableButton:function(f){var e=b.call(this,f);if(e){e.set("disabled",true)}else{return false}},enableButton:function(f){if(this.get("disabled")){return false}var e=b.call(this,f);if(e){if(e.get("disabled")){e.set("disabled",false)}}else{return false}},isSelected:function(f){var e=b.call(this,f);if(e){return e._selected}return false},selectButton:function(i,g){var f=b.call(this,i);if(f){f.addClass("yui-button-selected");f.addClass("yui-button-"+f.get("value")+"-selected");f._selected=true;if(g){if(f.buttonType=="rich"){var h=f.getMenu().getItems();for(var e=0;e<h.length;e++){if(h[e].value==g){h[e].cfg.setProperty("checked",true);f.set("label",'<span class="yui-toolbar-'+f.get("value")+"-"+(g).replace(/ /g,"-").toLowerCase()+'">'+h[e]._oText.nodeValue+"</span>")}else{h[e].cfg.setProperty("checked",false)}}}}}else{return false}},deselectButton:function(f){var e=b.call(this,f);if(e){e.removeClass("yui-button-selected");e.removeClass("yui-button-"+e.get("value")+"-selected");e.removeClass("yui-button-hover");e._selected=false}else{return false}},deselectAllButtons:function(){var e=this._buttonList.length;for(var f=0;f<e;f++){this.deselectButton(this._buttonList[f])}},disableAllButtons:function(){if(this.get("disabled")){return false}var e=this._buttonList.length;for(var f=0;f<e;f++){this.disableButton(this._buttonList[f])}},enableAllButtons:function(){if(this.get("disabled")){return false}var e=this._buttonList.length;for(var f=0;f<e;f++){this.enableButton(this._buttonList[f])}},resetAllButtons:function(j){if(!d.isObject(j)){j={}}if(this.get("disabled")){return false}var e=this._buttonList.length;for(var f=0;f<e;f++){var h=this._buttonList[f];if(h){var g=h._configs.disabled._initialConfig.value;if(j[h.get("id")]){this.enableButton(h);this.selectButton(h)}else{if(g){this.disableButton(h)}else{this.enableButton(h)}this.deselectButton(h)}}}},destroyButton:function(j){var g=b.call(this,j);if(g){var h=g.get("id");g.destroy();var e=this._buttonList.length;for(var f=0;f<e;f++){if(this._buttonList[f]&&this._buttonList[f].get("id")==h){this._buttonList[f]=null}}}else{return false}},destroy:function(){this.get("element").innerHTML="";this.get("element").className="";for(var e in this){if(d.hasOwnProperty(this,e)){this[e]=null}}return true},collapse:function(f){var e=c.getElementsByClassName("collapse","span",this._titlebar);if(f===false){c.removeClass(this.get("cont").parentNode,"yui-toolbar-container-collapsed");if(e[0]){c.removeClass(e[0],"collapsed")}this.fireEvent("toolbarExpanded",{type:"toolbarExpanded",target:this})}else{if(e[0]){c.addClass(e[0],"collapsed")}c.addClass(this.get("cont").parentNode,"yui-toolbar-container-collapsed");this.fireEvent("toolbarCollapsed",{type:"toolbarCollapsed",target:this})}},toString:function(){return"Toolbar (#"+this.get("element").id+") with "+this._buttonList.length+" buttons."}})})();(function(){var c=YAHOO.util.Dom,a=YAHOO.util.Event,d=YAHOO.lang,b=YAHOO.widget.Toolbar;YAHOO.widget.SimpleEditor=function(h,m){var g={};if(d.isObject(h)&&(!h.tagName)&&!m){d.augmentObject(g,h);h=document.createElement("textarea");this.DOMReady=true;if(g.container){var k=c.get(g.container);k.appendChild(h)}else{document.body.appendChild(h)}}else{if(m){d.augmentObject(g,m)}}var i={element:null,attributes:g},f=null;if(d.isString(h)){f=h}else{if(i.attributes.id){f=i.attributes.id}else{this.DOMReady=true;f=c.generateId(h)}}i.element=h;var j=document.createElement("DIV");i.attributes.element_cont=new YAHOO.util.Element(j,{id:f+"_container"});var e=document.createElement("div");c.addClass(e,"first-child");i.attributes.element_cont.appendChild(e);if(!i.attributes.toolbar_cont){i.attributes.toolbar_cont=document.createElement("DIV");i.attributes.toolbar_cont.id=f+"_toolbar";e.appendChild(i.attributes.toolbar_cont)}var l=document.createElement("DIV");e.appendChild(l);i.attributes.editor_wrapper=l;YAHOO.widget.SimpleEditor.superclass.constructor.call(this,i.element,i.attributes)};YAHOO.extend(YAHOO.widget.SimpleEditor,YAHOO.util.Element,{_resizeConfig:{handles:["br"],autoRatio:true,status:true,proxy:true,useShim:true,setSize:false},_setupResize:function(){if(!YAHOO.util.DD||!YAHOO.util.Resize){return false}if(this.get("resize")){var e={};d.augmentObject(e,this._resizeConfig);this.resize=new YAHOO.util.Resize(this.get("element_cont").get("element"),e);this.resize.on("resize",function(g){var l=this.get("animate");this.set("animate",false);this.set("width",g.width+"px");var i=g.height,j=(this.toolbar.get("element").clientHeight+2),k=0;if(this.dompath){k=(this.dompath.clientHeight+1)}var f=(i-j-k);this.set("height",f+"px");this.get("element_cont").setStyle("height","");this.set("animate",l)},this,true)}},resize:null,_setupDD:function(){if(!YAHOO.util.DD){return false}if(this.get("drag")){var f=this.get("drag"),e=YAHOO.util.DD;if(f==="proxy"){e=YAHOO.util.DDProxy}this.dd=new e(this.get("element_cont").get("element"));this.toolbar.addClass("draggable");this.dd.setHandleElId(this.toolbar._titlebar)}},dd:null,_lastCommand:null,_undoNodeChange:function(){},_storeUndo:function(){},_checkKey:function(f,j){var g=false;if((j.keyCode===f.key)){if(f.mods&&(f.mods.length>0)){var l=0;for(var h=0;h<f.mods.length;h++){if(this.browser.mac){if(f.mods[h]=="ctrl"){f.mods[h]="meta"}}if(j[f.mods[h]+"Key"]===true){l++}}if(l===f.mods.length){g=true}}else{g=true}}return g},_keyMap:{SELECT_ALL:{key:65,mods:["ctrl"]},CLOSE_WINDOW:{key:87,mods:["shift","ctrl"]},FOCUS_TOOLBAR:{key:27,mods:["shift"]},FOCUS_AFTER:{key:27},CREATE_LINK:{key:76,mods:["shift","ctrl"]},BOLD:{key:66,mods:["shift","ctrl"]},ITALIC:{key:73,mods:["shift","ctrl"]},UNDERLINE:{key:85,mods:["shift","ctrl"]},UNDO:{key:90,mods:["ctrl"]},REDO:{key:90,mods:["shift","ctrl"]},JUSTIFY_LEFT:{key:219,mods:["shift","ctrl"]},JUSTIFY_CENTER:{key:220,mods:["shift","ctrl"]},JUSTIFY_RIGHT:{key:221,mods:["shift","ctrl"]}},_cleanClassName:function(e){return e.replace(/ /g,"-").toLowerCase()},_textarea:null,_docType:'<!DOCTYPE HTML PUBLIC "-
E.innerHTML="";},_makeColorButton:function(E){if(!this._colorPicker){this._createColorPicker(this.get("id"));}E.type="color";E.menu=new YAHOO.widget.Overlay(this.get("id")+"_"+E.value+"_menu",{visible:false,position:"absolute",iframe:true});E.menu.setBody("");E.menu.render(this.get("cont"));C.addClass(E.menu.element,"yui-button-menu");C.addClass(E.menu.element,"yui-color-button-menu");E.menu.beforeShowEvent.subscribe(function(){E.menu.cfg.setProperty("zindex",5);E.menu.cfg.setProperty("context",[this.getButtonById(E.id).get("element"),"tl","bl"]);this._resetColorPicker();var F=this._colorPicker;if(F.parentNode){F.parentNode.removeChild(F);}E.menu.setBody("");E.menu.appendToBody(F);this._colorPicker.style.display="block";},this,true);return E;},_makeSpinButton:function(R,L){R.addClass(this.CLASS_PREFIX+"-spinbutton");var S=this,N=R._button.parentNode.parentNode,I=L.range,H=document.createElement("a"),G=document.createElement("a");H.href="#";G.href="#";H.tabIndex="-1";G.tabIndex="-1";H.className="up";H.title=this.STR_SPIN_UP;H.innerHTML=this.STR_SPIN_UP;G.className="down";G.title=this.STR_SPIN_DOWN;G.innerHTML=this.STR_SPIN_DOWN;N.appendChild(H);N.appendChild(G);var M=YAHOO.lang.substitute(this.STR_SPIN_LABEL,{VALUE:R.get("label")});R.set("title",M);var Q=function(T){T=((T<I[0])?I[0]:T);T=((T>I[1])?I[1]:T);return T;};var P=this.browser;var F=false;var K=this.STR_SPIN_LABEL;if(this._titlebar&&this._titlebar.firstChild){F=this._titlebar.firstChild;}var E=function(U){YAHOO.util.Event.stopEvent(U);if(!R.get("disabled")&&(U.keyCode!=9)){var V=parseInt(R.get("label"),10);V++;V=Q(V);R.set("label",""+V);var T=YAHOO.lang.substitute(K,{VALUE:R.get("label")});R.set("title",T);if(!P.webkit&&F){}S._buttonClick(U,L);}};var O=function(U){YAHOO.util.Event.stopEvent(U);if(!R.get("disabled")&&(U.keyCode!=9)){var V=parseInt(R.get("label"),10);V--;V=Q(V);R.set("label",""+V);var T=YAHOO.lang.substitute(K,{VALUE:R.get("label")});R.set("title",T);if(!P.webkit&&F){}S._buttonClick(U,L);}};var J=function(T){if(T.keyCode==38){E(T);}else{if(T.keyCode==40){O(T);}else{if(T.keyCode==107&&T.shiftKey){E(T);}else{if(T.keyCode==109&&T.shiftKey){O(T);}}}}};R.on("keydown",J,this,true);A.on(H,"mousedown",function(T){A.stopEvent(T);},this,true);A.on(G,"mousedown",function(T){A.stopEvent(T);},this,true);A.on(H,"click",E,this,true);A.on(G,"click",O,this,true);},_buttonClick:function(L,F){var E=true;if(L&&L.type=="keypress"){if(L.keyCode==9){E=false;}else{if((L.keyCode===13)||(L.keyCode===0)||(L.keyCode===32)){}else{E=false;}}}if(E){var N=true,H=false;F.isSelected=this.isSelected(F.id);if(F.value){H=this.fireEvent(F.value+"Click",{type:F.value+"Click",target:this.get("element"),button:F});if(H===false){N=false;}}if(F.menucmd&&N){H=this.fireEvent(F.menucmd+"Click",{type:F.menucmd+"Click",target:this.get("element"),button:F});if(H===false){N=false;}}if(N){this.fireEvent("buttonClick",{type:"buttonClick",target:this.get("element"),button:F});}if(F.type=="select"){var K=this.getButtonById(F.id);if(K.buttonType=="rich"){var J=F.value;for(var I=0;I<F.menu.length;I++){if(F.menu[I].value==F.value){J=F.menu[I].text;break;}}K.set("label",'<span class="yui-toolbar-'+F.menucmd+"-"+(F.value).replace(/ /g,"-").toLowerCase()+'">'+J+"</span>");var M=K.getMenu().getItems();for(var G=0;G<M.length;G++){if(M[G].value.toLowerCase()==F.value.toLowerCase()){M[G].cfg.setProperty("checked",true);}else{M[G].cfg.setProperty("checked",false);}}}}if(L){A.stopEvent(L);}}},_keyNav:null,_navCounter:null,_navigateButtons:function(F){switch(F.keyCode){case 37:case 39:if(F.keyCode==37){this._navCounter--;}else{this._navCounter++;}if(this._navCounter>(this._buttonList.length-1)){this._navCounter=0;}if(this._navCounter<0){this._navCounter=(this._buttonList.length-1);}if(this._buttonList[this._navCounter]){var E=this._buttonList[this._navCounter].get("element");if(this.browser.ie){E=this._buttonList[this._navCounter].get("element").getElementsByTagName("a")[0];}if(this._buttonList[this._navCounter].get("disabled")){this._navigateButtons(F);}else{E.focus();}}break;}},_handleFocus:function(){if(!this._keyNav){var E="keypress";if(this.browser.ie){E="keydown";}A.on(this.get("element"),E,this._navigateButtons,this,true);this._keyNav=true;this._navCounter=-1;}},getButtonById:function(G){var E=this._buttonList.length;for(var F=0;F<E;F++){if(this._buttonList[F]&&this._buttonList[F].get("id")==G){return this._buttonList[F];}}return false;},getButtonByValue:function(K){var H=this.get("buttons");var F=H.length;for(var I=0;I<F;I++){if(H[I].group!==undefined){for(var E=0;E<H[I].buttons.length;E++){if((H[I].buttons[E].value==K)||(H[I].buttons[E].menucmd==K)){return this.getButtonById(H[I].buttons[E].id);}if(H[I].buttons[E].menu){for(var J=0;J<H[I].buttons[E].menu.length;J++){if(H[I].buttons[E].menu[J].value==K){return this.getButtonById(H[I].buttons[E].id);}}}}}else{if((H[I].value==K)||(H[I].menucmd==K)){return this.getButtonById(H[I].id);}if(H[I].menu){for(var G=0;G<H[I].menu.length;G++){if(H[I].menu[G].value==K){return this.getButtonById(H[I].id);}}}}}return false;},getButtonByIndex:function(E){if(this._buttonList[E]){return this._buttonList[E];}else{return false;}},getButtons:function(){return this._buttonList;},disableButton:function(F){var E=B.call(this,F);if(E){E.set("disabled",true);}else{return false;}},enableButton:function(F){if(this.get("disabled")){return false;}var E=B.call(this,F);if(E){if(E.get("disabled")){E.set("disabled",false);}}else{return false;}},isSelected:function(F){var E=B.call(this,F);if(E){return E._selected;}return false;},selectButton:function(I,G){var F=B.call(this,I);if(F){F.addClass("yui-button-selected");F.addClass("yui-button-"+F.get("value")+"-selected");F._selected=true;if(G){if(F.buttonType=="rich"){var H=F.getMenu().getItems();for(var E=0;E<H.length;E++){if(H[E].value==G){H[E].cfg.setProperty("checked",true);F.set("label",'<span class="yui-toolbar-'+F.get("value")+"-"+(G).replace(/ /g,"-").toLowerCase()+'">'+H[E]._oText.nodeValue+"</span>");}else{H[E].cfg.setProperty("checked",false);}}}}}else{return false;}},deselectButton:function(F){var E=B.call(this,F);if(E){E.removeClass("yui-button-selected");E.removeClass("yui-button-"+E.get("value")+"-selected");E.removeClass("yui-button-hover");E._selected=false;}else{return false;}},deselectAllButtons:function(){var E=this._buttonList.length;for(var F=0;F<E;F++){this.deselectButton(this._buttonList[F]);}},disableAllButtons:function(){if(this.get("disabled")){return false;}var E=this._buttonList.length;for(var F=0;F<E;F++){this.disableButton(this._buttonList[F]);}},enableAllButtons:function(){if(this.get("disabled")){return false;}var E=this._buttonList.length;for(var F=0;F<E;F++){this.enableButton(this._buttonList[F]);}},resetAllButtons:function(I){if(!D.isObject(I)){I={};}if(this.get("disabled")){return false;}var E=this._buttonList.length;for(var F=0;F<E;F++){var H=this._buttonList[F];if(H){var G=H._configs.disabled._initialConfig.value;if(I[H.get("id")]){this.enableButton(H);this.selectButton(H);}else{if(G){this.disableButton(H);}else{this.enableButton(H);}this.deselectButton(H);}}}},destroyButton:function(I){var G=B.call(this,I);if(G){var H=G.get("id");G.destroy();var E=this._buttonList.length;for(var F=0;F<E;F++){if(this._buttonList[F]&&this._buttonList[F].get("id")==H){this._buttonList[F]=null;}}}else{return false;}},destroy:function(){this.get("element").innerHTML="";this.get("element").className="";for(var E in this){if(D.hasOwnProperty(this,E)){this[E]=null;}}return true;},collapse:function(F){var E=C.getElementsByClassName("collapse","span",this._titlebar);if(F===false){C.removeClass(this.get("cont").parentNode,"yui-toolbar-container-collapsed");if(E[0]){C.removeClass(E[0],"collapsed");}this.fireEvent("toolbarExpanded",{type:"toolbarExpanded",target:this});}else{if(E[0]){C.addClass(E[0],"collapsed");}C.addClass(this.get("cont").parentNode,"yui-toolbar-container-collapsed");this.fireEvent("toolbarCollapsed",{type:"toolbarCollapsed",target:this});}},toString:function(){return"Toolbar (#"+this.get("element").id+") with "+this._buttonList.length+" buttons.";}});})();(function(){var C=YAHOO.util.Dom,A=YAHOO.util.Event,D=YAHOO.lang,B=YAHOO.widget.Toolbar;YAHOO.widget.SimpleEditor=function(H,M){var G={};if(D.isObject(H)&&(!H.tagName)&&!M){D.augmentObject(G,H);H=document.createElement("textarea");this.DOMReady=true;if(G.container){var K=C.get(G.container);K.appendChild(H);}else{document.body.appendChild(H);}}else{if(M){D.augmentObject(G,M);}}var I={element:null,attributes:G},F=null;if(D.isString(H)){F=H;}else{if(I.attributes.id){F=I.attributes.id;}else{this.DOMReady=true;F=C.generateId(H);}}I.element=H;var J=document.createElement("DIV");I.attributes.element_cont=new YAHOO.util.Element(J,{id:F+"_container"});var E=document.createElement("div");C.addClass(E,"first-child");I.attributes.element_cont.appendChild(E);if(!I.attributes.toolbar_cont){I.attributes.toolbar_cont=document.createElement("DIV");I.attributes.toolbar_cont.id=F+"_toolbar";E.appendChild(I.attributes.toolbar_cont);}var L=document.createElement("DIV");E.appendChild(L);I.attributes.editor_wrapper=L;YAHOO.widget.SimpleEditor.superclass.constructor.call(this,I.element,I.attributes);};YAHOO.extend(YAHOO.widget.SimpleEditor,YAHOO.util.Element,{_resizeConfig:{handles:["br"],autoRatio:true,status:true,proxy:true,useShim:true,setSize:false},_setupResize:function(){if(!YAHOO.util.DD||!YAHOO.util.Resize){return false;}if(this.get("resize")){var E={};D.augmentObject(E,this._resizeConfig);this.resize=new YAHOO.util.Resize(this.get("element_cont").get("element"),E);this.resize.on("resize",function(G){var K=this.get("animate");this.set("animate",false);this.set("width",G.width+"px");var H=G.height,I=(this.toolbar.get("element").clientHeight+2),J=0;if(this.dompath){J=(this.dompath.clientHeight+1);}var F=(H-I-J);this.set("height",F+"px");this.get("element_cont").setStyle("height","");this.set("animate",K);},this,true);}},resize:null,_setupDD:function(){if(!YAHOO.util.DD){return false;}if(this.get("drag")){var F=this.get("drag"),E=YAHOO.util.DD;if(F==="proxy"){E=YAHOO.util.DDProxy;}this.dd=new E(this.get("element_cont").get("element"));this.toolbar.addClass("draggable");this.dd.setHandleElId(this.toolbar._titlebar);}},dd:null,_lastCommand:null,_undoNodeChange:function(){},_storeUndo:function(){},_checkKey:function(E,H){var F=false;if((H.keyCode===E.key)){if(E.mods&&(E.mods.length>0)){var I=0;for(var G=0;G<E.mods.length;G++){if(this.browser.mac){if(E.mods[G]=="ctrl"){E.mods[G]="meta";}}if(H[E.mods[G]+"Key"]===true){I++;}}if(I===E.mods.length){F=true;}}else{F=true;}}return F;},_keyMap:{SELECT_ALL:{key:65,mods:["ctrl"]},CLOSE_WINDOW:{key:87,mods:["shift","ctrl"]},FOCUS_TOOLBAR:{key:27,mods:["shift"]},FOCUS_AFTER:{key:27},CREATE_LINK:{key:76,mods:["shift","ctrl"]},BOLD:{key:66,mods:["shift","ctrl"]},ITALIC:{key:73,mods:["shift","ctrl"]},UNDERLINE:{key:85,mods:["shift","ctrl"]},UNDO:{key:90,mods:["ctrl"]},REDO:{key:90,mods:["shift","ctrl"]},JUSTIFY_LEFT:{key:219,mods:["shift","ctrl"]},JUSTIFY_CENTER:{key:220,mods:["shift","ctrl"]},JUSTIFY_RIGHT:{key:221,mods:["shift","ctrl"]}},_cleanClassName:function(E){return E.replace(/ /g,"-").toLowerCase();},_textarea:null,_docType:'<!DOCTYPE HTML PUBLIC "-/'+"/W3C/"+"/DTD HTML 4.01/"+'/EN" "http:/'+'/www.w3.org/TR/html4/strict.dtd">',editorDirty:null,_defaultCSS:"html { height: 95%; } body { padding: 7px; background-color: #fff; font:13px/1.22 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small; } a, a:visited, a:hover { color: blue !important; text-decoration: underline !important; cursor: text !important; } .warning-localfile { border-bottom: 1px dashed red !important; } .yui-busy { cursor: wait !important; } img.selected { border: 2px dotted #808080; } img { cursor: pointer !important; border: none; } body.ptags.webkit div { margin: 11px 0; }",_defaultToolbar:null,_lastButton:null,_baseHREF:function(){var E=document.location.href;if(E.indexOf("?")!==-1){E=E.substring(0,E.indexOf("?"));}E=E.substring(0,E.lastIndexOf("/"))+"/";return E;
c.target===d&&setTimeout(function(){e(document).one("mousedown",function(f){f.target!==a.element[0]&&f.target!==d&&!e.ui.contains(d,f.target)&&a.close()})},1);setTimeout(function(){clearTimeout(a.closing)},13)}).menu({focus:function(c,d){d=d.item.data("item.autocomplete");false!==a._trigger("focus",null,{item:d})&&/^key/.test(c.originalEvent.type)&&a.element.val(d.value)},selected:function(c,d){d=d.item.data("item.autocomplete");var f=a.previous;if(a.element[0]!==b.activeElement){a.element.focus(); a.previous=f}false!==a._trigger("select",c,{item:d})&&a.element.val(d.value);a.close(c);a.selectedItem=d},blur:function(){a.menu.element.is(":visible")&&a.element.val()!==a.term&&a.element.val(a.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");e.fn.bgiframe&&this.menu.element.bgiframe()},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup");this.menu.element.remove();
"body",b)[0]).mousedown(function(c){var d=a.menu.element[0];e(c.target).closest(".ui-menu-item").length||setTimeout(function(){e(document).one("mousedown",function(g){g.target!==a.element[0]&&g.target!==d&&!e.ui.contains(d,g.target)&&a.close()})},1);setTimeout(function(){clearTimeout(a.closing)},13)}).menu({focus:function(c,d){d=d.item.data("item.autocomplete");false!==a._trigger("focus",c,{item:d})&&/^key/.test(c.originalEvent.type)&&a.element.val(d.value)},selected:function(c,d){d=d.item.data("item.autocomplete"); var g=a.previous;if(a.element[0]!==b.activeElement){a.element.focus();a.previous=g;setTimeout(function(){a.previous=g},1)}false!==a._trigger("select",c,{item:d})&&a.element.val(d.value);a.term=a.element.val();a.close(c);a.selectedItem=d},blur:function(){a.menu.element.is(":visible")&&a.element.val()!==a.term&&a.element.val(a.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");e.fn.bgiframe&&this.menu.element.bgiframe()},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup");
c.target===d&&setTimeout(function(){e(document).one("mousedown",function(f){f.target!==a.element[0]&&f.target!==d&&!e.ui.contains(d,f.target)&&a.close()})},1);setTimeout(function(){clearTimeout(a.closing)},13)}).menu({focus:function(c,d){d=d.item.data("item.autocomplete");false!==a._trigger("focus",null,{item:d})&&/^key/.test(c.originalEvent.type)&&a.element.val(d.value)},selected:function(c,d){d=d.item.data("item.autocomplete");var f=a.previous;if(a.element[0]!==b.activeElement){a.element.focus();a.previous=f}false!==a._trigger("select",c,{item:d})&&a.element.val(d.value);a.close(c);a.selectedItem=d},blur:function(){a.menu.element.is(":visible")&&a.element.val()!==a.term&&a.element.val(a.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");e.fn.bgiframe&&this.menu.element.bgiframe()},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup");this.menu.element.remove();
ORBEON.xforms.Document.setValue(this.select1Control.id, option.value);
ORBEON.xforms.Document.setValue(this.select1ControlId, option.value);
selectionMade: function(name, event, option) { this.yuiButton.set("label", option.label); ORBEON.xforms.Document.setValue(this.select1Control.id, option.value); },
logger.log('send', name, JSON.stringify(args))
logger.debug('send', name, JSON.stringify(args))
this.sendFrame = function(name, args) { logger.log('send', name, JSON.stringify(args)) supr(this, 'sendFrame', arguments) }
if (ORBEON.util.Dom.hasClass(candidateForm, "xforms-form")) {
if (YAHOO.util.Dom.hasClass(candidateForm, "xforms-form")) {
sendHeartBeatIfNeeded: function(heartBeatDelay) { var currentTime = new Date().getTime(); if ((currentTime - ORBEON.xforms.Globals.lastEventSentTime) >= heartBeatDelay) { var heartBeatDiv = YAHOO.util.Dom.get("xforms-heartbeat"); if (heartBeatDiv == null) { var form; for (var formIndex = 0; formIndex < document.forms.length; formIndex++) { var candidateForm = document.forms[formIndex]; if (ORBEON.util.Dom.hasClass(candidateForm, "xforms-form")) { form = candidateForm; break; } } var heartBeatDiv = document.createElement("div"); heartBeatDiv.className = "xforms-heartbeat"; heartBeatDiv.id = "xforms-heartbeat"; form.appendChild(heartBeatDiv); } var event = new ORBEON.xforms.Server.Event(null, heartBeatDiv.id, null, null, "xxforms-session-heartbeat"); ORBEON.xforms.Server.fireEvents([event], false); } },
serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),
"object"){b=c.param(b,c.ajaxSettings.traditional);e="POST"}var h=this;c.ajax({url:a,type:e,dataType:"html",data:b,complete:function(l,k){if(k==="success"||k==="notmodified")h.html(f?c("<div>").append(l.responseText.replace(nb,"")).find(f):l.responseText);d&&h.each(d,[l.responseText,k,l])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&
serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),
serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),
"object"){b=c.param(b,c.ajaxSettings.traditional);e="POST"}var h=this;c.ajax({url:a,type:e,dataType:"html",data:b,complete:function(l,k){if(k==="success"||k==="notmodified")h.html(f?c("<div>").append(l.responseText.replace(nb,"")).find(f):l.responseText);d&&h.each(d,[l.responseText,k,l])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&& !this.disabled&&(this.checked||ob.test(this.nodeName)||pb.test(this.type))}).map(function(a,b){var d=c(this).val();return d==null?null:c.isArray(d)?c.map(d,function(e){return{name:b.name,value:e}}):{name:b.name,value:d}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:e})},
serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),
sys.puts("loading " + filename + "...");
exports.serveFile = function(req, res, filename) { // TODO: Ensure security against directory traversal attacks var body, headers; var content_type = mime.lookup(extname(filename)); var encoding = (content_type.slice(0,4) === 'text' ? 'utf8' : 'binary'); var status = 200; function loadResponseData(callback) { if (body && headers) { callback(); return; } sys.puts("loading " + filename + "..."); fs.readFile(filename, encoding, function (error, data) { if (error) { status = 404; body = '404' sys.puts("Error loading " + filename); return callback(); } body = data; headers = [ ['Content-Type', content_type], ['Content-Length', (encoding === 'utf8') ? encodeURIComponent(body).replace(/%../g, 'x').length : body.length ] ]; sys.puts("static file " + filename + " loaded"); callback(); }); } loadResponseData(function() { res.sendHeader(status, headers); res.write(body, encoding); res.close(); });}
sys.puts("Error loading " + filename);
exports.serveFile = function(req, res, filename) { // TODO: Ensure security against directory traversal attacks var body, headers; var content_type = mime.lookup(extname(filename)); var encoding = (content_type.slice(0,4) === 'text' ? 'utf8' : 'binary'); var status = 200; function loadResponseData(callback) { if (body && headers) { callback(); return; } sys.puts("loading " + filename + "..."); fs.readFile(filename, encoding, function (error, data) { if (error) { status = 404; body = '404' sys.puts("Error loading " + filename); return callback(); } body = data; headers = [ ['Content-Type', content_type], ['Content-Length', (encoding === 'utf8') ? encodeURIComponent(body).replace(/%../g, 'x').length : body.length ] ]; sys.puts("static file " + filename + " loaded"); callback(); }); } loadResponseData(function() { res.sendHeader(status, headers); res.write(body, encoding); res.close(); });}
sys.puts("static file " + filename + " loaded");
exports.serveFile = function(req, res, filename) { // TODO: Ensure security against directory traversal attacks var body, headers; var content_type = mime.lookup(extname(filename)); var encoding = (content_type.slice(0,4) === 'text' ? 'utf8' : 'binary'); var status = 200; function loadResponseData(callback) { if (body && headers) { callback(); return; } sys.puts("loading " + filename + "..."); fs.readFile(filename, encoding, function (error, data) { if (error) { status = 404; body = '404' sys.puts("Error loading " + filename); return callback(); } body = data; headers = [ ['Content-Type', content_type], ['Content-Length', (encoding === 'utf8') ? encodeURIComponent(body).replace(/%../g, 'x').length : body.length ] ]; sys.puts("static file " + filename + " loaded"); callback(); }); } loadResponseData(function() { res.sendHeader(status, headers); res.write(body, encoding); res.close(); });}
var promise = posix.cat(filename, encoding); promise.addCallback(function(data) {
fs.readFile(filename, encoding, function (error, data) { if (error) { status = 404; body = '404' sys.puts("Error loading " + filename); return callback(); }
exports.serveFile = function(req, res, filename) { // TODO: Ensure security against directory traversal attacks var body, headers; var content_type = mime.lookup(extname(filename)); var encoding = (content_type.slice(0,4) === 'text' ? 'utf8' : 'binary'); var status = 200; function loadResponseData(callback) { if (body && headers) { callback(); return; } sys.puts("loading " + filename + "..."); var promise = posix.cat(filename, encoding); promise.addCallback(function(data) { body = data; headers = [ ['Content-Type', content_type], ['Content-Length', (encoding === 'utf8') ? encodeURIComponent(body).replace(/%../g, 'x').length : body.length ] ]; sys.puts("static file " + filename + " loaded"); callback(); }); promise.addErrback(function() { status = 404; body = '404' sys.puts("Error loading " + filename); callback(); }); } loadResponseData(function() { res.sendHeader(status, headers); res.sendBody(body, encoding); res.finish(); });}
promise.addErrback(function() { status = 404; body = '404' sys.puts("Error loading " + filename); callback(); });
exports.serveFile = function(req, res, filename) { // TODO: Ensure security against directory traversal attacks var body, headers; var content_type = mime.lookup(extname(filename)); var encoding = (content_type.slice(0,4) === 'text' ? 'utf8' : 'binary'); var status = 200; function loadResponseData(callback) { if (body && headers) { callback(); return; } sys.puts("loading " + filename + "..."); var promise = posix.cat(filename, encoding); promise.addCallback(function(data) { body = data; headers = [ ['Content-Type', content_type], ['Content-Length', (encoding === 'utf8') ? encodeURIComponent(body).replace(/%../g, 'x').length : body.length ] ]; sys.puts("static file " + filename + " loaded"); callback(); }); promise.addErrback(function() { status = 404; body = '404' sys.puts("Error loading " + filename); callback(); }); } loadResponseData(function() { res.sendHeader(status, headers); res.sendBody(body, encoding); res.finish(); });}
res.sendBody(body, encoding); res.finish();
res.write(body, encoding); res.close();
exports.serveFile = function(req, res, filename) { // TODO: Ensure security against directory traversal attacks var body, headers; var content_type = mime.lookup(extname(filename)); var encoding = (content_type.slice(0,4) === 'text' ? 'utf8' : 'binary'); var status = 200; function loadResponseData(callback) { if (body && headers) { callback(); return; } sys.puts("loading " + filename + "..."); var promise = posix.cat(filename, encoding); promise.addCallback(function(data) { body = data; headers = [ ['Content-Type', content_type], ['Content-Length', (encoding === 'utf8') ? encodeURIComponent(body).replace(/%../g, 'x').length : body.length ] ]; sys.puts("static file " + filename + " loaded"); callback(); }); promise.addErrback(function() { status = 404; body = '404' sys.puts("Error loading " + filename); callback(); }); } loadResponseData(function() { res.sendHeader(status, headers); res.sendBody(body, encoding); res.finish(); });}
this._mutate({ id: itemId, op: 'set', prop: propName, args: [JSON.stringify(value)] })
var key = shared.keys.getItemPropertyKey(itemId, propName) this._mutate({ key: key, op: 'set', args: [JSON.stringify(value)] })
this.set = function(itemId, propName, value) { if (arguments.length == 2) { var properties = propName for (var propName in properties) { this.set(itemId, propName, properties[propName]) } return } this._mutate({ id: itemId, op: 'set', prop: propName, args: [JSON.stringify(value)] }) }
var key = shared.keys.getItemPropertyKey(itemId, propName)
var key = shared.keys.getItemPropertyKey(itemId, propName), value = properties[propName] if (typeof value == 'boolean') { value = value ? 1 : 0 }
this.set = function(itemId, properties) { var args = [], props = [] if (arguments.length == 3) { var propName = properties properties = {} properties[propName] = arguments[2] } for (var propName in properties) { var key = shared.keys.getItemPropertyKey(itemId, propName) props.push(propName) args.push(key) args.push(properties[propName]) } this.send('FIN_REQUEST_MUTATE_ITEM', { id: itemId, op: 'mset', props: props, args: args }) }
args.push(properties[propName])
args.push(JSON.stringify(value))
this.set = function(itemId, properties) { var args = [], props = [] if (arguments.length == 3) { var propName = properties properties = {} properties[propName] = arguments[2] } for (var propName in properties) { var key = shared.keys.getItemPropertyKey(itemId, propName) props.push(propName) args.push(key) args.push(properties[propName]) } this.send('FIN_REQUEST_MUTATE_ITEM', { id: itemId, op: 'mset', props: props, args: args }) }
this.send('FIN_REQUEST_MUTATE_ITEM', { id: itemId, op: 'mset', props: props, args: args })
this._mutate({ id: itemId, op: 'mset', props: props, args: args })
this.set = function(itemId, properties) { var args = [], props = [] if (arguments.length == 3) { var propName = properties properties = {} properties[propName] = arguments[2] } for (var propName in properties) { var key = shared.keys.getItemPropertyKey(itemId, propName) props.push(propName) args.push(key) args.push(properties[propName]) } this.send('FIN_REQUEST_MUTATE_ITEM', { id: itemId, op: 'mset', props: props, args: args }) }
combo_id_suffix=apieces[apieces.length-1];
combo_id_suffix=apieces[apieces.length-2] + '_' + apieces[apieces.length-1];
function set_combo_if_checkbox(oid,combo_id_prefix,value_to_assign){ var f=document.getElementById(oid); var all_inputs = f.getElementsByTagName('input'); var input_element; var check_id=''; var apieces=''; var combo_id_suffix=''; var cb_id= new Array(); var jdx=0; var idx=0; // Build an array with the html select ids // for(idx = 0; idx < all_inputs.length; idx++) { input_element=all_inputs[idx]; if(input_element.type == "checkbox" && input_element.checked && !input_element.disabled) { check_id=input_element.id; // Consider the id a list with '_' as element separator // apieces=check_id.split("_"); combo_id_suffix=apieces[apieces.length-1]; cb_id[jdx]=combo_id_prefix + combo_id_suffix; jdx++; } } // now set the combos for(idx = 0; idx < cb_id.length; idx++) { // debug - alert(cb_id[idx] + " will be" + value_to_assign); input_element=document.getElementById(cb_id[idx]); input_element.value=value_to_assign; }}
function set_path(path) {
exports.set_path = function (path) {
function set_path(path) { template_path = path;}
}
};
function set_path(path) { template_path = path;}
if (! ORBEON.util.Dom.existsAncestorOrSelf(element, function(node) { return YAHOO.util.Dom.hasClass(node, "xforms-case-deselected") || YAHOO.util.Dom.hasClass(node, "xforms-disabled") }, null, false)) {
var hasParentDisabledOrNonRelevant = ORBEON.util.Dom.existsAncestorOrSelf(element, function(node) { return YAHOO.util.Dom.hasClass(node, "xforms-case-deselected") || YAHOO.util.Dom.hasClass(node, "xforms-disabled"); }, null, false); if (! hasParentDisabledOrNonRelevant) {
setDisabledOnTree: function(root, disabled) { ORBEON.util.Dom.applyOnFormElements(root, function(element) { if (disabled) { // If the root becomes disabled, make all the form controls under that root disabled ORBEON.xforms.Controls.setDisabledOnFormElement(element, disabled); } else { // If the root becomes enabled, mark the form controls under the root enabled only if they don't have a // parent which is either a disabled case (xforms-case-deselected) or a non-relevant // group (xforms-disabled). if (! ORBEON.util.Dom.existsAncestorOrSelf(element, function(node) { return YAHOO.util.Dom.hasClass(node, "xforms-case-deselected") || YAHOO.util.Dom.hasClass(node, "xforms-disabled") }, null, false)) { ORBEON.xforms.Controls.setDisabledOnFormElement(element, disabled); } } }, null, false); },
yuiRTE.focus();
setFocus: function(control) { var yuiRTE = rteEditors[control.id]; // NOP: not sure what we can do with YUI 2.6. It seems 2.7 has a focus() method. },
for (i = 0; i < series.length; ++i)
for (var i = 0; i < series.length; ++i)
function setGridSpacing() { // get the most space needed around the grid for things // that may stick out var maxOutset = options.grid.borderWidth; for (i = 0; i < series.length; ++i) maxOutset = Math.max(maxOutset, 2 * (series[i].points.radius + series[i].points.lineWidth/2)); plotOffset.left = plotOffset.right = plotOffset.top = plotOffset.bottom = maxOutset; var margin = options.grid.labelMargin + options.grid.borderWidth; if (axes.xaxis.labelHeight > 0) plotOffset.bottom = Math.max(maxOutset, axes.xaxis.labelHeight + margin); if (axes.yaxis.labelWidth > 0) plotOffset.left = Math.max(maxOutset, axes.yaxis.labelWidth + margin); if (axes.x2axis.labelHeight > 0) plotOffset.top = Math.max(maxOutset, axes.x2axis.labelHeight + margin); if (axes.y2axis.labelWidth > 0) plotOffset.right = Math.max(maxOutset, axes.y2axis.labelWidth + margin); plotWidth = canvasWidth - plotOffset.left - plotOffset.right; plotHeight = canvasHeight - plotOffset.bottom - plotOffset.top; }
var helpImage = ORBEON.xforms.Controls._getControlLHHA(control, "help-image"); ORBEON.util.Dom.removeClass(helpImage, "xforms-disabled");
setHelpMessage: function(control, message) { // We escape the value because the help element is a little special, containing escaped HTML message = ORBEON.util.String.escapeHTMLMinimal(message); ORBEON.xforms.Controls._setMessage(control, "help", message); ORBEON.xforms.Controls._setTooltipMessage(control, message, ORBEON.xforms.Globals.helpTooltipForControl); // Enable the help image (it might be disabled if it was just copied from a repeat template) var helpImage = ORBEON.xforms.Controls._getControlLHHA(control, "help-image"); ORBEON.util.Dom.removeClass(helpImage, "xforms-disabled"); },
if (ORBEON.util.Dom.hasClass(control, "xforms-trigger") || ORBEON.util.Dom.hasClass(control, "xforms-submit")) {
if (YAHOO.util.Dom.hasClass(control, "xforms-trigger") || YAHOO.util.Dom.hasClass(control, "xforms-submit")) {
setHintMessage: function(control, message) { if (ORBEON.util.Dom.hasClass(control, "xforms-trigger") || ORBEON.util.Dom.hasClass(control, "xforms-submit")) { // For triggers, the value is stored in the title for the control if (ORBEON.xforms.Globals.hintTooltipForControl[control.id] == null) { // We only update the title if we don't have already a YUI hint widget. // If we do, updating the value in the YUI widget is enough. The YUI widget empties the content of the // title attribute to avoid the text in the title from showing. If we set the title, we might have // both the title shown by the browser and the YUI hint widget. var formElement = ORBEON.util.Dom.getElementByTagName(control, ["a", "button"]); formElement.title = message; } } else { ORBEON.xforms.Controls._setMessage(control, "hint", message); } // If there is already a YUI hint created for that control, update the message for the YUI widget ORBEON.xforms.Controls._setTooltipMessage(control, message, ORBEON.xforms.Globals.hintTooltipForControl); },
if (ORBEON.util.Dom.hasClass(control, "xforms-trigger") || ORBEON.util.Dom.hasClass(control, "xforms-submit")) {
if (YAHOO.util.Dom.hasClass(control, "xforms-trigger") || YAHOO.util.Dom.hasClass(control, "xforms-submit")) {
setLabelMessage: function(control, message) { if (ORBEON.util.Dom.hasClass(control, "xforms-trigger") || ORBEON.util.Dom.hasClass(control, "xforms-submit")) { var linkButtonElement = ORBEON.util.Utils.isNewXHTMLLayout() ? YAHOO.util.Dom.getFirstChild(control) : control; if (linkButtonElement.tagName.toLowerCase() == "input") { // Image linkButtonElement.alt = message; } else { // Link or button linkButtonElement.innerHTML = message; } } else if (ORBEON.util.Dom.hasClass(control, "xforms-dialog")) { // Dialog var labelDiv = ORBEON.util.Dom.getChildElementByIndex(control, 0); labelDiv.innerHTML = message; } else if (ORBEON.util.Dom.hasClass(control, "xforms-group-appearance-xxforms-fieldset")) { // Group with fieldset/legend var legend = ORBEON.util.Dom.getChildElementByIndex(control, 0); if (legend != null) legend.innerHTML = message; } else if (ORBEON.util.Dom.hasClass(control, "xforms-output-appearance-xxforms-download")) { // Download link var anchor = YAHOO.util.Dom.getChildren(control)[0]; anchor.innerHTML = message; } else { ORBEON.xforms.Controls._setMessage(control, "label", message); } },
} else if (ORBEON.util.Dom.hasClass(control, "xforms-dialog")) {
} else if (YAHOO.util.Dom.hasClass(control, "xforms-dialog")) {
setLabelMessage: function(control, message) { if (ORBEON.util.Dom.hasClass(control, "xforms-trigger") || ORBEON.util.Dom.hasClass(control, "xforms-submit")) { var linkButtonElement = ORBEON.util.Utils.isNewXHTMLLayout() ? YAHOO.util.Dom.getFirstChild(control) : control; if (linkButtonElement.tagName.toLowerCase() == "input") { // Image linkButtonElement.alt = message; } else { // Link or button linkButtonElement.innerHTML = message; } } else if (ORBEON.util.Dom.hasClass(control, "xforms-dialog")) { // Dialog var labelDiv = ORBEON.util.Dom.getChildElementByIndex(control, 0); labelDiv.innerHTML = message; } else if (ORBEON.util.Dom.hasClass(control, "xforms-group-appearance-xxforms-fieldset")) { // Group with fieldset/legend var legend = ORBEON.util.Dom.getChildElementByIndex(control, 0); if (legend != null) legend.innerHTML = message; } else if (ORBEON.util.Dom.hasClass(control, "xforms-output-appearance-xxforms-download")) { // Download link var anchor = YAHOO.util.Dom.getChildren(control)[0]; anchor.innerHTML = message; } else { ORBEON.xforms.Controls._setMessage(control, "label", message); } },
} else if (ORBEON.util.Dom.hasClass(control, "xforms-group-appearance-xxforms-fieldset")) {
} else if (YAHOO.util.Dom.hasClass(control, "xforms-group-appearance-xxforms-fieldset")) {
setLabelMessage: function(control, message) { if (ORBEON.util.Dom.hasClass(control, "xforms-trigger") || ORBEON.util.Dom.hasClass(control, "xforms-submit")) { var linkButtonElement = ORBEON.util.Utils.isNewXHTMLLayout() ? YAHOO.util.Dom.getFirstChild(control) : control; if (linkButtonElement.tagName.toLowerCase() == "input") { // Image linkButtonElement.alt = message; } else { // Link or button linkButtonElement.innerHTML = message; } } else if (ORBEON.util.Dom.hasClass(control, "xforms-dialog")) { // Dialog var labelDiv = ORBEON.util.Dom.getChildElementByIndex(control, 0); labelDiv.innerHTML = message; } else if (ORBEON.util.Dom.hasClass(control, "xforms-group-appearance-xxforms-fieldset")) { // Group with fieldset/legend var legend = ORBEON.util.Dom.getChildElementByIndex(control, 0); if (legend != null) legend.innerHTML = message; } else if (ORBEON.util.Dom.hasClass(control, "xforms-output-appearance-xxforms-download")) { // Download link var anchor = YAHOO.util.Dom.getChildren(control)[0]; anchor.innerHTML = message; } else { ORBEON.xforms.Controls._setMessage(control, "label", message); } },
} else if (ORBEON.util.Dom.hasClass(control, "xforms-output-appearance-xxforms-download")) {
} else if (YAHOO.util.Dom.hasClass(control, "xforms-output-appearance-xxforms-download")) {
setLabelMessage: function(control, message) { if (ORBEON.util.Dom.hasClass(control, "xforms-trigger") || ORBEON.util.Dom.hasClass(control, "xforms-submit")) { var linkButtonElement = ORBEON.util.Utils.isNewXHTMLLayout() ? YAHOO.util.Dom.getFirstChild(control) : control; if (linkButtonElement.tagName.toLowerCase() == "input") { // Image linkButtonElement.alt = message; } else { // Link or button linkButtonElement.innerHTML = message; } } else if (ORBEON.util.Dom.hasClass(control, "xforms-dialog")) { // Dialog var labelDiv = ORBEON.util.Dom.getChildElementByIndex(control, 0); labelDiv.innerHTML = message; } else if (ORBEON.util.Dom.hasClass(control, "xforms-group-appearance-xxforms-fieldset")) { // Group with fieldset/legend var legend = ORBEON.util.Dom.getChildElementByIndex(control, 0); if (legend != null) legend.innerHTML = message; } else if (ORBEON.util.Dom.hasClass(control, "xforms-output-appearance-xxforms-download")) { // Download link var anchor = YAHOO.util.Dom.getChildren(control)[0]; anchor.innerHTML = message; } else { ORBEON.xforms.Controls._setMessage(control, "label", message); } },
var linkButtonElement = ORBEON.util.Utils.isNewXHTMLLayout() ? YAHOO.util.Dom.getFirstChild(control) : control; if (linkButtonElement.tagName.toLowerCase() == "input") { linkButtonElement.alt = message;
if (ORBEON.util.Utils.isNewXHTMLLayout()) { ORBEON.xforms.Controls._setMessage(control, "control", message);
setLabelMessage: function(control, message) { if (YAHOO.util.Dom.hasClass(control, "xforms-trigger") || YAHOO.util.Dom.hasClass(control, "xforms-submit")) { var linkButtonElement = ORBEON.util.Utils.isNewXHTMLLayout() ? YAHOO.util.Dom.getFirstChild(control) : control; if (linkButtonElement.tagName.toLowerCase() == "input") { // Image linkButtonElement.alt = message; } else { // Link or button linkButtonElement.innerHTML = message; } } else if (YAHOO.util.Dom.hasClass(control, "xforms-dialog")) { // Dialog var labelDiv = ORBEON.util.Dom.getChildElementByIndex(control, 0); labelDiv.innerHTML = message; } else if (YAHOO.util.Dom.hasClass(control, "xforms-group-appearance-xxforms-fieldset")) { // Group with fieldset/legend var legend = ORBEON.util.Dom.getChildElementByIndex(control, 0); if (legend != null) legend.innerHTML = message; } else if (YAHOO.util.Dom.hasClass(control, "xforms-output-appearance-xxforms-download")) { // Download link var anchor = YAHOO.util.Dom.getChildren(control)[0]; anchor.innerHTML = message; } else { ORBEON.xforms.Controls._setMessage(control, "label", message); } },
linkButtonElement.innerHTML = message;
control.innerHTML = message;
setLabelMessage: function(control, message) { if (YAHOO.util.Dom.hasClass(control, "xforms-trigger") || YAHOO.util.Dom.hasClass(control, "xforms-submit")) { var linkButtonElement = ORBEON.util.Utils.isNewXHTMLLayout() ? YAHOO.util.Dom.getFirstChild(control) : control; if (linkButtonElement.tagName.toLowerCase() == "input") { // Image linkButtonElement.alt = message; } else { // Link or button linkButtonElement.innerHTML = message; } } else if (YAHOO.util.Dom.hasClass(control, "xforms-dialog")) { // Dialog var labelDiv = ORBEON.util.Dom.getChildElementByIndex(control, 0); labelDiv.innerHTML = message; } else if (YAHOO.util.Dom.hasClass(control, "xforms-group-appearance-xxforms-fieldset")) { // Group with fieldset/legend var legend = ORBEON.util.Dom.getChildElementByIndex(control, 0); if (legend != null) legend.innerHTML = message; } else if (YAHOO.util.Dom.hasClass(control, "xforms-output-appearance-xxforms-download")) { // Download link var anchor = YAHOO.util.Dom.getChildren(control)[0]; anchor.innerHTML = message; } else { ORBEON.xforms.Controls._setMessage(control, "label", message); } },
if (onBerlinDe) fullW = fullW - 1; var mapW = fullW - sideW - 7; if (onBerlinDe) mapW = fullW - sideW - 6;
if (onBerlinDe) fullW = fullW - 1; var mapW = mapW = fullW - sideW - 6;
function setLayout(fullH, fullW) { var sideW = 320; var topHeight = jQuery("#kaheader").css("height"); var startHeight = jQuery("#kaheader").css("top"); topHeight = parseInt(topHeight.substr(0, topHeight.length-2)); startHeight = parseInt(startHeight.substr(0, startHeight.length-2)); // topHeight = topHeight - startHeight; // if (onBerlinDe) fullW = fullW - 1; // var mapW = fullW - sideW - 7; if (onBerlinDe) mapW = fullW - sideW - 6; // border var mapH = fullH - topHeight - startHeight - 1; // current labs headerHeight if (onBerlinDe) jQuery("#bobody").css("width", fullW + 1); if (onBerlinDe) jQuery("#bohead").css("width", fullW + 1); jQuery("#kiezatlas").css("width", fullW); jQuery("#kiezatlas").css("visibility", "visible"); // make the whole appframe visible //jQuery("#kiezatlas").css("height", fullH - startHeight); jQuery("#kaheader").css("width", fullW); // jQuery("#map").css("top", topHeight); jQuery("#map").css("width", mapW); jQuery("#map").css("height", mapH); // jQuery("#mapControl").css("left", mapW - 128); jQuery("#mapControl").css("top", startHeight + topHeight + 8); // jQuery("#mapSwitcher").css("left", 525); if (onBerlinDe) jQuery("#focusInput").css("left", 225); else jQuery("#focusInput").css("left", 345); if (onBerlinDe) jQuery("#focusAlternatives").css("left", 295); else jQuery("#focusAlternatives").css("left", 420); //jQuery("#focusAlternatives").css("top", 205); jQuery("#searchInput").css("left", fullW - sideW + 10); if (onBerlinDe) jQuery("#headerButtons").css("left", fullW - 20); else jQuery("#headerButtons").css("left", fullW - 30); // sidebarControl is 5px fat jQuery("#sideBarControl").css("left", mapW); jQuery("#sideBarControl").css("height", mapH); jQuery("#sideBarControl").css("width", 5); // jQuery("#sideBar").css("height", mapH - 1); jQuery("#sideBar").css("left", mapW + 5); // fine adjustment per browser from the top jQuery("#map").css("top", topHeight + startHeight + 1); if (onBerlinDe) jQuery("#sideBar").css("top", topHeight + startHeight + 1); else jQuery("#sideBar").css("top", topHeight + startHeight + 1); jQuery("#sideBarControl").css("top", topHeight + startHeight + 1); // set width and perform a jquery show('fast') setSideBarWidth(sideW); // jQuery("#sideBar").show('fast'); // showSideBar // jQuery("#sideBarControl").css("right", sideW); jQuery("#sideBarCriterias").css("width", sideW - 5); jQuery("#sideBarCategories").css("width", sideW - 5); var critHeight = jQuery("#sideBarCriterias").css("height"); critHeight = parseInt(critHeight.substr(0, critHeight.length-2)); if (critHeight == 0 || isNaN(critHeight)) { critHeight = 110; } else { critHeight = critHeight + 5; } var footerHeight = jQuery("#kafooter").css("height"); footerHeight = parseInt(footerHeight.substr(0, footerHeight.length-2)); var sideBarHeight = mapH - critHeight - footerHeight; jQuery("#sideBarCategories").css("height", sideBarHeight); var fWidth = sideW - 6; var fOrientation = mapW - 3; // jQuery("#sideBarCategories").css("width", ); // jQuery("#sideBar").css("right", sideW); jQuery("#kafooter").css("width", fWidth - 15); jQuery("#kafooter").css("left", fOrientation + 10); jQuery("#helpFont").css("left", fOrientation + 22); // ugly but convenient for dealing with ie7/8 layout fixes now if (jQuery.browser.msie) { jQuery("input, textarea").css("height", 18); jQuery("#kaheader").css("height", 22); } }
jQuery("#kiezatlas").css("width", fullW); jQuery("#kiezatlas").css("visibility", "visible");
if (onBerlinDe) jQuery("#kiezatlas").css("width", fullW); jQuery("#kiezatlas").css("visibility", "visible");
function setLayout(fullH, fullW) { var sideW = 320; var topHeight = jQuery("#kaheader").css("height"); var startHeight = jQuery("#kaheader").css("top"); topHeight = parseInt(topHeight.substr(0, topHeight.length-2)); startHeight = parseInt(startHeight.substr(0, startHeight.length-2)); // topHeight = topHeight - startHeight; // if (onBerlinDe) fullW = fullW - 1; // var mapW = fullW - sideW - 7; if (onBerlinDe) mapW = fullW - sideW - 6; // border var mapH = fullH - topHeight - startHeight - 1; // current labs headerHeight if (onBerlinDe) jQuery("#bobody").css("width", fullW + 1); if (onBerlinDe) jQuery("#bohead").css("width", fullW + 1); jQuery("#kiezatlas").css("width", fullW); jQuery("#kiezatlas").css("visibility", "visible"); // make the whole appframe visible //jQuery("#kiezatlas").css("height", fullH - startHeight); jQuery("#kaheader").css("width", fullW); // jQuery("#map").css("top", topHeight); jQuery("#map").css("width", mapW); jQuery("#map").css("height", mapH); // jQuery("#mapControl").css("left", mapW - 128); jQuery("#mapControl").css("top", startHeight + topHeight + 8); // jQuery("#mapSwitcher").css("left", 525); if (onBerlinDe) jQuery("#focusInput").css("left", 225); else jQuery("#focusInput").css("left", 345); if (onBerlinDe) jQuery("#focusAlternatives").css("left", 295); else jQuery("#focusAlternatives").css("left", 420); //jQuery("#focusAlternatives").css("top", 205); jQuery("#searchInput").css("left", fullW - sideW + 10); if (onBerlinDe) jQuery("#headerButtons").css("left", fullW - 20); else jQuery("#headerButtons").css("left", fullW - 30); // sidebarControl is 5px fat jQuery("#sideBarControl").css("left", mapW); jQuery("#sideBarControl").css("height", mapH); jQuery("#sideBarControl").css("width", 5); // jQuery("#sideBar").css("height", mapH - 1); jQuery("#sideBar").css("left", mapW + 5); // fine adjustment per browser from the top jQuery("#map").css("top", topHeight + startHeight + 1); if (onBerlinDe) jQuery("#sideBar").css("top", topHeight + startHeight + 1); else jQuery("#sideBar").css("top", topHeight + startHeight + 1); jQuery("#sideBarControl").css("top", topHeight + startHeight + 1); // set width and perform a jquery show('fast') setSideBarWidth(sideW); // jQuery("#sideBar").show('fast'); // showSideBar // jQuery("#sideBarControl").css("right", sideW); jQuery("#sideBarCriterias").css("width", sideW - 5); jQuery("#sideBarCategories").css("width", sideW - 5); var critHeight = jQuery("#sideBarCriterias").css("height"); critHeight = parseInt(critHeight.substr(0, critHeight.length-2)); if (critHeight == 0 || isNaN(critHeight)) { critHeight = 110; } else { critHeight = critHeight + 5; } var footerHeight = jQuery("#kafooter").css("height"); footerHeight = parseInt(footerHeight.substr(0, footerHeight.length-2)); var sideBarHeight = mapH - critHeight - footerHeight; jQuery("#sideBarCategories").css("height", sideBarHeight); var fWidth = sideW - 6; var fOrientation = mapW - 3; // jQuery("#sideBarCategories").css("width", ); // jQuery("#sideBar").css("right", sideW); jQuery("#kafooter").css("width", fWidth - 15); jQuery("#kafooter").css("left", fOrientation + 10); jQuery("#helpFont").css("left", fOrientation + 22); // ugly but convenient for dealing with ie7/8 layout fixes now if (jQuery.browser.msie) { jQuery("input, textarea").css("height", 18); jQuery("#kaheader").css("height", 22); } }
jQuery("#mapControl").css("left", mapW - 128);
jQuery("#mapControl").css("left", mapW - 129);
function setLayout(fullH, fullW) { var sideW = 320; var topHeight = jQuery("#kaheader").css("height"); var startHeight = jQuery("#kaheader").css("top"); topHeight = parseInt(topHeight.substr(0, topHeight.length-2)); startHeight = parseInt(startHeight.substr(0, startHeight.length-2)); // topHeight = topHeight - startHeight; // if (onBerlinDe) fullW = fullW - 1; // var mapW = fullW - sideW - 7; if (onBerlinDe) mapW = fullW - sideW - 6; // border var mapH = fullH - topHeight - startHeight - 1; // current labs headerHeight if (onBerlinDe) jQuery("#bobody").css("width", fullW + 1); if (onBerlinDe) jQuery("#bohead").css("width", fullW + 1); jQuery("#kiezatlas").css("width", fullW); jQuery("#kiezatlas").css("visibility", "visible"); // make the whole appframe visible //jQuery("#kiezatlas").css("height", fullH - startHeight); jQuery("#kaheader").css("width", fullW); // jQuery("#map").css("top", topHeight); jQuery("#map").css("width", mapW); jQuery("#map").css("height", mapH); // jQuery("#mapControl").css("left", mapW - 128); jQuery("#mapControl").css("top", startHeight + topHeight + 8); // jQuery("#mapSwitcher").css("left", 525); if (onBerlinDe) jQuery("#focusInput").css("left", 225); else jQuery("#focusInput").css("left", 345); if (onBerlinDe) jQuery("#focusAlternatives").css("left", 295); else jQuery("#focusAlternatives").css("left", 420); //jQuery("#focusAlternatives").css("top", 205); jQuery("#searchInput").css("left", fullW - sideW + 10); if (onBerlinDe) jQuery("#headerButtons").css("left", fullW - 20); else jQuery("#headerButtons").css("left", fullW - 30); // sidebarControl is 5px fat jQuery("#sideBarControl").css("left", mapW); jQuery("#sideBarControl").css("height", mapH); jQuery("#sideBarControl").css("width", 5); // jQuery("#sideBar").css("height", mapH - 1); jQuery("#sideBar").css("left", mapW + 5); // fine adjustment per browser from the top jQuery("#map").css("top", topHeight + startHeight + 1); if (onBerlinDe) jQuery("#sideBar").css("top", topHeight + startHeight + 1); else jQuery("#sideBar").css("top", topHeight + startHeight + 1); jQuery("#sideBarControl").css("top", topHeight + startHeight + 1); // set width and perform a jquery show('fast') setSideBarWidth(sideW); // jQuery("#sideBar").show('fast'); // showSideBar // jQuery("#sideBarControl").css("right", sideW); jQuery("#sideBarCriterias").css("width", sideW - 5); jQuery("#sideBarCategories").css("width", sideW - 5); var critHeight = jQuery("#sideBarCriterias").css("height"); critHeight = parseInt(critHeight.substr(0, critHeight.length-2)); if (critHeight == 0 || isNaN(critHeight)) { critHeight = 110; } else { critHeight = critHeight + 5; } var footerHeight = jQuery("#kafooter").css("height"); footerHeight = parseInt(footerHeight.substr(0, footerHeight.length-2)); var sideBarHeight = mapH - critHeight - footerHeight; jQuery("#sideBarCategories").css("height", sideBarHeight); var fWidth = sideW - 6; var fOrientation = mapW - 3; // jQuery("#sideBarCategories").css("width", ); // jQuery("#sideBar").css("right", sideW); jQuery("#kafooter").css("width", fWidth - 15); jQuery("#kafooter").css("left", fOrientation + 10); jQuery("#helpFont").css("left", fOrientation + 22); // ugly but convenient for dealing with ie7/8 layout fixes now if (jQuery.browser.msie) { jQuery("input, textarea").css("height", 18); jQuery("#kaheader").css("height", 22); } }
jQuery("#sideBar").css("left", mapW + 5);
jQuery("#sideBar").css("left", mapW + 4);
function setLayout(fullH, fullW) { var sideW = 320; var topHeight = jQuery("#kaheader").css("height"); var startHeight = jQuery("#kaheader").css("top"); topHeight = parseInt(topHeight.substr(0, topHeight.length-2)); startHeight = parseInt(startHeight.substr(0, startHeight.length-2)); // topHeight = topHeight - startHeight; // if (onBerlinDe) fullW = fullW - 1; // var mapW = fullW - sideW - 7; if (onBerlinDe) mapW = fullW - sideW - 6; // border var mapH = fullH - topHeight - startHeight - 1; // current labs headerHeight if (onBerlinDe) jQuery("#bobody").css("width", fullW + 1); if (onBerlinDe) jQuery("#bohead").css("width", fullW + 1); jQuery("#kiezatlas").css("width", fullW); jQuery("#kiezatlas").css("visibility", "visible"); // make the whole appframe visible //jQuery("#kiezatlas").css("height", fullH - startHeight); jQuery("#kaheader").css("width", fullW); // jQuery("#map").css("top", topHeight); jQuery("#map").css("width", mapW); jQuery("#map").css("height", mapH); // jQuery("#mapControl").css("left", mapW - 128); jQuery("#mapControl").css("top", startHeight + topHeight + 8); // jQuery("#mapSwitcher").css("left", 525); if (onBerlinDe) jQuery("#focusInput").css("left", 225); else jQuery("#focusInput").css("left", 345); if (onBerlinDe) jQuery("#focusAlternatives").css("left", 295); else jQuery("#focusAlternatives").css("left", 420); //jQuery("#focusAlternatives").css("top", 205); jQuery("#searchInput").css("left", fullW - sideW + 10); if (onBerlinDe) jQuery("#headerButtons").css("left", fullW - 20); else jQuery("#headerButtons").css("left", fullW - 30); // sidebarControl is 5px fat jQuery("#sideBarControl").css("left", mapW); jQuery("#sideBarControl").css("height", mapH); jQuery("#sideBarControl").css("width", 5); // jQuery("#sideBar").css("height", mapH - 1); jQuery("#sideBar").css("left", mapW + 5); // fine adjustment per browser from the top jQuery("#map").css("top", topHeight + startHeight + 1); if (onBerlinDe) jQuery("#sideBar").css("top", topHeight + startHeight + 1); else jQuery("#sideBar").css("top", topHeight + startHeight + 1); jQuery("#sideBarControl").css("top", topHeight + startHeight + 1); // set width and perform a jquery show('fast') setSideBarWidth(sideW); // jQuery("#sideBar").show('fast'); // showSideBar // jQuery("#sideBarControl").css("right", sideW); jQuery("#sideBarCriterias").css("width", sideW - 5); jQuery("#sideBarCategories").css("width", sideW - 5); var critHeight = jQuery("#sideBarCriterias").css("height"); critHeight = parseInt(critHeight.substr(0, critHeight.length-2)); if (critHeight == 0 || isNaN(critHeight)) { critHeight = 110; } else { critHeight = critHeight + 5; } var footerHeight = jQuery("#kafooter").css("height"); footerHeight = parseInt(footerHeight.substr(0, footerHeight.length-2)); var sideBarHeight = mapH - critHeight - footerHeight; jQuery("#sideBarCategories").css("height", sideBarHeight); var fWidth = sideW - 6; var fOrientation = mapW - 3; // jQuery("#sideBarCategories").css("width", ); // jQuery("#sideBar").css("right", sideW); jQuery("#kafooter").css("width", fWidth - 15); jQuery("#kafooter").css("left", fOrientation + 10); jQuery("#helpFont").css("left", fOrientation + 22); // ugly but convenient for dealing with ie7/8 layout fixes now if (jQuery.browser.msie) { jQuery("input, textarea").css("height", 18); jQuery("#kaheader").css("height", 22); } }
jQuery("#resizeButton").attr("height", parseInt(jQuery("#kaheader").css("height"))-4); jQuery("#resizeButton").attr("width", parseInt(jQuery("#kaheader").css("height"))-4);
function setLayout(fullH, fullW) { var sideW = 320; var topHeight = jQuery("#kaheader").css("height"); var startHeight = jQuery("#kaheader").css("top"); topHeight = parseInt(topHeight.substr(0, topHeight.length-2)); startHeight = parseInt(startHeight.substr(0, startHeight.length-2)); // topHeight = topHeight - startHeight; // if (onBerlinDe) fullW = fullW - 1; // var mapW = fullW - sideW - 7; if (onBerlinDe) mapW = fullW - sideW - 6; // border var mapH = fullH - topHeight - startHeight - 1; // current labs headerHeight if (onBerlinDe) jQuery("#bobody").css("width", fullW + 1); if (onBerlinDe) jQuery("#bohead").css("width", fullW + 1); jQuery("#kiezatlas").css("width", fullW); jQuery("#kiezatlas").css("visibility", "visible"); // make the whole appframe visible //jQuery("#kiezatlas").css("height", fullH - startHeight); jQuery("#kaheader").css("width", fullW); // jQuery("#map").css("top", topHeight); jQuery("#map").css("width", mapW); jQuery("#map").css("height", mapH); // jQuery("#mapControl").css("left", mapW - 128); jQuery("#mapControl").css("top", startHeight + topHeight + 8); // jQuery("#mapSwitcher").css("left", 525); if (onBerlinDe) jQuery("#focusInput").css("left", 225); else jQuery("#focusInput").css("left", 345); if (onBerlinDe) jQuery("#focusAlternatives").css("left", 295); else jQuery("#focusAlternatives").css("left", 420); //jQuery("#focusAlternatives").css("top", 205); jQuery("#searchInput").css("left", fullW - sideW + 10); if (onBerlinDe) jQuery("#headerButtons").css("left", fullW - 20); else jQuery("#headerButtons").css("left", fullW - 30); // sidebarControl is 5px fat jQuery("#sideBarControl").css("left", mapW); jQuery("#sideBarControl").css("height", mapH); jQuery("#sideBarControl").css("width", 5); // jQuery("#sideBar").css("height", mapH - 1); jQuery("#sideBar").css("left", mapW + 5); // fine adjustment per browser from the top jQuery("#map").css("top", topHeight + startHeight + 1); if (onBerlinDe) jQuery("#sideBar").css("top", topHeight + startHeight + 1); else jQuery("#sideBar").css("top", topHeight + startHeight + 1); jQuery("#sideBarControl").css("top", topHeight + startHeight + 1); // set width and perform a jquery show('fast') setSideBarWidth(sideW); // jQuery("#sideBar").show('fast'); // showSideBar // jQuery("#sideBarControl").css("right", sideW); jQuery("#sideBarCriterias").css("width", sideW - 5); jQuery("#sideBarCategories").css("width", sideW - 5); var critHeight = jQuery("#sideBarCriterias").css("height"); critHeight = parseInt(critHeight.substr(0, critHeight.length-2)); if (critHeight == 0 || isNaN(critHeight)) { critHeight = 110; } else { critHeight = critHeight + 5; } var footerHeight = jQuery("#kafooter").css("height"); footerHeight = parseInt(footerHeight.substr(0, footerHeight.length-2)); var sideBarHeight = mapH - critHeight - footerHeight; jQuery("#sideBarCategories").css("height", sideBarHeight); var fWidth = sideW - 6; var fOrientation = mapW - 3; // jQuery("#sideBarCategories").css("width", ); // jQuery("#sideBar").css("right", sideW); jQuery("#kafooter").css("width", fWidth - 15); jQuery("#kafooter").css("left", fOrientation + 10); jQuery("#helpFont").css("left", fOrientation + 22); // ugly but convenient for dealing with ie7/8 layout fixes now if (jQuery.browser.msie) { jQuery("input, textarea").css("height", 18); jQuery("#kaheader").css("height", 22); } }
var params = { id: this._localId, op: 'set', prop: propName, args: [JSON.stringify(value)] } this._mutate(params, { local: true })
this._mutate({ locals: true, id: this._localId, op: 'set', prop: propName, args: [JSON.stringify(value)] })
this.setLocal = function(propName, value) { var params = { id: this._localId, op: 'set', prop: propName, args: [JSON.stringify(value)] } this._mutate(params, { local: true }) }
this._mutate({ locals: true, id: this._localId, op: 'set', prop: propName, args: [JSON.stringify(value)] })
this._mutate({ local: true, id: this._localId, op: 'set', prop: propName, args: [JSON.stringify(value)] })
this.setLocal = function(propName, value) { this._mutate({ locals: true, id: this._localId, op: 'set', prop: propName, args: [JSON.stringify(value)] }) }
c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a, d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top-
"marginTop"))||0;d+=parseFloat(c.css(a,"marginLeft"))||0}return{top:b,left:d}},setOffset:function(a,b,d){var e=c.css(a,"position");if(e==="static")a.style.position="relative";var f=c(a),h=f.offset(),l=c.css(a,"top"),k=c.css(a,"left"),o=e==="absolute"&&c.inArray("auto",[l,k])>-1;e={};var x={};if(o)x=f.position();l=o?x.top:parseInt(l,10)||0;k=o?x.left:parseInt(k,10)||0;if(c.isFunction(b))b=b.call(a,d,h);if(b.top!=null)e.top=b.top-h.top+l;if(b.left!=null)e.left=b.left-h.left+k;"using"in b?b.using.call(a, e):f.css(e)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),e=Ia.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.css(a,"marginTop"))||0;d.left-=parseFloat(c.css(a,"marginLeft"))||0;e.top+=parseFloat(c.css(b[0],"borderTopWidth"))||0;e.left+=parseFloat(c.css(b[0],"borderLeftWidth"))||0;return{top:d.top-e.top,left:d.left-e.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||t.body;a&&!Ia.test(a.nodeName)&&
c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a,d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top-
var oElement = this.cfg.getProperty(_ROLE) === _DIALOG ? this.innerElement : this.body; setARIAProperty(oElement, _HIDDEN, !this.cfg.getProperty(_VISIBLE));
setARIAProperty(this.innerElement, _HIDDEN, !this.cfg.getProperty(_VISIBLE));
var setPanelHiddenRole = function () { var oElement = this.cfg.getProperty(_ROLE) === _DIALOG ? this.innerElement : this.body; setARIAProperty(oElement, _HIDDEN, !this.cfg.getProperty(_VISIBLE)); };
if (isRelevant) ORBEON.util.Dom.removeClass(node, "xforms-disabled"); else ORBEON.util.Dom.addClass(node, "xforms-disabled");
if (isRelevant) YAHOO.util.Dom.removeClass(node, "xforms-disabled"); else YAHOO.util.Dom.addClass(node, "xforms-disabled");
setRelevant: function(node, isRelevant) { var FN = ORBEON.xforms.FlatNesting; var YD = YAHOO.util.Dom; var OD = ORBEON.util.Dom; var OC = ORBEON.xforms.Controls; // Update class on group begin or delimiter if (isRelevant) ORBEON.util.Dom.removeClass(node, "xforms-disabled"); else ORBEON.util.Dom.addClass(node, "xforms-disabled"); // If this group/iteration becomes relevant, but has a parent that is non-relevant, we should not // remove xforms-disabled otherwise it will incorrectly show, so our job stops here if (isRelevant && FN.hasAncestor(node, function(node) { return YAHOO.util.Dom.hasClass(node, "xforms-disabled"); })) return; FN.foldDescendants(node, null, function(node, value) { // Skip sub-tree if we are enabling and this sub-tree is disabled if (isRelevant && FN.isBegin(node) && YD.hasClass(node, "xforms-disabled")) return true; // Update disabled class on node if (isRelevant) { OD.removeClass(node, "xforms-disabled"); OD.removeClass(node, "xforms-disabled-subsequent"); OD.nudgeAfterDelay(node); } else { OD.addClass(node, "xforms-disabled-subsequent"); } // Update disabled attribute on form controls OC.setDisabledOnTree(node, ! isRelevant); return false; }, true); }
OD.removeClass(node, "xforms-disabled"); OD.removeClass(node, "xforms-disabled-subsequent");
YD.removeClass(node, "xforms-disabled"); YD.removeClass(node, "xforms-disabled-subsequent");
setRelevant: function(node, isRelevant) { var FN = ORBEON.xforms.FlatNesting; var YD = YAHOO.util.Dom; var OD = ORBEON.util.Dom; var OC = ORBEON.xforms.Controls; // Update class on group begin or delimiter if (isRelevant) ORBEON.util.Dom.removeClass(node, "xforms-disabled"); else ORBEON.util.Dom.addClass(node, "xforms-disabled"); // If this group/iteration becomes relevant, but has a parent that is non-relevant, we should not // remove xforms-disabled otherwise it will incorrectly show, so our job stops here if (isRelevant && FN.hasAncestor(node, function(node) { return YAHOO.util.Dom.hasClass(node, "xforms-disabled"); })) return; FN.foldDescendants(node, null, function(node, value) { // Skip sub-tree if we are enabling and this sub-tree is disabled if (isRelevant && FN.isBegin(node) && YD.hasClass(node, "xforms-disabled")) return true; // Update disabled class on node if (isRelevant) { OD.removeClass(node, "xforms-disabled"); OD.removeClass(node, "xforms-disabled-subsequent"); OD.nudgeAfterDelay(node); } else { OD.addClass(node, "xforms-disabled-subsequent"); } // Update disabled attribute on form controls OC.setDisabledOnTree(node, ! isRelevant); return false; }, true); }
OD.addClass(node, "xforms-disabled-subsequent");
YD.addClass(node, "xforms-disabled-subsequent");
setRelevant: function(node, isRelevant) { var FN = ORBEON.xforms.FlatNesting; var YD = YAHOO.util.Dom; var OD = ORBEON.util.Dom; var OC = ORBEON.xforms.Controls; // Update class on group begin or delimiter if (isRelevant) ORBEON.util.Dom.removeClass(node, "xforms-disabled"); else ORBEON.util.Dom.addClass(node, "xforms-disabled"); // If this group/iteration becomes relevant, but has a parent that is non-relevant, we should not // remove xforms-disabled otherwise it will incorrectly show, so our job stops here if (isRelevant && FN.hasAncestor(node, function(node) { return YAHOO.util.Dom.hasClass(node, "xforms-disabled"); })) return; FN.foldDescendants(node, null, function(node, value) { // Skip sub-tree if we are enabling and this sub-tree is disabled if (isRelevant && FN.isBegin(node) && YD.hasClass(node, "xforms-disabled")) return true; // Update disabled class on node if (isRelevant) { OD.removeClass(node, "xforms-disabled"); OD.removeClass(node, "xforms-disabled-subsequent"); OD.nudgeAfterDelay(node); } else { OD.addClass(node, "xforms-disabled-subsequent"); } // Update disabled attribute on form controls OC.setDisabledOnTree(node, ! isRelevant); return false; }, true); }