[ticket/10155] Add jQuery, introduce global assets path

Add the jQuery JavaScript library to all pages, giving modifications
instant access and allowing for any future core JavaScript to take
advantage of it.

Also introduce a global /assets directory for assets that are shared
between styles.

PHPBB3-10155
This commit is contained in:
Igor Wiedler 2011-07-11 09:55:18 +02:00
parent 09e0460e5b
commit c945fc9355
13 changed files with 28 additions and 0 deletions

View file

@ -53,6 +53,7 @@ $mode = request_var('mode', '');
// Set custom template for admin area // Set custom template for admin area
$template->set_custom_template($phpbb_admin_path . 'style', 'admin'); $template->set_custom_template($phpbb_admin_path . 'style', 'admin');
$template->assign_var('T_ASSETS_PATH', $phpbb_root_path . 'assets');
$template->assign_var('T_TEMPLATE_PATH', $phpbb_admin_path . 'style'); $template->assign_var('T_TEMPLATE_PATH', $phpbb_admin_path . 'style');
// the acp template is never stored in the database // the acp template is never stored in the database

View file

@ -11,6 +11,7 @@
<link href="../adm/style/admin.css" rel="stylesheet" type="text/css" media="screen" /> <link href="../adm/style/admin.css" rel="stylesheet" type="text/css" media="screen" />
<script type="text/javascript" src="{T_ASSETS_PATH}/javascript/jquery.js"></script>
<script type="text/javascript"> <script type="text/javascript">
// <![CDATA[ // <![CDATA[

View file

@ -11,6 +11,7 @@
<link href="style/admin.css" rel="stylesheet" type="text/css" media="screen" /> <link href="style/admin.css" rel="stylesheet" type="text/css" media="screen" />
<script type="text/javascript" src="{T_ASSETS_PATH}/javascript/jquery.js"></script>
<script type="text/javascript"> <script type="text/javascript">
// <![CDATA[ // <![CDATA[
var jump_page = '{LA_JUMP_PAGE}:'; var jump_page = '{LA_JUMP_PAGE}:';

View file

@ -11,6 +11,7 @@
<link href="style/admin.css" rel="stylesheet" type="text/css" media="screen" /> <link href="style/admin.css" rel="stylesheet" type="text/css" media="screen" />
<script type="text/javascript" src="{T_ASSETS_PATH}/javascript/jquery.js"></script>
<script type="text/javascript"> <script type="text/javascript">
// <![CDATA[ // <![CDATA[
var jump_page = '{LA_JUMP_PAGE}:'; var jump_page = '{LA_JUMP_PAGE}:';

16
phpBB/assets/javascript/jquery.js vendored Normal file

File diff suppressed because one or more lines are too long

View file

@ -269,6 +269,7 @@ PHPBB_QA (Set board to QA-Mode, which means the updater also c
<p>Path locations for the following template variables are affected by this too:</p> <p>Path locations for the following template variables are affected by this too:</p>
<ul> <ul>
<li>{T_ASSETS_PATH} - assets</li>
<li>{T_THEME_PATH} - styles/xxx/theme</li> <li>{T_THEME_PATH} - styles/xxx/theme</li>
<li>{T_TEMPLATE_PATH} - styles/xxx/template</li> <li>{T_TEMPLATE_PATH} - styles/xxx/template</li>
<li>{T_SUPER_TEMPLATE_PATH} - styles/xxx/template</li> <li>{T_SUPER_TEMPLATE_PATH} - styles/xxx/template</li>

View file

@ -402,6 +402,7 @@ PHPBB_USE_BOARD_URL_PATH (use generate_board_url() for image paths instead of $p
<p>Path locations for the following template variables are affected by this too:</p> <p>Path locations for the following template variables are affected by this too:</p>
<ul> <ul>
<li>{T_ASSETS_PATH} - assets</li>
<li>{T_THEME_PATH} - styles/xxx/theme</li> <li>{T_THEME_PATH} - styles/xxx/theme</li>
<li>{T_TEMPLATE_PATH} - styles/xxx/template</li> <li>{T_TEMPLATE_PATH} - styles/xxx/template</li>
<li>{T_SUPER_TEMPLATE_PATH} - styles/xxx/template</li> <li>{T_SUPER_TEMPLATE_PATH} - styles/xxx/template</li>

View file

@ -4487,6 +4487,7 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
'S_SEARCH_HIDDEN_FIELDS' => build_hidden_fields($s_search_hidden_fields), 'S_SEARCH_HIDDEN_FIELDS' => build_hidden_fields($s_search_hidden_fields),
'T_ASSETS_PATH' => "{$web_path}assets",
'T_THEME_PATH' => "{$web_path}styles/" . $user->theme['theme_path'] . '/theme', 'T_THEME_PATH' => "{$web_path}styles/" . $user->theme['theme_path'] . '/theme',
'T_TEMPLATE_PATH' => "{$web_path}styles/" . $user->theme['template_path'] . '/template', 'T_TEMPLATE_PATH' => "{$web_path}styles/" . $user->theme['template_path'] . '/template',
'T_SUPER_TEMPLATE_PATH' => (isset($user->theme['template_inherit_path']) && $user->theme['template_inherit_path']) ? "{$web_path}styles/" . $user->theme['template_inherit_path'] . '/template' : "{$web_path}styles/" . $user->theme['template_path'] . '/template', 'T_SUPER_TEMPLATE_PATH' => (isset($user->theme['template_inherit_path']) && $user->theme['template_inherit_path']) ? "{$web_path}styles/" . $user->theme['template_inherit_path'] . '/template' : "{$web_path}styles/" . $user->theme['template_path'] . '/template',

View file

@ -203,6 +203,7 @@ $config = new phpbb_config(array(
)); ));
$template->set_custom_template('../adm/style', 'admin'); $template->set_custom_template('../adm/style', 'admin');
$template->assign_var('T_ASSETS_PATH', '../assets');
$template->assign_var('T_TEMPLATE_PATH', '../adm/style'); $template->assign_var('T_TEMPLATE_PATH', '../adm/style');
// the acp template is never stored in the database // the acp template is never stored in the database

View file

@ -34,6 +34,7 @@
about phpBB please visit http://www.phpbb.com about phpBB please visit http://www.phpbb.com
--> -->
<script type="text/javascript" src="{T_ASSETS_PATH}/javascript/jquery.js"></script>
<script type="text/javascript"> <script type="text/javascript">
// <![CDATA[ // <![CDATA[
var jump_page = '{LA_JUMP_PAGE}:'; var jump_page = '{LA_JUMP_PAGE}:';

View file

@ -13,6 +13,7 @@
{META} {META}
<title>{SITENAME} &bull; <!-- IF S_IN_MCP -->{L_MCP} &bull; <!-- ELSEIF S_IN_UCP -->{L_UCP} &bull; <!-- ENDIF -->{PAGE_TITLE}</title> <title>{SITENAME} &bull; <!-- IF S_IN_MCP -->{L_MCP} &bull; <!-- ELSEIF S_IN_UCP -->{L_UCP} &bull; <!-- ENDIF -->{PAGE_TITLE}</title>
<script type="text/javascript" src="{T_ASSETS_PATH}/javascript/jquery.js"></script>
<script type="text/javascript"> <script type="text/javascript">
// <![CDATA[ // <![CDATA[

View file

@ -25,6 +25,7 @@
<link rel="stylesheet" href="{T_STYLESHEET_LINK}" type="text/css" /> <link rel="stylesheet" href="{T_STYLESHEET_LINK}" type="text/css" />
<script type="text/javascript" src="{T_ASSETS_PATH}/javascript/jquery.js"></script>
<script type="text/javascript"> <script type="text/javascript">
// <![CDATA[ // <![CDATA[
<!-- IF S_USER_PM_POPUP and S_NEW_PM --> <!-- IF S_USER_PM_POPUP and S_NEW_PM -->

View file

@ -14,6 +14,7 @@
<title>{SITENAME} &bull; <!-- IF S_IN_MCP -->{L_MCP} &bull; <!-- ELSEIF S_IN_UCP -->{L_UCP} &bull; <!-- ENDIF -->{PAGE_TITLE}</title> <title>{SITENAME} &bull; <!-- IF S_IN_MCP -->{L_MCP} &bull; <!-- ELSEIF S_IN_UCP -->{L_UCP} &bull; <!-- ENDIF -->{PAGE_TITLE}</title>
<link rel="stylesheet" href="{T_STYLESHEET_LINK}" type="text/css" /> <link rel="stylesheet" href="{T_STYLESHEET_LINK}" type="text/css" />
<script type="text/javascript" src="{T_ASSETS_PATH}/javascript/jquery.js"></script>
</head> </head>
<body class="{S_CONTENT_DIRECTION}"> <body class="{S_CONTENT_DIRECTION}">