newslash
Revisión | 3ccfe08832da4503753b27c8c3c538c6678e7b37 (tree) |
---|---|
Tiempo | 2019-06-17 17:58:24 |
Autor | ![]() |
Commiter | hylom |
editor: article editor supports media embed
@@ -181,6 +181,11 @@ sub post { | ||
181 | 181 | # TODO: media related |
182 | 182 | #$item->{mediaurl}; |
183 | 183 | #$item->{mediatype}; |
184 | + #$item->{media}; | |
185 | + | |
186 | + if ($item->{media}) { | |
187 | + $params->{media} = $item->{media}; | |
188 | + } | |
184 | 189 | |
185 | 190 | # source |
186 | 191 | if ($item->{source_id}) { |
@@ -30,6 +30,10 @@ articleEditor.init = function init () { | ||
30 | 30 | id: 0, |
31 | 31 | source_id: 0, |
32 | 32 | source_type: 0, |
33 | + | |
34 | + mediaurl: "", | |
35 | + mediatype: "", | |
36 | + media: "", | |
33 | 37 | }, |
34 | 38 | |
35 | 39 | message: "", |
@@ -82,6 +86,9 @@ articleEditor.init = function init () { | ||
82 | 86 | 'editor.dept': function watchDept(val, oldVal) { |
83 | 87 | this.item.dept = val; |
84 | 88 | }, |
89 | + 'editor.media': function watchMedia(val, oldVal) { | |
90 | + this.item.media = val; | |
91 | + }, | |
85 | 92 | 'editor.tags_string': _updateTopics, |
86 | 93 | }; |
87 | 94 |
@@ -110,6 +117,7 @@ articleEditor.init = function init () { | ||
110 | 117 | this.item.intro_text = _quoteHtml(this.editor.intro_text); |
111 | 118 | this.item.body_text = _quoteHtml(this.editor.body_text); |
112 | 119 | this.item.title = _quoteTitle(this.editor.title); |
120 | + this.item.media = _quoteTitle(this.editor.media); | |
113 | 121 | }, |
114 | 122 | startEdit: function startEdit() { |
115 | 123 | _startEdit.call(this); |
@@ -143,6 +151,8 @@ articleEditor.init = function init () { | ||
143 | 151 | this.message = ""; |
144 | 152 | this.item.title = resp.item.title; |
145 | 153 | this.item.intro_text = resp.item.intro_text; |
154 | + this.item.body_text = resp.item.body_text; | |
155 | + this.item.media = resp.item.media; | |
146 | 156 | this.item.url = this.editor.url; |
147 | 157 | this.item.primary_topic = resp.item.topic; |
148 | 158 | this.updatePrimaryTopicIconURL(); |
@@ -64,6 +64,13 @@ | ||
64 | 64 | </label> |
65 | 65 | </p> |
66 | 66 | |
67 | + <p v-if="contentType == 'story'"> | |
68 | + <label>メディア: | |
69 | + <textarea name="media" v-model="editor.media" | |
70 | + placeholder="埋め込みコンテンツなどをここに記述してください" ></textarea> | |
71 | + </label> | |
72 | + </p> | |
73 | + | |
67 | 74 | <p v-if="contentType == 'submission'"> |
68 | 75 | <label>URL(本文がない場合は必須): |
69 | 76 | <input type="text" name="url" v-model="editor.url" placeholder="重要なURLを1つ(任意)" /> |