app.factory('YouService', function() {
var progress = 90;
getProgress: function() {
return progress;
}
});
app.directive('YouDirective', function(YouService) {
return {
restrict: 'E',
...
...
link: function(scope, element, attrs) {
scope.$watch(function () {
return YouService.getProgress();
}, function (progress) {
console.log(progress);
}
});
}
});
io.configure(function (){
io.set('authorization', function (handshakeData, callback) {
var cookies = parseCookies(handshakeData);
console.log(cookies);
callback(null, true); // error first callback style
});
});
function parseCookies(request) {
var list = {},
rc = request.headers.cookie;
rc && rc.split(';').forEach(function(cookie) {
var parts = cookie.split('=');
list[parts.shift().trim()] = unescape(parts.join('='));
});
return list;
}
$(function() {
var images = [{
class: "first-img", // Класс
timeout: 2000 // Задержка для класса
}, {
class: "second-img",
timeout: 5000
}, {
class: "third-img",
timeout: 3000
}],
i = 0,
timeout;
function changeBackground() {
clearTimeout(timeout);
$('body').removeClass().addClass(function() {
if (i >= images.length)
i = 0;
timeout = setTimeout(changeBackground, images[i].timeout);
return images[i++].class;
});
}
changeBackground();
});
text-shadow: -1px -1px 0px #ffffff;
<div class="content-container">
<div class="nav-mess"></div>
<div class="body-mess"></div>
</div>
.content-container:before,
.content-container:after {
content: " ";
display: table;
}
.content-container:after {
clear: both;
}
@helpers-folder: "helpers";
@import url(~"@{helpers-folder}/normalize.less");
@import url(~"@{helpers-folder}/mixins.less");
ErrorDocument 403 path_to_html_files/deny_from_all_page.html
<FilesMatch "^(file1|file2)\.html$">
allow from allowed.ip.address
</FilesMatch>
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/nginx-default$fastcgi_script_name;
include fastcgi_params;
}
<div id="welcomeimage" class="row">
<img class="img-responsive" src="http://practicana.com/img/background-02.jpg">
<div id="my_text_id" class="container">
Practicana
</div>
</div>
img {
width: 300px;
height: 300px;
}
#welcomeimage {
position: relative;
width: 300px;
height: 300px;
}
#my_text_id {
width: 100%;
position: absolute;
text-align: center;
top: 50%;
-webkit-transform: translate(0, -50%);
-ms-transform: translate(0, -50%);
transform: translate(0, -50%);
}