if(wyraz.charAt(i) <"A"
&& wyraz.charAt(i) != "-"
&& wyraz.charAt(i) != " "
&& wyraz.charAt(i) != "."
&& wyraz.charAt(i) != "&"
&& wyraz.charAt(i) != "_"
&& wyraz.charAt(i) != "\""
&& wyraz.charAt(i) != "'"
) {
if(polska_litera(wyraz.charAt(i) ) == 0 )
return NO;
}
if(wyraz.charAt(i) >"Z"
&& wyraz.charAt(i) != "-"
&& wyraz.charAt(i) != " "
&& wyraz.charAt(i) != "."
&& wyraz.charAt(i) != "&"
&& wyraz.charAt(i) != "_"
&& wyraz.charAt(i) != "\""
&& wyraz.charAt(i) != "'"
)
Just PKP :)
> var x = 3;
> '5' + x - x
50
> '5' - x + x
5 // Because fuck math
JS is simply. Oh, wait...
$("#search-submit").click(function() {
$("#search form").submit()
});
type="submit"
is too mainstream, jquery is the proper way to do it
var query = $("#search-query");
query.click(function() {
if (query.val() == 'szukaj...') {
query.val('');
}
});
> const today = new Date(2016, 7, 7)
undefined
> const tomorrow = new Date(2016, 7, 8)
undefined
> tomorrow >= today
true
> today <= tomorrow
true
> today == tomorrow
false
function focused(evt, errors) {
let form = evt.target
const output = errors.map((error)=> {
// Find first component with error on form and set focus to it
let focusedInput = (Object.keys(error) == "phonebookId") ? Object.keys(error) :
(Object.keys(error) == "phonebook_str") ? Object.keys(error) :
(Object.keys(error) == "message") ? Object.keys(error) :
(Object.keys(error) == "image") ? Object.keys(error) :
(Object.keys(error) == "buttonLink") ? Object.keys(error) :
(Object.keys(error) == "messageSms") ? Object.keys(error) : false
return focusedInput.shift()
})
const selector = output.shift()
form.querySelector('[id="' + selector + '"]').focus()
return selector
}
What can I say... If you plan to work with freelancers with low rate then you should be ready to find it in them code :)
var None = null;
if ({{ post.pk }} == None) {
// reset to draft
$("#id_status")[0].value = 1;
}
var u = "Browser";
if (this.isIPad) {
u = "iPad"
} else {
if (this.isDDGIgnore) {
u = "Ignore"
} else {
if (/seamonkey/.test(x)) {
u = "SeaMonkey"
} else {
if (/iceape/.test(x)) {
u = "Iceape"
} else {
if (/palemoon/.test(x)) {
u = "PaleMoon"
} else {
if (this.isFirefox) {
u = "Firefox"
} else {
if (this.isAndroid) {
u = "Android"
} else {
if (/xbox/.test(x)) {
u = "xBox"
} else {
if (/midori/.test(x)) {
u = "Midori"
} else {
if (/opr/.test(x)) {
u = "Opera"
} else {
if (/maxthon/.test(x)) {
u = "Maxthon"
} else {
if (this.isYandex) {
u = "Yandex"
} else {
if (/vivaldi/.test(x)) {
u = "Vivaldi"
} else {
if (this.isChrome) {
u = "Chrome"
} else {
if (/fennec/.test(x)) {
u = "Fennec"
} else {
if (/epiphany/.test(x)) {
u = "Epiphany"
} else {
if (this.isFirefox) {
u = "Firefox"
} else {
if (/uzbl/.test(x)) {
u = "Uzbl"
} else {
if (this.isEdge) {
u = "Edge"
} else {
if (this.isIE && navigator.platform === "Win64" && !k() && Modernizr.touch && document.documentElement.clientWidth == screen.width) {
u = "IEMetro"
} else {
if (this.isIE) {
u = "IE"
} else {
if (this.isOpera) {
u = "Opera"
} else {
if (this.isIPhone) {
u = "iPhone"
} else {
if (/arora/.test(x)) {
u = "Arora"
} else {
if (this.isSafari) {
u = "Safari"
} else {
if (this.isKonqueror) {
u = "Konqueror"
} else {
if (this.isBlackberry) {
u = "Blackberry"
} else {
if (/phantomjs/.test(x)) {
u = "PhantomJS"
} else {
if (this.isIDevice) {
u = "iOS"
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
Found when looking at facebook.com code and formatting using google chrome developer tools.
if(
(!_.isEmpty($(switcher).val()) && value_isnt == ":empty") ||
((value_isnt) && !$(switcher).is(value_isnt) && value_isnt != ':empty') ||
(value_is && $(switcher).is(value_is) && value_is != ':empty') ||
(value_is == ':empty' && _.isEmpty($(switcher).val())) ||
(value && _switcherValue == value) ||
(valueIn && .anyMatchInArray(valueIn.split(','), .flatten([_switcherValue]))) ||
(valueOut && !.anyMatchInArray(valueOut.split(','), .flatten([_switcherValue])))
)
(this.router.state['view']['data'] || {})['menuOpen'] && this.router.navigateBack();
That's how pros are javascripting
var show = true;
function toggleShow(){
if(show === true){
show = false;
return show;
}else{
show = true;
return show;
}
}
return show = !show
, dude...
let showDots = typeof project.showDots === 'boolean' ? project.showDots : false;
if (showDots) {
// Somecode ...
}
Why, just why??
if (currentDay.day() !== MONDAY) {
do {
currentDay = this.$moment(currentDay).subtract(1, 'days');
days.unshift(currentDay);
} while (currentDay.day() !== MONDAY);
}
if(date.getFullYear() <= 2017) {
if(date.getMonth() <= 11) {
if(date.getDate() <= 26) {
if(date.getHours() <= 23) {
if(date.getMinutes() <= 59) {
if(date.getSeconds() <= 59) {
//Display popup before 2017-11-27
}
}
}
}
}
}
$scope.$$childHead.$$nextSibling.$$nextSibling.$$nextSibling.$$nextSibling.$$nextSibling.$$nextSibling.$$nextSibling.$$nextSibling.$$nextSibling.$$nextSibling.$$nextSibling.$$nextSibling.$$nextSibling.$$nextSibling.$$nextSibling.$$nextSibling.$$nextSibling.$$nextSibling.$$nextSibling.$$nextSibling.$$nextSibling.$$nextSibling.$$nextSibling.$$nextSibling
Was trying to find a very specific text box and as an AngularJS noob, this was the only way I could find it at first. I eventually figured out how to not do this before it ever got committed to production though. :)