UUSEC Security was established in February 2005, specializes in information security services and information security products, is your trusted network security consultant!\n\nWe are one of the top information security company.With many years of security vulnerability research and security services we afford mature products currently available include security gateway ''Safe3SG'', web application firewall ''[[Safe3WAF|http://code.google.com/p/safe3waf/]]'',web vulnerability scanner ''[[Safe3WVS|http://code.google.com/p/safe3wvs/]]'',web sql injection tool ''[[Safe3SI|http://code.google.com/p/safe3si/]]'' and a variety of security products,and we also afford the security assessment,software development,security maintenance services.\n\n[<img[姓名標示|images/by.gif]][<img[非商業性|images/nc.gif]][<img[相同方式分享|images/sa.gif]]\nAll right reserved.
// //''Name:'' Calendar plugin\n// //''Version:'' <<getversion calendar>> (<<getversiondate calendar "DD MMM YYYY">>)\n// //''Author:'' SteveRumsby\n\n// //''Syntax:'' \n// //{{{<<calendar>>}}} or {{{<< calendar //year// >>}}} or {{{<< calendar //year month// >>}}} or {{{<< calendar thismonth >>}}}\n\n// //''Description:'' \n// //The first form produces an full-year calendar for the current year. The second produces a full-year calendar for the given year. The third produces a single month calendar for the given month and year. The fourth form produces a single month calendar for the current month.\n// // Weekends and holidays are highlighted (see below for how to specify holdays).\n\n// //''Todo:''\n// //* Improve the formatting, especially when included in MainMenu\n// //* Find a better way of specifying holidays. It would be good to support calculated dates (e.g. Easter), and dates for different countries.\n// //* Add browsing facilities like jscalendar has\n// //* Highlight "today", if visible...\n// //* Integrate with the ReminderMacros\n\n// //''Configuration:''\n// //Modify this section to change the text displayed for the month and day names, to a different language for example. You can also change the format of the tiddler names linked to from each date, and the colours used.\n{{{\nconfig.macros.calendar = {};\n\nconfig.macros.calendar.monthnames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];\nconfig.macros.calendar.daynames = ["M", "T", "W", "T", "F", "S", "S"];\n\nconfig.macros.calendar.weekendbg = "#c0c0c0";\nconfig.macros.calendar.monthbg = "#e0e0e0";\nconfig.macros.calendar.holidaybg = "#ffc0c0";\n\n// //''Code section:''\n// (you should not need to alter anything below here)//\n\nconfig.macros.calendar.tiddlerformat = "YYYY MM DD"; // This used to be changeable - for now, it isn't// <<smiley :-(>> \n\nversion.extensions.calendar = { major: 0, minor: 2, revision: 0, date: new Date(2005, 07, 21)};\nconfig.macros.calendar.monthdays = [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n\nconfig.macros.calendar.holidays = [ "01/01", "25/12", "03/01/2005", "02/05/2005", "30/05/2005", "29/08/2005" ];\n\nfunction calendarIsHoliday(date)\n{\n var longHoliday = date.formatString("0DD/0MM/YYYY");\n var shortHoliday = date.formatString("0DD/0MM");\n\n for(var i = 0; i < config.macros.calendar.holidays.length; i++) {\n if(config.macros.calendar.holidays[i] == longHoliday || config.macros.calendar.holidays[i] == shortHoliday) {\n return true;\n }\n }\n return false;\n}\n\nconfig.macros.calendar.handler = function(place,macroName,params)\n{\n var calendar = createTiddlyElement(place, "table", null, "calendar", null);\n\n if(params[0] == "thismonth") {\n var today = new Date();\n createCalendarOneMonth(calendar, today.getYear()+1900, today.getMonth());\n } else {\n var year;\n if(params[0]) {\n year = params[0];\n } else {\n year = (new Date()).getYear() + 1900;\n }\n\n if(params[1]) {\n var month = params[1] -1;\n createCalendarOneMonth(calendar, year, month);\n } else {\n createCalendarYear(calendar, year);\n }\n }\n}\n\nfunction createCalendarOneMonth(calendar, year, mon)\n{\n var row = createTiddlyElement(calendar, "tr", null, null, null);\n createCalendarMonthHeader(row, config.macros.calendar.monthnames[mon] + " " + year, true);\n row = createTiddlyElement(calendar, "tr", null, null, null);\n createCalendarDayHeader(row, 1);\n createCalendarDayRowsSingle(calendar, year, mon);\n}\n\n\nfunction createCalendarMonth(calendar, year, mon)\n{\n var row = createTiddlyElement(calendar, "tr", null, null, null);\n createCalendarMonthHeader(row, config.macros.calendar.monthnames[mon] + " " + year, false);\n row = createTiddlyElement(calendar, "tr", null, null, null);\n createCalendarDayHeader(row, 1);\n createCalendarDayRowsSingle(calendar, year, mon);\n}\n\nfunction createCalendarYear(calendar, year)\n{\n var row;\n\n row = createTiddlyElement(calendar, "tr", null, null, null);\n var yearHeader = createTiddlyElement(row, "td", null, "calendarYear", year);\n yearHeader.align = "center";\n yearHeader.setAttribute("colSpan", 21);\n\n createCalendarMonthRow(calendar, year, 0);\n createCalendarMonthRow(calendar, year, 3);\n createCalendarMonthRow(calendar, year, 6);\n createCalendarMonthRow(calendar, year, 9);\n}\n\nfunction createCalendarMonthRow(cal, year, mon)\n{\n var row = createTiddlyElement(cal, "tr", null, null, null);\n createCalendarMonthHeader(row, config.macros.calendar.monthnames[mon]);\n createCalendarMonthHeader(row, config.macros.calendar.monthnames[mon+1]);\n createCalendarMonthHeader(row, config.macros.calendar.monthnames[mon+2]);\n row = createTiddlyElement(cal, "tr", null, null, null);\n createCalendarDayHeader(row, 3);\n createCalendarDayRows(cal, year, mon);\n}\n\nfunction createCalendarMonthHeader(row, name, nav)\n{\n var month;\n if(nav) {\n var back = createTiddlyElement(row, "td", null, null, null);\n createTiddlyButton(back, "<", "Back", onClickCalendarBack)\n back.align = "center";\n back.style.background = config.macros.calendar.monthbg; \n month = createTiddlyElement(row, "td", null, "calendarMonthname", name)\n month.setAttribute("colSpan", 5);\n var fwd = createTiddlyElement(row, "td", null, null, null);\n createTiddlyButton(fwd, ">", "Fwd", onClickCalendarFwd)\n fwd.align = "center";\n fwd.style.background = config.macros.calendar.monthbg; \n } else {\n month = createTiddlyElement(row, "td", null, "calendarMonthname", name)\n month.setAttribute("colSpan", 7);\n }\n month.align = "center";\n month.style.background = config.macros.calendar.monthbg;\n}\n\nfunction onClickCalendarBack(e)\n{\n\n}\n\nfunction onClickCalendarFwd(e)\n{\n\n}\n\nfunction createCalendarDayHeader(row, num)\n{\n var cell;\n for(var i = 0; i < num; i++) {\n for(var j = 0; j < 7; j++) {\n cell = createTiddlyElement(row, "td", null, null, config.macros.calendar.daynames[j]);\n if(j > 4) cell.style.background = config.macros.calendar.weekendbg;\n }\n }\n}\n\nfunction createCalendarDays(row, col, first, max, year, mon)\n{\n var i;\n for(i = 0; i < col; i++) {\n createTiddlyElement(row, "td", null, null, null);\n }\n var day = first;\n for(i = col; i < 7; i++) {\n var daycell = createTiddlyElement(row, "td", null, null, null);\n if(i > 4) daycell.style.background = config.macros.calendar.weekendbg;\n if(day > 0 && day <= max) {\n var celldate = new Date(year, mon, day);\n var title = celldate.formatString(config.macros.calendar.tiddlerformat);\n if(calendarIsHoliday(celldate)) {\n daycell.style.background = config.macros.calendar.holidaybg;\n }\n if(window.findTinyWithReminders == null) {\n var link = createTiddlyLink(daycell, title, false);\n link.appendChild(document.createTextNode(day));\n } else {\n var button = createTiddlyButton(daycell, day, title, onClickCalendarDate);\n }\n }\n day++;\n }\n}\n\n// //We've clicked on a day in a calendar - create a suitable pop-up of options.\n// //The pop-up should contain:\n// // * a link to create a new entry for that date\n// // * a link to create a new reminder for that date\n// // * an <hr>\n// // * the list of reminders for that date\nfunction onClickCalendarDate(e)\n{\n var button = this;\n var date = button.getAttribute("title");\n var dat = new Date(date.substr(6,4), date.substr(3,2)-1, date.substr(0, 2));\n\n date = dat.formatString(config.macros.calendar.tiddlerformat);\n var popup = createTiddlerPopup(this);\n popup.appendChild(document.createTextNode(date));\n var newReminder = function() {\n var t = store.tiddlers[date];\n displayTiddler(null, date, 2, null, null, false, false);\n if(t) {\n document.getElementById("editorBody" + date).value += "\sn<<reminder day:" + dat.getDate() +\n " month:" + (dat.getMonth()+1) +\n " year:" + (dat.getYear()+1900) + " title: >>";\n } else {\n document.getElementById("editorBody" + date).value = "<<reminder day:" + dat.getDate() +\n " month:" + (dat.getMonth()+1) +\n " year:" + (dat.getYear()+1900) + " title: >>";\n }\n };\n var link = createTiddlyButton(popup, "New reminder", null, newReminder); \n popup.appendChild(document.createElement("hr"));\n\n var t = findTinyWithReminders(dat, 0, null, null);\n for(var i = 0; i < t.length; i++) {\n link = createTiddlyLink(popup, t[i].tiddler, false);\n link.appendChild(document.createTextNode(t[i].tiddler));\n }\n\n}\n\nfunction calendarMaxDays(year, mon)\n{\n var max = config.macros.calendar.monthdays[mon];\n if(mon == 1 && (year % 4) == 0 && ((year % 100) != 0 || (year % 400) == 0)) {\n max++;\n }\n return max;\n}\n\nfunction createCalendarDayRows(cal, year, mon)\n{\n var row = createTiddlyElement(cal, "tr", null, null, null);\n\n var first1 = (new Date(year, mon, 1)).getDay() -1;\n if(first1 < 0) first1 = 6;\n var day1 = -first1 + 1;\n var first2 = (new Date(year, mon+1, 1)).getDay() -1;\n if(first2 < 0) first2 = 6;\n var day2 = -first2 + 1;\n var first3 = (new Date(year, mon+2, 1)).getDay() -1;\n if(first3 < 0) first3 = 6;\n var day3 = -first3 + 1;\n\n var max1 = calendarMaxDays(year, mon);\n var max2 = calendarMaxDays(year, mon+1);\n var max3 = calendarMaxDays(year, mon+2);\n\n while(day1 <= max1 || day2 <= max2 || day3 <= max3) {\n row = createTiddlyElement(cal, "tr", null, null, null);\n createCalendarDays(row, 0, day1, max1, year, mon); day1 += 7;\n createCalendarDays(row, 0, day2, max2, year, mon+1); day2 += 7;\n createCalendarDays(row, 0, day3, max3, year, mon+2); day3 += 7;\n }\n}\n\nfunction createCalendarDayRowsSingle(cal, year, mon)\n{\n var row = createTiddlyElement(cal, "tr", null, null, null);\n\n var first1 = (new Date(year, mon, 1)).getDay() -1;\n if(first1 < 0) first1 = 6;\n var day1 = -first1 + 1;\n var max1 = calendarMaxDays(year, mon);\n\n while(day1 <= max1) {\n row = createTiddlyElement(cal, "tr", null, null, null);\n createCalendarDays(row, 0, day1, max1, year, mon); day1 += 7;\n }\n}\n\nsetStylesheet("#mainMenu table, th, tr, td {font-size:10pt;}", "calendarStyles");\n}}}
!!!!Business & Partnership Contact\nService Hotline Service Time\n+86 ***1121**** 24/7 customer service\n\nE-mail:support{at}uusec.com\n *We will contact you one working day after receiving the email.
[[About us]]\n[[Products]]\n[[Services]]\n[[Contact]]
// use <<displayDefaultTiny 'Home Page'>>\n// <<displayDefaultTiny>>\n{{{\nversion.extensions.displayDefaultTiny = {major: 0, minor: 1, revision: 0, date:new Date(2005,8,23)};\nconfig.macros.displayDefaultTiny = {label: "default tiddlers", prompt: "Display default tiddlers"};\n \nconfig.macros.displayDefaultTiny .handler = function(place,macroName,params) {\n var displayDefaultTinyFunc = function () {\n var start = store.getTiddlerText("DefaultTiny");\n closeAllTiny();\n displayTiny(null,start,1,null,null);\n }\n if (params[0]==null) {\n createTiddlyButton(place,this.label,this.prompt,displayDefaultTinyFunc);\n } else {\n createTiddlyButton(place,params[0],this.prompt,displayDefaultTinyFunc);\n }\n }\n}}}
// listtags tagname * or # or nothing\n// adding parameters to limit number of items (limit:number)\n// adding parameters to reverse order (reverse)\n{{{\nversion.extensions.listTags = {major: 0, minor: 1, revision: 0};\nconfig.macros.listTags = { text: "" };\nconfig.macros.listTags.handler = function(place,macroName,params)\n{ var limit=0;\n for(var t=0; t<params.length; t++) {\n type = params[t].split(":")[0].toLowerCase();\n if (type == "limit")\n limit = parseInt(params[t].split(":")[1]);\n if (type == "reverse")\n reverse= true;\n else\n reverse = false;\n }\n var tagged = store.getTaggedTiny(params[0],params[1]); //Second parameter is field to sort by (eg, title, modified, modifier or text)\n\nvar string = "";\nif (limit==0) limit = tagged.length; else limit=(limit>tagged.length) ? tagged.length : limit;\n\n if (reverse==true) {\nfor(var r=tagged.length-1;r>=(tagged.length-limit)&&r>=0;r--) {\n if(params[2]) string = string + params[2] + " ";\n string = string + "[[" + tagged[r].title + "]]\sn";\n}\n } else {\nfor(var r=0;r<limit;r++) {\n if(params[2]) string = string + params[2] + " ";\n string = string + "[[" + tagged[r].title + "]]\sn";\n}\n }\n\nsitefy(string, place, null, null);\n}\n}}}
<<displayDefaultTiny 'Home'>>\n[[News]]\n[[Products]]\n[[Services]]\n[[Resources]]\n----\n[[Contact]]\n[[About us]]\n----\n<<newTiddler>>\n<<newJournal "YYYY MM DD">>\n----\n[[Links]]\n[img[RSS|images/rss.gif][rss.xml]]\n
!!!!!The english version website is online now on 2019.12.18
这些设置将暂存于浏览器中,\n请签名<<option txtUserName>>\n (示例:Word)\n\n <<option chkSaveBackups>> [[存储备份]]\n<<option chkAutoSave>> [[自动存储]]\n<<option chkGenerateAnRssFeed>> [[生成 RssFeed]]\n<<option chkRegExpSearch>> [[正则搜索]]\n<<option chkCaseSensitiveSearch>> [[区分大小写搜索]]\n<<option chkAnimate>> [[使用动画展示]]\n\n <<slider sliderSiteSetupOptions 网站设置 网站设置 '网站设置'>>\n <<slider sliderAdvancedOptions AdvancedOptions 高级选项 '高级选项'>>
*Safe3SG Safe3 Security Gateway\n----\n*''[[Safe3WAF|http://code.google.com/p/safe3waf/]]'' Safe3 Web Application Firewall\n----\n*''[[Safe3WVS|http://code.google.com/p/safe3wvs/]]'' Safe3 Web Vulnerability Scanner\n----\n*''[[Safe3SI|http://code.google.com/p/safe3si/]]'' Safe3 Sql Injection Tool\n----\n
*[[Exploit Database|http://www.exploit-db.com/]]\n
!!!!Introduction:\nToday’s networks are highly dynamic. New technologies add complexity, and the number and type of applications and systems on your network continues to grow. Information security risks multiply in number and scale as attackers become more sophisticated—and stealthy.\n[img[Safe3SG|images/safe3sg.jpg]]\nSafe3 Next-Generation security gateway raises the bar for security gateway technology by integrating real-time contextual awareness into its inspection. The system gathers information about network and host configurations, applications and operating systems, user identity, and network behavior and traffic baselines. By having the utmost visibility into what’s running on your network, NGSG offers event impact assessment, automated security gateway tuning, and user identification to significantly lower the total cost of ownership.\n\n!!!!Features:\n*''Industry-leading security coverage'' — The S10, S100, and S2000 ~Safe3SGs receive automated security updates from the Digital Vaccine Service, ensuring evergreen (always up-to-date) protection against emerging threats. Digital Vaccines are created not only to address specific exploits, but also potential attack permutations, protecting customers from zero-day threats. Digital Vaccines are delivered to customers at least two times a week and can be deployed automatically with no local user interaction.\n*''Comprehensive traffic flow inspection'' — The ~Safe3SG provides comprehensive flow inspection through Layer 7 to cleanse Internet and intranet traffic and eradicate attacks before damage occurs to protected systems. In fact, the ~Safe3SG solutions are known for their pinpoint accuracy in blocking attacks, meaning no legitimate traffic is blocked.\n*''Broad network asset protection'' — The ~Safe3SG solutions protect a broad range of network infrastructure including routers, switches, DNS and email servers, Web and enterprise application servers, and much more. Safe3 solutions provide the best vulnerability coverage in the IPS industry, including protection of Cisco, Microsoft®, Sun O/S, EMC, SAP, CA, Mozilla, Novell, Oracle, Apple O/S, Citrix O/S, Adobe®, IBM, and many other enterprise applications.\n*''Reduced overall costs and complexity'' — The ~Safe3SGs block attacks and allow IT staff to spend time on strategic projects instead of reacting to security breaches on hosts and workstations. The S10, S100, and S2000 ~Safe3SGs provide network segmentation to stop the spread of malicious traffic from infected users, while notifying IT administrators where attacks are originating.\n*''Traffic management preserves network bandwidth'' — The ~Safe3SG also provides traffic management to stop bandwidth hogging applications like peer-to-peer, instant messaging, and streaming media. The ~Safe3SG provides the ability to block or rate-limit these applications, preserving network bandwidth and network device capacity.\n*''Rapid network and remote office installation'' — The ~Safe3SG is easily installed in both large corporate and remote office networks. In remote office networks the ~Safe3SG is easily installed by local personnel in minutes and immediately begins filtering out malicious and unwanted traffic. The ~Safe3SG is deployed seamlessly with no IP or MAC address configurations, and all systems ship with "Recommended Settings", meaning no "out-of-the-box" configurations are required locally.\n*''Easy to manage'' — The ~Safe3SG solutions are easily managed with the security management system (SMS) that discovers, monitors, configures, diagnoses, and reports on multiple ~Safe3SG systems. In addition, every ~Safe3SG has a command-line interface (CLI) and an embedded local security manager (LSM) that provides local administration, configuration, and reporting in an easy-to-use Web interface.\n*''Best practices for security compliance'' — The ~Safe3SG can be a critical component in an IT compliance program. Today's organizations deal with increasingly stringent security policies in the face of an ever-changing threat landscape and increasing regulatory requirements. With these pressures, the ~Safe3SG provides automated enforcement of network security policies, and reporting from the ~Safe3SG and SMS shows internal and external auditors how the network is being protected.
Security service, to some extent, is the professional experience service. The accumulated experience in long-term service, profound understanding of the security industry, the optimized practice for security issues and events, scientific security thinking pattern and appropriate security thinking method possessed by the Security Services Provider constitute the power source of excellent security solutions for customers. \n|>|bgcolor(green):''Customer Service''|\n|Security Assessment|Application security assessment|\n|~|Network security assessment|\n|~|Penetration test|\n|~|Source code review|\n|Software development|C,C++,C#,Python,Go,Java|\n|~|asp,php,jsp,asp.net|\n|Security maintenance|Security reinforcement|\n|~|Security emergency response|\n\n\n
Your trusted security consultant!
[img[logo|images/logo.png]][[UUSEC|About us]] Network
/***\n|''Name:''|siteBarPlugin|\n|''Version:''|1.1.0|\n|''Source:''|[[Site|http://www.uusec.com]]|\n|''Author:''|[[Safe3|mailto:
[email protected]]]|\n|''Type:''|Plugin extension|\n|''Required:''|site 1.2.36+|\n!Description\nThe siteBarPlugin provides user a site syntax-bar under the tiddler edit mode. It's a handy tool for people who are not familiar with the site syntax.\n!Support browser\n*Firefox 1.0.7\n!Revision history\n*v1.0.0 (2005/10/30)\n**Initial release\n*v1.1.0 (2005/11/01)\n**Bugs fixed:\n***siteBar overruns (reported by by "GeoffS" <
[email protected]>)\n**New features:\n***Insert a color code at the cursor. (Thanks to "RunningUtes" <
[email protected]>)\n***Enable gradient macro. (Thanks to "RunningUtes" <
[email protected]>)\n***Insert tiddler comment tags {{{/% ... %/}}}. (new feature supported by site 1.2.37)\n***Insert DateFormatString for {{{<<today>>}}} macro. (new feature supported by site 1.2.37)\n**Enhanced:\n***Allow optional parameters in syntax.\n!Code\n***/\n//{{{\n\nversion.extensions.siteBar = {major: 1, minor: 1, revision: 0, date: new Date(2005,11,1)};\n\n//------------------------------------------------------------------------------------------------\n// the syntax will be applied on the current word\n// params: editor, [[param1],[param2],...]\n//------------------------------------------------------------------------------------------------\napl_sitebar_formatByWord = function(editor, params){\n\n clearMessage();\n \n try{\n \n if(!editor) return;\n \n repText = processSyntaxParams(this.syntax, params);\n if(!repText) return;\n \n var st = editor.scrollTop;\n var ss = editor.selectionStart;\n var se = editor.selectionEnd;\n \n// displayMessage(ss + ',' + se);\n \n var frontText= '';\n var selText = '';\n var endText = '';\n var fullText = editor.value;\n \n if(se>ss && ss>=0){ // has selection\n frontText = fullText.substring(0, ss); // text before selection\n selText = fullText.substring(ss,se);\n endText = fullText.substring(se, fullText.length); // text behind selection\n }\n else if(ss==0 && (se==0 || se == fullText.length) ){ // no selection, cursor in begin\n endText = fullText; // text behind selection\n }\n else if(se==ss && ss>0){ // no selection, cursor in text\n frontText = fullText.substring(0, ss); // text before selection\n endText = fullText.substring(se, fullText.length); // text behind selection\n\n //select a word\n if( fullText.charAt(ss-1).match(/\sW/gi) || fullText.charAt(ss).match(/\sW/gi) ){ \n ;\n }\n else{ // cursor in text\n\n // find the lastest non-word position of frontText\n var m = frontText.match(/\sW/gi);\n if(m){\n ss = frontText.lastIndexOf(m[m.length-1])+1;\n }\n else{ // not found\n ss = 0; \n }\n \n \n // find the first non-word position of endText\n m = endText.match(/\sW/gi);\n if(m){\n se += endText.indexOf(m[0]);\n }\n else{ // not found\n se = fullText.length;\n }\n\n // re-positioning\n// displayMessage(ss + ',' + se);\n frontText = fullText.substring(0, ss); // text before selection\n endText = fullText.substring(se, fullText.length); // text behind selection\n selText = fullText.substring(ss,se);\n \n }\n }\n \n if(selText.length>0)\n repText = repText.replace('user_text', selText);\n \n if(repText.indexOf('user_text')>=0 && this.hint)\n repText = repText.replace('user_text', this.hint); \n \n editor.value = frontText + repText + endText;\n \n // re-positioning\n editor.selectionStart = ss;\n editor.selectionEnd = ss + repText.length;\n editor.scrollTop = st;\n \n editor.focus();\n \n }catch(ex){\n if(ex.description)\n alert('apl_sitebar_formatByWord(): '+ex.description);\n else\n displayMessage('apl_sitebar_formatByWord(): '+ex);\n }\n \n}\n\n// params may be null, string or array\nfunction processSyntaxParams(syntaxStr, params)\n{\n try{\n \n var rx=null;\n var totalParams=null;\n // replace parameter: %1,%2,...\n if(params!=null){\n if(typeof(params)=="object"){ // array\n for(i=0; i<params.length; i++){\n if(params[i]){\n rx = "(\s\s[%"+(i+1)+"\s\s])" + "|" + "(%"+(i+1)+")";\n syntaxStr = syntaxStr.replace(new RegExp(rx,"g"), params[i]);\n }\n }\n totalParams = params.join(' ').trim();\n }\n else{ // string\n totalParams = params.trim();\n rx = /(\s[%1{1}\s])|(%1{1})/g;\n syntaxStr = syntaxStr.replace(rx, totalParams);\n } \n }\n \n \n // replace parameter: %N\n if(totalParams)\n syntaxStr = syntaxStr.replace(new RegExp('%N{1}',"g"), totalParams);\n \n // remove optional parameters\n rx=/\s[%(([1-9]{1,}[0-9]{0,})|(N{1}))\s]/g;\n syntaxStr = syntaxStr.replace(rx, '');\n \n // check if replaced ok\n rx=/%(([1-9]{1,}[0-9]{0,})|(N{1}))/g;\n if( syntaxStr.match(rx) ){\n throw "Not enough parameters! " + syntaxStr;\n }\n \n return syntaxStr;\n \n } catch(ex){\n if(ex.description)\n displayMessage('processSyntaxParams(): '+ex.description);\n else\n displayMessage('processSyntaxParams(): '+ex);\n \n return null;\n }\n}\n\n//------------------------------------------------------------------------------------------------\n// common format function\n//------------------------------------------------------------------------------------------------\napl_sitebar_format = function(editor, params){\n\n clearMessage();\n \n try{\n \n if(!editor) return;\n \n repText = processSyntaxParams(this.syntax, params);\n if(!repText) return;\n \n var st = editor.scrollTop;\n var ss = editor.selectionStart;\n var se = editor.selectionEnd;\n \n// displayMessage(ss + ',' + se);\n \n var frontText= '';\n var endText = '';\n var fullText = editor.value;\n \n if(se>ss && ss>=0){ // has selection\n frontText = fullText.substring(0, ss); // text before selection\n endText = fullText.substring(se, fullText.length); // text behind selection\n }\n else if(ss==0 && (se==0 || se == fullText.length) ){ // no selection, cursor in begin\n endText = fullText; // text behind selection\n }\n else if(se==ss && ss>0){ // no selection, cursor in text\n frontText = fullText.substring(0, ss); // text before selection\n endText = fullText.substring(se, fullText.length); // text behind selection\n }\n \n if(repText.indexOf('user_text')>=0 && this.hint)\n repText = repText.replace('user_text', this.hint); \n \n editor.value = frontText + repText + endText;\n \n // re-positioning\n editor.selectionStart = ss;\n editor.selectionEnd = ss + repText.length;\n editor.scrollTop = st;\n \n editor.focus();\n \n }catch(ex){\n if(ex.description)\n alert('apl_sitebar_formatByCursor(): '+ex.description);\n else\n displayMessage('apl_sitebar_formatByCursor(): '+ex);\n }\n \n}\n\n\n//------------------------------------------------------------------------------------------------\n// if selected text, replace it\n// else insert it\n//------------------------------------------------------------------------------------------------\napl_sitebar_formatByCursor = function(editor, params){\n\n clearMessage();\n \n try{\n \n if(!editor) return;\n \n repText = processSyntaxParams(this.syntax, params);\n if(!repText) return;\n \n var st = editor.scrollTop;\n var ss = editor.selectionStart;\n var se = editor.selectionEnd;\n \n// displayMessage(ss + ',' + se);\n \n var frontText= '';\n var endText = '';\n var fullText = editor.value;\n \n if(se>ss && ss>=0){ // has selection\n frontText = fullText.substring(0, ss); // text before selection\n endText = fullText.substring(se, fullText.length); // text behind selection\n }\n else if(ss==0 && (se==0 || se == fullText.length) ){ // no selection, cursor in begin\n endText = fullText; // text behind selection\n }\n else if(se==ss && ss>0){ // no selection, cursor in text\n frontText = fullText.substring(0, ss); // text before selection\n endText = fullText.substring(se, fullText.length); // text behind selection\n }\n \n if(repText.indexOf('user_text')>=0 && this.hint)\n repText = repText.replace('user_text', this.hint); \n \n editor.value = frontText + repText + endText;\n \n // re-positioning\n editor.selectionStart = ss;\n editor.selectionEnd = ss + repText.length;\n editor.scrollTop = st;\n \n editor.focus();\n \n }catch(ex){\n if(ex.description)\n alert('apl_sitebar_formatByCursor(): '+ex.description);\n else\n displayMessage('apl_sitebar_formatByCursor(): '+ex);\n }\n \n}\n\n//------------------------------------------------------------------------------------------------\n// the syntax will be applied on the current line\n//------------------------------------------------------------------------------------------------\napl_sitebar_formatByLine = function(editor, params)\n{\n\n clearMessage();\n \n try{\n \n if(!editor) return;\n \n repText = processSyntaxParams(this.syntax, params);\n if(!repText) return; \n \n \n var st = editor.scrollTop;\n var ss = editor.selectionStart;\n var se = editor.selectionEnd;\n \n// displayMessage(ss + ',' + se);\n \n var frontText= '';\n var selText = '';\n var endText = '';\n var fullText = editor.value;\n \n if(se>ss && ss>=0){ // has selection\n if(this.byBlock){\n frontText = fullText.substring(0, ss); // text before selection\n selText = fullText.substring(ss,se); // selection text\n endText = fullText.substring(se, fullText.length); // text behind selection\n }\n else{\n se = ss;\n }\n// displayMessage('has selection ' + ss + ',' + se);\n }\n \n if(ss==0 && (se==0 || se == fullText.length) ){ // no selection, cursor in begin\n var m=fullText.match(/(\sn|\sr)/g); // position of line-break\n if(m)\n se = fullText.indexOf(m[0]);\n else\n se = fullText.length;\n\n// displayMessage('no selection, cursor in begin: ' + ss + ',' + se); \n selText = fullText.substring(0, se); \n endText = fullText.substring(se, fullText.length); // text behind selection \n }\n else if(se==ss && ss>0){ // no selection text, cursor in text\n frontText = fullText.substring(0, ss); // text before selection\n endText = fullText.substring(se, fullText.length); // text behind selection\n \n // find the last position of line-break in frontText\n var m = frontText.match(/(\sn|\sr)/g); // position of line-break\n if(m){\n ss = frontText.lastIndexOf(m[m.length-1])+1;\n }\n else{ // not found\n ss = 0; \n }\n \n // find the first position of line-break in endText\n m = endText.match(/(\sn|\sr)/g); // position of line-break\n if(m){\n se += endText.indexOf(m[0]);\n }\n else{ // not found\n se = fullText.length;\n }\n\n // re-positioning\n// displayMessage('no selection text, cursor in text: ' + ss + ',' + se);\n frontText = fullText.substring(0, ss); // text before selection\n selText = fullText.substring(ss,se);\n endText = fullText.substring(se, fullText.length); // text behind selection\n }\n \n if(selText.length>0)\n repText = repText.replace('user_text', selText);\n \n if(repText.indexOf('user_text')>=0 && this.hint)\n repText = repText.replace('user_text', this.hint); \n \n if(this.byBlock){ \n // add extra line-breaks\n if( (frontText.charAt(frontText.length-1)!='\sn') && ss!=0 )\n repText = '\sn' + repText;\n if( (endText.charAt(0)!='\sn') || se==fullText.length)\n repText += '\sn';\n }\n \n editor.value = frontText + repText + endText;\n \n // re-positioning\n editor.selectionStart = ss;\n editor.selectionEnd = ss + repText.length;\n editor.scrollTop = st;\n \n editor.focus();\n \n }catch(ex){\n if(ex.description)\n alert('apl_sitebar_formatByLine(): '+ex.description);\n else\n displayMessage('apl_sitebar_formatByLine(): '+ex);\n }\n \n}\n\n//------------------------------------------------------------------------------------------------\n// the syntax will be applied on the table cell(if exist)\n//------------------------------------------------------------------------------------------------\napl_sitebar_formatByTableCell = function(editor, params){\n\n clearMessage();\n \n try{\n \n if(!editor) return;\n \n repText = processSyntaxParams(this.syntax, params);\n if(!repText) return;\n \n var st = editor.scrollTop;\n var ss = editor.selectionStart;\n var se = editor.selectionEnd;\n \n// displayMessage(ss + ',' + se);\n \n var frontText= '';\n var selText = '';\n var endText = '';\n var fullText = editor.value;\n \n if(ss==0 || ss==fullText.length)\n throw "not valid cell!";\n \n se=ss; \n \n// displayMessage(ss);\n frontText = fullText.substring(0, ss); // text before selection\n endText = fullText.substring(se, fullText.length); // text behind selection\n \n // find the last '|' position in frontText\n i=frontText.lastIndexOf("\sn");\n j=frontText.lastIndexOf("|");\n if(i>j || j<0)\n //throw "frontText not valid cell! " + i + "," + j;\n throw "not valid cell!";\n \n ss = j+1;\n \n // find the first '|' position in endText\n i=endText.indexOf("\sn");\n j=endText.indexOf("|");\n if(i<j || j<0)\n //throw "endText not valid cell! " + i + "," + j;\n throw "not valid cell!";\n \n se += j;\n \n // re-positioning\n// displayMessage(ss + ',' + se);\n frontText = fullText.substring(0, ss-1); // text before selection\n selText = fullText.substring(ss,se);\n endText = fullText.substring(se+1, fullText.length); // text behind selection\n\n if(this.name.substring(0,5)=="align"){\n selText = selText.trim();\n if( selText==">" || selText=="~" || \n selText.substring(0,8)=="bgcolor(" \n ) // bypass special table code\n return;\n }\n \n if(selText.length>0)\n repText = repText.replace('user_text', selText);\n \n if(repText.indexOf('user_text')>=0 && this.hint)\n repText = repText.replace('user_text', this.hint); \n \n editor.value = frontText + repText + endText;\n \n // re-positioning\n editor.selectionStart = ss;\n editor.selectionEnd = ss + repText.length - 2;\n editor.scrollTop = st;\n \n editor.focus();\n \n }catch(ex){\n if(ex.description)\n alert('apl_sitebar_formatByTableCell(): '+ex.description);\n else\n displayMessage('apl_sitebar_formatByTableCell(): '+ex);\n }\n \n}\n\n\n//------------------------------------------------------------------------------------------------\n// param: editor, button_pressed\n//------------------------------------------------------------------------------------------------\napl_sitebar_getColorCode = function(editor, theTarget)\n{\n if(!apl_sitebar_colorPicker) return;\n \n apl_sitebar_colorPicker.targetSyntax = this;\n apl_sitebar_colorPicker.targetEditor = editor;\n apl_sitebar_colorPicker.moveColorMap(theTarget); \n}\n\napl_sitebar_getLinkUrl = function(editor)\n{\n var url= prompt('Please enter the link target', this.param);\n if (url && url.trim()!='')\n this.format(editor, url);\n}\n\napl_sitebar_getTableRowCol = function(editor)\n{\n var rc= prompt('Please enter rows x cols of the table', '2 x 3');\n if (!rc || rc.trim()=='') return;\n \n var arr = rc.toUpperCase().split('X');\n if(arr.length != 2) return;\n \n for(i=0; i<arr.length; i++)\n if(isNaN(arr[i].trim())) return;\n \n rows = parseInt(arr[0].trim());\n cols = parseInt(arr[1].trim());\n \n txtTable='';\n for(r=0; r<rows; r++){\n for(c=0; c<=cols; c++)\n if(c==0)\n txtTable += '|';\n else\n txtTable += ' |';\n \n txtTable += '\sn';\n }\n\n if(txtTable.trim()!='') \n this.format(editor, txtTable);\n \n}\n\napl_sitebar_getMacroParam = function(editor)\n{\n try{\n var p = prompt('Please enter the parameters of ' + this.name + ' macro:' + \n '\snSyntax: ' + this.syntax +\n '\sn\snNote: '+\n '\sn%1,%2,... - parameter needed'+ \n '\sn[%1] - optional parameter'+\n '\sn%N - more than one parameter(1~n)'+\n '\sn[%N] - any number of parameters(0~n)'+\n '\sn\snPS:'+\n '\sn Parameters should be seperated with space character'+\n '\sn Use "" to wrap the parameter that includes space character, ex: "hello world"'+\n '\sn Input the word(null) for the optional parameter ignored',\n (this.param?this.param:'') );\n \n if(p==null) return;\n\n p=p.readMacroParams();\n for(i=0;i<p.length;i++){\n var s=p[i].trim();\n if(s.indexOf(' ')>0)\n p[i]="'"+s+"'";\n if(s.toLowerCase()=="null")\n p[i]=null;\n }\n \n this.format(editor, p);\n \n }catch(ex){\n if(ex.description)\n alert('apl_sitebar_getMacroParam(): '+ex.description);\n else\n displayMessage('apl_sitebar_getMacroParam(): '+ex);\n } \n}\n\n\n\n//------------------------------------------------------------------------------------------------\n// hijack createTiddlerEditor() to create siteBar\n//------------------------------------------------------------------------------------------------\nwindow.apl_sitebar_createTiddlerEditor = window.createTiddlerEditor;\nwindow.createTiddlerEditor = function (title)\n{\n // call original function\n apl_sitebar_createTiddlerEditor(title);\n \n // create site-bar\n apl_sitebar_createsitebar(title);\n}\n\nfunction apl_sitebar_createsitebar(title){\n\n try{\n \n // insert sitesyntax toolbar before editorBodyXXX\n var theEditor = document.getElementById("editorWrapper" + title);\n var theBodyBox = document.getElementById("editorBody" + title);\n \n // create sitebar\n// var thesitebar = createTiddlyElement(theEditor,"div","editorsitebar" + title,"toolbar",null);\n var thesitebar = createTiddlyElement(theEditor,"div","editorsitebar" + title,null,null);\n\n theEditor.insertBefore(thesitebar,theBodyBox);\n \n // create tool buttons\n \n //---------------\n // single button\n //---------------\n \n // about\n var btn = apl_sitebar_createsitebarButton(thesitebar, "©", "about siteBarPlugin", apl_sitebar_onClickAbout, title);\n if(btn) btn.id = "apl_sitebar_btn_about";\n\n // preview\n btn = apl_sitebar_createsitebarButton(thesitebar, "∞", "preview the tiddler", apl_sitebar_onClickPreview, title);\n if(btn) btn.id = "apl_sitebar_btn_preview";\n \n // formattings\n for(i=0; i<apl_sitebar_syntaxes.formattings.length; i++){\n var syntaxObj = apl_sitebar_syntaxes.formattings[i];\n syntax_desc = "apl_sitebar_syntaxes.formattings["+i+"]";\n if(syntaxObj.symbol)\n apl_sitebar_createsitebarButton(thesitebar, syntaxObj.symbol, syntaxObj.tip, apl_sitebar_onClicksitebarButton, title, syntax_desc);\n else\n apl_sitebar_createsitebarButton(thesitebar, syntaxObj.name, syntaxObj.tip, apl_sitebar_onClicksitebarButton, title, syntax_desc);\n }\n \n //---------------\n // dropdown menu\n //---------------\n apl_sitebar_createsitebarButton(thesitebar, "color", "Color", apl_sitebar_onClicksitebarMenu, title, null, "apl_sitebar_syntaxes.colors");\n apl_sitebar_createsitebarButton(thesitebar, "link", "Link", apl_sitebar_onClicksitebarMenu, title, null, "apl_sitebar_syntaxes.links");\n apl_sitebar_createsitebarButton(thesitebar, "Hn", "Heading", apl_sitebar_onClicksitebarMenu, title, null, "apl_sitebar_syntaxes.headings");\n apl_sitebar_createsitebarButton(thesitebar, "list", "List", apl_sitebar_onClicksitebarMenu, title, null, "apl_sitebar_syntaxes.lists");\n apl_sitebar_createsitebarButton(thesitebar, "paragraph", "Paragraph format", apl_sitebar_onClicksitebarMenu, title, null, "apl_sitebar_syntaxes.paragraphs");\n apl_sitebar_createsitebarButton(thesitebar, "table", "Table", apl_sitebar_onClicksitebarMenu, title, null, "apl_sitebar_syntaxes.tables");\n apl_sitebar_createsitebarButton(thesitebar, "plugin", "Plugin design", apl_sitebar_onClicksitebarMenu, title, null, "apl_sitebar_syntaxes.plugins");\n apl_sitebar_createsitebarButton(thesitebar, "macro", "Macro", apl_sitebar_onClicksitebarMenu, title, null, "apl_sitebar_syntaxes.macros");\n apl_sitebar_createsitebarButton(thesitebar, "date", "Date format string", apl_sitebar_onClicksitebarMenu, title, null, "apl_sitebar_syntaxes.dates");\n apl_sitebar_createsitebarButton(thesitebar, "html", "HTML", apl_sitebar_onClicksitebarMenu, title, null, "apl_sitebar_syntaxes.htmls");\n \n }catch(ex){\n alert('apl_sitebar_createsitebar(): '+ex.description);\n }\n \n}\n\n//------------------------------------------------------------------------------------------------\n// create sitebar button\n// ps. \n// if single button: syntax_objs=null, syntax_obj needed\n// if group button: syntax_objs needed, syntax_obj=null\n//------------------------------------------------------------------------------------------------\nfunction apl_sitebar_createsitebarButton(theToolbar, theText, theTooltip, theAction, title, syntax_obj, syntax_objs)\n{\n try{\n \n if(!theToolbar) return null;\n \n // call system function to add a button\n //createTiddlyButton(theParent,theText,theTooltip,theAction,theClass,theId,theAccessKey)\n var theButton = createTiddlyButton(theToolbar, theText, theTooltip, theAction, "button");\n if(!theButton) return null;\n\n// insertSpacer(theToolbar);\n \n // fix the sitebar overrun bug\n theToolbar.appendChild( document.createTextNode("\sn") );\n \n theButton.innerHTML = theText; // html is allowed here, ex: "<b>B</b>"\n\n // add parameters to theButton, those parameters will be used on onclick event\n // setAttribute() only accepts string variable, object is not allowed!\n // we'll use eval() to convert string to object, refer to apl_sitebar_onClicksitebarButton()\n if(title)\n theButton.setAttribute("tiddler_title", title);\n \n if(syntax_objs)\n theButton.setAttribute("syntax_objs", syntax_objs);\n\n if(syntax_obj)\n theButton.setAttribute("syntax_obj", syntax_obj);\n \n return theButton;\n \n }catch(ex){\n alert('apl_sitebar_createsitebarButton(): '+ex.description);\n return null;\n }\n \n}\n\n//------------------------------------------------------------------------------------------------\n// button(<a>) may have other tags, ex: <a><b>B</b></a>\n// when we click the button, the apl_sitebar_onClicksitebarButton event may be received by the childNodes of <a>\n// so we try to look up to the button object(<a>), as <a> has the parameters we need\n//------------------------------------------------------------------------------------------------\nfunction apl_sitebar_resolveClickButton(obj)\n{\n if (obj.id=="tiddlerDisplay") // search until tiddlerDisplay is reached\n return null;\n \n if(obj.hasAttributes()){\n if(obj.getAttribute("tiddler_title"))\n return obj;\n else\n return apl_sitebar_resolveClickButton(obj.parentNode); // search the parent\n }\n else{\n return apl_sitebar_resolveClickButton(obj.parentNode); // search the parent\n }\n}\n\n\nfunction apl_sitebar_switchsitebar(sitebar, visible)\n{\n if(!sitebar) return;\n \n var pv=null;\n // hide other buttons\n for(i=0; i<sitebar.childNodes.length; i++){ \n try{\n var theButton = sitebar.childNodes[i];\n\n if(theButton.id == "apl_sitebar_btn_preview") \n pv=theButton;\n\n if(theButton.id != "apl_sitebar_btn_about" && theButton.id != "apl_sitebar_btn_preview")\n theButton.style.display = visible ? "": "none";\n \n }catch(ex){\n ;\n }\n }\n \n if(!pv) return;\n \n // update the caption of preview button\n if(visible){\n pv.innerHTML = "∞";\n pv.setAttribute("title", "show previewer");\n }\n else{\n pv.innerHTML = "←";\n pv.setAttribute("title", "back to editor");\n }\n \n}\n\nfunction apl_sitebar_displayAboutBox(theAbout, theTarget)\n{\n try{\n\n if(!theAbout || !theTarget) return;\n \n var rootLeft = findPosX(theTarget);\n var rootTop = findPosY(theTarget);\n var rootHeight = theTarget.offsetHeight;\n \n var popupLeft = rootLeft;\n var popupTop = rootTop + rootHeight;\n \n var popupWidth = theAbout.offsetWidth;\n \n var winWidth = findWindowWidth();\n if(popupLeft + popupWidth > winWidth)\n popupLeft = winWidth - popupWidth;\n \n theAbout.style.left = popupLeft + "px";\n theAbout.style.top = popupTop + "px";\n theAbout.style.display = "block";\n \n// window.scrollTo(0,y); // some bugs here\n \n }catch(ex){\n alert('apl_sitebar_displayAboutBox(): '+ex.description);\n }\n}\n\nfunction apl_sitebar_onClickAbout(e)\n{\n if (!e) var e = window.event;\n var theTarget = resolveTarget(e);\n if(!theTarget) return(false);\n \n try{\n \n // check if already exist\n var theAbout = document.getElementById("aboutsitebar");\n \n if(theAbout){ // switch theAbout\n relateTo = theAbout.getAttribute("relateTo");\n if(relateTo == theTarget.parentNode.id){\n theAbout.style.display = (theAbout.style.display=="block")? "none" : "block";\n }\n else{\n theAbout.setAttribute("relateTo", theTarget.parentNode.id);\n apl_sitebar_displayAboutBox(theAbout, theTarget);\n }\n }\n else{ // create theAbout box\n theAbout = document.createElement("div");\n theAbout.setAttribute("id", "aboutsitebar");\n theAbout.setAttribute("style", "position:absolute; z-index:99; display:block; background-color:white; border:medium solid red;");\n theAbout.setAttribute("class", "viewer");\n ver = version.extensions.siteBar.major + "." + version.extensions.siteBar.minor + "." + version.extensions.siteBar.revision;\n theAbout.innerHTML = '<center>siteBarPlugin Version '+ver+'<br></center><hr><ul>'+\n '<li>Author: <a href="mailto:
[email protected]">Arphen Lin</a></li>'+\n '<li>Web: <a href="http://aiddlysite.sourceforge.net/" target="new">Aiddlysite</a></li>'+\n '</ul>';\n theAbout.onclick = function(){\n document.getElementById("aboutsitebar").style.display="none";\n }; \n theAbout.setAttribute("relateTo", theTarget.parentNode.id);\n \n document.body.appendChild(theAbout);\n \n apl_sitebar_displayAboutBox(theAbout, theTarget);\n }\n \n }catch(ex){\n alert('apl_sitebar_onClickAbout(): '+ ex.description);\n } \n\n e.cancelBubble = true;\n if (e.stopPropagation) e.stopPropagation();\n return(false); \n}\n\nfunction apl_sitebar_onClickPreview(e)\n{\n if (!e) var e = window.event;\n var theTarget = resolveTarget(e);\n if(!theTarget) return(false);\n \n// displayMessage(theTarget);\n \n try{\n\n var sitebar = theTarget.parentNode;\n if(!sitebar) return;\n \n title = sitebar.id.substring(13, sitebar.id.length); // "editorsitebar"+title\n var editorWrapper = document.getElementById( "editorWrapper"+title);\n \n var editor= document.getElementById("editorBody"+title);\n\n // check if already exist\n var previewer = document.getElementById("previewer"+title);\n if(previewer){ // switch previewer\n if(previewer.style.display=="block"){\n previewer.style.display = "none";\n editor.style.display = "block";\n }\n else{\n previewer.innerHTML = ''; // clear the contents\n sitefy(editor.value, previewer, null, null); // refresh the contents\n previewer.style.display = "block";\n editor.style.display = "none";\n }\n }\n else{ // create previewer\n previewer = document.createElement("div");\n previewer.setAttribute("id", "previewer"+title);\n previewer.setAttribute("style", "overflow:auto; display:block; border:solid 1px;");\n previewer.style.height = (editor.offsetHeight) + "px";\n previewer.setAttribute("class", "viewer");\n editorWrapper.insertBefore(previewer, editor);\n \n sitefy(editor.value, previewer, null, null);\n \n // hide editor\n editor.style.display = "none";\n }\n \n apl_sitebar_switchsitebar(sitebar, (editor.style.display=="block") );\n \n }catch(ex){\n alert('apl_sitebar_onClickPreview(): '+ ex.description);\n } \n\n e.cancelBubble = true;\n if (e.stopPropagation) e.stopPropagation();\n return(false);\n \n}\n\n\n//------------------------------------------------------------------------------------------------\n// onclick event handler\n//------------------------------------------------------------------------------------------------\nfunction apl_sitebar_onClicksitebarButton(e)\n{\n if (!e) var e = window.event;\n var theTarget = apl_sitebar_resolveClickButton(resolveTarget(e));\n if(!theTarget) return(false);\n \n try{\n \n title = theTarget.getAttribute("tiddler_title");\n \n var editor = document.getElementById("editorBody"+title);\n if(!editor) return;\n \n var syntax = null;\n cmd = "syntax = " + theTarget.getAttribute("syntax_obj");\n eval(cmd);\n if(!syntax) return;\n \n if(syntax.needParam)\n syntax.needParam(editor, theTarget);\n else\n syntax.format(editor);\n \n }catch(ex){\n alert('apl_sitebar_onClicksitebarButton(): '+ ex.description);\n } \n\n e.cancelBubble = true;\n if (e.stopPropagation) e.stopPropagation();\n return(false);\n\n}\n\n\n//------------------------------------------------------------------------------------------------\n// create drop-down menu\n//------------------------------------------------------------------------------------------------\nfunction apl_sitebar_onClicksitebarMenu(e)\n{\n if(!e) var e = window.event;\n var theTarget = resolveTarget(e); // = <span>, the object we click on\n \n try{ \n \n title = theTarget.getAttribute("tiddler_title");\n \n // retrieve the string and eval() it \n my_syntaxes = theTarget.getAttribute("syntax_objs");\n var items=null;\n cmd = "items = "+my_syntaxes;\n eval(cmd);\n if(!items) return;\n\n var popup = createTiddlerPopup(this);\n if(!popup) return;\n\n for (i=0; i<items.length; i++){\n var theItem = createTiddlyButton(\n createTiddlyElement(popup, "li"),\n items[i].name,\n items[i].tip,\n apl_sitebar_onClicksitebarButton\n );\n\n theItem.setAttribute("syntax_obj", my_syntaxes + "["+i+"]");\n theItem.setAttribute("tiddler_title", title);\n }\n\n scrollToTiddlerPopup(popup,false);\n \n }catch(ex){\n alert('apl_sitebar_onClicksitebarMenu(): '+ex.description);\n } \n \n e.cancelBubble = true;\n if (e.stopPropagation) e.stopPropagation();\n return(false);\n \n}\n\n\n//------------------------------------------------------------------------------------------------\n// apl_sitebar_ColorPicker class\n//------------------------------------------------------------------------------------------------\nfunction apl_sitebar_ColorPicker(theAction){\n \n // 16x16 colors\n this.colorTable = [ \n "#FFFFFF","#DDDDDD","#CCCCCC","#BBBBBB","#AAAAAA","#999999","#666666","#333333","#111111","#000000","#FFCC00","#FF9900","#FF6600","#FF3300","#CC3300","#CC0033",\n "#99CC00","#99DD00","#99EE00","#EE9900","#DD9900","#CC9900","#FFCC33","#FFCC66","#FF9966","#FF6633","#660000","#990000","#CC0000","#FF0000","#FF3366","#FF0033",\n "#CCFF00","#CCFF33","#333300","#666600","#999900","#CCCC00","#FFFF00","#CC9933","#CC6633","#330000","#993333","#CC3333","#FF3333","#CC3366","#FF6699","#FF0066",\n "#99FF00","#CCFF66","#99CC33","#666633","#999933","#CCCC33","#FFFF33","#996600","#993300","#663333","#CC6666","#FF6666","#990033","#CC3399","#FF66CC","#FF0099",\n "#66FF00","#99FF66","#66CC33","#669900","#999966","#CCCC66","#FFFF66","#996633","#663300","#996666","#FF9999","#FF3399","#CC0066","#990066","#FF33CC","#FF00CC",\n "#33FF00","#66FF33","#339900","#66CC00","#99FF33","#CCCC99","#FFFF99","#CC9966","#CC6600","#CC9999","#FF99CC","#CC6699","#993366","#660033","#CC0099","#330033",\n "#00CC00","#33CC00","#336600","#669933","#99CC66","#CCFF99","#FFFFCC","#FFCC99","#FF9933","#FFCCCC","#CC99CC","#996699","#993399","#990099","#663366","#660066",\n "#006600","#33CC33","#66CC66","#00FF00","#33FF33","#66FF66","#99FF99","#CCFFCC","#99CCFF","#FFCCFF","#FF99FF","#FF66FF","#FF33FF","#FF00FF","#CC66CC","#CC33CC",\n "#003300","#336633","#009900","#339933","#669966","#99CC99","#CCFFFF","#3399FF","#6699CC","#CCCCFF","#CC99FF","#9966CC","#663399","#330066","#9900CC","#CC00CC",\n "#00FF33","#00CC33","#006633","#339966","#66CC99","#99FFCC","#99CCCC","#0066CC","#336699","#9999FF","#9999CC","#9933FF","#6600CC","#660099","#CC33FF","#CC00FF",\n "#00FF66","#33FF66","#009933","#00CC66","#33FF99","#99FFFF","#669999","#003366","#003399","#6666FF","#6666CC","#666699","#330099","#9933CC","#CC66FF","#9900FF",\n "#00FF99","#66FF99","#33CC66","#009966","#66FFFF","#66CCCC","#336666","#006699","#3366CC","#3333FF","#3333CC","#333399","#333366","#6633CC","#9966FF","#6600FF",\n "#00FFCC","#66FFCC","#33CC99","#33FFFF","#33CCCC","#339999","#003333","#3399CC","#6699FF","#0000FF","#0000CC","#000099","#000066","#000033","#6633FF","#3300FF",\n "#00CC99","#33FFCC","#00FFFF","#00CCCC","#009999","#006666","#33CCFF","#66CCFF","#0099CC","#3366FF","#00CCFF","#0099FF","#0066FF","#0033FF","#0033CC","#3300CC"\n ];\n\n this.colorMap = null; // div object\n\n this.targetSyntax = null; // the syntax object that called apl_sitebar_ColorPicker\n this.targetEditor = null; // the editor object that will be applied selected color\n this.theAction = theAction;\n \n this.createColorMap();\n\n}\n\napl_sitebar_ColorPicker.prototype.showColorMap = function() \n{\n if(this.colorMap){\n this.colorMap.style.display = "block";\n }\n}\n\napl_sitebar_ColorPicker.prototype.hideColorMap = function() \n{\n if(this.colorMap){\n this.colorMap.style.display = "none";\n }\n}\n\n\napl_sitebar_ColorPicker.prototype.moveColorMap = function(theTarget)\n{\n try{\n\n var cm = this.colorMap; \n if(!cm) return;\n \n var rootLeft = findPosX(theTarget);\n var rootTop = findPosY(theTarget);\n var rootHeight = theTarget.offsetHeight;\n \n var popupLeft = rootLeft;\n var popupTop = rootTop + rootHeight;\n \n var popupWidth = cm.offsetWidth;\n \n var winWidth = findWindowWidth();\n if(popupLeft + popupWidth > winWidth)\n popupLeft = winWidth - popupWidth;\n \n cm.style.left = popupLeft + "px";\n cm.style.top = popupTop + "px";\n cm.style.display = "block";\n \n// window.scrollTo(0,y); // some bugs here\n \n }catch(ex){\n alert('moveColorMap(): '+ex.description);\n }\n}\n\napl_sitebar_ColorPicker.prototype.createColorMap = function() \n{\n try{ \n\n if(!this.theAction) return;\n \n if(this.colorMap) return;\n \n // create div\n this.colorMap = document.createElement("div");\n this.colorMap.setAttribute("id","colorMap");\n this.colorMap.setAttribute("style","display:none; position:absolute; left:0px; top:0px; z-index:99; margin:0px; padding:0px; cursor:crosshair;");\n document.body.appendChild(this.colorMap);\n\n // create table\n var theTable = document.createElement("table");\n theTable.setAttribute("cellspacing", 0);\n theTable.setAttribute("cellpadding", 0);\n theTable.setAttribute("style", "border:solid 1px black;");\n this.colorMap.appendChild(theTable);\n \n // create tr/td\n cellsPerRow = 16;\n var theTR=null;\n for(i=0; i<this.colorTable.length; i++){\n // create new row\n if((i%cellsPerRow)==0){ // 16x16\n theTR = document.createElement("tr");\n theTable.appendChild(theTR);\n }\n\n var theTD = document.createElement("td");\n if(this.colorTable[i].trim() == '')\n theTD.setAttribute("bgcolor", "white");\n else\n theTD.setAttribute("bgcolor", this.colorTable[i]);\n theTD.setAttribute("style", "border:solid 1px black;");\n theTD.onclick = this.theAction;\n theTD.innerHTML = '<span style="font-size:8px"> </span>';\n theTR.appendChild(theTD);\n }\n \n // bottom row\n theTR = document.createElement("tr");\n theTable.appendChild(theTR);\n var theTD = document.createElement("td");\n theTD.setAttribute("bgcolor", "white");\n theTD.setAttribute("style", "border:solid 1px black;");\n theTD.setAttribute("colspan",cellsPerRow);\n theTD.onclick = function(){ if(apl_sitebar_colorPicker) apl_sitebar_colorPicker.hideColorMap(); };\n theTD.innerHTML = '<center><span style="font-size:10px;">close</span></center>';\n theTR.appendChild(theTD);\n \n }catch(ex){\n alert('createColorMap: '+ex.description);\n }\n \n}\n\n//------------------------------------------------------------------------------------------------\n// do on select a color\n//------------------------------------------------------------------------------------------------\nfunction apl_sitebar_onSelectColor(e) \n{\n \n if (!e) var e = window.event;\n var theTarget = resolveTarget(e); //<span>\n if(!theTarget) return(false);\n\n try{\n\n if(!apl_sitebar_colorPicker) return;\n \n apl_sitebar_colorPicker.hideColorMap();\n\n // get the color \n theTD = theTarget.parentNode;\n color = theTD.getAttribute("bgcolor");\n if(!color) return;\n \n if(apl_sitebar_colorPicker.targetSyntax && apl_sitebar_colorPicker.targetEditor)\n apl_sitebar_colorPicker.targetSyntax.format(apl_sitebar_colorPicker.targetEditor, color);\n \n }catch(ex){\n alert('apl_sitebar_onSelectColor: '+ex.description);\n } \n \n e.cancelBubble = true;\n if (e.stopPropagation) e.stopPropagation();\n return(false);\n \n}\n\n\n//------------------------------------------------------------------------------------------------\n// global variables: color picker\n//------------------------------------------------------------------------------------------------\nvar apl_sitebar_colorPicker = new apl_sitebar_ColorPicker(apl_sitebar_onSelectColor);\n\n//------------------------------------------------------------------------------------------------\n// global variables: syntax object\n// \n// parameter syntax: %1,%2,... - parameter needed, [%1] - optional parameter\n// %N - more than one parameter(1~n)\n// [%N] - any parameter(0~n)\n//------------------------------------------------------------------------------------------------\nvar apl_sitebar_syntaxes = {\n formattings: [\n {\n name: "ignore",\n tip: "ignore site word",\n symbol: "~",\n syntax: "~user_text",\n hint: "site_word",\n format: apl_sitebar_formatByWord\n },\n {\n name: "bold",\n tip: "bolder text",\n symbol: "<strong>B</strong>",\n syntax: "''user_text''",\n hint: "bold_text",\n format: apl_sitebar_formatByWord\n },\n {\n name: "italic",\n tip: "italic text",\n symbol: "<em>I</em>",\n syntax: "//user_text//",\n hint: "italic_text",\n format: apl_sitebar_formatByWord\n },\n {\n name: "underline",\n tip: "underline text",\n symbol: "<u>U</u>",\n syntax: "__user_text__",\n hint: "underline_text",\n format: apl_sitebar_formatByWord\n },\n {\n name: "strike",\n tip: "strikethrough text",\n symbol: "<strike>S</strike>",\n syntax: "==user_text==",\n hint: "strikethrough_text",\n format: apl_sitebar_formatByWord\n },\n {\n name: "sup",\n tip: "superscript text",\n symbol: "X<sup>2</sup>",\n syntax: "^^user_text^^",\n hint: "superscript_text",\n format: apl_sitebar_formatByWord\n },\n {\n name: "sub",\n tip: "subscript text",\n symbol: "X<sub>2</sub>",\n syntax: "~~user_text~~",\n hint: "subscript_text",\n format: apl_sitebar_formatByWord\n },\n {\n name: "comment",\n tip: "comment text",\n symbol: "/%",\n syntax: "/%user_text%/",\n hint: "comment_text",\n format: apl_sitebar_formatByWord\n },\n {\n name: "monospaced",\n tip: "monospaced text",\n symbol: "<code>mono</code>",\n syntax: "{{{user_text}}}",\n hint: "monospaced_text",\n format: apl_sitebar_formatByWord\n },\n {\n name: "line",\n tip: "horizontal line",\n symbol: "—",\n syntax: "\sn----\sn",\n format: apl_sitebar_formatByCursor\n },\n {\n name: "crlf",\n tip: "line break",\n symbol: "¶",\n syntax: "\sn",\n format: apl_sitebar_formatByCursor\n }\n ], // formattings\n colors: [\n {\n name: "highlight",\n tip: "highlight text",\n syntax: "@@user_text@@",\n hint: "highlight_text",\n format: apl_sitebar_formatByWord\n },\n {\n name: "color",\n tip: "text color",\n hint: "your_text",\n syntax: "@@color(%1):user_text@@",\n format: apl_sitebar_formatByWord,\n needParam: apl_sitebar_getColorCode\n },\n {\n name: "bgcolor",\n tip: "background color",\n hint: "your_text",\n syntax: "@@bgcolor(%1):user_text@@",\n format: apl_sitebar_formatByWord,\n needParam: apl_sitebar_getColorCode\n },\n {\n name: "colorcode",\n tip: "insert colorcode",\n syntax: "%1",\n format: apl_sitebar_formatByCursor,\n needParam: apl_sitebar_getColorCode\n } \n ], // colors\n lists:[\n {\n name: "bullet",\n tip: "bullet point",\n syntax: "*user_text",\n hint: "bullet_text",\n format: apl_sitebar_formatByLine\n },\n {\n name: "numbered",\n tip: "numbered list",\n syntax: "#user_text",\n hint: "numbered_text",\n format: apl_sitebar_formatByLine\n }\n ], // lists\n headings:[\n {\n name: "Heading 1",\n tip: "Heading 1",\n syntax: "!user_text",\n hint: "heading_1",\n format: apl_sitebar_formatByLine\n },\n {\n name: "Heading 2",\n tip: "Heading 2",\n syntax: "!!user_text",\n hint: "heading_2",\n format: apl_sitebar_formatByLine\n },\n {\n name: "Heading 3",\n tip: "Heading 3",\n syntax: "!!!user_text",\n hint: "heading_3",\n format: apl_sitebar_formatByLine\n },\n {\n name: "Heading 4",\n tip: "Heading 4",\n syntax: "!!!!user_text",\n hint: "heading_4",\n format: apl_sitebar_formatByLine\n },\n {\n name: "Heading 5",\n tip: "Heading 5",\n syntax: "!!!!!user_text",\n hint: "heading_5",\n format: apl_sitebar_formatByLine\n }\n ], // headings\n paragraphs:[\n {\n name: "comment by line",\n tip: "line comment",\n syntax: "/%user_text%/",\n hint: "comment_text",\n format: apl_sitebar_formatByLine\n },\n {\n name: "comment by block",\n tip: "block comment",\n syntax: "/%\snuser_text\sn%/",\n hint: "comment_text",\n byBlock: true, \n format: apl_sitebar_formatByLine\n },\n {\n name: "monospaced by line",\n tip: "line monospaced",\n syntax: "{{{\snuser_text\sn}}}",\n hint: "monospaced_text",\n format: apl_sitebar_formatByLine\n },\n {\n name: "monospaced by block",\n tip: "block monospaced",\n syntax: "{{{\snuser_text\sn}}}",\n hint: "monospaced_text",\n byBlock: true,\n format: apl_sitebar_formatByLine\n },\n {\n name: "quote by line",\n tip: "line quote",\n syntax: ">user_text",\n hint: "quote_text",\n format: apl_sitebar_formatByLine\n },\n {\n name: "quote by block",\n tip: "block quote",\n syntax: "<<<\snuser_text\sn<<<",\n hint: "quote_text",\n byBlock: true, \n format: apl_sitebar_formatByLine\n }\n ], // paragraphs\n links:[\n {\n name: "site",\n tip: "site link",\n syntax: "[[user_text]]",\n hint: "site_word",\n format: apl_sitebar_formatByWord\n },\n {\n name: "pretty",\n tip: "pretty link",\n syntax: "[[user_text|%1]]", \n hint: "pretty_word",\n format: apl_sitebar_formatByWord,\n needParam: apl_sitebar_getLinkUrl,\n param: "PrettyLink Target"\n },\n {\n name: "url",\n tip: "url link",\n syntax: "[[user_text|%1]]", \n hint: "your_text",\n format: apl_sitebar_formatByWord,\n needParam: apl_sitebar_getLinkUrl,\n param: "http://..."\n },\n {\n name: "image",\n tip: "image link",\n syntax: "[img[user_text|%1]]", \n hint: "alt_text",\n format: apl_sitebar_formatByWord,\n needParam: apl_sitebar_getLinkUrl,\n param: "image/icon.jpg"\n }\n ], // links\n plugins:[\n {\n name: "codes area",\n tip: "block monospaced for plugin",\n syntax: "//{{{\snuser_text\sn//}}}",\n hint: "monospaced_plugin_text",\n byBlock: true,\n format: apl_sitebar_formatByLine\n }, \n {\n name: "comment by line",\n tip: "line comment",\n syntax: "//user_text",\n hint: "plugin_comment",\n format: apl_sitebar_formatByLine\n },\n {\n name: "comment by block",\n tip: "block comment",\n syntax: "/***\snuser_text\sn***/",\n hint: "plugin_comment",\n byBlock: true,\n format: apl_sitebar_formatByLine\n }\n ], // plugins\n tables:[\n {\n name: "table",\n tip: "create a new table",\n syntax: "\sn%1\sn",\n format: apl_sitebar_formatByWord,\n needParam: apl_sitebar_getTableRowCol\n },\n {\n name: "table header",\n tip: "table header text",\n syntax: "|user_text|c",\n hint: "table_header",\n format: apl_sitebar_formatByWord\n }, \n {\n name: "cell",\n tip: "create a tabel cell",\n syntax: "|user_text|",\n hint: "your_text",\n format: apl_sitebar_formatByWord\n },\n {\n name: "column header",\n tip: "create a column header cell",\n syntax: "|!user_text|",\n hint: "column_header",\n format: apl_sitebar_formatByWord\n },\n {\n name: "cell bgcolor",\n tip: "cell bgcolor",\n syntax: "|bgcolor(%1):user_text|",\n hint: "your_text",\n format: apl_sitebar_formatByTableCell,\n needParam: apl_sitebar_getColorCode\n },\n {\n name: "align left",\n tip: "add a tabel cell",\n syntax: "|user_text|",\n hint: "your_text",\n format: apl_sitebar_formatByTableCell\n },\n {\n name: "align center",\n tip: "add a tabel cell",\n syntax: "| user_text |",\n hint: "your_text",\n format: apl_sitebar_formatByTableCell\n },\n {\n name: "align right",\n tip: "add a tabel cell",\n syntax: "| user_text|",\n hint: "your_text",\n format: apl_sitebar_formatByTableCell\n }\n ], // tables\n macros:[\n {\n name: "allTags",\n tip: "allTags",\n syntax: "<<allTags>>",\n format: apl_sitebar_formatByWord\n },\n {\n name: "closeAll",\n tip: "closeAll",\n syntax: "<<closeAll>>",\n format: apl_sitebar_formatByWord\n },\n {\n name: "gradient",\n tip: "gradient",\n syntax: "<<gradient vert #ffffff %1>>user_text>>",\n format: apl_sitebar_formatByWord,\n needParam: apl_sitebar_getColorCode\n },\n {\n name: "list",\n tip: "list",\n syntax: "<<list>>",\n format: apl_sitebar_formatByWord\n },\n {\n name: "list missing",\n tip: "list missing",\n syntax: "<<list missing>>",\n format: apl_sitebar_formatByWord\n },\n {\n name: "list orphans",\n tip: "list orphans",\n syntax: "<<list orphans>>",\n format: apl_sitebar_formatByWord\n }, \n {\n name: "newJournal",\n tip: "newJournal",\n syntax: "<<newJournal>>",\n format: apl_sitebar_formatByWord\n }, \n {\n name: "newTiddler",\n tip: "newTiddler",\n syntax: "<<newTiddler>>",\n format: apl_sitebar_formatByWord\n }, \n {\n name: "option",\n tip: "option",\n syntax: "<<option %1>>[%2]\sn",\n format: apl_sitebar_formatByWord,\n needParam: apl_sitebar_getMacroParam,\n param: 'chkOpenInNewWindow "Open link in new window"'\n }, \n {\n name: "permaview",\n tip: "permaview",\n syntax: "<<permaview>>",\n format: apl_sitebar_formatByWord\n }, \n {\n name: "saveChanges",\n tip: "saveChanges",\n syntax: "<<saveChanges>>",\n format: apl_sitebar_formatByWord\n }, \n {\n name: "search",\n tip: "search",\n syntax: "<<search>>",\n format: apl_sitebar_formatByWord\n }, \n {\n name: "slider",\n tip: "slider",\n syntax: "<<slider %1 %2 %3>>",\n format: apl_sitebar_formatByWord,\n needParam: apl_sitebar_getMacroParam,\n param: "sliderID sliderTiddler sliderLabel"\n }, \n {\n name: "sparkline",\n tip: "sparkline",\n syntax: "<<sparkline %N>>", \n format: apl_sitebar_formatByWord,\n needParam: apl_sitebar_getMacroParam,\n param: "number_list(ex: 100 123 ...)"\n }, \n {\n name: "tabs",\n tip: "tabs",\n syntax: "<<tabs [%N]>>",\n format: apl_sitebar_formatByWord,\n needParam: apl_sitebar_getMacroParam,\n param: "indentifier tabLabel tabName Tiddler"\n }, \n {\n name: "tag",\n tip: "tag",\n syntax: "<<tag %1>>",\n format: apl_sitebar_formatByWord,\n needParam: apl_sitebar_getMacroParam,\n param: "tagName(ex: systemConfig)"\n }, \n {\n name: "tiddler",\n tip: "tiddler",\n syntax: "<<tiddler %1>>",\n format: apl_sitebar_formatByWord,\n needParam: apl_sitebar_getMacroParam,\n param: "Tiddler"\n }, \n {\n name: "timeline",\n tip: "timeline",\n syntax: "<<timeline>>",\n format: apl_sitebar_formatByWord\n }, \n {\n name: "today",\n tip: "today",\n syntax: "<<today [%1]>>", \n format: apl_sitebar_formatByWord,\n needParam: apl_sitebar_getMacroParam,\n param: '"YYYY/MM/DD hh:mm:ss"'\n }, \n {\n name: "version",\n tip: "version",\n syntax: "<<version>>",\n format: apl_sitebar_formatByWord\n }\n ], // macros\n dates:[\n {\n name: "YYYY",\n tip: "full year",\n syntax: "YYYY",\n format: apl_sitebar_formatByCursor\n },\n {\n name: "YY",\n tip: "2-digit year",\n syntax: "YY",\n format: apl_sitebar_formatByCursor\n },\n {\n name: "MMM",\n tip: "month name",\n syntax: "MMM",\n format: apl_sitebar_formatByCursor\n },\n {\n name: "MM",\n tip: "month",\n syntax: "MM",\n format: apl_sitebar_formatByCursor\n },\n {\n name: "0MM",\n tip: "zero-leading month",\n syntax: "0MM",\n format: apl_sitebar_formatByCursor\n },\n {\n name: "DDD",\n tip: "week day",\n syntax: "DDD",\n format: apl_sitebar_formatByCursor\n },\n {\n name: "DD",\n tip: "day",\n syntax: "DD",\n format: apl_sitebar_formatByCursor\n },\n {\n name: "0DD",\n tip: "zero-leading day",\n syntax: "0DD",\n format: apl_sitebar_formatByCursor\n },\n {\n name: "hh",\n tip: "hour",\n syntax: "hh",\n format: apl_sitebar_formatByCursor\n },\n {\n name: "mm",\n tip: "minute",\n syntax: "mm",\n format: apl_sitebar_formatByCursor\n },\n {\n name: "ss",\n tip: "second",\n syntax: "ss",\n format: apl_sitebar_formatByCursor\n } \n ], // dates\n htmls:[\n {\n name: "<html>",\n tip: "html tag",\n syntax: "<html>\snuser_text\sn</html>",\n hint: "html_content",\n byBlock: true,\n format: apl_sitebar_formatByLine\n }\n ] // htmls\n};\n\n\n//}}}
// // ''套件:'' zh_CN\n// // ''功能:'' 界面中文化\n// // ''作者:'' Safe3\n// // ''版本:'' 1.2.37 (2005/10/28)\n// // ''说明:''\n// // Oct 28, 2005: 1 新增 config.messages.shadowedTiddlerToolTip\n// // 2.新增 config.macros.list.shadowed.prompt\n// // 3.修改 config.views.sitefied.tag\n{{{\nversion.extensions.zh_CN = {major: 1, minor: 2, revision: 37, date: new Date("Oct 28, 2005")};\n// // ''Messages''\nconfig.messages= {\n customConfigError: "customConfig 错误 - '%1' - %0",\n savedSnapshotError: "此网站未正确存档",\n subtitleUnknown: "(未知)",\n undefinedTiddlerToolTip: "'%0' 尚无內容",\n externalLinkTooltip: "外部链接至 %0",\n shadowedTiddlerToolTip: "'%0' 尚无內容, 但已定义隐藏的预设值",\n noTags: "未设定标签的文章",\n notFileUrlError: "须先将此网站存至档案,才可存储变更",\n cantSaveError: "此浏览器无法存储变更,建议使用FireFox",\n invalidFileError: " '%0' 非有效的网站",\n backupSaved: "已储存备份",\n backupFailed: "无法储存备份",\n rssSaved: "RSS feed 已存储",\n rssFailed: "无法存储 RSS feed ",\n emptySaved: "已存储范本",\n emptyFailed: "无法存储范本",\n mainSaved: "主要的网站已存储",\n mainFailed: "无法存储主要网站. 所作的改变未存储",\n macroError: "macro执行错误 '%0'",\n overwriteWarning: "'%0' 已存在,[确定]覆盖",\n unsavedChangesWarning: "注意! 尚未存储变更\sn\sn[确定]存档,或[取消]放弃存档?",\n dates: {\n months: ["一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二"],\n days: ["日", "一","二", "三", "四", "五", "六"]\n }\n };\nconfig.views = {\n sitefied: {\n tag: {labelNoTags: "未设标签", labelTags: "Tag: ", tooltip: "显示标签为 '%0' 的文章", openAllText: "打开以下所有文章", openAllTooltip: "打开标签为 '%0' 的文章", popupNone: "仅此文标签为 '%0'"},\n toolbarClose: {text: "关闭", tooltip: "关闭本文"},\n toolbarEdit: {text: "编辑", tooltip: "编辑本文"},\n toolbarPermalink: {text: "引用链接", tooltip: "本文引用链接"},\n toolbarReferences: {text: "引用", tooltip: "引用本文的文章", popupNone: "本文未被引用"},\n defaultText: ""\n },\n editor: {\n tagPrompt: "设置标签之间的空白间隔,[[标签含空白时请使用中括号]],或点选现有标签加入",\n tagChooser: {text: "标签", tooltip: "点选现有标签加至本文章", popupNone: "未设置标签", tagTooltip: "加入标签 '%0'"},\n toolbarDone: {text: "完成", tooltip: "确定修改"},\n toolbarCancel: {text: "取消", tooltip: "取消修改"},\n toolbarDelete: {text: "刪除", tooltip: "刪除文章"},\n defaultText: ""\n }\n };\n// // ''SiderBar''\nconfig.shadowTiny.SideBarOptions = "<<gradient vert #ffffff #cc9900>><<search>><<closeAll>><<permaview>><<saveChanges>><<slider chkSliderOptionsPanel OptionsPanel 偏好设置 '变更网站选项'>>>>";\nconfig.shadowTiny.AdvancedOptions = "<<option chkOpenInNewWindow>> 打开新窗口链接\sn<<option chkSaveEmptyTemplate>> 存储范本\sn<<option chkToggleLinks>> 点击关闭文章\sn\sn<<option chkHttpReadOnly>> 隐藏编辑功能 ({{{http:}}})\sn<<option chkForceMinorUpdate>> 修改文章不变更日期事件\sn(确认修改同时按 Shift 键,或只按 Ctrl-Shift-Enter)";\nconfig.shadowTiny.OptionsPanel = "這些设置将暂存于浏览器中,\sn请签名<<option txtUserName>>\sn (示例:Word)\sn\sn <<option chkSaveBackups>> [[存储备份]]\sn<<option chkAutoSave>> [[自动存储]]\sn<<option chkGenerateAnRssFeed>> [[生成 RssFeed]]\sn<<option chkRegExpSearch>> [[正则搜索]]\sn<<option chkCaseSensitiveSearch>> [[区分大小写搜索]]\sn<<option \snchkAnimate>> [[使用动画显示]]\sn\sn <<slider sliderAdvancedOptions AdvancedOptions 高级选项 '高级选项'>>";\nconfig.shadowTiny.SideBarTabs = "<<tabs txtMainTab Timeline '依更新日期排序' TabTimeline All '所有文章' TabAll Tabs '依标签分类' TabTags More '其他' TabMore>>";\nconfig.shadowTiny.TabMore = "<<tabs txtMoreTab 未完成 '內容空白的文章' TabMoreMissing 未引用 '未被引用的文章' TabMoreOrphans>>";\nconfig.shadowTiny.SliderTimeline = "<<slider sliderTimeline TabTimeline 最近更新 '最近更新的文章'>>";\nconfig.macros.search.label = " Search";\nconfig.macros.search.prompt = "Search Content";\nconfig.macros.search.sizeTextbox = 15;\nconfig.macros.search.accessKey = "F";\nconfig.macros.search.successMsg = " %0 篇符合条件";\nconfig.macros.search.failureMsg = " 无符合条件";\nconfig.macros.timeline.dateFormat = "YYYY0MM0DD";\nconfig.macros.allTags.tooltip = "显示文章- 标签为'%0'";\nconfig.macros.allTags.noTags = "沒有标签的文章";\nconfig.macros.list.all.prompt = "依字母排序";\nconfig.macros.list.missing.prompt = "被引用且內容空白的文章";\nconfig.macros.list.orphans.prompt = "未被引用的文章";\nconfig.macros.list.shadowed.prompt = "这些隐藏的文章已定义预设內容";\n// // ''ToolsBar''\nconfig.macros.closeAll.label = "Close All";\nconfig.macros.closeAll.prompt = "Close all opened tiddlers(except editing)";\nconfig.macros.saveChanges.label = "存储变更";\nconfig.macros.saveChanges.prompt = "存储所有文章,生成新的版本";\nconfig.macros.permaview.label = "引用链接";\nconfig.macros.permaview.prompt = "可存取现有开启文章的链接位址";\nconfig.macros.newTiddler.label = "发表文章";\nconfig.macros.newTiddler.prompt = "新增文章";\nconfig.macros.newJournal.label = "发表日志";\nconfig.macros.newJournal.prompt = "新增日志";\n// // ''Date formatString''\nDate.prototype.formatString = function(template)\n{\n template = template.replace(/YYYY/g,this.getFullYear() + '年');\n template = template.replace(/YY/g,String.zeroPad(this.getFullYear()-1911,2) + '年');\n template = template.replace(/MMM/g,config.messages.dates.months[this.getMonth()] + '月');\n template = template.replace(/0MM/g,String.zeroPad(this.getMonth()+1,2) + '月');\n template = template.replace(/MM/g,this.getMonth()+1 + '月');\n template = template.replace(/DDD/g,'星期'+config.messages.dates.days[this.getDay()]);\n template = template.replace(/0DD/g,String.zeroPad(this.getDate(),2)+ '日');\n template = template.replace(/DD/g,this.getDate() + '日');\n template = template.replace(/hh/g,this.getHours());\n template = template.replace(/mm/g,this.getMinutes());\n template = template.replace(/ss/g,this.getSeconds());\n return template;\n};\n}}}