PageSourceSearch

https://greyos.gr/framework/extensions/js/user/i_mariojs/i_mariojs.js?version=1791060490

js greyos.gr collected 2026-10-03 20:48:21 UTC 5,738 bytes, 194 lines download raw bytes

1/*
2    GreyOS - iMariojs (Version: 1.0)
3
4    File name: i_mariojs.js
5    Description: This file contains the iMarioJS - Online game.
6
7    Coded by George Delaportas (G0D/ViR4X)
8    Copyright © 2023
9    Open Software License (OSL 3.0)
10*/
11
12// iMarioJS (3rd-party integrated online game)
13function i_mariojs()
14{
15    var self = this;
16
17    function config_model()
18    {
19        this.id = null;
20        this.content = null;
21    }
22
23    function utilities()
24    {
25        var me = this;
26
27        this.gui_init = function()
28        {
29            var __data_content_id = i_mariojs_bee.settings.general.id() + '_data';
30
31            infinity.setup(__data_content_id);
32            infinity.begin();
33
34            me.draw();
35            me.attach_events();
36
37            infinity.end();
38
39            return true;
40        };
41
42        this.draw = function()
43        {
44            config.content = '<div class="' + config.id + '">\
45                                 <div id="' + i_mariojs_bee.settings.general.id() + '_overlay" class="overlay"></div>\
46                                 <iframe id= "' + i_mariojs_bee.settings.general.id() + '_frame" title="Mario JS"\
47                                         src="https://lefterise.github.io/mario/" scrolling="no">\
48                                 </iframe>\
49                             </div>';
50
51            i_mariojs_bee.settings.data.window.content(config.content);
52
53            return true;
54        };
55
56        this.attach_events = function()
57        {
58            var __overlay_object = utils_sys.objects.by_id(i_mariojs_bee.settings.general.id() + '_overlay'),
59                __iframe_object = utils_sys.objects.by_id(i_mariojs_bee.settings.general.id() + '_frame');
60
61            utils_sys.events.attach(config.id, __overlay_object, 'click', 
62            function()
63            {
64                __overlay_object.style.display = 'none';
65
66                __iframe_object.focus();
67            });
68
69            return true;
70        };
71    }
72
73    this.base = function()
74    {
75        if (is_init === false)
76            return false;
77
78        return i_mariojs_bee;
79    };
80
81    this.on = function(event_name, event_handler)
82    {
83        if (is_init === false)
84            return false;
85
86        return i_mariojs_bee.on(event_name, event_handler);
87    };
88
89    this.run = function()
90    {
91        if (is_init === false)
92            return false;
93
94        return i_mariojs_bee.run();
95    };
96
97    this.quit = function()
98    {
99        if (is_init === false)
100            return false;
101
102        return i_mariojs_bee.close();
103    };
104
105    this.error = function()
106    {
107        if (is_init === false)
108            return false;
109
110        return i_mariojs_bee.error;
111    };
112
113    this.init = function()
114    {
115        if (utils_sys.validation.misc.is_nothing(cosmos))
116            return false;
117
118        if (is_init === true)
119            return false;
120
121        is_init = true;
122
123        i_mariojs_bee = dev_box.get('bee');
124
125        config.id = 'i_mariojs';
126
127        nature.themes.store(config.id);
128        nature.apply('new');
129
130        infinity.init();
131
132        i_mariojs_bee.init(config.id, 'i_mariojs_icon');
133        i_mariojs_bee.settings.data.window.labels.title('iMarioJS (Integrated Online Game)');
134        i_mariojs_bee.settings.data.window.labels.status_bar('Get \'em Mario!');
135        i_mariojs_bee.settings.general.single_instance(true);
136        i_mariojs_bee.settings.actions.can_edit_title(false);
137        i_mariojs_bee.settings.actions.can_use_menu(false);
138        i_mariojs_bee.gui.position.left((swarm.settings.right() / 2) - 600);
139        i_mariojs_bee.gui.position.top(0);
140        i_mariojs_bee.gui.size.width(1057);
141        i_mariojs_bee.gui.size.height(640);
142        i_mariojs_bee.gui.fx.fade.settings.into.set(0.07, 25, 100);
143        i_mariojs_bee.gui.fx.fade.settings.out.set(0.07, 25, 100);
144        i_mariojs_bee.on('open', function() { i_mariojs_bee.gui.fx.fade.into(); });
145        i_mariojs_bee.on('opened', function() { utils_int.gui_init(); });
146        i_mariojs_bee.on('keydown', function()
147                                    {
148                                        console.log('mario JS');
149                                    });
150        i_mariojs_bee.on('drag', function()
151                                 {
152                                     utils_sys.objects.by_id(i_mariojs_bee.settings.general.id() + '_overlay').style.display = 'block';
153                                 });
154        i_mariojs_bee.on('dragging', function()
155                                     {
156                                        i_mariojs_bee.gui.fx.opacity.settings.set(0.7);
157                                        i_mariojs_bee.gui.fx.opacity.apply();
158                                     });
159        i_mariojs_bee.on('dragged', function() { i_mariojs_bee.gui.fx.opacity.reset(); });
160        i_mariojs_bee.on('close', function() { i_mariojs_bee.gui.fx.fade.out(); });
161        i_mariojs_bee.on('closed', function() { nature.themes.clear(config.id); });
162
163        return true;
164    };
165
166    this.cosmos = function(cosmos_object)
167    {
168        if (utils_sys.validation.misc.is_undefined(cosmos_object))
169            return false;
170
171        cosmos = cosmos_object;
172
173        matrix = cosmos.hub.access('matrix');
174        dev_box = cosmos.hub.access('dev_box');
175
176        swarm = matrix.get('swarm');
177        nature = matrix.get('nature');
178        infinity = dev_box.get('infinity');
179
180        return true;
181    };
182
183    var is_init = false,
184        cosmos = null,
185        matrix = null,
186        dev_box = null,
187        swarm = null,
188        nature = null,
189        infinity = null,
190        i_mariojs_bee = null,
191        utils_sys = new vulcan(),
192        config = new config_model(),
193        utils_int = new utilities();
194}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.