From b10e31d2042821e54f3febc88829cd769843a3fe Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Mon, 10 Sep 2012 16:20:35 +0200 Subject: [PATCH] [IMP] replaced wiki stuff by html field bzr revid: nicolas.vanhoren@openerp.com-20120910142035-rzxwsv4nb3jfcf3o --- addons/document_page/__openerp__.py | 4 - addons/document_page/document_page_demo.xml | 164 +++++----- addons/document_page/document_page_view.xml | 2 +- .../static/src/js/document_page.js | 18 -- .../static/src/lib/wiky/Readme.md | 41 --- .../static/src/lib/wiky/index.html | 56 ---- .../static/src/lib/wiky/input_complete | 35 -- .../static/src/lib/wiky/wiky.css | 79 ----- .../document_page/static/src/lib/wiky/wiky.js | 303 ------------------ 9 files changed, 87 insertions(+), 615 deletions(-) delete mode 100644 addons/document_page/static/src/js/document_page.js 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 diff --git a/addons/document_page/__openerp__.py b/addons/document_page/__openerp__.py index a88e1d827d7..eec5166b0bf 100644 --- a/addons/document_page/__openerp__.py +++ b/addons/document_page/__openerp__.py @@ -44,10 +44,6 @@ Web pages 'auto_install': False, 'certificate': '0086363630317', 'images': [], - 'js': [ - 'static/src/lib/wiky/wiky.js', - 'static/src/js/document_page.js' - ], 'css' : ['static/src/css/document_page.css'], } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/document_page/document_page_demo.xml b/addons/document_page/document_page_demo.xml index 96984fe2e0b..d97ee0ae1b2 100644 --- a/addons/document_page/document_page_demo.xml +++ b/addons/document_page/document_page_demo.xml @@ -24,24 +24,28 @@ Additional ressources OpenERP 6.1. Functional Demo - -The news is out, OpenERP's latest version 6.1. is here. It's more -user-friendly, even more business oriented and efficient to manage your company - -How to discover the latest version 6.1.? - -Demo : [http://demo.openerp.com] -Online: [http://openerp.com/online] -Download: [http://openerp.com/downloads] - -We have also put together a functional demo that presents 6.1. Watch this video -to learn directly from us what OpenERP 6.1. can do for you. Share it in your -company, with your clients and implement it now for your business. - -==Watch on Youtube!== - -[[Video:http://www.youtube.com/embed/7jES2jxKMso ]] - + +
+The news is out, OpenERP's latest version 6.1. is here. It's more
+user-friendly, even more business oriented and efficient to manage your company
+
+How to discover the latest version 6.1.?
+
+Demo :
+Online:
+Download:
+
+We have also put together a functional demo that presents 6.1. Watch this video
+to learn directly from us what OpenERP 6.1. can do for you. Share it in your
+company, with your clients and implement it now for your business.
+
+

Watch on Youtube!


+
+
+
+
+]]>
@@ -49,36 +53,40 @@ company, with your clients and implement it now for your business. Personalise Dashboards -You like OpenERP, but feel like you want to personalise it more? Now, OpenERP -goes a step further and lets you customize your dashboard. Thanks to a new -feature that allows you to customize your dashboard by adding new boards of any -search view. - -==How is it done?== - -Step 1: access one search view - -Step 2: apply the filter you want to see at each connection to the application -(eg. on sales, manufacturing, etc) - -Step 3: add it into the dashboard in the same space where you can save the filter - -Step 4: choose the application you want it visible on and the name of the array - -Look at this simple example below from Purchase, where I want to put on the -application's dashboard "Purchases to Approve". After I access the search view -and apply the filter for "Purchases to Approve", I can add it immediately to my -Purchase dashboard. - -[[File:http://www.openerp.com/sites/default/files/fileattach/dashboard2_1(1).png ]] - -In less than a minute, the search view is visible on the dashboard - -[[File:http://www.openerp.com/sites/default/files/fileattach/dashboard2_2.png ]] - -Of course, you are free to delete what you don't need or like, but just in case -you change your mind there is a reset button to return to the default view. - + +You like OpenERP, but feel like you want to personalise it more? Now, OpenERP
+goes a step further and lets you customize your dashboard. Thanks to a new
+feature that allows you to customize your dashboard by adding new boards of any
+search view.
+
+

How is it done?


+
+Step 1: access one search view
+
+Step 2: apply the filter you want to see at each connection to the application
+(eg. on sales, manufacturing, etc)
+
+Step 3: add it into the dashboard in the same space where you can save the filter
+
+Step 4: choose the application you want it visible on and the name of the array
+
+Look at this simple example below from Purchase, where I want to put on the
+application's dashboard "Purchases to Approve". After I access the search view
+and apply the filter for "Purchases to Approve", I can add it immediately to my
+Purchase dashboard.
+
+
+
+In less than a minute, the search view is visible on the dashboard
+
+
+
+Of course, you are free to delete what you don't need or like, but just in case
+you change your mind there is a reset button to return to the default view.
+
+
+]]>
@@ -86,36 +94,36 @@ you change your mind there is a reset button to return to the default view. Touchscreen Point of Sale -The brand new OpenERP touchscreen point of sale available with 6.1 allows you -to manage your shop sales very easily. It's fully web based so that you don't -have to install or deploy any software and all the sales shops can be easily -consolidated. It works in connected and disconnected modes so that you can -continue to sell if you lose your internet connection. - -[[File:http://www.openerp.com/sites/default/files/fileattach/POS(2).png ]] - -==Here's a summary of its main features and benefits:== - -100% WEB based - -* available for any touchscreen device (ipod, ipad, any tablet)mobile (with portable devices) -* no installation required -* no synchronization needed, completely integrated -* continue working even when your connection is down if you close your browser, data won't be lost -* fully web based with a clean interface smart interface - -You have different options to select your products. You can do it through the -barcode reader, just browse through the categories you have put in place (ie. -drinks, snacks, meals, etc.), or text search in case neither of the other -options work for you. If you need to use the POS for your restaurant, for -example, your employees can record at the same time multiple tickets without -having to wait to do one transaction at a time. Along, to facilitate payment, -the application allows multiple payment methods. - -The POS application is so simple and accessible to use that your shop or -restaurant will never need any other tool to manage orders. Due to its smart -and user-friendly interface you don't need any training to learn how to use it. -Think of it as an out-of-the-box solution to boost your business' productivity. + +The brand new OpenERP touchscreen point of sale available with 6.1 allows you
+to manage your shop sales very easily. It's fully web based so that you don't
+have to install or deploy any software and all the sales shops can be easily
+consolidated. It works in connected and disconnected modes so that you can
+continue to sell if you lose your internet connection.
+
+
+
+

Here's a summary of its main features and benefits:


+
+100% WEB based
+
+
  • available for any touchscreen device (ipod, ipad, any tablet)mobile (with portable devices)
  • no installation required
  • no synchronization needed, completely integrated
  • continue working even when your connection is down if you close your browser, data won't be lost
  • fully web based with a clean interface smart interface

+
+You have different options to select your products. You can do it through the
+barcode reader, just browse through the categories you have put in place (ie.
+drinks, snacks, meals, etc.), or text search in case neither of the other
+options work for you. If you need to use the POS for your restaurant, for
+example, your employees can record at the same time multiple tickets without
+having to wait to do one transaction at a time. Along, to facilitate payment,
+the application allows multiple payment methods.
+
+The POS application is so simple and accessible to use that your shop or
+restaurant will never need any other tool to manage orders. Due to its smart
+and user-friendly interface you don't need any training to learn how to use it.
+Think of it as an out-of-the-box solution to boost your business' productivity.
+
+]]>
diff --git a/addons/document_page/document_page_view.xml b/addons/document_page/document_page_view.xml index 23c4b8f29c8..63f208c08a7 100644 --- a/addons/document_page/document_page_view.xml +++ b/addons/document_page/document_page_view.xml @@ -55,7 +55,7 @@
- +
diff --git a/addons/document_page/static/src/js/document_page.js b/addons/document_page/static/src/js/document_page.js deleted file mode 100644 index 836803bf700..00000000000 --- a/addons/document_page/static/src/js/document_page.js +++ /dev/null @@ -1,18 +0,0 @@ -openerp.document_page = function (openerp) { - openerp.web.form.widgets.add('text_wiki', 'openerp.web.form.FieldTextWiki'); - - openerp.web.form.FieldTextWiki = openerp.web.form.FieldText.extend({ - render_value: function() { - var show_value = openerp.web.format_value(this.get('value'), this, ''); - if (!this.get("effective_readonly")) { - this.$textarea.val(show_value); - if (show_value && this.view.options.resize_textareas) { - this.do_resize(this.view.options.resize_textareas); - } - } else { - var wiki_value = wiky.process(show_value || ''); - this.$el.html(wiki_value); - } - }, - }); -}; 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)=='*')?"
    ":"
      "; - - for(var i=start;i<=end;i++) { - - html += "
    1. "; - - var this_count = lines[i].match(/^(\*+|#+) /)[1].length; - - html += wiky.process_normal(lines[i].substring(this_count+1)); - - // continue previous with #: - { - 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 { - if (lines[j].charAt(nested_count) == ':') { - html += "
      " + wiky.process_normal(lines[j].substring(nested_count + 2)); - nested_end = j; - } else { - break; - } - } - - } - - i = nested_end; - } - - // nested bullet point - { - 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_bullet_point(lines, i + 1, nested_end); - i = nested_end; - } - } - - // continue previous with #: - { - 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 { - if (lines[j].charAt(nested_count) == ':') { - html += wiky.process_normal(lines[j].substring(nested_count + 2)); - nested_end = j; - } else { - break; - } - } - - } - - i = nested_end; - } - - html += "
    2. "; - } - - 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; -};