Show
Ignore:
Timestamp:
09/17/08 19:49:46 (4 months ago)
Author:
hoge1e3
Message:
 
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/actionscript/todoshare/textEdit.html

    r18180 r19435  
    22<head> 
    33<meta http-equiv="Content-type" content="text/html; charsrt=utf-8"> 
    4 <title>タイトル</title> 
     4<title>テキストエディタ</title> 
    55<script src="prototype.js"></script> 
    66<script src="suggest.js"></script> 
     
    1010<script src="js/tag.js"></script> 
    1111<script src="js/gui.js"></script> 
     12<script src="js/objEdit.js"></script> 
    1213<link rel="Stylesheet" type="text/css" href="css/default.css"> 
    1314<script>  
     15var content=""; 
     16var tagEditor; 
    1417// JavaScript 
    1518function onLoad() { 
    16     
     19   nagameru(); 
     20   tagEditor=new ObjectEditor("tags"); 
     21   tagEditor.setRelationFilter(function (rel) { 
     22       return rel.name!="content"; 
     23        
     24   }); 
    1725} 
    1826function nagameru() { 
     
    2735      r.map(function (e) { 
    2836         return ["span", 
    29             [abutton,{onclick: [[yomu,e.id]]},"Edit"], 
    30             ["span", ["strong", e.id], ": " ,e.content], 
     37            //[abutton,{onclick: [[yomu,e.id]]},"Edit"],["br"], 
     38            ["a", { 
     39               href:"javascript:;",  
     40               onclick: function() {yomu(e.id);} 
     41            }, e.id], 
     42            ["br"], 
     43            digest(e.content), 
    3144            ["br"] 
    3245         ]; 
    3346      }) 
    3447   ); 
     48} 
     49function digest(s) { 
     50   if (s.length<50) return s; 
     51   return s.substring(0,50)+"..."; 
    3552} 
    3653function yomu(id) { 
     
    4158      $("id").innerHTML=obj.id; 
    4259      $("text").value=obj.content; 
     60      content=obj.content; 
     61      tagEditor.setObjectID(obj.id); 
    4362   },gv("_")] 
    4463  ); 
     
    5776    [dbPut, obj], 
    5877    [print, "ほぞんしました: "], 
     78    function () {content=obj.content;}, 
    5979    dispID, 
    6080//    [print, gv(obj,"id")],  // ちえんひょうか 
     
    7090function clear() { 
    7191   $("text").value=""; 
     92   content=""; 
     93   $("id").value=""; 
    7294   obj=null; 
    7395} 
     96function changeLoop() { 
     97   if (content!=$("text").value) { 
     98      $("changed").innerHTML="へんこうあり"; 
     99   } else { 
     100      $("changed").innerHTML=""; 
     101   } 
     102} 
     103setInterval(changeLoop, 1000); 
    74104</script> 
    75105</head> 
    76106<body id=body onLoad="onLoad()"> 
     107<span id=menu> 
    77108<button onclick="save()">ほぞん</button> 
    78109<button onclick="mekuru()">めくる</button> 
     
    80111<button onclick="nagameru()">ながめる</button> 
    81112さがす:<input type=text name=word> 
     113</span> 
    82114 
    83 <Br> 
    84 <span id="view"></span> 
    85 ID: <span id="id"></span> <BR> 
    86 <textarea rows=10 cols=60 id=text></textarea> 
    87  
     115<span id="view" class="view"></span> 
     116<div class="main"> 
     117ID: <span id="id"></span> <span id="changed"></span> <BR> 
     118<textarea rows=20 cols=80 id=text></textarea> 
     119<BR> 
     120たぐ: 
     121<span id="tags"></span> 
    88122<HR> 
    89123<a href="./">Home</a><BR> 
    90124<span id="console"></span> 
     125</div> 
    91126</body> 
    92127</html>