OSDN Git Service

/submission/new: fix url handling
authorhylom <hylom@users.sourceforge.jp>
Thu, 4 Apr 2019 10:39:56 +0000 (19:39 +0900)
committerhylom <hylom@users.sourceforge.jp>
Thu, 4 Apr 2019 10:39:56 +0000 (19:39 +0900)
src/newslash_web/lib/Newslash/Web/Controller/API/Submission.pm
src/newslash_web/public/js/article-item2.js
src/newslash_web/public/js/content-editor.js

index 08ae3d7..ed40add 100644 (file)
@@ -107,9 +107,7 @@ sub post {
     if ($item->{url}) {
         my $url = Mojo::URL->new($item->{url});
         if ($url->is_abs) {
-            $params->{url} = $item->{url};
-            my $footer = $c->tt2renderer->render("system/submission/footer", {url => $item->{url}});
-            $params->{introtext} = $params->{introtext} . $footer;
+            $params->{url} = $url;
         }
         else {
             $message = "invalid_url";
index 8baa60a..45c84ae 100644 (file)
@@ -151,6 +151,7 @@ articleItem.init = function init () {
           this.message = "";
           this.previewTitle = resp.item.title;
           this.previewIntro = resp.item.intro_text;
+          this.item.url = this.editor.url;
           this.item.primary_topic = resp.item.topic;
           this.updatePrimaryTopicIconURL();
 
index a96d066..a39e22c 100644 (file)
@@ -46,6 +46,9 @@ contentEditor.run = function run(params) {
     title: function (val, oldVal) {
       this.item.title = (val.length > 0) ? this.quoteTitle(val) : "";
     },
+    url: function (val, oldVal) {
+      this.item.url = (val.length > 0) ? val : "";
+    },
   };
 
   const methods = {