diff options
Diffstat (limited to 'phpBB/styles/prosilver/template')
14 files changed, 150 insertions, 245 deletions
diff --git a/phpBB/styles/prosilver/template/forum_fn.js b/phpBB/styles/prosilver/template/forum_fn.js index 4fb8f7b284..693211983f 100644 --- a/phpBB/styles/prosilver/template/forum_fn.js +++ b/phpBB/styles/prosilver/template/forum_fn.js @@ -25,8 +25,19 @@ function popup(url, width, height, name) { /** * Jump to page */ -function jumpto() { - var page = prompt(jump_page, on_page); +function jumpto(item) { + if (!item || !item.length) { + item = $('a.pagination-trigger[data-lang-jump-page]'); + if (!item.length) { + return; + } + } + + var jump_page = item.attr('data-lang-jump-page'), + on_page = item.attr('data-on-page'), + per_page = item.attr('data-per-page'), + base_url = item.attr('data-base-url'), + page = prompt(jump_page, on_page); if (page !== null && !isNaN(page) && page == Math.floor(page) && page > 0) { if (base_url.indexOf('?') === -1) { @@ -266,8 +277,6 @@ function phpbb_check_key(event) { /** * Apply onkeypress event for forcing default submit button on ENTER key press -* The jQuery snippet used is based on http://greatwebguy.com/programming/dom/default-html-button-submit-on-enter-with-jquery/ -* The non-jQuery code is a mimick of the jQuery code ;) */ function apply_onkeypress_event() { jQuery('form input[type=text], form input[type=password]').on('keypress', function (e) { @@ -293,20 +302,137 @@ function apply_onkeypress_event() { jQuery(document).ready(apply_onkeypress_event); /** -* Adjust HTML code for IE8 and older versions +* Run MSN action +*/ +function msn_action(action, address) +{ + // Does the browser support the MSNM object? + var app = document.getElementById('objMessengerApp'); + + if (!app || !app.MyStatus) { + var lang = $('form[data-lang-im-msnm-browser]'); + if (lang.length) { + alert(lang.attr('data-lang-im-msnm-browser')); + } + return false; + } + + // Is MSNM connected? + if (app.MyStatus == 1) { + var lang = $('form[data-lang-im-msnm-connect]'); + if (lang.length) { + alert(lang.attr('data-lang-im-msnm-connect')); + } + return false; + } + + // Do stuff + try { + switch (action) { + case 'add': + app.AddContact(0, address); + break; + + case 'im': + app.InstantMessage(address); + break; + } + } + catch (e) { + return; + } +} + +/** +* Add to your contact list +*/ +function add_contact(address) +{ + msn_action('add', address); +} + +/** +* Write IM to contact +*/ +function im_contact(address) +{ + msn_action('im', address); +} + +/** +* Functions for user search popup +*/ +function insert_user(formId, value) +{ + var form = jQuery(formId), + formName = form.attr('data-form-name'), + fieldName = form.attr('data-field-name'), + item = opener.document.forms[formName][fieldName]; + + if (item.value.length && item.type == 'textarea') { + value = item.value + "\n" + value; + } + + item.value = value; +} + +function insert_marked_users(formId, users) +{ + if (typeof(users.length) == "undefined") + { + if (users.checked) + { + insert_user(formId, users.value); + } + } + else if (users.length > 0) + { + for (i = 0; i < users.length; i++) + { + if (users[i].checked) + { + insert_user(formId, users[i].value); + } + } + } + + self.close(); +} + +function insert_single_user(formId, user) +{ + insert_user(formId, user); + self.close(); +} + +/** +* Run onload functions */ (function($) { $(document).ready(function() { + // Focus forms + $('form[data-focus]:first').each(function() { + $('#' + this.getAttribute('data-focus')).focus(); + }); + + // Reset avatar dimensions when changing URL or EMAIL + $('input[data-reset-on-edit]').bind('keyup', function() { + $(this.getAttribute('data-reset-on-edit')).val(''); + }); + + // Pagination + $('a.pagination-trigger').click(function() { + jumpto($(this)); + }); + + // Adjust HTML code for IE8 and older versions var test = document.createElement('div'), oldBrowser = (typeof test.style.borderRadius == 'undefined'); delete test; - if (!oldBrowser) { - return; + if (oldBrowser) { + // Fix .linkslist.bulletin lists + $('ul.linklist.bulletin li:first-child, ul.linklist.bulletin li.rightside:last-child').addClass('no-bulletin'); } - - // Fix .linkslist.bulletin lists - $('ul.linklist.bulletin li:first-child, ul.linklist.bulletin li.rightside:last-child').addClass('no-bulletin'); }); })(jQuery); - diff --git a/phpBB/styles/prosilver/template/login_body.html b/phpBB/styles/prosilver/template/login_body.html index a1c2735ca9..38d9f8c68b 100644 --- a/phpBB/styles/prosilver/template/login_body.html +++ b/phpBB/styles/prosilver/template/login_body.html @@ -1,14 +1,6 @@ <!-- INCLUDE overall_header.html --> -<script type="text/javascript"> -// <![CDATA[ - onload_functions.push(function () { - document.getElementById("<!-- IF S_ADMIN_AUTH -->{PASSWORD_CREDENTIAL}<!-- ELSE -->{USERNAME_CREDENTIAL}<!-- ENDIF -->").focus(); - }); -// ]]> -</script> - -<form action="{S_LOGIN_ACTION}" method="post" id="login"> +<form action="{S_LOGIN_ACTION}" method="post" id="login" data-focus="<!-- IF S_ADMIN_AUTH -->{PASSWORD_CREDENTIAL}<!-- ELSE -->{USERNAME_CREDENTIAL}<!-- ENDIF -->"> <div class="panel"> <div class="inner"> diff --git a/phpBB/styles/prosilver/template/memberlist_body.html b/phpBB/styles/prosilver/template/memberlist_body.html index 459c3f6bc6..46b35eae2c 100644 --- a/phpBB/styles/prosilver/template/memberlist_body.html +++ b/phpBB/styles/prosilver/template/memberlist_body.html @@ -1,7 +1,7 @@ <!-- IF S_IN_SEARCH_POPUP --> <!-- INCLUDE simple_header.html --> <!-- INCLUDE memberlist_search.html --> - <form method="post" id="results" action="{S_MODE_ACTION}" onsubmit="insert_marked(this.user); return false"> + <form method="post" id="results" action="{S_MODE_ACTION}" onsubmit="insert_marked_users('#results', this.user); return false;" data-form-name="{S_FORM_NAME}" data-field-name="{S_FIELD_NAME}"> <!-- ELSE --> <!-- INCLUDE overall_header.html --> @@ -109,7 +109,7 @@ <!-- ENDIF --> <tr class="<!-- IF memberrow.S_ROW_COUNT is even -->bg1<!-- ELSE -->bg2<!-- ENDIF -->"> - <td><!-- IF memberrow.RANK_IMG --><span class="rank-img">{memberrow.RANK_IMG}</span><!-- ELSE --><span class="rank-img">{memberrow.RANK_TITLE}</span><!-- ENDIF --><!-- IF S_IN_SEARCH_POPUP and not S_SELECT_SINGLE --><input type="checkbox" name="user" value="{memberrow.USERNAME}" /> <!-- ENDIF --><!-- EVENT memberlist_body_username_prepend -->{memberrow.USERNAME_FULL}<!-- EVENT memberlist_body_username_append --><!-- IF S_SELECT_SINGLE --><br />[ <a href="#" onclick="insert_single('{memberrow.A_USERNAME}'); return false;">{L_SELECT}</a> ]<!-- ENDIF --></td> + <td><!-- IF memberrow.RANK_IMG --><span class="rank-img">{memberrow.RANK_IMG}</span><!-- ELSE --><span class="rank-img">{memberrow.RANK_TITLE}</span><!-- ENDIF --><!-- IF S_IN_SEARCH_POPUP and not S_SELECT_SINGLE --><input type="checkbox" name="user" value="{memberrow.USERNAME}" /> <!-- ENDIF --><!-- EVENT memberlist_body_username_prepend -->{memberrow.USERNAME_FULL}<!-- EVENT memberlist_body_username_append --><!-- IF S_IN_SEARCH_POPUP --><br />[ <a href="#" onclick="insert_single_user('#results', '{memberrow.A_USERNAME}'); return false;">{L_SELECT}</a> ]<!-- ENDIF --></td> <td class="posts"><!-- IF memberrow.POSTS and S_DISPLAY_SEARCH --><a href="{memberrow.U_SEARCH_USER}" title="{L_SEARCH_USER_POSTS}">{memberrow.POSTS}</a><!-- ELSE -->{memberrow.POSTS}<!-- ENDIF --></td> <td class="info"><!-- IF memberrow.U_WWW or memberrow.LOCATION --><!-- IF memberrow.U_WWW --><div><a href="{memberrow.U_WWW}" title="{L_VISIT_WEBSITE}{L_COLON} {memberrow.U_WWW}">{memberrow.U_SHORT_WWW}</a></div><!-- ENDIF --><!-- IF memberrow.LOCATION --><div>{memberrow.LOCATION}</div><!-- ENDIF --><!-- ELSE --> <!-- ENDIF --></td> <td>{memberrow.JOINED}</td> diff --git a/phpBB/styles/prosilver/template/memberlist_im.html b/phpBB/styles/prosilver/template/memberlist_im.html index 68aed0b3dd..8e7842e631 100644 --- a/phpBB/styles/prosilver/template/memberlist_im.html +++ b/phpBB/styles/prosilver/template/memberlist_im.html @@ -3,7 +3,7 @@ <!-- MSNM info from http://www.cdolive.net/ - doesn't seem to work with MSN Messenger --> <h2 class="solo">{L_SEND_IM}</h2> -<form method="post" action="{S_IM_ACTION}"> +<form method="post" action="{S_IM_ACTION}" data-lang-im-msnm-connect="{L_IM_MSNM_CONNECT|e('html_attr')}" data-lang-im-msnm-browser="{L_IM_MSNM_BROWSER|e('html_attr')}"> <div class="panel bg2"> <div class="inner"> @@ -85,74 +85,4 @@ <a href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a> -<script type="text/javascript"> -// <![CDATA[ - - /** The following will not work with Windows Vista **/ - - var app = document.getElementById('objMessengerApp'); - - /** - * Check whether the browser supports this and whether MSNM is connected - */ - function msn_supported() - { - // Does the browser support the MSNM object? - if (app.MyStatus) - { - // Is MSNM connected? - if (app.MyStatus == 1) - { - alert('{LA_IM_MSNM_CONNECT}'); - return false; - } - } - else - { - alert('{LA_IM_MSNM_BROWSER}'); - return false; - } - return true; - } - - /** - * Add to your contact list - */ - function add_contact(address) - { - if (msn_supported()) - { - // Could return an error while MSNM is connecting, don't want that - try - { - app.AddContact(0, address); - } - catch (e) - { - return; - } - } -} - -/** -* Write IM to contact -*/ -function im_contact(address) -{ - if (msn_supported()) - { - // Could return an error while MSNM is connecting, don't want that - try - { - app.InstantMessage(address); - } - catch (e) - { - return; - } - } -} -// ]]> -</script> - <!-- INCLUDE simple_footer.html --> diff --git a/phpBB/styles/prosilver/template/memberlist_search.html b/phpBB/styles/prosilver/template/memberlist_search.html index f9538ef2e2..0b04d0087c 100644 --- a/phpBB/styles/prosilver/template/memberlist_search.html +++ b/phpBB/styles/prosilver/template/memberlist_search.html @@ -1,43 +1,3 @@ -<!-- IF S_IN_SEARCH_POPUP --> -<!-- You should retain this javascript in your own template! --> -<script type="text/javascript"> -// <![CDATA[ -function insert_user(user) -{ - opener.document.forms['{S_FORM_NAME}'].{S_FIELD_NAME}.value = ( opener.document.forms['{S_FORM_NAME}'].{S_FIELD_NAME}.value.length && opener.document.forms['{S_FORM_NAME}'].{S_FIELD_NAME}.type == "textarea" ) ? opener.document.forms['{S_FORM_NAME}'].{S_FIELD_NAME}.value + "\n" + user : user; -} - -function insert_marked(users) -{ - if (typeof(users.length) == "undefined") - { - if (users.checked) - { - insert_user(users.value); - } - } - else if (users.length > 0) - { - for (i = 0; i < users.length; i++) - { - if (users[i].checked) - { - insert_user(users[i].value); - } - } - } - - self.close(); -} - -function insert_single(user) -{ - opener.document.forms['{S_FORM_NAME}'].{S_FIELD_NAME}.value = user; - self.close(); -} -// ]]> -</script> -<!-- ENDIF --> <h2 class="solo">{L_FIND_USERNAME}</h2> <form method="post" action="{S_MODE_ACTION}" id="search_memberlist"> diff --git a/phpBB/styles/prosilver/template/overall_footer.html b/phpBB/styles/prosilver/template/overall_footer.html index b948d9f627..15a298053b 100644 --- a/phpBB/styles/prosilver/template/overall_footer.html +++ b/phpBB/styles/prosilver/template/overall_footer.html @@ -58,8 +58,8 @@ <script type="text/javascript" src="{T_JQUERY_LINK}"></script> <!-- IF S_JQUERY_FALLBACK --><script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript src="{T_ASSETS_PATH}/javascript/jquery.js?assets_version={T_ASSETS_VERSION}" type="text/javascript"%3E%3C/script%3E'));</script><!-- ENDIF --> +<script type="text/javascript" src="{T_ASSETS_PATH}/javascript/core.js?assets_version={T_ASSETS_VERSION}"></script> <!-- INCLUDEJS forum_fn.js --> -<!-- INCLUDEJS {T_ASSETS_PATH}/javascript/core.js --> <!-- INCLUDEJS ajax.js --> <!-- EVENT overall_footer_after --> diff --git a/phpBB/styles/prosilver/template/overall_header.html b/phpBB/styles/prosilver/template/overall_header.html index c1cdc0c223..0b0c7a4172 100644 --- a/phpBB/styles/prosilver/template/overall_header.html +++ b/phpBB/styles/prosilver/template/overall_header.html @@ -24,42 +24,6 @@ Modified by: --> -<script type="text/javascript"> -// <![CDATA[ - var jump_page = '{LA_JUMP_PAGE}{L_COLON}'; - var on_page = '{ON_PAGE}'; - var per_page = '{PER_PAGE}'; - var base_url = '{A_BASE_URL}'; - var onload_functions = new Array(); - var onunload_functions = new Array(); - - <!-- IF S_USER_PM_POPUP and S_NEW_PM --> - var url = '{UA_POPUP_PM}'; - window.open(url.replace(/&/g, '&'), '_phpbbprivmsg', 'height=225,resizable=yes,scrollbars=yes, width=400'); - <!-- ENDIF --> - - /** - * New function for handling multiple calls to window.onload and window.unload by pentapenguin - */ - window.onload = function() - { - for (var i = 0; i < onload_functions.length; i++) - { - onload_functions[i](); - } - }; - - window.onunload = function() - { - for (var i = 0; i < onunload_functions.length; i++) - { - onunload_functions[i](); - } - }; - -// ]]> -</script> - <link href="{T_THEME_PATH}/print.css?assets_version={T_ASSETS_VERSION}" rel="stylesheet" type="text/css" media="print" title="printonly" /> <link href="{T_STYLESHEET_LINK}" rel="stylesheet" type="text/css" media="screen, projection" /> <link href="{T_STYLESHEET_LANG_LINK}" rel="stylesheet" type="text/css" media="screen, projection" /> diff --git a/phpBB/styles/prosilver/template/pagination.html b/phpBB/styles/prosilver/template/pagination.html index 1c8441a9fd..172bc952e4 100644 --- a/phpBB/styles/prosilver/template/pagination.html +++ b/phpBB/styles/prosilver/template/pagination.html @@ -1,5 +1,4 @@ - - <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> • + <a href="#" class="pagination-trigger" title="{L_JUMP_TO_PAGE}" data-lang-jump-page="{L_JUMP_PAGE|e('html_attr')}{L_COLON}" data-on-page="{ON_PAGE}" data-per-page="{PER_PAGE}" data-base-url="{BASE_URL|e('html_attr')}">{PAGE_NUMBER}</a> • <ul> <!-- BEGIN pagination --> <!-- IF pagination.S_IS_PREV --> diff --git a/phpBB/styles/prosilver/template/search_body.html b/phpBB/styles/prosilver/template/search_body.html index fedbdc6642..d4c1f98a2a 100644 --- a/phpBB/styles/prosilver/template/search_body.html +++ b/phpBB/styles/prosilver/template/search_body.html @@ -1,16 +1,8 @@ <!-- INCLUDE overall_header.html --> -<script type="text/javascript"> -// <![CDATA[ - onload_functions.push(function () { - document.getElementById("keywords").focus(); - }); -// ]]> -</script> - <h2 class="solo">{L_SEARCH}</h2> -<form method="get" action="{S_SEARCH_ACTION}"> +<form method="get" action="{S_SEARCH_ACTION}" data-focus="keywords"> <div class="panel"> <div class="inner"> diff --git a/phpBB/styles/prosilver/template/simple_header.html b/phpBB/styles/prosilver/template/simple_header.html index 5bdc539f40..08b212363e 100644 --- a/phpBB/styles/prosilver/template/simple_header.html +++ b/phpBB/styles/prosilver/template/simple_header.html @@ -7,38 +7,6 @@ {META} <title>{SITENAME} • <!-- IF S_IN_MCP -->{L_MCP} • <!-- ELSEIF S_IN_UCP -->{L_UCP} • <!-- ENDIF -->{PAGE_TITLE}</title> -<script type="text/javascript"> -// <![CDATA[ - - var jump_page = '{LA_JUMP_PAGE}{L_COLON}'; - var on_page = '{ON_PAGE}'; - var per_page = '{PER_PAGE}'; - var base_url = '{A_BASE_URL}'; - var onload_functions = new Array(); - var onunload_functions = new Array(); - - /** - * New function for handling multiple calls to window.onload and window.unload by pentapenguin - */ - window.onload = function() - { - for (var i = 0; i < onload_functions.length; i++) - { - onload_functions[i](); - } - } - - window.onunload = function() - { - for (var i = 0; i < onunload_functions.length; i++) - { - onunload_functions[i](); - } - } - -// ]]> -</script> - <link href="{T_THEME_PATH}/print.css?assets_version={T_ASSETS_VERSION}" rel="stylesheet" type="text/css" media="print" title="printonly" /> <link href="{T_STYLESHEET_LINK}" rel="stylesheet" type="text/css" media="screen, projection" /> <link href="{T_STYLESHEET_LANG_LINK}" rel="stylesheet" type="text/css" media="screen, projection" /> diff --git a/phpBB/styles/prosilver/template/ucp_auth_link.html b/phpBB/styles/prosilver/template/ucp_auth_link.html index 3c56415db0..078da58d19 100644 --- a/phpBB/styles/prosilver/template/ucp_auth_link.html +++ b/phpBB/styles/prosilver/template/ucp_auth_link.html @@ -6,7 +6,9 @@ <div class="inner"> <!-- IF ERROR --><dl><dd class="error">{ERROR}</dd></dl><!-- ENDIF --> - <!-- INCLUDE {PROVIDER_TEMPLATE_FILE} --> + <!-- IF PROVIDER_TEMPLATE_FILE --> + <!-- INCLUDE {PROVIDER_TEMPLATE_FILE} --> + <!-- ENDIF --> </div> </div> diff --git a/phpBB/styles/prosilver/template/ucp_avatar_options_gravatar.html b/phpBB/styles/prosilver/template/ucp_avatar_options_gravatar.html index 88e0e69f53..b1076c2d14 100644 --- a/phpBB/styles/prosilver/template/ucp_avatar_options_gravatar.html +++ b/phpBB/styles/prosilver/template/ucp_avatar_options_gravatar.html @@ -1,20 +1,6 @@ -<script type="text/javascript"> -// <![CDATA[ - -onload_functions.push(function() { - $('#avatar_gravatar_email').bind('keyup', function () { - $('#avatar_gravatar_width').val(''); - $('#avatar_gravatar_height').val(''); - $('#avatar_gravatar_email').unbind('keyup'); - }); -}); - -// ]]> -</script> - <dl> <dt><label for="avatar_gravatar_email">{L_GRAVATAR_AVATAR_EMAIL}{L_COLON}</label><br /><span>{L_GRAVATAR_AVATAR_EMAIL_EXPLAIN}</span></dt> - <dd><input type="email" name="avatar_gravatar_email" id="avatar_gravatar_email" value="{AVATAR_GRAVATAR_EMAIL}" class="inputbox" /></dd> + <dd><input type="email" name="avatar_gravatar_email" id="avatar_gravatar_email" value="{AVATAR_GRAVATAR_EMAIL}" class="inputbox" data-reset-on-edit="#avatar_gravatar_width, #avatar_gravatar_height" /></dd> </dl> <dl> <dt><label for="avatar_gravatar_width">{L_GRAVATAR_AVATAR_SIZE}{L_COLON}</label><br /><span>{L_GRAVATAR_AVATAR_SIZE_EXPLAIN}</span></dt> diff --git a/phpBB/styles/prosilver/template/ucp_avatar_options_remote.html b/phpBB/styles/prosilver/template/ucp_avatar_options_remote.html index 59adf10058..a8f6135fb2 100644 --- a/phpBB/styles/prosilver/template/ucp_avatar_options_remote.html +++ b/phpBB/styles/prosilver/template/ucp_avatar_options_remote.html @@ -1,20 +1,6 @@ -<script type="text/javascript"> -// <![CDATA[ - -onload_functions.push(function() { - $('#avatar_remote_url').bind('keyup', function () { - $('#avatar_remote_width').val(''); - $('#avatar_remote_height').val(''); - $('#avatar_remote_url').unbind('keyup'); - }); -}); - -// ]]> -</script> - <dl> <dt><label for="avatar_remote_url">{L_LINK_REMOTE_AVATAR}{L_COLON}</label><br /><span>{L_LINK_REMOTE_AVATAR_EXPLAIN}</span></dt> - <dd><input type="url" name="avatar_remote_url" id="avatar_remote_url" value="{AVATAR_REMOTE_URL}" class="inputbox" /></dd> + <dd><input type="url" name="avatar_remote_url" id="avatar_remote_url" value="{AVATAR_REMOTE_URL}" class="inputbox" data-reset-on-edit="#avatar_remote_width, #avatar_remote_height" /></dd> </dl> <dl> <dt><label for="avatar_remote_width">{L_LINK_REMOTE_SIZE}{L_COLON}</label><br /><span>{L_LINK_REMOTE_SIZE_EXPLAIN}</span></dt> diff --git a/phpBB/styles/prosilver/template/ucp_notifications.html b/phpBB/styles/prosilver/template/ucp_notifications.html index 6a1d3b8de4..2088de49e8 100644 --- a/phpBB/styles/prosilver/template/ucp_notifications.html +++ b/phpBB/styles/prosilver/template/ucp_notifications.html @@ -83,7 +83,7 @@ </div> </dt> - <dd class="mark"> <!-- IF notification_list.UNREAD --><input type="checkbox" name="mark[]" value="{notification_list.NOTIFICATION_ID}" /> <dfn>{L_MARK_READ}</dfn><!-- ENDIF --> </dd> + <dd class="mark"> <input type="checkbox" name="mark[]" value="{notification_list.NOTIFICATION_ID}"<!-- IF not notification_list.UNREAD --> disabled="disabled"<!-- ENDIF --> /> <dfn>{L_MARK_READ}</dfn> </dd> </dl> </li> <!-- END notification_list --> |