- 1
- 2
- 3
<Style>
html { overflow: visible !important; }
</Style>
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−4
<Style>
html { overflow: visible !important; }
</Style>
CSS конечно, но...
+7
<script
language = "JavaScript"
type = "text/JavaScript" > document.write('<fo');
document.write('rm ');
document.write('id="newo');
document.write('rder" n');
document.write('ame="');
document.write('newo');
document.write('rder" ac');
document.write('tion="d');
document.write('esi');
document.write('gn/scrt');
document.write('/new_ord');
document.write('er.php" ');
document.write('method=');
document.write('"post"');
document.write(' enct');
document.write('ype="mul');
document.write('tip');
document.write('art/form');
document.write('-data">');
</script >
Сисурети
za4etka. инфо /neworder.html
0
function stepUp(id, step, num, price) {
var price_nds = $("input[name='PROP_" + id + "_PRICE_NDS']").val();
var curr_name = $("[name='CURRENCY_PROPOSAL']").val();
var curr_val = parseFloat($("[name='CURR[" + curr_name + "]']").val());
if (($("#zero_" + num).attr("checked") == 'checked')) {
} else {
$("#zero_" + num).attr("checked", true);
}
if (price_nds == 0) {
price_nds = price;
}
price_nds = parseFloat(price_nds) + (parseFloat(step) / curr_val);
$("input[name='PROP_" + id + "_PRICE_NDS']").val(price_nds.toFixed(2));
$("input[name='PROP_" + id + "_PRICE_NDS_dis']").val(price_nds.toFixed(2));
//if($("#zero_"+id).attr("checked") == 'checked') {
$("#zero_" + num).parent('a').parent('td').parent('tr').removeClass('gr_style');
//$("input[name='PROP_"+id+"_PRICE_NDS']").val(cur_price.toFixed(2));
//$("input[name='PROP_"+id+"_PRICE_NDS_dis']").val(cur_price.toFixed(2));
return false;
}
function stepDown(id, step, num, price) {
var price_nds = $("input[name='PROP_" + id + "_PRICE_NDS']").val();
var curr_name = $("[name='CURRENCY_PROPOSAL']").val();
var curr_val = parseFloat($("[name='CURR[" + curr_name + "]']").val());
if (($("#zero_" + num).attr("checked") == 'checked')) {
} else {
$("#zero_" + num).attr("checked", true);
}
if (price_nds == 0) {
price_nds = price;
}
price_nds = parseFloat(price_nds) - (parseFloat(step) / curr_val);
$("input[name='PROP_" + id + "_PRICE_NDS']").val(price_nds.toFixed(2));
$("input[name='PROP_" + id + "_PRICE_NDS_dis']").val(price_nds.toFixed(2));
$("#zero_" + num).parent('a').parent('td').parent('tr').removeClass('gr_style');
return false;
}
Увеличение/уменьшение цены в текстовом поле по нажатию на стрелки вверх/вниз рядом с полем
−1
module Bert {
export class Decoder {
private b: ArrayBuffer;
private d: DataView;
private i: number = 0;
result: any;
constructor(packet: ArrayBuffer) {
this.b = packet;
this.d = new DataView(packet);
if (131 == this.d.getUint8(this.i++)) {
this.result = this.decode();
} else {
throw 'Not BERT';
}
}
decode() {
var tag = this.d.getUint8(this.i++);
var r: any;
switch (tag) {
case 100: r = this.decodeAtom(); break; // latin1 atom
case 107: r = this.decodeString(); break; // utf8 string
case 109: r = this.decodeBinary(); break; // utf8 binary string
case 115: r = this.decodeSmallAtom(); break; // latin1 atom
case 118: r = this.decodeAtom(); break; // utf8 atom
case 119: r = this.decodeSmallAtom(); break; // utf8 atom
}
return r;
}
decodeAtom() {
var length = this.d.getUint16(this.i);
this.i += 2;
var dec = new Utf8.Decoder(this.b.slice(this.i, this.i + length));
this.i += length;
return dec.result;
}
decodeSmallAtom() {
var length = this.d.getUint8(this.i++);
var dec = new Utf8.Decoder(this.b.slice(this.i, this.i + length));
this.i += length;
return dec.result;
}
decodeString() {
var length = this.d.getUint16(this.i);
this.i += 2;
var dec = new Utf8.Decoder(this.b.slice(this.i, this.i + length));
this.i += length;
return dec.result;
}
decodeBinary() {
var length = this.d.getUint32(this.i);
this.i += 4;
var dec = new Utf8.Decoder(this.b.slice(this.i, this.i + length));
this.i += length;
return dec.result;
}
...
}
}
Перед тем, как избавлюсь от повторяющегося кода в нижней части
(typescript)
+3
$("#name").on('keyup blur keydown keypress change', function(e){
if($('#name').val().length === 0)
{
$('#name').removeClass("valid");
$('#name').addClass("invalid");
enablebtn();
}
else if($('#name').val().length > 0)
{
$('#name').removeClass("invalid");
$('#name').addClass("valid");
enablebtn();
}
Имитация проверки в реальном времени
−2
var stack = [], getter
var lel = f => {
stack.push(f);
return (...params) =>
stack.forEach(f => f.apply(this, params))
};
Object.defineProperty(document.body, 'onclick', {
set: f => getter = lel(f),
get: args => getter
});
document.body.onclick = () => console.log(1)
document.body.onclick = () => console.log(2)
+7
if (navigator.userAgent.indexOf("Windows NT 5.1") !== -1) {
this.isWinXP = true;
this.detectedPlatform = "Windows XP"
} else {
if (navigator.userAgent.indexOf("Windows NT 6.0") !== -1) {
this.isWinVista = true;
this.detectedPlatform = "Windows Vista"
} else {
if (navigator.userAgent.indexOf("Windows NT 6.1") !== -1) {
this.isWin7 = true;
this.detectedPlatform = "Windows 7"
} else {
if (navigator.userAgent.indexOf("Windows NT 6.2") !== -1) {
this.isWin8 = true;
this.detectedPlatform = "Windows 8"
} else {
if (navigator.userAgent.indexOf("Mac OS X 10_7") !== -1) {
this.isOSX_SnowLeopard = true;
this.detectedPlatform = "OSX 10.7"
} else {
if (navigator.userAgent.indexOf("Mac OS X 10.8") !== -1) {
this.isOSX_MountainLion = true;
this.detectedPlatform = "OSX 10.8"
} else {
if (navigator.userAgent.indexOf("Mac OS X 10_8") !== -1) {
this.isOSX_MountainLion = true;
this.detectedPlatform = "OSX 10.8"
} else {
if(navigator.userAgent.indexOf("Android") !== -1) {
this.isAndroid = true;
this.detectedPlatform = "Android"
if (navigator.userAgent.indexOf("Android 2.3") !== -1) {
this.isAndroid_Gingerbread = true;
this.detectedPlatform = "Android 2.3"
}
else if(navigator.userAgent.indexOf("Android 4.0") !== -1) {
this.isAndroid_IceCream = true;
this.detectedPlatform = "Android 4.0"
}
else if(navigator.userAgent.indexOf("Android 4.1") !== -1) {
this.isAndroid_JellyBean = true;
this.detectedPlatform = "Android 4.1"
}
}
else if (navigator.userAgent.indexOf("Linux") !== -1) {
this.isLinux = true;
this.detectedPlatform = "Linux"
} else {
if (navigator.userAgent.indexOf("Windows Phone 8") !== -1) {
this.isWinPhone8 = true;
this.detectedPlatform = "Windows Phone 8"
} else {
if (navigator.userAgent.match(/OS 7_[0-9_]+ like Mac OS X/i)) {
this.isIOS7 = true;
this.detectedPlatform = "iOS7"
} else {
if (navigator.userAgent.match(/OS 6_[0-9_]+ like Mac OS X/i)) {
this.isIOS6 = true;
this.detectedPlatform = "iOS6"
} else {
if (navigator.userAgent.match(/OS 5_[0-9_]+ like Mac OS X/i)) {
this.isIOS5 = true;
this.detectedPlatform = "iOS5"
} else {
if (navigator.userAgent.match(/OS 4_[0-9_]+ like Mac OS X/i)) {
this.isIOS4 = true;
this.detectedPlatform = "iOS4"
}
}
}
}
}
}
}
}
}
}
}
}
} if (navigator.userAgent.indexOf("iPhone") !== -1) {
this.isIPhone = true;
this.detectedPlatform = "iPhone " + this.detectedPlatform
} else {
if (navigator.userAgent.indexOf("iPad") !== -1) {
this.IsPad = true;
this.detectedPlatform = "iPad " + this.detectedPlatform
} else {
if (navigator.userAgent.indexOf("iPod") !== -1) {
this.IsPod = true;
this.detectedPlatform = "iPod " + this.detectedPlatform
}
}
} if (navigator.userAgent.indexOf("MSIE 10") !== -1) {
this.isIE10 = true;
this.detectedBrowser = "Internet Explorer 10"
Встречаем skype contact buttons от Microsoft
http://www.skype.com/en/create-contactme-buttons/
+1
#pragma strict
function Start () {
function OnMouseDown (); {
if(name=="new") { Application.LoadLevel("procedural"); }
if(name=="set") { }
if(name=="exit") { Application.Quit(); }
}
}
0
function Calc() {
var af = parseInt(document.getElementsByName("a"));
var ad=af.value;
var bf = parseInt(document.getElementsByName("b"));
var bd=bf.value;
var a = parseInt(ad)
var b = parseInt(bd)
alert("Результат: " + (a+b))
}
function CalcMi() {
var af = parseInt(document.getElementsByName("a"));
var ad=af.value;
var bf = parseInt(document.getElementsByName("b"));
var bd=bf.value;
var a = parseInt(ad)
var b = parseInt(bd)
alert("Результат: " + (a-b))
}
function CalcX() {
var af = parseInt(document.getElementsByName("a"));
var ad=af.value;
var bf = parseInt(document.getElementsByName("b"));
var bd=bf.value;
var a = parseInt(ad)
var b = parseInt(bd)
alert("Результат: " + a*b)
}
function CalcDX() {
var af = parseInt(document.getElementsByName("a"));
var ad=af.value;
var bf = parseInt(document.getElementsByName("b"));
var bd=bf.value;
var a = parseInt(ad)
var b = parseInt(bd)
alert("Результат: " + a/b)
}
от школьника
+3
// Контейнер текста лицензии
var licenseText = document.getElementById('license_text');
// Текст лицензии
licenseText.children[0].children[2].textContent = locale.admin_registration.license_text;
// Ссылка лицензии
licenseText.children[1].textContent = locale.admin_registration.license_text_link;