mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
set naming convention for editor vars
This commit is contained in:
parent
e93e2f31a0
commit
9975daca5c
2 changed files with 23 additions and 7 deletions
16
migrations/129_rename_editor_settings.rb
Normal file
16
migrations/129_rename_editor_settings.rb
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
Sequel.migration do
|
||||||
|
up {
|
||||||
|
DB.rename_column :sites, :autocomplete_enabled, :editor_autocomplete_enabled
|
||||||
|
DB.rename_column :sites, :keyboard_mode, :editor_keyboard_mode
|
||||||
|
DB.rename_column :sites, :tab_width, :editor_tab_width
|
||||||
|
DB.drop_column :sites, :editor_keyboard_mode
|
||||||
|
DB.add_column :sites, :editor_keyboard_mode, String, size: 10
|
||||||
|
}
|
||||||
|
|
||||||
|
down {
|
||||||
|
DB.rename_column :sites, :editor_autocomplete_enabled, :autocomplete_enabled
|
||||||
|
DB.rename_column :sites, :editor_tab_width, :tab_width
|
||||||
|
DB.drop_column :sites, :editor_keyboard_mode
|
||||||
|
DB.add_column :sites, :keyboard_mode, :int, default: 0
|
||||||
|
}
|
||||||
|
end
|
|
@ -173,10 +173,10 @@
|
||||||
<p>
|
<p>
|
||||||
Keyboard Mode:
|
Keyboard Mode:
|
||||||
<select name="editor_keyboard_mode">
|
<select name="editor_keyboard_mode">
|
||||||
<option value="" <% if current_site.owner.editor_keyboard_mode == 0 %>selected<% end %>>Default</option>
|
<option value="" <% if current_site.owner.editor_keyboard_mode.blank? %>selected<% end %>>Default</option>
|
||||||
<option value="vim" <% if current_site.owner.editor_keyboard_mode == 1 %>selected<% end %>>Vim</option>
|
<option value="vim" <% if current_site.owner.editor_keyboard_mode == 'vim' %>selected<% end %>>Vim</option>
|
||||||
<option value="emacs" <% if current_site.owner.editor_keyboard_mode == 2 %>selected<% end %>>Emacs</option>
|
<option value="emacs" <% if current_site.owner.editor_keyboard_mode == 'emacs' %>selected<% end %>>Emacs</option>
|
||||||
<option value="vscode" <% if current_site.owner.editor_keyboard_mode == 3 %>selected<% end %>>VSCode</option>
|
<option value="vscode" <% if current_site.owner.editor_keyboard_mode == 'vscode' %>selected<% end %>>VSCode</option>
|
||||||
</select>
|
</select>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -294,11 +294,11 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
enableSnippets: true,
|
enableSnippets: true,
|
||||||
})
|
})
|
||||||
<% if current_site.owner.editor_keyboard_mode == 1%>
|
<% if current_site.owner.editor_keyboard_mode == 'vim' %>
|
||||||
editor.setKeyboardHandler("ace/keyboard/vim");
|
editor.setKeyboardHandler("ace/keyboard/vim");
|
||||||
<% elsif current_site.owner.editor_keyboard_mode == 2%>
|
<% elsif current_site.owner.editor_keyboard_mode == 'emacs' %>
|
||||||
editor.setKeyboardHandler("ace/keyboard/emacs");
|
editor.setKeyboardHandler("ace/keyboard/emacs");
|
||||||
<% elsif current_site.owner.editor_keyboard_mode == 3%>
|
<% elsif current_site.owner.editor_keyboard_mode == 'vscode' %>
|
||||||
editor.setKeyboardHandler("ace/keyboard/vscode");
|
editor.setKeyboardHandler("ace/keyboard/vscode");
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue