Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shapes for a front-end usage #137

Closed
spamforhope opened this issue Aug 11, 2017 · 4 comments
Closed

Shapes for a front-end usage #137

spamforhope opened this issue Aug 11, 2017 · 4 comments

Comments

@spamforhope
Copy link

You have unreachable code for a front-end usage of this module:

if ( NODEJS ) { var gObjPptxMasters = require('../dist/pptxgen.masters.js'); var gObjPptxShapes = require('../dist/pptxgen.shapes.js'); }

So if we don't use NodeJS to generate PPT we cannot use all possible shapes (for ex. shapes.OVAL, etc.)

I've fixed this by comment out this IF statement in your code, but it's bad behaviour

@gitbrent gitbrent self-assigned this Aug 15, 2017
@gitbrent
Copy link
Owner

Hi @spamforhope ,

Those 2 global vars are meant to be unreachable by web clients as the libraries should be included using the standard approach of <script>...

The pptxgen.masters.js file declares its variable first:

var gObjPptxMasters = {
	TITLE_SLIDE: {
[...]

What front end are you using?

@gitbrent gitbrent closed this as completed Sep 4, 2017
@abumphy
Copy link

abumphy commented Jan 8, 2019

I had the same problem. I used Vue. For the time being, I comment out this if statement.

@gitbrent
Copy link
Owner

gitbrent commented Jan 9, 2019

Thanks for bringing this up. This could stand to be improved.

Re-opening so these vars can be declared in our newer node and angular/react detection methods.

@gitbrent
Copy link
Owner

gitbrent commented Feb 5, 2019

Hi All,

The newest code just checked in should resolve this issue, making the Colors and Shapes libraries available to front-end applications.

Appreciate everyone's feedback!

@gitbrent gitbrent closed this as completed Feb 5, 2019
gitbrent added a commit that referenced this issue Feb 5, 2019
ericrockey pushed a commit to WeTransfer/PptxGenJS that referenced this issue Mar 24, 2020
ericrockey pushed a commit to WeTransfer/PptxGenJS that referenced this issue Mar 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants