-
Notifications
You must be signed in to change notification settings - Fork 25
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
Link Popovers added #380
base: master
Are you sure you want to change the base?
Link Popovers added #380
Conversation
publish new email images
Hi @krshubham, thanks for the pull request. Good work! I have tried it and there are some things to fix:
Thanks again for your work |
@krshubham, did you make the changes I proposed in my previous comment in this thread? |
@atfornes , I started out with the first issue, and it turned out that the issue was more related to a bug that prevailed before starting the task. Although, the popover covers over the link but when it goes we can open the link annotation dialog box. I checked that!. After some time on this, I started focusing on the SEO, since it itself was a bit complicated! However I'd mention these things in the gist that I am writing! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, check this review in order to merge the code.
I am sorry it comes late.
src/js/directives/pad.js
Outdated
var annotations = {}; | ||
|
||
function openLinkPopover(event,range){ | ||
if(!styleAppended){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style should be defined in a src/sass/*.sass file. In this case it could be either a new one or pad.sass
src/js/directives/pad.js
Outdated
} | ||
timer = $timeout(() => { | ||
event.stopPropagation(); | ||
let div = document.createElement('div'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Html code should be provided in a template, unless there is a good reason not to do it. Feel free to add a new one for this popovers.
src/js/services/pad/linkPreview.js
Outdated
.factory('linkPreview', linkPreview); | ||
|
||
function linkPreview($http) { | ||
const LINK_PREVIEW_SERVER_URL = 'http://localhost:9090/fetch'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This address should be provided in a configuration file instead ;)
src/js/directives/pad.js
Outdated
// https://github.com/P2Pvalue/swellrt/issues/84 | ||
var editorElement = angular.element($element.find('.swellrt-editor').children()[0]); | ||
$scope.padReady = function(editor) { | ||
// FIXME |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All FIXME comments should be removed if already fixed or transformed into a issue. The comment can stay in the later case providing a link to the actual issue.
src/js/services/pad/linkPreview.js
Outdated
function linkPreview($http) { | ||
const LINK_PREVIEW_SERVER_URL = 'http://localhost:9090/fetch'; | ||
function getMetaData(url){ | ||
//TODO: implement a check for the URL to be correct |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All TODOs shoud be transformed into issues or removed.
|
@krshubham, please share the code improvements you mentioned in your previous comment, are they ready? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some css style comments, I hope they help :)
src/js/directives/pad.js
Outdated
height: auto; | ||
max-height: 40px; | ||
margin: 0 auto; | ||
overflow: auto; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would chose a hidden overflow with text-overflow: ellipsis
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, maybe max-height is needed as now only allows two lines.
src/js/directives/pad.js
Outdated
border-radius: 6px; | ||
} | ||
div.popover-link-image{ | ||
width: 330px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather use max-width and max-height not to brake image ratio
src/js/directives/pad.js
Outdated
overflow: hidden; | ||
white-space: nowrap; | ||
} | ||
.popover-link-address{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe use the same green as links in the pad for popover links.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, is it really needed to display the url? we can just have href to the url at title and description... maybe also image? can you please check what other webs do and copy?
src/js/directives/pad.js
Outdated
left: -1px; | ||
border-style: solid; | ||
border-width: 0 10px 10px; | ||
border-color: #F1F1F1 transparent; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, use the colors at our src/sass/colors.sass file. Here and in every css color.
src/js/directives/pad.js
Outdated
div.style.backgroundColor = '#F2F2F2'; | ||
div.style.paddingTop = '5px'; | ||
div.id = 'popover-container'; | ||
document.body.appendChild(div); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding the popover inside the pad div breaks its dimensions when using narrow screens. I would try to get the position of the link and position it adding the element outside the editor element.
Added the link popovers and updated the docker-compose.yml to auto download the docker image. Hope it works fine 😄