@ -1,19 +1,4 @@
/ *
* lib / js / lib / history / history . min . js
* /
/ *
* jQuery hashchange event - v1 . 3 - 7 / 21 / 2010
* http : //benalman.com/projects/jquery-hashchange-plugin/
*
* Copyright ( c ) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses .
* http : //benalman.com/about/license/
* /
( function ( $ , e , b ) { var c = "hashchange" , h = document , f , g = $ . event . special , i = h . documentMode , d = "on" + c in e && ( i === b || i > 7 ) ; function a ( j ) { j = j || location . href ; return "#" + j . replace ( /^[^#]*#?(.*)$/ , "$1" ) } $ . fn [ c ] = function ( j ) { return j ? this . bind ( c , j ) : this . trigger ( c ) } ; $ . fn [ c ] . delay = 50 ; g [ c ] = $ . extend ( g [ c ] , { setup : function ( ) { if ( d ) { return false } $ ( f . start ) } , teardown : function ( ) { if ( d ) { return false } $ ( f . stop ) } } ) ; f = ( function ( ) { var j = { } , p , m = a ( ) , k = function ( q ) { return q } , l = k , o = k ; j . start = function ( ) { p || n ( ) } ; j . stop = function ( ) { p && clearTimeout ( p ) ; p = b } ; function n ( ) { var r = a ( ) , q = o ( m ) ; if ( r !== m ) { l ( m = r , q ) ; $ ( e ) . trigger ( c ) } else { if ( q !== m ) { location . href = location . href . replace ( /#.*/ , "" ) + q } } p = setTimeout ( n , $ . fn [ c ] . delay ) } $ . browser . msie && ! d && ( function ( ) { var q , r ; j . start = function ( ) { if ( ! q ) { r = $ . fn [ c ] . src ; r = r && r + a ( ) ; q = $ ( '<iframe tabindex="-1" title="empty"/>' ) . hide ( ) . one ( "load" , function ( ) { r || l ( a ( ) ) ; n ( ) } ) . attr ( "src" , r || "javascript:0" ) . insertAfter ( "body" ) [ 0 ] . contentWindow ; h . onpropertychange = function ( ) { try { if ( event . propertyName === "title" ) { q . document . title = h . title } } catch ( s ) { } } } } ; j . stop = k ; o = function ( ) { return a ( q . location . href ) } ; l = function ( v , s ) { var u = q . document , t = $ . fn [ c ] . domain ; if ( v !== s ) { u . title = h . title ; u . open ( ) ; t && u . write ( '<script>document.domain="' + t + '"<\/script>' ) ; u . close ( ) ; q . location . hash = v } } } ) ( ) ; return j } ) ( ) } ) ( jQuery , this ) ;
/ *
* lib / js / lib / jquery / jquery . ui . core . js
* /
@ -1314,7 +1299,7 @@ LocalDB.delete_doc=function(dt,dn){var doc=get_local(dt,dn);for(var ndt in local
delete locals [ dt ] [ dn ] ; }
function get_local ( dt , dn ) { return locals [ dt ] ? locals [ dt ] [ dn ] : null ; }
LocalDB . sync = function ( list ) { if ( list . _ kl ) list = expand_doclist ( list ) ; for ( var i = 0 ; i < list . length ; i ++ ) { var d = list [ i ] ; if ( ! d . name )
d . name = LocalDB . get_localname ( d . doctype ) ; LocalDB . add ( d . doctype , d . name ) ; locals [ d . doctype ] [ d . name ] = d ; if ( d . doctype == 'DocField' ) wn . meta . add_field ( d ) ; if ( d . localname ) { wn . model . new_names [ d . localname ] = d . name ; console . log ( d . localname ) ; $ ( document ) . trigger ( 'rename' , [ d . doctype , d . localname , d . name ] ) ; delete locals [ d . doctype ] [ d . localname ] ; } } }
d . name = LocalDB . get_localname ( d . doctype ) ; LocalDB . add ( d . doctype , d . name ) ; locals [ d . doctype ] [ d . name ] = d ; if ( d . doctype == 'DocField' ) wn . meta . add_field ( d ) ; if ( d . localname ) { wn . model . new_names [ d . localname ] = d . name ; $ ( document ) . trigger ( 'rename' , [ d . doctype , d . localname , d . name ] ) ; delete locals [ d . doctype ] [ d . localname ] ; } } }
local_name_idx = { } ; LocalDB . get_localname = function ( doctype ) { if ( ! local_name_idx [ doctype ] ) local_name_idx [ doctype ] = 1 ; var n = 'New ' + get_doctype_label ( doctype ) + ' ' + local_name_idx [ doctype ] ; local_name_idx [ doctype ] ++ ; return n ; }
LocalDB . set_default_values = function ( doc ) { var doctype = doc . doctype ; var docfields = wn . meta . docfield_list [ doctype ] ; if ( ! docfields ) { return ; }
var fields_to_refresh = [ ] ; for ( var fid = 0 ; fid < docfields . length ; fid ++ ) { var f = docfields [ fid ] ; if ( ! in_list ( no_value_fields , f . fieldtype ) && doc [ f . fieldname ] == null ) { var v = LocalDB . get_default_value ( f . fieldname , f . fieldtype , f [ 'default' ] ) ; if ( v ) { doc [ f . fieldname ] = v ; fields_to_refresh . push ( f . fieldname ) ; } } }
@ -1686,7 +1671,7 @@ d.onshow=function(){d.done_btn_area.innerHTML='';d.done_btn=$btn(d.done_btn_area
d . onhide = function ( ) { if ( _ f . cur_grid ) { _ f . cur_grid . refresh_row ( _ f . cur_grid_ridx , me . dn ) ; }
if ( wn . container . page . frm ) { cur_frm = wn . container . page . frm ; }
if ( me . cur_frm . cscript . hide_dialog ) { me . cur_frm . cscript . hide_dialog ( ) ; }
console . log ( me . cur_frm . wrapper ) ; $ ( me . cur_frm . page_layout . wrapper ) . toggle ( false ) ; }
$ ( me . cur_frm . page_layout . wrapper ) . toggle ( false ) ; }
this . dialog = d ; }
_ f . edit_record = function ( dt , dn ) { if ( ! _ f . frm_dialog ) { _ f . frm_dialog = new _ f . FrmDialog ( ) ; }
var d = _ f . frm_dialog ; wn . model . with_doctype ( dt , function ( ) { wn . model . with_doc ( dt , dn , function ( dn ) { if ( ! _ f . frms [ dt ] ) { _ f . frms [ dt ] = new _ f . Frm ( dt , d . body ) ; }
@ -1712,8 +1697,7 @@ this.appframe.add_button('Amend',function(){cur_frm.amend_doc()},'icon-pencil');
/ *
* lib / js / legacy / widgets / form / form . js
* /
wn . provide ( '_f' ) ; _ f . frms = { } ; _ f . Frm = function ( doctype , parent ) { this . docname = '' ; this . doctype = doctype ; this . display = 0 ; var me = this ; this . is_editable = { } ; this . opendocs = { } ; this . sections = [ ] ; this . grids = [ ] ; this . cscript = { } ; this . pformat = { } ; this . fetch_dict = { } ; this . parent = parent ; this . tinymce_id_list = [ ] ; this . setup_meta ( doctype ) ; var me = this ; $ ( document ) . bind ( 'rename' , function ( event , dt , old_name , new_name ) { console . log ( arguments )
if ( dt == me . doctype )
wn . provide ( '_f' ) ; _ f . frms = { } ; _ f . Frm = function ( doctype , parent ) { this . docname = '' ; this . doctype = doctype ; this . display = 0 ; var me = this ; this . is_editable = { } ; this . opendocs = { } ; this . sections = [ ] ; this . grids = [ ] ; this . cscript = { } ; this . pformat = { } ; this . fetch_dict = { } ; this . parent = parent ; this . tinymce_id_list = [ ] ; this . setup_meta ( doctype ) ; var me = this ; $ ( document ) . bind ( 'rename' , function ( event , dt , old_name , new_name ) { if ( dt == me . doctype )
me . rename_notify ( dt , old_name , new_name ) } ) ; }
_ f . Frm . prototype . check_doctype_conflict = function ( docname ) { var me = this ; if ( this . doctype == 'DocType' && docname == 'DocType' ) { msgprint ( 'Allowing DocType, DocType. Be careful!' ) } else if ( this . doctype == 'DocType' ) { if ( wn . views . formview [ docname ] ) { msgprint ( "Cannot open DocType when its instance is open" )
throw 'doctype open conflict' } } else { if ( wn . views . formview . DocType && wn . views . formview . DocType . frm . opendocs [ this . doctype ] ) { msgprint ( "Cannot open instance when its DocType is open" )
@ -1809,7 +1793,7 @@ this.runclientscript('validate',this.doctype,this.docname);if(!validated){this.s
var ret_fn = function ( r ) { me . savingflag = false ; if ( user == 'Guest' && ! r . exc ) { $dh ( me . page_layout . wrapper ) ; $ds ( me . saved_wrapper ) ; me . saved_wrapper . innerHTML = '<div style="padding: 150px 16px; text-align: center; font-size: 14px;">'
+ ( cur_frm . message_after_save ? cur_frm . message_after_save : 'Your information has been sent. Thank you!' )
+ '</div>' ; return ; }
if ( ! me . meta . istable ) { me . refresh ( ) ; }
if ( ! me . meta . istable ) { me . refresh ( r . docname ) ; }
if ( call_back ) { call_back ( r ) ; } }
var me = this ; var ret_fn_err = function ( r ) { var doc = locals [ me . doctype ] [ me . docname ] ; me . savingflag = false ; ret_fn ( r ) ; }
this . savingflag = true ; if ( this . docname && validated ) { scroll ( 0 , 0 ) ; return this . savedoc ( save_action , ret_fn , ret_fn_err ) ; } }