Vasaris
13
2006

Smarty Kaip: JavaScript Debug Šablonas

UPDATE: Paketą galima rasti čia: http://ideamesh.com/file/11/Smarty-Debug-with-Collapsible-Variables.html

Čia yra pakeistas kodas, darbo ir pasirengę eiti ..

Štai nuoroda, kur Jūs galite atsisiųsti nanotree javascript ...
http://nanotree.sourceforge.net/~~V

Pakeiskite savo kintamąjį {$ Site.framework_pub} tinkamai, kad javascript ir vaizdai gali būti kraunami teisingai.

Taip pat svarbu nepamiršti, aš papildomas skirsnyje apibrėžtos vartotojo debug Vars tvarkyti ... Mano derinimo struktūra pavadintas "_user_debug" ir "_user_debug_key,

Norėdami gauti daugiau informacijos apie tai, kaip įgyvendinti šią šioje temoje išvaizdą:
http://www.smarty.net/forums/viewtopic.php?p=31241 # 31.241

Priešingu atveju, jei nesate suinteresuotas, jis yra saugus, pašalinkite šį skyrių iš šablono. Taip pat galite pašalinti {jei} pareiškimą, aš wrap skyrių šabloną var.

Kitas dalykas, galbūt norėsite žaisti kiek simbolių yra išėjimas debug vertės. Ieškoti ir keisti antrą numerį pakeisti maksimalų chars produkciją: @ debug_print_var: 0:1000

PS Ar kas nors išsiaiškinti kodėl gaunu virš <h3>, vietos, dešiniajame langelyje?

Hope this helps, aš žinau, man patinka Šypsotis

PS Norint gauti visi JavaScript veikia teisingai, jums tik reikia pakeisti eilutę "var mynanopath =" ir įsitikinkite, kad jis nurodo savo visuomenės nanopath kataloge. Jūs galite žemyn nanotree paketas iš http://sourceforge.net/projects/nanotree/

Čia yra atnaujinama kodas

Kodas:
{*
Smarty Individualizuotos DHTML Derinimo Šablonas
@ Autorius Hielke Hoeve
@ Autorius. Owenas Cole <owenc ne ideamesh dot com>
@ Nuo 02/13/2006 Smarty 2.6.12
_AT_ Paketas Smarty
_AT_ Filename debug.tpl
*}

{Assign_debug_info}

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

jei (self.name == ") {ldelim}
var title = "Konsole";
{Rdelim}
kitas {ldelim}
var title = "Console_" + self.name;
{Rdelim}
_smarty_console = window.open ("", title.value width = 800, aukštis = 600, Maketus, Slinkties = taip ");
_smarty_console.document.write ("<html> <head> <title> Smarty Derinimo Console_ + self.name + <\ / pavadinimas> \ n");
_smarty_console.document.write ("<style> \ n");
_smarty_console.document.write (H3 {ldelim} padding: 5px 5px 5px 5px; marža: 0px 0px 0px 0px, background-color: # cccccc; {rdelim} \ n ");
_smarty_console.document.write (", # debugtreetable {ldelim} plotis: 100%; {rdelim} \ n");
_smarty_console.document.write (". # debugtreetable td {ldelim} siena: plonas kietas juodas; {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 ("* Reikalingas inicijuoti medį. \ n");
_smarty_console.document.write ("* Ir skambinti showTree imagepath), realiai parodyti medį \ n");
_smarty_console.document.write ("* Arba tai gali būti padaryta scenarijaus bloką puslapio apačioje. \ n");
_smarty_console.document.write ("* Nors šis metodas yra šiek tiek švaresnis. \ n");
_smarty_console.document.write ("* \ / \ n");
_smarty_console.document.write ("funkciją init () {ldelim} \ n");
_smarty_console.document.write ("konteineris = 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 ("* Kelia, kai vartotojas paspaudžia ant mazgas. \ n");
_smarty_console.document.write ("* @ param treeNode TreeNode objektas, kuris buvo paspaudėte \ 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 = (Parametras ==") treeNode.getName, ()? "<h3> '+ treeNode.getName () +" <\ / h3> <div> + + Parametras " <\ / 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 + vaizdai \ / folder_closed.gif ", \ n");
_smarty_console.document.write (var openGif = '+ mynanopath + vaizdai \ / folder_open.gif ", \ n");
_smarty_console.document.write (var pageIcon = '+ mynanopath + images \ / page16 × 16.gif ", \ n");
_smarty_console.document.write ("var userIcon =" "+ mynanopath + images \ / user_16 × 16.gif", \ n ");
_smarty_console.document.write (var helpIcon = '+ mynanopath + images \ / help_16 × 16.gif ", \ n");

{* Sukurti bazinę mazgas *}
{Priskirti var = skaitiklio vertė = 0}
_smarty_console.document.write ("rootNode = naujas TreeNode ({$ skaitiklis}" Smarty Debug "helpIcon" Tai Derinimo medis išstumia klasikinį Smarty Debug konsolės versiją. "); \ n");
{$ Skaitiklis + +}

{* Sukurti mazgas šabloną įeina *}
_smarty_console.document.write ("var mazgas {$ skaitiklis} = nauji TreeNode ({$ skaitiklis}," įtraukta šablonus ir config failus (krovimosi laikas sekundėmis): "pageIcon,");
_smarty_console.document.write ("<table width=\"100%\">");
{Section name = šablonai loop = $ _debug_tpls}
_smarty_console.document.write (: "<tr bgcolor={if %templates.index% yra even}#eeeeee{else}#fafafa{/if}> <td colspan=2> <tt> {section name = įtrauka kilpa = $ _debug_tpls [šablonai]. gylis} &&& {/ section} <font color = {jei $ _debug_tpls [šablonai]. tipas ekv "šablonas"} ruda {elseif $ _debug_tpls [šablonai]. tipas ekv. isset ($ _debug_tpls [šablonai] exec_time.)} <font Size=-1> <i> ({$ _debug_tpls [šablonai] exec_time | string_format: "% 0,5 f"}) {jei templates.index%% eq 0} (iš viso) {/ jeigu} <\ \ / i> <\ \ / font> {/ jeigu} <\ \ / tt> <\ \ / td> <\ \ / tr> ");
{Sectionelse}
_smarty_console.document.write ("<tr bgcolor=#eeeeee> <td colspan=2> <tt> <i> joks šablonas <\ \ / i> <\ \ / tt> <\ \ / td> <\ \ / tr> ");
{/ Section}
_smarty_console.document.write ("<\ \ / table>");
_smarty_console.document.write (""); \ n ");

_smarty_console.document.write ("rootNode.addChild (mazgas {$ kovos}); \ n");
{$ Skaitiklis + +}

{* Sukurti mazgas vartotojų debug kintamųjų *}
_smarty_console.document.write (var mazgas {$ skaitiklis} = nauji TreeNode ({$ skaitiklis}, vartotojo debug kintamieji: "new Array (closedGif, openGif)); \ n");
_smarty_console.document.write ("rootNode.addChild (mazgas {$ kovos}); \ n");
_smarty_console.document.write ("var tėvų = mazgas {$ skaitiklis}; \ n");
{$ Skaitiklis + +}

{* Susikurk vaikų mazgai vartotojų debug kintamųjų *}
{Skyriuje vardas = genofondo loop = $ _user_debug.}
_smarty_console.document.write ("var mazgas {$ skaitiklis} = nauji TreeNode ({$ skaitiklis} '{ldelim} $ {$ _user_debug_key [genofondo]} {rdelim}", pageIcon,' {$ _user_debug [genofondo] | @ debug_print_var: 0:1000 | pabėgti: JavaScript | pabėgti: "javascript"} '); \ n ");
_smarty_console.document.write ("parent.addChild (mazgas {$ kovos}); \ n");
{$ Skaitiklis + +}
{Sectionelse}
_smarty_console.document.write ("var mazgas {$ skaitiklis} = nauji TreeNode ({$ skaitiklis}," Ne Vartotojo priskiriamas derinimo informaciją ", HelpIcon); \ n");
_smarty_console.document.write ("parent.addChild (mazgas {$ kovos}); \ n");
{$ Skaitiklis + +}
{/ Section}

{* Susikurk mazgą už šablonų kintamuosiuose *}
_smarty_console.document.write (var mazgas {$ skaitiklis} = nauji TreeNode ({$ skaitiklis}, priskirti kintamieji šabloną: "new Array (closedGif, openGif)); \ n");
_smarty_console.document.write ("rootNode.addChild (mazgas {$ kovos}); \ n");
_smarty_console.document.write ("var tėvų = mazgas {$ skaitiklis}; \ n");
{$ Skaitiklis + +}

{* Sukurti vaikų mazgų šablono kintamuosius *}
{Section name = genofondo loop = $ _debug_keys}
{Jei $ _debug_keys [genofondo] = '_user_debug "&& $ _debug_keys [genofondo] =' _user_debug_key '}
_smarty_console.document.write ("var mazgas {$ skaitiklis} = nauji TreeNode ({$ skaitiklis} '{ldelim} $ {$ _debug_keys [genofondo]} {rdelim}", pageIcon' {$ _debug_vals [genofondo] | @ debug_print_var: 0:1000 | pabėgti: JavaScript | pabėgti: "javascript"} '); \ n ");
_smarty_console.document.write ("parent.addChild (mazgas {$ kovos}); \ n");
{$ Skaitiklis + +}
{/ If}
{Sectionelse}
_smarty_console.document.write ("var mazgas {$ skaitiklis} = nauji TreeNode ({$ skaitiklis}" Nėra šabloną kintamieji priskirti ", HelpIcon); \ n");
_smarty_console.document.write ("parent.addChild (mazgas {$ kovos}); \ n");
{$ Skaitiklis + +}
{/ Section}

{* Sukurti mazgas, Smarty konfigūracijos failo kintamųjų |}
_smarty_console.document.write ("var mazgas {$ skaitiklis} = nauji TreeNode ({$ skaitiklis}", priskirta config failų kintamųjų (išorinis šablonas taikymo sritis): "new Array (closedGif, openGif)); \ n");
_smarty_console.document.write ("rootNode.addChild (mazgas {$ kovos}); \ n");
_smarty_console.document.write ("var tėvų = mazgas {$ skaitiklis}; \ n");
{$ Skaitiklis + +}

{* Sukurti vaikų mazgų už Smarty config failų kintamųjų *}
{Pavadinimas skirsnyje. = Config_vars loop = $ _debug_config_keys}
_smarty_console.document.write ("var mazgas {$ skaitiklis} = nauji TreeNode ({$ skaitiklis} '{ldelim} $ {$ _debug_config_keys [config_vars]} {rdelim}", pageIcon' {$ _debug_config_vals [config_vars] | @ debug_print_var: 0:1000 | pabėgti: JavaScript | pabėgti: "javascript"} '); \ n ");
_smarty_console.document.write ("parent.addChild (mazgas {$ kovos}); \ n");
{$ Skaitiklis + +}
{Sectionelse}
_smarty_console.document.write ("var mazgas {$ skaitiklis} = nauji TreeNode ({$ skaitiklis}" nėra priskirtos "config kintamieji, HelpIcon); \ n");
_smarty_console.document.write ("parent.addChild (mazgas {$ kovos}); \ n");
{$ Skaitiklis + +}
{/ Section}

_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 & Vartotojo konsolė derinimo <\ / h3>");
_smarty_console.document.write ("<h4> Paspauskite ant medžio kintamųjų turi savo turinį, dešinėje pusėje skydelyje rodomi <\ / h4>");
_smarty_console.document.write ("<table border='0' id='debugtreetable'> <tr>");
_smarty_console.document.write ("<td valign='top' style='width: 250px;'> <div id='debugtreediv'> & <\ / div> <\ / td>");
_smarty_console.document.write ("<td valign='top'> <div id='debugtreetextdiv'> & <\ / td>");
_smarty_console.document.write ("<\ / tr> <\ / table>");
_smarty_console.document.write ("<\ / body> <\ / html>");
_smarty_console.document.close ();
</ Script>

Tags: ,
posted in Guides , programavimas pagal Owen

Sekite komentarus per RSS | Palikite komentarą | Trackback URL

Palikite komentarą

 
© 2008 - 2012 - All Rights Reserved - Ideamesh, Inc. 22 queries. 0.290 sek.