Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 16:03
    jcubic commented #853
  • 16:02
    jcubic edited #855
  • 14:49
    jcubic commented #853
  • 14:49
    jcubic opened #855
  • 14:49
    jcubic labeled #855
  • 14:44
    jcubic commented #853
  • 14:24
    leif commented #853
  • 14:23
    leif commented #853
  • 00:33
    VexFX commented #414
  • Jan 31 19:42
    leif closed #853
  • Jan 31 19:42
    leif commented #853
  • Jan 31 18:37
    jcubic commented #853
  • Jan 31 18:36
    jcubic commented #853
  • Jan 31 18:35
    jcubic commented #853
  • Jan 31 17:58
    leif commented #853
  • Jan 31 17:51
    leif commented #853
  • Jan 31 17:02
    jcubic unlabeled #854
  • Jan 31 17:02
    jcubic labeled #854
  • Jan 31 17:02
    jcubic commented #854
rotane.xrd
@RRotane_twitter
and get this error message:
image.png
it seems the import does not work
import terminal from 'jquery.terminal'
I am new to Javascript
Raja Zuberi
@RajaMBZ
Any idea how to add typing animation to this?
$('body').terminal(

    async function(query) {
await axios.get('/query/' + query)
  .then((response) => {
    this.echo(response.data, {raw: true});
  });
}
, {
    greetings: "GM"
});
Jakub T. Jankiewicz
@jcubic
@RajaMBZ Typing animation doesn't work with raw option, I need to document it somohow.
@RRotane_twitter How did you include the jQuery Terminal library?
2 replies
Raja Zuberi
@RajaMBZ
@jcubic thanks... it seems like raw option doesn't work with typing animation (i.e., if you apply both, typing animation works but raw doesn't). By any chance, will they both work near future?
Or is there any other workaround?
Jakub T. Jankiewicz
@jcubic
No, they will never work together becasue I would need to include Full HTML parser with the library and write a lot of code. Typing animation is only for normal text.
But what HTML do you exactly need?
rotane.xrd
@RRotane_twitter
image.png
image.png
snowpack
Jakub T. Jankiewicz
@jcubic
You need to execute terminal like this terminal(window, jQuery) But I've only tested it with require:
https://codesandbox.io/s/nice-poitras-y99o1
rotane.xrd
@RRotane_twitter
when I try with '''terminal(window, jQuery)''' I still receive an error
image.png
image.png
Jakub T. Jankiewicz
@jcubic
@RRotane_twitter don't use import, jQuery Terminal doesn't supports ES Modules
The library uses UMD so you can only use require() to import it
I'm not sure if there is a way to easily create ES Module from UMD. Probably you would be able to use Snowpack to do that but it would need to be added to the library.
rotane.xrd
@RRotane_twitter
I will try to use require instead of import with all bundles then
I will let you know if it worked :)
thanks for your support!
Jakub T. Jankiewicz
@jcubic
One note If you want to add ES Module support to jQuery Terminal by e.g. adding Snowpack then you're welcome to contribute. If not you can create an issue, but I'm not sure when this feature will be added.
jagg3127
@jagg3127
Ummmmm i wanna make a terminal application i tried my old code and it wont run maybe jquery is hogging to much cpu
I mean no errors just wont load
Jakub T. Jankiewicz
@jcubic
@jagg3127 Do you have the code online?
jagg3127
@jagg3127
Same place its always been
Jakub T. Jankiewicz
@jcubic
I'm not asking about the code, how do you test this? I want to see the error, not the code.
jagg3127
@jagg3127
I just ran the file directly the index.html
Is there a problem with that?
Jakub T. Jankiewicz
@jcubic
How do you run PHP file without the server?
It doesn't work is not helpful, it works when I tested on my computer. Your code is fine. Something is wrong on you system
I tested it with server and without, in both cases the code works fine
jagg3127
@jagg3127
Hm even the command cred
Jakub T. Jankiewicz
@jcubic
You said that the terminal don't load
jagg3127
@jagg3127
True but then i realized i worded it wrong the cred command fails to execute
Jakub T. Jankiewicz
@jcubic
cred will not work if you open the file from the browser, because it requires a HTTP server and PHP
jagg3127
@jagg3127
Ahhhhhyh ok lemme fix that really quick
Yep works lol, time to study how that works then make a new terminal application thanks jcubic again
Oh question can I make it stay logged in on refresh?
Jakub T. Jankiewicz
@jcubic
It should do that by default, unless you use custom login logic. Let me check
Jakub T. Jankiewicz
@jcubic
It would require more code, I don't know right now how to do that and if it's possible when using a command that logs you in
You will need to have JSON-RPC method that verify if the token and user is correct and in JavaScript you will need to have similar code like there one you have right now but will need to use autologin after you verify that the token is valid.
I'm not sure if this is possible with the library. The problem is that you can't easily access the token for the interpreter that you're not logged in.
I think that this will require updating the library, but it would be a nice feature to have
jagg3127
@jagg3127
Ok thanks