From 34f63c9667e200b2e978c29f0ba276457ca184cd Mon Sep 17 00:00:00 2001 From: fefa4ka Date: Tue, 9 Feb 2016 09:58:30 +0300 Subject: [PATCH] setcookie fix --- zsite/static/js/app.js | 6 ------ zsite/static/js/snippets.js | 5 +++++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/zsite/static/js/app.js b/zsite/static/js/app.js index 97c4f9f..a78c4bd 100644 --- a/zsite/static/js/app.js +++ b/zsite/static/js/app.js @@ -1,11 +1,5 @@ angular.module('zuykov', ['ui.bootstrap']); -function setCookie(key, value) { - var expires = new Date(); - expires.setTime(expires.getTime() + (1 * 24 * 60 * 60 * 1000)); - document.cookie = key + '=' + value + ';expires=' + expires.toUTCString(); -} - angular.module('zuykov') .controller('MainCtrl', ['$scope', function ($scope) { $scope.GetNoun = function(number, one, two, five) { diff --git a/zsite/static/js/snippets.js b/zsite/static/js/snippets.js index b8509eb..38f729a 100644 --- a/zsite/static/js/snippets.js +++ b/zsite/static/js/snippets.js @@ -22,6 +22,11 @@ GetAdj = function(number, one, two) { return two; }; +setCookie = function(key, value) { + var expires = new Date(); + expires.setTime(expires.getTime() + (1 * 24 * 60 * 60 * 1000)); + document.cookie = key + '=' + value + ';expires=' + expires.toUTCString(); +}; $(function() { $( "[href^=mailto]" ).click(function() {