diff --git a/build.json b/build.json index 6069394da55..e5f09396b5a 100644 --- a/build.json +++ b/build.json @@ -89,7 +89,6 @@ "js/all-web.js": [ "lib/js/lib/history/history.min.js:concat", "lib/js/lib/bootstrap.min.js:concat", - "lib/js/lib/sprintf.js", "lib/js/core.min.js:concat", "lib/js/legacy/globals.js", "lib/js/legacy/utils/datatype.js", @@ -97,21 +96,12 @@ "lib/js/legacy/utils/dom.js", "lib/js/legacy/utils/handler.js", "lib/js/legacy/utils/msgprint.js", - "lib/js/legacy/utils/shortcut.js", - "lib/js/legacy/widgets/form/fields.js", "lib/js/wn/ui/dialog.js", - "lib/js/wn/ui/button.js", "lib/js/legacy/widgets/dialog.js", "lib/js/wn/ui/listing.js", - "lib/js/legacy/widgets/layout.js", "lib/js/legacy/webpage/page_header.js", - "lib/js/legacy/webpage/search.js", "lib/js/legacy/webpage/spinner.js", - "lib/js/legacy/webpage/error_console.js", "lib/js/legacy/webpage/loaders.js", - "lib/js/legacy/webpage/uploader.js", - "lib/js/legacy/webpage/page.js", - "lib/js/legacy/wn/page_layout.js", "lib/js/legacy/wn/widgets/footer.js", "lib/js/legacy/model/local_data.js", "lib/js/legacy/model/doclist.js", @@ -138,7 +128,6 @@ "lib/js/legacy/utils/dom.js", "lib/js/legacy/utils/handler.js", "lib/js/legacy/utils/msgprint.js", - "lib/js/legacy/utils/shortcut.js", "lib/js/legacy/utils/printElement.js", "lib/js/legacy/widgets/form/fields.js", "lib/js/wn/ui/dialog.js", @@ -154,7 +143,6 @@ "lib/js/legacy/webpage/error_console.js", "lib/js/legacy/webpage/loaders.js", "lib/js/legacy/webpage/uploader.js", - "lib/js/legacy/webpage/page.js", "lib/js/legacy/wn/page_layout.js", "lib/js/legacy/wn/widgets/page_sidebar.js", "lib/js/legacy/wn/widgets/footer.js", diff --git a/css/all-app.css b/css/all-app.css index 4ed2d5771aa..24c333c0618 100644 --- a/css/all-app.css +++ b/css/all-app.css @@ -109,7 +109,7 @@ div.comment { color: #444; } } .help { - margin: 3px 0px; + margin-bottom: 3px; color: #888; } @@ -323,6 +323,20 @@ div.notice { */ /* FORMS */ +.breadcrumbs-area { + margin-bottom: 8px; +} + +.breadcrumbs { + background-color: #e8e8e8; + padding: 3px; + border-radius: 3px; +} + +.breadcrumbs a { + color: #000000; +} + div.form-section-head { margin: 11px 0px 3px 0px; border-top: 1px solid #ccc; @@ -1763,7 +1777,6 @@ h6 { font-weight: bold; color: #333333; text-rendering: optimizelegibility; - margin-bottom: 0.3em; } h1 small, h2 small, @@ -1775,37 +1788,37 @@ h6 small { color: #999999; } h1 { - font-size: 30px; - line-height: 36px; + font-size: 280%; + line-height: 120%; } h1 small { - font-size: 18px; + font-size: 150%; } h2 { - font-size: 24px; - line-height: 36px; + font-size: 200%; + line-height: 120%; } h2 small { - font-size: 18px; + font-size: 150%; } h3 { - line-height: 27px; - font-size: 18px; + font-size: 210%; + font-size: 150%; } h3 small { - font-size: 14px; + font-size: 130%; } h4, h5, h6 { - line-height: 18px; + font-size: 150%; } h4 { - font-size: 14px; + font-size: 113%; } h4 small { - font-size: 12px; + font-size: 100%; } h5 { - font-size: 12px; + font-size: 100%; } h6 { font-size: 11px; @@ -3470,7 +3483,8 @@ button.btn.small, input[type="submit"].btn.small { */ h1, h2, h3, h4, h5 { font-family: "Open Sans", Helvetica, "Helvetica Neue", sans-serif; - font-weight: bold; + font-weight: normal; + margin-top: 0.2em; } body { @@ -3484,6 +3498,7 @@ span, div, td, input, textarea, button, select { body { background: url(../images/redbeech.jpg) repeat; + color: #616161; } .small { @@ -3495,25 +3510,6 @@ body { text-align: center; } -.module-icons { - background: url(../images/module-icons.png) no-repeat top left; - width:16px; - height:16px; -} - -.module-icons-accounts{ background-position: 0 0; } -.module-icons-analysis{ background-position: 0 -66px; } -.module-icons-buying{ background-position: 0 -132px; } -.module-icons-home{ background-position: 0 -198px; } -.module-icons-hr{ background-position: 0 -264px; } -.module-icons-people{ background-position: 0 -330px; } -.module-icons-production{ background-position: 0 -396px; } -.module-icons-projects{ background-position: 0 -462px; } -.module-icons-selling{ background-position: 0 -528px; } -.module-icons-setup{ background-position: 0 -594px; } -.module-icons-stock{ background-position: 0 -660px; } -.module-icons-support{ background-position: 0 -726px; } - .navbar-new-comments { margin: -3px 0px; padding: 2px; diff --git a/css/all-web.css b/css/all-web.css index bdd2ad584f5..64e5566c6e3 100644 --- a/css/all-web.css +++ b/css/all-web.css @@ -109,7 +109,7 @@ div.comment { color: #444; } } .help { - margin: 3px 0px; + margin-bottom: 3px; color: #888; } @@ -415,7 +415,6 @@ h6 { font-weight: bold; color: #333333; text-rendering: optimizelegibility; - margin-bottom: 0.3em; } h1 small, h2 small, @@ -427,37 +426,37 @@ h6 small { color: #999999; } h1 { - font-size: 30px; - line-height: 36px; + font-size: 280%; + line-height: 120%; } h1 small { - font-size: 18px; + font-size: 150%; } h2 { - font-size: 24px; - line-height: 36px; + font-size: 200%; + line-height: 120%; } h2 small { - font-size: 18px; + font-size: 150%; } h3 { - line-height: 27px; - font-size: 18px; + font-size: 210%; + font-size: 150%; } h3 small { - font-size: 14px; + font-size: 130%; } h4, h5, h6 { - line-height: 18px; + font-size: 150%; } h4 { - font-size: 14px; + font-size: 113%; } h4 small { - font-size: 12px; + font-size: 100%; } h5 { - font-size: 12px; + font-size: 100%; } h6 { font-size: 11px; @@ -1799,7 +1798,8 @@ div.stat-bar { */ h1, h2, h3, h4, h5 { font-family: "Open Sans", Helvetica, "Helvetica Neue", sans-serif; - font-weight: bold; + font-weight: normal; + margin-top: 0.2em; } body { @@ -1813,6 +1813,7 @@ span, div, td, input, textarea, button, select { body { background: url(../images/redbeech.jpg) repeat; + color: #616161; } .small { @@ -1824,25 +1825,6 @@ body { text-align: center; } -.module-icons { - background: url(../images/module-icons.png) no-repeat top left; - width:16px; - height:16px; -} - -.module-icons-accounts{ background-position: 0 0; } -.module-icons-analysis{ background-position: 0 -66px; } -.module-icons-buying{ background-position: 0 -132px; } -.module-icons-home{ background-position: 0 -198px; } -.module-icons-hr{ background-position: 0 -264px; } -.module-icons-people{ background-position: 0 -330px; } -.module-icons-production{ background-position: 0 -396px; } -.module-icons-projects{ background-position: 0 -462px; } -.module-icons-selling{ background-position: 0 -528px; } -.module-icons-setup{ background-position: 0 -594px; } -.module-icons-stock{ background-position: 0 -660px; } -.module-icons-support{ background-position: 0 -726px; } - .navbar-new-comments { margin: -3px 0px; padding: 2px; @@ -1890,20 +1872,12 @@ body { /* * erpnext/website/css/website.css */ +div#body_div, header .container, .content, #opened-page-selector, footer { + width: 900px; +} + .layout_wrapper { - padding: 20px; -} - -h1 { - margin-bottom: 15px; -} - -h2 { - margin-bottom: 11px; -} - -h3 { - margin-bottom: 7px; + padding: 27px; } p, li { @@ -1942,6 +1916,7 @@ pre { margin-right: 15px; color: #606060; overflow-x: hidden; + font-size: 90%; } .web-page-status { @@ -2006,3 +1981,42 @@ footer a:hover { .web-footer-menu ul li:last-child { border-right: 0px solid #777 !important; } + +/* slide view */ + +.next-slide { + margin: 0px -27px 100px -27px; + background: #ffffff; /* Old browsers */ + background: -moz-linear-gradient(top, #eeeeee 0%, #fff 100%); /* FF3.6+ */ + background: -webkit-linear-gradient(top, #eeeeee 0%, #fff 100%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, #eeeeee 0%, #fff 100%); /* Opera 11.10+ */ + background: -ms-linear-gradient(top, #eeeeee 0%, #fff 100%); /* IE10+ */ + background: linear-gradient(top, #eeeeee 0%, #fff 100%); /* W3C */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#fff',GradientType=0 ); /* IE6-9 */ + height: 36px; +} + +.slide-shadow { + background: #eeeeee; /* Old browsers */ + background: -moz-linear-gradient(top, #bababa 0%,#eeeeee 100%); /* FF3.6+ */ + background: -webkit-linear-gradient(top, #bababa 0%,#eeeeee 100%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, #bababa 0%,#eeeeee 100%); /* Opera 11.10+ */ + background: -ms-linear-gradient(top, #bababa 0%,#eeeeee 100%); /* IE10+ */ + background: linear-gradient(top, #bababa 0%,#eeeeee 100%); /* W3C */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#bababa', endColorstr='#eeeeee',GradientType=0 ); /* IE6-9 */ + height: 3px; + margin: 100px -27px 0px -27px; + border-top: 1px solid #bababa; +} + +.two-column { + width: 40%; + float: left; + padding: 5%; +} + +.clear { + clear: both; +} + +/* */ diff --git a/erpnext/startup/startup.css b/erpnext/startup/startup.css index a6f4e920fb5..f59c082141a 100644 --- a/erpnext/startup/startup.css +++ b/erpnext/startup/startup.css @@ -1,6 +1,7 @@ h1, h2, h3, h4, h5 { font-family: "Open Sans", Helvetica, "Helvetica Neue", sans-serif; - font-weight: bold; + font-weight: normal; + margin-top: 0.2em; } body { @@ -14,6 +15,7 @@ span, div, td, input, textarea, button, select { body { background: url(../images/redbeech.jpg) repeat; + color: #616161; } .small { @@ -25,25 +27,6 @@ body { text-align: center; } -.module-icons { - background: url(../images/module-icons.png) no-repeat top left; - width:16px; - height:16px; -} - -.module-icons-accounts{ background-position: 0 0; } -.module-icons-analysis{ background-position: 0 -66px; } -.module-icons-buying{ background-position: 0 -132px; } -.module-icons-home{ background-position: 0 -198px; } -.module-icons-hr{ background-position: 0 -264px; } -.module-icons-people{ background-position: 0 -330px; } -.module-icons-production{ background-position: 0 -396px; } -.module-icons-projects{ background-position: 0 -462px; } -.module-icons-selling{ background-position: 0 -528px; } -.module-icons-setup{ background-position: 0 -594px; } -.module-icons-stock{ background-position: 0 -660px; } -.module-icons-support{ background-position: 0 -726px; } - .navbar-new-comments { margin: -3px 0px; padding: 2px; diff --git a/erpnext/website/css/website.css b/erpnext/website/css/website.css index b56b55ee353..1fd0bb055c6 100644 --- a/erpnext/website/css/website.css +++ b/erpnext/website/css/website.css @@ -1,17 +1,9 @@ +div#body_div, header .container, .content, #opened-page-selector, footer { + width: 900px; +} + .layout_wrapper { - padding: 20px; -} - -h1 { - margin-bottom: 15px; -} - -h2 { - margin-bottom: 11px; -} - -h3 { - margin-bottom: 7px; + padding: 27px; } p, li { @@ -50,6 +42,7 @@ pre { margin-right: 15px; color: #606060; overflow-x: hidden; + font-size: 90%; } .web-page-status { @@ -113,4 +106,43 @@ footer a:hover { .web-footer-menu ul li:last-child { border-right: 0px solid #777 !important; -} \ No newline at end of file +} + +/* slide view */ + +.next-slide { + margin: 0px -27px 100px -27px; + background: #ffffff; /* Old browsers */ + background: -moz-linear-gradient(top, #eeeeee 0%, #fff 100%); /* FF3.6+ */ + background: -webkit-linear-gradient(top, #eeeeee 0%, #fff 100%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, #eeeeee 0%, #fff 100%); /* Opera 11.10+ */ + background: -ms-linear-gradient(top, #eeeeee 0%, #fff 100%); /* IE10+ */ + background: linear-gradient(top, #eeeeee 0%, #fff 100%); /* W3C */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#fff',GradientType=0 ); /* IE6-9 */ + height: 36px; +} + +.slide-shadow { + background: #eeeeee; /* Old browsers */ + background: -moz-linear-gradient(top, #bababa 0%,#eeeeee 100%); /* FF3.6+ */ + background: -webkit-linear-gradient(top, #bababa 0%,#eeeeee 100%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, #bababa 0%,#eeeeee 100%); /* Opera 11.10+ */ + background: -ms-linear-gradient(top, #bababa 0%,#eeeeee 100%); /* IE10+ */ + background: linear-gradient(top, #bababa 0%,#eeeeee 100%); /* W3C */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#bababa', endColorstr='#eeeeee',GradientType=0 ); /* IE6-9 */ + height: 3px; + margin: 100px -27px 0px -27px; + border-top: 1px solid #bababa; +} + +.two-column { + width: 40%; + float: left; + padding: 5%; +} + +.clear { + clear: both; +} + +/* */ \ No newline at end of file diff --git a/erpnext/website/doctype/web_page/template.html b/erpnext/website/doctype/web_page/template.html index 69500699a71..e6f071d0a7a 100644 --- a/erpnext/website/doctype/web_page/template.html +++ b/erpnext/website/doctype/web_page/template.html @@ -1,16 +1,25 @@
-
- {% if doc.head_section %} +
+ {% if doc.head_section and doc.layout=='Two column with header' %}
{{ doc.head_section_html }}
{% endif %} + + {% if doc.layout.startswith('Two column') %}
+ {% endif %} {{ doc.main_section_html }} {% if doc.next_page_html %} {{ doc.next_page_html }} {% endif %} + + {% if doc.layout.startswith('Two column') %}
+ {% endif %} + + {% if doc.layout.startswith('Two column') %}
{{ doc.side_section_html }} {% if doc.see_also %} @@ -20,6 +29,7 @@
{% endif %}
+ {% endif %}
diff --git a/erpnext/website/doctype/web_page/web_page.js b/erpnext/website/doctype/web_page/web_page.js new file mode 100644 index 00000000000..442907512a2 --- /dev/null +++ b/erpnext/website/doctype/web_page/web_page.js @@ -0,0 +1,15 @@ +$.extend(cur_frm.cscript, { + layout: function(doc) { + if(!doc.layout) doc.layout = 'Two column with header' + hide_field(['head_section', 'side_section']); + if(doc.layout=='Two column with header') { + unhide_field(['head_section', 'side_section']); + } + if(doc.layout=='Two column') { + unhide_field('side_section'); + } + }, + refresh: function(doc) { + cur_frm.cscript.layout(doc); + } +}) \ No newline at end of file diff --git a/erpnext/website/doctype/web_page/web_page.txt b/erpnext/website/doctype/web_page/web_page.txt index 5adbccc6252..7c155d788c6 100644 --- a/erpnext/website/doctype/web_page/web_page.txt +++ b/erpnext/website/doctype/web_page/web_page.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2012-03-27 14:36:48', + 'creation': '2012-04-02 16:02:43', 'docstatus': 0, - 'modified': '2012-03-27 14:36:48', + 'modified': '2012-04-10 10:41:00', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -17,12 +17,12 @@ 'colour': u'White:FFF', 'description': u'A custom page is a simple page with the layout - headline, main section, side section\n\nEditing:\n\n- Editing is in [markdown format](http://daringfireball.net/projects/markdown/syntax)\n- You can also add images and embed html code\n\nAccessing the page:\n\n- The page can be accessed as #![page-name] after the main url\n\nIdeal for pages like FAQ, Terms and Conditions, Help etc.\n\n', 'doctype': 'DocType', - 'max_attachments': 5, + 'max_attachments': 20, 'module': u'Website', 'name': '__common__', 'section_style': u'Simple', 'show_in_menu': 0, - 'version': 6 + 'version': 11 }, # These values are common for all DocField @@ -66,6 +66,14 @@ 'permlevel': 1 }, + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'sb0', + 'fieldtype': u'Section Break', + 'label': u'Title and Style' + }, + # DocField { 'colour': u'White:FFF', @@ -77,6 +85,42 @@ 'reqd': 1 }, + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'layout', + 'fieldtype': u'Select', + 'label': u'Layout', + 'options': u'Two column with header\nTwo column\nSingle column' + }, + + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'cb1', + 'fieldtype': u'Column Break', + 'width': u'50%' + }, + + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'text_align', + 'fieldtype': u'Select', + 'label': u'Text Align', + 'options': u'Left\nCenter\nRight' + }, + + # DocField + { + 'colour': u'White:FFF', + 'description': u'Page content', + 'doctype': u'DocField', + 'fieldname': u'sb1', + 'fieldtype': u'Section Break', + 'label': u'Content' + }, + # DocField { 'colour': u'White:FFF', @@ -107,6 +151,16 @@ 'label': u'Side Section' }, + # DocField + { + 'colour': u'White:FFF', + 'description': u'Link to other pages in the side bar and next section', + 'doctype': u'DocField', + 'fieldname': u'sb2', + 'fieldtype': u'Section Break', + 'label': u'Links' + }, + # DocField { 'colour': u'White:FFF', diff --git a/js/all-app.js b/js/all-app.js index 0d379fc16d5..5ca3e7c6b00 100644 --- a/js/all-app.js +++ b/js/all-app.js @@ -525,17 +525,7 @@ return false;} var inList=in_list;function add_lists(l1,l2){var l=[];for(var k in l1)l.push(l1[k]);for(var k in l2)l.push(l2[k]);return l;} function docstring(obj){return JSON.stringify(obj);} function DocLink(p,doctype,name,onload){var a=$a(p,'span','link_type');a.innerHTML=a.dn=name;a.dt=doctype;a.onclick=function(){loaddoc(this.dt,this.dn,onload)};return a;} -var doc_link=DocLink;var known_numbers={0:'zero',1:'one',2:'two',3:'three',4:'four',5:'five',6:'six',7:'seven',8:'eight',9:'nine',10:'ten',11:'eleven',12:'twelve',13:'thirteen',14:'fourteen',15:'fifteen',16:'sixteen',17:'seventeen',18:'eighteen',19:'nineteen',20:'twenty',30:'thirty',40:'forty',50:'fifty',60:'sixty',70:'seventy',80:'eighty',90:'ninety'} -function in_words(n){var is_million=wn.control_panel.currency_format=='Millions'?1:0;n=cint(n) -if(known_numbers[n])return known_numbers[n];var bestguess=n+'';var remainder=0 -if(n<=20) -alert('Error while converting to words');else if(n<100){return in_words(Math.floor(n/10)*10)+'-'+in_words(n%10);}else if(n<1000){bestguess=in_words(Math.floor(n/100))+' '+'hundred';remainder=n%100;}else if(!is_million){if(n<100000){bestguess=in_words(Math.floor(n/1000))+' '+'thousand';remainder=n%1000;}else if(n<10000000){bestguess=in_words(Math.floor(n/100000))+' '+'lakh';remainder=n%100000;}else{bestguess=in_words(Math.floor(n/10000000))+' '+'crore' -remainder=n%10000000}}else{if(n<1000000){bestguess=in_words(Math.floor(n/1000))+' '+'thousand';remainder=n%1000;}else if(n<1000000000){bestguess=in_words(Math.floor(n/1000000))+' '+'million';remainder=n%1000000;}else{bestguess=in_words(Math.floor(n/1000000000))+' '+'billion' -remainder=n%1000000000}} -if(remainder){if(remainder>=100)comma=',' -else comma='' -return bestguess+comma+' '+in_words(remainder);}else{return bestguess;}} -function roundNumber(num,dec){var result=Math.round(num*Math.pow(10,dec))/Math.pow(10,dec);return result;} +var doc_link=DocLink;function roundNumber(num,dec){var result=Math.round(num*Math.pow(10,dec))/Math.pow(10,dec);return result;} /* * lib/js/legacy/utils/datetime.js */ @@ -696,18 +686,6 @@ msg_dialog.custom_onhide=callback;} var growl_area;function show_alert(txt,id){if(!growl_area){growl_area=$a(popup_cont,'div','',{position:'fixed',bottom:'8px',right:'8px',width:'320px',zIndex:10});} var wrapper=$a(growl_area,'div','',{position:'relative'});var body=$a(wrapper,'div','notice');var c=$a(body,'i','icon-remove-sign',{cssFloat:'right',cursor:'pointer'});$(c).click(function(){$dh(this.wrapper)});c.wrapper=wrapper;var t=$a(body,'div','',{color:'#FFF'});$(t).html(txt);if(id){$(t).attr('id',id);} $(wrapper).hide().fadeIn(1000);} -/* - * lib/js/legacy/utils/shortcut.js - */ -(function(jQuery){jQuery.hotkeys={version:"0.8",specialKeys:{8:"backspace",9:"tab",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",191:"/",224:"meta"},shiftNums:{"`":"~","1":"!","2":"@","3":"#","4":"$","5":"%","6":"^","7":"&","8":"*","9":"(","0":")","-":"_","=":"+",";":": ","'":"\"",",":"<",".":">","/":"?","\\":"|"}};function keyHandler(handleObj){if(typeof handleObj.data!=="string"){return;} -var origHandler=handleObj.handler,keys=handleObj.data.toLowerCase().split(" ");handleObj.handler=function(event){if(this!==event.target&&(/textarea|select/i.test(event.target.nodeName)||event.target.type==="text")){return;} -var special=event.type!=="keypress"&&jQuery.hotkeys.specialKeys[event.which],character=String.fromCharCode(event.which).toLowerCase(),key,modif="",possible={};if(event.altKey&&special!=="alt"){modif+="alt+";} -if(event.ctrlKey&&special!=="ctrl"){modif+="ctrl+";} -if(event.metaKey&&!event.ctrlKey&&special!=="meta"){modif+="meta+";} -if(event.shiftKey&&special!=="shift"){modif+="shift+";} -if(special){possible[modif+special]=true;}else{possible[modif+character]=true;possible[modif+jQuery.hotkeys.shiftNums[character]]=true;if(modif==="shift+"){possible[jQuery.hotkeys.shiftNums[character]]=true;}} -for(var i=0,l=keys.length;i '):'';var $button=$('').click(fn).appendTo(tb);if(green){$button.addClass('btn-info');$button.find('i').addClass('icon-white');} if(bold)$button.css('font-weight','bold');this.buttons[label]=$button.get(0);$ds(this.toolbar_area);return this.buttons[label];} PageHeader.prototype.clear_toolbar=function(){this.toolbar_area.innerHTML='';this.buttons={};} @@ -1189,22 +1167,6 @@ var uploaders={};var upload_frame_count=0;Uploader=function(parent,args,callback var inp=$a_input($a(ul_form,'span'),'hidden',{name:'uploader_id'});inp.value=id;var inp=$a_input($a(ul_form,'span'),'submit',null,{marginLeft:'7px'});inp.value='Upload';$y(inp,{width:'80px'});for(var key in args){var inp=$a_input($a(ul_form,'span'),'hidden',{name:key});inp.value=args[key];} uploaders[id]=this;} function upload_callback(id,fid){uploaders[id].callback(fid);} -/* - * lib/js/legacy/webpage/page.js - */ -function Page(page_name,content){var me=this;this.name=page_name;this.trigger=function(event){try{if(pscript[event+'_'+this.name]) -pscript[event+'_'+this.name](me.wrapper);if(me.wrapper[event]){me.wrapper[event](me.wrapper);}}catch(e){console.log(e);}} -this.page_show=function(){set_title(me.doc.title?me.doc.title:me.name);if(!me.onload_complete){me.trigger('onload');me.onload_complete=true;} -me.trigger('onshow');cur_frm=null;} -this.wrapper=wn.container.add_page(page_name,this.page_show);this.cont=this.wrapper -if(content) -this.wrapper.innerHTML=content;return this;} -function render_page(page_name,menuitem){if(!page_name)return;if((!locals['Page'])||(!locals['Page'][page_name])){loadpage('_home');return;} -var pdoc=locals['Page'][page_name];if(pdoc.style)set_style(pdoc.style) -var p=new Page(page_name,pdoc._Page__content?pdoc._Page__content:pdoc.content);var script=pdoc.__script?pdoc.__script:pdoc.script;p.doc=pdoc;if(script){eval(script);} -wn.container.change_to(page_name);return p;} -function refresh_page(page_name){var fn=function(r,rt){render_page(page_name)} -$c('webnotes.widgets.page.getpage',{'name':page_name},fn);} /* * lib/js/legacy/wn/page_layout.js */ @@ -1409,7 +1371,7 @@ return false;} * lib/js/wn/views/breadcrumbs.js */ wn.provide('wn.views');wn.views.breadcrumbs=function(parent,module,doctype,name){var $bspan=$(repl('\ - ',{home_page:wn.boot.home_page}));if(module){$bspan.append(repl(' / %(module)s Home',{module:module,module_small:module.toLowerCase()}))} + Home',{home_page:wn.boot.home_page}));if(module){$bspan.append(repl(' / %(module)s Home',{module:module,module_small:module.toLowerCase()}))} if(doctype&&(locals.DocType[doctype]&&!locals.DocType[doctype].issingle)){$bspan.append(repl(' / %(doctype)s List',{doctype:doctype}))} if(name){$bspan.append(' / '+name)} $bspan.appendTo(parent);} @@ -1642,7 +1604,7 @@ d.cur_frm=f;d.dn=dn;d.table_form=f.meta.istable;f.refresh(dn);d.dialog.show();}) /* * lib/js/legacy/widgets/form/form_header.js */ -_f.FrmHeader=function(parent,frm){var me=this;this.wrapper=$a(parent,'div');if(frm.meta.in_dialog)$y(this.wrapper,{marginLeft:'8px',marginRight:'8px'});this.page_head=new PageHeader(this.wrapper);wn.views.breadcrumbs(this.page_head.breadcrumbs,frm.meta.module,frm.meta.name);this.dt_area=$a(this.page_head.main_head,'h1','',{marginRight:'8px',display:'inline'}) +_f.FrmHeader=function(parent,frm){var me=this;this.wrapper=$a(parent,'div');if(frm.meta.in_dialog)$y(this.wrapper,{marginLeft:'8px',marginRight:'8px'});this.page_head=new PageHeader(this.wrapper);wn.views.breadcrumbs(this.page_head.breadcrumbs,frm.meta.module,frm.meta.name);this.dt_area=$a(this.page_head.main_head,'span','',{marginRight:'8px',display:'inline'}) var div=$a(null,'div','',{marginBottom:'4px'});this.page_head.wrapper.insertBefore(div,this.page_head.sub_head);this.dn_area=$a(div,'span','',{fontSize:'14px',fontWeight:'normal',marginRight:'8px',padding:'2px'}) this.status_area=$a(div,'span','',{marginRight:'8px',marginBottom:'2px',cursor:'pointer',textShadow:'none'})} _f.FrmHeader.prototype.show=function(){$ds(this.wrapper);} diff --git a/js/all-web.js b/js/all-web.js index 90f035eb3f9..d7f8f1c43e7 100644 --- a/js/all-web.js +++ b/js/all-web.js @@ -19,33 +19,6 @@ */ !function(a){a(function(){"use strict",a.support.transition=function(){var b=document.body||document.documentElement,c=b.style,d=c.transition!==undefined||c.WebkitTransition!==undefined||c.MozTransition!==undefined||c.MsTransition!==undefined||c.OTransition!==undefined;return d&&{end:function(){var b="TransitionEnd";return a.browser.webkit?b="webkitTransitionEnd":a.browser.mozilla?b="transitionend":a.browser.opera&&(b="oTransitionEnd"),b}()}}()})}(window.jQuery),!function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype={constructor:c,close:function(b){function f(){e.remove(),e.trigger("closed")}var c=a(this),d=c.attr("data-target"),e;d||(d=c.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),e=a(d),e.trigger("close"),b&&b.preventDefault(),e.length||(e=c.hasClass("alert")?c:c.parent()),e.removeClass("in"),a.support.transition&&e.hasClass("fade")?e.on(a.support.transition.end,f):f()}},a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("alert");e||d.data("alert",e=new c(this)),typeof b=="string"&&e[b].call(d)})},a.fn.alert.Constructor=c,a(function(){a("body").on("click.alert.data-api",b,c.prototype.close)})}(window.jQuery),!function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.button.defaults,c)};b.prototype={constructor:b,setState:function(a){var b="disabled",c=this.$element,d=c.data(),e=c.is("input")?"val":"html";a+="Text",d.resetText||c.data("resetText",c[e]()),c[e](d[a]||this.options[a]),setTimeout(function(){a=="loadingText"?c.addClass(b).attr(b,b):c.removeClass(b).removeAttr(b)},0)},toggle:function(){var a=this.$element.parent('[data-toggle="buttons-radio"]');a&&a.find(".active").removeClass("active"),this.$element.toggleClass("active")}},a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("button"),f=typeof c=="object"&&c;e||d.data("button",e=new b(this,f)),c=="toggle"?e.toggle():c&&e.setState(c)})},a.fn.button.defaults={loadingText:"loading..."},a.fn.button.Constructor=b,a(function(){a("body").on("click.button.data-api","[data-toggle^=button]",function(b){a(b.target).button("toggle")})})}(window.jQuery),!function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.carousel.defaults,c),this.options.slide&&this.slide(this.options.slide)};b.prototype={cycle:function(){return this.interval=setInterval(a.proxy(this.next,this),this.options.interval),this},to:function(b){var c=this.$element.find(".active"),d=c.parent().children(),e=d.index(c),f=this;if(b>d.length-1||b<0)return;return this.sliding?this.$element.one("slid",function(){f.to(b)}):e==b?this.pause().cycle():this.slide(b>e?"next":"prev",a(d[b]))},pause:function(){return clearInterval(this.interval),this},next:function(){if(this.sliding)return;return this.slide("next")},prev:function(){if(this.sliding)return;return this.slide("prev")},slide:function(b,c){var d=this.$element.find(".active"),e=c||d[b](),f=this.interval,g=b=="next"?"left":"right",h=b=="next"?"first":"last",i=this;return this.sliding=!0,f&&this.pause(),e=e.length?e:this.$element.find(".item")[h](),!a.support.transition&&this.$element.hasClass("slide")?(this.$element.trigger("slide"),d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid")):(e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),this.$element.trigger("slide"),this.$element.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid")},0)})),f&&this.cycle(),this}},a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("carousel"),f=typeof c=="object"&&c;e||d.data("carousel",e=new b(this,f)),typeof c=="number"?e.to(c):typeof c=="string"||(c=f.slide)?e[c]():e.cycle()})},a.fn.carousel.defaults={interval:5e3},a.fn.carousel.Constructor=b,a(function(){a("body").on("click.carousel.data-api","[data-slide]",function(b){var c=a(this),d,e=a(c.attr("data-target")||(d=c.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,"")),f=!e.data("modal")&&a.extend({},e.data(),c.data());e.carousel(f),b.preventDefault()})})}(window.jQuery),!function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.collapse.defaults,c),this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.prototype={constructor:b,dimension:function(){var a=this.$element.hasClass("width");return a?"width":"height"},show:function(){var b=this.dimension(),c=a.camelCase(["scroll",b].join("-")),d=this.$parent&&this.$parent.find(".in"),e;d&&d.length&&(e=d.data("collapse"),d.collapse("hide"),e||d.data("collapse",null)),this.$element[b](0),this.transition("addClass","show","shown"),this.$element[b](this.$element[0][c])},hide:function(){var a=this.dimension();this.reset(this.$element[a]()),this.transition("removeClass","hide","hidden"),this.$element[a](0)},reset:function(a){var b=this.dimension();this.$element.removeClass("collapse")[b](a||"auto")[0].offsetWidth,this.$element.addClass("collapse")},transition:function(b,c,d){var e=this,f=function(){c=="show"&&e.reset(),e.$element.trigger(d)};this.$element.trigger(c)[b]("in"),a.support.transition&&this.$element.hasClass("collapse")?this.$element.one(a.support.transition.end,f):f()},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}},a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("collapse"),f=typeof c=="object"&&c;e||d.data("collapse",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.collapse.defaults={toggle:!0},a.fn.collapse.Constructor=b,a(function(){a("body").on("click.collapse.data-api","[data-toggle=collapse]",function(b){var c=a(this),d,e=c.attr("data-target")||b.preventDefault()||(d=c.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""),f=a(e).data("collapse")?"toggle":c.data();a(e).collapse(f)})})}(window.jQuery),!function(a){function d(){a(b).parent().removeClass("open")}"use strict";var b='[data-toggle="dropdown"]',c=function(b){var c=a(b).on("click.dropdown.data-api",this.toggle);a("html").on("click.dropdown.data-api",function(){c.parent().removeClass("open")})};c.prototype={constructor:c,toggle:function(b){var c=a(this),e=c.attr("data-target"),f,g;return e||(e=c.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,"")),f=a(e),f.length||(f=c.parent()),g=f.hasClass("open"),d(),!g&&f.toggleClass("open"),!1}},a.fn.dropdown=function(b){return this.each(function(){var d=a(this),e=d.data("dropdown");e||d.data("dropdown",e=new c(this)),typeof b=="string"&&e[b].call(d)})},a.fn.dropdown.Constructor=c,a(function(){a("html").on("click.dropdown.data-api",d),a("body").on("click.dropdown.data-api",b,c.prototype.toggle)})}(window.jQuery),!function(a){function c(){var b=this,c=setTimeout(function(){b.$element.off(a.support.transition.end),d.call(b)},500);this.$element.one(a.support.transition.end,function(){clearTimeout(c),d.call(b)})}function d(a){this.$element.hide().trigger("hidden"),e.call(this)}function e(b){var c=this,d=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var e=a.support.transition&&d;this.$backdrop=a('