summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAl <gabriel.cortesi@outlook.com>2019-07-14 01:55:08 +0200
committerAl <gabriel.cortesi@outlook.com>2019-07-14 01:55:08 +0200
commita2aa4270e9d8516ece2a6e013ff6a13918dd1efc (patch)
treea5cdf6a2dda202f577abfcc2ebec4407376a920e /src
parent23b71ca21f15288f9d2e7e04a37de95b8ae8ca18 (diff)
Added full Spoiler support to the nexus Description viewer.
Diffstat (limited to 'src')
-rw-r--r--src/bbcode.cpp2
-rw-r--r--src/modinfodialognexus.cpp26
2 files changed, 28 insertions, 0 deletions
diff --git a/src/bbcode.cpp b/src/bbcode.cpp
index 3d7b2ba2..51c461e6 100644
--- a/src/bbcode.cpp
+++ b/src/bbcode.cpp
@@ -140,6 +140,8 @@ private:
"<figure class=\"quote\"><blockquote>\\1</blockquote></figure>");
m_TagMap["quote="] = std::make_pair(QRegExp("\\[quote=([^\\]]*)\\](.*)\\[/quote\\]"),
"<figure class=\"quote\"><blockquote>\\2</blockquote></figure>");
+ m_TagMap["spoiler"] = std::make_pair(QRegExp("\\[spoiler\\](.*)\\[/spoiler\\]"),
+ "<details><summary>Spoiler: <div class=\"bbc_spoiler_show\">Show</div></summary><div class=\"spoiler_content\">\\1</div></details>");
m_TagMap["code"] = std::make_pair(QRegExp("\\[code\\](.*)\\[/code\\]"),
"<code>\\1</code>");
m_TagMap["heading"]= std::make_pair(QRegExp("\\[heading\\](.*)\\[/heading\\]"),
diff --git a/src/modinfodialognexus.cpp b/src/modinfodialognexus.cpp
index 180c72f0..e606525c 100644
--- a/src/modinfodialognexus.cpp
+++ b/src/modinfodialognexus.cpp
@@ -238,6 +238,32 @@ void NexusTab::onModChanged()
padding: 0;
}
+ div.spoiler_content {
+ background: #262626;
+ border: 1px dashed #3b3b3b;
+ padding: 5px;
+ margin: 5px;
+ }
+
+ div.bbc_spoiler_show{
+ border: 1px solid black;
+ background-color: #454545;
+ font-size: 11px;
+ padding: 3px;
+ color: #E6E6E6;
+ border-radius: 3px;
+ display: inline-block;
+ cursor: pointer;
+ }
+
+ details summary::-webkit-details-marker {
+ display:none;
+ }
+
+ summary:focus {
+ outline: 0;
+ }
+
a
{
/*should avoid overflow with long links forcing wordwrap regardless of spaces*/