I am trying to use the language option on Videojs to have the play button's title text to be translated but that is not working... I am not sure what am I doing wrong..
I'm not sure if I am missing an import, but since I am using the npm package I thought that the imports were being done by videojs package...
https://codesandbox.io/s/videojs-forked-xt74qq
The final answer for this was a mix of both #misterben and #blurfus answers, I had to:
Switch lang: "fr-ca" for language: "fr-ca" inside the options;
Add an import for the language I needed, like: import fr from 'video.js/dist/lang/fr.json';
Add the language in the videojs object videojs.addLanguage('fr', fr);
Related
I would like to use TroisJS (three.js wrapper for Vue) with Nuxt.js. According to the TroisJS documentation (https://troisjs.github.io/guide/install.html#existing-vuejs-3-project) I need to add it to my project like:
import { TroisJSVuePlugin } from 'troisjs';
app.use(TroisJSVuePlugin);
However, I don"t know how to figure out where I should put this code. I would expect the nuxt.config.js file, but I don't seem to quite get it where it should go.
I decided to use TroisJS and not three.js because I thought the former might be easier to import and use. If importing three.js directly is easier, I don't mind using it.
Thank you very much for any help!
In /plugins folder add new file named troisjs-plugin.js with the following content :
import { TroisJSVuePlugin } from 'troisjs';
export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.vueApp.use(TroisJSVuePlugin )
})
I found a repo with some testing with Trois and Nuxt 3, probably outdated and maybe some apis have changed, but if you wanna check it out: alvarosabu/nuxt3-trois
Also, there's an official repo from the Trois author with a Nuxt 3 custom plugin (probably outdated too) here
I have installed a package #ng-bootstrap/ng-bootstrap for my angular project, I already implemented the carousel by it, but I need a multi-item carousel, can anybody suggest whether I can achieve it by this package or not, please suggest some tutorials.
In some research, I have not found that ng-bootstrap has a function for this at this time--Please correct me if I'm wrong.
https://github.com/ng-bootstrap/ng-bootstrap/issues/2083
If I ammm correct, since you already have the bootstrap dependency, I would import the 3 required js dependencies (popper, jquery, bootstrap.min.js)
and attempt to use something like this? (Is this what you are talking about?)
https://www.codeply.com/go/HDu8lT7NxJ
I need 2 files for creating new component in React:
${NAME}.js
import React from 'react';
import css from './${NAME}.css';
const ${NAME} = () => (
<div></div>
);
export default ${NAME};
${NAME}.css
/* Empty */
Note: ${NAME} needs to be entered like constant while creating these files.
I would like to use PhpStorm (or WebStorm) file template feature (or some other simple way) to create both files - by only clicking to create component like on image below:
Is something like that possible ?
As far as I'm aware it's not possible right now unless you code a plugin for that yourself.
https://youtrack.jetbrains.com/issue/IDEA-91565 -- watch this ticket (star/vote/comment) to get notified on any progress.
UPDATE 2020-12-04: The aforementioned ticket has been fixed and multi-file templates are available since 2020.3 version.
Some links if you are thinking about coding it yourself:
IntelliJ Platform SDK / Plugin Development Docs
API Forum
Some example
I just installed rxjs 5 beta 3 via npm i rxjs#5.0.0-beta.3.
I have the following example code:
import {Observable} from "rxjs"
new Observable(o => o.next(42)).filter(() => true);
This code compiles perfectly well when using ts-node for example.
But when looking at this code inside IntelliJ IDEA, the filter() operator is not found.
When using operators on an Observable instance, they are not found either.
The suggested static members of Observable are:
create()
if()
throw()
The suggested members of an instance of Observable are:
_isScalar()
forEach()
lift()
subscribe()
I also tried to import only what I need, but still my IDE tells me that filter() does not exist on the Observable instance:
import {Observable} from "rxjs/Observable"
import "rxjs/add/operator/filter"
new Observable(o => o.next(42)).filter(() => true);
Any suggestions how to make IntelliJ IDEA know about the operators?
To fix this issue you need to add RxJS as a javascript library in IntelliJ:
Go to Settings -> Languages and frameworks -> JavaScript -> Libraries
Click Add...
Add node_modules/rxjs by clicking the + button
Click all the OK buttons until you are back in your editor.
This solution is tested to work on IDEA 2016.1.3
Please, check IDEA 2016.1.2 or higher
Note: Directory node_modules must be not excluded from the project.
Otherwise, see answer https://stackoverflow.com/a/38499577/1057218
Note 2: File package.json must contain the direct dependency (or devdependency) 'rxjs'
Accepted answer doesn't work. I have tested IntelliJ IDEA 2016.2.1 EAP (ideaIU-162.1447.7) and the problem still persist.
The rabbit hole goes as follows:
In the accepted answer you find a link to version 2016.1, but that doesn't fix the problem.
Then you see a comment with a link to the IntelliJ bugtracker, where OP has the first/top comment.
At the bottom of that issue/bug thread you find a comment saying IDEA 2016.2 162.426.1 EAP will definitely fix the problem, it doesn't.
Bottom line, if you import all of what RxJS has to offer with import {Observable} from 'rxjs/Rx'; IntelliJ will still complain that it can't find methods like .map and .filter
So we're trying to change the default cluster icon using gmaps for rails.
In the wiki
it says
You can customize the pics used by the clusterer by setting the Gmaps.map.customClusterer js function in your code.
Where would we put that function? It says "In the javascript" - but where? Do we straight-up edit the code generated by gmaps4rails? How does gmaps4rails pick up the information?
To do this customization you just need to create js file. Then you can
"require" that js file in your Application.js or otherwise just directly refer in your view file. That's it you need not to do anything else. I have used it and it worked for me. If any questions do let me know.
To understand how it works you can just refer the
gmaps4rails.base.js (see #customClusterer = -> false)
gmaps4rails.googlemaps.js (method - createClusterer)
it is straight forward to understand