cyberweb 0.7.9 → 0.8.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +242 -141
- data/cyberweb.gemspec +6 -6
- data/doc/README.gen +242 -142
- data/doc/todo/todo_for_the_cyberweb_project.md +13 -0
- data/examples/advanced/animated_colourful_border/animated_colourful_border.cgi +149 -0
- data/examples/advanced/no_right_click.cgi +1 -2
- data/examples/css/changing_border_colours_animation/changing_border_colours_animation.html +134 -0
- data/examples/css/editable_boxes_example/editable_boxes_example.html +75 -0
- data/examples/css/flexbox_example/flexbox_example.html +39 -0
- data/examples/css/keyboard_example/keyboard_example.html +238 -0
- data/examples/css/magic_card/magic_card.html +110 -0
- data/examples/css/overflow_example/overflow_example.html +125 -0
- data/examples/css/planet_example/planet_example.html +34 -0
- data/examples/css/progress_bar_examples/progress_bar_examples.html +316 -0
- data/examples/css/single_row_glow/single_row_glow.html +91 -0
- data/examples/css/slinky_animation/slinky_animation.html +292 -0
- data/examples/html/hbox_and_vbox_example.html +5 -5
- data/examples/javascript_and_jquery/all_in_one_example/all_in_one_example.cgi +38 -0
- data/lib/cyberweb/base/misc.rb +63 -25
- data/lib/cyberweb/cascading_style_sheets/border.css +61 -24
- data/lib/cyberweb/cascading_style_sheets/colours.css +2 -0
- data/lib/cyberweb/cascading_style_sheets/default.css +102 -89
- data/lib/cyberweb/cascading_style_sheets/glow_effects.css +36 -0
- data/lib/cyberweb/cascading_style_sheets/margin.css +11 -7
- data/lib/cyberweb/cascading_style_sheets/misc.css +7 -0
- data/lib/cyberweb/cascading_style_sheets/text_shadow.css +6 -1
- data/lib/cyberweb/generator/cgi.rb +9 -1
- data/lib/cyberweb/html_template/html_template.rb +7 -2
- data/lib/cyberweb/javascript_code/custom_functions.js +33 -2
- data/lib/cyberweb/javascript_code/math.js +0 -0
- data/lib/cyberweb/objectified/html_tags/progress.rb +8 -8
- data/lib/cyberweb/skeleton/README.md +2 -0
- data/lib/cyberweb/skeleton/html_keyboard.md +140 -0
- data/lib/cyberweb/toplevel_methods/is_an_image.rb +18 -0
- data/lib/cyberweb/toplevel_methods/listing.rb +2 -3
- data/lib/cyberweb/toplevel_methods/misc.rb +1 -57
- data/lib/cyberweb/toplevel_methods/registered_ids.rb +53 -37
- data/lib/cyberweb/toplevel_methods/sort_this_array_by_time.rb +65 -0
- data/lib/cyberweb/toplevel_methods/video.rb +32 -19
- data/lib/cyberweb/utility_scripts/images_to_html/images_to_html.rb +78 -49
- data/lib/cyberweb/utility_scripts/remove_this_image_from_that_webpage.rb +125 -0
- data/lib/cyberweb/version/version.rb +2 -2
- data/lib/cyberweb/web_images/map_symbol_to_image_location.rb +28 -8
- data/lib/cyberweb/web_object/effects.rb +19 -0
- data/lib/cyberweb/web_object/html_tags.rb +199 -196
- data/lib/cyberweb/web_object/images.rb +83 -26
- data/lib/cyberweb/web_object/misc.rb +1048 -529
- data/lib/cyberweb/web_object/reset.rb +47 -29
- data/lib/cyberweb/yaml/custom_tags.yml +2 -0
- metadata +52 -52
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b459c51f52729d3f1d19e917be17b6cf37b06fbcbe8c62c1a005c31329afe6f
|
4
|
+
data.tar.gz: db63e41b27cca6d25cf35fbd9417cfde6ef2313308e7cc56fee1784cb9557b2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a69c30c551b685608b53609fc9f0c83cc70cf16c3a2d4a44db708cc09e49842d8d72be18aba96636691169d94ee40c0d202f519e7e6ae07393ebb0058edaed21
|
7
|
+
data.tar.gz: bdd7ec2c16b04ffdd27521676176e7b6fe593a5ac94dcba84a05332e6b1bb1a56d54040b6f20735773ada8f8afa9210f3a4e8a14619e98d69a67e62bd8487c73
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
[](https://www.ruby-lang.org/en/)
|
3
3
|
[](https://badge.fury.io/rb/cyberweb)
|
4
4
|
|
5
|
-
This gem was <b>last updated</b> on the <span style="color: darkblue; font-weight: bold">
|
5
|
+
This gem was <b>last updated</b> on the <span style="color: darkblue; font-weight: bold">26.01.2023</span> (dd.mm.yyyy notation), at <span style="color: steelblue; font-weight: bold">00:01:32</span> o'clock.
|
6
6
|
|
7
7
|
<img src="https://i.imgur.com/aC4YzSk.png" style="margin-left: 1.2em">
|
8
8
|
|
@@ -39,7 +39,7 @@ In PHP this is not easily possible, because the syntax is more rigid.
|
|
39
39
|
Thus, at the least in regards to the syntax, ruby is better than
|
40
40
|
PHP - more flexibility syntax-wise is available to ruby users than
|
41
41
|
is for PHP users. This flexibility helps a <b>lot</b> when writing
|
42
|
-
more dynamic, and more
|
42
|
+
more dynamic, and more succinct, code.
|
43
43
|
|
44
44
|
During that **transition phase**, from **php** to **ruby**, the cyberweb
|
45
45
|
project was renamed several times as well - first to **web_foundation**,
|
@@ -886,6 +886,33 @@ useful for short header-entries, such as "Goals" or
|
|
886
886
|
functionality purely exists due to convenience - I wanted
|
887
887
|
to quickly generate the default id entry for a sitemap.
|
888
888
|
|
889
|
+
Note that at the least h2_id() has been improved a bit,
|
890
|
+
directly and indirectly, in <b>January 2023</b>.
|
891
|
+
|
892
|
+
Specifically the following is now valid:
|
893
|
+
|
894
|
+
h2_id('Stickstofffixierung - eine symbiotische Beziehung, als '\
|
895
|
+
'Teil des Stickstoffkreislaufs') { :clickable_image }
|
896
|
+
|
897
|
+
So, what does this do?
|
898
|
+
|
899
|
+
First, as normal, it will "autogenerate" the corresponding
|
900
|
+
ID entry, via the newly created method .sanitize_this_id().
|
901
|
+
I intend to re-use this method for all other parts of the
|
902
|
+
cyberweb gem that require autogeneration of valid ID tags.
|
903
|
+
|
904
|
+
But, even more importantly than that, the block and the
|
905
|
+
Symbol called :clickable_image, will now add an image
|
906
|
+
(a small dot) to the left side of this header. This image
|
907
|
+
is clickable by the user. If the user clicks on that dot,
|
908
|
+
he/she will be re-directed to that specific header as
|
909
|
+
intralink. In other words: this functionality allows us
|
910
|
+
to "tag" any paragraph as intralink, by clicking on it.
|
911
|
+
|
912
|
+
I needed this functionality for many different local
|
913
|
+
websites, so I thought it was more useful if it is made
|
914
|
+
a proper method as-is.
|
915
|
+
|
889
916
|
## Redirecting to another page
|
890
917
|
|
891
918
|
You can combine BeautifulUrl, and Cyberweb, to redirect
|
@@ -1899,18 +1926,6 @@ fine. If they want to contribute code, that's fine - and if they
|
|
1899
1926
|
don't want to, that's fine as well, as far as the cyberweb
|
1900
1927
|
project is concerned.
|
1901
1928
|
|
1902
|
-
## Simple JavaScript Calculator
|
1903
|
-
|
1904
|
-
Use:
|
1905
|
-
|
1906
|
-
add_simple_javascript_calculator
|
1907
|
-
|
1908
|
-
You may need to style the input-tag a bit.
|
1909
|
-
|
1910
|
-
See the following file for a working example:
|
1911
|
-
|
1912
|
-
cyberweb/examples/advanced/simple_calculator.cgi
|
1913
|
-
|
1914
1929
|
## Drag and drop support in general and drag-and-drop support via Dragula
|
1915
1930
|
|
1916
1931
|
Via the new attribute **draggable="true"** it is possible to drag any
|
@@ -2674,20 +2689,6 @@ look at the **repackage gem** to find out how this is done.
|
|
2674
2689
|
Documentation is missing in this regard, but will be added over
|
2675
2690
|
the next weeks slowly.
|
2676
2691
|
|
2677
|
-
## JavaScript variables
|
2678
|
-
|
2679
|
-
The variables in JavaScript are by default global. You can make
|
2680
|
-
them local if you attach the **var** keyword to them.
|
2681
|
-
|
2682
|
-
You can also define several variables in one go, via:
|
2683
|
-
|
2684
|
-
var message = "hi",
|
2685
|
-
found = false,
|
2686
|
-
age = 29;
|
2687
|
-
|
2688
|
-
The keyword **let** has the lowest scope, even less than when
|
2689
|
-
compared to **var**.
|
2690
|
-
|
2691
2692
|
## Including CSS into a webpage
|
2692
2693
|
|
2693
2694
|
If you want to include CSS into a webpage, use the following HTML tag:
|
@@ -3730,23 +3731,6 @@ image at hand if you want it to "lose" colours (for display
|
|
3730
3731
|
purposes only; of course nothing is lost in the image as
|
3731
3732
|
such, only the display of said image is modified via CSS).
|
3732
3733
|
|
3733
|
-
## The progress bar in HTML5
|
3734
|
-
|
3735
|
-
You can use a progressbar to indicate progress based on
|
3736
|
-
percentage values. This is described here in detail:
|
3737
|
-
|
3738
|
-
https://css-tricks.com/html5-progress-element/
|
3739
|
-
|
3740
|
-
In cyberweb you can use:
|
3741
|
-
|
3742
|
-
progress
|
3743
|
-
progress('35 / 100') # 35%
|
3744
|
-
|
3745
|
-
At a later time we may add some javascript to indicate
|
3746
|
-
a counter-progress. Right now (as of February 2022)
|
3747
|
-
this is not possible though, so this part has to come
|
3748
|
-
at a later time.
|
3749
|
-
|
3750
3734
|
## Converting from a .html page to a cyberweb-object
|
3751
3735
|
|
3752
3736
|
The file **bin/html_to_cyberweb_converter** can be used
|
@@ -3891,90 +3875,6 @@ of boilerplate code, which I think is useful in its own right.
|
|
3891
3875
|
Future changes may even simplify this further, but for now
|
3892
3876
|
<b>let's keep it simple</b>.
|
3893
3877
|
|
3894
|
-
## Working with HTML forms, including creating input-buttons in such a form field
|
3895
|
-
|
3896
|
-
<form>
|
3897
|
-
<input type="button" class="BG_GRAYSTD bblack1" value="Default" name="foo" onClick="test1(this.form)">
|
3898
|
-
</form>
|
3899
|
-
|
3900
|
-
<form>
|
3901
|
-
<input class="BG_GRAYSTD bblack1" type="button" value="Default" name="foo" onClick="test1(this.form)">
|
3902
|
-
</form>
|
3903
|
-
|
3904
|
-
You can style ‹input> fields with a different background colour
|
3905
|
-
upon a mouse-focus event.
|
3906
|
-
|
3907
|
-
Examples for this would be:
|
3908
|
-
|
3909
|
-
input :text, 'Hello world!', :focus_with_salmon_background
|
3910
|
-
input :text, 'Hello World!', :focus_with_salmon_background, :select_on_click
|
3911
|
-
|
3912
|
-
View the file at **cyberweb/examples/simple/input_example_with_coloured_focus.cgi**
|
3913
|
-
to see this work in action.
|
3914
|
-
|
3915
|
-
You can modify the ‹input> tag within that via css by using:
|
3916
|
-
|
3917
|
-
input.view_css {}
|
3918
|
-
|
3919
|
-
Note that ‹input type="text"> only works for a single line of
|
3920
|
-
user input. If you would like to have the user work via multiple
|
3921
|
-
lines then you have to use the ‹textarea> tag instead.
|
3922
|
-
There may be work-arounds, such as giving the text-input the
|
3923
|
-
<b>word-break: break-word;</b> attribute, but this may not work
|
3924
|
-
on every browser.
|
3925
|
-
|
3926
|
-
Some shortcuts exist within the Cyberweb project. For instance,
|
3927
|
-
rather than do:
|
3928
|
-
|
3929
|
-
input :checkbox
|
3930
|
-
|
3931
|
-
You can do:
|
3932
|
-
|
3933
|
-
input_checkbox
|
3934
|
-
|
3935
|
-
Same with submit and other variants:
|
3936
|
-
|
3937
|
-
input_submit
|
3938
|
-
input_radio
|
3939
|
-
|
3940
|
-
This may not be a huge improvement, but I wanted to offer
|
3941
|
-
it in the event that some users like to avoid using the
|
3942
|
-
<b>:</b> for the symbol.
|
3943
|
-
|
3944
|
-
Combining a label and input-text is possible via Cyberweb
|
3945
|
-
too. Examples:
|
3946
|
-
|
3947
|
-
label_and_input_text :foobar
|
3948
|
-
label_and_input_text id: :foobar
|
3949
|
-
label_and_input_text id: :foobar, :br
|
3950
|
-
label_and_input_text id: :foobar, :linebreak
|
3951
|
-
label_and_input_text id: :foobar, :middle_break
|
3952
|
-
label_and_input_text :fname, 'First name:'
|
3953
|
-
|
3954
|
-
The last variant is essentially the same as this in HTML:
|
3955
|
-
|
3956
|
-
<label for="fname">First name:</label><br>
|
3957
|
-
<input type="text" id="fname" name="fname"><br>
|
3958
|
-
|
3959
|
-
If you have a need or use case to use a checked checkbox
|
3960
|
-
then you can use a variant such as this:
|
3961
|
-
|
3962
|
-
checked_checkbox name: 'valid_ninja'
|
3963
|
-
|
3964
|
-
It may be important to specify the name parameter, as
|
3965
|
-
shown above; otherwise it can be omitted.
|
3966
|
-
|
3967
|
-
This checked checkbox looks about like this:
|
3968
|
-
|
3969
|
-
<img src="https://i.imgur.com/Fn0GasM.png" style="margin: 1em">
|
3970
|
-
|
3971
|
-
## Use image-checkbox (on and off)
|
3972
|
-
|
3973
|
-
Examples:
|
3974
|
-
|
3975
|
-
show_image_checkbox :on, 'posab','top:10em;right:18%'
|
3976
|
-
show_image_checkbox :off, 'posab','top:10em;right:18%'
|
3977
|
-
|
3978
3878
|
## The CSS class called select_everything
|
3979
3879
|
|
3980
3880
|
This document already mentioned how to use JavaScript to select
|
@@ -4441,10 +4341,11 @@ the border via border-color then this will default to <b>black</b>.
|
|
4441
4341
|
|
4442
4342
|
## Cyberweb::HtmlTemplate
|
4443
4343
|
|
4444
|
-
class **Cyberweb::HtmlTemplate** can be used to
|
4344
|
+
class **Cyberweb::HtmlTemplate** can be used to describe (and ultimately
|
4345
|
+
generate) a .html file - that is, to fill this class with HTML
|
4445
4346
|
specific content.
|
4446
4347
|
|
4447
|
-
Let's show a specific example how this may be used:
|
4348
|
+
Let's show a specific example how this may be used first:
|
4448
4349
|
|
4449
4350
|
require 'cyberweb/requires/require_the_html_template.rb' # This is the recommended way to require class HtmlTemplate.
|
4450
4351
|
|
@@ -4458,7 +4359,7 @@ Let's show a specific example how this may be used:
|
|
4458
4359
|
This would represent a "full" HTML page, as a String.
|
4459
4360
|
|
4460
4361
|
It is possible, since as of **18.06.2021**, to pass **CSS classes**
|
4461
|
-
into this, via
|
4362
|
+
into this class, via the entry called <b>css_classes</b>:
|
4462
4363
|
|
4463
4364
|
css_classes:
|
4464
4365
|
|
@@ -4466,19 +4367,19 @@ For example, passing 'darkblue' to that key means that the CSS
|
|
4466
4367
|
class 'darkblue' will be made available, which ultimately comes
|
4467
4368
|
down to <b>color: darkblue</b>.
|
4468
4369
|
|
4469
|
-
|
4470
|
-
that
|
4471
|
-
Cyberweb::HtmlTemplate
|
4370
|
+
This functionality was necessary in order to pull in only the CSS
|
4371
|
+
classes that are used on a particular web-page generated or
|
4372
|
+
represented by class <b>Cyberweb::HtmlTemplate</b>.
|
4472
4373
|
|
4473
|
-
Various additional entries are available. For example, if
|
4474
|
-
|
4475
|
-
|
4374
|
+
Various additional entries are available. For example, if you want
|
4375
|
+
to modify the css-style in use for the body tag then you can
|
4376
|
+
simply use the following variant:
|
4476
4377
|
|
4477
4378
|
body_css_style: 'background-color:#DFD1FF'
|
4478
4379
|
|
4479
|
-
In the long run the goal here is to extend class
|
4480
|
-
in such a way that all html-generation used
|
4481
|
-
Cyberweb project can be handled by it.
|
4380
|
+
In the long run the goal here is to <b>extend</b> class
|
4381
|
+
HtmlTemplate in such a way that all html-generation used
|
4382
|
+
within the Cyberweb project can be handled by it.
|
4482
4383
|
|
4483
4384
|
You can also pass ad-hoc CSS style into it. Example:
|
4484
4385
|
|
@@ -4681,6 +4582,29 @@ This would yield the following Array:
|
|
4681
4582
|
"https://www.projectaon.org/en/xhtml/lw/02fotw/right.png"
|
4682
4583
|
]
|
4683
4584
|
|
4585
|
+
## Examples distributed in the cyberweb project
|
4586
|
+
|
4587
|
+
This subsection has a few noteworthy points to make about
|
4588
|
+
examples distributed in the cyberweb project.
|
4589
|
+
|
4590
|
+
You can find these examples under the directory called
|
4591
|
+
<b>examples/</b> - easy to remember.
|
4592
|
+
|
4593
|
+
You can find plain HTML examples, and examples that
|
4594
|
+
use JavaScript and CSS. Additionally some examples
|
4595
|
+
stored as .cgi files are distributed as well, to
|
4596
|
+
demonstrate how the cyberweb project works. I recommend
|
4597
|
+
that you have a look at the simple examples first,
|
4598
|
+
without .cgi, unless you already know HTML/CSS/JavaScript,
|
4599
|
+
and then transition into the .cgi files. That should make
|
4600
|
+
it a bit easier to understand what is going on.
|
4601
|
+
|
4602
|
+
You may find that these examples sort of follow a specific
|
4603
|
+
style, more or less. For instance, I tend to name all
|
4604
|
+
animations with a trailing <b>_animation</b> tag. That
|
4605
|
+
helps me identify which animations exist more easily
|
4606
|
+
so.
|
4607
|
+
|
4684
4608
|
## JavaScript support in the cyberweb project
|
4685
4609
|
|
4686
4610
|
### JavaScript for-in and for-of loops:
|
@@ -4829,6 +4753,183 @@ Example:
|
|
4829
4753
|
|
4830
4754
|
<script src="path/foobar.js" async></script>
|
4831
4755
|
|
4756
|
+
### JavaScript variables
|
4757
|
+
|
4758
|
+
The variables in JavaScript are by default global. You can make
|
4759
|
+
them local if you attach the **var** keyword to them.
|
4760
|
+
|
4761
|
+
You can also define several variables in one go, via:
|
4762
|
+
|
4763
|
+
var message = "hi",
|
4764
|
+
found = false,
|
4765
|
+
age = 29;
|
4766
|
+
|
4767
|
+
The keyword **let** has the lowest scope, even less than when
|
4768
|
+
compared to **var**.
|
4769
|
+
|
4770
|
+
### Simple JavaScript Calculator
|
4771
|
+
|
4772
|
+
Use:
|
4773
|
+
|
4774
|
+
add_simple_javascript_calculator
|
4775
|
+
|
4776
|
+
You may need to style the input-tag a bit.
|
4777
|
+
|
4778
|
+
See the following file for a working example:
|
4779
|
+
|
4780
|
+
cyberweb/examples/advanced/simple_calculator.cgi
|
4781
|
+
|
4782
|
+
## Showing a fancy CSS keyboard
|
4783
|
+
|
4784
|
+
If you use Cyberweb::WebObject then a fancy CSS keyboard
|
4785
|
+
can be shown. The method to do this is called:
|
4786
|
+
|
4787
|
+
show_the_keyboard
|
4788
|
+
|
4789
|
+
Right now this is not too terribly useful, but I can imagine
|
4790
|
+
that this could serve as the basis to add an ad-hoc keyboard
|
4791
|
+
to a website, such as for smartphone users.
|
4792
|
+
|
4793
|
+
## The progress bar in HTML5
|
4794
|
+
|
4795
|
+
You can use a <b>progressbar</b> to indicate progress based on
|
4796
|
+
percentage values. This is described here in more detail:
|
4797
|
+
|
4798
|
+
https://css-tricks.com/html5-progress-element/
|
4799
|
+
|
4800
|
+
In cyberweb you can use the following API to indicate this:
|
4801
|
+
|
4802
|
+
progress
|
4803
|
+
progress('35 / 100') # this will display 35%
|
4804
|
+
|
4805
|
+
At a later time some javascript code may be added to indicate
|
4806
|
+
a counter-progress. Right now (as of <b>February 2022</b>)
|
4807
|
+
this is not possible though, so this part has to come at
|
4808
|
+
a later time.
|
4809
|
+
|
4810
|
+
The raw HTML code would look like this, for 35%:
|
4811
|
+
|
4812
|
+
<progress max="100" value="35"></progress>
|
4813
|
+
|
4814
|
+
If you want to style the progressbar then you have to use
|
4815
|
+
CSS. This can then be done via the <b>progress[value]</b>
|
4816
|
+
selector.
|
4817
|
+
|
4818
|
+
Example for this:
|
4819
|
+
|
4820
|
+
progress[value] {
|
4821
|
+
/* Reset the default appearance */
|
4822
|
+
-webkit-appearance: none;
|
4823
|
+
appearance: none;
|
4824
|
+
width: 250px;
|
4825
|
+
height: 20px;
|
4826
|
+
}
|
4827
|
+
|
4828
|
+
## Working with HTML forms, including creating input-buttons in such a form field
|
4829
|
+
|
4830
|
+
<form>
|
4831
|
+
<input type="button" class="BG_GRAYSTD bblack1" value="Default" name="foo" onClick="test1(this.form)">
|
4832
|
+
</form>
|
4833
|
+
|
4834
|
+
<form>
|
4835
|
+
<input class="BG_GRAYSTD bblack1" type="button" value="Default" name="foo" onClick="test1(this.form)">
|
4836
|
+
</form>
|
4837
|
+
|
4838
|
+
You can style ‹input> fields with a different background colour
|
4839
|
+
upon a mouse-focus event.
|
4840
|
+
|
4841
|
+
Examples for this would be:
|
4842
|
+
|
4843
|
+
input :text, 'Hello world!', :focus_with_salmon_background
|
4844
|
+
input :text, 'Hello World!', :focus_with_salmon_background, :select_on_click
|
4845
|
+
|
4846
|
+
View the file at **cyberweb/examples/simple/input_example_with_coloured_focus.cgi**
|
4847
|
+
to see this work in action.
|
4848
|
+
|
4849
|
+
You can modify the ‹input> tag within that via css by using:
|
4850
|
+
|
4851
|
+
input.view_css {}
|
4852
|
+
|
4853
|
+
Note that ‹input type="text"> only works for a single line of
|
4854
|
+
user input. If you would like to have the user work via multiple
|
4855
|
+
lines then you have to use the ‹textarea> tag instead.
|
4856
|
+
There may be work-arounds, such as giving the text-input the
|
4857
|
+
<b>word-break: break-word;</b> attribute, but this may not work
|
4858
|
+
on every browser.
|
4859
|
+
|
4860
|
+
Some shortcuts exist within the Cyberweb project. For instance,
|
4861
|
+
rather than do:
|
4862
|
+
|
4863
|
+
input :checkbox
|
4864
|
+
|
4865
|
+
You can do:
|
4866
|
+
|
4867
|
+
input_checkbox
|
4868
|
+
|
4869
|
+
Same with submit and other variants:
|
4870
|
+
|
4871
|
+
input_submit
|
4872
|
+
input_radio
|
4873
|
+
|
4874
|
+
This may not be a huge improvement, but I wanted to offer it in
|
4875
|
+
the event that some users like to avoid using the <b>:</b> for
|
4876
|
+
the symbol.
|
4877
|
+
|
4878
|
+
Combining a label and input-text is possible via Cyberweb
|
4879
|
+
too. Examples:
|
4880
|
+
|
4881
|
+
label_and_input_text :foobar
|
4882
|
+
label_and_input_text id: :foobar
|
4883
|
+
label_and_input_text id: :foobar, :br
|
4884
|
+
label_and_input_text id: :foobar, :linebreak
|
4885
|
+
label_and_input_text id: :foobar, :middle_break
|
4886
|
+
label_and_input_text :fname, 'First name:'
|
4887
|
+
|
4888
|
+
The last variant is essentially the same as this in HTML:
|
4889
|
+
|
4890
|
+
<label for="fname">First name:</label><br>
|
4891
|
+
<input type="text" id="fname" name="fname"><br>
|
4892
|
+
|
4893
|
+
If you have a need or use case to use a checked checkbox
|
4894
|
+
then you can use a variant such as this:
|
4895
|
+
|
4896
|
+
checked_checkbox name: 'valid_ninja'
|
4897
|
+
|
4898
|
+
It may be important to specify the name parameter, as
|
4899
|
+
shown above; otherwise it can be omitted.
|
4900
|
+
|
4901
|
+
This <b>checked checkbox</b> looks about like this:
|
4902
|
+
|
4903
|
+
<img src="https://i.imgur.com/Fn0GasM.png" style="margin: 1em">
|
4904
|
+
|
4905
|
+
## Use image-checkbox (on and off)
|
4906
|
+
|
4907
|
+
Examples:
|
4908
|
+
|
4909
|
+
show_image_checkbox :on, 'posab','top:10em;right:18%'
|
4910
|
+
show_image_checkbox :off, 'posab','top:10em;right:18%'
|
4911
|
+
|
4912
|
+
## Science links
|
4913
|
+
|
4914
|
+
This is only useful for me and my home system. I have
|
4915
|
+
a few different science-specific subpages.
|
4916
|
+
|
4917
|
+
I can then link to these via:
|
4918
|
+
|
4919
|
+
science_links
|
4920
|
+
|
4921
|
+
This is quite plain, though, so I tend to add small
|
4922
|
+
images via:
|
4923
|
+
|
4924
|
+
science_links {{ use_this_image: dot109? }}
|
4925
|
+
|
4926
|
+
Other images could be supplied as well.
|
4927
|
+
|
4928
|
+
(Note that while this paragraph is for my own home system,
|
4929
|
+
the above could eventually be repurposed for other
|
4930
|
+
users too, if they have a bunch of external links
|
4931
|
+
they want to display on their homepage as well.
|
4932
|
+
I'll think about this for a while.)
|
4832
4933
|
## Useful quotes when designing websites and web-apps
|
4833
4934
|
|
4834
4935
|
The following subsection collects a few <b>interesting statements</b> -
|
data/cyberweb.gemspec
CHANGED
@@ -13,12 +13,12 @@ Cyberweb is a tool-set project for the www.
|
|
13
13
|
|
14
14
|
The project attempts to explore different ideas, including use
|
15
15
|
cases as an (incomplete) web "framework". Thus, the project is
|
16
|
-
of a somewhat
|
16
|
+
of a somewhat large size as-is these days.
|
17
17
|
|
18
18
|
As a project, cyberweb is quite far away from being feature-complete
|
19
19
|
or reasonably finished - consider the project to be more a
|
20
|
-
proof-of-concept
|
21
|
-
production.
|
20
|
+
proof-of-concept work at this point in time, rather than something
|
21
|
+
that should be used in production.
|
22
22
|
|
23
23
|
The cyberweb project in its present state is not fully documented,
|
24
24
|
which is unfortunate - the documentation will be subsequently
|
@@ -30,9 +30,9 @@ works fairly well. Since as of May 2021, sinatra is another
|
|
30
30
|
option in this regard, so the cyberweb project tries to adjust
|
31
31
|
to different use cases when necessary.
|
32
32
|
|
33
|
-
.cgi scripts are not that
|
34
|
-
2015. Nonetheless I still consider .cgi scripts to be
|
35
|
-
SIMPLE to use.
|
33
|
+
.cgi scripts are not that commonly seen in use past the year
|
34
|
+
2015. Nonetheless I still consider .cgi scripts to be
|
35
|
+
extremely SIMPLE to use.
|
36
36
|
|
37
37
|
If you need a framework that is more sophisticated then it is
|
38
38
|
recommended to look at sinatra and padrino instead.
|