diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2019-05-01 20:48:56 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2019-05-01 20:48:56 +0900 |
| commit | 79c49bc926ef2c91e231dde0c9132cdae338d421 (patch) | |
| tree | 2d1fea010186686d191ee94c8c188ce120bd8eb6 /src/client/app/common | |
| parent | :art: (diff) | |
| download | misskey-79c49bc926ef2c91e231dde0c9132cdae338d421.tar.gz misskey-79c49bc926ef2c91e231dde0c9132cdae338d421.tar.bz2 misskey-79c49bc926ef2c91e231dde0c9132cdae338d421.zip | |
ページのソースを見れるように
Diffstat (limited to 'src/client/app/common')
| -rw-r--r-- | src/client/app/common/views/components/page-editor/page-editor.vue | 46 | ||||
| -rw-r--r-- | src/client/app/common/views/pages/page/page.vue | 7 |
2 files changed, 32 insertions, 21 deletions
diff --git a/src/client/app/common/views/components/page-editor/page-editor.vue b/src/client/app/common/views/components/page-editor/page-editor.vue index 8b03df748b..6d07c5dc6b 100644 --- a/src/client/app/common/views/components/page-editor/page-editor.vue +++ b/src/client/app/common/views/components/page-editor/page-editor.vue @@ -36,10 +36,10 @@ </ui-select> <div class="eyeCatch"> - <ui-button v-if="eyeCatchingImageId == null" @click="setEyeCatchingImage()"><fa :icon="faPlus"/> {{ $t('set-eye-catchig-image') }}</ui-button> + <ui-button v-if="eyeCatchingImageId == null && !readonly" @click="setEyeCatchingImage()"><fa :icon="faPlus"/> {{ $t('set-eye-catchig-image') }}</ui-button> <div v-else-if="eyeCatchingImage"> <img :src="eyeCatchingImage.url" :alt="eyeCatchingImage.name"/> - <ui-button @click="removeEyeCatchingImage()"><fa :icon="faTrashAlt"/> {{ $t('remove-eye-catchig-image') }}</ui-button> + <ui-button @click="removeEyeCatchingImage()" v-if="!readonly"><fa :icon="faTrashAlt"/> {{ $t('remove-eye-catchig-image') }}</ui-button> </div> </div> </template> @@ -81,14 +81,22 @@ </template> </div> </ui-container> + + <ui-container :body-togglable="true" :expanded="false"> + <template #header><fa :icon="faCode"/> {{ $t('inspector') }}</template> + <div style="padding:0 32px 32px 32px;"> + <ui-textarea :value="JSON.stringify(content, null, 2)" readonly tall>{{ $t('content') }}</ui-textarea> + <ui-textarea :value="JSON.stringify(variables, null, 2)" readonly tall>{{ $t('variables') }}</ui-textarea> + </div> + </ui-container> </div> </template> <script lang="ts"> import Vue from 'vue'; -import i18n from '../../../../i18n'; -import { faICursor, faPlus, faMagic, faCog, faExternalLinkSquareAlt } from '@fortawesome/free-solid-svg-icons'; +import { faICursor, faPlus, faMagic, faCog, faCode, faExternalLinkSquareAlt } from '@fortawesome/free-solid-svg-icons'; import { faSave, faStickyNote, faTrashAlt } from '@fortawesome/free-regular-svg-icons'; +import i18n from '../../../../i18n'; import XVariable from './page-editor.script-block.vue'; import XBlock from './page-editor.block.vue'; import * as uuid from 'uuid'; @@ -106,7 +114,7 @@ export default Vue.extend({ props: { page: { - type: String, + type: Object, required: false }, readonly: { @@ -134,7 +142,7 @@ export default Vue.extend({ showOptions: false, moreDetails: false, url, - faPlus, faICursor, faSave, faStickyNote, faMagic, faCog, faTrashAlt, faExternalLinkSquareAlt + faPlus, faICursor, faSave, faStickyNote, faMagic, faCog, faTrashAlt, faExternalLinkSquareAlt, faCode }; }, @@ -162,21 +170,17 @@ export default Vue.extend({ }, { deep: true }); if (this.page) { - this.$root.api('pages/show', { - pageId: this.page, - }).then(page => { - this.author = page.user; - this.pageId = page.id; - this.title = page.title; - this.name = page.name; - this.currentName = page.name; - this.summary = page.summary; - this.font = page.font; - this.alignCenter = page.alignCenter; - this.content = page.content; - this.variables = page.variables; - this.eyeCatchingImageId = page.eyeCatchingImageId; - }); + this.author = this.page.user; + this.pageId = this.page.id; + this.title = this.page.title; + this.name = this.page.name; + this.currentName = this.page.name; + this.summary = this.page.summary; + this.font = this.page.font; + this.alignCenter = this.page.alignCenter; + this.content = this.page.content; + this.variables = this.page.variables; + this.eyeCatchingImageId = this.page.eyeCatchingImageId; } else { const id = uuid.v4(); this.content = [{ diff --git a/src/client/app/common/views/pages/page/page.vue b/src/client/app/common/views/pages/page/page.vue index ab19e14683..29853f95b8 100644 --- a/src/client/app/common/views/pages/page/page.vue +++ b/src/client/app/common/views/pages/page/page.vue @@ -11,6 +11,7 @@ <footer> <small>@{{ page.user.username }}</small> <router-link v-if="$store.getters.isSignedIn && $store.state.i.id === page.userId" :to="`/i/pages/edit/${page.id}`">{{ $t('edit-this-page') }}</router-link> + <router-link :to="`./${page.name}/view-source`">{{ $t('view-source') }}</router-link> </footer> </div> </template> @@ -154,4 +155,10 @@ export default Vue.extend({ display block opacity 0.5 + > a + font-size 14px + + > a + a + margin-left 8px + </style> |