Пример #1
0
 function head_custom()
 {
     qa_html_theme_base::head_custom();
     if (qa_opt('ccount')) {
         $this->output(qa_opt('ccount_css'));
     }
 }
Пример #2
0
    function head_custom()
    {
        qa_html_theme_base::head_custom();
        if (qa_opt('priv_active') && qa_opt('priv_check') && qa_get_logged_in_handle()) {
            $userid = qa_get_logged_in_userid();
            $notices = qa_db_read_one_value(qa_db_query_sub('SELECT meta_value FROM ^usermeta WHERE user_id=# AND meta_key=$ ', $userid, 'priv_notify'), true);
            if ($notices) {
                $all = explode('^', $notices);
                if (!$all[1]) {
                    // no new
                    return;
                }
                $n = explode(',', $all[1]);
                $this->notify = '<div class="notify-container">';
                $text = count($n) > 1 ? str_replace('#', count($n), qa_opt('priv_notify_text_multi')) : str_replace('^privilege', qa_lang('profile/' . $n[0]), qa_opt('priv_notify_text'));
                $text = str_replace('^profile', qa_path_html('user/' . qa_get_logged_in_handle(), array('tab' => 'privileges'), qa_opt('site_url')), $text);
                $this->notify .= '<div class="priv-notify notify">' . $text . '<div class="notify-close" onclick="jQuery(this).parent().sildeUp(\'fast\')">x</div></div>';
                $this->notify .= '</div>';
                // remove notification flag
                qa_db_query_sub('UPDATE ^usermeta SET meta_value=$ WHERE meta_key=$ AND user_id=#', ($all[0] ? $all[0] . ',' : '') . $all[1] . '^', 'priv_notify', $userid);
                /*					
                					$this->output("
                					<script>
                						jQuery('document').ready(function() { jQuery('.notify-container').delay(10000).fadeOut(); });
                					</script>");
                */
                $this->output('
					<style>', qa_opt('priv_css'), '</style>');
            }
        }
    }
    function head_custom()
    {
        qa_html_theme_base::head_custom();
        if (qa_opt('voting_on_cs')) {
            $this->output('
<style>
	.comment-votable-container {
		width:100% !important;
	}
	.comment-vote-container {
		padding-right: 4px;
		text-align: center;
		vertical-align:top;
		width:12px;
	}
	.comment-vote-item {
		color: silver;
	}

	.comment-vote-item:hover {
		color:black;
		cursor:pointer;
	}
	.comment-vote-item-selected {
		color:orange;
		cursor:pointer;
	}
	.comment-vote-item-disabled {
		display:none;
	}

</style>');
        }
    }
    function head_custom()
    {
        qa_html_theme_base::head_custom();
        if (in_array($this->template, array('question', 'ask', 'not-found')) && qa_opt('confirm_close_plugin')) {
            $this->output('<script type="text/javascript">
jQuery("document").ready(function() {

	jQuery("form").submit(function(event) {
		window.onbeforeunload = null;
	});

	window.onbeforeunload = function(event) {
		var content = false
		jQuery("textarea:visible").each( function() {
			if(this.value) {
				content = true;
				return false;
			}
		});
		if (content)
			return "You have entered text; are you sure you wish to leave this page?";

	}
});
</script>');
        }
    }
 function head_custom()
 {
     parent::head_custom();
     $tmpl = array('ask', 'question');
     if (!in_array($this->template, $tmpl)) {
         return;
     }
     $hidecss = qa_opt($this->cssopt) === '1';
     $usehljs = qa_opt($this->hljsopt) === '1';
     $wmd_buttons = QA_HTML_THEME_LAYER_URLTOROOT . 'pagedown/wmd-buttons.png';
     $this->output_raw("<style>\n" . ".wmd-button > span { background-image: url('{$wmd_buttons}') }\n");
     // display CSS for Markdown Editor
     if (!$hidecss) {
         $cssWMD = file_get_contents(QA_HTML_THEME_LAYER_DIRECTORY . 'pagedown/wmd.css');
         $this->output_raw($cssWMD);
         // display CSS for HighlightJS
         if ($usehljs) {
             $cssHJS = file_get_contents(QA_HTML_THEME_LAYER_DIRECTORY . 'pagedown/highlightjs.css');
             $this->output_raw($cssHJS);
         }
     }
     $this->output_raw("</style>\n\n");
     // set up HighlightJS
     if ($usehljs) {
         $this->output_raw("<script src=\"" . QA_HTML_THEME_LAYER_URLTOROOT . "pagedown/highlight.min.js\"></script>\n" . "<script type=\"text/javascript\">\n" . "\$(function(){\n" . "\t\$('.wmd-input').keypress(function(){\n" . "\t\twindow.clearTimeout(hljs.Timeout);\n" . "\t\thljs.Timeout = window.setTimeout(function() {\n" . "\t\t\thljs.initHighlighting.called = false;\n" . "\t\t\thljs.initHighlighting();\n" . "\t\t}, 500);\n" . "\t});\n" . "\twindow.setTimeout(function() {\n" . "\t\thljs.initHighlighting.called = false;\n" . "\t\thljs.initHighlighting();\n" . "\t}, 500);\n" . "});\n" . "</script>\n\n");
     }
     //by hoangweb
     //$cssHJS = file_get_contents( QA_HTML_THEME_LAYER_DIRECTORY . 'pagedown/hoangweb/dropzone.css' ); //print css
     /*$this->output_raw("<style>\n");
       $this->output_raw($cssHJS);
       $this->output_raw("</style>\n\n");*/
     $this->output_raw("<link rel=\"stylesheet\" type=\"text/css\" href=\"" . QA_HTML_THEME_LAYER_URLTOROOT . "pagedown/hoangweb/dropzone.css\"/>");
     $this->output_raw("<link rel=\"stylesheet\" type=\"text/css\" href=\"" . QA_HTML_THEME_LAYER_URLTOROOT . "pagedown/hoangweb/style.css\"/>");
     $this->output_raw("<script src=\"" . QA_HTML_THEME_LAYER_URLTOROOT . "pagedown/hoangweb/dropzone.js\"></script>");
 }
Пример #6
0
 function head_custom()
 {
     if ($this->template == 'admin') {
         $this->output("\n\t<script>\t\t\t\n\tfunction mergePluginGetPosts() {\n\t\tvar from=jQuery('#merge_from').val();\n\t\tvar to=jQuery('#merge_to').val();\n\n\t\tvar dataString = 'ajax_merge_get_from='+from+'&ajax_merge_get_to='+to;  \n\t\tjQuery.ajax({  \n\t\t  type: 'POST',  \n\t\t  url: '" . qa_self_html() . "',  \n\t\t  data: dataString,  \n\t\t  dataType: 'json',  \n\t\t  success: function(json) {\n\t\t\t\tjQuery('#merge_from_out').html('Merging from: <a href=\"'+json.from_url+'\">'+json.from+'</a>');\n\t\t\t\tjQuery('#merge_to_out').html('To: <a href=\"'+json.to_url+'\">'+json.to+'</a>');\n\t\t\t} \n\t\t});\n\t\treturn false;\n\t}\n\t</script>");
     }
     qa_html_theme_base::head_custom();
 }
Пример #7
0
    function head_custom()
    {
        parent::head_custom();
        if ($this->template != 'plugin' || $this->request != 'chat') {
            return;
        }
        $hidecss = qa_opt($this->optcss) === '1';
        if (!$hidecss) {
            $chat_css = '
				<style>
				#qa-chat-form { text-align: center; }
				.qa-chat-post { width: 600px; }
				#qa-chat-list, .qa-chat-item, #qa-chat-user-list, .qa-chat-user-item { display: block; list-style: none; margin: 0; padding: 0; font-size: 13px;  line-height: 1.4; }
				#qa-chat-list { width: 728px; margin: 1em auto; }
				.qa-chat-item { overflow: hidden; padding: 4px 0; border-top: 1px solid #eee; }
				.qa-chat-item:last-child { border-bottom: 1px solid #eee; }
				.qa-chat-item-meta { float: left; width: 110px; padding-right: 20px; font-size: 11px; color: #999; text-align: right; }
				.qa-chat-item-data { float: left; width: 598px; }
				.qa-chat-user-item { padding: 2px 4px; }
				.qa-chat-user-item:hover { background: rgba(255,255,255,0.4); }
				.qa-chat-idle, .qa-chat-idle > a { color: #aaa; }

				.qa-chat-kick { float: right; cursor: pointer; width: 10px; height: 10px; border-radius: 10px; background: #999; margin-top: 5px; }
				.qa-chat-kick:hover { background: #f00; }
				.qa-chat-service { background: #fffae4; }
				</style>';
            $this->output_raw($chat_css);
        }
    }
 function head_custom()
 {
     if (($this->template == 'user' || qa_opt('user_act_list_new')) && qa_opt('user_act_list_active')) {
         $this->output('<style type="text/css">', str_replace('^', QA_HTML_THEME_LAYER_URLTOROOT, qa_opt('user_act_list_css')), '</style>');
     }
     qa_html_theme_base::head_custom();
 }
Пример #9
0
 public function head_custom()
 {
     parent::head_custom();
     $allowed_tmpl = qa_opt($this->allowed_templates_opt);
     if (strlen($allowed_tmpl)) {
         $tmpl = explode(',', $allowed_tmpl);
     } else {
         //fall back for the defaults if the option is not set from the admin panel
         $tmpl = array('ask', 'question');
     }
     if (!in_array($this->template, $tmpl)) {
         return;
     }
     $hidecss = qa_opt($this->cssopt) === '1';
     $usehljs = qa_opt($this->hljsopt) === '1';
     $wmd_buttons = QA_HTML_THEME_LAYER_URLTOROOT . 'pagedown/wmd-buttons.png';
     $this->output_raw("<style>\n" . ".wmd-button > span { background-image: url('{$wmd_buttons}') }\n");
     // display CSS for Markdown Editor
     if (!$hidecss) {
         $cssWMD = file_get_contents(QA_HTML_THEME_LAYER_DIRECTORY . 'pagedown/wmd.css');
         $this->output_raw($cssWMD);
         // display CSS for HighlightJS
         if ($usehljs) {
             $cssHJS = file_get_contents(QA_HTML_THEME_LAYER_DIRECTORY . 'pagedown/highlightjs.css');
             $this->output_raw($cssHJS);
         }
     }
     $this->output_raw("</style>\n\n");
     // set up HighlightJS
     if ($usehljs) {
         $js = file_get_contents(QA_HTML_THEME_LAYER_DIRECTORY . 'pagedown/highlightjs-run.js');
         $this->output_raw('<script src="' . QA_HTML_THEME_LAYER_URLTOROOT . 'pagedown/highlight.min.js"></script>' . '<script>' . $js . '</script>');
     }
 }
Пример #10
0
 function head_custom()
 {
     qa_html_theme_base::head_custom();
     if (qa_opt('admin_plus_dropdown')) {
         $this->output("\n<style>\n.qa-nav-main-item{\n\tposition:relative;\n}\n.qa-nav-main-item ul{\n\tpadding-top:1px;\n\tz-index:1000;\n\tbackground:#fff; /* Adding a background makes the dropdown work properly in IE7+. Make this as close to your page's background as possible (i.e. white page == white background). */\n\tbackground:rgba(255,255,255,0); /* But! Let's make the background fully transparent where we can, we don't actually want to see it if we can help it... */\n\tlist-style:none;\n\tposition:absolute;\n\tleft:-9999px; /* Hide off-screen when not needed (this is more accessible than display:none;) */\n}\n.qa-nav-main-item ul li{\n\tpadding-top:1px; /* Introducing a padding between the li and the a give the illusion spaced items */\n\tfloat:none;\n}\n.qa-nav-main-item ul a{\n\twhite-space:nowrap; /* Stop text wrapping and creating multi-line dropdown items */\n\tfont-size:75%;\n}\n.qa-nav-main-item:hover ul{ /* Display the dropdown on hover */\n\tleft:0; /* Bring back on-screen when needed */\n}\n</style>\n");
     }
 }
Пример #11
0
 function head_custom()
 {
     qa_html_theme_base::head_custom();
     if (qa_opt('embed_enable_thickbox')) {
         $this->output('<script type="text/javascript" src="' . QA_HTML_THEME_LAYER_URLTOROOT . 'thickbox.js"></script>');
         $this->output('<link rel="stylesheet" href="' . QA_HTML_THEME_LAYER_URLTOROOT . 'thickbox.css" type="text/css" media="screen" />');
     }
 }
Пример #12
0
    function head_custom()
    {
        qa_html_theme_base::head_custom();
        $this->output('
<style>
' . qa_opt('share_plugin_css') . '				
</style>');
    }
Пример #13
0
 function head_custom()
 {
     if (qa_opt('embed_smileys') && qa_opt('embed_smileys_markdown_button')) {
         $this->output('<style>', qa_opt('embed_smileys_css'), '</style>');
         $this->output('<script>', "\n\t\t\t\tfunction toggleSmileyBox(idx) {\n\t\t\t\t\tjQuery('#smiley-box'+idx).toggle();\n\t\t\t\t}\n\t\t\t\tfunction insertSmiley(code,img,idx) {\n\t\t\t\t\tvar el = jQuery('textarea[index=\"'+idx+'\"]');\n\t\t\t\t\tel.val(el.val()+code);\n\t\t\t\t\ttoggleSmileyBox(idx);\n\t\t\t\t}\n\t\t\t\t", '</script>');
     }
     qa_html_theme_base::head_custom();
 }
Пример #14
0
    function head_custom()
    {
        qa_html_theme_base::head_custom();
        if (qa_opt('badge_active')) {
            $this->output("\n\t\t\t\t<script>" . (qa_opt('badge_notify_time') != '0' ? "\n\t\t\t\t\tjQuery('document').ready(function() { jQuery('.notify-container').delay(" . (int) qa_opt('badge_notify_time') * 1000 . ").slideUp('fast'); });" : "") . "\n\t\t\t\t\tfunction badgeEdit(slug,end) {\n\t\t\t\t\t\tif(end) {\n\t\t\t\t\t\t\tjQuery('#badge_'+slug+'_edit').hide();\n\t\t\t\t\t\t\tjQuery('#badge_'+slug+'_badge').show();\n\t\t\t\t\t\t\tjQuery('#badge_'+slug+'_badge').html(jQuery('#badge_'+slug+'_edit').val());\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tjQuery('#badge_'+slug+'_badge').hide();\n\t\t\t\t\t\tjQuery('#badge_'+slug+'_edit').show();\n\t\t\t\t\t\tjQuery('#badge_'+slug+'_edit').focus();\n\t\t\t\t\t}\n\t\t\t\t</script>");
            $this->output('
				<style>', qa_opt('badges_css'), '</style>');
        }
    }
 function head_custom()
 {
     parent::head_custom();
     if (qa_opt('qa_btt_enabled')) {
         $script = file_get_contents(QA_HTML_THEME_LAYER_DIRECTORY . 'js/qa-btt.js');
         $script = str_replace('QA_PLUGINDIR', QA_HTML_THEME_LAYER_URLTOROOT, $script);
         $this->output_raw('<script>' . $script . '</script>');
     }
 }
    function head_custom()
    {
        qa_html_theme_base::head_custom();
        if ($this->template != 'admin') {
            $this->output('
						<style>
						' . qa_opt(q2a_breadcrumbs_admin::CUSTOM_CSS) . '				
						</style>');
        }
    }
 function head_custom()
 {
     qa_html_theme_base::head_custom();
     if (!qa_opt('badge_active')) {
         return;
     }
     if ($this->request == 'admin/plugins' && qa_get_logged_in_level() >= QA_USER_LEVEL_ADMIN) {
         $this->output("\n\t\t\t\t<script>" . (qa_opt('badge_notify_time') != '0' ? "\n\t\t\t\t\tjQuery('document').ready(function() { jQuery('.notify-container').delay(" . (int) qa_opt('badge_notify_time') * 1000 . ").slideUp('fast'); });" : "") . "\n\t\t\t\t\tfunction badgeEdit(slug,end) {\n\t\t\t\t\t\tif(end) {\n\t\t\t\t\t\t\tjQuery('#badge_'+slug+'_edit').hide();\n\t\t\t\t\t\t\tjQuery('#badge_'+slug+'_badge').show();\n\t\t\t\t\t\t\tjQuery('#badge_'+slug+'_badge').html(jQuery('#badge_'+slug+'_edit').val());\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tjQuery('#badge_'+slug+'_badge').hide();\n\t\t\t\t\t\tjQuery('#badge_'+slug+'_edit').show();\n\t\t\t\t\t\tjQuery('#badge_'+slug+'_edit').focus();\n\t\t\t\t\t}\n\t\t\t\t</script>");
     }
     $this->output('<style>', qa_opt('badges_css'), '</style>');
 }
 function head_custom()
 {
     parent::head_custom();
     if (qa_opt('qa_eql_enabled')) {
         $ias_call = file_get_contents(QA_HTML_THEME_LAYER_DIRECTORY . 'js/qa-eql.js');
         $ias_call = str_replace('QA_PLUGINDIR', QA_HTML_THEME_LAYER_URLTOROOT, $ias_call);
         $this->output_raw('<script>' . $ias_call . '</script>');
         if (qa_opt('qa_eql_include')) {
             $this->output_raw('<script type="text/javascript" src="' . QA_HTML_THEME_LAYER_URLTOROOT . 'js/jquery-ias-min.js"></script>');
         }
     }
 }
Пример #19
0
 function head_custom()
 {
     qa_html_theme_base::head_custom();
     if (@$this->template == 'user' && qa_opt('signatures_enable')) {
         $formats = qa_list_modules('editor');
         $editorname = $formats[qa_opt('signatures_format')];
         $handle = preg_replace('/^[^\\/]+\\/([^\\/]+).*/', "\$1", $this->request);
         if (qa_get_logged_in_handle() == $handle && (!$editorname || $editorname == 'Markdown Editor')) {
             $this->output_raw('<script src="' . QA_HTML_THEME_LAYER_URLTOROOT . 'textLimitCount.js" type="text/javascript"></script>');
             $this->output_raw("\n<script>\n\tvar signature_max_length = " . (qa_opt('signatures_length') ? qa_opt('signatures_length') : 1000) . ";\n\tjQuery('document').ready(function(){\n\t\ttextLimiter(jQuery('textarea[name=\"signature_text\"]'),{\n\t\tmaxLength: signature_max_length,\n\t\telCount: 'elCount'\n\t  });\n\t});\n</script>");
         }
     }
 }
Пример #20
0
    function head_custom()
    {
        qa_html_theme_base::head_custom();
        if (qa_opt('buddypress_integration_enable') && qa_opt('buddypress_enable_profile') && $this->template == 'user' && !qa_get('tab')) {
            $this->output('
<style>', qa_opt('buddypress_integration_css'), '</style>');
        }
        // avatar as image_src
        if (qa_opt('buddypress_integration_enable') && qa_opt('buddypress_integration_avatar_head')) {
            $avatar = preg_replace('|.*src="([^"]+)".*|i', '$1', bp_core_fetch_avatar(array('item_id' => $this->content['q_view']['raw']['userid'], 'width' => qa_opt('buddypress_integration_avatar_w'), 'height' => qa_opt('buddypress_integration_avatar_h'), 'email' => $email)));
            $avatar = preg_replace('|.*SRC="([^"]+)".*|i', '$1', $this->content['q_view']['avatar']);
            if (isset($avatar)) {
                $this->output('<link rel="image_src" href="' . $avatar . '" />');
            }
        }
    }
 function head_custom()
 {
     parent::head_custom();
     //create upload token
     $session_token = NonceUtil::generate('valid_session', 1800);
     $upload_token = NonceUtil::generate('valid_token_upload', 1800);
     $gallery_token = NonceUtil::generate('load_images', 1800);
     $this->output_raw("<script>\n" . "var hw_imgur = {\r\n                ajaxHandler: qa_root + 'qa-plugin/hw-imgur/ajax.php' ,\r\n                session_token : '" . $session_token . "',\r\n                upload_token : '" . $upload_token . "',\r\n                gallery_token : '" . $gallery_token . "'\r\n            };\r\n                \n" . "</script>\n\n");
     $this->output_raw("<script src=\"" . QA_HTML_THEME_LAYER_URLTOROOT . "/js/script.js\"></script>");
     $this->output_raw("<script src=\"" . QA_HTML_THEME_LAYER_URLTOROOT . "/js/hw-jquery-plugin.js\"></script>");
     $this->output_raw("<script src=\"" . QA_HTML_THEME_LAYER_URLTOROOT . "/js/jquery-ui.js\"></script>");
     $this->output_raw("<link rel=\"stylesheet\" type=\"text/css\" href=\"" . QA_HTML_THEME_LAYER_URLTOROOT . "style.css\"/>");
     //print iflychat
     global $hw_iflychat;
     //if(!empty($hw_iflychat)) echo $hw_iflychat->getHtmlCode();
     if (!empty($this->ifly_html_code)) {
         echo $this->ifly_html_code;
     }
 }
Пример #22
0
    function head_custom()
    {
        $this->output('<style>', '#question-closed-message{
	font-style:italic; 
	background-color:silver; 
	padding:12px; 
	margin-top:12px;
}', '.question-closed-reason{
	font-weight:bold; 
}', '</style>');
        qa_html_theme_base::head_custom();
    }
Пример #23
0
 function head_custom()
 {
     qa_html_theme_base::head_custom();
     if ($this->template == 'user' && qa_opt('theme_switch_enable')) {
     }
 }
Пример #24
0
    function head_custom()
    {
        if (qa_opt('bookmarks_plugin_enable') && ($this->template == 'question' || $this->template == 'user')) {
            $this->output_raw('
				<style>
					#bookmark:hover {
						background-image:url(' . QA_HTML_THEME_LAYER_URLTOROOT . 'onbookmark.png);
					}
					#bookmark {
						cursor: pointer;
						float: right;
						margin: 12px 12px 12px 0;
						width: 24px;
						height: 24px;
						background-size:;
					}
					.bookmark {
						background-image:url(' . QA_HTML_THEME_LAYER_URLTOROOT . 'bookmark.png);
					}
					.unbookmark {
						background-image:url(' . QA_HTML_THEME_LAYER_URLTOROOT . 'unbookmark.png);
					}
					#ajax-bookmark-popup {
						left: 0;
						right: 0;
						top: 0;
						padding: 0;
						position: fixed;
						width: 100%;
						z-index: 10000;
						cursor:pointer;
						display:none;
					}
					.ajax-bookmark-popup-text {
						background-color: #F6DF30;
						color: #444444;
						font-weight: bold;
						width: 100%;
						text-align: center;
						font-family: sans-serif;
						font-size: 14px;
						padding: 10px 0;
						position:relative;
					}
					.bookmark-row-image{
						background-image:url(' . QA_HTML_THEME_LAYER_URLTOROOT . 'unbookmarks.png);
						float:left;
						width:12px;
						height:12px;
						margin-right:5px;
						cursor:pointer;
					}
					.bookmark-row {
						padding:2px 0;
					}
					.bookmark-row-image:hover {
						background-image:url(' . QA_HTML_THEME_LAYER_URLTOROOT . 'onbookmarks.png);
					}
				</style>');
            $this->output_raw("\n\t\t\t\t<script>\n\t\t\t\t\tfunction ajaxBookmarkConfirm(bmd) {\n\t\t\t\t\t\tjQuery('#ajax-bookmark-popup').remove();\n\t\t\t\t\t\tif(bmd) jQuery('<div id=\"ajax-bookmark-popup\"><div class=\"ajax-bookmark-popup-text\" onclick=\"this.style.display=\\'none\\';\">" . qa_opt('ajax_bookmark_popup_notice_text') . "</div></div>').insertAfter(jQuery('#bookmark')).fadeIn('fast').delay(5000).fadeOut('slow');\n\t\t\t\t\t\telse jQuery('<div id=\"ajax-bookmark-popup\"><div class=\"ajax-bookmark-popup-text\" onclick=\"this.style.display=\\'none\\';\">" . qa_opt('ajax_bookmark_popup_un_notice_text') . "</div></div>').insertAfter(jQuery('#bookmark')).fadeIn('fast').delay(5000).fadeOut('slow');\n\t\t\t\t\t}\n\t\t\t\t\tfunction ajaxBookmark(qid,uid,bmd,row) {\n\t\t\t\t\t\tvar dataString = 'ajax_bookmark_qid='+qid+'&ajax_bookmark_uid='+uid+'&ajax_bookmarked='+bmd;\n\t\t\t\t\t\tjQuery.ajax({  \n\t\t\t\t\t\t\ttype: 'POST',  \n\t\t\t\t\t\t\turl: '" . qa_self_html() . "',  \n\t\t\t\t\t\t\tdata: dataString,  \n\t\t\t\t\t\t\tsuccess: function(data) {\n\t\t\t\t\t\t\t\tif(/^[\\t\\n ]*###/.exec(data)) {\n\t\t\t\t\t\t\t\t\tvar error = data.substring(4);\n\t\t\t\t\t\t\t\t\twindow.alert(error);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if(row) {\n\t\t\t\t\t\t\t\t\tjQuery('#bookmark-row-'+row).fadeOut('slow',function(){\n\t\t\t\t\t\t\t\t\t\t\tjQuery('#bookmark-row-'+row).remove()\n\t\t\t\t\t\t\t\t\t\t\tif(jQuery('.bookmark-row').length == 0) {\n\t\t\t\t\t\t\t\t\t\t\t\tjQuery('#bookmarks_form').remove();\n\t\t\t\t\t\t\t\t\t\t\t\tjQuery('#bookmark_title').parent().remove();\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tajaxBookmarkConfirm(bmd==false);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\tjQuery('#bookmark').replaceWith(data);\n\t\t\t\t\t\t\t\t\tajaxBookmarkConfirm(bmd==false);\n\t\t\t\t\t\t\t\t}  \n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t</script>");
        }
        qa_html_theme_base::head_custom();
    }
    function head_custom()
    {
        qa_html_theme_base::head_custom();
        $this->output('<style>
' . qa_opt('expert_question_css') . '
</style>');
    }
Пример #26
0
 function head_custom()
 {
     parent::head_custom();
     // position inside <head> tag
     $this->_output_widget('head-tag');
 }
Пример #27
0
    function head_custom()
    {
        if (qa_opt('poll_enable')) {
            if ($this->template == 'ask') {
                $this->output_raw('<script>
	var poll_answer_index = 2;
	jQuery("document").ready(function(){jQuery("#is_poll").removeAttr("checked")});
	function addPollAnswer(idx) {
		jQuery("#qa-poll-ask-div").append(\'<br/><input type="input" class="qa-poll-answer-text" name="poll_answer_\'+idx+\'" id="poll_answer_\'+idx+\'">&nbsp;<input type="button" class="qa-poll-answer-add" value="+" onclick="addPollAnswer(poll_answer_index)">\');
		poll_answer_index++;
	}
	function pollSubmit(e) {
		if(jQuery("#is_poll").attr("checked")) {
			var idx = 0, count = 0;
			while(jQuery("#poll_answer_"+(++idx)).length) {
				if(jQuery("#poll_answer_"+idx).val().length) {
					count++;
				}
				if (count > 1) return true;
			}
			e.preventDefault();
			alert("' . qa_lang('polls/choice_count_error') . '");
			return false;
		}
	}
</script>');
            } else {
                if ($this->template == 'question' && @$this->poll && !qa_user_permit_error('permit_post_q')) {
                    $this->output('<style>', str_replace('^', QA_HTML_THEME_LAYER_URLTOROOT, qa_opt('poll_css')), '</style>');
                    if (qa_permit_check('permit_vote_poll')) {
                        $this->output_raw("<script>\nfunction pollVote(qid,uid,vid,cancel) {\n\tvar dataString = 'ajax_poll_id='+qid+'&ajax_poll_voter='+uid+'&ajax_poll_vote='+vid+(cancel?'&ajax_poll_cancel='+cancel:'');  \n\tjQuery.ajax({  \n\t  type: 'POST',  \n\t  url: '" . qa_self_html() . "',  \n\t  data: dataString,  \n\t  success: function(data) {\n\t\tif(/^[\\t\\n ]*###/.exec(data)) {\n\t\t\tvar error = data.replace(/^[\\t\\n ]*### */,'');\n\t\t\twindow.alert(error);\n\t\t}\n\t\telse {\n\t\t\t\tjQuery('#qa-poll-div').html(data);\n\t\t}\n\t  }  \n\t});\n}\n</script>");
                    }
                }
            }
        }
        qa_html_theme_base::head_custom();
    }
Пример #28
0
 function head_custom()
 {
     $this->output('<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />');
     qa_html_theme_base::head_custom();
 }
Пример #29
0
 function head_custom()
 {
     qa_html_theme_base::head_custom();
 }