Updated for opal 1.8.3 bug --> use 1.8.2

This commit is contained in:
G. Gibson 2026-08-06 18:41:49 -07:00
parent 55eb93501e
commit f50308f9e8
6 changed files with 133 additions and 7 deletions

View file

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

View file

@ -117,8 +117,10 @@ module GxG
end
end
end
unless result
# email address -- TODO
end
end
result
end
#

View file

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

View file

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

View file

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

View file

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