Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
S
sidekick
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Privat - Marco Schmiedel
sidekick
Commits
c2926260
Commit
c2926260
authored
Jun 27, 2022
by
Kevin Yumang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SERV-2286 - added random select (randomizer) element
parent
b759a483
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
79 additions
and
0 deletions
+79
-0
Config.php
src/Views/Limitless/Element/Config.php
+13
-0
Index.blade.php
...itless/Element/RandomSelect/Documentation/Index.blade.php
+61
-0
RandomSelect.blade.php
...ews/Limitless/Element/RandomSelect/RandomSelect.blade.php
+1
-0
Config.php
src/Views/Limitless/Help/Config.php
+3
-0
Master.blade.php
src/Views/Limitless/Help/Layout/Master.blade.php
+1
-0
No files found.
src/Views/Limitless/Element/Config.php
View file @
c2926260
...
...
@@ -40,6 +40,7 @@
'Limitless::ElementCardStart'
=>
'cardStart'
,
'Limitless::ElementCardStop'
=>
'cardStop'
,
'Limitless::LoremIpsum'
=>
'loremIpsum'
,
'Limitless::RandomSelect'
=>
'randomSelect'
,
'Limitless::Divider'
=>
'divider'
,
'Limitless::Example'
=>
'example'
,
];
...
...
@@ -105,6 +106,18 @@
}
/*
|--------------------------------------------------------------------------------------------
| Method "randomSelect"
|--------------------------------------------------------------------------------------------
*/
public
function
randomSelect
(
$items
)
{
return
View
(
'Limitless::Element.RandomSelect.RandomSelect'
)
->
withItems
(
$items
);
}
/*
|--------------------------------------------------------------------------------------------
...
...
src/Views/Limitless/Element/RandomSelect/Documentation/Index.blade.php
0 → 100644
View file @
c2926260
{{
--
Layout
Reference
--
}}
@
extends
(
'Limitless::Help.Layout.Master'
)
@
section
(
'Limitless::Content'
)
{{
--
Description
--
}}
@
Limitless
::
ElementCardStart
([
'title'
=>
"RandomSelect"
,
'icon'
=>
'icon-shuffle'
])
<
p
>
Selects
one
random
item
from
a
<
i
>
one
(
1
)
</
i
>
level
array
.</
p
>
@
Limitless
::
ElementCardStop
{{
--
Elements
--
}}
@
Limitless
::
ElementCardStart
([
'title'
=>
"Fragments"
,
'icon'
=>
'icon-grid5'
])
<
div
class
="
bg
-
dark
rounded
py
-
2
px
-
3
mb
-
3
">
<h6 class="
mb
-
0
font
-
weight
-
semibold
">RandomSelect</h6>
<p class="
mb
-
3
text
-
muted
">Selects one random item from a <i>one (1)</i> level array.</p>
<p class="
font
-
italic
font
-
size
-
lg
">Parameters</p>
<div class="
row
mt
-
2
">
@Limitless::TableStart([ 'extra' => ['class' => 'table table-xs table-striped'] ])
@Limitless::TableAutofillHeader([
['name' => 'Key'],
['name' => 'Type'],
['name' => 'Description']
])
@Limitless::TableAutofillBody([
[
['value' => 'items'],
['value' => '<i>Array</i> [Default = <code>[]</code>]', 'secure' => false],
['value' => 'The array of items.']
]
])
@Limitless::TableStop
</div>
</div>
@Limitless::ElementCardStop
{{-- Sample Output --}}
@Limitless::ElementCardStart(['title' => "
Sample
Output
", 'icon' => 'icon-display4' ] )
@php
$items
= ['Item1', 'Item2', 'Item3', 'Item4', 'Item5'];
@endphp
<div> @Limitless::RandomSelect(
$items
) </div>
<div> @Limitless::RandomSelect(
$items
) </div>
<div> @Limitless::RandomSelect(
$items
) </div>
<div> @Limitless::RandomSelect(
$items
) </div>
<div> @Limitless::RandomSelect(
$items
) </div>
@Limitless::ElementCardStop
@php
$example
= base64_decode("
QHBocAoJJGl0ZW1zID0gWydJdGVtMScsICdJdGVtMicsICdJdGVtMycsICdJdGVtNCcsICdJdGVtNSddOwpAZW5kcGhwCjxkaXY
+
IEBMaW1pdGxlc3M6OlJhbmRvbVNlbGVjdCgkaXRlbXMpIDwvZGl2Pgo8ZGl2PiBATGltaXRsZXNzOjpSYW5kb21TZWxlY3QoJGl0ZW1zKSA8L2Rpdj4KPGRpdj4gQExpbWl0bGVzczo6UmFuZG9tU2VsZWN0KCRpdGVtcykgPC9kaXY
+
CjxkaXY
+
IEBMaW1pdGxlc3M6OlJhbmRvbVNlbGVjdCgkaXRlbXMpIDwvZGl2Pgo8ZGl2PiBATGltaXRsZXNzOjpSYW5kb21TZWxlY3QoJGl0ZW1zKSA8L2Rpdj4
=
");
@endphp
{{-- Sample Code --}}
@Limitless::ElementCardStart(['title' => "
Sample
Code
", 'icon' => 'icon-circle-code' ] )
@Limitless::Codemirror([ 'language' => 'javascript', 'theme' => 'zenburn', 'value' =>
$example
])
@Limitless::ElementCardStop
@stop
src/Views/Limitless/Element/RandomSelect/RandomSelect.blade.php
0 → 100644
View file @
c2926260
{{
$items
[
array_rand
(
$items
)]
}}
\ No newline at end of file
src/Views/Limitless/Help/Config.php
View file @
c2926260
...
...
@@ -66,6 +66,9 @@
case
"navigation"
:
$path
=
'Limitless::Navigation.Documentation.Index'
;
break
;
case
"randomselect"
:
$path
=
'Limitless::Element.RandomSelect.Documentation.Index'
;
break
;
case
"table"
:
$path
=
'Limitless::Table.Documentation.Index'
;
break
;
...
...
src/Views/Limitless/Help/Layout/Master.blade.php
View file @
c2926260
...
...
@@ -32,6 +32,7 @@
@
Limitless
::
NavigationMenuItem
([
'url'
=>
'?page=divider'
,
'target'
=>
'_self'
,
'icon'
=>
'icon-minus2'
,
'title'
=>
'Divider'
])
@
Limitless
::
NavigationMenuItem
([
'url'
=>
'?page=loremipsum'
,
'target'
=>
'_self'
,
'icon'
=>
'icon-bubble-lines3'
,
'title'
=>
'Lorem Ipsum'
])
@
Limitless
::
NavigationMenuItem
([
'url'
=>
'?page=navigation'
,
'target'
=>
'_self'
,
'icon'
=>
'icon-menu8'
,
'title'
=>
'Navigation'
])
@
Limitless
::
NavigationMenuItem
([
'url'
=>
'?page=randomselect'
,
'target'
=>
'_self'
,
'icon'
=>
'icon-shuffle'
,
'title'
=>
'Random Select'
])
@
Limitless
::
NavigationMenuItem
([
'url'
=>
'?page=table'
,
'target'
=>
'_self'
,
'icon'
=>
'icon-table2'
,
'title'
=>
'Table'
])
@
Limitless
::
NavigationStop
@
stop
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment