-
Notifications
You must be signed in to change notification settings - Fork 308
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
Repair GH repo page url view only to point to master as committed originally... #204
Repair GH repo page url view only to point to master as committed originally... #204
Conversation
…ginal in OpenUserJS#89 Applies to OpenUserJS#200 * I currently see no advantage of pointing the view url to the current `tree/HEAD` when clicking the url to go to GH during the import process. I do however see a disadvantage of not being able to traverse up their breadcrumb list and being locked into a specific commit hash * Since the import process is probably dependent upon `/tree/HEAD` now leaving that alone * Add `target="_blank"` to this url since we do this anyways with multiple entries and keeps that window/tab open for importing after checking with GH * Fix white space issue with optional target after POST routine returns
This still leaves the encoding issue mentioned in #200 (comment) with users that may use EDIT: This presents an issue with being able to do this without breaking import. If I encode
Please let me know if things should be different but I'm leaning towards option 2 (could be swayed) unless we already have something in place? (maybe |
* This is considered bad form and could eventually break this controller if V8 updates to strict mode. * Think I got all of them on a manual survey of this controller. Applies to OpenUserJS#200 and should be clarified in OpenUserJS#19
* Create another object for mustache to correctly show GH target url if percent is used in `dir` or `filename` * Alter view page mustache usage to match Applies to OpenUserJS#200 and OpenUserJS#200 (comment)
I'm going to defer to @Zren's opinion on this PR since he wrote the new GH integration code. |
Doesn't encodeURIComponent('OpenUserJs/OpenUserJS.org/pull/204')
"OpenUserJs%2FOpenUserJS.org%2Fpull%2F204"
encodeURI('OpenUserJs/OpenUserJS.org/pull/204')
"OpenUserJs/OpenUserJS.org/pull/204" I used +1 for that commit.
Eh? Does the trailing whitespace in |
You'll probably also want to change this line: https://github.com/OpenUserJs/OpenUserJS.org/blob/master/libs/githubClient.js#L82 to "master" (i think that should work) to be consistent |
Very Good point I'll back that out... no need to mess that up... forgot about that since I never use that GH feature.
Validation for eventual HTML5 and SEO.
Moot point because if multiple ones are added in at any point it just makes it "harder to read" before or after... so no difference.
Yes as you pointed out in the code sample... I can change the affected ones to |
…ed but I have seen a few ppl do this. Applies to OpenUserJS#200 and OpenUserJS#204
Nope. TestUserScript / folder / test@.js https://github.com/ZrenTest/TestUserScript/blob/master/folder/test%40.js Edit: https://github.com/ZrenTest/TestUserScript/blob/master/folder/test@.js will automatically redirect, so encodeURI is okay. EditEdit: Nvm. The redirect was from HEAD => sha. GitHub doesn't redirect/sanitize the path when it sees special characters, nor does it break. |
So which would you recommend here and on which ones?
For your addition... Annoyance versus breakage is the thing here... I'd rather see a semi-grouchy author having to traversing the tree from top of the repo or having to type in |
Seems like there's a And use encode URI |
That could work too but I'm still a little green on the actual import process here and not sure where to read that in yet... and if needed to be applied to waterfall here. |
<a href="https://github.com/{{repo.owner.login}}/{{repo.name}}/tree/HEAD/{{pathAsEncoded.full}}" target="_blank">{{path.dir}}<b>{{path.name}}</b>{{path.ext}}</a>
<a href="https://github.com/{{repo.owner.login}}/{{repo.name}}/tree/{{repo.default_branc}}}/{{pathAsEncoded.full}}" target="_blank">{{path.dir}}<b>{{path.name}}</b>{{path.ext}}</a> Maybe? We don't need to change |
Appears to be and it redirects here to |
* Use `encodeComponent` as per @Zren recommendation * Use `repo.default_branch` to eventually be redirected to `blob/master` url NOTE: May need default_branch to be encoded I think... have to commit this to check out my other repo and test Applies to OpenUserJS#200
Talking to myself out loud here... Yes it does... and I don't have a clue which source to do this in... :\ There are too many |
* Create minimal `repoAsEncoded` * Use `repoAsEncoded` in view page Applies to OpenUserJS#200
Alright... how is this @Zren @sizzlemctwizzle That commit appears to be at the right spot... fixes the default repo HEAD naming issue is there is a branch that has a percent symbol (or other) like on my test repo... this won't stay for long so go visit soon. ;) Thought of another instance where plain |
Repair GH repo page url view only to point to master as committed originally...
... in #89
Applies to #200
tree/HEAD
when clicking the url to go to GH during the import process. I do however see a disadvantage of not being able to traverse up their breadcrumb list and being locked into a specific commit hash/tree/HEAD
now leaving that alonetarget="_blank"
to this url since we do this anyways with multiple entries and keeps that window/tab open for importing after checking with GHTested in dev okay.