|
|
@@ -132,41 +132,6 @@ function note_lookup(word, showto) {
|
|
|
);
|
|
|
}
|
|
|
|
|
|
-function term_load_preview(guid, showto) {
|
|
|
- $.get(
|
|
|
- "../term/term.php",
|
|
|
- {
|
|
|
- op: "load_id",
|
|
|
- id: guid,
|
|
|
- format: "json",
|
|
|
- },
|
|
|
- function (data, status) {
|
|
|
- let html = "";
|
|
|
- if (status == "success") {
|
|
|
- try {
|
|
|
- let result = JSON.parse(data)[0];
|
|
|
- html = "<div class='term_block'>";
|
|
|
-
|
|
|
- html += "<h2>" + result.word + "</h2>";
|
|
|
- html += "<div class='meaning'>" + result.meaning + "</div>";
|
|
|
- html +=
|
|
|
- "<div class='term_note' status='1'>" +
|
|
|
- note_init(result.note) +
|
|
|
- "</div>";
|
|
|
- html +=
|
|
|
- "<div ><a href='../wiki/wiki.php?word=" +
|
|
|
- result.word +
|
|
|
- "' target='_blank'>更多</a></div>";
|
|
|
- html += "</div>";
|
|
|
- $("#" + showto).html(html);
|
|
|
- } catch (e) {
|
|
|
- console.error("note_lookup_guid_json:" + e + " data:" + data);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- );
|
|
|
-}
|
|
|
-
|
|
|
var term_get_word_to_div_callback = null;
|
|
|
function term_get_word_to_div(strWord, div, callback) {
|
|
|
term_get_word_to_div_callback = callback;
|
|
|
@@ -856,3 +821,78 @@ function term_get_dict() {
|
|
|
}
|
|
|
);
|
|
|
}
|
|
|
+
|
|
|
+/*
|
|
|
+function term_popup_init() {
|
|
|
+ $(".term_link").each(function () {
|
|
|
+ if ($(this).attr("init") != "1") {
|
|
|
+ if ($(this).text().length > 0) {
|
|
|
+ $(this).css("background", "unset");
|
|
|
+ }
|
|
|
+ let gid = $(this).attr("gid");
|
|
|
+ if ($(this).offset().left < $(document.body).width() / 2) {
|
|
|
+ //出现在左侧
|
|
|
+ $(this).append(
|
|
|
+ '<div id="gid_' +
|
|
|
+ gid +
|
|
|
+ '" class="guide_contence" style="left: -5px;"></div>'
|
|
|
+ );
|
|
|
+ $(".guide_contence:after").css("left", "0");
|
|
|
+ } else {
|
|
|
+ //出现在右侧
|
|
|
+ $(this).append(
|
|
|
+ '<div id="gid_' +
|
|
|
+ gid +
|
|
|
+ '" class="guide_contence" style="right: -5px;"></div>'
|
|
|
+ );
|
|
|
+ $(".guide_contence:after").css("right", "0");
|
|
|
+ }
|
|
|
+ $(this).attr("init", "1");
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ $(".term_link").mouseenter(function () {
|
|
|
+ if ($(this).children(".guide_contence").first().html().length > 0) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let gid = $(this).attr("gid");
|
|
|
+ term_load_preview(gid, "gid_" + gid);
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+function term_load_preview(guid, showto) {
|
|
|
+ $.get(
|
|
|
+ "../term/term.php",
|
|
|
+ {
|
|
|
+ op: "load_id",
|
|
|
+ id: guid,
|
|
|
+ format: "json",
|
|
|
+ },
|
|
|
+ function (data, status) {
|
|
|
+ let html = "";
|
|
|
+ if (status == "success") {
|
|
|
+ try {
|
|
|
+ let result = JSON.parse(data)[0];
|
|
|
+ html = "<div class='term_block'>";
|
|
|
+
|
|
|
+ html += "<h2>" + result.word + "</h2>";
|
|
|
+ html += "<div class='meaning'>" + result.meaning + "</div>";
|
|
|
+ html +=
|
|
|
+ "<div class='term_note' status='1'>" +
|
|
|
+ note_init(result.note) +
|
|
|
+ "</div>";
|
|
|
+ html +=
|
|
|
+ "<div ><a href='../wiki/wiki.php?word=" +
|
|
|
+ result.word +
|
|
|
+ "' target='_blank'>更多</a></div>";
|
|
|
+ html += "</div>";
|
|
|
+ $("#" + showto).html(html);
|
|
|
+ } catch (e) {
|
|
|
+ console.error("note_lookup_guid_json:" + e + " data:" + data);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ );
|
|
|
+}
|
|
|
+
|
|
|
+*/
|