[cpif] r272 - in trunk/frontend-web: . skins/default

svn at argo.es svn at argo.es
Thu Jul 12 18:19:50 CEST 2007


Author: jcea
Date: Thu Jul 12 18:19:50 2007
New Revision: 272

Log:
El svn revert no es recursivo por defecto... :-)

Modified:
   trunk/frontend-web/parsers.py
   trunk/frontend-web/skins/default/body_show_thread.html

Modified: trunk/frontend-web/parsers.py
==============================================================================
--- trunk/frontend-web/parsers.py	(original)
+++ trunk/frontend-web/parsers.py	Thu Jul 12 18:19:50 2007
@@ -13,11 +13,9 @@
   
   tokens = [(True, text, None)]
 
-  parsers_first = [
+  parsers = [
       (allow_html, parser_html),
       (allow_bbcode, parser_bbcode),
-  ]
-  parsers_last = [
       (True, parser_urls),
       (True, parser_smileys),
       (True, parser_eol),
@@ -26,41 +24,7 @@
       (True, parser_entities)
   ]
 
-  aux=[]
-  while tokens :
-    token=tokens.pop(0)
-    must_reparse,fragment,curr_context=token
-    if must_reparse==False or not len(fragment) :
-      aux.append(token)
-      continue
-    pos=99999999
-    token_list_winner=None
-    for allow, parser in parsers_first :
-      if not allow : continue
-      retval,token_list=parser.parse(fragment, curr_context)
-      if retval :
-        return retval, None
-      must_reparse2,fragment2,dummy=token_list[0]
-      if must_reparse2 :
-        l=len(fragment2)
-        if l<pos :
-          pos=l
-          token_list_winner=token_list
-      else :
-        pos=0
-        token_list_winner=token_list
-        break
-    print token_list_winner
-    if token_list_winner==None : # All parsers are disable
-      aux=[token]+tokens
-      break
-    token=token_list_winner.pop(0)
-    aux.append(token)
-    tokens=token_list_winner+tokens
-  tokens=aux
-
-
-  for allow, parser in parsers_last:
+  for allow, parser in parsers:
     if allow:
       aux = []
       for token in tokens:
@@ -73,7 +37,6 @@
         aux+=token_list
       tokens = aux
   
-  print tokens
   return False, "".join([text for dummy, text, dummy in tokens])
 
 import unittest

Modified: trunk/frontend-web/skins/default/body_show_thread.html
==============================================================================
--- trunk/frontend-web/skins/default/body_show_thread.html	(original)
+++ trunk/frontend-web/skins/default/body_show_thread.html	Thu Jul 12 18:19:50 2007
@@ -68,31 +68,34 @@
   post.appendChild(document.getElementById("form"));
   toggleBox('form',1);
 
-  if(id == "hilos") { return; }
+/*   if(id == "hilos") { return; } */
 
   /* quotes */
-  var my_id = id.slice(1);
-  if(! used_ids[my_id]){
-    used_ids[my_id] = true;
-    var req = false;
-    try {
-      req = new XMLHttpRequest();
-    }
-    catch(e) {
-      req = false;
-    }
-    if(req) {
-      req.open("GET","/get_msg_source/"+my_id,false);
-      req.send("");
-      var xml = req.responseXML;;
-      var author = xml.getElementsByTagName("autor")[0].textContent;
-      var post = xml.getElementsByTagName("cuerpo")[0].textContent;
-      var form = document.getElementById("form");
-      var textarea = form.getElementsByTagName("textarea")[0];
-      text = '[quote="'+author+'"]'+post+'[/quote]\n';
-      textarea.value += text;
-    }
-  }
+/*   var my_id = id.slice(1); */
+/*   if(! used_ids[my_id]){ */
+/*     used_ids[my_id] = true; */
+/*     var req = false; */
+/*     try { */
+/*       req = new XMLHttpRequest(); */
+/*     } */
+/*     catch(e) { */
+/*       req = false; */
+/*     } */
+/*     if(req) { */
+/*       req.open("GET","/get_msg_source/"+my_id,false); */
+/*       req.send(""); */
+/*       var xml = req.responseXML;; */
+/*       var author = xml.getElementsByTagName("autor")[0].textContent; */
+/*       var post = xml.getElementsByTagName("cuerpo")[0].textContent; */
+/*       post = post.replace("&lt;","<"); */
+/*       post = post.replace("&gt;",">"); */
+/*       post = post.replace("&amp;","&"); */
+/*       var form = document.getElementById("form"); */
+/*       var textarea = form.getElementsByTagName("textarea")[0]; */
+/*       text = '[quote="'+author+'"]'+post+'[/quote]\n'; */
+/*       textarea.value += text; */
+/*     } */
+/*   } */
 }
 
 window.onload = toggleBox('form',0);



More information about the cpif mailing list