Amit Dodiya (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/6.1-opw-573134-ado into 
lp:openobject-addons/6.1.

Requested reviews:
  Naresh(OpenERP) (nch-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-573134-ado/+merge/99665

Hello,

"[FIX] Wiki module - several text formating issues"

Steps:
Several text formatting issues in wiki pages using web-client.
Open page Base wiki editing
- img:http://images.google.co.in/intl/en_ALL/images/images_hp.gif --> no image 
visible 
- Download File : attach:path to a real file --> no file attached
- this syntaxe : = 1st Level Heading = do not work (with 2 and 3 equals no 
problem)

Thanks,
Amit
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-573134-ado/+merge/99665
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.1-opw-573134-ado.
=== modified file 'wiki/static/src/lib/wiky/wiky.js'
--- wiki/static/src/lib/wiky/wiky.js	2012-01-17 11:22:46 +0000
+++ wiki/static/src/lib/wiky/wiky.js	2012-03-28 05:34:20 +0000
@@ -11,17 +11,20 @@
 	var lines = wikitext.split(/\r?\n/);
 	var start;
 	var html = "";
-	
 	for (var i=0;i<lines.length;i++)
 	{
 		var line = lines[i];
 		if (line.match(/^===/)!=null && line.match(/===$/)!=null)
 		{
-			html += "<h2>"+line.substring(3,line.length-3)+"</h2>";
+			html += "<h3>"+line.substring(3,line.length-3)+"</h3>";
 		}
 		else if (line.match(/^==/)!=null && line.match(/==$/)!=null)
 		{
-			html += "<h3>"+line.substring(2,line.length-2)+"</h3>";
+			html += "<h2>"+line.substring(2,line.length-2)+"</h2>";
+		}
+		else if (line.match(/^=/)!=null && line.match(/=$/)!=null)
+		{
+			html += "<h1>"+line.substring(1,line.length-1)+"</h1>";
 		}
 		else if (line.match(/^:+/)!=null)
 		{
@@ -54,6 +57,14 @@
 			
 			html += wiky.process_bullet_point(lines,start,i);
 		}
+		else if (line.match(/^img/)!=null)
+		{
+			html += wiky.process_image(line);
+		}
+		else if (line.match(/^attach/)!=null)
+		{
+			html += "<a href='"+line.substring(7)+"'>Download the file</a>"
+		}
 		else 
 		{
 			html += wiky.process_normal(line);
@@ -61,7 +72,6 @@
 		
 		html += "<br/>\n";
 	}
-	
 	return html;
 };
 
@@ -197,12 +207,10 @@
 	
 	if (index > -1) 
 	{
-		url = txt.substring(0,index);
-		label = txt.substring(index+1);
+		label = txt.substring(0,index);
+		url = txt.substring(index+1);
 	}
-	
-	
-	return "<img src='"+url+"' alt=\""+label+"\" />";
+	return "<image src='"+url+"' alt=\""+label+"\" />";
 };
 
 wiky.process_video = function(url) {

=== modified file 'wiki/wiki.py'
--- wiki/wiki.py	2011-12-19 16:54:40 +0000
+++ wiki/wiki.py	2012-03-28 05:34:20 +0000
@@ -230,9 +230,9 @@
         text2 = history_pool.read(cr, uid, [v2], ['text_area'])[0]['text_area']
         line1 = line2 = ''
         if text1:
-            line1 = tools.ustr(text1.splitlines(1))
+            line1 = text1.splitlines(1)
         if text2:
-            line2=tools.ustr(text2.splitlines(1))
+            line2 = text2.splitlines(1)
         if (not line1 and not line2) or (line1 == line2):
             raise osv.except_osv(_('Warning !'), _('There are no changes in revisions'))
         diff = difflib.HtmlDiff()

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to