<?php
-$a->theme_info = array();
function duepuntozero_init(&$a) {
+
+set_template_engine($a, 'smarty3');
+
+ $colorset = get_pconfig( local_user(), 'duepuntozero','colorset');
+ if (!$colorset)
+ $colorset = get_config('duepuntozero', 'colorset'); // user setting have priority, then node settings
+ if ($colorset) {
+ if ($colorset == 'greenzero')
+ $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/greenzero.css" type="text/css" media="screen" />'."\n";
+ if ($colorset == 'purplezero')
+ $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/purplezero.css" type="text/css" media="screen" />'."\n";
+ if ($colorset == 'easterbunny')
+ $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/easterbunny.css" type="text/css" media="screen" />'."\n";
+ if ($colorset == 'darkzero')
+ $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/darkzero.css" type="text/css" media="screen" />'."\n";
+ if ($colorset == 'comix')
+ $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/comix.css" type="text/css" media="screen" />'."\n";
+ if ($colorset == 'slackr')
+ $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/duepuntozero/deriv/slackr.css" type="text/css" media="screen" />'."\n";
+ }
$a->page['htmlhead'] .= <<< EOT
<script>
function insertFormatting(comment,BBcode,id) {
$("#comment-edit-text-" + id).addClass("comment-edit-text-full");
$("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
openMenu("comment-edit-submit-wrapper-" + id);
- }
+ $("#comment-edit-text-" + id).val(tmpStr);
+ }
textarea = document.getElementById("comment-edit-text-" +id);
if (document.selection) {
return true;
}
-function cmtBbOpen(id) {
- $(".comment-edit-bb-" + id).show();
+function cmtBbOpen(comment, id) {
+ if($(comment).hasClass('comment-edit-text-full')) {
+ $(".comment-edit-bb-" + id).show();
+ return true;
+ }
+ return false;
}
-function cmtBbClose(id) {
- $(".comment-edit-bb-" + id).hide();
+function cmtBbClose(comment, id) {
+// if($(comment).hasClass('comment-edit-text-empty')) {
+// $(".comment-edit-bb-" + id).hide();
+// return true;
+// }
+ return false;
}
$(document).ready(function() {