-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: spellcheck in the description texteditor #2027
base: main
Are you sure you want to change the base?
Changes from all commits
20326f6
9105f9b
fc05f9a
b64316f
bee95e1
9006e1a
9f85271
5b3e033
fac2006
75ab349
5e513f5
9acdb49
df68c19
d892439
552be51
a26d253
ab6b067
fd20647
b878981
179da04
378bb75
2c6f6fc
767b494
4266c09
91355ec
501ab16
766f6f8
f04ae24
e97b0ac
2e27ab2
d6945c4
7bee5c7
0df2fff
5f3ce46
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# frozen_string_literal: true | ||
|
||
module Chemotion | ||
class DictionaryAPI < Grape::API | ||
resource :dictionary do | ||
desc "amend custom dictionary" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. |
||
namespace :amend do | ||
params do | ||
requires :new_word, type: String | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Layout/IndentationWidth: Use 2 (not 4) spaces for indentation. |
||
end | ||
get do | ||
file_path = "public/typojs/custom/custom.dic" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Layout/SpaceAroundOperators: Operator There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Layout/ExtraSpacing: Unnecessary spacing detected. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. |
||
f = File.open(file_path, "a+") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. |
||
submitted_words = [] | ||
f.each {|dictionary_word| submitted_words.append(dictionary_word)} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style/MapIntoArray: Use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Layout/SpaceInsideBlockBraces: Space between { and | missing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Layout/SpaceInsideBlockBraces: Space missing inside }. |
||
unless submitted_words.include?("#{params[:new_word]}\n") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style/IfUnlessModifier: Favor modifier |
||
f.write( "#{params[:new_word]}\n") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Layout/SpaceInsideParens: Space inside parentheses detected. |
||
end | ||
f.close | ||
end | ||
end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Layout/BlockAlignment: |
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Layout/TrailingWhitespace: Trailing whitespace detected. |
||
namespace :remove do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Layout/IndentationConsistency: Inconsistent indentation detected. |
||
desc "remove last entry" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. |
||
params do | ||
requires :old_word, type: String | ||
end | ||
get do | ||
file_path = "public/typojs/custom/custom.dic" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. |
||
last_line = 0 | ||
file = File.open(file_path, "r+") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. |
||
file.each {last_line = file.pos unless file.eof?} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Layout/SpaceInsideBlockBraces: Space missing inside {. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Layout/SpaceInsideBlockBraces: Space missing inside }. |
||
file.seek(last_line, IO::SEEK_SET) | ||
file.truncate(file.pos) | ||
file.close | ||
end | ||
end | ||
|
||
namespace :save do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Layout/IndentationConsistency: Inconsistent indentation detected. |
||
desc "admin save" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. |
||
params do | ||
requires :new_dic, type: String | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Layout/IndentationWidth: Use 2 (not 1) spaces for indentation. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Layout/ExtraSpacing: Unnecessary spacing detected. |
||
end | ||
get do | ||
file_path = "public/typojs/custom/custom.dic" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. |
||
file = File.open(file_path, "w+") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. |
||
file.write(params[:new_dic]) | ||
file.close | ||
end | ||
end | ||
|
||
namespace :load do | ||
desc "loadBatchDescription" | ||
params do | ||
# requires :new_word, type: String | ||
end | ||
get do | ||
file_path = "public/published_reaction_description_290824.xlsx" | ||
f = File.open(file_path, "r") | ||
# submitted_words = [] | ||
end | ||
end | ||
end | ||
end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Layout/EndAlignment: |
||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
.customPopover { | ||
position: relative; | ||
// text-align: center; | ||
padding-left: 0; | ||
// width: 50%; | ||
margin: 0 auto; | ||
// background: linear-gradient(90deg, rgba(2,0,36,1) 0%, rgba(9,9,121,1) 35%, rgba(0,212,255,1) 100%); | ||
background-color: '#EEE'; | ||
box-shadow: '0 5px 10px rgba(0, 0, 0, 0.2)'; | ||
border: '1px solid #CCC'; | ||
border-radius: 3; | ||
width: 500; | ||
float:left; | ||
|
||
|
||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/IndentationWidth: Use 2 (not 4) spaces for indentation.