Skip to content

Commit de7fa17

Browse files
committed
Made the corrections
1 parent 6b5f255 commit de7fa17

10 files changed

+19
-20
lines changed

api_reference.php

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
}, { prompt: '>', name: 'test' });
123123
</pre>
124124

125-
<img src='images/Screenshot_138.png'/>
125+
<img src="images/screenshot_001.png"/>
126126

127127
<p>You can pass object as first argument - the methods will be invoked by commands typed by a user. In those methods <strong>this</strong> will point to terminal object.</p>
128128
<pre class="javascript">
@@ -142,9 +142,9 @@
142142
}, { prompt: '>', greeting: false });
143143
</pre>
144144

145-
<img src='images/Screenshot_R.png'/>
145+
<img src="images/screenshot_002.png"/>
146146

147-
<img src='images/Screenshot_calc.png'/>
147+
<img src="images/screenshot_003.png"/>
148148

149149

150150
<p>This code will create two command <strong>echo</strong> that will print first argument and <strong>add</strong> that will add two integers.</p>
@@ -167,7 +167,7 @@
167167
});
168168
</pre>
169169

170-
<img src='images/Screenshot_my.png'/>
170+
<img src="images/screenshot_004.png"/>
171171

172172
<p>In previous example mysql will be exception, even that rpc have that method it will not call it but create new interpreter.</p>
173173
<p>Terminal will always process numbers if processArguments is set to true (by default).</p>
@@ -452,22 +452,18 @@ function(user, password, callback) {
452452
// {_: ["bar", "baz", "quux"], a: true, b: true, c: true, foo: true}
453453

454454
$('body').terminal({
455-
copy: function(...args) {
456-
var options = $.terminal.parse_options(args);
457-
if (options.dest && options.src) {
458-
if (copy(options.src, options.dest)) {
459-
this.echo('[[;darkgreen;]successful]');
460-
} else {
461-
this.error('failed');
462-
}
463-
} else {
464-
this.echo('usage\ncopy --dest &lt;file&gt; --src &lt;file&gt;');
465-
}
466-
}
467-
}, {checkArity: false});</pre>
455+
copy: function copy(src, dest) {
456+
if (src === 'nonexistent') {
457+
return false;
458+
}
459+
return true;
460+
// NOTE: for this dummy example, you can use
461+
// return src !== 'nonexistent';
462+
}
463+
});</pre>
468464
</li>
469465

470-
<img src='Screenshot_1.png'/>
466+
<img src="screenshot_005.png"/>
471467

472468
<li id="tracking_replace"><strong>tracking_replace(string, regex, replacement, position)</strong> &mdash; Function work the same as normal replace but keep track of position change so you can use it in formatter, it return the same output as required by formatters in version >=1.19.0.</li>
473469
</ul>
@@ -483,6 +479,9 @@ function(user, password, callback) {
483479
//process user commands
484480
}
485481
});</pre>
482+
483+
<img src="images/screenshot_006.png"/>
484+
486485
<p>Here is <a href="https://codepen.io/jcubic/pen/XaoqGp">demo that creates terminal using only cmd</a>.</p>
487486
<p>And this pen is a demo of creating <a href="https://codepen.io/jcubic/pen/qPMPOR">text based dialog</a>.</p>
488487
<p>Command Line options: name, keypress, keydown, mask, enabled, width, prompt, commands, keymap.</p>
@@ -761,7 +760,7 @@ function(user, password, callback) {
761760
console.log(str.search(re));
762761
</pre>
763762

764-
<img src='images/Screenshot_arr.png'/>
763+
<img src="images/screenshot_007.png"/>
765764

766765
<p>formatter don't work with extended commands, so the brackets need to have at least 2 semicolons.</p>
767766
</article>
@@ -888,7 +887,7 @@ function(user, password, callback) {
888887
}
889888
});</pre></li>
890889

891-
<img src='Screenshot_140.png'/>
890+
<img src="screenshot_008.png"/>
892891

893892
<li>dterm.js &mdash; contain jQuery plugin <code>dterm</code> that is combination of jQuery UI Dialog and jQuery Terminal.</li>
894893
<li>

images/Screenshot_1.png

-15 KB
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

images/screenshot_005.png

11 KB
Loading
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)