Difference between revisions of "Widget"

From Mibbit Wiki
Jump to: navigation, search
Line 13: Line 13:
 
* channel - A '''single''' channel that the user will be directed to.
 
* channel - A '''single''' channel that the user will be directed to.
 
* server - This defaults to irc.mibbit.com. You can avoid the connect-form if you have authorized your server (see [http://mibbit.blogspot.com/2008/03/widget-connects-to-any-server.html blog]).
 
* server - This defaults to irc.mibbit.com. You can avoid the connect-form if you have authorized your server (see [http://mibbit.blogspot.com/2008/03/widget-connects-to-any-server.html blog]).
 +
* settings - Unique settings ID for an account on Mibbit.com. See [[Widget#Widget_Configuration|Widget Configuration]]
 
* userListWidth - The width of the user list in pixels
 
* userListWidth - The width of the user list in pixels
 
* noServerTab - True by default, if you set this to false, you will get a server tab, and motd etc goes there.
 
* noServerTab - True by default, if you set this to false, you will get a server tab, and motd etc goes there.
Line 18: Line 19:
 
* noServerMotd - False by default. If true, then motd to the embed channel is not displayed. (Only used if noServerTab==true)
 
* noServerMotd - False by default. If true, then motd to the embed channel is not displayed. (Only used if noServerTab==true)
 
* forcePrompt - False by default. If true, this forces the user to choose a nick and click connect.
 
* forcePrompt - False by default. If true, this forces the user to choose a nick and click connect.
+
* chatOutputShowTimes - False by default. If true, shows times of the messages
chatOutputShowTimes = false
+
* showJoinsParts - False by default. If true, shows when users enter or leave the channel
showJoinsParts = false
+
* showAwaysBacks - False by default. If true, shows when users go away and come back
showAwaysBacks = false
 
chatOutputNickWidth = 90
 
focusNewJoins = false
 
  
 +
Example URL:
 +
 +
<code>http://embed.mibbit.com/e/index.html?server=irc.mibbit.com&channel=%23chat</code>
  
 
''Please note you must urlencode all parameters. So #foo becomes %23foo etc.''
 
''Please note you must urlencode all parameters. So #foo becomes %23foo etc.''
  
==Widget Preference Parameters==
+
==Widget Configuration==
What can be set via uri: [[Preference parameters]] , link example:
+
Widget configuration is best done through passing a unique settings ID to the widget. To do this, create an account on Mibbit.com. Then go into the preferences and change the settings to how you want your widget to appear. At the top of the preferences screen there will be a unique ID for your settings (like 7ca12664887d4b6e7a0fa6552f9e0de6). This should be passed to the widget using the <code>&settings=</code> parameter. Example:
 +
 
 +
<code>http://embed.mibbit.com/e/index.html?server=irc.mibbit.com&channel=%23chat&settings=7ca12664887d4b6e7a0fa6552f9e0de6</code>
 +
 
 +
==[[Widget parameters]]==
 +
There are many [[Widget parameters|parameters]] that can be added to the widget by adding them to the URL. For example:
 
    
 
    
 
  <nowiki>
 
  <nowiki>
Line 41: Line 47:
 
  </nowiki>
 
  </nowiki>
  
===Settings ID===
+
View the full list [[Widget parameters|here]]
Additionall you can specify any setting as shown in /dset (deprecated soon). All preferences can also be taken from the setting of a mibbit account: &settings=id (where id is shown on the prefs page), see http://mibbit.blogspot.com/2008/04/this-weeks-updates.html .
 
 
 
"settings" example:  http://embed.mibbit.com/?settings=7ca12664887d4b6e7a0fa6552f9e0de6&channel=%23mibbit (type /dset to view the settings)
 
  
 
==Use the Widget in an Iframe==
 
==Use the Widget in an Iframe==

Revision as of 05:00, 4 May 2008

If you'd like to have webchat on your own website, then you could use a Java applet (slow, ugly, and not very accessible), or you could use Mibbit! example

The first step, is to decide where you want your users to go. You can either create a channel on irc.mibbit.com or if you manage your own irc server, please contact Mibbit and ask for it to be authorized.

The basic URL for the Mibbit Widget is

http://embed.mibbit.com/

The parameters you can pass are:

  • nick - If you do not specify this, a random one will be chosen eg mib_6d7s8euf
  • channel - A single channel that the user will be directed to.
  • server - This defaults to irc.mibbit.com. You can avoid the connect-form if you have authorized your server (see blog).
  • settings - Unique settings ID for an account on Mibbit.com. See Widget Configuration
  • userListWidth - The width of the user list in pixels
  • noServerTab - True by default, if you set this to false, you will get a server tab, and motd etc goes there.
  • noServerNotices - False by default. If true, then notices to the embed channel do not get displayed. (Only used if noServerTab==true)
  • noServerMotd - False by default. If true, then motd to the embed channel is not displayed. (Only used if noServerTab==true)
  • forcePrompt - False by default. If true, this forces the user to choose a nick and click connect.
  • chatOutputShowTimes - False by default. If true, shows times of the messages
  • showJoinsParts - False by default. If true, shows when users enter or leave the channel
  • showAwaysBacks - False by default. If true, shows when users go away and come back

Example URL:

http://embed.mibbit.com/e/index.html?server=irc.mibbit.com&channel=%23chat

Please note you must urlencode all parameters. So #foo becomes %23foo etc.

Widget Configuration

Widget configuration is best done through passing a unique settings ID to the widget. To do this, create an account on Mibbit.com. Then go into the preferences and change the settings to how you want your widget to appear. At the top of the preferences screen there will be a unique ID for your settings (like 7ca12664887d4b6e7a0fa6552f9e0de6). This should be passed to the widget using the &settings= parameter. Example:

http://embed.mibbit.com/e/index.html?server=irc.mibbit.com&channel=%23chat&settings=7ca12664887d4b6e7a0fa6552f9e0de6

Widget parameters

There are many parameters that can be added to the widget by adding them to the URL. For example:

<a href="http://embed.mibbit.com/
?server=irc.freenode.net
&nick=Guest...
&channel=%23mib_chat
&chatOutputShowTimes=true
&needSendButton=true" 
target="_blank">start chat on freenode</a>
 

View the full list here

Use the Widget in an Iframe

Make sure your page has a DTD setup, otherwise IE will not work properly. Place this code at the top of your page: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> Then place this code where you want the chat widget to appear:

<iframe width="600" height="380" scrolling="no" frameborder="0"
 src="http://embed.mibbit.com/?channel=%23my_chat&nick=choose_one">
</iframe>
type /nick to change your Nick name, /help, /cs help,
/ns help, or /ms help for available commands

Be sure to change the server and channel to your chatroom

Use the Widget in a Popup

Place this link in your page to open a popup window for the chat widget

<a href='#freenode/test' onclick='window.open("http://embed.mibbit.com/server=irc.freenode.net&channel=%23test&nick=prefix&chatOutputShowTimes=true","","width=999,height=555")'> Join our chat (popup)</a>

The code must be on one line. Be sure to change the server and channel to your chatroom

Securing your widget

There is also a secure mode of operation, if you wish you channel to be slightly more secure, or do not want anybody able to have a widget pointing at your channel. With this system, you tell us the channel/server, and a password. Then for each url you generate, you must specify a nick (Generate one yourself), and you send over 'key' as a param, equal to md5(nick + ":" + password). This means that unless you know the password, embedding to that channel/server is pretty hard. Additionally you can also specify a channel key if the channel is keyed. Then only people using *your* widget on your site, or people you allow, can enter the channel.