From b10e31d2042821e54f3febc88829cd769843a3fe Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Mon, 10 Sep 2012 16:20:35 +0200 Subject: [IMP] replaced wiki stuff by html field bzr revid: nicolas.vanhoren@openerp.com-20120910142035-rzxwsv4nb3jfcf3o --- addons/document_page/static/src/lib/wiky/Readme.md | 41 --- .../document_page/static/src/lib/wiky/index.html | 56 ---- .../static/src/lib/wiky/input_complete | 35 --- addons/document_page/static/src/lib/wiky/wiky.css | 79 ------ addons/document_page/static/src/lib/wiky/wiky.js | 303 --------------------- 5 files changed, 514 deletions(-) delete mode 100755 addons/document_page/static/src/lib/wiky/Readme.md delete mode 100755 addons/document_page/static/src/lib/wiky/index.html delete mode 100755 addons/document_page/static/src/lib/wiky/input_complete delete mode 100755 addons/document_page/static/src/lib/wiky/wiky.css delete mode 100755 addons/document_page/static/src/lib/wiky/wiky.js (limited to 'addons/document_page/static/src/lib') diff --git a/addons/document_page/static/src/lib/wiky/Readme.md b/addons/document_page/static/src/lib/wiky/Readme.md deleted file mode 100755 index 5d9bfe175a6..00000000000 --- a/addons/document_page/static/src/lib/wiky/Readme.md +++ /dev/null @@ -1,41 +0,0 @@ -Wiky.js - a javascript library to convert Wiki Markup language to HTML. -======================= - -(It is buggy, please use with care) - -Wiky.js is a javascript library that converts Wiki Markup language to HTML. - - -How to use it -------------------- -Include wiki.js into your HTML file. Wiky.js has only one function, which is wiky.process(wikitext). - -Please see index.html for an example. - -*wiky.js does not depend on jQuery, which is included for testing purpose. - - - -Supported Syntax -------------------- -* == Heading == -* === Subheading === -* [http://www.url.com Name of URLs] -* [[File:http://www.url.com/image.png Alternative Text]] -* -------------------- (Horizontal line) -* : (Indentation) -* # Ordered bullet point -* * Unordered bullet point - - - -License ------------------- -Creative Commons 3.0 - - - -Contributors -------------------- -Tanin Na Nakorn -Tanun Niyomjit (Designer) \ No newline at end of file diff --git a/addons/document_page/static/src/lib/wiky/index.html b/addons/document_page/static/src/lib/wiky/index.html deleted file mode 100755 index 97992354fd6..00000000000 --- a/addons/document_page/static/src/lib/wiky/index.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - Untitled Document - - - - -
- - - - - - - diff --git a/addons/document_page/static/src/lib/wiky/input_complete b/addons/document_page/static/src/lib/wiky/input_complete deleted file mode 100755 index c7e860cccf9..00000000000 --- a/addons/document_page/static/src/lib/wiky/input_complete +++ /dev/null @@ -1,35 +0,0 @@ -=== Heading === -Some content -I would like to add another line - -== Subheading == -Some more content -Some more lines1 -:A line with indent -:: A 2-indented line -:: more -:back to 1-indented line - -This is Taeyeon. -[[File:http://www.oknation.net/blog/home/blog_data/12/2012/images/ty4.jpg Taeyeon]] -Taeyeon is so cute. - -This is a link:[http://www.google.com Google]. -This is a bold link:'''[http://www.google.com Google]'''. -This is a bold-italic link:'''''[http://www.google.com Google]'''''. -This is '''bold''', '''''bold-italic''''', and ''italic'' - - -# First -# second -## Second-First -*** First Point -*** Second Point -#### z -#### y -#### x -*** Third Point -## Second-Second [ftp://www.facebook.com FacebookFTP] -## Second-Third [http://www.google.com Google Here] -# third - diff --git a/addons/document_page/static/src/lib/wiky/wiky.css b/addons/document_page/static/src/lib/wiky/wiky.css deleted file mode 100755 index 0adc7896df0..00000000000 --- a/addons/document_page/static/src/lib/wiky/wiky.css +++ /dev/null @@ -1,79 +0,0 @@ -@charset "UTF-8"; -.wiky_preview_area { - font-family: "Helvetica Neue", Arial, Helvetica, 'Liberation Sans', FreeSans, sans-serif; - font-size: 13px; - line-height: 1.5em; - color: #666; - font-weight:350; - width:600px; - display:block; -} -.wiky_preview_area h2{ - font-size:24px; - color:#333; - font-weight:400; - - text-shadow:0 1px 0 rgba(000, 000, 000, .4); -} -.wiky_preview_area h3{ - font-size:18px; - color:#555; - font-weight:400; - - text-shadow:0 1px 0 rgba(000, 000, 000, .4); -} -.wiky_preview_area img{ - background-repeat: repeat; - width: 400px; - -webkit-border-radius: 10px; - -moz-border-radius: 10px; - border-radius: 10px; - -webkit-box-shadow:0 1px 3px rgba(0, 0, 0, .8); - -moz-box-shadow:0 1px 3px rgba(0, 0, 0, .8); - box-shadow:0 1px 3px rgba(0, 0, 0, .8); -} -.wiky_preview_area a{ - padding:5px; - font-weight:400; - - background: #999; /* for non-css3 browsers */ - - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#cccccc', endColorstr='#000000'); /* for IE */ - background: -webkit-gradient(linear, left top, left bottom, from(#ccc), to(#000)); /* for webkit browsers */ - background: -moz-linear-gradient(top, #ccc, #000); /* for firefox 3.6+ */ - - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; - - -webkit-box-shadow:none; - -moz-box-shadow:none; - box-shadow:none; - - text-shadow:0 1px 0 rgba(255, 255, 255, 1); -} - -.wiky_preview_area a:hover{ - color:#333; - padding:5px; - font-weight:400; - text-decoration:none; - - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; - - -webkit-box-shadow:0 1px 3px rgba(0, 0, 0, .3); - -moz-box-shadow:0 1px 3px rgba(0, 0, 0, .3); - box-shadow:0 1px 3px rgba(0, 0, 0, .3); - - text-shadow:0 1px 0 rgba(255, 255, 255, 1); -} - - -.wiky_preview_area > ol, -.wiky_preview_area > ul, -.wiky_preview_area > ul > li, -.wiky_preview_area > ol > li { - list-style: disc inside none; -} \ No newline at end of file diff --git a/addons/document_page/static/src/lib/wiky/wiky.js b/addons/document_page/static/src/lib/wiky/wiky.js deleted file mode 100755 index 5bc9c6f167d..00000000000 --- a/addons/document_page/static/src/lib/wiky/wiky.js +++ /dev/null @@ -1,303 +0,0 @@ -/** - * Wiky.js - Javascript library to converts Wiki MarkUp language to HTML. - * You can do whatever with it. Please give me some credits (Apache License) - * - Tanin Na Nakorn - */ - -var wiky = {}; - - -wiky.process = function(wikitext) { - var lines = wikitext.split(/\r?\n/); - var start; - var html = ""; - - for (var i=0;i"; - } - else if (line.match(/^==/)!=null && line.match(/==$/)!=null) - { - html += "

"+line.substring(2,line.length-2)+"

"; - } - else if (line.match(/^:+/)!=null) - { - // find start line and ending line - start = i; - while (i < lines.length && lines[i].match(/^:+/)!=null) i++; - i--; - - html += wiky.process_indent(lines,start,i); - } - else if (line.match(/^----+(\s*)$/)!=null) - { - html += "
"; - } - else if (line.match(/^(\*+) /)!=null) - { - // find start line and ending line - start = i; - while (i < lines.length && lines[i].match(/^(\*+|##+):? /)!=null) i++; - i--; - - html += wiky.process_bullet_point(lines,start,i); - } - else if (line.match(/^(#+) /)!=null) - { - // find start line and ending line - start = i; - while (i < lines.length && lines[i].match(/^(#+|\*\*+):? /)!=null) i++; - i--; - - html += wiky.process_bullet_point(lines,start,i); - } - else - { - html += wiky.process_normal(line); - } - - html += "
\n"; - } - - return html; -}; - -wiky.process_indent = function(lines,start,end) { - var html = "
"; - - for(var i=start;i<=end;i++) { - - html += "
"; - - var this_count = lines[i].match(/^(:+)/)[1].length; - - html += wiky.process_normal(lines[i].substring(this_count)); - - var nested_end = i; - for (var j=i+1;j<=end;j++) { - var nested_count = lines[j].match(/^(:+)/)[1].length; - if (nested_count <= this_count) break; - else nested_end = j; - } - - if (nested_end > i) { - html += wiky.process_indent(lines,i+1,nested_end); - i = nested_end; - } - - html += "
"; - } - - html += "
"; - return html; -}; - -wiky.process_bullet_point = function(lines,start,end) { - var html = (lines[start].charAt(0)=='*')?"":""; - return html; -}; - -wiky.process_url = function(txt) { - - var index = txt.indexOf(" "); - - if (index == -1) - { - return ""; - } - else - { - var url = txt.substring(0,index); - var label = txt.substring(index+1); - return ""+label+""; - } -}; - -wiky.process_image = function(txt) { - var index = txt.indexOf(" "); - var url = txt; - var label = ""; - - if (index > -1) - { - url = txt.substring(0,index); - label = txt.substring(index+1); - } - - - return "\""+label+"\""; -}; - -wiky.process_video = function(url) { - - if (url.match(/^(https?:\/\/)?(www.)?youtube.com\//) == null) - { - return ""+url+" is an invalid YouTube URL"; - } - var result; - if ((result = url.match(/^(https?:\/\/)?(www.)?youtube.com\/watch\?(.*)v=([^&]+)/)) != null) - { - url = "http://www.youtube.com/embed/"+result[4]; - } - - - return ''; -}; - -wiky.process_normal = function(wikitext) { - - // Image - { - var index = wikitext.indexOf("[[File:"); - var end_index = wikitext.indexOf("]]", index + 7); - while (index > -1 && end_index > -1) { - - wikitext = wikitext.substring(0,index) - + wiky.process_image(wikitext.substring(index+7,end_index)) - + wikitext.substring(end_index+2); - - index = wikitext.indexOf("[[File:"); - end_index = wikitext.indexOf("]]", index + 7); - } - } - - // Video - { - var index = wikitext.indexOf("[[Video:"); - var end_index = wikitext.indexOf("]]", index + 8); - while (index > -1 && end_index > -1) { - - wikitext = wikitext.substring(0,index) - + wiky.process_video(wikitext.substring(index+8,end_index)) - + wikitext.substring(end_index+2); - - index = wikitext.indexOf("[[Video:"); - end_index = wikitext.indexOf("]]", index + 8); - } - } - - - // URL - var protocols = ["http","ftp","news"]; - - for (var i=0;i -1 && end_index > -1) { - - wikitext = wikitext.substring(0,index) - + wiky.process_url(wikitext.substring(index+1,end_index)) - + wikitext.substring(end_index+1); - - index = wikitext.indexOf("["+protocols[i]+"://",end_index+1); - end_index = wikitext.indexOf("]", index + 1); - - } - } - - var count_b = 0; - var index = wikitext.indexOf("'''"); - while(index > -1) { - - if ((count_b%2)==0) wikitext = wikitext.replace(/'''/,""); - else wikitext = wikitext.replace(/'''/,""); - - count_b++; - - index = wikitext.indexOf("'''",index); - } - - var count_i = 0; - var index = wikitext.indexOf("''"); - while(index > -1) { - - if ((count_i%2)==0) wikitext = wikitext.replace(/''/,""); - else wikitext = wikitext.replace(/''/,""); - - count_i++; - - index = wikitext.indexOf("''",index); - } - - wikitext = wikitext.replace(/<\/b><\/i>/g,""); - - return wikitext; -}; -- cgit v1.2.3