wxiaoguang
2c6cc0b8c9
Fix links for the menus in the view file page ( #22795 )
2 years ago
silverwind
c2fb27beb4
Improvements for Content Copy ( #21842 )
...
It now supports copying Markdown, SVG and Images (not in Firefox
currently because of lacking
[`ClipboardItem`](https://developer.mozilla.org/en-US/docs/Web/API/ClipboardItem )
support, but can be enabled in `about:config` and works). It will fetch
the data if in a rendered view or when it's an image.
Followup to https://github.com/go-gitea/gitea/pull/21629 .
2 years ago
silverwind
9db221780f
Ignore line anchor links with leading zeroes ( #21728 )
...
Fixes: https://github.com/go-gitea/gitea/issues/21722
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years ago
Yarden Shoham
e3a7f15791
Add "Copy" button to file view of raw text ( #21629 )
...
If a raw text file is displayed, a copy button of the text is enabled.
* Closes #12866
### Before
![image](https://user-images.githubusercontent.com/20454870/198898628-df1bcb0c-79d7-4ffb-95e4-441d77430827.png )
### After
![image](https://user-images.githubusercontent.com/20454870/199988152-ea1099ad-29e1-4765-a9ca-4c03c1737453.png )
#### Rendered files and binaries have their button disabled
![image](https://user-images.githubusercontent.com/20454870/199988408-73de6327-5e9e-462b-b2b6-8c3f5b878386.png )
![image](https://user-images.githubusercontent.com/20454870/199988563-844f8656-f48d-4929-880e-b6558c1c054a.png )
Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years ago
silverwind
1b2cd4c4e1
Replace fomantic popup module with tippy.js ( #20428 )
...
- replace fomantic popup module with tippy.js
- fix chaining and add comment
- add 100ms delay to tooltips
- stopwatch improvments, raise default maxWidth
- update web_src/js/features/common-global.js
- use type=submit instead of js
2 years ago
delvh
5ca224a789
Allow to mark files in a PR as viewed ( #19007 )
...
Users can now mark files in PRs as viewed, resulting in them not being shown again by default when they reopen the PR again.
3 years ago
Lunny Xiao
03eba32bd9
Add a new menu in file view to open blame view and fix blame view select range bug ( #19500 )
3 years ago
CommanderRoot
1ab88da0e4
Replace deprecated String.prototype.substr() with String.prototype.slice() ( #18796 )
...
String.prototype.substr() is deprecated (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr ) so we replace it with the slice() method which works similarily but isn't deprecated.
Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years ago
Jimmy Praet
9444135ff5
Fix source code line highlighting ( #18729 )
...
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
3 years ago
silverwind
19b017f398
Use explicit jQuery import, remove unused eslint globals ( #18435 )
...
- Don't rely on globals (window.$) for jQuery import
- Remove eslint globals no longer in use
3 years ago
silverwind
a159c3175f
Add new JS linter rules ( #17699 )
...
* Add new JS linter rules
Adds a few useful rules from eslint-plugin-github. Notable changes:
- Forbid dataset usage, its camel-casing behaviour makes it hard to
grep for attributes.
- Forbid .then() and .catch(), we should generally prefer await for new
code. For rare cases where they are useful, a eslint-disable-line
directive can be set.
- Add docs js to linting
* also enable github/array-foreach
* small tweak
Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
3 years ago
wxiaoguang
89beceeb9a
Fix a UI error when folding a file content in a commit view ( #17446 )
3 years ago
wxiaoguang
1a7473ff45
Split `index.js` to separate files ( #17315 )
...
* split `index.js` to separate files
* tune clipboard
* fix promise
* fix document
* remove intermediate empty file
* fix async event listener
* use `export function` instead of `export {}`, add more comments
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
3 years ago