本文整理汇总了PHP中qa_html_theme_base::head_script方法的典型用法代码示例。如果您正苦于以下问题:PHP qa_html_theme_base::head_script方法的具体用法?PHP qa_html_theme_base::head_script怎么用?PHP qa_html_theme_base::head_script使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qa_html_theme_base
的用法示例。
在下文中一共展示了qa_html_theme_base::head_script方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: head_script
function head_script()
{
qa_html_theme_base::head_script();
$url = qa_opt('site_url') . 'qa-plugin/ra-social/';
$this->output('<link rel="stylesheet" type="text/css" href="' . $url . 'style.css">');
$this->output('<script src="' . $url . 'script.js"></script>');
}
示例2: head_script
function head_script()
{
qa_html_theme_base::head_script();
if ($this->forbid_new_tag()) {
$this->output_raw("<script>\n" . "function qa_tag_verify()\n" . "{\n" . "\tvar tags = jQuery('#tags').val().split(' ');\n" . "\tvar alltags = ','+qa_tags_complete+',';\n" . "\tif ( jQuery('#tags').siblings('.qa-tag-synonyms-error').length > 0 )\n" . "\t\treturn false;\n\n" . "\tfor ( var i in tags )\n" . "\t{\n" . "\t\tif ( tags[i].length > 0 && alltags.indexOf(','+tags[i]+',') == -1 )\n" . "\t\t{\n" . "\t\t\tvar error = '<div style=\"display:none\" class=\"qa-form-tall-error qa-tag-synonyms-error\">The tag \"'+tags[i]+'\" does not exist; you need " . number_format(qa_opt('tag_synonyms_rep')) . " points to create new tags.</div>';\n" . "\t\t\tjQuery(error).insertAfter('#tags').slideDown('fast').delay(5000).slideUp('fast', function() { jQuery(this).detach() } );\n" . "\t\t\treturn false;\n" . "\t\t}\n" . "\t}\n\n" . "\tdocument.ask.submit();\n" . "}\n" . "</script>");
}
}
示例3: head_script
function head_script()
{
qa_html_theme_base::head_script();
if (qa_opt('voting_on_cs') && isset($this->content['q_view'])) {
$this->output("\n<script type='text/javascript'>\n\tfunction ajaxCommentVote(elem, oldvote)\n\t{\n\t\tvar ens=elem.getAttribute('name').split('_');\n\t\tvar postid=ens[1];\n\t\tvar vote=parseInt(ens[2]);\n\t\tvar anchor=ens[3];\n\t\tvar which=parseInt(ens[4]);\n\n\t\tvar dataString = 'ajax_comment_vote_id='+postid+'&ajax_comment_vote='+vote; \n\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\tif (json.status=='1') {\n\t\t\t\t\tswitch(vote) {\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\tvar up = 0;\n\t\t\t\t\t\t\tvar up_type = '-selected';\n\t\t\t\t\t\t\tvar down_type = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase -1:\n\t\t\t\t\t\t\tvar down = 0;\n\t\t\t\t\t\t\tvar up_type = false;\n\t\t\t\t\t\t\tvar down_type = '-selected';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\tvar up = 1;\n\t\t\t\t\t\t\tvar down = -1;\n\t\t\t\t\t\t\tvar up_type = '';\n\t\t\t\t\t\t\tvar down_type = '';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}" . (!qa_opt('voting_down_cs') ? "\n\t\t\t\t\t\n\t\t\t\t\tdown_type = false;\n" : "") . "\n\t\t\t\t\telem.parentNode.innerHTML = (up_type!==false?'<div class=\"comment-vote-item'+up_type+'\" name=\"vote_'+ens[1]+'_'+up+'_c'+ens[1]+'_1\" onclick=\"ajaxCommentVote(this);\" title=\"'+json.up+'\">▲</div>':'')+(parseInt(json.data)!=0?'<div id=\"voting_'+ens[1]+'\" title=\"json.up\">'+(json.data!='0'?json.data:'')+'</div>':'')+(down_type!==false?'<div class=\"comment-vote-item'+down_type+'\" name=\"vote_'+ens[1]+'_'+down+'_c'+ens[1]+'_-1\" onclick=\"ajaxCommentVote(this);\" title=\"'+json.down+'\">▼</div>':'');\n\n\t\t\t\t} else if (json.status=='0') {\n\t\t\t\t\tvar mess=document.getElementById('errorbox');\n\t\t\t\t\tif (!mess) {\n\t\t\t\t\t\tvar mess=document.createElement('div');\n\t\t\t\t\t\tmess.id='errorbox';\n\t\t\t\t\t\tmess.className='qa-error';\n\t\t\t\t\t\tmess.innerHTML=json.data;\n\t\t\t\t\t}\n\t\t\t\t\tvar postelem=document.getElementById(anchor);\n\t\t\t\t\tpostelem.parentNode.insertBefore(mess, postelem);\n\t\t\t\t} else {\n\t\t\t\t\talert('Unexpected response from server - please try again.');\n\t\t\t\t}\n\t\t\t} \n\t\t});\n\t\treturn false;\n\t} \t\n</script>");
}
}
示例4: head_script
function head_script()
{
qa_html_theme_base::head_script();
if (qa_opt('ajax_comment_enable') && !$this->qa_state && $this->template == 'question' && $this->can_comment) {
$this->output_raw("\n\t<style>\n\t\t.ajax-comment-hidden {\n\t\t\tdisplay:none;\n\t\t}\n\t\t.ajax-comment-reminder {\n\t\t\tfont-size:10px;\n\t\t\tfont-style:italic;\n\t\t}\n\t\t.ajax-comment-vote-popup {\n\t\t\tposition: absolute; \n\t\t\tbackground-color:yellow; \n\t\t\tpadding:10px;\n\t\t\tborder:1px solid; \n\t\t\tmargin-left:20px; \n\t\t\tmargin-top:45px; \n\t\t\ttext-align:justify; \n\t\t\twidth:250px; \n\t\t\tfont-weight:bold;\n\t\t\tcursor:pointer;\n\t\t\tdisplay:none;\n\t\t}\n\t</style>");
$this->output_raw("\n\t<script>\n\t\n\t\tfunction flashStar(idx) {\n\t\t\n\t\t\tvar star = jQuery('.qa-a-select-button').eq(idx-1);\n\t\t\tstar.attr('class','qa-a-select-hover');\n\t\t\tstar.fadeOut('slow').fadeIn('slow').fadeOut('slow').fadeIn('slow').fadeOut('slow').fadeIn('slow').fadeOut('slow').fadeIn('slow').fadeOut('slow').fadeIn('slow').fadeOut('slow',function(){\n\t\t\t\tstar.attr('class','qa-a-select-button').fadeIn('slow');\n\t\t\t});\n\t\t}\n\n\t\tfunction voteReminderNotice(elem,idx) {\n\t\t\tflashStar(idx);\n\t\t\tjQuery('<div class=\"ajax-comment-vote-popup\" onclick=\"this.style.display=\\'none\\';\">" . qa_html(qa_opt('ajax_comment_popup_notice_text')) . "</div>').insertAfter(elem.parentNode.parentNode).fadeIn('fast').delay(8000).fadeOut('slow');\n\t\t}\n\t\n\t\tvar ajax_comment_position = 0;\n\t\tvar ajax_comment_id = 0;\n\t\tvar ajax_comment_height = 0;\n\t\tfunction toggleComment(idx,username,flash) {\n\t\t\tjQuery('.ajax-comment').hide('slow');\n\t\t\t\n\t\t\tif(idx === false) {\n\t\t\t\tjQuery('textarea#comment').val('');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar cDiv = jQuery('#ajax-comment-'+idx);\n\t\t\t\n\t\t\tif(cDiv.length) {\n\t\t\t\tif(ajax_comment_position != idx) {\n\t\t\t\t\tcDiv.append(jQuery('#ajax-comment-'+ajax_comment_position).html());\n\t\t\t\t\tjQuery('#ajax-comment-'+ajax_comment_position).html('');\n\t\t\t\t\tajax_comment_position = idx;\n\t\t\t\t}\n\n\t\t\t\tif(!cDiv.is(':visible')) {\n\t\t\t\t\t\n\t\t\t\t\t// flash star\n\t\t\t\t\t\t\n\t\t\t\t\tif(flash && !jQuery('.qa-a-item-selected').length) flashStar(flash);\n\t\t\t\t\t\n\t\t\t\t\t// check if onscreen\n\t\t\t\t\t\n\t\t\t\t\tvar top = (-1)*jQuery('html').offset().top;\n\t\t\t\t\tvar cTop = cDiv.prev().offset().top + cDiv.prev().height();\n\t\t\t\t\tvar bot = top + jQuery(window).height();\n\t\t\t\t\t\n\t\t\t\t\tif (cTop > top && cTop < bot) {\n\t\t\t\t\t\tcDiv.show('slow',function(){\n\t\t\t\t\t\t\tjQuery('html').animate({scrollTop:(cDiv.offset().top-jQuery(window).height()+cDiv.height()+20)+'px'},{queue:false, duration:600, easing: 'swing'});\n\t\t\t\t\t\t\tjQuery('#ajax-comment-'+idx+' textarea#comment').focus();\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tcDiv.show();\n\t\t\t\t\t\tjQuery('html').animate({scrollTop:(cDiv.offset().top-jQuery(window).height()+cDiv.height()+20)+'px'},{queue:false, duration:600, easing: 'swing'});\n\t\t\t\t\t\tjQuery('#ajax-comment-'+idx+' textarea#comment').focus();\n\t\t\t\t\t}\n\n\t\t\t\t\tjQuery('#ajax-comment-'+idx+' textarea#comment').val((username?'@'+username+' ':''));\n\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif(username) {\n\t\t\t\t\t\tjQuery('#ajax-comment-'+idx+' textarea#comment').val(jQuery('#ajax-comment-'+idx+' textarea#comment').val()+'@'+username+' ');\n\t\t\t\t\t}\n\n\t\t\t\t\tjQuery('html').animate({scrollTop:(cDiv.offset().top-jQuery(window).height()+cDiv+20)+'px'},{queue:false, duration:600, easing: 'swing'});\n\t\t\t\t\tjQuery('#ajax-comment-'+idx+' textarea#comment').focus();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfunction ajaxPostComment() {\n\t\t\tvar cText = jQuery('#ajax-comment-'+ajax_comment_position+' textarea#comment');\n\t\t\tvar content = cText.val();\n\t\t\t\n\t\t\tvar notify = jQuery('#ajax-comment-'+(ajax_comment_position)+' input[name=\"notify\"]').attr('checked');\n\t\t\tvar email = jQuery('#ajax-comment-'+(ajax_comment_position)+' input[name=\"email\"]').val();\n\t\t\tvar editor = jQuery('#ajax-comment-'+(ajax_comment_position)+' input[name=\"editor\"]').val();\n\t\t\tvar oldcss = cText.css('background');\n\t\t\tcText.css('background','url(" . QA_HTML_THEME_LAYER_URLTOROOT . "ajax-loader.gif) no-repeat scroll center center silver');\n\t\t\t//cText.val('');\n\t\t\t\n\t\t\tvar dataString = 'ajax_id='+ajax_comment_position+'&ajax_comment_content='+content+(ajax_comment_position!=0?'&ajax_comment_id='+document.getElementById('ajax-comment-'+ajax_comment_position).getAttribute('value'):'')+(notify?'¬ify='+notify:'')+(email?'&email='+email:'')+(editor?'&editor='+editor:''); \n\t\t\tjQuery.ajax({ \n\t\t\t type: 'POST', \n\t\t\t url: '" . qa_self_html() . "', \n\t\t\t data: dataString, \n\t\t\t success: function(data) {\n\t\t\t\tif(/^[\\t\\n ]*###/.exec(data)) {\n\t\t\t\t\tvar error = data.replace(/^[\\t\\n ]*### */,'');\n\t\t\t\t\twindow.alert(error);\n\t\t\t\t\t//cText.val(content);\n\t\t\t\t}\n\t\t\t\telse if(ajax_comment_position == 0) {\n\t\t\t\t\tif(jQuery('.qa-q-view-c-list').length == 0) jQuery('<div class=\"qa-q-view-c-list\">'+data+'</div>').insertBefore('#ajax-comment-'+ajax_comment_position).find('div.qa-c-list-item:last').show('slow',function () {slideToDiv('.qa-q-view-c-list')});\n\t\t\t\t\telse jQuery('.qa-q-view-c-list').append(data).find('div.qa-c-list-item:last').show('slow',function () {slideToDiv('.qa-q-view-c-list')});\n\t\t\t\t\ttoggleComment(false);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif(!document.getElementById('ajax-comment-'+ajax_comment_position).getAttribute('comments')) {\n\t\t\t\t\t\tdocument.getElementById('ajax-comment-'+ajax_comment_position).setAttribute('comments','true');\n\t\t\t\t\t\tjQuery('<div class=\"qa-a-item-c-list\">'+data+'</div>').insertBefore('#ajax-comment-'+ajax_comment_position).find('div.qa-c-list-item:last').show('slow');\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tjQuery('.ajax-comment-idx-'+ajax_comment_position).append(data).find('div.qa-c-list-item:last').show('slow');\n\t\t\t\t\t}\n\t\t\t\t\ttoggleComment(false);\n\t\t\t\t}\n\t\t\t\tcText.css('background',oldcss);\n\t\t\t } \n\t\t\t});\n\t\t}\n\t\t\n\t\tfunction slideToDiv(div) {\n\t\t\tvar cDiv = jQuery(div);\n\t\t\tif(cDiv.length) {\n\t\t\t\tjQuery('html').animate({scrollTop:(cDiv.offset().top-jQuery(window).height()+cDiv.height()+20)+'px'},{queue:false, duration:600, easing: 'swing'});\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t</script>");
}
}
示例5: head_script
function head_script()
{
// insert Javascript into the <head>
$google_UA = qa_opt('google_analytics_UA');
$is_admin = qa_get_logged_in_level() == 120 ? true : false;
if (!empty($google_UA)) {
if (!($is_admin && qa_opt('google_analytics_show_for_admin'))) {
// the loged in user is not the admin
$this->content['script'][] = '<script type="text/javascript">' . 'var _gaq = _gaq || [];' . '_gaq.push([\'_setAccount\', \'' . $google_UA . '\']);' . '_gaq.push([\'_trackPageview\']);' . '(function() {' . 'var ga = document.createElement(\'script\'); ga.type = \'text/javascript\'; ga.async = true;' . 'ga.src = (\'https:\' == document.location.protocol ? \'https://ssl\' : \'http://www\') + \'.google-analytics.com/ga.js\';' . 'var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(ga, s);' . '})();' . '</script>';
}
}
qa_html_theme_base::head_script();
}
示例6: head_script
function head_script()
{
qa_html_theme_base::head_script();
$js_paths = array('bootstrap' => 'js/bootstrap.min.js', 'donut' => 'js/donut.js');
if ($this->template == 'admin') {
$js_paths['admin'] = 'js/admin.js';
}
if (DONUT_ACTIVATE_PROD_MODE) {
$cdn_js_paths = array('bootstrap' => donut_opt::BS_JS_CDN);
unset($js_paths['bootstrap']);
$this->donut_resources($cdn_js_paths, 'js', TRUE);
}
$this->donut_resources($js_paths, 'js');
}
示例7: head_script
function head_script()
{
// insert Javascript into the <head>
$google_UA = qa_opt('google_analytics_UA');
$google_domain = qa_opt('google_analytics_domain');
$is_admin = qa_get_logged_in_level() == 120 ? true : false;
if (!empty($google_UA)) {
if (!($is_admin && qa_opt('google_analytics_show_for_admin'))) {
// the loged in user is not the admin
$this->content['script'][] = $google_UA;
}
}
qa_html_theme_base::head_script();
}
示例8:
function head_script()
{
parent::head_script();
$this->output('<script>');
$this->output('function dhp_ask_user_confirmation(event){');
$this->output('if(!confirm("' . dhp_lang('are_you_sure') . '")) {');
$this->output('event.preventDefault();');
$this->output('return false ;');
$this->output('}');
$this->output('else {');
$this->output('return true ;');
$this->output('}');
$this->output('}');
$this->output('</script>');
$this->output();
}
示例9: head_script
function head_script()
{
qa_html_theme_base::head_script();
$this->output('
<script type="text/javascript">
$(document).ready(function(){
$(".menu_show_hide").click(function(){
$(".qa-nav-main").slideToggle();
});
$(window).resize(function() {
if ($(window).width()>720) {$(".qa-nav-main").show();}
});
}
);
</script>');
}
示例10: head_script
public function head_script()
{
qa_html_theme_base::head_script();
if (qa_caching_main::now_caching()) {
//$this->output('<script src="'.qa_path('qa-plugin/q2a-caching/js/qa-caching.js', null, null, QA_URL_FORMAT_NEAT).'"></script>');
//$this->output('<script src="'.qa_path('qa-plugin/q2a-caching/js/qa-caching.min.js', null, null, QA_URL_FORMAT_NEAT).'"></script>');
// Output as inline script
$this->output('<script type="text/javascript">');
$scripts = file_get_contents(QA_PLUGIN_DIR . 'q2a-caching/js/qa-caching.js');
if (!empty($scripts)) {
$scripts = explode("\n", $scripts);
foreach ($scripts as $script) {
if (!empty($script)) {
$this->output_raw($script);
}
}
}
$this->output('</script>');
}
}
示例11: head_script
/**
* Adding theme javascripts
*
* @since Snow 1.4
*/
public function head_script()
{
$jsUrl = $this->rooturl . $this->js_dir . '/snow-core.js?' . QA_VERSION;
$this->content['script'][] = '<script src="' . $jsUrl . '"></script>';
parent::head_script();
}
示例12: head_script
public function head_script()
{
$jsUrl = $this->rooturl . $this->js_dir . 'snow-core.js?' . QA_VERSION;
$this->content['script'][] = '<script src="' . $jsUrl . '"></script>';
qa_html_theme_base::head_script();
}
示例13: head_script
function head_script()
{
qa_html_theme_base::head_script();
}
示例14: head_script
function head_script()
{
qa_html_theme_base::head_script();
$this->output('<script type="text/javascript">', "if (typeof qa_wysiwyg_editor_config == 'object')", "\tqa_wysiwyg_editor_config.skin='moono';", '</script>');
}
示例15: head_script
function head_script()
{
qa_html_theme_base::head_script();
// set JS variables
$variables = '';
$variables .= 'it_root_url = "' . MYTHEME_URL . '";';
$variables .= 'it_featured_url_abs = "' . qa_opt('it_featured_url_abs') . '";';
$variables .= 'it_ajax_category_url = "' . MYTHEME_URL . 'ajax_category.php";';
$variables .= 'it_new_category_icon = "' . qa_opt('it_new_cat_icon') . '";';
$variables .= 'it_ajax_featured_upload_url = "' . MYTHEME_URL . 'ajax_upload.php";';
$variables .= 'it_ajax_featured_delete_url = "' . MYTHEME_URL . 'ajax_delete.php";';
$variables .= 'it_ajax_infinite_page_url = "' . MYTHEME_URL . 'ajax_infinite_page.php";';
$variables .= 'it_ajax_infinite_page_number = 2;';
$variables .= 'it_ajax_infinite_page_items_count = ' . qa_opt('page_size_home') . ';';
if (qa_opt('it_infinite_scroll_auto_enable')) {
$variables .= 'it_ajax_infinite_autoload = 1;';
} else {
$variables .= 'it_ajax_infinite_autoload = 0;';
}
$this->output('<script>' . $variables . '</script>');
// prepare JS scripts include Bootstrap's JS file
$this->output('<script src="' . $this->rooturl . 'js/bootstrap.min.js" type="text/javascript"></script>');
$this->output('<script src="' . $this->rooturl . 'js/isotope.min.js" type="text/javascript"></script>');
$this->output('<script src="' . $this->rooturl . 'js/main.js" type="text/javascript"></script>');
if ($this->template == 'ask' or $this->template == 'question' && substr(qa_get_state(), 0, 4) == 'edit') {
$this->output('<script src="' . $this->rooturl . 'js/ask.js" type="text/javascript"></script>');
$this->output('<script src="' . $this->rooturl . 'js/magicsuggest.min.js" type="text/javascript"></script>');
$this->output('<script src="' . $this->rooturl . 'js/uploadfile.min.js" type="text/javascript"></script>');
}
if ($this->request == 'admin/it_options') {
$this->output('<script src="' . $this->rooturl . 'js/admin.js" type="text/javascript"></script>');
$this->output('<script src="' . $this->rooturl . 'js/jquery.uploadfile.min.js" type="text/javascript"></script>');
$this->output('<script src="' . $this->rooturl . 'js/chosen.jquery.min.js" type="text/javascript"></script>');
$this->output('<script src="' . $this->rooturl . 'js/spectrum.js" type="text/javascript"></script>');
}
}