+144
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
var me = this;
if (me.profile.carveoutSettings) {
me.profile.carveoutSettings.truncationMethod = fields.truncationMethod;
me.profile.carveoutSettings.truncationMode = fields.truncationMode;
me.profile.carveoutSettings.applyTruncation = fields.applyTruncation;
me.profile.carveoutSettings.truncationValue = fields.truncationValue;
me.profile.carveoutSettings.applyExclusion = fields.applyExclusion;
me.profile.carveoutSettings.serviceTypes = me.getSelected(me.getServiceTypeSelector().getStore(), 'ServiceSubCategoryID');
me.profile.carveoutSettings.placeOfServices = me.getSelected(me.getPlaceOfServiceSelector().getStore(), 'code');
me.profile.carveoutSettings.chronicConditions = me.getSelected(me.getChronicConditionSelector().getStore(), 'column');
} else {
this.profile.carveoutSettings = {
truncationMethod: fields.truncationMethod,
truncationMode: fields.truncationMode,
applyTruncation: fields.applyTruncation,
truncationValue: fields.truncationValue,
applyExclusion: fields.applyExclusion,
serviceTypes: me.getSelected(me.getServiceTypeSelector().getStore(), 'ServiceSubCategoryID'),
placeOfServices: me.getSelected(me.getPlaceOfServiceSelector().getStore(), 'code'),
chronicConditions: me.getSelected(me.getChronicConditionSelector().getStore(), 'column')
}
}
Суслика видишь? а он есть ...
expert,
20 Июня 2015
+144
- 1
- 2
- 3
- 4
- 5
- 6
var s = 0;
$('#slider .slider_item').each(function(){
s++;
});
if (s > 1) {
// ...
Пример с прода для определения числа элементов в карусели
loudless,
18 Июня 2015
+142
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
orders_list_app.constant('User', {
auth : ('False' == 'True') ? true : false,
contractor : ('' == 'True') ? true : false,
user_id : ('False' == 'True') ? None : false
});
// goes in another place
angular.forEach(rootCategory.categories, function(category_2){
angular.forEach(category_2.service_orders, function(service_2){
rootCategory.service_orders.push(service_2);
angular.forEach(category_2.categories, function(category_3){
angular.forEach(category_3.service_orders, function(service_3){
rootCategory.service_orders.push(service_3);
});
});
});
});
rootCategory.service_orders.push({name:"Другие услуги" ,text: "", title: "Другие услуги"});
});
На одном из отечественном сайте в продакшыне..
alek0585,
15 Июня 2015
+143
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
"task_types": [
{
"id": 1,
"name": "Q_TASKS_CLASS_FOLLOW_UP",
"code": "FOLLOW_UP"
},
{
"id": 1,
"name": "Звонок",
"code": "CALL"
},
{
"id": 2,
"name": "Встреча",
"code": "MEETING"
},
{
"id": 3,
"name": "Письмо",
"code": "LETTER"
},
{
"id": "38234",
"name": "Звонок",
"code": ""
},
{
"id": "38246",
"name": "переписка",
"code": ""
},
{
"id": "53122",
"name": "test",
"code": ""
}
]
Кусок ответа от API Amocrm
le6ow5k1,
10 Июня 2015
+143
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
/**
* Generates a random number
*/
function doRand()
{
var num;
now=new Date();
num=(now.getSeconds());
num=num+1;
return num;
};
Пожалуй, лучшая функция генерации случайного числа
u4n,
10 Июня 2015
+141
- 1
- 2
- 3
- 4
- 5
<div style="display:none;">
<script type="text/javascript">
(function(w, c) {................................})(window, "yandex_metrika_callbacks");
</script>
</div>
А ты скрываешь свои скрипты?
11zero11,
04 Июня 2015
+142
- 1
Код не мой, но очень неоптимизированный. И так ещё десяток таких блоков. С сайта: http://ninjahonor.com/.
$(document).ready(function(){
$(".coffin-box1 a.name1").click(function(){
$(".vid1").addClass('active')
$(".vid2 , .vid3 , .vid4 , .vid5 , .vid6 , .vid7 , .vid8 , .vid9 , .vid10 , .vid11 , .vid12 , .vid13 , .vid14 , .vid15 , .vid16 , .vid17 , .vid18 , .vid19 , .vid20 , .vid21 , .vid22 , .vid23 , .vid24 , .vid25 , .vid0 ").removeClass('active')
});
});
$(document).ready(function(){
$(".coffin-box1 a.name2").click(function(){
$(".vid2").addClass('active')
$(".vid1 , .vid3 , .vid4 , .vid5 , .vid6 , .vid7 , .vid8 , .vid9 , .vid10 , .vid11 , .vid12 , .vid13 , .vid14 , .vid15 , .vid16 , .vid17 , .vid18 , .vid19 , .vid20 , .vid21 , .vid22 , .vid23 , .vid24 , .vid25 , .vid0 ").removeClass('active')
});
});
$(document).ready(function(){
$(".coffin-box2 a.name1").click(function(){
$(".vid6").addClass('active')
$(".vid2 , .vid3 , .vid4 , .vid5 , .vid1 , .vid7 , .vid8 , .vid9 , .vid10 , .vid11 , .vid12 , .vid13 , .vid14 , .vid15 , .vid16 , .vid17 , .vid18 , .vid19 , .vid20 , .vid21 , .vid22 , .vid23 , .vid24 , .vid25 , .vid0 ").removeClass('active')
});
});
Dev_18,
27 Мая 2015
+141
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
api.outboxStatus = function(params){
angular.forEach($rootScope.outbox, function(outbox, i){
if( outbox._id == params.outbox._id )
$rootScope.$apply(function(){
$rootScope.outbox[i] = params.outbox;
});
});
}
// -----------
шаблон
<tr ng-repeat="item in fOutbox = (outbox | filter:filterOutbox())">
JovialLiX,
25 Мая 2015
+142
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
"use strict"
var carousel = document.getElementById("carousel");
var carouselItems = document.getElementsByClassName("carousel-item");
var carouselIndecarors = document.getElementsByClassName("carousel-indicator");
var carouselActiveInt = 0;
var carouselInterval;
var carouselRefresh = function(){
}
for(var i=0;i<document.getElementsByClassName("carousel-indicator").length;i++){
document.getElementsByClassName("carousel-indicator")[i].onclick = function(){carouselIndecarorChange(this)};
}
var carouselIndecarorChange = function(id){
carouselItems[carouselActiveInt].classList.toggle("carousel-item__active");
carouselIndecarors[carouselActiveInt].classList.toggle("carousel-indicator__active");
carouselActiveInt = id.getAttribute("data-slide-to");
carouselItems[carouselActiveInt].classList.toggle("carousel-item__active");
carouselIndecarors[carouselActiveInt].classList.toggle("carousel-indicator__active");
}
var carouselNext = function(){
console.log(carouselActiveInt);
carouselItems[carouselActiveInt].classList.toggle("carousel-item__active");
carouselIndecarors[carouselActiveInt].classList.toggle("carousel-indicator__active");
if(carouselActiveInt == carouselItems.length-1){
carouselActiveInt=0;
}
else{
carouselActiveInt++;
}
carouselItems[carouselActiveInt].classList.toggle("carousel-item__active");
carouselIndecarors[carouselActiveInt].classList.toggle("carousel-indicator__active");
}
var carouselAutoPlay = function(time){
carouselInterval = setInterval(
function(){carouselNext()},time)
}
carouselAutoPlay(5000);
carousel.onmouseover = function(){clearInterval(carouselInterval)};
carousel.onmouseout = function(){carouselAutoPlay()};
Слайдер
mcheguevara2,
23 Мая 2015