From b3eb44832ba7419d0a769bf88cb19d4aafa39594 Mon Sep 17 00:00:00 2001
From: inga-lovinde <52715130+inga-lovinde@users.noreply.github.com>
Date: Sat, 10 Jul 2010 17:33:57 +0000
Subject: [PATCH] Implemented select-to-quote behavior in PostInfo
---
Builder/IISMainHandler/build.txt | 2 +-
.../handlers/response/PMReplyToPostHandler.cs | 1 +
.../handlers/response/ReplyHandler.cs | 1 +
static/js/common.js | 21 +++++++++++++++++++
templates/Full/PMReplyToPost.xslt | 11 +++++++++-
templates/Full/PostReply.xslt | 11 +++++++++-
templates/Full/elems/Main.xslt | 5 +++++
templates/Full/elems/PostInfo.xslt | 4 ++++
8 files changed, 53 insertions(+), 3 deletions(-)
diff --git a/Builder/IISMainHandler/build.txt b/Builder/IISMainHandler/build.txt
index 7bd7739..a42ae07 100644
--- a/Builder/IISMainHandler/build.txt
+++ b/Builder/IISMainHandler/build.txt
@@ -1 +1 @@
-713
\ No newline at end of file
+725
\ No newline at end of file
diff --git a/IISMainHandler/handlers/response/PMReplyToPostHandler.cs b/IISMainHandler/handlers/response/PMReplyToPostHandler.cs
index a4530a5..2654e3b 100644
--- a/IISMainHandler/handlers/response/PMReplyToPostHandler.cs
+++ b/IISMainHandler/handlers/response/PMReplyToPostHandler.cs
@@ -26,6 +26,7 @@ namespace FLocal.IISHandler.handlers.response {
post.thread.exportToXml(context, false),
post.exportToXmlWithoutThread(context, false),
new XElement("receiver", Account.LoadByUser(post.poster).exportToXml(context)),
+ new XElement("quoted", context.httprequest.Form["data"]),
};
}
}
diff --git a/IISMainHandler/handlers/response/ReplyHandler.cs b/IISMainHandler/handlers/response/ReplyHandler.cs
index e5079fc..fdbd8d8 100644
--- a/IISMainHandler/handlers/response/ReplyHandler.cs
+++ b/IISMainHandler/handlers/response/ReplyHandler.cs
@@ -28,6 +28,7 @@ namespace FLocal.IISHandler.handlers.response {
new XElement("layers",
from layer in PostLayer.allLayers select layer.exportToXml(context)
),
+ new XElement("quoted", context.httprequest.Form["data"]),
};
}
}
diff --git a/static/js/common.js b/static/js/common.js
index 1d4677f..4ab2e71 100644
--- a/static/js/common.js
+++ b/static/js/common.js
@@ -31,3 +31,24 @@ function assignArrowsHandlers() {
}
}
}
+
+function getSelText() {
+// alert(typeof(window.getSelection));
+// alert(typeof(document.getSelection));
+// alert(typeof(document.selection));
+ if(typeof(window.getSelection) == "function") {
+ return window.getSelection();
+ } else if(typeof(document.getSelection) == "function") {
+ return document.getSelection();
+ } else if(typeof(document.selection) == "object") {
+ return document.selection.createRange().text;
+ } else {
+ return "";
+ }
+}
+
+function submitSelText(url) {
+ document.getElementById("systemForm").data.value = getSelText();
+ document.getElementById("systemForm").action = url;
+ document.getElementById("systemForm").submit();
+}
diff --git a/templates/Full/PMReplyToPost.xslt b/templates/Full/PMReplyToPost.xslt
index 8a24977..11b5529 100644
--- a/templates/Full/PMReplyToPost.xslt
+++ b/templates/Full/PMReplyToPost.xslt
@@ -53,7 +53,16 @@
-
-