/** * Name: Viereinhalb * Version: 1.2 * Author: Fabio <http://kirgroup.com/profile/fabrixxm> * Author: Ike <http://pirati.ca/profile/heluecht> * Maintainer: Oliver <https://toktan.org/profile/oha> * Description: "Viereinhalb" is a "Vier" variation. It uses the font awesome font library: http://fortawesome.github.com/Font-Awesome/ */ function viereinhalb_init(&$a) { set_template_engine($a, 'smarty3'); $baseurl = $a->get_baseurl(); $a->theme_info = array(); $a->page['htmlhead'] .= <<<EOT <script type="text/javascript"> function insertFormatting(comment,BBcode,id) { \t\tvar tmpStr = \$("#comment-edit-text-" + id).val(); \t\tif(tmpStr == comment) { \t\t\ttmpStr = ""; \t\t\t\$("#comment-edit-text-" + id).addClass("comment-edit-text-full"); \t\t\t\$("#comment-edit-text-" + id).removeClass("comment-edit-text-empty"); \t\t\topenMenu("comment-edit-submit-wrapper-" + id); \t\t\t\$("#comment-edit-text-" + id).val(tmpStr); \t\t} \ttextarea = document.getElementById("comment-edit-text-" +id); \tif (document.selection) { \t\ttextarea.focus(); \t\tselected = document.selection.createRange(); \t\tif (BBcode == "url"){ \t\t\tselected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]"; \t\t\t} else \t\tselected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]"; \t} else if (textarea.selectionStart || textarea.selectionStart == "0") { \t\tvar start = textarea.selectionStart; \t\tvar end = textarea.selectionEnd; \t\tif (BBcode == "url"){ \t\t\ttextarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length); \t\t\t} else \t\ttextarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length); \t} \treturn true; } function showThread(id) { \t\$("#collapsed-comments-" + id).show() \t\$("#collapsed-comments-" + id + " .collapsed-comments").show() } function hideThread(id) { \t\$("#collapsed-comments-" + id).hide() \t\$("#collapsed-comments-" + id + " .collapsed-comments").hide() } function cmtBbOpen(id) { \t\$("#comment-edit-bb-" + id).show(); } function cmtBbClose(id) { \t\$("#comment-edit-bb-" + id).hide(); } </script> EOT; }
function frost_init(&$a) { $a->theme_info = array(); $a->videowidth = 400; $a->videoheight = 330; $a->theme_thread_allow = false; set_template_engine($a, 'smarty3'); }
function decaf_mobile_init(&$a) { $a->theme_info = array(); $a->sourcename = 'Friendica mobile web'; $a->videowidth = 250; $a->videoheight = 200; $a->theme_thread_allow = false; // $a->force_max_items = 10; set_template_engine($a, 'smarty3'); }
function frio_init(&$a) { set_template_engine($a, 'smarty3'); $baseurl = $a->get_baseurl(); $style = get_pconfig(local_user(), 'frio', 'style'); $frio = "view/theme/frio"; global $frio; if ($style == "") { $style = get_config('frio', 'style'); } }
function testbubble_init(&$a) { set_template_engine($a, 'smarty3'); $a->page['htmlhead'] .= <<<EOT <script> \$(document).ready(function() { \$('html').click(function() { \$("#nav-notifications-menu" ).hide(); }); }); </script> EOT; }
function darkbubble_init(&$a) { $a->theme_info = array('extends' => 'testbubble'); set_template_engine($a, 'smarty3'); $a->page['htmlhead'] .= <<<EOT <script> \$(document).ready(function() { \$('html').click(function() { \$("#nav-notifications-menu" ).hide(); }); }); </script> EOT; }
function comix_plain_init(&$a) { $a->theme_info = array('extends' => 'duepuntozero'); set_template_engine($a, 'smarty3'); $a->page['htmlhead'] .= <<<EOT <script> \$(document).ready(function() { \$('html').click(function() { \$("#nav-notifications-menu" ).hide(); }); \$('.group-edit-icon').hover( \tfunction() { \t\t\$(this).addClass('icon'); \$(this).removeClass('iconspacer');}, \tfunction() { \t\t\$(this).removeClass('icon'); \$(this).addClass('iconspacer');} \t); \$('.sidebar-group-element').hover( \tfunction() { \t\tid = \$(this).attr('id'); \t\t\$('#edit-' + id).addClass('icon'); \$('#edit-' + id).removeClass('iconspacer');}, \tfunction() { \t\tid = \$(this).attr('id'); \t\t\$('#edit-' + id).removeClass('icon');\$('#edit-' + id).addClass('iconspacer');} \t); \$('.savedsearchdrop').hover( \tfunction() { \t\t\$(this).addClass('drop'); \$(this).addClass('icon'); \$(this).removeClass('iconspacer');}, \tfunction() { \t\t\$(this).removeClass('drop'); \$(this).removeClass('icon'); \$(this).addClass('iconspacer');} \t); \$('.savedsearchterm').hover( \tfunction() { \t\tid = \$(this).attr('id'); \t\t\$('#drop-' + id).addClass('icon'); \t\$('#drop-' + id).addClass('drophide'); \$('#drop-' + id).removeClass('iconspacer');}, \tfunction() { \t\tid = \$(this).attr('id'); \t\t\$('#drop-' + id).removeClass('icon');\$('#drop-' + id).removeClass('drophide'); \$('#drop-' + id).addClass('iconspacer');} \t); }); </script> EOT; }
function dispy_dark_init(&$a) { $a->theme_info = array('family' => 'dispy', 'name' => 'dark'); set_template_engine($a, 'smarty3'); /** @purpose set some theme defaults */ $cssFile = null; $colour = 'dark'; $colour_path = "/dark/"; // set css if (!is_null($cssFile)) { $a->page['htmlhead'] .= sprintf('<link rel="stylesheet" type="text/css" href="%s" />', $cssFile); } }
function cleanzero_init(&$a) { $a->theme_info = array('extends' => 'duepuntozero'); set_template_engine($a, 'smarty3'); $a->page['htmlhead'] .= <<<EOT <script> function insertFormatting(comment,BBcode,id) { \t \t\tvar tmpStr = \$("#comment-edit-text-" + id).val(); \t\tif(tmpStr == comment) { \t\t\ttmpStr = ""; \t\t\t\$("#comment-edit-text-" + id).addClass("comment-edit-text-full"); \t\t\t\$("#comment-edit-text-" + id).removeClass("comment-edit-text-empty"); \t\t\topenMenu("comment-edit-submit-wrapper-" + id); \t\t\t\$("#comment-edit-text-" + id).val(tmpStr); \t\t} \ttextarea = document.getElementById("comment-edit-text-" +id); \tif (document.selection) { \t\ttextarea.focus(); \t\tselected = document.selection.createRange(); \t\tif (BBcode == "url"){ \t\t\tselected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]"; \t\t\t} else\t\t\t \t\tselected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]"; \t} else if (textarea.selectionStart || textarea.selectionStart == "0") { \t\tvar start = textarea.selectionStart; \t\tvar end = textarea.selectionEnd; \t\tif (BBcode == "url"){ \t\t\ttextarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length); \t\t\t} else \t\ttextarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length); \t} \treturn true; } function cmtBbOpen(comment, id) { \tif(\$(comment).hasClass('comment-edit-text-full')) { \t\t\$(".comment-edit-bb-" + id).show(); \t\treturn true; \t} \treturn false; } function cmtBbClose(comment, id) { //\tif(\$(comment).hasClass('comment-edit-text-empty')) { //\t\t\$(".comment-edit-bb-" + id).hide(); //\t\treturn true; //\t} \treturn false; } \$(document).ready(function() { \$('.group-edit-icon').hover( \tfunction() { \t\t\$(this).addClass('icon'); \$(this).removeClass('iconspacer');}, \tfunction() { \t\t\$(this).removeClass('icon'); \$(this).addClass('iconspacer');} \t); \$('.sidebar-group-element').hover( \tfunction() { \t\tid = \$(this).attr('id'); \t\t\$('#edit-' + id).addClass('icon'); \$('#edit-' + id).removeClass('iconspacer');}, \tfunction() { \t\tid = \$(this).attr('id'); \t\t\$('#edit-' + id).removeClass('icon');\$('#edit-' + id).addClass('iconspacer');} \t); \$('.savedsearchdrop').hover( \tfunction() { \t\t\$(this).addClass('drop'); \$(this).addClass('icon'); \$(this).removeClass('iconspacer');}, \tfunction() { \t\t\$(this).removeClass('drop'); \$(this).removeClass('icon'); \$(this).addClass('iconspacer');} \t); \$('.savedsearchterm').hover( \tfunction() { \t\tid = \$(this).attr('id'); \t\t\$('#drop-' + id).addClass('icon'); \t\$('#drop-' + id).addClass('drophide'); \$('#drop-' + id).removeClass('iconspacer');}, \tfunction() { \t\tid = \$(this).attr('id'); \t\t\$('#drop-' + id).removeClass('icon');\$('#drop-' + id).removeClass('drophide'); \$('#drop-' + id).addClass('iconspacer');} \t); }); </script> EOT; // get resize configuration $resize = false; $site_resize = get_config('cleanzero', 'resize'); if (local_user()) { $resize = get_pconfig(local_user(), 'cleanzero', 'resize'); } if ($resize === false) { $resize = $site_resize; } if ($resize === false) { $resize = 0; } if (intval($resize) > 0) { //load jquery.ae.image.resize.js $imageresizeJS = $a->get_baseurl($ssl_state) . "/view/theme/cleanzero/js/jquery.ae.image.resize.js"; $a->page['htmlhead'] .= sprintf('<script language="JavaScript" src="%s" ></script>', $imageresizeJS); $a->page['htmlhead'] .= ' <script> $(function() { $(".wall-item-content img").aeImageResize({height: ' . $resize . ', width: ' . $resize . '}); }); </script>'; } }
function diabook_init(&$a) { set_template_engine($a, 'smarty3'); //print diabook-version for debugging $diabook_version = "Diabook (Version: 1.028)"; $a->page['htmlhead'] .= sprintf('<META NAME=generator CONTENT="%s"/>', $diabook_version); //init css on network and profilepages $cssFile = null; // Preload config load_config("diabook"); load_pconfig(local_user(), "diabook"); // adjust nav-bar, depending state of user if (local_user()) { $a->page['htmlhead'] .= ' <script> $(document).ready(function() { $("li#nav-site-linkmenu.nav-menu-icon").attr("style","display: block;"); $("li#nav-directory-link.nav-menu").attr("style","margin-right: 0px;"); $("li#nav-home-link.nav-menu").attr("style","display: block;margin-right: 8px;"); }); </script>'; } if ($a->argv[0] == "profile" && $a->argv[1] != $a->user['nickname']) { $a->page['htmlhead'] .= ' <script> $(document).ready(function() { $("li#nav-site-linkmenu.nav-menu-icon").attr("style","display: block;"); $("li#nav-directory-link.nav-menu").attr("style","margin-right: 0px;"); $("li#nav-home-link.nav-menu").attr("style","display: block;margin-right: 8px;"); }); </script>'; } //get statuses of boxes at right-hand-column $close_pages = get_diabook_config("close_pages", 1); $close_profiles = get_diabook_config("close_profiles", 0); $close_helpers = get_diabook_config("close_helpers", 0); $close_services = get_diabook_config("close_services", 0); $close_friends = get_diabook_config("close_friends", 0); $close_lastusers = get_diabook_config("close_lastusers", 0); $close_lastphotos = get_diabook_config("close_lastphotos", 0); $close_lastlikes = get_diabook_config("close_lastlikes", 0); $close_mapquery = get_diabook_config("close_mapquery", 1); //get resolution (wide/normal) $resolution = false; $resolution = get_pconfig(local_user(), "diabook", "resolution"); if ($resolution === false) { $resolution = "normal"; } //Add META viewport tag respecting the resolution to header for tablets if ($resolution == "wide") { $a->page['htmlhead'] .= '<meta name="viewport" content="width=1200" />'; } else { $a->page['htmlhead'] .= '<meta name="viewport" content="width=980" />'; } //get colour-scheme $color = get_diabook_config("color", "diabook"); if ($color == "diabook") { $color_path = "/"; } if ($color == "aerith") { $color_path = "/diabook-aerith/"; } if ($color == "blue") { $color_path = "/diabook-blue/"; } if ($color == "red") { $color_path = "/diabook-red/"; } if ($color == "pink") { $color_path = "/diabook-pink/"; } if ($color == "green") { $color_path = "/diabook-green/"; } if ($color == "dark") { $color_path = "/diabook-dark/"; } // remove doubled checkboxes at contacts-edit-page if ($a->argv[0] === "contacts" && $a->argv[1] != NULL && local_user()) { $a->page['htmlhead'] .= ' <script> $(document).ready(function() { $("span.group_unselected").attr("style","display: none;"); $("span.group_selected").attr("style","display: none;"); $("input.unticked.action").attr("style","float: left; margin-top: 5px;-moz-appearance: none;"); $("li.menu-profile-list").attr("style","min-height: 22px;"); }); </script>'; } //build personal menue at lefthand-col (id="profile_side") and boxes at right-hand-col at networkpages if ($a->argv[0] === "network" && local_user()) { // USER MENU if (local_user()) { $r = q("SELECT micro FROM contact WHERE uid=%d AND self=1", intval($a->user['uid'])); $userinfo = array('icon' => count($r) ? $r[0]['micro'] : $a->get_baseurl() . "/images/default-profile-mm.jpg", 'name' => $a->user['username']); $ps = array('usermenu' => array()); $ps['usermenu']['status'] = array('profile/' . $a->user['nickname'], t('Home'), "", t('Your posts and conversations')); $ps['usermenu']['profile'] = array('profile/' . $a->user['nickname'] . '?tab=profile', t('Profile'), "", t('Your profile page')); $ps['usermenu']['contacts'] = array('contacts', t('Contacts'), "", t('Your contacts')); $ps['usermenu']['photos'] = array('photos/' . $a->user['nickname'], t('Photos'), "", t('Your photos')); $ps['usermenu']['events'] = array('events/', t('Events'), "", t('Your events')); $ps['usermenu']['notes'] = array('notes/', t('Personal notes'), "", t('Your personal photos')); $ps['usermenu']['community'] = array('community/', t('Community'), "", ""); $ps['usermenu']['pgroups'] = array('http://dir.friendica.com/directory/forum', t('Community Pages'), "", ""); $tpl = get_markup_template('profile_side.tpl'); $a->page['aside'] = replace_macros($tpl, array('$userinfo' => $userinfo, '$ps' => $ps)) . $a->page['aside']; } $ccCookie = $close_pages + $close_mapquery + $close_profiles + $close_helpers + $close_services + $close_friends + $close_lastusers + $close_lastphotos + $close_lastlikes; //if all boxes closed, dont build right-hand-col and dont use special css if ($ccCookie != "9") { // COMMUNITY diabook_community_info(); // CUSTOM CSS if ($resolution == "normal") { $cssFile = $a->get_baseurl($ssl_state) . "/view/theme/diabook" . $color_path . "style-network.css"; } if ($resolution == "wide") { $cssFile = $a->get_baseurl($ssl_state) . "/view/theme/diabook" . $color_path . "style-network-wide.css"; } } } //build boxes at right_aside at profile pages if ($a->argv[0] . $a->argv[1] === "profile" . $a->user['nickname']) { if ($ccCookie != "9") { // COMMUNITY diabook_community_info(); // CUSTOM CSS if ($resolution == "normal") { $cssFile = $a->get_baseurl($ssl_state) . "/view/theme/diabook" . $color_path . "style-profile.css"; } if ($resolution == "wide") { $cssFile = $a->get_baseurl($ssl_state) . "/view/theme/diabook" . $color_path . "style-profile-wide.css"; } } } //write js-scripts to the head-section: //load jquery.cookie.js $cookieJS = $a->get_baseurl($ssl_state) . "/view/theme/diabook/js/jquery.cookie.js"; $a->page['htmlhead'] .= sprintf('<script type="text/javascript" src="%s"></script>', $cookieJS); //load jquery.ae.image.resize.js $imageresizeJS = $a->get_baseurl($ssl_state) . "/view/theme/diabook/js/jquery.ae.image.resize.min.js"; $a->page['htmlhead'] .= sprintf('<script type="text/javascript" src="%s" ></script>', $imageresizeJS); //load jquery.ui.js if ($ccCookie != "9") { $jqueryuiJS = $a->get_baseurl($ssl_state) . "/view/theme/diabook/js/jquery-ui.min.js"; $a->page['htmlhead'] .= sprintf('<script type="text/javascript" src="%s" ></script>', $jqueryuiJS); $jqueryuicssJS = $a->get_baseurl($ssl_state) . "/view/theme/diabook/jquery-ui.min.css"; $a->page['htmlhead'] .= sprintf('<link rel="stylesheet" type="text/css" href="%s" />', $jqueryuicssJS); } //load jquery.mapquery.js if ($close_mapquery != "1") { $mqtmplJS = $a->get_baseurl($ssl_state) . "/view/theme/diabook/js/jquery.tmpl.js"; $a->page['htmlhead'] .= sprintf('<script type="text/javascript" src="%s" ></script>', $mqtmplJS); $mapqueryJS = $a->get_baseurl($ssl_state) . "/view/theme/diabook/js/jquery.mapquery.core.js"; $a->page['htmlhead'] .= sprintf('<script type="text/javascript" src="%s" ></script>', $mapqueryJS); $openlayersJS = $a->get_baseurl($ssl_state) . "/view/theme/diabook/js/OpenLayers.js"; $a->page['htmlhead'] .= sprintf('<script type="text/javascript" src="%s" ></script>', $openlayersJS); $mqmouseposJS = $a->get_baseurl($ssl_state) . "/view/theme/diabook/js/jquery.mapquery.mqMousePosition.js"; $a->page['htmlhead'] .= sprintf('<script type="text/javascript" src="%s" ></script>', $mqmouseposJS); $mousewheelJS = $a->get_baseurl($ssl_state) . "/view/theme/diabook/js/jquery.mousewheel.js"; $a->page['htmlhead'] .= sprintf('<script type="text/javascript" src="%s" ></script>', $mousewheelJS); $mqlegendJS = $a->get_baseurl($ssl_state) . "/view/theme/diabook/js/jquery.mapquery.legend.js"; $a->page['htmlhead'] .= sprintf('<script type="text/javascript" src="%s" ></script>', $mqlegendJS); $mqlayermanagerJS = $a->get_baseurl($ssl_state) . "/view/theme/diabook/js/jquery.mapquery.mqLayerManager.js"; $a->page['htmlhead'] .= sprintf('<script type="text/javascript" src="%s" ></script>', $mqlayermanagerJS); } $a->page['htmlhead'] .= ' <script> $(function() { $("a.lightbox").colorbox({maxHeight:"90%"}); // Select all links with lightbox class $("a#mapcontrol-link").colorbox({inline:true,onClosed: function() { $("#mapcontrol").attr("style","display: none;");}} ); $("a#closeicon").colorbox({inline:true,onClosed: function() { $("#boxsettings").attr("style","display: none;");}} ); }); $(window).load(function() { var footer_top = $(document).height() - 30; $("div#footerbox").attr("style", "border-top: 1px solid #D2D2D2; width: 70%;right: 15%;position: absolute;top:"+footer_top+"px;"); }); </script>'; //check if mapquerybox is active and print if ($close_mapquery != "1") { $ELZoom = get_diabook_config("ELZoom", 0); $ELPosX = get_diabook_config("ELPosX", 0); $ELPosY = get_diabook_config("ELPosY", 0); $a->page['htmlhead'] .= ' <script> $(function() { $("#map").mapQuery({ layers:[{ //add layers to your map; you need to define at least one to be able to see anything on the map type:"osm" //add a layer of the type osm (OpenStreetMap) }], center:({zoom:' . $ELZoom . ',position:[' . $ELPosX . ',' . $ELPosY . ']}), }); }); function open_mapcontrol() { $("div#mapcontrol").attr("style","display: block;width:900px;height:900px;"); $("#map2").mapQuery({ layers:[{type:"osm", label:"OpenStreetMap" }, {type:"wms", label:"Population density 2010", legend:{url:"http://mapserver.edugis.nl/cgi-bin/mapserv?map=maps/edugis/cache/population.map&version=1.1.1&service=WMS&request=GetLegendGraphic&layer=Bevolkingsdichtheid_2010&format=image/png"}, url:"http://t1.edugis.nl/tiles/tilecache.py?map=maps/edugis/cache/population.map", layers:"Bevolkingsdichtheid_2010" }, {type:"wms", label:"OpenLayers WMS", url:"http://labs.metacarta.com/wms/vmap0", layers:"basic" }], center:({zoom:' . $ELZoom . ',position:[' . $ELPosX . ',' . $ELPosY . ']})}); $("#mouseposition").mqMousePosition({ map: "#map2", x:"", y:"", precision:4 }); $("#layermanager").mqLayerManager({map:"#map2"}); $( "div#layermanager" ).accordion({header: ".mq-layermanager-element-header"}); $(".mq-layermanager-element-content").attr("style", ""); map = $("#map2").mapQuery().data("mapQuery"); textarea = document.getElementById("id_diabook_ELZoom"); textarea.value = "' . $ELZoom . '"; $("#map2").bind("mousewheel", function(event, delta) { if (delta > 0 && textarea.value < 18){ textarea.value = textarea.value - delta*-1; } if (delta < 0 && textarea.value > "0"){ textarea.value = textarea.value - delta*-1; } }); }; </script>'; } //check if community_home-plugin is activated and change css.. we need this, that the submit-wrapper doesn't overlay the login-panel if communityhome-plugin is active $nametocheck = "communityhome"; $r = q("select id from addon where name = '%s' and installed = 1", dbesc($nametocheck)); if (count($r) == "1" && $a->argv[0] === "home") { $a->page['htmlhead'] .= ' <script> $(function() { $("div#login-submit-wrapper").attr("style","padding-top: 120px;"); }); </script>'; } //comment-edit-wrapper on photo_view... we need this to workaround a global bug in photoview, where the comment-box is between the last comment the the comment before the last if ($a->argv[0] . $a->argv[2] === "photos" . "image") { $a->page['htmlhead'] .= ' <script> $(function(){ $(".comment-edit-form").css("display","table"); }); </script>'; } //restore (only) the order right hand col at settingspage if ($a->argv[0] === "settings" && local_user()) { $a->page['htmlhead'] .= ' <script> function restore_boxes(){ $.cookie("Boxorder",null, { expires: 365, path: "/" }); alert("Boxorder at right-hand column was restored. Please refresh your browser"); } </script>'; } if ($a->argv[0] . $a->argv[1] === "profile" . $a->user['nickname'] or $a->argv[0] === "network" && local_user()) { $a->page['htmlhead'] .= ' <script> $(function() { $(".oembed.photo img").aeImageResize({height: 400, width: 400}); }); </script>'; if ($ccCookie != "9") { $a->page['htmlhead'] .= ' <script> $("right_aside").ready(function(){ if(' . $close_pages . ') { document.getElementById( "close_pages" ).style.display = "none"; }; if(' . $close_mapquery . ') { document.getElementById( "close_mapquery" ).style.display = "none"; }; if(' . $close_profiles . ') { document.getElementById( "close_profiles" ).style.display = "none"; }; if(' . $close_helpers . ') { document.getElementById( "close_helpers" ).style.display = "none"; }; if(' . $close_services . ') { document.getElementById( "close_services" ).style.display = "none"; }; if(' . $close_friends . ') { document.getElementById( "close_friends" ).style.display = "none"; }; if(' . $close_lastusers . ') { document.getElementById( "close_lastusers" ).style.display = "none"; }; if(' . $close_lastphotos . ') { document.getElementById( "close_lastphotos" ).style.display = "none"; }; if(' . $close_lastlikes . ') { document.getElementById( "close_lastlikes" ).style.display = "none"; };} ); </script>'; } } //end js scripts // custom css if (!is_null($cssFile)) { $a->page['htmlhead'] .= sprintf('<link rel="stylesheet" type="text/css" href="%s" />', $cssFile); } //footer $tpl = get_markup_template('footer.tpl'); $a->page['footer'] .= replace_macros($tpl, array()); // js_diabook_footer(); }
function dispy_init(&$a) { $a->theme_info = array('family' => 'dispy', 'version' => '1.2.2'); set_template_engine($a, 'smarty3'); /** @purpose set some theme defaults */ $cssFile = null; $colour = get_pconfig(local_user(), "dispy", "colour"); $baseurl = $a->get_baseurl($ssl_state); if ($colour === false) { $colour = "light"; } if ($colour == "light") { $colour_path = "/light/"; require_once 'light/theme.php'; } if ($colour == "dark") { $colour_path = "/dark/"; require_once 'dark/theme.php'; } /** @purpose aside on profile page */ if ($a->argv[0] . $a->argv[1] === "profile" . $a->user['nickname']) { dispy_community_info(); } $a->page['htmlhead'] .= <<<EOT \t<script type="text/javascript" src="{$baseurl}/view/theme/dispy/js/modernizr.custom.2.5.3.min.js"></script> \t<script type="text/javascript"> \t\$(document).ready(function() { \t\t// Select all links with lightbox class \t\t\$("a.lightbox").colorbox({maxHeight:"90%"}); \t\$('.group-edit-icon').hover( \t\t\tfunction() { \t\t\t\t\$(this).addClass('icon'); \t\t\t\t\$(this).removeClass('iconspacer'); }, \t\t\tfunction() { \t\t\t\t\$(this).removeClass('icon'); \t\t\t\t\$(this).addClass('iconspacer'); } \t\t); \t\t\$('.sidebar-group-element').hover( \t\t\tfunction() { \t\t\t\tid = \$(this).attr('id'); \t\t\t\t\$('#edit-' + id).addClass('icon'); \t\t\t\t\$('#edit-' + id).removeClass('iconspacer'); }, \t\t\tfunction() { \t\t\t\tid = \$(this).attr('id'); \t\t\t\t\$('#edit-' + id).removeClass('icon'); \t\t\t\t\$('#edit-' + id).addClass('iconspacer'); } \t\t); \t\t\$('.savedsearchdrop').hover( \t\t\tfunction() { \t\t\t\t\$(this).addClass('drop'); \t\t\t\t\$(this).addClass('icon'); \t\t\t\t\$(this).removeClass('iconspacer'); }, \t\t\tfunction() { \t\t\t\t\$(this).removeClass('drop'); \t\t\t\t\$(this).removeClass('icon'); \t\t\t\t\$(this).addClass('iconspacer'); } \t\t); \t\t\$('.savedsearchterm').hover( \t\t\tfunction() { \t\t\t\tid = \$(this).attr('id'); \t\t\t\t\$('#drop-' + id).addClass('icon'); \t\t\t\t\$('#drop-' + id).addClass('drophide'); \t\t\t\t\$('#drop-' + id).removeClass('iconspacer'); }, \t\t\tfunction() { \t\t\t\tid = \$(this).attr('id'); \t\t\t\t\$('#drop-' + id).removeClass('icon'); \t\t\t\t\$('#drop-' + id).removeClass('drophide'); \t\t\t\t\$('#drop-' + id).addClass('iconspacer'); } \t\t\t); \t\t// click outside notifications menu closes it \t\t\$('html').click(function() { \t\t\t\$('#nav-notifications-linkmenu').removeClass('selected'); \t\t\t\$('#nav-notifications-menu').css({display: 'none'}); \t\t}); \t\t\$('#nav-notifications-linkmenu').click(function(event) { \t\t\tevent.stopPropagation(); \t\t}); \t\t// click outside profiles menu closes it \t\t\$('html').click(function() { \t\t\t\$('#profiles-menu-trigger').removeClass('selected'); \t\t\t\$('#profiles-menu').css({display: 'none'}); \t\t}); \t\t\$('#profiles-menu').click(function(event) { \t\t\tevent.stopPropagation(); \t\t}); \t\t// main function in toolbar functioning \t\tfunction toggleToolbar() { \t\t\tif ( \$('#nav-floater').is(':visible') ) { \t\t\t\t\$('#nav-floater').slideUp('fast'); \t\t\t\t\$('.floaterflip').css({ \t\t\t\t\tbackgroundPosition: '-210px -60px' \t\t\t\t}); \t\t\t\t\$('.search-box').slideUp('fast'); \t\t\t} else { \t\t\t\t\$('#nav-floater').slideDown('fast'); \t\t\t\t\$('.floaterflip').css({ \t\t\t\t\tbackgroundPosition: '-190px -60px' \t\t\t\t}); \t\t\t\t\$('.search-box').slideDown('fast'); \t\t\t} \t\t}; \t\t// our trigger for the toolbar button \t\t\$('.floaterflip').click(function() { \t\t\ttoggleToolbar(); \t\t\treturn false; \t\t}); \t\t// (attempt to) change the text colour in a top post \t\t\$('#profile-jot-text').focusin(function() { \t\t\t\$(this).css({color: '#eec'}); \t\t}); \t\t\$('a[href=#top]').click(function() { \t\t\t\$('html, body').animate({scrollTop:0}, 'slow'); \t\t\treturn false; \t\t}); \t}); \t// shadowing effect for floating toolbars \t\$(document).scroll(function(e) { \t\tvar pageTop = \$('html').scrollTop(); \t\tif (pageTop) { \t\t\t\$('#nav-floater').css({boxShadow: '3px 3px 10px rgba(0, 0, 0, 0.7)'}); \t\t\t\$('.search-box').css({boxShadow: '3px 3px 10px rgba(0, 0, 0, 0.7)'}); \t\t} else { \t\t\t\$('#nav-floater').css({boxShadow: '0 0 0 0'}); \t\t\t\$('.search-box').css({boxShadow: '0 0 0 0'}); \t\t} \t}); \t</script> EOT; // custom css if (!is_null($cssFile)) { $a->page['htmlhead'] .= sprintf('<link rel="stylesheet" type="text/css" href="%s" />', $cssFile); } _js_in_foot(); }
/** * Name: Vier * Version: 1.1 * Author: Fabio <http://kirgroup.com/profile/fabrixxm> * Author: Ike <http://pirati.ca/profile/heluecht> * Maintainer: Ike <http://pirati.ca/profile/heluecht> * Description: "Vier" is a very compact and modern theme. It uses the font awesome font library: http://fortawesome.github.com/Font-Awesome/ */ function vier_init(&$a) { set_template_engine($a, 'smarty3'); $baseurl = $a->get_baseurl(); $a->theme_info = array(); $style = get_pconfig(local_user(), 'vier', 'style'); if ($style == "") { $style = get_config('vier', 'style'); } if ($style == "flat") { $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/vier/flat.css" type="text/css" media="screen"/>' . "\n"; } else { if ($style == "netcolour") { $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/vier/netcolour.css" type="text/css" media="screen"/>' . "\n"; } else { if ($style == "breathe") { $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/vier/breathe.css" type="text/css" media="screen"/>' . "\n"; } else { if ($style == "plus") { $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/vier/plus.css" type="text/css" media="screen"/>' . "\n"; } } } } $a->page['htmlhead'] .= <<<EOT <script type="text/javascript"> function collapseHeight(elems) { \tvar elemName = '.wall-item-body:not(.divmore)'; \tif(typeof elems != 'undefined') { \t\telemName = elems + ' ' + elemName; \t} \t\$(elemName).each(function() { \t\tif(\$(this).height() > 450) { \t\t\t\$('html').height(\$('html').height()); \t\t\t\$(this).divgrow({ initialHeight: 400, showBrackets: false, speed: 0 }); \t\t\t\$(this).addClass('divmore'); \t\t\t\$('html').height('auto'); \t\t} \t}); } function insertFormatting(comment,BBcode,id) { \t\tvar tmpStr = \$("#comment-edit-text-" + id).val(); \t\tif(tmpStr == comment) { \t\t\ttmpStr = ""; \t\t\t\$("#comment-edit-text-" + id).addClass("comment-edit-text-full"); \t\t\t\$("#comment-edit-text-" + id).removeClass("comment-edit-text-empty"); \t\t\topenMenu("comment-edit-submit-wrapper-" + id); \t\t\t\$("#comment-edit-text-" + id).val(tmpStr); \t\t} \ttextarea = document.getElementById("comment-edit-text-" +id); \tif (document.selection) { \t\ttextarea.focus(); \t\tselected = document.selection.createRange(); \t\tif (BBcode == "url"){ \t\t\tselected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]"; \t\t\t} else \t\tselected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]"; \t} else if (textarea.selectionStart || textarea.selectionStart == "0") { \t\tvar start = textarea.selectionStart; \t\tvar end = textarea.selectionEnd; \t\tif (BBcode == "url"){ \t\t\ttextarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length); \t\t\t} else \t\ttextarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length); \t} \treturn true; } function showThread(id) { \t\$("#collapsed-comments-" + id).show() \t\$("#collapsed-comments-" + id + " .collapsed-comments").show() } function hideThread(id) { \t\$("#collapsed-comments-" + id).hide() \t\$("#collapsed-comments-" + id + " .collapsed-comments").hide() } function cmtBbOpen(id) { \t\$("#comment-edit-bb-" + id).show(); } function cmtBbClose(id) { \t\$("#comment-edit-bb-" + id).hide(); } </script> EOT; }
function vier_init(&$a) { $a->theme_events_in_profile = false; set_template_engine($a, 'smarty3'); $baseurl = $a->get_baseurl(); $a->theme_info = array(); if ($a->argv[0] . $a->argv[1] === "profile" . $a->user['nickname'] or $a->argv[0] === "network" && local_user()) { vier_community_info(); $a->page['htmlhead'] .= "<link rel='stylesheet' type='text/css' href='view/theme/vier/wide.css' media='screen and (min-width: 1300px)'/>\n"; } if ($a->is_mobile || $a->is_tablet) { $a->page['htmlhead'] .= '<meta name=viewport content="width=device-width, initial-scale=1">' . "\n"; $a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="view/theme/vier/mobile.css" media="screen"/>' . "\n"; } // deactivated since it doesn't work with desktop browsers at the moment (To-Do) //$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="view/theme/vier/mobile.css" media="screen and (max-width: 1000px)"/>'."\n"; $a->page['htmlhead'] .= <<<EOT <link rel='stylesheet' type='text/css' href='view/theme/vier/narrow.css' media='screen and (max-width: 1100px)' /> <script type="text/javascript"> function insertFormatting(comment,BBcode,id) { \t\tvar tmpStr = \$("#comment-edit-text-" + id).val(); \t\tif(tmpStr == comment) { \t\t\ttmpStr = ""; \t\t\t\$("#comment-edit-text-" + id).addClass("comment-edit-text-full"); \t\t\t\$("#comment-edit-text-" + id).removeClass("comment-edit-text-empty"); \t\t\topenMenu("comment-edit-submit-wrapper-" + id); \t\t\t\$("#comment-edit-text-" + id).val(tmpStr); \t\t} \ttextarea = document.getElementById("comment-edit-text-" +id); \tif (document.selection) { \t\ttextarea.focus(); \t\tselected = document.selection.createRange(); \t\tif (BBcode == "url"){ \t\t\tselected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]"; \t\t\t} else \t\tselected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]"; \t} else if (textarea.selectionStart || textarea.selectionStart == "0") { \t\tvar start = textarea.selectionStart; \t\tvar end = textarea.selectionEnd; \t\tif (BBcode == "url"){ \t\t\ttextarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length); \t\t\t} else \t\ttextarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length); \t} \treturn true; } function showThread(id) { \t\$("#collapsed-comments-" + id).show() \t\$("#collapsed-comments-" + id + " .collapsed-comments").show() } function hideThread(id) { \t\$("#collapsed-comments-" + id).hide() \t\$("#collapsed-comments-" + id + " .collapsed-comments").hide() } function cmtBbOpen(id) { \t\$("#comment-edit-bb-" + id).show(); } function cmtBbClose(id) { \t\$("#comment-edit-bb-" + id).hide(); } </script> EOT; if ($a->is_mobile || $a->is_tablet) { $a->page['htmlhead'] .= <<<EOT <script> \t\$(document).ready(function() { \t\t\$(".mobile-aside-toggle a").click(function(e){ \t\t\te.preventDefault(); \t\t\t\$("aside").toggleClass("show"); \t\t}); \t\t\$(".tabs").click(function(e){ \t\t\t\$(this).toggleClass("show"); \t\t}); \t}); </script> EOT; } // Hide the left menu bar if ($a->page['aside'] == "" and in_array($a->argv[0], array("community", "events", "help", "manage", "notifications", "probe", "webfinger", "login", "invite", "credits"))) { $a->page['htmlhead'] .= "<link rel='stylesheet' href='view/theme/vier/hide.css' />"; } }
function duepuntozero_init(&$a) { $a->theme_info = array(); 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) { \t \t\tvar tmpStr = \$("#comment-edit-text-" + id).val(); \t\tif(tmpStr == comment) { \t\t\ttmpStr = ""; \t\t\t\$("#comment-edit-text-" + id).addClass("comment-edit-text-full"); \t\t\t\$("#comment-edit-text-" + id).removeClass("comment-edit-text-empty"); \t\t\topenMenu("comment-edit-submit-wrapper-" + id); \t\t\t\$("#comment-edit-text-" + id).val(tmpStr); \t\t} \ttextarea = document.getElementById("comment-edit-text-" +id); \tif (document.selection) { \t\ttextarea.focus(); \t\tselected = document.selection.createRange(); \t\tif (BBcode == "url"){ \t\t\tselected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]"; \t\t\t} else\t\t\t \t\tselected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]"; \t} else if (textarea.selectionStart || textarea.selectionStart == "0") { \t\tvar start = textarea.selectionStart; \t\tvar end = textarea.selectionEnd; \t\tif (BBcode == "url"){ \t\t\ttextarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length); \t\t\t} else \t\ttextarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length); \t} \treturn true; } function cmtBbOpen(comment, id) { \tif(\$(comment).hasClass('comment-edit-text-full')) { \t\t\$(".comment-edit-bb-" + id).show(); \t\treturn true; \t} \treturn false; } function cmtBbClose(comment, id) { //\tif(\$(comment).hasClass('comment-edit-text-empty')) { //\t\t\$(".comment-edit-bb-" + id).hide(); //\t\treturn true; //\t} \treturn false; } \$(document).ready(function() { \$('html').click(function() { \$("#nav-notifications-menu" ).hide(); }); \$('.group-edit-icon').hover( \tfunction() { \t\t\$(this).addClass('icon'); \$(this).removeClass('iconspacer');}, \tfunction() { \t\t\$(this).removeClass('icon'); \$(this).addClass('iconspacer');} \t); \$('.sidebar-group-element').hover( \tfunction() { \t\tid = \$(this).attr('id'); \t\t\$('#edit-' + id).addClass('icon'); \$('#edit-' + id).removeClass('iconspacer');}, \tfunction() { \t\tid = \$(this).attr('id'); \t\t\$('#edit-' + id).removeClass('icon');\$('#edit-' + id).addClass('iconspacer');} \t); \$('.savedsearchdrop').hover( \tfunction() { \t\t\$(this).addClass('drop'); \$(this).addClass('icon'); \$(this).removeClass('iconspacer');}, \tfunction() { \t\t\$(this).removeClass('drop'); \$(this).removeClass('icon'); \$(this).addClass('iconspacer');} \t); \$('.savedsearchterm').hover( \tfunction() { \t\tid = \$(this).attr('id'); \t\t\$('#drop-' + id).addClass('icon'); \t\$('#drop-' + id).addClass('drophide'); \$('#drop-' + id).removeClass('iconspacer');}, \tfunction() { \t\tid = \$(this).attr('id'); \t\t\$('#drop-' + id).removeClass('icon');\$('#drop-' + id).removeClass('drophide'); \$('#drop-' + id).addClass('iconspacer');} \t); }); </script> EOT; }
function smoothly_init(&$a) { $a->theme_info = array(); set_template_engine($a, 'smarty3'); $cssFile = null; $ssl_state = null; $baseurl = $a->get_baseurl($ssl_state); $a->page['htmlhead'] .= <<<EOT <script> function insertFormatting(comment,BBcode,id) { \t \t\tvar tmpStr = \$("#comment-edit-text-" + id).val(); \t\tif(tmpStr == comment) { \t\t\ttmpStr = ""; \t\t\t\$("#comment-edit-text-" + id).addClass("comment-edit-text-full"); \t\t\t\$("#comment-edit-text-" + id).removeClass("comment-edit-text-empty"); \t\t\topenMenu("comment-edit-submit-wrapper-" + id); \t\t\t\$("#comment-edit-text-" + id).val(tmpStr); \t\t} \ttextarea = document.getElementById("comment-edit-text-" +id); \tif (document.selection) { \t\ttextarea.focus(); \t\tselected = document.selection.createRange(); \t\tif (BBcode == "url"){ \t\t\tselected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]"; \t\t\t} else\t\t\t \t\tselected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]"; \t} else if (textarea.selectionStart || textarea.selectionStart == "0") { \t\tvar start = textarea.selectionStart; \t\tvar end = textarea.selectionEnd; \t\tif (BBcode == "url"){ \t\t\ttextarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length); \t\t\t} else \t\ttextarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length); \t} \treturn true; } function cmtBbOpen(id) { \t\$(".comment-edit-bb-" + id).show(); } function cmtBbClose(comment, id) { \t\$(".comment-edit-bb-" + id).hide(); } \$(document).ready(function() { \$('html').click(function() { \$("#nav-notifications-menu" ).hide(); }); \$('.group-edit-icon').hover( \tfunction() { \t\t\$(this).addClass('icon'); \$(this).removeClass('iconspacer');}, \tfunction() { \t\t\$(this).removeClass('icon'); \$(this).addClass('iconspacer');} \t); \$('.sidebar-group-element').hover( \tfunction() { \t\tid = \$(this).attr('id'); \t\t\$('#edit-' + id).addClass('icon'); \$('#edit-' + id).removeClass('iconspacer');}, \tfunction() { \t\tid = \$(this).attr('id'); \t\t\$('#edit-' + id).removeClass('icon');\$('#edit-' + id).addClass('iconspacer');} \t); \$('.savedsearchdrop').hover( \tfunction() { \t\t\$(this).addClass('drop'); \$(this).addClass('icon'); \$(this).removeClass('iconspacer');}, \tfunction() { \t\t\$(this).removeClass('drop'); \$(this).removeClass('icon'); \$(this).addClass('iconspacer');} \t); \$('.savedsearchterm').hover( \tfunction() { \t\tid = \$(this).attr('id'); \t\t\$('#drop-' + id).addClass('icon'); \t\$('#drop-' + id).addClass('drophide'); \$('#drop-' + id).removeClass('iconspacer');}, \tfunction() { \t\tid = \$(this).attr('id'); \t\t\$('#drop-' + id).removeClass('icon');\$('#drop-' + id).removeClass('drophide'); \$('#drop-' + id).addClass('iconspacer');} \t); }); </script> EOT; /** custom css **/ if (!is_null($cssFile)) { $a->page['htmlhead'] .= sprintf('<link rel="stylesheet" type="text/css" href="%s" />', $cssFile); } _js_in_foot(); }
function slackr_init(&$a) { $a->theme_info = array('extends' => 'duepuntozero'); set_template_engine($a, 'smarty3'); $a->page['htmlhead'] .= <<<EOT <script> function insertFormatting(comment,BBcode,id) { \t \t\tvar tmpStr = \$("#comment-edit-text-" + id).val(); \t\tif(tmpStr == comment) { \t\t\ttmpStr = ""; \t\t\t\$("#comment-edit-text-" + id).addClass("comment-edit-text-full"); \t\t\t\$("#comment-edit-text-" + id).removeClass("comment-edit-text-empty"); \t\t\topenMenu("comment-edit-submit-wrapper-" + id); \t\t\t\$("#comment-edit-text-" + id).val(tmpStr); \t\t} \ttextarea = document.getElementById("comment-edit-text-" +id); \tif (document.selection) { \t\ttextarea.focus(); \t\tselected = document.selection.createRange(); \t\tif (BBcode == "url"){ \t\t\tselected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]"; \t\t\t} else\t\t\t \t\tselected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]"; \t} else if (textarea.selectionStart || textarea.selectionStart == "0") { \t\tvar start = textarea.selectionStart; \t\tvar end = textarea.selectionEnd; \t\tif (BBcode == "url"){ \t\t\ttextarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length); \t\t\t} else \t\ttextarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length); \t} \treturn true; } function cmtBbOpen(comment, id) { \tif(\$(comment).hasClass('comment-edit-text-full')) { \t\t\$(".comment-edit-bb-" + id).show(); \t\treturn true; \t} \treturn false; } function cmtBbClose(comment, id) { //\tif(\$(comment).hasClass('comment-edit-text-empty')) { //\t\t\$(".comment-edit-bb-" + id).hide(); //\t\treturn true; //\t} \treturn false; } function hidecal() { \tif(editor) return; \t\$('.fc').hide(); } \$(document).ready(function() { \t\$("#profile-jot-text").focus(hidecal); \t\$("#profile-jot-text").click(hidecal); \$('html').click(function() { \$("#nav-notifications-menu" ).hide(); }); \$('.group-edit-icon').hover( \tfunction() { \t\t\$(this).addClass('icon'); \$(this).removeClass('iconspacer');}, \tfunction() { \t\t\$(this).removeClass('icon'); \$(this).addClass('iconspacer');} \t); \$('.sidebar-group-element').hover( \tfunction() { \t\tid = \$(this).attr('id'); \t\t\$('#edit-' + id).addClass('icon'); \$('#edit-' + id).removeClass('iconspacer');}, \tfunction() { \t\tid = \$(this).attr('id'); \t\t\$('#edit-' + id).removeClass('icon');\$('#edit-' + id).addClass('iconspacer');} \t); \$('.savedsearchdrop').hover( \tfunction() { \t\t\$(this).addClass('drop'); \$(this).addClass('icon'); \$(this).removeClass('iconspacer');}, \tfunction() { \t\t\$(this).removeClass('drop'); \$(this).removeClass('icon'); \$(this).addClass('iconspacer');} \t); \$('.savedsearchterm').hover( \tfunction() { \t\tid = \$(this).attr('id'); \t\t\$('#drop-' + id).addClass('icon'); \t\$('#drop-' + id).addClass('drophide'); \$('#drop-' + id).removeClass('iconspacer');}, \tfunction() { \t\tid = \$(this).attr('id'); \t\t\$('#drop-' + id).removeClass('icon');\$('#drop-' + id).removeClass('drophide'); \$('#drop-' + id).addClass('iconspacer');} \t); }); </script> EOT; }
/** * Name: Quattro * Version: 0.6 * Author: Fabio <http://kirgroup.com/profile/fabrixxm> * Maintainer: Fabio <http://kirgroup.com/profile/fabrixxm> * Maintainer: Tobias <https://diekershoff.homeunix.net/friendica/profile/tobias> */ function quattro_init(&$a) { $a->theme_info = array(); set_template_engine($a, 'smarty3'); $a->page['htmlhead'] .= '<script src="' . $a->get_baseurl() . '/view/theme/quattro/tinycon.min.js"></script>'; $a->page['htmlhead'] .= <<<EOT <script> \$(document).ready(function(){ \$('nav').bind('nav-update', function(e,data){ var notifCount = \$(data).find('notif').attr('count'); var intro = \$(data).find('intro').text(); var mail = \$(data).find('mail').text(); console.log(intro,mail); if (notifCount > 0 ) { Tinycon.setBubble(notifCount); } else { Tinycon.setBubble(''); } if (intro>0){ \t\t\t\$("#nav-introductions-link").addClass("on"); \t\t} else { \t\t\t\$("#nav-introductions-link").removeClass("on"); \t\t} \t\t if (mail>0){ \t\t\t\$("#nav-messages-link").addClass("on"); \t\t} else { \t\t\t\$("#nav-messages-link").removeClass("on"); \t\t} \t\t }); \t \t/* \t * show and hide contact action buttons in \t * contacts page on contacts' checkbox selection \t */ \t\$('.contact-select').bind('click', function(e) { \t\tvar y = e.clientY; \t\tvar elm = \$("#contacts-actions"); \t\ty=y-40; \t\tif (y<0) y=0; \t\tif (y+elm.height() > \$("html").height()) y=\$("html").height()-elm.height(); \t\telm.css('top', y+"px"); \t\tif (\$(".contact-select:checked").length > 0) { \t\t\telm.show(); \t\t} else { \t\t\telm.hide(); \t\t} \t}); }); function insertFormatting(comment,BBcode,id) { \t \t\tvar tmpStr = \$("#comment-edit-text-" + id).val(); \t\tif(tmpStr == comment) { \t\t\ttmpStr = ""; \t\t\t\$("#comment-edit-text-" + id).addClass("comment-edit-text-full"); \t\t\t\$("#comment-edit-text-" + id).removeClass("comment-edit-text-empty"); \t\t\topenMenu("comment-edit-submit-wrapper-" + id); \t\t\t\$("#comment-edit-text-" + id).val(tmpStr); \t\t} \ttextarea = document.getElementById("comment-edit-text-" +id); \tif (document.selection) { \t\ttextarea.focus(); \t\tselected = document.selection.createRange(); \t\tif (BBcode == "url"){ \t\t\tselected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]"; \t\t\t} else\t\t\t \t\tselected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]"; \t} else if (textarea.selectionStart || textarea.selectionStart == "0") { \t\tvar start = textarea.selectionStart; \t\tvar end = textarea.selectionEnd; \t\tif (BBcode == "url"){ \t\t\ttextarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length); \t\t\t} else \t\ttextarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length); \t} \treturn true; } function showThread(id) { \t\$("#collapsed-comments-" + id).show() \t\$("#collapsed-comments-" + id + " .collapsed-comments").show() } function hideThread(id) { \t\$("#collapsed-comments-" + id).hide() \t\$("#collapsed-comments-" + id + " .collapsed-comments").hide() } function cmtBbOpen(id) { \t\$("#comment-edit-bb-" + id).show(); } function cmtBbClose(id) { \t\$("#comment-edit-bb-" + id).hide(); } \$(document).ready(function() { \t\$('html').click(function() { \$("#nav-notifications-menu" ).hide(); }); \t\$('.group-edit-icon').hover( \t\tfunction() { \t\t\t\$(this).addClass('icon'); \$(this).removeClass('iconspacer');}, \t\tfunction() { \t\t\t\$(this).removeClass('icon'); \$(this).addClass('iconspacer');} \t\t); \t\$('.sidebar-group-element').hover( \t\tfunction() { \t\t\tid = \$(this).attr('id'); \t\t\t\$('#edit-' + id).addClass('icon'); \$('#edit-' + id).removeClass('iconspacer');}, \t\tfunction() { \t\t\tid = \$(this).attr('id'); \t\t\t\$('#edit-' + id).removeClass('icon');\$('#edit-' + id).addClass('iconspacer');} \t\t); \t\$('.savedsearchdrop').hover( \t\tfunction() { \t\t\t\$(this).addClass('drop'); \$(this).addClass('icon'); \$(this).removeClass('iconspacer');}, \t\tfunction() { \t\t\t\$(this).removeClass('drop'); \$(this).removeClass('icon'); \$(this).addClass('iconspacer');} \t\t); \t\$('.savedsearchterm').hover( \t\tfunction() { \t\t\tid = \$(this).attr('id'); \t\t\t\$('#drop-' + id).addClass('icon'); \t\$('#drop-' + id).addClass('drophide'); \$('#drop-' + id).removeClass('iconspacer');}, \t\tfunction() { \t\t\tid = \$(this).attr('id'); \t\t\t\$('#drop-' + id).removeClass('icon');\$('#drop-' + id).removeClass('drophide'); \$('#drop-' + id).addClass('iconspacer');} \t); }); </script> EOT; }