Veljače
13
2006

Smarty Kako: Javascript Debug predlošku

UPDATE: preuzimanje paket je dostupan ovdje: http://ideamesh.com/file/11/Smarty-Debug-with-Collapsible-Variables.html

Ovdje je izmjena koda, rada i gotovs to ići ..

Ovdje je link gdje možete skinuti nanotree javascript ...
http://nanotree.sourceforge.net/~~V

Zamijenite svoju varijablu {$} Site.framework_pub prikladno, tako da javascript i slike mogu se učitati ispravno.

Također imajte na umu, ja sam dodao u sekciji za obradu korisničke debug Vars ... Moj debug struktura pod nazivom '_user_debug' i '_user_debug_key'

Za više informacija o tome kako implementirati ovaj pogled na ovaj thread:
http://www.smarty.net/forums/viewtopic.php?p=31241 # 31241

Inače, ako vas ne zanima, to je sigurno da uklonite taj dio iz predloška. Također se može ukloniti {ako} izjavu sam se da zamotate dio predloška var.

Još jedna stvar koju možda želite da se igraju s je koliko su likovi izlaz kao vrijednost za uklanjanje pogrešaka. Potražite za to i mijenjati drugi broj mijenjati max znakova izlaz: @ debug_print_var: 0:1000

PS Može li itko shvatiti zašto sam dobivanje prostora iznad <h3> u desnoj ćeliji?

Nadam se ovo pomaže, znam da mi se sviđa Osmijeh

PS Da bi se sve javascript radi ispravno samo trebate izmijeniti liniju "var mynanopath =" i uvjerite se da ukazuje na vašem javnom nanopath direktorij. Možete dolje nanotree paket http://sourceforge.net/projects/nanotree/

Ovdje je ažurirana kod

Šifra:
{*
Smarty Custom DHTML Debug predlošku
@ Autor Hielke Hoeve
@ Autor Owen Cole <owenc na ideamesh dot com>
@ 02/13/2006 Smarty od 2.6.12
@ Paket Smarty
@ Ime debug.tpl
*}

{} Assign_debug_info

<script Language=javascript>
var mynanopath = "{$ Site.javascript_path} \ / nanotree \ /";

if (self.name == ") {} ldelim
var title = "Konzola ';
{} Rdelim
else {} ldelim
var title = "Console_ '+ self.name;
{} Rdelim
_smarty_console = window.open ("", title.value "width = 800, height = 600, promjenjive veličine i scrollbars = yes");
_smarty_console.document.write ("<html> <head> <title> Smarty Debug Console_" + self.name + "<\ / title> \ n");
_smarty_console.document.write ("<style> \ n");
_smarty_console.document.write ("h3 {} ldelim padding: 5px 5px 5px 5px; margin: 0px 0px 0px 0px; background-color: # cccccc; rdelim {} \ n");
_smarty_console.document.write ("# debugtreetable {} ldelim širina: 100%, {rdelim} \ n");
_smarty_console.document.write ("# debugtreetable td {} ldelim border: solid tanka crna; rdelim {} \ n");
_smarty_console.document.write ("# debugtreetextdiv div {} ldelim padding-left: 10px;} {rdelim \ n");
_smarty_console.document.write ("<\ / style> \ n");
_smarty_console.document.write ("<script language=\"Javascript\" src=\"" + + mynanopath "nanotree.js\"> <\ / script> \ n");
_smarty_console.document.write ("<script type=\"text\/javascript\" language=\"JavaScript\"> \ n");
_smarty_console.document.write ("<- \ n!");
_smarty_console.document.write ("showRootNode = true; \ n");
_smarty_console.document.write ("sortNodes = 0, \ n");
_smarty_console.document.write ("dragable = false; \ n");
_smarty_console.document.write ("showAllNodesOnStartup = true; \ n");

_smarty_console.document.write ("\ / ** \ n");
_smarty_console.document.write ("* Potrebne inicijalizirati stablo \ n.");
_smarty_console.document.write ("* I nazvati showTree (ImagePath). zapravo pokazati stablo \ n");
_smarty_console.document.write ("* Ili to može biti učinjeno u skripti blok na dnu stranice \ n.");
_smarty_console.document.write ("* Iako je ova metoda je nešto čišći \ n.");
_smarty_console.document.write ("* \ / \ n");
_smarty_console.document.write ("funkcija init () {ldelim} \ n");
_smarty_console.document.write ("Spremnik = document.getElementById ('debugtreediv'), \ n");
_smarty_console.document.write ("showTree ('" + mynanopath + "'); \ n");
_smarty_console.document.write ("rdelim {} \ n");

_smarty_console.document.write ("\ / ** \ n");
_smarty_console.document.write ("* zove kad korisnik klikne na čvor \ n.");
_smarty_console.document.write ("* @ param treeNode TreeNode objekt koji su kliknuli \ n.");
_smarty_console.document.write ("* \ / \ n");
_smarty_console.document.write ("funkcija standardClick (treeNode) {ldelim} \ n");
_smarty_console.document.write ("var mytext = document.getElementById ('debugtreetextdiv'), \ n");
_smarty_console.document.write ("var param = treeNode.getParam (); \ n");
_smarty_console.document.write ("mytext.innerHTML = (param ==") treeNode.getName ():? <h3> '+ treeNode.getName () + "<\ / h3> <div>' + + param ' <\ / div> '; \ n ");
_smarty_console.document.write ("rdelim {} \ n");

_smarty_console.document.write ("funkcija nodeEdited (treeNode) {ldelim} \ n");
_smarty_console.document.write ("rdelim {} \ n");

_smarty_console.document.write ("var closedGif = '" + + mynanopath "slike \ / folder_closed.gif', \ n");
_smarty_console.document.write ("var openGif = '" + + mynanopath "slike \ / folder_open.gif', \ n");
_smarty_console.document.write ("var pageIcon = '" + + mynanopath "slike \ / page16 × 16.gif', \ n");
_smarty_console.document.write ("var userIcon = '" + + mynanopath "slike \ / user_16 × 16.gif', \ n");
_smarty_console.document.write ("var helpIcon = '" + + mynanopath "slike \ / help_16 × 16.gif', \ n");

{* Stvaranje * čvor osnovni}
{Dodijeliti var = protuvrijednost = 0}
_smarty_console.document.write ("rootNode = new TreeNode ({} $ brojac, 'Smarty Debug', helpIcon: 'Ovo je Debug Tree To zamjenjuje klasičnu verziju Smarty Debug konzole.'); \ n");
{$ Brojac + +}

{* Napravite čvor za predložak uključuje i *}
_smarty_console.document.write ("var čvor {} $ brojac = new TreeNode ({} $ brojac, 'uključene predloške i konfiguracijske datoteke (opterećenje vrijeme u sekundama):', pageIcon '");
_smarty_console.document.write ("<table width=\"100%\">");
{Naziv dijela predlošci = loop = $ _debug_tpls}
_smarty_console.document.write ("<tr bgcolor={if %templates.index% je even}#eeeeee{else}#fafafa{/if}> <td colspan=2> <tt> {odjeljak ime = alineje loop = $ _debug_tpls [predloške]. dubina} {&&& / Section} <font color = {ako je $ _debug_tpls [predloške]. Vrsta eq "predložak"} {elseif $ smeđa _debug_tpls [predloške]. Vrsta eq isset ($ _debug_tpls [predloške] exec_time.)} <font size=-1> <i> ({$ _debug_tpls [predloške] exec_time | string_format. "% f 0,5"}) {if posto eq templates.index% 0} (ukupno) {/ li} <\ \ / i> <\ \ / font> {/ li} <\ \ / tt> <\ \ / td> <\ \ / tr> ");
{} Sectionelse
_smarty_console.document.write ("<tr bgcolor=#eeeeee> <td colspan=2> <tt> <i> nema predlošci uključen <\ \ / i> <\ \ / tt> <\ \ / td> <\ \ / tr> ");
{/ Dio}
_smarty_console.document.write ("<\ \ / table>");
_smarty_console.document.write (""); \ n ");

_smarty_console.document.write ("rootNode.addChild (čvor {$ brojac}); \ n");
{$ Brojac + +}

{* Napravite čvor za uklanjanje pogrešaka korisnika varijabli *}
_smarty_console.document.write ("var čvor {} $ brojac = new TreeNode ({} $ brojac, 'debug korisnika varijable:' new Array (closedGif, openGif)), \ n");
_smarty_console.document.write ("rootNode.addChild (čvor {$ brojac}); \ n");
_smarty_console.document.write ("var = čvor roditelj {} $ brojac; \ n");
{$ Brojac + +}

{* Stvaranje djece čvorova za korisničke uklanjanje pogrešaka varijabli *}
{Odjeljak ime = Vars loop = $ _user_debug}
_smarty_console.document.write ("var čvor {} $ brojac = new TreeNode ({} $ brojac, '{ldelim} $ {$ _user_debug_key [Vars]} {rdelim}', pageIcon '{$ _user_debug [Vars] | @ debug_print_var: 0:1000 | bijeg: javascript | bijeg: javascript} '), \ n ");
_smarty_console.document.write ("parent.addChild (čvor {$ brojac}); \ n");
{$ Brojac + +}
{} Sectionelse
_smarty_console.document.write ("var čvor {} $ brojac = new TreeNode ({} $ brojac, 'Ne korisnik informacija Debug dodjeljuje', HelpIcon), \ n");
_smarty_console.document.write ("parent.addChild (čvor {$ brojac}); \ n");
{$ Brojac + +}
{/ Dio}

{* Napravite čvor za predložak varijable pokazuje *}
_smarty_console.document.write ("var čvor {} $ brojac = new TreeNode ({} $ brojac", dodijeljene predložak varijable: 'new Array (closedGif, openGif)), \ n ");
_smarty_console.document.write ("rootNode.addChild (čvor {$ brojac}); \ n");
_smarty_console.document.write ("var = čvor roditelj {} $ brojac; \ n");
{$ Brojac + +}

{* Stvaranje djece čvorova predložaka varijabli *}
{Odjeljak ime = Vars loop = $ _debug_keys}
{Ako je $ _debug_keys [Vars]! = '_user_debug To && $ _debug_keys [Vars]! =' _user_debug_key '}
_smarty_console.document.write ("var čvor {} $ brojac = new TreeNode ({} $ brojac, '{ldelim} $ {$ _debug_keys [Vars]} {rdelim}', pageIcon '{$ _debug_vals [Vars] | @ debug_print_var: 0:1000 | bijeg: javascript | bijeg: javascript} '), \ n ");
_smarty_console.document.write ("parent.addChild (čvor {$ brojac}); \ n");
{$ Brojac + +}
{/ Ako}
{} Sectionelse
_smarty_console.document.write ("var čvor {} $ brojac = new TreeNode ({} $ brojac, 'Nema predložak varijable dodijeljene", HelpIcon), \ n ");
_smarty_console.document.write ("parent.addChild (čvor {$ brojac}); \ n");
{$ Brojac + +}
{/ Dio}

{* Napravite čvor za Smarty varijabli config datoteke *}
_smarty_console.document.write ("var čvor {} $ brojac = new TreeNode ({} $ brojac, 'dodjeljuje varijabli (config datoteka predložak vanjski opseg):', new Array (closedGif, openGif)), \ n");
_smarty_console.document.write ("rootNode.addChild (čvor {$ brojac}); \ n");
_smarty_console.document.write ("var = čvor roditelj {} $ brojac; \ n");
{$ Brojac + +}

{* Stvaranje djece čvorova za Smarty varijabli config datoteke *}
{Odjeljak ime = config_vars loop = $ _debug_config_keys}
_smarty_console.document.write ("var čvor {} $ brojac = new TreeNode ({} $ brojac, '{ldelim} $ {$ _debug_config_keys [config_vars]} {rdelim}', pageIcon '{$ _debug_config_vals [config_vars] | @ debug_print_var: 0:1000 | bijeg: javascript | bijeg: javascript} '), \ n ");
_smarty_console.document.write ("parent.addChild (čvor {$ brojac}); \ n");
{$ Brojac + +}
{} Sectionelse
_smarty_console.document.write ("var čvor {} $ brojac = new TreeNode ({} $ brojac, 'Nema konfiguracijske varijable dodijeljene", HelpIcon), \ n ");
_smarty_console.document.write ("parent.addChild (čvor {$ brojac}); \ n");
{$ Brojac + +}
{/ Dio}

_smarty_console.document.write ("\ / \ / -> \ n");
_smarty_console.document.write ("<\ / script> \ n \ n");
_smarty_console.document.write ("<\ / head> <body onload=\"init()\"> \ n");
_smarty_console.document.write ("<h3> Smarty & konzole Upute Debug <\ / h3>");
_smarty_console.document.write ("<h4> Kliknite na varijabli u stabla imaju svoje sadržaje prikazane na desnoj strani ploče <\ / h4>.");
_smarty_console.document.write ("<table border='0' id='debugtreetable'> <tr>");
_smarty_console.document.write ("<td valign='top' style='width: 250px;'> <div id='debugtreediv'> i <\ / div> <\ / td>");
_smarty_console.document.write ("<td valign='top'> <div id='debugtreetextdiv'> i <\ / td>");
_smarty_console.document.write ("<\ / tr> <\ / table>");
_smarty_console.document.write ("<\ / body> <\ / html>");
_smarty_console.document.close ();
</ SCRIPT>

tags: ,
posted in vodiči , programiranje je Owen

Pratite komentare putem RSS Feed | Ostavite komentar | Trackback URL

Ostavite svoj komentar

 
© 2008 - 2012 - Sva prava pridržana - Ideamesh, Inc 22 upita. 0.779 sekundi.