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

Ability to supply custom CSS or JS #59

Open
jamesfalkner opened this issue May 2, 2018 · 6 comments
Open

Ability to supply custom CSS or JS #59

jamesfalkner opened this issue May 2, 2018 · 6 comments
Assignees
Projects

Comments

@jamesfalkner
Copy link

jamesfalkner commented May 2, 2018

This particular RFE is because, by default Markdown links like [some text](http://somelink) will open in the same browser tab, taking the user away from the workshopper content. It would be nice to automatically declare (via CSS or some other mechanism, not sure which is best) that every link should open in a new tab.

As a workaround, I currently add {:target="_blank"} to every single link (in Markdown) and that's kinda ugly (but not super painful).

@marekjelen
Copy link
Contributor

How do you handle this in your content @jorgemoralespou @siamaksade @thoraxe ?

@marekjelen marekjelen added this to ToDo in edge via automation Jul 19, 2018
@marekjelen marekjelen self-assigned this Jul 19, 2018
@thoraxe
Copy link
Contributor

thoraxe commented Jul 19, 2018

I have not been handling it at all in ops content.

@jorgemoralespou
Copy link
Contributor

@marekjelen, I don't think I've care about this, but it's a good idea.

@siamaksade
Copy link
Contributor

Low prio

@GrahamDumpleton
Copy link

FWIW. Have similar requirement.

As first pass on solution, am going to add in a workshopper.css and workshopper.js in public directory and then update app/views/layouts/application.html.erb to include workshopper.css in <head> and include workshopper.js at end of <body>. The two files will be empty but could then be replaced, by either replacing the files themselves, or possibly allowing an environment variable to be set which extends list of paths checked for static files so overrides can be found in an alternate directory first.

Suggestions on how to better integrate welcome.

@GrahamDumpleton
Copy link

GrahamDumpleton commented Feb 25, 2019

Once have this capability for workshopper.css and workshopper.js that you can safely override, someone wanting custom application, can drop in workshopper.js file containing:

$(document).ready(function() {
    $('div#lab-content a').each(function() {
        if (!(location.hostname === this.hostname || !this.hostname.length)) {
            $(this).attr('target','_blank');
        }
    });
});

Thus, any external link will have target set to _blank and open in a new browser window/tab.

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

No branches or pull requests

6 participants