You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

main-personal-info.js 4.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /**
  2. * @copyright 2021, Christopher Ng <chrng8@gmail.com>
  3. *
  4. * @author Christopher Ng <chrng8@gmail.com>
  5. *
  6. * @license AGPL-3.0-or-later
  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. import Vue from 'vue'
  23. import { getRequestToken } from '@nextcloud/auth'
  24. import { loadState } from '@nextcloud/initial-state'
  25. import { translate as t } from '@nextcloud/l10n'
  26. import AvatarSection from './components/PersonalInfo/AvatarSection.vue'
  27. import DetailsSection from './components/PersonalInfo/DetailsSection.vue'
  28. import DisplayNameSection from './components/PersonalInfo/DisplayNameSection.vue'
  29. import EmailSection from './components/PersonalInfo/EmailSection/EmailSection.vue'
  30. import PhoneSection from './components/PersonalInfo/PhoneSection.vue'
  31. import LocationSection from './components/PersonalInfo/LocationSection.vue'
  32. import WebsiteSection from './components/PersonalInfo/WebsiteSection.vue'
  33. import TwitterSection from './components/PersonalInfo/TwitterSection.vue'
  34. import FediverseSection from './components/PersonalInfo/FediverseSection.vue'
  35. import LanguageSection from './components/PersonalInfo/LanguageSection/LanguageSection.vue'
  36. import LocaleSection from './components/PersonalInfo/LocaleSection/LocaleSection.vue'
  37. import ProfileSection from './components/PersonalInfo/ProfileSection/ProfileSection.vue'
  38. import OrganisationSection from './components/PersonalInfo/OrganisationSection.vue'
  39. import RoleSection from './components/PersonalInfo/RoleSection.vue'
  40. import HeadlineSection from './components/PersonalInfo/HeadlineSection.vue'
  41. import BiographySection from './components/PersonalInfo/BiographySection.vue'
  42. import ProfileVisibilitySection from './components/PersonalInfo/ProfileVisibilitySection/ProfileVisibilitySection.vue'
  43. __webpack_nonce__ = btoa(getRequestToken())
  44. const profileEnabledGlobally = loadState('settings', 'profileEnabledGlobally', true)
  45. Vue.mixin({
  46. methods: {
  47. t,
  48. },
  49. })
  50. const AvatarView = Vue.extend(AvatarSection)
  51. const DetailsView = Vue.extend(DetailsSection)
  52. const DisplayNameView = Vue.extend(DisplayNameSection)
  53. const EmailView = Vue.extend(EmailSection)
  54. const PhoneView = Vue.extend(PhoneSection)
  55. const LocationView = Vue.extend(LocationSection)
  56. const WebsiteView = Vue.extend(WebsiteSection)
  57. const TwitterView = Vue.extend(TwitterSection)
  58. const FediverseView = Vue.extend(FediverseSection)
  59. const LanguageView = Vue.extend(LanguageSection)
  60. const LocaleView = Vue.extend(LocaleSection)
  61. new AvatarView().$mount('#vue-avatar-section')
  62. new DetailsView().$mount('#vue-details-section')
  63. new DisplayNameView().$mount('#vue-displayname-section')
  64. new EmailView().$mount('#vue-email-section')
  65. new PhoneView().$mount('#vue-phone-section')
  66. new LocationView().$mount('#vue-location-section')
  67. new WebsiteView().$mount('#vue-website-section')
  68. new TwitterView().$mount('#vue-twitter-section')
  69. new FediverseView().$mount('#vue-fediverse-section')
  70. new LanguageView().$mount('#vue-language-section')
  71. new LocaleView().$mount('#vue-locale-section')
  72. if (profileEnabledGlobally) {
  73. const ProfileView = Vue.extend(ProfileSection)
  74. const OrganisationView = Vue.extend(OrganisationSection)
  75. const RoleView = Vue.extend(RoleSection)
  76. const HeadlineView = Vue.extend(HeadlineSection)
  77. const BiographyView = Vue.extend(BiographySection)
  78. const ProfileVisibilityView = Vue.extend(ProfileVisibilitySection)
  79. new ProfileView().$mount('#vue-profile-section')
  80. new OrganisationView().$mount('#vue-organisation-section')
  81. new RoleView().$mount('#vue-role-section')
  82. new HeadlineView().$mount('#vue-headline-section')
  83. new BiographyView().$mount('#vue-biography-section')
  84. new ProfileVisibilityView().$mount('#vue-profile-visibility-section')
  85. }