Implemented select-to-quote behavior in PostInfo

main
Inga 🏳‍🌈 15 years ago
parent c17b224698
commit b3eb44832b
  1. 2
      Builder/IISMainHandler/build.txt
  2. 1
      IISMainHandler/handlers/response/PMReplyToPostHandler.cs
  3. 1
      IISMainHandler/handlers/response/ReplyHandler.cs
  4. 21
      static/js/common.js
  5. 11
      templates/Full/PMReplyToPost.xslt
  6. 11
      templates/Full/PostReply.xslt
  7. 5
      templates/Full/elems/Main.xslt
  8. 4
      templates/Full/elems/PostInfo.xslt

@ -26,6 +26,7 @@ namespace FLocal.IISHandler.handlers.response {
post.thread.exportToXml(context, false), post.thread.exportToXml(context, false),
post.exportToXmlWithoutThread(context, false), post.exportToXmlWithoutThread(context, false),
new XElement("receiver", Account.LoadByUser(post.poster).exportToXml(context)), new XElement("receiver", Account.LoadByUser(post.poster).exportToXml(context)),
new XElement("quoted", context.httprequest.Form["data"]),
}; };
} }
} }

@ -28,6 +28,7 @@ namespace FLocal.IISHandler.handlers.response {
new XElement("layers", new XElement("layers",
from layer in PostLayer.allLayers select layer.exportToXml(context) from layer in PostLayer.allLayers select layer.exportToXml(context)
), ),
new XElement("quoted", context.httprequest.Form["data"]),
}; };
} }
} }

@ -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();
}

@ -53,7 +53,16 @@
</input> </input>
<br/> <br/>
<br/> <br/>
<xsl:call-template name="textEditor"/> <xsl:call-template name="textEditor">
<xsl:with-param name="body">
<xsl:if test="quoted and quoted != ''">
<xsl:text>[q]</xsl:text>
<xsl:value-of select="quoted"/>
<xsl:text>[/q]
</xsl:text>
</xsl:if>
</xsl:with-param>
</xsl:call-template>
<br/> <br/>
<input type="checkbox" name="preview" value="1" class="formboxes" disabled="disabled" /> <input type="checkbox" name="preview" value="1" class="formboxes" disabled="disabled" />
<xsl:text>Я хочу предварительно просмотреть сообщение перед отправкой</xsl:text> <xsl:text>Я хочу предварительно просмотреть сообщение перед отправкой</xsl:text>

@ -56,7 +56,16 @@
</select> </select>
<br/> <br/>
<br/> <br/>
<xsl:call-template name="textEditor"/> <xsl:call-template name="textEditor">
<xsl:with-param name="body">
<xsl:if test="quoted and quoted != ''">
<xsl:text>[q]</xsl:text>
<xsl:value-of select="quoted"/>
<xsl:text>[/q]
</xsl:text>
</xsl:if>
</xsl:with-param>
</xsl:call-template>
<br/> <br/>
<input type="checkbox" name="preview" value="1" class="formboxes" disabled="disabled" /> <input type="checkbox" name="preview" value="1" class="formboxes" disabled="disabled" />
<xsl:text>Я хочу предварительно просмотреть сообщение перед отправкой</xsl:text> <xsl:text>Я хочу предварительно просмотреть сообщение перед отправкой</xsl:text>

@ -20,6 +20,11 @@
<body> <body>
<xsl:call-template name="header"/> <xsl:call-template name="header"/>
<xsl:call-template name="specific"/> <xsl:call-template name="specific"/>
<div style="display:none">
<form action="" method="POST" id="systemForm">
<input type="hidden" name="data"/>
</form>
</div>
<xsl:text disable-output-escaping="yes"><![CDATA[<!--]]></xsl:text> <xsl:text disable-output-escaping="yes"><![CDATA[<!--]]></xsl:text>
<br /> <br />
<xsl:text>Data used for authoring this XHTML document:</xsl:text> <xsl:text>Data used for authoring this XHTML document:</xsl:text>

@ -59,6 +59,8 @@
<xsl:if test="$isReplyDisabled='false'"> <xsl:if test="$isReplyDisabled='false'">
<xsl:if test="/root/session/sessionKey"> <xsl:if test="/root/session/sessionKey">
<xsl:attribute name="href">/Post/<xsl:value-of select="id"/>/Reply/</xsl:attribute> <xsl:attribute name="href">/Post/<xsl:value-of select="id"/>/Reply/</xsl:attribute>
<xsl:attribute name="onClick">submitSelText(this.href);return false;</xsl:attribute>
<xsl:attribute name="onMouseDown">submitSelText(this.href);return false;</xsl:attribute>
</xsl:if> </xsl:if>
</xsl:if> </xsl:if>
<img src="/static/images/reply.gif" border="0" alt="Îòâåò íà ñîîáùåíèå" width="27" height="14" title="Îòâåò íà ñîîáùåíèå" style="vertical-align: text-bottom" /> <img src="/static/images/reply.gif" border="0" alt="Îòâåò íà ñîîáùåíèå" width="27" height="14" title="Îòâåò íà ñîîáùåíèå" style="vertical-align: text-bottom" />
@ -91,6 +93,8 @@
<a> <a>
<xsl:if test="/root/session/sessionKey"> <xsl:if test="/root/session/sessionKey">
<xsl:attribute name="href">/Post/<xsl:value-of select="id"/>/PMReply/</xsl:attribute> <xsl:attribute name="href">/Post/<xsl:value-of select="id"/>/PMReply/</xsl:attribute>
<xsl:attribute name="onClick">submitSelText(this.href);return false;</xsl:attribute>
<xsl:attribute name="onMouseDown">submitSelText(this.href);return false;</xsl:attribute>
</xsl:if> </xsl:if>
<img src="/static/images/email2.gif" border="0" alt="Îòâåòèòü ïðèâàòîì" title="Îòâåòèòü ïðèâàòîì" /> <img src="/static/images/email2.gif" border="0" alt="Îòâåòèòü ïðèâàòîì" title="Îòâåòèòü ïðèâàòîì" />
</a> </a>

Loading…
Cancel
Save