Software Freedom Law Center

Changeset 9

Show
Ignore:
Timestamp:
12/22/05 15:54:16 (3 years ago)
Author:
orion
Message:


Files:

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 $ 
    22 
    33This is a scratchpad for hashing out the functions and objects and 
  • trunk/gpl2-gpl3.xml

    r8 r9  
    22<?xml-stylesheet href="selectxpath.xsl" type="text/xsl" ?> 
    33<!DOCTYPE gpl SYSTEM "gpl3.dtd"> 
    4 <!-- $Id$ --> 
     4<!-- $Id: gpl2-gpl3.xml 39 2005-12-13 21:31:52Z orion $ --> 
    55<gpl> 
    66    <head> 
  • trunk/lincoln-thanksgiving.xml

    r8 r9  
    22<?xml-stylesheet href="selectxpath.xsl" type="text/xsl" ?> 
    33<!DOCTYPE annot SYSTEM "annot.dtd"> 
     4 
     5<!-- $Id: lincoln-thanksgiving.xml 41 2005-12-13 21:35:10Z orion $ --> 
    46 
    57<annot> 
     
    2123      </address> 
    2224    </legalnotice> 
     25    <svn revision="$LastChangedRevision: 41 $"/> 
    2326  </head> 
    2427 
     
    2730 
    2831<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 the 
     32 <sent id="tgiving.p2.s1">The year that is drawing towards its close, has been filled with the 
    3033blessings of fruitful fields and healthful skies.</sent> 
    3134 <sent id="tgiving.p2.s2">To these bounties, 
     
    3437extraordinary a nature, that they cannot fail to penetrate and soften 
    3538even 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> 
     39providence of Almighty God.</sent> 
    3740 <sent id="tgiving.p2.s3">In the midst of a civil war of unequalled 
    3841magnitude and severity, which has sometimes seemed to foreign States 
     
    4952precious metals, have yielded even more abundantly than 
    5053heretofore.</sent> 
     54 <sent id="tgiving.p2.s5">Population has steadily increased, notwithstanding the 
     55waste that has been made in the camp, the siege and the battle-field; 
     56and the country, rejoicing in the consciousness of augmented strength 
     57and vigor, is permitted to expect continuance of years with large 
     58increase of freedom.</sent> 
    5159</p> 
    5260 
     
    6068be solemnly, reverently and gratefully acknowledged as with one heart 
    6169and voice by the whole American People.</sent> 
    62  <sent id="tgiving.p2.s5">Population has steadily increased, notwithstanding the 
    63 waste that has been made in the camp, the siege and the battle-field; 
    64 and the country, rejoicing in the consciousness of augmented strength 
    65 and vigor, is permitted to expect continuance of years with large 
    66 increase of freedom.</sent> 
    6770 <sent id="tgiving.p3.s4">I do therefore invite my 
    6871fellow citizens in every part of the United States, and also those who 
  • trunk/rt-test.pl

    r5 r9  
    2121# and the GNU General Public License along with this program. If not, see 
    2222# <http://www.gnu.org/licenses/>. 
     23 
     24# Copyright (c) 2005 Software Freedom Law Center 
     25# Author: Orion Montoya <orion@mdcclv.com> 
    2326 
    2427use CGI qw(:standard); 
     
    5760     OPERATOR => "=" 
    5861); 
    59 $count = $TicketObj->CountAll(); 
     62#$count = $TicketObj->CountAll(); 
    6063#print $TicketObj->loc("Found [quant,_1,annotation].\n",$count); 
    6164 
  • trunk/stet-spec.txt

    r6 r9  
    11Specification for stet, a system for public comment on gplv3 
    22Orion 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 $ 
    44 
    55 
     
    460460 
    461461 
     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 
    462467MUSING 
    463468 
     
    466471meta-licensing bootstrap operation: a program whose sole purpose is to 
    467472develop the terms for its own distribution. 
     473 
    468474 
    469475 
  • trunk/stet-submit.pl

    r5 r9  
    2222# <http://www.gnu.org/licenses/>. 
    2323 
     24# Copyright (c) 2005 Software Freedom Law Center 
     25# Author: Orion Montoya <orion@mdcclv.com> 
    2426 
    2527use CGI qw/:standard/; 
    2628use Data::Dumper; 
     29use MIME::Base64; 
     30use RPC::XML; 
     31use RPC::XML::Client; 
     32use RPC::XML::Client::send_request; 
     33 
     34use lib '/usr/share/request-tracker3.2/lib'; 
     35use lib '/usr/share/request-tracker3.2/libexec'; 
    2736 
    2837use lib '/usr/share/request-tracker3.4/lib'; 
    2938use lib '/usr/share/request-tracker3.4/libexec'; 
     39 
    3040#use RT::Interface::CLI; 
    3141use RT; 
     
    3444 
    3545my $returnme; 
     46 
    3647if(param()) { 
    37      
     48 
    3849$url = param('NoteUrl'); 
    3950$dompath = param('DomPath'); 
    4051$selectedtext = param('Selection'); 
    41 $start = param('StartNode'); 
     52# $start = param('StartNode'); 
    4253$startid = param('StartNodeId'); 
    43 $end = param('EndNode'); 
     54# $end = param('EndNode'); 
    4455$endid = param('EndNodeId'); 
    4556$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'); 
    4662 
    4763$returnme .=  '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'."\n"; 
     
    4965 
    5066$returnme .= "<annotation>\n"; 
    51 $returnme .= " <n>$notetext</n>\n"; 
     67$returnme .= " <n>$notetext " .  (ref $resp) ? join(', ', @{$resp->value}) : "Error: $resp" . "</n>\n"; 
    5268$returnme .= " <e>$endid</e>\n"; 
    5369$returnme .= " <s>$selectedtext</s>\n";  
     
    5571 
    5672 
     73print 
    5774 
    5875#    print Dumper($content); 
     
    98115$returnme .= "</response>\n"; 
    99116print $returnme; 
     117 
     118 
     119 
     120 
  • trunk/stet.css

    r7 r9  
    5959//      margin-right: 33%; 
    6060//        border: 1px dotted #666; 
    61         width: 65%; 
     61        width: 50%; 
    6262 } 
    6363 
     
    6868//      left: 80%; 
    6969//        top: 0; 
    70         width: 30%; 
     70           width: 40%; 
    7171font-size: smaller; 
    72 //left: 70%; 
     72left: 55%; 
    7373float: right; 
    7474position: absolute; 
    75 margin-left: 68%; 
     75//margin-left: 68%; 
    7676//        border: 1px dotted #666; 
    7777z-index: 100; 
     
    8181.annotation {  
    8282font-size: smaller; 
    83 //position: absolute; 
     83position: absolute; 
    8484//position: relative; 
    85 float: right; 
     85//float: right; 
    8686//margin-left: 100%; 
    87 left: 70%; 
     87left: 55%; 
    8888//right: -%; 
    89 width: 25%; 
     89width: 40%; 
    9090border: 1px dotted #666; 
    9191background: #f0ecb3; 
    9292z-index: 10; 
    93 clear: right; 
     93//clear: right; 
    9494 } 
    9595 
    9696 
    9797textarea {  
    98 background: #f0ecb3; 
     98background-color: #f0ecb3; 
    9999 } 
    100100 
    101101p {  
    102 clear:right; 
    103  } 
     102 clear:right; 
     103
     104 
     105.annoteButton { 
     106background-color: #f0ecb3; 
     107
  • trunk/stet.js

    r5 r9  
    2020//  His license is: 
    2121//     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> 
    2225 
    2326function XpathSel() { 
     
    215218        //        eval(method + '(\'\', result)'); 
    216219        } 
     220        unOverlap("annotation",5); 
     221         
    217222 
    218223    } else { 
     
    323328NoteUrl.setAttribute('type','hidden'); 
    324329 
     330var DocRevision = document.createElement('input'); 
     331DocRevision.setAttribute('id','DocRevision'); 
     332DocRevision.setAttribute('name','DocRevision'); 
     333DocRevision.setAttribute('type','hidden'); 
     334 
    325335var cancel = document.createElement('input'); 
    326336cancel.setAttribute('type','button'); 
     
    329339cancel.setAttribute('value','cancel'); 
    330340cancel.setAttribute('onClick','cancelNote("noteify")'); 
     341cancel.setAttribute('class','annoteButton'); 
    331342 
    332343var theBR = document.createElement('br'); 
     
    337348//submit.onclick = 'dump("clicked submit")'; 
    338349submit.setAttribute('onClick','submitComment()'); 
     350submit.setAttribute('class','annoteButton'); 
    339351 
    340352noteifyDiv.appendChild(DomPathTxt); 
     
    350362noteifyDiv.appendChild(EndNodeId); 
    351363noteifyDiv.appendChild(NoteUrl); 
     364noteifyDiv.appendChild(DocRevision); 
     365noteifyDiv.appendChild(theBR); 
    352366noteifyDiv.appendChild(submit); 
    353367noteifyDiv.appendChild(cancel); 
     
    378392  } 
    379393  if (node.nodeType == 3) { // text node 
    380     dump("node is "+node.parentNode.id+"\n"); 
     394//    dump("node is "+node.parentNode.id+"\n"); 
    381395    if (!haveHighlighted) { 
    382396      //dump("haven't highlighted\n"); 
     
    395409    var ticketLink = rtid ? '<a href="/rt/Ticket/Display.html?id='+rtid+'">[+]</a>' : '[reload for ticket link]'; 
    396410     
    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>'); 
    398412    //     dump("replaced on "+$&+"\n"); 
    399413    //dump("pString is now "+paragraphString+"\n"); 
     
    403417    } 
    404418  } 
    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 
     422function unOverlap(cls,gapDesired) { 
     423items = 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 
     455function 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 
     489var browser = new Browser(); 
     490 
     491// Global object to hold drag information. 
     492 
     493var dragObj = new Object(); 
     494dragObj.zIndex = 0; 
     495 
     496function 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 
     561function 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 
     585dragObj.elNode.style.left = (dragObj.elStartLeft + x - dragObj.cursorStartX) + "px"; 
     586dragObj.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 
     600function 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 
     617function 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
     628function 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
     636function 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 
     649function eraseCookie(name) 
     650
     651        createCookie(name,"",-1); 
     652
     653 
     654function readIt(name) 
     655
     656        alert('The value of the cookie is ' + readCookie(name)); 
     657
     658 
     659function 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 
     670function 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 
     685function initPage() { 
     686  loadXMLDoc('http://localhost/cgi-bin/rt-test.pl?NoteUrl='+location.href); 
     687
     688 
     689 
     690window.onload = initPage(); 
  • trunk/tagPSent.pl

    r7 r9  
    1919 
    2020 
     21# Copyright (c) 2005 Software Freedom Law Center 
     22# Author: Orion Montoya <orion@mdcclv.com> 
    2123 
    2224use Lingua::EN::Sentence qw( get_sentences add_acronyms ); 

SFLC Main Page

[frdm] Support SFLC