summaryrefslogtreecommitdiff
path: root/public/js (unfollow)
Commit message (Collapse)AuthorFilesLines
2020-11-27Remove reference to nonexisting DOM elementDavid Mehren1-2/+0
This was missed in #596 and breaks the frontend JS. Signed-off-by: David Mehren <git@herrmehren.de>
2020-11-26Remove pdf export codeTilman Vatteroth1-2/+1
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-11-14Replace CodiMD with HedgeDocErik Michelson2-3/+3
Signed-off-by: Erik Michelson <github@erik.michelson.eu> Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Rename to HedgeDoc: References in public/views Signed-off-by: David Mehren <git@herrmehren.de> Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Rename to HedgeDoc: Update links in README Signed-off-by: David Mehren <git@herrmehren.de> Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Rename to HedgeDoc: Update links in SECURITY.md Signed-off-by: David Mehren <git@herrmehren.de> Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Rename to HedgeDoc: Update links in LICENSE Signed-off-by: David Mehren <git@herrmehren.de> Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Rename to HedgeDoc: Update links in docs/configuration.md Signed-off-by: David Mehren <git@herrmehren.de> Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Rename to HedgeDoc: Update links in bin/setup Signed-off-by: David Mehren <git@herrmehren.de> Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Rename to HedgeDoc: References in docs/guides Signed-off-by: David Mehren <git@herrmehren.de> Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Rename to HedgeDoc: References in docs/dev Signed-off-by: David Mehren <git@herrmehren.de> Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Rename to HedgeDoc: References in docs/guides/auth Signed-off-by: David Mehren <git@herrmehren.de> Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Rename to HedgeDoc: References in docs/setup Signed-off-by: David Mehren <git@herrmehren.de> Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Rename to HedgeDoc: Update various links in code to the new GitHub org. Signed-off-by: David Mehren <git@herrmehren.de> Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Rename to HedgeDoc: codiMDVersion.js is now hedgeDocVersion.js Signed-off-by: David Mehren <git@herrmehren.de> Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Rename to HedgeDoc: References in docs/setup/yunohost Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Rebrand to HedgeDoc: Add banner and logo Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Rename to HedgeDoc: Update links in docs/guides/migrate-etherpad Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Rename to HedgeDoc: Remove note in docs/guides/auth/github Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Rename to HedgeDoc: Replace links in public/docs/features Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Rename to HedgeDoc: Add todo placeholder in docs/history Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Rename to HedgeDoc: Replace github link in public/views/index/body Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Rename to HedgeDoc: Replace github link in README Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Rename to HedgeDoc: Add logo to README Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Rename to HedgeDoc: Add note about the renaming to the front page Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Removed Travis from README.md and change CodiMD to HedgeDoc in some places Signed-off-by: Yannick Bungers <git@innay.de> Some more renaming to HedgeDoc - Fixed capitalization of HedgeDoc - Added renaming for etherpad migration doc Signed-off-by: Yannick Bungers <git@innay.de> Changed Repo name to hedgedoc Signed-off-by: Yannick Bungers <git@innay.de>
2020-11-10Use URL constructor instead of regex to check for valid URLDavid Mehren1-9/+4
Fixes #545 Co-authored-by: Yannick Bungers <git@innay.de> Signed-off-by: David Mehren <git@herrmehren.de>
2020-08-27Add config option for cookie SameSite policyErik Michelson5-12/+14
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2020-08-23Add prevent default to export button tooErik Michelson1-1/+2
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2020-08-23Add dropbox CSP directive if configured and make button clickableErik Michelson1-1/+2
The lack of a 'preventDefault' on the click event handler resulted in the dropbox link being unclickable. Furthermore because of a missing CSP rule, the dropbox script couldn't be loaded. The dropbox origin is now added to the CSP script sources if dropbox integration is configured. Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2020-08-13Made changed/created status translatableErik Michelson1-3/+6
The current version of CodiMD/HedgeDoc does only support translations to be filled on server-side rendering. To allow the translation of the changed/created texts, I duplicated the container that holds the text, and pre-filed these containers with the translation server-side. The client just needs to hide the unneeded container and show the right one to show the translated status text. Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2020-08-13Restructured locale.js to be included into the editor's js bundleErik Michelson2-31/+34
Until now client-side translations were only possible in the context of the intro/history page, because the locale-detection logic relied on the language selector as a source of available languages. The editor of course has no such selector. With this commit, I copied the list of available languages from the i18n-initialization (server-side) to support language detection in the editor too. Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2020-08-13Fixed setting moment.js locale to user-defined languageErik Michelson2-1/+7
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2020-06-08Set all cookies with sameSite: strictDavid Mehren4-12/+24
Modern browsers do not support (or will stop supporting) sameSite: none (or no sameSite attribute) without the Secure flag. As we don't want everyone to be able to make requests with our cookies anyway, this commit sets sameSite to strict. See https://developer.mozilla.org/de/docs/Web/HTTP/Headers/Set-Cookie/SameSite Signed-off-by: David Mehren <dmehren1@gmail.com>
2020-02-10Fix revision redirect to index pageSheogorath1-1/+1
The revision view had a bug that clicking on a list entry would redirect the user back to the index page instead of providing the revision diff. This was cased by the baseurl which is now used as reference for hrefs. Therefore when clicking on the `href="#"` this was actually pointing at `<baseurl>#` which is usually the index page. This patch simply removes the href from the list items and therefore the link functionality. This fixes the whole problem by removing 9 characters from our source code. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2020-01-08Fix #249 - Focus user field after opening login modalErik Michelson1-0/+14
Signed-off-by: Erik Michelson <erik@liltv.de>
2019-10-30make standard conform [fix]hoijui1-8/+5
Signed-off-by: hoijui <hoijui.quaero@gmail.com>
2019-10-30make `headerIds` `const` [fix]hoijui1-1/+1
Signed-off-by: hoijui <hoijui.quaero@gmail.com>
2019-10-30fix gfm header link generation with respect to `deduplicatedHeaderId`hoijui1-19/+69
Signed-off-by: hoijui <hoijui.quaero@gmail.com>
2019-10-30linkifyHeaderStyle needs no string-ification; is already str.hoijui1-1/+1
Co-Authored-By: Yukai Huang <yukaihuangtw@gmail.com> Signed-off-by: hoijui <hoijui.quaero@gmail.com>
2019-10-22Don't accept sandbox attributeRyotaK1-1/+1
Because sandbox is whitelist attribute, attacker will be able to create iframe that has more permission than default. Signed-off-by: RyotaK <49341894+ry0tak@users.noreply.github.com>
2019-10-22Allow to generate lower case header references through the confighoijui2-1/+7
This makes the references consistent/compatible with GitHub, GitLab, Pandoc and many other tools. This behavior can be enabled in config.json with: ``` "linkifyHeaderStyle": "gfm" ``` Signed-off-by: hoijui <hoijui.quaero@gmail.com>
2019-10-22slight doc comment touch-up/simplification [minor]hoijui1-3/+3
Signed-off-by: hoijui <hoijui.quaero@gmail.com>
2019-05-31Fix eslint warningsSheogorath10-953/+958
Since we are about to release it's time to finally fix our linting. This patch basically runs eslint --fix and does some further manual fixes. Also it sets up eslint to fail on every warning on order to make warnings visable in the CI process. There should no functional change be introduced. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2019-05-30fixed styling of slides previewToma Tasovac1-0/+2
Signed-off-by: Toma Tasovac <ttasovac@humanistika.org>
2019-05-12Fix toolbar day modePedro Ferreira2-15/+17
Also moved the code to SCSS Signed-off-by: Pedro Ferreira <pedro@dete.st>
2019-05-12Make upload button respect night modePedro Ferreira2-4/+4
Also set a title in the input field, so that the file name doesn't show up. Signed-off-by: Pedro Ferreira <pedro@dete.st>
2019-04-16Replace js-url with wurlSheogorath2-4/+6
js-url is outdated and wurl is it's successor. This will fix some vulnerabilities in the dependencies and also optimize the build process by removing the external library toward internal tooling. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2019-04-16Fix stored XSS in the graphviz error message rendering [Security Issue]Max Wu1-6/+7
Signed-off-by: Max Wu <jackymaxj@gmail.com> Co-Authored-By: Sheogorath <sheogorath@shivering-isles.com>
2019-03-25Move upload button into toolbarSheogorath4-17/+13
Currently we have the odd situation to have two toolbars. One inside the header and one in the editor. Since we only show the image upload button when the editor is visible we should move the upload button into the editor toolbar. This patch does this by adding the image upload button besides the image tag button. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2019-03-09Fix broken HTML export with emojisSheogorath1-1/+1
HTML export was broken due to missing alt-attribute for emojis. This patch adds the old alt-element style and restores the exportability this way. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2019-02-21Fix CI errors for unused variablesSheogorath1-3/+2
Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2019-02-21Remove broken speakerdeck embeddingSheogorath1-28/+7
The current speakerdeck implementation is broken. An alternative implementation using oembed doesn't work due to CORS, which could be solved by proxying the speakerdeck API, but we decided to not do this. This patch provides the link to the speakerdeck presentation instead, and this way doesn't break existing notes. This is right now the best solution we could come up with. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-12-28Fix to escape html comment tag [Security Issue]Max Wu1-1/+1
Signed-off-by: Max Wu <jackymaxj@gmail.com>
2018-11-21Update from to-markdown to turndownSheogorath1-2/+7
We got a security alert for a regular expression DoS attack on our used library `to-markdown`. After checking `to-markdown` to be maintained or not, it turned out they renamed the library to `turndown`. So upgrading to `turndown` should fix this vulnerbility. References: https://www.npmjs.com/package/to-markdown https://github.com/domchristie/turndown/wiki/Migrating-from-to-markdown-to-Turndown Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-11-19Fix wrong anchorsSheogorath2-2/+5
While experimenting with the ToC changes, it became obvious that anchors for those unnamed headers don't work. This patch fixes those links by running the autolinkify twice and make sure linkify only adds links to non-empty ids. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-11-14switching to eslint for code checkingClaudius Coenen4-6/+9
most rules degraded to WARN, so we don't go insane. This will change over time. The aim is to conform to a common style Signed-off-by: Claudius Coenen <opensource@amenthes.de>
2018-11-10Remove the xss library from webpackSheogorath2-4/+7
We can load the xss functions directly from the library instead of loading them through the expose loader of webpack, this should simplify the setup and maybe even improve speed a bit. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-10-31Again: Replace emoji-plugin regexSheogorath1-7/+6
The Regex introduced in the last commit[1], was already working quite good. But still resulted in false positives for all URL that contained a second `:`. To fix this once and for all, we craft a simple, but long regex based on all emoji names and use this to match them. We could probably optimize it, but that should also be something the regex engine itself can and should do. [1]: 7e45533c75a3697c916e52e5f4ddff42a38bd3d5 (in this source tree) Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-10-29Fix emoji regexSheogorath1-1/+1
The old regex, adapted from the other plugins, was a bit too open for matching. This leads to matching something like: `This is a sentence: [And something with a: in it.]()` which doesn't become a link anymore. Because the match is: ` [And something with a`. This patch provides a fix for the regex to only match non-space string within the `:`'s. References: - Introducing commit: https://github.com/hackmdio/codimd/commit/2063eb8bdf9c0537e9fcfadd7f587658c72bd281 - Inspirational source of the original RegEx: https://github.com/hackmdio/codimd/blob/2063eb8bdf9c0537e9fcfadd7f587658c72bd281/public/js/extra.js#L1095 Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-10-10Remove dead package octiconSheogorath1-1/+1
Octicon no longer provides its CSS classes and this way is useless in CodiMD. Replacing all used classes in the UI and remove it from build system. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-10-10Fix not rendered autocomplete emojisSheogorath1-0/+15
Currently we have some emojis that are autocompleted but won't show up in the resulting document. This patch adds all emojis that are pushed to Codemirror and applies them to the markdown rendering process, so they become usable. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-10-10Add autocomplete for highlight.js languages into codemirrorSheogorath1-1/+2
Right now we support code highlighting for rust, but it doesn't appear in autocomplete of codemirror, because codemirror is not aware of it. This patch lets highlightjs simply tell codemirror, what it supports and adds this to the autocomplete list. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-10-09Fix #986 : Visibility is now transmitted with gitlab V4 apiCédric Couralet1-1/+1
Signed-off-by: Cédric Couralet <cedric.couralet@gmail.com>
2018-10-04Add rel="noopener" to target="_blank" linksSheogorath1-1/+3
The noopener construct protects from some nasty clickjacking attacks. We can apply them savely to all our links since we don't rely on the previously used page. Some more details: https://mathiasbynens.github.io/rel-noopener/ Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-07-31Add possibility to choose between version v3 or v4 for the gitlab api.Cédric Couralet1-6/+11
Apart from the uri versioning, one big change is the snippet visibility post data (visibility_level -> visibility) Default gitlab api version to v4 Signed-off-by: Cédric Couralet <cedric.couralet@gmail.com>
2018-07-08Fix some false titlesAlexander Wellbrock1-2/+2
Signed-off-by: Alexander Wellbrock <a.wellbrock@mailbox.org>
2018-06-30Update storeSheogorath1-59/+20
Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-06-26Fix broken unicode urlsSheogorath1-1/+1
It wasn't possible to create unicode based URLs in freeurl mode, because the noteid used for the websocket connection is double escaped. When we decode it and let socketio-client reencode it, we get the real shortid/noteid and can find the note in the database and open the connection. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-06-24Add Print icon to slide viewSheogorath1-0/+1
It redirects the user to the print view of the document. I claim that people should either be smart enough to use ctrl+P or ask someone who knows how to print a webpage. I don't want to babysit our users. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-06-24Final replacementsSheogorath1-1/+1
Looks like I missed a few. This should be complete now. And make us ready for the repo rename and merging. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-06-24Rebrand HackMD to CodiMDSheogorath1-2/+2
Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-06-23Fix all newly introduced linting issuesSheogorath1-10/+10
Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>