فبراير
13
2006

زقحان كيفية: جافا سكريبت قالب التصحيح

استكمال: حزمة التحميل هو متاح هنا: http://ideamesh.com/file/11/Smarty-Debug-with-Collapsible-Variables.html

هنا هو رمز المعدلة، والعمل، وعلى استعداد للذهاب ..

ها هي وصلة حيث يمكنك تحميل جافا سكريبت nanotree ...
http://nanotree.sourceforge.net/~~V

استبدال متغير لي {$} Site.framework_pub بشكل مناسب والتي يمكن تحميل جافا سكريبت والصور بشكل صحيح.

يرجى أيضا ملاحظة، اضفت في قسم لمعالجة فار التصحيح يحددها المستخدم ... يدعى هيكل بلدي التصحيح '_user_debug' و '_user_debug_key'

للمزيد من المعلومات حول كيفية تنفيذ هذه نظرة على هذا الموضوع:
http://www.smarty.net/forums/viewtopic.php؟p=31241 # 31241

وإلا إذا لم تكن مهتمة، وأنها آمنة لإزالة هذا الجزء من القالب. هل يمكن أيضا إزالة بيان {} إذا كنت التفاف قسم فار قالب.

آخر شيء قد ترغب في اللعب مع هو عدد الأحرف الناتج كقيمة التصحيح. ابحث عن هذا وتعديل عدد 2 لتغيير الانتاج حرف كحد أقصى: @ debug_print_var: 0:1000

هل PS أي شخص معرفة لماذا أنا على الحصول على الفضاء فوق <h3> في الخلية أليس كذلك؟

ويساعد هذا الأمل، وأنا أعلم أنا أحب ذلك ابتسامة

PS للحصول على كل جافا سكريبت يعمل بشكل صحيح تحتاج فقط لتعديل خط "فار mynanopath =" وتأكد من أنه يشير إلى الدليل nanopath العامة. يمكنك أسفل الحزمة nanotree من http://sourceforge.net/projects/nanotree/

هنا هو رمز المحدثة

رمز:
{*
زقحان تصحيح DHTML مخصص قالب
@ كاتب Hielke هوف
@ كاتب أوين كول <owenc في ideamesh نقطة com>
@ منذ 2006/2/13 هندى 2.6.12
@ حزمة هندى
@ اسم debug.tpl
*}

{assign_debug_info}

<SCRIPT language=javascript>
فار mynanopath = "{$ Site.javascript_path} \ / nanotree \ /"؛

إذا كان (self.name == ") {ldelim}
فار لقب = 'وحدة التحكم "؛
{rdelim}
آخر رد ldelim}
فار لقب = 'Console_' + self.name؛
{rdelim}
_smarty_console = window.open (""، title.value، "العرض = 800، الطول = 600، ثانية، أشرطة التمرير = نعم")؛
_smarty_console.document.write ("<HTML> <HEAD> <TITLE> هندى تصحيح Console_" + self.name + "<\ / عنوان> \ ن")؛
_smarty_console.document.write ("<style> \ ن")؛
_smarty_console.document.write ("H3 {} ldelim الحشو: 5PX 5PX 5PX 5PX؛ الهامش: 0px 0px 0px 0px؛ لون الخلفية: # CCCCCC؛ rdelim {} \ ن")؛
_smarty_console.document.write ("debugtreetable # {} ldelim عرض: 100٪؛ rdelim {} \ ن")؛
_smarty_console.document.write ("debugtreetable # TD {ldelim} الحدود: سوداء صلبة رقيقة؛ rdelim {} \ ن")؛
_smarty_console.document.write ("# debugtreetextdiv DIV {} ldelim الحشو اليسار: 10px؛ rdelim {} \ ن")؛
_smarty_console.document.write ("<\ / النمط> \ ن")؛
_smarty_console.document.write ("<script language=\"Javascript\" src=\"" + + mynanopath "nanotree.js\"> <\ / SCRIPT> \ ن")؛
_smarty_console.document.write ("<script type=\"text\/javascript\" language=\"JavaScript\"> \ ن")؛
_smarty_console.document.write ("<- \ ن!")؛
_smarty_console.document.write ("showRootNode = صحيح؛ \ ن")؛
_smarty_console.document.write ("sortNodes = 0؛ \ ن")؛
_smarty_console.document.write ("dragable = كاذبة؛ \ ن")؛
_smarty_console.document.write ("showAllNodesOnStartup = صحيح؛ \ ن")؛

_smarty_console.document.write ("\ / ** \ ن")؛
_smarty_console.document.write ("* مطلوب لتهيئة شجرة \ ن")؛
_smarty_console.document.write ("* والدعوة showTree (imagePath)؛. لاظهار الحقيقة شجرة \ ن")؛
_smarty_console.document.write ("* وبدلا من هذا يمكن القيام به في كتلة برنامج نصي في أسفل الصفحة \ ن")؛
_smarty_console.document.write ("* على الرغم من هذا الأسلوب هو أكثر نظافة نوعا ما \ ن")؛
_smarty_console.document.write ("* \ / \ ن")؛
_smarty_console.document.write ("وظيفة الحرف الأول () {ldelim} \ ن")؛
_smarty_console.document.write ("document.getElementById = حاوية ('debugtreediv')؛ \ ن")؛
_smarty_console.document.write ("showTree ('" + mynanopath + "')؛ \ ن")؛
_smarty_console.document.write ("{rdelim} \ ن")؛

_smarty_console.document.write ("\ / ** \ ن")؛
_smarty_console.document.write ("* يطلق عندما يقوم المستخدم بالنقر على عقدة \ ن")؛
_smarty_console.document.write ("* @ المعلمة treeNode الكائن TreeNode التي تم النقر \ ن")؛
_smarty_console.document.write ("* \ / \ ن")؛
_smarty_console.document.write ("وظيفة standardClick (treeNode) {ldelim} \ ن")؛
_smarty_console.document.write ("فار mytext = document.getElementById ('debugtreetextdiv')؛ \ ن")؛
_smarty_console.document.write ("فار المعلمة = treeNode.getParam ()؛ \ ن")؛
_smarty_console.document.write ("mytext.innerHTML = (المعلمة ==") treeNode.getName ():؟ <h3> '+ treeNode.getName () +' <\ / H3> <DIV> '+ + المعلمة' <\ / div> المصدر '؛ \ ن ")؛
_smarty_console.document.write ("{rdelim} \ ن")؛

_smarty_console.document.write ("nodeEdited وظيفة (treeNode) {ldelim} \ ن")؛
_smarty_console.document.write ("{rdelim} \ ن")؛

_smarty_console.document.write ("فار closedGif = '" + + mynanopath "صور \ / folder_closed.gif'؛ \ ن")؛
_smarty_console.document.write ("فار openGif = '" + + mynanopath "صور \ / folder_open.gif'؛ \ ن")؛
_smarty_console.document.write ("فار pageIcon = '" + + mynanopath "صور \ / page16 × 16.gif'؛ \ ن")؛
_smarty_console.document.write ("فار userIcon = '" + + mynanopath "صور \ / user_16 × 16.gif'؛ \ ن")؛
_smarty_console.document.write ("فار helpIcon = '" + + mynanopath "صور \ / help_16 × 16.gif'؛ \ ن")؛

{* إنشاء قاعدة العقدة *}
{تعيين فار = قيمة العداد = 0}
_smarty_console.document.write ("rootNode = جديد TreeNode ({$ عداد}، 'تصحيح هندى"، helpIcon، "وهذه هي شجرة التصحيح وهو يحل محل النسخة الكلاسيكية من وحدة التحكم تصحيح هندى.')؛ \ ن")؛
{$ عداد + +}

{* إنشاء عقدة قالب يتضمن *}
_smarty_console.document.write ("فار العقدة {$} = عداد جديد TreeNode ({$ عداد}، 'شملت قوالب وملفات التكوين (وقت التحميل في ثانية):'، pageIcon، '")؛
_smarty_console.document.write ("<table width=\"100٪\">")؛
{قسم اسم = قوالب حلقة = $ _debug_tpls}
_smarty_console.document.write ("<tr bgcolor={if ٪templates.index٪ هو even}#eeeeee{else}#fafafa{/if}> <td colspan=2> <tt> اسم القسم {= البادئة حلقة = $ _debug_tpls [قوالب]. &&& عمق} {/} قسم لون الخط <= {$ إذا _debug_tpls [قوالب]. نوع مكافئ "قالب"} {البني ELSEIF $ _debug_tpls [قوالب]. نوع مكافئ isset ($ _debug_tpls [قوالب] exec_time.)} <font size=-1> <I> ({$ _debug_tpls [قوالب] exec_time | string_format: "٪ 0،5 و"}) {إذا٪ templates.index مكافئ٪ 0} (الكل) {/ إذا} <\ \ / I> <\ \ / FONT> {/ إذا} <\ \ / TT> <\ \ / TD> <\ \ / TR> ")؛
{sectionelse}
_smarty_console.document.write ("<tr bgcolor=#eeeeee> <td colspan=2> <tt> <I> إدراج أي قوالب <\ \ / I> <\ \ / TT> <\ \ / TD> <\ \ / TR> ")؛
{/ قسم}
_smarty_console.document.write ("<\ \ / الجدول>")؛
_smarty_console.document.write ("')؛ \ ن")؛

_smarty_console.document.write ("rootNode.addChild (عقدة {$} عداد)؛ \ ن")؛
{$ عداد + +}

{* إنشاء العقدة للمتغيرات التصحيح المستخدم *}
_smarty_console.document.write ("فار العقدة {$} = عداد جديد TreeNode ({$ عداد}، 'التصحيح المستخدم المتغيرات:'، مجموعة جديدة (closedGif، openGif))؛ \ ن")؛
_smarty_console.document.write ("rootNode.addChild (عقدة {$} عداد)؛ \ ن")؛
_smarty_console.document.write ("فار الأم = العقدة {$ عداد}؛ \ ن")؛
{$ عداد + +}

{* إنشاء العقد التابعة للمتغيرات التصحيح المستخدم *}
{قسم اسم = فار حلقة = $ _user_debug}
_smarty_console.document.write ("فار العقدة {$} = عداد جديد TreeNode ({$ عداد}، '{ldelim} $ {$ _user_debug_key [فار]} {rdelim}'، pageIcon، '{$ _user_debug [فار] | @ debug_print_var: 0:1000 | الهروب: جافا سكريبت | الهروب: جافا سكريبت} ')؛ \ ن ")؛
_smarty_console.document.write ("parent.addChild (عقدة {$} عداد)؛ \ ن")؛
{$ عداد + +}
{sectionelse}
_smarty_console.document.write ("فار العقدة {$} = عداد جديد TreeNode ({$ عداد}، 'لا يوجد معلومات التصحيح العضو المعين"، HelpIcon)؛ \ ن ")؛
_smarty_console.document.write ("parent.addChild (عقدة {$} عداد)؛ \ ن")؛
{$ عداد + +}
{/ قسم}

{* إنشاء عقدة * متغيرات قالب}
_smarty_console.document.write ("فار العقدة {$} = عداد جديد TreeNode ({$ عداد}، 'المتغيرات قالب تعيينه:"، مجموعة جديدة (closedGif، openGif))؛ \ ن ")؛
_smarty_console.document.write ("rootNode.addChild (عقدة {$} عداد)؛ \ ن")؛
_smarty_console.document.write ("فار الأم = العقدة {$ عداد}؛ \ ن")؛
{$ عداد + +}

{* إنشاء العقد التابعة للمتغيرات قالب *}
{قسم اسم = فار حلقة = $ _debug_keys}
{إذا $ _debug_keys [فار]! = '_user_debug' && $ _debug_keys [فار]! = '_user_debug_key'}
_smarty_console.document.write ("فار العقدة {$} = عداد جديد TreeNode ({$ عداد}، '{ldelim} $ {$ _debug_keys [فار]} {rdelim}'، pageIcon، '{$ _debug_vals [فار] | @ debug_print_var: 0:1000 | الهروب: جافا سكريبت | الهروب: جافا سكريبت} ')؛ \ ن ")؛
_smarty_console.document.write ("parent.addChild (عقدة {$} عداد)؛ \ ن")؛
{$ عداد + +}
{/ إذا}
{sectionelse}
_smarty_console.document.write ("فار العقدة {$} = عداد جديد TreeNode ({$ عداد}، 'لا يوجد متغيرات قالب تعيين'، HelpIcon)؛ \ ن")؛
_smarty_console.document.write ("parent.addChild (عقدة {$} عداد)؛ \ ن")؛
{$ عداد + +}
{/ قسم}

{* إنشاء عقدة زقحان المتغيرات ملف التكوين *}
_smarty_console.document.write ("فار العقدة {$} = عداد جديد TreeNode ({$ عداد}، 'تعيين متغيرات ملف التكوين (الخارجي نطاق قالب):'، جديد صفيف (closedGif، openGif))؛ \ ن")؛
_smarty_console.document.write ("rootNode.addChild (عقدة {$} عداد)؛ \ ن")؛
_smarty_console.document.write ("فار الأم = العقدة {$ عداد}؛ \ ن")؛
{$ عداد + +}

{* إنشاء العقد التابعة للزقحان المتغيرات ملف التكوين *}
{قسم اسم = config_vars حلقة = $ _debug_config_keys}
_smarty_console.document.write ("فار العقدة {$} = عداد جديد TreeNode ({$ عداد}، '{ldelim} $ {$ _debug_config_keys [config_vars]} {rdelim}'، pageIcon، '{$ _debug_config_vals [config_vars] | @ debug_print_var: 0:1000 | الهروب: جافا سكريبت | الهروب: جافا سكريبت} ')؛ \ ن ")؛
_smarty_console.document.write ("parent.addChild (عقدة {$} عداد)؛ \ ن")؛
{$ عداد + +}
{sectionelse}
_smarty_console.document.write ("فار العقدة {$} = عداد جديد TreeNode ({$ عداد}، 'لا يوجد متغيرات التكوين المخصصة، HelpIcon)؛ \ ن")؛
_smarty_console.document.write ("parent.addChild (عقدة {$} عداد)؛ \ ن")؛
{$ عداد + +}
{/ قسم}

_smarty_console.document.write ("\ / \ / -> \ ن")؛
_smarty_console.document.write ("<\ / SCRIPT> \ ن \ ن")؛
_smarty_console.document.write ("<\ / HEAD> <body onload=\"init()\"> \ ن")؛
_smarty_console.document.write ("<h3> هندى وحدة تحكم العضو تصحيح <\ / H3>")؛
_smarty_console.document.write ("<h4> انقر على المتغيرات في شجرة أن يكون عرض محتوياتها في لوحة الجانب الأيمن <\ / H4>.")؛
_smarty_console.document.write ("<table border='0' id='debugtreetable'> <TR>")؛
_smarty_console.document.write ("valign='top' <td style='width: 250px؛'> <div id='debugtreediv'> & <\ / DIV> <\ / TD>")؛
_smarty_console.document.write ("<td valign='top'> <div id='debugtreetextdiv'> & <\ / TD>")؛
_smarty_console.document.write ("<\ / TR> <\ / الجدول>")؛
_smarty_console.document.write ("<\ / BODY> <\ / HTML>")؛
_smarty_console.document.close ()؛
</ SCRIPT>

العلامات: ،
نشرت في دليل ، برمجة بواسطة أوين

متابعة التعليقات عن طريق آر إس إس | اترك التعليق | URL المرجع

ترك تعليقك

 
© 2008 - 2012 - جميع الحقوق محفوظة - Ideamesh، وشركة 22 استفسار. 0،321 ثانية.