Skip to content

Commit

Permalink
Started upgrading to vue3
Browse files Browse the repository at this point in the history
  • Loading branch information
ishubin committed Jan 16, 2025
1 parent 20b9521 commit a81b773
Show file tree
Hide file tree
Showing 37 changed files with 916 additions and 1,862 deletions.
1,874 changes: 559 additions & 1,315 deletions package-lock.json

Large diffs are not rendered by default.

19 changes: 8 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,17 @@
"@electron-forge/maker-squirrel": "^6.0.1",
"@electron-forge/maker-zip": "^6.0.1",
"@electron-forge/plugin-webpack": "^6.0.1",
"@johmun/vue-tags-input": "^1.5.10",
"@sipec/vue3-tags-input": "^3.0.4",
"@vercel/webpack-asset-relocator-loader": "^1.7.3",
"@vue/test-utils": "^1.0.0-beta.29",
"axios": "^0.22.0",
"babel-loader": "^8.2.2",
"bufferutil": "^4.0.9",
"codemirror": "^6.0.1",
"codemirror-lang-schemioscript": "^0.1.1",
"copy-webpack-plugin": "^11.0.0",
"css-loader": "^6.7.1",
"electron": "21.2.3",
"electron-icon-maker": "^0.0.5",
"esm": "^3.2.25",
"expect": "^27.4.2",
"file-loader": "^0.11.2",
"gifenc": "^1.0.3",
Expand All @@ -72,15 +71,13 @@
"shortid": "^2.2.16",
"style-loader": "^3.3.1",
"thememirror": "^2.0.1",
"tiptap": "^1.22.3",
"tiptap-extensions": "^1.22.3",
"vue": "^2.6.10",
"tiny-emitter": "^2.1.0",
"utf-8-validate": "^5.0.10",
"vue": "^3.5.13",
"vue-color": "2.8.1",
"vue-gtag": "^1.16.1",
"vue-loader": "^15.9.8",
"vue-router": "^2.7.0",
"vue-template-compiler": "^2.6.10",
"vuex": "^3.5.1",
"vue-loader": "^17.4.2",
"vue-router": "^4.5.0",
"vuex": "^4.1.0",
"webpack": "^5.64.0",
"webpack-cli": "^4.9.1",
"webpack-dev-server": "^4.5.0"
Expand Down
3 changes: 0 additions & 3 deletions src/electron/renderer/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,9 @@
import Vue from 'vue';
import ElectronApp from './ElectronApp.vue';
import store from '../../ui/store/Store.js';
import { applyVueFilters } from '../../ui/vue.filters';
import '../static/electron.css';
import { electronAPICLient } from './electronAPIClient';

applyVueFilters(Vue);

store.dispatch('setApiClient', electronAPICLient());
store.dispatch('setAssetsPath', 'media://assets');

Expand Down
17 changes: 2 additions & 15 deletions src/ui/app/view/FolderView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
</router-link>
</td>
<td class="time-column">
<span v-if="entry.modifiedTime">{{entry.modifiedTime | formatDateTime }}</span>
<span v-if="entry.modifiedTime">{{entry.modifiedTime}}</span>
</td>
<td class="operation-column">
<menu-dropdown v-if="entry.name !== '..' && !viewOnly" name="" iconClass="fas fa-ellipsis-v" :options="entry.menuOptions"
Expand Down Expand Up @@ -168,20 +168,7 @@ export default {
},

data() {
let path = this.$route.fullPath.trim();
if (path === '/') {
path = '';
}
const routePrefix = this.$store.state.routePrefix || '';

if (path.startsWith(routePrefix)) {
path = path.substring(routePrefix.length);
}

if (path.indexOf('/f/') === 0) {
path = decodeURI(path.substring(3));
}

const path = this.$route.params.folders ? this.$route.params.folders.join('/') : '';

return {
path: path,
Expand Down
6 changes: 3 additions & 3 deletions src/ui/app/view/SearchView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
</router-link>
</td>
<td class="time-column">
<span v-if="entry.modifiedTime">{{entry.modifiedTime | formatDateTime }}</span>
<span v-if="entry.modifiedTime">{{entry.modifiedTime}}</span>
</td>
</tr>
</tbody>
Expand Down Expand Up @@ -87,8 +87,8 @@ export default {
},
data() {
const query = this.$route.query.q;
const page = toPageNumber(this.$route.query.page);
const query = this.$route.query.q || '';
const page = toPageNumber(this.$route.query.page || 1);
return {
query,
page,
Expand Down
18 changes: 10 additions & 8 deletions src/ui/components/Pagination.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@
<ul v-if="pages.length > 1" class="pagination">
<li>
<span v-if="currentPage > 1">
<router-link v-if="useRouter" :to="{path: urlForPage(currentPage - 1)}"><i class="fas fa-chevron-circle-left"></i></router-link>
<router-link v-if="useRouter" :to="urlForPage(pageUrlPrefix, currentPage - 1)"><i class="fas fa-chevron-circle-left"></i></router-link>
<a v-else @click="onNonRoutablePageClicked($event, currentPage - 1)" href="#"><i class="fas fa-chevron-circle-left"></i></a>
</span>
<span v-else><i class="fas fa-chevron-circle-left"></i></span>
</li>

<li v-for="page in pages">
<span v-if="page.active">
<router-link v-if="useRouter" :to="{path: urlForPage(page.page)}">{{page.page}}</router-link>
<router-link v-if="useRouter" :to="page.url">{{page.page}}</router-link>
<a v-else @click="onNonRoutablePageClicked($event, page.page)" :class="{'current': currentPage === page.page}" href="#">{{page.page}}</a>
</span>
<span v-else>{{page.page}}</span>
</li>

<li>
<span v-if="currentPage < totalPages">
<router-link v-if="useRouter" :to="{path: urlForPage(currentPage + 1)}"><i class="fas fa-chevron-circle-right"></i></router-link>
<router-link v-if="useRouter" :to="urlForPage(pageUrlPrefix, currentPage + 1)"><i class="fas fa-chevron-circle-right"></i></router-link>
<a v-else @click="onNonRoutablePageClicked($event, currentPage + 1)" href="#"><i class="fas fa-chevron-circle-right"></i></a>
</span>
<span v-else><i class="fas fa-chevron-circle-right"></i></span>
Expand Down Expand Up @@ -53,15 +53,15 @@ export default {
}

return {
pages: this.buildPages(this.currentPage, this.totalPages),
pages: this.buildPages(pageUrlPrefix, this.currentPage, this.totalPages),
pageUrlPrefix
};
},

methods: {
urlForPage(page) {
if (this.urlPrefix) {
return this.pageUrlPrefix + page;
urlForPage(pageUrlPrefix, page) {
if (pageUrlPrefix) {
return pageUrlPrefix + page;
} else {
return '#';
}
Expand All @@ -74,7 +74,7 @@ export default {
return false;
},

buildPages(currentPage, totalPages) {
buildPages(pageUrlPrefix, currentPage, totalPages) {
currentPage = Math.min(currentPage, totalPages);
let pages = [];
let maxSideRange = 2;
Expand All @@ -95,6 +95,7 @@ export default {
if (start > 1) {
pages.push({
page: '1',
url: this.urlForPage(pageUrlPrefix, 1),
active: true
});
}
Expand All @@ -108,6 +109,7 @@ export default {
for (let page = start; page <= end; page++) {
pages.push({
page: page,
url: this.urlForPage(pageUrlPrefix, page),
active: page !== currentPage
});
}
Expand Down
Loading

0 comments on commit a81b773

Please sign in to comment.