Changeset 13
- Timestamp:
- 01/16/06 17:56:11 (3 years ago)
- Files:
-
- trunk/agree.pl (modified) (6 diffs)
- trunk/email.html (added)
- trunk/lincoln-thanksgiving.xml (modified) (1 diff)
- trunk/rt-test.pl (modified) (5 diffs)
- trunk/sarissa.js (added)
- trunk/sarissa_dhtml.js (added)
- trunk/sarissa_ieemu_xpath.js (added)
- trunk/sarissa_ieemu_xslt.js (added)
- trunk/searchhi.js (modified) (3 diffs)
- trunk/selectxpath.xsl (modified) (3 diffs)
- trunk/stet-debug.css (added)
- trunk/stet-devel.js (added)
- trunk/stet-newhl.js (added)
- trunk/stet-nodebug.js (added)
- trunk/stet-quickerhl.js (added)
- trunk/stet-quickhl.js (added)
- trunk/stet-safe.js (added)
- trunk/stet-sarissa.js (added)
- trunk/stet-submit.pl (modified) (3 diffs)
- trunk/stet-withintense.js (added)
- trunk/stet.css (modified) (8 diffs)
- trunk/stet.js (modified) (32 diffs)
- trunk/stetsubs.pl (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/agree.pl
r11 r13 45 45 if (($name, $pass) = split(/:/, decode_base64(cookie('__ac')))) { 46 46 $name =~ s/\"//g; 47 $server = Frontier::Client->new(url => "http://gplv3.fsf.org:8800/launch/acl_users/Users/acl_users",47 $server = Frontier::Client->new(url => 'http://stet_auth:fai1Iegh@gplv3.fsf.org:8800/launch/acl_users/Users/acl_users', 48 48 username => "stet_auth", 49 49 password => "fai1Iegh"); … … 71 71 #print Dumper($values); 72 72 #print "ticket has ".$values->count." customfieldvalues\n"; 73 if ($opn =~ /unagree/) { 73 # this is trusting the user input, but it really needs to check the values 74 if (($opn =~ /unagree/) && ($values->HasEntry($name))) { 74 75 ($bool, $message) = $Ticket->DeleteCustomFieldValue(Field => "7", Value => $name); 75 76 $agreebool = "unagree"; … … 78 79 79 80 else { 80 ($bool, $message) = $Ticket->AddCustomFieldValue(Field => "7", Value => $name); 81 print STDERR "AddCustomFieldValue said $bool, $message\n"; 82 $agreebool = "agree"; 81 if (!$values->HasEntry($name)) { 82 ($bool, $message) = $Ticket->AddCustomFieldValue(Field => "7", Value => $name); 83 print STDERR "AddCustomFieldValue said $bool, $message\n"; 84 $agreebool = "agree"; 85 } 83 86 } 87 if (!$agreebool) { $agreebool = "stop it"; } 84 88 # } 85 89 # } … … 94 98 95 99 # if (${$resp} == 0) { 100 if ($agreebool =~ /agree/) { 96 101 print header('text/xml'); 97 102 … … 100 105 <response> 101 106 <agreement> 107 <cs>You now $agreebool with <a href="/comments/rt/readsay.html?id=$id">$id</a>. <a href=\"/rt/NoAuth/changeshown.html\">change shown comments</a></cs> 102 108 <id>$id</id> 103 109 <b>$agreebool</b> … … 106 112 107 113 EOF 114 } 115 elsif ($agreebool =~ "stop it") { 116 print header('text/xml'); 117 118 print <<"EOF"; 119 <?xml version="1.0" encoding="UTF-8" standalone="yes"?> 120 <response> 121 <agreement> 122 <cs>Hmm, I'm confused about your agreement. Try again later, or reload to toggle your opinion. <a href=\"/rt/NoAuth/changeshown.html\">change shown comments</a></cs> 123 <id>$id</id> 124 <b>$agreebool</b> 125 </agreement> 126 </response> 127 128 EOF 129 } 130 108 131 #} 109 132 trunk/lincoln-thanksgiving.xml
r9 r13 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 2 <?xml-stylesheet href="selectxpath.xsl" type="text/xsl" ?> 3 <!DOCTYPE annot SYSTEM " annot.dtd">3 <!DOCTYPE annot SYSTEM "gpl3.dtd"> 4 4 5 5 <!-- $Id: lincoln-thanksgiving.xml 41 2005-12-13 21:35:10Z orion $ --> trunk/rt-test.pl
r11 r13 26 26 use lib '/usr/share/request-tracker3.4/lib/'; 27 27 use lib '/etc/request-tracker3.4/'; 28 use RT::Interface::CLI qw(CleanEnv GetCurrentUser GetMessageContent); 28 29 29 use lib '/usr/share/request-tracker3.2/lib/';30 use lib '/etc/request-tracker3.2/';31 32 use MIME::Base64;33 use Frontier::Client;34 35 36 use RT::Interface::CLI qw(CleanEnv GetCurrentUser GetMessageContent);37 use RT::Interface::Web;38 30 39 31 use RT; … … 45 37 use RT::CustomField; 46 38 use Data::Dumper; 39 my $CurrentUser = RT::Interface::CLI::GetCurrentUser(); 40 my $CustomFieldObj = RT::CustomField->new($CurrentUser); 41 #my $Query= " Requestor.EmailAddress LIKE 'moglen' "; 42 my $Query; 43 if(param()) { 47 44 48 sub debug { 49 print STDERR @_ . "\n"; 45 $NoteUrl = param('NoteUrl'); 46 # $Query = " CustomFields.NoteUrl LIKE '$NoteUrl' "; 47 } 48 # else { 49 $Query= " Requestor.EmailAddress LIKE 'moglen' "; 50 #} 50 51 51 } 52 53 $printargs = "default (20 most recent comments)"; 54 55 if (($name, $pass) = split(/:/, decode_base64(cookie('__ac')))) { 56 57 $name =~ s/\"//g; 58 $server = Frontier::Client->new(url => "http://gplv3.fsf.org:8800/launch/acl_users/Users/acl_users", 59 username => "stet_auth", 60 password => "fai1Iegh"); 61 62 63 $resp = $server->call('authRemoteUser',$name,$pass); 64 } 65 else { 66 ${$resp} = 0; 67 } 68 69 if (${$resp} == 0) { 70 print STDERR "auth boolean was 0\n"; 71 } 72 73 74 #my $CurrentUser = RT::Interface::CLI::GetCurrentUser(); 75 #my $CustomFieldObj = RT::CustomField->new($CurrentUser); 76 77 #my $Query; 78 #if(param()) { 79 # $NoteUrl = param('NoteUrl'); 80 # } 81 my $CurrentUser = $RT::SystemUser; 82 my $TicketObj = new RT::Tickets( $CurrentUser ); 83 if (param('WatcherOp') == "LIKE") { 84 $arg = "%".param('ValueOfWatcher')."%"; 85 } 86 else { 87 $arg = param('ValueOfWatcher'); 88 } 89 $Query = param('WatcherField')." ".param('WatcherOp'). 'Requestor.Name LIKE "%'.param('ValueOfWatcher').'%"' 52 my $TicketObj = new RT::Tickets( $RT::SystemUser ); 90 53 $TicketObj->FromSQL($Query); 91 %session = '';92 # as a result of next line, searches are *not* sticky.93 94 %ARGS = param();95 54 $TicketObj->Query(); 96 &LimitByArgs; 97 98 99 100 101 # $TicketObj->FromSQL($Query); 102 103 # $TicketObj->LimitCustomField( 104 # CUSTOMFIELD => 3, 105 # VALUE => $NoteUrl, 106 # OPERATOR => "=" 107 # ); 108 109 55 $TicketObj->LimitCustomField( 56 CUSTOMFIELD => 3, 57 VALUE => $NoteUrl, 58 OPERATOR => "=" 59 ); 110 60 $count = $TicketObj->CountAll(); 111 print STDERR$TicketObj->loc("Found [quant,_1,annotation].\n",$count);61 #print $TicketObj->loc("Found [quant,_1,annotation].\n",$count); 112 62 113 63 print header('text/xml'); … … 118 68 my $annotation; 119 69 while (my $item = $TicketObj->Next) { 120 $annotation = "";70 $annotation = ""; 121 71 my $Transactions = $item->Transactions; 122 while (my $Transaction = $Transactions->Next) { 123 next unless ($Transaction->Type =~ /^(Create|Correspond|Comment$)/); 124 125 my $attachments = $Transaction->Attachments; 126 # my $CustomFields = $item->QueueObj->TicketCustomFields(); 127 my $CustomFields = $item->QueueObj->CustomFields(); 128 $attachments->GotoFirstItem; 129 my $message = $attachments->Next; 130 $annotation .= $message->Content; 131 } 72 while (my $Transaction = $Transactions->Next) { 73 next unless ($Transaction->Type =~ /^(Create|Correspond|Comment$)/); 132 74 133 $showagree = ''; 134 $agr_vals = $item->CustomFieldValues(7); 135 if ($$resp == 1) { 136 137 while ($value = $agr_vals->Next) { 138 if (($name) && ($value->Content eq $name)) { 139 print STDERR "the user agrees with ".$item->id."\n"; 140 # $showagree = "<a label=\"you have indicated that you agree with this\" name=\"you have indicated that you agree with this\">unagree</a>"; 141 $showagree = "unagree"; 142 } 143 } 144 if (!$showagree) { 145 $showagree = "agree"; 146 } 147 } 148 else { 149 $showagree = "<a href=\"gplv3.fsf.org:8800/launch/login_form\">login</a> to agree"; 150 151 } 152 153 #print "ticket has ".$values->count." customfieldvalues\n"; 154 75 my $attachments = $Transaction->Attachments; 76 my $CustomFields = $item->QueueObj->TicketCustomFields(); 77 $attachments->GotoFirstItem; 78 my $message = $attachments->Next; 79 $annotation .= $message->Content; 80 } 155 81 # 156 82 # my $Attachs = $item->TransactionObj->Attachments->First; … … 158 84 # while (my $CustomField = $CustomFields->Next()) { 159 85 # my $CustomFieldValues=$Ticket->CustomFieldValues($CustomField->Id); 160 $returnme .= "<cs>Currently showing: $printargs. <a href=\"javascript:newQuery()\">change</a></cs>\n"; 161 $returnme .= "<annotation>\n"; 86 $returnme .= "<annotation>\n"; 162 87 # $returnme .= " <url>" . $item->FirstCustomFieldValue('NoteUrl') . "</url>\n"; 163 88 # $returnme .= " <dompath>" . $item->FirstCustomFieldValue('NoteDomPath') . "</dompath>\n"; 164 $returnme .= " <n>$annotation</n>\n"; 165 $returnme .= " <e>" . $item->FirstCustomFieldValue('NoteEndNodeId') . "</e>\n"; 166 $noteSelection = $item->FirstCustomFieldValue('NoteSelection'); 167 $noteSelection =~ s/</</g; 168 $noteSelection =~ s/>/>/g; 169 $returnme .= " <s>" . $noteSelection . "</s>\n"; 170 $returnme .= " <i>" . $item->FirstCustomFieldValue('NoteStartNodeId') . "</i>\n"; 171 $returnme .= " <u>" . $item->Requestors->MemberEmailAddressesAsString . "</u>\n"; 172 $returnme .= " <ua>" . $showagree . "</ua>\n"; 173 $returnme .= " <at>" . $agr_vals->count . "</at>\n"; 89 $returnme .= " <n>$annotation</n>\n"; 90 $returnme .= " <e>" . $item->FirstCustomFieldValue('NoteEndNodeId') . "</e>\n"; 91 $returnme .= " <s>" . $item->FirstCustomFieldValue('NoteSelection') . "</s>\n"; 92 $returnme .= " <i>" . $item->FirstCustomFieldValue('NoteStartNodeId') . "</i>\n"; 93 174 94 $returnme .= " <id>" . $item->id . "</id>\n"; 175 $returnme .= "</annotation>\n";176 177 # print STDERR Dumper($item);178 # print STDERR $item->requestors; 95 $returnme .= "</annotation>\n"; 96 97 # print Dumper($content); 98 179 99 } 180 100 … … 184 104 print $returnme; 185 105 #print Dumper($TicketObj); 186 187 # LimitByArgs adapted from $RT/lib/Interface/Web.pm's ProcessSearchQuery188 # (out of desperation)189 190 sub LimitByArgs {191 192 # {{{ Limit priority193 if ( param('ValueOfPriority') ne '' ) {194 $TicketObj->LimitPriority(195 VALUE => param('ValueOfPriority'),196 OPERATOR => param('PriorityOp')197 );198 debug('limiting by '.param('ValueOfPriority'));199 }200 201 # }}}202 # {{{ Limit owner203 if ( param('ValueOfOwner') ne '' ) {204 $TicketObj->LimitOwner(205 VALUE => param('ValueOfOwner'),206 OPERATOR => param('OwnerOp')207 );208 debug('limiting by '.param('ValueOfOwner'));209 }210 211 # }}}212 # {{{ Limit requestor email213 if ( param('ValueOfWatcher') ne '' ) {214 my ($field, $property) = split(/\./,param('WatcherField'));215 $TicketObj->LimitWatcher(216 # TYPE => $field,217 VALUE => param('ValueOfWatcher'),218 OPERATOR => param('WatcherOp'),219 220 );221 debug('limiting by '.param('ValueOfWatcher'));222 }223 224 # }}}225 # {{{ Limit Queue226 if ( param('ValueOfQueue') ne '' ) {227 $TicketObj->LimitQueue(228 VALUE => param('ValueOfQueue'),229 OPERATOR => param('QueueOp')230 );231 debug('limiting by '.param('ValueOfQueue'));232 }233 234 # }}}235 # {{{ Limit Status236 if ( param('ValueOfStatus') ne '' ) {237 if ( ref( param('ValueOfStatus') ) ) {238 foreach my $value ( @{ param('ValueOfStatus') } ) {239 $TicketObj->LimitStatus(240 VALUE => $value,241 OPERATOR => param('StatusOp'),242 );243 }244 debug('limiting by '.@{param('ValueOfStatus')}[0]);245 }246 else {247 $TicketObj->LimitStatus(248 VALUE => param('ValueOfStatus'),249 OPERATOR => param('StatusOp'),250 );251 debug('limiting by '.param('ValueOfStatus'));252 }253 254 }255 256 # }}}257 # {{{ Limit Subject258 if ( param('ValueOfSubject') ne '' ) {259 my $val = param('ValueOfSubject');260 if (param('SubjectOp') =~ /like/) {261 $val = "%".$val."%";262 }263 $TicketObj->LimitSubject(264 VALUE => $val,265 OPERATOR => param('SubjectOp'),266 );267 debug('limiting by '.$val);268 }269 270 # }}}271 # {{{ Limit Dates272 if ( param('ValueOfDate') ne '' ) {273 my $date = ParseDateToISO( param('ValueOfDate') );274 ARGS{'DateType'} =~ s/_Date$//;275 276 if ( ARGS{'DateType'} eq 'Updated' ) {277 $TicketObj->LimitTransactionDate(278 VALUE => $date,279 OPERATOR => param('DateOp'),280 );281 }282 else {283 $TicketObj->LimitDate( FIELD => ARGS{'DateType'},284 VALUE => $date,285 OPERATOR => param('DateOp'),286 );287 }288 }289 290 # }}}291 # {{{ Limit Content292 if ( param('ValueOfAttachmentField') ne '' ) {293 my $val = param('ValueOfAttachmentField');294 if (param('AttachmentFieldOp') =~ /like/) {295 $val = "%".$val."%";296 }297 $TicketObj->Limit(298 FIELD => param('AttachmentField'),299 VALUE => $val,300 OPERATOR => param('AttachmentFieldOp'),301 );302 }303 304 # }}}305 306 # {{{ Limit CustomFields307 308 foreach my $arg ( keys %ARGS ) {309 my $id;310 if ( $arg =~ /^CustomField(\d+)$/ ) {311 $id = $1;312 }313 else {314 next;315 }316 next unless ( param($arg) );317 318 my $form = param($arg);319 my $oper = param->{ "CustomFieldOp" . $id };320 foreach my $value ( ref($form) ? @{$form} : ($form) ) {321 my $quote = 1;322 if ($oper =~ /like/i) {323 $value = "%".$value."%";324 }325 if ( $value =~ /^null$/i ) {326 327 #Don't quote the string 'null'328 $quote = 0;329 330 # Convert the operator to something apropriate for nulls331 $oper = 'IS' if ( $oper eq '=' );332 $oper = 'IS NOT' if ( $oper eq '!=' );333 }334 $TicketObj->LimitCustomField( CUSTOMFIELD => $id,335 OPERATOR => $oper,336 QUOTEVALUE => $quote,337 VALUE => $value );338 }339 }340 341 342 }343 # {{{ sub ParseDateToISO344 345 =head2 ParseDateToISO346 347 Takes a date in an arbitrary format.348 Returns an ISO date and time in GMT349 350 =cut351 352 sub ParseDateToISO {353 my $date = shift;354 355 my $date_obj = RT::Date->new($session{'CurrentUser'});356 $date_obj->Set(357 Format => 'unknown',358 Value => $date359 );360 return ( $date_obj->ISO );361 }362 363 # }}}364 365 366 367 =cut368 369 # http://gplv3.fsf.org/stet/rt-test.pl?SearchId=new370 Query=371 Format=%27+++%3Cb%3E%3Ca+href%3D%22%2Frt%2FTicket%2FDisplay.html%3Fid%3D__id__%22%3E__id__%3C%2Fa%3E%3C%2Fb%3E%2FTITLE%3A%23%27%2C+%0D%0A%27%3Cb%3E%3Ca+href%3D%22%2Frt%2FTicket%2FDisplay.html%3Fid%3D__id__%22%3E__Subject__%3C%2Fa%3E%3C%2Fb%3E%2FTITLE%3ASubject%27%2C+%0D%0A%27__Status__%27%2C+%0D%0A%27__QueueName__%27%2C+%0D%0A%27__OwnerName__%27%2C+%0D%0A%27__Priority__%27%2C+%0D%0A%27__NEWLINE__%27%2C+%0D%0A%27%27%2C+%0D%0A%27%3Csmall%3E__Requestors__%3C%2Fsmall%3E%27%2C+%0D%0A%27%3Csmall%3E__CreatedRelative__%3C%2Fsmall%3E%27%2C+%0D%0A%27%3Csmall%3E__ToldRelative__%3C%2Fsmall%3E%27%2C+%0D%0A%27%3Csmall%3E__LastUpdatedRelative__%3C%2Fsmall%3E%27%2C+%0D%0A%27%3Csmall%3E__TimeLeft__%3C%2Fsmall%3E%27372 AndOr=AND373 AttachmentField=Subject374 AttachmentOp=LIKE375 ValueOfAttachment=376 QueueOp=%3D377 ValueOfQueue=378 StatusOp=%3D379 ValueOfStatus=380 ActorField=Owner381 ActorOp=%3D382 ValueOfActor=383 WatcherField=Requestor.Name384 WatcherOp=LIKE385 ValueOfWatcher=orion386 DateField=Created387 DateOp=%3C388 ValueOfDate=389 TimeField=TimeWorked390 TimeOp=%3C391 ValueOfTime=392 PriorityField=Priority393 PriorityOp=%3C394 ValueOfPriority=395 LinksField=HasMember396 LinksOp=%3D397 ValueOfLinks=398 idOp=%3C399 ValueOfid=400 %27CF.NoteSelection%27Op=LIKE401 ValueOf%27CF.NoteSelection%27=402 %27CF.NoteDomPath%27Op=LIKE403 ValueOf%27CF.NoteDomPath%27=404 %27CF.NoteUrl%27Op=LIKE405 ValueOf%27CF.NoteUrl%27=406 %27CF.NoteStartNodeId%27Op=LIKE407 ValueOf%27CF.NoteStartNodeId%27=408 %27CF.NoteEndNodeId%27Op=LIKE409 ValueOf%27CF.NoteEndNodeId%27=410 %27CF.NoteText%27Op=LIKE411 ValueOf%27CF.NoteText%27=412 %27CF.Agreeers%27Op=LIKE413 ValueOf%27CF.Agreeers%27=414 AddClause=Add415 Owner=RT%3A%3AUser-12416 Description=417 LoadSavedSearch=418 Link=None419 Title=420 Size=421 Face=422 OrderBy=id423 Order=ASC424 RowsPerPage=50trunk/searchhi.js
r11 r13 1 /* The MIT Licence, for code from kryogenix.org 2 ** 3 ** Code downloaded from the Browser Experiments section of kryogenix.org 4 ** is licenced under the so-called MIT licence. The licence is below. 5 ** 1 /* 2 ** Copyright (c) 2005, 2006 Software Freedom Law Center, Inc. 6 3 ** Copyright (c) 1997-2005 Stuart Langridge 7 4 ** … … 24 21 /* http://www.kryogenix.org/code/browser/searchhi/ */ 25 22 /* Modified 20021006 to fix query string parsing and add case insensitivity */ 23 /* Modified-On-Behalf-of-SFLC-By: Orion Montoya <orion@mdcclv.com> */ 26 24 27 function highlightWord(node,word,tooltip,rtid,altClass) { 28 var haveHighlighted = false; 29 dump("doing highlightword of "+word+"\n"); 30 if (node.hasChildNodes) { 31 var iCN; 32 dump("this node has "+node.childNodes.length+" childNodes\n"); 33 for (iCN=0;iCN<node.childNodes.length;iCN++) { 34 dump("going in to "+node.childNodes[iCN].nodeName+"\nfor "+word+" iCN="+iCN+"\n"); 35 highlightWord(node.childNodes[iCN],word,tooltip,rtid); 25 function highlightWord(node,word,tooltip,altClass) { 26 var haveHighlighted = false; 27 28 // Iterate into this node's childNodes 29 if (!haveHighlighted) { 30 if (node.hasChildNodes) { 31 // dump("iterating into child nodes\n"); 32 var hi_cn; 33 for (hi_cn=0;hi_cn<node.childNodes.length;hi_cn++) { 34 // dump("going in to "+node.childNodes[hi_cn].nodeName+"\nfor "+word+"\n"); 35 highlightWord(node.childNodes[hi_cn],word,tooltip); 36 } 37 // dump("done with child nodes\n"); 38 } 39 36 40 } 37 }38 if (node.nodeType == 3) { // text node39 dump("node is "+node.nodeName+"\n");40 if (!haveHighlighted) {41 dump("haven't highlighted\n");42 paragraph = node.parentNode.parentNode;43 paragraphString = (new XMLSerializer).serializeToString(paragraph);44 paragraphString.replace(/\s+/g,' ');45 tempNodeVal = paragraphString;46 tempWordVal = word;47 tempWordVal = tempWordVal.replace(/\W+/g,'[\\W\\s]+(<[^>]+>)?');48 49 var re = new RegExp(tempWordVal, 'mi');50 // var re = new RegExp("software", 'mig');51 dump("re is "+re+"\n");52 tooltipString = (new XMLSerializer).serializeToString(tooltip);53 var ticketLink = rtid ? '<a href="/rt/Ticket/Display.html?id='+rtid+'">[+]</a>' : '[reload for ticket link]';54 55 paragraphString = paragraphString.replace(re,'<span class="highlight">$&<span class="annotation">'+tooltipString+ticketLink+' </span></span>');56 // dump("replaced on "+$&+"\n");57 dump("pString is now "+paragraphString+"\n");58 node.parentNode.parentNode.innerHTML = paragraphString;59 41 60 // haveHighlighted=true; 61 } 62 } 63 } 64 65 /* if ((ni = tempNodeVal.search(re)) && (ni != -1)) { 42 // And do this node itself 43 if (node.nodeType == 3) { // text node 44 if (!haveHighlighted) { 45 //tempNodeVal = escape(node.nodeValue.toLowerCase()); 46 //tempWordVal = escape(word.toLowerCase()); 47 node.nodeValue = node.nodeValue.replace(/\s+/g,' '); 48 49 tempNodeVal = node.nodeValue; 50 tempWordVal = word; 51 tempWordVal = tempWordVal.replace(/\W+/g,'[\\W\\s]+'); 52 //tempWordVal = tempWordVal.replace(/\W+/g,' '); 53 // dump('trying with\n'+escape(tempWordVal)+'\non\n'+escape(tempNodeVal)+"\n"); 54 var re = new RegExp(tempWordVal, 'mi'); 55 if ((ni = tempNodeVal.search(re)) && (ni != -1)) { 66 56 //if (tempNodeVal.indexOf(tempWordVal) != -1) { 67 dump(tempWordVal+' matched!\n');57 // dump(tempWordVal+' matched!\n'); 68 58 pn = node.parentNode; 69 //if (pn.className != "highlight") {59 if (pn.className != "highlight") { 70 60 // word has not already been highlighted! 71 61 // nv = escape(node.nodeValue); 72 nv = paragraphString;62 nv = node.nodeValue; 73 63 //ni = tempNodeVal.indexOf(tempWordVal); 74 64 // Create a load of replacement nodes … … 78 68 hiwordtext = document.createTextNode(docWordVal); 79 69 hiword = document.createElement("span"); 80 // if (altClass) { dump("altClass is "+altClass+"\n"); } 81 // hiword.className = altClass ? altClass : "highlight"; 82 hiword.className = "highlight"; 83 // tooltiptext = document.createTextNode(tooltip); 84 tooltipString = (new XMLSerializer).serializeToString(tooltip); 85 hiword.title = tooltipString; 86 // dump('tooltiptext is '+tooltiptext.+"\n"); 70 if (altClass) { dump("altClass is "+altClass+"\n"); } 71 hiword.className = altClass ? altClass : "highlight"; 72 hiword.title = tooltip; 87 73 hiword.appendChild(hiwordtext); 88 74 if (tooltip) { 89 75 annote = document.createElement("span"); 90 76 annote.className = "annotation"; 91 linkToTkt = document.createElement("a"); 92 linkToTkt.href = '/rt/Ticket/Display.html?id='+rtid; 93 linkToTkt.appendChild(document.createTextNode('[+]')); 94 annoteText = document.createElement('span'); 95 annoteText.innerHTML = tooltipString; 96 // annoteText.appendChild(tooltiptext); 77 annoteText = document.createTextNode(tooltip); 97 78 annote.appendChild(annoteText); 98 // annote.appendChild(tooltipString);99 annote.appendChild(linkToTkt);100 79 hiword.appendChild(annote); 101 80 } 102 dump(before);103 // pn.innerHTML="";104 81 pn.insertBefore(before,node); 105 82 pn.insertBefore(hiword,node); 106 83 pn.insertBefore(after,node); 107 84 pn.removeChild(node); 85 haveHighlighted = true; 86 } 87 else if (pn.className == "noteLive") { 88 pn.setAttribute("class","highlight"); 89 } 90 } 108 91 } 109 haveHighlighted = true; 92 /* else { */ 93 /* highlightWord(node.parentNode,word,tooltip); */ 94 /* } */ 95 96 } 110 97 111 // }112 // else if (pn.className == "noteLive") {113 // pn.setAttribute("class","highlight");114 // }115 }116 }117 98 } 118 99 119 */ 100 function XPointerHighlight() { 101 // if (!document.createElement) return; 102 // ref = document.referrer; 103 // if (ref.indexOf('?') == -1) return; 104 // qs = ref.substr(ref.indexOf('?')+1); 105 // qsa = qs.split('&'); 106 // for (i=0;i<qsa.length;i++) { 107 // qsip = qsa[i].split('='); 108 // if (qsip.length == 1) continue; 109 // if (qsip[0] == 'q' || qsip[0] == 'p') { // q= for Google, p= for Yahoo 120 110 121 window.onload = loadXMLDoc('http://localhost/cgi-bin/rt-test.pl?NoteUrl='+location.href); 111 // hardcoded = 'copying, distribution and modification'; 112 // hardid = 'terms.0.p2.s1'; 113 114 // words = unescape(qsip[1].replace(/\+/g,' ')).split(/\s+/); 115 // for (w=0;w<words.length;w++) { 116 117 118 // highlightWord(document.getElementsByTagName("body")[0],words[w]); 119 // highlightWord(document.getElementById(hardid),hardcoded); 120 // highlightWord(document.getElementsByTagName("body")[0],hardcoded); 121 122 123 124 // } 125 // } 126 // } 127 } 128 129 //window.onload = XPointerHighlight; 130 window.onload = loadXMLDoc('http://localhost/cgi-bin/rt-test.pl'); trunk/selectxpath.xsl
r12 r13 33 33 <title><xsl:value-of select="//head/title"/></title> 34 34 <script type="text/javascript" src="stet.js"/> 35 <script type="text/javascript" language="javascript"> 36 window.onload = initPage(); 37 </script> 38 35 39 <link rel="stylesheet" type="text/css" href="stet.css"/> 36 40 </head> 37 41 <body onkeypress="checkKeyPressed(event);" bgcolor="#FFFFFF"> 38 42 <div id="topbar" class="topbar"> 39 <span id="statustext" class="statustext">Loading comments. If you're still reading this, it's a strong indication that we do not properly support your browser . You may need to email your commentsinstead, or try another recent Gecko-based browser.</span> <span id="querydiv" style="display:none"></span>43 <span id="statustext" class="statustext">Loading comments. If you're still reading this, it's a strong indication that we do not properly support your browser yet. You may need to <a href="/comments/email.html">email your comments</a> instead, or try another recent Gecko-based browser.</span> <span id="querydiv" style="display:none"></span> 40 44 <span id="login" class="login"></span> 41 45 </div> 46 <div class="portlet" id="portlet-dogear"> 47 <div class="portletBody"> 48 <img alt="" src="http://gplv3.fsf.org/dogear.png" /> 49 </div> 50 </div> 51 52 <h1 id="portal-logo"> 53 <a href="http://gplv3.fsf.org" accesskey="1">GPLv3</a> 54 </h1> 55 56 <ul id="portal-globalnav"> 57 <li class="plain"> 58 <a href="http://gplv3.fsf.org">Home</a></li> 59 <li class="selected"> 60 <a href="http://gplv3.fsf.org/comments/">Comments</a></li> 61 <li class="plain"> 62 <a href="http://gplv3.fsf.org/wiki/">Wiki</a></li> 63 <li class="plain"> 64 <a href="http://gplv3.fsf.org/press">Press</a></li> 65 </ul> 66 67 <ul id="portal-personaltools"> 68 </ul> 69 70 71 42 72 <div id="maintext"> 43 73 <xsl:apply-templates/> … … 58 88 59 89 <xsl:template match="//head"> 60 <section id="title">< p id="title.0"><sent id="title.0.0"><h1><xsl:value-of select="title"/></h1></sent></p>90 <section id="title"><h1><p id="title.0"><sent id="title.0.0"><xsl:value-of select="title"/></sent></p></h1> 61 91 <p id="title.1"><sent id="title.1.0"><xsl:value-of select="pubdate"/></sent></p> 62 92 <p id="status.0"><sent id="status.0.0"><strong><xsl:value-of select="status"/></strong></sent></p> … … 84 114 <xsl:template match="//body"> 85 115 <p><a href="javascript:XpathSel()">select some text and then type "c" to submit comments.</a></p> 86 87 <!-- <p><strong>Notes 2006-01-04</strong> I've broken through a few logjams that have been preventing many comments from displaying, and I'm glad to have exposed several other problems with my method for inserting these comments, but also to see all the comments that have been made so far. The current implementation was already a plan B, and so now I need a plan C. Also I see many of the <em> are not being closed.</p>88 89 <p><strong>Notes 2006-01-06</strong>90 <ul>91 <li>You can now agree with a comment, or once you've agreed you may revoke your agreement if you change your mind.</li>92 <li>Comments are now excerpted if they're long. Toggle them by clicking anywhere on them, or on the [+]</li>93 <li>agreement/disagreement/ticketlink are all behind the [+] now</li>94 <li>Comments now ask you to put a subject or summary: a change in presumption, from presuming brevity to presuming lengthiness.</li>95 </ul>96 </p>97 98 <p>Also, you now need to be <a href="http://gplv3.fsf.org:8800/launch/login_form">logged in</a> to the main gplv3.fsf.org site in order to make comments. Alert box to this effect coming soon.</p>99 100 -->101 116 <!-- <p>Toggle display of <a href="javascript:toggle('add')">additions</a> | <a href="javascript:toggle('del')">deletions</a> [none yet on these documents]</p> --> 102 117 103 118 <xsl:for-each select="section"> 104 <h3><xsl:value-of select="title"/></h3>105 119 <section id="{@id}" name="{@id}"> 120 <p class="sectTitle" id="{@id}.0"><sent id="{@id}.0.0"><xsl:value-of select="title"/></sent></p> 121 <p class="sectTitle sub" id="{@id}.0.0.0"><sent id="{@id}.0.0.0.0"><xsl:value-of select="subtitle"/></sent></p> 106 122 <xsl:for-each select="p"> 107 123 <p id="{@id}" name="{@id}"> trunk/stet-submit.pl
r11 r13 26 26 use Data::Dumper; 27 27 28 use MIME::Base64;29 use Frontier::Client;30 31 use lib '/usr/share/request-tracker3.2/lib';32 use lib '/usr/share/request-tracker3.2/libexec';33 34 28 use lib '/usr/share/request-tracker3.4/lib'; 35 29 use lib '/usr/share/request-tracker3.4/libexec'; 36 37 30 #use RT::Interface::CLI; 38 31 use RT; 39 use RT::Ticket;40 use RT::CurrentUser;41 use RT::Queues;42 require "/var/www/stet/stetsubs.pl";43 RT::LoadConfig();44 RT::Init();45 32 46 33 print header('text/xml'); 47 34 35 my $returnme; 48 36 if(param()) { 37 38 $url = param('NoteUrl'); 39 $dompath = param('DomPath'); 40 $selectedtext = param('Selection'); 41 $start = param('StartNode'); 42 $startid = param('StartNodeId'); 43 $end = param('EndNode'); 44 $endid = param('EndNodeId'); 45 $notetext = param('NoteText'); 49 46 50 $url = param('NoteUrl');51 52 $urlpath = $url;53 $urlpath =~ s/http:\/\/([^\/]+)(\/.*)\?/$2/;54 55 $url =~ s/.*\/([^\/]+)/$1/;56 57 $dompath = param('DomPath');58 $selectedtext = URI::Escape::uri_unescape(param('Selection'));59 $notesubj = URI::Escape::uri_unescape(param('NoteSubj'));60 # $start = param('StartNode');61 $startid = param('StartNodeId');62 # $end = param('EndNode');63 $endid = param('EndNodeId');64 $notetext = URI::Escape::uri_unescape(param('NoteText'));65 66 }67 68 our $name;69 my ($CurrentUser, $resp) = getUser();70 71 print STDERR "auth boolean for $name was $resp\n";72 if ($resp == 0) {73 74 print <<"EOF";75 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>76 <response>77 <cs>Your comment was not submitted because you could not be authenticated. <a href=\"changeshown.html\">change query</a></cs>78 <annotation>79 <u>Authentication error</u>80 <i>$startid</i>81 <e>$endid</e>82 <n>Your comment was not saved. You need to <a href="http://gplv3.fsf.org:8800/launch/login_form?came_from=$urlpath">login</a> in order to make comments. The text of your comment was:<br/> <strong>Subject:</strong>$notesubj<br/>$notetext</n>83 <s>$selectedtext</s>84 <id>x</id>85 <ua>x</ua>86 <at>x</at>87 </annotation>88 </response>89 EOF90 }91 92 93 elsif ($resp == 1) {94 95 param('queue') ? $queue = param('queue') : $queue = "Inbox";96 97 #my $CurrentUser = RT::CurrentUser->new();98 #$CurrentUser->LoadByName($name);99 100 my $ThisQueue = RT::Queue->new($CurrentUser);101 $ThisQueue->Load($queue);102 if ($CurrentUser->HasRight( Right => 'SeeQueue', Object => $ThisQueue )) {103 $realqueue = $queue;104 }105 else {106 $realqueue = "Inbox";107 }108 109 my $returnme;110 47 $returnme .= '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'."\n"; 111 48 $returnme .= "<response>\n"; 112 $returnme .= "<cs>Your comment was submitted. <a href=\"javascript:newQuery()\">change query</a></cs>\n"; 49 113 50 $returnme .= "<annotation>\n"; 114 51 $returnme .= " <n>$notetext</n>\n"; … … 116 53 $returnme .= " <s>$selectedtext</s>\n"; 117 54 $returnme .= " <i>$startid</i>\n"; 118 # two more come after we submit to RT...119 120 121 #print STDERR ref($resp) ? $resp->value : "Error: $resp";122 123 #print STDERR Dumper($resp);124 55 125 56 126 57 58 # print Dumper($content); 59 60 } 61 62 63 64 65 66 RT::LoadConfig(); 67 RT::Init(); 68 use RT::Ticket; 69 use RT::CurrentUser; 70 my $CurrentUser = RT::SystemUser(); 71 127 72 use MIME::Entity; 128 73 129 print STDERR "stet-submit name is '$name'\n";74 print STDERR "Have extra data '$j'\n" if $j; 130 75 my $ticket = new RT::Ticket($CurrentUser); 131 76 my $ticket_body = MIME::Entity->build(Data => $notetext, 132 77 Type => 'text/plain'); 133 my %ticket_vals = ( Queue => $realqueue,134 Subject => $ notesubj,135 # Owner => 'Nobody',136 Requestor => \$CurrentUser, #$name,137 #InitialPriority => '11',138 #FinalPriority => '20',78 my %ticket_vals = ( Queue => 'General', 79 Subject => $selectedtext, 80 Owner => 'root', 81 Requestor => 'moglen@columbia.edu', 82 InitialPriority => '11', 83 FinalPriority => '20', 139 84 MIMEObj => $ticket_body, 140 85 'CustomField-1' => $selectedtext, … … 144 89 'CustomField-5' => $endid, 145 90 'CustomField-6' => $notetext, 146 'CustomField-7' => $name, 147 ); 91 ); 148 92 my ($id, $transaction_object, $err) = $ticket->Create(%ticket_vals); 149 93 print STDERR $err . "\n" if $err; 150 94 151 95 $returnme .= " <id>$id</id>\n"; 152 $returnme .= " <u>$name</u>\n";153 $returnme .= " <ua>unagree</ua>\n";154 $returnme .= " <at>1</at>\n";155 96 156 97 $returnme .= "</annotation>\n"; 157 98 $returnme .= "</response>\n"; 158 99 print $returnme; 159 160 161 }162 trunk/stet.css
r12 r13 22 22 /* along with this software. If not, see <http://www.gnu.org/licenses/>. */ 23 23 24 body { 25 font: 94% Verdana, Lucida, Helvetica, Arial, sans-serif; 26 } 24 27 em.del { 25 28 font-style: normal; … … 78 81 line-height: normal; 79 82 }