Skip to content

Commit 637d434

Browse files
committed
Add OCA.Files.Settings for Files Settings
Signed-off-by: Gary Kim <[email protected]>
1 parent 9ec5f1b commit 637d434

File tree

13 files changed

+279
-21
lines changed

13 files changed

+279
-21
lines changed

apps/files/css/files.scss

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,9 @@
33
* @copyright Copyright (c) 2019, Fabian Dreßler <[email protected]>
44
*
55
* This file is licensed under the Affero General Public License version 3 or later.
6-
* See the COPYING-README file.
6+
* See the COPYING-README file.
77
*/
88

9-
/* SETTINGS */
10-
#files-setting-showhidden {
11-
padding-bottom: 8px;
12-
}
13-
149
/* FILE MENU */
1510
.actions {
1611
padding: 5px;

apps/files/js/dist/files-app-settings.js

Lines changed: 75 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/files/js/dist/files-app-settings.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/files/js/dist/personal-settings.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/files/js/dist/personal-settings.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/files/js/dist/sidebar.js

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/files/js/dist/sidebar.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<!--
2+
- @copyright Copyright (c) 2019 Gary Kim <[email protected]>
3+
-
4+
- @author Gary Kim <[email protected]>
5+
-
6+
- @license GNU AGPL version 3 or any later version
7+
-
8+
- This program is free software: you can redistribute it and/or modify
9+
- it under the terms of the GNU Affero General Public License as
10+
- published by the Free Software Foundation, either version 3 of the
11+
- License, or (at your option) any later version.
12+
-
13+
- This program is distributed in the hope that it will be useful,
14+
- but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
- GNU Affero General Public License for more details.
17+
-
18+
- You should have received a copy of the GNU Affero General Public License
19+
- along with this program. If not, see <http://www.gnu.org/licenses/>.
20+
-
21+
-->
22+
<template>
23+
<div id="files-app-extra-settings">
24+
<template v-for="setting in settings">
25+
<component
26+
:is="setting.component"
27+
:key="setting.name"
28+
:component="setting.component"
29+
:name="setting.name" />
30+
</template>
31+
</div>
32+
</template>
33+
34+
<script>
35+
export default {
36+
name: 'Settings',
37+
data() {
38+
return {
39+
settings: OCA.Files.Settings.settings,
40+
}
41+
},
42+
}
43+
</script>
44+
45+
<style lang="scss" scoped>
46+
#files-app-extra-settings {
47+
padding-bottom: 8px;
48+
}
49+
</style>
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/**
2+
* @copyright Copyright (c) 2019 Gary Kim <[email protected]>
3+
* @copyright Copyright (c) 2019 John Molakvoæ <[email protected]>
4+
*
5+
* @author Gary Kim <[email protected]>
6+
*
7+
* @license GNU AGPL version 3 or any later version
8+
*
9+
* This program is free software: you can redistribute it and/or modify
10+
* it under the terms of the GNU Affero General Public License as
11+
* published by the Free Software Foundation, either version 3 of the
12+
* License, or (at your option) any later version.
13+
*
14+
* This program is distributed in the hope that it will be useful,
15+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
* GNU Affero General Public License for more details.
18+
*
19+
* You should have received a copy of the GNU Affero General Public License
20+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
21+
*
22+
*/
23+
24+
import Vue from 'vue'
25+
import Settings from './services/Settings'
26+
import SettingsView from './components/Settings'
27+
import Setting from './models/Setting'
28+
29+
Vue.prototype.t = t
30+
31+
window.addEventListener('DOMContentLoaded', () => {
32+
// Init Files App Settings Service
33+
if (!window.OCA.Files) {
34+
window.OCA.Files = {}
35+
}
36+
Object.assign(window.OCA.Files, { Settings: new Settings() })
37+
Object.assign(window.OCA.Files.Settings, { Setting })
38+
39+
// Init Vue app
40+
new (Vue.extend(SettingsView))().$mount('#files-app-settings')
41+
})

apps/files/src/models/Setting.js

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/**
2+
* @copyright Copyright (c) 2019 Gary Kim <[email protected]>
3+
* @copyright Copyright (c) 2019 John Molakvoæ <[email protected]>
4+
*
5+
* @author Gary Kim <[email protected]>
6+
*
7+
* @license GNU AGPL version 3 or any later version
8+
*
9+
* This program is free software: you can redistribute it and/or modify
10+
* it under the terms of the GNU Affero General Public License as
11+
* published by the Free Software Foundation, either version 3 of the
12+
* License, or (at your option) any later version.
13+
*
14+
* This program is distributed in the hope that it will be useful,
15+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
* GNU Affero General Public License for more details.
18+
*
19+
* You should have received a copy of the GNU Affero General Public License
20+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
21+
*
22+
*/
23+
24+
export default class Setting {
25+
26+
#component
27+
#name
28+
29+
/**
30+
* Create a new files app setting
31+
*
32+
* @param {string} name the name of this setting
33+
* @param {Object} component the vue component
34+
*/
35+
constructor(name, component) {
36+
this.#name = name
37+
this.#component = component
38+
}
39+
40+
get name() {
41+
return this.#name
42+
}
43+
44+
get component() {
45+
return this.#component
46+
}
47+
48+
}

0 commit comments

Comments
 (0)