From f50308f9e8d6be6d915a712881eb4161b4167da2 Mon Sep 17 00:00:00 2001 From: "G. Gibson" Date: Thu, 6 Aug 2026 18:41:49 -0700 Subject: [PATCH] Updated for opal 1.8.3 bug --> use 1.8.2 --- README.md | 2 +- gxg/web/gxg_events.rb | 4 ++- gxg/web/gxg_vdom.rb | 80 ++++++++++++++++++++++++++++++++++++++++-- gxg/web/gxg_windows.rb | 47 +++++++++++++++++++++++++ gxg_web.rb | 5 ++- update_web.sh | 2 +- 6 files changed, 133 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 4484deb..ac4699b 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ GxG Web Client Installation: -sudo gem install opal +sudo gem install opal --version "=1.8.2" ln -s /path/to/opal/stdlib opal-stdlib diff --git a/gxg/web/gxg_events.rb b/gxg/web/gxg_events.rb index 4267bfc..8421ba3 100644 --- a/gxg/web/gxg_events.rb +++ b/gxg/web/gxg_events.rb @@ -117,7 +117,9 @@ module GxG end end end - # email address -- TODO + unless result + # email address -- TODO + end end result end diff --git a/gxg/web/gxg_vdom.rb b/gxg/web/gxg_vdom.rb index a4733db..6c49d25 100644 --- a/gxg/web/gxg_vdom.rb +++ b/gxg/web/gxg_vdom.rb @@ -438,7 +438,7 @@ module GxG path_array = [] queue = [(self)] while queue.size > 0 do - entry = queue.unshift() + entry = queue.shift() if entry unless page() == entry path_array << entry.title.to_s @@ -1155,12 +1155,86 @@ module GxG # puts "Got: #{event_record.inspect}" end end - # - @event_handlers[(the_type)].call(event_record) + # TODO: switch in edit mode to object_selection_component_overly + + if GxG::DISPLAY_DETAILS[:mode] == :browsing + GxG::DISPLAY_DETAILS[:target] = self + @event_handlers[(the_type)].call(event_record) + else + if GxG::DISPLAY_DETAILS[:mode] == :editing + if GxG::EDITMASK.keys.include?(@uuid) + GxG::DISPLAY_DETAILS[:target] = self + @event_handlers[(the_type)].call(event_record) + else + # ??? + # edit object + GxG::DISPLAY_DETAILS[:target] = nil + page.editor_select_object(self,{}) + end + else + # unsupported mode --> expansion + end + end # end end # + def editmask(options={:original_content => true}) + process_queue = [(self)] + mask_queue = [(self)] + while process_queue.size > 0 do + entry = process_queue.shift + if entry + if options[:original_content] == true + if entry.respond_to?(:original_content) + entry.original_content.each_pair do |object_name, the_object| + process_queue << the_object + mask_queue << the_object + end + end + end + # + entry.content.each_pair do |object_name, the_object| + process_queue << the_object + mask_queue << the_object + end + end + end + mask_queue.each do |the_object| + unless GxG::EDITMASK[(the_object.uuid)] + GxG::EDITMASK[(the_object.uuid)] = the_object + end + end + true + end + # + def editunmask(options={:original_content => true}) + process_queue = [(self)] + mask_queue = [(self)] + while process_queue.size > 0 do + entry = process_queue.shift + if entry + if options[:original_content] == true + if entry.respond_to?(:original_content) + entry.original_content.each_pair do |object_name, the_object| + process_queue << the_object + mask_queue << the_object + end + end + end + # + entry.content.each_pair do |object_name, the_object| + process_queue << the_object + mask_queue << the_object + end + end + end + mask_queue.each do |the_object| + tempobject = GxG::EDITMASK.delete(the_object.uuid) + end + true + end + # TODO: fix indent wierdness def set_script(the_script_body="", alternate_target=nil) result = false if the_script_body.size > 0 diff --git a/gxg/web/gxg_windows.rb b/gxg/web/gxg_windows.rb index b32f808..3bc6e21 100644 --- a/gxg/web/gxg_windows.rb +++ b/gxg/web/gxg_windows.rb @@ -1625,6 +1625,53 @@ module GxG # ### Page supports module Vdom class Page + # Busy/Unbusy Supports: + def busy() + @busy + end + # + def set_busy(state=false) + if state == true + unless @busy == true + busy_overlay = {:component => "block", :options => {:title => "gxg_wait_overlay", :style => {:cursor => "wait", :opacity => 0.01, :"background-color" => "#ffffff", :position => "absolute", :top => "0px", :left => "0px", :width => "100%", :height => "100%", :"z-index" => 9999}}, :content => [], :script => ""} + busy_overlay[:script] = " + on(:mouseup,true) do |event| + end + on(:mousedown,true) do |event| + end + on(:mousemove,true) do |event| + end + on(:mouseenter,true) do |event| + end + on(:mouseleave,true) do |event| + end + " + self.build_components([{:parent => nil, :record => {:content => [(busy_overlay)]}, :element => self}]) + @busy = true + end + else + if @busy == true + busy_overlay = self.find_object_by_title("gxg_wait_overlay") + if busy_overlay + self.unregister_object("gxg_wait_overlay") + busy_overlay.destroy + end + @busy = false + end + end + @busy + end + # + def editor_select_object(the_object=nil, options={}) + result = false + # + if the_object + # Get top-left and height and width from native object + end + # + result + end + # def window_open(build_source=nil, the_application=nil) if build_source.is_a?(GxG::Database::DetachedHash) self.build_components(self, [(build_source)], {:application => the_application}) diff --git a/gxg_web.rb b/gxg_web.rb index 9cf44b7..de868a2 100644 --- a/gxg_web.rb +++ b/gxg_web.rb @@ -47,6 +47,9 @@ require 'web/gxg_database' require 'web/gxg_libraries' require 'web/gxg_applications' # Ferro-Alternative: Foundation Framwork +module GxG + EDITMASK = {} +end require 'web/gxg_vdom' require 'web/gxg_foundation' require 'web/gxg_layout' @@ -55,7 +58,7 @@ require 'web/gxg_gui' require 'web/gxg_comm' # module GxG - DISPLAY_DETAILS = {:server_status => :running, :logged_in => false, :host_path => "", :use_ssl => false, :socket => nil, :object => nil, :theme => "default", :query => {}, :article => nil, :mode => :browsing} + DISPLAY_DETAILS = {:server_status => :running, :logged_in => false, :host_path => "", :use_ssl => false, :socket => nil, :object => nil, :theme => "default", :query => {}, :article => nil, :mode => :browsing, :target => nil} LAYOUT = {:"top-left" => {}, :top => {}, :"top-right" => {}, :right => {}, :"bottom-right" => {}, :bottom => {}, :"bottom-left" => {}, :left => {}} LAYOUT_LIMITS = {:top => 0, :left => 0, :bottom => `window.innerHeight`.to_i, :right => `window.innerWidth`.to_i, :page_width => `window.innerWidth`.to_i, :page_height => `window.innerHeight`.to_i} APPLICATIONS = {:processes => {}, :libraries => {}, :viewports => {}, :prefetching => false} diff --git a/update_web.sh b/update_web.sh index ef5d8fe..74cf44e 100755 --- a/update_web.sh +++ b/update_web.sh @@ -4,4 +4,4 @@ rm ./gxg.js #opal -I ./gxg -I ./gxg/deps -I ./gxg/standard --compile gxg_web.rb > gxg.js #opal -I ./gxg -I ./gxg/deps -I ./gxg/standard --compile gxg_web.rb > gxg.js # minify ./gxg.js > ../src/main/gxg.js -JRUBY_OPTS=-J-Xss8192k OPAL_PREFORK_DISABLE=1 opal -I ./gxg -I ./gxg/deps -I ./gxg/standard --compile gxg_web.rb > gxg.js +JRUBY_OPTS=-J-Xss8192k OPAL_PREFORK_DISABLE=1 opal -I ./opal-stdlib -I ./gxg -I ./gxg/deps -I ./gxg/standard --compile gxg_web.rb > gxg.js