From 88b1df1906ee5e86d26bc91c1ca20545b54ac3b1 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Tue, 19 Jan 2021 21:36:47 +0100 Subject: [PATCH] Display setup info in popup --- .../Resources/Templates/Page/index.html | 17 ++---------- .../Controller/User/AddressBooks.php | 2 +- .../BaikalAdmin/Controller/User/Calendars.php | 2 +- .../BaikalAdmin/Controller/Users.php | 1 + .../Resources/Templates/Page/index.html | 17 ++---------- .../Resources/Templates/Page/style.css | 17 ++++++++++++ .../Templates/User/AddressBooks.html | 4 +-- .../Resources/Templates/User/Calendars.html | 4 +-- .../Resources/Templates/Users.html | 3 ++- Core/Frameworks/BaikalAdmin/Resources/main.js | 27 +++++++++++++++++++ .../js/jquery.color-2.2.0.min.js | 3 +++ 11 files changed, 60 insertions(+), 37 deletions(-) create mode 100644 Core/Frameworks/BaikalAdmin/Resources/main.js create mode 100644 Core/Frameworks/TwitterBootstrap/js/jquery.color-2.2.0.min.js diff --git a/Core/Frameworks/Baikal/Resources/Templates/Page/index.html b/Core/Frameworks/Baikal/Resources/Templates/Page/index.html index c85f01c..1434ca3 100644 --- a/Core/Frameworks/Baikal/Resources/Templates/Page/index.html +++ b/Core/Frameworks/Baikal/Resources/Templates/Page/index.html @@ -31,22 +31,9 @@ ================================================== --> + - + {{ javascript }} diff --git a/Core/Frameworks/BaikalAdmin/Controller/User/AddressBooks.php b/Core/Frameworks/BaikalAdmin/Controller/User/AddressBooks.php index 85d7ac4..5f12008 100644 --- a/Core/Frameworks/BaikalAdmin/Controller/User/AddressBooks.php +++ b/Core/Frameworks/BaikalAdmin/Controller/User/AddressBooks.php @@ -275,6 +275,6 @@ class AddressBooks extends \Flake\Core\Controller { * @return string AddressBook DAV URI */ protected function getDavUri(\Baikal\Model\AddressBook $addressbook) { - return PROJECT_BASEURI . 'dav.php/addressbooks/' . $this->oUser->get('username') . '/' . $addressbook->get('uri') . '/'; + return PROJECT_URI . 'dav.php/addressbooks/' . $this->oUser->get('username') . '/' . $addressbook->get('uri') . '/'; } } diff --git a/Core/Frameworks/BaikalAdmin/Controller/User/Calendars.php b/Core/Frameworks/BaikalAdmin/Controller/User/Calendars.php index 3a62128..42aca38 100644 --- a/Core/Frameworks/BaikalAdmin/Controller/User/Calendars.php +++ b/Core/Frameworks/BaikalAdmin/Controller/User/Calendars.php @@ -279,6 +279,6 @@ class Calendars extends \Flake\Core\Controller { * @return string Calender DAV URI */ protected function getDavUri(\Baikal\Model\Calendar $calendar) { - return PROJECT_BASEURI . 'dav.php/calendars/' . $this->oUser->get('username') . '/' . $calendar->get('uri') . '/'; + return PROJECT_URI . 'dav.php/calendars/' . $this->oUser->get('username') . '/' . $calendar->get('uri') . '/'; } } diff --git a/Core/Frameworks/BaikalAdmin/Controller/Users.php b/Core/Frameworks/BaikalAdmin/Controller/Users.php index 9c6f2cc..3bab7fb 100644 --- a/Core/Frameworks/BaikalAdmin/Controller/Users.php +++ b/Core/Frameworks/BaikalAdmin/Controller/Users.php @@ -78,6 +78,7 @@ class Users extends \Flake\Core\Controller { $oView->setData("users", $aUsers); $oView->setData("calendaricon", \Baikal\Model\Calendar::icon()); $oView->setData("usericon", \Baikal\Model\User::icon()); + $oView->setData("davUri", PROJECT_URI . 'dav.php'); # Messages $sMessages = implode("\n", $this->aMessages); diff --git a/Core/Frameworks/BaikalAdmin/Resources/Templates/Page/index.html b/Core/Frameworks/BaikalAdmin/Resources/Templates/Page/index.html index c85f01c..1434ca3 100644 --- a/Core/Frameworks/BaikalAdmin/Resources/Templates/Page/index.html +++ b/Core/Frameworks/BaikalAdmin/Resources/Templates/Page/index.html @@ -31,22 +31,9 @@ ================================================== --> + - + {{ javascript }} diff --git a/Core/Frameworks/BaikalAdmin/Resources/Templates/Page/style.css b/Core/Frameworks/BaikalAdmin/Resources/Templates/Page/style.css index 2f3c2ed..2de8bb4 100644 --- a/Core/Frameworks/BaikalAdmin/Resources/Templates/Page/style.css +++ b/Core/Frameworks/BaikalAdmin/Resources/Templates/Page/style.css @@ -107,3 +107,20 @@ table.users .col-username { width: 45%;} transform: rotate(360deg); } } + +.popover { + max-width: 100%; +} + +.copy-to-clipboard { + cursor: pointer; +} + +.copy-to-clipboard i { + margin-left: 5px; + opacity: 1; +} + +.copy-to-clipboard:hover i { + opacity: 0.5; +} diff --git a/Core/Frameworks/BaikalAdmin/Resources/Templates/User/AddressBooks.html b/Core/Frameworks/BaikalAdmin/Resources/Templates/User/AddressBooks.html index 7ea4b48..729c97a 100644 --- a/Core/Frameworks/BaikalAdmin/Resources/Templates/User/AddressBooks.html +++ b/Core/Frameworks/BaikalAdmin/Resources/Templates/User/AddressBooks.html @@ -18,14 +18,14 @@ {% for addressbook in addressbooks %} - {{ addressbook.label|escape }} + {{ addressbook.label|escape }} {{ addressbook.contacts|escape }} {{ addressbook.description|escape }}

+ Edit Delete - AddressBook URI

diff --git a/Core/Frameworks/BaikalAdmin/Resources/Templates/User/Calendars.html b/Core/Frameworks/BaikalAdmin/Resources/Templates/User/Calendars.html index ffd52b6..97c9a2f 100644 --- a/Core/Frameworks/BaikalAdmin/Resources/Templates/User/Calendars.html +++ b/Core/Frameworks/BaikalAdmin/Resources/Templates/User/Calendars.html @@ -18,14 +18,14 @@ {% for calendar in calendars %} - {{ calendar.label|escape }}{%if calendar.instanced%} Has instances{% endif %} + {{ calendar.label|escape }}{%if calendar.instanced%} Has instances{% endif %} {{ calendar.events|escape }} {{ calendar.description|escape }}

+ Edit Delete - Calendar URI

diff --git a/Core/Frameworks/BaikalAdmin/Resources/Templates/Users.html b/Core/Frameworks/BaikalAdmin/Resources/Templates/Users.html index 465f8da..0422347 100644 --- a/Core/Frameworks/BaikalAdmin/Resources/Templates/Users.html +++ b/Core/Frameworks/BaikalAdmin/Resources/Templates/Users.html @@ -14,6 +14,7 @@

+ Calendars Address Books Edit @@ -27,4 +28,4 @@ {{ messages }} {{ form }} -{% endautoescape %} \ No newline at end of file +{% endautoescape %} diff --git a/Core/Frameworks/BaikalAdmin/Resources/main.js b/Core/Frameworks/BaikalAdmin/Resources/main.js new file mode 100644 index 0000000..0414853 --- /dev/null +++ b/Core/Frameworks/BaikalAdmin/Resources/main.js @@ -0,0 +1,27 @@ +$(document).ready(function() { + $("[rel=tooltip]").tooltip(); + $(".popover-hover").popover(); + $(".popover-focus").popover({ + trigger: 'focus' + }); + $(".popover-focus-top").popover({ + trigger: 'focus', + placement: 'top' + }); + $(".popover-focus-bottom").popover({ + trigger: 'focus', + placement: 'bottom' + }); +}); + +function copyToClipboard(el) { + var range = document.createRange(); + range.selectNodeContents(el); + var sel = window.getSelection(); + sel.removeAllRanges(); + sel.addRange(range); + document.execCommand("copy"); + sel.removeAllRanges(); + $(el).css({backgroundColor:"#75c753"}); + $(el).animate({backgroundColor:"transparent"}, 1500); +} diff --git a/Core/Frameworks/TwitterBootstrap/js/jquery.color-2.2.0.min.js b/Core/Frameworks/TwitterBootstrap/js/jquery.color-2.2.0.min.js new file mode 100644 index 0000000..d5daa4d --- /dev/null +++ b/Core/Frameworks/TwitterBootstrap/js/jquery.color-2.2.0.min.js @@ -0,0 +1,3 @@ +/*! jQuery Color v2.2.0 http://github.com/jquery/jquery-color | jquery.org/license */ + +!function(r,n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof exports?module.exports=n(require("jquery")):n(r.jQuery)}(this,function(l,f){var c,t={},n=t.toString,p=/^([\-+])=\s*(\d+\.?\d*)/,r=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(r){return[r[1],r[2],r[3],r[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(r){return[2.55*r[1],2.55*r[2],2.55*r[3],r[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})?/,parse:function(r){return[parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16),r[4]?(parseInt(r[4],16)/255).toFixed(2):1]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])?/,parse:function(r){return[parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16),parseInt(r[3]+r[3],16),r[4]?(parseInt(r[4]+r[4],16)/255).toFixed(2):1]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(r){return[r[1],r[2]/100,r[3]/100,r[4]]}}],d=l.Color=function(r,n,t,e){return new l.Color.fn.parse(r,n,t,e)},h={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},b={byte:{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},i=d.support={},e=l("

")[0],g=l.each;function x(r){return null==r?r+"":"object"==typeof r?t[n.call(r)]||"object":typeof r}function y(r,n,t){var e=b[n.type]||{};return null==r?t||!n.def?null:n.def:(r=e.floor?~~r:parseFloat(r),isNaN(r)?n.def:e.mod?(r+e.mod)%e.mod:Math.min(e.max,Math.max(0,r)))}function s(i){var s=d(),u=s._rgba=[];return i=i.toLowerCase(),g(r,function(r,n){var t,e=n.re.exec(i),o=e&&n.parse(e),a=n.space||"rgba";if(o)return t=s[a](o),s[h[a].cache]=t[h[a].cache],u=s._rgba=t._rgba,!1}),u.length?("0,0,0,0"===u.join()&&l.extend(u,c.transparent),s):c[i]}function u(r,n,t){return 6*(t=(t+1)%1)<1?r+(n-r)*t*6:2*t<1?n:3*t<2?r+(n-r)*(2/3-t)*6:r}e.style.cssText="background-color:rgba(1,1,1,.5)",i.rgba=-1