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

Link Popovers added #380

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

Link Popovers added #380

wants to merge 14 commits into from

Conversation

krshubham
Copy link
Contributor

Added the link popovers and updated the docker-compose.yml to auto download the docker image. Hope it works fine 😄

@atfornes
Copy link
Contributor

Hi @krshubham, thanks for the pull request. Good work!

I have tried it and there are some things to fix:

  1. Now we cannot change the link, because the popover is of the preview, even in edit mode. Either a change link should appear in the popover or only the edition options to be displayed in edit mode.
  2. when title and description is not provided something different than undefinedand description not providedshould be provided.
  3. Some style, giving more weight to title might improve the visual aspect. Please do a visual proposal and share it with @elenamv for feedback.

Thanks again for your work

@atfornes
Copy link
Contributor

@krshubham, did you make the changes I proposed in my previous comment in this thread?

@krshubham
Copy link
Contributor Author

@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!

Copy link
Contributor

@atfornes atfornes left a 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.

var annotations = {};

function openLinkPopover(event,range){
if(!styleAppended){
Copy link
Contributor

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

}
timer = $timeout(() => {
event.stopPropagation();
let div = document.createElement('div');
Copy link
Contributor

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.

.factory('linkPreview', linkPreview);

function linkPreview($http) {
const LINK_PREVIEW_SERVER_URL = 'http://localhost:9090/fetch';
Copy link
Contributor

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 ;)

// https://github.com/P2Pvalue/swellrt/issues/84
var editorElement = angular.element($element.find('.swellrt-editor').children()[0]);
$scope.padReady = function(editor) {
// FIXME
Copy link
Contributor

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.

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
Copy link
Contributor

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
Copy link
Contributor Author

  • Separated HTML and CSS in respective files
  • Added weight to the title
  • Checked indentation properly

@krshubham krshubham closed this Aug 28, 2017
@krshubham krshubham reopened this Aug 28, 2017
@atfornes
Copy link
Contributor

@krshubham, please share the code improvements you mentioned in your previous comment, are they ready?

Copy link
Contributor

@atfornes atfornes left a 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 :)

height: auto;
max-height: 40px;
margin: 0 auto;
overflow: auto;
Copy link
Contributor

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

Copy link
Contributor

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.

border-radius: 6px;
}
div.popover-link-image{
width: 330px;
Copy link
Contributor

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

overflow: hidden;
white-space: nowrap;
}
.popover-link-address{
Copy link
Contributor

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.

Copy link
Contributor

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?

left: -1px;
border-style: solid;
border-width: 0 10px 10px;
border-color: #F1F1F1 transparent;
Copy link
Contributor

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.

div.style.backgroundColor = '#F2F2F2';
div.style.paddingTop = '5px';
div.id = 'popover-container';
document.body.appendChild(div);
Copy link
Contributor

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.

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

Successfully merging this pull request may close these issues.

2 participants