diff --git a/src/components/project.vue b/src/components/project.vue index 6d2b78d..9eb5879 100644 --- a/src/components/project.vue +++ b/src/components/project.vue @@ -1,7 +1,7 @@ diff --git a/src/components/projectPopup.vue b/src/components/projectPopup.vue index 03af693..f3abc7e 100644 --- a/src/components/projectPopup.vue +++ b/src/components/projectPopup.vue @@ -3,7 +3,6 @@ import projectMapLink from '@components/projectMapLink'; import spotIcon from '@components/spotIcon'; import projectRelTime from '@components/projectRelTime'; import projectMediaLink from '@components/projectMediaLink'; -import { options } from '@scripts/lightbox'; export default { components: { diff --git a/src/scripts/common.js b/src/scripts/common.js index e049dc9..e5ed44c 100644 --- a/src/scripts/common.js +++ b/src/scripts/common.js @@ -1,40 +1,5 @@ /* Common Functions */ -export function copyArray(asArray) -{ - return asArray.slice(0); //trick to copy array -} - -export function getElem(aoAnchor, asPath) -{ - return (typeof asPath == 'object' && asPath.length > 1)?getElem(aoAnchor[asPath.shift()], asPath):aoAnchor[(typeof asPath == 'object')?asPath.shift():asPath]; -} - -export function setElem(aoAnchor, asPath, oValue) -{ - var asTypes = {boolean:false, string:'', integer:0, int:0, array:[], object:{}}; - if(typeof asPath == 'object' && asPath.length > 1) - { - var nextlevel = asPath.shift(); - if(!(nextlevel in aoAnchor)) aoAnchor[nextlevel] = {}; //Creating a new level - if(typeof aoAnchor[nextlevel] !== 'object') debug('Error - setElem() : Already existing path at level "'+nextlevel+'". Cancelling setElem() action'); - return setElem(aoAnchor[nextlevel], asPath, oValue); - } - else - { - var sKey = (typeof asPath == 'object')?asPath.shift():asPath; - return aoAnchor[sKey] = (!(sKey in aoAnchor) && (oValue in asTypes))?asTypes[oValue]:oValue; - } -} - -export function getDragPosition(oEvent) { - let bMouse = oEvent.type.includes('mouse'); - return { - x: bMouse?oEvent.pageX:oEvent.touches[0].clientX, - y: bMouse?oEvent.pageY:oEvent.touches[0].clientY - }; -} - export function copyTextToClipboard(text) { if(!navigator.clipboard) { var textArea = document.createElement('textarea'); diff --git a/src/scripts/jquery.helpers.js b/src/scripts/jquery.helpers.js deleted file mode 100644 index 201163e..0000000 --- a/src/scripts/jquery.helpers.js +++ /dev/null @@ -1,78 +0,0 @@ -import { getDragPosition } from '@scripts/common'; - -$.prototype.defaultVal = function(sDefaultValue) -{ - $(this) - .data('default_value', sDefaultValue) - .val(sDefaultValue) - .addClass('defaultText') - .focus(function() - { - var $This = $(this); - if($This.val() == $This.data('default_value')) $This.val('').removeClass('defaultText'); - }) - .blur(function() - { - var $This = $(this); - if($This.val() == '') $This.val($This.data('default_value')).addClass('defaultText'); - }); -}; - -$.prototype.checkForm = function(sSelector) -{ - sSelector = sSelector || 'input[type="text"], textarea'; - var $This = $(this); - var bOk = true; - $This.find(sSelector).each(function() - { - $This = $(this); - bOk = bOk && $This.val()!='' && $This.val()!=$This.data('default_value'); - }); - return bOk; -}; - -$.prototype.onSwipe = function(fOnStart, fOnMove, fOnEnd){ - return $(this) - .on('dragstart', (e) => { - e.preventDefault(); - }) - .on('mousedown touchstart', (e) => { - var $This = $(this); - var oPos = getDragPosition(e); - $This.data('x-start', oPos.x); - $This.data('y-start', oPos.y); - $This.data('x-move', oPos.x); - $This.data('y-move', oPos.y); - $This.data('moving', true).addClass('moving'); - fOnStart({ - xStart: $This.data('x-start'), - yStart: $This.data('y-start') - }); - }) - .on('touchmove mousemove', (e) => { - var $This = $(this); - if($This.data('moving')) { - var oPos = getDragPosition(e); - $This.data('x-move', oPos.x); - $This.data('y-move', oPos.y); - fOnMove({ - xStart: $This.data('x-start'), - yStart: $This.data('y-start'), - xMove: $This.data('x-move'), - yMove: $This.data('y-move') - }); - } - }) - .on('mouseup mouseleave touchend', (e) => { - var $This = $(this); - if($This.data('moving')) { - $This.data('moving', false).removeClass('moving'); - fOnEnd({ - xStart: $This.data('x-start'), - yStart: $This.data('y-start'), - xEnd: $This.data('x-move'), - yEnd: $This.data('y-move') - }); - } - }); -}; diff --git a/src/styles/_page.project.settings.scss b/src/styles/_page.project.settings.scss index 1deb70e..69c2ce7 100644 --- a/src/styles/_page.project.settings.scss +++ b/src/styles/_page.project.settings.scss @@ -112,7 +112,7 @@ } } - .newsletter { + &.newsletter { .newsletter-form { display: flex; align-items: stretch;