summaryrefslogtreecommitdiffstats
path: root/web_src/js/features
Commit message (Collapse)AuthorAgeFilesLines
* Add Image Diff options in Pull Request Diff view (#14450)KN4CK3R2021-02-271-0/+206
| | | Implemented GitHub style image diff
* stopwatch notif: check if timetracking is enabled (#14750)Norwin2021-02-201-2/+5
| | | fixes #14435
* Move the stopwatches to the eventsource stream (#14588)zeripath2021-02-192-1/+57
| | | | | | | | | Move the stopwatches to the eventsource stream Use the /user/events eventsource to update the stopwatches instead of polling /api/v1/user/stopwatches if the eventsource is enabled. Signed-off-by: Andrew Thornton <art27@cantab.net>
* Add fullTextSearch to dropdowns by default (#14694)zeripath2021-02-161-0/+1
| | | | | | | | | | | | | | | This PR adds `fullTextSearch: 'exact'` to most dropdown invocations meaning that if there is a search box for the dropdown it will automatically do a fullTextSearch looking for the provided fragment instead of starting at the beginning We should consider changing other places that use `fullTextSearch: true` to `'exact'` because these will be using a fuzzy-textual search that doesn't necessarily return the expected results. Fix #14689 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Sort / Move project boards (#14634)Romain2021-02-111-0/+29
| | | Sort Project board (#14533)
* Display current stopwatch in navbar (#14122)Norwin2021-01-211-0/+91
| | | | | | | | | | | | | | | | | * add notification about running stopwatch to header * serialize seconds, duration in stopwatches api * ajax update stopwatch i should get my testenv working locally... * new variant: hover dialog * noscript compatibility * js: live-update stopwatch time * js live update robustness
* KanBan: be able to set default board (#14147)65432021-01-151-4/+19
| | | | Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: zeripath <art27@cantab.net>
* Update JS dependencies and webpack (#14118)silverwind2020-12-271-37/+35
| | | | | | | | | | | | | | | | | | * Update JS dependencies - Update all JS dependencies - Adapt webpack config for version 5 - Update to Less 4.0, adapting usage of removed mixin syntax - Enable new ESLint rules and fix discovered issues * update license-webpack-plugin to fix missing licenses * update license-webpack-plugin once more to get webpack into the license output * switch to license-checker-webpack-plugin again for performance * update deps again Co-authored-by: Lauris BH <lauris@nix.lv>
* Remove fetch request from heatmap (#13623)silverwind2020-11-182-10/+23
| | | | | | | | | | | | | | | | | | | * Remove fetch request from heatmap Render heatmap data directly to HTML, eliminating one HTTP request on frontpage and user profile. Also added min-height to the container so the page content will no longer move after loading. * rename and error display * also log the js error * add error handler * remove useless inline style and hide divider on small screens * Update routers/user/home.go * Update routers/user/profile.go
* Use monaco for the git hook editor (#13552)silverwind2020-11-131-41/+56
| | | | | | | Migrate git hook editor to monaco, replacing CodeMirror. Had to do a few refactors to make the monaco instantiation generic enough to be of use. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Multiple GitGraph improvements: Exclude PR heads, Add branch/PR links, Show ↵zeripath2020-11-081-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | only certain branches, (#12766) * Multiple GitGraph improvements. Add backend support for excluding PRs, selecting branches and files. Fix #10327 Signed-off-by: Andrew Thornton <art27@cantab.net> * as per @silverwind Signed-off-by: Andrew Thornton <art27@cantab.net> * as per @silverwind Signed-off-by: Andrew Thornton <art27@cantab.net> * Only show refs in dropdown we display on the graph Signed-off-by: Andrew Thornton <art27@cantab.net> * as per @silverwind Signed-off-by: Andrew Thornton <art27@cantab.net> * use flexbox for ui header Signed-off-by: Andrew Thornton <art27@cantab.net> * Move Hide Pull Request button to the dropdown Signed-off-by: Andrew Thornton <art27@cantab.net> * Add SHA and user pictures Signed-off-by: Andrew Thornton <art27@cantab.net> * fix test Signed-off-by: Andrew Thornton <art27@cantab.net> * fix test 2 Signed-off-by: Andrew Thornton <art27@cantab.net> * fixes * async * more tweaks * use tabs in tmpl Signed-off-by: Andrew Thornton <art27@cantab.net> * remove commented thing Signed-off-by: Andrew Thornton <art27@cantab.net> * fix linting Signed-off-by: Andrew Thornton <art27@cantab.net> * Update web_src/js/features/gitgraph.js Co-authored-by: silverwind <me@silverwind.io> * graph tweaks * more tweaks * add title Signed-off-by: Andrew Thornton <art27@cantab.net> * fix loading indicator z-index and position Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: Lauris BH <lauris@nix.lv>
* Update some JS dependencies (#13222)silverwind2020-10-211-1/+1
| | | | | | | | | | | | | * Update some JS dependencies - Update selective dependencies that are compatible with webpack 4. We can not upgrade to webpack 5 yet because `license-webpack-plugin` is incompatible. - Enable a few new eslint rules and fix new issues * fix comment Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: zeripath <art27@cantab.net>
* Disable migration items when mirror is selected (#12918)mrsdizzie2020-09-221-3/+10
| | | | | | | | | * Disable migration items when mirror is selected Disable migration items when mirror option is selected to make it more clear that it isn't possible to mirror anything other than code. * allow wiki checkbox for mirrors Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Make SVG size argument optional (#12814)silverwind2020-09-111-1/+1
| | | | | Now defaults to 16 on both frontend and backend. Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Add a migrate service type switch page (#12697)Lunny Xiao2020-09-091-13/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add a migrat service type switch page * Improve translations * remove images * Fix images * remove extra create repo button on dashboard * Follow reviewers' opinions * Fix frontend lint * Remove wrong submit file * Fix tests * Adjust the size of image * Apply suggestions from code review Co-authored-by: 赵智超 <1012112796@qq.com> * Remove username and password from migration of github/gitlab * Improve docs * Improve interface docs Co-authored-by: 赵智超 <1012112796@qq.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Git migration UX (#12619)John Olheiser2020-08-281-0/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Initial work Signed-off-by: jolheiser <john.olheiser@gmail.com> * Implementation Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix gitlab and token cloning Signed-off-by: jolheiser <john.olheiser@gmail.com> * Imports and JS Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix test Signed-off-by: jolheiser <john.olheiser@gmail.com> * Linting Signed-off-by: jolheiser <john.olheiser@gmail.com> * Generate swagger Signed-off-by: jolheiser <john.olheiser@gmail.com> * Move mirror toggle and rename options Signed-off-by: jolheiser <john.olheiser@gmail.com> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix emoji replacements, make emoji images consistent (#12567)silverwind2020-08-231-1/+1
| | | | | | | - Fix emoji not being replaced in issue title change text - Make the image attributes consistent, add alt, remove align Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Kanban board (#8346)Lanre Adelowo2020-08-161-0/+99
| | | | | | | | | | | | | Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: jaqra <48099350+jaqra@users.noreply.github.com> Co-authored-by: Kerry <flatline-studios@users.noreply.github.com> Co-authored-by: Jaqra <jaqra@hotmail.com> Co-authored-by: Kyle Evans <kevans91@users.noreply.github.com> Co-authored-by: Tsakiridis Ilias <TsakiDev@users.noreply.github.com> Co-authored-by: Ilias Tsakiridis <ilias.tsakiridis@outlook.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Render the git graph on the server (#12333)zeripath2020-08-061-564/+77
| | | | | | | | | | | | | Rendering the git graph on the server means that we can properly track flows and switch from the Canvas implementation to a SVG implementation. * This implementation provides a 16 limited color selection * The uniqued color numbers are also provided * And there is also a monochrome version *In addition is a hover highlight that allows users to highlight commits on the same flow. Closes #12209 Signed-off-by: Andrew Thornton art27@cantab.net Co-authored-by: silverwind <me@silverwind.io>
* Move jquery-minicolors to npm/webpack (#12305)silverwind2020-07-291-0/+10
| | | | | | | | | | | | | | | | | | | | * Move jquery-minicolors to npm/webpack - Unvendor and add as npm dependency - Removed unneeded backend variable - Fixed existing bug where picker would previously initizalize to the same green color when editing a label. There was probably a version bump because the previous version was over 3 years old but it seems to be compatible. * use file-loader * trailing comma and comment update * misc tweaks Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Direct SVG rendering (#12157)silverwind2020-07-121-1/+1
| | | | | | | | | | | | Introduce 'make svg' which calls a node script that compiles svg files to `public/img/svg`. These files are vendored to not create a dependency on Node for the backend build. On the frontend side, configure webpack using `raw-loader` so SVGs can be imported as string. Also moved our existing SVGs to web_src/svg for consistency. Fixes: https://github.com/go-gitea/gitea/issues/11618
* Rewrite GitGraph.js (#12137)zeripath2020-07-051-4/+559
| | | | | | | | | | | | | | | | | | | The current vendored gitgraph.js is no longer maintained and is difficult to understand, fix and maintain. This PR completely rewrites its logic - hopefully in a clearer fashion and easier to maintain. It also includes @silverwind's improvements of coloring the commit dots and preventing the flash of incorrect content. Further changes to contemplate in future will be abstracting out of the flows to an object, storing the involved commit references on the flows etc. However, this is probably a required step for this. Replaces #12131 Fixes #11981 (part 3) Signed-off-by: Andrew Thornton <art27@cantab.net>
* Re-fix #12095 again (#12138)zeripath2020-07-052-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unfortunately some of the suggested changes to #12095 introduced bugs which due to caching behaviour of sharedworkers were not caught on simple tests. These are as follows: * Changing from simple for loop to use includes here: ```js register(port) { if (!this.clients.includes(port)) return; this.clients.push(port); port.postMessage({ type: 'status', message: `registered to ${this.url}`, }); } ``` The additional `!` prevents any clients from being added and should read: ```js if (this.clients.includes(port)) return; ``` * Dropping the use of jQuery `$(...)` selection and using DOM `querySelector` here: ```js async function receiveUpdateCount(event) { try { const data = JSON.parse(event.data); const notificationCount = document.querySelector('.notification_count'); if (data.Count > 0) { notificationCount.classList.remove('hidden'); } else { notificationCount.classList.add('hidden'); } notificationCount.text() = `${data.Count}`; await updateNotificationTable(); } catch (error) { console.error(error, event); } } ``` Requires that `notificationCount.text()` be changed to use `textContent` instead. Signed-off-by: Andrew Thornton <art27@cantab.net>
* Bugfix for shared event source (#12129)zeripath2020-07-042-17/+7
| | | | | | | | For some reason our eslint configuration is not working correctly and a bug has become apparent when trying to backport this to 1.12. Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Move EventSource to SharedWorker (#12095)zeripath2020-07-032-29/+208
| | | | | | | | | | | | | Move EventSource to use a SharedWorker. This prevents issues with HTTP/1.1 open browser connections from preventing gitea from opening multiple tabs. Also allow setting EVENT_SOURCE_UPDATE_TIME to disable EventSource updating Fix #11978 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Server-side syntax highlighting for all code (#12047)mrsdizzie2020-07-012-31/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Server-side syntax hilighting for all code This PR does a few things: * Remove all traces of highlight.js * Use chroma library to provide fast syntax hilighting directly on the server * Provide syntax hilighting for diffs * Re-style both unified and split diffs views * Add custom syntax hilighting styling for both regular and arc-green Fixes #7729 Fixes #10157 Fixes #11825 Fixes #7728 Fixes #3872 Fixes #3682 And perhaps gets closer to #9553 * fix line marker * fix repo search * Fix single line select * properly load settings * npm uninstall highlight.js * review suggestion * code review * forgot to call function * fix test * Apply suggestions from code review suggestions from @silverwind thanks Co-authored-by: silverwind <me@silverwind.io> * code review * copy/paste error * Use const for highlight size limit * Update web_src/less/_repository.less Co-authored-by: Lauris BH <lauris@nix.lv> * update size limit to 1MB and other styling tweaks * fix highlighting for certain diff sections * fix test * add worker back as suggested Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Lauris BH <lauris@nix.lv>
* [UI] Sortable Tables Header By Click (#7980)65432020-06-241-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | * [UI] Sortable Tables Header By Click * get rid of padding above header * restart CI * fix lint * convert getArrow JS to SortArrow go func * addopt SortArrow funct * suggestions from @silverwind - tablesort.js Co-authored-by: silverwind <me@silverwind.io> * Update web_src/js/features/tablesort.js Co-authored-by: silverwind <me@silverwind.io> * Update web_src/js/features/tablesort.js Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: silverwind <me@silverwind.io>
* Replace jquery-datetimepicker with native date input (#11684)silverwind2020-06-101-8/+0
| | | | | | | | | | | | This removes the jQuery plugin as well as the associated config options. Native input[type=date] does not require a language attribute as it is localized by default, except for the placeholder attribute for which I currently piggy-back the repo.issues.due_date_form localization option. Implementation should pretty much match GH. Of note is that Safari does not provide a UI for this input type, but I don't think providing one is neccessary and GH did not bother either. Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* rework eslint config (#11615)silverwind2020-06-093-12/+11
| | | | | | | | | | | | | | | | | | | | | | | | * rework eslint config - use explicit config that only enables rules - upgrade eslint to 7.1.0 - add new plugins with selected rules enabled - fix discovered issues, remove global wipPrefixes * remove if * undo template change * add disabled rules as well for easier config updating * add missing disabled rule * update eslint and plugins * fix new violation * remove deprecated rules Co-authored-by: Lauris BH <lauris@nix.lv>
* export monaco editor on window.codeEditors (#11739)silverwind2020-06-031-0/+8
| | | | | Fixes: https://github.com/go-gitea/gitea/issues/10409 Co-authored-by: Lauris BH <lauris@nix.lv>
* Fix serviceworker output file and misc improvements (#11562)silverwind2020-05-241-14/+24
| | | | | | | | | | | | | | * Fix serviceworker output file and misc improvements - Fix output file location for production build - Cache more asset types: fonts and worker variants - Parallelize a few tasks during initalization - Only invalidate caches starting with our prefix - Remove public/serviceworker.js before building - Remove font preloads, they cause strange cors issues - Misc eslint config adjustments * remove webpack output files on watch-frontend
* Close EventSource before unloading the page (#11539)silverwind2020-05-221-0/+3
| | | | Should eliminate a error in the Firefox console regarding the connection being interrupted while the page was loading.
* Move serviceworker to workbox and fix SSE interference (#11538)silverwind2020-05-211-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Move serviceworker to workbox and fix SSE interference Instead of statically hardcoding every frontend asset, this uses a type-based approach to cache all js,css and manifest.json requests. This also fixes the issue that the service worker was interfering with EventSource because it was unconditionally handling all requests which this new implementation doesn't. Fixes: https://github.com/go-gitea/gitea/issues/11092 Fixes: https://github.com/go-gitea/gitea/issues/7372 * rethrow error instead of logging * await .register * Revert "rethrow error instead of logging" This reverts commit 043162ba1f18b98a4bf9635959fd28d16e839fc5. * improve comment * remove JSRenderer * add version-based cache invalidation * refactor * more refactor * remove comment * rename item to fit cache name Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
* Move tributejs to npm/webpack (#11497)silverwind2020-05-201-51/+67
| | | | | | | | | | | | | | | | | | | | | | | | | * Move tributejs to npm/webpack - Move vendored bundle to npm and webpack - Rewrote initialization to single function - Restyled it (made it a bit smaller) - Fixed it for arc-green * fix mention * also include emoji on #content * Update web_src/less/_tribute.less Co-authored-by: mrsdizzie <info@mrsdizzie.com> * rewrite to only use one instance of Tribute * refactor * fix copy/paste error Co-authored-by: mrsdizzie <info@mrsdizzie.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Switch code editor to Monaco (#11366)silverwind2020-05-141-0/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Switch code editor to Monaco This switches out CodeMirror for Monaco which is based on the same code base as VS code and should work pretty similar to it. It does add a few async chunks, totalling around 10MB to our build. It currently supports around 65 languages and in the default configuration, each language would emit one ugly [number].js chunk, so I opted to combine them all into a single file for now. CodeMirror is still being used under the hood by SimpleMDE so it can not be removed yet. * inline editorconfig, fix diff, use for markdown, remove more dead code * refactors, remove jquery usage * use tab_width * fix intellisense * rename function for clarity * misc tweaks, enable webpack progress display * only use --progress on dev build * remove useless borders in arc-green * fix typo * remove obsolete comment * small refactor * fix file creation and various refactors * unset useTabStops too when no editorconfig * small refactor * disable webpack's [big] warnings * remove useless await * fix dark theme check * rename chunk to 'monaco' * add to .gitignore and delete webpack dest before build * increase editor height * support more editorconfig properties * remove empty element filter * rename Co-authored-by: John Olheiser <john.olheiser@gmail.com>
* Add EventSource support (#11235)zeripath2020-05-071-11/+48
| | | | | | If the browser supports EventSource switch to use this instead of polling notifications. Signed-off-by: Andrew Thornton art27@cantab.net
* Support unicode emojis and remove emojify.js (#11032)mrsdizzie2020-04-283-2/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Use AJAX for notifications table (#10961)zeripath2020-04-241-0/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Use AJAX for notifications table Signed-off-by: Andrew Thornton <art27@cantab.net> * move to separate js Signed-off-by: Andrew Thornton <art27@cantab.net> * placate golangci-lint Signed-off-by: Andrew Thornton <art27@cantab.net> * Add autoupdating notification count Signed-off-by: Andrew Thornton <art27@cantab.net> * Fix wipeall Signed-off-by: Andrew Thornton <art27@cantab.net> * placate tests Signed-off-by: Andrew Thornton <art27@cantab.net> * Try hidden Signed-off-by: Andrew Thornton <art27@cantab.net> * Try hide and hidden Signed-off-by: Andrew Thornton <art27@cantab.net> * More auto-update improvements Only run checker on pages that have a count Change starting checker to 10s with a back-off to 60s if there is no change Signed-off-by: Andrew Thornton <art27@cantab.net> * string comparison! Signed-off-by: Andrew Thornton <art27@cantab.net> * as per @silverwind Signed-off-by: Andrew Thornton <art27@cantab.net> * add configurability as per @6543 Signed-off-by: Andrew Thornton <art27@cantab.net> * Add documentation as per @6543 Signed-off-by: Andrew Thornton <art27@cantab.net> * Use CSRF header not query Signed-off-by: Andrew Thornton <art27@cantab.net> * Further JS improvements Fix @etzelia update notification table request Fix @silverwind comments Co-Authored-By: silverwind <me@silverwind.io> Signed-off-by: Andrew Thornton <art27@cantab.net> * Simplify the notification count fns Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: silverwind <me@silverwind.io>
* Move syntax highlighting to web worker (#11017)silverwind2020-04-132-8/+27
| | | | | | | | | This should eliminate page freezes when loading big files/diff. `highlightBlock` is needed to preserve existing nodes when highlighting and for that, highlight.js needs access to the DOM API so I added a DOM implementation to make it work, which adds around 300kB to the output file size of the lazy-loaded `highlight.js`. Co-authored-by: Lauris BH <lauris@nix.lv>
* Migrate ActivityHeatmap to Vue SFC (#10953)Gary Kim2020-04-061-92/+4
| | | | | | | | | | | | | | | * Migrate ActivityHeatmap to Vue SFC Signed-off-by: Gary Kim <gary@garykim.dev> * Readd vue compiler alias Signed-off-by: Gary Kim <gary@garykim.dev> * Remove unneeded use of v-html Signed-off-by: Gary Kim <gary@garykim.dev> Co-authored-by: zeripath <art27@cantab.net>
* move jquery-datetimepicker to npm/webpack (#10713)silverwind2020-03-171-0/+8
| | | | | | | | | - 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>
* Misc JS linting and naming tweaks (#10652)silverwind2020-03-115-9/+9
| | | | | | | | - lowercase all js filenames except Vue components - enable new lint rules, mostly focused on shorter code - autofix new lint violations - apply misc transformations indexOf -> includes and onevent-> addEventListener Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
* Move dropzone.js to npm/webpack (#10645)silverwind2020-03-071-0/+9
| | | | - 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-0/+98
| | | | | | | | | | | | - 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
* SVG Octicon fixes (#10237)John Olheiser2020-02-111-11/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * SVG fixes Signed-off-by: jolheiser <john.olheiser@gmail.com> * Colorize span->svg only Signed-off-by: jolheiser <john.olheiser@gmail.com> * @silverwind suggestions Signed-off-by: jolheiser <john.olheiser@gmail.com> * Alphabetical Signed-off-by: jolheiser <john.olheiser@gmail.com> * Convert suburl and staticPrefix to window.config Signed-off-by: jolheiser <john.olheiser@gmail.com> * De-structure Signed-off-by: jolheiser <john.olheiser@gmail.com> Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
* Allow emoji on popup label (#10166)jaqra2020-02-081-1/+2
| | | | | | | | | | | | * allow emoji on popup label * Make emojify work * Remove unnecessary class Co-Authored-By: silverwind <me@silverwind.io> Co-authored-by: silverwind <me@silverwind.io>
* move clipboard.js to npm/webpack (#10183)silverwind2020-02-081-0/+23
| | | | | | | | - 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>
* Reorganize frontend files and tooling (#10168)silverwind2020-02-071-0/+13
| | | | | | | | | | | | - move "vendor" files to js/vendor and less/vendor - move swagger to js/standalone (meant for standalone pages) - move gitgraph to features and streamline its loading - add linting configs to webpack dependencies in make - set ignored files for eslint/stylelint directly in their configs Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
* move highlight.js to npm/webpack (#10011)silverwind2020-01-281-0/+12
| | | | | | | | | | - 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>
* Issue/PR Context Popups (#9822)John Olheiser2020-01-191-0/+66
* Add data-index attribute to issue anchors Signed-off-by: jolheiser <john.olheiser@gmail.com> * Init JS Signed-off-by: jolheiser <john.olheiser@gmail.com> * Add required data to anchor Signed-off-by: jolheiser <john.olheiser@gmail.com> * Finish popup Signed-off-by: jolheiser <john.olheiser@gmail.com> * Revert changes to html.go Signed-off-by: jolheiser <john.olheiser@gmail.com> * Better octicon contexts Signed-off-by: jolheiser <john.olheiser@gmail.com> * Split out popup function for re-use Signed-off-by: jolheiser <john.olheiser@gmail.com> * Style changes, test fixes, and cross-reference support Signed-off-by: jolheiser <john.olheiser@gmail.com> * Prefer em to px Signed-off-by: jolheiser <john.olheiser@gmail.com> * Move label margin to base CSS Signed-off-by: jolheiser <john.olheiser@gmail.com> * Move JS to separate file. Signed-off-by: jolheiser <john.olheiser@gmail.com> * Move JS to features and fix module Signed-off-by: jolheiser <john.olheiser@gmail.com> * Remove query-string and hash Co-Authored-By: silverwind <me@silverwind.io> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: zeripath <art27@cantab.net>