Changeset 9
- Timestamp:
- 12/22/05 15:54:16 (3 years ago)
- Files:
-
- trunk/AGPLv3 (added)
- trunk/core-comment-pointer-behavior.txt (modified) (1 diff)
- trunk/gpl2-gpl3.xml (modified) (1 diff)
- trunk/GPLv2 (added)
- trunk/lincoln-thanksgiving.xml (modified) (6 diffs)
- trunk/rt-test.pl (modified) (2 diffs)
- trunk/stet-spec.txt (modified) (3 diffs)
- trunk/stet-submit.pl (modified) (5 diffs)
- trunk/stet.css (modified) (3 diffs)
- trunk/stet.js (modified) (9 diffs)
- trunk/tagPSent.pl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/core-comment-pointer-behavior.txt
r6 r9 1 $Id: core-comment-pointer-behavior.txt 3 2005-10-11 17:44:19Z orion $1 $Id: core-comment-pointer-behavior.txt 39 2005-12-13 21:31:52Z orion $ 2 2 3 3 This is a scratchpad for hashing out the functions and objects and trunk/gpl2-gpl3.xml
r8 r9 2 2 <?xml-stylesheet href="selectxpath.xsl" type="text/xsl" ?> 3 3 <!DOCTYPE gpl SYSTEM "gpl3.dtd"> 4 <!-- $Id $ -->4 <!-- $Id: gpl2-gpl3.xml 39 2005-12-13 21:31:52Z orion $ --> 5 5 <gpl> 6 6 <head> trunk/lincoln-thanksgiving.xml
r8 r9 2 2 <?xml-stylesheet href="selectxpath.xsl" type="text/xsl" ?> 3 3 <!DOCTYPE annot SYSTEM "annot.dtd"> 4 5 <!-- $Id: lincoln-thanksgiving.xml 41 2005-12-13 21:35:10Z orion $ --> 4 6 5 7 <annot> … … 21 23 </address> 22 24 </legalnotice> 25 <svn revision="$LastChangedRevision: 41 $"/> 23 26 </head> 24 27 … … 27 30 28 31 <p id="tgiving.p2"> 29 <sent id="tgiving.p2.s1">The year that is drawing towards its close <span class="del" id="tgiving.p2.s1">,</span>has been filled with the32 <sent id="tgiving.p2.s1">The year that is drawing towards its close, has been filled with the 30 33 blessings of fruitful fields and healthful skies.</sent> 31 34 <sent id="tgiving.p2.s2">To these bounties, … … 34 37 extraordinary a nature, that they cannot fail to penetrate and soften 35 38 even the heart which is habitually insensible to the ever watchful 36 providence of <span class="del" id="tgiving.p2.s2">Almighty God</span><span class="add" id="tgiving.p2.s2">random coincidence</span>.</sent>39 providence of Almighty God.</sent> 37 40 <sent id="tgiving.p2.s3">In the midst of a civil war of unequalled 38 41 magnitude and severity, which has sometimes seemed to foreign States … … 49 52 precious metals, have yielded even more abundantly than 50 53 heretofore.</sent> 54 <sent id="tgiving.p2.s5">Population has steadily increased, notwithstanding the 55 waste that has been made in the camp, the siege and the battle-field; 56 and the country, rejoicing in the consciousness of augmented strength 57 and vigor, is permitted to expect continuance of years with large 58 increase of freedom.</sent> 51 59 </p> 52 60 … … 60 68 be solemnly, reverently and gratefully acknowledged as with one heart 61 69 and voice by the whole American People.</sent> 62 <sent id="tgiving.p2.s5">Population has steadily increased, notwithstanding the63 waste that has been made in the camp, the siege and the battle-field;64 and the country, rejoicing in the consciousness of augmented strength65 and vigor, is permitted to expect continuance of years with large66 increase of freedom.</sent>67 70 <sent id="tgiving.p3.s4">I do therefore invite my 68 71 fellow citizens in every part of the United States, and also those who trunk/rt-test.pl
r5 r9 21 21 # and the GNU General Public License along with this program. If not, see 22 22 # <http://www.gnu.org/licenses/>. 23 24 # Copyright (c) 2005 Software Freedom Law Center 25 # Author: Orion Montoya <orion@mdcclv.com> 23 26 24 27 use CGI qw(:standard); … … 57 60 OPERATOR => "=" 58 61 ); 59 $count = $TicketObj->CountAll();62 #$count = $TicketObj->CountAll(); 60 63 #print $TicketObj->loc("Found [quant,_1,annotation].\n",$count); 61 64 trunk/stet-spec.txt
r6 r9 1 1 Specification for stet, a system for public comment on gplv3 2 2 Orion Montoya <orion@diderot.uchicago.edu> 3 $Id: stet-spec.txt 28 2005-11-01 01:45:09Z orion $3 $Id: stet-spec.txt 42 2005-12-15 23:18:11Z orion $ 4 4 5 5 … … 460 460 461 461 462 *** simplified submission based on comment match via procmail and cgi *** 463 464 *** you can highlight the title of the document as an easteregg scratch buffer *** 465 466 462 467 MUSING 463 468 … … 466 471 meta-licensing bootstrap operation: a program whose sole purpose is to 467 472 develop the terms for its own distribution. 473 468 474 469 475 trunk/stet-submit.pl
r5 r9 22 22 # <http://www.gnu.org/licenses/>. 23 23 24 # Copyright (c) 2005 Software Freedom Law Center 25 # Author: Orion Montoya <orion@mdcclv.com> 24 26 25 27 use CGI qw/:standard/; 26 28 use Data::Dumper; 29 use MIME::Base64; 30 use RPC::XML; 31 use RPC::XML::Client; 32 use RPC::XML::Client::send_request; 33 34 use lib '/usr/share/request-tracker3.2/lib'; 35 use lib '/usr/share/request-tracker3.2/libexec'; 27 36 28 37 use lib '/usr/share/request-tracker3.4/lib'; 29 38 use lib '/usr/share/request-tracker3.4/libexec'; 39 30 40 #use RT::Interface::CLI; 31 41 use RT; … … 34 44 35 45 my $returnme; 46 36 47 if(param()) { 37 48 38 49 $url = param('NoteUrl'); 39 50 $dompath = param('DomPath'); 40 51 $selectedtext = param('Selection'); 41 $start = param('StartNode');52 # $start = param('StartNode'); 42 53 $startid = param('StartNodeId'); 43 $end = param('EndNode');54 # $end = param('EndNode'); 44 55 $endid = param('EndNodeId'); 45 56 $notetext = param('NoteText'); 57 58 # ($name, $pass) = split(/:/, decode_base64(cookie('__ac'))); 59 60 $cli = RPC::XML::Client->new('http://stet_auth:fai1Iegh@gplv3.fsf.org:8800/launch/acl_users/Users/acl_users'); 61 $resp = $cli->send_request('system.listMethods'); 46 62 47 63 $returnme .= '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'."\n"; … … 49 65 50 66 $returnme .= "<annotation>\n"; 51 $returnme .= " <n>$notetext </n>\n";67 $returnme .= " <n>$notetext " . (ref $resp) ? join(', ', @{$resp->value}) : "Error: $resp" . "</n>\n"; 52 68 $returnme .= " <e>$endid</e>\n"; 53 69 $returnme .= " <s>$selectedtext</s>\n"; … … 55 71 56 72 73 print 57 74 58 75 # print Dumper($content); … … 98 115 $returnme .= "</response>\n"; 99 116 print $returnme; 117 118 119 120 trunk/stet.css
r7 r9 59 59 // margin-right: 33%; 60 60 // border: 1px dotted #666; 61 width: 65%;61 width: 50%; 62 62 } 63 63 … … 68 68 // left: 80%; 69 69 // top: 0; 70 width: 30%;70 width: 40%; 71 71 font-size: smaller; 72 //left: 70%;72 left: 55%; 73 73 float: right; 74 74 position: absolute; 75 margin-left: 68%;75 //margin-left: 68%; 76 76 // border: 1px dotted #666; 77 77 z-index: 100; … … 81 81 .annotation { 82 82 font-size: smaller; 83 //position: absolute;83 position: absolute; 84 84 //position: relative; 85 float: right;85 //float: right; 86 86 //margin-left: 100%; 87 left: 70%;87 left: 55%; 88 88 //right: -%; 89 width: 25%;89 width: 40%; 90 90 border: 1px dotted #666; 91 91 background: #f0ecb3; 92 92 z-index: 10; 93 clear: right;93 //clear: right; 94 94 } 95 95 96 96 97 97 textarea { 98 background : #f0ecb3;98 background-color: #f0ecb3; 99 99 } 100 100 101 101 p { 102 clear:right; 103 } 102 clear:right; 103 } 104 105 .annoteButton { 106 background-color: #f0ecb3; 107 } trunk/stet.js
r5 r9 20 20 // His license is: 21 21 // You may copy, tweak, rewrite, sell or lease any code example on this site. 22 23 // Copyright (C) 2005 Software Freedom Law Center 24 // Author: Orion Montoya <orion@mdcclv.com> 22 25 23 26 function XpathSel() { … … 215 218 // eval(method + '(\'\', result)'); 216 219 } 220 unOverlap("annotation",5); 221 217 222 218 223 } else { … … 323 328 NoteUrl.setAttribute('type','hidden'); 324 329 330 var DocRevision = document.createElement('input'); 331 DocRevision.setAttribute('id','DocRevision'); 332 DocRevision.setAttribute('name','DocRevision'); 333 DocRevision.setAttribute('type','hidden'); 334 325 335 var cancel = document.createElement('input'); 326 336 cancel.setAttribute('type','button'); … … 329 339 cancel.setAttribute('value','cancel'); 330 340 cancel.setAttribute('onClick','cancelNote("noteify")'); 341 cancel.setAttribute('class','annoteButton'); 331 342 332 343 var theBR = document.createElement('br'); … … 337 348 //submit.onclick = 'dump("clicked submit")'; 338 349 submit.setAttribute('onClick','submitComment()'); 350 submit.setAttribute('class','annoteButton'); 339 351 340 352 noteifyDiv.appendChild(DomPathTxt); … … 350 362 noteifyDiv.appendChild(EndNodeId); 351 363 noteifyDiv.appendChild(NoteUrl); 364 noteifyDiv.appendChild(DocRevision); 365 noteifyDiv.appendChild(theBR); 352 366 noteifyDiv.appendChild(submit); 353 367 noteifyDiv.appendChild(cancel); … … 378 392 } 379 393 if (node.nodeType == 3) { // text node 380 dump("node is "+node.parentNode.id+"\n");394 // dump("node is "+node.parentNode.id+"\n"); 381 395 if (!haveHighlighted) { 382 396 //dump("haven't highlighted\n"); … … 395 409 var ticketLink = rtid ? '<a href="/rt/Ticket/Display.html?id='+rtid+'">[+]</a>' : '[reload for ticket link]'; 396 410 397 paragraphString = paragraphString.replace(re,'<span class="highlight" id="note.'+rtid+'.'+node.parentNode.id+'">$&<span class="annotation" >'+tooltipString+" "+ticketLink+' </span></span>');411 paragraphString = paragraphString.replace(re,'<span class="highlight" id="note.'+rtid+'.'+node.parentNode.id+'">$&<span class="annotation" id="rt'+rtid+'" onmousedown="dragStart(event,\'rt'+rtid+'\')">'+tooltipString+" "+ticketLink+' </span></span>'); 398 412 // dump("replaced on "+$&+"\n"); 399 413 //dump("pString is now "+paragraphString+"\n"); … … 403 417 } 404 418 } 405 } 406 407 408 409 410 window.onload = loadXMLDoc('http://localhost/cgi-bin/rt-test.pl?NoteUrl='+location.href); 419 // dump(getCookie("__ac")); 420 } 421 422 function unOverlap(cls,gapDesired) { 423 items = getElementsByClass(cls); 424 425 for (i = 0; i< (items.length - 1); i++) { 426 //dump("doing item "+i+", a "+items[i]+"\n"); 427 iheight =parseInt(document.defaultView.getComputedStyle(items[i], '').getPropertyValue("height")); 428 ibottom = parseInt(parseInt(items[i].offsetTop) + parseInt(iheight)); 429 //dump("iheight is "+iheight+" ibottom is "+ibottom+"\n"); 430 items[i+1].style.top = items[i+1].offsetTop+"px"; 431 //dump("next offsetTop is "+items[i+1].offsetTop+" ibootom is "+ibottom+"\n"); 432 433 diff = parseInt(ibottom) - parseInt(items[i+1].style.top); 434 //dump("diff is "+diff+"\n"); 435 if (diff >= 0) { 436 items[i+1].style.top = parseInt(parseInt(items[i+1].style.top)+parseInt(diff)+parseInt(gapDesired))+"px"; 437 // dump("items[i+1].style.top = "+parseInt(items[i+1].style.top)+"+"+diff+"+"+gapDesired+"\n"); 438 // dump("top is now "+items[i+1].style.top+"\n"); 439 } 440 } 441 } 442 443 444 //* dragging behavior courtesy of brainjar.com. License is GPL2+ 445 446 //***************************************************************************** 447 // Do not remove this notice. 448 // 449 // Copyright 2001 by Mike Hall. 450 // See http://www.brainjar.com for terms of use. 451 //***************************************************************************** 452 453 // Determine browser and version. 454 455 function Browser() { 456 457 var ua, s, i; 458 459 this.isIE = false; 460 this.isNS = false; 461 this.version = null; 462 463 ua = navigator.userAgent; 464 465 s = "MSIE"; 466 if ((i = ua.indexOf(s)) >= 0) { 467 this.isIE = true; 468 this.version = parseFloat(ua.substr(i + s.length)); 469 return; 470 } 471 472 s = "Netscape6/"; 473 if ((i = ua.indexOf(s)) >= 0) { 474 this.isNS = true; 475 this.version = parseFloat(ua.substr(i + s.length)); 476 return; 477 } 478 479 // Treat any other "Gecko" browser as NS 6.1. 480 481 s = "Gecko"; 482 if ((i = ua.indexOf(s)) >= 0) { 483 this.isNS = true; 484 this.version = 6.1; 485 return; 486 } 487 } 488 489 var browser = new Browser(); 490 491 // Global object to hold drag information. 492 493 var dragObj = new Object(); 494 dragObj.zIndex = 0; 495 496 function dragStart(event, id) { 497 498 var el; 499 var x, y; 500 501 // If an element id was given, find it. Otherwise use the element being 502 // clicked on. 503 504 if (id) 505 dragObj.elNode = document.getElementById(id); 506 else { 507 if (browser.isIE) 508 dragObj.elNode = window.event.srcElement; 509 if (browser.isNS) 510 dragObj.elNode = event.target; 511 512 // If this is a text node, use its parent element. 513 514 if (dragObj.elNode.nodeType == 3) 515 dragObj.elNode = dragObj.elNode.parentNode; 516 } 517 518 // Get cursor position with respect to the page. 519 520 if (browser.isIE) { 521 x = window.event.clientX + document.documentElement.scrollLeft 522 + document.body.scrollLeft; 523 y = window.event.clientY + document.documentElement.scrollTop 524 + document.body.scrollTop; 525 } 526 if (browser.isNS) { 527 x = event.clientX + window.scrollX; 528 y = event.clientY + window.scrollY; 529 } 530 531 // Save starting positions of cursor and element. 532 533 dragObj.cursorStartX = x; 534 dragObj.cursorStartY = y; 535 536 dragObj.elStartLeft = parseInt(dragObj.elNode.offsetLeft, 10); 537 dragObj.elStartTop = parseInt(dragObj.elNode.offsetTop, 10); 538 539 if (isNaN(dragObj.elStartLeft)) dragObj.elStartLeft = 0; 540 if (isNaN(dragObj.elStartTop)) dragObj.elStartTop = 0; 541 542 // Update element's z-index. 543 544 dragObj.elNode.style.zIndex = ++dragObj.zIndex; 545 546 // Capture mousemove and mouseup events on the page. 547 548 if (browser.isIE) { 549 document.attachEvent("onmousemove", dragGo); 550 document.attachEvent("onmouseup", dragStop); 551 window.event.cancelBubble = true; 552 window.event.returnValue = false; 553 } 554 if (browser.isNS) { 555 document.addEventListener("mousemove", dragGo, true); 556 document.addEventListener("mouseup", dragStop, true); 557 event.preventDefault(); 558 } 559 } 560 561 function dragGo(event) { 562 563 var x, y; 564 565 // Get cursor position with respect to the page. 566 567 if (browser.isIE) { 568 x = window.event.clientX + document.documentElement.scrollLeft 569 + document.body.scrollLeft; 570 y = window.event.clientY + document.documentElement.scrollTop 571 + document.body.scrollTop; 572 } 573 if (browser.isNS) { 574 x = event.clientX + window.scrollX; 575 y = event.clientY + window.scrollY; 576 } 577 578 // Move drag element by the same amount the cursor has moved. 579 // dump("left starts as "+dragObj.elStartLeft+"; top starts as "+dragObj.elStartTop+"\n"); 580 // dump("x is "+x+" and y is "+y+"\n"); 581 582 // dragObj.elNode.style.left = (dragObj.elStartLeft + x - dragObj.cursorStartX) + "px"; 583 // dragObj.elNode.style.top = (dragObj.elStartTop + y - dragObj.cursorStartY) + "px"; 584 585 dragObj.elNode.style.left = (dragObj.elStartLeft + x - dragObj.cursorStartX) + "px"; 586 dragObj.elNode.style.top = (dragObj.elStartTop + y - dragObj.cursorStartY) + "px"; 587 588 589 590 // dump("left is now "+dragObj.elNode.style.left+"; top is now "+dragObj.elNode.style.top+"\n"); 591 592 if (browser.isIE) { 593 window.event.cancelBubble = true; 594 window.event.returnValue = false; 595 } 596 if (browser.isNS) 597 event.preventDefault(); 598 } 599 600 function dragStop(event) { 601 602 // Stop capturing mousemove and mouseup events. 603 604 if (browser.isIE) { 605 document.detachEvent("onmousemove", dragGo); 606 document.detachEvent("onmouseup", dragStop); 607 } 608 if (browser.isNS) { 609 document.removeEventListener("mousemove", dragGo, true); 610 document.removeEventListener("mouseup", dragStop, true); 611 } 612 } 613 614 /* cookie stuff also from Brainjar 2001, see above and */ 615 /* http://www.brainjar.com for terms of use (GPL2+) */ 616 617 function createCookie(name,value,days) 618 { 619 if (days) 620 { 621 var date = new Date(); 622 date.setTime(date.getTime()+(days*24*60*60*1000)); 623 var expires = "; expires="+date.toGMTString(); 624 } 625 else var expires = ""; 626 document.cookie = name+"="+value+expires+"; path=/"; 627 } 628 function saveIt(name) 629 { 630 var x = document.forms[0].cookievalue.value; 631 if (!x) 632 alert('Please fill in a value in the input box.'); 633 else 634 createCookie(name,x,7); 635 } 636 function readCookie(name) 637 { 638 var nameEQ = name + "="; 639 var ca = document.cookie.split(';'); 640 for(var i=0;i<ca.length;i++) 641 { 642 var c = ca[i]; 643 while (c.charAt(0)==' ') c = c.substring(1,c.length); 644 if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); 645 } 646 return null; 647 } 648 649 function eraseCookie(name) 650 { 651 createCookie(name,"",-1); 652 } 653 654 function readIt(name) 655 { 656 alert('The value of the cookie is ' + readCookie(name)); 657 } 658 659 function eraseIt(name) 660 { 661 eraseCookie(name); 662 alert('Cookie erased'); 663 } 664 665 // end of brainjar code 666 667 668 // http://www.webreference.com/js/column8/functions.html 669 670 function getCookie(name) { 671 var dc = document.cookie; 672 var prefix = name + "="; 673 var begin = dc.indexOf("; " + prefix); 674 if (begin == -1) { 675 begin = dc.indexOf(prefix); 676 if (begin != 0) return null; 677 } else 678 begin += 2; 679 var end = document.cookie.indexOf(";", begin); 680 if (end == -1) 681 end = dc.length; 682 return unescape(dc.substring(begin + prefix.length, end)); 683 } 684 685 function initPage() { 686 loadXMLDoc('http://localhost/cgi-bin/rt-test.pl?NoteUrl='+location.href); 687 } 688 689 690 window.onload = initPage(); trunk/tagPSent.pl
r7 r9 19 19 20 20 21 # Copyright (c) 2005 Software Freedom Law Center 22 # Author: Orion Montoya <orion@mdcclv.com> 21 23 22 24 use Lingua::EN::Sentence qw( get_sentences add_acronyms );