Skip to content
Extraits de code Groupes Projets
Valider 3d780813 rédigé par mattpiwik's avatar mattpiwik
Parcourir les fichiers

- testing js include...

git-svn-id: http://dev.piwik.org/svn/trunk@206 59fd770c-687e-43c8-a1e3-f5a4ff64c105
parent 36570492
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -62,7 +62,8 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = 'ISO-88 ...@@ -62,7 +62,8 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = 'ISO-88
case 'javascript': case 'javascript':
// escape quotes and backslashes, newlines, etc. // escape quotes and backslashes, newlines, etc.
return strtr($string, array('\\'=>'\\\\',"'"=>"\\'",'"'=>'\\"',"\r"=>'\\r',"\n"=>'\\n','</'=>'<\/')); return strtr($string, array('\\'=>'\\\\',"'"=>"\\'",'"'=>'\\"',"\r"=>'\\r',"\n"=>'\\n','</'=>'<\/',
'script' => "sc'+'ript"));
case 'mail': case 'mail':
// safe way to display e-mail address on a web page // safe way to display e-mail address on a web page
......
<div id="{$id}" class="parentDiv"> <div id="{$id}" class="parentDiv">
{literal} {literal}
<style> <style>
<!--
#tagCloud{ #tagCloud{
width:500px; width:500px;
} }
...@@ -45,7 +45,6 @@ span.size6, span.size6 a { ...@@ -45,7 +45,6 @@ span.size6, span.size6 a {
color: #A3A8B6; color: #A3A8B6;
font-size: 11px; font-size: 11px;
} }
//-->
</style> </style>
{/literal} {/literal}
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
//A list of all our datatables //A list of all our datatables
var dataTables = new Object; var dataTables = new Object;
//On document ready we create a JS object for every datatable in the page //On document ready we create a JS object for every datatable in the page
$(document).ready( createAllDataTableObjects ); $(document).ready( createAllDataTableObjects );
......
...@@ -31,12 +31,19 @@ class Piwik_Widgetize_Controller extends Piwik_Controller ...@@ -31,12 +31,19 @@ class Piwik_Widgetize_Controller extends Piwik_Controller
echo $view->render(); echo $view->render();
} }
function testJsInclude1()
function testJsInclude()
{ {
$view = new Piwik_View('Widgetize/templates/test_jsinclude.tpl'); $view = new Piwik_View('Widgetize/templates/test_jsinclude.tpl');
$view->url1 = '?module=Widgetize&action=js&moduleToWidgetize=Home&actionToWidgetize=getBrowser&idSite=1&period=day&date=yesterday'; $view->url1 = '?module=Widgetize&action=js&moduleToWidgetize=Home&actionToWidgetize=getBrowser&idSite=1&period=day&date=yesterday';
echo $view->render();
}
function testJsInclude2()
{
$view = new Piwik_View('Widgetize/templates/test_jsinclude2.tpl');
$view->url1 = '?module=Widgetize&action=js&moduleToWidgetize=Home&actionToWidgetize=getBrowser&idSite=1&period=day&date=yesterday';
$view->url2 = '?module=Widgetize&action=js&moduleToWidgetize=Home&actionToWidgetize=getCountry&idSite=1&period=day&date=yesterday&viewDataTable=cloud&showDataTableFooter=0'; $view->url2 = '?module=Widgetize&action=js&moduleToWidgetize=Home&actionToWidgetize=getCountry&idSite=1&period=day&date=yesterday&viewDataTable=cloud&showDataTableFooter=0';
echo $view->render(); echo $view->render();
} }
......
<ul> <ul>
<li><a href='?module=Widgetize&action=testIframe'>Test getCountry table in a IFRAME</li> <li><a href='?module=Widgetize&action=testIframe'>Test getCountry table in a IFRAME</li>
<li><a href='?module=Widgetize&action=testJsInclude'>Test getCountry table in a JS include</a></li> <li><a href='?module=Widgetize&action=testJsInclude1'>Test getCountry table in a JS include</a></li>
<li><a href='?module=Widgetize&action=testJsInclude2'>Test include 2 tables in 2 JS include in one page</a></li>
</ul> </ul>
\ No newline at end of file
<html> <html>
<body> <body>
<h2>Test getCountry table in a JS include</h2> <p>This text is after the JS INCLUDE</p>
<script type="text/javascript" src="{$url1}"></script>
<noscript>Powered by <a href="http://piwik.org">Piwik</a></div></noscript>
{literal}
<style>
table.dataTable td {
background-color:red;
}
</style>
{/literal}
<p>This test is after the JS INCLUDE</p>
<h2>Test tag cloud in a JS include</h2> <h2>Test tag cloud in a JS include</h2>
<script type="text/javascript" src="{$url2}"></script> <script type="text/javascript" src="{$url1}"></script>
<noscript>Powered by <a href="http://piwik.org">Piwik</a></div></noscript> <noscript>Powered by <a href="http://piwik.org">Piwik</a></div></noscript>
<p>This test is after the JS INCLUDE</p> <p>This text is after the JS INCLUDE</p>
</body> </body>
</html> </html>
\ No newline at end of file
<html>
<body>
<p>This text is after the JS INCLUDE</p>
<h2>Test table in a JS include</h2>
<script type="text/javascript" src="{$url1}"></script>
<noscript>Powered by <a href="http://piwik.org">Piwik</a></div></noscript>
<p>This text is after the JS INCLUDE</p>
<h2>Test tag cloud in a JS include</h2>
<script type="text/javascript" src="{$url2}"></script>
<noscript>Powered by <a href="http://piwik.org">Piwik</a></div></noscript>
<p>This text is after the JS INCLUDE</p>
</body>
</html>
\ No newline at end of file
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter