2016-04-21 15:14:50 +00:00
function newContactHTMLBuilder ( ) { var a = document . createElement ( "h4" ) ; a . dataset . icon = "p" ; a . className = "new-contact" ; a . innerHTML = "<input type='text' class='no-line' data-name='number' placeholder='Num\u00e9ro de t\u00e9l\u00e9phone'> " ; a . innerHTML += "<input type='text' class='no-line' data-name='username' placeholder='Pseudo'> " ; a . innerHTML += "<input type='text' class='no-line' data-name='firstname' placeholder='Pr\u00e9nom'> " ; a . innerHTML += "<input type='text' class='no-line' data-name='lastname' placeholder='Nom'> " ;
2016-04-22 08:27:58 +00:00
a . innerHTML += "<input type='submit' class='primary no-line sub-number' value='Enregistrer'>" ; return a } var ficheRelationHTML = "" ; function updateListener ( a , b , c , d ) { a . removeEventListener ( b , c ) ; d . addEventListener ( b , c ) ; return d } var ic = new inputChecker , FormDeflaterP = { tags : [ "input" ] , attr : [ "data-name" ] } , importCallLog = $ ( 'input#call_log-import[type="file"]' ) , contactDeflaters = [ ] ;
function contactForms ( ) { var a = $$ ( "h4.new-contact" ) ; contactDeflaters = [ ] ; for ( var b = 0 ; b < a . length ; b ++ ) contactDeflaters . push ( new FormDeflater ( a [ b ] , FormDeflaterP . tags , FormDeflaterP . attr ) ) ; return a } var addContact = $ ( "h4.add-contact" ) , contactContainer = $ ( "article.contact-panel" ) ;
2016-04-21 15:14:50 +00:00
function addNewContact ( ) { console . log ( "adding New Contact" ) ; console . log ( contactContainer . children ) ; contactContainer . removeChild ( addContact ) ; contactContainer . appendChild ( newContactHTMLBuilder ( ) ) ; contactContainer . appendChild ( addContact ) } addContact . addEventListener ( "click" , addNewContact , ! 1 ) ; var relationDeflaters = [ ] ;
2016-04-22 08:27:58 +00:00
function relationForms ( ) { var a = $$ ( "h4.fiche-relation" ) ; relationDeflaters = [ ] ; for ( var b = 0 ; b < a . length ; b ++ ) relationDeflaters . push ( new FormDeflater ( a [ b ] , FormDeflaterP . tags , FormDeflaterP . attr ) ) ; return a } importCallLog . addEventListener ( "change" , function ( a ) { api . send ( { path : "upload/call_log" , file : importCallLog . files [ 0 ] } , function ( a ) { console . log ( a ) ; 0 == a . ModuleError && importCallLog . addClass ( "active" ) } ) } , ! 1 ) ;