Commit 2f7d3efa by Scott

Combine JavaScript into one file

We now use qa-global.js for all the in-page JS (except for qa-admin.js
which regular visitors don’t need).
parent ce8c9c3e
......@@ -1662,7 +1662,6 @@ function qa_set_up_tag_field(&$qa_content, &$field, $fieldname, $tags, $examplet
{
$template = '<a href="#" class="qa-tag-link" onclick="return qa_tag_click(this);">^</a>';
$qa_content['script_rel'][] = 'qa-content/qa-ask.js?' . QA_VERSION;
$qa_content['script_var']['qa_tag_template'] = $template;
$qa_content['script_var']['qa_tag_onlycomma'] = (int)qa_opt('tag_separator_comma');
$qa_content['script_var']['qa_tags_examples'] = qa_html(implode(',', $exampletags));
......@@ -1736,7 +1735,6 @@ function qa_set_up_category_field(&$qa_content, &$field, $fieldname, $navcategor
else
$maxdepth = QA_CATEGORY_DEPTH;
$qa_content['script_rel'][] = 'qa-content/qa-ask.js?' . QA_VERSION;
$qa_content['script_onloads'][] = sprintf('qa_category_select(%s, %s);', qa_js($fieldname), qa_js($startpath));
$qa_content['script_var']['qa_cat_exclude'] = $excludecategoryid;
......
......@@ -821,7 +821,7 @@ function qa_content_prepare($voting = false, $categoryids = null)
}
$qa_content['script_rel'] = array('qa-content/jquery-1.11.3.min.js');
$qa_content['script_rel'][] = 'qa-content/qa-page.js?' . QA_VERSION;
$qa_content['script_rel'][] = 'qa-content/qa-global.js?' . QA_VERSION;
if ($voting)
$qa_content['error'] = @$qa_page_error_html;
......
......@@ -236,7 +236,6 @@ if (!strlen($custom)) {
}
if (qa_opt('do_ask_check_qs') || qa_opt('do_example_tags')) {
$qa_content['script_rel'][] = 'qa-content/qa-ask.js?'.QA_VERSION;
$qa_content['form']['fields']['title']['tags'] .= ' onchange="qa_title_change(this.value);"';
if (strlen(@$in['title'])) {
......
......@@ -75,7 +75,6 @@ $count = $numMessages['count'];
$qa_content = qa_content_prepare();
$qa_content['title'] = qa_lang_html($showOutbox ? 'misc/pm_outbox_title' : 'misc/pm_inbox_title');
$qa_content['script_rel'][] = 'qa-content/qa-user.js?' . QA_VERSION;
$qa_content['message_list'] = array(
'tags' => 'id="privatemessages"',
......
......@@ -219,8 +219,6 @@ if (isset($userid) && !$formrequested)
$qa_content['favorite'] = qa_favorite_form(QA_ENTITY_QUESTION, $questionid, $favorite,
qa_lang($favorite ? 'question/remove_q_favorites' : 'question/add_q_favorites'));
$qa_content['script_rel'][] = 'qa-content/qa-question.js?' . QA_VERSION;
if (isset($pageerror))
$qa_content['error'] = $pageerror; // might also show voting error set in qa-index.php
......
......@@ -345,8 +345,6 @@ if (isset($loginuserid) && $loginuserid != $useraccount['userid'] && !QA_FINAL_E
qa_lang_sub($favorite ? 'main/remove_x_favorites' : 'users/add_user_x_favorites', $handle));
}
$qa_content['script_rel'][] = 'qa-content/qa-user.js?' . QA_VERSION;
// General information about the user, only available if we're using internal user management
......
......@@ -99,8 +99,6 @@ $qa_content = qa_content_prepare();
$qa_content['title'] = qa_lang_html_sub('profile/wall_for_x', $userhtml);
$qa_content['error'] = @$errors['page'];
$qa_content['script_rel'][] = 'qa-content/qa-user.js?' . QA_VERSION;
$qa_content['message_list'] = array(
'tags' => 'id="wallmessages"',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment