Merge branch 'shf_rename' of github.com:webnotes/erpnext into shf_rename

This commit is contained in:
Anand Doshi 2012-04-10 12:39:15 +05:30
commit cfcaf38111
12 changed files with 247 additions and 558 deletions

View File

@ -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",

View File

@ -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;

View File

@ -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;
}
/* */

View File

@ -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;

View File

@ -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;
}
}
/* 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;
}
/* */

View File

@ -1,16 +1,25 @@
<div class="layout_wrapper">
<div class="web-content" id="content-{{ doc.name }}">
{% if doc.head_section %}
<div class="web-content" id="content-{{ doc.name }}"
style="text-align: {{ doc.text_align }};">
{% if doc.head_section and doc.layout=='Two column with header' %}
<div class="web-head-section">
{{ doc.head_section_html }}
</div>
{% endif %}
{% if doc.layout.startswith('Two column') %}
<div class="web-main-section">
{% endif %}
{{ doc.main_section_html }}
{% if doc.next_page_html %}
{{ doc.next_page_html }}
{% endif %}
{% if doc.layout.startswith('Two column') %}
</div>
{% endif %}
{% if doc.layout.startswith('Two column') %}
<div class="web-side-section">
{{ doc.side_section_html }}
{% if doc.see_also %}
@ -20,6 +29,7 @@
</div>
{% endif %}
</div>
{% endif %}
<div style="clear: both"></div>
</div>
</div>

View File

@ -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);
}
})

View File

@ -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',

View File

@ -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<l;i++){if(possible[keys[i]]){return origHandler.apply(this,arguments);}}};}
jQuery.each(["keydown","keyup","keypress"],function(){jQuery.event.special[this]={add:keyHandler};});})(jQuery);
/*
* lib/js/legacy/utils/printElement.js
*/;(function(window,undefined){var document=window["document"];var $=window["jQuery"];$.fn["printElement"]=function(options){var mainOptions=$.extend({},$.fn["printElement"]["defaults"],options);if(mainOptions["printMode"]=='iframe'){if($.browser.opera||(/chrome/.test(navigator.userAgent.toLowerCase())))
@ -1051,7 +1029,7 @@ this.show=function(){$ds(me.ldiv);}}
* lib/js/legacy/webpage/page_header.js
*/
var def_ph_style={wrapper:{marginBottom:'16px',backgroundColor:'#EEE'},main_heading:{},sub_heading:{marginBottom:'8px',color:'#555',display:'none'},separator:{borderTop:'1px solid #ddd'},toolbar_area:{padding:'3px 0px',display:'none',borderBottom:'1px solid #ddd'}}
function PageHeader(parent,main_text,sub_text){this.wrapper=$a(parent,'div','page_header');this.close_btn=$a(this.wrapper,'a','close',{},'&times;');this.close_btn.onclick=function(){window.history.back();};this.breadcrumbs=$a(this.wrapper,'div');this.main_head=$a(this.wrapper,'h1','',def_ph_style.main_heading);this.sub_head=$a(this.wrapper,'h4','',def_ph_style.sub_heading);this.separator=$a(this.wrapper,'div','',def_ph_style.separator);this.toolbar_area=$a(this.wrapper,'div','',def_ph_style.toolbar_area);this.padding_area=$a(this.wrapper,'div','',{padding:'3px'});if(main_text)this.main_head.innerHTML=main_text;if(sub_text)this.sub_head.innerHTML=sub_text;this.buttons={};this.buttons2={};}
function PageHeader(parent,main_text,sub_text){this.wrapper=$a(parent,'div','page_header');this.close_btn=$a(this.wrapper,'a','close',{},'&times;');this.close_btn.onclick=function(){window.history.back();};this.breadcrumbs=$a(this.wrapper,'div','breadcrumbs-area');this.main_head=$a(this.wrapper,'h1','',def_ph_style.main_heading);this.sub_head=$a(this.wrapper,'h4','',def_ph_style.sub_heading);this.separator=$a(this.wrapper,'div','',def_ph_style.separator);this.toolbar_area=$a(this.wrapper,'div','',def_ph_style.toolbar_area);this.padding_area=$a(this.wrapper,'div','',{padding:'3px'});if(main_text)this.main_head.innerHTML=main_text;if(sub_text)this.sub_head.innerHTML=sub_text;this.buttons={};this.buttons2={};}
PageHeader.prototype.add_button=function(label,fn,bold,icon,green){var tb=this.toolbar_area;if(this.buttons[label])return;iconhtml=icon?('<i class="'+icon+'"></i> '):'';var $button=$('<button class="btn btn-small">'+iconhtml+label+'</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('<span class="breadcrumbs">\
<a href="#%(home_page)s"><i class="icon-home"></i></a></span>',{home_page:wn.boot.home_page}));if(module){$bspan.append(repl(' / <a href="#!%(module_small)s-home">%(module)s Home</a>',{module:module,module_small:module.toLowerCase()}))}
<a href="#%(home_page)s">Home</a></span>',{home_page:wn.boot.home_page}));if(module){$bspan.append(repl(' / <a href="#!%(module_small)s-home">%(module)s Home</a>',{module:module,module_small:module.toLowerCase()}))}
if(doctype&&(locals.DocType[doctype]&&!locals.DocType[doctype].issingle)){$bspan.append(repl(' / <a href="#!List/%(doctype)s">%(doctype)s List</a>',{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);}

File diff suppressed because one or more lines are too long

24
temp.py
View File

@ -39,17 +39,19 @@ OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
if __name__=='__main__':
import os
clicense = '\n'.join([('# ' + l) for l in license2.split('\n')])
for wt in os.walk('lib/py/build/'):
#clicense = '\n'.join([('# ' + l) for l in license2.split('\n')])
cnt = 0
for wt in os.walk('.'):
for fname in wt[2]:
if fname.endswith('.py'):
path = os.path.join(wt[0], fname)
with open(path, 'r') as codefile:
codetxt = codefile.read()
if fname.endswith('.js'):
cnt += 1
#path = os.path.join(wt[0], fname)
#with open(path, 'r') as codefile:
# codetxt = codefile.read()
if codetxt.strip():
with open(path, 'w') as codefile:
codefile.write(clicense + '\n\n' + codetxt)
#if codetxt.strip():
# with open(path, 'w') as codefile:
# codefile.write(clicense + '\n\n' + codetxt)
print 'updated in ' + path
# print 'updated in ' + path
print cnt

View File

@ -1 +1 @@
1507
1539