User:Maosef: Difference between revisions
Jump to navigation
Jump to search
imported>Maosef No edit summary |
imported>Maosef No edit summary |
||
Line 1: | Line 1: | ||
<div id="mw-mywiki-example"></div> | |||
{{Advertisement}} | |||
Line 58: | Line 57: | ||
$Result = preg_replace ("#</semantics>#", "<annotation encoding=\"OpenMath\" >" . $renderer->getUserInputTex() . "</annotation>\n</semantics>", $Result ); # puppet operations | $Result = preg_replace ("#</semantics>#", "<annotation encoding=\"OpenMath\" >" . $renderer->getUserInputTex() . "</annotation>\n</semantics>", $Result ); # puppet operations | ||
java -jar latex-to-cas-translator.jar -c -CAS=Maple -Expression="\cos@{\alpha}" |
Revision as of 23:27, 12 May 2017
$(function () {
var myElement = document.getElementById('mw-mywiki-example'); myElement.innerHTML = 'any HTML';
}());
Bold text
$contents = wfShellExec( $cmd, $retval );
public function execute($par) {
$this->setHeaders();
- A formDescriptor Array to tell HTMLForm what to build
$formDescriptor = array( 'simpletextfield' => array( 'label' => 'Simple Text Field', # What's the label of the field 'class' => 'HTMLTextField' # What's the input type ) ); $htmlForm = new HTMLForm( $formDescriptor, $this->getContext(), 'myform' ); # We build the HTMLForm object, calling the form "myform" $htmlForm->setSubmitText( 'Allons-y gaiement' ); # What text does the submit button display
/* We set a callback function */ $htmlForm->setSubmitCallback( array( 'SpecialMyForm', 'processInput' ) ); # Call processInput() in SpecialMyForm on submit
$htmlForm->show(); # Displaying the form
}
/* We write a callback function */
- OnSubmit Callback, here we do all the logic we want to do...
static function processInput( $formData ) {
if ( $formData['simpletextfield'] == 'next' ) { return true; #if returned true, the form won't display again. } elseif ($formData['simpletextfield'] == 'again' ) { return false; #if returned false, the form will be redisplayed. } return 'Try again'; #if returned a string, it will be displayed as an error message with the form
}
- Retrieve Andre's program
$contents = wfShellExec( $cmd, $retval ); # Math mediawiki extension LoggerFactory::getInstance( 'Math' )->debug( "TeX output:\n $contents\n---" );
$Result = preg_replace ("#</semantics>#", "<annotation encoding=\"OpenMath\" >" . $renderer->getUserInputTex() . "</annotation>\n</semantics>", $Result ); # puppet operations
java -jar latex-to-cas-translator.jar -c -CAS=Maple -Expression="\cos@{\alpha}"