Browse Source

调整按钮位置

visuddhinanda 4 years ago
parent
commit
b3d2449437
3 changed files with 122 additions and 115 deletions
  1. 105 105
      app/article/add_to_collect_dlg.js
  2. 9 5
      app/article/my_article.js
  3. 8 5
      app/article/my_article_edit.php

+ 105 - 105
app/article/add_to_collect_dlg.js

@@ -1,120 +1,120 @@
 function add_to_collect_dlg_init() {
-  $("[vui='collect-dlg']").each(function () {
-    $(this).css("position", "relative");
-    let html = "";
-    html +=
-      "<button class='button_add_to_collect icon_btn' title='" +
-      gLocal.gui.add_to +
-      gLocal.gui.anthology +
-      "'>";
-    html +=
-      "<svg class='icon'><use xlink:href='../studio/svg/icon.svg#add_to_anthology'></use></svg></button><div class='float_dlg' style='left:0;'></div>";
+	$("[vui='collect-dlg']").each(function () {
+		$(this).css("position", "relative");
+		let html = "";
+		html += '<span class="icon_btn_div">';
+		html += '<span class="icon_btn_tip">' + gLocal.gui.add_to + gLocal.gui.anthology + "</span>";
+		html += "<button class='button_add_to_collect icon_btn' >";
+		html += "<svg class='icon'>";
+		html += "<use xlink:href='../studio/svg/icon.svg#add_to_anthology'></use>";
+		html += "</svg>";
+		html += "</button>";
+		html += "<span class='float_dlg' style='top: 20px;' ></span>";
+		html += "</span>";
+		$(this).html(html);
+	});
 
-    $(this).html(html);
-  });
+	$(".button_add_to_collect").click(function () {
+		let html = "";
+		let article_id = $(this).parent().attr("a_id");
+		html += "<div id='add_to_collect_dlg_" + article_id + "'>";
+		html += "<div >";
+		html += "<input type='input'  placeholder='" + gLocal.gui.search + "' />";
+		html += "</div>";
+		html += "<div>";
+		html += "<div class='exist'>";
+		html += "</div>";
+		html += "<div class='others'>";
+		html += "</div>";
+		html += "<div id='add_to_collection_msg'>";
+		html += "<a href='../article/my_collect_index.php' target='_blank'>添加新的文集</a>";
+		html += "</div>";
+		html += "</div>";
+		html += "<div style='display:flex;justify-content: space-between;'>";
+		html +=
+			"<button onclick=\"article_add_to_collect_cancel('" +
+			article_id +
+			"')\">" +
+			gLocal.gui.cancel +
+			"</button>";
+		html +=
+			"<button onclick=\"article_add_to_collect_ok('" + article_id + "')\">" + gLocal.gui.finish + "</button>";
+		html += "</div>";
+		html += "</div>";
+		$(this).siblings(".float_dlg").first().html(html);
+		$(this).siblings(".float_dlg").first().show();
+		$.get(
+			"../article/list_article_in_collect.php",
+			{
+				id: article_id,
+			},
+			function (data, status) {
+				let collect_list = JSON.parse(data);
 
-  $(".button_add_to_collect").click(function () {
-    let html = "";
-    let article_id = $(this).parent().attr("a_id");
-    html += "<div id='add_to_collect_dlg_" + article_id + "'>";
-    html += "<div >";
-    html += "<input type='input'  placeholder='" + gLocal.gui.search + "' />";
-    html += "</div>";
-    html += "<div>";
-    html += "<div class='exist'>";
-    html += "</div>";
-    html += "<div class='others'>";
-    html += "</div>";
-    html += "</div>";
-    html += "<div style='display:flex;justify-content: space-evenly;'>";
-    html += "<button onclick='collect_new()'>" + gLocal.gui.new_composition + "</button>";
-    html +=
-      "<button onclick=\"article_add_to_collect_cancel('" +
-      article_id +
-      "')\">" + gLocal.gui.cancel + "</button>";
-    html +=
-      "<button onclick=\"article_add_to_collect_ok('" +
-      article_id +
-      "')\">" + gLocal.gui.finish + "</button>";
-    html += "</div>";
-    html += "</div>";
-    $(this).siblings(".float_dlg").first().html(html);
-    $(this).siblings(".float_dlg").first().show();
-    $.get(
-      "../article/list_article_in_collect.php",
-      {
-        id: article_id,
-      },
-      function (data, status) {
-        let collect_list = JSON.parse(data);
+				let id = collect_list.article_id;
+				let html_exist = "";
 
-        let id = collect_list.article_id;
-        let html_exist = "";
-        for (const iterator of collect_list.exist) {
-          html_exist +=
-            "<div><input type='checkbox' class='collect' collect_id='" +
-            iterator.id +
-            "' checked />";
-          html_exist += iterator.title;
-          html_exist += "</div>";
-        }
-        $("#add_to_collect_dlg_" + id)
-          .find(".exist")
-          .first()
-          .html(html_exist);
+				for (const iterator of collect_list.exist) {
+					html_exist +=
+						"<div><input type='checkbox' class='collect' collect_id='" + iterator.id + "' checked />";
+					html_exist += iterator.title;
+					html_exist += "</div>";
+				}
+				$("#add_to_collect_dlg_" + id)
+					.find(".exist")
+					.first()
+					.html(html_exist);
 
-        if (collect_list.others) {
-          let html_others = "";
-          for (const iterator of collect_list.others) {
-            html_others +=
-              "<div><input type='checkbox' class='collect' collect_id='" +
-              iterator.id +
-              "' />";
-            html_others += iterator.title;
-            html_others += "</div>";
-          }
-          $("#add_to_collect_dlg_" + id)
-            .find(".others")
-            .first()
-            .html(html_others);
-        }
-      }
-    );
-  });
+				if (collect_list.others) {
+					let html_others = "";
+					for (const iterator of collect_list.others) {
+						html_others +=
+							"<div><input type='checkbox' class='collect' collect_id='" + iterator.id + "' />";
+						html_others += iterator.title;
+						html_others += "</div>";
+					}
+					$("#add_to_collect_dlg_" + id)
+						.find(".others")
+						.first()
+						.html(html_others);
+				}
+			}
+		);
+	});
 }
 
 function article_add_to_collect_ok(article_id) {
-  let obj = document.querySelectorAll(".collect");
-  let collect_id = new Array();
-  for (const iterator of obj) {
-    if (iterator.checked == true) {
-      collect_id.push(iterator.getAttributeNode("collect_id").value);
-    }
-  }
-  $.post(
-    "../article/add_article_to_collect.php",
-    {
-      id: article_id,
-      title: $("#input_article_title").val(),
-      data: JSON.stringify(collect_id),
-    },
-    function (data) {
-      let result = JSON.parse(data);
-      if (result.status > 0) {
-        alert(result.message);
-      } else {
-        add_to_collect_dlg_close(result.id);
-      }
-    }
-  );
+	let obj = document.querySelectorAll(".collect");
+	let collect_id = new Array();
+	for (const iterator of obj) {
+		if (iterator.checked == true) {
+			collect_id.push(iterator.getAttributeNode("collect_id").value);
+		}
+	}
+	$.post(
+		"../article/add_article_to_collect.php",
+		{
+			id: article_id,
+			title: $("#input_article_title").val(),
+			data: JSON.stringify(collect_id),
+		},
+		function (data) {
+			let result = JSON.parse(data);
+			if (result.status > 0) {
+				alert(result.message);
+			} else {
+				add_to_collect_dlg_close(result.id);
+			}
+		}
+	);
 }
 
 function article_add_to_collect_cancel(article_id) {
-  add_to_collect_dlg_close(article_id);
+	add_to_collect_dlg_close(article_id);
 }
 
 function add_to_collect_dlg_close(article_id) {
-  $("#add_to_collect_dlg_" + article_id)
-    .parent()
-    .hide();
+	$("#add_to_collect_dlg_" + article_id)
+		.parent()
+		.hide();
 }

+ 9 - 5
app/article/my_article.js

@@ -199,10 +199,14 @@ function my_article_edit(id) {
 					html += "<div>";
 					//html += "<div id='article_collect' vui='collect-dlg' ></div>"
 					html += "<div style='display:flex;'>";
-					html += "<span style='flex:3;margin:auto;'>" + gLocal.gui.title + "</span>";
-					html += '<span id="article_title" style="flex:7;"></span></div>';
+					html += "<span style='flex:1;'>" + gLocal.gui.title + "</span>";
+					html += '<span id="article_title" style="flex:7;"></span>';
+					html += "</div>";
 					html += "<div id='channal_selector' form_name='channal' style='display:none;'></div>";
-					html += "<div id='aritcle_status' style='display: flex; '></div>";
+					html += "<div style='display:flex;'>";
+					html += "<span style='flex:1;'>" + gLocal.gui.status + "</span>";
+					html += '<span id="aritcle_status" style="flex:7;"></span>';
+					html += "</div>";
 					html +=
 						'<div style="display:none;width:100%;" ><span style="flex:3;margin: auto;">' +
 						gLocal.gui.language_select +
@@ -218,13 +222,13 @@ function my_article_edit(id) {
 						result.lang +
 						'" > <input id="article_lang" type="hidden" name="lang" value=""></div>';
 					html += "<div style='display:flex;'>";
-					html += "<span style='flex:3;margin:auto;'>" + gLocal.gui.introduction + "</span>";
+					html += "<span style='flex:1;margin:auto;'>" + gLocal.gui.introduction + "</span>";
 					html += "<textarea style='flex:7;' name='summary' >" + result.summary + "</textarea></div>";
 					html += "</div>";
 					html += "</div>";
 
 					html +=
-						"<textarea id='article_content' name='content' style='height:500px;max-height: 40vh;'>" +
+						"<textarea id='article_content' name='content' style='height:480px;resize: vertical;'>" +
 						result.content +
 						"</textarea>";
 					html += "</div>";

+ 8 - 5
app/article/my_article_edit.php

@@ -57,6 +57,7 @@ require_once '../studio/index_head.php';
 	color: var(--main-color);
 	padding: 0.5em;
 }
+
 	</style>
 
 	<?php
@@ -66,7 +67,7 @@ require_once '../studio/index_head.php';
 	<div class="index_inner " >
 	<form id="article_edit" action="##" onsubmit="return false"  method="POST" >
 	<div class="file_list_block">
-		<div class="tool_bar" style="width:50%;">
+		<div class="tool_bar" >
 			<div style="display:flex;">
 
 				<span class="icon_btn_div">
@@ -89,18 +90,20 @@ require_once '../studio/index_head.php';
 					</button>
 				</span>
 
-				<div id="article_collect" vui='collect-dlg' ></div>
+				
 			</div>
 			<div style="display:flex;">
-				<div>
-					<button class="icon_btn" title=<?php echo $_local->gui->scan_in_reader ;?>>
+				<div id="article_collect" vui='collect-dlg' ></div>
+				<span class="icon_btn_div">
+					<span class="icon_btn_tip"><?php echo $_local->gui->scan_in_reader ;?></span>
+					<button type="button" class="icon_btn" >
 						<a href="../article/index.php?id=<?php echo $_GET["id"];?>" target="_blank">
 							<svg class="icon">
 								<use xlink:href="../studio/svg/icon.svg#library"></use>
 							</svg>
 						</a>
 					</button>
-				</div>
+				</span>
 
 				<span class="icon_btn_div">
 					<span class="icon_btn_tip"><?php echo $_local->gui->save ;?></span>