summaryrefslogtreecommitdiff
path: root/app/Helper
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2018-04-20 15:18:30 -0700
committerFrédéric Guillot <fred@kanboard.net>2018-04-20 15:18:30 -0700
commit5996a8abcf12336586cee345180203dd1500c92f (patch)
tree83b5c32b6ab8610d6607b9b5486d55a40225c505 /app/Helper
parent927607b5ff106224e49b63adc58454ffef2e2504 (diff)
Rewrite tooltips code without jQuery
Diffstat (limited to 'app/Helper')
-rw-r--r--app/Helper/AppHelper.php10
-rw-r--r--app/Helper/TextHelper.php12
2 files changed, 10 insertions, 12 deletions
diff --git a/app/Helper/AppHelper.php b/app/Helper/AppHelper.php
index 3a0a2428..63ebac98 100644
--- a/app/Helper/AppHelper.php
+++ b/app/Helper/AppHelper.php
@@ -12,6 +12,16 @@ use Kanboard\Core\Base;
*/
class AppHelper extends Base
{
+ public function tooltipMarkdown($markdownText, $icon = 'fa-info-circle')
+ {
+ return '<span class="tooltip"><i class="fa '.$icon.'"></i><script type="text/template"><div class="markdown">'.$this->helper->text->markdown($markdownText).'</div></script></span>';
+ }
+
+ public function tooltipLink($label, $link)
+ {
+ return '<span class="tooltip" data-href="'.$link.'">'.$label.'</span>';
+ }
+
public function getToken()
{
return $this->token;
diff --git a/app/Helper/TextHelper.php b/app/Helper/TextHelper.php
index 698bef6d..910130d6 100644
--- a/app/Helper/TextHelper.php
+++ b/app/Helper/TextHelper.php
@@ -52,18 +52,6 @@ class TextHelper extends Base
}
/**
- * Escape Markdown text that need to be stored in HTML attribute
- *
- * @access public
- * @param string $text
- * @return mixed
- */
- public function markdownAttribute($text)
- {
- return htmlentities($this->markdown($text), ENT_QUOTES, 'UTF-8');
- }
-
- /**
* Format a file size
*
* @param integer $size Size in bytes