Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*.rbc
.bundle
.config
.vscode
Gemfile.lock
.bundle/
log/*.log
Expand Down
20 changes: 10 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ rvm:
- 2.3.7
- 2.4.4
- 2.5.1
env:
global:
- QMAKE=/usr/lib/x86_64-linux-gnu/qt5/bin/qmake
addons:
apt:
sources:
- ubuntu-sdk-team
packages:
- libqt5webkit5-dev
- qtdeclarative5-dev
addons: # get google-chrome-stable
chrome: stable
install: # Install ChromeDriver (64bits; replace 64 with 32 for 32bits).
- wget -N https://chromedriver.storage.googleapis.com/2.43/chromedriver_linux64.zip -P ~/
- unzip ~/chromedriver_linux64.zip -d ~/
- rm ~/chromedriver_linux64.zip
- sudo mv -f ~/chromedriver /usr/local/share/
- sudo chmod +x /usr/local/share/chromedriver
- sudo ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver
before_install:
- gem update --system
- bundle install
script:
- bin/rails db:migrate
- bundle exec rubocop && xvfb-run bundle exec rspec spec
Expand Down
23 changes: 20 additions & 3 deletions app/assets/javascripts/rosetta/application.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
//= require ./vendor/vue.min
//= require ./vendor/lunr
//= require ./vendor/autosize.min

function initPhrasesList(selector, phrases) {
new Vue({
el: selector,

data: {
phrases: phrases,
query: ''
query: '',
menuOpened: false,
},

computed: {
searchIndex: function() {
var that = this;
Expand All @@ -17,14 +21,14 @@ function initPhrasesList(selector, phrases) {
this.field('text');

that.phrases.forEach(function (phrase) {
this.add(phrase)
this.add(phrase);
}, this);
});
},

filteredPhrases: function () {
if (this.query) {
var results = this.searchIndex.search(this.query);

return this.phrases.filter(function (phrase) {
return results.some(function (result) {
return result.ref === phrase.code;
Expand All @@ -34,6 +38,19 @@ function initPhrasesList(selector, phrases) {
return this.phrases;
}
}
},

updated: function () {
this.$nextTick(function () {
autosize(document.querySelectorAll('.database__field'));
});
},

methods: {
toggleNav: function() {
this.menuOpened = this.menuOpened ? false : true;
console.log('toggleNav', this.menuOpened);
}
}
});
}
6 changes: 6 additions & 0 deletions app/assets/javascripts/rosetta/vendor/autosize.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

205 changes: 0 additions & 205 deletions app/assets/stylesheets/rosetta/application.css

This file was deleted.

2 changes: 2 additions & 0 deletions app/assets/stylesheets/rosetta/application.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@import 'blocks/pharses-menu';
@import 'blocks/phrases-list';
Loading