summaryrefslogtreecommitdiffstats
path: root/public/vendor/librejs.html
Commit message (Collapse)AuthorAgeFilesLines
* Support unicode emojis and remove emojify.js (#11032)mrsdizzie2020-04-281-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Support unicode emojis and remove emojify.js This PR replaces all use of emojify.js and adds unicode emoji support to various areas of gitea. This works in a few ways: First it adds emoji parsing support into gitea itself. This allows us to * Render emojis from valid alias (:smile:) * Detect unicode emojis and let us put them in their own class with proper aria-labels and styling * Easily allow for custom "emoji" * Support all emoji rendering and features without javascript * Uses plain unicode and lets the system render in appropriate emoji font * Doesn't leave us relying on external sources for updates/fixes/features That same list of emoji is also used to create a json file which replaces the part of emojify.js that populates the emoji search tribute. This file is about 35KB with GZIP turned on and I've set it to load after the page renders to not hinder page load time (and this removes loading emojify.js also) For custom "emoji" it uses a pretty simple scheme of just looking for /emojis/img/name.png where name is something a user has put in the "allowed reactions" setting we already have. The gitea reaction that was previously hard coded into a forked copy of emojify.js is included and works as a custom reaction under this method. The emoji data sourced here is from https://github.com/github/gemoji which is the gem library Github uses for their emoji rendering (and a data source for other sites). So we should be able to easily render any emoji and :alias: that Github can, removing any errors from migrated content. They also update it as well, so we can sync when there are new unicode emoji lists released. I've included a slimmed down and slightly modified forked copy of https://github.com/knq/emoji to make up our own emoji module. The code is pretty straight forward and again allows us to have a lot of flexibility in what happens. I had seen a few comments about performance in some of the other threads if we render this ourselves, but there doesn't seem to be any issue here. In a test it can parse, convert, and render 1,000 emojis inside of a large markdown table in about 100ms on my laptop (which is many more emojis than will ever be in any normal issue). This also prevents any flickering and other weirdness from using javascript to render some things while using go for others. Not included here are image fall back URLS. I don't really think they are necessary for anything new being written in 2020. However, managing the emoji ourselves would allow us to add these as a feature later on if it seems necessary. Fixes: https://github.com/go-gitea/gitea/issues/9182 Fixes: https://github.com/go-gitea/gitea/issues/8974 Fixes: https://github.com/go-gitea/gitea/issues/8953 Fixes: https://github.com/go-gitea/gitea/issues/6628 Fixes: https://github.com/go-gitea/gitea/issues/5130 * add new shared function emojiHTML * don't increase emoji size in issue title * Update templates/repo/issue/view_content/add_reaction.tmpl Co-Authored-By: 6543 <6543@obermui.de> * Support for emoji rendering in various templates * Render code and review comments as they should be * Better way to handle mail subjects * insert unicode from tribute selection * Add template helper for plain text when needed * Use existing replace function I forgot about * Don't include emoji greater than Unicode Version 12 Only include emoji and aliases in JSON * Update build/generate-emoji.go * Tweak regex slightly to really match everything including random invisible characters. Run tests for every emoji we have * final updates * code review * code review * hard code gitea custom emoji to match previous behavior * Update .eslintrc Co-Authored-By: silverwind <me@silverwind.io> * disable preempt Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
* Upgrade jQuery to 3.5.0, remove jQuery-Migrate, fix deprecations (#11055)silverwind2020-04-181-6/+1
| | | | | | | | | | | | - Removed jQuery-Migrate as it seems to no longer be needed. - Removed a dead code section. - Fixed some deprecations detected by jQuery-Migrate. Ref: https://jquery.com/upgrade-guide/3.5/ Ref: https://github.com/gogs/gogs/search?q=repo-name-change-prompt Ref: https://github.com/go-gitea/gitea/search?q=repo-name-change-prompt Fixes: https://github.com/go-gitea/gitea/issues/9372 Co-authored-by: zeripath <art27@cantab.net>
* Remove nonexistant serviceworker entries (#11091)silverwind2020-04-161-1/+1
|
* move jquery-datetimepicker to npm/webpack (#10713)silverwind2020-03-171-6/+6
| | | | | | | | | - update to latest version and move to npm - adapt for api changes and css class rename - add specificity to arc-green rules as dependency css now loads later - use imports-loader to make it load correctly - fix some wrong paths in librejs Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Move dropzone.js to npm/webpack (#10645)silverwind2020-03-071-3/+3
| | | | - unvendor dropzone and upgrade it from 4.2.0 to 5.7.0 - make `csrf` available on window.config
* move vue and vue-calendar-heatmap to webpack (#10188)silverwind2020-02-231-9/+4
| | | | | | | | | | | | - unvendor vue and vue-calendar-heatmap - remove unused moment.js leftover from previous heatmap version - ensure webpack loads the full version of vue - fix vue devmode warning related to 'searchLimit' type I wanted to name the chunk heatmap.js but adblockers don't like that filename [1]. [1] https://github.com/easylist/easylist/blob/3899d5dff33216c0bc64f09ff15d376f346d3e33/easyprivacy/easyprivacy_general.txt#L2095
* move clipboard.js to npm/webpack (#10183)silverwind2020-02-081-2/+2
| | | | | | | | - created lazy-loaded webpack chunk for clipboard.js - upgraded clipboard.js from 1.5.9 to 2.0.4 - parallelize initialization of all lazy-loaded features Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
* move jquery.are-you-sure to npm/webpack (#10063)silverwind2020-01-291-1/+1
|
* move highlight.js to npm/webpack (#10011)silverwind2020-01-281-2/+2
| | | | | | | | | | - introduced window.config to help with js-based lazy-loading - adjusted webpack chunk naming to avoid 'vendors~name.js' that webpack defaults to for vendor chunks. - added theme class to html and prefixed all selectors. this is neccesary so that the theme styles win over the lazy-loaded ones. Co-authored-by: zeripath <art27@cantab.net>
* Change font to Roboto to support more charsets (#9803)Lauris BH2020-01-251-3/+3
|
* remove loadCSS and preload woff2 icon fonts (#9976)silverwind2020-01-251-10/+0
| | | | | | | | | | loadCSS was used as a polyfill for rel=preload but it seems we only used it on a single CSS file which did not help much. Changed the icon CSS to a blocking load and preload the woff2 variants which does work in modern browsers (Firefox currently needs the network.preload about:config setting but should gain proper support soon). Co-authored-by: zeripath <art27@cantab.net>
* fix wrong font url on semantic-ui (#9917)Lunny Xiao2020-01-211-1/+1
| | | | Co-authored-by: Lauris BH <lauris@nix.lv>
* move jquery and jquery-migrate to npm/webpack (#9813)silverwind2020-01-211-3/+3
| | | | | | | | | | Currently, this needs to be its own chunk because fomantic depends on jQuery being present. The next step is to move fomantic to webpack too after which we can combine the index,fomantic and jquery files into one. jquery-migrate is still neccessary because our ancient version of Dropzone seems to break without it. I imagine it can be removed after a Dropzone upgrade.
* remove promise-polyfill (#9812)silverwind2020-01-161-5/+0
| | | promises are polyfilled by babel, it's no longer needed.
* switch to fomantic-ui (#9374)techknowlogick2019-12-171-3/+3
|
* move semantic.dropdown.custom.js to webpack (#9064)silverwind2019-11-211-2/+2
| | | | | | | | | | | | | * move semantic.dropdown.custom.js to webpack Also disabled a annoying linter rule which insisted that imports can not contain a file extension. Fixes: https://github.com/go-gitea/gitea/issues/8971 * reorganize web_src files and rebuild * restart ci
* enable lazy-loading of gitgraph.js (#9036)silverwind2019-11-171-1/+1
| | | | | | | | | | | | | | | | | - moved gitgraph.js to web_src and made it importable and es6-compatible - created new webpack chunk for gitgraph - enabled CSS loader in webpack - enabled async/await syntax via regenerator-runtime - added script to ensure webpack chunks are loaded correctly - disable terser's comment extraction to prevent .LICENCE files gitgraph.js has many issues: 1. it is incompatible with ES6 because of strict-mode violations 1. it does not export anything 1. it's css has weird styles like for `body` 1. it is not available on npm I fixed points 1-3 in our version so it's now loadable in webpack. We should eventually consider alternatives.
* Pack web_src/js/draw.js to public/js/index.js (#8975)Lunny Xiao2019-11-141-6/+1
| | | | | | * pack web_src/js/draw.js to public/js/index.js * fix eslint
* [Feature] Add Gitea Emoji (#8950)65432019-11-141-1/+1
| | | | | | | | | | | | | | * add gitea emoji * alphabetic order * Update emojify.js to 1.1.0 * mv to custom * add gitea emoji * minify
* a11y: Improve accessibility of dropdown menus (#8638)Jookia2019-11-081-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * js: Import Semantic-UI's dropdown.js (version 2.3.1) * js: Set tabindex=-1 on dropdown items Setting tabindex=-1 on focusable elements within dropdown menus allows the user to treat dropdown menus as a single focusable item with its own internal navigation using arrow keys. * js: Don't use jQuery to click menu items Menu items are often <a> elements, which jQuery refuses to trigger click events on. Instead it just bubbles up to the menu. Using HTMLElement's click method fixes this and makes menu items clickable from the keyboard using dropdown menus. * js: Set correct ARIA 1.1 roles on dropdown menus Setting role= makes assistive technology aware there is a widget here. In this case, Orca will now exit browse mode and allow us to capture keydown events when focused on a dropdown menu. It will also inform the user that there's a menu focused. Since dropdowns can be used in multiple elements each with different ARIA roles, a guessRole method is used to find the correct role. All roles I consider possible are listed, but only menu is implemented. * js: Set aria-expanded when dropdown menus show and hide This is deliberately done before the transition finishes so that screen readers get immediate feedback. * js: Set aria-label or aria-labelledby on dropdown menus This makes dropdown menu buttons screen reader accessible. aria-labelledby refers to an element using an ID, so the chosen labels are now assigned a unique ID- This ID is not stable, do not refer to it with user scripts. * js: Set aria-activedescendant on dropdown menus As the menus grab focus and navigate by tracking a 'selected' div class, assistive technology has no idea that what the current selection is. Assign IDs to each menu item and set aria-activedescendant to the ID of the currently selected menu item. When the menu is unfocused, remove aria-activedescendant- This isn't neccessary but in my experience it triggers Orca to remind the user of their current selection when re-focusing the menu. * Makefile: Make eslint ignore semantic.dropdown.js This file is taken from Semantic UI which isn't linted upstream. Ignore it as we won't fix these issues. * js: Add version note to semantic.dropdown.js * Add Md5 AppVer to templates/base/footer.tmpl Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> * Add Md5 AppVer to templates/pwa/serviceworker_js.tmpl Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> * semantic.dropdown.js -> semantic.dropdown.custom.js * Use eslintignore * remove bogus submodule
* Update CodeMirror to version 5.49.0 (#8381)oscar.lofwenhamn2019-10-151-2/+2
| | | | | | * Update CodeMirror to version 5.49.0 * Update CodeMirror versions in librejs and VERSIONS
* vendor: update pdf.js to v2.1.266 (#7834)Antoine GIRARD2019-08-131-1/+1
|
* jQuery 3 (#7425)techknowlogick2019-07-121-2/+7
| | | | | | | | | | * jquery 3 * use most recent version of migrate plugin * Delete .DS_Store * update service worker in case anyone has old version of jquery cached
* update swagger-ui (#6661)Antoine GIRARD2019-04-161-1/+1
|
* update highlight.js (#6658)silverwind2019-04-161-2/+2
|
* UI: Fix race in update issue labels and assignees (#6194)silverwind2019-02-281-3/+3
| | | | | | | | | | Fix #6191 * fix issue update race condition * fix similar race same race when clearing assignee * always load promise polyfill * replace es6-promise with promise-polyfill * move promise-polyfill to <head>
* Fix heatmap and repository menu display in Internet Explorer 9+ (#6117)Lauris BH2019-02-191-2/+7
|
* Refactor heatmap to vue component (#5401)Lauris BH2018-11-271-8/+3
|
* User action heatmap (#5131)kolaente2018-10-231-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Added basic heatmap data * Added extra case for sqlite * Built basic heatmap into user profile * Get contribution data from api & styling * Fixed lint & added extra group by statements for all database types * generated swagger spec * generated swagger spec * generated swagger spec * fixed swagger spec * fmt * Added tests * Added setting to enable/disable user heatmap * Added locale for loading text * Removed UseTiDB * Updated librejs & moment.js * Fixed import order * Fixed heatmap in postgresql * Update docs/content/doc/advanced/config-cheat-sheet.en-us.md Co-Authored-By: kolaente <konrad@kola-entertainments.de> * Added copyright header * Fixed a bug to show the heatmap for the actual user instead of the currently logged in * Added integration test for heatmaps * Added a heatmap on the dashboard * Fixed timestamp parsing * Hide heatmap on mobile * optimized postgresql group by query * Improved sqlite group by statement
* offline use of fonts (#4872)techknowlogick2018-09-061-0/+5
|
* Update jQuery to v1.12.4 (#4551)techknowlogick2018-07-301-1/+1
| | | Fix #4384
* relative URLs for LibreJS page (#4460)techknowlogick2018-07-181-24/+24
| | | Fix #4449
* Added front-end topics validation (#4316)Alexey Terentyev2018-07-141-2/+2
|
* Remove autolink.js references (#4072)techknowlogick2018-05-291-5/+0
| | | | | | | | | | * Autolink.js no longer used Fixes #4069 * Remove autolink.js references * Fix reference to u2f js
* Add support for FIDO U2F (#3971)Jonas Franz2018-05-191-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add support for U2F Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add vendor library Add missing translations Signed-off-by: Jonas Franz <info@jonasfranz.software> * Minor improvements Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add U2F support for Firefox, Chrome (Android) by introducing a custom JS library Add U2F error handling Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add U2F login page to OAuth Signed-off-by: Jonas Franz <info@jonasfranz.software> * Move U2F user settings to a separate file Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add unit tests for u2f model Renamed u2f table name Signed-off-by: Jonas Franz <info@jonasfranz.software> * Fix problems caused by refactoring Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add U2F documentation Signed-off-by: Jonas Franz <info@jonasfranz.software> * Remove not needed console.log-s Signed-off-by: Jonas Franz <info@jonasfranz.software> * Add default values to app.ini.sample Add FIDO U2F to comparison Signed-off-by: Jonas Franz <info@jonasfranz.software>
* Moved vendored js/css into `public/vendor` and documented sources (#1484) ↵Michael Lustfield2017-08-231-0/+136
(#2241) * Cleaning up public/ and documenting js/css libs. This commit mostly addresses #1484 by moving vendor'ed plugins into a vendor/ directory and documenting their upstream source and license in vendor/librejs.html. This also proves gitea is using only open source js/css libraries which helps toward reaching #1524. * Removing unused css file. The version of this file in use is located at: vendor/plugins/highlight/github.css * Cleaned up librejs.html and added javascript header A SafeJS function was added to templates/helper.go to allow keeping comments inside of javascript. A javascript comment was added in the header of templates/base/head.tmpl to mark all non-inline source as free. The librejs.html file was updated to meet the current librejs spec. I have now verified that the librejs plugin detects most of the scripts included in gitea and suspect the non-free detections are the result of a bug in the plugin. I believe this commit is enough to meet the C0.0 requirement of #1534. * Updating SafeJS function per lint suggestion * Added VERSIONS file, per request