*[[Ashraf Apandi]]\n*[[Illida Nawi]]\n*[[Michael Robinson]]\n*[[Brandon Siegel]]
<html><table style="border: none"><tr style="border: none"><td style="border: none"><img src="ashraf.jpg" alt="Ashraf Apandi" /></td><td valign="top" style="border: none">Ashraf Anwar is currently a forth-year student at Case Western Reserve University in Cleveland, Ohio, where he is majoring in Computer Engineering. He has a solid background in programming languages such as C++ and Java. He also plans to get a minor degree in Economics. He's thinking of getting a job that applies both his computer application and economics knowledge in the future.</td></tr></table></html>
<html><table style="border: none"><tr style="border: none"><td style="border: none"><img src="brandon.jpg" alt="Brandon Siegel" /></td><td valign="top" style="border: none">Brandon is currently a third-year student at Case Western Reserve University in Cleveland, Ohio, where he is majoring in Computer Engineering. He has approximately ten years of HTML experience, as well as six years of experience in both scripting (PHP, Perl, JavaScript, Lua) and enterprise (C++; Mips, ARM, and x86 assembly) computer languages, and in specialties such as dynamic web portals, web interfaces to existing hardware and software products, computer security, authentication, and encryption, and database administration. He is the lead developer on many open-source projects and has contributed to numerous others including the Mozilla project.</td></tr></table></html>
//{{{\nwindow.onClickToolbarCloseOthers = function(e) {\n if (!e) var e = window.event;\n clearMessage();\n if(this.parentNode.id)\n closeAllOtherTiddlers(this.parentNode.id.substr(7));\n e.cancelBubble = true;\n if (e.stopPropagation) e.stopPropagation();\n return(false);\n}\n\nfunction closeAllOtherTiddlers(thisTitle) {\n clearMessage();\n var place = document.getElementById("tiddlerDisplay");\n var tiddler = place.firstChild;\n var nextTiddler;\n while(tiddler) {\n nextTiddler = tiddler.nextSibling;\n if(tiddler.id) {\n if(tiddler.id.substr(0,7) == "tiddler") {\n var title = tiddler.id.substr(7);\n if(!document.getElementById("editorWrapper" + title) && title != thisTitle) {\n place.removeChild(tiddler);\n }\n }\n }\n tiddler = nextTiddler;\n }\n window.scrollTo(0,0);\n}\n\nconfig.views.wikified.toolbarCloseOthers = {text: "close others", tooltip: "Close all articles except this one"};\n\nwindow.createTiddlerToolbar_orig_mptw_closeothers = window.createTiddlerToolbar;\nwindow.createTiddlerToolbar = function(title,isEditor) {\n createTiddlerToolbar_orig_mptw_closeothers(title,isEditor);\n if(true || !isEditor) {\n var theToolbar = document.getElementById("toolbar" + title);\n var lingo = config.views.wikified;\n var newButton = createTiddlyButton(theToolbar, lingo.toolbarCloseOthers.text, lingo.toolbarCloseOthers.tooltip, onClickToolbarCloseOthers);\n var newSpacer = insertSpacer(theToolbar);\n\n secondButton = theToolbar.childNodes[3];\n\n\n theToolbar.insertBefore(newSpacer,secondButton);\n theToolbar.insertBefore(newButton,newSpacer);\n\n }\n}\n//}}}
A full cost-benefit analysis will be conducted as part of our feasibility study. Once the results are collected, the information will be available here.
[[What is the PSD?]]
!!!!!GPS Receiver\nA GPS receiver could be used to to receive the exact coordinates and then transmit them over the cellular telephone network to a Campus Security dispatcher. This would allow the PSD to be used at the widest range of places, but also would cost more money and would require the user to either frequently charge the device, or leave it off and turn it on only in an emergency (wasting valuable seconds in the process).\n<html><center><img src="gps.jpg" alt="GPS Receiver" /></center></html>\n\n!!!!!Remote Button\nAfter verifying their functionality, receivers could be installed into each emergency phone stand on campus. The PSD itself would work much like a remote unlock unit for a car or a garage door opener, sending out a coded signal instructing the phone to activate. While this option does not transmit the location as precisely and can be used only where receivers are installed, it is much less expensive and a single button-cell battery will keep the device usable for many years. Another advantage is that due to the low cost of production, it would be feasible for local and city governments to deploy this version of the PSD both in popular social areas such as Little Italy or the Flats, and in high-risk areas.\n<html><center><img src="remote.jpg" alt="Remote Button" /></center></html>
*[[Projected Cost]]\n*[[Potential Profit]]\n*[[Benefit Analysis|Cost-Benefit Analysis]]\n*[[Funding Sources]]\n*<html><a target="_blank" title="External link to FeasibilityReport.pdf" href="FeasibilityReport.pdf" class="externalLink">Report <img src="pdf.png" alt="PDF" /></a></html>
''[[2006 Grants to Reduce Violent Crimes Against Women on Campus|http://www.fedgrants.gov/Applicants/DOJ/HQ/OJP/OVW-2006-1205/Grant.html]]''\n''//$400,000//''\n\nViolence against women -- including dating violence, domestic violence, sexual assault, and stalking -- is a serious problem on campuses, as it is across the nation. On campuses, however, unique issues arise. To address these particular circumstances, Congress created the Grants to Reduce Violent Crimes Against Women on Campus Program. The primary purpose of the Campus Program is to develop and strengthen victim services in cases involving violent crimes against women on campuses. The Campus Program also aims to strengthen security and investigative strategies to prevent and prosecute violent crimes against women on campuses.\n\n<html><hr /></html>\n''[[2006 NIJ Public Safety Interventions Grants|http://www.fedgrants.gov/Applicants/DOJ/HQ/OJP/2006-NIJ-1166/Grant.html]]''\n''//$250,000//''\n\nNIJ is seeking proposals to conduct process and outcome evaluations to improve public safety interventions at the local level. Effective law enforcement and crime prevention programs are critical to ensuring the safety of communities throughout the country. With the limited resources of many police departments, local agencies, and other groups, it is especially important to determine the effectiveness of public safety interventions.
<html><table style="border: none"><tr style="border: none"><td style="border: none"><img src="illida.jpg" alt="Illida Nawi" /></td><td valign="top" style="border: none">Illida is currently a forth-year student at Case Western Reserve University in Cleveland, Ohio, where she is majoring in Biomedical Engineering. She is working to design a drug polymer delivery device for post-ablated tumor. This design will compete in the Innovative Medical Solutions Competition sponsored by NDI Medical and The Medtronic Foundation. Winning this competition is important for her, as additional financing, design support, and faculty mentorship to advance the design to working prototypes will support the continued development of the winning concepts. She is planning to go back to Malaysia and work part-time for a few months before pursuing her Masters in Biotechnology.</td></tr></table></html>
!16 Nov 2005\n''Storyboard Due''\n\n\n!21 Nov 2005\n''Progress Report Due''\n\n\n!23 Nov 2005\n''Project Web Page Due''\n\n\n!28 Nov 2005\n''Final Project Draft Due''\n\n\n!30 Nov 2005\n''Graded Web Presentations''\n\n\n!5 Dec 2005\n''Project Presentations''\n\n\n!7 Dec 2005\n''Project Presentations''\n\n\n!9 Dec 2005\n''Feasability Reports Due''
[[Overview|What is the PSD?]]<<slider sec Why [[Why the PSD?]] 'Discover how the PSD can keep you safe wherever you go'>><<slider proj Project Project 'View in-depth project information'>><<slider feas Feasibility Feasibility 'Examine project feasibility study results'>><<slider prog Progress Progress 'See the current progress of the CasePSD project'>><<slider about [[About Us]] [[About Us]] 'Learn about the CasePSD team'>>\n[[Request a PSD]][[Get Adobe Reader|http://www.adobe.com/acrobat/readstep2.html]]<<newTiddler>>
<html><table style="border: none"><tr style="border: none"><td style="border: none"><img src="mike.jpg" alt="Mike Robinson" /></td><td valign="top" style="border: none">Michael is currently a second-year student at Case Western Reserve University in Cleveland, Ohio where he is majoring in Chemical Engineering. He has three years of laboratory experience which includes process efficiency analysis, distillation, and liquid-vapor equilibrium. In the future, he hopes to specialize in the research, development, and application of alternate forms of energy.</td></tr></table></html>
Because the PSD will be given to anyone who needs one, there is no direct profit from the sale of the PSD. However, a more secure campus will encourage more students to apply to Case (and perhaps more importantly, reassure prospective students' parents). When parents hear that Case's campus is near East Cleveland, many are discouraged and decide to have their child apply to universities with 'safer' campuses. While this fear is not necessarily warranted, the stigma does exist and affect's Case's applicant pool significantly. With the advent of the PSD, parents will no longer fear for their child's safety while on campus, and the administration will have a project that they can point to when parents raise security concerns.
*[[Important Dates]]\n*[[Project Calendar|calendar/]]\n*<html><a target="_blank" title="External link to ProgressReport.pdf" href="ProgressReport.pdf" class="externalLink">Report <img src="pdf.png" alt="PDF" /></a></html>
*[[Background|Project Background]]\n*[[Purpose/Goals|Project Goals]]\n*[[Design|Design and Engineering]]\n*<html><a target="_blank" title="External link to ProjectProposal.pdf" href="ProjectProposal.pdf" class="externalLink">Proposal <img src="pdf.png" alt="PDF" /></a></html>\n*<html><a target="_blank" title="External link to Storyboard.pdf" href="Storyboard.pdf" class="externalLink">Storyboard <img src="pdf.png" alt="PDF" /></a></html>
We are a group of Engineering undergraduate students at Case Western Reserve University. We feel that because of the extrordinary foundation in engineering we have received as Case undergrads, we can create a project to significantly improve the safety of everyone on campus. We have been prepared with the ability to take on real-world challenges and to make a difference, and we wish to put our talents we have cultivated to good use. Thus, we have designed a Personal Security Device that signals Protective Services when the user feels threatened. The PSD will be both helpful in an emergency and useful as a deterrent, yet will be inexpensive to manufacture.
*To ensure the safety of the students and staff while at Case.\n*To provide an alternative to victims in situations where quick emergency help is required.\n*To provide a safety net for students while still in the Cleveland area but outside of campus.
Regardless of which design is chosen for the final device, the devices will carry a cost of production. To keep this low, we feel that when distributing the PSD, a deposit should required by the user. Should they simply keep it, the university would have the cost of the device and could make a replacement unit; however if they return it in working condition, their deposit would be refunded.\n\nThe actual costs of producing the unit vary depending on which design is most feasible. We suspect that the unit using GPS and cellular technology will cost significantly more than the passive unit. Only if this design demonstrates significant performance benefits or ends up with an overall cost approximately equal to the passive design will we focus on it. We do not expect the cost to exceed more than twenty dollars to produce each PSD unit using the passive technology, and fifty dollars using the GPS technology. The cost per receiver for the passive PSD unit should be no more than one hundred dollars.
The Personal Security Device is currently under development. Soon you will be able to request a clicker by visiting any Case Western Reserve University Campus Security satellite office. If you wish to be notified when ~PSDs are available in your area, simply send an e-mail to [[casepsd@case.edu|mailto:casepsd@case.edu]] [img[E-Mail|email.png]] and we will add you to our mailing list.
[img[sub.gif]]@@color(#bbccdd):a portable, on-campus personal security device@@\n
[img[logo.gif]]@@color(#bbccdd):Case PSD Project@@
http://anubis.cwru.edu/clicker.html
#popup{\n padding-left: 2px !important;\n padding-bottom: 2px !important;\n}\n\n#popup *{\n border: 0 !important;\n}\n\n#popup hr {\n border-top: solid 1px #ccc !important; \n border-left: none;\n border-right: none;\n border-bottom: none;\n height: 1px;\n color: #ccc;\n width: 98%;\n}\n\n#popup a:hover{\n color: black !important;\n}\n\nbody {\n margin: 0px;\n background-color: #e4e4e4;\n font-size: 9pt;\n font-family: tahoma,arial,helvetica;\n}\n\na:link, a:visited, a:hover, a:active {\n text-decoration: none;\n}\n\n#header {\n border-bottom: 1px solid #458;\n margin-bottom: 0em;\n}\n\n#titleLine {\n color: #fff;\n background: #bcd;\n padding: 0.7em 1em 1em 1em;\n}\n\n#titleLine a {\n text-decoration: none;\n color: #9ab;\n}\n\n#siteTitle {\n font-size: 40pt;\n font-weight: bold;\n display: block;\n position: relative;\n bottom: 0px;\n left: 0px;\n padding-left: 20px;\n color: #9ab;\n}\n\n#siteSubtitle {\n font-size: 12pt;\n font-family: georgia,times;\n font-style: italic;\n color: #457;\n display: block;\n position: relative;\n bottom: 0px;\n left: 0px;\n padding-left: 70px;\n}\n\n#mainMenu {\n font-size: 12px;\n float: left;\n width: 13em;\n border: 1px solid #aaa;\n margin: .5em 1em .5em 1em;\n background: #f3f3f3 url(bg.gif);\n line-height: 125%;\n color: black;\n text-align: left;\npadding: 0;\n}\n\n#mainMenu .sliderPanel {\n display: inline;\n text-decoration: none;\n width: 12em;\n padding: .25em .5em;\n color: #444;\n text-transform: capitalize;\n}\n\n#mainMenu .tiddlyLink, #mainMenu .externalLink, #mainMenu a.button {\n display: block;\n text-decoration: none;\n padding: .25em .5em;\n color: #444;\n text-transform: capitalize;\n}\n\n#mainMenu a:hover {\n color: #000 !important;\n background-color: #bcd !important;\n}\n\n#displayArea {\n margin: 1em 14em 0em 15em;\n}\n\n#messageArea {\n background-color: #5a84ad;\n color: #fff;\n padding: 0.5em 0.5em 0.5em 0.5em;\n margin: 0em 0em 0.6em 0em;\n border-bottom: 1px solid #458;\n display: none;\n}\n\n#messageArea a:link, #messageArea a:visited {\n display: inline;\n text-decoration: underline;\n color: #ddf;\n}\n\n#messageArea a:hover, #messageArea a:active{\n color: #fff;\n}\n\n.tiddler {\n border: 1px solid #aaa;\n margin: 0 10px 20px;\n padding: 8px;\n padding-top:0;\n font-family: arial,georgia,times;\n background-color: white;\n width: auto;\n overflow: hidden;\n}\n\n.innerTiddler {\n padding: 0.7em 1em 1em 0.8em;\n font-size: 9pt;\n}\n\n#displayArea .tiddlyLinkExisting {\n font-weight: bold;\n}\n\n#displayArea .tiddlyLinkNonExisting {\n font-style: italic;\n}\n\n#displayArea .externalLink {\n text-decoration: underline;\n}\n.title {\n font-family: tahoma,arial,helvetica;\n font-size: 13pt;\n color: #469;\n font-weight: bold;\n }\n\n.toolbar {\n font-family: tahoma,arial,helvetica;\n font-weight: normal;\n font-size: 8pt;\n padding: 0em 0em 0em 1em;\n color: #aaa !important;\n visibility: hidden;\n}\n\n.toolbar a{\n padding: 0.2em 0.4em 0.2em 0.4em;\n color: #888 !important;\n}\n\n.toolbar a:hover{\n color: black;\n background-color: #e4e4e4 !important;\n border: 1px solid #aaa !important;\n margin-left: -1px; \n margin-right: -1px;\n}\n\n.toolbar a:active{\n color: #666;\n}\n\n.toolbar a.button:active{\n background-color: white;\n}\n\n.viewer a.button{\n border: 0;\n background-color: transparent !important;\n padding: 0em;\n color: #888 !important;\n border: 1px solid transparent;\n}\n\n.editorFooter a:hover, .footer a.button{\n color: #888 !important;\n background-color: #fff !important;\n}\n\n.editorFooter a:hover, .footer a:hover, .footer a:active{\n color: black;\n background-color: #e4e4e4 !important;\n border: 1px solid #aaa !important;\n margin-left: -1px; \n margin-right: -1px;\n}\n\n.viewer a.button:hover{\n color: black;\n background-color: #e4e4e4 !important;\n border: 1px solid #aaa !important;\n}\n\n.viewer a.button{\n color: #666;\n}\n\n#popup {\n display: none;\n position: absolute;\n top: 1.5em;\n left: 13.25em;\n font-size: 8pt;\n color: #888;\n background-color: #e4e4e4;\n padding: 0;\n border-top: 1px solid #aaa;\n border-bottom: 1px solid #330000;\n border-right: 1px solid #330000;\n border-left: 1px solid #aaa;\n}\n\n#popup a {\n display: block;\n color: #888;\n min-width: 8em;\n border: 0;\n margin: 0;\n}\n\n#popup a:hover {\n background-color: #e4e4e4;\n color: black;\n}\n\n.body {\n border-top:1px solid #ccc;\n padding-top: 0.5em;\n margin-top:0.3em;\n overflow: hidden;\n}\n\n.viewer {\n color: black;\n line-height: 140%;\n}\n\n.viewer a:link, .body a:visited{\n color: #922;\n}\n\n.viewer a:hover {\n color: #b44;\n background-color: transparent;\n text-decoration: none;\n}\n\n.viewer blockquote {\n font-size: 8pt;\n line-height: 150%;\n border-left: 1px solid #ccc;\n padding-left: 0.8em;\n margin-left: 2.5em;\n}\n\n.viewer ul {\n margin-left: 0.5em;\n padding-left: 1.5em;\n}\n\n.viewer ol {\n margin-left: 0.5em;\n padding-left: 1.5em;\n}\n\n/*==============================================Headings================*/\n\n.viewer h1,.viewer h2,h3,h4,h5,h6 {\n font-weight: bold;\n text-decoration: none;\n color: #469;\n padding-left: .6em;\nbackground-color: transparent !important;\nborder-bottom: 3px dotted #ccc;\n}\n\n.viewer h2 {\n font-size: 12pt;\n}\n\n.viewer h3 {\n font-size: 11pt;\n}\n\n.viewer h4 {\n font-size: 10pt;\n}\n\n.viewer h5 {\n font-size: 9pt;\n}\n\n.viewer h6 {\n font-size: 8pt;\n}\n\n.viewer table {\n font-size: 10pt;\n border-collapse: collapse;\n border: 2px solid #303030;\n margin-left: 1.0em;\n margin-right: 1.0em;\n margin-top: 0.8em;\n margin-bottom: 0.8em;\n}\n\n.viewer th {\n background-color: #bcd;\n border: 1px solid #606060;\n padding: 3px;\n}\n\n.viewer td, tr {\n border: 1px solid #606060;\n padding: 3px;\n}\n\n.viewer caption {\n font-size: smaller;\n padding: 3px;\n}\n\n.viewer hr {\n border-top: dashed 1px #606060;\n border-left: none;\n border-right: none;\n border-bottom: none;\n height: 1px;\n color: #666666;\n}\n\n.highlight {\n color: #000000;\n background-color: #bcd;\n}\n\n.editor {\n font-size: 8pt;\n color: #402c74;\n font-weight: normal;\n}\n\n.editor input {\n display: block;\n border: 1px solid black;\n}\n\n.editor textarea {\n display: block;\n font: inherit;\n border: 1px solid black;\n}\n\n/*\n=================Sidebar==========\n=================================\n*/\n\n\n#sidebar {\n float: right;\n width: 14em;\n font-size: 8pt;\n border-left: 1px solid #aaa;\n border-bottom:1px solid #aaa;\n}\n\n#sidebarOptions {\n color: #666 !important;\n background-color: #f3f3f3 !important;\n}\n\n#sidebar #sidebarOptions a:hover{\n background-color: #f3f3f3;\n}\n\n#contentWrapper #sidebar a:hover{\n color: #b44;\n text-decoration: underline;\n}\n\n#contentWrapper .sidebarSubHeading {\n font-size: 0.95em;\n color: #236;\n}\n\n#contentWrapper #commandPanel {\n padding-top: 0.5em;\n background-color: #f3f3f3;\n color: black;\n font-size: 8pt;\n}\n\n#contentWrapper #commandPanel a {\n display: block;\n padding: 0.3em 0.2em 0.3em 1em;\n color: #666;\n text-decoration: none;\n}\n\n#contentWrapper #commandPanel a:hover {\n color: #922;\n text-decoration: underline;\n background-color: transparent;;\n}\n\n#contentWrapper #commandPanel input {\n margin: 0.4em 0em 0.3em 1em;\n border: 1px solid black;\n}\n\n#contentWrapper #optionsPanel {\n display: none;\n background-color: #f3f8ff;\n padding: 0.5em 0.5em 0em 0.5em;\n font-size: 7pt;\n color: black;\n}\n\n#contentWrapper #optionsPanel a:link, #optionsPanel a:visited {\n color: #666;\n font-weight: bold;\n}\n\n#contentWrapper #optionsPanel a:hover {\n color: #922;\n text-decoration: underline;\n background-color: transparent;\n}\n\n.optionsText {\n margin-top: 0.25em;\n margin-bottom: 0.75em;\n}\n\n.optionsItem {\n}\n/*========================================================================*/\n#contentWrapper #sidebarTabs {\n background-color: #f3f3f3;\n padding: 0em;\n}\n\n#contentWrapper #sidebarTabs a {\n color: black;\n background-color: transparent;\n}\n\n#contentWrapper #sidebarTabs a:hover {\n color: #922; text-decoration: underline;\n background-color: transparent;\n}\n\n#contentWrapper #sidebarTabs a:active {\n color: black;\n}\n\n#contentWrapper .tabContentTags #popup {\n display: none;\n position: absolute;\n top: 1em;\n left: 13.25em;\n font-size: 8pt;\n color: #888;\n background-color: #e4e4e4;\n padding: 0;\n margin-top: -2px;\n border-top: 1px solid #aaa;\n border-bottom: 1px solid #330000;\n border-right: 1px solid #330000;\n border-left: 1px solid #aaa;\n}\n\n#contentWrapper .tabContentTags #popup hr {\n color: #ccc;\n}\n\nhr{\n color: black !important;\n}\n\n#contentWrapper .tabContentTags #popup a {\n display: block;\n color: #888;\n min-width: 8em;\n border: 0;\n margin: 0;\n height: 1.2em;\n}\n\n#contentWrapper .tabContentTags #popup a:hover {\n background-color: #e4e4e4;\n color: black;\n}\n\n#contentWrapper a.tab {\n font-weight: normal;\n display: inline;\n margin: 0px 1px; \n border:1px solid #aaa;\n border-bottom:none;\n}\n\n#contentWrapper a.tabSelected {\n background-color: #e6e6e6 !important;\n padding: 2px 4px 2px 4px;\n}\n\n#contentWrapper a.tabUnselected {\n background-color: #f3f3f3;\n padding: 2px 4px 0px 4px;\n}\n\n/*===========================================================================================*/\n/*===========================================================================================*/\n#sidebarTabs{\n margin: 0;\n padding: 0;\n}\n\n#contentWrapper .tabContents {\n background-color: #e6e6e6;\n border-bottom: solid #aaa 1px;\n}\n\n#contentWrapper .tabContents a.tiddlyLink, #contentWrapper .tabContents a.button{\n background-color: #e6e6e6;\n color: #922 !important;\n}\n\n#contentWrapper .tabContents a:hover{\n color: #b44 !important;\n}\n\n#contentWrapper .txtMoreTab a.tabUnselected {\n background-color: #e6e6e6;\n padding: 2px 4px 0px 4px;\n}\n\n#contentWrapper .txtMoreTab a.tabSelected {\n background-color: #ccc !important;\n padding: 2px 4px 2px 4px;\n}\n\n.txtMoreTab .tabContents {\n background-color: #ccc !important;\n border-bottom: solid #aaa 1px;\n}\n\n.txtMoreTab .tabContents a{\n background-color: transparent !important;\n}\n\n#licensePanel {\n padding: 0.5em 0.2em 0.5em 0.2em;\n}\n\n#licensePanel a {\n display: block;\n padding: 0.2em 0.2em 0.2em 0.2em;\n color: #555;\n}\n\n#licensePanel a:hover {\n text-decoration: none;\n color: #922;\n background-color: transparent;\n}\n\n#storeArea, #copyright {\n display: none;\n}\n\n#floater {\n font-size: 10pt;\n visibility: hidden;\n color: white;\n border: 1px solid #666;\n background-color: white;\n position: absolute;\n padding: 1em 1em 1em 1em;\n display:none;\n}\n\n@media print {\n\n#mainMenu {\n display: none;\n}\n\n#siteTitle {\n display: none;\n}\n\n#siteSubtitle {\n display: none;\n}\n\n#displayArea {\n margin: 1em 1em 0em 1em;\n}\n\n#sidebar {\n display: none;\n}\n\n}\n
The campus of Case Western Reserve University is a place that is comfortable for most everyone. Unfortunately, due to a number of factors including its urban environment, our campus has experienced a statistically higher than average number of incidents requiring the intervention of campus security.\n!!!!Factors\nCampus location aside, there are several other factors that contribute to frequency of these incidents. First, the campus itself is quite open and directly connected to the urban areas nearby. It is frequently difficult to tell whether a given business, park or street is or is not considered 'on campus'. Another factor is the diversity that we all enjoy. There are so many different cultures of people among the students and faculty that it is often quite difficult to tell if the people we meet while going about our daily routine are part of the school or not.\n!!!!Police presence\nCampus security has provided 150 emergency phones throughout the campus, 56 code blue phones around the University Circle area, and 30 security officers who patrol the campus 24 hours a day; however these preventative measures are not enough to ensure full safety among the students and the staff. Police presence is an important deterrent, but campus security offices are only located on the north side of campus.\n!!!!Emergency Phone System\nAnother weak point in our security is the emergency phone system. While the emergency phone stands are useful in filling this presence gap, they are quite scarce and often a victim in need of assistance would have to run quite a distance to find one. The fact that a large number of these stands are not currently functioning only compounds the problem. This means that a victim must survey the area to attempt to locate an emergency stand, and should they find one, they must then run up to it and hope that it is functioning. If it is not, they have lost crucial moments and must try to find another stand if possible. It is evident that this security measure is simply not fast enough in such a time-critical situation.\n!!!!Off Campus\nFinally, while not strictly in the jurisdiction of the campus police, the security of Case students should be considered when they are away from campus. As the administration often encourages students to get out and experience what Cleveland has to offer, it should play some role in their protection while they do so. Whether students walk down to Little Italy for a study break or drive to the Flats to unwind on the weekend, they are very much on their own. Thus Case needs a way to improve the security for students and faculty both on and off campus.
Enter the Case PSD (Portable Security Device). The PSD is a small device, no larger than a keyless entry pad for a car, that you can use to summon help to your exact location quickly and discretely. In short, the PSD is ''//discrete//'', ''//available//'', ''//ubiquitous//'' and ''//free//''.\n!!!!!The PSD is better than a cell phone\nWhile many people have cellular phones, they are not an optimal device to use in an emergency situation. An assailant would easily notice someone taking a phone from their pocket or purse and dialling for help. With the PSD, a simple flick of the lid and a press of the button is all you need to summon help fast - it can ''//discretely//'' be operated while left in a pocket or concealed in the palm of a hand.\n!!!!!The PSD is better than a code-blue phone\nThe code-blue phones on campus make us more secure. However, since their installation a large number of these phones have fallen into disrepair - a victim may try to use a code-blue phone that no longer works. The limited number of code-blue phones also creates a new problem - ''//availability//''. The code-blue phone system requires a victim to consider where they are on campus, to scan the nearby area, and to locate a code-blue phone - all activities that take a certain level of mental acuity that a victim may not have when in a panic situation. In contrast, activating the PSD is a task so simple that it can be done strictly on impulse, from anywhere on campus.\n!!!!!The PSD is proactive\nOnce ~PSDs begin to be distrubited on campus, their existance will be heavily advertised and their presence on campus will become ''//ubiquitous//''. Because of their small form factor, a would-be assailant will have no idea whether a given person is carrying a PSD. This will cause many would-be assailants to decide against assaulting a victim, regardess of whether or not they are carrying a PSD.\n!!!!!The PSD is free\n~PSDs will be ''//freely//'' available from any campus security office to any student, faculty or staff member, or visitor. Only a small deposit will be required to obtain a PSD, so that users are encouraged to return them once they no longer need them.
The Personal Security Device is a small keyring-sized device that students, faculty, staff and visitors can carry with them at all times. This device has a single button shielded by a protective cover that the user can press in an emergency situation. Once the device is activated, it will instantly summon help to the exact location of the user.\n<html><center><img alt="Personal Security Device" src="psd.jpg" /></center></html>
*[[The Problem]]\n*[[The Solution]]
//{{{\n\nversion.extensions.WikiBar = {major: 1, minor: 2, revision: 0, date: new Date(2005,11,21)};\n\n//------------------------------------------------------------------------------------------------\n// the syntax will be applied on the current word\n// params: editor, [[param1],[param2],...]\n//------------------------------------------------------------------------------------------------\napl_wikibar_formatByWord = function(editor, params){\n\n clearMessage();\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 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 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}\n\n// params may be null, string or array\nfunction processSyntaxParams(syntaxStr, params)\n{\n try{\n\n var pcr = "AplWikibarPcr"; // percent character replacement\n var rx=null;\n var allParams=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 // hide % character\n params[i] = params[i].replace(new RegExp('%',"g"), pcr).trim();\n rx = "(\s\s[%"+(i+1)+"\s\s])" + "|" + "(%"+(i+1)+")";\n syntaxStr = syntaxStr.replace(new RegExp(rx,"g"), params[i] );\n }\n }\n allParams = params.join(' ').trim();\n }\n else{ // string\n allParams = params.replace(new RegExp('%',"g"), pcr).trim(); // hide % character\n rx = /(\s[%1{1}\s])|(%1{1})/g;\n syntaxStr = syntaxStr.replace(rx, allParams);\n } \n }\n \n // replace parameter: %N\n if(allParams)\n syntaxStr = syntaxStr.replace(new RegExp('%N{1}',"g"), allParams);\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 // recover % character\n syntaxStr=syntaxStr.replace(new RegExp(pcr,"g"), '%');\n \n return syntaxStr;\n \n } catch(ex){\n// displayMessage('processSyntaxParams(): '+ex);\n return null;\n }\n}\n\n//------------------------------------------------------------------------------------------------\n// common format function\n//------------------------------------------------------------------------------------------------\napl_wikibar_format = function(editor, params){\n\n clearMessage();\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}\n\n\n//------------------------------------------------------------------------------------------------\n// if selected text, replace it\n// else insert it\n//------------------------------------------------------------------------------------------------\napl_wikibar_formatByCursor = function(editor, params){\n\n clearMessage();\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 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}\n\n//------------------------------------------------------------------------------------------------\n// the syntax will be applied on the current line\n//------------------------------------------------------------------------------------------------\napl_wikibar_formatByLine = function(editor, params)\n{\n\n clearMessage();\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 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 }\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 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 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}\n\n//------------------------------------------------------------------------------------------------\n// the syntax will be applied on the table cell(if exist)\n//------------------------------------------------------------------------------------------------\napl_wikibar_formatByTableCell = function(editor, params){\n\n clearMessage();\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 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 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 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}\n\n\n//------------------------------------------------------------------------------------------------\n// param: editor, button_pressed\n//------------------------------------------------------------------------------------------------\napl_wikibar_selectColorPalette = function(editor, theTarget)\n{\n if(!apl_wikibar_colorTool) return;\n\n apl_wikibar_colorTool.createPaletteSelector(theTarget);\n}\n\napl_wikibar_getColorCode = function(editor, theTarget)\n{\n if(!apl_wikibar_colorTool) return;\n \n apl_wikibar_colorTool.targetSyntax = this;\n apl_wikibar_colorTool.targetEditor = editor;\n apl_wikibar_colorTool.moveColorPicker(theTarget); \n}\n\napl_wikibar_getLinkUrl = function(editor)\n{\n var url= prompt('Please enter the link target', this.param);\n if (url && url.trim().length>0)\n this.format(editor, url);\n}\n\napl_wikibar_getTableRowCol = function(editor)\n{\n var rc= prompt('Please enter rows x cols of the table', '2 x 3');\n if (!rc || (rc.trim()).length==0) 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().length>0) \n this.format(editor, txtTable);\n \n}\n\napl_wikibar_getMacroParam = function(editor)\n{\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}\n\n\n//------------------------------------------------------------------------------------------------\n// hijack createTiddlerEditor() to create WikiBar\n//------------------------------------------------------------------------------------------------\nwindow.apl_wikibar_createTiddlerEditor = window.createTiddlerEditor;\nwindow.createTiddlerEditor = function (title)\n{\n // call original function\n apl_wikibar_createTiddlerEditor(title);\n \n // create wiki-bar\n apl_wikibar_createWikibar(title);\n}\n\nfunction apl_wikibar_createWikibar(title){\n\n // insert wikisyntax toolbar before editorBodyXXX\n var theEditor = document.getElementById("editorWrapper" + title);\n var theBodyBox = document.getElementById("editorBody" + title);\n \n // create Wikibar\n var theWikibar = createTiddlyElement(theEditor,"div","editorWikibar" + title,"wikibar",null); // CSS: .wikibar\n\n theEditor.insertBefore(theWikibar,theBodyBox);\n \n // create tool buttons\n \n // single button\n \n // about\n var btn = apl_wikibar_createWikibarButton(theWikibar, "&copy;", "about WikiBarPlugin", apl_wikibar_onClickAbout, title);\n if(btn) btn.id = "apl_wikibar_btn_about";\n\n // preview\n btn = apl_wikibar_createWikibarButton(theWikibar, "&infin;", "preview the tiddler", apl_wikibar_onClickPreview, title);\n if(btn) btn.id = "apl_wikibar_btn_preview";\n \n // formattings\n for(i=0; i<apl_wikibar_syntaxes.formattings.length; i++){\n var syntaxObj = apl_wikibar_syntaxes.formattings[i];\n syntax_desc = "apl_wikibar_syntaxes.formattings["+i+"]";\n if(syntaxObj.symbol)\n apl_wikibar_createWikibarButton(theWikibar, syntaxObj.symbol, syntaxObj.tip, apl_wikibar_onClickWikibarButton, title, syntax_desc);\n else\n apl_wikibar_createWikibarButton(theWikibar, syntaxObj.name, syntaxObj.tip, apl_wikibar_onClickWikibarButton, title, syntax_desc);\n }\n \n // dropdown menu\n apl_wikibar_createWikibarButton(theWikibar, "color", "Color", apl_wikibar_onClickWikibarMenu, title, null, "apl_wikibar_syntaxes.colors");\n apl_wikibar_createWikibarButton(theWikibar, "link", "Link", apl_wikibar_onClickWikibarMenu, title, null, "apl_wikibar_syntaxes.links");\n apl_wikibar_createWikibarButton(theWikibar, "Hn", "Heading", apl_wikibar_onClickWikibarMenu, title, null, "apl_wikibar_syntaxes.headings");\n apl_wikibar_createWikibarButton(theWikibar, "list", "List", apl_wikibar_onClickWikibarMenu, title, null, "apl_wikibar_syntaxes.lists");\n apl_wikibar_createWikibarButton(theWikibar, "paragraph", "Paragraph format", apl_wikibar_onClickWikibarMenu, title, null, "apl_wikibar_syntaxes.paragraphs");\n apl_wikibar_createWikibarButton(theWikibar, "table", "Table", apl_wikibar_onClickWikibarMenu, title, null, "apl_wikibar_syntaxes.tables");\n apl_wikibar_createWikibarButton(theWikibar, "plugin", "Plugin design", apl_wikibar_onClickWikibarMenu, title, null, "apl_wikibar_syntaxes.plugins");\n apl_wikibar_createWikibarButton(theWikibar, "macro", "Macro", apl_wikibar_onClickWikibarMenu, title, null, "apl_wikibar_syntaxes.macros");\n apl_wikibar_createWikibarButton(theWikibar, "date", "Date format string", apl_wikibar_onClickWikibarMenu, title, null, "apl_wikibar_syntaxes.dates");\n apl_wikibar_createWikibarButton(theWikibar, "html", "HTML", apl_wikibar_onClickWikibarMenu, title, null, "apl_wikibar_syntaxes.htmls");\n \n}\n\n//------------------------------------------------------------------------------------------------\n// create wikibar 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_wikibar_createWikibarButton(theToolbar, theText, theTooltip, theAction, title, syntax_obj, syntax_objs)\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 wikibar 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_wikibar_onClickWikibarButton()\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 \n}\n\nfunction apl_wikibar_getComplementColor(c)\n{\n n=parseInt(c.replace('#','0x'));\n nc=0xffffff-n;\n s = nc.toString(16);\n if(s.length<6)\n for(i=0;i<6-s.length;i++)\n s ='0'+s;\n return '#'+s; \n}\n\nfunction apl_wikibar_numToHexColor(n)\n{\n if(typeof(n)=='number' && (n>=0 && n<=255)) {\n s = n.toString(16).toUpperCase();\n return ((s.length==1)? '0'+s : s);\n }\n \n return null;\n}\n\n//------------------------------------------------------------------------------------------------\n// button(<a>) may have other tags, ex: <a><b>B</b></a>\n// when we click the button, the apl_wikibar_onClickWikibarButton 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_wikibar_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_wikibar_resolveClickButton(obj.parentNode); // search the parent\n }\n else{\n return apl_wikibar_resolveClickButton(obj.parentNode); // search the parent\n }\n}\n\n\nfunction apl_wikibar_switchWikibar(wikibar, visible)\n{\n if(!wikibar) return;\n \n var pv=null;\n // hide other buttons\n for(i=0; i<wikibar.childNodes.length; i++){ \n try{\n var theButton = wikibar.childNodes[i];\n\n if(theButton.id == "apl_wikibar_btn_preview") \n pv=theButton;\n\n if(theButton.id != "apl_wikibar_btn_about" && theButton.id != "apl_wikibar_btn_preview")\n theButton.style.display = visible ? "": "none";\n \n }catch(ex){\n ; // ignore object that doesn't has style\n }\n }\n \n if(!pv) return;\n \n // update the caption of preview button\n if(visible){\n pv.innerHTML = "&infin;";\n pv.setAttribute("title", "show previewer");\n }\n else{\n pv.innerHTML = "&larr;";\n pv.setAttribute("title", "back to editor");\n }\n \n}\n\nfunction apl_wikibar_displayAboutBox(theAbout, theTarget)\n{\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}\n\nfunction apl_wikibar_onClickAbout(e)\n{\n if (!e) var e = window.event;\n var theTarget = resolveTarget(e);\n if(!theTarget) return(false);\n \n \n // check if already exist\n var theAbout = document.getElementById("aboutWikibar");\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_wikibar_displayAboutBox(theAbout, theTarget);\n }\n }\n else{ // create theAbout box\n theAbout = document.createElement("div");\n theAbout.setAttribute("id", "aboutWikibar"); // CSS: #aboutWikibar\n theAbout.setAttribute("class", "viewer");\n ver = version.extensions.WikiBar.major + "." + version.extensions.WikiBar.minor + "." + version.extensions.WikiBar.revision;\n theAbout.innerHTML = '<center>WikiBarPlugin Version '+ver+'<br></center><hr><ul>'+\n '<li>Author: <a href="mailto:arphenlin@gmail.com">Arphen Lin</a></li>'+\n '<li>Web: <a href="http://aiddlywiki.sourceforge.net/" target="new">AiddlyWiki</a></li>'+\n '</ul>';\n theAbout.onclick = function(){\n document.getElementById("aboutWikibar").style.display="none";\n }; \n theAbout.setAttribute("relateTo", theTarget.parentNode.id);\n \n document.body.appendChild(theAbout);\n \n apl_wikibar_displayAboutBox(theAbout, theTarget);\n }\n \n e.cancelBubble = true;\n if (e.stopPropagation) e.stopPropagation();\n return(false); \n}\n\nfunction apl_wikibar_onClickPreview(e)\n{\n if (!e) var e = window.event;\n var theTarget = resolveTarget(e);\n if(!theTarget) return(false);\n \n var wikibar = theTarget.parentNode;\n if(!wikibar) return;\n \n title = wikibar.id.substring(13, wikibar.id.length); // "editorWikibar"+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 wikify(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.style.height = (editor.offsetHeight) + "px";\n previewer.setAttribute("class", "viewer");\n previewer.setAttribute("class", "previewer");\n editorWrapper.insertBefore(previewer, editor);\n \n wikify(editor.value, previewer, null, null);\n \n // hide editor\n editor.style.display = "none";\n }\n \n apl_wikibar_switchWikibar(wikibar, (editor.style.display=="block") );\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_wikibar_onClickWikibarButton(e)\n{\n if (!e) var e = window.event;\n var theTarget = apl_wikibar_resolveClickButton(resolveTarget(e));\n if(!theTarget) return(false);\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 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_wikibar_onClickWikibarMenu(e)\n{\n if(!e) var e = window.event;\n var theTarget = resolveTarget(e); // = <span>, the object we click on\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_wikibar_onClickWikibarButton\n );\n\n theItem.setAttribute("syntax_obj", my_syntaxes + "["+i+"]");\n theItem.setAttribute("tiddler_title", title);\n }\n\n scrollToTiddlerPopup(popup,false);\n \n \n e.cancelBubble = true;\n if (e.stopPropagation) e.stopPropagation();\n return(false); \n \n}\n\n\n//------------------------------------------------------------------------------------------------\n// apl_wikibar_ColorTool class\n//------------------------------------------------------------------------------------------------\nfunction apl_wikibar_ColorTool(theAction){\n \n // 16x16 colors\n this.defaultPaletteName = 'default';\n this.defaultColumns = 16;\n this.defaultPalette = [ \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.paletteName = this.defaultPaletteName; \n this.palette = this.defaultPalette;\n this.columns = this.defaultColumns;\n \n this.colorPicker = null; // div object\n\n this.targetSyntax = null; // the syntax object that called apl_wikibar_ColorTool\n this.targetEditor = null; // the editor object that will be applied selected color\n this.theAction = theAction;\n \n// this.createColorPicker();\n\n}\n\napl_wikibar_ColorTool.prototype.renderColorPalette = function() \n{\n\n if(this.paletteName==this.defaultPaletteName){\n this.palette=this.defaultPalette;\n this.columns=this.defaultColumns;\n return;\n }\n \n tiddlerText = (store.getTiddlerText(this.paletteName, '')).trim();\n if(tiddlerText.length==0) return;\n var cpContents = tiddlerText.split('\sn');\n \n var colors=[];\n columns = this.defaultColumns;\n var tmpArray=null;\n errCount=0;\n for(i=0; i<cpContents.length; i++){\n cpLine=cpContents[i].trim();\n\n if( (cpLine==null) || (cpLine.length==0) || (cpLine.charAt(0) == '#') ) continue;\n \n if(cpLine.substring(0,8).toLowerCase()=='columns:'){\n tmpArray = cpLine.split(':');\n try{\n columns = parseInt(tmpArray[1]);\n }catch(ex){\n columns = this.defaultColumns;\n }\n }else{\n tmpArray = cpLine.replace('\st', ' ').split(/[ ]{1,}/);\n \n try{\n color='';\n for(j=0; j<3; j++){\n c=parseInt(tmpArray[j].trim());\n if(isNaN(c)){\n break; // for\n }else{\n c=apl_wikibar_numToHexColor(c);\n if(c==null) break;\n color+=c;\n }\n } // for(j)\n \n if(color.length==6){\n colors.push('#'+color);\n } else {\n throw 'error';\n }\n \n }catch(ex){\n //displayMessage('error line #'+i+': ' + cpLine);\n ; // ignore invalid record\n }\n \n } // else\n \n } // for(i)\n \n if(colors.length>0){\n this.palette = colors;\n this.columns = columns;\n }else{\n throw 'renderColorPalette(): No color defined in the palette.';\n }\n \n}\n\napl_wikibar_ColorTool.prototype.showColorPicker = function() \n{\n if(this.colorPicker){\n this.colorPicker.style.display = "block";\n }\n \n this.closePaletteSelector();\n}\n\napl_wikibar_ColorTool.prototype.hideColorPicker = function() \n{\n if(this.colorPicker){\n this.colorPicker.style.display = "none";\n }\n}\n\n\napl_wikibar_ColorTool.prototype.moveColorPicker = function(theTarget)\n{\n if(!this.colorPicker)\n this.createColorPicker();\n \n var cp = this.colorPicker; \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 = cp.offsetWidth;\n \n var winWidth = findWindowWidth();\n if(popupLeft + popupWidth > winWidth)\n popupLeft = winWidth - popupWidth;\n \n cp.style.left = popupLeft + "px";\n cp.style.top = popupTop + "px";\n this.showColorPicker();\n \n}\n\napl_wikibar_ColorTool.prototype.createColorPicker = function(theTarget, palette) \n{\n if(!this.theAction) return;\n \n if(palette) this.paletteName=palette;\n\n this.renderColorPalette();\n \n // create div\n this.colorPicker = document.createElement("div");\n this.colorPicker.setAttribute("id","colorPicker"); //CSS: #colorPicker\n document.body.appendChild(this.colorPicker);\n\n // create table\n var theTable = document.createElement("table");\n this.colorPicker.appendChild(theTable);\n\n // header row\n var theTR = document.createElement("tr");\n theTable.appendChild(theTR);\n var theTD = document.createElement("td");\n theTD.setAttribute("colspan",this.columns);\n theTD.setAttribute("class", "header"); //CSS: #colorPicker .header\n theTD.innerHTML = this.paletteName;\n theTR.appendChild(theTD);\n \n // create tr/td\n for(i=0; i<this.palette.length; i++){\n // create new row\n if((i%this.columns)==0){ // 16x16\n theTR = document.createElement("tr");\n theTable.appendChild(theTR);\n }\n\n var theTD = document.createElement("td");\n if(this.palette[i].trim() == '')\n theTD.setAttribute("bgcolor", "white");\n else\n theTD.setAttribute("bgcolor", this.palette[i]);\n theTD.setAttribute("class", "cell"); //CSS: #colorPicker .cell\n theTD.onclick = this.theAction;\n theTD.onmouseover = apl_wikibar_onMouseOverColor;\n theTR.appendChild(theTD);\n }\n \n // pad\n rest = this.palette.length % this.columns;\n if(rest>0){\n var theTD = document.createElement("td");\n theTD.setAttribute("colspan",this.columns-rest);\n theTD.setAttribute("bgcolor", "black");\n theTR.appendChild(theTD);\n }\n \n // color info row\n theTR = document.createElement("tr");\n theTable.appendChild(theTR);\n theTD = document.createElement("td");\n theTD.setAttribute("colspan",this.columns);\n theTD.setAttribute("id", "colorPickerInfo"); //CSS: #colorPickerInfo\n theTR.appendChild(theTD); \n\n// //other palette row\n// theTR = document.createElement("tr");\n// theTable.appendChild(theTR);\n// var theTD = document.createElement("td");\n// theTD.setAttribute("colspan",this.columns);\n// theTD.setAttribute("class", "button"); //CSS: #colorPicker .button\n// theTD.onclick = function(){ apl_wikibar_selectColorPalette(null, apl_wikibar_colorTool.colorPicker); };\n// theTD.innerHTML = 'other palette...';\n// theTR.appendChild(theTD);\n\n// // bottom row\n// theTR = document.createElement("tr");\n// theTable.appendChild(theTR);\n// var theTD = document.createElement("td");\n// theTD.setAttribute("colspan",this.columns);\n// theTD.setAttribute("class", "button"); //CSS: #colorPicker .button\n// theTD.onclick = function(){ apl_wikibar_colorTool.hideColorPicker(); };\n// theTD.innerHTML = 'close';\n// theTR.appendChild(theTD);\n \n}\n\napl_wikibar_ColorTool.prototype.closePaletteSelector = function() \n{\n paletteSelector = document.getElementById("paletteSelector");\n if(paletteSelector)\n document.body.removeChild(paletteSelector);\n}\n\napl_wikibar_ColorTool.prototype.createPaletteSelector = function(theTarget)\n{\n var cpTiddlers = store.getTaggedTiddlers("ColorPalettes");\n if(!cpTiddlers) return;\n \n var palettes=[];\n palettes.push(this.defaultPaletteName);\n for(i=0; i<cpTiddlers.length; i++)\n palettes.push(cpTiddlers[i].title.trim());\n \n // check if exist\n var paletteSelector = document.getElementById("paletteSelector");\n if(paletteSelector)\n document.body.removeChild(paletteSelector);\n\n // create paletteSelector\n paletteSelector = document.createElement("div");\n paletteSelector.setAttribute("id","paletteSelector"); // CSS: #paletteSelector\n document.body.appendChild(paletteSelector);\n\n // create table\n var theTable = document.createElement("table");\n paletteSelector.appendChild(theTable);\n \n // create tr/td\n var theTR=null;\n for(i=0; i<palettes.length; i++){\n // create new row\n theTR = document.createElement("tr");\n theTable.appendChild(theTR);\n\n var theTD = document.createElement("td");\n theTD.setAttribute("palette", palettes[i]);\n if(palettes[i]==apl_wikibar_colorTool.paletteName){\n theTD.setAttribute("class", "selected"); // CSS: #paletteSelector .selected\n }else{\n theTD.setAttribute("class", "unSelected"); // CSS: #paletteSelector .unSelected\n }\n theTD.onclick = apl_wikibar_onSelectPalette;\n theTD.innerHTML = palettes[i];\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("class", "button"); // CSS: #paletteSelector .button\n// theTD.onclick = apl_wikibar_colorTool.closePaletteSelector;\n// theTD.innerHTML = 'close';\n// theTR.appendChild(theTD);\n \n // set position\n rootLeft = findPosX(theTarget);\n rootTop = findPosY(theTarget);\n popupLeft = rootLeft;\n popupTop = rootTop;\n\n if(theTarget != apl_wikibar_colorTool.colorPicker){\n rootHeight = theTarget.offsetHeight;\n popupTop += rootHeight;\n \n popupWidth = paletteSelector.offsetWidth;\n \n winWidth = findWindowWidth();\n if(popupLeft + popupWidth > winWidth)\n popupLeft = winWidth - popupWidth;\n }\n \n paletteSelector.style.left = popupLeft + "px";\n paletteSelector.style.top = popupTop + "px";\n paletteSelector.style.display = "block"; \n \n apl_wikibar_colorTool.hideColorPicker();\n \n}\n\n\n//------------------------------------------------------------------------------------------------\n// do on select a color\n//------------------------------------------------------------------------------------------------\nfunction apl_wikibar_onSelectColor(e) \n{\n if (!e) var e = window.event;\n var theTarget = resolveTarget(e); \n if(!theTarget) return(false);\n\n if(!apl_wikibar_colorTool) return;\n \n // get the color\n color = theTarget.getAttribute("bgcolor");\n if(!color) return;\n \n // close it\n apl_wikibar_colorTool.hideColorPicker();\n \n if(apl_wikibar_colorTool.targetSyntax && apl_wikibar_colorTool.targetEditor)\n apl_wikibar_colorTool.targetSyntax.format(apl_wikibar_colorTool.targetEditor, color);\n \n e.cancelBubble = true;\n if (e.stopPropagation) e.stopPropagation();\n return(false); \n}\n\nfunction apl_wikibar_onMouseOverColor(e) \n{\n if (!e) var e = window.event;\n var theTarget = resolveTarget(e);\n if(!theTarget) return(false);\n\n if(!apl_wikibar_colorTool) return;\n \n // get the color \n color = theTarget.getAttribute("bgcolor");\n if(!color) return;\n \n td=document.getElementById("colorPickerInfo");\n if(!td) return;\n \n td.setAttribute("bgcolor", color);\n td.innerHTML = '<span style="color:#000;">'+color+'</span>&nbsp;&nbsp;&nbsp;' +\n '<span style="color:#fff;">'+color+'</span>';\n\n e.cancelBubble = true;\n if (e.stopPropagation) e.stopPropagation();\n return(false); \n \n}\n\nfunction apl_wikibar_onDocumentClick(e)\n{\n if (!e) var e = window.event;\n var theTarget = resolveTarget(e); \n if(!theTarget) return(false);\n\n // 1-CAPTURING_PHASE; 2-AT_TARGET; 3-BUBBLING_PHASE\n if(e.eventPhase == undefined || e.eventPhase == Event.BUBBLING_PHASE || e.eventPhase == Event.AT_TARGET){\n apl_wikibar_colorTool.hideColorPicker();\n apl_wikibar_colorTool.closePaletteSelector();\n var theAbout = document.getElementById("aboutWikibar");\n if(theAbout) theAbout.style.display="none";\n }\n \n return true;\n}\n\n\nfunction apl_wikibar_onSelectPalette(e) \n{\n clearMessage();\n \n if (!e) var e = window.event;\n var theTarget = resolveTarget(e); \n if(!theTarget) return(false);\n \n theTarget.setAttribute("class", "selected");\n \n // get the palette name\n palette = theTarget.getAttribute("palette");\n if(!palette) return;\n \n // recreate colorPicker\n oldPaletteName = apl_wikibar_colorTool.paletteName;\n if(oldPaletteName != palette){\n try{\n apl_wikibar_colorTool.createColorPicker(theTarget, palette);\n displayMessage('Palette "'+palette+'" ('+ apl_wikibar_colorTool.palette.length +' colors) is selected');\n }catch(ex){\n errMsg = ex;\n if(errMsg.substring(0,18)=='renderColorPalette'){\n displayMessage('Invalid palette "' + palette + '", please check it out!');\n apl_wikibar_colorTool.createColorPicker(theTarget, oldPaletteName);\n }\n }\n }\n \n // close\n apl_wikibar_colorTool.closePaletteSelector();\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_wikibar_colorTool = new apl_wikibar_ColorTool(apl_wikibar_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_wikibar_syntaxes = {\n formattings: [\n {\n name: "ignore",\n tip: "ignore wiki word",\n symbol: "~",\n syntax: "~user_text",\n hint: "wiki_word",\n format: apl_wikibar_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_wikibar_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_wikibar_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_wikibar_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_wikibar_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_wikibar_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_wikibar_formatByWord\n },\n {\n name: "comment",\n tip: "comment text",\n symbol: "/%",\n syntax: "/%user_text%/",\n hint: "comment_text",\n format: apl_wikibar_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_wikibar_formatByWord\n },\n {\n name: "line",\n tip: "horizontal line",\n symbol: "&mdash;",\n syntax: "\sn----\sn",\n format: apl_wikibar_formatByCursor\n },\n {\n name: "crlf",\n tip: "line break",\n symbol: "&para;",\n syntax: "\sn",\n format: apl_wikibar_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_wikibar_formatByWord\n },\n {\n name: "palette",\n tip: "select palette",\n syntax: "",\n needParam: apl_wikibar_selectColorPalette\n },\n {\n name: "color",\n tip: "text color",\n hint: "your_text",\n syntax: "@@color(%1):user_text@@",\n format: apl_wikibar_formatByWord,\n needParam: apl_wikibar_getColorCode\n },\n {\n name: "bgcolor",\n tip: "background color",\n hint: "your_text",\n syntax: "@@bgcolor(%1):user_text@@",\n format: apl_wikibar_formatByWord,\n needParam: apl_wikibar_getColorCode\n },\n {\n name: "colorcode",\n tip: "insert colorcode",\n syntax: "%1",\n format: apl_wikibar_formatByCursor,\n needParam: apl_wikibar_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_wikibar_formatByLine\n },\n {\n name: "numbered",\n tip: "numbered list",\n syntax: "#user_text",\n hint: "numbered_text",\n format: apl_wikibar_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_wikibar_formatByLine\n },\n {\n name: "Heading 2",\n tip: "Heading 2",\n syntax: "!!user_text",\n hint: "heading_2",\n format: apl_wikibar_formatByLine\n },\n {\n name: "Heading 3",\n tip: "Heading 3",\n syntax: "!!!user_text",\n hint: "heading_3",\n format: apl_wikibar_formatByLine\n },\n {\n name: "Heading 4",\n tip: "Heading 4",\n syntax: "!!!!user_text",\n hint: "heading_4",\n format: apl_wikibar_formatByLine\n },\n {\n name: "Heading 5",\n tip: "Heading 5",\n syntax: "!!!!!user_text",\n hint: "heading_5",\n format: apl_wikibar_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_wikibar_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_wikibar_formatByLine\n },\n {\n name: "monospaced by line",\n tip: "line monospaced",\n syntax: "{{{\snuser_text\sn}}}",\n hint: "monospaced_text",\n format: apl_wikibar_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_wikibar_formatByLine\n },\n {\n name: "quote by line",\n tip: "line quote",\n syntax: ">user_text",\n hint: "quote_text",\n format: apl_wikibar_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_wikibar_formatByLine\n }\n ], // paragraphs\n links:[\n {\n name: "wiki",\n tip: "wiki link",\n syntax: "[[user_text]]",\n hint: "wiki_word",\n format: apl_wikibar_formatByWord\n },\n {\n name: "pretty",\n tip: "pretty link",\n syntax: "[[user_text|%1]]", \n hint: "pretty_word",\n format: apl_wikibar_formatByWord,\n needParam: apl_wikibar_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_wikibar_formatByWord,\n needParam: apl_wikibar_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_wikibar_formatByWord,\n needParam: apl_wikibar_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_wikibar_formatByLine\n }, \n {\n name: "comment by line",\n tip: "line comment",\n syntax: "//user_text",\n hint: "plugin_comment",\n format: apl_wikibar_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_wikibar_formatByLine\n }\n ], // plugins\n tables:[\n {\n name: "table",\n tip: "create a new table",\n syntax: "\sn%1\sn",\n format: apl_wikibar_formatByWord,\n needParam: apl_wikibar_getTableRowCol\n },\n {\n name: "table header",\n tip: "table header text",\n syntax: "|user_text|c",\n hint: "table_header",\n format: apl_wikibar_formatByWord\n }, \n {\n name: "cell",\n tip: "create a tabel cell",\n syntax: "|user_text|",\n hint: "your_text",\n format: apl_wikibar_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_wikibar_formatByWord\n },\n {\n name: "cell bgcolor",\n tip: "cell bgcolor",\n syntax: "|bgcolor(%1):user_text|",\n hint: "your_text",\n format: apl_wikibar_formatByTableCell,\n needParam: apl_wikibar_getColorCode\n },\n {\n name: "align left",\n tip: "add a tabel cell",\n syntax: "|user_text|",\n hint: "your_text",\n format: apl_wikibar_formatByTableCell\n },\n {\n name: "align center",\n tip: "add a tabel cell",\n syntax: "| user_text |",\n hint: "your_text",\n format: apl_wikibar_formatByTableCell\n },\n {\n name: "align right",\n tip: "add a tabel cell",\n syntax: "| user_text|",\n hint: "your_text",\n format: apl_wikibar_formatByTableCell\n }\n ], // tables\n macros:[\n {\n name: "allTags",\n tip: "allTags",\n syntax: "<<allTags>>",\n format: apl_wikibar_formatByWord\n },\n {\n name: "closeAll",\n tip: "closeAll",\n syntax: "<<closeAll>>",\n format: apl_wikibar_formatByWord\n },\n {\n name: "gradient",\n tip: "gradient",\n syntax: "<<gradient vert #ffffff %1>>user_text>>",\n format: apl_wikibar_formatByWord,\n needParam: apl_wikibar_getColorCode\n },\n {\n name: "list",\n tip: "list",\n syntax: "<<list>>",\n format: apl_wikibar_formatByWord\n },\n {\n name: "list missing",\n tip: "list missing",\n syntax: "<<list missing>>",\n format: apl_wikibar_formatByWord\n },\n {\n name: "list orphans",\n tip: "list orphans",\n syntax: "<<list orphans>>",\n format: apl_wikibar_formatByWord\n }, \n {\n name: "newJournal",\n tip: "newJournal",\n syntax: "<<newJournal>>",\n format: apl_wikibar_formatByWord\n }, \n {\n name: "newTiddler",\n tip: "newTiddler",\n syntax: "<<newTiddler>>",\n format: apl_wikibar_formatByWord\n }, \n {\n name: "option",\n tip: "option",\n syntax: "<<option %1>>[%2]\sn",\n format: apl_wikibar_formatByWord,\n needParam: apl_wikibar_getMacroParam,\n param: 'chkOpenInNewWindow "Open link in new window"'\n }, \n {\n name: "permaview",\n tip: "permaview",\n syntax: "<<permaview>>",\n format: apl_wikibar_formatByWord\n }, \n {\n name: "saveChanges",\n tip: "saveChanges",\n syntax: "<<saveChanges>>",\n format: apl_wikibar_formatByWord\n }, \n {\n name: "search",\n tip: "search",\n syntax: "<<search>>",\n format: apl_wikibar_formatByWord\n }, \n {\n name: "slider",\n tip: "slider",\n syntax: "<<slider %1 %2 %3>>",\n format: apl_wikibar_formatByWord,\n needParam: apl_wikibar_getMacroParam,\n param: "sliderID sliderTiddler sliderLabel"\n }, \n {\n name: "sparkline",\n tip: "sparkline",\n syntax: "<<sparkline %N>>", \n format: apl_wikibar_formatByWord,\n needParam: apl_wikibar_getMacroParam,\n param: "number_list(ex: 100 123 ...)"\n }, \n {\n name: "tabs",\n tip: "tabs",\n syntax: "<<tabs [%N]>>",\n format: apl_wikibar_formatByWord,\n needParam: apl_wikibar_getMacroParam,\n param: "indentifier tabLabel tabName Tiddler"\n }, \n {\n name: "tag",\n tip: "tag",\n syntax: "<<tag %1>>",\n format: apl_wikibar_formatByWord,\n needParam: apl_wikibar_getMacroParam,\n param: "tagName(ex: systemConfig)"\n }, \n {\n name: "tiddler",\n tip: "tiddler",\n syntax: "<<tiddler %1>>",\n format: apl_wikibar_formatByWord,\n needParam: apl_wikibar_getMacroParam,\n param: "Tiddler"\n }, \n {\n name: "timeline",\n tip: "timeline",\n syntax: "<<timeline>>",\n format: apl_wikibar_formatByWord\n }, \n {\n name: "today",\n tip: "today",\n syntax: "<<today [%1]>>", \n format: apl_wikibar_formatByWord,\n needParam: apl_wikibar_getMacroParam,\n param: '"YYYY/MM/DD hh:mm:ss"'\n }, \n {\n name: "version",\n tip: "version",\n syntax: "<<version>>",\n format: apl_wikibar_formatByWord\n }\n ], // macros\n dates:[\n {\n name: "YYYY",\n tip: "full year",\n syntax: "YYYY",\n format: apl_wikibar_formatByCursor\n },\n {\n name: "YY",\n tip: "2-digit year",\n syntax: "YY",\n format: apl_wikibar_formatByCursor\n },\n {\n name: "MMM",\n tip: "month name",\n syntax: "MMM",\n format: apl_wikibar_formatByCursor\n },\n {\n name: "MM",\n tip: "month",\n syntax: "MM",\n format: apl_wikibar_formatByCursor\n },\n {\n name: "0MM",\n tip: "zero-leading month",\n syntax: "0MM",\n format: apl_wikibar_formatByCursor\n },\n {\n name: "DDD",\n tip: "week day",\n syntax: "DDD",\n format: apl_wikibar_formatByCursor\n },\n {\n name: "DD",\n tip: "day",\n syntax: "DD",\n format: apl_wikibar_formatByCursor\n },\n {\n name: "0DD",\n tip: "zero-leading day",\n syntax: "0DD",\n format: apl_wikibar_formatByCursor\n },\n {\n name: "hh",\n tip: "hour",\n syntax: "hh",\n format: apl_wikibar_formatByCursor\n },\n {\n name: "mm",\n tip: "minute",\n syntax: "mm",\n format: apl_wikibar_formatByCursor\n },\n {\n name: "ss",\n tip: "second",\n syntax: "ss",\n format: apl_wikibar_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_wikibar_formatByLine\n }\n ] // htmls\n};\n\n/* style sheet */\nsetStylesheet('/* wikibar */ /* .wikibar .button {color:#59b; background:#eee} .wikibar .button:hover { color:#fff; background:#136; } */ /* aboutWikibar */ #aboutWikibar {position:absolute; z-index:10; background:#fff; border:2px solid red; } /* previewer */ .previewer {overflow:auto; display:block; border:1px solid;} /* colorPicker */ #colorPicker {position:absolute; display:none; z-index:10; margin:0px; padding:0px; } #colorPicker table { margin:0px; padding:0px; border:2px solid black; border-spacing: 0px; border-collapse: collapse; } #colorPicker td {margin:0px; padding:0px; border:1px solid; font-size:11px; text-align:center; cursor:auto;} #colorPicker .header {background: #fff;} #colorPicker .button {background: #fff; cursor:pointer; cursor:hand;} #colorPicker td.button:hover {padding-top:3px; padding-bottom:3px; color:#fff; background:#136;} #colorPicker .cell {padding:4px; font-size:7px; cursor:crosshair;} #colorPicker td.cell:hover {padding:10px;} /* paletteSelector */ #paletteSelector {position:absolute; z-index:10; margin:0px; padding:0px;} #paletteSelector table { margin:0px; padding:0px; border:2px solid black; border-spacing: 0px; border-collapse: collapse; } #paletteSelector td {margin:0px; padding:1px; border:1px solid; font-size:11px; text-align:left; background: #fff; cursor:pointer; cursor:hand;} #paletteSelector td:hover {padding-top:3px; padding-bottom:3px; color:#fff; background:#136;} #paletteSelector .selected {background: #ff9;} #paletteSelector .unSelected {background: #fff;} #paletteSelector .button {text-align:center; background: #fff; }',\n 'WikiBarStyleSheet'\n);\n\n/* event listener */\naddEvent(document,"click", apl_wikibar_onDocumentClick);\n\n//}}}