Giter VIP home page Giter VIP logo

publiclab / publiclab.editor Goto Github PK

View Code? Open in Web Editor NEW
81.0 24.0 129.0 20.1 MB

A general purpose, JS/Bootstrap UI framework for rich text posting. An author-friendly, minimal, mobile/desktop interface for creating blog-like content, designed for PublicLab.org

Home Page: https://publiclab.github.io/PublicLab.Editor/examples/

License: GNU General Public License v3.0

JavaScript 97.91% HTML 2.09%
hacktoberfest

publiclab.editor's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

publiclab.editor's Issues

GuidedTags module to help people post power tags

A moddable module which can guide you through making tags, which could simply be some common options displayed as buttons, or could be some more involved kind of menu or prompt.

@ebarry -- do you think that if we had an interface like this, that the tags it creates should be added to the basic "tags" input, in part so that people can "see behind the curtain" and be able to add tags themselves without the guide (or to a pre-existing page?)

Or do you think that might result in a confusing amount of tags in the tag input? It might end up looking like this:

screenshot 2016-08-03 at 5 57 37 pm

bold text which was converted to Headers got odd formatting

I made some bold text at https://publiclab.org/editor into a header using the Cmd-D shortcut.

I was left with:

**

### Session note-taking**

I did:

  1. created the bold text by typing and selecting and using cmd-B
  2. selected it and turned it into a heading using cmd-D
  3. repeated the cmd-D twice more to get a smaller heading
  4. switched to Markdown mode

I was able to reproduce this at https://publiclab.github.io/PublicLab.Editor/examples/, too.

I believe this may be an issue to fix in domador? https://github.com/bevacqua/domador

ability to generate HTML elements from templates

This is not an urgent feature, but could result in just having to pass an element (or jQuery-type selector, like div#editor) instead of needing a whole bunch of specifically named elements as in the example pages.

This is also not super easy in older browsers, due to template literals being a pretty new feature: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals

(apart from just doing it messily, building in jQuery node by node in older JS syntax)

...but could be done with https://babeljs.io/, perhaps with help from https://github.com/trueadm/t7

Don't display "alert" element if there are no errors

What happened just before the problem occurred

When starting a new post in the rich editor, you can see a red bar or box where errors would show, even though there aren't any errors.

Relevant URLs

https://publiclab.org/editor/ (requires login) or in this repository's demo?

Relevant lines of code

Here's where we check if there are errors: https://github.com/publiclab/PublicLab.Editor/blob/master/src/PublicLab.Errors.js#L14

Here's where the errors are displayed in a <div>: https://github.com/publiclab/PublicLab.Editor/blob/master/src/PublicLab.Errors.js#L16

So really, we should add a test that checks that the errors are not shown when there is no _errors.options included in the editor's constructor. The test could go here:

https://github.com/publiclab/PublicLab.Editor/blob/master/spec/javascripts/errors_spec.js

Preview for small leads images is tiled

I uploaded this small image to the main image box on the Editor:

screen shot 2016-10-26 at 2 45 15 pm

and the preview showed this:

screen shot 2016-10-26 at 2 45 33 pm

But this is not a real problem because once published, the lead image was not actually tiled.

Toggling between Rich and Markdown resets all numbers in a numbered list to `1.`

Really enjoying the new Editor, just wanted to point out that when toggling between the rich mode and markdown (which i did to try to get more control on how some code bits were displaying), resulted in some loss of formatting when back in rich mode.

The automated indentations were still present, but the numbers all reset to 1. It was easy to fix this by placing my cursor after the automatic number at the start of my text, and click backspace and the numbering caught up to where it should have been:

screen shot 2016-10-26 at 12 11 21 pm

screen shot 2016-10-26 at 12 11 32 pm

ask for specific interface design input via research note

Draft questions:

We're looking for design feedback from folks new to Public Lab. Have you ever posted on PublicLab.org?

If you have one, what is your username?

Rate https://publiclab.org/post from 1: confusing to 5: intuitive

Comments and thoughts on the design and interface?

Specific things that caused you trouble or were confusing?

Rate https://publiclab.org/editor/examples/ from 1: confusing to 5: intuitive

Comments and thoughts on the design and interface?

Specific things that caused you trouble or were confusing?

What is an authoring interface you've used that you liked? That you didn't like?

Set minimum note length, or at least prompt authors to write more

We sometimes get very short posts by people with no context or background, and perhaps just a MapKnitter map or Spectral Workbench image. We should try to draw them out more in describing what they're sharing and why. Apart from better templates, we could make an alert popup or something like that, that can say something like:

You haven't written very much -- add a bit more detail or background to help people understand what you're sharing and why.

We'd have to be sure this doesn't affect questions, which can be very short. Or maybe set the threshold for questions to be shorter.

When dragging and dropping, image URL prompt flashes then disappears quickly

I'm using the publiclab.org/editor and it's very nice.

When i drag and drop images, the image URL prompt displays for a short time, i think while the image is uploading -- it seems to request information like adding a link URL but the issue i am reporting is that this prompt disappears before i can actually read it or type into it. I had to be fast even to capture this screenshot of it!

screen shot 2016-10-26 at 10 11 42 am

Actually, if i had wanted to add a link to the image, and i had missed my chance during this flash, i am not sure how to get this popup back.

Document/refine autocompletion code

Please note we are preparing to participate in Google Code-in, and have reserved this issue for GCI participants - but we'd love to have your help with another one! Please check out https://code.publiclab.org to see more.

GCI students are requested to go through the conversation and understand it before jumping to the implementation. The conversation will help them to debug it.

maybe break out into independent submodule?

History module doesn't display until a day is over, in incognito mode

What is happening here is all body text logs are being saved in the local cookie store but as you can see in this line https://github.com/publiclab/PublicLab.Editor/blob/master/src/PublicLab.History.js#L194 they are appended with a display:none property in a p tag. All these logs can be toggled with a log button that displays the date on which they were made. But the button isn't displayed until a day gets over after you use the editor for the first time. See these lines: https://github.com/publiclab/PublicLab.Editor/blob/master/src/PublicLab.History.js#L185-L192. After a day it shows the toggle button and logs can be seen henceforth.

Entering a link scrolls the page to the start of the textarea

Please note we are preparing to participate in Google Code-in, and have reserved this issue for GCI participants - but we'd love to have your help with another one! Please check out https://code.publiclab.org to see more.

Not sure if this is a Woofmark behavior or what? https://github.com/bevacqua/woofmark

but it could be tested in that editor to see; it may be due to a # link of some kind being triggered on pressing enter after inputting the URL in the popup form.

Minor fix in the tooltip

Hello, while trying to get a hang of the codebase I noticed a relatively insignificant issue that the tooltip-arrow wasn't positioned properly in the example page. Can get rid of the arrow simply by adding .tooltip.bottom .tooltip-arrow { display:none;} to the css.

Error message doesn't show correctly for unsuccessful Submission

If the form Submission fails due to some reason such as not entering the title or body (or if any validation check fails at database side) the entire html template is appended to the url as response text and no appropriate error message is displayed. This is what I am getting for a unsuccessful submission while integrating it with a Rails server(Testing with the plots code).
error_editor

Better tests and debugging for History module

I haven't seen my drafts saving... i think we're deleting from the wrong end of the array at:

https://github.com/publiclab/PublicLab.Editor/blob/master/src/PublicLab.History.js#L59-L60

        _history.log = _history.log.slice(0, 20);

Hmm, tested this out and it looks ok --

Maybe this is more about what exactly triggers history storage? Right now it's on 10 second interval, but also on if the textarea 'changes':

https://github.com/publiclab/PublicLab.Editor/blob/master/src/PublicLab.History.js#L20

      $(_editor.richTextModule.options.textarea).on('change', function() {

and of course if it's changed from the last editor entry.

Toggling between Rich and Markdown loses extra carriage returns in numbered lists

When returning to rich mode from a brief dive into markdown mode, the carriage returns (which i placed after each numbered item to add white space between the bottom of the screenshot from the top of the next instruction) were lost. Not a big deal here, easy to work around this, but reporting it because it was unexpected behavior

If inside an ordered list, image upload fails.

Hi, i'm not sure if this is a bug, but i'm just pointing out that when i add images to my instructional steps, which are in a numbered list, i have to get out of the list in order for images to successfully upload. Once uploaded, i can easily indent an image as part of a numbered step.

if just typing numbers (i.e. not using the list widget), then dragging and dropping works although it loses how far you may be scrolled down the page -- it bumps you up to the top of your posting.

Refactor tagname/username/emoji autocompletion using atwho library

Autocompletion with horsey is just not working reliably in this library. But @cheneyshreve and @ViditChitkara have implemented some amazing autocompletion on the plots2 project using the atwho library:

@cheneyshreve has documented the at.js lib working in concert with our Woofmark rich text editor module. So this should work! We'd love some help getting this up and running.

Number of steps left doesn't show correctly

I see a little problem in the No of steps left displayed in the bottom right corner of the editor. It shows just fine when you fill out the body first and then the title. But if you fill out the title first and then the body (which is the usual order of posting a note) it shows 1 of 2 steps left. Also the Submit button is disabled until then so basically you can't post despite filling out all the title and body. Only after you write something in the title again all steps are shown to be complete and the Submit button is enabled.

Develop system for making "related" [Add +] buttons do something

https://github.com/publiclab/PublicLab.Editor/blob/master/src/modules/PublicLab.TitleModule.Related.js#L50 adds a + button to each "related" post when typing a title.

screen shot 2016-11-23 at 1 47 31 pm

That's set with:

function fetchRelated() {

    show([
      { id: 1, title: 'A related post',       url: '/', author: 'eustatic'},
      { id: 2, title: 'Another related post', url: '/', author: 'stevie'},
      { id: 3, title: 'A third related post', url: '/', author: 'bsugar'}
    ]);

  }

We should make it possible to set an action for when you press Add + -- perhaps an API method like:

function addRelated(item) {
  editor.tagsModule.value('notify:' + item.author + ',' + editor.tagsModule.value())
}

However, this would depend on publiclab/plots2#646 -- worthwhile, but for now, perhaps we wait.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.