Cookie Consent (Silk Tide Modification) 1.0.0

   (0 reviews)

About This File

This is a modification of the Cookie Consent javascript from https://silktide.com/tools/cookie-consent/

The original was trying to be too clever for my tastes with multiple font sizes and sliders for different screen sizes. It didn't look great on my desktop, tablet, phone. It would I've stripped it down to the bare minimum to reduce distraction. It just features a single line in body text.

The original version used an Amazon S3 address for the javascript and CSS which was OK but the Cache-Control / Expires headers are not present which wasn't great for PageSpeed/YSlow reports and caching. With this version you have to self-host the files. Of course if you use a CDN you can upload them there too.

Whether it complies with the EU cookie law as implemented in your country is for you to determine - this implementation is fine for the UK and common to a number of notable websites such as http://www.theregister.co.uk (it's what I modelled the banner and CSS on).

To use:

- Upload the js and css files to your host somewhere. 

- Add this code to your pages just before the </head> tag. Modify the text as required and adjust the url for the css. 

Example:

<!-- Begin Cookie Consent -->
<script type="text/javascript">
    window.cookieconsent_options = {"message":"This website uses cookies","dismiss":"Close","learnMore":"Find out more","link":"https://www.yoursite.com/site/cookie-policy/","theme":"//www.yoursite.com/js/cookieconsent/cookieconsent-dark.css"};
</script>

<script type="text/javascript" src="//www.yoursite.com/js/cookieconsent/cookieconsent.min.js"></script>
<!-- End Cookie Consent -->

 

See the forum url for more details/discussion..


1 person likes this



User Feedback

You may only provide a review once you have downloaded the file.

There are no reviews to display.

  • Similar Content

    • genius257
      Is it possible to throw an error in a ScriptControl object, via AutoIt
      By genius257
      First of all I've been searching on the forum, and while there's been done something like this with: https://www.autoitscript.com/forum/topic/141004-comobject-proxy-seamless-windows-script-control-autoitobj/
      I could not find any solution to my predicament.
       
      Is it possible to throw an error in a ScriptControl object, via AutoIt?
      I have a script, where AutoIt calls ScriptControl:JavaScript which in turn calls AutoIt.
      However i would like to be able to make AutoIt invoke an exception within ScriptControl, if the called functionality fails.
      Here's some code for reference:
      #AutoIt3Wrapper_Run_AU3Check=n #include-once #include "AutoitObject.au3" #include <WinAPIDiag.au3> $oJS = ObjCreate("ScriptControl") $oJS.Language = "JScript" $oJS.TimeOut = 0; A value of 0 means that the ScriptControl will monitor the execution of the script and will trigger the Timeout event if it determines that the script is hung. _AutoItObject_Startup() $oAutoIt = _AutoItObject_Create() _AutoItObject_AddMethod($oAutoIt, "Execute", "_Execute", False) $oJS.AddObject("AutoIt", $oAutoIt, True) OnAutoItExitRegister("_CleanUp") $_AutoItError = ObjEvent("AutoIt.Error", "_AutoItError") Func _CleanUp() ConsoleWrite("Cleaning up..."&@CRLF) $oJS = 0 $oAutoIt = 0 _AutoItObject_Shutdown() EndFunc Func _Execute($oSelf, $sString) $vReturn = Execute($sString) If @error<>0 Then Return $oJS.Eval("throw new SyntaxError();"); Does invoke exception, but not within the try/catch Return $vReturn EndFunc Func _AutoItError($oError) $oError2 = $oJS.Error ConsoleWrite( _ "Column: " & $oError2.Column & @CRLF & _ "Description: " & $oError2.Description & @CRLF & _ "HelpContext: " & $oError2.HelpContext & @CRLF & _ "HelpFile: " & $oError2.HelpFile & @CRLF & _ "Line: " & $oError2.Line & @CRLF & _ "Number: " & $oError2.Number & @CRLF & _ "Source: " & $oError2.Source & @CRLF & _ "Text: " & $oError2.Text & @CRLF _ ) $oError2.Clear() EndFunc $oJS.Eval("(function(){"& _ "try{"& _ "AutoIt.Execute('MsgBox(0,\'\', \'a\')');"& _ "AutoIt.Execute('a.b');/*error should occur here*/"& _ "AutoIt.Execute('MsgBox(0,\'\', \'b\')');"& _ "}catch(e){"& _ "AutoIt.Execute('ConsoleWrite(\'Error\'&@CRLF)');"& _ "}"& _ "})()")  
    • Robdog1955
      Enter data into IE form that has a javascript editbox
      By Robdog1955
      I am trying to use IE.au3 UDF to auto fill a webpage. All goes well until I get to an editbox that appears to be a javascript. I am attaching a pic of the editbox. (I would be glad to add any other information needed to help me past this last hurdle in my script. I'm just not sure what questions you have to help me with this.)

    • DrewSS
      javascript menu automation help - _FFCmd
      By DrewSS
      Hello,
      I'm looking for some direction with how to automate the exporting of an excel report through a javascript driven menu; unfortunately it does not support IE, so Firefox is what i've been trying, and I can navigate all the way through the dashboard and generate the report, but to export it I need to go through the menu. The menu has onmousedown and onmouseover events that I'm not sure how to send. It looks like I can do this with _FFCmd, but it may take several statements.. can someone help me get started?
       
      This is the path to export:
       
      <div id="mstr395" tstid="" class="mstrmojo-ListBase mstrmojo-ui-Menu unselectable mojo-theme-dark visible" style="top: 0px; right: 100%; bottom: auto; left: auto;"
      onclick="mstrmojo.dom.captureDomEvent('mstr395','click', self, event)"
      ondblclick="mstrmojo.dom.captureDomEvent('mstr395','dblclick', self, event)"
      onmousedown="mstrmojo.dom.captureDomEvent('mstr395','mousedown', self, event)"
      onmouseover="mstrmojo.dom.captureDomEvent('mstr395','mouseover', self, event)"
      onmouseout="mstrmojo.dom.captureDomEvent('mstr395','mouseout', self, event)"
      oncontextmenu="mstrmojo.dom.captureDomEvent('mstr395','contextmenu', self, event)">
      <div class="mstrmojo-ui-Menu-item-container" style="">
      <a class="item exportToExcel mstrmojo-ui-Menu-item" idx="0" style="" title="">
      <div class="micn"></div>Excel</a><a class="item exportToPDF mstrmojo-ui-Menu-item" idx="1" style="" title="">
       
      Sorry I cannot provide access to the dashboard as it has sensitive information. Any feedback is greatly appreciated!
       
       
       
       
       
    • guinness
      imageExists
      By guinness
      Check if an image actually resolves to a successful HTTP status code e.g. 200 (OK). imageExists returns a promise, so make sure the browser you're using supports promises e.g. Chrome. If not, then you can look at using a polyfill (https://github.com/components/es6-promise) or if you're feeling adventurous, then change the code to use jQuery's deferreds (not recommended).
      To see it working, copy the code to http://www.es6fiddle.net/ and watch the images either resolve or fail (reject).
      /*global console, Promise*/ /** * Check if an image is resolvable i.e. returns a HTTP status code that is not 404 * * @param {string} sourceFile An image source file to check * @return {promise} A promise that is resolved/rejected once the image has loaded or a response has been resolved. The source file is passed through */ var imageExists = (function imageExistsModule(document, Promise) { // Append to the global object i.e. window return function imageExists(sourceFile) { if (!sourceFile || !sourceFile.length) { return Promise.reject(sourceFile); } // Create a HTMLImageElement node, but don't insert into the DOM var img = document.createElement('img'); // Set the image element source file img.src = sourceFile; // If the image has already been loaded i.e. cached, then resolve a promise if (img.complete) { return Promise.resolve(sourceFile); } // Return a promise return new Promise(function promise(resolve, reject) { // Create event listeners for when or if the HTMLImageElement is loaded img.addEventListener('error', function errorEvent() { reject(sourceFile); }); img.addEventListener('load', function loadEvent() { resolve(sourceFile); }); }); }; }( document, Promise )); (function example(imageExists, console) { // Check if guinness' thumbnail exists. This returns a promise object imageExists('https://www.autoitscript.com/forum/uploads/profile/photo-thumb-35302.jpg').then(function promiseThen(image) { console.log(image + ' => OKAY'); }).catch(function promiseCatch(image) { console.log(image + ' => FAIL'); }); // Check if a random thumbnail exists. This returns a promise object imageExists('https://www.autoitscript.com/forum/uploads/profile/random-thumb.jpg').then(function promiseThen(image) { console.log(image + ' => OKAY'); }).catch(function promiseCatch(image) { console.log(image + ' => FAIL'); }); }( imageExists, console ));  
    • grakker
      FF.au3 Javascript Click on Button Question
      By grakker
      I have a page with a bunch of links that look like this:
      <input type="submit" name="ctl00$MainContent$DroppedStudents$ClassRptr$ctl01$btnStuProfile" value="" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;ctl00$MainContent$DroppedStudents$ClassRptr$ctl01$btnStuProfile&quot;, &quot;&quot;, false, &quot;&quot;, &quot;Helpers/SetStudentAndRedirect.aspx?DU=StudentProfile.aspx&amp;SN=3720&quot;, false, false))" id="ctl00_MainContent_DroppedStudents_ClassRptr_ctl01_btnStuProfile" title="View Student Profile" class="dim-link student-profile" /> I'm able to parse the page and end up with an array of `name` references that look like this:
       
      ctl00$MainContent$ClassRptr$ctl01$btnStuProfile ctl00$MainContent$ClassRptr$ctl02$btnStuProfile ctl00$MainContent$ClassRptr$ctl03$btnStuProfile ctl00$MainContent$ClassRptr$ctl04$btnStuProfile ctl00$MainContent$ClassRptr$ctl05$btnStuProfile I can't figure out how to use the Firefox UDF to click on these. I have installed and tested MozRepl and it works. I want to do something like:
      For $row in $array _FFLinkClick($row, "name") Next Well, I'm going to do more than just click those links, but I can't even get that to work. Right now my error looks like:
      _FFConnect: OS: WIN_7 WIN32_NT 7601 Service Pack 1 _FFConnect: AutoIt: 3.3.14.2 _FFConnect: FF.au3: 0.6.0.1b-15 _FFConnect: IP: 127.0.0.1 _FFConnect: Port: 4242 _FFConnect: Delay: 2ms _FFConnect: Socket: 580 _FFConnect: Browser: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0 __FFSendJavaScripts: Sending functions to FireFox .......... done __FFSend: FFau3.xpath=null;try{FFau3.xpath=FFau3.WCD.evaluate("//a[contains(@name,'ctl00$MainContent$ClassRptr$ctl01$btnStuProfile')]",FFau3.WCD,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;}catch(e){'_FFXPath_Error: '+e;}; __FFRecv: _FFXPath_Error: TypeError: can't access dead object __FFSend: try{FFau3.simulateEvent(0,'MouseEvents','click');}catch(e){'_FFCmd_Err';}; _FFXPath ==> Error return value: _FFXPath_Error: TypeError: can't access dead object __FFRecv: -3 I have looked at the samples, but I just can't figure out how to do this. I think that it is something with _FFXPath, but that documentation stumps me as well.