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

Updated test.html with support for testing the plugins #592

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

VitaliyR
Copy link
Contributor

Separated PR from #584 which is upgrading test.html so it can now test the plugins too.

Not the best solution is used, but it is working. Prism core object is being updated while any of plugin is loaded and for clearing it out from plugin's mixins we need to reload it. It's done via reattaching prism.js script file.

@VitaliyR
Copy link
Contributor Author

@Golmote I've merged your changes into this branch

@VitaliyR
Copy link
Contributor Author

@Golmote any updates?

@Golmote
Copy link
Contributor

Golmote commented Jun 22, 2015

I don't have much time to properly test this, for the moment.

@VitaliyR
Copy link
Contributor Author

@Golmote, sure, take your time. Maybe you have propositions how to make it better?

Copy link
Member

@mAAdhaTTah mAAdhaTTah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still need to test this myself, but I love the idea of including plugins on the test page. Got some minor changes / suggestions first.

test.html Outdated Show resolved Hide resolved
test.html Outdated Show resolved Hide resolved
test.html Outdated Show resolved Hide resolved
@mAAdhaTTah mAAdhaTTah changed the base branch from gh-pages to master June 5, 2018 20:18
@mAAdhaTTah
Copy link
Member

@VitaliyR Our apologies on the delay! I know its been a while, but would you be interested in making the changes suggested here?


$('#prism').remove();
$$('script[data-type="plugin"],link[data-type="plugin"]').forEach(function (script) {
script.remove();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Golmote @LeaVerou Removing this script tag doesn't undo what the script has done. I think we'd need to implement #1381 before we can do this. Any other ideas?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could use an iframe whose srcset is set dynamically for the demo :)

PS: Awwww, I wish we could remove <script> elements and have their effects undone, that would be so nicely reactive! :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha, yes, indeed. It was done (probably? 2 years has passed..) for more clean html structure, I guess.. But later I'm realoading Prism core js file - so it will be run again and we will receive clean object.

Doing everything in iframes is better and nice idea also

@VitaliyR
Copy link
Contributor Author

Oki, here're few changes.

  • Promises fixes
  • Check if plugin has css file and only then load it
  • Removed localStorage stuff from this PR

@RunDevelopment
Copy link
Member

@mAAdhaTTah Is this going to get merged anytime soon?

@mAAdhaTTah
Copy link
Member

@RunDevelopment I'm not sure this has been addressed (or even how to address it). Although I think the point of clobbering & replacing the global Prism object might be enough. We should test this before we merge, but I dig it.

test.html Outdated Show resolved Hide resolved
test.html Outdated Show resolved Hide resolved
@VitaliyR
Copy link
Contributor Author

VitaliyR commented Dec 4, 2018

FYI: Updated PR and replied to your comment

@mAAdhaTTah
Copy link
Member

@RunDevelopment We have a PR to add line-numbers to the test page. Do we / can we combine it with this?

@mAAdhaTTah mAAdhaTTah closed this Mar 10, 2019
@mAAdhaTTah mAAdhaTTah reopened this Mar 10, 2019
@mAAdhaTTah
Copy link
Member

(Didn't mean to close)

@RunDevelopment
Copy link
Member

@mAAdhaTTah I don't see why we would need #1554 after this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants