- 1
var routers = new (R(views))();
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
0
var routers = new (R(views))();
Чет по другому не придумал как в роутер view передать
+3
setTimeout(function() {
$('#kostyl').click().click();
}, 2000);
Применить сортировку по этому столбцу в таблице после её подгрузки и отработки жс, который строит эту таблицу.
+3
var pricerawjson = "%7B%22price%22%3A%226973.00%22%2C%22status%22%3A%22active%22%2C%22sell_status%22%3A%22available%22%2C%22old_price%22%3A%227607.0000%22%2C%22price_formatted%22%3A%226%20973%22%2C%22old_price_formatted%22%3A%227%20607%22%7D";
if (pricerawjson.length == 0) {
pricerawjson = '%7B%22price%22%3A%226973%22%2C%22price_formatted%22%3A%226%20973%22%2C%22old_price%22%3A7607%2C%22old_price_formatted%22%3A%227%20607%22%2C%22status%22%3A%22active%22%2C%22sell_status%22%3A%22available%22%7D';
}
0
.container .additional-item{display: block;width:100%;}
.container .additional-item thead{display: block;width:100%;}
.container .additional-item thead tr td{font-weight: bold;}
.container .additional-item tbody{display: block;width:100%;}
.container .additional-item tr{display: block;width:100%;padding:10px 0px;}
.container .additional-item tr td{display: inline-block;text-align: center;}
.container .additional-item tr td:nth-child(1){width:3%;}
.container .additional-item tr td:nth-child(2){width:3%;}
.container .additional-item tr td:nth-child(3){width:3%;}
.container .additional-item tr td:nth-child(4){width:15%;}
.container .additional-item tr td:nth-child(5){width:5%;}
.container .additional-item tr td:nth-child(6){width:5%;overflow: hidden;}
.container .additional-item tr td:nth-child(7){width:20%;overflow: hidden;}
.container .additional-item tr td:nth-child(8){width:3%;overflow: hidden;}
.container .additional-item tr td:nth-child(9){width:3%;overflow: hidden;}
.container .additional-item tr td:nth-child(10){width:5%;overflow: hidden;}
.container .additional-item tbody tr td:nth-child(11){font-weight: bold;color:rgb(138, 43, 23);}
.container .additional-item tr td:nth-child(11){width:10%;overflow: hidden;}
.container .additional-item tr td:nth-child(12){width:7.5%;overflow: hidden;}
.container .additional-item tr td:nth-child(12) input{width:50%;margin:auto;text-align: center;}
.container .additional-item tr td:nth-child(13){width:12%;overflow: hidden;}
.container .additional-item tr td:nth-child(13) a{display: block;width: 95%;margin-left: 5%;height: 30px;line-height: 15px;font-size: 100%;}
+4
$(document).ready(function() {
setInterval(form_check, 10);
function form_check() {
if ($("#main-order-form input[name='car-name']").attr("value") == "") {
$("#main-order-form button").attr('disabled', 'disabled');
} else {
$("#main-order-form button").removeAttr('disabled');
}
}
});
Валидация формы)))
+2
try {
$files->load($avatar);
$this->fail('Fail message');
} catch (\Exception $ex) {
//All good
}
Это авто тест на метод $files->load
$this->fail - здесь кидает исключение
All good - и не важно какое исключение кинет $files->load, а если не кинет, то вызовем fail который наверняка кинет исключение
+2
public struct TotalStat
{
public int Level { get; set; }
public int Type { get; set; }
public string Name { get; set; }
public string Code { get; set; }
public int VAL_01_1 { get; set; }
public int VAL_01_2 { get; set; }
public int VAL_01_3 { get; set; }
public int VAL_01_4 { get; set; }
public int VAL_51_1 { get; set; }
public int VAL_51_2 { get; set; }
public int VAL_51_3 { get; set; }
public int VAL_51_4 { get; set; }
public TotalStat[] Children;
public FontWeight FontWeight
{
get
{
return Type == 2 ? FontWeights.Bold : FontWeights.Normal;
}
}
public Thickness Margin
{
get
{
return new Thickness(this.Level * 10, 0, 0, 0);
}
}
public string CNT_01
{
get
{
var v = VAL_01_1 + VAL_01_2 + VAL_01_3 + VAL_01_4;
return v.ToString();
}
}
public string CNT_51
{
get
{
var v = VAL_51_1 + VAL_51_2 + VAL_51_3 + VAL_51_4;
return v.ToString();
}
}
public string CNT_01_1
{
get
{
if (Type == 1) return "";
if (VAL_01_1 == 0) return "-";
return VAL_01_1.ToString();
}
}
public string CNT_01_2
{
get
{
if (Type == 1) return "";
if (VAL_01_2 == 0) return "-";
return VAL_01_2.ToString();
}
}
public string CNT_01_3
{
get
{
if (Type == 1) return "";
if (VAL_01_3 == 0) return "-";
return VAL_01_3.ToString();
}
}
//В том же духе до CNT_51_4
public static TotalStat operator +(TotalStat t, TotalStat c)
{
t.VAL_01_1 += c.VAL_01_1;
t.VAL_01_2 += c.VAL_01_2;
t.VAL_01_3 += c.VAL_01_3;
t.VAL_01_4 += c.VAL_01_4;
t.VAL_51_1 += c.VAL_51_1;
t.VAL_51_2 += c.VAL_51_2;
t.VAL_51_3 += c.VAL_51_3;
t.VAL_51_4 += c.VAL_51_4;
return t;
}
}
На лабу похоже, да? А вот это не лаба. Сириозный праэкт для суровой организации (продолжение).
+2
public function extractPublicPlace($item)
{
list($a['name'], list($a['lat'], $a['lon'])) = $item;
return $a;
}
просто оставлю
+2
applications_menu_container.find('a').click(function () {
if ($(this).parent('.disabled').length === 0 || $(this).parent('.active').length === 0) {
applications_menu_container.find('li').removeClass('active');
$(this).parent().addClass('active');
switch ($(this).attr('id')) {
case 'active_applications':
applications_history_container.hide();
applications_history_pagination_toolbar.hide();
application_add_container.hide();
active_applications_sub_menu.hide();
change_application_sub_container.hide();
application_history_sub_container.hide();
application_files_sub_container.hide();
applications_history_sub_menu.hide();
historical_application_history_sub_container.hide();
historical_application_files_sub_container.hide();
load_active_applications(0, 10);
break;
case 'applications_history':
active_applications_container.hide();
active_applications_bottom_toolbar.hide();
application_add_container.hide();
active_applications_sub_menu.hide();
change_application_sub_container.hide();
application_history_sub_container.hide();
application_files_sub_container.hide();
applications_history_sub_menu.hide();
historical_application_history_sub_container.hide();
historical_application_files_sub_container.hide();
load_applications_history(0, 10);
break;
case 'new_application':
default:
active_applications_container.hide();
active_applications_bottom_toolbar.hide();
applications_history_container.hide();
applications_history_pagination_toolbar.hide();
active_applications_sub_menu.hide();
change_application_sub_container.hide();
application_history_sub_container.hide();
application_files_sub_container.hide();
applications_history_sub_menu.hide();
historical_application_history_sub_container.hide();
historical_application_files_sub_container.hide();
show_add_application_form();
break;
}
}
return false;
});
Переключение вкладок.
+1
public function k($heh) {
return ($heh == "") ? rand() : $heh;
}
// ...
$stars += count(array_intersect(
array($this->k($this->id_type), $this->k($this->id_type2), $this->k($this->id_type3)),
array($this->k($that->id_type), $this->k($that->id_type2), $this->k($that->id_type3))
));
// ...
не учитываем пустые id_type