Skip to content

Commit

Permalink
Merge pull request #26 from davidxuan/master
Browse files Browse the repository at this point in the history
improve post global message
  • Loading branch information
AdiChat authored Mar 19, 2019
2 parents b89d154 + d25dc1c commit d8d3ecb
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 5 deletions.
9 changes: 9 additions & 0 deletions assets/js/message.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
var msg_contents = {
"algorithm": [{
"text": "Want to contribute to Algorithms? See this task list and make your first contribution today 💪.",
"link": "https://discourse.opengenus.org/t/task-list-algorithms/2052/",
}, {
"text": "Want to contribute to Data Structure? See this task list and make your first contribution today 💪.",
"link": "https://discourse.opengenus.org/t/task-list-data-structures/1898/"
}]
}
2 changes: 1 addition & 1 deletion assets/mindmap/content/main.01f2ceab.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion page-convex-hull-map.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ into the {body} of the default.hbs template --}}
{{#post}}

<div id='site-nav'></div>
<svg class="mindmap-svg" id="mindmap-svg" viewBox="-116 -556 637 551"
<svg class="mindmap-svg" id="mindmap-svg" viewBox="-500 -600 1500 1500"
style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: gray;">
</svg>

Expand Down
2 changes: 1 addition & 1 deletion page-cs-map.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ into the {body} of the default.hbs template --}}
{{#post}}

<div id='site-nav'></div>
<svg class="mindmap-svg" id="mindmap-svg" viewBox="-336 -486 637 551"
<svg class="mindmap-svg" id="mindmap-svg" viewBox="-700 -600 1500 1500"
style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: gray;">
</svg>

Expand Down
19 changes: 17 additions & 2 deletions post.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ into the {body} of the default.hbs template --}}

<header class="post-full-header">
<h1 class="post-full-title" style="color:#292929; font-size:30px ; ">{{title}}</h1>
<div id="global_message" style="background: rgb(181, 222, 250);padding-top:20px;padding-bottom:20px;">
<a id='global_message_link' style="font-color: #a0a1a1; "></a>
</div>
<br>
<p style="display: inline-block; font-size: 75%">Share this:</p>
<h4 style="display: inline-block"><span>

Expand Down Expand Up @@ -289,6 +293,7 @@ into the {body} of the default.hbs template --}}

{{!-- The #contentFor helper here will send everything inside it up to the matching #block helper found in default.hbs --}}
{{#contentFor "scripts"}}
<script type="text/javascript" src="{{asset "js/message.js"}}"></script>
<script type="text/javascript" src="{{asset "js/lightbox/lightbox.js"}}"></script>
<script>
Expand Down Expand Up @@ -385,6 +390,18 @@ into the {body} of the default.hbs template --}}
});
$(document).ready(function () {
num = Math.floor(Math.random() * msg_contents['algorithm'].length); // later change algorithm to tag names
msg = msg_contents['algorithm'][num];
var text = msg['text'];
var link = msg['link'];
var msg_box = document.getElementById('global_message');
var a = document.getElementById('global_message_link');
a.href = link;
a.innerHTML = text;
msg_box.onclick = function () {
window.open(link, "_self");
};
var taglist_height = $('#taglist').height();
var tag_height = $('#tag_element').height();
var q_message = document.createElement('h6');
Expand Down Expand Up @@ -508,6 +525,4 @@ into the {body} of the default.hbs template --}}
}
</script>


{{/contentFor}}

0 comments on commit d8d3ecb

Please sign in to comment.