/*jslint browser: true, devel: true, sloppy: true, plusplus: true, nomen: true, forin: true, continue: true */\r
/*globals kiwi, $, _, Tabview, Userlist, User, Box */\r
+/**\r
+* @namespace\r
+*/\r
kiwi.front.ui = {\r
\r
+ /**\r
+ *\r
+ */\r
doLayoutSize: function () {\r
var kiwi, toolbars, ul, n_top, n_bottom, nl;\r
kiwi = $('#kiwi');\r
nl.css({top: n_top + 'px', bottom: n_bottom + 'px', left: $(document).width() - ul.outerWidth(true)});\r
},\r
\r
-\r
+ /**\r
+ *\r
+ */\r
doLayout: function () {\r
$('#kiwi .msginput .nick a').text(kiwi.gateway.nick);\r
$('#kiwi_msginput').val(' ');\r
$('#kiwi_msginput').focus();\r
},\r
\r
-\r
+ /**\r
+ * Binds keyboard and mouse events to handlers\r
+ */\r
registerKeys: function () {\r
var tabcomplete = {active: false, data: [], prefix: ''};\r
$('#kiwi_msginput').bind('keydown', function (e) {\r
\r
},\r
\r
-\r
+ /**\r
+ * Prompts user for a new nick\r
+ */\r
showChangeNick: function (caption) {\r
caption = (typeof caption !== 'undefined') ? caption : '';\r
\r
},\r
\r
\r
-\r
+ /**\r
+ * Displays the current channel's topic in the topic bar\r
+ */\r
setTopicText: function (new_topic) {\r
kiwi.front.cache.original_topic = new_topic;\r
$('#kiwi .cur_topic .topic').text(new_topic);\r
\r
\r
\r
-\r
+ /**\r
+ * \r
+ */\r
tabviewsNext: function () {\r
var wl = $('#kiwi .windowlist ul'),\r
next_left = parseInt(wl.css('text-indent').replace('px', ''), 10) + 170;\r
wl.css('text-indent', next_left);\r
},\r
\r
+ /**\r
+ *\r
+ */\r
tabviewsPrevious: function () {\r
var wl = $('#kiwi .windowlist ul'),\r
next_left = parseInt(wl.css('text-indent').replace('px', ''), 10) - 170;\r
wl.css('text-indent', next_left);\r
},\r
\r
+ /**\r
+ * Displays the next tab\r
+ */\r
windowsNext: function () {\r
var tab, tabs, curTab, next;\r
next = false;\r
}\r
},\r
\r
+ /**\r
+ * Displays the previous tab\r
+ */\r
windowsPrevious: function () {\r
var tab, tabs, curTab, prev_tab, next;\r
next = false;\r
}\r
},\r
\r
+ /**\r
+ * Shows a specific tab\r
+ * @param {Number} num The index of the tab to show\r
+ */\r
windowsShow: function (num) {\r
num = parseInt(num, 10);\r
console.log('Showing window ' + num.toString());\r
},\r
\r
\r
-\r
+ /**\r
+ * \r
+ */\r
barsShow: function () {\r
$('#kiwi .control').slideDown();\r
$('#kiwi .toolbars').slideDown(400, function () {\r
});\r
},\r
\r
+ /**\r
+ *\r
+ */\r
barsHide: function () {\r
$('#kiwi .control').slideUp();\r
$('#kiwi .toolbars').slideUp(400, function () {\r
\r
\r
\r
-\r
+ /**\r
+ * Displays the tutorial\r
+ */\r
tutorial: function () {\r
var b = $('<div id="tutorial_box" style="border:3px solid blue;"></div>'),\r
bounds,\r
b.css({display: 'block', position: 'absolute', height:'100%', width:'100%'});\r
$('#kiwi').append(b);\r
\r
+ /**\r
+ * @inner\r
+ */\r
bounds = function (el) {\r
var b = 3, ret = {};\r
ret.top = el.offset().top;\r
\r
\r
current_s = -1;\r
+ /**\r
+ * @inner\r
+ */\r
next_s = function () {\r
current_s++;\r
if (typeof s[current_s] === 'function') {\r