Skip to content

Commit

Permalink
Worldicon
Browse files Browse the repository at this point in the history
  • Loading branch information
KoljaL committed Feb 11, 2021
1 parent ab9eff6 commit 53494a5
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 52 deletions.
49 changes: 10 additions & 39 deletions assets/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ document.getElementById('color_select').onchange = function () {
var strAtt = e.options[e.selectedIndex].getAttribute('id'); // will return the value
var strVal = e.options[e.selectedIndex].value; // will return the value
var strText = e.options[e.selectedIndex].text; // will return the text
console.log(strAtt);
console.log(strVal);
console.log(strText);
// console.log(strAtt);
// console.log(strVal);
// console.log(strText);
var list = document.getElementsByClassName("change_color");
document.getElementById("hr").style.background = strAtt;
for (var i = 0; i < list.length; i++) {
Expand All @@ -24,7 +24,7 @@ document.getElementById("container_select").onchange = function () {
var select_value = document.getElementById("container_select").value;
// set input value with pulldown value
document.getElementById("container_input").value = select_value;
console.log("container_select " + select_value);
// console.log("container_select " + select_value);
}
// DROPDOWN CONTAINERNAME TO INPUT TEXT

Expand Down Expand Up @@ -270,10 +270,7 @@ if (('ontouchstart' in window) == true){


(function() {

"use strict";
// H E L P E R F U N C T I O N S

/**
* Function to check if we clicked inside an element with a particular class
* name.
Expand Down Expand Up @@ -307,17 +304,14 @@ if (('ontouchstart' in window) == true){
function getPosition(e) {
var posx = 0;
var posy = 0;

if (!e) var e = window.event;

if (e.pageX || e.pageY) {
posx = e.pageX;
posy = e.pageY;
} else if (e.clientX || e.clientY) {
posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
}

return {
x: posx,
y: posy
Expand All @@ -331,15 +325,12 @@ if (('ontouchstart' in window) == true){
var contextMenuItemClassName = "context-menu__item";
var contextMenuLinkClassName = "context-menu__link";
var contextMenuActive = "context-menu--active";

var taskItemClassName = "task";
var taskItemInContext;
var item_ID;

var clickCoords;
var clickCoordsX;
var clickCoordsY;

var menu = document.querySelector("#context-menu");
var menuItems = menu.querySelectorAll(".context-menu__item");
var menuState = 0;
Expand All @@ -348,7 +339,6 @@ if (('ontouchstart' in window) == true){
var menuPosition;
var menuPositionX;
var menuPositionY;

var windowWidth;
var windowHeight;

Expand All @@ -368,32 +358,17 @@ if (('ontouchstart' in window) == true){
function contextListener() {
document.addEventListener( "contextmenu", function(e) {
taskItemInContext = clickInsideElement( e, taskItemClassName );

if (taskItemInContext){
item_ID = taskItemInContext.getAttribute("data-id");
}


console.table(item_ID);



if (taskItemInContext) {
item_ID = taskItemInContext.getAttribute("data-id");
}

// console.table(item_ID);
// if (taskItemInContext) {
// item_ID = taskItemInContext.getAttribute("data-id");
// }
var logger = document.getElementById('context-menu');
logger.innerHTML = '<label class="tooltip icon" onmousedown="show_tooltip(\'' + item_ID +'\');">&nbsp; &#128462;</label>&nbsp;';
logger.innerHTML += '<form action="" method="post"><button type="submit" name="edit" value="' + item_ID + '" class="icon">✎</button></form>';
console.table(item_ID);








// console.table(item_ID);
if ( taskItemInContext ) {
e.preventDefault();
toggleMenuOn();
Expand All @@ -411,7 +386,6 @@ if (('ontouchstart' in window) == true){
function clickListener() {
document.addEventListener( "click", function(e) {
var clickeElIsLink = clickInsideElement( e, contextMenuLinkClassName );

if ( clickeElIsLink ) {
e.preventDefault();
menuItemListener( clickeElIsLink );
Expand Down Expand Up @@ -473,19 +447,16 @@ if (('ontouchstart' in window) == true){
clickCoords = getPosition(e);
clickCoordsX = clickCoords.x+10;
clickCoordsY = clickCoords.y-13;
console.table(clickCoords);
// console.table(clickCoords);
menuWidth = menu.offsetWidth + 4;
menuHeight = menu.offsetHeight + 4;

windowWidth = window.innerWidth;
windowHeight = window.innerHeight;

if ( (windowWidth - clickCoordsX) < menuWidth ) {
menu.style.left = windowWidth - menuWidth + "px";
} else {
menu.style.left = clickCoordsX + "px";
}

if ( (windowHeight - clickCoordsY) < menuHeight ) {
menu.style.top = windowHeight - menuHeight + "px";
} else {
Expand Down
2 changes: 1 addition & 1 deletion assets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
.item{clear:both; position: relative;}
.item:hover div.icons{visibility: visible;opacity:1;}
.item_link{display: inline-block;}
.item img{position: relative;top: 2px; width: 24px; height: 24px; padding: 8px 4px 0px 4px;}
.item img, .item svg{position: relative;top: 2px; width: 24px; height: 24px; padding: 8px 6px 2px 4px;}
/* .icons{float:right; visibility: hidden; opacity:0; transition:visibility 0.03s linear,opacity 0.03s linear;transition-delay: 0.025s} */
.icons form{margin:0;}
button.icon{background: transparent; border: none; height: 24px; padding: 0; margin:0; width: 24px; font-size:18px; cursor:pointer;}
Expand Down
14 changes: 4 additions & 10 deletions assets/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,11 @@
<?php if(substr($item,0,2) !='I_')continue; ?>
<!-- ITEMS -->
<div class="item task" data-id="<?= $param['id'] ?>" >
<?php if(!empty($param['icon'])): ?>
<?php if(!empty($param['icon']) and (exif_imagetype($param['icon']))): ?>
<img title="<?= $param['icon'] ?>" src="<?= $param['icon'] ?>" width="16" height="16" />
<?php else: ?>
<!-- <img src="data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAFo9M/3AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGQSURBVChTbZNPK6VRHIDPpSymSZKtGhZKbFF01dAMi5nFbHwNitjIwgdQZudPmWIjajZqiiJJytIHUKOUnbJjiOc57znXe42nnvM77znve+7v/M65IbGVmx92Io14irfxCcZTDJUUt1Os+Kos4iNe+fDRBqZwz09elw6hyeYMd/EG+x2QCWzB3/gBe3ETI/6A7KRYpqeB5qDoh4sUpS/F76YZU4NZvMef+Iz/MO8nUkULkn+yDhMyMRM0URM28cheim48Y+1yQUJPimXyjhZNcgS7sLvkGHoUQxjmbCBvTeZTrFpryzmDw3iMrvqE7TjowzX+RWtvPhs4gKNYO+CMqy3gCd7hNxR32ozWyjqdYyQv4IdLaNUd+4yHWMbNHqGnYHrTGBdy1bxRWce2oluHY2tFN+I3sQge3z4+oEzictH9j/Kcl/OrHfdUPiwv69vaiGPOZfymdm8sUj76DlwpunWs4qeiG9/NV6iGl+sXOull+4OtSfuOOec7tYv4XqpiYb9gZ3wK4RL943i8JUJ4ATAKRUDHWhJdAAAAAElFTkSuQmCC" width="16" height="16" alt="" /> -->
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="-2 -2 90 90" version="1.1">
<path fill="transparent" stroke="<?= $data_array[$container]['color_hex'] ?>" stroke-width="1" d="M 80 40 A 40 40 90 1 0 0 40 M 80 40 A 40 40 90 1 1 0 40 M 40 80 A 45 40 90 0 1 40 0 M 40 80 A 45 40 90 0 0 40 0 M 7.5 17 L 72.5 17 M 0 40 L 80 40 M 7.5 63 L 72.5 63" />
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="-2 -2 84 84" version="1.1">
<path fill="transparent" stroke="<?= $data_array[$container]['color_hex'] ?>" stroke-width="3" d="M 80 40 A 40 40 90 1 0 0 40 M 80 40 A 40 40 90 1 1 0 40 M 40 80 A 48 40 90 0 1 40 0 M 40 80 A 48 40 90 0 0 40 0 M 7.5 17 L 72.5 17 M 0 40 L 80 40 M 7.5 63 L 72.5 63" />
</svg>
<?php endif ?>
<div class="item_link">
Expand All @@ -208,12 +207,7 @@
<a href="#" onclick="document.getElementById('url2post').submit();"><?= $param['name'] ?></a>
</form>
<?php else: ?>


<!-- <div id="ctxMenu"><button type='submit' name='edit' value='<?= $param['id'] ?>' class='icon'>✎</button></div> -->


<a href="<?= $param['url'] ?>"target="_blank" > <?= $param['name'] ?> </a>
<a href="<?= $param['url'] ?>"target="_blank" > <?= $param['name'] ?> </a>
<?php endif ?>
</div>

Expand Down
2 changes: 1 addition & 1 deletion assets/world.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added favicon.ico
Binary file not shown.
3 changes: 2 additions & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@


/*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ CONFIG ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*/
$url = "http://localhost:8080/"; // (isset($_SERVER['HTTPS']) && 'on' === $_SERVER['HTTPS'] ? 'https' : 'http') . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
$url = (isset($_SERVER['HTTPS']) && 'on' === $_SERVER['HTTPS'] ? 'https' : 'http') . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
// $url = "http://localhost:8080/";
$dir_db = 'data';
if (!file_exists($dir_db)) {
mkdir($dir_db, 0777, true);
Expand Down

0 comments on commit 53494a5

Please sign in to comment.