tag:blogger.com,1999:blog-84407837678536244322024-03-08T07:10:42.057-08:00ogunogunhttp://www.blogger.com/profile/13809274138647763617noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-8440783767853624432.post-79744670707173280052016-07-22T08:11:00.001-07:002016-07-22T08:12:11.832-07:00Adding Tab in PhotonKit, and skin for electron<div dir="ltr" style="text-align: left;" trbidi="on">
Resources required:<br />
1.</div>
ogunhttp://www.blogger.com/profile/13809274138647763617noreply@blogger.com0tag:blogger.com,1999:blog-8440783767853624432.post-57116303322497620712016-07-10T02:11:00.001-07:002016-07-10T02:11:13.317-07:00Which method will be called?<p>experimenting javascript on method overload</p> <p><!doctype html></p> <p><html></p> <p><body><table><tr onclick=”hello(this);”><td>56</td></tr></table></body></p> <p><script><br> 'use strict'<br>function hello(control){<br> console.log('Overloaded');<br> //console.log(control.tagName);<br>}</p> <p>function hello(controla, controlb){<br> console.log('Overloaded ha ha ha');<br> //console.log(control.tagName);<br>}<br>function hello(){<br> console.log(arguments);<br> //console.log(control.tagName);<br>}<br></script></p> <p></html></p> <p>Interesting Result:</p> <p>Method which ever is declared/written in last is called.</p> <p>try to change the sequence and run it.</p> <p>would like to know the reason, please leave reason in comment </p>ogunhttp://www.blogger.com/profile/13809274138647763617noreply@blogger.com0tag:blogger.com,1999:blog-8440783767853624432.post-88095675631894197332016-07-03T12:33:00.001-07:002016-07-27T08:10:19.112-07:00Localize electron desktop app using i18next<div dir="ltr" style="text-align: left;" trbidi="on">
<strong>Requirement: </strong>3 jquery library<br />
1. jquery3.0.0.js or latest<br />
2. i18next-1.6.3.min.js or latest<br />
3. localizeit.js (customize scripts code)<br />
localizeit.js Content:<br />
<span style="background-color: lime;">//starts</span><br />
window.i18n = require('./js/i18next-1.6.3.min.js');<br />
var resources = {<br />
"pt": {<br />
"translation": {<br />
"title": "Título",<br />
"put":"colocar",<br />
"language":"<span style="background-color: white; color: #545454; font-family: "arial" , sans-serif; font-size: x-small; line-height: 18.2px;">português</span>"<br />
}<br />
},<br />
"fr": {<br />
"translation": {<br />
"title": "Titre",<br />
"put":"mettre",<br />
"language":"<span style="background-color: white; color: #545454; font-family: "arial" , sans-serif; font-size: x-small; line-height: 18.2px;">français</span>"<br />
}<br />
},<br />
"hi": {<br />
"translation": {<br />
"title": "नाम",<br />
"put":"पुट",<br />
"language":"हिन्दी"<br />
}<br />
},<br />
"en": {<br />
"translation": {<br />
"title": "title of the page", <br />
"put": "Put",<br />
"language":"English"<br />
}<br />
}<br />
};<br />
<br />
//for default language<br />
$(document).ready(function () {<br />
i18n.init({<br />
"lng": 'hi',<br />
"resStore": resources,<br />
"fallbackLng" : 'en'<br />
}, function (t) {<br />
$(document).i18n();<br />
});<br />
<br />
$('.lang').click(function () {<br />
var lang = $(this).attr('data-lang');<br />
i18n.init({<br />
lng: lang<br />
}, function (t) {<br />
$(document).i18n();<br />
});<br />
});<br />
});<br />
<span style="background-color: lime;">//ends</span><br />
index.html Content<br />
<!doctype html><br />
<html> <br />
<head><br />
<meta charset="UTF-8"><!--mandatory--> <br />
<br />
<!--In Electron way--><br />
<script>window.$ = window.jQuery = require('./js/jquery.min.js');</script><br />
<script src="./js/i18next-1.6.3.min.js"></script><br />
<script src="./js/localize.js"></script><br />
</head><br />
<body><br />
<div data-i18n="title"></div><br />
<div data-i18n="put"></div><br />
<button class="lang" data-lang="en">Eng</button><br />
<button class="lang" data-lang="hi">Hindi</button><br />
<button class="lang" data-lang="fr"><span style="background-color: white; color: #545454; font-family: "arial" , sans-serif; font-size: x-small; line-height: 18.2px;">français</span></button><br />
<button class="lang" data-lang="pt"><span style="background-color: white; color: #6a6a6a; font-family: "arial" , sans-serif; font-size: x-small; font-weight: bold; line-height: 18.2px;">Portuguese</span></button><br />
</body><br />
<br />
</html><br />
<br />
this is a basic implementation, language resources can be read from external json file.(Best practice). Visit <a href="http://www.i18next.com/" target="_blank">i18next</a> for more implementation details.<br />
Once your above code execute without error, you may just provide link to above 3 scripts in any .html page, and it will localize it, dont forget to declare the key declaration in resource variable.<br />
<br />
Use <a href="http://www.google.com/inputtools/try/" target="_blank">Google Input tool</a> to translate Language<br />
<br />
Happy Coding!</div>
ogunhttp://www.blogger.com/profile/13809274138647763617noreply@blogger.com1tag:blogger.com,1999:blog-8440783767853624432.post-89573739379681813032016-07-02T07:11:00.003-07:002016-07-02T07:21:05.746-07:00when technology meets fashion<div dir="ltr" style="text-align: left;" trbidi="on">
1. <a href="http://www.lookseelabs.com/#infinitepossibilities" rel="nofollow">Fashion and technology</a></div>
ogunhttp://www.blogger.com/profile/13809274138647763617noreply@blogger.com0tag:blogger.com,1999:blog-8440783767853624432.post-71429930147017938972016-07-02T07:10:00.004-07:002016-07-02T10:04:48.363-07:00must watch videos<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<iframe width="320" height="266" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/b0kHh-VuQA4/0.jpg" src="https://www.youtube.com/embed/b0kHh-VuQA4?feature=player_embedded" frameborder="0" allowfullscreen></iframe></div>
<br /></div>
ogunhttp://www.blogger.com/profile/13809274138647763617noreply@blogger.com0tag:blogger.com,1999:blog-8440783767853624432.post-86762475496600251382016-07-02T07:10:00.001-07:002016-07-02T07:10:07.180-07:00how to be productive?<div dir="ltr" style="text-align: left;" trbidi="on">
<br /></div>
ogunhttp://www.blogger.com/profile/13809274138647763617noreply@blogger.com0