]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Avoid raw javascript in template
authorJeremy <jeremy.benoist@gmail.com>
Sat, 7 Feb 2015 17:28:30 +0000 (18:28 +0100)
committerJeremy <jeremy.benoist@gmail.com>
Sat, 7 Feb 2015 17:28:31 +0000 (18:28 +0100)
It kills the Symfony Crawler :)

src/Wallabag/CoreBundle/Resources/public/js/bookmarklet.js [new file with mode: 0644]
src/Wallabag/CoreBundle/Resources/views/_bookmarklet.html.twig [deleted file]
src/Wallabag/CoreBundle/Resources/views/_head.html.twig
src/Wallabag/CoreBundle/Resources/views/layout.html.twig

diff --git a/src/Wallabag/CoreBundle/Resources/public/js/bookmarklet.js b/src/Wallabag/CoreBundle/Resources/public/js/bookmarklet.js
new file mode 100644 (file)
index 0000000..2afdfc3
--- /dev/null
@@ -0,0 +1,2 @@
+
+top["bookmarklet-url@wallabag.org"]=""+"<!DOCTYPE html>"+"<html>"+"<head>"+"<title>bag it!</title>"+'<link rel="icon" href="tpl/img/favicon.ico" />'+"</head>"+"<body>"+"<script>"+"window.onload=function(){"+"window.setTimeout(function(){"+"history.back();"+"},250);"+"};"+"</scr"+"ipt>"+"</body>"+"</html>"
diff --git a/src/Wallabag/CoreBundle/Resources/views/_bookmarklet.html.twig b/src/Wallabag/CoreBundle/Resources/views/_bookmarklet.html.twig
deleted file mode 100644 (file)
index fd662c1..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-        <script type="text/javascript">
-          top["bookmarklet-url@wallabag.org"]=""+"<!DOCTYPE html>"+"<html>"+"<head>"+"<title>bag it!</title>"+'<link rel="icon" href="tpl/img/favicon.ico" />'+"</head>"+"<body>"+"<script>"+"window.onload=function(){"+"window.setTimeout(function(){"+"history.back();"+"},250);"+"};"+"</scr"+"ipt>"+"</body>"+"</html>"
-        </script>
index f123183b8548c7ba4b860ca2f1df1dfc55bc8993..726b4163a1836023f360d06b4921213f465387b3 100755 (executable)
@@ -37,3 +37,4 @@
         <script src="{{ asset('themes/_global/js/saveLink.js') }}"></script>
         <script src="{{ asset('themes/_global/js/popupForm.js') }}"></script>
         <script src="{{ asset('themes/baggy/js/closeMessage.js') }}"></script>
+        <script src="{{ asset('bundles/wallabagcore/js/bookmarklet.js') }}"></script>
index f062672c83a5d401f7d105de72c0bed478f481dc..e9ccc58c5713d24389e1c7affcf3b4b87b2e3ea3 100644 (file)
@@ -12,7 +12,6 @@
         <![endif]-->
         <title>{% block title %}{% endblock %} - wallabag</title>
         {% include "WallabagCoreBundle::_head.html.twig" %}
-        {% include "WallabagCoreBundle::_bookmarklet.html.twig" %}
     </head>
     <body>
     {% include "WallabagCoreBundle::_top.html.twig" %}