# def append_to target, content
# @fluxToSend.send "$('#{target}').appendTo('#{content}');"
# end
#
# def append target, content, id=time, css_class="standard_object"
# content="
#{content}
"
# @fluxToSend.send "$('#{target}').append('#{content}');"
# end
#
# def prepend_to target, content
# @fluxToSend.send "$('#{target}').prependTo('#{content}');"
# end
#
# def prepend target, content
# @fluxToSend.send "$('#{target}').prepend('#{content}');"
# end
#
# def set_time_out time, fct_content
# @fluxToSend.send "setTimeout(function(){#{fct_content}}, #{time})"
# end
#
# def every time, fct_name, fct_content
# @fluxToSend.send "var #{fct_name}=setInterval(function(){#{fct_content}},#{time})"
# end
#
# def kill_every fct_name
# @fluxToSend.send "clearInterval(#{fct_name});"
# end
#
# def ready datas
# @fluxToSend.send = "$(document).ready(function(){#{datas}}"
# end
#
# def alert message
# @fluxToSend.send "alert('#{message}')"
#
# end
#
# def send_alert message
# return "alert('#{message}')"
# end
#
# def click target, action
# @fluxToSend.send "$('#{target}').click(function(){#{action}});"
# end
#
# def native flow_to_send
# @fluxToSend.send flow_to_send
# end
#
# def this
# "this"
# end
#
# def html object, content
# if object=='this'
# "$(#{object}).html('#{content}')"
# else
# "$('#{object}').html('#{content}')"
# end
# end
#
# def text object, content
# if object=='this'
# "$(#{object}).text('#{content}')"
# else
# "$('#{object}').text('#{content}')"
# end
# end
#
# def each selection, action
# @fluxToSend.send "$('#{selection}').each(function(index){#{action}});"
# end
def last_ID_created
last_ID_saved= File.read("../diamonds/user_app/ID_Repository.txt")
last_ID_saved=last_ID_saved.to_i+1
File.write("../diamonds/user_app/ID_Repository.txt", last_ID_saved)
return "source_obj_#{last_ID_saved}"
end
def teleport_to_client_view message
# file=File.read("./apps/user_app.rb")
# puts file
open("./apps/user_app.rb", 'a') { |f|
f.puts message
}
end
def alert message
message=message.gsub("'","\"")
teleport_to_client_view "alert '" +message+"'"
end
def timeout params
fct=params[:function]
time=params[:delay]
send_this = <.#{id}{position:#{position} ;z-index:#{z_index};width:#{width}; height:#{height};top:#{left};left:#{left};background-color:#{background_color};color:#{color};border-style:#{border_style};border-width:#{border_width};border-color:#{border_color};border-radius: #{border_radius};#{style};}")
Element.find("#{target}").append("<#{type} id='#{id}' class='system_object #{objclass} #{id}'>#{text}#{type}>")
HEREDOC
# alert "l'ID est : #{id} trouvé : #{last_ID_created}"
teleport_to_client_view send_this
end
def the_big_verif
puts "ok ok\n"*99
end