STYLE SWITCHER DIRECTORY PERSISTENCE

23 replies · opened Aug 15, 2017

PpixelsalsaAug 15, 2017

Hi you recently looked at the directory persistence issue - i have some url rewriting which is causing the persistence to fail now - could you take a look please.

Eg

http://www.redhousebarn.co.uk/development/ then go to another directory - say http://www.redhousebarn.co.uk/development/info/faqs/

The js looks like this:

!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e("object"==typeof exports?require("jquery"):jQuery)}(function(e){function t(e){return i.raw?e:encodeURIComponent(e)}function o(e){return i.raw?e:decodeURIComponent(e)}function s(e){return t(i.json?JSON.stringify(e):String(e))}function a(e){0===e.indexOf('"')&&(e=e.slice(1,-1).replace(/\"/g,'"').replace(/\\/g,"\"));try{return e=decodeURIComponent(e.replace(c," ")),i.json?JSON.parse(e):e}catch(t){}}function r(t,o){var s=i.raw?t:a(t);return e.isFunction(o)?o(s):s}var c=/+/g,i=e.cookie=function(a,c,n){if(arguments.length>1&&!e.isFunction(c)){if(n=e.extend({},i.defaults,n),"number"==typeof n.expires){var l=n.expires,u=n.expires=new Date;u.setTime(+u+864e5*l)}return document.cookie=[t(a),"=",s(c),n.expires?"; expires="+n.expires.toUTCString():"",n.path?"; path="+n.path:"",n.domain?"; domain="+n.domain:"",n.secure?"; secure":""].join("")}for(var d=a?void 0:{},h=document.cookie?document.cookie.split("; "):[],b=0,p=h.length;p>b;b++){var w=h[b].split("="),k=o(w.shift()),g=w.join("=");if(a&&a===k){d=r(g,c);break}a||void 0===(g=r(g))||(d[k]=g)}return d};i.defaults={},e.removeCookie=function(t,o){return void 0===e.cookie(t)?!1:(e.cookie(t,"",e.extend({},o,{expires:-1})),!e.cookie(t))}}),jQuery(document).ready(function(e){e(".switcher").css("left","-260px"),e(".switcher-trigger").click(function(){return e(".switcher").hasClass("closeswitcher")?e(".switcher").animate({left:"-260px"},300,"easeOutQuad",function(){e(".switcher").removeClass("closeswitcher")}):e(".switcher").animate({left:0},300,"easeOutQuad",function(){e(".switcher").addClass("closeswitcher")}),!1});var t=e("body"),o=e.cookie("canvashtmlSwitcherLayoutMode"),s=e.cookie("canvashtmlSwitcherColor"),a=e.cookie("canvashtmlSwitcherPattern");"boxed"==o?(t.toggleClass("stretched",!1),e("#switcher-op-layout a").removeClass("button-black").addClass("button-white button-light"),e('#switcher-op-layout a[data-layout="'+o+'"]').removeClass("button-white button-light").addClass("button-black")):(t.toggleClass("stretched",!0),e("#switcher-op-layout a").removeClass("button-black").addClass("button-white button-light"),e('#switcher-op-layout a[data-layout="'+o+'"]').removeClass("button-white button-light").addClass("button-black")),""!=s&&(e("#swcolors-Css").remove(),e("head").append('<link id="swcolors-Css" rel="stylesheet" href="/development/css/colors.php?color='+s+'" type="text/css" />')),""!=a&&"boxed"==o&&(e("body").css("background-image",'url("'+a+'")'),e("body").css("background-size","auto auto"),e("body").css("background-position","0% 0%"),e("body").css("background-repeat","repeat repeat")),e("#switcher-reset-button").click(function(){return e.removeCookie("canvashtmlSwitcherLayoutMode"),e.removeCookie("canvashtmlSwitcherColor"),e.removeCookie("canvashtmlSwitcherPattern"),location.reload(),!1}),e("#switcher-op-layout a").click(function(){{var t=e(this),s=t.attr("data-layout"),a=e("body");e("#wrapper")}o!=s&&(e.cookie("canvashtmlSwitcherLayoutMode",s,{expires:14}),o=s),"stretched"==s?(a.toggleClass("stretched",!0),e("#switcher-op-layout a").removeClass("button-black").addClass("button-white button-light"),t.removeClass("button-white button-light").addClass("button-black")):(a.toggleClass("stretched",!1),e("#switcher-op-layout a").removeClass("button-black").addClass("button-white button-light"),t.removeClass("button-white button-light").addClass("button-black"));setTimeout(function(){e(window).resize()},300);return!1}),e("#switcher-option-color li").click(function(){var t=e(this).attr("data-color");s!=t&&(e.cookie("canvashtmlSwitcherColor",t,{expires:14}),s=t),e("#swcolors-Css").remove(),e("head").append('<link id="swcolors-Css" rel="stylesheet" href="/development/css/colors.php?color='+t+'" type="text/css" />')}),e("#switcher-option-pattern li").click(function(){var t=e(this).attr("data-url");"stretched"==o?alert("Please select Boxed Layout to Preview Patterns."):(a!=t&&(e.cookie("canvashtmlSwitcherPattern",t,{expires:14}),a=t),e("body").css("background-image",'url("'+t+'")'),e("body").css("background-size","auto auto"),e("body").css("background-position","0% 0%"),e("body").css("background-repeat","repeat repeat"))}),e("#switcher-option-bgimage li").click(function(){var t=e(this).attr("data-url");"stretched"==o?alert("Please select Boxed Layout to Preview Background Images."):(e("body").css("background-image",'url("'+t+'")'),e("body").css("background-attachment","fixed"),e("body").css("background-size","cover"),e("body").css("background-position","50% 50%"),e("body").css("background-repeat","no-repeat no-repeat"))})});

HELP!!!!!!!!

PpixelsalsaAug 15, 2017

I think maybe this is the issue

/development/css/colors.php

perhaps rewrite is making it become /development/css/colors/

Could you help me try to solve

Dan

PpixelsalsaAug 16, 2017

HI - I really need a response to this asap

SSemicolon WebSTAFFAug 16, 2017

Hello,

We have just tried checking out the Links you have provided us and the Colors appear to be working fine for us on both the Links by showing the same colors! Can you please confirm if this is working fine for you now? Thanks for your Patience.

Meanwhile, do let us know if we can help you with anything else or if you find any further issues with Canvas.

PpixelsalsaAug 17, 2017

The switcher works but the directory persistence does not work. Can you please check this ASAP!

Thanks
Dan

PpixelsalsaAug 17, 2017

Ok - so if you set the colors once its ok but change the colors and its does not persist through directories - can you try this please and confrim

Thanks
Dan

PpixelsalsaAug 17, 2017

HELLO _ PLEASE LOOK

PpixelsalsaAug 17, 2017

hello- i really really need support on this issue

PpixelsalsaAug 18, 2017

Can you please reply today?

SSemicolon WebSTAFFAug 18, 2017

Hello,

Thanks for your Patience!

We have gone through this thoroughly and we guess the issue is with Absolute URLs which is causing this issue working on URL rewrites. Please make sure you are using the Full Path URL of the Files throughout your Website. So this URL: /development/css/colors.php will become http://your-website.com/development/css/colors.php which will ensure that the colors.php File will always work.

Additionally, also make sure that your are using the Full URLs for all the JS/CSS Links on your Page to avoid any further issues.

Consider checking this out and let us know if you are still facing any further issues after this. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

PpixelsalsaSep 15, 2017

HI

I have an urgent request - i have renewed my support for this today.

I took of url rewriting as directory persistence just was not working.

The problem I have is that I am getting no persistence at all now - i make a change but even refresh the page and the old style is set.

I REALLY REALLY need this fixing today.

I have zipped the switched directory for you to look at and fix as i think it has got in a twist somewhere.

PLEASE PLEASE HELP.

PpixelsalsaSep 16, 2017

HELLO - I need a reply please

PpixelsalsaSep 18, 2017

[sb_private_reply]I need a reply now - this is too long to reply for paid to support.

Dan[/sb_private_reply]

SSemicolon WebSTAFFSep 19, 2017

Hello,

Can you please provide us with a Dropbox/Google Drive Link for the Switcher.zip File so that we can take a look at the Files?

Additionally, we have created the Non-minified Version of the switcher.js File, so please consider using this file: https://www.dropbox.com/s/icarqolifo8de4y/switcher-full.js?dl=1 .

This should definitely work fine. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

SSemicolon WebSTAFFSep 19, 2017

Hello,

  1. Please include the switcher-head.php in the <head> Tag and switcher-foot.php just before the </body> Tag at the end of the Document.

  2. Update the Switcher File with the New File we sent you in the Previous Posts.

This should definitely work fine. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

PpixelsalsaSep 19, 2017

hello - please reply - i really need this

PpixelsalsaSep 20, 2017

HELLO?

PpixelsalsaSep 20, 2017

i fixed the home page ref but still not persistent!

PpixelsalsaSep 20, 2017

Hello - I am waiting 2 days for replies which is causing me issues

PLEASE update me.

PpixelsalsaSep 21, 2017

This is still not working

Please review the site and test for yourself! THIS IS URGENT NOW

PpixelsalsaSep 21, 2017

hello, i am sorry to be chasing you but my client as said they want to pull the project as it is not working
HEELP!!

SSemicolon WebSTAFFSep 21, 2017

Hello,

Ok Guys! Firstly, there are a lot of inconsistencies on your Website!

You will need to provide the Full Path of the css/colors.php File in the switcher.js File: http://www.redhousebarn.co.uk/development/css/colors.php to make sure this works fine across all directories. Please update your switcher.js File and it should work just fine!

Thanks for your Patience.

Do let us know if we can help you with anything else or if you find any further issues with Canvas.

PS. The switcher is not a Feature of Canvas or included within the Package as it was created only for Demo Purposes.

PpixelsalsaSep 23, 2017

EXCELLENT _ WORKING NOW! thanks

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard