From cb75a24e92f4d7c9bb80cc8accf610f127052a08 Mon Sep 17 00:00:00 2001 From: Julian Prieber <60265788+JulianPrieber@users.noreply.github.com> Date: Wed, 4 May 2022 10:12:01 +0200 Subject: [PATCH] Update button editor Added functionality for custom website button. Made button editor optional to use. --- .env | 16 +++++++----- .../views/studio/button-editor.blade.php | 26 +++++++++++++------ resources/views/studio/links.blade.php | 4 ++- storage/backups/default_settings | 6 ++++- studio/button-editor/css/style.css | 26 ++++++++++++++++++- 5 files changed, 61 insertions(+), 17 deletions(-) diff --git a/.env b/.env index 89b0d7a..9c362ee 100644 --- a/.env +++ b/.env @@ -2,7 +2,7 @@ #=REGISTER_AUTH either auth or verified. If auth is selected, no verification is required. Default is verified. REGISTER_AUTH=verified -#Internal notifications=Changes if certain messages should be displayed or not +#Internal notifications=Changes if certain messages should be displayed or not. #=NOTIFY_EVENTS notifies admins if an important event is happening, such as polls about the future of this project or security vulnerabilities. NOTIFY_EVENTS=true #=NOTIFY_UPDATES either all, major or false. All notifies about all updates, major only notifies about major or important updates, false does not notify about any updates. @@ -10,7 +10,7 @@ NOTIFY_UPDATES=major DISPLAY_FOOTER=true DISPLAY_CREDIT=true -#Home URL=Changes if a user profile should be displayed as the homepage +#Home URL=Changes if a user profile should be displayed as the homepage. #=Leave empty to use the default homepage. To set your profile as the homepage, enter a LittleLink name. You can find this on the user panel under the page setting, the name is what comes after the '@'. #=(e.g. 'admin' without the '@') HOME_URL= @@ -22,10 +22,14 @@ APP_KEY= #=The APP_URL should be left empty under most circumstances. This setting is not required for LittleLink Custom, and you should only change this if required for your setup. APP_URL= -#Debug Settings=Changes if your page should display a full error description instead of a generic error 500 +#ENABLE_BUTTON_EDITOR=Determines if the custom button editor should be enabled or not, default is true. +#=ENABLE_BUTTON_EDITOR either true or false. +ENABLE_BUTTON_EDITOR=true + +#Debug Settings=Changes if your page should display a full error description instead of a generic error 500. #=App_debug either true or false. You might want to change this to false after you're done installing, but it's very useful for troubleshooting. APP_DEBUG=true -#=App_env either local or production. Change this to production if you set the value above to false +#=App_env either local or production. Change this to production if you set the value above to false. APP_ENV=local LOG_CHANNEL=stack LOG_LEVEL=debug @@ -33,7 +37,7 @@ LOG_LEVEL=debug #Database Settings=Should be left alone. If you wish to use mysql you'd have to seed the database again. DB_CONNECTION=sqlite -#Mail Settings=LittleLink Custom comes with a free to use built-in SMTP server for sending mail. You can leave this setting as is, if you wish to use this service please read our terms and conditions at llc-mail.tru.io. If you do not wish to use the built-in SMTP server, change the setting below +#Mail Settings=LittleLink Custom comes with a free to use built-in SMTP server for sending mail. You can leave this setting as is, if you wish to use this service please read our terms and conditions at llc-mail.tru.io. If you do not wish to use the built-in SMTP server, change the setting below. #=MAIL_MAILER either smtp or built-in. Make sure to change this setting if you want to add a custom SMTP server. MAIL_MAILER=built-in MAIL_HOST= @@ -44,7 +48,7 @@ MAIL_ENCRYPTION= MAIL_FROM_ADDRESS= MAIL_FROM_NAME="${APP_NAME}" -#Cache Settings=Completely optional +#Cache Settings=Completely optional. MEMCACHED_HOST=127.0.0.1 REDIS_HOST=127.0.0.1 REDIS_PASSWORD=null diff --git a/resources/views/studio/button-editor.blade.php b/resources/views/studio/button-editor.blade.php index e61108e..30a3cc6 100644 --- a/resources/views/studio/button-editor.blade.php +++ b/resources/views/studio/button-editor.blade.php @@ -1,3 +1,4 @@ +@if(env('ENABLE_BUTTON_EDITOR') === true) @extends('layouts.sidebar') @section('content') @@ -208,7 +209,11 @@ var button_css = {
-
Example
+@if($buttonId == 1) +
{{ $title }}
+@else +
{{ $title }}
+@endif
@@ -245,14 +250,19 @@ background-image: linear-gradient(-135deg,#0f0c29,#302b63,#24243e)

Result:

- @if($custom_css === "") -
Example
- @elseif($custom_css != "") -
Example
+ @if($custom_css === "" and $buttonId == 1) +
{{ $title }}
+ @elseif($custom_css === "" and $buttonId == 2) +
{{ $title }}
+ @elseif($custom_css != "" and $buttonId == 2) +
{{ $title }}
+ @else +
{{ $title }}
@endif


+ @if($buttonId == 1)
@csrf
@@ -315,14 +325,14 @@ background-image: linear-gradient(-135deg,#0f0c29,#302b63,#24243e)
- +




+ @endif
@endsection - - +@endif \ No newline at end of file diff --git a/resources/views/studio/links.blade.php b/resources/views/studio/links.blade.php index ca6ecd5..3bff627 100755 --- a/resources/views/studio/links.blade.php +++ b/resources/views/studio/links.blade.php @@ -13,7 +13,7 @@ Order ⏶ Pin Link ⏶ Edit - Button Editor  beta + @if(env('ENABLE_BUTTON_EDITOR') === true)Button Editor  beta@endif Delete @@ -26,11 +26,13 @@ {{ $link->order }} {{ $link->up_link }} Edit + @if(env('ENABLE_BUTTON_EDITOR') === true) @if($link->button_id == 1 or $link->button_id == 2) Customize Button @else - @endif + @endif Delete @endforeach diff --git a/storage/backups/default_settings b/storage/backups/default_settings index 4897d9f..3f290b8 100644 --- a/storage/backups/default_settings +++ b/storage/backups/default_settings @@ -10,7 +10,7 @@ NOTIFY_UPDATES=major DISPLAY_FOOTER=true DISPLAY_CREDIT=true -#Home URL=Changes if a user profile should be displayed as the homepage +#Home URL=Changes if a user profile should be displayed as the homepage. #=Leave empty to use the default homepage. To set your profile as the homepage, enter a LittleLink name. You can find this on the user panel under the page setting, the name is what comes after the '@'. #=(e.g. 'admin' without the '@') HOME_URL= @@ -22,6 +22,10 @@ APP_KEY=base64:YOU+MUST+CHANGE+THIS+YUFukELiN6Bk9gQ19+9zwk= #=The APP_URL should be left empty under most circumstances. This setting is not required for LittleLink Custom, and you should only change this if required for your setup. APP_URL= +#ENABLE_BUTTON-EDITOR=Determines if the custom button editor should be enabled or not, default is true. +#=ENABLE_BUTTON-EDITOR either true or false. +ENABLE_BUTTON-EDITOR=true + #Debug Settings=Changes if your page should display a full error description instead of a generic error 500 #=App_debug either true or false. You might want to change this to false after you're done installing, but it's very useful for troubleshooting. APP_DEBUG=true diff --git a/studio/button-editor/css/style.css b/studio/button-editor/css/style.css index 9652f74..8388c0c 100644 --- a/studio/button-editor/css/style.css +++ b/studio/button-editor/css/style.css @@ -516,6 +516,12 @@ button-demo { width: 20px; height: 20px; } +.wicon { + padding: 0px 6px 0px 0px; + vertical-align: middle; + width: 26px; + height: 20px; + } .button.button-custom { color: #FFFFFF; background-color: #FFFFFF; @@ -524,6 +530,24 @@ button-demo { .button.button-custom:focus { filter: brightness(90%) } + .button.button-custom_website { + color: #ffffff; + background-color: #000000; + display: inline-block; + text-decoration: none; + height: 48px; + text-align: center; + vertical-align: middle; + font-size: 18px; + width: 300px; + font-weight: 700; + line-height: 48px; + letter-spacing: 0.1px; + white-space: wrap; + border-radius: 8px; + cursor: pointer; + } + details { width: 64.7%; background: #282828; @@ -579,4 +603,4 @@ details > ul { width: 80%; top: 10%; left: 10%; -} \ No newline at end of file +}