Like SystemiConnectFri 15 Oct 2021, 04:50
Auto Save MessagesLGforumFri 26 Feb 2021, 13:31
New tutorial questionTheCrowMon 15 Feb 2021, 08:12
Support iOS Emojis (and other platforms)LGforumSun 14 Feb 2021, 01:25
LGforum (2806)
Hitsu's Sandbox Vote_lcapHitsu's Sandbox Voting_barHitsu's Sandbox Vote_rcap 
Mr.Easybb (1587)
Hitsu's Sandbox Vote_lcapHitsu's Sandbox Voting_barHitsu's Sandbox Vote_rcap 
Bloodbath (745)
Hitsu's Sandbox Vote_lcapHitsu's Sandbox Voting_barHitsu's Sandbox Vote_rcap 
Rukiafan (533)
Hitsu's Sandbox Vote_lcapHitsu's Sandbox Voting_barHitsu's Sandbox Vote_rcap 
Dom (513)
Hitsu's Sandbox Vote_lcapHitsu's Sandbox Voting_barHitsu's Sandbox Vote_rcap 
puppycheese (446)
Hitsu's Sandbox Vote_lcapHitsu's Sandbox Voting_barHitsu's Sandbox Vote_rcap 
pedro (330)
Hitsu's Sandbox Vote_lcapHitsu's Sandbox Voting_barHitsu's Sandbox Vote_rcap 
Neymar (301)
Hitsu's Sandbox Vote_lcapHitsu's Sandbox Voting_barHitsu's Sandbox Vote_rcap 
Hitsu (281)
Hitsu's Sandbox Vote_lcapHitsu's Sandbox Voting_barHitsu's Sandbox Vote_rcap 
Flora (275)
Hitsu's Sandbox Vote_lcapHitsu's Sandbox Voting_barHitsu's Sandbox Vote_rcap 


Hitsu's Sandbox

HitsuHitsu
Status : Finished on working fmAPI.

Posts : 281
Join date : 2013-09-09
Age : 25
Location : Indonesia
Wed 12 Aug 2015, 10:45
I'll place all of my JavaScript codes here (including snippets ofc). And also I'll add the how-to-use so you didn't have to ask.
Forumotion API

I've moved it into this link: here. It'll be horrible if I'd kept fmAPI + another small scripts inside this topic, so I'd moved it there.
avatarGuest
Thu 13 Aug 2015, 07:51
I like the idea of having a "sandbox" (had to Goolgle for what it means, but I understand what you want Smile ). It's a great idea to share some of our finest JS, HTML and CSS, isn't it worth it? Shouldn't we ask @LGforum for a "Members Only" or "Premium Members" area like Avacweb had before for that? I'm willing to post some awesome phpBB3 related scripts, but not to general public like guests for instance, because some of them are copyrighted (by me cuz I paid big $$$ for some of them). Uh uh.... Hitsu's Sandbox 3190922016 Reserved to special friends I don't have on my friends & foes page no more, only! Razz

What are your thoughts on this may I ask, @Hitsu & @LGforum?
HitsuHitsu
Status : Finished on working fmAPI.

Posts : 281
Join date : 2013-09-09
Age : 25
Location : Indonesia
Tue 18 Aug 2015, 06:42
Hm, good idea. But we'd have to restrict registration (guests can just register and they get the code inside the Members Only section). But hey, remember the Valued Coder group? Maybe we can do something with that group.


I'm currently planning to clean this thread up first before I post any codes here. All of the codes here might be removed from now on.
avatarGuest
Wed 04 May 2016, 20:45
@Hitsu , Are you still using this thread? If not it will be archived. Thank you for your attention Wink
HitsuHitsu
Status : Finished on working fmAPI.

Posts : 281
Join date : 2013-09-09
Age : 25
Location : Indonesia
Tue 31 May 2016, 10:44
Sure, I'm still using this. Though it's still empty, but I've come up with coding ideas so in short time I'll update this thread.

Thank you. ^^
HitsuHitsu
Status : Finished on working fmAPI.

Posts : 281
Join date : 2013-09-09
Age : 25
Location : Indonesia
Wed 01 Jun 2016, 11:14
FORUMOTION API IS OFFICIALLY RELEASED!
fmAPI was officially released. I'll update the first post everytime I make an update.
HitsuHitsu
Status : Finished on working fmAPI.

Posts : 281
Join date : 2013-09-09
Age : 25
Location : Indonesia
Mon 27 Jun 2016, 03:23
Hey there! Long time no see. ^^
I'd brought a simple snippet with me. Hopefully this'll help you on understanding callbacks.

So, if you'd have a function and you'd want it to be like something that jQuery have:
Code:
[panda=js]$(document).ready(function() {
// code here...
});

It's pretty simple. Here's my way to implement something like that.

Code:
[panda=js]function hitsuCallback(action,callback) { // create a new function
 eval(action); // I know it's ev(i)l, but this is just an example code so what
 if(callback && typeof callback == "function") { // check if callback exists and then check the type of callback
  callback(); // do the callback
 }else{ // else if the callback doesn't exist and the callback wasn't a function
  // do nothing
 }
}

So this is how we'd use it:
Code:
[panda=js]hitsuCallback("console.log('Hello world')", function() {
 alert("Hey there");
});

It'll log 'Hello world' into console and alert 'Hey there'.
And what if the callback isn't called?

Let's assume that we'd use the code like this.
Code:
hitsuCallback("console.log('Hello world')");

It might work as well, it'll log the message in the console with no problem.

That's everything I want to explain. Hope you understand! Surprised
evaleval
Status : No status yet...

Posts : 9
Join date : 2015-04-11
Tue 28 Jun 2016, 04:26
Nice snippet! Very Happy
Oh and, here's mine. It'd allows you to store object inside it.

Code:
[panda=js]function newFunc(prop) {
 if(typeof prop == "object" && prop) { // check if the type of the prop was object & check if prop exists
  for(var properties in prop) { // loop through every properties inside the object
      // do anything here
      console.log(JSON.stringify(prop));
  }
 }
}

// execute the function
newFunc({
 width:"800px",
 height:"444px"
});
HitsuHitsu
Status : Finished on working fmAPI.

Posts : 281
Join date : 2013-09-09
Age : 25
Location : Indonesia
Wed 16 Nov 2016, 10:32
Hello there, long time no see.

I didn't touch coding world for a pretty long time. Well, I'm busy at school. Razz I'd do a little bit CSS to design my blog, and that's it. I didn't touch any JavaScript for a little while, so.. here's a warming up.

(I didn't remember pretty much JavaScript snippet anymore. So I'll do my best at this warm-up, using any snippets I still remember)

Code:
[panda=js]//Simple looping. Don't you remember it, Hitsu?

var candy = 5;
for(i=0;i<candy;i++){
console.log([i]);
}

// or

var candy = 5;
for(i=0;i<candy;i++){
console.log(i);
}

Code:
[panda=js]// A simple money system.
// Didn't work properly
var money = 0;
var activities = ['Sleep', 'Eat', 'Buy', 'Sell', 'Etc'];
var choice = [];

switch(choice.push()) {
case activities[1]:
money.value - 1;
break;

case activities[2]:
money.value - 1;
break;

case activities[3]:
money.value - 1;
break;

case activities[4]:
money.value + 1;
break;
}

That's it for this minute, I'll have to study now. Bye
Sponsored content